@angular/build 22.3.0-next.1 → 22.3.0-next.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +13 -13
- package/src/builders/application/build-action.js +2 -2
- package/src/builders/application/build-action.js.map +1 -1
- package/src/builders/application/index.js +8 -31
- package/src/builders/application/index.js.map +1 -1
- package/src/builders/application/options.d.ts +1 -3
- package/src/builders/application/options.js +1 -1
- package/src/builders/application/options.js.map +1 -1
- package/src/builders/application/results.d.ts +1 -1
- package/src/builders/dev-server/vite/utils.js +1 -1
- package/src/builders/dev-server/vite/utils.js.map +1 -1
- package/src/builders/extract-i18n/application-extraction.js +2 -1
- package/src/builders/extract-i18n/application-extraction.js.map +1 -1
- package/src/builders/karma/assets-middleware.js +1 -1
- package/src/builders/karma/assets-middleware.js.map +1 -1
- package/src/builders/library/builder-state.d.ts +115 -0
- package/src/builders/library/builder-state.js +282 -0
- package/src/builders/library/builder-state.js.map +1 -0
- package/src/builders/library/builder.js +101 -89
- package/src/builders/library/builder.js.map +1 -1
- package/src/builders/library/execution-result.d.ts +35 -0
- package/src/builders/library/execution-result.js +67 -0
- package/src/builders/library/execution-result.js.map +1 -0
- package/src/builders/library/index.d.ts +1 -1
- package/src/builders/library/index.js.map +1 -1
- package/src/builders/library/options.d.ts +9 -0
- package/src/builders/library/options.js +29 -14
- package/src/builders/library/options.js.map +1 -1
- package/src/builders/library/pipeline/assets.d.ts +3 -3
- package/src/builders/library/pipeline/assets.js +12 -16
- package/src/builders/library/pipeline/assets.js.map +1 -1
- package/src/builders/library/pipeline/build-action.d.ts +11 -24
- package/src/builders/library/pipeline/build-action.js +76 -125
- package/src/builders/library/pipeline/build-action.js.map +1 -1
- package/src/builders/library/pipeline/bundler.d.ts +3 -3
- package/src/builders/library/pipeline/bundler.js +55 -33
- package/src/builders/library/pipeline/bundler.js.map +1 -1
- package/src/builders/library/pipeline/compilation.d.ts +7 -26
- package/src/builders/library/pipeline/compilation.js +59 -69
- package/src/builders/library/pipeline/compilation.js.map +1 -1
- package/src/builders/library/pipeline/entry-points.d.ts +26 -6
- package/src/builders/library/pipeline/entry-points.js +82 -21
- package/src/builders/library/pipeline/entry-points.js.map +1 -1
- package/src/builders/library/pipeline/package-manifests.d.ts +2 -1
- package/src/builders/library/pipeline/package-manifests.js +50 -1
- package/src/builders/library/pipeline/package-manifests.js.map +1 -1
- package/src/builders/library/pipeline/stylesheet-bundler.d.ts +4 -1
- package/src/builders/library/pipeline/stylesheet-bundler.js +1 -1
- package/src/builders/library/pipeline/stylesheet-bundler.js.map +1 -1
- package/src/builders/library/pipeline/utils.d.ts +19 -11
- package/src/builders/library/pipeline/utils.js +27 -11
- package/src/builders/library/pipeline/utils.js.map +1 -1
- package/src/builders/library/schema.json +2 -4
- package/src/builders/library/types.d.ts +62 -22
- package/src/builders/unit-test/runners/vitest/executor.js +0 -5
- package/src/builders/unit-test/runners/vitest/executor.js.map +1 -1
- package/src/builders/unit-test/runners/vitest/plugins.js +13 -1
- package/src/builders/unit-test/runners/vitest/plugins.js.map +1 -1
- package/src/builders/unit-test/test-discovery.js +4 -2
- package/src/builders/unit-test/test-discovery.js.map +1 -1
- package/src/private.d.ts +1 -1
- package/src/private.js +3 -3
- package/src/private.js.map +1 -1
- package/src/tools/angular/angular-host.d.ts +1 -1
- package/src/tools/angular/angular-host.js +5 -2
- package/src/tools/angular/angular-host.js.map +1 -1
- package/src/tools/angular/compilation/angular-compilation.d.ts +1 -0
- package/src/tools/angular/compilation/angular-compilation.js.map +1 -1
- package/src/tools/angular/compilation/aot-compilation.js +325 -80
- package/src/tools/angular/compilation/aot-compilation.js.map +1 -1
- package/src/tools/angular/compilation/compiler-options.js +4 -1
- package/src/tools/angular/compilation/compiler-options.js.map +1 -1
- package/src/tools/angular/compilation/jit-compilation.js +5 -4
- package/src/tools/angular/compilation/jit-compilation.js.map +1 -1
- package/src/tools/angular/compilation/parallel-worker.js +1 -0
- package/src/tools/angular/compilation/parallel-worker.js.map +1 -1
- package/src/tools/angular/compilation/typescript-compilation.d.ts +2 -0
- package/src/tools/angular/compilation/typescript-compilation.js +44 -5
- package/src/tools/angular/compilation/typescript-compilation.js.map +1 -1
- package/src/tools/esbuild/bundler-context.js +5 -1
- package/src/tools/esbuild/bundler-context.js.map +1 -1
- package/src/tools/esbuild/persistent-load-result-cache.js +2 -4
- package/src/tools/esbuild/persistent-load-result-cache.js.map +1 -1
- package/src/tools/esbuild/utils.d.ts +1 -2
- package/src/tools/esbuild/utils.js +0 -13
- package/src/tools/esbuild/utils.js.map +1 -1
- package/src/tools/sass/rebasing-importer.d.ts +1 -1
- package/src/tools/sass/rebasing-importer.js +6 -3
- package/src/tools/sass/rebasing-importer.js.map +1 -1
- package/src/tools/vite/middlewares/assets-middleware.js +1 -1
- package/src/tools/vite/middlewares/assets-middleware.js.map +1 -1
- package/src/utils/concurrency.d.ts +4 -0
- package/src/utils/concurrency.js +5 -0
- package/src/utils/concurrency.js.map +1 -1
- package/src/utils/delete-output-dir.js +3 -2
- package/src/utils/delete-output-dir.js.map +1 -1
- package/src/utils/disk-files.d.ts +30 -0
- package/src/utils/disk-files.js +68 -0
- package/src/utils/disk-files.js.map +1 -0
- package/src/utils/index-file/nonce.d.ts +2 -1
- package/src/utils/index-file/nonce.js +22 -4
- package/src/utils/index-file/nonce.js.map +1 -1
- package/src/utils/normalize-asset-patterns.d.ts +18 -3
- package/src/utils/normalize-asset-patterns.js +34 -67
- package/src/utils/normalize-asset-patterns.js.map +1 -1
- package/src/utils/normalize-cache.js +2 -2
- package/src/utils/normalize-cache.js.map +1 -1
- package/src/utils/postcss-configuration.d.ts +2 -2
- package/src/utils/postcss-configuration.js +3 -3
- package/src/utils/postcss-configuration.js.map +1 -1
- package/src/utils/resolve-assets.js +28 -9
- package/src/utils/resolve-assets.js.map +1 -1
- package/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.d.ts +1 -1
- package/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.js +3 -3
- package/src/utils/server-rendering/esm-in-memory-loader/loader-hooks.js.map +1 -1
- package/src/utils/server-rendering/esm-in-memory-loader/register-hooks.js +3 -2
- package/src/utils/server-rendering/esm-in-memory-loader/register-hooks.js.map +1 -1
- package/src/utils/test-files.js +5 -57
- package/src/utils/test-files.js.map +1 -1
- package/src/utils/watcher.d.ts +53 -0
- package/src/utils/watcher.js +404 -76
- package/src/utils/watcher.js.map +1 -1
- package/src/builders/library/pipeline/types.d.ts +0 -54
|
@@ -12,32 +12,51 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
12
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
13
|
exports.DEFAULT_ASSET_IGNORE = void 0;
|
|
14
14
|
exports.resolveAssets = resolveAssets;
|
|
15
|
+
const promises_1 = require("node:fs/promises");
|
|
15
16
|
const node_path_1 = __importDefault(require("node:path"));
|
|
16
17
|
const tinyglobby_1 = require("tinyglobby");
|
|
18
|
+
const concurrency_1 = require("./concurrency");
|
|
17
19
|
const path_1 = require("./path");
|
|
18
20
|
/**
|
|
19
21
|
* Default glob ignore patterns for assets.
|
|
20
22
|
*/
|
|
21
23
|
exports.DEFAULT_ASSET_IGNORE = ['.gitkeep', '**/.DS_Store', '**/Thumbs.db'];
|
|
22
24
|
async function resolveAssets(entries, root) {
|
|
23
|
-
const
|
|
24
|
-
for (const entry of entries) {
|
|
25
|
+
const resolvedEntries = await (0, concurrency_1.mapConcurrent)(entries, concurrency_1.MAX_CONCURRENT_READS, async (entry) => {
|
|
25
26
|
if (!(0, path_1.isSubDirectory)(root, entry.input)) {
|
|
26
27
|
throw new Error(`The ${entry.input} asset path must be within the workspace root.`);
|
|
27
28
|
}
|
|
28
29
|
const cwd = node_path_1.default.resolve(root, entry.input);
|
|
30
|
+
if (!entry.ignore?.length && !(0, tinyglobby_1.isDynamicPattern)(entry.glob)) {
|
|
31
|
+
const src = node_path_1.default.join(cwd, entry.glob);
|
|
32
|
+
if ((0, path_1.isSubDirectory)(cwd, src)) {
|
|
33
|
+
try {
|
|
34
|
+
const stats = await (entry.followSymlinks ? (0, promises_1.stat)(src) : (0, promises_1.lstat)(src));
|
|
35
|
+
if (stats.isFile()) {
|
|
36
|
+
const filePath = entry.flatten ? node_path_1.default.basename(entry.glob) : entry.glob;
|
|
37
|
+
return [{ source: src, destination: node_path_1.default.join(entry.output, filePath) }];
|
|
38
|
+
}
|
|
39
|
+
if (!stats.isSymbolicLink()) {
|
|
40
|
+
return [];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch {
|
|
44
|
+
// File does not exist or cannot be accessed.
|
|
45
|
+
return [];
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
}
|
|
29
49
|
const files = await (0, tinyglobby_1.glob)(entry.glob, {
|
|
30
50
|
cwd,
|
|
31
51
|
dot: true,
|
|
32
52
|
ignore: entry.ignore ? [...exports.DEFAULT_ASSET_IGNORE, ...entry.ignore] : exports.DEFAULT_ASSET_IGNORE,
|
|
33
53
|
followSymbolicLinks: entry.followSymlinks ?? false,
|
|
34
54
|
});
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
return outputFiles;
|
|
55
|
+
return files.map((file) => ({
|
|
56
|
+
source: node_path_1.default.join(cwd, file),
|
|
57
|
+
destination: node_path_1.default.join(entry.output, entry.flatten ? node_path_1.default.basename(file) : file),
|
|
58
|
+
}));
|
|
59
|
+
});
|
|
60
|
+
return resolvedEntries.flat();
|
|
42
61
|
}
|
|
43
62
|
//# sourceMappingURL=resolve-assets.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolve-assets.js","sourceRoot":"","sources":["resolve-assets.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;
|
|
1
|
+
{"version":3,"file":"resolve-assets.js","sourceRoot":"","sources":["resolve-assets.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;;AAaH,sCAqDC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C,IAAI,CAAC;wBAExE,OAAO,CAAC,EAAE,MAAM,EAAE,GAAG,EAAE,WAAW,EAAE,mBAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,QAAQ,CAAC,EAAE,CAAC,CAAC;oBAC3E,CAAC;oBAED,IAAI,CAAC,KAAK,CAAC,cAAc,EAAE,EAAE,CAAC;wBAC5B,OAAO,EAAE,CAAC;oBACZ,CAAC;gBACH,CAAC;gBAAC,MAAM,CAAC;oBACP,6CAA6C;oBAC7C,OAAO,EAAE,CAAC;gBACZ,CAAC;YACH,CAAC;QACH,CAAC;QAED,MAAM,KAAK,GAAG,MAAM,IAAA,iBAAI,EAAC,KAAK,CAAC,IAAI,EAAE;YACnC,GAAG;YACH,GAAG,EAAE,IAAI;YACT,MAAM,EAAE,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,GAAG,4BAAoB,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,4BAAoB;YACxF,mBAAmB,EAAE,KAAK,CAAC,cAAc,IAAI,KAAK;SACnD,CAAC,CAAC;QAEH,OAAO,KAAK,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;YAC1B,MAAM,EAAE,mBAAI,CAAC,IAAI,CAAC,GAAG,EAAE,IAAI,CAAC;YAC5B,WAAW,EAAE,mBAAI,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,mBAAI,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;SACjF,CAAC,CAAC,CAAC;IACN,CAAC,CAAC,CAAC;IAEH,OAAO,eAAe,CAAC,IAAI,EAAE,CAAC;AAChC,CAAC"}
|
|
@@ -15,7 +15,7 @@ exports.resolve = resolve;
|
|
|
15
15
|
exports.load = load;
|
|
16
16
|
const node_assert_1 = __importDefault(require("node:assert"));
|
|
17
17
|
const node_crypto_1 = require("node:crypto");
|
|
18
|
-
const
|
|
18
|
+
const node_fs_1 = require("node:fs");
|
|
19
19
|
const node_path_1 = require("node:path");
|
|
20
20
|
const node_url_1 = require("node:url");
|
|
21
21
|
/**
|
|
@@ -89,7 +89,7 @@ function resolve(specifier, context, nextResolve) {
|
|
|
89
89
|
parentURL: new URL('index.js', memoryVirtualRootUrl).href,
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
|
-
|
|
92
|
+
function load(url, context, nextLoad) {
|
|
93
93
|
const { format } = context;
|
|
94
94
|
// Load the file from memory if the URL is based in the virtual root
|
|
95
95
|
if (url.startsWith(memoryVirtualRootUrl)) {
|
|
@@ -111,7 +111,7 @@ async function load(url, context, nextLoad) {
|
|
|
111
111
|
return nextLoad(url, context);
|
|
112
112
|
}
|
|
113
113
|
const filePath = (0, node_url_1.fileURLToPath)(url);
|
|
114
|
-
const fileBytes =
|
|
114
|
+
const fileBytes = (0, node_fs_1.readFileSync)(filePath);
|
|
115
115
|
const source = Buffer.concat([NG_SERVER_MODE_INIT_BYTES, fileBytes]);
|
|
116
116
|
return {
|
|
117
117
|
format,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"loader-hooks.js","sourceRoot":"","sources":["loader-hooks.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;AA6BH,gCAUC;AAED,0BA+DC;AAED,oBAuCC;AA/ID,8DAAiC;AACjC,6CAAyC;AACzC
|
|
1
|
+
{"version":3,"file":"loader-hooks.js","sourceRoot":"","sources":["loader-hooks.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;AA6BH,gCAUC;AAED,0BA+DC;AAED,oBAuCC;AA/ID,8DAAiC;AACjC,6CAAyC;AACzC,qCAAuC;AACvC,yCAAiC;AACjC,uCAAwD;AAExD;;GAEG;AACH,MAAM,yBAAyB,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,wBAAwB,CAAC,CAAC;AACrF,MAAM,YAAY,GAAG,IAAI,WAAW,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AC,CAAC,CAAC;QACtE,IAAA,qBAAM,EAAC,SAAS,KAAK,SAAS,EAAE,mDAAmD,GAAG,GAAG,CAAC,CAAC;QAE3F,MAAM,MAAM,GAAG,OAAO,SAAS,KAAK,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,YAAY,CAAC,MAAM,CAAC,SAAS,CAAC,CAAC;QAE1F,6FAA6F;QAC7F,OAAO;YACL,MAAM,EAAE,MAAM,IAAI,QAAQ;YAC1B,YAAY,EAAE,IAAI;YAClB,MAAM;SACP,CAAC;IACJ,CAAC;IAED,qFAAqF;IACrF,6BAA6B;IAC7B,IAAI,MAAM,KAAK,QAAQ,IAAI,cAAc,CAAC,GAAG,CAAC,EAAE,CAAC;QAC/C,iGAAiG;QACjG,IAAI,CAAC,GAAG,CAAC,QAAQ,CAAC,YAAY,CAAC,EAAE,CAAC;YAChC,OAAO,QAAQ,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;QAChC,CAAC;QAED,MAAM,QAAQ,GAAG,IAAA,wBAAa,EAAC,GAAG,CAAC,CAAC;QACpC,MAAM,SAAS,GAAG,IAAA,sBAAY,EAAC,QAAQ,CAAC,CAAC;QACzC,MAAM,MAAM,GAAG,MAAM,CAAC,MAAM,CAAC,CAAC,yBAAyB,EAAE,SAAS,CAAC,CAAC,CAAC;QAErE,OAAO;YACL,MAAM;YACN,YAAY,EAAE,IAAI;YAClB,MAAM;SACP,CAAC;IACJ,CAAC;IAED,qCAAqC;IACrC,OAAO,QAAQ,CAAC,GAAG,CAAC,CAAC;AACvB,CAAC;AAED,SAAS,cAAc,CAAC,GAAW;IACjC,OAAO,GAAG,CAAC,UAAU,CAAC,SAAS,CAAC,CAAC;AACnC,CAAC"}
|
|
@@ -8,7 +8,8 @@
|
|
|
8
8
|
*/
|
|
9
9
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
10
10
|
const node_module_1 = require("node:module");
|
|
11
|
-
const node_url_1 = require("node:url");
|
|
12
11
|
const node_worker_threads_1 = require("node:worker_threads");
|
|
13
|
-
|
|
12
|
+
const loader_hooks_1 = require("./loader-hooks");
|
|
13
|
+
(0, loader_hooks_1.initialize)(node_worker_threads_1.workerData);
|
|
14
|
+
(0, node_module_1.registerHooks)({ resolve: loader_hooks_1.resolve, load: loader_hooks_1.load });
|
|
14
15
|
//# sourceMappingURL=register-hooks.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"register-hooks.js","sourceRoot":"","sources":["register-hooks.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH,
|
|
1
|
+
{"version":3,"file":"register-hooks.js","sourceRoot":"","sources":["register-hooks.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AAEH,6CAA4C;AAC5C,6DAAiD;AACjD,iDAA2D;AAE3D,IAAA,yBAAU,EAAC,gCAAU,CAAC,CAAC;AACvB,IAAA,2BAAa,EAAC,EAAE,OAAO,EAAP,sBAAO,EAAE,IAAI,EAAJ,mBAAI,EAAE,CAAC,CAAC"}
|
package/src/utils/test-files.js
CHANGED
|
@@ -6,48 +6,14 @@
|
|
|
6
6
|
* Use of this source code is governed by an MIT-style license that can be
|
|
7
7
|
* found in the LICENSE file at https://angular.dev/license
|
|
8
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
9
|
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
43
10
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
44
11
|
};
|
|
45
12
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
46
13
|
exports.writeTestFiles = writeTestFiles;
|
|
47
|
-
const fs = __importStar(require("node:fs/promises"));
|
|
48
14
|
const node_path_1 = __importDefault(require("node:path"));
|
|
49
15
|
const bundler_files_1 = require("../tools/esbuild/bundler-files");
|
|
50
|
-
const
|
|
16
|
+
const disk_files_1 = require("./disk-files");
|
|
51
17
|
/**
|
|
52
18
|
* Writes a collection of build result files to a specified directory.
|
|
53
19
|
* This function handles both in-memory and on-disk files, creating subdirectories
|
|
@@ -56,28 +22,10 @@ const utils_1 = require("../tools/esbuild/utils");
|
|
|
56
22
|
* @param files A collection of `ResultFile` objects, representing the build output.
|
|
57
23
|
* @param testDir The absolute path to the directory where the files should be written.
|
|
58
24
|
*/
|
|
59
|
-
|
|
60
|
-
const directoryExists = new Set();
|
|
25
|
+
function writeTestFiles(files, testDir) {
|
|
61
26
|
// Writes the test related output files to disk and ensures the containing directories are present
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
}
|
|
66
|
-
const fullFilePath = node_path_1.default.join(testDir, file.path);
|
|
67
|
-
// Ensure output subdirectories exist
|
|
68
|
-
const fileBasePath = node_path_1.default.dirname(fullFilePath);
|
|
69
|
-
if (fileBasePath && !directoryExists.has(fileBasePath)) {
|
|
70
|
-
await fs.mkdir(fileBasePath, { recursive: true });
|
|
71
|
-
directoryExists.add(fileBasePath);
|
|
72
|
-
}
|
|
73
|
-
if (file.origin === 'memory') {
|
|
74
|
-
// Write file contents
|
|
75
|
-
await fs.writeFile(fullFilePath, file.contents);
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
// Copy file contents
|
|
79
|
-
await fs.copyFile(file.inputPath, fullFilePath, fs.constants.COPYFILE_FICLONE);
|
|
80
|
-
}
|
|
81
|
-
});
|
|
27
|
+
return (0, disk_files_1.emitFilesToDisk)(files, (file) => file.type === bundler_files_1.BuildOutputFileType.Browser || file.type === bundler_files_1.BuildOutputFileType.Media
|
|
28
|
+
? node_path_1.default.join(testDir, file.path)
|
|
29
|
+
: undefined);
|
|
82
30
|
}
|
|
83
31
|
//# sourceMappingURL=test-files.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"test-files.js","sourceRoot":"","sources":["test-files.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG
|
|
1
|
+
{"version":3,"file":"test-files.js","sourceRoot":"","sources":["test-files.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;AAeH,wCAOC;AApBD,0DAA6B;AAE7B,kEAAqE;AACrE,6CAA+C;AAE/C;;;;;;;GAOG;AACH,SAAgB,cAAc,CAAC,KAA4B,EAAE,OAAe;IAC1E,kGAAkG;IAClG,OAAO,IAAA,4BAAe,EAAC,KAAK,EAAE,CAAC,IAAI,EAAE,EAAE,CACrC,IAAI,CAAC,IAAI,KAAK,mCAAmB,CAAC,OAAO,IAAI,IAAI,CAAC,IAAI,KAAK,mCAAmB,CAAC,KAAK;QAClF,CAAC,CAAC,mBAAI,CAAC,IAAI,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC;QAC/B,CAAC,CAAC,SAAS,CACd,CAAC;AACJ,CAAC"}
|
package/src/utils/watcher.d.ts
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
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 ParcelWatcher from '@parcel/watcher';
|
|
8
9
|
export declare class ChangedFiles {
|
|
9
10
|
readonly added: Set<string>;
|
|
10
11
|
readonly modified: Set<string>;
|
|
@@ -66,3 +67,55 @@ export declare function isPathInside(file: string, dir: string): boolean;
|
|
|
66
67
|
* - `posixPath` must be a normalized POSIX-style path (using forward slashes '/').
|
|
67
68
|
*/
|
|
68
69
|
export declare function extractNodeModulesPackageDir(posixPath: string): string | undefined;
|
|
70
|
+
/**
|
|
71
|
+
* Manages `@parcel/watcher` directory subscriptions for watched files located outside the
|
|
72
|
+
* primary `workspaceRoot`.
|
|
73
|
+
*
|
|
74
|
+
* Because `@parcel/watcher` watches directories recursively and macOS limits each process to
|
|
75
|
+
* ~512 concurrent `FSEvents` streams, this manager:
|
|
76
|
+
* - Normalizes external `node_modules` file paths to their package root directory.
|
|
77
|
+
* - Batches synchronous `watchFile` and `removeFile` calls within a microtask before subscribing.
|
|
78
|
+
* - Uses a directory prefix tree to subsume nested child directories and iteratively coalesce
|
|
79
|
+
* deepest branching subdirectories into common ancestors when the subscription budget is exceeded.
|
|
80
|
+
* - Dynamically lowers its subscription budget and coalesces further if `subscribe()` fails on
|
|
81
|
+
* an existing directory due to OS stream limits.
|
|
82
|
+
*/
|
|
83
|
+
export declare class ParcelExternalManager {
|
|
84
|
+
#private;
|
|
85
|
+
/**
|
|
86
|
+
* Creates a new external directory subscription manager for `@parcel/watcher`.
|
|
87
|
+
*
|
|
88
|
+
* @param parcelWatcher The `@parcel/watcher` module.
|
|
89
|
+
* @param options Watcher configuration options.
|
|
90
|
+
* @param rootDirPosix Normalized POSIX path of the primary workspace root.
|
|
91
|
+
* @param rootDirLookupKey Case-normalized lookup key of the primary workspace root.
|
|
92
|
+
* @param isCaseSensitive Whether the filesystem at the workspace root is case-sensitive.
|
|
93
|
+
* @param handleEvents Callback to process incoming `@parcel/watcher` events.
|
|
94
|
+
* @param maxSubscriptions Maximum number of concurrent external directory subscriptions before coalescing.
|
|
95
|
+
*/
|
|
96
|
+
constructor(parcelWatcher: typeof ParcelWatcher, options: WatcherOptions | undefined, rootDirPosix: string, rootDirLookupKey: string, isCaseSensitive: boolean, handleEvents: (events: ParcelWatcher.Event[]) => void, maxSubscriptions?: number);
|
|
97
|
+
/**
|
|
98
|
+
* Registers a file path to be watched if it resides outside the primary workspace root,
|
|
99
|
+
* and schedules an asynchronous subscription reconciliation pass if needed.
|
|
100
|
+
*
|
|
101
|
+
* @param posixPath Normalized POSIX file path preserving original casing.
|
|
102
|
+
* @param lookupKey Case-normalized lookup key for the file path.
|
|
103
|
+
*/
|
|
104
|
+
watchFile(posixPath: string, lookupKey: string): void;
|
|
105
|
+
/**
|
|
106
|
+
* Unregisters a previously watched external file and schedules a reconciliation pass
|
|
107
|
+
* if it was the last watched file in its target directory.
|
|
108
|
+
*
|
|
109
|
+
* @param lookupKey Case-normalized lookup key for the file path to remove.
|
|
110
|
+
*/
|
|
111
|
+
removeFile(lookupKey: string): void;
|
|
112
|
+
/**
|
|
113
|
+
* Waits for any scheduled or in-progress subscription reconciliation pass to complete.
|
|
114
|
+
*/
|
|
115
|
+
flush(): Promise<void>;
|
|
116
|
+
/**
|
|
117
|
+
* Closes the manager, awaiting any pending reconciliation and unsubscribing all active
|
|
118
|
+
* external directory subscriptions.
|
|
119
|
+
*/
|
|
120
|
+
close(): Promise<void>;
|
|
121
|
+
}
|