@angular/build 19.1.6 → 19.2.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 +13 -14
- package/src/builders/application/build-action.js +1 -6
- package/src/builders/application/execute-post-bundle.js +2 -2
- package/src/builders/dev-server/vite-server.js +3 -32
- package/src/tools/vite/plugins/angular-memory-plugin.js +13 -2
- package/src/utils/normalize-cache.js +1 -1
- package/src/utils/version.js +10 -31
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@angular/build",
|
|
3
|
-
"version": "19.1
|
|
3
|
+
"version": "19.2.0-next.1",
|
|
4
4
|
"description": "Official build system for Angular",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Angular CLI",
|
|
@@ -23,13 +23,12 @@
|
|
|
23
23
|
"builders": "builders.json",
|
|
24
24
|
"dependencies": {
|
|
25
25
|
"@ampproject/remapping": "2.3.0",
|
|
26
|
-
"@angular-devkit/
|
|
27
|
-
"@
|
|
28
|
-
"@babel/core": "7.26.0",
|
|
26
|
+
"@angular-devkit/architect": "0.1902.0-next.1",
|
|
27
|
+
"@babel/core": "7.26.7",
|
|
29
28
|
"@babel/helper-annotate-as-pure": "7.25.9",
|
|
30
29
|
"@babel/helper-split-export-declaration": "7.24.7",
|
|
31
30
|
"@babel/plugin-syntax-import-attributes": "7.26.0",
|
|
32
|
-
"@inquirer/confirm": "5.1.
|
|
31
|
+
"@inquirer/confirm": "5.1.4",
|
|
33
32
|
"@vitejs/plugin-basic-ssl": "1.2.0",
|
|
34
33
|
"beasties": "0.2.0",
|
|
35
34
|
"browserslist": "^4.23.0",
|
|
@@ -43,8 +42,8 @@
|
|
|
43
42
|
"parse5-html-rewriting-stream": "7.0.0",
|
|
44
43
|
"picomatch": "4.0.2",
|
|
45
44
|
"piscina": "4.8.0",
|
|
46
|
-
"rollup": "4.
|
|
47
|
-
"sass": "1.83.
|
|
45
|
+
"rollup": "4.32.1",
|
|
46
|
+
"sass": "1.83.4",
|
|
48
47
|
"semver": "7.6.3",
|
|
49
48
|
"vite": "6.0.11",
|
|
50
49
|
"watchpack": "2.4.2"
|
|
@@ -53,14 +52,14 @@
|
|
|
53
52
|
"lmdb": "3.2.2"
|
|
54
53
|
},
|
|
55
54
|
"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.1
|
|
55
|
+
"@angular/compiler": "^19.0.0 || ^19.2.0-next.0",
|
|
56
|
+
"@angular/compiler-cli": "^19.0.0 || ^19.2.0-next.0",
|
|
57
|
+
"@angular/localize": "^19.0.0 || ^19.2.0-next.0",
|
|
58
|
+
"@angular/platform-server": "^19.0.0 || ^19.2.0-next.0",
|
|
59
|
+
"@angular/service-worker": "^19.0.0 || ^19.2.0-next.0",
|
|
60
|
+
"@angular/ssr": "^19.2.0-next.1",
|
|
62
61
|
"less": "^4.2.0",
|
|
63
|
-
"ng-packagr": "^19.0.0",
|
|
62
|
+
"ng-packagr": "^19.0.0 || ^19.2.0-next.0",
|
|
64
63
|
"postcss": "^8.4.0",
|
|
65
64
|
"tailwindcss": "^2.0.0 || ^3.0.0 || ^4.0.0",
|
|
66
65
|
"typescript": ">=5.5 <5.8"
|
|
@@ -127,9 +127,6 @@ async function* runEsBuildBuildAction(action, options) {
|
|
|
127
127
|
if (!watcher) {
|
|
128
128
|
return;
|
|
129
129
|
}
|
|
130
|
-
// Used to force a full result on next rebuild if there were initial errors.
|
|
131
|
-
// This ensures at least one full result is emitted.
|
|
132
|
-
let hasInitialErrors = result.errors.length > 0;
|
|
133
130
|
// Wait for changes and rebuild as needed
|
|
134
131
|
const currentWatchFiles = new Set(result.watchFiles);
|
|
135
132
|
try {
|
|
@@ -167,11 +164,9 @@ async function* runEsBuildBuildAction(action, options) {
|
|
|
167
164
|
if (staleWatchFiles?.size) {
|
|
168
165
|
watcher.remove([...staleWatchFiles]);
|
|
169
166
|
}
|
|
170
|
-
for (const outputResult of emitOutputResults(result, outputOptions, changes, incrementalResults
|
|
167
|
+
for (const outputResult of emitOutputResults(result, outputOptions, changes, incrementalResults ? rebuildState : undefined)) {
|
|
171
168
|
yield outputResult;
|
|
172
169
|
}
|
|
173
|
-
// Clear initial build errors flag if no errors are now present
|
|
174
|
-
hasInitialErrors &&= result.errors.length > 0;
|
|
175
170
|
}
|
|
176
171
|
}
|
|
177
172
|
finally {
|
|
@@ -38,7 +38,7 @@ async function executePostBundleSteps(metafile, options, outputFiles, assetFiles
|
|
|
38
38
|
const allErrors = [];
|
|
39
39
|
const allWarnings = [];
|
|
40
40
|
const prerenderedRoutes = {};
|
|
41
|
-
const { baseHref = '/', serviceWorker,
|
|
41
|
+
const { baseHref = '/', serviceWorker, i18nOptions, indexHtmlOptions, optimizationOptions, sourcemapOptions, outputMode, serverEntryPoint, prerenderOptions, appShellOptions, publicPath, workspaceRoot, partialSSRBuild, } = options;
|
|
42
42
|
// Index HTML content without CSS inlining to be used for server rendering (AppShell, SSG and SSR).
|
|
43
43
|
// NOTE: Critical CSS inlining is deliberately omitted here, as it will be handled during server rendering.
|
|
44
44
|
// Additionally, when using prerendering or AppShell, the index HTML file may be regenerated.
|
|
@@ -57,7 +57,7 @@ async function executePostBundleSteps(metafile, options, outputFiles, assetFiles
|
|
|
57
57
|
}
|
|
58
58
|
// Create server manifest
|
|
59
59
|
const initialFilesPaths = new Set(initialFiles.keys());
|
|
60
|
-
if (serverEntryPoint
|
|
60
|
+
if (serverEntryPoint) {
|
|
61
61
|
const { manifestContent, serverAssetsChunks } = (0, manifest_1.generateAngularServerAppManifest)(additionalHtmlOutputFiles, outputFiles, optimizationOptions.styles.inlineCritical ?? false, undefined, locale, baseHref, initialFilesPaths, metafile, publicPath);
|
|
62
62
|
additionalOutputFiles.push(...serverAssetsChunks, (0, utils_1.createOutputFile)(manifest_1.SERVER_APP_MANIFEST_FILENAME, manifestContent, bundler_context_1.BuildOutputFileType.ServerApplication));
|
|
63
63
|
}
|
|
@@ -161,7 +161,6 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context
|
|
|
161
161
|
},
|
|
162
162
|
});
|
|
163
163
|
}
|
|
164
|
-
yield { baseUrl: '', success: false };
|
|
165
164
|
continue;
|
|
166
165
|
}
|
|
167
166
|
// Clear existing error overlay on successful result
|
|
@@ -322,29 +321,6 @@ async function* serveWithVite(serverOptions, builderName, builderAction, context
|
|
|
322
321
|
break;
|
|
323
322
|
}
|
|
324
323
|
});
|
|
325
|
-
// Setup component HMR invalidation
|
|
326
|
-
// Invalidation occurs when the runtime cannot update a component
|
|
327
|
-
server.hot.on('angular:invalidate', (data) => {
|
|
328
|
-
if (typeof data?.id !== 'string') {
|
|
329
|
-
context.logger.warn('Development server client sent invalid internal invalidate event.');
|
|
330
|
-
}
|
|
331
|
-
// Clear invalid template update
|
|
332
|
-
templateUpdates.delete(data.id);
|
|
333
|
-
// Some cases are expected unsupported update scenarios but some may be errors.
|
|
334
|
-
// If an error occurred, log the error in addition to the invalidation.
|
|
335
|
-
if (data.error) {
|
|
336
|
-
context.logger.error(`Component update failed${data.message ? `: ${data.message}` : '.'}` +
|
|
337
|
-
'\nPlease consider reporting the error at https://github.com/angular/angular-cli/issues');
|
|
338
|
-
}
|
|
339
|
-
else {
|
|
340
|
-
context.logger.warn(`Component update unsupported${data.message ? `: ${data.message}` : '.'}`);
|
|
341
|
-
}
|
|
342
|
-
server?.ws.send({
|
|
343
|
-
type: 'full-reload',
|
|
344
|
-
path: '*',
|
|
345
|
-
});
|
|
346
|
-
context.logger.info('Page reload sent to client(s).');
|
|
347
|
-
});
|
|
348
324
|
const urls = server.resolvedUrls;
|
|
349
325
|
if (urls && (urls.local.length || urls.network.length)) {
|
|
350
326
|
serverUrl = new URL(urls.local[0] ?? urls.network[0]);
|
|
@@ -574,14 +550,6 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks,
|
|
|
574
550
|
mainFields: ['es2020', 'browser', 'module', 'main'],
|
|
575
551
|
preserveSymlinks,
|
|
576
552
|
},
|
|
577
|
-
dev: {
|
|
578
|
-
// This is needed when `externalDependencies` is used to prevent Vite load errors.
|
|
579
|
-
// NOTE: If Vite adds direct support for externals, this can be removed.
|
|
580
|
-
// NOTE: Vite breaks the resolution of browser modules in SSR
|
|
581
|
-
// when accessing a url with two or more segments (e.g., 'foo/bar'),
|
|
582
|
-
// as they are not re-based from the base href.
|
|
583
|
-
preTransformRequests: externalMetadata.explicitBrowser.length === 0 && ssrMode === plugins_1.ServerSsrMode.NoSsr,
|
|
584
|
-
},
|
|
585
553
|
server: {
|
|
586
554
|
warmup: {
|
|
587
555
|
ssrFiles,
|
|
@@ -619,6 +587,9 @@ async function setupServer(serverOptions, outputFiles, assets, preserveSymlinks,
|
|
|
619
587
|
...[...assets.values()].map(({ source }) => source),
|
|
620
588
|
],
|
|
621
589
|
},
|
|
590
|
+
// This is needed when `externalDependencies` is used to prevent Vite load errors.
|
|
591
|
+
// NOTE: If Vite adds direct support for externals, this can be removed.
|
|
592
|
+
preTransformRequests: externalMetadata.explicitBrowser.length === 0,
|
|
622
593
|
},
|
|
623
594
|
ssr: {
|
|
624
595
|
// Note: `true` and `/.*/` have different sematics. When true, the `external` option is ignored.
|
|
@@ -47,13 +47,24 @@ async function createAngularMemoryPlugin(options) {
|
|
|
47
47
|
// `/@id/${source}` but is currently closer to a raw external than a resolved file path.
|
|
48
48
|
return source;
|
|
49
49
|
}
|
|
50
|
-
if (importer
|
|
50
|
+
if (importer) {
|
|
51
51
|
const normalizedImporter = normalizePath(importer);
|
|
52
|
-
if (normalizedImporter.startsWith(virtualProjectRoot)) {
|
|
52
|
+
if (source[0] === '.' && normalizedImporter.startsWith(virtualProjectRoot)) {
|
|
53
53
|
// Remove query if present
|
|
54
54
|
const [importerFile] = normalizedImporter.split('?', 1);
|
|
55
55
|
source = '/' + (0, node_path_1.join)((0, node_path_1.dirname)((0, node_path_1.relative)(virtualProjectRoot, importerFile)), source);
|
|
56
56
|
}
|
|
57
|
+
else if (!ssr &&
|
|
58
|
+
source[0] === '/' &&
|
|
59
|
+
importer.endsWith('index.html') &&
|
|
60
|
+
normalizedImporter.startsWith(virtualProjectRoot)) {
|
|
61
|
+
// This is only needed when using SSR and `angularSsrMiddleware` (old style) to correctly resolve
|
|
62
|
+
// .js files when using lazy-loading.
|
|
63
|
+
// Remove query if present
|
|
64
|
+
const [importerFile] = normalizedImporter.split('?', 1);
|
|
65
|
+
source =
|
|
66
|
+
'/' + (0, node_path_1.join)((0, node_path_1.dirname)((0, node_path_1.relative)(virtualProjectRoot, importerFile)), (0, node_path_1.basename)(source));
|
|
67
|
+
}
|
|
57
68
|
}
|
|
58
69
|
const [file] = source.split('?', 1);
|
|
59
70
|
if (outputFiles.has(normalizePath(file))) {
|
|
@@ -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.1
|
|
13
|
+
const VERSION = '19.2.0-next.1';
|
|
14
14
|
function hasCacheMetadata(value) {
|
|
15
15
|
return (!!value &&
|
|
16
16
|
typeof value === 'object' &&
|
package/src/utils/version.js
CHANGED
|
@@ -12,52 +12,31 @@ exports.assertCompatibleAngularVersion = assertCompatibleAngularVersion;
|
|
|
12
12
|
const node_module_1 = require("node:module");
|
|
13
13
|
const semver_1 = require("semver");
|
|
14
14
|
function assertCompatibleAngularVersion(projectRoot) {
|
|
15
|
-
let angularCliPkgJson;
|
|
16
15
|
let angularPkgJson;
|
|
17
16
|
// Create a custom require function for ESM compliance.
|
|
18
17
|
// NOTE: The trailing slash is significant.
|
|
19
18
|
const projectRequire = (0, node_module_1.createRequire)(projectRoot + '/');
|
|
20
19
|
try {
|
|
21
|
-
|
|
22
|
-
angularPkgJson = projectRequire(angularPackagePath);
|
|
20
|
+
angularPkgJson = projectRequire('@angular/core/package.json');
|
|
23
21
|
}
|
|
24
22
|
catch {
|
|
25
|
-
console.error('
|
|
23
|
+
console.error('Error: It appears that "@angular/core" is missing as a dependency. Please ensure it is included in your project.');
|
|
26
24
|
process.exit(2);
|
|
27
25
|
}
|
|
28
|
-
if (!
|
|
29
|
-
console.error('
|
|
30
|
-
'This likely
|
|
26
|
+
if (!angularPkgJson?.['version']) {
|
|
27
|
+
console.error('Error: Unable to determine the versions of "@angular/core".\n' +
|
|
28
|
+
'This likely indicates a corrupted local installation. Please try reinstalling your packages.');
|
|
31
29
|
process.exit(2);
|
|
32
30
|
}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
if (!(angularCliPkgJson && angularCliPkgJson['version'])) {
|
|
37
|
-
return;
|
|
38
|
-
}
|
|
39
|
-
}
|
|
40
|
-
catch {
|
|
41
|
-
// Not using @angular-devkit/build-angular with @angular/cli is ok too.
|
|
42
|
-
// In this case we don't provide as many version checks.
|
|
43
|
-
return;
|
|
44
|
-
}
|
|
45
|
-
if (angularCliPkgJson['version'] === '0.0.0' || angularPkgJson['version'] === '0.0.0') {
|
|
46
|
-
// Internal CLI testing version or integration testing in the angular/angular
|
|
47
|
-
// repository with the generated development @angular/core npm package which is versioned "0.0.0".
|
|
31
|
+
const supportedAngularSemver = '^19.0.0 || ^19.2.0-next.0';
|
|
32
|
+
if (supportedAngularSemver.startsWith('0.0.0')) {
|
|
33
|
+
// Internal CLI testing version.
|
|
48
34
|
return;
|
|
49
35
|
}
|
|
50
|
-
let supportedAngularSemver;
|
|
51
|
-
try {
|
|
52
|
-
supportedAngularSemver = projectRequire('@angular/build/package.json')['peerDependencies']['@angular/compiler-cli'];
|
|
53
|
-
}
|
|
54
|
-
catch {
|
|
55
|
-
supportedAngularSemver = projectRequire('@angular-devkit/build-angular/package.json')['peerDependencies']['@angular/compiler-cli'];
|
|
56
|
-
}
|
|
57
36
|
const angularVersion = new semver_1.SemVer(angularPkgJson['version']);
|
|
58
37
|
if (!(0, semver_1.satisfies)(angularVersion, supportedAngularSemver, { includePrerelease: true })) {
|
|
59
|
-
console.error(`
|
|
60
|
-
`but Angular version ${angularVersion}
|
|
38
|
+
console.error(`Error: The current version of "@angular/build" supports Angular versions ${supportedAngularSemver},\n` +
|
|
39
|
+
`but detected Angular version ${angularVersion} instead.\n` +
|
|
61
40
|
'Please visit the link below to find instructions on how to update Angular.\nhttps://update.angular.dev/');
|
|
62
41
|
process.exit(3);
|
|
63
42
|
}
|