@angular-devkit/build-angular 19.2.0-next.2 → 19.2.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.
Files changed (45) hide show
  1. package/package.json +18 -18
  2. package/src/builders/app-shell/index.js +2 -2
  3. package/src/builders/browser/index.js +2 -2
  4. package/src/builders/dev-server/webpack-server.js +2 -2
  5. package/src/builders/extract-i18n/ivy-extract-loader.js +1 -1
  6. package/src/builders/karma/browser_builder.js +2 -2
  7. package/src/builders/karma/find-tests-plugin.js +4 -4
  8. package/src/builders/karma/index.js +22 -7
  9. package/src/builders/prerender/index.js +2 -2
  10. package/src/builders/protractor/index.js +3 -3
  11. package/src/builders/ssr-dev-server/index.js +5 -5
  12. package/src/builders/ssr-dev-server/utils.d.ts +1 -1
  13. package/src/builders/ssr-dev-server/utils.js +5 -5
  14. package/src/builders/web-test-runner/index.js +1 -1
  15. package/src/builders/web-test-runner/schema.d.ts +4 -0
  16. package/src/builders/web-test-runner/schema.json +5 -0
  17. package/src/tools/webpack/configs/common.js +1 -1
  18. package/src/tools/webpack/configs/dev-server.js +15 -15
  19. package/src/tools/webpack/plugins/any-component-style-budget-checker.js +1 -1
  20. package/src/tools/webpack/plugins/common-js-usage-warn-plugin.js +2 -2
  21. package/src/tools/webpack/plugins/hmr/hmr-loader.js +2 -2
  22. package/src/tools/webpack/plugins/index-html-webpack-plugin.js +4 -4
  23. package/src/tools/webpack/plugins/postcss-cli-resources.js +2 -2
  24. package/src/tools/webpack/plugins/scripts-webpack-plugin.js +1 -1
  25. package/src/tools/webpack/plugins/styles-webpack-plugin.js +3 -3
  26. package/src/tools/webpack/plugins/transfer-size-plugin.js +3 -3
  27. package/src/tools/webpack/utils/helpers.js +3 -3
  28. package/src/utils/error.js +2 -2
  29. package/src/utils/i18n-inlining.js +2 -2
  30. package/src/utils/normalize-asset-patterns.js +3 -3
  31. package/src/utils/normalize-cache.js +1 -1
  32. package/src/utils/normalize-file-replacements.js +4 -4
  33. package/src/utils/normalize-polyfills.js +4 -4
  34. package/src/utils/output-paths.js +5 -5
  35. package/src/utils/process-bundle.js +4 -4
  36. package/src/utils/read-tsconfig.js +1 -1
  37. package/src/utils/run-module-as-observable-fork.js +4 -4
  38. package/src/utils/webpack-browser-config.js +1 -1
  39. package/src/builders/karma/application_builder.d.ts +0 -19
  40. package/src/builders/karma/application_builder.js +0 -458
  41. package/src/builders/karma/find-tests.d.ts +0 -15
  42. package/src/builders/karma/find-tests.js +0 -144
  43. package/src/builders/karma/init_test_bed.js +0 -19
  44. package/src/builders/karma/jasmine_global.js +0 -18
  45. package/src/builders/karma/jasmine_global_cleanup.js +0 -14
@@ -53,9 +53,9 @@ exports.globalScriptsByBundleName = globalScriptsByBundleName;
53
53
  exports.assetPatterns = assetPatterns;
54
54
  exports.getStatsOptions = getStatsOptions;
55
55
  exports.isPackageInstalled = isPackageInstalled;
56
- const crypto_1 = require("crypto");
57
56
  const fast_glob_1 = __importDefault(require("fast-glob"));
58
- const path = __importStar(require("path"));
57
+ const node_crypto_1 = require("node:crypto");
58
+ const path = __importStar(require("node:path"));
59
59
  const schema_1 = require("../../../builders/browser/schema");
60
60
  const package_version_1 = require("../../../utils/package-version");
