@angular/build 20.1.0 → 20.2.0-next.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/build",
3
- "version": "20.1.0",
3
+ "version": "20.2.0-next.0",
4
4
  "description": "Official build system for Angular",
5
5
  "keywords": [
6
6
  "Angular CLI",
@@ -23,47 +23,47 @@
23
23
  "builders": "builders.json",
24
24
  "dependencies": {
25
25
  "@ampproject/remapping": "2.3.0",
26
- "@angular-devkit/architect": "0.2001.0",
27
- "@babel/core": "7.27.7",
26
+ "@angular-devkit/architect": "0.2002.0-next.0",
27
+ "@babel/core": "7.28.0",
28
28
  "@babel/helper-annotate-as-pure": "7.27.3",
29
29
  "@babel/helper-split-export-declaration": "7.24.7",
30
30
  "@inquirer/confirm": "5.1.13",
31
31
  "@vitejs/plugin-basic-ssl": "2.1.0",
32
- "beasties": "0.3.4",
32
+ "beasties": "0.3.5",
33
33
  "browserslist": "^4.23.0",
34
- "esbuild": "0.25.5",
34
+ "esbuild": "0.25.6",
35
35
  "https-proxy-agent": "7.0.6",
36
36
  "istanbul-lib-instrument": "6.0.3",
37
37
  "jsonc-parser": "3.3.1",
38
- "listr2": "8.3.3",
38
+ "listr2": "9.0.1",
39
39
  "magic-string": "0.30.17",
40
40
  "mrmime": "2.0.1",
41
- "parse5-html-rewriting-stream": "7.1.0",
41
+ "parse5-html-rewriting-stream": "8.0.0",
42
42
  "picomatch": "4.0.2",
43
- "piscina": "5.1.2",
44
- "rollup": "4.44.1",
43
+ "piscina": "5.1.3",
44
+ "rollup": "4.45.1",
45
45
  "sass": "1.89.2",
46
46
  "semver": "7.7.2",
47
47
  "source-map-support": "0.5.21",
48
48
  "tinyglobby": "0.2.14",
49
- "vite": "7.0.0",
49
+ "vite": "7.0.4",
50
50
  "watchpack": "2.4.4"
51
51
  },
52
52
  "optionalDependencies": {
53
53
  "lmdb": "3.4.1"
54
54
  },
55
55
  "peerDependencies": {
56
- "@angular/core": "^20.0.0",
57
- "@angular/compiler": "^20.0.0",
58
- "@angular/compiler-cli": "^20.0.0",
59
- "@angular/localize": "^20.0.0",
60
- "@angular/platform-browser": "^20.0.0",
61
- "@angular/platform-server": "^20.0.0",
62
- "@angular/service-worker": "^20.0.0",
63
- "@angular/ssr": "^20.1.0",
56
+ "@angular/core": "^20.0.0 || ^20.2.0-next.0",
57
+ "@angular/compiler": "^20.0.0 || ^20.2.0-next.0",
58
+ "@angular/compiler-cli": "^20.0.0 || ^20.2.0-next.0",
59
+ "@angular/localize": "^20.0.0 || ^20.2.0-next.0",
60
+ "@angular/platform-browser": "^20.0.0 || ^20.2.0-next.0",
61
+ "@angular/platform-server": "^20.0.0 || ^20.2.0-next.0",
62
+ "@angular/service-worker": "^20.0.0 || ^20.2.0-next.0",
63
+ "@angular/ssr": "^20.2.0-next.0",
64
64
  "karma": "^6.4.0",
65
65
  "less": "^4.2.0",
66
- "ng-packagr": "^20.0.0",
66
+ "ng-packagr": "^20.0.0 || ^20.2.0-next.0",
67
67
  "postcss": "^8.4.0",
68
68
  "tailwindcss": "^2.0.0 || ^3.0.0 || ^4.0.0",
69
69
  "tslib": "^2.3.0",
@@ -50,6 +50,7 @@ const bundler_context_1 = require("../../tools/esbuild/bundler-context");
50
50
  const sass_language_1 = require("../../tools/esbuild/stylesheets/sass-language");
51
51
  const utils_1 = require("../../tools/esbuild/utils");
52
52
  const environment_options_1 = require("../../utils/environment-options");
53
+ const path_1 = require("../../utils/path");
53
54
  const results_1 = require("./results");
54
55
  // Watch workspace for package manager changes
55
56
  const packageWatchFiles = [
@@ -91,7 +92,7 @@ async function* runEsBuildBuildAction(action, options) {
91
92
  // Ignore the output and cache paths to avoid infinite rebuild cycles
92
93
  outputOptions.base,
93
94
  cacheOptions.basePath,
94
- `${workspaceRoot.replace(/\\/g, '/')}/**/.*/**`,
95
+ `${(0, path_1.toPosixPath)(workspaceRoot)}/**/.*/**`,
95
96
  ];
96
97
  // Setup a watcher
97
98
  const { createWatcher } = await Promise.resolve().then(() => __importStar(require('../../tools/esbuild/watcher')));
@@ -55,6 +55,7 @@ const utils_2 = require("../../utils");
55
55
  const environment_options_1 = require("../../utils/environment-options");
56
56
  const load_esm_1 = require("../../utils/load-esm");
57
57
  const results_1 = require("../application/results");
58
+ const schema_1 = require("../application/schema");
58
59
  const internal_1 = require("./internal");
59
60
  /**
60
61
  * Build options that are also present on the dev server but are only passed
@@ -114,6 +115,13 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context
114
115
  // https://nodejs.org/api/process.html#processsetsourcemapsenabledval
115
116
  process.setSourceMapsEnabled(true);
116
117
  }
118
+ if (serverOptions.hmr &&
119
+ (browserOptions.outputHashing === schema_1.OutputHashing.All ||
120
+ browserOptions.outputHashing === schema_1.OutputHashing.Bundles)) {
121
+ serverOptions.hmr = false;
122
+ context.logger.warn(`Hot Module Replacement (HMR) is disabled because the 'outputHashing' option is set to '${browserOptions.outputHashing}'. ` +
123
+ 'HMR is incompatible with this setting.');
124
+ }
117
125
  const componentsHmrCanBeUsed = browserOptions.aot && serverOptions.liveReload && serverOptions.hmr;
118
126
  // Enable to support link-based component style hot reloading (`NG_HMR_CSTYLES=1` can be used to enable)
119
127
  browserOptions.externalRuntimeStyles = componentsHmrCanBeUsed && environment_options_1.useComponentStyleHmr;
@@ -12,6 +12,7 @@ exports.getTestEntrypoints = getTestEntrypoints;
12
12
  const node_fs_1 = require("node:fs");
13
13
  const node_path_1 = require("node:path");
14
14
  const tinyglobby_1 = require("tinyglobby");
15
+ const path_1 = require("../../utils/path");
15
16
  /* Go through all patterns and find unique list of files */
16
17
  async function findTests(include, exclude, workspaceRoot, projectSourceRoot) {
17
18
  const matchingTestsPromises = include.map((pattern) => findMatchingTests(pattern, exclude, workspaceRoot, projectSourceRoot));
@@ -39,7 +40,6 @@ function getTestEntrypoints(testFiles, { projectSourceRoot, workspaceRoot }) {
39
40
  return [uniqueName, testFile];
40
41
  }));
41
42
  }
42
- const normalizePath = (path) => path.replace(/\\/g, '/');
43
43
  const removeLeadingSlash = (pattern) => {
44
44
  if (pattern.charAt(0) === '/') {
45
45
  return pattern.substring(1);
@@ -62,9 +62,9 @@ function removeRoots(path, roots) {
62
62
  }
63
63
  async function findMatchingTests(pattern, ignore, workspaceRoot, projectSourceRoot) {
64
64
  // normalize pattern, glob lib only accepts forward slashes
65
- let normalizedPattern = normalizePath(pattern);
65
+ let normalizedPattern = (0, path_1.toPosixPath)(pattern);
66
66
  normalizedPattern = removeLeadingSlash(normalizedPattern);
67
- const relativeProjectRoot = normalizePath((0, node_path_1.relative)(workspaceRoot, projectSourceRoot) + '/');
67
+ const relativeProjectRoot = (0, path_1.toPosixPath)((0, node_path_1.relative)(workspaceRoot, projectSourceRoot) + '/');
68
68
  // remove relativeProjectRoot to support relative paths from root
69
69
  // such paths are easy to get when running scripts via IDEs
70
70
  normalizedPattern = removeRelativeRoot(normalizedPattern, relativeProjectRoot);
@@ -84,7 +84,7 @@ async function findMatchingTests(pattern, ignore, workspaceRoot, projectSourceRo
84
84
  }
85
85
  }
86
86
  // normalize the patterns in the ignore list
87
- const normalizedIgnorePatternList = ignore.map((pattern) => removeRelativeRoot(removeLeadingSlash(normalizePath(pattern)), relativeProjectRoot));
87
+ const normalizedIgnorePatternList = ignore.map((pattern) => removeRelativeRoot(removeLeadingSlash((0, path_1.toPosixPath)(pattern)), relativeProjectRoot));
88
88
  return (0, tinyglobby_1.glob)(normalizedPattern, {
89
89
  cwd: projectSourceRoot,
90
90
  absolute: true,
@@ -18,6 +18,7 @@ const node_path_1 = __importDefault(require("node:path"));
18
18
  const virtual_module_plugin_1 = require("../../tools/esbuild/virtual-module-plugin");
19
19
  const error_1 = require("../../utils/error");
20
20
  const load_esm_1 = require("../../utils/load-esm");
21
+ const path_1 = require("../../utils/path");
21
22
  const application_1 = require("../application");
22
23
  const results_1 = require("../application/results");
23
24
  const schema_1 = require("../application/schema");
@@ -73,7 +74,7 @@ async function* execute(options, context, extensions = {}) {
73
74
  // Setup test file build options based on application build target options
74
75
  const buildTargetOptions = (await context.validateOptions(await context.getTargetOptions(normalizedOptions.buildTarget), await context.getBuilderNameForTarget(normalizedOptions.buildTarget)));
75
76
  buildTargetOptions.polyfills = (0, options_1.injectTestingPolyfills)(buildTargetOptions.polyfills);
76
- const outputPath = node_path_1.default.join(context.workspaceRoot, generateOutputPath());
77
+ const outputPath = (0, path_1.toPosixPath)(node_path_1.default.join(context.workspaceRoot, generateOutputPath()));
77
78
  const buildOptions = {
78
79
  ...buildTargetOptions,
79
80
  watch: normalizedOptions.watch,
@@ -112,10 +113,9 @@ async function* execute(options, context, extensions = {}) {
112
113
  `import { BrowserTestingModule, platformBrowserTesting } from '@angular/platform-browser/testing';`,
113
114
  '',
114
115
  normalizedOptions.providersFile
115
- ? `import providers from './${node_path_1.default
116
+ ? `import providers from './${(0, path_1.toPosixPath)(node_path_1.default
116
117
  .relative(projectSourceRoot, normalizedOptions.providersFile)
117
- .replace(/.[mc]?ts$/, '')
118
- .replace(/\\/g, '/')}'`
118
+ .replace(/.[mc]?ts$/, ''))}'`
119
119
  : 'const providers = [];',
120
120
  '',
121
121
  // Same as https://github.com/angular/angular/blob/05a03d3f975771bb59c7eefd37c01fa127ee2229/packages/core/testing/src/test_hooks.ts#L21-L29
@@ -308,7 +308,7 @@ function generateCoverageOption(codeCoverage, workspaceRoot, outputPath) {
308
308
  return {
309
309
  enabled: true,
310
310
  excludeAfterRemap: true,
311
- include: [`${node_path_1.default.relative(workspaceRoot, outputPath)}/**`],
311
+ include: [`${(0, path_1.toPosixPath)(node_path_1.default.relative(workspaceRoot, outputPath))}/**`],
312
312
  // Special handling for `reporter` due to an undefined value causing upstream failures
313
313
  ...(codeCoverage.reporters
314
314
  ? { reporter: codeCoverage.reporters }
package/src/private.d.ts CHANGED
@@ -5,6 +5,13 @@
5
5
  * Use of this source code is governed by an MIT-style license that can be
6
6
  * found in the LICENSE file at https://angular.dev/license
7
7
  */
8
+ /**
9
+ * @fileoverview
10
+ * Private exports intended only for use with the @angular-devkit/build-angular package.
11
+ * All exports are not supported for external use, do not provide SemVer guarantees, and
12
+ * their existence may change in any future version.
13
+ */
14
+ import { createAngularCompilation } from './tools/angular/compilation';
8
15
  import { CompilerPluginOptions } from './tools/esbuild/angular/compiler-plugin';
9
16
  import { BundleStylesheetOptions } from './tools/esbuild/stylesheets/bundle-options';
10
17
  export { buildApplicationInternal } from './builders/application';
@@ -25,6 +32,8 @@ export declare function createCompilerPlugin(pluginOptions: CompilerPluginOption
25
32
  }, styleOptions: BundleStylesheetOptions & {
26
33
  inlineStyleLanguage: string;
27
34
  }): import('esbuild').Plugin;
35
+ export type { AngularCompilation } from './tools/angular/compilation';
36
+ export { createAngularCompilation };
28
37
  export * from './utils/bundle-calculator';
29
38
  export { checkPort } from './utils/check-port';
30
39
  export { deleteOutputDir } from './utils/delete-output-dir';
package/src/private.js CHANGED
@@ -21,7 +21,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
21
21
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
22
22
  };
23
23
  Object.defineProperty(exports, "__esModule", { value: true });
24
- exports.loadPostcssConfiguration = exports.generateSearchDirectories = exports.findTailwindConfiguration = exports.getTestEntrypoints = exports.findTests = exports.assertCompatibleAngularVersion = exports.getSupportedBrowsers = exports.generateBuildStatsTable = exports.augmentAppWithServiceWorker = exports.purgeStaleBuildCache = exports.createTranslationLoader = exports.loadProxyConfiguration = exports.InlineCriticalCssProcessor = exports.IndexHtmlGenerator = exports.loadTranslations = exports.createI18nOptions = exports.deleteOutputDir = exports.checkPort = exports.JavaScriptTransformer = exports.createJitResourceTransformer = exports.SourceFileCache = exports.SassWorkerImplementation = exports.transformSupportedBrowsersToTargets = exports.emitFilesToDisk = exports.serveWithVite = exports.ResultKind = exports.buildApplicationInternal = void 0;
24
+ exports.loadPostcssConfiguration = exports.generateSearchDirectories = exports.findTailwindConfiguration = exports.getTestEntrypoints = exports.findTests = exports.assertCompatibleAngularVersion = exports.getSupportedBrowsers = exports.generateBuildStatsTable = exports.augmentAppWithServiceWorker = exports.purgeStaleBuildCache = exports.createTranslationLoader = exports.loadProxyConfiguration = exports.InlineCriticalCssProcessor = exports.IndexHtmlGenerator = exports.loadTranslations = exports.createI18nOptions = exports.deleteOutputDir = exports.checkPort = exports.createAngularCompilation = exports.JavaScriptTransformer = exports.createJitResourceTransformer = exports.SourceFileCache = exports.SassWorkerImplementation = exports.transformSupportedBrowsersToTargets = exports.emitFilesToDisk = exports.serveWithVite = exports.ResultKind = exports.buildApplicationInternal = void 0;
25
25
  exports.createCompilerPlugin = createCompilerPlugin;
26
26
  /**
27
27
  * @fileoverview
@@ -30,6 +30,7 @@ exports.createCompilerPlugin = createCompilerPlugin;
30
30
  * their existence may change in any future version.
31
31
  */
32
32
  const compilation_1 = require("./tools/angular/compilation");
33
+ Object.defineProperty(exports, "createAngularCompilation", { enumerable: true, get: function () { return compilation_1.createAngularCompilation; } });
33
34
  const compiler_plugin_1 = require("./tools/esbuild/angular/compiler-plugin");
34
35
  const component_stylesheets_1 = require("./tools/esbuild/angular/component-stylesheets");
35
36
  // Builders
@@ -14,4 +14,4 @@ import type { AngularCompilation } from './angular-compilation';
14
14
  * @param browserOnlyBuild True, for browser only builds; False, for browser and server builds.
15
15
  * @returns An instance of an Angular compilation object.
16
16
  */
17
- export declare function createAngularCompilation(jit: boolean, browserOnlyBuild: boolean): Promise<AngularCompilation>;
17
+ export declare function createAngularCompilation(jit: boolean, browserOnlyBuild: boolean, parallel?: boolean): Promise<AngularCompilation>;
@@ -50,8 +50,8 @@ const environment_options_1 = require("../../../utils/environment-options");
50
50
  * @param browserOnlyBuild True, for browser only builds; False, for browser and server builds.
51
51
  * @returns An instance of an Angular compilation object.
52
52
  */
53
- async function createAngularCompilation(jit, browserOnlyBuild) {
54
- if (environment_options_1.useParallelTs) {
53
+ async function createAngularCompilation(jit, browserOnlyBuild, parallel = environment_options_1.useParallelTs) {
54
+ if (parallel) {
55
55
  const { ParallelCompilation } = await Promise.resolve().then(() => __importStar(require('./parallel-compilation')));
56
56
  return new ParallelCompilation(jit, browserOnlyBuild);
57
57
  }
@@ -20,6 +20,7 @@ const node_crypto_1 = require("node:crypto");
20
20
  const node_path_1 = require("node:path");
21
21
  const schema_1 = require("../../builders/application/schema");
22
22
  const environment_options_1 = require("../../utils/environment-options");
23
+ const path_1 = require("../../utils/path");
23
24
  const manifest_1 = require("../../utils/server-rendering/manifest");
24
25
  const compilation_1 = require("../angular/compilation");
25
26
  const compiler_plugin_1 = require("./angular/compiler-plugin");
@@ -511,9 +512,7 @@ function getEsBuildCommonPolyfillsOptions(options, namespace, tryToResolvePolyfi
511
512
  }));
512
513
  }
513
514
  // Generate module contents with an import statement per defined polyfill
514
- let contents = polyfillPaths
515
- .map((file) => `import '${file.replace(/\\/g, '/')}';`)
516
- .join('\n');
515
+ let contents = polyfillPaths.map((file) => `import '${(0, path_1.toPosixPath)(file)}';`).join('\n');
517
516
  // The below should be done after loading `$localize` as otherwise the locale will be overridden.
518
517
  if (i18nOptions.shouldInline) {
519
518
  // When inlining, a placeholder is used to allow the post-processing step to inject the $localize locale identifier.
@@ -534,8 +533,5 @@ function getEsBuildCommonPolyfillsOptions(options, namespace, tryToResolvePolyfi
534
533
  return buildOptions;
535
534
  }
536
535
  function entryFileToWorkspaceRelative(workspaceRoot, entryFile) {
537
- return ('./' +
538
- (0, node_path_1.relative)(workspaceRoot, entryFile)
539
- .replace(/.[mc]?ts$/, '')
540
- .replace(/\\/g, '/'));
536
+ return './' + (0, path_1.toPosixPath)((0, node_path_1.relative)(workspaceRoot, entryFile).replace(/.[mc]?ts$/, ''));
541
537
  }
@@ -12,6 +12,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
12
12
  Object.defineProperty(exports, "__esModule", { value: true });
13
13
  exports.createGlobalStylesBundleOptions = createGlobalStylesBundleOptions;
14
14
  const node_assert_1 = __importDefault(require("node:assert"));
15
+ const path_1 = require("../../utils/path");
15
16
  const bundle_options_1 = require("./stylesheets/bundle-options");
16
17
  const virtual_module_plugin_1 = require("./virtual-module-plugin");
17
18
  function createGlobalStylesBundleOptions(options, target, initial) {
@@ -66,7 +67,7 @@ function createGlobalStylesBundleOptions(options, target, initial) {
66
67
  const files = globalStyles.find(({ name }) => name === args.path)?.files;
67
68
  (0, node_assert_1.default)(files, `global style name should always be found [${args.path}]`);
68
69
  return {
69
- contents: files.map((file) => `@import '${file.replace(/\\/g, '/')}';`).join('\n'),
70
+ contents: files.map((file) => `@import '${(0, path_1.toPosixPath)(file)}';`).join('\n'),
70
71
  loader: 'css',
71
72
  resolveDir: workspaceRoot,
72
73
  };
@@ -17,6 +17,7 @@ const node_fs_1 = require("node:fs");
17
17
  const node_path_1 = require("node:path");
18
18
  const node_url_1 = require("node:url");
19
19
  const error_1 = require("../../utils/error");
20
+ const path_1 = require("../../utils/path");
20
21
  const lexer_1 = require("./lexer");
21
22
  /**
22
23
  * A Sass Importer base class that provides the load logic to rebase all `url()` functions
@@ -69,7 +70,7 @@ class UrlRebasingImporter {
69
70
  const rebasedPath = (0, node_path_1.relative)(this.entryDirectory, stylesheetDirectory);
70
71
  // Normalize path separators and escape characters
71
72
  // https://developer.mozilla.org/en-US/docs/Web/CSS/url#syntax
72
- const rebasedUrl = rebasedPath.replace(/\\/g, '/').replace(/[()\s'"]/g, '\\$&');
73
+ const rebasedUrl = (0, path_1.toPosixPath)(rebasedPath).replace(/[()\s'"]/g, '\\$&');
73
74
  updatedContents ??= new magic_string_1.default(contents);
74
75
  // Always quote the URL to avoid potential downstream parsing problems
75
76
  updatedContents.update(start, end, `"${rebasedUrl}||file:${valueNormalized}"`);
@@ -6,45 +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.dev/license
8
8
  */
9
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- var desc = Object.getOwnPropertyDescriptor(m, k);
12
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
13
- desc = { enumerable: true, get: function() { return m[k]; } };
14
- }
15
- Object.defineProperty(o, k2, desc);
16
- }) : (function(o, m, k, k2) {
17
- if (k2 === undefined) k2 = k;
18
- o[k2] = m[k];
19
- }));
20
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
21
- Object.defineProperty(o, "default", { enumerable: true, value: v });
22
- }) : function(o, v) {
23
- o["default"] = v;
24
- });
25
- var __importStar = (this && this.__importStar) || (function () {
26
- var ownKeys = function(o) {
27
- ownKeys = Object.getOwnPropertyNames || function (o) {
28
- var ar = [];
29
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
30
- return ar;
31
- };
32
- return ownKeys(o);
33
- };
34
- return function (mod) {
35
- if (mod && mod.__esModule) return mod;
36
- var result = {};
37
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
38
- __setModuleDefault(result, mod);
39
- return result;
40
- };
41
- })();
42
9
  Object.defineProperty(exports, "__esModule", { value: true });
43
10
  exports.InlineFontsProcessor = void 0;
44
11
  const https_proxy_agent_1 = require("https-proxy-agent");
45
12
  const node_crypto_1 = require("node:crypto");
46
13
  const promises_1 = require("node:fs/promises");
47
- const https = __importStar(require("node:https"));
14
+ const node_https_1 = require("node:https");
48
15
  const node_path_1 = require("node:path");
49
16
  const html_rewriting_stream_1 = require("./html-rewriting-stream");
50
17
  const SUPPORTED_PROVIDERS = {
@@ -193,16 +160,11 @@ class InlineFontsProcessor {
193
160
  }
194
161
  catch { }
195
162
  }
196
- let agent;
197
163
  const httpsProxy = process.env.HTTPS_PROXY ?? process.env.https_proxy;
198
- if (httpsProxy) {
199
- agent = new https_proxy_agent_1.HttpsProxyAgent(httpsProxy);
200
- }
201
164
  const data = await new Promise((resolve, reject) => {
202
165
  let rawResponse = '';
203
- https
204
- .get(url, {
205
- agent,
166
+ (0, node_https_1.get)(url, {
167
+ agent: httpsProxy ? new https_proxy_agent_1.HttpsProxyAgent(httpsProxy) : undefined,
206
168
  headers: {
207
169
  /**
208
170
  * Always use a Windows UA. This is because Google fonts will including hinting in fonts for Windows.
@@ -221,8 +183,7 @@ class InlineFontsProcessor {
221
183
  return;
222
184
  }
223
185
  res.on('data', (chunk) => (rawResponse += chunk)).on('end', () => resolve(rawResponse));
224
- })
225
- .on('error', (e) => reject(new Error(`Inlining of fonts failed. An error has occurred while retrieving ${url} over the internet.\n` +
186
+ }).on('error', (e) => reject(new Error(`Inlining of fonts failed. An error has occurred while retrieving ${url} over the internet.\n` +
226
187
  e.message)));
227
188
  });
228
189
  if (cacheFile) {
@@ -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.1.0';
13
+ const VERSION = '20.2.0-next.0';
14
14
  function hasCacheMetadata(value) {
15
15
  return (!!value &&
16
16
  typeof value === 'object' &&
@@ -0,0 +1,29 @@
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
+ /**
9
+ * Converts a Windows-style file path to a POSIX-compliant path.
10
+ *
11
+ * This function replaces all backslashes (`\`) with forward slashes (`/`).
12
+ * It is a no-op on POSIX systems (e.g., Linux, macOS), as the conversion
13
+ * only runs on Windows (`win32`).
14
+ *
15
+ * @param path - The file path to convert.
16
+ * @returns The POSIX-compliant file path.
17
+ *
18
+ * @example
19
+ * ```ts
20
+ * // On a Windows system:
21
+ * toPosixPath('C:\\Users\\Test\\file.txt');
22
+ * // => 'C:/Users/Test/file.txt'
23
+ *
24
+ * // On a POSIX system (Linux/macOS):
25
+ * toPosixPath('/home/user/file.txt');
26
+ * // => '/home/user/file.txt'
27
+ * ```
28
+ */
29
+ export declare function toPosixPath(path: string): string;
@@ -0,0 +1,37 @@
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.dev/license
8
+ */
9
+ Object.defineProperty(exports, "__esModule", { value: true });
10
+ exports.toPosixPath = toPosixPath;
11
+ const node_path_1 = require("node:path");
12
+ const node_process_1 = require("node:process");
13
+ const WINDOWS_PATH_SEPERATOR_REGEXP = /\\/g;
14
+ /**
15
+ * Converts a Windows-style file path to a POSIX-compliant path.
16
+ *
17
+ * This function replaces all backslashes (`\`) with forward slashes (`/`).
18
+ * It is a no-op on POSIX systems (e.g., Linux, macOS), as the conversion
19
+ * only runs on Windows (`win32`).
20
+ *
21
+ * @param path - The file path to convert.
22
+ * @returns The POSIX-compliant file path.
23
+ *
24
+ * @example
25
+ * ```ts
26
+ * // On a Windows system:
27
+ * toPosixPath('C:\\Users\\Test\\file.txt');
28
+ * // => 'C:/Users/Test/file.txt'
29
+ *
30
+ * // On a POSIX system (Linux/macOS):
31
+ * toPosixPath('/home/user/file.txt');
32
+ * // => '/home/user/file.txt'
33
+ * ```
34
+ */
35
+ function toPosixPath(path) {
36
+ return node_process_1.platform === 'win32' ? path.replace(WINDOWS_PATH_SEPERATOR_REGEXP, node_path_1.posix.sep) : path;
37
+ }
@@ -13,6 +13,7 @@ const node_path_1 = require("node:path");
13
13
  const schema_1 = require("../../builders/application/schema");
14
14
  const bundler_context_1 = require("../../tools/esbuild/bundler-context");
15
15
  const error_1 = require("../error");
16
+ const path_1 = require("../path");
16
17
  const url_1 = require("../url");
17
18
  const worker_pool_1 = require("../worker-pool");
18
19
  const utils_1 = require("./esm-in-memory-loader/utils");
@@ -49,7 +50,7 @@ async function prerenderPages(workspaceRoot, baseHref, appShellOptions, prerende
49
50
  serverBundlesSourceMaps.clear();
50
51
  const assetsReversed = {};
51
52
  for (const { source, destination } of assets) {
52
- assetsReversed[addLeadingSlash(destination.replace(/\\/g, node_path_1.posix.sep))] = source;
53
+ assetsReversed[addLeadingSlash((0, path_1.toPosixPath)(destination))] = source;
53
54
  }
54
55
  // Get routes to prerender
55
56
  const { errors: extractionErrors, serializedRouteTree: serializableRouteTreeNode, appShellRoute, } = await getAllRoutes(workspaceRoot, baseHref, outputFilesForWorker, assetsReversed, appShellOptions, prerenderOptions, sourcemap, outputMode).catch((err) => {
@@ -49,6 +49,7 @@ const path = __importStar(require("node:path"));
49
49
  const bundler_context_1 = require("../tools/esbuild/bundler-context");
50
50
  const error_1 = require("./error");
51
51
  const load_esm_1 = require("./load-esm");
52
+ const path_1 = require("./path");
52
53
  class CliFilesystem {
53
54
  fs;
54
55
  base;
@@ -81,7 +82,7 @@ class CliFilesystem {
81
82
  const stats = await this.fs.stat(entryPath);
82
83
  if (stats.isFile()) {
83
84
  // Uses posix paths since the service worker expects URLs
84
- items.push('/' + path.relative(this.base, entryPath).replace(/\\/g, '/'));
85
+ items.push('/' + (0, path_1.toPosixPath)(path.relative(this.base, entryPath)));
85
86
  }
86
87
  else if (stats.isDirectory()) {
87
88
  subdirectories.push(entryPath);
@@ -98,11 +99,11 @@ class ResultFilesystem {
98
99
  constructor(outputFiles, assetFiles) {
99
100
  for (const file of outputFiles) {
100
101
  if (file.type === bundler_context_1.BuildOutputFileType.Media || file.type === bundler_context_1.BuildOutputFileType.Browser) {
101
- this.fileReaders.set('/' + file.path.replace(/\\/g, '/'), async () => file.contents);
102
+ this.fileReaders.set('/' + (0, path_1.toPosixPath)(file.path), async () => file.contents);
102
103
  }
103
104
  }
104
105
  for (const file of assetFiles) {
105
- this.fileReaders.set('/' + file.destination.replace(/\\/g, '/'), () => node_fs_1.promises.readFile(file.source));
106
+ this.fileReaders.set('/' + (0, path_1.toPosixPath)(file.destination), () => node_fs_1.promises.readFile(file.source));
106
107
  }
107
108
  }
108
109
  async list(dir) {
@@ -28,7 +28,7 @@ function assertCompatibleAngularVersion(projectRoot) {
28
28
  'This likely indicates a corrupted local installation. Please try reinstalling your packages.');
29
29
  process.exit(2);
30
30
  }
31
- const supportedAngularSemver = '^20.0.0';
31
+ const supportedAngularSemver = '^20.0.0 || ^20.2.0-next.0';
32
32
  if (angularPkgJson['version'] === '0.0.0' || supportedAngularSemver.startsWith('0.0.0')) {
33
33
  // Internal CLI and FW testing version.
34
34
  return;