Skip to content

Commit

Permalink
feat(@angular/cli): use devkit/build-webpack in projects
Browse files Browse the repository at this point in the history
  • Loading branch information
filipesilva committed Mar 28, 2018
1 parent af68853 commit 7d27bf7
Show file tree
Hide file tree
Showing 8 changed files with 430 additions and 5,478 deletions.
5,750 changes: 413 additions & 5,337 deletions package-lock.json

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,6 @@
"homepage": "https://github.com/angular/angular-cli",
"dependencies": {
"@angular-devkit/architect": "0.0.8",
"@angular-devkit/build-webpack": "0.0.8",
"@angular-devkit/core": "0.4.7",
"@angular-devkit/schematics": "0.4.7",
"@schematics/angular": "0.4.7",
Expand All @@ -60,7 +59,6 @@
"rxjs": "^5.5.8",
"semver": "^5.3.0",
"silent-error": "^1.0.0",
"typescript": "~2.6.2",
"yargs-parser": "^9.0.2"
},
"devDependencies": {
Expand Down Expand Up @@ -102,8 +100,10 @@
"tar": "^4.1.1",
"temp": "0.8.3",
"through": "^2.3.6",
"tree-kill": "^1.2.0",
"ts-node": "^4.1.0",
"tslint": "^5.8.0",
"typescript": "~2.6.2",
"zone.js": "^0.8.20"
}
}
3 changes: 0 additions & 3 deletions packages/@angular/cli/models/architect-command.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,6 @@ import { WorkspaceLoader } from '../models/workspace-loader';
import { of } from 'rxjs/observable/of';
const stringUtils = require('ember-cli-string-utils');

// TODO: consider making this a local project dependency instead.
// We assume the default build-webpack package, so we need to add it here for the dep checker.
// require('@angular-devkit/build-webpack')

export interface GenericTargetTargetSpecifier {
target: string;
Expand Down
1 change: 0 additions & 1 deletion packages/@angular/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@
"homepage": "https://github.com/angular/angular-cli",
"dependencies": {
"@angular-devkit/architect": "0.0.8",
"@angular-devkit/build-webpack": "0.0.8",
"@angular-devkit/core": "0.4.7",
"@angular-devkit/schematics": "0.4.7",
"@ngtools/json-schema": "1.2.0",
Expand Down
113 changes: 0 additions & 113 deletions packages/@angular/cli/utilities/service-worker/index.ts

This file was deleted.

25 changes: 7 additions & 18 deletions scripts/publish/validate_dependencies.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,8 @@ const IMPORT_RE = /(^|\n)\s*import\b(?:.|\n)*?\'[^\']*\'/g;
const REQUIRE_RE = /\brequire\('[^)]+?'\)/g;
const IGNORE_RE = /\s+@ignoreDep\s+\S+/g;
const NODE_PACKAGES = Object.keys(process.binding('natives'));
const ANGULAR_PACKAGES = [
'@angular/compiler',
'@angular/compiler-cli',
'@angular/core',
'@schematics/update'
];
const OPTIONAL_PACKAGES = [
'@angular/service-worker',
];
const PEERDEP_HACK_PACKAGES = [
'typescript',
const DYNAMIC_DEVKIT_PACKAGES = [
'@schematics/update',
];


Expand Down Expand Up @@ -134,13 +125,12 @@ for (const packageName of Object.keys(packages)) {
.concat(Object.keys(packageJson['devDependencies'] || {}))
.concat(Object.keys(packageJson['peerDependencies'] || {}));

const missingDeps = dependencies
.filter(d => allDeps.indexOf(d) == -1)
.filter(d => OPTIONAL_PACKAGES.indexOf(d) == -1);
const missingDeps = dependencies.filter(d => allDeps.indexOf(d) == -1)
.filter(x => DYNAMIC_DEVKIT_PACKAGES.indexOf(x) == -1);
reportMissingDependencies(missingDeps);

const overDeps = allDeps.filter(d => dependencies.indexOf(d) == -1)
.filter(x => ANGULAR_PACKAGES.indexOf(x) == -1);
.filter(x => DYNAMIC_DEVKIT_PACKAGES.indexOf(x) == -1);
reportExcessiveDependencies(overDeps);

console.log('');
Expand All @@ -158,12 +148,11 @@ const allRootDeps = []
const internalPackages = Object.keys(packages);
const missingRootDeps = overallDeps.filter(d => allRootDeps.indexOf(d) == -1)
.filter(d => internalPackages.indexOf(d) == -1)
.filter(x => OPTIONAL_PACKAGES.indexOf(x) == -1);
.filter(x => DYNAMIC_DEVKIT_PACKAGES.indexOf(x) == -1);
reportMissingDependencies(missingRootDeps);

const overRootDeps = allRootDeps.filter(d => overallDeps.indexOf(d) == -1)
.filter(x => ANGULAR_PACKAGES.indexOf(x) == -1)
.filter(x => PEERDEP_HACK_PACKAGES.indexOf(x) == -1);
.filter(x => DYNAMIC_DEVKIT_PACKAGES.indexOf(x) == -1);
reportExcessiveDependencies(overRootDeps);

process.exit(exitCode);
4 changes: 4 additions & 0 deletions tests/e2e/setup/500-create-project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ export default async function() {
.then(() => useCIDefaults())
.then(() => argv['ng-version'] ? useNgVersion(argv['ng-version']) : Promise.resolve())
.then(() => argv.nightly || argv['ng-sha'] ? useSha() : Promise.resolve())
// TODO: remove this when schematics are updated
.then(() => updateJsonFile('package.json', json => {
json['devDependencies']['@angular-devkit/build-webpack'] = '0.0.8';
}))
// npm link on Circle CI is very noisy.
.then(() => silentNpm('install'))
.then(() => ng('version'))
Expand Down
8 changes: 4 additions & 4 deletions tests/e2e/utils/project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ export function createProject(name: string, ...args: string[]) {
.then(() => argv['ng2'] ? useNg2() : Promise.resolve())
.then(() => argv['ng4'] ? useNg4() : Promise.resolve())
.then(() => argv.nightly || argv['ng-sha'] ? useSha() : Promise.resolve())
// TODO(architect): remove the changes to karma config when schematics are in
// .then(() => replaceInFile('karma.conf.js', /@angular\/cli/g, '@angular-devkit/build-webpack'))
// .then(() => replaceInFile('karma.conf.js', 'reports',
// `dir: require('path').join(__dirname, 'coverage'), reports`))
// TODO: remove this when schematics are updated
.then(() => updateJsonFile('package.json', json => {
json['devDependencies']['@angular-devkit/build-webpack'] = '0.0.8';
}))
.then(() => console.log(`Project ${name} created... Installing npm.`))
.then(() => silentNpm('install'));
}
Expand Down

0 comments on commit 7d27bf7

Please sign in to comment.