Skip to content

Commit e02fa3a

Browse files
authored
chore: update to angular 8.0.0-rc.1 (#15909)
* chore: update to angular 8.0.0-rc.1 * build: use ts-api-guardian from npm * update rules_nodejs * update to rc.1 * updgrade ts-api-guardian * update @Angular-devkit * don't rename symbols that start with ɵɵ * add @bazel/bazel to dev deps * fix e2e deps * fix schematic tests
1 parent c0d493f commit e02fa3a

File tree

28 files changed

+585
-543
lines changed

28 files changed

+585
-543
lines changed

WORKSPACE

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
55
# Add NodeJS rules (explicitly used for sass bundle rules)
66
http_archive(
77
name = "build_bazel_rules_nodejs",
8-
sha256 = "88e5e579fb9edfbd19791b8a3c6bfbe16ae3444dba4b428e5efd36856db7cf16",
9-
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.27.8/rules_nodejs-0.27.8.tar.gz"],
8+
sha256 = "4c702ffeeab2d24dd4101601b6d27cf582d2e0d4cdc3abefddd4834664669b6b",
9+
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.28.0/rules_nodejs-0.28.0.tar.gz"],
1010
)
1111

1212
# Add sass rules
@@ -68,23 +68,6 @@ rules_sass_dependencies()
6868
load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories")
6969
sass_repositories()
7070

71-
# Temporarily add the Angular repository so that we can set up "ts_api_guardian".
72-
# TODO(jelbourn): remove this once we can do all the same stuff via @npm//@angular
73-
http_archive(
74-
name = "angular",
75-
sha256 = "a542f00adf5cafbcad24268d69da8e4746c22619699f29c3b3b0259d0ce52974",
76-
url = "https://github.com/angular/angular/archive/8.0.0-beta.6.zip",
77-
strip_prefix = "angular-8.0.0-beta.6",
78-
)
79-
80-
# Only install the "ts-api-guardian" dependencies as we don't want to install the
81-
# Angular dev dependencies which are not needed.
82-
yarn_install(
83-
name = "ts-api-guardian_deps",
84-
package_json = "@angular//tools/ts-api-guardian:package.json",
85-
yarn_lock = "@angular//tools/ts-api-guardian:yarn.lock",
86-
)
87-
8871
# Bring in bazel_toolchains for RBE setup configuration.
8972
http_archive(
9073
name = "bazel_toolchains",

package.json

Lines changed: 22 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -29,42 +29,42 @@
2929
"format": "git-clang-format HEAD $(git diff HEAD --name-only | grep -v \"\\.d\\.ts\")"
3030
},
3131
"version": "8.0.0-beta.2",
32-
"requiredAngularVersion": ">=7.0.0",
32+
"requiredAngularVersion": ">=8.0.0-rc.1",
3333
"requiredMDCVersion": "^1.1.0",
3434
"dependencies": {
35-
"@angular/animations": "8.0.0-beta.10",
36-
"@angular/common": "8.0.0-beta.10",
37-
"@angular/compiler": "8.0.0-beta.10",
38-
"@angular/core": "8.0.0-beta.10",
39-
"@angular/elements": "8.0.0-beta.10",
40-
"@angular/forms": "8.0.0-beta.10",
41-
"@angular/platform-browser": "8.0.0-beta.10",
35+
"@angular/animations": "^8.0.0-rc.1",
36+
"@angular/common": "^8.0.0-rc.1",
37+
"@angular/compiler": "^8.0.0-rc.1",
38+
"@angular/core": "^8.0.0-rc.1",
39+
"@angular/elements": "^8.0.0-rc.1",
40+
"@angular/forms": "^8.0.0-rc.1",
41+
"@angular/platform-browser": "^8.0.0-rc.1",
4242
"@webcomponents/custom-elements": "^1.1.0",
4343
"core-js": "^2.6.1",
4444
"material-components-web": "^1.1.0",
4545
"rxjs": "^6.4.0",
4646
"systemjs": "0.19.43",
47-
"tsickle": "^0.34.0",
47+
"tsickle": "^0.35.0",
4848
"tslib": "^1.9.3",
4949
"zone.js": "^0.9.0"
5050
},
5151
"devDependencies": {
52-
"@angular-devkit/core": "7.3.7",
53-
"@angular-devkit/schematics": "7.3.7",
54-
"@angular/bazel": "8.0.0-beta.10",
55-
"@angular/compiler-cli": "8.0.0-beta.10",
56-
"@angular/http": "8.0.0-beta.10",
57-
"@angular/platform-browser-dynamic": "8.0.0-beta.10",
58-
"@angular/platform-server": "8.0.0-beta.10",
59-
"@angular/router": "8.0.0-beta.10",
60-
"@angular/upgrade": "8.0.0-beta.10",
52+
"@angular-devkit/core": "^8.0.0-rc.1",
53+
"@angular-devkit/schematics": "^8.0.0-rc.1",
54+
"@angular/bazel": "^8.0.0-rc.1",
55+
"@angular/compiler-cli": "^8.0.0-rc.1",
56+
"@angular/platform-browser-dynamic": "^8.0.0-rc.1",
57+
"@angular/platform-server": "^8.0.0-rc.1",
58+
"@angular/router": "^8.0.0-rc.1",
59+
"@angular/upgrade": "^8.0.0-rc.1",
60+
"@bazel/bazel": "^0.24.1",
6161
"@bazel/ibazel": "^0.9.0",
6262
"@bazel/jasmine": "0.27.8",
6363
"@bazel/karma": "0.27.8",
64-
"@bazel/typescript": "0.27.8",
64+
"@bazel/typescript": "^0.27.12",
6565
"@firebase/app-types": "^0.3.2",
6666
"@octokit/rest": "^15.9.4",
67-
"@schematics/angular": "7.3.7",
67+
"@schematics/angular": "^8.0.0-rc.1",
6868
"@types/browser-sync": "^0.0.42",
6969
"@types/chalk": "^0.4.31",
7070
"@types/fs-extra": "^4.0.3",
@@ -135,11 +135,12 @@
135135
"selenium-webdriver": "^3.6.0",
136136
"sorcery": "^0.10.0",
137137
"stylelint": "^9.10.1",
138+
"ts-api-guardian": "^0.4.4",
138139
"ts-node": "^3.0.4",
139140
"tsconfig-paths": "^2.3.0",
140141
"tslint": "^5.13.1",
141142
"tsutils": "^3.0.0",
142-
"typescript": "~3.3.3333",
143+
"typescript": "~3.4",
143144
"uglify-js": "^2.8.14"
144145
}
145146
}

