@angular-devkit/build-angular 12.1.0-next.4 → 12.1.1

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 (86) hide show
  1. package/package.json +35 -33
  2. package/src/app-shell/index.js +28 -8
  3. package/src/babel/plugins/adjust-static-class-members.d.ts +25 -0
  4. package/src/babel/plugins/adjust-static-class-members.js +251 -0
  5. package/src/babel/plugins/adjust-typescript-enums.d.ts +21 -0
  6. package/src/babel/plugins/adjust-typescript-enums.js +123 -0
  7. package/src/babel/plugins/elide-angular-metadata.d.ts +21 -0
  8. package/src/babel/plugins/elide-angular-metadata.js +68 -0
  9. package/src/babel/plugins/pure-toplevel-functions.d.ts +14 -0
  10. package/src/babel/plugins/pure-toplevel-functions.js +86 -0
  11. package/src/babel/presets/application.d.ts +1 -0
  12. package/src/babel/presets/application.js +24 -4
  13. package/src/babel/webpack-loader.js +39 -1
  14. package/src/browser/index.d.ts +1 -4
  15. package/src/browser/index.js +26 -36
  16. package/src/dev-server/index.d.ts +1 -1
  17. package/src/dev-server/index.js +31 -10
  18. package/src/dev-server/tests/execute-fetch.js +4 -1
  19. package/src/extract-i18n/index.d.ts +1 -1
  20. package/src/extract-i18n/index.js +37 -14
  21. package/src/extract-i18n/ivy-extract-loader.js +20 -1
  22. package/src/karma/find-tests.js +20 -1
  23. package/src/karma/index.js +21 -1
  24. package/src/karma/tests/setup.d.ts +18 -0
  25. package/src/karma/tests/setup.js +29 -0
  26. package/src/ng-packagr/index.js +21 -2
  27. package/src/protractor/index.js +21 -2
  28. package/src/sass/sass-service.d.ts +0 -3
  29. package/src/sass/sass-service.js +4 -5
  30. package/src/server/index.d.ts +1 -1
  31. package/src/server/index.js +20 -1
  32. package/src/tslint/index.js +22 -3
  33. package/src/typings.d.ts +6 -0
  34. package/src/utils/action-cache.js +21 -2
  35. package/src/utils/action-executor.js +21 -2
  36. package/src/utils/build-browser-features.js +25 -3
  37. package/src/utils/cache-path.js +5 -2
  38. package/src/utils/check-port.js +20 -1
  39. package/src/utils/color.js +20 -1
  40. package/src/utils/copy-assets.js +26 -4
  41. package/src/utils/copy-file.js +20 -1
  42. package/src/utils/delete-output-dir.js +28 -2
  43. package/src/utils/environment-options.d.ts +1 -0
  44. package/src/utils/environment-options.js +26 -2
  45. package/src/utils/find-up.js +20 -1
  46. package/src/utils/i18n-inlining.js +21 -2
  47. package/src/utils/i18n-options.js +23 -5
  48. package/src/utils/index-file/html-rewriting-stream.js +20 -1
  49. package/src/utils/index-file/index-html-generator.js +20 -1
  50. package/src/utils/index-file/inline-critical-css.js +20 -1
  51. package/src/utils/index-file/inline-fonts.js +27 -5
  52. package/src/utils/is-directory.js +20 -1
  53. package/src/utils/load-translations.js +26 -7
  54. package/src/utils/process-bundle.js +34 -12
  55. package/src/utils/read-tsconfig.js +20 -1
  56. package/src/utils/service-worker.js +21 -2
  57. package/src/utils/spinner.d.ts +2 -0
  58. package/src/utils/spinner.js +18 -2
  59. package/src/utils/webpack-browser-config.js +21 -2
  60. package/src/webpack/configs/analytics.d.ts +11 -0
  61. package/src/webpack/configs/analytics.js +29 -0
  62. package/src/webpack/configs/browser.js +0 -4
  63. package/src/webpack/configs/common.js +90 -31
  64. package/src/webpack/configs/dev-server.js +20 -1
  65. package/src/webpack/configs/index.d.ts +1 -0
  66. package/src/webpack/configs/index.js +1 -0
  67. package/src/webpack/configs/server.js +0 -1
  68. package/src/webpack/configs/stats.d.ts +2 -0
  69. package/src/webpack/configs/stats.js +1 -0
  70. package/src/webpack/configs/styles.js +28 -2
  71. package/src/webpack/configs/test.js +32 -3
  72. package/src/webpack/configs/typescript.d.ts +2 -9
  73. package/src/webpack/configs/typescript.js +16 -14
  74. package/src/webpack/plugins/any-component-style-budget-checker.js +20 -1
  75. package/src/webpack/plugins/builder-watch-plugin.d.ts +0 -2
  76. package/src/webpack/plugins/builder-watch-plugin.js +2 -7
  77. package/src/webpack/plugins/index.js +4 -1
  78. package/src/webpack/plugins/karma/karma-context.html +1 -1
  79. package/src/webpack/plugins/karma/karma-debug.html +1 -1
  80. package/src/webpack/plugins/karma/karma.js +27 -5
  81. package/src/webpack/plugins/postcss-cli-resources.js +21 -2
  82. package/src/webpack/plugins/scripts-webpack-plugin.js +20 -1
  83. package/src/webpack/utils/async-chunks.js +9 -5
  84. package/src/webpack/utils/helpers.js +20 -1
  85. package/src/webpack/utils/stats.d.ts +2 -3
  86. package/src/webpack/utils/stats.js +50 -15
