@angular-devkit/build-angular 12.1.0-next.5 → 12.1.2

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.
Files changed (70) hide show
  1. package/package.json +24 -23
  2. package/src/app-shell/index.js +28 -8
  3. package/src/babel/plugins/adjust-static-class-members.js +4 -1
  4. package/src/babel/plugins/adjust-typescript-enums.js +4 -1
  5. package/src/babel/plugins/pure-toplevel-functions.js +24 -2
  6. package/src/babel/presets/application.js +25 -4
  7. package/src/browser/index.d.ts +1 -4
  8. package/src/browser/index.js +38 -36
  9. package/src/dev-server/index.d.ts +1 -1
  10. package/src/dev-server/index.js +31 -10
  11. package/src/dev-server/tests/execute-fetch.js +4 -1
  12. package/src/extract-i18n/index.d.ts +1 -1
  13. package/src/extract-i18n/index.js +34 -12
  14. package/src/extract-i18n/ivy-extract-loader.js +20 -1
  15. package/src/karma/find-tests.js +20 -1
  16. package/src/karma/index.js +21 -2
  17. package/src/ng-packagr/index.js +21 -2
  18. package/src/protractor/index.js +21 -2
  19. package/src/server/index.d.ts +1 -1
  20. package/src/server/index.js +21 -2
  21. package/src/server/tests/setup.d.ts +18 -0
  22. package/src/server/tests/setup.js +27 -0
  23. package/src/tslint/index.js +22 -3
  24. package/src/utils/action-cache.js +21 -2
  25. package/src/utils/action-executor.js +21 -2
  26. package/src/utils/build-browser-features.js +25 -3
  27. package/src/utils/cache-path.js +5 -2
  28. package/src/utils/check-port.js +20 -1
  29. package/src/utils/color.js +20 -1
  30. package/src/utils/copy-assets.js +26 -4
  31. package/src/utils/copy-file.js +20 -1
  32. package/src/utils/delete-output-dir.js +28 -2
  33. package/src/utils/environment-options.d.ts +1 -0
  34. package/src/utils/environment-options.js +26 -2
  35. package/src/utils/find-up.js +20 -1
  36. package/src/utils/i18n-inlining.js +21 -2
  37. package/src/utils/i18n-options.js +22 -3
  38. package/src/utils/index-file/html-rewriting-stream.js +20 -1
  39. package/src/utils/index-file/index-html-generator.js +20 -1
  40. package/src/utils/index-file/inline-critical-css.js +20 -1
  41. package/src/utils/index-file/inline-fonts.js +27 -5
  42. package/src/utils/is-directory.js +20 -1
  43. package/src/utils/load-translations.js +26 -7
  44. package/src/utils/process-bundle.js +34 -12
  45. package/src/utils/read-tsconfig.js +20 -1
  46. package/src/utils/service-worker.js +21 -2
  47. package/src/utils/spinner.js +5 -2
  48. package/src/utils/version.d.ts +1 -2
  49. package/src/utils/version.js +5 -4
  50. package/src/utils/webpack-browser-config.js +21 -2
  51. package/src/webpack/configs/analytics.d.ts +11 -0
  52. package/src/webpack/configs/analytics.js +29 -0
  53. package/src/webpack/configs/browser.js +0 -16
  54. package/src/webpack/configs/common.js +94 -16
  55. package/src/webpack/configs/dev-server.js +20 -1
  56. package/src/webpack/configs/index.d.ts +1 -0
  57. package/src/webpack/configs/index.js +1 -0
  58. package/src/webpack/configs/server.js +0 -1
  59. package/src/webpack/configs/styles.js +30 -2
  60. package/src/webpack/configs/test.js +32 -3
  61. package/src/webpack/configs/typescript.d.ts +2 -9
  62. package/src/webpack/configs/typescript.js +16 -14
  63. package/src/webpack/plugins/any-component-style-budget-checker.js +20 -1
  64. package/src/webpack/plugins/index.js +4 -1
  65. package/src/webpack/plugins/karma/karma.js +26 -4
  66. package/src/webpack/plugins/postcss-cli-resources.js +21 -2
  67. package/src/webpack/plugins/scripts-webpack-plugin.js +20 -1
  68. package/src/webpack/utils/helpers.js +20 -1
  69. package/src/webpack/utils/stats.d.ts +0 -1
  70. package/src/webpack/utils/stats.js +35 -12
