putitoutthere 0.2.68 → 0.2.70

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 (209) hide show
  1. package/dist/advance-floating-major.d.ts +1 -2
  2. package/dist/advance-floating-major.d.ts.map +1 -1
  3. package/dist/advance-floating-major.js +8 -9
  4. package/dist/advance-floating-major.js.map +1 -1
  5. package/dist/advance-v0.d.ts +3 -4
  6. package/dist/advance-v0.d.ts.map +1 -1
  7. package/dist/advance-v0.js +5 -6
  8. package/dist/advance-v0.js.map +1 -1
  9. package/dist/check-crate-size.d.ts +1 -1
  10. package/dist/check-crate-size.d.ts.map +1 -1
  11. package/dist/check-crate-size.js +22 -13
  12. package/dist/check-crate-size.js.map +1 -1
  13. package/dist/check.d.ts +1 -1
  14. package/dist/check.d.ts.map +1 -1
  15. package/dist/check.js +55 -68
  16. package/dist/check.js.map +1 -1
  17. package/dist/cli.d.ts.map +1 -1
  18. package/dist/cli.js +12 -11
  19. package/dist/cli.js.map +1 -1
  20. package/dist/completeness.d.ts +2 -2
  21. package/dist/completeness.d.ts.map +1 -1
  22. package/dist/completeness.js +13 -12
  23. package/dist/completeness.js.map +1 -1
  24. package/dist/config.d.ts +1 -1
  25. package/dist/config.d.ts.map +1 -1
  26. package/dist/config.js +6 -9
  27. package/dist/config.js.map +1 -1
  28. package/dist/ensure-tag.d.ts +1 -1
  29. package/dist/ensure-tag.d.ts.map +1 -1
  30. package/dist/ensure-tag.js +4 -4
  31. package/dist/ensure-tag.js.map +1 -1
  32. package/dist/find-workspace-root.d.ts +1 -1
  33. package/dist/find-workspace-root.d.ts.map +1 -1
  34. package/dist/find-workspace-root.js +3 -3
  35. package/dist/find-workspace-root.js.map +1 -1
  36. package/dist/fold-action-bundle.d.ts +1 -1
  37. package/dist/fold-action-bundle.d.ts.map +1 -1
  38. package/dist/fold-action-bundle.js +5 -5
  39. package/dist/fold-action-bundle.js.map +1 -1
  40. package/dist/force-move-tag.d.ts +1 -1
  41. package/dist/force-move-tag.d.ts.map +1 -1
  42. package/dist/force-move-tag.js +3 -3
  43. package/dist/force-move-tag.js.map +1 -1
  44. package/dist/git.d.ts +19 -21
  45. package/dist/git.d.ts.map +1 -1
  46. package/dist/git.js +42 -48
  47. package/dist/git.js.map +1 -1
  48. package/dist/glob.d.ts +1 -1
  49. package/dist/glob.d.ts.map +1 -1
  50. package/dist/glob.js +17 -7
  51. package/dist/glob.js.map +1 -1
  52. package/dist/handlers/crates.d.ts +1 -1
  53. package/dist/handlers/crates.d.ts.map +1 -1
  54. package/dist/handlers/crates.js +26 -34
  55. package/dist/handlers/crates.js.map +1 -1
  56. package/dist/handlers/npm-platform.d.ts.map +1 -1
  57. package/dist/handlers/npm-platform.js +34 -36
  58. package/dist/handlers/npm-platform.js.map +1 -1
  59. package/dist/handlers/npm.d.ts.map +1 -1
  60. package/dist/handlers/npm.js +21 -27
  61. package/dist/handlers/npm.js.map +1 -1
  62. package/dist/handlers/pypi.d.ts.map +1 -1
  63. package/dist/handlers/pypi.js +11 -17
  64. package/dist/handlers/pypi.js.map +1 -1
  65. package/dist/normalize-artifacts.d.ts +1 -1
  66. package/dist/normalize-artifacts.d.ts.map +1 -1
  67. package/dist/normalize-artifacts.js +8 -7
  68. package/dist/normalize-artifacts.js.map +1 -1
  69. package/dist/plan-status.js +1 -1
  70. package/dist/plan-status.js.map +1 -1
  71. package/dist/plan.d.ts.map +1 -1
  72. package/dist/plan.js +27 -27
  73. package/dist/plan.js.map +1 -1
  74. package/dist/preflight.d.ts +14 -14
  75. package/dist/preflight.d.ts.map +1 -1
  76. package/dist/preflight.js +56 -56
  77. package/dist/preflight.js.map +1 -1
  78. package/dist/publish.js +14 -14
  79. package/dist/publish.js.map +1 -1
  80. package/dist/python-versions.d.ts +1 -1
  81. package/dist/python-versions.d.ts.map +1 -1
  82. package/dist/python-versions.js +5 -5
  83. package/dist/python-versions.js.map +1 -1
  84. package/dist/reconcile.js +3 -3
  85. package/dist/reconcile.js.map +1 -1
  86. package/dist/release-github/gh-release-create.d.ts +1 -1
  87. package/dist/release-github/gh-release-create.d.ts.map +1 -1
  88. package/dist/release-github/gh-release-create.js +3 -4
  89. package/dist/release-github/gh-release-create.js.map +1 -1
  90. package/dist/release-github/gh-release-exists.d.ts +1 -1
  91. package/dist/release-github/gh-release-exists.d.ts.map +1 -1
  92. package/dist/release-github/gh-release-exists.js +3 -3
  93. package/dist/release-github/gh-release-exists.js.map +1 -1
  94. package/dist/release-github/index.d.ts +4 -5
  95. package/dist/release-github/index.d.ts.map +1 -1
  96. package/dist/release-github/index.js +8 -9
  97. package/dist/release-github/index.js.map +1 -1
  98. package/dist/resolve-tag-commit.d.ts +2 -2
  99. package/dist/resolve-tag-commit.d.ts.map +1 -1
  100. package/dist/resolve-tag-commit.js +4 -4
  101. package/dist/resolve-tag-commit.js.map +1 -1
  102. package/dist/status.js +2 -2
  103. package/dist/status.js.map +1 -1
  104. package/dist/to-error.d.ts +17 -0
  105. package/dist/to-error.d.ts.map +1 -0
  106. package/dist/to-error.js +19 -0
  107. package/dist/to-error.js.map +1 -0
  108. package/dist/utils/exec-capture.d.ts +20 -0
  109. package/dist/utils/exec-capture.d.ts.map +1 -0
  110. package/dist/utils/exec-capture.js +25 -0
  111. package/dist/utils/exec-capture.js.map +1 -0
  112. package/dist/utils/exec-error.d.ts +16 -0
  113. package/dist/utils/exec-error.d.ts.map +1 -0
  114. package/dist/utils/exec-error.js +21 -0
  115. package/dist/utils/exec-error.js.map +1 -0
  116. package/dist/utils/exec-inherit.d.ts +13 -0
  117. package/dist/utils/exec-inherit.d.ts.map +1 -0
  118. package/dist/utils/exec-inherit.js +25 -0
  119. package/dist/utils/exec-inherit.js.map +1 -0
  120. package/dist/utils/list-files-recursive.d.ts +2 -2
  121. package/dist/utils/list-files-recursive.d.ts.map +1 -1
  122. package/dist/utils/list-files-recursive.js +7 -6
  123. package/dist/utils/list-files-recursive.js.map +1 -1
  124. package/dist/utils/path-exists.d.ts +3 -0
  125. package/dist/utils/path-exists.d.ts.map +1 -0
  126. package/dist/utils/path-exists.js +12 -0
  127. package/dist/utils/path-exists.js.map +1 -0
  128. package/dist/utils/sleep.d.ts +3 -0
  129. package/dist/utils/sleep.d.ts.map +1 -0
  130. package/dist/utils/sleep.js +5 -0
  131. package/dist/utils/sleep.js.map +1 -0
  132. package/dist/verbose.d.ts +1 -1
  133. package/dist/verbose.d.ts.map +1 -1
  134. package/dist/verbose.js +5 -5
  135. package/dist/verbose.js.map +1 -1
  136. package/dist/verify/bundle-cli/index.d.ts +2 -2
  137. package/dist/verify/bundle-cli/index.d.ts.map +1 -1
  138. package/dist/verify/bundle-cli/index.js +6 -6
  139. package/dist/verify/bundle-cli/index.js.map +1 -1
  140. package/dist/verify/bundle-cli/read-python-source.d.ts +1 -1
  141. package/dist/verify/bundle-cli/read-python-source.d.ts.map +1 -1
  142. package/dist/verify/bundle-cli/read-python-source.js +5 -4
  143. package/dist/verify/bundle-cli/read-python-source.js.map +1 -1
  144. package/dist/verify/crate/extract-crate.d.ts +1 -1
  145. package/dist/verify/crate/extract-crate.d.ts.map +1 -1
  146. package/dist/verify/crate/extract-crate.js +5 -5
  147. package/dist/verify/crate/extract-crate.js.map +1 -1
  148. package/dist/verify/crate/find-crate-file.d.ts +1 -1
  149. package/dist/verify/crate/find-crate-file.d.ts.map +1 -1
  150. package/dist/verify/crate/find-crate-file.js +4 -4
  151. package/dist/verify/crate/find-crate-file.js.map +1 -1
  152. package/dist/verify/crate/has-crate-source.d.ts +1 -1
  153. package/dist/verify/crate/has-crate-source.d.ts.map +1 -1
  154. package/dist/verify/crate/has-crate-source.js +2 -2
  155. package/dist/verify/crate/has-crate-source.js.map +1 -1
  156. package/dist/verify/crate/index.d.ts +2 -2
  157. package/dist/verify/crate/index.d.ts.map +1 -1
  158. package/dist/verify/crate/index.js +8 -8
  159. package/dist/verify/crate/index.js.map +1 -1
  160. package/dist/verify/npm-tarball/download.d.ts +2 -2
  161. package/dist/verify/npm-tarball/download.d.ts.map +1 -1
  162. package/dist/verify/npm-tarball/download.js +7 -7
  163. package/dist/verify/npm-tarball/download.js.map +1 -1
  164. package/dist/verify/npm-tarball/local-dir-state.d.ts +1 -1
  165. package/dist/verify/npm-tarball/local-dir-state.d.ts.map +1 -1
  166. package/dist/verify/npm-tarball/local-dir-state.js +5 -4
  167. package/dist/verify/npm-tarball/local-dir-state.js.map +1 -1
  168. package/dist/verify/npm-tarball/main.d.ts.map +1 -1
  169. package/dist/verify/npm-tarball/main.js +8 -7
  170. package/dist/verify/npm-tarball/main.js.map +1 -1
  171. package/dist/verify/npm-tarball/resolve-url.js +4 -4
  172. package/dist/verify/npm-tarball/resolve-url.js.map +1 -1
  173. package/dist/verify/npm-tarball/triple.js +5 -5
  174. package/dist/verify/npm-tarball/triple.js.map +1 -1
  175. package/dist/verify/posture.js +1 -1
  176. package/dist/verify/posture.js.map +1 -1
  177. package/dist/verify/wheel/find-dist-file.d.ts +1 -1
  178. package/dist/verify/wheel/find-dist-file.d.ts.map +1 -1
  179. package/dist/verify/wheel/find-dist-file.js +6 -5
  180. package/dist/verify/wheel/find-dist-file.js.map +1 -1
  181. package/dist/verify/wheel/index.d.ts +2 -2
  182. package/dist/verify/wheel/index.d.ts.map +1 -1
  183. package/dist/verify/wheel/index.js +8 -7
  184. package/dist/verify/wheel/index.js.map +1 -1
  185. package/dist/verify/wheel/read-wheel-version.d.ts +1 -1
  186. package/dist/verify/wheel/read-wheel-version.d.ts.map +1 -1
  187. package/dist/verify/wheel/read-wheel-version.js +3 -3
  188. package/dist/verify/wheel/read-wheel-version.js.map +1 -1
  189. package/dist/wheel-abi.d.ts +2 -2
  190. package/dist/wheel-abi.d.ts.map +1 -1
  191. package/dist/wheel-abi.js +7 -7
  192. package/dist/wheel-abi.js.map +1 -1
  193. package/dist/write-crate-version.d.ts +1 -1
  194. package/dist/write-crate-version.d.ts.map +1 -1
  195. package/dist/write-crate-version.js +4 -4
  196. package/dist/write-crate-version.js.map +1 -1
  197. package/dist/write-launcher.d.ts +2 -2
  198. package/dist/write-launcher.d.ts.map +1 -1
  199. package/dist/write-launcher.js +9 -9
  200. package/dist/write-launcher.js.map +1 -1
  201. package/dist/write-resolved-cargo-version.d.ts +1 -1
  202. package/dist/write-resolved-cargo-version.d.ts.map +1 -1
  203. package/dist/write-resolved-cargo-version.js +6 -6
  204. package/dist/write-resolved-cargo-version.js.map +1 -1
  205. package/dist/write-version.d.ts +1 -1
  206. package/dist/write-version.d.ts.map +1 -1
  207. package/dist/write-version.js +9 -12
  208. package/dist/write-version.js.map +1 -1
  209. package/package.json +1 -1