@@ -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);
@@ -118,7 +140,7 @@ async function execute(options, context, transforms) {
118
140
  const i18n = i18n_options_1.createI18nOptions(metadata);
119
141
  let useLegacyIds = true;
120
142
  const ivyMessages = [];
121
- const { config, projectRoot } = await webpack_browser_config_1.generateBrowserWebpackConfigFromContext({
143
+ const builderOptions = {
122
144
  ...browserOptions,
123
145
  optimization: false,
124
146
  sourceMap: {
@@ -138,7 +160,8 @@ async function execute(options, context, transforms) {
138
160
  subresourceIntegrity: false,
139
161
  outputHashing: schema_1.OutputHashing.None,
140
162
  namedChunks: true,
141
- }, context, (wco) => {
163
+ };
164
+ const { config, projectRoot } = await webpack_browser_config_1.generateBrowserWebpackConfigFromContext(builderOptions, context, (wco) => {
142
165
  var _a;
143
166
  if (wco.tsConfig.options.enableIvy === false) {
144
167
  context.logger.warn('Ivy extraction enabled but application is not Ivy enabled. Extraction may fail.');
@@ -191,8 +214,8 @@ async function execute(options, context, transforms) {
191
214
  };
192
215
  }
193
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, {
194
- logging: stats_1.createWebpackLoggingCallback(false, context.logger),
195
- webpackFactory: webpack,
217
+ logging: stats_1.createWebpackLoggingCallback(builderOptions, context.logger),
218
+ webpackFactory: webpack_1.default,
196
219
  }).toPromise();
197
220
  // Set the outputPath to the extraction output location for downstream consumers
198
221
  webpackResult.outputPath = outFile;
@@ -201,7 +224,7 @@ async function execute(options, context, transforms) {
201
224
  return webpackResult;
202
225
  }
203
226
  const basePath = config.context || projectRoot;
204
- 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')));
205
228
  // The filesystem is used to create a relative path for each file
206
229
  // from the basePath. This relative path is then used in the error message.
207
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");
@@ -40,6 +59,7 @@ async function initialize(options, context, webpackConfigurationTransformer) {
40
59
  // https://github.com/webpack/webpack-dev-middleware/blob/698c9ae5e9bb9a013985add6189ff21c1a1ec185/src/index.js#L65
41
60
  // https://github.com/webpack/webpack/blob/cde1b73e12eb8a77eb9ba42e7920c9ec5d29c2c9/lib/Compiler.js#L379-L388
42
61
  watch: true,
62
+ extractCss: true,
43
63
  }, context, (wco) => [
44
64
  configs_1.getCommonConfig(wco),
45
65
  configs_1.getStylesConfig(wco),
@@ -47,7 +67,7 @@ async function initialize(options, context, webpackConfigurationTransformer) {
47
67
  configs_1.getTestConfig(wco),
48
68
  configs_1.getWorkerConfig(wco),
49
69
  ]);
50
- const karma = await Promise.resolve().then(() => require('karma'));
70
+ const karma = await Promise.resolve().then(() => __importStar(require('karma')));
51
71
  return [
52
72
  karma,
53
73
  webpackConfigurationTransformer ? await webpackConfigurationTransformer(config) : config,
@@ -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 KARMA_BUILDER_INFO: Readonly<{
11
+ name: string;
12
+ schemaPath: string;
13
+ }>;
14
+ /**
15
+ * Contains all required karma builder fields.
16
+ * Also disables progress reporting to minimize logging output.
17
+ */
18
+ export declare const BASE_OPTIONS: Readonly<Schema>;
@@ -0,0 +1,29 @@
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.KARMA_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.KARMA_BUILDER_INFO = Object.freeze({
14
+ name: '@angular-devkit/build-angular:karma',
15
+ schemaPath: __dirname + '/../schema.json',
16
+ });
17
+ /**
18
+ * Contains all required karma builder fields.
19
+ * Also disables progress reporting to minimize logging output.
20
+ */
21
+ exports.BASE_OPTIONS = Object.freeze({
22
+ main: 'src/test.ts',
23
+ polyfills: 'src/polyfills.ts',
24
+ tsConfig: 'src/tsconfig.spec.json',
25
+ karmaConfig: 'karma.conf.js',
26
+ browsers: 'ChromeHeadlessCI',
27
+ progress: false,
28
+ watch: false,
29
+ });
@@ -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
@@ -41,9 +41,6 @@ export declare class SassWorkerImplementation {
41
41
  /**
42
42
  * Shutdown the Sass render worker.
43
43
  * Executing this method will stop any pending render requests.
44
- *
45
- * The worker is unreferenced upon creation and will not block application exit. This method
46
- * is only needed if early cleanup is needed.
47
44
  */
48
45
  close(): void;
49
46
  private createWorker;
@@ -87,13 +87,13 @@ class SassWorkerImplementation {
87
87
  /**
88
88
  * Shutdown the Sass render worker.
89
89
  * Executing this method will stop any pending render requests.
90
- *
91
- * The worker is unreferenced upon creation and will not block application exit. This method
92
- * is only needed if early cleanup is needed.
93
90
  */
94
91
  close() {
95
92
  for (const worker of this.workers) {
96
- void worker.terminate();
93
+ try {
94
+ void worker.terminate();
95
+ }
96
+ catch { }
97
97
  }
98
98
  this.requests.clear();
99
99
  }
@@ -154,7 +154,6 @@ class SassWorkerImplementation {
154
154
  Atomics.notify(importerSignal, 0);
155
155
  });
156
156
  });
157
- worker.unref();
158
157
  mainImporterPort.unref();
159
158
  return worker;
160
159
  }
@@ -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");
@@ -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.');
package/src/typings.d.ts CHANGED
@@ -9,3 +9,9 @@
9
9
  declare module '@discoveryjs/json-ext' {
10
10
  export function stringifyStream(value: unknown): import('stream').Readable;
11
11
  }
12
+
13
+ declare module '@babel/helper-annotate-as-pure' {
14
+ export default function annotateAsPure(
15
+ pathOrNode: import('@babel/types').Node | { node: import('@babel/types').Node },
16
+ ): void;
17
+ }
@@ -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;