@venizia/dev-configs 0.4.6 → 0.4.7-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (199) hide show
  1. package/LICENSE.md +1 -3
  2. package/README.md +1 -1
  3. package/dist/checks/catalog.d.ts +4 -2
  4. package/dist/checks/catalog.d.ts.map +1 -1
  5. package/dist/checks/catalog.js +72 -68
  6. package/dist/checks/catalog.js.map +1 -1
  7. package/dist/checks/module-cycles.d.ts +11 -9
  8. package/dist/checks/module-cycles.d.ts.map +1 -1
  9. package/dist/checks/module-cycles.js +32 -30
  10. package/dist/checks/module-cycles.js.map +1 -1
  11. package/dist/checks/purity/manifest.d.ts +44 -38
  12. package/dist/checks/purity/manifest.d.ts.map +1 -1
  13. package/dist/checks/purity/manifest.js +121 -115
  14. package/dist/checks/purity/manifest.js.map +1 -1
  15. package/dist/checks/purity/probe.d.ts +22 -18
  16. package/dist/checks/purity/probe.d.ts.map +1 -1
  17. package/dist/checks/purity/probe.js +101 -99
  18. package/dist/checks/purity/probe.js.map +1 -1
  19. package/dist/checks/purity/run.d.ts +18 -16
  20. package/dist/checks/purity/run.d.ts.map +1 -1
  21. package/dist/checks/purity/run.js +90 -86
  22. package/dist/checks/purity/run.js.map +1 -1
  23. package/dist/checks/test-controls.d.ts +17 -15
  24. package/dist/checks/test-controls.d.ts.map +1 -1
  25. package/dist/checks/test-controls.js +71 -69
  26. package/dist/checks/test-controls.js.map +1 -1
  27. package/dist/checks/test-dead-code.d.ts +5 -3
  28. package/dist/checks/test-dead-code.d.ts.map +1 -1
  29. package/dist/checks/test-dead-code.js +23 -21
  30. package/dist/checks/test-dead-code.js.map +1 -1
  31. package/dist/checks/test-mutate.d.ts +12 -7
  32. package/dist/checks/test-mutate.d.ts.map +1 -1
  33. package/dist/checks/test-mutate.js +59 -56
  34. package/dist/checks/test-mutate.js.map +1 -1
  35. package/dist/checks/test-weight.d.ts +11 -8
  36. package/dist/checks/test-weight.d.ts.map +1 -1
  37. package/dist/checks/test-weight.js +98 -94
  38. package/dist/checks/test-weight.js.map +1 -1
  39. package/dist/cli/check.d.ts.map +1 -1
  40. package/dist/cli/check.js +11 -8
  41. package/dist/cli/check.js.map +1 -1
  42. package/dist/cli/codemod/async-style.d.ts +62 -0
  43. package/dist/cli/codemod/async-style.d.ts.map +1 -0
  44. package/dist/cli/codemod/async-style.js +248 -0
  45. package/dist/cli/codemod/async-style.js.map +1 -0
  46. package/dist/cli/codemod/const-classes.d.ts.map +1 -1
  47. package/dist/cli/codemod/const-classes.js +2 -1
  48. package/dist/cli/codemod/const-classes.js.map +1 -1
  49. package/dist/cli/codemod/drop-redundant-casts.d.ts.map +1 -1
  50. package/dist/cli/codemod/drop-redundant-casts.js +2 -1
  51. package/dist/cli/codemod/drop-redundant-casts.js.map +1 -1
  52. package/dist/cli/codemod/files.d.ts +7 -0
  53. package/dist/cli/codemod/files.d.ts.map +1 -1
  54. package/dist/cli/codemod/files.js +33 -0
  55. package/dist/cli/codemod/files.js.map +1 -1
  56. package/dist/cli/codemod/index.d.ts.map +1 -1
  57. package/dist/cli/codemod/index.js +12 -3
  58. package/dist/cli/codemod/index.js.map +1 -1
  59. package/dist/cli/codemod/model-settings.d.ts +7 -5
  60. package/dist/cli/codemod/model-settings.d.ts.map +1 -1
  61. package/dist/cli/codemod/model-settings.js +293 -291
  62. package/dist/cli/codemod/model-settings.js.map +1 -1
  63. package/dist/cli/codemod/namespace-functions/index.d.ts +20 -0
  64. package/dist/cli/codemod/namespace-functions/index.d.ts.map +1 -0
  65. package/dist/cli/codemod/namespace-functions/index.js +182 -0
  66. package/dist/cli/codemod/namespace-functions/index.js.map +1 -0
  67. package/dist/cli/codemod/namespace-functions/logger-scope.d.ts +32 -0
  68. package/dist/cli/codemod/namespace-functions/logger-scope.d.ts.map +1 -0
  69. package/dist/cli/codemod/namespace-functions/logger-scope.js +128 -0
  70. package/dist/cli/codemod/namespace-functions/logger-scope.js.map +1 -0
  71. package/dist/cli/codemod/namespace-functions/mapping.d.ts +66 -0
  72. package/dist/cli/codemod/namespace-functions/mapping.d.ts.map +1 -0
  73. package/dist/cli/codemod/namespace-functions/mapping.js +99 -0
  74. package/dist/cli/codemod/namespace-functions/mapping.js.map +1 -0
  75. package/dist/cli/codemod/namespace-functions/mappings/boot.d.ts +7 -0
  76. package/dist/cli/codemod/namespace-functions/mappings/boot.d.ts.map +1 -0
  77. package/dist/cli/codemod/namespace-functions/mappings/boot.js +28 -0
  78. package/dist/cli/codemod/namespace-functions/mappings/boot.js.map +1 -0
  79. package/dist/cli/codemod/namespace-functions/mappings/connectors.d.ts +4 -0
  80. package/dist/cli/codemod/namespace-functions/mappings/connectors.d.ts.map +1 -0
  81. package/dist/cli/codemod/namespace-functions/mappings/connectors.js +218 -0
  82. package/dist/cli/codemod/namespace-functions/mappings/connectors.js.map +1 -0
  83. package/dist/cli/codemod/namespace-functions/mappings/core-server.d.ts +7 -0
  84. package/dist/cli/codemod/namespace-functions/mappings/core-server.d.ts.map +1 -0
  85. package/dist/cli/codemod/namespace-functions/mappings/core-server.js +162 -0
  86. package/dist/cli/codemod/namespace-functions/mappings/core-server.js.map +1 -0
  87. package/dist/cli/codemod/namespace-functions/mappings/core-worker.d.ts +7 -0
  88. package/dist/cli/codemod/namespace-functions/mappings/core-worker.d.ts.map +1 -0
  89. package/dist/cli/codemod/namespace-functions/mappings/core-worker.js +18 -0
  90. package/dist/cli/codemod/namespace-functions/mappings/core-worker.js.map +1 -0
  91. package/dist/cli/codemod/namespace-functions/mappings/dev-configs.d.ts +7 -0
  92. package/dist/cli/codemod/namespace-functions/mappings/dev-configs.d.ts.map +1 -0
  93. package/dist/cli/codemod/namespace-functions/mappings/dev-configs.js +192 -0
  94. package/dist/cli/codemod/namespace-functions/mappings/dev-configs.js.map +1 -0
  95. package/dist/cli/codemod/namespace-functions/mappings/filter.d.ts +7 -0
  96. package/dist/cli/codemod/namespace-functions/mappings/filter.d.ts.map +1 -0
  97. package/dist/cli/codemod/namespace-functions/mappings/filter.js +30 -0
  98. package/dist/cli/codemod/namespace-functions/mappings/filter.js.map +1 -0
  99. package/dist/cli/codemod/namespace-functions/mappings/helpers.d.ts +16 -0
  100. package/dist/cli/codemod/namespace-functions/mappings/helpers.d.ts.map +1 -0
  101. package/dist/cli/codemod/namespace-functions/mappings/helpers.js +535 -0
  102. package/dist/cli/codemod/namespace-functions/mappings/helpers.js.map +1 -0
  103. package/dist/cli/codemod/namespace-functions/mappings/index.d.ts +4 -0
  104. package/dist/cli/codemod/namespace-functions/mappings/index.d.ts.map +1 -0
  105. package/dist/cli/codemod/namespace-functions/mappings/index.js +25 -0
  106. package/dist/cli/codemod/namespace-functions/mappings/index.js.map +1 -0
  107. package/dist/cli/codemod/namespace-functions/mappings/inversion.d.ts +10 -0
  108. package/dist/cli/codemod/namespace-functions/mappings/inversion.d.ts.map +1 -0
  109. package/dist/cli/codemod/namespace-functions/mappings/inversion.js +81 -0
  110. package/dist/cli/codemod/namespace-functions/mappings/inversion.js.map +1 -0
  111. package/dist/cli/codemod/namespace-functions/mappings/kernel.d.ts +17 -0
  112. package/dist/cli/codemod/namespace-functions/mappings/kernel.d.ts.map +1 -0
  113. package/dist/cli/codemod/namespace-functions/mappings/kernel.js +229 -0
  114. package/dist/cli/codemod/namespace-functions/mappings/kernel.js.map +1 -0
  115. package/dist/cli/codemod/namespace-functions/rewriter.d.ts +61 -0
  116. package/dist/cli/codemod/namespace-functions/rewriter.d.ts.map +1 -0
  117. package/dist/cli/codemod/namespace-functions/rewriter.js +564 -0
  118. package/dist/cli/codemod/namespace-functions/rewriter.js.map +1 -0
  119. package/dist/cli/index.js +2 -0
  120. package/dist/cli/index.js.map +1 -1
  121. package/dist/compilers/bun.d.ts +1 -1
  122. package/dist/compilers/bun.js +1 -1
  123. package/dist/compilers/bun.js.map +1 -1
  124. package/dist/linters/house/await-support.d.ts +74 -0
  125. package/dist/linters/house/await-support.d.ts.map +1 -0
  126. package/dist/linters/house/await-support.js +238 -0
  127. package/dist/linters/house/await-support.js.map +1 -0
  128. package/dist/linters/house/common.d.ts +15 -9
  129. package/dist/linters/house/common.d.ts.map +1 -1
  130. package/dist/linters/house/common.js +20 -15
  131. package/dist/linters/house/common.js.map +1 -1
  132. package/dist/linters/house/configs.d.ts +26 -0
  133. package/dist/linters/house/configs.d.ts.map +1 -1
  134. package/dist/linters/house/configs.js +55 -1
  135. package/dist/linters/house/configs.js.map +1 -1
  136. package/dist/linters/house/const-class-values.rule.d.ts.map +1 -1
  137. package/dist/linters/house/const-class-values.rule.js +27 -19
  138. package/dist/linters/house/const-class-values.rule.js.map +1 -1
  139. package/dist/linters/house/effect-cleanup-consistency.rule.d.ts +17 -0
  140. package/dist/linters/house/effect-cleanup-consistency.rule.d.ts.map +1 -0
  141. package/dist/linters/house/effect-cleanup-consistency.rule.js +87 -0
  142. package/dist/linters/house/effect-cleanup-consistency.rule.js.map +1 -0
  143. package/dist/linters/house/hook-support.d.ts +29 -0
  144. package/dist/linters/house/hook-support.d.ts.map +1 -0
  145. package/dist/linters/house/hook-support.js +72 -0
  146. package/dist/linters/house/hook-support.js.map +1 -0
  147. package/dist/linters/house/index.d.ts +9 -0
  148. package/dist/linters/house/index.d.ts.map +1 -1
  149. package/dist/linters/house/index.js +9 -0
  150. package/dist/linters/house/index.js.map +1 -1
  151. package/dist/linters/house/max-params-own.rule.d.ts.map +1 -1
  152. package/dist/linters/house/max-params-own.rule.js +33 -24
  153. package/dist/linters/house/max-params-own.rule.js.map +1 -1
  154. package/dist/linters/house/no-async-hook-callback.rule.d.ts +18 -0
  155. package/dist/linters/house/no-async-hook-callback.rule.d.ts.map +1 -0
  156. package/dist/linters/house/no-async-hook-callback.rule.js +50 -0
  157. package/dist/linters/house/no-async-hook-callback.rule.js.map +1 -0
  158. package/dist/linters/house/no-await-promise-chain.rule.d.ts +24 -0
  159. package/dist/linters/house/no-await-promise-chain.rule.d.ts.map +1 -0
  160. package/dist/linters/house/no-await-promise-chain.rule.js +298 -0
  161. package/dist/linters/house/no-await-promise-chain.rule.js.map +1 -0
  162. package/dist/linters/house/no-inline-await.rule.d.ts +20 -0
  163. package/dist/linters/house/no-inline-await.rule.d.ts.map +1 -0
  164. package/dist/linters/house/no-inline-await.rule.js +70 -0
  165. package/dist/linters/house/no-inline-await.rule.js.map +1 -0
  166. package/dist/linters/house/no-new-error.rule.js +4 -4
  167. package/dist/linters/house/no-new-error.rule.js.map +1 -1
  168. package/dist/linters/house/no-return-await.rule.d.ts +15 -0
  169. package/dist/linters/house/no-return-await.rule.d.ts.map +1 -0
  170. package/dist/linters/house/no-return-await.rule.js +92 -0
  171. package/dist/linters/house/no-return-await.rule.js.map +1 -0
  172. package/dist/linters/house/no-silent-catch.rule.d.ts +22 -0
  173. package/dist/linters/house/no-silent-catch.rule.d.ts.map +1 -0
  174. package/dist/linters/house/no-silent-catch.rule.js +88 -0
  175. package/dist/linters/house/no-silent-catch.rule.js.map +1 -0
  176. package/dist/linters/house/plugin.d.ts.map +1 -1
  177. package/dist/linters/house/plugin.js +12 -0
  178. package/dist/linters/house/plugin.js.map +1 -1
  179. package/dist/linters/house/promise-chain-support.d.ts +49 -0
  180. package/dist/linters/house/promise-chain-support.d.ts.map +1 -0
  181. package/dist/linters/house/promise-chain-support.js +188 -0
  182. package/dist/linters/house/promise-chain-support.js.map +1 -0
  183. package/dist/linters/rules/no-restricted-properties.rule.js +1 -1
  184. package/dist/linters/rules/no-restricted-properties.rule.js.map +1 -1
  185. package/dist/testing/rejection.helper.d.ts +25 -20
  186. package/dist/testing/rejection.helper.d.ts.map +1 -1
  187. package/dist/testing/rejection.helper.js +33 -31
  188. package/dist/testing/rejection.helper.js.map +1 -1
  189. package/dist/testing/repo-tmp.d.ts +19 -9
  190. package/dist/testing/repo-tmp.d.ts.map +1 -1
  191. package/dist/testing/repo-tmp.js +50 -48
  192. package/dist/testing/repo-tmp.js.map +1 -1
  193. package/dist/testing/spawn.helper.d.ts +12 -10
  194. package/dist/testing/spawn.helper.d.ts.map +1 -1
  195. package/dist/testing/spawn.helper.js +22 -16
  196. package/dist/testing/spawn.helper.js.map +1 -1
  197. package/dist/testing/tmpdir-preload.js +1 -1
  198. package/dist/testing/tmpdir-preload.js.map +1 -1
  199. package/package.json +2 -3
