@visulima/vis 2.0.0 → 2.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +13 -0
- package/README.md +1 -1
- package/dist/bin.js +1 -1
- package/dist/binx.js +2 -2
- package/dist/config/index.d.ts +1817 -1811
- package/dist/generate/index.d.ts +39 -39
- package/dist/packem_chunks/CONFIG_FILES.js +5 -5
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/cache-attestation.js +1 -1
- package/dist/packem_chunks/catalog.js +63 -61
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +133 -130
- package/dist/packem_chunks/detect.js +3 -3
- package/dist/packem_chunks/detect2.js +4 -4
- package/dist/packem_chunks/dispatch.js +3 -3
- package/dist/packem_chunks/extra-files.js +3 -3
- package/dist/packem_chunks/fix.js +8 -8
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +5 -5
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +6 -6
- 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 +2 -2
- package/dist/packem_chunks/handler21.js +2 -2
- package/dist/packem_chunks/handler22.js +10 -10
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +5 -5
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +3 -3
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +2 -3
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler31.js +2 -2
- package/dist/packem_chunks/handler35.js +3 -3
- package/dist/packem_chunks/handler4.js +3 -3
- package/dist/packem_chunks/handler40.js +10 -10
- package/dist/packem_chunks/handler42.js +3 -3
- package/dist/packem_chunks/handler43.js +3 -3
- package/dist/packem_chunks/handler5.js +5 -5
- package/dist/packem_chunks/handler50.js +2 -2
- package/dist/packem_chunks/handler51.js +13 -13
- package/dist/packem_chunks/handler52.js +3 -3
- package/dist/packem_chunks/handler53.js +1 -1
- package/dist/packem_chunks/handler54.js +2 -2
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler57.js +5 -5
- package/dist/packem_chunks/handler58.js +4 -4
- package/dist/packem_chunks/handler59.js +8 -8
- package/dist/packem_chunks/handler6.js +6 -6
- package/dist/packem_chunks/handler60.js +2 -2
- package/dist/packem_chunks/handler61.js +13 -13
- package/dist/packem_chunks/handler62.js +3 -3
- package/dist/packem_chunks/handler63.js +3 -3
- package/dist/packem_chunks/handler64.js +4 -4
- package/dist/packem_chunks/handler65.js +6 -6
- package/dist/packem_chunks/handler66.js +2 -2
- package/dist/packem_chunks/handler67.js +16 -16
- package/dist/packem_chunks/handler68.js +7 -7
- package/dist/packem_chunks/handler69.js +25 -25
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +6 -6
- package/dist/packem_chunks/handler71.js +14 -14
- package/dist/packem_chunks/handler72.js +42 -42
- package/dist/packem_chunks/handler73.js +9 -9
- package/dist/packem_chunks/handler74.js +21 -21
- package/dist/packem_chunks/handler75.js +3 -3
- package/dist/packem_chunks/handler76.js +8 -8
- package/dist/packem_chunks/handler77.js +63 -64
- package/dist/packem_chunks/handler78.js +22 -22
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +5 -5
- package/dist/packem_chunks/heal.js +8 -8
- package/dist/packem_chunks/help-command.js +26 -26
- package/dist/packem_chunks/index2.js +5 -5
- package/dist/packem_chunks/index3.js +2 -2
- package/dist/packem_chunks/index4.js +11 -11
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +1 -1
- package/dist/packem_chunks/list.js +2 -2
- package/dist/packem_chunks/loader.js +4 -4
- package/dist/packem_chunks/orchestrator.js +14 -14
- package/dist/packem_chunks/pre-mode.js +2 -2
- package/dist/packem_chunks/prompts.js +3 -3
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/publish-guards.js +1 -1
- package/dist/packem_chunks/registry.js +17 -17
- package/dist/packem_chunks/resolveFormatter.js +5 -5
- package/dist/packem_chunks/shell-runner.js +1 -1
- package/dist/packem_chunks/snapshot.js +2 -2
- package/dist/packem_chunks/stage-publisher.js +1 -1
- package/dist/packem_chunks/staged-registry.js +2 -2
- package/dist/packem_chunks/state.js +3 -3
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tar.js +3 -3
- package/dist/packem_chunks/tripwire.js +2 -2
- package/dist/packem_chunks/ts-loader.js +8 -8
- package/dist/packem_chunks/verify-lockfile.js +2 -2
- package/dist/packem_chunks/workspace.js +2 -2
- package/dist/packem_shared/advisories-BGeuHJQg.js +1 -0
- package/dist/packem_shared/affected-selection-B85ND6JV.js +1 -0
- package/dist/packem_shared/affected-shas-BWRRAB47.js +1 -0
- package/dist/packem_shared/ai-analysis-oNMAj1wd.js +68 -0
- package/dist/packem_shared/{ai-fix-CLfWbyqY.js → ai-fix-BgBU0TOz.js} +9 -9
- package/dist/packem_shared/{augment-BVuj3ee7.js → augment-HVeX6LpU.js} +4 -4
- package/dist/packem_shared/bin-DKod8Iqo.js +1 -0
- package/dist/packem_shared/build-scripts-CM8M1xcG.js +1 -0
- package/dist/packem_shared/{command-runtime-DTbo12cP.js → command-runtime-BVi4lL8k.js} +1 -1
- package/dist/packem_shared/cyclonedx-y7VLI-1d.js +4 -0
- package/dist/packem_shared/{dependency-scan-DZcSlSFp.js → dependency-scan-BAzKpXdW.js} +1 -1
- package/dist/packem_shared/{docker-69ybb6g7.js → docker-D1LStSlH.js} +36 -36
- package/dist/packem_shared/{en-C26W78--.js → en-BxrK-n-J.js} +10 -10
- package/dist/packem_shared/failure-log-ChuFC-8f.js +2 -0
- package/dist/packem_shared/giget-CAxjpwew.js +2 -0
- package/dist/packem_shared/glob-BUjyjdE8-BSrdzgma.js +1 -0
- package/dist/packem_shared/{index-Bhzio2RB.js → index-BJw7gKD1.js} +1 -1
- package/dist/packem_shared/index-BWl4DbMp.js +1 -0
- package/dist/packem_shared/index-DND6ptxQ.js +35 -0
- package/dist/packem_shared/{interface.d-B7VK2rcH.d.ts → interface.d-CRqRz4jt.d.ts} +39 -39
- package/dist/packem_shared/{interface.d-Cezzifoh.d.ts → interface.d-CrHOtJc1.d.ts} +37 -37
- package/dist/packem_shared/lifecycle-Db0qh6vR.js +2 -0
- package/dist/packem_shared/lockfile-CDQ0n4P5.js +1 -0
- package/dist/packem_shared/main-D_cam4hv.js +1 -0
- package/dist/packem_shared/manifests-Da_no4ZH.js +1 -0
- package/dist/packem_shared/{min-release-age-hK604veF.js → min-release-age-V6L6dpiP.js} +2 -2
- package/dist/packem_shared/missing-package-json-Jw8IEHct.js +1 -0
- package/dist/packem_shared/{native-config-sync-DDKjAy0i.js → native-config-sync-C0pUePad.js} +6 -6
- package/dist/packem_shared/osv-bloom-DNFpvSSO.js +2 -0
- package/dist/packem_shared/package-version-DjHDww_5.js +4 -0
- package/dist/packem_shared/packument-N3EWbZpL.js +1 -0
- package/dist/packem_shared/pm-runner-Bssje5qH.js +1 -0
- package/dist/packem_shared/project-name-filter-u2Q7YpQH.js +7 -0
- package/dist/packem_shared/prompt-BSAy8SMH.js +1 -0
- package/dist/packem_shared/{provenance-CRBV9cko.js → provenance-9OT8sTqn.js} +1 -1
- package/dist/packem_shared/{readJsonSync-DuMMeB3s-B9cGBVbJ.js → readJsonSync-BnWiH5-R-BpnwAB0Z.js} +1 -1
- package/dist/packem_shared/registry-keys-CYHd7qU2.js +1 -0
- package/dist/packem_shared/{resolve-explicit-BX6aMYl-.js → resolve-explicit-DC3XssJa.js} +1 -1
- package/dist/packem_shared/{resolve-runtime-COyiEML3.js → resolve-runtime-f5l4ODsH.js} +1 -1
- package/dist/packem_shared/run-file-zB4ACnUy.js +1 -0
- package/dist/packem_shared/{runtime-check-fzDkedMW.js → runtime-check-CWvAfu5u.js} +1 -1
- package/dist/packem_shared/s1ngularity-DsmC71xt.js +1 -0
- package/dist/packem_shared/{scan-progress-DQ9qIGzr.js → scan-progress-Ch8s3Uwl.js} +2 -2
- package/dist/packem_shared/selectors-CtxnIT4X.js +3 -0
- package/dist/packem_shared/signatures-Dwx5fD4g.js +2 -0
- package/dist/packem_shared/subtree-DSm0QEoE.js +2 -0
- package/dist/packem_shared/target-merge-b7bE1AEx.js +11 -0
- package/dist/packem_shared/target-options-BO4Uxt0k.js +1 -0
- package/dist/packem_shared/toolchain-BY8lJaSN.js +5 -0
- package/dist/packem_shared/typosquats-BUGgotNu.js +1 -0
- package/dist/packem_shared/{use-measured-height-DfNxp6nf.js → use-measured-height-BLZt9dW2.js} +1 -1
- package/dist/packem_shared/verify-B0ztxKMa.js +1 -0
- package/dist/packem_shared/vis-update-app-D1gLJB1O.js +1 -0
- package/dist/packem_shared/vis-user-error-DjFv8uxy.js +28 -0
- package/dist/packem_shared/watch-CGrUW_JD.js +1 -0
- package/dist/packem_shared/watch-loop-DIwSMjlA.js +11 -0
- package/dist/release/core/package-managers/index.d.ts +2 -2
- package/dist/release/core/version-actions/index.d.ts +10 -10
- package/dist/release/index.d.ts +60 -60
- package/dist/release/plugin-sdk.d.ts +80 -80
- package/dist/release/presets.d.ts +148 -148
- package/dist/release/types.d.ts +840 -840
- package/dist/runtime/preload.js +1 -1
- package/index.d.ts +204 -204
- package/index.js +52 -52
- package/package.json +12 -12
- package/schemas/project.schema.json +4 -1
- package/schemas/vis-config.schema.json +9 -3
- package/dist/packem_shared/advisories-B76fBVL-.js +0 -1
- package/dist/packem_shared/affected-shas-BOeR4vEc.js +0 -1
- package/dist/packem_shared/ai-analysis-D7HOdUwd.js +0 -68
- package/dist/packem_shared/bin-CkfFJCAM.js +0 -1
- package/dist/packem_shared/build-scripts-CfAqHBlq.js +0 -1
- package/dist/packem_shared/cyclonedx--L7NbMBH.js +0 -4
- package/dist/packem_shared/failure-log-BZQqxffZ.js +0 -2
- package/dist/packem_shared/giget-DVTFJlbR.js +0 -2
- package/dist/packem_shared/glob-DMbPwGSj-D2Hk3lFG.js +0 -1
- package/dist/packem_shared/index-2LCHaVNX.js +0 -35
- package/dist/packem_shared/index-B0EsgdzO.js +0 -1
- package/dist/packem_shared/index-Bq6YEpiq.js +0 -28
- package/dist/packem_shared/lifecycle-BcCMt9wn.js +0 -2
- package/dist/packem_shared/lockfile-Cwt0Nwr0.js +0 -1
- package/dist/packem_shared/main-B3juSU5z.js +0 -1
- package/dist/packem_shared/manifests-BshBdSb-.js +0 -1
- package/dist/packem_shared/missing-package-json-Cu0iWMT2.js +0 -1
- package/dist/packem_shared/osv-bloom-DMhXP184.js +0 -2
- package/dist/packem_shared/package-version-TsxLc6w2.js +0 -4
- package/dist/packem_shared/packument-CtVAoNo7.js +0 -1
- package/dist/packem_shared/pm-runner-CfyxALPK.js +0 -1
- package/dist/packem_shared/prompt-DjXHVgYU.js +0 -1
- package/dist/packem_shared/registry-keys-Ci2keQNi.js +0 -1
- package/dist/packem_shared/run-file-CTJfIZ0I.js +0 -1
- package/dist/packem_shared/s1ngularity-Cq1cCSpU.js +0 -1
- package/dist/packem_shared/selectors-B9dOMIMq.js +0 -3
- package/dist/packem_shared/signatures-DvD1E8Xa.js +0 -2
- package/dist/packem_shared/subtree-C7bZuiSQ.js +0 -2
- package/dist/packem_shared/target-merge-Dg25Izl5.js +0 -11
- package/dist/packem_shared/target-options-aPqByoww.js +0 -1
- package/dist/packem_shared/toolchain-CiaW3bx4.js +0 -5
- package/dist/packem_shared/typosquats-CRnvlYPw.js +0 -1
- package/dist/packem_shared/verify-23b6IfSg.js +0 -1
- package/dist/packem_shared/vis-update-app-De8JjZm0.js +0 -1
- package/dist/packem_shared/watch-B3P2dwoG.js +0 -1
- package/dist/packem_shared/watch-loop-B3_O8hF-.js +0 -11
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as N}from"node:module";import S from"./index.js";import{VisReleaseError as u}from"../packem_shared/VisReleaseError-DMGRBTNO.js";const A
|
|
2
|
-
${
|
|
3
|
-
${
|
|
1
|
+
import{createRequire as N}from"node:module";import S from"./index.js";import{VisReleaseError as u}from"../packem_shared/VisReleaseError-DMGRBTNO.js";let A;const x=o=>(A??=N(import.meta.url))(o),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=o=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[t,e]=h.versions.node.split(".").map(Number);if(t>22||t===22&&e>=3||t===20&&e>=16)return h.getBuiltinModule(o)}return x(o)},{readFile:b,rename:L,readdir:_}=v("node:fs/promises"),{isAbsolute:k,join:c,basename:C}=v("node:path");class m{constructor(t){this.runner=t}runner;async publishNative(t){throw new u({code:"CONFIG_INVALID",hint:'Set publish.publishStrategy back to "npm-publish-tarball" (the default), or use a package manager whose adapter implements native publish.',message:`publishStrategy "native" is not supported by the "${this.id}" adapter.`})}async readCatalogYaml(t){}}const f=(o,t)=>{if(o.exitCode===0)return{output:o.stdout,published:!0};const e=`${o.stdout}
|
|
2
|
+
${o.stderr}`;if(/EPUBLISHCONFLICT|cannot publish over the previously published versions|forbidden.*409/i.test(e))return{alreadyPublished:!0,output:e,published:!1};throw new u({code:"PUBLISH_FAILED",message:`${t} failed: ${e}`})};class g extends m{id="npm";minVersion="11.5.1";async pack(t){const e=["pack","--json"];t.destination&&e.push("--pack-destination",t.destination);const s=await this.runner.run("npm",e,{cwd:t.cwd,silent:!0});if(s.exitCode!==0)throw new u({code:"PUBLISH_FAILED",message:`npm pack failed: ${s.stderr||s.stdout}`});const a=JSON.parse(s.stdout),n=a[0]?.filename;if(!n)throw new u({code:"PUBLISH_FAILED",hint:"Upgrade npm to a version that emits --json output, or report this with the raw stdout.",message:`npm pack: could not parse output: ${s.stdout}`});const r=t.destination??t.cwd;let i=k(n)?n:c(r,n);return t.filename&&(await(await import("node:fs/promises")).rename(i,c(r,t.filename)),i=c(r,t.filename)),{raw:a,tarball:i}}async installLockfileOnly(t){const e=await this.runner.run("npm",["install","--package-lock-only"],{cwd:t.cwd,silent:t.silent});if(e.exitCode!==0)throw new u({code:"CONFIG_INVALID",message:`npm install --package-lock-only failed: ${e.stderr||e.stdout}`})}async listWorkspacePackages(t){const e=await this.runner.run("npm",["query",".workspace","--json"],{cwd:t,silent:!0});if(e.exitCode!==0)return[];try{return JSON.parse(e.stdout).filter(s=>typeof s.name=="string").map(s=>({name:s.name,path:s.path??s.location??t,private:s.private??!1,version:s.version??"0.0.0"}))}catch{return[]}}async publish(t){const e=t.stage?["stage","publish",t.tarball]:["publish",t.tarball];t.tag&&e.push("--tag",t.tag),t.access&&e.push("--access",t.access),t.registry&&e.push("--registry",t.registry),t.otp&&e.push("--otp",t.otp),t.provenance&&e.push("--provenance"),t.stage&&e.push("--json");for(const n of t.extraArgs??[])e.push(n);const s=await this.runner.run("npm",e,{cwd:process.cwd(),silent:!0});if(s.exitCode===0){const n={output:s.stdout,published:!0};if(t.stage)try{const r=JSON.parse(s.stdout);n.stageId=r.id??r.stageId}catch{}return n}const a=`${s.stdout}
|
|
3
|
+
${s.stderr}`;if(/EPUBLISHCONFLICT|cannot publish over the previously published versions|forbidden.*409/i.test(a))return{alreadyPublished:!0,output:a,published:!1};throw new u({code:"PUBLISH_FAILED",message:`npm publish failed: ${a}`})}async publishNative(t){const e=["publish"];t.tag&&e.push("--tag",t.tag),t.access&&e.push("--access",t.access),t.registry&&e.push("--registry",t.registry),t.otp&&e.push("--otp",t.otp),t.provenance&&e.push("--provenance");for(const a of t.extraArgs??[])e.push(a);const s=await this.runner.run("npm",e,{cwd:t.cwd,silent:!0});return f(s,"npm publish")}async detectVersion(t){const e=await this.runner.run("npm",["--version"],{cwd:t,silent:!0});return e.exitCode===0?e.stdout.trim():void 0}}class O extends m{id="bun";minVersion="1.1.36";async pack(t){const e=["pm","pack"];t.destination&&e.push("--destination",t.destination);const s=await this.runner.run("bun",e,{cwd:t.cwd,silent:!0});if(s.exitCode!==0)throw new u({code:"PUBLISH_FAILED",message:`bun pm pack failed: ${s.stderr||s.stdout}`});const a=/(?:^|["'\s])([^\s"']*\.tgz)/m.exec(s.stdout),n=t.destination??t.cwd;let r;if(a?.[1]){const i=a[1];r=k(i)?i:c(n,i)}else{const i=JSON.parse(await b(c(t.cwd,"package.json"),"utf8")),d=(i.name??"package").replaceAll("/","-").replace(/^@/,"");r=c(n,`${d}-${i.version??"0.0.0"}.tgz`)}if(t.filename&&C(r)!==t.filename){const i=c(n,t.filename);await L(r,i),r=i}return{raw:s.stdout,tarball:r}}async installLockfileOnly(t){const e=await this.runner.run("bun",["install","--lockfile-only"],{cwd:t.cwd,silent:t.silent});if(e.exitCode!==0)throw new u({code:"CONFIG_INVALID",message:`bun install --lockfile-only failed: ${e.stderr||e.stdout}`})}async listWorkspacePackages(t){try{const e=JSON.parse(await b(c(t,"package.json"),"utf8")),s=Array.isArray(e.workspaces)?e.workspaces:e.workspaces?.packages??[];if(s.length===0)return[];const a=new Set,n=["."],r=5,i=new Set;for(;n.length>0;){const p=n.shift();if(i.has(p)||(i.add(p),(p==="."?0:p.split("/").length)>r))continue;let w;try{w=await _(c(t,p),{withFileTypes:!0})}catch{continue}for(const l of w){if(!l.isDirectory()||l.name==="node_modules"||l.name.startsWith("."))continue;const y=p==="."?l.name:`${p}/${l.name}`;s.some(I=>S(I,y))&&a.add(y),n.push(y)}}const d=[];for(const p of a){const w=c(t,p,"package.json");try{const l=JSON.parse(await b(w,"utf8"));if(typeof l.name!="string")continue;d.push({name:l.name,path:c(t,p),private:l.private??!1,version:l.version??"0.0.0"})}catch{}}return d}catch{return[]}}async publish(t){return new g(this.runner).publish(t)}async publishNative(t){const e=["publish"];t.tag&&e.push("--tag",t.tag),t.access&&e.push("--access",t.access),t.registry&&e.push("--registry",t.registry);for(const a of t.extraArgs??[])e.push(a);const s=await this.runner.run("bun",e,{cwd:t.cwd,silent:!0});return f(s,"bun publish")}async detectVersion(t){const e=await this.runner.run("bun",["--version"],{cwd:t,silent:!0});return e.exitCode===0?e.stdout.trim():void 0}}class $ extends m{id="pnpm";minVersion="9.5.0";async pack(t){const e=["pack","--json"];t.destination&&e.push("--pack-destination",t.destination);const s=await this.runner.run("pnpm",e,{cwd:t.cwd,silent:!0});if(s.exitCode!==0)throw new u({code:"PUBLISH_FAILED",message:`pnpm pack failed: ${s.stderr||s.stdout}`});const a=JSON.parse(s.stdout),{filename:n}=a;if(!n)throw new u({code:"PUBLISH_FAILED",message:`pnpm pack: could not parse output: ${s.stdout}`});const r=t.destination??t.cwd;let i=k(n)?n:c(r,n);return t.filename&&(await(await import("node:fs/promises")).rename(i,c(r,t.filename)),i=c(r,t.filename)),{raw:a,tarball:i}}async installLockfileOnly(t){const e=await this.runner.run("pnpm",["install","--lockfile-only"],{cwd:t.cwd,silent:t.silent});if(e.exitCode!==0)throw new u({code:"CONFIG_INVALID",message:`pnpm install --lockfile-only failed: ${e.stderr||e.stdout}`})}async listWorkspacePackages(t){const e=await this.runner.run("pnpm",["-r","ls","--depth","-1","--json"],{cwd:t,silent:!0});if(e.exitCode!==0)return[];try{return JSON.parse(e.stdout).filter(s=>typeof s.name=="string").map(s=>({name:s.name,path:s.path??t,private:s.private??!1,version:s.version??"0.0.0"}))}catch{return[]}}async publish(t){return new g(this.runner).publish(t)}async publishNative(t){const e=["publish","--no-git-checks"];t.tag&&e.push("--tag",t.tag),t.access&&e.push("--access",t.access),t.registry&&e.push("--registry",t.registry),t.otp&&e.push("--otp",t.otp),t.provenance&&e.push("--provenance");for(const a of t.extraArgs??[])e.push(a);const s=await this.runner.run("pnpm",e,{cwd:t.cwd,silent:!0});return f(s,"pnpm publish")}async detectVersion(t){const e=await this.runner.run("pnpm",["--version"],{cwd:t,silent:!0});return e.exitCode===0?e.stdout.trim():void 0}async readCatalogYaml(t){const e=await import("node:fs/promises");try{return await e.readFile(c(t,"pnpm-workspace.yaml"),"utf8")}catch{return}}}class j extends m{id="yarn";minVersion="4.0.0";async pack(t){const e=t.destination??t.cwd,s=t.filename??"%s-%v.tgz",a=["pack","--out",c(e,s)],n=await this.runner.run("yarn",a,{cwd:t.cwd,silent:!0});if(n.exitCode!==0)throw new u({code:"PUBLISH_FAILED",message:`yarn pack failed: ${n.stderr||n.stdout}`});const r=await import("node:fs/promises"),i=await import("node:path"),d=JSON.parse(await r.readFile(i.join(t.cwd,"package.json"),"utf8")),p=s.replaceAll("%s",(d.name??"package").replaceAll("/","-").replace(/^@/,"")).replaceAll("%v",d.version??"0.0.0");return{raw:n.stdout,tarball:c(e,p)}}async installLockfileOnly(t){const e=await this.runner.run("yarn",["install","--mode","update-lockfile"],{cwd:t.cwd,silent:t.silent});if(e.exitCode!==0)throw new u({code:"CONFIG_INVALID",message:`yarn install --mode update-lockfile failed: ${e.stderr||e.stdout}`})}async listWorkspacePackages(t){const e=await this.runner.run("yarn",["workspaces","list","--json"],{cwd:t,silent:!0});if(e.exitCode!==0)return[];const s=[];for(const a of e.stdout.split(/\r?\n/)){const n=a.trim();if(n)try{const r=JSON.parse(n);if(typeof r.name!="string"||r.name==="")continue;s.push({name:r.name,path:r.location?c(t,r.location):t,private:!1,version:"0.0.0"})}catch{}}return s}async publish(t){return new g(this.runner).publish(t)}async publishNative(t){const e=["npm","publish"];t.tag&&e.push("--tag",t.tag),t.access&&e.push("--access",t.access),t.provenance&&e.push("--provenance");for(const a of t.extraArgs??[])e.push(a);const s=await this.runner.run("yarn",e,{cwd:t.cwd,silent:!0});return f(s,"yarn npm publish")}async detectVersion(t){const e=await this.runner.run("yarn",["--version"],{cwd:t,silent:!0});return e.exitCode===0?e.stdout.trim():void 0}}const V=async(o,t)=>{const e=await import("node:fs/promises"),s=await import("node:path");try{const n=JSON.parse(await e.readFile(s.join(o,"package.json"),"utf8"));if(typeof n.packageManager=="string"){const r=n.packageManager.indexOf("@"),i=r>0?n.packageManager.slice(0,r):n.packageManager;if(i==="pnpm"||i==="yarn"||i==="bun"||i==="npm")return i}}catch{}const a=async n=>{try{return await e.access(s.join(o,n)),!0}catch{return!1}};return await a("bun.lock")||await a("bun.lockb")?"bun":await a("pnpm-lock.yaml")||await a("pnpm-workspace.yaml")?"pnpm":await a("yarn.lock")?"yarn":"npm"},B=(o,t)=>{switch(o){case"bun":return new O(t);case"pnpm":return new $(t);case"yarn":return new j(t);default:return new g(t)}};export{g as N,B as c,V as d};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import{createRequire as f}from"node:module";const y
|
|
1
|
+
import{createRequire as f}from"node:module";let y;const w=o=>(y??=f(import.meta.url))(o),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$=o=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[e,t]=d.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return d.getBuiltinModule(o)}return w(o)},{basename:O}=$("node:path"),x=o=>{const e=[],t=[];for(const s of o??[]){if(typeof s=="string"){e.push(s);continue}if(s.path){const r=s.label??s.name;e.push(r?`${s.path}#${r}`:s.path)}else if(s.linkUrl){const r=s.label??s.name??s.linkUrl;t.push(`- [${r}](${s.linkUrl})`)}}return{linkAppendix:t.length>0?`
|
|
2
2
|
|
|
3
3
|
### Additional links
|
|
4
4
|
|
|
5
5
|
${t.join(`
|
|
6
|
-
`)}`:"",paths:e}},
|
|
7
|
-
${t.body}`;if(r)return(await e.run("gh",["api","-X","PATCH",`repos/${t.repo}/issues/comments/${r.id}`,"-f",`body=${n}`],this.runOpts(t.cwd))).exitCode===0?{created:!1,id:r.id}:void 0;const i=await e.run("gh",["api","-X","POST",`repos/${t.repo}/issues/${t.issueNumber}/comments`,"-f",`body=${n}`],this.runOpts(t.cwd));if(i.exitCode===0)try{return{created:!0,id:JSON.parse(i.stdout).id}}catch{return}}async createRelease(e,t){const{linkAppendix:s,paths:r}=
|
|
8
|
-
${t.body}`,n=p(t.repo);if(s)return(await e.run("glab",["api","-X","PUT",`projects/${n}/merge_requests/${t.issueNumber}/notes/${s.id}`,"-f",`body=${r}`],this.runOpts(t.cwd))).exitCode===0?{created:!1,id:s.id}:void 0;const i=await e.run("glab",["api","-X","POST",`projects/${n}/merge_requests/${t.issueNumber}/notes`,"-f",`body=${r}`],this.runOpts(t.cwd));if(i.exitCode===0)try{return{created:!0,id:JSON.parse(i.stdout).id}}catch{return}}async createRelease(e,t){const{genericPackages:s,links:r,uploads:n}=
|
|
6
|
+
`)}`:"",paths:e}},C=(o,e)=>{if(o!==0)return[];try{return JSON.parse(e).filter(t=>typeof t.body=="string").map(t=>({body:t.body??"",id:t.id}))}catch{return[]}};class P{id="github";host;httpProxy;constructor(e={}){this.host=e.host,this.httpProxy=e.httpProxy}runOpts(e){if(!this.host&&!this.httpProxy)return{cwd:e,silent:!0};const t={...process.env};return this.host&&(t.GH_HOST=this.host),this.httpProxy&&(t.HTTPS_PROXY=this.httpProxy,t.HTTP_PROXY=this.httpProxy),{cwd:e,env:t,silent:!0}}async listRecentReleases(e,t){const s=Math.max(1,t.limit),r=t.tagPrefix?Math.min(100,s*4):s,n=await e.run("gh",["release","list","--repo",t.repo,"--limit",String(r),"--json","tagName,url,name"],this.runOpts(t.cwd));if(n.exitCode!==0)return[];let i;try{i=JSON.parse(n.stdout)}catch{return[]}const a=[];for(const u of i)if(!(typeof u.tagName!="string"||typeof u.url!="string")&&!(t.tagPrefix&&!u.tagName.startsWith(t.tagPrefix))&&!(t.excludeTag&&u.tagName===t.excludeTag)&&(a.push({name:u.name??u.tagName,tag:u.tagName,url:u.url}),a.length>=s))break;return a}async detectRepoSlug(e,t){const s=await t.run("gh",["repo","view","--json","nameWithOwner","-q",".nameWithOwner"],this.runOpts(e));if(s.exitCode===0)return s.stdout.trim()||void 0}detectPullRequestNumber(e){const t=e.GITHUB_REF;if(t){const r=/^refs\/pull\/(\d+)\/(?:merge|head)$/.exec(t);if(r?.[1])return Number.parseInt(r[1],10)}const s=e.PR_NUMBER??e.VIS_PR_NUMBER;if(s){const r=Number.parseInt(s,10);return Number.isNaN(r)?void 0:r}}async upsertStickyComment(e,t){const s=await e.run("gh",["api",`repos/${t.repo}/issues/${t.issueNumber}/comments`,"--paginate"],this.runOpts(t.cwd)),r=C(s.exitCode,s.stdout).find(a=>a.body.includes(t.marker)),n=t.body.includes(t.marker)?t.body:`${t.marker}
|
|
7
|
+
${t.body}`;if(r)return(await e.run("gh",["api","-X","PATCH",`repos/${t.repo}/issues/comments/${r.id}`,"-f",`body=${n}`],this.runOpts(t.cwd))).exitCode===0?{created:!1,id:r.id}:void 0;const i=await e.run("gh",["api","-X","POST",`repos/${t.repo}/issues/${t.issueNumber}/comments`,"-f",`body=${n}`],this.runOpts(t.cwd));if(i.exitCode===0)try{return{created:!0,id:JSON.parse(i.stdout).id}}catch{return}}async createRelease(e,t){const{linkAppendix:s,paths:r}=x(t.assets),n=s?`${t.body}${s}`:t.body,i=["release","create",t.tag,"--repo",t.repo,"--title",t.title,"--notes",n];t.draft&&i.push("--draft"),t.prerelease&&i.push("--prerelease"),t.discussionCategory&&i.push("--discussion-category",t.discussionCategory),r.length>0&&i.push(...r);const a=await e.run("gh",i,this.runOpts(t.cwd));if(a.exitCode===0)return{url:a.stdout.trim()||void 0}}async addLabels(e,t){if(t.labels.length===0)return!0;const s=["api","-X","POST",`repos/${t.repo}/issues/${t.issueNumber}/labels`];for(const r of t.labels)s.push("-f",`labels[]=${r}`);return(await e.run("gh",s,this.runOpts(t.cwd))).exitCode===0}async upsertIssue(e,t){const s=await e.run("gh",["issue","list","--repo",t.repo,"--state","open","--search",t.marker,"--json","number,title,url","--limit","20"],this.runOpts(t.cwd));if(s.exitCode===0&&s.stdout.trim()&&s.stdout.trim()!=="[]")try{const u=JSON.parse(s.stdout).find(c=>c.title.includes(t.marker));if(u){const c=["issue","edit",String(u.number),"--repo",t.repo,"--title",t.title,"--body",t.body];return t.labels&&t.labels.length>0&&c.push("--add-label",t.labels.join(",")),t.assignees&&t.assignees.length>0&&c.push("--add-assignee",t.assignees.join(",")),(await e.run("gh",c,this.runOpts(t.cwd))).exitCode===0?{created:!1,number:u.number,url:u.url}:void 0}}catch{}const r=["issue","create","--repo",t.repo,"--title",t.title,"--body",t.body];t.labels&&t.labels.length>0&&r.push("--label",t.labels.join(",")),t.assignees&&t.assignees.length>0&&r.push("--assignee",t.assignees.join(","));const n=await e.run("gh",r,this.runOpts(t.cwd));if(n.exitCode!==0)return;const i=n.stdout.trim(),a=/\/issues\/(\d+)/.exec(i);return a?{created:!0,number:Number.parseInt(a[1]??"0",10),url:i}:void 0}async closeIssue(e,t){return t.closingComment&&await e.run("gh",["issue","comment",String(t.issueNumber),"--repo",t.repo,"--body",t.closingComment],this.runOpts(t.cwd)),(await e.run("gh",["issue","close",String(t.issueNumber),"--repo",t.repo],this.runOpts(t.cwd))).exitCode===0}async upsertPullRequest(e,t){const s=await e.run("gh",["pr","list","--repo",t.repo,"--head",t.head,"--state","open","--json","number,url"],this.runOpts(t.cwd));if(s.exitCode===0&&s.stdout.trim()&&s.stdout.trim()!=="[]")try{const i=JSON.parse(s.stdout);if(i[0])return await e.run("gh",["pr","edit",String(i[0].number),"--repo",t.repo,"--title",t.title,"--body",t.body],this.runOpts(t.cwd)),{existing:!0,number:i[0].number,url:i[0].url}}catch{}const r=await e.run("gh",["pr","create","--repo",t.repo,"--head",t.head,"--base",t.base,"--title",t.title,"--body",t.body],this.runOpts(t.cwd));if(r.exitCode!==0)return;const n=/\/pull\/(\d+)/.exec(r.stdout);return n?{existing:!1,number:Number.parseInt(n[1]??"0",10),url:r.stdout.trim()}:void 0}}const p=o=>encodeURIComponent(o),N=o=>o.replace(/^v(?=\d)/,""),R=o=>{const e=[],t=[],s=[];for(const r of o??[]){if(typeof r=="string"){e.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}):e.push(r.path):r.linkUrl&&t.push({linkType:r.type,name:r.label??r.name??r.linkUrl,url:r.linkUrl})}return{genericPackages:s,links:t,uploads:e}};class b{id="gitlab";static recentReleasesWarned=!1;async listRecentReleases(e,t){return b.recentReleasesWarned||(b.recentReleasesWarned=!0,console.warn("[vis release] addReleases is not yet supported on GitLab — skipping the Related releases block.")),[]}host;httpProxy;constructor(e={}){this.host=e.host,this.httpProxy=e.httpProxy}runOpts(e){if(!this.host&&!this.httpProxy)return{cwd:e,silent:!0};const t={...process.env};return this.host&&(t.GITLAB_HOST=this.host),this.httpProxy&&(t.HTTPS_PROXY=this.httpProxy,t.HTTP_PROXY=this.httpProxy),{cwd:e,env:t,silent:!0}}async listMrNotes(e,t,s,r){const n=await e.run("glab",["api",`projects/${p(s)}/merge_requests/${r}/notes`,"--paginate"],this.runOpts(t));if(n.exitCode!==0)return[];try{return JSON.parse(n.stdout).filter(i=>typeof i.body=="string"&&i.system!==!0).map(i=>({body:i.body??"",id:i.id}))}catch{return[]}}async uploadGenericPackage(e,t,s,r,n){const i=p(s),a=O(n.path),u=n.packageName??s.split("/").pop()??"release",c=n.packageVersion??N(r),l=`projects/${i}/packages/generic/${encodeURIComponent(u)}/${encodeURIComponent(c)}/${encodeURIComponent(a)}`;if((await e.run("glab",["api","-X","PUT",l,"--input",n.path],this.runOpts(t))).exitCode!==0)return;const h=this.host?.replace(/^https?:\/\//i,"").replace(/\/+$/,""),g=`${h?`https://${h}`:"https://gitlab.com"}/api/v4/${l}`,m=["api","-X","POST",`projects/${i}/releases/${encodeURIComponent(r)}/assets/links`,"-f",`name=${n.label??n.name??a}`,"-f",`url=${g}`];n.linkType&&m.push("-f",`link_type=${n.linkType}`),await e.run("glab",m,this.runOpts(t))}async detectRepoSlug(e,t){const s=process.env.CI_PROJECT_PATH;if(s)return s;const r=await t.run("git",["config","--get","remote.origin.url"],{cwd:e,silent:!0});if(r.exitCode!==0)return;const n=r.stdout.trim();return/gitlab\.[\w.-]+[/:]([^/].*?)(?:\.git)?$/.exec(n)?.[1]}detectPullRequestNumber(e){const t=e.CI_MERGE_REQUEST_IID??e.VIS_MR_NUMBER;if(!t)return;const s=Number.parseInt(t,10);return Number.isNaN(s)?void 0:s}async upsertStickyComment(e,t){const s=(await this.listMrNotes(e,t.cwd,t.repo,t.issueNumber)).find(a=>a.body.includes(t.marker)),r=t.body.includes(t.marker)?t.body:`${t.marker}
|
|
8
|
+
${t.body}`,n=p(t.repo);if(s)return(await e.run("glab",["api","-X","PUT",`projects/${n}/merge_requests/${t.issueNumber}/notes/${s.id}`,"-f",`body=${r}`],this.runOpts(t.cwd))).exitCode===0?{created:!1,id:s.id}:void 0;const i=await e.run("glab",["api","-X","POST",`projects/${n}/merge_requests/${t.issueNumber}/notes`,"-f",`body=${r}`],this.runOpts(t.cwd));if(i.exitCode===0)try{return{created:!0,id:JSON.parse(i.stdout).id}}catch{return}}async createRelease(e,t){const{genericPackages:s,links:r,uploads:n}=R(t.assets),i=["release","create",t.tag,"--repo",t.repo,"--name",t.title,"--notes",t.body];if(t.milestones&&t.milestones.length>0)for(const c of t.milestones)i.push("--milestone",c);if((await e.run("glab",i,this.runOpts(t.cwd))).exitCode!==0)return;n.length>0&&await e.run("glab",["release","upload",t.tag,"--repo",t.repo,...n],this.runOpts(t.cwd));const a=p(t.repo);for(const c of r){const l=["api","-X","POST",`projects/${a}/releases/${encodeURIComponent(t.tag)}/assets/links`,"-f",`name=${c.name}`,"-f",`url=${c.url}`];c.linkType&&l.push("-f",`link_type=${c.linkType}`),await e.run("glab",l,this.runOpts(t.cwd))}for(const c of s)await this.uploadGenericPackage(e,t.cwd,t.repo,t.tag,c);const u=await e.run("glab",["api",`projects/${a}/releases/${encodeURIComponent(t.tag)}`],this.runOpts(t.cwd));try{return{url:JSON.parse(u.stdout)._links?.self}}catch{return{url:void 0}}}async addLabels(e,t){if(t.labels.length===0)return!0;const s=p(t.repo);return(await e.run("glab",["api","-X","PUT",`projects/${s}/issues/${t.issueNumber}`,"-f",`add_labels=${t.labels.join(",")}`],this.runOpts(t.cwd))).exitCode===0}async upsertIssue(e,t){const s=p(t.repo),r=await e.run("glab",["api",`projects/${s}/issues?state=opened&search=${encodeURIComponent(t.marker)}&in=title`],this.runOpts(t.cwd));if(r.exitCode===0)try{const c=JSON.parse(r.stdout).find(l=>l.title.includes(t.marker));if(c){const l=["api","-X","PUT",`projects/${s}/issues/${c.iid}`,"-f",`title=${t.title}`,"-f",`description=${t.body}`];if(t.labels&&t.labels.length>0&&l.push("-f",`add_labels=${t.labels.join(",")}`),t.assignees?.[0]){const h=await e.run("glab",["api",`users?username=${encodeURIComponent(t.assignees[0])}`],this.runOpts(t.cwd));try{const g=JSON.parse(h.stdout);g[0]&&l.push("-f",`assignee_id=${g[0].id}`)}catch{}}return(await e.run("glab",l,this.runOpts(t.cwd))).exitCode===0?{created:!1,number:c.iid,url:c.web_url}:void 0}}catch{}const n=["issue","create","--repo",t.repo,"--title",t.title,"--description",t.body,"--yes"];t.labels&&t.labels.length>0&&n.push("--label",t.labels.join(",")),t.assignees?.[0]&&n.push("--assignee",t.assignees[0]);const i=await e.run("glab",n,this.runOpts(t.cwd));if(i.exitCode!==0)return;const a=i.stdout.trim(),u=/\/issues\/(\d+)/.exec(a);return u?{created:!0,number:Number.parseInt(u[1]??"0",10),url:a}:void 0}async closeIssue(e,t){if(t.closingComment){const s=p(t.repo);await e.run("glab",["api","-X","POST",`projects/${s}/issues/${t.issueNumber}/notes`,"-f",`body=${t.closingComment}`],this.runOpts(t.cwd))}return(await e.run("glab",["issue","close",String(t.issueNumber),"--repo",t.repo],this.runOpts(t.cwd))).exitCode===0}async upsertPullRequest(e,t){const s=p(t.repo),r=await e.run("glab",["api",`projects/${s}/merge_requests?state=opened&source_branch=${encodeURIComponent(t.head)}&target_branch=${encodeURIComponent(t.base)}`],this.runOpts(t.cwd));if(r.exitCode===0)try{const u=JSON.parse(r.stdout);if(u[0])return(await e.run("glab",["api","-X","PUT",`projects/${s}/merge_requests/${u[0].iid}`,"-f",`title=${t.title}`,"-f",`description=${t.body}`],this.runOpts(t.cwd))).exitCode===0?{existing:!0,number:u[0].iid,url:u[0].web_url}:void 0}catch{}const n=await e.run("glab",["mr","create","--repo",t.repo,"--source-branch",t.head,"--target-branch",t.base,"--title",t.title,"--description",t.body,"--yes"],this.runOpts(t.cwd));if(n.exitCode!==0)return;const i=n.stdout.trim(),a=/\/merge_requests\/(\d+)/.exec(i);return a?{existing:!1,number:Number.parseInt(a[1]??"0",10),url:i}:void 0}}const _=o=>{if(o.GITHUB_ACTIONS==="true"||o.GITHUB_REPOSITORY)return"github";if(o.GITLAB_CI==="true"||o.CI_PROJECT_PATH)return"gitlab"},k=o=>{const e=o.trim();if(e!==""){if(!e.includes("://")){const t=e.indexOf(":"),s=e.indexOf("/");if(t>0&&(s===-1||t<s)){const r=e.slice(0,t),n=r.lastIndexOf("@");return(n===-1?r:r.slice(n+1)).toLowerCase()||void 0}return}try{return new URL(e).hostname.toLowerCase()||void 0}catch{return}}},T=async(o,e)=>{const t=await e.run("git",["config","--get","remote.origin.url"],{cwd:o,silent:!0});if(t.exitCode!==0)return;const s=k(t.stdout);if(s){if(s==="github.com"||s.endsWith(".github.com"))return"github";if(s==="gitlab.com"||s.startsWith("gitlab."))return"gitlab"}},S=async(o,e,t,s=process.env)=>_(s)??await T(o,e)??"github",j=(o,e={})=>o==="gitlab"?new b({host:e.gitlabHost,httpProxy:e.httpProxy}):new P({host:e.githubHost,httpProxy:e.httpProxy});export{j as createRemoteClient,S as detectRemoteProvider};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as d}from"node:module";import{m as p,H as
|
|
2
|
-
`),process.exit(1));const s=
|
|
1
|
+
import{createRequire as d}from"node:module";import{m as p,H as _}from"../packem_shared/index-DND6ptxQ.js";let f;const l=e=>(f??=d(import.meta.url))(e),i=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=e=>{if(typeof i<"u"&&i.versions&&i.versions.node){const[r,s]=i.versions.node.split(".").map(Number);if(r>22||r===22&&s>=3||r===20&&s>=16)return i.getBuiltinModule(e)}return l(e)},{spawnSync:h}=u("node:child_process"),{readFileSync:g,statSync:v}=u("node:fs"),m={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}},y=new Set(["create","dlx","exec","init"]),a=e=>{try{return v(e).isFile()}catch{return!1}},w=e=>e==="npm"||e==="pnpm"||e==="yarn"?e:void 0,x=e=>{const r=[["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(g(t,"utf8")).packageManager;if(typeof o=="string"&&o.length>0){const c=w(o.split("@")[0]);if(c!==void 0)return c}}catch{}for(const[o,c]of r)if(a(p(s,o)))return c;const n=_(s);if(n===s)return;s=n}},j=()=>process.env.npm_config_user_agent!==void 0||process.env.npm_execpath!==void 0,k=(e,r,s,t)=>{const n=m[e];if(n===void 0)return"dispatch";const o=n.runner||s!==void 0&&y.has(s);return r!==void 0&&n.pm!==r&&!o&&!t?"refuse":"dispatch"},S=e=>{const r=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 r){const n=p(s,t);if(a(n))return n}},T=(e,r)=>{m[e]===void 0&&(process.stderr.write(`vis: ${e} is not a known package-manager shim.
|
|
2
|
+
`),process.exit(1));const s=x(process.cwd());k(e,s,r[0],j())==="refuse"&&(process.stderr.write(`vis: this project uses ${String(s)}, but \`${e}\` was run. Use \`${String(s)}\` instead, or run \`vis shim uninstall\` to disable the PM guard.
|
|
3
3
|
`),process.exit(1));const t=S(e);t===void 0&&(process.stderr.write(`vis: \`${e}\` was not found on PATH (outside the shim dir).
|
|
4
|
-
`),process.exit(1));const n=
|
|
4
|
+
`),process.exit(1));const n=h(t,r,{stdio:"inherit"});process.exit(n.status??(n.signal===null?0:1))};export{k as decideShim,T as dispatchShim};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as N}from"node:module";import{VisReleaseError as b}from"../packem_shared/VisReleaseError-DMGRBTNO.js";const A
|
|
2
|
-
`);let
|
|
3
|
-
`),warnings:i}:{warnings:i}:(i.push(`extra-files: ${u}[${e.path}] annotation marker "${h}" not found in ${
|
|
1
|
+
import{createRequire as N}from"node:module";import{VisReleaseError as b}from"../packem_shared/VisReleaseError-DMGRBTNO.js";let A;const I=e=>(A??=N(import.meta.url))(e),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=e=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[r,s]=g.versions.node.split(".").map(Number);if(r>22||r===22&&s>=3||r===20&&s>=16)return g.getBuiltinModule(e)}return I(e)},{readFile:R}=_("node:fs/promises"),{isAbsolute:x,join:w}=_("node:path"),j="x-release-please-version",y=e=>e.type==="annotation",O=e=>!y(e),E=(e,r)=>{if(!O(e))throw new b({code:"CONFIG_INVALID",message:`extra-files rule at ${r} has type="${e.type}" — compileRule is regex-only.`});try{return new RegExp(e.search,e.flags??"g")}catch(s){throw new b({cause:s,code:"CONFIG_INVALID",message:`Invalid extra-files regex at ${r}.search: ${s.message}`})}},F=(e,r,s)=>e.replaceAll("{version}",r).replaceAll("{name}",s).replaceAll("{packageName}",s),T=/\d+\.\d+\.\d+(?:-[\w.-]+)?(?:\+[\w.-]+)?/,v=(e,r)=>{let s=0;if(r!==void 0){const h=e.indexOf(r);if(h===-1)return;s=h+r.length}const u=e.slice(s),o=T.exec(u);if(o)return{index:s+o.index,match:o[0]}},q=(e,r,s,u,o)=>{const h=e.marker??j,i=[],l=r.split(`
|
|
2
|
+
`);let t=!1,a=!1;for(let n=0;n<l.length;n++){const c=l[n];if(c.includes(h))if(t=!0,c.slice(0,c.indexOf(h)).replace(/^\s*(?:#|\/\/|\/\*|--|<!--)\s*$/,"").trim()===""){const p=n+1,f=l[p];if(f===void 0){i.push(`extra-files: ${u}[${e.path}] annotation marker on the last line of ${o} (no following line to update).`);continue}const d=v(f,e.anchor);if(!d){i.push(e.anchor===void 0?`extra-files: ${u}[${e.path}] annotation marker at ${o}:${n+1} but no semver-shaped substring on the following line.`:`extra-files: ${u}[${e.path}] annotation marker at ${o}:${n+1} but anchor "${e.anchor}" / no semver-shaped substring after it on the following line.`);continue}l[p]=f.slice(0,d.index)+s+f.slice(d.index+d.match.length),a=!0}else{const p=v(c,e.anchor);if(!p){i.push(e.anchor===void 0?`extra-files: ${u}[${e.path}] annotation marker at ${o}:${n+1} but no semver-shaped substring on the marked line.`:`extra-files: ${u}[${e.path}] annotation marker at ${o}:${n+1} but anchor "${e.anchor}" / no semver-shaped substring after it on the marked line.`);continue}l[n]=c.slice(0,p.index)+s+c.slice(p.index+p.match.length),a=!0}}return t?a?{content:l.join(`
|
|
3
|
+
`),warnings:i}:{warnings:i}:(i.push(`extra-files: ${u}[${e.path}] annotation marker "${h}" not found in ${o}; rule may be stale.`),{warnings:i})},M=async(e,r,s,u,o)=>{let h;try{h=await R(e,"utf8")}catch(t){return t.code==="ENOENT"?{warnings:[`extra-files: ${o} → ${e} does not exist; skipping ${r.length} rule(s).`]}:{warnings:[`extra-files: ${o} → could not read ${e}: ${t.message}`]}}let i=h;const l=[];for(const t of r){if(y(t)){const f=q(t,i,s,o,e);l.push(...f.warnings),f.content!==void 0&&(i=f.content);continue}const a=E(t,`${o}[${t.path}]`),n=t.replace===void 0?s:F(t.replace,s,u);let c=!1;const p=i.replace(a,(f,...d)=>(c=!0,t.replace===void 0?n:n.replaceAll(/\$([&$1-9])/g,(D,$)=>{if($==="&")return f;if($==="$")return"$";const k=Number.parseInt($,10)-1,m=d[k];return typeof m=="string"?m:""})));if(!c){l.push(`extra-files: ${o}[${t.path}] regex /${t.search}/${t.flags??"g"} matched nothing in ${e}; rule may be stale.`);continue}i=p}return i===h?{warnings:l}:{content:i,warnings:l}},B=async(e,r,s,u,o=[],h=[])=>{const i=[],l=[],t=new Map;for(const a of o){const n=x(a.path)?a.path:w(e,a.path),c=t.get(n)??{label:"workspace",rules:[]};c.rules.push(a),t.set(n,c)}for(const a of h){const n=x(a.path)?a.path:w(r,a.path),c=t.get(n)??{label:"per-package",rules:[]};c.rules.push(a),t.set(n,c)}for(const[a,n]of t){const c=n.rules[0],p=await M(a,n.rules,s,u,n.label);l.push(...p.warnings),p.content!==void 0&&i.push({content:p.content,path:a,rule:c})}return{warnings:l,writes:i}};export{j as DEFAULT_ANNOTATION_MARKER,B as applyExtraFilesForRelease,E as compileRule};
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import{createRequire as F}from"node:module";import{j as w,E as k,s as b,q as
|
|
1
|
+
import{createRequire as F}from"node:module";import{j as w,E as k,s as b,q as J,V as C,I as j}from"../packem_shared/index.server-qvZ-cy29.js";import{y as I}from"../packem_shared/index-DND6ptxQ.js";import{a as D,r as E,b as m,c as B}from"../packem_shared/ai-fix-BgBU0TOz.js";import{p}from"./cli-main.js";import{l as N}from"../packem_shared/failure-log-ChuFC-8f.js";let A;const O=o=>(A??=F(import.meta.url))(o),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,q=o=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[t,r]=h.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return h.getBuiltinModule(o)}return O(o)},{createInterface:T}=q("node:readline"),L={"ambiguous-match":"ambiguous match",applied:"applied",error:"error","missing-file":"missing file","no-match":"no match","outside-workspace":"outside workspace"},R=(o,t,r)=>{const e=B(o,t,r),s=I(o,e);return s===""||s.startsWith("..")?e:s},M=(o,t,r)=>{const e=[w(`Fix proposal (${o.provider}, confidence: ${o.confidence})`),"",o.explanation||k("<no explanation>")];if(o.cannotFix)return e.push(""),e.push(b(`Cannot fix automatically: ${o.cannotFix}`)),e.join(`
|
|
2
2
|
`);if(o.patches.length===0)return e.push(""),e.push(b("No patches were proposed.")),e.join(`
|
|
3
|
-
`);e.push(""),e.push(w(`Patches (${String(o.patches.length)}):`));for(const[s,i]of o.patches.entries()){const a=
|
|
4
|
-
`))e.push(
|
|
3
|
+
`);e.push(""),e.push(w(`Patches (${String(o.patches.length)}):`));for(const[s,i]of o.patches.entries()){const a=R(t,r,i.file);e.push(""),e.push(J(`[${String(s+1)}] ${a}`)),i.reason&&e.push(k(` reason: ${i.reason}`));for(const u of i.oldString.split(`
|
|
4
|
+
`))e.push(C(` - ${u}`));for(const u of i.newString.split(`
|
|
5
5
|
`))e.push(j(` + ${u}`))}return e.join(`
|
|
6
|
-
`)},
|
|
7
|
-
`)},y=o=>{let t=0,r=0;for(const e of o)e.status==="applied"?t+=1:r+=1;return{applied:t,failed:r}},
|
|
8
|
-
`)}else{p.error("No task ID specified. Usage: vis ai fix <project>:<target>");const l=N(a);if(l.length>0){p.info("Tasks with captured failure logs:");for(const f of l)p.info(` - ${f}`)}else p.notice("No failure logs found. Re-run a failing task with `vis run` to capture logs.")}process.exitCode=1;return}const n=await
|
|
9
|
-
`):(p.error(`No failure log or run summary found for task "${i}".`),p.notice("Re-run the task with `vis run` so its terminal output and run metadata are captured.")),process.exitCode=1;return}n.terminalOutputCaptured||p.warn(`No captured terminal output for "${i}". Re-run with \`vis run\` for a better fix proposal.`);const
|
|
6
|
+
`)},_=(o,t,r)=>{const e=[];for(const s of o){const i=s.absolutePath?I(t,s.absolutePath)||s.absolutePath:R(t,r,s.patch.file),a=L[s.status];s.status==="applied"?e.push(j(` ✓ ${i}: ${a}`)):e.push(C(` ✗ ${i}: ${a}${s.error?` (${s.error})`:""}`))}return e.join(`
|
|
7
|
+
`)},y=o=>{let t=0,r=0;for(const e of o)e.status==="applied"?t+=1:r+=1;return{applied:t,failed:r}},U=o=>new Promise(t=>{const r=T({input:process.stdin,output:process.stderr});r.question(`${o} (y/N) `,e=>{r.close();const s=e.trim().toLowerCase();t(s==="y"||s==="yes")})}),W=o=>o??process.cwd(),X=async({argument:o,logger:t,options:r,visConfig:e,workspaceRoot:s})=>{const i=o[0],a=W(s),u=(r.format??"text")==="json";if(!i){if(u){const l=N(a);process.stdout.write(`${JSON.stringify({availableTasks:l,error:"No task ID specified"},void 0,2)}
|
|
8
|
+
`)}else{p.error("No task ID specified. Usage: vis ai fix <project>:<target>");const l=N(a);if(l.length>0){p.info("Tasks with captured failure logs:");for(const f of l)p.info(` - ${f}`)}else p.notice("No failure logs found. Re-run a failing task with `vis run` to capture logs.")}process.exitCode=1;return}const n=await D(a,i,{runId:r.run});if(!n){u?process.stdout.write(`${JSON.stringify({error:"No failure log or run summary found",taskId:i},void 0,2)}
|
|
9
|
+
`):(p.error(`No failure log or run summary found for task "${i}".`),p.notice("Re-run the task with `vis run` so its terminal output and run metadata are captured.")),process.exitCode=1;return}n.terminalOutputCaptured||p.warn(`No captured terminal output for "${i}". Re-run with \`vis run\` for a better fix proposal.`);const S=e?.ai,c=await E(n,t,{cache:r.cache!==!1,config:S});if(!c){u&&process.stdout.write(`${JSON.stringify({error:"AI fix proposal failed or no provider available",taskId:i},void 0,2)}
|
|
10
10
|
`),process.exitCode=1;return}const g=r.apply===!0;if(u){const l=g?void 0:await m(a,n.cwd,c,{dryRun:!0}),f=g?await m(a,n.cwd,c):void 0;if(process.stdout.write(`${JSON.stringify({appliedResults:f,dryRunResults:l,failureContext:{cwd:n.cwd,hash:n.hash,runId:n.runId,taskId:n.taskId,terminalOutputCaptured:n.terminalOutputCaptured},proposal:c},void 0,2)}
|
|
11
|
-
`),g&&f){const{failed:P}=y(f);P>0&&(process.exitCode=1)}return}if(t.info(
|
|
11
|
+
`),g&&f){const{failed:P}=y(f);P>0&&(process.exitCode=1)}return}if(t.info(M(c,a,n.cwd)),c.cannotFix||c.patches.length===0)return;const x=await m(a,n.cwd,c,{dryRun:!0}),$=y(x);if(t.info(""),t.info(w("Patch validation:")),t.info(_(x,a,n.cwd)),!g){t.info(""),p.info("Re-run with --apply to write these patches to disk.");return}if($.applied===0){p.error("No patches can be applied (every patch failed validation)."),process.exitCode=1;return}if(r.yes!==!0&&(t.info(""),!await U(`Apply ${String($.applied)} patch${$.applied===1?"":"es"} to disk?`))){p.notice("Aborted. Nothing written.");return}const v=await m(a,n.cwd,c),d=y(v);t.info(""),t.info(w("Apply results:")),t.info(_(v,a,n.cwd)),t.info(""),d.failed===0?p.success(`Applied ${String(d.applied)} patch${d.applied===1?"":"es"}.`):(p.warn(`${String(d.applied)} applied, ${String(d.failed)} failed.`),process.exitCode=1)};export{X as aiFix};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{L as v,h,N as u}from"../packem_shared/pm-runner-
|
|
1
|
+
import{L as v,h,N as u}from"../packem_shared/pm-runner-Bssje5qH.js";import{r as w,a as C}from"../packem_shared/command-runtime-BVi4lL8k.js";import{i as R}from"../packem_shared/utils-CRueU43T.js";const b=async({argument:f,logger:l,options:e,rawUnknown:m,visConfig:s,workspaceRoot:d})=>{const a=f;if(!a||a.length===0)throw new Error("No command specified. Usage: vis exec <command> [args...]");const[n,...c]=a,t=m??[],i=t[0]==="--"?c:[...c,...t],o=d??process.cwd(),p=R(e.filter);let r=!e.recursive&&!e.workspaceRoot&&!e.parallel&&!e.reverse&&!e.shellMode&&p.length===0?v(n,i,o):null;if(r===null){const g=w({logger:l,options:e,visConfig:s},o),k=h(o,{backend:C(g),configBackend:s?.install?.backend,configCorepack:s?.install?.corepack});r=u(k,{args:i,command:n,filter:p,parallel:e.parallel||!1,recursive:e.recursive||!1,reverse:e.reverse||!1,shellMode:e.shellMode||!1,workspaceRoot:e.workspaceRoot||!1},o,l)}r!==0&&(process.exitCode=r)};export{b as default};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`),
|
|
3
|
-
`)),n.push(i))}catch{
|
|
4
|
-
Type "uninstall" to confirm: `,h)});if(e.close(),p.trim()!=="uninstall"){n.info("Aborted.");return}}const
|
|
5
|
-
✓ Removed ${c}`)}catch(e){throw new Error(`Failed to remove ${c}: ${e instanceof Error?e.message:String(e)}`,{cause:e})}n.info("✓ vis has been uninstalled.")};export{
|
|
1
|
+
import{createRequire as _}from"node:module";import{l as a,z as d,m as r,q as y}from"../packem_shared/index-DND6ptxQ.js";import{b}from"../packem_shared/en-BxrK-n-J.js";let g;const v=s=>(g??=_(import.meta.url))(s),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=s=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[n,i]=t.versions.node.split(".").map(Number);if(n>22||n===22&&i>=3||n===20&&i>=16)return t.getBuiltinModule(s)}return v(s)},{homedir:o}=u("node:os"),{createInterface:w}=u("node:readline"),c=b(),m=[r(o(),".zshrc"),r(o(),".zshenv"),r(o(),".bashrc"),r(o(),".bash_profile"),r(o(),".profile"),r(o(),".config","fish","config.fish")],j=s=>{const n=[];for(const i of m)if(a(i))try{const f=d(i).split(`
|
|
2
|
+
`),l=f.filter(e=>!e.includes(".vis/bin")&&!e.includes("VIS_HOME")&&!e.includes("# vis "));l.length!==f.length&&(y(i,l.join(`
|
|
3
|
+
`)),n.push(i))}catch{s.warn(`warning: could not clean ${i}`)}return n},E=async({fs:s,logger:n,options:i})=>{if(!a(c)){n.info("vis is not installed (no ~/.vis directory found).");return}n.info("This will remove:"),n.info(` ${c}/`);const f=m.filter(e=>a(e)&&d(e).includes(".vis"));for(const e of f)n.info(` Lines in ${e}`);if(!i.yes){if(!process.stdin.isTTY)throw new Error("Non-interactive terminal. Use --yes to confirm.");const e=w({input:process.stdin,output:process.stdout}),p=await new Promise(h=>{e.question(`
|
|
4
|
+
Type "uninstall" to confirm: `,h)});if(e.close(),p.trim()!=="uninstall"){n.info("Aborted.");return}}const l=j(n);for(const e of l)n.info(`Cleaned ${e}`);try{await s.rm(c,{force:!0,recursive:!0}),n.info(`
|
|
5
|
+
✓ Removed ${c}`)}catch(e){throw new Error(`Failed to remove ${c}: ${e instanceof Error?e.message:String(e)}`,{cause:e})}n.info("✓ vis has been uninstalled.")};export{E as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as f,a as d}from"../packem_shared/pm-runner-
|
|
1
|
+
import{h as f,a as d}from"../packem_shared/pm-runner-Bssje5qH.js";import{r as k,a as m}from"../packem_shared/command-runtime-BVi4lL8k.js";const h=async({argument:o,logger:s,options:i,process:c,visConfig:e,workspaceRoot:r})=>{if(!o||o.length===0)throw new Error("No package specified. Usage: vis info <package> [field...]");const[t,...l]=o,a=r??c.cwd,p=k({logger:s,options:i,visConfig:e},a),g=f(a,{backend:m(p),configBackend:e?.install?.backend,configCorepack:e?.install?.corepack}),n=d(g,{fields:l,json:i.json||!1,package:t},a,s);n!==0&&n!==1&&(process.exitCode=n)};export{h as default};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{createRequire as D}from"node:module";import{m,y as
|
|
1
|
+
import{createRequire as D}from"node:module";import{m as d,y as F,l as $,q as b}from"../packem_shared/index-DND6ptxQ.js";import{findVisConfigFile as I,DEFAULT_MIN_RELEASE_AGE_MINUTES as h}from"./CONFIG_FILES.js";import{p as e,e as q}from"./cli-main.js";import{A as G}from"../packem_shared/pm-runner-Bssje5qH.js";import{w as P}from"../packem_shared/build-scripts-CM8M1xcG.js";import{O as A}from"../packem_shared/native-config-sync-C0pUePad.js";import{S as x}from"../packem_shared/min-release-age-V6L6dpiP.js";let N;const M=i=>(N??=D(import.meta.url))(i),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=i=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[s,o]=g.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return g.getBuiltinModule(i)}return M(i)},{execFileSync:O}=R("node:child_process"),{createInterface:B}=R("node:readline"),K=i=>{const s=[];return $(d(i,"turbo.json"))&&s.push("turborepo"),$(d(i,"nx.json"))&&s.push("nx"),$(d(i,".moon"))&&s.push("moon"),s},E=(i,s)=>new Promise(o=>{i.question(s,t=>{o(t.trim())})}),u=async(i,s,o=!0)=>{const t=await E(i,`${s} ${o?"[Y/n]":"[y/N]"} `);return t===""?o:t.toLowerCase()==="y"||t.toLowerCase()==="yes"},w=(i,s)=>{const o=[],t=Object.entries(s.allowBuilds).filter(([,c])=>c).map(([c])=>` "${c}": true,`).join(`
|
|
2
2
|
`),a=[` installScripts: {
|
|
3
|
-
allow: ${
|
|
4
|
-
${
|
|
3
|
+
allow: ${t?`{
|
|
4
|
+
${t}
|
|
5
5
|
}`:"{}"},
|
|
6
6
|
},`];s.minimumReleaseAge!==void 0&&a.push(` firstSeen: {
|
|
7
7
|
minutes: ${String(s.minimumReleaseAge)},
|
|
@@ -21,7 +21,7 @@ ${o.join(`
|
|
|
21
21
|
|
|
22
22
|
`)}
|
|
23
23
|
});
|
|
24
|
-
`},
|
|
24
|
+
`},L=async(i,s,o)=>{const t=B({input:process.stdin,output:process.stdout});e.info(`
|
|
25
25
|
vis init — interactive setup
|
|
26
|
-
`);const a=await u(
|
|
27
|
-
`);for(const r of
|
|
26
|
+
`);const a=await u(t," Enable Socket.dev security scanning?");a&&(e.success(" Socket.dev enabled — scores, alerts, and supply chain data active."),process.env.VIS_SOCKET_TOKEN||e.notice(" Set VIS_SOCKET_TOKEN for a custom API token (optional).")),e.info("");const n=await u(t," Enable Google deps.dev (OpenSSF Scorecard + GHSA advisories)?");n&&e.success(" deps.dev enabled — Scorecard signals and advisories merged into the security report."),e.info("");const c=await u(t," Scan for packages with build scripts?"),p={};if(c){e.info(" Scanning node_modules...");const l=P(i,{});if(l.length>0){e.info(` Found ${String(l.length)} package${l.length===1?"":"s"} with build scripts:
|
|
27
|
+
`);for(const r of l){const f=await u(t,` Allow ${r}?`,!1),_=r.split(" (")[0]??r;p[_]=f,f&&e.success(` ✓ ${_} approved`)}}else e.info(" No packages with build scripts found.")}e.info("");const T=await u(t," Enforce a minimum release age (block freshly-published versions)?");let m;if(T){const l=await E(t,` Minimum age in minutes (default ${String(h)} = 2 days): `),r=l===""?h:Number.parseInt(l,10);m=Number.isFinite(r)&&r>0?r:h,e.success(` minimumReleaseAge: ${String(m)} minutes`)}e.info("");const y=await u(t," Set up pre-commit hooks (lint-staged)?",!1);let S=!1;(s.name==="pnpm"||s.name==="yarn"||s.name==="npm"||s.name==="bun")&&(e.info(""),S=await u(t,` Sync security settings to ${s.name} config?`));const v=K(i);if(v.length>0&&(e.info(""),e.info(` Detected existing tools: ${v.join(", ")}`),await u(t,` Run \`vis migrate\` for ${v.join(", ")}?`,!1))){t.close();const[l,...r]=s.name==="pnpm"?["pnpm","exec"]:s.name==="yarn"?["yarn","exec"]:s.name==="bun"?["bunx"]:["npx"];for(const f of v){e.info(` Migrating from ${f}...`);try{O(l,[...r,"vis","migrate",f],{cwd:i,stdio:"inherit"})}catch{e.warn(` Migration from ${f} had issues — run \`vis migrate ${f}\` manually.`)}}if($(o))e.success(`Migrated config written to ${o}`);else{const f=w(s.name,{allowBuilds:p,enableDepsDev:n,enableSocket:a,minimumReleaseAge:m,staged:y});b(o,f),e.success(`Created ${o}`)}e.notice(" Run 'vis doctor' to see your project's full health status.");return}t.close(),e.info("");const C=w(s.name,{allowBuilds:p,enableDepsDev:n,enableSocket:a,minimumReleaseAge:m,staged:y});if(b(o,C),e.success(`Created ${o}`),S){const l=Object.fromEntries(Object.entries(p).filter(([,r])=>r));for(const r of A(s.name,i,l))e.success(` ${r}`);for(const r of x(s.name,i,m))e.success(` ${r}`)}e.info(""),e.info(" Setup complete. Your config:");const j=[a&&"Socket.dev",n&&"deps.dev"].filter(Boolean);e.info(` Security: ${j.length>0?`${j.join(" + ")} enabled`:"defaults only"}`),e.info(` Build scripts: ${Object.values(p).filter(Boolean).length} approved`),e.info(` Min age: ${m===void 0?"not enforced":`${String(m)} minutes`}`),e.info(` Git hooks: ${y?"lint-staged configured":"not configured"}`),e.info(` PM sync: ${S?"done":"skipped"}`),e.info(""),e.notice(" Run 'vis doctor' to see your project's full health status."),e.info("")},U=(i,s,o,t)=>{const a=w(s.name,{allowBuilds:{},enableDepsDev:!1,enableSocket:!1,minimumReleaseAge:h,staged:!1});if(b(t,a),e.success(`Created ${t}`),e.info(" Secure defaults are applied automatically by defineConfig()."),o.syncNative){for(const n of A(s.name,i,{}))e.success(` ${n}`);for(const n of x(s.name,i,h))e.success(` ${n}`)}e.info(""),e.notice("Run 'vis doctor' for a full health check, or 'vis init' in a terminal for guided setup.")},k=(i,s,o)=>{const t=d(i,".."),a=d(s,"node_modules","@visulima","vis","schemas",o),n=F(t,a),c=n===""?`./${o}`:n.split(/[/\\]/u).join("/");return c.startsWith(".")?c:`./${c}`},V=(i,s)=>{const o=k(d(i,"project.json"),s,"project.schema.json"),t=k(d(i,"vis.config.ts"),s,"vis-config.schema.json");e.info(""),e.info("Paste these into your config files to get editor IntelliSense:"),e.info(""),e.info(` project.json → "$schema": "${o}"`),e.info(` vis.config.ts → see ${t} (vis.config.ts is TypeScript; use the import path directly)`),e.info(""),e.notice("For nested project.json files, the `..` depth changes — run `vis migrate nx` to auto-rewrite all of them.")},ee=async({options:i,workspaceRoot:s})=>{const o=s??process.cwd();if(i.schema){V(o,o);return}const t=G(o),a=I(o);if(a&&!i.force){e.warn(`Config already exists: ${a}`),e.notice("Use --force to overwrite, or edit the existing file.");return}const n=a??d(o,"vis.config.ts");process.stdin.isTTY&&i.interactive!==!1?await L(o,t,n):U(o,t,i,n);const c=q(o);c.added.length>0&&e.success(`Added to .gitignore: ${c.added.join(", ")}`)};export{k as buildSchemaRefForTesting,ee as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{I as $,E as u,V as k,s as y}from"../packem_shared/index.server-qvZ-cy29.js";import{p}from"./cli-main.js";import{r as N,M,a as R,b as S,c as x,d as A,e as V,f as b,g as C,h as E}from"../packem_shared/s1ngularity-
|
|
1
|
+
import{I as $,E as u,V as k,s as y}from"../packem_shared/index.server-qvZ-cy29.js";import{p}from"./cli-main.js";import{r as N,M,a as R,b as S,c as x,d as A,e as V,f as b,g as C,h as E}from"../packem_shared/s1ngularity-DsmC71xt.js";import{g as P,r as j}from"../packem_shared/packument-N3EWbZpL.js";import{r as B}from"../packem_shared/provenance-9OT8sTqn.js";import{r as D}from"../packem_shared/signatures-Dwx5fD4g.js";const v=new Set(["archivedRepo","author","downloads","expiredDomains","metadata","newBin","provenance","s1ngularity","signatures"]),I=r=>{const s=r.trim();if(s==="")return;if(s.startsWith("@")){const o=s.indexOf("@",1);return o===-1?{name:s,spec:void 0}:{name:s.slice(0,o),spec:s.slice(o+1)||void 0}}const i=s.indexOf("@");return i===-1?{name:s,spec:void 0}:{name:s.slice(0,i),spec:s.slice(i+1)||void 0}},O=r=>{if(r===void 0||r.trim()==="")return;const s=new Set;for(const i of r.split(",")){const o=i.trim();if(!v.has(o))throw new Error(`Unknown marshall in --only: ${o}. Known: ${[...v].sort().join(", ")}.`);s.add(o)}return s},m=(r,s)=>r===void 0||r.has(s),F=r=>r?.has("signatures")??!1,K=async({argument:r,options:s,workspaceRoot:i})=>{if(!r||r.length===0)throw new Error("No package specified. Usage: vis inspect <package>[@<spec>]");const o=I(r[0]);if(o===void 0)throw new Error(`Invalid package argument: "${String(r[0])}". Usage: vis inspect <package>[@<spec>]`);const t=O(s.only),f=await P(o.name,{workspaceRoot:i});if(f===void 0){p.error(`Package ${o.name} not found in the registry.`),process.exitCode=2;return}const g=j(f,o.spec);if(g===void 0){p.error(`Could not resolve ${o.name}@${o.spec??"latest"} to a published version.`),process.exitCode=2;return}const c=[{name:o.name,version:g}],n=new M;if(m(t,"author")){const e=await N(c,{workspaceRoot:i});for(const a of e)n.add({marshall:"author",message:a.message,packageName:a.packageName,severity:a.severity})}if(m(t,"provenance")){const e=await B(c);for(const a of e)n.add({marshall:"provenance",message:`Prior version ${a.priorVersionWithProvenance} had provenance but ${a.version} does not.`,packageName:a.packageName,severity:"error"})}if(m(t,"s1ngularity")){const e=await R(c,{workspaceRoot:i});for(const a of e){const d=a.hookChanges.map(w=>`${w.hook} (${w.kind})`).join(", "),l=a.hookChanges.length===1;n.add({marshall:"s1ngularity",message:`${a.version} ${l?"has an":"has"} install-script ${l?"change":"changes"} [${d}] AND dropped the provenance attestation that ${a.priorVersion} carried — this is the s1ngularity compromised-publish shape.`,packageName:a.packageName,severity:"error"})}}if(m(t,"newBin")){const e=await S(c);for(const a of e){const d=a.newBins.map(l=>l.command).join(", ");n.add({marshall:"newBin",message:`${a.toVersion} adds new bin script${a.newBins.length===1?"":"s"}: ${d} (prior: ${a.fromVersion}).`,packageName:a.packageName,severity:"warning"})}}if(m(t,"metadata")){const e=await x(c,{workspaceRoot:i});for(const a of e)n.add({marshall:"metadata",message:`Missing/invalid metadata: ${a.issues.join(", ")}.`,packageName:a.packageName,severity:"warning"})}if(m(t,"downloads")){const e=await A([o.name]);for(const a of e){const d=a.downloadsLastMonth===void 0?"unknown":String(a.downloadsLastMonth);n.add({marshall:"downloads",message:a.kind==="no-data"?"npm stats API returned no monthly download data.":`Only ${d} downloads in the past month.`,packageName:a.packageName,severity:a.severity})}}if(m(t,"expiredDomains")){const e=await V(c,{workspaceRoot:i});for(const a of e)n.add({marshall:"expiredDomains",message:a.kind==="expired"?`Maintainer email domain ${a.domain} (${a.maintainer}) is unregistered — potential hijack risk.`:`Could not verify maintainer email domain ${a.domain} (${a.maintainer}).`,packageName:a.packageName,severity:a.severity})}if(F(t)){const e=await D(c,{workspaceRoot:i});for(const a of e)n.add({marshall:"signatures",message:a.message,packageName:a.packageName,severity:a.severity})}if(m(t,"archivedRepo")){const e=await b(c,{workspaceRoot:i});for(const a of e)n.add({marshall:"archivedRepo",message:a.kind==="archived"?`Source repo ${a.owner}/${a.repo} is archived${a.archivedAt===void 0?"":` (since ${a.archivedAt})`}.`:`Source repo ${a.owner}/${a.repo} returned 404 from GitHub.`,packageName:a.packageName,severity:"warning"})}const h=n.all();if(s.json===!0)process.stdout.write(`${JSON.stringify(C(h),void 0,2)}
|
|
2
2
|
`);else{const e=`${o.name}@${g}`;if(h.length===0)p.info(`${$("✓")} ${e} — no findings.`);else{p.info(`${u("Inspecting")} ${e}`);for(const l of E(h))process.stdout.write(`${l}
|
|
3
3
|
`);const a=n.errors().length,d=n.warnings().length;process.stdout.write(`
|
|
4
4
|
${u("Summary:")} ${k(`${String(a)} error${a===1?"":"s"}`)}, ${y(`${String(d)} warning${d===1?"":"s"}`)}.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{m as C,
|
|
1
|
+
import{m as C,l as _,H as A,j as B}from"../packem_shared/index-DND6ptxQ.js";import{p as t}from"./cli-main.js";import{A as F,h,I as H,C as T}from"../packem_shared/pm-runner-Bssje5qH.js";import{a as M,r as N}from"../packem_shared/command-runtime-BVi4lL8k.js";import{s as Q}from"../packem_shared/typosquats-BUGgotNu.js";import{h as U,P as V}from"../packem_shared/peer-warnings-BXAzXqY3.js";import{i as W}from"../packem_shared/utils-CRueU43T.js";const G=["pnpm-lock.yaml","yarn.lock","package-lock.json","npm-shrinkwrap.json","bun.lock","bun.lockb"],J=a=>{let r=a;for(;;){for(const l of G)if(_(C(r,l)))return!0;const n=A(r);if(n===r||B(r).root===r)return!1;r=n}},g=new Set(["aube","auto","bun","npm","pnpm","yarn"]),se=async a=>{const{argument:r,fs:n,logger:l,options:e,visConfig:i,workspaceRoot:w}=a,s=w??process.cwd();if(r&&r.length>0){const o=e,{default:q}=await import("./handler15.js"),I=o.marshallCheck===!1||o["no-marshall-check"]===!0?!1:void 0,z=o.socketCheck===!1||o["no-socket-check"]===!0?!1:void 0,E=o.typosquatCheck===!1||o["no-typosquat-check"]===!0?!1:void 0,P=o.runScripts===!0||o["run-scripts"]===!0,j=o.workspaceRoot===!0||o["workspace-root"]===!0,D=o.saveOptional===!0||o["save-optional"]===!0,$=e.dev===!0,L={autoInstallPeers:!1,exact:o.exact===!0,filter:e.filter,global:!1,marshallCheck:I,runScripts:P,saveDev:$,saveOptional:D,savePeer:!1,socketCheck:z,to:void 0,typosquatCheck:E,workspace:!1,workspaceRoot:j};await q({...a,argument:r,options:L});return}if(e.typosquatCheck!==!1&&!await Q(s,i?.security?.typosquatAllowlist)){process.exitCode=1;return}const c=e.installer;if(c&&!g.has(c)){t.error(`Invalid --installer value: "${c}". Expected one of: ${[...g].join(", ")}.`),process.exitCode=1;return}const y=c,b=e.aube===!1,f=M(N({logger:l,options:e,visConfig:i},s));let p;try{p=b?f===void 0?F(s):h(s,{backend:f}):h(s,{backend:y??f,configBackend:i?.install?.backend,configCorepack:i?.install?.corepack})}catch(o){t.error(o instanceof Error?o.message:String(o)),process.exitCode=1;return}const m=H(s,p);m&&t.warn(m);const x=W(e.filter),u=e.ci||!1,d=e.frozenLockfile||u,O=e.frozenLockfile===!1||e.force||e.lockfileOnly,R=J(s),v=d||!O&&R;if(!d&&v&&!e.silent&&t.info("Defaulting to frozen lockfile (pass --no-frozen-lockfile to allow lockfile updates)."),u){t.info("Clean install: removing node_modules...");try{await n.rm(C(s,"node_modules"),{force:!0,recursive:!0})}catch(o){t.error(`Failed to remove node_modules: ${o instanceof Error?o.message:String(o)}`),process.exitCode=1;return}}const{code:k,output:S}=await T(p,{dev:e.dev||!1,filter:x,force:e.force||!1,frozenLockfile:v,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,l,{ciMode:u,preferOffline:e.preferOffline||!1});k!==0&&(process.exitCode=k),k===0&&!e.silent&&U(S)&&t.info(V)};export{se as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{createRequire as M}from"node:module";import{I as
|
|
1
|
+
import{createRequire as M}from"node:module";import{I as x,E as j,V as L,s as O}from"../packem_shared/index.server-qvZ-cy29.js";import{m as B,c as N}from"../packem_shared/index-DND6ptxQ.js";import{T as F}from"../packem_shared/package-version-DjHDww_5.js";import"../packem_shared/public-api-WqUCiyIe.js";import{b as z,f as U,v as V,R as H,g as J}from"./catalog.js";import{i as b,p as f}from"./cli-main.js";import{h as W,j as Y,y as G}from"../packem_shared/pm-runner-Bssje5qH.js";import{r as K,a as Q}from"../packem_shared/command-runtime-BVi4lL8k.js";import{r as _,a as X,p as Z,b as ee}from"../packem_shared/resolve-explicit-DC3XssJa.js";import{H as oe,F as C,D as te,J as se,y,B as ne,h as re}from"../packem_shared/en-BxrK-n-J.js";import{r as ie}from"../packem_shared/typosquats-BUGgotNu.js";import{f as D,i as R}from"../packem_shared/utils-CRueU43T.js";import{a as ae}from"../packem_shared/readJsonSync-BnWiH5-R-BpnwAB0Z.js";let q;const T=t=>(q??=M(import.meta.url))(t),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,A=t=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[c,e]=w.versions.node.split(".").map(Number);if(c>22||c===22&&e>=3||c===20&&e>=16)return w.getBuiltinModule(t)}return T(t)},{createInterface:I}=A("node:readline"),S=t=>t==="default"?"catalog:":`catalog:${t}`,v=t=>t==="default"?"default catalog":`catalog "${t}"`,ce=(t,c)=>{const e=[];for(const[o,s]of c)o.includes(":")||s.has(t)&&e.push(o);if(e.length===0)return;if(e.length===1){const[o]=e;return{source:v(o),spec:S(o)}}const r=e.find(o=>o==="default")??e[0],i=e.filter(o=>o!==r);return{candidates:[...e],conflict:!0,source:`${v(r)} (also in: ${i.map(o=>v(o)).join(", ")})`,spec:S(r)}},le=(t,c)=>{const e=new Map;for(const[a,u]of c){if(!a.includes(":"))continue;const p=u.get(t);p!==void 0&&e.set(p,(e.get(p)??0)+1)}if(e.size===0)return;const r=[...e.entries()],i=r.reduce((a,[,u])=>a+u,0);if(r.length===1){const[[a]]=r;return{source:`siblings (${String(i)} pkg${i===1?"":"s"} on ${a})`,spec:a}}const o=[...r].sort((a,u)=>u[1]-a[1]),[s,n]=o[0],l=o.slice(1).map(([a,u])=>`${a} (×${String(u)})`);return{candidates:o.map(([a])=>a),conflict:!0,source:`siblings (most common: ${s} ×${String(n)}; conflicts: ${l.join(", ")})`,spec:s}},pe=(t,c)=>ce(t,c)||le(t,c),fe=(t,c,e)=>{const r=[];for(const i of t.values()){const{overall:o}=i.score,s=ne(o),n=`${String(Math.round(o*100))}%`,l=i.alerts.length,a=y(i),u=oe(a,i.version,e),p=s==="red"?L:s==="yellow"?O:x;if(u?f.info(` ${p(n)} ${C(i)} ${j(`[accepted: ${u.reason}]`)}`):f.info(` ${p(n)} ${C(i)}`),l>0){const g=i.alerts.filter(d=>d.severity==="critical"||d.severity==="high").length;g>0&&f.warn(` ${String(g)} critical/high alert${g===1?"":"s"}`)}o<c&&!u&&r.push(i)}return r},ue=async(t,c)=>{const e=I({input:process.stdin,output:process.stdout}),r=n=>new Promise(l=>{e.question(n,a=>{l(a.trim())})}),i=String(Math.round(c*100));f.warn(""),f.warn(`${String(t.length)} package${t.length===1?"":"s"} scored below the minimum threshold (${i}%):`);for(const n of t){const l=y(n),a=`${String(Math.round(n.score.overall*100))}%`;f.warn(` • ${l}@${n.version} — score: ${a} (${te(n.score.overall)})`)}f.warn("");const o=await r("Continue adding these packages? [y/N] ");if(o.toLowerCase()!=="y"&&o.toLowerCase()!=="yes")return e.close(),!1;const s=await r("Remember this decision? (prints config snippet) [y/N] ");if(e.close(),s.toLowerCase()==="y"||s.toLowerCase()==="yes"){f.notice(""),f.notice("Add the following to security.acceptedRisks in vis.config.ts:"),f.notice("");for(const n of t){const l=y(n),a=se(l,n.version,n.score.overall,"Reviewed and accepted");f.notice(a)}f.notice("")}return!0},de=async(t,c,e,r)=>{const i=await _(t);if(i.length===0)return!0;f.info(""),f.info(`${c.map(n=>n.displayName).join(" + ")} security check:`);const o=await U(c,i);if(o.size===0)return f.info(" Could not fetch security data. Proceeding."),!0;const s=fe(o,e,r);return s.length===0?(f.info(""),!0):process.stdin.isTTY?ue(s,e):(f.warn(`Aborting: ${String(s.length)} package${s.length===1?"":"s"} below minimum score. Use --no-socket-check to skip.`),!1)},ge=["dependencies","devDependencies","peerDependencies","optionalDependencies"],me=t=>t.savePeer?"peerDependencies":t.saveOptional?"optionalDependencies":t.saveDev?"devDependencies":"dependencies",P=(t,c)=>t.startsWith("catalog:")||!c?t:t.replace(/^[\^~]/,""),he=async(t,c)=>{const e=[];for(const o of t){const{name:s,versionSpec:n}=D(o);if(!s)continue;if(n!==void 0){e.push({explicit:n,name:s});continue}const l=pe(s,c);if(l){l.conflict&&f.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 r=e.filter(o=>"kind"in o&&o.kind==="missing").map(o=>o.name),i=r.length>0?await ee(r):new Map;return e.map(o=>{if("explicit"in o)return{name:o.name,source:"explicit",spec:o.explicit};if(o.kind==="resolved")return o.entry;const s=i.get(o.name);if(s===void 0)throw new Error(`--to: cannot resolve a version for "${o.name}" (not in any catalog or sibling, and registry lookup failed). Pass ${o.name}@<version> explicitly.`);const n=`^${s}`;return f.info(`${o.name}: no existing constraint — using registry latest (${n}). Add to a catalog to share this version across workspace packages.`),{name:o.name,source:"registry latest",spec:n}})},ke=(t,c,e,r)=>{for(const{name:i,spec:o}of c){const s=P(o,r);for(const l of ge){if(l===e)continue;const a=t[l];a?.[i]!==void 0&&(delete a[i],Object.keys(a).length===0&&delete t[l])}let n=t[e];n===void 0&&(n={},t[e]=n),n[i]=s}},we=async({ignoreScripts:t,logger:c,options:e,packages:r,pm:i,target:o,visConfig:s,workspaceRoot:n})=>{const{workspace:l}=V(n,s??{}),a=l.projects[o];if(!a){const m=Object.keys(l.projects).sort();throw new Error(`--to: workspace package "${o}" not found. Available: ${m.length>0?m.slice(0,10).join(", "):"(none)"}${m.length>10?`, ... (${String(m.length-10)} more)`:""}.`)}const u=B(n,a.root,"package.json"),{packageManager:p}=F(n),g=H(n,p),d=me(e),k=e.exact??!1,h=await he(r,g);if(h.length===0)return 0;const $=ae(u);ke($,h,d,k),N(u,$,{indent:J(u,{useEditorconfig:s?.editorconfig??!0}),overwrite:!0});for(const m of h){const E=P(m.spec,k);f.info(`${x("+")} ${m.name}@${E} → ${o}/${d} (${j(m.source)})`)}return G(i,{dev:!1,filter:[],force:!1,frozenLockfile:!1,ignoreScripts:t,lockfileOnly:!1,noOptional:!1,offline:!1,prod:!1,recursive:!1,silent:!1,workspaceRoot:!1},n,c)},qe=async({argument:t,logger:c,options:e,visConfig:r,workspaceRoot:i})=>{let o=t;if(!o||o.length===0)throw new Error("No packages specified. Usage: vis add <packages...>");if(e.typosquatCheck!==!1){const p=o.map(d=>D(d)),g=await ie(p.map(d=>d.name),r?.security?.typosquatAllowlist);if(!g.ok){process.exitCode=1;return}o=p.map((d,k)=>{const h=g.packages[k];return h!==d.name?d.versionSpec?`${h}@${d.versionSpec}`:h??"":o[k]??""})}if(e.marshallCheck!==!1){const p=await _(o);if(p.length>0){const g=await X(p,{config:r?.security?.marshalls,workspaceRoot:i});if(!await Z(g)){process.exitCode=1;return}}}if(e.socketCheck!==!1){const p=new Set;b("socket")&&p.add("socket"),b("depsDev")&&p.add("deps-dev");const g=z(r?.security,{disabled:p,minimumScore:r?.security?.policies?.score?.minimum});if(g.length>0){const d=r?.security?.policies?.score?.minimum??re;if(!await de(o,g,d,r?.security?.acceptedRisks)){process.exitCode=1;return}}}const s=process.cwd(),n=K({logger:c,options:e,visConfig:r},i??s),l=W(i??s,{backend:Q(n),configBackend:r?.install?.backend,configCorepack:r?.install?.corepack}),a=!e.runScripts;if(e.to){if(e.global||e.workspaceRoot)throw new Error("--to is incompatible with --global / --workspace-root.");if(e.filter&&R(e.filter).length>0)throw new Error("--to and --filter are mutually exclusive — --to already targets one package.");if(!i)throw new Error("--to requires a monorepo workspace. Run from inside a pnpm/bun/yarn/npm workspace.");const p=await we({ignoreScripts:a,logger:c,options:e,packages:o,pm:l,target:e.to,visConfig:r,workspaceRoot:i});p!==0&&(process.exitCode=p);return}const u=Y(l,{exact:e.exact||!1,filter:R(e.filter),global:e.global||!1,optional:e.saveOptional||!1,packages:o,peer:e.savePeer||!1,saveDev:e.saveDev||!1,workspace:e.workspace||!1,workspaceRoot:e.workspaceRoot||!1},s,c,{autoInstallPeers:e.autoInstallPeers||!1,ignoreScripts:a});u!==0&&(process.exitCode=u)};export{qe as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as m,S as p}from"../packem_shared/pm-runner-
|
|
1
|
+
import{h as m,S as p}from"../packem_shared/pm-runner-Bssje5qH.js";import{r as g,a as d}from"../packem_shared/command-runtime-BVi4lL8k.js";const u=async({argument:s,logger:e,options:r,visConfig:o,workspaceRoot:t})=>{const c=s?.[0]??null,n=t??process.cwd(),i=g({logger:e,options:r,visConfig:o},n),l=m(n,{backend:d(i),configBackend:o?.install?.backend,configCorepack:o?.install?.corepack}),a=p(l,c,n,e);a!==0&&(process.exitCode=a)};export{u as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as f,U as k}from"../packem_shared/pm-runner-
|
|
1
|
+
import{h as f,U as k}from"../packem_shared/pm-runner-Bssje5qH.js";import{r as h,a as w}from"../packem_shared/command-runtime-BVi4lL8k.js";const C=async({argument:c,logger:a,options:t,rawUnknown:l,visConfig:n,workspaceRoot:p})=>{const o=c;if(!o||o.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[d,...i]=o,s=l??[],g=s[0]==="--"?i:[...i,...s],e=p??process.cwd(),u=h({logger:a,options:t,visConfig:n},e),m=f(e,{backend:w(u),configBackend:n?.install?.backend,configCorepack:n?.install?.corepack}),r=k(m,d,g,e,a);r!==0&&(process.exitCode=r)};export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{h as f,E as g}from"../packem_shared/pm-runner-
|
|
1
|
+
import{h as f,E as g}from"../packem_shared/pm-runner-Bssje5qH.js";import{r as k,a as m}from"../packem_shared/command-runtime-BVi4lL8k.js";import{c as v,i as d}from"../packem_shared/utils-CRueU43T.js";const b=async({argument:c,logger:a,options:e,rawUnknown:t,visConfig:o,workspaceRoot:r})=>{const n=v(c,t);if(n.length===0)throw new Error("No packages specified. Usage: vis remove <packages...>");const s=process.cwd(),l=k({logger:a,options:e,visConfig:o},r??s),p=f(r??s,{backend:m(l),configBackend:o?.install?.backend,configCorepack:o?.install?.corepack}),i=g(p,{filter:d(e.filter),global:e.global||!1,packages:n,recursive:e.recursive||!1,saveDev:e.saveDev||!1,workspaceRoot:e.workspaceRoot||!1},s,a);i!==0&&(process.exitCode=i)};export{b as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{readLastRunSummary as k,getLastRunSummaryPath as g}from"@visulima/task-runner";import{p as m,l as S,r as x}from"./cli-main.js";import{c as h,d as p}from"../packem_shared/en-
|
|
1
|
+
import{readLastRunSummary as k,getLastRunSummaryPath as g}from"@visulima/task-runner";import{p as m,l as S,r as x}from"./cli-main.js";import{c as h,d as p}from"../packem_shared/en-BxrK-n-J.js";const I=new Set(["json","table"]),v=(t,a)=>t??a,c=t=>t===void 0?"-":t<1e3?`${String(t)}ms`:`${(t/1e3).toFixed(2)}s`,$=t=>t.exitCode===void 0?t.cacheStatus:t.exitCode===0?t.cacheStatus==="MISS"?"OK":t.cacheStatus:`FAIL(${String(t.exitCode)})`,r=(t,a)=>t.length>=a?t:t+" ".repeat(a-t.length),w=t=>t.exitCode!==void 0&&t.exitCode!==0,l=(t,a)=>{a.info(`Run ${t.id}`),a.info(` start: ${t.startTime}`),a.info(` end: ${t.endTime}`),a.info(` duration: ${c(t.duration)}`),a.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`),a.info(` env: node ${t.environment.nodeVersion} · ${t.environment.platform}/${t.environment.arch}`),a.info("")},y=(t,a)=>{if(t.length===0){a.info("(no tasks match the current filter)");return}const e=t.map(s=>({duration:c(s.duration),hash:s.hash?s.hash.slice(0,12):"-",status:$(s),taskId:s.taskId})),i={duration:Math.max(8,...e.map(s=>s.duration.length)),hash:Math.max(4,...e.map(s=>s.hash.length)),status:Math.max(6,...e.map(s=>s.status.length)),taskId:Math.max(4,...e.map(s=>s.taskId.length))};a.info(` ${r("task",i.taskId)} ${r("status",i.status)} ${r("duration",i.duration)} ${r("hash",i.hash)}`),a.info(` ${"-".repeat(i.taskId)} ${"-".repeat(i.status)} ${"-".repeat(i.duration)} ${"-".repeat(i.hash)}`);for(const s of e)a.info(` ${r(s.taskId,i.taskId)} ${r(s.status,i.status)} ${r(s.duration,i.duration)} ${r(s.hash,i.hash)}`)},C=(t,a,e)=>{l(t,e),e.info(`Task ${a.taskId}`),e.info(` status: ${$(a)}`),e.info(` cache: ${a.cacheStatus}`),e.info(` duration: ${c(a.duration)}`),e.info(` exit: ${a.exitCode===void 0?"-":String(a.exitCode)}`),e.info(` hash: ${a.hash??"(none)"}`),e.info(` start: ${a.startTime??"-"}`),e.info(` end: ${a.endTime??"-"}`),a.dependencies.length>0&&e.info(` deps: ${a.dependencies.join(", ")}`),e.info(""),m.info(`Drill into hash inputs with: vis cache why ${a.taskId} --run ${t.id}`)},R=t=>{process.stdout.write(`${JSON.stringify(t.map(a=>({id:a.id,mtime:new Date(a.mtimeMs).toISOString(),path:a.path})),void 0,2)}
|
|
2
2
|
`)},T=(t,a,e)=>{if(t.length===0){m.info(`No recorded runs found in ${p(a)}/. Run with --summarize to record a run.`);return}const i={id:Math.max(2,...t.map(s=>s.id.length)),mtime:24};e.info(` ${r("id",i.id)} ${r("mtime",i.mtime)}`),e.info(` ${"-".repeat(i.id)} ${"-".repeat(i.mtime)}`);for(const s of t)e.info(` ${r(s.id,i.id)} ${new Date(s.mtimeMs).toISOString()}`)},D=(t,a)=>{let{tasks:e}=t;return a.task!==void 0&&(e=e.filter(i=>i.taskId===a.task)),a.failed&&(e=e.filter(i=>w(i))),e},M=async(t,a)=>{const{failed:e,format:i,runId:s,task:o,workspaceRoot:d}=t,n=s===void 0?await k(d,{dataDirectory:h(d)}):await x(d,s);if(!n){if(i==="json"){process.stdout.write(`${JSON.stringify({error:"no-summary",runId:s??null},void 0,2)}
|
|
3
3
|
`),process.exitCode=1;return}s===void 0?m.error(`No previous run summary found. Run a task first to populate \`${g(d,{dataDirectory:h(d)})}\`.`):m.error(`Run summary "${s}" not found in ${p(d)}/.`),process.exitCode=1;return}const f=D(n,{failed:e,task:o});if(o!==void 0&&f.length===0){if(i==="json"){process.stdout.write(`${JSON.stringify({error:"task-not-in-summary",runId:n.id,taskId:o},void 0,2)}
|
|
4
4
|
`),process.exitCode=1;return}m.error(`Task "${o}" was not part of run ${n.id}.`),process.exitCode=1;return}if(n.stats.failed>0&&(process.exitCode=1),i==="json"){process.stdout.write(`${JSON.stringify({duration:n.duration,endTime:n.endTime,environment:n.environment,runId:n.id,startTime:n.startTime,stats:n.stats,tasks:f.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
|
|
1
|
+
import{createTaskGraph as $}from"@visulima/task-runner";import{v as O,S}from"./catalog.js";import{f as b}from"../packem_shared/project-name-filter-u2Q7YpQH.js";import{r as E,f as R,a as P}from"../packem_shared/selectors-CtxnIT4X.js";const B=(f,s,o)=>{const c=[],t=new Set,n=(e,g)=>{if(t.has(e))return;t.add(e);const j=s[e]??[];for(const m of j)n(m,g+1);const r=o[e],d=" ".repeat(g);c.push(`${d}${e}${r?.cache===!1?" (no-cache)":""}`)};for(const e of f)n(e,0);return c},G=(f,s,o)=>({roots:f,tasks:Object.fromEntries(Object.entries(o).map(([c,t])=>[c,{cache:t.cache,dependsOn:s[c]??[],outputs:t.outputs,parallelism:t.parallelism,projectRoot:t.projectRoot,target:t.target}]))}),C=async({argument:f,logger:s,options:o,process:c,visConfig:t,workspaceRoot:n})=>{const e=f[0];if(!e)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:g,packageJsons:j,workspace:r}=O(n,t),d=S(n,r,j),m=await E(e,r,c.cwd,n),{target:l}=m;let i=m.projects;o.projects!==void 0&&(i=b(i,String(o.projects),Object.keys(r.projects))),o.query&&(i=R(i,r,o.query)),i=P(i,r,o.tag);const h=i.filter(p=>r.projects[p]?.targets?.[l]!==void 0);if(h.length===0){s.info(`No projects have a "${l}" target.`);return}const w=h.map(p=>{const k=r.projects[p],u=k.targets?.[l],v={project:p,target:l};return{cache:u?.cache,id:`${p}:${l}`,outputs:u?.outputs??[],overrides:{command:u?.command},parallelism:u?.parallelism,projectRoot:k.root,target:v}}),a=$(w,{projectGraph:d,targetDefaults:g.tasks,workspace:r});if(o.json){s.info(JSON.stringify(G(a.roots,a.dependencies,a.tasks),null,2));return}const y=B(a.roots,a.dependencies,a.tasks);s.info(`Execution plan (${Object.keys(a.tasks).length} task(s), ${a.roots.length} root(s)):`),s.info("");for(const p of y)s.info(p)};export{C as default};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{B
|
|
2
|
-
`,m=e.output??(s==="xml"?"sbom.cdx.xml":"sbom.cdx.json");if(m==="-"){process.stdout.write(a);return}const r=
|
|
1
|
+
import{B,d as $,H as g}from"../packem_shared/index-DND6ptxQ.js";import{v as b,S as h}from"./catalog.js";import{p}from"./cli-main.js";import{b as j,s as y}from"../packem_shared/cyclonedx-y7VLI-1d.js";const l=["json","xml"],C=n=>l.includes(n),F=async({fs:n,options:e,visConfig:d,workspaceRoot:o})=>{if(!o)throw new Error("Could not determine workspace root. Run inside a monorepo.");const{packageJsons:f,workspace:i}=b(o,d),u=h(o,i,f),c=e.focus,w=c?c.split(",").map(v=>v.trim()).filter(Boolean):void 0,s=(e.format??"json").toLowerCase();if(!C(s))throw new Error(`Unknown --format: "${s}". Expected one of: ${l.join(", ")}.`);const t=j({focus:w,includeDev:!!e.includeDev,projectGraph:u,workspace:i,workspaceRoot:o}),a=s==="xml"?y(t):`${JSON.stringify(t,void 0,2)}
|
|
2
|
+
`,m=e.output??(s==="xml"?"sbom.cdx.xml":"sbom.cdx.json");if(m==="-"){process.stdout.write(a);return}const r=B(o,m);$(g(r)),await n.writeFile(r,a,"utf8");const x=t.components?.length??0,k=t.dependencies?.length??0;p.success(`SBOM written to ${r}`),p.notice(`${x} components, ${k} dependency edges`)};export{F as default};
|