@angular-devkit/build-angular 17.2.3 → 17.3.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 +27 -27
- package/src/builders/app-shell/index.js +1 -0
- package/src/builders/app-shell/render-worker.js +1 -1
- package/src/builders/application/build-action.d.ts +3 -1
- package/src/builders/application/build-action.js +5 -1
- package/src/builders/application/execute-build.js +1 -1
- package/src/builders/application/index.js +9 -6
- package/src/builders/application/options.d.ts +2 -6
- package/src/builders/application/options.js +48 -25
- package/src/builders/application/schema.d.ts +6 -0
- package/src/builders/application/schema.json +4 -0
- package/src/builders/browser/index.js +1 -1
- package/src/builders/browser/schema.d.ts +3 -3
- package/src/builders/browser/schema.json +1 -2
- package/src/builders/browser-esbuild/schema.d.ts +3 -3
- package/src/builders/browser-esbuild/schema.json +1 -2
- package/src/builders/dev-server/builder.js +13 -4
- package/src/builders/dev-server/schema.d.ts +6 -3
- package/src/builders/dev-server/schema.json +3 -3
- package/src/builders/dev-server/vite-server.js +7 -4
- package/src/builders/prerender/index.js +2 -0
- package/src/builders/server/schema.d.ts +3 -4
- package/src/builders/server/schema.json +1 -2
- package/src/builders/web-test-runner/index.js +1 -1
- package/src/tools/esbuild/angular/compilation/parallel-compilation.js +1 -0
- package/src/tools/esbuild/application-code-bundle.js +1 -2
- package/src/tools/esbuild/bundler-execution-result.d.ts +2 -0
- package/src/tools/esbuild/bundler-execution-result.js +4 -0
- package/src/tools/esbuild/global-styles.js +1 -2
- package/src/tools/esbuild/i18n-inliner.js +1 -0
- package/src/tools/esbuild/javascript-transformer.js +1 -0
- package/src/tools/esbuild/utils.d.ts +2 -1
- package/src/tools/esbuild/utils.js +26 -24
- package/src/tools/sass/sass-service.d.ts +3 -3
- package/src/tools/sass/sass-service.js +3 -3
- package/src/tools/webpack/plugins/javascript-optimizer-plugin.js +1 -0
- package/src/tools/webpack/plugins/javascript-optimizer-worker.d.ts +1 -1
- package/src/tools/webpack/utils/stats.js +3 -2
- package/src/utils/action-executor.js +1 -0
- package/src/utils/color.d.ts +0 -1
- package/src/utils/color.js +4 -10
- package/src/utils/index-file/html-rewriting-stream.js +9 -26
- package/src/utils/index-file/index-html-generator.js +4 -5
- package/src/utils/purge-cache.js +17 -12
- package/src/utils/server-rendering/load-esm-from-memory.d.ts +10 -0
- package/src/utils/server-rendering/load-esm-from-memory.js +26 -0
- package/src/utils/server-rendering/prerender.js +2 -0
- package/src/utils/server-rendering/render-page.js +2 -2
- package/src/utils/server-rendering/render-worker.js +0 -2
- package/src/utils/server-rendering/routes-extractor-worker.js +3 -3
- package/src/utils/version.js +15 -21
- package/src/utils/strip-bom.d.ts +0 -8
- package/src/utils/strip-bom.js +0 -17
package/src/utils/version.js
CHANGED
|
@@ -9,32 +9,30 @@
|
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.assertCompatibleAngularVersion = void 0;
|
|
11
11
|
/* eslint-disable no-console */
|
|
12
|
-
const
|
|
12
|
+
const node_module_1 = require("node:module");
|
|
13
13
|
const semver_1 = require("semver");
|
|
14
14
|
function assertCompatibleAngularVersion(projectRoot) {
|
|
15
15
|
let angularCliPkgJson;
|
|
16
16
|
let angularPkgJson;
|
|
17
|
-
|
|
17
|
+
// Create a custom require function for ESM compliance.
|
|
18
|
+
// NOTE: The trailing slash is significant.
|
|
19
|
+
const projectRequire = (0, node_module_1.createRequire)(projectRoot + '/');
|
|
18
20
|
try {
|
|
19
|
-
const angularPackagePath =
|
|
20
|
-
angularPkgJson =
|
|
21
|
+
const angularPackagePath = projectRequire.resolve('@angular/core/package.json');
|
|
22
|
+
angularPkgJson = projectRequire(angularPackagePath);
|
|
21
23
|
}
|
|
22
24
|
catch {
|
|
23
|
-
console.error(
|
|
24
|
-
You seem to not be depending on "@angular/core". This is an error.
|
|
25
|
-
`);
|
|
25
|
+
console.error('You seem to not be depending on "@angular/core". This is an error.');
|
|
26
26
|
process.exit(2);
|
|
27
27
|
}
|
|
28
28
|
if (!(angularPkgJson && angularPkgJson['version'])) {
|
|
29
|
-
console.error(
|
|
30
|
-
|
|
31
|
-
This likely means your local installation is broken. Please reinstall your packages.
|
|
32
|
-
`);
|
|
29
|
+
console.error('Cannot determine versions of "@angular/core".\n' +
|
|
30
|
+
'This likely means your local installation is broken. Please reinstall your packages.');
|
|
33
31
|
process.exit(2);
|
|
34
32
|
}
|
|
35
33
|
try {
|
|
36
|
-
const angularCliPkgPath =
|
|
37
|
-
angularCliPkgJson =
|
|
34
|
+
const angularCliPkgPath = projectRequire.resolve('@angular/cli/package.json');
|
|
35
|
+
angularCliPkgJson = projectRequire(angularCliPkgPath);
|
|
38
36
|
if (!(angularCliPkgJson && angularCliPkgJson['version'])) {
|
|
39
37
|
return;
|
|
40
38
|
}
|
|
@@ -49,16 +47,12 @@ function assertCompatibleAngularVersion(projectRoot) {
|
|
|
49
47
|
// repository with the generated development @angular/core npm package which is versioned "0.0.0".
|
|
50
48
|
return;
|
|
51
49
|
}
|
|
52
|
-
const supportedAngularSemver =
|
|
50
|
+
const supportedAngularSemver = projectRequire('@angular-devkit/build-angular/package.json')['peerDependencies']['@angular/compiler-cli'];
|
|
53
51
|
const angularVersion = new semver_1.SemVer(angularPkgJson['version']);
|
|
54
52
|
if (!(0, semver_1.satisfies)(angularVersion, supportedAngularSemver, { includePrerelease: true })) {
|
|
55
|
-
console.error(
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
Please visit the link below to find instructions on how to update Angular.
|
|
60
|
-
https://update.angular.io/
|
|
61
|
-
` + '\n');
|
|
53
|
+
console.error(`This version of CLI is only compatible with Angular versions ${supportedAngularSemver},\n` +
|
|
54
|
+
`but Angular version ${angularVersion} was found instead.\n` +
|
|
55
|
+
'Please visit the link below to find instructions on how to update Angular.\nhttps://update.angular.io/');
|
|
62
56
|
process.exit(3);
|
|
63
57
|
}
|
|
64
58
|
}
|
package/src/utils/strip-bom.d.ts
DELETED
package/src/utils/strip-bom.js
DELETED
|
@@ -1,17 +0,0 @@
|
|
|
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.io/license
|
|
8
|
-
*/
|
|
9
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.stripBom = void 0;
|
|
11
|
-
// TODO: cleanup this file, it's copied as is from Angular CLI.
|
|
12
|
-
// Strip BOM from file data.
|
|
13
|
-
// https://stackoverflow.com/questions/24356713
|
|
14
|
-
function stripBom(data) {
|
|
15
|
-
return data.replace(/^\uFEFF/, '');
|
|
16
|
-
}
|
|
17
|
-
exports.stripBom = stripBom;
|