From e0900dd5e89750a6d7c129ce82d71354dc8882be Mon Sep 17 00:00:00 2001 From: Jonas Date: Tue, 17 Nov 2020 19:22:59 +0100 Subject: [PATCH] chore(deps)!: update to angular 11 (#874) closes #854, closes #873 --- MIGRATION.MD | 4 ++ README.md | 5 +- packages/custom-webpack/README.md | 1 + .../examples/full-cycle-app/package.json | 36 ++++++------ .../src/app/app.component.spec.ts | 55 +++++++++++-------- .../examples/sanity-app/package.json | 36 ++++++------ .../sanity-app/src/app/app.component.spec.ts | 14 +++-- packages/custom-webpack/package.json | 6 +- .../src/generic-browser-builder.ts | 2 +- .../custom-webpack/src/transform-factories.ts | 2 +- packages/jest/README.md | 3 +- .../jest/examples/multiple-apps/angular.json | 4 +- .../jest/examples/multiple-apps/package.json | 38 ++++++------- .../my-shared-library/tsconfig.lib.json | 1 + .../my-shared-library/tsconfig.lib.prod.json | 3 + .../jest/examples/simple-app/angular.json | 1 - .../jest/examples/simple-app/package.json | 35 ++++++------ packages/jest/package.json | 6 +- .../jest/src/default-config.resolver.spec.ts | 4 +- packages/jest/src/default-config.resolver.ts | 4 +- packages/jest/src/index.ts | 18 +++--- packages/timestamp/example/angular.json | 1 - packages/timestamp/example/package.json | 6 +- .../example/src/app/app.component.spec.ts | 14 +++-- packages/timestamp/package.json | 4 +- 25 files changed, 162 insertions(+), 141 deletions(-) diff --git a/MIGRATION.MD b/MIGRATION.MD index 80964b88c..b4e33a67c 100644 --- a/MIGRATION.MD +++ b/MIGRATION.MD @@ -1,3 +1,7 @@ +# Migration from version 10 to version 11 + +## No action needed + # Migration from version 9 to version 10 ## Jest builder diff --git a/README.md b/README.md index dc237aece..90844c89e 100644 --- a/README.md +++ b/README.md @@ -2,7 +2,7 @@ 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 10 +## The latest version of all the builders require Angular CLI 11 ## [Documentation for version 7](https://github.com/just-jeb/angular-builders/tree/7.x.x) @@ -10,6 +10,8 @@ The purpose of this repository is to consolidate all the community builders for ## [Documentation for version 9](https://github.com/just-jeb/angular-builders/tree/9.x.x) +## [Documentation for version 10](https://github.com/just-jeb/angular-builders/tree/10.x.x) + ## [Migration guide](./MIGRATION.MD) # Builders @@ -56,6 +58,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 3dff1ee59..14809030d 100644 --- a/packages/custom-webpack/README.md +++ b/packages/custom-webpack/README.md @@ -11,6 +11,7 @@ Allow customizing build configuration without ejecting webpack configuration (`n - [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) +- [Version 10](https://github.com/just-jeb/angular-builders/blob/10.x.x/packages/custom-webpack/README.md) ## Prerequisites: diff --git a/packages/custom-webpack/examples/full-cycle-app/package.json b/packages/custom-webpack/examples/full-cycle-app/package.json index 62af0b86d..91cda0fc6 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": "^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", + "@angular/animations": "^11.0.0", + "@angular/common": "^11.0.0", + "@angular/compiler": "^11.0.0", + "@angular/core": "^11.0.0", + "@angular/forms": "^11.0.0", + "@angular/platform-browser": "^11.0.0", + "@angular/platform-browser-dynamic": "^11.0.0", + "@angular/router": "^11.0.0", "rxjs": "~6.5.2", "tslib": "^2.0.0", "zone.js": "~0.10.2" }, "devDependencies": { "@angular-builders/custom-webpack": "latest", - "@angular-devkit/build-angular": ">=0.1000.0 < 0.1100.0", - "@angular/cli": "^10.0.0", - "@angular/compiler-cli": "^10.0.0", - "@angular/language-service": "^10.0.0", - "@types/jasmine": "~3.3.13", + "@angular-devkit/build-angular": ">=0.1100.0 < 0.1200.0", + "@angular/cli": "^11.0.1", + "@angular/compiler-cli": "^11.0.0", + "@angular/language-service": "^11.0.0", + "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", - "codelyzer": "^5.1.2", + "codelyzer": "^6.0.0", "html-webpack-plugin": "^3.2.0", - "jasmine-core": "~3.5.0", + "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~5.0.0", - "karma": "~5.0.0", + "karma": "~5.1.1", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.2", - "karma-jasmine": "~3.3.0", + "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", "protractor": "~7.0.0", "ts-node": "~8.1.1", "tslint": "~6.1.0", - "typescript": "~3.9.5" + "typescript": "~4.0.5" } } diff --git a/packages/custom-webpack/examples/full-cycle-app/src/app/app.component.spec.ts b/packages/custom-webpack/examples/full-cycle-app/src/app/app.component.spec.ts index 39f09beae..cc75c37cf 100644 --- a/packages/custom-webpack/examples/full-cycle-app/src/app/app.component.spec.ts +++ b/packages/custom-webpack/examples/full-cycle-app/src/app/app.component.spec.ts @@ -1,25 +1,36 @@ -import { TestBed, async } from '@angular/core/testing'; +import { TestBed, waitForAsync } from '@angular/core/testing'; import { AppComponent } from './app.component'; describe('AppComponent', () => { - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [AppComponent], - }).compileComponents(); - })); - it('should create the app', async(() => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.debugElement.componentInstance; - expect(app).toBeTruthy(); - })); - it(`should have as title 'app'`, async(() => { - const fixture = TestBed.createComponent(AppComponent); - const app = fixture.debugElement.componentInstance; - expect(app.title).toEqual('full-cycle-app'); - })); - it('should render title in a h1 tag', async(() => { - const fixture = TestBed.createComponent(AppComponent); - fixture.detectChanges(); - const compiled = fixture.debugElement.nativeElement; - expect(compiled.querySelector('h1').textContent).toContain('Welcome to full-cycle-app!'); - })); + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [AppComponent], + }).compileComponents(); + }) + ); + it( + 'should create the app', + waitForAsync(() => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app).toBeTruthy(); + }) + ); + it( + `should have as title 'app'`, + waitForAsync(() => { + const fixture = TestBed.createComponent(AppComponent); + const app = fixture.debugElement.componentInstance; + expect(app.title).toEqual('full-cycle-app'); + }) + ); + it( + 'should render title in a h1 tag', + waitForAsync(() => { + const fixture = TestBed.createComponent(AppComponent); + fixture.detectChanges(); + const compiled = fixture.debugElement.nativeElement; + expect(compiled.querySelector('h1').textContent).toContain('Welcome to full-cycle-app!'); + }) + ); }); diff --git a/packages/custom-webpack/examples/sanity-app/package.json b/packages/custom-webpack/examples/sanity-app/package.json index e7dfb7a5f..a483078e8 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": "^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", + "@angular/animations": "^11.0.0", + "@angular/common": "^11.0.0", + "@angular/compiler": "^11.0.0", + "@angular/core": "^11.0.0", + "@angular/forms": "^11.0.0", + "@angular/platform-browser": "^11.0.0", + "@angular/platform-browser-dynamic": "^11.0.0", + "@angular/router": "^11.0.0", "rxjs": "~6.5.2", "tslib": "^2.0.0", "zone.js": "~0.10.2" }, "devDependencies": { "@angular-builders/custom-webpack": "latest", - "@angular-devkit/build-angular": ">=0.1000.0 < 0.1100.0", - "@angular/cli": "^10.0.0", - "@angular/compiler-cli": "^10.0.0", - "@angular/language-service": "^10.0.0", - "@types/jasmine": "~3.3.13", + "@angular-devkit/build-angular": ">=0.1100.0 < 0.1200.0", + "@angular/cli": "^11.0.1", + "@angular/compiler-cli": "^11.0.0", + "@angular/language-service": "^11.0.0", + "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", - "codelyzer": "^5.1.2", - "jasmine-core": "~3.5.0", + "codelyzer": "^6.0.0", + "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~5.0.0", - "karma": "~5.0.0", + "karma": "~5.1.1", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.2", - "karma-jasmine": "~3.3.0", + "karma-jasmine": "~4.0.0", "karma-jasmine-html-reporter": "^1.5.0", "protractor": "~7.0.0", "ts-node": "~8.2.0", "tslint": "~6.1.0", - "typescript": "~3.9.5" + "typescript": "~4.0.5" } } diff --git a/packages/custom-webpack/examples/sanity-app/src/app/app.component.spec.ts b/packages/custom-webpack/examples/sanity-app/src/app/app.component.spec.ts index f3d0c90aa..24918ef71 100644 --- a/packages/custom-webpack/examples/sanity-app/src/app/app.component.spec.ts +++ b/packages/custom-webpack/examples/sanity-app/src/app/app.component.spec.ts @@ -1,12 +1,14 @@ -import { TestBed, async } from '@angular/core/testing'; +import { TestBed, waitForAsync } from '@angular/core/testing'; import { AppComponent } from './app.component'; describe('AppComponent', () => { - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [AppComponent], - }).compileComponents(); - })); + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [AppComponent], + }).compileComponents(); + }) + ); it('should create the app', () => { const fixture = TestBed.createComponent(AppComponent); diff --git a/packages/custom-webpack/package.json b/packages/custom-webpack/package.json index 92abc18ec..d627a7a6e 100644 --- a/packages/custom-webpack/package.json +++ b/packages/custom-webpack/package.json @@ -37,9 +37,9 @@ }, "builders": "builders.json", "dependencies": { - "@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", + "@angular-devkit/architect": ">=0.1100.0 < 0.1200.0", + "@angular-devkit/build-angular": ">=0.1100.0 < 0.1200.0", + "@angular-devkit/core": "^11.0.0", "lodash": "^4.17.15", "ts-node": "^9.0.0", "webpack-merge": "^4.2.2" diff --git a/packages/custom-webpack/src/generic-browser-builder.ts b/packages/custom-webpack/src/generic-browser-builder.ts index 993840230..01bfa31d9 100644 --- a/packages/custom-webpack/src/generic-browser-builder.ts +++ b/packages/custom-webpack/src/generic-browser-builder.ts @@ -4,7 +4,7 @@ import { BuilderHandlerFn, } from '@angular-devkit/architect'; import { ExecutionTransformer } from '@angular-devkit/build-angular'; -import { IndexHtmlTransform } from '@angular-devkit/build-angular/src/angular-cli-files/utilities/index-file/write-index-html'; +import { IndexHtmlTransform } from '@angular-devkit/build-angular/src/utils/index-file/write-index-html'; import { from } from 'rxjs'; import { switchMap } from 'rxjs/operators'; import { Configuration } from 'webpack'; diff --git a/packages/custom-webpack/src/transform-factories.ts b/packages/custom-webpack/src/transform-factories.ts index 4c9693c91..845a41e45 100644 --- a/packages/custom-webpack/src/transform-factories.ts +++ b/packages/custom-webpack/src/transform-factories.ts @@ -1,6 +1,6 @@ import { BuilderContext } from '@angular-devkit/architect'; import { ExecutionTransformer } from '@angular-devkit/build-angular'; -import { IndexHtmlTransform } from '@angular-devkit/build-angular/src/angular-cli-files/utilities/index-file/write-index-html'; +import { IndexHtmlTransform } from '@angular-devkit/build-angular/src/utils/index-file/write-index-html'; import { getSystemPath, normalize } from '@angular-devkit/core'; import { Configuration } from 'webpack'; import { CustomWebpackBuilder } from './custom-webpack-builder'; diff --git a/packages/jest/README.md b/packages/jest/README.md index c530cd9da..1004831a3 100644 --- a/packages/jest/README.md +++ b/packages/jest/README.md @@ -12,10 +12,11 @@ The builder comes to provide zero configuration setup for Jest while keeping the - [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) +- [Version 10](https://github.com/just-jeb/angular-builders/blob/10.x.x/packages/custom-webpack/README.md) ## Prerequisites -- [Angular CLI 10](https://www.npmjs.com/package/@angular/cli) +- [Angular CLI 11](https://www.npmjs.com/package/@angular/cli) - [Jest 26](https://www.npmjs.com/package/jest) ## Installation diff --git a/packages/jest/examples/multiple-apps/angular.json b/packages/jest/examples/multiple-apps/angular.json index 44418989e..2f3f6f8ff 100644 --- a/packages/jest/examples/multiple-apps/angular.json +++ b/packages/jest/examples/multiple-apps/angular.json @@ -39,7 +39,6 @@ "optimization": true, "outputHashing": "all", "sourceMap": false, - "extractCss": true, "namedChunks": false, "aot": true, "extractLicenses": true, @@ -149,7 +148,6 @@ "optimization": true, "outputHashing": "all", "sourceMap": false, - "extractCss": true, "namedChunks": false, "aot": true, "extractLicenses": true, @@ -227,7 +225,7 @@ "prefix": "lib", "architect": { "build": { - "builder": "@angular-devkit/build-ng-packagr:build", + "builder": "@angular-devkit/build-angular:ng-packagr", "options": { "tsConfig": "projects/my-shared-library/tsconfig.lib.json", "project": "projects/my-shared-library/ng-package.json" diff --git a/packages/jest/examples/multiple-apps/package.json b/packages/jest/examples/multiple-apps/package.json index 13af3aa91..307f62f08 100644 --- a/packages/jest/examples/multiple-apps/package.json +++ b/packages/jest/examples/multiple-apps/package.json @@ -7,41 +7,39 @@ "build": "yarn ng build", "test": "yarn ng test", "lint": "yarn ng lint", - "e2e": "yarn ng e2e", - "postinstall": "ngcc" + "e2e": "yarn ng e2e" }, "private": true, "dependencies": { - "@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", + "@angular/animations": "^11.0.0", + "@angular/common": "^11.0.0", + "@angular/compiler": "^11.0.0", + "@angular/core": "^11.0.0", + "@angular/forms": "^11.0.0", + "@angular/platform-browser": "^11.0.0", + "@angular/platform-browser-dynamic": "^11.0.0", + "@angular/router": "^11.0.0", "rxjs": "~6.5.2", "tslib": "^2.0.0", "zone.js": "~0.10.2" }, "devDependencies": { "@angular-builders/jest": "latest", - "@angular-devkit/build-angular": ">=0.1000.0 < 0.1100.0", - "@angular-devkit/build-ng-packagr": ">=0.1000.0 < 0.1100.0", - "@angular/cli": "^10.0.0", - "@angular/compiler-cli": "^10.0.0", - "@angular/language-service": "^10.0.0", - "@types/jasmine": "~3.3.13", + "@angular-devkit/build-angular": ">=0.1100.0 < 0.1200.0", + "@angular/cli": "^11.0.1", + "@angular/compiler-cli": "^11.0.0", + "@angular/language-service": "^11.0.0", + "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", - "codelyzer": "^5.1.2", - "jasmine-core": "~3.5.0", + "codelyzer": "^6.0.0", + "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~5.0.0", "jest": "^26.1.0", - "ng-packagr": "^10.0.0", + "ng-packagr": "^11.0.2", "protractor": "~7.0.0", "ts-node": "~8.2.0", "tslint": "~6.1.0", - "typescript": "~3.9.5" + "typescript": "~4.0.5" } } 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 f67fefaf1..a24eb9320 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 @@ -2,6 +2,7 @@ "extends": "../../tsconfig.base.json", "compilerOptions": { "outDir": "../../out-tsc/lib", + "declarationMap": true, "target": "es2015", "declaration": true, "inlineSources": true, diff --git a/packages/jest/examples/multiple-apps/projects/my-shared-library/tsconfig.lib.prod.json b/packages/jest/examples/multiple-apps/projects/my-shared-library/tsconfig.lib.prod.json index b1d501abb..2617a83e3 100644 --- a/packages/jest/examples/multiple-apps/projects/my-shared-library/tsconfig.lib.prod.json +++ b/packages/jest/examples/multiple-apps/projects/my-shared-library/tsconfig.lib.prod.json @@ -1,5 +1,8 @@ { "extends": "./tsconfig.lib.json", + "compilerOptions": { + "declarationMap": false + }, "angularCompilerOptions": { "enableIvy": false } diff --git a/packages/jest/examples/simple-app/angular.json b/packages/jest/examples/simple-app/angular.json index 238b2f680..f6ea02edc 100644 --- a/packages/jest/examples/simple-app/angular.json +++ b/packages/jest/examples/simple-app/angular.json @@ -43,7 +43,6 @@ "optimization": true, "outputHashing": "all", "sourceMap": false, - "extractCss": true, "namedChunks": false, "aot": true, "extractLicenses": true, diff --git a/packages/jest/examples/simple-app/package.json b/packages/jest/examples/simple-app/package.json index 446997658..1322f27b1 100644 --- a/packages/jest/examples/simple-app/package.json +++ b/packages/jest/examples/simple-app/package.json @@ -7,40 +7,39 @@ "build": "yarn ng build", "test": "yarn ng test", "lint": "yarn ng lint", - "e2e": "yarn ng e2e", - "postinstall": "ngcc" + "e2e": "yarn ng e2e" }, "private": true, "dependencies": { - "@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", + "@angular/animations": "^11.0.0", + "@angular/common": "^11.0.0", + "@angular/compiler": "^11.0.0", + "@angular/core": "^11.0.0", + "@angular/forms": "^11.0.0", + "@angular/platform-browser": "^11.0.0", + "@angular/platform-browser-dynamic": "^11.0.0", + "@angular/router": "^11.0.0", "rxjs": "~6.5.2", "tslib": "^2.0.0", "zone.js": "~0.10.2" }, "devDependencies": { "@angular-builders/jest": "latest", - "@angular-devkit/build-angular": ">=0.1000.0 < 0.1100.0", - "@angular/cli": "^10.0.0", - "@angular/compiler-cli": "^10.0.0", - "@angular/language-service": "^10.0.0", - "@types/jasmine": "~3.3.13", + "@angular-devkit/build-angular": ">=0.1100.0 < 0.1200.0", + "@angular/cli": "^11.0.1", + "@angular/compiler-cli": "^11.0.0", + "@angular/language-service": "^11.0.0", + "@types/jasmine": "~3.6.0", "@types/jasminewd2": "~2.0.3", "@types/node": "^12.11.1", - "codelyzer": "^5.1.2", - "jasmine-core": "~3.5.0", + "codelyzer": "^6.0.0", + "jasmine-core": "~3.6.0", "jasmine-spec-reporter": "~5.0.0", "jest": "^26.1.0", "jest-junit": "^6.4.0", "protractor": "~7.0.0", "ts-node": "~8.2.0", "tslint": "~6.1.0", - "typescript": "~3.9.5" + "typescript": "~4.0.5" } } diff --git a/packages/jest/package.json b/packages/jest/package.json index 8f6c3719d..ae533c7c0 100644 --- a/packages/jest/package.json +++ b/packages/jest/package.json @@ -39,9 +39,9 @@ "ci": "./scripts/ci.sh" }, "dependencies": { - "@angular-devkit/architect": ">=0.1000.0 < 0.1100.0", - "@angular-devkit/core": "^10.0.0", - "jest-preset-angular": "^8.2.1", + "@angular-devkit/architect": ">=0.1100.0 < 0.1200.0", + "@angular-devkit/core": "^11.0.0", + "jest-preset-angular": "^8.3.2", "lodash": "^4.17.15" }, "peerDependencies": { diff --git a/packages/jest/src/default-config.resolver.spec.ts b/packages/jest/src/default-config.resolver.spec.ts index f6e0ab465..7ab4718a4 100644 --- a/packages/jest/src/default-config.resolver.spec.ts +++ b/packages/jest/src/default-config.resolver.spec.ts @@ -8,7 +8,7 @@ const defaultConfigResolver = new DefaultConfigResolver(); describe('Resolve project default configuration', () => { it('Should resolve tsconfig relatively to project root', () => { const config = defaultConfigResolver.resolveForProject(normalize('/some/cool/directory')); - expect(config.globals['ts-jest'].tsConfig).toEqual( + expect(config.globals['ts-jest'].tsconfig).toEqual( getSystemPath(normalize(`/some/cool/directory/${tsConfigName}`)) ); }); @@ -16,7 +16,7 @@ describe('Resolve project default configuration', () => { it('Should resolve path to the tsconfig if "tsConfig" is provided', () => { const defaultConfigResolver = new DefaultConfigResolver('./ts-configs/tsconfig.spec.json'); const config = defaultConfigResolver.resolveForProject(normalize('/some/cool/project')); - const tsConfig = config.globals['ts-jest'].tsConfig; + const tsConfig = config.globals['ts-jest'].tsconfig; expect(tsConfig).toEqual( getSystemPath(normalize(`/some/cool/project/ts-configs/tsconfig.spec.json`)) ); diff --git a/packages/jest/src/default-config.resolver.ts b/packages/jest/src/default-config.resolver.ts index 995e0c921..27e152dd3 100644 --- a/packages/jest/src/default-config.resolver.ts +++ b/packages/jest/src/default-config.resolver.ts @@ -1,4 +1,4 @@ -import { getSystemPath, join, Path, normalize } from '@angular-devkit/core'; +import { getSystemPath, join, Path } from '@angular-devkit/core'; import defaultConfig from './jest-config/default-config'; export const testPattern = `/**/*(*.)@(spec|test).[tj]s?(x)`; @@ -17,7 +17,7 @@ export class DefaultConfigResolver { 'ts-jest': { // Join with the default `tsConfigName` if the `tsConfig` option // is not provided - tsConfig: getSystemPath(join(projectRoot, this.tsConfig || tsConfigName)), + tsconfig: getSystemPath(join(projectRoot, this.tsConfig || tsConfigName)), }, }, testMatch: [`${getSystemPath(projectRoot)}${testPattern}`], diff --git a/packages/jest/src/index.ts b/packages/jest/src/index.ts index ba83bb95b..c7331f6e9 100644 --- a/packages/jest/src/index.ts +++ b/packages/jest/src/index.ts @@ -1,5 +1,5 @@ import { BuilderContext, BuilderOutput, createBuilder } from '@angular-devkit/architect'; -import { experimental, normalize, Path, schema, json } from '@angular-devkit/core'; +import { normalize, Path, schema, json, workspaces } from '@angular-devkit/core'; import { NodeJsSyncHost } from '@angular-devkit/core/node'; import { run } from 'jest'; import { from, Observable } from 'rxjs'; @@ -13,17 +13,17 @@ import { SchemaObject as JestBuilderSchema } from './schema'; export async function getRoots( context: BuilderContext ): Promise<{ workspaceRoot: Path; projectRoot: Path }> { - const host = new NodeJsSyncHost(); const registry = new schema.CoreSchemaRegistry(); registry.addPostTransform(schema.transforms.addUndefinedDefaults); - const workspace = await experimental.workspace.Workspace.fromPath( - host, + const { workspace } = await workspaces.readWorkspace( normalize(context.workspaceRoot), - registry + workspaces.createWorkspaceHost(new NodeJsSyncHost()) ); - const projectName = context.target ? context.target.project : workspace.getDefaultProjectName(); + const projectName = context.target + ? context.target.project + : workspace.extensions['defaultProject']; - if (!projectName) { + if (typeof projectName !== 'string') { throw new Error('Must either have a target from the context or a default project.'); } @@ -31,10 +31,10 @@ export async function getRoots( // workspace.root, // normalize(workspace.getProject(projectName).root), // ); - const { root } = workspace.getProject(projectName); + const { root } = workspace.projects.get(projectName); return { projectRoot: normalize(root), - workspaceRoot: workspace.root, + workspaceRoot: normalize(context.workspaceRoot), }; } diff --git a/packages/timestamp/example/angular.json b/packages/timestamp/example/angular.json index 1e60de9cf..d79e65179 100644 --- a/packages/timestamp/example/angular.json +++ b/packages/timestamp/example/angular.json @@ -43,7 +43,6 @@ "optimization": true, "outputHashing": "all", "sourceMap": false, - "extractCss": true, "namedChunks": false, "aot": true, "extractLicenses": true, diff --git a/packages/timestamp/example/package.json b/packages/timestamp/example/package.json index 96e81667d..97c9b1444 100644 --- a/packages/timestamp/example/package.json +++ b/packages/timestamp/example/package.json @@ -25,8 +25,8 @@ }, "devDependencies": { "@angular-builders/timestamp": "latest", - "@angular-devkit/build-angular": ">=0.1000.0 < 0.1100.0", - "@angular/cli": "^11.0.0", + "@angular-devkit/build-angular": ">=0.1100.0 < 0.1200.0", + "@angular/cli": "^11.0.1", "@angular/compiler-cli": "^11.0.0", "@angular/language-service": "^11.0.0", "@types/jasmine": "~3.6.0", @@ -34,7 +34,7 @@ "@types/node": "^14.0.13", "codelyzer": "^6.0.0", "jasmine-core": "~3.6.0", - "jasmine-spec-reporter": "~6.0.0", + "jasmine-spec-reporter": "~5.0.0", "karma": "~5.2.0", "karma-chrome-launcher": "~3.1.0", "karma-coverage-istanbul-reporter": "~3.0.2", diff --git a/packages/timestamp/example/src/app/app.component.spec.ts b/packages/timestamp/example/src/app/app.component.spec.ts index bad9e963d..93c032ef8 100644 --- a/packages/timestamp/example/src/app/app.component.spec.ts +++ b/packages/timestamp/example/src/app/app.component.spec.ts @@ -1,12 +1,14 @@ -import { TestBed, async } from '@angular/core/testing'; +import { TestBed, waitForAsync } from '@angular/core/testing'; import { AppComponent } from './app.component'; describe('AppComponent', () => { - beforeEach(async(() => { - TestBed.configureTestingModule({ - declarations: [AppComponent], - }).compileComponents(); - })); + beforeEach( + waitForAsync(() => { + TestBed.configureTestingModule({ + declarations: [AppComponent], + }).compileComponents(); + }) + ); it('should create the app', () => { const fixture = TestBed.createComponent(AppComponent); diff --git a/packages/timestamp/package.json b/packages/timestamp/package.json index 234d1926a..0c6537f91 100644 --- a/packages/timestamp/package.json +++ b/packages/timestamp/package.json @@ -29,8 +29,8 @@ "@types/dateformat": "^3.0.1" }, "dependencies": { - "@angular-devkit/architect": ">=0.1000.0 < 0.1100.0", - "@angular-devkit/core": "^10.0.0", + "@angular-devkit/architect": ">=0.1100.0 < 0.1200.0", + "@angular-devkit/core": "^11.0.0", "dateformat": "^3.0.3" } }