Skip to content

Commit

Permalink
Merge pull request #1113 from SQ-UI/feature/bump-angular-version
Browse files Browse the repository at this point in the history
Feature/bump angular version
  • Loading branch information
samuil4 authored Jun 8, 2023
2 parents 827d760 + a290b8f commit d283bcf
Show file tree
Hide file tree
Showing 85 changed files with 25,180 additions and 27,654 deletions.
10 changes: 2 additions & 8 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ jobs:
- name: Install node.js
uses: actions/setup-node@v2
with:
node-version: '14'
node-version: '18'
check-latest: true

- name: Install dependencies
Expand All @@ -42,10 +42,4 @@ jobs:
with:
coverageCommand: npm run coverage
coverageLocations: |
${{github.workspace}}/coverage/ng-sq-common/lcov.info:lcov
${{github.workspace}}/coverage/ng-datatable/lcov.info:lcov
${{github.workspace}}/coverage/ng-datetime-picker/lcov.info:lcov
${{github.workspace}}/coverage/ng-sq-ui/lcov.info:lcov
${{github.workspace}}/coverage/ng-modal/lcov.info:lcov
${{github.workspace}}/coverage/ng-form-elements/lcov.info:lcov
${{github.workspace}}/coverage/ng-progress-bar/lcov.info:lcov
${{github.workspace}}/coverage/lcov.info:lcov
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
!.vscode/extensions.json

