@visulima/vis 3.0.0 → 3.0.2

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 (306) hide show
  1. package/CHANGELOG.md +19 -0
  2. package/LICENSE.md +5760 -4562
  3. package/dashboard/dist/index.html +12 -12
  4. package/dist/bin.js +1 -1
  5. package/dist/binx.js +2 -2
  6. package/dist/config/index.js +1 -1
  7. package/dist/packem_chunks/CONFIG_FILES.js +6 -6
  8. package/dist/packem_chunks/DEFAULT_CLEAN_KEEP.js +1 -1
  9. package/dist/packem_chunks/agent-instructions.js +7 -7
  10. package/dist/packem_chunks/bloom-status.js +2 -2
  11. package/dist/packem_chunks/bloom-sync.js +2 -2
  12. package/dist/packem_chunks/cache-attestation.js +1 -1
  13. package/dist/packem_chunks/catalog-detector.js +1 -1
  14. package/dist/packem_chunks/catalog.js +87 -111
  15. package/dist/packem_chunks/cli-exec.js +1 -1
  16. package/dist/packem_chunks/cli-main.js +192 -217
  17. package/dist/packem_chunks/defineReleasePlugin.js +3 -3
  18. package/dist/packem_chunks/detect.js +8 -3
  19. package/dist/packem_chunks/devtools.js +1 -1
  20. package/dist/packem_chunks/discord.js +4 -4
  21. package/dist/packem_chunks/dispatch.js +4 -4
  22. package/dist/packem_chunks/doctor-probe.js +2 -2
  23. package/dist/packem_chunks/extra-files.js +3 -3
  24. package/dist/packem_chunks/fix.js +11 -11
  25. package/dist/packem_chunks/git.js +3 -3
  26. package/dist/packem_chunks/group-tags.js +1 -1
  27. package/dist/packem_chunks/handler.js +1 -1
  28. package/dist/packem_chunks/handler10.js +5 -5
  29. package/dist/packem_chunks/handler11.js +1 -1
  30. package/dist/packem_chunks/handler12.js +16 -16
  31. package/dist/packem_chunks/handler13.js +5 -5
  32. package/dist/packem_chunks/handler14.js +1 -1
  33. package/dist/packem_chunks/handler15.js +1 -1
  34. package/dist/packem_chunks/handler16.js +1 -1
  35. package/dist/packem_chunks/handler17.js +1 -1
  36. package/dist/packem_chunks/handler18.js +1 -1
  37. package/dist/packem_chunks/handler19.js +5 -5
  38. package/dist/packem_chunks/handler2.js +1 -1
  39. package/dist/packem_chunks/handler20.js +2 -2
  40. package/dist/packem_chunks/handler21.js +2 -2
  41. package/dist/packem_chunks/handler22.js +8 -8
  42. package/dist/packem_chunks/handler23.js +1 -1
  43. package/dist/packem_chunks/handler24.js +1 -1
  44. package/dist/packem_chunks/handler25.js +1 -1
  45. package/dist/packem_chunks/handler26.js +5 -5
  46. package/dist/packem_chunks/handler27.js +1 -1
  47. package/dist/packem_chunks/handler28.js +3 -3
  48. package/dist/packem_chunks/handler29.js +1 -1
  49. package/dist/packem_chunks/handler3.js +2 -2
  50. package/dist/packem_chunks/handler30.js +1 -1
  51. package/dist/packem_chunks/handler31.js +2 -2
  52. package/dist/packem_chunks/handler32.js +2 -2
  53. package/dist/packem_chunks/handler33.js +2 -2
  54. package/dist/packem_chunks/handler34.js +3 -3
  55. package/dist/packem_chunks/handler35.js +5 -5
  56. package/dist/packem_chunks/handler36.js +1 -1
  57. package/dist/packem_chunks/handler37.js +2 -2
  58. package/dist/packem_chunks/handler38.js +6 -6
  59. package/dist/packem_chunks/handler39.js +8 -8
  60. package/dist/packem_chunks/handler4.js +4 -4
  61. package/dist/packem_chunks/handler40.js +34 -34
  62. package/dist/packem_chunks/handler41.js +5 -5
  63. package/dist/packem_chunks/handler42.js +4 -4
  64. package/dist/packem_chunks/handler43.js +3 -3
  65. package/dist/packem_chunks/handler44.js +2 -2
  66. package/dist/packem_chunks/handler45.js +1 -1
  67. package/dist/packem_chunks/handler46.js +1 -1
  68. package/dist/packem_chunks/handler47.js +1 -1
  69. package/dist/packem_chunks/handler48.js +3 -3
  70. package/dist/packem_chunks/handler49.js +1 -1
  71. package/dist/packem_chunks/handler5.js +6 -6
  72. package/dist/packem_chunks/handler50.js +6 -6
  73. package/dist/packem_chunks/handler51.js +13 -13
  74. package/dist/packem_chunks/handler52.js +3 -3
  75. package/dist/packem_chunks/handler53.js +5 -5
  76. package/dist/packem_chunks/handler54.js +2 -2
  77. package/dist/packem_chunks/handler55.js +1 -1
  78. package/dist/packem_chunks/handler56.js +4 -4
  79. package/dist/packem_chunks/handler57.js +5 -5
  80. package/dist/packem_chunks/handler58.js +5 -5
  81. package/dist/packem_chunks/handler59.js +8 -8
  82. package/dist/packem_chunks/handler6.js +7 -7
  83. package/dist/packem_chunks/handler60.js +3 -3
  84. package/dist/packem_chunks/handler61.js +21 -21
  85. package/dist/packem_chunks/handler62.js +12 -12
  86. package/dist/packem_chunks/handler63.js +3 -3
  87. package/dist/packem_chunks/handler64.js +5 -5
  88. package/dist/packem_chunks/handler65.js +8 -8
  89. package/dist/packem_chunks/handler66.js +2 -2
  90. package/dist/packem_chunks/handler67.js +25 -24
  91. package/dist/packem_chunks/handler68.js +153 -25
  92. package/dist/packem_chunks/handler69.js +10 -153
  93. package/dist/packem_chunks/handler7.js +1 -1
  94. package/dist/packem_chunks/handler70.js +22 -10
  95. package/dist/packem_chunks/handler71.js +17 -17
  96. package/dist/packem_chunks/handler72.js +104 -104
  97. package/dist/packem_chunks/handler73.js +20 -20
  98. package/dist/packem_chunks/handler74.js +45 -45
  99. package/dist/packem_chunks/handler75.js +27 -3
  100. package/dist/packem_chunks/handler76.js +3 -27
  101. package/dist/packem_chunks/handler77.js +68 -68
  102. package/dist/packem_chunks/handler78.js +30 -30
  103. package/dist/packem_chunks/handler8.js +1 -1
  104. package/dist/packem_chunks/handler9.js +1 -1
  105. package/dist/packem_chunks/heal-accept.js +9 -9
  106. package/dist/packem_chunks/heal.js +11 -11
  107. package/dist/packem_chunks/help-command.js +7 -63
  108. package/dist/packem_chunks/index.js +1 -1
  109. package/dist/packem_chunks/index2.js +48 -804
  110. package/dist/packem_chunks/index3.js +3 -7
  111. package/dist/packem_chunks/index4.js +801 -134
  112. package/dist/packem_chunks/index5.js +7 -73
  113. package/dist/packem_chunks/index6.js +73 -0
  114. package/dist/packem_chunks/index7.js +135 -0
  115. package/dist/packem_chunks/interface.js +2 -2
  116. package/dist/packem_chunks/keys-refresh.js +4 -4
  117. package/dist/packem_chunks/lean.js +3 -3
  118. package/dist/packem_chunks/list.js +3 -3
  119. package/dist/packem_chunks/loader.js +4 -4
  120. package/dist/packem_chunks/loader2.js +1 -1
  121. package/dist/packem_chunks/orchestrator.js +27 -27
  122. package/dist/packem_chunks/pre-mode.js +2 -2
  123. package/dist/packem_chunks/print-config.js +1 -1
  124. package/dist/packem_chunks/prompts.js +7 -7
  125. package/dist/packem_chunks/prune.js +3 -3
  126. package/dist/packem_chunks/publish-guards.js +1 -1
  127. package/dist/packem_chunks/resolveFormatter.js +5 -5
  128. package/dist/packem_chunks/run.js +1 -1
  129. package/dist/packem_chunks/security.js +1 -1
  130. package/dist/packem_chunks/shell-runner.js +1 -1
  131. package/dist/packem_chunks/slack.js +2 -2
  132. package/dist/packem_chunks/snapshot.js +2 -2
  133. package/dist/packem_chunks/stage-publisher.js +1 -1
  134. package/dist/packem_chunks/staged-registry.js +2 -2
  135. package/dist/packem_chunks/state.js +3 -3
  136. package/dist/packem_chunks/status.js +2 -2
  137. package/dist/packem_chunks/success-walk.js +4 -4
  138. package/dist/packem_chunks/sync.js +2 -2
  139. package/dist/packem_chunks/sync2.js +2 -2
  140. package/dist/packem_chunks/tar.js +3 -3
  141. package/dist/packem_chunks/tripwire.js +2 -2
  142. package/dist/packem_chunks/ts-loader.js +5 -9
  143. package/dist/packem_chunks/verify-lockfile.js +2 -2
  144. package/dist/packem_chunks/version-resolver.js +2 -2
  145. package/dist/packem_chunks/webhook.js +1 -1
  146. package/dist/packem_chunks/workflow-templates.js +5 -5
  147. package/dist/packem_chunks/workspace.js +2 -2
  148. package/dist/packem_shared/ReleaseClient-DAvbxCdo.js +1 -0
  149. package/dist/packem_shared/Table-DyORjLji-CC9cYgCG.js +11 -0
  150. package/dist/packem_shared/{VisReleaseError-DMGRBTNO.js → VisReleaseError-DZtgcKf8.js} +1 -1
  151. package/dist/packem_shared/_commonjsHelpers-DTfxOvZk.js +1 -0
  152. package/dist/packem_shared/advisories-DZd1uGqa.js +1 -0
  153. package/dist/packem_shared/affected-selection-CoRXp5H4.js +1 -0
  154. package/dist/packem_shared/affected-shas-Dd0P7fGD.js +1 -0
  155. package/dist/packem_shared/ai-analysis-DSQQDFU9.js +68 -0
  156. package/dist/packem_shared/ai-fix-6nXZbecQ.js +43 -0
  157. package/dist/packem_shared/augment-COAiXSIx.js +4 -0
  158. package/dist/packem_shared/bin-C2eYtJ_N.js +1 -0
  159. package/dist/packem_shared/build-scripts-pdVmqXRm.js +1 -0
  160. package/dist/packem_shared/clean-DRiLimTx.js +1 -0
  161. package/dist/packem_shared/command-runtime-CiLVo4ED.js +1 -0
  162. package/dist/packem_shared/{compile-cache-B_Vf_WxT.js → compile-cache-DoMHRsRZ.js} +1 -1
  163. package/dist/packem_shared/createAdapter-F7GidOzU.js +1 -0
  164. package/dist/packem_shared/createVersionActions-ByaJ1Nbv.js +1 -0
  165. package/dist/packem_shared/cyclonedx-B1vzerwP.js +4 -0
  166. package/dist/packem_shared/dependency-scan-DBH2Qo4I.js +1 -0
  167. package/dist/packem_shared/docker-Bex05Qcn.js +59 -0
  168. package/dist/packem_shared/failure-log-D92tM0ie.js +2 -0
  169. package/dist/packem_shared/formatBytes-BHAzNIrn-DFIppnY0.js +4 -0
  170. package/dist/packem_shared/getRandomSpinner-4ZEcbTYv-DCyIuj19.js +1 -0
  171. package/dist/packem_shared/giget-D8Kwb0kD.js +2 -0
  172. package/dist/packem_shared/glob-Cyk1H9ZL-ox19CSsT.js +1 -0
  173. package/dist/packem_shared/index-B4AjSxHU.js +1 -0
  174. package/dist/packem_shared/index-BisalDCf.js +39 -0
  175. package/dist/packem_shared/{index-BWl4DbMp.js → index-BjdW45xX.js} +1 -1
  176. package/dist/packem_shared/index-DHD8wb6Z.js +22 -0
  177. package/dist/packem_shared/index-DXPSWMbG.js +1 -0
  178. package/dist/packem_shared/index.server-BAjDJSEu.js +2 -0
  179. package/dist/packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js +1 -0
  180. package/dist/packem_shared/license-DvlYdo6T.js +1 -0
  181. package/dist/packem_shared/lifecycle-CfTZQHOG.js +2 -0
  182. package/dist/packem_shared/lockfile-35RFsJDs.js +1 -0
  183. package/dist/packem_shared/lockfile-DhHAaHN5.js +1 -0
  184. package/dist/packem_shared/main-BP-w-K-6.js +1 -0
  185. package/dist/packem_shared/manifests-BNSmpPF_.js +1 -0
  186. package/dist/packem_shared/min-release-age-ChzTC7_I.js +34 -0
  187. package/dist/packem_shared/missing-package-json-C0keIt78.js +1 -0
  188. package/dist/packem_shared/native-config-sync-BSzU4qUO.js +21 -0
  189. package/dist/packem_shared/osv-bloom-1JS__1or.js +2 -0
  190. package/dist/packem_shared/otelPlugin-D8LL2-4L.js +1 -0
  191. package/dist/packem_shared/package-version-Bb7KGF36.js +4 -0
  192. package/dist/packem_shared/packument-C55kVxcQ.js +1 -0
  193. package/dist/packem_shared/{peer-warnings-BXAzXqY3.js → peer-warnings-CmYSxvql.js} +1 -1
  194. package/dist/packem_shared/pm-runner-de-jCq8q.js +1 -0
  195. package/dist/packem_shared/project-name-filter-DYaIbrXa.js +7 -0
  196. package/dist/packem_shared/{prompt-BSAy8SMH.js → prompt-DMzaQEVa.js} +1 -1
  197. package/dist/packem_shared/provenance-CvfQEJPQ.js +1 -0
  198. package/dist/packem_shared/readJsonSync-CbryXYxN-B2aSeDpC.js +1 -0
  199. package/dist/packem_shared/registry-keys-DmBrAlhg.js +1 -0
  200. package/dist/packem_shared/resolve-explicit-DYaHAVDg.js +5 -0
  201. package/dist/packem_shared/resolve-runtime-C7NBCA1C.js +1 -0
  202. package/dist/packem_shared/run-file-jMngGQhs.js +1 -0
  203. package/dist/packem_shared/runtime-check-BklgEMkC.js +1 -0
  204. package/dist/packem_shared/s1ngularity-C8sva2SO.js +1 -0
  205. package/dist/packem_shared/scan-progress-aVHGZYWf.js +2 -0
  206. package/dist/packem_shared/selectors-B7lSFz7l.js +3 -0
  207. package/dist/packem_shared/signatures-oZ_2IneN.js +2 -0
  208. package/dist/packem_shared/{slug-DoueYuLo.js → slug-OBHcH7wV.js} +1 -1
  209. package/dist/packem_shared/spinner-CbJfWYwB.js +1 -0
  210. package/dist/packem_shared/sticky-comment-DjhyCIZt.js +1 -0
  211. package/dist/packem_shared/subtree-DtmcKAJK.js +2 -0
  212. package/dist/packem_shared/symbols-BXDZ_sKt.js +1 -0
  213. package/dist/packem_shared/tabs-BilwonkM.js +1 -0
  214. package/dist/packem_shared/target-merge-DCGow6Kw.js +4 -0
  215. package/dist/packem_shared/target-options-d_rIrLyq.js +1 -0
  216. package/dist/packem_shared/toolchain-DY11tPCw.js +5 -0
  217. package/dist/packem_shared/typosquats-Cdsnf6aN.js +1 -0
  218. package/dist/packem_shared/use-measured-height-BPQg2q_p.js +1 -0
  219. package/dist/packem_shared/utils-DQFHJn72.js +1 -0
  220. package/dist/packem_shared/verify-D8wYvB85.js +1 -0
  221. package/dist/packem_shared/vis-update-app-ngwL2mRv.js +1 -0
  222. package/dist/packem_shared/vis-user-error-CAu9wIbe.js +30 -0
  223. package/dist/packem_shared/watch-Dswvj6Zp.js +1 -0
  224. package/dist/packem_shared/watch-loop-COWvvSbR.js +11 -0
  225. package/dist/packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js +1 -0
  226. package/dist/release/core/changelog/index.d.ts +62 -2
  227. package/dist/release/core/package-managers/index.d.ts +25 -1
  228. package/dist/release/core/package-managers/index.js +1 -1
  229. package/dist/release/core/version-actions/index.d.ts +47 -2
  230. package/dist/release/core/version-actions/index.js +1 -1
  231. package/dist/release/index.d.ts +100 -1
  232. package/dist/release/index.js +1 -1
  233. package/dist/release/plugin-sdk.d.ts +16 -1
  234. package/dist/release/plugin-sdk.js +1 -1
  235. package/dist/release/presets.js +1 -1
  236. package/dist/release/types.js +1 -1
  237. package/dist/runtime/preload.js +1 -1
  238. package/index.js +26 -26
  239. package/package.json +14 -14
  240. package/dist/packem_chunks/detect2.js +0 -8
  241. package/dist/packem_chunks/registry.js +0 -48
  242. package/dist/packem_shared/ReleaseClient-BY4OZNCK.js +0 -1
  243. package/dist/packem_shared/_commonjsHelpers-B5Y90VFO.js +0 -1
  244. package/dist/packem_shared/advisories-DsXRmIA5.js +0 -1
  245. package/dist/packem_shared/affected-selection-BE6VFCDV.js +0 -1
  246. package/dist/packem_shared/affected-shas-BKEu4RZc.js +0 -1
  247. package/dist/packem_shared/ai-analysis-DikAj6rX.js +0 -68
  248. package/dist/packem_shared/ai-fix-bfWo0cZX.js +0 -43
  249. package/dist/packem_shared/augment-BkJxi_GW.js +0 -4
  250. package/dist/packem_shared/bin-B-TytgzW.js +0 -1
  251. package/dist/packem_shared/build-scripts-DWypBQ--.js +0 -1
  252. package/dist/packem_shared/clean-DWjQl14S.js +0 -1
  253. package/dist/packem_shared/command-runtime-DQ7ZpLYL.js +0 -1
  254. package/dist/packem_shared/createAdapter-bU4DIP3F.js +0 -1
  255. package/dist/packem_shared/createVersionActions-BK43SNDH.js +0 -1
  256. package/dist/packem_shared/cyclonedx-DLBi65MV.js +0 -4
  257. package/dist/packem_shared/dependency-scan-ZLOuLkGN.js +0 -1
  258. package/dist/packem_shared/docker-B4zAZCZG.js +0 -59
  259. package/dist/packem_shared/en-BDYMmM2_.js +0 -27
  260. package/dist/packem_shared/failure-log-DyhWPqno.js +0 -2
  261. package/dist/packem_shared/giget-CAxjpwew.js +0 -2
  262. package/dist/packem_shared/glob-BUjyjdE8-Dp_QcayW.js +0 -1
  263. package/dist/packem_shared/index-BAe6e0XE.js +0 -1
  264. package/dist/packem_shared/index-BLtnel38.js +0 -35
  265. package/dist/packem_shared/index-CuKDxOCI.js +0 -1
  266. package/dist/packem_shared/index-tNFGWxc0.js +0 -39
  267. package/dist/packem_shared/index.server-CusjRLCh.js +0 -2
  268. package/dist/packem_shared/license-t5KnNX6v.js +0 -1
  269. package/dist/packem_shared/lifecycle-KY9umOg6.js +0 -2
  270. package/dist/packem_shared/lockfile-YAuZf1gh.js +0 -1
  271. package/dist/packem_shared/main-D_cam4hv.js +0 -1
  272. package/dist/packem_shared/manifests-BwTn_1ad.js +0 -1
  273. package/dist/packem_shared/min-release-age-6avfn81h.js +0 -34
  274. package/dist/packem_shared/missing-package-json-Cl0vdz6K.js +0 -1
  275. package/dist/packem_shared/native-config-sync-CHMCJx7H.js +0 -21
  276. package/dist/packem_shared/osv-bloom-DdqDnLCt.js +0 -2
  277. package/dist/packem_shared/otelPlugin-DmKDBaPo.js +0 -1
  278. package/dist/packem_shared/package-version-BNRJ3o9C.js +0 -4
  279. package/dist/packem_shared/packument-B9-WqReu.js +0 -1
  280. package/dist/packem_shared/pm-runner-DRybtzOV.js +0 -1
  281. package/dist/packem_shared/project-name-filter-Dw0fC6IO.js +0 -7
  282. package/dist/packem_shared/provenance-CLxuqCfL.js +0 -1
  283. package/dist/packem_shared/readJsonSync-DweZd5ZA-CtrDlqpb.js +0 -1
  284. package/dist/packem_shared/registry-keys-cTN24144.js +0 -1
  285. package/dist/packem_shared/resolve-explicit-Uw6WQl9R.js +0 -5
  286. package/dist/packem_shared/resolve-runtime-DztanwkZ.js +0 -1
  287. package/dist/packem_shared/run-file-CaE5_xBY.js +0 -1
  288. package/dist/packem_shared/runtime-check-C32yE57I.js +0 -1
  289. package/dist/packem_shared/s1ngularity-BIYhg82u.js +0 -1
  290. package/dist/packem_shared/scan-progress-DWfY4zkp.js +0 -2
  291. package/dist/packem_shared/selectors-D2j4M9Ul.js +0 -3
  292. package/dist/packem_shared/signatures-C8iQ5fUq.js +0 -2
  293. package/dist/packem_shared/sticky-comment-D6_7-w8T.js +0 -1
  294. package/dist/packem_shared/subtree-DSm0QEoE.js +0 -2
  295. package/dist/packem_shared/symbols-DPTlrJ3B.js +0 -1
  296. package/dist/packem_shared/target-merge-DLxJTcxn.js +0 -11
  297. package/dist/packem_shared/target-options-3t4-2F-F.js +0 -1
  298. package/dist/packem_shared/toolchain-BPzbahcQ.js +0 -5
  299. package/dist/packem_shared/typosquats-BWrmhh36.js +0 -1
  300. package/dist/packem_shared/use-measured-height-BwAwGHjw.js +0 -1
  301. package/dist/packem_shared/utils-CRueU43T.js +0 -1
  302. package/dist/packem_shared/verify-CzUPT6Uk.js +0 -1
  303. package/dist/packem_shared/vis-update-app-D6Wq8ZHM.js +0 -1
  304. package/dist/packem_shared/vis-user-error-CfM4_ORo.js +0 -30
  305. package/dist/packem_shared/watch-D_oAxW_Z.js +0 -1
  306. package/dist/packem_shared/watch-loop-BrjblOz5.js +0 -11
