@angular/build 20.1.0-next.0 → 20.1.0-next.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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@angular/build",
3
- "version": "20.1.0-next.0",
3
+ "version": "20.1.0-next.1",
4
4
  "description": "Official build system for Angular",
5
5
  "keywords": [
6
6
  "Angular CLI",
@@ -23,7 +23,7 @@
23
23
  "builders": "builders.json",
24
24
  "dependencies": {
25
25
  "@ampproject/remapping": "2.3.0",
26
- "@angular-devkit/architect": "0.2001.0-next.0",
26
+ "@angular-devkit/architect": "0.2001.0-next.1",
27
27
  "@babel/core": "7.27.4",
28
28
  "@babel/helper-annotate-as-pure": "7.27.3",
29
29
  "@babel/helper-split-export-declaration": "7.24.7",
@@ -41,8 +41,8 @@
41
41
  "parse5-html-rewriting-stream": "7.1.0",
42
42
  "picomatch": "4.0.2",
43
43
  "piscina": "5.0.0",
44
- "rollup": "4.41.1",
45
- "sass": "1.89.1",
44
+ "rollup": "4.43.0",
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",
@@ -60,7 +60,7 @@
60
60
  "@angular/platform-browser": "^20.0.0 || ^20.1.0-next.0",
61
61
  "@angular/platform-server": "^20.0.0 || ^20.1.0-next.0",
62
62
  "@angular/service-worker": "^20.0.0 || ^20.1.0-next.0",
63
- "@angular/ssr": "^20.1.0-next.0",
63
+ "@angular/ssr": "^20.1.0-next.1",
64
64
  "karma": "^6.4.0",
65
65
  "less": "^4.2.0",
66
66
  "ng-packagr": "^20.0.0 || ^20.1.0-next.0",
@@ -75,7 +75,7 @@ async function* execute(options, context, extensions = {}) {
75
75
  if (buildTargetOptions.polyfills?.includes('zone.js')) {
76
76
  buildTargetOptions.polyfills.push('zone.js/testing');
77
77
  }
78
- const outputPath = node_path_1.default.join(context.workspaceRoot, 'dist/test-out', (0, node_crypto_1.randomUUID)());
78
+ const outputPath = node_path_1.default.join(context.workspaceRoot, generateOutputPath());
79
79
  const buildOptions = {
80
80
  ...buildTargetOptions,
81
81
  watch: normalizedOptions.watch,
@@ -170,36 +170,61 @@ async function* execute(options, context, extensions = {}) {
170
170
  instance ??= await startVitest('test', undefined /* cliFilters */, {
171
171
  // Disable configuration file resolution/loading
172
172
  config: false,
173
- }, {
174
- test: {
175
- root: outputPath,
176
- globals: true,
177
- setupFiles,
178
- // Use `jsdom` if no browsers are explicitly configured.
179
- // `node` is effectively no "environment" and the default.
180
- environment: browser ? 'node' : 'jsdom',
181
- watch: normalizedOptions.watch,
182
- browser,
183
- reporters: normalizedOptions.reporters ?? ['default'],
184
- coverage: {
185
- enabled: !!normalizedOptions.codeCoverage,
186
- reporter: normalizedOptions.codeCoverage?.reporters,
187
- excludeAfterRemap: true,
188
- },
189
- ...debugOptions,
173
+ root: workspaceRoot,
174
+ project: ['base', projectName],
175
+ name: 'base',
176
+ include: [],
177
+ reporters: normalizedOptions.reporters ?? ['default'],
178
+ watch: normalizedOptions.watch,
179
+ coverage: {
180
+ enabled: !!normalizedOptions.codeCoverage,
181
+ excludeAfterRemap: true,
182
+ exclude: normalizedOptions.codeCoverage?.exclude,
183
+ // Special handling for `reporter` due to an undefined value causing upstream failures
184
+ ...(normalizedOptions.codeCoverage?.reporters
185
+ ? { reporters: normalizedOptions.codeCoverage.reporters }
186
+ : {}),
190
187
  },
188
+ ...debugOptions,
189
+ }, {
191
190
  plugins: [
192
191
  {
193
- name: 'angular-coverage-exclude',
194
- configureVitest(context) {
195
- // Adjust coverage excludes to not include the otherwise automatically inserted included unit tests.
196
- // Vite does this as a convenience but is problematic for the bundling strategy employed by the
197
- // builder's test setup. To workaround this, the excludes are adjusted here to only automatically
198
- // exclude the TypeScript source test files.
199
- context.project.config.coverage.exclude = [
200
- ...(normalizedOptions.codeCoverage?.exclude ?? []),
201
- '**/*.{test,spec}.?(c|m)ts',
202
- ];
192
+ name: 'angular:project-init',
193
+ async configureVitest(context) {
194
+ // Create a subproject that can be configured with plugins for browser mode.
195
+ // Plugins defined directly in the vite overrides will not be present in the
196
+ // browser specific Vite instance.
197
+ await context.injectTestProjects({
198
+ test: {
199
+ name: projectName,
200
+ root: outputPath,
201
+ globals: true,
202
+ setupFiles,
203
+ // Use `jsdom` if no browsers are explicitly configured.
204
+ // `node` is effectively no "environment" and the default.
205
+ environment: browser ? 'node' : 'jsdom',
206
+ browser,
207
+ },
208
+ plugins: [
209
+ {
210
+ name: 'angular:html-index',
211
+ transformIndexHtml() {
212
+ // Add all global stylesheets
213
+ return (Object.entries(result.files)
214
+ // TODO: Expand this to all configured global stylesheets
215
+ .filter(([file]) => file === 'styles.css')
216
+ .map(([styleUrl]) => ({
217
+ tag: 'link',
218
+ attrs: {
219
+ 'href': styleUrl,
220
+ 'rel': 'stylesheet',
221
+ },
222
+ injectTo: 'head',
223
+ })));
224
+ },
225
+ },
226
+ ],
227
+ });
203
228
  },
204
229
  },
205
230
  ],
@@ -265,3 +290,8 @@ function setupBrowserConfiguration(browsers, debug, projectSourceRoot) {
265
290
  };
266
291
  return { browser };
267
292
  }
293
+ function generateOutputPath() {
294
+ const datePrefix = new Date().toISOString().replaceAll(/[-:.]/g, '');
295
+ const uuidSuffix = (0, node_crypto_1.randomUUID)().slice(0, 8);
296
+ return node_path_1.default.join('dist', 'test-out', `${datePrefix}-${uuidSuffix}`);
297
+ }
@@ -281,6 +281,7 @@ class BundlerContext {
281
281
  for (const { external, kind, path } of imports) {
282
282
  if (!external ||
283
283
  utils_1.SERVER_GENERATED_EXTERNALS.has(path) ||
284
+ isInternalAngularFile(path) ||
284
285
  (kind !== 'import-statement' && kind !== 'dynamic-import' && kind !== 'require-call')) {
285
286
  continue;
286
287
  }
@@ -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-next.0';
13
+ const VERSION = '20.1.0-next.1';
14
14
  function hasCacheMetadata(value) {
15
15
  return (!!value &&
16
16
  typeof value === 'object' &&