@angular/build 22.3.0-next.0 → 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/chunk-optimizer.js +2 -1
- package/src/builders/application/chunk-optimizer.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 +2 -3
- package/src/builders/application/options.js.map +1 -1
- package/src/builders/application/results.d.ts +1 -1
- package/src/builders/dev-server/options.js +1 -1
- package/src/builders/dev-server/options.js.map +1 -1
- package/src/builders/dev-server/vite/server.js +1 -1
- package/src/builders/dev-server/vite/server.js.map +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 +110 -92
- 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 -23
- package/src/builders/library/options.js.map +1 -1
- package/src/builders/library/pipeline/assets.d.ts +5 -16
- package/src/builders/library/pipeline/assets.js +16 -59
- package/src/builders/library/pipeline/assets.js.map +1 -1
- package/src/builders/library/pipeline/build-action.d.ts +21 -13
- package/src/builders/library/pipeline/build-action.js +76 -124
- package/src/builders/library/pipeline/build-action.js.map +1 -1
- package/src/builders/library/pipeline/bundler.d.ts +5 -3
- package/src/builders/library/pipeline/bundler.js +123 -43
- 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/ng-packagr/builder.js +2 -2
- package/src/builders/ng-packagr/builder.js.map +1 -1
- package/src/builders/unit-test/builder.js +1 -1
- package/src/builders/unit-test/builder.js.map +1 -1
- package/src/builders/unit-test/options.js +1 -2
- package/src/builders/unit-test/options.js.map +1 -1
- 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/load-proxy-config.js +12 -10
- package/src/utils/load-proxy-config.js.map +1 -1
- package/src/utils/load-rolldown.d.ts +27 -0
- package/src/utils/load-rolldown.js +79 -0
- package/src/utils/load-rolldown.js.map +1 -0
- 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.d.ts +14 -1
- package/src/utils/normalize-cache.js +18 -4
- 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
|
@@ -6,61 +6,39 @@
|
|
|
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.normalizeAssetPatterns = normalizeAssetPatterns;
|
|
47
|
-
const node_assert_1 = __importDefault(require("node:assert"));
|
|
48
14
|
const node_fs_1 = require("node:fs");
|
|
49
|
-
const
|
|
15
|
+
const node_path_1 = __importDefault(require("node:path"));
|
|
50
16
|
const path_1 = require("./path");
|
|
17
|
+
/**
|
|
18
|
+
* Normalizes raw string and object asset patterns into {@link NormalizedAssetsPattern} objects
|
|
19
|
+
* and validates that all asset inputs and outputs stay within the workspace and output directories.
|
|
20
|
+
*
|
|
21
|
+
* @param assetPatterns Raw string or object asset patterns from builder options.
|
|
22
|
+
* @param workspaceRoot Workspace root directory path.
|
|
23
|
+
* @param projectRoot Project root directory path.
|
|
24
|
+
* @param projectSourceRoot Optional project source root directory path.
|
|
25
|
+
* @returns An array of normalized asset pattern configurations.
|
|
26
|
+
*/
|
|
51
27
|
function normalizeAssetPatterns(assetPatterns, workspaceRoot, projectRoot, projectSourceRoot) {
|
|
52
28
|
if (assetPatterns.length === 0) {
|
|
53
29
|
return [];
|
|
54
30
|
}
|
|
55
31
|
// When sourceRoot is not available, we default to ${projectRoot}/src.
|
|
56
|
-
const sourceRoot = projectSourceRoot ||
|
|
57
|
-
const
|
|
58
|
-
const
|
|
32
|
+
const sourceRoot = projectSourceRoot || node_path_1.default.join(projectRoot, 'src');
|
|
33
|
+
const resolvedWorkspaceRoot = node_path_1.default.resolve(workspaceRoot);
|
|
34
|
+
const resolvedSourceRoot = node_path_1.default.resolve(resolvedWorkspaceRoot, sourceRoot);
|
|
35
|
+
const resolvedProjectRoot = node_path_1.default.resolve(resolvedWorkspaceRoot, projectRoot);
|
|
59
36
|
return assetPatterns.map((assetPattern) => {
|
|
37
|
+
let normalized;
|
|
60
38
|
// Normalize string asset patterns to objects.
|
|
61
39
|
if (typeof assetPattern === 'string') {
|
|
62
|
-
const assetPath =
|
|
63
|
-
const resolvedAssetPath =
|
|
40
|
+
const assetPath = node_path_1.default.normalize(assetPattern);
|
|
41
|
+
const resolvedAssetPath = node_path_1.default.resolve(resolvedWorkspaceRoot, assetPath);
|
|
64
42
|
let root;
|
|
65
43
|
// Check if the string asset is within sourceRoot.
|
|
66
44
|
if (resolvedAssetPath.startsWith(resolvedSourceRoot)) {
|
|
@@ -69,47 +47,36 @@ function normalizeAssetPatterns(assetPatterns, workspaceRoot, projectRoot, proje
|
|
|
69
47
|
else if (resolvedAssetPath.startsWith(resolvedProjectRoot)) {
|
|
70
48
|
root = resolvedProjectRoot;
|
|
71
49
|
}
|
|
72
|
-
else if (resolvedAssetPath.startsWith(
|
|
73
|
-
root =
|
|
50
|
+
else if (resolvedAssetPath.startsWith(resolvedWorkspaceRoot)) {
|
|
51
|
+
root = resolvedWorkspaceRoot;
|
|
74
52
|
}
|
|
75
53
|
else {
|
|
76
54
|
throw new Error(`The ${assetPattern} asset path must be within the workspace root.`);
|
|
77
55
|
}
|
|
78
|
-
let
|
|
79
|
-
let isDirectory;
|
|
56
|
+
let isDirectory = true;
|
|
80
57
|
try {
|
|
81
|
-
isDirectory = (0, node_fs_1.statSync)(resolvedAssetPath)
|
|
82
|
-
}
|
|
83
|
-
catch {
|
|
84
|
-
isDirectory = true;
|
|
85
|
-
}
|
|
86
|
-
if (isDirectory) {
|
|
87
|
-
// Folders get a recursive star glob.
|
|
88
|
-
glob = '**/*';
|
|
89
|
-
// Input directory is their original path.
|
|
90
|
-
input = assetPath;
|
|
91
|
-
}
|
|
92
|
-
else {
|
|
93
|
-
// Files are their own glob.
|
|
94
|
-
glob = path.basename(assetPath);
|
|
95
|
-
// Input directory is their original dirname.
|
|
96
|
-
input = path.dirname(assetPath);
|
|
58
|
+
isDirectory = (0, node_fs_1.statSync)(resolvedAssetPath, { throwIfNoEntry: false })?.isDirectory() ?? true;
|
|
97
59
|
}
|
|
60
|
+
catch { }
|
|
61
|
+
const glob = isDirectory ? '**/*' : node_path_1.default.basename(assetPath);
|
|
62
|
+
const input = isDirectory ? assetPath : node_path_1.default.dirname(assetPath);
|
|
98
63
|
// Output directory for both is the relative path from the root to input.
|
|
99
|
-
const output =
|
|
100
|
-
|
|
64
|
+
const output = node_path_1.default.relative(root, node_path_1.default.resolve(resolvedWorkspaceRoot, input));
|
|
65
|
+
normalized = { glob, input, output };
|
|
101
66
|
}
|
|
102
67
|
else {
|
|
103
|
-
if (!(0, path_1.isSubDirectory)(
|
|
68
|
+
if (!(0, path_1.isSubDirectory)(resolvedWorkspaceRoot, assetPattern.input)) {
|
|
104
69
|
throw new Error(`The ${assetPattern.input} asset path must be within the workspace root.`);
|
|
105
70
|
}
|
|
106
|
-
|
|
71
|
+
normalized = {
|
|
72
|
+
...assetPattern,
|
|
73
|
+
output: node_path_1.default.join('.', assetPattern.output ?? ''),
|
|
74
|
+
};
|
|
107
75
|
}
|
|
108
|
-
|
|
109
|
-
if (assetPattern.output.startsWith('..')) {
|
|
76
|
+
if (normalized.output.startsWith('..')) {
|
|
110
77
|
throw new Error('An asset cannot be written to a location outside of the output path.');
|
|
111
78
|
}
|
|
112
|
-
return
|
|
79
|
+
return normalized;
|
|
113
80
|
});
|
|
114
81
|
}
|
|
115
82
|
//# sourceMappingURL=normalize-asset-patterns.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-asset-patterns.js","sourceRoot":"","sources":["normalize-asset-patterns.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG
|
|
1
|
+
{"version":3,"file":"normalize-asset-patterns.js","sourceRoot":"","sources":["normalize-asset-patterns.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;;;;AAyBH,wDAgEC;AAvFD,qCAAmC;AACnC,0DAA6B;AAE7B,iCAAwC;AAUxC;;;;;;;;;GASG;AACH,SAAgB,sBAAsB,CACpC,aAA6B,EAC7B,aAAqB,EACrB,WAAmB,EACnB,iBAAqC;IAErC,IAAI,aAAa,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QAC/B,OAAO,EAAE,CAAC;IACZ,CAAC;IAED,sEAAsE;IACtE,MAAM,UAAU,GAAG,iBAAiB,IAAI,mBAAI,CAAC,IAAI,CAAC,WAAW,EAAE,KAAK,CAAC,CAAC;IACtE,MAAM,qBAAqB,GAAG,mBAAI,CAAC,OAAO,CAAC,aAAa,CAAC,CAAC;IAC1D,MAAM,kBAAkB,GAAG,mBAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,UAAU,CAAC,CAAC;IAC3E,MAAM,mBAAmB,GAAG,mBAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,WAAW,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CAAC;YAEhE,yEAAyE;YACzE,MAAM,MAAM,GAAG,mBAAI,CAAC,QAAQ,CAAC,IAAI,EAAE,mBAAI,CAAC,OAAO,CAAC,qBAAqB,EAAE,KAAK,CAAC,CAAC,CAAC;YAE/E,UAAU,GAAG,EAAE,IAAI,EAAE,KAAK,EAAE,MAAM,EAAE,CAAC;QACvC,CAAC;aAAM,CAAC;YACN,IAAI,CAAC,IAAA,qBAAc,EAAC,qBAAqB,EAAE,YAAY,CAAC,KAAK,CAAC,EAAE,CAAC;gBAC/D,MAAM,IAAI,KAAK,CAAC,OAAO,YAAY,CAAC,KAAK,gDAAgD,CAAC,CAAC;YAC7F,CAAC;YAED,UAAU,GAAG;gBACX,GAAG,YAAY;gBACf,MAAM,EAAE,mBAAI,CAAC,IAAI,CAAC,GAAG,EAAE,YAAY,CAAC,MAAM,IAAI,EAAE,CAAC;aAClD,CAAC;QACJ,CAAC;QAED,IAAI,UAAU,CAAC,MAAM,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACvC,MAAM,IAAI,KAAK,CAAC,sEAAsE,CAAC,CAAC;QAC1F,CAAC;QAED,OAAO,UAAU,CAAC;IACpB,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -23,4 +23,17 @@ export interface NormalizedCachedOptions {
|
|
|
23
23
|
*/
|
|
24
24
|
localBasePath?: string;
|
|
25
25
|
}
|
|
26
|
-
|
|
26
|
+
/**
|
|
27
|
+
* Normalizes the persistent disk cache configuration for a project or workspace.
|
|
28
|
+
*
|
|
29
|
+
* Resolves whether disk caching is enabled based on the CLI cache metadata, current runtime
|
|
30
|
+
* environment (local vs. CI, or WebContainers), and computes the versioned cache directory paths
|
|
31
|
+
* (resolving shared Git worktree paths when applicable).
|
|
32
|
+
*
|
|
33
|
+
* @param projectMetadata The project or workspace metadata object containing optional `cli.cache` settings.
|
|
34
|
+
* @param workspaceRoot The absolute path to the workspace root directory.
|
|
35
|
+
* @param projectName Optional name of the project used to scope the resolved cache path.
|
|
36
|
+
* @param builderName Optional name of the builder or tool used to further scope the resolved cache path.
|
|
37
|
+
* @returns The normalized disk cache options including enabled state and resolved directory paths.
|
|
38
|
+
*/
|
|
39
|
+
export declare function normalizeCacheOptions(projectMetadata: unknown, workspaceRoot: string, projectName?: string, builderName?: string): NormalizedCachedOptions;
|
|
@@ -11,7 +11,7 @@ exports.normalizeCacheOptions = normalizeCacheOptions;
|
|
|
11
11
|
const node_fs_1 = require("node:fs");
|
|
12
12
|
const node_path_1 = require("node:path");
|
|
13
13
|
/** Version placeholder is replaced during the build process with actual package version */
|
|
14
|
-
const VERSION = '22.3.0-next.
|
|
14
|
+
const VERSION = '22.3.0-next.2';
|
|
15
15
|
function hasCacheMetadata(value) {
|
|
16
16
|
return (!!value &&
|
|
17
17
|
typeof value === 'object' &&
|
|
@@ -62,7 +62,20 @@ function getCacheBasePath(workspaceRoot, cachePathSetting) {
|
|
|
62
62
|
catch { }
|
|
63
63
|
return (0, node_path_1.resolve)(workspaceRoot, cachePathSetting);
|
|
64
64
|
}
|
|
65
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Normalizes the persistent disk cache configuration for a project or workspace.
|
|
67
|
+
*
|
|
68
|
+
* Resolves whether disk caching is enabled based on the CLI cache metadata, current runtime
|
|
69
|
+
* environment (local vs. CI, or WebContainers), and computes the versioned cache directory paths
|
|
70
|
+
* (resolving shared Git worktree paths when applicable).
|
|
71
|
+
*
|
|
72
|
+
* @param projectMetadata The project or workspace metadata object containing optional `cli.cache` settings.
|
|
73
|
+
* @param workspaceRoot The absolute path to the workspace root directory.
|
|
74
|
+
* @param projectName Optional name of the project used to scope the resolved cache path.
|
|
75
|
+
* @param builderName Optional name of the builder or tool used to further scope the resolved cache path.
|
|
76
|
+
* @returns The normalized disk cache options including enabled state and resolved directory paths.
|
|
77
|
+
*/
|
|
78
|
+
function normalizeCacheOptions(projectMetadata, workspaceRoot, projectName = '', builderName = '') {
|
|
66
79
|
const cacheMetadata = hasCacheMetadata(projectMetadata) ? projectMetadata.cli.cache : {};
|
|
67
80
|
const {
|
|
68
81
|
// Webcontainers do not currently benefit from persistent disk caching and can lead to increased browser memory usage
|
|
@@ -81,12 +94,13 @@ function normalizeCacheOptions(projectMetadata, workspaceRoot) {
|
|
|
81
94
|
}
|
|
82
95
|
const cacheBasePath = getCacheBasePath(workspaceRoot, path);
|
|
83
96
|
const localCacheBasePath = (0, node_path_1.isAbsolute)(path) ? path : (0, node_path_1.resolve)(workspaceRoot, path);
|
|
97
|
+
const normalizedBuilderName = builderName.replace('@', '').replaceAll(/[:/]/g, '-');
|
|
84
98
|
return {
|
|
85
99
|
enabled: cacheEnabled,
|
|
86
100
|
basePath: cacheBasePath,
|
|
87
|
-
path: (0, node_path_1.join)(cacheBasePath, VERSION),
|
|
101
|
+
path: (0, node_path_1.join)(cacheBasePath, VERSION, projectName, normalizedBuilderName),
|
|
88
102
|
localBasePath: localCacheBasePath,
|
|
89
|
-
localPath: (0, node_path_1.join)(localCacheBasePath, VERSION),
|
|
103
|
+
localPath: (0, node_path_1.join)(localCacheBasePath, VERSION, projectName, normalizedBuilderName),
|
|
90
104
|
};
|
|
91
105
|
}
|
|
92
106
|
//# sourceMappingURL=normalize-cache.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"normalize-cache.js","sourceRoot":"","sources":["normalize-cache.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;
|
|
1
|
+
{"version":3,"file":"normalize-cache.js","sourceRoot":"","sources":["normalize-cache.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AA0GH,sDAuCC;AA/ID,qCAA6D;AAC7D,yCAAyE;AAEzE,2FAA2F;AAC3F,MAAM,OAAO,GAAG,mBAAmB,CAAC;AA+BpC,SAAS,gBAAgB,CAAC,KAAc;IACtC,OAAO,CACL,CAAC,CAAC,KAAK;QACP,OAAO,KAAK,KAAK,QAAQ;QACzB,KAAK,IAAI,KAAK;QACd,CAAC,CAAC,KAAK,CAAC,KA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YAAY,GAAG,OAAO,CAAC;IAC3B,IAAI,YAAY,EAAE,CAAC;QACjB,QAAQ,WAAW,EAAE,CAAC;YACpB,KAAK,IAAI;gBACP,YAAY,GAAG,IAAI,CAAC;gBACpB,MAAM;YACR,KAAK,OAAO;gBACV,YAAY,GAAG,CAAC,IAAI,CAAC;gBACrB,MAAM;QACV,CAAC;IACH,CAAC;IAED,MAAM,aAAa,GAAG,gBAAgB,CAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IAC5D,MAAM,kBAAkB,GAAG,IAAA,sBAAU,EAAC,IAAI,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAA,mBAAO,EAAC,aAAa,EAAE,IAAI,CAAC,CAAC;IAClF,MAAM,qBAAqB,GAAG,WAAW,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,CAAC,CAAC,UAAU,CAAC,OAAO,EAAE,GAAG,CAAC,CAAC;IAEpF,OAAO;QACL,OAAO,EAAE,YAAY;QACrB,QAAQ,EAAE,aAAa;QACvB,IAAI,EAAE,IAAA,gBAAI,EAAC,aAAa,EAAE,OAAO,EAAE,WAAW,EAAE,qBAAqB,CAAC;QACtE,aAAa,EAAE,kBAAkB;QACjC,SAAS,EAAE,IAAA,gBAAI,EAAC,kBAAkB,EAAE,OAAO,EAAE,WAAW,EAAE,qBAAqB,CAAC;KACjF,CAAC;AACJ,CAAC"}
|
|
@@ -16,10 +16,10 @@ export declare function generateSearchDirectories(roots: string[]): Promise<Sear
|
|
|
16
16
|
export declare function findTailwindConfiguration(searchDirectories: SearchDirectory[]): string | undefined;
|
|
17
17
|
export declare function getTailwindConfig(searchDirectories: SearchDirectory[], workspaceRoot: string, logger?: {
|
|
18
18
|
warn(message: string): void;
|
|
19
|
-
}):
|
|
19
|
+
}): {
|
|
20
20
|
file: string;
|
|
21
21
|
package: string;
|
|
22
|
-
} | undefined
|
|
22
|
+
} | undefined;
|
|
23
23
|
export declare function loadPostcssConfiguration(searchDirectories: SearchDirectory[]): Promise<{
|
|
24
24
|
configPath: string;
|
|
25
25
|
config: PostcssConfiguration;
|
|
@@ -21,8 +21,8 @@ const tailwindConfigFiles = [
|
|
|
21
21
|
'tailwind.config.mjs',
|
|
22
22
|
'tailwind.config.ts',
|
|
23
23
|
];
|
|
24
|
-
|
|
25
|
-
return
|
|
24
|
+
function generateSearchDirectories(roots) {
|
|
25
|
+
return Promise.all(roots.map((root) => (0, promises_1.readdir)(root, { withFileTypes: true }).then((entries) => ({
|
|
26
26
|
root,
|
|
27
27
|
files: new Set(entries.filter((entry) => entry.isFile()).map((entry) => entry.name)),
|
|
28
28
|
}))));
|
|
@@ -40,7 +40,7 @@ function findFile(searchDirectories, potentialFiles) {
|
|
|
40
40
|
function findTailwindConfiguration(searchDirectories) {
|
|
41
41
|
return findFile(searchDirectories, tailwindConfigFiles);
|
|
42
42
|
}
|
|
43
|
-
|
|
43
|
+
function getTailwindConfig(searchDirectories, workspaceRoot, logger) {
|
|
44
44
|
const tailwindConfigurationPath = findTailwindConfiguration(searchDirectories);
|
|
45
45
|
if (!tailwindConfigurationPath) {
|
|
46
46
|
return undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"postcss-configuration.js","sourceRoot":"","sources":["postcss-configuration.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AA2BH,8DASC;AAiBD,8DAIC;AAED,8CA2BC;AAWD,4DAqDC;AApJD,+CAAqD;AACrD,6CAA4C;AAC5C,yCAA2C;AAU3C,MAAM,yBAAyB,GAAa,CAAC,qBAAqB,EAAE,iBAAiB,CAAC,CAAC;AACvF,MAAM,mBAAmB,GAAa;IACpC,oBAAoB;IACpB,qBAAqB;IACrB,qBAAqB;IACrB,oBAAoB;CACrB,CAAC;
|
|
1
|
+
{"version":3,"file":"postcss-configuration.js","sourceRoot":"","sources":["postcss-configuration.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG;;AA2BH,8DASC;AAiBD,8DAIC;AAED,8CA2BC;AAWD,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__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;AAhED,+CAA+C;AAC/C,0DAA6B;AAC7B,2CAAoD;AACpD,+CAAoE;AACpE,iCAAwC;AAExC;;GAEG;AACU,QAAA,oBAAoB,GAAG,CAAC,UAAU,EAAE,cAAc,EAAE,cAAc,CAAU,CAAC;AAEnF,KAAK,UAAU,aAAa,CACjC,OAOG,EACH,IAAY;IAEZ,MAAM,eAAe,GAAG,MAAM,IAAA,2BAAa,EAAC,OAAO,EAAE,kCAAoB,EAAE,KAAK,EAAE,KAAK,EAAE,EAAE;QACzF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O,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,EAAE,CAAC;AAEvC;;;GAGG;AAEH,MAAM,iBAAiB,GAAG,WAAW,CAAC;AAOtC,IAAI,oBAA4B,CAAC;AACjC,IAAI,WAAgD,CAAC;AAErD,SAAgB,UAAU,CAAC,IAAqC;IAC9D,wFAAwF;IACxF,6CAA6C;IAC7C,0FAA0F;IAC1F,gFAAgF;IAChF,gDAAgD;IAChD,oBAAoB,GAAG,IAAA,wBAAa,EAClC,IAAA,gBAAI,EAAC,IAAI,CAAC,aAAa,EAAE,2BAA2B,IAA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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
|
+
}
|