@angular/build 22.3.0-next.1 → 22.3.0-next.2
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 -13
- package/src/builders/application/build-action.js +2 -2
- package/src/builders/application/build-action.js.map +1 -1
- package/src/builders/application/index.js +8 -31
- package/src/builders/application/index.js.map +1 -1
- package/src/builders/application/options.d.ts +1 -3
- package/src/builders/application/options.js +1 -1
- package/src/builders/application/options.js.map +1 -1
- package/src/builders/application/results.d.ts +1 -1
- package/src/builders/dev-server/vite/utils.js +1 -1
- package/src/builders/dev-server/vite/utils.js.map +1 -1
- package/src/builders/extract-i18n/application-extraction.js +2 -1
- package/src/builders/extract-i18n/application-extraction.js.map +1 -1
- package/src/builders/karma/assets-middleware.js +1 -1
- package/src/builders/karma/assets-middleware.js.map +1 -1
- package/src/builders/library/builder-state.d.ts +115 -0
- package/src/builders/library/builder-state.js +282 -0
- package/src/builders/library/builder-state.js.map +1 -0
- package/src/builders/library/builder.js +101 -89
- package/src/builders/library/builder.js.map +1 -1
- package/src/builders/library/execution-result.d.ts +35 -0
- package/src/builders/library/execution-result.js +67 -0
- package/src/builders/library/execution-result.js.map +1 -0
- package/src/builders/library/index.d.ts +1 -1
- package/src/builders/library/index.js.map +1 -1
- package/src/builders/library/options.d.ts +9 -0
- package/src/builders/library/options.js +29 -14
- package/src/builders/library/options.js.map +1 -1
- package/src/builders/library/pipeline/assets.d.ts +3 -3
- package/src/builders/library/pipeline/assets.js +12 -16
- package/src/builders/library/pipeline/assets.js.map +1 -1
- package/src/builders/library/pipeline/build-action.d.ts +11 -24
- package/src/builders/library/pipeline/build-action.js +76 -125
- package/src/builders/library/pipeline/build-action.js.map +1 -1
- package/src/builders/library/pipeline/bundler.d.ts +3 -3
- package/src/builders/library/pipeline/bundler.js +55 -33
- package/src/builders/library/pipeline/bundler.js.map +1 -1
- package/src/builders/library/pipeline/compilation.d.ts +7 -26
- package/src/builders/library/pipeline/compilation.js +59 -69
- package/src/builders/library/pipeline/compilation.js.map +1 -1
- package/src/builders/library/pipeline/entry-points.d.ts +26 -6
- package/src/builders/library/pipeline/entry-points.js +82 -21
- package/src/builders/library/pipeline/entry-points.js.map +1 -1
- package/src/builders/library/pipeline/package-manifests.d.ts +2 -1
- package/src/builders/library/pipeline/package-manifests.js +50 -1
- package/src/builders/library/pipeline/package-manifests.js.map +1 -1
- package/src/builders/library/pipeline/stylesheet-bundler.d.ts +4 -1
- package/src/builders/library/pipeline/stylesheet-bundler.js +1 -1
- package/src/builders/library/pipeline/stylesheet-bundler.js.map +1 -1
- package/src/builders/library/pipeline/utils.d.ts +19 -11
- package/src/builders/library/pipeline/utils.js +27 -11
- package/src/builders/library/pipeline/utils.js.map +1 -1
- package/src/builders/library/schema.json +2 -4
- package/src/builders/library/types.d.ts +62 -22
- package/src/builders/unit-test/runners/vitest/executor.js +0 -5
- package/src/builders/unit-test/runners/vitest/executor.js.map +1 -1
- package/src/builders/unit-test/runners/vitest/plugins.js +13 -1
- package/src/builders/unit-test/runners/vitest/plugins.js.map +1 -1
- package/src/builders/unit-test/test-discovery.js +4 -2
- package/src/builders/unit-test/test-discovery.js.map +1 -1
- package/src/private.d.ts +1 -1
- package/src/private.js +3 -3
- package/src/private.js.map +1 -1
- package/src/tools/angular/angular-host.d.ts +1 -1
- package/src/tools/angular/angular-host.js +5 -2
- package/src/tools/angular/angular-host.js.map +1 -1
- package/src/tools/angular/compilation/angular-compilation.d.ts +1 -0
- package/src/tools/angular/compilation/angular-compilation.js.map +1 -1
- package/src/tools/angular/compilation/aot-compilation.js +325 -80
- package/src/tools/angular/compilation/aot-compilation.js.map +1 -1
- package/src/tools/angular/compilation/compiler-options.js +4 -1
- package/src/tools/angular/compilation/compiler-options.js.map +1 -1
- package/src/tools/angular/compilation/jit-compilation.js +5 -4
- package/src/tools/angular/compilation/jit-compilation.js.map +1 -1
- package/src/tools/angular/compilation/parallel-worker.js +1 -0
- package/src/tools/angular/compilation/parallel-worker.js.map +1 -1
- package/src/tools/angular/compilation/typescript-compilation.d.ts +2 -0
- package/src/tools/angular/compilation/typescript-compilation.js +44 -5
- package/src/tools/angular/compilation/typescript-compilation.js.map +1 -1
- package/src/tools/esbuild/bundler-context.js +5 -1
- package/src/tools/esbuild/bundler-context.js.map +1 -1
- package/src/tools/esbuild/persistent-load-result-cache.js +2 -4
- package/src/tools/esbuild/persistent-load-result-cache.js.map +1 -1
- package/src/tools/esbuild/utils.d.ts +1 -2
- package/src/tools/esbuild/utils.js +0 -13
- package/src/tools/esbuild/utils.js.map +1 -1
- package/src/tools/sass/rebasing-importer.d.ts +1 -1
- package/src/tools/sass/rebasing-importer.js +6 -3
- package/src/tools/sass/rebasing-importer.js.map +1 -1
- package/src/tools/vite/middlewares/assets-middleware.js +1 -1
- package/src/tools/vite/middlewares/assets-middleware.js.map +1 -1
- package/src/utils/concurrency.d.ts +4 -0
- package/src/utils/concurrency.js +5 -0
- package/src/utils/concurrency.js.map +1 -1
- package/src/utils/delete-output-dir.js +3 -2
- package/src/utils/delete-output-dir.js.map +1 -1
- package/src/utils/disk-files.d.ts +30 -0
- package/src/utils/disk-files.js +68 -0
- package/src/utils/disk-files.js.map +1 -0
- package/src/utils/index-file/nonce.d.ts +2 -1
- package/src/utils/index-file/nonce.js +22 -4
- package/src/utils/index-file/nonce.js.map +1 -1
- package/src/utils/normalize-asset-patterns.d.ts +18 -3
- package/src/utils/normalize-asset-patterns.js +34 -67
- package/src/utils/normalize-asset-patterns.js.map +1 -1
- package/src/utils/normalize-cache.js +2 -2
- package/src/utils/normalize-cache.js.map +1 -1
- package/src/utils/postcss-configuration.d.ts +2 -2
- package/src/utils/postcss-configuration.js +3 -3
- package/src/utils/postcss-configuration.js.map +1 -1
- package/src/utils/resolve-assets.js +28 -9
- package/src/utils/resolve-assets.js.map +1 -1
- package/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.d.ts +1 -1
- package/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.js +3 -3
- package/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.js.map +1 -1
- package/src/utils/server-rendering/esm-in-memory-loader/register-hooks.js +3 -2
- package/src/utils/server-rendering/esm-in-memory-loader/register-hooks.js.map +1 -1
- package/src/utils/test-files.js +5 -57
- package/src/utils/test-files.js.map +1 -1
- package/src/utils/watcher.d.ts +53 -0
- package/src/utils/watcher.js +404 -76
- package/src/utils/watcher.js.map +1 -1
- package/src/builders/library/pipeline/types.d.ts +0 -54
|
@@ -10,161 +10,112 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
11
|
};
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.createSingleBuildState = createSingleBuildState;
|
|
14
13
|
exports.buildAction = buildAction;
|
|
15
|
-
exports.hasModifiedWatchedFile = hasModifiedWatchedFile;
|
|
16
|
-
const promises_1 = require("node:fs/promises");
|
|
17
14
|
const node_path_1 = __importDefault(require("node:path"));
|
|
18
|
-
const
|
|
19
|
-
const
|
|
15
|
+
const disk_files_1 = require("../../../utils/disk-files");
|
|
16
|
+
const error_1 = require("../../../utils/error");
|
|
20
17
|
const assets_1 = require("./assets");
|
|
21
18
|
const bundler_1 = require("./bundler");
|
|
22
19
|
const compilation_1 = require("./compilation");
|
|
20
|
+
const entry_points_1 = require("./entry-points");
|
|
23
21
|
const package_manifests_1 = require("./package-manifests");
|
|
24
|
-
/**
|
|
25
|
-
* Creates a fresh {@link SingleBuildState} instance.
|
|
26
|
-
*/
|
|
27
|
-
function createSingleBuildState() {
|
|
28
|
-
return {
|
|
29
|
-
previousBundleResults: new Map(),
|
|
30
|
-
pendingChangedEsmFiles: new Set(),
|
|
31
|
-
pendingChangedDtsFiles: new Set(),
|
|
32
|
-
directoryExists: new Set(),
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
22
|
/**
|
|
36
23
|
* Executes a single iteration of the library build pipeline, including
|
|
37
24
|
* single-program Angular compilation, parallel typechecking, 2-instance Rolldown bundling,
|
|
38
25
|
* manifest generation, and asset copying.
|
|
39
26
|
*
|
|
40
27
|
* @param actionContext The build action state and configuration.
|
|
28
|
+
* @returns A promise resolving to the build iteration's `ExecutionResult`.
|
|
41
29
|
*/
|
|
42
30
|
async function buildAction(actionContext) {
|
|
43
|
-
const { options,
|
|
44
|
-
const
|
|
45
|
-
const {
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
!buildState.singleProgramCache ||
|
|
51
|
-
buildState.hasCompilationError ||
|
|
52
|
-
buildState.hasEntryPointsChanges ||
|
|
53
|
-
pendingChangedEsmFiles.size > 0 ||
|
|
54
|
-
pendingChangedDtsFiles.size > 0 ||
|
|
55
|
-
hasModifiedWatchedFile(modifiedFiles, watchedCompilationFiles, posixPackageJsonPath);
|
|
56
|
-
const shouldGenerateManifests = !buildState.hasEmittedManifests;
|
|
57
|
-
if (shouldGenerateManifests) {
|
|
58
|
-
verifyAllowedDependencies(options);
|
|
59
|
-
}
|
|
60
|
-
const filesToEmit = [];
|
|
61
|
-
if (shouldCompileEntryPoints) {
|
|
62
|
-
buildState.hasCompilationError = true;
|
|
63
|
-
buildState.hasEntryPointsChanges = false;
|
|
64
|
-
const { esmFiles, dtsFiles, changedEsmFiles, changedDtsFiles, referencedFiles, cache, diagnosePromise, } = await (0, compilation_1.compileLibrary)(options.entryPoints.values(), options, stylesheetBundler, buildState.singleProgramCache, modifiedFiles);
|
|
65
|
-
buildState.singleProgramCache = cache;
|
|
66
|
-
for (const file of referencedFiles) {
|
|
67
|
-
watchedCompilationFiles.add(file);
|
|
68
|
-
}
|
|
69
|
-
for (const file of changedEsmFiles) {
|
|
70
|
-
pendingChangedEsmFiles.add(file);
|
|
31
|
+
const { options, stylesheetBundler, isWatchMode, buildState, modifiedFiles } = actionContext;
|
|
32
|
+
const result = buildState.resetExecutionResult();
|
|
33
|
+
const { packageJsonPath } = options;
|
|
34
|
+
const shouldCompileEntryPoints = buildState.shouldCompileEntryPoints(packageJsonPath, modifiedFiles);
|
|
35
|
+
try {
|
|
36
|
+
if (!buildState.hasEmittedManifests && !verifyAllowedDependencies(options, result)) {
|
|
37
|
+
return result;
|
|
71
38
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
const
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
hasEntryPointChanges(previousBundleResult.dtsModuleIds, pendingChangedDtsFiles);
|
|
82
|
-
if (hasEsmChanges || hasDtsChanges) {
|
|
83
|
-
context.logger.info(`Compiling ${entryPoint.displayName}...`);
|
|
84
|
-
itemsToBundle.push({
|
|
85
|
-
entryPoint,
|
|
86
|
-
hasEsmChanges,
|
|
87
|
-
hasDtsChanges,
|
|
88
|
-
previousBundleResult,
|
|
89
|
-
});
|
|
39
|
+
const filesToEmit = [];
|
|
40
|
+
if (shouldCompileEntryPoints) {
|
|
41
|
+
buildState.hasCompilationError = true;
|
|
42
|
+
const compilationOutput = await (0, compilation_1.compileLibrary)(options, stylesheetBundler, buildState, buildState.getCompilationModifiedFiles(modifiedFiles));
|
|
43
|
+
buildState.recordCompilationOutput(compilationOutput);
|
|
44
|
+
const { esmFiles, dtsFiles, hasStylesheetErrors, diagnosePromise, declarationMap, compilationMode, } = compilationOutput;
|
|
45
|
+
if (hasStylesheetErrors) {
|
|
46
|
+
await diagnosePromise;
|
|
47
|
+
return result;
|
|
90
48
|
}
|
|
49
|
+
const itemsToBundle = (0, entry_points_1.collectEntryPointsToBundle)(options, buildState);
|
|
50
|
+
let bundleOutput;
|
|
51
|
+
try {
|
|
52
|
+
[bundleOutput] = await Promise.all([
|
|
53
|
+
(0, bundler_1.bundleEntryPoints)(itemsToBundle, esmFiles, dtsFiles, {
|
|
54
|
+
...options,
|
|
55
|
+
declarationMap,
|
|
56
|
+
compilationMode,
|
|
57
|
+
}),
|
|
58
|
+
diagnosePromise,
|
|
59
|
+
]);
|
|
60
|
+
}
|
|
61
|
+
catch (error) {
|
|
62
|
+
(0, error_1.assertIsError)(error);
|
|
63
|
+
// Prioritize TypeScript/Angular diagnostic errors over secondary bundler failures.
|
|
64
|
+
await diagnosePromise;
|
|
65
|
+
if (!result.hasErrors) {
|
|
66
|
+
result.addError(error.message);
|
|
67
|
+
}
|
|
68
|
+
return result;
|
|
69
|
+
}
|
|
70
|
+
result.addWarnings(bundleOutput.warnings);
|
|
71
|
+
if (result.hasErrors) {
|
|
72
|
+
return result;
|
|
73
|
+
}
|
|
74
|
+
filesToEmit.push(...bundleOutput.filesToEmit);
|
|
75
|
+
buildState.recordBundleOutput(bundleOutput.bundleResults);
|
|
91
76
|
}
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
]);
|
|
99
|
-
}
|
|
100
|
-
catch (error) {
|
|
101
|
-
// Prioritize TypeScript/Angular diagnostic errors over secondary bundler failures.
|
|
102
|
-
await diagnosePromise;
|
|
103
|
-
throw error;
|
|
104
|
-
}
|
|
105
|
-
buildState.hasCompilationError = false;
|
|
106
|
-
pendingChangedEsmFiles.clear();
|
|
107
|
-
pendingChangedDtsFiles.clear();
|
|
108
|
-
for (const warning of [...warnings, ...bundleOutput.warnings]) {
|
|
109
|
-
context.logger.warn(warning);
|
|
110
|
-
}
|
|
111
|
-
filesToEmit.push(...bundleOutput.filesToEmit);
|
|
112
|
-
for (const [name, bundleResult] of bundleOutput.bundleResults) {
|
|
113
|
-
buildState.previousBundleResults.set(name, bundleResult);
|
|
114
|
-
}
|
|
115
|
-
}
|
|
116
|
-
if (shouldGenerateManifests) {
|
|
117
|
-
filesToEmit.push(...(0, package_manifests_1.generatePackageManifests)(options, isWatchMode));
|
|
118
|
-
}
|
|
119
|
-
const resolvedAssetsToEmit = (actionContext.assetsToEmit ??= await (0, assets_1.collectAssetsToEmit)(options.assets, options.workspaceRoot, buildState.hasEmittedAssets ? modifiedFiles : undefined));
|
|
120
|
-
filesToEmit.push(...resolvedAssetsToEmit);
|
|
121
|
-
await (0, utils_1.emitFilesToDisk)(filesToEmit, async (file) => {
|
|
122
|
-
const fullFilePath = node_path_1.default.join(options.outputPath, file.path);
|
|
123
|
-
const fileBasePath = node_path_1.default.dirname(fullFilePath);
|
|
124
|
-
if (fileBasePath && !directoryExists.has(fileBasePath)) {
|
|
125
|
-
await (0, promises_1.mkdir)(fileBasePath, { recursive: true });
|
|
126
|
-
directoryExists.add(fileBasePath);
|
|
127
|
-
}
|
|
128
|
-
if (file.type === 'memory') {
|
|
129
|
-
await (0, promises_1.writeFile)(fullFilePath, file.contents);
|
|
130
|
-
}
|
|
131
|
-
else {
|
|
132
|
-
await (0, promises_1.copyFile)(file.source, fullFilePath, promises_1.constants.COPYFILE_FICLONE);
|
|
133
|
-
}
|
|
134
|
-
});
|
|
135
|
-
buildState.hasEmittedManifests = true;
|
|
136
|
-
buildState.hasEmittedAssets = true;
|
|
137
|
-
}
|
|
138
|
-
function hasModifiedWatchedFile(modifiedFiles, watchedCompilationFiles, posixPackageJsonPath) {
|
|
139
|
-
for (const file of modifiedFiles) {
|
|
140
|
-
if (file !== posixPackageJsonPath && watchedCompilationFiles.has(file)) {
|
|
141
|
-
return true;
|
|
77
|
+
const { hasTslibImport } = buildState;
|
|
78
|
+
if (!buildState.hasEmittedManifests || buildState.hasEmittedTslib !== hasTslibImport) {
|
|
79
|
+
filesToEmit.push(...(await (0, package_manifests_1.generatePackageManifests)({
|
|
80
|
+
...options,
|
|
81
|
+
compilationMode: buildState.compilationMode ?? options.compilationMode ?? 'partial',
|
|
82
|
+
}, isWatchMode, hasTslibImport)));
|
|
142
83
|
}
|
|
84
|
+
const resolvedAssetsToEmit = (actionContext.assetsToEmit ??= await (0, assets_1.collectAssetsToEmit)(options.assets, options.workspaceRoot, buildState.hasEmittedAssets ? modifiedFiles : undefined));
|
|
85
|
+
filesToEmit.push(...resolvedAssetsToEmit);
|
|
86
|
+
await (0, disk_files_1.emitFilesToDisk)(filesToEmit, (file) => node_path_1.default.posix.join(options.outputPath, file.path));
|
|
87
|
+
buildState.hasEmittedManifests = true;
|
|
88
|
+
buildState.hasEmittedTslib = hasTslibImport;
|
|
89
|
+
buildState.hasEmittedAssets = true;
|
|
143
90
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
if (changedFiles.size === 0) {
|
|
148
|
-
return false;
|
|
149
|
-
}
|
|
150
|
-
for (const file of changedFiles) {
|
|
151
|
-
if (moduleIds.has(file)) {
|
|
152
|
-
return true;
|
|
153
|
-
}
|
|
91
|
+
catch (error) {
|
|
92
|
+
(0, error_1.assertIsError)(error);
|
|
93
|
+
result.addError(error.message);
|
|
154
94
|
}
|
|
155
|
-
return
|
|
95
|
+
return result;
|
|
156
96
|
}
|
|
157
|
-
|
|
97
|
+
/**
|
|
98
|
+
* Validates that all direct and optional dependencies in `package.json` are
|
|
99
|
+
* permitted by `allowedNonPeerDependencies`.
|
|
100
|
+
*
|
|
101
|
+
* @param options The normalized library builder options.
|
|
102
|
+
* @param result The execution result to record any disallowed dependency errors into.
|
|
103
|
+
* @returns `true` if all dependencies are allowed; otherwise `false`.
|
|
104
|
+
*/
|
|
105
|
+
function verifyAllowedDependencies(options, result) {
|
|
158
106
|
const { packageJson, allowedNonPeerDependencies } = options;
|
|
159
107
|
const dependencies = {
|
|
160
108
|
...(packageJson.dependencies ?? {}),
|
|
161
109
|
...(packageJson.optionalDependencies ?? {}),
|
|
162
110
|
};
|
|
111
|
+
let isValid = true;
|
|
163
112
|
for (const dep of Object.keys(dependencies)) {
|
|
164
113
|
if (!allowedNonPeerDependencies.some((regex) => regex.test(dep))) {
|
|
165
|
-
|
|
114
|
+
result.addError(`Dependency '${dep}' must be explicitly allowed using the 'allowedNonPeerDependencies' option, ` +
|
|
166
115
|
`or moved to 'peerDependencies' in 'package.json'.`);
|
|
116
|
+
isValid = false;
|
|
167
117
|
}
|
|
168
118
|
}
|
|
119
|
+
return isValid;
|
|
169
120
|
}
|
|
170
121
|
//# sourceMappingURL=build-action.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"build-action.js","sourceRoot":"","sources":["build-action.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;
|
|
1
|
+
{"version":3,"file":"build-action.js","sourceRoot":"","sources":["build-action.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;AAoDH,kCA2GC;AA7JD,0DAA6B;AAE7B,0DAA4D;AAC5D,gDAAqD;AAIrD,qCAA+C;AAC/C,uCAA4E;AAC5E,+CAA+C;AAC/C,iDAA4D;AAC5D,2DAA+D;AA+B/D;;;;;;;GAOG;AACI,KAAK,UAAU,WAAW,CAAC,aAAiC;IACjE,MAAM,EAAE,OAAO,EAAE,iBAAiB,EAAE,WAAW,EAAE,UAAU,EAAE,aAAa,EAAE,GAAG,aAAa,CAAC;IAC7F,MAAM,MAAM,GAAG,UAAU,CAAC,oBAAoB,EAAE,CAAC;IAEjD,MAAM,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC;IAEpC,MAAM,wBAAwB,GAAG,UAAU,CAAC,wBAAwB,CAClE,eAAe,EACf,aAAa,CACd,CAAC;IAEF,IAAI,CAAC;QACH,IAAI,CAAC,UAAU,CAAC,mBAAmB,IAAI,CAAC,yBAAyB,CAAC,OAAO,EAAE,MAAM,CAAC,EAAE,CAAC;YACnF,OAAO,MAAM,CAAC;QAChB,CAAC;QAED,MAAM,WAAW,GAAiB,EAAE,CAAC;QAErC,IAAI,wBAAwB,EAAE,CAAC;YAC7B,UAAU,CAAC,mBAAmB,GAAG,IAAI,CAAC;YAEtC,MAAM,iBAAiB,GAAG,MAAM,IAAA,4BAAc,EAC5C,OAAO,EACP,iBAAiB,EACjB,UAAU,EACV,UAAU,CAAC,2BAA2B,CAAC,aAAa,CAAC,CACtD,CAAC;YACF,UAAU,CAAC,uBAAuB,CAAC,iBAAiB,CAAC,CAAC;YAEtD,MAAM,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IAAI,EAAE,CAAC;KAC5C,CAAC;IAEF,IAAI,OAAO,GAAG,IAAI,CAAC;IACnB,KAAK,MAAM,GAAG,IAAI,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QAC5C,IAAI,CAAC,0BAA0B,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC;YACjE,MAAM,CAAC,QAAQ,CACb,eAAe,GAAG,8EAA8E;gBAC9F,mDAAmD,CACtD,CAAC;YACF,OAAO,GAAG,KAAK,CAAC;QAClB,CAAC;IACH,CAAC;IAED,OAAO,OAAO,CAAC;AACjB,CAAC"}
|
|
@@ -36,9 +36,9 @@ export interface BundleEntryPointInput {
|
|
|
36
36
|
* using at most 2 Rolldown instances total (1 for all .mjs bundles, 1 for all .d.ts bundles).
|
|
37
37
|
*
|
|
38
38
|
* @param items The collection of entry point inputs with change statuses.
|
|
39
|
-
* @param esmFiles Map of virtual ESM output file paths to their content.
|
|
40
|
-
* @param dtsFiles Map of virtual TypeScript declaration file paths to their content.
|
|
41
|
-
* @param options The normalized library builder options.
|
|
39
|
+
* @param esmFiles Map of virtual POSIX ESM output file paths to their content.
|
|
40
|
+
* @param dtsFiles Map of virtual POSIX TypeScript declaration file paths to their content.
|
|
41
|
+
* @param options The normalized library builder options with POSIX paths.
|
|
42
42
|
* @returns A promise resolving to the bundled output files and bundle cache results.
|
|
43
43
|
*/
|
|
44
44
|
export declare function bundleEntryPoints(items: readonly BundleEntryPointInput[], esmFiles: ReadonlyMap<string, string>, dtsFiles: ReadonlyMap<string, string>, options: NormalizedLibraryOptions): Promise<BundleEntryPointsOutput>;
|
|
@@ -56,9 +56,9 @@ const DTS_EXTENSIONS = ['.d.ts', '.d.mts', '/index.d.ts', '/index.d.mts'];
|
|
|
56
56
|
* using at most 2 Rolldown instances total (1 for all .mjs bundles, 1 for all .d.ts bundles).
|
|
57
57
|
*
|
|
58
58
|
* @param items The collection of entry point inputs with change statuses.
|
|
59
|
-
* @param esmFiles Map of virtual ESM output file paths to their content.
|
|
60
|
-
* @param dtsFiles Map of virtual TypeScript declaration file paths to their content.
|
|
61
|
-
* @param options The normalized library builder options.
|
|
59
|
+
* @param esmFiles Map of virtual POSIX ESM output file paths to their content.
|
|
60
|
+
* @param dtsFiles Map of virtual POSIX TypeScript declaration file paths to their content.
|
|
61
|
+
* @param options The normalized library builder options with POSIX paths.
|
|
62
62
|
* @returns A promise resolving to the bundled output files and bundle cache results.
|
|
63
63
|
*/
|
|
64
64
|
async function bundleEntryPoints(items, esmFiles, dtsFiles, options) {
|
|
@@ -82,13 +82,15 @@ async function bundleEntryPoints(items, esmFiles, dtsFiles, options) {
|
|
|
82
82
|
]);
|
|
83
83
|
for (const { entryPoint, previousBundleResult } of items) {
|
|
84
84
|
const { bundleName, name } = entryPoint;
|
|
85
|
+
const esmModuleIds = esmOutput.moduleIdsByBundle.get(bundleName);
|
|
85
86
|
bundleResults.set(name, {
|
|
86
|
-
esmModuleIds:
|
|
87
|
-
previousBundleResult?.esmModuleIds ??
|
|
88
|
-
new Set(),
|
|
87
|
+
esmModuleIds: esmModuleIds ?? previousBundleResult?.esmModuleIds ?? new Set(),
|
|
89
88
|
dtsModuleIds: dtsOutput.moduleIdsByBundle.get(bundleName) ??
|
|
90
89
|
previousBundleResult?.dtsModuleIds ??
|
|
91
90
|
new Set(),
|
|
91
|
+
hasTslibImport: esmModuleIds
|
|
92
|
+
? esmOutput.tslibBundles.has(bundleName)
|
|
93
|
+
: (previousBundleResult?.hasTslibImport ?? false),
|
|
92
94
|
});
|
|
93
95
|
}
|
|
94
96
|
return {
|
|
@@ -102,23 +104,21 @@ async function bundleEntryPoints(items, esmFiles, dtsFiles, options) {
|
|
|
102
104
|
*
|
|
103
105
|
* @param entryPoints The entry points to include in the bundle input map.
|
|
104
106
|
* @param dtsMode Whether the input map is for declaration files (.d.ts) rather than ESM files (.js).
|
|
105
|
-
* @returns A record mapping bundle names to virtual entry file paths.
|
|
107
|
+
* @returns A record mapping bundle names to virtual POSIX entry file paths.
|
|
106
108
|
*/
|
|
107
109
|
function resolveEntryInputMap(entryPoints, dtsMode) {
|
|
108
110
|
const input = {};
|
|
109
111
|
for (const { bundleName, entryFilePath } of entryPoints) {
|
|
110
|
-
const posixPath = (0, path_1.toPosixPath)(entryFilePath);
|
|
111
112
|
input[bundleName] = dtsMode
|
|
112
|
-
?
|
|
113
|
-
:
|
|
113
|
+
? entryFilePath.replace(/\.([cm]?ts)$/, '.d.$1')
|
|
114
|
+
: entryFilePath.replace(/\.([cm]?)ts$/, '.$1js');
|
|
114
115
|
}
|
|
115
116
|
return input;
|
|
116
117
|
}
|
|
117
118
|
/**
|
|
118
|
-
* Creates a Rolldown plugin that loads modules from an in-memory file map
|
|
119
|
-
* and prevents illegal cross-entry-point sibling imports.
|
|
119
|
+
* Creates a Rolldown plugin that resolves and loads modules from an in-memory file map.
|
|
120
120
|
*
|
|
121
|
-
* @param files Map of virtual file paths to their content.
|
|
121
|
+
* @param files Map of virtual POSIX file paths to their content.
|
|
122
122
|
* @param extensions Candidate extensions to probe when resolving extensionless module specifiers.
|
|
123
123
|
* @param includeMap Whether source map files should also be loaded from the memory map.
|
|
124
124
|
* @returns A Rolldown plugin instance.
|
|
@@ -138,11 +138,7 @@ function createMemoryFileLoaderPlugin(files, extensions, includeMap) {
|
|
|
138
138
|
if (id[0] !== '.' && !node_path_1.default.isAbsolute(id)) {
|
|
139
139
|
return { id, external: true };
|
|
140
140
|
}
|
|
141
|
-
const
|
|
142
|
-
const importerPosix = (0, path_1.toPosixPath)(importer);
|
|
143
|
-
const resolved = posixId[0] === '.'
|
|
144
|
-
? node_path_1.default.posix.join(node_path_1.default.posix.dirname(importerPosix), posixId)
|
|
145
|
-
: posixId;
|
|
141
|
+
const resolved = id[0] === '.' ? node_path_1.default.posix.join(node_path_1.default.posix.dirname(importer), id) : id;
|
|
146
142
|
let resolvedCandidate;
|
|
147
143
|
if (files.has(resolved)) {
|
|
148
144
|
resolvedCandidate = resolved;
|
|
@@ -180,12 +176,13 @@ function createMemoryFileLoaderPlugin(files, extensions, includeMap) {
|
|
|
180
176
|
* the transitive set of module IDs belonging to each entry point bundle.
|
|
181
177
|
*
|
|
182
178
|
* @param output The array of output chunks and assets from Rolldown.
|
|
183
|
-
* @param dir The destination output directory prefix.
|
|
179
|
+
* @param dir The destination POSIX output directory prefix.
|
|
184
180
|
* @returns The processed multi-bundle output.
|
|
185
181
|
*/
|
|
186
182
|
function processRolldownOutput(output, dir) {
|
|
187
183
|
const filesToEmit = [];
|
|
188
184
|
const moduleIdsByBundle = new Map();
|
|
185
|
+
const tslibBundles = new Set();
|
|
189
186
|
const chunksByFileName = new Map();
|
|
190
187
|
const entryChunks = [];
|
|
191
188
|
for (const item of output) {
|
|
@@ -217,6 +214,9 @@ function processRolldownOutput(output, dir) {
|
|
|
217
214
|
}
|
|
218
215
|
}
|
|
219
216
|
for (const depFile of [...chunk.imports, ...chunk.dynamicImports]) {
|
|
217
|
+
if (depFile === 'tslib') {
|
|
218
|
+
tslibBundles.add(entryChunk.name);
|
|
219
|
+
}
|
|
220
220
|
const depChunk = chunksByFileName.get(depFile);
|
|
221
221
|
if (depChunk && !visited.has(depChunk)) {
|
|
222
222
|
queue.push(depChunk);
|
|
@@ -224,15 +224,23 @@ function processRolldownOutput(output, dir) {
|
|
|
224
224
|
}
|
|
225
225
|
}
|
|
226
226
|
}
|
|
227
|
-
return { filesToEmit, moduleIdsByBundle };
|
|
227
|
+
return { filesToEmit, moduleIdsByBundle, tslibBundles };
|
|
228
228
|
}
|
|
229
|
+
/**
|
|
230
|
+
* Set of Rolldown warning codes that should be ignored.
|
|
231
|
+
*/
|
|
232
|
+
const IGNORED_ROLLDOWN_WARNING_CODES = new Set([
|
|
233
|
+
'EMPTY_BUNDLE',
|
|
234
|
+
'UNUSED_EXTERNAL_IMPORT',
|
|
235
|
+
'THIS_IS_UNDEFINED',
|
|
236
|
+
]);
|
|
229
237
|
/**
|
|
230
238
|
* Executes a Rolldown bundle build across all provided entry inputs.
|
|
231
239
|
*
|
|
232
|
-
* @param input Map of bundle names to virtual entry file paths.
|
|
240
|
+
* @param input Map of bundle names to virtual POSIX entry file paths.
|
|
233
241
|
* @param plugins Rolldown plugins to use during bundling.
|
|
234
242
|
* @param extension Output file extension ('mjs' or 'd.ts').
|
|
235
|
-
* @param options The normalized library options.
|
|
243
|
+
* @param options The normalized library options with POSIX paths.
|
|
236
244
|
* @returns A promise resolving to the multi-bundle output.
|
|
237
245
|
*/
|
|
238
246
|
async function executeMultiBundle(input, plugins, extension, options) {
|
|
@@ -242,7 +250,7 @@ async function executeMultiBundle(input, plugins, extension, options) {
|
|
|
242
250
|
let dir;
|
|
243
251
|
if (isDts) {
|
|
244
252
|
dir = utils_1.TYPES_OUTPUT_DIR;
|
|
245
|
-
sourcemap = declarationMap;
|
|
253
|
+
sourcemap = !!declarationMap;
|
|
246
254
|
}
|
|
247
255
|
else {
|
|
248
256
|
dir = utils_1.FESM_OUTPUT_DIR;
|
|
@@ -260,7 +268,11 @@ async function executeMultiBundle(input, plugins, extension, options) {
|
|
|
260
268
|
resolve: { symlinks: !preserveSymlinks },
|
|
261
269
|
checks: { circularDependency: false },
|
|
262
270
|
onLog(level, log) {
|
|
271
|
+
// Ignore specified warning codes
|
|
263
272
|
if (level === 'warn') {
|
|
273
|
+
if (log.code && IGNORED_ROLLDOWN_WARNING_CODES.has(log.code)) {
|
|
274
|
+
return;
|
|
275
|
+
}
|
|
264
276
|
warnings.push(log.message);
|
|
265
277
|
}
|
|
266
278
|
},
|
|
@@ -271,12 +283,12 @@ async function executeMultiBundle(input, plugins, extension, options) {
|
|
|
271
283
|
try {
|
|
272
284
|
const { output } = await bundle.generate({
|
|
273
285
|
format: 'es',
|
|
274
|
-
dir: node_path_1.default.join(outputPath, dir),
|
|
286
|
+
dir: node_path_1.default.posix.join(outputPath, dir),
|
|
275
287
|
entryFileNames: `[name].${extension}`,
|
|
276
288
|
chunkFileNames: `[name]-[hash].${extension}`,
|
|
277
289
|
sourcemap,
|
|
278
290
|
hoistTransitiveImports: false,
|
|
279
|
-
comments: { jsdoc: isDts, legal: true, annotation:
|
|
291
|
+
comments: { jsdoc: isDts, legal: true, annotation: !isDts },
|
|
280
292
|
});
|
|
281
293
|
return {
|
|
282
294
|
...processRolldownOutput(output, dir),
|
|
@@ -291,13 +303,18 @@ async function executeMultiBundle(input, plugins, extension, options) {
|
|
|
291
303
|
* Bundles JavaScript ESM output files for all provided entry points.
|
|
292
304
|
*
|
|
293
305
|
* @param entryPoints The entry points to bundle.
|
|
294
|
-
* @param esmFiles Map of virtual ESM output file paths to contents.
|
|
295
|
-
* @param options The normalized library options.
|
|
306
|
+
* @param esmFiles Map of virtual POSIX ESM output file paths to contents.
|
|
307
|
+
* @param options The normalized library options with POSIX paths.
|
|
296
308
|
* @returns A promise resolving to the multi-bundle output.
|
|
297
309
|
*/
|
|
298
310
|
async function bundleAllEsm(entryPoints, esmFiles, options) {
|
|
299
311
|
if (entryPoints.length === 0) {
|
|
300
|
-
return {
|
|
312
|
+
return {
|
|
313
|
+
filesToEmit: [],
|
|
314
|
+
moduleIdsByBundle: new Map(),
|
|
315
|
+
tslibBundles: new Set(),
|
|
316
|
+
warnings: [],
|
|
317
|
+
};
|
|
301
318
|
}
|
|
302
319
|
return executeMultiBundle(resolveEntryInputMap(entryPoints, false), [createMemoryFileLoaderPlugin(esmFiles, ESM_EXTENSIONS, true)], 'mjs', options);
|
|
303
320
|
}
|
|
@@ -305,19 +322,24 @@ async function bundleAllEsm(entryPoints, esmFiles, options) {
|
|
|
305
322
|
* Bundles TypeScript declaration (.d.ts) output files for all provided entry points.
|
|
306
323
|
*
|
|
307
324
|
* @param entryPoints The entry points to bundle.
|
|
308
|
-
* @param dtsFiles Map of virtual declaration output file paths to contents.
|
|
309
|
-
* @param options The normalized library options.
|
|
325
|
+
* @param dtsFiles Map of virtual POSIX declaration output file paths to contents.
|
|
326
|
+
* @param options The normalized library options with POSIX paths.
|
|
310
327
|
* @returns A promise resolving to the multi-bundle output.
|
|
311
328
|
*/
|
|
312
329
|
async function bundleAllDts(entryPoints, dtsFiles, options) {
|
|
313
330
|
if (entryPoints.length === 0) {
|
|
314
|
-
return {
|
|
331
|
+
return {
|
|
332
|
+
filesToEmit: [],
|
|
333
|
+
moduleIdsByBundle: new Map(),
|
|
334
|
+
tslibBundles: new Set(),
|
|
335
|
+
warnings: [],
|
|
336
|
+
};
|
|
315
337
|
}
|
|
316
338
|
// Ensure Rolldown's native binding is initialized via `loadRolldown()` before evaluating
|
|
317
339
|
// `rolldown-plugin-dts`, which has top-level imports of `rolldown/experimental`.
|
|
318
340
|
await (0, load_rolldown_1.loadRolldown)();
|
|
319
|
-
const { dts } = await Promise.resolve().then(
|
|
320
|
-
const dtsSourcemap = options.declarationMap;
|
|
341
|
+
const { dts } = (await Promise.resolve(`${'rolldown-plugin-dts'}`).then(s => __importStar(require(s))));
|
|
342
|
+
const dtsSourcemap = !!options.declarationMap;
|
|
321
343
|
// Filter out `rolldown-plugin-dts:resolver` because all `.d.ts` files are already emitted
|
|
322
344
|
// in-memory by the Angular/TypeScript compilation and resolved via `createMemoryFileLoaderPlugin`.
|
|
323
345
|
// The default `rolldown-plugin-dts:resolver` plugin performs filesystem resolution (`oxc-resolver`)
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bundler.js","sourceRoot":"","sources":["bundler.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"bundler.js","sourceRoot":"","sources":["bundler.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA4EH,8CAgDC;AA1HD,8DAAiC;AACjC,0DAA6B;AAE7B,gEAA4D;AAC5D,8CAAkD;AAElD,mCAKiB;AAiCjB,MAAM,cAAc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,QAAQ,EAAE,cAAc,EAAE,YAAY,CAAC,EAAE,GAAG,UAAU,CAAC,EACrF,MAAM,EACN,OAAO,CACR,CAAC;AACJ,CAAC"}
|
|
@@ -6,34 +6,15 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { ComponentStylesheetBundler } from '../../../tools/esbuild/angular/component-stylesheets';
|
|
9
|
-
import type {
|
|
10
|
-
|
|
11
|
-
* Output of the unified library compilation step.
|
|
12
|
-
*/
|
|
13
|
-
export interface LibraryCompilationOutput {
|
|
14
|
-
/** Read-only map of emitted JavaScript files. */
|
|
15
|
-
readonly esmFiles: ReadonlyMap<string, string>;
|
|
16
|
-
/** Read-only map of emitted TypeScript declaration files. */
|
|
17
|
-
readonly dtsFiles: ReadonlyMap<string, string>;
|
|
18
|
-
/** Set of JavaScript file paths that were modified or newly emitted in this iteration. */
|
|
19
|
-
readonly changedEsmFiles: ReadonlySet<string>;
|
|
20
|
-
/** Set of declaration file paths that were modified or newly emitted in this iteration. */
|
|
21
|
-
readonly changedDtsFiles: ReadonlySet<string>;
|
|
22
|
-
/** Set of all source and dependency file paths referenced during compilation. */
|
|
23
|
-
readonly referencedFiles: ReadonlySet<string>;
|
|
24
|
-
/** Cached compilation state for subsequent incremental builds. */
|
|
25
|
-
readonly cache: SingleProgramCache;
|
|
26
|
-
/** Promise that resolves to formatted compilation warnings or rejects on diagnostic errors. */
|
|
27
|
-
readonly diagnosePromise: Promise<string[]>;
|
|
28
|
-
}
|
|
9
|
+
import type { BuilderState } from '../builder-state';
|
|
10
|
+
import type { LibraryCompilationOutput, NormalizedLibraryOptions } from '../types';
|
|
29
11
|
/**
|
|
30
12
|
* Compiles all library entry points in a single TypeScript and Angular compilation pass.
|
|
31
13
|
*
|
|
32
|
-
* @param
|
|
33
|
-
* @param options The normalized library builder options.
|
|
14
|
+
* @param options The normalized library builder options with POSIX paths.
|
|
34
15
|
* @param stylesheetBundler The component stylesheet bundler instance.
|
|
35
|
-
* @param
|
|
36
|
-
* @param modifiedFiles Optional set of modified file paths for incremental compilation.
|
|
37
|
-
* @returns A promise resolving to the compilation output containing emitted files and
|
|
16
|
+
* @param buildState The build state tracking compilation caches, file references, and diagnostics.
|
|
17
|
+
* @param modifiedFiles Optional set of modified POSIX file paths for incremental compilation.
|
|
18
|
+
* @returns A promise resolving to the compilation output containing emitted files and cache state.
|
|
38
19
|
*/
|
|
39
|
-
export declare function compileLibrary(
|
|
20
|
+
export declare function compileLibrary(options: NormalizedLibraryOptions, stylesheetBundler: ComponentStylesheetBundler, buildState: BuilderState, modifiedFiles?: Set<string>): Promise<LibraryCompilationOutput>;
|