@smoothbricks/nx-plugin 0.6.2 → 0.7.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 (177) hide show
  1. package/README.md +417 -171
  2. package/dist/.build-inputs.json +39 -28
  3. package/dist/bin/smoo-nx-go-test-build.d.ts +3 -0
  4. package/dist/bin/smoo-nx-go-test-build.d.ts.map +1 -0
  5. package/dist/bin/smoo-nx-go-test-build.js +79 -0
  6. package/dist/bin/smoo-nx-go-test-run.d.ts +3 -0
  7. package/dist/bin/smoo-nx-go-test-run.d.ts.map +1 -0
  8. package/dist/bin/smoo-nx-go-test-run.js +129 -0
  9. package/dist/bin/smoo-nx-publish.d.ts +3 -0
  10. package/dist/bin/smoo-nx-publish.d.ts.map +1 -0
  11. package/dist/bin/smoo-nx-publish.js +3 -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 +9 -8
  15. package/dist/cargo-retention-hook.d.ts +6 -2
  16. package/dist/cargo-retention-hook.d.ts.map +1 -1
  17. package/dist/cargo-retention-hook.js +13 -7
  18. package/dist/cargo-workspace.d.ts +10 -20
  19. package/dist/cargo-workspace.d.ts.map +1 -1
  20. package/dist/cargo-workspace.js +12 -22
  21. package/dist/cross-check-policy.d.ts +2 -2
  22. package/dist/cross-check-policy.js +2 -2
  23. package/dist/deploy-policy.d.ts +6 -0
  24. package/dist/deploy-policy.d.ts.map +1 -1
  25. package/dist/deploy-policy.js +11 -0
  26. package/dist/eslint-file-set.d.ts +4 -1
  27. package/dist/eslint-file-set.d.ts.map +1 -1
  28. package/dist/eslint-sources.d.ts +25 -0
  29. package/dist/eslint-sources.d.ts.map +1 -0
  30. package/dist/eslint-sources.js +99 -0
  31. package/dist/executors/all-verdicts/executor.d.ts +2 -1
  32. package/dist/executors/all-verdicts/executor.d.ts.map +1 -1
  33. package/dist/executors/all-verdicts/executor.js +48 -2
  34. package/dist/executors/all-verdicts/schema.d.ts +13 -0
  35. package/dist/executors/all-verdicts/schema.d.ts.map +1 -1
  36. package/dist/executors/all-verdicts/schema.js +7 -0
  37. package/dist/executors/bounded-exec/bounds.d.ts +57 -8
  38. package/dist/executors/bounded-exec/bounds.d.ts.map +1 -1
  39. package/dist/executors/bounded-exec/bounds.js +100 -11
  40. package/dist/executors/bounded-exec/executor.d.ts +2 -1
  41. package/dist/executors/bounded-exec/executor.d.ts.map +1 -1
  42. package/dist/executors/bounded-exec/executor.js +289 -34
  43. package/dist/executors/bounded-exec/hang-diagnostics.d.ts +2 -0
  44. package/dist/executors/bounded-exec/hang-diagnostics.d.ts.map +1 -1
  45. package/dist/executors/bounded-exec/hang-diagnostics.js +2 -2
  46. package/dist/executors/bounded-exec/mbx-pool.d.ts +56 -10
  47. package/dist/executors/bounded-exec/mbx-pool.d.ts.map +1 -1
  48. package/dist/executors/bounded-exec/mbx-pool.js +145 -11
  49. package/dist/executors/bounded-exec/mbx-queue.d.ts +30 -0
  50. package/dist/executors/bounded-exec/mbx-queue.d.ts.map +1 -0
  51. package/dist/executors/bounded-exec/mbx-queue.js +229 -0
  52. package/dist/executors/bounded-exec/progress.d.ts +9 -2
  53. package/dist/executors/bounded-exec/progress.d.ts.map +1 -1
  54. package/dist/executors/bounded-exec/progress.js +151 -25
  55. package/dist/executors/bounded-exec/runner-sizing.d.ts +40 -2
  56. package/dist/executors/bounded-exec/runner-sizing.d.ts.map +1 -1
  57. package/dist/executors/bounded-exec/runner-sizing.js +55 -4
  58. package/dist/executors/bounded-exec/runtime-pin.js +1 -1
  59. package/dist/executors/bounded-exec/test-result-writer.d.ts +30 -0
  60. package/dist/executors/bounded-exec/test-result-writer.d.ts.map +1 -0
  61. package/dist/executors/bounded-exec/test-result-writer.js +126 -0
  62. package/dist/executors/bounded-exec/test-results.d.ts +33 -0
  63. package/dist/executors/bounded-exec/test-results.d.ts.map +1 -0
  64. package/dist/executors/bounded-exec/test-results.js +33 -0
  65. package/dist/executors/bounded-exec/verdict.d.ts +26 -2
  66. package/dist/executors/bounded-exec/verdict.d.ts.map +1 -1
  67. package/dist/executors/bounded-exec/verdict.js +108 -4
  68. package/dist/executors/wrangler-deploy/deploy-hash.d.ts +10 -0
  69. package/dist/executors/wrangler-deploy/deploy-hash.d.ts.map +1 -0
  70. package/dist/executors/wrangler-deploy/deploy-hash.js +14 -0
  71. package/dist/executors/wrangler-deploy/executor.d.ts +24 -0
  72. package/dist/executors/wrangler-deploy/executor.d.ts.map +1 -0
  73. package/dist/executors/wrangler-deploy/executor.js +43 -0
  74. package/dist/executors/wrangler-deploy/hasher.d.ts +27 -0
  75. package/dist/executors/wrangler-deploy/hasher.d.ts.map +1 -0
  76. package/dist/executors/wrangler-deploy/hasher.js +90 -0
  77. package/dist/executors/wrangler-deploy/schema.d.ts +5 -0
  78. package/dist/executors/wrangler-deploy/schema.d.ts.map +1 -0
  79. package/dist/go-tests.d.ts +30 -0
  80. package/dist/go-tests.d.ts.map +1 -0
  81. package/dist/go-tests.js +43 -0
  82. package/dist/index.d.ts +12 -4
  83. package/dist/index.d.ts.map +1 -1
  84. package/dist/index.js +338 -295
  85. package/dist/managed-files/files.d.ts.map +1 -1
  86. package/dist/managed-files/files.js +5 -0
  87. package/dist/nx-publish.d.ts +24 -0
  88. package/dist/nx-publish.d.ts.map +1 -0
  89. package/dist/nx-publish.js +150 -0
  90. package/dist/process-group.js +2 -2
  91. package/dist/runtime-input-policy.d.ts +17 -3
  92. package/dist/runtime-input-policy.d.ts.map +1 -1
  93. package/dist/runtime-input-policy.js +4 -4
  94. package/dist/test-timings.d.ts +23 -4
  95. package/dist/test-timings.d.ts.map +1 -1
  96. package/dist/test-timings.js +72 -12
  97. package/dist/tool-bins.d.ts +6 -8
  98. package/dist/tool-bins.d.ts.map +1 -1
  99. package/dist/tool-bins.js +7 -5
  100. package/dist/version-actions.cjs +10 -11
  101. package/dist/version-actions.d.cts.map +1 -1
  102. package/dist/workspace-config-policy.d.ts.map +1 -1
  103. package/dist/workspace-config-policy.js +17 -22
  104. package/dist/workspace-index.d.ts +7 -0
  105. package/dist/workspace-index.d.ts.map +1 -1
  106. package/dist/workspace-index.js +11 -0
  107. package/dist/workspace-manifest.js +3 -3
  108. package/executors.json +7 -6
  109. package/managed/raw/patches/nx@23.2.1.patch +118 -24
  110. package/managed/raw/patches/ttsc@0.34.1.patch +139 -0
  111. package/managed/raw/tooling/devenv +1 -2
  112. package/managed/raw/tooling/direnv/developer-links.ts +124 -51
  113. package/managed/raw/tooling/direnv/devenv.smoo.nix +34 -15
  114. package/managed/raw/tooling/direnv/github-actions-bootstrap.sh +20 -10
  115. package/managed/raw/tooling/direnv/installed-bun-links.ts +7 -6
  116. package/managed/raw/tooling/direnv/setup-environment.ts +49 -24
  117. package/managed/raw/tooling/direnv/ttsc-env.sh +8 -6
  118. package/managed/raw/tooling/git-hooks/pinned-revisions-served.ts +252 -0
  119. package/managed/raw/tooling/git-hooks/pre-push.sh +34 -32
  120. package/managed/templates/github/actions/cache-node-modules/action.yml +1 -1
  121. package/managed/templates/github/actions/cache-ttsc-plugins/action.yml +12 -11
  122. package/package.json +277 -11
  123. package/runtime/nx-publish/.build-inputs.json +11 -0
  124. package/runtime/nx-publish/cache_adapter.js +45 -0
  125. package/runtime/nx-publish/nx_publish.js +60 -0
  126. package/runtime-input.sh +62 -26
  127. package/src/bin/smoo-nx-go-test-build.ts +83 -0
  128. package/src/bin/smoo-nx-go-test-run.ts +140 -0
  129. package/src/bin/smoo-nx-publish.ts +4 -0
  130. package/src/bounded-test-policy.ts +9 -8
  131. package/src/cargo-retention-hook.ts +16 -10
  132. package/src/cargo-workspace.ts +12 -24
  133. package/src/cross-check-policy.ts +2 -2
  134. package/src/deploy-policy.ts +11 -0
  135. package/src/eslint-file-set.ts +4 -1
  136. package/src/eslint-sources.ts +134 -0
  137. package/src/executors/all-verdicts/executor.ts +58 -3
  138. package/src/executors/all-verdicts/schema.json +4 -0
  139. package/src/executors/all-verdicts/schema.ts +14 -0
  140. package/src/executors/bounded-exec/bounds.ts +132 -15
  141. package/src/executors/bounded-exec/executor.ts +329 -34
  142. package/src/executors/bounded-exec/hang-diagnostics.ts +3 -2
  143. package/src/executors/bounded-exec/mbx-pool.ts +158 -17
  144. package/src/executors/bounded-exec/mbx-queue.ts +170 -0
  145. package/src/executors/bounded-exec/progress.ts +171 -18
  146. package/src/executors/bounded-exec/runner-sizing.ts +73 -7
  147. package/src/executors/bounded-exec/runtime-pin.ts +1 -1
  148. package/src/executors/bounded-exec/test-result-writer.ts +152 -0
  149. package/src/executors/bounded-exec/test-results.ts +39 -0
  150. package/src/executors/bounded-exec/verdict.ts +115 -5
  151. package/src/executors/wrangler-deploy/deploy-hash.ts +15 -0
  152. package/src/executors/wrangler-deploy/executor.ts +63 -0
  153. package/src/executors/wrangler-deploy/hasher.ts +111 -0
  154. package/src/executors/wrangler-deploy/schema.json +16 -0
  155. package/src/executors/wrangler-deploy/schema.ts +4 -0
  156. package/src/go-tests.ts +67 -0
  157. package/src/index.ts +368 -323
  158. package/src/managed-files/files.ts +5 -0
  159. package/src/nx-publish.ts +157 -0
  160. package/src/process-group.ts +2 -2
  161. package/src/runtime-input-policy.ts +4 -4
  162. package/src/test-timings.ts +72 -14
  163. package/src/tool-bins.ts +13 -9
  164. package/src/version-actions.cts +10 -11
  165. package/src/workspace-config-policy.ts +20 -29
  166. package/src/workspace-index.ts +12 -0
  167. package/src/workspace-manifest.ts +3 -3
  168. package/test-timings.json +131 -125
  169. package/dist/executors/clean-outputs/executor.d.ts +0 -26
  170. package/dist/executors/clean-outputs/executor.d.ts.map +0 -1
  171. package/dist/executors/clean-outputs/executor.js +0 -83
  172. package/dist/executors/clean-outputs/schema.d.ts +0 -4
  173. package/dist/executors/clean-outputs/schema.d.ts.map +0 -1
  174. package/src/executors/clean-outputs/executor.ts +0 -131
  175. package/src/executors/clean-outputs/schema.json +0 -15
  176. package/src/executors/clean-outputs/schema.ts +0 -3
  177. /package/dist/executors/{clean-outputs → wrangler-deploy}/schema.js +0 -0
