From d188092e3bf9f91d20473c3eac058b9bdcb53a4a Mon Sep 17 00:00:00 2001 From: Tim Deschryver <28659384+timdeschryver@users.noreply.github.com> Date: Sun, 21 Aug 2022 14:58:50 +0200 Subject: [PATCH] chore: run nx migrate --- apps/example-app-karma/project.json | 2 +- apps/example-app-karma/tsconfig.json | 4 +- .../{jest.config.js => jest.config.ts} | 6 +- apps/example-app/project.json | 4 +- apps/example-app/tsconfig.app.json | 2 +- apps/example-app/tsconfig.json | 4 +- apps/example-app/tsconfig.spec.json | 2 +- jest.config.js => jest.config.ts | 2 +- jest.preset.js | 3 +- nx.json | 17 ++- package.json | 107 +++++++++--------- .../{jest.config.js => jest.config.ts} | 4 +- projects/testing-library/project.json | 4 +- projects/testing-library/tsconfig.json | 4 +- projects/testing-library/tsconfig.lib.json | 2 +- .../testing-library/tsconfig.lib.prod.json | 3 +- projects/testing-library/tsconfig.spec.json | 2 +- 17 files changed, 90 insertions(+), 82 deletions(-) rename apps/example-app/{jest.config.js => jest.config.ts} (67%) rename jest.config.js => jest.config.ts (81%) rename projects/testing-library/{jest.config.js => jest.config.ts} (73%) diff --git a/apps/example-app-karma/project.json b/apps/example-app-karma/project.json index 94b4a463..75e38aab 100644 --- a/apps/example-app-karma/project.json +++ b/apps/example-app-karma/project.json @@ -1,6 +1,6 @@ { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", - "root": "apps/example-app-karma", "sourceRoot": "apps/example-app-karma/src", "prefix": "app", "generators": {}, diff --git a/apps/example-app-karma/tsconfig.json b/apps/example-app-karma/tsconfig.json index 0cfe7c56..9453a196 100644 --- a/apps/example-app-karma/tsconfig.json +++ b/apps/example-app-karma/tsconfig.json @@ -2,7 +2,9 @@ "extends": "../../tsconfig.base.json", "files": [], "include": [], - "compilerOptions": {}, + "compilerOptions": { + "target": "es2020" + }, "angularCompilerOptions": { "strictInjectionParameters": true, "strictInputAccessModifiers": true, diff --git a/apps/example-app/jest.config.js b/apps/example-app/jest.config.ts similarity index 67% rename from apps/example-app/jest.config.js rename to apps/example-app/jest.config.ts index 2be66c61..4b0c248c 100644 --- a/apps/example-app/jest.config.js +++ b/apps/example-app/jest.config.ts @@ -1,7 +1,7 @@ -module.exports = { - name: 'Example App', +/* eslint-disable */ +export default { displayName: { - name: 'Example', + name: 'Example App', color: 'blue', }, preset: '../../jest.preset.js', diff --git a/apps/example-app/project.json b/apps/example-app/project.json index ebab97cb..dcc8b341 100644 --- a/apps/example-app/project.json +++ b/apps/example-app/project.json @@ -1,6 +1,6 @@ { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "application", - "root": "apps/example-app", "sourceRoot": "apps/example-app/src", "prefix": "app", "generators": {}, @@ -73,7 +73,7 @@ "test": { "executor": "@nrwl/jest:jest", "options": { - "jestConfig": "apps/example-app/jest.config.js" + "jestConfig": "apps/example-app/jest.config.ts" }, "outputs": ["coverage/"] } diff --git a/apps/example-app/tsconfig.app.json b/apps/example-app/tsconfig.app.json index 04fbd826..ab030646 100644 --- a/apps/example-app/tsconfig.app.json +++ b/apps/example-app/tsconfig.app.json @@ -8,5 +8,5 @@ }, "files": ["src/main.ts", "src/polyfills.ts"], "include": ["src/**/*.d.ts"], - "exclude": ["**/*.test.ts", "**/*.spec.ts"] + "exclude": ["**/*.test.ts", "**/*.spec.ts", "jest.config.ts"] } diff --git a/apps/example-app/tsconfig.json b/apps/example-app/tsconfig.json index 523f7fc7..c0e57dc9 100644 --- a/apps/example-app/tsconfig.json +++ b/apps/example-app/tsconfig.json @@ -2,7 +2,9 @@ "extends": "../../tsconfig.base.json", "files": [], "include": [], - "compilerOptions": {}, + "compilerOptions": { + "target": "es2020" + }, "angularCompilerOptions": { "strictInjectionParameters": true, "strictInputAccessModifiers": true, diff --git a/apps/example-app/tsconfig.spec.json b/apps/example-app/tsconfig.spec.json index d8a4c20f..83f36dfd 100644 --- a/apps/example-app/tsconfig.spec.json +++ b/apps/example-app/tsconfig.spec.json @@ -6,5 +6,5 @@ "types": ["jest", "node", "@testing-library/jest-dom"] }, "files": ["src/test-setup.ts"], - "include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"] + "include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts", "jest.config.ts"] } diff --git a/jest.config.js b/jest.config.ts similarity index 81% rename from jest.config.js rename to jest.config.ts index 42c86fd0..dafe1653 100644 --- a/jest.config.js +++ b/jest.config.ts @@ -1,5 +1,5 @@ const { getJestProjects } = require('@nrwl/jest'); -module.exports = { +export default { projects: getJestProjects(), }; diff --git a/jest.preset.js b/jest.preset.js index c9b13e14..39f74f07 100644 --- a/jest.preset.js +++ b/jest.preset.js @@ -1,4 +1,5 @@ -const nxPreset = require('@nrwl/jest/preset'); +const nxPreset = require('@nrwl/jest/preset').default; + module.exports = { ...nxPreset, testMatch: ['**/+(*.)+(spec|test).+(ts|js)?(x)'], diff --git a/nx.json b/nx.json index d8e87c08..e7ffe758 100644 --- a/nx.json +++ b/nx.json @@ -34,14 +34,6 @@ } } }, - "targetDependencies": { - "build": [ - { - "target": "build", - "projects": "dependencies" - } - ] - }, "generators": { "@nrlw/workspace:library": { "linter": "eslint", @@ -60,7 +52,6 @@ "tags": ["type:app"] }, "@nrwl/angular:library": { - "style": "scss", "linter": "eslint", "unitTestRunner": "jest", "strict": true, @@ -80,5 +71,11 @@ } } }, - "defaultProject": "example-app" + "defaultProject": "example-app", + "$schema": "./node_modules/nx/schemas/nx-schema.json", + "targetDefaults": { + "build": { + "dependsOn": ["^build"] + } + } } diff --git a/package.json b/package.json index 219e6784..447d18ef 100644 --- a/package.json +++ b/package.json @@ -4,12 +4,12 @@ "scripts": { "ng": "nx", "nx": "nx", - "postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2015 browser module main", + "postinstall": "node ./decorate-angular-cli.js && ngcc --properties es2020 browser module main", "start": "nx serve", "prebuild": "rimraf dist", "build": "nx run-many --target=build --projects=testing-library", "build:schematics": "tsc -p ./projects/testing-library/tsconfig.schematics.json", - "test": "nx run-many --target=test --all", + "test": "nx run-many --target=test --all --parallel=1", "lint": "nx workspace-lint && nx lint", "e2e": "nx e2e", "affected:apps": "nx affected:apps", @@ -28,77 +28,80 @@ "prepare": "git config core.hookspath .githooks" }, "dependencies": { - "@angular/animations": "14.0.0", - "@angular/cdk": "14.0.0", - "@angular/common": "14.0.0", - "@angular/compiler": "14.0.0", - "@angular/core": "14.0.0", - "@angular/material": "14.0.0", - "@angular/platform-browser": "14.0.0", - "@angular/platform-browser-dynamic": "14.0.0", - "@angular/router": "14.0.0", - "@ngrx/store": "14.0.0-beta.0", - "@nrwl/angular": "13.4.3", - "@nrwl/nx-cloud": "13.0.2", + "@angular/animations": "14.1.3", + "@angular/cdk": "14.1.3", + "@angular/common": "14.1.3", + "@angular/compiler": "14.1.3", + "@angular/core": "14.1.3", + "@angular/material": "14.1.3", + "@angular/platform-browser": "14.1.3", + "@angular/platform-browser-dynamic": "14.1.3", + "@angular/router": "14.1.3", + "@ngrx/store": "14.0.2", + "@nrwl/angular": "14.5.8", + "@nrwl/nx-cloud": "14.4.1", "@testing-library/dom": "^8.11.1", - "rxjs": "^7.5.1", + "rxjs": "7.5.6", "tslib": "~2.3.1", "zone.js": "~0.11.4" }, "devDependencies": { - "@angular-devkit/build-angular": "14.0.0", - "@angular-eslint/builder": "14.0.0", - "@angular-eslint/eslint-plugin": "14.0.0", - "@angular-eslint/eslint-plugin-template": "14.0.0", - "@angular-eslint/schematics": "14.0.0", - "@angular-eslint/template-parser": "14.0.0", - "@angular/cli": "14.0.0", - "@angular/compiler-cli": "14.0.0", - "@angular/forms": "14.0.0", - "@angular/language-service": "14.0.0", - "@nrwl/cli": "13.4.3", - "@nrwl/eslint-plugin-nx": "13.4.3", - "@nrwl/jest": "13.4.3", - "@nrwl/linter": "13.4.3", - "@nrwl/node": "13.4.3", - "@nrwl/nx-plugin": "13.4.3", - "@nrwl/workspace": "13.4.3", + "@angular-devkit/build-angular": "14.1.3", + "@angular-eslint/builder": "14.0.2", + "@angular-eslint/eslint-plugin": "14.0.2", + "@angular-eslint/eslint-plugin-template": "14.0.2", + "@angular-eslint/schematics": "14.0.2", + "@angular-eslint/template-parser": "14.0.2", + "@angular/cli": "~14.1.0", + "@angular/compiler-cli": "14.1.3", + "@angular/forms": "14.1.3", + "@angular/language-service": "14.1.3", + "@nrwl/cli": "14.5.8", + "@nrwl/eslint-plugin-nx": "14.5.8", + "@nrwl/jest": "14.5.8", + "@nrwl/linter": "14.5.8", + "@nrwl/node": "14.5.8", + "@nrwl/nx-plugin": "14.5.8", + "@nrwl/workspace": "14.5.8", + "@swc-node/register": "^1.4.2", + "@swc/core": "^1.2.173", "@testing-library/jasmine-dom": "^1.2.0", "@testing-library/jest-dom": "^5.15.1", "@testing-library/user-event": "^13.5.0", - "@types/jasmine": "^3.10.2", - "@types/jest": "27.4.0", - "@types/node": "14.14.37", - "@typescript-eslint/eslint-plugin": "~5.3.0", - "@typescript-eslint/parser": "~5.3.0", + "@types/jasmine": "4.0.3", + "@types/jest": "28.1.7", + "@types/node": "18.7.1", + "@typescript-eslint/eslint-plugin": "5.29.0", + "@typescript-eslint/parser": "5.29.0", "cpy-cli": "^3.1.1", - "eslint": "~8.6.0", + "eslint": "8.15.0", "eslint-config-prettier": "8.3.0", "eslint-plugin-import": "~2.25.4", "eslint-plugin-jasmine": "~4.1.3", "eslint-plugin-jest": "~25.3.4", "eslint-plugin-jest-dom": "~4.0.1", "eslint-plugin-testing-library": "~5.0.1", - "jasmine-core": "^3.10.1", - "jasmine-spec-reporter": "^7.0.0", - "jest": "28.1.1", + "jasmine-core": "4.2.0", + "jasmine-spec-reporter": "7.0.0", + "jest": "28.1.3", "jest-environment-jsdom": "^28.1.1", "jest-preset-angular": "12.1.0", - "karma": "^6.3.9", + "karma": "6.4.0", "karma-chrome-launcher": "^3.1.0", - "karma-jasmine": "^4.0.1", - "karma-jasmine-html-reporter": "^1.7.0", + "karma-jasmine": "5.1.0", + "karma-jasmine-html-reporter": "2.0.0", "lint-staged": "^12.1.6", - "ng-packagr": "14.0.0", + "ng-packagr": "14.1.0", + "nx": "14.5.8", "postcss": "^8.4.5", - "postcss-import": "^14.0.2", - "postcss-preset-env": "^7.2.0", - "postcss-url": "^10.1.3", - "prettier": "^2.4.1", + "postcss-import": "14.1.0", + "postcss-preset-env": "7.5.0", + "postcss-url": "10.1.3", + "prettier": "2.6.2", "rimraf": "^3.0.2", "semantic-release": "^18.0.0", - "ts-jest": "28.0.4", - "ts-node": "~10.4.0", - "typescript": "4.7.2" + "ts-jest": "28.0.8", + "ts-node": "10.9.1", + "typescript": "4.7.4" } } diff --git a/projects/testing-library/jest.config.js b/projects/testing-library/jest.config.ts similarity index 73% rename from projects/testing-library/jest.config.js rename to projects/testing-library/jest.config.ts index 216a1f4e..189e52f8 100644 --- a/projects/testing-library/jest.config.js +++ b/projects/testing-library/jest.config.ts @@ -1,5 +1,5 @@ -module.exports = { - name: 'Angular Testing Library', +/* eslint-disable */ +export default { displayName: { name: 'ATL', color: 'magenta', diff --git a/projects/testing-library/project.json b/projects/testing-library/project.json index 1caa86ee..88ff0a4c 100644 --- a/projects/testing-library/project.json +++ b/projects/testing-library/project.json @@ -1,6 +1,6 @@ { + "$schema": "../../node_modules/nx/schemas/project-schema.json", "projectType": "library", - "root": "projects/testing-library", "sourceRoot": "projects/testing-library/src", "prefix": "lib", "targets": { @@ -47,7 +47,7 @@ "test": { "executor": "@nrwl/jest:jest", "options": { - "jestConfig": "projects/testing-library/jest.config.js" + "jestConfig": "projects/testing-library/jest.config.ts" }, "outputs": ["coverage/projects/testing-library"] } diff --git a/projects/testing-library/tsconfig.json b/projects/testing-library/tsconfig.json index 24663f6f..21a2b8ef 100644 --- a/projects/testing-library/tsconfig.json +++ b/projects/testing-library/tsconfig.json @@ -13,7 +13,9 @@ "path": "./tsconfig.spec.json" } ], - "compilerOptions": {}, + "compilerOptions": { + "target": "es2020" + }, "angularCompilerOptions": { "strictInjectionParameters": true, "strictInputAccessModifiers": true, diff --git a/projects/testing-library/tsconfig.lib.json b/projects/testing-library/tsconfig.lib.json index 7d77d4c9..8d9b29fc 100644 --- a/projects/testing-library/tsconfig.lib.json +++ b/projects/testing-library/tsconfig.lib.json @@ -7,6 +7,6 @@ "inlineSources": true, "types": ["node", "jest"] }, - "exclude": ["src/test-setup.ts", "**/*.spec.ts", "**/*.test.ts"], + "exclude": ["src/test-setup.ts", "**/*.spec.ts", "**/*.test.ts", "jest.config.ts"], "include": ["**/*.ts"] } diff --git a/projects/testing-library/tsconfig.lib.prod.json b/projects/testing-library/tsconfig.lib.prod.json index 2a2faa88..bf43f045 100644 --- a/projects/testing-library/tsconfig.lib.prod.json +++ b/projects/testing-library/tsconfig.lib.prod.json @@ -5,5 +5,6 @@ }, "angularCompilerOptions": { "compilationMode": "partial" - } + }, + "exclude": ["jest.config.ts"] } diff --git a/projects/testing-library/tsconfig.spec.json b/projects/testing-library/tsconfig.spec.json index 73461f35..9fee53b3 100644 --- a/projects/testing-library/tsconfig.spec.json +++ b/projects/testing-library/tsconfig.spec.json @@ -5,5 +5,5 @@ "types": ["node", "jest", "@testing-library/jest-dom"] }, "files": ["test-setup.ts"], - "include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts"] + "include": ["**/*.spec.ts", "**/*.test.ts", "**/*.d.ts", "jest.config.ts"] }