@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
package/test-timings.json CHANGED
@@ -2,132 +2,138 @@
2
2
  "version": 1,
3
3
  "files": {
4
4
  "src/executors/bounded-exec/go-progress-host.test.ts": 113358,
5
- "src/ensure-built.test.ts": 63589,
6
- "src/owned-installation.test.ts": 52150,
7
- "src/nx-daemon-validity.test.ts": 50650,
5
+ "src/ensure-built.test.ts": 50158,
6
+ "src/nx-daemon-validity.test.ts": 43752,
8
7
  "src/executors/bounded-exec/cargo-progress-host.test.ts": 38973,
9
- "src/cargo-resolve-cache.test.ts": 35830,
10
- "src/executors/bounded-exec/executor.test.ts": 27061,
11
- "src/ensure-built-receipt.test.ts": 22597,
12
- "src/index.test.ts": 17787,
13
- "src/linked-snapshots.nx.test.ts": 17751,
14
- "src/cargo-retention.test.ts": 17431,
15
- "src/cargo-source-hash.test.ts": 16020,
16
- "src/process-group.test.ts": 11471,
17
- "src/cargo-closure-input.test.ts": 11140,
18
- "src/nx-dot-input-policy.test.ts": 8998,
19
- "src/nx-daemon-claim.test.ts": 8514,
20
- "src/task-results.test.ts": 8194,
21
- "src/executors/typescript-emit/executor.test.ts": 7952,
22
- "src/executors/bounded-exec/ram-temp.test.ts": 7270,
23
- "src/cargo-closure-key.test.ts": 6359,
24
- "src/bounded-test-policy.test.ts": 5754,
25
- "src/nextest-partitions.test.ts": 5407,
26
- "src/nx-daemon-ignore-files.test.ts": 5306,
27
- "src/nx-daemon-idle-policy.test.ts": 4132,
28
- "src/managed-files/repo-path.test.ts": 3915,
29
- "src/executors/bounded-exec/verdict.test.ts": 3665,
30
- "src/runtime-input.test.ts": 3653,
31
- "src/managed-files/forgejo-artifact.test.ts": 3633,
32
- "src/cargo-workspace.test.ts": 3380,
33
- "src/nx-daemon-start-never.test.ts": 3312,
34
- "src/nx-project-graph-errors.test.ts": 3146,
35
- "src/nx-task-output-lease.test.ts": 3142,
36
- "src/nx-daemon-watch-filter.test.ts": 2746,
37
- "src/nx-cache-restore-mtime.test.ts": 2727,
38
- "src/nx-remote-cache-outage.test.ts": 2659,
39
- "src/serial-group-wiring.test.ts": 2245,
40
- "src/task-history-namespace.test.ts": 2160,
41
- "src/nx-skipped-task-exit.test.ts": 2119,
42
- "src/managed-files/generator.test.ts": 1989,
43
- "src/nx-cache-kept-outputs.test.ts": 1953,
44
- "src/nx-plugin-load-errors.test.ts": 1914,
45
- "src/nx-files-archive-racy.test.ts": 1890,
46
- "src/task-graph-policy.nx.test.ts": 1719,
47
- "src/nx-use-local.test.ts": 1694,
48
- "src/nx-daemon-env-identity.test.ts": 1653,
49
- "src/typecheck-test-policy.test.ts": 1635,
50
- "src/cross-check-policy.test.ts": 1506,
51
- "src/managed-files/managed-format-json.test.ts": 1422,
52
- "src/graph-input-contract.test.ts": 1406,
53
- "src/test-walk-policy.test.ts": 1330,
54
- "src/cargo-build-script-env.test.ts": 1286,
55
- "src/nextest-code-bound.test.ts": 1178,
56
- "src/nx-foreign-workspace-env.test.ts": 1117,
57
- "src/bin/smoo-nx-bound-failures.test.ts": 1046,
58
- "src/typescript-resolution.test.ts": 1001,
59
- "src/testing.test.ts": 900,
60
- "src/cargo-child-kill.test.ts": 867,
61
- "src/nx-resident-graph-workers.test.ts": 778,
62
- "src/executors/all-verdicts/executor.test.ts": 735,
63
- "src/nx-failure-life-cycles.test.ts": 689,
64
- "src/nx-incomplete-run-summary.test.ts": 667,
65
- "src/nx-critical-path-schedule.test.ts": 662,
66
- "src/package-target-policy.test.ts": 590,
67
- "src/bun-bootstrap.test.ts": 547,
68
- "src/nx-store-resolution.test.ts": 537,
69
- "src/executors/bounded-exec/runner-hook.test.ts": 530,
70
- "src/nx-cache-bound.test.ts": 516,
71
- "src/test-clock-policy.test.ts": 425,
72
- "src/nx-raw-inputs.test.ts": 424,
73
- "src/lock-scope.test.ts": 409,
74
- "src/managed-files/unserved-workspace-hooks.test.ts": 394,
75
- "src/executors/cargo-zigbuild/executor.test.ts": 392,
76
- "src/forbidden-spelling-policy.test.ts": 388,
77
- "src/managed-files/github-host-cache-isolation.test.ts": 365,
78
- "src/executors/scriptc-native/executor.test.ts": 362,
79
- "src/ensure-built-witness.test.ts": 361,
80
- "src/executors/bounded-exec/hang-diagnostics.test.ts": 347,
81
- "src/nx-daemon-root-normalization.test.ts": 307,
82
- "src/executors/bounded-exec/runtime-pin.test.ts": 136,
83
- "src/test-timings.test.ts": 135,
84
- "src/version-actions.test.ts": 132,
85
- "src/generators/make-public/generator.test.ts": 131,
86
- "src/managed-files/cache-ttsc-plugins.test.ts": 131,
87
- "src/build-state-output-policy.test.ts": 130,
88
- "src/release-config-policy.test.ts": 120,
89
- "src/managed-files/setup-devenv-free-disk.test.ts": 114,
90
- "src/cargo-toolchain-paths.test.ts": 110,
91
- "src/executors/bounded-exec/cpu-pool.test.ts": 101,
92
- "src/cargo-closure-filesets.test.ts": 98,
93
- "src/producer-receipts.test.ts": 83,
94
- "src/workspace-config-policy.test.ts": 80,
95
- "src/nx-state-location.test.ts": 57,
96
- "src/manifest-hash.test.ts": 53,
97
- "src/wait-why-policy.test.ts": 40,
98
- "src/executors/bounded-exec/ram-provenance.test.ts": 38,
99
- "src/executors/bounded-exec/run-cpu-pool.test.ts": 38,
100
- "src/executors/bounded-exec/disk-lease.test.ts": 33,
101
- "src/managed-files/tree-permissions.test.ts": 33,
8
+ "src/nextest-partitions.test.ts": 35261,
9
+ "src/executors/bounded-exec/executor.test.ts": 28863,
10
+ "src/cargo-retention.test.ts": 24111,
11
+ "src/owned-installation.test.ts": 23722,
12
+ "src/ensure-built-receipt.test.ts": 20391,
13
+ "src/cargo-resolve-cache.test.ts": 20246,
14
+ "src/cargo-source-hash.test.ts": 16053,
15
+ "src/linked-snapshots.nx.test.ts": 11920,
16
+ "src/index.test.ts": 8528,
17
+ "src/cargo-closure-input.test.ts": 8157,
18
+ "src/nx-daemon-claim.test.ts": 7678,
19
+ "src/executors/typescript-emit/executor.test.ts": 7126,
20
+ "src/executors/bounded-exec/ram-temp.test.ts": 5801,
21
+ "src/process-group.test.ts": 5461,
22
+ "src/bounded-test-policy.test.ts": 5361,
23
+ "src/task-history-namespace.test.ts": 5246,
24
+ "src/executors/bounded-exec/run-cpu-pool.test.ts": 5185,
25
+ "src/task-results.test.ts": 4915,
26
+ "src/nx-daemon-start-never.test.ts": 4590,
27
+ "src/serial-group-wiring.test.ts": 4153,
28
+ "src/nx-daemon-ignore-files.test.ts": 4149,
29
+ "src/nx-dot-input-policy.test.ts": 3577,
30
+ "src/cargo-workspace.test.ts": 3534,
31
+ "src/cargo-build-script-env.test.ts": 3401,
32
+ "src/executors/bounded-exec/hang-diagnostics.test.ts": 3348,
33
+ "src/nx-files-archive-racy.test.ts": 3119,
34
+ "src/nx-daemon-idle-policy.test.ts": 3069,
35
+ "src/nx-remote-cache-outage.test.ts": 2542,
36
+ "src/cross-check-policy.test.ts": 2486,
37
+ "src/cargo-closure-key.test.ts": 2374,
38
+ "src/managed-files/repo-path.test.ts": 2244,
39
+ "src/testing.test.ts": 2140,
40
+ "src/nx-daemon-watch-filter.test.ts": 2120,
41
+ "src/nx-daemon-env-identity.test.ts": 2075,
42
+ "src/nx-task-output-lease.test.ts": 1926,
43
+ "src/runtime-input.test.ts": 1781,
44
+ "src/nx-skipped-task-exit.test.ts": 1767,
45
+ "src/executors/bounded-exec/verdict.test.ts": 1643,
46
+ "src/nx-project-graph-errors.test.ts": 1591,
47
+ "src/managed-files/forgejo-artifact.test.ts": 1556,
48
+ "src/nx-cache-restore-mtime.test.ts": 1453,
49
+ "src/graph-input-contract.test.ts": 1308,
50
+ "src/managed-files/generator.test.ts": 1168,
51
+ "src/nx-foreign-workspace-env.test.ts": 1151,
52
+ "src/nx-cache-kept-outputs.test.ts": 1095,
53
+ "src/nx-use-local.test.ts": 1064,
54
+ "src/bin/smoo-nx-bound-failures.test.ts": 1049,
55
+ "src/managed-files/managed-format-json.test.ts": 1041,
56
+ "src/typecheck-test-policy.test.ts": 1019,
57
+ "src/executors/all-verdicts/executor.test.ts": 972,
58
+ "src/nextest-code-bound.test.ts": 896,
59
+ "src/nx-plugin-load-errors.test.ts": 860,
60
+ "src/executors/bounded-exec/test-results-run.test.ts": 838,
61
+ "src/nx-resident-graph-workers.test.ts": 836,
62
+ "src/cargo-child-kill.test.ts": 745,
63
+ "src/test-walk-policy.test.ts": 633,
64
+ "src/typescript-resolution.test.ts": 562,
65
+ "src/executors/bounded-exec/runner-hook.test.ts": 543,
66
+ "src/task-graph-policy.nx.test.ts": 512,
67
+ "src/nx-store-resolution.test.ts": 485,
68
+ "src/nx-failure-life-cycles.test.ts": 450,
69
+ "src/bun-bootstrap.test.ts": 414,
70
+ "src/nx-daemon-root-normalization.test.ts": 407,
71
+ "src/managed-files/github-host-cache-isolation.test.ts": 356,
72
+ "src/nx-incomplete-run-summary.test.ts": 346,
73
+ "src/nx-critical-path-schedule.test.ts": 315,
74
+ "src/nx-raw-inputs.test.ts": 275,
75
+ "src/nx-cache-bound.test.ts": 248,
76
+ "src/ensure-built-witness.test.ts": 237,
77
+ "src/test-clock-policy.test.ts": 230,
78
+ "src/managed-files/unserved-workspace-hooks.test.ts": 215,
79
+ "src/executors/bounded-exec/cpu-pool.test.ts": 212,
80
+ "src/package-target-policy.test.ts": 211,
81
+ "src/executors/cargo-zigbuild/executor.test.ts": 194,
82
+ "src/lock-scope.test.ts": 135,
83
+ "src/managed-files/cache-ttsc-plugins.test.ts": 116,
84
+ "src/forbidden-spelling-policy.test.ts": 115,
85
+ "src/managed-files/devenv-wrapper.test.ts": 103,
86
+ "src/executors/bounded-exec/runtime-pin.test.ts": 99,
87
+ "src/nx-state-location.test.ts": 88,
88
+ "src/managed-files/setup-devenv-free-disk.test.ts": 86,
89
+ "src/generators/make-public/generator.test.ts": 85,
90
+ "src/test-timings.test.ts": 85,
91
+ "src/cargo-closure-filesets.test.ts": 83,
92
+ "src/executors/scriptc-native/executor.test.ts": 80,
93
+ "src/executors/wrangler-deploy/executor.test.ts": 70,
94
+ "src/producer-receipts.test.ts": 60,
95
+ "src/release-config-policy.test.ts": 56,
96
+ "src/version-actions.test.ts": 53,
97
+ "src/manifest-hash.test.ts": 49,
98
+ "src/workspace-config-policy.test.ts": 47,
99
+ "src/executors/wrangler-deploy/hasher.test.ts": 39,
100
+ "src/generators/create-package/generator.test.ts": 33,
101
+ "src/cargo-toolchain-paths.test.ts": 31,
102
+ "src/eslint-sources.test.ts": 31,
103
+ "src/executors/bounded-exec/test-results.test.ts": 30,
104
+ "src/managed-files/trace-db-artifact.test.ts": 30,
102
105
  "src/executors/nextest-group/executor.test.ts": 28,
103
- "src/executors/bounded-exec/ram-temp-held.test.ts": 25,
104
- "src/managed-files/trace-db-artifact.test.ts": 25,
105
- "src/executors/clean-outputs/executor.test.ts": 23,
106
- "src/managed-files/json-edit.test.ts": 22,
107
- "src/generators/bun-test-tracing/generator.test.ts": 21,
108
- "src/generators/create-package/generator.test.ts": 20,
109
- "src/generators/bounded-test-targets/generator.test.ts": 17,
110
- "src/executors/bounded-exec/ram-detach.test.ts": 15,
111
- "src/cargo-closure-input.property.test.ts": 14,
112
- "src/nx-daemon-idle-cpu.test.ts": 14,
113
- "src/task-graph-policy.test.ts": 13,
114
- "src/disk-command-policy.test.ts": 12,
115
- "src/executors/bounded-exec/lock-wait.test.ts": 11,
116
- "src/managed-files/tree.test.ts": 11,
117
- "src/nx-project-resolution-cache.test.ts": 11,
118
- "src/test-program.test.ts": 11,
119
- "src/host-controller-wiring.test.ts": 9,
120
- "src/managed-files/managed-content.test.ts": 9,
121
- "src/nx-run-information.test.ts": 9,
122
- "src/nx-task-graph-cycles.test.ts": 8,
123
- "src/bun-file-packages.test.ts": 7,
124
- "src/executors/bounded-exec/progress.test.ts": 7,
125
- "src/executors/bounded-exec/ram-fixture.test.ts": 6,
126
- "src/executors/bounded-exec/runner-lifecycle.test.ts": 6,
127
- "src/executors/bounded-exec/runner-sizing.test.ts": 6,
128
- "src/executors/bounded-exec/mbx-pool.test.ts": 5,
129
- "src/cargo-retention-hook.test.ts": 5,
130
- "src/executors/bounded-exec/owned-subtree.test.ts": 5,
131
- "src/executors/bounded-exec/bounds.test.ts": 3
106
+ "src/executors/bounded-exec/disk-lease.test.ts": 27,
107
+ "src/executors/bounded-exec/ram-provenance.test.ts": 27,
108
+ "src/executors/bounded-exec/progress.test.ts": 26,
109
+ "src/executors/bounded-exec/ram-detach.test.ts": 25,
110
+ "src/generators/bun-test-tracing/generator.test.ts": 25,
111
+ "src/executors/bounded-exec/mbx-queue.test.ts": 24,
112
+ "src/build-state-output-policy.test.ts": 21,
113
+ "src/generators/bounded-test-targets/generator.test.ts": 21,
114
+ "src/executors/bounded-exec/bounds.test.ts": 20,
115
+ "src/executors/bounded-exec/runner-sizing.test.ts": 19,
116
+ "src/executors/bounded-exec/lock-wait.test.ts": 17,
117
+ "src/executors/bounded-exec/ram-temp-held.test.ts": 17,
118
+ "src/executors/bounded-exec/runner-lifecycle.test.ts": 17,
119
+ "src/managed-files/json-edit.test.ts": 17,
120
+ "src/executors/bounded-exec/mbx-pool.test.ts": 15,
121
+ "src/executors/bounded-exec/ram-fixture.test.ts": 14,
122
+ "src/managed-files/tree-permissions.test.ts": 12,
123
+ "src/managed-files/tree.test.ts": 12,
124
+ "src/wait-why-policy.test.ts": 12,
125
+ "src/executors/bounded-exec/owned-subtree.test.ts": 11,
126
+ "src/cargo-closure-input.property.test.ts": 10,
127
+ "src/managed-files/managed-content.test.ts": 10,
128
+ "src/nx-daemon-idle-cpu.test.ts": 10,
129
+ "src/task-graph-policy.test.ts": 10,
130
+ "src/disk-command-policy.test.ts": 9,
131
+ "src/test-program.test.ts": 9,
132
+ "src/bun-file-packages.test.ts": 8,
133
+ "src/cargo-retention-hook.test.ts": 8,
134
+ "src/host-controller-wiring.test.ts": 8,
135
+ "src/nx-project-resolution-cache.test.ts": 8,
136
+ "src/nx-task-graph-cycles.test.ts": 7,
137
+ "src/nx-run-information.test.ts": 6
132
138
  }
