@smoothbricks/nx-plugin 0.4.24 → 0.4.25

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 CHANGED
@@ -38,6 +38,13 @@ Keep `targetDefaults.lint` limited to shared cache policy. Smoo's workspace poli
38
38
  commands, dependencies, inputs and outputs because they override source-aware inference for every project. Project-local
39
39
  `nx.targets.lint` declarations retain normal Nx override precedence.
40
40
 
41
+ The plugin's own `nx run nx-plugin:test` aggregates four bounded Bun targets. Each uses Bun's native
42
+ `--timings=test-timings.json --shard=N/4` partition to balance measured per-file work, while normal discovery still runs
43
+ every test file (including newly added files) exactly once. A failed shard fails the aggregate. The shard count,
44
+ parallelism and standard 120-second target deadline stay unchanged. Refresh the portable timing manifest from this
45
+ package directory with `bun test --timeout=30000 --timings=test-timings.json --update-timings`; it is scheduling data,
46
+ not a test allowlist.
47
+
41
48
  ## Cargo Workspace Layouts
42
49
 
43
50
  The plugin discovers Cargo workspaces beside Nx project manifests at any depth:
@@ -1 +1 @@
1
- {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/managed-files/files.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACb,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,6BAA6B,EAC7B,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,kBAAkB,EAAmD,MAAM,kBAAkB,CAAC;AAI5G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAa7C,MAAM,WAAW,kBAAkB;IACjC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,uBAAuB,EAAE,OAAO,CAAC;IACjC,0BAA0B,EAAE,OAAO,CAAC;IACpC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,uBAAuB,EAAE,OAAO,CAAC;IACjC,8BAA8B,EAAE,OAAO,CAAC;IACxC,qBAAqB,CAAC,EAAE,YAAY,CAAC;IACrC,wBAAwB,CAAC,EAAE,YAAY,CAAC;IACxC,cAAc,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B,yFAAyF;IACzF,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,gBAAgB,CAAC,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IACzD,eAAe,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACvD,cAAc,CAAC,EAAE,6BAA6B,CAAC;IAC/C,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,qFAAqF;IACrF,0BAA0B,EAAE,MAAM,EAAE,CAAC;IACrC,0BAA0B,EAAE,MAAM,EAAE,CAAC;IACrC,wFAAwF;IACxF,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,sFAAsF;IACtF,eAAe,CAAC,EAAE,2BAA2B,EAAE,CAAC;IAChD,kGAAkG;IAClG,gBAAgB,CAAC,EAAE,6BAA6B,CAAC;IACjD,uGAAuG;IACvG,WAAW,CAAC,EAAE,wBAAwB,CAAC;IACvC;;;;OAIG;IACH,iBAAiB,EAAE,kBAAkB,EAAE,CAAC;CACzC;AAED,sFAAsF;AACtF,eAAO,MAAM,gBAAgB;aAC3B,OAAO,EAAE,QAAQ;aACjB,GAAG,EAAE,aAAa;aAClB,IAAI,EAAE,2BAA2B;CACzB,CAAC;AA6JX,eAAO,MAAM,yBAAyB;;;GAAyE,CAAC;AAchH,qFAAqF;AACrF,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAElF;AAED,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,GAAG,WAAW,EAAE,CAM7E;AAED,+GAA+G;AAC/G,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,aAAa,GAAG,kBAAkB,GAAG,6BAA6B,EAC1E,OAAO,EAAE,kBAAkB,GAC1B,MAAM,CAMR"}
1
+ {"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/managed-files/files.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,aAAa,EACb,6BAA6B,EAC7B,uBAAuB,EACvB,wBAAwB,EACxB,iBAAiB,EACjB,6BAA6B,EAC7B,2BAA2B,EAC5B,MAAM,0BAA0B,CAAC;AAClC,OAAO,EAAE,KAAK,kBAAkB,EAAmD,MAAM,kBAAkB,CAAC;AAI5G,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,WAAW,CAAC;AAa7C,MAAM,WAAW,kBAAkB;IACjC,kBAAkB,EAAE,OAAO,CAAC;IAC5B,uBAAuB,EAAE,OAAO,CAAC;IACjC,0BAA0B,EAAE,OAAO,CAAC;IACpC,qBAAqB,EAAE,OAAO,CAAC;IAC/B,uBAAuB,EAAE,OAAO,CAAC;IACjC,8BAA8B,EAAE,OAAO,CAAC;IACxC,qBAAqB,CAAC,EAAE,YAAY,CAAC;IACrC,wBAAwB,CAAC,EAAE,YAAY,CAAC;IACxC,cAAc,EAAE,aAAa,CAAC,MAAM,CAAC,CAAC;IACtC,QAAQ,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC5B,yFAAyF;IACzF,WAAW,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IAC/B,gBAAgB,CAAC,EAAE,iBAAiB,CAAC,kBAAkB,CAAC,CAAC;IACzD,eAAe,CAAC,EAAE,iBAAiB,CAAC,iBAAiB,CAAC,CAAC;IACvD,cAAc,CAAC,EAAE,6BAA6B,CAAC;IAC/C,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACxC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACrC,mBAAmB,EAAE,MAAM,CAAC;IAC5B,QAAQ,EAAE,MAAM,CAAC;IACjB,mBAAmB,EAAE,MAAM,EAAE,CAAC;IAC9B,qFAAqF;IACrF,0BAA0B,EAAE,MAAM,EAAE,CAAC;IACrC,0BAA0B,EAAE,MAAM,EAAE,CAAC;IACrC,wFAAwF;IACxF,UAAU,CAAC,EAAE,uBAAuB,CAAC;IACrC,sFAAsF;IACtF,eAAe,CAAC,EAAE,2BAA2B,EAAE,CAAC;IAChD,kGAAkG;IAClG,gBAAgB,CAAC,EAAE,6BAA6B,CAAC;IACjD,uGAAuG;IACvG,WAAW,CAAC,EAAE,wBAAwB,CAAC;IACvC;;;;OAIG;IACH,iBAAiB,EAAE,kBAAkB,EAAE,CAAC;CACzC;AAED,sFAAsF;AACtF,eAAO,MAAM,gBAAgB;aAC3B,OAAO,EAAE,QAAQ;aACjB,GAAG,EAAE,aAAa;aAClB,IAAI,EAAE,2BAA2B;CACzB,CAAC;AAmKX,eAAO,MAAM,yBAAyB;;;GAAyE,CAAC;AAchH,qFAAqF;AACrF,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,kBAAkB,GAAG,MAAM,EAAE,CAElF;AAED,0EAA0E;AAC1E,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,kBAAkB,GAAG,WAAW,EAAE,CAM7E;AAED,+GAA+G;AAC/G,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,aAAa,GAAG,kBAAkB,GAAG,6BAA6B,EAC1E,OAAO,EAAE,kBAAkB,GAC1B,MAAM,CAMR"}
@@ -72,6 +72,12 @@ const managedFiles = [
72
72
  source: 'tooling/direnv/shared-caches.sh',
73
73
  target: 'tooling/direnv/shared-caches.sh',
74
74
  },
75
+ {
76
+ kind: 'raw',
77
+ source: 'tooling/direnv/inherited-devenv.ts',
78
+ target: 'tooling/direnv/inherited-devenv.ts',
79
+ executable: true,
80
+ },
75
81
  {
76
82
  kind: 'raw',
77
83
  source: 'tooling/git-hooks/pre-commit.sh',
package/managed/raw/envrc CHANGED
@@ -31,8 +31,18 @@ unset devenv_keys
31
31
  # leaves us there and a bare relative path would resolve under tooling/direnv.
32
32
  project_root="$PWD"
33
33
  local_override="$project_root/.envrc-local"
34
+ # The origin checkout publishes a credential-free evaluated shell inside its
35
+ # private .devenv; cowshed clones inherit it copy-on-write. No sibling-owned
36
+ # writable cache can provide shell code. Changed inputs evaluate in place.
37
+ watch_file tooling/direnv/inherited-devenv.ts
38
+ smoo_inherited_devenv() {
39
+ bun "$project_root/tooling/direnv/inherited-devenv.ts" "$project_root" "$@"
40
+ }
41
+ DEVENV_BIN=smoo_inherited_devenv
34
42
  cd tooling/direnv
35
43
  . envrc.sh
44
+ unset -f smoo_inherited_devenv
45
+ unset DEVENV_BIN
36
46
 
37
47
  # Re-enter exactly when shell entry has something to do. The scripts it runs
38
48
  # decide what that is, and setup-environment.ts records the files its install
@@ -55,6 +55,7 @@ formatters:
55
55
  # Cargo lockfiles are generated and should not be rewritten by Prettier
56
56
  - '!Cargo.lock'
57
57
  # Binary artifacts: not text, nothing for Prettier to do.
58
+ - '!*.bin'
58
59
  - '!*.wasm'
59
60
  - '!*.wasm.sha256'
60
61
  # Prettier has no parser for these; --ignore-unknown swallows stdin and
@@ -386,6 +386,10 @@ in {
386
386
  # a subprocess of either), and one socket dir for two workspaces makes the
387
387
  # daemon refuse whichever came second ("received a message from a
388
388
  # different workspace"). Nobody supplies this deliberately.
389
+ #
390
+ # In a cowshed sandbox an inherited private .devenv can supply the
391
+ # evaluated shell after its inputs and task graph are checked. The merged
392
+ # hook still runs only when direnv imports the workspace's own export.
389
393
  (lib.mkBefore ''
390
394
  cd "$DEVENV_ROOT/../.."
391
395
  export PATH="$("$PWD/tooling/direnv/repo-path")"
@@ -0,0 +1,615 @@
1
+ #!/usr/bin/env bun
2
+ import { randomUUID } from 'node:crypto';
3
+ /**
4
+ * Managed by `smoo monorepo`. A cowshed clone inherits its origin's .devenv
5
+ * along with the source tree. Reuse a real devenv export from that private
6
+ * image only while the evaluated inputs and toolchain still agree. No shell
7
+ * reads a writable cache belonging to another workspace.
8
+ */
9
+ import {
10
+ existsSync,
11
+ lstatSync,
12
+ mkdirSync,
13
+ readdirSync,
14
+ readFileSync,
15
+ readlinkSync,
16
+ realpathSync,
17
+ renameSync,
18
+ statSync,
19
+ writeFileSync,
20
+ } from 'node:fs';
21
+ import path from 'node:path';
22
+
23
+ const DEVENV_DIR = 'tooling/direnv';
24
+ const ARTIFACT = 'inherited-shell.json';
25
+ const ENV_PATHS = [
26
+ 'HOME',
27
+ 'TMPDIR',
28
+ 'XDG_RUNTIME_DIR',
29
+ 'XDG_CONFIG_HOME',
30
+ 'XDG_CACHE_HOME',
31
+ 'XDG_DATA_HOME',
32
+ 'XDG_STATE_HOME',
33
+ 'DEVENV_HOME',
34
+ 'DIRENV_CONFIG',
35
+ 'NX_SOCKET_DIR',
36
+ ] as const;
37
+ // Nix receives no caller credential, gateway token, or ambient impure override
38
+ // while creating an artifact. A live shell still runs with its exact caller env.
39
+ const EVALUATOR_ENV = [
40
+ 'PATH',
41
+ 'HOME',
42
+ 'TMPDIR',
43
+ 'XDG_RUNTIME_DIR',
44
+ 'XDG_CONFIG_HOME',
45
+ 'XDG_CACHE_HOME',
46
+ 'XDG_DATA_HOME',
47
+ 'XDG_STATE_HOME',
48
+ 'DEVENV_HOME',
49
+ 'DIRENV_CONFIG',
50
+ 'NX_SOCKET_DIR',
51
+ 'USER',
52
+ 'LOGNAME',
53
+ 'SHELL',
54
+ 'LANG',
55
+ 'LC_ALL',
56
+ 'LC_CTYPE',
57
+ 'TERM',
58
+ 'NIX_SSL_CERT_FILE',
59
+ 'SSL_CERT_FILE',
60
+ 'NODE_EXTRA_CA_CERTS',
61
+ 'GIT_SSL_CAINFO',
62
+ 'DEVELOPER_DIR',
63
+ 'SDKROOT',
64
+ ] as const;
65
+
66
+ type Watch = { readonly scope: 'root' | 'home' | 'runtime' | 'tmp' | 'store'; readonly relative: string };
67
+ type Entry = {
68
+ readonly relative: string;
69
+ readonly kind: 'file' | 'link';
70
+ readonly executable?: boolean;
71
+ readonly target?: string;
72
+ };
73
+ interface Artifact {
74
+ readonly version: 1;
75
+ readonly root: string;
76
+ readonly paths: Readonly<Record<string, string>>;
77
+ readonly basis: string;
78
+ readonly graphBasis: string;
79
+ readonly watches: readonly Watch[];
80
+ readonly watchBasis: string;
81
+ readonly toolchain: string;
82
+ readonly export: string;
83
+ }
84
+
85
+ function privateEnvironment(env: NodeJS.ProcessEnv): NodeJS.ProcessEnv {
86
+ const selected: NodeJS.ProcessEnv = {};
87
+ for (const name of EVALUATOR_ENV) {
88
+ const value = env[name];
89
+ if (value !== undefined) selected[name] = value;
90
+ }
91
+ return selected;
92
+ }
93
+
94
+ function toolchain(env: NodeJS.ProcessEnv): string | undefined {
95
+ const versions: string[] = [];
96
+ for (const command of [
97
+ ['devenv', 'version'],
98
+ ['nix', '--version'],
99
+ ]) {
100
+ const result = Bun.spawnSync(command, { env, stdout: 'pipe', stderr: 'pipe' });
101
+ if (result.exitCode !== 0) return undefined;
102
+ versions.push(result.stdout.toString().trim());
103
+ }
104
+ return `${process.platform}/${process.arch}\n${versions.join('\n')}`;
105
+ }
106
+
107
+ /** devenv's runtime directory is keyed by the dotfile, not by DEVENV_RUNTIME. */
108
+ export function devenvRuntimeDir(xdg: string | undefined, dotfile: string): string {
109
+ const hash = new Bun.CryptoHasher('sha256').update(dotfile).digest('hex');
110
+ return path.join(xdg || '/tmp', `devenv-${hash.slice(0, 7)}`);
111
+ }
112
+
113
+ function pathsOf(root: string, env: NodeJS.ProcessEnv): Record<string, string> {
114
+ const paths: Record<string, string> = {};
115
+ for (const name of ENV_PATHS) {
116
+ const value = env[name];
117
+ if (value) paths[name] = value;
118
+ }
119
+ paths.DEVENV_RUNTIME = devenvRuntimeDir(env.XDG_RUNTIME_DIR, path.join(root, DEVENV_DIR, '.devenv'));
120
+ return paths;
121
+ }
122
+
123
+ export interface Relocation {
124
+ readonly from: string;
125
+ readonly to: string;
126
+ }
127
+ export function relocations(
128
+ origin: string,
129
+ originPaths: Readonly<Record<string, string>>,
130
+ root: string,
131
+ env: NodeJS.ProcessEnv,
132
+ ): Relocation[] {
133
+ const current = pathsOf(root, env);
134
+ const moves: Relocation[] = [];
135
+ for (const [name, from] of Object.entries(originPaths)) {
136
+ const to = current[name];
137
+ if (to && from !== to) moves.push({ from, to });
138
+ }
139
+ moves.push({ from: origin, to: root });
140
+ moves.sort((left, right) => right.from.length - left.from.length);
141
+ return moves;
142
+ }
143
+ export function relocate(text: string, moves: readonly Relocation[]): string {
144
+ // Match only the original export: a replacement can itself start with HOME,
145
+ // especially when a host's checkout lives below HOME.
146
+ let cursor = 0;
147
+ let result = '';
148
+ while (cursor < text.length) {
149
+ let next = text.length;
150
+ let selected: Relocation | undefined;
151
+ for (const move of moves) {
152
+ if (!move.from) continue;
153
+ const found = text.indexOf(move.from, cursor);
154
+ if (found !== -1 && (found < next || (found === next && move.from.length > (selected?.from.length ?? 0)))) {
155
+ next = found;
156
+ selected = move;
157
+ }
158
+ }
159
+ if (!selected) break;
160
+ result += text.slice(cursor, next) + selected.to;
161
+ cursor = next + selected.from.length;
162
+ }
163
+ return result + text.slice(cursor);
164
+ }
165
+
166
+ /** Local path inputs have Nix's layout; unknown YAML imports are not guessed. */
167
+ function pathInputs(root: string): string[] {
168
+ const dir = path.join(root, DEVENV_DIR);
169
+ const yaml = path.join(dir, 'devenv.yaml');
170
+ const document: unknown = Bun.YAML.parse(readFileSync(yaml, 'utf8'));
171
+ if (typeof document !== 'object' || document === null || Array.isArray(document))
172
+ throw new Error(`${yaml} is not a mapping`);
173
+ if ('imports' in document && Array.isArray(document.imports) && document.imports.length > 0) {
174
+ throw new Error(`${yaml} imports modules outside the captured inputs`);
175
+ }
176
+ const inputs = 'inputs' in document ? document.inputs : undefined;
177
+ const directories = new Set<string>();
178
+ for (const [name, input] of Object.entries(typeof inputs === 'object' && inputs !== null ? inputs : {})) {
179
+ const url: unknown = typeof input === 'object' && input !== null && 'url' in input ? input.url : undefined;
180
+ if (typeof url !== 'string' || !url.startsWith('path:')) continue;
181
+ const resolved = realpathSync(path.resolve(dir, url.slice(5)));
182
+ if (!resolved.startsWith(`${root}/`) || !statSync(resolved).isDirectory()) {
183
+ throw new Error(`path input ${name} is not a directory inside ${root}`);
184
+ }
185
+ const relative = path.relative(root, resolved);
186
+ if (relative !== DEVENV_DIR && !relative.startsWith(`${DEVENV_DIR}/`)) directories.add(relative);
187
+ }
188
+ return [...directories].sort();
189
+ }
190
+
191
+ function entriesUnder(
192
+ root: string,
193
+ relative: string,
194
+ followLinks: boolean,
195
+ entries: Entry[],
196
+ ancestors: ReadonlySet<string>,
197
+ ): void {
198
+ const absolute = path.join(root, relative);
199
+ const stat = lstatSync(absolute);
200
+ if (stat.isSymbolicLink() && !followLinks) {
201
+ entries.push({ relative, kind: 'link', target: readlinkSync(absolute) });
202
+ return;
203
+ }
204
+ const real = realpathSync(absolute);
205
+ if (!real.startsWith(`${root}/`)) throw new Error(`${absolute} resolves outside ${root}`);
206
+ if (ancestors.has(real)) throw new Error(`${absolute} links back into itself`);
207
+ const target = statSync(absolute);
208
+ if (target.isDirectory()) {
209
+ const inside = new Set(ancestors).add(real);
210
+ for (const name of readdirSync(absolute).sort()) {
211
+ if (relative === DEVENV_DIR && (name === '.devenv' || name === '.direnv')) continue;
212
+ entriesUnder(root, path.join(relative, name), followLinks, entries, inside);
213
+ }
214
+ } else if (target.isFile()) {
215
+ entries.push({ relative, kind: 'file', executable: (target.mode & 0o100) !== 0 });
216
+ }
217
+ }
218
+
219
+ function sourceBasis(root: string): string {
220
+ const entries: Entry[] = [];
221
+ entriesUnder(root, DEVENV_DIR, true, entries, new Set());
222
+ for (const relative of pathInputs(root)) entriesUnder(root, relative, false, entries, new Set());
223
+ entries.sort((left, right) => left.relative.localeCompare(right.relative));
224
+ const hash = new Bun.CryptoHasher('sha256');
225
+ for (const entry of entries) {
226
+ if (entry.kind === 'link') {
227
+ hash.update(`link\0${entry.relative}\0${entry.target}\0`);
228
+ } else {
229
+ const bytes = readFileSync(path.join(root, entry.relative));
230
+ hash.update(`file\0${entry.relative}\0${entry.executable ? 'x' : '-'}\0${bytes.byteLength}\0`);
231
+ hash.update(bytes);
232
+ }
233
+ }
234
+ return hash.digest('hex');
235
+ }
236
+
237
+ function watchPaths(root: string, env: NodeJS.ProcessEnv): Watch[] {
238
+ const inputPaths = readFileSync(path.join(root, DEVENV_DIR, '.devenv', 'input-paths.txt'), 'utf8');
239
+ const home = env.HOME;
240
+ const runtime = devenvRuntimeDir(env.XDG_RUNTIME_DIR, path.join(root, DEVENV_DIR, '.devenv'));
241
+ const tmp = env.TMPDIR || '/tmp';
242
+ const bases: readonly [Watch['scope'], string | undefined][] = [
243
+ ['runtime', runtime],
244
+ ['home', home],
245
+ ['root', root],
246
+ ['tmp', tmp],
247
+ ['store', '/nix/store'],
248
+ ];
249
+ const watches = new Map<string, Watch>();
250
+ for (const input of inputPaths.split('\n').filter(Boolean)) {
251
+ if (!path.isAbsolute(input)) throw new Error(`devenv input is not absolute: ${input}`);
252
+ const match = [...bases]
253
+ .sort((a, b) => (b[1]?.length ?? 0) - (a[1]?.length ?? 0))
254
+ .find(([, base]) => base && (input === base || input.startsWith(`${base}/`)));
255
+ if (!match || !match[1]) throw new Error(`devenv input is outside isolated roots: ${input}`);
256
+ const relative = path.relative(match[1], input);
257
+ const watch: Watch = { scope: match[0], relative };
258
+ watches.set(`${watch.scope}:${watch.relative}`, watch);
259
+ }
260
+ return [...watches.values()].sort((a, b) => `${a.scope}:${a.relative}`.localeCompare(`${b.scope}:${b.relative}`));
261
+ }
262
+
263
+ function watchedBasis(root: string, env: NodeJS.ProcessEnv, watches: readonly Watch[]): string {
264
+ const bases: Record<Watch['scope'], string> = {
265
+ root,
266
+ home: env.HOME ?? '',
267
+ runtime: devenvRuntimeDir(env.XDG_RUNTIME_DIR, path.join(root, DEVENV_DIR, '.devenv')),
268
+ tmp: env.TMPDIR || '/tmp',
269
+ store: '/nix/store',
270
+ };
271
+ const hash = new Bun.CryptoHasher('sha256');
272
+ for (const watch of watches) {
273
+ const base = bases[watch.scope];
274
+ if (!base) throw new Error(`missing ${watch.scope} for a watched devenv input`);
275
+ const absolute = path.resolve(base, watch.relative);
276
+ if (absolute !== base && !absolute.startsWith(`${base}/`)) throw new Error(`watch escapes ${watch.scope}`);
277
+ hash.update(`${watch.scope}:${watch.relative}\0`);
278
+ const stat = lstatSync(absolute, { throwIfNoEntry: false });
279
+ if (!stat) {
280
+ hash.update('absent\0');
281
+ } else if (watch.scope === 'store') {
282
+ hash.update('store-present\0'); // Nix store paths are immutable; their names identify their contents.
283
+ } else if (stat.isSymbolicLink()) {
284
+ const target = readlinkSync(absolute);
285
+ hash.update(`link\0${target}\0`);
286
+ const resolved = realpathSync(absolute);
287
+ if (!resolved.startsWith(`${root}/`) && !resolved.startsWith('/nix/store/')) {
288
+ throw new Error(`watched link resolves outside isolated roots: ${absolute}`);
289
+ }
290
+ hash.update(readFileSync(resolved));
291
+ } else if (stat.isFile()) {
292
+ hash.update(`file\0${stat.mode & 0o111}\0${stat.size}\0`);
293
+ hash.update(readFileSync(absolute));
294
+ } else {
295
+ throw new Error(`watched input is neither a file nor a missing path: ${absolute}`);
296
+ }
297
+ }
298
+ return hash.digest('hex');
299
+ }
300
+
301
+ function graphBasis(dotfile: string): string {
302
+ const gc = path.join(dotfile, 'gc');
303
+ if (!lstatSync(dotfile).isDirectory() || !lstatSync(gc).isDirectory())
304
+ throw new Error('devenv state or GC root is not a private directory');
305
+ const graph = path.join(gc, 'task-config-devenv-config-task-config');
306
+ const link = lstatSync(graph);
307
+ if (
308
+ !link.isSymbolicLink() ||
309
+ !readlinkSync(graph).startsWith('/nix/store/') ||
310
+ !realpathSync(graph).startsWith('/nix/store/')
311
+ )
312
+ throw new Error(`task graph is not a Nix store link: ${graph}`);
313
+ return new Bun.CryptoHasher('sha256').update(readFileSync(graph)).digest('hex');
314
+ }
315
+
316
+ function readArtifact(file: string): Artifact | undefined {
317
+ if (!lstatSync(file, { throwIfNoEntry: false })?.isFile()) return undefined;
318
+ const value: unknown = JSON.parse(readFileSync(file, 'utf8'));
319
+ if (
320
+ typeof value !== 'object' ||
321
+ value === null ||
322
+ !('version' in value) ||
323
+ value.version !== 1 ||
324
+ !('root' in value) ||
325
+ typeof value.root !== 'string' ||
326
+ !('paths' in value) ||
327
+ typeof value.paths !== 'object' ||
328
+ value.paths === null ||
329
+ Array.isArray(value.paths) ||
330
+ !('basis' in value) ||
331
+ !('graphBasis' in value) ||
332
+ typeof value.graphBasis !== 'string' ||
333
+ typeof value.basis !== 'string' ||
334
+ !('watches' in value) ||
335
+ !Array.isArray(value.watches) ||
336
+ !('watchBasis' in value) ||
337
+ typeof value.watchBasis !== 'string' ||
338
+ !('toolchain' in value) ||
339
+ typeof value.toolchain !== 'string' ||
340
+ !('export' in value) ||
341
+ typeof value.export !== 'string'
342
+ )
343
+ return undefined;
344
+ const paths: Record<string, string> = {};
345
+ for (const [name, entry] of Object.entries(value.paths)) {
346
+ if (typeof entry !== 'string') return undefined;
347
+ paths[name] = entry;
348
+ }
349
+ const watches: Watch[] = [];
350
+ for (const entry of value.watches) {
351
+ const watch: unknown = entry;
352
+ if (
353
+ typeof watch !== 'object' ||
354
+ watch === null ||
355
+ !('scope' in watch) ||
356
+ (watch.scope !== 'root' &&
357
+ watch.scope !== 'home' &&
358
+ watch.scope !== 'runtime' &&
359
+ watch.scope !== 'tmp' &&
360
+ watch.scope !== 'store') ||
361
+ !('relative' in watch) ||
362
+ typeof watch.relative !== 'string'
363
+ )
364
+ return undefined;
365
+ watches.push({ scope: watch.scope, relative: watch.relative });
366
+ }
367
+ return {
368
+ version: 1,
369
+ root: value.root,
370
+ paths,
371
+ basis: value.basis,
372
+ graphBasis: value.graphBasis,
373
+ watches,
374
+ watchBasis: value.watchBasis,
375
+ toolchain: value.toolchain,
376
+ export: value.export,
377
+ };
378
+ }
379
+
380
+ /** Check inherited data from this checkout only. A sibling cannot write this file or its GC roots. */
381
+ function inherited(root: string, env: NodeJS.ProcessEnv, file: string): string | undefined {
382
+ if (!lstatSync(path.dirname(file), { throwIfNoEntry: false })?.isDirectory()) return undefined;
383
+ const artifact = readArtifact(file);
384
+ if (!artifact) return undefined;
385
+ if (
386
+ artifact.basis !== sourceBasis(root) ||
387
+ artifact.toolchain !== toolchain(privateEnvironment(env)) ||
388
+ artifact.watchBasis !== watchedBasis(root, env, artifact.watches) ||
389
+ artifact.graphBasis !== graphBasis(path.join(root, DEVENV_DIR, '.devenv'))
390
+ )
391
+ return undefined;
392
+ const graph = enterShellTasks(path.join(root, DEVENV_DIR, '.devenv'));
393
+ if (graph.kind !== 'confined') return undefined;
394
+ const dotfile = path.join(root, DEVENV_DIR, '.devenv');
395
+ const shell = path.join(dotfile, 'gc', 'shell');
396
+ if (!lstatSync(shell, { throwIfNoEntry: false })?.isSymbolicLink()) return undefined;
397
+ const target = readlinkSync(shell);
398
+ if (!target.startsWith('/nix/store/') || !realpathSync(shell).startsWith('/nix/store/')) return undefined;
399
+ const moves = relocations(artifact.root, artifact.paths, root, env);
400
+ const registered = Bun.spawnSync(['nix-store', '--realise', target, '--add-root', shell], {
401
+ env: privateEnvironment(env),
402
+ stdout: 'ignore',
403
+ stderr: 'inherit',
404
+ });
405
+ if (registered.exitCode !== 0) return undefined;
406
+ const inputPaths = path.join(dotfile, 'input-paths.txt');
407
+ if (existsSync(inputPaths)) {
408
+ const staged = `${inputPaths}.${randomUUID()}`;
409
+ writeFileSync(staged, relocate(readFileSync(inputPaths, 'utf8'), moves), { flag: 'wx' });
410
+ renameSync(staged, inputPaths);
411
+ }
412
+ return `${relocate(artifact.export, moves)}\nunset DEVENV_TASK_FILE DEVENV_TASKS\n`;
413
+ }
414
+
415
+ interface Task {
416
+ readonly name: string;
417
+ readonly command: string | null;
418
+ readonly before: readonly string[];
419
+ readonly after: readonly string[];
420
+ }
421
+ function strings(value: unknown): value is string[] {
422
+ return Array.isArray(value) && value.every((item): item is string => typeof item === 'string');
423
+ }
424
+ /** Classify the real graph emitted by devenv, not script text or source names. */
425
+ function enterShellTasks(
426
+ dotfile: string,
427
+ ): { kind: 'confined'; names: ReadonlySet<string> } | { kind: 'writes'; reason: string } {
428
+ const graph = path.join(dotfile, 'gc', 'task-config-devenv-config-task-config');
429
+ let rows: unknown;
430
+ try {
431
+ rows = JSON.parse(readFileSync(graph, 'utf8'));
432
+ } catch (error) {
433
+ return { kind: 'writes', reason: `task graph ${graph}: ${String(error)}` };
434
+ }
435
+ if (!Array.isArray(rows)) return { kind: 'writes', reason: `${graph} is not a list of tasks` };
436
+ const tasks = new Map<string, Task>();
437
+ for (const row of rows) {
438
+ const raw: unknown = row;
439
+ if (
440
+ typeof raw !== 'object' ||
441
+ raw === null ||
442
+ !('name' in raw) ||
443
+ typeof raw.name !== 'string' ||
444
+ !('command' in raw) ||
445
+ (raw.command !== null && typeof raw.command !== 'string') ||
446
+ !('before' in raw) ||
447
+ !strings(raw.before) ||
448
+ !('after' in raw) ||
449
+ !strings(raw.after) ||
450
+ tasks.has(raw.name)
451
+ )
452
+ return { kind: 'writes', reason: `${graph} has a malformed or duplicate task` };
453
+ tasks.set(raw.name, { name: raw.name, command: raw.command, before: raw.before, after: raw.after });
454
+ }
455
+ if (!tasks.has('devenv:enterShell')) return { kind: 'writes', reason: `${graph} has no devenv:enterShell` };
456
+ const pending = ['devenv:enterShell'];
457
+ const closure = new Set<string>();
458
+ for (let name = pending.pop(); name !== undefined; name = pending.pop()) {
459
+ if (closure.has(name)) continue;
460
+ const task = tasks.get(name);
461
+ if (!task) return { kind: 'writes', reason: `${graph} depends on missing task ${name}` };
462
+ closure.add(name);
463
+ pending.push(...task.after);
464
+ for (const candidate of tasks.values()) if (candidate.before.includes(name)) pending.push(candidate.name);
465
+ }
466
+ const writing = [...closure].filter((name) => {
467
+ const task = tasks.get(name);
468
+ return (
469
+ task?.command !== null &&
470
+ task?.command !== undefined &&
471
+ name !== 'devenv:enterShell' &&
472
+ name !== 'devenv:files:cleanup'
473
+ );
474
+ });
475
+ return writing.length === 0
476
+ ? { kind: 'confined', names: new Set(tasks.keys()) }
477
+ : { kind: 'writes', reason: `enterShell runs ${writing.sort().join(', ')}, which write into its evaluation root` };
478
+ }
479
+
480
+ /** Expose only a credential-free evaluated shell to future private COW clones. */
481
+ export function exportShell(rootPath: string, args: readonly string[], env: NodeJS.ProcessEnv): number {
482
+ const root = realpathSync(rootPath);
483
+ const cwd = path.join(root, DEVENV_DIR);
484
+ if (args.at(-1) !== 'direnv-export') {
485
+ const live = Bun.spawnSync(['devenv', ...args], {
486
+ cwd,
487
+ env,
488
+ stdin: 'inherit',
489
+ stdout: 'inherit',
490
+ stderr: 'inherit',
491
+ });
492
+ return live.exitCode;
493
+ }
494
+ const local = ['.env', 'devenv.local.nix', 'devenv.local.yaml', 'devenv.local.yml'];
495
+ const privateInputs =
496
+ local.some((name) => existsSync(path.join(cwd, name))) ||
497
+ (env.HOME && existsSync(path.join(env.HOME, '.config', 'nixpkgs')));
498
+ const file = path.join(cwd, '.devenv', ARTIFACT);
499
+ if (!privateInputs) {
500
+ try {
501
+ const cached = inherited(root, env, file);
502
+ if (cached !== undefined) {
503
+ process.stdout.write(cached);
504
+ console.error("inherited devenv: reused this checkout's evaluated shell");
505
+ return 0;
506
+ }
507
+ } catch (error) {
508
+ console.error(`inherited devenv: private artifact cannot be used (${String(error)}); evaluating in place`);
509
+ }
510
+ }
511
+ const safe = privateEnvironment(env);
512
+ const dotfile = path.join(cwd, '.devenv');
513
+ const live = (): number => {
514
+ const evaluated = Bun.spawnSync(['devenv', ...args], {
515
+ cwd,
516
+ env,
517
+ stdin: 'inherit',
518
+ stdout: 'pipe',
519
+ stderr: 'inherit',
520
+ });
521
+ if (evaluated.exitCode === 0) process.stdout.write(evaluated.stdout);
522
+ return evaluated.exitCode;
523
+ };
524
+ if (privateInputs) {
525
+ console.error('inherited devenv: checkout-local or home configuration; evaluating in place');
526
+ return live();
527
+ }
528
+ try {
529
+ const before = sourceBasis(root);
530
+ const options = args.slice(0, -1);
531
+ const disabled = [...options, '--option', 'enterShell:string', ''];
532
+ const evaluate = (argv: readonly string[]) =>
533
+ Bun.spawnSync(['devenv', ...argv], {
534
+ cwd,
535
+ env: safe,
536
+ stdin: 'inherit',
537
+ stdout: 'pipe',
538
+ stderr: 'inherit',
539
+ });
540
+ const original = evaluate([...options, 'eval', 'enterShell']);
541
+ const without = evaluate([...disabled, 'eval', 'enterShell']);
542
+ if (original.exitCode !== 0 || without.exitCode !== 0)
543
+ throw new Error('devenv cannot evaluate the merged hook without executing it');
544
+ const hook: unknown = JSON.parse(original.stdout.toString());
545
+ const empty: unknown = JSON.parse(without.stdout.toString());
546
+ if (
547
+ typeof hook !== 'object' ||
548
+ hook === null ||
549
+ !('enterShell' in hook) ||
550
+ typeof hook.enterShell !== 'string' ||
551
+ typeof empty !== 'object' ||
552
+ empty === null ||
553
+ !('enterShell' in empty) ||
554
+ empty.enterShell !== ''
555
+ )
556
+ throw new Error('devenv did not prove the complete merged hook was disabled');
557
+ const listed = evaluate([...disabled, 'tasks', 'list', '--json']);
558
+ if (listed.exitCode !== 0) throw new Error('devenv cannot list the disabled task graph');
559
+ const listing: unknown = JSON.parse(listed.stdout.toString());
560
+ if (
561
+ !Array.isArray(listing) ||
562
+ listing.some(
563
+ (entry: unknown) =>
564
+ typeof entry !== 'object' || entry === null || !('name' in entry) || typeof entry.name !== 'string',
565
+ )
566
+ )
567
+ throw new Error('devenv returned a malformed task listing');
568
+ const graph = enterShellTasks(dotfile);
569
+ if (graph.kind !== 'confined') throw new Error(graph.reason);
570
+ const names = new Set(listing.map((entry: { name: string }) => entry.name));
571
+ if (
572
+ names.size !== listing.length ||
573
+ names.size !== graph.names.size ||
574
+ [...names].some((name) => !graph.names.has(name))
575
+ )
576
+ throw new Error('listed tasks differ from the compiled task graph');
577
+ const planned = graphBasis(dotfile);
578
+ const evaluated = evaluate([...disabled, 'direnv-export']);
579
+ if (evaluated.exitCode !== 0) throw new Error(`devenv export exited ${evaluated.exitCode}`);
580
+ if (planned !== graphBasis(dotfile)) throw new Error('task graph changed after preflight');
581
+ const watches = watchPaths(root, safe);
582
+ const after = sourceBasis(root);
583
+ const version = toolchain(safe);
584
+ if (before !== after || !version) throw new Error('evaluated inputs or toolchain changed');
585
+ const exported = `${evaluated.stdout.toString()}\n${hook.enterShell}\nunset DEVENV_TASK_FILE DEVENV_TASKS\n`;
586
+ const artifact: Artifact = {
587
+ version: 1,
588
+ root,
589
+ paths: pathsOf(root, safe),
590
+ basis: after,
591
+ watches,
592
+ watchBasis: watchedBasis(root, safe, watches),
593
+ graphBasis: planned,
594
+ toolchain: version,
595
+ export: exported,
596
+ };
597
+ const staged = `${file}.${randomUUID()}`;
598
+ writeFileSync(staged, `${JSON.stringify(artifact)}\n`, { mode: 0o600, flag: 'wx' });
599
+ renameSync(staged, file);
600
+ process.stdout.write(exported);
601
+ return 0;
602
+ } catch (error) {
603
+ console.error(`inherited devenv: ${String(error)}; evaluating in place`);
604
+ return live();
605
+ }
606
+ }
607
+
608
+ if (import.meta.main) {
609
+ const [root, ...args] = process.argv.slice(2);
610
+ if (!root || args.length === 0) {
611
+ console.error('inherited-devenv.ts: expected <project root> <devenv args…>');
612
+ process.exit(2);
613
+ }
614
+ process.exitCode = exportShell(root, args, process.env);
615
+ }
@@ -35,6 +35,12 @@ import {
35
35
  // above the repository and failing with "could not find a package.json".
36
36
  const devenvRoot = process.env.DEVENV_ROOT;
37
37
 
38
+ /** What a setup command printed, as captured. */
39
+ interface CapturedOutput {
40
+ readonly stdout: Uint8Array;
41
+ readonly stderr: Uint8Array;
42
+ }
43
+
38
44
  class CapturedCommandError extends Error {
39
45
  constructor(
40
46
  public readonly command: string,
@@ -163,12 +169,14 @@ try {
163
169
  if (frozenError !== undefined) {
164
170
  console.error('git diff after install:');
165
171
  try {
166
- await runSetupCommand('git diff', $`git diff`, { quiet: false });
172
+ // Captured and written to stderr, the one stream devenv shows for a failed entry.
173
+ await writeCapturedOutput(await runSetupCommand('git diff', $`git diff`));
167
174
  } catch (diffError) {
168
175
  // This diff is diagnostics for the install failure we are already
169
176
  // reporting, so it must never become the failure: say it broke and keep
170
177
  // the original exit path. Plain `git diff` exits 0 even when the
171
- // lockfile drifted, so a non-zero here means git itself failed.
178
+ // lockfile drifted, so a failure here is git itself failing or stderr
179
+ // closing under the write.
172
180
  console.error(`! git diff failed: ${diffError instanceof Error ? diffError.message : String(diffError)}`);
173
181
  }
174
182
  process.exit(1);
@@ -198,8 +206,13 @@ try {
198
206
  ensureTypeScriptApiPackage(projectRoot);
199
207
  }
200
208
  // Under the same lock: the repository config and hooks are one more thing two shell
201
- // entries would otherwise write at once.
202
- await applyWorkspaceGitConfig(projectRoot);
209
+ // entries would otherwise write at once. Hooks this shell may not write — a cowshed
210
+ // job's sandbox refuses `.git/hooks` — take the shell down no more than an install
211
+ // does: say so and load it.
212
+ await applyWorkspaceGitConfig(projectRoot).catch((configError: unknown) => {
213
+ describeFailure('WARNING', configError);
214
+ console.error('Git hooks and repository config were not applied; the shell is loaded without them.\n---');
215
+ });
203
216
  return error;
204
217
  });
205
218
  if (installError !== undefined) {
@@ -717,6 +730,9 @@ function assertTypescriptApiAt(typescriptRoot: string, expectedTarget: string):
717
730
  * package graph exists — not the installer. Called under the install lock.
718
731
  */
719
732
  async function applyWorkspaceGitConfig(root: string): Promise<void> {
733
+ // A workspace job inherits the installed hooks, but cannot mutate .git/config
734
+ // or .git/hooks. Git wiring belongs to setup outside the job's sandbox.
735
+ if (process.env.COWSHED_WORKSPACE_TOKEN) return;
720
736
  await keepRepositoryConfig(root);
721
737
 
722
738
  const gitDirResult = await $`git rev-parse --git-dir`.cwd(root).quiet().nothrow();
@@ -810,7 +826,7 @@ async function runSetupCommand(
810
826
  command: string,
811
827
  shell: ReturnType<typeof $>,
812
828
  options: { quiet?: boolean; cwd?: string } = {},
813
- ): Promise<void> {
829
+ ): Promise<CapturedOutput> {
814
830
  const result = await shell
815
831
  .quiet(options.quiet ?? true)
816
832
  .nothrow()
@@ -818,6 +834,7 @@ async function runSetupCommand(
818
834
  if (result.exitCode !== 0) {
819
835
  throw new CapturedCommandError(command, result.exitCode, result.stdout, result.stderr);
820
836
  }
837
+ return result;
821
838
  }
822
839
 
823
840
  /**
@@ -999,3 +1016,25 @@ function replayCapturedOutput(error: unknown): void {
999
1016
  process.stderr.write(stderr);
1000
1017
  }
1001
1018
  }
1019
+
1020
+ /**
1021
+ * Writes what a setup command printed to stderr and returns once the bytes have
1022
+ * left this process. Stderr, not stdout, because devenv reports a failed shell
1023
+ * entry as "Shell environment capture failed:" plus the shell's stderr and
1024
+ * discards the stdout it captured. Awaited, because a pipe write still queued
1025
+ * when `process.exit` runs is cut short (Bun 1.4.2: 5 MB written to a slow
1026
+ * reader arrived as 1.3 MB), and a diagnostic that ends mid-hunk is not one.
1027
+ * Redacts what a replay redacts: the values this script resolved itself. A CI
1028
+ * runner resolves none, so the secrets its store injects are the platform's to
1029
+ * mask in the job log, as for every other line of it.
1030
+ */
1031
+ async function writeCapturedOutput(output: CapturedOutput): Promise<void> {
1032
+ for (const stream of [output.stdout, output.stderr]) {
1033
+ const masked = maskSecretValues(stream, resolvedSecretValues);
1034
+ if (masked.length > 0) {
1035
+ await new Promise<void>((resolve, reject) =>
1036
+ process.stderr.write(masked, (error) => (error ? reject(error) : resolve())),
1037
+ );
1038
+ }
1039
+ }
1040
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smoothbricks/nx-plugin",
3
- "version": "0.4.24",
3
+ "version": "0.4.25",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "./loader.js",
@@ -153,9 +153,45 @@
153
153
  "targets": {
154
154
  "lint": {},
155
155
  "test": {
156
+ "executor": "nx:noop",
157
+ "dependsOn": [
158
+ "test-shard1",
159
+ "test-shard2",
160
+ "test-shard3",
161
+ "test-shard4"
162
+ ]
163
+ },
164
+ "test-shard1": {
156
165
  "executor": "@smoothbricks/nx-plugin:bounded-exec",
157
166
  "options": {
158
- "command": "bun test --timeout=30000",
167
+ "command": "bun test --timeout=30000 --timings=test-timings.json --shard=1/4",
168
+ "cwd": "{projectRoot}",
169
+ "timeoutMs": 120000,
170
+ "killAfterMs": 10000
171
+ }
172
+ },
173
+ "test-shard2": {
174
+ "executor": "@smoothbricks/nx-plugin:bounded-exec",
175
+ "options": {
176
+ "command": "bun test --timeout=30000 --timings=test-timings.json --shard=2/4",
177
+ "cwd": "{projectRoot}",
178
+ "timeoutMs": 120000,
179
+ "killAfterMs": 10000
180
+ }
181
+ },
182
+ "test-shard3": {
183
+ "executor": "@smoothbricks/nx-plugin:bounded-exec",
184
+ "options": {
185
+ "command": "bun test --timeout=30000 --timings=test-timings.json --shard=3/4",
186
+ "cwd": "{projectRoot}",
187
+ "timeoutMs": 120000,
188
+ "killAfterMs": 10000
189
+ }
190
+ },
191
+ "test-shard4": {
192
+ "executor": "@smoothbricks/nx-plugin:bounded-exec",
193
+ "options": {
194
+ "command": "bun test --timeout=30000 --timings=test-timings.json --shard=4/4",
159
195
  "cwd": "{projectRoot}",
160
196
  "timeoutMs": 120000,
161
197
  "killAfterMs": 10000
@@ -171,6 +207,7 @@
171
207
  "dist",
172
208
  "src",
173
209
  "nextest.toml",
210
+ "test-timings.json",
174
211
  "README.md",
175
212
  "loader.js",
176
213
  "generators.json",
@@ -135,6 +135,12 @@ const managedFiles: ManagedFileDescriptor[] = [
135
135
  source: 'tooling/direnv/shared-caches.sh',
136
136
  target: 'tooling/direnv/shared-caches.sh',
137
137
  },
138
+ {
139
+ kind: 'raw',
140
+ source: 'tooling/direnv/inherited-devenv.ts',
141
+ target: 'tooling/direnv/inherited-devenv.ts',
142
+ executable: true,
143
+ },
138
144
  {
139
145
  kind: 'raw',
140
146
  source: 'tooling/git-hooks/pre-commit.sh',
@@ -0,0 +1,33 @@
1
+ {
2
+ "version": 1,
3
+ "files": {
4
+ "src/cargo-source-hash.test.ts": 21109,
5
+ "src/ensure-built.test.ts": 19578,
6
+ "src/cargo-closure-input.test.ts": 16994,
7
+ "src/index.test.ts": 8471,
8
+ "src/typecheck-test-policy.test.ts": 7898,
9
+ "src/executors/bounded-exec/executor.test.ts": 6001,
10
+ "src/executors/typescript-emit/executor.test.ts": 2630,
11
+ "src/executors/napi-cross-toolchain/executor.test.ts": 1756,
12
+ "src/cross-check-policy.test.ts": 311,
13
+ "src/managed-files/generator.test.ts": 288,
14
+ "src/managed-files/github-host-cache-isolation.test.ts": 226,
15
+ "src/version-actions.test.ts": 96,
16
+ "src/manifest-hash.test.ts": 62,
17
+ "src/package-target-policy.test.ts": 60,
18
+ "src/bounded-test-policy.test.ts": 34,
19
+ "src/generators/make-public/generator.test.ts": 31,
20
+ "src/cargo-workspace.test.ts": 29,
21
+ "src/release-config-policy.test.ts": 24,
22
+ "src/generators/bun-test-tracing/generator.test.ts": 19,
23
+ "src/generators/bounded-test-targets/generator.test.ts": 17,
24
+ "src/generators/create-package/generator.test.ts": 17,
25
+ "src/managed-files/managed-content.test.ts": 16,
26
+ "src/nextest-extraction.test.ts": 16,
27
+ "src/workspace-config-policy.test.ts": 14,
28
+ "src/executors/clean-outputs/executor.test.ts": 13,
29
+ "src/managed-files/tree-permissions.test.ts": 11,
30
+ "src/managed-files/tree.test.ts": 10,
31
+ "src/bun-bootstrap.test.ts": 9
32
+ }
33
+ }