@@ -6,43 +6,48 @@
6
6
  "packages/nx-plugin/src/bin/smoo-nx-cargo-toolchain.ts": "c24be4ca223cd946de95be5243596267d09baa75e8841892b0299a5478b197d5",
7
7
  "packages/nx-plugin/src/bin/smoo-nx-exec.ts": "42e699cf710b36f72565279f558076b4b08b9fdb4e02a09e851d29bd0d341029",
8
8
  "packages/nx-plugin/src/bin/smoo-nx-forbidden-spellings.ts": "f5e0e7f50a2cb60d34e7d4c95839c6b632e1b28d6b87fddb6ce437d4a5908886",
9
+ "packages/nx-plugin/src/bin/smoo-nx-go-test-build.ts": "effb57c6bd7fad46ca5f01322618b1e8822e6eaf2a49fbae0e573d0a8138f36b",
10
+ "packages/nx-plugin/src/bin/smoo-nx-go-test-run.ts": "cfbb09075bb24c387a9f1305dafab8dd08a6355d7dffd6e43fc6870c43cc5225",
9
11
  "packages/nx-plugin/src/bin/smoo-nx-nextest-timings.ts": "706548efc89848cf90381fab2298d0b14224f0fdacc401115369dae8f0aced19",
12
+ "packages/nx-plugin/src/bin/smoo-nx-publish.ts": "b911f05d5a1a9170f49078804b7f9ae2a63468aa668501df7a3a38cdba91b07c",
10
13
  "packages/nx-plugin/src/bin/smoo-nx-test-clocks.ts": "e523ea4da694ae56c83b8601568df3a8723d9d42e56f08703389b9c8d1e2296d",
11
14
  "packages/nx-plugin/src/bin/smoo-nx-test-walks.ts": "94e8af452331d765e711aa2493efbff4ddb4e6e3088343873f78d9eaa840570b",
12
- "packages/nx-plugin/src/bounded-test-policy.ts": "f337c18bdbe913fcbd7dba8894737f98103214462b92d8e5986313380245bb30",
15
+ "packages/nx-plugin/src/bounded-test-policy.ts": "b52a8858543d25e173aad4f49002a7cdc7f70b098f6046fc56acb747065acd8a",
13
16
  "packages/nx-plugin/src/build-state-output-policy.ts": "031a75cb96a2fed0ab2ce80a98588482595f7550d5259e33edabd6e676ad3a3c",
14
17
  "packages/nx-plugin/src/bun-lock-scope.ts": "f249da592592080ee302cfaa48d607b2acaa6f516f24bafe7f12b9dd49dacaa7",
15
18
  "packages/nx-plugin/src/cargo-build-script-env.ts": "e5b45ccefc2255cd8a48121eb97132a08e136b4cbbc375d04c940d821a429b23",
16
19
  "packages/nx-plugin/src/cargo-closure-input.ts": "6f16430ec0b8949c33337353280372a7258a22d19c79ea3d3dd6bb47acb6fa0d",
17
20
  "packages/nx-plugin/src/cargo-dev-profile.ts": "34764ba4fc2aeebe75051c98c2eb64b6baeaa3d8cc0242803081ef935465368d",
18
- "packages/nx-plugin/src/cargo-retention-hook.ts": "8666d49b18227b9793d90f68bd5162d8071ed6b9f004be781852b1c74d5adbe1",
21
+ "packages/nx-plugin/src/cargo-retention-hook.ts": "5699506a32aff25be4adca91fff443bea2bfcd6fd7b2964dfa38296c50043ba1",
19
22
  "packages/nx-plugin/src/cargo-source-hash.ts": "1d72427cb2c7d9038c9452db958d14cbb5017d633f40590093654b474b71cb8e",
20
23
  "packages/nx-plugin/src/cargo-toolchain-paths.ts": "3f91da4c07394e47205093874b3d46e888c2e53ab735bbea2b64d660c2611469",
21
24
  "packages/nx-plugin/src/cargo-toolchain-policy.ts": "715a743a9922fa1f3be4301bbecee5ed5c1c00c7e9fa6eec0ce9ef9b384fad04",
