@smoothbricks/nx-plugin 0.6.3-0 → 0.7.1

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.
Files changed (109) hide show
  1. package/README.md +159 -121
  2. package/dist/.build-inputs.json +25 -20
  3. package/dist/bin/smoo-nx-go-test-build.d.ts +3 -0
  4. package/dist/bin/smoo-nx-go-test-build.d.ts.map +1 -0
  5. package/dist/bin/smoo-nx-go-test-build.js +79 -0
  6. package/dist/bin/smoo-nx-go-test-run.d.ts +3 -0
  7. package/dist/bin/smoo-nx-go-test-run.d.ts.map +1 -0
  8. package/dist/bin/smoo-nx-go-test-run.js +129 -0
  9. package/dist/bounded-test-policy.d.ts +1 -1
  10. package/dist/bounded-test-policy.d.ts.map +1 -1
  11. package/dist/bounded-test-policy.js +9 -8
  12. package/dist/cargo-workspace.d.ts +10 -20
  13. package/dist/cargo-workspace.d.ts.map +1 -1
  14. package/dist/cargo-workspace.js +12 -22
  15. package/dist/cross-check-policy.d.ts +2 -2
  16. package/dist/cross-check-policy.js +2 -2
  17. package/dist/deploy-policy.d.ts +6 -0
  18. package/dist/deploy-policy.d.ts.map +1 -1
  19. package/dist/deploy-policy.js +11 -0
  20. package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
  21. package/dist/executors/bounded-exec/executor.js +49 -37
  22. package/dist/executors/bounded-exec/mbx-pool.d.ts +39 -10
  23. package/dist/executors/bounded-exec/mbx-pool.d.ts.map +1 -1
  24. package/dist/executors/bounded-exec/mbx-pool.js +78 -24
  25. package/dist/executors/bounded-exec/progress.js +5 -5
  26. package/dist/executors/bounded-exec/runner-sizing.d.ts +40 -2
  27. package/dist/executors/bounded-exec/runner-sizing.d.ts.map +1 -1
  28. package/dist/executors/bounded-exec/runner-sizing.js +55 -4
  29. package/dist/executors/bounded-exec/runtime-pin.js +1 -1
  30. package/dist/executors/bounded-exec/verdict.d.ts +6 -0
  31. package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
  32. package/dist/executors/bounded-exec/verdict.js +6 -0
  33. package/dist/executors/wrangler-deploy/deploy-hash.d.ts +10 -0
  34. package/dist/executors/wrangler-deploy/deploy-hash.d.ts.map +1 -0
  35. package/dist/executors/wrangler-deploy/deploy-hash.js +14 -0
  36. package/dist/executors/wrangler-deploy/executor.d.ts +24 -0
  37. package/dist/executors/wrangler-deploy/executor.d.ts.map +1 -0
  38. package/dist/executors/wrangler-deploy/executor.js +43 -0
  39. package/dist/executors/wrangler-deploy/hasher.d.ts +27 -0
  40. package/dist/executors/wrangler-deploy/hasher.d.ts.map +1 -0
  41. package/dist/executors/wrangler-deploy/hasher.js +90 -0
  42. package/dist/executors/wrangler-deploy/schema.d.ts +5 -0
  43. package/dist/executors/wrangler-deploy/schema.d.ts.map +1 -0
  44. package/dist/go-tests.d.ts +30 -0
  45. package/dist/go-tests.d.ts.map +1 -0
  46. package/dist/go-tests.js +43 -0
  47. package/dist/index.d.ts +9 -2
  48. package/dist/index.d.ts.map +1 -1
  49. package/dist/index.js +271 -230
  50. package/dist/managed-files/files.d.ts.map +1 -1
  51. package/dist/managed-files/files.js +5 -0
  52. package/dist/process-group.js +2 -2
  53. package/dist/runtime-input-policy.d.ts +3 -3
  54. package/dist/runtime-input-policy.js +3 -3
  55. package/dist/test-timings.d.ts +23 -4
  56. package/dist/test-timings.d.ts.map +1 -1
  57. package/dist/test-timings.js +72 -12
  58. package/dist/version-actions.cjs +10 -11
  59. package/dist/version-actions.d.cts.map +1 -1
  60. package/dist/workspace-config-policy.d.ts.map +1 -1
  61. package/dist/workspace-config-policy.js +17 -22
  62. package/dist/workspace-manifest.js +3 -3
  63. package/executors.json +6 -5
  64. package/managed/raw/patches/nx@23.2.1.patch +118 -24
  65. package/managed/raw/patches/ttsc@0.34.1.patch +64 -0
  66. package/managed/raw/tooling/direnv/developer-links.ts +121 -51
  67. package/managed/raw/tooling/direnv/installed-bun-links.ts +7 -6
  68. package/managed/raw/tooling/direnv/setup-environment.ts +14 -4
  69. package/managed/raw/tooling/git-hooks/pinned-revisions-served.ts +252 -0
  70. package/managed/raw/tooling/git-hooks/pre-push.sh +34 -32
  71. package/package.json +58 -8
  72. package/runtime/nx-publish/.build-inputs.json +11 -0
  73. package/runtime-input.sh +50 -23
  74. package/src/bin/smoo-nx-go-test-build.ts +83 -0
  75. package/src/bin/smoo-nx-go-test-run.ts +140 -0
  76. package/src/bounded-test-policy.ts +9 -8
  77. package/src/cargo-workspace.ts +12 -24
  78. package/src/cross-check-policy.ts +2 -2
  79. package/src/deploy-policy.ts +11 -0
  80. package/src/executors/bounded-exec/executor.ts +61 -42
  81. package/src/executors/bounded-exec/mbx-pool.ts +97 -33
  82. package/src/executors/bounded-exec/progress.ts +5 -5
  83. package/src/executors/bounded-exec/runner-sizing.ts +73 -7
  84. package/src/executors/bounded-exec/runtime-pin.ts +1 -1
  85. package/src/executors/bounded-exec/verdict.ts +7 -0
  86. package/src/executors/wrangler-deploy/deploy-hash.ts +15 -0
  87. package/src/executors/wrangler-deploy/executor.ts +63 -0
  88. package/src/executors/wrangler-deploy/hasher.ts +111 -0
  89. package/src/executors/wrangler-deploy/schema.json +16 -0
  90. package/src/executors/wrangler-deploy/schema.ts +4 -0
  91. package/src/go-tests.ts +67 -0
  92. package/src/index.ts +294 -253
  93. package/src/managed-files/files.ts +5 -0
  94. package/src/process-group.ts +2 -2
  95. package/src/runtime-input-policy.ts +3 -3
  96. package/src/test-timings.ts +72 -14
  97. package/src/version-actions.cts +10 -11
  98. package/src/workspace-config-policy.ts +20 -29
  99. package/src/workspace-manifest.ts +3 -3
  100. package/test-timings.json +131 -130
  101. package/dist/executors/clean-outputs/executor.d.ts +0 -26
  102. package/dist/executors/clean-outputs/executor.d.ts.map +0 -1
  103. package/dist/executors/clean-outputs/executor.js +0 -83
  104. package/dist/executors/clean-outputs/schema.d.ts +0 -4
  105. package/dist/executors/clean-outputs/schema.d.ts.map +0 -1
  106. package/src/executors/clean-outputs/executor.ts +0 -131
  107. package/src/executors/clean-outputs/schema.json +0 -15
  108. package/src/executors/clean-outputs/schema.ts +0 -3
  109. /package/dist/executors/{clean-outputs → wrangler-deploy}/schema.js +0 -0
