Skip to content

Commit

Permalink
build: update Angular tooling packages to 15.0.0-next.3 (#47584)
Browse files Browse the repository at this point in the history
- This update is needed to implement the changes in `ng add localize` #47569
- Add missing `root` options to all `angular.json`, this is required as otherwise the angular.json validation will fail.
- Remove `require.context` from test.ts integration test, as this is no longer needed.
- Update payloads golden files.

PR Close #47584
  • Loading branch information
alan-agius4 authored and AndrewKushnir committed Sep 30, 2022
1 parent 50f8928 commit 249384b
Show file tree
Hide file tree
Showing 20 changed files with 525 additions and 537 deletions.
10 changes: 5 additions & 5 deletions goldens/size-tracking/integration-payloads.json
Expand Up @@ -2,7 +2,7 @@
"cli-hello-world": {
"uncompressed": {
"runtime": 1083,
"main": 125134,
"main": 124531,
"polyfills": 33824
}
},
Expand All @@ -19,7 +19,7 @@
"cli-hello-world-ivy-compat": {
"uncompressed": {
"runtime": 1102,
"main": 132120,
"main": 131519,
"polyfills": 33957
}
},
Expand All @@ -33,22 +33,22 @@
"cli-hello-world-lazy": {
"uncompressed": {
"runtime": 2835,
"main": 227905,
"main": 225269,
"polyfills": 33842,
"src_app_lazy_lazy_routes_ts": 487
}
},
"forms": {
"uncompressed": {
"runtime": 1060,
"main": 157136,
"main": 155712,
"polyfills": 33915
}
},
"animations": {
"uncompressed": {
"runtime": 1070,
"main": 156816,
"main": 155920,
"polyfills": 33814
}
},
Expand Down
6 changes: 0 additions & 6 deletions integration/animations/src/test.ts
Expand Up @@ -7,14 +7,8 @@ import {
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

declare const require: any;

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
1 change: 0 additions & 1 deletion integration/cli-elements-universal/src/main.server.ts
Expand Up @@ -8,4 +8,3 @@ if (environment.production) {
}

export { AppServerModule } from './app/app.server.module';
export { renderModule, renderModuleFactory } from '@angular/platform-server';
12 changes: 1 addition & 11 deletions integration/cli-elements-universal/src/test.ts
Expand Up @@ -7,19 +7,9 @@ import {
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

declare const require: {
context(path: string, deep?: boolean, filter?: RegExp): {
keys(): string[];
<T>(id: string): T;
};
};

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);

6 changes: 0 additions & 6 deletions integration/cli-hello-world-ivy-compat/src/test.ts
Expand Up @@ -7,14 +7,8 @@ import {
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

declare const require: any;

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
6 changes: 0 additions & 6 deletions integration/cli-hello-world-ivy-i18n/src/test.ts
Expand Up @@ -7,14 +7,8 @@ import {
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

declare const require: any;

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
6 changes: 0 additions & 6 deletions integration/cli-hello-world-lazy/src/test.ts
Expand Up @@ -7,14 +7,8 @@ import {
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

declare const require: any;

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
6 changes: 0 additions & 6 deletions integration/cli-hello-world-mocha/src/test.ts
Expand Up @@ -5,11 +5,5 @@ import 'zone.js/testing';
import {getTestBed} from '@angular/core/testing';
import {BrowserDynamicTestingModule, platformBrowserDynamicTesting} from '@angular/platform-browser-dynamic/testing';

declare const require: any;

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(BrowserDynamicTestingModule, platformBrowserDynamicTesting());
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
6 changes: 0 additions & 6 deletions integration/cli-hello-world-ts-47/src/test.ts
Expand Up @@ -7,14 +7,8 @@ import {
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

declare const require: any;

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
6 changes: 0 additions & 6 deletions integration/cli-hello-world/src/test.ts
Expand Up @@ -7,14 +7,8 @@ import {
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

declare const require: any;

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
6 changes: 0 additions & 6 deletions integration/forms/src/test.ts
Expand Up @@ -7,14 +7,8 @@ import {
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

declare const require: any;

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
11 changes: 0 additions & 11 deletions integration/trusted-types/src/test.ts
Expand Up @@ -7,19 +7,8 @@ import {
platformBrowserDynamicTesting
} from '@angular/platform-browser-dynamic/testing';

declare const require: {
context(path: string, deep?: boolean, filter?: RegExp): {
keys(): string[];
<T>(id: string): T;
};
};

// First, initialize the Angular testing environment.
getTestBed().initTestEnvironment(
BrowserDynamicTestingModule,
platformBrowserDynamicTesting()
);
// Then we find all the tests.
const context = require.context('./', true, /\.spec\.ts$/);
// And load the modules.
context.keys().map(context);
10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -45,13 +45,13 @@
},
"// 1": "dependencies are used locally and by bazel",
"dependencies": {
"@angular-devkit/build-angular": "^14.2.0",
"@angular-devkit/build-angular": "15.0.0-next.3",
"@angular-devkit/build-optimizer": "0.1302.0-rc.1",
"@angular-devkit/core": "^14.2.0",
"@angular-devkit/schematics": "^14.2.0",
"@angular-devkit/core": "15.0.0-next.3",
"@angular-devkit/schematics": "15.0.0-next.3",
"@angular/animations-12": "npm:@angular/animations@12.2.13",
"@angular/cdk": "^14.2.0",
"@angular/cli": "^14.2.0",
"@angular/cli": "15.0.0-next.3",
"@angular/common-12": "npm:@angular/common@12.2.13",
"@angular/core-12": "npm:@angular/core@12.2.13",
"@angular/forms-12": "npm:@angular/forms@12.2.13",
Expand Down Expand Up @@ -80,7 +80,7 @@
"@rollup/plugin-babel": "^5.3.0",
"@rollup/plugin-commonjs": "^22.0.0",
"@rollup/plugin-node-resolve": "^13.0.4",
"@schematics/angular": "^14.2.0",
"@schematics/angular": "15.0.0-next.3",
"@types/angular": "^1.6.47",
"@types/babel__core": "7.1.19",
"@types/babel__generator": "7.6.4",
Expand Down
2 changes: 1 addition & 1 deletion packages/core/schematics/test/all-migrations.spec.ts
Expand Up @@ -30,7 +30,7 @@ describe('all migrations', () => {
writeFile('/node_modules/@angular/core/index.d.ts', `export const MODULE: any;`);
writeFile('/angular.json', JSON.stringify({
version: 1,
projects: {t: {architect: {build: {options: {tsConfig: './tsconfig.json'}}}}}
projects: {t: {root: '', architect: {build: {options: {tsConfig: './tsconfig.json'}}}}}
}));
writeFile('/tsconfig.json', `{}`);

Expand Down
2 changes: 1 addition & 1 deletion packages/core/schematics/test/entry_components_spec.ts
Expand Up @@ -33,7 +33,7 @@ describe('entryComponents migration', () => {
}));
writeFile('/angular.json', JSON.stringify({
version: 1,
projects: {t: {architect: {build: {options: {tsConfig: './tsconfig.json'}}}}}
projects: {t: {root: '', architect: {build: {options: {tsConfig: './tsconfig.json'}}}}}
}));

previousWorkingDir = shx.pwd();
Expand Down
2 changes: 1 addition & 1 deletion packages/core/schematics/test/path_match_type_spec.ts
Expand Up @@ -32,7 +32,7 @@ describe('PathMatch type migration', () => {
}));
writeFile('/angular.json', JSON.stringify({
version: 1,
projects: {t: {architect: {build: {options: {tsConfig: './tsconfig.json'}}}}}
projects: {t: {root: '', architect: {build: {options: {tsConfig: './tsconfig.json'}}}}}
}));
// We need to declare the Angular symbols we're testing for, otherwise type checking won't work.
writeFile('/node_modules/@angular/router/index.d.ts', `
Expand Down
14 changes: 10 additions & 4 deletions packages/core/schematics/test/project_tsconfig_paths_spec.ts
Expand Up @@ -22,7 +22,9 @@ describe('project tsconfig paths', () => {
testTree.create('/my-custom-config.json', '');
testTree.create('/angular.json', JSON.stringify({
version: 1,
projects: {my_name: {architect: {build: {options: {tsConfig: './my-custom-config.json'}}}}}
projects: {
my_name: {root: '', architect: {build: {options: {tsConfig: './my-custom-config.json'}}}}
}
}));

expect((await getProjectTsConfigPaths(testTree)).buildPaths).toEqual(['my-custom-config.json']);
Expand All @@ -36,6 +38,7 @@ describe('project tsconfig paths', () => {
// Comments are supported in the workspace configurations.
"projects": {
"with_tests": {
"root": "",
"targets": {
"build": {
"options": {
Expand All @@ -56,7 +59,8 @@ describe('project tsconfig paths', () => {
testTree.create('/my-test-config.json', '');
testTree.create('/angular.json', JSON.stringify({
version: 1,
projects: {my_name: {architect: {test: {options: {tsConfig: './my-test-config.json'}}}}}
projects:
{my_name: {root: '', architect: {test: {options: {tsConfig: './my-test-config.json'}}}}}
}));

expect((await getProjectTsConfigPaths(testTree)).testPaths).toEqual(['my-test-config.json']);
Expand All @@ -66,7 +70,9 @@ describe('project tsconfig paths', () => {
testTree.create('/my-test-config.json', '');
testTree.create('/.angular.json', JSON.stringify({
version: 1,
projects: {with_tests: {architect: {test: {options: {tsConfig: './my-test-config.json'}}}}}
projects: {
with_tests: {root: '', architect: {test: {options: {tsConfig: './my-test-config.json'}}}}
}
}));

expect((await getProjectTsConfigPaths(testTree)).testPaths).toEqual(['my-test-config.json']);
Expand All @@ -76,7 +82,7 @@ describe('project tsconfig paths', () => {
testTree.create('/tsconfig.json', '');
testTree.create('/.angular.json', JSON.stringify({
version: 1,
projects: {app: {architect: {build: {options: {tsConfig: 'tsconfig.json'}}}}}
projects: {app: {root: '', architect: {build: {options: {tsConfig: 'tsconfig.json'}}}}}
}));

expect((await getProjectTsConfigPaths(testTree)).buildPaths).toEqual(['tsconfig.json']);
Expand Down
2 changes: 1 addition & 1 deletion packages/core/schematics/test/typed_forms_spec.ts
Expand Up @@ -33,7 +33,7 @@ describe('Typed Forms migration', () => {

writeFile('/angular.json', JSON.stringify({
version: 1,
projects: {t: {architect: {build: {options: {tsConfig: './tsconfig.json'}}}}}
projects: {t: {root: '', architect: {build: {options: {tsConfig: './tsconfig.json'}}}}}
}));

// We need to declare the Angular symbols we're testing for, otherwise type checking won't work.
Expand Down
2 changes: 2 additions & 0 deletions packages/localize/schematics/ng-add/index_spec.ts
Expand Up @@ -52,6 +52,7 @@ export { renderModule, renderModuleFactory } from '@angular/platform-server';`;
version: 1,
projects: {
'demo': {
root: '',
architect: {
build: {
builder: '@angular-devkit/build-angular:browser',
Expand Down Expand Up @@ -166,6 +167,7 @@ export { renderModule, renderModuleFactory } from '@angular/platform-server';`;
version: 1,
projects: {
'demo': {
root: '',
architect: {},
}
},
Expand Down

0 comments on commit 249384b

Please sign in to comment.