22
- "packages/nx-plugin/src/cargo-workspace.ts": "27cd61d7ada05366719e34380c9d8e701b982fb3e75799256be94aa6cafb6264",
23
- "packages/nx-plugin/src/cross-check-policy.ts": "fc45eefdcf7ea3975affb4b89d91093b9cbfc3504756103a18353aef3a264db6",
24
- "packages/nx-plugin/src/deploy-policy.ts": "8456e2f896c489e5f4905383a0294d1b7a33c2d95c5ca718458cc40ed8672c5c",
25
+ "packages/nx-plugin/src/cargo-workspace.ts": "ecbe5e0545e07a68ba02d18a2ed362a545e902e947a52af1dab112b71f91f633",
26
+ "packages/nx-plugin/src/cross-check-policy.ts": "37f304954419306803972b0a48bde97b50a7b773883655639994c6d007f2e54d",
27
+ "packages/nx-plugin/src/deploy-policy.ts": "2f6202000dceca84d472f417affce50fd2ec3cab87c969443d83ec6e1d4ccf71",
25
28
  "packages/nx-plugin/src/disk-command-policy.ts": "fb8731ccf41cff47b88f30165b08dc8d551068c436f4e49cb2b62aa4b49be43c",
26
29
  "packages/nx-plugin/src/ensure-built-receipt.ts": "f80084d91d37c5132822bf26b45e6a9ae35e54e366cedbb9d69a2abd663ca419",
27
30
  "packages/nx-plugin/src/ensure-built-witness.ts": "428b3bde289d4f10cdc2b2442a84ebc653f3da8955f9ea596dddf3c759029b1c",
28
31
  "packages/nx-plugin/src/ensure-built.ts": "cced1cdc9090c820320492c6bf40b853dd02e461651484193af89dc29173984f",
29
32
  "packages/nx-plugin/src/eslint-config-closure.ts": "0cd5a9da34df914c2d6033b7d3de49728cd71229065a2e1b43dba923001e0826",
30
- "packages/nx-plugin/src/eslint-file-set.ts": "d5d59b6ef25888e6036036b6a891273490e41b0fa2770640bf465410aca90ac8",
31
- "packages/nx-plugin/src/executors/all-verdicts/executor.ts": "e8abe81c29074b6517a6251cc1c1ee87ba126d6f0959e182a9dd46b5a977ce6d",
32
- "packages/nx-plugin/src/executors/all-verdicts/schema.ts": "9d2372b64ec77ae82b686df68a2843c11268920064909aa871edc538414ef13c",
33
- "packages/nx-plugin/src/executors/bounded-exec/bounds.ts": "bb192e95fe56659e958c200282b9248653ea350e61dcb1eb84065b6e1b746c2b",
33
+ "packages/nx-plugin/src/eslint-file-set.ts": "06d2b6c895c025bfc5269e119830f6fb2c21a6e35dd8e1484ecc8086aa13f753",
34
+ "packages/nx-plugin/src/eslint-sources.ts": "976a2b8e0520b5f6aaf397a272791817a4f385507bc0cbaad4b114fefa8decf5",
35
+ "packages/nx-plugin/src/executors/all-verdicts/executor.ts": "4d3aac65aa2e03a2d24d149c412aa18f2e66a6a36a4e88993122b10e9355c8f0",
36
+ "packages/nx-plugin/src/executors/all-verdicts/schema.ts": "2ca6bd8d2f19d851f291ab6a5227167399b9dc8ed0fda0248b69896d77e471f1",
37
+ "packages/nx-plugin/src/executors/bounded-exec/bounds.ts": "908d7146746d53f9558e7b7de08c498ec4352ecf054c1d2f67bedba9a973139b",
34
38
  "packages/nx-plugin/src/executors/bounded-exec/cpu-pool-thread.ts": "4b914385f7ab73cfb3afdc75c0e3c462e7c103c5061f7f7720d7b95f6655e32d",
35
39
  "packages/nx-plugin/src/executors/bounded-exec/cpu-pool.ts": "a4be1280a0ea4b5aa0f04170ce75ce4b813631264c50fab5cdd05d34926fc890",
36
40
  "packages/nx-plugin/src/executors/bounded-exec/disk-lease.ts": "1a3f6a6fa590d9a2550490bb6906dc91b6c05fbef235b025eaf257eb5310e92d",
37
- "packages/nx-plugin/src/executors/bounded-exec/executor.ts": "0d1284c1f3e9718a2b2ff5d7139b048cae7d9a7fe3db96d01110bf0937a7ecfc",
41
+ "packages/nx-plugin/src/executors/bounded-exec/executor.ts": "5a90bd7410b80909224ae10e866bd7881ff91b8fffbedf01e1b1c845ea0ead56",
38
42
  "packages/nx-plugin/src/executors/bounded-exec/gateway-lease.ts": "f3f73bd92db30e4857f98fb8bd2b9a75b2a5a2a318f094e075ed803c1f9a0117",
39
- "packages/nx-plugin/src/executors/bounded-exec/hang-diagnostics.ts": "56a6997611b23eb5f603672e73b58f212558e5255f69b65332734516ad37fe9d",
43
+ "packages/nx-plugin/src/executors/bounded-exec/hang-diagnostics.ts": "bcaa9e52384f6c481a9cc2835ba6e8ffe167afa3cb51623fdf8dc3493876f335",
40
44
  "packages/nx-plugin/src/executors/bounded-exec/lease-wait.ts": "59d8ac94d0b8b75858971c5bb28ee421fca4f7685577274fe8bbaf0c01ba462a",
41
45
  "packages/nx-plugin/src/executors/bounded-exec/lock-wait.ts": "b14a23b49759a777f4b3338ced003adaf76837c2c38462458f76a7fef1b95d9e",
42
- "packages/nx-plugin/src/executors/bounded-exec/mbx-pool.ts": "ed35855d8c989358e78a8487b47658319d38efd52f4b1b9a3e95d74dee4002b8",
46
+ "packages/nx-plugin/src/executors/bounded-exec/mbx-pool.ts": "1b6bae7975355563c31eb60d3b23480c12c51c24bdd7bce9bccc161838a88037",
47
+ "packages/nx-plugin/src/executors/bounded-exec/mbx-queue.ts": "ac309e28e5ee78fa08d628edb00e33532514f7572166770799ae86d468c12b4e",
43
48
  "packages/nx-plugin/src/executors/bounded-exec/no-space.ts": "ec032968d89f9e853796012705a06c06cfc4da54bf6e6f10a526f98daca3d077",
44
49
  "packages/nx-plugin/src/executors/bounded-exec/owned-subtree.ts": "cb5edf2b5fe2c1b5b961f8c0ff16ec7bfae3c22ad75dfd671b74f1a4a865863f",
45
- "packages/nx-plugin/src/executors/bounded-exec/progress.ts": "353f415cc869fca65a75e5e89bd826292e1421ce1609002e4e47477cbb5ea6b4",
50
+ "packages/nx-plugin/src/executors/bounded-exec/progress.ts": "ed926f7b4991ebf7a7c8876ab0ea00295934d058c774e3f811963a85d209979b",
46
51
  "packages/nx-plugin/src/executors/bounded-exec/ram-attach.ts": "865eb5c277d9ab4b258013030938aeee762b731a7298fa8ad3c5eba3026df77a",
47
52
  "packages/nx-plugin/src/executors/bounded-exec/ram-detach.ts": "535d26114d14d0d94db76227ea7ba52b1ae0b590d7dbac22993b6796d255e666",
48
53
  "packages/nx-plugin/src/executors/bounded-exec/ram-temp-fixtures.ts": "075da4ecfd1cf7dd98fc8c894599dcf2720faba07ac30b8e5592964178849359",
@@ -51,14 +56,14 @@
51
56
  "packages/nx-plugin/src/executors/bounded-exec/run-cpu-pool.ts": "3fc4bfe04862a756d9f74743e399d902a6ce6052a0a3ff4e7edf17f875f33266",
52
57
  "packages/nx-plugin/src/executors/bounded-exec/runner-hook.ts": "606eab5db826e571eb15df618315e01cc773d09fd647beb1c00f6434df58ffad",
53
58
  "packages/nx-plugin/src/executors/bounded-exec/runner-lifecycle.ts": "dc5c10634b8ccda82c71887bf55aaa67f322b1dace53383d45bd8863469af8a1",
54
- "packages/nx-plugin/src/executors/bounded-exec/runner-sizing.ts": "bb8ecbc6acad99e077885ef096f61bf04fe017aa4184c34c98a578c3d3ef5a93",
55
- "packages/nx-plugin/src/executors/bounded-exec/runtime-pin.ts": "8e7fecaf6dd01ce6e065020f8c87edfcdc04e995934e018ab3b69b36acdc5e4f",
59
+ "packages/nx-plugin/src/executors/bounded-exec/runner-sizing.ts": "6884ebad97f5d481af8f04399cc6c45763765be06c56be08126b0a9b0c134c60",
60
+ "packages/nx-plugin/src/executors/bounded-exec/runtime-pin.ts": "3eb9a8b794da51ffa01723509935f48bfb497fba883518046e74a53209f0eb10",
56
61
  "packages/nx-plugin/src/executors/bounded-exec/schema.ts": "18c2b0b6e8c5377f3cd520798da26a0fe2d04ebc35e16035af6432b85d038a2c",
