@visulima/vis 1.0.0-alpha.9 → 1.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 +1854 -3
- package/LICENSE.md +13515 -10
- package/README.md +215 -39
- package/bin/resolve-binary.mjs +85 -0
- package/bin/vis.mjs +76 -0
- package/dashboard/dist/index.html +152 -0
- package/dist/bin.d.ts +1 -0
- package/dist/bin.js +1 -2
- package/dist/binx.js +3 -0
- package/dist/config/index.d.ts +3276 -0
- package/dist/config/index.js +1 -0
- package/dist/generate/index.d.ts +1 -1
- package/dist/generate/index.js +1 -1
- package/dist/packem_chunks/CONFIG_FILES.js +8 -0
- package/dist/packem_chunks/DEFAULT_CLEAN_KEEP.js +1 -0
- package/dist/packem_chunks/agent-instructions.js +11 -0
- package/dist/packem_chunks/bloom-status.js +2 -0
- package/dist/packem_chunks/bloom-sync.js +2 -0
- package/dist/packem_chunks/cache-attestation.js +1 -0
- package/dist/packem_chunks/catalog-detector.js +1 -0
- package/dist/packem_chunks/catalog.js +114 -0
- package/dist/packem_chunks/cli-exec.js +1 -0
- package/dist/packem_chunks/cli-main.js +268 -0
- package/dist/packem_chunks/defineReleasePlugin.js +3 -0
- package/dist/packem_chunks/detect.js +3 -0
- package/dist/packem_chunks/detect2.js +8 -0
- package/dist/packem_chunks/devtools.js +4 -0
- package/dist/packem_chunks/discord.js +4 -0
- package/dist/packem_chunks/dispatch.js +4 -0
- package/dist/packem_chunks/doctor-probe.js +2 -0
- package/dist/packem_chunks/dynamic-import.js +1 -0
- package/dist/packem_chunks/extra-files.js +3 -0
- package/dist/packem_chunks/fix.js +11 -0
- package/dist/packem_chunks/git.js +3 -0
- package/dist/packem_chunks/group-tags.js +1 -0
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +5 -1
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +26 -152
- package/dist/packem_chunks/handler13.js +5 -1
- package/dist/packem_chunks/handler14.js +1 -3
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -2
- package/dist/packem_chunks/handler17.js +1 -7
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +5 -19
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +2 -428
- package/dist/packem_chunks/handler21.js +2 -22
- package/dist/packem_chunks/handler22.js +14 -3
- package/dist/packem_chunks/handler23.js +1 -5
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -20
- package/dist/packem_chunks/handler26.js +5 -1
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +3 -1
- package/dist/packem_chunks/handler29.js +1 -2
- package/dist/packem_chunks/handler3.js +4 -2
- package/dist/packem_chunks/handler30.js +1 -22
- package/dist/packem_chunks/handler31.js +2 -1
- package/dist/packem_chunks/handler32.js +2 -1
- package/dist/packem_chunks/handler33.js +2 -37
- package/dist/packem_chunks/handler34.js +3 -3
- package/dist/packem_chunks/handler35.js +6 -23
- package/dist/packem_chunks/handler36.js +1 -5
- package/dist/packem_chunks/handler37.js +36 -21
- package/dist/packem_chunks/handler38.js +8 -1
- package/dist/packem_chunks/handler39.js +9 -2
- package/dist/packem_chunks/handler4.js +4 -5
- package/dist/packem_chunks/handler40.js +75 -1
- package/dist/packem_chunks/handler41.js +5 -5
- package/dist/packem_chunks/handler42.js +4 -1
- package/dist/packem_chunks/handler43.js +3 -24
- package/dist/packem_chunks/handler44.js +2 -3
- package/dist/packem_chunks/handler45.js +1 -1
- package/dist/packem_chunks/handler46.js +1 -0
- package/dist/packem_chunks/handler47.js +1 -0
- package/dist/packem_chunks/handler48.js +3 -0
- package/dist/packem_chunks/handler49.js +1 -0
- package/dist/packem_chunks/handler5.js +6 -4
- package/dist/packem_chunks/handler50.js +7 -0
- package/dist/packem_chunks/handler51.js +33 -0
- package/dist/packem_chunks/handler52.js +3 -0
- package/dist/packem_chunks/handler53.js +8 -0
- package/dist/packem_chunks/handler54.js +4 -0
- package/dist/packem_chunks/handler55.js +1 -0
- package/dist/packem_chunks/handler56.js +12 -0
- package/dist/packem_chunks/handler57.js +11 -0
- package/dist/packem_chunks/handler58.js +5 -0
- package/dist/packem_chunks/handler59.js +11 -0
- package/dist/packem_chunks/handler6.js +8 -2
- package/dist/packem_chunks/handler60.js +3 -0
- package/dist/packem_chunks/handler61.js +22 -0
- package/dist/packem_chunks/handler62.js +61 -0
- package/dist/packem_chunks/handler63.js +3 -0
- package/dist/packem_chunks/handler64.js +6 -0
- package/dist/packem_chunks/handler65.js +9 -0
- package/dist/packem_chunks/handler66.js +2 -0
- package/dist/packem_chunks/handler67.js +24 -0
- package/dist/packem_chunks/handler68.js +25 -0
- package/dist/packem_chunks/handler69.js +153 -0
- package/dist/packem_chunks/handler7.js +1 -24
- package/dist/packem_chunks/handler70.js +10 -0
- package/dist/packem_chunks/handler71.js +23 -0
- package/dist/packem_chunks/handler72.js +322 -0
- package/dist/packem_chunks/handler73.js +708 -0
- package/dist/packem_chunks/handler74.js +48 -0
- package/dist/packem_chunks/handler75.js +27 -0
- package/dist/packem_chunks/handler76.js +3 -0
- package/dist/packem_chunks/handler77.js +190 -0
- package/dist/packem_chunks/handler78.js +38 -0
- package/dist/packem_chunks/handler8.js +1 -6
- package/dist/packem_chunks/handler9.js +1 -8
- package/dist/packem_chunks/heal-accept.js +10 -0
- package/dist/packem_chunks/heal.js +14 -0
- package/dist/packem_chunks/help-command.js +31 -0
- package/dist/packem_chunks/index.js +1 -7
- package/dist/packem_chunks/index2.js +802 -0
- package/dist/packem_chunks/index3.js +7 -0
- package/dist/packem_chunks/index4.js +135 -0
- package/dist/packem_chunks/index5.js +73 -0
- package/dist/packem_chunks/interface.js +2 -0
- package/dist/packem_chunks/keys-refresh.js +4 -0
- package/dist/packem_chunks/lean.js +4 -0
- package/dist/packem_chunks/list.js +3 -0
- package/dist/packem_chunks/loader.js +4 -1
- package/dist/packem_chunks/loader2.js +1 -0
- package/dist/packem_chunks/orchestrator.js +42 -0
- package/dist/packem_chunks/pre-mode.js +2 -0
- package/dist/packem_chunks/print-config.js +2 -0
- package/dist/packem_chunks/prompts.js +7 -0
- package/dist/packem_chunks/prune.js +3 -0
- package/dist/packem_chunks/publish-guards.js +1 -0
- package/dist/packem_chunks/registry.js +48 -0
- package/dist/packem_chunks/resolveFormatter.js +9 -0
- package/dist/packem_chunks/run.js +1 -0
- package/dist/packem_chunks/security.js +1 -0
- package/dist/packem_chunks/shell-runner.js +1 -0
- package/dist/packem_chunks/slack.js +2 -0
- package/dist/packem_chunks/snapshot.js +2 -0
- package/dist/packem_chunks/stage-publisher.js +1 -0
- package/dist/packem_chunks/staged-registry.js +2 -0
- package/dist/packem_chunks/state.js +3 -0
- package/dist/packem_chunks/status.js +2 -0
- package/dist/packem_chunks/success-walk.js +8 -0
- package/dist/packem_chunks/sync.js +2 -0
- package/dist/packem_chunks/sync2.js +2 -0
- package/dist/packem_chunks/tar.js +3 -0
- package/dist/packem_chunks/tripwire.js +2 -0
- package/dist/packem_chunks/ts-loader.js +22 -0
- package/dist/packem_chunks/verify-lockfile.js +2 -0
- package/dist/packem_chunks/version-resolver.js +2 -0
- package/dist/packem_chunks/webhook.js +1 -0
- package/dist/packem_chunks/workflow-templates.js +167 -0
- package/dist/packem_chunks/workspace.js +2 -0
- package/dist/packem_shared/AfterAllProjectsVersioned-CAKI2nWf.js +1 -0
- package/dist/packem_shared/MultiSpinner-B9U0-aE3-B-gIXhFk.js +3 -0
- package/dist/packem_shared/ReleaseClient-BY4OZNCK.js +1 -0
- package/dist/packem_shared/Table-BGIHvenQ-D2oJtNQj.js +34 -0
- package/dist/packem_shared/VisReleaseError-DMGRBTNO.js +1 -0
- package/dist/packem_shared/_commonjsHelpers-B5Y90VFO.js +1 -0
- package/dist/packem_shared/advisories-CaP4uNhD.js +1 -0
- package/dist/packem_shared/affected-shas-BfO3PDJq.js +1 -0
- package/dist/packem_shared/ai-analysis-CO7No4rt.js +68 -0
- package/dist/packem_shared/ai-fix-B4u2zlVG.js +43 -0
- package/dist/packem_shared/anolilab-text-CAM_E6uK.js +13 -0
- package/dist/packem_shared/api.d-BPftyU9r.d.ts +27 -0
- package/dist/packem_shared/augment-8z86AwtF.js +4 -0
- package/dist/packem_shared/bin-Cv8vsMEo.js +1 -0
- package/dist/packem_shared/build-scripts-D477Ou-x.js +1 -0
- package/dist/packem_shared/command-runtime-EWjmSxPj.js +1 -0
- package/dist/packem_shared/compile-cache-B_Vf_WxT.js +3 -0
- package/dist/packem_shared/createAdapter-bU4DIP3F.js +1 -0
- package/dist/packem_shared/createVersionActions-BK43SNDH.js +1 -0
- package/dist/packem_shared/cyclonedx-CDWHbD9s.js +4 -0
- package/dist/packem_shared/defineFormatter-D5dCp6Kv.js +1 -0
- package/dist/packem_shared/definePlugin-DoUcoYSy.js +1 -0
- package/dist/packem_shared/dependency-scan-P52jY0pU.js +1 -0
- package/dist/packem_shared/docker-CD7o1D1o.js +59 -0
- package/dist/packem_shared/env-Cpxa_7UE.js +27 -0
- package/dist/packem_shared/failure-log-MOhz-TBv.js +2 -0
- package/dist/packem_shared/giget-DVTFJlbR.js +2 -0
- package/dist/packem_shared/glob-DMbPwGSj-uzODoE-1.js +1 -0
- package/dist/packem_shared/index-B0EsgdzO.js +1 -0
- package/dist/packem_shared/index-BAUIIRZJ.js +1 -0
- package/dist/packem_shared/index-BVuCxe14.js +22 -0
- package/dist/packem_shared/index-CdTXvj-V.js +1 -0
- package/dist/packem_shared/index-CgXLAAVI.js +28 -0
- package/dist/packem_shared/index-DjTWo3sH.js +1 -0
- package/dist/packem_shared/index.server-J83sowC4.js +2 -0
- package/dist/packem_shared/interface.d-B7VK2rcH.d.ts +148 -0
- package/dist/packem_shared/interface.d-Cezzifoh.d.ts +106 -0
- package/dist/packem_shared/license-t5KnNX6v.js +1 -0
- package/dist/packem_shared/lifecycle-hzwghh5a.js +2 -0
- package/dist/packem_shared/lockfile-CWcVTdRc.js +1 -0
- package/dist/packem_shared/main-B3juSU5z.js +1 -0
- package/dist/packem_shared/manifests-CaPqgQxW.js +1 -0
- package/dist/packem_shared/min-release-age-skpcnlpk.js +34 -0
- package/dist/packem_shared/missing-package-json-_hOp4AW5.js +1 -0
- package/dist/packem_shared/native-config-sync-CFi1iQNG.js +21 -0
- package/dist/packem_shared/osv-bloom-BAyJUnRx.js +2 -0
- package/dist/packem_shared/otelPlugin-DmKDBaPo.js +1 -0
- package/dist/packem_shared/packument-CYxvm590.js +1 -0
- package/dist/packem_shared/peer-warnings-BXAzXqY3.js +1 -0
- package/dist/packem_shared/plugins.d-ND23R9I3.d.ts +4 -0
- package/dist/packem_shared/pm-runner-mVFjedM6.js +1 -0
- package/dist/packem_shared/prompt-DjXHVgYU.js +1 -0
- package/dist/packem_shared/provenance-CI_WQx7G.js +1 -0
- package/dist/packem_shared/public-api-WqUCiyIe.js +131 -0
- package/dist/packem_shared/readJsonSync-DuMMeB3s-Cx08VBQg.js +1 -0
- package/dist/packem_shared/registry-keys-AGlSEY6R.js +1 -0
- package/dist/packem_shared/resolve-explicit-DVE9cfkm.js +5 -0
- package/dist/packem_shared/resolve-runtime-CGHf-wHz.js +1 -0
- package/dist/packem_shared/run-file-Bs_E9O6O.js +1 -0
- package/dist/packem_shared/runtime-check-pS2XH4BO.js +1 -0
- package/dist/packem_shared/runtime-process-Dmz0vCJy-DUwTvH1J.js +1 -0
- package/dist/packem_shared/s1ngularity-xmrq5T5r.js +1 -0
- package/dist/packem_shared/scan-progress-DQ4TMXcb.js +2 -0
- package/dist/packem_shared/selectors-CRgS4bU9.js +3 -0
- package/dist/packem_shared/signatures-Dp3th1DB.js +2 -0
- package/dist/packem_shared/slug-DoueYuLo.js +1 -0
- package/dist/packem_shared/spinner-DuJJvFTl.js +1 -0
- package/dist/packem_shared/sticky-comment-D6_7-w8T.js +1 -0
- package/dist/packem_shared/subtree-C7bZuiSQ.js +2 -0
- package/dist/packem_shared/symbols-DPTlrJ3B.js +1 -0
- package/dist/packem_shared/tabs-CgxCvjCY.js +1 -0
- package/dist/packem_shared/target-merge-D2eTghgd.js +11 -0
- package/dist/packem_shared/target-options-TM6ETDAS.js +1 -0
- package/dist/packem_shared/toolchain-B5KwUZfq.js +5 -0
- package/dist/packem_shared/typosquats-C0layQsP.js +1 -0
- package/dist/packem_shared/use-measured-height-Drobr4fe.js +1 -0
- package/dist/packem_shared/utils-CRueU43T.js +1 -0
- package/dist/packem_shared/verify-Cjo4EBFZ.js +1 -0
- package/dist/packem_shared/vis-update-app-qIkyvrd1.js +1 -0
- package/dist/packem_shared/watch-BnE1TzYn.js +1 -0
- package/dist/packem_shared/watch-loop-Irf3Pm-1.js +11 -0
- package/dist/release/core/changelog/index.d.ts +5 -0
- package/dist/release/core/changelog/index.js +1 -0
- package/dist/release/core/package-managers/index.d.ts +6 -0
- package/dist/release/core/package-managers/index.js +1 -0
- package/dist/release/core/version-actions/index.d.ts +14 -0
- package/dist/release/core/version-actions/index.js +1 -0
- package/dist/release/index.d.ts +233 -0
- package/dist/release/index.js +1 -0
- package/dist/release/plugin-sdk.d.ts +128 -0
- package/dist/release/plugin-sdk.js +1 -0
- package/dist/release/presets.d.ts +225 -0
- package/dist/release/presets.js +1 -0
- package/dist/release/types.d.ts +1493 -0
- package/dist/release/types.js +1 -0
- package/dist/runtime/preload.d.ts +1 -0
- package/dist/runtime/preload.js +1 -0
- package/index.d.ts +450 -0
- package/index.js +663 -556
- package/package.json +105 -62
- package/schemas/project.schema.json +872 -225
- package/schemas/vis-config.schema.json +6309 -264
- package/schemas/vis-release-config.schema.json +1423 -0
- package/skills/vis/SKILL.md +96 -0
- package/templates/buildkite-ci/.buildkite/pipeline.yml.tera +85 -0
- package/templates/buildkite-ci/template.yml +20 -0
- package/dist/config.d.ts +0 -1087
- package/dist/config.js +0 -1
- package/dist/packem_shared/VisUpdateApp-BBx3idMI.js +0 -1
- package/dist/packem_shared/ai-analysis-DDqXRFxY.js +0 -67
- package/dist/packem_shared/bin-BaZZ32BK.js +0 -93
- package/dist/packem_shared/cache-directory-DL8hfXeG.js +0 -1
- package/dist/packem_shared/catalog-CuSpuB_R.js +0 -12
- package/dist/packem_shared/dependency-scan-BoLG2Fez.js +0 -1
- package/dist/packem_shared/docker-BcfqH4Av.js +0 -2
- package/dist/packem_shared/flakiness-DSIHZGBT.js +0 -1
- package/dist/packem_shared/otelPlugin-DxyvBcXO.js +0 -1
- package/dist/packem_shared/runtime-check-CGHal8SO.js +0 -1
- package/dist/packem_shared/selectors-CfH9ZY08.js +0 -3
- package/dist/packem_shared/symbols-CIMw60-G.js +0 -1
- package/dist/packem_shared/toolchain-C3ZG0o_X.js +0 -5
- package/dist/packem_shared/typosquats-Bpq4zcWL.js +0 -1
- package/dist/packem_shared/utils-DrNg0XTR.js +0 -1
|
@@ -1,37 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
`)},"writeBashHistory"),Or=Ee(async o=>{const e=Ne(Be(),".local","share","fish","fish_history"),t=`- cmd: ${o.replaceAll("\\","\\\\").replaceAll(`
|
|
4
|
-
`,String.raw`\n`)}
|
|
5
|
-
when: ${Math.floor(Date.now()/1e3)}
|
|
6
|
-
`;await De(e,t)},"writeFishHistory");var Fr=Object.defineProperty,ue=O((o,e)=>Fr(o,"name",{value:e,configurable:!0}),"i$1");const ot=ue(o=>{const e=new Set;for(const t of Object.values(o.projects))for(const s of Object.keys(t.targets??{}))e.add(s);return[...e].sort()},"collectAvailableTargets"),Pr=ue(o=>{const e=new Map;for(const t of o.values())for(const[s,n]of Object.entries(t))for(const d of n.aliases??[])e.has(d)||e.set(d,s);return e},"buildAliasMap"),Ar=ue((o,e)=>e.get(o)??o,"resolveTargetAlias"),Lr=ue((o,e)=>{if(o.length===0)return e.length;if(e.length===0)return o.length;const t=[];for(let s=0;s<=e.length;s++)t[s]=[s];for(let s=0;s<=o.length;s++)t[0][s]=s;for(let s=1;s<=e.length;s++)for(let n=1;n<=o.length;n++){const d=e[s-1]===o[n-1]?0:1;t[s][n]=Math.min(t[s-1][n]+1,t[s][n-1]+1,t[s-1][n-1]+d)}return t[e.length][o.length]},"levenshtein"),Dr=ue((o,e,t=3)=>Tt(o,e,1,t)[0],"suggestTarget"),Tt=ue((o,e,t=3,s=3)=>{const n=[];for(const d of e){const a=Lr(o.toLowerCase(),d.toLowerCase());a<=s&&n.push({distance:a,name:d})}return n.sort((d,a)=>d.distance-a.distance||d.name.localeCompare(a.name)),n.slice(0,t).map(d=>d.name)},"suggestTargets"),Br=ue(o=>o.length===0?" (no targets found)":o.map(e=>` - ${e}`).join(`
|
|
7
|
-
`),"formatTargetList"),Nr=ue(async o=>{if(o.length===0||!process.stdin.isTTY||!process.stdout.isTTY)return;const e=pr({input:process.stdin,output:process.stdout});try{process.stdout.write(`Available targets:
|
|
8
|
-
`);for(const[n,d]of o.entries())process.stdout.write(` ${String(n+1).padStart(2," ")}. ${d}
|
|
9
|
-
`);process.stdout.write(`
|
|
10
|
-
`);const t=(await new Promise(n=>{e.question("Select a target (number or name, blank to cancel): ",n)})).trim();if(t.length===0)return;const s=Number.parseInt(t,10);return Number.isFinite(s)&&s>=1&&s<=o.length?o[s-1]:o.includes(t)?t:Dr(t,o)}finally{e.close()}},"promptTargetInteractively");var Hr=Object.defineProperty,Ge=O((o,e)=>Hr(o,"name",{value:e,configurable:!0}),"i");const Gr=Ge(o=>Array.isArray(o)?`[${o.join(",")}]`:typeof o=="object"&&o!==null?JSON.stringify(o):String(o),"formatValue"),qr=Ge((o,e,t)=>e==="_"?`${o}${Array.isArray(t)?t.join(" "):String(t)}`:`${o}--${e}=${Gr(t)}`,"formatFlags"),qe=Ge((o,e,t)=>{const s=new Set(new Set(t.map(k=>k.target.target))),n=new Set(new Set(t.map(k=>k.target.project))),d=e.filter(k=>s.has(k)),a=o.filter(k=>n.has(k)),f=t.length-a.length*d.length,p=d.length===1?"target":"targets",g=d.join(", ");let c;c=a.length===1?`project ${a[0]}`:`${a.length} projects`;let M=`${p} ${g} for ${c}`;return f>0&&(M+=` and ${f} ${f===1?"task":"tasks"} ${f===1?"it depends":"they depend"} on`),M},"formatTargetsAndProjects");var Ur=Object.defineProperty,_r=O((o,e)=>Ur(o,"name",{value:e,configurable:!0}),"c$2");const Wr={error:"red",info:"white",success:"green"},Pe=_r(({children:o,title:e,variant:t})=>{const s=Wr[t];return l(u,{flexDirection:"column",children:[l(u,{gap:1,children:[i(r,{bold:!0,inverse:!0,children:" VIS "}),i(r,{bold:!0,color:s,children:"•"}),i(r,{children:e})]}),o]})},"Header");var Vr=Object.defineProperty,zr=O((o,e)=>Vr(o,"name",{value:e,configurable:!0}),"s$1");const Ct=zr(({cached:o,failed:e,failedIds:t,projectNames:s,skippedIds:n,succeeded:d,targets:a,tasks:f,took:p})=>{const g=qe(s,a,f);if(e===0&&(!n||n.length===0)){const c=o>0?` (${o} read from cache)`:"";return i(Ze,{children:O(()=>i(Pe,{title:`Successfully ran ${g}`,variant:"success",children:l(u,{flexDirection:"column",paddingLeft:2,children:[l(r,{children:[i(r,{color:"green",children:vt})," ",d+o," ","tasks completed",c?i(r,{dimColor:!0,children:c}):null]}),l(r,{dimColor:!0,children:[" ","Took",p]})]})}),"children")})}return i(Ze,{children:O(()=>i(Pe,{title:`Ran ${g}`,variant:"error",children:l(u,{flexDirection:"column",paddingLeft:2,children:[n&&n.length>0&&l(u,{flexDirection:"column",children:[l(r,{dimColor:!0,children:[n.length," ","task",n.length===1?"":"s"," ","skipped (dependency failed or --bail)"]}),n.map(c=>l(r,{dimColor:!0,children:[" - ",c]},c)),i(r,{})]}),e>0&&l(u,{flexDirection:"column",children:[l(r,{children:[i(r,{color:"red",children:String(e)})," ","task",e===1?"":"s"," ","failed:"]}),t.map(c=>l(r,{children:[" ",i(r,{color:"red",children:He})," ",c]},c)),i(r,{})]}),l(r,{dimColor:!0,children:[" ","Took",p]})]})}),"children")})},"CommandSummary");var Yr=Object.defineProperty,Fe=O((o,e)=>Yr(o,"name",{value:e,configurable:!0}),"u$1");class $e{static{O(this,"TaskStore")}static{Fe(this,"TaskStore")}#e;#r=new Set;#o=new Map;constructor(e){this.#e={autoExitCountdown:null,cached:0,completed:0,done:!1,endTime:null,failed:0,filterActive:!1,filterText:"",focusedPanel:"tasks",interactiveMode:!1,outputs:new Map,pinnedTaskIds:[null,null],rerunRequested:!1,retryTaskId:null,rows:e.map(t=>({status:"pending",taskId:t.id})),selectedIndex:0,startTime:Date.now(),statusFilter:"all",succeeded:0,viewMode:"list"}}getSnapshot=Fe(()=>this.#e,"getSnapshot");subscribe=Fe(e=>(this.#r.add(e),()=>{this.#r.delete(e)}),"subscribe");startTasks(e){const t=[...this.#e.rows];for(const s of e){const n=t.findIndex(d=>d.taskId===s.id);n!==-1&&(t[n]={...t[n],elapsed:0,status:"running"},this.#o.set(s.id,process.hrtime()))}this.#t({...this.#e,rows:t})}endTasks(e){const t=[...this.#e.rows];let{cached:s,completed:n,failed:d,succeeded:a}=this.#e;const f=new Map(this.#e.outputs);for(const g of e){const c=t.findIndex(M=>M.taskId===g.task.id);switch(c!==-1&&(t[c]={...t[c],duration:g.startTime&&g.endTime?g.endTime-g.startTime:void 0,status:g.status}),n++,g.status){case"failure":{d++;break}case"local-cache":case"local-cache-kept-existing":case"remote-cache":{s++;break}case"success":{a++;break}}g.terminalOutput&&!f.has(g.task.id)&&f.set(g.task.id,g.terminalOutput),this.#o.delete(g.task.id)}let{selectedIndex:p}=this.#e;if(d>this.#e.failed){const g=t.findIndex(c=>c.status==="failure");g!==-1&&(p=g)}this.#t({...this.#e,cached:s,completed:n,failed:d,outputs:f,rows:t,selectedIndex:p,succeeded:a})}static#i=256*1024;addOutput(e,t){if(!t.trim())return;let s=(this.#e.outputs.get(e)??"")+t;s.length>$e.#i&&(s=s.slice(-$e.#i)),this.#e.outputs.set(e,s),this.#t({...this.#e})}setOutput(e,t){this.#e.outputs.set(e,t),this.#t({...this.#e})}markDone(){this.#t({...this.#e,done:!0,endTime:Date.now()})}tick(){if(this.#o.size===0)return;let e=!1;const t=[...this.#e.rows];for(let s=0;s<t.length;s++){const n=t[s];if(n.status==="running"){const d=this.#o.get(n.taskId);if(d){const a=process.hrtime(d),f=a[0]*1e3+a[1]/1e6;t[s]={...n,elapsed:f},e=!0}}}e&&this.#t({...this.#e,rows:t})}setSelectedIndex(e){e!==this.#e.selectedIndex&&this.#t({...this.#e,selectedIndex:e})}setFocusedPanel(e){e!==this.#e.focusedPanel&&this.#t({...this.#e,focusedPanel:e})}setFilter(e){this.#t({...this.#e,filterText:e,selectedIndex:0})}setFilterActive(e){e!==this.#e.filterActive&&this.#t({...this.#e,filterActive:e,filterText:e?this.#e.filterText:"",selectedIndex:0})}pinTask(e,t){const s=[...this.#e.pinnedTaskIds];s[e]=t,this.#t({...this.#e,pinnedTaskIds:s})}clearPins(){this.#t({...this.#e,pinnedTaskIds:[null,null]})}requestRetry(e){const t=[...this.#e.rows],s=t.findIndex(f=>f.taskId===e);let{completed:n,failed:d,succeeded:a}=this.#e;if(s!==-1){const f=t[s].status;f==="failure"?(d=Math.max(0,d-1),n=Math.max(0,n-1)):f==="success"&&(a=Math.max(0,a-1),n=Math.max(0,n-1)),t[s]={...t[s],elapsed:0,status:"running"},this.#o.set(e,process.hrtime())}this.#t({...this.#e,completed:n,done:!1,endTime:null,failed:d,interactiveMode:!1,retryTaskId:e,rows:t,succeeded:a})}acknowledgeRetry(){const e=this.#e.retryTaskId;return e&&this.#t({...this.#e,retryTaskId:null}),e}setInteractiveMode(e){e!==this.#e.interactiveMode&&this.#t({...this.#e,interactiveMode:e})}setViewMode(e){e!==this.#e.viewMode&&this.#t({...this.#e,viewMode:e})}setStatusFilter(e){this.#t({...this.#e,selectedIndex:0,statusFilter:e})}requestRerun(){this.#o.clear(),this.#t({...this.#e,autoExitCountdown:null,cached:0,completed:0,done:!1,endTime:null,failed:0,interactiveMode:!1,outputs:new Map,rerunRequested:!0,rows:this.#e.rows.map(e=>({status:"pending",taskId:e.taskId})),startTime:Date.now(),succeeded:0,viewMode:"list"})}acknowledgeRerun(){this.#e.rerunRequested&&this.#t({...this.#e,rerunRequested:!1})}#t(e){this.#e=e;for(const t of this.#r)try{t()}catch{}}}var Qr=Object.defineProperty,oe=O((o,e)=>Qr(o,"name",{value:e,configurable:!0}),"t");const Xr={d:oe(()=>" d","d"),future:"in %s",h:oe(()=>" h","h"),m:oe(()=>" m","m"),mo:oe(()=>" mo","mo"),ms:oe(()=>" ms","ms"),past:"%s ago",s:oe(()=>" s","s"),w:oe(()=>" w","w"),y:oe(()=>" y","y")},St={delimiter:" ",language:Xr,largest:2,round:!0,spacer:"",units:["h","m","s","ms"]};oe(o=>{const e=o[0]*1e3+o[1]/1e6;return yt(e,St)},"formatHrtime");const me=oe(o=>yt(o,St),"formatMs");var Kr=Object.defineProperty,Ce=O((o,e)=>Kr(o,"name",{value:e,configurable:!0}),"n$1");const Te=Ce(o=>o==="local-cache"||o==="local-cache-kept-existing"||o==="remote-cache","isCacheStatus"),Se=Ce(o=>{switch(o){case"failure":return{color:"red",icon:He};case"local-cache":case"local-cache-kept-existing":case"remote-cache":case"success":return{color:"green",icon:vt};case"skipped":return{color:"gray",icon:Ie};default:return{color:"gray",icon:"?"}}},"getStatusInfo"),$t=Ce(o=>{const{color:e,icon:t}=Se(o);return K(F.createElement(r,{color:e},t),{columns:10}).trim()},"getStatusIcon"),Jr=Ce(o=>{const{color:e,icon:t}=Se(o);switch(o){case"local-cache":case"local-cache-kept-existing":case"remote-cache":return K(F.createElement(r,null,F.createElement(r,{color:e},t)," ",F.createElement(r,{color:"cyan"},"[cache]")),{columns:30}).trim();case"skipped":return K(F.createElement(r,null,F.createElement(r,{dimColor:!0},t)," ",F.createElement(r,{dimColor:!0},"[skipped]")),{columns:30}).trim();default:return K(F.createElement(r,{color:e},t),{columns:10}).trim()}},"getStatusPrefix"),Zr=Ce((o,e,t)=>{const s=t.trim();if(!s)return;const n=`
|
|
11
|
-
`;if(process.env.GITHUB_ACTIONS==="true")process.stdout.write(`::group::${$t(e)} ${o}${n}`),process.stdout.write(s+n),process.stdout.write(`::endgroup::${n}`);else{const d=process.stdout.columns||80,a=K(F.createElement(r,{dimColor:!0},Ie.repeat(d)),{columns:d}).trim(),f=Jr(e),p=K(F.createElement(r,{bold:!0},o),{columns:d}).trim();process.stdout.write(`${a}${n}`),process.stdout.write(`${f} ${p}${n}`),process.stdout.write(s+n),process.stdout.write(`${a}${n}`)}},"logCommandOutputCI");var eo=Object.defineProperty,xt=O((o,e)=>eo(o,"name",{value:e,configurable:!0}),"c$1");const to=xt(o=>o==="running"?{color:"white",icon:"•"}:o==="pending"?{color:"gray",icon:"·"}:Se(o),"getDisplayInfo"),it=xt(({duration:o,focused:e,interactiveMode:t,output:s,scrollRef:n,showFullscreenHint:d,status:a,taskId:f})=>{const p=a??"pending",{icon:g}=to(p),c=e?"bold":"single",M=p==="failure"?"red":p==="success"||Te(p)?e?"green":"gray":p==="running"?e?"white":"cyan":e?"white":"gray",k=f?`${g} ${f}`:void 0,P=o===void 0?void 0:me(o),y=f?t?"Esc cancel | Enter send":e&&p==="running"&&d?"⏎ FULLSCREEN i INPUT":e&&p==="running"?"i INPUT":e&&d?"<enter> full screen":e?void 0:"<tab> or <enter> to focus":void 0;if(!f)return l(u,{alignItems:"center",borderColor:"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,justifyContent:"center",paddingX:2,paddingY:1,children:[i(r,{dimColor:!0,children:"Select a task to view output"}),i(r,{dimColor:!0,children:"Press Enter or 1/2 to pin"})]});const S=s?s.split(`
|
|
12
|
-
`).map(v=>v.replace(/\r$/,"")):[];return!s&&(p==="running"||p==="pending")?i(u,{borderBottomTitle:y,borderColor:M,borderStyle:c,borderTopRightTitle:P,borderTopTitle:k,flexDirection:"column",flexGrow:1,paddingX:2,paddingY:1,children:i(u,{alignItems:"center",flexGrow:1,justifyContent:"center",children:i(r,{dimColor:!0,children:"Waiting for task output..."})})}):l(u,{borderBottomTitle:y,borderColor:t?"yellow":M,borderStyle:c,borderTopRightTitle:P,borderTopTitle:k,flexDirection:"column",flexGrow:1,children:[i(u,{flexGrow:1,flexShrink:1,paddingY:1,children:i(kt,{flexGrow:1,followOutput:!0,paddingX:2,ref:n,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:S.map((v,x)=>i(r,{children:v},String(x)))})}),t&&i(u,{flexShrink:0,justifyContent:"center",paddingX:1,children:i(r,{bold:!0,color:"yellow",children:"INTERACTIVE — keystrokes forwarded to task — Esc to exit"})})]})},"OutputPanel");var ro=Object.defineProperty,Me=O((o,e)=>ro(o,"name",{value:e,configurable:!0}),"u");const It=6,Rt=8,Et=10,oo=Me(o=>o==="running"||o==="pending"?bt:o==="local-cache"||o==="local-cache-kept-existing"?"Local":o==="remote-cache"?"Remote":Ie,"getCacheLabel"),nt=Me((o,e)=>e[0]===o?"[1]":e[1]===o?"[2]":"","getPinLabel"),st=Me(({compact:o,isSelected:e,pinLabel:t,row:s})=>{const{status:n,taskId:d}=s,a=e?">":" ";let f;if(n==="running")f=l(r,{bold:!0,color:"white",children:[" ",i(gr,{type:"dots"})," "]});else if(n==="pending")f=i(r,{bold:!0,color:"gray",children:" · "});else{const{color:g,icon:c}=Se(n);f=l(r,{bold:!0,color:g,children:[" ",c," "]})}let p=bt;return n!=="running"&&n!=="pending"?p=s.duration===void 0?Ie:me(s.duration):n==="running"&&s.elapsed!==void 0&&(p=me(s.elapsed)),l(u,{children:[i(r,{children:a}),i(u,{width:It,children:f}),l(u,{flexGrow:1,children:[i(r,{bold:e,inverse:e,children:d}),t?i(r,{dimColor:!0,children:` ${t}`}):null]}),!o&&i(u,{justifyContent:"flex-end",width:Rt,children:i(r,{dimColor:!Te(n),children:oo(n)})}),!o&&i(u,{justifyContent:"flex-end",width:Et,children:i(r,{dimColor:n==="pending",children:p})})]})},"TaskListRow"),lt=Me(({compact:o,filterActive:e,filterText:t,focused:s,headerStatus:n,parallelSlots:d=3,pinnedTaskIds:a,rows:f,scrollRef:p,selectedIndex:g,title:c})=>{const M=n==="error"?"red":n==="success"?"green":s?"white":"gray",k=f[g]?.taskId,P=f.filter(v=>v.status==="running"),y=P.length>0||f.some(v=>v.status==="pending"),S=[];if(y)for(let v=0;v<d;v++){const x=P[v];x?S.push(i(st,{compact:o,isSelected:x.taskId===k,pinLabel:nt(x.taskId,a),row:x},`par-${x.taskId}`)):S.push(l(u,{children:[i(r,{children:" "}),i(u,{width:It,children:i(r,{bold:!0,color:"gray",children:" · "})}),i(r,{dimColor:!0,children:"Waiting for task..."})]},`par-empty-${String(v)}`))}return l(u,{borderColor:M,borderStyle:"single",flexDirection:"column",flexGrow:1,children:[l(u,{flexShrink:0,gap:1,paddingX:1,children:[i(r,{bold:!0,inverse:!0,children:" VIS "}),i(r,{children:c}),!o&&l(u,{flexGrow:1,gap:0,justifyContent:"flex-end",children:[i(u,{justifyContent:"flex-end",width:Rt,children:i(r,{dimColor:!0,children:"Cache"})}),i(u,{justifyContent:"flex-end",width:Et,children:i(r,{dimColor:!0,children:"Duration"})})]})]}),i(kt,{flexGrow:1,flexShrink:1,paddingLeft:1,paddingY:1,ref:p,scrollbar:!0,scrollbarColor:"gray",scrollbarStyle:"block",children:f.map(v=>i(st,{compact:o,isSelected:v.taskId===k,pinLabel:nt(v.taskId,a),row:v},v.taskId))}),y&&i(u,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",borderTop:!0,flexDirection:"column",flexShrink:0,paddingLeft:1,paddingY:1,children:S}),e&&l(u,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",borderTop:!0,flexShrink:0,paddingX:1,children:[i(r,{bold:!0,color:"white",children:"/ "}),i(r,{children:t}),i(r,{inverse:!0,children:" "})]})]})},"TaskListPanel");var io=Object.defineProperty,no=O((o,e)=>io(o,"name",{value:e,configurable:!0}),"y");const ct=40,at=10,dt=100,so=no(({autoExitSeconds:o,parallelSlots:e,projectNames:t,stdinRegistry:s,store:n,targets:d,tasks:a})=>{const{exit:f}=wr(),{columns:p,rows:g}=kr(),c=yr(n.subscribe,n.getSnapshot),[M,k]=tt(!1),P=ye(null),y=ye(null),S=ye(null),[v,x]=tt(!1),N=ye({list:0,splitList:0,splitOutput:0}),R=je(()=>{c.viewMode==="list"?N.current.list=y.current?.getScrollOffset()??0:c.viewMode==="split"&&(N.current.splitList=y.current?.getScrollOffset()??0,N.current.splitOutput=S.current?.getScrollOffset()??0)},[c.viewMode]),Z=je(m=>{setTimeout(()=>{if(m==="list"){const h=N.current.list;y.current?.scrollTo(h)}else if(m==="split"){const h=N.current.splitList;h>0?y.current?.scrollTo(h):y.current?.scrollTo(Math.max(0,n.getSnapshot().selectedIndex-2)),S.current?.scrollTo(N.current.splitOutput)}},0)},[n]),U=ye(!1);Oe(()=>{c.done&&!U.current&&(U.current=!0,o>0&&x(!0)),!c.done&&U.current&&(U.current=!1,x(!1))},[c.done,o]);const B=rt(()=>{let m=c.rows;if(c.statusFilter!=="all"&&(m=m.filter(h=>c.statusFilter==="failed"?h.status==="failure":c.statusFilter==="running"?h.status==="running"||h.status==="pending":c.statusFilter==="passed"?h.status==="success"||Te(h.status):!0)),c.filterText){const h=c.filterText.toLowerCase();m=m.filter(b=>b.taskId.toLowerCase().includes(h))}return m},[c.rows,c.filterText,c.statusFilter]),ie=rt(()=>c.rows.filter(m=>m.status==="running").length,[c.rows]),H=(B[c.selectedIndex]??null)?.taskId??null,$=c.pinnedTaskIds[0]??H,j=$?c.rows.find(m=>m.taskId===$):null,Y=$?c.outputs.get($)??"":"",D=qe(t,d,a),_=c.done?`Completed ${D} (${me((c.endTime??Date.now())-c.startTime)})`:`Running ${D}...`,he=c.done?c.failed>0?"error":"success":"running",ee=je(m=>{y.current?.scrollTo(Math.max(0,m-2))},[]);if(Oe(()=>{c.interactiveMode&&j?.status!=="running"&&n.setInteractiveMode(!1)},[c.interactiveMode,j?.status,n]),Oe(()=>{if(!$)return;let m=p;c.viewMode==="split"&&p>=dt?m=p-Math.floor(p*.4)-2:(c.viewMode==="split"||c.viewMode==="fullscreen")&&(m=p-2);const h=Math.max(1,g-4);s.get($)?.resize?.(m,h)},[p,g,c.viewMode,$]),et((m,h)=>{if(h.escape){n.setInteractiveMode(!1);return}if(!$)return;const b=s.get($);if(!b){n.setInteractiveMode(!1);return}if(h.return)b.write("\r");else if(h.upArrow)b.write("\x1B[A");else if(h.downArrow)b.write("\x1B[B");else if(h.rightArrow)b.write("\x1B[C");else if(h.leftArrow)b.write("\x1B[D");else if(h.backspace)b.write("");else if(h.delete)b.write("\x1B[3~");else if(h.tab)b.write(" ");else if(h.home)b.write("\x1B[H");else if(h.end)b.write("\x1B[F");else if(h.pageUp)b.write("\x1B[5~");else if(h.pageDown)b.write("\x1B[6~");else if(h.ctrl&&m){const Q=m.toUpperCase().codePointAt(0);Q!==void 0&&Q>=65&&Q<=90&&b.write(String.fromCodePoint(Q-64))}else m&&b.write(m)},{isActive:c.interactiveMode}),et((m,h)=>{if(m==="c"&&h.ctrl){f();return}if(!v){if(M){h.escape||m==="?"?k(!1):m==="q"?(k(!1),x(!0)):h.downArrow||m==="j"?P.current?.scrollBy(1):h.upArrow||m==="k"?P.current?.scrollBy(-1):h.pageDown?P.current?.scrollBy(5):h.pageUp?P.current?.scrollBy(-5):h.home?P.current?.scrollToTop():h.end&&P.current?.scrollToBottom();return}if(m==="?"){k(!0);return}if(m==="q"){x(!0);return}if(m==="r"&&c.done){n.requestRerun();return}if(m==="R"&&c.done){const b=B[c.selectedIndex];b?.status==="failure"&&n.requestRetry(b.taskId);return}if(m==="F"&&!c.filterActive){const b=["all","failed","running","passed"],Q=b.indexOf(c.statusFilter);n.setStatusFilter(b[(Q+1)%b.length]);return}if(c.filterActive){if(h.escape){n.setFilterActive(!1);return}if(h.return){n.setFilterActive(!1);return}if(h.backspace){n.setFilter(c.filterText.slice(0,-1));return}if(m&&!h.ctrl&&!h.meta){n.setFilter(c.filterText+m);return}return}if(m==="i"&&j?.status==="running"&&(c.viewMode==="fullscreen"||c.viewMode==="split"&&c.focusedPanel==="output")){n.setInteractiveMode(!0);return}if(c.viewMode==="fullscreen"){if(h.escape){n.setViewMode("split"),Z("split");return}if(h.downArrow||m==="j"){S.current?.scrollBy(1);return}if(h.upArrow||m==="k"){S.current?.scrollBy(-1);return}if(h.pageDown||h.ctrl&&m==="d"){S.current?.scrollBy(12);return}if(h.pageUp||h.ctrl&&m==="u"){S.current?.scrollBy(-12);return}if(h.home){S.current?.scrollToTop();return}if(h.end){S.current?.scrollToBottom();return}return}if(c.viewMode==="split"){if(h.tab){const b=c.focusedPanel==="tasks"?"output":"tasks";n.setFocusedPanel(b);return}if(c.focusedPanel==="output"){if(h.escape){n.setFocusedPanel("tasks");return}if(h.return){R(),n.setViewMode("fullscreen");return}if(h.downArrow||m==="j"){S.current?.scrollBy(1);return}if(h.upArrow||m==="k"){S.current?.scrollBy(-1);return}if(h.pageDown||h.ctrl&&m==="d"){S.current?.scrollBy(12);return}if(h.pageUp||h.ctrl&&m==="u"){S.current?.scrollBy(-12);return}if(h.home){S.current?.scrollToTop();return}if(h.end){S.current?.scrollToBottom();return}return}if(h.escape){n.setViewMode("list"),Z("list");return}if(h.return){n.setFocusedPanel("output");return}}if(c.viewMode==="list"||c.viewMode==="split"&&c.focusedPanel==="tasks"){if(h.downArrow||m==="j"){const b=Math.min(c.selectedIndex+1,Math.max(0,B.length-1));n.setSelectedIndex(b),ee(b);return}if(h.upArrow||m==="k"){const b=Math.max(c.selectedIndex-1,0);n.setSelectedIndex(b),ee(b);return}if(h.return&&c.viewMode==="list"){R(),N.current.splitList=0,N.current.splitOutput=0,n.setViewMode("split"),n.setFocusedPanel("output"),Z("split");return}if(m==="/"){n.setFilterActive(!0);return}if(m==="1"&&H){n.pinTask(0,H);return}if(m==="2"&&H){n.pinTask(1,H);return}if(m==="0"){n.clearPins();return}h.escape&&c.filterText&&n.setFilter("")}}},{isActive:!c.interactiveMode}),p<ct||g<at)return i(u,{alignItems:"center",height:g,justifyContent:"center",width:p,children:l(r,{color:"yellow",children:["Terminal too small (",p,"x",g,"). Minimum:"," ",ct,"x",at]})});const A=l(u,{gap:1,children:[c.succeeded>0&&l(r,{bold:!0,color:"green",children:["✓"," ",c.succeeded]}),c.failed>0&&l(r,{bold:!0,color:"red",children:["✗"," ",c.failed]}),ie>0&&l(r,{color:"cyan",children:["◷"," ",ie]}),l(r,{dimColor:!0,children:[c.rows.length," ","total"]}),c.statusFilter!=="all"&&l(r,{color:"yellow",children:["[",c.statusFilter,"]"]})]});let W;if(c.viewMode==="fullscreen")W=[l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"Esc"}),i(r,{dimColor:!0,children:"BACK"})]},"esc"),l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"↑↓"}),i(r,{dimColor:!0,children:"SCROLL"})]},"scroll"),l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"^u ^d"}),i(r,{dimColor:!0,children:"PAGE"})]},"page"),...j?.status==="running"?[l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"i"}),i(r,{dimColor:!0,children:"INPUT"})]},"i")]:[],l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"q"}),i(r,{dimColor:!0,children:"QUIT"})]},"q")];else if(c.done){const m=B[c.selectedIndex]?.status==="failure";W=[l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"q"}),i(r,{dimColor:!0,children:"QUIT"})]},"q"),l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"r"}),i(r,{dimColor:!0,children:"RERUN"})]},"r"),...m?[l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"R"}),i(r,{dimColor:!0,children:"RETRY"})]},"R")]:[],l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"?"}),i(r,{dimColor:!0,children:"HELP"})]},"?"),l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"↑↓"}),i(r,{dimColor:!0,children:"NAV"})]},"nav"),l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"F"}),i(r,{dimColor:!0,children:"FILTER"})]},"F"),l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"⏎"}),i(r,{dimColor:!0,children:c.viewMode==="list"?"OUTPUT":"FULLSCREEN"})]},"enter")]}else c.viewMode==="split"&&c.focusedPanel==="output"?W=[l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"q"}),i(r,{dimColor:!0,children:"QUIT"})]},"q"),l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"Esc"}),i(r,{dimColor:!0,children:"BACK"})]},"esc"),l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"↑↓"}),i(r,{dimColor:!0,children:"SCROLL"})]},"scroll"),...j?.status==="running"?[l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"i"}),i(r,{dimColor:!0,children:"INPUT"})]},"i")]:[],l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"⏎"}),i(r,{dimColor:!0,children:"FULLSCREEN"})]},"enter"),l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"Tab"}),i(r,{dimColor:!0,children:"PANEL"})]},"tab"),l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"?"}),i(r,{dimColor:!0,children:"HELP"})]},"?")]:W=[l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"q"}),i(r,{dimColor:!0,children:"QUIT"})]},"q"),l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"?"}),i(r,{dimColor:!0,children:"HELP"})]},"?"),l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"↑↓"}),i(r,{dimColor:!0,children:"NAV"})]},"nav"),l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"/"}),i(r,{dimColor:!0,children:"FILTER"})]},"/"),l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"F"}),i(r,{dimColor:!0,children:"STATUS"})]},"F"),l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"⏎"}),i(r,{dimColor:!0,children:c.viewMode==="list"?"OUTPUT":"FULLSCREEN"})]},"enter"),...c.viewMode==="split"?[l(u,{gap:1,children:[i(r,{bold:!0,color:"white",children:"Tab"}),i(r,{dimColor:!0,children:"PANEL"})]},"tab")]:[]];const re=l(u,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,justifyContent:"space-between",children:[i(u,{flexGrow:1,flexWrap:"wrap",gap:2,paddingX:1,children:W}),i(u,{flexShrink:0,paddingX:1,children:A})]}),te=l(vr,{backgroundColor:"#1e1e1e",footer:l(r,{dimColor:!0,children:[i(r,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",i(r,{bold:!0,color:"white",children:"?"}),"/",i(r,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:P,title:"KEYBOARD SHORTCUTS",visible:M,width:52,children:[l(u,{flexDirection:"column",marginBottom:1,children:[l(u,{marginBottom:1,children:[i(r,{dimColor:!0,children:"── "}),i(r,{bold:!0,color:"white",children:"NAVIGATION"})]}),l(u,{children:[i(u,{width:24,children:l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","↑","/k"]}),i(r,{dimColor:!0,children:" Move up"})]})}),l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","↓","/j"]}),i(r,{dimColor:!0,children:" Move down"})]})]}),l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","Tab"]}),i(r,{dimColor:!0,children:" Switch panel (split)"})]}),l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","Esc"]}),i(r,{dimColor:!0,children:" Back / close"})]}),l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","Enter"]}),i(r,{dimColor:!0,children:" Show output / fullscreen"})]})]}),l(u,{flexDirection:"column",marginBottom:1,children:[l(u,{marginBottom:1,children:[i(r,{dimColor:!0,children:"── "}),i(r,{bold:!0,color:"white",children:"VIEWS"})]}),l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","Enter"]}),l(r,{dimColor:!0,children:[" ","List"," ","→"," ","Split"," ","→"," ","Fullscreen"]})]}),l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","Esc"]}),l(r,{dimColor:!0,children:[" ","Fullscreen"," ","→"," ","Split"," ","→"," ","List"]})]})]}),l(u,{flexDirection:"column",marginBottom:1,children:[l(u,{marginBottom:1,children:[i(r,{dimColor:!0,children:"── "}),i(r,{bold:!0,color:"white",children:"ACTIONS"})]}),l(u,{children:[i(u,{width:24,children:l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","/"]}),i(r,{dimColor:!0,children:" Filter by text"})]})}),l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","F"]}),i(r,{dimColor:!0,children:" Filter by status"})]})]}),l(u,{children:[i(u,{width:24,children:l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","1"]}),i(r,{dimColor:!0,children:"/"}),i(r,{bold:!0,color:"white",children:"2"}),i(r,{dimColor:!0,children:" Pin to output pane"})]})}),l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","0"]}),i(r,{dimColor:!0,children:" Clear pins"})]})]}),l(u,{children:[i(u,{width:24,children:l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","r"]}),i(r,{dimColor:!0,children:" Rerun all (done)"})]})}),l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","R"]}),i(r,{dimColor:!0,children:" Retry failed task"})]})]}),l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","i"]}),i(r,{dimColor:!0,children:" Interactive input (running task)"})]})]}),l(u,{flexDirection:"column",marginBottom:1,children:[l(u,{marginBottom:1,children:[i(r,{dimColor:!0,children:"── "}),i(r,{bold:!0,color:"white",children:"SCROLLING"}),i(r,{dimColor:!0,children:" (output panel)"})]}),l(u,{children:[i(u,{width:24,children:l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","↑","/k"]}),i(r,{dimColor:!0,children:" Scroll up"})]})}),l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","↓","/j"]}),i(r,{dimColor:!0,children:" Scroll down"})]})]}),l(u,{children:[i(u,{width:24,children:l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","^u"]}),i(r,{dimColor:!0,children:" Page up"})]})}),l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","^d"]}),i(r,{dimColor:!0,children:" Page down"})]})]}),l(u,{children:[i(u,{width:24,children:l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","Home"]}),i(r,{dimColor:!0,children:" Top"})]})}),l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","End"]}),i(r,{dimColor:!0,children:" Bottom"})]})]})]}),l(u,{flexDirection:"column",children:[l(u,{marginBottom:1,children:[i(r,{dimColor:!0,children:"── "}),i(r,{bold:!0,color:"white",children:"GENERAL"})]}),l(u,{children:[i(u,{width:24,children:l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","q"]}),i(r,{dimColor:!0,children:" Quit"})]})}),l(r,{children:[l(r,{bold:!0,color:"white",children:[" ","?"]}),i(r,{dimColor:!0,children:" Toggle help"})]})]})]})]}),ne=i(Vt,{autoExitSeconds:o>0?o:3,onCancel:O(()=>{x(!1)},"onCancel"),visible:v});if(c.viewMode==="fullscreen")return l(u,{flexDirection:"column",height:g,width:p,children:[i(u,{flexGrow:1,children:i(it,{duration:j?.duration??j?.elapsed,focused:!0,interactiveMode:c.interactiveMode,output:Y,scrollRef:S,status:j?.status,taskId:$})}),re,ne,te]});if(c.viewMode==="split"){const m=p>=dt,h=i(lt,{compact:!0,filterActive:c.filterActive,filterText:c.filterText,focused:c.focusedPanel==="tasks",headerStatus:he,parallelSlots:e,pinnedTaskIds:c.pinnedTaskIds,rows:B,scrollRef:y,selectedIndex:c.selectedIndex,title:_}),b=i(it,{duration:j?.duration??j?.elapsed,focused:c.focusedPanel==="output",interactiveMode:c.interactiveMode,output:Y,scrollRef:S,showFullscreenHint:!0,status:j?.status,taskId:$});if(m){const ke=Math.floor(p*.4);return l(u,{flexDirection:"column",height:g,width:p,children:[l(u,{flexDirection:"row",flexGrow:1,children:[i(u,{width:ke,children:h}),i(u,{flexGrow:1,children:b})]}),re,ne,te]})}const Q=Math.floor(g*.45);return l(u,{flexDirection:"column",height:g,width:p,children:[i(u,{height:Q,children:h}),i(u,{flexGrow:1,children:b}),re,ne,te]})}return l(u,{flexDirection:"column",height:g,width:p,children:[i(u,{flexGrow:1,children:i(lt,{filterActive:c.filterActive,filterText:c.filterText,focused:!0,headerStatus:he,parallelSlots:e,pinnedTaskIds:c.pinnedTaskIds,rows:B,scrollRef:y,selectedIndex:c.selectedIndex,title:_})}),re,ne,te]})},"VisTaskRunnerApp");var lo=Object.defineProperty,ge=O((o,e)=>lo(o,"name",{value:e,configurable:!0}),"n");const co=ge(o=>{const{args:e,autoExit:t=!1,projectNames:s,stdinRegistry:n,tasks:d}=o,a=new $e(d),f=typeof e.parallel=="number"?e.parallel:3,p=t===!0?3:typeof t=="number"?t:0;let g,c;const M=new Promise(R=>{c=R});let k;const P=ge(()=>{k&&(clearInterval(k),k=void 0)},"cleanup"),y=ge(()=>{if(n){for(const R of n.values())R.kill?.();n.clear()}},"killAllPtyProcesses"),S=ge(()=>{P(),N(),y(),process.stdout.write("\x1B[?1049l\x1B[?25h"),g?.cleanup(),process.exit(1)},"onSignal"),v=ge(()=>{const R=a.getSnapshot(),Z=me(Date.now()-R.startTime),U=R.rows.filter(H=>H.status==="failure").map(H=>H.taskId),B=process.stdout.columns||80;process.stdout.write(`
|
|
13
|
-
`);for(const H of R.rows){const{status:$,taskId:j}=H,Y=Se($);let D="";switch($){case"local-cache":case"local-cache-kept-existing":{D=" [local cache]";break}case"remote-cache":{D=" [remote cache]";break}case"skipped":{D=" [skipped]";break}}const _=K(F.createElement(r,null," ",F.createElement(r,{color:Y.color},Y.icon),` vis run ${j}`,D?F.createElement(r,{dimColor:!0},` ${D}`):null),{columns:B});process.stdout.write(`${_}
|
|
14
|
-
`)}process.stdout.write(`
|
|
15
|
-
`);const ie=K(F.createElement(Ct,{cached:R.cached,failed:R.failed,failedIds:U,projectNames:s,succeeded:R.succeeded,targets:e.targets,tasks:d,took:Z}),{columns:B});if(process.stdout.write(`${ie}
|
|
16
|
-
`),U.length>0)for(const H of U){const $=R.outputs.get(H);if($?.trim()){const j=K(F.createElement(r,null,`
|
|
17
|
-
`,F.createElement(r,{bold:!0,color:"red"},` ${He} vis run ${H}`)),{columns:B});process.stdout.write(`${j}
|
|
18
|
-
|
|
19
|
-
`);const Y=$.trim().split(`
|
|
20
|
-
`).map(D=>` ${D}`).join(`
|
|
21
|
-
`);process.stdout.write(`${Y}
|
|
22
|
-
`)}}},"printExitSummary");let x;const N=ge(()=>{x&&(clearInterval(x),x=void 0)},"clearKeepAlive");return{lifeCycle:{endCommand(){P(),a.markDone(),x||(x=setInterval(()=>{},1e3)),process.stdin.isTTY&&typeof process.stdin.setRawMode=="function"&&(process.stdin.setRawMode(!0),process.stdin.ref(),process.stdin.resume())},endTasks(R){a.endTasks(R)},printTaskTerminalOutput(R,Z,U){a.getSnapshot().outputs.has(R.id)||a.addOutput(R.id,U)},startCommand(){process.on("SIGINT",S),process.on("SIGTERM",S),x||(x=setInterval(()=>{},1e3)),process.stdin.isTTY&&typeof process.stdin.setRawMode=="function"&&(process.stdin.setRawMode(!0),process.stdin.ref(),process.stdin.resume()),g=br(F.createElement(so,{autoExitSeconds:p,parallelSlots:f,projectNames:s,stdinRegistry:n??new Map,store:a,targets:e.targets,tasks:d}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}),g.waitUntilExit().then(()=>{N(),y(),process.removeListener("SIGINT",S),process.removeListener("SIGTERM",S),v(),c()},()=>{N(),y(),process.removeListener("SIGINT",S),process.removeListener("SIGTERM",S),c()})},startTasks(R){a.startTasks(R),k||(k=setInterval(()=>{a.tick()},100))}},renderIsDone:M,store:a}},"createDynamicOutputRenderer");var ao=Object.defineProperty,uo=O((o,e)=>ao(o,"name",{value:e,configurable:!0}),"m");class ho{static{O(this,"StaticOutputLifeCycle")}static{uo(this,"StaticOutputLifeCycle")}#e;#r;#o;#i=[];#t=[];#n=new Map;#s;#l=0;constructor(e){this.#e=e.projectNames,this.#r=e.args.targets,this.#o=e.tasks,this.#s=e.logReporter}startCommand(){this.#l=Date.now();const e=process.stdout.columns||80,t=`Running ${qe(this.#e,this.#r,this.#o)}`,s=K(F.createElement(Pe,{title:t,variant:"info"}),{columns:e});process.stdout.write(s);const n=this.#o[0],d=n?.overrides?Object.entries(n.overrides).filter(([a])=>a!=="command"):[];if(d.length>0){process.stdout.write(`
|
|
23
|
-
With additional flags:
|
|
24
|
-
`);for(const[a,f]of d)process.stdout.write(`${qr(" ",a,f)}
|
|
25
|
-
`)}process.stdout.write(`
|
|
26
|
-
`)}startTasks(e){const t=process.stdout.columns||80;for(const s of e){const n=K(F.createElement(r,null,F.createElement(r,{dimColor:!0},">"),` ${s.id}`),{columns:t});process.stdout.write(`${n}
|
|
27
|
-
`)}}endTasks(e){const t=process.stdout.columns||80;for(const s of e){this.#n.set(s.task.id,s),s.status==="failure"?this.#i.push(s):Te(s.status)&&this.#t.push(s);const n=$t(s.status),d=s.startTime&&s.endTime?` (${me(s.endTime-s.startTime)})`:"",a=Te(s.status)?" [cache]":"",f=K(F.createElement(r,null,n,` ${s.task.id}`,a?F.createElement(r,{color:"cyan"},a):null,d?F.createElement(r,{dimColor:!0},d):null),{columns:t});process.stdout.write(`${f}
|
|
28
|
-
`)}}printTaskTerminalOutput(e,t,s){if(this.#s){this.#s.printTaskTerminalOutput(e,t,s);return}Zr(e.id,t,s)}endCommand(){const e=me(Date.now()-this.#l),t=this.#o.filter(d=>!this.#n.has(d.id)).map(d=>d.id);process.stdout.write(`
|
|
29
|
-
`);const s=process.stdout.columns||80,n=K(F.createElement(Ct,{cached:this.#t.length,failed:this.#i.length,failedIds:this.#i.map(d=>d.task.id),projectNames:this.#e,skippedIds:t.length>0?t:void 0,succeeded:this.#n.size-this.#i.length-this.#t.length,targets:this.#r,tasks:this.#o,took:e}),{columns:s});process.stdout.write(`${n}
|
|
30
|
-
`)}}var fo=Object.defineProperty,we=O((o,e)=>fo(o,"name",{value:e,configurable:!0}),"l");const po=[/node_modules(?:\/|$)/,/\.git(?:\/|$)/,/\.vis(?:\/|$)/,/\.task-runner(?:\/|$)/],ut=we((o,e)=>{const t=new Set,s=new Set;for(const[,a]of o){const f=a.task.hashDetails?.nodes;if(f)for(const p of Object.keys(f))t.add(p),s.add(hr(wt(e,p)))}const n=[...s].sort(),d=[];for(const a of n)d.some(f=>a===f||a.startsWith(`${f}/`))||d.push(a);return{directories:d,files:t}},"collectTrackedWatchTargets"),mo=we((o,e,t)=>{const s=new Set;for(const n of o){const d=wt(e,n);for(const a of t)if(d===a||d.startsWith(`${a}/`)){const f=fr(a,d);f.length>0&&s.add(f)}}return n=>{const d=n.replaceAll("\\","/");return s.has(d)}},"createTrackedFileFilter"),go=we(o=>{const e=o.replaceAll("\\","/");return po.some(t=>t.test(e))},"shouldIgnore"),ht=we(o=>{const{debounceMs:e=150,filter:t,onChange:s,paths:n}=o,d=[];let a=new Set,f;const p=we(()=>{f=void 0;const g=[...a];a=new Set,g.length!==0&&Promise.resolve(s(g)).catch(c=>{console.error("[vis watch] onChange handler failed:",c)})},"flush");for(const g of n)try{const c=Tr(g,{recursive:!0},(M,k)=>{k&&(go(k)||t&&!t(k)||(a.add(k),f&&clearTimeout(f),f=setTimeout(p,e)))});d.push(c)}catch(c){console.warn(`[vis watch] unable to watch ${g}: ${c.message}`)}return{close:we(()=>{f&&clearTimeout(f);for(const g of d)try{g.close()}catch{}},"close")}},"startWatcher");var wo=Object.defineProperty,E=O((o,e)=>wo(o,"name",{value:e,configurable:!0}),"c");const Ue="VIS_AFFECTED_FILES",Mt=E((o,e,t)=>t||!e?o:e.startsWith("/")?e:`${o}/${e}`,"resolveCwd"),ft=E(async(o,e,t,s)=>{const n=o.map(d=>{const a=d.overrides.command;if(!a)return;const f=d.overrides.visOptions,p=Mt(e,d.projectRoot,!!f?.runFromWorkspaceRoot),g=f?.envFile?gt(p,f.envFile):{},c=t&&(f?.affectedFiles==="env"||f?.affectedFiles==="both")?{[Ue]:t.join(`
|
|
31
|
-
`)}:{};return{command:a,cwd:p,env:{INIT_CWD:s,...g,...c},name:d.id}}).filter(d=>d!==void 0);n.length!==0&&await Le(n,{killOthers:["failure"]})},"runPersistentTasks"),Ae=256*1024;class ko{static{O(this,"ye")}static{E(this,"OutputRingBuffer")}#e;#r="";#o=!1;constructor(e){this.#e=e}append(e){this.#r+=e,this.#r.length>this.#e&&(this.#r=this.#r.slice(-this.#e),this.#o=!0)}toString(){return this.#o?`[...output truncated, showing last ${Math.round(this.#e/1024)}KB...]
|
|
32
|
-
${this.#r}`:this.#r}}const jt=E(o=>{const e=o.overrides.visOptions;if(e&&typeof e=="object")return e},"getTaskOptions"),_e=E(o=>`'${o.replaceAll("'",String.raw`'\''`)}'`,"singleQuoteEscape"),vo=E((o,e,t)=>{if(!e||e.length===0||t===!1||t===void 0)return o;if(t==="args"||t==="both"){const s=e.map(_e).join(" ");return`${o} ${s}`}return o},"buildAffectedFilesArgs"),Ot="visForwardedArgs",bo=E((o,e)=>{const t=e.overrides[Ot];if(!Array.isArray(t)||t.length===0)return o;const s=t.map(_e).join(" ");return`${o} ${s}`},"appendForwardedArgs"),yo=E(async(o,e,t)=>{if(!e)return t();const s=o.get(e)??Promise.resolve();let n;const d=new Promise(f=>{n=f}),a=s.then(()=>d);o.set(e,a),await s;try{return await t()}finally{n(),o.get(e)===a&&o.delete(e)}},"withMutex"),To=E(o=>{let e=Math.max(0,Math.floor(o));return{claim(t){const s=Math.max(0,Math.min(t,e));return e-=s,s},get remaining(){return e}}},"createRetryBudget"),Co=E((o,e,t)=>{const s=`${e}\0${typeof t=="string"?t:String(t)}`,n=o.get(s);if(n)return n;const d=gt(e,t);return o.set(s,d),d},"loadEnvFileCached"),pt=E(o=>{const e=new Map;return async(t,s)=>{const{affectedFiles:n,currentOs:d,initCwd:a,lifeCycle:f,mutexPool:p,onOutput:g,onOutputReplace:c,retryBudget:M,stdinRegistry:k,workspaceRoot:P}=o,y=jt(t),S=Mt(P,s.cwd??t.projectRoot,y?.runFromWorkspaceRoot===!0),v=t.overrides.command;if(!v)return{code:0,terminalOutput:`No command configured for ${t.target.project}:${t.target.target}`};const x=bo(v,t),N=vo(x,n,y?.affectedFiles),R=zt(y,d),Z=R?`${R} -c ${_e(N)}`:N,U=y?.envFile?Co(e,S,y.envFile):void 0,B={};n&&n.length>0&&(y?.affectedFiles==="env"||y?.affectedFiles==="both")&&(B[Ue]=n.join(`
|
|
33
|
-
`));const ie={INIT_CWD:a,...U,...s.env,...B},H=y?.pty===!0,$=!!k,j=$||H;j&&(t.cache=!1);const Y=j?void 0:new ko(Ae),D=j?new mt(Ae):void 0;let _;const he=E(A=>{if(A.kind==="started"&&(_=A.kill,A.write&&k&&k.set(t.id,{kill:A.kill,resize:A.resize,write:A.write})),(A.kind==="stdout"||A.kind==="stderr")&&A.text!==void 0)if(A.kind==="stdout"?f?.onTaskStdout?.(t,A.text):f?.onTaskStderr?.(t,A.text),D)D.write(A.text),$&&c?.(t.id,D.toString());else{const W=`${A.text}
|
|
34
|
-
`;Y.append(W),g?.(t.id,W)}A.kind==="close"&&k&&k.delete(t.id)},"onEvent"),ee=E(async()=>{const A=y?.retryCount??0,W=y?.retryDelay,re=M?M.claim(A):A,te=typeof y?.timeout=="number"&&y.timeout>0?y.timeout:0;let ne=!1,m;te>0&&(m=setTimeout(()=>{ne=!0,_?.("SIGTERM")},te));let h;try{h=await Le([{command:Z,cwd:S,env:ie,name:t.id,...j?{ptySize:{cols:process.stdout.columns??80,rows:process.stdout.rows??24},stdin:"pty"}:{}}],{killOthers:["failure"],onEvent:he,...re>0?{restart:{delay:W??"exponential",tries:re}}:{}})}finally{m&&clearTimeout(m)}const b=h.closeEvents[0],Q=D?D.toString():Y.toString();return ne?{code:124,terminalOutput:`${Q}
|
|
35
|
-
[timeout] Task "${t.id}" exceeded ${te}ms budget.
|
|
36
|
-
`}:{code:b?.exitCode??1,terminalOutput:Q}},"runOnce");return p?yo(p,y?.mutex,ee):ee()}},"createConcurrentExecutor"),So=E(o=>{if(!o||o.trim().length===0)return;const e=Number.parseFloat(o);return!Number.isFinite(e)||e<=0?{invalid:o}:{value:Math.floor(e)}},"parseEnvConcurrency"),$o=E(async(o,e)=>{const t=await Bt(o);if(!t){e.warn("No previous run recorded yet. Run a task at least once to populate .task-runner/last-summary.json.");return}const s=(t.duration/1e3).toFixed(2);if(e.info(""),e.info(`Last run — ${t.startTime} (${s}s)`),e.info(""),e.info(` Total: ${String(t.stats.total)}`),e.info(` Succeeded: ${String(t.stats.succeeded)}`),e.info(` Cached: ${String(t.stats.cached)}`),e.info(` Failed: ${String(t.stats.failed)}`),e.info(` Skipped: ${String(t.stats.skipped)}`),e.info(""),t.stats.failed>0){const d=t.tasks.filter(a=>a.exitCode!==void 0&&a.exitCode!==0);e.info("Failed tasks:");for(const a of d){const f=a.duration??0;e.info(` × ${a.taskId} (exit ${String(a.exitCode??-1)}, ${f}ms)`)}e.info("")}const n=[...t.tasks].filter(d=>typeof d.duration=="number").sort((d,a)=>(a.duration??0)-(d.duration??0)).slice(0,5);if(n.length>0){e.info("Slowest tasks:");for(const d of n)e.info(` ${d.taskId.padEnd(40)} ${String(d.duration??0).padStart(6)}ms [${d.cacheStatus}]`);e.info("")}},"renderLastRunSummary"),Go=E(async({argument:o,logger:e,options:t,runtime:s,visConfig:n,workspaceRoot:d})=>{if(!d)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const a=d;if(t.lastDetails===!0){await $o(a,e);return}const f=process.cwd(),{config:p,packageJsons:g,projectOptions:c,workspace:M}=Yt(a,n),k=Qt(a,M,g);let P=o[0];if(!P){const w=ot(M);if(process.stdout.isTTY&&process.stdin.isTTY){const T=await Nr(w);if(!T){e.info("No target selected.");return}P=T,await Er(`vis run ${T}`)}else{e.info("Available targets:"),e.info(""),e.info(Br(w)),e.info(""),e.info("Usage: vis run <target>");return}}if(p.constraints&&!t.skipConstraints){const w=Nt(k,p.constraints);if(w.length>0){for(const T of w)e.error(`[${T.rule}] ${T.message}`);throw new Error(`${w.length} project constraint violation(s) found. Use --skip-constraints to bypass.`)}}if(t.affected){const w=[P];t.parallel!==void 0&&w.push(`--parallel=${String(t.parallel)}`),t.cache||w.push("--no-cache"),t.query&&w.push(`--query=${String(t.query)}`),await s.runCommand("affected",{argv:w});return}const y=await cr(P,M,process.cwd(),a),S=Pr(c),v=Ar(y.target,S);v!==y.target&&e.debug?.(`Resolved alias "${y.target}" → "${v}"`);let x=y.projects;const N=o.slice(1).map(String);if(t.projects){const w=new Set(t.projects.split(",").map(T=>T.trim()));if(x=x.filter(T=>w.has(T)),x.length===0)throw new Error(`No matching projects found for: ${String(t.projects)}`)}if(t.query&&(x=ar(x,M,t.query),x.length===0)){e.info(`Query "${String(t.query)}" matched no projects.`);return}const R=Xt(),Z=process.env[Ue],U=Z?Z.split(`
|
|
37
|
-
`).filter(Boolean):void 0,B=[],ie=new Map;for(const w of x){const T=c.get(w)?.[v];if(!T)continue;const C=T.options;if(!C?.internal){if(!Kt(C,R)){e.debug?.(`Skipping ${w}:${v} — osType does not match ${R}`);continue}if(!Jt(C,!!Je)){e.debug?.(`Skipping ${w}:${v} — runInCI filter`);continue}if(!Zt(C?.when)){e.debug?.(`Skipping ${w}:${v} — \`when\` condition not satisfied`);continue}B.push(w),ie.set(w,T)}}if(B.length===0){const w=ot(M),T=Object.entries(M.projects).filter(([,C])=>C.targets?.[v]!==void 0).map(([C])=>C);if(e.error(`No projects have the "${v}" target.`),T.length>0){e.info(""),e.info(`Target "${v}" exists in these projects but was filtered out:`);for(const C of T.slice(0,5))e.info(` - ${C}`);T.length>5&&e.info(` …and ${T.length-5} more`)}else{const C=Tt(v,w,3);C.length>0&&(e.info(""),e.info(C.length===1?`Did you mean "${C[0]}"?`:`Did you mean one of: ${C.map(G=>`"${G}"`).join(", ")}?`)),e.info(""),e.info("Run `vis run` without arguments to see all available targets.")}return}const H=t.pty===!0;let $=B.map(w=>{const T=M.projects[w],C=ie.get(w),G={project:w,target:v},q=`${w}:${v}`,se=H?{...C.options,pty:C.options?.pty??!0}:C.options;return{cache:C.cache,id:q,outputs:C.outputs??[],overrides:{command:C.command,...N.length>0?{[Ot]:N}:{},...se?{visOptions:se}:{}},parallelism:C.parallelism,projectRoot:T?.root,target:G}});const j=[],Y=[];for(const w of $)jt(w)?.persistent?(w.cache=!1,j.push(w)):Y.push(w);$=Y;const D=Ht(t.partition);if(D&&($=Gt.partitionTasks($,D),e.info(`Partition ${D.index}/${D.total}: running ${$.length} task(s)`),$.length===0)){e.info("No tasks assigned to this partition.");return}const _=qt($,{projectGraph:k,targetDefaults:p.targetDefaults,workspace:M});if(t.dryRun){const w=Object.keys(_.tasks).length,T=_.roots.length;e.info(`Execution plan (${String(w)} task(s), ${String(T)} root(s)):`),e.info("");const C=new Set,G=E((q,se)=>{if(C.has(q))return;C.add(q);for(const fe of _.dependencies[q]??[])G(fe,se+1);const le=_.tasks[q],J=" ".repeat(se+1);e.info(`${J}${q}${le?.cache===!1?" (no-cache)":""}`)},"walkPlan");for(const q of _.roots)G(q,0);j.length>0&&(e.info(""),e.info(` + ${String(j.length)} persistent task(s) (run after graph completes)`)),e.info("");return}await mr(a,p.toolchain,{error:E(w=>e.error(w),"error"),info:E(w=>e.info(w),"info"),warn:E(w=>e.warn(w),"warn")},!!t.skipToolchain);const he=Date.now(),ee=Sr(),A=E((w,T)=>{const C=T instanceof Error?T.message:String(T);e.warn(`Plugin error in ${w}: ${C}`)},"onHookError");await $r(ee,p.plugins);const W=typeof t.profile=="string"?t.profile:void 0,re=E(async w=>{if(!W)return;const T=Qe(w,_,he),C=W.startsWith("/")?W:`${a}/${W}`;await Ut(T,C),e.info(`Profile written to ${W}`)},"maybeWriteProfile"),te=p.taskRunnerOptions??{},ne=er(a,t.cacheDir,te.cacheDirectory),m=tr(ne,a,p.branchScopedCache),h=So(process.env.VIS_RUN_CONCURRENCY_LIMIT);h&&"invalid"in h&&e.warn(`VIS_RUN_CONCURRENCY_LIMIT=${h.invalid} is not a positive number; falling back to default concurrency.`);const b=h&&"value"in h?h.value:void 0,Q=t.parallel??b??3,ke={dryRun:t.dryRun??!1,parallel:Q,skipNxCache:!t.cache,summarize:t.summarize??!1,...te,cacheDirectory:m},Ft=process.stdout.isTTY&&!Je,Pt=p.tui?.autoExit??!1,We={args:{parallel:ke.parallel,targets:[v]},autoExit:Pt,projectNames:B,tasks:$},Ve=typeof t.retryBudget=="number"?t.retryBudget:void 0,ze=Ve===void 0?void 0:To(Ve),Ye=new xr(ee,A);if(await ee.callHook("run:before",{tasks:$,workspaceRoot:a}),Ft){const w=new Map,T=co({...We,stdinRegistry:w}),{lifeCycle:C,store:G}=T,q=new Xe([C,Ye]),se=pt({affectedFiles:U,currentOs:R,initCwd:f,lifeCycle:q,mutexPool:new Map,onOutput:E((I,L)=>{G.addOutput(I,L)},"onOutput"),onOutputReplace:E((I,L)=>{G.setOutput(I,L)},"onOutputReplace"),retryBudget:ze,stdinRegistry:w,workspaceRoot:a});let le="rerun",J=null,fe=new Map;for(;le!=="quit";){if(le==="rerun")fe=await Ke($,ke,{lifeCycle:q,projectGraph:k,taskExecutor:se,taskGraph:_,workspaceRoot:a});else if(le==="retry"&&J){const I=$.find(z=>z.id===J),L=I?.overrides.command;if(I&&L){const z=I.projectRoot??a,pe=z.startsWith("/")?z:`${a}/${z}`;q.startTasks?.([I]);const ce=new mt(Ae),de=(await Le([{command:L,cwd:pe,name:I.id,ptySize:{cols:process.stdout.columns??80,rows:process.stdout.rows??24},stdin:"pty"}],{onEvent:E(V=>{V.kind==="started"&&V.write&&w.set(I.id,{kill:V.kill,resize:V.resize,write:V.write}),(V.kind==="stdout"||V.kind==="stderr")&&V.text&&(ce.write(V.text),G.setOutput(I.id,ce.toString())),V.kind==="close"&&w.delete(I.id)},"onEvent")})).closeEvents[0];q.endTasks?.([{code:de?.exitCode??1,status:de?.exitCode===0?"success":"failure",task:I,terminalOutput:G.getSnapshot().outputs.get(I.id)}])}else I&&q.endTasks?.([{code:1,status:"failure",task:I,terminalOutput:`No command configured for ${I.id}`}]);J=null,G.markDone()}le=await new Promise(I=>{const L=G.subscribe(()=>{const z=G.getSnapshot();z.rerunRequested&&(G.acknowledgeRerun(),L(),I("rerun")),z.retryTaskId&&(J=G.acknowledgeRetry(),L(),I("retry"))});T.renderIsDone.then(()=>{L(),I("quit")},()=>{L(),I("quit")})})}await T.renderIsDone,await ee.callHook("run:after",fe),await re(fe),j.length>0&&!t.failFast&&await ft(j,a,U,f)}else{const w=new Map,T=typeof t.log=="string"?t.log.toLowerCase():"",C=T==="labeled"||T==="grouped"||T==="interleaved"?T:void 0,G=C?_t(C):void 0,q=new Xe([new ho({...We,logReporter:G}),Ye]),se=pt({affectedFiles:U,currentOs:R,initCwd:f,lifeCycle:q,mutexPool:w,retryBudget:ze,workspaceRoot:a}),le=E(async()=>{const I=Date.now(),L=await Ke($,ke,{lifeCycle:q,projectGraph:k,taskExecutor:se,taskGraph:_,workspaceRoot:a}),z=Date.now()-I;if(t.summarize){const ve=Qe(L,_,he);await Wt(ve,a)}let pe=!1;for(const[,ve]of L)ve.status==="failure"&&(pe=!0);const ce=rr(L,z),de=or(a),V=ir(a,z,de);return e.info(""),e.info(` ${ce}${V?` ${V}`:""}`),{hasFailure:pe,results:L,runHistory:de}},"runOnce"),J=await le();await ee.callHook("run:after",J.results),await re(J.results);const{hasFailure:fe}=J;if(t.watch){const I=B.map(X=>{const ae=M.projects[X]?.root;if(ae)return ae.startsWith("/")?ae:`${a}/${ae}`}).filter(X=>X!==void 0);let L=!1,z=J.results;const pe=E(()=>{const X=ut(z,a);if(X.directories.length>0&&X.files.size>0){const ae=mo(X.files,a,X.directories);return{handle:ht({filter:ae,onChange:de,paths:X.directories}),mode:"tracked"}}return{handle:ht({onChange:de,paths:I}),mode:"roots"}},"buildHandle");let ce;const de=E(async X=>{if(!L){L=!0;try{e.info(`Change detected in ${X.length} file(s), rerunning…`),z=(await le()).results,ce?.close(),ce=pe().handle}finally{L=!1}}},"onChangeHandler"),V=pe();ce=V.handle;const ve=V.mode==="tracked"?`Watching ${String(ut(z,a).files.size)} tracked file(s)`:`Watching ${String(I.length)} project root(s)`;e.info(`${ve} — edit a file to rerun, Ctrl+C to exit.`),await new Promise(X=>{const ae=E(()=>{process.off("SIGINT",ae),ce?.close(),X()},"onSigint");process.on("SIGINT",ae)});return}if(fe){if(t.flaky!==!1){const I=nr(a,{minRuns:2},J.runHistory);if(I.length>0){e.info(""),e.info("Flaky tasks (based on historical runs):"),e.info("");for(const L of sr(I))e.info(` ${L}`);e.info("")}}throw new Error("Some tasks failed.")}j.length>0&&!t.failFast&&await ft(j,a,U,f)}},"execute");export{To as createRetryBudget,Go as default};
|
|
1
|
+
import{DEFAULT_CHANGES_DIR as R}from"./DEFAULT_CLEAN_KEEP.js";import{b as D,c as F,d as b}from"./orchestrator.js";import{createShellRunner as E}from"./shell-runner.js";const y=async({logger:r,options:d,workspaceRoot:$})=>{const s=$??process.cwd(),p=d.noFail===!0,u=d.strict===!0,t=await D({cwd:s}),{printConfigIfRequested:x}=await import("./print-config.js");if(x(d,t,r))return;const{files:i}=await F({changesDir:t.config.changesDir,cwd:s});if(i.length===0){u?(r.error("No change files present and --strict is set."),r.error(`Run \`vis release add\` to author one in ${t.config.changesDir??R}.`),process.exitCode=p?0:1):(r.warn("No change files present. PR will not produce a release."),process.exitCode=0);return}if(!u){r.info(`${i.length} change file(s) present. ✓`),process.exitCode=0;return}const m=t.config.baseBranch??"main",g=await E().run("git",["diff","--name-only",`${m}...HEAD`],{cwd:s,silent:!0});if(g.exitCode!==0){r.warn(`Could not run git diff vs ${m}: ${g.stderr}`),process.exitCode=0;return}const f=g.stdout.split(`
|
|
2
|
+
`).map(e=>e.trim()).filter(Boolean);if(f.length===0){r.info("No source files changed. ✓"),process.exitCode=0;return}const{default:w}=await import("./index.js"),k=t.config.changedFilePatterns??["**"],v=(e,n,l)=>{if(!e.startsWith(`${n}/`))return!1;const h=e.slice(n.length+1);return l.some(o=>w(o,h))},C=new Set(b(i).keys()),c=new Set;for(const e of f){const n=t.packages.find(o=>{const a=o.dir.startsWith(s)?o.dir.slice(s.length).replace(/^[/\\]/,""):o.dir;return e===`${a}/package.json`||e.startsWith(`${a}/`)});for(const o of t.packages){const a=t.perPackageConfig.get(o.name)?.additionalPaths;!a||a.length===0||a.some(P=>w(P,e))&&!C.has(o.name)&&c.add(o.name)}if(!n)continue;const l=n.dir.startsWith(s)?n.dir.slice(s.length).replace(/^[/\\]/,""):n.dir,h=t.perPackageConfig.get(n.name)?.changedFilePatterns??k;e!==`${l}/package.json`&&!v(e,l,h)||C.has(n.name)||c.add(n.name)}if(c.size>0){r.error("The following packages have changes but no covering change file:");for(const e of c)r.error(` - ${e}`);r.error("Run `vis release add` to author one."),process.exitCode=p?0:1;return}r.info(`${i.length} change file(s); ${f.length} changed file(s) all covered. ✓`),process.exitCode=0};export{y as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
`
|
|
3
|
-
|
|
1
|
+
import{b as h}from"./orchestrator.js";import{escapeMarkdown as f}from"./security.js";import{createShellRunner as g}from"./shell-runner.js";import{d as w,a as R,u as $}from"../packem_shared/sticky-comment-D6_7-w8T.js";const k=(o,a)=>{const e=["### 🚀 Release Plan",""];if(a&&(e.push(`Channel: \`${a}\``),e.push("")),o.releases.length===0)return e.push("_No pending releases._ (Add a change file via `vis release add` to mark this PR as releasing.)"),e.join(`
|
|
2
|
+
`);const n={major:[],minor:[],patch:[]};for(const s of o.releases)n[s.type].push(s);for(const s of["major","minor","patch"])if(n[s].length!==0){e.push(`#### ${s.charAt(0).toUpperCase()}${s.slice(1)}`),e.push("");for(const r of n[s]){const t=[];r.isCascadeBump&&t.push("cascade"),r.isGroupBump&&t.push("group"),r.isDependencyBump&&!r.isCascadeBump&&t.push("dep-bump");const i=t.length>0?` _(${t.join(", ")})_`:"";e.push(`- \`${r.name}\`: ${r.oldVersion} → **${r.newVersion}**${i}`)}e.push("")}if(o.warnings.length>0){e.push("#### ⚠️ Warnings"),e.push("");for(const s of o.warnings)e.push(`- ${f(s)}`)}return e.join(`
|
|
3
|
+
`)},v=async({logger:o,options:a,workspaceRoot:e})=>{const n=e??process.cwd(),s=a.noFail===!0,r=a.strict===!0,t=g(),i=await w(t,n),c=R(process.env);(!i||!c)&&o.warn("Not running in a PR context (GITHUB_REF / PR_NUMBER missing or `gh repo view` failed). Falling back to local print.");const p=await h({cwd:n,skipRegistryLookup:!0}),{printConfigIfRequested:d}=await import("./print-config.js");if(d(a,p,o))return;const m=p.config.versionPr?.commentMarker??"<!-- vis-release-comment -->",l=k(p.plan,p.channel?.tag);if(i&&c){const u=await $({body:l,cwd:n,issueNumber:c,marker:m,repo:i,runner:t});if(u)o.info(`${u.created?"Posted":"Updated"} release-plan comment on PR #${c} (id: ${u.id}).`);else{o.error("Failed to post / update PR comment."),process.exitCode=s?0:1;return}}else o.info(l);r&&p.plan.releases.length===0&&(o.error("--strict and no pending releases."),process.exitCode=s?0:1)};export{v as default};
|
|
@@ -1,23 +1,6 @@
|
|
|
1
|
-
|
|
2
|
-
`)
|
|
3
|
-
|
|
4
|
-
`
|
|
5
|
-
|
|
6
|
-
`)
|
|
7
|
-
${r.description}
|
|
8
|
-
`),r.keywords.length>0){const o=`keywords: ${r.keywords.slice(0,6).join(", ")}${r.keywords.length>6?", ...":""}`;process.stdout.write(` ${t?b(o):o}
|
|
9
|
-
`)}process.stdout.write(`
|
|
10
|
-
`)}},"printListRules"),De=f(async(e,t)=>{const n=await pe(e);if(n.length===0){process.stdout.write(t?`${b("No non-HTTP validators required by the current ruleset.")}
|
|
11
|
-
`:`No non-HTTP validators required by the current ruleset.
|
|
12
|
-
`);return}process.stdout.write(`${String(n.length)} non-HTTP validator type(s) referenced by the current ruleset:
|
|
13
|
-
|
|
14
|
-
`);for(const r of n){const s=t?E(r.displayName):r.displayName,a=`(${r.type}, ${String(r.ruleCount)} rule${r.ruleCount===1?"":"s"})`;process.stdout.write(`${s} ${t?b(a):a}
|
|
15
|
-
`),process.stdout.write(` ${r.summary}
|
|
16
|
-
`);const o=r.packageName?`install: npm add ${r.packageName}`:"no driver — bespoke implementation required";process.stdout.write(` ${t?b(o):o}
|
|
17
|
-
|
|
18
|
-
`)}},"printListValidators"),He=f(async(e,t,n)=>{const r=B(e,T);!n&&D(r)&&(L(`Detected existing ${T} — refusing to overwrite. Delete it first to re-init.`),process.exit(1)),V(n?"[dry-run] Previewing init — no files will be written.":"Scanning workspace to seed baseline…");const s=ne("scanning");let a;try{a=await X([e],t)}finally{s.stop()}if(n){V(`[dry-run] Would create ${T} with ${String(a.length)} finding(s).`);return}const o=re(a,r,e,{replace:!0});q(`Wrote ${T} (${String(o)} findings).`),Z("Commit it. Use `vis secrets --baseline .secrets-baseline.json` in CI. Add path patterns to .gitignore to exclude directories from scanning.")},"runInit"),Ee=f((e,t,n)=>{const r=t??{},s=f(g=>g?j(n,g):void 0,"resolvePath"),a=f((g,v)=>{const h=W(g);return h.length>0?h:v},"pickList"),o=a(e.enableRule,r.rules?.enable),c=a(e.excludeRule,r.rules?.exclude),i=a(e.includeRule,r.rules?.include),l=a(e.exclude,r.walk?.excludePatterns),d=W(e.excludeFrom).map(g=>j(n,g)),u=d.length>0?d:r.walk?.excludeFromFiles?.map(g=>j(n,g)),S=s(e.baseline)??s(r.baseline),w=s(e.config)??s(r.config?.path),p=Pe(e.minConfidence??r.config?.minConfidence);return{baseline:S,concurrency:e.concurrency,config:{extendBundled:e.noExtendBundled?!1:r.config?.extendBundled,inline:r.config?.inline,minConfidence:p,onlyVerified:e.onlyVerified??r.config?.onlyVerified??!1,path:w,validate:e.validate??r.config?.validate??!1},redact:e.redact??r.redact,rules:{enable:o,exclude:c,include:i},verbose:e.verbose??!1,walk:{excludeFromFiles:u,excludePatterns:l,gitignore:e.noGitignore?!1:r.walk?.gitignore??!0,includeHidden:e.includeHidden??r.walk?.includeHidden,maxFileSize:e.maxSize??r.walk?.maxFileSize}}},"resolveScanOptions"),Ve=f(e=>{process.stderr.write(`${b("baseline diff: ")}${Le(`+${String(e.fresh.length)} new`)} · ${E(`${String(e.surviving.length)} unchanged`)} · ${b(`-${String(e.resolved.length)} resolved`)}
|
|
19
|
-
`)},"printDiff"),ze=f(async(e,t,n)=>{if(e.staged)return P(n)||(M("--staged requires a git working tree, and none was detected."),process.exit(2)),{files:Ae(n)};if(e.since)return P(n)||(M("--since requires a git working tree, and none was detected."),process.exit(2)),{files:J(n,e.since)};if(e.affected){if(!P(n))return L("--affected requires git; falling back to full scan"),{paths:t&&t.length>0?t.map(s=>j(n,s)):[n]};const r=process.env.VIS_BASE??"HEAD~1";return{files:J(n,r)}}return{paths:t&&t.length>0?t.map(r=>j(n,r)):[n]}},"chooseScanPaths"),Ue=f((e,t,n,r,s,a)=>{switch(t){case"json":{const o=e.map(c=>O(c,n));process.stdout.write(`${JSON.stringify(o,null,2)}
|
|
20
|
-
`);break}case"sarif":{process.stdout.write(`${Me(e,s,n,a)}
|
|
21
|
-
`);break}default:process.stdout.write(`${Fe(e,n,r)}
|
|
22
|
-
`)}},"emitFindings"),Ze=f(async({argument:e,options:t,visConfig:n,workspaceRoot:r})=>{const s=t,a=e,o=r??process.cwd(),c=!s.quiet&&process.stdout.isTTY,i=n?.secrets,l=Ee(s,i,o),d="0.0.0-alpha";if(s.listRules){await _e(l,c);return}if(s.listValidators){await De(l,c);return}if(s.init){await He(o,l,s.dryRun??!1);return}const u=await ze(s,a??[],o);if(u.files?.length===0){s.quiet||q("No files to scan.");return}const S=!s.quiet&&!["json","sarif"].includes(s.format??"text")?ne("scanning for secrets"):{stop:f(()=>{},"stop"),update:f(()=>{},"update")};let w;try{w=u.files===void 0?await X(u.paths??[o],l):await ge(u.files,l)}catch($){S.stop(),M(`secret scan failed: ${$ instanceof Error?$.message:String($)}`),process.exit(2)}finally{S.stop()}if(s.verbose){const $=await me(l);if($.length>0){L(`${String($.length)} rule(s) skipped due to invalid regex. First few:`);for(const R of $.slice(0,5))process.stderr.write(` - ${R.ruleId}: ${R.reason}
|
|
23
|
-
`)}}const p=l.baseline??B(o,T),g=!s.quiet&&D(p);if(s.updateBaseline){const $=re(w,p,o,{replace:s.replaceBaseline});q(`Baseline updated: ${H(o,p)||p} now contains ${String($)} entries.`);return}const v=Ne(s.format),h=v==="sarif"?await Q(l).catch(()=>[]):[];Ue(w,v,o,c,d,h),v==="text"&&g&&Ve(ve(w,p,o)),w.length>0&&(s.quiet||(L(`${String(w.length)} potential secret(s) found`),Z("Suppress individual lines with `gitleaks:allow` / `secret-scanner:allow`, or run `vis secrets --update-baseline`.")),process.exit(1)),s.quiet||q("No secrets detected.")},"execute");export{Ze as default};
|
|
1
|
+
import{createRequire as _}from"node:module";import{b as y}from"./orchestrator.js";const m=_(import.meta.url),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,g=n=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[o,i]=r.versions.node.split(".").map(Number);if(o>22||o===22&&i>=3||o===20&&i>=16)return r.getBuiltinModule(n)}return m(n)},{appendFileSync:f}=g("node:fs"),B=async({logger:n,options:o,workspaceRoot:i})=>{const l=i??process.cwd(),s=await y({cwd:l,skipRegistryLookup:!0}),{printConfigIfRequested:u}=await import("./print-config.js");if(u(o,s,n))return;const t=s.plan.releases.length===0?"nothing":s.channel?.mode==="version-pr"?"version-pr":"publish",a=s.plan.releases.map(e=>e.name),p={channel:s.channel?.tag,mode:t,packages:a,plan:s.plan.releases.map(e=>({isCascadeBump:e.isCascadeBump,isDependencyBump:e.isDependencyBump,isGroupBump:e.isGroupBump,name:e.name,newVersion:e.newVersion,oldVersion:e.oldVersion,type:e.type})),prerelease:s.channel?.prerelease,warnings:s.plan.warnings};process.stdout.write(`${JSON.stringify(p,null,2)}
|
|
2
|
+
`);const c=process.env.GITHUB_OUTPUT;if(c){const e=[`mode=${t}`,`packages=${a.join(",")}`,`json<<__VIS_RELEASE_EOF__
|
|
3
|
+
${JSON.stringify(p)}
|
|
4
|
+
__VIS_RELEASE_EOF__`];try{f(c,`${e.join(`
|
|
5
|
+
`)}
|
|
6
|
+
`)}catch(d){n.warn(`Could not write $GITHUB_OUTPUT: ${d.message}`)}}};export{B as default};
|
|
@@ -1,5 +1 @@
|
|
|
1
|
-
|
|
2
|
-
`)?"crlf":"lf","detectLineEnding"),z=new Set(["auto","crlf","lf"]),G=a(e=>{if(e===void 0||e==="")return"auto";if(z.has(e))return e;O(`--line-ending must be one of: auto, lf, crlf (got "${e}")`),process.exit(2)},"validateLineEnding"),V=a((e,t,o)=>t.length===0?e:e.filter(i=>{const r=P(o,i),n=B(i);return!t.some(s=>{const l=s.includes("/")?r:n;return F(s,l)})}),"filterByIgnore"),H=a((e,t)=>{if(t.length===0)return e;const o={},i=new Set;for(const r of t)Object.hasOwn(e,r)&&(o[r]=e[r],i.add(r));for(const r of Object.keys(e))i.has(r)||(o[r]=e[r]);return o},"applySortOrder"),K=a((e,t,o)=>{if(o.length===0)return e;const i={...e};for(const r of o)Object.hasOwn(t,r)&&(i[r]=t[r]);return i},"restoreUnsortedSections"),Q=a((e,t)=>{const o=t.indent??D(e),i=t.lineEnding==="auto"?W(e):t.lineEnding,r=C(e,{pretty:!1,sortScripts:t.sortScripts});let n=JSON.parse(r);if(t.unsorted.length>0){const l=JSON.parse(e);n=K(n,l,t.unsorted)}n=H(n,t.sortOrder);let s=JSON.stringify(n,null,o);return t.finalNewline&&(s+=`
|
|
3
|
-
`),i==="crlf"&&(s=s.replaceAll(`
|
|
4
|
-
`,`\r
|
|
5
|
-
`)),s},"sortContents"),ie=a(async({options:e,visConfig:t,workspaceRoot:o})=>{const i=o??process.cwd(),r=t?.sortPackageJson,n=e.check||!1,s={finalNewline:e.finalNewline??r?.finalNewline??!0,ignore:[...j(e.ignore),...r?.ignore??[]],indent:U(e.indent??r?.indent),lineEnding:G(e.lineEnding??r?.lineEnding),sortOrder:[...j(e.sortOrder),...r?.sortOrder??[]],sortScripts:e.sortScripts||r?.sortScripts||!1,unsorted:[...j(e.unsorted),...r?.unsorted??[]]},l=R(i),g=V(l,s.ignore,i);if(g.length===0){y(l.length===0?"No package.json files found.":"All package.json files were excluded by --ignore.");return}let f=0,d=0,p=0;for(const c of g)try{const m=v(c);let S;try{S=Q(m,s)}catch(_){O(`${c}: ${b(_)}`),p++;continue}if(m===S){d++;continue}f++,n?T(`${c} is not sorted`):(J(c,S,"utf8"),q(`Sorted ${c}`))}catch(m){O(`${c}: ${b(m)}`),p++}if(n)f>0?(y(`${f} file${f===1?"":"s"} not sorted, ${d} already sorted`),process.exitCode=1):y(`All ${d} package.json file${d===1?" is":"s are"} sorted`);else{const c=[];f>0&&c.push(`sorted ${f} file${f===1?"":"s"}`),d>0&&c.push(`${d} already sorted`),p>0&&c.push(`${p} error${p===1?"":"s"}`),y(c.join(", "))}p>0&&(process.exitCode=1)},"execute");export{ie as default};
|
|
1
|
+
import{b as f}from"./orchestrator.js";import{createShellRunner as g}from"./shell-runner.js";const p=async({logger:r,options:n,workspaceRoot:l})=>{const t=l??process.cwd(),i=g(),s=await f({cwd:t}),e=n.branch??s.config.versionPr?.branch??"vis-release/version-packages",o=n.base??s.config.baseBranch??"main";r.info(`Rebasing ${e} onto ${o}...`);const a=await i.run("git",["fetch","origin",`${e}:${e}`,o],{cwd:t,silent:!0});if(a.exitCode!==0){r.info(`No remote branch ${e} to rebase (${a.stderr.trim()||"fetch failed"}). Skipping.`);return}const c=await i.run("git",["switch",e],{cwd:t,silent:!0});if(c.exitCode!==0){r.error(`Could not switch to ${e}: ${c.stderr.trim()}`),process.exitCode=1;return}if((await i.run("git",["rebase",`origin/${o}`],{cwd:t,silent:!0})).exitCode!==0){await i.run("git",["rebase","--abort"],{cwd:t,silent:!0}),r.error("Rebase produced conflicts; aborting. Resolve manually, or let the next `vis release ci release` recompute the version PR from scratch."),process.exitCode=1;return}const u=await i.run("git",["rev-list","--count",`origin/${e}..${e}`],{cwd:t,silent:!0});if(u.exitCode===0&&u.stdout.trim()==="0"){r.info(`${e} is already up to date with ${o}. Nothing to push.`);return}const d=await i.run("git",["push","--force-with-lease","origin",`${e}:${e}`],{cwd:t,silent:!0});if(d.exitCode!==0){r.error(`Failed to force-push ${e}: ${d.stderr.trim()}`),process.exitCode=1;return}r.info(`Force-pushed ${e} after rebasing onto ${o}.`)};export{p as default};
|
|
@@ -1,27 +1,42 @@
|
|
|
1
|
-
|
|
1
|
+
const i=`
|
|
2
|
+
🔧 vis release CI setup
|
|
2
3
|
|
|
3
|
-
|
|
4
|
+
1. Workflow permissions
|
|
5
|
+
Add to .github/workflows/vis-release.yml:
|
|
6
|
+
permissions:
|
|
7
|
+
contents: write
|
|
8
|
+
pull-requests: write
|
|
9
|
+
id-token: write # required for OIDC trusted publishing on npm
|
|
4
10
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
11
|
+
2. Secrets
|
|
12
|
+
Required:
|
|
13
|
+
- VIS_GH_TOKEN — PAT or GitHub App token. Used to force-push the
|
|
14
|
+
version-PR branch and create/edit the version PR. The default
|
|
15
|
+
\${{ github.token }} is anti-recursion-locked and cannot trigger
|
|
16
|
+
downstream workflows on the version-PR.
|
|
17
|
+
- GH_TOKEN — \${{ github.token }} works for read-only / commenting.
|
|
18
|
+
Optional:
|
|
19
|
+
- NPM_TOKEN — fallback when OIDC is not available. Trusted Publishing
|
|
20
|
+
(id-token: write) is preferred.
|
|
8
21
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
`)},info({message:a}){i(C(a))},patternEnd({patternId:a,status:c}){const l=n.get(a)??a;i(`${o(c)} ${l}`)},patternStart({patternId:a}){const c=n.get(a)??a;i(`${Y(">")} ${c}`)},start({patterns:a}){if(a.length===0){i(C("No staged files matched any pattern."));return}const c=new Set(a.flatMap(l=>l.files)).size;i(`${Y(">")} Running staged tasks on ${c} file${c===1?"":"s"} across ${a.length} pattern${a.length===1?"":"s"}`);for(const l of a){n.set(l.id,l.title);for(const u of l.commands)s.set(u.id,u.title)}},stop(){},warn({message:a}){i(pe(a))}}},"createPlainRenderer");var Ft=Object.defineProperty,Nt=f((e,t)=>Ft(e,"name",{value:t,configurable:!0}),"t");const Gt=Nt(async e=>{const{env:t}=process;if(e.debug===!0||e.quiet===!0||t.NODE_ENV==="test"||t.TERM==="dumb"||t.CI!==void 0||!process.stderr.isTTY)return ge({quiet:e.quiet,verbose:e.verbose});try{return Ot({verbose:e.verbose})}catch{return ge({quiet:e.quiet,verbose:e.verbose})}},"pickRenderer");var _t=Object.defineProperty,G=f((e,t)=>_t(e,"name",{value:t,configurable:!0}),"a");const Q=G(e=>typeof e=="object"&&e!==null&&typeof e.title=="string"&&typeof e.task=="function","isCustomTask"),Dt=G(async e=>{let t=0,r=0;const n=G(()=>(t+=1,`pattern-${t}`),"nextPatternId"),s=G(()=>(r+=1,`cmd-${r}`),"nextCommandId"),i=G(async(a,c,l)=>{if(typeof a=="string"){l.push({command:a,files:c,id:s(),source:"string",title:a});return}if(Array.isArray(a)){for(const u of a)await i(u,c,l);return}if(typeof a=="function"){const u=await a([...c]);if(typeof u=="string"){l.push({command:u,files:c,id:s(),source:"function",title:u});return}if(Array.isArray(u)){for(const d of u)if(typeof d=="string")l.push({command:d,files:c,id:s(),source:"function",title:d});else if(Q(d))l.push({files:c,id:s(),run:d.task,source:"custom",title:d.title});else throw new b("Task function returned an array with an unsupported entry — expected strings or { title, task }.");return}if(Q(u)){l.push({files:c,id:s(),run:u.task,source:"custom",title:u.title});return}throw new b("Task function returned an unsupported value — expected string, string[], or { title, task }.")}if(Q(a)){l.push({files:c,id:s(),run:a.task,source:"custom",title:a.title});return}throw new b("Unsupported task value — expected string, string[], function, or { title, task }.")},"expandTask"),o=[];for(const[a,c]of Object.entries(e.config)){const l=Et(a,e.files,e.cwd,{caseInsensitive:e.caseInsensitive===!0});if(l.length===0)continue;const u=e.relative?l.map(p=>D(e.cwd,p)):l,d=[];await i(c,u,d),d.length!==0&&o.push({commands:d,files:u,id:n(),pattern:a,title:`${a} — ${l.length} file${l.length===1?"":"s"}`})}return o},"buildTaskGraph");var Ht=Object.defineProperty,z=f((e,t)=>Ht(e,"name",{value:t,configurable:!0}),"d$1");const Lt=z(e=>{const t=[];let r="",n=!1,s=!1;for(let i=0;i<e.length;i+=1){const o=e[i];if(o===void 0)break;if(o==="\\"&&!n&&i+1<e.length){const a=e[i+1];if(a!==void 0){s&&a!=='"'&&a!=="\\"&&(r+=o),r+=a,i+=1;continue}}if(o==='"'&&!n){s=!s;continue}if(o==="'"&&!s){n=!n;continue}if(!n&&!s&&/\s/.test(o)){r.length>0&&(t.push(r),r="");continue}r+=o}if(n||s)throw new b(`Unterminated ${n?"single":"double"} quote in command: ${e}`);return r.length>0&&t.push(r),t},"parseCommandString"),Ie=process.platform==="win32"?28e3:131072,Bt=z((e,t,r)=>{const n=[];let s=[],i=t;const o=r<=0?Ie:r;for(const a of e){const c=Buffer.byteLength(a)+1;s.length>0&&i+c>o&&(n.push(s),s=[],i=t),s.push(a),i+=c}return s.length>0&&n.push(s),n},"chunkFiles"),Ut=z(async(e,t,r)=>{const n=Lt(e);if(n.length===0)throw new M(e,"Empty command for staged task.");const[s,...i]=n;if(s===void 0)throw new M(e,"Empty command for staged task.");const o=Buffer.byteLength(s)+i.reduce((u,d)=>u+Buffer.byteLength(d)+1,0),a=Bt(t,o,r.maxArgLength??Ie),c=Date.now(),l=[];for(const u of a){if(r.signal?.aborted===!0)throw new M(e,"Task aborted by earlier failure.");const d=await ye(s,[...i,...u],{cancelSignal:r.signal,cwd:r.cwd,env:qt(r.env),killSignal:r.killSignal??"SIGTERM",reject:!1,stderr:"pipe",stdout:"pipe"}),p=typeof d.stdout=="string"?d.stdout:"",w=typeof d.stderr=="string"?d.stderr:"",h=[p,w].filter(m=>m.length>0).join(`
|
|
17
|
-
`);if(h.length>0&&l.push(h),d.isCanceled||d.isTerminated||typeof d.exitCode!="number"){const m=d.isCanceled?"Task aborted by earlier failure.":d.isTerminated?`Task killed by signal ${d.signal??"(unknown)"}.`:h.trim()||"Task exited without a numeric status code.";throw new M(e,m)}if(d.exitCode!==0)throw new M(e,h.trim()||`Exit code ${d.exitCode} from ${s}`)}return{durationMs:Date.now()-c,output:l.join(`
|
|
18
|
-
`)}},"execCommand"),qt=z(e=>{const t={...process.env};return process.stderr.isTTY&&t.FORCE_COLOR===void 0&&t.NO_COLOR===void 0&&(t.FORCE_COLOR="1"),e?{...t,...e}:t},"buildTaskEnv");var Vt=Object.defineProperty,j=f((e,t)=>Vt(e,"name",{value:t,configurable:!0}),"o");const zt=j(async(e,t,r)=>{const n=Kt(r.concurrent,e.length),s=[],i=new AbortController;let o=!1,a=0;const c=j(()=>{o||(o=!0,r.continueOnError||i.abort())},"cancel");r.externalSignal&&(r.externalSignal.aborted?c():r.externalSignal.addEventListener("abort",()=>{c()},{once:!0}));const l=j(h=>{for(const m of h.commands)t.commandEnd({commandId:m.id,durationMs:0,patternId:h.id,status:"skipped"})},"emitSkippedCommands"),u=j(async h=>{if(o){l(h),t.patternEnd({patternId:h.id,status:"skipped"});return}t.patternStart({patternId:h.id});let m="success";for(const v of h.commands){if(o){t.commandEnd({commandId:v.id,durationMs:0,patternId:h.id,status:"skipped"}),m=m==="success"?"skipped":m;continue}t.commandStart({commandId:v.id,patternId:h.id});const y=await Wt(v,r,i.signal),T=y.status==="failed"&&i.signal.aborted?{...y,status:"skipped"}:y;if(t.commandEnd({commandId:v.id,durationMs:T.durationMs,error:T.error,output:T.output,patternId:h.id,status:T.status}),T.status==="failed"){s.push(v.title),m="failed",c();break}if(T.status==="skipped"){m=m==="success"?"skipped":m;break}}t.patternEnd({patternId:h.id,status:m})},"runOne"),d=j(async()=>{for(;a<e.length;){const h=e[a];a+=1,h&&await u(h)}},"pickNext"),p=[];for(let h=0;h<Math.min(n,e.length);h+=1)p.push(d());await Promise.all(p);const w=r.externalSignal?.aborted===!0;return{failedCommands:s,success:s.length===0&&!w}},"runTasks"),Wt=j(async(e,t,r)=>{const n=Date.now();try{if(e.source==="custom"&&e.run)return await e.run([...e.files]),{durationMs:Date.now()-n,status:"success"};if(e.command){const s=await Ut(e.command,e.files,{cwd:t.cwd,killSignal:t.killSignal,maxArgLength:t.maxArgLength,signal:r});return{durationMs:s.durationMs,output:t.verbose?s.output:void 0,status:"success"}}return{durationMs:Date.now()-n,error:new M(e.title,"Command has no invocation target."),status:"failed"}}catch(s){const i=s instanceof Error?s:new Error(String(s));return{durationMs:Date.now()-n,error:i,output:i instanceof M?i.message:void 0,status:"failed"}}},"runCommand"),Kt=j((e,t)=>{if(e===!1)return 1;if(e===!0){const n=Math.max(1,typeof se=="function"?se():4);return Math.min(Math.max(1,t),n)}const r=Math.floor(e);return r>0?r:1},"concurrencyLimit");var Yt=Object.defineProperty,Z=f((e,t)=>Yt(e,"name",{value:t,configurable:!0}),"u");const Jt=!0,Qt=Z(e=>{try{return!je(e)}catch{return!1}},"detectCaseInsensitive"),Xt=Z(async(e={})=>{const t=e.cwd??process.cwd(),r=await Gt(e),n=await tt(e);typeof n!="function"&&ie(n);const s=new Ct({...e,cwd:t}),i=new AbortController;let o=!1;const a=Z(d=>{if(o){process.removeListener("SIGINT",a),process.removeListener("SIGTERM",a),process.kill(process.pid,d);return}o=!0,r.warn({message:`Received ${d} — cancelling staged tasks and restoring state. Press Ctrl+C again to abort.`}),i.abort()},"onInterrupt");process.on("SIGINT",a),process.on("SIGTERM",a);let c={failedCommands:[],ranTasks:!1,success:!0},l=!1,u=!1;try{await s.prepare(),l=!0;for(const y of s.warnings)r.warn({message:y});if(s.stagedFiles.length===0)return e.allowEmpty!==!0&&r.info({message:"No staged files found."}),u=!0,{failedCommands:[],ranTasks:!1,success:!0};const d=Qt(t),p=At(s.stagedFiles,e.ignore,t,{caseInsensitive:d});if(p.length===0&&s.stagedFiles.length>0)return r.info({message:"Every staged file was excluded by the `ignore` list."}),u=!0,{failedCommands:[],ranTasks:!1,success:!0};const w=typeof n=="function"?ie(await n([...p])):n,h=await Dt({caseInsensitive:d,config:w,cwd:t,files:p,relative:e.relative});if(r.start({patterns:h}),h.length===0)return r.info({message:"No staged files matched any pattern."}),u=!0,{failedCommands:[],ranTasks:!1,success:!0};const{failedCommands:m,success:v}=await zt(h,r,{concurrent:e.concurrent??Jt,continueOnError:e.continueOnError===!0,cwd:t,externalSignal:i.signal,killSignal:e.killSignal,maxArgLength:e.maxArgLength,verbose:e.verbose});if(c={failedCommands:m,ranTasks:!0,success:v},v){if(e.diff===void 0&&(await s.applyModifications({autoStage:e.autoStage===!0}),e.failOnChanges===!0&&s.indexTreeChanged()&&(r.warn({message:"Tasks modified staged content — failing because --fail-on-changes is set."}),c={failedCommands:[...m],ranTasks:!0,success:!1}),e.allowEmpty!==!0&&s.postTaskIndexMatchesHead()))throw new Ue("All staged changes were reverted by tasks. Re-stage changes or rerun with --allow-empty.")}else if(e.revert===!0)r.info({message:"Reverting working tree from backup stash."}),await s.revert();else{const y=s.recoveryHint();y&&r.warn({message:y})}return await s.restoreUnstagedChanges(),u=c.success,c}catch(d){const p=d instanceof Error?d.message:String(d),w=d instanceof Error?d:new Error(p);if(r.error({error:w,message:p}),d instanceof O)return{failedCommands:c.failedCommands,ranTasks:c.ranTasks,success:!1};throw d}finally{if(process.removeListener("SIGINT",a),process.removeListener("SIGTERM",a),l)try{await s.cleanup(u)}catch(d){r.error({error:d,message:"Cleanup failed."})}await r.stop()}},"runStaged");var Zt=Object.defineProperty,er=f((e,t)=>Zt(e,"name",{value:t,configurable:!0}),"n");const tr="VIS_STAGED_CONCURRENT",me=er(e=>{const t=e.trim();if(t==="true"||t==="")return!0;if(t==="false")return!1;const r=Number(t);return Number.isNaN(r)?!0:r},"parseConcurrent");var rr=Object.defineProperty,L=f((e,t)=>rr(e,"name",{value:t,configurable:!0}),"d");const sr=L((e,t)=>{const r={};t!==void 0&&(r.config=t);const n=L(E=>e[E]===void 0?void 0:!!e[E],"readBool"),s=L(E=>{const W=e[E];return typeof W=="string"&&W.length>0?W:void 0},"readString"),i=n("allow-empty");i!==void 0&&(r.allowEmpty=i);const o=n("auto-stage");o!==void 0&&(r.autoStage=o);const a=n("continue-on-error");a!==void 0&&(r.continueOnError=a);const c=n("debug");c!==void 0&&(r.debug=c);const l=n("fail-on-changes");l!==void 0&&(r.failOnChanges=l);const u=n("hide-partially-staged");u!==void 0&&(r.hidePartiallyStaged=u);const d=n("hide-unstaged");d!==void 0&&(r.hideUnstaged=d);const p=n("quiet");p!==void 0&&(r.quiet=p);const w=n("relative");w!==void 0&&(r.relative=w);const h=n("revert");h!==void 0&&(r.revert=h);const m=n("stash");m!==void 0&&(r.stash=m);const v=n("verbose");v!==void 0&&(r.verbose=v);const y=s("cwd");y!==void 0&&(r.cwd=y);const T=s("diff");T!==void 0&&(r.diff=T);const te=s("diff-filter");if(te!==void 0&&(r.diffFilter=te),n("force-kill")===!0&&(r.killSignal="SIGKILL"),e.concurrent===void 0){const E=process.env[tr];E!==void 0&&(r.concurrent=me(E.trim()))}else r.concurrent=me(String(e.concurrent));return r},"buildRunOptions"),pr=L(async({options:e,visConfig:t})=>{const r=(t??{}).staged;if(!r)throw new Error(`No "staged" config found in vis.config.ts. Add one:
|
|
22
|
+
3. Trusted Publishing on npm
|
|
23
|
+
For each published package:
|
|
24
|
+
a. https://npmjs.com/package/<name>/access → Publishing access
|
|
25
|
+
b. Add a Trusted Publisher with provider=GitHub Actions
|
|
26
|
+
c. Repository: visulima/visulima
|
|
27
|
+
d. Workflow filename: vis-release.yml
|
|
28
|
+
e. Environment name: (leave blank unless you use one)
|
|
19
29
|
|
|
20
|
-
|
|
21
|
-
|
|
30
|
+
4. Concurrency group (recommended)
|
|
31
|
+
concurrency:
|
|
32
|
+
group: vis-release-\${{ github.ref }}
|
|
33
|
+
cancel-in-progress: false
|
|
22
34
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
35
|
+
5. Husky pre-commit gate (optional)
|
|
36
|
+
Add to .husky/pre-commit:
|
|
37
|
+
vis release check --hook pre-commit --no-fail
|
|
38
|
+
(Or run \`vis release init\` and confirm the prompt — it'll auto-wire
|
|
39
|
+
the hook if you say yes.)
|
|
26
40
|
|
|
27
|
-
|
|
41
|
+
📚 RFC: packages/tooling/vis/rfc/design-release-manager.md (§16)
|
|
42
|
+
`,o=async({logger:e})=>{e.info(i)};export{o as default};
|
|
@@ -1 +1,8 @@
|
|
|
1
|
-
|
|
1
|
+
import{b as g}from"./orchestrator.js";import{detectRemoteProvider as h,createRemoteClient as $}from"./detect2.js";import{createShellRunner as w}from"./shell-runner.js";import{runSnapshot as R}from"./snapshot.js";const y=(r,o)=>{if(r.length===0)return"_No packages were affected by this PR._";const n=["### 📦 Preview Packages",""];for(const e of r){const t=`${e.name}@${e.version}`;n.push(`- \`${e.name}\` → \`${e.version}\``),o?n.push(` \`\`\`sh
|
|
2
|
+
npm i ${t} --registry ${o}
|
|
3
|
+
\`\`\``):n.push(` \`\`\`sh
|
|
4
|
+
npm i ${t}
|
|
5
|
+
\`\`\``)}return n.join(`
|
|
6
|
+
`)},S=async({logger:r,options:o,workspaceRoot:n})=>{const e=n??process.cwd(),t=w(),l=await h(e,t),a=$(l),s=a.detectPullRequestNumber(process.env),p=o.tag??(s?`pr-${s}`:void 0);if(!p){r.error("Could not determine snapshot tag. Pass --tag or run in a PR context (GITHUB_REF=refs/pull/<n>/merge)."),process.exitCode=1;return}if(o.onClose){await C(e,t,a,s,r);return}let c,u;try{c=await g({cwd:e});const{printConfigIfRequested:i}=await import("./print-config.js");if(i(o,c,r))return;u=await R({context:c,runner:t,tag:p})}catch(i){r.error(`Snapshot failed: ${i.message}`),process.exitCode=1;return}if(r.info(`Snapshotted ${u.published.length} package(s) at version ${u.snapshotVersion} → tag "${u.tag}"`),!s)return;const d=await a.detectRepoSlug(e,t);if(!d){r.warn("Could not detect repo slug — skipping sticky PR comment.");return}const m="<!-- vis-release-snapshot-comment -->",f=`${m}
|
|
7
|
+
|
|
8
|
+
${y(u.published,c.config.snapshot?.registry)}`;try{const i=await a.upsertStickyComment(t,{body:f,cwd:e,issueNumber:s,marker:m,repo:d});i&&r.info(`${i.created?"Posted":"Updated"} snapshot comment on PR #${s}.`)}catch(i){r.warn(`upsertStickyComment failed (publish already succeeded): ${i.message}`)}},C=async(r,o,n,e,t)=>{if(!e){t.error("PR-close cleanup requires a PR context."),process.exitCode=1;return}const l=await n.detectRepoSlug(r,o);if(!l){t.warn("Could not detect repo slug — skipping cleanup.");return}const a=await o.run("gh",["api",`repos/${l}/pulls/${e}/commits`,"--paginate"],{cwd:r,silent:!0});if(a.exitCode!==0){t.warn(`gh api failed: ${a.stderr}`);return}let s;try{s=JSON.parse(a.stdout)}catch{t.warn("Could not parse gh api output.");return}const p=[`pr-${e}`];for(const c of s)p.push(c.sha,c.sha.slice(0,7));t.info(`Cleanup intent for PR #${e}: ${p.length} tag pattern(s) across ${s.length} commit(s)`),t.info("Default backend (pkg-pr-new) auto-cleans by TTL — no DELETE issued. Implement a custom backend's delete endpoint to enable real cleanup.")};export{S as default};
|