@smoothbricks/nx-plugin 0.5.7 → 0.6.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 (446) hide show
  1. package/README.md +1097 -360
  2. package/dist/.build-inputs.json +141 -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 +22 -5
  48. package/dist/ensure-built-receipt.d.ts.map +1 -1
  49. package/dist/ensure-built-receipt.js +168 -48
  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/bounded-exec/bounds.d.ts +56 -0
  59. package/dist/executors/bounded-exec/bounds.d.ts.map +1 -0
  60. package/dist/executors/bounded-exec/bounds.js +43 -0
  61. package/dist/executors/bounded-exec/cpu-pool-thread.d.ts +28 -0
  62. package/dist/executors/bounded-exec/cpu-pool-thread.d.ts.map +1 -0
  63. package/dist/executors/bounded-exec/cpu-pool-thread.js +20 -0
  64. package/dist/executors/bounded-exec/cpu-pool.d.ts +35 -38
  65. package/dist/executors/bounded-exec/cpu-pool.d.ts.map +1 -1
  66. package/dist/executors/bounded-exec/cpu-pool.js +56 -120
  67. package/dist/executors/bounded-exec/executor.d.ts +19 -12
  68. package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
  69. package/dist/executors/bounded-exec/executor.js +389 -239
  70. package/dist/executors/bounded-exec/gateway-lease.d.ts +23 -19
  71. package/dist/executors/bounded-exec/gateway-lease.d.ts.map +1 -1
  72. package/dist/executors/bounded-exec/gateway-lease.js +102 -29
  73. package/dist/executors/bounded-exec/hang-diagnostics.d.ts +18 -1
  74. package/dist/executors/bounded-exec/hang-diagnostics.d.ts.map +1 -1
  75. package/dist/executors/bounded-exec/hang-diagnostics.js +148 -30
  76. package/dist/executors/bounded-exec/lease-wait.d.ts +64 -0
  77. package/dist/executors/bounded-exec/lease-wait.d.ts.map +1 -0
  78. package/dist/executors/bounded-exec/lease-wait.js +72 -0
  79. package/dist/executors/bounded-exec/lock-wait.d.ts +51 -0
  80. package/dist/executors/bounded-exec/lock-wait.d.ts.map +1 -0
  81. package/dist/executors/bounded-exec/lock-wait.js +108 -0
  82. package/dist/executors/bounded-exec/mbx-pool.d.ts +31 -0
  83. package/dist/executors/bounded-exec/mbx-pool.d.ts.map +1 -0
  84. package/dist/executors/bounded-exec/mbx-pool.js +24 -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 +10 -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 +122 -35
  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 +48 -11
  119. package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
  120. package/dist/executors/bounded-exec/verdict.js +89 -20
  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/emit-overrides.d.ts +14 -0
  135. package/dist/executors/typescript-emit/emit-overrides.d.ts.map +1 -0
  136. package/dist/executors/typescript-emit/emit-overrides.js +24 -0
  137. package/dist/executors/typescript-emit/executor.d.ts +3 -1
  138. package/dist/executors/typescript-emit/executor.d.ts.map +1 -1
  139. package/dist/executors/typescript-emit/executor.js +146 -33
  140. package/dist/forbidden-spelling-policy.d.ts +56 -0
  141. package/dist/forbidden-spelling-policy.d.ts.map +1 -0
  142. package/dist/forbidden-spelling-policy.js +176 -0
  143. package/dist/generators/create-package/generator.d.ts.map +1 -1
  144. package/dist/generators/create-package/generator.js +3 -4
  145. package/dist/graph-input-contract.d.ts +14 -0
  146. package/dist/graph-input-contract.d.ts.map +1 -1
  147. package/dist/graph-input-contract.js +67 -2
  148. package/dist/index.d.ts +23 -6
  149. package/dist/index.d.ts.map +1 -1
  150. package/dist/index.js +672 -214
  151. package/dist/managed-assets.d.ts +2 -0
  152. package/dist/managed-assets.d.ts.map +1 -1
  153. package/dist/managed-files/files.d.ts +3 -3
  154. package/dist/managed-files/files.d.ts.map +1 -1
  155. package/dist/managed-files/files.js +28 -3
  156. package/dist/managed-files/managed-format.d.ts.map +1 -1
  157. package/dist/managed-files/managed-format.js +1 -0
  158. package/dist/managed-files/publish-workflow.js +14 -11
  159. package/dist/nextest-code-bound.js +1 -0
  160. package/dist/nextest-timings.d.ts +35 -0
  161. package/dist/nextest-timings.d.ts.map +1 -0
  162. package/dist/nextest-timings.js +168 -0
  163. package/dist/owned-installation.d.ts +6 -5
  164. package/dist/owned-installation.d.ts.map +1 -1
  165. package/dist/owned-installation.js +150 -26
  166. package/dist/package-target-policy.d.ts.map +1 -1
  167. package/dist/package-target-policy.js +2 -3
  168. package/dist/process-children.d.ts +7 -0
  169. package/dist/process-children.d.ts.map +1 -0
  170. package/dist/process-children.darwin.d.ts +7 -0
  171. package/dist/process-children.darwin.d.ts.map +1 -0
  172. package/dist/process-children.darwin.js +13 -0
  173. package/dist/process-children.js +14 -0
  174. package/dist/process-children.linux.d.ts +8 -0
  175. package/dist/process-children.linux.d.ts.map +1 -0
  176. package/dist/process-children.linux.js +25 -0
  177. package/dist/process-group.d.ts +108 -0
  178. package/dist/process-group.d.ts.map +1 -0
  179. package/dist/process-group.js +171 -0
  180. package/dist/process-listing.d.ts +7 -0
  181. package/dist/process-listing.d.ts.map +1 -0
  182. package/dist/process-listing.js +51 -0
  183. package/dist/producer-receipts.d.ts +8 -2
  184. package/dist/producer-receipts.d.ts.map +1 -1
  185. package/dist/producer-receipts.js +514 -47
  186. package/dist/task-graph-policy.d.ts +21 -0
  187. package/dist/task-graph-policy.d.ts.map +1 -0
  188. package/dist/task-graph-policy.js +91 -0
  189. package/dist/test-timings.js +4 -4
  190. package/dist/test-walk-policy.d.ts +14 -5
  191. package/dist/test-walk-policy.d.ts.map +1 -1
  192. package/dist/test-walk-policy.js +8 -2
  193. package/dist/testing.d.ts +73 -28
  194. package/dist/testing.d.ts.map +1 -1
  195. package/dist/testing.js +217 -223
  196. package/dist/tool-bins.d.ts +33 -0
  197. package/dist/tool-bins.d.ts.map +1 -0
  198. package/dist/tool-bins.js +72 -0
  199. package/dist/typecheck-test-policy.d.ts.map +1 -1
  200. package/dist/typecheck-test-policy.js +3 -4
  201. package/dist/wait-why-policy.d.ts +28 -0
  202. package/dist/wait-why-policy.d.ts.map +1 -0
  203. package/dist/wait-why-policy.js +223 -0
  204. package/dist/workspace-config-policy.d.ts +14 -8
  205. package/dist/workspace-config-policy.d.ts.map +1 -1
  206. package/dist/workspace-config-policy.js +60 -16
  207. package/dist/workspace-manifest.d.ts +41 -6
  208. package/dist/workspace-manifest.d.ts.map +1 -1
  209. package/dist/workspace-manifest.js +57 -0
  210. package/executors.json +16 -1
  211. package/loader.js +2 -0
  212. package/managed/raw/envrc +11 -0
  213. package/managed/raw/patches/nx@23.2.1.patch +2840 -199
  214. package/managed/raw/patches/ttsc@0.34.1.patch +119 -0
  215. package/managed/raw/tooling/direnv/cargo-fetch-bound.ts +245 -0
  216. package/managed/raw/tooling/direnv/cargo-fetch-run.ts +299 -0
  217. package/managed/raw/tooling/direnv/compiler-variables.sh +42 -0
  218. package/managed/raw/tooling/direnv/developer-links.ts +464 -25
  219. package/managed/raw/tooling/direnv/devenv.smoo.nix +78 -38
  220. package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +14 -12
  221. package/managed/raw/tooling/direnv/installed-bun-links.ts +308 -0
  222. package/managed/raw/tooling/direnv/linked-snapshots.ts +62 -3
  223. package/managed/raw/tooling/direnv/nx-socket-dir.sh +56 -17
  224. package/managed/raw/tooling/direnv/repo-path +68 -6
  225. package/managed/raw/tooling/direnv/secret-references.ts +13 -4
  226. package/managed/raw/tooling/direnv/setup-environment.ts +128 -537
  227. package/managed/raw/tooling/direnv/toolchain-stamp.ts +4 -2
  228. package/managed/raw/tooling/direnv/ttsc-env.sh +9 -0
  229. package/managed/raw/tooling/direnv/uv-relocation.ts +227 -0
  230. package/managed/raw/tooling/git-hooks/commit-msg.sh +2 -1
  231. package/managed/raw/tooling/git-hooks/pre-commit.sh +2 -1
  232. package/managed/raw/tooling/git-hooks/pre-push.sh +2 -1
  233. package/managed/templates/github/actions/cache-ttsc-plugins/action.yml +85 -7
  234. package/managed/templates/github/actions/save-nix-devenv/action.yml +12 -2
  235. package/managed/templates/github/actions/setup-devenv/action.yml +2 -0
  236. package/package.json +95 -14
  237. package/src/bin/smoo-nx-cargo-toolchain.ts +11 -0
  238. package/src/bin/smoo-nx-forbidden-spellings.ts +33 -0
  239. package/src/bin/smoo-nx-nextest-timings.ts +31 -0
  240. package/src/bounded-test-policy.ts +12 -14
  241. package/src/build-state-output-policy.ts +458 -34
  242. package/src/bun-lock-scope.ts +108 -0
  243. package/src/cargo-build-script-env.ts +265 -0
  244. package/src/cargo-closure-input.ts +74 -7
  245. package/src/cargo-retention-hook.ts +94 -0
  246. package/src/cargo-source-hash.ts +138 -41
  247. package/src/cargo-toolchain-paths.ts +95 -0
  248. package/src/cargo-toolchain-policy.ts +49 -5
  249. package/src/cargo-workspace.ts +72 -123
  250. package/src/cross-check-policy.ts +12 -10
  251. package/src/disk-command-policy.ts +1 -0
  252. package/src/ensure-built-receipt.ts +173 -39
  253. package/src/ensure-built-witness.ts +62 -10
  254. package/src/ensure-built.ts +11 -1
  255. package/src/eslint-config-closure.ts +357 -0
  256. package/src/executors/bounded-exec/bounds.ts +76 -0
  257. package/src/executors/bounded-exec/cpu-pool-thread.ts +43 -0
  258. package/src/executors/bounded-exec/cpu-pool.ts +55 -120
  259. package/src/executors/bounded-exec/executor.ts +442 -260
  260. package/src/executors/bounded-exec/gateway-lease.ts +94 -35
  261. package/src/executors/bounded-exec/hang-diagnostics.ts +173 -31
  262. package/src/executors/bounded-exec/lease-wait.ts +116 -0
  263. package/src/executors/bounded-exec/lock-wait.ts +141 -0
  264. package/src/executors/bounded-exec/mbx-pool.ts +48 -0
  265. package/src/executors/bounded-exec/owned-subtree.ts +235 -0
  266. package/src/executors/bounded-exec/progress.ts +9 -3
  267. package/src/executors/bounded-exec/ram-attach.ts +238 -0
  268. package/src/executors/bounded-exec/ram-detach.ts +226 -0
  269. package/src/executors/bounded-exec/ram-temp-fixtures.ts +358 -0
  270. package/src/executors/bounded-exec/ram-temp-registry.txt +440 -0
  271. package/src/executors/bounded-exec/ram-temp.ts +1497 -460
  272. package/src/executors/bounded-exec/run-cpu-pool.ts +129 -35
  273. package/src/executors/bounded-exec/runner-hook.ts +14 -6
  274. package/src/executors/bounded-exec/runner-lifecycle.ts +31 -8
  275. package/src/executors/bounded-exec/{cpu-tokens.ts → runner-sizing.ts} +13 -59
  276. package/src/executors/bounded-exec/runtime-pin.ts +232 -0
  277. package/src/executors/bounded-exec/schema.json +11 -2
  278. package/src/executors/bounded-exec/schema.ts +19 -1
  279. package/src/executors/bounded-exec/verdict.ts +145 -35
  280. package/src/executors/cargo-zigbuild/executor.ts +82 -8
  281. package/src/executors/clean-outputs/executor.ts +1 -0
  282. package/src/executors/scriptc-native/executor.ts +394 -0
  283. package/src/executors/scriptc-native/ffi-paths.ts +29 -0
  284. package/src/executors/scriptc-native/schema.json +60 -0
  285. package/src/executors/scriptc-native/schema.ts +34 -0
  286. package/src/executors/typescript-emit/emit-overrides.ts +24 -0
  287. package/src/executors/typescript-emit/executor.ts +186 -38
  288. package/src/forbidden-spelling-policy.ts +226 -0
  289. package/src/generators/create-package/generator.ts +7 -7
  290. package/src/graph-input-contract.ts +61 -2
  291. package/src/index.ts +788 -224
  292. package/src/managed-assets.ts +3 -0
  293. package/src/managed-files/files.ts +28 -3
  294. package/src/managed-files/managed-format.ts +1 -0
  295. package/src/managed-files/publish-workflow.ts +20 -15
  296. package/src/nextest-code-bound.ts +1 -0
  297. package/src/nextest-timings.ts +106 -0
  298. package/src/owned-installation.ts +150 -23
  299. package/src/package-target-policy.ts +2 -3
  300. package/src/process-children.darwin.ts +14 -0
  301. package/src/process-children.linux.ts +33 -0
  302. package/src/process-children.ts +22 -0
  303. package/src/process-group.ts +209 -0
  304. package/src/process-listing.ts +54 -0
  305. package/src/producer-receipts.ts +92 -41
  306. package/src/task-graph-policy.ts +98 -0
  307. package/src/test-walk-policy.ts +23 -8
  308. package/src/testing.ts +240 -232
  309. package/src/tool-bins.ts +108 -0
  310. package/src/typecheck-test-policy.ts +2 -3
  311. package/src/wait-why-policy.ts +226 -0
  312. package/src/workspace-config-policy.ts +63 -15
  313. package/src/workspace-manifest.ts +89 -6
  314. package/test-timings.json +124 -99
  315. package/dist/bin/smoo-nx-failures.d.ts +0 -3
  316. package/dist/bin/smoo-nx-failures.d.ts.map +0 -1
  317. package/dist/bin/smoo-nx-failures.js +0 -3
  318. package/dist/bin/smoo-nx-nextest-extract.d.ts +0 -3
  319. package/dist/bin/smoo-nx-nextest-extract.d.ts.map +0 -1
  320. package/dist/bin/smoo-nx-nextest-extract.js +0 -42
  321. package/dist/executors/bounded-exec/cpu-tokens.d.ts.map +0 -1
  322. package/dist/failure-summary.d.ts +0 -5
  323. package/dist/failure-summary.d.ts.map +0 -1
  324. package/dist/failure-summary.js +0 -118
  325. package/dist/nextest-extraction.d.ts +0 -117
  326. package/dist/nextest-extraction.d.ts.map +0 -1
  327. package/dist/nextest-extraction.js +0 -303
  328. package/managed/raw/patches/ttsc@0.30.4.patch +0 -2255
  329. package/src/__tests__/cargo-closure-filesets.ts +0 -94
  330. package/src/__tests__/cargo-closure-fixture.ts +0 -113
  331. package/src/__tests__/counted-cargo-process.ts +0 -286
  332. package/src/__tests__/counted-cargo.ts +0 -713
  333. package/src/__tests__/directory-change.ts +0 -27
  334. package/src/__tests__/fixture-cargo-home.ts +0 -36
  335. package/src/__tests__/fixture-nx-env.ts +0 -193
  336. package/src/__tests__/owned-installation.ts +0 -13
  337. package/src/__tests__/past-tick.ts +0 -12
  338. package/src/__tests__/progress-clock.ts +0 -43
  339. package/src/__tests__/runtime-input.ts +0 -23
  340. package/src/bin/smoo-nx-bound-failures.test.ts +0 -127
  341. package/src/bin/smoo-nx-failures.ts +0 -4
  342. package/src/bin/smoo-nx-nextest-extract.ts +0 -44
  343. package/src/bounded-test-policy.test.ts +0 -1029
  344. package/src/build-state-output-policy.test.ts +0 -115
  345. package/src/bun-bootstrap.test.ts +0 -102
  346. package/src/bun-file-packages.test.ts +0 -47
  347. package/src/cargo-closure-filesets.test.ts +0 -63
  348. package/src/cargo-closure-input.property.test.ts +0 -50
  349. package/src/cargo-closure-input.test.ts +0 -506
  350. package/src/cargo-closure-key.test.ts +0 -240
  351. package/src/cargo-resolve-cache.test.ts +0 -1181
  352. package/src/cargo-source-hash.test.ts +0 -707
  353. package/src/cargo-workspace.test.ts +0 -615
  354. package/src/cross-check-policy.test.ts +0 -316
  355. package/src/disk-command-policy.test.ts +0 -61
  356. package/src/ensure-built-receipt.test.ts +0 -279
  357. package/src/ensure-built-witness.test.ts +0 -688
  358. package/src/ensure-built.test.ts +0 -1462
  359. package/src/executors/all-verdicts/executor.test.ts +0 -135
  360. package/src/executors/bounded-exec/cargo-progress-host.test.ts +0 -332
  361. package/src/executors/bounded-exec/cpu-pool.test.ts +0 -684
  362. package/src/executors/bounded-exec/cpu-tokens.test.ts +0 -519
  363. package/src/executors/bounded-exec/disk-lease.test.ts +0 -219
  364. package/src/executors/bounded-exec/executor-host.test.ts +0 -800
  365. package/src/executors/bounded-exec/executor.test.ts +0 -1819
  366. package/src/executors/bounded-exec/go-progress-host.test.ts +0 -171
  367. package/src/executors/bounded-exec/hang-diagnostics.test.ts +0 -291
  368. package/src/executors/bounded-exec/progress.test.ts +0 -139
  369. package/src/executors/bounded-exec/ram-temp-held.test.ts +0 -264
  370. package/src/executors/bounded-exec/ram-temp-host.test.ts +0 -635
  371. package/src/executors/bounded-exec/ram-temp.test.ts +0 -750
  372. package/src/executors/bounded-exec/run-cpu-pool.test.ts +0 -79
  373. package/src/executors/bounded-exec/runner-hook.test.ts +0 -193
  374. package/src/executors/bounded-exec/runner-lifecycle.test.ts +0 -82
  375. package/src/executors/bounded-exec/verdict.test.ts +0 -545
  376. package/src/executors/cargo-zigbuild/executor.test.ts +0 -129
  377. package/src/executors/clean-outputs/executor.test.ts +0 -20
  378. package/src/executors/typescript-emit/executor.test.ts +0 -83
  379. package/src/failure-summary.ts +0 -119
  380. package/src/generators/bounded-test-targets/generator.test.ts +0 -138
  381. package/src/generators/bun-test-tracing/generator.test.ts +0 -250
  382. package/src/generators/create-package/generator.test.ts +0 -190
  383. package/src/generators/make-public/generator.test.ts +0 -137
  384. package/src/graph-input-contract.test.ts +0 -379
  385. package/src/host-controller-wiring.test.ts +0 -31
  386. package/src/index.test.ts +0 -3321
  387. package/src/linked-snapshots.nx.test.ts +0 -254
  388. package/src/managed-files/forgejo-artifact.test.ts +0 -395
  389. package/src/managed-files/generator.test.ts +0 -243
  390. package/src/managed-files/github-host-cache-isolation.test.ts +0 -86
  391. package/src/managed-files/json-edit.test.ts +0 -216
  392. package/src/managed-files/managed-content.test.ts +0 -166
  393. package/src/managed-files/managed-format-json.test.ts +0 -308
  394. package/src/managed-files/repo-path.test.ts +0 -172
  395. package/src/managed-files/setup-devenv-free-disk.test.ts +0 -95
  396. package/src/managed-files/trace-db-artifact.test.ts +0 -7
  397. package/src/managed-files/tree-permissions.test.ts +0 -109
  398. package/src/managed-files/tree.test.ts +0 -123
  399. package/src/manifest-hash.test.ts +0 -219
  400. package/src/nextest-code-bound.test.ts +0 -161
  401. package/src/nextest-extraction.test.ts +0 -216
  402. package/src/nextest-extraction.ts +0 -371
  403. package/src/nextest-partitions.test.ts +0 -501
  404. package/src/nx-cache-bound.test.ts +0 -109
  405. package/src/nx-cache-restore-mtime.test.ts +0 -170
  406. package/src/nx-daemon-claim.test.ts +0 -279
  407. package/src/nx-daemon-idle-cpu.test.ts +0 -80
  408. package/src/nx-daemon-idle-policy.test.ts +0 -111
  409. package/src/nx-daemon-ignore-files.test.ts +0 -210
  410. package/src/nx-daemon-root-normalization.test.ts +0 -105
  411. package/src/nx-daemon-start-never.test.ts +0 -292
  412. package/src/nx-daemon-validity.test.ts +0 -1055
  413. package/src/nx-dot-input-policy.test.ts +0 -353
  414. package/src/nx-failure-life-cycles.test.ts +0 -207
  415. package/src/nx-files-archive-racy.test.ts +0 -97
  416. package/src/nx-foreign-workspace-env.test.ts +0 -329
  417. package/src/nx-incomplete-run-summary.test.ts +0 -70
  418. package/src/nx-plugin-load-errors.test.ts +0 -120
  419. package/src/nx-project-graph-errors.test.ts +0 -70
  420. package/src/nx-project-resolution-cache.test.ts +0 -176
  421. package/src/nx-raw-inputs.test.ts +0 -166
  422. package/src/nx-resident-graph-workers.test.ts +0 -112
  423. package/src/nx-run-information.test.ts +0 -118
  424. package/src/nx-skipped-task-exit.test.ts +0 -180
  425. package/src/nx-state-location.test.ts +0 -63
  426. package/src/nx-store-resolution.test.ts +0 -81
  427. package/src/nx-task-graph-cycles.test.ts +0 -148
  428. package/src/nx-task-output-lease.test.ts +0 -550
  429. package/src/nx-use-local.test.ts +0 -105
  430. package/src/owned-installation.test.ts +0 -105
  431. package/src/package-target-policy.test.ts +0 -1014
  432. package/src/producer-receipts.test.ts +0 -285
  433. package/src/release-config-policy.test.ts +0 -311
  434. package/src/runtime-input.test.ts +0 -393
  435. package/src/serial-group-wiring.test.ts +0 -326
  436. package/src/task-history-namespace.test.ts +0 -181
  437. package/src/task-results.test.ts +0 -228
  438. package/src/test-clock-policy.test.ts +0 -338
  439. package/src/test-program.test.ts +0 -303
  440. package/src/test-timings.test.ts +0 -240
  441. package/src/test-walk-policy.test.ts +0 -620
  442. package/src/testing.test.ts +0 -509
  443. package/src/typecheck-test-policy.test.ts +0 -1468
  444. package/src/typescript-resolution.test.ts +0 -76
  445. package/src/version-actions.test.ts +0 -80
  446. package/src/workspace-config-policy.test.ts +0 -737
