From 409f3563a8d9b753c2c60ec6be120d35cf99b31c Mon Sep 17 00:00:00 2001 From: JeB <9823087+just-jeb@users.noreply.github.com> Date: Thu, 25 Jun 2020 17:27:16 +0300 Subject: [PATCH] build!: update to Angular 10 (#782) --- MIGRATION.MD | 5 ++ README.md | 5 +- packages/custom-webpack/README.md | 18 +++-- packages/custom-webpack/builders.json | 2 +- .../{browserslist => .browserslistrc} | 0 .../examples/full-cycle-app/e2e/tsconfig.json | 4 +- .../examples/full-cycle-app/package.json | 48 ++++++------- .../examples/full-cycle-app/tsconfig.app.json | 2 +- .../full-cycle-app/tsconfig.base.json | 22 ++++++ .../examples/full-cycle-app/tsconfig.json | 37 +++++----- .../full-cycle-app/tsconfig.spec.json | 2 +- .../examples/full-cycle-app/tslint.json | 67 ++++++++++++++++++- .../{browserslist => .browserslistrc} | 0 .../examples/sanity-app/e2e/tsconfig.json | 4 +- .../examples/sanity-app/package.json | 48 ++++++------- .../examples/sanity-app/tsconfig.app.json | 2 +- .../examples/sanity-app/tsconfig.base.json | 22 ++++++ .../examples/sanity-app/tsconfig.json | 37 +++++----- .../examples/sanity-app/tsconfig.spec.json | 2 +- .../examples/sanity-app/tslint.json | 67 ++++++++++++++++++- packages/custom-webpack/package.json | 17 +++-- packages/jest/README.md | 14 ++-- packages/jest/builders.json | 2 +- .../jest/examples/multiple-apps/package.json | 42 ++++++------ .../{browserslist => .browserslistrc} | 0 .../my-first-app/configs/tsconfig.spec.json | 2 +- .../projects/my-first-app/e2e/tsconfig.json | 4 +- .../projects/my-first-app/tsconfig.app.json | 2 +- .../{browserslist => .browserslistrc} | 0 .../projects/my-second-app/e2e/tsconfig.json | 4 +- .../projects/my-second-app/tsconfig.app.json | 2 +- .../projects/my-second-app/tsconfig.spec.json | 2 +- .../projects/my-shared-library/package.json | 3 + .../my-shared-library/tsconfig.lib.json | 2 +- .../my-shared-library/tsconfig.spec.json | 2 +- .../examples/multiple-apps/tsconfig.base.json | 27 ++++++++ .../jest/examples/multiple-apps/tsconfig.json | 44 ++++++------ .../jest/examples/multiple-apps/tslint.json | 67 ++++++++++++++++++- .../{browserslist => .browserslistrc} | 0 .../examples/simple-app/e2e/tsconfig.json | 4 +- .../jest/examples/simple-app/package.json | 38 +++++------ .../examples/simple-app/tsconfig.app.json | 2 +- .../examples/simple-app/tsconfig.base.json | 19 ++++++ .../jest/examples/simple-app/tsconfig.json | 31 ++++----- .../examples/simple-app/tsconfig.spec.json | 2 +- packages/jest/examples/simple-app/tslint.json | 67 ++++++++++++++++++- packages/jest/package.json | 17 +++-- packages/timestamp/README.md | 2 +- packages/timestamp/builders.json | 2 +- .../example/{browserslist => .browserslistrc} | 0 packages/timestamp/example/e2e/tsconfig.json | 4 +- packages/timestamp/example/package.json | 24 +++---- packages/timestamp/example/tsconfig.app.json | 2 +- packages/timestamp/example/tsconfig.base.json | 22 ++++++ packages/timestamp/example/tsconfig.json | 37 +++++----- packages/timestamp/example/tsconfig.spec.json | 2 +- packages/timestamp/example/tslint.json | 67 ++++++++++++++++++- packages/timestamp/package.json | 11 ++- 58 files changed, 705 insertions(+), 278 deletions(-) rename packages/custom-webpack/examples/full-cycle-app/{browserslist => .browserslistrc} (100%) create mode 100644 packages/custom-webpack/examples/full-cycle-app/tsconfig.base.json rename packages/custom-webpack/examples/sanity-app/{browserslist => .browserslistrc} (100%) create mode 100644 packages/custom-webpack/examples/sanity-app/tsconfig.base.json rename packages/jest/examples/multiple-apps/projects/my-first-app/{browserslist => .browserslistrc} (100%) rename packages/jest/examples/multiple-apps/projects/my-second-app/{browserslist => .browserslistrc} (100%) create mode 100644 packages/jest/examples/multiple-apps/tsconfig.base.json rename packages/jest/examples/simple-app/{browserslist => .browserslistrc} (100%) create mode 100644 packages/jest/examples/simple-app/tsconfig.base.json rename packages/timestamp/example/{browserslist => .browserslistrc} (100%) create mode 100644 packages/timestamp/example/tsconfig.base.json diff --git a/MIGRATION.MD b/MIGRATION.MD index c82f71a25..80964b88c 100644 --- a/MIGRATION.MD +++ b/MIGRATION.MD @@ -1,3 +1,8 @@ +# Migration from version 9 to version 10 + +## Jest builder +1. Update to Jest 26 if you still haven't. + # Migration from version 8 to version 9 ## All builders diff --git a/README.md b/README.md index fffbf0126..f6d13b40c 100644 --- a/README.md +++ b/README.md @@ -2,12 +2,14 @@ The purpose of this repository is to consolidate all the community builders for Angular build facade. -## The latest version of all the builders require Angular CLI 9 +## The latest version of all the builders require Angular CLI 10 ## [Documentation for version 7](https://github.com/just-jeb/angular-builders/tree/7.x.x) ## [Documentation for version 8](https://github.com/just-jeb/angular-builders/tree/8.x.x) +## [Documentation for version 9](https://github.com/just-jeb/angular-builders/tree/9.x.x) + ## [Migration guide](./MIGRATION.MD) # Builders @@ -52,6 +54,7 @@ Thanks goes to these wonderful people ([emoji key](https://allcontributors.org/d + This project follows the [all-contributors](https://github.com/all-contributors/all-contributors) specification. Contributions of any kind welcome! diff --git a/packages/custom-webpack/README.md b/packages/custom-webpack/README.md index 678d164a1..fee667159 100644 --- a/packages/custom-webpack/README.md +++ b/packages/custom-webpack/README.md @@ -4,11 +4,17 @@ Allow customizing build configuration without ejecting webpack configuration (`ng eject`) -# This documentation is for version 9 only. Find documentation for version 7 [here](https://github.com/just-jeb/angular-builders/blob/7.x.x/packages/custom-webpack/README.md) and for version 8 [here](https://github.com/just-jeb/angular-builders/blob/8.x.x/packages/custom-webpack/README.md). +# This documentation is for the latest major version only -# Prerequisites: +## Previous versions -- [Angular CLI 9](https://www.npmjs.com/package/@angular/cli) +- [Version 7](https://github.com/just-jeb/angular-builders/blob/7.x.x/packages/custom-webpack/README.md) +- [Version 8](https://github.com/just-jeb/angular-builders/blob/8.x.x/packages/custom-webpack/README.md) +- [Version 9](https://github.com/just-jeb/angular-builders/blob/9.x.x/packages/custom-webpack/README.md) + +## Prerequisites: + +- [Angular CLI 10](https://www.npmjs.com/package/@angular/cli) # Usage @@ -321,7 +327,11 @@ import { CustomWebpackBrowserSchema, TargetOptions } from '@angular-builders/cus import * as webpack from 'webpack'; import * as pkg from './package.json'; -export default (config: webpack.Configuration, options: CustomWebpackBrowserSchema, targetOptions: TargetOptions) => { +export default ( + config: webpack.Configuration, + options: CustomWebpackBrowserSchema, + targetOptions: TargetOptions +) => { config.plugins.push( new webpack.DefinePlugin({ APP_VERSION: JSON.stringify(pkg.version), diff --git a/packages/custom-webpack/builders.json b/packages/custom-webpack/builders.json index 111127c18..4c88a5e07 100644 --- a/packages/custom-webpack/builders.json +++ b/packages/custom-webpack/builders.json @@ -1,5 +1,5 @@ { - "$schema": "../../node_modules/@angular-devkit/architect/src/builders-schema.json", + "$schema": "./node_modules/@angular-devkit/architect/src/builders-schema.json", "builders": { "browser": { "implementation": "./dist/browser", diff --git a/packages/custom-webpack/examples/full-cycle-app/browserslist b/packages/custom-webpack/examples/full-cycle-app/.browserslistrc similarity index 100% rename from packages/custom-webpack/examples/full-cycle-app/browserslist rename to packages/custom-webpack/examples/full-cycle-app/.browserslistrc diff --git a/packages/custom-webpack/examples/full-cycle-app/e2e/tsconfig.json b/packages/custom-webpack/examples/full-cycle-app/e2e/tsconfig.json index 39b800f78..6b87cc425 100644 --- a/packages/custom-webpack/examples/full-cycle-app/e2e/tsconfig.json +++ b/packages/custom-webpack/examples/full-cycle-app/e2e/tsconfig.json @@ -1,9 +1,9 @@ { - "extends": "../tsconfig.json", + "extends": "../tsconfig.base.json", "compilerOptions": { "outDir": "../out-tsc/e2e", "module": "commonjs", - "target": "es5", + "target": "es2018", "types": [ "jasmine", "jasminewd2", diff --git a/packages/custom-webpack/examples/full-cycle-app/package.json b/packages/custom-webpack/examples/full-cycle-app/package.json index d80ecbf04..9f597720c 100644 --- a/packages/custom-webpack/examples/full-cycle-app/package.json +++ b/packages/custom-webpack/examples/full-cycle-app/package.json @@ -11,39 +11,39 @@ }, "private": true, "dependencies": { - "@angular/animations": "^9.0.0", - "@angular/common": "^9.0.0", - "@angular/compiler": "^9.0.0", - "@angular/core": "^9.0.0", - "@angular/forms": "^9.0.0", - "@angular/platform-browser": "^9.0.0", - "@angular/platform-browser-dynamic": "^9.0.0", - "@angular/router": "^9.0.0", + "@angular/animations": "^10.0.0", + "@angular/common": "^10.0.0", + "@angular/compiler": "^10.0.0", + "@angular/core": "^10.0.0", + "@angular/forms": "^10.0.0", + "@angular/platform-browser": "^10.0.0", + "@angular/platform-browser-dynamic": "^10.0.0", + "@angular/router": "^10.0.0", "rxjs": "~6.5.2", - "tslib": "^1.10.0", + "tslib": "^2.0.0", "zone.js": "~0.10.2" }, "devDependencies": { "@angular-builders/custom-webpack": "latest", - "@angular-devkit/build-angular": ">=0.900.0 < 0.1000.0", - "@angular/cli": "^9.0.0", - "@angular/compiler-cli": "^9.0.0", - "@angular/language-service": "^9.0.0", + "@angular-devkit/build-angular": "0.1000.0", + "@angular/cli": "^10.0.0", + "@angular/compiler-cli": "^10.0.0", + "@angular/language-service": "^10.0.0", "@types/jasmine": "~3.3.13", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", "codelyzer": "^5.1.2", "html-webpack-plugin": "^3.2.0", - "jasmine-core": "~3.4.0", - "jasmine-spec-reporter": "~4.2.1", - "karma": "~4.1.0", - "karma-chrome-launcher": "~2.2.0", - "karma-coverage-istanbul-reporter": "~2.0.1", - "karma-jasmine": "~2.0.1", - "karma-jasmine-html-reporter": "^1.4.2", - "protractor": "^5.4.2", + "jasmine-core": "~3.5.0", + "jasmine-spec-reporter": "~5.0.0", + "karma": "~5.0.0", + "karma-chrome-launcher": "~3.1.0", + "karma-coverage-istanbul-reporter": "~3.0.2", + "karma-jasmine": "~3.3.0", + "karma-jasmine-html-reporter": "^1.5.0", + "protractor": "~7.0.0", "ts-node": "~8.1.1", - "tslint": "~5.16.0", - "typescript": "~3.7.5" + "tslint": "~6.1.0", + "typescript": "~3.9.5" } -} +} \ No newline at end of file diff --git a/packages/custom-webpack/examples/full-cycle-app/tsconfig.app.json b/packages/custom-webpack/examples/full-cycle-app/tsconfig.app.json index 31f8397ac..fa3be07df 100644 --- a/packages/custom-webpack/examples/full-cycle-app/tsconfig.app.json +++ b/packages/custom-webpack/examples/full-cycle-app/tsconfig.app.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig.base.json", "compilerOptions": { "outDir": "./out-tsc/app", "types": [] diff --git a/packages/custom-webpack/examples/full-cycle-app/tsconfig.base.json b/packages/custom-webpack/examples/full-cycle-app/tsconfig.base.json new file mode 100644 index 000000000..6ec9ceb17 --- /dev/null +++ b/packages/custom-webpack/examples/full-cycle-app/tsconfig.base.json @@ -0,0 +1,22 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "module": "esnext", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "importHelpers": true, + "target": "es2015", + "typeRoots": [ + "node_modules/@types" + ], + "lib": [ + "es2018", + "dom" + ] + } +} diff --git a/packages/custom-webpack/examples/full-cycle-app/tsconfig.json b/packages/custom-webpack/examples/full-cycle-app/tsconfig.json index 6ec9ceb17..7e00e7077 100644 --- a/packages/custom-webpack/examples/full-cycle-app/tsconfig.json +++ b/packages/custom-webpack/examples/full-cycle-app/tsconfig.json @@ -1,22 +1,17 @@ +/* + This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. + It is not intended to be used to perform a compilation. + + To learn more about this file see: https://angular.io/config/solution-tsconfig. +*/ { - "compileOnSave": false, - "compilerOptions": { - "baseUrl": "./", - "outDir": "./dist/out-tsc", - "sourceMap": true, - "declaration": false, - "module": "esnext", - "moduleResolution": "node", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "importHelpers": true, - "target": "es2015", - "typeRoots": [ - "node_modules/@types" - ], - "lib": [ - "es2018", - "dom" - ] - } -} + "files": [], + "references": [ + { + "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} \ No newline at end of file diff --git a/packages/custom-webpack/examples/full-cycle-app/tsconfig.spec.json b/packages/custom-webpack/examples/full-cycle-app/tsconfig.spec.json index 6400fde7d..1db2e6ee9 100644 --- a/packages/custom-webpack/examples/full-cycle-app/tsconfig.spec.json +++ b/packages/custom-webpack/examples/full-cycle-app/tsconfig.spec.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig.base.json", "compilerOptions": { "outDir": "./out-tsc/spec", "types": [ diff --git a/packages/custom-webpack/examples/full-cycle-app/tslint.json b/packages/custom-webpack/examples/full-cycle-app/tslint.json index 188bd78d3..d320b01fb 100644 --- a/packages/custom-webpack/examples/full-cycle-app/tslint.json +++ b/packages/custom-webpack/examples/full-cycle-app/tslint.json @@ -1,8 +1,16 @@ { "extends": "tslint:recommended", "rules": { + "align": { + "options": [ + "parameters", + "statements" + ] + }, "array-type": false, "arrow-parens": false, + "arrow-return-shorthand": true, + "curly": true, "deprecation": { "severity": "warn" }, @@ -21,10 +29,17 @@ "app", "kebab-case" ], + "eofline": true, "import-blacklist": [ true, "rxjs/Rx" ], + "import-spacing": true, + "indent": { + "options": [ + "spaces" + ] + }, "interface-name": false, "max-classes-per-file": false, "max-line-length": [ @@ -60,7 +75,6 @@ "no-non-null-assertion": true, "no-redundant-jsdoc": true, "no-switch-case-fall-through": true, - "no-use-before-declare": true, "no-var-requires": false, "object-literal-key-quotes": [ true, @@ -72,6 +86,20 @@ true, "single" ], + "semicolon": { + "options": [ + "always" + ] + }, + "space-before-function-paren": { + "options": { + "anonymous": "never", + "asyncArrow": "always", + "constructor": "never", + "method": "never", + "named": "never" + } + }, "trailing-comma": false, "no-conflicting-lifecycle": true, "no-host-metadata-property": true, @@ -83,9 +111,44 @@ "no-outputs-metadata-property": true, "template-banana-in-box": true, "template-no-negated-async": true, + "typedef-whitespace": { + "options": [ + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ] + }, "use-lifecycle-interface": true, "use-pipe-transform-interface": true - }, + , "variable-name": { + "options": [ + "ban-keywords", + "check-format", + "allow-pascal-case" + ] + }, + "whitespace": { + "options": [ + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type", + "check-typecast" + ] + } +}, "rulesDirectory": [ "codelyzer" ] diff --git a/packages/custom-webpack/examples/sanity-app/browserslist b/packages/custom-webpack/examples/sanity-app/.browserslistrc similarity index 100% rename from packages/custom-webpack/examples/sanity-app/browserslist rename to packages/custom-webpack/examples/sanity-app/.browserslistrc diff --git a/packages/custom-webpack/examples/sanity-app/e2e/tsconfig.json b/packages/custom-webpack/examples/sanity-app/e2e/tsconfig.json index 39b800f78..6b87cc425 100644 --- a/packages/custom-webpack/examples/sanity-app/e2e/tsconfig.json +++ b/packages/custom-webpack/examples/sanity-app/e2e/tsconfig.json @@ -1,9 +1,9 @@ { - "extends": "../tsconfig.json", + "extends": "../tsconfig.base.json", "compilerOptions": { "outDir": "../out-tsc/e2e", "module": "commonjs", - "target": "es5", + "target": "es2018", "types": [ "jasmine", "jasminewd2", diff --git a/packages/custom-webpack/examples/sanity-app/package.json b/packages/custom-webpack/examples/sanity-app/package.json index c8f99352e..ddbfda03a 100644 --- a/packages/custom-webpack/examples/sanity-app/package.json +++ b/packages/custom-webpack/examples/sanity-app/package.json @@ -11,38 +11,38 @@ }, "private": true, "dependencies": { - "@angular/animations": "^9.0.0", - "@angular/common": "^9.0.0", - "@angular/compiler": "^9.0.0", - "@angular/core": "^9.0.0", - "@angular/forms": "^9.0.0", - "@angular/platform-browser": "^9.0.0", - "@angular/platform-browser-dynamic": "^9.0.0", - "@angular/router": "^9.0.0", + "@angular/animations": "^10.0.0", + "@angular/common": "^10.0.0", + "@angular/compiler": "^10.0.0", + "@angular/core": "^10.0.0", + "@angular/forms": "^10.0.0", + "@angular/platform-browser": "^10.0.0", + "@angular/platform-browser-dynamic": "^10.0.0", + "@angular/router": "^10.0.0", "rxjs": "~6.5.2", - "tslib": "^1.10.0", + "tslib": "^2.0.0", "zone.js": "~0.10.2" }, "devDependencies": { "@angular-builders/custom-webpack": "latest", - "@angular-devkit/build-angular": ">=0.900.0 < 0.1000.0", - "@angular/cli": "^9.0.0", - "@angular/compiler-cli": "^9.0.0", - "@angular/language-service": "^9.0.0", + "@angular-devkit/build-angular": "0.1000.0", + "@angular/cli": "^10.0.0", + "@angular/compiler-cli": "^10.0.0", + "@angular/language-service": "^10.0.0", "@types/jasmine": "~3.3.13", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", "codelyzer": "^5.1.2", - "jasmine-core": "~3.4.0", - "jasmine-spec-reporter": "~4.2.1", - "karma": "~4.1.0", - "karma-chrome-launcher": "~2.2.0", - "karma-coverage-istanbul-reporter": "~2.0.1", - "karma-jasmine": "~2.0.1", - "karma-jasmine-html-reporter": "^1.4.2", - "protractor": "^5.4.2", + "jasmine-core": "~3.5.0", + "jasmine-spec-reporter": "~5.0.0", + "karma": "~5.0.0", + "karma-chrome-launcher": "~3.1.0", + "karma-coverage-istanbul-reporter": "~3.0.2", + "karma-jasmine": "~3.3.0", + "karma-jasmine-html-reporter": "^1.5.0", + "protractor": "~7.0.0", "ts-node": "~8.2.0", - "tslint": "~5.16.0", - "typescript": "~3.7.5" + "tslint": "~6.1.0", + "typescript": "~3.9.5" } -} +} \ No newline at end of file diff --git a/packages/custom-webpack/examples/sanity-app/tsconfig.app.json b/packages/custom-webpack/examples/sanity-app/tsconfig.app.json index 31f8397ac..fa3be07df 100644 --- a/packages/custom-webpack/examples/sanity-app/tsconfig.app.json +++ b/packages/custom-webpack/examples/sanity-app/tsconfig.app.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig.base.json", "compilerOptions": { "outDir": "./out-tsc/app", "types": [] diff --git a/packages/custom-webpack/examples/sanity-app/tsconfig.base.json b/packages/custom-webpack/examples/sanity-app/tsconfig.base.json new file mode 100644 index 000000000..6ec9ceb17 --- /dev/null +++ b/packages/custom-webpack/examples/sanity-app/tsconfig.base.json @@ -0,0 +1,22 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "module": "esnext", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "importHelpers": true, + "target": "es2015", + "typeRoots": [ + "node_modules/@types" + ], + "lib": [ + "es2018", + "dom" + ] + } +} diff --git a/packages/custom-webpack/examples/sanity-app/tsconfig.json b/packages/custom-webpack/examples/sanity-app/tsconfig.json index 6ec9ceb17..7e00e7077 100644 --- a/packages/custom-webpack/examples/sanity-app/tsconfig.json +++ b/packages/custom-webpack/examples/sanity-app/tsconfig.json @@ -1,22 +1,17 @@ +/* + This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. + It is not intended to be used to perform a compilation. + + To learn more about this file see: https://angular.io/config/solution-tsconfig. +*/ { - "compileOnSave": false, - "compilerOptions": { - "baseUrl": "./", - "outDir": "./dist/out-tsc", - "sourceMap": true, - "declaration": false, - "module": "esnext", - "moduleResolution": "node", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "importHelpers": true, - "target": "es2015", - "typeRoots": [ - "node_modules/@types" - ], - "lib": [ - "es2018", - "dom" - ] - } -} + "files": [], + "references": [ + { + "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} \ No newline at end of file diff --git a/packages/custom-webpack/examples/sanity-app/tsconfig.spec.json b/packages/custom-webpack/examples/sanity-app/tsconfig.spec.json index 6400fde7d..1db2e6ee9 100644 --- a/packages/custom-webpack/examples/sanity-app/tsconfig.spec.json +++ b/packages/custom-webpack/examples/sanity-app/tsconfig.spec.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig.base.json", "compilerOptions": { "outDir": "./out-tsc/spec", "types": [ diff --git a/packages/custom-webpack/examples/sanity-app/tslint.json b/packages/custom-webpack/examples/sanity-app/tslint.json index 188bd78d3..d320b01fb 100644 --- a/packages/custom-webpack/examples/sanity-app/tslint.json +++ b/packages/custom-webpack/examples/sanity-app/tslint.json @@ -1,8 +1,16 @@ { "extends": "tslint:recommended", "rules": { + "align": { + "options": [ + "parameters", + "statements" + ] + }, "array-type": false, "arrow-parens": false, + "arrow-return-shorthand": true, + "curly": true, "deprecation": { "severity": "warn" }, @@ -21,10 +29,17 @@ "app", "kebab-case" ], + "eofline": true, "import-blacklist": [ true, "rxjs/Rx" ], + "import-spacing": true, + "indent": { + "options": [ + "spaces" + ] + }, "interface-name": false, "max-classes-per-file": false, "max-line-length": [ @@ -60,7 +75,6 @@ "no-non-null-assertion": true, "no-redundant-jsdoc": true, "no-switch-case-fall-through": true, - "no-use-before-declare": true, "no-var-requires": false, "object-literal-key-quotes": [ true, @@ -72,6 +86,20 @@ true, "single" ], + "semicolon": { + "options": [ + "always" + ] + }, + "space-before-function-paren": { + "options": { + "anonymous": "never", + "asyncArrow": "always", + "constructor": "never", + "method": "never", + "named": "never" + } + }, "trailing-comma": false, "no-conflicting-lifecycle": true, "no-host-metadata-property": true, @@ -83,9 +111,44 @@ "no-outputs-metadata-property": true, "template-banana-in-box": true, "template-no-negated-async": true, + "typedef-whitespace": { + "options": [ + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ] + }, "use-lifecycle-interface": true, "use-pipe-transform-interface": true - }, + , "variable-name": { + "options": [ + "ban-keywords", + "check-format", + "allow-pascal-case" + ] + }, + "whitespace": { + "options": [ + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type", + "check-typecast" + ] + } +}, "rulesDirectory": [ "codelyzer" ] diff --git a/packages/custom-webpack/package.json b/packages/custom-webpack/package.json index b61180ba5..752f372cb 100644 --- a/packages/custom-webpack/package.json +++ b/packages/custom-webpack/package.json @@ -14,7 +14,7 @@ "author": "JeB Barabanov", "license": "MIT", "engines": { - "node": ">=10.0.0" + "node": ">=10.13.0" }, "keywords": [ "cli", @@ -36,12 +36,11 @@ }, "builders": "builders.json", "dependencies": { - "@angular-devkit/architect": ">=0.900.0 < 0.1000.0", - "@angular-devkit/build-angular": ">=0.900.0 < 0.1000.0", - "@angular-devkit/core": "^9.0.0", - "lodash": "^4.17.10", - "ts-node": "^8.5.2", - "webpack-merge": "^4.2.1" - }, - "gitHead": "e06cf28d3c8ac200a1434ddb9c643bf0788fb3dc" + "@angular-devkit/architect": ">=0.1000.0 < 0.1100.0", + "@angular-devkit/build-angular": ">=0.1000.0 < 0.1100.0", + "@angular-devkit/core": "^10.0.0", + "lodash": "^4.17.15", + "ts-node": "^8.10.2", + "webpack-merge": "^4.2.2" + } } diff --git a/packages/jest/README.md b/packages/jest/README.md index a383a574c..c530cd9da 100644 --- a/packages/jest/README.md +++ b/packages/jest/README.md @@ -2,15 +2,21 @@ [![npm version](https://img.shields.io/npm/v/@angular-builders/jest.svg) ![npm (tag)](https://img.shields.io/npm/v/@angular-builders/jest/next.svg) ![npm](https://img.shields.io/npm/dm/@angular-builders/jest.svg)](https://www.npmjs.com/package/@angular-builders/jest) -# This documentation is for version 9 only. Find documentation for version 7 [here](https://github.com/just-jeb/angular-builders/blob/7.x.x/packages/jest/README.md) and for version 8 [here](https://github.com/just-jeb/angular-builders/blob/8.x.x/packages/jest/README.md). - Allows running `ng test` with Jest instead of Karma & Jasmine. The builder comes to provide zero configuration setup for Jest while keeping the workspace clear of boilerplate code. +# This documentation is for the latest major version only + +## Previous versions + +- [Version 7](https://github.com/just-jeb/angular-builders/blob/7.x.x/packages/custom-webpack/README.md) +- [Version 8](https://github.com/just-jeb/angular-builders/blob/8.x.x/packages/custom-webpack/README.md) +- [Version 9](https://github.com/just-jeb/angular-builders/blob/9.x.x/packages/custom-webpack/README.md) + ## Prerequisites -- [Angular CLI 9](https://www.npmjs.com/package/@angular/cli) -- [Jest 24](https://www.npmjs.com/package/jest) +- [Angular CLI 10](https://www.npmjs.com/package/@angular/cli) +- [Jest 26](https://www.npmjs.com/package/jest) ## Installation diff --git a/packages/jest/builders.json b/packages/jest/builders.json index d3237d952..ebb087bd5 100644 --- a/packages/jest/builders.json +++ b/packages/jest/builders.json @@ -1,5 +1,5 @@ { - "$schema": "../../node_modules/@angular-devkit/architect/src/builders-schema.json", + "$schema": "./node_modules/@angular-devkit/architect/src/builders-schema.json", "builders": { "run": { "implementation": "./dist", diff --git a/packages/jest/examples/multiple-apps/package.json b/packages/jest/examples/multiple-apps/package.json index 599fc69af..f557682b8 100644 --- a/packages/jest/examples/multiple-apps/package.json +++ b/packages/jest/examples/multiple-apps/package.json @@ -12,36 +12,36 @@ }, "private": true, "dependencies": { - "@angular/animations": "^9.0.0", - "@angular/common": "^9.0.0", - "@angular/compiler": "^9.0.0", - "@angular/core": "^9.0.0", - "@angular/forms": "^9.0.0", - "@angular/platform-browser": "^9.0.0", - "@angular/platform-browser-dynamic": "^9.0.0", - "@angular/router": "^9.0.0", + "@angular/animations": "^10.0.0", + "@angular/common": "^10.0.0", + "@angular/compiler": "^10.0.0", + "@angular/core": "^10.0.0", + "@angular/forms": "^10.0.0", + "@angular/platform-browser": "^10.0.0", + "@angular/platform-browser-dynamic": "^10.0.0", + "@angular/router": "^10.0.0", "rxjs": "~6.5.2", - "tslib": "^1.10.0", + "tslib": "^2.0.0", "zone.js": "~0.10.2" }, "devDependencies": { "@angular-builders/jest": "latest", - "@angular-devkit/build-angular": ">=0.900.0 < 0.1000.0", - "@angular-devkit/build-ng-packagr": ">=0.900.0 < 0.1000.0", - "@angular/cli": "^9.0.0", - "@angular/compiler-cli": "^9.0.0", - "@angular/language-service": "^9.0.0", + "@angular-devkit/build-angular": "0.1000.0", + "@angular-devkit/build-ng-packagr": "0.1000.0", + "@angular/cli": "^10.0.0", + "@angular/compiler-cli": "^10.0.0", + "@angular/language-service": "^10.0.0", "@types/jasmine": "~3.3.13", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", "codelyzer": "^5.1.2", - "jasmine-core": "~3.4.0", - "jasmine-spec-reporter": "~4.2.1", - "jest": "^24.8.0", - "ng-packagr": "^9.0.0-rc.2", - "protractor": "^5.4.2", + "jasmine-core": "~3.5.0", + "jasmine-spec-reporter": "~5.0.0", + "jest": "^26.1.0", + "ng-packagr": "^10.0.0", + "protractor": "~7.0.0", "ts-node": "~8.2.0", - "tslint": "~5.16.0", - "typescript": "~3.7.5" + "tslint": "~6.1.0", + "typescript": "~3.9.5" } } diff --git a/packages/jest/examples/multiple-apps/projects/my-first-app/browserslist b/packages/jest/examples/multiple-apps/projects/my-first-app/.browserslistrc similarity index 100% rename from packages/jest/examples/multiple-apps/projects/my-first-app/browserslist rename to packages/jest/examples/multiple-apps/projects/my-first-app/.browserslistrc diff --git a/packages/jest/examples/multiple-apps/projects/my-first-app/configs/tsconfig.spec.json b/packages/jest/examples/multiple-apps/projects/my-first-app/configs/tsconfig.spec.json index 4b9b95189..86fa4b0d1 100644 --- a/packages/jest/examples/multiple-apps/projects/my-first-app/configs/tsconfig.spec.json +++ b/packages/jest/examples/multiple-apps/projects/my-first-app/configs/tsconfig.spec.json @@ -1,5 +1,5 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.base.json", "files": [ "../src/polyfills.ts" ], diff --git a/packages/jest/examples/multiple-apps/projects/my-first-app/e2e/tsconfig.json b/packages/jest/examples/multiple-apps/projects/my-first-app/e2e/tsconfig.json index bc240fbf8..746a24280 100644 --- a/packages/jest/examples/multiple-apps/projects/my-first-app/e2e/tsconfig.json +++ b/packages/jest/examples/multiple-apps/projects/my-first-app/e2e/tsconfig.json @@ -1,9 +1,9 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "outDir": "../../../out-tsc/e2e", "module": "commonjs", - "target": "es5", + "target": "es2018", "types": [ "jasmine", "jasminewd2", diff --git a/packages/jest/examples/multiple-apps/projects/my-first-app/tsconfig.app.json b/packages/jest/examples/multiple-apps/projects/my-first-app/tsconfig.app.json index 809c09ca7..406dd61a4 100644 --- a/packages/jest/examples/multiple-apps/projects/my-first-app/tsconfig.app.json +++ b/packages/jest/examples/multiple-apps/projects/my-first-app/tsconfig.app.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "../../out-tsc/app", "types": [] diff --git a/packages/jest/examples/multiple-apps/projects/my-second-app/browserslist b/packages/jest/examples/multiple-apps/projects/my-second-app/.browserslistrc similarity index 100% rename from packages/jest/examples/multiple-apps/projects/my-second-app/browserslist rename to packages/jest/examples/multiple-apps/projects/my-second-app/.browserslistrc diff --git a/packages/jest/examples/multiple-apps/projects/my-second-app/e2e/tsconfig.json b/packages/jest/examples/multiple-apps/projects/my-second-app/e2e/tsconfig.json index bc240fbf8..746a24280 100644 --- a/packages/jest/examples/multiple-apps/projects/my-second-app/e2e/tsconfig.json +++ b/packages/jest/examples/multiple-apps/projects/my-second-app/e2e/tsconfig.json @@ -1,9 +1,9 @@ { - "extends": "../../../tsconfig.json", + "extends": "../../../tsconfig.base.json", "compilerOptions": { "outDir": "../../../out-tsc/e2e", "module": "commonjs", - "target": "es5", + "target": "es2018", "types": [ "jasmine", "jasminewd2", diff --git a/packages/jest/examples/multiple-apps/projects/my-second-app/tsconfig.app.json b/packages/jest/examples/multiple-apps/projects/my-second-app/tsconfig.app.json index 809c09ca7..406dd61a4 100644 --- a/packages/jest/examples/multiple-apps/projects/my-second-app/tsconfig.app.json +++ b/packages/jest/examples/multiple-apps/projects/my-second-app/tsconfig.app.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "../../out-tsc/app", "types": [] diff --git a/packages/jest/examples/multiple-apps/projects/my-second-app/tsconfig.spec.json b/packages/jest/examples/multiple-apps/projects/my-second-app/tsconfig.spec.json index 50e0319f0..e8210a930 100644 --- a/packages/jest/examples/multiple-apps/projects/my-second-app/tsconfig.spec.json +++ b/packages/jest/examples/multiple-apps/projects/my-second-app/tsconfig.spec.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "../../out-tsc/spec", }, diff --git a/packages/jest/examples/multiple-apps/projects/my-shared-library/package.json b/packages/jest/examples/multiple-apps/projects/my-shared-library/package.json index ae1158725..0bc06303a 100644 --- a/packages/jest/examples/multiple-apps/projects/my-shared-library/package.json +++ b/packages/jest/examples/multiple-apps/projects/my-shared-library/package.json @@ -4,5 +4,8 @@ "peerDependencies": { "@angular/common": "^8.0.0", "@angular/core": "^8.0.0" + }, + "dependencies": { + "tslib": "^2.0.0" } } \ No newline at end of file diff --git a/packages/jest/examples/multiple-apps/projects/my-shared-library/tsconfig.lib.json b/packages/jest/examples/multiple-apps/projects/my-shared-library/tsconfig.lib.json index 0e0b9c45d..f67fefaf1 100644 --- a/packages/jest/examples/multiple-apps/projects/my-shared-library/tsconfig.lib.json +++ b/packages/jest/examples/multiple-apps/projects/my-shared-library/tsconfig.lib.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "../../out-tsc/lib", "target": "es2015", diff --git a/packages/jest/examples/multiple-apps/projects/my-shared-library/tsconfig.spec.json b/packages/jest/examples/multiple-apps/projects/my-shared-library/tsconfig.spec.json index d3ab57d03..4fad15347 100644 --- a/packages/jest/examples/multiple-apps/projects/my-shared-library/tsconfig.spec.json +++ b/packages/jest/examples/multiple-apps/projects/my-shared-library/tsconfig.spec.json @@ -1,5 +1,5 @@ { - "extends": "../../tsconfig.json", + "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "../../out-tsc/spec", }, diff --git a/packages/jest/examples/multiple-apps/tsconfig.base.json b/packages/jest/examples/multiple-apps/tsconfig.base.json new file mode 100644 index 000000000..2836f9375 --- /dev/null +++ b/packages/jest/examples/multiple-apps/tsconfig.base.json @@ -0,0 +1,27 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "module": "esnext", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "importHelpers": true, + "target": "es2015", + "lib": [ + "es2018", + "dom" + ], + "paths": { + "my-shared-library": [ + "dist/my-shared-library" + ], + "my-shared-library/*": [ + "dist/my-shared-library/*" + ] + } + } +} \ No newline at end of file diff --git a/packages/jest/examples/multiple-apps/tsconfig.json b/packages/jest/examples/multiple-apps/tsconfig.json index 2836f9375..cf94dfbea 100644 --- a/packages/jest/examples/multiple-apps/tsconfig.json +++ b/packages/jest/examples/multiple-apps/tsconfig.json @@ -1,27 +1,23 @@ +/* + This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. + It is not intended to be used to perform a compilation. + + To learn more about this file see: https://angular.io/config/solution-tsconfig. +*/ { - "compileOnSave": false, - "compilerOptions": { - "baseUrl": "./", - "outDir": "./dist/out-tsc", - "sourceMap": true, - "declaration": false, - "module": "esnext", - "moduleResolution": "node", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "importHelpers": true, - "target": "es2015", - "lib": [ - "es2018", - "dom" - ], - "paths": { - "my-shared-library": [ - "dist/my-shared-library" - ], - "my-shared-library/*": [ - "dist/my-shared-library/*" - ] + "files": [], + "references": [ + { + "path": "./projects/my-first-app/tsconfig.app.json" + }, + { + "path": "././configs/tsconfig.spec.json" + }, + { + "path": "./projects/my-second-app/tsconfig.app.json" + }, + { + "path": "./projects/my-shared-library/tsconfig.lib.json" } - } + ] } \ No newline at end of file diff --git a/packages/jest/examples/multiple-apps/tslint.json b/packages/jest/examples/multiple-apps/tslint.json index 62a9cc5f0..39c2c0962 100644 --- a/packages/jest/examples/multiple-apps/tslint.json +++ b/packages/jest/examples/multiple-apps/tslint.json @@ -4,15 +4,30 @@ "codelyzer" ], "rules": { + "align": { + "options": [ + "parameters", + "statements" + ] + }, "array-type": false, "arrow-parens": false, + "arrow-return-shorthand": true, + "curly": true, "deprecation": { "severity": "warn" }, + "eofline": true, "import-blacklist": [ true, "rxjs/Rx" ], + "import-spacing": true, + "indent": { + "options": [ + "spaces" + ] + }, "interface-name": false, "max-classes-per-file": false, "max-line-length": [ @@ -48,7 +63,6 @@ "no-non-null-assertion": true, "no-redundant-jsdoc": true, "no-switch-case-fall-through": true, - "no-use-before-declare": true, "no-var-requires": false, "object-literal-key-quotes": [ true, @@ -60,6 +74,20 @@ true, "single" ], + "semicolon": { + "options": [ + "always" + ] + }, + "space-before-function-paren": { + "options": { + "anonymous": "never", + "asyncArrow": "always", + "constructor": "never", + "method": "never", + "named": "never" + } + }, "trailing-comma": false, "component-class-suffix": true, "contextual-lifecycle": true, @@ -74,7 +102,42 @@ "no-outputs-metadata-property": true, "template-banana-in-box": true, "template-no-negated-async": true, + "typedef-whitespace": { + "options": [ + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ] + }, "use-lifecycle-interface": true, "use-pipe-transform-interface": true - } + , "variable-name": { + "options": [ + "ban-keywords", + "check-format", + "allow-pascal-case" + ] + }, + "whitespace": { + "options": [ + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type", + "check-typecast" + ] + } +} } \ No newline at end of file diff --git a/packages/jest/examples/simple-app/browserslist b/packages/jest/examples/simple-app/.browserslistrc similarity index 100% rename from packages/jest/examples/simple-app/browserslist rename to packages/jest/examples/simple-app/.browserslistrc diff --git a/packages/jest/examples/simple-app/e2e/tsconfig.json b/packages/jest/examples/simple-app/e2e/tsconfig.json index 39b800f78..6b87cc425 100644 --- a/packages/jest/examples/simple-app/e2e/tsconfig.json +++ b/packages/jest/examples/simple-app/e2e/tsconfig.json @@ -1,9 +1,9 @@ { - "extends": "../tsconfig.json", + "extends": "../tsconfig.base.json", "compilerOptions": { "outDir": "../out-tsc/e2e", "module": "commonjs", - "target": "es5", + "target": "es2018", "types": [ "jasmine", "jasminewd2", diff --git a/packages/jest/examples/simple-app/package.json b/packages/jest/examples/simple-app/package.json index 69ff80635..74ce65456 100644 --- a/packages/jest/examples/simple-app/package.json +++ b/packages/jest/examples/simple-app/package.json @@ -12,35 +12,35 @@ }, "private": true, "dependencies": { - "@angular/animations": "^9.0.0", - "@angular/common": "^9.0.0", - "@angular/compiler": "^9.0.0", - "@angular/core": "^9.0.0", - "@angular/forms": "^9.0.0", - "@angular/platform-browser": "^9.0.0", - "@angular/platform-browser-dynamic": "^9.0.0", - "@angular/router": "^9.0.0", + "@angular/animations": "^10.0.0", + "@angular/common": "^10.0.0", + "@angular/compiler": "^10.0.0", + "@angular/core": "^10.0.0", + "@angular/forms": "^10.0.0", + "@angular/platform-browser": "^10.0.0", + "@angular/platform-browser-dynamic": "^10.0.0", + "@angular/router": "^10.0.0", "rxjs": "~6.5.2", - "tslib": "^1.10.0", + "tslib": "^2.0.0", "zone.js": "~0.10.2" }, "devDependencies": { "@angular-builders/jest": "latest", - "@angular-devkit/build-angular": ">=0.900.0 < 0.1000.0", - "@angular/cli": "^9.0.0", - "@angular/compiler-cli": "^9.0.0", - "@angular/language-service": "^9.0.0", + "@angular-devkit/build-angular": "0.1000.0", + "@angular/cli": "^10.0.0", + "@angular/compiler-cli": "^10.0.0", + "@angular/language-service": "^10.0.0", "@types/jasmine": "~3.3.13", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", "codelyzer": "^5.1.2", - "jasmine-core": "~3.4.0", - "jasmine-spec-reporter": "~4.2.1", - "jest": "^24.8.0", + "jasmine-core": "~3.5.0", + "jasmine-spec-reporter": "~5.0.0", + "jest": "^26.1.0", "jest-junit": "^6.4.0", - "protractor": "^5.4.2", + "protractor": "~7.0.0", "ts-node": "~8.2.0", - "tslint": "~5.16.0", - "typescript": "~3.7.5" + "tslint": "~6.1.0", + "typescript": "~3.9.5" } } diff --git a/packages/jest/examples/simple-app/tsconfig.app.json b/packages/jest/examples/simple-app/tsconfig.app.json index f758d9820..44795bd55 100644 --- a/packages/jest/examples/simple-app/tsconfig.app.json +++ b/packages/jest/examples/simple-app/tsconfig.app.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig.base.json", "compilerOptions": { "outDir": "./out-tsc/app", "types": [] diff --git a/packages/jest/examples/simple-app/tsconfig.base.json b/packages/jest/examples/simple-app/tsconfig.base.json new file mode 100644 index 000000000..b6112641f --- /dev/null +++ b/packages/jest/examples/simple-app/tsconfig.base.json @@ -0,0 +1,19 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "module": "esnext", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "importHelpers": true, + "target": "es2015", + "lib": [ + "es2018", + "dom" + ] + } +} diff --git a/packages/jest/examples/simple-app/tsconfig.json b/packages/jest/examples/simple-app/tsconfig.json index b6112641f..38ef5b409 100644 --- a/packages/jest/examples/simple-app/tsconfig.json +++ b/packages/jest/examples/simple-app/tsconfig.json @@ -1,19 +1,14 @@ +/* + This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. + It is not intended to be used to perform a compilation. + + To learn more about this file see: https://angular.io/config/solution-tsconfig. +*/ { - "compileOnSave": false, - "compilerOptions": { - "baseUrl": "./", - "outDir": "./dist/out-tsc", - "sourceMap": true, - "declaration": false, - "module": "esnext", - "moduleResolution": "node", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "importHelpers": true, - "target": "es2015", - "lib": [ - "es2018", - "dom" - ] - } -} + "files": [], + "references": [ + { + "path": "./tsconfig.app.json" + } + ] +} \ No newline at end of file diff --git a/packages/jest/examples/simple-app/tsconfig.spec.json b/packages/jest/examples/simple-app/tsconfig.spec.json index 64cc445a6..00bce7c2a 100644 --- a/packages/jest/examples/simple-app/tsconfig.spec.json +++ b/packages/jest/examples/simple-app/tsconfig.spec.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig.base.json", "compilerOptions": { "outDir": "./out-tsc/spec", }, diff --git a/packages/jest/examples/simple-app/tslint.json b/packages/jest/examples/simple-app/tslint.json index 188bd78d3..d320b01fb 100644 --- a/packages/jest/examples/simple-app/tslint.json +++ b/packages/jest/examples/simple-app/tslint.json @@ -1,8 +1,16 @@ { "extends": "tslint:recommended", "rules": { + "align": { + "options": [ + "parameters", + "statements" + ] + }, "array-type": false, "arrow-parens": false, + "arrow-return-shorthand": true, + "curly": true, "deprecation": { "severity": "warn" }, @@ -21,10 +29,17 @@ "app", "kebab-case" ], + "eofline": true, "import-blacklist": [ true, "rxjs/Rx" ], + "import-spacing": true, + "indent": { + "options": [ + "spaces" + ] + }, "interface-name": false, "max-classes-per-file": false, "max-line-length": [ @@ -60,7 +75,6 @@ "no-non-null-assertion": true, "no-redundant-jsdoc": true, "no-switch-case-fall-through": true, - "no-use-before-declare": true, "no-var-requires": false, "object-literal-key-quotes": [ true, @@ -72,6 +86,20 @@ true, "single" ], + "semicolon": { + "options": [ + "always" + ] + }, + "space-before-function-paren": { + "options": { + "anonymous": "never", + "asyncArrow": "always", + "constructor": "never", + "method": "never", + "named": "never" + } + }, "trailing-comma": false, "no-conflicting-lifecycle": true, "no-host-metadata-property": true, @@ -83,9 +111,44 @@ "no-outputs-metadata-property": true, "template-banana-in-box": true, "template-no-negated-async": true, + "typedef-whitespace": { + "options": [ + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ] + }, "use-lifecycle-interface": true, "use-pipe-transform-interface": true - }, + , "variable-name": { + "options": [ + "ban-keywords", + "check-format", + "allow-pascal-case" + ] + }, + "whitespace": { + "options": [ + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type", + "check-typecast" + ] + } +}, "rulesDirectory": [ "codelyzer" ] diff --git a/packages/jest/package.json b/packages/jest/package.json index 7ed76c6d9..78b40b82c 100644 --- a/packages/jest/package.json +++ b/packages/jest/package.json @@ -9,7 +9,7 @@ "author": "JeB Barabanov", "license": "MIT", "engines": { - "node": ">=10.0.0" + "node": ">=10.13.0" }, "main": "dist/index.js", "files": [ @@ -38,16 +38,15 @@ "ci": "./scripts/ci.sh" }, "dependencies": { - "@angular-devkit/architect": ">=0.900.0 < 0.1000.0", - "@angular-devkit/core": "^9.0.0", - "jest-preset-angular": "^8.1.2", - "lodash": "^4.17.10" + "@angular-devkit/architect": ">=0.1000.0 < 0.1100.0", + "@angular-devkit/core": "^10.0.0", + "jest-preset-angular": "^8.2.1", + "lodash": "^4.17.15" }, "peerDependencies": { - "jest": ">=24" + "jest": ">=26" }, "devDependencies": { - "jest": "^24.5.0" - }, - "gitHead": "e06cf28d3c8ac200a1434ddb9c643bf0788fb3dc" + "jest": "^26.1.0" + } } diff --git a/packages/timestamp/README.md b/packages/timestamp/README.md index 683fb14de..ee0225a17 100644 --- a/packages/timestamp/README.md +++ b/packages/timestamp/README.md @@ -2,7 +2,7 @@ [![npm version](https://img.shields.io/npm/v/@angular-builders/timestamp.svg) ![npm (tag)](https://img.shields.io/npm/v/@angular-builders/timestamp/next.svg) ![npm](https://img.shields.io/npm/dm/@angular-builders/timestamp.svg)](https://www.npmjs.com/package/@angular-builders/timestamp) -This builder is an example from the Medium article [Angular CLI 6 under the hood — builders demystified](https://medium.com/@just-jeb/angular-cli-6-under-the-hood-builders-demystified-f0690ebcf01). +This builder is an example from the Medium article [Angular CLI under the hood — builders demystified](https://medium.com/angular-in-depth/angular-cli-under-the-hood-builders-demystified-v2-e73ee0f2d811). ## Usage diff --git a/packages/timestamp/builders.json b/packages/timestamp/builders.json index 253b5aafa..7ea4eab2c 100644 --- a/packages/timestamp/builders.json +++ b/packages/timestamp/builders.json @@ -1,5 +1,5 @@ { - "$schema": "../../node_modules/@angular-devkit/architect/src/builders-schema.json", + "$schema": "./node_modules/@angular-devkit/architect/src/builders-schema.json", "builders": { "file": { "implementation": "./dist", diff --git a/packages/timestamp/example/browserslist b/packages/timestamp/example/.browserslistrc similarity index 100% rename from packages/timestamp/example/browserslist rename to packages/timestamp/example/.browserslistrc diff --git a/packages/timestamp/example/e2e/tsconfig.json b/packages/timestamp/example/e2e/tsconfig.json index 39b800f78..6b87cc425 100644 --- a/packages/timestamp/example/e2e/tsconfig.json +++ b/packages/timestamp/example/e2e/tsconfig.json @@ -1,9 +1,9 @@ { - "extends": "../tsconfig.json", + "extends": "../tsconfig.base.json", "compilerOptions": { "outDir": "../out-tsc/e2e", "module": "commonjs", - "target": "es5", + "target": "es2018", "types": [ "jasmine", "jasminewd2", diff --git a/packages/timestamp/example/package.json b/packages/timestamp/example/package.json index ff82202bb..85a34c397 100644 --- a/packages/timestamp/example/package.json +++ b/packages/timestamp/example/package.json @@ -13,21 +13,21 @@ "dependencies": { "@angular/animations": "^10.0.0", "@angular/common": "^10.0.0", - "@angular/compiler": "^9.0.0", - "@angular/core": "^9.0.0", + "@angular/compiler": "^10.0.0", + "@angular/core": "^10.0.0", "@angular/forms": "^10.0.0", "@angular/platform-browser": "^10.0.0", "@angular/platform-browser-dynamic": "^10.0.0", "@angular/router": "^10.0.0", "rxjs": "~6.5.2", - "tslib": "^1.10.0", + "tslib": "^2.0.0", "zone.js": "~0.10.2" }, "devDependencies": { "@angular-builders/timestamp": "latest", - "@angular-devkit/build-angular": ">=0.900.0 < 0.1000.0", + "@angular-devkit/build-angular": "0.1000.0", "@angular/cli": "^10.0.0", - "@angular/compiler-cli": "^9.0.0", + "@angular/compiler-cli": "^10.0.0", "@angular/language-service": "^10.0.0", "@types/jasmine": "~3.5.0", "@types/jasminewd2": "~2.0.3", @@ -35,14 +35,14 @@ "codelyzer": "^5.1.2", "jasmine-core": "~3.5.0", "jasmine-spec-reporter": "~5.0.0", - "karma": "~5.1.0", + "karma": "~5.0.0", "karma-chrome-launcher": "~3.1.0", - "karma-coverage-istanbul-reporter": "~3.0.3", - "karma-jasmine": "~3.3.1", - "karma-jasmine-html-reporter": "^1.4.2", - "protractor": "^7.0.0", + "karma-coverage-istanbul-reporter": "~3.0.2", + "karma-jasmine": "~3.3.0", + "karma-jasmine-html-reporter": "^1.5.0", + "protractor": "~7.0.0", "ts-node": "~8.10.2", "tslint": "~6.1.0", - "typescript": "~3.8.3" + "typescript": "~3.9.5" } -} +} \ No newline at end of file diff --git a/packages/timestamp/example/tsconfig.app.json b/packages/timestamp/example/tsconfig.app.json index f758d9820..44795bd55 100644 --- a/packages/timestamp/example/tsconfig.app.json +++ b/packages/timestamp/example/tsconfig.app.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig.base.json", "compilerOptions": { "outDir": "./out-tsc/app", "types": [] diff --git a/packages/timestamp/example/tsconfig.base.json b/packages/timestamp/example/tsconfig.base.json new file mode 100644 index 000000000..6ec9ceb17 --- /dev/null +++ b/packages/timestamp/example/tsconfig.base.json @@ -0,0 +1,22 @@ +{ + "compileOnSave": false, + "compilerOptions": { + "baseUrl": "./", + "outDir": "./dist/out-tsc", + "sourceMap": true, + "declaration": false, + "module": "esnext", + "moduleResolution": "node", + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "importHelpers": true, + "target": "es2015", + "typeRoots": [ + "node_modules/@types" + ], + "lib": [ + "es2018", + "dom" + ] + } +} diff --git a/packages/timestamp/example/tsconfig.json b/packages/timestamp/example/tsconfig.json index 6ec9ceb17..7e00e7077 100644 --- a/packages/timestamp/example/tsconfig.json +++ b/packages/timestamp/example/tsconfig.json @@ -1,22 +1,17 @@ +/* + This is a "Solution Style" tsconfig.json file, and is used by editors and TypeScript’s language server to improve development experience. + It is not intended to be used to perform a compilation. + + To learn more about this file see: https://angular.io/config/solution-tsconfig. +*/ { - "compileOnSave": false, - "compilerOptions": { - "baseUrl": "./", - "outDir": "./dist/out-tsc", - "sourceMap": true, - "declaration": false, - "module": "esnext", - "moduleResolution": "node", - "emitDecoratorMetadata": true, - "experimentalDecorators": true, - "importHelpers": true, - "target": "es2015", - "typeRoots": [ - "node_modules/@types" - ], - "lib": [ - "es2018", - "dom" - ] - } -} + "files": [], + "references": [ + { + "path": "./tsconfig.app.json" + }, + { + "path": "./tsconfig.spec.json" + } + ] +} \ No newline at end of file diff --git a/packages/timestamp/example/tsconfig.spec.json b/packages/timestamp/example/tsconfig.spec.json index 6400fde7d..1db2e6ee9 100644 --- a/packages/timestamp/example/tsconfig.spec.json +++ b/packages/timestamp/example/tsconfig.spec.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig.json", + "extends": "./tsconfig.base.json", "compilerOptions": { "outDir": "./out-tsc/spec", "types": [ diff --git a/packages/timestamp/example/tslint.json b/packages/timestamp/example/tslint.json index 188bd78d3..d320b01fb 100644 --- a/packages/timestamp/example/tslint.json +++ b/packages/timestamp/example/tslint.json @@ -1,8 +1,16 @@ { "extends": "tslint:recommended", "rules": { + "align": { + "options": [ + "parameters", + "statements" + ] + }, "array-type": false, "arrow-parens": false, + "arrow-return-shorthand": true, + "curly": true, "deprecation": { "severity": "warn" }, @@ -21,10 +29,17 @@ "app", "kebab-case" ], + "eofline": true, "import-blacklist": [ true, "rxjs/Rx" ], + "import-spacing": true, + "indent": { + "options": [ + "spaces" + ] + }, "interface-name": false, "max-classes-per-file": false, "max-line-length": [ @@ -60,7 +75,6 @@ "no-non-null-assertion": true, "no-redundant-jsdoc": true, "no-switch-case-fall-through": true, - "no-use-before-declare": true, "no-var-requires": false, "object-literal-key-quotes": [ true, @@ -72,6 +86,20 @@ true, "single" ], + "semicolon": { + "options": [ + "always" + ] + }, + "space-before-function-paren": { + "options": { + "anonymous": "never", + "asyncArrow": "always", + "constructor": "never", + "method": "never", + "named": "never" + } + }, "trailing-comma": false, "no-conflicting-lifecycle": true, "no-host-metadata-property": true, @@ -83,9 +111,44 @@ "no-outputs-metadata-property": true, "template-banana-in-box": true, "template-no-negated-async": true, + "typedef-whitespace": { + "options": [ + { + "call-signature": "nospace", + "index-signature": "nospace", + "parameter": "nospace", + "property-declaration": "nospace", + "variable-declaration": "nospace" + }, + { + "call-signature": "onespace", + "index-signature": "onespace", + "parameter": "onespace", + "property-declaration": "onespace", + "variable-declaration": "onespace" + } + ] + }, "use-lifecycle-interface": true, "use-pipe-transform-interface": true - }, + , "variable-name": { + "options": [ + "ban-keywords", + "check-format", + "allow-pascal-case" + ] + }, + "whitespace": { + "options": [ + "check-branch", + "check-decl", + "check-operator", + "check-separator", + "check-type", + "check-typecast" + ] + } +}, "rulesDirectory": [ "codelyzer" ] diff --git a/packages/timestamp/package.json b/packages/timestamp/package.json index 3d7081b75..69dfdb563 100644 --- a/packages/timestamp/package.json +++ b/packages/timestamp/package.json @@ -13,7 +13,7 @@ "builders.json" ], "engines": { - "node": ">=10.0.0" + "node": ">=10.13.0" }, "builders": "builders.json", "scripts": { @@ -25,12 +25,11 @@ "generate": "../../node_modules/.bin/quicktype -s schema src/schema.json -o src/schema.ts" }, "devDependencies": { - "@types/dateformat": "^3.0.0" + "@types/dateformat": "^3.0.1" }, "dependencies": { - "@angular-devkit/architect": ">=0.900.0 < 0.1000.0", - "@angular-devkit/core": "^9.0.0", + "@angular-devkit/architect": ">=0.1000.0 < 0.1100.0", + "@angular-devkit/core": "^10.0.0", "dateformat": "^3.0.3" - }, - "gitHead": "e06cf28d3c8ac200a1434ddb9c643bf0788fb3dc" + } }