package/dist/git.d.ts CHANGED
@@ -1,10 +1,8 @@
1
1
  /**
2
2
  * Thin wrapper around the `git` CLI for the ops putitoutthere needs.
3
3
  *
4
- * Sync-only, by design — the caller is either CI (which we don't mind
5
- * blocking) or a doctor run (which is interactive). Stderr is captured
6
- * and surfaced in thrown errors so failures are diagnosable without
7
- * re-running with --verbose.
4
+ * Stderr is captured and surfaced in thrown errors so failures are
5
+ * diagnosable without re-running with --verbose.
8
6
  *
9
7
  * Issue #9. Plan: §13.6 (no-push tag model), §14.2 (last-tag resolver).
10
8
  */
@@ -14,13 +12,13 @@ export interface GitOptions {
14
12
  interface TagOptions extends GitOptions {
15
13
  message?: string;
16
14
  }
17
- export declare function headCommit(opts?: GitOptions): string;
18
- export declare function commitBody(sha: string, opts?: GitOptions): string;
19
- export declare function commitParents(sha: string, opts?: GitOptions): string[];
20
- export declare function diffNames(from: string, to: string, opts?: GitOptions): string[];
21
- export declare function tagList(glob: string, opts?: GitOptions): string[];
22
- export declare function createTag(name: string, sha: string, opts?: TagOptions): void;
23
- export declare function pushTag(name: string, opts?: GitOptions): void;
15
+ export declare function headCommit(opts?: GitOptions): Promise<string>;
16
+ export declare function commitBody(sha: string, opts?: GitOptions): Promise<string>;
17
+ export declare function commitParents(sha: string, opts?: GitOptions): Promise<string[]>;
18
+ export declare function diffNames(from: string, to: string, opts?: GitOptions): Promise<string[]>;
19
+ export declare function tagList(glob: string, opts?: GitOptions): Promise<string[]>;
20
+ export declare function createTag(name: string, sha: string, opts?: TagOptions): Promise<void>;
21
+ export declare function pushTag(name: string, opts?: GitOptions): Promise<void>;
24
22
  /**
25
23
  * `git fetch --tags --force origin` — refresh every remote tag, forcing
26
24
  * updates for tags that moved on the remote. The `--force` is load-bearing
@@ -28,26 +26,26 @@ export declare function pushTag(name: string, opts?: GitOptions): void;
28
26
  * rejected as a non-fast-forward, failing the fetch. Used before the
29
27
  * floating-major-tag move re-derives "latest release" from local tags.
30
28
  */
31
- export declare function fetchTagsForce(opts?: GitOptions): void;
29
+ export declare function fetchTagsForce(opts?: GitOptions): Promise<void>;
32
30
  /**
33
31
  * `git tag -f <name> <target>` — create or move a lightweight tag to
34
32
  * `target`, overwriting an existing tag of the same name. The local half of
35
33
  * a floating-tag move; pair with `pushTagRefForce` to publish it.
36
34
  */
37
- export declare function forceTag(name: string, target: string, opts?: GitOptions): void;
35
+ export declare function forceTag(name: string, target: string, opts?: GitOptions): Promise<void>;
38
36
  /**
39
37
  * `git push --force origin refs/tags/<name>` — force-publish a single moved
40
38
  * tag, ref-scoped so it is invisible to every other tag. The remote half of
41
39
  * a floating-tag move: unlike `pushTagRef` (which fails on a non-fast-
42
40
  * forward), this overwrites the remote tag, which floating tags require.
43
41
  */
44
- export declare function pushTagRefForce(name: string, opts?: GitOptions): void;
42
+ export declare function pushTagRefForce(name: string, opts?: GitOptions): Promise<void>;
45
43
  /**
46
44
  * The tags whose commit is HEAD — `git tag --points-at HEAD`. Lists exactly
47
45
  * the tags the engine just created on this commit, with no fetch and no
48
46
  * remote dependency (#444). Empty array when HEAD carries no tag.
49
47
  */
50
- export declare function tagsPointingAtHead(opts?: GitOptions): string[];
48
+ export declare function tagsPointingAtHead(opts?: GitOptions): Promise<string[]>;
51
49
  /**
52
50
  * Push a single tag ref-scoped: `git push origin refs/tags/<name>`. Scoped
53
51
  * to the one ref so it is invisible to every other tag — a consumer's
@@ -57,20 +55,20 @@ export declare function tagsPointingAtHead(opts?: GitOptions): string[];
57
55
  * remote) still fails loudly, which the release concurrency group exists to
58
56
  * prevent. Distinct from `pushTag`, which pushes by bare name (#444).
59
57
  */
60
- export declare function pushTagRef(name: string, opts?: GitOptions): void;
58
+ export declare function pushTagRef(name: string, opts?: GitOptions): Promise<void>;
61
59
  /**
62
60
  * `git add -f <pathspec>` — stage `pathspec`, overriding `.gitignore`. The
63
61
  * action bundle (`dist-action/`) is gitignored on main and exists only on
64
62
  * tag commits, so folding it in requires the force flag.
65
63
  */
66
- export declare function addForce(pathspec: string, opts?: GitOptions): void;
64
+ export declare function addForce(pathspec: string, opts?: GitOptions): Promise<void>;
67
65
  /**
68
66
  * Whether the index holds staged changes — `git diff --cached --quiet`
69
67
  * exits non-zero when there are. Returns `true` when something is staged,
70
68
  * `false` on a clean index. Used to guard the fold against committing
71
69
  * nothing when `build:action` produced no bundle output.
72
70
  */
73
- export declare function hasStagedChanges(opts?: GitOptions): boolean;
71
+ export declare function hasStagedChanges(opts?: GitOptions): Promise<boolean>;
74
72
  /**
75
73
  * `git commit -m <subject> -m <body>` — commit the staged index with a
76
74
  * two-paragraph message. git joins the two `-m` values with a blank line,
@@ -79,12 +77,12 @@ export declare function hasStagedChanges(opts?: GitOptions): boolean;
79
77
  * the fold relies on so a `release:` trailer survives — see
80
78
  * notes/handoff/2026-04-24-dist-action.md).
81
79
  */
82
- export declare function commitWithBody(subject: string, body: string, opts?: GitOptions): void;
80
+ export declare function commitWithBody(subject: string, body: string, opts?: GitOptions): Promise<void>;
83
81
  /**
84
82
  * The commit a tag points at. `rev-list -n 1` dereferences an annotated
85
83
  * tag down to the commit it ultimately references.
86
84
  */
87
- export declare function tagCommit(name: string, opts?: GitOptions): string;
85
+ export declare function tagCommit(name: string, opts?: GitOptions): Promise<string>;
88
86
  /**
89
87
  * Find the highest-semver tag for a given package.
90
88
  *
@@ -96,6 +94,6 @@ export declare function tagCommit(name: string, opts?: GitOptions): string;
96
94
  *
97
95
  * Returns null when no tag for this package exists.
98
96
  */
99
- export declare function lastTag(packageName: string, tagFormat: string, opts?: GitOptions): string | null;
97
+ export declare function lastTag(packageName: string, tagFormat: string, opts?: GitOptions): Promise<string | null>;
100
98
  export {};
101
99
  //# sourceMappingURL=git.d.ts.map
package/dist/git.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"git.d.ts","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAMH,MAAM,WAAW,UAAU;IACzB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,UAAU,UAAW,SAAQ,UAAU;IACrC,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAgDD,wBAAgB,UAAU,CAAC,IAAI,GAAE,UAAe,GAAG,MAAM,CAExD;AAED,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,UAAe,GAAG,MAAM,CAGrE;AAED,wBAAgB,aAAa,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,GAAE,UAAe,GAAG,MAAM,EAAE,CAM1E;AAED,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,MAAM,EACV,IAAI,GAAE,UAAe,GACpB,MAAM,EAAE,CAIV;AAID,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,UAAe,GAAG,MAAM,EAAE,CAIrE;AAED,wBAAgB,SAAS,CACvB,IAAI,EAAE,MAAM,EACZ,GAAG,EAAE,MAAM,EACX,IAAI,GAAE,UAAe,GACpB,IAAI,CAGN;AAED,wBAAgB,OAAO,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,UAAe,GAAG,IAAI,CAEjE;AAED;;;;;;GAMG;AACH,wBAAgB,cAAc,CAAC,IAAI,GAAE,UAAe,GAAG,IAAI,CAE1D;AAED;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EA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AAC,IAAI,CAAC,CAEnF;AAID;;;;GAIG;AACH,wBAAsB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,IAAI,GAAE,UAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAErF;AAED;;;;;GAKG;AACH,wBAAsB,gBAAgB,CAAC,IAAI,GAAE,UAAe,GAAG,OAAO,CAAC,OAAO,CAAC,CAO9E;AAED;;;;;;;GAOG;AACH,wBAAsB,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,UAAe,GAAG,OAAO,CAAC,IAAI,CAAC,CAExG;AAID;;;GAGG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,EAAE,IAAI,GAAE,UAAe,GAAG,OAAO,CAAC,MAAM,CAAC,CAEpF;AAID;;;;;;;;;;GAUG;AACH,wBAAsB,OAAO,CAC3B,WAAW,EAAE,MAAM,EACnB,SAAS,EAAE,MAAM,EACjB,IAAI,GAAE,UAAe,GACpB,OAAO,CAAC,MAAM,GAAG,IAAI,CAAC,CAoBxB"}
package/dist/git.js CHANGED
@@ -1,31 +1,25 @@
1
1
  /**
2
2
  * Thin wrapper around the `git` CLI for the ops putitoutthere needs.
3
3
  *
4
- * Sync-only, by design — the caller is either CI (which we don't mind
5
- * blocking) or a doctor run (which is interactive). Stderr is captured
6
- * and surfaced in thrown errors so failures are diagnosable without
7
- * re-running with --verbose.
4
+ * Stderr is captured and surfaced in thrown errors so failures are
5
+ * diagnosable without re-running with --verbose.
8
6
  *
9
7
  * Issue #9. Plan: §13.6 (no-push tag model), §14.2 (last-tag resolver).
10
8
  */