57
- "packages/nx-plugin/src/executors/bounded-exec/verdict.ts": "c9b6746839602f14d92c48b9013e86d1fa4c3dd5446384146c7c22d1fd7b712c",
62
+ "packages/nx-plugin/src/executors/bounded-exec/test-result-writer.ts": "df7668a11d105a1f88d2187ef8b0edff9db7ba56d8176b5bc35daf1359667637",
63
+ "packages/nx-plugin/src/executors/bounded-exec/test-results.ts": "4f83dc3accd7892f45385796522267adad9401326d0cd9ce4d4e1145b9023577",
64
+ "packages/nx-plugin/src/executors/bounded-exec/verdict.ts": "cf8416985b83e41409fc689ceef61df89c8cf2e42bdb42eea7a7c157b8e8eba2",
58
65
  "packages/nx-plugin/src/executors/cargo-zigbuild/executor.ts": "d20b73cc90ae1a9c3f96996cdde4d97347395ca875c4801ab67842ec89f9acd7",
59
66
  "packages/nx-plugin/src/executors/cargo-zigbuild/schema.ts": "e5cf3b0cc91a2d003a63ca0c9a93f1ec08263469b8a19dbe338b2dc0c0810747",
60
- "packages/nx-plugin/src/executors/clean-outputs/executor.ts": "acf82d9560451d76d9357217f5f57645135a393a6deadf8f217b57b481022c46",
61
- "packages/nx-plugin/src/executors/clean-outputs/schema.ts": "47e6f840d56a33bad6aba12171628b74a17911b5503399ebf484baf71be2f58f",
62
67
  "packages/nx-plugin/src/executors/scriptc-native/executor.ts": "4db61da4444d3a30acd3995b6cf53a4bc403a40fe856d88b2c30ce467badbea8",
63
68
  "packages/nx-plugin/src/executors/scriptc-native/ffi-paths.ts": "a73ed6800f69992cad6b954f14c0adb4f0ded45900bf84582df4755a3775104c",
64
69
  "packages/nx-plugin/src/executors/scriptc-native/schema.ts": "41e48a9032ce93b2e6965861c73776e23015f44a0ebd1e011a0786e17b22a108",
@@ -67,6 +72,10 @@
67
72
  "packages/nx-plugin/src/executors/typescript-emit/emit-overrides.ts": "3021aeb756492632d3e5da7a7ae15dded0a9399f73734c0d1fea1c69a2bd4b85",
68
73
  "packages/nx-plugin/src/executors/typescript-emit/executor.ts": "efea02d08b3112d1927562f09dd8641d8a5e1653af876d89314e35fc381e6a53",
69
74
  "packages/nx-plugin/src/executors/typescript-emit/schema.ts": "20edee20fee80198bbfbb743848d4ac3e41e734050abd511fceafcea9cd6da28",
75
+ "packages/nx-plugin/src/executors/wrangler-deploy/deploy-hash.ts": "0ebcf8d795e703f98e43e6e89c474f71f8bde0e09a807564480dbc73ce30cd8a",
76
+ "packages/nx-plugin/src/executors/wrangler-deploy/executor.ts": "de8a8b2c069692b1280b779b48069f7c0cd30cd394c416c821d635130c365a5a",
77
+ "packages/nx-plugin/src/executors/wrangler-deploy/hasher.ts": "d8ffd58ad546fc971ebae91b2c616dc3195132d0ffbaf941946c6544a050b24c",
78
+ "packages/nx-plugin/src/executors/wrangler-deploy/schema.ts": "15db38aaf66abef2d4f20f97e8ec36b31b58194170aef9d5088a1e53e667b796",
70
79
  "packages/nx-plugin/src/forbidden-spelling-policy.ts": "d6c2c17665770432e53ae4b49986dc88eb8e5205be915c6baf34cd819ca9470c",
71
80
  "packages/nx-plugin/src/generators/bounded-test-targets/generator.ts": "fd77c72df6c8457f25c73e512546229ef11001974cba0a05d8700e523d990131",
72
81
  "packages/nx-plugin/src/generators/bounded-test-targets/schema.d.ts": "c471477fdc3c60937c7ba418d6b836dd4f581884cd35b9215068b96a9e5a33c0",
@@ -76,12 +85,13 @@
76
85
  "packages/nx-plugin/src/generators/create-package/schema.d.ts": "8166f79ce6a383f00eb80d7aaeba8f708ed79659b072f1871043b689ceb704d6",
77
86
  "packages/nx-plugin/src/generators/make-public/generator.ts": "2963006e663ff5b1dab37b188f96e40d8c55e0014cadf5c0c755b93c9d479a0f",
78
87
  "packages/nx-plugin/src/generators/make-public/schema.d.ts": "5e7bd2f1ce16795df4c919d6d53588ea85b574c84400940b6322275f96f60357",
88
+ "packages/nx-plugin/src/go-tests.ts": "8e356b6ee276e6e836c404353b0ffb5ccec5beb261126f167f730e6e01e9c2b6",
79
89
  "packages/nx-plugin/src/graph-input-contract.ts": "8a1aec1294960ae80bcff55a0370c95004a911bf1afe6caa47e666da3baeac43",
80
- "packages/nx-plugin/src/index.ts": "d4535f91e1314d9f8230029ad9620d9abca15ec3740a269f851a9a028bbfa34d",
90
+ "packages/nx-plugin/src/index.ts": "44c78d8718f7e1c9ff0dfea57ca00dd04d7f8f0f1adadfb2dd2a540e7da300f9",
81
91
  "packages/nx-plugin/src/managed-assets.ts": "9cea959c09f3163992e666eecc5a65ec1f1b63c81fc56c5e99088507d02c5e3b",
82
92
  "packages/nx-plugin/src/managed-files/ci-workflow.ts": "2d64d689e999af20d65cc21b4803659a835a6eb5340e8d3f896cb0c74e6a0878",
83
93
  "packages/nx-plugin/src/managed-files/context.ts": "5b83c000322382cb781df4f415f3759388e69686b76779599572a62a5c4dd28c",
84
- "packages/nx-plugin/src/managed-files/files.ts": "468d462da82cf0c3b8bb5db736cb3c06203c2cf8f9bc6cebe70ca52eb6fdac5f",
94
+ "packages/nx-plugin/src/managed-files/files.ts": "4de7e3898f1cb107be5ac2d4419865637469690985ec4f37951aa2efee5e8686",
85
95
  "packages/nx-plugin/src/managed-files/generator.ts": "8cf1a1b121645c5ead86c163c9da03f612efb2fff6aabed3ea858d87d6cbd0b3",
86
96
  "packages/nx-plugin/src/managed-files/github-runs-on.ts": "a049ca60a79dec57f77e5d18090569a9b8b78818219f236fe352e7705500f531",
87
97
  "packages/nx-plugin/src/managed-files/json-edit.ts": "81bc6dd10fffff583cc9f2269f0c2fd2f76b1c5aedbc7d068cf29878371497c2",
@@ -95,17 +105,18 @@
95
105
  "packages/nx-plugin/src/manifest-hash.ts": "26cb2598853801cf70785386e1847feba7f04780b43809597004b7fb7ecbc2b6",
96
106
  "packages/nx-plugin/src/nextest-code-bound.ts": "e1036934a35f1b65e0f43bddbea259e01a1100e553cdeaefc2db8823a4517340",
97
107
  "packages/nx-plugin/src/nextest-timings.ts": "3d3c87e8a6e701e5e87073754257a442b9e2045665de31a9571b8c38dc8bfd0b",
108
+ "packages/nx-plugin/src/nx-publish.ts": "0e660129843e7656d8d68b4f6df967739df66aa99264f709124d5ea25c62f7a2",
98
109
  "packages/nx-plugin/src/owned-installation.ts": "6d4c0eac0c9b9fef1c27dbedd008722b702136a177b39567d623234632de5470",
99
110
  "packages/nx-plugin/src/package-target-policy.ts": "32b88c9e6ae54e2ae5492086ff7f4d1147e9f53f014a0614f48953a649bb8cc7",
100
111
  "packages/nx-plugin/src/platform-targets.ts": "a2a1aa3a7fae87931e6387275983435c7f76ce8a91808a9c47eb111bd83cad8f",
