@visulima/vis 7.1.0-next.5 → 7.1.0-next.7
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 +80 -0
- package/README.md +1 -1
- package/bin/route.mjs +154 -27
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +227 -12
- package/dist/packem_chunks/CONFIG_FILES.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/catalog.js +1 -1
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +57 -57
- package/dist/packem_chunks/detect.js +4 -4
- package/dist/packem_chunks/dispatch.js +1 -1
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +1 -1
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler22.js +1 -1
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +1 -1
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +2 -2
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler32.js +1 -1
- package/dist/packem_chunks/handler4.js +1 -1
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler50.js +1 -1
- package/dist/packem_chunks/handler51.js +1 -1
- package/dist/packem_chunks/handler52.js +1 -1
- package/dist/packem_chunks/handler53.js +1 -1
- package/dist/packem_chunks/handler54.js +1 -1
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler56.js +1 -1
- package/dist/packem_chunks/handler58.js +1 -1
- package/dist/packem_chunks/handler59.js +1 -1
- package/dist/packem_chunks/handler6.js +1 -1
- package/dist/packem_chunks/handler60.js +1 -1
- package/dist/packem_chunks/handler61.js +22 -3
- package/dist/packem_chunks/handler62.js +2 -22
- package/dist/packem_chunks/handler63.js +6 -2
- package/dist/packem_chunks/handler64.js +8 -61
- package/dist/packem_chunks/handler65.js +2 -6
- package/dist/packem_chunks/handler66.js +12 -8
- package/dist/packem_chunks/handler67.js +5 -2
- package/dist/packem_chunks/handler68.js +25 -12
- package/dist/packem_chunks/handler69.js +50 -25
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +153 -50
- package/dist/packem_chunks/handler71.js +1 -1
- package/dist/packem_chunks/handler72.js +1 -1
- package/dist/packem_chunks/handler73.js +1 -1
- package/dist/packem_chunks/handler74.js +1 -1
- package/dist/packem_chunks/handler75.js +1 -1
- package/dist/packem_chunks/handler76.js +1 -1
- package/dist/packem_chunks/handler77.js +1 -1
- package/dist/packem_chunks/handler78.js +1 -1
- package/dist/packem_chunks/handler79.js +64 -64
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/index7.js +1 -1
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +1 -1
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/ts-loader.js +2 -2
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_chunks/workflow-templates.js +29 -32
- package/dist/packem_shared/{ReleaseClient-C2xIJ6LK.js → ReleaseClient-CqGLb7S4.js} +1 -1
- package/dist/packem_shared/{advisories-DoJg1aO9.js → advisories-CyXUdibZ.js} +1 -1
- package/dist/packem_shared/{affected-selection-vthRDY8k.js → affected-selection-CJnDzyIK.js} +1 -1
- package/dist/packem_shared/affected-shas-CJLirD2O.js +1 -0
- package/dist/packem_shared/{ai-analysis-BQXQSrpM.js → ai-analysis-DHlzow2O.js} +1 -1
- package/dist/packem_shared/{ai-cache-_pgEsibl.js → ai-cache-D-BSLcuJ.js} +1 -1
- package/dist/packem_shared/{ai-fix-Bc5SFN7s.js → ai-fix-CyExJC_c.js} +1 -1
- package/dist/packem_shared/{augment-BSeqaai8.js → augment-Ub6PCwbh.js} +1 -1
- package/dist/packem_shared/{bin-N12LFeEP.js → bin-BaReRSyo.js} +1 -1
- package/dist/packem_shared/{build-scripts-Dff0s5AH.js → build-scripts-BeJkep8z.js} +1 -1
- package/dist/packem_shared/ci-commands-4W9d2six.js +1 -0
- package/dist/packem_shared/{command-runtime-DG49t2MT.js → command-runtime-DdnpiUmN.js} +1 -1
- package/dist/packem_shared/{dependency-scan-DheQqeil.js → dependency-scan-CyByCwef.js} +1 -1
- package/dist/packem_shared/{detect-CknQIlyA.js → detect-xqoTANJb.js} +1 -1
- package/dist/packem_shared/{docker-w_1gOq50.js → docker-CJXAt5Au.js} +1 -1
- package/dist/packem_shared/{ecosystem-gate-BKRW_EF3.js → ecosystem-gate-DEnubRcS.js} +1 -1
- package/dist/packem_shared/{env-CGTN0BFz.js → env-NauRSSEC.js} +1 -1
- package/dist/packem_shared/{env-consistency-2UlhhMn5.js → env-consistency-Cl1Rg65z.js} +1 -1
- package/dist/packem_shared/{failure-log-DwZ4pNmp.js → failure-log-DwroazKs.js} +1 -1
- package/dist/packem_shared/glob-Cyk1H9ZL-BtN6Zzwg.js +1 -0
- package/dist/packem_shared/{index-CypvJE1G.js → index-BCEhCrLl.js} +1 -1
- package/dist/packem_shared/{index-DGll9r9W.js → index-OmE1O0Ys.js} +1 -1
- package/dist/packem_shared/{index-0dnGN3GP.js → index-zq6Ehql6.js} +1 -1
- package/dist/packem_shared/{isAccessibleSync-DYKTrrvc-CBsMZhj-.js → isAccessibleSync-DYKTrrvc-CKahNmLy.js} +1 -1
- package/dist/packem_shared/{lifecycle-B2m1OncV.js → lifecycle-Cn1mSP5f.js} +1 -1
- package/dist/packem_shared/{lockfile-DEWjBrlY.js → lockfile-Cx2Ny3um.js} +1 -1
- package/dist/packem_shared/{manifests-hpWznbs9.js → manifests-BEGTH1ZG.js} +1 -1
- package/dist/packem_shared/{min-release-age-Dy7mkYsY.js → min-release-age-DLAERxRt.js} +1 -1
- package/dist/packem_shared/{missing-package-json-SDyf6fjC.js → missing-package-json-w74qGfyh.js} +1 -1
- package/dist/packem_shared/{multi-eco-lockfiles-DDjCxn43.js → multi-eco-lockfiles-SATPXx6-.js} +1 -1
- package/dist/packem_shared/{native-config-sync-DlljvZ64.js → native-config-sync-DDFn6Zsf.js} +1 -1
- package/dist/packem_shared/{npmrc-CIvOb61L.js → npmrc-DONprxrc.js} +1 -1
- package/dist/packem_shared/{osv-C4Vn7VCy.js → osv-dvIA_vX3.js} +1 -1
- package/dist/packem_shared/{package-version-DteJxz6k.js → package-version-BOK3IncQ.js} +2 -2
- package/dist/packem_shared/{packument-BHB4BqzR.js → packument-B678kHJO.js} +1 -1
- package/dist/packem_shared/{pm-runner-BXRi4ZM9.js → pm-runner-CYsiSHYa.js} +1 -1
- package/dist/packem_shared/{project-name-filter-yTiFERfc.js → project-name-filter-CBEoY08a.js} +1 -1
- package/dist/packem_shared/{provenance-BLycrdW2.js → provenance-D4ioWGBq.js} +1 -1
- package/dist/packem_shared/publish-missing-DgPXeH9w.js +38 -0
- package/dist/packem_shared/reachable-DX8FPErP.js +1 -0
- package/dist/packem_shared/{registry-48vkYPJB.js → registry-ClmannRw.js} +2 -2
- package/dist/packem_shared/{registry-keys-DdqAOng1.js → registry-keys-CF45rOur.js} +1 -1
- package/dist/packem_shared/{removeSync-g1D5kONg-jOsRSIIv.js → removeSync-g1D5kONg-DcG75b0G.js} +1 -1
- package/dist/packem_shared/{renderToString-DR0zDUjh-AcCpRdMt.js → renderToString-DR0zDUjh-CBDmAXxb.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-BbIYCI43.js → resolve-explicit-C5-y-xEU.js} +1 -1
- package/dist/packem_shared/{resolve-runtime-D8rxuo3J.js → resolve-runtime-DBDozrmt.js} +1 -1
- package/dist/packem_shared/{run-file-D1mlOnd8.js → run-file-BKXvoVj2.js} +1 -1
- package/dist/packem_shared/{run-summary-utils-BIFZ0_Qf.js → run-summary-utils-75paIrLB.js} +1 -1
- package/dist/packem_shared/{runtime-check-B2u8WTUY.js → runtime-check-Yl8-Awkf.js} +1 -1
- package/dist/packem_shared/{s1ngularity-CTb560h1.js → s1ngularity-B2bqwE0C.js} +1 -1
- package/dist/packem_shared/{scaffold-files-CnWTGzav.js → scaffold-files-UiCBBCT5.js} +1 -1
- package/dist/packem_shared/{scan-progress-BEB4T6jo.js → scan-progress-Dws7Gif1.js} +1 -1
- package/dist/packem_shared/{selectors-DFzKNlk8.js → selectors-DZ4HDnlD.js} +1 -1
- package/dist/packem_shared/{signatures-CoRC1HW7.js → signatures-DNqgsRp7.js} +1 -1
- package/dist/packem_shared/{spinner-uH0pr4ln.js → spinner-BQ9mLz8X.js} +1 -1
- package/dist/packem_shared/{table-DL8yVcm3.js → table-D1CpySxU.js} +1 -1
- package/dist/packem_shared/{tabs-C1RRtWUi.js → tabs-BYtpIN5b.js} +1 -1
- package/dist/packem_shared/{target-options-rIthWS4M.js → target-options-CsevVc7U.js} +1 -1
- package/dist/packem_shared/{task-env-Cl4jNMCR.js → task-env-BftNOR00.js} +1 -1
- package/dist/packem_shared/{toolchain-BdYvWNPz.js → toolchain-BvluBdrw.js} +1 -1
- package/dist/packem_shared/{typosquats-D0yqKvP6.js → typosquats-XrArH9TO.js} +1 -1
- package/dist/packem_shared/{use-measured-height-Cq0aFDqE.js → use-measured-height-hHis1NaB.js} +1 -1
- package/dist/packem_shared/{verify-3WE9U_Bv.js → verify-Dic2G0nQ.js} +1 -1
- package/dist/packem_shared/{vis-update-app-B0FW7Sl_.js → vis-update-app-BNnbDZ--.js} +1 -1
- package/dist/packem_shared/{vis-user-error-Bdcaov20.js → vis-user-error-DhgW3DzD.js} +2 -2
- package/dist/packem_shared/{watch-C-9-PD2m.js → watch-BLHtUgfb.js} +1 -1
- package/dist/packem_shared/{watch-loop-B2vH6Ae0.js → watch-loop-Dh4GHUVS.js} +7 -7
- package/dist/release/index.js +1 -1
- package/dist/runtime/preload.js +1 -1
- package/index.d.ts +204 -213
- package/index.js +54 -54
- package/package.json +11 -10
- package/schemas/vis-config.schema.json +1419 -80
- package/dist/packem_shared/affected-shas-CycHU3nr.js +0 -1
- package/dist/packem_shared/glob-Cyk1H9ZL-DV-XWFct.js +0 -1
- package/dist/packem_shared/publish-missing-CZK1BpWt.js +0 -38
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{createRequire as v}from"node:module";let $;const x=
|
|
1
|
+
import{createRequire as v}from"node:module";let $;const x=u=>($??=v(import.meta.url))(u),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,O=u=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[t,e]=g.versions.node.split(".").map(Number);if(t>22||t===22&&e>=3||t===20&&e>=16)return g.getBuiltinModule(u)}return x(u)},{basename:P}=O("node:path"),w=u=>{const t=[];let e=0,s=!1,r=!1,a=-1;for(let i=0;i<u.length;i+=1){const n=u[i];if(s){r?r=!1:n==="\\"?r=!0:n==='"'&&(s=!1);continue}switch(n){case'"':{s=!0;break}case"[":case"{":{e===0&&(a=i),e+=1;break}case"]":case"}":{if(e-=1,e===0)try{const c=JSON.parse(u.slice(a,i+1));if(!Array.isArray(c))return;t.push(...c)}catch{return}break}default:if(e===0&&n!==void 0&&!/\s/.test(n))return}}return e===0&&a!==-1?t:void 0},k=u=>{const t=[],e=[];for(const r of u??[]){if(typeof r=="string"){t.push(r);continue}if(r.path){const a=r.label??r.name;t.push(a?`${r.path}#${a}`:r.path)}else if(r.linkUrl){const a=r.label??r.name??r.linkUrl;e.push(`- [${a}](${r.linkUrl})`)}}return{linkAppendix:e.length>0?`
|
|
2
2
|
|
|
3
3
|
### Additional links
|
|
4
4
|
|
|
5
5
|
${e.join(`
|
|
6
|
-
`)}`:"",paths:t}},C=(
|
|
7
|
-
${
|
|
8
|
-
${
|
|
6
|
+
`)}`:"",paths:t}},C=(u,t)=>{if(u===0)return w(t)?.filter(e=>typeof e.body=="string").map(e=>({author:e.user?.login,authorIsBot:e.user?.type==="Bot",body:e.body??"",id:e.id}))};class R{id="github";host;httpProxy;viewer;constructor(t={}){this.host=t.host,this.httpProxy=t.httpProxy}runOpts(t){if(!this.host&&!this.httpProxy)return{cwd:t,silent:!0};const e={...process.env};return this.host&&(e.GH_HOST=this.host),this.httpProxy&&(e.HTTPS_PROXY=this.httpProxy,e.HTTP_PROXY=this.httpProxy),{cwd:t,env:e,silent:!0}}async listRecentReleases(t,e){const s=Math.max(1,e.limit),r=e.tagPrefix?Math.min(100,s*4):s,a=await t.run("gh",["release","list","--repo",e.repo,"--limit",String(r),"--json","tagName,url,name"],this.runOpts(e.cwd));if(a.exitCode!==0)return[];let i;try{i=JSON.parse(a.stdout)}catch{return[]}const n=[];for(const c of i)if(!(typeof c.tagName!="string"||typeof c.url!="string")&&!(e.tagPrefix&&!c.tagName.startsWith(e.tagPrefix))&&!(e.excludeTag&&c.tagName===e.excludeTag)&&(n.push({name:c.name??c.tagName,tag:c.tagName,url:c.url}),n.length>=s))break;return n}async detectRepoSlug(t,e){const s=await e.run("gh",["repo","view","--json","nameWithOwner","-q",".nameWithOwner"],this.runOpts(t));if(s.exitCode===0)return s.stdout.trim()||void 0}detectPullRequestNumber(t){const e=t.GITHUB_REF;if(e){const r=/^refs\/pull\/(\d+)\/(?:merge|head)$/.exec(e);if(r?.[1])return Number.parseInt(r[1],10)}const s=t.PR_NUMBER??t.VIS_PR_NUMBER;if(s){const r=Number.parseInt(s,10);return Number.isNaN(r)?void 0:r}}async resolveViewer(t,e){return this.viewer??=t.run("gh",["api","graphql","-f","query=query{viewer{login}}","--jq",".data.viewer.login"],this.runOpts(e)).then(s=>s.exitCode===0&&s.stdout.trim()?s.stdout.trim():void 0),this.viewer}async upsertStickyComment(t,e){const s=await t.run("gh",["api",`repos/${e.repo}/issues/${e.issueNumber}/comments`,"--paginate"],this.runOpts(e.cwd)),r=C(s.exitCode,s.stdout);if(!r)return;const a=r.filter(d=>d.body.includes(e.marker)),i=a.length>0?await this.resolveViewer(t,e.cwd):void 0,n=i===void 0?void 0:a.find(d=>d.author===i||d.authorIsBot&&d.author===`${i}[bot]`),c=n&&e.merge?e.merge(n.body):e.body,o=c.includes(e.marker)?c:`${e.marker}
|
|
7
|
+
${c}`;if(n)return o===n.body?{created:!1,id:n.id}:(await t.run("gh",["api","-X","PATCH",`repos/${e.repo}/issues/comments/${n.id}`,"-f",`body=${o}`],this.runOpts(e.cwd))).exitCode===0?{created:!1,id:n.id}:void 0;const l=await t.run("gh",["api","-X","POST",`repos/${e.repo}/issues/${e.issueNumber}/comments`,"-f",`body=${o}`],this.runOpts(e.cwd));if(l.exitCode===0)try{return{created:!0,id:JSON.parse(l.stdout).id}}catch{return}}async createRelease(t,e){const{linkAppendix:s,paths:r}=k(e.assets),a=s?`${e.body}${s}`:e.body,i=["release","create",e.tag,"--repo",e.repo,"--title",e.title,"--notes",a];e.draft&&i.push("--draft"),e.prerelease&&i.push("--prerelease"),e.discussionCategory&&i.push("--discussion-category",e.discussionCategory),r.length>0&&i.push(...r);const n=await t.run("gh",i,this.runOpts(e.cwd));if(n.exitCode===0)return{url:n.stdout.trim()||void 0}}async addLabels(t,e){if(e.labels.length===0)return!0;const s=["api","-X","POST",`repos/${e.repo}/issues/${e.issueNumber}/labels`];for(const a of e.labels)s.push("-f",`labels[]=${a}`);return(await t.run("gh",s,this.runOpts(e.cwd))).exitCode===0}async upsertIssue(t,e){const s=await t.run("gh",["issue","list","--repo",e.repo,"--state","open","--search",e.marker,"--json","number,title,url","--limit","20"],this.runOpts(e.cwd));if(s.exitCode===0&&s.stdout.trim()&&s.stdout.trim()!=="[]")try{const o=JSON.parse(s.stdout).find(l=>l.title.includes(e.marker));if(o){const l=["issue","edit",String(o.number),"--repo",e.repo,"--title",e.title,"--body",e.body];return e.labels&&e.labels.length>0&&l.push("--add-label",e.labels.join(",")),e.assignees&&e.assignees.length>0&&l.push("--add-assignee",e.assignees.join(",")),(await t.run("gh",l,this.runOpts(e.cwd))).exitCode===0?{created:!1,number:o.number,url:o.url}:void 0}}catch{}const r=["issue","create","--repo",e.repo,"--title",e.title,"--body",e.body];e.labels&&e.labels.length>0&&r.push("--label",e.labels.join(",")),e.assignees&&e.assignees.length>0&&r.push("--assignee",e.assignees.join(","));const a=await t.run("gh",r,this.runOpts(e.cwd));if(a.exitCode!==0)return;const i=a.stdout.trim(),n=/\/issues\/(\d+)/.exec(i);return n?{created:!0,number:Number.parseInt(n[1]??"0",10),url:i}:void 0}async closeIssue(t,e){return e.closingComment&&await t.run("gh",["issue","comment",String(e.issueNumber),"--repo",e.repo,"--body",e.closingComment],this.runOpts(e.cwd)),(await t.run("gh",["issue","close",String(e.issueNumber),"--repo",e.repo],this.runOpts(e.cwd))).exitCode===0}async upsertPullRequest(t,e){const s=await t.run("gh",["pr","list","--repo",e.repo,"--head",e.head,"--state","open","--json","number,url"],this.runOpts(e.cwd));if(s.exitCode===0&&s.stdout.trim()&&s.stdout.trim()!=="[]")try{const i=JSON.parse(s.stdout);if(i[0])return await t.run("gh",["pr","edit",String(i[0].number),"--repo",e.repo,"--title",e.title,"--body",e.body],this.runOpts(e.cwd)),{existing:!0,number:i[0].number,url:i[0].url}}catch{}const r=await t.run("gh",["pr","create","--repo",e.repo,"--head",e.head,"--base",e.base,"--title",e.title,"--body",e.body],this.runOpts(e.cwd));if(r.exitCode!==0)return;const a=/\/pull\/(\d+)/.exec(r.stdout);return a?{existing:!1,number:Number.parseInt(a[1]??"0",10),url:r.stdout.trim()}:void 0}}const h=u=>encodeURIComponent(u),_=u=>u.replace(/^v(?=\d)/,""),N=u=>{const t=[],e=[],s=[];for(const r of u??[]){if(typeof r=="string"){t.push(r);continue}r.path?r.target==="generic_package"?s.push({label:r.label,linkType:r.type,name:r.name,packageName:r.packageName,packageVersion:r.packageVersion,path:r.path}):t.push(r.path):r.linkUrl&&e.push({linkType:r.type,name:r.label??r.name??r.linkUrl,url:r.linkUrl})}return{genericPackages:s,links:e,uploads:t}};class f{id="gitlab";static recentReleasesWarned=!1;async listRecentReleases(t,e){return f.recentReleasesWarned||(f.recentReleasesWarned=!0,console.warn("[vis release] addReleases is not yet supported on GitLab — skipping the Related releases block.")),[]}host;httpProxy;viewer;constructor(t={}){this.host=t.host,this.httpProxy=t.httpProxy}runOpts(t){if(!this.host&&!this.httpProxy)return{cwd:t,silent:!0};const e={...process.env};return this.host&&(e.GITLAB_HOST=this.host),this.httpProxy&&(e.HTTPS_PROXY=this.httpProxy,e.HTTP_PROXY=this.httpProxy),{cwd:t,env:e,silent:!0}}async listNotes(t,e,s){const r=await t.run("glab",["api",s,"--paginate"],this.runOpts(e));if(r.exitCode===0)return w(r.stdout)?.filter(a=>typeof a.body=="string"&&a.system!==!0).map(a=>({author:a.author?.username,body:a.body??"",id:a.id}))}async resolveViewer(t,e){return this.viewer??=t.run("glab",["api","user"],this.runOpts(e)).then(s=>{if(s.exitCode===0)try{const{username:r}=JSON.parse(s.stdout);return typeof r=="string"&&r?r:void 0}catch{return}}),this.viewer}async uploadGenericPackage(t,e,s,r,a){const i=h(s),n=P(a.path),c=a.packageName??s.split("/").pop()??"release",o=a.packageVersion??_(r),l=`projects/${i}/packages/generic/${encodeURIComponent(c)}/${encodeURIComponent(o)}/${encodeURIComponent(n)}`;if((await t.run("glab",["api","-X","PUT",l,"--input",a.path],this.runOpts(e))).exitCode!==0)return;const p=this.host?.replace(/^https?:\/\//i,"").replace(/\/+$/,""),m=`${p?`https://${p}`:"https://gitlab.com"}/api/v4/${l}`,y=["api","-X","POST",`projects/${i}/releases/${encodeURIComponent(r)}/assets/links`,"-f",`name=${a.label??a.name??n}`,"-f",`url=${m}`];a.linkType&&y.push("-f",`link_type=${a.linkType}`),await t.run("glab",y,this.runOpts(e))}async detectRepoSlug(t,e){const s=process.env.CI_PROJECT_PATH;if(s)return s;const r=await e.run("git",["config","--get","remote.origin.url"],{cwd:t,silent:!0});if(r.exitCode!==0)return;const a=r.stdout.trim();return/gitlab\.[\w.-]+[/:]([^/].*?)(?:\.git)?$/.exec(a)?.[1]}detectPullRequestNumber(t){const e=t.CI_MERGE_REQUEST_IID??t.VIS_MR_NUMBER;if(!e)return;const s=Number.parseInt(e,10);return Number.isNaN(s)?void 0:s}async upsertStickyComment(t,e){const s=`projects/${h(e.repo)}/${e.target==="issue"?"issues":"merge_requests"}/${e.issueNumber}/notes`,r=await this.listNotes(t,e.cwd,s);if(!r)return;const a=r.filter(d=>d.body.includes(e.marker)),i=a.length>0?await this.resolveViewer(t,e.cwd):void 0,n=i===void 0?void 0:a.find(d=>d.author===i),c=n&&e.merge?e.merge(n.body):e.body,o=c.includes(e.marker)?c:`${e.marker}
|
|
8
|
+
${c}`;if(n)return o===n.body?{created:!1,id:n.id}:(await t.run("glab",["api","-X","PUT",`${s}/${n.id}`,"-f",`body=${o}`],this.runOpts(e.cwd))).exitCode===0?{created:!1,id:n.id}:void 0;const l=await t.run("glab",["api","-X","POST",s,"-f",`body=${o}`],this.runOpts(e.cwd));if(l.exitCode===0)try{return{created:!0,id:JSON.parse(l.stdout).id}}catch{return}}async createRelease(t,e){const{genericPackages:s,links:r,uploads:a}=N(e.assets),i=["release","create",e.tag,"--repo",e.repo,"--name",e.title,"--notes",e.body];if(e.milestones&&e.milestones.length>0)for(const l of e.milestones)i.push("--milestone",l);if((await t.run("glab",i,this.runOpts(e.cwd))).exitCode!==0)return;a.length>0&&await t.run("glab",["release","upload",e.tag,"--repo",e.repo,...a],this.runOpts(e.cwd));const c=h(e.repo);for(const l of r){const d=["api","-X","POST",`projects/${c}/releases/${encodeURIComponent(e.tag)}/assets/links`,"-f",`name=${l.name}`,"-f",`url=${l.url}`];l.linkType&&d.push("-f",`link_type=${l.linkType}`),await t.run("glab",d,this.runOpts(e.cwd))}for(const l of s)await this.uploadGenericPackage(t,e.cwd,e.repo,e.tag,l);const o=await t.run("glab",["api",`projects/${c}/releases/${encodeURIComponent(e.tag)}`],this.runOpts(e.cwd));try{return{url:JSON.parse(o.stdout)._links?.self}}catch{return{url:void 0}}}async addLabels(t,e){if(e.labels.length===0)return!0;const s=h(e.repo),r=e.target==="merge_request"?"merge_requests":"issues";return(await t.run("glab",["api","-X","PUT",`projects/${s}/${r}/${e.issueNumber}`,"-f",`add_labels=${e.labels.join(",")}`],this.runOpts(e.cwd))).exitCode===0}async upsertIssue(t,e){const s=h(e.repo),r=await t.run("glab",["api",`projects/${s}/issues?state=opened&search=${encodeURIComponent(e.marker)}&in=title`],this.runOpts(e.cwd));if(r.exitCode===0)try{const l=JSON.parse(r.stdout).find(d=>d.title.includes(e.marker));if(l){const d=["api","-X","PUT",`projects/${s}/issues/${l.iid}`,"-f",`title=${e.title}`,"-f",`description=${e.body}`];if(e.labels&&e.labels.length>0&&d.push("-f",`add_labels=${e.labels.join(",")}`),e.assignees?.[0]){const b=await t.run("glab",["api",`users?username=${encodeURIComponent(e.assignees[0])}`],this.runOpts(e.cwd));try{const m=JSON.parse(b.stdout);m[0]&&d.push("-f",`assignee_id=${m[0].id}`)}catch{}}return(await t.run("glab",d,this.runOpts(e.cwd))).exitCode===0?{created:!1,number:l.iid,url:l.web_url}:void 0}}catch{}const a=["issue","create","--repo",e.repo,"--title",e.title,"--description",e.body,"--yes"];e.labels&&e.labels.length>0&&a.push("--label",e.labels.join(",")),e.assignees?.[0]&&a.push("--assignee",e.assignees[0]);const i=await t.run("glab",a,this.runOpts(e.cwd));if(i.exitCode!==0)return;const n=i.stdout.trim(),c=/\/issues\/(\d+)/.exec(n);return c?{created:!0,number:Number.parseInt(c[1]??"0",10),url:n}:void 0}async closeIssue(t,e){if(e.closingComment){const r=h(e.repo);await t.run("glab",["api","-X","POST",`projects/${r}/issues/${e.issueNumber}/notes`,"-f",`body=${e.closingComment}`],this.runOpts(e.cwd))}return(await t.run("glab",["issue","close",String(e.issueNumber),"--repo",e.repo],this.runOpts(e.cwd))).exitCode===0}async upsertPullRequest(t,e){const s=h(e.repo),r=await t.run("glab",["api",`projects/${s}/merge_requests?state=opened&source_branch=${encodeURIComponent(e.head)}&target_branch=${encodeURIComponent(e.base)}`],this.runOpts(e.cwd));if(r.exitCode===0)try{const c=JSON.parse(r.stdout);if(c[0])return(await t.run("glab",["api","-X","PUT",`projects/${s}/merge_requests/${c[0].iid}`,"-f",`title=${e.title}`,"-f",`description=${e.body}`],this.runOpts(e.cwd))).exitCode===0?{existing:!0,number:c[0].iid,url:c[0].web_url}:void 0}catch{}const a=await t.run("glab",["mr","create","--repo",e.repo,"--source-branch",e.head,"--target-branch",e.base,"--title",e.title,"--description",e.body,"--yes"],this.runOpts(e.cwd));if(a.exitCode!==0)return;const i=a.stdout.trim(),n=/\/merge_requests\/(\d+)/.exec(i);return n?{existing:!1,number:Number.parseInt(n[1]??"0",10),url:i}:void 0}}const T=u=>{if(u.GITHUB_ACTIONS==="true"||u.GITHUB_REPOSITORY)return"github";if(u.GITLAB_CI==="true"||u.CI_PROJECT_PATH)return"gitlab"},I=u=>{const t=u.trim();if(t!==""){if(!t.includes("://")){const e=t.indexOf(":"),s=t.indexOf("/");if(e>0&&(s===-1||e<s)){const r=t.slice(0,e),a=r.lastIndexOf("@");return(a===-1?r:r.slice(a+1)).toLowerCase()||void 0}return}try{return new URL(t).hostname.toLowerCase()||void 0}catch{return}}},S=async(u,t)=>{const e=await t.run("git",["config","--get","remote.origin.url"],{cwd:u,silent:!0});if(e.exitCode!==0)return;const s=I(e.stdout);if(s){if(s==="github.com"||s.endsWith(".github.com"))return"github";if(s==="gitlab.com"||s.startsWith("gitlab."))return"gitlab"}},j=async(u,t,e=process.env)=>T(e)??await S(u,t),A=async(u,t,e,s=process.env)=>{if(e&&e!=="auto"){if(e==="github"||e==="gitlab")return e;throw new Error(`Unsupported release.provider: ${e}. Expected "github", "gitlab", or "auto".`)}return await j(u,t,s)??"github"},q=(u,t={})=>u==="gitlab"?new f({host:t.gitlabHost,httpProxy:t.httpProxy}):new R({host:t.githubHost,httpProxy:t.httpProxy});export{q as createRemoteClient,j as detectKnownRemoteProvider,A as detectRemoteProvider};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as m}from"node:module";import{e as p,m as g}from"../packem_shared/index-
|
|
1
|
+
import{createRequire as m}from"node:module";import{e as p,m as g}from"../packem_shared/index-zq6Ehql6.js";let l;const f=e=>(l??=m(import.meta.url))(e),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=e=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[n,s]=c.versions.node.split(".").map(Number);if(n>22||n===22&&s>=3||n===20&&s>=16)return c.getBuiltinModule(e)}return f(e)},{spawnSync:h}=u("node:child_process"),{readFileSync:y,statSync:_}=u("node:fs"),d={npm:{pm:"npm",runner:!1},npx:{pm:"npm",runner:!0},pnpm:{pm:"pnpm",runner:!1},pnpx:{pm:"pnpm",runner:!0},yarn:{pm:"yarn",runner:!1},yarnpkg:{pm:"yarn",runner:!1}},v=new Set(["create","dlx","exec","init"]),a=e=>{try{return _(e).isFile()}catch{return!1}},S=e=>e==="npm"||e==="pnpm"||e==="yarn"?e:void 0,w=e=>{const n=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"]];let s=e;for(;;){const t=p(s,"package.json");if(a(t))try{const o=JSON.parse(y(t,"utf8")).packageManager;if(typeof o=="string"&&o.length>0){const i=S(o.split("@")[0]);if(i!==void 0)return i}}catch{}for(const[o,i]of n)if(a(p(s,o)))return i;const r=g(s);if(r===s)return;s=r}},x=()=>process.env.npm_config_user_agent!==void 0||process.env.npm_execpath!==void 0,j=(e,n,s,t)=>{const r=d[e];if(r===void 0)return"dispatch";const o=r.runner||s!==void 0&&v.has(s);return n!==void 0&&r.pm!==n&&!o&&!t?"refuse":"dispatch"},$=e=>{const n=process.platform==="win32"?[`${e}.cmd`,`${e}.exe`,e]:[e];for(const s of(process.env.PATH??"").split(process.platform==="win32"?";":":"))if(!(s===""||s.replace(/[/\\]+$/u,"").endsWith(p(".vis","shims"))))for(const t of n){const r=p(s,t);if(a(r))return r}},R=(e,n)=>{d[e]===void 0&&(process.stderr.write(`vis: ${e} is not a known package-manager shim.
|
|
2
2
|
`),process.exit(1));const t=w(process.cwd());j(e,t,n[0],x())==="refuse"&&(process.stderr.write(`vis: this project uses ${String(t)}, but \`${e}\` was run. Use \`${String(t)}\` instead, or run \`vis shim uninstall\` to disable the PM guard.
|
|
3
3
|
`),process.exit(1));const r=$(e);r===void 0&&(process.stderr.write(`vis: \`${e}\` was not found on PATH (outside the shim dir).
|
|
4
4
|
`),process.exit(1));const o=h(r,n,{stdio:"inherit"});process.exit(o.status??(o.signal===null?0:1))};export{j as decideShim,R as dispatchShim};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as T}from"node:module";import{j as $,F as R,b as P,q as L,X as S,J as k}from"../packem_shared/index.server-Ca_EEVfw.js";import{a as N}from"../packem_shared/index-
|
|
1
|
+
import{createRequire as T}from"node:module";import{j as $,F as R,b as P,q as L,X as S,J as k}from"../packem_shared/index.server-Ca_EEVfw.js";import{a as N}from"../packem_shared/index-zq6Ehql6.js";import{a as B,r as D,b as y,c as M}from"../packem_shared/ai-fix-CyExJC_c.js";import{p as c}from"./cli-main.js";import{l as _}from"../packem_shared/failure-log-DwroazKs.js";let A;const O=s=>(A??=T(import.meta.url))(s),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,q=s=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[t,i]=d.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return d.getBuiltinModule(s)}return O(s)},{createInterface:J}=q("node:readline"),U={"ambiguous-match":"ambiguous match",applied:"applied",error:"error","missing-file":"missing file","no-match":"no match","outside-workspace":"outside workspace"},j=(s,t,i)=>{const e=M(s,t,i),r=N(s,e);return r===""||r.startsWith("..")?e:r},W=(s,t,i)=>{const e=[$(`Fix proposal (${s.provider}, confidence: ${s.confidence})`),"",s.explanation||R("<no explanation>")];if(s.cannotFix)return e.push(""),e.push(P(`Cannot fix automatically: ${s.cannotFix}`)),e.join(`
|
|
2
2
|
`);if(s.patches.length===0)return e.push(""),e.push(P("No patches were proposed.")),e.join(`
|
|
3
3
|
`);e.push(""),e.push($(`Patches (${String(s.patches.length)}):`));for(const[r,o]of s.patches.entries()){const a=j(t,i,o.file);e.push(""),e.push(L(`[${String(r+1)}] ${a}`)),o.reason&&e.push(R(` reason: ${o.reason}`));for(const h of o.oldString.split(`
|
|
4
4
|
`))e.push(S(` - ${h}`));for(const h of o.newString.split(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as w,a as p,b as v}from"../packem_shared/pm-runner-
|
|
1
|
+
import{r as w,a as p,b as v}from"../packem_shared/pm-runner-CYsiSHYa.js";import{r as h,a as x}from"../packem_shared/command-runtime-DdnpiUmN.js";import{t as R}from"../packem_shared/utils-DQFHJn72.js";const B=async({argument:d,logger:f,options:e,rawUnknown:i,visConfig:l,workspaceRoot:k})=>{const s=d;if(!s||s.length===0)throw new Error("No command specified. Usage: vis exec <command> [args...]");const[c,...o]=s,n=i??[],t=n[0]==="--"?o:[...o,...n],r=k??process.cwd(),m=R(e.filter);let a=!e.recursive&&!e.workspaceRoot&&!e.parallel&&!e.reverse&&!e.shellMode&&m.length===0?w(c,t,r):null;if(a===null){const u=h({options:e,visConfig:l},r),g=p(r,{backend:x(u),configBackend:l?.install?.backend,configCorepack:l?.install?.corepack});a=v(g,{args:t,command:c,filter:m,parallel:e.parallel||!1,recursive:e.recursive||!1,reverse:e.reverse||!1,shellMode:e.shellMode||!1,workspaceRoot:e.workspaceRoot||!1},r,f)}a!==0&&(process.exitCode=a)};export{B as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as _}from"node:module";import{z as m,e as t}from"../packem_shared/index-
|
|
1
|
+
import{createRequire as _}from"node:module";import{z as m,e as t}from"../packem_shared/index-zq6Ehql6.js";import{c as b,U as j}from"../packem_shared/env-NauRSSEC.js";import{y as a}from"../packem_shared/isAccessibleSync-DYKTrrvc-CKahNmLy.js";let v;const w=o=>(v??=_(import.meta.url))(o),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=o=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[n,s]=c.versions.node.split(".").map(Number);if(n>22||n===22&&s>=3||n===20&&s>=16)return c.getBuiltinModule(o)}return w(o)},{homedir:i}=d("node:os"),{createInterface:y}=d("node:readline"),f=b(),p=[t(i(),".zshrc"),t(i(),".zshenv"),t(i(),".bashrc"),t(i(),".bash_profile"),t(i(),".profile"),t(i(),".config","fish","config.fish")],E=o=>{const n=[];for(const s of p)if(a(s))try{const l=m(s).split(`
|
|
2
2
|
`),e=l.filter(r=>!r.includes(".vis/bin")&&!r.includes("VIS_HOME")&&!r.includes("# vis "));e.length!==l.length&&(j(s,e.join(`
|
|
3
3
|
`)),n.push(s))}catch{o.warn(`warning: could not clean ${s}`)}return n},R=async({fs:o,logger:n,options:s})=>{if(!a(f)){n.info("vis is not installed (no ~/.vis directory found).");return}n.info("This will remove:"),n.info(` ${f}/`);const u=p.filter(e=>a(e)&&m(e).includes(".vis"));for(const e of u)n.info(` Lines in ${e}`);if(!s.yes){if(!process.stdin.isTTY)throw new Error("Non-interactive terminal. Use --yes to confirm.");const e=y({input:process.stdin,output:process.stdout}),r=await new Promise(h=>{e.question(`
|
|
4
4
|
Type "uninstall" to confirm: `,h)});if(e.close(),r.trim()!=="uninstall"){n.info("Aborted.");return}}const l=E(n);for(const e of l)n.info(`Cleaned ${e}`);try{await o.rm(f,{force:!0,recursive:!0}),n.info(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f,f as k}from"../packem_shared/pm-runner-
|
|
1
|
+
import{a as f,f as k}from"../packem_shared/pm-runner-CYsiSHYa.js";import{r as m,a as w}from"../packem_shared/command-runtime-DdnpiUmN.js";const x=async({argument:e,logger:n,options:s,process:r,visConfig:o,workspaceRoot:t})=>{if(!e||e.length===0)throw new Error("No package specified. Usage: vis info <package> [field...]");const[l,...d]=e,a=t??r.cwd,i=m({options:s,visConfig:o},a),p=f(a,{backend:w(i),configBackend:o?.install?.backend,configCorepack:o?.install?.corepack}),c=k(p,{fields:d,json:s.json||!1,package:l},a,n);c!==0&&c!==1&&(process.exitCode=c)};export{x as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as A}from"node:module";import{e as m,a as O}from"../packem_shared/index-
|
|
1
|
+
import{createRequire as A}from"node:module";import{e as m,a as O}from"../packem_shared/index-zq6Ehql6.js";import{findVisConfigFile as F,DEFAULT_MIN_RELEASE_AGE_MINUTES as h}from"./CONFIG_FILES.js";import{p as e,e as V}from"./cli-main.js";import{d as q,r as G}from"../packem_shared/detect-xqoTANJb.js";import{d as K}from"../packem_shared/pm-runner-CYsiSHYa.js";import{a as P,g as U,b as L}from"../packem_shared/scaffold-files-UiCBBCT5.js";import{s as Y}from"../packem_shared/build-scripts-BeJkep8z.js";import{y as S}from"../packem_shared/isAccessibleSync-DYKTrrvc-CKahNmLy.js";import{U as j}from"../packem_shared/env-NauRSSEC.js";import{s as R}from"../packem_shared/native-config-sync-DDFn6Zsf.js";import{s as T}from"../packem_shared/min-release-age-DLAERxRt.js";let M;const N=n=>(M??=A(import.meta.url))(n),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=n=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[s,t]=g.versions.node.split(".").map(Number);if(s>22||s===22&&t>=3||s===20&&t>=16)return g.getBuiltinModule(n)}return N(n)},{execFileSync:I}=x("node:child_process"),{createInterface:D}=x("node:readline"),W=n=>{const s=[];return S(m(n,"turbo.json"))&&s.push("turborepo"),S(m(n,"nx.json"))&&s.push("nx"),S(m(n,".moon"))&&s.push("moon"),s},B=(n,s)=>new Promise(t=>{n.question(s,i=>{t(i.trim())})}),d=async(n,s,t=!0)=>{const o=await B(n,`${s} ${t?"[Y/n]":"[y/N]"} `);return o===""?t:o.toLowerCase()==="y"||o.toLowerCase()==="yes"},w=(n,s)=>{const t=[],i=Object.entries(s.allowBuilds).filter(([,c])=>c).map(([c])=>` "${c}": true,`).join(`
|
|
2
2
|
`),a=[` installScripts: {
|
|
3
3
|
allow: ${i?`{
|
|
4
4
|
${i}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{J as k,F as v,X as $,b as y}from"../packem_shared/index.server-Ca_EEVfw.js";import{p}from"./cli-main.js";import{r as N,M,a as S,b as x,c as A,d as b,e as C,f as R,g as P,h as j}from"../packem_shared/s1ngularity-
|
|
1
|
+
import{J as k,F as v,X as $,b as y}from"../packem_shared/index.server-Ca_EEVfw.js";import{p}from"./cli-main.js";import{r as N,M,a as S,b as x,c as A,d as b,e as C,f as R,g as P,h as j}from"../packem_shared/s1ngularity-B2bqwE0C.js";import{g as B,r as D}from"../packem_shared/packument-B678kHJO.js";import{r as E}from"../packem_shared/provenance-D4ioWGBq.js";import{r as O}from"../packem_shared/signatures-DNqgsRp7.js";const w=new Set(["archivedRepo","author","downloads","expiredDomains","metadata","newBin","provenance","s1ngularity","signatures"]),V=n=>{const s=n.trim();if(s==="")return;if(s.startsWith("@")){const r=s.indexOf("@",1);return r===-1?{name:s,spec:void 0}:{name:s.slice(0,r),spec:s.slice(r+1)||void 0}}const t=s.indexOf("@");return t===-1?{name:s,spec:void 0}:{name:s.slice(0,t),spec:s.slice(t+1)||void 0}},F=n=>{if(n===void 0||n.trim()==="")return;const s=new Set;for(const t of n.split(",")){const r=t.trim();if(!w.has(r))throw new Error(`Unknown marshall in --only: ${r}. Known: ${[...w].sort().join(", ")}.`);s.add(r)}return s},l=(n,s)=>n===void 0||n.has(s),L=n=>n?.has("signatures")??!1,q=async({argument:n,options:s,workspaceRoot:t})=>{if(!n||n.length===0)throw new Error("No package specified. Usage: vis inspect <package>[@<spec>]");const r=V(n[0]);if(r===void 0)throw new Error(`Invalid package argument: "${String(n[0])}". Usage: vis inspect <package>[@<spec>]`);const i=F(s.only),u=await B(r.name,{workspaceRoot:t});if(u===void 0){p.error(`Package ${r.name} not found in the registry.`),process.exitCode=2;return}const g=D(u,r.spec);if(g===void 0){p.error(`Could not resolve ${r.name}@${r.spec??"latest"} to a published version.`),process.exitCode=2;return}const c=[{name:r.name,version:g}],o=new M;if(l(i,"author")){const a=await N(c,{workspaceRoot:t});for(const e of a)o.add({marshall:"author",message:e.message,packageName:e.packageName,severity:e.severity})}if(l(i,"provenance")){const a=await E(c);for(const e of a)o.add({marshall:"provenance",message:`Prior version ${e.priorVersionWithProvenance} had provenance but ${e.version} does not.`,packageName:e.packageName,severity:"error"})}if(l(i,"s1ngularity")){const a=await S(c,{workspaceRoot:t});for(const e of a){const d=e.hookChanges.map(f=>`${f.hook} (${f.kind})`).join(", "),m=e.hookChanges.length===1;o.add({marshall:"s1ngularity",message:`${e.version} ${m?"has an":"has"} install-script ${m?"change":"changes"} [${d}] AND dropped the provenance attestation that ${e.priorVersion} carried — this is the s1ngularity compromised-publish shape.`,packageName:e.packageName,severity:"error"})}}if(l(i,"newBin")){const a=await x(c);for(const e of a){const d=e.newBins.map(m=>m.command).join(", ");o.add({marshall:"newBin",message:`${e.toVersion} adds new bin script${e.newBins.length===1?"":"s"}: ${d} (prior: ${e.fromVersion}).`,packageName:e.packageName,severity:"warning"})}}if(l(i,"metadata")){const a=await A(c,{workspaceRoot:t});for(const e of a)o.add({marshall:"metadata",message:`Missing/invalid metadata: ${e.issues.join(", ")}.`,packageName:e.packageName,severity:"warning"})}if(l(i,"downloads")){const a=await b([r.name]);for(const e of a){const d=e.downloadsLastMonth===void 0?"unknown":String(e.downloadsLastMonth);o.add({marshall:"downloads",message:e.kind==="no-data"?"npm stats API returned no monthly download data.":`Only ${d} downloads in the past month.`,packageName:e.packageName,severity:e.severity})}}if(l(i,"expiredDomains")){const a=await C(c,{workspaceRoot:t});for(const e of a)o.add({marshall:"expiredDomains",message:e.kind==="expired"?`Maintainer email domain ${e.domain} (${e.maintainer}) is unregistered — potential hijack risk.`:`Could not verify maintainer email domain ${e.domain} (${e.maintainer}).`,packageName:e.packageName,severity:e.severity})}if(L(i)){const a=await O(c,{workspaceRoot:t});for(const e of a)o.add({marshall:"signatures",message:e.message,packageName:e.packageName,severity:e.severity})}if(l(i,"archivedRepo")){const a=await R(c,{workspaceRoot:t});for(const e of a)o.add({marshall:"archivedRepo",message:e.kind==="archived"?`Source repo ${e.owner}/${e.repo} is archived${e.archivedAt===void 0?"":` (since ${e.archivedAt})`}.`:`Source repo ${e.owner}/${e.repo} returned 404 from GitHub.`,packageName:e.packageName,severity:"warning"})}const h=o.all();if(s.json)process.stdout.write(`${JSON.stringify(P(h),void 0,2)}
|
|
2
2
|
`);else{const a=`${r.name}@${g}`;if(h.length===0)p.info(`${k("✓")} ${a} — no findings.`);else{p.info(`${v("Inspecting")} ${a}`);for(const m of j(h))process.stdout.write(`${m}
|
|
3
3
|
`);const e=o.errors().length,d=o.warnings().length;process.stdout.write(`
|
|
4
4
|
${v("Summary:")} ${$(`${String(e)} error${e===1?"":"s"}`)}, ${y(`${String(d)} warning${d===1?"":"s"}`)}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{e as w,m as F,b as _}from"../packem_shared/index-
|
|
1
|
+
import{e as w,m as F,b as _}from"../packem_shared/index-zq6Ehql6.js";import{p as r}from"./cli-main.js";import{d as j,a as v,g as N,h as W}from"../packem_shared/pm-runner-CYsiSHYa.js";import{a as $,r as K}from"../packem_shared/command-runtime-DdnpiUmN.js";import{s as M}from"../packem_shared/typosquats-XrArH9TO.js";import{h as T,P as H}from"../packem_shared/peer-warnings-CmYSxvql.js";import{t as G}from"../packem_shared/utils-DQFHJn72.js";import{y as J}from"../packem_shared/isAccessibleSync-DYKTrrvc-CKahNmLy.js";const Q=["pnpm-lock.yaml","yarn.lock","package-lock.json","npm-shrinkwrap.json","bun.lock","bun.lockb"],U=n=>{let t=n;for(;;){for(const i of Q)if(J(w(t,i)))return!0;const a=F(t);if(a===t||_(t).root===t)return!1;t=a}},g=new Set(["aube","auto","bun","npm","pnpm","yarn"]),re=async n=>{const{argument:t,fs:a,logger:i,options:e,visConfig:c,workspaceRoot:C}=n,s=C??process.cwd();if(t&&t.length>0){const o=e,{default:L}=await import("./handler15.js"),R=o.marshallCheck===!1||o["no-marshall-check"]===!0?!1:void 0,z=o.socketCheck===!1||o["no-socket-check"]===!0?!1:void 0,D=o.typosquatCheck===!1||o["no-typosquat-check"]===!0?!1:void 0,I=o.runScripts===!0||o["run-scripts"]===!0,P=o.workspaceRoot===!0||o["workspace-root"]===!0,q=o.saveOptional===!0||o["save-optional"]===!0,A=e.dev===!0,B={autoInstallPeers:!1,exact:o.exact===!0,filter:e.filter,global:!1,marshallCheck:R,runScripts:I,saveDev:A,saveOptional:q,savePeer:!1,socketCheck:z,to:void 0,typosquatCheck:D,workspace:!1,workspaceRoot:P};await L({...n,argument:t,options:B});return}if(e.typosquatCheck!==!1&&!await M(s,c?.security?.typosquatAllowlist)){process.exitCode=1;return}const l=e.installer;if(l&&!g.has(l)){r.error(`Invalid --installer value: "${l}". Expected one of: ${[...g].join(", ")}.`),process.exitCode=1;return}const y=l,O=e.aube===!1,f=$(K({options:e,visConfig:c},s));let p;try{p=O?f===void 0?j(s):v(s,{backend:f}):v(s,{backend:y??f,configBackend:c?.install?.backend,configCorepack:c?.install?.corepack})}catch(o){r.error(o instanceof Error?o.message:String(o)),process.exitCode=1;return}const k=N(s,p);k&&r.warn(k);const b=G(e.filter),u=e.ci||!1,m=e.frozenLockfile||u,x=!e.frozenLockfile||e.force||e.lockfileOnly,E=U(s),h=m||!x&&E;if(!m&&h&&!e.silent&&r.info("Defaulting to frozen lockfile (pass --no-frozen-lockfile to allow lockfile updates)."),u){r.info("Clean install: removing node_modules...");try{await a.rm(w(s,"node_modules"),{force:!0,recursive:!0})}catch(o){r.error(`Failed to remove node_modules: ${o instanceof Error?o.message:String(o)}`),process.exitCode=1;return}}const{code:d,output:S}=await W(p,{dev:e.dev||!1,filter:b,force:e.force||!1,frozenLockfile:h,ignoreScripts:!e.runScripts,lockfileOnly:e.lockfileOnly||!1,noOptional:e.optional===!1,offline:e.offline||!1,prod:e.prod||!1,recursive:e.recursive||!1,silent:e.silent||!1,workspaceRoot:e.workspaceRoot||!1},s,i,{ciMode:u,preferOffline:e.preferOffline||!1});d!==0&&(process.exitCode=d),d===0&&!e.silent&&T(S)&&r.info(H)};export{re as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as D}from"node:module";import{J as P,F as j,X as q,b as F}from"../packem_shared/index.server-Ca_EEVfw.js";import{e as I}from"../packem_shared/index-
|
|
1
|
+
import{createRequire as D}from"node:module";import{J as P,F as j,X as q,b as F}from"../packem_shared/index.server-Ca_EEVfw.js";import{e as I}from"../packem_shared/index-zq6Ehql6.js";import{c as b,p,O as N}from"./cli-main.js";import{a as B,f as U,d as z,q as H,u as V}from"../packem_shared/registry-ClmannRw.js";import{V as W}from"../packem_shared/vis-user-error-DhgW3DzD.js";import{a as G,c as X,n as Y}from"../packem_shared/pm-runner-CYsiSHYa.js";import{r as J,a as K}from"../packem_shared/command-runtime-DdnpiUmN.js";import{r as _,a as Q,p as Z,b as ee}from"../packem_shared/resolve-explicit-C5-y-xEU.js";import{e as te,f as y,i as re,j as S,k as se,l as oe,s as ne}from"../packem_shared/env-NauRSSEC.js";import{r as ae}from"../packem_shared/typosquats-XrArH9TO.js";import{readCatalogs as ce}from"./catalog.js";import{p as E,t as C}from"../packem_shared/utils-DQFHJn72.js";import{y as ie}from"../packem_shared/isAccessibleSync-DYKTrrvc-CKahNmLy.js";import{p as le}from"../packem_shared/package-version-BOK3IncQ.js";let L;const T=r=>(L??=D(import.meta.url))(r),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,M=r=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[i,e]=w.versions.node.split(".").map(Number);if(i>22||i===22&&e>=3||i===20&&e>=16)return w.getBuiltinModule(r)}return T(r)},{createInterface:O}=M("node:readline"),x=r=>r==="default"?"catalog:":`catalog:${r}`,v=r=>r==="default"?"default catalog":`catalog "${r}"`,fe=(r,i)=>{const e=[];for(const[t,s]of i)t.includes(":")||s.has(r)&&e.push(t);if(e.length===0)return;if(e.length===1){const[t]=e;return{source:v(t),spec:x(t)}}const n=e.find(t=>t==="default")??e[0],a=e.filter(t=>t!==n);return{candidates:[...e],conflict:!0,source:`${v(n)} (also in: ${a.map(t=>v(t)).join(", ")})`,spec:x(n)}},pe=(r,i)=>{const e=new Map;for(const[c,d]of i){if(!c.includes(":"))continue;const f=d.get(r);f!==void 0&&e.set(f,(e.get(f)??0)+1)}if(e.size===0)return;const n=[...e.entries()],a=n.reduce((c,[,d])=>c+d,0);if(n.length===1){const[[c]]=n;return{source:`siblings (${String(a)} pkg${a===1?"":"s"} on ${c})`,spec:c}}const t=[...n].sort((c,d)=>d[1]-c[1]),[s,o]=t[0],l=t.slice(1).map(([c,d])=>`${c} (×${String(d)})`);return{candidates:t.map(([c])=>c),conflict:!0,source:`siblings (most common: ${s} ×${String(o)}; conflicts: ${l.join(", ")})`,spec:s}},de=(r,i)=>{const e=fe(r,i);return e||pe(r,i)},ue=(r,i,e)=>{const n=[];for(const a of r.values()){const{overall:t}=a.score,s=ne(t),o=`${String(Math.round(t*100))}%`,l=a.alerts.length,c=y(a),d=re(c,a.version,e),f=s==="red"?q:s==="yellow"?F:P;if(d?p.info(` ${f(o)} ${S(a)} ${j(`[accepted: ${d.reason}]`)}`):p.info(` ${f(o)} ${S(a)}`),l>0){const m=a.alerts.filter(u=>u.severity==="critical"||u.severity==="high").length;m>0&&p.warn(` ${String(m)} critical/high alert${m===1?"":"s"}`)}t<i&&!d&&n.push(a)}return n},me=async(r,i)=>{const e=O({input:process.stdin,output:process.stdout}),n=o=>new Promise(l=>{e.question(o,c=>{l(c.trim())})}),a=String(Math.round(i*100));p.warn(""),p.warn(`${String(r.length)} package${r.length===1?"":"s"} scored below the minimum threshold (${a}%):`);for(const o of r){const l=y(o),c=`${String(Math.round(o.score.overall*100))}%`;p.warn(` • ${l}@${o.version} — score: ${c} (${se(o.score.overall)})`)}p.warn("");const t=await n("Continue adding these packages? [y/N] ");if(t.toLowerCase()!=="y"&&t.toLowerCase()!=="yes")return e.close(),!1;const s=await n("Remember this decision? (prints config snippet) [y/N] ");if(e.close(),s.toLowerCase()==="y"||s.toLowerCase()==="yes"){p.notice(""),p.notice("Add the following to security.acceptedRisks in vis.config.ts:"),p.notice("");for(const o of r){const l=y(o),c=oe(l,o.version,o.score.overall,"Reviewed and accepted");p.notice(c)}p.notice("")}return!0},ge=async(r,i,e,n)=>{const a=await _(r);if(a.length===0)return!0;p.info(""),p.info(`${i.map(o=>o.displayName).join(" + ")} security check:`);const t=await U(i,a);if(t.size===0)return p.info(" Could not fetch security data. Proceeding."),!0;const s=ue(t,e,n);return s.length===0?(p.info(""),!0):process.stdin.isTTY?me(s,e):(p.warn(`Aborting: ${String(s.length)} package${s.length===1?"":"s"} below minimum score. Use --no-socket-check to skip.`),!1)},he=["dependencies","devDependencies","peerDependencies","optionalDependencies"],ke=r=>r.savePeer?"peerDependencies":r.saveOptional?"optionalDependencies":r.saveDev?"devDependencies":"dependencies",R=(r,i)=>r.startsWith("catalog:")||!i?r:r.replace(/^[\^~]/,""),we=async(r,i)=>{const e=[];for(const t of r){const{name:s,versionSpec:o}=E(t);if(!s)continue;if(o!==void 0){e.push({explicit:o,name:s});continue}const l=de(s,i);if(l){l.conflict&&p.warn(`${s}: ambiguous constraint — picking ${l.spec} (${l.source}). Pass ${s}@<version> to override.`),e.push({entry:{name:s,source:l.source,spec:l.spec},kind:"resolved",name:s});continue}e.push({kind:"missing",name:s})}const n=e.filter(t=>"kind"in t&&t.kind==="missing").map(t=>t.name),a=n.length>0?await ee(n):new Map;return e.map(t=>{if("explicit"in t)return{name:t.name,source:"explicit",spec:t.explicit};if(t.kind==="resolved")return t.entry;const s=a.get(t.name);if(s===void 0)throw new Error(`--to: cannot resolve a version for "${t.name}" (not in any catalog or sibling, and registry lookup failed). Pass ${t.name}@<version> explicitly.`);const o=`^${s}`;return p.info(`${t.name}: no existing constraint — using registry latest (${o}). Add to a catalog to share this version across workspace packages.`),{name:t.name,source:"registry latest",spec:o}})},ve=(r,i,e,n)=>{for(const{name:a,spec:t}of i){const s=R(t,n);for(const l of he){if(l===e)continue;const c=r[l];c?.[a]!==void 0&&(delete c[a],Object.keys(c).length===0&&delete r[l])}let o=r[e];o===void 0&&(o={},r[e]=o),o[a]=s}},ye=async({ignoreScripts:r,logger:i,options:e,packages:n,pm:a,target:t,visConfig:s,workspaceRoot:o})=>{const{workspace:l}=z(o,s??{}),c=l.projects[t];if(!c){const g=Object.keys(l.projects).sort();throw new Error(`--to: workspace package "${t}" not found. Available: ${g.length>0?g.slice(0,10).join(", "):"(none)"}${g.length>10?`, ... (${String(g.length-10)} more)`:""}.`)}const d=I(o,c.root,"package.json");if(!ie(d))throw new W(`--to: project "${t}" has no package.json (${c.root}), so there is nothing to add npm dependencies to.`);const{packageManager:f}=N(o),m=ce(o,f),u=ke(e),k=e.exact??!1,h=await we(n,m);if(h.length===0)return 0;const $=le(d);ve($,h,u,k),H(d,$,{indent:V(d,{useEditorconfig:s?.editorconfig??!0}),overwrite:!0});for(const g of h){const A=R(g.spec,k);p.info(`${P("+")} ${g.name}@${A} → ${t}/${u} (${j(g.source)})`)}return Y(a,{dev:!1,filter:[],force:!1,frozenLockfile:!1,ignoreScripts:r,lockfileOnly:!1,noOptional:!1,offline:!1,prod:!1,recursive:!1,silent:!1,workspaceRoot:!1},o,i)},Oe=async({argument:r,logger:i,options:e,visConfig:n,workspaceRoot:a})=>{let t=r;if(!t||t.length===0)throw new Error("No packages specified. Usage: vis add <packages...>");if(e.typosquatCheck!==!1){const f=t.map(u=>E(u)),m=await ae(f.map(u=>u.name),n?.security?.typosquatAllowlist);if(!m.ok){process.exitCode=1;return}t=f.map((u,k)=>{const h=m.packages[k];return h!==u.name?u.versionSpec?`${h}@${u.versionSpec}`:h??"":t[k]??""})}if(e.marshallCheck!==!1){const f=await _(t);if(f.length>0){const m=await Q(f,{config:n?.security?.marshalls,workspaceRoot:a});if(!await Z(m)){process.exitCode=1;return}}}if(e.socketCheck!==!1){const f=new Set;b("socket")&&f.add("socket"),b("depsDev")&&f.add("deps-dev");const m=B(n?.security,{disabled:f,minimumScore:n?.security?.policies?.score?.minimum});if(m.length>0){const u=n?.security?.policies?.score?.minimum??te;if(!await ge(t,m,u,n?.security?.acceptedRisks)){process.exitCode=1;return}}}const s=process.cwd(),o=J({options:e,visConfig:n},a??s),l=G(a??s,{backend:K(o),configBackend:n?.install?.backend,configCorepack:n?.install?.corepack}),c=!e.runScripts;if(e.to){if(e.global||e.workspaceRoot)throw new Error("--to is incompatible with --global / --workspace-root.");if(e.filter&&C(e.filter).length>0)throw new Error("--to and --filter are mutually exclusive — --to already targets one package.");if(!a)throw new Error("--to requires a monorepo workspace. Run from inside a pnpm/bun/yarn/npm workspace.");const f=await ye({ignoreScripts:c,logger:i,options:e,packages:t,pm:l,target:e.to,visConfig:n,workspaceRoot:a});f!==0&&(process.exitCode=f);return}const d=X(l,{exact:e.exact||!1,filter:C(e.filter),global:e.global||!1,optional:e.saveOptional||!1,packages:t,peer:e.savePeer||!1,saveDev:e.saveDev||!1,workspace:e.workspace||!1,workspaceRoot:e.workspaceRoot||!1},s,i,{autoInstallPeers:e.autoInstallPeers||!1,ignoreScripts:c});d!==0&&(process.exitCode=d)};export{Oe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as m,i}from"../packem_shared/pm-runner-
|
|
1
|
+
import{a as m,i}from"../packem_shared/pm-runner-CYsiSHYa.js";import{r as p,a as k}from"../packem_shared/command-runtime-DdnpiUmN.js";const w=async({argument:a,logger:n,options:t,visConfig:e,workspaceRoot:s})=>{const r=a?.[0]??null,c=s??process.cwd(),l=p({options:t,visConfig:e},c),d=m(c,{backend:k(l),configBackend:e?.install?.backend,configCorepack:e?.install?.corepack}),o=i(d,r,c,n);o!==0&&(process.exitCode=o)};export{w as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as w,j as b}from"../packem_shared/pm-runner-
|
|
1
|
+
import{a as w,j as b}from"../packem_shared/pm-runner-CYsiSHYa.js";import{r as f,a as g}from"../packem_shared/command-runtime-DdnpiUmN.js";const R=async({argument:a,logger:r,options:i,rawUnknown:l,visConfig:o,workspaceRoot:d})=>{const e=a;if(!e||e.length===0)throw new Error("No subcommand specified. Available: cache, publish, audit, list, view, config, whoami, login, logout, pack, owner, dist-tag, search, fund, ping, token, deprecate, rebuild, prune, plugin");const[m,...c]=e,s=l??[],p=s[0]==="--"?c:[...c,...s],n=d??process.cwd(),u=f({options:i,visConfig:o},n),k=w(n,{backend:g(u),configBackend:o?.install?.backend,configCorepack:o?.install?.corepack}),t=b(k,m,p,n,r);t!==0&&(process.exitCode=t)};export{R as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as d,k as f}from"../packem_shared/pm-runner-
|
|
1
|
+
import{a as d,k as f}from"../packem_shared/pm-runner-CYsiSHYa.js";import{r as i,a as p}from"../packem_shared/command-runtime-DdnpiUmN.js";import{m as g,t as v}from"../packem_shared/utils-DQFHJn72.js";const R=async({argument:t,logger:l,options:e,rawUnknown:n,visConfig:a,workspaceRoot:s})=>{const c=g(t,n);if(c.length===0)throw new Error("No packages specified. Usage: vis remove <packages...>");const r=process.cwd(),m=i({options:e,visConfig:a},s??r),k=d(s??r,{backend:p(m),configBackend:a?.install?.backend,configCorepack:a?.install?.corepack}),o=f(k,{filter:v(e.filter),global:e.global||!1,packages:c,recursive:e.recursive||!1,saveDev:e.saveDev||!1,workspaceRoot:e.workspaceRoot||!1},r,l);o!==0&&(process.exitCode=o)};export{R as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{readLastRunSummary as S,getLastRunSummaryPath as I}from"@visulima/task-runner";import{p as f}from"./cli-main.js";import{l as x,r as w}from"../packem_shared/run-summary-utils-
|
|
1
|
+
import{readLastRunSummary as S,getLastRunSummaryPath as I}from"@visulima/task-runner";import{p as f}from"./cli-main.js";import{l as x,r as w}from"../packem_shared/run-summary-utils-75paIrLB.js";import{d as $,a as m}from"../packem_shared/env-NauRSSEC.js";const T=new Set(["json","table"]),k=(t,e)=>t??e,h=t=>t===void 0?"-":t<1e3?`${String(t)}ms`:`${(t/1e3).toFixed(2)}s`,p=t=>t.exitCode===void 0?t.cacheStatus:t.exitCode===0?t.cacheStatus==="MISS"?"OK":t.cacheStatus:`FAIL(${String(t.exitCode)})`,s=(t,e)=>t.length>=e?t:t+" ".repeat(e-t.length),v=t=>t.exitCode!==void 0&&t.exitCode!==0,l=(t,e)=>{e.info(`Run ${t.id}`),e.info(` start: ${t.startTime}`),e.info(` end: ${t.endTime}`),e.info(` duration: ${h(t.duration)}`),e.info(` totals: ${String(t.stats.total)} total · ${String(t.stats.succeeded)} ok · ${String(t.stats.cached)} cached · ${String(t.stats.skipped)} skipped · ${String(t.stats.failed)} failed`),e.info(` env: node ${t.environment.nodeVersion} · ${t.environment.platform}/${t.environment.arch}`),e.info("")},C=(t,e)=>{if(t.length===0){e.info("(no tasks match the current filter)");return}const n=t.map(i=>({duration:h(i.duration),hash:i.hash?i.hash.slice(0,12):"-",status:p(i),taskId:i.taskId})),a={duration:Math.max(8,...n.map(i=>i.duration.length)),hash:Math.max(4,...n.map(i=>i.hash.length)),status:Math.max(6,...n.map(i=>i.status.length)),taskId:Math.max(4,...n.map(i=>i.taskId.length))};e.info(` ${s("task",a.taskId)} ${s("status",a.status)} ${s("duration",a.duration)} ${s("hash",a.hash)}`),e.info(` ${"-".repeat(a.taskId)} ${"-".repeat(a.status)} ${"-".repeat(a.duration)} ${"-".repeat(a.hash)}`);for(const i of n)e.info(` ${s(i.taskId,a.taskId)} ${s(i.status,a.status)} ${s(i.duration,a.duration)} ${s(i.hash,a.hash)}`)},R=(t,e,n)=>{l(t,n),n.info(`Task ${e.taskId}`),n.info(` status: ${p(e)}`),n.info(` cache: ${e.cacheStatus}`),n.info(` duration: ${h(e.duration)}`),n.info(` exit: ${e.exitCode===void 0?"-":String(e.exitCode)}`),n.info(` hash: ${e.hash??"(none)"}`),n.info(` start: ${e.startTime??"-"}`),n.info(` end: ${e.endTime??"-"}`),e.dependencies.length>0&&n.info(` deps: ${e.dependencies.join(", ")}`),n.info(""),f.info(`Drill into hash inputs with: vis cache why ${e.taskId} --run ${t.id}`)},D=t=>{process.stdout.write(`${JSON.stringify(t.map(e=>({id:e.id,mtime:new Date(e.mtimeMs).toISOString(),path:e.path})),void 0,2)}
|
|
2
2
|
`)},M=(t,e,n)=>{if(t.length===0){f.info(`No recorded runs found in ${m(e)}/. Run with --summarize to record a run.`);return}const a={id:Math.max(2,...t.map(i=>i.id.length)),mtime:24};n.info(` ${s("id",a.id)} ${s("mtime",a.mtime)}`),n.info(` ${"-".repeat(a.id)} ${"-".repeat(a.mtime)}`);for(const i of t)n.info(` ${s(i.id,a.id)} ${new Date(i.mtimeMs).toISOString()}`)},O=(t,e)=>{let{tasks:n}=t;return e.task!==void 0&&(n=n.filter(a=>a.taskId===e.task)),e.failed&&(n=n.filter(a=>v(a))),n},j=async(t,e)=>{const{failed:n,format:a,runId:i,task:o,workspaceRoot:d}=t,r=i===void 0?await S(d,{dataDirectory:$(d)}):await w(d,i);if(!r){if(a==="json"){process.stdout.write(`${JSON.stringify({error:"no-summary",runId:i??null},void 0,2)}
|
|
3
3
|
`),process.exitCode=1;return}i===void 0?f.error(`No previous run summary found. Run a task first to populate \`${I(d,{dataDirectory:$(d)})}\`.`):f.error(`Run summary "${i}" not found in ${m(d)}/.`),process.exitCode=1;return}const c=O(r,{failed:n,task:o});if(o!==void 0&&c.length===0){if(a==="json"){process.stdout.write(`${JSON.stringify({error:"task-not-in-summary",runId:r.id,taskId:o},void 0,2)}
|
|
4
4
|
`),process.exitCode=1;return}f.error(`Task "${o}" was not part of run ${r.id}.`),process.exitCode=1;return}if(r.stats.failed>0&&(process.exitCode=1),a==="json"){process.stdout.write(`${JSON.stringify({duration:r.duration,endTime:r.endTime,environment:r.environment,runId:r.id,startTime:r.startTime,stats:r.stats,tasks:c.map(u=>({cacheStatus:u.cacheStatus,dependencies:u.dependencies,duration:u.duration,endTime:u.endTime,exitCode:u.exitCode,hash:u.hash??null,startTime:u.startTime,taskId:u.taskId}))},void 0,2)}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createTaskGraph as $}from"@visulima/task-runner";import{d as b,b as O}from"../packem_shared/registry-
|
|
1
|
+
import{createTaskGraph as $}from"@visulima/task-runner";import{d as b,b as O}from"../packem_shared/registry-ClmannRw.js";import{f as P}from"../packem_shared/project-name-filter-CBEoY08a.js";import{r as S,f as E,a as G}from"../packem_shared/selectors-DZ4HDnlD.js";const T=(l,s,t)=>{const a=[],e=new Set,n=(r,u)=>{if(e.has(r))return;e.add(r);const m=s[r]??[];for(const d of m)n(d,u+1);const o=t[r],h=" ".repeat(u);a.push(`${h}${r}${o?.cache===!1?" (no-cache)":""}`)};for(const r of l)n(r,0);return a},x=(l,s,t)=>({roots:l,tasks:Object.fromEntries(Object.entries(t).map(([a,e])=>[a,{cache:e.cache,dependsOn:s[a]??[],outputs:e.outputs,parallelism:e.parallelism,projectRoot:e.projectRoot,target:e.target}]))}),C=async({argument:l,logger:s,options:t,process:a,visConfig:e,workspaceRoot:n})=>{const r=l[0];if(!r)throw new Error("Missing selector. Usage: vis action-graph <selector>");if(!n)throw new Error("Could not determine workspace root. Run inside a monorepo.");const{config:u,packageJsons:m,workspace:o}=b(n,e),h=O(n,o,m),d=await S(r,o,a.cwd,n),{target:f}=d;let i=d.projects;t.projects!==void 0&&(i=P(i,String(t.projects),Object.keys(o.projects))),t.query&&(i=E(i,o,t.query)),i=G(i,o,t.tag);const k=i.filter(p=>o.projects[p]?.targets?.[f]!==void 0);if(k.length===0){s.info(`No projects have a "${f}" target.`);return}const y=k.map(p=>{const g=o.projects[p],j=g.targets?.[f],v={project:p,target:f};return{cache:j?.cache,id:`${p}:${f}`,outputs:j?.outputs??[],overrides:{command:j?.command},parallelism:j?.parallelism,projectRoot:g.root,target:v}}),c=$(y,{projectGraph:h,targetDefaults:u.tasks,workspace:o});if(t.json){s.info(JSON.stringify(x(c.roots,c.dependencies,c.tasks),null,2));return}const w=T(c.roots,c.dependencies,c.tasks);s.info(`Execution plan (${Object.keys(c.tasks).length} task(s), ${c.roots.length} root(s)):`),s.info("");for(const p of w)s.info(p)};export{C as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{U as B,m as E}from"../packem_shared/index-
|
|
1
|
+
import{U as B,m as E}from"../packem_shared/index-zq6Ehql6.js";import{d as $,b as v}from"../packem_shared/registry-ClmannRw.js";import{p as f}from"./cli-main.js";import{o as S,s as g,f as C,b as O,a as D}from"../packem_shared/ecosystem-gate-DEnubRcS.js";import{h as F}from"../packem_shared/env-NauRSSEC.js";const w=["json","xml"],G=n=>w.includes(n),T=async({console:n,fs:x,options:e,visConfig:a,workspaceRoot:o})=>{if(!o)throw new Error("Could not determine workspace root. Run inside a monorepo.");const{packageJsons:h,workspace:i}=$(o,a),y=v(o,i,h),m=e.focus,b=m?m.split(",").map(r=>r.trim()).filter(Boolean):void 0,t=(e.format??"json").toLowerCase();if(!G(t))throw new Error(`Unknown --format: "${t}". Expected one of: ${w.join(", ")}.`);const d=S(a),p=g(C(o).filter(({id:r})=>!d.has(r)));p!==void 0&&n.error(p);const s=O({ecosystems:d,focus:b,includeDev:!!e.includeDev,projectGraph:y,workspace:i,workspaceRoot:o}),l=t==="xml"?D(s):`${JSON.stringify(s,void 0,2)}
|
|
2
2
|
`,u=e.output??(t==="xml"?"sbom.cdx.xml":"sbom.cdx.json");if(u==="-"){process.stdout.write(l);return}const c=B(o,u);F(E(c)),await x.writeFile(c,l,"utf8");const k=s.components?.length??0,j=s.dependencies?.length??0;f.success(`SBOM written to ${c}`),f.notice(`${k} components, ${j} dependency edges`)};export{T as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{createRequire as T}from"node:module";import"../packem_shared/index-
|
|
1
|
+
import{createRequire as T}from"node:module";import"../packem_shared/index-zq6Ehql6.js";import{o as A,d as I}from"../packem_shared/registry-ClmannRw.js";import{p as c,h as N}from"./cli-main.js";import{p as L,i as R,r as v,g as H,s as M,a as b,S as W,b as O,c as P,d as U,e as D}from"../packem_shared/lifecycle-Cn1mSP5f.js";import{r as q,l as z}from"../packem_shared/target-options-CsevVc7U.js";let C;const _=s=>(C??=T(import.meta.url))(s),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,j=s=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[e,r]=w.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return w.getBuiltinModule(s)}return _(s)},{open:E,stat:$,watch:F}=j("node:fs/promises"),h=async s=>{const e=s?.plugins;if(!e||e.length===0)return;const r=U();return await D(r,e),{callHook:async(d,...o)=>{try{await r.callHook(d,...o)}catch(t){const a=t instanceof Error?t.message:String(t);c.warn(`Plugin error in ${d}: ${a}`)}}}},V=s=>{const e=s.trim(),r=e.lastIndexOf(":");if(!(r<=0||r===e.length-1))return{project:e.slice(0,r),target:e.slice(r+1)}},y=async(s,e,r)=>{const d=V(r);if(!d){c.error(`Invalid target id "${r}". Expected "<project>:<target>", e.g. "@my/api:db".`);return}const o=await A(s,e),{projectOptions:t,workspace:a}=I(s,e,o),i=a.projects[d.project],n=t.get(d.project)?.[d.target];if(!i||!n){c.error(`Target "${r}" not found in this workspace.`);return}const p=n.options?.service;if(!p){c.error(`Target "${r}" is not a service. Add an \`options.service\` block to make it eligible for \`vis service\`.`);return}if(!n.command){c.error(`Target "${r}" has no command — services must be runnable.`);return}const g=q(s,i.root,n.options?.runFromWorkspaceRoot===!0),u=n.options?.envFile?z(g,n.options.envFile):{};return{command:n.command,cwd:g,env:{...u,...p.env},service:p,target:n,targetId:r}},m=s=>{if(!s)throw new Error("Could not determine workspace root. Run `vis service` inside a workspace.");return s},re=async({argument:s,options:e,visConfig:r,workspaceRoot:d})=>{const o=m(d),t=s[0]?.trim();if(!t){c.error("Missing target id. Usage: vis service start <project>:<target>"),process.exitCode=1;return}const a=await y(o,r,t);if(!a){process.exitCode=1;return}try{const{entry:i}=await b({command:a.command,config:a.service,cwd:a.cwd,env:a.env,id:t,readinessTimeoutMs:e.timeout,skipReadiness:e.readiness===!1,workspaceRoot:o});await(await h(r))?.callHook("service:start",i),c.success(`Started ${t} (pid ${String(i.pid)})`),c.info(` log: ${i.logFile}`)}catch(i){const n=i instanceof Error?i.message:String(i);i instanceof W?c.error(`Readiness probe failed for ${t}: ${n}`):c.error(`Failed to start ${t}: ${n}`),process.exitCode=1}},S=async({graceMs:s,hookSink:e,id:r,workspaceRoot:d})=>{const o=await v(d,r),{stopped:t}=await M({graceMs:s,id:r,workspaceRoot:d});return t?(o&&await e?.callHook("service:stop",o),c.success(`Stopped ${r}`),!0):(c.info(`No running service registered for ${r}`),!1)},se=async({argument:s,options:e,visConfig:r,workspaceRoot:d})=>{const o=m(d),{graceMs:t}=e,a=s[0]?.trim(),i=await h(r);if(e.all){if(a){c.error("Cannot combine --all with a target id. Use one or the other."),process.exitCode=1;return}const p=await P(o);if(p.length===0){c.info("No running services registered for this workspace.");return}for(const g of p)await S({graceMs:t,hookSink:i,id:g.id,workspaceRoot:o});return}if(!a){c.error("Missing target id. Usage: vis service stop <project>:<target> | --all"),process.exitCode=1;return}await S({graceMs:t,hookSink:i,id:a,workspaceRoot:o})||(process.exitCode=1)},B=s=>{const e=s.config.readiness?.tcp.port??s.config.port;return e===void 0?"—":String(e)},x=new Set(["json","table"]),oe=async({logger:s,options:e,workspaceRoot:r})=>{const d=m(r),o=e.format??"table";if(!x.has(o)){c.error(`Invalid --format "${o}". Expected one of: ${[...x].sort().join(", ")}.`),process.exitCode=1;return}const{surviving:t}=await L(d);if(o==="json"){const l=Date.now();process.stdout.write(`${JSON.stringify(t.map(f=>{const k=Date.parse(f.startedAt);return{ageMs:Number.isFinite(k)?l-k:null,alive:R(f.pid),command:f.command,cwd:f.cwd,env:f.env,id:f.id,logFile:f.logFile,pid:f.pid,port:f.config.readiness?.tcp.port??f.config.port??null,startedAt:f.startedAt,visVersion:f.visVersion}}),void 0,2)}
|
|
2
2
|
`);return}if(t.length===0){c.info("No running services registered for this workspace.");return}const a=Date.now(),i=t.map(l=>{const f=Date.parse(l.startedAt);return{age:Number.isFinite(f)?N(f,a):"?",id:l.id,log:l.logFile,pid:String(l.pid),port:B(l)}}),n=Math.max(2,...i.map(l=>l.id.length)),p=Math.max(3,...i.map(l=>l.pid.length)),g=Math.max(4,...i.map(l=>l.port.length)),u=Math.max(3,...i.map(l=>l.age.length));s.info(` ${"id".padEnd(n)} ${"pid".padEnd(p)} ${"port".padEnd(g)} ${"age".padEnd(u)} log`),s.info(` ${"-".repeat(n)} ${"-".repeat(p)} ${"-".repeat(g)} ${"-".repeat(u)} ---`);for(const l of i)s.info(` ${l.id.padEnd(n)} ${l.pid.padEnd(p)} ${l.port.padEnd(g)} ${l.age.padEnd(u)} ${l.log}`)},ie=async({argument:s,options:e,workspaceRoot:r})=>{const d=m(r),o=s[0]?.trim();if(!o){c.error("Missing target id. Usage: vis service status <project>:<target>"),process.exitCode=1;return}const t=await v(d,o);if(!t){c.error(`No service registered for ${o}.`),process.exitCode=1;return}if(!R(t.pid)){c.error(`Service ${o} is not running (pid ${String(t.pid)} is dead). Run \`vis service start ${o}\` to recover.`),process.exitCode=1;return}try{await O(t.config,{timeoutMs:e.timeout}),c.success(`${o} healthy (pid ${String(t.pid)})`)}catch(a){const i=a instanceof Error?a.message:String(a);c.error(`${o} probe failed: ${i}`),process.exitCode=1}},ae=async({argument:s,options:e,visConfig:r,workspaceRoot:d})=>{const o=m(d),t=s[0]?.trim();if(!t){c.error("Missing target id. Usage: vis service restart <project>:<target>"),process.exitCode=1;return}const a=await h(r),i=await v(o,t);(await M({graceMs:e.graceMs,id:t,workspaceRoot:o})).stopped&&i&&await a?.callHook("service:stop",i);const p=await y(o,r,t);if(!p){process.exitCode=1;return}try{const{entry:g}=await b({command:p.command,config:p.service,cwd:p.cwd,env:p.env,id:t,readinessTimeoutMs:e.timeout,skipReadiness:e.readiness===!1,workspaceRoot:o});await a?.callHook("service:start",g),c.success(`Restarted ${t} (pid ${String(g.pid)})`)}catch(g){const u=g instanceof Error?g.message:String(g);c.error(`Failed to restart ${t}: ${u}`),process.exitCode=1}},G=200,J=1024*1024,K=async s=>{let e=0;try{e=(await $(s)).size}catch{e=0}const r=new AbortController;let d=!1;const o=()=>{d=!0,r.abort()},t=()=>{r.abort()};process.on("SIGINT",o),process.on("SIGTERM",t);let a=!1;const i=async()=>{if(!a){a=!0;try{const n=await $(s).catch(()=>{});if(!n||(n.size<e&&(e=0),n.size===e))return;const p=n.size-e,g=Math.min(p,J),u=await E(s,"r");try{const l=Buffer.alloc(g);await u.read(l,0,g,e),process.stdout.write(l),e+=g}finally{await u.close().catch(()=>{})}}finally{a=!1}}};try{const n=(async()=>{try{const p=F(s,{signal:r.signal});for(;!(await p.next()).done;)await i()}catch{}})();for(;!r.signal.aborted;)await i(),await new Promise(p=>{const g=setTimeout(p,G);r.signal.addEventListener("abort",()=>{clearTimeout(g),p()},{once:!0})});await n.catch(()=>{}),await i().catch(()=>{})}finally{process.off("SIGINT",o),process.off("SIGTERM",t)}d&&(process.exitCode=130)},ne=async({argument:s,options:e,workspaceRoot:r})=>{const d=m(r),o=s[0]?.trim();if(!o){c.error("Missing target id. Usage: vis service logs <project>:<target>"),process.exitCode=1;return}const t=await v(d,o);if(!t){c.error(`No service registered for ${o}.`),process.exitCode=1;return}if(!await H(t.logFile)){c.warn(`Log file is missing for ${o}: ${t.logFile}`),process.exitCode=1;return}if(e.follow){await K(t.logFile);return}const a=await E(t.logFile,"r");try{const i=a.createReadStream();await new Promise((n,p)=>{i.on("end",n),i.on("error",p),i.pipe(process.stdout,{end:!1})})}finally{await a.close().catch(()=>{})}};export{oe as serviceListExecute,ne as serviceLogsExecute,ae as serviceRestartExecute,re as serviceStartExecute,ie as serviceStatusExecute,se as serviceStopExecute};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as p}from"node:module";import{m as f,e as l}from"../packem_shared/index-
|
|
1
|
+
import{createRequire as p}from"node:module";import{m as f,e as l}from"../packem_shared/index-zq6Ehql6.js";import{n as y}from"./cli-main.js";let v;const g=e=>(v??=p(import.meta.url))(e),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=e=>{if(typeof a<"u"&&a.versions&&a.versions.node){const[s,t]=a.versions.node.split(".").map(Number);if(s>22||s===22&&t>=3||s===20&&t>=16)return a.getBuiltinModule(e)}return g(e)},{chmodSync:$}=d("node:fs"),{createRequire:_}=d("node:module"),m=["npm","npx","pnpm","pnpx","yarn","yarnpkg"],o=process.platform==="win32",h=e=>l(e.process.cwd,".vis","shims"),P=async(e,s)=>{const t=async u=>e.fs.stat(u).then(()=>!0).catch(()=>!1),i=process.env.VIS_NATIVE_BIN;if(i!==void 0&&i!==""&&await t(i))return i;const c=o?"vis-native-cli.exe":"vis-native-cli",n=l(s,c);if(await t(n))return n;const r=y();if(r!==void 0)try{return _(import.meta.url).resolve(`@visulima/vis-binding-${r}/${c}`)}catch{return}},T=(e,s,t,i)=>o?t===void 0?`@echo off\r
|
|
2
2
|
"${e}" "${s}" __pm-shim ${i} %*\r
|
|
3
3
|
`:`@echo off\r
|
|
4
4
|
if exist "${t}" (\r
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as v}from"../packem_shared/index.server-Ca_EEVfw.js";import{v as R,e as y}from"../packem_shared/index-
|
|
1
|
+
import{F as v}from"../packem_shared/index.server-Ca_EEVfw.js";import{v as R,e as y}from"../packem_shared/index-zq6Ehql6.js";import{d as j}from"../packem_shared/registry-ClmannRw.js";import{a as C,b as g,s as x,i as B,c as D,p as P,d as E,r as N,e as A}from"../packem_shared/subtree-DtmcKAJK.js";import{s as W,n as k}from"../packem_shared/utils-DQFHJn72.js";const z=async(u,m,t)=>{const e=m[u];if(e?.root)return{pkgName:u,relativeDir:k(e.root)};const o=k(u);if(o.length>0&&await t(o))return{pkgName:o.split("/").pop()??o,relativeDir:o}},K=async({argument:u,fs:m,logger:t,options:e,process:o,visConfig:h,workspaceRoot:b})=>{const p=u[0];if(!p)throw new Error("Missing <package>. Pass a project name or a workspace-relative path.");if(!e.dryRun&&!e.output)throw new Error("Missing --output <dir>. Pass the destination directory for the new repo (or use --dry-run).");const r=b??o.cwd;C(r);const{workspace:$}=j(r,h),w=async i=>{try{return await m.access(i),!0}catch{return!1}},l=await z(p,$.projects,i=>w(y(r,i,"package.json")));if(!l){const i=Object.keys($.projects).sort().join(", ");throw new Error(`Unknown package "${p}". Known projects: ${i||"(none)"}.`)}const{pkgName:f,relativeDir:n}=l,s=e.branch??h?.defaultBase??"main",d=`vis/split/${W(n.replaceAll("/","-"))}`,c=e.output?R(e.output)?e.output:y(r,e.output):void 0;if(e.dryRun){t.info("Dry run — no changes will be made. Planned git commands:"),t.info(` git subtree split --prefix=${n}${e.annotate?` --annotate=(${f}) `:""} -b ${d}`),c&&(t.info(` git -C ${c} init -b ${s}`),t.info(` git -C ${c} pull ${r} ${d}`)),e.remote&&t.info(` git -C ${c??"<output>"} remote add origin ${e.remote}`),e.push&&t.info(` git -C ${c??"<output>"} push -u origin ${s}`),e.remove&&t.info(` git rm -r ${n} && git commit (in ${r})`);return}const a=c;if(await w(a)){if((await m.readdir(a)).length>0&&!e.force)throw new Error(`${a} is not empty. Re-run with --force to use it anyway.`)}else await m.mkdir(a,{recursive:!0});e.remove&&g(r),t.info(`Splitting ${v(n)} → ${a} ...`);try{x({annotate:e.annotate?`(${f}) `:void 0,branch:d,cwd:r,prefix:n}),B({branch:s,source:r,sourceBranch:d,target:a}),e.remote?(D("origin",e.remote,a),e.push&&P("origin",s,a)):e.push&&t.warn("--push ignored: no --remote provided.");const i=E(s,a);t.info(`✓ Extracted ${f} with ${i} commit(s) to ${a}`),e.remove&&(N(n,`chore(${f}): split out to standalone repo`,r),t.info(`✓ Removed ${n} from the monorepo (committed).`)),e.remote||t.info(v(`Next: cd ${a} && git remote add origin <url> && git push -u origin ${s}`))}finally{try{A(d,r)}catch{}}};export{K as default,z as resolvePackageDirectory};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{F as T,J as a,b as S,X as y}from"../packem_shared/index.server-Ca_EEVfw.js";import{e as V}from"../packem_shared/index-
|
|
1
|
+
import{F as T,J as a,b as S,X as y}from"../packem_shared/index.server-Ca_EEVfw.js";import{e as V}from"../packem_shared/index-zq6Ehql6.js";import{enforceProjectConstraints as v}from"@visulima/task-runner";import{d as x,b as J}from"../packem_shared/registry-ClmannRw.js";import{j as w}from"./cli-main.js";import{c as z}from"../packem_shared/runtime-check-Yl8-Awkf.js";import{a as D}from"../packem_shared/env-NauRSSEC.js";import{y as G}from"../packem_shared/isAccessibleSync-DYKTrrvc-CKahNmLy.js";import{p as H}from"../packem_shared/package-version-BOK3IncQ.js";const e=c=>c?a("✓"):y("✗"),N=async({fs:c,logger:t,options:b,visConfig:g,workspaceRoot:n})=>{if(!n)throw new Error("Could not determine workspace root.");const{config:h,packageJsons:C,workspace:f}=x(n,g),O=J(n,f,C),k=Object.keys(f.projects).length,$=new Set(Object.values(f.projects).flatMap(d=>Object.keys(d.targets??{}))).size,i=z(n);let s=0;h.constraints&&(s=v(O,h.constraints).length);const o=w(n,{minRuns:2});let r;const l=D(n);if(G(l)){const F=(await c.readdir(l)).filter(u=>u.endsWith(".json")).sort();let p=0,j=0;for(const u of F.slice(-20))try{const m=H(V(l,u));m.stats&&(p+=m.stats.total??0,j+=m.stats.cached??0)}catch{continue}p>0&&(r=`${(j/p*100).toFixed(0)}%`)}if(b.json){t.info(JSON.stringify({cacheHitRate:r??null,constraintViolations:s,flakyTasks:o.length,projects:k,runtimeIssues:i.length,targets:$},null,2));return}t.info(""),t.info(` ${T("VIS STATUS")}`),t.info(""),t.info(` ${e(!0)} ${String(k)} projects · ${String($)} unique targets`),t.info(` ${e(i.length===0)} Runtime: ${i.length===0?a("OK"):S(`${String(i.length)} issue(s)`)}`),t.info(` ${e(s===0)} Constraints: ${s===0?a("OK"):y(`${String(s)} violation(s)`)}`),t.info(` ${e(o.length===0)} Flaky tasks: ${o.length===0?a("none"):S(String(o.length))}`),r&&t.info(` ${e(!0)} Cache hit rate: ${r} (last 20 runs)`),t.info("")};export{N as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createTaskGraph as m}from"@visulima/task-runner";import{d as b,b as v}from"../packem_shared/registry-
|
|
1
|
+
import{createTaskGraph as m}from"@visulima/task-runner";import{d as b,b as v}from"../packem_shared/registry-ClmannRw.js";const y=(a,t)=>{const s=new Map;for(const[i,o]of Object.entries(a.dependencies))for(const p of o){const c=s.get(p)??[];c.push(i),s.set(p,c)}if(!a.tasks[t])return;const r=new Set([t]),e=[{node:t,path:[t]}];for(;e.length>0;){const i=e.shift();if(a.roots.includes(i.node))return i.path;for(const o of s.get(i.node)??[])r.has(o)||(r.add(o),e.push({node:o,path:[o,...i.path]}))}return[t]},E=(a,t)=>{const s=[];for(const[r,e]of Object.entries(a.dependencies))e.includes(t)&&s.push(r);return s.sort()},I=async({argument:a,logger:t,visConfig:s,workspaceRoot:r})=>{if(!r)throw new Error("Could not determine workspace root.");const e=a[0];if(!e)throw new Error("No task ID specified. Usage: vis task-why <project>:<target>");if(!e.includes(":"))throw new Error(`Invalid task ID "${e}" — expected format "project:target".`);const{packageJsons:i,workspace:o}=b(r,s),p=v(r,o,i),[c,j]=e.split(":",2),$=o.projects[c];if(!$)throw new Error(`Unknown project "${c}".`);if(!$.targets?.[j])throw new Error(`Project "${c}" has no target "${j}".`);const l=Object.entries(o.projects).flatMap(([n,w])=>Object.keys(w.targets??{}).map(d=>({id:`${n}:${d}`,outputs:[],overrides:{},target:{project:n,target:d}}))),f=m(l,{projectGraph:p,workspace:o});if(!f.tasks[e])throw new Error(`Task "${e}" is not reachable in the graph.`);const h=y(f,e),u=E(f,e);if(t.info(""),t.info(`Why ${e}?`),t.info(""),h&&h.length>1){t.info("Shortest path from a root to this task:");for(const[n,w]of h.entries()){const d=n===0?" ":`${" ".repeat(n+1)}└─ `;t.info(`${d}${w}`)}t.info("")}else t.info(" This task is itself a root — nothing upstream depends on it."),t.info("");if(u.length>0){t.info(`Directly depended on by ${u.length} task(s):`);for(const n of u)t.info(` - ${n}`);t.info("")}const k=f.dependencies[e]??[];if(k.length>0){t.info(`This task depends on ${k.length} task(s):`);for(const n of[...k].sort())t.info(` - ${n}`);t.info("")}};export{I as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as M}from"node:module";import{F as g,J as k,X as A,b as W}from"../packem_shared/index.server-Ca_EEVfw.js";import{e as S}from"../packem_shared/index-
|
|
1
|
+
import{createRequire as M}from"node:module";import{F as g,J as k,X as A,b as W}from"../packem_shared/index.server-Ca_EEVfw.js";import{e as S}from"../packem_shared/index-zq6Ehql6.js";import{p as o}from"./cli-main.js";import{c as B}from"../packem_shared/env-consistency-Cl1Rg65z.js";import{p as O,g as w,S as x,w as j,b as R,a as q,f as C,c as _,d as H,u as b,e as K,h as L}from"../packem_shared/toolchain-BvluBdrw.js";let I;const F=e=>(I??=M(import.meta.url))(e),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,N=e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[n,i]=h.versions.node.split(".").map(Number);if(n>22||n===22&&i>=3||n===20&&i>=16)return h.getBuiltinModule(e)}return F(e)},{spawnSync:U}=N("node:child_process"),y=["aube","bun","go","node","npm","pnpm","python","ruby","rust","yarn"],D=e=>y.includes(e),v=e=>e?k("✓"):A("✗"),E=W("⚠"),J=e=>{if(e.installed){const n=e.version?` v${e.version}`:"",i=e.configFiles.length>0?` (${e.configFiles.join(", ")})`:"";return`${v(!0)} ${e.name}${n}${i}`}return`${E} ${e.name} — referenced by ${e.configFiles.join(", ")} but not installed`},z=e=>{if(e.matches)return"";const{manager:n}=e;return n.name==="none"?g("→ (no manager)"):n.name==="self-activate"?"":n.installed?g(`→ ${n.name}`):g(`→ ${n.name} (missing)`)},G=e=>e.matches?v(!0):e.actual?E:v(!1),X=e=>{if(o.info(""),o.info(g("── Toolchain ───────────────────────")),e.detected.length===0)o.info(` ${v(!1)} No version manager detected`),o.notice(` Install one of: ${x.join(", ")}`);else for(const n of e.detected)o.info(` ${J(n)}`);if(o.info(""),e.tools.length===0){o.info(` ${g("No tool pins found — add engines.node, .nvmrc, or a manager config file.")}`);return}o.info(g("── Tools ───────────────────────────"));for(const n of e.tools){const i=`${n.expected.tool} ${n.expected.version}`,a=n.actual?`actual ${n.actual}`:"not installed",l=n.matches?"":g(` [${n.expected.source}]`),t=z(n),s=t===""?"":` ${t}`;o.info(` ${G(n)} ${i} — ${a}${l}${s}`),n.manager.note&&o.notice(` ${n.manager.note}`)}},Q=(e,n,i)=>{const a=w(e,n),l=B(e).filter(s=>s.status==="warn").map(s=>s.message);if(i.json){process.stdout.write(`${JSON.stringify({declarationWarnings:l,detected:a.detected.map(s=>({binPath:s.binPath??null,configFiles:s.configFiles,installed:s.installed,name:s.name,version:s.version??null})),tools:a.tools.map(s=>({actual:s.actual??null,expected:s.expected.version,manager:s.manager.name,managerInstalled:s.manager.installed,matches:s.matches,note:s.manager.note??null,source:s.expected.source,tool:s.expected.tool}))},void 0,2)}
|
|
2
2
|
`);return}if(X(a),l.length>0){o.info("");for(const s of l)o.warn(` ${s}`)}const t=a.tools.filter(s=>!s.matches);t.length>0&&(o.info(""),o.notice(" Run `vis toolchain install` to install pinned versions.")),i.exitCode&&t.length>0&&(process.exitCode=1)},V=e=>{const n=new Map;for(const i of e){const a=n.get(i.manager.name);a?a.push(i):n.set(i.manager.name,[i])}return n},P=(e,n,i)=>U(e,n,{cwd:i,stdio:"inherit"}).status??1,Y=(e,n,i)=>{const a=w(e,n),l=a.tools.filter(d=>!d.matches);if(l.length===0){o.success("Everything already matches — nothing to install.");return}const t=l.some(d=>d.manager.name!=="self-activate"&&d.manager.name!=="none");if(a.detected.length===0&&t){o.error(`No version manager detected. Install one of: ${x.join(", ")}.`),process.exitCode=1;return}const s=V(l);let u=!1,c=0;for(const[d,f]of s){if(d==="self-activate"){for(const{expected:r}of f){if(r.source==="packageManager")o.info(`${g("$")} (${r.tool} will self-activate from the package.json pin on next invocation)`);else if(o.info(`${g("$")} Pinning ${r.tool}@${r.version} in package.json`),i.dryRun)u=!0;else try{j(e,r),u=!0}catch(p){o.error(p.message),c=1}o.notice(` ${r.tool} ${r.version} — no install needed`)}continue}if(d==="none"){for(const{expected:r}of f)o.warn(`Cannot install ${r.tool} ${r.version} — no manager can handle it.`);c=1;continue}if(!a.detected.find(r=>r.name===d)?.installed){o.error(`${d} is referenced but not on PATH — install it first, then rerun \`vis toolchain install\`.`),c=1;continue}const T=f.map(r=>R(d,r.expected)).filter(Boolean);for(const r of T){if(!r)continue;if(r.bin==="nvm"&&r.args.length===0){o.error("nvm is a shell function — run `nvm install` in your shell, then rerun `vis toolchain install`."),r.hint&&o.notice(` ${r.hint}`),c=1;continue}if(o.info(`${g("$")} ${r.bin} ${r.args.join(" ")}`),r.hint&&o.notice(` ${r.hint}`),i.dryRun){u=!0;continue}const p=P(r.bin,r.args,e);if(u=!0,p!==0){c=p;break}}}if(c!==0){process.exitCode=c;return}u&&o.success("Toolchain installed.")},Z=async(e,n,i,a,l)=>{if(!a)throw new Error("Usage: vis toolchain use <tool>@<version> (e.g. vis toolchain use node@22.13.0)");const t=q(a);if(!t)throw new Error(`Could not parse "${a}". Expected "<tool>@<version>" where <tool> is one of ${y.join(", ")}.`);const s=C(n),u=_(t,s,i);if(u.name==="none"){o.error(`No manager can pin ${t.tool}. Install one of: ${x.join(", ")}.`),process.exitCode=1;return}if(!u.installed){o.error(`The best manager for ${t.tool} (${u.name}) is not on PATH. ${u.note??""}`),process.exitCode=1;return}const c=H(u.name,t);if(!c){o.error(`${u.name} cannot pin ${t.tool}. Use a different manager, or set \`toolchain.tools.${t.tool}\` in vis.config.ts.`),process.exitCode=1;return}if(u.name==="self-activate"){if(o.info(`${g("→")} Pinning the version in package.json...`),l.dryRun){o.notice(` Would pin ${t.tool}@${t.version} in package.json`);return}try{const f=j(n,t);if(!f){o.error(`Refusing to pin non-package-manager tool ${t.tool} in package.json.`),process.exitCode=1;return}if(o.success(`Pinned ${f} in package.json — ${t.tool} will activate this version on next invocation.`),l.engines!==!1){const m=b(n,t);m&&o.success(`Updated package.json engines.${t.tool} → ${m}.`)}}catch(f){o.error(f.message),process.exitCode=1}return}if(c.args.length===0&&u.name==="nvm"&&t.tool==="node"){const f=S(n,".nvmrc");if(o.info(`${g("→")} Writing ${f}...`),l.dryRun){o.notice(` Would write ${t.version} to .nvmrc`);return}try{await e.writeFile(f,`${t.version}
|
|
3
3
|
`)}catch(m){o.error(`Failed to write .nvmrc: ${m.message}`),process.exitCode=1;return}o.success(`Wrote ${t.version} to .nvmrc.`),o.notice(" nvm is a shell function — run `nvm use` to activate it in this shell.");return}if(c.args.length===0){o.error(`${u.name} cannot pin ${t.tool} from a subprocess. ${c.configChange?.hint??""}`),c.configChange&&o.notice(` Edit ${c.configChange.file} by hand and rerun \`vis toolchain status\` to verify.`),process.exitCode=1;return}if(o.info(`${g("$")} ${c.bin} ${c.args.join(" ")}`),c.configChange&&o.notice(` Will update ${c.configChange.file} — ${c.configChange.hint}`),l.dryRun)return;const d=P(c.bin,c.args,n);if(d!==0){process.exitCode=d;return}if(o.success(`Pinned ${t.tool} to ${t.version}.`),l.engines!==!1)try{const f=b(n,t);f&&o.success(`Updated package.json engines.${t.tool} → ${f}.`)}catch(f){o.warn(`Could not update engines.${t.tool}: ${f.message}`)}},ee=(e,n,i)=>{if(!i)throw new Error("Usage: vis toolchain which <tool> (e.g. vis toolchain which node)");const a=i.toLowerCase();if(!D(a))throw new Error(`Unknown tool "${i}". Known: ${y.join(", ")}.`);const l=C(e),t=_({source:"vis.config.ts",tool:a,version:"*"},l,n),s=t.installed&&t.name!=="self-activate"&&t.name!=="none"?l.find(c=>c.name===t.name):void 0,u=s?K(s,a):L(a);if(!u){o.error(`${i} not found in PATH${s?` or via ${s.name}`:""}.`),process.exitCode=1;return}process.stdout.write(`${u}
|
|
4
4
|
`)},ne=(e,n)=>{const i=O(e,n);process.stdout.write(`${i.name}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as k,l as p}from"../packem_shared/pm-runner-
|
|
1
|
+
import{a as k,l as p}from"../packem_shared/pm-runner-CYsiSHYa.js";import{r as i,a as u}from"../packem_shared/command-runtime-DdnpiUmN.js";import{m as f}from"../packem_shared/utils-DQFHJn72.js";const b=async({argument:s,logger:o,options:c,rawUnknown:n,visConfig:e,workspaceRoot:t})=>{const l=f(s,n),a=t??process.cwd(),m=i({options:c,visConfig:e},a),d=k(a,{backend:u(m),configBackend:e?.install?.backend,configCorepack:e?.install?.corepack}),r=p(d,l,c.recursive||!1,a,o);r!==0&&(process.exitCode=r)};export{b as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as u}from"node:module";import{g as m}from"../packem_shared/package-version-
|
|
1
|
+
import{createRequire as u}from"node:module";import{g as m}from"../packem_shared/package-version-BOK3IncQ.js";let a;const f=t=>(a??=u(import.meta.url))(t),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=t=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[e,s]=r.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return r.getBuiltinModule(t)}return f(t)},{execSync:l,spawnSync:p}=d("node:child_process"),y=async({argument:t,logger:e,options:s})=>{const o=t?.[0];e.info("info: checking for updates...");const i=m();let n;try{const c=l("npm view @visulima/vis version",{encoding:"utf8"}).trim();n=o??c}catch{throw new Error("Failed to query npm registry. Check your network connection.")}if(i===n&&!s.force){e.info(`
|
|
2
2
|
✓ Already up to date (${i})`);return}if(s.check){i===n?e.info(`✓ Already up to date (${i})`):e.info(`info: found @visulima/vis@${n} (current: ${i})`);return}if(e.info(`info: found @visulima/vis@${n} (current: ${i})`),e.info("info: installing..."),p("npm",["install","-g",`@visulima/vis@${n}`],{encoding:"utf8",stdio:"inherit"}).status!==0)throw new Error("Failed to update. Try running with sudo or fix npm permissions.");e.info(`
|
|
3
3
|
✓ Updated @visulima/vis from ${i} → ${n}`)};export{y as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as g,m as p}from"../packem_shared/pm-runner-
|
|
1
|
+
import{a as g,m as p}from"../packem_shared/pm-runner-CYsiSHYa.js";import{r as k,a as i}from"../packem_shared/command-runtime-DdnpiUmN.js";import{m as u,t as b}from"../packem_shared/utils-DQFHJn72.js";const y=async({argument:c,logger:d,options:e,process:o,rawUnknown:t,visConfig:a,workspaceRoot:n})=>{const s=u(c,t);if(s.length===0)throw new Error("No packages specified. Usage: vis why <package...>");const r=n??o.cwd,f=k({options:e,visConfig:a},r),m=g(r,{backend:i(f),configBackend:a?.install?.backend,configCorepack:a?.install?.corepack}),l=p(m,{depth:e.depth===void 0?void 0:Number(e.depth),dev:e.dev||!1,filter:b(e.filter),global:e.global||!1,json:e.json||!1,long:e.long||!1,noOptional:e.optional===!1,packages:s,parseable:e.parseable||!1,prod:e.prod||!1,recursive:e.recursive||!1},r,d);l!==0&&l!==1&&(process.exitCode=l)};export{y as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{e as C}from"../packem_shared/index-
|
|
1
|
+
import{e as C}from"../packem_shared/index-zq6Ehql6.js";import{r as P}from"./cli-main.js";import{d as b,b as x}from"../packem_shared/registry-ClmannRw.js";import{V as n}from"../packem_shared/vis-user-error-DhgW3DzD.js";import{s as D}from"../packem_shared/affected-selection-CJnDzyIK.js";import{f as I,a as R}from"../packem_shared/selectors-DZ4HDnlD.js";const v=(r,e)=>{if(r.length>0)return[...r];const a=e.indexOf("affected",2);return a===-1?[]:e.slice(a+1)},T=async({argument:r,options:e,process:a,rawArgv:u,runtime:h,visConfig:s,workspaceRoot:i})=>{if(!r[0])throw new n("Missing target. Usage: vis affected <target>");if(!i)throw new n("Could not determine workspace root. Run this command inside a monorepo.");if(e.sparseCheckout){if(e.depsOnly||e.skipDeps)throw new n("--sparse-checkout only prints project roots; --deps-only / --skip-deps do not apply to it.");const c=i,{config:d,fileOwners:l,packageJsons:g,workspace:t}=b(c,s),w=x(c,t,g),k=d.taskRunner??{},j=P({branchScopedCache:d.branchScopedCache,configCacheDir:k.cacheDirectory,optionsCacheDir:void 0,sharedWorktreeCache:d.sharedWorktreeCache,workspaceRoot:c}),y=await D({base:e.base,downstream:e.downstream,head:e.head,uncommitted:e.uncommitted,upstream:e.upstream},{fileOwners:l,namedInputs:s?.namedInputs,projectGraph:w,projects:t.projects,workspaceRoot:c},{affectedIgnore:s?.affectedIgnore,defaultBase:s?.defaultBase,externalInputStatePath:C(j,"external-inputs.json")});let f=I(y.affectedProjects,t,e.query);f=R(f,t,e.tag);const p=[...new Set(f.map(m=>t.projects[m]?.root??m))].sort();process.stdout.write(p.length>0?`${p.join(`
|
|
2
2
|
`)}
|
|
3
|
-
`:"");return}const
|
|
3
|
+
`:"");return}const o=v(u??[],a?.argv??[]);if(o.length===0)throw new n("Missing target. Usage: vis affected <target>");await h.runCommand("run",{argv:o.includes("--affected")?o:[...o,"--affected"]})};export{T as default,v as forwardedArgv};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as d,U as u}from"../packem_shared/index-
|
|
1
|
+
import{v as d,U as u}from"../packem_shared/index-zq6Ehql6.js";import{r as w}from"../packem_shared/command-runtime-DdnpiUmN.js";import{r as v}from"../packem_shared/run-file-BKXvoVj2.js";const F=async({argument:t,options:r,rawUnknown:i,visConfig:c,workspaceRoot:n})=>{const a=t??[],[o,...m]=a;if(o===void 0)throw new Error("No file specified. Usage: vis x <file> [args...]");const s=process.cwd(),f=d(o)?o:u(s,o),p=[...m,...i??[]],{runtime:l}=w({options:r,visConfig:c},n??s),e=await v(f,p,l,s);e!==0&&(process.exitCode=e)};export{F as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{releaseChangelog as i}from"../packem_shared/ReleaseClient-
|
|
1
|
+
import{releaseChangelog as i}from"../packem_shared/ReleaseClient-CqGLb7S4.js";const f=async({logger:e,options:t,workspaceRoot:r})=>{const s=r??process.cwd(),c=t.filter?t.filter.split(",").map(n=>n.trim()).filter(Boolean):void 0,o=await i({channel:t.channel,cwd:s,projects:c});if(t.json){process.stdout.write(`${JSON.stringify(o,null,2)}
|
|
2
2
|
`),o.projectChangelogs.length===0&&(process.exitCode=1);return}if(o.projectChangelogs.length===0){e.info("No pending releases — no changelog entries to render."),process.exitCode=1;return}for(const n of o.projectChangelogs)e.info(`# ${n.package} → ${n.file}`),e.info(""),e.info(n.content),e.info("")};export{f as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{O as R}from"./cli-main.js";import{v as x,r as V,f as N}from"../packem_shared/ai-analysis-
|
|
1
|
+
import{O as R}from"./cli-main.js";import{v as x,r as V,f as N}from"../packem_shared/ai-analysis-DHlzow2O.js";import{p as $,g as T,e as M,a as C,f as O}from"../packem_shared/registry-ClmannRw.js";import{readCatalogs as S,fetchPackageVersions as j}from"./catalog.js";import{f as z}from"../packem_shared/osv-dvIA_vX3.js";const F=/^[\^~>=<]+/,B=async({argument:E,logger:s,options:i,visConfig:c,workspaceRoot:l})=>{if(!l)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const p=E,e=p[0];if(!e)throw new Error("Package name is required. Usage: vis analyze <package> [version]");const u=p[1],{packageManager:A}=R(l);let r,m="default";const b=S(l,A);for(const[t,h]of b){const n=h.get(e);if(n){r=n,m=t;break}}if(!r)throw new Error(`Package "${e}" not found in any catalog or package.json. Make sure it exists in your workspace dependencies.`);let a;if(u)a=u;else{s.info(`Fetching latest version for ${e}...
|
|
2
2
|
`);const t=await j(e);if(!t.latest)throw new Error(`Could not determine latest version for "${e}".`);a=t.latest}const d=$(r),g=$(a);if(!d||!g)throw new Error(`Could not parse versions: current="${r}", target="${a}".`);const y=T(d,g);if(y==="none"){s.info(`${e} is already at ${a}. Nothing to analyze.`);return}const P=M(r),f={catalogName:m,currentRange:r,newRange:`${P}${a}`,packageName:e,targetVersion:a,updateType:y},w=x(i.aiType??"impact");if(w==="security"||i.security){s.info(`Checking for known vulnerabilities...
|
|
3
3
|
`);const t=r.replace(F,""),n=(await z([{name:e,version:t}])).get(e);n&&n.length>0&&(f.vulnerabilities=n);const v=C(c?.security,{minimumScore:c?.security?.policies?.score?.minimum});if(v.length>0){const o=(await O(v,[{name:e,version:t}])).get(`${e}@${t}`);o&&(f.socketReport={alerts:o.alerts,license:o.license,score:o.score})}}const k=await V([f],s,c?.ai,w);(i.format??"table")==="json"?process.stdout.write(`${JSON.stringify(k,void 0,2)}
|
|
4
4
|
`):s.info(N(k))};export{B as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{VisReleaseError as x}from"../packem_shared/VisReleaseError-DZtgcKf8.js";import{r as d,a as g}from"../packem_shared/publish-report-C-f7hkwx.js";import{b as y}from"./context.js";import{p as C,a as P}from"../packem_shared/publish-missing-
|
|
1
|
+
import{VisReleaseError as x}from"../packem_shared/VisReleaseError-DZtgcKf8.js";import{r as d,a as g}from"../packem_shared/publish-report-C-f7hkwx.js";import{b as y}from"./context.js";import{p as C,a as P}from"../packem_shared/publish-missing-DgPXeH9w.js";const k=async({logger:t,options:s,workspaceRoot:p})=>{const m=p??process.cwd(),l=s.dryRun===!0,c=s.missing===!0,h=s.filter?s.filter.split(",").map(e=>e.trim()).filter(Boolean):void 0;if(c&&(s.checkOnly===!0||s.firstRelease===!0)){t.error(`--missing cannot be combined with ${s.checkOnly===!0?"--check-only":"--first-release"}.`),process.exitCode=1;return}let n;try{n=await y({channel:s.channel,cwd:m,firstRelease:s.firstRelease===!0,projects:h})}catch(e){t.error(`Failed to load release context: ${e instanceof Error?e.message:String(e)}`),process.exitCode=1;return}const{printConfigIfRequested:$}=await import("./print-config.js");if($(s,n,t))return;if(s.checkOnly===!0){if(t.info(`Preflight: ${n.plan.releases.length} pending publish(es)${n.channel?` to dist-tag "${n.channel.tag}"`:""}.`),n.plan.warnings.length>0)for(const e of n.plan.warnings)t.warn(` - ${e}`);process.exitCode=n.plan.releases.length===0?1:0;return}if(!c&&n.plan.releases.length===0){t.info("No pending releases — nothing to publish.");return}const a=s.tag??n.channel?.tag;a||t.warn("No --tag provided and no channel matched the current branch. Defaulting to dist-tag 'latest'. Set channels in vis.config.ts to control this."),c?t.info(`Looking for released versions that never reached dist-tag "${a??"latest"}"...`):t.info(`${l?"[dry-run] would publish":"Publishing"} ${n.plan.releases.length} package(s) to dist-tag "${a??"latest"}"${l?"":"..."}`);let i,{warnings:f}=n.plan;try{const e={dryRun:l,noPush:!s.push,otp:s.otp,resume:s.resume===!0,tag:a};if(c){i=await C(n,{...e,projects:h}),{warnings:f}=i;for(const r of i.missing){const o=r.onRegistry?"tag":"publish";t.info(` [missing] ${r.name}@${r.version} (${l?`would ${o}`:o}, release commit ${r.commit.slice(0,7)})`)}i.missing.length===0&&t.info("No released-but-unpublished versions found.")}else i=await P(n,e)}catch(e){if(d(t,f),e instanceof x&&e.code==="STAGE_PENDING"){t.error(e.message),e.hint&&(t.info(""),t.info(`Next steps: ${e.hint}`)),process.exitCode=1;return}t.error(`Publish failed: ${e instanceof Error?e.message:String(e)}`),process.exitCode=1;return}t.info(""),g(t,i,a??"latest"),d(t,f),i.failed.length===0?process.exitCode=0:i.published.length===0&&i.skipped.length===0?process.exitCode=3:process.exitCode=2;const u=i.failed.filter(e=>/\bEOTP\b|one[- ]time password|otp/i.test(e.reason));if(u.length>0){t.info(""),t.warn("Publish failed because the registry required a 2FA OTP. Rerun with:");const e=u.map(w=>w.name).join(","),r=s.channel?` --channel=${s.channel}`:"",o=s.tag?` --tag=${s.tag}`:"",b=` --filter='${e}'`;t.info(` vis release publish --otp=REPLACE_WITH_NEW_OTP --resume${o}${r}${b}`)}};export{k as default};
|