@angular-devkit/build-angular 12.0.0-rc.0 → 12.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +14 -13
- package/package.json +24 -24
- package/plugins/karma.d.ts +1 -1
- package/plugins/karma.js +1 -1
- package/src/app-shell/index.d.ts +7 -0
- package/src/app-shell/index.js +9 -7
- package/src/app-shell/schema.json +1 -4
- package/src/babel/babel-loader.d.ts +2 -1
- package/src/babel/presets/application.d.ts +7 -0
- package/src/babel/presets/application.js +3 -3
- package/src/babel/webpack-loader.d.ts +7 -0
- package/src/babel/webpack-loader.js +6 -5
- package/src/babel-bazel.d.ts +2 -1
- package/src/browser/index.d.ts +1 -1
- package/src/browser/index.js +34 -33
- package/src/browser/schema.d.ts +1 -5
- package/src/browser/schema.json +11 -57
- package/src/browser/tests/setup.d.ts +1 -1
- package/src/browser/tests/setup.js +7 -0
- package/src/dev-server/index.d.ts +1 -1
- package/src/dev-server/index.js +22 -15
- package/src/dev-server/schema.json +1 -3
- package/src/dev-server/tests/execute-fetch.d.ts +1 -1
- package/src/dev-server/tests/execute-fetch.js +4 -4
- package/src/dev-server/tests/setup.d.ts +7 -0
- package/src/dev-server/tests/setup.js +7 -0
- package/src/extract-i18n/index.d.ts +1 -1
- package/src/extract-i18n/index.js +10 -12
- package/src/extract-i18n/ivy-extract-loader.d.ts +7 -0
- package/src/extract-i18n/ivy-extract-loader.js +7 -6
- package/src/extract-i18n/schema.json +2 -14
- package/src/index.d.ts +6 -6
- package/src/index.js +1 -1
- package/src/karma/find-tests.d.ts +7 -0
- package/src/karma/find-tests.js +4 -4
- package/src/karma/index.d.ts +1 -1
- package/src/karma/index.js +21 -13
- package/src/karma/schema.json +7 -28
- package/src/ng-packagr/index.d.ts +1 -1
- package/src/ng-packagr/index.js +4 -4
- package/src/ng-packagr/schema.json +1 -3
- package/src/protractor/index.d.ts +1 -1
- package/src/protractor/index.js +8 -8
- package/src/protractor/schema.json +1 -3
- package/src/server/index.d.ts +1 -1
- package/src/server/index.js +6 -6
- package/src/server/schema.d.ts +1 -5
- package/src/server/schema.json +7 -35
- package/src/test-utils.d.ts +1 -1
- package/src/test-utils.js +4 -4
- package/src/testing/builder-harness.d.ts +2 -2
- package/src/testing/builder-harness.js +10 -8
- package/src/testing/file-watching.d.ts +1 -1
- package/src/testing/file-watching.js +7 -0
- package/src/testing/index.d.ts +1 -1
- package/src/testing/index.js +7 -0
- package/src/testing/jasmine-helpers.d.ts +2 -2
- package/src/testing/jasmine-helpers.js +7 -0
- package/src/transforms.d.ts +1 -1
- package/src/transforms.js +7 -0
- package/src/tslint/index.d.ts +7 -0
- package/src/tslint/index.js +10 -12
- package/src/tslint/schema.json +1 -1
- package/src/typings.d.ts +2 -1
- package/src/utils/action-cache.d.ts +7 -0
- package/src/utils/action-cache.js +6 -8
- package/src/utils/action-executor.d.ts +7 -0
- package/src/utils/action-executor.js +13 -28
- package/src/utils/build-browser-features.d.ts +1 -1
- package/src/utils/build-browser-features.js +3 -7
- package/src/utils/build-options.d.ts +1 -2
- package/src/utils/build-options.js +1 -1
- package/src/utils/bundle-calculator.d.ts +7 -0
- package/src/utils/bundle-calculator.js +32 -31
- package/src/utils/cache-path.d.ts +7 -0
- package/src/utils/cache-path.js +3 -3
- package/src/utils/check-port.d.ts +7 -0
- package/src/utils/check-port.js +4 -4
- package/src/utils/color.d.ts +1 -1
- package/src/utils/color.js +3 -3
- package/src/utils/copy-assets.d.ts +7 -0
- package/src/utils/copy-assets.js +3 -3
- package/src/utils/copy-file.d.ts +2 -2
- package/src/utils/copy-file.js +4 -4
- package/src/utils/default-progress.d.ts +1 -1
- package/src/utils/default-progress.js +1 -1
- package/src/utils/delete-output-dir.d.ts +7 -0
- package/src/utils/delete-output-dir.js +3 -3
- package/src/utils/empty.js +0 -1
- package/src/utils/environment-options.d.ts +7 -0
- package/src/utils/environment-options.js +3 -3
- package/src/utils/find-up.d.ts +7 -0
- package/src/utils/find-up.js +3 -3
- package/src/utils/i18n-inlining.d.ts +1 -1
- package/src/utils/i18n-inlining.js +8 -1
- package/src/utils/i18n-options.d.ts +1 -1
- package/src/utils/i18n-options.js +11 -3
- package/src/utils/index-file/augment-index-html.d.ts +1 -1
- package/src/utils/index-file/augment-index-html.js +6 -11
- package/src/utils/index-file/html-rewriting-stream.d.ts +1 -1
- package/src/utils/index-file/html-rewriting-stream.js +2 -2
- package/src/utils/index-file/index-html-generator.d.ts +1 -1
- package/src/utils/index-file/index-html-generator.js +7 -11
- package/src/utils/index-file/inline-critical-css.d.ts +1 -1
- package/src/utils/index-file/inline-critical-css.js +1 -1
- package/src/utils/index-file/inline-fonts.d.ts +1 -1
- package/src/utils/index-file/inline-fonts.js +18 -19
- package/src/utils/index.d.ts +1 -1
- package/src/utils/index.js +1 -1
- package/src/utils/is-directory.d.ts +1 -1
- package/src/utils/is-directory.js +2 -3
- package/src/utils/load-translations.d.ts +7 -0
- package/src/utils/load-translations.js +9 -19
- package/src/utils/normalize-asset-patterns.d.ts +1 -1
- package/src/utils/normalize-asset-patterns.js +6 -7
- package/src/utils/normalize-builder-schema.d.ts +1 -1
- package/src/utils/normalize-builder-schema.js +5 -6
- package/src/utils/normalize-file-replacements.d.ts +1 -1
- package/src/utils/normalize-file-replacements.js +2 -3
- package/src/utils/normalize-optimization.d.ts +1 -1
- package/src/utils/normalize-optimization.js +12 -8
- package/src/utils/normalize-source-maps.d.ts +1 -1
- package/src/utils/normalize-source-maps.js +3 -3
- package/src/utils/output-paths.d.ts +7 -0
- package/src/utils/output-paths.js +7 -4
- package/src/utils/package-chunk-sort.d.ts +1 -1
- package/src/utils/package-chunk-sort.js +10 -3
- package/src/utils/process-bundle-bootstrap.js +3 -2
- package/src/utils/process-bundle.d.ts +2 -2
- package/src/utils/process-bundle.js +31 -40
- package/src/utils/read-tsconfig.d.ts +1 -1
- package/src/utils/read-tsconfig.js +2 -4
- package/src/utils/run-module-as-observable-fork.d.ts +1 -1
- package/src/utils/run-module-as-observable-fork.js +9 -2
- package/src/utils/run-module-worker.js +1 -3
- package/src/utils/service-worker.d.ts +1 -1
- package/src/utils/service-worker.js +3 -3
- package/src/utils/spinner.d.ts +1 -1
- package/src/utils/spinner.js +1 -1
- package/src/utils/strip-bom.d.ts +1 -1
- package/src/utils/strip-bom.js +2 -3
- package/src/utils/tty.d.ts +1 -1
- package/src/utils/tty.js +1 -1
- package/src/utils/url.d.ts +1 -1
- package/src/utils/url.js +1 -1
- package/src/utils/version.d.ts +1 -1
- package/src/utils/version.js +3 -3
- package/src/utils/webpack-browser-config.d.ts +1 -1
- package/src/utils/webpack-browser-config.js +9 -2
- package/src/utils/webpack-diagnostics.d.ts +2 -2
- package/src/utils/webpack-diagnostics.js +4 -4
- package/src/utils/workers.d.ts +1 -1
- package/src/utils/workers.js +1 -1
- package/src/webpack/configs/browser.d.ts +7 -0
- package/src/webpack/configs/browser.js +3 -3
- package/src/webpack/configs/common.d.ts +7 -0
- package/src/webpack/configs/common.js +16 -19
- package/src/webpack/configs/dev-server.d.ts +1 -1
- package/src/webpack/configs/dev-server.js +7 -6
- package/src/webpack/configs/index.d.ts +1 -1
- package/src/webpack/configs/index.js +7 -7
- package/src/webpack/configs/server.d.ts +7 -0
- package/src/webpack/configs/server.js +4 -4
- package/src/webpack/configs/stats.d.ts +1 -1
- package/src/webpack/configs/stats.js +1 -1
- package/src/webpack/configs/styles.d.ts +7 -0
- package/src/webpack/configs/styles.js +6 -10
- package/src/webpack/configs/test.d.ts +1 -1
- package/src/webpack/configs/test.js +2 -5
- package/src/webpack/configs/typescript.d.ts +7 -0
- package/src/webpack/configs/typescript.js +4 -6
- package/src/webpack/configs/worker.d.ts +7 -0
- package/src/webpack/configs/worker.js +3 -3
- package/src/webpack/es5-jit-polyfills.js +2 -1
- package/src/webpack/es5-polyfills.js +2 -3
- package/src/webpack/jit-polyfills.js +2 -1
- package/src/webpack/plugins/analytics.d.ts +2 -2
- package/src/webpack/plugins/analytics.js +9 -9
- package/src/webpack/plugins/any-component-style-budget-checker.d.ts +1 -1
- package/src/webpack/plugins/any-component-style-budget-checker.js +3 -9
- package/src/webpack/plugins/builder-watch-plugin.d.ts +1 -1
- package/src/webpack/plugins/builder-watch-plugin.js +7 -0
- package/src/webpack/plugins/common-js-usage-warn-plugin.d.ts +1 -1
- package/src/webpack/plugins/common-js-usage-warn-plugin.js +10 -10
- package/src/webpack/plugins/dedupe-module-resolve-plugin.d.ts +1 -1
- package/src/webpack/plugins/dedupe-module-resolve-plugin.js +9 -2
- package/src/webpack/plugins/hmr/hmr-accept.d.ts +1 -1
- package/src/webpack/plugins/hmr/hmr-accept.js +6 -9
- package/src/webpack/plugins/hmr/hmr-loader.d.ts +1 -1
- package/src/webpack/plugins/hmr/hmr-loader.js +2 -2
- package/src/webpack/plugins/index-html-webpack-plugin.d.ts +7 -0
- package/src/webpack/plugins/index-html-webpack-plugin.js +6 -6
- package/src/webpack/plugins/index.d.ts +2 -2
- package/src/webpack/plugins/index.js +1 -1
- package/src/webpack/plugins/karma/karma-context.html +31 -30
- package/src/webpack/plugins/karma/karma-debug.html +34 -33
- package/src/webpack/plugins/karma/karma.d.ts +7 -0
- package/src/webpack/plugins/karma/karma.js +13 -11
- package/src/webpack/plugins/optimize-css-webpack-plugin.d.ts +7 -0
- package/src/webpack/plugins/optimize-css-webpack-plugin.js +18 -11
- package/src/webpack/plugins/postcss-cli-resources.d.ts +7 -0
- package/src/webpack/plugins/postcss-cli-resources.js +11 -9
- package/src/webpack/plugins/remove-hash-plugin.d.ts +1 -1
- package/src/webpack/plugins/remove-hash-plugin.js +9 -4
- package/src/webpack/plugins/scripts-webpack-plugin.d.ts +1 -1
- package/src/webpack/plugins/scripts-webpack-plugin.js +11 -10
- package/src/webpack/plugins/single-test-transform.d.ts +1 -1
- package/src/webpack/plugins/single-test-transform.js +5 -5
- package/src/webpack/plugins/suppress-entry-chunks-webpack-plugin.d.ts +1 -1
- package/src/webpack/plugins/suppress-entry-chunks-webpack-plugin.js +1 -1
- package/src/webpack/utils/async-chunks.d.ts +1 -1
- package/src/webpack/utils/async-chunks.js +9 -1
- package/src/webpack/utils/helpers.d.ts +1 -1
- package/src/webpack/utils/helpers.js +2 -2
- package/src/webpack/utils/stats.d.ts +1 -1
- package/src/webpack/utils/stats.js +39 -33
package/src/browser/schema.json
CHANGED
|
@@ -44,12 +44,7 @@
|
|
|
44
44
|
"description": "The stylesheet language to use for the application's inline component styles.",
|
|
45
45
|
"type": "string",
|
|
46
46
|
"default": "css",
|
|
47
|
-
"enum": [
|
|
48
|
-
"css",
|
|
49
|
-
"less",
|
|
50
|
-
"sass",
|
|
51
|
-
"scss"
|
|
52
|
-
]
|
|
47
|
+
"enum": ["css", "less", "sass", "scss"]
|
|
53
48
|
},
|
|
54
49
|
"stylePreprocessorOptions": {
|
|
55
50
|
"description": "Options to pass to style preprocessors.",
|
|
@@ -257,12 +252,7 @@
|
|
|
257
252
|
"type": "string",
|
|
258
253
|
"description": "Define the output filename cache-busting hashing mode.",
|
|
259
254
|
"default": "none",
|
|
260
|
-
"enum": [
|
|
261
|
-
"none",
|
|
262
|
-
"all",
|
|
263
|
-
"media",
|
|
264
|
-
"bundles"
|
|
265
|
-
]
|
|
255
|
+
"enum": ["none", "all", "media", "bundles"]
|
|
266
256
|
},
|
|
267
257
|
"poll": {
|
|
268
258
|
"type": "number",
|
|
@@ -286,7 +276,7 @@
|
|
|
286
276
|
"type": "boolean",
|
|
287
277
|
"description": "Show circular dependency warnings on builds.",
|
|
288
278
|
"default": false,
|
|
289
|
-
"x-deprecated": "The recommended method to detect circular dependencies in project code is to use
|
|
279
|
+
"x-deprecated": "The recommended method to detect circular dependencies in project code is to use either a lint rule or other external tooling."
|
|
290
280
|
},
|
|
291
281
|
"buildOptimizer": {
|
|
292
282
|
"type": "boolean",
|
|
@@ -344,11 +334,6 @@
|
|
|
344
334
|
"description": "Generates a 'stats.json' file which can be analyzed using tools such as 'webpack-bundle-analyzer'.",
|
|
345
335
|
"default": false
|
|
346
336
|
},
|
|
347
|
-
"forkTypeChecker": {
|
|
348
|
-
"type": "boolean",
|
|
349
|
-
"description": "Run the TypeScript type checker in a forked process.",
|
|
350
|
-
"default": true
|
|
351
|
-
},
|
|
352
337
|
"budgets": {
|
|
353
338
|
"description": "Budget thresholds to ensure parts of your application stay within boundaries which you set.",
|
|
354
339
|
"type": "array",
|
|
@@ -365,11 +350,7 @@
|
|
|
365
350
|
"type": "string",
|
|
366
351
|
"description": "Define the crossorigin attribute setting of elements that provide CORS support.",
|
|
367
352
|
"default": "none",
|
|
368
|
-
"enum": [
|
|
369
|
-
"none",
|
|
370
|
-
"anonymous",
|
|
371
|
-
"use-credentials"
|
|
372
|
-
]
|
|
353
|
+
"enum": ["none", "anonymous", "use-credentials"]
|
|
373
354
|
},
|
|
374
355
|
"allowedCommonJsDependencies": {
|
|
375
356
|
"description": "A list of CommonJS packages that are allowed to be used without a build time warning.",
|
|
@@ -381,12 +362,7 @@
|
|
|
381
362
|
}
|
|
382
363
|
},
|
|
383
364
|
"additionalProperties": false,
|
|
384
|
-
"required": [
|
|
385
|
-
"outputPath",
|
|
386
|
-
"index",
|
|
387
|
-
"main",
|
|
388
|
-
"tsConfig"
|
|
389
|
-
],
|
|
365
|
+
"required": ["outputPath", "index", "main", "tsConfig"],
|
|
390
366
|
"definitions": {
|
|
391
367
|
"assetPattern": {
|
|
392
368
|
"oneOf": [
|
|
@@ -419,11 +395,7 @@
|
|
|
419
395
|
}
|
|
420
396
|
},
|
|
421
397
|
"additionalProperties": false,
|
|
422
|
-
"required": [
|
|
423
|
-
"glob",
|
|
424
|
-
"input",
|
|
425
|
-
"output"
|
|
426
|
-
]
|
|
398
|
+
"required": ["glob", "input", "output"]
|
|
427
399
|
},
|
|
428
400
|
{
|
|
429
401
|
"type": "string"
|
|
@@ -445,10 +417,7 @@
|
|
|
445
417
|
}
|
|
446
418
|
},
|
|
447
419
|
"additionalProperties": false,
|
|
448
|
-
"required": [
|
|
449
|
-
"src",
|
|
450
|
-
"replaceWith"
|
|
451
|
-
]
|
|
420
|
+
"required": ["src", "replaceWith"]
|
|
452
421
|
},
|
|
453
422
|
{
|
|
454
423
|
"type": "object",
|
|
@@ -463,10 +432,7 @@
|
|
|
463
432
|
}
|
|
464
433
|
},
|
|
465
434
|
"additionalProperties": false,
|
|
466
|
-
"required": [
|
|
467
|
-
"replace",
|
|
468
|
-
"with"
|
|
469
|
-
]
|
|
435
|
+
"required": ["replace", "with"]
|
|
470
436
|
}
|
|
471
437
|
]
|
|
472
438
|
},
|
|
@@ -491,9 +457,7 @@
|
|
|
491
457
|
}
|
|
492
458
|
},
|
|
493
459
|
"additionalProperties": false,
|
|
494
|
-
"required": [
|
|
495
|
-
"input"
|
|
496
|
-
]
|
|
460
|
+
"required": ["input"]
|
|
497
461
|
},
|
|
498
462
|
{
|
|
499
463
|
"type": "string",
|
|
@@ -507,15 +471,7 @@
|
|
|
507
471
|
"type": {
|
|
508
472
|
"type": "string",
|
|
509
473
|
"description": "The type of budget.",
|
|
510
|
-
"enum": [
|
|
511
|
-
"all",
|
|
512
|
-
"allScript",
|
|
513
|
-
"any",
|
|
514
|
-
"anyScript",
|
|
515
|
-
"anyComponentStyle",
|
|
516
|
-
"bundle",
|
|
517
|
-
"initial"
|
|
518
|
-
]
|
|
474
|
+
"enum": ["all", "allScript", "any", "anyScript", "anyComponentStyle", "bundle", "initial"]
|
|
519
475
|
},
|
|
520
476
|
"name": {
|
|
521
477
|
"type": "string",
|
|
@@ -551,9 +507,7 @@
|
|
|
551
507
|
}
|
|
552
508
|
},
|
|
553
509
|
"additionalProperties": false,
|
|
554
|
-
"required": [
|
|
555
|
-
"type"
|
|
556
|
-
]
|
|
510
|
+
"required": ["type"]
|
|
557
511
|
}
|
|
558
512
|
}
|
|
559
513
|
}
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
2
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
10
|
exports.BASE_OPTIONS = exports.BROWSER_BUILDER_INFO = exports.describeBuilder = void 0;
|
|
4
11
|
var testing_1 = require("../../testing");
|
package/src/dev-server/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
/**
|
|
3
3
|
* @license
|
|
4
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.io/license
|
|
@@ -52,7 +52,7 @@ const devServerBuildOverriddenKeys = [
|
|
|
52
52
|
*
|
|
53
53
|
* @experimental Direct usage of this function is considered experimental.
|
|
54
54
|
*/
|
|
55
|
-
//
|
|
55
|
+
// eslint-disable-next-line max-lines-per-function
|
|
56
56
|
function serveWebpackBrowser(options, context, transforms = {}) {
|
|
57
57
|
// Check Angular version.
|
|
58
58
|
const { logger, workspaceRoot } = context;
|
|
@@ -65,13 +65,13 @@ function serveWebpackBrowser(options, context, transforms = {}) {
|
|
|
65
65
|
options.port = await check_port_1.checkPort((_a = options.port) !== null && _a !== void 0 ? _a : 4200, options.host || 'localhost');
|
|
66
66
|
// Override options we need to override, if defined.
|
|
67
67
|
const overrides = Object.keys(options)
|
|
68
|
-
.filter(key => options[key] !== undefined && devServerBuildOverriddenKeys.includes(key))
|
|
68
|
+
.filter((key) => options[key] !== undefined && devServerBuildOverriddenKeys.includes(key))
|
|
69
69
|
.reduce((previous, key) => ({
|
|
70
70
|
...previous,
|
|
71
71
|
[key]: options[key],
|
|
72
72
|
}), {});
|
|
73
73
|
const devServerOptions = Object.keys(options)
|
|
74
|
-
.filter(key => !devServerBuildOverriddenKeys.includes(key) && key !== 'browserTarget')
|
|
74
|
+
.filter((key) => !devServerBuildOverriddenKeys.includes(key) && key !== 'browserTarget')
|
|
75
75
|
.reduce((previous, key) => ({
|
|
76
76
|
...previous,
|
|
77
77
|
[key]: options[key],
|
|
@@ -88,8 +88,8 @@ function serveWebpackBrowser(options, context, transforms = {}) {
|
|
|
88
88
|
(_b = rawBrowserOptions.allowedCommonJsDependencies) !== null && _b !== void 0 ? _b : (rawBrowserOptions.allowedCommonJsDependencies = []);
|
|
89
89
|
rawBrowserOptions.allowedCommonJsDependencies.push('strip-ansi');
|
|
90
90
|
const browserName = await context.getBuilderNameForTarget(browserTarget);
|
|
91
|
-
const browserOptions = await context.validateOptions({ ...rawBrowserOptions, ...overrides }, browserName);
|
|
92
|
-
const { config, projectRoot, i18n } = await webpack_browser_config_1.generateI18nBrowserWebpackConfigFromContext(browserOptions, context, wco => [
|
|
91
|
+
const browserOptions = (await context.validateOptions({ ...rawBrowserOptions, ...overrides }, browserName));
|
|
92
|
+
const { config, projectRoot, i18n } = await webpack_browser_config_1.generateI18nBrowserWebpackConfigFromContext(browserOptions, context, (wco) => [
|
|
93
93
|
configs_1.getDevServerConfig(wco),
|
|
94
94
|
configs_1.getCommonConfig(wco),
|
|
95
95
|
configs_1.getBrowserConfig(wco),
|
|
@@ -106,7 +106,6 @@ function serveWebpackBrowser(options, context, transforms = {}) {
|
|
|
106
106
|
// This is needed because we cannot use the inline option directly in the config
|
|
107
107
|
// because of the SuppressExtractedTextChunksWebpackPlugin
|
|
108
108
|
// Consider not using SuppressExtractedTextChunksWebpackPlugin when liveReload is enable.
|
|
109
|
-
// tslint:disable-next-line: no-any
|
|
110
109
|
webpackDevServer.addDevServerEntrypoints(config, {
|
|
111
110
|
...config.devServer,
|
|
112
111
|
inline: true,
|
|
@@ -114,12 +113,15 @@ function serveWebpackBrowser(options, context, transforms = {}) {
|
|
|
114
113
|
// Remove live-reload code from all entrypoints but not main.
|
|
115
114
|
// Otherwise this will break SuppressExtractedTextChunksWebpackPlugin because
|
|
116
115
|
// 'addDevServerEntrypoints' adds addional entry-points to all entries.
|
|
117
|
-
if (config.entry &&
|
|
116
|
+
if (config.entry &&
|
|
117
|
+
typeof config.entry === 'object' &&
|
|
118
|
+
!Array.isArray(config.entry) &&
|
|
119
|
+
config.entry.main) {
|
|
118
120
|
for (const [key, value] of Object.entries(config.entry)) {
|
|
119
121
|
if (key === 'main' || !Array.isArray(value)) {
|
|
120
122
|
continue;
|
|
121
123
|
}
|
|
122
|
-
const webpackClientScriptIndex = value.findIndex(x => x.includes('webpack-dev-server/client/index.js'));
|
|
124
|
+
const webpackClientScriptIndex = value.findIndex((x) => x.includes('webpack-dev-server/client/index.js'));
|
|
123
125
|
if (webpackClientScriptIndex >= 0) {
|
|
124
126
|
// Remove the webpack-dev-server/client script from array.
|
|
125
127
|
value.splice(webpackClientScriptIndex, 1);
|
|
@@ -131,9 +133,9 @@ function serveWebpackBrowser(options, context, transforms = {}) {
|
|
|
131
133
|
logger.warn(core_1.tags.stripIndents `NOTICE: Hot Module Replacement (HMR) is enabled for the dev server.
|
|
132
134
|
See https://webpack.js.org/guides/hot-module-replacement for information on working with HMR for Webpack.`);
|
|
133
135
|
}
|
|
134
|
-
if (options.host
|
|
135
|
-
|
|
136
|
-
|
|
136
|
+
if (options.host &&
|
|
137
|
+
!/^127\.\d+\.\d+\.\d+/g.test(options.host) &&
|
|
138
|
+
options.host !== 'localhost') {
|
|
137
139
|
logger.warn(core_1.tags.stripIndent `
|
|
138
140
|
Warning: This is a simple server for use in testing or debugging Angular applications
|
|
139
141
|
locally. It hasn't been reviewed for security issues.
|
|
@@ -234,12 +236,14 @@ function serveWebpackBrowser(options, context, transforms = {}) {
|
|
|
234
236
|
port: buildEvent.port,
|
|
235
237
|
});
|
|
236
238
|
if (index === 0) {
|
|
237
|
-
logger.info('\n' +
|
|
239
|
+
logger.info('\n' +
|
|
240
|
+
core_1.tags.oneLine `
|
|
238
241
|
**
|
|
239
242
|
Angular Live Development Server is listening on ${options.host}:${buildEvent.port},
|
|
240
243
|
open your browser on ${serverAddress}
|
|
241
244
|
**
|
|
242
|
-
` +
|
|
245
|
+
` +
|
|
246
|
+
'\n');
|
|
243
247
|
if (options.open) {
|
|
244
248
|
const open = await Promise.resolve().then(() => require('open'));
|
|
245
249
|
await open(serverAddress);
|
|
@@ -265,7 +269,10 @@ async function setupLocalize(locale, i18n, browserOptions, webpackConfig) {
|
|
|
265
269
|
webpackConfig.entry['main'].unshift(localeDescription.dataPath);
|
|
266
270
|
}
|
|
267
271
|
else {
|
|
268
|
-
webpackConfig.entry['main'] = [
|
|
272
|
+
webpackConfig.entry['main'] = [
|
|
273
|
+
localeDescription.dataPath,
|
|
274
|
+
webpackConfig.entry['main'],
|
|
275
|
+
];
|
|
269
276
|
}
|
|
270
277
|
}
|
|
271
278
|
let missingTranslationBehavior = browserOptions.i18nMissingTranslation || 'ignore';
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.executeOnceAndFetch = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @license
|
|
6
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7
5
|
*
|
|
8
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
7
|
* found in the LICENSE file at https://angular.io/license
|
|
10
8
|
*/
|
|
11
|
-
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.executeOnceAndFetch = void 0;
|
|
11
|
+
const node_fetch_1 = require("node-fetch"); // eslint-disable-line import/no-extraneous-dependencies
|
|
12
12
|
const operators_1 = require("rxjs/operators");
|
|
13
13
|
const url_1 = require("url");
|
|
14
14
|
async function executeOnceAndFetch(harness, url, options) {
|
|
@@ -1,3 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
1
8
|
import { Schema as BrowserSchema } from '../../browser/schema';
|
|
2
9
|
import { BuilderHarness } from '../../testing/builder-harness';
|
|
3
10
|
import { Schema } from '../schema';
|
|
@@ -1,4 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* @license
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
5
|
+
*
|
|
6
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
7
|
+
* found in the LICENSE file at https://angular.io/license
|
|
8
|
+
*/
|
|
2
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
10
|
exports.setupBrowserTarget = exports.BUILD_TIMEOUT = exports.BASE_OPTIONS = exports.DEV_SERVER_BUILDER_INFO = exports.describeBuilder = void 0;
|
|
4
11
|
const fs_1 = require("fs");
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.execute = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @license
|
|
6
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7
5
|
*
|
|
8
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
7
|
* found in the LICENSE file at https://angular.io/license
|
|
10
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.execute = void 0;
|
|
11
11
|
const architect_1 = require("@angular-devkit/architect");
|
|
12
12
|
const build_webpack_1 = require("@angular-devkit/build-webpack");
|
|
13
13
|
const fs = require("fs");
|
|
@@ -43,18 +43,18 @@ async function getSerializer(format, sourceLocale, basePath, useLegacyIds, diagn
|
|
|
43
43
|
switch (format) {
|
|
44
44
|
case schema_2.Format.Xmb:
|
|
45
45
|
const { XmbTranslationSerializer } = await Promise.resolve().then(() => require('@angular/localize/src/tools/src/extract/translation_files/xmb_translation_serializer'));
|
|
46
|
-
//
|
|
46
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
47
47
|
return new XmbTranslationSerializer(basePath, useLegacyIds);
|
|
48
48
|
case schema_2.Format.Xlf:
|
|
49
49
|
case schema_2.Format.Xlif:
|
|
50
50
|
case schema_2.Format.Xliff:
|
|
51
51
|
const { Xliff1TranslationSerializer } = await Promise.resolve().then(() => require('@angular/localize/src/tools/src/extract/translation_files/xliff1_translation_serializer'));
|
|
52
|
-
//
|
|
52
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
53
53
|
return new Xliff1TranslationSerializer(sourceLocale, basePath, useLegacyIds, {});
|
|
54
54
|
case schema_2.Format.Xlf2:
|
|
55
55
|
case schema_2.Format.Xliff2:
|
|
56
56
|
const { Xliff2TranslationSerializer } = await Promise.resolve().then(() => require('@angular/localize/src/tools/src/extract/translation_files/xliff2_translation_serializer'));
|
|
57
|
-
//
|
|
57
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
58
58
|
return new Xliff2TranslationSerializer(sourceLocale, basePath, useLegacyIds, {});
|
|
59
59
|
case schema_2.Format.Json:
|
|
60
60
|
const { SimpleJsonTranslationSerializer } = await Promise.resolve().then(() => require('@angular/localize/src/tools/src/extract/translation_files/json_translation_serializer'));
|
|
@@ -69,7 +69,7 @@ async function getSerializer(format, sourceLocale, basePath, useLegacyIds, diagn
|
|
|
69
69
|
return path.relative(from, to);
|
|
70
70
|
},
|
|
71
71
|
};
|
|
72
|
-
//
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
73
73
|
return new ArbTranslationSerializer(sourceLocale, basePath, fileSystem);
|
|
74
74
|
}
|
|
75
75
|
}
|
|
@@ -195,9 +195,7 @@ async function execute(options, context, transforms) {
|
|
|
195
195
|
return webpackResult;
|
|
196
196
|
}
|
|
197
197
|
const basePath = config.context || projectRoot;
|
|
198
|
-
const { checkDuplicateMessages } = await Promise.resolve().then(() => require(
|
|
199
|
-
// tslint:disable-next-line: trailing-comma
|
|
200
|
-
'@angular/localize/src/tools/src/extract/duplicates'));
|
|
198
|
+
const { checkDuplicateMessages } = await Promise.resolve().then(() => require('@angular/localize/src/tools/src/extract/duplicates'));
|
|
201
199
|
// The filesystem is used to create a relative path for each file
|
|
202
200
|
// from the basePath. This relative path is then used in the error message.
|
|
203
201
|
const checkFileSystem = {
|
|
@@ -206,9 +204,9 @@ async function execute(options, context, transforms) {
|
|
|
206
204
|
},
|
|
207
205
|
};
|
|
208
206
|
const diagnostics = checkDuplicateMessages(
|
|
209
|
-
//
|
|
207
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
210
208
|
checkFileSystem, ivyMessages, 'warning',
|
|
211
|
-
//
|
|
209
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
212
210
|
basePath);
|
|
213
211
|
if (diagnostics.messages.length > 0) {
|
|
214
212
|
context.logger.warn(diagnostics.formatDiagnostics(''));
|
|
@@ -1 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
1
8
|
export default function localizeExtractLoader(this: any, content: string, map: any): void;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
2
|
/**
|
|
4
3
|
* @license
|
|
5
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
6
5
|
*
|
|
7
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
8
7
|
* found in the LICENSE file at https://angular.io/license
|
|
9
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const extraction_1 = require("@angular/localize/src/tools/src/extract/extraction");
|
|
11
11
|
const loader_utils_1 = require("loader-utils");
|
|
12
12
|
const nodePath = require("path");
|
|
13
13
|
function localizeExtractLoader(content,
|
|
14
14
|
// Source map types are broken in the webpack type definitions
|
|
15
|
-
//
|
|
15
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
16
16
|
map) {
|
|
17
|
+
// eslint-disable-next-line @typescript-eslint/no-this-alias
|
|
17
18
|
const loaderContext = this;
|
|
18
19
|
// Casts are needed to workaround the loader-utils typings limited support for option values
|
|
19
20
|
const options = loader_utils_1.getOptions(this);
|
|
@@ -22,7 +23,7 @@ map) {
|
|
|
22
23
|
// level 2 is warnings
|
|
23
24
|
level: 2,
|
|
24
25
|
debug(...args) {
|
|
25
|
-
//
|
|
26
|
+
// eslint-disable-next-line no-console
|
|
26
27
|
console.debug(...args);
|
|
27
28
|
},
|
|
28
29
|
info(...args) {
|
|
@@ -68,9 +69,9 @@ map) {
|
|
|
68
69
|
return nodePath.dirname(path);
|
|
69
70
|
},
|
|
70
71
|
};
|
|
71
|
-
//
|
|
72
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
72
73
|
const extractor = new extraction_1.MessageExtractor(filesystem, logger, {
|
|
73
|
-
//
|
|
74
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
74
75
|
basePath: this.rootContext,
|
|
75
76
|
useSourceMaps: !!map,
|
|
76
77
|
});
|
|
@@ -13,17 +13,7 @@
|
|
|
13
13
|
"type": "string",
|
|
14
14
|
"description": "Output format for the generated file.",
|
|
15
15
|
"default": "xlf",
|
|
16
|
-
"enum": [
|
|
17
|
-
"xmb",
|
|
18
|
-
"xlf",
|
|
19
|
-
"xlif",
|
|
20
|
-
"xliff",
|
|
21
|
-
"xlf2",
|
|
22
|
-
"xliff2",
|
|
23
|
-
"json",
|
|
24
|
-
"arb",
|
|
25
|
-
"legacy-migrate"
|
|
26
|
-
]
|
|
16
|
+
"enum": ["xmb", "xlf", "xlif", "xliff", "xlf2", "xliff2", "json", "arb", "legacy-migrate"]
|
|
27
17
|
},
|
|
28
18
|
"progress": {
|
|
29
19
|
"type": "boolean",
|
|
@@ -40,7 +30,5 @@
|
|
|
40
30
|
}
|
|
41
31
|
},
|
|
42
32
|
"additionalProperties": false,
|
|
43
|
-
"required": [
|
|
44
|
-
"browserTarget"
|
|
45
|
-
]
|
|
33
|
+
"required": ["browserTarget"]
|
|
46
34
|
}
|
package/src/index.d.ts
CHANGED
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* @license
|
|
3
|
-
* Copyright Google
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.io/license
|
|
7
7
|
*/
|
|
8
8
|
export * from './transforms';
|
|
9
9
|
export { AssetPattern, AssetPatternClass as AssetPatternObject, Budget, CrossOrigin, ExtraEntryPoint, ExtraEntryPointClass as ExtraEntryPointObject, FileReplacement, OptimizationClass as OptimizationObject, OptimizationUnion, OutputHashing, Schema as BrowserBuilderOptions, SourceMapClass as SourceMapObject, SourceMapUnion, StylePreprocessorOptions, Type, } from './browser/schema';
|
|
10
|
-
export { buildWebpackBrowser as executeBrowserBuilder, BrowserBuilderOutput
|
|
10
|
+
export { buildWebpackBrowser as executeBrowserBuilder, BrowserBuilderOutput } from './browser';
|
|
11
11
|
export { serveWebpackBrowser as executeDevServerBuilder, DevServerBuilderOptions, DevServerBuilderOutput, } from './dev-server';
|
|
12
|
-
export { execute as executeExtractI18nBuilder, ExtractI18nBuilderOptions
|
|
13
|
-
export { execute as executeKarmaBuilder, KarmaBuilderOptions, KarmaConfigOptions
|
|
14
|
-
export { execute as executeProtractorBuilder, ProtractorBuilderOptions
|
|
12
|
+
export { execute as executeExtractI18nBuilder, ExtractI18nBuilderOptions } from './extract-i18n';
|
|
13
|
+
export { execute as executeKarmaBuilder, KarmaBuilderOptions, KarmaConfigOptions } from './karma';
|
|
14
|
+
export { execute as executeProtractorBuilder, ProtractorBuilderOptions } from './protractor';
|
|
15
15
|
export { execute as executeServerBuilder, ServerBuilderOptions, ServerBuilderOutput, } from './server';
|
|
16
|
-
export { execute as executeNgPackagrBuilder, NgPackagrBuilderOptions
|
|
16
|
+
export { execute as executeNgPackagrBuilder, NgPackagrBuilderOptions } from './ng-packagr';
|
package/src/index.js
CHANGED
|
@@ -1 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.io/license
|
|
7
|
+
*/
|
|
1
8
|
export declare function findTests(patterns: string[], cwd: string, workspaceRoot: string): string[];
|
package/src/karma/find-tests.js
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.findTests = void 0;
|
|
4
2
|
/**
|
|
5
3
|
* @license
|
|
6
|
-
* Copyright Google
|
|
4
|
+
* Copyright Google LLC All Rights Reserved.
|
|
7
5
|
*
|
|
8
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
9
7
|
* found in the LICENSE file at https://angular.io/license
|
|
10
8
|
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.findTests = void 0;
|
|
11
11
|
const fs_1 = require("fs");
|
|
12
12
|
const glob = require("glob");
|
|
13
13
|
const path_1 = require("path");
|
|
@@ -17,7 +17,7 @@ function findTests(patterns, cwd, workspaceRoot) {
|
|
|
17
17
|
return patterns.reduce((files, pattern) => {
|
|
18
18
|
const relativePathToMain = cwd.replace(workspaceRoot, '').substr(1); // remove leading slash
|
|
19
19
|
const tests = findMatchingTests(pattern, cwd, relativePathToMain);
|
|
20
|
-
tests.forEach(file => {
|
|
20
|
+
tests.forEach((file) => {
|
|
21
21
|
if (!files.includes(file)) {
|
|
22
22
|
files.push(file);
|
|
23
23
|
}
|
package/src/karma/index.d.ts
CHANGED