101
112
  "packages/nx-plugin/src/process-children.darwin.ts": "a2f95428b94738e53a6d6bee0cbb721bd22a6608432ec393520d0c7baa468329",
102
113
  "packages/nx-plugin/src/process-children.linux.ts": "c1a84b04501f895661efa6800a0cd451ecafaca4a42dc8a1671a8ed615ff5530",
103
114
  "packages/nx-plugin/src/process-children.ts": "eb59f25c02213942b85c16f9f758acf37112b5a5a550152c80656dc1ffcf8b30",
104
- "packages/nx-plugin/src/process-group.ts": "2fcfb039c7dd2467319eb7377a3097b2ef7296ad31183595d0c98c1c2ead1189",
115
+ "packages/nx-plugin/src/process-group.ts": "e3523b074280430c883dd53d39e9e4f9a3d3390bdb8a2667142f7a5d0449c872",
105
116
  "packages/nx-plugin/src/process-listing.ts": "70e7b75d1dda4e813d6fd43800f38ea890cd816fd9b652dfb2eae4b598ff9e46",
106
117
  "packages/nx-plugin/src/producer-receipts.ts": "7b3bc6ad60333015e35861da1d85443cc7954cd08cde8488e863aa856f120490",
107
118
  "packages/nx-plugin/src/release-config-policy.ts": "850fefcddefff6a76c596abea4d9e569f932fd3f94782b26ac6c8e29e3ac4c98",
108
- "packages/nx-plugin/src/runtime-input-policy.ts": "a16545693909fa9b8271af51f73570b392c5c99a864bfd1eae4db40775e1d53f",
119
+ "packages/nx-plugin/src/runtime-input-policy.ts": "c08693adac4c79e66eca331b3c43c22fa9c9032f6f2bb2c39d820f67ef06f041",
109
120
  "packages/nx-plugin/src/runtime-input.ts": "56e748e0b7835d65efbb3be109c201bb4f10dc601a7ac5c8a8a51521501329a7",
110
121
  "packages/nx-plugin/src/rust-tokens.ts": "cbaf7552192b4f82f04518fbcc48c235b4974de5348bc3c175cabcaffffdc32b",
111
122
  "packages/nx-plugin/src/source-directories.ts": "453de3d8be798e6e69eebf7d3ed1842fb13e7d1476b6a088f032ecdfa39a2a72",
@@ -114,17 +125,17 @@
114
125
  "packages/nx-plugin/src/test-backstop.ts": "bd8b27cc05f001e460c29997125f2d7cb07a98ca1ae306f0b0f1884978e247e1",
115
126
  "packages/nx-plugin/src/test-clock-policy.ts": "4edaef6535b862a5b4ca19686ad958c4df1986e1f97821a6193d4a99742598e9",
116
127
  "packages/nx-plugin/src/test-program.ts": "5c5337a3a1deb7e2b11e46fd91136a0b6f41d4b5b42873be573330c59d73000b",
117
- "packages/nx-plugin/src/test-timings.ts": "ffde798346afb092d4ecf34b0a6f886fe5a8a8dfc32fee6ebc2f8592c491f2e1",
128
+ "packages/nx-plugin/src/test-timings.ts": "73c2de1b5c0d06a6628d1659727a8504eaf3c21e89fe0a5da969702ba6823ec9",
118
129
  "packages/nx-plugin/src/test-walk-policy.ts": "f1c92f1a2ba0c3282abb1706bb637d4b5dc74109edb27f7e41edc14e475bfc91",
119
130
  "packages/nx-plugin/src/testing.ts": "2f14ec40b51dd5a1314e5873708ae30c0cd3f0b5bd85042e9a38d7e68ad5a422",
120
- "packages/nx-plugin/src/tool-bins.ts": "ce90414f9fc09bc972322ea5960acf9c3b36889863a0cd31a8ceea5af3180486",
131
+ "packages/nx-plugin/src/tool-bins.ts": "8e5b194d76ce854fd33ad464017c021af401a2d92383f5c31168652b73656601",
121
132
  "packages/nx-plugin/src/type-guards.ts": "87d87a9bb83f0f4614b9f615d8cc7347772cb1418dc1946978987147c0d6ef0c",
122
133
  "packages/nx-plugin/src/typecheck-test-policy.ts": "5f6b1ff0dbf4bcac84721e60452790fb5e4ce41ee35ca2f1d033d51575ed53d7",
123
- "packages/nx-plugin/src/version-actions.cts": "cd77da78b1a80171104c3db0bea586e513f0ce0d66c80f9a38a73533de2a1bbe",
134
+ "packages/nx-plugin/src/version-actions.cts": "c579ed33d5641bd487024429758582fe1f7bde376cfbd4a4a4325aa70fb71883",
124
135
  "packages/nx-plugin/src/wait-why-policy.ts": "f10a5370665c0c38dc778d7532b2cd2b008221efea097b788aeaba8ee63745ea",
125
- "packages/nx-plugin/src/workspace-config-policy.ts": "410debddb0280489f54ab8173fa11890334e19efba69c19d85b92981d2d40688",
126
- "packages/nx-plugin/src/workspace-index.ts": "ba806bf1ab701831868e52efd2e284fb7a4929099b6b8c99e2008e7eae171690",
127
- "packages/nx-plugin/src/workspace-manifest.ts": "3dd8da8dd96f6005282df18d13c15ea4a2d9db78c2bd472cddb3ee18b6ffc50c",
136
+ "packages/nx-plugin/src/workspace-config-policy.ts": "4b5c914027f1512d52a9eed195a368d0e9b21222c17c462841ccb33ba889de5e",
137
+ "packages/nx-plugin/src/workspace-index.ts": "b2036b48bae92d618027bcc1f876eb9312627ed035d4753eead70b23aa482cc5",
138
+ "packages/nx-plugin/src/workspace-manifest.ts": "02329a63dec5fae66bc571ce8a876ff1864c2e6ed07016ef132b9d97d4330c22",
128
139
  "packages/nx-plugin/src/workspace-package-policy.ts": "f569ce4e5d27168ea83aa41893573cb869d6f062d37133e95911fdd1d709fa8c",
129
140
  "packages/nx-plugin/tsconfig.lib.json": "553a96cc72e10c187d5e7d3da767270d8184ae07929139e417345c770b8d84d1"
