@visulima/vis 2.0.2 → 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 +28 -0
- package/LICENSE.md +5395 -4307
- 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 -802
- 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.d.ts +204 -204
- package/index.js +26 -26
- package/package.json +13 -13
- 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-CCBGdU8U.js +0 -1
- package/dist/packem_shared/affected-selection-Dj-ymxhw.js +0 -1
- package/dist/packem_shared/affected-shas-PwkVbPch.js +0 -1
- package/dist/packem_shared/ai-analysis-bGCAc1jR.js +0 -68
- package/dist/packem_shared/ai-fix-DV5-dHBY.js +0 -43
- package/dist/packem_shared/augment-24KX2nkI.js +0 -4
- package/dist/packem_shared/bin-CtzhnYMp.js +0 -1
- package/dist/packem_shared/build-scripts-w4SNeR7D.js +0 -1
- package/dist/packem_shared/clean-DWjQl14S.js +0 -1
- package/dist/packem_shared/command-runtime-BLFPUYAT.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-C4KaVTn1.js +0 -4
- package/dist/packem_shared/dependency-scan-D_ona0Qm.js +0 -1
- package/dist/packem_shared/docker-DaVs-9wK.js +0 -59
- package/dist/packem_shared/en-D3CfXlO7.js +0 -27
- package/dist/packem_shared/failure-log-CTneNcio.js +0 -2
- package/dist/packem_shared/giget-CAxjpwew.js +0 -2
- package/dist/packem_shared/glob-BUjyjdE8-C4M8e02u.js +0 -1
- package/dist/packem_shared/index-BAe6e0XE.js +0 -1
- package/dist/packem_shared/index-CTMU29dI.js +0 -1
- package/dist/packem_shared/index-uBVnF4ji.js +0 -35
- package/dist/packem_shared/index.server-CusjRLCh.js +0 -2
- package/dist/packem_shared/license-t5KnNX6v.js +0 -1
- package/dist/packem_shared/lifecycle-B8A2T3gx.js +0 -2
- package/dist/packem_shared/lockfile-Bccery3L.js +0 -1
- package/dist/packem_shared/main-D_cam4hv.js +0 -1
- package/dist/packem_shared/manifests-BDkwiVbh.js +0 -1
- package/dist/packem_shared/min-release-age-OaYpLwux.js +0 -34
- package/dist/packem_shared/missing-package-json-BqS-OnKd.js +0 -1
- package/dist/packem_shared/native-config-sync-Ds1FtcrM.js +0 -21
- package/dist/packem_shared/osv-bloom-pKp7urSB.js +0 -2
- package/dist/packem_shared/otelPlugin-DmKDBaPo.js +0 -1
- package/dist/packem_shared/package-version-C47v64aB.js +0 -4
- package/dist/packem_shared/packument-HBVbyf7x.js +0 -1
- package/dist/packem_shared/pm-runner-C6eTANt1.js +0 -1
- package/dist/packem_shared/project-name-filter-CJ3XX2TI.js +0 -7
- package/dist/packem_shared/provenance-D4Cza8cp.js +0 -1
- package/dist/packem_shared/public-api-WqUCiyIe.js +0 -131
- package/dist/packem_shared/readJsonSync-DweZd5ZA-0eZh9sGm.js +0 -1
- package/dist/packem_shared/registry-keys-C0ez2VND.js +0 -1
- package/dist/packem_shared/resolve-explicit-BbT764KS.js +0 -5
- package/dist/packem_shared/resolve-runtime-D_vZovbB.js +0 -1
- package/dist/packem_shared/run-file-DyPFFN9U.js +0 -1
- package/dist/packem_shared/runtime-check-D4um-yQq.js +0 -1
- package/dist/packem_shared/s1ngularity-St6dhKiq.js +0 -1
- package/dist/packem_shared/scan-progress-q-N2JtIp.js +0 -2
- package/dist/packem_shared/selectors-Ce_6UAoY.js +0 -3
- package/dist/packem_shared/signatures-Dyeyg1q9.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-Cfy7c__2.js +0 -11
- package/dist/packem_shared/target-options-7XcbqGDe.js +0 -1
- package/dist/packem_shared/toolchain-C_pNMBM6.js +0 -5
- package/dist/packem_shared/typosquats-xzcAGPiM.js +0 -1
- package/dist/packem_shared/use-measured-height-CBjN0fle.js +0 -1
- package/dist/packem_shared/utils-CRueU43T.js +0 -1
- package/dist/packem_shared/verify-Dve9PQj3.js +0 -1
- package/dist/packem_shared/vis-update-app-DMAC2pPf.js +0 -1
- package/dist/packem_shared/vis-user-error-xmha3L4n.js +0 -30
- package/dist/packem_shared/watch-BXOOX7lx.js +0 -1
- package/dist/packem_shared/watch-loop-Q7UpkVbr.js +0 -11
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{b as $,p as m}from"./orchestrator.js";import{VisReleaseError as b}from"../packem_shared/VisReleaseError-DZtgcKf8.js";const P=async({logger:t,options:n,workspaceRoot:o})=>{const f=o??process.cwd(),r=n.dryRun===!0;let a;try{a=await $({channel:n.channel,cwd:f,firstRelease:n.firstRelease===!0,projects:n.filter?n.filter.split(",").map(e=>e.trim()).filter(Boolean):void 0})}catch(e){t.error(`Failed to load release context: ${e instanceof Error?e.message:String(e)}`),process.exitCode=1;return}const{printConfigIfRequested:c}=await import("./print-config.js");if(c(n,a,t))return;if(n.checkOnly===!0){if(t.info(`Preflight: ${a.plan.releases.length} pending publish(es)${a.channel?` to dist-tag "${a.channel.tag}"`:""}.`),a.plan.warnings.length>0)for(const e of a.plan.warnings)t.warn(` - ${e}`);process.exitCode=a.plan.releases.length===0?1:0;return}if(a.plan.releases.length===0){t.info("No pending releases — nothing to publish.");return}const i=n.tag??a.channel?.tag;i||t.warn("No --tag provided and no channel matched the current branch. Defaulting to dist-tag 'latest'. Set channels in vis.config.ts to control this."),t.info(`${r?"[dry-run] would publish":"Publishing"} ${a.plan.releases.length} package(s) to dist-tag "${i??"latest"}"${r?"":"..."}`);let s;try{s=await m(a,{dryRun:r,noPush:n.noPush===!0,otp:n.otp,resume:n.resume===!0,tag:i})}catch(e){if(e instanceof b&&e.code==="STAGE_PENDING"){t.error(e.message),e.hint&&(t.info(""),t.info(`Next steps: ${e.hint}`)),process.exitCode=1;return}t.error(`Publish failed: ${e instanceof Error?e.message:String(e)}`),process.exitCode=1;return}t.info("");for(const e of s.published)t.info(` [published] ${e.name}@${e.version}`);for(const e of s.skipped)e.reason.startsWith("stage-")?t.warn(` [stage] ${e.name} (${e.reason} — re-run \`vis release publish\` once approved)`):t.info(` [skipped] ${e.name} (${e.reason})`);for(const e of s.failed)t.error(` [failed] ${e.name}: ${e.reason}`);t.info(""),t.info(`Published: ${s.published.length} | Skipped: ${s.skipped.length} | Failed: ${s.failed.length}`),s.tags.length>0&&t.info(`Tags created: ${s.tags.length}${s.tagsPushed?" (pushed)":" (NOT pushed — re-run with --resume to retry)"}`),s.failed.length===0?process.exitCode=0:s.published.length===0&&s.skipped.length===0?process.exitCode=3:process.exitCode=2;const l=s.failed.filter(e=>/\bEOTP\b|one[- ]time password|otp/i.test(e.reason));if(l.length>0){t.info(""),t.warn("Publish failed because the registry required a 2FA OTP. Rerun with:");const e=l.map(p=>p.name).join(","),h=n.channel?` --channel=${n.channel}`:"",d=n.tag?` --tag=${n.tag}`:"",u=` --filter='${e}'`;t.info(` vis release publish --otp=REPLACE_WITH_NEW_OTP --resume${d}${h}${u}`)}};export{P as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{b as f}from"./orchestrator.js";import{runSnapshot as c}from"./snapshot.js";const h=async({logger:r,options:i,workspaceRoot:a})=>{const o=a??process.cwd();if(!i.tag){r.error("--tag is required."),process.exitCode=1;return}const s=i.dryRun===!0,n=await f({cwd:o}),{printConfigIfRequested:d}=await import("./print-config.js");if(d(i,n,r))return;let e;try{e=await c({context:n,dryRun:s,filter:i.filter,registry:i.registry,tag:i.tag})}catch(t){r.error(`Snapshot failed: ${t.message}`),process.exitCode=1;return}r.info(`${s?"[dry-run] would snapshot":"Snapshotting"} at version ${e.snapshotVersion} → tag "${e.tag}"`);for(const t of e.published)r.info(` ${s?"[dry-run] ":"[published]"} ${t.name}@${t.version}`);for(const t of e.skipped)r.info(` [skipped] ${t.name} (${t.reason})`);for(const t of e.failed)r.error(` [failed] ${t.name}: ${t.reason}`);r.info(""),r.info(`Published: ${e.published.length} | Skipped: ${e.skipped.length} | Failed: ${e.failed.length}`),process.exitCode=e.failed.length>0?2:0};export{h as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{DEFAULT_CHANGES_DIR as
|
|
2
|
-
`)}if(o.json){process.stdout.write(`${JSON.stringify({npm:
|
|
3
|
-
`);return}if(
|
|
1
|
+
import{DEFAULT_CHANGES_DIR as g}from"./DEFAULT_CLEAN_KEEP.js";import{b as m}from"./orchestrator.js";import{createShellRunner as $}from"./shell-runner.js";import{readStagedRegistry as y,removePendingStages as w,writeStagedRegistry as x}from"./staged-registry.js";import{acquireLock as C,releaseLock as A}from"./state.js";const S=["approve","list","reject"],j=t=>t===void 0||t===""?"list":S.includes(t)?t:void 0,N=async(t,a,o,n)=>{const s=["stage","list","--json"],d=o.stageIds?.[0],i=o.filter??d;i&&s.push(i);const f=await t.run("npm",s,{cwd:a,silent:!0}),c=await m({cwd:a}),r=await y(a,c.config.changesDir??g),u=i?{...r,pending:r.pending.filter(e=>e.name===i)}:r;let l=[];if(f.exitCode===0&&f.stdout.trim())try{l=JSON.parse(f.stdout)}catch{process.stdout.write(`${f.stdout}
|
|
2
|
+
`)}if(o.json){process.stdout.write(`${JSON.stringify({npm:l,registry:u.pending},null,2)}
|
|
3
|
+
`);return}if(l.length===0&&u.pending.length===0){n.info("No staged versions awaiting approval.");return}const h=new Set(l.map(e=>e.id).filter(Boolean)),p=new Set(u.pending.map(e=>e.id));for(const e of l){const v=p.has(e.id??"")?"":" [npm-only]";n.info(` ${e.id??"<no-id>"} ${e.package??"?"}@${e.version??"?"} → ${e.tag??"latest"}${v}`)}for(const e of u.pending)h.has(e.id)||n.info(` ${e.id} ${e.name}@${e.version} → ${e.tag??"latest"} [registry-only, ${e.reason}]`)},k=async(t,a,o)=>{if(a.all){const s=await m({cwd:t}),d=await y(t,s.config.changesDir??g);if(d.pending.length===0){o.error("No pending stages in .vis/release/staged.json. Approve manually with explicit ids, or rerun `vis release publish` with publish.stage: true.");return}return d.pending.map(i=>i.id)}const n=a.stageIds??[];if(n.length===0){o.error("Pass stage ids positionally, or use --all to approve every pending stage in .vis/release/staged.json.");return}return n},E=async(t,a,o,n,s)=>{const d=t==="approve"?await k(o,n,s):n.stageIds;if(!d||d.length===0){t==="reject"&&s.error("Pass stage ids positionally to reject."),process.exitCode=1;return}const i=[],f=[];for(const c of d){const r=await a.run("npm",["stage",t,c],{cwd:o,silent:!1});r.exitCode===0?i.push(c):f.push({id:c,reason:r.stderr.trim()||`exit ${r.exitCode}`})}if(s.info(""),i.length>0){s.info(`${t==="approve"?"Approved":"Rejected"} ${i.length} stage(s).`);let c=[];try{const r=await m({cwd:o}),u=r.config.changesDir??g,l=await y(o,u);if(t==="reject"){const p=new Set(i);c=l.pending.filter(e=>p.has(e.id)).map(e=>({name:e.name,version:e.version}))}const h=w(l,i);if(h!==l){const p=await x(o,u,h);if(p.changed&&n.commit!==!1){const{stageAndCommitFile:e}=await import("./git.js"),v=p.removed?"chore(release): clear pending stage registry [skip ci]":`chore(release): ${t} ${i.length} stage${i.length===1?"":"s"} [skip ci]`;await e({cwd:o,runner:a},p.path,v,{author:r.config.gitUser,push:n.push!==!1,sign:r.config.gitSignCommits===!0}),s.info(`Updated ${p.path} and committed${n.push===!1?"":" + pushed"}.`)}else p.changed&&s.info(`Updated ${p.path}. Commit + push it so the next release wave sees the resolved state.`)}}catch(r){s.warn(`Could not update staged registry: ${r.message}`)}if(c.length>0){s.info(""),s.info("Orphan CHANGELOG sections to review:");for(const r of c)s.info(` Edit CHANGELOG.md for ${r.name} to remove the orphan ${r.version} section before the next wave`);s.info("(Workspace CHANGELOG.md is unaffected — its wave entry is written from the publish phase against actually-published versions.)")}}if(f.length>0){for(const c of f)s.error(` ${c.id}: ${c.reason}`);process.exitCode=1}},G=async({logger:t,options:a,workspaceRoot:o})=>{const n=o??process.cwd(),s=j(a.action);if(s===void 0){t.error(`Unknown action "${a.action}". Expected one of: list, approve, reject.`),process.exitCode=1;return}const d=$();if(s==="list"){await N(d,n,a,t);return}let i,f=!1;if(a.commit!==!1)try{i=(await m({cwd:n})).config.changesDir??g,await C(n,i),f=!0}catch(c){t.error(`Could not acquire release lock: ${c.message}`),process.exitCode=1;return}try{await E(s,d,n,a,t)}finally{f&&i&&await A(n,i)}};export{G as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{b as
|
|
1
|
+
import{b as c,a as o}from"./orchestrator.js";import{VisReleaseError as d}from"../packem_shared/VisReleaseError-DZtgcKf8.js";const p=async({logger:e,options:a,workspaceRoot:r})=>{const l=r??process.cwd(),s=a.dryRun===!0,t=await c({channel:a.channel,cwd:l,firstRelease:a.firstRelease===!0,projects:a.filter?a.filter.split(",").map(n=>n.trim()).filter(Boolean):void 0}),{printConfigIfRequested:f}=await import("./print-config.js");if(f(a,t,e))return;if(a.checkOnly===!0){if(e.info(`Preflight: ${t.plan.releases.length} pending release(s)${t.channel?` on channel "${t.channel.tag}"`:""}.`),t.plan.warnings.length>0)for(const n of t.plan.warnings)e.warn(` - ${n}`);process.exitCode=t.plan.releases.length===0?1:0;return}if(t.plan.releases.length===0){e.info("No pending releases — nothing to version."),process.exitCode=0;return}t.channel&&e.info(`Channel: ${t.channel.tag}${t.channel.prerelease?` (preid: ${t.channel.prerelease})`:""}`),e.info(`${s?"[dry-run] would version":"Versioning"} ${t.plan.releases.length} package(s)...`);for(const n of t.plan.releases)e.info(` ${n.name}: ${n.oldVersion} → ${n.newVersion}`);let i;try{i=await o(t,{commit:a.commit===!0,dryRun:s})}catch(n){if(n instanceof d&&n.code==="STAGE_PENDING"){e.error(n.message),n.hint&&(e.info(""),e.info(`Next steps: ${n.hint}`)),process.exitCode=1;return}throw n}if(s){e.info(""),e.info(`[dry-run] would write ${i.changedFiles.length} file(s):`);for(const n of i.changedFiles)e.info(` ${n}`);if(i.deletedFiles.length>0){e.info(`[dry-run] would delete ${i.deletedFiles.length} change file(s):`);for(const n of i.deletedFiles)e.info(` ${n}`)}e.info(""),e.info("Dry run complete. No changes made.")}else e.info(""),e.info(`Wrote ${i.changedFiles.length} file(s); deleted ${i.deletedFiles.length} consumed change file(s).`),i.commitSha?e.info(`Committed as ${i.commitSha.slice(0,7)}.`):a.commit&&e.warn("--commit was requested but no commit was made (likely no changes to commit).");if(t.plan.warnings.length>0){e.info(""),e.warn(`${t.plan.warnings.length} warning(s):`);for(const n of t.plan.warnings)e.warn(` - ${n}`)}};export{p as default};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`);else if(n==="ndjson")for(const e of
|
|
3
|
-
`);else if(
|
|
4
|
-
`);return}r.warn(`${
|
|
5
|
-
`,"utf8"),
|
|
6
|
-
`);return}r.info(`Signed SLSA v1 provenance for ${v(a)} (sha256 ${
|
|
1
|
+
import{createRequire as $}from"node:module";import{E as j,R as E,q as I}from"./catalog.js";import{d as P}from"../packem_shared/pm-runner-de-jCq8q.js";import{l as C}from"../packem_shared/dependency-scan-DBH2Qo4I.js";import{r as T}from"../packem_shared/provenance-CvfQEJPQ.js";import{r as D}from"../packem_shared/signatures-oZ_2IneN.js";import{loadOptionalSigstore as R}from"./loader.js";let y;const N=s=>(y??=$(import.meta.url))(s),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=s=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[t,r]=m.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return m.getBuiltinModule(s)}return N(s)},{createHash:O}=_("node:crypto"),{isAbsolute:k,resolve:S,basename:v}=_("node:path"),q=s=>(s??"").split(",").map(t=>t.trim()).filter(t=>t.length>0),G=async({logger:s,options:t,workspaceRoot:r})=>{if(!r)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const n=t.format??"table",c=t.prodOnly??!1,u=t.failOn==="error"?"error":"warning",d=q(t.allowlist),a=P(r),l=C(r,a.name,{includeDev:!c}).map(({name:e,version:o})=>({name:e,version:o})),[f,p]=await Promise.all([T(l,{allowlist:d,workspaceRoot:r}),D(l,{allowlist:d,workspaceRoot:r})]),i=[...f.map(e=>({code:"provenance-regression",message:`Resolved ${e.packageName}@${e.version} has no published provenance attestation, but ${e.packageName}@${e.priorVersionWithProvenance} did — a provenance regression.`,packageName:e.packageName,severity:"warning",version:e.version})),...p.map(e=>({code:e.code,message:e.message,packageName:e.packageName,severity:e.severity,version:e.version}))],g=i.filter(e=>u==="error"?e.severity==="error":!0);if(n==="json")process.stdout.write(`${JSON.stringify({findings:i,ok:g.length===0},void 0,2)}
|
|
2
|
+
`);else if(n==="ndjson")for(const e of i)process.stdout.write(`${JSON.stringify(e)}
|
|
3
|
+
`);else if(i.length===0)s.info(`No provenance regressions or signature problems across ${String(l.length)} locked packages.`);else{const e=process.stdout.columns||80;s.info(j(E.createElement(I,{data:i.map(o=>({code:o.code,package:`${o.packageName}@${o.version}`,severity:o.severity}))}),{columns:e}));for(const o of i)s.warn(`${o.packageName}@${o.version}: ${o.message}`)}g.length>0&&(process.exitCode=1)},x=()=>process.env.CI==="true"||typeof process.env.ACTIONS_ID_TOKEN_REQUEST_URL=="string"||typeof process.env.SIGSTORE_ID_TOKEN=="string",J=(s,t,r)=>({_type:"https://in-toto.io/Statement/v1",predicate:{buildDefinition:{buildType:"https://visulima.com/vis/attest/v1",externalParameters:{workspaceRoot:r},internalParameters:{},resolvedDependencies:[]},runDetails:{builder:{id:"https://visulima.com/vis"},metadata:{invocationId:process.env.GITHUB_RUN_ID??"",startedOn:new Date().toISOString()}}},predicateType:"https://slsa.dev/provenance/v1",subject:[{digest:{sha256:t},name:s}]}),H=async({argument:s,fs:t,logger:r,options:n,workspaceRoot:c})=>{if(!c)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const u=s[0];if(!u)throw new Error("Missing subject. Usage: vis attest <path-to-artifact>");const d=n.predicate??"slsaProvenance";if(d!=="slsaProvenance")throw new Error(`Unsupported predicate '${d}'. Only 'slsaProvenance' is supported.`);const a=k(u)?u:S(c,u),w=n.requireSigning??!1,l=n.format??"table";let f;try{f=await t.readFile(a)}catch{throw new Error(`Cannot read subject artifact at ${a}.`)}const p=O("sha256").update(f).digest("hex");if(!x()){const b="No ambient OIDC token (not running in CI). Keyless signing needs a Fulcio identity from CI OIDC.";if(w)throw new Error(`${b} Re-run in CI or drop --require-signing.`);if(l==="json"){process.stdout.write(`${JSON.stringify({ok:!1,reason:"no-ambient-oidc",sha256:p,skipped:!0,subject:v(a)},void 0,2)}
|
|
4
|
+
`);return}r.warn(`${b} Skipping signing (subject sha256: ${p}). Pass --require-signing to make this fatal.`);return}const i=J(v(a),p,c),g=Buffer.from(JSON.stringify(i)),o=await(await R({workspaceRoot:c})).attest(g,"application/vnd.in-toto+json"),h=n.output?k(n.output)?n.output:S(c,n.output):`${a}.sigstore`;if(await t.writeFile(h,`${JSON.stringify(o,void 0,2)}
|
|
5
|
+
`,"utf8"),l==="json"){process.stdout.write(`${JSON.stringify({bundle:h,ok:!0,sha256:p,subject:v(a)},void 0,2)}
|
|
6
|
+
`);return}r.info(`Signed SLSA v1 provenance for ${v(a)} (sha256 ${p.slice(0,16)}…).`),r.info(`Bundle written to ${h}.`)};export{H as attestEmitExecute,G as attestVerifyExecute};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{
|
|
2
|
-
`,
|
|
1
|
+
import{c as b,a as l,D as d,T as y}from"../packem_shared/ai-analysis-DSQQDFU9.js";import{E as g,R as x,q as S}from"./catalog.js";import{q as w,F as u,D as E,J as I,r as D}from"../packem_shared/index.server-CwSgbeN7.js";const p={command:"ai",description:"AI-assisted commands: provider detection, cache management, and failure-fix proposals."},R=e=>{if(typeof e!="function")return String(e);const{name:n}=e;return n==="Boolean"?"boolean":n==="Number"?"number":n==="String"?"string":n??"unknown"},A=e=>{const n=[...e.commandPath??[],e.name].join(" "),s=(e.examples??[]).map(([t,r])=>({command:t??"",description:r??""})),o=(e.options??[]).map(t=>({defaultValue:t.defaultValue,description:t.description,name:t.name,type:R(t.type)}));return{argument:e.argument?{description:e.argument.description,name:e.argument.name}:void 0,description:e.description??"",examples:s,name:e.name,options:o,path:n}},f=(e,n=p)=>({command:n.command,description:n.description,subcommands:e.map(s=>A(s))}),P=(e,n=p)=>`${JSON.stringify(f(e,n),void 0,2)}
|
|
2
|
+
`,T=(e,n=p)=>{const s=f(e,n),o=[w(`vis ${s.command} — ${s.description}`),"",u("Subcommands:")];for(const t of s.subcommands){const r=t.argument?` ${E(`<${t.argument.name}>`)}`:"";if(o.push(""),o.push(` ${I(`vis ${t.path}`)}${r}`),t.description&&o.push(` ${t.description}`),t.options.length>0){const a=t.options.map(c=>`--${c.name}${c.type==="boolean"?"":`=<${c.type}>`}`).join(", ");o.push(u(` options: ${a}`))}if(t.examples.length>0){o.push(u(" examples:"));for(const a of t.examples){const c=a.description?u(` — ${a.description}`):"";o.push(` ${D(a.command)}${c}`)}}}return o.push(""),o.push(u(`Run \`vis ${s.command} discover-help\` for the machine-readable JSON catalogue (designed for AI agents).`)),o.push(u(`Run \`vis ${s.command} <subcommand> --help\` for full usage of a specific subcommand.`)),`${o.join(`
|
|
3
3
|
`)}
|
|
4
|
-
`},h=async()=>{const{default:e}=await import("./cli-main.js").then(
|
|
5
|
-
`);return}const
|
|
6
|
-
Selected provider: ${
|
|
7
|
-
No AI provider available. Install one of the supported AI CLI tools.`)},q=async e=>{const{aiFix:
|
|
4
|
+
`},h=async()=>{const{default:e}=await import("./cli-main.js").then(n=>n.av);return e.filter(n=>n.name!=="ai")},J=async()=>{const e=await h();process.stderr.write(T(e))},j=async()=>{const e=await h();process.stdout.write(P(e))},F=async({logger:e,visConfig:n})=>{const s=n?.ai,o=l(s);if(!o){e.error("No AI provider available to test."),process.exitCode=1;return}e.info(`Testing ${o.name}...`);try{const t=await y(o,"Reply with exactly: OK",{timeoutMs:3e4});e.info(`Provider ${o.name} responded: ${t.stdout.trim().slice(0,200)}`)}catch(t){const r=t instanceof Error?t.message:String(t);e.error(`Provider ${o.name} failed: ${r}`),process.exitCode=1}},M=({logger:e,options:n,visConfig:s})=>{const o=n.format??"table",t=s?.ai,r=b(),a=l(t);if(o==="json"){const i=r.map(m=>({available:m.available,method:m.detectionMethod,name:m.name,path:m.path,priority:d[m.name]??0,selected:m.name===a?.name,version:m.version}));process.stdout.write(`${JSON.stringify(i,void 0,2)}
|
|
5
|
+
`);return}const c=r.map(i=>({method:i.detectionMethod??"-",path:i.path??"-",priority:String(d[i.name]??0),provider:i.name,selected:i.name===a?.name?">>>":"",status:i.available?"available":"not found",version:i.version??"-"})),v=process.stdout.columns||80,$=g(x.createElement(S,{data:c}),{columns:v});e.info($),a?e.info(`
|
|
6
|
+
Selected provider: ${a.name} (priority ${String(d[a.name]??0)})`):e.info(`
|
|
7
|
+
No AI provider available. Install one of the supported AI CLI tools.`)},q=async e=>{const{aiFix:n}=await import("./fix.js");await n(e)};export{j as aiDiscoverHelpExecute,q as aiFixExecute,M as aiProvidersExecute,J as aiRootExecute,F as aiTestExecute};
|
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
${
|
|
3
|
-
`)}`,
|
|
4
|
-
`}`,
|
|
1
|
+
import{createRequire as B}from"node:module";import{z as E}from"../packem_shared/index-DHD8wb6Z.js";import{findVisConfigFile as D}from"./CONFIG_FILES.js";import{y as V}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{U as w}from"../packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js";import{p as e}from"./cli-main.js";import{d as C}from"../packem_shared/pm-runner-de-jCq8q.js";import{a as F}from"../packem_shared/build-scripts-pdVmqXRm.js";import{s as O}from"../packem_shared/native-config-sync-BSzU4qUO.js";let N;const M=c=>(N??=B(import.meta.url))(c),$=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=c=>{if(typeof $<"u"&&$.versions&&$.versions.node){const[t,s]=$.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return $.getBuiltinModule(c)}return M(c)},{spawnSync:A}=T("node:child_process"),P=/(defineConfig\s*\(\s*\{)/,q=/(export\s+default\s+\{)/,y=(c,t)=>`${t}${JSON.stringify(c)}: true,`,z=(c,t)=>{if(t.length===0)return{added:[],skipped:[],status:"noop"};const s=D(c);if(!s)return{added:[],skipped:t,status:"no-config"};if(!V(s))return{added:[],skipped:t,status:"no-config"};const n=E(s),h=n.search(/installScripts\s*:\s*\{/);let l=null,r=0;if(h!==-1){const a=n.slice(h),d=/(allow\s*:\s*\{)([^}]*)(\})/.exec(a);d?.index!==void 0&&(l=d,r=h+d.index)}if(l){const a=l[2]??"",f=new Set;for(const g of a.matchAll(/["']([^"']+)["']\s*:/g))f.add(g[1]);for(const g of a.matchAll(/(?:^|,|\{)\s*([a-z_$][\w-]*)\s*:/gi))f.add(g[1]);const d=[],k=[];for(const g of t)f.has(g)?k.push(g):d.push(g);if(d.length===0)return{added:[],configPath:s,skipped:k,status:"noop"};const x=/\n([ \t]+)\S/.exec(a)?.[1]??" ",_=`
|
|
2
|
+
${d.map(g=>y(g,x)).join(`
|
|
3
|
+
`)}`,v=a.replace(/\s+$/,""),S=a.slice(v.length),R=`${v}${v.endsWith(",")||v===""?"":","}${_}${S.length>0?S:`
|
|
4
|
+
`}`,j=`${n.slice(0,r)}${l[1]}${R}${l[3]}${n.slice(r+l[0].length)}`;return w(s,j),{added:d,configPath:s,skipped:k,status:"updated"}}const i=/(installScripts\s*:\s*\{)/;if(i.test(n)){const a=`
|
|
5
5
|
allow: {
|
|
6
|
-
${t.map(
|
|
6
|
+
${t.map(d=>y(d," ")).join(`
|
|
7
7
|
`)}
|
|
8
|
-
},`,
|
|
8
|
+
},`,f=n.replace(i,`$1${a}`);return w(s,f),{added:t,configPath:s,skipped:[],status:"updated"}}const o=/(policies\s*:\s*\{)/;if(o.test(n)){const a=`
|
|
9
9
|
installScripts: {
|
|
10
10
|
allow: {
|
|
11
|
-
${t.map(
|
|
11
|
+
${t.map(d=>y(d," ")).join(`
|
|
12
12
|
`)}
|
|
13
13
|
},
|
|
14
|
-
},`,
|
|
14
|
+
},`,f=n.replace(o,`$1${a}`);return w(s,f),{added:t,configPath:s,skipped:[],status:"updated"}}const u=/(security\s*:\s*\{)/;if(u.test(n)){const a=`
|
|
15
15
|
policies: {
|
|
16
16
|
installScripts: {
|
|
17
17
|
allow: {
|
|
18
|
-
${t.map(
|
|
18
|
+
${t.map(d=>y(d," ")).join(`
|
|
19
19
|
`)}
|
|
20
20
|
},
|
|
21
21
|
},
|
|
22
|
-
},`,
|
|
22
|
+
},`,f=n.replace(u,`$1${a}`);return w(s,f),{added:t,configPath:s,skipped:[],status:"updated"}}const p=P.exec(n)??q.exec(n);if(!p)return{added:[],configPath:s,skipped:t,status:"missing-anchor"};const m=`
|
|
23
23
|
security: {
|
|
24
24
|
policies: {
|
|
25
25
|
installScripts: {
|
|
26
26
|
allow: {
|
|
27
|
-
${t.map(a=>
|
|
27
|
+
${t.map(a=>y(a," ")).join(`
|
|
28
28
|
`)}
|
|
29
29
|
},
|
|
30
30
|
},
|
|
31
31
|
},
|
|
32
|
-
},`,
|
|
33
|
-
`);for(const o of
|
|
32
|
+
},`,b=`${n.slice(0,p.index+p[0].length)}${m}${n.slice(p.index+p[0].length)}`;return w(s,b),{added:t,configPath:s,skipped:[],status:"updated"}},Z=async({options:c,visConfig:t,workspaceRoot:s})=>{const n=s??process.cwd(),h=C(n);if(h.name==="pnpm"&&!c.scan){e.info("Delegating to pnpm approve-builds...");const l=["approve-builds"];c.all&&l.push("--all");const r=A("pnpm",l,{cwd:n,stdio:"inherit"});if(r.error)throw new Error(`Failed to run pnpm approve-builds: ${r.error.message}`);if(r.status!==0&&r.status!==null&&(e.error(`pnpm approve-builds exited with code ${r.status}`),process.exitCode=r.status),!c.syncNative){e.notice(""),e.notice("Tip: vis.config.ts security.policies.installScripts.allow may now be out of sync with pnpm-workspace.yaml."),e.notice("Run 'vis check --security-config' to compare, or copy the new entries into vis.config.ts.");return}}else{const l=t?.security?.policies?.installScripts?.allow??{},r=t?.security?.pinVersions===!0,i=F(n,l,{pinVersions:r});if(i.unapproved.length===0)e.success("No unapproved build scripts found."),c.write&&(e.info(""),e.info("Nothing to write — there are no unapproved build scripts."));else{e.warn(`Found ${i.unapproved.length} package${i.unapproved.length===1?"":"s"} with unapproved build scripts:
|
|
33
|
+
`);for(const o of i.unapproved)e.info(` ${o.name} (${o.hooks.join(", ")})`);e.notice(""),e.notice("To approve these packages, add them to vis.config.ts:"),e.notice(""),e.notice(" security: {"),e.notice(" policies: {"),e.notice(" installScripts: {"),e.notice(" allow: {");for(const o of i.unapproved){const u=r&&o.version?`${o.name}@${o.version}`:o.name;e.notice(` "${u}": true,`)}if(e.notice(" },"),e.notice(" },"),e.notice(" },"),e.notice(" },"),h.name==="pnpm"&&(e.notice(""),e.notice("Or run 'pnpm approve-builds' to update pnpm-workspace.yaml directly.")),c.write){const o=t?.security?.pinVersions===!0,u=i.unapproved.map(m=>o&&m.version?`${m.name}@${m.version}`:m.name),p=z(n,u);switch(e.info(""),p.status){case"missing-anchor":{e.warn(`Could not locate 'defineConfig({' or 'export default {' in ${String(p.configPath)} — please add entries manually.`);break}case"no-config":{e.warn("No vis.config.ts found. Run 'vis init' first, then re-run with --write.");break}case"noop":{e.info(`All ${String(u.length)} entr${u.length===1?"y":"ies"} were already present in vis.config.ts security.policies.installScripts.allow.`);break}default:e.success(`Wrote ${String(p.added.length)} entr${p.added.length===1?"y":"ies"} to ${String(p.configPath)}.`),p.skipped.length>0&&e.info(`Skipped ${String(p.skipped.length)} already-present entr${p.skipped.length===1?"y":"ies"}.`)}}}if(i.excess.length>0){e.notice(""),e.warn(`Stale installScripts.allow entries — ${String(i.excess.length)} pattern${i.excess.length===1?"":"s"} no longer match any installed package:`);for(const o of i.excess)e.info(` ${o}`);e.notice("Consider removing these entries from vis.config.ts security.policies.installScripts.allow.")}if(i.versionDrift.length>0){e.notice(""),e.warn(`Version drift — ${String(i.versionDrift.length)} entr${i.versionDrift.length===1?"y":"ies"} pinned to an outdated version:`);for(const{from:o,to:u}of i.versionDrift)e.info(` ${o} → ${u}`);e.notice("Rename the keys in vis.config.ts security.policies.installScripts.allow to migrate.")}}if(c.syncNative){const l=t?.security?.policies?.installScripts?.allow??{};if(Object.keys(l).length===0)e.warn("No security.policies.installScripts.allow configured in vis.config.ts. Nothing to sync.");else{const r=O(h.name,n,l);e.info("");for(const i of r)e.success(i)}}};export{Z as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`):t.info(
|
|
3
|
-
`)[0]??"";if(
|
|
1
|
+
import{createRequire as F}from"node:module";import{getAffectedProjects as T}from"@visulima/task-runner";import{d as H,b as D}from"./catalog.js";let I;const M=e=>(I??=F(import.meta.url))(e),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=e=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[t,r]=g.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return g.getBuiltinModule(e)}return M(e)},{execFile:N}=k("node:child_process"),{promisify:G}=k("node:util"),P=G(N),V=["[skip ci]","[ci skip]","[no ci]","[vis skip]","[nx skip]"],q=["[vis deploy]","[nx deploy]"],J=["vis","nx"],K=["CACHED_COMMIT_REF","VERCEL_GIT_PREVIOUS_SHA","GITHUB_BASE_REF","CI_COMMIT_BEFORE_SHA"],L=/^[\w./~^@{}][\w.\-/~^@{}]*$/,U=(e=process.env)=>{for(const t of K){const r=e[t];if(r&&r.trim().length>0)return r.trim()}},w=e=>{if(!L.test(e))throw new Error(`Invalid git ref: "${e}". Refs must start with an alphanumeric character or one of _ . / ~ ^ @ { } and may only contain letters, digits, dots, dashes, underscores, slashes, tildes, carets, @, and braces.`)},W=async(e,t)=>{try{return await P("git",["rev-parse","--verify",`${t}^{commit}`],{cwd:e}),!0}catch{return!1}},Z=async e=>{try{const{stdout:t}=await P("git",["log","-1","--pretty=%B"],{cwd:e});return t}catch{return""}},B=(e,t,r)=>J.some(i=>e.includes(`[${i} ${t} ${r}]`)),z=(e,t)=>V.some(r=>e.includes(r))||B(e,"skip",t),X=(e,t)=>q.some(r=>e.includes(r))||B(e,"deploy",t),f=(e,t,r,i)=>({action:"build",message:r,project:e,reason:t,...i}),y=(e,t,r,i)=>({action:"skip",message:r,project:e,reason:t,...i}),Q=e=>`${e.action==="skip"?"🛑":"✅"} ${e.message}`,Y=(e,t)=>e.action==="skip"||t?0:1,S=new Set(["deep","direct","none"]),se=async({argument:e,logger:t,options:r,visConfig:i,workspaceRoot:l})=>{const s=e[0]??"",E=!!r.json,A=!!r.verbose,O=!!(r["exit-zero-on-build"]??r.exitZeroOnBuild),u=n=>{A&&!E&&t.info(`❱ ${n}`)},o=n=>{E?process.stdout.write(`${JSON.stringify(n)}
|
|
2
|
+
`):t.info(Q(n)),process.exit(Y(n,O))};if(!s)return o(f("","missing-project-argument","Missing project argument. Usage: vis ci ignore <project>"));if(!l)return o(f(s,"workspace-error","Could not determine workspace root — building defensively"));const m=await Z(l),_=m.trim().split(`
|
|
3
|
+
`)[0]??"";if(u(`commit: ${_}`),m&&X(m,s))return o(f(s,"commit-force-deploy",`Force-deploy keyword in commit: "${_}"`));if(m&&z(m,s))return o(y(s,"commit-skip",`Skip keyword in commit: "${_}"`));let h,v;try{({packageJsons:v,workspace:h}=H(l,i))}catch(n){const a=n instanceof Error?n.message:String(n);return o(f(s,"workspace-error",`Workspace discovery failed (${a}) — building defensively`))}if(!Object.hasOwn(h.projects,s))return o(f(s,"project-unknown",`Project "${s}" not found in workspace — building defensively`));try{const n=r.base?.trim(),a=U();let c=n||a||"HEAD~1";const p=r.head?.trim()||"HEAD";w(c),w(p),u(`resolved base ref: ${c} (source: ${n?"flag":a?"ci-env":"default"})`);const R=W(l,c),x=D(l,h,v);await R||(u(`base ref ${c} not reachable — falling back to HEAD~1`),c="HEAD~1"),u(`comparing ${c}...${p}`);const b=r.downstream??"deep",j=r.upstream??"none";if(!S.has(b))throw new Error(`Invalid --downstream value: "${b}". Must be "none", "direct", or "deep".`);if(!S.has(j))throw new Error(`Invalid --upstream value: "${j}". Must be "none", "direct", or "deep".`);const C={base:c,downstream:b,head:p,projectGraph:x,projects:h.projects,upstream:j,workspaceRoot:l},d=await T(C);u(`changed files: ${d.changedFiles.length}`),u(`affected projects: ${d.affectedProjects.join(", ")||"(none)"}`);const $={base:c,head:p};return d.changedFiles.length===0?o(y(s,"no-changes",`No files changed between ${c}...${p}`,{...$,affectedProjects:[]})):d.affectedProjects.includes(s)?o(f(s,"project-affected",`Build ${s}: affected by ${d.changedFiles.length} changed file(s)`,{...$,affectedProjects:d.affectedProjects})):o(y(s,"project-not-affected",`Skip ${s}: not affected by changes between ${c}...${p}`,{...$,affectedProjects:d.affectedProjects}))}catch(n){const a=n instanceof Error?n.message:String(n);return t.error(`Affected detection failed: ${a}`),o(f(s,"workspace-error",`Affected detection failed (${a}) — building defensively`))}};export{se as default};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{F as p}from"../packem_shared/index.server-CwSgbeN7.js";import{e as f}from"../packem_shared/index-DHD8wb6Z.js";const g={docker:".dockerignore",npm:".npmignore",slug:".slugignore",vercel:".vercelignore"},m=[".git",".gitattributes",".gitignore",".editorconfig",".vscode/",".idea/",".DS_Store","*.md","LICENSE*","LICENCE*","CHANGELOG*","CONTRIBUTING*","AUTHORS*","docs/","doc/","examples/","example/",".github/",".gitlab-ci.yml",".circleci/","appveyor.yml",".eslintrc*","eslint.config.*",".prettierrc*","prettier.config.*","*.log","npm-debug.log*","*.d.ts","*.map","*.flow","tsconfig*.json","__tests__/","__mocks__/","test/","tests/","*.test.*","*.spec.*","coverage/",".nyc_output/"],w={docker:["node_modules",".vis/","Dockerfile*",".dockerignore"],npm:[],slug:["node_modules"],vercel:["node_modules",".vercel/"]},E=e=>{const r=new Set,o=[];for(const t of[...m,...w[e]])r.has(t)||(r.add(t),o.push(t));return o},_=e=>e.trim(),h="# Added by vis ignore",$=(e,r)=>{const o=new Set;for(const n of e.split(/\r?\n/u)){const i=_(n);i!==""&&!i.startsWith("#")&&o.add(i)}const t=[];for(const n of r)o.has(n)||(o.add(n),t.push(n));if(t.length===0)return{added:t,content:e};const s=e.includes(`\r
|
|
2
2
|
`)?`\r
|
|
3
3
|
`:`
|
|
4
|
-
`,d=[
|
|
5
|
-
`)?s:`${s}${s}`;return{added:t,content:`${e}${
|
|
6
|
-
`);return}if(
|
|
4
|
+
`,d=[h,...t].join(s);if(e.trim()==="")return{added:t,content:`${d}${s}`};const c=e.endsWith(`
|
|
5
|
+
`)?s:`${s}${s}`;return{added:t,content:`${e}${c}${d}${s}`}},S=e=>e==="docker"||e==="npm"||e==="slug"||e==="vercel",I=async(e,r)=>{try{return await e.readFile(r,"utf8")}catch{return""}},y=async({fs:e,logger:r,options:o,process:t,workspaceRoot:s})=>{const d=s??t.cwd,c=o.target??"docker";if(!S(c))throw new Error(`Invalid --target "${c}". Expected one of: docker, vercel, npm, slug.`);const n=g[c],i=f(d,n),u=await I(e,i),{added:a,content:l}=$(u,E(c));if(o.json){process.stdout.write(`${JSON.stringify({added:a,file:n,target:c},null,2)}
|
|
6
|
+
`);return}if(o.write){if(a.length===0){r.info(`${n} is already up to date (no new patterns).`);return}await e.writeFile(i,l),r.info(`Added ${a.length} pattern(s) to ${n}.`);return}process.stdout.write(l.endsWith(`
|
|
7
7
|
`)?l:`${l}
|
|
8
|
-
`),r.info(
|
|
8
|
+
`),r.info(p(`(${a.length} new pattern(s); re-run with --write to save ${n})`))};export{y as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{F as p}from"../packem_shared/index.server-CwSgbeN7.js";import{e as m,z as k}from"../packem_shared/index-DHD8wb6Z.js";import{a as y,b as h,f as w}from"../packem_shared/subtree-DtmcKAJK.js";import{n as u}from"../packem_shared/utils-DQFHJn72.js";import{v as $,j as x}from"./catalog.js";import{y as A}from"../packem_shared/isAccessibleSync-DYKTrrvc-CSnBISfV.js";import{U as b}from"../packem_shared/writeFileSync-DJoHk3Ks-CgQ-VNNT.js";import{p as E}from"../packem_shared/readJsonSync-CbryXYxN-B2aSeDpC.js";import{T as l}from"../packem_shared/target-merge-D1xbylFw.js";const P=["aube-workspace.yaml","pnpm-workspace.yaml"],v=/^\s*packages\s*:\s*$/,j=/^(\s*)-\s/,I=(c,i)=>{const s=c.includes(`\r
|
|
2
2
|
`)?`\r
|
|
3
3
|
`:`
|
|
4
|
-
`,e=c.split(/\r?\n/),
|
|
4
|
+
`,e=c.split(/\r?\n/),n=e.findIndex(r=>v.test(r));if(n===-1)return;let t=" ";for(let r=n+1;r<e.length;r++){const o=j.exec(e[r]);if(o){t=o[1];break}if(e[r].trim().length>0)break}return e.splice(n+1,0,`${t}- "${i}"`),e.join(s)},R=(c,i,s)=>{const e=m(c,"package.json");let n;try{n=E(e)}catch{return!1}const{workspaces:t}=n;return Array.isArray(t)?t.includes(i)?!1:(s||l(e,{...n,workspaces:[...t,i]},{detectIndent:!0}),!0):t&&typeof t=="object"&&Array.isArray(t.packages)?t.packages.includes(i)?!1:(s||l(e,{...n,workspaces:{...t,packages:[...t.packages,i]}},{detectIndent:!0}),!0):!1},q=({dryRun:c=!1,prefix:i,workspaceRoot:s})=>{const e=u(i),n=$(s);if(!n)return{status:"no-config"};if(x(s,n).some(r=>u(r)===e))return{status:"already-covered"};for(const r of P){const o=m(s,r);if(!A(o))continue;const a=I(k(o),e);if(a!==void 0)return c||b(o,a),{entry:e,file:r,status:"added"}}return R(s,e,c)?{entry:e,file:"package.json",status:"added"}:{status:"no-config"}},z=async({argument:c,fs:i,logger:s,options:e,process:n,workspaceRoot:t})=>{const r=c[0];if(!r)throw new Error("Missing <source>. Pass a git repository URL or local path to import.");if(!e.prefix)throw new Error("Missing --prefix <dir>. Pass the target directory in the monorepo (e.g. packages/tooling/foo).");const o=t??n.cwd,a=u(e.prefix),d=e.ref??"HEAD";if(y(o),await(async f=>{try{return await i.access(f),!0}catch{return!1}})(m(o,a)))throw new Error(`Target "${a}" already exists. git subtree add requires a non-existent prefix.`);if(e.dryRun){const f=e.squash?" --squash":"",g=e.message?` -m "${e.message}"`:"";s.info("Dry run — no changes will be made. Planned steps:"),s.info(` git subtree add --prefix=${a}${f}${g} ${r} ${d}`),e.noRegister||s.info(` register ${a} into the workspace config (skipped if already covered by an existing glob)`);return}if(h(o),s.info(`Importing ${p(r)}@${d} → ${a} ...`),w({cwd:o,message:e.message,prefix:a,ref:d,repo:r,squash:e.squash}),s.info(`✓ Imported ${r} into ${a} (history preserved).`),e.noRegister)s.info(p(`Skipped workspace registration (--no-register). Add ${a} to your workspace config manually.`));else{const f=q({prefix:a,workspaceRoot:o});f.status==="already-covered"?s.info(`✓ ${a} is already covered by an existing workspace glob.`):f.status==="added"?s.info(`✓ Registered ${f.entry} in ${f.file}.`):s.warn(`Could not auto-register ${a}: no workspace config found. Add it to pnpm-workspace.yaml or package.json#workspaces manually.`)}s.info(p("Note: project.json / nx tags are not generated. Add them if your tooling needs them."))};export{z as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{a as I}from"../packem_shared/index-DHD8wb6Z.js";import{d as O}from"./catalog.js";import{f as D,a as x}from"../packem_shared/selectors-B7lSFz7l.js";import E from"./index.js";import{v as J}from"./cli-main.js";const S=(e,t)=>{for(const l of t)if(E(l,e))return!0;return!1},q=(e,t={})=>{const{depTypes:l,excludePatterns:f,externalOnly:h,includePatterns:m,internalOnly:g}=t;if(g&&h)return[];const d=l&&l.length>0?new Set(l):void 0,k=m&&m.length>0?m:void 0,w=f&&f.length>0?f:void 0,N=[];for(const y of e)g&&!y.isInternal||h&&y.isInternal||d&&!d.has(y.depType)||k&&(!y.packageName||!S(y.packageName,k))||w&&y.packageName&&S(y.packageName,w)||N.push(y);return N},C=new Set(["json","ndjson","table"]),M=e=>{if(e===void 0)return"table";const t=e.toLowerCase();if(!C.has(t))throw new Error(`--format must be one of: table, json, ndjson (got "${e}")`);return t},P=(e,t)=>({depName:e.depName,depType:e.depType,isInternal:e.isInternal,packageDir:e.packageDir,packageJsonPath:I(t,e.packageJsonPath),packageName:e.packageName,specifier:e.specifier}),$=new Set(["dependencies","devDependencies","optionalDependencies","overrides","peerDependencies","pnpm.overrides","resolutions"]),A=e=>{if(!e||e.length===0)return;const t=[],l=[];for(const f of e)for(const h of f.split(",")){const m=h.trim();m&&($.has(m)?t.push(m):l.push(m))}if(l.length>0)throw new Error(`Unknown --dep-type value(s): ${l.join(", ")}. Valid: ${[...$].join(", ")}`);return t.length>0?t:void 0},V=async({logger:e,options:t,visConfig:l,workspaceRoot:f})=>{if(!f)throw new Error("Could not determine workspace root.");const h=M(t.format);if(t.deps===!0){if(t.internalOnly&&t.externalOnly)throw new Error("--internal-only and --external-only are mutually exclusive");const p=A(t.depType),c=J(f);let r=q(c,{depTypes:p,excludePatterns:t.exclude,externalOnly:t.externalOnly,includePatterns:t.include,internalOnly:t.internalOnly});if(t.query||t.tag&&t.tag.length>0){const{workspace:n}=O(f,l),i=D(Object.keys(n.projects),n,t.query),T=new Set(x(i,n,t.tag));r=r.filter(v=>v.packageName!==void 0&&T.has(v.packageName))}const u=[...r].sort((n,i)=>{const T=`${n.packageName??n.packageDir} ${n.depType} ${n.depName}`,v=`${i.packageName??i.packageDir} ${i.depType} ${i.depName}`;return T.localeCompare(v)});if(h==="ndjson"){for(const n of u)e.info(JSON.stringify(P(n,f)));return}if(h==="json"){const n=u.map(i=>P(i,f));e.info(JSON.stringify(n,null,t.pretty===!0?2:void 0));return}if(u.length===0){e.info("No matching dep-instances.");return}const o=["Package","Block","Dep","Specifier","Internal","Path"],a=u.map(n=>[n.packageName??n.packageDir,n.depType,n.depName,n.specifier,n.isInternal?"yes":"no",I(f,n.packageJsonPath)]),s=o.map((n,i)=>Math.max(n.length,...a.map(T=>(T[i]??"").length))),j=(n,i)=>n.padEnd(i);e.info(o.map((n,i)=>j(n,s[i])).join(" ")),e.info(s.map(n=>"─".repeat(n)).join("──"));for(const n of a)e.info(n.map((i,T)=>j(i,s[T])).join(" "));e.info(""),e.info(`${String(u.length)} dep-instance(s)`);return}if(h==="ndjson")throw new Error("--format=ndjson is only supported with --deps");const{projectOptions:m,workspace:g}=O(f,l);let d=Object.keys(g.projects).sort();if(t.query&&(d=D(d,g,t.query)),d=x(d,g,t.tag),d.length===0){e.info("No projects found.");return}const k=t.inferred===!0,w=t.targets===!0||k;if(h==="json"){const p=d.map(c=>{const r=g.projects[c],u=m.get(c)??{},o=Object.entries(r.targets??{}).map(([a])=>{const s=u[a],j=s?.inferred===!0;return{aliases:s?.aliases??[],command:s?.command,description:s?.description,...j?{inferred:!0}:{},name:a,type:s?.type}}).filter(a=>!k||a.inferred===!0);return{language:r.language,layer:r.layer,name:c,root:r.root,stack:r.stack,tags:r.tags??[],targets:o,type:r.projectType??"library"}});e.info(JSON.stringify(p,null,2));return}const N=(p,c)=>{const r=p.map((o,a)=>{let s=0;for(const j of c)s=Math.max(s,(j[a]??"").length);return Math.max(o.length,s)}),u=(o,a)=>o.padEnd(a);e.info(p.map((o,a)=>u(o,r[a])).join(" ")),e.info(r.map(o=>"─".repeat(o)).join("──"));for(const o of c)e.info(o.map((a,s)=>u(a,r[s])).join(" "))};if(w){const p=[];for(const c of d){const r=g.projects[c],u=m.get(c)??{};for(const o of Object.keys(r.targets??{}).sort()){const a=u[o],s=a?.inferred===!0;if(k&&!s)continue;const j=r.targets?.[o],n=j?.cache===!1?"no":j?.cache===!0?"yes":"default";p.push([c,o,a?.type??"—",n,s?"yes":"no",a?.description??"—"])}}if(p.length===0){e.info(k?"No inferred targets found.":"No targets found.");return}N(["Project","Target","Type","Cache","Inferred","Description"],p),e.info(""),e.info(`${String(p.length)} target(s) across ${String(d.length)} project(s)`);return}const y=["Project","Type","Layer","Tags","Targets"],b=d.map(p=>{const c=g.projects[p],r=Object.keys(c.targets??{});return[p,c.projectType??"library",c.layer??"—",(c.tags??[]).join(", ")||"—",r.length>4?`${r.slice(0,4).join(", ")}… (${String(r.length)})`:r.join(", ")||"—"]});N(y,b),e.info(""),e.info(`${String(d.length)} project(s)`)};export{V as default};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import{DEFAULT_CHANGES_DIR as
|
|
1
|
+
import{DEFAULT_CHANGES_DIR as S}from"./DEFAULT_CLEAN_KEEP.js";import{b as k,c as A,a as $,p as P}from"./orchestrator.js";import{hasUncommittedChanges as E,getCurrentBranch as F,pushBranch as x,stageAndCommit as N}from"./git.js";import{createShellRunner as I}from"./shell-runner.js";import{stateFilePath as D}from"./state.js";import{d as O}from"../packem_shared/sticky-comment-DjhyCIZt.js";import{VisReleaseError as R}from"../packem_shared/VisReleaseError-DZtgcKf8.js";const M="<!-- vis:user-content -->",_="<!-- /vis:user-content -->",j=/<!-- vis:user-content -->([\s\S]*?)<!-- \/vis:user-content -->/g,L=/<!-- vis:user-content -->(?:(?!<!-- \/vis:user-content -->)[\s\S])*?<!-- vis:user-content -->/,V=s=>`${M}${s}${_}`,U=(s,e)=>{const i=[],o=/<!-- vis:user-content -->\s*<!-- \/vis:user-content -->/g;let n=o.exec(s);for(;n!==null;)i.push({end:n.index+n[0].length,start:n.index}),n=o.exec(s);if(i.length===0)return{body:s,remaining:e};let r=0;const t=[],l=Math.min(i.length,e.length);for(let u=0;u<l;u+=1){const d=i[u],a=e[u];t.push(s.slice(r,d.start)),t.push(a),r=d.end}return t.push(s.slice(r)),{body:t.join(""),remaining:e.slice(l)}},T=(s,e)=>{if(s===void 0||s==="")return e;const i=s.replaceAll(/```[\s\S]*?```/g,"").replaceAll(/~~~[\s\S]*?~~~/g,""),o=(i.match(/<!-- vis:user-content -->/g)??[]).length,n=(i.match(/<!-- \/vis:user-content -->/g)??[]).length;if(o!==n)throw new R({code:"CONFIG_INVALID",hint:"Fix the marker pairs in the PR body and re-run.",message:`PR body has unbalanced <!-- vis:user-content --> markers (${o} opens, ${n} closes). Refusing to merge to prevent silent edit loss.`});if(L.test(i))throw new R({code:"CONFIG_INVALID",hint:"Flatten the nesting in the PR body and re-run.",message:"Nested <!-- vis:user-content --> markers are not allowed in PR body. The merger refuses to operate to prevent silent edit loss."});const r=[];for(const a of s.matchAll(j)){const g=a[1]??"";g.trim()!==""&&r.push(V(g))}if(r.length===0)return e;const{body:t,remaining:l}=U(e,r);if(l.length===0)return t;const u=t.replace(/\s+$/u,""),d=l.join(`
|
|
2
2
|
|
|
3
|
-
`);return`${
|
|
3
|
+
`);return`${u}
|
|
4
4
|
|
|
5
5
|
${d}
|
|
6
|
-
`},
|
|
6
|
+
`},q=async(s,e,i)=>{try{return await s.access(D(e,i)),!0}catch{return!1}},K=async(s,e,i,o,n,r,t)=>{const l=await s.run("gh",["pr","list","--head",o,"--state","open","--json","number"],{cwd:i,silent:!0});if(l.exitCode===0&&l.stdout.trim()!==""&&l.stdout.trim()!=="[]")try{const a=JSON.parse(l.stdout);if(a[0]){let g=r,w=!1;try{const m=await s.run("gh",["pr","view",String(a[0].number),"--json","body","-q",".body"],{cwd:i,silent:!0});if(m.exitCode===0)try{g=T(m.stdout.replace(/\n$/,""),r)}catch(C){w=!0,e.warn(`Skipping PR body update for #${a[0].number} — protected-content blocks are unbalanced, refusing to overwrite operator content. Please clean up markers manually. Cause: ${C.message}`)}}catch(m){e.warn(`Could not read existing body of PR #${a[0].number} for protected-edit merge: ${m.message}. Proceeding with the unmerged body.`)}const v=w?["pr","edit",String(a[0].number),"--title",n]:["pr","edit",String(a[0].number),"--title",n,"--body",g],b=await s.run("gh",v,{cwd:i,silent:!0});if(b.exitCode!==0)throw new Error(`gh pr edit #${a[0].number} failed: ${b.stderr.trim()}`);return{existing:!0,number:a[0].number}}}catch{}const u=await s.run("gh",["pr","create","--head",o,"--base",t,"--title",n,"--body",r],{cwd:i,silent:!0});if(u.exitCode!==0)return;const d=/\/pull\/(\d+)/.exec(u.stdout);return d?{existing:!1,number:Number.parseInt(d[1]??"0",10)}:void 0},G=async(s,e,i,o)=>{const n=o.labels??["autorelease: pending"];n.length>0&&await s.run("gh",["pr","edit",String(i),...n.flatMap(r=>["--add-label",r])],{cwd:e,silent:!0}),o.reviewers&&o.reviewers.length>0&&await s.run("gh",["pr","edit",String(i),"--add-reviewer",o.reviewers.join(",")],{cwd:e,silent:!0}),o.assignees&&o.assignees.length>0&&await s.run("gh",["pr","edit",String(i),"--add-assignee",o.assignees.join(",")],{cwd:e,silent:!0})},Y=async({fs:s,logger:e,options:i,workspaceRoot:o})=>{const n=o??process.cwd(),r=I(),t=await k({channel:i.channel,cwd:n}),{printConfigIfRequested:l}=await import("./print-config.js");if(l(i,t,e))return;const u=i.autoPublish===!0?"auto-publish":t.channel?.mode??"auto-publish";if(await E({cwd:n,runner:r})){e.warn("Working tree has uncommitted changes. CI mode requires a clean tree."),process.exitCode=1;return}const{files:d}=await A({changesDir:t.config.changesDir,cwd:n});if(u==="auto-publish"){if(d.length===0){e.info("No pending change files. Nothing to release.");return}e.info(`Auto-publish mode — versioning + publishing ${t.plan.releases.length} package(s).`),await $(t,{commit:!0});const c=await P(t,{resume:!0,tag:t.channel?.tag}),p=await F({cwd:n,runner:r});if(p)try{await x({cwd:n,runner:r},p)}catch(f){e.error(`Failed to push branch: ${f.message}`)}e.info(`Published: ${c.published.length} | Skipped: ${c.skipped.length} | Failed: ${c.failed.length}`),process.exitCode=c.failed.length>0?2:0;return}if(d.length===0){const c=t.config.changesDir??S,p=await q(s,n,c);p?e.info("No pending change files but `.state.json` is present — resuming the prior wave's publish."):e.info("No pending change files — assuming this push is a merged release PR. Publishing.");const f=await P(t,{resume:p,tag:t.channel?.tag});e.info(`Published: ${f.published.length} | Skipped: ${f.skipped.length} | Failed: ${f.failed.length}`),process.exitCode=f.failed.length>0?2:0;return}e.info(`Version-PR mode — maintaining release PR for ${t.plan.releases.length} package(s).`);const a=i.branch??t.config.versionPr?.branch??"vis-release/version-packages",g=t.config.versionPr?.title??"🚀 Versioned release";if(!await O(r,n)){e.error("Could not detect repository slug via gh CLI. Cannot maintain version PR."),process.exitCode=1;return}const v=await r.run("git",["switch","-C",a],{cwd:n,silent:!0});if(v.exitCode!==0){e.error(`Could not switch to ${a}: ${v.stderr}`),process.exitCode=1;return}const b=await $(t,{commit:!1}),m=[...b.changedFiles,...b.deletedFiles];if(m.length===0){e.warn("Apply produced no file changes. Aborting version PR.");return}await N({cwd:n,runner:r},m,t.config.gitUser?`release(${t.channel?.tag??"main"}): version packages [skip ci]`:"release: version packages [skip ci]",{author:t.config.gitUser});try{await x({cwd:n,runner:r},a,{force:!0})}catch(c){e.error(`Could not push ${a}: ${c.message}`),process.exitCode=1;return}const C=t.branch??t.config.baseBranch??"main",y=`${t.config.versionPr?.preamble??""}
|
|
7
7
|
|
|
8
8
|
## Pending releases
|
|
9
9
|
|
|
10
10
|
${t.plan.releases.map(c=>`- \`${c.name}\`: ${c.oldVersion} → **${c.newVersion}**`).join(`
|
|
11
11
|
`)}
|
|
12
|
-
`,
|
|
12
|
+
`,h=await K(r,e,n,a,g,y,C);if(h){if(e.info(`${h.existing?"Updated":"Opened"} version PR #${h.number}.`),await G(r,n,h.number,{assignees:h.existing?void 0:t.config.versionPr?.assignees,labels:t.config.versionPr?.labels,reviewers:h.existing?void 0:t.config.versionPr?.reviewers}),t.config.versionPr?.autoMerge&&!h.existing){const c=t.config.versionPr.autoMergeMethod??"squash",p=await r.run("gh",["pr","merge",String(h.number),"--auto",`--${c}`],{cwd:n,silent:!0});p.exitCode===0?e.info(`Auto-merge enabled (${c}).`):e.warn(`Could not enable auto-merge on PR #${h.number}: ${p.stderr.trim()||`exit ${p.exitCode}`}`)}}else e.error("Failed to create / update version PR."),process.exitCode=1};export{Y as default};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{createRequire as
|
|
1
|
+
import{createRequire as S}from"node:module";import{b as I}from"./orchestrator.js";let U;const j=e=>(U??=S(import.meta.url))(e),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,C=e=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[t,r]=w.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return w.getBuiltinModule(e)}return j(e)},{mkdtemp:F,writeFile:_,rm:D,readdir:M,readFile:N}=C("node:fs/promises"),{tmpdir:A}=C("node:os"),{join:g}=C("node:path"),O="https://www.npmjs.com",P=(e,t)=>t&&!/registry\.npmjs\.org/.test(t)?void 0:`${O}/package/${encodeURIComponent(e)}/access`,q=e=>`# ${e}
|
|
2
2
|
|
|
3
3
|
> ⚠️ **Placeholder package — do not use.**
|
|
4
4
|
|
|
5
5
|
This version contains **no code** and is **not functional**. It was published by [\`vis release pretrust\`](https://visulima.com/packages/vis) only to register the package name on the registry so that **npm Trusted Publishing (OIDC)** can be configured before the first real release.
|
|
6
6
|
|
|
7
7
|
Do **not** add this as a dependency. A functional version will replace it when the package is first released.
|
|
8
|
-
`,B=(e,r,
|
|
9
|
-
${
|
|
10
|
-
`),await
|
|
11
|
-
${$.stderr}`;/EPUBLISHCONFLICT|cannot publish over|previously published/i.test(
|
|
8
|
+
`,B=(e,t,r,a)=>{const i={description:"Placeholder published by `vis release pretrust` to enable npm trusted publishing (OIDC). Not functional — do not use.",files:["README.md"],license:typeof e.manifest.license=="string"?e.manifest.license:"MIT",name:t,publishConfig:{access:a},version:r};return e.manifest.repository!==void 0&&(i.repository=e.manifest.repository),i},L=(e,t)=>{const r=["trust",t.provider,e,"--file",t.workflow];return t.repo&&r.push(t.provider==="gitlab"?"--project":"--repo",t.repo),t.env&&r.push("--env",t.env),r.push("--allow-publish"),t.allowStagePublish&&r.push("--allow-stage-publish"),r.push("-y"),r},T=(e,t)=>{if(e.includes("gitlab"))return{provider:"gitlab",repo:t};if(e.includes("github"))return{provider:"github",repo:t}},W=e=>{const t=e.trim().replace(/\.git$/,"");if(t.startsWith("ssh://"))try{const a=new URL(t);return T(a.hostname,a.pathname.replace(/^\/+/,""))}catch{return}const r=/(?:https?:\/\/|git@)([^/:]+)[/:](\S+)/.exec(t);if(r)return T(r[1]??"",r[2]??"")},H=async(e,t)=>{try{const r=await e.run("git",["config","--get","remote.origin.url"],{cwd:t,silent:!0});return r.exitCode!==0?void 0:W(r.stdout.trim())}catch{return}},z=async(e,t)=>{if(t==="gitlab")return".gitlab-ci.yml";const r=g(e,".github","workflows");let a;try{a=await M(r)}catch{return}const i=a.filter(u=>/\.ya?ml$/.test(u)),c=[];for(const u of i)try{const h=await N(g(r,u),"utf8");/vis\s+release/.test(h)&&/publish/.test(h)&&c.push(u)}catch{}if(c.length===1)return c[0];if(c.length>1)return;const l=i.filter(u=>/release/i.test(u));return l.length===1?l[0]:void 0},G=async(e,t,r,a,i)=>{const c=L(r,a);i&&c.push("--registry",i);try{const l=await e.run("npm",c,{cwd:t,silent:!0});return l.exitCode===0?{trusted:!0}:{reason:`${l.stdout}
|
|
9
|
+
${l.stderr}`.trim()||`npm trust exited ${l.exitCode}`,trusted:!1}}catch(l){return{reason:l.message,trusted:!1}}},J=async(e,t,r,a)=>{const i=["view",t,"version","--silent"];a&&i.push("--registry",a);try{const c=await e.run("npm",i,{cwd:r,silent:!0});return c.exitCode===0&&c.stdout.trim().length>0}catch{return!1}},Y=async e=>{const{context:t,dryRun:r=!1,force:a=!1,registry:i}=e,c=e.access??"public",l=e.tag??"placeholder",u=e.version??"0.0.0",{createShellRunner:h}=await import("./shell-runner.js"),o=e.runner??h();let m=t.packages.filter(n=>!n.private);if(e.filter){const{default:n}=await import("./index.js"),d=e.filter.split(",").map(f=>f.trim()).filter(Boolean);m=m.filter(f=>d.some(b=>f.name===b||n(b,f.name)))}const v=[],s=[],R=[],E=e.trust!==!1&&!r;let x,y;if(E){const n=e.provider&&e.repo?{provider:e.provider,repo:e.repo}:await H(o,t.cwd),d=e.provider??n?.provider;if(d){const f=e.workflow??await z(t.cwd,d);f?x={allowStagePublish:e.allowStagePublish,env:e.env,provider:d,repo:e.repo??n?.repo,workflow:f}:y="could not find a release workflow file (pass --workflow)"}else y="could not detect a github/gitlab remote (pass --provider + --repo)"}for(const n of m){if(!a&&await J(o,n.name,t.cwd,i)){s.push({name:n.name,reason:"already-on-registry"});continue}if(r){v.push({accessUrl:P(n.name,i),name:n.name,version:u});continue}let d;try{d=await F(g(A(),"vis-pretrust-"));const f=B(n,n.name,u,c);await _(g(d,"package.json"),`${JSON.stringify(f,null,2)}
|
|
10
|
+
`),await _(g(d,"README.md"),q(n.name));const b=["publish","--tag",l,"--access",c];i&&b.push("--registry",i);const $=await o.run("npm",b,{cwd:d,silent:!0});if($.exitCode===0){const p={accessUrl:P(n.name,i),name:n.name,version:u};if(x){const k=await G(o,t.cwd,n.name,x,i);p.trusted=k.trusted,k.trusted||(p.trustReason=k.reason)}else y&&(p.trusted=!1,p.trustReason=y);v.push(p)}else{const p=`${$.stdout}
|
|
11
|
+
${$.stderr}`;/EPUBLISHCONFLICT|cannot publish over|previously published/i.test(p)?s.push({name:n.name,reason:"already-on-registry"}):R.push({name:n.name,reason:p.trim()||`npm publish exited ${$.exitCode}`})}}catch(f){R.push({name:n.name,reason:f.message})}finally{d&&await D(d,{force:!0,recursive:!0}).catch(()=>{})}}return{failed:R,published:v,skipped:s}},V=async({logger:e,options:t,workspaceRoot:r})=>{const a=r??process.cwd(),i=t.dryRun===!0;if(t.access!==void 0&&t.access!=="public"&&t.access!=="restricted"){e.error(`Invalid --access value: "${t.access}". Expected "public" or "restricted".`),process.exitCode=1;return}if(t.provider!==void 0&&t.provider!=="github"&&t.provider!=="gitlab"){e.error(`Invalid --provider value: "${t.provider}". Expected "github" or "gitlab".`),process.exitCode=1;return}const c=t.access??"public",{provider:l}=t,u=await I({cwd:a}),{printConfigIfRequested:h}=await import("./print-config.js");if(h(t,u,e))return;let o;try{o=await Y({access:c,allowStagePublish:t.allowStagePublish===!0,context:u,dryRun:i,env:t.env,filter:t.filter,force:t.force===!0,provider:l,registry:t.registry,repo:t.repo,tag:t.tag,trust:t.noTrust!==!0,version:t.version,workflow:t.workflow})}catch(s){e.error(`Pretrust failed: ${s.message}`),process.exitCode=1;return}for(const s of o.published)e.info(` ${i?"[dry-run] ":"[published]"} ${s.name}@${s.version}`),!i&&(s.trusted===!0?e.info(" ✓ trusted publisher configured (npm trust)"):s.trustReason?(e.warn(` ⚠ trust not configured: ${s.trustReason}`),s.accessUrl&&e.info(` finish manually → ${s.accessUrl}`)):s.accessUrl&&e.info(` configure trusted publishing → ${s.accessUrl}`));for(const s of o.skipped)e.info(` [skipped] ${s.name} (${s.reason})`);for(const s of o.failed)e.error(` [failed] ${s.name}: ${s.reason}`);const m=o.published.filter(s=>s.trusted===!0).length,v=o.published.filter(s=>s.trusted===!1).length;e.info(""),e.info(`Placeholders: ${o.published.length} | Trusted: ${m} | Skipped: ${o.skipped.length} | Failed: ${o.failed.length}`),o.published.length>0&&!i&&(e.info(""),v>0?e.info("Next: finish trusted-publisher setup for the packages above (the first `npm trust` call may need a 2FA OTP), then run `vis release publish`."):e.info("Next: run `vis release publish` — trusted publishing is configured.")),process.exitCode=o.failed.length>0?2:0};export{V as default};
|