@@ -1,37 +1,39 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.expectRejection = exports.rejectionOf = void 0;
3
+ exports.RejectionHelper = void 0;
4
4
  const bun_test_1 = require("bun:test");
5
- /**
6
- * Awaits a task that must reject and returns what it rejected with; throws when the task resolves.
7
- *
8
- * bun types the async matchers (`expect(task).rejects` / `.resolves`) as `void`, so
9
- * `await expect(task).rejects.toThrow()` is refused by `await-thenable` - and left un-awaited the
10
- * assertion never runs. Awaiting the task itself needs no matcher and no cast:
11
- * `expectRejection({ task, message })` or `expect(await rejectionOf(task)).toBeInstanceOf(Error)`,
12
- * and for a resolution `expect(await task).toMatchObject(...)`.
13
- */
14
- const rejectionOf = async (task) => {
15
- try {
16
- await task;
5
+ class RejectionHelper {
6
+ /**
7
+ * Awaits a task that must reject and returns what it rejected with; throws when the task resolves.
8
+ *
9
+ * bun types the async matchers (`expect(task).rejects` / `.resolves`) as `void`, so
10
+ * `await expect(task).rejects.toThrow()` is refused by `await-thenable` - and left un-awaited the
11
+ * assertion never runs. Awaiting the task itself needs no matcher and no cast:
12
+ * `RejectionHelper.expectRejection({ task, message })` or
13
+ * `expect(await RejectionHelper.rejectionOf({ task })).toBeInstanceOf(Error)`,
14
+ * and for a resolution `expect(await task).toMatchObject(...)`.
15
+ */
16
+ static async rejectionOf(opts) {
17
+ try {
18
+ await opts.task;
19
+ }
20
+ catch (error) {
21
+ return error;
22
+ }
23
+ return bun_test_1.expect.unreachable('Expected the task to reject, but it resolved');
17
24
  }
18
- catch (error) {
19
- return error;
25
+ /**
26
+ * The task rejects with an Error whose message contains `message` (a string) or matches it (a
27
+ * RegExp). The message is compared as a string on purpose: bun 1.4.2 `toMatchObject` with an
28
+ * asymmetric matcher overwrites the matched property on the object it checks, so a later read of
29
+ * `error.message` gets the matcher back.
30
+ */
31
+ static async expectRejection(opts) {
32
+ const { task, message } = opts;
33
+ const reason = await RejectionHelper.rejectionOf({ task });
34
+ (0, bun_test_1.expect)(reason).toBeInstanceOf(Error);
35
+ (0, bun_test_1.expect)(reason instanceof Error ? reason.message : String(reason)).toMatch(message);
20
36
  }
21
- return bun_test_1.expect.unreachable('Expected the task to reject, but it resolved');
22
- };
23
- exports.rejectionOf = rejectionOf;
24
- /**
25
- * The task rejects with an Error whose message contains `message` (a string) or matches it (a
26
- * RegExp). The message is compared as a string on purpose: bun 1.4.2 `toMatchObject` with an
27
- * asymmetric matcher overwrites the matched property on the object it checks, so a later read of
28
- * `error.message` gets the matcher back.
29
- */
30
- const expectRejection = async (opts) => {
31
- const { task, message } = opts;
32
- const reason = await (0, exports.rejectionOf)(task);
33
- (0, bun_test_1.expect)(reason).toBeInstanceOf(Error);
34
- (0, bun_test_1.expect)(reason instanceof Error ? reason.message : String(reason)).toMatch(message);
35
- };
36
- exports.expectRejection = expectRejection;
37
+ }
38
+ exports.RejectionHelper = RejectionHelper;
37
39
  //# sourceMappingURL=rejection.helper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"rejection.helper.js","sourceRoot":"","sources":["../../src/testing/rejection.helper.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAElC;;;;;;;;GAQG;AACI,MAAM,WAAW,GAAG,KAAK,EAAE,IAAsB,EAAoB,EAAE;IAC5E,IAAI,CAAC;QACH,MAAM,IAAI,CAAC;IACb,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,KAAK,CAAC;IACf,CAAC;IAED,OAAO,iBAAM,CAAC,WAAW,CAAC,8CAA8C,CAAC,CAAC;AAC5E,CAAC,CAAC;AARW,QAAA,WAAW,eAQtB;AAEF;;;;;GAKG;AACI,MAAM,eAAe,GAAG,KAAK,EAAE,IAGrC,EAAiB,EAAE;IAClB,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAC/B,MAAM,MAAM,GAAG,MAAM,IAAA,mBAAW,EAAC,IAAI,CAAC,CAAC;IAEvC,IAAA,iBAAM,EAAC,MAAM,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;IACrC,IAAA,iBAAM,EAAC,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;AACrF,CAAC,CAAC;AATW,QAAA,eAAe,mBAS1B","sourcesContent":["import { expect } from 'bun:test';\n\n/**\n * Awaits a task that must reject and returns what it rejected with; throws when the task resolves.\n *\n * bun types the async matchers (`expect(task).rejects` / `.resolves`) as `void`, so\n * `await expect(task).rejects.toThrow()` is refused by `await-thenable` - and left un-awaited the\n * assertion never runs. Awaiting the task itself needs no matcher and no cast:\n * `expectRejection({ task, message })` or `expect(await rejectionOf(task)).toBeInstanceOf(Error)`,\n * and for a resolution `expect(await task).toMatchObject(...)`.\n */\nexport const rejectionOf = async (task: Promise<unknown>): Promise<unknown> => {\n try {\n await task;\n } catch (error) {\n return error;\n }\n\n return expect.unreachable('Expected the task to reject, but it resolved');\n};\n\n/**\n * The task rejects with an Error whose message contains `message` (a string) or matches it (a\n * RegExp). The message is compared as a string on purpose: bun 1.4.2 `toMatchObject` with an\n * asymmetric matcher overwrites the matched property on the object it checks, so a later read of\n * `error.message` gets the matcher back.\n */\nexport const expectRejection = async (opts: {\n task: Promise<unknown>;\n message: string | RegExp;\n}): Promise<void> => {\n const { task, message } = opts;\n const reason = await rejectionOf(task);\n\n expect(reason).toBeInstanceOf(Error);\n expect(reason instanceof Error ? reason.message : String(reason)).toMatch(message);\n};\n"]}
1
+ {"version":3,"file":"rejection.helper.js","sourceRoot":"","sources":["../../src/testing/rejection.helper.ts"],"names":[],"mappings":";;;AAAA,uCAAkC;AAElC,MAAa,eAAe;IAC1B;;;;;;;;;OASG;IACH,MAAM,CAAC,KAAK,CAAC,WAAW,CAAC,IAAgC;QACvD,IAAI,CAAC;YACH,MAAM,IAAI,CAAC,IAAI,CAAC;QAClB,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,OAAO,KAAK,CAAC;QACf,CAAC;QAED,OAAO,iBAAM,CAAC,WAAW,CAAC,8CAA8C,CAAC,CAAC;IAC5E,CAAC;IAED;;;;;OAKG;IACH,MAAM,CAAC,KAAK,CAAC,eAAe,CAAC,IAG5B;QACC,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;QAC/B,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,WAAW,CAAC,EAAE,IAAI,EAAE,CAAC,CAAC;QAE3D,IAAA,iBAAM,EAAC,MAAM,CAAC,CAAC,cAAc,CAAC,KAAK,CAAC,CAAC;QACrC,IAAA,iBAAM,EAAC,MAAM,YAAY,KAAK,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC;IACrF,CAAC;CACF;AArCD,0CAqCC","sourcesContent":["import { expect } from 'bun:test';\n\nexport class RejectionHelper {\n /**\n * Awaits a task that must reject and returns what it rejected with; throws when the task resolves.\n *\n * bun types the async matchers (`expect(task).rejects` / `.resolves`) as `void`, so\n * `await expect(task).rejects.toThrow()` is refused by `await-thenable` - and left un-awaited the\n * assertion never runs. Awaiting the task itself needs no matcher and no cast:\n * `RejectionHelper.expectRejection({ task, message })` or\n * `expect(await RejectionHelper.rejectionOf({ task })).toBeInstanceOf(Error)`,\n * and for a resolution `expect(await task).toMatchObject(...)`.\n */\n static async rejectionOf(opts: { task: Promise<unknown> }): Promise<unknown> {\n try {\n await opts.task;\n } catch (error) {\n return error;\n }\n\n return expect.unreachable('Expected the task to reject, but it resolved');\n }\n\n /**\n * The task rejects with an Error whose message contains `message` (a string) or matches it (a\n * RegExp). The message is compared as a string on purpose: bun 1.4.2 `toMatchObject` with an\n * asymmetric matcher overwrites the matched property on the object it checks, so a later read of\n * `error.message` gets the matcher back.\n */\n static async expectRejection(opts: {\n task: Promise<unknown>;\n message: string | RegExp;\n }): Promise<void> {\n const { task, message } = opts;\n const reason = await RejectionHelper.rejectionOf({ task });\n\n expect(reason).toBeInstanceOf(Error);\n expect(reason instanceof Error ? reason.message : String(reason)).toMatch(message);\n }\n}\n"]}
@@ -1,12 +1,22 @@
1
1
  /** The folder under the repository root that holds a test run's temp folders. */
2
2
  export declare const REPO_TMP_DIRECTORY: string;
3
- /** The nearest ancestor of `start` that holds a `.git` (folder or file); `start` itself when there is none. */
4
- export declare const findRepositoryRoot: (start?: string) => string;
5
- /**
6
- * Points TMPDIR at the repository's test folder unless it is already inside it (make's value, or a
7
- * private folder a caller made there), and returns the folder now in force. Idempotent.
8
- */
9
- export declare const useRepoTmp: (opts?: {
10
- root?: string;
11
- }) => string;
3
+ export declare class RepoTmp {
4
+ /** The nearest ancestor of `start` that holds a `.git` (folder or file); `start` itself when there is none. */
5
+ static findRoot(opts?: {
6
+ start?: string;
7
+ }): string;
8
+ /**
9
+ * `Bun.spawn` and `Bun.spawnSync` hand a child the environment the process started with, not the one
10
+ * it has now, so a TMPDIR set here would never reach it. Wrapped to default to the current one; an
11
+ * `env` a caller passes wins. `spawn(cmd, options)` and `spawn({ cmd, ...options })` are both handled.
12
+ */
13
+ private static withCurrentEnv;
14
+ /**
15
+ * Points TMPDIR at the repository's test folder unless it is already inside it (make's value, or a
16
+ * private folder a caller made there), and returns the folder now in force. Idempotent.
17
+ */
18
+ static apply(opts?: {
19
+ root?: string;
20
+ }): string;
21
+ }
12
22
  //# sourceMappingURL=repo-tmp.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"repo-tmp.d.ts","sourceRoot":"","sources":["../../src/testing/repo-tmp.ts"],"names":[],"mappings":"AAWA,iFAAiF;AACjF,eAAO,MAAM,kBAAkB,QAA2C,CAAC;AAE3E,+GAA+G;AAC/G,eAAO,MAAM,kBAAkB,GAAI,QAAO,MAAsB,KAAG,MAelE,CAAC;AAwBF;;;GAGG;AACH,eAAO,MAAM,UAAU,GAAI,OAAM;IAAE,IAAI,CAAC,EAAE,MAAM,CAAA;CAAO,KAAG,MAkBzD,CAAC"}
1
+ {"version":3,"file":"repo-tmp.d.ts","sourceRoot":"","sources":["../../src/testing/repo-tmp.ts"],"names":[],"mappings":"AAWA,iFAAiF;AACjF,eAAO,MAAM,kBAAkB,QAA2C,CAAC;AAI3E,qBAAa,OAAO;IAClB,+GAA+G;IAC/G,MAAM,CAAC,QAAQ,CAAC,IAAI,GAAE;QAAE,KAAK,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,MAAM;IAkBtD;;;;OAIG;IACH,OAAO,CAAC,MAAM,CAAC,cAAc;IAe7B;;;OAGG;IACH,MAAM,CAAC,KAAK,CAAC,IAAI,GAAE;QAAE,IAAI,CAAC,EAAE,MAAM,CAAA;KAAO,GAAG,MAAM;CAqBnD"}
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.useRepoTmp = exports.findRepositoryRoot = exports.REPO_TMP_DIRECTORY = void 0;
3
+ exports.RepoTmp = exports.REPO_TMP_DIRECTORY = void 0;
4
4
  /**
5
5
  * Where a test makes its temp folders: `.agents/local/tmp/tests` of the repository, never the system
6
6
  * temp. `make test` sets TMPDIR to a folder like it; this does the same for a run without make - a
@@ -13,55 +13,57 @@ const node_fs_1 = require("node:fs");
13
13
  const node_path_1 = require("node:path");
14
14
  /** The folder under the repository root that holds a test run's temp folders. */
15
15
  exports.REPO_TMP_DIRECTORY = (0, node_path_1.join)('.agents', 'local', 'tmp', 'tests');
16
- /** The nearest ancestor of `start` that holds a `.git` (folder or file); `start` itself when there is none. */
17
- const findRepositoryRoot = (start = process.cwd()) => {
18
- let current = (0, node_path_1.resolve)(start);
19
- for (;;) {
20
- if ((0, node_fs_1.existsSync)((0, node_path_1.join)(current, '.git'))) {
21
- return current;
22
- }
23
- const parent = (0, node_path_1.dirname)(current);
24
- if (parent === current) {
25
- return (0, node_path_1.resolve)(start);
16
+ class RepoTmp {
17
+ /** The nearest ancestor of `start` that holds a `.git` (folder or file); `start` itself when there is none. */
18
+ static findRoot(opts = {}) {
19
+ const { start = process.cwd() } = opts;
20
+ let current = (0, node_path_1.resolve)(start);
21
+ for (;;) {
22
+ if ((0, node_fs_1.existsSync)((0, node_path_1.join)(current, '.git'))) {
23
+ return current;
24
+ }
25
+ const parent = (0, node_path_1.dirname)(current);
26
+ if (parent === current) {
27
+ return (0, node_path_1.resolve)(start);
28
+ }
29
+ current = parent;
26
30
  }
27
- current = parent;
28
31
  }
29
- };
30
- exports.findRepositoryRoot = findRepositoryRoot;
31
- /**
32
- * `Bun.spawn` and `Bun.spawnSync` hand a child the environment the process started with, not the one
33
- * it has now, so a TMPDIR set here would never reach it. Wrapped to default to the current one; an
34
- * `env` a caller passes wins. `spawn(cmd, options)` and `spawn({ cmd, ...options })` are both handled.
35
- */
36
- const withCurrentEnv = (spawn) => {
37
- return (...args) => {
38
- const [first, second] = args;
39
- const options = Array.isArray(first) ? second : first;
40
- if (options?.env !== undefined) {
41
- return spawn(...args);
32
+ /**
33
+ * `Bun.spawn` and `Bun.spawnSync` hand a child the environment the process started with, not the one
34
+ * it has now, so a TMPDIR set here would never reach it. Wrapped to default to the current one; an
35
+ * `env` a caller passes wins. `spawn(cmd, options)` and `spawn({ cmd, ...options })` are both handled.
36
+ */
37
+ static withCurrentEnv(spawn) {
38
+ return (...args) => {
39
+ const [first, second] = args;
40
+ const options = Array.isArray(first) ? second : first;
41
+ if (options?.env !== undefined) {
42
+ return spawn(...args);
43
+ }
44
+ return Array.isArray(first)
45
+ ? spawn(first, { ...second, env: process.env })
46
+ : spawn({ ...first, env: process.env });
47
+ };
48
+ }
49
+ /**
50
+ * Points TMPDIR at the repository's test folder unless it is already inside it (make's value, or a
51
+ * private folder a caller made there), and returns the folder now in force. Idempotent.
52
+ */
53
+ static apply(opts = {}) {
54
+ const root = opts.root ?? RepoTmp.findRoot();
55
+ const testTmp = (0, node_path_1.join)(root, exports.REPO_TMP_DIRECTORY);
56
+ const current = process.env.TMPDIR;
57
+ if (current !== undefined && `${(0, node_path_1.resolve)(current)}${node_path_1.sep}`.startsWith(`${testTmp}${node_path_1.sep}`)) {
58
+ return current;
42
59
  }
43
- return Array.isArray(first)
44
- ? spawn(first, { ...second, env: process.env })
45
- : spawn({ ...first, env: process.env });
46
- };
47
- };
48
- /**
49
- * Points TMPDIR at the repository's test folder unless it is already inside it (make's value, or a
50
- * private folder a caller made there), and returns the folder now in force. Idempotent.
51
- */
52
- const useRepoTmp = (opts = {}) => {
53
- const root = opts.root ?? (0, exports.findRepositoryRoot)();
54
- const testTmp = (0, node_path_1.join)(root, exports.REPO_TMP_DIRECTORY);
55
- const current = process.env.TMPDIR;
56
- if (current !== undefined && `${(0, node_path_1.resolve)(current)}${node_path_1.sep}`.startsWith(`${testTmp}${node_path_1.sep}`)) {
57
- return current;
60
+ (0, node_fs_1.mkdirSync)((0, node_path_1.join)(testTmp, '.git'), { recursive: true });
61
+ process.env.TMPDIR = testTmp;
62
+ process.env.GIT_CEILING_DIRECTORIES = testTmp;
63
+ Bun.spawn = RepoTmp.withCurrentEnv(Bun.spawn);
64
+ Bun.spawnSync = RepoTmp.withCurrentEnv(Bun.spawnSync);
65
+ return testTmp;
58
66
  }
59
- (0, node_fs_1.mkdirSync)((0, node_path_1.join)(testTmp, '.git'), { recursive: true });
60
- process.env.TMPDIR = testTmp;
61
- process.env.GIT_CEILING_DIRECTORIES = testTmp;
62
- Bun.spawn = withCurrentEnv(Bun.spawn);
63
- Bun.spawnSync = withCurrentEnv(Bun.spawnSync);
64
- return testTmp;
65
- };
66
- exports.useRepoTmp = useRepoTmp;
67
+ }
68
+ exports.RepoTmp = RepoTmp;
67
69
  //# sourceMappingURL=repo-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: `.agents/local/tmp/tests` of the repository, never the system\n * temp. `make test` sets TMPDIR to a folder like it; this does the same for a run without make - a\n * bare `bun test` on one file - and is the one place that knows the path.\n *\n * The empty `.git` marker in it stops git and bun's ignore lookup from reading the enclosing\n * repository, so GIT_CEILING_DIRECTORIES is set to the same folder.\n */\nimport { existsSync, mkdirSync } from 'node:fs';\nimport { dirname, join, resolve, sep } from 'node:path';\n\n/** The folder under the repository root that holds a test run's temp folders. */\nexport const REPO_TMP_DIRECTORY = join('.agents', 'local', 'tmp', 'tests');\n\n/** The nearest ancestor of `start` that holds a `.git` (folder or file); `start` itself when there is none. */\nexport const findRepositoryRoot = (start: string = process.cwd()): string => {\n let current = resolve(start);\n\n for (;;) {\n if (existsSync(join(current, '.git'))) {\n return current;\n }\n\n const parent = dirname(current);\n if (parent === current) {\n return resolve(start);\n }\n\n current = parent;\n }\n};\n\ntype TSpawn = (...args: unknown[]) => unknown;\n\n/**\n * `Bun.spawn` and `Bun.spawnSync` hand a child the environment the process started with, not the one\n * it has now, so a TMPDIR set here would never reach it. Wrapped to default to the current one; an\n * `env` a caller passes wins. `spawn(cmd, options)` and `spawn({ cmd, ...options })` are both handled.\n */\nconst withCurrentEnv = (spawn: TSpawn): TSpawn => {\n return (...args) => {\n const [first, second] = args;\n const options = Array.isArray(first) ? second : first;\n\n if ((options as { env?: unknown } | undefined)?.env !== undefined) {\n return spawn(...args);\n }\n\n return Array.isArray(first)\n ? spawn(first, { ...(second as object), env: process.env })\n : spawn({ ...(first as object), env: process.env });\n };\n};\n\n/**\n * Points TMPDIR at the repository's test folder unless it is already inside it (make's value, or a\n * private folder a caller made there), and returns the folder now in force. Idempotent.\n */\nexport const useRepoTmp = (opts: { root?: string } = {}): string => {\n const root = opts.root ?? findRepositoryRoot();\n const testTmp = join(root, REPO_TMP_DIRECTORY);\n const current = process.env.TMPDIR;\n\n if (current !== undefined && `${resolve(current)}${sep}`.startsWith(`${testTmp}${sep}`)) {\n return current;\n }\n\n mkdirSync(join(testTmp, '.git'), { recursive: true });\n process.env.TMPDIR = testTmp;\n process.env.GIT_CEILING_DIRECTORIES = testTmp;\n Bun.spawn = withCurrentEnv(Bun.spawn as unknown as TSpawn) as unknown as typeof Bun.spawn;\n Bun.spawnSync = withCurrentEnv(\n Bun.spawnSync as unknown as TSpawn,\n ) as unknown as typeof Bun.spawnSync;\n\n return testTmp;\n};\n"]}
1
+ {"version":3,"file":"repo-tmp.js","sourceRoot":"","sources":["../../src/testing/repo-tmp.ts"],"names":[],"mappings":";;;AAAA;;;;;;;GAOG;AACH,qCAAgD;AAChD,yCAAwD;AAExD,iFAAiF;AACpE,QAAA,kBAAkB,GAAG,IAAA,gBAAI,EAAC,SAAS,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,CAAC,CAAC;AAI3E,MAAa,OAAO;IAClB,+GAA+G;IAC/G,MAAM,CAAC,QAAQ,CAAC,OAA2B,EAAE;QAC3C,MAAM,EAAE,KAAK,GAAG,OAAO,CAAC,GAAG,EAAE,EAAE,GAAG,IAAI,CAAC;QACvC,IAAI,OAAO,GAAG,IAAA,mBAAO,EAAC,KAAK,CAAC,CAAC;QAE7B,SAAS,CAAC;YACR,IAAI,IAAA,oBAAU,EAAC,IAAA,gBAAI,EAAC,OAAO,EAAE,MAAM,CAAC,CAAC,EAAE,CAAC;gBACtC,OAAO,OAAO,CAAC;YACjB,CAAC;YAED,MAAM,MAAM,GAAG,IAAA,mBAAO,EAAC,OAAO,CAAC,CAAC;YAChC,IAAI,MAAM,KAAK,OAAO,EAAE,CAAC;gBACvB,OAAO,IAAA,mBAAO,EAAC,KAAK,CAAC,CAAC;YACxB,CAAC;YAED,OAAO,GAAG,MAAM,CAAC;QACnB,CAAC;IACH,CAAC;IAED;;;;OAIG;IACK,MAAM,CAAC,cAAc,CAAC,KAAa;QACzC,OAAO,CAAC,GAAG,IAAI,EAAE,EAAE;YACjB,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;YAC7B,MAAM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AK,GAAG,OAAO,CAAC,cAAc,CAChC,GAAG,CAAC,KAA0B,CACA,CAAC;QACjC,GAAG,CAAC,SAAS,GAAG,OAAO,CAAC,cAAc,CACpC,GAAG,CAAC,SAA8B,CACA,CAAC;QAErC,OAAO,OAAO,CAAC;IACjB,CAAC;CACF;AAjED,0BAiEC","sourcesContent":["/**\n * Where a test makes its temp folders: `.agents/local/tmp/tests` of the repository, never the system\n * temp. `make test` sets TMPDIR to a folder like it; this does the same for a run without make - a\n * bare `bun test` on one file - and is the one place that knows the path.\n *\n * The empty `.git` marker in it stops git and bun's ignore lookup from reading the enclosing\n * repository, so GIT_CEILING_DIRECTORIES is set to the same folder.\n */\nimport { existsSync, mkdirSync } from 'node:fs';\nimport { dirname, join, resolve, sep } from 'node:path';\n\n/** The folder under the repository root that holds a test run's temp folders. */\nexport const REPO_TMP_DIRECTORY = join('.agents', 'local', 'tmp', 'tests');\n\ntype TSpawn = (...args: unknown[]) => unknown;\n\nexport class RepoTmp {\n /** The nearest ancestor of `start` that holds a `.git` (folder or file); `start` itself when there is none. */\n static findRoot(opts: { start?: string } = {}): string {\n const { start = process.cwd() } = opts;\n let current = resolve(start);\n\n for (;;) {\n if (existsSync(join(current, '.git'))) {\n return current;\n }\n\n const parent = dirname(current);\n if (parent === current) {\n return resolve(start);\n }\n\n current = parent;\n }\n }\n\n /**\n * `Bun.spawn` and `Bun.spawnSync` hand a child the environment the process started with, not the one\n * it has now, so a TMPDIR set here would never reach it. Wrapped to default to the current one; an\n * `env` a caller passes wins. `spawn(cmd, options)` and `spawn({ cmd, ...options })` are both handled.\n */\n private static withCurrentEnv(spawn: TSpawn): TSpawn {\n return (...args) => {\n const [first, second] = args;\n const options = Array.isArray(first) ? second : first;\n\n if ((options as { env?: unknown } | undefined)?.env !== undefined) {\n return spawn(...args);\n }\n\n return Array.isArray(first)\n ? spawn(first, { ...(second as object), env: process.env })\n : spawn({ ...(first as object), env: process.env });\n };\n }\n\n /**\n * Points TMPDIR at the repository's test folder unless it is already inside it (make's value, or a\n * private folder a caller made there), and returns the folder now in force. Idempotent.\n */\n static apply(opts: { root?: string } = {}): string {\n const root = opts.root ?? RepoTmp.findRoot();\n const testTmp = join(root, REPO_TMP_DIRECTORY);\n const current = process.env.TMPDIR;\n\n if (current !== undefined && `${resolve(current)}${sep}`.startsWith(`${testTmp}${sep}`)) {\n return current;\n }\n\n mkdirSync(join(testTmp, '.git'), { recursive: true });\n process.env.TMPDIR = testTmp;\n process.env.GIT_CEILING_DIRECTORIES = testTmp;\n Bun.spawn = RepoTmp.withCurrentEnv(\n Bun.spawn as unknown as TSpawn,\n ) as unknown as typeof Bun.spawn;\n Bun.spawnSync = RepoTmp.withCurrentEnv(\n Bun.spawnSync as unknown as TSpawn,\n ) as unknown as typeof Bun.spawnSync;\n\n return testTmp;\n }\n}\n"]}
@@ -1,13 +1,15 @@
1
1
  /** Long enough for a cold `bun build` under a loaded parallel run; it bounds a stall, not a slow run. */
2
2
  export declare const SPAWN_TIMEOUT_MS = 120000;
3
- /**
4
- * `Bun.spawnSync`, bounded. A sync spawn blocks the worker thread, so bun's own test timeout cannot
5
- * fire while it waits: the `timeout` option is the only bound. Its default signal, SIGTERM, can be
6
- * outlived by a stuck child - one such child once stalled a whole suite for 770s - so this kills with
7
- * SIGKILL, and throws naming the command instead of returning a half-finished result.
8
- */
9
- export declare const spawnSyncBounded: <const In extends Bun.SpawnOptions.Writable = "ignore", const Out extends Bun.SpawnOptions.Readable = "pipe", const Err extends Bun.SpawnOptions.Readable = "pipe">(opts: Bun.SpawnOptions.SpawnSyncOptions<In, Out, Err> & {
10
- cmd: string[];
11
- onExit?: undefined;
12
- }) => Bun.SyncSubprocess<Out, Err>;
3
+ export declare class SpawnHelper {
4
+ /**
5
+ * `Bun.spawnSync`, bounded. A sync spawn blocks the worker thread, so bun's own test timeout cannot
6
+ * fire while it waits: the `timeout` option is the only bound. Its default signal, SIGTERM, can be
7
+ * outlived by a stuck child - one such child once stalled a whole suite for 770s - so this kills with
8
+ * SIGKILL, and throws naming the command instead of returning a half-finished result.
9
+ */
10
+ static spawnSyncBounded<const In extends Bun.SpawnOptions.Writable = 'ignore', const Out extends Bun.SpawnOptions.Readable = 'pipe', const Err extends Bun.SpawnOptions.Readable = 'pipe'>(opts: Bun.SpawnOptions.SpawnSyncOptions<In, Out, Err> & {
11
+ cmd: string[];
12
+ onExit?: undefined;
13
+ }): Bun.SyncSubprocess<Out, Err>;
14
+ }
13
15
  //# sourceMappingURL=spawn.helper.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"spawn.helper.d.ts","sourceRoot":"","sources":["../../src/testing/spawn.helper.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,eAAO,MAAM,gBAAgB,SAAU,CAAC;AAExC;;;;;GAKG;AACH,eAAO,MAAM,gBAAgB,GAC3B,KAAK,CAAC,EAAE,SAAS,GAAG,CAAC,YAAY,CAAC,QAAQ,GAAG,QAAQ,EACrD,KAAK,CAAC,GAAG,SAAS,GAAG,CAAC,YAAY,CAAC,QAAQ,GAAG,MAAM,EACpD,KAAK,CAAC,GAAG,SAAS,GAAG,CAAC,YAAY,CAAC,QAAQ,GAAG,MAAM,EAEpD,MAAM,GAAG,CAAC,YAAY,CAAC,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG;IAAE,GAAG,EAAE,MAAM,EAAE,CAAC;IAAC,MAAM,CAAC,EAAE,SAAS,CAAA;CAAE,iCAa9F,CAAC"}
1
+ {"version":3,"file":"spawn.helper.d.ts","sourceRoot":"","sources":["../../src/testing/spawn.helper.ts"],"names":[],"mappings":"AAAA,yGAAyG;AACzG,eAAO,MAAM,gBAAgB,SAAU,CAAC;AAExC,qBAAa,WAAW;IACtB;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CACrB,KAAK,CAAC,EAAE,SAAS,GAAG,CAAC,YAAY,CAAC,QAAQ,GAAG,QAAQ,EACrD,KAAK,CAAC,GAAG,SAAS,GAAG,CAAC,YAAY,CAAC,QAAQ,GAAG,MAAM,EACpD,KAAK,CAAC,GAAG,SAAS,GAAG,CAAC,YAAY,CAAC,QAAQ,GAAG,MAAM,EACpD,IAAI,EAAE,GAAG,CAAC,YAAY,CAAC,gBAAgB,CAAC,EAAE,EAAE,GAAG,EAAE,GAAG,CAAC,GAAG;QAAE,GAAG,EAAE,MAAM,EAAE,CAAC;QAAC,MAAM,CAAC,EAAE,SAAS,CAAA;KAAE;CAiBhG"}
@@ -1,22 +1,28 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.spawnSyncBounded = exports.SPAWN_TIMEOUT_MS = void 0;
3
+ exports.SpawnHelper = exports.SPAWN_TIMEOUT_MS = void 0;
4
4
  /** Long enough for a cold `bun build` under a loaded parallel run; it bounds a stall, not a slow run. */
5
5
  exports.SPAWN_TIMEOUT_MS = 120_000;
6
- /**
7
- * `Bun.spawnSync`, bounded. A sync spawn blocks the worker thread, so bun's own test timeout cannot
8
- * fire while it waits: the `timeout` option is the only bound. Its default signal, SIGTERM, can be
9
- * outlived by a stuck child - one such child once stalled a whole suite for 770s - so this kills with
10
- * SIGKILL, and throws naming the command instead of returning a half-finished result.
11
- */
12
- const spawnSyncBounded = (opts) => {
13
- const timeout = opts.timeout ?? exports.SPAWN_TIMEOUT_MS;
14
- const result = Bun.spawnSync({ ...opts, timeout, killSignal: 'SIGKILL' });
15
- if (result.exitedDueToTimeout) {
16
- // eslint-disable-next-line venizia/no-new-error -- getError would be a dev-configs -> inversion cycle
17
- throw new Error(`[spawnSyncBounded] did not exit within ${timeout} ms, killed | cmd: ${opts.cmd.join(' ').slice(0, 200)}`);
6
+ class SpawnHelper {
7
+ /**
8
+ * `Bun.spawnSync`, bounded. A sync spawn blocks the worker thread, so bun's own test timeout cannot
9
+ * fire while it waits: the `timeout` option is the only bound. Its default signal, SIGTERM, can be
10
+ * outlived by a stuck child - one such child once stalled a whole suite for 770s - so this kills with
11
+ * SIGKILL, and throws naming the command instead of returning a half-finished result.
12
+ */
13
+ static spawnSyncBounded(opts) {
14
+ const timeout = opts.timeout ?? exports.SPAWN_TIMEOUT_MS;
15
+ const result = Bun.spawnSync({
16
+ ...opts,
17
+ timeout,
18
+ killSignal: 'SIGKILL',
19
+ });
20
+ if (result.exitedDueToTimeout) {
21
+ // eslint-disable-next-line venizia/no-new-error -- getError would be a dev-configs -> inversion cycle
22
+ throw new Error(`[SpawnHelper.spawnSyncBounded] did not exit within ${timeout} ms, killed | cmd: ${opts.cmd.join(' ').slice(0, 200)}`);
23
+ }
24
+ return result;
18
25
  }
19
- return result;
20
- };
21
- exports.spawnSyncBounded = spawnSyncBounded;
26
+ }
27
+ exports.SpawnHelper = SpawnHelper;
22
28
  //# sourceMappingURL=spawn.helper.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"spawn.helper.js","sourceRoot":"","sources":["../../src/testing/spawn.helper.ts"],"names":[],"mappings":";;;AAAA,yGAAyG;AAC5F,QAAA,gBAAgB,GAAG,OAAO,CAAC;AAExC;;;;;GAKG;AACI,MAAM,gBAAgB,GAAG,CAK9B,IAA6F,EAC7F,EAAE;IACF,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,wBAAgB,CAAC;IACjD,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAe,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,UAAU,EAAE,SAAkB,EAAE,CAAC,CAAC;IAEjG,IAAI,MAAM,CAAC,kBAAkB,EAAE,CAAC;QAC9B,sGAAsG;QACtG,MAAM,IAAI,KAAK,CACb,0CAA0C,OAAO,sBAAsB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CAC1G,CAAC;IACJ,CAAC;IAED,OAAO,MAAM,CAAC;AAChB,CAAC,CAAC;AAlBW,QAAA,gBAAgB,oBAkB3B","sourcesContent":["/** Long enough for a cold `bun build` under a loaded parallel run; it bounds a stall, not a slow run. */\nexport const SPAWN_TIMEOUT_MS = 120_000;\n\n/**\n * `Bun.spawnSync`, bounded. A sync spawn blocks the worker thread, so bun's own test timeout cannot\n * fire while it waits: the `timeout` option is the only bound. Its default signal, SIGTERM, can be\n * outlived by a stuck child - one such child once stalled a whole suite for 770s - so this kills with\n * SIGKILL, and throws naming the command instead of returning a half-finished result.\n */\nexport const spawnSyncBounded = <\n const In extends Bun.SpawnOptions.Writable = 'ignore',\n const Out extends Bun.SpawnOptions.Readable = 'pipe',\n const Err extends Bun.SpawnOptions.Readable = 'pipe',\n>(\n opts: Bun.SpawnOptions.SpawnSyncOptions<In, Out, Err> & { cmd: string[]; onExit?: undefined },\n) => {\n const timeout = opts.timeout ?? SPAWN_TIMEOUT_MS;\n const result = Bun.spawnSync<In, Out, Err>({ ...opts, timeout, killSignal: 'SIGKILL' as const });\n\n if (result.exitedDueToTimeout) {\n // eslint-disable-next-line venizia/no-new-error -- getError would be a dev-configs -> inversion cycle\n throw new Error(\n `[spawnSyncBounded] did not exit within ${timeout} ms, killed | cmd: ${opts.cmd.join(' ').slice(0, 200)}`,\n );\n }\n\n return result;\n};\n"]}
1
+ {"version":3,"file":"spawn.helper.js","sourceRoot":"","sources":["../../src/testing/spawn.helper.ts"],"names":[],"mappings":";;;AAAA,yGAAyG;AAC5F,QAAA,gBAAgB,GAAG,OAAO,CAAC;AAExC,MAAa,WAAW;IACtB;;;;;OAKG;IACH,MAAM,CAAC,gBAAgB,CAIrB,IAA6F;QAC7F,MAAM,OAAO,GAAG,IAAI,CAAC,OAAO,IAAI,wBAAgB,CAAC;QACjD,MAAM,MAAM,GAAG,GAAG,CAAC,SAAS,CAAe;YACzC,GAAG,IAAI;YACP,OAAO;YACP,UAAU,EAAE,SAAkB;SAC/B,CAAC,CAAC;QAEH,IAAI,MAAM,CAAC,kBAAkB,EAAE,CAAC;YAC9B,sGAAsG;YACtG,MAAM,IAAI,KAAK,CACb,sDAAsD,OAAO,sBAAsB,IAAI,CAAC,GAAG,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,EAAE,GAAG,CAAC,EAAE,CACtH,CAAC;QACJ,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF;AA5BD,kCA4BC","sourcesContent":["/** Long enough for a cold `bun build` under a loaded parallel run; it bounds a stall, not a slow run. */\nexport const SPAWN_TIMEOUT_MS = 120_000;\n\nexport class SpawnHelper {\n /**\n * `Bun.spawnSync`, bounded. A sync spawn blocks the worker thread, so bun's own test timeout cannot\n * fire while it waits: the `timeout` option is the only bound. Its default signal, SIGTERM, can be\n * outlived by a stuck child - one such child once stalled a whole suite for 770s - so this kills with\n * SIGKILL, and throws naming the command instead of returning a half-finished result.\n */\n static spawnSyncBounded<\n const In extends Bun.SpawnOptions.Writable = 'ignore',\n const Out extends Bun.SpawnOptions.Readable = 'pipe',\n const Err extends Bun.SpawnOptions.Readable = 'pipe',\n >(opts: Bun.SpawnOptions.SpawnSyncOptions<In, Out, Err> & { cmd: string[]; onExit?: undefined }) {\n const timeout = opts.timeout ?? SPAWN_TIMEOUT_MS;\n const result = Bun.spawnSync<In, Out, Err>({\n ...opts,\n timeout,\n killSignal: 'SIGKILL' as const,\n });\n\n if (result.exitedDueToTimeout) {\n // eslint-disable-next-line venizia/no-new-error -- getError would be a dev-configs -> inversion cycle\n throw new Error(\n `[SpawnHelper.spawnSyncBounded] did not exit within ${timeout} ms, killed | cmd: ${opts.cmd.join(' ').slice(0, 200)}`,\n );\n }\n\n return result;\n }\n}\n"]}
@@ -7,5 +7,5 @@ Object.defineProperty(exports, "__esModule", { value: true });
7
7
  * run inside a package: there, pass `--preload @venizia/dev-configs/testing/tmpdir-preload` in the `test` script.
8
8
  */
9
9
  const repo_tmp_1 = require("./repo-tmp");
10
- (0, repo_tmp_1.useRepoTmp)();
10
+ repo_tmp_1.RepoTmp.apply();
11
11
  //# sourceMappingURL=tmpdir-preload.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tmpdir-preload.js","sourceRoot":"","sources":["../../src/testing/tmpdir-preload.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,yCAAwC;AAExC,IAAA,qBAAU,GAAE,CAAC","sourcesContent":["/**\n * Test preload: `[test] preload = [\"@venizia/dev-configs/testing/tmpdir-preload\"]` in a bunfig makes\n * a bare `bun test` keep its temp folders in the repository, like `make test` does. Bun reads only the\n * `bunfig.toml` of the folder it runs in, so a root file applies to a run from the root, not to `bun test`\n * run inside a package: there, pass `--preload @venizia/dev-configs/testing/tmpdir-preload` in the `test` script.\n */\nimport { useRepoTmp } from './repo-tmp';\n\nuseRepoTmp();\n"]}
1
+ {"version":3,"file":"tmpdir-preload.js","sourceRoot":"","sources":["../../src/testing/tmpdir-preload.ts"],"names":[],"mappings":";;AAAA;;;;;GAKG;AACH,yCAAqC;AAErC,kBAAO,CAAC,KAAK,EAAE,CAAC","sourcesContent":["/**\n * Test preload: `[test] preload = [\"@venizia/dev-configs/testing/tmpdir-preload\"]` in a bunfig makes\n * a bare `bun test` keep its temp folders in the repository, like `make test` does. Bun reads only the\n * `bunfig.toml` of the folder it runs in, so a root file applies to a run from the root, not to `bun test`\n * run inside a package: there, pass `--preload @venizia/dev-configs/testing/tmpdir-preload` in the `test` script.\n */\nimport { RepoTmp } from './repo-tmp';\n\nRepoTmp.apply();\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@venizia/dev-configs",
3
- "version": "0.4.6",
3
+ "version": "0.4.7-1",
4
4
  "description": "Shareable development configurations for TypeScript projects: oxlint presets with per-rule builders, the ESLint naming-convention rule, the legacy ESLint flat config, and TypeScript compiler options with critical decorator support (experimentalDecorators, emitDecoratorMetadata, useDefineForClassFields). Single source of truth for consistent code style, type checking, and build settings across monorepo packages.",
5
5
  "keywords": [
6
6
  "build-tools",
@@ -105,8 +105,7 @@
105
105
  "access": "public"
106
106
  },
107
107
  "scripts": {
108
- "force-update": "sh ../../scripts/build/force-update.sh",
109
- "prepublishOnly": "make rebuild"
108
+ "force-update": "sh ../../scripts/build/force-update.sh"
110
109
  },
111
110
  "dependencies": {
112
111
  "@eslint/js": "^10.0.1",