@@ -1,3 +1,3 @@
1
- const e=s=>s.config.plugins??[],i=async(s,a)=>{for(const l of e(s))l.applyDraft&&await l.applyDraft({...s,plan:a})},t=async(s,a)=>{for(const l of e(s))if(l.willPublish&&await l.willPublish({...s,package:a})===!1)return{by:l.name,skip:!0};return{skip:!1}},n=async(s,a)=>{for(const l of e(s))if(l.afterPublish)try{await l.afterPublish({...s,package:a})}catch(r){process.stderr.write(`[vis release] plugin "${l.name}" afterPublish(${a.name}) failed: ${r.message}
2
- `)}},f=async(s,a)=>{for(const l of e(s))if(l.afterPublishAll)try{await l.afterPublishAll({...s,result:a})}catch(r){process.stderr.write(`[vis release] plugin "${l.name}" afterPublishAll failed: ${r.message}
3
- `)}},o=s=>s;export{o as defineReleasePlugin,f as runAfterPublishAllHooks,n as runAfterPublishHooks,i as runApplyDraftHooks,t as runWillPublishHooks};
1
+ const l=s=>s.config.plugins??[],a=async(s,i)=>{for(const e of l(s))e.applyDraft&&await e.applyDraft({...s,plan:i})},n=async(s,i)=>{for(const e of l(s)){if(!e.willPublish)continue;if(await e.willPublish({...s,package:i})===!1)return{by:e.name,skip:!0}}return{skip:!1}},t=async(s,i)=>{for(const e of l(s))if(e.afterPublish)try{await e.afterPublish({...s,package:i})}catch(r){process.stderr.write(`[vis release] plugin "${e.name}" afterPublish(${i.name}) failed: ${r.message}
2
+ `)}},o=async(s,i)=>{for(const e of l(s))if(e.afterPublishAll)try{await e.afterPublishAll({...s,result:i})}catch(r){process.stderr.write(`[vis release] plugin "${e.name}" afterPublishAll failed: ${r.message}
3
+ `)}},f=s=>s;export{f as defineReleasePlugin,o as runAfterPublishAllHooks,t as runAfterPublishHooks,a as runApplyDraftHooks,n as runWillPublishHooks};
@@ -1,3 +1,8 @@
1
- import{createRequire as N}from"node:module";import S from"./index.js";import{VisReleaseError as u}from"../packem_shared/VisReleaseError-DMGRBTNO.js";let A;const x=o=>(A??=N(import.meta.url))(o),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=o=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[t,e]=h.versions.node.split(".").map(Number);if(t>22||t===22&&e>=3||t===20&&e>=16)return h.getBuiltinModule(o)}return x(o)},{readFile:b,rename:L,readdir:_}=v("node:fs/promises"),{isAbsolute:k,join:c,basename:C}=v("node:path");class m{constructor(t){this.runner=t}runner;async publishNative(t){throw new u({code:"CONFIG_INVALID",hint:'Set publish.publishStrategy back to "npm-publish-tarball" (the default), or use a package manager whose adapter implements native publish.',message:`publishStrategy "native" is not supported by the "${this.id}" adapter.`})}async readCatalogYaml(t){}}const f=(o,t)=>{if(o.exitCode===0)return{output:o.stdout,published:!0};const e=`${o.stdout}
2
- ${o.stderr}`;if(/EPUBLISHCONFLICT|cannot publish over the previously published versions|forbidden.*409/i.test(e))return{alreadyPublished:!0,output:e,published:!1};throw new u({code:"PUBLISH_FAILED",message:`${t} failed: ${e}`})};class g extends m{id="npm";minVersion="11.5.1";async pack(t){const e=["pack","--json"];t.destination&&e.push("--pack-destination",t.destination);const s=await this.runner.run("npm",e,{cwd:t.cwd,silent:!0});if(s.exitCode!==0)throw new u({code:"PUBLISH_FAILED",message:`npm pack failed: ${s.stderr||s.stdout}`});const a=JSON.parse(s.stdout),n=a[0]?.filename;if(!n)throw new u({code:"PUBLISH_FAILED",hint:"Upgrade npm to a version that emits --json output, or report this with the raw stdout.",message:`npm pack: could not parse output: ${s.stdout}`});const r=t.destination??t.cwd;let i=k(n)?n:c(r,n);return t.filename&&(await(await import("node:fs/promises")).rename(i,c(r,t.filename)),i=c(r,t.filename)),{raw:a,tarball:i}}async installLockfileOnly(t){const e=await this.runner.run("npm",["install","--package-lock-only"],{cwd:t.cwd,silent:t.silent});if(e.exitCode!==0)throw new u({code:"CONFIG_INVALID",message:`npm install --package-lock-only failed: ${e.stderr||e.stdout}`})}async listWorkspacePackages(t){const e=await this.runner.run("npm",["query",".workspace","--json"],{cwd:t,silent:!0});if(e.exitCode!==0)return[];try{return JSON.parse(e.stdout).filter(s=>typeof s.name=="string").map(s=>({name:s.name,path:s.path??s.location??t,private:s.private??!1,version:s.version??"0.0.0"}))}catch{return[]}}async publish(t){const e=t.stage?["stage","publish",t.tarball]:["publish",t.tarball];t.tag&&e.push("--tag",t.tag),t.access&&e.push("--access",t.access),t.registry&&e.push("--registry",t.registry),t.otp&&e.push("--otp",t.otp),t.provenance&&e.push("--provenance"),t.stage&&e.push("--json");for(const n of t.extraArgs??[])e.push(n);const s=await this.runner.run("npm",e,{cwd:process.cwd(),silent:!0});if(s.exitCode===0){const n={output:s.stdout,published:!0};if(t.stage)try{const r=JSON.parse(s.stdout);n.stageId=r.id??r.stageId}catch{}return n}const a=`${s.stdout}
3
- ${s.stderr}`;if(/EPUBLISHCONFLICT|cannot publish over the previously published versions|forbidden.*409/i.test(a))return{alreadyPublished:!0,output:a,published:!1};throw new u({code:"PUBLISH_FAILED",message:`npm publish failed: ${a}`})}async publishNative(t){const e=["publish"];t.tag&&e.push("--tag",t.tag),t.access&&e.push("--access",t.access),t.registry&&e.push("--registry",t.registry),t.otp&&e.push("--otp",t.otp),t.provenance&&e.push("--provenance");for(const a of t.extraArgs??[])e.push(a);const s=await this.runner.run("npm",e,{cwd:t.cwd,silent:!0});return f(s,"npm publish")}async detectVersion(t){const e=await this.runner.run("npm",["--version"],{cwd:t,silent:!0});return e.exitCode===0?e.stdout.trim():void 0}}class O extends m{id="bun";minVersion="1.1.36";async pack(t){const e=["pm","pack"];t.destination&&e.push("--destination",t.destination);const s=await this.runner.run("bun",e,{cwd:t.cwd,silent:!0});if(s.exitCode!==0)throw new u({code:"PUBLISH_FAILED",message:`bun pm pack failed: ${s.stderr||s.stdout}`});const a=/(?:^|["'\s])([^\s"']*\.tgz)/m.exec(s.stdout),n=t.destination??t.cwd;let r;if(a?.[1]){const i=a[1];r=k(i)?i:c(n,i)}else{const i=JSON.parse(await b(c(t.cwd,"package.json"),"utf8")),d=(i.name??"package").replaceAll("/","-").replace(/^@/,"");r=c(n,`${d}-${i.version??"0.0.0"}.tgz`)}if(t.filename&&C(r)!==t.filename){const i=c(n,t.filename);await L(r,i),r=i}return{raw:s.stdout,tarball:r}}async installLockfileOnly(t){const e=await this.runner.run("bun",["install","--lockfile-only"],{cwd:t.cwd,silent:t.silent});if(e.exitCode!==0)throw new u({code:"CONFIG_INVALID",message:`bun install --lockfile-only failed: ${e.stderr||e.stdout}`})}async listWorkspacePackages(t){try{const e=JSON.parse(await b(c(t,"package.json"),"utf8")),s=Array.isArray(e.workspaces)?e.workspaces:e.workspaces?.packages??[];if(s.length===0)return[];const a=new Set,n=["."],r=5,i=new Set;for(;n.length>0;){const p=n.shift();if(i.has(p)||(i.add(p),(p==="."?0:p.split("/").length)>r))continue;let w;try{w=await _(c(t,p),{withFileTypes:!0})}catch{continue}for(const l of w){if(!l.isDirectory()||l.name==="node_modules"||l.name.startsWith("."))continue;const y=p==="."?l.name:`${p}/${l.name}`;s.some(I=>S(I,y))&&a.add(y),n.push(y)}}const d=[];for(const p of a){const w=c(t,p,"package.json");try{const l=JSON.parse(await b(w,"utf8"));if(typeof l.name!="string")continue;d.push({name:l.name,path:c(t,p),private:l.private??!1,version:l.version??"0.0.0"})}catch{}}return d}catch{return[]}}async publish(t){return new g(this.runner).publish(t)}async publishNative(t){const e=["publish"];t.tag&&e.push("--tag",t.tag),t.access&&e.push("--access",t.access),t.registry&&e.push("--registry",t.registry);for(const a of t.extraArgs??[])e.push(a);const s=await this.runner.run("bun",e,{cwd:t.cwd,silent:!0});return f(s,"bun publish")}async detectVersion(t){const e=await this.runner.run("bun",["--version"],{cwd:t,silent:!0});return e.exitCode===0?e.stdout.trim():void 0}}class $ extends m{id="pnpm";minVersion="9.5.0";async pack(t){const e=["pack","--json"];t.destination&&e.push("--pack-destination",t.destination);const s=await this.runner.run("pnpm",e,{cwd:t.cwd,silent:!0});if(s.exitCode!==0)throw new u({code:"PUBLISH_FAILED",message:`pnpm pack failed: ${s.stderr||s.stdout}`});const a=JSON.parse(s.stdout),{filename:n}=a;if(!n)throw new u({code:"PUBLISH_FAILED",message:`pnpm pack: could not parse output: ${s.stdout}`});const r=t.destination??t.cwd;let i=k(n)?n:c(r,n);return t.filename&&(await(await import("node:fs/promises")).rename(i,c(r,t.filename)),i=c(r,t.filename)),{raw:a,tarball:i}}async installLockfileOnly(t){const e=await this.runner.run("pnpm",["install","--lockfile-only"],{cwd:t.cwd,silent:t.silent});if(e.exitCode!==0)throw new u({code:"CONFIG_INVALID",message:`pnpm install --lockfile-only failed: ${e.stderr||e.stdout}`})}async listWorkspacePackages(t){const e=await this.runner.run("pnpm",["-r","ls","--depth","-1","--json"],{cwd:t,silent:!0});if(e.exitCode!==0)return[];try{return JSON.parse(e.stdout).filter(s=>typeof s.name=="string").map(s=>({name:s.name,path:s.path??t,private:s.private??!1,version:s.version??"0.0.0"}))}catch{return[]}}async publish(t){return new g(this.runner).publish(t)}async publishNative(t){const e=["publish","--no-git-checks"];t.tag&&e.push("--tag",t.tag),t.access&&e.push("--access",t.access),t.registry&&e.push("--registry",t.registry),t.otp&&e.push("--otp",t.otp),t.provenance&&e.push("--provenance");for(const a of t.extraArgs??[])e.push(a);const s=await this.runner.run("pnpm",e,{cwd:t.cwd,silent:!0});return f(s,"pnpm publish")}async detectVersion(t){const e=await this.runner.run("pnpm",["--version"],{cwd:t,silent:!0});return e.exitCode===0?e.stdout.trim():void 0}async readCatalogYaml(t){const e=await import("node:fs/promises");try{return await e.readFile(c(t,"pnpm-workspace.yaml"),"utf8")}catch{return}}}class j extends m{id="yarn";minVersion="4.0.0";async pack(t){const e=t.destination??t.cwd,s=t.filename??"%s-%v.tgz",a=["pack","--out",c(e,s)],n=await this.runner.run("yarn",a,{cwd:t.cwd,silent:!0});if(n.exitCode!==0)throw new u({code:"PUBLISH_FAILED",message:`yarn pack failed: ${n.stderr||n.stdout}`});const r=await import("node:fs/promises"),i=await import("node:path"),d=JSON.parse(await r.readFile(i.join(t.cwd,"package.json"),"utf8")),p=s.replaceAll("%s",(d.name??"package").replaceAll("/","-").replace(/^@/,"")).replaceAll("%v",d.version??"0.0.0");return{raw:n.stdout,tarball:c(e,p)}}async installLockfileOnly(t){const e=await this.runner.run("yarn",["install","--mode","update-lockfile"],{cwd:t.cwd,silent:t.silent});if(e.exitCode!==0)throw new u({code:"CONFIG_INVALID",message:`yarn install --mode update-lockfile failed: ${e.stderr||e.stdout}`})}async listWorkspacePackages(t){const e=await this.runner.run("yarn",["workspaces","list","--json"],{cwd:t,silent:!0});if(e.exitCode!==0)return[];const s=[];for(const a of e.stdout.split(/\r?\n/)){const n=a.trim();if(n)try{const r=JSON.parse(n);if(typeof r.name!="string"||r.name==="")continue;s.push({name:r.name,path:r.location?c(t,r.location):t,private:!1,version:"0.0.0"})}catch{}}return s}async publish(t){return new g(this.runner).publish(t)}async publishNative(t){const e=["npm","publish"];t.tag&&e.push("--tag",t.tag),t.access&&e.push("--access",t.access),t.provenance&&e.push("--provenance");for(const a of t.extraArgs??[])e.push(a);const s=await this.runner.run("yarn",e,{cwd:t.cwd,silent:!0});return f(s,"yarn npm publish")}async detectVersion(t){const e=await this.runner.run("yarn",["--version"],{cwd:t,silent:!0});return e.exitCode===0?e.stdout.trim():void 0}}const V=async(o,t)=>{const e=await import("node:fs/promises"),s=await import("node:path");try{const n=JSON.parse(await e.readFile(s.join(o,"package.json"),"utf8"));if(typeof n.packageManager=="string"){const r=n.packageManager.indexOf("@"),i=r>0?n.packageManager.slice(0,r):n.packageManager;if(i==="pnpm"||i==="yarn"||i==="bun"||i==="npm")return i}}catch{}const a=async n=>{try{return await e.access(s.join(o,n)),!0}catch{return!1}};return await a("bun.lock")||await a("bun.lockb")?"bun":await a("pnpm-lock.yaml")||await a("pnpm-workspace.yaml")?"pnpm":await a("yarn.lock")?"yarn":"npm"},B=(o,t)=>{switch(o){case"bun":return new O(t);case"pnpm":return new $(t);case"yarn":return new j(t);default:return new g(t)}};export{g as N,B as c,V as d};
1
+ import{createRequire as w}from"node:module";let $;const x=c=>($??=w(import.meta.url))(c),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,O=c=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[t,e]=g.versions.node.split(".").map(Number);if(t>22||t===22&&e>=3||t===20&&e>=16)return g.getBuiltinModule(c)}return x(c)},{basename:P}=O("node:path"),R=c=>{const t=[],e=[];for(const r of c??[]){if(typeof r=="string"){t.push(r);continue}if(r.path){const a=r.label??r.name;t.push(a?`${r.path}#${a}`:r.path)}else if(r.linkUrl){const a=r.label??r.name??r.linkUrl;e.push(`- [${a}](${r.linkUrl})`)}}return{linkAppendix:e.length>0?`
2
+
3
+ ### Additional links
4
+
5
+ ${e.join(`
6
+ `)}`:"",paths:t}},k=(c,t)=>{if(c!==0)return[];try{return JSON.parse(t).filter(s=>typeof s.body=="string").map(s=>({body:s.body??"",id:s.id}))}catch{return[]}};class C{id="github";host;httpProxy;constructor(t={}){this.host=t.host,this.httpProxy=t.httpProxy}runOpts(t){if(!this.host&&!this.httpProxy)return{cwd:t,silent:!0};const e={...process.env};return this.host&&(e.GH_HOST=this.host),this.httpProxy&&(e.HTTPS_PROXY=this.httpProxy,e.HTTP_PROXY=this.httpProxy),{cwd:t,env:e,silent:!0}}async listRecentReleases(t,e){const s=Math.max(1,e.limit),r=e.tagPrefix?Math.min(100,s*4):s,a=await t.run("gh",["release","list","--repo",e.repo,"--limit",String(r),"--json","tagName,url,name"],this.runOpts(e.cwd));if(a.exitCode!==0)return[];let i;try{i=JSON.parse(a.stdout)}catch{return[]}const n=[];for(const u of i)if(!(typeof u.tagName!="string"||typeof u.url!="string")&&!(e.tagPrefix&&!u.tagName.startsWith(e.tagPrefix))&&!(e.excludeTag&&u.tagName===e.excludeTag)&&(n.push({name:u.name??u.tagName,tag:u.tagName,url:u.url}),n.length>=s))break;return n}async detectRepoSlug(t,e){const s=await e.run("gh",["repo","view","--json","nameWithOwner","-q",".nameWithOwner"],this.runOpts(t));if(s.exitCode===0)return s.stdout.trim()||void 0}detectPullRequestNumber(t){const e=t.GITHUB_REF;if(e){const r=/^refs\/pull\/(\d+)\/(?:merge|head)$/.exec(e);if(r?.[1])return Number.parseInt(r[1],10)}const s=t.PR_NUMBER??t.VIS_PR_NUMBER;if(s){const r=Number.parseInt(s,10);return Number.isNaN(r)?void 0:r}}async upsertStickyComment(t,e){const s=await t.run("gh",["api",`repos/${e.repo}/issues/${e.issueNumber}/comments`,"--paginate"],this.runOpts(e.cwd)),a=k(s.exitCode,s.stdout).find(u=>u.body.includes(e.marker)),i=e.body.includes(e.marker)?e.body:`${e.marker}
7
+ ${e.body}`;if(a)return(await t.run("gh",["api","-X","PATCH",`repos/${e.repo}/issues/comments/${a.id}`,"-f",`body=${i}`],this.runOpts(e.cwd))).exitCode===0?{created:!1,id:a.id}:void 0;const n=await t.run("gh",["api","-X","POST",`repos/${e.repo}/issues/${e.issueNumber}/comments`,"-f",`body=${i}`],this.runOpts(e.cwd));if(n.exitCode===0)try{return{created:!0,id:JSON.parse(n.stdout).id}}catch{return}}async createRelease(t,e){const{linkAppendix:s,paths:r}=R(e.assets),a=s?`${e.body}${s}`:e.body,i=["release","create",e.tag,"--repo",e.repo,"--title",e.title,"--notes",a];e.draft&&i.push("--draft"),e.prerelease&&i.push("--prerelease"),e.discussionCategory&&i.push("--discussion-category",e.discussionCategory),r.length>0&&i.push(...r);const n=await t.run("gh",i,this.runOpts(e.cwd));if(n.exitCode===0)return{url:n.stdout.trim()||void 0}}async addLabels(t,e){if(e.labels.length===0)return!0;const s=["api","-X","POST",`repos/${e.repo}/issues/${e.issueNumber}/labels`];for(const a of e.labels)s.push("-f",`labels[]=${a}`);return(await t.run("gh",s,this.runOpts(e.cwd))).exitCode===0}async upsertIssue(t,e){const s=await t.run("gh",["issue","list","--repo",e.repo,"--state","open","--search",e.marker,"--json","number,title,url","--limit","20"],this.runOpts(e.cwd));if(s.exitCode===0&&s.stdout.trim()&&s.stdout.trim()!=="[]")try{const d=JSON.parse(s.stdout).find(l=>l.title.includes(e.marker));if(d){const l=["issue","edit",String(d.number),"--repo",e.repo,"--title",e.title,"--body",e.body];return e.labels&&e.labels.length>0&&l.push("--add-label",e.labels.join(",")),e.assignees&&e.assignees.length>0&&l.push("--add-assignee",e.assignees.join(",")),(await t.run("gh",l,this.runOpts(e.cwd))).exitCode===0?{created:!1,number:d.number,url:d.url}:void 0}}catch{}const r=["issue","create","--repo",e.repo,"--title",e.title,"--body",e.body];e.labels&&e.labels.length>0&&r.push("--label",e.labels.join(",")),e.assignees&&e.assignees.length>0&&r.push("--assignee",e.assignees.join(","));const a=await t.run("gh",r,this.runOpts(e.cwd));if(a.exitCode!==0)return;const i=a.stdout.trim(),n=/\/issues\/(\d+)/.exec(i);return n?{created:!0,number:Number.parseInt(n[1]??"0",10),url:i}:void 0}async closeIssue(t,e){return e.closingComment&&await t.run("gh",["issue","comment",String(e.issueNumber),"--repo",e.repo,"--body",e.closingComment],this.runOpts(e.cwd)),(await t.run("gh",["issue","close",String(e.issueNumber),"--repo",e.repo],this.runOpts(e.cwd))).exitCode===0}async upsertPullRequest(t,e){const s=await t.run("gh",["pr","list","--repo",e.repo,"--head",e.head,"--state","open","--json","number,url"],this.runOpts(e.cwd));if(s.exitCode===0&&s.stdout.trim()&&s.stdout.trim()!=="[]")try{const i=JSON.parse(s.stdout);if(i[0])return await t.run("gh",["pr","edit",String(i[0].number),"--repo",e.repo,"--title",e.title,"--body",e.body],this.runOpts(e.cwd)),{existing:!0,number:i[0].number,url:i[0].url}}catch{}const r=await t.run("gh",["pr","create","--repo",e.repo,"--head",e.head,"--base",e.base,"--title",e.title,"--body",e.body],this.runOpts(e.cwd));if(r.exitCode!==0)return;const a=/\/pull\/(\d+)/.exec(r.stdout);return a?{existing:!1,number:Number.parseInt(a[1]??"0",10),url:r.stdout.trim()}:void 0}}const h=c=>encodeURIComponent(c),N=c=>c.replace(/^v(?=\d)/,""),_=c=>{const t=[],e=[],s=[];for(const r of c??[]){if(typeof r=="string"){t.push(r);continue}r.path?r.target==="generic_package"?s.push({label:r.label,linkType:r.type,name:r.name,packageName:r.packageName,packageVersion:r.packageVersion,path:r.path}):t.push(r.path):r.linkUrl&&e.push({linkType:r.type,name:r.label??r.name??r.linkUrl,url:r.linkUrl})}return{genericPackages:s,links:e,uploads:t}};class p{id="gitlab";static recentReleasesWarned=!1;async listRecentReleases(t,e){return p.recentReleasesWarned||(p.recentReleasesWarned=!0,console.warn("[vis release] addReleases is not yet supported on GitLab — skipping the Related releases block.")),[]}host;httpProxy;constructor(t={}){this.host=t.host,this.httpProxy=t.httpProxy}runOpts(t){if(!this.host&&!this.httpProxy)return{cwd:t,silent:!0};const e={...process.env};return this.host&&(e.GITLAB_HOST=this.host),this.httpProxy&&(e.HTTPS_PROXY=this.httpProxy,e.HTTP_PROXY=this.httpProxy),{cwd:t,env:e,silent:!0}}async listMrNotes(t,e,s,r){const a=await t.run("glab",["api",`projects/${h(s)}/merge_requests/${r}/notes`,"--paginate"],this.runOpts(e));if(a.exitCode!==0)return[];try{return JSON.parse(a.stdout).filter(n=>typeof n.body=="string"&&n.system!==!0).map(n=>({body:n.body??"",id:n.id}))}catch{return[]}}async uploadGenericPackage(t,e,s,r,a){const i=h(s),n=P(a.path),u=a.packageName??s.split("/").pop()??"release",d=a.packageVersion??N(r),l=`projects/${i}/packages/generic/${encodeURIComponent(u)}/${encodeURIComponent(d)}/${encodeURIComponent(n)}`;if((await t.run("glab",["api","-X","PUT",l,"--input",a.path],this.runOpts(e))).exitCode!==0)return;const b=this.host?.replace(/^https?:\/\//i,"").replace(/\/+$/,""),m=`${b?`https://${b}`:"https://gitlab.com"}/api/v4/${l}`,y=["api","-X","POST",`projects/${i}/releases/${encodeURIComponent(r)}/assets/links`,"-f",`name=${a.label??a.name??n}`,"-f",`url=${m}`];a.linkType&&y.push("-f",`link_type=${a.linkType}`),await t.run("glab",y,this.runOpts(e))}async detectRepoSlug(t,e){const s=process.env.CI_PROJECT_PATH;if(s)return s;const r=await e.run("git",["config","--get","remote.origin.url"],{cwd:t,silent:!0});if(r.exitCode!==0)return;const a=r.stdout.trim();return/gitlab\.[\w.-]+[/:]([^/].*?)(?:\.git)?$/.exec(a)?.[1]}detectPullRequestNumber(t){const e=t.CI_MERGE_REQUEST_IID??t.VIS_MR_NUMBER;if(!e)return;const s=Number.parseInt(e,10);return Number.isNaN(s)?void 0:s}async upsertStickyComment(t,e){const r=(await this.listMrNotes(t,e.cwd,e.repo,e.issueNumber)).find(u=>u.body.includes(e.marker)),a=e.body.includes(e.marker)?e.body:`${e.marker}
8
+ ${e.body}`,i=h(e.repo);if(r)return(await t.run("glab",["api","-X","PUT",`projects/${i}/merge_requests/${e.issueNumber}/notes/${r.id}`,"-f",`body=${a}`],this.runOpts(e.cwd))).exitCode===0?{created:!1,id:r.id}:void 0;const n=await t.run("glab",["api","-X","POST",`projects/${i}/merge_requests/${e.issueNumber}/notes`,"-f",`body=${a}`],this.runOpts(e.cwd));if(n.exitCode===0)try{return{created:!0,id:JSON.parse(n.stdout).id}}catch{return}}async createRelease(t,e){const{genericPackages:s,links:r,uploads:a}=_(e.assets),i=["release","create",e.tag,"--repo",e.repo,"--name",e.title,"--notes",e.body];if(e.milestones&&e.milestones.length>0)for(const l of e.milestones)i.push("--milestone",l);if((await t.run("glab",i,this.runOpts(e.cwd))).exitCode!==0)return;a.length>0&&await t.run("glab",["release","upload",e.tag,"--repo",e.repo,...a],this.runOpts(e.cwd));const u=h(e.repo);for(const l of r){const o=["api","-X","POST",`projects/${u}/releases/${encodeURIComponent(e.tag)}/assets/links`,"-f",`name=${l.name}`,"-f",`url=${l.url}`];l.linkType&&o.push("-f",`link_type=${l.linkType}`),await t.run("glab",o,this.runOpts(e.cwd))}for(const l of s)await this.uploadGenericPackage(t,e.cwd,e.repo,e.tag,l);const d=await t.run("glab",["api",`projects/${u}/releases/${encodeURIComponent(e.tag)}`],this.runOpts(e.cwd));try{return{url:JSON.parse(d.stdout)._links?.self}}catch{return{url:void 0}}}async addLabels(t,e){if(e.labels.length===0)return!0;const s=h(e.repo);return(await t.run("glab",["api","-X","PUT",`projects/${s}/issues/${e.issueNumber}`,"-f",`add_labels=${e.labels.join(",")}`],this.runOpts(e.cwd))).exitCode===0}async upsertIssue(t,e){const s=h(e.repo),r=await t.run("glab",["api",`projects/${s}/issues?state=opened&search=${encodeURIComponent(e.marker)}&in=title`],this.runOpts(e.cwd));if(r.exitCode===0)try{const l=JSON.parse(r.stdout).find(o=>o.title.includes(e.marker));if(l){const o=["api","-X","PUT",`projects/${s}/issues/${l.iid}`,"-f",`title=${e.title}`,"-f",`description=${e.body}`];if(e.labels&&e.labels.length>0&&o.push("-f",`add_labels=${e.labels.join(",")}`),e.assignees?.[0]){const f=await t.run("glab",["api",`users?username=${encodeURIComponent(e.assignees[0])}`],this.runOpts(e.cwd));try{const m=JSON.parse(f.stdout);m[0]&&o.push("-f",`assignee_id=${m[0].id}`)}catch{}}return(await t.run("glab",o,this.runOpts(e.cwd))).exitCode===0?{created:!1,number:l.iid,url:l.web_url}:void 0}}catch{}const a=["issue","create","--repo",e.repo,"--title",e.title,"--description",e.body,"--yes"];e.labels&&e.labels.length>0&&a.push("--label",e.labels.join(",")),e.assignees?.[0]&&a.push("--assignee",e.assignees[0]);const i=await t.run("glab",a,this.runOpts(e.cwd));if(i.exitCode!==0)return;const n=i.stdout.trim(),u=/\/issues\/(\d+)/.exec(n);return u?{created:!0,number:Number.parseInt(u[1]??"0",10),url:n}:void 0}async closeIssue(t,e){if(e.closingComment){const r=h(e.repo);await t.run("glab",["api","-X","POST",`projects/${r}/issues/${e.issueNumber}/notes`,"-f",`body=${e.closingComment}`],this.runOpts(e.cwd))}return(await t.run("glab",["issue","close",String(e.issueNumber),"--repo",e.repo],this.runOpts(e.cwd))).exitCode===0}async upsertPullRequest(t,e){const s=h(e.repo),r=await t.run("glab",["api",`projects/${s}/merge_requests?state=opened&source_branch=${encodeURIComponent(e.head)}&target_branch=${encodeURIComponent(e.base)}`],this.runOpts(e.cwd));if(r.exitCode===0)try{const u=JSON.parse(r.stdout);if(u[0])return(await t.run("glab",["api","-X","PUT",`projects/${s}/merge_requests/${u[0].iid}`,"-f",`title=${e.title}`,"-f",`description=${e.body}`],this.runOpts(e.cwd))).exitCode===0?{existing:!0,number:u[0].iid,url:u[0].web_url}:void 0}catch{}const a=await t.run("glab",["mr","create","--repo",e.repo,"--source-branch",e.head,"--target-branch",e.base,"--title",e.title,"--description",e.body,"--yes"],this.runOpts(e.cwd));if(a.exitCode!==0)return;const i=a.stdout.trim(),n=/\/merge_requests\/(\d+)/.exec(i);return n?{existing:!1,number:Number.parseInt(n[1]??"0",10),url:i}:void 0}}const v=c=>{if(c.GITHUB_ACTIONS==="true"||c.GITHUB_REPOSITORY)return"github";if(c.GITLAB_CI==="true"||c.CI_PROJECT_PATH)return"gitlab"},T=c=>{const t=c.trim();if(t!==""){if(!t.includes("://")){const e=t.indexOf(":"),s=t.indexOf("/");if(e>0&&(s===-1||e<s)){const r=t.slice(0,e),a=r.lastIndexOf("@");return(a===-1?r:r.slice(a+1)).toLowerCase()||void 0}return}try{return new URL(t).hostname.toLowerCase()||void 0}catch{return}}},j=async(c,t)=>{const e=await t.run("git",["config","--get","remote.origin.url"],{cwd:c,silent:!0});if(e.exitCode!==0)return;const s=T(e.stdout);if(s){if(s==="github.com"||s.endsWith(".github.com"))return"github";if(s==="gitlab.com"||s.startsWith("gitlab."))return"gitlab"}},S=async(c,t,e,s=process.env)=>{if(e&&e!=="auto"){if(e==="github"||e==="gitlab")return e;throw new Error(`Unsupported release.provider: ${e}. Expected "github", "gitlab", or "auto".`)}return v(s)??await j(c,t)??"github"},U=(c,t={})=>c==="gitlab"?new p({host:t.gitlabHost,httpProxy:t.httpProxy}):new C({host:t.githubHost,httpProxy:t.httpProxy});export{U as createRemoteClient,S as detectRemoteProvider};
@@ -1,4 +1,4 @@
1
- import n from"react-devtools-core";const s=async()=>new Promise(t=>{const e=new WebSocket("ws://localhost:8097"),o=setTimeout(()=>{e.close(),t(!1)},2e3);o.unref(),e.addEventListener("open",()=>{clearTimeout(o),e.close(),t(!0)}),e.addEventListener("error",()=>{clearTimeout(o),t(!1)})});await s()?(n.initialize(),n.connectToDevTools()):console.warn(`DEV is set to true, but the React DevTools server is not running. Start it with:
1
+ import n from"react-devtools-core";const s=async()=>new Promise(o=>{const e=new WebSocket("ws://localhost:8097"),t=setTimeout(()=>{e.close(),o(!1)},2e3);t.unref(),e.addEventListener("open",()=>{clearTimeout(t),e.close(),o(!0)}),e.addEventListener("error",()=>{clearTimeout(t),o(!1)})});await s()?(n.initialize(),n.connectToDevTools()):console.warn(`DEV is set to true, but the React DevTools server is not running. Start it with:
2
2
 
3
3
  $ npx react-devtools
4
4
  `);
@@ -1,4 +1,4 @@
1
- import{expandNotificationTemplate as h}from"./interface.js";const p=4096,l=3800,d=i=>i.url?`• [\`${i.name}@${i.version}\`](${i.url})`:`• \`${i.name}@${i.version}\``,f=i=>{const t=i.published.map(n=>d(n));let s=t.join(`
2
- `);if(s.length>l){let n=0;const e=[];for(const r of t){if(n+r.length+1>l){e.push(`*… +${t.length-e.length} more*`);break}e.push(r),n+=r.length+1}s=e.join(`
3
- `)}return s.slice(0,p)};class g{constructor(t){this.config=t,this.id=t.id?`discord:${t.id}`:"discord"}config;id;async send(t){const s=this.config.title?h(this.config.title,t):`🚀 Released ${t.published.length} package${t.published.length===1?"":"s"}`,n={color:this.config.color??3900150,description:f(t),fields:[],timestamp:t.completedAt,title:s},e=[];if(t.channel&&e.push({inline:!0,name:"Channel",value:`\`${t.channel}\``}),t.repo&&e.push({inline:!0,name:"Repository",value:`[${t.repo}](https://github.com/${t.repo})`}),t.skipped.length>0&&this.config.includeSkipped!==!1){const o=t.skipped.map(c=>`\`${c.name}\` — ${c.reason}`).join(`
4
- `).slice(0,1024);e.push({inline:!1,name:`Skipped (${t.skipped.length})`,value:o})}e.length>0&&(n.fields=e);const r={...this.config.username?{username:this.config.username}:{},...this.config.avatarUrl?{avatar_url:this.config.avatarUrl}:{},embeds:[n]};let a;try{a=await fetch(this.config.webhook,{body:JSON.stringify(r),headers:{"Content-Type":"application/json"},method:"POST"})}catch(o){const c=o instanceof Error?o.name:"NetworkError";throw new Error(`Discord webhook fetch failed (${c})`,{cause:o})}if(!a.ok){const o=await a.text().catch(()=>"");throw new Error(`Discord webhook returned ${a.status} ${a.statusText}${o?`: ${o.slice(0,200)}`:""}`)}}}export{g as DiscordNotificationChannel};
1
+ import{expandNotificationTemplate as c}from"./interface.js";const d=4096,h=3800,p=n=>n.url?`• [\`${n.name}@${n.version}\`](${n.url})`:`• \`${n.name}@${n.version}\``,f=n=>{const e=n.published.map(t=>p(t));let o=e.join(`
2
+ `);if(o.length>h){let t=0;const i=[];for(const r of e){if(t+r.length+1>h){i.push(`*… +${e.length-i.length} more*`);break}i.push(r),t+=r.length+1}o=i.join(`
3
+ `)}return o.slice(0,d)};class m{constructor(e){this.config=e,this.id=e.id?`discord:${e.id}`:"discord"}config;id;async send(e){const o=this.config.title?c(this.config.title,e):`🚀 Released ${e.published.length} package${e.published.length===1?"":"s"}`,t={color:this.config.color??3900150,description:f(e),fields:[],timestamp:e.completedAt,title:o},i=[];if(e.channel&&i.push({inline:!0,name:"Channel",value:`\`${e.channel}\``}),e.repo&&i.push({inline:!0,name:"Repository",value:`[${e.repo}](https://github.com/${e.repo})`}),e.skipped.length>0&&this.config.includeSkipped!==!1){const s=e.skipped.map(l=>`\`${l.name}\` — ${l.reason}`).join(`
4
+ `).slice(0,1024);i.push({inline:!1,name:`Skipped (${e.skipped.length})`,value:s})}i.length>0&&(t.fields=i);const r={...this.config.username?{username:this.config.username}:{},...this.config.avatarUrl?{avatar_url:this.config.avatarUrl}:{},embeds:[t]};let a;try{a=await fetch(this.config.webhook,{body:JSON.stringify(r),headers:{"Content-Type":"application/json"},method:"POST"})}catch(s){const l=s instanceof Error?s.name:"NetworkError";throw new Error(`Discord webhook fetch failed (${l})`,{cause:s})}if(!a.ok){const s=await a.text().catch(()=>"");throw new Error(`Discord webhook returned ${a.status} ${a.statusText}${s?`: ${s.slice(0,200)}`:""}`)}}}export{m as DiscordNotificationChannel};
@@ -1,4 +1,4 @@
1
- import{createRequire as m}from"node:module";import{w as p,J as _}from"../packem_shared/index-BLtnel38.js";let f;const l=e=>(f??=m(import.meta.url))(e),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=e=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[r,s]=i.versions.node.split(".").map(Number);if(r>22||r===22&&s>=3||r===20&&s>=16)return i.getBuiltinModule(e)}return l(e)},{spawnSync:h}=u("node:child_process"),{readFileSync:g,statSync:v}=u("node:fs"),d={npm:{pm:"npm",runner:!1},npx:{pm:"npm",runner:!0},pnpm:{pm:"pnpm",runner:!1},pnpx:{pm:"pnpm",runner:!0},yarn:{pm:"yarn",runner:!1},yarnpkg:{pm:"yarn",runner:!1}},y=new Set(["create","dlx","exec","init"]),a=e=>{try{return v(e).isFile()}catch{return!1}},w=e=>e==="npm"||e==="pnpm"||e==="yarn"?e:void 0,x=e=>{const r=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"]];let s=e;for(;;){const t=p(s,"package.json");if(a(t))try{const o=JSON.parse(g(t,"utf8")).packageManager;if(typeof o=="string"&&o.length>0){const c=w(o.split("@")[0]);if(c!==void 0)return c}}catch{}for(const[o,c]of r)if(a(p(s,o)))return c;const n=_(s);if(n===s)return;s=n}},j=()=>process.env.npm_config_user_agent!==void 0||process.env.npm_execpath!==void 0,k=(e,r,s,t)=>{const n=d[e];if(n===void 0)return"dispatch";const o=n.runner||s!==void 0&&y.has(s);return r!==void 0&&n.pm!==r&&!o&&!t?"refuse":"dispatch"},S=e=>{const r=process.platform==="win32"?[`${e}.cmd`,`${e}.exe`,e]:[e];for(const s of(process.env.PATH??"").split(process.platform==="win32"?";":":"))if(!(s===""||s.replace(/[/\\]+$/u,"").endsWith(p(".vis","shims"))))for(const t of r){const n=p(s,t);if(a(n))return n}},T=(e,r)=>{d[e]===void 0&&(process.stderr.write(`vis: ${e} is not a known package-manager shim.
2
- `),process.exit(1));const s=x(process.cwd());k(e,s,r[0],j())==="refuse"&&(process.stderr.write(`vis: this project uses ${String(s)}, but \`${e}\` was run. Use \`${String(s)}\` instead, or run \`vis shim uninstall\` to disable the PM guard.
3
- `),process.exit(1));const t=S(e);t===void 0&&(process.stderr.write(`vis: \`${e}\` was not found on PATH (outside the shim dir).
4
- `),process.exit(1));const n=h(t,r,{stdio:"inherit"});process.exit(n.status??(n.signal===null?0:1))};export{k as decideShim,T as dispatchShim};
1
+ import{createRequire as m}from"node:module";import{e as p,m as g}from"../packem_shared/index-DHD8wb6Z.js";let l;const f=e=>(l??=m(import.meta.url))(e),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=e=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[n,s]=c.versions.node.split(".").map(Number);if(n>22||n===22&&s>=3||n===20&&s>=16)return c.getBuiltinModule(e)}return f(e)},{spawnSync:h}=u("node:child_process"),{readFileSync:y,statSync:_}=u("node:fs"),d={npm:{pm:"npm",runner:!1},npx:{pm:"npm",runner:!0},pnpm:{pm:"pnpm",runner:!1},pnpx:{pm:"pnpm",runner:!0},yarn:{pm:"yarn",runner:!1},yarnpkg:{pm:"yarn",runner:!1}},v=new Set(["create","dlx","exec","init"]),a=e=>{try{return _(e).isFile()}catch{return!1}},S=e=>e==="npm"||e==="pnpm"||e==="yarn"?e:void 0,w=e=>{const n=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"]];let s=e;for(;;){const t=p(s,"package.json");if(a(t))try{const o=JSON.parse(y(t,"utf8")).packageManager;if(typeof o=="string"&&o.length>0){const i=S(o.split("@")[0]);if(i!==void 0)return i}}catch{}for(const[o,i]of n)if(a(p(s,o)))return i;const r=g(s);if(r===s)return;s=r}},x=()=>process.env.npm_config_user_agent!==void 0||process.env.npm_execpath!==void 0,j=(e,n,s,t)=>{const r=d[e];if(r===void 0)return"dispatch";const o=r.runner||s!==void 0&&v.has(s);return n!==void 0&&r.pm!==n&&!o&&!t?"refuse":"dispatch"},$=e=>{const n=process.platform==="win32"?[`${e}.cmd`,`${e}.exe`,e]:[e];for(const s of(process.env.PATH??"").split(process.platform==="win32"?";":":"))if(!(s===""||s.replace(/[/\\]+$/u,"").endsWith(p(".vis","shims"))))for(const t of n){const r=p(s,t);if(a(r))return r}},R=(e,n)=>{d[e]===void 0&&(process.stderr.write(`vis: ${e} is not a known package-manager shim.
2
+ `),process.exit(1));const t=w(process.cwd());j(e,t,n[0],x())==="refuse"&&(process.stderr.write(`vis: this project uses ${String(t)}, but \`${e}\` was run. Use \`${String(t)}\` instead, or run \`vis shim uninstall\` to disable the PM guard.
3
+ `),process.exit(1));const r=$(e);r===void 0&&(process.stderr.write(`vis: \`${e}\` was not found on PATH (outside the shim dir).
4
+ `),process.exit(1));const o=h(r,n,{stdio:"inherit"});process.exit(o.status??(o.signal===null?0:1))};export{j as decideShim,R as dispatchShim};
@@ -1,2 +1,2 @@
1
- import{I as p,V as u,j as l,E as i,q as h,s as g}from"../packem_shared/index.server-CusjRLCh.js";import{resolveTurboEnvCompat as d,ReapiRemoteCache as m}from"@visulima/task-runner";import{p as b}from"./cli-main.js";const f=(t,r)=>r==="http"||r==="reapi"?r:t.startsWith("grpc://")||t.startsWith("grpcs://")?"reapi":"http",$=async(t,r)=>{const o=Date.now(),a=new AbortController,e=setTimeout(()=>{a.abort()},r);try{const s=await fetch(t,{method:"HEAD",signal:a.signal});return{backend:"http",durationMs:Date.now()-o,httpStatus:s.status,ok:!0,url:t}}catch(s){return{backend:"http",durationMs:Date.now()-o,error:s instanceof Error?s.message:String(s),ok:!1,url:t}}finally{clearTimeout(e)}},k=async(t,r)=>{const o=Date.now(),a=new m({...t,timeout:r});try{return{backend:"reapi",capabilities:await a.probeCapabilities(),durationMs:Date.now()-o,ok:!0,url:t.url}}catch(e){return{backend:"reapi",durationMs:Date.now()-o,error:e instanceof Error?e.message:String(e),ok:!1,url:t.url}}finally{try{await a.close()}catch{}}},w=t=>{const r=[],o=t.ok?p("OK"):u("FAIL");if(r.push(`${l("Remote cache")} ${o}`),r.push(` ${i("URL:")} ${h(t.url)}`),r.push(` ${i("Backend:")} ${t.backend}`),r.push(` ${i("Latency:")} ${String(t.durationMs)}ms`),t.httpStatus!==void 0&&r.push(` ${i("Status:")} ${String(t.httpStatus)}`),t.capabilities){const a=t.capabilities.digestFunctions.length>0?t.capabilities.digestFunctions.join(", "):g("(none advertised)");r.push(` ${i("Digests:")} ${a}`),r.push(` ${i("Batch:")} ${String(t.capabilities.maxBatchTotalSizeBytes)} bytes`)}return t.error&&r.push(` ${i("Error:")} ${u(t.error)}`),r.join(`
2
- `)},D=async({logger:t,options:r,visConfig:o})=>{const a=d((o??{}).taskRunner?.remoteCache),e=r.url??a?.url,s=r.format??"table",c=r.timeout??5e3;if(!e){b.error("No remote cache configured. Set taskRunner.remoteCache.url in vis.config.ts, pass --url=..., or export TURBO_API."),process.exitCode=1;return}const n=f(e,r.backend)==="reapi"?await k({...a??{url:e},backend:"reapi",url:e},c):await $(e,c);s==="json"?t.log(JSON.stringify(n,null,2)):t.log(w(n)),n.ok||(process.exitCode=1)};export{D as cacheDoctorExecute};
1
+ import{J as l,X as u,j as f,F as n,q as b,b as m}from"../packem_shared/index.server-BAjDJSEu.js";import{resolveTurboEnvCompat as d,ReapiRemoteCache as g}from"@visulima/task-runner";import{p as k}from"./cli-main.js";const $=(t,e)=>e==="http"||e==="reapi"?e:t.startsWith("grpc://")||t.startsWith("grpcs://")?"reapi":"http",w=async(t,e)=>{const a=Date.now(),o=new AbortController,r=setTimeout(()=>{o.abort()},e);try{const s=await fetch(t,{method:"HEAD",signal:o.signal});return{backend:"http",durationMs:Date.now()-a,httpStatus:s.status,ok:!0,url:t}}catch(s){return{backend:"http",durationMs:Date.now()-a,error:s instanceof Error?s.message:String(s),ok:!1,url:t}}finally{clearTimeout(r)}},y=async(t,e)=>{const a=Date.now(),o=new g({...t,timeout:e});try{return{backend:"reapi",capabilities:await o.probeCapabilities(),durationMs:Date.now()-a,ok:!0,url:t.url}}catch(r){return{backend:"reapi",durationMs:Date.now()-a,error:r instanceof Error?r.message:String(r),ok:!1,url:t.url}}finally{try{await o.close()}catch{}}},S=t=>{const e=[],a=t.ok?l("OK"):u("FAIL");if(e.push(`${f("Remote cache")} ${a}`),e.push(` ${n("URL:")} ${b(t.url)}`),e.push(` ${n("Backend:")} ${t.backend}`),e.push(` ${n("Latency:")} ${String(t.durationMs)}ms`),t.httpStatus!==void 0&&e.push(` ${n("Status:")} ${String(t.httpStatus)}`),t.capabilities){const o=t.capabilities.digestFunctions.length>0?t.capabilities.digestFunctions.join(", "):m("(none advertised)");e.push(` ${n("Digests:")} ${o}`),e.push(` ${n("Batch:")} ${String(t.capabilities.maxBatchTotalSizeBytes)} bytes`)}return t.error&&e.push(` ${n("Error:")} ${u(t.error)}`),e.join(`
2
+ `)},A=async({logger:t,options:e,visConfig:a})=>{const r=d((a??{}).taskRunner?.remoteCache),i=e.url??r?.url,h=e.format??"table",p=e.timeout??5e3;if(!i){k.error("No remote cache configured. Set taskRunner.remoteCache.url in vis.config.ts, pass --url=..., or export TURBO_API."),process.exitCode=1;return}const c=$(i,e.backend)==="reapi"?await y({...r??{url:i},backend:"reapi",url:i},p):await w(i,p);h==="json"?t.log(JSON.stringify(c,null,2)):t.log(S(c)),c.ok||(process.exitCode=1)};export{A as cacheDoctorExecute};
@@ -1,3 +1,3 @@
1
- import{createRequire as N}from"node:module";import{VisReleaseError as b}from"../packem_shared/VisReleaseError-DMGRBTNO.js";let A;const I=e=>(A??=N(import.meta.url))(e),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=e=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[r,s]=g.versions.node.split(".").map(Number);if(r>22||r===22&&s>=3||r===20&&s>=16)return g.getBuiltinModule(e)}return I(e)},{readFile:R}=_("node:fs/promises"),{isAbsolute:x,join:w}=_("node:path"),j="x-release-please-version",y=e=>e.type==="annotation",O=e=>!y(e),E=(e,r)=>{if(!O(e))throw new b({code:"CONFIG_INVALID",message:`extra-files rule at ${r} has type="${e.type}" — compileRule is regex-only.`});try{return new RegExp(e.search,e.flags??"g")}catch(s){throw new b({cause:s,code:"CONFIG_INVALID",message:`Invalid extra-files regex at ${r}.search: ${s.message}`})}},F=(e,r,s)=>e.replaceAll("{version}",r).replaceAll("{name}",s).replaceAll("{packageName}",s),T=/\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?/,v=(e,r)=>{let s=0;if(r!==void 0){const h=e.indexOf(r);if(h===-1)return;s=h+r.length}const u=e.slice(s),o=T.exec(u);if(o)return{index:s+o.index,match:o[0]}},q=(e,r,s,u,o)=>{const h=e.marker??j,i=[],l=r.split(`
2
- `);let t=!1,a=!1;for(let n=0;n<l.length;n++){const c=l[n];if(c.includes(h))if(t=!0,c.slice(0,c.indexOf(h)).replace(/^\s*(?:#|\/\/|\/\*|--|<!--)\s*$/,"").trim()===""){const p=n+1,f=l[p];if(f===void 0){i.push(`extra-files: ${u}[${e.path}] annotation marker on the last line of ${o} (no following line to update).`);continue}const d=v(f,e.anchor);if(!d){i.push(e.anchor===void 0?`extra-files: ${u}[${e.path}] annotation marker at ${o}:${n+1} but no semver-shaped substring on the following line.`:`extra-files: ${u}[${e.path}] annotation marker at ${o}:${n+1} but anchor "${e.anchor}" / no semver-shaped substring after it on the following line.`);continue}l[p]=f.slice(0,d.index)+s+f.slice(d.index+d.match.length),a=!0}else{const p=v(c,e.anchor);if(!p){i.push(e.anchor===void 0?`extra-files: ${u}[${e.path}] annotation marker at ${o}:${n+1} but no semver-shaped substring on the marked line.`:`extra-files: ${u}[${e.path}] annotation marker at ${o}:${n+1} but anchor "${e.anchor}" / no semver-shaped substring after it on the marked line.`);continue}l[n]=c.slice(0,p.index)+s+c.slice(p.index+p.match.length),a=!0}}return t?a?{content:l.join(`
3
- `),warnings:i}:{warnings:i}:(i.push(`extra-files: ${u}[${e.path}] annotation marker "${h}" not found in ${o}; rule may be stale.`),{warnings:i})},M=async(e,r,s,u,o)=>{let h;try{h=await R(e,"utf8")}catch(t){return t.code==="ENOENT"?{warnings:[`extra-files: ${o} → ${e} does not exist; skipping ${r.length} rule(s).`]}:{warnings:[`extra-files: ${o} → could not read ${e}: ${t.message}`]}}let i=h;const l=[];for(const t of r){if(y(t)){const f=q(t,i,s,o,e);l.push(...f.warnings),f.content!==void 0&&(i=f.content);continue}const a=E(t,`${o}[${t.path}]`),n=t.replace===void 0?s:F(t.replace,s,u);let c=!1;const p=i.replace(a,(f,...d)=>(c=!0,t.replace===void 0?n:n.replaceAll(/\$([&$1-9])/g,(D,$)=>{if($==="&")return f;if($==="$")return"$";const k=Number.parseInt($,10)-1,m=d[k];return typeof m=="string"?m:""})));if(!c){l.push(`extra-files: ${o}[${t.path}] regex /${t.search}/${t.flags??"g"} matched nothing in ${e}; rule may be stale.`);continue}i=p}return i===h?{warnings:l}:{content:i,warnings:l}},B=async(e,r,s,u,o=[],h=[])=>{const i=[],l=[],t=new Map;for(const a of o){const n=x(a.path)?a.path:w(e,a.path),c=t.get(n)??{label:"workspace",rules:[]};c.rules.push(a),t.set(n,c)}for(const a of h){const n=x(a.path)?a.path:w(r,a.path),c=t.get(n)??{label:"per-package",rules:[]};c.rules.push(a),t.set(n,c)}for(const[a,n]of t){const c=n.rules[0],p=await M(a,n.rules,s,u,n.label);l.push(...p.warnings),p.content!==void 0&&i.push({content:p.content,path:a,rule:c})}return{warnings:l,writes:i}};export{j as DEFAULT_ANNOTATION_MARKER,B as applyExtraFilesForRelease,E as compileRule};
1
+ import{createRequire as I}from"node:module";import{VisReleaseError as R}from"../packem_shared/VisReleaseError-DZtgcKf8.js";let E;const N=e=>(E??=I(import.meta.url))(e),$=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=e=>{if(typeof $<"u"&&$.versions&&$.versions.node){const[r,s]=$.versions.node.split(".").map(Number);if(r>22||r===22&&s>=3||r===20&&s>=16)return $.getBuiltinModule(e)}return N(e)},{readFile:O}=k("node:fs/promises"),{isAbsolute:v,join:_}=k("node:path"),T="x-release-please-version",A=e=>e.type==="annotation",b=e=>!A(e),j=(e,r)=>{if(!b(e))throw new R({code:"CONFIG_INVALID",message:`extra-files rule at ${r} has type="${e.type}" — compileRule is regex-only.`});try{return new RegExp(e.search,e.flags??"g")}catch(s){throw new R({cause:s,code:"CONFIG_INVALID",message:`Invalid extra-files regex at ${r}.search: ${s.message}`})}},M=(e,r,s)=>e.replaceAll("{version}",r).replaceAll("{name}",s).replaceAll("{packageName}",s),F=/\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?/,y=(e,r)=>{let s=0;if(r!==void 0){const f=e.indexOf(r);if(f===-1)return;s=f+r.length}const p=e.slice(s),o=F.exec(p);if(o)return{index:s+o.index,match:o[0]}},L=(e,r,s,p,o)=>{const f=e.marker??T,a=[],l=r.split(`
2
+ `);let t=!1,i=!1;for(let n=0;n<l.length;n++){const c=l[n];if(!c.includes(f))continue;if(t=!0,c.slice(0,c.indexOf(f)).replace(/^\s*(?:#|\/\/|\/\*|--|<!--)\s*$/,"").trim()===""){const u=n+1,d=l[u];if(d===void 0){a.push(`extra-files: ${p}[${e.path}] annotation marker on the last line of ${o} (no following line to update).`);continue}const m=y(d,e.anchor);if(!m){a.push(e.anchor===void 0?`extra-files: ${p}[${e.path}] annotation marker at ${o}:${n+1} but no semver-shaped substring on the following line.`:`extra-files: ${p}[${e.path}] annotation marker at ${o}:${n+1} but anchor "${e.anchor}" / no semver-shaped substring after it on the following line.`);continue}l[u]=d.slice(0,m.index)+s+d.slice(m.index+m.match.length),i=!0}else{const u=y(c,e.anchor);if(!u){a.push(e.anchor===void 0?`extra-files: ${p}[${e.path}] annotation marker at ${o}:${n+1} but no semver-shaped substring on the marked line.`:`extra-files: ${p}[${e.path}] annotation marker at ${o}:${n+1} but anchor "${e.anchor}" / no semver-shaped substring after it on the marked line.`);continue}l[n]=c.slice(0,u.index)+s+c.slice(u.index+u.match.length),i=!0}}return t?i?{content:l.join(`
3
+ `),warnings:a}:{warnings:a}:(a.push(`extra-files: ${p}[${e.path}] annotation marker "${f}" not found in ${o}; rule may be stale.`),{warnings:a})},q=async(e,r,s,p,o)=>{let f;try{f=await O(e,"utf8")}catch(t){return t.code==="ENOENT"?{warnings:[`extra-files: ${o} → ${e} does not exist; skipping ${r.length} rule(s).`]}:{warnings:[`extra-files: ${o} → could not read ${e}: ${t.message}`]}}let a=f;const l=[];for(const t of r){if(A(t)){const g=L(t,a,s,o,e);l.push(...g.warnings),g.content!==void 0&&(a=g.content);continue}const i=j(t,`${o}[${t.path}]`),n=t.replace===void 0?s:M(t.replace,s,p);let c=!1;const h=a.replace(i,(g,...x)=>(c=!0,t.replace===void 0?n:n.replaceAll(/\$([&$1-9])/g,(u,d)=>{if(d==="&")return g;if(d==="$")return"$";const m=Number.parseInt(d,10)-1,w=x[m];return typeof w=="string"?w:""})));if(!c){l.push(`extra-files: ${o}[${t.path}] regex /${t.search}/${t.flags??"g"} matched nothing in ${e}; rule may be stale.`);continue}a=h}return a===f?{warnings:l}:{content:a,warnings:l}},G=async(e,r,s,p,o=[],f=[])=>{const a=[],l=[],t=new Map;for(const i of o){const n=v(i.path)?i.path:_(e,i.path),c=t.get(n)??{label:"workspace",rules:[]};c.rules.push(i),t.set(n,c)}for(const i of f){const n=v(i.path)?i.path:_(r,i.path),c=t.get(n)??{label:"per-package",rules:[]};c.rules.push(i),t.set(n,c)}for(const[i,n]of t){const c=n.rules[0],h=await q(i,n.rules,s,p,n.label);l.push(...h.warnings),h.content!==void 0&&a.push({content:h.content,path:i,rule:c})}return{warnings:l,writes:a}};export{T as DEFAULT_ANNOTATION_MARKER,G as applyExtraFilesForRelease,j as compileRule};
@@ -1,11 +1,11 @@
1
- import{createRequire as F}from"node:module";import{j as w,E as b,s as k,q as J,V as C,I as j}from"../packem_shared/index.server-CusjRLCh.js";import{b as I}from"../packem_shared/index-BLtnel38.js";import{a as D,r as E,b as m,c as B}from"../packem_shared/ai-fix-bfWo0cZX.js";import{p}from"./cli-main.js";import{l as N}from"../packem_shared/failure-log-DyhWPqno.js";let A;const O=o=>(A??=F(import.meta.url))(o),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,q=o=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[t,r]=h.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return h.getBuiltinModule(o)}return O(o)},{createInterface:T}=q("node:readline"),L={"ambiguous-match":"ambiguous match",applied:"applied",error:"error","missing-file":"missing file","no-match":"no match","outside-workspace":"outside workspace"},R=(o,t,r)=>{const e=B(o,t,r),s=I(o,e);return s===""||s.startsWith("..")?e:s},M=(o,t,r)=>{const e=[w(`Fix proposal (${o.provider}, confidence: ${o.confidence})`),"",o.explanation||b("<no explanation>")];if(o.cannotFix)return e.push(""),e.push(k(`Cannot fix automatically: ${o.cannotFix}`)),e.join(`
2
- `);if(o.patches.length===0)return e.push(""),e.push(k("No patches were proposed.")),e.join(`
3
- `);e.push(""),e.push(w(`Patches (${String(o.patches.length)}):`));for(const[s,i]of o.patches.entries()){const a=R(t,r,i.file);e.push(""),e.push(J(`[${String(s+1)}] ${a}`)),i.reason&&e.push(b(` reason: ${i.reason}`));for(const u of i.oldString.split(`
4
- `))e.push(C(` - ${u}`));for(const u of i.newString.split(`
5
- `))e.push(j(` + ${u}`))}return e.join(`
6
- `)},_=(o,t,r)=>{const e=[];for(const s of o){const i=s.absolutePath?I(t,s.absolutePath)||s.absolutePath:R(t,r,s.patch.file),a=L[s.status];s.status==="applied"?e.push(j(` ✓ ${i}: ${a}`)):e.push(C(` ✗ ${i}: ${a}${s.error?` (${s.error})`:""}`))}return e.join(`
7
- `)},y=o=>{let t=0,r=0;for(const e of o)e.status==="applied"?t+=1:r+=1;return{applied:t,failed:r}},U=o=>new Promise(t=>{const r=T({input:process.stdin,output:process.stderr});r.question(`${o} (y/N) `,e=>{r.close();const s=e.trim().toLowerCase();t(s==="y"||s==="yes")})}),W=o=>o??process.cwd(),X=async({argument:o,logger:t,options:r,visConfig:e,workspaceRoot:s})=>{const i=o[0],a=W(s),u=(r.format??"text")==="json";if(!i){if(u){const l=N(a);process.stdout.write(`${JSON.stringify({availableTasks:l,error:"No task ID specified"},void 0,2)}
8
- `)}else{p.error("No task ID specified. Usage: vis ai fix <project>:<target>");const l=N(a);if(l.length>0){p.info("Tasks with captured failure logs:");for(const f of l)p.info(` - ${f}`)}else p.notice("No failure logs found. Re-run a failing task with `vis run` to capture logs.")}process.exitCode=1;return}const n=await D(a,i,{runId:r.run});if(!n){u?process.stdout.write(`${JSON.stringify({error:"No failure log or run summary found",taskId:i},void 0,2)}
9
- `):(p.error(`No failure log or run summary found for task "${i}".`),p.notice("Re-run the task with `vis run` so its terminal output and run metadata are captured.")),process.exitCode=1;return}n.terminalOutputCaptured||p.warn(`No captured terminal output for "${i}". Re-run with \`vis run\` for a better fix proposal.`);const S=e?.ai,c=await E(n,t,{cache:r.cache!==!1,config:S});if(!c){u&&process.stdout.write(`${JSON.stringify({error:"AI fix proposal failed or no provider available",taskId:i},void 0,2)}
10
- `),process.exitCode=1;return}const g=r.apply===!0;if(u){const l=g?void 0:await m(a,n.cwd,c,{dryRun:!0}),f=g?await m(a,n.cwd,c):void 0;if(process.stdout.write(`${JSON.stringify({appliedResults:f,dryRunResults:l,failureContext:{cwd:n.cwd,hash:n.hash,runId:n.runId,taskId:n.taskId,terminalOutputCaptured:n.terminalOutputCaptured},proposal:c},void 0,2)}
11
- `),g&&f){const{failed:P}=y(f);P>0&&(process.exitCode=1)}return}if(t.info(M(c,a,n.cwd)),c.cannotFix||c.patches.length===0)return;const x=await m(a,n.cwd,c,{dryRun:!0}),$=y(x);if(t.info(""),t.info(w("Patch validation:")),t.info(_(x,a,n.cwd)),!g){t.info(""),p.info("Re-run with --apply to write these patches to disk.");return}if($.applied===0){p.error("No patches can be applied (every patch failed validation)."),process.exitCode=1;return}if(r.yes!==!0&&(t.info(""),!await U(`Apply ${String($.applied)} patch${$.applied===1?"":"es"} to disk?`))){p.notice("Aborted. Nothing written.");return}const v=await m(a,n.cwd,c),d=y(v);t.info(""),t.info(w("Apply results:")),t.info(_(v,a,n.cwd)),t.info(""),d.failed===0?p.success(`Applied ${String(d.applied)} patch${d.applied===1?"":"es"}.`):(p.warn(`${String(d.applied)} applied, ${String(d.failed)} failed.`),process.exitCode=1)};export{X as aiFix};
1
+ import{createRequire as T}from"node:module";import{j as $,F as R,b as P,q as L,X as S,J as k}from"../packem_shared/index.server-BAjDJSEu.js";import{a as N}from"../packem_shared/index-DHD8wb6Z.js";import{a as B,r as D,b as y,c as M}from"../packem_shared/ai-fix-6nXZbecQ.js";import{p as c}from"./cli-main.js";import{l as _}from"../packem_shared/failure-log-D92tM0ie.js";let A;const O=s=>(A??=T(import.meta.url))(s),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,q=s=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[t,i]=d.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return d.getBuiltinModule(s)}return O(s)},{createInterface:J}=q("node:readline"),U={"ambiguous-match":"ambiguous match",applied:"applied",error:"error","missing-file":"missing file","no-match":"no match","outside-workspace":"outside workspace"},j=(s,t,i)=>{const e=M(s,t,i),r=N(s,e);return r===""||r.startsWith("..")?e:r},W=(s,t,i)=>{const e=[$(`Fix proposal (${s.provider}, confidence: ${s.confidence})`),"",s.explanation||R("<no explanation>")];if(s.cannotFix)return e.push(""),e.push(P(`Cannot fix automatically: ${s.cannotFix}`)),e.join(`
2
+ `);if(s.patches.length===0)return e.push(""),e.push(P("No patches were proposed.")),e.join(`
3
+ `);e.push(""),e.push($(`Patches (${String(s.patches.length)}):`));for(const[r,o]of s.patches.entries()){const a=j(t,i,o.file);e.push(""),e.push(L(`[${String(r+1)}] ${a}`)),o.reason&&e.push(R(` reason: ${o.reason}`));for(const h of o.oldString.split(`
4
+ `))e.push(S(` - ${h}`));for(const h of o.newString.split(`
5
+ `))e.push(k(` + ${h}`))}return e.join(`
6
+ `)},C=(s,t,i)=>{const e=[];for(const r of s){const o=r.absolutePath?N(t,r.absolutePath)||r.absolutePath:j(t,i,r.patch.file),a=U[r.status];r.status==="applied"?e.push(k(` ✓ ${o}: ${a}`)):e.push(S(` ✗ ${o}: ${a}${r.error?` (${r.error})`:""}`))}return e.join(`
7
+ `)},v=s=>{let t=0,i=0;for(const e of s)e.status==="applied"?t+=1:i+=1;return{applied:t,failed:i}},z=s=>new Promise(t=>{const i=J({input:process.stdin,output:process.stderr});i.question(`${s} (y/N) `,e=>{i.close();const r=e.trim().toLowerCase();t(r==="y"||r==="yes")})}),E=s=>s??process.cwd(),Y=async({argument:s,logger:t,options:i,visConfig:e,workspaceRoot:r})=>{const o=s[0],a=E(r),m=(i.format??"text")==="json";if(!o){if(m){const p=_(a);process.stdout.write(`${JSON.stringify({availableTasks:p,error:"No task ID specified"},void 0,2)}
8
+ `)}else{c.error("No task ID specified. Usage: vis ai fix <project>:<target>");const p=_(a);if(p.length>0){c.info("Tasks with captured failure logs:");for(const f of p)c.info(` - ${f}`)}else c.notice("No failure logs found. Re-run a failing task with `vis run` to capture logs.")}process.exitCode=1;return}const n=await B(a,o,{runId:i.run});if(!n){m?process.stdout.write(`${JSON.stringify({error:"No failure log or run summary found",taskId:o},void 0,2)}
9
+ `):(c.error(`No failure log or run summary found for task "${o}".`),c.notice("Re-run the task with `vis run` so its terminal output and run metadata are captured.")),process.exitCode=1;return}n.terminalOutputCaptured||c.warn(`No captured terminal output for "${o}". Re-run with \`vis run\` for a better fix proposal.`);const F=e?.ai,u=await D(n,t,{cache:i.cache!==!1,config:F});if(!u){m&&process.stdout.write(`${JSON.stringify({error:"AI fix proposal failed or no provider available",taskId:o},void 0,2)}
10
+ `),process.exitCode=1;return}const w=i.apply===!0;if(m){const p=w?void 0:await y(a,n.cwd,u,{dryRun:!0}),f=w?await y(a,n.cwd,u):void 0;if(process.stdout.write(`${JSON.stringify({appliedResults:f,dryRunResults:p,failureContext:{cwd:n.cwd,hash:n.hash,runId:n.runId,taskId:n.taskId,terminalOutputCaptured:n.terminalOutputCaptured},proposal:u},void 0,2)}
11
+ `),w&&f){const{failed:I}=v(f);I>0&&(process.exitCode=1)}return}if(t.info(W(u,a,n.cwd)),u.cannotFix||u.patches.length===0)return;const b=await y(a,n.cwd,u,{dryRun:!0}),x=v(b);if(t.info(""),t.info($("Patch validation:")),t.info(C(b,a,n.cwd)),!w){t.info(""),c.info("Re-run with --apply to write these patches to disk.");return}if(x.applied===0){c.error("No patches can be applied (every patch failed validation)."),process.exitCode=1;return}if(i.yes!==!0&&(t.info(""),!await z(`Apply ${String(x.applied)} patch${x.applied===1?"":"es"} to disk?`))){c.notice("Aborted. Nothing written.");return}const g=await y(a,n.cwd,u),l=v(g);t.info(""),t.info($("Apply results:")),t.info(C(g,a,n.cwd)),t.info(""),l.failed===0?c.success(`Applied ${String(l.applied)} patch${l.applied===1?"":"es"}.`):(c.warn(`${String(l.applied)} applied, ${String(l.failed)} failed.`),process.exitCode=1)};export{Y as aiFix};
@@ -1,3 +1,3 @@
1
- import{VisReleaseError as d}from"../packem_shared/VisReleaseError-DMGRBTNO.js";const u=async(t,e,i=!0)=>t.runner.run("git",e,{cwd:t.cwd,silent:i}),h=async t=>{const e=await u(t,["rev-parse","--abbrev-ref","HEAD"]);if(e.exitCode!==0)return;const i=e.stdout.trim();return i==="HEAD"||i===""?void 0:i},w=async t=>{const e=await u(t,["rev-parse","HEAD"]);return e.exitCode===0?e.stdout.trim():void 0},E=async t=>{const e=await u(t,["rev-parse","--short","HEAD"]);return e.exitCode===0?e.stdout.trim():void 0},_=async t=>{const e=await u(t,["status","--porcelain"]);return e.exitCode===0&&e.stdout.trim()!==""},f=async(t,e)=>(await u(t,["rev-parse","--verify","--quiet",`refs/tags/${e}`])).exitCode===0,p=async(t,e,i="origin")=>{const s=await u(t,["ls-remote","--tags",i,e]);return s.exitCode===0&&s.stdout.trim()!==""},C=async(t,e,i,s={})=>{if(e.length===0&&!s.allowEmpty)throw new d({code:"CONFIG_INVALID",message:"stageAndCommit called with no files (and allowEmpty=false)."});if(e.length>0){const o=await t.runner.run("git",["add","--",...e],{cwd:t.cwd,silent:!0});if(o.exitCode!==0)throw new d({code:"GIT_OPERATION_FAILED",message:`git add failed: ${o.stderr||o.stdout}`})}const a={...process.env};s.author&&(a.GIT_AUTHOR_NAME=s.author.name,a.GIT_AUTHOR_EMAIL=s.author.email,a.GIT_COMMITTER_NAME=s.author.name,a.GIT_COMMITTER_EMAIL=s.author.email);const r=["commit","-m",i];s.allowEmpty&&r.push("--allow-empty");const n=await t.runner.run("git",r,{cwd:t.cwd,env:a,silent:!0});if(n.exitCode!==0)throw new d({code:"GIT_OPERATION_FAILED",message:`git commit failed: ${n.stderr||n.stdout}`});const c=await w(t);if(!c)throw new d({code:"GIT_OPERATION_FAILED",message:"git commit succeeded but HEAD is not resolvable."});return c},A=6e4;let g;const l=async t=>{const e=Date.now();if(g!==void 0&&e-g.cachedAtMs<A)return g.value;const i=await t.runner.run("gitsign",["--version"],{cwd:t.cwd,silent:!0});return g={cachedAtMs:e,value:i.exitCode===0},g.value},$=async(t,e,i,s={})=>{if(await f(t,e))throw new d({code:"TAG_COLLISION",message:`Tag "${e}" already exists locally. Resolve manually before re-running.`});if(!s.skipRemoteCheck&&await p(t,e,s.remote??"origin"))throw new d({code:"TAG_COLLISION",message:`Tag "${e}" already exists on remote "${s.remote??"origin"}". A previous run may have pushed tags but failed mid-publish — inspect the remote and either re-use the existing tag or delete it before re-running.`});const{signing:a}=s;if(a?.mode==="sigstore"){if(await l(t)){const c=["tag","-a",e];i&&c.push("-m",i);const o=await t.runner.run("gitsign",c,{cwd:t.cwd,silent:!0});if(o.exitCode!==0)throw new d({code:"GIT_OPERATION_FAILED",message:`gitsign tag ${e} failed: ${o.stderr||o.stdout}`});return}process.stderr.write(`[vis release] Warning: signing.mode is "sigstore" but \`gitsign\` is not on PATH; falling back to GPG signing for tag ${e}.
2
- `)}const r=["tag"];a&&(a.key&&a.mode==="gpg"?r.push("-u",a.key):r.push("-s")),i?r.push("-a",e,"-m",i):r.push(e);const n=await u(t,r);if(n.exitCode!==0)throw new d({code:"GIT_OPERATION_FAILED",message:`git tag ${e} failed: ${n.stderr||n.stdout}`})},O=async(t,e={})=>{const i=["push",e.remote??"origin","--tags"];e.atomic&&i.splice(1,0,"--atomic");const s=await u(t,i,!1);if(s.exitCode!==0)throw new d({code:"TAG_PUSH_FAILED",hint:"After resolving, re-run with --resume to retry the push.",message:`git push --tags failed: ${s.stderr||s.stdout}`})},v=async(t,e,i={})=>{const{signing:s}=i;if(s?.mode==="sigstore"){if(await l(t)){const c=["tag","-f","-a","-m",`Floating tag ${e}`,e],o=await t.runner.run("gitsign",c,{cwd:t.cwd,silent:!0});if(o.exitCode!==0)throw new d({code:"GIT_OPERATION_FAILED",message:`gitsign tag -f ${e} failed: ${o.stderr||o.stdout}`});if(i.push===!1)return;const m=await u(t,["push",i.remote??"origin","--force",`refs/tags/${e}:refs/tags/${e}`],!1);if(m.exitCode!==0)throw new d({code:"TAG_PUSH_FAILED",hint:"After resolving, re-run with --resume to retry the push.",message:`git push --force refs/tags/${e} failed: ${m.stderr||m.stdout}`});return}process.stderr.write(`[vis release] Warning: signing.mode is "sigstore" but \`gitsign\` is not on PATH; falling back to GPG signing for floating tag ${e}.
3
- `)}const a=["tag","-f"];s&&(s.key&&s.mode==="gpg"?a.push("-u",s.key):a.push("-s")),a.push(e);const r=await u(t,a);if(r.exitCode!==0)throw new d({code:"GIT_OPERATION_FAILED",message:`git tag -f ${e} failed: ${r.stderr||r.stdout}`});if(i.push===!1)return;const n=await u(t,["push",i.remote??"origin","--force",`refs/tags/${e}:refs/tags/${e}`],!1);if(n.exitCode!==0)throw new d({code:"TAG_PUSH_FAILED",hint:"After resolving, re-run with --resume to retry the push.",message:`git push --force refs/tags/${e} failed: ${n.stderr||n.stdout}`})},y=async(t,e,i,s={})=>{const a=await t.runner.run("git",["add","-A","--",e],{cwd:t.cwd,silent:!0});if(a.exitCode!==0)throw new d({code:"GIT_OPERATION_FAILED",message:`git add ${e} failed: ${a.stderr||a.stdout}`});if((await t.runner.run("git",["diff","--cached","--quiet","--",e],{cwd:t.cwd,silent:!0})).exitCode===0)return{committed:!1,pushed:!1};const r={...process.env};s.author&&(r.GIT_AUTHOR_NAME=s.author.name,r.GIT_AUTHOR_EMAIL=s.author.email,r.GIT_COMMITTER_NAME=s.author.name,r.GIT_COMMITTER_EMAIL=s.author.email);const n=["commit","-m",i];s.sign&&n.push("-S");const c=await t.runner.run("git",n,{cwd:t.cwd,env:r,silent:!0});if(c.exitCode!==0)throw new d({code:"GIT_OPERATION_FAILED",message:`git commit failed: ${c.stderr||c.stdout}`});if(!s.push)return{committed:!0,pushed:!1};const o=s.branch??await h(t);return o?{committed:!0,pushed:(await t.runner.run("git",["push",s.remote??"origin",`HEAD:${o}`],{cwd:t.cwd,silent:!1})).exitCode===0}:{committed:!0,pushed:!1}},G=async(t,e,i={})=>{const s=["push",i.remote??"origin",`HEAD:${e}`];i.force&&s.push("--force-with-lease");const a=await u(t,s,!1);if(a.exitCode!==0)throw new d({code:"TAG_PUSH_FAILED",message:`git push ${e} failed: ${a.stderr||a.stdout}`})},x=(t,e)=>`${t}@${e}`,I=/\{(name|unscopedName|version|major|minor|patch|date|channel)\}/g,D=(t,e)=>{const i=e.version??"",[s="",a="",r=""]=i.split(/[-+]/,1)[0].split("."),n={channel:e.channel??"",date:e.date??new Date().toISOString().slice(0,10),major:s,minor:a,name:e.name??"",patch:r,unscopedName:e.name?e.name.replace(/^@[^/]+\//,""):"",version:i};return t.replaceAll(I,(c,o)=>n[o]??"")};export{v as createOrUpdateFloatingTag,$ as createTag,x as defaultTagFor,h as getCurrentBranch,w as getCurrentSha,E as getShortSha,l as gitsignAvailable,_ as hasUncommittedChanges,G as pushBranch,O as pushTags,D as renderTagPattern,C as stageAndCommit,y as stageAndCommitFile,f as tagExists,p as tagExistsRemote};
1
+ import{VisReleaseError as n}from"../packem_shared/VisReleaseError-DZtgcKf8.js";const d=async(t,e,r=!0)=>t.runner.run("git",e,{cwd:t.cwd,silent:r}),f=async t=>{const e=await d(t,["rev-parse","--abbrev-ref","HEAD"]);if(e.exitCode!==0)return;const r=e.stdout.trim();return r==="HEAD"||r===""?void 0:r},w=async t=>{const e=await d(t,["rev-parse","HEAD"]);return e.exitCode===0?e.stdout.trim():void 0},C=async t=>{const e=await d(t,["rev-parse","--short","HEAD"]);return e.exitCode===0?e.stdout.trim():void 0},v=async t=>{const e=await d(t,["status","--porcelain"]);return e.exitCode===0&&e.stdout.trim()!==""},A=async(t,e)=>(await d(t,["rev-parse","--verify","--quiet",`refs/tags/${e}`])).exitCode===0,T=async(t,e,r="origin")=>{const s=await d(t,["ls-remote","--tags",r,e]);return s.exitCode===0&&s.stdout.trim()!==""},$=async(t,e,r,s={})=>{if(e.length===0&&!s.allowEmpty)throw new n({code:"CONFIG_INVALID",message:"stageAndCommit called with no files (and allowEmpty=false)."});if(e.length>0){const u=await t.runner.run("git",["add","--",...e],{cwd:t.cwd,silent:!0});if(u.exitCode!==0)throw new n({code:"GIT_OPERATION_FAILED",message:`git add failed: ${u.stderr||u.stdout}`})}const i={...process.env};s.author&&(i.GIT_AUTHOR_NAME=s.author.name,i.GIT_AUTHOR_EMAIL=s.author.email,i.GIT_COMMITTER_NAME=s.author.name,i.GIT_COMMITTER_EMAIL=s.author.email);const o=["commit","-m",r];s.allowEmpty&&o.push("--allow-empty");const a=await t.runner.run("git",o,{cwd:t.cwd,env:i,silent:!0});if(a.exitCode!==0)throw new n({code:"GIT_OPERATION_FAILED",message:`git commit failed: ${a.stderr||a.stdout}`});const c=await w(t);if(!c)throw new n({code:"GIT_OPERATION_FAILED",message:"git commit succeeded but HEAD is not resolvable."});return c},I=6e4;let l;const h=async t=>{const e=Date.now();if(l!==void 0&&e-l.cachedAtMs<I)return l.value;const r=await t.runner.run("gitsign",["--version"],{cwd:t.cwd,silent:!0});return l={cachedAtMs:e,value:r.exitCode===0},l.value},_=()=>{l=void 0},O=_,G=async(t,e,r,s={})=>{if(await A(t,e))throw new n({code:"TAG_COLLISION",message:`Tag "${e}" already exists locally. Resolve manually before re-running.`});if(!s.skipRemoteCheck&&await T(t,e,s.remote??"origin"))throw new n({code:"TAG_COLLISION",message:`Tag "${e}" already exists on remote "${s.remote??"origin"}". A previous run may have pushed tags but failed mid-publish — inspect the remote and either re-use the existing tag or delete it before re-running.`});const{signing:i}=s;if(i?.mode==="sigstore"){if(await h(t)){const c=["tag","-a",e];r&&c.push("-m",r);const u=await t.runner.run("gitsign",c,{cwd:t.cwd,silent:!0});if(u.exitCode!==0)throw new n({code:"GIT_OPERATION_FAILED",message:`gitsign tag ${e} failed: ${u.stderr||u.stdout}`});return}process.stderr.write(`[vis release] Warning: signing.mode is "sigstore" but \`gitsign\` is not on PATH; falling back to GPG signing for tag ${e}.
2
+ `)}const o=["tag"];i&&(i.key&&i.mode==="gpg"?o.push("-u",i.key):o.push("-s")),r?o.push("-a",e,"-m",r):o.push(e);const a=await d(t,o);if(a.exitCode!==0)throw new n({code:"GIT_OPERATION_FAILED",message:`git tag ${e} failed: ${a.stderr||a.stdout}`})},R=async(t,e={})=>{const r=["push",e.remote??"origin","--tags"];e.atomic&&r.splice(1,0,"--atomic");const s=await d(t,r,!1);if(s.exitCode!==0)throw new n({code:"TAG_PUSH_FAILED",hint:"After resolving, re-run with --resume to retry the push.",message:`git push --tags failed: ${s.stderr||s.stdout}`})},y=async(t,e,r={})=>{const{signing:s}=r;if(s?.mode==="sigstore"){if(await h(t)){const u=["tag","-f","-a","-m",`Floating tag ${e}`,e],g=await t.runner.run("gitsign",u,{cwd:t.cwd,silent:!0});if(g.exitCode!==0)throw new n({code:"GIT_OPERATION_FAILED",message:`gitsign tag -f ${e} failed: ${g.stderr||g.stdout}`});if(r.push===!1)return;const m=await d(t,["push",r.remote??"origin","--force",`refs/tags/${e}:refs/tags/${e}`],!1);if(m.exitCode!==0)throw new n({code:"TAG_PUSH_FAILED",hint:"After resolving, re-run with --resume to retry the push.",message:`git push --force refs/tags/${e} failed: ${m.stderr||m.stdout}`});return}process.stderr.write(`[vis release] Warning: signing.mode is "sigstore" but \`gitsign\` is not on PATH; falling back to GPG signing for floating tag ${e}.
3
+ `)}const i=["tag","-f"];s&&(s.key&&s.mode==="gpg"?i.push("-u",s.key):i.push("-s")),i.push(e);const o=await d(t,i);if(o.exitCode!==0)throw new n({code:"GIT_OPERATION_FAILED",message:`git tag -f ${e} failed: ${o.stderr||o.stdout}`});if(r.push===!1)return;const a=await d(t,["push",r.remote??"origin","--force",`refs/tags/${e}:refs/tags/${e}`],!1);if(a.exitCode!==0)throw new n({code:"TAG_PUSH_FAILED",hint:"After resolving, re-run with --resume to retry the push.",message:`git push --force refs/tags/${e} failed: ${a.stderr||a.stdout}`})},D=async(t,e,r,s={})=>{const i=await t.runner.run("git",["add","-A","--",e],{cwd:t.cwd,silent:!0});if(i.exitCode!==0)throw new n({code:"GIT_OPERATION_FAILED",message:`git add ${e} failed: ${i.stderr||i.stdout}`});if((await t.runner.run("git",["diff","--cached","--quiet","--",e],{cwd:t.cwd,silent:!0})).exitCode===0)return{committed:!1,pushed:!1};const a={...process.env};s.author&&(a.GIT_AUTHOR_NAME=s.author.name,a.GIT_AUTHOR_EMAIL=s.author.email,a.GIT_COMMITTER_NAME=s.author.name,a.GIT_COMMITTER_EMAIL=s.author.email);const c=["commit","-m",r];s.sign&&c.push("-S");const u=await t.runner.run("git",c,{cwd:t.cwd,env:a,silent:!0});if(u.exitCode!==0)throw new n({code:"GIT_OPERATION_FAILED",message:`git commit failed: ${u.stderr||u.stdout}`});if(!s.push)return{committed:!0,pushed:!1};const g=s.branch??await f(t);return g?{committed:!0,pushed:(await t.runner.run("git",["push",s.remote??"origin",`HEAD:${g}`],{cwd:t.cwd,silent:!1})).exitCode===0}:{committed:!0,pushed:!1}},L=async(t,e,r={})=>{const s=["push",r.remote??"origin",`HEAD:${e}`];r.force&&s.push("--force-with-lease");const i=await d(t,s,!1);if(i.exitCode!==0)throw new n({code:"TAG_PUSH_FAILED",message:`git push ${e} failed: ${i.stderr||i.stdout}`})},N=(t,e)=>`${t}@${e}`,E=/\{(name|unscopedName|version|major|minor|patch|date|channel)\}/g,F=(t,e)=>{const r=e.version??"",[s="",i="",o=""]=r.split(/[-+]/,1)[0].split("."),a={channel:e.channel??"",date:e.date??new Date().toISOString().slice(0,10),major:s,minor:i,name:e.name??"",patch:o,unscopedName:e.name?e.name.replace(/^@[^/]+\//,""):"",version:r};return t.replaceAll(E,(c,u)=>a[u]??"")};export{y as createOrUpdateFloatingTag,G as createTag,N as defaultTagFor,f as getCurrentBranch,w as getCurrentSha,C as getShortSha,h as gitsignAvailable,v as hasUncommittedChanges,L as pushBranch,R as pushTags,F as renderTagPattern,_ as resetGitsignCache,O as resetGitsignCacheForTests,$ as stageAndCommit,D as stageAndCommitFile,A as tagExists,T as tagExistsRemote};
@@ -1 +1 @@
1
- import{s as l}from"../packem_shared/index-BAe6e0XE.js";import g from"./index.js";import{normaliseGroup as d}from"../release/types.js";const v=(n,e,r)=>(n??"{name}@{version}").replaceAll("{name}",e).replaceAll("{version}",r),h=n=>{let e=n[0]??"0.0.0";for(const r of n){const s=l.valid(r)!==null,t=l.valid(e)!==null;s&&(!t||l.gt(r,e))&&(e=r)}return e},k=(n,e)=>{const r=[...n.fixed??[],...n.linked??[]].map(a=>d(a)),s=[],t=new Set;return r.forEach((a,f)=>{if(!a.syncGitTag)return;const m=e.filter(o=>!t.has(o.name)&&a.packages.some(i=>o.name===i||g(i,o.name))).map(o=>o.name);if(m.length===0)return;for(const o of m)t.add(o);const u=m.map(o=>e.find(i=>i.name===o)?.version??"0.0.0"),p=h(u),c=a.name??`group-${f}`;s.push({members:m,name:c,tag:v(a.tagPattern,c,p),version:p})}),{grouped:t,groups:s}};export{k as resolveSyncTagGroups};
1
+ import{s as i}from"../packem_shared/index-B4AjSxHU.js";import d from"./index.js";import{normaliseGroup as v}from"../release/types.js";const g=(r,e,o)=>(r??"{name}@{version}").replaceAll("{name}",e).replaceAll("{version}",o),x=r=>{let e=r[0]??"0.0.0";for(const o of r){const s=i.valid(o)!==null,t=i.valid(e)!==null;s&&(!t||i.gt(o,e))&&(e=o)}return e},T=(r,e)=>{const o=[...r.fixed??[],...r.linked??[]].map(a=>v(a)),s=[],t=new Set;return o.forEach((a,f)=>{if(!a.syncGitTag)return;const m=e.filter(n=>!t.has(n.name)&&a.packages.some(c=>n.name===c||d(c,n.name))).map(n=>n.name);if(m.length===0)return;for(const n of m)t.add(n);const u=m.map(n=>e.find(c=>c.name===n)?.version??"0.0.0"),l=x(u),p=a.name??`group-${f}`;s.push({members:m,name:p,tag:g(a.tagPattern,p,l),version:l})}),{grouped:t,groups:s}};export{T as resolveSyncTagGroups};
@@ -1 +1 @@
1
- import{L as v,h,N as u}from"../packem_shared/pm-runner-DRybtzOV.js";import{r as w,a as C}from"../packem_shared/command-runtime-DQ7ZpLYL.js";import{i as R}from"../packem_shared/utils-CRueU43T.js";const b=async({argument:f,logger:l,options:e,rawUnknown:m,visConfig:s,workspaceRoot:d})=>{const a=f;if(!a||a.length===0)throw new Error("No command specified. Usage: vis exec <command> [args...]");const[n,...c]=a,t=m??[],i=t[0]==="--"?c:[...c,...t],o=d??process.cwd(),p=R(e.filter);let r=!e.recursive&&!e.workspaceRoot&&!e.parallel&&!e.reverse&&!e.shellMode&&p.length===0?v(n,i,o):null;if(r===null){const g=w({logger:l,options:e,visConfig:s},o),k=h(o,{backend:C(g),configBackend:s?.install?.backend,configCorepack:s?.install?.corepack});r=u(k,{args:i,command:n,filter:p,parallel:e.parallel||!1,recursive:e.recursive||!1,reverse:e.reverse||!1,shellMode:e.shellMode||!1,workspaceRoot:e.workspaceRoot||!1},o,l)}r!==0&&(process.exitCode=r)};export{b as default};
1
+ import{r as g,a as p,b as v}from"../packem_shared/pm-runner-de-jCq8q.js";import{r as h,a as x}from"../packem_shared/command-runtime-CiLVo4ED.js";import{t as R}from"../packem_shared/utils-DQFHJn72.js";const B=async({argument:f,logger:c,options:e,rawUnknown:i,visConfig:s,workspaceRoot:k})=>{const l=f;if(!l||l.length===0)throw new Error("No command specified. Usage: vis exec <command> [args...]");const[o,...n]=l,t=i??[],m=t[0]==="--"?n:[...n,...t],a=k??process.cwd(),d=R(e.filter);let r=!e.recursive&&!e.workspaceRoot&&!e.parallel&&!e.reverse&&!e.shellMode&&d.length===0?g(o,m,a):null;if(r===null){const u=h({logger:c,options:e,visConfig:s},a),w=p(a,{backend:x(u),configBackend:s?.install?.backend,configCorepack:s?.install?.corepack});r=v(w,{args:m,command:o,filter:d,parallel:e.parallel||!1,recursive:e.recursive||!1,reverse:e.reverse||!1,shellMode:e.shellMode||!1,workspaceRoot:e.workspaceRoot||!1},a,c)}r!==0&&(process.exitCode=r)};export{B as default};
@@ -1,5 +1,5 @@
1
- import{createRequire as _}from"node:module";import{l as a,z as d,w as r,j as y}from"../packem_shared/index-BLtnel38.js";import{b}from"../packem_shared/en-BDYMmM2_.js";let g;const v=s=>(g??=_(import.meta.url))(s),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=s=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[n,i]=t.versions.node.split(".").map(Number);if(n>22||n===22&&i>=3||n===20&&i>=16)return t.getBuiltinModule(s)}return v(s)},{homedir:o}=u("node:os"),{createInterface:w}=u("node:readline"),c=b(),p=[r(o(),".zshrc"),r(o(),".zshenv"),r(o(),".bashrc"),r(o(),".bash_profile"),r(o(),".profile"),r(o(),".config","fish","config.fish")],j=s=>{const n=[];for(const i of p)if(a(i))try{const f=d(i).split(`
2
- `),l=f.filter(e=>!e.includes(".vis/bin")&&!e.includes("VIS_HOME")&&!e.includes("# vis "));l.length!==f.length&&(y(i,l.join(`
3
- `)),n.push(i))}catch{s.warn(`warning: could not clean ${i}`)}return n},E=async({fs:s,logger:n,options:i})=>{if(!a(c)){n.info("vis is not installed (no ~/.vis directory found).");return}n.info("This will remove:"),n.info(` ${c}/`);const f=p.filter(e=>a(e)&&d(e).includes(".vis"));for(const e of f)n.info(` Lines in ${e}`);if(!i.yes){if(!process.stdin.isTTY)throw new Error("Non-interactive terminal. Use --yes to confirm.");const e=w({input:process.stdin,output:process.stdout}),m=await new Promise(h=>{e.question(`
4
- Type "uninstall" to confirm: `,h)});if(e.close(),m.trim()!=="uninstall"){n.info("Aborted.");return}}const l=j(n);for(const e of l)n.info(`Cleaned ${e}`);try{await s.rm(c,{force:!0,recursive:!0}),n.info(`
5
- ✓ Removed ${c}`)}catch(e){throw new Error(`Failed to remove ${c}: ${e instanceof Error?e.message:String(e)}`,{cause:e})}n.info("✓ vis has been uninstalled.")};export{E as default};
1
+ import{createRequire as _}from"node:module";import{z as m,e as t}from"../packem_shared/index-DHD8wb6Z.js";import{b}from"../packem_shared/formatBytes-BHAzNIrn-DFIppnY0.js";import{y as a}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{U as j}from"../packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js";let v;const w=s=>(v??=_(import.meta.url))(s),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=s=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[n,o]=c.versions.node.split(".").map(Number);if(n>22||n===22&&o>=3||n===20&&o>=16)return c.getBuiltinModule(s)}return w(s)},{homedir:i}=d("node:os"),{createInterface:y}=d("node:readline"),f=b(),p=[t(i(),".zshrc"),t(i(),".zshenv"),t(i(),".bashrc"),t(i(),".bash_profile"),t(i(),".profile"),t(i(),".config","fish","config.fish")],E=s=>{const n=[];for(const o of p)if(a(o))try{const l=m(o).split(`
2
+ `),e=l.filter(r=>!r.includes(".vis/bin")&&!r.includes("VIS_HOME")&&!r.includes("# vis "));e.length!==l.length&&(j(o,e.join(`
3
+ `)),n.push(o))}catch{s.warn(`warning: could not clean ${o}`)}return n},H=async({fs:s,logger:n,options:o})=>{if(!a(f)){n.info("vis is not installed (no ~/.vis directory found).");return}n.info("This will remove:"),n.info(` ${f}/`);const u=p.filter(e=>a(e)&&m(e).includes(".vis"));for(const e of u)n.info(` Lines in ${e}`);if(!o.yes){if(!process.stdin.isTTY)throw new Error("Non-interactive terminal. Use --yes to confirm.");const e=y({input:process.stdin,output:process.stdout}),r=await new Promise(h=>{e.question(`
4
+ Type "uninstall" to confirm: `,h)});if(e.close(),r.trim()!=="uninstall"){n.info("Aborted.");return}}const l=E(n);for(const e of l)n.info(`Cleaned ${e}`);try{await s.rm(f,{force:!0,recursive:!0}),n.info(`
5
+ ✓ Removed ${f}`)}catch(e){throw new Error(`Failed to remove ${f}: ${e instanceof Error?e.message:String(e)}`,{cause:e})}n.info("✓ vis has been uninstalled.")};export{H as default};
@@ -1 +1 @@
1
- import{h as f,a as d}from"../packem_shared/pm-runner-DRybtzOV.js";import{r as k,a as m}from"../packem_shared/command-runtime-DQ7ZpLYL.js";const h=async({argument:o,logger:s,options:i,process:c,visConfig:e,workspaceRoot:r})=>{if(!o||o.length===0)throw new Error("No package specified. Usage: vis info <package> [field...]");const[t,...l]=o,a=r??c.cwd,p=k({logger:s,options:i,visConfig:e},a),g=f(a,{backend:m(p),configBackend:e?.install?.backend,configCorepack:e?.install?.corepack}),n=d(g,{fields:l,json:i.json||!1,package:t},a,s);n!==0&&n!==1&&(process.exitCode=n)};export{h as default};
1
+ import{a as f,f as k}from"../packem_shared/pm-runner-de-jCq8q.js";import{r as m,a as w}from"../packem_shared/command-runtime-CiLVo4ED.js";const I=async({argument:e,logger:s,options:n,process:r,visConfig:a,workspaceRoot:t})=>{if(!e||e.length===0)throw new Error("No package specified. Usage: vis info <package> [field...]");const[l,...d]=e,c=t??r.cwd,i=m({logger:s,options:n,visConfig:a},c),p=f(c,{backend:w(i),configBackend:a?.install?.backend,configCorepack:a?.install?.corepack}),o=k(p,{fields:d,json:n.json||!1,package:l},c,s);o!==0&&o!==1&&(process.exitCode=o)};export{I as default};
@@ -1,27 +1,27 @@
1
- import{createRequire as D}from"node:module";import{w as d,b as F,l as $,j as y}from"../packem_shared/index-BLtnel38.js";import{findVisConfigFile as I,DEFAULT_MIN_RELEASE_AGE_MINUTES as h}from"./CONFIG_FILES.js";import{p as e,e as G}from"./cli-main.js";import{A as P}from"../packem_shared/pm-runner-DRybtzOV.js";import{w as q}from"../packem_shared/build-scripts-DWypBQ--.js";import{O as A}from"../packem_shared/native-config-sync-CHMCJx7H.js";import{S as x}from"../packem_shared/min-release-age-6avfn81h.js";let N;const M=i=>(N??=D(import.meta.url))(i),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=i=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[s,o]=g.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return g.getBuiltinModule(i)}return M(i)},{execFileSync:O}=R("node:child_process"),{createInterface:B}=R("node:readline"),K=i=>{const s=[];return $(d(i,"turbo.json"))&&s.push("turborepo"),$(d(i,"nx.json"))&&s.push("nx"),$(d(i,".moon"))&&s.push("moon"),s},E=(i,s)=>new Promise(o=>{i.question(s,t=>{o(t.trim())})}),u=async(i,s,o=!0)=>{const t=await E(i,`${s} ${o?"[Y/n]":"[y/N]"} `);return t===""?o:t.toLowerCase()==="y"||t.toLowerCase()==="yes"},w=(i,s)=>{const o=[],t=Object.entries(s.allowBuilds).filter(([,c])=>c).map(([c])=>` "${c}": true,`).join(`
2
- `),a=[` installScripts: {
3
- allow: ${t?`{
4
- ${t}
1
+ import{createRequire as E}from"node:module";import{e as m,a as O}from"../packem_shared/index-DHD8wb6Z.js";import{findVisConfigFile as F,DEFAULT_MIN_RELEASE_AGE_MINUTES as v}from"./CONFIG_FILES.js";import{p as e,e as q}from"./cli-main.js";import{d as G}from"../packem_shared/pm-runner-de-jCq8q.js";import{s as U}from"../packem_shared/build-scripts-pdVmqXRm.js";import{y as S}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{U as j}from"../packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js";import{s as T}from"../packem_shared/native-config-sync-BSzU4qUO.js";import{s as R}from"../packem_shared/min-release-age-ChzTC7_I.js";let M;const N=t=>(M??=E(import.meta.url))(t),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=t=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[s,n]=p.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return p.getBuiltinModule(t)}return N(t)},{execFileSync:I}=x("node:child_process"),{createInterface:D}=x("node:readline"),K=t=>{const s=[];return S(m(t,"turbo.json"))&&s.push("turborepo"),S(m(t,"nx.json"))&&s.push("nx"),S(m(t,".moon"))&&s.push("moon"),s},B=(t,s)=>new Promise(n=>{t.question(s,i=>{n(i.trim())})}),d=async(t,s,n=!0)=>{const o=await B(t,`${s} ${n?"[Y/n]":"[y/N]"} `);return o===""?n:o.toLowerCase()==="y"||o.toLowerCase()==="yes"},w=(t,s)=>{const n=[],i=Object.entries(s.allowBuilds).filter(([,c])=>c).map(([c])=>` "${c}": true,`).join(`
2
+ `),r=[` installScripts: {
3
+ allow: ${i?`{
4
+ ${i}
5
5
  }`:"{}"},
6
- },`];s.minimumReleaseAge!==void 0&&a.push(` firstSeen: {
6
+ },`];s.minimumReleaseAge!==void 0&&r.push(` firstSeen: {
7
7
  minutes: ${String(s.minimumReleaseAge)},
8
- },`);let n=` policies: {
9
- ${a.join(`
8
+ },`);let l=` policies: {
9
+ ${r.join(`
10
10
  `)}
11
- },`;return s.enableSocket&&(n+=`
12
- socket: { enabled: true },`),s.enableDepsDev&&(n+=`
13
- depsDev: { enabled: true },`),o.push(` security: {
14
- ${n}
15
- },`),s.staged&&o.push(` staged: {
11
+ },`;return s.enableSocket&&(l+=`
12
+ socket: { enabled: true },`),s.enableDepsDev&&(l+=`
13
+ depsDev: { enabled: true },`),n.push(` security: {
14
+ ${l}
15
+ },`),s.staged&&n.push(` staged: {
16
16
  "*": ["vis lint --staged --fix", "vis fmt --staged"],
17
17
  },`),`import { defineConfig } from "@visulima/vis/config";
18
18
 
19
19
  export default defineConfig({
20
- ${o.join(`
20
+ ${n.join(`
21
21
 
22
22
  `)}
23
23
  });
24
- `},L=async(i,s,o)=>{const t=B({input:process.stdin,output:process.stdout});e.info(`
24
+ `},L=async(t,s,n)=>{const i=D({input:process.stdin,output:process.stdout});e.info(`
25
25
  vis init — interactive setup
26
- `);const a=await u(t," Enable Socket.dev security scanning?");a&&(e.success(" Socket.dev enabled — scores, alerts, and supply chain data active."),process.env.VIS_SOCKET_TOKEN||e.notice(" Set VIS_SOCKET_TOKEN for a custom API token (optional).")),e.info("");const n=await u(t," Enable Google deps.dev (OpenSSF Scorecard + GHSA advisories)?");n&&e.success(" deps.dev enabled — Scorecard signals and advisories merged into the security report."),e.info("");const c=await u(t," Scan for packages with build scripts?"),p={};if(c){e.info(" Scanning node_modules...");const l=q(i,{});if(l.length>0){e.info(` Found ${String(l.length)} package${l.length===1?"":"s"} with build scripts:
27
- `);for(const r of l){const f=await u(t,` Allow ${r}?`,!1),_=r.split(" (")[0]??r;p[_]=f,f&&e.success(` ✓ ${_} approved`)}}else e.info(" No packages with build scripts found.")}e.info("");const T=await u(t," Enforce a minimum release age (block freshly-published versions)?");let m;if(T){const l=await E(t,` Minimum age in minutes (default ${String(h)} = 2 days): `),r=l===""?h:Number.parseInt(l,10);m=Number.isFinite(r)&&r>0?r:h,e.success(` minimumReleaseAge: ${String(m)} minutes`)}e.info("");const b=await u(t," Set up pre-commit hooks (lint-staged)?",!1);let S=!1;(s.name==="pnpm"||s.name==="yarn"||s.name==="npm"||s.name==="bun")&&(e.info(""),S=await u(t,` Sync security settings to ${s.name} config?`));const v=K(i);if(v.length>0&&(e.info(""),e.info(` Detected existing tools: ${v.join(", ")}`),await u(t,` Run \`vis migrate\` for ${v.join(", ")}?`,!1))){t.close();const[l,...r]=s.name==="pnpm"?["pnpm","exec"]:s.name==="yarn"?["yarn","exec"]:s.name==="bun"?["bunx"]:["npx"];for(const f of v){e.info(` Migrating from ${f}...`);try{O(l,[...r,"vis","migrate",f],{cwd:i,stdio:"inherit"})}catch{e.warn(` Migration from ${f} had issues — run \`vis migrate ${f}\` manually.`)}}if($(o))e.success(`Migrated config written to ${o}`);else{const f=w(s.name,{allowBuilds:p,enableDepsDev:n,enableSocket:a,minimumReleaseAge:m,staged:b});y(o,f),e.success(`Created ${o}`)}e.notice(" Run 'vis doctor' to see your project's full health status.");return}t.close(),e.info("");const C=w(s.name,{allowBuilds:p,enableDepsDev:n,enableSocket:a,minimumReleaseAge:m,staged:b});if(y(o,C),e.success(`Created ${o}`),S){const l=Object.fromEntries(Object.entries(p).filter(([,r])=>r));for(const r of A(s.name,i,l))e.success(` ${r}`);for(const r of x(s.name,i,m))e.success(` ${r}`)}e.info(""),e.info(" Setup complete. Your config:");const j=[a&&"Socket.dev",n&&"deps.dev"].filter(Boolean);e.info(` Security: ${j.length>0?`${j.join(" + ")} enabled`:"defaults only"}`),e.info(` Build scripts: ${Object.values(p).filter(Boolean).length} approved`),e.info(` Min age: ${m===void 0?"not enforced":`${String(m)} minutes`}`),e.info(` Git hooks: ${b?"lint-staged configured":"not configured"}`),e.info(` PM sync: ${S?"done":"skipped"}`),e.info(""),e.notice(" Run 'vis doctor' to see your project's full health status."),e.info("")},U=(i,s,o,t)=>{const a=w(s.name,{allowBuilds:{},enableDepsDev:!1,enableSocket:!1,minimumReleaseAge:h,staged:!1});if(y(t,a),e.success(`Created ${t}`),e.info(" Secure defaults are applied automatically by defineConfig()."),o.syncNative){for(const n of A(s.name,i,{}))e.success(` ${n}`);for(const n of x(s.name,i,h))e.success(` ${n}`)}e.info(""),e.notice("Run 'vis doctor' for a full health check, or 'vis init' in a terminal for guided setup.")},k=(i,s,o)=>{const t=d(i,".."),a=d(s,"node_modules","@visulima","vis","schemas",o),n=F(t,a),c=n===""?`./${o}`:n.split(/[/\\]/u).join("/");return c.startsWith(".")?c:`./${c}`},V=(i,s)=>{const o=k(d(i,"project.json"),s,"project.schema.json"),t=k(d(i,"vis.config.ts"),s,"vis-config.schema.json");e.info(""),e.info("Paste these into your config files to get editor IntelliSense:"),e.info(""),e.info(` project.json → "$schema": "${o}"`),e.info(` vis.config.ts → see ${t} (vis.config.ts is TypeScript; use the import path directly)`),e.info(""),e.notice("For nested project.json files, the `..` depth changes — run `vis migrate nx` to auto-rewrite all of them.")},ee=async({options:i,workspaceRoot:s})=>{const o=s??process.cwd();if(i.schema){V(o,o);return}const t=P(o),a=I(o);if(a&&!i.force){e.warn(`Config already exists: ${a}`),e.notice("Use --force to overwrite, or edit the existing file.");return}const n=a??d(o,"vis.config.ts");process.stdin.isTTY&&i.interactive!==!1?await L(o,t,n):U(o,t,i,n);const c=G(o);c.added.length>0&&e.success(`Added to .gitignore: ${c.added.join(", ")}`)};export{k as buildSchemaRefForTesting,ee as default};
26
+ `);const o=await d(i," Enable Socket.dev security scanning?");o&&(e.success(" Socket.dev enabled — scores, alerts, and supply chain data active."),process.env.VIS_SOCKET_TOKEN||e.notice(" Set VIS_SOCKET_TOKEN for a custom API token (optional).")),e.info("");const r=await d(i," Enable Google deps.dev (OpenSSF Scorecard + GHSA advisories)?");r&&e.success(" deps.dev enabled — Scorecard signals and advisories merged into the security report."),e.info("");const l=await d(i," Scan for packages with build scripts?"),c={};if(l){e.info(" Scanning node_modules...");const f=U(t,{});if(f.length>0){e.info(` Found ${String(f.length)} package${f.length===1?"":"s"} with build scripts:
27
+ `);for(const a of f){const y=await d(i,` Allow ${a}?`,!1),u=a.split(" (")[0]??a;c[u]=y,y&&e.success(` ✓ ${u} approved`)}}else e.info(" No packages with build scripts found.")}e.info("");const C=await d(i," Enforce a minimum release age (block freshly-published versions)?");let g;if(C){const f=await B(i,` Minimum age in minutes (default ${String(v)} = 2 days): `),a=f===""?v:Number.parseInt(f,10);g=Number.isFinite(a)&&a>0?a:v,e.success(` minimumReleaseAge: ${String(g)} minutes`)}e.info("");const $=await d(i," Set up pre-commit hooks (lint-staged)?",!1);let b=!1;(s.name==="pnpm"||s.name==="yarn"||s.name==="npm"||s.name==="bun")&&(e.info(""),b=await d(i,` Sync security settings to ${s.name} config?`));const h=K(t);if(h.length>0&&(e.info(""),e.info(` Detected existing tools: ${h.join(", ")}`),await d(i,` Run \`vis migrate\` for ${h.join(", ")}?`,!1))){i.close();const[a,...y]=s.name==="pnpm"?["pnpm","exec"]:s.name==="yarn"?["yarn","exec"]:s.name==="bun"?["bunx"]:["npx"];for(const u of h){e.info(` Migrating from ${u}...`);try{I(a,[...y,"vis","migrate",u],{cwd:t,stdio:"inherit"})}catch{e.warn(` Migration from ${u} had issues — run \`vis migrate ${u}\` manually.`)}}if(S(n))e.success(`Migrated config written to ${n}`);else{const u=w(s.name,{allowBuilds:c,enableDepsDev:r,enableSocket:o,minimumReleaseAge:g,staged:$});j(n,u),e.success(`Created ${n}`)}e.notice(" Run 'vis doctor' to see your project's full health status.");return}i.close(),e.info("");const A=w(s.name,{allowBuilds:c,enableDepsDev:r,enableSocket:o,minimumReleaseAge:g,staged:$});if(j(n,A),e.success(`Created ${n}`),b){const f=Object.fromEntries(Object.entries(c).filter(([,a])=>a));for(const a of T(s.name,t,f))e.success(` ${a}`);for(const a of R(s.name,t,g))e.success(` ${a}`)}e.info(""),e.info(" Setup complete. Your config:");const _=[o&&"Socket.dev",r&&"deps.dev"].filter(Boolean);e.info(` Security: ${_.length>0?`${_.join(" + ")} enabled`:"defaults only"}`),e.info(` Build scripts: ${Object.values(c).filter(Boolean).length} approved`),e.info(` Min age: ${g===void 0?"not enforced":`${String(g)} minutes`}`),e.info(` Git hooks: ${$?"lint-staged configured":"not configured"}`),e.info(` PM sync: ${b?"done":"skipped"}`),e.info(""),e.notice(" Run 'vis doctor' to see your project's full health status."),e.info("")},V=(t,s,n,i)=>{const o=w(s.name,{allowBuilds:{},enableDepsDev:!1,enableSocket:!1,minimumReleaseAge:v,staged:!1});if(j(i,o),e.success(`Created ${i}`),e.info(" Secure defaults are applied automatically by defineConfig()."),n.syncNative){for(const r of T(s.name,t,{}))e.success(` ${r}`);for(const r of R(s.name,t,v))e.success(` ${r}`)}e.info(""),e.notice("Run 'vis doctor' for a full health check, or 'vis init' in a terminal for guided setup.")},k=(t,s,n)=>{const i=m(t,".."),o=m(s,"node_modules","@visulima","vis","schemas",n),r=O(i,o),l=r===""?`./${n}`:r.split(/[/\\]/u).join("/");return l.startsWith(".")?l:`./${l}`},Y=(t,s)=>{const n=k(m(t,"project.json"),s,"project.schema.json"),i=k(m(t,"vis.config.ts"),s,"vis-config.schema.json");e.info(""),e.info("Paste these into your config files to get editor IntelliSense:"),e.info(""),e.info(` project.json → "$schema": "${n}"`),e.info(` vis.config.ts → see ${i} (vis.config.ts is TypeScript; use the import path directly)`),e.info(""),e.notice("For nested project.json files, the `..` depth changes — run `vis migrate nx` to auto-rewrite all of them.")},ne=async({options:t,workspaceRoot:s})=>{const n=s??process.cwd();if(t.schema){Y(n,n);return}const i=G(n),o=F(n);if(o&&!t.force){e.warn(`Config already exists: ${o}`),e.notice("Use --force to overwrite, or edit the existing file.");return}const r=o??m(n,"vis.config.ts");!!process.stdin.isTTY&&t.interactive!==!1?await L(n,i,r):V(n,i,t,r);const c=q(n);c.added.length>0&&e.success(`Added to .gitignore: ${c.added.join(", ")}`)};export{k as buildSchemaRefForTesting,ne as default};
@@ -1,5 +1,5 @@
1
- import{I as $,E as u,V as k,s as y}from"../packem_shared/index.server-CusjRLCh.js";import{p}from"./cli-main.js";import{r as N,M,a as R,b as S,c as x,d as A,e as V,f as b,g as C,h as E}from"../packem_shared/s1ngularity-BIYhg82u.js";import{g as P,r as j}from"../packem_shared/packument-B9-WqReu.js";import{r as B}from"../packem_shared/provenance-CLxuqCfL.js";import{r as D}from"../packem_shared/signatures-C8iQ5fUq.js";const v=new Set(["archivedRepo","author","downloads","expiredDomains","metadata","newBin","provenance","s1ngularity","signatures"]),I=r=>{const s=r.trim();if(s==="")return;if(s.startsWith("@")){const o=s.indexOf("@",1);return o===-1?{name:s,spec:void 0}:{name:s.slice(0,o),spec:s.slice(o+1)||void 0}}const i=s.indexOf("@");return i===-1?{name:s,spec:void 0}:{name:s.slice(0,i),spec:s.slice(i+1)||void 0}},O=r=>{if(r===void 0||r.trim()==="")return;const s=new Set;for(const i of r.split(",")){const o=i.trim();if(!v.has(o))throw new Error(`Unknown marshall in --only: ${o}. Known: ${[...v].sort().join(", ")}.`);s.add(o)}return s},m=(r,s)=>r===void 0||r.has(s),F=r=>r?.has("signatures")??!1,K=async({argument:r,options:s,workspaceRoot:i})=>{if(!r||r.length===0)throw new Error("No package specified. Usage: vis inspect <package>[@<spec>]");const o=I(r[0]);if(o===void 0)throw new Error(`Invalid package argument: "${String(r[0])}". Usage: vis inspect <package>[@<spec>]`);const t=O(s.only),f=await P(o.name,{workspaceRoot:i});if(f===void 0){p.error(`Package ${o.name} not found in the registry.`),process.exitCode=2;return}const g=j(f,o.spec);if(g===void 0){p.error(`Could not resolve ${o.name}@${o.spec??"latest"} to a published version.`),process.exitCode=2;return}const c=[{name:o.name,version:g}],n=new M;if(m(t,"author")){const e=await N(c,{workspaceRoot:i});for(const a of e)n.add({marshall:"author",message:a.message,packageName:a.packageName,severity:a.severity})}if(m(t,"provenance")){const e=await B(c);for(const a of e)n.add({marshall:"provenance",message:`Prior version ${a.priorVersionWithProvenance} had provenance but ${a.version} does not.`,packageName:a.packageName,severity:"error"})}if(m(t,"s1ngularity")){const e=await R(c,{workspaceRoot:i});for(const a of e){const d=a.hookChanges.map(w=>`${w.hook} (${w.kind})`).join(", "),l=a.hookChanges.length===1;n.add({marshall:"s1ngularity",message:`${a.version} ${l?"has an":"has"} install-script ${l?"change":"changes"} [${d}] AND dropped the provenance attestation that ${a.priorVersion} carried — this is the s1ngularity compromised-publish shape.`,packageName:a.packageName,severity:"error"})}}if(m(t,"newBin")){const e=await S(c);for(const a of e){const d=a.newBins.map(l=>l.command).join(", ");n.add({marshall:"newBin",message:`${a.toVersion} adds new bin script${a.newBins.length===1?"":"s"}: ${d} (prior: ${a.fromVersion}).`,packageName:a.packageName,severity:"warning"})}}if(m(t,"metadata")){const e=await x(c,{workspaceRoot:i});for(const a of e)n.add({marshall:"metadata",message:`Missing/invalid metadata: ${a.issues.join(", ")}.`,packageName:a.packageName,severity:"warning"})}if(m(t,"downloads")){const e=await A([o.name]);for(const a of e){const d=a.downloadsLastMonth===void 0?"unknown":String(a.downloadsLastMonth);n.add({marshall:"downloads",message:a.kind==="no-data"?"npm stats API returned no monthly download data.":`Only ${d} downloads in the past month.`,packageName:a.packageName,severity:a.severity})}}if(m(t,"expiredDomains")){const e=await V(c,{workspaceRoot:i});for(const a of e)n.add({marshall:"expiredDomains",message:a.kind==="expired"?`Maintainer email domain ${a.domain} (${a.maintainer}) is unregistered — potential hijack risk.`:`Could not verify maintainer email domain ${a.domain} (${a.maintainer}).`,packageName:a.packageName,severity:a.severity})}if(F(t)){const e=await D(c,{workspaceRoot:i});for(const a of e)n.add({marshall:"signatures",message:a.message,packageName:a.packageName,severity:a.severity})}if(m(t,"archivedRepo")){const e=await b(c,{workspaceRoot:i});for(const a of e)n.add({marshall:"archivedRepo",message:a.kind==="archived"?`Source repo ${a.owner}/${a.repo} is archived${a.archivedAt===void 0?"":` (since ${a.archivedAt})`}.`:`Source repo ${a.owner}/${a.repo} returned 404 from GitHub.`,packageName:a.packageName,severity:"warning"})}const h=n.all();if(s.json===!0)process.stdout.write(`${JSON.stringify(C(h),void 0,2)}
2
- `);else{const e=`${o.name}@${g}`;if(h.length===0)p.info(`${$("✓")} ${e} — no findings.`);else{p.info(`${u("Inspecting")} ${e}`);for(const l of E(h))process.stdout.write(`${l}
3
- `);const a=n.errors().length,d=n.warnings().length;process.stdout.write(`
4
- ${u("Summary:")} ${k(`${String(a)} error${a===1?"":"s"}`)}, ${y(`${String(d)} warning${d===1?"":"s"}`)}.
5
- `)}}(n.hasErrors()||s.strict===!0&&!n.isEmpty())&&(process.exitCode=1)};export{K as default,I as parsePackageArg};
1
+ import{J as k,F as v,X as $,b as y}from"../packem_shared/index.server-BAjDJSEu.js";import{p}from"./cli-main.js";import{r as N,M,a as S,b as x,c as A,d as b,e as C,f as R,g as P,h as j}from"../packem_shared/s1ngularity-C8sva2SO.js";import{g as B,r as D}from"../packem_shared/packument-C55kVxcQ.js";import{r as E}from"../packem_shared/provenance-CvfQEJPQ.js";import{r as O}from"../packem_shared/signatures-oZ_2IneN.js";const w=new Set(["archivedRepo","author","downloads","expiredDomains","metadata","newBin","provenance","s1ngularity","signatures"]),V=n=>{const s=n.trim();if(s==="")return;if(s.startsWith("@")){const r=s.indexOf("@",1);return r===-1?{name:s,spec:void 0}:{name:s.slice(0,r),spec:s.slice(r+1)||void 0}}const t=s.indexOf("@");return t===-1?{name:s,spec:void 0}:{name:s.slice(0,t),spec:s.slice(t+1)||void 0}},F=n=>{if(n===void 0||n.trim()==="")return;const s=new Set;for(const t of n.split(",")){const r=t.trim();if(!w.has(r))throw new Error(`Unknown marshall in --only: ${r}. Known: ${[...w].sort().join(", ")}.`);s.add(r)}return s},l=(n,s)=>n===void 0||n.has(s),L=n=>n?.has("signatures")??!1,q=async({argument:n,options:s,workspaceRoot:t})=>{if(!n||n.length===0)throw new Error("No package specified. Usage: vis inspect <package>[@<spec>]");const r=V(n[0]);if(r===void 0)throw new Error(`Invalid package argument: "${String(n[0])}". Usage: vis inspect <package>[@<spec>]`);const i=F(s.only),h=await B(r.name,{workspaceRoot:t});if(h===void 0){p.error(`Package ${r.name} not found in the registry.`),process.exitCode=2;return}const g=D(h,r.spec);if(g===void 0){p.error(`Could not resolve ${r.name}@${r.spec??"latest"} to a published version.`),process.exitCode=2;return}const c=[{name:r.name,version:g}],o=new M;if(l(i,"author")){const a=await N(c,{workspaceRoot:t});for(const e of a)o.add({marshall:"author",message:e.message,packageName:e.packageName,severity:e.severity})}if(l(i,"provenance")){const a=await E(c);for(const e of a)o.add({marshall:"provenance",message:`Prior version ${e.priorVersionWithProvenance} had provenance but ${e.version} does not.`,packageName:e.packageName,severity:"error"})}if(l(i,"s1ngularity")){const a=await S(c,{workspaceRoot:t});for(const e of a){const d=e.hookChanges.map(f=>`${f.hook} (${f.kind})`).join(", "),m=e.hookChanges.length===1;o.add({marshall:"s1ngularity",message:`${e.version} ${m?"has an":"has"} install-script ${m?"change":"changes"} [${d}] AND dropped the provenance attestation that ${e.priorVersion} carried — this is the s1ngularity compromised-publish shape.`,packageName:e.packageName,severity:"error"})}}if(l(i,"newBin")){const a=await x(c);for(const e of a){const d=e.newBins.map(m=>m.command).join(", ");o.add({marshall:"newBin",message:`${e.toVersion} adds new bin script${e.newBins.length===1?"":"s"}: ${d} (prior: ${e.fromVersion}).`,packageName:e.packageName,severity:"warning"})}}if(l(i,"metadata")){const a=await A(c,{workspaceRoot:t});for(const e of a)o.add({marshall:"metadata",message:`Missing/invalid metadata: ${e.issues.join(", ")}.`,packageName:e.packageName,severity:"warning"})}if(l(i,"downloads")){const a=await b([r.name]);for(const e of a){const d=e.downloadsLastMonth===void 0?"unknown":String(e.downloadsLastMonth);o.add({marshall:"downloads",message:e.kind==="no-data"?"npm stats API returned no monthly download data.":`Only ${d} downloads in the past month.`,packageName:e.packageName,severity:e.severity})}}if(l(i,"expiredDomains")){const a=await C(c,{workspaceRoot:t});for(const e of a)o.add({marshall:"expiredDomains",message:e.kind==="expired"?`Maintainer email domain ${e.domain} (${e.maintainer}) is unregistered — potential hijack risk.`:`Could not verify maintainer email domain ${e.domain} (${e.maintainer}).`,packageName:e.packageName,severity:e.severity})}if(L(i)){const a=await O(c,{workspaceRoot:t});for(const e of a)o.add({marshall:"signatures",message:e.message,packageName:e.packageName,severity:e.severity})}if(l(i,"archivedRepo")){const a=await R(c,{workspaceRoot:t});for(const e of a)o.add({marshall:"archivedRepo",message:e.kind==="archived"?`Source repo ${e.owner}/${e.repo} is archived${e.archivedAt===void 0?"":` (since ${e.archivedAt})`}.`:`Source repo ${e.owner}/${e.repo} returned 404 from GitHub.`,packageName:e.packageName,severity:"warning"})}const u=o.all();if(s.json===!0)process.stdout.write(`${JSON.stringify(P(u),void 0,2)}
2
+ `);else{const a=`${r.name}@${g}`;if(u.length===0)p.info(`${k("✓")} ${a} — no findings.`);else{p.info(`${v("Inspecting")} ${a}`);for(const m of j(u))process.stdout.write(`${m}
3
+ `);const e=o.errors().length,d=o.warnings().length;process.stdout.write(`
4
+ ${v("Summary:")} ${$(`${String(e)} error${e===1?"":"s"}`)}, ${y(`${String(d)} warning${d===1?"":"s"}`)}.
5
+ `)}}(o.hasErrors()||s.strict===!0&&!o.isEmpty())&&(process.exitCode=1)};export{q as default,V as parsePackageArg};
@@ -1 +1 @@
1
- import{w,l as j,J as A,M as B}from"../packem_shared/index-BLtnel38.js";import{p as t}from"./cli-main.js";import{A as M,h,I as F,C as T}from"../packem_shared/pm-runner-DRybtzOV.js";import{a as H,r as J}from"../packem_shared/command-runtime-DQ7ZpLYL.js";import{s as N}from"../packem_shared/typosquats-BWrmhh36.js";import{h as Q,P as U}from"../packem_shared/peer-warnings-BXAzXqY3.js";import{i as V}from"../packem_shared/utils-CRueU43T.js";const W=["pnpm-lock.yaml","yarn.lock","package-lock.json","npm-shrinkwrap.json","bun.lock","bun.lockb"],G=a=>{let r=a;for(;;){for(const l of W)if(j(w(r,l)))return!0;const n=A(r);if(n===r||B(r).root===r)return!1;r=n}},g=new Set(["aube","auto","bun","npm","pnpm","yarn"]),se=async a=>{const{argument:r,fs:n,logger:l,options:e,visConfig:i,workspaceRoot:C}=a,s=C??process.cwd();if(r&&r.length>0){const o=e,{default:q}=await import("./handler15.js"),I=o.marshallCheck===!1||o["no-marshall-check"]===!0?!1:void 0,z=o.socketCheck===!1||o["no-socket-check"]===!0?!1:void 0,E=o.typosquatCheck===!1||o["no-typosquat-check"]===!0?!1:void 0,P=o.runScripts===!0||o["run-scripts"]===!0,D=o.workspaceRoot===!0||o["workspace-root"]===!0,$=o.saveOptional===!0||o["save-optional"]===!0,L=e.dev===!0,_={autoInstallPeers:!1,exact:o.exact===!0,filter:e.filter,global:!1,marshallCheck:I,runScripts:P,saveDev:L,saveOptional:$,savePeer:!1,socketCheck:z,to:void 0,typosquatCheck:E,workspace:!1,workspaceRoot:D};await q({...a,argument:r,options:_});return}if(e.typosquatCheck!==!1&&!await N(s,i?.security?.typosquatAllowlist)){process.exitCode=1;return}const c=e.installer;if(c&&!g.has(c)){t.error(`Invalid --installer value: "${c}". Expected one of: ${[...g].join(", ")}.`),process.exitCode=1;return}const y=c,b=e.aube===!1,f=H(J({logger:l,options:e,visConfig:i},s));let p;try{p=b?f===void 0?M(s):h(s,{backend:f}):h(s,{backend:y??f,configBackend:i?.install?.backend,configCorepack:i?.install?.corepack})}catch(o){t.error(o instanceof Error?o.message:String(o)),process.exitCode=1;return}const d=F(s,p);d&&t.warn(d);const x=V(e.filter),u=e.ci||!1,m=e.frozenLockfile||u,O=e.frozenLockfile===!1||e.force||e.lockfileOnly,R=G(s),v=m||!O&&R;if(!m&&v&&!e.silent&&t.info("Defaulting to frozen lockfile (pass --no-frozen-lockfile to allow lockfile updates)."),u){t.info("Clean install: removing node_modules...");try{await n.rm(w(s,"node_modules"),{force:!0,recursive:!0})}catch(o){t.error(`Failed to remove node_modules: ${o instanceof Error?o.message:String(o)}`),process.exitCode=1;return}}const{code:k,output:S}=await T(p,{dev:e.dev||!1,filter:x,force:e.force||!1,frozenLockfile:v,ignoreScripts:!e.runScripts,lockfileOnly:e.lockfileOnly||!1,noOptional:e.optional===!1,offline:e.offline||!1,prod:e.prod||!1,recursive:e.recursive||!1,silent:e.silent||!1,workspaceRoot:e.workspaceRoot||!1},s,l,{ciMode:u,preferOffline:e.preferOffline||!1});k!==0&&(process.exitCode=k),k===0&&!e.silent&&Q(S)&&t.info(U)};export{se as default};
1
+ import{e as w,m as F,c as _}from"../packem_shared/index-DHD8wb6Z.js";import{p as r}from"./cli-main.js";import{d as j,a as v,g as N,h as W}from"../packem_shared/pm-runner-de-jCq8q.js";import{a as $,r as K}from"../packem_shared/command-runtime-CiLVo4ED.js";import{s as M}from"../packem_shared/typosquats-Cdsnf6aN.js";import{h as T,P as H}from"../packem_shared/peer-warnings-CmYSxvql.js";import{t as G}from"../packem_shared/utils-DQFHJn72.js";import{y as J}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";const Q=["pnpm-lock.yaml","yarn.lock","package-lock.json","npm-shrinkwrap.json","bun.lock","bun.lockb"],U=n=>{let t=n;for(;;){for(const c of Q)if(J(w(t,c)))return!0;const a=F(t);if(a===t||_(t).root===t)return!1;t=a}},g=new Set(["aube","auto","bun","npm","pnpm","yarn"]),re=async n=>{const{argument:t,fs:a,logger:c,options:e,visConfig:l,workspaceRoot:C}=n,s=C??process.cwd();if(t&&t.length>0){const o=e,{default:L}=await import("./handler15.js"),R=o.marshallCheck===!1||o["no-marshall-check"]===!0?!1:void 0,z=o.socketCheck===!1||o["no-socket-check"]===!0?!1:void 0,D=o.typosquatCheck===!1||o["no-typosquat-check"]===!0?!1:void 0,I=o.runScripts===!0||o["run-scripts"]===!0,P=o.workspaceRoot===!0||o["workspace-root"]===!0,q=o.saveOptional===!0||o["save-optional"]===!0,A=e.dev===!0,B={autoInstallPeers:!1,exact:o.exact===!0,filter:e.filter,global:!1,marshallCheck:R,runScripts:I,saveDev:A,saveOptional:q,savePeer:!1,socketCheck:z,to:void 0,typosquatCheck:D,workspace:!1,workspaceRoot:P};await L({...n,argument:t,options:B});return}if(e.typosquatCheck!==!1&&!await M(s,l?.security?.typosquatAllowlist)){process.exitCode=1;return}const i=e.installer;if(i&&!g.has(i)){r.error(`Invalid --installer value: "${i}". Expected one of: ${[...g].join(", ")}.`),process.exitCode=1;return}const y=i,O=e.aube===!1,f=$(K({logger:c,options:e,visConfig:l},s));let p;try{p=O?f===void 0?j(s):v(s,{backend:f}):v(s,{backend:y??f,configBackend:l?.install?.backend,configCorepack:l?.install?.corepack})}catch(o){r.error(o instanceof Error?o.message:String(o)),process.exitCode=1;return}const k=N(s,p);k&&r.warn(k);const x=G(e.filter),u=e.ci||!1,m=e.frozenLockfile||u,b=e.frozenLockfile===!1||e.force||e.lockfileOnly,E=U(s),h=m||!b&&E;if(!m&&h&&!e.silent&&r.info("Defaulting to frozen lockfile (pass --no-frozen-lockfile to allow lockfile updates)."),u){r.info("Clean install: removing node_modules...");try{await a.rm(w(s,"node_modules"),{force:!0,recursive:!0})}catch(o){r.error(`Failed to remove node_modules: ${o instanceof Error?o.message:String(o)}`),process.exitCode=1;return}}const{code:d,output:S}=await W(p,{dev:e.dev||!1,filter:x,force:e.force||!1,frozenLockfile:h,ignoreScripts:!e.runScripts,lockfileOnly:e.lockfileOnly||!1,noOptional:e.optional===!1,offline:e.offline||!1,prod:e.prod||!1,recursive:e.recursive||!1,silent:e.silent||!1,workspaceRoot:e.workspaceRoot||!1},s,c,{ciMode:u,preferOffline:e.preferOffline||!1});d!==0&&(process.exitCode=d),d===0&&!e.silent&&T(S)&&r.info(H)};export{re as default};