@angular/build 20.0.0-next.4 → 20.0.0-next.5

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/build",
3
- "version": "20.0.0-next.4",
3
+ "version": "20.0.0-next.5",
4
4
  "description": "Official build system for Angular",
5
5
  "keywords": [
6
6
  "Angular CLI",
@@ -23,13 +23,13 @@
23
23
  "builders": "builders.json",
24
24
  "dependencies": {
25
25
  "@ampproject/remapping": "2.3.0",
26
- "@angular-devkit/architect": "0.2000.0-next.4",
26
+ "@angular-devkit/architect": "0.2000.0-next.5",
27
27
  "@babel/core": "7.26.10",
28
28
  "@babel/helper-annotate-as-pure": "7.25.9",
29
29
  "@babel/helper-split-export-declaration": "7.24.7",
30
- "@inquirer/confirm": "5.1.8",
30
+ "@inquirer/confirm": "5.1.9",
31
31
  "@vitejs/plugin-basic-ssl": "2.0.0",
32
- "beasties": "0.2.0",
32
+ "beasties": "0.3.2",
33
33
  "browserslist": "^4.23.0",
34
34
  "esbuild": "0.25.2",
35
35
  "https-proxy-agent": "7.0.6",
@@ -42,32 +42,37 @@
42
42
  "picomatch": "4.0.2",
43
43
  "piscina": "4.9.2",
44
44
  "rollup": "4.39.0",
45
- "sass": "1.86.1",
45
+ "sass": "1.86.3",
46
46
  "semver": "7.7.1",
47
47
  "source-map-support": "0.5.21",
48
48
  "tinyglobby": "0.2.12",
49
- "vite": "6.2.4",
49
+ "vite": "6.2.5",
50
50
  "watchpack": "2.4.2"
51
51
  },
52
52
  "optionalDependencies": {
53
53
  "lmdb": "3.2.6"
54
54
  },
55
55
  "peerDependencies": {
56
+ "@angular/core": "^20.0.0 || ^20.0.0-next.0",
56
57
  "@angular/compiler": "^20.0.0 || ^20.0.0-next.0",
57
58
  "@angular/compiler-cli": "^20.0.0 || ^20.0.0-next.0",
58
59
  "@angular/localize": "^20.0.0 || ^20.0.0-next.0",
59
60
  "@angular/platform-browser": "^20.0.0 || ^20.0.0-next.0",
60
61
  "@angular/platform-server": "^20.0.0 || ^20.0.0-next.0",
61
62
  "@angular/service-worker": "^20.0.0 || ^20.0.0-next.0",
62
- "@angular/ssr": "^20.0.0-next.4",
63
+ "@angular/ssr": "^20.0.0-next.5",
63
64
  "karma": "^6.4.0",
64
65
  "less": "^4.2.0",
65
66
  "ng-packagr": "^20.0.0 || ^20.0.0-next.0",
66
67
  "postcss": "^8.4.0",
67
68
  "tailwindcss": "^2.0.0 || ^3.0.0 || ^4.0.0",
69
+ "tslib": "^2.3.0",
68
70
  "typescript": ">=5.8 <5.9"
69
71
  },
70
72
  "peerDependenciesMeta": {
73
+ "@angular/core": {
74
+ "optional": true
75
+ },
71
76
  "@angular/localize": {
72
77
  "optional": true
73
78
  },
@@ -476,7 +476,11 @@ function normalizeExternals(value) {
476
476
  if (!value) {
477
477
  return undefined;
478
478
  }
479
- return [...new Set(value.map((d) => (d.endsWith('/*') ? d.slice(0, -2) : d)))];
479
+ return [
480
+ ...new Set(value.map((d) =>
481
+ // remove "/*" wildcard in the end if provided string is not path-like
482
+ d.endsWith('/*') && !/^\.{0,2}\//.test(d) ? d.slice(0, -2) : d)),
483
+ ];
480
484
  }
481
485
  async function findFrameworkVersion(projectRoot) {
482
486
  // Create a custom require function for ESM compliance.
@@ -57,7 +57,7 @@ const purge_cache_1 = require("../../utils/purge-cache");
57
57
  async function* execute(options, context) {
58
58
  // Purge old build disk cache.
59
59
  await (0, purge_cache_1.purgeStaleBuildCache)(context);
60
- const root = context.workspaceRoot;
60
+ const workspaceRoot = context.workspaceRoot;
61
61
  let packager;
62
62
  try {
63
63
  packager = (await Promise.resolve().then(() => __importStar(require('ng-packagr')))).ngPackagr();
@@ -72,15 +72,18 @@ async function* execute(options, context) {
72
72
  }
73
73
  throw error;
74
74
  }
75
- packager.forProject((0, node_path_1.resolve)(root, options.project));
76
- if (options.tsConfig) {
77
- packager.withTsConfig((0, node_path_1.resolve)(root, options.tsConfig));
78
- }
79
75
  const projectName = context.target?.project;
80
76
  if (!projectName) {
81
77
  throw new Error('The builder requires a target.');
82
78
  }
83
79
  const metadata = await context.getProjectMetadata(projectName);
80
+ const ngPackagrConfig = options.project
81
+ ? (0, node_path_1.join)(workspaceRoot, options.project)
82
+ : (0, node_path_1.join)(workspaceRoot, metadata.root ?? '', 'ng-package.json');
83
+ packager.forProject(ngPackagrConfig);
84
+ if (options.tsConfig) {
85
+ packager.withTsConfig((0, node_path_1.resolve)(workspaceRoot, options.tsConfig));
86
+ }
84
87
  const { enabled: cacheEnabled, path: cacheDirectory } = (0, normalize_cache_1.normalizeCacheOptions)(metadata, context.workspaceRoot);
85
88
  const ngPackagrOptions = {
86
89
  cacheEnabled,
@@ -9,7 +9,7 @@ export type Schema = {
9
9
  /**
10
10
  * The file path for the ng-packagr configuration file, relative to the current workspace.
11
11
  */
12
- project: string;
12
+ project?: string;
13
13
  /**
14
14
  * The full path for the TypeScript configuration file, relative to the current workspace.
15
15
  */
@@ -22,6 +22,5 @@
22
22
  "description": "Enable and define the file watching poll time period in milliseconds."
23
23
  }
24
24
  },
25
- "additionalProperties": false,
26
- "required": ["project"]
25
+ "additionalProperties": false
27
26
  }
@@ -14,6 +14,7 @@ export interface CompilerPluginOptions {
14
14
  sourcemap: boolean | 'external';
15
15
  tsconfig: string;
16
16
  jit?: boolean;
17
+ includeTestMetadata?: boolean;
17
18
  advancedOptimizations?: boolean;
18
19
  thirdPartySourcemaps?: boolean;
19
20
  fileReplacements?: Record<string, string>;
@@ -233,7 +233,7 @@ function createCompilerPlugin(pluginOptions, compilationOrFactory, stylesheetBun
233
233
  let referencedFiles;
234
234
  let externalStylesheets;
235
235
  try {
236
- const initializationResult = await compilation.initialize(pluginOptions.tsconfig, hostOptions, createCompilerOptionsTransformer(setupWarnings, pluginOptions, preserveSymlinks, build.initialOptions.conditions, build.initialOptions.absWorkingDir));
236
+ const initializationResult = await compilation.initialize(pluginOptions.tsconfig, hostOptions, createCompilerOptionsTransformer(setupWarnings, pluginOptions, preserveSymlinks, build.initialOptions.conditions));
237
237
  shouldTsIgnoreJs = !initializationResult.compilerOptions.allowJs;
238
238
  // Isolated modules option ensures safe non-TypeScript transpilation.
239
239
  // Typescript printing support for sourcemaps is not yet integrated.
@@ -474,7 +474,7 @@ async function bundleExternalStylesheet(stylesheetBundler, stylesheetFile, exter
474
474
  });
475
475
  }
476
476
  }
477
- function createCompilerOptionsTransformer(setupWarnings, pluginOptions, preserveSymlinks, customConditions, absWorkingDir) {
477
+ function createCompilerOptionsTransformer(setupWarnings, pluginOptions, preserveSymlinks, customConditions) {
478
478
  return (compilerOptions) => {
479
479
  // target of 9 is ES2022 (using the number avoids an expensive import of typescript just for an enum)
480
480
  if (compilerOptions.target === undefined || compilerOptions.target < 9 /** ES2022 */) {
@@ -542,6 +542,7 @@ function createCompilerOptionsTransformer(setupWarnings, pluginOptions, preserve
542
542
  return {
543
543
  ...compilerOptions,
544
544
  noEmitOnError: false,
545
+ composite: false,
545
546
  inlineSources: !!pluginOptions.sourcemap,
546
547
  inlineSourceMap: !!pluginOptions.sourcemap,
547
548
  sourceMap: undefined,
@@ -550,6 +551,7 @@ function createCompilerOptionsTransformer(setupWarnings, pluginOptions, preserve
550
551
  preserveSymlinks,
551
552
  externalRuntimeStyles: pluginOptions.externalRuntimeStyles,
552
553
  _enableHmr: !!pluginOptions.templateUpdates,
554
+ supportTestBed: !!pluginOptions.includeTestMetadata,
553
555
  };
554
556
  };
555
557
  }
@@ -9,7 +9,7 @@
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.createCompilerPluginOptions = createCompilerPluginOptions;
11
11
  function createCompilerPluginOptions(options, sourceFileCache, loadResultCache, templateUpdates) {
12
- const { sourcemapOptions, tsconfig, fileReplacements, advancedOptimizations, jit, externalRuntimeStyles, instrumentForCoverage, } = options;
12
+ const { sourcemapOptions, tsconfig, fileReplacements, advancedOptimizations, jit, externalRuntimeStyles, instrumentForCoverage, optimizationOptions, } = options;
13
13
  const incremental = !!options.watch;
14
14
  return {
15
15
  sourcemap: !!sourcemapOptions.scripts && (sourcemapOptions.hidden ? 'external' : true),
@@ -24,5 +24,6 @@ function createCompilerPluginOptions(options, sourceFileCache, loadResultCache,
24
24
  externalRuntimeStyles,
25
25
  instrumentForCoverage,
26
26
  templateUpdates,
27
+ includeTestMetadata: !optimizationOptions.scripts,
27
28
  };
28
29
  }
@@ -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 = '20.0.0-next.4';
13
+ const VERSION = '20.0.0-next.5';
14
14
  function hasCacheMetadata(value) {
15
15
  return (!!value &&
16
16
  typeof value === 'object' &&