@depup/angular__build 22.1.8-depup.5 → 22.2.0-depup.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/README.md +9 -14
- package/builders.json +1 -1
- package/changes.json +12 -32
- package/package.json +29 -48
- package/src/builders/application/build-action.js +63 -92
- package/src/builders/application/build-action.js.map +1 -1
- package/src/builders/application/chunk-optimizer.d.ts +2 -2
- package/src/builders/application/chunk-optimizer.js +5 -5
- package/src/builders/application/chunk-optimizer.js.map +1 -1
- package/src/builders/application/execute-build.js +26 -19
- package/src/builders/application/execute-build.js.map +1 -1
- package/src/builders/application/execute-post-bundle.d.ts +2 -2
- package/src/builders/application/execute-post-bundle.js +5 -5
- package/src/builders/application/execute-post-bundle.js.map +1 -1
- package/src/builders/application/i18n.d.ts +3 -1
- package/src/builders/application/i18n.js +48 -13
- package/src/builders/application/i18n.js.map +1 -1
- package/src/{tools/esbuild → builders/application}/index-html-generator.d.ts +2 -2
- package/src/{tools/esbuild → builders/application}/index-html-generator.js +2 -2
- package/src/builders/application/index-html-generator.js.map +1 -0
- package/src/builders/application/index.js +2 -2
- package/src/builders/application/index.js.map +1 -1
- package/src/builders/application/options.d.ts +5 -0
- package/src/builders/application/options.js +8 -26
- package/src/builders/application/options.js.map +1 -1
- package/src/builders/application/results.d.ts +3 -2
- package/src/builders/application/schema.d.ts +2 -1
- package/src/builders/application/schema.js.map +1 -1
- package/src/builders/application/schema.json +1 -2
- package/src/builders/application/setup-bundling.js +3 -1
- package/src/builders/application/setup-bundling.js.map +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/internal.js.map +1 -1
- package/src/builders/dev-server/vite/index.js +5 -8
- package/src/builders/dev-server/vite/index.js.map +1 -1
- package/src/builders/dev-server/vite/server.js +2 -0
- package/src/builders/dev-server/vite/server.js.map +1 -1
- package/src/builders/dev-server/vite/utils.d.ts +1 -1
- package/src/builders/dev-server/vite/utils.js +9 -4
- package/src/builders/dev-server/vite/utils.js.map +1 -1
- package/src/builders/extract-i18n/application-extraction.js +6 -5
- package/src/builders/extract-i18n/application-extraction.js.map +1 -1
- package/src/builders/karma/application_builder.js +1 -1
- package/src/builders/karma/application_builder.js.map +1 -1
- package/src/builders/karma/assets-middleware.d.ts +2 -2
- package/src/builders/karma/assets-middleware.js +5 -2
- package/src/builders/karma/assets-middleware.js.map +1 -1
- package/src/builders/karma/progress-reporter.js +7 -5
- package/src/builders/karma/progress-reporter.js.map +1 -1
- package/src/builders/karma/utils.d.ts +2 -1
- package/src/builders/karma/utils.js +2 -2
- package/src/builders/karma/utils.js.map +1 -1
- package/src/builders/unit-test/builder.js +1 -1
- package/src/builders/unit-test/runners/vitest/build-options.js +9 -3
- package/src/builders/unit-test/runners/vitest/build-options.js.map +1 -1
- package/src/builders/unit-test/runners/vitest/executor.js +5 -4
- package/src/builders/unit-test/runners/vitest/executor.js.map +1 -1
- package/src/builders/unit-test/runners/vitest/plugins.d.ts +4 -4
- package/src/builders/unit-test/runners/vitest/plugins.js +9 -2
- package/src/builders/unit-test/runners/vitest/plugins.js.map +1 -1
- package/src/builders/unit-test/schema.d.ts +3 -2
- package/src/builders/unit-test/schema.js.map +1 -1
- package/src/builders/unit-test/schema.json +3 -2
- package/src/builders/unit-test/test-discovery.js +3 -2
- package/src/builders/unit-test/test-discovery.js.map +1 -1
- package/src/private.d.ts +3 -5
- package/src/private.js +6 -9
- package/src/private.js.map +1 -1
- package/src/tools/angular/angular-host.d.ts +1 -2
- package/src/tools/angular/angular-host.js +6 -6
- package/src/tools/angular/angular-host.js.map +1 -1
- package/src/tools/angular/compilation/angular-compilation.d.ts +24 -16
- package/src/tools/angular/compilation/angular-compilation.js +4 -80
- package/src/tools/angular/compilation/angular-compilation.js.map +1 -1
- package/src/tools/angular/compilation/aot-compilation.d.ts +6 -12
- package/src/tools/angular/compilation/aot-compilation.js +23 -20
- package/src/tools/angular/compilation/aot-compilation.js.map +1 -1
- package/src/tools/angular/compilation/compiler-options.d.ts +25 -0
- package/src/tools/angular/compilation/compiler-options.js +135 -0
- package/src/tools/angular/compilation/compiler-options.js.map +1 -0
- package/src/tools/angular/compilation/factory.d.ts +5 -3
- package/src/tools/angular/compilation/factory.js +10 -5
- package/src/tools/angular/compilation/factory.js.map +1 -1
- package/src/tools/angular/compilation/index.d.ts +3 -3
- package/src/tools/angular/compilation/index.js +1 -3
- package/src/tools/angular/compilation/index.js.map +1 -1
- package/src/tools/angular/compilation/jit-compilation.d.ts +6 -9
- package/src/tools/angular/compilation/jit-compilation.js +10 -16
- package/src/tools/angular/compilation/jit-compilation.js.map +1 -1
- package/src/tools/angular/compilation/parallel-compilation.d.ts +3 -14
- package/src/tools/angular/compilation/parallel-compilation.js +40 -42
- package/src/tools/angular/compilation/parallel-compilation.js.map +1 -1
- package/src/tools/angular/compilation/parallel-worker.d.ts +5 -17
- package/src/tools/angular/compilation/parallel-worker.js +89 -68
- package/src/tools/angular/compilation/parallel-worker.js.map +1 -1
- package/src/tools/angular/compilation/typescript-compilation.d.ts +31 -0
- package/src/tools/angular/compilation/typescript-compilation.js +125 -0
- package/src/tools/angular/compilation/typescript-compilation.js.map +1 -0
- package/src/tools/angular/linker/oxc-ast-host.d.ts +33 -0
- package/src/tools/angular/linker/oxc-ast-host.js +234 -0
- package/src/tools/angular/linker/oxc-ast-host.js.map +1 -0
- package/src/tools/angular/linker/oxc-linker.d.ts +22 -0
- package/src/tools/angular/linker/oxc-linker.js +75 -0
- package/src/tools/angular/linker/oxc-linker.js.map +1 -0
- package/src/tools/angular/linker/string-ast-factory.d.ts +86 -0
- package/src/tools/angular/linker/string-ast-factory.js +234 -0
- package/src/tools/angular/linker/string-ast-factory.js.map +1 -0
- package/src/tools/esbuild/angular/compilation-state.d.ts +23 -3
- package/src/tools/esbuild/angular/compilation-state.js +51 -13
- package/src/tools/esbuild/angular/compilation-state.js.map +1 -1
- package/src/tools/esbuild/angular/compiler-plugin.d.ts +1 -0
- package/src/tools/esbuild/angular/compiler-plugin.js +126 -139
- package/src/tools/esbuild/angular/compiler-plugin.js.map +1 -1
- package/src/tools/esbuild/angular/component-stylesheets.d.ts +3 -3
- package/src/tools/esbuild/angular/component-stylesheets.js +52 -22
- package/src/tools/esbuild/angular/component-stylesheets.js.map +1 -1
- package/src/tools/esbuild/angular/source-file-cache.d.ts +1 -2
- package/src/tools/esbuild/angular/source-file-cache.js +1 -11
- package/src/tools/esbuild/angular/source-file-cache.js.map +1 -1
- package/src/tools/esbuild/application-code-bundle.js +7 -14
- package/src/tools/esbuild/application-code-bundle.js.map +1 -1
- package/src/tools/esbuild/budget-stats.js +3 -3
- package/src/tools/esbuild/budget-stats.js.map +1 -1
- package/src/tools/esbuild/bundler-context.d.ts +23 -7
- package/src/tools/esbuild/bundler-context.js +112 -43
- package/src/tools/esbuild/bundler-context.js.map +1 -1
- package/src/tools/esbuild/bundler-execution-result.d.ts +2 -1
- package/src/tools/esbuild/bundler-execution-result.js +2 -2
- package/src/tools/esbuild/bundler-execution-result.js.map +1 -1
- package/src/tools/esbuild/bundler-files.js +3 -5
- package/src/tools/esbuild/bundler-files.js.map +1 -1
- package/src/tools/esbuild/compiler-plugin-options.js +2 -1
- package/src/tools/esbuild/compiler-plugin-options.js.map +1 -1
- package/src/tools/esbuild/i18n-locale-plugin.d.ts +1 -8
- package/src/tools/esbuild/i18n-locale-plugin.js +33 -114
- package/src/tools/esbuild/i18n-locale-plugin.js.map +1 -1
- package/src/tools/esbuild/license-extractor.d.ts +1 -1
- package/src/tools/esbuild/license-extractor.js +89 -86
- package/src/tools/esbuild/license-extractor.js.map +1 -1
- package/src/tools/esbuild/load-result-cache.d.ts +2 -1
- package/src/tools/esbuild/load-result-cache.js +28 -13
- package/src/tools/esbuild/load-result-cache.js.map +1 -1
- package/src/tools/esbuild/persistent-load-result-cache.d.ts +87 -0
- package/src/tools/esbuild/persistent-load-result-cache.js +229 -0
- package/src/tools/esbuild/persistent-load-result-cache.js.map +1 -0
- package/src/tools/esbuild/stylesheets/bundle-options.d.ts +1 -0
- package/src/tools/esbuild/stylesheets/bundle-options.js +1 -1
- package/src/tools/esbuild/stylesheets/bundle-options.js.map +1 -1
- package/src/tools/esbuild/stylesheets/css-resource-plugin.d.ts +3 -1
- package/src/tools/esbuild/stylesheets/css-resource-plugin.js +4 -2
- package/src/tools/esbuild/stylesheets/css-resource-plugin.js.map +1 -1
- package/src/tools/esbuild/stylesheets/sass-language.d.ts +9 -0
- package/src/tools/esbuild/stylesheets/sass-language.js +109 -50
- package/src/tools/esbuild/stylesheets/sass-language.js.map +1 -1
- package/src/tools/esbuild/stylesheets/stylesheet-cache-key.d.ts +35 -0
- package/src/tools/esbuild/stylesheets/stylesheet-cache-key.js +64 -0
- package/src/tools/esbuild/stylesheets/stylesheet-cache-key.js.map +1 -0
- package/src/tools/esbuild/stylesheets/stylesheet-plugin-factory.d.ts +1 -1
- package/src/tools/esbuild/utils.d.ts +3 -3
- package/src/tools/esbuild/utils.js +9 -6
- package/src/tools/esbuild/utils.js.map +1 -1
- package/src/tools/i18n/i18n-inliner-worker.d.ts +126 -0
- package/src/tools/i18n/i18n-inliner-worker.js +363 -0
- package/src/tools/i18n/i18n-inliner-worker.js.map +1 -0
- package/src/tools/i18n/i18n-inliner.d.ts +97 -0
- package/src/tools/i18n/i18n-inliner.js +500 -0
- package/src/tools/i18n/i18n-inliner.js.map +1 -0
- package/src/tools/i18n/i18n-translation-encoder.d.ts +21 -0
- package/src/tools/i18n/i18n-translation-encoder.js +92 -0
- package/src/tools/i18n/i18n-translation-encoder.js.map +1 -0
- package/src/tools/i18n/i18n-translation-reader.d.ts +41 -0
- package/src/tools/i18n/i18n-translation-reader.js +164 -0
- package/src/tools/i18n/i18n-translation-reader.js.map +1 -0
- package/src/tools/i18n/index.d.ts +11 -0
- package/src/tools/i18n/index.js +28 -0
- package/src/tools/i18n/index.js.map +1 -0
- package/src/tools/i18n/locale-data.d.ts +47 -0
- package/src/tools/i18n/locale-data.js +108 -0
- package/src/tools/i18n/locale-data.js.map +1 -0
- package/src/tools/javascript-transformer/index.d.ts +8 -0
- package/src/tools/javascript-transformer/index.js +25 -0
- package/src/tools/javascript-transformer/index.js.map +1 -0
- package/src/tools/{esbuild → javascript-transformer}/javascript-transformer-worker.d.ts +0 -4
- package/src/tools/javascript-transformer/javascript-transformer-worker.js +231 -0
- package/src/tools/javascript-transformer/javascript-transformer-worker.js.map +1 -0
- package/src/tools/{esbuild → javascript-transformer}/javascript-transformer.d.ts +26 -9
- package/src/tools/javascript-transformer/javascript-transformer.js +294 -0
- package/src/tools/javascript-transformer/javascript-transformer.js.map +1 -0
- package/src/tools/{babel/plugins → oxc}/oxc-transform.d.ts +5 -2
- package/src/tools/{babel/plugins → oxc}/oxc-transform.js +105 -138
- package/src/tools/oxc/oxc-transform.js.map +1 -0
- package/src/tools/oxc/traversal.d.ts +32 -0
- package/src/tools/oxc/traversal.js +299 -0
- package/src/tools/oxc/traversal.js.map +1 -0
- package/src/tools/oxc/types.d.ts +20 -0
- package/src/tools/sass/rebasing-importer.d.ts +12 -18
- package/src/tools/sass/rebasing-importer.js +23 -26
- package/src/tools/sass/rebasing-importer.js.map +1 -1
- package/src/tools/sass/sass-service.d.ts +15 -38
- package/src/tools/sass/sass-service.js +132 -187
- package/src/tools/sass/sass-service.js.map +1 -1
- package/src/tools/vite/middlewares/assets-middleware.js +3 -3
- package/src/tools/vite/middlewares/assets-middleware.js.map +1 -1
- package/src/tools/vite/utils.d.ts +1 -1
- package/src/{tools/esbuild → utils/cache}/cache.d.ts +25 -8
- package/src/{tools/esbuild → utils/cache}/cache.js +72 -41
- package/src/utils/cache/cache.js.map +1 -0
- package/src/utils/cache/index.d.ts +8 -0
- package/src/utils/cache/index.js +25 -0
- package/src/utils/cache/index.js.map +1 -0
- package/src/{tools/esbuild → utils/cache}/lmdb-cache-store.js +1 -1
- package/src/{tools/esbuild → utils/cache}/lmdb-cache-store.js.map +1 -1
- package/src/{tools/esbuild → utils/cache}/sqlite-cache-store.d.ts +1 -1
- package/src/utils/cache/sqlite-cache-store.js +339 -0
- package/src/utils/cache/sqlite-cache-store.js.map +1 -0
- package/src/utils/concurrency.d.ts +30 -0
- package/src/utils/concurrency.js +81 -0
- package/src/utils/concurrency.js.map +1 -0
- package/src/utils/environment-options.d.ts +34 -0
- package/src/utils/environment-options.js +42 -12
- package/src/utils/environment-options.js.map +1 -1
- package/src/utils/hash.d.ts +24 -0
- package/src/utils/hash.js +94 -0
- package/src/utils/hash.js.map +1 -0
- package/src/utils/i18n-options.d.ts +3 -1
- package/src/utils/i18n-options.js.map +1 -1
- package/src/utils/index-file/auto-csp.d.ts +8 -0
- package/src/utils/index-file/auto-csp.js +30 -3
- package/src/utils/index-file/auto-csp.js.map +1 -1
- package/src/utils/index-file/index-html-generator.d.ts +1 -1
- package/src/utils/index-file/index-html-generator.js +9 -13
- package/src/utils/index-file/index-html-generator.js.map +1 -1
- package/src/utils/index-file/inline-critical-css.d.ts +16 -18
- package/src/utils/index-file/inline-critical-css.js +78 -179
- package/src/utils/index-file/inline-critical-css.js.map +1 -1
- package/src/utils/index-file/nonce.d.ts +2 -0
- package/src/utils/index-file/nonce.js +1 -0
- package/src/utils/index-file/nonce.js.map +1 -1
- package/src/utils/normalize-cache.js +1 -1
- package/src/utils/postcss-configuration.d.ts +6 -0
- package/src/utils/postcss-configuration.js +23 -0
- package/src/utils/postcss-configuration.js.map +1 -1
- package/src/{tools/esbuild → utils}/profiling.js +1 -1
- package/src/{tools/esbuild → utils}/profiling.js.map +1 -1
- package/src/utils/server-rendering/manifest.d.ts +2 -2
- package/src/utils/server-rendering/manifest.js +53 -4
- package/src/utils/server-rendering/manifest.js.map +1 -1
- package/src/utils/source-map.d.ts +26 -2
- package/src/utils/source-map.js +151 -53
- package/src/utils/source-map.js.map +1 -1
- package/src/utils/test-files.d.ts +2 -2
- package/src/utils/test-files.js +3 -3
- package/src/utils/test-files.js.map +1 -1
- package/src/utils/watcher.d.ts +61 -0
- package/src/utils/watcher.js +642 -0
- package/src/utils/watcher.js.map +1 -0
- package/src/tools/angular/compilation/noop-compilation.d.ts +0 -20
- package/src/tools/angular/compilation/noop-compilation.js +0 -27
- package/src/tools/angular/compilation/noop-compilation.js.map +0 -1
- package/src/tools/babel/plugins/add-code-coverage.d.ts +0 -14
- package/src/tools/babel/plugins/add-code-coverage.js +0 -44
- package/src/tools/babel/plugins/add-code-coverage.js.map +0 -1
- package/src/tools/babel/plugins/adjust-static-class-members.d.ts +0 -25
- package/src/tools/babel/plugins/adjust-static-class-members.js +0 -349
- package/src/tools/babel/plugins/adjust-static-class-members.js.map +0 -1
- package/src/tools/babel/plugins/adjust-typescript-enums.d.ts +0 -21
- package/src/tools/babel/plugins/adjust-typescript-enums.js +0 -113
- package/src/tools/babel/plugins/adjust-typescript-enums.js.map +0 -1
- package/src/tools/babel/plugins/elide-angular-metadata.d.ts +0 -23
- package/src/tools/babel/plugins/elide-angular-metadata.js +0 -110
- package/src/tools/babel/plugins/elide-angular-metadata.js.map +0 -1
- package/src/tools/babel/plugins/index.d.ts +0 -11
- package/src/tools/babel/plugins/index.js +0 -22
- package/src/tools/babel/plugins/index.js.map +0 -1
- package/src/tools/babel/plugins/oxc-transform.js.map +0 -1
- package/src/tools/babel/plugins/pure-toplevel-functions.d.ts +0 -13
- package/src/tools/babel/plugins/pure-toplevel-functions.js +0 -128
- package/src/tools/babel/plugins/pure-toplevel-functions.js.map +0 -1
- package/src/tools/babel/plugins/types.d.ts +0 -20
- package/src/tools/babel/typings.d.ts +0 -21
- package/src/tools/esbuild/cache.js.map +0 -1
- package/src/tools/esbuild/i18n-inliner-worker.d.ts +0 -81
- package/src/tools/esbuild/i18n-inliner-worker.js +0 -255
- package/src/tools/esbuild/i18n-inliner-worker.js.map +0 -1
- package/src/tools/esbuild/i18n-inliner.d.ts +0 -58
- package/src/tools/esbuild/i18n-inliner.js +0 -265
- package/src/tools/esbuild/i18n-inliner.js.map +0 -1
- package/src/tools/esbuild/index-html-generator.js.map +0 -1
- package/src/tools/esbuild/javascript-transformer-worker.js +0 -192
- package/src/tools/esbuild/javascript-transformer-worker.js.map +0 -1
- package/src/tools/esbuild/javascript-transformer.js +0 -197
- package/src/tools/esbuild/javascript-transformer.js.map +0 -1
- package/src/tools/esbuild/sqlite-cache-store.js +0 -165
- package/src/tools/esbuild/sqlite-cache-store.js.map +0 -1
- package/src/tools/esbuild/watcher.d.ts +0 -25
- package/src/tools/esbuild/watcher.js +0 -119
- package/src/tools/esbuild/watcher.js.map +0 -1
- package/src/tools/sass/worker.d.ts +0 -63
- package/src/tools/sass/worker.js +0 -202
- package/src/tools/sass/worker.js.map +0 -1
- /package/src/tools/{esbuild/angular → angular/compilation}/diagnostics.d.ts +0 -0
- /package/src/tools/{esbuild/angular → angular/compilation}/diagnostics.js +0 -0
- /package/src/tools/{esbuild/angular → angular/compilation}/diagnostics.js.map +0 -0
- /package/src/{tools/esbuild → utils/cache}/lmdb-cache-store.d.ts +0 -0
- /package/src/{tools/esbuild → utils}/profiling.d.ts +0 -0
|
@@ -0,0 +1,135 @@
|
|
|
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 __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
12
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
13
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
14
|
+
}
|
|
15
|
+
Object.defineProperty(o, k2, desc);
|
|
16
|
+
}) : (function(o, m, k, k2) {
|
|
17
|
+
if (k2 === undefined) k2 = k;
|
|
18
|
+
o[k2] = m[k];
|
|
19
|
+
}));
|
|
20
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
21
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
22
|
+
}) : function(o, v) {
|
|
23
|
+
o["default"] = v;
|
|
24
|
+
});
|
|
25
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
26
|
+
var ownKeys = function(o) {
|
|
27
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
28
|
+
var ar = [];
|
|
29
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
30
|
+
return ar;
|
|
31
|
+
};
|
|
32
|
+
return ownKeys(o);
|
|
33
|
+
};
|
|
34
|
+
return function (mod) {
|
|
35
|
+
if (mod && mod.__esModule) return mod;
|
|
36
|
+
var result = {};
|
|
37
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
38
|
+
__setModuleDefault(result, mod);
|
|
39
|
+
return result;
|
|
40
|
+
};
|
|
41
|
+
})();
|
|
42
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
43
|
+
exports.transformCompilerOptions = transformCompilerOptions;
|
|
44
|
+
const path = __importStar(require("node:path"));
|
|
45
|
+
function transformCompilerOptions(typeScript, baseCompilerOptions, overrides, tsconfig) {
|
|
46
|
+
const compilerOptions = { ...baseCompilerOptions };
|
|
47
|
+
const warnings = [];
|
|
48
|
+
if (compilerOptions.target === undefined ||
|
|
49
|
+
compilerOptions.target < typeScript.ScriptTarget.ES2022) {
|
|
50
|
+
// If 'useDefineForClassFields' is already defined in the users project leave the value as is.
|
|
51
|
+
// Otherwise fallback to false due to https://github.com/microsoft/TypeScript/issues/45995
|
|
52
|
+
// which breaks the deprecated `@Effects` NGRX decorator and potentially other existing code as well.
|
|
53
|
+
compilerOptions.target = typeScript.ScriptTarget.ES2022;
|
|
54
|
+
compilerOptions.useDefineForClassFields ??= false;
|
|
55
|
+
warnings.push({
|
|
56
|
+
text: `TypeScript compiler options 'target' and 'useDefineForClassFields' are set to 'ES2022' and ` +
|
|
57
|
+
`'false' respectively by the Angular CLI.`,
|
|
58
|
+
location: tsconfig ? { file: tsconfig } : null,
|
|
59
|
+
notes: [
|
|
60
|
+
{
|
|
61
|
+
text: 'To control ECMA version and features use the Browserslist configuration. ' +
|
|
62
|
+
'For more information, see https://angular.dev/tools/cli/build#configuring-browser-compatibility',
|
|
63
|
+
},
|
|
64
|
+
],
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
if (compilerOptions.compilationMode === 'partial') {
|
|
68
|
+
warnings.push({
|
|
69
|
+
text: 'Angular partial compilation mode is not supported when building applications.',
|
|
70
|
+
location: null,
|
|
71
|
+
notes: [{ text: 'Full compilation mode will be used instead.' }],
|
|
72
|
+
});
|
|
73
|
+
compilerOptions.compilationMode = 'full';
|
|
74
|
+
}
|
|
75
|
+
// Enable incremental compilation by default if caching is enabled and incremental is not explicitly disabled
|
|
76
|
+
if (compilerOptions.incremental !== false && overrides?.cachePath) {
|
|
77
|
+
compilerOptions.incremental = true;
|
|
78
|
+
// Set the build info file location to the configured cache directory
|
|
79
|
+
compilerOptions.tsBuildInfoFile = path.join(overrides.cachePath, '.tsbuildinfo');
|
|
80
|
+
}
|
|
81
|
+
else {
|
|
82
|
+
compilerOptions.incremental = false;
|
|
83
|
+
}
|
|
84
|
+
if (compilerOptions.module === undefined ||
|
|
85
|
+
compilerOptions.module < typeScript.ModuleKind.ES2015) {
|
|
86
|
+
compilerOptions.module = typeScript.ModuleKind.ES2022;
|
|
87
|
+
warnings.push({
|
|
88
|
+
text: `TypeScript compiler options 'module' values 'CommonJS', 'UMD', 'System' and 'AMD' are not supported.`,
|
|
89
|
+
location: null,
|
|
90
|
+
notes: [{ text: `The 'module' option will be set to 'ES2022' instead.` }],
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
if (compilerOptions.isolatedModules && compilerOptions.emitDecoratorMetadata) {
|
|
94
|
+
warnings.push({
|
|
95
|
+
text: `TypeScript compiler option 'isolatedModules' may prevent the 'emitDecoratorMetadata' option from emitting all metadata.`,
|
|
96
|
+
location: null,
|
|
97
|
+
notes: [
|
|
98
|
+
{
|
|
99
|
+
text: `The 'emitDecoratorMetadata' option is not required by Angular` +
|
|
100
|
+
'and can be removed if not explictly required by the project.',
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
// Synchronize custom resolve conditions.
|
|
106
|
+
// Set if using the supported bundler resolution mode (bundler is the default in new projects)
|
|
107
|
+
if (compilerOptions.moduleResolution === typeScript.ModuleResolutionKind.Bundler ||
|
|
108
|
+
compilerOptions.module === typeScript.ModuleKind.Preserve) {
|
|
109
|
+
compilerOptions.customConditions = overrides?.customConditions;
|
|
110
|
+
}
|
|
111
|
+
return {
|
|
112
|
+
compilerOptions: {
|
|
113
|
+
...compilerOptions,
|
|
114
|
+
noEmitOnError: false,
|
|
115
|
+
composite: false,
|
|
116
|
+
inlineSources: !!overrides?.sourcemap,
|
|
117
|
+
inlineSourceMap: !!overrides?.sourcemap,
|
|
118
|
+
sourceMap: undefined,
|
|
119
|
+
mapRoot: undefined,
|
|
120
|
+
sourceRoot: undefined,
|
|
121
|
+
preserveSymlinks: overrides?.preserveSymlinks,
|
|
122
|
+
externalRuntimeStyles: overrides?.externalRuntimeStyles,
|
|
123
|
+
_enableHmr: !!overrides?.enableHmr,
|
|
124
|
+
// TypeScript transpilation is forced if:
|
|
125
|
+
// - isolatedModules is disabled (TS needs full module types to emit JS).
|
|
126
|
+
// - Karma code coverage is active (the coverage instrumentation transformer is Babel-based
|
|
127
|
+
// and cannot parse raw TypeScript code; Vitest handles coverage instrumentation downstream).
|
|
128
|
+
_useTypeScriptTranspilation: !compilerOptions.isolatedModules || !!overrides?.instrumentForCoverage,
|
|
129
|
+
supportTestBed: !!overrides?.includeTestMetadata,
|
|
130
|
+
supportJitMode: !!overrides?.includeTestMetadata,
|
|
131
|
+
},
|
|
132
|
+
warnings,
|
|
133
|
+
};
|
|
134
|
+
}
|
|
135
|
+
//# sourceMappingURL=compiler-options.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compiler-options.js","sourceRoot":"","sources":["compiler-options.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmBH,4DA+GC;AA9HD,gDAAkC;AAelC,SAAgB,wBAAwB,CACtC,UAAqB,EACrB,mBAAuC,EACvC,SAAmC,EACnC,QAAiB;IAEjB,MAAM,eAAe,GAAG,EAAE,GAAG,mBAAmB,EAAE,CAAC;IACnD,MAAM,QAAQ,GAAqB,EAAE,CAAC;IAEtC,IACE,eAAe,CAAC,MAAM,KAAK,SAAS;QACpC,eAAe,CAAC,MAAM,GAAG,UAAU,CAAC,YAAY,CAAC,MAAM,EACvD,CAAC;QACD,8FAA8F;QAC9F,0FAA0F;QAC1F,qGAAqG;QACrG,eAAe,CAAC,MAAM,GAAG,UAAU,CAAC,YAAY,CAAC,MAAM,CAAC;QACxD,eAAe,CAAC,uBAAuB,KAAK,KAAK,CAAC;QAElD,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EACF,6FAA6F;gBAC7F,0CAA0C;YAC5C,QAAQ,EAAE,QAAQ,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC,CAAC,IAAI;YAC9C,KAAK,EAAE;gBACL;oBACE,IAAI,EACF,2EAA2E;wBAC3E,iGAAiG;iBACpG;aACF;SACF,CAAC,CAAC;IACL,CAAC;IAED,IAAI,eAAe,CAAC,eAAe,KAAK,SAAS,EAAE,CAAC;QAClD,QAAQ,CAAC,IAAI,CAAC;YACZ,IAAI,EAAE,+EAA+E;YACrF,QAAQ,EAAE,IAAI;YACd,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,6CAA6C,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,gBAAgB,CAAC;IACjE,CAAC;IAED,OAAO;QACL,eAAe,EAAE;YACf,GAAG,eAAe;YAClB,aAAa,EAAE,KAAK;YACpB,SAAS,EAAE,KAAK;YAChB,aAAa,EAAE,CAAC,CAAC,SAAS,EAAE,SAAS;YACrC,eAAe,EAAE,CAAC,CAAC,SAAS,EAAE,SAAS;YACvC,SAAS,EAAE,SAAS;YACpB,OAAO,EAAE,SAAS;YAClB,UAAU,EAAE,SAAS;YACrB,gBAAgB,EAAE,SAAS,EAAE,gBAAgB;YAC7C,qBAAqB,EAAE,SAAS,EAAE,qBAAqB;YACvD,UAAU,EAAE,CAAC,CAAC,SAAS,EAAE,SAAS;YAClC,yCAAyC;YACzC,yEAAyE;YACzE,2FAA2F;YAC3F,+FAA+F;YAC/F,2BAA2B,EACzB,CAAC,eAAe,CAAC,eAAe,IAAI,CAAC,CAAC,SAAS,EAAE,qBAAqB;YACxE,cAAc,EAAE,CAAC,CAAC,SAAS,EAAE,mBAAmB;YAChD,cAAc,EAAE,CAAC,CAAC,SAAS,EAAE,mBAAmB;SACjD;QACD,QAAQ;KACT,CAAC;AACJ,CAAC"}
|
|
@@ -6,12 +6,14 @@
|
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
8
|
import type { AngularCompilation } from './angular-compilation';
|
|
9
|
+
export type AngularCompilationMode = 'aot' | 'jit' | 'transform';
|
|
9
10
|
/**
|
|
10
11
|
* Creates an Angular compilation object that can be used to perform Angular application
|
|
11
|
-
* compilation either for AOT or
|
|
12
|
+
* compilation either for AOT, JIT, or on-demand transform mode. By default a parallel compilation is created
|
|
12
13
|
* that uses a Node.js worker thread.
|
|
13
|
-
* @param
|
|
14
|
+
* @param mode True or 'jit' for JIT mode; False or 'aot' for AOT compilation; 'transform' for on-demand transformation.
|
|
14
15
|
* @param browserOnlyBuild True, for browser only builds; False, for browser and server builds.
|
|
16
|
+
* @param parallel True to execute compilation in a worker thread.
|
|
15
17
|
* @returns An instance of an Angular compilation object.
|
|
16
18
|
*/
|
|
17
|
-
export declare function createAngularCompilation(
|
|
19
|
+
export declare function createAngularCompilation(mode: boolean | AngularCompilationMode, browserOnlyBuild: boolean, parallel?: boolean): Promise<AngularCompilation>;
|
|
@@ -44,18 +44,23 @@ exports.createAngularCompilation = createAngularCompilation;
|
|
|
44
44
|
const environment_options_1 = require("../../../utils/environment-options");
|
|
45
45
|
/**
|
|
46
46
|
* Creates an Angular compilation object that can be used to perform Angular application
|
|
47
|
-
* compilation either for AOT or
|
|
47
|
+
* compilation either for AOT, JIT, or on-demand transform mode. By default a parallel compilation is created
|
|
48
48
|
* that uses a Node.js worker thread.
|
|
49
|
-
* @param
|
|
49
|
+
* @param mode True or 'jit' for JIT mode; False or 'aot' for AOT compilation; 'transform' for on-demand transformation.
|
|
50
50
|
* @param browserOnlyBuild True, for browser only builds; False, for browser and server builds.
|
|
51
|
+
* @param parallel True to execute compilation in a worker thread.
|
|
51
52
|
* @returns An instance of an Angular compilation object.
|
|
52
53
|
*/
|
|
53
|
-
async function createAngularCompilation(
|
|
54
|
+
async function createAngularCompilation(mode, browserOnlyBuild, parallel = environment_options_1.useParallelTs) {
|
|
55
|
+
if (mode === 'transform') {
|
|
56
|
+
throw new Error('Transform compilation mode is not supported.');
|
|
57
|
+
}
|
|
58
|
+
const isJit = mode === true || mode === 'jit';
|
|
54
59
|
if (parallel) {
|
|
55
60
|
const { ParallelCompilation } = await Promise.resolve().then(() => __importStar(require('./parallel-compilation')));
|
|
56
|
-
return new ParallelCompilation(
|
|
61
|
+
return new ParallelCompilation(isJit, browserOnlyBuild);
|
|
57
62
|
}
|
|
58
|
-
if (
|
|
63
|
+
if (isJit) {
|
|
59
64
|
const { JitCompilation } = await Promise.resolve().then(() => __importStar(require('./jit-compilation')));
|
|
60
65
|
return new JitCompilation(browserOnlyBuild);
|
|
61
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"factory.js","sourceRoot":"","sources":["factory.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"factory.js","sourceRoot":"","sources":["factory.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAgBH,4DA0BC;AAxCD,4EAAmE;AAKnE;;;;;;;;GAQG;AACI,KAAK,UAAU,wBAAwB,CAC5C,IAAsC,EACtC,gBAAyB,EACzB,WAAoB,mCAAa;IAEjC,IAAI,IAAI,KAAK,WAAW,EAAE,CAAC;QACzB,MAAM,IAAI,KAAK,CAAC,8CAA8C,CAAC,CAAC;IAClE,CAAC;IAED,MAAM,KAAK,GAAG,IAAI,KAAK,IAAI,IAAI,IAAI,KAAK,KAAK,CAAC;IAE9C,IAAI,QAAQ,EAAE,CAAC;QACb,MAAM,EAAE,mBAAmB,EAAE,GAAG,wDAAa,wBAAwB,GAAC,CAAC;QAEvE,OAAO,IAAI,mBAAmB,CAAC,KAAK,EAAE,gBAAgB,CAAC,CAAC;IAC1D,CAAC;IAED,IAAI,KAAK,EAAE,CAAC;QACV,MAAM,EAAE,cAAc,EAAE,GAAG,wDAAa,mBAAmB,GAAC,CAAC;QAE7D,OAAO,IAAI,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAC9C,CAAC;SAAM,CAAC;QACN,MAAM,EAAE,cAAc,EAAE,GAAG,wDAAa,mBAAmB,GAAC,CAAC;QAE7D,OAAO,IAAI,cAAc,CAAC,gBAAgB,CAAC,CAAC;IAC9C,CAAC;AACH,CAAC"}
|
|
@@ -5,6 +5,6 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
export { AngularCompilation, DiagnosticModes } from './angular-compilation';
|
|
9
|
-
export {
|
|
10
|
-
export {
|
|
8
|
+
export { AngularCompilation, type AngularCompilationOptions, type AngularCompilationResult, DiagnosticModes, type EmitFileResult, type FileTransformResult, } from './angular-compilation';
|
|
9
|
+
export type { CompilerOptionOverrides } from './compiler-options';
|
|
10
|
+
export { createAngularCompilation, type AngularCompilationMode } from './factory';
|
|
@@ -7,12 +7,10 @@
|
|
|
7
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.createAngularCompilation = exports.DiagnosticModes = exports.AngularCompilation = void 0;
|
|
11
11
|
var angular_compilation_1 = require("./angular-compilation");
|
|
12
12
|
Object.defineProperty(exports, "AngularCompilation", { enumerable: true, get: function () { return angular_compilation_1.AngularCompilation; } });
|
|
13
13
|
Object.defineProperty(exports, "DiagnosticModes", { enumerable: true, get: function () { return angular_compilation_1.DiagnosticModes; } });
|
|
14
14
|
var factory_1 = require("./factory");
|
|
15
15
|
Object.defineProperty(exports, "createAngularCompilation", { enumerable: true, get: function () { return factory_1.createAngularCompilation; } });
|
|
16
|
-
var noop_compilation_1 = require("./noop-compilation");
|
|
17
|
-
Object.defineProperty(exports, "NoopCompilation", { enumerable: true, get: function () { return noop_compilation_1.NoopCompilation; } });
|
|
18
16
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["index.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAEH,6DAO+B;AAN7B,yHAAA,kBAAkB,OAAA;AAGlB,sHAAA,eAAe,OAAA;AAKjB,qCAAkF;AAAzE,mHAAA,wBAAwB,OAAA"}
|
|
@@ -5,19 +5,16 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
import type * as ng from '@angular/compiler-cli';
|
|
9
8
|
import ts from 'typescript';
|
|
10
9
|
import { AngularHostOptions } from '../angular-host';
|
|
11
|
-
import {
|
|
12
|
-
|
|
10
|
+
import { type AngularCompilationResult, DiagnosticModes, type EmitFileResult } from './angular-compilation';
|
|
11
|
+
import type { CompilerOptionOverrides } from './compiler-options';
|
|
12
|
+
import { TypeScriptCompilation } from './typescript-compilation';
|
|
13
|
+
export declare class JitCompilation extends TypeScriptCompilation {
|
|
13
14
|
#private;
|
|
14
15
|
private readonly browserOnlyBuild;
|
|
15
16
|
constructor(browserOnlyBuild: boolean);
|
|
16
|
-
initialize(tsconfig: string, hostOptions: AngularHostOptions,
|
|
17
|
-
|
|
18
|
-
compilerOptions: ng.CompilerOptions;
|
|
19
|
-
referencedFiles: readonly string[];
|
|
20
|
-
}>;
|
|
21
|
-
collectDiagnostics(modes: DiagnosticModes): Iterable<ts.Diagnostic>;
|
|
17
|
+
initialize(tsconfig: string, hostOptions: AngularHostOptions, compilerOptionOverrides?: CompilerOptionOverrides): Promise<AngularCompilationResult>;
|
|
18
|
+
protected collectDiagnostics(modes: DiagnosticModes): Iterable<ts.Diagnostic>;
|
|
22
19
|
emitAffectedFiles(): Iterable<EmitFileResult>;
|
|
23
20
|
}
|
|
@@ -46,12 +46,13 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
46
46
|
exports.JitCompilation = void 0;
|
|
47
47
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
48
48
|
const typescript_1 = __importDefault(require("typescript"));
|
|
49
|
-
const profiling_1 = require("
|
|
49
|
+
const profiling_1 = require("../../../utils/profiling");
|
|
50
50
|
const angular_host_1 = require("../angular-host");
|
|
51
51
|
const jit_resource_transformer_1 = require("../transformers/jit-resource-transformer");
|
|
52
52
|
const lazy_routes_transformer_1 = require("../transformers/lazy-routes-transformer");
|
|
53
53
|
const web_worker_transformer_1 = require("../transformers/web-worker-transformer");
|
|
54
54
|
const angular_compilation_1 = require("./angular-compilation");
|
|
55
|
+
const typescript_compilation_1 = require("./typescript-compilation");
|
|
55
56
|
class JitCompilationState {
|
|
56
57
|
compilerHost;
|
|
57
58
|
typeScriptProgram;
|
|
@@ -66,29 +67,30 @@ class JitCompilationState {
|
|
|
66
67
|
this.webWorkerTransform = webWorkerTransform;
|
|
67
68
|
}
|
|
68
69
|
}
|
|
69
|
-
class JitCompilation extends
|
|
70
|
+
class JitCompilation extends typescript_compilation_1.TypeScriptCompilation {
|
|
70
71
|
browserOnlyBuild;
|
|
71
72
|
#state;
|
|
72
73
|
constructor(browserOnlyBuild) {
|
|
73
74
|
super();
|
|
74
75
|
this.browserOnlyBuild = browserOnlyBuild;
|
|
75
76
|
}
|
|
76
|
-
async initialize(tsconfig, hostOptions,
|
|
77
|
+
async initialize(tsconfig, hostOptions, compilerOptionOverrides) {
|
|
77
78
|
// Dynamically load the Angular compiler CLI package
|
|
78
79
|
const { constructorParametersDownlevelTransform } = await Promise.resolve().then(() => __importStar(require('@angular/compiler-cli/private/tooling')));
|
|
79
80
|
// Load the compiler configuration and transform as needed
|
|
80
|
-
const {
|
|
81
|
-
|
|
81
|
+
const { compilerOptions, rootNames, errors: configurationDiagnostics, warnings, } = await this.loadConfiguration(tsconfig, compilerOptionOverrides);
|
|
82
|
+
if (hostOptions.modifiedFiles) {
|
|
83
|
+
this.invalidateFiles(hostOptions.modifiedFiles);
|
|
84
|
+
}
|
|
82
85
|
// Create Angular compiler host
|
|
83
|
-
const host = (0, angular_host_1.createAngularCompilerHost)(typescript_1.default, compilerOptions, hostOptions, undefined);
|
|
86
|
+
const host = (0, angular_host_1.createAngularCompilerHost)(typescript_1.default, compilerOptions, hostOptions, undefined, this.sourceFiles);
|
|
84
87
|
// Create the TypeScript Program
|
|
85
88
|
const typeScriptProgram = (0, profiling_1.profileSync)('TS_CREATE_PROGRAM', () => typescript_1.default.createEmitAndSemanticDiagnosticsBuilderProgram(rootNames, compilerOptions, host, this.#state?.typeScriptProgram ?? typescript_1.default.readBuilderProgram(compilerOptions, host), configurationDiagnostics));
|
|
86
|
-
const affectedFiles = (0, profiling_1.profileSync)('TS_FIND_AFFECTED', () => findAffectedFiles(typeScriptProgram));
|
|
87
89
|
this.#state = new JitCompilationState(host, typeScriptProgram, constructorParametersDownlevelTransform(typeScriptProgram.getProgram()), (0, jit_resource_transformer_1.createJitResourceTransformer)(() => typeScriptProgram.getProgram().getTypeChecker()), (0, web_worker_transformer_1.createWorkerTransformer)(hostOptions.processWebWorker.bind(hostOptions)));
|
|
88
90
|
const referencedFiles = typeScriptProgram
|
|
89
91
|
.getSourceFiles()
|
|
90
92
|
.map((sourceFile) => sourceFile.fileName);
|
|
91
|
-
return {
|
|
93
|
+
return { compilerOptions, referencedFiles, warnings };
|
|
92
94
|
}
|
|
93
95
|
*collectDiagnostics(modes) {
|
|
94
96
|
(0, node_assert_1.default)(this.#state, 'Compilation must be initialized prior to collecting diagnostics.');
|
|
@@ -139,12 +141,4 @@ class JitCompilation extends angular_compilation_1.AngularCompilation {
|
|
|
139
141
|
}
|
|
140
142
|
}
|
|
141
143
|
exports.JitCompilation = JitCompilation;
|
|
142
|
-
function findAffectedFiles(builder) {
|
|
143
|
-
const affectedFiles = new Set();
|
|
144
|
-
let result;
|
|
145
|
-
while ((result = builder.getSemanticDiagnosticsOfNextAffectedFile())) {
|
|
146
|
-
affectedFiles.add(result.affected);
|
|
147
|
-
}
|
|
148
|
-
return affectedFiles;
|
|
149
|
-
}
|
|
150
144
|
//# sourceMappingURL=jit-compilation.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jit-compilation.js","sourceRoot":"","sources":["jit-compilation.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAGH,8DAAiC;AACjC,4DAA4B;AAC5B,
|
|
1
|
+
{"version":3,"file":"jit-compilation.js","sourceRoot":"","sources":["jit-compilation.ts"],"names":[],"mappings":";AAAA;;;;;;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C,QAAQ,EAAE,QAAQ,EAAE,CAAC,CAAC;QACrE,CAAC,CAAC;QACF,MAAM,YAAY,GAAG;YACnB,MAAM,EAAE;gBACN,yBAAyB;gBACzB,uCAAuC;gBACvC,kBAAkB;aACnB;SACF,CAAC;QAEF,IAAI,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;YAC3B,YAAY,CAAC,MAAM,CAAC,IAAI,CAAC,IAAA,+CAAqB,EAAC,eAAe,EAAE,YAAY,CAAC,CAAC,CAAC;QACjF,CAAC;QAED,6EAA6E;QAC7E,OACE,iBAAiB,CAAC,oBAAoB,CAAC,iBAAiB,EAAE,SAAS,EAAE,SAAS,EAAE,YAAY,CAAC,EAC7F,CAAC;YACD,WAAW;QACb,CAAC;QAED,OAAO,YAAY,CAAC;IACtB,CAAC;CACF;AAnID,wCAmIC"}
|
|
@@ -5,11 +5,10 @@
|
|
|
5
5
|
* Use of this source code is governed by an MIT-style license that can be
|
|
6
6
|
* found in the LICENSE file at https://angular.dev/license
|
|
7
7
|
*/
|
|
8
|
-
import type { CompilerOptions } from '@angular/compiler-cli';
|
|
9
8
|
import type { PartialMessage } from 'esbuild';
|
|
10
|
-
import type { SourceFile } from 'typescript';
|
|
11
9
|
import type { AngularHostOptions } from '../angular-host';
|
|
12
|
-
import { AngularCompilation, DiagnosticModes, EmitFileResult } from './angular-compilation';
|
|
10
|
+
import { AngularCompilation, AngularCompilationResult, DiagnosticModes, EmitFileResult } from './angular-compilation';
|
|
11
|
+
import type { CompilerOptionOverrides } from './compiler-options';
|
|
13
12
|
/**
|
|
14
13
|
* An Angular compilation which uses a Node.js Worker thread to load and execute
|
|
15
14
|
* the TypeScript and Angular compilers. This allows for longer synchronous actions
|
|
@@ -23,17 +22,7 @@ export declare class ParallelCompilation extends AngularCompilation {
|
|
|
23
22
|
private readonly jit;
|
|
24
23
|
private readonly browserOnlyBuild;
|
|
25
24
|
constructor(jit: boolean, browserOnlyBuild: boolean);
|
|
26
|
-
initialize(tsconfig: string, hostOptions: AngularHostOptions,
|
|
27
|
-
affectedFiles: ReadonlySet<SourceFile>;
|
|
28
|
-
compilerOptions: CompilerOptions;
|
|
29
|
-
referencedFiles: readonly string[];
|
|
30
|
-
externalStylesheets?: ReadonlyMap<string, string>;
|
|
31
|
-
}>;
|
|
32
|
-
/**
|
|
33
|
-
* This is not needed with this compilation type since the worker will already send a response
|
|
34
|
-
* with the serializable esbuild compatible diagnostics.
|
|
35
|
-
*/
|
|
36
|
-
protected collectDiagnostics(): never;
|
|
25
|
+
initialize(tsconfig: string, hostOptions: AngularHostOptions, compilerOptionOverrides?: CompilerOptionOverrides): Promise<AngularCompilationResult>;
|
|
37
26
|
diagnoseFiles(modes?: DiagnosticModes): Promise<{
|
|
38
27
|
errors?: PartialMessage[];
|
|
39
28
|
warnings?: PartialMessage[];
|
|
@@ -10,8 +10,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
10
10
|
exports.ParallelCompilation = void 0;
|
|
11
11
|
const node_module_1 = require("node:module");
|
|
12
12
|
const node_worker_threads_1 = require("node:worker_threads");
|
|
13
|
+
const profiling_1 = require("../../../utils/profiling");
|
|
13
14
|
const worker_pool_1 = require("../../../utils/worker-pool");
|
|
14
|
-
const profiling_1 = require("../../esbuild/profiling");
|
|
15
15
|
const angular_compilation_1 = require("./angular-compilation");
|
|
16
16
|
/**
|
|
17
17
|
* An Angular compilation which uses a Node.js Worker thread to load and execute
|
|
@@ -25,6 +25,7 @@ class ParallelCompilation extends angular_compilation_1.AngularCompilation {
|
|
|
25
25
|
jit;
|
|
26
26
|
browserOnlyBuild;
|
|
27
27
|
#worker;
|
|
28
|
+
#webWorkerChannel;
|
|
28
29
|
constructor(jit, browserOnlyBuild) {
|
|
29
30
|
super();
|
|
30
31
|
this.jit = jit;
|
|
@@ -37,7 +38,7 @@ class ParallelCompilation extends angular_compilation_1.AngularCompilation {
|
|
|
37
38
|
filename: localRequire.resolve('./parallel-worker'),
|
|
38
39
|
});
|
|
39
40
|
}
|
|
40
|
-
initialize(tsconfig, hostOptions,
|
|
41
|
+
async initialize(tsconfig, hostOptions, compilerOptionOverrides) {
|
|
41
42
|
const stylesheetChannel = new node_worker_threads_1.MessageChannel();
|
|
42
43
|
// The request identifier is required because Angular can issue multiple concurrent requests
|
|
43
44
|
stylesheetChannel.port1.on('message', ({ requestId, data, containingFile, stylesheetFile, order, className }) => {
|
|
@@ -46,9 +47,11 @@ class ParallelCompilation extends angular_compilation_1.AngularCompilation {
|
|
|
46
47
|
.then((value) => stylesheetChannel.port1.postMessage({ requestId, value }))
|
|
47
48
|
.catch((error) => stylesheetChannel.port1.postMessage({ requestId, error }));
|
|
48
49
|
});
|
|
50
|
+
this.#webWorkerChannel?.port1.close();
|
|
49
51
|
// The web worker processing is a synchronous operation and uses shared memory combined with
|
|
50
52
|
// the Atomics API to block execution here until a response is received.
|
|
51
53
|
const webWorkerChannel = new node_worker_threads_1.MessageChannel();
|
|
54
|
+
this.#webWorkerChannel = webWorkerChannel;
|
|
52
55
|
const webWorkerSignal = new Int32Array(new SharedArrayBuffer(4));
|
|
53
56
|
webWorkerChannel.port1.on('message', ({ workerFile, containingFile }) => {
|
|
54
57
|
try {
|
|
@@ -63,45 +66,32 @@ class ParallelCompilation extends angular_compilation_1.AngularCompilation {
|
|
|
63
66
|
Atomics.notify(webWorkerSignal, 0);
|
|
64
67
|
}
|
|
65
68
|
});
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
webWorkerChannel.
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
69
|
+
let success = false;
|
|
70
|
+
try {
|
|
71
|
+
// Execute the initialize function in the worker thread
|
|
72
|
+
const result = await this.#worker.run({
|
|
73
|
+
fileReplacements: hostOptions.fileReplacements,
|
|
74
|
+
tsconfig,
|
|
75
|
+
jit: this.jit,
|
|
76
|
+
browserOnlyBuild: this.browserOnlyBuild,
|
|
77
|
+
compilerOptionOverrides,
|
|
78
|
+
stylesheetPort: stylesheetChannel.port2,
|
|
79
|
+
webWorkerPort: webWorkerChannel.port2,
|
|
80
|
+
webWorkerSignal,
|
|
81
|
+
}, {
|
|
82
|
+
name: 'initialize',
|
|
83
|
+
transferList: [stylesheetChannel.port2, webWorkerChannel.port2],
|
|
84
|
+
});
|
|
85
|
+
success = true;
|
|
86
|
+
return result;
|
|
87
|
+
}
|
|
88
|
+
finally {
|
|
89
|
+
stylesheetChannel.port1.close();
|
|
90
|
+
if (!success) {
|
|
91
|
+
this.#webWorkerChannel?.port1.close();
|
|
92
|
+
this.#webWorkerChannel = undefined;
|
|
81
93
|
}
|
|
82
|
-
}
|
|
83
|
-
// Execute the initialize function in the worker thread
|
|
84
|
-
return this.#worker.run({
|
|
85
|
-
fileReplacements: hostOptions.fileReplacements,
|
|
86
|
-
tsconfig,
|
|
87
|
-
jit: this.jit,
|
|
88
|
-
browserOnlyBuild: this.browserOnlyBuild,
|
|
89
|
-
stylesheetPort: stylesheetChannel.port2,
|
|
90
|
-
optionsPort: optionsChannel.port2,
|
|
91
|
-
optionsSignal,
|
|
92
|
-
webWorkerPort: webWorkerChannel.port2,
|
|
93
|
-
webWorkerSignal,
|
|
94
|
-
}, {
|
|
95
|
-
name: 'initialize',
|
|
96
|
-
transferList: [stylesheetChannel.port2, optionsChannel.port2, webWorkerChannel.port2],
|
|
97
|
-
});
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* This is not needed with this compilation type since the worker will already send a response
|
|
101
|
-
* with the serializable esbuild compatible diagnostics.
|
|
102
|
-
*/
|
|
103
|
-
collectDiagnostics() {
|
|
104
|
-
throw new Error('Not implemented in ParallelCompilation.');
|
|
94
|
+
}
|
|
105
95
|
}
|
|
106
96
|
async diagnoseFiles(modes = angular_compilation_1.DiagnosticModes.All) {
|
|
107
97
|
const { timings, ...result } = await this.#worker.run(modes, { name: 'diagnose' });
|
|
@@ -110,13 +100,21 @@ class ParallelCompilation extends angular_compilation_1.AngularCompilation {
|
|
|
110
100
|
}
|
|
111
101
|
return result;
|
|
112
102
|
}
|
|
113
|
-
emitAffectedFiles() {
|
|
114
|
-
|
|
103
|
+
async emitAffectedFiles() {
|
|
104
|
+
try {
|
|
105
|
+
return await this.#worker.run(undefined, { name: 'emit' });
|
|
106
|
+
}
|
|
107
|
+
finally {
|
|
108
|
+
this.#webWorkerChannel?.port1.close();
|
|
109
|
+
this.#webWorkerChannel = undefined;
|
|
110
|
+
}
|
|
115
111
|
}
|
|
116
112
|
update(files) {
|
|
117
113
|
return this.#worker.run(files, { name: 'update' });
|
|
118
114
|
}
|
|
119
115
|
close() {
|
|
116
|
+
this.#webWorkerChannel?.port1.close();
|
|
117
|
+
this.#webWorkerChannel = undefined;
|
|
120
118
|
return this.#worker.destroy();
|
|
121
119
|
}
|
|
122
120
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parallel-compilation.js","sourceRoot":"","sources":["parallel-compilation.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;
|
|
1
|
+
{"version":3,"file":"parallel-compilation.js","sourceRoot":"","sources":["parallel-compilation.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;AAGH,6CAA4C;AAC5C,6DAAqD;AACrD,wDAAoE;AACpE,4DAAwD;AAExD,+DAK+B;AAG/B;;;;;;;GAOG;AACH,MAAa,mBAAoB,SAAQ,wCAAkB;IAKtC;IACA;IALV,OAAO,CAAa;IAC7B,iBAAiB,CAAkB;IAEnC,YACmB,GAAY,EACZ,gBAAyB;QAE1C,KAAK,EAAE,CAAC;QAHS,QAAG,GAAH,GAAG,CAAS;QACZ,qBAAgB,GAAhB,gBAAgB,CAAS;QAI1C,2DAA2D;QAC3D,MAAM,YAAY,GAAG,IAAA,2BAAa,EAAC,UAAU,CAAC,CAAC;QAE/C,IAAI,CAAC,OAAO,GAAG,IAAI,wBAAU,CAAC;YA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C;QACH,CAAC;IACH,CAAC;IAEQ,KAAK,CAAC,aAAa,CAC1B,KAAK,GAAG,qCAAe,CAAC,GAAG;QAE3B,MAAM,EAAE,OAAO,EAAE,GAAG,MAAM,EAAE,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,UAAU,EAAE,CAAC,CAAC;QACnF,IAAI,OAAO,EAAE,CAAC;YACZ,IAAA,oCAAwB,EAAC,OAAO,CAAC,CAAC;QACpC,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;IAEQ,KAAK,CAAC,iBAAiB;QAC9B,IAAI,CAAC;YACH,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,SAAS,EAAE,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;QAC7D,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,iBAAiB,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;YACtC,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;QACrC,CAAC;IACH,CAAC;IAEQ,MAAM,CAAC,KAAkB;QAChC,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,KAAK,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE,CAAC,CAAC;IACrD,CAAC;IAEQ,KAAK;QACZ,IAAI,CAAC,iBAAiB,EAAE,KAAK,CAAC,KAAK,EAAE,CAAC;QACtC,IAAI,CAAC,iBAAiB,GAAG,SAAS,CAAC;QAEnC,OAAO,IAAI,CAAC,OAAO,CAAC,OAAO,EAAE,CAAC;IAChC,CAAC;CACF;AArHD,kDAqHC"}
|
|
@@ -7,35 +7,23 @@
|
|
|
7
7
|
*/
|
|
8
8
|
import type { PartialMessage } from 'esbuild';
|
|
9
9
|
import { type MessagePort } from 'node:worker_threads';
|
|
10
|
-
import type { DiagnosticModes } from './angular-compilation';
|
|
10
|
+
import type { AngularCompilationResult, DiagnosticModes } from './angular-compilation';
|
|
11
|
+
import type { CompilerOptionOverrides } from './compiler-options';
|
|
11
12
|
export interface InitRequest {
|
|
12
13
|
jit: boolean;
|
|
13
14
|
browserOnlyBuild: boolean;
|
|
14
15
|
tsconfig: string;
|
|
15
16
|
fileReplacements?: Record<string, string>;
|
|
17
|
+
compilerOptionOverrides?: CompilerOptionOverrides;
|
|
16
18
|
stylesheetPort: MessagePort;
|
|
17
|
-
optionsPort: MessagePort;
|
|
18
|
-
optionsSignal: Int32Array;
|
|
19
19
|
webWorkerPort: MessagePort;
|
|
20
20
|
webWorkerSignal: Int32Array;
|
|
21
21
|
}
|
|
22
|
-
export declare function initialize(request: InitRequest): Promise<
|
|
23
|
-
externalStylesheets: ReadonlyMap<string, string> | undefined;
|
|
24
|
-
templateUpdates: ReadonlyMap<string, string> | undefined;
|
|
25
|
-
referencedFiles: readonly string[];
|
|
26
|
-
compilerOptions: {
|
|
27
|
-
allowJs: boolean | undefined;
|
|
28
|
-
isolatedModules: boolean | undefined;
|
|
29
|
-
sourceMap: boolean | undefined;
|
|
30
|
-
inlineSourceMap: boolean | undefined;
|
|
31
|
-
_useTypeScriptTranspilation: boolean | undefined;
|
|
32
|
-
};
|
|
33
|
-
componentResourcesDependencies: ReadonlyMap<string, readonly string[]> | undefined;
|
|
34
|
-
}>;
|
|
22
|
+
export declare function initialize(request: InitRequest): Promise<AngularCompilationResult>;
|
|
35
23
|
export declare function diagnose(modes: DiagnosticModes): Promise<{
|
|
36
24
|
errors?: PartialMessage[];
|
|
37
25
|
warnings?: PartialMessage[];
|
|
38
26
|
timings?: Record<string, number[]>;
|
|
39
27
|
}>;
|
|
40
28
|
export declare function emit(): Promise<import("./angular-compilation").EmitFileResult[]>;
|
|
41
|
-
export declare function update(files: Set<string>): void
|
|
29
|
+
export declare function update(files: Set<string>): Promise<void>;
|