# misc
/.angular/cache
/.sass-cache
/connect.lock
/coverage
Expand Down
3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,9 @@ Any types of public interfaces and services are also included.
- [Live examples](http://bit.ly/ng-sq-ui-docs-live-examples)
- [Troubleshooting](http://bit.ly/ng-sq-ui-docs-troubleshooting)

## BREAKING CHANGES:
The 2.0.1 relases of all packages are compatible with Angular 14+. If you need a backwards-compatible version, please refer to 1.x.y packages, as stated below.

**Note:**<br>
For projects that use the View Engine, instead Ivy (Angular 10 ~ Angular 12), please use the following version for each package:

Expand Down
120 changes: 30 additions & 90 deletions angular.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,63 +77,10 @@
}
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@angular-builders/jest:run",
"options": {
"main": "src/test.ts",
"polyfills": "src/polyfills.ts",
"tsConfig": "src/tsconfig.spec.json",
"karmaConfig": "src/karma.conf.js",
"codeCoverage": true,
"styles": [
"src/styles.scss"
],
"scripts": [],
"assets": [
"src/favicon.ico",
"src/assets"
]
}
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": [
"src/tsconfig.app.json",
"src/tsconfig.spec.json"
],
"exclude": [
"**/node_modules/**"
]
}
}
}
},
"sq-ui-e2e": {
"root": "e2e/",
"projectType": "application",
"architect": {
"e2e": {
"builder": "@angular-devkit/build-angular:protractor",
"options": {
"protractorConfig": "e2e/protractor.conf.js"
},
"configurations": {
"production": {
"devServerTarget": "sq-ui:serve:production"
},
"development": {
"devServerTarget": "sq-ui:serve:development"
}
},
"defaultConfiguration": "development"
},
"lint": {
"builder": "@angular-devkit/build-angular:tslint",
"options": {
"tsConfig": "e2e/tsconfig.e2e.json",
"exclude": [
"**/node_modules/**"
]
"configPath": "../../jest.config.js",
"no-cache": true
}
}
}
Expand All @@ -159,12 +106,10 @@
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@angular-builders/jest:run",
"options": {
"codeCoverage": true,
"main": "projects/ng-sq-ui/src/test.ts",
"tsConfig": "projects/ng-sq-ui/tsconfig.spec.json",
"karmaConfig": "projects/ng-sq-ui/karma.conf.js"
"configPath": "../../jest.config.js",
"no-cache": true
}
},
"lint": {
Expand Down Expand Up @@ -199,12 +144,10 @@
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@angular-builders/jest:run",
"options": {
"codeCoverage": true,
"main": "projects/ng-datetime-picker/src/test.ts",
"tsConfig": "projects/ng-datetime-picker/tsconfig.spec.json",
"karmaConfig": "projects/ng-datetime-picker/karma.conf.js"
"configPath": "../../jest.config.js",
"no-cache": true
}
},
"lint": {
Expand Down Expand Up @@ -239,12 +182,10 @@
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@angular-builders/jest:run",
"options": {
"codeCoverage": true,
"main": "projects/ng-datatable/src/test.ts",
"tsConfig": "projects/ng-datatable/tsconfig.spec.json",
"karmaConfig": "projects/ng-datatable/karma.conf.js"
"configPath": "../../jest.config.js",
"no-cache": true
}
},
"lint": {
Expand Down Expand Up @@ -279,12 +220,10 @@
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@angular-builders/jest:run",
"options": {
"codeCoverage": true,
"main": "projects/ng-sq-common/src/test.ts",
"tsConfig": "projects/ng-sq-common/tsconfig.spec.json",
"karmaConfig": "projects/ng-sq-common/karma.conf.js"
"configPath": "../../jest.config.js",
"no-cache": true
}
},
"lint": {
Expand Down Expand Up @@ -319,12 +258,10 @@
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@angular-builders/jest:run",
"options": {
"codeCoverage": true,
"main": "projects/ng-modal/src/test.ts",
"tsConfig": "projects/ng-modal/tsconfig.spec.json",
"karmaConfig": "projects/ng-modal/karma.conf.js"
"configPath": "../../jest.config.js",
"no-cache": true
}
},
"lint": {
Expand Down Expand Up @@ -360,11 +297,10 @@
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@angular-builders/jest:run",
"options": {
"main": "projects/ng-form-elements/src/test.ts",
"tsConfig": "projects/ng-form-elements/tsconfig.spec.json",
"karmaConfig": "projects/ng-form-elements/karma.conf.js"
"configPath": "../../jest.config.js",
"no-cache": true
}
}
}
Expand All @@ -391,24 +327,28 @@
"defaultConfiguration": "production"
},
"test": {
"builder": "@angular-devkit/build-angular:karma",
"builder": "@angular-builders/jest:run",
"options": {
"main": "projects/ng-progress-bar/src/test.ts",
"tsConfig": "projects/ng-progress-bar/tsconfig.spec.json",
"karmaConfig": "projects/ng-progress-bar/karma.conf.js"
"configPath": "../../jest.config.js",
"no-cache": true
}
}
}
}
},
"defaultProject": "sq-ui",
"schematics": {
"@schematics/angular:component": {
"prefix": "sq",
"style": "scss"
},
"@schematics/angular:directive": {
"prefix": "sq"
},
"@angular-eslint/schematics:application": {
"setParserOptionsProject": true
},
"@angular-eslint/schematics:library": {
"setParserOptionsProject": true
}
}
}
6 changes: 3 additions & 3 deletions docs/common-module.md
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ import { AfterViewInit } from '@angular/core';
export class ExampleComponent implements AfterViewInit {

listenForOutsideClick: boolean = false;

ngAfterViewInit() {
listenForOutsideClick = true;
this.listenForOutsideClick = true;
}

onClickOutsideComponent() {
Expand All @@ -54,7 +54,7 @@ export class ExampleComponent implements AfterViewInit {
```


## Services
## Services
### OSDetectorService

- **getDeviceOS():** [`DeviceOS`](enums.md??id=deviceos).
Expand Down
28 changes: 0 additions & 28 deletions e2e/protractor.conf.js

This file was deleted.

14 changes: 0 additions & 14 deletions e2e/src/app.e2e-spec.ts

This file was deleted.

11 changes: 0 additions & 11 deletions e2e/src/app.po.ts

This file was deleted.

13 changes: 0 additions & 13 deletions e2e/tsconfig.e2e.json

This file was deleted.

32 changes: 32 additions & 0 deletions jest.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
// weird issue with Jest after updating to Angular ver 14:
// https://github.com/nrwl/nx/issues/7844#issuecomment-1139427677
const esModules = ['@angular', 'tslib', 'rxjs'].join('|');

module.exports = {
preset: 'jest-preset-angular',
// verbose: true,
roots: ['projects'],
restoreMocks: true,
rootDir: './',
modulePaths: ['<rootDir>'],
modulePathIgnorePatterns: ['^.+\\.js$'],
testEnvironment: 'jsdom',
testMatch: ['**/?(*.)+(spec).ts?(x)'],
transform: {
'^.+\\.(ts|js|html)$': ['jest-preset-angular', {
tsconfig: '<rootDir>/tsconfig.spec.json',
allowSyntheticDefaultImports: true,
diagnostics: { warnOnly: true },
stringifyContentPathRegex: '\\.html$',
}],
},
moduleNameMapper: {
'^@sq-ui/ng-sq-common/(.*)$': '<rootDir>/projects/ng-sq-common/src/$1',
'@sq-ui/ng-sq-common': '<rootDir>/projects/ng-sq-common/src/index.ts',
},
moduleFileExtensions: ['ts', 'js', 'html'],
coverageReporters: ['html'],
setupFilesAfterEnv: ['<rootDir>/setup-jest.ts'],
transformIgnorePatterns: [`<rootDir>/node_modules/(?!.*\\.mjs$|${esModules})`],
coverageReporters: ["lcov", "text"],
};
Loading

0 comments on commit d283bcf

Please sign in to comment.