Skip to content

Commit 27401e6

Browse files
committed
feat(@angular/cli): use architect
1 parent 9ac1b36 commit 27401e6

File tree

154 files changed

+1258
-5488
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

154 files changed

+1258
-5488
lines changed

package-lock.json

+367-324
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+4-41
Original file line numberDiff line numberDiff line change
@@ -41,64 +41,30 @@
4141
},
4242
"homepage": "https://github.com/angular/angular-cli",
4343
"dependencies": {
44-
"@angular-devkit/build-optimizer": "0.4.3",
45-
"@angular-devkit/core": "0.4.3",
44+
"@angular-devkit/architect": "angular/angular-devkit-architect-builds#7b1aa387",
45+
"@angular-devkit/build-webpack": "angular/angular-devkit-build-webpack-builds#7b1aa387",
46+
"@angular-devkit/core": "angular/angular-devkit-core-builds#7b1aa387",
4647
"@angular-devkit/schematics": "0.4.3",
4748
"@schematics/angular": "0.4.3",
4849
"@schematics/package-update": "0.4.3",
4950
"ajv": "^6.1.1",
50-
"autoprefixer": "^7.2.3",
51-
"cache-loader": "^1.2.0",
5251
"chalk": "~2.2.0",
53-
"circular-dependency-plugin": "^4.4.0",
54-
"clean-css": "^4.1.9",
5552
"common-tags": "^1.3.1",
56-
"copy-webpack-plugin": "~4.4.2",
5753
"core-object": "^3.1.0",
5854
"ember-cli-string-utils": "^1.0.0",
59-
"extract-text-webpack-plugin": "~4.0.0-beta.0",
60-
"file-loader": "^1.1.9",
6155
"fs-extra": "^4.0.0",
62-
"glob": "^7.0.3",
63-
"html-webpack-plugin": "github:webpack-contrib/html-webpack-plugin#a8a8c2b6ea496c257fd6f501db3a06a51fa03e1e",
64-
"istanbul-instrumenter-loader": "^3.0.0",
65-
"karma-source-map-support": "^1.2.0",
66-
"less": "^2.7.2",
67-
"less-loader": "^4.0.5",
68-
"license-webpack-plugin": "^1.1.2",
69-
"loader-utils": "^1.1.0",
7056
"lodash": "^4.11.1",
71-
"memory-fs": "^0.4.1",
72-
"minimatch": "^3.0.4",
7357
"node-modules-path": "^1.0.0",
7458
"nopt": "^4.0.1",
7559
"opn": "~5.1.0",
76-
"parse5": "^4.0.0",
77-
"portfinder": "~1.0.12",
78-
"postcss": "^6.0.19",
79-
"postcss-import": "^11.1.0",
80-
"postcss-loader": "^2.1.1",
81-
"postcss-url": "^7.1.2",
82-
"raw-loader": "^0.5.1",
8360
"resolve": "^1.1.7",
8461
"rxjs": "^5.5.6",
85-
"sass-loader": "^6.0.6",
8662
"semver": "^5.3.0",
8763
"silent-error": "^1.0.0",
88-
"source-map-support": "^0.4.1",
89-
"style-loader": "^0.20.2",
90-
"stylus": "^0.54.5",
91-
"stylus-loader": "^3.0.2",
9264
"tree-kill": "^1.0.0",
9365
"typescript": "~2.6.2",
94-
"uglifyjs-webpack-plugin": "^1.2.2",
95-
"url-loader": "^0.6.2",
9666
"webpack": "~4.0.0",
97-
"webpack-dev-middleware": "^2.0.6",
98-
"webpack-dev-server": "^3.0.1-beta.0",
99-
"webpack-merge": "^4.1.2",
100-
"webpack-sources": "^1.1.0",
101-
"webpack-subresource-integrity": "^1.0.1"
67+
"webpack-sources": "^1.1.0"
10268
},
10369
"devDependencies": {
10470
"@angular/common": "^5.2.0",
@@ -142,8 +108,5 @@
142108
"ts-node": "^4.1.0",
143109
"tslint": "^5.8.0",
144110
"zone.js": "^0.8.20"
145-
},
146-
"optionalDependencies": {
147-
"node-sass": "^4.7.2"
148111
}
149112
}

