@smoothbricks/nx-plugin 0.5.6 → 0.6.0

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 (440) hide show
  1. package/README.md +1095 -360
  2. package/dist/.build-inputs.json +138 -0
  3. package/dist/bin/smoo-nx-cargo-toolchain.d.ts +3 -0
  4. package/dist/bin/smoo-nx-cargo-toolchain.d.ts.map +1 -0
  5. package/dist/bin/smoo-nx-cargo-toolchain.js +8 -0
  6. package/dist/bin/smoo-nx-forbidden-spellings.d.ts +3 -0
  7. package/dist/bin/smoo-nx-forbidden-spellings.d.ts.map +1 -0
  8. package/dist/bin/smoo-nx-forbidden-spellings.js +32 -0
  9. package/dist/bin/smoo-nx-nextest-timings.d.ts +3 -0
  10. package/dist/bin/smoo-nx-nextest-timings.d.ts.map +1 -0
  11. package/dist/bin/smoo-nx-nextest-timings.js +28 -0
  12. package/dist/bounded-test-policy.d.ts +1 -1
  13. package/dist/bounded-test-policy.d.ts.map +1 -1
  14. package/dist/bounded-test-policy.js +14 -15
  15. package/dist/build-state-output-policy.d.ts +95 -1
  16. package/dist/build-state-output-policy.d.ts.map +1 -1
  17. package/dist/build-state-output-policy.js +368 -30
  18. package/dist/bun-lock-scope.d.ts +44 -0
  19. package/dist/bun-lock-scope.d.ts.map +1 -0
  20. package/dist/bun-lock-scope.js +97 -0
  21. package/dist/cargo-build-script-env.d.ts +49 -0
  22. package/dist/cargo-build-script-env.d.ts.map +1 -0
  23. package/dist/cargo-build-script-env.js +324 -0
  24. package/dist/cargo-closure-input.d.ts +31 -4
  25. package/dist/cargo-closure-input.d.ts.map +1 -1
  26. package/dist/cargo-closure-input.js +66 -6
  27. package/dist/cargo-retention-hook.d.ts +17 -0
  28. package/dist/cargo-retention-hook.d.ts.map +1 -0
  29. package/dist/cargo-retention-hook.js +85 -0
  30. package/dist/cargo-source-hash.d.ts +25 -7
  31. package/dist/cargo-source-hash.d.ts.map +1 -1
  32. package/dist/cargo-source-hash.js +108 -43
  33. package/dist/cargo-toolchain-paths.d.ts +40 -0
  34. package/dist/cargo-toolchain-paths.d.ts.map +1 -0
  35. package/dist/cargo-toolchain-paths.js +84 -0
  36. package/dist/cargo-toolchain-policy.d.ts +25 -8
  37. package/dist/cargo-toolchain-policy.d.ts.map +1 -1
  38. package/dist/cargo-toolchain-policy.js +39 -5
  39. package/dist/cargo-workspace.d.ts +10 -4
  40. package/dist/cargo-workspace.d.ts.map +1 -1
  41. package/dist/cargo-workspace.js +65 -95
  42. package/dist/cross-check-policy.d.ts +9 -9
  43. package/dist/cross-check-policy.d.ts.map +1 -1
  44. package/dist/cross-check-policy.js +11 -11
  45. package/dist/disk-command-policy.d.ts.map +1 -1
  46. package/dist/disk-command-policy.js +1 -0
  47. package/dist/ensure-built-receipt.d.ts +13 -5
  48. package/dist/ensure-built-receipt.d.ts.map +1 -1
  49. package/dist/ensure-built-receipt.js +126 -47
  50. package/dist/ensure-built-witness.d.ts +27 -8
  51. package/dist/ensure-built-witness.d.ts.map +1 -1
  52. package/dist/ensure-built-witness.js +45 -15
  53. package/dist/ensure-built.d.ts.map +1 -1
  54. package/dist/ensure-built.js +9 -1
  55. package/dist/eslint-config-closure.d.ts +7 -0
  56. package/dist/eslint-config-closure.d.ts.map +1 -0
  57. package/dist/eslint-config-closure.js +346 -0
  58. package/dist/executors/all-verdicts/executor.d.ts +35 -0
  59. package/dist/executors/all-verdicts/executor.d.ts.map +1 -0
  60. package/dist/executors/all-verdicts/executor.js +133 -0
  61. package/dist/executors/all-verdicts/schema.d.ts +10 -0
  62. package/dist/executors/all-verdicts/schema.d.ts.map +1 -0
  63. package/dist/executors/all-verdicts/schema.js +2 -0
  64. package/dist/executors/bounded-exec/bounds.d.ts +56 -0
  65. package/dist/executors/bounded-exec/bounds.d.ts.map +1 -0
  66. package/dist/executors/bounded-exec/bounds.js +43 -0
  67. package/dist/executors/bounded-exec/cpu-pool.d.ts +33 -36
  68. package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
  69. package/dist/executors/bounded-exec/cpu-pool.js +54 -119
  70. package/dist/executors/bounded-exec/executor.d.ts +19 -12
  71. package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
  72. package/dist/executors/bounded-exec/executor.js +371 -239
  73. package/dist/executors/bounded-exec/gateway-lease.d.ts +22 -19
  74. package/dist/executors/bounded-exec/gateway-lease.d.ts.map +1 -1
  75. package/dist/executors/bounded-exec/gateway-lease.js +81 -28
  76. package/dist/executors/bounded-exec/hang-diagnostics.d.ts +18 -1
  77. package/dist/executors/bounded-exec/hang-diagnostics.d.ts.map +1 -1
  78. package/dist/executors/bounded-exec/hang-diagnostics.js +148 -30
  79. package/dist/executors/bounded-exec/lease-wait.d.ts +43 -0
  80. package/dist/executors/bounded-exec/lease-wait.d.ts.map +1 -0
  81. package/dist/executors/bounded-exec/lease-wait.js +68 -0
  82. package/dist/executors/bounded-exec/lock-wait.d.ts +51 -0
  83. package/dist/executors/bounded-exec/lock-wait.d.ts.map +1 -0
  84. package/dist/executors/bounded-exec/lock-wait.js +108 -0
  85. package/dist/executors/bounded-exec/owned-subtree.d.ts +84 -0
  86. package/dist/executors/bounded-exec/owned-subtree.d.ts.map +1 -0
  87. package/dist/executors/bounded-exec/owned-subtree.js +178 -0
  88. package/dist/executors/bounded-exec/progress.d.ts +4 -1
  89. package/dist/executors/bounded-exec/progress.d.ts.map +1 -1
  90. package/dist/executors/bounded-exec/progress.js +5 -2
  91. package/dist/executors/bounded-exec/ram-attach.d.ts +19 -0
  92. package/dist/executors/bounded-exec/ram-attach.d.ts.map +1 -0
  93. package/dist/executors/bounded-exec/ram-attach.js +207 -0
  94. package/dist/executors/bounded-exec/ram-detach.d.ts +25 -0
  95. package/dist/executors/bounded-exec/ram-detach.d.ts.map +1 -0
  96. package/dist/executors/bounded-exec/ram-detach.js +207 -0
  97. package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts +76 -0
  98. package/dist/executors/bounded-exec/ram-temp-fixtures.d.ts.map +1 -1
  99. package/dist/executors/bounded-exec/ram-temp-fixtures.js +296 -0
  100. package/dist/executors/bounded-exec/ram-temp.d.ts +388 -88
  101. package/dist/executors/bounded-exec/ram-temp.d.ts.map +1 -1
  102. package/dist/executors/bounded-exec/ram-temp.js +1213 -399
  103. package/dist/executors/bounded-exec/run-cpu-pool.d.ts +4 -4
  104. package/dist/executors/bounded-exec/run-cpu-pool.d.ts.map +1 -1
  105. package/dist/executors/bounded-exec/run-cpu-pool.js +20 -30
  106. package/dist/executors/bounded-exec/runner-hook.js +14 -5
  107. package/dist/executors/bounded-exec/runner-lifecycle.d.ts +14 -1
  108. package/dist/executors/bounded-exec/runner-lifecycle.d.ts.map +1 -1
  109. package/dist/executors/bounded-exec/runner-lifecycle.js +27 -6
  110. package/dist/executors/bounded-exec/{cpu-tokens.d.ts → runner-sizing.d.ts} +14 -42
  111. package/dist/executors/bounded-exec/runner-sizing.d.ts.map +1 -0
  112. package/dist/executors/bounded-exec/{cpu-tokens.js → runner-sizing.js} +5 -35
  113. package/dist/executors/bounded-exec/runtime-pin.d.ts +73 -0
  114. package/dist/executors/bounded-exec/runtime-pin.d.ts.map +1 -0
  115. package/dist/executors/bounded-exec/runtime-pin.js +167 -0
  116. package/dist/executors/bounded-exec/schema.d.ts +18 -1
  117. package/dist/executors/bounded-exec/schema.d.ts.map +1 -1
  118. package/dist/executors/bounded-exec/verdict.d.ts +40 -11
  119. package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
  120. package/dist/executors/bounded-exec/verdict.js +88 -19
  121. package/dist/executors/cargo-zigbuild/executor.d.ts +21 -0
  122. package/dist/executors/cargo-zigbuild/executor.d.ts.map +1 -1
  123. package/dist/executors/cargo-zigbuild/executor.js +67 -12
  124. package/dist/executors/clean-outputs/executor.js +1 -0
  125. package/dist/executors/scriptc-native/executor.d.ts +79 -0
  126. package/dist/executors/scriptc-native/executor.d.ts.map +1 -0
  127. package/dist/executors/scriptc-native/executor.js +367 -0
  128. package/dist/executors/scriptc-native/ffi-paths.d.ts +9 -0
  129. package/dist/executors/scriptc-native/ffi-paths.d.ts.map +1 -0
  130. package/dist/executors/scriptc-native/ffi-paths.js +25 -0
  131. package/dist/executors/scriptc-native/schema.d.ts +34 -0
  132. package/dist/executors/scriptc-native/schema.d.ts.map +1 -0
  133. package/dist/executors/scriptc-native/schema.js +1 -0
  134. package/dist/executors/typescript-emit/executor.d.ts +3 -1
  135. package/dist/executors/typescript-emit/executor.d.ts.map +1 -1
  136. package/dist/executors/typescript-emit/executor.js +164 -33
  137. package/dist/forbidden-spelling-policy.d.ts +56 -0
  138. package/dist/forbidden-spelling-policy.d.ts.map +1 -0
  139. package/dist/forbidden-spelling-policy.js +176 -0
  140. package/dist/generators/create-package/generator.d.ts.map +1 -1
  141. package/dist/generators/create-package/generator.js +3 -4
  142. package/dist/graph-input-contract.d.ts +14 -0
  143. package/dist/graph-input-contract.d.ts.map +1 -1
  144. package/dist/graph-input-contract.js +67 -2
  145. package/dist/index.d.ts +23 -6
  146. package/dist/index.d.ts.map +1 -1
  147. package/dist/index.js +676 -215
  148. package/dist/managed-assets.d.ts +2 -0
  149. package/dist/managed-assets.d.ts.map +1 -1
  150. package/dist/managed-files/files.d.ts +3 -3
  151. package/dist/managed-files/files.d.ts.map +1 -1
  152. package/dist/managed-files/files.js +28 -3
  153. package/dist/managed-files/managed-format.d.ts.map +1 -1
  154. package/dist/managed-files/managed-format.js +1 -0
  155. package/dist/nextest-code-bound.js +1 -0
  156. package/dist/nextest-timings.d.ts +35 -0
  157. package/dist/nextest-timings.d.ts.map +1 -0
  158. package/dist/nextest-timings.js +168 -0
  159. package/dist/owned-installation.d.ts +6 -5
  160. package/dist/owned-installation.d.ts.map +1 -1
  161. package/dist/owned-installation.js +150 -26
  162. package/dist/package-target-policy.d.ts.map +1 -1
  163. package/dist/package-target-policy.js +2 -3
  164. package/dist/process-children.d.ts +7 -0
  165. package/dist/process-children.d.ts.map +1 -0
  166. package/dist/process-children.darwin.d.ts +7 -0
  167. package/dist/process-children.darwin.d.ts.map +1 -0
  168. package/dist/process-children.darwin.js +13 -0
  169. package/dist/process-children.js +14 -0
  170. package/dist/process-children.linux.d.ts +8 -0
  171. package/dist/process-children.linux.d.ts.map +1 -0
  172. package/dist/process-children.linux.js +25 -0
  173. package/dist/process-group.d.ts +108 -0
  174. package/dist/process-group.d.ts.map +1 -0
  175. package/dist/process-group.js +171 -0
  176. package/dist/process-listing.d.ts +7 -0
  177. package/dist/process-listing.d.ts.map +1 -0
  178. package/dist/process-listing.js +51 -0
  179. package/dist/producer-receipts.d.ts +8 -2
  180. package/dist/producer-receipts.d.ts.map +1 -1
  181. package/dist/producer-receipts.js +75 -48
  182. package/dist/task-graph-policy.d.ts +21 -0
  183. package/dist/task-graph-policy.d.ts.map +1 -0
  184. package/dist/task-graph-policy.js +91 -0
  185. package/dist/test-timings.js +4 -4
  186. package/dist/test-walk-policy.d.ts +14 -5
  187. package/dist/test-walk-policy.d.ts.map +1 -1
  188. package/dist/test-walk-policy.js +8 -2
  189. package/dist/testing.d.ts +73 -28
  190. package/dist/testing.d.ts.map +1 -1
  191. package/dist/testing.js +217 -223
  192. package/dist/tool-bins.d.ts +33 -0
  193. package/dist/tool-bins.d.ts.map +1 -0
  194. package/dist/tool-bins.js +72 -0
  195. package/dist/typecheck-test-policy.d.ts.map +1 -1
  196. package/dist/typecheck-test-policy.js +3 -4
  197. package/dist/wait-why-policy.d.ts +28 -0
  198. package/dist/wait-why-policy.d.ts.map +1 -0
  199. package/dist/wait-why-policy.js +223 -0
  200. package/dist/workspace-config-policy.d.ts +14 -8
  201. package/dist/workspace-config-policy.d.ts.map +1 -1
  202. package/dist/workspace-config-policy.js +60 -16
  203. package/dist/workspace-manifest.d.ts +41 -6
  204. package/dist/workspace-manifest.d.ts.map +1 -1
  205. package/dist/workspace-manifest.js +57 -0
  206. package/executors.json +21 -1
  207. package/loader.js +2 -0
  208. package/managed/raw/envrc +11 -0
  209. package/managed/raw/patches/nx@23.2.1.patch +2840 -199
  210. package/managed/raw/patches/ttsc@0.34.1.patch +119 -0
  211. package/managed/raw/tooling/direnv/cargo-fetch-bound.ts +245 -0
  212. package/managed/raw/tooling/direnv/cargo-fetch-run.ts +299 -0
  213. package/managed/raw/tooling/direnv/compiler-variables.sh +42 -0
  214. package/managed/raw/tooling/direnv/developer-links.ts +464 -25
  215. package/managed/raw/tooling/direnv/devenv.smoo.nix +78 -38
  216. package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +14 -12
  217. package/managed/raw/tooling/direnv/installed-bun-links.ts +308 -0
  218. package/managed/raw/tooling/direnv/linked-snapshots.ts +62 -3
  219. package/managed/raw/tooling/direnv/nx-socket-dir.sh +56 -17
  220. package/managed/raw/tooling/direnv/repo-path +68 -6
  221. package/managed/raw/tooling/direnv/secret-references.ts +13 -4
  222. package/managed/raw/tooling/direnv/setup-environment.ts +128 -537
  223. package/managed/raw/tooling/direnv/toolchain-stamp.ts +4 -2
  224. package/managed/raw/tooling/direnv/ttsc-env.sh +9 -0
  225. package/managed/raw/tooling/direnv/uv-relocation.ts +227 -0
  226. package/managed/raw/tooling/git-hooks/commit-msg.sh +2 -1
  227. package/managed/raw/tooling/git-hooks/pre-commit.sh +2 -1
  228. package/managed/raw/tooling/git-hooks/pre-push.sh +2 -1
  229. package/managed/templates/github/actions/cache-ttsc-plugins/action.yml +85 -7
  230. package/managed/templates/github/actions/save-nix-devenv/action.yml +12 -2
  231. package/managed/templates/github/actions/setup-devenv/action.yml +2 -0
  232. package/package.json +77 -13
  233. package/src/bin/smoo-nx-cargo-toolchain.ts +11 -0
  234. package/src/bin/smoo-nx-forbidden-spellings.ts +33 -0
  235. package/src/bin/smoo-nx-nextest-timings.ts +31 -0
  236. package/src/bounded-test-policy.ts +12 -14
  237. package/src/build-state-output-policy.ts +458 -34
  238. package/src/bun-lock-scope.ts +108 -0
  239. package/src/cargo-build-script-env.ts +265 -0
  240. package/src/cargo-closure-input.ts +74 -7
  241. package/src/cargo-retention-hook.ts +94 -0
  242. package/src/cargo-source-hash.ts +138 -41
  243. package/src/cargo-toolchain-paths.ts +95 -0
  244. package/src/cargo-toolchain-policy.ts +49 -5
  245. package/src/cargo-workspace.ts +72 -123
  246. package/src/cross-check-policy.ts +12 -10
  247. package/src/disk-command-policy.ts +1 -0
  248. package/src/ensure-built-receipt.ts +132 -39
  249. package/src/ensure-built-witness.ts +62 -10
  250. package/src/ensure-built.ts +11 -1
  251. package/src/eslint-config-closure.ts +357 -0
  252. package/src/executors/all-verdicts/executor.ts +164 -0
  253. package/src/executors/all-verdicts/schema.json +22 -0
  254. package/src/executors/all-verdicts/schema.ts +10 -0
  255. package/src/executors/bounded-exec/bounds.ts +76 -0
  256. package/src/executors/bounded-exec/cpu-pool.ts +51 -117
  257. package/src/executors/bounded-exec/executor.ts +423 -259
  258. package/src/executors/bounded-exec/gateway-lease.ts +82 -33
  259. package/src/executors/bounded-exec/hang-diagnostics.ts +173 -31
  260. package/src/executors/bounded-exec/lease-wait.ts +89 -0
  261. package/src/executors/bounded-exec/lock-wait.ts +141 -0
  262. package/src/executors/bounded-exec/owned-subtree.ts +235 -0
  263. package/src/executors/bounded-exec/progress.ts +9 -3
  264. package/src/executors/bounded-exec/ram-attach.ts +238 -0
  265. package/src/executors/bounded-exec/ram-detach.ts +226 -0
  266. package/src/executors/bounded-exec/ram-temp-fixtures.ts +358 -0
  267. package/src/executors/bounded-exec/ram-temp-registry.txt +440 -0
  268. package/src/executors/bounded-exec/ram-temp.ts +1497 -460
  269. package/src/executors/bounded-exec/run-cpu-pool.ts +22 -30
  270. package/src/executors/bounded-exec/runner-hook.ts +14 -6
  271. package/src/executors/bounded-exec/runner-lifecycle.ts +31 -8
  272. package/src/executors/bounded-exec/{cpu-tokens.ts → runner-sizing.ts} +13 -59
  273. package/src/executors/bounded-exec/runtime-pin.ts +232 -0
  274. package/src/executors/bounded-exec/schema.json +11 -2
  275. package/src/executors/bounded-exec/schema.ts +19 -1
  276. package/src/executors/bounded-exec/verdict.ts +137 -34
  277. package/src/executors/cargo-zigbuild/executor.ts +82 -8
  278. package/src/executors/clean-outputs/executor.ts +1 -0
  279. package/src/executors/scriptc-native/executor.ts +394 -0
  280. package/src/executors/scriptc-native/ffi-paths.ts +29 -0
  281. package/src/executors/scriptc-native/schema.json +60 -0
  282. package/src/executors/scriptc-native/schema.ts +34 -0
  283. package/src/executors/typescript-emit/executor.ts +205 -38
  284. package/src/forbidden-spelling-policy.ts +226 -0
  285. package/src/generators/create-package/generator.ts +7 -7
  286. package/src/graph-input-contract.ts +61 -2
  287. package/src/index.ts +792 -225
  288. package/src/managed-assets.ts +3 -0
  289. package/src/managed-files/files.ts +28 -3
  290. package/src/managed-files/managed-format.ts +1 -0
  291. package/src/nextest-code-bound.ts +1 -0
  292. package/src/nextest-timings.ts +106 -0
  293. package/src/owned-installation.ts +150 -23
  294. package/src/package-target-policy.ts +2 -3
  295. package/src/process-children.darwin.ts +14 -0
  296. package/src/process-children.linux.ts +33 -0
  297. package/src/process-children.ts +22 -0
  298. package/src/process-group.ts +209 -0
  299. package/src/process-listing.ts +54 -0
  300. package/src/producer-receipts.ts +68 -45
  301. package/src/task-graph-policy.ts +98 -0
  302. package/src/test-walk-policy.ts +23 -8
  303. package/src/testing.ts +240 -232
  304. package/src/tool-bins.ts +108 -0
  305. package/src/typecheck-test-policy.ts +2 -3
  306. package/src/wait-why-policy.ts +226 -0
  307. package/src/workspace-config-policy.ts +63 -15
  308. package/src/workspace-manifest.ts +89 -6
  309. package/test-timings.json +123 -98
  310. package/dist/bin/smoo-nx-failures.d.ts +0 -3
  311. package/dist/bin/smoo-nx-failures.d.ts.map +0 -1
  312. package/dist/bin/smoo-nx-failures.js +0 -3
  313. package/dist/bin/smoo-nx-nextest-extract.d.ts +0 -3
  314. package/dist/bin/smoo-nx-nextest-extract.d.ts.map +0 -1
  315. package/dist/bin/smoo-nx-nextest-extract.js +0 -42
  316. package/dist/executors/bounded-exec/cpu-tokens.d.ts.map +0 -1
  317. package/dist/failure-summary.d.ts +0 -5
  318. package/dist/failure-summary.d.ts.map +0 -1
  319. package/dist/failure-summary.js +0 -118
  320. package/dist/nextest-extraction.d.ts +0 -117
  321. package/dist/nextest-extraction.d.ts.map +0 -1
  322. package/dist/nextest-extraction.js +0 -303
  323. package/managed/raw/patches/ttsc@0.30.4.patch +0 -2255
  324. package/src/__tests__/cargo-closure-filesets.ts +0 -94
  325. package/src/__tests__/cargo-closure-fixture.ts +0 -113
  326. package/src/__tests__/counted-cargo-process.ts +0 -286
  327. package/src/__tests__/counted-cargo.ts +0 -713
  328. package/src/__tests__/directory-change.ts +0 -27
  329. package/src/__tests__/fixture-cargo-home.ts +0 -36
  330. package/src/__tests__/fixture-nx-env.ts +0 -193
  331. package/src/__tests__/owned-installation.ts +0 -13
  332. package/src/__tests__/past-tick.ts +0 -12
  333. package/src/__tests__/progress-clock.ts +0 -43
  334. package/src/__tests__/runtime-input.ts +0 -23
  335. package/src/bin/smoo-nx-bound-failures.test.ts +0 -127
  336. package/src/bin/smoo-nx-failures.ts +0 -4
  337. package/src/bin/smoo-nx-nextest-extract.ts +0 -44
  338. package/src/bounded-test-policy.test.ts +0 -1029
  339. package/src/build-state-output-policy.test.ts +0 -115
  340. package/src/bun-bootstrap.test.ts +0 -102
  341. package/src/bun-file-packages.test.ts +0 -47
  342. package/src/cargo-closure-filesets.test.ts +0 -63
  343. package/src/cargo-closure-input.property.test.ts +0 -50
  344. package/src/cargo-closure-input.test.ts +0 -506
  345. package/src/cargo-closure-key.test.ts +0 -240
  346. package/src/cargo-resolve-cache.test.ts +0 -1181
  347. package/src/cargo-source-hash.test.ts +0 -707
  348. package/src/cargo-workspace.test.ts +0 -615
  349. package/src/cross-check-policy.test.ts +0 -316
  350. package/src/disk-command-policy.test.ts +0 -61
  351. package/src/ensure-built-receipt.test.ts +0 -279
  352. package/src/ensure-built-witness.test.ts +0 -688
  353. package/src/ensure-built.test.ts +0 -1462
  354. package/src/executors/bounded-exec/cargo-progress-host.test.ts +0 -332
  355. package/src/executors/bounded-exec/cpu-pool.test.ts +0 -684
  356. package/src/executors/bounded-exec/cpu-tokens.test.ts +0 -519
  357. package/src/executors/bounded-exec/disk-lease.test.ts +0 -219
  358. package/src/executors/bounded-exec/executor-host.test.ts +0 -800
  359. package/src/executors/bounded-exec/executor.test.ts +0 -1819
  360. package/src/executors/bounded-exec/go-progress-host.test.ts +0 -171
  361. package/src/executors/bounded-exec/hang-diagnostics.test.ts +0 -291
  362. package/src/executors/bounded-exec/progress.test.ts +0 -139
  363. package/src/executors/bounded-exec/ram-temp-held.test.ts +0 -264
  364. package/src/executors/bounded-exec/ram-temp-host.test.ts +0 -635
  365. package/src/executors/bounded-exec/ram-temp.test.ts +0 -750
  366. package/src/executors/bounded-exec/run-cpu-pool.test.ts +0 -79
  367. package/src/executors/bounded-exec/runner-hook.test.ts +0 -193
  368. package/src/executors/bounded-exec/runner-lifecycle.test.ts +0 -82
  369. package/src/executors/bounded-exec/verdict.test.ts +0 -545
  370. package/src/executors/cargo-zigbuild/executor.test.ts +0 -129
  371. package/src/executors/clean-outputs/executor.test.ts +0 -20
  372. package/src/executors/typescript-emit/executor.test.ts +0 -83
  373. package/src/failure-summary.ts +0 -119
  374. package/src/generators/bounded-test-targets/generator.test.ts +0 -138
  375. package/src/generators/bun-test-tracing/generator.test.ts +0 -250
  376. package/src/generators/create-package/generator.test.ts +0 -190
  377. package/src/generators/make-public/generator.test.ts +0 -137
  378. package/src/graph-input-contract.test.ts +0 -379
  379. package/src/host-controller-wiring.test.ts +0 -31
  380. package/src/index.test.ts +0 -3319
  381. package/src/linked-snapshots.nx.test.ts +0 -254
  382. package/src/managed-files/forgejo-artifact.test.ts +0 -395
  383. package/src/managed-files/generator.test.ts +0 -243
  384. package/src/managed-files/github-host-cache-isolation.test.ts +0 -86
  385. package/src/managed-files/json-edit.test.ts +0 -216
  386. package/src/managed-files/managed-content.test.ts +0 -166
  387. package/src/managed-files/managed-format-json.test.ts +0 -308
  388. package/src/managed-files/repo-path.test.ts +0 -172
  389. package/src/managed-files/setup-devenv-free-disk.test.ts +0 -95
  390. package/src/managed-files/trace-db-artifact.test.ts +0 -7
  391. package/src/managed-files/tree-permissions.test.ts +0 -109
  392. package/src/managed-files/tree.test.ts +0 -123
  393. package/src/manifest-hash.test.ts +0 -219
  394. package/src/nextest-code-bound.test.ts +0 -161
  395. package/src/nextest-extraction.test.ts +0 -216
  396. package/src/nextest-extraction.ts +0 -371
  397. package/src/nextest-partitions.test.ts +0 -501
  398. package/src/nx-cache-bound.test.ts +0 -109
  399. package/src/nx-cache-restore-mtime.test.ts +0 -170
  400. package/src/nx-daemon-claim.test.ts +0 -279
  401. package/src/nx-daemon-idle-cpu.test.ts +0 -80
  402. package/src/nx-daemon-idle-policy.test.ts +0 -111
  403. package/src/nx-daemon-ignore-files.test.ts +0 -210
  404. package/src/nx-daemon-root-normalization.test.ts +0 -105
  405. package/src/nx-daemon-start-never.test.ts +0 -292
  406. package/src/nx-daemon-validity.test.ts +0 -1055
  407. package/src/nx-dot-input-policy.test.ts +0 -353
  408. package/src/nx-failure-life-cycles.test.ts +0 -207
  409. package/src/nx-files-archive-racy.test.ts +0 -97
  410. package/src/nx-foreign-workspace-env.test.ts +0 -329
  411. package/src/nx-incomplete-run-summary.test.ts +0 -70
  412. package/src/nx-plugin-load-errors.test.ts +0 -120
  413. package/src/nx-project-graph-errors.test.ts +0 -70
  414. package/src/nx-project-resolution-cache.test.ts +0 -176
  415. package/src/nx-raw-inputs.test.ts +0 -166
  416. package/src/nx-resident-graph-workers.test.ts +0 -112
  417. package/src/nx-run-information.test.ts +0 -118
  418. package/src/nx-skipped-task-exit.test.ts +0 -180
  419. package/src/nx-state-location.test.ts +0 -63
  420. package/src/nx-store-resolution.test.ts +0 -81
  421. package/src/nx-task-graph-cycles.test.ts +0 -148
  422. package/src/nx-task-output-lease.test.ts +0 -550
  423. package/src/nx-use-local.test.ts +0 -105
  424. package/src/owned-installation.test.ts +0 -105
  425. package/src/package-target-policy.test.ts +0 -1014
  426. package/src/producer-receipts.test.ts +0 -285
  427. package/src/release-config-policy.test.ts +0 -311
  428. package/src/runtime-input.test.ts +0 -393
  429. package/src/serial-group-wiring.test.ts +0 -326
  430. package/src/task-history-namespace.test.ts +0 -181
  431. package/src/task-results.test.ts +0 -228
  432. package/src/test-clock-policy.test.ts +0 -338
  433. package/src/test-program.test.ts +0 -303
  434. package/src/test-timings.test.ts +0 -240
  435. package/src/test-walk-policy.test.ts +0 -620
  436. package/src/testing.test.ts +0 -509
  437. package/src/typecheck-test-policy.test.ts +0 -1468
  438. package/src/typescript-resolution.test.ts +0 -76
  439. package/src/version-actions.test.ts +0 -80
  440. package/src/workspace-config-policy.test.ts +0 -737
