diff --git a/angular.json b/angular.json index 45579721f5..959042954f 100644 --- a/angular.json +++ b/angular.json @@ -19,41 +19,186 @@ } }, "projects": { - "example-app": { - "root": "projects/example-app", - "sourceRoot": "projects/example-app/src", + "component": { + "projectType": "library", + "root": "modules/component", + "sourceRoot": "modules/component/src", + "prefix": "ngrx", + "architect": { + "build-package": { + "builder": "@angular-devkit/build-angular:ng-packagr", + "options": { + "tsConfig": "modules/component/tsconfig.build.json", + "project": "modules/component/ng-package.json" + } + }, + "build": { + "builder": "@nrwl/workspace:run-commands", + "options": { + "parallel": false, + "commands": [ + { + "command": "ng run component:build-package" + }, + { + "command": "yarn tsc -p modules/component/tsconfig.schematics.json" + } + ], + "outputPath": ["dist/modules/component"] + } + }, + "lint": { + "builder": "@nrwl/linter:eslint", + "options": { + "lintFilePatterns": [ + "modules/component/*/**/*.ts", + "modules/component/*/**/*.html" + ] + }, + "outputs": ["{options.outputFile}"] + }, + "test": { + "builder": "@nrwl/jest:jest", + "options": { + "jestConfig": "modules/component/jest.config.js", + "runInBand": true + }, + "outputs": ["coverage/modules/component"] + } + }, + "schematics": {} + }, + "component-store": { + "projectType": "library", + "root": "modules/component-store", + "sourceRoot": "modules/component-store/src", + "prefix": "ngrx", + "architect": { + "build-package": { + "builder": "@angular-devkit/build-angular:ng-packagr", + "options": { + "tsConfig": "modules/component-store/tsconfig.build.json", + "project": "modules/component-store/ng-package.json" + } + }, + "build": { + "builder": "@nrwl/workspace:run-commands", + "options": { + "parallel": false, + "commands": [ + { + "command": "ng run component-store:build-package" + }, + { + "command": "yarn tsc -p modules/component-store/tsconfig.schematics.json" + } + ], + "outputPath": ["dist/modules/component-store"] + } + }, + "lint": { + "builder": "@nrwl/linter:eslint", + "options": { + "lintFilePatterns": [ + "modules/component-store/*/**/*.ts", + "modules/component-store/*/**/*.html" + ] + }, + "outputs": ["{options.outputFile}"] + }, + "test": { + "builder": "@nrwl/jest:jest", + "options": { + "jestConfig": "modules/component-store/jest.config.js", + "runInBand": true + }, + "outputs": ["coverage/modules/component-store"] + } + }, + "schematics": {} + }, + "data": { + "projectType": "library", + "root": "modules/data", + "sourceRoot": "modules/data/src", + "prefix": "ngrx", + "architect": { + "build-package": { + "builder": "@angular-devkit/build-angular:ng-packagr", + "options": { + "tsConfig": "modules/data/tsconfig.build.json", + "project": "modules/data/ng-package.json" + } + }, + "build": { + "builder": "@nrwl/workspace:run-commands", + "options": { + "parallel": false, + "commands": [ + { + "command": "ng run data:build-package" + }, + { + "command": "yarn tsc -p modules/data/tsconfig.schematics.json" + } + ], + "outputPath": ["dist/modules/data"] + } + }, + "lint": { + "builder": "@nrwl/linter:eslint", + "options": { + "lintFilePatterns": [ + "modules/data/*/**/*.ts", + "modules/data/*/**/*.html" + ] + }, + "outputs": ["{options.outputFile}"] + }, + "test": { + "builder": "@nrwl/jest:jest", + "options": { + "jestConfig": "modules/data/jest.config.js", + "runInBand": true + }, + "outputs": ["coverage/modules/data"] + } + }, + "schematics": {} + }, + "data-example-app": { "projectType": "application", - "prefix": "bc", - "schematics": {}, + "schematics": { + "@nrwl/angular:component": { + "style": "scss" + } + }, + "root": "projects/data-example-app", + "sourceRoot": "projects/data-example-app/src", + "prefix": "ngrx", "architect": { "build": { "builder": "@angular-devkit/build-angular:browser", "options": { + "outputPath": "dist/projects/data-example-app", + "index": "projects/data-example-app/src/index.html", + "main": "projects/data-example-app/src/main.ts", + "polyfills": "projects/data-example-app/src/polyfills.ts", + "tsConfig": "projects/data-example-app/tsconfig.app.json", "aot": true, - "outputPath": "dist/projects/example-app", - "index": "projects/example-app/src/index.html", - "main": "projects/example-app/src/main.ts", - "polyfills": "projects/example-app/src/polyfills.ts", - "tsConfig": "projects/example-app/tsconfig.app.json", "assets": [ - "projects/example-app/src/favicon.ico", - "projects/example-app/src/assets" + "projects/data-example-app/src/favicon.ico", + "projects/data-example-app/src/assets" ], - "styles": ["projects/example-app/src/styles.css"], + "styles": ["projects/data-example-app/src/styles.scss"], "scripts": [] }, "configurations": { "production": { - "budgets": [ - { - "type": "anyComponentStyle", - "maximumWarning": "6kb" - } - ], "fileReplacements": [ { - "replace": "projects/example-app/src/environments/environment.ts", - "with": "projects/example-app/src/environments/environment.prod.ts" + "replace": "projects/data-example-app/src/environments/environment.ts", + "with": "projects/data-example-app/src/environments/environment.prod.ts" } ], "optimization": true, @@ -62,7 +207,19 @@ "namedChunks": false, "extractLicenses": true, "vendorChunk": false, - "buildOptimizer": true + "buildOptimizer": true, + "budgets": [ + { + "type": "initial", + "maximumWarning": "2mb", + "maximumError": "5mb" + }, + { + "type": "anyComponentStyle", + "maximumWarning": "6kb", + "maximumError": "10kb" + } + ] } }, "outputs": ["{options.outputPath}"] @@ -70,121 +227,100 @@ "serve": { "builder": "@angular-devkit/build-angular:dev-server", "options": { - "browserTarget": "example-app:build" + "browserTarget": "data-example-app:build" }, "configurations": { "production": { - "browserTarget": "example-app:build:production" + "browserTarget": "data-example-app:build:production" } } }, "extract-i18n": { "builder": "@angular-devkit/build-angular:extract-i18n", "options": { - "browserTarget": "example-app:build" + "browserTarget": "data-example-app:build" } }, "lint": { "builder": "@nrwl/linter:eslint", "options": { "lintFilePatterns": [ - "projects/example-app/*/**/*.ts", - "projects/example-app/*/**/*.html" + "projects/data-example-app/*/**/*.ts", + "projects/data-example-app/*/**/*.html" ] - } + }, + "outputs": ["{options.outputFile}"] }, "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "projects/example-app/jest.config.js", - "runInBand": true - }, - "outputs": ["coverage/projects/example-app"] - } - } - }, - "example-app-e2e": { - "root": "projects/example-app-e2e", - "sourceRoot": "projects/example-app-e2e/src", - "projectType": "application", - "architect": { - "e2e": { - "builder": "@nrwl/cypress:cypress", - "options": { - "cypressConfig": "projects/example-app-e2e/cypress.json", - "tsConfig": "projects/example-app-e2e/tsconfig.e2e.json", - "devServerTarget": "example-app:serve" - }, - "configurations": { - "production": { - "devServerTarget": "example-app:serve:production" - } - } - }, - "lint": { - "builder": "@nrwl/linter:eslint", - "options": { - "lintFilePatterns": ["projects/example-app-e2e/**/*.{js,ts}"] + "jestConfig": "projects/data-example-app/jest.config.js", + "tsConfig": "projects/data-example-app/tsconfig.spec.json", + "passWithNoTests": true, + "setupFile": "projects/data-example-app/src/test-setup.ts" } } } }, - "store": { - "projectType": "library", - "root": "modules/store", - "sourceRoot": "modules/store/src", - "prefix": "ngrx", + "docs-app": { + "root": "projects/ngrx.io", + "sourceRoot": "projects/ngrx.io/src", + "projectType": "application", + "prefix": "aio", + "schematics": {}, "architect": { - "build-package": { - "builder": "@angular-devkit/build-angular:ng-packagr", - "options": { - "tsConfig": "modules/store/tsconfig.build.json", - "project": "modules/store/ng-package.json" - } - }, "build": { "builder": "@nrwl/workspace:run-commands", "options": { + "cwd": "projects/ngrx.io", "parallel": false, "commands": [ { - "command": "ng run store:build-package" + "command": "yarn setup" }, { - "command": "yarn tsc -p modules/store/tsconfig.schematics.json" + "command": "npm rebuild node-sass" }, { - "command": "yarn rimraf node_modules/@ngrx/store" + "command": "yarn build-for next --progress false && yarn copy-404-page" }, { - "command": "yarn mkdirp node_modules/@ngrx/store" + "command": "yarn --cwd ../../ cpy projects/ngrx.io/src/extra-files/next/*.* projects/ngrx.io/dist/ngrx.io/" }, { - "command": "ncp dist/modules/store node_modules/@ngrx/store" + "command": "yarn --cwd ../../ cpy projects/ngrx.io/src/extra-files/next/CNAME projects/ngrx.io/dist/ngrx.io/" } ], - "outputPath": ["dist/modules/store", "node_modules/@ngrx/store"] + "outputPath": ["projects/ngrx.io/dist/ngrx.io"] + }, + "outputs": ["{options.outputPath}"] + }, + "test": { + "builder": "@nrwl/workspace:run-commands", + "options": { + "cwd": "projects/ngrx.io", + "parallel": false, + "commands": [ + { + "command": "yarn --ignore-engines --frozen-lockfile --non-interactive" + }, + { + "command": "yarn test --watch=false" + } + ] } }, "lint": { "builder": "@nrwl/linter:eslint", "options": { "lintFilePatterns": [ - "modules/store/*/**/*.ts", - "modules/store/*/**/*.html" + "projects/ngrx.io/src/*/**/*.ts", + "projects/ngrx.io/src/*/**/*.html" ] - } - }, - "test": { - "builder": "@nrwl/jest:jest", - "options": { - "jestConfig": "modules/store/jest.config.js", - "runInBand": true }, - "outputs": ["coverage/modules/store"] + "outputs": ["{options.outputFile}"] } - }, - "schematics": {} + } }, "effects": { "projectType": "library", @@ -230,7 +366,8 @@ "modules/effects/*/**/*.ts", "modules/effects/*/**/*.html" ] - } + }, + "outputs": ["{options.outputFile}"] }, "test": { "builder": "@nrwl/jest:jest", @@ -243,54 +380,6 @@ }, "schematics": {} }, - "data": { - "projectType": "library", - "root": "modules/data", - "sourceRoot": "modules/data/src", - "prefix": "ngrx", - "architect": { - "build-package": { - "builder": "@angular-devkit/build-angular:ng-packagr", - "options": { - "tsConfig": "modules/data/tsconfig.build.json", - "project": "modules/data/ng-package.json" - } - }, - "build": { - "builder": "@nrwl/workspace:run-commands", - "options": { - "parallel": false, - "commands": [ - { - "command": "ng run data:build-package" - }, - { - "command": "yarn tsc -p modules/data/tsconfig.schematics.json" - } - ], - "outputPath": ["dist/modules/data"] - } - }, - "lint": { - "builder": "@nrwl/linter:eslint", - "options": { - "lintFilePatterns": [ - "modules/data/*/**/*.ts", - "modules/data/*/**/*.html" - ] - } - }, - "test": { - "builder": "@nrwl/jest:jest", - "options": { - "jestConfig": "modules/data/jest.config.js", - "runInBand": true - }, - "outputs": ["coverage/modules/data"] - } - }, - "schematics": {} - }, "entity": { "projectType": "library", "root": "modules/entity", @@ -335,7 +424,8 @@ "modules/entity/*/**/*.ts", "modules/entity/*/**/*.html" ] - } + }, + "outputs": ["{options.outputFile}"] }, "test": { "builder": "@nrwl/jest:jest", @@ -348,53 +438,117 @@ }, "schematics": {} }, - "store-devtools": { - "projectType": "library", - "root": "modules/store-devtools", - "sourceRoot": "modules/store-devtools/src", - "prefix": "ngrx", + "example-app": { + "root": "projects/example-app", + "sourceRoot": "projects/example-app/src", + "projectType": "application", + "prefix": "bc", + "schematics": {}, "architect": { - "build-package": { - "builder": "@angular-devkit/build-angular:ng-packagr", + "build": { + "builder": "@angular-devkit/build-angular:browser", "options": { - "tsConfig": "modules/store-devtools/tsconfig.build.json", - "project": "modules/store-devtools/ng-package.json" + "aot": true, + "outputPath": "dist/projects/example-app", + "index": "projects/example-app/src/index.html", + "main": "projects/example-app/src/main.ts", + "polyfills": "projects/example-app/src/polyfills.ts", + "tsConfig": "projects/example-app/tsconfig.app.json", + "assets": [ + "projects/example-app/src/favicon.ico", + "projects/example-app/src/assets" + ], + "styles": ["projects/example-app/src/styles.css"], + "scripts": [] + }, + "configurations": { + "production": { + "budgets": [ + { + "type": "anyComponentStyle", + "maximumWarning": "6kb" + } + ], + "fileReplacements": [ + { + "replace": "projects/example-app/src/environments/environment.ts", + "with": "projects/example-app/src/environments/environment.prod.ts" + } + ], + "optimization": true, + "outputHashing": "all", + "sourceMap": false, + "namedChunks": false, + "extractLicenses": true, + "vendorChunk": false, + "buildOptimizer": true + } + }, + "outputs": ["{options.outputPath}"] + }, + "serve": { + "builder": "@angular-devkit/build-angular:dev-server", + "options": { + "browserTarget": "example-app:build" + }, + "configurations": { + "production": { + "browserTarget": "example-app:build:production" + } } }, - "build": { - "builder": "@nrwl/workspace:run-commands", + "extract-i18n": { + "builder": "@angular-devkit/build-angular:extract-i18n", "options": { - "parallel": false, - "commands": [ - { - "command": "ng run store-devtools:build-package" - }, - { - "command": "yarn tsc -p modules/store-devtools/tsconfig.schematics.json" - } - ], - "outputPath": ["dist/modules/store-devtools"] + "browserTarget": "example-app:build" } }, "lint": { "builder": "@nrwl/linter:eslint", "options": { "lintFilePatterns": [ - "modules/store-devtools/*/**/*.ts", - "modules/store-devtools/*/**/*.html" + "projects/example-app/*/**/*.ts", + "projects/example-app/*/**/*.html" ] - } + }, + "outputs": ["{options.outputFile}"] }, "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "modules/store-devtools/jest.config.js", + "jestConfig": "projects/example-app/jest.config.js", "runInBand": true }, - "outputs": ["coverage/modules/store-devtools"] + "outputs": ["coverage/projects/example-app"] + } + } + }, + "example-app-e2e": { + "root": "projects/example-app-e2e", + "sourceRoot": "projects/example-app-e2e/src", + "projectType": "application", + "architect": { + "e2e": { + "builder": "@nrwl/cypress:cypress", + "options": { + "cypressConfig": "projects/example-app-e2e/cypress.json", + "tsConfig": "projects/example-app-e2e/tsconfig.e2e.json", + "devServerTarget": "example-app:serve" + }, + "configurations": { + "production": { + "devServerTarget": "example-app:serve:production" + } + } + }, + "lint": { + "builder": "@nrwl/linter:eslint", + "options": { + "lintFilePatterns": ["projects/example-app-e2e/**/*.{js,ts}"] + }, + "outputs": ["{options.outputFile}"] } - }, - "schematics": {} + } }, "router-store": { "projectType": "library", @@ -431,7 +585,8 @@ "modules/router-store/*/**/*.ts", "modules/router-store/*/**/*.html" ] - } + }, + "outputs": ["{options.outputFile}"] }, "test": { "builder": "@nrwl/jest:jest", @@ -457,7 +612,8 @@ "modules/schematics/*/**/*.ts", "modules/schematics/*/**/*.html" ] - } + }, + "outputs": ["{options.outputFile}"] }, "test": { "builder": "@nrwl/jest:jest", @@ -530,65 +686,44 @@ } } }, - "component": { + "schematics-core": { "projectType": "library", - "root": "modules/component", - "sourceRoot": "modules/component/src", + "root": "modules/schematics-core", + "sourceRoot": "modules/schematics-core/src", "prefix": "ngrx", "architect": { - "build-package": { - "builder": "@angular-devkit/build-angular:ng-packagr", - "options": { - "tsConfig": "modules/component/tsconfig.build.json", - "project": "modules/component/ng-package.json" - } - }, - "build": { - "builder": "@nrwl/workspace:run-commands", - "options": { - "parallel": false, - "commands": [ - { - "command": "ng run component:build-package" - }, - { - "command": "yarn tsc -p modules/component/tsconfig.schematics.json" - } - ], - "outputPath": ["dist/modules/component"] - } - }, "lint": { "builder": "@nrwl/linter:eslint", "options": { "lintFilePatterns": [ - "modules/component/*/**/*.ts", - "modules/component/*/**/*.html" + "modules/schematics-core/*/**/*.ts", + "modules/schematics-core/*/**/*.html" ] - } + }, + "outputs": ["{options.outputFile}"] }, "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "modules/component/jest.config.js", - "runInBand": true + "jestConfig": "modules/schematics-core/jest.config.js", + "passWithNoTests": true }, - "outputs": ["coverage/modules/component"] + "outputs": ["coverage/modules/schematics-core"] } }, "schematics": {} }, - "component-store": { + "store": { "projectType": "library", - "root": "modules/component-store", - "sourceRoot": "modules/component-store/src", + "root": "modules/store", + "sourceRoot": "modules/store/src", "prefix": "ngrx", "architect": { "build-package": { "builder": "@angular-devkit/build-angular:ng-packagr", "options": { - "tsConfig": "modules/component-store/tsconfig.build.json", - "project": "modules/component-store/ng-package.json" + "tsConfig": "modules/store/tsconfig.build.json", + "project": "modules/store/ng-package.json" } }, "build": { @@ -597,214 +732,93 @@ "parallel": false, "commands": [ { - "command": "ng run component-store:build-package" + "command": "ng run store:build-package" }, { - "command": "yarn tsc -p modules/component-store/tsconfig.schematics.json" + "command": "yarn tsc -p modules/store/tsconfig.schematics.json" + }, + { + "command": "yarn rimraf node_modules/@ngrx/store" + }, + { + "command": "yarn mkdirp node_modules/@ngrx/store" + }, + { + "command": "ncp dist/modules/store node_modules/@ngrx/store" } ], - "outputPath": ["dist/modules/component-store"] + "outputPath": ["dist/modules/store", "node_modules/@ngrx/store"] } }, "lint": { "builder": "@nrwl/linter:eslint", "options": { "lintFilePatterns": [ - "modules/component-store/*/**/*.ts", - "modules/component-store/*/**/*.html" + "modules/store/*/**/*.ts", + "modules/store/*/**/*.html" ] - } + }, + "outputs": ["{options.outputFile}"] }, "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "modules/component-store/jest.config.js", + "jestConfig": "modules/store/jest.config.js", "runInBand": true }, - "outputs": ["coverage/modules/component-store"] + "outputs": ["coverage/modules/store"] } }, "schematics": {} }, - "docs-app": { - "root": "projects/ngrx.io", - "sourceRoot": "projects/ngrx.io/src", - "projectType": "application", - "prefix": "aio", - "schematics": {}, + "store-devtools": { + "projectType": "library", + "root": "modules/store-devtools", + "sourceRoot": "modules/store-devtools/src", + "prefix": "ngrx", "architect": { - "build": { - "builder": "@nrwl/workspace:run-commands", + "build-package": { + "builder": "@angular-devkit/build-angular:ng-packagr", "options": { - "cwd": "projects/ngrx.io", - "parallel": false, - "commands": [ - { - "command": "yarn setup" - }, - { - "command": "npm rebuild node-sass" - }, - { - "command": "yarn build-for next --progress false && yarn copy-404-page" - }, - { - "command": "yarn --cwd ../../ cpy projects/ngrx.io/src/extra-files/next/*.* projects/ngrx.io/dist/ngrx.io/" - }, - { - "command": "yarn --cwd ../../ cpy projects/ngrx.io/src/extra-files/next/CNAME projects/ngrx.io/dist/ngrx.io/" - } - ], - "outputPath": ["projects/ngrx.io/dist/ngrx.io"] - }, - "outputs": ["{options.outputPath}"] + "tsConfig": "modules/store-devtools/tsconfig.build.json", + "project": "modules/store-devtools/ng-package.json" + } }, - "test": { + "build": { "builder": "@nrwl/workspace:run-commands", "options": { - "cwd": "projects/ngrx.io", "parallel": false, "commands": [ { - "command": "yarn --ignore-engines --frozen-lockfile --non-interactive" + "command": "ng run store-devtools:build-package" }, { - "command": "yarn test --watch=false" + "command": "yarn tsc -p modules/store-devtools/tsconfig.schematics.json" } - ] + ], + "outputPath": ["dist/modules/store-devtools"] } }, "lint": { "builder": "@nrwl/linter:eslint", "options": { "lintFilePatterns": [ - "projects/ngrx.io/src/*/**/*.ts", - "projects/ngrx.io/src/*/**/*.html" - ] - } - } - } - }, - "schematics-core": { - "projectType": "library", - "root": "modules/schematics-core", - "sourceRoot": "modules/schematics-core/src", - "prefix": "ngrx", - "architect": { - "lint": { - "builder": "@nrwl/linter:eslint", - "options": { - "lintFilePatterns": [ - "modules/schematics-core/*/**/*.ts", - "modules/schematics-core/*/**/*.html" + "modules/store-devtools/*/**/*.ts", + "modules/store-devtools/*/**/*.html" ] - } + }, + "outputs": ["{options.outputFile}"] }, "test": { "builder": "@nrwl/jest:jest", "options": { - "jestConfig": "modules/schematics-core/jest.config.js", - "passWithNoTests": true + "jestConfig": "modules/store-devtools/jest.config.js", + "runInBand": true }, - "outputs": ["coverage/modules/schematics-core"] + "outputs": ["coverage/modules/store-devtools"] } }, "schematics": {} - }, - "data-example-app": { - "projectType": "application", - "schematics": { - "@nrwl/angular:component": { - "style": "scss" - } - }, - "root": "projects/data-example-app", - "sourceRoot": "projects/data-example-app/src", - "prefix": "ngrx", - "architect": { - "build": { - "builder": "@angular-devkit/build-angular:browser", - "options": { - "outputPath": "dist/projects/data-example-app", - "index": "projects/data-example-app/src/index.html", - "main": "projects/data-example-app/src/main.ts", - "polyfills": "projects/data-example-app/src/polyfills.ts", - "tsConfig": "projects/data-example-app/tsconfig.app.json", - "aot": true, - "assets": [ - "projects/data-example-app/src/favicon.ico", - "projects/data-example-app/src/assets" - ], - "styles": ["projects/data-example-app/src/styles.scss"], - "scripts": [] - }, - "configurations": { - "production": { - "fileReplacements": [ - { - "replace": "projects/data-example-app/src/environments/environment.ts", - "with": "projects/data-example-app/src/environments/environment.prod.ts" - } - ], - "optimization": true, - "outputHashing": "all", - "sourceMap": false, - "namedChunks": false, - "extractLicenses": true, - "vendorChunk": false, - "buildOptimizer": true, - "budgets": [ - { - "type": "initial", - "maximumWarning": "2mb", - "maximumError": "5mb" - }, - { - "type": "anyComponentStyle", - "maximumWarning": "6kb", - "maximumError": "10kb" - } - ] - } - }, - "outputs": ["{options.outputPath}"] - }, - "serve": { - "builder": "@angular-devkit/build-angular:dev-server", - "options": { - "browserTarget": "data-example-app:build" - }, - "configurations": { - "production": { - "browserTarget": "data-example-app:build:production" - } - } - }, - "extract-i18n": { - "builder": "@angular-devkit/build-angular:extract-i18n", - "options": { - "browserTarget": "data-example-app:build" - } - }, - "lint": { - "builder": "@nrwl/linter:eslint", - "options": { - "lintFilePatterns": [ - "projects/data-example-app/*/**/*.ts", - "projects/data-example-app/*/**/*.html" - ] - } - }, - "test": { - "builder": "@nrwl/jest:jest", - "options": { - "jestConfig": "projects/data-example-app/jest.config.js", - "tsConfig": "projects/data-example-app/tsconfig.spec.json", - "passWithNoTests": true, - "setupFile": "projects/data-example-app/src/test-setup.ts" - } - } - } } } } diff --git a/jest.config.js b/jest.config.js index c1d55a3603..d08e9812cc 100644 --- a/jest.config.js +++ b/jest.config.js @@ -1,15 +1,3 @@ -module.exports = { - projects: [ - '/projects/example-app', - '/modules/store', - '/modules/effects', - '/modules/data', - '/modules/entity', - '/modules/store-devtools', - '/modules/router-store', - '/modules/schematics', - '/modules/component', - '/modules/component-store', - '/modules/schematics-core', - ], -}; +const { getJestProjects } = require('@nrwl/jest'); + +module.exports = { projects: getJestProjects() }; diff --git a/jest.preset.js b/jest.preset.js index ecb0b0990e..b74c21a409 100644 --- a/jest.preset.js +++ b/jest.preset.js @@ -8,4 +8,10 @@ module.exports = { resolver: '@nrwl/jest/plugins/resolver', moduleFileExtensions: ['ts', 'js', 'html'], coverageReporters: ['html'], + snapshotSerializers: [ + 'jest-preset-angular/build/serializers/no-ng-attributes', + 'jest-preset-angular/build/serializers/ng-snapshot', + 'jest-preset-angular/build/serializers/html-comment', + ], + testRunner: 'jest-jasmine2', }; diff --git a/migrations.json b/migrations.json new file mode 100644 index 0000000000..9010dd7632 --- /dev/null +++ b/migrations.json @@ -0,0 +1,83 @@ +{ + "migrations": [ + { + "version": "12.5.0-beta.1", + "description": "Rename the workspace-schematic script into workspace-generator script", + "factory": "./src/migrations/update-12-5-0/add-target-dependencies", + "cli": "nx", + "package": "@nrwl/workspace", + "name": "add-target-dependencies" + }, + { + "cli": "nx", + "version": "12.9.0", + "description": "Fixes invalid importPaths for buildable and publishable libs.", + "factory": "./src/migrations/update-12-9-0/update-invalid-import-paths", + "package": "@nrwl/angular", + "name": "update-invalid-import-paths" + }, + { + "version": "12.1.0", + "factory": "./update-12/replace-prod-flag", + "description": "Replace the deprecated '--prod' in package.json scripts.", + "package": "@angular/cli", + "name": "replace-deprecated-prod-flag" + }, + { + "cli": "nx", + "version": "12.8.0-beta.0", + "description": "Remove Typescript Preprocessor Plugin", + "factory": "./src/migrations/update-12-8-0/remove-typescript-plugin", + "package": "@nrwl/cypress", + "name": "remove-typescript-plugin" + }, + { + "version": "12.4.0-beta.1", + "cli": "nx", + "description": "Add testEnvironment: 'jsdom' in web apps + libraries", + "factory": "./src/migrations/update-12-4-0/add-test-environment-for-node", + "package": "@nrwl/jest", + "name": "support-jest-27" + }, + { + "version": "12.4.0-beta.1", + "cli": "nx", + "description": "Support for Jest 27 via updating ts-jest + jest-preset-angular", + "factory": "./src/migrations/update-12-4-0/update-jest-preset-angular", + "package": "@nrwl/jest", + "name": "update-ts-jest-and-jest-preset-angular" + }, + { + "version": "12.6.0-beta.0", + "cli": "nx", + "description": "Uses `getJestProjects()` to populate projects array in root level `jest.config.js` file.", + "factory": "./src/migrations/update-12-6-0/update-base-jest-config", + "package": "@nrwl/jest", + "name": "update-jest-config-to-use-util" + }, + { + "cli": "nx", + "version": "12.4.0-beta.0", + "description": "Remove ESLint parserOptions.project config if no rules requiring type-checking are in use", + "factory": "./src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules", + "package": "@nrwl/linter", + "name": "remove-eslint-project-config-if-no-type-checking-rules" + }, + { + "cli": "nx", + "version": "12.9.0-beta.0", + "description": "Add outputs for caching", + "factory": "./src/migrations/update-12-9-0/add-outputs", + "package": "@nrwl/linter", + "name": "add-outputs" + }, + { + "cli": "nx", + "version": "12.9.0-beta.0", + "description": "Remove ESLint parserOptions.project config if no rules requiring type-checking are in use", + "factory": "./src/migrations/update-12-4-0/remove-eslint-project-config-if-no-type-checking-rules", + "package": "@nrwl/linter", + "name": "remove-eslint-project-config-if-no-type-checking-rules-again" + } + ] +} diff --git a/modules/component-store/jest.config.js b/modules/component-store/jest.config.js index e191818c81..a797da8257 100644 --- a/modules/component-store/jest.config.js +++ b/modules/component-store/jest.config.js @@ -2,22 +2,13 @@ module.exports = { displayName: 'Component Store', preset: '../../jest.preset.js', coverageDirectory: '../../coverage/libs/component-store', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], + setupFilesAfterEnv: ['/test-setup.ts'], globals: { 'ts-jest': { tsconfig: '/tsconfig.spec.json', stringifyContentPathRegex: '\\.(html|svg)$', - astTransformers: { - before: [ - 'jest-preset-angular/build/InlineFilesTransformer', - 'jest-preset-angular/build/StripStylesTransformer', - ], - }, }, }, + transform: { '^.+\\.(ts|js|html)$': 'jest-preset-angular' }, }; diff --git a/modules/component-store/schematics-core/jest.config.js b/modules/component-store/schematics-core/jest.config.js index 167b6a9927..d27598e702 100644 --- a/modules/component-store/schematics-core/jest.config.js +++ b/modules/component-store/schematics-core/jest.config.js @@ -15,9 +15,4 @@ module.exports = { }, }, coverageDirectory: '../../coverage/modules/schematics-core', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], }; diff --git a/modules/component-store/schematics-core/test-setup.ts b/modules/component-store/schematics-core/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/component-store/schematics-core/test-setup.ts +++ b/modules/component-store/schematics-core/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/modules/component-store/test-setup.ts b/modules/component-store/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/component-store/test-setup.ts +++ b/modules/component-store/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/modules/component/jest.config.js b/modules/component/jest.config.js index 630956d075..fbc56090f3 100644 --- a/modules/component/jest.config.js +++ b/modules/component/jest.config.js @@ -6,18 +6,9 @@ module.exports = { 'ts-jest': { tsconfig: '/tsconfig.spec.json', stringifyContentPathRegex: '\\.(html|svg)$', - astTransformers: { - before: [ - 'jest-preset-angular/build/InlineFilesTransformer', - 'jest-preset-angular/build/StripStylesTransformer', - ], - }, }, }, setupFilesAfterEnv: ['/test-setup.ts'], - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], + + transform: { '^.+\\.(ts|js|html)$': 'jest-preset-angular' }, }; diff --git a/modules/component/schematics-core/jest.config.js b/modules/component/schematics-core/jest.config.js index 167b6a9927..d27598e702 100644 --- a/modules/component/schematics-core/jest.config.js +++ b/modules/component/schematics-core/jest.config.js @@ -15,9 +15,4 @@ module.exports = { }, }, coverageDirectory: '../../coverage/modules/schematics-core', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], }; diff --git a/modules/component/schematics-core/test-setup.ts b/modules/component/schematics-core/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/component/schematics-core/test-setup.ts +++ b/modules/component/schematics-core/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/modules/component/test-setup.ts b/modules/component/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/component/test-setup.ts +++ b/modules/component/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/modules/data/jest.config.js b/modules/data/jest.config.js index 7834dd02ea..2798c89201 100644 --- a/modules/data/jest.config.js +++ b/modules/data/jest.config.js @@ -2,22 +2,13 @@ module.exports = { displayName: 'Data', preset: '../../jest.preset.js', coverageDirectory: '../../coverage/modules/data', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], + setupFilesAfterEnv: ['/test-setup.ts'], globals: { 'ts-jest': { tsconfig: '/tsconfig.spec.json', stringifyContentPathRegex: '\\.(html|svg)$', - astTransformers: { - before: [ - 'jest-preset-angular/build/InlineFilesTransformer', - 'jest-preset-angular/build/StripStylesTransformer', - ], - }, }, }, + transform: { '^.+\\.(ts|js|html)$': 'jest-preset-angular' }, }; diff --git a/modules/data/schematics-core/jest.config.js b/modules/data/schematics-core/jest.config.js index 167b6a9927..d27598e702 100644 --- a/modules/data/schematics-core/jest.config.js +++ b/modules/data/schematics-core/jest.config.js @@ -15,9 +15,4 @@ module.exports = { }, }, coverageDirectory: '../../coverage/modules/schematics-core', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], }; diff --git a/modules/data/schematics-core/test-setup.ts b/modules/data/schematics-core/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/data/schematics-core/test-setup.ts +++ b/modules/data/schematics-core/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/modules/data/test-setup.ts b/modules/data/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/data/test-setup.ts +++ b/modules/data/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/modules/effects/jest.config.js b/modules/effects/jest.config.js index 65a098fc1c..1f10fc4bd4 100644 --- a/modules/effects/jest.config.js +++ b/modules/effects/jest.config.js @@ -2,22 +2,13 @@ module.exports = { displayName: 'Effects', preset: '../../jest.preset.js', coverageDirectory: '../../coverage/modules/effects', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], + setupFilesAfterEnv: ['/test-setup.ts'], globals: { 'ts-jest': { tsconfig: '/tsconfig.spec.json', stringifyContentPathRegex: '\\.(html|svg)$', - astTransformers: { - before: [ - 'jest-preset-angular/build/InlineFilesTransformer', - 'jest-preset-angular/build/StripStylesTransformer', - ], - }, }, }, + transform: { '^.+\\.(ts|js|html)$': 'jest-preset-angular' }, }; diff --git a/modules/effects/schematics-core/jest.config.js b/modules/effects/schematics-core/jest.config.js index 167b6a9927..d27598e702 100644 --- a/modules/effects/schematics-core/jest.config.js +++ b/modules/effects/schematics-core/jest.config.js @@ -15,9 +15,4 @@ module.exports = { }, }, coverageDirectory: '../../coverage/modules/schematics-core', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], }; diff --git a/modules/effects/schematics-core/test-setup.ts b/modules/effects/schematics-core/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/effects/schematics-core/test-setup.ts +++ b/modules/effects/schematics-core/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/modules/effects/test-setup.ts b/modules/effects/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/effects/test-setup.ts +++ b/modules/effects/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/modules/entity/jest.config.js b/modules/entity/jest.config.js index 36bb6788eb..4b71e19db5 100644 --- a/modules/entity/jest.config.js +++ b/modules/entity/jest.config.js @@ -2,22 +2,13 @@ module.exports = { displayName: 'Entity', preset: '../../jest.preset.js', coverageDirectory: '../../coverage/modules/entity', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], + setupFilesAfterEnv: ['/test-setup.ts'], globals: { 'ts-jest': { tsconfig: '/tsconfig.spec.json', stringifyContentPathRegex: '\\.(html|svg)$', - astTransformers: { - before: [ - 'jest-preset-angular/build/InlineFilesTransformer', - 'jest-preset-angular/build/StripStylesTransformer', - ], - }, }, }, + transform: { '^.+\\.(ts|js|html)$': 'jest-preset-angular' }, }; diff --git a/modules/entity/schematics-core/jest.config.js b/modules/entity/schematics-core/jest.config.js index 167b6a9927..d27598e702 100644 --- a/modules/entity/schematics-core/jest.config.js +++ b/modules/entity/schematics-core/jest.config.js @@ -15,9 +15,4 @@ module.exports = { }, }, coverageDirectory: '../../coverage/modules/schematics-core', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], }; diff --git a/modules/entity/schematics-core/test-setup.ts b/modules/entity/schematics-core/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/entity/schematics-core/test-setup.ts +++ b/modules/entity/schematics-core/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/modules/entity/test-setup.ts b/modules/entity/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/entity/test-setup.ts +++ b/modules/entity/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/modules/router-store/jest.config.js b/modules/router-store/jest.config.js index 225be28e38..0dfa1a4794 100644 --- a/modules/router-store/jest.config.js +++ b/modules/router-store/jest.config.js @@ -2,22 +2,13 @@ module.exports = { displayName: 'Router Store', preset: '../../jest.preset.js', coverageDirectory: '../../coverage/modules/router-store', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], + setupFilesAfterEnv: ['/test-setup.ts'], globals: { 'ts-jest': { tsconfig: '/tsconfig.spec.json', stringifyContentPathRegex: '\\.(html|svg)$', - astTransformers: { - before: [ - 'jest-preset-angular/build/InlineFilesTransformer', - 'jest-preset-angular/build/StripStylesTransformer', - ], - }, }, }, + transform: { '^.+\\.(ts|js|html)$': 'jest-preset-angular' }, }; diff --git a/modules/router-store/schematics-core/jest.config.js b/modules/router-store/schematics-core/jest.config.js index 167b6a9927..d27598e702 100644 --- a/modules/router-store/schematics-core/jest.config.js +++ b/modules/router-store/schematics-core/jest.config.js @@ -15,9 +15,4 @@ module.exports = { }, }, coverageDirectory: '../../coverage/modules/schematics-core', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], }; diff --git a/modules/router-store/schematics-core/test-setup.ts b/modules/router-store/schematics-core/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/router-store/schematics-core/test-setup.ts +++ b/modules/router-store/schematics-core/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/modules/router-store/test-setup.ts b/modules/router-store/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/router-store/test-setup.ts +++ b/modules/router-store/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/modules/schematics-core/jest.config.js b/modules/schematics-core/jest.config.js index 167b6a9927..fc00ff7ac7 100644 --- a/modules/schematics-core/jest.config.js +++ b/modules/schematics-core/jest.config.js @@ -6,18 +6,9 @@ module.exports = { 'ts-jest': { tsconfig: '/tsconfig.spec.json', stringifyContentPathRegex: '\\.(html|svg)$', - astTransformers: { - before: [ - 'jest-preset-angular/build/InlineFilesTransformer', - 'jest-preset-angular/build/StripStylesTransformer', - ], - }, }, }, coverageDirectory: '../../coverage/modules/schematics-core', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], + + transform: { '^.+\\.(ts|js|html)$': 'jest-preset-angular' }, }; diff --git a/modules/schematics-core/test-setup.ts b/modules/schematics-core/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/schematics-core/test-setup.ts +++ b/modules/schematics-core/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/modules/schematics/jest.config.js b/modules/schematics/jest.config.js index 19e2ab2680..8ece605d8f 100644 --- a/modules/schematics/jest.config.js +++ b/modules/schematics/jest.config.js @@ -2,10 +2,7 @@ module.exports = { displayName: 'Schematics', preset: '../../jest.preset.js', coverageDirectory: '../../coverage/modules/schematics', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], + globals: { 'ts-jest': { tsconfig: '/tsconfig.spec.json' } }, + testEnvironment: 'node', }; diff --git a/modules/schematics/schematics-core/jest.config.js b/modules/schematics/schematics-core/jest.config.js index 167b6a9927..d27598e702 100644 --- a/modules/schematics/schematics-core/jest.config.js +++ b/modules/schematics/schematics-core/jest.config.js @@ -15,9 +15,4 @@ module.exports = { }, }, coverageDirectory: '../../coverage/modules/schematics-core', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], }; diff --git a/modules/schematics/schematics-core/test-setup.ts b/modules/schematics/schematics-core/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/schematics/schematics-core/test-setup.ts +++ b/modules/schematics/schematics-core/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/modules/schematics/test-setup.ts b/modules/schematics/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/schematics/test-setup.ts +++ b/modules/schematics/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/modules/store-devtools/jest.config.js b/modules/store-devtools/jest.config.js index 189f2aea67..ea0013620e 100644 --- a/modules/store-devtools/jest.config.js +++ b/modules/store-devtools/jest.config.js @@ -2,22 +2,13 @@ module.exports = { displayName: 'Store Devtools', preset: '../../jest.preset.js', coverageDirectory: '../../coverage/modules/store-devtools', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], + setupFilesAfterEnv: ['/test-setup.ts'], globals: { 'ts-jest': { tsconfig: '/tsconfig.spec.json', stringifyContentPathRegex: '\\.(html|svg)$', - astTransformers: { - before: [ - 'jest-preset-angular/build/InlineFilesTransformer', - 'jest-preset-angular/build/StripStylesTransformer', - ], - }, }, }, + transform: { '^.+\\.(ts|js|html)$': 'jest-preset-angular' }, }; diff --git a/modules/store-devtools/schematics-core/jest.config.js b/modules/store-devtools/schematics-core/jest.config.js index 167b6a9927..d27598e702 100644 --- a/modules/store-devtools/schematics-core/jest.config.js +++ b/modules/store-devtools/schematics-core/jest.config.js @@ -15,9 +15,4 @@ module.exports = { }, }, coverageDirectory: '../../coverage/modules/schematics-core', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], }; diff --git a/modules/store-devtools/schematics-core/test-setup.ts b/modules/store-devtools/schematics-core/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/store-devtools/schematics-core/test-setup.ts +++ b/modules/store-devtools/schematics-core/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/modules/store-devtools/test-setup.ts b/modules/store-devtools/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/store-devtools/test-setup.ts +++ b/modules/store-devtools/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/modules/store/jest.config.js b/modules/store/jest.config.js index c318a6c423..90bef57045 100644 --- a/modules/store/jest.config.js +++ b/modules/store/jest.config.js @@ -2,22 +2,13 @@ module.exports = { displayName: 'Store', preset: '../../jest.preset.js', coverageDirectory: '../../coverage/modules/store', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], + setupFilesAfterEnv: ['/test-setup.ts'], globals: { 'ts-jest': { tsconfig: '/tsconfig.spec.json', stringifyContentPathRegex: '\\.(html|svg)$', - astTransformers: { - before: [ - 'jest-preset-angular/build/InlineFilesTransformer', - 'jest-preset-angular/build/StripStylesTransformer', - ], - }, }, }, + transform: { '^.+\\.(ts|js|html)$': 'jest-preset-angular' }, }; diff --git a/modules/store/schematics-core/jest.config.js b/modules/store/schematics-core/jest.config.js index 167b6a9927..d27598e702 100644 --- a/modules/store/schematics-core/jest.config.js +++ b/modules/store/schematics-core/jest.config.js @@ -15,9 +15,4 @@ module.exports = { }, }, coverageDirectory: '../../coverage/modules/schematics-core', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], }; diff --git a/modules/store/schematics-core/test-setup.ts b/modules/store/schematics-core/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/store/schematics-core/test-setup.ts +++ b/modules/store/schematics-core/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/modules/store/src/action_creator.ts b/modules/store/src/action_creator.ts index 7a4ba34546..939610d5a6 100644 --- a/modules/store/src/action_creator.ts +++ b/modules/store/src/action_creator.ts @@ -143,5 +143,5 @@ function defineType( return Object.defineProperty(creator, 'type', { value: type, writable: false, - }); + }) as ActionCreator; } diff --git a/modules/store/test-setup.ts b/modules/store/test-setup.ts index 8d88704e8f..1100b3e8a6 100644 --- a/modules/store/test-setup.ts +++ b/modules/store/test-setup.ts @@ -1 +1 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; diff --git a/nx.json b/nx.json index 212267997b..dc67342ddf 100644 --- a/nx.json +++ b/nx.json @@ -4,11 +4,13 @@ "package.json": "*", "tslint.json": "*", "nx.json": "*", - "tsconfig.base.json": "*", + "tsconfig.json": "*", ".circleci/config.yml": "*", ".eslintrc.json": "*" }, - "affected": { "defaultBase": "master" }, + "affected": { + "defaultBase": "master" + }, "npmScope": "ngrx", "tasksRunnerOptions": { "default": { @@ -27,19 +29,23 @@ } } }, - "workspaceLayout": { "appsDir": "projects", "libsDir": "modules" }, + "workspaceLayout": { + "appsDir": "projects", + "libsDir": "modules" + }, "projects": { - "example-app": { "tags": [] }, - "store": { "tags": [] }, - "effects": { "tags": [] }, - "data": { "tags": [] }, - "entity": { "tags": [] }, - "store-devtools": { "tags": [] }, - "router-store": { "tags": [] }, - "schematics": { "tags": [] }, - "component": { "tags": [] }, - "component-store": { "tags": [] }, - "example-app-e2e": { "tags": [], "implicitDependencies": ["example-app"] }, + "component": { + "tags": [] + }, + "component-store": { + "tags": [] + }, + "data": { + "tags": [] + }, + "data-example-app": { + "tags": [] + }, "docs-app": { "tags": [], "implicitDependencies": [ @@ -54,7 +60,41 @@ "component-store" ] }, - "schematics-core": { "tags": [] }, - "data-example-app": { "tags": [] } + "effects": { + "tags": [] + }, + "entity": { + "tags": [] + }, + "example-app": { + "tags": [] + }, + "example-app-e2e": { + "tags": [], + "implicitDependencies": ["example-app"] + }, + "router-store": { + "tags": [] + }, + "schematics": { + "tags": [] + }, + "schematics-core": { + "tags": [] + }, + "store": { + "tags": [] + }, + "store-devtools": { + "tags": [] + } + }, + "targetDependencies": { + "build": [ + { + "target": "build", + "projects": "dependencies" + } + ] } } diff --git a/package.json b/package.json index f30d650336..5e623c7525 100644 --- a/package.json +++ b/package.json @@ -18,10 +18,10 @@ "coverage:html": "nyc report --reporter=html", "copy:dist": "ncp dist/ ./node_modules/@ngrx/", "example:start": "yarn run cli serve", - "example:start:aot": "yarn run cli serve --prod", + "example:start:aot": "yarn run cli serve --configuration production", "example:test": "nx test example-app", "example:e2e": "nx e2e example-app-e2e", - "example:build": "yarn cli build --prod", + "example:build": "yarn cli build --configuration production", "example:build:prod": "yarn example:build --no-progress --base-href \"/platform/example-app/\"", "ci": "yarn run test && nyc report --reporter=text-lcov | coveralls", "prettier": "prettier --write \"**/*.ts\"", @@ -95,33 +95,33 @@ ] }, "dependencies": { - "@angular/animations": "12.0.4", - "@angular/cdk": "^12.0.4", - "@angular/common": "12.0.4", - "@angular/compiler": "12.0.4", - "@angular/core": "12.0.4", - "@angular/forms": "12.0.4", - "@angular/material": "^12.0.4", - "@angular/platform-browser": "12.0.4", - "@angular/platform-browser-dynamic": "12.0.4", - "@angular/platform-server": "^12.0.4", - "@angular/router": "12.0.4", + "@angular/animations": "12.2.6", + "@angular/cdk": "12.2.6", + "@angular/common": "12.2.6", + "@angular/compiler": "12.2.6", + "@angular/core": "12.2.6", + "@angular/forms": "12.2.6", + "@angular/material": "12.2.6", + "@angular/platform-browser": "12.2.6", + "@angular/platform-browser-dynamic": "12.2.6", + "@angular/platform-server": "12.2.6", + "@angular/router": "12.2.6", "@applitools/eyes-cypress": "^3.4.12", - "@nrwl/angular": "12.3.6", + "@nrwl/angular": "12.9.0", "core-js": "^2.5.4", "opencollective": "^1.0.3", "rxjs": "~6.5.5", "tslib": "^2.2.0", - "zone.js": "~0.11.4" + "zone.js": "0.11.4" }, "devDependencies": { - "@angular-devkit/build-angular": "12.0.4", - "@angular-eslint/eslint-plugin": "~2.0.2", - "@angular-eslint/eslint-plugin-template": "~2.0.2", - "@angular-eslint/template-parser": "~2.0.2", - "@angular/bazel": "^12.0.4", - "@angular/cli": "12.0.4", - "@angular/compiler-cli": "12.0.4", + "@angular-devkit/build-angular": "12.2.6", + "@angular-eslint/eslint-plugin": "12.3.1", + "@angular-eslint/eslint-plugin-template": "12.3.1", + "@angular-eslint/template-parser": "12.3.1", + "@angular/bazel": "^12.2.6", + "@angular/cli": "12.2.6", + "@angular/compiler-cli": "12.2.6", "@babel/core": "7.9.0", "@bazel/bazelisk": "1.4.0", "@bazel/buildifier": "^2.2.1", @@ -129,15 +129,15 @@ "@bazel/jasmine": "1.6.0", "@bazel/typescript": "1.6.0", "@cypress/webpack-preprocessor": "^4.0.3", - "@nrwl/cli": "12.3.6", - "@nrwl/cypress": "12.3.6", - "@nrwl/eslint-plugin-nx": "12.3.6", - "@nrwl/jest": "12.3.6", - "@nrwl/linter": "12.3.6", - "@nrwl/node": "12.3.6", - "@nrwl/nx-cloud": "11.2.0", - "@nrwl/tao": "12.3.6", - "@nrwl/workspace": "12.3.6", + "@nrwl/cli": "12.9.0", + "@nrwl/cypress": "12.9.0", + "@nrwl/eslint-plugin-nx": "12.9.0", + "@nrwl/jest": "12.9.0", + "@nrwl/linter": "12.9.0", + "@nrwl/node": "12.9.0", + "@nrwl/nx-cloud": "12.3.11", + "@nrwl/tao": "12.9.0", + "@nrwl/workspace": "12.9.0", "@octokit/rest": "^15.17.0", "@testing-library/cypress": "^7.0.1", "@types/fs-extra": "^2.1.0", @@ -153,8 +153,8 @@ "@types/prettier": "^1.19.0", "@types/rimraf": "^0.0.28", "@types/shelljs": "^0.8.5", - "@typescript-eslint/eslint-plugin": "4.19.0", - "@typescript-eslint/parser": "4.19.0", + "@typescript-eslint/eslint-plugin": "4.28.5", + "@typescript-eslint/parser": "4.28.5", "chokidar": "^1.7.0", "chokidar-cli": "^1.2.0", "conventional-changelog": "^1.1.4", @@ -173,10 +173,10 @@ "husky": "^1.2.0", "jasmine": "^3.4.0", "jasmine-core": "3.6.0", - "jasmine-marbles": "^0.4.0", + "jasmine-marbles": "0.8.3", "jasmine-spec-reporter": "5.0.2", - "jest": "26.2.2", - "jest-preset-angular": "8.3.2", + "jest": "27.0.3", + "jest-preset-angular": "9.0.7", "jest-zone-patch": "^0.0.10", "karma": "6.3.2", "karma-chrome-launcher": "3.1.0", @@ -186,11 +186,11 @@ "karma-jasmine-html-reporter": "1.5.4", "lint-staged": "^8.0.0", "ncp": "^2.0.0", - "ng-packagr": "12.0.5", + "ng-packagr": "12.2.1", "npm-run-all": "^4.1.5", "nyc": "^10.1.2", "ora": "^1.3.0", - "prettier": "2.2.1", + "prettier": "2.4.1", "protractor": "7.0.0", "reflect-metadata": "^0.1.9", "replace-in-file": "^3.1.1", @@ -203,14 +203,14 @@ "rxjs-marbles": "^6.0.0", "shelljs": "^0.8.3", "sorcery": "^0.10.0", - "ts-jest": "26.4.0", + "ts-jest": "27.0.3", "ts-loader": "^5.3.3", "ts-node": "9.1.1", "ts-snippet": "5.0.2", "tsconfig-paths": "^3.1.3", "tsickle": "^0.37.0", "tsutils": "2.27.2", - "typescript": "4.2.4", + "typescript": "4.3.5", "uglify-js": "^3.1.9" }, "collective": { @@ -230,3 +230,4 @@ } } } + diff --git a/projects/data-example-app/jest.config.js b/projects/data-example-app/jest.config.js index 690e807be6..ce71f388a1 100644 --- a/projects/data-example-app/jest.config.js +++ b/projects/data-example-app/jest.config.js @@ -2,22 +2,13 @@ module.exports = { displayName: 'Data Example App', preset: '../../jest.preset.js', coverageDirectory: '../../coverage/apps/data-example-app', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], + setupFilesAfterEnv: ['/src/test-setup.ts'], globals: { 'ts-jest': { tsconfig: '/tsconfig.spec.json', stringifyContentPathRegex: '\\.(html|svg)$', - astTransformers: { - before: [ - 'jest-preset-angular/build/InlineFilesTransformer', - 'jest-preset-angular/build/StripStylesTransformer', - ], - }, }, }, + transform: { '^.+\\.(ts|js|html)$': 'jest-preset-angular' }, }; diff --git a/projects/data-example-app/src/test-setup.ts b/projects/data-example-app/src/test-setup.ts index 485edda61e..e76c4ae5fa 100644 --- a/projects/data-example-app/src/test-setup.ts +++ b/projects/data-example-app/src/test-setup.ts @@ -1,4 +1,4 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; (global as any)['CSS'] = null; /** diff --git a/projects/example-app/jest.config.js b/projects/example-app/jest.config.js index ff80fecb1d..7e6be1a1fa 100644 --- a/projects/example-app/jest.config.js +++ b/projects/example-app/jest.config.js @@ -2,22 +2,12 @@ module.exports = { displayName: 'Example App', preset: '../../jest.preset.js', coverageDirectory: '../../coverage/apps/example-app', - snapshotSerializers: [ - 'jest-preset-angular/build/AngularNoNgAttributesSnapshotSerializer.js', - 'jest-preset-angular/build/AngularSnapshotSerializer.js', - 'jest-preset-angular/build/HTMLCommentSerializer.js', - ], setupFilesAfterEnv: ['/src/test-setup.ts'], globals: { 'ts-jest': { tsconfig: '/tsconfig.spec.json', stringifyContentPathRegex: '\\.(html|svg)$', - astTransformers: { - before: [ - 'jest-preset-angular/build/InlineFilesTransformer', - 'jest-preset-angular/build/StripStylesTransformer', - ], - }, }, }, + transform: { '^.+\\.(ts|js|html)$': 'jest-preset-angular' }, }; diff --git a/projects/example-app/src/app/auth/components/__snapshots__/login-form.component.spec.ts.snap b/projects/example-app/src/app/auth/components/__snapshots__/login-form.component.spec.ts.snap index 590251a27a..39f762abc1 100644 --- a/projects/example-app/src/app/auth/components/__snapshots__/login-form.component.spec.ts.snap +++ b/projects/example-app/src/app/auth/components/__snapshots__/login-form.component.spec.ts.snap @@ -37,7 +37,6 @@ exports[`Login Page should compile 1`] = ` />

-

@@ -93,7 +92,6 @@ exports[`Login Page should disable the form if pending 1`] = ` />

-

@@ -153,7 +151,6 @@ exports[`Login Page should display an error message if provided 1`] = ` > Invalid credentials

-

diff --git a/projects/example-app/src/app/auth/containers/__snapshots__/login-page.component.spec.ts.snap b/projects/example-app/src/app/auth/containers/__snapshots__/login-page.component.spec.ts.snap index 98f4eef461..e29ff00062 100644 --- a/projects/example-app/src/app/auth/containers/__snapshots__/login-page.component.spec.ts.snap +++ b/projects/example-app/src/app/auth/containers/__snapshots__/login-page.component.spec.ts.snap @@ -33,8 +33,6 @@ exports[`Login Page should compile 1`] = `

- -
@@ -56,15 +54,9 @@ exports[`Login Page should compile 1`] = ` Username - - - - -
-
-
-
-
-
@@ -102,8 +90,6 @@ exports[`Login Page should compile 1`] = `
- -
@@ -125,15 +111,9 @@ exports[`Login Page should compile 1`] = ` Password - - - - -
-
-
-
-
-

-

diff --git a/projects/example-app/src/app/books/containers/__snapshots__/collection-page.component.spec.ts.snap b/projects/example-app/src/app/books/containers/__snapshots__/collection-page.component.spec.ts.snap index 5d49fe1546..1597407f84 100644 --- a/projects/example-app/src/app/books/containers/__snapshots__/collection-page.component.spec.ts.snap +++ b/projects/example-app/src/app/books/containers/__snapshots__/collection-page.component.spec.ts.snap @@ -15,7 +15,6 @@ exports[`Collection Page should compile 1`] = ` My Collection - `; diff --git a/projects/example-app/src/app/books/containers/__snapshots__/find-book-page.component.spec.ts.snap b/projects/example-app/src/app/books/containers/__snapshots__/find-book-page.component.spec.ts.snap index 4f65345349..999f69bae9 100644 --- a/projects/example-app/src/app/books/containers/__snapshots__/find-book-page.component.spec.ts.snap +++ b/projects/example-app/src/app/books/containers/__snapshots__/find-book-page.component.spec.ts.snap @@ -30,8 +30,6 @@ exports[`Find Book Page should compile 1`] = `

- -
@@ -51,15 +49,9 @@ exports[`Find Book Page should compile 1`] = ` Search for a book - - - - -
-
-
-
-
-
@@ -106,19 +94,15 @@ exports[`Find Book Page should compile 1`] = ` r="10" style="animation-name: mat-progress-spinner-stroke-rotate-30; stroke-dasharray: 62.83185307179586px; stroke-width: 10%;" /> - - - - `; diff --git a/projects/example-app/src/app/books/containers/__snapshots__/selected-book-page.component.spec.ts.snap b/projects/example-app/src/app/books/containers/__snapshots__/selected-book-page.component.spec.ts.snap index c5fb4db35c..00c17a483c 100644 --- a/projects/example-app/src/app/books/containers/__snapshots__/selected-book-page.component.spec.ts.snap +++ b/projects/example-app/src/app/books/containers/__snapshots__/selected-book-page.component.spec.ts.snap @@ -8,7 +8,6 @@ exports[`Selected Book Page should compile 1`] = ` store={[Function MockStore]} > - `; diff --git a/projects/example-app/src/app/books/containers/__snapshots__/view-book-page.component.spec.ts.snap b/projects/example-app/src/app/books/containers/__snapshots__/view-book-page.component.spec.ts.snap index 915162180e..fdbe8282e3 100644 --- a/projects/example-app/src/app/books/containers/__snapshots__/view-book-page.component.spec.ts.snap +++ b/projects/example-app/src/app/books/containers/__snapshots__/view-book-page.component.spec.ts.snap @@ -7,7 +7,6 @@ exports[`View Book Page should compile 1`] = ` > - diff --git a/projects/example-app/src/test-setup.ts b/projects/example-app/src/test-setup.ts index 485edda61e..e76c4ae5fa 100644 --- a/projects/example-app/src/test-setup.ts +++ b/projects/example-app/src/test-setup.ts @@ -1,4 +1,4 @@ -import 'jest-preset-angular'; +import 'jest-preset-angular/setup-jest'; (global as any)['CSS'] = null; /** diff --git a/projects/ngrx.io/src/app/custom-elements/contributor/contributor-list.component.ts b/projects/ngrx.io/src/app/custom-elements/contributor/contributor-list.component.ts index 184bbc746d..6521fec23f 100644 --- a/projects/ngrx.io/src/app/custom-elements/contributor/contributor-list.component.ts +++ b/projects/ngrx.io/src/app/custom-elements/contributor/contributor-list.component.ts @@ -10,7 +10,7 @@ import { map, takeUntil } from 'rxjs/operators'; template: ` diff --git a/projects/ngrx.io/src/app/layout/mode-banner/mode-banner.component.ts b/projects/ngrx.io/src/app/layout/mode-banner/mode-banner.component.ts index 8d8e0d79ef..ee72817c39 100644 --- a/projects/ngrx.io/src/app/layout/mode-banner/mode-banner.component.ts +++ b/projects/ngrx.io/src/app/layout/mode-banner/mode-banner.component.ts @@ -4,7 +4,7 @@ import { VersionInfo } from 'app/navigation/navigation.service'; @Component({ selector: 'aio-mode-banner', template: ` -
+
This is the archived documentation for NgRx v{{version?.major}}. Please visit ngrx.io to see documentation for the current version of NgRx.
diff --git a/projects/ngrx.io/src/app/layout/nav-item/nav-item.component.html b/projects/ngrx.io/src/app/layout/nav-item/nav-item.component.html index cf02e3611a..ccaceea369 100644 --- a/projects/ngrx.io/src/app/layout/nav-item/nav-item.component.html +++ b/projects/ngrx.io/src/app/layout/nav-item/nav-item.component.html @@ -14,7 +14,7 @@ class="heading-container" *ngIf="node.children">