@angular/build 22.2.1 → 22.3.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/builders.json +5 -0
- package/package.json +19 -18
- package/src/builders/library/builder.d.ts +19 -0
- package/src/builders/library/builder.js +279 -0
- package/src/builders/library/builder.js.map +1 -0
- package/src/builders/library/index.d.ts +13 -0
- package/src/builders/library/index.js +17 -0
- package/src/builders/library/index.js.map +1 -0
- package/src/builders/library/options.d.ts +11 -0
- package/src/builders/library/options.js +116 -0
- package/src/builders/library/options.js.map +1 -0
- package/src/builders/library/pipeline/assets.d.ts +29 -0
- package/src/builders/library/pipeline/assets.js +106 -0
- package/src/builders/library/pipeline/assets.js.map +1 -0
- package/src/builders/library/pipeline/build-action.d.ts +35 -0
- package/src/builders/library/pipeline/build-action.js +169 -0
- package/src/builders/library/pipeline/build-action.js.map +1 -0
- package/src/builders/library/pipeline/bundler.d.ts +42 -0
- package/src/builders/library/pipeline/bundler.js +278 -0
- package/src/builders/library/pipeline/bundler.js.map +1 -0
- package/src/builders/library/pipeline/compilation.d.ts +39 -0
- package/src/builders/library/pipeline/compilation.js +197 -0
- package/src/builders/library/pipeline/compilation.js.map +1 -0
- package/src/builders/library/pipeline/entry-points.d.ts +34 -0
- package/src/builders/library/pipeline/entry-points.js +194 -0
- package/src/builders/library/pipeline/entry-points.js.map +1 -0
- package/src/builders/library/pipeline/package-manifests.d.ts +17 -0
- package/src/builders/library/pipeline/package-manifests.js +119 -0
- package/src/builders/library/pipeline/package-manifests.js.map +1 -0
- package/src/builders/library/pipeline/stylesheet-bundler.d.ts +19 -0
- package/src/builders/library/pipeline/stylesheet-bundler.js +39 -0
- package/src/builders/library/pipeline/stylesheet-bundler.js.map +1 -0
- package/src/builders/library/pipeline/types.d.ts +54 -0
- package/src/builders/library/pipeline/utils.d.ts +69 -0
- package/src/builders/library/pipeline/utils.js +73 -0
- package/src/builders/library/pipeline/utils.js.map +1 -0
- package/src/builders/library/schema.d.ts +149 -0
- package/src/builders/library/schema.js +26 -0
- package/src/builders/library/schema.js.map +1 -0
- package/src/builders/library/schema.json +168 -0
- package/src/builders/library/types.d.ts +125 -0
- package/src/builders/library/types.js +10 -0
- package/src/builders/library/types.js.map +1 -0
- package/src/builders/unit-test/builder.js +24 -2
- package/src/builders/unit-test/builder.js.map +1 -1
- package/src/builders/unit-test/options.d.ts +1 -0
- package/src/builders/unit-test/options.js +2 -1
- package/src/builders/unit-test/options.js.map +1 -1
- package/src/builders/unit-test/runners/api.d.ts +1 -1
- package/src/builders/unit-test/runners/karma/executor.js +1 -1
- package/src/builders/unit-test/runners/karma/executor.js.map +1 -1
- package/src/builders/unit-test/runners/vitest/build-options.d.ts +8 -2
- package/src/builders/unit-test/runners/vitest/build-options.js +21 -45
- package/src/builders/unit-test/runners/vitest/build-options.js.map +1 -1
- package/src/builders/unit-test/runners/vitest/index.js +2 -2
- package/src/builders/unit-test/runners/vitest/index.js.map +1 -1
- package/src/builders/unit-test/schema.d.ts +6 -0
- package/src/builders/unit-test/schema.js.map +1 -1
- package/src/builders/unit-test/schema.json +8 -0
- package/src/tools/angular/compilation/angular-compilation.d.ts +2 -1
- package/src/tools/angular/compilation/angular-compilation.js.map +1 -1
- package/src/tools/angular/compilation/aot-compilation.d.ts +1 -1
- package/src/tools/angular/compilation/aot-compilation.js +20 -11
- package/src/tools/angular/compilation/aot-compilation.js.map +1 -1
- package/src/tools/angular/compilation/compiler-options.d.ts +4 -1
- package/src/tools/angular/compilation/compiler-options.js +24 -7
- package/src/tools/angular/compilation/compiler-options.js.map +1 -1
- package/src/tools/angular/compilation/jit-compilation.d.ts +1 -1
- package/src/tools/angular/compilation/jit-compilation.js +2 -2
- package/src/tools/angular/compilation/jit-compilation.js.map +1 -1
- package/src/tools/angular/compilation/parallel-compilation.d.ts +1 -1
- package/src/tools/angular/compilation/parallel-compilation.js +2 -1
- package/src/tools/angular/compilation/parallel-compilation.js.map +1 -1
- package/src/tools/angular/compilation/parallel-worker.d.ts +1 -0
- package/src/tools/angular/compilation/parallel-worker.js +2 -1
- package/src/tools/angular/compilation/parallel-worker.js.map +1 -1
- package/src/tools/angular/compilation/typescript-compilation.d.ts +1 -1
- package/src/tools/angular/compilation/typescript-compilation.js +2 -2
- package/src/tools/angular/compilation/typescript-compilation.js.map +1 -1
- package/src/tools/esbuild/stylesheets/stylesheet-cache-key.d.ts +1 -0
- package/src/tools/esbuild/stylesheets/stylesheet-cache-key.js +2 -0
- package/src/tools/esbuild/stylesheets/stylesheet-cache-key.js.map +1 -1
- package/src/utils/normalize-cache.js +1 -1
- package/src/utils/resolve-assets.js +1 -1
- package/src/utils/resolve-assets.js.map +1 -1
- package/src/utils/version.js +1 -1
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import type { ComponentStylesheetBundler } from '../../../tools/esbuild/angular/component-stylesheets';
|
|
9
|
+
import type { NormalizedEntryPoint, NormalizedLibraryOptions, SingleProgramCache } from '../types';
|
|
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
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Compiles all library entry points in a single TypeScript and Angular compilation pass.
|
|
31
|
+
*
|
|
32
|
+
* @param entryPoints The collection of normalized library entry points to compile.
|
|
33
|
+
* @param options The normalized library builder options.
|
|
34
|
+
* @param stylesheetBundler The component stylesheet bundler instance.
|
|
35
|
+
* @param cached Optional cached compilation state from a previous build iteration.
|
|
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 diagnostics.
|
|
38
|
+
*/
|
|
39
|
+
export declare function compileLibrary(entryPoints: Iterable<NormalizedEntryPoint>, options: NormalizedLibraryOptions, stylesheetBundler: ComponentStylesheetBundler, cached?: SingleProgramCache, modifiedFiles?: Set<string>): Promise<LibraryCompilationOutput>;
|
|
@@ -0,0 +1,197 @@
|
|
|
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.dev/license
|
|
8
|
+
*/
|
|
9
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
+
exports.compileLibrary = compileLibrary;
|
|
11
|
+
const esbuild_1 = require("esbuild");
|
|
12
|
+
const node_fs_1 = require("node:fs");
|
|
13
|
+
const compilation_1 = require("../../../tools/angular/compilation");
|
|
14
|
+
const environment_options_1 = require("../../../utils/environment-options");
|
|
15
|
+
const path_1 = require("../../../utils/path");
|
|
16
|
+
const utils_1 = require("./utils");
|
|
17
|
+
const EMITTED_EXTENSIONS = ['.js', '.mjs', '.cjs', '.d.ts', '.d.mts', '.d.cts'];
|
|
18
|
+
/**
|
|
19
|
+
* Compiles all library entry points in a single TypeScript and Angular compilation pass.
|
|
20
|
+
*
|
|
21
|
+
* @param entryPoints The collection of normalized library entry points to compile.
|
|
22
|
+
* @param options The normalized library builder options.
|
|
23
|
+
* @param stylesheetBundler The component stylesheet bundler instance.
|
|
24
|
+
* @param cached Optional cached compilation state from a previous build iteration.
|
|
25
|
+
* @param modifiedFiles Optional set of modified file paths for incremental compilation.
|
|
26
|
+
* @returns A promise resolving to the compilation output containing emitted files and diagnostics.
|
|
27
|
+
*/
|
|
28
|
+
async function compileLibrary(entryPoints, options, stylesheetBundler, cached, modifiedFiles) {
|
|
29
|
+
const { tsConfigPath, compilationMode, preserveSymlinks, colors, declarationMap } = options;
|
|
30
|
+
const entryPathsMap = {};
|
|
31
|
+
const rootFiles = [];
|
|
32
|
+
for (const ep of entryPoints) {
|
|
33
|
+
entryPathsMap[ep.displayName] = [ep.entryFilePath];
|
|
34
|
+
rootFiles.push(ep.entryFilePath);
|
|
35
|
+
}
|
|
36
|
+
const compilationInstance = cached?.compilationInstance ?? (await (0, compilation_1.createAngularCompilation)('aot', false));
|
|
37
|
+
try {
|
|
38
|
+
let effectiveModifiedFiles = modifiedFiles;
|
|
39
|
+
if (cached?.failedFiles?.size) {
|
|
40
|
+
stylesheetBundler.invalidate(cached.failedFiles);
|
|
41
|
+
effectiveModifiedFiles = new Set(modifiedFiles);
|
|
42
|
+
for (const file of cached.failedFiles) {
|
|
43
|
+
effectiveModifiedFiles.add(file);
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
if (effectiveModifiedFiles && effectiveModifiedFiles.size > 0) {
|
|
47
|
+
await compilationInstance.update?.(effectiveModifiedFiles);
|
|
48
|
+
}
|
|
49
|
+
const allReferencedFiles = new Set();
|
|
50
|
+
const stylesheetWarnings = [];
|
|
51
|
+
const stylesheetErrors = [];
|
|
52
|
+
const failedFiles = new Set();
|
|
53
|
+
const hostOptions = {
|
|
54
|
+
modifiedFiles: effectiveModifiedFiles,
|
|
55
|
+
async transformStylesheet(data, containingFile, stylesheetFile) {
|
|
56
|
+
const result = stylesheetFile
|
|
57
|
+
? await stylesheetBundler.bundleFile(stylesheetFile)
|
|
58
|
+
: await stylesheetBundler.bundleInline(data, containingFile);
|
|
59
|
+
result.referencedFiles?.forEach((f) => allReferencedFiles.add((0, path_1.toPosixPath)(f)));
|
|
60
|
+
if (result.warnings.length > 0) {
|
|
61
|
+
stylesheetWarnings.push(...result.warnings);
|
|
62
|
+
}
|
|
63
|
+
if (result.errors?.length) {
|
|
64
|
+
stylesheetErrors.push(...result.errors);
|
|
65
|
+
failedFiles.add((0, path_1.toPosixPath)(containingFile));
|
|
66
|
+
if (stylesheetFile) {
|
|
67
|
+
failedFiles.add((0, path_1.toPosixPath)(stylesheetFile));
|
|
68
|
+
}
|
|
69
|
+
return '';
|
|
70
|
+
}
|
|
71
|
+
return result.contents;
|
|
72
|
+
},
|
|
73
|
+
processWebWorker: () => '',
|
|
74
|
+
};
|
|
75
|
+
const { referencedFiles } = await compilationInstance.initialize(tsConfigPath, hostOptions, {
|
|
76
|
+
sourcemap: true,
|
|
77
|
+
preserveSymlinks,
|
|
78
|
+
rootFiles,
|
|
79
|
+
declarationMap,
|
|
80
|
+
compilationMode,
|
|
81
|
+
paths: entryPathsMap,
|
|
82
|
+
}, 'library');
|
|
83
|
+
const emittedFiles = stylesheetErrors.length === 0 ? await compilationInstance.emitAffectedFiles() : [];
|
|
84
|
+
const diagnosePromise = runDiagnosticsAndFormat(compilationInstance, stylesheetErrors, stylesheetWarnings, colors);
|
|
85
|
+
// Prevent unhandled promise rejection if an error occurs before diagnosePromise is awaited.
|
|
86
|
+
diagnosePromise.catch(() => { });
|
|
87
|
+
const esmFiles = cached?.esmFiles ?? new Map();
|
|
88
|
+
const dtsFiles = cached?.dtsFiles ?? new Map();
|
|
89
|
+
const changedEsmFiles = new Set();
|
|
90
|
+
const changedDtsFiles = new Set();
|
|
91
|
+
for (const ref of referencedFiles) {
|
|
92
|
+
allReferencedFiles.add((0, path_1.toPosixPath)(ref));
|
|
93
|
+
}
|
|
94
|
+
if (effectiveModifiedFiles) {
|
|
95
|
+
for (const modifiedFile of effectiveModifiedFiles) {
|
|
96
|
+
const posixModified = (0, path_1.toPosixPath)(modifiedFile);
|
|
97
|
+
if (allReferencedFiles.has(posixModified)) {
|
|
98
|
+
continue;
|
|
99
|
+
}
|
|
100
|
+
const basePathWithoutExt = posixModified.replace(/(?:\.d\.[cm]?ts|\.[cm]?[jt]sx?)$/i, '');
|
|
101
|
+
if (basePathWithoutExt === posixModified || (0, node_fs_1.existsSync)(posixModified)) {
|
|
102
|
+
continue;
|
|
103
|
+
}
|
|
104
|
+
for (const ext of EMITTED_EXTENSIONS) {
|
|
105
|
+
const outputPath = `${basePathWithoutExt}${ext}`;
|
|
106
|
+
const mapPath = `${outputPath}.map`;
|
|
107
|
+
if (esmFiles.delete(outputPath)) {
|
|
108
|
+
changedEsmFiles.add(outputPath);
|
|
109
|
+
}
|
|
110
|
+
if (dtsFiles.delete(outputPath)) {
|
|
111
|
+
changedDtsFiles.add(outputPath);
|
|
112
|
+
}
|
|
113
|
+
esmFiles.delete(mapPath);
|
|
114
|
+
dtsFiles.delete(mapPath);
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
}
|
|
118
|
+
for (const { filename, contents } of emittedFiles) {
|
|
119
|
+
const normalized = (0, path_1.toPosixPath)(filename);
|
|
120
|
+
if (normalized.endsWith('.map')) {
|
|
121
|
+
const isDtsMap = (0, utils_1.isDeclarationSourceMapFile)(normalized);
|
|
122
|
+
const targetMap = isDtsMap ? dtsFiles : esmFiles;
|
|
123
|
+
if (targetMap.get(normalized) !== contents) {
|
|
124
|
+
targetMap.set(normalized, contents);
|
|
125
|
+
(isDtsMap ? changedDtsFiles : changedEsmFiles).add(normalized.slice(0, -4));
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
else if ((0, utils_1.isDeclarationFile)(normalized)) {
|
|
129
|
+
if (dtsFiles.get(normalized) !== contents) {
|
|
130
|
+
changedDtsFiles.add(normalized);
|
|
131
|
+
dtsFiles.set(normalized, contents);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
else if (esmFiles.get(normalized) !== contents) {
|
|
135
|
+
changedEsmFiles.add(normalized);
|
|
136
|
+
esmFiles.set(normalized, contents);
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
return {
|
|
140
|
+
esmFiles,
|
|
141
|
+
dtsFiles,
|
|
142
|
+
changedEsmFiles,
|
|
143
|
+
changedDtsFiles,
|
|
144
|
+
referencedFiles: allReferencedFiles,
|
|
145
|
+
cache: {
|
|
146
|
+
compilationInstance,
|
|
147
|
+
esmFiles,
|
|
148
|
+
dtsFiles,
|
|
149
|
+
failedFiles: failedFiles.size > 0 ? failedFiles : undefined,
|
|
150
|
+
},
|
|
151
|
+
diagnosePromise,
|
|
152
|
+
};
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
if (!cached) {
|
|
156
|
+
await compilationInstance.close?.();
|
|
157
|
+
}
|
|
158
|
+
throw error;
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
/**
|
|
162
|
+
* Validates stylesheet bundling results and runs TypeScript/Angular diagnostics.
|
|
163
|
+
*
|
|
164
|
+
* @param compilationInstance The active Angular compilation instance.
|
|
165
|
+
* @param stylesheetErrors List of stylesheet bundling errors.
|
|
166
|
+
* @param stylesheetWarnings List of stylesheet bundling warnings.
|
|
167
|
+
* @param colors Whether diagnostic messages should be formatted with ANSI colors.
|
|
168
|
+
* @returns A promise resolving to formatted warning messages.
|
|
169
|
+
* @throws If stylesheet bundling errors or compilation errors occur.
|
|
170
|
+
*/
|
|
171
|
+
async function runDiagnosticsAndFormat(compilationInstance, stylesheetErrors, stylesheetWarnings, colors) {
|
|
172
|
+
if (stylesheetErrors.length > 0) {
|
|
173
|
+
const formatted = await (0, esbuild_1.formatMessages)(stylesheetErrors, { kind: 'error', color: colors });
|
|
174
|
+
throw new Error(`Failed to bundle stylesheet:\n${formatted.join('\n')}`);
|
|
175
|
+
}
|
|
176
|
+
const warningsOut = [];
|
|
177
|
+
if (environment_options_1.useTypeChecking) {
|
|
178
|
+
const { errors, warnings } = await compilationInstance.diagnoseFiles();
|
|
179
|
+
if (errors?.length) {
|
|
180
|
+
const errorMessages = await (0, esbuild_1.formatMessages)(errors, { kind: 'error', color: colors });
|
|
181
|
+
throw new Error(`Compilation failed with errors:\n${errorMessages.join('\n')}`);
|
|
182
|
+
}
|
|
183
|
+
if (warnings?.length) {
|
|
184
|
+
const formatted = await (0, esbuild_1.formatMessages)(warnings, { kind: 'warning', color: colors });
|
|
185
|
+
warningsOut.push(...formatted);
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
if (stylesheetWarnings.length > 0) {
|
|
189
|
+
const formattedStyleWarnings = await (0, esbuild_1.formatMessages)(stylesheetWarnings, {
|
|
190
|
+
kind: 'warning',
|
|
191
|
+
color: colors,
|
|
192
|
+
});
|
|
193
|
+
warningsOut.push(...formattedStyleWarnings);
|
|
194
|
+
}
|
|
195
|
+
return warningsOut;
|
|
196
|
+
}
|
|
197
|
+
//# sourceMappingURL=compilation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compilation.js","sourceRoot":"","sources":["compilation.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAoDH,wCA2KC;AA7ND,qCAA8D;AAC9D,qCAAqC;AACrC,oEAG4C;AAE5C,4EAAqE;AACrE,8CAAkD;AAElD,mCAAwE;AAExE,MAAM,kBAAkB,GAAG,CAAC,KAAK,EAAE,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAC,CAAC;AA4BhF;;;;;;;;;GASG;AACI,KAAK,UAAU,cAAc,CAClC,WAA2C,EAC3C,OAAiC,EACj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CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;IAC3E,CAAC;IAED,MAAM,WAAW,GAAa,EAAE,CAAC;IAEjC,IAAI,qCAAe,EAAE,CAAC;QACpB,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,mBAAmB,CAAC,aAAa,EAAE,CAAC;QACvE,IAAI,MAAM,EAAE,MAAM,EAAE,CAAC;YACnB,MAAM,aAAa,GAAG,MAAM,IAAA,wBAAc,EAAC,MAAM,EAAE,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;YACrF,MAAM,IAAI,KAAK,CAAC,oCAAoC,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CAAC,CAAC;QAClF,CAAC;QAED,IAAI,QAAQ,EAAE,MAAM,EAAE,CAAC;YACrB,MAAM,SAAS,GAAG,MAAM,IAAA,wBAAc,EAAC,QAAQ,EAAE,EAAE,IAAI,EAAE,SAAS,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC,CAAC;YACrF,WAAW,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,CAAC;QACjC,CAAC;IACH,CAAC;IAED,IAAI,kBAAkB,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClC,MAAM,sBAAsB,GAAG,MAAM,IAAA,wBAAc,EAAC,kBAAkB,EAAE;YACtE,IAAI,EAAE,SAAS;YACf,KAAK,EAAE,MAAM;SACd,CAAC,CAAC;QACH,WAAW,CAAC,IAAI,CAAC,GAAG,sBAAsB,CAAC,CAAC;IAC9C,CAAC;IAED,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import type { NormalizedEntryPoint, NormalizedLibraryOptions, PackageJsonData, SingleBuildState } from '../types';
|
|
9
|
+
/**
|
|
10
|
+
* Computes the base bundle file name for an entry point.
|
|
11
|
+
*
|
|
12
|
+
* @param packageName The package name from package.json.
|
|
13
|
+
* @param entryPointName The entry point subpath name (defaults to '.').
|
|
14
|
+
* @returns The sanitized bundle base name.
|
|
15
|
+
*/
|
|
16
|
+
export declare function getEntryPointBundleName(packageName: string, entryPointName?: string): string;
|
|
17
|
+
/**
|
|
18
|
+
* Normalizes all entry points from the library's `package.json` `exports` field.
|
|
19
|
+
*
|
|
20
|
+
* @param rawExports The `exports` field from `package.json`.
|
|
21
|
+
* @param projectRoot The library project root directory.
|
|
22
|
+
* @param packageJsonPath Path to `package.json` for error reporting.
|
|
23
|
+
* @param packageName The root package name (e.g. `@my/lib`).
|
|
24
|
+
* @returns A Map of normalized entry points keyed by name.
|
|
25
|
+
*/
|
|
26
|
+
export declare function normalizeEntryPoints(rawExports: unknown, projectRoot: string, packageJsonPath: string, packageName: string): Map<string, NormalizedEntryPoint>;
|
|
27
|
+
/**
|
|
28
|
+
* Determines whether two sets of normalized entry points differ in keys, paths, or subpaths.
|
|
29
|
+
*/
|
|
30
|
+
export declare function haveEntryPointsChanged(oldEntryPoints: ReadonlyMap<string, NormalizedEntryPoint>, newEntryPoints: ReadonlyMap<string, NormalizedEntryPoint>): boolean;
|
|
31
|
+
/**
|
|
32
|
+
* Updates watched files, entry points in options, and cached bundle results when package.json entry points change.
|
|
33
|
+
*/
|
|
34
|
+
export declare function updateWatchedEntryPoints(packageJson: PackageJsonData, options: NormalizedLibraryOptions, buildState: SingleBuildState, allWatchedFiles: Set<string>, packageJsonPath: string): void;
|
|
@@ -0,0 +1,194 @@
|
|
|
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.dev/license
|
|
8
|
+
*/
|
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.getEntryPointBundleName = getEntryPointBundleName;
|
|
14
|
+
exports.normalizeEntryPoints = normalizeEntryPoints;
|
|
15
|
+
exports.haveEntryPointsChanged = haveEntryPointsChanged;
|
|
16
|
+
exports.updateWatchedEntryPoints = updateWatchedEntryPoints;
|
|
17
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
18
|
+
const path_1 = require("../../../utils/path");
|
|
19
|
+
/**
|
|
20
|
+
* Computes the base bundle file name for an entry point.
|
|
21
|
+
*
|
|
22
|
+
* @param packageName The package name from package.json.
|
|
23
|
+
* @param entryPointName The entry point subpath name (defaults to '.').
|
|
24
|
+
* @returns The sanitized bundle base name.
|
|
25
|
+
*/
|
|
26
|
+
function getEntryPointBundleName(packageName, entryPointName = '.') {
|
|
27
|
+
const isPrimary = !entryPointName || entryPointName === '.';
|
|
28
|
+
const pkgName = packageName[0] === '@' ? packageName.slice(1) : packageName;
|
|
29
|
+
const epName = isPrimary ? pkgName : `${pkgName}-${entryPointName}`;
|
|
30
|
+
return epName.replaceAll('/', '-').toLowerCase();
|
|
31
|
+
}
|
|
32
|
+
/**
|
|
33
|
+
* Normalizes a single entry point specification.
|
|
34
|
+
*
|
|
35
|
+
* @param key The entry point key from package.json exports (e.g. '.' or './testing').
|
|
36
|
+
* @param posixKey Normalized POSIX key without trailing slashes.
|
|
37
|
+
* @param isPrimary Whether this is the primary entry point.
|
|
38
|
+
* @param targetPath The relative file path string from exports.
|
|
39
|
+
* @param projectRoot The library project root directory.
|
|
40
|
+
* @param packageName The root package name (e.g. `@my/lib`).
|
|
41
|
+
* @returns The normalized entry point descriptor.
|
|
42
|
+
*/
|
|
43
|
+
function normalizeEntryPoint(key, posixKey, isPrimary, targetPath, projectRoot, packageName) {
|
|
44
|
+
const name = isPrimary
|
|
45
|
+
? '.'
|
|
46
|
+
: posixKey[0] === '.' && posixKey[1] === '/'
|
|
47
|
+
? posixKey.slice(2)
|
|
48
|
+
: posixKey;
|
|
49
|
+
if (name !== '.' && (node_path_1.default.posix.isAbsolute(name) || name.includes('..'))) {
|
|
50
|
+
throw new Error(`Invalid entry point key '${key}'. Entry point keys must be relative subpaths without '..' (e.g. './testing').`);
|
|
51
|
+
}
|
|
52
|
+
const subpath = isPrimary ? '.' : `./${name}`;
|
|
53
|
+
const displayName = (isPrimary ? packageName : `${packageName}/${name}`).toLowerCase();
|
|
54
|
+
const bundleName = getEntryPointBundleName(packageName, name);
|
|
55
|
+
const entryFilePath = node_path_1.default.resolve(projectRoot, targetPath);
|
|
56
|
+
if (!/(?<!\.d)\.(?:ts|mts)$/.test(entryFilePath)) {
|
|
57
|
+
throw new Error(`Entry point '${key}' file path must be a TypeScript file ('.ts' or '.mts'): '${entryFilePath}'.`);
|
|
58
|
+
}
|
|
59
|
+
return {
|
|
60
|
+
subpath,
|
|
61
|
+
name,
|
|
62
|
+
displayName,
|
|
63
|
+
bundleName,
|
|
64
|
+
entryFilePath,
|
|
65
|
+
isPrimary,
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Resolves the target TypeScript entry file path from an export value,
|
|
70
|
+
* which may be a string, an array of fallback alternatives, or a condition object.
|
|
71
|
+
*
|
|
72
|
+
* @param value The raw export value for an entry point subpath.
|
|
73
|
+
* @returns The resolved target string path, or undefined if none found.
|
|
74
|
+
*/
|
|
75
|
+
function resolveTarget(value) {
|
|
76
|
+
if (typeof value === 'string') {
|
|
77
|
+
return value;
|
|
78
|
+
}
|
|
79
|
+
if (Array.isArray(value)) {
|
|
80
|
+
for (const item of value) {
|
|
81
|
+
const target = resolveTarget(item);
|
|
82
|
+
if (target) {
|
|
83
|
+
return target;
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
return undefined;
|
|
87
|
+
}
|
|
88
|
+
if (typeof value === 'object' && value !== null) {
|
|
89
|
+
return resolveTarget(value['default']);
|
|
90
|
+
}
|
|
91
|
+
return undefined;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Normalizes all entry points from the library's `package.json` `exports` field.
|
|
95
|
+
*
|
|
96
|
+
* @param rawExports The `exports` field from `package.json`.
|
|
97
|
+
* @param projectRoot The library project root directory.
|
|
98
|
+
* @param packageJsonPath Path to `package.json` for error reporting.
|
|
99
|
+
* @param packageName The root package name (e.g. `@my/lib`).
|
|
100
|
+
* @returns A Map of normalized entry points keyed by name.
|
|
101
|
+
*/
|
|
102
|
+
function normalizeEntryPoints(rawExports, projectRoot, packageJsonPath, packageName) {
|
|
103
|
+
if (!rawExports || (typeof rawExports !== 'string' && typeof rawExports !== 'object')) {
|
|
104
|
+
throw new Error(`The 'package.json' at '${packageJsonPath}' must contain an 'exports' field defining the primary entry point ('.').`);
|
|
105
|
+
}
|
|
106
|
+
let exportsRecord;
|
|
107
|
+
if (typeof rawExports === 'string' || Array.isArray(rawExports)) {
|
|
108
|
+
exportsRecord = { '.': rawExports };
|
|
109
|
+
}
|
|
110
|
+
else {
|
|
111
|
+
// If an object has no keys starting with '.', Node.js treats the entire object as the '.' entry point.
|
|
112
|
+
const hasSubpathKeys = Object.keys(rawExports).some((k) => k.startsWith('.'));
|
|
113
|
+
exportsRecord = hasSubpathKeys ? rawExports : { '.': rawExports };
|
|
114
|
+
}
|
|
115
|
+
const entryPoints = new Map();
|
|
116
|
+
const usedBundleNames = new Map();
|
|
117
|
+
let hasPrimary = false;
|
|
118
|
+
for (const [key, value] of Object.entries(exportsRecord)) {
|
|
119
|
+
const target = resolveTarget(value);
|
|
120
|
+
const posixKey = (0, path_1.toPosixPath)(key).replace(/\/+$/, '');
|
|
121
|
+
const isPrimary = posixKey === '.' || posixKey === '';
|
|
122
|
+
if (!target) {
|
|
123
|
+
if (isPrimary) {
|
|
124
|
+
throw new Error(`The primary entry point '.' in '${packageJsonPath}' must specify a string path ` +
|
|
125
|
+
`or a 'default' condition pointing to a TypeScript file.`);
|
|
126
|
+
}
|
|
127
|
+
// Non-JS/TS conditional export (e.g., sass/style-only subpath); preserve in package.json without compiling.
|
|
128
|
+
continue;
|
|
129
|
+
}
|
|
130
|
+
if (!isPrimary && !/\.m?ts$/.test(target)) {
|
|
131
|
+
// Static asset, stylesheet, or package.json export; preserve in package.json without compiling.
|
|
132
|
+
continue;
|
|
133
|
+
}
|
|
134
|
+
const entryPoint = normalizeEntryPoint(key, posixKey, isPrimary, target, projectRoot, packageName);
|
|
135
|
+
const existingKey = usedBundleNames.get(entryPoint.bundleName);
|
|
136
|
+
if (existingKey) {
|
|
137
|
+
throw new Error(`Duplicate entry point detected: '${key}' resolves to the same bundle name ('${entryPoint.bundleName}') ` +
|
|
138
|
+
`as existing entry point '${existingKey}'. ` +
|
|
139
|
+
`Entry points must be unique and cannot differ only by case, slashes, or hyphens.`);
|
|
140
|
+
}
|
|
141
|
+
usedBundleNames.set(entryPoint.bundleName, key);
|
|
142
|
+
entryPoints.set(entryPoint.name, entryPoint);
|
|
143
|
+
if (entryPoint.isPrimary) {
|
|
144
|
+
hasPrimary = true;
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
if (!hasPrimary) {
|
|
148
|
+
throw new Error(`The 'exports' field in '${packageJsonPath}' must contain a primary entry point with key '.'.`);
|
|
149
|
+
}
|
|
150
|
+
return entryPoints;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Determines whether two sets of normalized entry points differ in keys, paths, or subpaths.
|
|
154
|
+
*/
|
|
155
|
+
function haveEntryPointsChanged(oldEntryPoints, newEntryPoints) {
|
|
156
|
+
if (oldEntryPoints.size !== newEntryPoints.size) {
|
|
157
|
+
return true;
|
|
158
|
+
}
|
|
159
|
+
for (const [name, oldEp] of oldEntryPoints) {
|
|
160
|
+
const newEp = newEntryPoints.get(name);
|
|
161
|
+
if (!newEp ||
|
|
162
|
+
newEp.entryFilePath !== oldEp.entryFilePath ||
|
|
163
|
+
newEp.subpath !== oldEp.subpath ||
|
|
164
|
+
newEp.bundleName !== oldEp.bundleName ||
|
|
165
|
+
newEp.displayName !== oldEp.displayName) {
|
|
166
|
+
return true;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return false;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Updates watched files, entry points in options, and cached bundle results when package.json entry points change.
|
|
173
|
+
*/
|
|
174
|
+
function updateWatchedEntryPoints(packageJson, options, buildState, allWatchedFiles, packageJsonPath) {
|
|
175
|
+
const newEntryPoints = normalizeEntryPoints(packageJson.exports, options.projectRoot, packageJsonPath, options.packageName);
|
|
176
|
+
if (haveEntryPointsChanged(options.entryPoints, newEntryPoints)) {
|
|
177
|
+
for (const entryPoint of newEntryPoints.values()) {
|
|
178
|
+
allWatchedFiles.add((0, path_1.toPosixPath)(entryPoint.entryFilePath));
|
|
179
|
+
}
|
|
180
|
+
for (const name of buildState.previousBundleResults.keys()) {
|
|
181
|
+
const oldEp = options.entryPoints.get(name);
|
|
182
|
+
const newEp = newEntryPoints.get(name);
|
|
183
|
+
if (!newEp ||
|
|
184
|
+
!oldEp ||
|
|
185
|
+
newEp.entryFilePath !== oldEp.entryFilePath ||
|
|
186
|
+
newEp.bundleName !== oldEp.bundleName) {
|
|
187
|
+
buildState.previousBundleResults.delete(name);
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
options.entryPoints = newEntryPoints;
|
|
191
|
+
buildState.hasEntryPointsChanges = true;
|
|
192
|
+
}
|
|
193
|
+
}
|
|
194
|
+
//# sourceMappingURL=entry-points.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"entry-points.js","sourceRoot":"","sources":["entry-points.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;AAkBH,0DAMC;AA6FD,oDAiFC;AAKD,wDAsBC;AA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AAI,CAAC,CAAC;YAChD,CAAC;QACH,CAAC;QAED,OAAO,CAAC,WAAW,GAAG,cAAc,CAAC;QACrC,UAAU,CAAC,qBAAqB,GAAG,IAAI,CAAC;IAC1C,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @license
|
|
3
|
+
* Copyright Google LLC All Rights Reserved.
|
|
4
|
+
*
|
|
5
|
+
* Use of this source code is governed by an MIT-style license that can be
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
|
+
*/
|
|
8
|
+
import type { NormalizedLibraryOptions } from '../types';
|
|
9
|
+
import { type MemoryOutputFile } from './utils';
|
|
10
|
+
/**
|
|
11
|
+
* Generates the APF package.json and secondary entry point package.json manifests.
|
|
12
|
+
*
|
|
13
|
+
* @param options The normalized library options.
|
|
14
|
+
* @param isWatchMode Whether the builder is running in watch mode.
|
|
15
|
+
* @returns An array of memory output files containing generated package manifests and .npmignore.
|
|
16
|
+
*/
|
|
17
|
+
export declare function generatePackageManifests(options: NormalizedLibraryOptions, isWatchMode: boolean): MemoryOutputFile[];
|
|
@@ -0,0 +1,119 @@
|
|
|
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.dev/license
|
|
8
|
+
*/
|
|
9
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
11
|
+
};
|
|
12
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
+
exports.generatePackageManifests = generatePackageManifests;
|
|
14
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
15
|
+
const utils_1 = require("./utils");
|
|
16
|
+
/**
|
|
17
|
+
* Generates the APF package.json and secondary entry point package.json manifests.
|
|
18
|
+
*
|
|
19
|
+
* @param options The normalized library options.
|
|
20
|
+
* @param isWatchMode Whether the builder is running in watch mode.
|
|
21
|
+
* @returns An array of memory output files containing generated package manifests and .npmignore.
|
|
22
|
+
*/
|
|
23
|
+
function generatePackageManifests(options, isWatchMode) {
|
|
24
|
+
const { packageJson: rawPackageJson, keepLifecycleScripts, compilationMode } = options;
|
|
25
|
+
const { devDependencies: _devDependencies, scripts, name, version, exports: userExports, workspaces: _workspaces, ...restPackageJson } = rawPackageJson;
|
|
26
|
+
const exportsMap = {
|
|
27
|
+
...(typeof userExports === 'object' && userExports !== null && !Array.isArray(userExports)
|
|
28
|
+
? userExports
|
|
29
|
+
: {}),
|
|
30
|
+
'./package.json': { default: './package.json' },
|
|
31
|
+
};
|
|
32
|
+
const primaryEntryPoint = options.entryPoints.get('.');
|
|
33
|
+
if (!primaryEntryPoint) {
|
|
34
|
+
throw new Error(`Primary entry point '.' was not found in entryPoints.`);
|
|
35
|
+
}
|
|
36
|
+
const primaryName = primaryEntryPoint.bundleName;
|
|
37
|
+
// Configure primary entry point
|
|
38
|
+
const primaryFesm = `./${utils_1.FESM_OUTPUT_DIR}/${primaryName}.mjs`;
|
|
39
|
+
const primaryDts = `./${utils_1.TYPES_OUTPUT_DIR}/${primaryName}.d.ts`;
|
|
40
|
+
exportsMap['.'] = createExportConditions(exportsMap['.'], primaryDts, primaryFesm);
|
|
41
|
+
const distPackageJson = {
|
|
42
|
+
...restPackageJson,
|
|
43
|
+
name,
|
|
44
|
+
type: 'module',
|
|
45
|
+
sideEffects: rawPackageJson.sideEffects ?? false,
|
|
46
|
+
main: primaryFesm,
|
|
47
|
+
module: primaryFesm,
|
|
48
|
+
typings: primaryDts,
|
|
49
|
+
types: primaryDts,
|
|
50
|
+
exports: exportsMap,
|
|
51
|
+
// Needed because of Webpack's 5 `cachemanagedpaths`
|
|
52
|
+
// https://github.com/angular/angular-cli/issues/20962
|
|
53
|
+
version: isWatchMode ? `0.0.0-watch+${Date.now()}` : version,
|
|
54
|
+
};
|
|
55
|
+
// Retain scripts if keepLifecycleScripts is set
|
|
56
|
+
if (keepLifecycleScripts && scripts) {
|
|
57
|
+
distPackageJson.scripts = scripts;
|
|
58
|
+
}
|
|
59
|
+
// Prevent accidental publishing of non-partial compilation packages (APF requirement)
|
|
60
|
+
if (compilationMode !== 'partial') {
|
|
61
|
+
distPackageJson.scripts = {
|
|
62
|
+
...distPackageJson.scripts,
|
|
63
|
+
prepublishOnly: 'node --eval "' +
|
|
64
|
+
"console.error('ERROR: Trying to publish a package that has been compiled in full compilation mode. " +
|
|
65
|
+
'This is not allowed by the Angular Package Format. ' +
|
|
66
|
+
"Please rebuild with compilationMode set to \\'partial\\' before publishing.'); " +
|
|
67
|
+
'process.exit(1)"',
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
// Configure secondary entry points
|
|
71
|
+
const nestedPackageJsonDirs = [];
|
|
72
|
+
const filesToEmit = [];
|
|
73
|
+
for (const entryPoint of options.entryPoints.values()) {
|
|
74
|
+
if (entryPoint.isPrimary) {
|
|
75
|
+
continue;
|
|
76
|
+
}
|
|
77
|
+
const { subpath, name: epSubpathName, bundleName: epName } = entryPoint;
|
|
78
|
+
const epFesm = `./${utils_1.FESM_OUTPUT_DIR}/${epName}.mjs`;
|
|
79
|
+
const epDts = `./${utils_1.TYPES_OUTPUT_DIR}/${epName}.d.ts`;
|
|
80
|
+
exportsMap[subpath] = createExportConditions(exportsMap[subpath], epDts, epFesm);
|
|
81
|
+
// Emit secondary package.json for legacy resolution tools
|
|
82
|
+
nestedPackageJsonDirs.push(epSubpathName);
|
|
83
|
+
const relFesm = node_path_1.default.posix.relative(epSubpathName, epFesm);
|
|
84
|
+
const relDts = node_path_1.default.posix.relative(epSubpathName, epDts);
|
|
85
|
+
const secondaryModule = relFesm[0] === '.' ? relFesm : `./${relFesm}`;
|
|
86
|
+
const secondaryTypings = relDts[0] === '.' ? relDts : `./${relDts}`;
|
|
87
|
+
const secondaryPackageJson = {
|
|
88
|
+
module: secondaryModule,
|
|
89
|
+
typings: secondaryTypings,
|
|
90
|
+
types: secondaryTypings,
|
|
91
|
+
};
|
|
92
|
+
filesToEmit.push((0, utils_1.createMemoryOutputFile)(node_path_1.default.posix.join(epSubpathName, 'package.json'), secondaryPackageJson));
|
|
93
|
+
}
|
|
94
|
+
// Write .npmignore to prevent publishing nested secondary package.json files
|
|
95
|
+
if (nestedPackageJsonDirs.length > 0) {
|
|
96
|
+
const entryPointsJsonPaths = nestedPackageJsonDirs.map((d) => `/${d}/package.json`);
|
|
97
|
+
filesToEmit.push((0, utils_1.createMemoryOutputFile)('.npmignore', `# Nested package.json's are only needed for development.\n${entryPointsJsonPaths.join('\n')}`));
|
|
98
|
+
}
|
|
99
|
+
// create root package.json
|
|
100
|
+
filesToEmit.push((0, utils_1.createMemoryOutputFile)('package.json', distPackageJson));
|
|
101
|
+
return filesToEmit;
|
|
102
|
+
}
|
|
103
|
+
/**
|
|
104
|
+
* Creates or updates export conditions for an entry point, preserving custom user-defined conditions.
|
|
105
|
+
*/
|
|
106
|
+
function createExportConditions(existingConditions, dtsPath, fesmPath) {
|
|
107
|
+
const existing = typeof existingConditions === 'object' &&
|
|
108
|
+
existingConditions !== null &&
|
|
109
|
+
!Array.isArray(existingConditions)
|
|
110
|
+
? existingConditions
|
|
111
|
+
: {};
|
|
112
|
+
const { types: _types, default: _default, ...otherConditions } = existing;
|
|
113
|
+
return {
|
|
114
|
+
types: dtsPath,
|
|
115
|
+
...otherConditions,
|
|
116
|
+
default: fesmPath,
|
|
117
|
+
};
|
|
118
|
+
}
|
|
119
|
+
//# sourceMappingURL=package-manifests.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"package-manifests.js","sourceRoot":"","sources":["package-manifests.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;AAkBH,4DAuHC;AAvID,0DAA6B;AAE7B,mCAKiB;AAEjB;;;;;;GAMG;AACH,SAAgB,wBAAwB,CACtC,O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