Skip to content

chore: update to angular 8.0.0-rc.1 #15909

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 10 commits into from
Apr 28, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 2 additions & 19 deletions WORKSPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ load("@bazel_tools//tools/build_defs/repo:http.bzl", "http_archive")
# Add NodeJS rules (explicitly used for sass bundle rules)
http_archive(
name = "build_bazel_rules_nodejs",
sha256 = "88e5e579fb9edfbd19791b8a3c6bfbe16ae3444dba4b428e5efd36856db7cf16",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.27.8/rules_nodejs-0.27.8.tar.gz"],
sha256 = "4c702ffeeab2d24dd4101601b6d27cf582d2e0d4cdc3abefddd4834664669b6b",
urls = ["https://github.com/bazelbuild/rules_nodejs/releases/download/0.28.0/rules_nodejs-0.28.0.tar.gz"],
)

# Add sass rules
Expand Down Expand Up @@ -68,23 +68,6 @@ rules_sass_dependencies()
load("@io_bazel_rules_sass//:defs.bzl", "sass_repositories")
sass_repositories()

# Temporarily add the Angular repository so that we can set up "ts_api_guardian".
# TODO(jelbourn): remove this once we can do all the same stuff via @npm//@angular
http_archive(
name = "angular",
sha256 = "a542f00adf5cafbcad24268d69da8e4746c22619699f29c3b3b0259d0ce52974",
url = "https://github.com/angular/angular/archive/8.0.0-beta.6.zip",
strip_prefix = "angular-8.0.0-beta.6",
)

# Only install the "ts-api-guardian" dependencies as we don't want to install the
# Angular dev dependencies which are not needed.
yarn_install(
name = "ts-api-guardian_deps",
package_json = "@angular//tools/ts-api-guardian:package.json",
yarn_lock = "@angular//tools/ts-api-guardian:yarn.lock",
)