61
61
  function getOutputHashFormat(outputHashing = schema_1.OutputHashing.None, length = 20) {
@@ -171,7 +171,7 @@ function getCacheSettings(wco, angularVersion) {
171
171
  // We use the versions and build options as the cache name. The Webpack configurations are too
172
172
  // dynamic and shared among different build types: test, build and serve.
173
173
  // None of which are "named".
174
- name: (0, crypto_1.createHash)('sha1')
174
+ name: (0, node_crypto_1.createHash)('sha1')
175
175
  .update(angularVersion)
176
176
  .update(package_version_1.VERSION)
177
177
  .update(wco.projectRoot)
@@ -11,10 +11,10 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.assertIsError = assertIsError;
14
- const assert_1 = __importDefault(require("assert"));
14
+ const node_assert_1 = __importDefault(require("node:assert"));
15
15
  function assertIsError(value) {
16
16
  const isError = value instanceof Error ||
17
17
  // The following is needing to identify errors coming from RxJs.
18
18
  (typeof value === 'object' && value && 'name' in value && 'message' in value);
19
- (0, assert_1.default)(isError, 'catch clause variable is not an Error instance');
19
+ (0, node_assert_1.default)(isError, 'catch clause variable is not an Error instance');
20
20
  }
@@ -41,8 +41,8 @@ var __importStar = (this && this.__importStar) || (function () {
41
41
  })();
42
42
  Object.defineProperty(exports, "__esModule", { value: true });
43
43
  exports.i18nInlineEmittedFiles = i18nInlineEmittedFiles;
44
- const fs = __importStar(require("fs"));
45
- const path = __importStar(require("path"));
44
+ const fs = __importStar(require("node:fs"));
45
+ const path = __importStar(require("node:path"));
46
46
  const action_executor_1 = require("./action-executor");
47
47
  const copy_assets_1 = require("./copy-assets");
48
48
  const error_1 = require("./error");
@@ -45,9 +45,9 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
45
45
  Object.defineProperty(exports, "__esModule", { value: true });
46
46
  exports.MissingAssetSourceRootException = void 0;
47
47
  exports.normalizeAssetPatterns = normalizeAssetPatterns;
48
- const fs_1 = require("fs");
49
48
  const node_assert_1 = __importDefault(require("node:assert"));
50
- const path = __importStar(require("path"));
49
+ const node_fs_1 = require("node:fs");
50
+ const path = __importStar(require("node:path"));
51
51
  class MissingAssetSourceRootException extends Error {
52
52
  constructor(path) {
53
53
  super(`The ${path} asset path must start with the project source root.`);
@@ -73,7 +73,7 @@ function normalizeAssetPatterns(assetPatterns, workspaceRoot, projectRoot, proje
73
73
  let glob, input;
74
74
  let isDirectory = false;
75
75
  try {
76
- isDirectory = (0, fs_1.statSync)(resolvedAssetPath).isDirectory();
76
+ isDirectory = (0, node_fs_1.statSync)(resolvedAssetPath).isDirectory();
77
77
  }
78
78
  catch {
79
79
  isDirectory = true;
@@ -10,7 +10,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.normalizeCacheOptions = normalizeCacheOptions;
11
11
  const node_path_1 = require("node:path");
12
12
  /** Version placeholder is replaced during the build process with actual package version */
13
- const VERSION = '19.2.0-next.2';
13
+ const VERSION = '19.2.0';
14
14
  function hasCacheMetadata(value) {
15
15
  return (!!value &&
16
16
  typeof value === 'object' &&
@@ -42,8 +42,8 @@ var __importStar = (this && this.__importStar) || (function () {
42
42
  Object.defineProperty(exports, "__esModule", { value: true });
43
43
  exports.MissingFileReplacementException = void 0;
44
44
  exports.normalizeFileReplacements = normalizeFileReplacements;
45
- const fs_1 = require("fs");
46
- const path = __importStar(require("path"));
45
+ const node_fs_1 = require("node:fs");
46
+ const path = __importStar(require("node:path"));
47
47
  class MissingFileReplacementException extends Error {
48
48
  constructor(path) {
49
49
  super(`The ${path} path in file replacements does not exist.`);
@@ -56,10 +56,10 @@ function normalizeFileReplacements(fileReplacements, workspaceRoot) {
56
56
  }
57
57
  const normalizedReplacement = fileReplacements.map((replacement) => normalizeFileReplacement(replacement, workspaceRoot));
58
58
  for (const { replace, with: replacementWith } of normalizedReplacement) {
59
- if (!(0, fs_1.existsSync)(replacementWith)) {
59
+ if (!(0, node_fs_1.existsSync)(replacementWith)) {
60
60
  throw new MissingFileReplacementException(replacementWith);
61
61
  }
62
- if (!(0, fs_1.existsSync)(replace)) {
62
+ if (!(0, node_fs_1.existsSync)(replace)) {
63
63
  throw new MissingFileReplacementException(replace);
64
64
  }
65
65
  }
@@ -8,16 +8,16 @@
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.normalizePolyfills = normalizePolyfills;
11
- const fs_1 = require("fs");
12
- const path_1 = require("path");
11
+ const node_fs_1 = require("node:fs");
12
+ const node_path_1 = require("node:path");
13
13
  function normalizePolyfills(polyfills, root) {
14
14
  if (!polyfills) {
15
15
  return [];
16
16
  }
17
17
  const polyfillsList = Array.isArray(polyfills) ? polyfills : [polyfills];
18
18
  return polyfillsList.map((p) => {
19
- const resolvedPath = (0, path_1.resolve)(root, p);
19
+ const resolvedPath = (0, node_path_1.resolve)(root, p);
20
20
  // If file doesn't exist, let the bundle resolve it using node module resolution.
21
- return (0, fs_1.existsSync)(resolvedPath) ? resolvedPath : p;
21
+ return (0, node_fs_1.existsSync)(resolvedPath) ? resolvedPath : p;
22
22
  });
23
23
  }
@@ -8,18 +8,18 @@
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.ensureOutputPaths = ensureOutputPaths;
11
- const fs_1 = require("fs");
12
- const path_1 = require("path");
11
+ const node_fs_1 = require("node:fs");
12
+ const node_path_1 = require("node:path");
13
13
  function ensureOutputPaths(baseOutputPath, i18n) {
14
14
  const outputPaths = i18n.shouldInline
15
15
  ? [...i18n.inlineLocales].map((l) => [
16
16
  l,
17
- i18n.flatOutput ? baseOutputPath : (0, path_1.join)(baseOutputPath, i18n.locales[l].subPath),
17
+ i18n.flatOutput ? baseOutputPath : (0, node_path_1.join)(baseOutputPath, i18n.locales[l].subPath),
18
18
  ])
19
19
  : [['', baseOutputPath]];
20
20
  for (const [, outputPath] of outputPaths) {
21
- if (!(0, fs_1.existsSync)(outputPath)) {
22
- (0, fs_1.mkdirSync)(outputPath, { recursive: true });
21
+ if (!(0, node_fs_1.existsSync)(outputPath)) {
22
+ (0, node_fs_1.mkdirSync)(outputPath, { recursive: true });
23
23
  }
24
24
  }
25
25
  return new Map(outputPaths);
@@ -46,16 +46,16 @@ Object.defineProperty(exports, "__esModule", { value: true });
46
46
  exports.inlineLocales = inlineLocales;
47
47
  const remapping_1 = __importDefault(require("@ampproject/remapping"));
48
48
  const core_1 = require("@babel/core");
49
- const fs = __importStar(require("fs/promises"));
50
- const path = __importStar(require("path"));
51
- const worker_threads_1 = require("worker_threads");
49
+ const fs = __importStar(require("node:fs/promises"));
50
+ const path = __importStar(require("node:path"));
51
+ const node_worker_threads_1 = require("node:worker_threads");
52
52
  const environment_options_1 = require("./environment-options");
53
53
  const error_1 = require("./error");
54
54
  const load_esm_1 = require("./load-esm");
55
55
  // Lazy loaded webpack-sources object
56
56
  // Webpack is only imported if needed during the processing
57
57
  let webpackSources;
58
- const { i18n } = (worker_threads_1.workerData || {});
58
+ const { i18n } = (node_worker_threads_1.workerData || {});
59
59
  /**
60
60
  * Internal flag to enable the direct usage of the `@angular/localize` translation plugins.
61
61
  * Their usage is currently several times slower than the string manipulation method.
@@ -41,7 +41,7 @@ var __importStar = (this && this.__importStar) || (function () {
41
41
  })();
42
42
  Object.defineProperty(exports, "__esModule", { value: true });
43
43
  exports.readTsconfig = readTsconfig;
44
- const path = __importStar(require("path"));
44
+ const path = __importStar(require("node:path"));
45
45
  const load_esm_1 = require("./load-esm");
46
46
  /**
47
47
  * Reads and parses a given TsConfig file.
@@ -11,15 +11,15 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
11
11
  };
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.runModuleAsObservableFork = runModuleAsObservableFork;
14
- const child_process_1 = require("child_process");
15
- const path_1 = require("path");
14
+ const node_child_process_1 = require("node:child_process");
15
+ const node_path_1 = require("node:path");
16
16
  const rxjs_1 = require("rxjs");
17
17
  const tree_kill_1 = __importDefault(require("tree-kill"));
18
18
  function runModuleAsObservableFork(cwd, modulePath, exportName,
19
19
  // eslint-disable-next-line @typescript-eslint/no-explicit-any
20
20
  args) {
21
21
  return new rxjs_1.Observable((obs) => {
22
- const workerPath = (0, path_1.resolve)(__dirname, './run-module-worker.js');
22
+ const workerPath = (0, node_path_1.resolve)(__dirname, './run-module-worker.js');
23
23
  const debugArgRegex = /--inspect(?:-brk|-port)?|--debug(?:-brk|-port)/;
24
24
  const execArgv = process.execArgv.filter((arg) => {
25
25
  // Remove debug args.
@@ -38,7 +38,7 @@ args) {
38
38
  // logger.error, // make it a stream
39
39
  // ];
40
40
  // }
41
- const forkedProcess = (0, child_process_1.fork)(workerPath, undefined, forkOptions);
41
+ const forkedProcess = (0, node_child_process_1.fork)(workerPath, undefined, forkOptions);
42
42
  // Cleanup.
43
43
  const killForkedProcess = () => {
44
44
  if (forkedProcess && forkedProcess.pid) {
@@ -45,7 +45,7 @@ exports.generateI18nBrowserWebpackConfigFromContext = generateI18nBrowserWebpack
45
45
  exports.generateBrowserWebpackConfigFromContext = generateBrowserWebpackConfigFromContext;
46
46
  exports.getIndexOutputFile = getIndexOutputFile;
47
47
  exports.getIndexInputFile = getIndexInputFile;
48
- const path = __importStar(require("path"));
48
+ const path = __importStar(require("node:path"));
49
49
  const webpack_1 = require("webpack");
50
50
  const webpack_merge_1 = require("webpack-merge");
51
51
  const builder_watch_plugin_1 = require("../tools/webpack/plugins/builder-watch-plugin");
@@ -1,19 +0,0 @@
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.dev/license
7
- */
8
- import { ResultFile } from '@angular/build/private';
9
- import { BuilderContext, BuilderOutput } from '@angular-devkit/architect';
10
- import type { ConfigOptions } from 'karma';
11
- import { Observable } from 'rxjs';
12
- import { Configuration } from 'webpack';
13
- import { ExecutionTransformer } from '../../transforms';
14
- import { Schema as KarmaBuilderOptions } from './schema';
15
- export declare function execute(options: KarmaBuilderOptions, context: BuilderContext, karmaOptions: ConfigOptions, transforms?: {
16
- webpackConfiguration?: ExecutionTransformer<Configuration>;
17
- karmaOptions?: (options: ConfigOptions) => ConfigOptions;
18
- }): Observable<BuilderOutput>;
19
- export declare function writeTestFiles(files: Record<string, ResultFile>, testDir: string): Promise<void>;