@angular/build 19.1.5 → 19.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/README.md +1 -1
- package/package.json +14 -14
- package/src/builders/application/build-action.js +2 -29
- package/src/builders/dev-server/options.d.ts +0 -1
- package/src/builders/dev-server/options.js +1 -2
- package/src/builders/dev-server/schema.d.ts +0 -12
- package/src/builders/dev-server/schema.json +0 -17
- package/src/builders/dev-server/vite-server.js +1 -19
- package/src/tools/angular/compilation/angular-compilation.js +0 -3
- package/src/utils/normalize-cache.js +1 -1
- package/src/utils/service-worker.d.ts +1 -1
- package/src/utils/service-worker.js +7 -3
package/README.md
CHANGED
|
@@ -2,4 +2,4 @@
|
|
|
2
2
|
|
|
3
3
|
The sources for this package are in the [Angular CLI](https://github.com/angular/angular-cli) repository. Please file issues and pull requests against that repository.
|
|
4
4
|
|
|
5
|
-
Usage information and reference details can be found in repository [README](
|
|
5
|
+
Usage information and reference details can be found in repository [README](../../../README.md) file.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/build",
|
|
3
|
-
"version": "19.
|
|
3
|
+
"version": "19.2.0-next.0",
|
|
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/core": "19.
|
|
27
|
-
"@angular-devkit/architect": "0.
|
|
26
|
+
"@angular-devkit/core": "19.2.0-next.0",
|
|
27
|
+
"@angular-devkit/architect": "0.1902.0-next.0",
|
|
28
28
|
"@babel/core": "7.26.0",
|
|
29
29
|
"@babel/helper-annotate-as-pure": "7.25.9",
|
|
30
30
|
"@babel/helper-split-export-declaration": "7.24.7",
|
|
31
31
|
"@babel/plugin-syntax-import-attributes": "7.26.0",
|
|
32
|
-
"@inquirer/confirm": "5.1.
|
|
32
|
+
"@inquirer/confirm": "5.1.3",
|
|
33
33
|
"@vitejs/plugin-basic-ssl": "1.2.0",
|
|
34
34
|
"beasties": "0.2.0",
|
|
35
35
|
"browserslist": "^4.23.0",
|
|
@@ -43,8 +43,8 @@
|
|
|
43
43
|
"parse5-html-rewriting-stream": "7.0.0",
|
|
44
44
|
"picomatch": "4.0.2",
|
|
45
45
|
"piscina": "4.8.0",
|
|
46
|
-
"rollup": "4.
|
|
47
|
-
"sass": "1.83.
|
|
46
|
+
"rollup": "4.31.0",
|
|
47
|
+
"sass": "1.83.4",
|
|
48
48
|
"semver": "7.6.3",
|
|
49
49
|
"vite": "6.0.11",
|
|
50
50
|
"watchpack": "2.4.2"
|
|
@@ -53,16 +53,16 @@
|
|
|
53
53
|
"lmdb": "3.2.2"
|
|
54
54
|
},
|
|
55
55
|
"peerDependencies": {
|
|
56
|
-
"@angular/compiler": "^19.0.0",
|
|
57
|
-
"@angular/compiler-cli": "^19.0.0",
|
|
58
|
-
"@angular/localize": "^19.0.0",
|
|
59
|
-
"@angular/platform-server": "^19.0.0",
|
|
60
|
-
"@angular/service-worker": "^19.0.0",
|
|
61
|
-
"@angular/ssr": "^19.
|
|
56
|
+
"@angular/compiler": "^19.0.0 || ^19.2.0-next.0",
|
|
57
|
+
"@angular/compiler-cli": "^19.0.0 || ^19.2.0-next.0",
|
|
58
|
+
"@angular/localize": "^19.0.0 || ^19.2.0-next.0",
|
|
59
|
+
"@angular/platform-server": "^19.0.0 || ^19.2.0-next.0",
|
|
60
|
+
"@angular/service-worker": "^19.0.0 || ^19.2.0-next.0",
|
|
61
|
+
"@angular/ssr": "^19.2.0-next.0",
|
|
62
62
|
"less": "^4.2.0",
|
|
63
|
-
"ng-packagr": "^19.0.0",
|
|
63
|
+
"ng-packagr": "^19.0.0 || ^19.2.0-next.0",
|
|
64
64
|
"postcss": "^8.4.0",
|
|
65
|
-
"tailwindcss": "^2.0.0 || ^3.0.0
|
|
65
|
+
"tailwindcss": "^2.0.0 || ^3.0.0",
|
|
66
66
|
"typescript": ">=5.5 <5.8"
|
|
67
67
|
},
|
|
68
68
|
"peerDependenciesMeta": {
|
|
@@ -239,7 +239,6 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa
|
|
|
239
239
|
outputOptions,
|
|
240
240
|
},
|
|
241
241
|
};
|
|
242
|
-
let hasCssUpdates = false;
|
|
243
242
|
// Initially assume all previous output files have been removed
|
|
244
243
|
const removedOutputFiles = new Map(previousOutputInfo);
|
|
245
244
|
for (const file of outputFiles) {
|
|
@@ -255,11 +254,8 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa
|
|
|
255
254
|
incrementalResult.modified.push(file.path);
|
|
256
255
|
}
|
|
257
256
|
if (needFile) {
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
}
|
|
261
|
-
else if (!/(?:\.m?js|\.map)$/.test(file.path)) {
|
|
262
|
-
// Updates to non-JS files must signal an update with the dev server
|
|
257
|
+
// Updates to non-JS files must signal an update with the dev server
|
|
258
|
+
if (!/(?:\.m?js|\.map)$/.test(file.path)) {
|
|
263
259
|
incrementalResult.background = false;
|
|
264
260
|
}
|
|
265
261
|
incrementalResult.files[file.path] = {
|
|
@@ -285,21 +281,12 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa
|
|
|
285
281
|
else {
|
|
286
282
|
continue;
|
|
287
283
|
}
|
|
288
|
-
hasCssUpdates ||= destination.endsWith('.css');
|
|
289
284
|
incrementalResult.files[destination] = {
|
|
290
285
|
type: bundler_context_1.BuildOutputFileType.Browser,
|
|
291
286
|
inputPath: source,
|
|
292
287
|
origin: 'disk',
|
|
293
288
|
};
|
|
294
289
|
}
|
|
295
|
-
// Do not remove stale files yet if there are template updates.
|
|
296
|
-
// Component chunk files may still be referenced in running browser code.
|
|
297
|
-
// Module evaluation time component updates will update any of these files.
|
|
298
|
-
// This typically occurs when a lazy component is changed that has not yet
|
|
299
|
-
// been accessed at runtime.
|
|
300
|
-
if (hasTemplateUpdates && incrementalResult.background) {
|
|
301
|
-
removedOutputFiles.clear();
|
|
302
|
-
}
|
|
303
290
|
// Include the removed output and asset files
|
|
304
291
|
incrementalResult.removed.push(...Array.from(removedOutputFiles, ([file, { type }]) => ({
|
|
305
292
|
path: file,
|
|
@@ -312,17 +299,6 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa
|
|
|
312
299
|
// If there are template updates and the incremental update was background only, a component
|
|
313
300
|
// update is possible.
|
|
314
301
|
if (hasTemplateUpdates && incrementalResult.background) {
|
|
315
|
-
// Template changes may be accompanied by stylesheet changes and these should also be updated hot when possible.
|
|
316
|
-
if (hasCssUpdates) {
|
|
317
|
-
const styleResult = {
|
|
318
|
-
kind: results_1.ResultKind.Incremental,
|
|
319
|
-
added: incrementalResult.added.filter(isCssFilePath),
|
|
320
|
-
removed: incrementalResult.removed.filter(({ path }) => isCssFilePath(path)),
|
|
321
|
-
modified: incrementalResult.modified.filter(isCssFilePath),
|
|
322
|
-
files: Object.fromEntries(Object.entries(incrementalResult.files).filter(([path]) => isCssFilePath(path))),
|
|
323
|
-
};
|
|
324
|
-
yield styleResult;
|
|
325
|
-
}
|
|
326
302
|
const updateResult = {
|
|
327
303
|
kind: results_1.ResultKind.ComponentUpdate,
|
|
328
304
|
updates: Array.from(templateUpdates, ([id, content]) => ({
|
|
@@ -334,6 +310,3 @@ function* emitOutputResults({ outputFiles, assetFiles, errors, warnings, externa
|
|
|
334
310
|
yield updateResult;
|
|
335
311
|
}
|
|
336
312
|
}
|
|
337
|
-
function isCssFilePath(filePath) {
|
|
338
|
-
return /\.css(?:\.map)?$/i.test(filePath);
|
|
339
|
-
}
|
|
@@ -73,7 +73,7 @@ async function normalizeOptions(context, projectName, options) {
|
|
|
73
73
|
}
|
|
74
74
|
}
|
|
75
75
|
// Initial options to keep
|
|
76
|
-
const { host, port, poll, open, verbose, watch, liveReload, hmr, headers, proxyConfig, servePath, ssl, sslCert, sslKey, prebundle,
|
|
76
|
+
const { host, port, poll, open, verbose, watch, liveReload, hmr, headers, proxyConfig, servePath, ssl, sslCert, sslKey, prebundle, } = options;
|
|
77
77
|
// Return all the normalized options
|
|
78
78
|
return {
|
|
79
79
|
buildTarget,
|
|
@@ -97,6 +97,5 @@ async function normalizeOptions(context, projectName, options) {
|
|
|
97
97
|
// Prebundling defaults to true but requires caching to function
|
|
98
98
|
prebundle: cacheOptions.enabled && !optimization.scripts && prebundle,
|
|
99
99
|
inspect,
|
|
100
|
-
allowedHosts: allowedHosts ? allowedHosts : [],
|
|
101
100
|
};
|
|
102
101
|
}
|
|
@@ -2,12 +2,6 @@
|
|
|
2
2
|
* Dev Server target options for Build Facade.
|
|
3
3
|
*/
|
|
4
4
|
export type Schema = {
|
|
5
|
-
/**
|
|
6
|
-
* The hosts that can access the development server. This option sets the Vite option of the
|
|
7
|
-
* same name. For further details:
|
|
8
|
-
* https://vite.dev/config/server-options.html#server-allowedhosts
|
|
9
|
-
*/
|
|
10
|
-
allowedHosts?: AllowedHosts;
|
|
11
5
|
/**
|
|
12
6
|
* A build builder target to serve in the format of `project:target[:configuration]`. You
|
|
13
7
|
* can also pass in more than one configuration name as a comma-separated list. Example:
|
|
@@ -85,12 +79,6 @@ export type Schema = {
|
|
|
85
79
|
*/
|
|
86
80
|
watch?: boolean;
|
|
87
81
|
};
|
|
88
|
-
/**
|
|
89
|
-
* The hosts that can access the development server. This option sets the Vite option of the
|
|
90
|
-
* same name. For further details:
|
|
91
|
-
* https://vite.dev/config/server-options.html#server-allowedhosts
|
|
92
|
-
*/
|
|
93
|
-
export type AllowedHosts = string[] | boolean;
|
|
94
82
|
/**
|
|
95
83
|
* Activate debugging inspector. This option only has an effect when 'SSR' or 'SSG' are
|
|
96
84
|
* enabled.
|
|
@@ -36,23 +36,6 @@
|
|
|
36
36
|
"type": "string",
|
|
37
37
|
"description": "SSL certificate to use for serving HTTPS."
|
|
38
38
|
},
|
|
39
|
-
"allowedHosts": {
|
|
40
|
-
"description": "The hosts that can access the development server. This option sets the Vite option of the same name. For further details: https://vite.dev/config/server-options.html#server-allowedhosts",
|
|
41
|
-
"default": [],
|
|
42
|
-
"oneOf": [
|
|
43
|
-
{
|
|
44
|
-
"type": "array",
|
|
45
|
-
"description": "List of hosts that are allowed to access the development server.",
|
|
46
|
-
"items": {
|
|
47
|
-
"type": "string"
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
{
|
|
51
|
-
"type": "boolean",
|
|
52
|
-
"description": "Indicates that all hosts are allowed. This is not recommended and a security risk."
|
|
53
|
-
}
|
|
54
|
-
]
|
|
55
|
-
},
|
|
56
39
|
"headers": {
|
|
57
40
|
"type": "object",
|
|
58
41
|
"description": "Custom HTTP headers to be added to all responses.",
|
|
@@ -304,23 +304,6 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context
|
|
|
304
304
|
const serverConfiguration = await setupServer(serverOptions, generatedFiles, assetFiles, browserOptions.preserveSymlinks, externalMetadata, ssrMode, prebundleTransformer, target, (0, internal_1.isZonelessApp)(polyfills), componentStyles, templateUpdates, browserOptions.loader, browserOptions.define, extensions?.middleware, transformers?.indexHtml, thirdPartySourcemaps);
|
|
305
305
|
server = await createServer(serverConfiguration);
|
|
306
306
|
await server.listen();
|
|
307
|
-
// Setup builder context logging for browser clients
|
|
308
|
-
server.hot.on('angular:log', (data) => {
|
|
309
|
-
if (typeof data?.text !== 'string') {
|
|
310
|
-
context.logger.warn('Development server client sent invalid internal log event.');
|
|
311
|
-
}
|
|
312
|
-
switch (data.kind) {
|
|
313
|
-
case 'error':
|
|
314
|
-
context.logger.error(`[CLIENT ERROR]: ${data.text}`);
|
|
315
|
-
break;
|
|
316
|
-
case 'warning':
|
|
317
|
-
context.logger.warn(`[CLIENT WARNING]: ${data.text}`);
|
|
318
|
-
break;
|
|
319
|
-
default:
|
|
320
|
-
context.logger.info(`[CLIENT INFO]: ${data.text}`);
|
|
321
|
-
break;
|
|
322
|
-
}
|
|
323
|
-
});
|
|
324
307
|
const urls = server.resolvedUrls;
|
|
325
308
|
if (urls && (urls.local.length || urls.network.length)) {
|
|
326
309
|
serverUrl = new URL(urls.local[0] ?? urls.network[0]);
|
|
@@ -437,7 +420,7 @@ function handleUpdate(server, serverOptions, logger, componentStyles, updatedFil
|
|
|
437
420
|
type: 'update',
|
|
438
421
|
updates,
|
|
439
422
|
});
|
|
440
|
-
logger.info('
|
|
423
|
+
logger.info('HMR update sent to client(s).');
|
|
441
424
|
return;
|
|
442
425
|
}
|
|
443
426
|
}
|
|
@@ -558,7 +541,6 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks,
|
|
|
558
541
|
strictPort: true,
|
|
559
542
|
host: serverOptions.host,
|
|
560
543
|
open: serverOptions.open,
|
|
561
|
-
allowedHosts: serverOptions.allowedHosts,
|
|
562
544
|
headers: serverOptions.headers,
|
|
563
545
|
// Disable the websocket if live reload is disabled (false/undefined are the only valid values)
|
|
564
546
|
ws: serverOptions.liveReload === false && serverOptions.hmr === false ? false : undefined,
|
|
@@ -80,9 +80,6 @@ class AngularCompilation {
|
|
|
80
80
|
enableResourceInlining: false,
|
|
81
81
|
supportTestBed: false,
|
|
82
82
|
supportJitMode: false,
|
|
83
|
-
// Disable removing of comments as TS is quite aggressive with these and can
|
|
84
|
-
// remove important annotations, such as /* @__PURE__ */ and comments like /* vite-ignore */.
|
|
85
|
-
removeComments: false,
|
|
86
83
|
}));
|
|
87
84
|
}
|
|
88
85
|
async diagnoseFiles(modes = DiagnosticModes.All) {
|
|
@@ -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.
|
|
13
|
+
const VERSION = '19.2.0-next.0';
|
|
14
14
|
function hasCacheMetadata(value) {
|
|
15
15
|
return (!!value &&
|
|
16
16
|
typeof value === 'object' &&
|
|
@@ -9,7 +9,7 @@ import type { Config, Filesystem } from '@angular/service-worker/config';
|
|
|
9
9
|
import { promises as fsPromises } from 'node:fs';
|
|
10
10
|
import { BuildOutputFile } from '../tools/esbuild/bundler-context';
|
|
11
11
|
import { BuildOutputAsset } from '../tools/esbuild/bundler-execution-result';
|
|
12
|
-
export declare function augmentAppWithServiceWorker(appRoot: string, workspaceRoot: string, outputPath: string, baseHref: string, ngswConfigPath?: string,
|
|
12
|
+
export declare function augmentAppWithServiceWorker(appRoot: string, workspaceRoot: string, outputPath: string, baseHref: string, ngswConfigPath?: string, inputputFileSystem?: typeof fsPromises, outputFileSystem?: typeof fsPromises): Promise<void>;
|
|
13
13
|
export declare function augmentAppWithServiceWorkerEsbuild(workspaceRoot: string, configPath: string, baseHref: string, indexHtml: string | undefined, outputFiles: BuildOutputFile[], assetFiles: BuildOutputAsset[]): Promise<{
|
|
14
14
|
manifest: string;
|
|
15
15
|
assetFiles: BuildOutputAsset[];
|
|
@@ -133,7 +133,7 @@ class ResultFilesystem {
|
|
|
133
133
|
throw new Error('Serviceworker manifest generator should not attempted to write.');
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
|
-
async function augmentAppWithServiceWorker(appRoot, workspaceRoot, outputPath, baseHref, ngswConfigPath,
|
|
136
|
+
async function augmentAppWithServiceWorker(appRoot, workspaceRoot, outputPath, baseHref, ngswConfigPath, inputputFileSystem = node_fs_1.promises, outputFileSystem = node_fs_1.promises) {
|
|
137
137
|
// Determine the configuration file path
|
|
138
138
|
const configPath = ngswConfigPath
|
|
139
139
|
? path.join(workspaceRoot, ngswConfigPath)
|
|
@@ -141,7 +141,7 @@ async function augmentAppWithServiceWorker(appRoot, workspaceRoot, outputPath, b
|
|
|
141
141
|
// Read the configuration file
|
|
142
142
|
let config;
|
|
143
143
|
try {
|
|
144
|
-
const configurationData = await
|
|
144
|
+
const configurationData = await inputputFileSystem.readFile(configPath, 'utf-8');
|
|
145
145
|
config = JSON.parse(configurationData);
|
|
146
146
|
}
|
|
147
147
|
catch (error) {
|
|
@@ -158,7 +158,11 @@ async function augmentAppWithServiceWorker(appRoot, workspaceRoot, outputPath, b
|
|
|
158
158
|
const result = await augmentAppWithServiceWorkerCore(config, new CliFilesystem(outputFileSystem, outputPath), baseHref);
|
|
159
159
|
const copy = async (src, dest) => {
|
|
160
160
|
const resolvedDest = path.join(outputPath, dest);
|
|
161
|
-
return
|
|
161
|
+
return inputputFileSystem === outputFileSystem
|
|
162
|
+
? // Native FS (Builder).
|
|
163
|
+
inputputFileSystem.copyFile(src, resolvedDest, node_fs_1.constants.COPYFILE_FICLONE)
|
|
164
|
+
: // memfs (Webpack): Read the file from the input FS (disk) and write it to the output FS (memory).
|
|
165
|
+
outputFileSystem.writeFile(resolvedDest, await inputputFileSystem.readFile(src));
|
|
162
166
|
};
|
|
163
167
|
await outputFileSystem.writeFile(path.join(outputPath, 'ngsw.json'), result.manifest);
|
|
164
168
|
for (const { source, destination } of result.assetFiles) {
|