133
139
  }
@@ -1,26 +0,0 @@
1
- import type { CleanOutputsOptions } from './schema.js';
2
- interface CleanOutputsContext {
3
- root: string;
4
- projectName?: string;
5
- projectsConfigurations?: {
6
- projects: Record<string, NxProject>;
7
- };
8
- }
9
- interface CleanOutputsResult {
10
- success: boolean;
11
- }
12
- interface NxProject {
13
- root?: string;
14
- targets?: Record<string, {
15
- outputs?: string[];
16
- }>;
17
- }
18
- export default function cleanOutputsExecutor(options: CleanOutputsOptions, context: CleanOutputsContext): Promise<CleanOutputsResult>;
19
- export declare function resolveOutputDirs(options: {
20
- outputs: string[];
21
- projectName: string;
22
- projectRoot: string;
23
- workspaceRoot: string;
24
- }): string[];
25
- export {};
26
- //# sourceMappingURL=executor.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"executor.d.ts","sourceRoot":"","sources":["../../../src/executors/clean-outputs/executor.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAEvD,UAAU,mBAAmB;IAC3B,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,sBAAsB,CAAC,EAAE;QACvB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,SAAS,CAAC,CAAC;KACrC,CAAC;CACH;AAED,UAAU,kBAAkB;IAC1B,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,UAAU,SAAS;IACjB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE;QAAE,OAAO,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC,CAAC;CAClD;AAED,wBAA8B,oBAAoB,CAChD,OAAO,EAAE,mBAAmB,EAC5B,OAAO,EAAE,mBAAmB,GAC3B,OAAO,CAAC,kBAAkB,CAAC,CA8B7B;AAED,wBAAgB,iBAAiB,CAAC,OAAO,EAAE;IACzC,OAAO,EAAE,MAAM,EAAE,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,WAAW,EAAE,MAAM,CAAC;IACpB,aAAa,EAAE,MAAM,CAAC;CACvB,GAAG,MAAM,EAAE,CAOX"}
@@ -1,83 +0,0 @@
1
- import { spawnSync } from 'node:child_process';
2
- import { rm } from 'node:fs/promises';
3
- import path from 'node:path';
4
- export default async function cleanOutputsExecutor(options, context) {
5
- const projectName = context.projectName;
6
- if (!projectName) {
7
- throw new Error('@smoothbricks/nx-plugin:clean-outputs requires a project context.');
8
- }
9
- const workspaceRoot = context.root;
10
- const project = context.projectsConfigurations?.projects[projectName];
11
- if (!project) {
12
- throw new Error(`Project ${projectName} was not found in the Nx project graph.`);
13
- }
14
- const outputDirs = resolveOutputDirs({
15
- outputs: options.outputs ?? project.targets?.build?.outputs ?? ['{projectRoot}/dist'],
16
- projectName,
17
- projectRoot: project.root ?? '.',
18
- workspaceRoot,
19
- });
20
- for (const outputDir of outputDirs) {
21
- assertSafeOutputDir(outputDir, project.root ?? '.', workspaceRoot);
22
- if (containsTrackedFiles(outputDir, workspaceRoot)) {
23
- console.log(`skipped ${path.relative(workspaceRoot, outputDir)} (contains tracked files)`);
24
- continue;
25
- }
26
- await rm(outputDir, { force: true, recursive: true });
27
- console.log(`removed ${path.relative(workspaceRoot, outputDir)}`);
28
- }
29
- return { success: true };
30
- }
31
- export function resolveOutputDirs(options) {
32
- const concreteOutputDirs = options.outputs.map((output) => outputDir(output, options));
33
- const dedupedOutputDirs = [...new Set(concreteOutputDirs)].sort((a, b) => a.length - b.length);
34
- return dedupedOutputDirs.filter((candidate, index) => !dedupedOutputDirs.some((other, otherIndex) => otherIndex < index && isWithin(candidate, other)));
35
- }
36
- function outputDir(output, options) {
37
- const interpolated = output
38
- .replaceAll('{workspaceRoot}', '.')
39
- .replaceAll('{projectRoot}', options.projectRoot)
40
- .replaceAll('{projectName}', options.projectName);
41
- const segments = interpolated.split(/[\\/]/);
42
- const globIndex = segments.findIndex((segment) => segment.includes('*'));
43
- const dirSegments = globIndex === -1 ? segments : segments.slice(0, globIndex);
44
- const outputPath = dirSegments.join(path.sep);
45
- return path.resolve(options.workspaceRoot, outputPath);
46
- }
47
- function assertSafeOutputDir(outputDir, projectRoot, workspaceRoot) {
48
- const absoluteWorkspaceRoot = path.resolve(workspaceRoot);
49
- const absoluteProjectRoot = path.resolve(workspaceRoot, projectRoot);
50
- if (!isWithin(outputDir, absoluteWorkspaceRoot)) {
51
- throw new Error(`Refusing to remove output outside workspace: ${outputDir}`);
52
- }
53
- if (outputDir === absoluteWorkspaceRoot || outputDir === absoluteProjectRoot) {
54
- throw new Error(`Refusing to remove unsafe output directory: ${path.relative(workspaceRoot, outputDir) || '.'}`);
55
- }
56
- }
57
- function isWithin(candidate, parent) {
58
- const relative = path.relative(parent, candidate);
59
- return relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative));
60
- }
61
- function containsTrackedFiles(outputDir, workspaceRoot) {
62
- const relativeOutputDir = path.relative(workspaceRoot, outputDir);
63
- // eslint-disable-next-line deadline/no-unbounded-wait -- WHY unbounded: a local git file listing whose length is its own read of this repository: it asks no remote, and a held index.lock fails it at once rather than waiting, so only the operator's interrupt ends a hung one
64
- const result = spawnSync('git', ['ls-files', '--', relativeOutputDir], {
65
- cwd: workspaceRoot,
66
- encoding: 'utf8',
67
- });
68
- const command = `git ls-files -- ${relativeOutputDir}`;
69
- if (typeof result.stdout === 'string' && result.stdout.length > 0) {
70
- process.stdout.write(result.stdout);
71
- }
72
- if (typeof result.stderr === 'string' && result.stderr.length > 0) {
73
- process.stderr.write(result.stderr);
74
- }
75
- if (result.error) {
76
- console.error(result.error.message);
77
- throw new Error(`${command} failed with exit code ${result.status ?? 1}`, { cause: result.error });
78
- }
79
- if (result.status !== 0) {
80
- throw new Error(`${command} failed with exit code ${result.status ?? 1}`);
81
- }
82
- return result.stdout.trim().length > 0;
83
- }
@@ -1,4 +0,0 @@
1
- export interface CleanOutputsOptions {
2
- outputs?: string[];
3
- }
4
- //# sourceMappingURL=schema.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"schema.d.ts","sourceRoot":"","sources":["../../../src/executors/clean-outputs/schema.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,EAAE,CAAC;CACpB"}
@@ -1,131 +0,0 @@
1
- import { spawnSync } from 'node:child_process';
2
- import { rm } from 'node:fs/promises';
3
- import path from 'node:path';
4
-
5
- import type { CleanOutputsOptions } from './schema.js';
6
-
7
- interface CleanOutputsContext {
8
- root: string;
9
- projectName?: string;
10
- projectsConfigurations?: {
11
- projects: Record<string, NxProject>;
12
- };
13
- }
14
-
15
- interface CleanOutputsResult {
16
- success: boolean;
17
- }
18
-
19
- interface NxProject {
20
- root?: string;
21
- targets?: Record<string, { outputs?: string[] }>;
22
- }
23
-
24
- export default async function cleanOutputsExecutor(
25
- options: CleanOutputsOptions,
26
- context: CleanOutputsContext,
27
- ): Promise<CleanOutputsResult> {
28
- const projectName = context.projectName;
29
- if (!projectName) {
30
- throw new Error('@smoothbricks/nx-plugin:clean-outputs requires a project context.');
31
- }
32
-
33
- const workspaceRoot = context.root;
34
- const project = context.projectsConfigurations?.projects[projectName];
35
- if (!project) {
36
- throw new Error(`Project ${projectName} was not found in the Nx project graph.`);
37
- }
38
-
39
- const outputDirs = resolveOutputDirs({
40
- outputs: options.outputs ?? project.targets?.build?.outputs ?? ['{projectRoot}/dist'],
41
- projectName,
42
- projectRoot: project.root ?? '.',
43
- workspaceRoot,
44
- });
45
-
46
- for (const outputDir of outputDirs) {
47
- assertSafeOutputDir(outputDir, project.root ?? '.', workspaceRoot);
48
- if (containsTrackedFiles(outputDir, workspaceRoot)) {
49
- console.log(`skipped ${path.relative(workspaceRoot, outputDir)} (contains tracked files)`);
50
- continue;
51
- }
52
- await rm(outputDir, { force: true, recursive: true });
53
- console.log(`removed ${path.relative(workspaceRoot, outputDir)}`);
54
- }
55
-
56
- return { success: true };
57
- }
58
-
59
- export function resolveOutputDirs(options: {
60
- outputs: string[];
61
- projectName: string;
62
- projectRoot: string;
63
- workspaceRoot: string;
64
- }): string[] {
65
- const concreteOutputDirs = options.outputs.map((output) => outputDir(output, options));
66
- const dedupedOutputDirs = [...new Set(concreteOutputDirs)].sort((a, b) => a.length - b.length);
67
- return dedupedOutputDirs.filter(
68
- (candidate, index) =>
69
- !dedupedOutputDirs.some((other, otherIndex) => otherIndex < index && isWithin(candidate, other)),
70
- );
71
- }
72
-
73
- function outputDir(
74
- output: string,
75
- options: { projectName: string; projectRoot: string; workspaceRoot: string },
76
- ): string {
77
- const interpolated = output
78
- .replaceAll('{workspaceRoot}', '.')
79
- .replaceAll('{projectRoot}', options.projectRoot)
80
- .replaceAll('{projectName}', options.projectName);
81
-
82
- const segments = interpolated.split(/[\\/]/);
83
- const globIndex = segments.findIndex((segment) => segment.includes('*'));
84
- const dirSegments = globIndex === -1 ? segments : segments.slice(0, globIndex);
85
- const outputPath = dirSegments.join(path.sep);
86
-
87
- return path.resolve(options.workspaceRoot, outputPath);
88
- }
89
-
90
- function assertSafeOutputDir(outputDir: string, projectRoot: string, workspaceRoot: string): void {
91
- const absoluteWorkspaceRoot = path.resolve(workspaceRoot);
92
- const absoluteProjectRoot = path.resolve(workspaceRoot, projectRoot);
93
-
94
- if (!isWithin(outputDir, absoluteWorkspaceRoot)) {
95
- throw new Error(`Refusing to remove output outside workspace: ${outputDir}`);
96
- }
97
-
98
- if (outputDir === absoluteWorkspaceRoot || outputDir === absoluteProjectRoot) {
99
- throw new Error(`Refusing to remove unsafe output directory: ${path.relative(workspaceRoot, outputDir) || '.'}`);
100
- }
101
- }
102
-
103
- function isWithin(candidate: string, parent: string): boolean {
104
- const relative = path.relative(parent, candidate);
105
- return relative === '' || (!relative.startsWith('..') && !path.isAbsolute(relative));
106
- }
107
-
108
- function containsTrackedFiles(outputDir: string, workspaceRoot: string): boolean {
109
- const relativeOutputDir = path.relative(workspaceRoot, outputDir);
110
- // eslint-disable-next-line deadline/no-unbounded-wait -- WHY unbounded: a local git file listing whose length is its own read of this repository: it asks no remote, and a held index.lock fails it at once rather than waiting, so only the operator's interrupt ends a hung one
111
- const result = spawnSync('git', ['ls-files', '--', relativeOutputDir], {
112
- cwd: workspaceRoot,
113
- encoding: 'utf8',
114
- });
115
- const command = `git ls-files -- ${relativeOutputDir}`;
116
- if (typeof result.stdout === 'string' && result.stdout.length > 0) {
117
- process.stdout.write(result.stdout);
118
- }
119
- if (typeof result.stderr === 'string' && result.stderr.length > 0) {
120
- process.stderr.write(result.stderr);
121
- }
122
- if (result.error) {
123
- console.error(result.error.message);
124
- throw new Error(`${command} failed with exit code ${result.status ?? 1}`, { cause: result.error });
125
- }
126
- if (result.status !== 0) {
127
- throw new Error(`${command} failed with exit code ${result.status ?? 1}`);
128
- }
129
-
130
- return result.stdout.trim().length > 0;
131
- }
@@ -1,15 +0,0 @@
1
- {
2
- "$schema": "https://json-schema.org/schema",
3
- "version": 2,
4
- "title": "Clean Outputs Executor",
5
- "description": "Remove declared build output directories unless they contain tracked files.",
6
- "type": "object",
7
- "properties": {
8
- "outputs": {
9
- "type": "array",
10
- "items": { "type": "string" },
11
- "description": "Optional output patterns. Defaults to the project's build outputs, then {projectRoot}/dist."
12
- }
13
- },
14
- "additionalProperties": false
15
- }
@@ -1,3 +0,0 @@
1
- export interface CleanOutputsOptions {
2
- outputs?: string[];
3
- }