11
- import { execFileSync } from 'node:child_process';
9
+ import { execCapture } from './utils/exec-capture.js';
10
+ import { ExecError } from './utils/exec-error.js';
12
11
  import { parseTagVersion, tagGlob } from './tag-template.js';
13
12
  import { parseSemver } from './version.js';
14
13
  /* ------------------------------ core ------------------------------ */
15
- function run(args, opts = {}) {
14
+ async function run(args, opts = {}) {
16
15
  try {
17
- return execFileSync('git', args, {
18
- cwd: opts.cwd,
19
- encoding: 'utf8',
20
- stdio: ['ignore', 'pipe', 'pipe'],
21
- }).trimEnd();
16
+ return (await execCapture('git', args, { cwd: opts.cwd })).stdout.trimEnd();
22
17
  }
23
18
  catch (err) {
24
- // execFileSync throws an Error whose `stderr` field carries git's
25
- // error output. Fold it into the thrown message so tests + logs
26
- // see the root cause without separate plumbing.
27
- /* v8 ignore start -- defensive: execFileSync always throws Error with .stderr */
28
- const stderr = err.stderr?.toString('utf8').trim();
19
+ // execCapture rejects with an ExecError whose `stderr` field carries
20
+ // git's error output (already a string). Fold it into the thrown
21
+ // message so tests + logs see the root cause without separate plumbing.
22
+ const stderr = err instanceof ExecError ? err.stderr.trim() : undefined;
29
23
  const base = err instanceof Error ? err.message : String(err);
30
24
  // `git tag -a` on a runner with no user.name/email surfaces as
31
25
  // "Please tell me who you are" / "unable to auto-detect email
@@ -35,6 +29,7 @@ function run(args, opts = {}) {
35
29
  /unable to auto-detect email address|Please tell me who you are/.test(stderr);
36
30
  if (needsIdentity) {
37
31
  throw new Error([
32
+ /* v8 ignore next -- args[0] is always defined: every git wrapper passes a non-empty argv, so the `?? ''` fallback is unreachable via the public API */
38
33
  `git ${args[0] ?? ''}: no committer identity configured.`,
39
34
  'piot cuts annotated tags which require `user.name` + `user.email`.',
40
35
  'Configure them in the publish job before invoking piot:',
@@ -47,47 +42,46 @@ function run(args, opts = {}) {
47
42
  ].join('\n'), { cause: err });
48
43
  }
49
44
  throw new Error(stderr ? `${base}\n${stderr}` : base, { cause: err });
50
- /* v8 ignore stop */
51
45
  }
52
46
  }
53
47
  /* ---------------------------- observers ---------------------------- */
54
- export function headCommit(opts = {}) {
48
+ export async function headCommit(opts = {}) {
55
49
  return run(['rev-parse', 'HEAD'], opts);
56
50
  }
57
- export function commitBody(sha, opts = {}) {
51
+ export async function commitBody(sha, opts = {}) {
58
52
  // %B = raw body (subject + body, no trailer folding).
59
53
  return run(['log', '-1', '--format=%B', sha], opts);
60
54
  }
61
- export function commitParents(sha, opts = {}) {
55
+ export async function commitParents(sha, opts = {}) {
62
56
  // %P = parent SHAs, space-separated. Merge commits have ≥2;
63
57
  // plain commits have 1; root commits have 0.
64
- const out = run(['log', '-1', '--format=%P', sha], opts);
58
+ const out = await run(['log', '-1', '--format=%P', sha], opts);
65
59
  if (out === '') {
66
60
  return [];
67
61
  }
68
62
  return out.split(' ').filter((s) => s.length > 0);
69
63
  }
70
- export function diffNames(from, to, opts = {}) {
71
- const out = run(['diff', '--name-only', `${from}..${to}`], opts);
64
+ export async function diffNames(from, to, opts = {}) {
65
+ const out = await run(['diff', '--name-only', `${from}..${to}`], opts);
72
66
  if (out === '') {
73
67
  return [];
74
68
  }
75
69
  return out.split('\n').filter((l) => l.length > 0);
76
70
  }
77
71
  /* ------------------------------ tags ------------------------------ */
78
- export function tagList(glob, opts = {}) {
79
- const out = run(['tag', '-l', glob], opts);
72
+ export async function tagList(glob, opts = {}) {
73
+ const out = await run(['tag', '-l', glob], opts);
80
74
  if (out === '') {
81
75
  return [];
82
76
  }
83
77
  return out.split('\n').filter((l) => l.length > 0);
84
78
  }
85
- export function createTag(name, sha, opts = {}) {
79
+ export async function createTag(name, sha, opts = {}) {
86
80
  const message = opts.message ?? name;
87
- run(['tag', '-a', '-m', message, name, sha], opts);
81
+ await run(['tag', '-a', '-m', message, name, sha], opts);
88
82
  }
89
- export function pushTag(name, opts = {}) {
90
- run(['push', 'origin', name], opts);
83
+ export async function pushTag(name, opts = {}) {
84
+ await run(['push', 'origin', name], opts);
91
85
  }
92
86
  /**
93
87
  * `git fetch --tags --force origin` — refresh every remote tag, forcing
@@ -96,16 +90,16 @@ export function pushTag(name, opts = {}) {
96
90
  * rejected as a non-fast-forward, failing the fetch. Used before the
97
91
  * floating-major-tag move re-derives "latest release" from local tags.
98
92
  */
99
- export function fetchTagsForce(opts = {}) {
100
- run(['fetch', '--tags', '--force', 'origin'], opts);
93
+ export async function fetchTagsForce(opts = {}) {
94
+ await run(['fetch', '--tags', '--force', 'origin'], opts);
101
95
  }
102
96
  /**
103
97
  * `git tag -f <name> <target>` — create or move a lightweight tag to
104
98
  * `target`, overwriting an existing tag of the same name. The local half of
105
99
  * a floating-tag move; pair with `pushTagRefForce` to publish it.
106
100
  */
107
- export function forceTag(name, target, opts = {}) {
108
- run(['tag', '-f', name, target], opts);
101
+ export async function forceTag(name, target, opts = {}) {
102
+ await run(['tag', '-f', name, target], opts);
109
103
  }
110
104
  /**
111
105
  * `git push --force origin refs/tags/<name>` — force-publish a single moved
@@ -113,16 +107,16 @@ export function forceTag(name, target, opts = {}) {
113
107
  * a floating-tag move: unlike `pushTagRef` (which fails on a non-fast-
114
108
  * forward), this overwrites the remote tag, which floating tags require.
115
109
  */
116
- export function pushTagRefForce(name, opts = {}) {
117
- run(['push', '--force', 'origin', `refs/tags/${name}`], opts);
110
+ export async function pushTagRefForce(name, opts = {}) {
111
+ await run(['push', '--force', 'origin', `refs/tags/${name}`], opts);
118
112
  }
119
113
  /**
120
114
  * The tags whose commit is HEAD — `git tag --points-at HEAD`. Lists exactly
121
115
  * the tags the engine just created on this commit, with no fetch and no
122
116
  * remote dependency (#444). Empty array when HEAD carries no tag.
123
117
  */
124
- export function tagsPointingAtHead(opts = {}) {
125
- const out = run(['tag', '--points-at', 'HEAD'], opts);
118
+ export async function tagsPointingAtHead(opts = {}) {
119
+ const out = await run(['tag', '--points-at', 'HEAD'], opts);
126
120
  if (out === '') {
127
121
  return [];
128
122
  }
@@ -137,8 +131,8 @@ export function tagsPointingAtHead(opts = {}) {
137
131
  * remote) still fails loudly, which the release concurrency group exists to
138
132
  * prevent. Distinct from `pushTag`, which pushes by bare name (#444).
139
133
  */
140
- export function pushTagRef(name, opts = {}) {
141
- run(['push', 'origin', `refs/tags/${name}`], opts);
134
+ export async function pushTagRef(name, opts = {}) {
135
+ await run(['push', 'origin', `refs/tags/${name}`], opts);
142
136
  }
143
137
  /* ---------------------------- staging ---------------------------- */
144
138
  /**
@@ -146,8 +140,8 @@ export function pushTagRef(name, opts = {}) {
146
140
  * action bundle (`dist-action/`) is gitignored on main and exists only on
147
141
  * tag commits, so folding it in requires the force flag.
148
142
  */
149
- export function addForce(pathspec, opts = {}) {
150
- run(['add', '-f', pathspec], opts);
143
+ export async function addForce(pathspec, opts = {}) {
144
+ await run(['add', '-f', pathspec], opts);
151
145
  }
152
146
  /**
153
147
  * Whether the index holds staged changes — `git diff --cached --quiet`
@@ -155,9 +149,9 @@ export function addForce(pathspec, opts = {}) {
155
149
  * `false` on a clean index. Used to guard the fold against committing
156
150
  * nothing when `build:action` produced no bundle output.
157
151
  */
158
- export function hasStagedChanges(opts = {}) {
152
+ export async function hasStagedChanges(opts = {}) {
159
153
  try {
160
- run(['diff', '--cached', '--quiet'], opts);
154
+ await run(['diff', '--cached', '--quiet'], opts);
161
155
  return false;
162
156
  }
163
157
  catch {
@@ -172,15 +166,15 @@ export function hasStagedChanges(opts = {}) {
172
166
  * the fold relies on so a `release:` trailer survives — see
173
167
  * notes/handoff/2026-04-24-dist-action.md).
174
168
  */
175
- export function commitWithBody(subject, body, opts = {}) {
176
- run(['commit', '-m', subject, '-m', body], opts);
169
+ export async function commitWithBody(subject, body, opts = {}) {
170
+ await run(['commit', '-m', subject, '-m', body], opts);
177
171
  }
178
172
  /* ------------------------------ tags ------------------------------ */
179
173
  /**
180
174
  * The commit a tag points at. `rev-list -n 1` dereferences an annotated
181
175
  * tag down to the commit it ultimately references.
182
176
  */
183
- export function tagCommit(name, opts = {}) {
177
+ export async function tagCommit(name, opts = {}) {
184
178
  return run(['rev-list', '-n', '1', name], opts);
185
179
  }
186
180
  /* -------------------------- last-tag resolver -------------------------- */
@@ -195,8 +189,8 @@ export function tagCommit(name, opts = {}) {
195
189
  *
196
190
  * Returns null when no tag for this package exists.
197
191
  */
198
- export function lastTag(packageName, tagFormat, opts = {}) {
199
- const candidates = tagList(tagGlob(tagFormat, packageName), opts);
192
+ export async function lastTag(packageName, tagFormat, opts = {}) {
193
+ const candidates = await tagList(tagGlob(tagFormat, packageName), opts);
200
194
  let best = null;
201
195
  for (const tag of candidates) {
202
196
  const versionPart = parseTagVersion(tagFormat, packageName, tag);
package/dist/git.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"git.js","sourceRoot":"","sources":["../src/git.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAClD,OAAO,EAAE,eAAe,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC7D,OAAO,EAAE,WAAW,EAAe,MAAM,cAAc,CAAC;AAUxD,wEAAwE;AAExE,SAAS,GAAG,CAAC,IAAc,EAAE,OAAmB,EAAE;IAChD,IAAI,CAAC;QACH,OAAO,YAAY,CAAC,KAAK,EAAE,IAAI,EAAE;YAC/B,GAAG,EAAE,IAAI,CAAC,GAAG;YACb,QAAQ,EAAE,MAAM;YAChB,KAAK,EAAE,CAAC,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC;SAClC,CAAC,CAAC,OAAO,EAAE,CAAC;IACf,CAAC;IAAC,OAAO,GAAG,EAAE,CAAC;QACb,kEAAkE;QAClE,gEAAgE;QAChE,gDAAgD;QAChD,iFAAiF;QACjF,MAAM,MAAM,GAAI,GAA2B,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM,CAAC,CAAC,IAAI,EAAE,CAAC;QAC5E,MAAM,IAAI,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC;QAC9D,+DAA+D;QAC/D,8DAA8D;QAC9D,+DAA+D;QAC/D,yBAAyB;QACzB,MAAM,aAAa,GACjB,MAAM,KAAK,SAAS;YACpB,gEAAgE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;QAChF,IAAI,aAAa,EAAE,CAAC;YAClB,MAAM,IAAI,KAAK,CACb;gBACE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,OAAO,IAAI,EAAE,GAAG,IAAI,IAAI,CAAC;AAC3B,CAAC;AAED,SAAS,OAAO,CAAC,CAAS,EAAE,CAAS;IACnC,sFAAsF;IACtF,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC;QAAA,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;IAAA,CAAC;IACpD,IAAI,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,KAAK,EAAE,CAAC;QAAA,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;IAAA,CAAC;IACpD,OAAO,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC;AAC3B,CAAC"}
package/dist/glob.d.ts CHANGED
@@ -20,5 +20,5 @@ export declare function matchesAny(patterns: readonly string[], path: string): b
20
20
  * directory — while a glob entry is matched one path segment at a time
21
21
  * against the real directory tree, so only existing directories come back.
22
22
  */
23
- export declare function expandDirGlob(baseDir: string, pattern: string): string[];
23
+ export declare function expandDirGlob(baseDir: string, pattern: string): Promise<string[]>;
24
24
  //# sourceMappingURL=glob.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../src/glob.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAaH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAElE;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAK7E;AAID;;;;;;;GAOG;AACH,wBAAgB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,EAAE,CAiBxE"}
1
+ {"version":3,"file":"glob.d.ts","sourceRoot":"","sources":["../src/glob.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAeH,wBAAgB,WAAW,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAElE;AAED,wBAAgB,UAAU,CAAC,QAAQ,EAAE,SAAS,MAAM,EAAE,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAK7E;AAID;;;;;;;GAOG;AACH,wBAAsB,aAAa,CAAC,OAAO,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,EAAE,CAAC,CAsBvF"}
package/dist/glob.js CHANGED
@@ -10,8 +10,9 @@
10
10
  *
11
11
  * Issue #10.
12
12
  */
13
- import { existsSync, readdirSync } from 'node:fs';
13
+ import { readdir } from 'node:fs/promises';
14
14
  import { join } from 'node:path';
15
+ import { pathExists } from './utils/path-exists.js';
15
16
  import { minimatch } from 'minimatch';
16
17
  const OPTS = {
17
18
  dot: true,
@@ -38,7 +39,7 @@ const GLOB_META = /[*?[\]{}]/;
38
39
  * directory — while a glob entry is matched one path segment at a time
39
40
  * against the real directory tree, so only existing directories come back.
40
41
  */
41
- export function expandDirGlob(baseDir, pattern) {
42
+ export async function expandDirGlob(baseDir, pattern) {
42
43
  const segments = pattern.split('/').filter((s) => s.length > 0);
43
44
  let dirs = [baseDir];
44
45
  for (const segment of segments) {
@@ -46,11 +47,20 @@ export function expandDirGlob(baseDir, pattern) {
46
47
  dirs = dirs.map((d) => join(d, segment));
47
48
  continue;
48
49
  }
49
- dirs = dirs
50
- .filter((d) => existsSync(d))
51
- .flatMap((d) => readdirSync(d, { withFileTypes: true })
52
- .filter((e) => e.isDirectory() && matchesGlob(segment, e.name))
53
- .map((e) => join(d, e.name)));
50
+ // Sequential expansion (no Promise.all): matches the prior flatMap
51
+ // order — readdir order within each dir, dirs in their existing order.
52
+ const next = [];
53
+ for (const d of dirs) {
54
+ if (!(await pathExists(d))) {
55
+ continue;
56
+ }
57
+ for (const e of await readdir(d, { withFileTypes: true })) {
58
+ if (e.isDirectory() && matchesGlob(segment, e.name)) {
59
+ next.push(join(d, e.name));
60
+ }
61
+ }
62
+ }
63
+ dirs = next;
54
64
  }
55
65
  return dirs;
56
66
  }
package/dist/glob.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"glob.js","sourceRoot":"","sources":["../src/glob.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAClD,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAEjC,OAAO,EAAE,SAAS,EAAE,MAAM,WAAW,CAAC;AAEtC,MAAM,IAAI,GAAG;IACX,GAAG,EAAE,IAAI;IACT,SAAS,EAAE,KAAK;IAChB,SAAS,EAAE,IAAI,EAAE,oDAAoD;CAC7D,CAAC;AAEX,MAAM,UAAU,WAAW,CAAC,OAAe,EAAE,IAAY;IACvD,OAAO,SAAS,CAAC,IAAI,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;AACxC,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,QAA2B,EAAE,IAAY;IAClE,KAAK,MAAM,CAAC,IAAI,QAAQ,EAAE,CAAC;QACzB,IAAI,WAAW,CAAC,CAAC,EAAE,IAAI,CAAC,EAAE,CAAC;YAAA,OAAO,IAAI,CAAC;QAAA,CAAC;IAC1C,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC;AAED,MAAM,SAAS,GAAG,WAAW,CAAC;AAE9B;;;;;;;GAOG;AACH,MAAM,UAAU,aAAa,CAAC,OAAe,EAAE,OAAe;IAC5D,MAAM,QAAQ,GAAG,OAAO,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC;IAChE,IAAI,IAAI,GAAG,CAAC,OAAO,CAAC,CAAC;IACrB,KAAK,MAAM,OAAO,IAAI,QAAQ,EAAE,CAAC;QAC/B,IAAI,CAAC,SAAS,CAAC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BACpD,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC;gBAC7B,CAAC;YACH,CAAC;QACH,CAAC;QACD,IAAI,GAAG,IAAI,CAAC;IACd,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
@@ -55,7 +55,7 @@ export declare function replaceCargoVersion(source: string, version: string): st
55
55
  * a git work tree, git command missing, etc) — callers treat null as
56
56
  * "can't verify, fall through to cargo's own --allow-dirty behavior."
57
57
  */
58
- export declare function scanDirtyOutsideManifest(cwd: string, pkgPath: string, artifactsRoot?: string, siblingPackagePaths?: readonly string[]): string[] | null;
58
+ export declare function scanDirtyOutsideManifest(cwd: string, pkgPath: string, artifactsRoot?: string, siblingPackagePaths?: readonly string[]): Promise<string[] | null>;
59
59
  export declare function relativeOrSelf(base: string, target: string): string;
60
60
  export declare const crates: Handler;
61
61
  //# sourceMappingURL=crates.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"crates.d.ts","sourceRoot":"","sources":["../../src/handlers/crates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAMH,OAAO,KAAK,EAAO,OAAO,EAA+B,MAAM,aAAa,CAAC;AAwO7E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAOpF;AAUD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAa3E;AAED;;;;;GAKG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,MAAM,EACtB,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,GACtC,MAAM,EAAE,GAAG,IAAI,CA2FjB;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAOnE;AA6CD,eAAO,MAAM,MAAM,EAAE,OAOpB,CAAC"}
1
+ {"version":3,"file":"crates.d.ts","sourceRoot":"","sources":["../../src/handlers/crates.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;GA2BG;AAKH,OAAO,KAAK,EAAO,OAAO,EAA+B,MAAM,aAAa,CAAC;AAqO7E;;;;;;;;;;;;;GAaG;AACH,wBAAgB,gCAAgC,CAAC,MAAM,EAAE,MAAM,GAAG,SAAS,GAAG,OAAO,CAOpF;AAUD;;;;;GAKG;AACH,wBAAgB,mBAAmB,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,GAAG,MAAM,CAa3E;AAED;;;;;GAKG;AACH,wBAAsB,wBAAwB,CAC5C,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,MAAM,EACf,aAAa,CAAC,EAAE,MAAM,EACtB,mBAAmB,CAAC,EAAE,SAAS,MAAM,EAAE,GACtC,OAAO,CAAC,MAAM,EAAE,GAAG,IAAI,CAAC,CAqF1B;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAOnE;AA6CD,eAAO,MAAM,MAAM,EAAE,OAOpB,CAAC"}
@@ -26,13 +26,15 @@
26
26
  * drive the exchange -- it just reads the env var the workflow wired
27
27
  * up (same for classic token fallback).
28
28
  */
29
- import { execFileSync } from 'node:child_process';
30
- import { readFileSync, writeFileSync } from 'node:fs';
29
+ import { readFile, writeFile } from 'node:fs/promises';
31
30
  import { join, relative } from 'node:path';
32
31
  import { TransientError } from '../types.js';
33
32
  import { ErrorCodes } from '../error-codes.js';
34
33
  import { buildSubprocessEnv, nonEmpty } from '../env.js';
34
+ import { toError } from '../to-error.js';
35
35
  import { USER_AGENT } from '../version.js';
36
+ import { execCapture } from '../utils/exec-capture.js';
37
+ import { ExecError } from '../utils/exec-error.js';
36
38
  const REGISTRY = 'https://crates.io';
37
39
  async function isPublishedImpl(pkg, version, _ctx) {
38
40
  const crateName = crateNameFor(pkg);
@@ -53,33 +55,30 @@ async function isPublishedImpl(pkg, version, _ctx) {
53
55
  /* v8 ignore next -- defensive 4xx fallthrough; crates.io returns 200/404 for this endpoint */
54
56
  throw new Error(`crates.io GET ${url} returned ${res.status}`);
55
57
  }
56
- function writeVersionImpl(pkg, version, _ctx) {
58
+ async function writeVersionImpl(pkg, version, _ctx) {
57
59
  const cargoPath = join(pkg.path, 'Cargo.toml');
58
60
  let original;
59
61
  try {
60
- original = readFileSync(cargoPath, 'utf8');
62
+ original = await readFile(cargoPath, 'utf8');
61
63
  }
62
64
  catch (err) {
63
65
  if (err.code === 'ENOENT') {
64
- return Promise.reject(new Error(`Cargo.toml not found at ${cargoPath}`));
66
+ throw new Error(`Cargo.toml not found at ${cargoPath}`, { cause: err });
65
67
  }
66
- return Promise.reject(err instanceof Error ? err : new Error(String(err)));
68
+ throw toError(err);
67
69
  }
68
70
  let updated;
69
71
  try {
70
72
  updated = replaceCargoVersion(original, version);
71
73
  }
72
74
  catch (err) {
73
- return Promise.reject(err instanceof Error
74
- ? err
75
- : /* v8 ignore next -- replaceCargoVersion only ever throws Error, so this String(err) fallback is unreachable */
76
- new Error(String(err)));
75
+ throw toError(err);
77
76
  }
78
77
  if (updated === original) {
79
- return Promise.resolve([]);
78
+ return [];
80
79
  }
81
- writeFileSync(cargoPath, updated, 'utf8');
82
- return Promise.resolve([cargoPath]);
80
+ await writeFile(cargoPath, updated, 'utf8');
81
+ return [cargoPath];
83
82
  }
84
83
  async function publishImpl(pkg, version, ctx) {
85
84
  if (await isPublishedImpl(pkg, version, ctx)) {
@@ -97,7 +96,7 @@ async function publishImpl(pkg, version, ctx) {
97
96
  // `npm install + npm run build` per npm package before the engine
98
97
  // publishes). cargo only packs files inside its own package dir, so
99
98
  // sibling-package state can't end up in the crate tarball anyway.
100
- const unexpected = scanDirtyOutsideManifest(ctx.cwd, pkg.path, ctx.artifactsRoot, ctx.siblingPackagePaths);
99
+ const unexpected = await scanDirtyOutsideManifest(ctx.cwd, pkg.path, ctx.artifactsRoot, ctx.siblingPackagePaths);
101
100
  if (unexpected !== null && unexpected.length > 0) {
102
101
  throw new Error([
103
102
  `cargo publish: refusing to proceed; unexpected dirty files in the working tree outside ${relativeOrSelf(ctx.cwd, join(pkg.path, 'Cargo.toml'))}:`,
@@ -127,7 +126,7 @@ async function publishImpl(pkg, version, ctx) {
127
126
  // to today's real-crates.io-only behavior in that case.
128
127
  const primaryOverride = nonEmpty(ctx.env.PIOT_CRATES_REGISTRY_PRIMARY);
129
128
  const fallbackUrl = nonEmpty(ctx.env.PIOT_CRATES_REGISTRY_FALLBACK);
130
- const runPublish = (registryUrl) => {
129
+ const runPublish = async (registryUrl) => {
131
130
  // cargo refuses to invoke `publish --index <url>` without an
132
131
  // explicit `--token` argument at the CLI parser level — neither
133
132
  // CARGO_REGISTRY_TOKEN nor credentials.toml entries unblock it.
@@ -141,21 +140,20 @@ async function publishImpl(pkg, version, ctx) {
141
140
  const args = registryUrl
142
141
  ? [...baseArgs, '--index', registryUrl, '--token', 'piot-alt-registry-placeholder']
143
142
  : baseArgs;
144
- execFileSync('cargo', args, {
143
+ await execCapture('cargo', args, {
145
144
  cwd: ctx.cwd,
146
145
  // #138: minimal env. The parent process.env leaks unrelated
147
146
  // secrets to cargo; forward only a known-safe baseline plus the
148
147
  // workflow-declared ctx.env (which carries CARGO_REGISTRY_TOKEN
149
148
  // and OIDC vars when present).
150
149
  env: buildSubprocessEnv(ctx.env, { CARGO_TERM_VERBOSE: 'true' }),
151
- stdio: ['ignore', 'pipe', 'pipe'],
152
150
  });
153
151
  };
154
152
  try {
155
- runPublish(primaryOverride);
153
+ await runPublish(primaryOverride);
156
154
  }
157
155
  catch (err) {
158
- const stderr = err.stderr?.toString('utf8').trim();
156
+ const stderr = err instanceof ExecError ? err.stderr.trim() : undefined;
159
157
  // 429-only fallback. Predicate scoped narrowly to rate-limit prose
160
158
  // so non-rate-limit failures (auth, network, validation) surface
161
159
  // verbatim. Only fires when the workflow provisioned a fallback AND
@@ -169,10 +167,10 @@ async function publishImpl(pkg, version, ctx) {
169
167
  // isn't misled by the green check.
170
168
  process.stdout.write(`::warning::crates.io returned 429; falling back to ${fallbackUrl} (real OIDC-TP path not exercised this run)\n`);
171
169
  try {
172
- runPublish(fallbackUrl);
170
+ await runPublish(fallbackUrl);
173
171
  }
174
172
  catch (retryErr) {
175
- const retryStderr = retryErr.stderr?.toString('utf8').trim();
173
+ const retryStderr = retryErr instanceof ExecError ? retryErr.stderr.trim() : undefined;
176
174
  const retryBase = retryErr instanceof Error ? retryErr.message : String(retryErr);
177
175
  throw new Error(`cargo publish (fallback ${fallbackUrl}) failed${retryStderr ? `:\n${retryStderr}` : `: ${retryBase}`}`, { cause: retryErr });
178
176
  }
@@ -285,15 +283,13 @@ export function replaceCargoVersion(source, version) {
285
283
  * a git work tree, git command missing, etc) — callers treat null as
286
284
  * "can't verify, fall through to cargo's own --allow-dirty behavior."
287
285
  */
288
- export function scanDirtyOutsideManifest(cwd, pkgPath, artifactsRoot, siblingPackagePaths) {
286
+ export async function scanDirtyOutsideManifest(cwd, pkgPath, artifactsRoot, siblingPackagePaths) {
289
287
  // Confirm we're inside a git work tree. If not, bail and let cargo's
290
288
  // own --allow-dirty handling take over.
291
289
  try {
292
- const topOut = execFileSync('git', ['rev-parse', '--show-toplevel'], {
290
+ const topOut = (await execCapture('git', ['rev-parse', '--show-toplevel'], {
293
291
  cwd,
294
- encoding: 'utf8',
295
- stdio: ['ignore', 'pipe', 'pipe'],
296
- });
292
+ })).stdout;
297
293
  if (!topOut.trim()) {
298
294
  return null;
299
295
  }
@@ -307,11 +303,9 @@ export function scanDirtyOutsideManifest(cwd, pkgPath, artifactsRoot, siblingPac
307
303
  // Windows 8.3 short names + case-insensitive FS).
308
304
  let managedRel = '';
309
305
  try {
310
- managedRel = execFileSync('git', ['ls-files', '--full-name', '--', 'Cargo.toml'], {
306
+ managedRel = (await execCapture('git', ['ls-files', '--full-name', '--', 'Cargo.toml'], {
311
307
  cwd: pkgPath,
312
- encoding: 'utf8',
313
- stdio: ['ignore', 'pipe', 'pipe'],
314
- }).trim();
308
+ })).stdout.trim();
315
309
  /* v8 ignore next 4 -- Cargo.toml is always tracked at publish time */
316
310
  }
317
311
  catch {
@@ -320,11 +314,9 @@ export function scanDirtyOutsideManifest(cwd, pkgPath, artifactsRoot, siblingPac
320
314
  }
321
315
  let porcelain;
322
316
  try {
323
- porcelain = execFileSync('git', ['status', '--porcelain'], {
317
+ porcelain = (await execCapture('git', ['status', '--porcelain'], {
324
318
  cwd,
325
- encoding: 'utf8',
326
- stdio: ['ignore', 'pipe', 'pipe'],
327
- });
319
+ })).stdout;
328
320
  /* v8 ignore start -- rev-parse succeeded above, status shouldn't fail */
329
321
  }
330
322
  catch {