@@ -0,0 +1,72 @@
1
+ import { readFile, realpath } from 'node:fs/promises';
2
+ import { dirname, join, posix, relative } from 'node:path';
3
+ /** The workspace root's link to this plugin, which every workspace that uses it has. */
4
+ const PLUGIN_LINK = 'node_modules/@smoothbricks/nx-plugin';
5
+ /**
6
+ * The command that runs a tool package's executable `file` (a path inside the package) from the directory `cwd`
7
+ * (relative to the workspace root) an inferred target runs in.
8
+ *
9
+ * A tool package is a dependency of this plugin, never of the workspace root, so the root `node_modules` has no link to
10
+ * it. Its executable is named through the plugin's root link, as the plugin's own `nextest.toml` is and for the same
11
+ * reason (never the plugin's real location, whose depth from each workspace differs), and then one step up to the
12
+ * package beside the plugin: every install layout puts a package's dependencies next to it, the workspace's `packages/`
13
+ * directory for a linked checkout, a hoisted `node_modules/@smoothbricks/`, a bun or pnpm store's per-package
14
+ * `node_modules`. The kernel resolves that `..` from where the link really points, so the executable runs from the
15
+ * path as written, which is why it is concatenated rather than joined: a lexical join would drop the link before the
16
+ * `..`.
17
+ */
18
+ function toolCommand(cwd, tool, file) {
19
+ return `${posix.join(posix.relative(cwd, '.'), PLUGIN_LINK)}/../${tool}/${file}`;
20
+ }
21
+ /** The tool packages whose executables inferred commands run. */
22
+ const NATIVE_TOOL_PACKAGES = ['build-inputs', 'cargo-retain', 'nextest-extract'];
23
+ /**
24
+ * The tools of the workspace at `workspaceRoot`, whose project manifests are `projectManifests` (workspace-relative):
25
+ * a tool package is a project when the plugin's link resolves beside one of them.
26
+ */
27
+ export async function resolveNativeTools(workspaceRoot, projectManifests, platform, target) {
28
+ const projects = new Map();
29
+ const plugin = await realpath(join(workspaceRoot, PLUGIN_LINK)).catch((error) => {
30
+ // A workspace whose install has not linked the plugin yet has no tool package of its own either.
31
+ if (error instanceof Error && 'code' in error && error.code === 'ENOENT')
32
+ return null;
33
+ throw error;
34
+ });
35
+ if (plugin !== null) {
36
+ const root = await realpath(workspaceRoot);
37
+ for (const tool of NATIVE_TOOL_PACKAGES) {
38
+ const manifest = relative(root, join(dirname(plugin), tool, 'package.json')).replaceAll('\\', '/');
39
+ if (!projectManifests.includes(manifest))
40
+ continue;
41
+ const parsed = JSON.parse(await readFile(join(root, manifest), 'utf8'));
42
+ const name = projectName(parsed);
43
+ if (name === undefined)
44
+ throw new Error(`${manifest}: a tool package names its Nx project in name or nx.name`);
45
+ projects.set(tool, name);
46
+ }
47
+ }
48
+ return { platform, target, projects };
49
+ }
50
+ function projectName(manifest) {
51
+ if (typeof manifest !== 'object' || manifest === null)
52
+ return undefined;
53
+ const nx = 'nx' in manifest && typeof manifest.nx === 'object' && manifest.nx !== null ? manifest.nx : undefined;
54
+ const nxName = nx !== undefined && 'name' in nx && typeof nx.name === 'string' ? nx.name : undefined;
55
+ const name = 'name' in manifest && typeof manifest.name === 'string' ? manifest.name : undefined;
56
+ return nxName ?? name;
57
+ }
58
+ /**
59
+ * The command running `tool`'s executable `bin` from `cwd`. `tools` is null on a host no scriptc platform covers,
60
+ * where no tool package carries an executable to run.
61
+ */
62
+ export function nativeToolCommand(tools, cwd, tool, bin) {
63
+ if (tools === null) {
64
+ throw new Error(`@smoothbricks/${tool} ships ${bin} for darwin-arm64, darwin-x64, linux-arm64 and linux-x64 only, and Nx is inferring this workspace for another platform`);
65
+ }
66
+ return toolCommand(cwd, tool, `dist/bin/${tools.platform}/${bin}`);
67
+ }
68
+ /** The task that builds `tool`'s executables for this host, when this workspace builds them. */
69
+ export function nativeToolDependsOn(tools, tool) {
70
+ const project = tools?.projects.get(tool);
71
+ return project === undefined || tools === null ? [] : [{ projects: [project], target: tools.target }];
72
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"typecheck-test-policy.d.ts","sourceRoot":"","sources":["../src/typecheck-test-policy.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,0BAA0B,CAAC;AAKrD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,yBAAyB,CAAC;AAC3D,OAAO,EAIL,KAAK,WAAW,EAGjB,MAAM,mBAAmB,CAAC;AAE3B,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,8BAA8B,CAAC;AAElE,MAAM,MAAM,UAAU,GAAG,KAAK,GAAG,QAAQ,CAAC;AAI1C;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAC5B,cAAc,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GACvC,WAAW,CAAC,UAAU,CAAC,CAqDzB;AAED;;;GAGG;AACH,wBAAgB,wBAAwB,CACtC,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EAC5C,WAAW,EAAE,MAAM,GAClB,aAAa,EAAE,CAgDjB;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,eA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,EAAE,IAAI,GAAG,WAAW,EAAE,CAiElE;AAiED;;;;;;;GAOG;AACH,wBAAgB,wBAAwB,CAAC,IAAI,EAAE,MAAM,GAAG,aAAa,EAAE,CAuEtE"}
@@ -7,6 +7,7 @@ import { editJsonText } from './managed-files/json-edit.js';
7
7
  import { formatJsonWithBiome, jsonFileText } from './managed-files/managed-format.js';
8
8
  import { includeGlobsFor, listTypeScriptSources, testProgramFault, } from './test-program.js';
9
9
  import { isRecord } from './type-guards.js';
10
+ import { workspacePackagePatterns } from './workspace-manifest.js';
10
11
  const workspaceDependencyFields = ['dependencies', 'devDependencies', 'peerDependencies', 'optionalDependencies'];
11
12
  /**
12
13
  * Detect test runners from a package.json object and optional project targets
@@ -541,9 +542,7 @@ function listWorkspacePackageJsonPaths(root) {
541
542
  if (!rootPackage) {
542
543
  return [];
543
544
  }
544
- const workspacePatterns = Array.isArray(rootPackage.workspaces)
545
- ? rootPackage.workspaces.filter((entry) => typeof entry === 'string')
546
- : [];
545
+ const workspacePatterns = workspacePackagePatterns(rootPackage.workspaces) ?? [];
547
546
  const paths = [];
548
547
  for (const pattern of workspacePatterns) {
549
548
  if (!pattern.includes('*')) {
@@ -653,8 +652,8 @@ function readJsonObject(path) {
653
652
  /** TypeScript 5 accepts ordered base-config arrays as well as a single base. */
654
653
  function tsconfigExtends(config) {
655
654
  return (() => {
656
- const __is = input => null !== input && (undefined === input || "string" === typeof input || Array.isArray(input) && input.every(elem => "string" === typeof elem));
657
655
  let _errorFactory;
656
+ const __is = input => null !== input && (undefined === input || "string" === typeof input || Array.isArray(input) && input.every(elem => "string" === typeof elem));
658
657
  return (input, errorFactory) => {
659
658
  if (false === __is(input)) {
660
659
  _errorFactory = errorFactory;
@@ -0,0 +1,28 @@
1
+ /**
2
+ * WAIT-WHY (specs/cowshed/05_gateway.md, "Deadlines", Enforcement). Clippy refuses each cross-process wait a crate's
3
+ * `clippy.toml` disallows; a site kept unbounded is suppressed for its one item or statement, and this check refuses
4
+ * the suppression unless an adjacent `// WHY unbounded:` says what ends the wait. A reason that records `debt:` names
5
+ * a stall the site leaves, not an end, and is refused: the site is bounded instead.
6
+ */
7
+ export declare const WAIT_WHY = "WAIT-WHY";
8
+ /** The waits every enrolled `clippy.toml` disallows, each named in its entry's `path`. */
9
+ export declare const WAIT_METHODS: readonly ['std::process::Child::wait', 'std::process::Child::wait_with_output', 'tokio::process::Child::wait', 'tokio::process::Child::wait_with_output', 'tokio::process::Child::kill', 'cowshed_os::fork_lock::Run::output_locked', 'cowshed_os::fork_lock::Run::status_locked', 'cowshed_os::fork_lock::RunAsync::output_locked', 'cowshed_os::fork_lock::RunAsync::status_locked', 'std::process::Command::output', 'std::process::Command::status', 'tokio::process::Command::output', 'tokio::process::Command::status', 'std::os::unix::net::UnixStream::connect', 'tokio::net::UnixStream::connect', 'libc::flock', 'std::fs::File::lock', 'std::fs::File::lock_shared', 'libc::waitpid', 'libc::waitid', 'libc::wait4'];
10
+ export interface WaitWhyFinding {
11
+ readonly path: string;
12
+ readonly line: number;
13
+ readonly message: string;
14
+ }
15
+ /**
16
+ * The 1-based lines of each suppression of `clippy::disallowed_methods` in `source` that covers a call named like a
17
+ * disallowed wait and has no `// WHY unbounded: <reason>` beside it, or whose reason records `debt:`. Beside it
18
+ * means: in the comment and attribute lines directly above the attribute, on the attribute's own lines, or on the
19
+ * first line of what it covers.
20
+ */
21
+ export declare function unexplainedWaitAllows(source: string): number[];
22
+ /**
23
+ * WAIT-WHY over every crate directly under `crates` that has a `clippy.toml`: that file disallows every wait in
24
+ * {@link WAIT_METHODS}, and every suppression in the crate covering one says why it is kept.
25
+ */
26
+ export declare function checkWaitWhy(crates: string): WaitWhyFinding[];
27
+ export declare function formatWaitWhy(finding: WaitWhyFinding): string;
28
+ //# sourceMappingURL=wait-why-policy.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"wait-why-policy.d.ts","sourceRoot":"","sources":["../src/wait-why-policy.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,eAAO,MAAM,QAAQ,aAAa,CAAC;AAEnC,0FAA0F;AAC1F,eAAO,MAAM,YAAY,YACvB,2BAA2B,EAC3B,uCAAuC,EACvC,6BAA6B,EAC7B,yCAAyC,EACzC,6BAA6B,EAC7B,2CAA2C,EAC3C,2CAA2C,EAC3C,gDAAgD,EAChD,gDAAgD,EAChD,+BAA+B,EAC/B,+BAA+B,EAC/B,iCAAiC,EACjC,iCAAiC,EACjC,yCAAyC,EACzC,iCAAiC,EACjC,aAAa,EACb,qBAAqB,EACrB,4BAA4B,EAC5B,eAAe,EACf,cAAc,EACd,aAAa,CACL,CAAC;AAaX,MAAM,WAAW,cAAc;IAC7B,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAC;CAC1B;AAmED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,EAAE,CAqC9D;AAUD;;;GAGG;AACH,wBAAgB,YAAY,CAAC,MAAM,EAAE,MAAM,GAAG,cAAc,EAAE,CA8B7D;AAED,wBAAgB,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,CAE7D"}
@@ -0,0 +1,223 @@
1
+ import { existsSync, readdirSync, readFileSync } from 'node:fs';
2
+ import { join, relative, resolve } from 'node:path';
3
+ import { fileURLToPath } from 'node:url';
4
+ import { rustTokens } from './rust-tokens.js';
5
+ /**
6
+ * WAIT-WHY (specs/cowshed/05_gateway.md, "Deadlines", Enforcement). Clippy refuses each cross-process wait a crate's
7
+ * `clippy.toml` disallows; a site kept unbounded is suppressed for its one item or statement, and this check refuses
8
+ * the suppression unless an adjacent `// WHY unbounded:` says what ends the wait. A reason that records `debt:` names
9
+ * a stall the site leaves, not an end, and is refused: the site is bounded instead.
10
+ */
11
+ export const WAIT_WHY = 'WAIT-WHY';
12
+ /** The waits every enrolled `clippy.toml` disallows, each named in its entry's `path`. */
13
+ export const WAIT_METHODS = [
14
+ 'std::process::Child::wait',
15
+ 'std::process::Child::wait_with_output',
16
+ 'tokio::process::Child::wait',
17
+ 'tokio::process::Child::wait_with_output',
18
+ 'tokio::process::Child::kill',
19
+ 'cowshed_os::fork_lock::Run::output_locked',
20
+ 'cowshed_os::fork_lock::Run::status_locked',
21
+ 'cowshed_os::fork_lock::RunAsync::output_locked',
22
+ 'cowshed_os::fork_lock::RunAsync::status_locked',
23
+ 'std::process::Command::output',
24
+ 'std::process::Command::status',
25
+ 'tokio::process::Command::output',
26
+ 'tokio::process::Command::status',
27
+ 'std::os::unix::net::UnixStream::connect',
28
+ 'tokio::net::UnixStream::connect',
29
+ 'libc::flock',
30
+ 'std::fs::File::lock',
31
+ 'std::fs::File::lock_shared',
32
+ 'libc::waitpid',
33
+ 'libc::waitid',
34
+ 'libc::wait4',
35
+ ];
36
+ /** A suppression covers a wait when a call it covers names one of these. */
37
+ const WAIT_NAMES = new Set(WAIT_METHODS.map((path) => path.slice(path.lastIndexOf('::') + 2)));
38
+ /** The reason, with text after it: an empty `// WHY unbounded:` explains nothing. */
39
+ const WHY = /\/\/\s*WHY unbounded:\s*\S/u;
40
+ /** A reason that records debt: a waiver naming the stall it leaves, never what ends the wait. */
41
+ const DEBT = /\bdebt:/u;
42
+ const OPENERS = new Set(['(', '[', '{']);
43
+ const CLOSERS = new Set([')', ']', '}']);
44
+ /** The index of the closer matching the opener at `open`, or the last token when the source ends first. */
45
+ function closing(tokens, open) {
46
+ let depth = 0;
47
+ for (let index = open; index < tokens.length; index += 1) {
48
+ const text = tokens[index]?.text ?? '';
49
+ if (OPENERS.has(text))
50
+ depth += 1;
51
+ else if (CLOSERS.has(text)) {
52
+ depth -= 1;
53
+ if (depth === 0)
54
+ return index;
55
+ }
56
+ }
57
+ return tokens.length - 1;
58
+ }
59
+ /** `[start, end)` of the item or statement an outer attribute ending before `start` applies to. */
60
+ function following(tokens, start) {
61
+ let first = start;
62
+ // Further attributes on the same item.
63
+ while (tokens[first]?.text === '#' && tokens[first + 1]?.text === '[')
64
+ first = closing(tokens, first + 1) + 1;
65
+ let depth = 0;
66
+ for (let index = first; index < tokens.length; index += 1) {
67
+ const text = tokens[index]?.text ?? '';
68
+ if (OPENERS.has(text))
69
+ depth += 1;
70
+ else if (CLOSERS.has(text)) {
71
+ // The enclosing block closes: the attribute was on its last expression.
72
+ if (depth === 0)
73
+ return [first, index];
74
+ depth -= 1;
75
+ if (depth === 0 && text === '}') {
76
+ const next = tokens[index + 1]?.text;
77
+ if (next === ';' || next === ',')
78
+ return [first, index + 2];
79
+ if (next !== '.' && next !== '?' && next !== 'else')
80
+ return [first, index + 1];
81
+ }
82
+ }
83
+ else if (depth === 0 && (text === ';' || text === ','))
84
+ return [first, index + 1];
85
+ }
86
+ return [first, tokens.length];
87
+ }
88
+ /** `[start, end)` of the scope an inner attribute ending before `start` applies to: the rest of its block. */
89
+ function enclosing(tokens, start) {
90
+ let depth = 0;
91
+ for (let index = start; index < tokens.length; index += 1) {
92
+ const text = tokens[index]?.text ?? '';
93
+ if (OPENERS.has(text))
94
+ depth += 1;
95
+ else if (CLOSERS.has(text)) {
96
+ if (depth === 0)
97
+ return [start, index];
98
+ depth -= 1;
99
+ }
100
+ }
101
+ return [start, tokens.length];
102
+ }
103
+ /** `allow(…)`/`expect(…)` naming `clippy::disallowed_methods`, also inside `cfg_attr`. */
104
+ function suppressesDisallowedMethods(attribute) {
105
+ const suppresses = attribute.some((token) => token.text === 'allow' || token.text === 'expect');
106
+ return (suppresses &&
107
+ attribute.some((token, index) => token.text === 'disallowed_methods' &&
108
+ attribute[index - 1]?.text === '::' &&
109
+ attribute[index - 2]?.text === 'clippy'));
110
+ }
111
+ /**
112
+ * The 1-based lines of each suppression of `clippy::disallowed_methods` in `source` that covers a call named like a
113
+ * disallowed wait and has no `// WHY unbounded: <reason>` beside it, or whose reason records `debt:`. Beside it
114
+ * means: in the comment and attribute lines directly above the attribute, on the attribute's own lines, or on the
115
+ * first line of what it covers.
116
+ */
117
+ export function unexplainedWaitAllows(source) {
118
+ const tokens = rustTokens(source);
119
+ const lines = source.split('\n');
120
+ const starts = [0];
121
+ for (let index = source.indexOf('\n'); index !== -1; index = source.indexOf('\n', index + 1))
122
+ starts.push(index + 1);
123
+ const lineOf = (offset) => {
124
+ let low = 0;
125
+ let high = starts.length - 1;
126
+ while (low < high) {
127
+ const middle = (low + high + 1) >> 1;
128
+ if ((starts[middle] ?? 0) <= offset)
129
+ low = middle;
130
+ else
131
+ high = middle - 1;
132
+ }
133
+ return low + 1;
134
+ };
135
+ const found = [];
136
+ for (let index = 0; index < tokens.length; index += 1) {
137
+ if (tokens[index]?.text !== '#')
138
+ continue;
139
+ const inner = tokens[index + 1]?.text === '!';
140
+ const open = index + (inner ? 2 : 1);
141
+ if (tokens[open]?.text !== '[')
142
+ continue;
143
+ const close = closing(tokens, open);
144
+ if (!suppressesDisallowedMethods(tokens.slice(open + 1, close)))
145
+ continue;
146
+ const [first, end] = inner ? enclosing(tokens, close + 1) : following(tokens, close + 1);
147
+ const covered = tokens.slice(first, end);
148
+ const calls = covered.some((token, at) => token.kind === 'ident' && WAIT_NAMES.has(token.text) && covered[at + 1]?.text === '(');
149
+ if (!calls)
150
+ continue;
151
+ const attributeLine = lineOf(tokens[index]?.offset ?? 0);
152
+ const coveredLine = covered[0] === undefined ? attributeLine : lineOf(covered[0].offset);
153
+ let above = attributeLine - 1;
154
+ while (above >= 1 && /^\s*(?:\/\/|#!?\[)/u.test(lines[above - 1] ?? ''))
155
+ above -= 1;
156
+ const beside = lines.slice(above, coveredLine);
157
+ if (!beside.some((line) => WHY.test(line)) || beside.some((line) => DEBT.test(line)))
158
+ found.push(attributeLine);
159
+ }
160
+ return found;
161
+ }
162
+ function rustFiles(directory) {
163
+ return readdirSync(directory, { withFileTypes: true }).flatMap((entry) => {
164
+ const path = join(directory, entry.name);
165
+ if (entry.isDirectory())
166
+ return entry.name === 'target' ? [] : rustFiles(path);
167
+ return entry.name.endsWith('.rs') ? [path] : [];
168
+ });
169
+ }
170
+ /**
171
+ * WAIT-WHY over every crate directly under `crates` that has a `clippy.toml`: that file disallows every wait in
172
+ * {@link WAIT_METHODS}, and every suppression in the crate covering one says why it is kept.
173
+ */
174
+ export function checkWaitWhy(crates) {
175
+ const findings = [];
176
+ for (const crate of readdirSync(crates, { withFileTypes: true })) {
177
+ const root = join(crates, crate.name);
178
+ const config = join(root, 'clippy.toml');
179
+ if (!crate.isDirectory() || !existsSync(config))
180
+ continue;
181
+ const toml = readFileSync(config, 'utf8');
182
+ for (const method of WAIT_METHODS) {
183
+ if (!toml.includes(`path = "${method}"`)) {
184
+ findings.push({
185
+ path: relative(crates, config),
186
+ line: 1,
187
+ message: `disallowed-methods lacks \`${method}\`; every crate with a clippy.toml disallows each wait`,
188
+ });
189
+ }
190
+ }
191
+ for (const file of rustFiles(root)) {
192
+ for (const line of unexplainedWaitAllows(readFileSync(file, 'utf8'))) {
193
+ findings.push({
194
+ path: relative(crates, file),
195
+ line,
196
+ message: 'allow(clippy::disallowed_methods) covers a cross-process wait without an adjacent ' +
197
+ '`// WHY unbounded: <what ends the wait>`, or with one that records debt: instead of an end; bound it ' +
198
+ 'with cowshed_os::deadline or say what ends it',
199
+ });
200
+ }
201
+ }
202
+ }
203
+ return findings;
204
+ }
205
+ export function formatWaitWhy(finding) {
206
+ return `${finding.path}:${finding.line}: error[${WAIT_WHY}] ${finding.message}`;
207
+ }
208
+ if (process.argv[1] && resolve(process.argv[1]) === fileURLToPath(import.meta.url)) {
209
+ const crates = process.argv.slice(2);
210
+ if (crates.length === 0) {
211
+ process.stderr.write('usage: wait-why-policy.ts <crates-directory>...\n');
212
+ process.exit(2);
213
+ }
214
+ for (const directory of crates) {
215
+ const findings = checkWaitWhy(directory);
216
+ for (const finding of findings)
217
+ process.stderr.write(`${directory}/${formatWaitWhy(finding)}\n`);
218
+ if (findings.length > 0)
219
+ process.exitCode = 1;
220
+ else
221
+ process.stdout.write(`${WAIT_WHY} passed: every kept wait under ${directory} says what ends it\n`);
222
+ }
223
+ }
@@ -16,15 +16,21 @@ export { LINUX_PLATFORM_TARGET_GLOBS, MACOS_PLATFORM_TARGET_GLOBS, PLATFORM_TARG
16
16
  */
17
17
  export declare function isBuildOutputTargetName(name: string): boolean;
18
18
  /**
19
- * A target whose job is to RUN tests. `test`, anything under `test-`/`test:`,
20
- * and the plugin's own `cargo-test-<crate>` namespace. Deliberately name-based:
21
- * the aggregate is assembled from declared AND inferred target names, and a
22
- * declaration carries no marker saying "this executes rather than emits".
19
+ * The runners under the `test` namespace: `test`, anything under `test-`/`test:`, and the plugin's own
20
+ * `cargo-test-<crate>` namespace. Inference gives a declared one `test`'s build prerequisites, which a suite named for
21
+ * what it tests (`launcher-test`) never gets: it states its own producers.
22
+ */
23
+ export declare function isTestNamespaceTargetName(name: string): boolean;
24
+ /**
25
+ * A target whose job is to RUN tests or to compile the binaries they run: the `test` namespace above, any
26
+ * `<suite>-test` (the `cargo-test` aggregate, `napi-test`, `launcher-test`) and the cross namespace. Deliberately
27
+ * name-based: the aggregate is assembled from declared AND inferred target names, and a declaration carries no marker
28
+ * saying "this executes rather than emits".
23
29
  *
24
- * A runner collides with the families by construction whenever its name ends in
25
- * one: a crate named `…-js` puts `cargo-test-<crate>` in the family, and a bun
26
- * suite named `test-bun` reads as "tool=test, output=bun". Both would drag a
27
- * test suite into `build`, so the rule is the CLASS, not one namespace.
30
+ * A runner collides with the families by construction whenever its name ends in one: a crate named `…-js` puts
31
+ * `cargo-test-<crate>` in the family, a triple ending `-android` does the same to `cargo-cross-test-<triple>`, and a
32
+ * bun suite named `test-bun` reads as "tool=test, output=bun". All would drag a test suite into `build`, so the rule
33
+ * is the CLASS, not one namespace.
28
34
  */
29
35
  export declare function isTestRunnerTargetName(name: string): boolean;
30
36
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"workspace-config-policy.d.ts","sourceRoot":"","sources":["../src/workspace-config-policy.ts"],"names":[],"mappings":"AA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M,GAAG,aAAa,EAAE,CAYxE;AAED;;GAEG;AACH,wBAAgB,0BAA0B,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAWhE"}
@@ -5,9 +5,12 @@ import { join } from 'node:path';
5
5
  import { readJson, writeJson } from 'nx/src/devkit-exports.js';
6
6
  import typia from 'typia';
7
7
  import { CARGO_TEST_TARGET } from './cargo-workspace.js';
8
+ import { cargoCrossTestTargetName } from './cross-check-policy.js';
8
9
  import { writeJsonFile } from './managed-files/managed-format.js';
9
10
  export const MANAGED_FILES_SYNC_GENERATOR = '@smoothbricks/nx-plugin:managed-files';
10
11
  const validatePlugins = (() => {
12
+ let errors;
13
+ let _report;
11
14
  const _io0 = input => "string" === typeof input.plugin && true && (undefined === input.include || Array.isArray(input.include) && input.include.every(elem => "string" === typeof elem)) && (undefined === input.exclude || Array.isArray(input.exclude) && input.exclude.every(elem => "string" === typeof elem));
12
15
  const _vo0 = (input, _path, _exceptionable = true) => ["string" === typeof input.plugin || _report(_exceptionable, {
13
16
  path: _path + ".plugin",
@@ -39,8 +42,6 @@ const validatePlugins = (() => {
39
42
  value: input.exclude
40
43
  })].every(flag => flag);
41
44
  const __is = input => Array.isArray(input) && input.every(elem => null !== elem && undefined !== elem && ("string" === typeof elem || "object" === typeof elem && null !== elem && _io0(elem)));
42
- let errors;
43
- let _report;
44
45
  return _createStandardSchema_1._createStandardSchema(input => {
45
46
  if (false === __is(input)) {
46
47
  errors = [];
@@ -111,18 +112,31 @@ export function isBuildOutputTargetName(name) {
111
112
  return buildOutputTargetSuffixes.some((suffix) => name.endsWith(suffix));
112
113
  }
113
114
  /**
114
- * A target whose job is to RUN tests. `test`, anything under `test-`/`test:`,
115
- * and the plugin's own `cargo-test-<crate>` namespace. Deliberately name-based:
116
- * the aggregate is assembled from declared AND inferred target names, and a
117
- * declaration carries no marker saying "this executes rather than emits".
115
+ * The runners under the `test` namespace: `test`, anything under `test-`/`test:`, and the plugin's own
116
+ * `cargo-test-<crate>` namespace. Inference gives a declared one `test`'s build prerequisites, which a suite named for
117
+ * what it tests (`launcher-test`) never gets: it states its own producers.
118
+ */
119
+ export function isTestNamespaceTargetName(name) {
120
+ return (name === 'test' || name.startsWith('test-') || name.startsWith('test:') || name.startsWith(`${CARGO_TEST_TARGET}-`));
121
+ }
122
+ /**
123
+ * The plugin's foreign-triple test namespace, `cargo-cross-test-archive-<triple>` and `cargo-cross-test-<triple>`. It
124
+ * sits beside `cargo-test-<crate>`, not under it, so a triple never reads as a crate.
125
+ */
126
+ const CARGO_CROSS_TEST_NAMESPACE = cargoCrossTestTargetName('');
127
+ /**
128
+ * A target whose job is to RUN tests or to compile the binaries they run: the `test` namespace above, any
129
+ * `<suite>-test` (the `cargo-test` aggregate, `napi-test`, `launcher-test`) and the cross namespace. Deliberately
130
+ * name-based: the aggregate is assembled from declared AND inferred target names, and a declaration carries no marker
131
+ * saying "this executes rather than emits".
118
132
  *
119
- * A runner collides with the families by construction whenever its name ends in
120
- * one: a crate named `…-js` puts `cargo-test-<crate>` in the family, and a bun
121
- * suite named `test-bun` reads as "tool=test, output=bun". Both would drag a
122
- * test suite into `build`, so the rule is the CLASS, not one namespace.
133
+ * A runner collides with the families by construction whenever its name ends in one: a crate named `…-js` puts
134
+ * `cargo-test-<crate>` in the family, a triple ending `-android` does the same to `cargo-cross-test-<triple>`, and a
135
+ * bun suite named `test-bun` reads as "tool=test, output=bun". All would drag a test suite into `build`, so the rule
136
+ * is the CLASS, not one namespace.
123
137
  */
124
138
  export function isTestRunnerTargetName(name) {
125
- return (name === 'test' || name.startsWith('test-') || name.startsWith('test:') || name.startsWith(`${CARGO_TEST_TARGET}-`));
139
+ return isTestNamespaceTargetName(name) || name.endsWith('-test') || name.startsWith(CARGO_CROSS_TEST_NAMESPACE);
126
140
  }
127
141
  const nxJsTypescriptPlugin = '@nx/js/typescript';
128
142
  const smoothBricksNxPlugin = '@smoothbricks/nx-plugin';
@@ -386,11 +400,20 @@ function validateNamedInputDefaults(nxJson, nxJsonPath, issues) {
386
400
  if (!isPreciseProductionNamedInput(production)) {
387
401
  issues.push({
388
402
  path: nxJsonPath,
389
- message: 'namedInputs.production must enumerate precise production inputs. Do not include default or broad {projectRoot}/** globs; use language/tool-specific paths such as {projectRoot}/src/**/*, {projectRoot}/Cargo.toml, or {projectRoot}/pyproject.toml.',
403
+ message: 'namedInputs.production must enumerate precise production inputs. Do not include default or broad {projectRoot}/** globs; use language/tool-specific paths such as {projectRoot}/src/**/*, {projectRoot}/package.json, or {projectRoot}/pyproject.toml.',
390
404
  });
391
405
  }
392
- else if (!production.includes(MARKDOWN_EXCLUSION)) {
393
- issues.push({ path: nxJsonPath, message: markdownExclusionMessage('production') });
406
+ else {
407
+ const rustInputs = production.filter(isRustCrateSourceInput);
408
+ if (rustInputs.length > 0) {
409
+ issues.push({
410
+ path: nxJsonPath,
411
+ message: `namedInputs.production must not name Rust crate sources (${rustInputs.join(', ')}): TypeScript targets see Rust only as the producer target's outputs (dependsOn + dependentTasksOutputFiles); a target that reads crate source as text names it in its own inputs; cargo targets are keyed by cargoClosure.`,
412
+ });
413
+ }
414
+ if (!production.includes(MARKDOWN_EXCLUSION)) {
415
+ issues.push({ path: nxJsonPath, message: markdownExclusionMessage('production') });
416
+ }
394
417
  }
395
418
  }
396
419
  function markdownExclusionMessage(name) {
@@ -479,11 +502,16 @@ function applyNamedInputDefaults(nxJson) {
479
502
  namedInputs.default = defaults.filter((input) => input !== 'sharedGlobals');
480
503
  changed = true;
481
504
  }
482
- const production = namedInputs.production;
483
- if (!Array.isArray(production) || !isPreciseProductionNamedInput(production)) {
505
+ const production = Array.isArray(namedInputs.production) ? namedInputs.production : [];
506
+ const withoutRust = production.filter((input) => !isRustCrateSourceInput(input));
507
+ if (!isPreciseProductionNamedInput(withoutRust)) {
484
508
  namedInputs.production = defaultProductionNamedInput;
485
509
  changed = true;
486
510
  }
511
+ else if (withoutRust.length < production.length) {
512
+ namedInputs.production = withoutRust;
513
+ changed = true;
514
+ }
487
515
  for (const name of ['default', 'production']) {
488
516
  const inputs = namedInputs[name];
489
517
  if (Array.isArray(inputs) && !inputs.includes(MARKDOWN_EXCLUSION)) {
@@ -523,6 +551,22 @@ function isPreciseProductionNamedInput(production) {
523
551
  }
524
552
  return hasPositiveProjectInput;
525
553
  }
554
+ /**
555
+ * Rust crate source named by a positive `production` entry: a path under `{projectRoot}/crates`, a `.rs` file or a
556
+ * `Cargo.toml`. `production` keys a project's TypeScript tasks and, through `^production`, its dependents'. They see
557
+ * Rust only as the producer target's outputs (`dependsOn` + `dependentTasksOutputFiles`); cargo targets key on
558
+ * `cargoClosure`; a target that reads crate source as text names it in its own inputs. An exclusion names nothing.
559
+ */
560
+ function isRustCrateSourceInput(input) {
561
+ if (typeof input !== 'string' || input.startsWith('!')) {
562
+ return false;
563
+ }
564
+ const name = input.slice(input.lastIndexOf('/') + 1);
565
+ return (input === '{projectRoot}/crates' ||
566
+ input.startsWith('{projectRoot}/crates/') ||
567
+ name.endsWith('.rs') ||
568
+ name === 'Cargo.toml');
569
+ }
526
570
  function nxPluginName(plugin) {
527
571
  return typeof plugin === 'string' ? plugin : plugin.plugin;
528
572
  }
@@ -1,3 +1,4 @@
1
+ import type { ProjectConfiguration, TargetConfiguration } from 'nx/src/config/workspace-json-project-json.js';
1
2
  import type typia from 'typia';
2
3
  /** String-keyed dependency / script / engine maps. */
3
4
  export type StringMap = Record<string, string>;
@@ -160,9 +161,10 @@ export interface PackagePrivateNpmConfig {
160
161
  * shell (tooling/direnv/secret-references.ts). Absent means every workspace
161
162
  * keeps its own local cache and nothing is shared.
162
163
  *
163
- * The pair is emitted whole or not at all, because Nx accepts only 200 or 404
164
- * from a cache server: a server without a working credential fails every task
165
- * with 401 rather than missing quietly.
164
+ * The pair is emitted whole or not at all: the managed Nx patch reads a cache
165
+ * server that cannot answer (unreachable, a 5xx, or silent for 90 s) as a
166
+ * miss, but a server without a working credential fails every task with 401
167
+ * rather than missing quietly.
166
168
  */
167
169
  export interface PackageRemoteCacheConfig {
168
170
  /**
@@ -259,14 +261,23 @@ export interface PackageSmooConfig {
259
261
  */
260
262
  developerLinks?: Record<string, DeveloperLinkDirectory | DeveloperLinkSnapshotDeclaration>;
261
263
  }
262
- export interface PackageWorkspacesObject {
264
+ /**
265
+ * Bun catalogs: one version per dependency for every member that writes `catalog:` (the default catalog,
266
+ * also `catalog:default`) or `catalog:<name>` (a named one) instead of a version.
267
+ */
268
+ export interface PackageCatalogs {
269
+ catalog?: StringMap;
270
+ catalogs?: Record<string, StringMap>;
271
+ }
272
+ /** The object form of `workspaces`: the member patterns, and the catalogs Bun then reads from here. */
273
+ export interface PackageWorkspacesObject extends PackageCatalogs {
263
274
  packages?: string[];
264
275
  }
265
276
  /**
266
277
  * package.json shape used by smoo. Optional fields stay optional so partial
267
278
  * manifests parse; mutation helpers create nested objects on demand.
268
279
  */
269
- export interface PackageJson {
280
+ export interface PackageJson extends PackageCatalogs {
270
281
  name?: string;
271
282
  version?: string;
272
283
  private?: boolean;
@@ -301,6 +312,8 @@ export interface PackageExportMap {
301
312
  export interface NxDependsOnObject {
302
313
  target: string;
303
314
  projects?: string | string[];
315
+ /** The same target of every dependency project, as the `^target` string form says. */
316
+ dependencies?: boolean;
304
317
  }
305
318
  export type NxDependsOn = string | NxDependsOnObject;
306
319
  /** Nx target options are executor-specific open bags. */
@@ -312,7 +325,10 @@ export interface NxTargetConfig {
312
325
  outputs?: string[];
313
326
  inputs?: NxInput[];
314
327
  options?: NxTargetOptions;
315
- configurations?: Record<string, NxTargetConfig>;
328
+ /** Each named configuration's overrides of `options`: executor options, merged over them for a task run under it. */
329
+ configurations?: Record<string, NxTargetOptions>;
330
+ /** The configuration Nx runs a request naming none under; Nx's own target type owns it. */
331
+ defaultConfiguration?: TargetConfiguration['defaultConfiguration'];
316
332
  cache?: boolean;
317
333
  command?: string;
318
334
  }
@@ -320,10 +336,29 @@ export interface NxProjectJson {
320
336
  name?: string;
321
337
  root?: string;
322
338
  tags?: string[];
339
+ namedInputs?: ProjectConfiguration['namedInputs'];
323
340
  targets?: Record<string, NxTargetConfig>;
324
341
  }
325
342
  export interface NxJson {
326
343
  namedInputs?: Record<string, Array<string | Record<string, unknown>> | string>;
327
344
  }
328
345
  export declare function ciPushBranches(github: PackageSmooGithub | undefined): NonEmptyArray<string>;
346
+ /**
347
+ * The member patterns a root manifest's `workspaces` declares, in either shape Bun reads: the array itself, or the
348
+ * object whose `packages` holds it beside the catalogs. `undefined` when the value is neither.
349
+ */
350
+ export declare function workspacePackagePatterns(workspaces: unknown): string[] | undefined;
351
+ /** The default catalog's name: `catalog:` and `catalog:default` both resolve to it. */
352
+ export declare const DEFAULT_CATALOG = "default";
353
+ /**
354
+ * The catalog a dependency value names: {@link DEFAULT_CATALOG} for `catalog:` and `catalog:default`, the name for
355
+ * `catalog:<name>`, `null` for a value that is no catalog reference.
356
+ */
357
+ export declare function catalogName(value: string): string | null;
358
+ /** The catalog `name` resolves to in a root manifest, or `undefined` when the root defines none by that name. */
359
+ export declare function rootCatalog(root: PackageJson, name: string): StringMap | undefined;
360
+ /** The catalog `name` resolves to, created empty where Bun reads it when the root defines none by that name. */
361
+ export declare function ensureRootCatalog(root: PackageJson, name: string): StringMap;
362
+ /** JSON path of the catalog `name` resolves to, for messages: `workspaces.catalog`, `catalogs.<name>`, ... */
363
+ export declare function rootCatalogPath(root: PackageJson, name: string): string;
329
364
  //# sourceMappingURL=workspace-manifest.d.ts.map