@angular/build 18.1.0-next.2 → 18.1.0-next.3

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": "18.1.0-next.2",
3
+ "version": "18.1.0-next.3",
4
4
  "description": "Official build system for Angular",
5
5
  "keywords": [
6
6
  "Angular CLI",
@@ -23,11 +23,11 @@
23
23
  "builders": "builders.json",
24
24
  "dependencies": {
25
25
  "@ampproject/remapping": "2.3.0",
26
- "@angular-devkit/architect": "0.1801.0-next.2",
26
+ "@angular-devkit/architect": "0.1801.0-next.3",
27
27
  "@babel/core": "7.24.7",
28
28
  "@babel/helper-annotate-as-pure": "7.24.7",
29
29
  "@babel/helper-split-export-declaration": "7.24.7",
30
- "@inquirer/confirm": "3.1.9",
30
+ "@inquirer/confirm": "3.1.10",
31
31
  "@vitejs/plugin-basic-ssl": "1.1.0",
32
32
  "ansi-colors": "4.1.3",
33
33
  "browserslist": "^4.23.0",
@@ -41,11 +41,11 @@
41
41
  "ora": "5.4.1",
42
42
  "parse5-html-rewriting-stream": "7.0.0",
43
43
  "picomatch": "4.0.2",
44
- "piscina": "4.5.1",
45
- "sass": "1.77.5",
44
+ "piscina": "4.6.0",
45
+ "sass": "1.77.6",
46
46
  "semver": "7.6.2",
47
- "undici": "6.18.2",
48
- "vite": "5.2.13",
47
+ "undici": "6.19.2",
48
+ "vite": "5.3.1",
49
49
  "watchpack": "2.4.1"
50
50
  },
51
51
  "peerDependencies": {
@@ -78,7 +78,7 @@
78
78
  "optional": true
79
79
  }
80
80
  },
81
- "packageManager": "yarn@4.2.2",
81
+ "packageManager": "yarn@4.3.0",
82
82
  "repository": {
83
83
  "type": "git",
84
84
  "url": "https://github.com/angular/angular-cli.git"
@@ -508,6 +508,7 @@ function getDepOptimizationConfig({ disabled, exclude, include, target, zoneless
508
508
  supported: (0, internal_1.getFeatureSupport)(target, zoneless),
509
509
  plugins,
510
510
  loader,
511
+ resolveExtensions: ['.mjs', '.js', '.cjs'],
511
512
  },
512
513
  };
513
514
  }
