@smoothbricks/nx-plugin 0.7.16 → 0.7.18
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 +210 -64
- package/dist/.build-inputs.json +28 -23
- package/dist/bun-lock-scope.d.ts +128 -20
- package/dist/bun-lock-scope.d.ts.map +1 -1
- package/dist/bun-lock-scope.js +267 -44
- package/dist/cargo-closure-input.d.ts +8 -6
- package/dist/cargo-closure-input.d.ts.map +1 -1
- package/dist/cargo-closure-input.js +14 -11
- package/dist/cargo-source-hash.d.ts +23 -4
- package/dist/cargo-source-hash.d.ts.map +1 -1
- package/dist/cargo-source-hash.js +80 -14
- package/dist/cargo-workspace.d.ts +20 -2
- package/dist/cargo-workspace.d.ts.map +1 -1
- package/dist/cargo-workspace.js +42 -22
- package/dist/compile-environment.d.ts +8 -0
- package/dist/compile-environment.d.ts.map +1 -0
- package/dist/compile-environment.js +80 -0
- package/dist/dependency-manifests.d.ts +13 -0
- package/dist/dependency-manifests.d.ts.map +1 -0
- package/dist/dependency-manifests.js +20 -0
- package/dist/ensure-built-receipt.d.ts +3 -2
- package/dist/ensure-built-receipt.d.ts.map +1 -1
- package/dist/ensure-built-receipt.js +3 -2
- package/dist/eslint-config-closure.d.ts +8 -3
- package/dist/eslint-config-closure.d.ts.map +1 -1
- package/dist/eslint-config-closure.js +24 -5
- package/dist/executors/bounded-exec/bounds.d.ts +12 -1
- package/dist/executors/bounded-exec/bounds.d.ts.map +1 -1
- package/dist/executors/bounded-exec/bounds.js +8 -4
- package/dist/executors/bounded-exec/cpu-rise.d.ts +73 -0
- package/dist/executors/bounded-exec/cpu-rise.d.ts.map +1 -0
- package/dist/executors/bounded-exec/cpu-rise.js +111 -0
- package/dist/executors/bounded-exec/executor.d.ts +1 -1
- package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
- package/dist/executors/bounded-exec/executor.js +54 -22
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts +8 -0
- package/dist/executors/bounded-exec/hang-diagnostics.d.ts.map +1 -1
- package/dist/executors/bounded-exec/hang-diagnostics.js +66 -6
- package/dist/executors/bounded-exec/mbx-pool.d.ts +16 -2
- package/dist/executors/bounded-exec/mbx-pool.d.ts.map +1 -1
- package/dist/executors/bounded-exec/mbx-pool.js +18 -2
- package/dist/executors/bounded-exec/mbx-reservations.d.ts +5 -2
- package/dist/executors/bounded-exec/mbx-reservations.d.ts.map +1 -1
- package/dist/executors/bounded-exec/mbx-reservations.js +5 -3
- package/dist/executors/bounded-exec/progress-channel.d.ts +38 -0
- package/dist/executors/bounded-exec/progress-channel.d.ts.map +1 -0
- package/dist/executors/bounded-exec/progress-channel.js +113 -0
- package/dist/executors/bounded-exec/progress.d.ts +2 -1
- package/dist/executors/bounded-exec/progress.d.ts.map +1 -1
- package/dist/executors/bounded-exec/ram-temp.d.ts +24 -1
- package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -1
- package/dist/executors/bounded-exec/ram-temp.js +123 -16
- package/dist/executors/bounded-exec/schema.d.ts +5 -0
- package/dist/executors/bounded-exec/schema.d.ts.map +1 -1
- package/dist/executors/bounded-exec/schema.js +17 -1
- package/dist/executors/bounded-exec/verdict.d.ts +13 -6
- package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
- package/dist/executors/bounded-exec/verdict.js +34 -9
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +216 -97
- package/dist/managed-files/files.d.ts +3 -3
- package/dist/managed-files/files.js +3 -3
- package/dist/managed-files/generator.d.ts +5 -1
- package/dist/managed-files/generator.d.ts.map +1 -1
- package/dist/managed-files/generator.js +22 -7
- package/dist/managed-files/render-memo.d.ts +13 -0
- package/dist/managed-files/render-memo.d.ts.map +1 -0
- package/dist/managed-files/render-memo.js +94 -0
- package/dist/test-program.d.ts +11 -6
- package/dist/test-program.d.ts.map +1 -1
- package/dist/test-program.js +39 -35
- package/dist/tool-bins.d.ts +12 -0
- package/dist/tool-bins.d.ts.map +1 -1
- package/dist/tool-bins.js +31 -6
- package/dist/typecheck-route.d.ts +3 -4
- package/dist/typecheck-route.d.ts.map +1 -1
- package/dist/typecheck-route.js +4 -15
- package/dist/typecheck-test-policy.d.ts +10 -1
- package/dist/typecheck-test-policy.d.ts.map +1 -1
- package/dist/typecheck-test-policy.js +40 -24
- package/dist/workspace-index.d.ts +14 -1
- package/dist/workspace-index.d.ts.map +1 -1
- package/dist/workspace-index.js +36 -4
- package/managed/raw/patches/nx@24.0.3.patch +703 -119
- package/managed/raw/patches/{ttsc@0.34.1.patch → ttsc@0.36.3.patch} +728 -71
- package/managed/raw/tooling/direnv/developer-links.ts +17 -3
- package/managed/raw/tooling/direnv/devenv.smoo.nix +1 -1
- package/managed/templates/github/actions/save-nix-devenv/action.yml +19 -1
- package/managed/templates/github/actions/setup-devenv/action.yml +2 -0
- package/package.json +5 -4
- package/src/bun-lock-scope.ts +293 -40
- package/src/cargo-closure-input.ts +19 -11
- package/src/cargo-source-hash.ts +103 -13
- package/src/cargo-workspace.ts +59 -20
- package/src/compile-environment.ts +35 -0
- package/src/dependency-manifests.ts +30 -0
- package/src/ensure-built-receipt.ts +3 -2
- package/src/eslint-config-closure.ts +27 -6
- package/src/executors/bounded-exec/bounds.ts +13 -4
- package/src/executors/bounded-exec/cpu-rise.ts +156 -0
- package/src/executors/bounded-exec/executor.ts +65 -21
- package/src/executors/bounded-exec/hang-diagnostics.ts +88 -6
- package/src/executors/bounded-exec/mbx-pool.ts +24 -3
- package/src/executors/bounded-exec/mbx-reservations.ts +7 -5
- package/src/executors/bounded-exec/progress-channel.ts +129 -0
- package/src/executors/bounded-exec/progress.ts +2 -1
- package/src/executors/bounded-exec/ram-temp.ts +137 -17
- package/src/executors/bounded-exec/schema.ts +19 -0
- package/src/executors/bounded-exec/verdict.ts +44 -16
- package/src/index.ts +272 -106
- package/src/managed-files/files.ts +3 -3
- package/src/managed-files/generator.ts +21 -6
- package/src/managed-files/render-memo.ts +135 -0
- package/src/test-program.ts +36 -41
- package/src/tool-bins.ts +35 -6
- package/src/typecheck-route.ts +5 -14
- package/src/typecheck-test-policy.ts +49 -24
- package/src/workspace-index.ts +40 -5
- package/test-timings.json +6 -0
|
@@ -2,9 +2,9 @@ import { createHash } from 'node:crypto';
|
|
|
2
2
|
import { realpath } from 'node:fs/promises';
|
|
3
3
|
import { isAbsolute, join, posix, relative, sep } from 'node:path';
|
|
4
4
|
import { CARGO_ANCESTOR_INPUTS } from '@smoothbricks/cargo-retain/cargo-ancestor-inputs';
|
|
5
|
-
import { compiledInFiles, dependencyClosure, HASH_SKIPPED_DIRECTORIES, readCargoResolve, } from './cargo-source-hash.js';
|
|
5
|
+
import { cargoSourceIndex, compiledInFiles, dependencyClosure, HASH_SKIPPED_DIRECTORIES, readCargoResolve, retainIncludeScans, } from './cargo-source-hash.js';
|
|
6
6
|
import { runtimeInput, shellWord } from './runtime-input.js';
|
|
7
|
-
import { globIndexedFiles } from './workspace-index.js';
|
|
7
|
+
import { globIndexedFiles, indexedFileData } from './workspace-index.js';
|
|
8
8
|
/**
|
|
9
9
|
* The named input the plugin infers for every project with crates of a Cargo
|
|
10
10
|
* workspace under its root: the mutable sources of the Cargo-resolved
|
|
@@ -51,12 +51,15 @@ const SKIPPED_TREES = `**/{${HASH_SKIPPED_DIRECTORIES.join(',')}}/**`;
|
|
|
51
51
|
/** A path holding any of these would be read as a pattern, not as itself. */
|
|
52
52
|
const GLOB_SYNTAX = /[*?[\]{}()!,]/;
|
|
53
53
|
/**
|
|
54
|
-
*
|
|
55
|
-
* applied, `node_modules` never entered. A package whose manifest is missing
|
|
56
|
-
*
|
|
54
|
+
* The Cargo manifests and Rust sources of Nx's workspace file index, with Nx's content hash of each source:
|
|
55
|
+
* .gitignore and .nxignore applied, `node_modules` never entered. A package whose manifest is missing here has no
|
|
56
|
+
* files a fileset input can hash. Scans of source texts no longer indexed are forgotten here.
|
|
57
57
|
*/
|
|
58
|
-
export async function
|
|
59
|
-
|
|
58
|
+
export async function indexedCargoSources(workspaceRoot) {
|
|
59
|
+
const [root, files] = await Promise.all([realpath(workspaceRoot), indexedFileData(workspaceRoot)]);
|
|
60
|
+
const index = cargoSourceIndex(root, files);
|
|
61
|
+
retainIncludeScans(index);
|
|
62
|
+
return index;
|
|
60
63
|
}
|
|
61
64
|
/**
|
|
62
65
|
* Content-keyed locked offline metadata. A refusal fails graph inference:
|
|
@@ -64,9 +67,9 @@ export async function indexedCargoManifests(workspaceRoot) {
|
|
|
64
67
|
* precise set of cache inputs.
|
|
65
68
|
*/
|
|
66
69
|
export async function resolveCargoClosureSource(manifest, workspaceRoot, indexed, compiledFilesCache) {
|
|
67
|
-
const [root,
|
|
68
|
-
const cargo = await readCargoResolve(join(root, manifest), root,
|
|
69
|
-
return { manifest, workspaceRoot, root, cargo, indexed:
|
|
70
|
+
const [root, sources] = await Promise.all([realpath(workspaceRoot), indexed]);
|
|
71
|
+
const cargo = await readCargoResolve(join(root, manifest), root, sources.manifests);
|
|
72
|
+
return { manifest, workspaceRoot, root, cargo, indexed: sources.manifests, sources, compiledFilesCache };
|
|
70
73
|
}
|
|
71
74
|
/**
|
|
72
75
|
* The `cargoClosure` definition for the project at `projectRoot`: for each
|
|
@@ -135,7 +138,7 @@ async function workspaceClosureInputs(projectRoot, source) {
|
|
|
135
138
|
if (!indexed.has(posix.join(directory, 'Cargo.toml'))) {
|
|
136
139
|
throw new Error(`the Cargo package ${directory} is not in Nx's file index (an ignored directory)`);
|
|
137
140
|
}
|
|
138
|
-
for (const compiled of compiledInFiles(pkg.directory, source.compiledFilesCache)) {
|
|
141
|
+
for (const compiled of compiledInFiles(pkg.directory, source.sources, source.compiledFilesCache)) {
|
|
139
142
|
const file = indexablePath(root, compiled.file);
|
|
140
143
|
if (file === null)
|
|
141
144
|
throw new Error(`${directory} compiles ${compiled.file}, which Nx's file index cannot hold`);
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { type FileData } from 'nx/src/native/index.js';
|
|
1
2
|
/** One resolved dependency of a package: the package it resolved to, and whether every declaration of it is a dev one. */
|
|
2
3
|
export interface CargoEdge {
|
|
3
4
|
readonly pkg: string;
|
|
@@ -100,9 +101,27 @@ export interface CompiledCargoInput {
|
|
|
100
101
|
readonly literal: string;
|
|
101
102
|
}
|
|
102
103
|
/**
|
|
103
|
-
*
|
|
104
|
-
*
|
|
105
|
-
*
|
|
104
|
+
* The Rust sources and Cargo packages of Nx's workspace file index (.gitignore and .nxignore applied, as for every
|
|
105
|
+
* fileset input), canonical and absolute. A graph computation takes a package's sources and nested packages from
|
|
106
|
+
* here, so it lists no directory and probes no path for a manifest.
|
|
106
107
|
*/
|
|
107
|
-
export
|
|
108
|
+
export interface CargoSourceIndex {
|
|
109
|
+
/** Every `Cargo.toml` in the index, relative to the workspace root. */
|
|
110
|
+
readonly manifests: ReadonlySet<string>;
|
|
111
|
+
/** Every directory holding an indexed `Cargo.toml`. */
|
|
112
|
+
readonly packageDirectories: ReadonlySet<string>;
|
|
113
|
+
/** Nx's content hash of every indexed `.rs` file. */
|
|
114
|
+
readonly rustSources: ReadonlyMap<string, string>;
|
|
115
|
+
}
|
|
116
|
+
/** {@link CargoSourceIndex} of Nx's file data (workspace-relative paths and content hashes) under the canonical `root`. */
|
|
117
|
+
export declare function cargoSourceIndex(root: string, files: Iterable<FileData>): CargoSourceIndex;
|
|
118
|
+
/** Forgets the scan of every source text `index` no longer holds. */
|
|
119
|
+
export declare function retainIncludeScans(index: CargoSourceIndex): void;
|
|
120
|
+
/**
|
|
121
|
+
* Existing literal include_str!/include_bytes! files read by this package's Rust sources, as Nx's file index holds
|
|
122
|
+
* them: a generated (ignored) source is its producer's output and keys a consumer through its dependency outputs.
|
|
123
|
+
* One graph owns the memo; runtime hashing consumes the same discovery alongside source bytes. Nested packages own
|
|
124
|
+
* their sources separately. Computed paths remain explicit inputs.
|
|
125
|
+
*/
|
|
126
|
+
export declare function compiledInFiles(root: string, index: CargoSourceIndex, cache: Map<string, CompiledCargoInput[]>): CompiledCargoInput[];
|
|
108
127
|
//# sourceMappingURL=cargo-source-hash.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cargo-source-hash.d.ts","sourceRoot":"","sources":["../src/cargo-source-hash.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"cargo-source-hash.d.ts","sourceRoot":"","sources":["../src/cargo-source-hash.ts"],"names":[],"mappings":"AAmBA,OAAe,EAAE,KAAK,QAAQ,EAAE,MAAM,wBAAwB,CAAC;AA6F/D,0HAA0H;AAC1H,MAAM,WAAW,SAAS;IACxB,QAAQ,CAAC,GAAG,EAAE,MAAM,CAAC;IACrB,yFAAyF;IACzF,QAAQ,CAAC,OAAO,EAAE,OAAO,CAAC;CAC3B;AAED,iHAAiH;AACjH,MAAM,MAAM,YAAY,GAAG,WAAW,CAAC,MAAM,EAAE,SAAS,MAAM,EAAE,CAAC,CAAC;AAElE,mFAAmF;AACnF,MAAM,WAAW,iBAAiB;IAChC,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;IACzB,QAAQ,CAAC,SAAS,EAAE,MAAM,CAAC;IAC3B,QAAQ,CAAC,QAAQ,EAAE,MAAM,CAAC;IAC1B,iHAAiH;IACjH,QAAQ,CAAC,OAAO,EAAE,SAAS,MAAM,EAAE,CAAC;IACpC,QAAQ,CAAC,iBAAiB,EAAE,MAAM,CAAC;CACpC;AAED,kGAAkG;AAClG,MAAM,WAAW,YAAY;IAC3B,0CAA0C;IAC1C,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,2EAA2E;IAC3E,QAAQ,CAAC,OAAO,EAAE,WAAW,CAAC,MAAM,CAAC,CAAC;IACtC,QAAQ,CAAC,KAAK,EAAE,SAAS,iBAAiB,EAAE,CAAC;IAC7C;;;OAGG;IACH,QAAQ,CAAC,MAAM,EAAE,WAAW,CAAC,MAAM,EAAE,MAAM,C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gBAAgB,GAAG,IAAI,CAGhE;AAyBD;;;;;GAKG;AACH,wBAAgB,eAAe,CAC7B,IAAI,EAAE,MAAM,EACZ,KAAK,EAAE,gBAAgB,EACvB,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,kBAAkB,EAAE,CAAC,GACvC,kBAAkB,EAAE,CAYtB"}
|
|
@@ -5,14 +5,14 @@ import { accessSync, constants, existsSync, readdirSync, readFileSync, realpathS
|
|
|
5
5
|
import { lstat, mkdir, readdir, readFile, readlink, realpath, rename, rm, stat, writeFile } from 'node:fs/promises';
|
|
6
6
|
import { createRequire } from 'node:module';
|
|
7
7
|
import { homedir } from 'node:os';
|
|
8
|
-
import { delimiter, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
8
|
+
import { basename, delimiter, dirname, isAbsolute, join, relative, resolve, sep } from 'node:path';
|
|
9
9
|
import { CARGO_ANCESTOR_INPUTS } from '@smoothbricks/cargo-retain/cargo-ancestor-inputs';
|
|
10
10
|
import native from 'nx/src/native/index.js';
|
|
11
11
|
import { workspaceDataDirectoryForWorkspace } from 'nx/src/utils/cache-directory.js';
|
|
12
12
|
import { CARGO_TOOLCHAIN_PIN_INPUTS } from './cargo-toolchain-policy.js';
|
|
13
13
|
import { describeTeardown, killProcessGroupNow, TEARDOWN_PATIENCE } from './process-group.js';
|
|
14
14
|
import { rustTokens } from './rust-tokens.js';
|
|
15
|
-
const { IS_WASM, WorkspaceContext } = native;
|
|
15
|
+
const { IS_WASM, WorkspaceContext, hashArray } = native;
|
|
16
16
|
const cargoResolveEvents = channel('@smoothbricks/nx-plugin:cargo-resolve');
|
|
17
17
|
/**
|
|
18
18
|
* Narrowed field by field, not by typia: graph inference imports this module,
|
|
@@ -867,7 +867,7 @@ export async function hashCargoPathInputs(manifestPath, workspaceRoot, options)
|
|
|
867
867
|
const scan = scans.get(input.file);
|
|
868
868
|
if (scan !== undefined) {
|
|
869
869
|
scans.delete(input.file);
|
|
870
|
-
collectCompiledInputs(input.file, bytes.toString('utf8'), scan.found);
|
|
870
|
+
collectCompiledInputs(input.file, includeSpellings(bytes.toString('utf8')), scan.found);
|
|
871
871
|
}
|
|
872
872
|
hash.update(input.key);
|
|
873
873
|
hash.update('\0');
|
|
@@ -890,7 +890,7 @@ export async function hashCargoPathInputs(manifestPath, workspaceRoot, options)
|
|
|
890
890
|
continue;
|
|
891
891
|
// Discovery also visits ignored sources. They have no scheduled identity;
|
|
892
892
|
// if an include alias later names one, preserve the old read-then-hash path.
|
|
893
|
-
collectCompiledInputs(source, readFileSync(source, 'utf8'), scan.found);
|
|
893
|
+
collectCompiledInputs(source, includeSpellings(readFileSync(source, 'utf8')), scan.found);
|
|
894
894
|
}
|
|
895
895
|
for (const input of [...scan.found.values()].sort((left, right) => left.file < right.file ? -1 : left.file > right.file ? 1 : 0)) {
|
|
896
896
|
if (ignored(input.file))
|
|
@@ -1065,9 +1065,13 @@ function* compiledSourceFiles(root) {
|
|
|
1065
1065
|
}
|
|
1066
1066
|
}
|
|
1067
1067
|
}
|
|
1068
|
-
|
|
1068
|
+
/** What a source with no include spells. */
|
|
1069
|
+
const NO_SPELLINGS = [];
|
|
1070
|
+
/** The paths a Rust source's text spells as literal include_str!/include_bytes! arguments. */
|
|
1071
|
+
function includeSpellings(text) {
|
|
1069
1072
|
if (!text.includes('include_'))
|
|
1070
|
-
return;
|
|
1073
|
+
return NO_SPELLINGS;
|
|
1074
|
+
const spellings = [];
|
|
1071
1075
|
const tokens = rustTokens(text);
|
|
1072
1076
|
for (let index = 0; index < tokens.length; index += 1) {
|
|
1073
1077
|
if (tokens[index]?.text !== 'include_str' && tokens[index]?.text !== 'include_bytes')
|
|
@@ -1082,8 +1086,14 @@ function collectCompiledInputs(source, text, found) {
|
|
|
1082
1086
|
// must reference path-sized storage, not a view into the decoded source.
|
|
1083
1087
|
const literal = Buffer.from(tokens[index + 3]?.text ?? '', 'utf8').toString('utf8');
|
|
1084
1088
|
const path = INCLUDE_STRING.exec(literal)?.[1] ?? INCLUDE_RAW_STRING.exec(literal)?.[2];
|
|
1085
|
-
if (path
|
|
1086
|
-
|
|
1089
|
+
if (path !== undefined && path !== '')
|
|
1090
|
+
spellings.push(path);
|
|
1091
|
+
}
|
|
1092
|
+
return spellings;
|
|
1093
|
+
}
|
|
1094
|
+
/** Records each existing file `source` spells, keeping the smallest declaring source and spelling per file. */
|
|
1095
|
+
function collectCompiledInputs(source, spellings, found) {
|
|
1096
|
+
for (const path of spellings) {
|
|
1087
1097
|
const file = resolve(dirname(source), path);
|
|
1088
1098
|
if (statSync(file, { throwIfNoEntry: false })?.isFile()) {
|
|
1089
1099
|
const prior = found.get(file);
|
|
@@ -1093,18 +1103,74 @@ function collectCompiledInputs(source, text, found) {
|
|
|
1093
1103
|
}
|
|
1094
1104
|
}
|
|
1095
1105
|
}
|
|
1106
|
+
/** {@link CargoSourceIndex} of Nx's file data (workspace-relative paths and content hashes) under the canonical `root`. */
|
|
1107
|
+
export function cargoSourceIndex(root, files) {
|
|
1108
|
+
const manifests = new Set();
|
|
1109
|
+
const packageDirectories = new Set();
|
|
1110
|
+
const rustSources = new Map();
|
|
1111
|
+
for (const { file, hash } of files) {
|
|
1112
|
+
if (file === 'Cargo.toml' || file.endsWith('/Cargo.toml')) {
|
|
1113
|
+
manifests.add(file);
|
|
1114
|
+
packageDirectories.add(dirname(join(root, file)));
|
|
1115
|
+
}
|
|
1116
|
+
else if (file.endsWith('.rs')) {
|
|
1117
|
+
rustSources.set(join(root, file), hash);
|
|
1118
|
+
}
|
|
1119
|
+
}
|
|
1120
|
+
return { manifests, packageDirectories, rustSources };
|
|
1121
|
+
}
|
|
1096
1122
|
/**
|
|
1097
|
-
*
|
|
1098
|
-
*
|
|
1099
|
-
*
|
|
1123
|
+
* The include spellings of every Rust source text scanned, by Nx's content hash of that text: a source whose hash is
|
|
1124
|
+
* unchanged is not read again. An entry is kept only when the text read hashes to that hash, so a write Nx's index has
|
|
1125
|
+
* not seen yet is scanned but never remembered under the hash of the bytes it replaced. Entries leave when no index
|
|
1126
|
+
* holds their hash any longer ({@link retainIncludeScans}); nothing expires by time.
|
|
1100
1127
|
*/
|
|
1101
|
-
|
|
1128
|
+
const includeScans = new Map();
|
|
1129
|
+
/** Forgets the scan of every source text `index` no longer holds. */
|
|
1130
|
+
export function retainIncludeScans(index) {
|
|
1131
|
+
const held = new Set(index.rustSources.values());
|
|
1132
|
+
for (const hash of includeScans.keys())
|
|
1133
|
+
if (!held.has(hash))
|
|
1134
|
+
includeScans.delete(hash);
|
|
1135
|
+
}
|
|
1136
|
+
function includeSpellingsOf(source, hash) {
|
|
1137
|
+
const known = includeScans.get(hash);
|
|
1138
|
+
if (known !== undefined)
|
|
1139
|
+
return known;
|
|
1140
|
+
const text = readFileSync(source, 'utf8');
|
|
1141
|
+
const spellings = includeSpellings(text);
|
|
1142
|
+
if (hashArray([text]) === hash)
|
|
1143
|
+
includeScans.set(hash, spellings);
|
|
1144
|
+
return spellings;
|
|
1145
|
+
}
|
|
1146
|
+
const SCAN_SKIPPED = new Set(HASH_SKIPPED_DIRECTORIES);
|
|
1147
|
+
/** The indexed Rust sources of the package at `root`, with their hashes: none beneath a nested package or a skipped directory. */
|
|
1148
|
+
function* packageRustSources(root, index) {
|
|
1149
|
+
const prefix = `${root}${sep}`;
|
|
1150
|
+
sources: for (const [source, hash] of index.rustSources) {
|
|
1151
|
+
if (!source.startsWith(prefix))
|
|
1152
|
+
continue;
|
|
1153
|
+
for (let directory = dirname(source); directory !== root; directory = dirname(directory)) {
|
|
1154
|
+
if (index.packageDirectories.has(directory) || SCAN_SKIPPED.has(basename(directory)))
|
|
1155
|
+
continue sources;
|
|
1156
|
+
}
|
|
1157
|
+
yield [source, hash];
|
|
1158
|
+
}
|
|
1159
|
+
}
|
|
1160
|
+
/**
|
|
1161
|
+
* Existing literal include_str!/include_bytes! files read by this package's Rust sources, as Nx's file index holds
|
|
1162
|
+
* them: a generated (ignored) source is its producer's output and keys a consumer through its dependency outputs.
|
|
1163
|
+
* One graph owns the memo; runtime hashing consumes the same discovery alongside source bytes. Nested packages own
|
|
1164
|
+
* their sources separately. Computed paths remain explicit inputs.
|
|
1165
|
+
*/
|
|
1166
|
+
export function compiledInFiles(root, index, cache) {
|
|
1102
1167
|
const cached = cache.get(root);
|
|
1103
1168
|
if (cached !== undefined)
|
|
1104
1169
|
return cached;
|
|
1105
1170
|
const found = new Map();
|
|
1106
|
-
for (const source of
|
|
1107
|
-
collectCompiledInputs(source,
|
|
1171
|
+
for (const [source, hash] of packageRustSources(root, index)) {
|
|
1172
|
+
collectCompiledInputs(source, includeSpellingsOf(source, hash), found);
|
|
1173
|
+
}
|
|
1108
1174
|
const files = [...found.values()].sort((left, right) => left.file < right.file ? -1 : left.file > right.file ? 1 : 0);
|
|
1109
1175
|
cache.set(root, files);
|
|
1110
1176
|
return files;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type TomlTable } from 'smol-toml';
|
|
2
|
-
import { type CargoResolve, type CompiledCargoInput } from './cargo-source-hash.js';
|
|
2
|
+
import { type CargoResolve, type CargoSourceIndex, type CompiledCargoInput } from './cargo-source-hash.js';
|
|
3
3
|
export interface CargoWorkspacePackage {
|
|
4
4
|
name: string;
|
|
5
5
|
dir: string;
|
|
@@ -40,6 +40,8 @@ export interface CargoPackageTestInputsOptions {
|
|
|
40
40
|
memberDir: string;
|
|
41
41
|
/** Cargo's locked resolve of that workspace, which decides the crates the member's tests build. */
|
|
42
42
|
cargo: CargoResolve;
|
|
43
|
+
/** Nx's indexed Cargo sources, where the crates' Rust sources and nested packages are found. */
|
|
44
|
+
sources: CargoSourceIndex;
|
|
43
45
|
/** Shared across every call of one graph computation; see {@link createCargoInputsCache}. */
|
|
44
46
|
cache?: CargoInputsCache;
|
|
45
47
|
}
|
|
@@ -50,7 +52,9 @@ export interface CargoPackageTestInputsOptions {
|
|
|
50
52
|
* three targets over ~45 crates that was ~135 derivations and the dominant
|
|
51
53
|
* cost of loading the graph. The cache lives exactly as long as one
|
|
52
54
|
* `createNodes` call — Nx recomputes the graph when a manifest changes, so
|
|
53
|
-
* nothing here can go stale across runs.
|
|
55
|
+
* nothing here can go stale across runs. What outlives the call is keyed by
|
|
56
|
+
* content, not by time: a Rust source's include scan by Nx's hash of it
|
|
57
|
+
* (`compiledInFiles`), so a recomputation reads only the sources that changed.
|
|
54
58
|
*/
|
|
55
59
|
export interface CargoInputsCache {
|
|
56
60
|
readonly manifests: Map<string, Promise<TomlTable>>;
|
|
@@ -59,6 +63,20 @@ export interface CargoInputsCache {
|
|
|
59
63
|
readonly results: Map<string, Promise<string[]>>;
|
|
60
64
|
}
|
|
61
65
|
export declare function createCargoInputsCache(): CargoInputsCache;
|
|
66
|
+
/** A producer output a Cargo target hashes: the files one producer edge writes under one closure file set. */
|
|
67
|
+
export interface CargoProducerOutputInput {
|
|
68
|
+
readonly dependentTasksOutputFiles: string;
|
|
69
|
+
readonly transitive: false;
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* The outputs of a Cargo target's producers its compile can read: one `dependentTasksOutputFiles` per file set of its
|
|
73
|
+
* closure (`cargoPackageTestInputs`, or the generic fallback rooted at `projectRoot`). A producer that writes a
|
|
74
|
+
* generated crate source, a compiled-in file or a manifest keys the target; one that writes anywhere else, such as a
|
|
75
|
+
* TypeScript package's `dist`, does not. Nx matches the glob against each output file's workspace-relative path (the
|
|
76
|
+
* same `matchGlobPaths` its `--check` uses), so the `{workspaceRoot}/` anchor is dropped. An exclusion or a named input
|
|
77
|
+
* has no output form, and a producer writes into no build directory the exclusions name.
|
|
78
|
+
*/
|
|
79
|
+
export declare function cargoProducerOutputInputs(inputs: readonly (string | object)[], projectRoot: string): CargoProducerOutputInput[];
|
|
62
80
|
export declare function cargoPackageTestInputs(options: CargoPackageTestInputsOptions): Promise<string[]>;
|
|
63
81
|
/**
|
|
64
82
|
* Refuses inputs outside the Nx workspace that `nx.json` gives no `externalRustCrates` runtime hash for: no fileset
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cargo-workspace.d.ts","sourceRoot":"","sources":["../src/cargo-workspace.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAE/D,OAAO,
|
|
1
|
+
{"version":3,"file":"cargo-workspace.d.ts","sourceRoot":"","sources":["../src/cargo-workspace.ts"],"names":[],"mappings":"AAIA,OAAO,EAAsB,KAAK,SAAS,EAAE,MAAM,WAAW,CAAC;AAE/D,OAAO,EAEL,KAAK,YAAY,EACjB,KAAK,gBAAgB,EACrB,KAAK,kBAAkB,EAExB,MAAM,wBAAwB,CAAC;AAEhC,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ;;;OAGG;IACH,UAAU,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,WAAW,qBAAqB;IACpC,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,+BAAgC,SAAQ,qBAAqB;IAC5E,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,wBAAgB,0BAA0B,CAAC,mBAAmB,EAAE,MAAM,GAAG,qBAAqB,EAAE,CAkF/F;AA0ED;;;;GAIG;AACH,wBAAgB,+BAA+B,CAC7C,QAAQ,EAAE,SAAS,qBAAqB,EAAE,EAC1C,QAAQ,EAAE,SAAS,qBAAqB,EAAE,GACzC,+BAA+B,EAAE,CAgBnC;AAED;;;;;;GAMG;AACH,eAAO,MAAM,0BAA0B,uBAAuB,CAAC;AAE/D,MAAM,WAAW,6BAA6B;IAC5C,oEAAoE;IACpE,aAAa,EAAE,MAAM,CAAC;IACtB,mEAAmE;IACnE,mBAAmB,EAAE,MAAM,CAAC;IAC5B,SAAS,EAAE,MAAM,CAAC;IAClB,mGAAmG;IACnG,KAAK,EAAE,YAAY,CAAC;IACpB,gGAAgG;IAChG,OAAO,EAAE,gBAAgB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AuC7E;AAED;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,GAAG,oBAAoB,CAMhE;AAmKD,iFAAiF;AACjF,eAAO,MAAM,0BAA0B,sDAAsD,CAAC;AAE9F;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA4BG;AACH,wBAAgB,oBAAoB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAGhE;AAED,+EAA+E;AAC/E,eAAO,MAAM,wBAAwB,yBAAyB,CAAC"}
|
package/dist/cargo-workspace.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { existsSync, readdirSync, readFileSync } from 'node:fs';
|
|
2
2
|
import { readFile, realpath } from 'node:fs/promises';
|
|
3
|
-
import { dirname, isAbsolute, join, posix, relative, resolve, sep } from 'node:path';
|
|
3
|
+
import { basename, dirname, isAbsolute, join, posix, relative, resolve, sep } from 'node:path';
|
|
4
4
|
import { readNxJson } from 'nx/src/config/nx-json.js';
|
|
5
5
|
import { parse as parseToml } from 'smol-toml';
|
|
6
|
-
import { buildClosure, compiledInFiles } from './cargo-source-hash.js';
|
|
6
|
+
import { buildClosure, compiledInFiles, } from './cargo-source-hash.js';
|
|
7
7
|
export function listCargoWorkspacePackages(absoluteProjectRoot) {
|
|
8
8
|
const workspaceTomlPath = join(absoluteProjectRoot, 'Cargo.toml');
|
|
9
9
|
if (!existsSync(workspaceTomlPath)) {
|
|
@@ -173,6 +173,26 @@ export const EXTERNAL_RUST_CRATES_INPUT = 'externalRustCrates';
|
|
|
173
173
|
export function createCargoInputsCache() {
|
|
174
174
|
return { manifests: new Map(), nestedCrateDirs: new Map(), compiledInFiles: new Map(), results: new Map() };
|
|
175
175
|
}
|
|
176
|
+
/**
|
|
177
|
+
* The outputs of a Cargo target's producers its compile can read: one `dependentTasksOutputFiles` per file set of its
|
|
178
|
+
* closure (`cargoPackageTestInputs`, or the generic fallback rooted at `projectRoot`). A producer that writes a
|
|
179
|
+
* generated crate source, a compiled-in file or a manifest keys the target; one that writes anywhere else, such as a
|
|
180
|
+
* TypeScript package's `dist`, does not. Nx matches the glob against each output file's workspace-relative path (the
|
|
181
|
+
* same `matchGlobPaths` its `--check` uses), so the `{workspaceRoot}/` anchor is dropped. An exclusion or a named input
|
|
182
|
+
* has no output form, and a producer writes into no build directory the exclusions name.
|
|
183
|
+
*/
|
|
184
|
+
export function cargoProducerOutputInputs(inputs, projectRoot) {
|
|
185
|
+
const globs = inputs.flatMap((input) => {
|
|
186
|
+
if (typeof input !== 'string')
|
|
187
|
+
return [];
|
|
188
|
+
if (input.startsWith('{workspaceRoot}/'))
|
|
189
|
+
return [input.slice('{workspaceRoot}/'.length)];
|
|
190
|
+
if (input.startsWith('{projectRoot}/'))
|
|
191
|
+
return [posix.join(projectRoot, input.slice('{projectRoot}/'.length))];
|
|
192
|
+
return [];
|
|
193
|
+
});
|
|
194
|
+
return [...new Set(globs)].map((glob) => ({ dependentTasksOutputFiles: glob, transitive: false }));
|
|
195
|
+
}
|
|
176
196
|
export function cargoPackageTestInputs(options) {
|
|
177
197
|
const cache = options.cache ?? createCargoInputsCache();
|
|
178
198
|
const key = `${options.absoluteProjectRoot}\0${options.memberDir}`;
|
|
@@ -183,7 +203,7 @@ export function cargoPackageTestInputs(options) {
|
|
|
183
203
|
cache.results.set(key, derived);
|
|
184
204
|
return derived;
|
|
185
205
|
}
|
|
186
|
-
async function deriveCargoPackageTestInputs({ workspaceRoot, absoluteProjectRoot, memberDir, cargo }, cache) {
|
|
206
|
+
async function deriveCargoPackageTestInputs({ workspaceRoot, absoluteProjectRoot, memberDir, cargo, sources }, cache) {
|
|
187
207
|
// Every fileset is anchored at `{workspaceRoot}`, never `{projectRoot}`: Nx
|
|
188
208
|
// hashes a `{projectRoot}` glob against only the files its project OWNS, and
|
|
189
209
|
// a nested Nx project owns the crates under it. A repository-root cargo
|
|
@@ -253,7 +273,7 @@ async function deriveCargoPackageTestInputs({ workspaceRoot, absoluteProjectRoot
|
|
|
253
273
|
// Cargo packages can compile include_bytes!, headers, schemas and build.rs,
|
|
254
274
|
// not only Rust sources. Nested packages are separate source owners.
|
|
255
275
|
inputs.add(`${inputPath(absoluteDir)}/**/*`);
|
|
256
|
-
for (const child of nestedCrateDirs(absoluteDir, cache)) {
|
|
276
|
+
for (const child of nestedCrateDirs(absoluteDir, sources, cache)) {
|
|
257
277
|
const childDir = relative(cargoRoot, child).split(sep).join('/');
|
|
258
278
|
if (!dirs.has(childDir))
|
|
259
279
|
exclusions.add(`!${inputPath(child)}/**`);
|
|
@@ -261,7 +281,7 @@ async function deriveCargoPackageTestInputs({ workspaceRoot, absoluteProjectRoot
|
|
|
261
281
|
// `include_str!("../../../skills/SKILL.md")` compiles a file the package's own
|
|
262
282
|
// fileset does not reach; a target that does not hash it serves a binary
|
|
263
283
|
// built from the file's old bytes.
|
|
264
|
-
for (const { file } of compiledInFiles(absoluteDir, cache.compiledInFiles)) {
|
|
284
|
+
for (const { file } of compiledInFiles(absoluteDir, sources, cache.compiledInFiles)) {
|
|
265
285
|
if (isOutsideRoot(relative(absoluteDir, file)))
|
|
266
286
|
declaredSources.add(file);
|
|
267
287
|
}
|
|
@@ -338,30 +358,30 @@ export function requireExternalRustCratesInput(workspaceRoot, manifest, external
|
|
|
338
358
|
'with runtime inputs that hash those external sources and configuration');
|
|
339
359
|
}
|
|
340
360
|
/** Every directory beneath `root` that holds its own `Cargo.toml`, the walk stopping at each. */
|
|
341
|
-
|
|
361
|
+
/** Directories whose packages are never nested crates of a package: build output, VCS and Nx state, installed packages. */
|
|
362
|
+
const NESTED_CRATE_SKIPPED = new Set(['target', '.git', 'node_modules', '.nx']);
|
|
363
|
+
/**
|
|
364
|
+
* The packages nested in the package at `root`: the indexed package directories beneath it with no other package,
|
|
365
|
+
* and no skipped directory, in between. Read from Nx's file index, so no directory is listed and no path probed.
|
|
366
|
+
*/
|
|
367
|
+
function nestedCrateDirs(root, sources, cache) {
|
|
342
368
|
const cached = cache.nestedCrateDirs.get(root);
|
|
343
369
|
if (cached !== undefined)
|
|
344
370
|
return cached;
|
|
371
|
+
const prefix = `${root}${sep}`;
|
|
345
372
|
const found = [];
|
|
346
|
-
const
|
|
347
|
-
|
|
348
|
-
const current = scan.pop();
|
|
349
|
-
if (current === undefined || !existsSync(current))
|
|
373
|
+
nested: for (const directory of sources.packageDirectories) {
|
|
374
|
+
if (!directory.startsWith(prefix))
|
|
350
375
|
continue;
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
}
|
|
357
|
-
else if (existsSync(join(child, 'Cargo.toml'))) {
|
|
358
|
-
found.push(child);
|
|
359
|
-
}
|
|
360
|
-
else {
|
|
361
|
-
scan.push(child);
|
|
362
|
-
}
|
|
376
|
+
if (NESTED_CRATE_SKIPPED.has(basename(directory)))
|
|
377
|
+
continue;
|
|
378
|
+
for (let parent = dirname(directory); parent !== root; parent = dirname(parent)) {
|
|
379
|
+
if (sources.packageDirectories.has(parent) || NESTED_CRATE_SKIPPED.has(basename(parent)))
|
|
380
|
+
continue nested;
|
|
363
381
|
}
|
|
382
|
+
found.push(directory);
|
|
364
383
|
}
|
|
384
|
+
found.sort();
|
|
365
385
|
cache.nestedCrateDirs.set(root, found);
|
|
366
386
|
return found;
|
|
367
387
|
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { DependencyManifest } from './dependency-manifests.js';
|
|
2
|
+
/**
|
|
3
|
+
* The environment variables a project's transformed output depends on, over its direct dependencies' manifests, once
|
|
4
|
+
* each in declaration order. A manifest that declares `smoo.compileEnv` in another shape refuses the inference by its
|
|
5
|
+
* path and the field it got wrong.
|
|
6
|
+
*/
|
|
7
|
+
export declare function compileEnvironment(manifests: readonly DependencyManifest[]): string[];
|
|
8
|
+
//# sourceMappingURL=compile-environment.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"compile-environment.d.ts","sourceRoot":"","sources":["../src/compile-environment.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAcpE;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,SAAS,EAAE,SAAS,kBAAkB,EAAE,GAAG,MAAM,EAAE,CAcrF"}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import * as _validateReport_1 from "typia/lib/internal/_validateReport";
|
|
2
|
+
import * as _createStandardSchema_1 from "typia/lib/internal/_createStandardSchema";
|
|
3
|
+
import typia from 'typia';
|
|
4
|
+
const validateManifest = (() => {
|
|
5
|
+
let errors;
|
|
6
|
+
let _report;
|
|
7
|
+
const _io0 = input => undefined === input.smoo || "object" === typeof input.smoo && null !== input.smoo && false === Array.isArray(input.smoo) && _io1(input.smoo);
|
|
8
|
+
const _io1 = input => undefined === input.compileEnv || Array.isArray(input.compileEnv) && input.compileEnv.every(elem => "string" === typeof elem);
|
|
9
|
+
const _vo0 = (input, _path, _exceptionable = true) => [undefined === input.smoo || ("object" === typeof input.smoo && null !== input.smoo && false === Array.isArray(input.smoo) || _report(_exceptionable, {
|
|
10
|
+
path: _path + ".smoo",
|
|
11
|
+
expected: "(undefined | { readonly compileEnv?: readonly string[] | undefined; })",
|
|
12
|
+
value: input.smoo
|
|
13
|
+
})) && _vo1(input.smoo, _path + ".smoo", true && _exceptionable) || _report(_exceptionable, {
|
|
14
|
+
path: _path + ".smoo",
|
|
15
|
+
expected: "(undefined | { readonly compileEnv?: readonly string[] | undefined; })",
|
|
16
|
+
value: input.smoo
|
|
17
|
+
})].every(flag => flag);
|
|
18
|
+
const _vo1 = (input, _path, _exceptionable = true) => [undefined === input.compileEnv || (Array.isArray(input.compileEnv) || _report(_exceptionable, {
|
|
19
|
+
path: _path + ".compileEnv",
|
|
20
|
+
expected: "(ReadonlyArray<string> | undefined)",
|
|
21
|
+
value: input.compileEnv
|
|
22
|
+
})) && input.compileEnv.map((elem, _index2) => "string" === typeof elem || _report(_exceptionable, {
|
|
23
|
+
path: _path + ".compileEnv[" + _index2 + "]",
|
|
24
|
+
expected: "string",
|
|
25
|
+
value: elem
|
|
26
|
+
})).every(flag => flag) || _report(_exceptionable, {
|
|
27
|
+
path: _path + ".compileEnv",
|
|
28
|
+
expected: "(ReadonlyArray<string> | undefined)",
|
|
29
|
+
value: input.compileEnv
|
|
30
|
+
})].every(flag => flag);
|
|
31
|
+
const __is = input => "object" === typeof input && null !== input && false === Array.isArray(input) && _io0(input);
|
|
32
|
+
return _createStandardSchema_1._createStandardSchema(input => {
|
|
33
|
+
if (false === __is(input)) {
|
|
34
|
+
errors = [];
|
|
35
|
+
_report = _validateReport_1._validateReport(errors);
|
|
36
|
+
((input, _path, _exceptionable = true) => ("object" === typeof input && null !== input && false === Array.isArray(input) || _report(true, {
|
|
37
|
+
path: _path + "",
|
|
38
|
+
expected: "DeclaringManifest",
|
|
39
|
+
value: input
|
|
40
|
+
})) && _vo0(input, _path + "", true) || _report(true, {
|
|
41
|
+
path: _path + "",
|
|
42
|
+
expected: "DeclaringManifest",
|
|
43
|
+
value: input
|
|
44
|
+
}))(input, "$input", true);
|
|
45
|
+
const success = 0 === errors.length;
|
|
46
|
+
return success ? {
|
|
47
|
+
success,
|
|
48
|
+
data: input
|
|
49
|
+
} : {
|
|
50
|
+
success,
|
|
51
|
+
errors,
|
|
52
|
+
data: input
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return {
|
|
56
|
+
success: true,
|
|
57
|
+
data: input
|
|
58
|
+
};
|
|
59
|
+
});
|
|
60
|
+
})();
|
|
61
|
+
/**
|
|
62
|
+
* The environment variables a project's transformed output depends on, over its direct dependencies' manifests, once
|
|
63
|
+
* each in declaration order. A manifest that declares `smoo.compileEnv` in another shape refuses the inference by its
|
|
64
|
+
* path and the field it got wrong.
|
|
65
|
+
*/
|
|
66
|
+
export function compileEnvironment(manifests) {
|
|
67
|
+
const names = [];
|
|
68
|
+
for (const manifest of manifests) {
|
|
69
|
+
const checked = validateManifest(manifest.json);
|
|
70
|
+
if (!checked.success) {
|
|
71
|
+
throw new Error(`${manifest.path}: smoo.compileEnv must be ['<VARIABLE>', ...]: ${checked.errors
|
|
72
|
+
.map((error) => `${error.path} expected ${error.expected}`)
|
|
73
|
+
.join('; ')}`);
|
|
74
|
+
}
|
|
75
|
+
for (const name of checked.data.smoo?.compileEnv ?? [])
|
|
76
|
+
if (!names.includes(name))
|
|
77
|
+
names.push(name);
|
|
78
|
+
}
|
|
79
|
+
return names;
|
|
80
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/** One installed direct dependency's manifest: its package name, where it is, and its parsed JSON. */
|
|
2
|
+
export interface DependencyManifest {
|
|
3
|
+
readonly name: string;
|
|
4
|
+
readonly path: string;
|
|
5
|
+
readonly json: unknown;
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* The manifests of a project's direct dependencies, the ones ttsc discovers plugins on (`dependencies` and
|
|
9
|
+
* `devDependencies`), once per name. Each is the manifest Node resolution reaches from the project, as ttsc reads it;
|
|
10
|
+
* a dependency that is not installed has none. Read once per project, for every declaration inference reads from them.
|
|
11
|
+
*/
|
|
12
|
+
export declare function directDependencyManifests(packageJsonPath: string, dependencies: readonly string[]): DependencyManifest[];
|
|
13
|
+
//# sourceMappingURL=dependency-manifests.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"dependency-manifests.d.ts","sourceRoot":"","sources":["../src/dependency-manifests.ts"],"names":[],"mappings":"AAIA,sGAAsG;AACtG,MAAM,WAAW,kBAAkB;IACjC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,OAAO,CAAC;CACxB;AAED;;;;GAIG;AACH,wBAAgB,yBAAyB,CACvC,eAAe,EAAE,MAAM,EACvB,YAAY,EAAE,SAAS,MAAM,EAAE,GAC9B,kBAAkB,EAAE,CAUtB"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from 'node:fs';
|
|
2
|
+
import { createRequire } from 'node:module';
|
|
3
|
+
import { join } from 'node:path';
|
|
4
|
+
/**
|
|
5
|
+
* The manifests of a project's direct dependencies, the ones ttsc discovers plugins on (`dependencies` and
|
|
6
|
+
* `devDependencies`), once per name. Each is the manifest Node resolution reaches from the project, as ttsc reads it;
|
|
7
|
+
* a dependency that is not installed has none. Read once per project, for every declaration inference reads from them.
|
|
8
|
+
*/
|
|
9
|
+
export function directDependencyManifests(packageJsonPath, dependencies) {
|
|
10
|
+
const lookup = createRequire(packageJsonPath);
|
|
11
|
+
const manifests = [];
|
|
12
|
+
for (const name of new Set(dependencies)) {
|
|
13
|
+
const path = (lookup.resolve.paths(name) ?? [])
|
|
14
|
+
.map((root) => join(root, ...name.split('/'), 'package.json'))
|
|
15
|
+
.find((candidate) => existsSync(candidate));
|
|
16
|
+
if (path !== undefined)
|
|
17
|
+
manifests.push({ name, path, json: JSON.parse(readFileSync(path, 'utf-8')) });
|
|
18
|
+
}
|
|
19
|
+
return manifests;
|
|
20
|
+
}
|
|
@@ -28,8 +28,9 @@ export interface ProducerSourceWitness {
|
|
|
28
28
|
readonly outputs: readonly string[];
|
|
29
29
|
}
|
|
30
30
|
/**
|
|
31
|
-
* Git as receipts read it: the checkout and nothing of the operator's home. The producer hooks run in
|
|
32
|
-
*
|
|
31
|
+
* Git as receipts read it: the checkout and nothing of the operator's home. The producer hooks run in the process that
|
|
32
|
+
* runs the tasks (patches/README.md, "A run's task hooks run in its own process"), a host shell's or a sandboxed job's,
|
|
33
|
+
* under whatever HOME that process has; git with the operator's HOME
|
|
33
34
|
* reads the operator's global configuration, the sandbox denies it, and git dies (specs/cowshed/04_sandbox.md, the
|
|
34
35
|
* runtime-input contract). A receipt's tree, HEAD and tracked-file status are read under the repository's own
|
|
35
36
|
* configuration alone, so a host run and a sandboxed run agree on them.
|
|
@@ -1 +1 @@
|
|
|
1
|
-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oToolchainPathsInput } from './cargo-toolchain-policy.js';
|
|
6
6
|
import { censusStart, directoryMembers, movedNodes, recordedStamp, } from './ensure-built-witness.js';
|
|
7
7
|
/**
|
|
8
|
-
* Git as receipts read it: the checkout and nothing of the operator's home. The producer hooks run in
|
|
9
|
-
*
|
|
8
|
+
* Git as receipts read it: the checkout and nothing of the operator's home. The producer hooks run in the process that
|
|
9
|
+
* runs the tasks (patches/README.md, "A run's task hooks run in its own process"), a host shell's or a sandboxed job's,
|
|
10
|
+
* under whatever HOME that process has; git with the operator's HOME
|
|
10
11
|
* reads the operator's global configuration, the sandbox denies it, and git dies (specs/cowshed/04_sandbox.md, the
|
|
11
12
|
* runtime-input contract). A receipt's tree, HEAD and tracked-file status are read under the repository's own
|
|
12
13
|
* configuration alone, so a host run and a sandboxed run agree on them.
|