@visulima/vis 3.0.0 → 3.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/LICENSE.md +5307 -4249
- 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 +21 -21
- package/dist/packem_chunks/handler68.js +21 -21
- package/dist/packem_chunks/handler69.js +30 -30
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +9 -9
- 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 +803 -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-CyDqzi5j.js +1 -0
- package/dist/packem_shared/affected-selection-DPQR-Bd3.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-wafzkjaB.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-C_ezHg8b.js +4 -0
- package/dist/packem_shared/dependency-scan-DBH2Qo4I.js +1 -0
- package/dist/packem_shared/docker-Br_iFmI-.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-CVyyR7x8.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-CwSgbeN7.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-BjJN8kWj.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-5wDAoZ1e.js +2 -0
- package/dist/packem_shared/otelPlugin-D8LL2-4L.js +1 -0
- package/dist/packem_shared/package-version-BJkg7-6H.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-BeREbPMI.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-COmP7eqr.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-RZOHbGrE.js +1 -0
- package/dist/packem_shared/scan-progress-C9nMDLis.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-D1xbylFw.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-D8ppc5kr.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-jhNwmkZp.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 +9 -9
- 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,3 +1,3 @@
|
|
|
1
|
-
const
|
|
2
|
-
`)}},
|
|
3
|
-
`)}},
|
|
1
|
+
const l=s=>s.config.plugins??[],a=async(s,i)=>{for(const e of l(s))e.applyDraft&&await e.applyDraft({...s,plan:i})},n=async(s,i)=>{for(const e of l(s)){if(!e.willPublish)continue;if(await e.willPublish({...s,package:i})===!1)return{by:e.name,skip:!0}}return{skip:!1}},t=async(s,i)=>{for(const e of l(s))if(e.afterPublish)try{await e.afterPublish({...s,package:i})}catch(r){process.stderr.write(`[vis release] plugin "${e.name}" afterPublish(${i.name}) failed: ${r.message}
|
|
2
|
+
`)}},o=async(s,i)=>{for(const e of l(s))if(e.afterPublishAll)try{await e.afterPublishAll({...s,result:i})}catch(r){process.stderr.write(`[vis release] plugin "${e.name}" afterPublishAll failed: ${r.message}
|
|
3
|
+
`)}},f=s=>s;export{f as defineReleasePlugin,o as runAfterPublishAllHooks,t as runAfterPublishHooks,a as runApplyDraftHooks,n as runWillPublishHooks};
|
|
@@ -1,3 +1,8 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
|
|
3
|
-
|
|
1
|
+
import{createRequire as w}from"node:module";let $;const x=c=>($??=w(import.meta.url))(c),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,O=c=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[t,e]=g.versions.node.split(".").map(Number);if(t>22||t===22&&e>=3||t===20&&e>=16)return g.getBuiltinModule(c)}return x(c)},{basename:P}=O("node:path"),R=c=>{const t=[],e=[];for(const r of c??[]){if(typeof r=="string"){t.push(r);continue}if(r.path){const a=r.label??r.name;t.push(a?`${r.path}#${a}`:r.path)}else if(r.linkUrl){const a=r.label??r.name??r.linkUrl;e.push(`- [${a}](${r.linkUrl})`)}}return{linkAppendix:e.length>0?`
|
|
2
|
+
|
|
3
|
+
### Additional links
|
|
4
|
+
|
|
5
|
+
${e.join(`
|
|
6
|
+
`)}`:"",paths:t}},k=(c,t)=>{if(c!==0)return[];try{return JSON.parse(t).filter(s=>typeof s.body=="string").map(s=>({body:s.body??"",id:s.id}))}catch{return[]}};class C{id="github";host;httpProxy;constructor(t={}){this.host=t.host,this.httpProxy=t.httpProxy}runOpts(t){if(!this.host&&!this.httpProxy)return{cwd:t,silent:!0};const e={...process.env};return this.host&&(e.GH_HOST=this.host),this.httpProxy&&(e.HTTPS_PROXY=this.httpProxy,e.HTTP_PROXY=this.httpProxy),{cwd:t,env:e,silent:!0}}async listRecentReleases(t,e){const s=Math.max(1,e.limit),r=e.tagPrefix?Math.min(100,s*4):s,a=await t.run("gh",["release","list","--repo",e.repo,"--limit",String(r),"--json","tagName,url,name"],this.runOpts(e.cwd));if(a.exitCode!==0)return[];let i;try{i=JSON.parse(a.stdout)}catch{return[]}const n=[];for(const u of i)if(!(typeof u.tagName!="string"||typeof u.url!="string")&&!(e.tagPrefix&&!u.tagName.startsWith(e.tagPrefix))&&!(e.excludeTag&&u.tagName===e.excludeTag)&&(n.push({name:u.name??u.tagName,tag:u.tagName,url:u.url}),n.length>=s))break;return n}async detectRepoSlug(t,e){const s=await e.run("gh",["repo","view","--json","nameWithOwner","-q",".nameWithOwner"],this.runOpts(t));if(s.exitCode===0)return s.stdout.trim()||void 0}detectPullRequestNumber(t){const e=t.GITHUB_REF;if(e){const r=/^refs\/pull\/(\d+)\/(?:merge|head)$/.exec(e);if(r?.[1])return Number.parseInt(r[1],10)}const s=t.PR_NUMBER??t.VIS_PR_NUMBER;if(s){const r=Number.parseInt(s,10);return Number.isNaN(r)?void 0:r}}async upsertStickyComment(t,e){const s=await t.run("gh",["api",`repos/${e.repo}/issues/${e.issueNumber}/comments`,"--paginate"],this.runOpts(e.cwd)),a=k(s.exitCode,s.stdout).find(u=>u.body.includes(e.marker)),i=e.body.includes(e.marker)?e.body:`${e.marker}
|
|
7
|
+
${e.body}`;if(a)return(await t.run("gh",["api","-X","PATCH",`repos/${e.repo}/issues/comments/${a.id}`,"-f",`body=${i}`],this.runOpts(e.cwd))).exitCode===0?{created:!1,id:a.id}:void 0;const n=await t.run("gh",["api","-X","POST",`repos/${e.repo}/issues/${e.issueNumber}/comments`,"-f",`body=${i}`],this.runOpts(e.cwd));if(n.exitCode===0)try{return{created:!0,id:JSON.parse(n.stdout).id}}catch{return}}async createRelease(t,e){const{linkAppendix:s,paths:r}=R(e.assets),a=s?`${e.body}${s}`:e.body,i=["release","create",e.tag,"--repo",e.repo,"--title",e.title,"--notes",a];e.draft&&i.push("--draft"),e.prerelease&&i.push("--prerelease"),e.discussionCategory&&i.push("--discussion-category",e.discussionCategory),r.length>0&&i.push(...r);const n=await t.run("gh",i,this.runOpts(e.cwd));if(n.exitCode===0)return{url:n.stdout.trim()||void 0}}async addLabels(t,e){if(e.labels.length===0)return!0;const s=["api","-X","POST",`repos/${e.repo}/issues/${e.issueNumber}/labels`];for(const a of e.labels)s.push("-f",`labels[]=${a}`);return(await t.run("gh",s,this.runOpts(e.cwd))).exitCode===0}async upsertIssue(t,e){const s=await t.run("gh",["issue","list","--repo",e.repo,"--state","open","--search",e.marker,"--json","number,title,url","--limit","20"],this.runOpts(e.cwd));if(s.exitCode===0&&s.stdout.trim()&&s.stdout.trim()!=="[]")try{const d=JSON.parse(s.stdout).find(l=>l.title.includes(e.marker));if(d){const l=["issue","edit",String(d.number),"--repo",e.repo,"--title",e.title,"--body",e.body];return e.labels&&e.labels.length>0&&l.push("--add-label",e.labels.join(",")),e.assignees&&e.assignees.length>0&&l.push("--add-assignee",e.assignees.join(",")),(await t.run("gh",l,this.runOpts(e.cwd))).exitCode===0?{created:!1,number:d.number,url:d.url}:void 0}}catch{}const r=["issue","create","--repo",e.repo,"--title",e.title,"--body",e.body];e.labels&&e.labels.length>0&&r.push("--label",e.labels.join(",")),e.assignees&&e.assignees.length>0&&r.push("--assignee",e.assignees.join(","));const a=await t.run("gh",r,this.runOpts(e.cwd));if(a.exitCode!==0)return;const i=a.stdout.trim(),n=/\/issues\/(\d+)/.exec(i);return n?{created:!0,number:Number.parseInt(n[1]??"0",10),url:i}:void 0}async closeIssue(t,e){return e.closingComment&&await t.run("gh",["issue","comment",String(e.issueNumber),"--repo",e.repo,"--body",e.closingComment],this.runOpts(e.cwd)),(await t.run("gh",["issue","close",String(e.issueNumber),"--repo",e.repo],this.runOpts(e.cwd))).exitCode===0}async upsertPullRequest(t,e){const s=await t.run("gh",["pr","list","--repo",e.repo,"--head",e.head,"--state","open","--json","number,url"],this.runOpts(e.cwd));if(s.exitCode===0&&s.stdout.trim()&&s.stdout.trim()!=="[]")try{const i=JSON.parse(s.stdout);if(i[0])return await t.run("gh",["pr","edit",String(i[0].number),"--repo",e.repo,"--title",e.title,"--body",e.body],this.runOpts(e.cwd)),{existing:!0,number:i[0].number,url:i[0].url}}catch{}const r=await t.run("gh",["pr","create","--repo",e.repo,"--head",e.head,"--base",e.base,"--title",e.title,"--body",e.body],this.runOpts(e.cwd));if(r.exitCode!==0)return;const a=/\/pull\/(\d+)/.exec(r.stdout);return a?{existing:!1,number:Number.parseInt(a[1]??"0",10),url:r.stdout.trim()}:void 0}}const h=c=>encodeURIComponent(c),N=c=>c.replace(/^v(?=\d)/,""),_=c=>{const t=[],e=[],s=[];for(const r of c??[]){if(typeof r=="string"){t.push(r);continue}r.path?r.target==="generic_package"?s.push({label:r.label,linkType:r.type,name:r.name,packageName:r.packageName,packageVersion:r.packageVersion,path:r.path}):t.push(r.path):r.linkUrl&&e.push({linkType:r.type,name:r.label??r.name??r.linkUrl,url:r.linkUrl})}return{genericPackages:s,links:e,uploads:t}};class p{id="gitlab";static recentReleasesWarned=!1;async listRecentReleases(t,e){return p.recentReleasesWarned||(p.recentReleasesWarned=!0,console.warn("[vis release] addReleases is not yet supported on GitLab — skipping the Related releases block.")),[]}host;httpProxy;constructor(t={}){this.host=t.host,this.httpProxy=t.httpProxy}runOpts(t){if(!this.host&&!this.httpProxy)return{cwd:t,silent:!0};const e={...process.env};return this.host&&(e.GITLAB_HOST=this.host),this.httpProxy&&(e.HTTPS_PROXY=this.httpProxy,e.HTTP_PROXY=this.httpProxy),{cwd:t,env:e,silent:!0}}async listMrNotes(t,e,s,r){const a=await t.run("glab",["api",`projects/${h(s)}/merge_requests/${r}/notes`,"--paginate"],this.runOpts(e));if(a.exitCode!==0)return[];try{return JSON.parse(a.stdout).filter(n=>typeof n.body=="string"&&n.system!==!0).map(n=>({body:n.body??"",id:n.id}))}catch{return[]}}async uploadGenericPackage(t,e,s,r,a){const i=h(s),n=P(a.path),u=a.packageName??s.split("/").pop()??"release",d=a.packageVersion??N(r),l=`projects/${i}/packages/generic/${encodeURIComponent(u)}/${encodeURIComponent(d)}/${encodeURIComponent(n)}`;if((await t.run("glab",["api","-X","PUT",l,"--input",a.path],this.runOpts(e))).exitCode!==0)return;const b=this.host?.replace(/^https?:\/\//i,"").replace(/\/+$/,""),m=`${b?`https://${b}`:"https://gitlab.com"}/api/v4/${l}`,y=["api","-X","POST",`projects/${i}/releases/${encodeURIComponent(r)}/assets/links`,"-f",`name=${a.label??a.name??n}`,"-f",`url=${m}`];a.linkType&&y.push("-f",`link_type=${a.linkType}`),await t.run("glab",y,this.runOpts(e))}async detectRepoSlug(t,e){const s=process.env.CI_PROJECT_PATH;if(s)return s;const r=await e.run("git",["config","--get","remote.origin.url"],{cwd:t,silent:!0});if(r.exitCode!==0)return;const a=r.stdout.trim();return/gitlab\.[\w.-]+[/:]([^/].*?)(?:\.git)?$/.exec(a)?.[1]}detectPullRequestNumber(t){const e=t.CI_MERGE_REQUEST_IID??t.VIS_MR_NUMBER;if(!e)return;const s=Number.parseInt(e,10);return Number.isNaN(s)?void 0:s}async upsertStickyComment(t,e){const r=(await this.listMrNotes(t,e.cwd,e.repo,e.issueNumber)).find(u=>u.body.includes(e.marker)),a=e.body.includes(e.marker)?e.body:`${e.marker}
|
|
8
|
+
${e.body}`,i=h(e.repo);if(r)return(await t.run("glab",["api","-X","PUT",`projects/${i}/merge_requests/${e.issueNumber}/notes/${r.id}`,"-f",`body=${a}`],this.runOpts(e.cwd))).exitCode===0?{created:!1,id:r.id}:void 0;const n=await t.run("glab",["api","-X","POST",`projects/${i}/merge_requests/${e.issueNumber}/notes`,"-f",`body=${a}`],this.runOpts(e.cwd));if(n.exitCode===0)try{return{created:!0,id:JSON.parse(n.stdout).id}}catch{return}}async createRelease(t,e){const{genericPackages:s,links:r,uploads:a}=_(e.assets),i=["release","create",e.tag,"--repo",e.repo,"--name",e.title,"--notes",e.body];if(e.milestones&&e.milestones.length>0)for(const l of e.milestones)i.push("--milestone",l);if((await t.run("glab",i,this.runOpts(e.cwd))).exitCode!==0)return;a.length>0&&await t.run("glab",["release","upload",e.tag,"--repo",e.repo,...a],this.runOpts(e.cwd));const u=h(e.repo);for(const l of r){const o=["api","-X","POST",`projects/${u}/releases/${encodeURIComponent(e.tag)}/assets/links`,"-f",`name=${l.name}`,"-f",`url=${l.url}`];l.linkType&&o.push("-f",`link_type=${l.linkType}`),await t.run("glab",o,this.runOpts(e.cwd))}for(const l of s)await this.uploadGenericPackage(t,e.cwd,e.repo,e.tag,l);const d=await t.run("glab",["api",`projects/${u}/releases/${encodeURIComponent(e.tag)}`],this.runOpts(e.cwd));try{return{url:JSON.parse(d.stdout)._links?.self}}catch{return{url:void 0}}}async addLabels(t,e){if(e.labels.length===0)return!0;const s=h(e.repo);return(await t.run("glab",["api","-X","PUT",`projects/${s}/issues/${e.issueNumber}`,"-f",`add_labels=${e.labels.join(",")}`],this.runOpts(e.cwd))).exitCode===0}async upsertIssue(t,e){const s=h(e.repo),r=await t.run("glab",["api",`projects/${s}/issues?state=opened&search=${encodeURIComponent(e.marker)}&in=title`],this.runOpts(e.cwd));if(r.exitCode===0)try{const l=JSON.parse(r.stdout).find(o=>o.title.includes(e.marker));if(l){const o=["api","-X","PUT",`projects/${s}/issues/${l.iid}`,"-f",`title=${e.title}`,"-f",`description=${e.body}`];if(e.labels&&e.labels.length>0&&o.push("-f",`add_labels=${e.labels.join(",")}`),e.assignees?.[0]){const f=await t.run("glab",["api",`users?username=${encodeURIComponent(e.assignees[0])}`],this.runOpts(e.cwd));try{const m=JSON.parse(f.stdout);m[0]&&o.push("-f",`assignee_id=${m[0].id}`)}catch{}}return(await t.run("glab",o,this.runOpts(e.cwd))).exitCode===0?{created:!1,number:l.iid,url:l.web_url}:void 0}}catch{}const a=["issue","create","--repo",e.repo,"--title",e.title,"--description",e.body,"--yes"];e.labels&&e.labels.length>0&&a.push("--label",e.labels.join(",")),e.assignees?.[0]&&a.push("--assignee",e.assignees[0]);const i=await t.run("glab",a,this.runOpts(e.cwd));if(i.exitCode!==0)return;const n=i.stdout.trim(),u=/\/issues\/(\d+)/.exec(n);return u?{created:!0,number:Number.parseInt(u[1]??"0",10),url:n}:void 0}async closeIssue(t,e){if(e.closingComment){const r=h(e.repo);await t.run("glab",["api","-X","POST",`projects/${r}/issues/${e.issueNumber}/notes`,"-f",`body=${e.closingComment}`],this.runOpts(e.cwd))}return(await t.run("glab",["issue","close",String(e.issueNumber),"--repo",e.repo],this.runOpts(e.cwd))).exitCode===0}async upsertPullRequest(t,e){const s=h(e.repo),r=await t.run("glab",["api",`projects/${s}/merge_requests?state=opened&source_branch=${encodeURIComponent(e.head)}&target_branch=${encodeURIComponent(e.base)}`],this.runOpts(e.cwd));if(r.exitCode===0)try{const u=JSON.parse(r.stdout);if(u[0])return(await t.run("glab",["api","-X","PUT",`projects/${s}/merge_requests/${u[0].iid}`,"-f",`title=${e.title}`,"-f",`description=${e.body}`],this.runOpts(e.cwd))).exitCode===0?{existing:!0,number:u[0].iid,url:u[0].web_url}:void 0}catch{}const a=await t.run("glab",["mr","create","--repo",e.repo,"--source-branch",e.head,"--target-branch",e.base,"--title",e.title,"--description",e.body,"--yes"],this.runOpts(e.cwd));if(a.exitCode!==0)return;const i=a.stdout.trim(),n=/\/merge_requests\/(\d+)/.exec(i);return n?{existing:!1,number:Number.parseInt(n[1]??"0",10),url:i}:void 0}}const v=c=>{if(c.GITHUB_ACTIONS==="true"||c.GITHUB_REPOSITORY)return"github";if(c.GITLAB_CI==="true"||c.CI_PROJECT_PATH)return"gitlab"},T=c=>{const t=c.trim();if(t!==""){if(!t.includes("://")){const e=t.indexOf(":"),s=t.indexOf("/");if(e>0&&(s===-1||e<s)){const r=t.slice(0,e),a=r.lastIndexOf("@");return(a===-1?r:r.slice(a+1)).toLowerCase()||void 0}return}try{return new URL(t).hostname.toLowerCase()||void 0}catch{return}}},j=async(c,t)=>{const e=await t.run("git",["config","--get","remote.origin.url"],{cwd:c,silent:!0});if(e.exitCode!==0)return;const s=T(e.stdout);if(s){if(s==="github.com"||s.endsWith(".github.com"))return"github";if(s==="gitlab.com"||s.startsWith("gitlab."))return"gitlab"}},S=async(c,t,e,s=process.env)=>{if(e&&e!=="auto"){if(e==="github"||e==="gitlab")return e;throw new Error(`Unsupported release.provider: ${e}. Expected "github", "gitlab", or "auto".`)}return v(s)??await j(c,t)??"github"},U=(c,t={})=>c==="gitlab"?new p({host:t.gitlabHost,httpProxy:t.httpProxy}):new C({host:t.githubHost,httpProxy:t.httpProxy});export{U as createRemoteClient,S as detectRemoteProvider};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import n from"react-devtools-core";const s=async()=>new Promise(
|
|
1
|
+
import n from"react-devtools-core";const s=async()=>new Promise(o=>{const e=new WebSocket("ws://localhost:8097"),t=setTimeout(()=>{e.close(),o(!1)},2e3);t.unref(),e.addEventListener("open",()=>{clearTimeout(t),e.close(),o(!0)}),e.addEventListener("error",()=>{clearTimeout(t),o(!1)})});await s()?(n.initialize(),n.connectToDevTools()):console.warn(`DEV is set to true, but the React DevTools server is not running. Start it with:
|
|
2
2
|
|
|
3
3
|
$ npx react-devtools
|
|
4
4
|
`);
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{expandNotificationTemplate as
|
|
2
|
-
`);if(
|
|
3
|
-
`)}return
|
|
4
|
-
`).slice(0,1024);
|
|
1
|
+
import{expandNotificationTemplate as c}from"./interface.js";const d=4096,h=3800,p=n=>n.url?`• [\`${n.name}@${n.version}\`](${n.url})`:`• \`${n.name}@${n.version}\``,f=n=>{const e=n.published.map(t=>p(t));let o=e.join(`
|
|
2
|
+
`);if(o.length>h){let t=0;const i=[];for(const r of e){if(t+r.length+1>h){i.push(`*… +${e.length-i.length} more*`);break}i.push(r),t+=r.length+1}o=i.join(`
|
|
3
|
+
`)}return o.slice(0,d)};class m{constructor(e){this.config=e,this.id=e.id?`discord:${e.id}`:"discord"}config;id;async send(e){const o=this.config.title?c(this.config.title,e):`🚀 Released ${e.published.length} package${e.published.length===1?"":"s"}`,t={color:this.config.color??3900150,description:f(e),fields:[],timestamp:e.completedAt,title:o},i=[];if(e.channel&&i.push({inline:!0,name:"Channel",value:`\`${e.channel}\``}),e.repo&&i.push({inline:!0,name:"Repository",value:`[${e.repo}](https://github.com/${e.repo})`}),e.skipped.length>0&&this.config.includeSkipped!==!1){const s=e.skipped.map(l=>`\`${l.name}\` — ${l.reason}`).join(`
|
|
4
|
+
`).slice(0,1024);i.push({inline:!1,name:`Skipped (${e.skipped.length})`,value:s})}i.length>0&&(t.fields=i);const r={...this.config.username?{username:this.config.username}:{},...this.config.avatarUrl?{avatar_url:this.config.avatarUrl}:{},embeds:[t]};let a;try{a=await fetch(this.config.webhook,{body:JSON.stringify(r),headers:{"Content-Type":"application/json"},method:"POST"})}catch(s){const l=s instanceof Error?s.name:"NetworkError";throw new Error(`Discord webhook fetch failed (${l})`,{cause:s})}if(!a.ok){const s=await a.text().catch(()=>"");throw new Error(`Discord webhook returned ${a.status} ${a.statusText}${s?`: ${s.slice(0,200)}`:""}`)}}}export{m as DiscordNotificationChannel};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as m}from"node:module";import{
|
|
2
|
-
`),process.exit(1));const
|
|
3
|
-
`),process.exit(1));const
|
|
4
|
-
`),process.exit(1));const
|
|
1
|
+
import{createRequire as m}from"node:module";import{e as p,m as g}from"../packem_shared/index-DHD8wb6Z.js";let l;const f=e=>(l??=m(import.meta.url))(e),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=e=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[n,s]=c.versions.node.split(".").map(Number);if(n>22||n===22&&s>=3||n===20&&s>=16)return c.getBuiltinModule(e)}return f(e)},{spawnSync:h}=u("node:child_process"),{readFileSync:y,statSync:_}=u("node:fs"),d={npm:{pm:"npm",runner:!1},npx:{pm:"npm",runner:!0},pnpm:{pm:"pnpm",runner:!1},pnpx:{pm:"pnpm",runner:!0},yarn:{pm:"yarn",runner:!1},yarnpkg:{pm:"yarn",runner:!1}},v=new Set(["create","dlx","exec","init"]),a=e=>{try{return _(e).isFile()}catch{return!1}},S=e=>e==="npm"||e==="pnpm"||e==="yarn"?e:void 0,w=e=>{const n=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"]];let s=e;for(;;){const t=p(s,"package.json");if(a(t))try{const o=JSON.parse(y(t,"utf8")).packageManager;if(typeof o=="string"&&o.length>0){const i=S(o.split("@")[0]);if(i!==void 0)return i}}catch{}for(const[o,i]of n)if(a(p(s,o)))return i;const r=g(s);if(r===s)return;s=r}},x=()=>process.env.npm_config_user_agent!==void 0||process.env.npm_execpath!==void 0,j=(e,n,s,t)=>{const r=d[e];if(r===void 0)return"dispatch";const o=r.runner||s!==void 0&&v.has(s);return n!==void 0&&r.pm!==n&&!o&&!t?"refuse":"dispatch"},$=e=>{const n=process.platform==="win32"?[`${e}.cmd`,`${e}.exe`,e]:[e];for(const s of(process.env.PATH??"").split(process.platform==="win32"?";":":"))if(!(s===""||s.replace(/[/\\]+$/u,"").endsWith(p(".vis","shims"))))for(const t of n){const r=p(s,t);if(a(r))return r}},R=(e,n)=>{d[e]===void 0&&(process.stderr.write(`vis: ${e} is not a known package-manager shim.
|
|
2
|
+
`),process.exit(1));const t=w(process.cwd());j(e,t,n[0],x())==="refuse"&&(process.stderr.write(`vis: this project uses ${String(t)}, but \`${e}\` was run. Use \`${String(t)}\` instead, or run \`vis shim uninstall\` to disable the PM guard.
|
|
3
|
+
`),process.exit(1));const r=$(e);r===void 0&&(process.stderr.write(`vis: \`${e}\` was not found on PATH (outside the shim dir).
|
|
4
|
+
`),process.exit(1));const o=h(r,n,{stdio:"inherit"});process.exit(o.status??(o.signal===null?0:1))};export{j as decideShim,R as dispatchShim};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`)},
|
|
1
|
+
import{J as l,X as u,q as f,F as n,D as m,r as d}from"../packem_shared/index.server-CwSgbeN7.js";import{resolveTurboEnvCompat as b,ReapiRemoteCache as g}from"@visulima/task-runner";import{p as k}from"./cli-main.js";const $=(t,e)=>e==="http"||e==="reapi"?e:t.startsWith("grpc://")||t.startsWith("grpcs://")?"reapi":"http",w=async(t,e)=>{const r=Date.now(),o=new AbortController,a=setTimeout(()=>{o.abort()},e);try{const s=await fetch(t,{method:"HEAD",signal:o.signal});return{backend:"http",durationMs:Date.now()-r,httpStatus:s.status,ok:!0,url:t}}catch(s){return{backend:"http",durationMs:Date.now()-r,error:s instanceof Error?s.message:String(s),ok:!1,url:t}}finally{clearTimeout(a)}},y=async(t,e)=>{const r=Date.now(),o=new g({...t,timeout:e});try{return{backend:"reapi",capabilities:await o.probeCapabilities(),durationMs:Date.now()-r,ok:!0,url:t.url}}catch(a){return{backend:"reapi",durationMs:Date.now()-r,error:a instanceof Error?a.message:String(a),ok:!1,url:t.url}}finally{try{await o.close()}catch{}}},S=t=>{const e=[],r=t.ok?l("OK"):u("FAIL");if(e.push(`${f("Remote cache")} ${r}`),e.push(` ${n("URL:")} ${m(t.url)}`),e.push(` ${n("Backend:")} ${t.backend}`),e.push(` ${n("Latency:")} ${String(t.durationMs)}ms`),t.httpStatus!==void 0&&e.push(` ${n("Status:")} ${String(t.httpStatus)}`),t.capabilities){const o=t.capabilities.digestFunctions.length>0?t.capabilities.digestFunctions.join(", "):d("(none advertised)");e.push(` ${n("Digests:")} ${o}`),e.push(` ${n("Batch:")} ${String(t.capabilities.maxBatchTotalSizeBytes)} bytes`)}return t.error&&e.push(` ${n("Error:")} ${u(t.error)}`),e.join(`
|
|
2
|
+
`)},A=async({logger:t,options:e,visConfig:r})=>{const a=b((r??{}).taskRunner?.remoteCache),i=e.url??a?.url,h=e.format??"table",p=e.timeout??5e3;if(!i){k.error("No remote cache configured. Set taskRunner.remoteCache.url in vis.config.ts, pass --url=..., or export TURBO_API."),process.exitCode=1;return}const c=$(i,e.backend)==="reapi"?await y({...a??{url:i},backend:"reapi",url:i},p):await w(i,p);h==="json"?t.log(JSON.stringify(c,null,2)):t.log(S(c)),c.ok||(process.exitCode=1)};export{A as cacheDoctorExecute};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`);let t=!1,
|
|
3
|
-
`),warnings:
|
|
1
|
+
import{createRequire as I}from"node:module";import{VisReleaseError as R}from"../packem_shared/VisReleaseError-DZtgcKf8.js";let E;const N=e=>(E??=I(import.meta.url))(e),$=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=e=>{if(typeof $<"u"&&$.versions&&$.versions.node){const[r,s]=$.versions.node.split(".").map(Number);if(r>22||r===22&&s>=3||r===20&&s>=16)return $.getBuiltinModule(e)}return N(e)},{readFile:O}=k("node:fs/promises"),{isAbsolute:v,join:_}=k("node:path"),T="x-release-please-version",A=e=>e.type==="annotation",b=e=>!A(e),j=(e,r)=>{if(!b(e))throw new R({code:"CONFIG_INVALID",message:`extra-files rule at ${r} has type="${e.type}" — compileRule is regex-only.`});try{return new RegExp(e.search,e.flags??"g")}catch(s){throw new R({cause:s,code:"CONFIG_INVALID",message:`Invalid extra-files regex at ${r}.search: ${s.message}`})}},M=(e,r,s)=>e.replaceAll("{version}",r).replaceAll("{name}",s).replaceAll("{packageName}",s),F=/\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?/,y=(e,r)=>{let s=0;if(r!==void 0){const f=e.indexOf(r);if(f===-1)return;s=f+r.length}const p=e.slice(s),o=F.exec(p);if(o)return{index:s+o.index,match:o[0]}},L=(e,r,s,p,o)=>{const f=e.marker??T,a=[],l=r.split(`
|
|
2
|
+
`);let t=!1,i=!1;for(let n=0;n<l.length;n++){const c=l[n];if(!c.includes(f))continue;if(t=!0,c.slice(0,c.indexOf(f)).replace(/^\s*(?:#|\/\/|\/\*|--|<!--)\s*$/,"").trim()===""){const u=n+1,d=l[u];if(d===void 0){a.push(`extra-files: ${p}[${e.path}] annotation marker on the last line of ${o} (no following line to update).`);continue}const m=y(d,e.anchor);if(!m){a.push(e.anchor===void 0?`extra-files: ${p}[${e.path}] annotation marker at ${o}:${n+1} but no semver-shaped substring on the following line.`:`extra-files: ${p}[${e.path}] annotation marker at ${o}:${n+1} but anchor "${e.anchor}" / no semver-shaped substring after it on the following line.`);continue}l[u]=d.slice(0,m.index)+s+d.slice(m.index+m.match.length),i=!0}else{const u=y(c,e.anchor);if(!u){a.push(e.anchor===void 0?`extra-files: ${p}[${e.path}] annotation marker at ${o}:${n+1} but no semver-shaped substring on the marked line.`:`extra-files: ${p}[${e.path}] annotation marker at ${o}:${n+1} but anchor "${e.anchor}" / no semver-shaped substring after it on the marked line.`);continue}l[n]=c.slice(0,u.index)+s+c.slice(u.index+u.match.length),i=!0}}return t?i?{content:l.join(`
|
|
3
|
+
`),warnings:a}:{warnings:a}:(a.push(`extra-files: ${p}[${e.path}] annotation marker "${f}" not found in ${o}; rule may be stale.`),{warnings:a})},q=async(e,r,s,p,o)=>{let f;try{f=await O(e,"utf8")}catch(t){return t.code==="ENOENT"?{warnings:[`extra-files: ${o} → ${e} does not exist; skipping ${r.length} rule(s).`]}:{warnings:[`extra-files: ${o} → could not read ${e}: ${t.message}`]}}let a=f;const l=[];for(const t of r){if(A(t)){const g=L(t,a,s,o,e);l.push(...g.warnings),g.content!==void 0&&(a=g.content);continue}const i=j(t,`${o}[${t.path}]`),n=t.replace===void 0?s:M(t.replace,s,p);let c=!1;const h=a.replace(i,(g,...x)=>(c=!0,t.replace===void 0?n:n.replaceAll(/\$([&$1-9])/g,(u,d)=>{if(d==="&")return g;if(d==="$")return"$";const m=Number.parseInt(d,10)-1,w=x[m];return typeof w=="string"?w:""})));if(!c){l.push(`extra-files: ${o}[${t.path}] regex /${t.search}/${t.flags??"g"} matched nothing in ${e}; rule may be stale.`);continue}a=h}return a===f?{warnings:l}:{content:a,warnings:l}},G=async(e,r,s,p,o=[],f=[])=>{const a=[],l=[],t=new Map;for(const i of o){const n=v(i.path)?i.path:_(e,i.path),c=t.get(n)??{label:"workspace",rules:[]};c.rules.push(i),t.set(n,c)}for(const i of f){const n=v(i.path)?i.path:_(r,i.path),c=t.get(n)??{label:"per-package",rules:[]};c.rules.push(i),t.set(n,c)}for(const[i,n]of t){const c=n.rules[0],h=await q(i,n.rules,s,p,n.label);l.push(...h.warnings),h.content!==void 0&&a.push({content:h.content,path:i,rule:c})}return{warnings:l,writes:a}};export{T as DEFAULT_ANNOTATION_MARKER,G as applyExtraFilesForRelease,j as compileRule};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`);if(
|
|
3
|
-
`);e.push(""),e.push(
|
|
4
|
-
`))e.push(
|
|
5
|
-
`))e.push(
|
|
6
|
-
`)},
|
|
7
|
-
`)},
|
|
8
|
-
`)}else{
|
|
9
|
-
`):(
|
|
10
|
-
`),process.exitCode=1;return}const
|
|
11
|
-
`),
|
|
1
|
+
import{createRequire as T}from"node:module";import{q as $,F as b,r as P,D,X as S,J as k}from"../packem_shared/index.server-CwSgbeN7.js";import{a as N}from"../packem_shared/index-DHD8wb6Z.js";import{a as L,r as B,b as y,c as M}from"../packem_shared/ai-fix-6nXZbecQ.js";import{p as c}from"./cli-main.js";import{l as _}from"../packem_shared/failure-log-D92tM0ie.js";let A;const O=s=>(A??=T(import.meta.url))(s),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,q=s=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[t,i]=d.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return d.getBuiltinModule(s)}return O(s)},{createInterface:J}=q("node:readline"),U={"ambiguous-match":"ambiguous match",applied:"applied",error:"error","missing-file":"missing file","no-match":"no match","outside-workspace":"outside workspace"},j=(s,t,i)=>{const e=M(s,t,i),r=N(s,e);return r===""||r.startsWith("..")?e:r},W=(s,t,i)=>{const e=[$(`Fix proposal (${s.provider}, confidence: ${s.confidence})`),"",s.explanation||b("<no explanation>")];if(s.cannotFix)return e.push(""),e.push(P(`Cannot fix automatically: ${s.cannotFix}`)),e.join(`
|
|
2
|
+
`);if(s.patches.length===0)return e.push(""),e.push(P("No patches were proposed.")),e.join(`
|
|
3
|
+
`);e.push(""),e.push($(`Patches (${String(s.patches.length)}):`));for(const[r,o]of s.patches.entries()){const a=j(t,i,o.file);e.push(""),e.push(D(`[${String(r+1)}] ${a}`)),o.reason&&e.push(b(` reason: ${o.reason}`));for(const h of o.oldString.split(`
|
|
4
|
+
`))e.push(S(` - ${h}`));for(const h of o.newString.split(`
|
|
5
|
+
`))e.push(k(` + ${h}`))}return e.join(`
|
|
6
|
+
`)},C=(s,t,i)=>{const e=[];for(const r of s){const o=r.absolutePath?N(t,r.absolutePath)||r.absolutePath:j(t,i,r.patch.file),a=U[r.status];r.status==="applied"?e.push(k(` ✓ ${o}: ${a}`)):e.push(S(` ✗ ${o}: ${a}${r.error?` (${r.error})`:""}`))}return e.join(`
|
|
7
|
+
`)},v=s=>{let t=0,i=0;for(const e of s)e.status==="applied"?t+=1:i+=1;return{applied:t,failed:i}},z=s=>new Promise(t=>{const i=J({input:process.stdin,output:process.stderr});i.question(`${s} (y/N) `,e=>{i.close();const r=e.trim().toLowerCase();t(r==="y"||r==="yes")})}),E=s=>s??process.cwd(),Y=async({argument:s,logger:t,options:i,visConfig:e,workspaceRoot:r})=>{const o=s[0],a=E(r),m=(i.format??"text")==="json";if(!o){if(m){const p=_(a);process.stdout.write(`${JSON.stringify({availableTasks:p,error:"No task ID specified"},void 0,2)}
|
|
8
|
+
`)}else{c.error("No task ID specified. Usage: vis ai fix <project>:<target>");const p=_(a);if(p.length>0){c.info("Tasks with captured failure logs:");for(const f of p)c.info(` - ${f}`)}else c.notice("No failure logs found. Re-run a failing task with `vis run` to capture logs.")}process.exitCode=1;return}const n=await L(a,o,{runId:i.run});if(!n){m?process.stdout.write(`${JSON.stringify({error:"No failure log or run summary found",taskId:o},void 0,2)}
|
|
9
|
+
`):(c.error(`No failure log or run summary found for task "${o}".`),c.notice("Re-run the task with `vis run` so its terminal output and run metadata are captured.")),process.exitCode=1;return}n.terminalOutputCaptured||c.warn(`No captured terminal output for "${o}". Re-run with \`vis run\` for a better fix proposal.`);const F=e?.ai,u=await B(n,t,{cache:i.cache!==!1,config:F});if(!u){m&&process.stdout.write(`${JSON.stringify({error:"AI fix proposal failed or no provider available",taskId:o},void 0,2)}
|
|
10
|
+
`),process.exitCode=1;return}const w=i.apply===!0;if(m){const p=w?void 0:await y(a,n.cwd,u,{dryRun:!0}),f=w?await y(a,n.cwd,u):void 0;if(process.stdout.write(`${JSON.stringify({appliedResults:f,dryRunResults:p,failureContext:{cwd:n.cwd,hash:n.hash,runId:n.runId,taskId:n.taskId,terminalOutputCaptured:n.terminalOutputCaptured},proposal:u},void 0,2)}
|
|
11
|
+
`),w&&f){const{failed:I}=v(f);I>0&&(process.exitCode=1)}return}if(t.info(W(u,a,n.cwd)),u.cannotFix||u.patches.length===0)return;const g=await y(a,n.cwd,u,{dryRun:!0}),x=v(g);if(t.info(""),t.info($("Patch validation:")),t.info(C(g,a,n.cwd)),!w){t.info(""),c.info("Re-run with --apply to write these patches to disk.");return}if(x.applied===0){c.error("No patches can be applied (every patch failed validation)."),process.exitCode=1;return}if(i.yes!==!0&&(t.info(""),!await z(`Apply ${String(x.applied)} patch${x.applied===1?"":"es"} to disk?`))){c.notice("Aborted. Nothing written.");return}const R=await y(a,n.cwd,u),l=v(R);t.info(""),t.info($("Apply results:")),t.info(C(R,a,n.cwd)),t.info(""),l.failed===0?c.success(`Applied ${String(l.applied)} patch${l.applied===1?"":"es"}.`):(c.warn(`${String(l.applied)} applied, ${String(l.failed)} failed.`),process.exitCode=1)};export{Y as aiFix};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{VisReleaseError as
|
|
2
|
-
`)}const
|
|
3
|
-
`)}const
|
|
1
|
+
import{VisReleaseError as n}from"../packem_shared/VisReleaseError-DZtgcKf8.js";const d=async(t,e,r=!0)=>t.runner.run("git",e,{cwd:t.cwd,silent:r}),f=async t=>{const e=await d(t,["rev-parse","--abbrev-ref","HEAD"]);if(e.exitCode!==0)return;const r=e.stdout.trim();return r==="HEAD"||r===""?void 0:r},w=async t=>{const e=await d(t,["rev-parse","HEAD"]);return e.exitCode===0?e.stdout.trim():void 0},C=async t=>{const e=await d(t,["rev-parse","--short","HEAD"]);return e.exitCode===0?e.stdout.trim():void 0},v=async t=>{const e=await d(t,["status","--porcelain"]);return e.exitCode===0&&e.stdout.trim()!==""},A=async(t,e)=>(await d(t,["rev-parse","--verify","--quiet",`refs/tags/${e}`])).exitCode===0,T=async(t,e,r="origin")=>{const s=await d(t,["ls-remote","--tags",r,e]);return s.exitCode===0&&s.stdout.trim()!==""},$=async(t,e,r,s={})=>{if(e.length===0&&!s.allowEmpty)throw new n({code:"CONFIG_INVALID",message:"stageAndCommit called with no files (and allowEmpty=false)."});if(e.length>0){const u=await t.runner.run("git",["add","--",...e],{cwd:t.cwd,silent:!0});if(u.exitCode!==0)throw new n({code:"GIT_OPERATION_FAILED",message:`git add failed: ${u.stderr||u.stdout}`})}const i={...process.env};s.author&&(i.GIT_AUTHOR_NAME=s.author.name,i.GIT_AUTHOR_EMAIL=s.author.email,i.GIT_COMMITTER_NAME=s.author.name,i.GIT_COMMITTER_EMAIL=s.author.email);const o=["commit","-m",r];s.allowEmpty&&o.push("--allow-empty");const a=await t.runner.run("git",o,{cwd:t.cwd,env:i,silent:!0});if(a.exitCode!==0)throw new n({code:"GIT_OPERATION_FAILED",message:`git commit failed: ${a.stderr||a.stdout}`});const c=await w(t);if(!c)throw new n({code:"GIT_OPERATION_FAILED",message:"git commit succeeded but HEAD is not resolvable."});return c},I=6e4;let l;const h=async t=>{const e=Date.now();if(l!==void 0&&e-l.cachedAtMs<I)return l.value;const r=await t.runner.run("gitsign",["--version"],{cwd:t.cwd,silent:!0});return l={cachedAtMs:e,value:r.exitCode===0},l.value},_=()=>{l=void 0},O=_,G=async(t,e,r,s={})=>{if(await A(t,e))throw new n({code:"TAG_COLLISION",message:`Tag "${e}" already exists locally. Resolve manually before re-running.`});if(!s.skipRemoteCheck&&await T(t,e,s.remote??"origin"))throw new n({code:"TAG_COLLISION",message:`Tag "${e}" already exists on remote "${s.remote??"origin"}". A previous run may have pushed tags but failed mid-publish — inspect the remote and either re-use the existing tag or delete it before re-running.`});const{signing:i}=s;if(i?.mode==="sigstore"){if(await h(t)){const c=["tag","-a",e];r&&c.push("-m",r);const u=await t.runner.run("gitsign",c,{cwd:t.cwd,silent:!0});if(u.exitCode!==0)throw new n({code:"GIT_OPERATION_FAILED",message:`gitsign tag ${e} failed: ${u.stderr||u.stdout}`});return}process.stderr.write(`[vis release] Warning: signing.mode is "sigstore" but \`gitsign\` is not on PATH; falling back to GPG signing for tag ${e}.
|
|
2
|
+
`)}const o=["tag"];i&&(i.key&&i.mode==="gpg"?o.push("-u",i.key):o.push("-s")),r?o.push("-a",e,"-m",r):o.push(e);const a=await d(t,o);if(a.exitCode!==0)throw new n({code:"GIT_OPERATION_FAILED",message:`git tag ${e} failed: ${a.stderr||a.stdout}`})},R=async(t,e={})=>{const r=["push",e.remote??"origin","--tags"];e.atomic&&r.splice(1,0,"--atomic");const s=await d(t,r,!1);if(s.exitCode!==0)throw new n({code:"TAG_PUSH_FAILED",hint:"After resolving, re-run with --resume to retry the push.",message:`git push --tags failed: ${s.stderr||s.stdout}`})},y=async(t,e,r={})=>{const{signing:s}=r;if(s?.mode==="sigstore"){if(await h(t)){const u=["tag","-f","-a","-m",`Floating tag ${e}`,e],g=await t.runner.run("gitsign",u,{cwd:t.cwd,silent:!0});if(g.exitCode!==0)throw new n({code:"GIT_OPERATION_FAILED",message:`gitsign tag -f ${e} failed: ${g.stderr||g.stdout}`});if(r.push===!1)return;const m=await d(t,["push",r.remote??"origin","--force",`refs/tags/${e}:refs/tags/${e}`],!1);if(m.exitCode!==0)throw new n({code:"TAG_PUSH_FAILED",hint:"After resolving, re-run with --resume to retry the push.",message:`git push --force refs/tags/${e} failed: ${m.stderr||m.stdout}`});return}process.stderr.write(`[vis release] Warning: signing.mode is "sigstore" but \`gitsign\` is not on PATH; falling back to GPG signing for floating tag ${e}.
|
|
3
|
+
`)}const i=["tag","-f"];s&&(s.key&&s.mode==="gpg"?i.push("-u",s.key):i.push("-s")),i.push(e);const o=await d(t,i);if(o.exitCode!==0)throw new n({code:"GIT_OPERATION_FAILED",message:`git tag -f ${e} failed: ${o.stderr||o.stdout}`});if(r.push===!1)return;const a=await d(t,["push",r.remote??"origin","--force",`refs/tags/${e}:refs/tags/${e}`],!1);if(a.exitCode!==0)throw new n({code:"TAG_PUSH_FAILED",hint:"After resolving, re-run with --resume to retry the push.",message:`git push --force refs/tags/${e} failed: ${a.stderr||a.stdout}`})},D=async(t,e,r,s={})=>{const i=await t.runner.run("git",["add","-A","--",e],{cwd:t.cwd,silent:!0});if(i.exitCode!==0)throw new n({code:"GIT_OPERATION_FAILED",message:`git add ${e} failed: ${i.stderr||i.stdout}`});if((await t.runner.run("git",["diff","--cached","--quiet","--",e],{cwd:t.cwd,silent:!0})).exitCode===0)return{committed:!1,pushed:!1};const a={...process.env};s.author&&(a.GIT_AUTHOR_NAME=s.author.name,a.GIT_AUTHOR_EMAIL=s.author.email,a.GIT_COMMITTER_NAME=s.author.name,a.GIT_COMMITTER_EMAIL=s.author.email);const c=["commit","-m",r];s.sign&&c.push("-S");const u=await t.runner.run("git",c,{cwd:t.cwd,env:a,silent:!0});if(u.exitCode!==0)throw new n({code:"GIT_OPERATION_FAILED",message:`git commit failed: ${u.stderr||u.stdout}`});if(!s.push)return{committed:!0,pushed:!1};const g=s.branch??await f(t);return g?{committed:!0,pushed:(await t.runner.run("git",["push",s.remote??"origin",`HEAD:${g}`],{cwd:t.cwd,silent:!1})).exitCode===0}:{committed:!0,pushed:!1}},L=async(t,e,r={})=>{const s=["push",r.remote??"origin",`HEAD:${e}`];r.force&&s.push("--force-with-lease");const i=await d(t,s,!1);if(i.exitCode!==0)throw new n({code:"TAG_PUSH_FAILED",message:`git push ${e} failed: ${i.stderr||i.stdout}`})},N=(t,e)=>`${t}@${e}`,E=/\{(name|unscopedName|version|major|minor|patch|date|channel)\}/g,F=(t,e)=>{const r=e.version??"",[s="",i="",o=""]=r.split(/[-+]/,1)[0].split("."),a={channel:e.channel??"",date:e.date??new Date().toISOString().slice(0,10),major:s,minor:i,name:e.name??"",patch:o,unscopedName:e.name?e.name.replace(/^@[^/]+\//,""):"",version:r};return t.replaceAll(E,(c,u)=>a[u]??"")};export{y as createOrUpdateFloatingTag,G as createTag,N as defaultTagFor,f as getCurrentBranch,w as getCurrentSha,C as getShortSha,h as gitsignAvailable,v as hasUncommittedChanges,L as pushBranch,R as pushTags,F as renderTagPattern,_ as resetGitsignCache,O as resetGitsignCacheForTests,$ as stageAndCommit,D as stageAndCommitFile,A as tagExists,T as tagExistsRemote};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as
|
|
1
|
+
import{s as i}from"../packem_shared/index-B4AjSxHU.js";import d from"./index.js";import{normaliseGroup as v}from"../release/types.js";const g=(r,e,o)=>(r??"{name}@{version}").replaceAll("{name}",e).replaceAll("{version}",o),x=r=>{let e=r[0]??"0.0.0";for(const o of r){const s=i.valid(o)!==null,t=i.valid(e)!==null;s&&(!t||i.gt(o,e))&&(e=o)}return e},T=(r,e)=>{const o=[...r.fixed??[],...r.linked??[]].map(a=>v(a)),s=[],t=new Set;return o.forEach((a,f)=>{if(!a.syncGitTag)return;const m=e.filter(n=>!t.has(n.name)&&a.packages.some(c=>n.name===c||d(c,n.name))).map(n=>n.name);if(m.length===0)return;for(const n of m)t.add(n);const u=m.map(n=>e.find(c=>c.name===n)?.version??"0.0.0"),l=x(u),p=a.name??`group-${f}`;s.push({members:m,name:p,tag:g(a.tagPattern,p,l),version:l})}),{grouped:t,groups:s}};export{T as resolveSyncTagGroups};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{r as g,a as p,b as v}from"../packem_shared/pm-runner-de-jCq8q.js";import{r as h,a as x}from"../packem_shared/command-runtime-CiLVo4ED.js";import{t as R}from"../packem_shared/utils-DQFHJn72.js";const B=async({argument:f,logger:c,options:e,rawUnknown:i,visConfig:s,workspaceRoot:k})=>{const l=f;if(!l||l.length===0)throw new Error("No command specified. Usage: vis exec <command> [args...]");const[o,...n]=l,t=i??[],m=t[0]==="--"?n:[...n,...t],a=k??process.cwd(),d=R(e.filter);let r=!e.recursive&&!e.workspaceRoot&&!e.parallel&&!e.reverse&&!e.shellMode&&d.length===0?g(o,m,a):null;if(r===null){const u=h({logger:c,options:e,visConfig:s},a),w=p(a,{backend:x(u),configBackend:s?.install?.backend,configCorepack:s?.install?.corepack});r=v(w,{args:m,command:o,filter:d,parallel:e.parallel||!1,recursive:e.recursive||!1,reverse:e.reverse||!1,shellMode:e.shellMode||!1,workspaceRoot:e.workspaceRoot||!1},a,c)}r!==0&&(process.exitCode=r)};export{B as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as _}from"node:module";import{
|
|
2
|
-
`),l
|
|
3
|
-
`)),n.push(
|
|
4
|
-
Type "uninstall" to confirm: `,h)});if(e.close(),
|
|
5
|
-
✓ Removed ${
|
|
1
|
+
import{createRequire as _}from"node:module";import{z as m,e as t}from"../packem_shared/index-DHD8wb6Z.js";import{b}from"../packem_shared/formatBytes-BHAzNIrn-DFIppnY0.js";import{y as a}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{U as j}from"../packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js";let v;const w=s=>(v??=_(import.meta.url))(s),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=s=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[n,o]=c.versions.node.split(".").map(Number);if(n>22||n===22&&o>=3||n===20&&o>=16)return c.getBuiltinModule(s)}return w(s)},{homedir:i}=d("node:os"),{createInterface:y}=d("node:readline"),f=b(),p=[t(i(),".zshrc"),t(i(),".zshenv"),t(i(),".bashrc"),t(i(),".bash_profile"),t(i(),".profile"),t(i(),".config","fish","config.fish")],E=s=>{const n=[];for(const o of p)if(a(o))try{const l=m(o).split(`
|
|
2
|
+
`),e=l.filter(r=>!r.includes(".vis/bin")&&!r.includes("VIS_HOME")&&!r.includes("# vis "));e.length!==l.length&&(j(o,e.join(`
|
|
3
|
+
`)),n.push(o))}catch{s.warn(`warning: could not clean ${o}`)}return n},H=async({fs:s,logger:n,options:o})=>{if(!a(f)){n.info("vis is not installed (no ~/.vis directory found).");return}n.info("This will remove:"),n.info(` ${f}/`);const u=p.filter(e=>a(e)&&m(e).includes(".vis"));for(const e of u)n.info(` Lines in ${e}`);if(!o.yes){if(!process.stdin.isTTY)throw new Error("Non-interactive terminal. Use --yes to confirm.");const e=y({input:process.stdin,output:process.stdout}),r=await new Promise(h=>{e.question(`
|
|
4
|
+
Type "uninstall" to confirm: `,h)});if(e.close(),r.trim()!=="uninstall"){n.info("Aborted.");return}}const l=E(n);for(const e of l)n.info(`Cleaned ${e}`);try{await s.rm(f,{force:!0,recursive:!0}),n.info(`
|
|
5
|
+
✓ Removed ${f}`)}catch(e){throw new Error(`Failed to remove ${f}: ${e instanceof Error?e.message:String(e)}`,{cause:e})}n.info("✓ vis has been uninstalled.")};export{H as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as f,f as k}from"../packem_shared/pm-runner-de-jCq8q.js";import{r as m,a as w}from"../packem_shared/command-runtime-CiLVo4ED.js";const I=async({argument:e,logger:s,options:n,process:r,visConfig:a,workspaceRoot:t})=>{if(!e||e.length===0)throw new Error("No package specified. Usage: vis info <package> [field...]");const[l,...d]=e,c=t??r.cwd,i=m({logger:s,options:n,visConfig:a},c),p=f(c,{backend:w(i),configBackend:a?.install?.backend,configCorepack:a?.install?.corepack}),o=k(p,{fields:d,json:n.json||!1,package:l},c,s);o!==0&&o!==1&&(process.exitCode=o)};export{I as default};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`),
|
|
3
|
-
allow: ${
|
|
4
|
-
${
|
|
1
|
+
import{createRequire as E}from"node:module";import{e as m,a as O}from"../packem_shared/index-DHD8wb6Z.js";import{findVisConfigFile as F,DEFAULT_MIN_RELEASE_AGE_MINUTES as v}from"./CONFIG_FILES.js";import{p as e,e as q}from"./cli-main.js";import{d as G}from"../packem_shared/pm-runner-de-jCq8q.js";import{s as U}from"../packem_shared/build-scripts-pdVmqXRm.js";import{y as S}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{U as j}from"../packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js";import{s as T}from"../packem_shared/native-config-sync-BSzU4qUO.js";import{s as R}from"../packem_shared/min-release-age-ChzTC7_I.js";let M;const N=t=>(M??=E(import.meta.url))(t),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=t=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[s,n]=p.versions.node.split(".").map(Number);if(s>22||s===22&&n>=3||s===20&&n>=16)return p.getBuiltinModule(t)}return N(t)},{execFileSync:I}=x("node:child_process"),{createInterface:D}=x("node:readline"),K=t=>{const s=[];return S(m(t,"turbo.json"))&&s.push("turborepo"),S(m(t,"nx.json"))&&s.push("nx"),S(m(t,".moon"))&&s.push("moon"),s},B=(t,s)=>new Promise(n=>{t.question(s,i=>{n(i.trim())})}),d=async(t,s,n=!0)=>{const o=await B(t,`${s} ${n?"[Y/n]":"[y/N]"} `);return o===""?n:o.toLowerCase()==="y"||o.toLowerCase()==="yes"},w=(t,s)=>{const n=[],i=Object.entries(s.allowBuilds).filter(([,c])=>c).map(([c])=>` "${c}": true,`).join(`
|
|
2
|
+
`),r=[` installScripts: {
|
|
3
|
+
allow: ${i?`{
|
|
4
|
+
${i}
|
|
5
5
|
}`:"{}"},
|
|
6
|
-
},`];s.minimumReleaseAge!==void 0&&
|
|
6
|
+
},`];s.minimumReleaseAge!==void 0&&r.push(` firstSeen: {
|
|
7
7
|
minutes: ${String(s.minimumReleaseAge)},
|
|
8
|
-
},`);let
|
|
9
|
-
${
|
|
8
|
+
},`);let l=` policies: {
|
|
9
|
+
${r.join(`
|
|
10
10
|
`)}
|
|
11
|
-
},`;return s.enableSocket&&(
|
|
12
|
-
socket: { enabled: true },`),s.enableDepsDev&&(
|
|
13
|
-
depsDev: { enabled: true },`),
|
|
14
|
-
${
|
|
15
|
-
},`),s.staged&&
|
|
11
|
+
},`;return s.enableSocket&&(l+=`
|
|
12
|
+
socket: { enabled: true },`),s.enableDepsDev&&(l+=`
|
|
13
|
+
depsDev: { enabled: true },`),n.push(` security: {
|
|
14
|
+
${l}
|
|
15
|
+
},`),s.staged&&n.push(` staged: {
|
|
16
16
|
"*": ["vis lint --staged --fix", "vis fmt --staged"],
|
|
17
17
|
},`),`import { defineConfig } from "@visulima/vis/config";
|
|
18
18
|
|
|
19
19
|
export default defineConfig({
|
|
20
|
-
${
|
|
20
|
+
${n.join(`
|
|
21
21
|
|
|
22
22
|
`)}
|
|
23
23
|
});
|
|
24
|
-
`},L=async(
|
|
24
|
+
`},L=async(t,s,n)=>{const i=D({input:process.stdin,output:process.stdout});e.info(`
|
|
25
25
|
vis init — interactive setup
|
|
26
|
-
`);const
|
|
27
|
-
`);for(const
|
|
26
|
+
`);const o=await d(i," Enable Socket.dev security scanning?");o&&(e.success(" Socket.dev enabled — scores, alerts, and supply chain data active."),process.env.VIS_SOCKET_TOKEN||e.notice(" Set VIS_SOCKET_TOKEN for a custom API token (optional).")),e.info("");const r=await d(i," Enable Google deps.dev (OpenSSF Scorecard + GHSA advisories)?");r&&e.success(" deps.dev enabled — Scorecard signals and advisories merged into the security report."),e.info("");const l=await d(i," Scan for packages with build scripts?"),c={};if(l){e.info(" Scanning node_modules...");const f=U(t,{});if(f.length>0){e.info(` Found ${String(f.length)} package${f.length===1?"":"s"} with build scripts:
|
|
27
|
+
`);for(const a of f){const y=await d(i,` Allow ${a}?`,!1),u=a.split(" (")[0]??a;c[u]=y,y&&e.success(` ✓ ${u} approved`)}}else e.info(" No packages with build scripts found.")}e.info("");const C=await d(i," Enforce a minimum release age (block freshly-published versions)?");let g;if(C){const f=await B(i,` Minimum age in minutes (default ${String(v)} = 2 days): `),a=f===""?v:Number.parseInt(f,10);g=Number.isFinite(a)&&a>0?a:v,e.success(` minimumReleaseAge: ${String(g)} minutes`)}e.info("");const $=await d(i," Set up pre-commit hooks (lint-staged)?",!1);let b=!1;(s.name==="pnpm"||s.name==="yarn"||s.name==="npm"||s.name==="bun")&&(e.info(""),b=await d(i,` Sync security settings to ${s.name} config?`));const h=K(t);if(h.length>0&&(e.info(""),e.info(` Detected existing tools: ${h.join(", ")}`),await d(i,` Run \`vis migrate\` for ${h.join(", ")}?`,!1))){i.close();const[a,...y]=s.name==="pnpm"?["pnpm","exec"]:s.name==="yarn"?["yarn","exec"]:s.name==="bun"?["bunx"]:["npx"];for(const u of h){e.info(` Migrating from ${u}...`);try{I(a,[...y,"vis","migrate",u],{cwd:t,stdio:"inherit"})}catch{e.warn(` Migration from ${u} had issues — run \`vis migrate ${u}\` manually.`)}}if(S(n))e.success(`Migrated config written to ${n}`);else{const u=w(s.name,{allowBuilds:c,enableDepsDev:r,enableSocket:o,minimumReleaseAge:g,staged:$});j(n,u),e.success(`Created ${n}`)}e.notice(" Run 'vis doctor' to see your project's full health status.");return}i.close(),e.info("");const A=w(s.name,{allowBuilds:c,enableDepsDev:r,enableSocket:o,minimumReleaseAge:g,staged:$});if(j(n,A),e.success(`Created ${n}`),b){const f=Object.fromEntries(Object.entries(c).filter(([,a])=>a));for(const a of T(s.name,t,f))e.success(` ${a}`);for(const a of R(s.name,t,g))e.success(` ${a}`)}e.info(""),e.info(" Setup complete. Your config:");const _=[o&&"Socket.dev",r&&"deps.dev"].filter(Boolean);e.info(` Security: ${_.length>0?`${_.join(" + ")} enabled`:"defaults only"}`),e.info(` Build scripts: ${Object.values(c).filter(Boolean).length} approved`),e.info(` Min age: ${g===void 0?"not enforced":`${String(g)} minutes`}`),e.info(` Git hooks: ${$?"lint-staged configured":"not configured"}`),e.info(` PM sync: ${b?"done":"skipped"}`),e.info(""),e.notice(" Run 'vis doctor' to see your project's full health status."),e.info("")},V=(t,s,n,i)=>{const o=w(s.name,{allowBuilds:{},enableDepsDev:!1,enableSocket:!1,minimumReleaseAge:v,staged:!1});if(j(i,o),e.success(`Created ${i}`),e.info(" Secure defaults are applied automatically by defineConfig()."),n.syncNative){for(const r of T(s.name,t,{}))e.success(` ${r}`);for(const r of R(s.name,t,v))e.success(` ${r}`)}e.info(""),e.notice("Run 'vis doctor' for a full health check, or 'vis init' in a terminal for guided setup.")},k=(t,s,n)=>{const i=m(t,".."),o=m(s,"node_modules","@visulima","vis","schemas",n),r=O(i,o),l=r===""?`./${n}`:r.split(/[/\\]/u).join("/");return l.startsWith(".")?l:`./${l}`},Y=(t,s)=>{const n=k(m(t,"project.json"),s,"project.schema.json"),i=k(m(t,"vis.config.ts"),s,"vis-config.schema.json");e.info(""),e.info("Paste these into your config files to get editor IntelliSense:"),e.info(""),e.info(` project.json → "$schema": "${n}"`),e.info(` vis.config.ts → see ${i} (vis.config.ts is TypeScript; use the import path directly)`),e.info(""),e.notice("For nested project.json files, the `..` depth changes — run `vis migrate nx` to auto-rewrite all of them.")},ne=async({options:t,workspaceRoot:s})=>{const n=s??process.cwd();if(t.schema){Y(n,n);return}const i=G(n),o=F(n);if(o&&!t.force){e.warn(`Config already exists: ${o}`),e.notice("Use --force to overwrite, or edit the existing file.");return}const r=o??m(n,"vis.config.ts");!!process.stdin.isTTY&&t.interactive!==!1?await L(n,i,r):V(n,i,t,r);const c=q(n);c.added.length>0&&e.success(`Added to .gitignore: ${c.added.join(", ")}`)};export{k as buildSchemaRefForTesting,ne as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`);else{const
|
|
3
|
-
`);const
|
|
4
|
-
${
|
|
5
|
-
`)}}(
|
|
1
|
+
import{J as k,F as v,X as $,r as y}from"../packem_shared/index.server-CwSgbeN7.js";import{p}from"./cli-main.js";import{r as N,M,a as S,b as x,c as A,d as C,e as R,f as b,g as P,h as j}from"../packem_shared/s1ngularity-RZOHbGrE.js";import{g as B,r as D}from"../packem_shared/packument-C55kVxcQ.js";import{r as E}from"../packem_shared/provenance-CvfQEJPQ.js";import{r as O}from"../packem_shared/signatures-oZ_2IneN.js";const w=new Set(["archivedRepo","author","downloads","expiredDomains","metadata","newBin","provenance","s1ngularity","signatures"]),V=n=>{const s=n.trim();if(s==="")return;if(s.startsWith("@")){const r=s.indexOf("@",1);return r===-1?{name:s,spec:void 0}:{name:s.slice(0,r),spec:s.slice(r+1)||void 0}}const t=s.indexOf("@");return t===-1?{name:s,spec:void 0}:{name:s.slice(0,t),spec:s.slice(t+1)||void 0}},F=n=>{if(n===void 0||n.trim()==="")return;const s=new Set;for(const t of n.split(",")){const r=t.trim();if(!w.has(r))throw new Error(`Unknown marshall in --only: ${r}. Known: ${[...w].sort().join(", ")}.`);s.add(r)}return s},l=(n,s)=>n===void 0||n.has(s),L=n=>n?.has("signatures")??!1,q=async({argument:n,options:s,workspaceRoot:t})=>{if(!n||n.length===0)throw new Error("No package specified. Usage: vis inspect <package>[@<spec>]");const r=V(n[0]);if(r===void 0)throw new Error(`Invalid package argument: "${String(n[0])}". Usage: vis inspect <package>[@<spec>]`);const i=F(s.only),h=await B(r.name,{workspaceRoot:t});if(h===void 0){p.error(`Package ${r.name} not found in the registry.`),process.exitCode=2;return}const g=D(h,r.spec);if(g===void 0){p.error(`Could not resolve ${r.name}@${r.spec??"latest"} to a published version.`),process.exitCode=2;return}const c=[{name:r.name,version:g}],o=new M;if(l(i,"author")){const a=await N(c,{workspaceRoot:t});for(const e of a)o.add({marshall:"author",message:e.message,packageName:e.packageName,severity:e.severity})}if(l(i,"provenance")){const a=await E(c);for(const e of a)o.add({marshall:"provenance",message:`Prior version ${e.priorVersionWithProvenance} had provenance but ${e.version} does not.`,packageName:e.packageName,severity:"error"})}if(l(i,"s1ngularity")){const a=await S(c,{workspaceRoot:t});for(const e of a){const d=e.hookChanges.map(f=>`${f.hook} (${f.kind})`).join(", "),m=e.hookChanges.length===1;o.add({marshall:"s1ngularity",message:`${e.version} ${m?"has an":"has"} install-script ${m?"change":"changes"} [${d}] AND dropped the provenance attestation that ${e.priorVersion} carried — this is the s1ngularity compromised-publish shape.`,packageName:e.packageName,severity:"error"})}}if(l(i,"newBin")){const a=await x(c);for(const e of a){const d=e.newBins.map(m=>m.command).join(", ");o.add({marshall:"newBin",message:`${e.toVersion} adds new bin script${e.newBins.length===1?"":"s"}: ${d} (prior: ${e.fromVersion}).`,packageName:e.packageName,severity:"warning"})}}if(l(i,"metadata")){const a=await A(c,{workspaceRoot:t});for(const e of a)o.add({marshall:"metadata",message:`Missing/invalid metadata: ${e.issues.join(", ")}.`,packageName:e.packageName,severity:"warning"})}if(l(i,"downloads")){const a=await C([r.name]);for(const e of a){const d=e.downloadsLastMonth===void 0?"unknown":String(e.downloadsLastMonth);o.add({marshall:"downloads",message:e.kind==="no-data"?"npm stats API returned no monthly download data.":`Only ${d} downloads in the past month.`,packageName:e.packageName,severity:e.severity})}}if(l(i,"expiredDomains")){const a=await R(c,{workspaceRoot:t});for(const e of a)o.add({marshall:"expiredDomains",message:e.kind==="expired"?`Maintainer email domain ${e.domain} (${e.maintainer}) is unregistered — potential hijack risk.`:`Could not verify maintainer email domain ${e.domain} (${e.maintainer}).`,packageName:e.packageName,severity:e.severity})}if(L(i)){const a=await O(c,{workspaceRoot:t});for(const e of a)o.add({marshall:"signatures",message:e.message,packageName:e.packageName,severity:e.severity})}if(l(i,"archivedRepo")){const a=await b(c,{workspaceRoot:t});for(const e of a)o.add({marshall:"archivedRepo",message:e.kind==="archived"?`Source repo ${e.owner}/${e.repo} is archived${e.archivedAt===void 0?"":` (since ${e.archivedAt})`}.`:`Source repo ${e.owner}/${e.repo} returned 404 from GitHub.`,packageName:e.packageName,severity:"warning"})}const u=o.all();if(s.json===!0)process.stdout.write(`${JSON.stringify(P(u),void 0,2)}
|
|
2
|
+
`);else{const a=`${r.name}@${g}`;if(u.length===0)p.info(`${k("✓")} ${a} — no findings.`);else{p.info(`${v("Inspecting")} ${a}`);for(const m of j(u))process.stdout.write(`${m}
|
|
3
|
+
`);const e=o.errors().length,d=o.warnings().length;process.stdout.write(`
|
|
4
|
+
${v("Summary:")} ${$(`${String(e)} error${e===1?"":"s"}`)}, ${y(`${String(d)} warning${d===1?"":"s"}`)}.
|
|
5
|
+
`)}}(o.hasErrors()||s.strict===!0&&!o.isEmpty())&&(process.exitCode=1)};export{q as default,V as parsePackageArg};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{e as w,m as F,c as _}from"../packem_shared/index-DHD8wb6Z.js";import{p as r}from"./cli-main.js";import{d as j,a as v,g as N,h as W}from"../packem_shared/pm-runner-de-jCq8q.js";import{a as $,r as K}from"../packem_shared/command-runtime-CiLVo4ED.js";import{s as M}from"../packem_shared/typosquats-D8ppc5kr.js";import{h as T,P as H}from"../packem_shared/peer-warnings-CmYSxvql.js";import{t as G}from"../packem_shared/utils-DQFHJn72.js";import{y as J}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";const Q=["pnpm-lock.yaml","yarn.lock","package-lock.json","npm-shrinkwrap.json","bun.lock","bun.lockb"],U=n=>{let t=n;for(;;){for(const c of Q)if(J(w(t,c)))return!0;const a=F(t);if(a===t||_(t).root===t)return!1;t=a}},g=new Set(["aube","auto","bun","npm","pnpm","yarn"]),re=async n=>{const{argument:t,fs:a,logger:c,options:e,visConfig:l,workspaceRoot:C}=n,s=C??process.cwd();if(t&&t.length>0){const o=e,{default:L}=await import("./handler15.js"),R=o.marshallCheck===!1||o["no-marshall-check"]===!0?!1:void 0,z=o.socketCheck===!1||o["no-socket-check"]===!0?!1:void 0,D=o.typosquatCheck===!1||o["no-typosquat-check"]===!0?!1:void 0,I=o.runScripts===!0||o["run-scripts"]===!0,P=o.workspaceRoot===!0||o["workspace-root"]===!0,q=o.saveOptional===!0||o["save-optional"]===!0,A=e.dev===!0,B={autoInstallPeers:!1,exact:o.exact===!0,filter:e.filter,global:!1,marshallCheck:R,runScripts:I,saveDev:A,saveOptional:q,savePeer:!1,socketCheck:z,to:void 0,typosquatCheck:D,workspace:!1,workspaceRoot:P};await L({...n,argument:t,options:B});return}if(e.typosquatCheck!==!1&&!await M(s,l?.security?.typosquatAllowlist)){process.exitCode=1;return}const i=e.installer;if(i&&!g.has(i)){r.error(`Invalid --installer value: "${i}". Expected one of: ${[...g].join(", ")}.`),process.exitCode=1;return}const y=i,O=e.aube===!1,f=$(K({logger:c,options:e,visConfig:l},s));let p;try{p=O?f===void 0?j(s):v(s,{backend:f}):v(s,{backend:y??f,configBackend:l?.install?.backend,configCorepack:l?.install?.corepack})}catch(o){r.error(o instanceof Error?o.message:String(o)),process.exitCode=1;return}const k=N(s,p);k&&r.warn(k);const x=G(e.filter),u=e.ci||!1,m=e.frozenLockfile||u,b=e.frozenLockfile===!1||e.force||e.lockfileOnly,E=U(s),h=m||!b&&E;if(!m&&h&&!e.silent&&r.info("Defaulting to frozen lockfile (pass --no-frozen-lockfile to allow lockfile updates)."),u){r.info("Clean install: removing node_modules...");try{await a.rm(w(s,"node_modules"),{force:!0,recursive:!0})}catch(o){r.error(`Failed to remove node_modules: ${o instanceof Error?o.message:String(o)}`),process.exitCode=1;return}}const{code:d,output:S}=await W(p,{dev:e.dev||!1,filter:x,force:e.force||!1,frozenLockfile:h,ignoreScripts:!e.runScripts,lockfileOnly:e.lockfileOnly||!1,noOptional:e.optional===!1,offline:e.offline||!1,prod:e.prod||!1,recursive:e.recursive||!1,silent:e.silent||!1,workspaceRoot:e.workspaceRoot||!1},s,c,{ciMode:u,preferOffline:e.preferOffline||!1});d!==0&&(process.exitCode=d),d===0&&!e.silent&&T(S)&&r.info(H)};export{re as default};
|