@@ -6,13 +6,35 @@
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
8
8
  */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
9
31
  Object.defineProperty(exports, "__esModule", { value: true });
10
32
  exports.execute = void 0;
11
33
  const architect_1 = require("@angular-devkit/architect");
12
34
  const build_webpack_1 = require("@angular-devkit/build-webpack");
13
- const fs = require("fs");
14
- const path = require("path");
15
- const webpack = require("webpack");
35
+ const fs = __importStar(require("fs"));
36
+ const path = __importStar(require("path"));
37
+ const webpack_1 = __importDefault(require("webpack"));
16
38
  const schema_1 = require("../browser/schema");
17
39
  const i18n_options_1 = require("../utils/i18n-options");
18
40
  const version_1 = require("../utils/version");
@@ -42,28 +64,28 @@ function getI18nOutfile(format) {
42
64
  async function getSerializer(format, sourceLocale, basePath, useLegacyIds, diagnostics) {
43
65
  switch (format) {
44
66
  case schema_2.Format.Xmb:
45
- const { XmbTranslationSerializer } = await Promise.resolve().then(() => require('@angular/localize/src/tools/src/extract/translation_files/xmb_translation_serializer'));
67
+ const { XmbTranslationSerializer } = await Promise.resolve().then(() => __importStar(require('@angular/localize/src/tools/src/extract/translation_files/xmb_translation_serializer')));
46
68
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
47
69
  return new XmbTranslationSerializer(basePath, useLegacyIds);
48
70
  case schema_2.Format.Xlf:
49
71
  case schema_2.Format.Xlif:
50
72
  case schema_2.Format.Xliff:
51
- const { Xliff1TranslationSerializer } = await Promise.resolve().then(() => require('@angular/localize/src/tools/src/extract/translation_files/xliff1_translation_serializer'));
73
+ const { Xliff1TranslationSerializer } = await Promise.resolve().then(() => __importStar(require('@angular/localize/src/tools/src/extract/translation_files/xliff1_translation_serializer')));
52
74
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
53
75
  return new Xliff1TranslationSerializer(sourceLocale, basePath, useLegacyIds, {});
54
76
  case schema_2.Format.Xlf2:
55
77
  case schema_2.Format.Xliff2:
56
- const { Xliff2TranslationSerializer } = await Promise.resolve().then(() => require('@angular/localize/src/tools/src/extract/translation_files/xliff2_translation_serializer'));
78
+ const { Xliff2TranslationSerializer } = await Promise.resolve().then(() => __importStar(require('@angular/localize/src/tools/src/extract/translation_files/xliff2_translation_serializer')));
57
79
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
58
80
  return new Xliff2TranslationSerializer(sourceLocale, basePath, useLegacyIds, {});
59
81
  case schema_2.Format.Json:
60
- const { SimpleJsonTranslationSerializer } = await Promise.resolve().then(() => require('@angular/localize/src/tools/src/extract/translation_files/json_translation_serializer'));
82
+ const { SimpleJsonTranslationSerializer } = await Promise.resolve().then(() => __importStar(require('@angular/localize/src/tools/src/extract/translation_files/json_translation_serializer')));
61
83
  return new SimpleJsonTranslationSerializer(sourceLocale);
62
84
  case schema_2.Format.LegacyMigrate:
63
- const { LegacyMessageIdMigrationSerializer } = await Promise.resolve().then(() => require('@angular/localize/src/tools/src/extract/translation_files/legacy_message_id_migration_serializer'));
85
+ const { LegacyMessageIdMigrationSerializer } = await Promise.resolve().then(() => __importStar(require('@angular/localize/src/tools/src/extract/translation_files/legacy_message_id_migration_serializer')));
64
86
  return new LegacyMessageIdMigrationSerializer(diagnostics);
65
87
  case schema_2.Format.Arb:
66
- const { ArbTranslationSerializer } = await Promise.resolve().then(() => require('@angular/localize/src/tools/src/extract/translation_files/arb_translation_serializer'));
88
+ const { ArbTranslationSerializer } = await Promise.resolve().then(() => __importStar(require('@angular/localize/src/tools/src/extract/translation_files/arb_translation_serializer')));
67
89
  const fileSystem = {
68
90
  relative(from, to) {
69
91
  return path.relative(from, to);
@@ -100,7 +122,7 @@ class NoEmitPlugin {
100
122
  async function execute(options, context, transforms) {
101
123
  var _a;
102
124
  // Check Angular version.
103
- version_1.assertCompatibleAngularVersion(context.workspaceRoot, context.logger);
125
+ version_1.assertCompatibleAngularVersion(context.workspaceRoot);
104
126
  const browserTarget = architect_1.targetFromTargetString(options.browserTarget);
105
127
  const browserOptions = await context.validateOptions(await context.getTargetOptions(browserTarget), await context.getBuilderNameForTarget(browserTarget));
106
128
  const format = normalizeFormatOption(options);
@@ -193,7 +215,7 @@ async function execute(options, context, transforms) {
193
215
  }
194
216
  const webpackResult = await build_webpack_1.runWebpack((await ((_a = transforms === null || transforms === void 0 ? void 0 : transforms.webpackConfiguration) === null || _a === void 0 ? void 0 : _a.call(transforms, config))) || config, context, {
195
217
  logging: stats_1.createWebpackLoggingCallback(builderOptions, context.logger),
196
- webpackFactory: webpack,
218
+ webpackFactory: webpack_1.default,
197
219
  }).toPromise();
198
220
  // Set the outputPath to the extraction output location for downstream consumers
199
221
  webpackResult.outputPath = outFile;
@@ -202,7 +224,7 @@ async function execute(options, context, transforms) {
202
224
  return webpackResult;
203
225
  }
204
226
  const basePath = config.context || projectRoot;
205
- const { checkDuplicateMessages } = await Promise.resolve().then(() => require('@angular/localize/src/tools/src/extract/duplicates'));
227
+ const { checkDuplicateMessages } = await Promise.resolve().then(() => __importStar(require('@angular/localize/src/tools/src/extract/duplicates')));
206
228
  // The filesystem is used to create a relative path for each file
207
229
  // from the basePath. This relative path is then used in the error message.
208
230
  const checkFileSystem = {
@@ -6,10 +6,29 @@
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
8
8
  */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  const extraction_1 = require("@angular/localize/src/tools/src/extract/extraction");
11
30
  const loader_utils_1 = require("loader-utils");
12
- const nodePath = require("path");
31
+ const nodePath = __importStar(require("path"));
13
32
  function localizeExtractLoader(content,
14
33
  // Source map types are broken in the webpack type definitions
15
34
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
@@ -6,10 +6,29 @@
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
8
8
  */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.findTests = void 0;
11
30
  const fs_1 = require("fs");
12
- const glob = require("glob");
31
+ const glob = __importStar(require("glob"));
13
32
  const path_1 = require("path");
14
33
  const is_directory_1 = require("../utils/is-directory");
15
34
  // go through all patterns and find unique list of files
@@ -6,6 +6,25 @@
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
8
8
  */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.execute = void 0;
11
30
  const architect_1 = require("@angular-devkit/architect");
@@ -48,7 +67,7 @@ async function initialize(options, context, webpackConfigurationTransformer) {
48
67
  configs_1.getTestConfig(wco),
49
68
  configs_1.getWorkerConfig(wco),
50
69
  ]);
51
- const karma = await Promise.resolve().then(() => require('karma'));
70
+ const karma = await Promise.resolve().then(() => __importStar(require('karma')));
52
71
  return [
53
72
  karma,
54
73
  webpackConfigurationTransformer ? await webpackConfigurationTransformer(config) : config,
@@ -59,7 +78,7 @@ async function initialize(options, context, webpackConfigurationTransformer) {
59
78
  */
60
79
  function execute(options, context, transforms = {}) {
61
80
  // Check Angular version.
62
- version_1.assertCompatibleAngularVersion(context.workspaceRoot, context.logger);
81
+ version_1.assertCompatibleAngularVersion(context.workspaceRoot);
63
82
  let singleRun;
64
83
  if (options.watch !== undefined) {
65
84
  singleRun = !options.watch;
@@ -6,6 +6,25 @@
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
8
8
  */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.execute = void 0;
11
30
  const architect_1 = require("@angular-devkit/architect");
@@ -13,7 +32,7 @@ const path_1 = require("path");
13
32
  const rxjs_1 = require("rxjs");
14
33
  const operators_1 = require("rxjs/operators");
15
34
  async function initialize(options, root) {
16
- const packager = (await Promise.resolve().then(() => require('ng-packagr'))).ngPackagr();
35
+ const packager = (await Promise.resolve().then(() => __importStar(require('ng-packagr')))).ngPackagr();
17
36
  packager.forProject(path_1.resolve(root, options.project));
18
37
  if (options.tsConfig) {
19
38
  packager.withTsConfig(path_1.resolve(root, options.tsConfig));
@@ -24,7 +43,7 @@ async function initialize(options, root) {
24
43
  * @experimental Direct usage of this function is considered experimental.
25
44
  */
26
45
  function execute(options, context) {
27
- return rxjs_1.from(initialize(options, context.workspaceRoot)).pipe(operators_1.switchMap((packager) => (options.watch ? packager.watch() : packager.build())), operators_1.mapTo({ success: true }));
46
+ return rxjs_1.from(initialize(options, context.workspaceRoot)).pipe(operators_1.switchMap((packager) => (options.watch ? packager.watch() : packager.build())), operators_1.mapTo({ success: true }), operators_1.catchError((err) => rxjs_1.of({ success: false, error: err.message })));
28
47
  }
29
48
  exports.execute = execute;
30
49
  exports.default = architect_1.createBuilder(execute);
@@ -6,12 +6,31 @@
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
8
8
  */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.execute = void 0;
11
30
  const architect_1 = require("@angular-devkit/architect");
12
31
  const core_1 = require("@angular-devkit/core");
13
32
  const path_1 = require("path");
14
- const url = require("url");
33
+ const url = __importStar(require("url"));
15
34
  const utils_1 = require("../utils");
16
35
  function runProtractor(root, options) {
17
36
  const additionalProtractorConfig = {
@@ -50,7 +69,7 @@ async function updateWebdriver() {
50
69
  Update webdriver-manager manually and run 'ng e2e --no-webdriver-update' instead.
51
70
  `);
52
71
  }
53
- const webdriverUpdate = await Promise.resolve().then(() => require(path));
72
+ const webdriverUpdate = await Promise.resolve().then(() => __importStar(require(path)));
54
73
  // const webdriverUpdate = await import(path) as typeof import ('webdriver-manager/built/lib/cmds/update');
55
74
  // run `webdriver-manager update --standalone false --gecko false --quiet`
56
75
  // if you change this, update the command comment in prev line
@@ -8,7 +8,7 @@
8
8
  import { BuilderContext, BuilderOutput } from '@angular-devkit/architect';
9
9
  import { json } from '@angular-devkit/core';
10
10
  import { Observable } from 'rxjs';
11
- import * as webpack from 'webpack';
11
+ import webpack from 'webpack';
12
12
  import { ExecutionTransformer } from '../transforms';
13
13
  import { Schema as ServerBuilderOptions } from './schema';
14
14
  /**
@@ -6,12 +6,31 @@
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
8
8
  */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.execute = void 0;
11
30
  const architect_1 = require("@angular-devkit/architect");
12
31
  const build_webpack_1 = require("@angular-devkit/build-webpack");
13
32
  const core_1 = require("@angular-devkit/core");
14
- const path = require("path");
33
+ const path = __importStar(require("path"));
15
34
  const rxjs_1 = require("rxjs");
16
35
  const operators_1 = require("rxjs/operators");
17
36
  const typescript_1 = require("typescript");
@@ -29,7 +48,7 @@ const stats_1 = require("../webpack/utils/stats");
29
48
  function execute(options, context, transforms = {}) {
30
49
  const root = context.workspaceRoot;
31
50
  // Check Angular version.
32
- version_1.assertCompatibleAngularVersion(root, context.logger);
51
+ version_1.assertCompatibleAngularVersion(root);
33
52
  const tsConfig = read_tsconfig_1.readTsconfig(options.tsConfig, root);
34
53
  const target = tsConfig.options.target || typescript_1.ScriptTarget.ES5;
35
54
  const baseOutputPath = path.resolve(root, options.outputPath);
@@ -0,0 +1,18 @@
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
+ */
8
+ import { Schema } from '../schema';
9
+ export { describeBuilder } from '../../testing';
10
+ export declare const SERVER_BUILDER_INFO: Readonly<{
11
+ name: string;
12
+ schemaPath: string;
13
+ }>;
14
+ /**
15
+ * Contains all required Server builder fields.
16
+ * Also disables progress reporting to minimize logging output.
17
+ */
18
+ export declare const BASE_OPTIONS: Readonly<Schema>;
@@ -0,0 +1,27 @@
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
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.BASE_OPTIONS = exports.SERVER_BUILDER_INFO = exports.describeBuilder = void 0;
11
+ var testing_1 = require("../../testing");
12
+ Object.defineProperty(exports, "describeBuilder", { enumerable: true, get: function () { return testing_1.describeBuilder; } });
13
+ exports.SERVER_BUILDER_INFO = Object.freeze({
14
+ name: '@angular-devkit/build-angular:server',
15
+ schemaPath: __dirname + '/../schema.json',
16
+ });
17
+ /**
18
+ * Contains all required Server builder fields.
19
+ * Also disables progress reporting to minimize logging output.
20
+ */
21
+ exports.BASE_OPTIONS = Object.freeze({
22
+ main: 'src/main.server.ts',
23
+ tsConfig: 'src/tsconfig.server.json',
24
+ progress: false,
25
+ watch: false,
26
+ outputPath: 'dist',
27
+ });
@@ -6,12 +6,31 @@
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
8
8
  */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  const architect_1 = require("@angular-devkit/architect");
11
30
  const fs_1 = require("fs");
12
- const glob = require("glob");
31
+ const glob = __importStar(require("glob"));
13
32
  const minimatch_1 = require("minimatch");
14
- const path = require("path");
33
+ const path = __importStar(require("path"));
15
34
  const strip_bom_1 = require("../utils/strip-bom");
16
35
  async function _run(options, context) {
17
36
  context.logger.warn(`TSLint's support is discontinued and we're deprecating its support in Angular CLI.\n` +
@@ -30,7 +49,7 @@ async function _run(options, context) {
30
49
  }
31
50
  let tslint;
32
51
  try {
33
- tslint = await Promise.resolve().then(() => require('tslint'));
52
+ tslint = await Promise.resolve().then(() => __importStar(require('tslint')));
34
53
  }
35
54
  catch {
36
55
  throw new Error('Unable to find TSLint. Ensure TSLint is installed.');
@@ -6,11 +6,30 @@
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
8
8
  */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.BundleActionCache = void 0;
11
- const cacache = require("cacache");
30
+ const cacache = __importStar(require("cacache"));
12
31
  const crypto_1 = require("crypto");
13
- const fs = require("fs");
32
+ const fs = __importStar(require("fs"));
14
33
  const copy_file_1 = require("./copy-file");
15
34
  const environment_options_1 = require("./environment-options");
16
35
  const packageVersion = require('../../package.json').version;
@@ -6,11 +6,30 @@
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
8
8
  */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.BundleActionExecutor = void 0;
11
30
  const jest_worker_1 = require("jest-worker");
12
- const os = require("os");
13
- const path = require("path");
31
+ const os = __importStar(require("os"));
32
+ const path = __importStar(require("path"));
14
33
  const v8_1 = require("v8");
15
34
  const action_cache_1 = require("./action-cache");
16
35
  const environment_options_1 = require("./environment-options");
@@ -6,15 +6,37 @@
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
8
8
  */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
28
+ var __importDefault = (this && this.__importDefault) || function (mod) {
29
+ return (mod && mod.__esModule) ? mod : { "default": mod };
30
+ };
9
31
  Object.defineProperty(exports, "__esModule", { value: true });
10
32
  exports.BuildBrowserFeatures = void 0;
11
- const browserslist = require("browserslist");
33
+ const browserslist_1 = __importDefault(require("browserslist"));
12
34
  const caniuse_lite_1 = require("caniuse-lite");
13
- const ts = require("typescript");
35
+ const ts = __importStar(require("typescript"));
14
36
  class BuildBrowserFeatures {
15
37
  constructor(projectRoot) {
16
38
  this.projectRoot = projectRoot;
17
- this.supportedBrowsers = browserslist(undefined, { path: this.projectRoot });
39
+ this.supportedBrowsers = browserslist_1.default(undefined, { path: this.projectRoot });
18
40
  }
19
41
  /**
20
42
  * True, when one or more browsers requires ES5
@@ -6,9 +6,12 @@
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
8
8
  */
9
+ var __importDefault = (this && this.__importDefault) || function (mod) {
10
+ return (mod && mod.__esModule) ? mod : { "default": mod };
11
+ };
9
12
  Object.defineProperty(exports, "__esModule", { value: true });
10
13
  exports.findCachePath = void 0;
11
- const findCacheDirectory = require("find-cache-dir");
14
+ const find_cache_dir_1 = __importDefault(require("find-cache-dir"));
12
15
  const os_1 = require("os");
13
16
  const path_1 = require("path");
14
17
  const environment_options_1 = require("./environment-options");
@@ -16,6 +19,6 @@ function findCachePath(name) {
16
19
  if (environment_options_1.cachingBasePath) {
17
20
  return path_1.resolve(environment_options_1.cachingBasePath, name);
18
21
  }
19
- return findCacheDirectory({ name }) || os_1.tmpdir();
22
+ return find_cache_dir_1.default({ name }) || os_1.tmpdir();
20
23
  }
21
24
  exports.findCachePath = findCachePath;
@@ -6,10 +6,29 @@
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
8
8
  */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.checkPort = void 0;
11
30
  const inquirer_1 = require("inquirer");
12
- const net = require("net");
31
+ const net = __importStar(require("net"));
13
32
  const tty_1 = require("./tty");
14
33
  function createInUseError(port) {
15
34
  return new Error(`Port ${port} is already in use. Use '--port' to specify a different port.`);
@@ -6,9 +6,28 @@
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
8
8
  */
9
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
12
+ }) : (function(o, m, k, k2) {
13
+ if (k2 === undefined) k2 = k;
14
+ o[k2] = m[k];
15
+ }));
16
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
17
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
18
+ }) : function(o, v) {
19
+ o["default"] = v;
20
+ });
21
+ var __importStar = (this && this.__importStar) || function (mod) {
22
+ if (mod && mod.__esModule) return mod;
23
+ var result = {};
24
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
25
+ __setModuleDefault(result, mod);
26
+ return result;
27
+ };
9
28
  Object.defineProperty(exports, "__esModule", { value: true });
10
29
  exports.colors = exports.removeColor = void 0;
11
- const ansiColors = require("ansi-colors");
30
+ const ansiColors = __importStar(require("ansi-colors"));
12
31
  const tty_1 = require("tty");
13
32
  const supportsColor = process.stdout instanceof tty_1.WriteStream && process.stdout.getColorDepth() > 1;
14
33
  function removeColor(text) {