# Bring in bazel_toolchains for RBE setup configuration.
http_archive(
name = "bazel_toolchains",
Expand Down
43 changes: 22 additions & 21 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,42 +29,42 @@
"format": "git-clang-format HEAD $(git diff HEAD --name-only | grep -v \"\\.d\\.ts\")"
},
"version": "8.0.0-beta.2",
"requiredAngularVersion": ">=7.0.0",
"requiredAngularVersion": ">=8.0.0-rc.1",
"requiredMDCVersion": "^1.1.0",
"dependencies": {
"@angular/animations": "8.0.0-beta.10",
"@angular/common": "8.0.0-beta.10",
"@angular/compiler": "8.0.0-beta.10",
"@angular/core": "8.0.0-beta.10",
"@angular/elements": "8.0.0-beta.10",
"@angular/forms": "8.0.0-beta.10",
"@angular/platform-browser": "8.0.0-beta.10",
"@angular/animations": "^8.0.0-rc.1",
"@angular/common": "^8.0.0-rc.1",
"@angular/compiler": "^8.0.0-rc.1",
"@angular/core": "^8.0.0-rc.1",
"@angular/elements": "^8.0.0-rc.1",
"@angular/forms": "^8.0.0-rc.1",
"@angular/platform-browser": "^8.0.0-rc.1",
"@webcomponents/custom-elements": "^1.1.0",
"core-js": "^2.6.1",
"material-components-web": "^1.1.0",
"rxjs": "^6.4.0",
"systemjs": "0.19.43",
"tsickle": "^0.34.0",
"tsickle": "^0.35.0",
"tslib": "^1.9.3",
"zone.js": "^0.9.0"
},
"devDependencies": {
"@angular-devkit/core": "7.3.7",
"@angular-devkit/schematics": "7.3.7",
"@angular/bazel": "8.0.0-beta.10",
"@angular/compiler-cli": "8.0.0-beta.10",
"@angular/http": "8.0.0-beta.10",
"@angular/platform-browser-dynamic": "8.0.0-beta.10",
"@angular/platform-server": "8.0.0-beta.10",
"@angular/router": "8.0.0-beta.10",
"@angular/upgrade": "8.0.0-beta.10",
"@angular-devkit/core": "^8.0.0-rc.1",
"@angular-devkit/schematics": "^8.0.0-rc.1",
"@angular/bazel": "^8.0.0-rc.1",
"@angular/compiler-cli": "^8.0.0-rc.1",
"@angular/platform-browser-dynamic": "^8.0.0-rc.1",
"@angular/platform-server": "^8.0.0-rc.1",
"@angular/router": "^8.0.0-rc.1",
"@angular/upgrade": "^8.0.0-rc.1",
"@bazel/bazel": "^0.24.1",
"@bazel/ibazel": "^0.9.0",
"@bazel/jasmine": "0.27.8",
"@bazel/karma": "0.27.8",
"@bazel/typescript": "0.27.8",
"@bazel/typescript": "^0.27.12",
"@firebase/app-types": "^0.3.2",
"@octokit/rest": "^15.9.4",
"@schematics/angular": "7.3.7",
"@schematics/angular": "^8.0.0-rc.1",
"@types/browser-sync": "^0.0.42",
"@types/chalk": "^0.4.31",
"@types/fs-extra": "^4.0.3",
Expand Down Expand Up @@ -135,11 +135,12 @@
"selenium-webdriver": "^3.6.0",
"sorcery": "^0.10.0",
"stylelint": "^9.10.1",
"ts-api-guardian": "^0.4.4",
"ts-node": "^3.0.4",
"tsconfig-paths": "^2.3.0",
"tslint": "^5.13.1",
"tsutils": "^3.0.0",
"typescript": "~3.3.3333",
"typescript": "~3.4",
"uglify-js": "^2.8.14"
}
}
4 changes: 2 additions & 2 deletions src/cdk/schematics/ng-add/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@ describe('CDK ng-add', () => {
let runner: SchematicTestRunner;
let appTree: Tree;

beforeEach(() => {
beforeEach(async () => {
runner = new SchematicTestRunner('schematics', require.resolve('../collection.json'));
appTree = createTestApp(runner);
appTree = await createTestApp(runner);
});

it('should update the package.json', () => {
Expand Down
52 changes: 26 additions & 26 deletions src/cdk/schematics/ng-generate/drag-drop/index.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ describe('CDK drag-drop schematic', () => {
runner = new SchematicTestRunner('schematics', require.resolve('../../collection.json'));
});

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

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

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

expect(moduleContent).toContain('DragDropModule');
});

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

expect(tree.files).not.toContain('/projects/material/src/app/foo/foo.component.spec.ts');
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import {createTestCaseSetup} from '../../../testing';
describe('v6 method call checks', () => {

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

const {logOutput} = await runFixers();

Expand Down
7 changes: 4 additions & 3 deletions src/cdk/schematics/testing/test-app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,14 @@
import {SchematicTestRunner, UnitTestTree} from '@angular-devkit/schematics/testing';

/** Create a base app used for testing. */
export function createTestApp(runner: SchematicTestRunner, appOptions = {}): UnitTestTree {
export async function createTestApp(runner: SchematicTestRunner, appOptions = {}):
Promise<UnitTestTree> {
const workspaceTree = runner.runExternalSchematic('@schematics/angular', 'workspace', {
name: 'workspace',
version: '6.0.0',
newProjectRoot: 'projects',
});

return runner.runExternalSchematic('@schematics/angular', 'application',
{name: 'material', ...appOptions}, workspaceTree);
return runner.runExternalSchematicAsync('@schematics/angular', 'application',
{name: 'material', ...appOptions}, workspaceTree).toPromise();
}
12 changes: 6 additions & 6 deletions src/cdk/schematics/testing/test-case-setup.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,9 @@ export function readFileContent(filePath: string): string {
* Creates a test app schematic tree that will be copied over to a real filesystem location.
* This is necessary because TSLint is not able to read from the virtual filesystem tree.
*/
export function createFileSystemTestApp(runner: SchematicTestRunner) {
export async function createFileSystemTestApp(runner: SchematicTestRunner) {
const tempFileSystemHost = new TempScopedNodeJsSyncHost();
const appTree: UnitTestTree = createTestApp(runner, {name: 'cdk-testing'});
const appTree: UnitTestTree = await createTestApp(runner, {name: 'cdk-testing'});
const tempPath = getSystemPath(tempFileSystemHost.root);

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

export function createTestCaseSetup(migrationName: string, collectionPath: string,
export async function createTestCaseSetup(migrationName: string, collectionPath: string,
inputFiles: string[]) {

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

const {appTree, tempPath, removeTempDir} = createFileSystemTestApp(runner);
const {appTree, tempPath, removeTempDir} = await createFileSystemTestApp(runner);

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

const runFixers = async function() {
runner.runSchematic(migrationName, {}, appTree);
await runner.runSchematicAsync(migrationName, {}, appTree).toPromise();

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

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

await runFixers();

Expand Down
2 changes: 1 addition & 1 deletion src/cdk/schematics/utils/ast.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

import {WorkspaceProject} from '@angular-devkit/core/src/workspace';
import {WorkspaceProject} from '@angular-devkit/core/src/experimental/workspace';
import {SchematicsException, Tree} from '@angular-devkit/schematics';
import {Schema as ComponentOptions} from '@schematics/angular/component/schema';
import {addImportToModule} from '@schematics/angular/utility/ast-utils';
Expand Down
2 changes: 1 addition & 1 deletion src/cdk/schematics/utils/get-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

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

/**
Expand Down
2 changes: 1 addition & 1 deletion src/cdk/schematics/utils/project-main-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

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

Expand Down
2 changes: 1 addition & 1 deletion src/cdk/schematics/utils/project-style-file.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
*/

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

/** Regular expression that matches all possible Angular CLI default style files. */
Expand Down
2 changes: 1 addition & 1 deletion src/cdk/schematics/utils/project-targets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

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

/** Resolves the architect options for the build target of the given project. */
Expand Down
2 changes: 1 addition & 1 deletion src/cdk/schematics/utils/schematic-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@
* found in the LICENSE file at https://angular.io/license
*/

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


/**
Expand Down
2 changes: 2 additions & 0 deletions src/e2e-app/BUILD.bazel
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,8 @@ ts_devserver(
"@npm//zone.js",
"@npm//core-js",
"@npm//hammerjs",
"@npm//material-components-web",
"@npm//moment",
"@npm//@webcomponents/custom-elements",
"//src/material/prebuilt-themes:indigo-pink",
":index.html",
Expand Down
Loading