@angular/build 18.1.0-next.0 → 18.1.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 +23 -14
- package/src/builders/application/build-action.d.ts +1 -1
- package/src/builders/application/build-action.js +2 -3
- package/src/builders/application/execute-build.d.ts +1 -1
- package/src/builders/application/execute-build.js +2 -3
- package/src/builders/application/execute-post-bundle.d.ts +1 -1
- package/src/builders/application/execute-post-bundle.js +2 -3
- package/src/builders/application/i18n.d.ts +1 -1
- package/src/builders/application/i18n.js +3 -4
- package/src/builders/application/index.d.ts +1 -1
- package/src/builders/application/index.js +3 -4
- package/src/builders/application/options.d.ts +3 -3
- package/src/builders/application/options.js +2 -3
- package/src/builders/application/setup-bundling.d.ts +1 -1
- package/src/builders/application/setup-bundling.js +3 -9
- package/src/builders/dev-server/builder.d.ts +1 -2
- package/src/builders/dev-server/builder.js +2 -3
- package/src/builders/dev-server/index.d.ts +1 -1
- package/src/builders/dev-server/index.js +1 -1
- package/src/builders/dev-server/internal.d.ts +1 -1
- package/src/builders/dev-server/internal.js +1 -1
- package/src/builders/dev-server/options.d.ts +5 -1
- package/src/builders/dev-server/options.js +27 -3
- package/src/builders/dev-server/output.d.ts +1 -1
- package/src/builders/dev-server/output.js +1 -1
- package/src/builders/dev-server/schema.d.ts +10 -0
- package/src/builders/dev-server/schema.json +11 -0
- package/src/builders/dev-server/vite-server.d.ts +1 -1
- package/src/builders/dev-server/vite-server.js +43 -35
- package/src/builders/extract-i18n/application-extraction.d.ts +1 -1
- package/src/builders/extract-i18n/application-extraction.js +2 -3
- package/src/builders/extract-i18n/builder.d.ts +1 -1
- package/src/builders/extract-i18n/builder.js +2 -3
- package/src/builders/extract-i18n/index.d.ts +1 -1
- package/src/builders/extract-i18n/index.js +1 -1
- package/src/builders/extract-i18n/options.d.ts +1 -1
- package/src/builders/extract-i18n/options.js +2 -3
- package/src/index.d.ts +1 -1
- package/src/index.js +1 -1
- package/src/private.d.ts +1 -1
- package/src/private.js +1 -1
- package/src/tools/babel/plugins/adjust-static-class-members.d.ts +1 -2
- package/src/tools/babel/plugins/adjust-static-class-members.js +3 -4
- package/src/tools/babel/plugins/adjust-typescript-enums.d.ts +1 -2
- package/src/tools/babel/plugins/adjust-typescript-enums.js +3 -4
- package/src/tools/babel/plugins/elide-angular-metadata.d.ts +1 -2
- package/src/tools/babel/plugins/elide-angular-metadata.js +3 -4
- package/src/tools/babel/plugins/index.d.ts +1 -1
- package/src/tools/babel/plugins/index.js +1 -1
- package/src/tools/babel/plugins/pure-toplevel-functions.d.ts +1 -2
- package/src/tools/babel/plugins/pure-toplevel-functions.js +2 -2
- package/src/tools/babel/typings.d.ts +1 -1
- package/src/tools/esbuild/angular/angular-host.d.ts +1 -1
- package/src/tools/esbuild/angular/angular-host.js +3 -4
- package/src/tools/esbuild/angular/compilation/angular-compilation.d.ts +1 -1
- package/src/tools/esbuild/angular/compilation/angular-compilation.js +1 -1
- package/src/tools/esbuild/angular/compilation/aot-compilation.d.ts +1 -1
- package/src/tools/esbuild/angular/compilation/aot-compilation.js +43 -8
- package/src/tools/esbuild/angular/compilation/factory.d.ts +1 -1
- package/src/tools/esbuild/angular/compilation/factory.js +2 -3
- package/src/tools/esbuild/angular/compilation/index.d.ts +1 -1
- package/src/tools/esbuild/angular/compilation/index.js +1 -1
- package/src/tools/esbuild/angular/compilation/jit-bootstrap-transformer.d.ts +1 -1
- package/src/tools/esbuild/angular/compilation/jit-bootstrap-transformer.js +3 -4
- package/src/tools/esbuild/angular/compilation/jit-compilation.d.ts +1 -1
- package/src/tools/esbuild/angular/compilation/jit-compilation.js +1 -1
- package/src/tools/esbuild/angular/compilation/noop-compilation.d.ts +1 -1
- package/src/tools/esbuild/angular/compilation/noop-compilation.js +1 -1
- package/src/tools/esbuild/angular/compilation/parallel-compilation.d.ts +1 -1
- package/src/tools/esbuild/angular/compilation/parallel-compilation.js +1 -1
- package/src/tools/esbuild/angular/compilation/parallel-worker.d.ts +3 -2
- package/src/tools/esbuild/angular/compilation/parallel-worker.js +11 -8
- package/src/tools/esbuild/angular/compilation-state.d.ts +1 -1
- package/src/tools/esbuild/angular/compilation-state.js +3 -3
- package/src/tools/esbuild/angular/compiler-plugin.d.ts +2 -2
- package/src/tools/esbuild/angular/compiler-plugin.js +27 -13
- package/src/tools/esbuild/angular/component-stylesheets.d.ts +1 -1
- package/src/tools/esbuild/angular/component-stylesheets.js +1 -1
- package/src/tools/esbuild/angular/diagnostics.d.ts +1 -1
- package/src/tools/esbuild/angular/diagnostics.js +2 -3
- package/src/tools/esbuild/angular/file-reference-tracker.d.ts +1 -1
- package/src/tools/esbuild/angular/file-reference-tracker.js +1 -1
- package/src/tools/esbuild/angular/jit-plugin-callbacks.d.ts +1 -1
- package/src/tools/esbuild/angular/jit-plugin-callbacks.js +2 -3
- package/src/tools/esbuild/angular/jit-resource-transformer.d.ts +1 -1
- package/src/tools/esbuild/angular/jit-resource-transformer.js +2 -3
- package/src/tools/esbuild/angular/source-file-cache.d.ts +1 -1
- package/src/tools/esbuild/angular/source-file-cache.js +1 -1
- package/src/tools/esbuild/angular/uri.d.ts +1 -1
- package/src/tools/esbuild/angular/uri.js +5 -5
- package/src/tools/esbuild/angular/web-worker-transformer.d.ts +1 -1
- package/src/tools/esbuild/angular/web-worker-transformer.js +2 -3
- package/src/tools/esbuild/application-code-bundle.d.ts +1 -1
- package/src/tools/esbuild/application-code-bundle.js +21 -7
- package/src/tools/esbuild/budget-stats.d.ts +1 -1
- package/src/tools/esbuild/budget-stats.js +2 -3
- package/src/tools/esbuild/bundler-context.d.ts +1 -1
- package/src/tools/esbuild/bundler-context.js +1 -1
- package/src/tools/esbuild/bundler-execution-result.d.ts +1 -1
- package/src/tools/esbuild/bundler-execution-result.js +1 -1
- package/src/tools/esbuild/cache.d.ts +1 -1
- package/src/tools/esbuild/cache.js +1 -1
- package/src/tools/esbuild/commonjs-checker.d.ts +1 -1
- package/src/tools/esbuild/commonjs-checker.js +2 -3
- package/src/tools/esbuild/compiler-plugin-options.d.ts +1 -1
- package/src/tools/esbuild/compiler-plugin-options.js +3 -4
- package/src/tools/esbuild/external-packages-plugin.d.ts +1 -1
- package/src/tools/esbuild/external-packages-plugin.js +2 -3
- package/src/tools/esbuild/global-scripts.d.ts +1 -1
- package/src/tools/esbuild/global-scripts.js +2 -3
- package/src/tools/esbuild/global-styles.d.ts +1 -1
- package/src/tools/esbuild/global-styles.js +3 -4
- package/src/tools/esbuild/i18n-inliner-worker.d.ts +2 -2
- package/src/tools/esbuild/i18n-inliner-worker.js +2 -2
- package/src/tools/esbuild/i18n-inliner.d.ts +1 -1
- package/src/tools/esbuild/i18n-inliner.js +1 -1
- package/src/tools/esbuild/i18n-locale-plugin.d.ts +1 -1
- package/src/tools/esbuild/i18n-locale-plugin.js +3 -3
- package/src/tools/esbuild/index-html-generator.d.ts +1 -1
- package/src/tools/esbuild/index-html-generator.js +9 -12
- package/src/tools/esbuild/javascript-transformer-worker.d.ts +1 -1
- package/src/tools/esbuild/javascript-transformer-worker.js +2 -2
- package/src/tools/esbuild/javascript-transformer.d.ts +2 -2
- package/src/tools/esbuild/javascript-transformer.js +1 -1
- package/src/tools/esbuild/license-extractor.d.ts +1 -1
- package/src/tools/esbuild/license-extractor.js +2 -3
- package/src/tools/esbuild/lmdb-cache-store.d.ts +1 -1
- package/src/tools/esbuild/lmdb-cache-store.js +1 -1
- package/src/tools/esbuild/load-result-cache.d.ts +1 -1
- package/src/tools/esbuild/load-result-cache.js +3 -3
- package/src/tools/esbuild/profiling.d.ts +1 -1
- package/src/tools/esbuild/profiling.js +5 -6
- package/src/tools/esbuild/rxjs-esm-resolution-plugin.d.ts +1 -1
- package/src/tools/esbuild/rxjs-esm-resolution-plugin.js +2 -3
- package/src/tools/esbuild/sourcemap-ignorelist-plugin.d.ts +1 -1
- package/src/tools/esbuild/sourcemap-ignorelist-plugin.js +2 -3
- package/src/tools/esbuild/stylesheets/bundle-options.d.ts +1 -1
- package/src/tools/esbuild/stylesheets/bundle-options.js +2 -3
- package/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.d.ts +1 -1
- package/src/tools/esbuild/stylesheets/css-inline-fonts-plugin.js +2 -3
- package/src/tools/esbuild/stylesheets/css-language.d.ts +1 -1
- package/src/tools/esbuild/stylesheets/css-language.js +1 -1
- package/src/tools/esbuild/stylesheets/css-resource-plugin.d.ts +1 -1
- package/src/tools/esbuild/stylesheets/css-resource-plugin.js +2 -3
- package/src/tools/esbuild/stylesheets/less-language.d.ts +1 -1
- package/src/tools/esbuild/stylesheets/less-language.js +1 -1
- package/src/tools/esbuild/stylesheets/sass-language.d.ts +1 -1
- package/src/tools/esbuild/stylesheets/sass-language.js +30 -4
- package/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.d.ts +9 -2
- package/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.js +46 -41
- package/src/tools/esbuild/utils.d.ts +1 -1
- package/src/tools/esbuild/utils.js +16 -17
- package/src/tools/esbuild/virtual-module-plugin.d.ts +1 -1
- package/src/tools/esbuild/virtual-module-plugin.js +2 -3
- package/src/tools/esbuild/watcher.d.ts +1 -1
- package/src/tools/esbuild/watcher.js +3 -3
- package/src/tools/sass/lexer.d.ts +1 -1
- package/src/tools/sass/lexer.js +2 -3
- package/src/tools/sass/rebasing-importer.d.ts +1 -1
- package/src/tools/sass/rebasing-importer.js +3 -3
- package/src/tools/sass/sass-service.d.ts +1 -1
- package/src/tools/sass/sass-service.js +4 -2
- package/src/tools/sass/worker.d.ts +3 -5
- package/src/tools/sass/worker.js +2 -2
- package/src/tools/vite/angular-memory-plugin.d.ts +1 -1
- package/src/tools/vite/angular-memory-plugin.js +2 -3
- package/src/tools/vite/i18n-locale-plugin.d.ts +1 -1
- package/src/tools/vite/i18n-locale-plugin.js +3 -3
- package/src/utils/bundle-calculator.d.ts +1 -1
- package/src/utils/bundle-calculator.js +5 -5
- package/src/utils/check-port.d.ts +1 -1
- package/src/utils/check-port.js +28 -9
- package/src/utils/color.d.ts +1 -1
- package/src/utils/color.js +1 -1
- package/src/utils/delete-output-dir.d.ts +1 -1
- package/src/utils/delete-output-dir.js +2 -3
- package/src/utils/environment-options.d.ts +1 -1
- package/src/utils/environment-options.js +1 -1
- package/src/utils/error.d.ts +1 -1
- package/src/utils/error.js +2 -3
- package/src/utils/format-bytes.d.ts +1 -1
- package/src/utils/format-bytes.js +2 -3
- package/src/utils/i18n-options.d.ts +1 -1
- package/src/utils/i18n-options.js +3 -4
- package/src/utils/index-file/add-event-dispatch-contract.d.ts +1 -1
- package/src/utils/index-file/add-event-dispatch-contract.js +2 -3
- package/src/utils/index-file/augment-index-html.d.ts +1 -1
- package/src/utils/index-file/augment-index-html.js +22 -10
- package/src/utils/index-file/html-rewriting-stream.d.ts +1 -1
- package/src/utils/index-file/html-rewriting-stream.js +2 -3
- package/src/utils/index-file/index-html-generator.d.ts +1 -1
- package/src/utils/index-file/index-html-generator.js +1 -1
- package/src/utils/index-file/inline-critical-css.d.ts +1 -1
- package/src/utils/index-file/inline-critical-css.js +1 -1
- package/src/utils/index-file/inline-fonts.d.ts +1 -1
- package/src/utils/index-file/inline-fonts.js +1 -1
- package/src/utils/index-file/nonce.d.ts +1 -1
- package/src/utils/index-file/nonce.js +2 -3
- package/src/utils/index-file/valid-self-closing-tags.d.ts +1 -1
- package/src/utils/index-file/valid-self-closing-tags.js +1 -1
- package/src/utils/index.d.ts +1 -1
- package/src/utils/index.js +1 -1
- package/src/utils/load-esm.d.ts +1 -1
- package/src/utils/load-esm.js +2 -3
- package/src/utils/load-proxy-config.d.ts +1 -1
- package/src/utils/load-proxy-config.js +2 -3
- package/src/utils/load-translations.d.ts +1 -1
- package/src/utils/load-translations.js +2 -3
- package/src/utils/normalize-asset-patterns.d.ts +1 -1
- package/src/utils/normalize-asset-patterns.js +3 -3
- package/src/utils/normalize-cache.d.ts +1 -1
- package/src/utils/normalize-cache.js +3 -4
- package/src/utils/normalize-optimization.d.ts +1 -1
- package/src/utils/normalize-optimization.js +2 -3
- package/src/utils/normalize-source-maps.d.ts +1 -1
- package/src/utils/normalize-source-maps.js +2 -3
- package/src/utils/postcss-configuration.d.ts +1 -1
- package/src/utils/postcss-configuration.js +4 -5
- package/src/utils/purge-cache.d.ts +1 -1
- package/src/utils/purge-cache.js +2 -3
- package/src/utils/resolve-assets.d.ts +1 -1
- package/src/utils/resolve-assets.js +2 -3
- package/src/utils/routes-extractor/extractor.d.ts +1 -1
- package/src/utils/routes-extractor/extractor.js +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 +4 -5
- package/src/utils/server-rendering/esm-in-memory-loader/register-hooks.d.ts +1 -1
- package/src/utils/server-rendering/esm-in-memory-loader/register-hooks.js +1 -1
- package/src/utils/server-rendering/fetch-patch.d.ts +1 -1
- package/src/utils/server-rendering/fetch-patch.js +2 -3
- package/src/utils/server-rendering/load-esm-from-memory.d.ts +1 -1
- package/src/utils/server-rendering/load-esm-from-memory.js +2 -3
- package/src/utils/server-rendering/main-bundle-exports.d.ts +1 -1
- package/src/utils/server-rendering/main-bundle-exports.js +1 -1
- package/src/utils/server-rendering/prerender.d.ts +1 -1
- package/src/utils/server-rendering/prerender.js +2 -3
- package/src/utils/server-rendering/render-page.d.ts +1 -1
- package/src/utils/server-rendering/render-page.js +2 -3
- package/src/utils/server-rendering/render-worker.d.ts +1 -1
- package/src/utils/server-rendering/render-worker.js +1 -1
- package/src/utils/server-rendering/routes-extractor-worker.d.ts +1 -1
- package/src/utils/server-rendering/routes-extractor-worker.js +1 -1
- package/src/utils/service-worker.d.ts +1 -3
- package/src/utils/service-worker.js +4 -5
- package/src/utils/spinner.d.ts +1 -1
- package/src/utils/spinner.js +1 -1
- package/src/utils/stats-table.d.ts +1 -1
- package/src/utils/stats-table.js +3 -4
- package/src/utils/supported-browsers.d.ts +1 -1
- package/src/utils/supported-browsers.js +2 -3
- package/src/utils/tty.d.ts +1 -1
- package/src/utils/tty.js +2 -3
- package/src/utils/url.d.ts +1 -1
- package/src/utils/url.js +2 -3
- package/src/utils/version.d.ts +1 -1
- package/src/utils/version.js +2 -3
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -133,8 +133,10 @@ class AotCompilation extends angular_compilation_1.AngularCompilation {
|
|
|
133
133
|
}
|
|
134
134
|
emitAffectedFiles() {
|
|
135
135
|
(0, node_assert_1.default)(this.#state, 'Angular compilation must be initialized prior to emitting files.');
|
|
136
|
-
const { angularCompiler, compilerHost, typeScriptProgram, webWorkerTransform } = this.#state;
|
|
137
|
-
const
|
|
136
|
+
const { affectedFiles, angularCompiler, compilerHost, typeScriptProgram, webWorkerTransform } = this.#state;
|
|
137
|
+
const compilerOptions = typeScriptProgram.getCompilerOptions();
|
|
138
|
+
const buildInfoFilename = compilerOptions.tsBuildInfoFile ?? '.tsbuildinfo';
|
|
139
|
+
const useTypeScriptTranspilation = !compilerOptions.isolatedModules || !!compilerOptions.sourceMap;
|
|
138
140
|
const emittedFiles = new Map();
|
|
139
141
|
const writeFileCallback = (filename, contents, _a, _b, sourceFiles) => {
|
|
140
142
|
if (!sourceFiles?.length && filename.endsWith(buildInfoFilename)) {
|
|
@@ -154,9 +156,20 @@ class AotCompilation extends angular_compilation_1.AngularCompilation {
|
|
|
154
156
|
transformers.before ??= [];
|
|
155
157
|
transformers.before.push((0, jit_bootstrap_transformer_1.replaceBootstrap)(() => typeScriptProgram.getProgram().getTypeChecker()));
|
|
156
158
|
transformers.before.push(webWorkerTransform);
|
|
157
|
-
//
|
|
158
|
-
|
|
159
|
-
|
|
159
|
+
// Emit is handled in write file callback when using TypeScript
|
|
160
|
+
if (useTypeScriptTranspilation) {
|
|
161
|
+
// TypeScript will loop until there are no more affected files in the program
|
|
162
|
+
while (typeScriptProgram.emitNextAffectedFile(writeFileCallback, undefined, undefined, transformers)) {
|
|
163
|
+
/* empty */
|
|
164
|
+
}
|
|
165
|
+
}
|
|
166
|
+
else if (compilerOptions.tsBuildInfoFile) {
|
|
167
|
+
// Manually get the builder state for the persistent cache
|
|
168
|
+
// The TypeScript API currently embeds this behavior inside the program emit
|
|
169
|
+
// via emitNextAffectedFile but that also applies all internal transforms.
|
|
170
|
+
const programWithGetState = typeScriptProgram.getProgram();
|
|
171
|
+
(0, node_assert_1.default)(typeof programWithGetState.emitBuildInfo === 'function', 'TypeScript program emitBuildInfo is missing.');
|
|
172
|
+
programWithGetState.emitBuildInfo();
|
|
160
173
|
}
|
|
161
174
|
// Angular may have files that must be emitted but TypeScript does not consider affected
|
|
162
175
|
for (const sourceFile of typeScriptProgram.getSourceFiles()) {
|
|
@@ -166,10 +179,32 @@ class AotCompilation extends angular_compilation_1.AngularCompilation {
|
|
|
166
179
|
if (sourceFile.isDeclarationFile) {
|
|
167
180
|
continue;
|
|
168
181
|
}
|
|
169
|
-
if (angularCompiler.incrementalCompilation.safeToSkipEmit(sourceFile)
|
|
182
|
+
if (angularCompiler.incrementalCompilation.safeToSkipEmit(sourceFile) &&
|
|
183
|
+
!affectedFiles.has(sourceFile)) {
|
|
170
184
|
continue;
|
|
171
185
|
}
|
|
172
|
-
|
|
186
|
+
if (useTypeScriptTranspilation) {
|
|
187
|
+
typeScriptProgram.emit(sourceFile, writeFileCallback, undefined, undefined, transformers);
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
// When not using TypeScript transpilation, directly apply only Angular specific transformations
|
|
191
|
+
const transformResult = typescript_1.default.transform(sourceFile, [
|
|
192
|
+
...(transformers.before ?? []),
|
|
193
|
+
...(transformers.after ?? []),
|
|
194
|
+
], compilerOptions);
|
|
195
|
+
(0, node_assert_1.default)(transformResult.transformed.length === 1, 'TypeScript transforms should not produce multiple outputs for ' + sourceFile.fileName);
|
|
196
|
+
let contents;
|
|
197
|
+
if (sourceFile === transformResult.transformed[0]) {
|
|
198
|
+
// Use original content if no changes were made
|
|
199
|
+
contents = sourceFile.text;
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
// Otherwise, print the transformed source file
|
|
203
|
+
const printer = typescript_1.default.createPrinter(compilerOptions, transformResult);
|
|
204
|
+
contents = printer.printFile(transformResult.transformed[0]);
|
|
205
|
+
}
|
|
206
|
+
angularCompiler.incrementalCompilation.recordSuccessfulEmit(sourceFile);
|
|
207
|
+
emittedFiles.set(sourceFile, { filename: sourceFile.fileName, contents });
|
|
173
208
|
}
|
|
174
209
|
return emittedFiles.values();
|
|
175
210
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { AngularCompilation } from './angular-compilation';
|
|
9
9
|
/**
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
@@ -30,7 +30,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
30
30
|
return result;
|
|
31
31
|
};
|
|
32
32
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
-
exports.createAngularCompilation =
|
|
33
|
+
exports.createAngularCompilation = createAngularCompilation;
|
|
34
34
|
const environment_options_1 = require("../../../../utils/environment-options");
|
|
35
35
|
/**
|
|
36
36
|
* Creates an Angular compilation object that can be used to perform Angular application
|
|
@@ -53,4 +53,3 @@ async function createAngularCompilation(jit) {
|
|
|
53
53
|
return new AotCompilation();
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
-
exports.createAngularCompilation = createAngularCompilation;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
export { AngularCompilation, DiagnosticModes } from './angular-compilation';
|
|
9
9
|
export { createAngularCompilation } from './factory';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.NoopCompilation = exports.createAngularCompilation = exports.DiagnosticModes = exports.AngularCompilation = void 0;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import ts from 'typescript';
|
|
9
9
|
export declare function replaceBootstrap(getTypeChecker: () => ts.TypeChecker): ts.TransformerFactory<ts.SourceFile>;
|
|
@@ -4,13 +4,14 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
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.
|
|
13
|
+
exports.replaceBootstrap = replaceBootstrap;
|
|
14
|
+
exports.elideImports = elideImports;
|
|
14
15
|
const typescript_1 = __importDefault(require("typescript"));
|
|
15
16
|
/**
|
|
16
17
|
* The name of the Angular platform that should be replaced within
|
|
@@ -57,7 +58,6 @@ function replaceBootstrap(getTypeChecker) {
|
|
|
57
58
|
};
|
|
58
59
|
};
|
|
59
60
|
}
|
|
60
|
-
exports.replaceBootstrap = replaceBootstrap;
|
|
61
61
|
// Remove imports for which all identifiers have been removed.
|
|
62
62
|
// Needs type checker, and works even if it's not the first transformer.
|
|
63
63
|
// Works by removing imports for symbols whose identifiers have all been removed.
|
|
@@ -179,4 +179,3 @@ function elideImports(sourceFile, removedNodes, getTypeChecker, compilerOptions)
|
|
|
179
179
|
}
|
|
180
180
|
return importNodeRemovals;
|
|
181
181
|
}
|
|
182
|
-
exports.elideImports = elideImports;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type ng from '@angular/compiler-cli';
|
|
9
9
|
import ts from 'typescript';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type ng from '@angular/compiler-cli';
|
|
9
9
|
import type ts from 'typescript';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.NoopCompilation = void 0;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { CompilerOptions } from '@angular/compiler-cli';
|
|
9
9
|
import type { PartialMessage } from 'esbuild';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -3,9 +3,8 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
/// <reference types="node" />
|
|
9
8
|
import type { PartialMessage } from 'esbuild';
|
|
10
9
|
import { type MessagePort } from 'node:worker_threads';
|
|
11
10
|
import type { DiagnosticModes } from './angular-compilation';
|
|
@@ -23,6 +22,8 @@ export declare function initialize(request: InitRequest): Promise<{
|
|
|
23
22
|
referencedFiles: readonly string[];
|
|
24
23
|
compilerOptions: {
|
|
25
24
|
allowJs: boolean | undefined;
|
|
25
|
+
isolatedModules: boolean | undefined;
|
|
26
|
+
sourceMap: boolean | undefined;
|
|
26
27
|
};
|
|
27
28
|
}>;
|
|
28
29
|
export declare function diagnose(modes: DiagnosticModes): Promise<{
|
|
@@ -4,13 +4,16 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
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.
|
|
13
|
+
exports.initialize = initialize;
|
|
14
|
+
exports.diagnose = diagnose;
|
|
15
|
+
exports.emit = emit;
|
|
16
|
+
exports.update = update;
|
|
14
17
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
15
18
|
const node_crypto_1 = require("node:crypto");
|
|
16
19
|
const node_worker_threads_1 = require("node:worker_threads");
|
|
@@ -67,24 +70,24 @@ async function initialize(request) {
|
|
|
67
70
|
});
|
|
68
71
|
return {
|
|
69
72
|
referencedFiles,
|
|
70
|
-
// TODO: Expand? `allowJs`
|
|
71
|
-
compilerOptions: {
|
|
73
|
+
// TODO: Expand? `allowJs`, `isolatedModules`, `sourceMap` are the only fields needed currently.
|
|
74
|
+
compilerOptions: {
|
|
75
|
+
allowJs: compilerOptions.allowJs,
|
|
76
|
+
isolatedModules: compilerOptions.isolatedModules,
|
|
77
|
+
sourceMap: compilerOptions.sourceMap,
|
|
78
|
+
},
|
|
72
79
|
};
|
|
73
80
|
}
|
|
74
|
-
exports.initialize = initialize;
|
|
75
81
|
async function diagnose(modes) {
|
|
76
82
|
(0, node_assert_1.default)(compilation);
|
|
77
83
|
const diagnostics = await compilation.diagnoseFiles(modes);
|
|
78
84
|
return diagnostics;
|
|
79
85
|
}
|
|
80
|
-
exports.diagnose = diagnose;
|
|
81
86
|
async function emit() {
|
|
82
87
|
(0, node_assert_1.default)(compilation);
|
|
83
88
|
const files = await compilation.emitAffectedFiles();
|
|
84
89
|
return [...files];
|
|
85
90
|
}
|
|
86
|
-
exports.emit = emit;
|
|
87
91
|
function update(files) {
|
|
88
92
|
sourceFileCache.invalidate(files);
|
|
89
93
|
}
|
|
90
|
-
exports.update = update;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
export declare class SharedTSCompilationState {
|
|
9
9
|
#private;
|
|
@@ -4,10 +4,11 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.
|
|
10
|
+
exports.SharedTSCompilationState = void 0;
|
|
11
|
+
exports.getSharedCompilationState = getSharedCompilationState;
|
|
11
12
|
class SharedTSCompilationState {
|
|
12
13
|
#pendingCompilation = true;
|
|
13
14
|
#resolveCompilationReady;
|
|
@@ -41,4 +42,3 @@ let globalSharedCompilationState;
|
|
|
41
42
|
function getSharedCompilationState() {
|
|
42
43
|
return (globalSharedCompilationState ??= new SharedTSCompilationState());
|
|
43
44
|
}
|
|
44
|
-
exports.getSharedCompilationState = getSharedCompilationState;
|
|
@@ -3,14 +3,14 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { Plugin } from 'esbuild';
|
|
9
9
|
import { LoadResultCache } from '../load-result-cache';
|
|
10
10
|
import { BundleStylesheetOptions } from '../stylesheets/bundle-options';
|
|
11
11
|
import { SourceFileCache } from './source-file-cache';
|
|
12
12
|
export interface CompilerPluginOptions {
|
|
13
|
-
sourcemap: boolean;
|
|
13
|
+
sourcemap: boolean | 'external';
|
|
14
14
|
tsconfig: string;
|
|
15
15
|
jit?: boolean;
|
|
16
16
|
/** Skip TypeScript compilation setup. This is useful to re-use the TypeScript compilation from another plugin. */
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
@@ -33,7 +33,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
33
33
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
34
34
|
};
|
|
35
35
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
-
exports.createCompilerPlugin =
|
|
36
|
+
exports.createCompilerPlugin = createCompilerPlugin;
|
|
37
37
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
38
38
|
const path = __importStar(require("node:path"));
|
|
39
39
|
const environment_options_1 = require("../../../utils/environment-options");
|
|
@@ -53,13 +53,19 @@ function createCompilerPlugin(pluginOptions, styleOptions) {
|
|
|
53
53
|
async setup(build) {
|
|
54
54
|
let setupWarnings = [];
|
|
55
55
|
const preserveSymlinks = build.initialOptions.preserveSymlinks;
|
|
56
|
-
// Initialize a worker pool for JavaScript transformations
|
|
56
|
+
// Initialize a worker pool for JavaScript transformations.
|
|
57
|
+
// Webcontainers currently do not support this persistent cache store.
|
|
57
58
|
let cacheStore;
|
|
58
|
-
if (pluginOptions.sourceFileCache?.persistentCachePath) {
|
|
59
|
+
if (pluginOptions.sourceFileCache?.persistentCachePath && !process.versions.webcontainer) {
|
|
59
60
|
const { LmbdCacheStore } = await Promise.resolve().then(() => __importStar(require('../lmdb-cache-store')));
|
|
60
61
|
cacheStore = new LmbdCacheStore(path.join(pluginOptions.sourceFileCache.persistentCachePath, 'angular-compiler.db'));
|
|
61
62
|
}
|
|
62
|
-
const javascriptTransformer = new javascript_transformer_1.JavaScriptTransformer(
|
|
63
|
+
const javascriptTransformer = new javascript_transformer_1.JavaScriptTransformer({
|
|
64
|
+
sourcemap: !!pluginOptions.sourcemap,
|
|
65
|
+
thirdPartySourcemaps: pluginOptions.thirdPartySourcemaps,
|
|
66
|
+
advancedOptimizations: pluginOptions.advancedOptimizations,
|
|
67
|
+
jit: pluginOptions.jit,
|
|
68
|
+
}, environment_options_1.maxWorkers, cacheStore?.createCache('jstransformer'));
|
|
63
69
|
// Setup defines based on the values used by the Angular compiler-cli
|
|
64
70
|
build.initialOptions.define ??= {};
|
|
65
71
|
build.initialOptions.define['ngI18nClosureMode'] ??= 'false';
|
|
@@ -77,6 +83,8 @@ function createCompilerPlugin(pluginOptions, styleOptions) {
|
|
|
77
83
|
let hasCompilationErrors = true;
|
|
78
84
|
// Determines if TypeScript should process JavaScript files based on tsconfig `allowJs` option
|
|
79
85
|
let shouldTsIgnoreJs = true;
|
|
86
|
+
// Determines if transpilation should be handle by TypeScript or esbuild
|
|
87
|
+
let useTypeScriptTranspilation = true;
|
|
80
88
|
// Track incremental component stylesheet builds
|
|
81
89
|
const stylesheetBundler = new component_stylesheets_1.ComponentStylesheetBundler(styleOptions, pluginOptions.incremental);
|
|
82
90
|
let sharedTSCompilationState;
|
|
@@ -179,6 +187,11 @@ function createCompilerPlugin(pluginOptions, styleOptions) {
|
|
|
179
187
|
try {
|
|
180
188
|
const initializationResult = await compilation.initialize(pluginOptions.tsconfig, hostOptions, createCompilerOptionsTransformer(setupWarnings, pluginOptions, preserveSymlinks));
|
|
181
189
|
shouldTsIgnoreJs = !initializationResult.compilerOptions.allowJs;
|
|
190
|
+
// Isolated modules option ensures safe non-TypeScript transpilation.
|
|
191
|
+
// Typescript printing support for sourcemaps is not yet integrated.
|
|
192
|
+
useTypeScriptTranspilation =
|
|
193
|
+
!initializationResult.compilerOptions.isolatedModules ||
|
|
194
|
+
!!initializationResult.compilerOptions.sourceMap;
|
|
182
195
|
referencedFiles = initializationResult.referencedFiles;
|
|
183
196
|
}
|
|
184
197
|
catch (error) {
|
|
@@ -249,8 +262,9 @@ function createCompilerPlugin(pluginOptions, styleOptions) {
|
|
|
249
262
|
});
|
|
250
263
|
build.onLoad({ filter: /\.[cm]?[jt]sx?$/ }, async (args) => {
|
|
251
264
|
const request = path.normalize(pluginOptions.fileReplacements?.[path.normalize(args.path)] ?? args.path);
|
|
265
|
+
const isJS = /\.[cm]?js$/.test(request);
|
|
252
266
|
// Skip TS load attempt if JS TypeScript compilation not enabled and file is JS
|
|
253
|
-
if (shouldTsIgnoreJs &&
|
|
267
|
+
if (shouldTsIgnoreJs && isJS) {
|
|
254
268
|
return undefined;
|
|
255
269
|
}
|
|
256
270
|
// The filename is currently used as a cache key. Since the cache is memory only,
|
|
@@ -266,7 +280,7 @@ function createCompilerPlugin(pluginOptions, styleOptions) {
|
|
|
266
280
|
}
|
|
267
281
|
// No TS result indicates the file is not part of the TypeScript program.
|
|
268
282
|
// If allowJs is enabled and the file is JS then defer to the next load hook.
|
|
269
|
-
if (!shouldTsIgnoreJs &&
|
|
283
|
+
if (!shouldTsIgnoreJs && isJS) {
|
|
270
284
|
return undefined;
|
|
271
285
|
}
|
|
272
286
|
// Otherwise return an error
|
|
@@ -276,8 +290,9 @@ function createCompilerPlugin(pluginOptions, styleOptions) {
|
|
|
276
290
|
],
|
|
277
291
|
};
|
|
278
292
|
}
|
|
279
|
-
else if (typeof contents === 'string') {
|
|
280
|
-
// A string indicates untransformed output from the TS/NG compiler
|
|
293
|
+
else if (typeof contents === 'string' && (useTypeScriptTranspilation || isJS)) {
|
|
294
|
+
// A string indicates untransformed output from the TS/NG compiler.
|
|
295
|
+
// This step is unneeded when using esbuild transpilation.
|
|
281
296
|
const sideEffects = await hasSideEffects(request);
|
|
282
297
|
contents = await javascriptTransformer.transformData(request, contents, true /* skipLinker */, sideEffects);
|
|
283
298
|
// Store as the returned Uint8Array to allow caching the fully transformed code
|
|
@@ -285,7 +300,7 @@ function createCompilerPlugin(pluginOptions, styleOptions) {
|
|
|
285
300
|
}
|
|
286
301
|
return {
|
|
287
302
|
contents,
|
|
288
|
-
loader: 'js',
|
|
303
|
+
loader: useTypeScriptTranspilation || isJS ? 'js' : 'ts',
|
|
289
304
|
};
|
|
290
305
|
});
|
|
291
306
|
build.onLoad({ filter: /\.[cm]?js$/ }, (0, load_result_cache_1.createCachedLoad)(pluginOptions.loadResultCache, async (args) => {
|
|
@@ -343,7 +358,6 @@ function createCompilerPlugin(pluginOptions, styleOptions) {
|
|
|
343
358
|
},
|
|
344
359
|
};
|
|
345
360
|
}
|
|
346
|
-
exports.createCompilerPlugin = createCompilerPlugin;
|
|
347
361
|
function createCompilerOptionsTransformer(setupWarnings, pluginOptions, preserveSymlinks) {
|
|
348
362
|
return (compilerOptions) => {
|
|
349
363
|
// target of 9 is ES2022 (using the number avoids an expensive import of typescript just for an enum)
|
|
@@ -394,8 +408,8 @@ function createCompilerOptionsTransformer(setupWarnings, pluginOptions, preserve
|
|
|
394
408
|
return {
|
|
395
409
|
...compilerOptions,
|
|
396
410
|
noEmitOnError: false,
|
|
397
|
-
inlineSources: pluginOptions.sourcemap,
|
|
398
|
-
inlineSourceMap: pluginOptions.sourcemap,
|
|
411
|
+
inlineSources: !!pluginOptions.sourcemap,
|
|
412
|
+
inlineSourceMap: !!pluginOptions.sourcemap,
|
|
399
413
|
mapRoot: undefined,
|
|
400
414
|
sourceRoot: undefined,
|
|
401
415
|
preserveSymlinks,
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import { OutputFile } from 'esbuild';
|
|
9
9
|
import { BundleStylesheetOptions } from '../stylesheets/bundle-options';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
10
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { PartialMessage } from 'esbuild';
|
|
9
9
|
import type ts from 'typescript';
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.convertTypeScriptDiagnostic =
|
|
10
|
+
exports.convertTypeScriptDiagnostic = convertTypeScriptDiagnostic;
|
|
11
11
|
const node_os_1 = require("node:os");
|
|
12
12
|
/**
|
|
13
13
|
* Converts TypeScript Diagnostic related information into an esbuild compatible note object.
|
|
@@ -66,4 +66,3 @@ function convertTypeScriptDiagnostic(typescript, diagnostic) {
|
|
|
66
66
|
}
|
|
67
67
|
return message;
|
|
68
68
|
}
|
|
69
|
-
exports.convertTypeScriptDiagnostic = convertTypeScriptDiagnostic;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
export declare class FileReferenceTracker {
|
|
9
9
|
#private;
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
exports.FileReferenceTracker = void 0;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { Metafile, OutputFile, PluginBuild } from 'esbuild';
|
|
9
9
|
import { LoadResultCache } from '../load-result-cache';
|
|
@@ -4,10 +4,10 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
|
-
exports.setupJitPluginCallbacks =
|
|
10
|
+
exports.setupJitPluginCallbacks = setupJitPluginCallbacks;
|
|
11
11
|
const promises_1 = require("node:fs/promises");
|
|
12
12
|
const node_path_1 = require("node:path");
|
|
13
13
|
const load_result_cache_1 = require("../load-result-cache");
|
|
@@ -114,4 +114,3 @@ function setupJitPluginCallbacks(build, stylesheetBundler, additionalResultFiles
|
|
|
114
114
|
};
|
|
115
115
|
}));
|
|
116
116
|
}
|
|
117
|
-
exports.setupJitPluginCallbacks = setupJitPluginCallbacks;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import ts from 'typescript';
|
|
9
9
|
/**
|
|
@@ -4,13 +4,13 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
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.createJitResourceTransformer =
|
|
13
|
+
exports.createJitResourceTransformer = createJitResourceTransformer;
|
|
14
14
|
const typescript_1 = __importDefault(require("typescript"));
|
|
15
15
|
const uri_1 = require("./uri");
|
|
16
16
|
/**
|
|
@@ -50,7 +50,6 @@ function createJitResourceTransformer(getTypeChecker) {
|
|
|
50
50
|
};
|
|
51
51
|
};
|
|
52
52
|
}
|
|
53
|
-
exports.createJitResourceTransformer = createJitResourceTransformer;
|
|
54
53
|
function visitDecorator(nodeFactory, node, typeChecker, resourceImportDeclarations) {
|
|
55
54
|
const origin = getDecoratorOrigin(node, typeChecker);
|
|
56
55
|
if (!origin || origin.module !== '@angular/core' || origin.name !== 'Component') {
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type ts from 'typescript';
|
|
9
9
|
import { MemoryLoadResultCache } from '../load-result-cache';
|
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
* Copyright Google LLC All Rights Reserved.
|
|
5
5
|
*
|
|
6
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.
|
|
7
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
8
8
|
*/
|
|
9
9
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
10
|
if (k2 === undefined) k2 = k;
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
* Copyright Google LLC All Rights Reserved.
|
|
4
4
|
*
|
|
5
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.
|
|
6
|
+
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
/**
|
|
9
9
|
* A string value representing the namespace for Angular JIT mode related imports for
|