@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.
- package/CHANGELOG.md +19 -0
- package/LICENSE.md +5760 -4562
- package/dashboard/dist/index.html +12 -12
- package/dist/bin.js +1 -1
- package/dist/binx.js +2 -2
- package/dist/config/index.js +1 -1
- package/dist/packem_chunks/CONFIG_FILES.js +6 -6
- package/dist/packem_chunks/DEFAULT_CLEAN_KEEP.js +1 -1
- package/dist/packem_chunks/agent-instructions.js +7 -7
- package/dist/packem_chunks/bloom-status.js +2 -2
- package/dist/packem_chunks/bloom-sync.js +2 -2
- package/dist/packem_chunks/cache-attestation.js +1 -1
- package/dist/packem_chunks/catalog-detector.js +1 -1
- package/dist/packem_chunks/catalog.js +87 -111
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +192 -217
- package/dist/packem_chunks/defineReleasePlugin.js +3 -3
- package/dist/packem_chunks/detect.js +8 -3
- package/dist/packem_chunks/devtools.js +1 -1
- package/dist/packem_chunks/discord.js +4 -4
- package/dist/packem_chunks/dispatch.js +4 -4
- package/dist/packem_chunks/doctor-probe.js +2 -2
- package/dist/packem_chunks/extra-files.js +3 -3
- package/dist/packem_chunks/fix.js +11 -11
- package/dist/packem_chunks/git.js +3 -3
- package/dist/packem_chunks/group-tags.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +5 -5
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +16 -16
- package/dist/packem_chunks/handler13.js +5 -5
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +5 -5
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +2 -2
- package/dist/packem_chunks/handler21.js +2 -2
- package/dist/packem_chunks/handler22.js +8 -8
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +5 -5
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +3 -3
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +2 -2
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler31.js +2 -2
- package/dist/packem_chunks/handler32.js +2 -2
- package/dist/packem_chunks/handler33.js +2 -2
- package/dist/packem_chunks/handler34.js +3 -3
- package/dist/packem_chunks/handler35.js +5 -5
- package/dist/packem_chunks/handler36.js +1 -1
- package/dist/packem_chunks/handler37.js +2 -2
- package/dist/packem_chunks/handler38.js +6 -6
- package/dist/packem_chunks/handler39.js +8 -8
- package/dist/packem_chunks/handler4.js +4 -4
- package/dist/packem_chunks/handler40.js +34 -34
- package/dist/packem_chunks/handler41.js +5 -5
- package/dist/packem_chunks/handler42.js +4 -4
- package/dist/packem_chunks/handler43.js +3 -3
- package/dist/packem_chunks/handler44.js +2 -2
- package/dist/packem_chunks/handler45.js +1 -1
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler47.js +1 -1
- package/dist/packem_chunks/handler48.js +3 -3
- package/dist/packem_chunks/handler49.js +1 -1
- package/dist/packem_chunks/handler5.js +6 -6
- package/dist/packem_chunks/handler50.js +6 -6
- package/dist/packem_chunks/handler51.js +13 -13
- package/dist/packem_chunks/handler52.js +3 -3
- package/dist/packem_chunks/handler53.js +5 -5
- package/dist/packem_chunks/handler54.js +2 -2
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler56.js +4 -4
- package/dist/packem_chunks/handler57.js +5 -5
- package/dist/packem_chunks/handler58.js +5 -5
- package/dist/packem_chunks/handler59.js +8 -8
- package/dist/packem_chunks/handler6.js +7 -7
- package/dist/packem_chunks/handler60.js +3 -3
- package/dist/packem_chunks/handler61.js +21 -21
- package/dist/packem_chunks/handler62.js +12 -12
- package/dist/packem_chunks/handler63.js +3 -3
- package/dist/packem_chunks/handler64.js +5 -5
- package/dist/packem_chunks/handler65.js +8 -8
- package/dist/packem_chunks/handler66.js +2 -2
- package/dist/packem_chunks/handler67.js +25 -24
- package/dist/packem_chunks/handler68.js +153 -25
- package/dist/packem_chunks/handler69.js +10 -153
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +22 -10
- package/dist/packem_chunks/handler71.js +17 -17
- package/dist/packem_chunks/handler72.js +104 -104
- package/dist/packem_chunks/handler73.js +20 -20
- package/dist/packem_chunks/handler74.js +45 -45
- package/dist/packem_chunks/handler75.js +27 -3
- package/dist/packem_chunks/handler76.js +3 -27
- package/dist/packem_chunks/handler77.js +68 -68
- package/dist/packem_chunks/handler78.js +30 -30
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +9 -9
- package/dist/packem_chunks/heal.js +11 -11
- package/dist/packem_chunks/help-command.js +7 -63
- package/dist/packem_chunks/index.js +1 -1
- package/dist/packem_chunks/index2.js +48 -804
- package/dist/packem_chunks/index3.js +3 -7
- package/dist/packem_chunks/index4.js +801 -134
- package/dist/packem_chunks/index5.js +7 -73
- package/dist/packem_chunks/index6.js +73 -0
- package/dist/packem_chunks/index7.js +135 -0
- package/dist/packem_chunks/interface.js +2 -2
- package/dist/packem_chunks/keys-refresh.js +4 -4
- package/dist/packem_chunks/lean.js +3 -3
- package/dist/packem_chunks/list.js +3 -3
- package/dist/packem_chunks/loader.js +4 -4
- package/dist/packem_chunks/loader2.js +1 -1
- package/dist/packem_chunks/orchestrator.js +27 -27
- package/dist/packem_chunks/pre-mode.js +2 -2
- package/dist/packem_chunks/print-config.js +1 -1
- package/dist/packem_chunks/prompts.js +7 -7
- package/dist/packem_chunks/prune.js +3 -3
- package/dist/packem_chunks/publish-guards.js +1 -1
- package/dist/packem_chunks/resolveFormatter.js +5 -5
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/security.js +1 -1
- package/dist/packem_chunks/shell-runner.js +1 -1
- package/dist/packem_chunks/slack.js +2 -2
- package/dist/packem_chunks/snapshot.js +2 -2
- package/dist/packem_chunks/stage-publisher.js +1 -1
- package/dist/packem_chunks/staged-registry.js +2 -2
- package/dist/packem_chunks/state.js +3 -3
- package/dist/packem_chunks/status.js +2 -2
- package/dist/packem_chunks/success-walk.js +4 -4
- package/dist/packem_chunks/sync.js +2 -2
- package/dist/packem_chunks/sync2.js +2 -2
- package/dist/packem_chunks/tar.js +3 -3
- package/dist/packem_chunks/tripwire.js +2 -2
- package/dist/packem_chunks/ts-loader.js +5 -9
- package/dist/packem_chunks/verify-lockfile.js +2 -2
- package/dist/packem_chunks/version-resolver.js +2 -2
- package/dist/packem_chunks/webhook.js +1 -1
- package/dist/packem_chunks/workflow-templates.js +5 -5
- package/dist/packem_chunks/workspace.js +2 -2
- package/dist/packem_shared/ReleaseClient-DAvbxCdo.js +1 -0
- package/dist/packem_shared/Table-DyORjLji-CC9cYgCG.js +11 -0
- package/dist/packem_shared/{VisReleaseError-DMGRBTNO.js → VisReleaseError-DZtgcKf8.js} +1 -1
- package/dist/packem_shared/_commonjsHelpers-DTfxOvZk.js +1 -0
- package/dist/packem_shared/advisories-DZd1uGqa.js +1 -0
- package/dist/packem_shared/affected-selection-CoRXp5H4.js +1 -0
- package/dist/packem_shared/affected-shas-Dd0P7fGD.js +1 -0
- package/dist/packem_shared/ai-analysis-DSQQDFU9.js +68 -0
- package/dist/packem_shared/ai-fix-6nXZbecQ.js +43 -0
- package/dist/packem_shared/augment-COAiXSIx.js +4 -0
- package/dist/packem_shared/bin-C2eYtJ_N.js +1 -0
- package/dist/packem_shared/build-scripts-pdVmqXRm.js +1 -0
- package/dist/packem_shared/clean-DRiLimTx.js +1 -0
- package/dist/packem_shared/command-runtime-CiLVo4ED.js +1 -0
- package/dist/packem_shared/{compile-cache-B_Vf_WxT.js → compile-cache-DoMHRsRZ.js} +1 -1
- package/dist/packem_shared/createAdapter-F7GidOzU.js +1 -0
- package/dist/packem_shared/createVersionActions-ByaJ1Nbv.js +1 -0
- package/dist/packem_shared/cyclonedx-B1vzerwP.js +4 -0
- package/dist/packem_shared/dependency-scan-DBH2Qo4I.js +1 -0
- package/dist/packem_shared/docker-Bex05Qcn.js +59 -0
- package/dist/packem_shared/failure-log-D92tM0ie.js +2 -0
- package/dist/packem_shared/formatBytes-BHAzNIrn-DFIppnY0.js +4 -0
- package/dist/packem_shared/getRandomSpinner-4ZEcbTYv-DCyIuj19.js +1 -0
- package/dist/packem_shared/giget-D8Kwb0kD.js +2 -0
- package/dist/packem_shared/glob-Cyk1H9ZL-ox19CSsT.js +1 -0
- package/dist/packem_shared/index-B4AjSxHU.js +1 -0
- package/dist/packem_shared/index-BisalDCf.js +39 -0
- package/dist/packem_shared/{index-BWl4DbMp.js → index-BjdW45xX.js} +1 -1
- package/dist/packem_shared/index-DHD8wb6Z.js +22 -0
- package/dist/packem_shared/index-DXPSWMbG.js +1 -0
- package/dist/packem_shared/index.server-BAjDJSEu.js +2 -0
- package/dist/packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js +1 -0
- package/dist/packem_shared/license-DvlYdo6T.js +1 -0
- package/dist/packem_shared/lifecycle-CfTZQHOG.js +2 -0
- package/dist/packem_shared/lockfile-35RFsJDs.js +1 -0
- package/dist/packem_shared/lockfile-DhHAaHN5.js +1 -0
- package/dist/packem_shared/main-BP-w-K-6.js +1 -0
- package/dist/packem_shared/manifests-BNSmpPF_.js +1 -0
- package/dist/packem_shared/min-release-age-ChzTC7_I.js +34 -0
- package/dist/packem_shared/missing-package-json-C0keIt78.js +1 -0
- package/dist/packem_shared/native-config-sync-BSzU4qUO.js +21 -0
- package/dist/packem_shared/osv-bloom-1JS__1or.js +2 -0
- package/dist/packem_shared/otelPlugin-D8LL2-4L.js +1 -0
- package/dist/packem_shared/package-version-Bb7KGF36.js +4 -0
- package/dist/packem_shared/packument-C55kVxcQ.js +1 -0
- package/dist/packem_shared/{peer-warnings-BXAzXqY3.js → peer-warnings-CmYSxvql.js} +1 -1
- package/dist/packem_shared/pm-runner-de-jCq8q.js +1 -0
- package/dist/packem_shared/project-name-filter-DYaIbrXa.js +7 -0
- package/dist/packem_shared/{prompt-BSAy8SMH.js → prompt-DMzaQEVa.js} +1 -1
- package/dist/packem_shared/provenance-CvfQEJPQ.js +1 -0
- package/dist/packem_shared/readJsonSync-CbryXYxN-B2aSeDpC.js +1 -0
- package/dist/packem_shared/registry-keys-DmBrAlhg.js +1 -0
- package/dist/packem_shared/resolve-explicit-DYaHAVDg.js +5 -0
- package/dist/packem_shared/resolve-runtime-C7NBCA1C.js +1 -0
- package/dist/packem_shared/run-file-jMngGQhs.js +1 -0
- package/dist/packem_shared/runtime-check-BklgEMkC.js +1 -0
- package/dist/packem_shared/s1ngularity-C8sva2SO.js +1 -0
- package/dist/packem_shared/scan-progress-aVHGZYWf.js +2 -0
- package/dist/packem_shared/selectors-B7lSFz7l.js +3 -0
- package/dist/packem_shared/signatures-oZ_2IneN.js +2 -0
- package/dist/packem_shared/{slug-DoueYuLo.js → slug-OBHcH7wV.js} +1 -1
- package/dist/packem_shared/spinner-CbJfWYwB.js +1 -0
- package/dist/packem_shared/sticky-comment-DjhyCIZt.js +1 -0
- package/dist/packem_shared/subtree-DtmcKAJK.js +2 -0
- package/dist/packem_shared/symbols-BXDZ_sKt.js +1 -0
- package/dist/packem_shared/tabs-BilwonkM.js +1 -0
- package/dist/packem_shared/target-merge-DCGow6Kw.js +4 -0
- package/dist/packem_shared/target-options-d_rIrLyq.js +1 -0
- package/dist/packem_shared/toolchain-DY11tPCw.js +5 -0
- package/dist/packem_shared/typosquats-Cdsnf6aN.js +1 -0
- package/dist/packem_shared/use-measured-height-BPQg2q_p.js +1 -0
- package/dist/packem_shared/utils-DQFHJn72.js +1 -0
- package/dist/packem_shared/verify-D8wYvB85.js +1 -0
- package/dist/packem_shared/vis-update-app-ngwL2mRv.js +1 -0
- package/dist/packem_shared/vis-user-error-CAu9wIbe.js +30 -0
- package/dist/packem_shared/watch-Dswvj6Zp.js +1 -0
- package/dist/packem_shared/watch-loop-COWvvSbR.js +11 -0
- package/dist/packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js +1 -0
- package/dist/release/core/changelog/index.d.ts +62 -2
- package/dist/release/core/package-managers/index.d.ts +25 -1
- package/dist/release/core/package-managers/index.js +1 -1
- package/dist/release/core/version-actions/index.d.ts +47 -2
- package/dist/release/core/version-actions/index.js +1 -1
- package/dist/release/index.d.ts +100 -1
- package/dist/release/index.js +1 -1
- package/dist/release/plugin-sdk.d.ts +16 -1
- package/dist/release/plugin-sdk.js +1 -1
- package/dist/release/presets.js +1 -1
- package/dist/release/types.js +1 -1
- package/dist/runtime/preload.js +1 -1
- package/index.js +26 -26
- package/package.json +14 -14
- package/dist/packem_chunks/detect2.js +0 -8
- package/dist/packem_chunks/registry.js +0 -48
- package/dist/packem_shared/ReleaseClient-BY4OZNCK.js +0 -1
- package/dist/packem_shared/_commonjsHelpers-B5Y90VFO.js +0 -1
- package/dist/packem_shared/advisories-DsXRmIA5.js +0 -1
- package/dist/packem_shared/affected-selection-BE6VFCDV.js +0 -1
- package/dist/packem_shared/affected-shas-BKEu4RZc.js +0 -1
- package/dist/packem_shared/ai-analysis-DikAj6rX.js +0 -68
- package/dist/packem_shared/ai-fix-bfWo0cZX.js +0 -43
- package/dist/packem_shared/augment-BkJxi_GW.js +0 -4
- package/dist/packem_shared/bin-B-TytgzW.js +0 -1
- package/dist/packem_shared/build-scripts-DWypBQ--.js +0 -1
- package/dist/packem_shared/clean-DWjQl14S.js +0 -1
- package/dist/packem_shared/command-runtime-DQ7ZpLYL.js +0 -1
- package/dist/packem_shared/createAdapter-bU4DIP3F.js +0 -1
- package/dist/packem_shared/createVersionActions-BK43SNDH.js +0 -1
- package/dist/packem_shared/cyclonedx-DLBi65MV.js +0 -4
- package/dist/packem_shared/dependency-scan-ZLOuLkGN.js +0 -1
- package/dist/packem_shared/docker-B4zAZCZG.js +0 -59
- package/dist/packem_shared/en-BDYMmM2_.js +0 -27
- package/dist/packem_shared/failure-log-DyhWPqno.js +0 -2
- package/dist/packem_shared/giget-CAxjpwew.js +0 -2
- package/dist/packem_shared/glob-BUjyjdE8-Dp_QcayW.js +0 -1
- package/dist/packem_shared/index-BAe6e0XE.js +0 -1
- package/dist/packem_shared/index-BLtnel38.js +0 -35
- package/dist/packem_shared/index-CuKDxOCI.js +0 -1
- package/dist/packem_shared/index-tNFGWxc0.js +0 -39
- package/dist/packem_shared/index.server-CusjRLCh.js +0 -2
- package/dist/packem_shared/license-t5KnNX6v.js +0 -1
- package/dist/packem_shared/lifecycle-KY9umOg6.js +0 -2
- package/dist/packem_shared/lockfile-YAuZf1gh.js +0 -1
- package/dist/packem_shared/main-D_cam4hv.js +0 -1
- package/dist/packem_shared/manifests-BwTn_1ad.js +0 -1
- package/dist/packem_shared/min-release-age-6avfn81h.js +0 -34
- package/dist/packem_shared/missing-package-json-Cl0vdz6K.js +0 -1
- package/dist/packem_shared/native-config-sync-CHMCJx7H.js +0 -21
- package/dist/packem_shared/osv-bloom-DdqDnLCt.js +0 -2
- package/dist/packem_shared/otelPlugin-DmKDBaPo.js +0 -1
- package/dist/packem_shared/package-version-BNRJ3o9C.js +0 -4
- package/dist/packem_shared/packument-B9-WqReu.js +0 -1
- package/dist/packem_shared/pm-runner-DRybtzOV.js +0 -1
- package/dist/packem_shared/project-name-filter-Dw0fC6IO.js +0 -7
- package/dist/packem_shared/provenance-CLxuqCfL.js +0 -1
- package/dist/packem_shared/readJsonSync-DweZd5ZA-CtrDlqpb.js +0 -1
- package/dist/packem_shared/registry-keys-cTN24144.js +0 -1
- package/dist/packem_shared/resolve-explicit-Uw6WQl9R.js +0 -5
- package/dist/packem_shared/resolve-runtime-DztanwkZ.js +0 -1
- package/dist/packem_shared/run-file-CaE5_xBY.js +0 -1
- package/dist/packem_shared/runtime-check-C32yE57I.js +0 -1
- package/dist/packem_shared/s1ngularity-BIYhg82u.js +0 -1
- package/dist/packem_shared/scan-progress-DWfY4zkp.js +0 -2
- package/dist/packem_shared/selectors-D2j4M9Ul.js +0 -3
- package/dist/packem_shared/signatures-C8iQ5fUq.js +0 -2
- package/dist/packem_shared/sticky-comment-D6_7-w8T.js +0 -1
- package/dist/packem_shared/subtree-DSm0QEoE.js +0 -2
- package/dist/packem_shared/symbols-DPTlrJ3B.js +0 -1
- package/dist/packem_shared/target-merge-DLxJTcxn.js +0 -11
- package/dist/packem_shared/target-options-3t4-2F-F.js +0 -1
- package/dist/packem_shared/toolchain-BPzbahcQ.js +0 -5
- package/dist/packem_shared/typosquats-BWrmhh36.js +0 -1
- package/dist/packem_shared/use-measured-height-BwAwGHjw.js +0 -1
- package/dist/packem_shared/utils-CRueU43T.js +0 -1
- package/dist/packem_shared/verify-CzUPT6Uk.js +0 -1
- package/dist/packem_shared/vis-update-app-D6Wq8ZHM.js +0 -1
- package/dist/packem_shared/vis-user-error-CfM4_ORo.js +0 -30
- package/dist/packem_shared/watch-D_oAxW_Z.js +0 -1
- package/dist/packem_shared/watch-loop-BrjblOz5.js +0 -11
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
const u=e=>e==null?[]:Array.isArray(e)?e:[e],y=e=>e.length===0?!1:e.every(
|
|
2
|
-
`)},
|
|
1
|
+
const u=e=>e==null?[]:Array.isArray(e)?e:[e],y=e=>e.length===0?!1:e.every(r=>/-/.test(r.version)),g=async(e,r,c)=>{const i=c??{warn:t=>process.stderr.write(`${t}
|
|
2
|
+
`)},o={failed:[],succeeded:[]};if(!e||r.published.length===0||(e.skipPrerelease??!0)&&y(r.published))return o;const s=[],{redactTokens:p}=await import("./security.js"),{SlackNotificationChannel:n}=await import("./slack.js");for(const t of u(e.slack))s.push(new n(t));const{DiscordNotificationChannel:l}=await import("./discord.js");for(const t of u(e.discord))s.push(new l(t));const{WebhookNotificationChannel:w}=await import("./webhook.js");for(const t of u(e.webhook))s.push(new w(t));for(const t of e.plugins??[])try{const a=await m(t);s.push(a)}catch(a){const d=typeof t=="string"?t:t[0],f=a.message,h=p(f);o.failed.push({error:`plugin load failed: ${h}`,id:d}),i.warn(`[notifications:${d}] could not load plugin: ${h}`)}return s.length===0||await Promise.all(s.map(async t=>{try{await t.send(r),o.succeeded.push(t.id)}catch(a){const d=a instanceof Error?a.message:String(a),f=p(d);o.failed.push({error:f,id:t.id}),i.warn(`[notifications:${t.id}] ${f}`)}})),o},m=async e=>{const[r,c]=Array.isArray(e)?e:[e,void 0],{pathToFileURL:i}=await import("node:url"),o=r.startsWith(".")?i(`${process.cwd()}/${r}`).href:r,{dynamicEsmImport:s}=await import("./dynamic-import.js"),p=await s(o),n=p.default??p;if(typeof n=="function"){const l=n(c);if(l&&typeof l=="object"&&typeof l.send=="function")return l}if(n&&typeof n=="object"&&typeof n.send=="function")return n;throw new TypeError(`Notification plugin at ${r} did not export a NotificationChannel (object with .send) or a factory returning one.`)},A=(e,r)=>{if(typeof e!="string")return String(e??"");const c=r.published[0];return e.replaceAll("{count}",String(r.published.length)).replaceAll("{packages}",r.published.map(i=>`${i.name}@${i.version}`).join(", ")).replaceAll("{firstName}",c?.name??"").replaceAll("{firstVersion}",c?.version??"").replaceAll("{channel}",r.channel??"").replaceAll("{repo}",r.repo??"").replaceAll("{date}",r.completedAt.slice(0,10))};export{g as dispatchNotifications,A as expandNotificationTemplate};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as
|
|
2
|
-
`);return}
|
|
3
|
-
`),process.exitCode=1;return}
|
|
4
|
-
`);return}if(e.fromCache&&e.stale===!0){
|
|
1
|
+
import{p as s}from"./cli-main.js";import{c as a,f as c}from"../packem_shared/registry-keys-DmBrAlhg.js";const f=async({options:r})=>{if(r.clear){const t=a();if(r.json){process.stdout.write(`${JSON.stringify({cleared:t,refetched:!1},void 0,2)}
|
|
2
|
+
`);return}s.success(t?"Cleared cached npm signing keys.":"No cached npm signing keys to clear.");return}const e=await c({forceRefresh:!0});if(e===void 0){if(r.json){process.stdout.write(`${JSON.stringify({cleared:!1,error:"fetch-failed",refetched:!1},void 0,2)}
|
|
3
|
+
`),process.exitCode=1;return}s.error("Failed to fetch npm signing keys (network error and no cached keys available)."),process.exitCode=1;return}if(r.json){process.stdout.write(`${JSON.stringify({cleared:!1,fromCache:e.fromCache,keyCount:e.keys.length,refetched:!e.fromCache,stale:e.stale??!1},void 0,2)}
|
|
4
|
+
`);return}if(e.fromCache&&e.stale===!0){s.warn(`Network fetch failed — falling back to expired cache (${String(e.keys.length)} keys).`);return}s.success(`Refreshed npm signing keys (${String(e.keys.length)} keys).`)};export{f as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{v as
|
|
2
|
-
`),process.exitCode=1;return}const e=process.cwd(),
|
|
1
|
+
import{v as l,U as a}from"../packem_shared/index-DHD8wb6Z.js";import{r as m}from"../packem_shared/resolve-runtime-C7NBCA1C.js";import{r as u}from"../packem_shared/run-file-jMngGQhs.js";const p=s=>{let r,n=!1,o;const i=[];for(let e=0;e<s.length;e+=1){const t=s[e];if(o===void 0){if(t==="--node"){n=!0;continue}if(t==="--runtime"){r=s[e+1],e+=1;continue}if(t.startsWith("--runtime=")){r=t.slice(10);continue}o=t;continue}i.push(t)}return i[0]==="--"&&i.shift(),{file:o,node:n,runtimeFlag:r,scriptArguments:i}},h=async s=>{const{file:r,node:n,runtimeFlag:o,scriptArguments:i}=p(s);if(r===void 0){process.stderr.write(`No file specified. Usage: vis x <file> [args...]
|
|
2
|
+
`),process.exitCode=1;return}const e=process.cwd(),t=l(r)?r:a(e,r);if(n){const d=await u(t,i,"node",e,{node:!0});d!==0&&(process.exitCode=d);return}let c;try{c=m(e,{flag:o})}catch(d){process.stderr.write(`${d.message}
|
|
3
3
|
`),process.exitCode=1;return}c.deferredNotice!==void 0&&process.stderr.write(`${c.deferredNotice}
|
|
4
|
-
`);const
|
|
4
|
+
`);const f=await u(t,i,c.runtime,e);f!==0&&(process.exitCode=f)};export{p as parseLeanXArgs,h as runLeanX};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`);return}if(
|
|
3
|
-
`),n.installed.length===0&&n.unapproved.length===0&&
|
|
1
|
+
import{createRequire as _}from"node:module";import{w as x,p as t,x as R}from"./cli-main.js";import{d as P}from"../packem_shared/pm-runner-de-jCq8q.js";import{a as M}from"../packem_shared/build-scripts-pdVmqXRm.js";import{e as v}from"../packem_shared/index-DHD8wb6Z.js";import{y as w}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{p as q}from"../packem_shared/readJsonSync-CbryXYxN-B2aSeDpC.js";let j;const B=c=>(j??=_(import.meta.url))(c),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,D=c=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[i,f]=y.versions.node.split(".").map(Number);if(i>22||i===22&&f>=3||i===20&&f>=16)return y.getBuiltinModule(c)}return B(c)},{readdirSync:S,statSync:N}=D("node:fs"),T=(c,i={})=>{const f=v(c,"node_modules");if(!w(f))return[];const l=new Map,p=new Set,b=(n,o,r)=>{const e=`${o}@${r}`;if(p.has(e))return;p.add(e);const s=r.startsWith(c)?r.slice(c.length+1):r;let u=l.get(n);u||(u=[],l.set(n,u)),u.some($=>$.name===o)||u.push({name:o,relativePath:s})},m=(n,o="")=>{let r;try{r=S(n)}catch{return}for(const e of r){const s=v(n,e);if(e.startsWith("@")){m(s,`${e}/`);continue}if(e===".pnpm"&&o===""){let a;try{a=S(s)}catch{continue}for(const d of a){const g=v(s,d,"node_modules");w(g)&&m(g)}continue}if(e.startsWith("."))continue;const u=o+e,$=v(s,"package.json");try{if(!N(s).isDirectory()||!w($))continue;const a=q($),d=typeof a.name=="string"?a.name:u;if(typeof a.bin=="string"){const k=d.includes("/")?d.split("/").pop():d;b(k,d,s)}else if(a.bin&&typeof a.bin=="object")for(const k of Object.keys(a.bin))b(k,d,s);const g=v(s,"node_modules");w(g)&&m(g)}catch{}}};m(f);const h=[];for(const[n,o]of l)o.length<2||i[n]===!0||o.every(e=>i[`${e.name}#${n}`]===!0)||h.push({bin:n,packages:o});return h.sort((n,o)=>n.bin.localeCompare(o.bin))},V=new Set(["bun","npm","pnpm","yarn"]),F=({options:c,visConfig:i,workspaceRoot:f})=>{const l=f??process.cwd(),p=P(l),b=i?.security?.policies?.installScripts?.allow??{},m=i?.security?.allowBins??{},h=i?.security?.pinVersions===!0,n=M(l,b,{pinVersions:h}),o=T(l,m),r=i&&V.has(p.name)?x(i,p.name,l):void 0;if(c.json){process.stdout.write(`${JSON.stringify({binConflicts:o,drift:r,excess:n.excess,installed:n.installed.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),packageManager:p.name,pinVersions:h,unapproved:n.unapproved.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),versionDrift:n.versionDrift},void 0,2)}
|
|
2
|
+
`);return}if(t.info(`Build-script status (${p.name}):
|
|
3
|
+
`),n.installed.length===0&&n.unapproved.length===0&&t.success(" No installed packages declare lifecycle scripts."),n.installed.length>0){t.success(` Approved (${String(n.installed.length)}):`);for(const e of n.installed)t.info(` ✓ ${e.name} — ${e.hooks.join(", ")}`)}if(n.unapproved.length>0){t.info(""),t.warn(` Unapproved (${String(n.unapproved.length)}):`);for(const e of n.unapproved)t.info(` ✗ ${e.name} — ${e.hooks.join(", ")}`);t.notice(" Run 'vis approve-builds' to review.")}if(n.excess.length>0){t.info(""),t.warn(` Stale allowlist entries (${String(n.excess.length)}):`);for(const e of n.excess)t.info(` ! ${e}`);t.notice(" Remove these from vis.config.ts security.policies.installScripts.allow.")}if(n.versionDrift.length>0){t.info(""),t.warn(` Version drift (pinVersions: true) — ${String(n.versionDrift.length)} entr${n.versionDrift.length===1?"y":"ies"} point at outdated versions:`);for(const{from:e,to:s}of n.versionDrift)t.info(` ${e} → ${s}`);t.notice(" Update vis.config.ts security.policies.installScripts.allow keys to migrate.")}if(o.length>0){t.info(""),t.warn(` Bin conflicts (${String(o.length)}) — multiple packages expose the same bin name:`);for(const e of o)t.info(` ${e.bin} ← ${e.packages.map(s=>s.name).join(", ")}`);t.notice(" Add the bin (or 'pkg#bin') to vis.config.ts security.allowBins to silence this.")}if(r?.hasDrift){t.info("");for(const e of R(r))t.warn(e)}};export{F as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
${
|
|
3
|
-
${
|
|
4
|
-
${
|
|
1
|
+
import{createRequire as f}from"node:module";import{d as p,c as I}from"../packem_shared/pm-runner-de-jCq8q.js";let _;const w=e=>(_??=f(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,g=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,r]=o.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return o.getBuiltinModule(e)}return w(e)},{createInterface:y}=g("node:readline"),s="sigstore",v=()=>!!process.stdout.isTTY&&process.env.CI!=="true",$=e=>new Promise(t=>{const r=y({input:process.stdin,output:process.stderr});r.question(`${e} (Y/n) `,a=>{r.close();const n=a.trim().toLowerCase();t(n===""||n==="y"||n==="yes")})}),h=e=>{const t=p(e),r=I(t,{exact:!1,filter:[],global:!1,optional:!1,packages:[s],peer:!1,saveDev:!0,workspace:!1,workspaceRoot:!1},e,console);return Promise.resolve({exitCode:r})},C=()=>{try{return import.meta.resolve(s),!0}catch{return!1}},R=e=>{let t="pnpm";try{t=p(e).name}catch{}switch(t){case"bun":return`bun add -d ${s}`;case"npm":return`npm install -D ${s}`;case"yarn":return`yarn add -D ${s}`;default:return`pnpm add -D ${s}`}},D=()=>import("sigstore"),E=async(e={})=>{const t=e.interactive??v(),r=e.prompt??$,a=e.runInstall??h,n=e.importImpl??D,l=e.workspaceRoot??process.cwd(),i=R(l);try{return await n()}catch(d){const{code:u,message:m}=d;if(!(u==="ERR_MODULE_NOT_FOUND"||u==="MODULE_NOT_FOUND")||!m.includes(s))throw d}if(!t)throw new Error(`${s} is not installed. \`vis attest\` needs it for keyless signing/verification. Install it in your repo first:
|
|
2
|
+
${i}`);if(!await r(`${s} isn't installed. Install it now?`))throw new Error(`${s} install declined. Re-run \`vis attest\` after installing manually:
|
|
3
|
+
${i}`);const c=await a(l);if(c.exitCode!==0)throw new Error(`Install of ${s} failed (exit ${String(c.exitCode)}). Install manually and retry:
|
|
4
|
+
${i}`);return await n()};export{R as installCommandFor,C as isSigstoreInstalled,E as loadOptionalSigstore};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{i as r}from"./ts-loader.js";const n=(t,
|
|
1
|
+
import{i as r}from"./ts-loader.js";const n=(t,e)=>{if(!e||typeof e!="object")throw new TypeError(`${t}: default export must be an object (got ${e===null?"null":typeof e}). Use createTemplate({ ... }).`);const o=e;if(typeof o.about!="object"||o.about===null)throw new TypeError(`${t}: default export missing required "about" object`);if(typeof o.produce!="function")throw new TypeError(`${t}: default export missing required "produce" function`);return e},c=async t=>{const o=(await r(t)).default??null;return n(t,o)};export{c as loadNativeTemplate};
|
|
@@ -1,42 +1,42 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`).trim();return{meta:Object.keys(
|
|
3
|
-
`):"{}"}else{const n=[`${le(e.package)}:`,` bump: ${e.bump}`];if(e.releaseAs&&n.push(` releaseAs: ${e.releaseAs}`),e.cascade){n.push(" cascade:");for(const[
|
|
1
|
+
import{createRequire as We}from"node:module";import{a as H}from"../packem_shared/index-B4AjSxHU.js";import{DEFAULT_CHANGES_DIR as ae,DEFAULT_DEPENDENCY_BUMP_RULES as Xe,DEFAULT_CONFIG as Qe}from"./DEFAULT_CLEAN_KEEP.js";import{VisReleaseError as A}from"../packem_shared/VisReleaseError-DZtgcKf8.js";import{e as Ze,p as xe,b as es}from"./index2.js";import{L as as}from"../packem_shared/index-BisalDCf.js";import{BUMP_LEVELS as ye,maxBump as ue,normaliseGroup as be,bumpRank as ne}from"../release/types.js";import{isValidPackageName as ns,escapeMarkdown as ts,assertValidPackageName as rs}from"./security.js";import te from"./index.js";import{d as is,c as os}from"./index3.js";import{createShellRunner as ee}from"./shell-runner.js";let He;const ze=e=>(He??=We(import.meta.url))(e),Q=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,we=e=>{if(typeof Q<"u"&&Q.versions&&Q.versions.node){const[s,a]=Q.versions.node.split(".").map(Number);if(s>22||s===22&&a>=3||s===20&&a>=16)return Q.getBuiltinModule(e)}return ze(e)},{readdir:Ye,readFile:Je,writeFile:qe,unlink:Ke}=we("node:fs/promises"),{resolve:ge,sep:Z,join:ss}=we("node:path"),{realpathSync:ke}=we("node:fs"),cs=/^exit[\s-]prerelease\s*:\s*(.+)$/i,ls=/^(.+)@(\d+\.\d+\.\d+(?:[-+].*)?)$/,Pe=(e,s,a)=>{if(!ns(e))throw new A({code:"BUMP_FILE_INVALID",file:a,message:`Invalid replay condition "${s}": ${JSON.stringify(e)} is not a valid package name.`,packageName:e||void 0});return e},ds=(e,s)=>{if(typeof e!="string"||e.trim()==="")throw new A({code:"BUMP_FILE_INVALID",file:s,message:`Invalid replay condition: ${JSON.stringify(e)}. Expected "name@1.2.0" or "exit-prerelease:name".`});const a=e.trim(),n=cs.exec(a);if(n)return{kind:"exit-prerelease",package:Pe((n[1]??"").trim(),a,s)};const t=ls.exec(a);if(t)return{kind:"version",package:Pe((t[1]??"").trim(),a,s),version:t[2]??""};throw new A({code:"BUMP_FILE_INVALID",file:s,message:`Invalid replay condition "${a}". Expected "name@1.2.0" or "exit-prerelease:name".`})},ps=(e,s)=>{if(!Array.isArray(e))throw new A({code:"BUMP_FILE_INVALID",file:s,message:'`replay` must be a list of conditions (e.g. ["name@1.2.0", "exit-prerelease:name"]).'});return e.map(a=>ds(a,s))},me=e=>!("bumps"in e.payload)&&Array.isArray(e.payload.replay)&&e.payload.replay.length>0,$e=e=>/^\d+\.\d+\.\d+-/.test(e),gs=(e,s)=>e.package!==s.name?!1:e.kind==="version"?s.newVersion===e.version:$e(s.oldVersion)&&!$e(s.newVersion),us=(e,s)=>{const a=new Map,n=[],t=[];for(const i of e){if(!me(i))continue;const d=i.payload.replay;let c=!0;for(const o of d){const r=s.find(u=>gs(o,u));if(r){const u=a.get(r.name)??[];u.some(g=>g.id===i.id)||u.push(i),a.set(r.name,u)}else c=!1}c?n.push(i):t.push(i)}return{consumed:n,injectionsByPackage:a,retained:t}},ms=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/,fs=e=>{const s=ms.exec(e);return s?{body:(s[2]??"").trim(),frontmatter:s[1]??""}:null},hs=/^(?:@[a-z0-9-]+\/)?[\w.-]+$/i,ws=214,ys=e=>e.length===0||e.length>ws||e.startsWith(".")||e.startsWith("_")||e.startsWith("-")?!1:hs.test(e),fe=e=>typeof e=="string"&&ye.includes(e),vs=/^ {0,3}(#{1,3})\s+\S/,bs=/^ {0,3}(?:```|~~~)/,ks=e=>{let s,a=0,n=!1;for(const t of e.split(/\r?\n/)){if(bs.test(t)){n=!n;continue}if(n)continue;const i=vs.exec(t);if(!i)continue;const d=(i[1]??"").length,c=4-d;c>a&&(a=c,s=d===1?"major":d===2?"minor":"patch")}return s},Ps=/^\s*(pr|commit|author)\s*:\s*(.+?)\s*$/i,$s=e=>{const s=e.split(/\r?\n/),a={};let n=0;for(const i of s){if(i.trim()===""){n+=1;continue}const d=Ps.exec(i);if(!d)break;const[,c="",o=""]=d;switch(c.toLowerCase()){case"author":{a.author=o.startsWith("@")?o:`@${o}`;break}case"commit":{a.commit=o;break}case"pr":{const u=Number.parseInt(o,10);!Number.isNaN(u)&&u>0&&(a.pr=u);break}}n+=1}const t=s.slice(n).join(`
|
|
2
|
+
`).trim();return{meta:Object.keys(a).length>0?a:void 0,remainder:t}},Ce=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&("bump"in e||"replay"in e),Cs=(e,s,a)=>{const n=s.replay!==void 0;if(n&&s.bump!==void 0)throw new A({code:"BUMP_FILE_INVALID",file:a,message:`"${e}" sets both \`bump\` and \`replay\`. Replay files are changelog-only and never bump — remove \`bump\`, or drop \`replay\` to make this a normal change file.`,packageName:e});const t=s.bump===void 0&&n?"none":s.bump;if(!fe(t))throw new A({code:"BUMP_FILE_INVALID",file:a,message:`Invalid bump level for "${e}": ${JSON.stringify(s.bump)}. Expected one of: ${ye.join(", ")}`,packageName:e});const i={bump:t,package:e};if(n&&(i.replay=ps(s.replay,a)),s.releaseAs!==void 0){if(typeof s.releaseAs!="string"||!/^\d+\.\d+\.\d+(?:[-+].*)?$/.test(s.releaseAs))throw new A({code:"BUMP_FILE_INVALID",file:a,message:`Invalid releaseAs for "${e}": ${JSON.stringify(s.releaseAs)}. Expected a semver string like "2.0.0" or "2.0.0-rc.1".`,packageName:e});i.releaseAs=s.releaseAs}if(s.cascade!==void 0){if(typeof s.cascade!="object"||s.cascade===null||Array.isArray(s.cascade))throw new A({code:"BUMP_FILE_INVALID",file:a,message:`Cascade block for "${e}" must be an object mapping package globs to bump levels.`,packageName:e});const d={};for(const[c,o]of Object.entries(s.cascade)){if(!fe(o))throw new A({code:"BUMP_FILE_INVALID",file:a,message:`Invalid cascade bump level for "${c}": ${JSON.stringify(o)}.`,packageName:e});d[c]=o}i.cascade=d}return i},ce=e=>e.replaceAll(/^.*[/\\]/g,"").replace(/\.md$/i,""),Ns=(e,s)=>{const a=fs(e);if(!a)throw new A({code:"BUMP_FILE_INVALID",file:s,message:"Change file is missing YAML frontmatter (expected `---` delimiters)."});let n;try{n=as(a.frontmatter,{strict:!0})}catch(o){throw new A({cause:o,code:"BUMP_FILE_INVALID",file:s,message:`YAML parse failed: ${o.message}`})}if(n==null)return{body:a.body.trim(),id:ce(s),path:s,payload:{bumps:{}}};if(typeof n!="object"||Array.isArray(n))throw new A({code:"BUMP_FILE_INVALID",file:s,message:"Frontmatter must be a YAML object mapping package names to bump levels."});const t=Object.entries(n);if(t.length===0)return{body:a.body.trim(),id:ce(s),path:s,payload:{bumps:{}}};for(const[o]of t)if(!ys(o))throw new A({code:"BUMP_FILE_INVALID",file:s,message:`Invalid package name: ${JSON.stringify(o)}.`,packageName:o});let i;if(t.length===1&&Ce(t[0][1])){const[o,r]=t[0];i=Cs(o,r,s)}else{const o={},r=[];for(const[u,g]of t){if(Ce(g))throw new A({code:"BUMP_FILE_INVALID",file:s,message:`Mixed simple + nested entries are not allowed. Package "${u}" uses the nested shape but the file has multiple top-level entries.`,packageName:u});if(g==null||g===""){r.push(u);continue}if(!fe(g))throw new A({code:"BUMP_FILE_INVALID",file:s,message:`Invalid bump level for "${u}": ${JSON.stringify(g)}. Expected one of: ${ye.join(", ")}`,packageName:u});o[u]=g}if(r.length>0){const u=ks(a.body);if(!u)throw new A({code:"BUMP_FILE_INVALID",file:s,message:`No bump level for ${r.map(g=>`"${g}"`).join(", ")}: the entry is empty and the body has no markdown heading to infer one from. Add an explicit level (e.g. \`${r[0]}: minor\`) or a heading (\`# major\`, \`## minor\`, \`### patch\`).`,packageName:r[0]});for(const g of r)o[g]=u}i={bumps:o}}const{meta:d,remainder:c}=$s(a.body);return{body:c,id:ce(s),meta:d,path:s,payload:i}},ma=(e,s)=>{let a;if("bumps"in e){const n=Object.entries(e.bumps).map(([t,i])=>`${le(t)}: ${i}`);a=n.length>0?n.join(`
|
|
3
|
+
`):"{}"}else{const n=[`${le(e.package)}:`,` bump: ${e.bump}`];if(e.releaseAs&&n.push(` releaseAs: ${e.releaseAs}`),e.cascade){n.push(" cascade:");for(const[t,i]of Object.entries(e.cascade))n.push(` ${le(t)}: ${i}`)}if(e.replay&&e.replay.length>0){n.push(" replay:");for(const t of e.replay){const i=t.kind==="version"?`${t.package}@${t.version}`:`exit-prerelease:${t.package}`;n.push(` - "${i}"`)}}a=n.join(`
|
|
4
4
|
`)}return`---
|
|
5
|
-
${
|
|
5
|
+
${a}
|
|
6
6
|
---
|
|
7
|
-
${
|
|
8
|
-
`}`},le=e=>/^[a-z0-9-]/.test(e)?e:`"${e}"`,
|
|
9
|
-
`)},se=e=>{const{current:a,prerelease:t}=e;let{bump:n}=e;if(!H.valid(a))throw new C({code:"CONFIG_INVALID",message:`Invalid current version: ${JSON.stringify(a)}`});const s=H.parse(a),i=s.prerelease[0],l=s.prerelease.length>0;if(s.major===0&&e.bumpMinorPreMajor&&(n==="major"&&(n="minor"),n==="minor"&&e.bumpPatchForMinorPreMajor&&(n="patch")),n==="none")return(i??void 0)===(t??void 0)?a:!l&&t?`${s.major}.${s.minor}.${s.patch}-${t}.0`:l&&!t?`${s.major}.${s.minor}.${s.patch}`:l&&t?`${s.major}.${s.minor}.${s.patch}-${t}.0`:a;if(l&&t&&i===t){const o=La(s);if(Re[n]<=Re[o]){const g=H.inc(a,"prerelease",t);if(!g)throw new C({code:"CONFIG_INVALID",message:`semver.inc returned null for prerelease bump on ${a}`});return g}const r=`${s.major}.${s.minor}.${s.patch}`,u=H.inc(r,n);if(!u)throw new C({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${r}`});return`${u}-${t}.0`}if(t){const o=`${s.major}.${s.minor}.${s.patch}`,r=H.inc(o,n);if(!r)throw new C({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${o}`});return`${r}-${t}.0`}if(l){const o=`${s.major}.${s.minor}.${s.patch}`,r=H.inc(o,n);if(!r)throw new C({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${o}`});return r}const c=H.inc(a,n);if(!c)throw new C({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${a}`});return c},Re={major:3,minor:2,patch:1},La=e=>e.minor===0&&e.patch===0?"major":e.patch===0?"minor":"patch",Ba=(e,a)=>{const t=_e(a);return t?H.satisfies(e,t,{includePrerelease:!0}):!0},_e=e=>{if(!e||e.startsWith("catalog:")||e==="*"||e==="workspace:*"||e==="workspace:^"||e==="workspace:~")return null;if(e.startsWith("workspace:")){const a=e.slice(10);return a==="*"||a==="^"||a==="~"?null:a}if(e.startsWith("npm:")){const a=e.lastIndexOf("@");return a>4?e.slice(a+1):null}return e},pe=100,W=(e,a,t,n,{isCascadeBump:s=!1,isDependencyBump:i=!1,isGroupBump:l=!1,source:c}={})=>{const o=e.get(a);if(o){const r=o.type;return o.type=me(o.type,t),o.reasons.add(n),i&&(o.isDependencyBump=!0),l&&(o.isGroupBump=!0),s&&(o.isCascadeBump=!0),c&&o.sources.set(c.name,{bumpType:c.bumpType,newVersion:c.newVersion}),o.type!==r}return e.set(a,{isCascadeBump:s,isDependencyBump:i,isGroupBump:l,name:a,proactiveSeen:!1,reasons:new Set([n]),sources:c?new Map([[c.name,{bumpType:c.bumpType,newVersion:c.newVersion}]]):new Map,type:t}),!0},Oa=(e,a,t,n)=>{const s=t?.get(e)?.dependencyBumpRules?.[a];if(s!==void 0)return s;const i=n.dependencyBumpRules?.[a];return i!==void 0?i:qe[a]??!1},Me=(e,a)=>te(e)>=te(a),je=(e,a)=>a==="match"?e:a,Ta=(e,a)=>a===!0?!0:Array.isArray(a)?a.includes(e):!1,xa=10,Ga=(e,a,t,n,s,i,l)=>{let c=!1;for(const o of e.values()){const r=a.getPackage(o.name);if(!r)continue;const u=n.currentVersions?.get(o.name)??r.version,g=t.get(o.name)??se({bump:o.type,bumpMinorPreMajor:n.bumpMinorPreMajor,bumpPatchForMinorPreMajor:n.bumpPatchForMinorPreMajor,current:u,prerelease:n.prerelease});t.set(o.name,g);for(const p of a.getDependents(o.name)){if(p.kind==="devDependencies"){if(!Ta(o.name,i.bumpDevDependencies))continue;if(W(e,p.name,"patch","DEVDEPENDENCY_BUMPED",{isDependencyBump:!0,source:{bumpType:o.type,name:o.name,newVersion:g}})&&(c=!0,t.delete(p.name)),i.bumpDevDependencies===!0){let y=l.get(o.name);y||(y=new Set,l.set(o.name,y)),y.add(p.name)}continue}const d=_e(p.range);if(d===null||Ba(g,d))continue;let f,$="DEPENDENCY_OUT_OF_RANGE";p.kind==="peerDependencies"?(f=o.type==="none"?"patch":o.type,$="PEER_DEP_MATCH",d.startsWith("^0.")&&f!=="patch"&&s.push(`^0.x peer dep "${o.name}" → "${p.name}" produced a ${f} bump. Consider widening the range manually.`)):f="patch",W(e,p.name,f,$,{isDependencyBump:!0,source:{bumpType:o.type,name:o.name,newVersion:g}})&&(c=!0,t.delete(p.name))}}return c},Ua=(e,a,t)=>{let n=!1;for(const s of t.fixed??[]){const i=$e(s),l=re(i.packages,a),c=l.filter(r=>e.has(r));if(c.length===0)continue;let o="none";for(const r of c)o=me(o,e.get(r).type);for(const r of l)a.isInternal(r)&&W(e,r,o,"FIXED_GROUP",{isGroupBump:!0})&&(n=!0)}for(const s of t.linked??[]){const i=$e(s),l=re(i.packages,a).filter(o=>e.has(o));if(l.length===0)continue;let c="none";for(const o of l)c=me(c,e.get(o).type);for(const o of l)W(e,o,c,"LINKED_GROUP",{isGroupBump:!0})&&(n=!0)}return n},De=new WeakMap,Ha=/[!()*+?@[\]{|}]/,re=(e,a)=>{let t=De.get(a);t||(t={allNames:a.allPackages().map(s=>s.name),matched:new Map},De.set(a,t));const n=new Set;for(const s of e){if(!Ha.test(s)){n.add(s);continue}let i=t.matched.get(s);i||(i=t.allNames.filter(l=>ne(s,l)),t.matched.set(s,i));for(const l of i)n.add(l)}return[...n]},Wa=(e,a,t,n,s,i)=>{let l=!1;const c=n.updateInternalDependencies??"out-of-range",o=r=>{const u=i.get(r.name);if(u!==void 0)return u;const g=se({bump:r.type,bumpMinorPreMajor:s.bumpMinorPreMajor,bumpPatchForMinorPreMajor:s.bumpPatchForMinorPreMajor,current:s.currentVersions?.get(r.name)??t.getPackage(r.name).version,prerelease:s.prerelease});return i.set(r.name,g),g};for(const r of a){if("bumps"in r.payload||!r.payload.cascade)continue;const u=e.get(r.payload.package);if(!u)continue;const g=i.get(u.name)??se({bump:u.type,bumpMinorPreMajor:s.bumpMinorPreMajor,bumpPatchForMinorPreMajor:s.bumpPatchForMinorPreMajor,current:s.currentVersions?.get(u.name)??t.getPackage(u.name).version,prerelease:s.prerelease});i.set(u.name,g);for(const[p,d]of Object.entries(r.payload.cascade))for(const f of re([p],t))t.isInternal(f)&&W(e,f,d,"CASCADE",{isCascadeBump:!0,source:{bumpType:u.type,name:u.name,newVersion:g}})&&(l=!0)}for(const r of e.values()){const u=s.perPackageConfig?.get(r.name)?.cascadeTo;if(u)for(const[g,p]of Object.entries(u)){if(!Me(r.type,p.trigger))continue;const d=je(r.type,p.bumpAs),f=o(r);for(const $ of re([g],t))t.isInternal($)&&W(e,$,d,"CASCADE_TO",{isCascadeBump:!0,source:{bumpType:r.type,name:r.name,newVersion:f}})&&(l=!0)}}if(c==="out-of-range")return l;for(const r of e.values())if(!r.proactiveSeen&&!(c==="minor"&&te(r.type)<te("minor"))){for(const u of t.getDependents(r.name)){const g=Oa(u.name,u.kind,s.perPackageConfig,n);if(g===!1||!Me(r.type,g.trigger))continue;const p=je(r.type,g.bumpAs);if(p==="none")continue;const d=o(r);W(e,u.name,p,"DEPENDENCY_BUMPED",{isDependencyBump:!0,source:{bumpType:r.type,name:r.name,newVersion:d}})&&(l=!0)}r.proactiveSeen=!0}return l},Ja=(e,a,t,n={})=>{const s=e.filter(d=>ue(d)),i=s.length>0?e.filter(d=>!ue(d)):e,l=new Map,c=[],o=new Map;for(const[d,f]of Aa(i).entries()){if(!a.isInternal(d)){c.push(`Change file references non-workspace package "${d}" — ignored.`);continue}f!=="none"&&W(l,d,f,"EXPLICIT")}for(const d of n.catalogConsumers??[]){if(!a.isInternal(d.packageName))continue;const f=`catalog:${d.catalog}/${d.dep}`;W(l,d.packageName,"patch","CATALOG_CHANGED",{isDependencyBump:!0,source:{bumpType:"patch",name:f,newVersion:d.newVersion??""}})}const r=new Map,u=d=>{const f=Ae(d,i).map(y=>"releaseAs"in y.payload?{file:y.path,version:y.payload.releaseAs}:void 0).filter(y=>y!==void 0&&typeof y.version=="string"),$=new Set(f.map(y=>y.version));if($.size>1)throw new C({code:"BUMP_FILE_INVALID",message:`Conflicting releaseAs values for ${d}: ${[...$].join(", ")}. Found in: ${f.map(y=>y.file).join(", ")}. Consolidate the change files to a single override.`,packageName:d});return f[0]?.version},g=new Map;for(const d of l.values()){if(d.type==="none")continue;const f=u(d.name);f&&(g.set(d.name,f),o.set(d.name,f))}for(let d=0;d<pe;d+=1){const f=Ga(l,a,o,n,c,t,r),$=Ua(l,a,t),y=Wa(l,i,a,t,n,o);if(!f&&!$&&!y)break;d===pe-1&&c.push(`Release plan did not converge after ${pe} iterations — releasing the current best plan. This usually indicates a config bug (cyclic cascade?).`)}for(const[d,f]of r){const $=f.size;$>xa&&c.push(`bumpDevDependencies: true triggered ${$} patch-cascades to distinct dependents from a single devdep bump (${d}). Consider scoping with the array form ['only', 'these', 'sources'].`)}const p=[];for(const d of l.values()){if(d.type==="none")continue;const f=a.getPackage(d.name);if(!f)continue;const $=Ae(d.name,i),y=g.get(d.name),b=n.currentVersions?.get(d.name)??f.version,P=y??o.get(d.name)??se({bump:d.type,bumpMinorPreMajor:n.bumpMinorPreMajor,bumpPatchForMinorPreMajor:n.bumpPatchForMinorPreMajor,current:b,prerelease:n.prerelease});p.push({changeFiles:$,isCascadeBump:d.isCascadeBump,isDependencyBump:d.isDependencyBump,isGroupBump:d.isGroupBump,name:d.name,newVersion:P,oldVersion:b,reasons:[...d.reasons],sources:[...d.sources.entries()].map(([k,V])=>({name:k,...V})),type:d.type})}if(p.sort((d,f)=>d.name.localeCompare(f.name)),s.length>0){const d=ga(s,p);for(const[f,$]of d.injectionsByPackage){const y=p.find(b=>b.name===f);y&&(y.changeFiles=[...y.changeFiles,...$])}return{consumedChangeFiles:[...i,...d.consumed],releases:p,warnings:c}}return{consumedChangeFiles:i,releases:p,warnings:c}},Fe=async(e,a,t={})=>{const n=await e.listPackages(),s=[],i=new Map,l=new Map,c=g=>{const p=ge(g);try{return ve.native(p)}catch{try{return ve(p)}catch{return p}}},o=t.cwd===void 0?void 0:c(t.cwd),r=g=>g.replaceAll("\\","/"),u=[];for(const{manifest:g,manifestPath:p}of n){const d=he(typeof g.name=="string"?g.name:"",g,a);if(g.napi!==void 0||d.versionActions==="native-addon"){const f=r(p.replace(/[/\\]package\.json$/i,""));u.push(`${f}/npm/`)}}for(const{manifest:g,manifestPath:p}of n){if(typeof g.name!="string"||g.name==="")continue;const d=r(p.replace(/[/\\]package\.json$/i,""));if(u.some(y=>d.startsWith(y)))continue;if(sa(g.name),l.has(g.name))throw new C({code:"DUPLICATE_PACKAGE_NAME",message:`Duplicate package name "${g.name}" — at ${l.get(g.name)} and ${p}.`,packageName:g.name});if(l.set(g.name,p),o!==void 0){const y=c(p),b=o.endsWith(K)?o:`${o}${K}`,P=V=>K==="\\"?V.toLowerCase():V,k=P(y);if(k!==P(o)&&!k.startsWith(P(b)))throw new C({code:"CONFIG_INVALID",message:`Package manifest is outside the workspace: ${p} (workspace: ${o}).`,packageName:g.name})}const f=he(g.name,g,a);if(!Ee(g.name,g,f,a))continue;const $=p.replace(/[/\\]package\.json$/i,"");s.push({dir:$,manifest:g,manifestPath:p,name:g.name,private:g.private===!0,version:typeof g.version=="string"?g.version:"0.0.0"}),i.set(g.name,f)}return{packages:s,perPackageConfig:i}},he=(e,a,t)=>{const n=t.packages?.[e]??{},s=a["vis-release"]??{};return{...n,...s}},Ee=(e,a,t,n)=>t.managed===!1?!1:t.managed===!0?!0:Ve(e,n.ignore??[])?!1:Ve(e,n.include??[])?!0:a.private===!0&&!(n.privatePackages?.version??!1)?!1:n.defaultManaged??!1,Ve=(e,a)=>a.some(t=>ne(t,e)),Se=(e,a)=>a.versionActions!==void 0?a.versionActions:e.manifest.napi!==void 0?"native-addon":e.private?"private":"npm",ut=Object.defineProperty({__proto__:null,discoverPackages:Fe,isPackageManaged:Ee,mergePerPackageConfig:he,resolveVersionActionsId:Se},Symbol.toStringTag,{value:"Module"}),ft=async(e={})=>{const a=e.cwd??process.cwd(),t=Q(),n=await ra(a),s=oa(n,t),i=await s.detectVersion(a);if(i&&!za(i,s.minVersion))throw new C({code:"PM_VERSION_TOO_LOW",hint:`pnpm install -g ${s.id}@latest (or your equivalent)`,message:`${s.id} version ${i} is below the required minimum ${s.minVersion}. Upgrade ${s.id} to enable release operations.`});let l={};try{const{loadVisConfig:R}=await import("./CONFIG_FILES.js"),_=await R(a);_.release&&(l=_.release)}catch(R){const{code:_}=R,N=R.message??"";if(!(_==="ENOENT"||_==="MODULE_NOT_FOUND"||/cannot find module/i.test(N)))throw R}const c=Ya(l,e.config??{});!c.acknowledgeUnstable&&process.env.VIS_RELEASE_SUPPRESS_UNSTABLE!=="1"&&process.stderr.write("[vis release] ⚠ This subsystem is flagged unstable. Set `release.acknowledgeUnstable: true` in vis.config.ts to suppress this warning. (RFC §21.2)\n");const o=e.channel??await Da(a,t),r=o?Ra(o,c.channels):void 0,u=await import("node:fs/promises"),g={listPackages:async()=>{const R=await s.listWorkspacePackages(a);return(await Promise.all(R.map(async _=>{const N=`${_.path}/package.json`;try{const E=await u.readFile(N,"utf8");return{manifest:JSON.parse(E),manifestPath:N}}catch{return}}))).filter(_=>_!==void 0)}},{packages:p,perPackageConfig:d}=await Fe(g,c,{cwd:a}),f=new _a(p),{files:$}=await Na({changesDir:c.changesDir,cwd:a}),{readPreMode:y}=await import("./pre-mode.js"),b=await y(a,c.changesDir??".vis/release");let P;b?.mode==="pre"?P=b.tag:b?.mode==="exit-pending"?P=void 0:P=r?.prerelease;const k=e.firstRelease===!0,{resolveCurrentVersionsForWorkspace:V}=await import("./version-resolver.js"),{versions:h,warnings:L}=await V(p,f,c,d,{cwd:a,firstRelease:k,pm:s,runner:t,skipRegistryLookup:e.skipRegistryLookup===!0}),I=[],B=[];if(c.detectCatalogChanges===!0)try{const{detectCatalogChanges:R,findCatalogConsumers:_,parseCatalogs:N}=await import("./catalog-detector.js"),E=await s.readCatalogYaml(a),J=N(E);let G;try{const m=await t.run("git",["show","HEAD~1:pnpm-workspace.yaml"],{cwd:a,silent:!0});m.exitCode===0&&(G=m.stdout)}catch{}const oe=N(G),Y=R(oe,J).filter(m=>m.oldVersion!==void 0&&m.newVersion!==void 0);if(Y.length>0){const m=_(p,J);for(const v of Y){const j=m.get(v.catalog)?.get(v.dep)??[];for(const x of j)I.push({catalog:v.catalog,dep:v.dep,newVersion:v.newVersion,oldVersion:v.oldVersion,packageName:x.packageName})}I.length>0&&B.push(`Catalog change-detection: ${Y.length} catalog dep(s) moved; ${I.length} consumer-package patch bump(s) tagged CATALOG_CHANGED.`)}}catch(R){B.push(`Catalog change-detection skipped: ${R.message}.`)}const A=Ja($,f,c,{bumpMinorPreMajor:c.bumpMinorPreMajor,bumpPatchForMinorPreMajor:c.bumpPatchForMinorPreMajor,catalogConsumers:I,currentVersions:h,perPackageConfig:d,prerelease:P});if(B.length>0&&A.warnings.push(...B),L.length>0&&A.warnings.push(...L),k&&A.warnings.push('First-release mode: currentVersionResolver forced to "disk", remote tag-collision checks skipped. Drop --first-release after the initial wave lands.'),b?.mode==="pre"&&A.warnings.push(`Pre-mode is ACTIVE (tag "${b.tag}"); every version produces a prerelease. Exit with \`vis release pre exit\` when ready to ship stable.`),b?.mode==="exit-pending"&&A.warnings.push(`Pre-mode is EXIT-PENDING (was "${b.tag}"); the next \`vis release version\` will consolidate the prerelease and delete pre.json.`),r?.overlapping&&r.overlapping.length>0&&A.warnings.push(`Branch "${o}" matches multiple channel patterns: "${r.branch}" (active) plus ${r.overlapping.map(R=>`"${R}"`).join(", ")}. Reorder channels in vis.config.ts if this is unintentional.`),e.projects&&e.projects.length>0){const{default:R}=await import("./index.js"),_=e.projects;A.releases=A.releases.filter(N=>_.some(E=>N.name===E||R(E,N.name)))}return{branch:o,channel:r?{mode:r.mode,prerelease:r.prerelease,tag:r.tag}:void 0,config:c,cwd:a,depGraph:f,firstRelease:k,packages:p,perPackageConfig:d,plan:A,pm:s,preMode:b}},Ya=(...e)=>{let a={...Xe};for(const t of e)a={...a,...t};return a},za=(e,a)=>{const t=H.coerce(e)?.version??e;try{return H.gte(t,a)}catch{return!0}},Z=async(e,a,t)=>{if(!a||a.trim()==="")return;const n=Q(),s=process.platform==="win32",i=s?"cmd":"sh",l=s?["/c",a]:["-c",a],c=await n.run(i,l,{cwd:e,silent:!1});if(c.exitCode!==0)throw new Error(`${t} failed (exit ${c.exitCode}): ${a}`)},Le=async(e,a,t,n={})=>{const{findConflictingPendingStages:s,readStagedRegistry:i,removePendingStages:l,writeStagedRegistry:c}=await import("./staged-registry.js"),o=e.config.changesDir??ae;let r=t??await i(e.cwd,o);if(r.pending.length===0)return;const u=new Map(e.plan.releases.map(y=>[y.name,y.newVersion])),g=[...u.keys()];let p=s(r,g).filter(y=>u.get(y.name)!==y.version);if(p.length===0)return;let d=[];if(!n.skipSelfHeal){const y=n.runner??Q();d=(await Promise.all(p.map(async b=>{const P=await y.run("npm",["view",`${b.name}@${b.version}`,"dist.tarball","--silent"],{cwd:e.cwd,silent:!0});return P.exitCode===0&&P.stdout.trim().length>0?b.id:void 0}))).filter(b=>b!==void 0)}if(d.length>0){if(r=l(r,d),n.persistSelfHeal!==!1)try{await c(e.cwd,o,r)}catch{}if(p=s(r,g).filter(y=>u.get(y.name)!==y.version),p.length===0)return}const f=p.map(y=>` • ${y.name}@${y.version} — stage ${y.id} (${y.reason}, recorded ${y.stagedAt})`).join(`
|
|
10
|
-
`)
|
|
11
|
-
${
|
|
12
|
-
`);return`release(${
|
|
13
|
-
|
|
14
|
-
${
|
|
7
|
+
${s.trim()===""?"":`${s.trim()}
|
|
8
|
+
`}`},le=e=>/^[a-z0-9-]/.test(e)?e:`"${e}"`,As=e=>{const s=new Map,a=t=>t==="major"?3:t==="minor"?2:t==="patch"?1:0,n=(t,i)=>{const d=s.get(t);(d===void 0||a(i)>a(d))&&s.set(t,i)};for(const t of e)if("bumps"in t.payload)for(const[i,d]of Object.entries(t.payload.bumps))n(i,d);else n(t.payload.package,t.payload.bump);return s},Ne=(e,s)=>s.filter(a=>"bumps"in a.payload?Object.hasOwn(a.payload.bumps,e):a.payload.package===e),Rs=new Set(["README.md","readme.md"]),Is=async e=>{const s=e.changesDir??ae,a=ge(e.cwd),n=ge(e.cwd,s),t=n,i=a.endsWith(Z)?a:`${a}${Z}`;if(n!==a&&!n.startsWith(i))throw new A({code:"CONFIG_INVALID",message:`changesDir resolves outside the workspace: ${n} (workspace: ${a}). Set release.changesDir to a path inside the repo.`});const d=[];let c;try{c=await Ye(t)}catch(u){if(u.code==="ENOENT")return{files:[],warnings:[]};throw new A({cause:u,code:"CONFIG_INVALID",message:`Cannot read change-files directory ${t}: ${u.message}`})}const o=c.filter(u=>!Rs.has(u)&&u.endsWith(".md"));return{files:await Promise.all(o.map(async u=>{const g=ss(t,u),l=await Je(g,"utf8");return Ns(l,g)})),warnings:d}},Es=(e,s)=>{if(!s)return;if(Object.hasOwn(s,e)){const n=Object.keys(s).filter(t=>t!==e&&Re(t)&&te(t,e));return Ae(e,s[e],n)}const a=[];for(const[n]of Object.entries(s))Re(n)&&te(n,e)&&a.push(n);if(a.length>0){const[n,...t]=a;return Ae(e,s[n],t)}},Ae=(e,s,a=[])=>{let{tag:n}=s;return n==="branch-name"&&(n=Ms(e)),{branch:e,mode:s.mode??"auto-publish",...a.length>0?{overlapping:a}:{},prerelease:s.prerelease,range:s.range,tag:n}},Ms=e=>e.toLowerCase().replaceAll(/[^a-z0-9.-]/g,"-").replaceAll(/^-+|-+$/g,"")||"branch",_s=/[!()*+?@[\]{|}]/,Re=e=>_s.test(e),Ds=async(e,s)=>{try{const a=await s.run("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e,silent:!0});if(a.exitCode!==0)return;const n=a.stdout.trim();return n==="HEAD"||n===""?void 0:n}catch{return}},Fs=["dependencies","devDependencies","peerDependencies","optionalDependencies"];class Ss{dependents;dependenciesByPackage;packagesByName;constructor(s){this.dependents=new Map,this.dependenciesByPackage=new Map,this.packagesByName=new Map;for(const a of s){if(this.packagesByName.has(a.name))throw new A({code:"DUPLICATE_PACKAGE_NAME",message:`Duplicate package name "${a.name}" — found at ${this.packagesByName.get(a.name).dir} and ${a.dir}.`,packageName:a.name});this.packagesByName.set(a.name,a),this.dependents.set(a.name,[]),this.dependenciesByPackage.set(a.name,[])}for(const a of s)for(const n of Fs){const t=a.manifest[n];if(!(!t||typeof t!="object"))for(const[i,d]of Object.entries(t))this.packagesByName.has(i)&&(this.dependents.get(i).push({kind:n,name:a.name,range:d}),this.dependenciesByPackage.get(a.name).push({kind:n,name:i,range:d}))}}getPackage(s){return this.packagesByName.get(s)}allPackages(){return[...this.packagesByName.values()]}isInternal(s){return this.packagesByName.has(s)}getDependents(s){return this.dependents.get(s)??[]}getDependencies(s){return this.dependenciesByPackage.get(s)??[]}topologicalSort(s){const a=s?new Set(s):new Set(this.packagesByName.keys()),n=new Set,t=new Set,i=[],d=(c,o)=>{if(!n.has(c)){if(t.has(c)){const r=o.indexOf(c),u=r===-1?[...o,c]:[...o.slice(r),c];throw new A({code:"CYCLIC_DEPENDENCY",message:`Cyclic dependency detected: ${u.join(" → ")}`})}t.add(c);for(const r of this.getDependencies(c))a.has(r.name)&&r.kind!=="devDependencies"&&d(r.name,[...o,c]);t.delete(c),n.add(c),i.push(c)}};for(const c of a)d(c,[]);return i}get size(){return this.packagesByName.size}}const js=/\{(name|version|previousVersion|date|repo|contributors)\}/g,Vs=(e,s)=>e.replaceAll(js,(a,n)=>s[n]??""),Ls=(e,s={})=>{const a=new Set;for(const i of s.internalAuthors??[]){const d=i.trim().toLowerCase().replace(/^@/,"");d.length>0&&a.add(d)}const n=new Set,t=[];for(const i of e){const d=i.meta?.author;if(d)for(const c of d.split(",")){const o=c.trim();if(!o)continue;const r=o.replace(/^@/,"");if(r.length===0)continue;const u=r.toLowerCase();n.has(u)||a.has(u)||(n.add(u),t.push(ts(o)))}}return t.length===0?"":t.map(i=>`- ${i}`).join(`
|
|
9
|
+
`)},re=e=>{const{current:s,prerelease:a}=e;let{bump:n}=e;if(!H.valid(s))throw new A({code:"CONFIG_INVALID",message:`Invalid current version: ${JSON.stringify(s)}`});const t=H.parse(s),i=t.prerelease[0],d=t.prerelease.length>0;if(t.major===0&&e.bumpMinorPreMajor&&(n==="major"&&(n="minor"),n==="minor"&&e.bumpPatchForMinorPreMajor&&(n="patch")),n==="none")return(i??void 0)===(a??void 0)?s:!d&&a?`${t.major}.${t.minor}.${t.patch}-${a}.0`:d&&!a?`${t.major}.${t.minor}.${t.patch}`:d&&a?`${t.major}.${t.minor}.${t.patch}-${a}.0`:s;if(d&&a&&i===a){const o=Ts(t);if(Ie[n]<=Ie[o]){const g=H.inc(s,"prerelease",a);if(!g)throw new A({code:"CONFIG_INVALID",message:`semver.inc returned null for prerelease bump on ${s}`});return g}const r=`${t.major}.${t.minor}.${t.patch}`,u=H.inc(r,n);if(!u)throw new A({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${r}`});return`${u}-${a}.0`}if(a){const o=`${t.major}.${t.minor}.${t.patch}`,r=H.inc(o,n);if(!r)throw new A({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${o}`});return`${r}-${a}.0`}if(d){const o=`${t.major}.${t.minor}.${t.patch}`,r=H.inc(o,n);if(!r)throw new A({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${o}`});return r}const c=H.inc(s,n);if(!c)throw new A({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${s}`});return c},Ie={major:3,minor:2,patch:1},Ts=e=>e.minor===0&&e.patch===0?"major":e.patch===0?"minor":"patch",Bs=(e,s)=>{const a=Fe(s);return a?H.satisfies(e,a,{includePrerelease:!0}):!0},Fe=e=>{if(!e||e.startsWith("catalog:")||e==="*"||e==="workspace:*"||e==="workspace:^"||e==="workspace:~")return null;if(e.startsWith("workspace:")){const s=e.slice(10);return s==="*"||s==="^"||s==="~"?null:s}if(e.startsWith("npm:")){const s=e.lastIndexOf("@");return s>4?e.slice(s+1):null}return e},de=100,J=(e,s,a,n,{isCascadeBump:t=!1,isDependencyBump:i=!1,isGroupBump:d=!1,source:c}={})=>{const o=e.get(s);if(o){const r=o.type;return o.type=ue(o.type,a),o.reasons.add(n),i&&(o.isDependencyBump=!0),d&&(o.isGroupBump=!0),t&&(o.isCascadeBump=!0),c&&o.sources.set(c.name,{bumpType:c.bumpType,newVersion:c.newVersion}),o.type!==r}return e.set(s,{isCascadeBump:t,isDependencyBump:i,isGroupBump:d,name:s,proactiveSeen:!1,reasons:new Set([n]),sources:c?new Map([[c.name,{bumpType:c.bumpType,newVersion:c.newVersion}]]):new Map,type:a}),!0},Os=(e,s,a,n)=>{const t=a?.get(e)?.dependencyBumpRules?.[s];if(t!==void 0)return t;const i=n.dependencyBumpRules?.[s];return i!==void 0?i:Xe[s]??!1},Ee=(e,s)=>ne(e)>=ne(s),Me=(e,s)=>s==="match"?e:s,Gs=(e,s)=>s===!0?!0:Array.isArray(s)?s.includes(e):!1,Us=10,Ws=(e,s,a,n,t,i,d)=>{let c=!1;for(const o of e.values()){const r=s.getPackage(o.name);if(!r)continue;const u=n.currentVersions?.get(o.name)??r.version,g=a.get(o.name)??re({bump:o.type,bumpMinorPreMajor:n.bumpMinorPreMajor,bumpPatchForMinorPreMajor:n.bumpPatchForMinorPreMajor,current:u,prerelease:n.prerelease});a.set(o.name,g);for(const l of s.getDependents(o.name)){if(l.kind==="devDependencies"){if(!Gs(o.name,i.bumpDevDependencies))continue;if(J(e,l.name,"patch","DEVDEPENDENCY_BUMPED",{isDependencyBump:!0,source:{bumpType:o.type,name:o.name,newVersion:g}})&&(c=!0,a.delete(l.name)),i.bumpDevDependencies===!0){let b=d.get(o.name);b||(b=new Set,d.set(o.name,b)),b.add(l.name)}continue}const p=Fe(l.range);if(p===null||Bs(g,p))continue;let m,v="DEPENDENCY_OUT_OF_RANGE";l.kind==="peerDependencies"?(m=o.type==="none"?"patch":o.type,v="PEER_DEP_MATCH",p.startsWith("^0.")&&m!=="patch"&&t.push(`^0.x peer dep "${o.name}" → "${l.name}" produced a ${m} bump. Consider widening the range manually.`)):m="patch",J(e,l.name,m,v,{isDependencyBump:!0,source:{bumpType:o.type,name:o.name,newVersion:g}})&&(c=!0,a.delete(l.name))}}return c},Hs=(e,s,a)=>{let n=!1;for(const t of a.fixed??[]){const i=be(t),d=ie(i.packages,s),c=d.filter(r=>e.has(r));if(c.length===0)continue;let o="none";for(const r of c)o=ue(o,e.get(r).type);for(const r of d){if(!s.isInternal(r))continue;J(e,r,o,"FIXED_GROUP",{isGroupBump:!0})&&(n=!0)}}for(const t of a.linked??[]){const i=be(t),c=ie(i.packages,s).filter(r=>e.has(r));if(c.length===0)continue;let o="none";for(const r of c)o=ue(o,e.get(r).type);for(const r of c)J(e,r,o,"LINKED_GROUP",{isGroupBump:!0})&&(n=!0)}return n},_e=new WeakMap,zs=/[!()*+?@[\]{|}]/,ie=(e,s)=>{let a=_e.get(s);a||(a={allNames:s.allPackages().map(t=>t.name),matched:new Map},_e.set(s,a));const n=new Set;for(const t of e){if(!zs.test(t)){n.add(t);continue}let i=a.matched.get(t);i||(i=a.allNames.filter(d=>te(t,d)),a.matched.set(t,i));for(const d of i)n.add(d)}return[...n]},Ys=(e,s,a,n,t,i)=>{let d=!1;const c=n.updateInternalDependencies??"out-of-range",o=r=>{const u=i.get(r.name);if(u!==void 0)return u;const g=re({bump:r.type,bumpMinorPreMajor:t.bumpMinorPreMajor,bumpPatchForMinorPreMajor:t.bumpPatchForMinorPreMajor,current:t.currentVersions?.get(r.name)??a.getPackage(r.name).version,prerelease:t.prerelease});return i.set(r.name,g),g};for(const r of s){if("bumps"in r.payload||!r.payload.cascade)continue;const u=e.get(r.payload.package);if(!u)continue;const g=i.get(u.name)??re({bump:u.type,bumpMinorPreMajor:t.bumpMinorPreMajor,bumpPatchForMinorPreMajor:t.bumpPatchForMinorPreMajor,current:t.currentVersions?.get(u.name)??a.getPackage(u.name).version,prerelease:t.prerelease});i.set(u.name,g);for(const[l,p]of Object.entries(r.payload.cascade))for(const m of ie([l],a)){if(!a.isInternal(m))continue;J(e,m,p,"CASCADE",{isCascadeBump:!0,source:{bumpType:u.type,name:u.name,newVersion:g}})&&(d=!0)}}for(const r of e.values()){const u=t.perPackageConfig?.get(r.name)?.cascadeTo;if(u)for(const[g,l]of Object.entries(u)){if(!Ee(r.type,l.trigger))continue;const p=Me(r.type,l.bumpAs),m=o(r);for(const v of ie([g],a)){if(!a.isInternal(v))continue;J(e,v,p,"CASCADE_TO",{isCascadeBump:!0,source:{bumpType:r.type,name:r.name,newVersion:m}})&&(d=!0)}}}if(c==="out-of-range")return d;for(const r of e.values())if(!r.proactiveSeen&&!(c==="minor"&&ne(r.type)<ne("minor"))){for(const u of a.getDependents(r.name)){const g=Os(u.name,u.kind,t.perPackageConfig,n);if(g===!1||!Ee(r.type,g.trigger))continue;const l=Me(r.type,g.bumpAs);if(l==="none")continue;const p=o(r);J(e,u.name,l,"DEPENDENCY_BUMPED",{isDependencyBump:!0,source:{bumpType:r.type,name:r.name,newVersion:p}})&&(d=!0)}r.proactiveSeen=!0}return d},Js=(e,s,a,n={})=>{const t=e.filter(p=>me(p)),i=t.length>0?e.filter(p=>!me(p)):e,d=new Map,c=[],o=new Map;for(const[p,m]of As(i).entries()){if(!s.isInternal(p)){c.push(`Change file references non-workspace package "${p}" — ignored.`);continue}m!=="none"&&J(d,p,m,"EXPLICIT")}for(const p of n.catalogConsumers??[]){if(!s.isInternal(p.packageName))continue;const m=`catalog:${p.catalog}/${p.dep}`;J(d,p.packageName,"patch","CATALOG_CHANGED",{isDependencyBump:!0,source:{bumpType:"patch",name:m,newVersion:p.newVersion??""}})}const r=new Map,u=p=>{const m=Ne(p,i).map(y=>"releaseAs"in y.payload?{file:y.path,version:y.payload.releaseAs}:void 0).filter(y=>y!==void 0&&typeof y.version=="string"),v=new Set(m.map(y=>y.version));if(v.size>1)throw new A({code:"BUMP_FILE_INVALID",message:`Conflicting releaseAs values for ${p}: ${[...v].join(", ")}. Found in: ${m.map(y=>y.file).join(", ")}. Consolidate the change files to a single override.`,packageName:p});return m[0]?.version},g=new Map;for(const p of d.values()){if(p.type==="none")continue;const m=u(p.name);m&&(g.set(p.name,m),o.set(p.name,m))}for(let p=0;p<de;p+=1){const m=Ws(d,s,o,n,c,a,r),v=Hs(d,s,a),y=Ys(d,i,s,a,n,o);if(!m&&!v&&!y)break;p===de-1&&c.push(`Release plan did not converge after ${de} iterations — releasing the current best plan. This usually indicates a config bug (cyclic cascade?).`)}for(const[p,m]of r){const v=m.size;v>Us&&c.push(`bumpDevDependencies: true triggered ${v} patch-cascades to distinct dependents from a single devdep bump (${p}). Consider scoping with the array form ['only', 'these', 'sources'].`)}const l=[];for(const p of d.values()){if(p.type==="none")continue;const m=s.getPackage(p.name);if(!m)continue;const v=Ne(p.name,i),y=g.get(p.name),P=n.currentVersions?.get(p.name)??m.version,b=y??o.get(p.name)??re({bump:p.type,bumpMinorPreMajor:n.bumpMinorPreMajor,bumpPatchForMinorPreMajor:n.bumpPatchForMinorPreMajor,current:P,prerelease:n.prerelease});l.push({changeFiles:v,isCascadeBump:p.isCascadeBump,isDependencyBump:p.isDependencyBump,isGroupBump:p.isGroupBump,name:p.name,newVersion:b,oldVersion:P,reasons:[...p.reasons],sources:[...p.sources.entries()].map(([$,D])=>({name:$,...D})),type:p.type})}if(l.sort((p,m)=>p.name.localeCompare(m.name)),t.length>0){const p=us(t,l);for(const[m,v]of p.injectionsByPackage){const y=l.find(P=>P.name===m);y&&(y.changeFiles=[...y.changeFiles,...v])}return{consumedChangeFiles:[...i,...p.consumed],releases:l,warnings:c}}return{consumedChangeFiles:i,releases:l,warnings:c}},Se=async(e,s,a={})=>{const n=await e.listPackages(),t=[],i=new Map,d=new Map,c=g=>{const l=ge(g);try{return ke.native(l)}catch{try{return ke(l)}catch{return l}}},o=a.cwd===void 0?void 0:c(a.cwd),r=g=>g.replaceAll("\\","/"),u=[];for(const{manifest:g,manifestPath:l}of n){const p=he(typeof g.name=="string"?g.name:"",g,s);if(g.napi!==void 0||p.versionActions==="native-addon"){const v=r(l.replace(/[/\\]package\.json$/i,""));u.push(`${v}/npm/`)}}for(const{manifest:g,manifestPath:l}of n){if(typeof g.name!="string"||g.name==="")continue;const p=r(l.replace(/[/\\]package\.json$/i,""));if(u.some(y=>p.startsWith(y)))continue;if(rs(g.name),d.has(g.name))throw new A({code:"DUPLICATE_PACKAGE_NAME",message:`Duplicate package name "${g.name}" — at ${d.get(g.name)} and ${l}.`,packageName:g.name});if(d.set(g.name,l),o!==void 0){const y=c(l),P=o.endsWith(Z)?o:`${o}${Z}`,b=D=>Z==="\\"?D.toLowerCase():D,$=b(y);if($!==b(o)&&!$.startsWith(b(P)))throw new A({code:"CONFIG_INVALID",message:`Package manifest is outside the workspace: ${l} (workspace: ${o}).`,packageName:g.name})}const m=he(g.name,g,s);if(!je(g.name,g,m,s))continue;const v=l.replace(/[/\\]package\.json$/i,"");t.push({dir:v,manifest:g,manifestPath:l,name:g.name,private:g.private===!0,version:typeof g.version=="string"?g.version:"0.0.0"}),i.set(g.name,m)}return{packages:t,perPackageConfig:i}},he=(e,s,a)=>{const n=a.packages?.[e]??{},t=s["vis-release"]??{};return{...n,...t}},je=(e,s,a,n)=>a.managed===!1?!1:a.managed===!0?!0:De(e,n.ignore??[])?!1:De(e,n.include??[])?!0:s.private===!0&&!(n.privatePackages?.version??!1)?!1:n.defaultManaged??!1,De=(e,s)=>s.some(a=>te(a,e)),Ve=(e,s)=>s.versionActions!==void 0?s.versionActions:e.manifest.napi!==void 0?"native-addon":e.private?"private":"npm",fa=Object.defineProperty({__proto__:null,discoverPackages:Se,isPackageManaged:je,mergePerPackageConfig:he,resolveVersionActionsId:Ve},Symbol.toStringTag,{value:"Module"}),ha=async(e={})=>{const s=e.cwd??process.cwd(),a=ee(),n=await is(s),t=os(n,a),i=await t.detectVersion(s);if(i&&!Ks(i,t.minVersion))throw new A({code:"PM_VERSION_TOO_LOW",hint:`pnpm install -g ${t.id}@latest (or your equivalent)`,message:`${t.id} version ${i} is below the required minimum ${t.minVersion}. Upgrade ${t.id} to enable release operations.`});let d={};try{const{loadVisConfig:C}=await import("./CONFIG_FILES.js"),S=await C(s);S.release&&(d=S.release)}catch(C){const{code:S}=C,M=C.message??"";if(!(S==="ENOENT"||S==="MODULE_NOT_FOUND"||/cannot find module/i.test(M)))throw C}const c=qs(d,e.config??{});!c.acknowledgeUnstable&&process.env.VIS_RELEASE_SUPPRESS_UNSTABLE!=="1"&&process.stderr.write("[vis release] ⚠ This subsystem is flagged unstable. Set `release.acknowledgeUnstable: true` in vis.config.ts to suppress this warning. (RFC §21.2)\n");const o=e.channel??await Ds(s,a),r=o?Es(o,c.channels):void 0,u=await import("node:fs/promises"),g={listPackages:async()=>{const C=await t.listWorkspacePackages(s);return(await Promise.all(C.map(async M=>{const E=`${M.path}/package.json`;try{const U=await u.readFile(E,"utf8");return{manifest:JSON.parse(U),manifestPath:E}}catch{return}}))).filter(M=>M!==void 0)}},{packages:l,perPackageConfig:p}=await Se(g,c,{cwd:s}),m=new Ss(l),{files:v}=await Is({changesDir:c.changesDir,cwd:s}),{readPreMode:y}=await import("./pre-mode.js"),P=await y(s,c.changesDir??".vis/release");let b;P?.mode==="pre"?b=P.tag:P?.mode==="exit-pending"?b=void 0:b=r?.prerelease;const $=e.firstRelease===!0,{resolveCurrentVersionsForWorkspace:D}=await import("./version-resolver.js"),{versions:h,warnings:B}=await D(l,m,c,p,{cwd:s,firstRelease:$,pm:t,runner:a,skipRegistryLookup:e.skipRegistryLookup===!0}),I=[],_=[];if(c.detectCatalogChanges===!0)try{const{detectCatalogChanges:C,findCatalogConsumers:S,parseCatalogs:M}=await import("./catalog-detector.js"),E=await t.readCatalogYaml(s),U=M(E);let G;try{const k=await a.run("git",["show","HEAD~1:pnpm-workspace.yaml"],{cwd:s,silent:!0});k.exitCode===0&&(G=k.stdout)}catch{}const q=M(G),f=C(q,U).filter(k=>k.oldVersion!==void 0&&k.newVersion!==void 0);if(f.length>0){const k=S(l,U);for(const R of f){const L=k.get(R.catalog)?.get(R.dep)??[];for(const F of L)I.push({catalog:R.catalog,dep:R.dep,newVersion:R.newVersion,oldVersion:R.oldVersion,packageName:F.packageName})}I.length>0&&_.push(`Catalog change-detection: ${f.length} catalog dep(s) moved; ${I.length} consumer-package patch bump(s) tagged CATALOG_CHANGED.`)}}catch(C){_.push(`Catalog change-detection skipped: ${C.message}.`)}const V=Js(v,m,c,{bumpMinorPreMajor:c.bumpMinorPreMajor,bumpPatchForMinorPreMajor:c.bumpPatchForMinorPreMajor,catalogConsumers:I,currentVersions:h,perPackageConfig:p,prerelease:b});if(_.length>0&&V.warnings.push(..._),B.length>0&&V.warnings.push(...B),$&&V.warnings.push('First-release mode: currentVersionResolver forced to "disk", remote tag-collision checks skipped. Drop --first-release after the initial wave lands.'),P?.mode==="pre"&&V.warnings.push(`Pre-mode is ACTIVE (tag "${P.tag}"); every version produces a prerelease. Exit with \`vis release pre exit\` when ready to ship stable.`),P?.mode==="exit-pending"&&V.warnings.push(`Pre-mode is EXIT-PENDING (was "${P.tag}"); the next \`vis release version\` will consolidate the prerelease and delete pre.json.`),r?.overlapping&&r.overlapping.length>0&&V.warnings.push(`Branch "${o}" matches multiple channel patterns: "${r.branch}" (active) plus ${r.overlapping.map(C=>`"${C}"`).join(", ")}. Reorder channels in vis.config.ts if this is unintentional.`),e.projects&&e.projects.length>0){const{default:C}=await import("./index.js"),S=e.projects;V.releases=V.releases.filter(M=>S.some(E=>M.name===E||C(E,M.name)))}return{branch:o,channel:r?{mode:r.mode,prerelease:r.prerelease,tag:r.tag}:void 0,config:c,cwd:s,depGraph:m,firstRelease:$,packages:l,perPackageConfig:p,plan:V,pm:t,preMode:P}},qs=(...e)=>{let s={...Qe};for(const a of e)s={...s,...a};return s},Ks=(e,s)=>{const a=H.coerce(e)?.version??e;try{return H.gte(a,s)}catch{return!0}},x=async(e,s,a)=>{if(!s||s.trim()==="")return;const n=ee(),t=process.platform==="win32",i=t?"cmd":"sh",d=t?["/c",s]:["-c",s],c=await n.run(i,d,{cwd:e,silent:!1});if(c.exitCode!==0)throw new Error(`${a} failed (exit ${c.exitCode}): ${s}`)},Le=async(e,s,a,n={})=>{const{findConflictingPendingStages:t,readStagedRegistry:i,removePendingStages:d,writeStagedRegistry:c}=await import("./staged-registry.js"),o=e.config.changesDir??ae;let r=a??await i(e.cwd,o);if(r.pending.length===0)return;const u=new Map(e.plan.releases.map(y=>[y.name,y.newVersion])),g=[...u.keys()];let l=t(r,g).filter(y=>u.get(y.name)!==y.version);if(l.length===0)return;let p=[];if(!n.skipSelfHeal){const y=n.runner??ee();p=(await Promise.all(l.map(async b=>{const $=await y.run("npm",["view",`${b.name}@${b.version}`,"dist.tarball","--silent"],{cwd:e.cwd,silent:!0});return $.exitCode===0&&$.stdout.trim().length>0?b.id:void 0}))).filter(b=>b!==void 0)}if(p.length>0){if(r=d(r,p),n.persistSelfHeal!==!1)try{await c(e.cwd,o,r)}catch{}if(l=t(r,g).filter(y=>u.get(y.name)!==y.version),l.length===0)return}const m=l.map(y=>` • ${y.name}@${y.version} — stage ${y.id} (${y.reason}, recorded ${y.stagedAt})`).join(`
|
|
10
|
+
`),v=s==="version"?"version":"publish";throw new A({code:"STAGE_PENDING",hint:"Resolve via `vis release stage approve <id>` / `--all` or `vis release stage reject <id>`, commit the updated staged.json, then retry.",message:`Refusing to ${v} — ${l.length} package(s) have a pending stage from a prior wave:
|
|
11
|
+
${m}`})},wa=async(e,s={})=>{if(e.plan.releases.length===0)return{changedFiles:[],deletedFiles:[],plan:e.plan};if(await Le(e,"version",void 0,{persistSelfHeal:!1}),!s.dryRun&&e.config.preVersionCommand&&await x(e.cwd,e.config.preVersionCommand,"preVersionCommand"),!s.dryRun&&e.config.groupPreVersionCommands){const{normaliseGroup:l}=await import("../release/types.js"),p=[...e.config.fixed??[],...e.config.linked??[]].map(v=>l(v)),{default:m}=await import("./index.js");for(const[v,y]of Object.entries(e.config.groupPreVersionCommands)){const P=Number.parseInt(v.replace(/^group-/,""),10),b=p[P];!b||!e.plan.releases.some(D=>b.packages.some(h=>D.name===h||m(h,D.name)))||await x(e.cwd,y,`groupPreVersionCommand[${v}]`)}}const a=await import("node:fs/promises"),{readFileSync:n}=await import("node:fs"),{resolveFormatter:t}=await import("./resolveFormatter.js"),{resolveGroupChangelogRouting:i}=await import("./workspace.js"),d=await t(e.config.changelog,e.cwd),c=new Date().toISOString().slice(0,10),o=i(e.config,e.packages,e.cwd),r=await Ze(e.plan,e.depGraph,{changelogPath:l=>o.get(l.name)??`${l.dir}/CHANGELOG.md`,readChangelog:l=>{try{return n(l,"utf8")}catch{return}},readManifest:l=>{try{return n(l,"utf8")}catch{return}},renderChangelogEntry:l=>d({changeFiles:l.changeFiles,date:c,release:l,target:"changelog"})}),u=[];{const{applyExtraFilesForRelease:l}=await import("./extra-files.js"),p=await Promise.all(e.plan.releases.map(async m=>{const v=e.depGraph.getPackage(m.name);if(!v)return{warnings:[],writes:[]};const y=e.perPackageConfig.get(m.name)?.extraFiles??[],P=e.config.publish?.extraFiles??[];return y.length===0&&P.length===0?{warnings:[],writes:[]}:l(e.cwd,v.dir,m.newVersion,m.name,P,y)}));for(const m of p){for(const v of m.writes)r.writes.push({content:v.content,path:v.path});u.push(...m.warnings)}u.length>0&&e.plan.warnings.push(...u)}if(s.dryRun)return{changedFiles:r.writes.map(l=>l.path),deletedFiles:r.deletions,plan:e.plan};await Promise.all([...r.writes.map(l=>qe(l.path,l.content)),...r.deletions.map(async l=>{try{await Ke(l)}catch{}})]);try{await e.pm.installLockfileOnly({cwd:e.cwd,silent:!0})}catch{}if(!s.dryRun&&e.config.formatChangedFiles&&await Xs(r.writes.map(l=>l.path),e.cwd),e.config.plugins?.length){const{runApplyDraftHooks:l}=await import("./defineReleasePlugin.js");await l({config:e.config,cwd:e.cwd},e.plan)}let g;if(s.commit){const{stageAndCommit:l}=await import("./git.js"),p=ee(),m=["pnpm-lock.yaml","package-lock.json","yarn.lock","bun.lock","bun.lockb"],v=await import("node:path"),y=[];for(const b of m)try{await a.access(v.join(e.cwd,b)),y.push(v.join(e.cwd,b))}catch{}const P=e.config.aggregateRelease===!0||typeof e.config.aggregateRelease=="object"&&e.config.aggregateRelease.enabled;if(e.config.oneCommitPerPackage===!0&&!P&&e.plan.releases.length>0){const b=e.channel?.tag??e.branch??"main",$=r.writes.map(B=>B.path),D=new Set,{releases:h}=e.plan;for(let B=0;B<h.length;B+=1){const I=h[B],_=e.depGraph.getPackage(I.name),V=_?`${_.dir}${v.sep}`:void 0,C=V?$.filter(E=>E.startsWith(V)):[];for(const E of C)D.add(E);const S=B===h.length-1?[...$.filter(E=>!D.has(E)),...r.deletions,...y]:[],M=[...C,...S];M.length!==0&&(g=await l({cwd:e.cwd,runner:p},M,`release(${b}): ${I.name}@${I.newVersion} [skip ci]`,{author:e.config.gitUser}))}}else{const b=s.commitMessage??Qs(e),$=[...r.writes.map(D=>D.path),...r.deletions,...y];g=await l({cwd:e.cwd,runner:p},$,b,{author:e.config.gitUser})}}if(!s.dryRun&&e.config.postVersionCommand&&await x(e.cwd,e.config.postVersionCommand,"postVersionCommand"),!s.dryRun&&e.preMode?.mode==="exit-pending"){const{deletePreMode:l,preModeFilePath:p}=await import("./pre-mode.js"),m=e.config.changesDir??".vis/release";await l(e.cwd,m)&&e.plan.warnings.push(`Pre-mode exited: \`${p(e.cwd,m)}\` was deleted. Commit the deletion so the registry stays consistent across CI runs.`)}return{changedFiles:r.writes.map(l=>l.path),commitSha:g,deletedFiles:r.deletions,plan:e.plan}},Xs=async(e,s)=>{if(e.length===0)return;const{join:a}=await import("node:path");let n;try{const{createRequire:i}=await import("node:module"),{pathToFileURL:d}=await import("node:url"),c=i(a(s,"package.json"));n=await import(d(c.resolve("prettier")).href)}catch{return}const t=await import("node:fs/promises");for(const i of e)try{const d=await n.getFileInfo(i);if(d.ignored||!d.inferredParser)continue;const c=await t.readFile(i,"utf8"),o=await n.resolveConfig(i),r=await n.format(c,{...o,filepath:i});r!==c&&await t.writeFile(i,r)}catch{}},Qs=e=>{const s=e.channel?.tag??e.branch??"main",{releases:a}=e.plan,n=a.length<=3?a.map(i=>`${i.name}@${i.newVersion}`).join(", "):`version ${a.length} packages`,t=a.map(i=>`- ${i.name}: ${i.oldVersion} → ${i.newVersion}`).join(`
|
|
12
|
+
`);return`release(${s}): ${n} [skip ci]
|
|
13
|
+
|
|
14
|
+
${t}`},pe=async(e,s,a,n,t)=>{const{stageAndCommitFile:i}=await import("./git.js"),{stateFilePath:d}=await import("./state.js");try{const c=await i({cwd:e.cwd,runner:s},d(e.cwd,a,!0),`chore(release): ${n} publish lock [skip ci]`,{author:e.config.gitUser,push:!t.noPush,sign:e.config.gitSignCommits===!0});!t.noPush&&c.committed&&!c.pushed&&process.stderr.write(`[vis release] Warning: publish lock (${n}) was committed locally but could not be pushed — cross-runner resume may use a stale lock.
|
|
15
15
|
`)}catch(c){process.stderr.write(`[vis release] Warning: could not commit publish lock (${n}): ${c.message}
|
|
16
|
-
`)}},
|
|
17
|
-
`)}}}if(!
|
|
18
|
-
`)}}catch(
|
|
19
|
-
`)}}if(!
|
|
20
|
-
`)}}}catch(
|
|
21
|
-
`)}}if(!
|
|
16
|
+
`)}},ya=async(e,s={})=>{const a={failed:[],published:[],skipped:[],tags:[],tagsPushed:!1},n=ee();if(e.plan.releases.length===0)return a;if(!s.dryRun&&e.channel?.mode==="version-pr"){const{createRemoteClient:o,detectRemoteProvider:r}=await import("./detect.js"),u=await r(e.cwd,n,e.config.provider),l=await o(u,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}).detectRepoSlug(e.cwd,n),p=e.config.versionPr?.branch??"vis-release/version-packages";if(l)try{const m=await n.run("gh",["pr","list","--head",p,"--state","open","--json","number"],{cwd:e.cwd,silent:!0});if(m.exitCode===0&&m.stdout.trim()&&m.stdout.trim()!=="[]"){const v=JSON.parse(m.stdout);if(v[0])return a.failed.push({name:"_preflight",reason:`Open release PR #${v[0].number} exists. Merge or close it before publishing locally. (Override: --no-push then \`git push --tags\` manually.)`}),a}}catch{}}if(!s.dryRun&&e.config.prePublishCommand)try{await x(e.cwd,e.config.prePublishCommand,"prePublishCommand")}catch(o){return a.failed.push({name:"_prePublishCommand",reason:o.message}),a}const t=e.config.changesDir??ae,{acquireLock:i,releaseLock:d}=await import("./state.js");let c=!1;if(!s.dryRun)try{await i(e.cwd,t),c=!0}catch(o){return a.failed.push({name:"_lock",reason:o.message}),a}try{const{clearState:o,filterPlanByState:r,newState:u,readState:g,writeState:l}=await import("./state.js"),{readStagedRegistry:p,removePendingStages:m,upsertPendingStages:v,writeStagedRegistry:y}=await import("./staged-registry.js"),P=e.config.changesDir??ae,b=e.config.publish?.lockInGit===!0;let $=s.resume||b?await g(e.cwd,P,b):void 0;$&&b&&($.channel=e.channel?.tag);const D=async()=>{s.dryRun||!$||(await l(e.cwd,P,$,b),b&&await pe(e,n,P,"progress",{noPush:s.noPush}))};let h=await p(e.cwd,P);await Le(e,"publish",h,{runner:n}),h=await p(e.cwd,P);const B={...h,pending:[...h.pending]};let{releases:I}=e.plan;$?I=r(I,$):($=u(e.channel?.tag,e.plan.releases),s.dryRun||(await l(e.cwd,P,$,b),b&&await pe(e,n,P,"open",{noPush:s.noPush})));const _=await e.pm.readCatalogYaml(e.cwd),V=xe(_),C=e.depGraph.topologicalSort(I.map(f=>f.name)),S=new Map(I.map(f=>[f.name,f])),M=new Set,E=new Map;for(const f of e.plan.releases){const k=e.depGraph.getPackage(f.name);k&&E.set(f.name,{...k.manifest,version:f.newVersion})}const U={config:e.config,cwd:e.cwd},G=e.config.plugins?.length?await import("./defineReleasePlugin.js"):void 0;for(const f of C){const k=S.get(f);if(!k){a.skipped.push({name:f,reason:"topo-sort returned a name not in the release plan (internal bug)"});continue}const R=e.depGraph.getPackage(f);if(!R)continue;const O=[...new Set(e.depGraph.getDependencies(f).filter(w=>w.kind!=="devDependencies"&&M.has(w.name)).map(w=>w.name))];if(O.length>0){a.skipped.push({name:f,reason:`dependency-failed: not published because ${O.join(", ")} failed to publish (publishing would orphan this package's dependency range)`}),M.add(f);continue}const L=e.perPackageConfig.get(f)??{},F=Ve(R,L),W=s.publishActionsOverride??es(F),T=s.tag??e.channel?.tag;if(G){const w=await G.runWillPublishHooks(U,{dir:R.dir,name:f,oldVersion:k.oldVersion,version:k.newVersion});if(w.skip){a.skipped.push({name:f,reason:`plugin-skipped${w.by?` by "${w.by}"`:""}`}),M.add(f);continue}}const z=h.pending.find(w=>w.name===f&&w.version===k.newVersion);try{const w=await W.publish({catalogs:V,cleanPackageJsonConfig:e.config.publish?.cleanPackageJson,dryRun:s.dryRun,otp:s.otp,perPackageConfig:L,pkg:R,pm:e.pm,provenance:aa(e),registry:L.registry,release:k,resumeStageId:z?.id,tag:T,versionedManifestByName:E,workspaceConfig:e.config});if(w.published||w.alreadyPublished){const N=h.pending.filter(j=>j.name===f&&j.version===k.newVersion).map(j=>j.id);N.length>0&&(h=m(h,N))}if(w.published)a.published.push({name:f,stageId:w.stageId,tarball:w.tarball,version:k.newVersion}),$.published.push(`${f}@${k.newVersion}`),G&&await G.runAfterPublishHooks(U,{dir:R.dir,name:f,oldVersion:k.oldVersion,version:k.newVersion});else if(w.alreadyPublished)a.skipped.push({name:f,reason:"already-published"}),$.published.push(`${f}@${k.newVersion}`);else if(a.skipped.push({name:f,reason:w.output??"skipped"}),w.stageId){const N=(w.output??"").startsWith("stage-rejected")?"rejected":"timeout";h=v(h,[{id:w.stageId,name:f,reason:N,stagedAt:new Date().toISOString(),tag:T??"latest",version:k.newVersion}])}await D()}catch(w){a.failed.push({name:f,reason:w.message}),M.add(f)}}G&&await G.runAfterPublishAllHooks(U,{failed:a.failed.map(f=>({name:f.name,reason:f.reason})),published:a.published.map(f=>({name:f.name,version:f.version})),skipped:a.skipped.map(f=>({name:f.name,reason:f.reason}))});const{resolveSyncTagGroups:q}=await import("./group-tags.js"),se=q(e.config,a.published);if(!s.dryRun&&!s.noTag&&a.published.length>0){const{createOrUpdateFloatingTag:f,createTag:k,defaultTagFor:R,pushTags:O,renderTagPattern:L}=await import("./git.js"),F=e.config.releaseTagPattern,W=e.channel?.tag,T=e.config.floatingMajorTag===!0,z=!!e.channel?.prerelease||!!e.preMode;for(const{name:w,version:N}of a.published){if(se.grouped.has(w))continue;const Y=e.perPackageConfig.get(w)?.releaseTagPattern??F,K=Y?L(Y,{channel:W,name:w,version:N}):R(w,N);try{await k({cwd:e.cwd,runner:n},K,`Release ${w}@${N}`,{signing:e.config.signing,skipRemoteCheck:e.firstRelease}),a.tags.push(K)}catch(X){e.firstRelease&&X instanceof A&&X.code==="TAG_COLLISION"?a.skipped.push({name:K,reason:"tag-creation: tag already exists (first-release — skipped)"}):a.skipped.push({name:K,reason:`tag-creation: ${X.message}`})}const Te=e.depGraph.getPackage(w),Be=e.perPackageConfig.get(w),Oe=Te?.manifest?.private===!0,Ge=Be?.skipNpmPublish===!0;if(T&&!z&&!Y?.includes("{major}")&&!Oe&&!Ge){const X=N.split(/[-+]/,1)[0].split(".")[0];if(X!==void 0&&X!==""){const ve=w.replace(/^@/,"").replaceAll("/","-");if(ve!==""){const oe=`${ve}-v${X}`;try{await f({cwd:e.cwd,runner:n},oe,{push:!s.noPush,signing:e.config.signing}),a.tags.push(oe)}catch(Ue){a.skipped.push({name:oe,reason:`floating-major-tag: ${Ue.message}`})}}}}}for(const w of se.groups)try{await k({cwd:e.cwd,runner:n},w.tag,`Release ${w.name} ${w.version}`,{signing:e.config.signing,skipRemoteCheck:e.firstRelease}),a.tags.push(w.tag)}catch(N){e.firstRelease&&N instanceof A&&N.code==="TAG_COLLISION"?a.skipped.push({name:w.tag,reason:"tag-creation: tag already exists (first-release — skipped)"}):a.skipped.push({name:w.tag,reason:`tag-creation: ${N.message}`})}if(!s.noPush&&a.tags.length>0)try{await O({cwd:e.cwd,runner:n}),a.tagsPushed=!0}catch(w){a.tagsPushed=!1,a.failed.push({name:"_pushTags",reason:`git push --tags failed: ${w.message}. Retry with: git push --tags`})}$.tagged=[...a.tags],$.pushed=a.tagsPushed,await D(),a.failed.length===0&&!s.dryRun&&(await o(e.cwd,P,b),b&&await pe(e,n,P,"close",{noPush:s.noPush}))}if(!s.dryRun){const f=B.pending.length,k=h.pending.length,R=await y(e.cwd,P,h);if(R.changed){const{stageAndCommitFile:O}=await import("./git.js");let L;if(R.removed)L="chore(release): clear pending stage registry [skip ci]";else if(k>f){const F=k-f;L=`chore(release): record ${F} new pending stage${F===1?"":"s"} [skip ci]`}else if(k<f){const F=f-k;L=`chore(release): drain ${F} resolved stage${F===1?"":"s"} [skip ci]`}else L=`chore(release): update pending stage registry (${k} pending) [skip ci]`;try{await O({cwd:e.cwd,runner:n},R.path,L,{author:e.config.gitUser,push:!s.noPush,sign:e.config.gitSignCommits===!0})}catch(F){process.stderr.write(`[vis release] Warning: could not commit ${R.path}: ${F.message}
|
|
17
|
+
`)}}}if(!s.dryRun&&a.published.length>0&&e.config.workspaceChangelog!==!1){const f=e.config.workspaceChangelog,k=typeof f=="object"?f:void 0,R=typeof e.config.aggregateRelease=="object"?e.config.aggregateRelease.enabled:e.config.aggregateRelease===!0;if(k!==void 0||R)try{const{writeWorkspaceChangelogWave:O}=await import("./workspace.js"),L=new Set(a.published.map(T=>T.name)),F=e.plan.releases.filter(T=>L.has(T.name)),W=await O({changelogConfig:e.config.changelog,cwd:e.cwd,workspaceChangelog:e.config.workspaceChangelog},F);if(W)try{const{stageAndCommitFile:T}=await import("./git.js");await T({cwd:e.cwd,runner:n},W,"chore(release): record wave [skip ci]",{author:e.config.gitUser,push:!s.noPush,sign:e.config.gitSignCommits===!0})}catch(T){process.stderr.write(`[vis release] Warning: could not commit workspace CHANGELOG.md: ${T.message}
|
|
18
|
+
`)}}catch(O){process.stderr.write(`[vis release] Warning: could not write workspace CHANGELOG.md wave entry: ${O.message}
|
|
19
|
+
`)}}if(!s.dryRun&&a.published.length>0&&a.tagsPushed){e.config.publish?.noRelease!==!0&&await sa(e,a,n,se);try{const{walkSuccessfulRelease:f}=await import("./success-walk.js"),{createRemoteClient:k,detectRemoteProvider:R}=await import("./detect.js"),{resolveFormatter:O}=await import("./resolveFormatter.js"),L=await R(e.cwd,n,e.config.provider),F=k(L,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}),W=await F.detectRepoSlug(e.cwd,n),T=await O(e.config.changelog,e.cwd),{recordRecentlyWalked:z}=await import("./staged-registry.js"),w=new Set([...$.walked??[],...(h.recentlyWalked??[]).map(j=>j.key)]),N={...a,published:a.published.filter(j=>!w.has(`${j.name}@${j.version}`))};if(N.published.length>0){const j=await f(e,N,n,{client:F,formatter:T,repo:W}),Y=N.published.map(K=>`${K.name}@${K.version}`);$.walked=[...$.walked??[],...Y],await D(),h=z(h,Y),j.warnings.length>0&&e.plan.warnings.push(...j.warnings)}}catch(f){e.plan.warnings.push(`successWalk: could not run post-release walk: ${f.message}`)}if(e.config.notifications)try{const{dispatchNotifications:f}=await import("./interface.js"),{createRemoteClient:k,detectRemoteProvider:R}=await import("./detect.js"),O=await R(e.cwd,n,e.config.provider),F=await k(O,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}).detectRepoSlug(e.cwd,n);let W;try{const w=`${e.cwd}/package.json`,N=await import("node:fs/promises");W=JSON.parse(await N.readFile(w,"utf8")).name}catch{}const T=new Set([...$.notified??[],...(h.recentlyNotified??[]).map(w=>w.key)]),z=a.published.filter(w=>!T.has(`${w.name}@${w.version}`));if(z.length>0){const w=await f(e.config.notifications,{channel:e.channel?.tag,completedAt:new Date().toISOString(),...W===void 0?{}:{monorepoName:W},published:z.map(N=>({name:N.name,tag:e.channel?.tag,...N.url===void 0?{}:{url:N.url},version:N.version})),...F===void 0?{}:{repo:F},skipped:a.skipped.map(N=>({name:N.name,reason:N.reason}))},{warn:N=>e.plan.warnings.push(N)});if(w.succeeded.length>0){const N=z.map(Y=>`${Y.name}@${Y.version}`);$.notified=[...$.notified??[],...N],await D();const{recordRecentlyNotified:j}=await import("./staged-registry.js");h=j(h,N)}if(w.failed.length>0||w.succeeded.length>0){const N=w.succeeded.length+w.failed.length;if(w.failed.length>0){e.plan.warnings.push(`[notifications] dispatched ${w.succeeded.length}/${N} channels${w.succeeded.length>0?` (succeeded: ${w.succeeded.join(", ")})`:""}; ${w.failed.length} failed.`);for(const j of w.failed)e.plan.warnings.push(`[notifications:${j.id}] ${j.error}`)}}}}catch(f){e.plan.warnings.push(`notifications: dispatch failed: ${f.message}`)}if(!s.dryRun)try{const f=await y(e.cwd,P,h);if(f.changed){const{stageAndCommitFile:k}=await import("./git.js");try{await k({cwd:e.cwd,runner:n},f.path,"chore(release): record cross-runner notify/walk dedupe [skip ci]",{author:e.config.gitUser,push:!s.noPush,sign:e.config.gitSignCommits===!0})}catch(R){process.stderr.write(`[vis release] Warning: could not commit ${f.path} (notify/walk dedupe): ${R.message}
|
|
20
|
+
`)}}}catch(f){process.stderr.write(`[vis release] Warning: could not update cross-runner dedupe registry: ${f.message}
|
|
21
|
+
`)}}if(!s.dryRun&&e.config.postPublishCommand)try{await x(e.cwd,e.config.postPublishCommand,"postPublishCommand")}catch(f){a.failed.push({name:"_postPublishCommand",reason:f.message})}return a}finally{c&&await d(e.cwd,t)}},Zs=e=>e.length===0?"":`## Related releases
|
|
22
22
|
|
|
23
23
|
${e.map(a=>`- [${a.name}](${a.url})`).join(`
|
|
24
|
-
`)}`,
|
|
24
|
+
`)}`,xs=(e,s,a)=>{if(!s||!s.header&&!s.footer)return e;const n=i=>Vs(i,{contributors:a.contributors??"",date:a.date,name:a.name,previousVersion:a.previousVersion,repo:a.repo,version:a.version}).replaceAll(/\n{3,}/g,`
|
|
25
25
|
|
|
26
|
-
`).replace(/\s+$/,""),
|
|
26
|
+
`).replace(/\s+$/,""),t=[];if(s.header){const i=n(s.header);i.length>0&&t.push(i)}if(t.push(e),s.footer){const i=n(s.footer);i.length>0&&t.push(i)}return t.join(`
|
|
27
27
|
|
|
28
|
-
`)},
|
|
29
|
-
`);try{const
|
|
30
|
-
`);try{const I=await c.createRelease(
|
|
28
|
+
`)},ea=e=>{if(!Array.isArray(e))return;const[s,a]=e;if(s!=="github"||typeof a!="object"||a===null)return;const{internalAuthors:n}=a;if(Array.isArray(n))return n.filter(t=>typeof t=="string")},sa=async(e,s,a,n)=>{const{createRemoteClient:t,detectRemoteProvider:i}=await import("./detect.js"),d=await i(e.cwd,a,e.config.provider),c=t(d,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}),o=await c.detectRepoSlug(e.cwd,a);if(!o)return;const r=typeof e.config.aggregateRelease=="object"?e.config.aggregateRelease:{enabled:e.config.aggregateRelease===!0},u=e.config.publish?.draftRelease===!0,g=e.config.publish?.discussionCategory,l=e.config.publish?.addReleases;if(r.enabled){const h=new Date().toISOString().slice(0,10),I=(r.title??"Release {date}").replaceAll("{date}",h),_=`release-${h}`,V=s.published.map(C=>`- \`${C.name}\` → ${C.version}`).join(`
|
|
29
|
+
`);try{const C=await c.createRelease(a,{body:V,cwd:e.cwd,discussionCategory:g,draft:u,repo:o,tag:_,title:I});if(C?.url)for(const S of s.published)S.url=C.url}catch{}return}const{defaultTagFor:p,renderTagPattern:m}=await import("./git.js"),v=e.config.releaseTagPattern,y=e.channel?.tag,P=e.config.publish?.releaseAssets??{},b=new Date().toISOString().slice(0,10),$=ea(e.config.changelog),D=Ls(e.plan.consumedChangeFiles??[],{internalAuthors:$});for(const h of n.groups){const B=h.members.map(I=>`- \`${I}\` → ${s.published.find(_=>_.name===I)?.version??h.version}`).join(`
|
|
30
|
+
`);try{const I=await c.createRelease(a,{body:B,cwd:e.cwd,discussionCategory:g,draft:u,prerelease:h.version.includes("-"),repo:o,tag:h.tag,title:`${h.name} ${h.version}`});if(I?.url)for(const _ of s.published)h.members.includes(_.name)&&(_.url=I.url)}catch(I){console.warn(`createRelease failed for group ${h.name} (tag ${h.tag}): ${I.message}`)}}for(const h of s.published){if(n.grouped.has(h.name))continue;const I=e.perPackageConfig.get(h.name)?.releaseTagPattern??v,_=I?m(I,{channel:y,name:h.name,version:h.version}):p(h.name,h.version),V=h.version.includes("-");let C=`Release of ${h.name}@${h.version}.`;if(h.stageId&&(C=`${C}
|
|
31
31
|
|
|
32
|
-
> ⏳ **Staged — not yet installable.** Approve via \`vis release stage approve ${h.stageId}\` or the npmjs.com web UI.`),
|
|
32
|
+
> ⏳ **Staged — not yet installable.** Approve via \`vis release stage approve ${h.stageId}\` or the npmjs.com web UI.`),P.stampHashes&&h.tarball&&(C=`${C}
|
|
33
33
|
|
|
34
34
|
### Tarball integrity
|
|
35
35
|
|
|
36
36
|
- size: \`${h.tarball.size}\` bytes
|
|
37
37
|
- sha256: \`${h.tarball.sha256}\`
|
|
38
|
-
- sha512: \`${h.tarball.sha512}\``),
|
|
38
|
+
- sha512: \`${h.tarball.sha512}\``),l!==void 0&&l!==!1)try{const E=_.lastIndexOf("@"),U=E>0?_.slice(0,E+1):"",G=await c.listRecentReleases(a,{cwd:e.cwd,excludeTag:_,limit:5,repo:o,tagPrefix:U}),q=Zs(G);q&&(C=l==="top"?`${q}
|
|
39
39
|
|
|
40
|
-
${
|
|
40
|
+
${C}`:`${C}
|
|
41
41
|
|
|
42
|
-
${
|
|
42
|
+
${q}`)}catch{}const{releaseNoteTemplate:S}=e.config;if(S){const U=e.plan.releases.find(G=>G.name===h.name)?.oldVersion??"";C=xs(C,S,{contributors:D,date:b,name:h.name,previousVersion:U,repo:o,version:h.version})}const M=[];P.uploadTarball&&h.tarball&&M.push(h.tarball.path);try{const E=await c.createRelease(a,{assets:M.length>0?M:void 0,body:C,cwd:e.cwd,discussionCategory:g,draft:u,prerelease:V,repo:o,tag:_,title:`${h.name} v${h.version}`});E?.url&&(h.url=E.url)}catch(E){console.warn(`createRelease failed for ${h.name}@${h.version} (tag ${_}): ${E.message}`)}}},aa=e=>(e.config.publish?.publishArgs??[]).includes("--provenance")&&e.pm.id!=="bun";export{wa as a,ha as b,Is as c,As as d,ma as f,ya as p,Ve as r,fa as w};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as l}from"node:module";import{VisReleaseError as a}from"../packem_shared/VisReleaseError-
|
|
2
|
-
`),o},
|
|
1
|
+
import{createRequire as l}from"node:module";import{VisReleaseError as a}from"../packem_shared/VisReleaseError-DZtgcKf8.js";let m;const u=r=>(m??=l(import.meta.url))(r),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=r=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[t,e]=i.versions.node.split(".").map(Number);if(t>22||t===22&&e>=3||t===20&&e>=16)return i.getBuiltinModule(r)}return u(r)},{readFile:f,unlink:p,mkdir:_,writeFile:g}=d("node:fs/promises"),{join:h,dirname:T}=d("node:path"),c=(r,t)=>h(r,t,"pre.json"),P=async(r,t)=>{const e=c(r,t);let o;try{o=await f(e,"utf8")}catch(n){if(n.code==="ENOENT")return;throw new a({cause:n,code:"STATE_FILE_CORRUPT",message:`Failed to read pre-mode file at ${e}: ${n.message}`})}let s;try{s=JSON.parse(o)}catch(n){throw new a({cause:n,code:"STATE_FILE_CORRUPT",message:`Pre-mode file at ${e} is not valid JSON: ${n.message}.`})}if(s.version!==1)throw new a({code:"STATE_FILE_CORRUPT",message:`Pre-mode file at ${e} reports unknown version ${s.version}.`});if(s.mode!=="pre"&&s.mode!=="exit-pending")throw new a({code:"STATE_FILE_CORRUPT",message:`Pre-mode file at ${e} has invalid mode ${JSON.stringify(s.mode)}.`});if(typeof s.tag!="string"||s.tag.length===0)throw new a({code:"STATE_FILE_CORRUPT",message:`Pre-mode file at ${e} is missing a tag.`});return s},R=async(r,t,e)=>{const o=c(r,t);return await _(T(o),{recursive:!0}),await g(o,`${JSON.stringify(e,null,2)}
|
|
2
|
+
`),o},v=async(r,t)=>{const e=c(r,t);try{return await p(e),!0}catch(o){if(o.code==="ENOENT")return!1;throw o}},y=(r,t)=>{const e={};for(const o of t)e[o.name]=o.version;return{enteredAt:new Date().toISOString(),initialVersions:e,mode:"pre",tag:r,version:1}};export{y as buildEnterFile,v as deletePreMode,c as preModeFilePath,P as readPreMode,R as writePreMode};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{normaliseGroup as
|
|
1
|
+
import{normaliseGroup as d}from"../release/types.js";const p=r=>r==="debug",u=r=>/[\\/]/.test(r)||/\.(?:pem|gpg|key|asc|p12|pfx)$/i.test(r)||r.length<8?"(key: configured)":`…${r.slice(-4)}`,i=r=>{try{const a=new URL(r);a.username="",a.password="";const n=a.pathname!==""&&a.pathname!=="/"?"/…REDACTED…":"";return`${a.origin}${n}`}catch{return r.replace(/(:\/\/)[^@/]+@/,"$1")||"[REDACTED]"}},m=r=>{if(!r)return r;const a={};for(const n of Object.keys(r))a[n]="[REDACTED]";return a},h=r=>{const a=structuredClone(r);if(a.signing?.key&&(a.signing={...a.signing,key:u(a.signing.key)}),a.httpProxy&&(a.httpProxy=i(a.httpProxy)),a.notifications){const n=a.notifications,o=s=>({...s,webhook:i(s.webhook)}),t=s=>({...s,webhook:i(s.webhook)}),e=s=>({...s,headers:m(s.headers),url:i(s.url)});n.slack&&(n.slack=Array.isArray(n.slack)?n.slack.map(s=>o(s)):o(n.slack)),n.discord&&(n.discord=Array.isArray(n.discord)?n.discord.map(s=>t(s)):t(n.discord)),n.webhook&&(n.webhook=Array.isArray(n.webhook)?n.webhook.map(s=>e(s)):e(n.webhook))}return a},g=r=>r&&r.map(a=>d(a)),b=(r,a,n)=>{const o=r.printConfig;if(o===void 0||o===!1||o==="")return!1;const t=p(o),e=h(a.config),s=e.gitUser?{...e.gitUser,email:e.gitUser.email?"[REDACTED]":e.gitUser.email}:e.gitUser,c={access:e.access,aggregateRelease:e.aggregateRelease,allowCustomCommands:e.allowCustomCommands,baseBranch:e.baseBranch,bumpDevDependencies:e.bumpDevDependencies,bumpMinorPreMajor:e.bumpMinorPreMajor,bumpPatchForMinorPreMajor:e.bumpPatchForMinorPreMajor,changelog:e.changelog,changesDir:e.changesDir,channels:e.channels,defaultManaged:e.defaultManaged,detectCatalogChanges:e.detectCatalogChanges,fixed:g(e.fixed),floatingMajorTag:e.floatingMajorTag,githubHost:e.githubHost,gitlabHost:e.gitlabHost,gitUser:s,httpProxy:e.httpProxy,ignore:e.ignore,include:e.include,linked:g(e.linked),notifications:e.notifications,postPublishCommand:e.postPublishCommand,postVersionCommand:e.postVersionCommand,prePublishCommand:e.prePublishCommand,preVersionCommand:e.preVersionCommand,privatePackages:e.privatePackages,provider:e.provider,publish:e.publish,releaseNoteTemplate:e.releaseNoteTemplate,releaseTagPattern:e.releaseTagPattern,signing:e.signing,snapshot:e.snapshot,successWalk:e.successWalk,updateInternalDependencies:e.updateInternalDependencies,versionPr:e.versionPr};return t&&(c.__resolved__={branch:a.branch,channel:a.channel,cwd:a.cwd,packageCount:a.packages.length,packageManager:a.pm.id,packageNames:a.packages.map(l=>l.name).sort(),perPackageConfigKeys:[...a.perPackageConfig.keys()].sort()}),process.stdout.write(`${JSON.stringify(c,null,2)}
|
|
2
2
|
`),!0};export{b as printConfigIfRequested};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`);for(const[
|
|
3
|
-
`);for(;;){const
|
|
4
|
-
`))}}finally{
|
|
5
|
-
`);for(const[
|
|
6
|
-
`);for(;;){const
|
|
7
|
-
`))}}finally{
|
|
1
|
+
import{createRequire as p}from"node:module";import{F as i}from"../packem_shared/index.server-BAjDJSEu.js";let m;const d=r=>(m??=p(import.meta.url))(r),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=r=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[e,t]=c.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return c.getBuiltinModule(r)}return d(r)},{createInterface:a}=w("node:readline"),l=(r,e)=>new Promise(t=>{r.question(e,n=>{t(n.trim())})}),y=async(r,e=!0)=>{const t=a({input:process.stdin,output:process.stdout});try{const s=await l(t,`${r} ${i(e?"[Y/n]":"[y/N]")} `);return s===""?e:/^y(?:es)?$/i.test(s)}finally{t.close()}},$=async(r,e="")=>{const t=a({input:process.stdin,output:process.stdout});try{const n=e?` ${i(`(${e})`)}`:"",s=await l(t,`${r}${n} `);return s===""?e:s}finally{t.close()}},_=async(r,e)=>{if(e.length===0)throw new Error("selectPrompt called with no options.");const t=a({input:process.stdin,output:process.stdout});try{process.stdout.write(`${r}
|
|
2
|
+
`);for(const[n,s]of e.entries())process.stdout.write(` ${n+1}) ${s.label}
|
|
3
|
+
`);for(;;){const n=await l(t,i(` [1-${e.length}] `)),s=Number.parseInt(n,10);if(!Number.isNaN(s)&&s>=1&&s<=e.length)return e[s-1].value;process.stdout.write(i(` Please enter a number between 1 and ${e.length}.
|
|
4
|
+
`))}}finally{t.close()}},b=async(r,e)=>{if(e.length===0)throw new Error("multiSelectPrompt called with no options.");const t=a({input:process.stdin,output:process.stdout});try{process.stdout.write(`${r}
|
|
5
|
+
`);for(const[n,s]of e.entries())process.stdout.write(` ${n+1}) ${s.label}
|
|
6
|
+
`);for(;;){const u=(await l(t,i(" Comma-separated indices (e.g. 1,3,4): "))).split(",").map(o=>o.trim()).filter(Boolean).map(o=>Number.parseInt(o,10));if(u.every(o=>!Number.isNaN(o)&&o>=1&&o<=e.length))return u.map(o=>e[o-1].value);process.stdout.write(i(` Please enter comma-separated numbers between 1 and ${e.length}.
|
|
7
|
+
`))}}finally{t.close()}};export{y as confirmPrompt,b as multiSelectPrompt,_ as selectPrompt,$ as textPrompt};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{p as o}from"./cli-main.js";import{r as
|
|
2
|
-
`);return}const a=[
|
|
3
|
-
`);return}o.success(`Removed ${
|
|
1
|
+
import{p as o}from"./cli-main.js";import{r as f}from"../packem_shared/advisories-DZd1uGqa.js";const d=async({fs:c,logger:u,options:r,workspaceRoot:t})=>{if(!t)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const e=r.db??f(t),s=r.format==="json";if(!r.force){o.warn(`Prune is destructive. Will remove: ${e}`),o.info("Re-run with --force to proceed."),s&&process.stdout.write(`${JSON.stringify({dbPath:e,reason:"needs --force",removed:!1})}
|
|
2
|
+
`);return}const a=[e,`${e}-wal`,`${e}-shm`,`${e}-journal`],i=[];for(const n of a)try{await c.rm(n,{force:!0}),i.push(n)}catch{}if(s){process.stdout.write(`${JSON.stringify({dbPath:e,files:i,removed:!0})}
|
|
3
|
+
`);return}o.success(`Removed ${e}.`)},v=d;export{v as advisoriesPruneExecute};
|