@@ -211,6 +211,11 @@ const managedFiles: ManagedFileDescriptor[] = [
211
211
  target: 'tooling/git-hooks/pre-push.sh',
212
212
  executable: true,
213
213
  },
214
+ {
215
+ kind: 'raw',
216
+ source: 'tooling/git-hooks/pinned-revisions-served.ts',
217
+ target: 'tooling/git-hooks/pinned-revisions-served.ts',
218
+ },
214
219
  {
215
220
  kind: 'raw',
216
221
  source: 'tooling/git-reword-commit',
@@ -173,8 +173,8 @@ export function killProcessGroupNow(pgid: number, patience: Patience): boolean {
173
173
  * Waits `ms` of host time without blocking this thread, so that the event loop serves everything else meanwhile and
174
174
  * reaps the group's leader. Two waits, and whichever ends first ends the pause: a timer, which keeps the process alive
175
175
  * while it waits, and `Atomics.waitAsync`, which does not (a process with nothing else pending exits under it, as
176
- * measured on Node 26 and Bun 1.4.3) but is not a timer. A timer alone is its caller's clock, and a test that fakes the
177
- * clock stops it for good, while what a kill waits for is the kernel.
176
+ * measured on Node 26 and Bun 1.4.3 and 1.4.4) but is not a timer. A timer alone is its caller's clock, and a test
177
+ * that fakes the clock stops it for good, while what a kill waits for is the kernel.
178
178
  */
179
179
  function pause(ms: number): Promise<void> {
180
180
  return new Promise((resolve) => {
@@ -376,9 +376,9 @@ function absentAsUndefined<T>(read: () => T): T | undefined {
376
376
 
377
377
  /**
378
378
  * The report of every failure runtime-input.sh retained under `root` at or after `sinceMs`, oldest first, each headed
379
- * by its path. Nx 23.2.1 names a failed runtime input only as `invalid utf-8 sequence of 1 bytes from index N` and
380
- * drops the input's stderr, so a headless run prints these after Nx fails: they name the command, its exit status and
381
- * its stderr. A record without a report (its evidence could not be written) is named as such.
379
+ * by its path. Nx names a failed runtime input's tasks and their runtime inputs (`Could not hash …`), not which one
380
+ * failed or why, and drops the input's stderr, so a headless run prints these after Nx fails: they name the command,
381
+ * its exit status and its stderr. A record without a report (its evidence could not be written) is named as such.
382
382
  */
383
383
  export function runtimeInputFailureReports(root: string, sinceMs: number): string[] {
384
384
  const directory = join(root, RUNTIME_INPUT_FAILURES);
@@ -1,9 +1,10 @@
1
+ import type { Stats } from 'node:fs';
1
2
  import { readdir, readFile, stat } from 'node:fs/promises';
2
3
  import { join, posix } from 'node:path';
3
4
  import { parse as parseToml } from 'smol-toml';
4
5
  import typia, { type IValidation } from 'typia';
5
6
 
6
- import { shellWord } from './runtime-input.js';
7
+ import { runtimeInput, shellWord } from './runtime-input.js';
7
8
  import { isRecord } from './type-guards.js';
8
9
 
9
10
  /**
@@ -187,10 +188,11 @@ const validateBunfigDiscovery = typia.createValidate<BunfigDiscovery>();
187
188
  * Bun's test discovery for `args` in `cwd`, replayed without running a test: files named `*.test.*`, `*_test.*`,
188
189
  * `*.spec.*` or `*_spec.*` with a JavaScript extension, in any letter case, under bunfig's `test.root`, outside
189
190
  * `node_modules` and hidden directories. A symlink counts as its target, a directory entered and a file matched, and a
190
- * link to nothing as a file; the link's own name is the one the name rules see. `--path-ignore-patterns` globs match
191
- * the cwd-relative path as written and replace bunfig's `pathIgnorePatterns` when given; `--config=` names another
192
- * bunfig; `.gitignore` plays no part. These are the rules of Bun 1.4: `test-timings.test.ts` compares them with the
193
- * files `bun test --update-timings` writes for a fixture, so a Bun release that changes them fails there.
191
+ * link to nothing is skipped; any other link it cannot resolve refuses the replay. The link's own name is the one the
192
+ * name rules see. `--path-ignore-patterns` globs match the cwd-relative path as written and replace bunfig's
193
+ * `pathIgnorePatterns` when given; `--config=` names another bunfig; `.gitignore` plays no part. These are the rules
194
+ * of Bun 1.4.4: `test-timings.test.ts` compares them with the files `bun test --update-timings` writes for a fixture,
195
+ * so a Bun release that changes them fails there.
194
196
  */
195
197
  export async function timingsCoverage(
196
198
  workspaceRoot: string,
@@ -210,7 +212,12 @@ export async function timingsCoverage(
210
212
  cliIgnores.length > 0 ? cliIgnores : typeof bunfigIgnores === 'string' ? [bunfigIgnores] : bunfigIgnores;
211
213
  const root = posix.normalize(bunfig.test?.root ?? '.');
212
214
  const files: string[] = [];
213
- await collectTestFiles(cwd, root === '.' ? '' : root.replace(/\/$/, ''), ignores, files);
215
+ try {
216
+ await collectTestFiles(cwd, root === '.' ? '' : root.replace(/\/$/, ''), ignores, files);
217
+ } catch (error) {
218
+ if (!(error instanceof Error && 'code' in error)) throw error;
219
+ return { ok: false, error: `cannot replay Bun's discovery under ${posix.join(suite.cwd, root)}: ${error.message}` };
220
+ }
214
221
  files.sort();
215
222
  const timed = new Set<string>();
216
223
  for (const manifest of manifests) {
@@ -221,6 +228,50 @@ export async function timingsCoverage(
221
228
  return { ok: true, coverage: { manifests, files, untimed: files.filter((file) => !timed.has(file)) } };
222
229
  }
223
230
 
231
+ /**
232
+ * What the shard-timings check reads, as Nx inputs: its timing manifests and its bunfig as files, and the names Bun's
233
+ * discovery would find as {@link bunTestFileNamesInput}. Files alone cannot key the last: discovery finds gitignored
234
+ * files too, and Nx hashes no ignored file.
235
+ */
236
+ export function timingsSuiteInputs(suite: Pick<TimingsShardedSuite, 'cwd' | 'args'>): (string | { runtime: string })[] {
237
+ const inCwd = (file: string) => `{workspaceRoot}/${posix.join(suite.cwd, file)}`;
238
+ return [
239
+ ...flagValues(suite.args, '--timings').map(inCwd),
240
+ inCwd(flagValues(suite.args, '--config').at(-1) ?? 'bunfig.toml'),
241
+ bunTestFileNamesInput(suite.cwd),
242
+ ];
243
+ }
244
+
245
+ /**
246
+ * The names of the files under `cwd` (workspace-relative) Bun's discovery could run, sorted, as a runtime input. It is a
247
+ * superset of {@link timingsCoverage}'s rules (any extension, the whole tree whatever bunfig's `test.root`, no ignore
248
+ * glob), so every file discovery would find changes the value, and a name discovery skips costs at most a cache miss.
249
+ * Like Bun, it skips `node_modules` and hidden directories, follows symlinks (each directory once, by its real path),
250
+ * skips a link to nothing, and reads no `.gitignore`. It walks with Bun, which every workspace declares.
251
+ */
252
+ export function bunTestFileNamesInput(cwd: string): { runtime: string } {
253
+ return runtimeInput(`bun -e ${shellWord(LIST_TEST_FILE_NAMES)} ${shellWord(cwd)}`);
254
+ }
255
+
256
+ const LIST_TEST_FILE_NAMES = [
257
+ 'const { readdirSync, realpathSync, statSync } = require("node:fs");',
258
+ 'const names = []; const seen = new Set();',
259
+ 'const walk = (dir) => {',
260
+ ' const real = realpathSync(dir); if (seen.has(real)) return; seen.add(real);',
261
+ ' for (const entry of readdirSync(dir, { withFileTypes: true })) {',
262
+ ' const path = dir === "." ? entry.name : dir + "/" + entry.name; const name = entry.name.toLowerCase();',
263
+ ' let directory = entry.isDirectory();',
264
+ ' if (entry.isSymbolicLink()) {',
265
+ ' try { directory = statSync(path).isDirectory(); }',
266
+ ' catch (error) { if (error?.code !== "ENOENT") throw error; continue; }',
267
+ ' }',
268
+ ' if (directory) { if (!name.startsWith(".") && name !== "node_modules") walk(path); }',
269
+ ' else if (/[._](test|spec)[.]/.test(name)) names.push(path);',
270
+ ' }',
271
+ '};',
272
+ 'process.chdir(process.argv[1]); walk("."); names.sort(); for (const name of names) console.log(name);',
273
+ ].join(' ');
274
+
224
275
  /**
225
276
  * The failure an untimed file earns: every such file, and the one command that refreshes the manifest. `cwd` is the
226
277
  * suite's workspace-relative directory, so the operator can find the files from the repository root.
@@ -242,17 +293,14 @@ async function collectTestFiles(cwd: string, dir: string, ignores: readonly stri
242
293
  const path = dir === '' ? entry.name : `${dir}/${entry.name}`;
243
294
  // Bun matches every name in lower case, and its ignore globs see the path as written.
244
295
  const name = entry.name.toLowerCase();
245
- // Bun follows a symlink to what it points at and takes one that points at nothing for a file.
246
- const resolved = entry.isSymbolicLink() ? await stat(join(cwd, path)).catch(() => null) : entry;
247
- if (resolved?.isDirectory()) {
296
+ // Bun follows a symlink to what it points at and skips one that points at nothing.
297
+ const resolved = entry.isSymbolicLink() ? await statUnlessMissing(join(cwd, path)) : entry;
298
+ if (resolved === null) continue;
299
+ if (resolved.isDirectory()) {
248
300
  if (!name.startsWith('.') && name !== 'node_modules') {
249
301
  await collectTestFiles(cwd, path, ignores, files);
250
302
  }
251
- } else if (
252
- (resolved === null || resolved.isFile()) &&
253
- TEST_FILE.test(name) &&
254
- !ignores.some((glob) => posix.matchesGlob(path, glob))
255
- ) {
303
+ } else if (resolved.isFile() && TEST_FILE.test(name) && !ignores.some((glob) => posix.matchesGlob(path, glob))) {
256
304
  files.push(path);
257
305
  }
258
306
  }
@@ -297,6 +345,16 @@ async function readTimingManifest(
297
345
  return { ok: true, files: validated.data.files };
298
346
  }
299
347
 
348
+ /** What a symlink at `path` leads to, or null when it leads nowhere; any other failure to resolve it is thrown. */
349
+ async function statUnlessMissing(path: string): Promise<Stats | null> {
350
+ try {
351
+ return await stat(path);
352
+ } catch (error) {
353
+ if (error instanceof Error && 'code' in error && error.code === 'ENOENT') return null;
354
+ throw error;
355
+ }
356
+ }
357
+
300
358
  async function readOptionalFile(path: string): Promise<string | null> {
301
359
  try {
302
360
  return await readFile(path, 'utf-8');
@@ -34,19 +34,18 @@ const PUBLISHED_DEPENDENCY_FIELDS = ['dependencies', 'peerDependencies', 'option
34
34
  const afterAllProjectsVersioned: AfterAllProjectsVersioned = async (cwd, options) => {
35
35
  const result = await nxJsVersionActions.afterAllProjectsVersioned(cwd, options);
36
36
 
37
- // Temporary Bun workaround. Delete this hook together with the CLI lockfile
38
- // sync/validation code once supported Bun versions fix all three issues:
39
- // - https://github.com/oven-sh/bun/issues/18906
40
- // - https://github.com/oven-sh/bun/issues/20477
41
- // - https://github.com/oven-sh/bun/issues/20829
42
- //
43
37
  // After ANY version bump (release or prepare-next), bun.lock workspace versions
44
- // must match package.json exactly — including unpublished -next. Day-to-day CI
45
- // and frozen installs require that invariant.
38
+ // must match package.json exactly, unpublished -next included, and
39
+ // `smoo monorepo validate` refuses a lock that does not. The Bun bugs this hook
40
+ // began as a workaround for are closed (oven-sh/bun#18906, #20477, #20829):
41
+ // measured on Bun 1.4.4, `bun install --lockfile-only`, the lock update Nx runs
42
+ // after versioning, writes a bumped package.json version into bun.lock. But
43
+ // `bun install --frozen-lockfile` still accepts an entry the manifest moved
44
+ // past, so the release commit's lock is made exact here whatever ran before.
46
45
  //
47
- // Publish-time pack rewrites (-next → last stable tag) happen only in
48
- // `smoo release publish` around `bun pm pack`, never here. Doing publish-mode
49
- // rewrite on prepare-next is what left lock at 0.x.y while package.json said
46
+ // Publish-time pins (-next → last stable tag) go only into the packed manifest
47
+ // of `smoo release publish`, never into bun.lock. Rewriting the lock that way
48
+ // on prepare-next is what left it at 0.x.y while package.json said
50
49
  // 0.x.y-next.0 and blew up monorepo validate / packed-package-manifest.
51
50
  const updated = syncBunLockfileVersionsToPackageJson(cwd);
52
51
  if (updated === 0) {
@@ -84,7 +84,11 @@ export function isTestRunnerTargetName(name: string): boolean {
84
84
 
85
85
  const nxJsTypescriptPlugin = '@nx/js/typescript';
86
86
  const smoothBricksNxPlugin = '@smoothbricks/nx-plugin';
87
- const cleanOutputsExecutor = '@smoothbricks/nx-plugin:clean-outputs';
87
+ /**
88
+ * The executor of the retired `clean` target, which deleted declared outputs file by file. Build state is removed whole
89
+ * instead (cowshed rm, mbx gc), so a `targetDefaults.clean` naming it is refused and removed.
90
+ */
91
+ const retiredCleanOutputsExecutor = '@smoothbricks/nx-plugin:clean-outputs';
88
92
  const ciWorkflowNamedInput = ['{workspaceRoot}/.github/workflows/ci.yml'];
89
93
  const inferredTestTypecheckTarget = 'typecheck-tests';
90
94
  /**
@@ -138,6 +142,12 @@ export function checkWorkspaceConfig(nxJson: Record<string, unknown>): NxPolicyI
138
142
  'Per-project inference selects current library or build outputs before test typechecking.',
139
143
  });
140
144
  }
145
+ if (isRetiredCleanTargetDefault(targetDefaults, targetName)) {
146
+ issues.push({
147
+ path: 'nx.json',
148
+ message: `targetDefaults.clean names the retired ${retiredCleanOutputsExecutor}; run smoo monorepo update to remove it`,
149
+ });
150
+ }
141
151
  }
142
152
  }
143
153
 
@@ -149,9 +159,6 @@ export function checkWorkspaceConfig(nxJson: Record<string, unknown>): NxPolicyI
149
159
 
150
160
  validateLintTargetDefault(nxJson, 'nx.json', issues);
151
161
 
152
- // Clean target default
153
- validateCleanTargetDefault(nxJson, 'nx.json', issues);
154
-
155
162
  // Named input defaults
156
163
  validateNamedInputDefaults(nxJson, 'nx.json', issues);
157
164
 
@@ -203,7 +210,6 @@ export function applyWorkspaceConfig(nxJson: Record<string, unknown>): boolean {
203
210
  changed = applyBuildTargetDefault(nxJson) || changed;
204
211
  changed = applyTestTargetDefault(nxJson) || changed;
205
212
  changed = applyLintTargetDefault(nxJson) || changed;
206
- changed = applyCleanTargetDefault(nxJson) || changed;
207
213
  changed = applyNamedInputDefaults(nxJson) || changed;
208
214
  const plugins = validatePlugins(nxJson.plugins === undefined ? [] : nxJson.plugins);
209
215
  if (plugins.success) {
@@ -322,21 +328,6 @@ function validateBuildTargetDefault(
322
328
  }
323
329
  }
324
330
 
325
- function validateCleanTargetDefault(
326
- nxJson: Record<string, unknown>,
327
- nxJsonPath: string,
328
- issues: NxPolicyIssue[],
329
- ): void {
330
- const targetDefaults = recordProperty(nxJson, 'targetDefaults');
331
- const clean = targetDefaults ? recordProperty(targetDefaults, 'clean') : null;
332
- if (!clean || clean.executor !== cleanOutputsExecutor) {
333
- issues.push({ path: nxJsonPath, message: `targetDefaults.clean.executor must be ${cleanOutputsExecutor}` });
334
- }
335
- if (clean?.cache !== false) {
336
- issues.push({ path: nxJsonPath, message: 'targetDefaults.clean.cache must be false' });
337
- }
338
- }
339
-
340
331
  function validateNamedInputDefaults(
341
332
  nxJson: Record<string, unknown>,
342
333
  nxJsonPath: string,
@@ -471,14 +462,6 @@ function applyLintTargetDefault(nxJson: Record<string, unknown>): boolean {
471
462
  return changed;
472
463
  }
473
464
 
474
- function applyCleanTargetDefault(nxJson: Record<string, unknown>): boolean {
475
- const targetDefaults = getOrCreateRecord(nxJson, 'targetDefaults');
476
- const clean = getOrCreateRecord(targetDefaults, 'clean');
477
- let changed = setStringProperty(clean, 'executor', cleanOutputsExecutor);
478
- changed = setBooleanProperty(clean, 'cache', false) || changed;
479
- return changed;
480
- }
481
-
482
465
  function applyNamedInputDefaults(nxJson: Record<string, unknown>): boolean {
483
466
  const namedInputs = getOrCreateRecord(nxJson, 'namedInputs');
484
467
  let changed = false;
@@ -516,7 +499,11 @@ function removeDisallowedTargetDefaults(nxJson: Record<string, unknown>): boolea
516
499
  }
517
500
  let changed = false;
518
501
  for (const targetName of Object.keys(targetDefaults)) {
519
- if (targetName.includes(':') || targetName === inferredTestTypecheckTarget) {
502
+ if (
503
+ targetName.includes(':') ||
504
+ targetName === inferredTestTypecheckTarget ||
505
+ isRetiredCleanTargetDefault(targetDefaults, targetName)
506
+ ) {
520
507
  delete targetDefaults[targetName];
521
508
  changed = true;
522
509
  }
@@ -524,6 +511,10 @@ function removeDisallowedTargetDefaults(nxJson: Record<string, unknown>): boolea
524
511
  return changed;
525
512
  }
526
513
 
514
+ function isRetiredCleanTargetDefault(targetDefaults: Record<string, unknown>, targetName: string): boolean {
515
+ return targetName === 'clean' && recordProperty(targetDefaults, 'clean')?.executor === retiredCleanOutputsExecutor;
516
+ }
517
+
527
518
  function isPreciseProductionNamedInput(production: unknown[]): boolean {
528
519
  let hasPositiveProjectInput = false;
529
520
  for (const input of production) {
@@ -414,9 +414,9 @@ export function catalogName(value: string): string | null {
414
414
  /**
415
415
  * Where Bun reads a root manifest's catalogs: from the object form of `workspaces` once it holds `catalog` or
416
416
  * `catalogs`, and then from nowhere else; otherwise from the manifest's own top-level `catalog` and `catalogs`.
417
- * Measured with `bun install` 1.4.3: beside a `workspaces.catalog`, a top-level `catalog` entry is not in the catalog
418
- * and a top-level `catalogs` name is "no catalog named"; beside a `workspaces` object without either, the top level
419
- * resolves.
417
+ * Measured with `bun install` 1.4.3 and 1.4.4: beside a `workspaces.catalog`, a top-level `catalog` entry is not in
418
+ * the catalog and a top-level `catalogs` name is "no catalog named"; beside a `workspaces` object without either, the
419
+ * top level resolves.
420
420
  */
421
421
  function catalogHolder(root: PackageJson): { holder: PackageCatalogs; path: string } {
422
422
  const workspaces = root.workspaces;
package/test-timings.json CHANGED
@@ -2,137 +2,138 @@
2
2
  "version": 1,
3
3
  "files": {
4
4
  "src/executors/bounded-exec/go-progress-host.test.ts": 113358,
5
- "src/ensure-built.test.ts": 63589,
6
- "src/owned-installation.test.ts": 52150,
7
- "src/nx-daemon-validity.test.ts": 50650,
8
- "src/executors/bounded-exec/mbx-queue.test.ts": 45955,
5
+ "src/ensure-built.test.ts": 50158,
6
+ "src/nx-daemon-validity.test.ts": 43752,
9
7
  "src/executors/bounded-exec/cargo-progress-host.test.ts": 38973,
10
- "src/cargo-resolve-cache.test.ts": 35830,
11
- "src/executors/bounded-exec/executor.test.ts": 27061,
12
- "src/ensure-built-receipt.test.ts": 22597,
13
- "src/index.test.ts": 17787,
14
- "src/linked-snapshots.nx.test.ts": 17751,
15
- "src/cargo-retention.test.ts": 17431,
16
- "src/cargo-source-hash.test.ts": 16020,
17
- "src/executors/bounded-exec/progress.test.ts": 13261,
18
- "src/process-group.test.ts": 11471,
19
- "src/cargo-closure-input.test.ts": 11140,
20
- "src/managed-files/devenv-wrapper.test.ts": 10173,
21
- "src/nx-dot-input-policy.test.ts": 8998,
22
- "src/nx-daemon-claim.test.ts": 8514,
23
- "src/task-results.test.ts": 8194,
24
- "src/executors/typescript-emit/executor.test.ts": 7952,
25
- "src/executors/bounded-exec/ram-temp.test.ts": 7270,
26
- "src/cargo-closure-key.test.ts": 6359,
27
- "src/bounded-test-policy.test.ts": 5754,
28
- "src/nextest-partitions.test.ts": 5407,
29
- "src/nx-daemon-ignore-files.test.ts": 5306,
30
- "src/nx-daemon-idle-policy.test.ts": 4132,
31
- "src/managed-files/repo-path.test.ts": 3915,
32
- "src/executors/bounded-exec/verdict.test.ts": 3665,
33
- "src/runtime-input.test.ts": 3653,
34
- "src/managed-files/forgejo-artifact.test.ts": 3633,
35
- "src/cargo-workspace.test.ts": 3380,
36
- "src/nx-daemon-start-never.test.ts": 3312,
37
- "src/nx-project-graph-errors.test.ts": 3146,
38
- "src/nx-task-output-lease.test.ts": 3142,
39
- "src/nx-daemon-watch-filter.test.ts": 2746,
40
- "src/nx-cache-restore-mtime.test.ts": 2727,
41
- "src/nx-remote-cache-outage.test.ts": 2659,
42
- "src/executors/bounded-exec/test-results-run.test.ts": 2373,
43
- "src/serial-group-wiring.test.ts": 2245,
44
- "src/task-history-namespace.test.ts": 2160,
45
- "src/nx-skipped-task-exit.test.ts": 2119,
46
- "src/managed-files/generator.test.ts": 1989,
47
- "src/nx-cache-kept-outputs.test.ts": 1953,
48
- "src/nx-plugin-load-errors.test.ts": 1914,
49
- "src/nx-files-archive-racy.test.ts": 1890,
50
- "src/task-graph-policy.nx.test.ts": 1719,
51
- "src/nx-use-local.test.ts": 1694,
52
- "src/nx-daemon-env-identity.test.ts": 1653,
53
- "src/typecheck-test-policy.test.ts": 1635,
54
- "src/cross-check-policy.test.ts": 1506,
55
- "src/managed-files/managed-format-json.test.ts": 1422,
56
- "src/graph-input-contract.test.ts": 1406,
57
- "src/test-walk-policy.test.ts": 1330,
58
- "src/cargo-build-script-env.test.ts": 1286,
59
- "src/nextest-code-bound.test.ts": 1178,
60
- "src/executors/all-verdicts/executor.test.ts": 1171,
61
- "src/nx-foreign-workspace-env.test.ts": 1117,
62
- "src/bin/smoo-nx-bound-failures.test.ts": 1046,
63
- "src/typescript-resolution.test.ts": 1001,
64
- "src/testing.test.ts": 900,
65
- "src/cargo-child-kill.test.ts": 867,
66
- "src/nx-resident-graph-workers.test.ts": 778,
67
- "src/nx-failure-life-cycles.test.ts": 689,
68
- "src/nx-incomplete-run-summary.test.ts": 667,
69
- "src/nx-critical-path-schedule.test.ts": 662,
70
- "src/package-target-policy.test.ts": 590,
71
- "src/bun-bootstrap.test.ts": 547,
72
- "src/nx-store-resolution.test.ts": 537,
73
- "src/executors/bounded-exec/runner-hook.test.ts": 530,
74
- "src/nx-cache-bound.test.ts": 516,
75
- "src/test-clock-policy.test.ts": 425,
76
- "src/nx-raw-inputs.test.ts": 424,
77
- "src/lock-scope.test.ts": 409,
78
- "src/managed-files/unserved-workspace-hooks.test.ts": 394,
79
- "src/executors/cargo-zigbuild/executor.test.ts": 392,
80
- "src/forbidden-spelling-policy.test.ts": 388,
81
- "src/managed-files/github-host-cache-isolation.test.ts": 365,
82
- "src/executors/scriptc-native/executor.test.ts": 362,
83
- "src/ensure-built-witness.test.ts": 361,
84
- "src/executors/bounded-exec/hang-diagnostics.test.ts": 347,
85
- "src/eslint-sources.test.ts": 326,
86
- "src/nx-daemon-root-normalization.test.ts": 307,
87
- "src/executors/bounded-exec/runtime-pin.test.ts": 136,
88
- "src/test-timings.test.ts": 135,
89
- "src/version-actions.test.ts": 132,
90
- "src/generators/make-public/generator.test.ts": 131,
91
- "src/managed-files/cache-ttsc-plugins.test.ts": 131,
92
- "src/build-state-output-policy.test.ts": 130,
93
- "src/release-config-policy.test.ts": 120,
94
- "src/managed-files/setup-devenv-free-disk.test.ts": 114,
95
- "src/cargo-toolchain-paths.test.ts": 110,
96
- "src/executors/bounded-exec/cpu-pool.test.ts": 101,
97
- "src/cargo-closure-filesets.test.ts": 98,
98
- "src/producer-receipts.test.ts": 83,
99
- "src/workspace-config-policy.test.ts": 80,
100
- "src/nx-state-location.test.ts": 57,
101
- "src/manifest-hash.test.ts": 53,
102
- "src/executors/bounded-exec/test-results.test.ts": 48,
103
- "src/wait-why-policy.test.ts": 40,
104
- "src/executors/bounded-exec/ram-provenance.test.ts": 38,
105
- "src/executors/bounded-exec/run-cpu-pool.test.ts": 38,
106
- "src/executors/bounded-exec/disk-lease.test.ts": 33,
107
- "src/managed-files/tree-permissions.test.ts": 33,
8
+ "src/nextest-partitions.test.ts": 35261,
9
+ "src/executors/bounded-exec/executor.test.ts": 28863,
10
+ "src/cargo-retention.test.ts": 24111,
11
+ "src/owned-installation.test.ts": 23722,
12
+ "src/ensure-built-receipt.test.ts": 20391,
13
+ "src/cargo-resolve-cache.test.ts": 20246,
14
+ "src/cargo-source-hash.test.ts": 16053,
15
+ "src/linked-snapshots.nx.test.ts": 11920,
16
+ "src/index.test.ts": 8528,
17
+ "src/cargo-closure-input.test.ts": 8157,
18
+ "src/nx-daemon-claim.test.ts": 7678,
19
+ "src/executors/typescript-emit/executor.test.ts": 7126,
20
+ "src/executors/bounded-exec/ram-temp.test.ts": 5801,
21
+ "src/process-group.test.ts": 5461,
22
+ "src/bounded-test-policy.test.ts": 5361,
23
+ "src/task-history-namespace.test.ts": 5246,
24
+ "src/executors/bounded-exec/run-cpu-pool.test.ts": 5185,
25
+ "src/task-results.test.ts": 4915,
26
+ "src/nx-daemon-start-never.test.ts": 4590,
27
+ "src/serial-group-wiring.test.ts": 4153,
28
+ "src/nx-daemon-ignore-files.test.ts": 4149,
29
+ "src/nx-dot-input-policy.test.ts": 3577,
30
+ "src/cargo-workspace.test.ts": 3534,
31
+ "src/cargo-build-script-env.test.ts": 3401,
32
+ "src/executors/bounded-exec/hang-diagnostics.test.ts": 3348,
33
+ "src/nx-files-archive-racy.test.ts": 3119,
34
+ "src/nx-daemon-idle-policy.test.ts": 3069,
35
+ "src/nx-remote-cache-outage.test.ts": 2542,
36
+ "src/cross-check-policy.test.ts": 2486,
37
+ "src/cargo-closure-key.test.ts": 2374,
38
+ "src/managed-files/repo-path.test.ts": 2244,
39
+ "src/testing.test.ts": 2140,
40
+ "src/nx-daemon-watch-filter.test.ts": 2120,
41
+ "src/nx-daemon-env-identity.test.ts": 2075,
42
+ "src/nx-task-output-lease.test.ts": 1926,
43
+ "src/runtime-input.test.ts": 1781,
44
+ "src/nx-skipped-task-exit.test.ts": 1767,
45
+ "src/executors/bounded-exec/verdict.test.ts": 1643,
46
+ "src/nx-project-graph-errors.test.ts": 1591,
47
+ "src/managed-files/forgejo-artifact.test.ts": 1556,
48
+ "src/nx-cache-restore-mtime.test.ts": 1453,
49
+ "src/graph-input-contract.test.ts": 1308,
50
+ "src/managed-files/generator.test.ts": 1168,
51
+ "src/nx-foreign-workspace-env.test.ts": 1151,
52
+ "src/nx-cache-kept-outputs.test.ts": 1095,
53
+ "src/nx-use-local.test.ts": 1064,
54
+ "src/bin/smoo-nx-bound-failures.test.ts": 1049,
55
+ "src/managed-files/managed-format-json.test.ts": 1041,
56
+ "src/typecheck-test-policy.test.ts": 1019,
57
+ "src/executors/all-verdicts/executor.test.ts": 972,
58
+ "src/nextest-code-bound.test.ts": 896,
59
+ "src/nx-plugin-load-errors.test.ts": 860,
60
+ "src/executors/bounded-exec/test-results-run.test.ts": 838,
61
+ "src/nx-resident-graph-workers.test.ts": 836,
62
+ "src/cargo-child-kill.test.ts": 745,
63
+ "src/test-walk-policy.test.ts": 633,
64
+ "src/typescript-resolution.test.ts": 562,
65
+ "src/executors/bounded-exec/runner-hook.test.ts": 543,
66
+ "src/task-graph-policy.nx.test.ts": 512,
67
+ "src/nx-store-resolution.test.ts": 485,
68
+ "src/nx-failure-life-cycles.test.ts": 450,
69
+ "src/bun-bootstrap.test.ts": 414,
70
+ "src/nx-daemon-root-normalization.test.ts": 407,
71
+ "src/managed-files/github-host-cache-isolation.test.ts": 356,
72
+ "src/nx-incomplete-run-summary.test.ts": 346,
73
+ "src/nx-critical-path-schedule.test.ts": 315,
74
+ "src/nx-raw-inputs.test.ts": 275,
75
+ "src/nx-cache-bound.test.ts": 248,
76
+ "src/ensure-built-witness.test.ts": 237,
77
+ "src/test-clock-policy.test.ts": 230,
78
+ "src/managed-files/unserved-workspace-hooks.test.ts": 215,
79
+ "src/executors/bounded-exec/cpu-pool.test.ts": 212,
80
+ "src/package-target-policy.test.ts": 211,
81
+ "src/executors/cargo-zigbuild/executor.test.ts": 194,
82
+ "src/lock-scope.test.ts": 135,
83
+ "src/managed-files/cache-ttsc-plugins.test.ts": 116,
84
+ "src/forbidden-spelling-policy.test.ts": 115,
85
+ "src/managed-files/devenv-wrapper.test.ts": 103,
86
+ "src/executors/bounded-exec/runtime-pin.test.ts": 99,
87
+ "src/nx-state-location.test.ts": 88,
88
+ "src/managed-files/setup-devenv-free-disk.test.ts": 86,
89
+ "src/generators/make-public/generator.test.ts": 85,
90
+ "src/test-timings.test.ts": 85,
91
+ "src/cargo-closure-filesets.test.ts": 83,
92
+ "src/executors/scriptc-native/executor.test.ts": 80,
93
+ "src/executors/wrangler-deploy/executor.test.ts": 70,
94
+ "src/producer-receipts.test.ts": 60,
95
+ "src/release-config-policy.test.ts": 56,
96
+ "src/version-actions.test.ts": 53,
97
+ "src/manifest-hash.test.ts": 49,
98
+ "src/workspace-config-policy.test.ts": 47,
99
+ "src/executors/wrangler-deploy/hasher.test.ts": 39,
100
+ "src/generators/create-package/generator.test.ts": 33,
101
+ "src/cargo-toolchain-paths.test.ts": 31,
102
+ "src/eslint-sources.test.ts": 31,
103
+ "src/executors/bounded-exec/test-results.test.ts": 30,
104
+ "src/managed-files/trace-db-artifact.test.ts": 30,
108
105
  "src/executors/nextest-group/executor.test.ts": 28,
109
- "src/executors/bounded-exec/ram-temp-held.test.ts": 25,
110
- "src/managed-files/trace-db-artifact.test.ts": 25,
111
- "src/executors/clean-outputs/executor.test.ts": 23,
112
- "src/managed-files/json-edit.test.ts": 22,
113
- "src/generators/bun-test-tracing/generator.test.ts": 21,
114
- "src/generators/create-package/generator.test.ts": 20,
115
- "src/generators/bounded-test-targets/generator.test.ts": 17,
116
- "src/executors/bounded-exec/ram-detach.test.ts": 15,
117
- "src/cargo-closure-input.property.test.ts": 14,
118
- "src/nx-daemon-idle-cpu.test.ts": 14,
119
- "src/task-graph-policy.test.ts": 13,
120
- "src/disk-command-policy.test.ts": 12,
121
- "src/executors/bounded-exec/lock-wait.test.ts": 11,
122
- "src/managed-files/tree.test.ts": 11,
123
- "src/nx-project-resolution-cache.test.ts": 11,
124
- "src/test-program.test.ts": 11,
125
- "src/host-controller-wiring.test.ts": 9,
126
- "src/managed-files/managed-content.test.ts": 9,
127
- "src/nx-run-information.test.ts": 9,
128
- "src/nx-task-graph-cycles.test.ts": 8,
129
- "src/bun-file-packages.test.ts": 7,
130
- "src/executors/bounded-exec/ram-fixture.test.ts": 6,
131
- "src/executors/bounded-exec/runner-lifecycle.test.ts": 6,
132
- "src/executors/bounded-exec/runner-sizing.test.ts": 6,
133
- "src/cargo-retention-hook.test.ts": 5,
134
- "src/executors/bounded-exec/mbx-pool.test.ts": 5,
135
- "src/executors/bounded-exec/owned-subtree.test.ts": 5,
136
- "src/executors/bounded-exec/bounds.test.ts": 3
106
+ "src/executors/bounded-exec/disk-lease.test.ts": 27,
107
+ "src/executors/bounded-exec/ram-provenance.test.ts": 27,
108
+ "src/executors/bounded-exec/progress.test.ts": 26,
109
+ "src/executors/bounded-exec/ram-detach.test.ts": 25,
110
+ "src/generators/bun-test-tracing/generator.test.ts": 25,
111
+ "src/executors/bounded-exec/mbx-queue.test.ts": 24,
112
+ "src/build-state-output-policy.test.ts": 21,
113
+ "src/generators/bounded-test-targets/generator.test.ts": 21,
114
+ "src/executors/bounded-exec/bounds.test.ts": 20,
115
+ "src/executors/bounded-exec/runner-sizing.test.ts": 19,
116
+ "src/executors/bounded-exec/lock-wait.test.ts": 17,
117
+ "src/executors/bounded-exec/ram-temp-held.test.ts": 17,
118
+ "src/executors/bounded-exec/runner-lifecycle.test.ts": 17,
119
+ "src/managed-files/json-edit.test.ts": 17,
120
+ "src/executors/bounded-exec/mbx-pool.test.ts": 15,
121
+ "src/executors/bounded-exec/ram-fixture.test.ts": 14,
122
+ "src/managed-files/tree-permissions.test.ts": 12,
123
+ "src/managed-files/tree.test.ts": 12,
124
+ "src/wait-why-policy.test.ts": 12,
125
+ "src/executors/bounded-exec/owned-subtree.test.ts": 11,
126
+ "src/cargo-closure-input.property.test.ts": 10,
127
+ "src/managed-files/managed-content.test.ts": 10,
128
+ "src/nx-daemon-idle-cpu.test.ts": 10,
129
+ "src/task-graph-policy.test.ts": 10,
130
+ "src/disk-command-policy.test.ts": 9,
131
+ "src/test-program.test.ts": 9,
132
+ "src/bun-file-packages.test.ts": 8,
133
+ "src/cargo-retention-hook.test.ts": 8,
134
+ "src/host-controller-wiring.test.ts": 8,
135
+ "src/nx-project-resolution-cache.test.ts": 8,
136
+ "src/nx-task-graph-cycles.test.ts": 7,
137
+ "src/nx-run-information.test.ts": 6
137
138
  }
138
139
  }
@@ -1,26 +0,0 @@
1
- import type { CleanOutputsOptions } from './schema.js';
2
- interface CleanOutputsContext {
3
- root: string;
4
- projectName?: string;
5
- projectsConfigurations?: {
6
- projects: Record<string, NxProject>;
7
- };
8
- }
9
- interface CleanOutputsResult {
10
- success: boolean;
11
- }
12
- interface NxProject {
13
- root?: string;
14
- targets?: Record<string, {
15
- outputs?: string[];
16
- }>;
17
- }
18
- export default function cleanOutputsExecutor(options: CleanOutputsOptions, context: CleanOutputsContext): Promise<CleanOutputsResult>;
19
- export declare function resolveOutputDirs(options: {
20
- outputs: string[];
21
- projectName: string;
22
- projectRoot: string;
23
- workspaceRoot: string;
24
- }): string[];
25
- export {};
26
- //# sourceMappingURL=executor.d.ts.map