@@ -29,7 +29,9 @@
29
29
  * cargo re-runs those scripts against the current toolchain, and every target
30
30
  * directory's `.rustc_info.json`, so cargo asks the current rustc again.
31
31
  * Nothing else under target/ is touched; a checkout without target/ has
32
- * nothing to do.
32
+ * nothing to do. The DEVENV_SKIP_TASKS environment-capture pass only needs
33
+ * exported variables: leave probes and cache invalidation to final shell entry,
34
+ * after tasks and project hooks have settled the toolchain.
33
35
  */
34
36
  import { existsSync, readdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
35
37
  import { join, resolve } from 'node:path';
@@ -37,7 +39,7 @@ import { $ } from 'bun';
37
39
 
38
40
  const root = resolve(`${process.env.DEVENV_ROOT ?? process.cwd()}/../..`);
39
41
  const target = join(root, 'target');
40
- if (existsSync(target)) {
42
+ if (!process.env.DEVENV_SKIP_TASKS && existsSync(target)) {
41
43
  const stamp = join(target, '.toolchain-stamp');
42
44
  const identity = await toolchainIdentity();
43
45
  const recorded = existsSync(stamp) ? readFileSync(stamp, 'utf8') : null;
@@ -10,6 +10,15 @@
10
10
  # TTSC_GO_CACHE_DIR, where ttsc keeps the plugin binaries it compiles and the
11
11
  # Go build cache that compiles them.
12
12
  #
13
+ # This checkout is the directory the script is sourced from: devenv.smoo.nix's
14
+ # enterShell enters the workspace root first, and each git hook enters
15
+ # `git rev-parse --show-toplevel`. Sourced from any other directory, $PWD names
16
+ # no checkout, and every cache below would land beside that directory instead:
17
+ # a shell in HOME would create ~/.cache/ttsc. That directory is refused.
18
+ if [ ! -f "$PWD/tooling/direnv/ttsc-env.sh" ]; then
19
+ echo "ttsc-env.sh: not a workspace root (no tooling/direnv/ttsc-env.sh): $PWD; source it from the checkout root" >&2
20
+ return 1
21
+ fi
13
22
  # The compiler is always this checkout's own. An inherited cache directory is
14
23
  # the host's choice and stays (CI points it at a cache shared across runs),
15
24
  # unless the environment was bound for another workspace: an inherited
@@ -0,0 +1,227 @@
1
+ import {
2
+ closeSync,
3
+ existsSync,
4
+ lstatSync,
5
+ openSync,
6
+ readdirSync,
7
+ readFileSync,
8
+ readlinkSync,
9
+ readSync,
10
+ realpathSync,
11
+ statSync,
12
+ writeFileSync,
13
+ } from 'node:fs';
14
+ import path from 'node:path';
15
+
16
+ /**
17
+ * What keeps a uv environment location-independent, read and written on the filesystem alone: whether an existing
18
+ * environment is the relocatable one an install leaves (uvEnvironmentRelocatable), and the rewrite of each `.pth`
19
+ * line naming a directory in the checkout as a path relative to its site-packages (relativizeCheckoutPaths).
20
+ * setup-environment.ts's uv installer runs uv and stamps; this module decides nothing about when.
21
+ */
22
+
23
+ function sitePackagesDirectories(environment: string): string[] {
24
+ const lib = path.join(environment, 'lib');
25
+ const directories: string[] = [];
26
+ for (const python of existsSync(lib) ? readdirSync(lib) : []) {
27
+ if (!python.startsWith('python')) continue;
28
+ const sitePackages = path.join(lib, python, 'site-packages');
29
+ if (existsSync(sitePackages)) directories.push(sitePackages);
30
+ }
31
+ return directories;
32
+ }
33
+
34
+ /** One shell command line as its words: quotes group, backslash escapes, no expansion. */
35
+ function shellWords(line: string): string[] {
36
+ const words: string[] = [];
37
+ let word = '';
38
+ let quote: string | null = null;
39
+ let started = false;
40
+ for (let index = 0; index < line.length; index += 1) {
41
+ const char = line[index] ?? '';
42
+ if (quote !== null) {
43
+ if (char === quote) quote = null;
44
+ else if (char === '\\' && quote === '"' && index + 1 < line.length) word += line[++index];
45
+ else word += char;
46
+ continue;
47
+ }
48
+ if (char === "'" || char === '"') {
49
+ quote = char;
50
+ started = true;
51
+ } else if (char === '\\' && index + 1 < line.length) {
52
+ word += line[++index];
53
+ started = true;
54
+ } else if (/\s/.test(char)) {
55
+ if (started || word !== '') words.push(word);
56
+ word = '';
57
+ started = false;
58
+ } else {
59
+ word += char;
60
+ }
61
+ }
62
+ if (started || word !== '') words.push(word);
63
+ return words;
64
+ }
65
+
66
+ /**
67
+ * Whether an existing environment is the relocatable one install would leave: its config says
68
+ * so, no launcher or interpreter link names an environment or a checkout (its own, a foreign
69
+ * one, or a checkout's .devenv profile, in a shebang, a wrapper's exec argv, or the link
70
+ * itself), and no `.pth` line is an absolute path. The stamp alone cannot witness this — a
71
+ * copied checkout carries a matching stamp and an old absolute launcher together, and admits
72
+ * the launcher forever.
73
+ */
74
+ export function uvEnvironmentRelocatable(environment: string): boolean {
75
+ let config: string;
76
+ try {
77
+ config = readFileSync(path.join(environment, 'pyvenv.cfg'), 'utf8');
78
+ } catch (error) {
79
+ if (error instanceof Error && 'code' in error && error.code === 'ENOENT') return false;
80
+ throw error;
81
+ }
82
+ if (!/^relocatable\s*=\s*true\s*$/m.test(config)) return false;
83
+ const environmentReal = realpathSync(environment);
84
+ // Whether an absolute interpreter path names an environment or a checkout, as opposed to a
85
+ // store or system interpreter, which names neither: it is inside this environment, inside
86
+ // another environment (its home carries pyvenv.cfg), under a checkout's .devenv state, or
87
+ // it no longer exists at all.
88
+ const namesEnvironment = (interpreter: string): boolean => {
89
+ if (interpreter.startsWith(`${environment}/`) || interpreter.startsWith(`${environmentReal}/`)) return true;
90
+ if (!existsSync(interpreter)) return true;
91
+ if (interpreter.split(path.sep).includes('.devenv')) return true;
92
+ const home = path.dirname(path.dirname(interpreter));
93
+ return existsSync(path.join(home, 'pyvenv.cfg')) && home !== environment && home !== environmentReal;
94
+ };
95
+ const bin = path.join(environment, 'bin');
96
+ if (existsSync(bin)) {
97
+ const buffer = Buffer.alloc(256);
98
+ for (const name of readdirSync(bin)) {
99
+ const file = path.join(bin, name);
100
+ let size: number;
101
+ let isFile: boolean;
102
+ let isLink = false;
103
+ try {
104
+ const stat = statSync(file);
105
+ size = stat.size;
106
+ isFile = stat.isFile();
107
+ isLink = lstatSync(file).isSymbolicLink();
108
+ } catch {
109
+ return false;
110
+ }
111
+ if (!isFile) continue;
112
+ if (isLink) {
113
+ // The interpreter link itself is witnessed lexically, but only when it leaves the
114
+ // environment: a relative alias (bin/python3 -> python) is the layout uv itself
115
+ // writes and stays inside it. An absolute link into another checkout's .devenv
116
+ // state names that checkout even when its final target is a store interpreter,
117
+ // and no shebang reading ever sees it.
118
+ let linkTarget: string;
119
+ try {
120
+ linkTarget = readlinkSync(file);
121
+ } catch {
122
+ return false;
123
+ }
124
+ if (path.isAbsolute(linkTarget)) {
125
+ const lexical = path.resolve(bin, linkTarget);
126
+ if (lexical.split(path.sep).includes('.devenv')) return false;
127
+ const linkHome = path.dirname(path.dirname(lexical));
128
+ if (existsSync(path.join(linkHome, 'pyvenv.cfg')) && linkHome !== environment && linkHome !== environmentReal)
129
+ return false;
130
+ } else {
131
+ // A relative alias that resolves outside the environment is judged by where it
132
+ // lands, like an absolute one; only aliases staying inside are uv's own layout.
133
+ const lexical = path.resolve(bin, linkTarget);
134
+ if (
135
+ !lexical.startsWith(`${environment}${path.sep}`) &&
136
+ !lexical.startsWith(`${environmentReal}${path.sep}`) &&
137
+ namesEnvironment(lexical)
138
+ )
139
+ return false;
140
+ }
141
+ }
142
+ let head: string;
143
+ try {
144
+ const fd = openSync(file, 'r');
145
+ try {
146
+ head = buffer.toString('utf8', 0, readSync(fd, buffer, 0, buffer.length, 0));
147
+ } finally {
148
+ closeSync(fd);
149
+ }
150
+ } catch {
151
+ return false;
152
+ }
153
+ const shebang = /^#!\s*(\/\S+)(?:\s+(.*))?$/.exec(head.split('\n')[0] ?? '');
154
+ if (shebang === null) continue;
155
+ const interpreter = shebang[1] ?? '';
156
+ const program = path.basename(interpreter);
157
+ if (program === 'env') {
158
+ // An env trampoline naming a bare program resolves through PATH; one naming an
159
+ // absolute interpreter (after any flags, -S included) is judged as that interpreter.
160
+ const tokens = shellWords(shebang[2] ?? '');
161
+ let index = 0;
162
+ while (index < tokens.length && tokens[index]?.startsWith('-')) index += tokens[index] === '-u' ? 2 : 1;
163
+ const target = tokens[index];
164
+ if (target !== undefined && target.startsWith('/') && namesEnvironment(target)) return false;
165
+ continue;
166
+ }
167
+ if (['sh', 'bash', 'dash', 'zsh'].includes(program)) {
168
+ // A relocatable wrapper execs a self-locating interpreter; a legacy one execs an
169
+ // absolute environment path. Only exec lines are judged, tokenized as shell words
170
+ // (quotes group, so spaced paths stay whole; a $VAR expansion is not an absolute
171
+ // path and is never classified).
172
+ if (size > 262_144) return false;
173
+ let body: string;
174
+ try {
175
+ body = readFileSync(file, 'utf8');
176
+ } catch {
177
+ return false;
178
+ }
179
+ for (const line of body.split('\n')) {
180
+ // Producer headers are shell words too: a uv console script's polyglot first
181
+ // line tokenizes to the same exec argv as a plain exec line.
182
+ const words = shellWords(line);
183
+ if (words[0] !== 'exec') continue;
184
+ const target = words.find((word) => word.includes('/bin/python')) ?? words[1];
185
+ if (target !== undefined && target.startsWith('/') && namesEnvironment(target)) return false;
186
+ }
187
+ continue;
188
+ }
189
+ if (namesEnvironment(interpreter)) return false;
190
+ }
191
+ }
192
+ for (const sitePackages of sitePackagesDirectories(environment)) {
193
+ for (const name of readdirSync(sitePackages).filter((entry) => entry.endsWith('.pth'))) {
194
+ const content = readFileSync(path.join(sitePackages, name), 'utf8');
195
+ if (content.split('\n').some((line) => path.isAbsolute(line))) return false;
196
+ }
197
+ }
198
+ return true;
199
+ }
200
+
201
+ /**
202
+ * Rewrite every `.pth` line in the environment's site-packages that names a
203
+ * directory inside the checkout at `checkoutRoot` as a path relative to that
204
+ * site-packages, which is how Python's `site` resolves a relative line. Every
205
+ * other line — an `import` line, a path outside the checkout, a directory that
206
+ * does not exist — stays as uv wrote it.
207
+ */
208
+ export function relativizeCheckoutPaths(environment: string, checkoutRoot: string): void {
209
+ const root = `${realpathSync(checkoutRoot)}${path.sep}`;
210
+ for (const sitePackages of sitePackagesDirectories(environment)) {
211
+ const site = realpathSync(sitePackages);
212
+ for (const name of readdirSync(site).filter((entry) => entry.endsWith('.pth'))) {
213
+ const file = path.join(site, name);
214
+ const content = readFileSync(file, 'utf8');
215
+ const rewritten = content
216
+ .split('\n')
217
+ .map((line) => {
218
+ const target = path.isAbsolute(line) && existsSync(line) ? realpathSync(line) : null;
219
+ return target?.startsWith(root) ? path.relative(site, target) : line;
220
+ })
221
+ .join('\n');
222
+ if (rewritten !== content) {
223
+ writeFileSync(file, rewritten);
224
+ }
225
+ }
226
+ }
227
+ }
@@ -2,7 +2,8 @@
2
2
  cd "$(git rev-parse --show-toplevel)"
3
3
  TOOLING="$PWD/tooling"
4
4
 
5
- export PATH="$("$TOOLING/direnv/repo-path")"
5
+ # A bare assignment, not `export PATH=$(…)`: export's status would hide repo-path's refusal of an unserved workspace.
6
+ PATH="$("$TOOLING/direnv/repo-path")" || exit $?
6
7
  # ttsc compiles with this checkout's native TypeScript compiler into this
7
8
  # checkout's plugin cache, which the dev shell names. A hook runs outside that
8
9
  # shell, in whatever environment ran `git`; ttsc-env.sh names them the same way.
@@ -2,7 +2,8 @@
2
2
  cd "$(git rev-parse --show-toplevel)"
3
3
  TOOLING="$PWD/tooling"
4
4
 
5
- export PATH="$("$TOOLING/direnv/repo-path")"
5
+ # A bare assignment, not `export PATH=$(…)`: export's status would hide repo-path's refusal of an unserved workspace.
6
+ PATH="$("$TOOLING/direnv/repo-path")" || exit $?
6
7
  # ttsc compiles with this checkout's native TypeScript compiler into this
7
8
  # checkout's plugin cache, which the dev shell names. A hook runs outside that
8
9
  # shell, in whatever environment ran `git`; ttsc-env.sh names them the same way.
@@ -50,7 +50,8 @@ TOOLING="$PWD/tooling"
50
50
  # gates below guard publication only, so they do not apply.
51
51
  if [ "${1:-}" = backup ]; then exit 0; fi
52
52
 
53
- export PATH="$("$TOOLING/direnv/repo-path")"
53
+ # A bare assignment, not `export PATH=$(…)`: export's status would hide repo-path's refusal of an unserved workspace.
54
+ PATH="$("$TOOLING/direnv/repo-path")" || exit $?
54
55
  # ttsc compiles with this checkout's native TypeScript compiler into this
55
56
  # checkout's plugin cache, which the dev shell names. A hook runs outside that
56
57
  # shell, in whatever environment ran `git`; ttsc-env.sh names them the same way.
@@ -1,18 +1,96 @@
1
1
  name: Cache ttsc plugins
2
2
  description: >
3
- Restore/save compiled ttsc native plugin binaries (typia, etc.). These are content-keyed under TTSC_CACHE_DIR/plugins
4
- and skip the multi-minute `go build` when the cache key matches. The Go object cache (go-build/) is NOT cached — it is
5
- multi-GB and only helps when the plugin key misses. Do not use restore-keys: a prefix hit restores plugins built for a
6
- different lock/patch, then ttsc still compiles any missing plugin against a cold GOMODCACHE.
3
+ Restore or save the compiled ttsc native plugin binaries (typia, etc.) under TTSC_CACHE_DIR/plugins. ttsc names every
4
+ entry by a hash of what it was compiled from and skips the multi-minute `go build` when one matches. Setup restores
5
+ them, and save-nix-devenv saves the entries the job used when the job ends, red or green. The Go object cache
6
+ (go-build/) is NOT cached: it is multi-GB and only helps when the plugin key misses.
7
+
8
+ inputs:
9
+ mode:
10
+ description: Restore the plugin cache before the shell is built, or save it when the job ends.
11
+ required: false
12
+ default: restore
7
13
 
8
14
  runs:
9
15
  using: composite
10
16
  steps:
11
- - name: Cache ttsc plugin binaries
12
- uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
17
+ # The binaries are compiled from ttsc's own packages and from each package that ships a ttsc plugin, which declares
18
+ # ttsc as a dependency or peer (typia does). Those bun.lock entries, with the ttsc patch and the Go toolchain pins,
19
+ # are the whole key: a dependency change no plugin reaches, such as a release commit rewriting a workspace package's
20
+ # version, keeps the binaries. No match fails the step: this action only runs where bun.lock locks ttsc.
21
+ - name: Select ttsc lock entries
22
+ if: inputs.mode == 'restore'
23
+ shell: bash
24
+ run: |
25
+ mkdir -p .cache/ttsc
26
+ grep -E '^ +"(@ttsc/[^"]+|ttsc(/[^"]+)?)": |"ttsc": "' bun.lock > .cache/ttsc/plugin-lock-entries
27
+
28
+ # A prefix hit is safe. ttsc names every entry by a hash of what it was compiled from (the ttsc and tsgo versions,
29
+ # platform and architecture, the Go toolchain and its build environment, the plugin sources) and runs an entry only
30
+ # when its name is the one it computes for this checkout, so a restored entry of other inputs is dead weight and
31
+ # never a wrong binary.
32
+ - name: Restore ttsc plugin binaries
33
+ id: restore
34
+ if: inputs.mode == 'restore'
35
+ uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
13
36
  with:
14
37
  # Only the compiled plugin binaries (~30MB each). Path is relative to the
15
38
  # workspace; devenv sets TTSC_CACHE_DIR to <repo>/.cache/ttsc.
16
39
  path: .cache/ttsc/plugins
17
40
  # prettier-ignore
18
- key: ${{ runner.os }}-${{ runner.arch }}-ttsc-plugins-v1-${{ hashFiles('bun.lock', 'package.json', 'patches/ttsc@*.patch', 'tooling/direnv/devenv.lock', 'tooling/direnv/devenv.smoo.nix') }}
41
+ key: ${{ runner.os }}-${{ runner.arch }}-ttsc-plugins-v1-${{ hashFiles('.cache/ttsc/plugin-lock-entries', 'patches/ttsc@*.patch', 'tooling/direnv/devenv.lock', 'tooling/direnv/devenv.smoo.nix') }}
42
+ restore-keys: |
43
+ ${{ runner.os }}-${{ runner.arch }}-ttsc-plugins-v1-
44
+
45
+ # A composite action has no post step, so the save is a second call of this action, made by save-nix-devenv when
46
+ # the job ends. It then sees every plugin the job compiled, Nx tasks included, and it still runs after a red job:
47
+ # actions/cache saves in its own post step only after a green one. The save needs the key looked up here and the
48
+ # time of this restore. An exact hit, or a runner without a cache service, has nothing to save and leaves both unset.
49
+ - name: Note the key and time for the job-end save
50
+ if: steps.restore.outputs.cache-primary-key != '' && steps.restore.outputs.cache-hit != 'true'
51
+ shell: bash
52
+ env:
53
+ PRIMARY_KEY: ${{ steps.restore.outputs.cache-primary-key }}
54
+ run: |
55
+ {
56
+ echo "SMOO_TTSC_PLUGINS_SAVE_KEY=$PRIMARY_KEY"
57
+ echo "SMOO_TTSC_PLUGINS_RESTORED_AT_MS=$(($(date +%s) * 1000))"
58
+ } >> "$GITHUB_ENV"
59
+ echo "no exact hit: the job end saves the ttsc plugins it used under $PRIMARY_KEY"
60
+
61
+ # Each prefix hit restores the entries of earlier inputs, and saving them under the new key would carry every
62
+ # generation forward. ttsc evicts only from a cache it owns; one named by TTSC_CACHE_DIR belongs to the caller, so
63
+ # nothing else does. ttsc writes the epoch milliseconds into <entry>/.last-used on every hit and build, so an entry
64
+ # stamped before this job restored is one the job never used: it goes, with the lock directories ttsc keeps beside
65
+ # it (<entry>.lock*, which are not entries). A job that used no entry (it failed before ttsc ran) keeps none, and
66
+ # saving an emptied cache would pin it to the exact key for every later run, so it saves nothing.
67
+ - name: Drop ttsc plugin entries this job did not use
68
+ id: prune
69
+ if: inputs.mode == 'save' && env.SMOO_TTSC_PLUGINS_SAVE_KEY != ''
70
+ shell: bash
71
+ run: |
72
+ set -euo pipefail
73
+ shopt -s nullglob
74
+ : "${SMOO_TTSC_PLUGINS_RESTORED_AT_MS:?the restore of this action records when the job restored the cache}"
75
+ kept=0
76
+ for entry in "$GITHUB_WORKSPACE"/.cache/ttsc/plugins/*/; do
77
+ entry="${entry%/}"
78
+ case "$entry" in *.lock | *.lock.*) continue ;; esac
79
+ used=0
80
+ if [ -f "$entry/.last-used" ]; then used="$(<"$entry/.last-used")"; fi
81
+ if [ "$used" -ge "$SMOO_TTSC_PLUGINS_RESTORED_AT_MS" ]; then
82
+ kept=$((kept + 1))
83
+ else
84
+ echo "dropping ${entry##*/} (last used $used, job restored at $SMOO_TTSC_PLUGINS_RESTORED_AT_MS)"
85
+ rm -rf "$entry" "$entry".lock*
86
+ fi
87
+ done
88
+ echo "kept=$kept" >> "$GITHUB_OUTPUT"
89
+ echo "ttsc plugin entries this job used: $kept"
90
+
91
+ - name: Save ttsc plugin binaries
92
+ if: inputs.mode == 'save' && steps.prune.outputs.kept > 0
93
+ uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
94
+ with:
95
+ path: .cache/ttsc/plugins
96
+ key: ${{ env.SMOO_TTSC_PLUGINS_SAVE_KEY }}
@@ -1,7 +1,9 @@
1
1
  name: Save Nix/devenv caches
2
2
  description: >
3
- Save the devenv/direnv eval-cache segment after the job, on every ephemeral runner where setup missed and build-shell
4
- produced nix-eval-cache.db. The Nix store cache saves itself in setup-devenv's post phase (ephemeral runners only).
3
+ Save what must outlive the job, after it ends and whatever its result: the devenv/direnv eval-cache segment, on every
4
+ ephemeral runner where setup missed and build-shell produced nix-eval-cache.db, and the ttsc plugin binaries the job
5
+ used, when setup's restore was not an exact hit. The Nix store cache saves itself in setup-devenv's post phase
6
+ (ephemeral runners only).
5
7
 
6
8
  inputs:
7
9
  devenv-cache-hit:
@@ -30,3 +32,11 @@ runs:
30
32
  uses: ./.github/actions/cache-nix-devenv
31
33
  with:
32
34
  mode: save
35
+
36
+ # The plugins ttsc compiled during the whole job, Nx tasks included, which is why the save is here and not in setup,
37
+ # which returns before any of them runs. Setup's restore leaves the key to save under; where it left none (a host
38
+ # runner, an exact hit) this does nothing.
39
+ - name: 🧊 Save ttsc plugins
40
+ uses: ./.github/actions/cache-ttsc-plugins
41
+ with:
42
+ mode: save
@@ -319,6 +319,8 @@ runs:
319
319
  if: steps.runner-kind.outputs.host != 'true'
320
320
  uses: ./.github/actions/cache-node-modules
321
321
 
322
+ # Only the restore is here: save-nix-devenv saves the plugins when the job ends, after the tasks that run later
323
+ # have compiled theirs too.
322
324
  - name: 🧊 Cache ttsc plugins
323
325
  if: steps.runner-kind.outputs.host != 'true'
324
326
  uses: ./.github/actions/cache-ttsc-plugins
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smoothbricks/nx-plugin",
3
- "version": "0.5.6",
3
+ "version": "0.6.0",
4
4
  "type": "module",
5
5
  "sideEffects": false,
6
6
  "main": "./loader.js",
@@ -23,10 +23,10 @@
23
23
  "import": "./dist/eslint-file-set.js",
24
24
  "default": "./dist/eslint-file-set.js"
25
25
  },
26
- "./failure-summary": {
27
- "types": "./dist/failure-summary.d.ts",
28
- "import": "./dist/failure-summary.js",
29
- "default": "./dist/failure-summary.js"
26
+ "./cargo-build-script-env": {
27
+ "types": "./dist/cargo-build-script-env.d.ts",
28
+ "import": "./dist/cargo-build-script-env.js",
29
+ "default": "./dist/cargo-build-script-env.js"
30
30
  },
31
31
  "./bounded-test-policy": {
32
32
  "types": "./dist/bounded-test-policy.d.ts",
@@ -38,11 +38,21 @@
38
38
  "import": "./dist/build-state-output-policy.js",
39
39
  "default": "./dist/build-state-output-policy.js"
40
40
  },
41
+ "./task-graph-policy": {
42
+ "types": "./dist/task-graph-policy.d.ts",
43
+ "import": "./dist/task-graph-policy.js",
44
+ "default": "./dist/task-graph-policy.js"
45
+ },
41
46
  "./test-clock-policy": {
42
47
  "types": "./dist/test-clock-policy.d.ts",
43
48
  "import": "./dist/test-clock-policy.js",
44
49
  "default": "./dist/test-clock-policy.js"
45
50
  },
51
+ "./forbidden-spelling-policy": {
52
+ "types": "./dist/forbidden-spelling-policy.d.ts",
53
+ "import": "./dist/forbidden-spelling-policy.js",
54
+ "default": "./dist/forbidden-spelling-policy.js"
55
+ },
46
56
  "./test-walk-policy": {
47
57
  "types": "./dist/test-walk-policy.d.ts",
48
58
  "import": "./dist/test-walk-policy.js",
@@ -197,11 +207,12 @@
197
207
  "bin": {
198
208
  "smoo-nx-exec": "./dist/bin/smoo-nx-exec.js",
199
209
  "smoo-nx-cargo-hash": "./dist/bin/smoo-nx-cargo-hash.js",
200
- "smoo-nx-nextest-extract": "./dist/bin/smoo-nx-nextest-extract.js",
210
+ "smoo-nx-cargo-toolchain": "./dist/bin/smoo-nx-cargo-toolchain.js",
211
+ "smoo-nx-nextest-timings": "./dist/bin/smoo-nx-nextest-timings.js",
201
212
  "smoo-nx-bound-failures": "./dist/bin/smoo-nx-bound-failures.js",
202
- "smoo-nx-failures": "./dist/bin/smoo-nx-failures.js",
203
213
  "smoo-nx-test-walks": "./dist/bin/smoo-nx-test-walks.js",
204
- "smoo-nx-test-clocks": "./dist/bin/smoo-nx-test-clocks.js"
214
+ "smoo-nx-test-clocks": "./dist/bin/smoo-nx-test-clocks.js",
215
+ "smoo-nx-forbidden-spellings": "./dist/bin/smoo-nx-forbidden-spellings.js"
205
216
  },
206
217
  "generators": "./generators.json",
207
218
  "executors": "./executors.json",
@@ -223,6 +234,13 @@
223
234
  },
224
235
  "test-shard1": {
225
236
  "executor": "@smoothbricks/nx-plugin:bounded-exec",
237
+ "cache": true,
238
+ "inputs": [
239
+ "default",
240
+ "^dependencyDefault",
241
+ "bunToolchain",
242
+ "{workspaceRoot}/packages/cowshed/crates/cowshed-core/src/port_zero.cjs"
243
+ ],
226
244
  "options": {
227
245
  "command": "bun test --timeout=0 --timings=test-timings.json --shard=1/4 --path-ignore-patterns='**/*-host.test.ts'",
228
246
  "cwd": "{projectRoot}",
@@ -232,6 +250,13 @@
232
250
  },
233
251
  "test-shard2": {
234
252
  "executor": "@smoothbricks/nx-plugin:bounded-exec",
253
+ "cache": true,
254
+ "inputs": [
255
+ "default",
256
+ "^dependencyDefault",
257
+ "bunToolchain",
258
+ "{workspaceRoot}/packages/cowshed/crates/cowshed-core/src/port_zero.cjs"
259
+ ],
235
260
  "options": {
236
261
  "command": "bun test --timeout=0 --timings=test-timings.json --shard=2/4 --path-ignore-patterns='**/*-host.test.ts'",
237
262
  "cwd": "{projectRoot}",
@@ -241,6 +266,13 @@
241
266
  },
242
267
  "test-shard3": {
243
268
  "executor": "@smoothbricks/nx-plugin:bounded-exec",
269
+ "cache": true,
270
+ "inputs": [
271
+ "default",
272
+ "^dependencyDefault",
273
+ "bunToolchain",
274
+ "{workspaceRoot}/packages/cowshed/crates/cowshed-core/src/port_zero.cjs"
275
+ ],
244
276
  "options": {
245
277
  "command": "bun test --timeout=0 --timings=test-timings.json --shard=3/4 --path-ignore-patterns='**/*-host.test.ts'",
246
278
  "cwd": "{projectRoot}",
@@ -250,6 +282,13 @@
250
282
  },
251
283
  "test-shard4": {
252
284
  "executor": "@smoothbricks/nx-plugin:bounded-exec",
285
+ "cache": true,
286
+ "inputs": [
287
+ "default",
288
+ "^dependencyDefault",
289
+ "bunToolchain",
290
+ "{workspaceRoot}/packages/cowshed/crates/cowshed-core/src/port_zero.cjs"
291
+ ],
253
292
  "options": {
254
293
  "command": "bun test --timeout=0 --timings=test-timings.json --shard=4/4 --path-ignore-patterns='**/*-host.test.ts'",
255
294
  "cwd": "{projectRoot}",
@@ -259,16 +298,35 @@
259
298
  },
260
299
  "test-host": {
261
300
  "executor": "@smoothbricks/nx-plugin:bounded-exec",
301
+ "cache": true,
302
+ "inputs": [
303
+ "default",
304
+ "^dependencyDefault",
305
+ "bunToolchain",
306
+ "{workspaceRoot}/devenv.lock",
307
+ "{workspaceRoot}/tooling/direnv/devenv.lock",
308
+ "{workspaceRoot}/packages/cowshed/bin/**/*",
309
+ {
310
+ "dependentTasksOutputFiles": "**/*",
311
+ "transitive": true
312
+ }
313
+ ],
262
314
  "dependsOn": [
263
315
  {
264
316
  "projects": [
265
317
  "cowshed"
266
318
  ],
267
- "target": "build"
319
+ "target": "cli-native"
320
+ },
321
+ {
322
+ "projects": [
323
+ "cowshed"
324
+ ],
325
+ "target": "ram-fixture"
268
326
  }
269
327
  ],
270
328
  "options": {
271
- "command": "bun test --timeout=0 ./src/executors/bounded-exec/ram-temp-host.test.ts ./src/executors/bounded-exec/executor-host.test.ts ./src/executors/bounded-exec/go-progress-host.test.ts ./src/executors/bounded-exec/cargo-progress-host.test.ts",
329
+ "command": "bun test --timeout=0 ./src/executors/bounded-exec/ram-temp-host.test.ts ./src/executors/bounded-exec/executor-host.test.ts ./src/executors/bounded-exec/go-progress-host.test.ts ./src/executors/bounded-exec/cargo-progress-host.test.ts ./src/nx-daemon-stop-host.test.ts ./src/nx-daemon-watch-stream-host.test.ts ./src/executors/bounded-exec/hang-diagnostics-host.test.ts",
272
330
  "cwd": "{projectRoot}",
273
331
  "env": {
274
332
  "COWSHED_EXECUTABLE": "{workspaceRoot}/packages/cowshed/bin/cowshed"
@@ -294,6 +352,8 @@
294
352
  "generators.json",
295
353
  "executors.json",
296
354
  "!**/*.tsbuildinfo",
355
+ "!src/**/*.test.ts",
356
+ "!src/**/__tests__",
297
357
  "managed"
298
358
  ],
299
359
  "license": "MIT",
@@ -307,18 +367,22 @@
307
367
  },
308
368
  "dependencies": {
309
369
  "@nx/js": "23.2.1",
370
+ "@smoothbricks/build-inputs": "0.0.1-next.0",
371
+ "@smoothbricks/cargo-retain": "0.0.1-next.0",
372
+ "@smoothbricks/nextest-extract": "0.0.1-next.0",
310
373
  "jsonc-parser": "^3.3.1",
374
+ "minimatch": "10.2.5",
311
375
  "nx": "latest",
312
376
  "prettier": "^3.9.8",
313
377
  "smol-toml": "^1.6.1",
314
378
  "tslib": "^2.8.1",
315
379
  "typescript": "^6.0.3",
316
- "typia": "14.0.6",
380
+ "typia": "15.2.1",
317
381
  "yaml": "^2.9.0"
318
382
  },
319
383
  "devDependencies": {
320
- "@smoothbricks/lmao": "0.5.6",
321
- "@smoothbricks/validation": "0.1.12",
384
+ "@smoothbricks/lmao": "0.5.8",
385
+ "@smoothbricks/validation": "0.1.13",
322
386
  "fast-check": "^4.4.0"
323
387
  }
324
388
  }
@@ -0,0 +1,11 @@
1
+ #!/usr/bin/env node
2
+ import { cargoToolchainPaths, NIX_STORE_ROOT, resolveProgram } from '../cargo-toolchain-paths.js';
3
+
4
+ /** The runtime input of a cached cargo target: stdout is the value Nx hashes (cargo-toolchain-paths.ts says what it names). */
5
+ process.stdout.write(
6
+ cargoToolchainPaths({
7
+ environment: process.env,
8
+ storeRoot: NIX_STORE_ROOT,
9
+ resolve: (program) => resolveProgram(program, process.env.PATH),
10
+ }),
11
+ );