@@ -248,7 +248,7 @@ function getEsBuildCommonOptions(options) {
248
248
  format: 'esm',
249
249
  assetNames: outputNames.media,
250
250
  conditions: ['es2020', 'es2015', 'module'],
251
- resolveExtensions: ['.ts', '.tsx', '.mjs', '.js'],
251
+ resolveExtensions: ['.ts', '.tsx', '.mjs', '.js', '.cjs'],
252
252
  metafile: true,
253
253
  legalComments: options.extractLicenses ? 'none' : 'eof',
254
254
  logLevel: options.verbose && !jsonLogs ? 'debug' : 'silent',
@@ -73,7 +73,7 @@ function createGlobalScriptsBundleOptions(options, target, initial) {
73
73
  assetNames: outputNames.media,
74
74
  mainFields: ['script', 'browser', 'main'],
75
75
  conditions: ['script'],
76
- resolveExtensions: ['.mjs', '.js'],
76
+ resolveExtensions: ['.mjs', '.js', '.cjs'],
77
77
  logLevel: options.verbose && !jsonLogs ? 'debug' : 'silent',
78
78
  metafile: true,
79
79
  minify: optimizationOptions.scripts,
@@ -42,18 +42,14 @@ function createAngularMemoryPlugin(options) {
42
42
  return (0, node_path_1.join)(virtualProjectRoot, source);
43
43
  }
44
44
  },
45
- async load(id) {
45
+ load(id) {
46
46
  const [file] = id.split('?', 1);
47
47
  const relativeFile = '/' + normalizePath((0, node_path_1.relative)(virtualProjectRoot, file));
48
48
  const codeContents = outputFiles.get(relativeFile)?.contents;
49
49
  if (codeContents === undefined) {
50
- if (relativeFile.endsWith('/node_modules/vite/dist/client/client.mjs')) {
51
- return {
52
- code: await loadViteClientCode(file),
53
- map: await (0, promises_1.readFile)(file + '.map', 'utf-8'),
54
- };
55
- }
56
- return;
50
+ return relativeFile.endsWith('/node_modules/vite/dist/client/client.mjs')
51
+ ? loadViteClientCode(file)
52
+ : undefined;
57
53
  }
58
54
  const code = Buffer.from(codeContents).toString('utf-8');
59
55
  const mapContents = outputFiles.get(relativeFile + '.map')?.contents;
@@ -231,9 +227,13 @@ function createAngularMemoryPlugin(options) {
231
227
  */
232
228
  async function loadViteClientCode(file) {
233
229
  const originalContents = await (0, promises_1.readFile)(file, 'utf-8');
234
- const updatedContents = originalContents.replace(`h('br'), 'You can also disable this overlay by setting ', ` +
235
- `h('code', { part: 'config-option-name' }, 'server.hmr.overlay'), '` +
236
- ` to ', h('code', { part: 'config-option-value' }, 'false'), ' in ', h('code', { part: 'config-file-name' }, hmrConfigName), '.'`, '');
230
+ const updatedContents = originalContents.replace(`"You can also disable this overlay by setting ",
231
+ h("code", { part: "config-option-name" }, "server.hmr.overlay"),
232
+ " to ",
233
+ h("code", { part: "config-option-value" }, "false"),
234
+ " in ",
235
+ h("code", { part: "config-file-name" }, hmrConfigName),
236
+ "."`, '');
237
237
  (0, node_assert_1.default)(originalContents !== updatedContents, 'Failed to update Vite client error overlay text.');
238
238
  return updatedContents;
239
239
  }
@@ -8,6 +8,7 @@
8
8
  */
9
9
  Object.defineProperty(exports, "__esModule", { value: true });
10
10
  exports.useJSONBuildLogs = exports.useTypeChecking = exports.shouldWatchRoot = exports.debugPerformance = exports.useParallelTs = exports.maxWorkers = exports.allowMinify = exports.shouldBeautify = exports.allowMangle = void 0;
11
+ const node_os_1 = require("node:os");
11
12
  function isDisabled(variable) {
12
13
  return variable === '0' || variable.toLowerCase() === 'false';
13
14
  }
@@ -66,7 +67,9 @@ exports.allowMinify = debugOptimize.minify;
66
67
  *
67
68
  */
68
69
  const maxWorkersVariable = process.env['NG_BUILD_MAX_WORKERS'];
69
- exports.maxWorkers = isPresent(maxWorkersVariable) ? +maxWorkersVariable : 4;
70
+ exports.maxWorkers = isPresent(maxWorkersVariable)
71
+ ? +maxWorkersVariable
72
+ : Math.min(4, (0, node_os_1.availableParallelism)());
70
73
  const parallelTsVariable = process.env['NG_BUILD_PARALLEL_TS'];
71
74
  exports.useParallelTs = !isPresent(parallelTsVariable) || !isDisabled(parallelTsVariable);
72
75
  const debugPerfVariable = process.env['NG_BUILD_DEBUG_PERF'];
@@ -25,8 +25,7 @@ async function addNonce(html) {
25
25
  }
26
26
  const { rewriter, transformedContent } = await (0, html_rewriting_stream_1.htmlRewritingStream)(html);
27
27
  rewriter.on('startTag', (tag) => {
28
- if ((tag.tagName === 'style' ||
29
- (tag.tagName === 'script' && !tag.attrs.some((attr) => attr.name === 'src'))) &&
28
+ if ((tag.tagName === 'style' || tag.tagName === 'script') &&
30
29
  !tag.attrs.some((attr) => attr.name === 'nonce')) {
31
30
  tag.attrs.push({ name: 'nonce', value: nonce });
32
31
  }
@@ -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 = '18.1.0-next.2';
13
+ const VERSION = '18.1.0-next.3';
14
14
  function hasCacheMetadata(value) {
15
15
  return (!!value &&
16
16
  typeof value === 'object' &&