130
141
  },
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=smoo-nx-go-test-build.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smoo-nx-go-test-build.d.ts","sourceRoot":"","sources":["../../src/bin/smoo-nx-go-test-build.ts"],"names":[],"mappings":""}
@@ -0,0 +1,79 @@
1
+ #!/usr/bin/env node
2
+ import { spawnSync } from 'node:child_process';
3
+ import { lstatSync, mkdirSync, renameSync, rmSync, writeFileSync } from 'node:fs';
4
+ import { join, relative, resolve } from 'node:path';
5
+ import { GO_TESTS_MANIFEST } from '../go-tests.js';
6
+ // Builds a Go module's test binaries ahead of their run, so the build can be a cached target of its own: run in the
7
+ // module, it builds one `go test -c` binary for each package with test files among <package pattern>..., as `go list`
8
+ // resolves them, and writes <out-dir>/go-tests.json naming each binary's package and directory for
9
+ // smoo-nx-go-test-run. <out-dir> is replaced whole, so no binary of a package that lost its tests lingers; a directory
10
+ // that holds no such manifest is never replaced. Exit 2 on a usage error or such a directory; go's own status when go
11
+ // fails, its diagnostics already on stderr.
12
+ const usage = 'usage: smoo-nx-go-test-build <out-dir> <package pattern>...\n';
13
+ const words = process.argv.slice(2);
14
+ const [outWord, ...patterns] = words;
15
+ if (outWord === undefined || patterns.length === 0 || words.some((word) => word.startsWith('-'))) {
16
+ process.stderr.write(usage);
17
+ process.exit(2);
18
+ }
19
+ const out = resolve(outWord);
20
+ // One record per package with test files: its import path and directory, each NUL-terminated; go list ends the
21
+ // output of every package that printed one with a newline. No path holds a NUL, so the records split exactly.
22
+ const LISTED = '{{if or .TestGoFiles .XTestGoFiles}}{{.ImportPath}}{{"\\x00"}}{{.Dir}}{{"\\x00"}}{{end}}';
23
+ function refuse(reason) {
24
+ process.stderr.write(`smoo-nx-go-test-build: ${reason}\n`);
25
+ process.exit(2);
26
+ }
27
+ function exists(path) {
28
+ try {
29
+ lstatSync(path);
30
+ return true;
31
+ }
32
+ catch (error) {
33
+ if (error instanceof Error && 'code' in error && error.code === 'ENOENT')
34
+ return false;
35
+ throw error;
36
+ }
37
+ }
38
+ /** `go args`; when it fails, this build ends with go's status after `cleanup`. */
39
+ function go(args, capture, cleanup) {
40
+ // eslint-disable-next-line deadline/no-unbounded-wait -- WHY unbounded: go list resolves and go test -c compiles for as long as the module takes; the target that runs this build bounds it, or the operator's interrupt ends it
41
+ const ran = spawnSync('go', args, { stdio: ['ignore', capture ? 'pipe' : 'inherit', 'inherit'], encoding: 'utf8' });
42
+ if (ran.error !== undefined || ran.status !== 0) {
43
+ cleanup();
44
+ const ended = ran.error?.message ?? (ran.signal === null ? `exit ${ran.status}` : `killed by ${ran.signal}`);
45
+ process.stderr.write(`smoo-nx-go-test-build: go ${args.join(' ')} failed: ${ended}\n`);
46
+ process.exit(ran.status === null || ran.status === 0 ? 2 : ran.status);
47
+ }
48
+ return ran;
49
+ }
50
+ if (exists(out) && !exists(join(out, GO_TESTS_MANIFEST))) {
51
+ refuse(`${out} exists and holds no ${GO_TESTS_MANIFEST}; only a directory this tool built is replaced`);
52
+ }
53
+ const packages = go(['list', '-f', LISTED, ...patterns], true, () => { })
54
+ .stdout.split('\0\n')
55
+ .filter((record) => record !== '')
56
+ .map((record) => {
57
+ const [importPath, dir, ...rest] = record.split('\0');
58
+ if (importPath === undefined || dir === undefined || rest.length > 0) {
59
+ refuse(`go list printed a record that is no import path and directory: ${JSON.stringify(record)}`);
60
+ }
61
+ return { importPath, dir };
62
+ })
63
+ .sort((a, b) => (a.importPath < b.importPath ? -1 : a.importPath > b.importPath ? 1 : 0));
64
+ const staging = `${out}.building-${process.pid}`;
65
+ const dropStaging = () => rmSync(staging, { recursive: true, force: true });
66
+ dropStaging();
67
+ mkdirSync(staging, { recursive: true });
68
+ const tests = [];
69
+ for (const { importPath, dir } of packages) {
70
+ // Injective, so no two packages share a binary, and readable enough to name the package.
71
+ const binary = `${encodeURIComponent(importPath)}.test`;
72
+ go(['test', '-c', '-o', join(staging, binary), importPath], false, dropStaging);
73
+ tests.push({ binary, dir: relative(out, dir) || '.', importPath });
74
+ }
75
+ const manifest = { version: 1, tests };
76
+ writeFileSync(join(staging, GO_TESTS_MANIFEST), `${JSON.stringify(manifest, null, 2)}\n`);
77
+ rmSync(out, { recursive: true, force: true });
78
+ renameSync(staging, out);
79
+ process.stdout.write(`smoo-nx-go-test-build: ${tests.length} test binaries in ${out}\n`);
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=smoo-nx-go-test-run.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smoo-nx-go-test-run.d.ts","sourceRoot":"","sources":["../../src/bin/smoo-nx-go-test-run.ts"],"names":[],"mappings":""}
@@ -0,0 +1,129 @@
1
+ #!/usr/bin/env node
2
+ import { spawn, spawnSync } from 'node:child_process';
3
+ import { statSync } from 'node:fs';
4
+ import { availableParallelism } from 'node:os';
5
+ import { readGoTestsManifest } from '../go-tests.js';
6
+ // Runs the test binaries smoo-nx-go-test-build listed in <go-tests.json> as `go test -json` runs a package's binary:
7
+ // in its package directory, under `go tool test2json -t -p <import path>`, with the flags go test gives it, up to -p
8
+ // binaries at once (default GOMAXPROCS, else one per core, as go test's -p). Each event line reaches stdout whole, so
9
+ // bounded-exec reads results, verdict and progress from it as from go test (GO_TEST_RUNNER); `-json` is accepted and
10
+ // implied. A manifest listing no binary is refused unless --allow-empty says none is expected, so a package pattern
11
+ // that matched no tests cannot pass. Exit 1 when any binary failed, 2 on a usage error or a manifest it cannot run.
12
+ const usage = 'usage: smoo-nx-go-test-run [-p=N] [-json] [--allow-empty] <go-tests.json>\n';
13
+ // What `go test -json` passes every test binary it runs, its default -timeout included.
14
+ const GO_TEST_BINARY_FLAGS = ['-test.v=test2json', '-test.paniconexit0', '-test.timeout=10m0s'];
15
+ const COUNT = /^[1-9]\d*$/;
16
+ function refuse(reason) {
17
+ process.stderr.write(`smoo-nx-go-test-run: ${reason}\n`);
18
+ process.exit(2);
19
+ }
20
+ function parseArguments(words) {
21
+ let packages = null;
22
+ let allowEmpty = false;
23
+ let manifest = null;
24
+ for (let at = 0; at < words.length; at += 1) {
25
+ const word = words[at] ?? '';
26
+ const flag = /^-p(?:=(.*))?$/.exec(word);
27
+ if (flag !== null) {
28
+ let value = flag[1];
29
+ if (value === undefined) {
30
+ at += 1;
31
+ value = words[at];
32
+ }
33
+ if (value === undefined || !COUNT.test(value))
34
+ return null;
35
+ packages = Number(value);
36
+ }
37
+ else if (word === '--allow-empty') {
38
+ allowEmpty = true;
39
+ }
40
+ else if (word === '-json' || word === '-json=true') {
41
+ // Implied: test2json writes nothing else.
42
+ }
43
+ else if (word.startsWith('-') || word === '' || manifest !== null) {
44
+ return null;
45
+ }
46
+ else {
47
+ manifest = word;
48
+ }
49
+ }
50
+ return manifest === null ? null : { packages, allowEmpty, manifest };
51
+ }
52
+ /** Every complete line `from` writes reaches `to` whole, so concurrent binaries' events never split a line. */
53
+ function forwardLines(from, to) {
54
+ let pending = Buffer.alloc(0);
55
+ from.on('data', (chunk) => {
56
+ const bytes = pending.length === 0 ? chunk : Buffer.concat([pending, chunk]);
57
+ const end = bytes.lastIndexOf(10);
58
+ if (end === -1) {
59
+ pending = bytes;
60
+ return;
61
+ }
62
+ to.write(bytes.subarray(0, end + 1));
63
+ pending = bytes.subarray(end + 1);
64
+ });
65
+ from.on('end', () => {
66
+ if (pending.length > 0)
67
+ to.write(Buffer.concat([pending, Buffer.from('\n')]));
68
+ });
69
+ }
70
+ /** Null when the binary passed, else how it ended. */
71
+ function runBinary(test2json, test) {
72
+ // The plugin's lib target (ES2022) has no Promise.withResolvers.
73
+ // eslint-disable-next-line deadline/no-unbounded-wait -- WHY unbounded: a test binary runs as long as its tests do; the bounded-exec run around this bin owns their progress bound and ends a hung one with its process group
74
+ return new Promise((resolve) => {
75
+ const child = spawn(test2json, ['-t', '-p', test.importPath, test.binary, ...GO_TEST_BINARY_FLAGS], {
76
+ cwd: test.dir,
77
+ stdio: ['ignore', 'pipe', 'pipe'],
78
+ });
79
+ forwardLines(child.stdout, process.stdout);
80
+ forwardLines(child.stderr, process.stderr);
81
+ child.on('error', (error) => resolve(`could not start: ${error.message}`));
82
+ child.on('close', (code, signal) => resolve(code === 0 ? null : signal === null ? `exit ${code}` : `killed by ${signal}`));
83
+ });
84
+ }
85
+ const parsed = parseArguments(process.argv.slice(2));
86
+ if (parsed === null) {
87
+ process.stderr.write(usage);
88
+ process.exit(2);
89
+ }
90
+ const read = readGoTestsManifest(parsed.manifest);
91
+ if (!read.ok)
92
+ refuse(read.reason);
93
+ const tests = read.tests;
94
+ if (tests.length === 0) {
95
+ if (parsed.allowEmpty)
96
+ process.exit(0);
97
+ refuse(`${parsed.manifest} lists no test binaries, as when no package pattern matched a test; --allow-empty expects that`);
98
+ }
99
+ for (const test of tests) {
100
+ if (statSync(test.binary, { throwIfNoEntry: false })?.isFile() !== true) {
101
+ refuse(`${parsed.manifest} lists ${test.binary} for ${test.importPath}, which is no file; build it again`);
102
+ }
103
+ if (statSync(test.dir, { throwIfNoEntry: false })?.isDirectory() !== true) {
104
+ refuse(`${parsed.manifest} runs ${test.importPath} in ${test.dir}, which is no directory`);
105
+ }
106
+ }
107
+ // eslint-disable-next-line deadline/no-unbounded-wait -- WHY unbounded: go builds test2json into its cache on its first use, for as long as that compile takes; the bounded-exec run around this bin ends a hung one
108
+ const tool = spawnSync('go', ['tool', '-n', 'test2json'], { stdio: ['ignore', 'pipe', 'inherit'], encoding: 'utf8' });
109
+ if (tool.error !== undefined || tool.status !== 0) {
110
+ refuse(`go tool -n test2json named no test2json: ${tool.error?.message ?? `exit ${tool.status ?? tool.signal}`}`);
111
+ }
112
+ const test2json = tool.stdout.trim();
113
+ const inherited = process.env.GOMAXPROCS;
114
+ const packages = parsed.packages ?? (inherited !== undefined && COUNT.test(inherited) ? Number(inherited) : availableParallelism());
115
+ const failures = [];
116
+ const queue = tests.values();
117
+ const worker = async () => {
118
+ for (const test of queue) {
119
+ const failure = await runBinary(test2json, test);
120
+ if (failure !== null)
121
+ failures.push(`${test.importPath} (${failure})`);
122
+ }
123
+ };
124
+ await Promise.all(Array.from({ length: Math.min(packages, tests.length) }, worker));
125
+ if (failures.length > 0) {
126
+ failures.sort();
127
+ process.stderr.write(`smoo-nx-go-test-run: ${failures.length} of ${tests.length} test binaries failed: ${failures.join(', ')}\n`);
128
+ process.exitCode = 1;
129
+ }
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ export {};
3
+ //# sourceMappingURL=smoo-nx-publish.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"smoo-nx-publish.d.ts","sourceRoot":"","sources":["../../src/bin/smoo-nx-publish.ts"],"names":[],"mappings":""}
@@ -0,0 +1,3 @@
1
+ #!/usr/bin/env node
2
+ import { runNxPublish } from '../nx-publish.js';
3
+ process.exitCode = await runNxPublish(process.argv.slice(2));
@@ -49,7 +49,7 @@ export declare function checkWorkspaceBoundedTestTargetPolicy(root: string, opti
49
49
  * package-local `nx.targets['cargo-test'].dependsOn` that omits the inferred
50
50
  * runner leg leaves a target that still "reaches" its dependencies while no
51
51
  * test binary is ever run. Reachability alone cannot see this, because
52
- * `cargo-test-archive` only compiles. (Inference itself no longer skips a
52
+ * `cargo-test-build` only compiles. (Inference itself no longer skips a
53
53
  * declared cargo key, so the executor and options survive the declaration —
54
54
  * see `index.ts`.)
55
55
  *
@@ -1 +1 @@
1
- {"version":3,"file":"bounded-test-policy.d.ts","sourceRoot":"","sources":["../src/bounded-test-policy.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAKrG,OAAO,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAC9F,eAAO,MAAM,qBAAqB,yCAAyC,CAAC;AAC5E;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AAEnD,MAAM,WAAW,4BAA4B;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,EAAE,CAAC,EAAE;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KACnD,CAAC;CACH;AAED,MAAM,WAAW,4BAA4B;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACnD;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mCAAmC;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,4BAA4B,CAAC;IAC3C,eAAe,CAAC,EAAE,sBAAsB,CAAC;CAC1C;AAED,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,4BAA4B,EACzC,OAAO,EAAE,mCAAmC,GAC3C,IAAI,CAuBN;AAED,wBAAgB,qCAAqC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,0BAA+B,GAAG,OAAO,CAiCrH;AAED,wBAAgB,qCAAqC,CACnD,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,0BAA+B,GACvC,sBAAsB,EAAE,CA4B1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,yCAAyC,CACvD,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,0BAA+B,GACvC,sBAAsB,EAAE,CAwC1B;AAgID,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,4BAA4B,EACzC,OAAO,EAAE,mCAAmC,GAC3C,OAAO,CAqBT;AA8KD,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,4BAA4B,EACzC,cAAc,SAAa,EAC3B,WAAW,CAAC,EAAE,4BAA4B,GACzC,MAAM,CAER;AA4CD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAYhE"}
1
+ {"version":3,"file":"bounded-test-policy.d.ts","sourceRoot":"","sources":["../src/bounded-test-policy.ts"],"names":[],"mappings":"AAWA,OAAO,KAAK,EAAE,0BAA0B,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAC;AAKrG,OAAO,EAAE,4BAA4B,EAAE,0BAA0B,EAAE,MAAM,oBAAoB,CAAC;AAC9F,eAAO,MAAM,qBAAqB,yCAAyC,CAAC;AAC5E;;;;;;GAMG;AACH,eAAO,MAAM,qBAAqB,gBAAgB,CAAC;AAEnD,MAAM,WAAW,4BAA4B;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,OAAO,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IAClC,EAAE,CAAC,EAAE;QACH,IAAI,CAAC,EAAE,MAAM,CAAC;QACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;KACnD,CAAC;CACH;AAED,MAAM,WAAW,4BAA4B;IAC3C,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC;CACnD;AAED,MAAM,WAAW,sBAAsB;IACrC,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,mCAAmC;IAClD,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,WAAW,CAAC,EAAE,4BAA4B,CAAC;IAC3C,eAAe,CAAC,EAAE,sBAAsB,CAAC;CAC1C;AAED,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,4BAA4B,EACzC,OAAO,EAAE,mCAAmC,GAC3C,IAAI,CAuBN;AAED,wBAAgB,qCAAqC,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,GAAE,0BAA+B,GAAG,OAAO,CAiCrH;AAED,wBAAgB,qCAAqC,CACnD,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,0BAA+B,GACvC,sBAAsB,EAAE,CA4B1B;AAED;;;;;;;;;;;;;;;;;;;;;;;;GAwBG;AACH,wBAAgB,yCAAyC,CACvD,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,0BAA+B,GACvC,sBAAsB,EAAE,CAwC1B;AAiID,wBAAgB,4BAA4B,CAC1C,WAAW,EAAE,4BAA4B,EACzC,OAAO,EAAE,mCAAmC,GAC3C,OAAO,CAqBT;AA8KD,wBAAgB,sBAAsB,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CAElE;AAED,wBAAgB,kBAAkB,CAChC,WAAW,EAAE,4BAA4B,EACzC,cAAc,SAAa,EAC3B,WAAW,CAAC,EAAE,4BAA4B,GACzC,MAAM,CAER;AA4CD,wBAAgB,wBAAwB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAYhE"}
@@ -1,7 +1,7 @@
1
1
  import { existsSync, readdirSync, readFileSync } from 'node:fs';
2
2
  import { dirname, join } from 'node:path';
3
3
  import { expandWildcardTargetConfiguration } from 'nx/src/tasks-runner/utils.js';
4
- import { CARGO_TEST_ARCHIVE_TARGET, CARGO_TEST_TARGET, listCargoWorkspacePackages, packageNameFromCargoTestTarget, } from './cargo-workspace.js';
4
+ import { CARGO_TEST_BUILD_TARGET, CARGO_TEST_TARGET, listCargoWorkspacePackages, packageNameFromCargoTestTarget, } from './cargo-workspace.js';
5
5
  import { cargoCrossTestTripleFromArchiveTarget } from './cross-check-policy.js';
6
6
  import { writeJsonFile } from './managed-files/managed-format.js';
7
7
  import { BOUNDED_TEST_IDLE_TIMEOUT_MS, BOUNDED_TEST_KILL_AFTER_MS } from './test-backstop.js';
@@ -114,7 +114,7 @@ export function checkWorkspaceBoundedTestTargetPolicy(root, options = {}) {
114
114
  * package-local `nx.targets['cargo-test'].dependsOn` that omits the inferred
115
115
  * runner leg leaves a target that still "reaches" its dependencies while no
116
116
  * test binary is ever run. Reachability alone cannot see this, because
117
- * `cargo-test-archive` only compiles. (Inference itself no longer skips a
117
+ * `cargo-test-build` only compiles. (Inference itself no longer skips a
118
118
  * declared cargo key, so the executor and options survive the declaration —
119
119
  * see `index.ts`.)
120
120
  *
@@ -169,9 +169,9 @@ export function checkWorkspaceCargoTestReachabilityPolicy(root, options = {}) {
169
169
  /**
170
170
  * True when `target`, or something in its dependency closure, invokes cargo in a
171
171
  * mode that executes tests. Compile-only steps are deliberately excluded:
172
- * `cargo-test-archive` is `cargo nextest archive` and a `--no-run` build is
173
- * `cargo test --no-run`. Both prove the binaries build and nothing about them
174
- * running, and both say "test"/"nextest" in their command — a closure holding
172
+ * `cargo-test-build` is `cargo nextest list --list-type binaries-only`, a cross
173
+ * lane's archive is `cargo nextest archive` and a `--no-run` build is
174
+ * `cargo test --no-run`. Each proves the binaries build and nothing about them
175
175
  * only these is the silent green this check exists to catch.
176
176
  */
177
177
  function resolvedTargetRunsTests(project, target) {
@@ -186,7 +186,8 @@ function resolvedTargetRunsTests(project, target) {
186
186
  const runs = command !== undefined &&
187
187
  /\btest\b|\bnextest\b/.test(command) &&
188
188
  !command.includes('--no-run') &&
189
- !command.includes('nextest archive');
189
+ !command.includes('nextest archive') &&
190
+ !command.includes('nextest list');
190
191
  const reached = runs ||
191
192
  (project.targetDependencies?.get(targetName) ?? []).some((dependency) => matchingResolvedTargets(dependency, project.targets, targetNames).some(visit));
192
193
  visiting.delete(targetName);
@@ -195,7 +196,7 @@ function resolvedTargetRunsTests(project, target) {
195
196
  return visit(target);
196
197
  }
197
198
  /**
198
- * Per-crate nextest targets that `cargo-test` actually reaches. `cargo-test-archive`
199
+ * Per-crate nextest targets that `cargo-test` actually reaches. `cargo-test-build`
199
200
  * is excluded: it is not a runner. Members come from the same Cargo.toml walk
200
201
  * inference uses; the child list is the graph, not a hand-written crate list.
201
202
  */
@@ -367,7 +368,7 @@ function bunTestHasNoDeadline(command) {
367
368
  return found;
368
369
  }
369
370
  function isTestLegTargetName(name) {
370
- return (name !== CARGO_TEST_ARCHIVE_TARGET &&
371
+ return (name !== CARGO_TEST_BUILD_TARGET &&
371
372
  cargoCrossTestTripleFromArchiveTarget(name) === null &&
372
373
  isTestRunnerTargetName(name));
373
374
  }
@@ -15,8 +15,12 @@ export declare const CARGO_PRODUCER_METADATA: {
15
15
  export declare function mbxManagesTargets(environment: Readonly<NodeJS.ProcessEnv>): boolean;
16
16
  /**
17
17
  * After a run that executed a Cargo producer task ({@link CARGO_PRODUCER_METADATA}), check whether
18
- * each Cargo workspace is due for its daily maintenance. A successful receipt schedules only;
19
- * every due pass reads the current graph under Cargo's locks and is awaited by this Nx process.
18
+ * each Cargo workspace is due for its daily maintenance, and start each due pass in a process of its own
19
+ * (`startRetentionPass`). Nx awaits this hook, inside its daemon when one serves the run, so the pass never runs here:
20
+ * its unlinks are synchronous, and one freeing a large trash on a loaded volume held a daemon, and every client waiting
21
+ * on it, for more than thirty minutes. Here only the gate answers (not due, busy, refused); the started pass reads the
22
+ * current graph under Cargo's locks and records its outcome in the target's receipt, and neither this process nor its
23
+ * exit waits on it. A successful receipt schedules only.
20
24
  * Maintenance never fails the run it follows: every outcome, a refused or busy pass included, is only reported. In an
21
25
  * mbx project ({@link mbxManagesTargets}) it does nothing.
22
26
  */
@@ -1 +1 @@
1
- {"version":3,"file":"cargo-retention-hook.d.ts","sourceRoot":"","sources":["../src/cargo-retention-hook.ts"],"names":[],"mappings":"AAYA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAuB5F;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;aAAK,aAAa;CAAiB,CAAC;AAExE;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,OAAO,CAEnF;AAED;;;;;;GAMG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CA8C7G"}
1
+ {"version":3,"file":"cargo-retention-hook.d.ts","sourceRoot":"","sources":["../src/cargo-retention-hook.ts"],"names":[],"mappings":"AAaA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,4CAA4C,CAAC;AAuB5F;;;;GAIG;AACH,eAAO,MAAM,uBAAuB;aAAK,aAAa;CAAiB,CAAC;AAExE;;;;GAIG;AACH,wBAAgB,iBAAiB,CAAC,WAAW,EAAE,QAAQ,CAAC,MAAM,CAAC,UAAU,CAAC,GAAG,OAAO,CAEnF;AAED;;;;;;;;;;GAUG;AACH,wBAAsB,kBAAkB,CAAC,QAAQ,EAAE,OAAO,EAAE,OAAO,EAAE,yBAAyB,GAAG,OAAO,CAAC,IAAI,CAAC,CA+C7G"}
@@ -1,5 +1,6 @@
1
1
  import { join, relative } from 'node:path';
2
- import { describeRetention, describeRetentionError, refusedAnywhere, retainCargoWorkspace, } from '@smoothbricks/cargo-retain';
2
+ import { describeRetentionError, describeRetentionStart, refusedAnywhere, startRetentionPass, } from '@smoothbricks/cargo-retain';
3
+ import { launchNodeCli } from '@smoothbricks/cargo-retain/launch-node';
3
4
  import { nodeLocks } from '@smoothbricks/cargo-retain/locks-node';
4
5
  import { logger, readCachedProjectGraph } from 'nx/src/devkit-exports.js';
5
6
  function describeCause(error) {
@@ -35,8 +36,12 @@ export function mbxManagesTargets(environment) {
35
36
  }
36
37
  /**
37
38
  * After a run that executed a Cargo producer task ({@link CARGO_PRODUCER_METADATA}), check whether
38
- * each Cargo workspace is due for its daily maintenance. A successful receipt schedules only;
39
- * every due pass reads the current graph under Cargo's locks and is awaited by this Nx process.
39
+ * each Cargo workspace is due for its daily maintenance, and start each due pass in a process of its own
40
+ * (`startRetentionPass`). Nx awaits this hook, inside its daemon when one serves the run, so the pass never runs here:
41
+ * its unlinks are synchronous, and one freeing a large trash on a loaded volume held a daemon, and every client waiting
42
+ * on it, for more than thirty minutes. Here only the gate answers (not due, busy, refused); the started pass reads the
43
+ * current graph under Cargo's locks and records its outcome in the target's receipt, and neither this process nor its
44
+ * exit waits on it. A successful receipt schedules only.
40
45
  * Maintenance never fails the run it follows: every outcome, a refused or busy pass included, is only reported. In an
41
46
  * mbx project ({@link mbxManagesTargets}) it does nothing.
42
47
  */
@@ -69,7 +74,7 @@ export async function postTasksExecution(_options, context) {
69
74
  const cpu = process.cpuUsage();
70
75
  let result;
71
76
  try {
72
- result = await retainCargoWorkspace(root, { apply: true, automatic: true, now: Date.now() }, nodeLocks);
77
+ result = await startRetentionPass(root, Date.now(), nodeLocks, launchNodeCli);
73
78
  }
74
79
  catch (error) {
75
80
  // Maintenance never fails the run it follows: say what escaped, then go on to the next workspace.
@@ -86,9 +91,10 @@ export async function postTasksExecution(_options, context) {
86
91
  logger.warn(`Cargo retention for ${root}: ${describeRetentionError(result.error)}`);
87
92
  continue;
88
93
  }
89
- done.push(result.value.workspaceRoot);
90
- const line = describeRetention(result.value);
91
- if (refusedAnywhere(result.value))
94
+ const start = result.value;
95
+ done.push(start.kind === 'answered' ? start.report.workspaceRoot : start.workspaceRoot);
96
+ const line = describeRetentionStart(start);
97
+ if (start.kind === 'answered' && refusedAnywhere(start.report))
92
98
  logger.warn(line);
93
99
  else
94
100
  logger.info(line);