src/cdk/schematics/ng-add/index.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,9 @@ describe('CDK ng-add', () => {
66
let runner: SchematicTestRunner;
77
let appTree: Tree;
88

9-
beforeEach(() => {
9+
beforeEach(async () => {
1010
runner = new SchematicTestRunner('schematics', require.resolve('../collection.json'));
11-
appTree = createTestApp(runner);
11+
appTree = await createTestApp(runner);
1212
});
1313

1414
it('should update the package.json', () => {

src/cdk/schematics/ng-generate/drag-drop/index.spec.ts

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ describe('CDK drag-drop schematic', () => {
2020
runner = new SchematicTestRunner('schematics', require.resolve('../../collection.json'));
2121
});
2222

23-
it('should create drag-drop files and add them to module', () => {
24-
const tree = runner.runSchematic('drag-drop', baseOptions, createTestApp(runner));
23+
it('should create drag-drop files and add them to module', async () => {
24+
const tree = runner.runSchematic('drag-drop', baseOptions, await createTestApp(runner));
2525
const moduleContent = getFileContent(tree, '/projects/material/src/app/app.module.ts');
2626
const files = tree.files;
2727

@@ -34,23 +34,23 @@ describe('CDK drag-drop schematic', () => {
3434
expect(moduleContent).toMatch(/declarations:\s*\[[^\]]+?,\r?\n\s+FooComponent\r?\n/m);
3535
});
3636

37-
it('should add drag-drop module', () => {
38-
const tree = runner.runSchematic('drag-drop', baseOptions, createTestApp(runner));
37+
it('should add drag-drop module', async () => {
38+
const tree = runner.runSchematic('drag-drop', baseOptions, await createTestApp(runner));
3939
const moduleContent = getFileContent(tree, '/projects/material/src/app/app.module.ts');
4040

4141
expect(moduleContent).toContain('DragDropModule');
4242
});
4343

4444
describe('style option', () => {
45-
it('should respect the option value', () => {
45+
it('should respect the option value', async () => {
4646
const tree = runner.runSchematic(
47-
'drag-drop', {style: 'scss', ...baseOptions}, createTestApp(runner));
47+
'drag-drop', {style: 'scss', ...baseOptions}, await createTestApp(runner));
4848

4949
expect(tree.files).toContain('/projects/material/src/app/foo/foo.component.scss');
5050
});
5151

52-
it('should respect the deprecated "styleext" option value', () => {
53-
let tree = createTestApp(runner);
52+
it('should respect the deprecated "styleext" option value', async () => {
53+
let tree = await createTestApp(runner);
5454
const workspace = getWorkspace(tree);
5555
const project = getProjectFromWorkspace(workspace);
5656

@@ -66,9 +66,9 @@ describe('CDK drag-drop schematic', () => {
6666
expect(tree.files).toContain('/projects/material/src/app/foo/foo.component.scss');
6767
});
6868

69-
it('should not generate invalid stylesheets', () => {
69+
it('should not generate invalid stylesheets', async () => {
7070
const tree = runner.runSchematic(
71-
'drag-drop', {style: 'styl', ...baseOptions}, createTestApp(runner));
71+
'drag-drop', {style: 'styl', ...baseOptions}, await createTestApp(runner));
7272

7373
// In this case we expect the schematic to generate a plain "css" file because
7474
// the component schematics are using CSS style templates which are not compatible
@@ -79,56 +79,56 @@ describe('CDK drag-drop schematic', () => {
7979
'Expected the schematic to not generate a "stylus" file');
8080
});
8181

82-
it('should fall back to the @schematics/angular:component option value', () => {
82+
it('should fall back to the @schematics/angular:component option value', async () => {
8383
const tree = runner.runSchematic(
84-
'drag-drop', baseOptions, createTestApp(runner, {style: 'less'}));
84+
'drag-drop', baseOptions, await createTestApp(runner, {style: 'less'}));
8585

8686
expect(tree.files).toContain('/projects/material/src/app/foo/foo.component.less');
8787
});
8888
});
8989

9090
describe('inlineStyle option', () => {
91-
it('should respect the option value', () => {
91+
it('should respect the option value', async () => {
9292
const tree = runner.runSchematic(
93-
'drag-drop', {inlineStyle: true, ...baseOptions}, createTestApp(runner));
93+
'drag-drop', {inlineStyle: true, ...baseOptions}, await createTestApp(runner));
9494

9595
expect(tree.files).not.toContain('/projects/material/src/app/foo/foo.component.css');
9696
});
9797

98-
it('should fall back to the @schematics/angular:component option value', () => {
98+
it('should fall back to the @schematics/angular:component option value', async () => {
9999
const tree = runner.runSchematic(
100-
'drag-drop', baseOptions, createTestApp(runner, {inlineStyle: true}));
100+
'drag-drop', baseOptions, await createTestApp(runner, {inlineStyle: true}));
101101

102102
expect(tree.files).not.toContain('/projects/material/src/app/foo/foo.component.css');
103103
});
104104
});
105105

106106
describe('inlineTemplate option', () => {
107-
it('should respect the option value', () => {
107+
it('should respect the option value', async () => {
108108
const tree = runner.runSchematic(
109-
'drag-drop', {inlineTemplate: true, ...baseOptions}, createTestApp(runner));
109+
'drag-drop', {inlineTemplate: true, ...baseOptions}, await createTestApp(runner));
110110

111111
expect(tree.files).not.toContain('/projects/material/src/app/foo/foo.component.html');
112112
});
113113

114-
it('should fall back to the @schematics/angular:component option value', () => {
114+
it('should fall back to the @schematics/angular:component option value', async () => {
115115
const tree = runner.runSchematic(
116-
'drag-drop', baseOptions, createTestApp(runner, {inlineTemplate: true}));
116+
'drag-drop', baseOptions, await createTestApp(runner, {inlineTemplate: true}));
117117

118118
expect(tree.files).not.toContain('/projects/material/src/app/foo/foo.component.html');
119119
});
120120
});
121121

122122
describe('skipTests option', () => {
123-
it('should respect the option value', () => {
123+
it('should respect the option value', async () => {
124124
const tree = runner.runSchematic(
125-
'drag-drop', {skipTests: true, ...baseOptions}, createTestApp(runner));
125+
'drag-drop', {skipTests: true, ...baseOptions}, await createTestApp(runner));
126126

127127
expect(tree.files).not.toContain('/projects/material/src/app/foo/foo.component.spec.ts');
128128
});
129129

130-
it('should respect the deprecated global "spec" option value', () => {
131-
let tree = createTestApp(runner);
130+
it('should respect the deprecated global "spec" option value', async () => {
131+
let tree = await createTestApp(runner);
132132
const workspace = getWorkspace(tree);
133133
const project = getProjectFromWorkspace(workspace);
134134

@@ -144,9 +144,9 @@ describe('CDK drag-drop schematic', () => {
144144
expect(tree.files).not.toContain('/projects/material/src/app/foo/foo.component.spec.ts');
145145
});
146146

147-
it('should fall back to the @schematics/angular:component option value', () => {
147+
it('should fall back to the @schematics/angular:component option value', async () => {
148148
const tree = runner.runSchematic(
149-
'drag-drop', baseOptions, createTestApp(runner, {skipTests: true}));
149+
'drag-drop', baseOptions, await createTestApp(runner, {skipTests: true}));
150150

151151
expect(tree.files).not.toContain('/projects/material/src/app/foo/foo.component.spec.ts');
152152
});

src/cdk/schematics/ng-update/test-cases/misc/method-call-checks.spec.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,8 @@ import {createTestCaseSetup} from '../../../testing';
44
describe('v6 method call checks', () => {
55

66
it('should properly report invalid method calls', async () => {
7-
const {runFixers, removeTempDir} = createTestCaseSetup('migration-v6', migrationCollection,
8-
[require.resolve('./method-call-checks_input.ts')]);
7+
const {runFixers, removeTempDir} = await createTestCaseSetup('migration-v6',
8+
migrationCollection, [require.resolve('./method-call-checks_input.ts')]);
99

1010
const {logOutput} = await runFixers();
1111

src/cdk/schematics/testing/test-app.ts

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,14 @@
99
import {SchematicTestRunner, UnitTestTree} from '@angular-devkit/schematics/testing';
1010

1111
/** Create a base app used for testing. */
12-
export function createTestApp(runner: SchematicTestRunner, appOptions = {}): UnitTestTree {
12+
export async function createTestApp(runner: SchematicTestRunner, appOptions = {}):
13+
Promise<UnitTestTree> {
1314
const workspaceTree = runner.runExternalSchematic('@schematics/angular', 'workspace', {
1415
name: 'workspace',
1516
version: '6.0.0',
1617
newProjectRoot: 'projects',
1718
});
1819

19-
return runner.runExternalSchematic('@schematics/angular', 'application',
20-
{name: 'material', ...appOptions}, workspaceTree);
20+
return runner.runExternalSchematicAsync('@schematics/angular', 'application',
21+
{name: 'material', ...appOptions}, workspaceTree).toPromise();
2122
}

src/cdk/schematics/testing/test-case-setup.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@ export function readFileContent(filePath: string): string {
3030
* Creates a test app schematic tree that will be copied over to a real filesystem location.
3131
* This is necessary because TSLint is not able to read from the virtual filesystem tree.
3232
*/
33-
export function createFileSystemTestApp(runner: SchematicTestRunner) {
33+
export async function createFileSystemTestApp(runner: SchematicTestRunner) {
3434
const tempFileSystemHost = new TempScopedNodeJsSyncHost();
35-
const appTree: UnitTestTree = createTestApp(runner, {name: 'cdk-testing'});
35+
const appTree: UnitTestTree = await createTestApp(runner, {name: 'cdk-testing'});
3636
const tempPath = getSystemPath(tempFileSystemHost.root);
3737

3838
// Since the TSLint fix task expects all files to be present on the real file system, we
@@ -44,7 +44,7 @@ export function createFileSystemTestApp(runner: SchematicTestRunner) {
4444
return {appTree, tempPath, removeTempDir: () => removeSync(tempPath)};
4545
}
4646

47-
export function createTestCaseSetup(migrationName: string, collectionPath: string,
47+
export async function createTestCaseSetup(migrationName: string, collectionPath: string,
4848
inputFiles: string[]) {
4949

5050
const runner = new SchematicTestRunner('schematics', collectionPath);
@@ -53,7 +53,7 @@ export function createTestCaseSetup(migrationName: string, collectionPath: strin
5353
let logOutput = '';
5454
runner.logger.subscribe(entry => logOutput += entry.message);
5555

56-
const {appTree, tempPath, removeTempDir} = createFileSystemTestApp(runner);
56+
const {appTree, tempPath, removeTempDir} = await createFileSystemTestApp(runner);
5757

5858
// Write each test-case input to the file-system. This is necessary because otherwise
5959
// TSLint won't be able to pick up the test cases.
@@ -66,7 +66,7 @@ export function createTestCaseSetup(migrationName: string, collectionPath: strin
6666
});
6767

6868
const runFixers = async function() {
69-
runner.runSchematic(migrationName, {}, appTree);
69+
await runner.runSchematicAsync(migrationName, {}, appTree).toPromise();
7070

7171
// Switch to the new temporary directory because otherwise TSLint cannot read the files.
7272
process.chdir(tempPath);
@@ -149,7 +149,7 @@ export function defineJasmineTestCases(versionName: string, collectionFile: stri
149149

150150
beforeAll(async () => {
151151
const {tempPath, runFixers, removeTempDir} =
152-
createTestCaseSetup(`migration-${versionName}`, collectionFile, inputFiles);
152+
await createTestCaseSetup(`migration-${versionName}`, collectionFile, inputFiles);
153153

154154
await runFixers();
155155

src/cdk/schematics/utils/ast.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {WorkspaceProject} from '@angular-devkit/core/src/workspace';
9+
import {WorkspaceProject} from '@angular-devkit/core/src/experimental/workspace';
1010
import {SchematicsException, Tree} from '@angular-devkit/schematics';
1111
import {Schema as ComponentOptions} from '@schematics/angular/component/schema';
1212
import {addImportToModule} from '@schematics/angular/utility/ast-utils';

src/cdk/schematics/utils/get-project.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {WorkspaceSchema, WorkspaceProject} from '@angular-devkit/core/src/workspace';
9+
import {WorkspaceSchema, WorkspaceProject} from '@angular-devkit/core/src/experimental/workspace';
1010
import {SchematicsException} from '@angular-devkit/schematics';
1111

1212
/**

src/cdk/schematics/utils/project-main-file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {WorkspaceProject} from '@angular-devkit/core/src/workspace';
9+
import {WorkspaceProject} from '@angular-devkit/core/src/experimental/workspace';
1010
import {SchematicsException} from '@angular-devkit/schematics';
1111
import {getProjectTargetOptions} from './project-targets';
1212

src/cdk/schematics/utils/project-style-file.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*/
88

99
import {normalize} from '@angular-devkit/core';
10-
import {WorkspaceProject} from '@angular-devkit/core/src/workspace';
10+
import {WorkspaceProject} from '@angular-devkit/core/src/experimental/workspace';
1111
import {getProjectTargetOptions} from './project-targets';
1212

1313
/** Regular expression that matches all possible Angular CLI default style files. */

src/cdk/schematics/utils/project-targets.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {WorkspaceProject} from '@angular-devkit/core/src/workspace';
9+
import {WorkspaceProject} from '@angular-devkit/core/src/experimental/workspace';
1010
import {SchematicsException} from '@angular-devkit/schematics';
1111

1212
/** Resolves the architect options for the build target of the given project. */

src/cdk/schematics/utils/schematic-options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* found in the LICENSE file at https://angular.io/license
77
*/
88

9-
import {WorkspaceProject} from '@angular-devkit/core/src/workspace';
9+
import {WorkspaceProject} from '@angular-devkit/core/src/experimental/workspace';
1010

1111

1212
/**

src/e2e-app/BUILD.bazel

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,8 @@ ts_devserver(
7070
"@npm//zone.js",
7171
"@npm//core-js",
7272
"@npm//hammerjs",
73+
"@npm//material-components-web",
74+
"@npm//moment",
7375
"@npm//@webcomponents/custom-elements",
7476
"//src/material/prebuilt-themes:indigo-pink",
7577
":index.html",

0 commit comments

Comments
 (0)