packages/@angular/cli/commands/build.ts

+2-209
Original file line numberDiff line numberDiff line change
@@ -1,213 +1,14 @@
1-
import { CliConfig } from '../models/config';
21
import { BuildOptions } from '../models/build-options';
32
import { Version } from '../upgrade/version';
4-
import { oneLine } from 'common-tags';
53
import { getAppFromConfig } from '../utilities/app-utils';
64
import { join } from 'path';
75
import { RenderUniversalTaskOptions } from '../tasks/render-universal';
86

97
const Command = require('../ember-cli/lib/models/command');
108
const SilentError = require('silent-error');
119

12-
const config = CliConfig.fromProject() || CliConfig.fromGlobal();
13-
const buildConfigDefaults = config.getPaths('defaults.build', [
14-
'sourcemaps', 'baseHref', 'progress', 'poll', 'deleteOutputPath', 'preserveSymlinks',
15-
'showCircularDependencies', 'commonChunk', 'namedChunks'
16-
]);
17-
1810
// defaults for BuildOptions
19-
export const baseBuildCommandOptions: any = [
20-
{
21-
name: 'target',
22-
type: String,
23-
default: 'development',
24-
aliases: ['t', { 'dev': 'development' }, { 'prod': 'production' }],
25-
description: 'Defines the build target.'
26-
},
27-
{
28-
name: 'environment',
29-
type: String,
30-
aliases: ['e'],
31-
description: 'Defines the build environment.'
32-
},
33-
{
34-
name: 'output-path',
35-
type: 'Path',
36-
aliases: ['op'],
37-
description: 'Path where output will be placed.'
38-
},
39-
{
40-
name: 'aot',
41-
type: Boolean,
42-
description: 'Build using Ahead of Time compilation.'
43-
},
44-
{
45-
name: 'sourcemaps',
46-
type: Boolean,
47-
aliases: ['sm', 'sourcemap'],
48-
description: 'Output sourcemaps.',
49-
default: buildConfigDefaults['sourcemaps']
50-
},
51-
{
52-
name: 'vendor-chunk',
53-
type: Boolean,
54-
aliases: ['vc'],
55-
description: 'Use a separate bundle containing only vendor libraries.'
56-
},
57-
{
58-
name: 'common-chunk',
59-
type: Boolean,
60-
default: buildConfigDefaults['commonChunk'],
61-
aliases: ['cc'],
62-
description: 'Use a separate bundle containing code used across multiple bundles.'
63-
},
64-
{
65-
name: 'base-href',
66-
type: String,
67-
aliases: ['bh'],
68-
description: 'Base url for the application being built.',
69-
default: buildConfigDefaults['baseHref']
70-
},
71-
{
72-
name: 'deploy-url',
73-
type: String,
74-
aliases: ['d'],
75-
description: 'URL where files will be deployed.'
76-
},
77-
{
78-
name: 'verbose',
79-
type: Boolean,
80-
default: false,
81-
aliases: ['v'],
82-
description: 'Adds more details to output logging.'
83-
},
84-
{
85-
name: 'progress',
86-
type: Boolean,
87-
aliases: ['pr'],
88-
description: 'Log progress to the console while building.',
89-
default: typeof buildConfigDefaults['progress'] !== 'undefined'
90-
? buildConfigDefaults['progress']
91-
: process.stdout.isTTY === true
92-
},
93-
{
94-
name: 'i18n-file',
95-
type: String,
96-
description: 'Localization file to use for i18n.'
97-
},
98-
{
99-
name: 'i18n-format',
100-
type: String,
101-
description: 'Format of the localization file specified with --i18n-file.'
102-
},
103-
{
104-
name: 'locale',
105-
type: String,
106-
description: 'Locale to use for i18n.'
107-
},
108-
{
109-
name: 'missing-translation',
110-
type: String,
111-
description: 'How to handle missing translations for i18n.'
112-
},
113-
{
114-
name: 'extract-css',
115-
type: Boolean,
116-
aliases: ['ec'],
117-
description: 'Extract css from global styles onto css files instead of js ones.'
118-
},
119-
{
120-
name: 'watch',
121-
type: Boolean,
122-
default: false,
123-
aliases: ['w'],
124-
description: 'Run build when files change.'
125-
},
126-
{
127-
name: 'output-hashing',
128-
type: String,
129-
values: ['none', 'all', 'media', 'bundles'],
130-
description: 'Define the output filename cache-busting hashing mode.',
131-
aliases: ['oh']
132-
},
133-
{
134-
name: 'poll',
135-
type: Number,
136-
description: 'Enable and define the file watching poll time period (milliseconds).',
137-
default: buildConfigDefaults['poll']
138-
},
139-
{
140-
name: 'app',
141-
type: String,
142-
aliases: ['a'],
143-
description: 'Specifies app name or index to use.'
144-
},
145-
{
146-
name: 'delete-output-path',
147-
type: Boolean,
148-
aliases: ['dop'],
149-
description: 'Delete output path before build.',
150-
default: buildConfigDefaults['deleteOutputPath'],
151-
},
152-
{
153-
name: 'preserve-symlinks',
154-
type: Boolean,
155-
description: 'Do not use the real path when resolving modules.',
156-
default: buildConfigDefaults['preserveSymlinks']
157-
},
158-
{
159-
name: 'extract-licenses',
160-
type: Boolean,
161-
description: 'Extract all licenses in a separate file, in the case of production builds only.'
162-
},
163-
{
164-
name: 'show-circular-dependencies',
165-
type: Boolean,
166-
aliases: ['scd'],
167-
description: 'Show circular dependency warnings on builds.',
168-
default: buildConfigDefaults['showCircularDependencies']
169-
},
170-
{
171-
name: 'build-optimizer',
172-
type: Boolean,
173-
description: 'Enables @angular-devkit/build-optimizer optimizations when using `--aot`.'
174-
},
175-
{
176-
name: 'named-chunks',
177-
type: Boolean,
178-
aliases: ['nc'],
179-
description: 'Use file name for lazy loaded chunks.',
180-
default: buildConfigDefaults['namedChunks']
181-
},
182-
{
183-
name: 'subresource-integrity',
184-
type: Boolean,
185-
default: false,
186-
aliases: ['sri'],
187-
description: 'Enables the use of subresource integrity validation.'
188-
},
189-
{
190-
name: 'bundle-dependencies',
191-
type: ['none', 'all'],
192-
default: 'none',
193-
description: 'Available on server platform only. Which external dependencies to bundle into '
194-
+ 'the module. By default, all of node_modules will be kept as requires.'
195-
},
196-
{
197-
name: 'service-worker',
198-
type: Boolean,
199-
default: true,
200-
aliases: ['sw'],
201-
description: 'Generates a service worker config for production builds, if the app has '
202-
+ 'service worker enabled.'
203-
},
204-
{
205-
name: 'skip-app-shell',
206-
type: Boolean,
207-
description: 'Flag to prevent building an app shell',
208-
default: false
209-
}
210-
];
11+
export const baseBuildCommandOptions: any = [];
21112

21213
export interface BuildTaskOptions extends BuildOptions {
21314
statsJson?: boolean;
@@ -218,15 +19,7 @@ const BuildCommand = Command.extend({
21819
description: 'Builds your app and places it into the output path (dist/ by default).',
21920
aliases: ['b'],
22021

221-
availableOptions: baseBuildCommandOptions.concat([
222-
{
223-
name: 'stats-json',
224-
type: Boolean,
225-
default: false,
226-
description: oneLine`Generates a \`stats.json\` file which can be analyzed using tools
227-
such as: \`webpack-bundle-analyzer\` or https://webpack.github.io/analyse.`
228-
}
229-
]),
22+
availableOptions: [],
23023

23124
run: function (commandOptions: BuildTaskOptions) {
23225
// Check Angular and TypeScript versions.

0 commit comments

Comments
 (0)