@visulima/vis 6.1.2 → 6.1.4
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 +31 -0
- package/LICENSE.md +0 -29
- package/dashboard/dist/index.html +10 -10
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +16 -10
- package/dist/generate/index.d.ts +25 -0
- package/dist/packem_chunks/CONFIG_FILES.js +6 -7
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/catalog2.js +7 -7
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +129 -129
- 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 +5 -5
- 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/handler40.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 +2 -2
- 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 +2 -2
- 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 +4 -4
- package/dist/packem_chunks/handler61.js +2 -2
- package/dist/packem_chunks/handler62.js +1 -1
- package/dist/packem_chunks/handler63.js +2 -61
- package/dist/packem_chunks/handler64.js +61 -6
- package/dist/packem_chunks/handler65.js +6 -8
- package/dist/packem_chunks/handler66.js +8 -2
- package/dist/packem_chunks/handler67.js +2 -28
- package/dist/packem_chunks/handler68.js +28 -12
- package/dist/packem_chunks/handler69.js +12 -25
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +25 -22
- package/dist/packem_chunks/handler71.js +22 -10
- package/dist/packem_chunks/handler72.js +10 -133
- package/dist/packem_chunks/handler73.js +133 -23
- package/dist/packem_chunks/handler74.js +23 -323
- package/dist/packem_chunks/handler75.js +274 -659
- package/dist/packem_chunks/handler76.js +13 -13
- package/dist/packem_chunks/handler77.js +12 -12
- package/dist/packem_chunks/handler78.js +1 -1
- package/dist/packem_chunks/handler79.js +69 -67
- 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/html.js +707 -0
- package/dist/packem_chunks/index4.js +1 -1
- package/dist/packem_chunks/index6.js +57 -51
- package/dist/packem_chunks/index7.js +2 -2
- 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/run.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 +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_shared/{ReleaseClient-CWD9BC5w.js → ReleaseClient-CRuCHDsT.js} +1 -1
- package/dist/packem_shared/advisories-DHGJ6XhP.js +1 -0
- package/dist/packem_shared/affected-selection-DCT4CLex.js +1 -0
- package/dist/packem_shared/{affected-shas-B_kfSKss.js → affected-shas-CycHU3nr.js} +1 -1
- package/dist/packem_shared/{ai-analysis-BCJ1kuDM.js → ai-analysis-CO4rT3Nd.js} +1 -1
- package/dist/packem_shared/ai-cache-Dkb6me20.js +1 -0
- package/dist/packem_shared/{ai-fix-DIMErSws.js → ai-fix-C0OBhGDq.js} +1 -1
- package/dist/packem_shared/{augment-B9kSZuvW.js → augment-BSeqaai8.js} +1 -1
- package/dist/packem_shared/{bin-BcLTer1k.js → bin-DwACrJUJ.js} +1 -1
- package/dist/packem_shared/build-scripts-BeMIA-_q.js +1 -0
- package/dist/packem_shared/{command-runtime-HSsYGCQd.js → command-runtime-DG49t2MT.js} +1 -1
- package/dist/packem_shared/{dependency-scan-D_v3KM59.js → dependency-scan-D8e370_h.js} +1 -1
- package/dist/packem_shared/detect-C-9o_BPB.js +1 -0
- package/dist/packem_shared/{docker-DXqV-07f.js → docker-vRDm2lHX.js} +1 -1
- package/dist/packem_shared/{ecosystem-gate-CwsTc7YW.js → ecosystem-gate-DpO43yAS.js} +1 -1
- package/dist/packem_shared/env-BymuoTL8.js +4 -0
- package/dist/packem_shared/env-consistency-BDfAa56d.js +1 -0
- package/dist/packem_shared/{failure-log-DIsKBKaI.js → failure-log-BslhfaEO.js} +1 -1
- package/dist/packem_shared/glob-Cyk1H9ZL-6yDyaJwk.js +1 -0
- package/dist/packem_shared/{index-BzhrR_iC.js → index-0dnGN3GP.js} +1 -1
- package/dist/packem_shared/index-CIdjkZgt.js +1 -0
- package/dist/packem_shared/{index-9Ot7jTd4.js → index-Cwxbl_pY.js} +1 -1
- package/dist/packem_shared/index-Doab17tq.js +1 -0
- package/dist/packem_shared/{isAccessibleSync-DYKTrrvc-C-_5cgwu.js → isAccessibleSync-DYKTrrvc-CBsMZhj-.js} +1 -1
- package/dist/packem_shared/{lifecycle-CQjeMPY0.js → lifecycle-Gy7mqMGg.js} +2 -2
- package/dist/packem_shared/{lockfile-CiUtEbnt.js → lockfile-DEWjBrlY.js} +1 -1
- package/dist/packem_shared/manifests-kE5OweNT.js +1 -0
- package/dist/packem_shared/{min-release-age-JViyQuBM.js → min-release-age-yvuPbJ8G.js} +1 -1
- package/dist/packem_shared/missing-package-json-CEEPXqYi.js +1 -0
- package/dist/packem_shared/{multi-eco-lockfiles-fgkpeHJv.js → multi-eco-lockfiles-D5tM7pkg.js} +1 -1
- package/dist/packem_shared/{native-config-sync-TdTWjVgI.js → native-config-sync-DDGt3vvd.js} +1 -1
- package/dist/packem_shared/{npmrc-CHsOyMvA.js → npmrc-CIvOb61L.js} +1 -1
- package/dist/packem_shared/{osv-Do9PMOea.js → osv-4kFhXIoW.js} +1 -1
- package/dist/packem_shared/osv-bloom-DU6avR2k.js +2 -0
- package/dist/packem_shared/package-version-x7sPg2TM.js +4 -0
- package/dist/packem_shared/packument-Dg8cIDYR.js +1 -0
- package/dist/packem_shared/{pm-runner-RM72mDZg.js → pm-runner-Dboj-wZG.js} +1 -1
- package/dist/packem_shared/{project-name-filter-ZQaLgytG.js → project-name-filter-B3tKt-Pf.js} +1 -1
- package/dist/packem_shared/{provenance-SX1MxPUZ.js → provenance-BG5mu0H_.js} +1 -1
- package/dist/packem_shared/publish-DkgvB2Lk.js +34 -0
- package/dist/packem_shared/registry-CndByNx9.js +85 -0
- package/dist/packem_shared/registry-keys-CE-RZlp_.js +1 -0
- package/dist/packem_shared/{removeSync-g1D5kONg-LbjATA8v.js → removeSync-g1D5kONg-jOsRSIIv.js} +1 -1
- package/dist/packem_shared/{renderToString-DR0zDUjh-DXppT6AM.js → renderToString-DR0zDUjh-DeiCwydO.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-D9kdTNvl.js → resolve-explicit-Cge6eKPt.js} +1 -1
- package/dist/packem_shared/{resolve-runtime-DNukUjIr.js → resolve-runtime-D8rxuo3J.js} +1 -1
- package/dist/packem_shared/run-CKL4VGzQ.js +10 -0
- package/dist/packem_shared/{run-file-UBukWaha.js → run-file-D1mlOnd8.js} +1 -1
- package/dist/packem_shared/{run-summary-utils-CMeURYtS.js → run-summary-utils-DbyeUM6f.js} +1 -1
- package/dist/packem_shared/runtime-check-Dw0q3X67.js +1 -0
- package/dist/packem_shared/s1ngularity-BOl0c716.js +1 -0
- package/dist/packem_shared/{scaffold-files-DJlz36Mu.js → scaffold-files-B8zMyMvq.js} +1 -1
- package/dist/packem_shared/{scan-progress-DymX71_5.js → scan-progress-CY3XIDOY.js} +1 -1
- package/dist/packem_shared/selectors-BB0yaWyK.js +3 -0
- package/dist/packem_shared/{signatures-CeL0bOEo.js → signatures-r1SeDHLL.js} +1 -1
- package/dist/packem_shared/spinner-B_rRdoro.js +1 -0
- package/dist/packem_shared/{table-oA7p7-yP.js → table-bu4cV-it.js} +1 -1
- package/dist/packem_shared/{tabs-BiSifphV.js → tabs-A2EUpTHt.js} +1 -1
- package/dist/packem_shared/target-merge-ya19LiWB.js +1 -0
- package/dist/packem_shared/{target-options-DsHFmRZH.js → target-options-rIthWS4M.js} +1 -1
- package/dist/packem_shared/{task-env-C2lmxvzA.js → task-env-Cl4jNMCR.js} +1 -1
- package/dist/packem_shared/toolchain-Bt93i37e.js +5 -0
- package/dist/packem_shared/typosquats-BbebOgKM.js +1 -0
- package/dist/packem_shared/{use-measured-height-BHm-HiSF.js → use-measured-height-CwhybDI9.js} +1 -1
- package/dist/packem_shared/{verify-B_MblU_Q.js → verify-3WE9U_Bv.js} +1 -1
- package/dist/packem_shared/{vis-update-app-6QOYxnNx.js → vis-update-app-PjJWvxqF.js} +1 -1
- package/dist/packem_shared/{vis-user-error-3YS7sPYy.js → vis-user-error-BivZDkQD.js} +2 -2
- package/dist/packem_shared/{watch-CcTketln.js → watch-C-9-PD2m.js} +1 -1
- package/dist/packem_shared/{watch-loop-CGi66Fs0.js → watch-loop-dWYGUQwi.js} +1 -1
- package/dist/release/index.js +1 -1
- package/dist/release/plugin-sdk.d.ts +32 -0
- package/dist/release/presets.d.ts +38 -0
- package/dist/runtime/preload.js +1 -1
- package/index.js +26 -26
- package/package.json +19 -15
- package/schemas/vis-config.schema.json +12 -0
- package/dist/packem_shared/advisories-DO-P0V1_.js +0 -1
- package/dist/packem_shared/affected-selection-CeeZo7Uy.js +0 -1
- package/dist/packem_shared/ai-cache-iSIyY3So.js +0 -1
- package/dist/packem_shared/build-scripts-CEDx_nJp.js +0 -1
- package/dist/packem_shared/detect-CbMRSXkM.js +0 -1
- package/dist/packem_shared/env-BSXG3QKH.js +0 -4
- package/dist/packem_shared/env-consistency-B4rU4MQb.js +0 -1
- package/dist/packem_shared/glob-Cyk1H9ZL-CL9optrn.js +0 -1
- package/dist/packem_shared/index-BS6A9QR_.js +0 -1
- package/dist/packem_shared/manifests-Du4yKlf_.js +0 -1
- package/dist/packem_shared/missing-package-json-1BIoWQq0.js +0 -1
- package/dist/packem_shared/osv-bloom-BCAX5ARR.js +0 -2
- package/dist/packem_shared/package-version-Bq6Cne_7.js +0 -4
- package/dist/packem_shared/packument-CbTmbHU4.js +0 -1
- package/dist/packem_shared/publish-Dc0XGH3K.js +0 -34
- package/dist/packem_shared/readJsonSync-CbryXYxN-EWl7_7KX.js +0 -1
- package/dist/packem_shared/registry-Dg9XI6RT.js +0 -81
- package/dist/packem_shared/registry-keys-z038Ecb4.js +0 -1
- package/dist/packem_shared/run-DLvd3RIZ.js +0 -10
- package/dist/packem_shared/runtime-check-D3cRDuoi.js +0 -1
- package/dist/packem_shared/s1ngularity-BuU9Cxpy.js +0 -1
- package/dist/packem_shared/selectors-edwcgNl3.js +0 -3
- package/dist/packem_shared/spinner-CPoBymcv.js +0 -1
- package/dist/packem_shared/target-merge-DVJl-7Qz.js +0 -4
- package/dist/packem_shared/toolchain-CP79HNVy.js +0 -5
- package/dist/packem_shared/typosquats-BFKus_aM.js +0 -1
- package/dist/packem_shared/writeFileSync-DJoHk3Ks-BPRoepNw.js +0 -1
|
@@ -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-0dnGN3GP.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-0dnGN3GP.js";import{a as B,r as D,b as y,c as M}from"../packem_shared/ai-fix-C0OBhGDq.js";import{p as c}from"./cli-main.js";import{l as _}from"../packem_shared/failure-log-BslhfaEO.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-Dboj-wZG.js";import{r as h,a as x}from"../packem_shared/command-runtime-DG49t2MT.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,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as _}from"node:module";import{z as m,e as t}from"../packem_shared/index-
|
|
2
|
-
`),e=l.filter(r=>!r.includes(".vis/bin")&&!r.includes("VIS_HOME")&&!r.includes("# vis "));e.length!==l.length&&(j(
|
|
3
|
-
`)),n.push(
|
|
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
|
|
5
|
-
✓ Removed ${f}`)}catch(e){throw new Error(`Failed to remove ${f}: ${e instanceof Error?e.message:String(e)}`,{cause:e})}n.info("✓ vis has been uninstalled.")};export{
|
|
1
|
+
import{createRequire as _}from"node:module";import{z as m,e as t}from"../packem_shared/index-0dnGN3GP.js";import{c as b,U as j}from"../packem_shared/env-BymuoTL8.js";import{y as a}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.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
|
+
`),e=l.filter(r=>!r.includes(".vis/bin")&&!r.includes("VIS_HOME")&&!r.includes("# vis "));e.length!==l.length&&(j(s,e.join(`
|
|
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
|
+
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(`
|
|
5
|
+
✓ Removed ${f}`)}catch(e){throw new Error(`Failed to remove ${f}: ${e instanceof Error?e.message:String(e)}`,{cause:e})}n.info("✓ vis has been uninstalled.")};export{R as default};
|
|
@@ -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-Dboj-wZG.js";import{r as m,a as w}from"../packem_shared/command-runtime-DG49t2MT.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-0dnGN3GP.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-C-9o_BPB.js";import{d as K}from"../packem_shared/pm-runner-Dboj-wZG.js";import{a as P,g as U,b as L}from"../packem_shared/scaffold-files-B8zMyMvq.js";import{s as Y}from"../packem_shared/build-scripts-BeMIA-_q.js";import{y as S}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{U as j}from"../packem_shared/env-BymuoTL8.js";import{s as R}from"../packem_shared/native-config-sync-DDGt3vvd.js";import{s as T}from"../packem_shared/min-release-age-yvuPbJ8G.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-BOl0c716.js";import{g as B,r as D}from"../packem_shared/packument-Dg8cIDYR.js";import{r as E}from"../packem_shared/provenance-BG5mu0H_.js";import{r as O}from"../packem_shared/signatures-r1SeDHLL.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-0dnGN3GP.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-Dboj-wZG.js";import{a as $,r as K}from"../packem_shared/command-runtime-DG49t2MT.js";import{s as M}from"../packem_shared/typosquats-BbebOgKM.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-CBsMZhj-.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
|
|
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-0dnGN3GP.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-CndByNx9.js";import{V as W}from"../packem_shared/vis-user-error-BivZDkQD.js";import{a as G,c as X,n as Y}from"../packem_shared/pm-runner-Dboj-wZG.js";import{r as J,a as K}from"../packem_shared/command-runtime-DG49t2MT.js";import{r as _,a as Q,p as Z,b as ee}from"../packem_shared/resolve-explicit-Cge6eKPt.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-BymuoTL8.js";import{r as ae}from"../packem_shared/typosquats-BbebOgKM.js";import{readCatalogs as ce}from"./catalog2.js";import{p as E,t as C}from"../packem_shared/utils-DQFHJn72.js";import{y as ie}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as le}from"../packem_shared/package-version-x7sPg2TM.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-Dboj-wZG.js";import{r as p,a as k}from"../packem_shared/command-runtime-DG49t2MT.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-Dboj-wZG.js";import{r as f,a as g}from"../packem_shared/command-runtime-DG49t2MT.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-Dboj-wZG.js";import{r as i,a as p}from"../packem_shared/command-runtime-DG49t2MT.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-DbyeUM6f.js";import{d as $,a as m}from"../packem_shared/env-BymuoTL8.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-CndByNx9.js";import{f as P}from"../packem_shared/project-name-filter-B3tKt-Pf.js";import{r as S,f as E,a as G}from"../packem_shared/selectors-BB0yaWyK.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-0dnGN3GP.js";import{d as $,b as v}from"../packem_shared/registry-CndByNx9.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-DpO43yAS.js";import{h as F}from"../packem_shared/env-BymuoTL8.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-0dnGN3GP.js";import{o as A,d as I}from"../packem_shared/registry-CndByNx9.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-Gy7mqMGg.js";import{r as q,l as z}from"../packem_shared/target-options-rIthWS4M.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 h,e as l}from"../packem_shared/index-
|
|
1
|
+
import{createRequire as p}from"node:module";import{m as h,e as l}from"../packem_shared/index-0dnGN3GP.js";let v;const g=e=>(v??=p(import.meta.url))(e),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,f=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:$}=f("node:fs"),{createRequire:_}=f("node:module"),m=["npm","npx","pnpm","pnpx","yarn","yarnpkg"],o=process.platform==="win32",u=e=>l(e.process.cwd,".vis","shims"),w=()=>{const{report:e}=process;if(typeof e?.getReport!="function")return!1;const s=e.getReport();return Array.isArray(s.sharedObjects)?s.sharedObjects.some(t=>t.includes("libc.musl-")||t.includes("ld-musl-")):!s.header?.glibcVersionRuntime},y={"darwin:arm64":"darwin-arm64","darwin:x64":"darwin-x64","win32:arm64":"win32-arm64-msvc","win32:x64":"win32-x64-msvc"},T=()=>{const{arch:e,platform:s}=process;return s==="linux"?e==="arm64"||e==="x64"?`linux-${e}-${w()?"musl":"gnu"}`:void 0:y[`${s}:${e}`]},A=async(e,s)=>{const t=async d=>e.fs.stat(d).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",r=l(s,c);if(await t(r))return r;const n=T();if(n!==void 0)try{return _(import.meta.url).resolve(`@visulima/vis-binding-${n}/${c}`)}catch{return}},P=(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-0dnGN3GP.js";import{d as j}from"../packem_shared/registry-CndByNx9.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-0dnGN3GP.js";import{enforceProjectConstraints as v}from"@visulima/task-runner";import{d as x,b as J}from"../packem_shared/registry-CndByNx9.js";import{j as w}from"./cli-main.js";import{c as z}from"../packem_shared/runtime-check-Dw0q3X67.js";import{a as D}from"../packem_shared/env-BymuoTL8.js";import{y as G}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as H}from"../packem_shared/package-version-x7sPg2TM.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-CndByNx9.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-0dnGN3GP.js";import{p as o}from"./cli-main.js";import{c as B}from"../packem_shared/env-consistency-BDfAa56d.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-Bt93i37e.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-Dboj-wZG.js";import{r as i,a as u}from"../packem_shared/command-runtime-DG49t2MT.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-x7sPg2TM.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-Dboj-wZG.js";import{r as k,a as i}from"../packem_shared/command-runtime-DG49t2MT.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{d as
|
|
1
|
+
import{e as C}from"../packem_shared/index-0dnGN3GP.js";import{r as P}from"./cli-main.js";import{d as b,b as x}from"../packem_shared/registry-CndByNx9.js";import{V as f}from"../packem_shared/vis-user-error-BivZDkQD.js";import{s as I}from"../packem_shared/affected-selection-DCT4CLex.js";import{f as D,a as R}from"../packem_shared/selectors-BB0yaWyK.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:h,runtime:p,visConfig:o,workspaceRoot:i})=>{if(!r[0])throw new f("Missing target. Usage: vis affected <target>");if(!i)throw new f("Could not determine workspace root. Run this command inside a monorepo.");if(e.sparseCheckout){const c=i,{config:n,fileOwners:g,packageJsons:l,workspace:t}=b(c,o),w=x(c,t,l),j=n.taskRunner??{},k=P({branchScopedCache:n.branchScopedCache,configCacheDir:j.cacheDirectory,optionsCacheDir:void 0,sharedWorktreeCache:n.sharedWorktreeCache,workspaceRoot:c}),y=await I({base:e.base,downstream:e.downstream,head:e.head,uncommitted:e.uncommitted,upstream:e.upstream},{fileOwners:g,namedInputs:o?.namedInputs,projectGraph:w,projects:t.projects,workspaceRoot:c},{affectedIgnore:o?.affectedIgnore,defaultBase:o?.defaultBase,externalInputStatePath:C(k,"external-inputs.json")});let d=D(y.affectedProjects,t,e.query);d=R(d,t,e.tag);const m=[...new Set(d.map(u=>t.projects[u]?.root??u))].sort();process.stdout.write(m.length>0?`${m.join(`
|
|
2
2
|
`)}
|
|
3
|
-
`:"");return}const s=
|
|
3
|
+
`:"");return}const s=v(h??[],a?.argv??[]);if(s.length===0)throw new f("Missing target. Usage: vis affected <target>");await p.runCommand("run",{argv:s.includes("--affected")?s:[...s,"--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-0dnGN3GP.js";import{r as w}from"../packem_shared/command-runtime-DG49t2MT.js";import{r as v}from"../packem_shared/run-file-D1mlOnd8.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-CRuCHDsT.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-CO4rT3Nd.js";import{p as $,g as T,e as M,a as C,f as O}from"../packem_shared/registry-CndByNx9.js";import{readCatalogs as S,fetchPackageVersions as j}from"./catalog2.js";import{f as z}from"../packem_shared/osv-4kFhXIoW.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{createRequire as l}from"node:module";import{r as w}from"../packem_shared/run-
|
|
1
|
+
import{createRequire as l}from"node:module";import{r as w}from"../packem_shared/run-CKL4VGzQ.js";import{createShellRunner as y}from"./shell-runner.js";import{b as R}from"./context.js";let d;const p=n=>(d??=l(import.meta.url))(n),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m=n=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[e,r]=o.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return o.getBuiltinModule(n)}return p(n)},{relative:_}=m("node:path"),C=async({fs:n,logger:e,options:r,workspaceRoot:c})=>{const a=c??process.cwd(),i=await R({cwd:a,skipRegistryLookup:!0}),{printConfigIfRequested:u}=await import("./print-config.js");if(u(r,i,e))return;const t=await w({allowFullHistory:r.allowFullHistory===!0,config:i.config,cwd:a,dryRun:r.dryRun===!0,from:r.from,fs:n,name:r.name,packages:i.packages,perPackageConfig:i.perPackageConfig,runner:y(),sinceLastRelease:r.sinceLastRelease===!0});for(const s of t.notes)e.info(s);for(const s of t.warnings)e.warn(s);if(t.status==="failed"){e.error(t.error),process.exitCode=1;return}if(t.status!=="no-changes"){if(t.status==="dry-run"){e.info("[dry-run] would write:"),e.info(t.content);return}e.info(`Created ${_(a,t.createdFile)}`);for(const[s,f]of t.bumps)e.info(` ${s}: ${f}`)}};export{C as default};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{VisReleaseError as $}from"../packem_shared/VisReleaseError-DZtgcKf8.js";import{b as m}from"./context.js";import{p as b}from"../packem_shared/publish-
|
|
1
|
+
import{VisReleaseError as $}from"../packem_shared/VisReleaseError-DZtgcKf8.js";import{b as m}from"./context.js";import{p as b}from"../packem_shared/publish-DkgvB2Lk.js";const C=async({logger:t,options:n,workspaceRoot:o})=>{const f=o??process.cwd(),r=n.dryRun===!0;let a;try{a=await m({channel:n.channel,cwd:f,firstRelease:n.firstRelease===!0,projects:n.filter?n.filter.split(",").map(e=>e.trim()).filter(Boolean):void 0})}catch(e){t.error(`Failed to load release context: ${e instanceof Error?e.message:String(e)}`),process.exitCode=1;return}const{printConfigIfRequested:c}=await import("./print-config.js");if(c(n,a,t))return;if(n.checkOnly===!0){if(t.info(`Preflight: ${a.plan.releases.length} pending publish(es)${a.channel?` to dist-tag "${a.channel.tag}"`:""}.`),a.plan.warnings.length>0)for(const e of a.plan.warnings)t.warn(` - ${e}`);process.exitCode=a.plan.releases.length===0?1:0;return}if(a.plan.releases.length===0){t.info("No pending releases — nothing to publish.");return}const i=n.tag??a.channel?.tag;i||t.warn("No --tag provided and no channel matched the current branch. Defaulting to dist-tag 'latest'. Set channels in vis.config.ts to control this."),t.info(`${r?"[dry-run] would publish":"Publishing"} ${a.plan.releases.length} package(s) to dist-tag "${i??"latest"}"${r?"":"..."}`);let s;try{s=await b(a,{dryRun:r,noPush:!n.push,otp:n.otp,resume:n.resume===!0,tag:i})}catch(e){if(e instanceof $&&e.code==="STAGE_PENDING"){t.error(e.message),e.hint&&(t.info(""),t.info(`Next steps: ${e.hint}`)),process.exitCode=1;return}t.error(`Publish failed: ${e instanceof Error?e.message:String(e)}`),process.exitCode=1;return}t.info("");for(const e of s.published)t.info(` [published] ${e.name}@${e.version}`);for(const e of s.skipped)e.reason.startsWith("stage-")?t.warn(` [stage] ${e.name} (${e.reason} — re-run \`vis release publish\` once approved)`):t.info(` [skipped] ${e.name} (${e.reason})`);for(const e of s.failed)t.error(` [failed] ${e.name}: ${e.reason}`);t.info(""),t.info(`Published: ${s.published.length} | Skipped: ${s.skipped.length} | Failed: ${s.failed.length}`),s.tags.length>0&&t.info(`Tags created: ${s.tags.length}${s.tagsPushed?" (pushed)":" (NOT pushed — re-run with --resume to retry)"}`),s.failed.length===0?process.exitCode=0:s.published.length===0&&s.skipped.length===0?process.exitCode=3:process.exitCode=2;const l=s.failed.filter(e=>/\bEOTP\b|one[- ]time password|otp/i.test(e.reason));if(l.length>0){t.info(""),t.warn("Publish failed because the registry required a 2FA OTP. Rerun with:");const e=l.map(p=>p.name).join(","),h=n.channel?` --channel=${n.channel}`:"",d=n.tag?` --tag=${n.tag}`:"",u=` --filter='${e}'`;t.info(` vis release publish --otp=REPLACE_WITH_NEW_OTP --resume${d}${h}${u}`)}};export{C as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as $}from"node:module";import{O as j}from"../packem_shared/renderToString-DR0zDUjh-
|
|
1
|
+
import{createRequire as $}from"node:module";import{O as j}from"../packem_shared/renderToString-DR0zDUjh-DeiCwydO.js";import{q as E}from"../packem_shared/table-bu4cV-it.js";import{R as I}from"../packem_shared/registry-CndByNx9.js";import{d as P}from"../packem_shared/pm-runner-Dboj-wZG.js";import{l as C}from"../packem_shared/dependency-scan-D8e370_h.js";import{r as T}from"../packem_shared/provenance-BG5mu0H_.js";import{r as D}from"../packem_shared/signatures-r1SeDHLL.js";import{loadOptionalSigstore as R}from"./loader.js";let y;const O=r=>(y??=$(import.meta.url))(r),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=r=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[t,s]=m.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return m.getBuiltinModule(r)}return O(r)},{createHash:N}=_("node:crypto"),{isAbsolute:k,resolve:S,basename:v}=_("node:path"),q=r=>(r??"").split(",").map(t=>t.trim()).filter(t=>t.length>0),V=async({logger:r,options:t,workspaceRoot:s})=>{if(!s)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const n=t.format??"table",c=t.prodOnly??!1,u=t.failOn==="error"?"error":"warning",d=q(t.allowlist),a=P(s),l=C(s,a.name,{includeDev:!c}).map(({name:e,version:o})=>({name:e,version:o})),[f,p]=await Promise.all([T(l,{allowlist:d,workspaceRoot:s}),D(l,{allowlist:d,workspaceRoot:s})]),i=[...f.map(e=>({code:"provenance-regression",message:`Resolved ${e.packageName}@${e.version} has no published provenance attestation, but ${e.packageName}@${e.priorVersionWithProvenance} did — a provenance regression.`,packageName:e.packageName,severity:"warning",version:e.version})),...p.map(e=>({code:e.code,message:e.message,packageName:e.packageName,severity:e.severity,version:e.version}))],g=i.filter(e=>u==="error"?e.severity==="error":!0);if(n==="json")process.stdout.write(`${JSON.stringify({findings:i,ok:g.length===0},void 0,2)}
|
|
2
2
|
`);else if(n==="ndjson")for(const e of i)process.stdout.write(`${JSON.stringify(e)}
|
|
3
3
|
`);else if(i.length===0)r.info(`No provenance regressions or signature problems across ${String(l.length)} locked packages.`);else{const e=process.stdout.columns||80;r.info(j(I.createElement(E,{data:i.map(o=>({code:o.code,package:`${o.packageName}@${o.version}`,severity:o.severity}))}),{columns:e}));for(const o of i)r.warn(`${o.packageName}@${o.version}: ${o.message}`)}g.length>0&&(process.exitCode=1)},x=()=>process.env.CI==="true"||typeof process.env.ACTIONS_ID_TOKEN_REQUEST_URL=="string"||typeof process.env.SIGSTORE_ID_TOKEN=="string",J=(r,t,s)=>({_type:"https://in-toto.io/Statement/v1",predicate:{buildDefinition:{buildType:"https://visulima.com/vis/attest/v1",externalParameters:{workspaceRoot:s},internalParameters:{},resolvedDependencies:[]},runDetails:{builder:{id:"https://visulima.com/vis"},metadata:{invocationId:process.env.GITHUB_RUN_ID??"",startedOn:new Date().toISOString()}}},predicateType:"https://slsa.dev/provenance/v1",subject:[{digest:{sha256:t},name:r}]}),Q=async({argument:r,fs:t,logger:s,options:n,workspaceRoot:c})=>{if(!c)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");const u=r[0];if(!u)throw new Error("Missing subject. Usage: vis attest <path-to-artifact>");const d=n.predicate??"slsaProvenance";if(d!=="slsaProvenance")throw new Error(`Unsupported predicate '${d}'. Only 'slsaProvenance' is supported.`);const a=k(u)?u:S(c,u),w=n.requireSigning??!1,l=n.format??"table";let f;try{f=await t.readFile(a)}catch{throw new Error(`Cannot read subject artifact at ${a}.`)}const p=N("sha256").update(f).digest("hex");if(!x()){const b="No ambient OIDC token (not running in CI). Keyless signing needs a Fulcio identity from CI OIDC.";if(w)throw new Error(`${b} Re-run in CI or drop --require-signing.`);if(l==="json"){process.stdout.write(`${JSON.stringify({ok:!1,reason:"no-ambient-oidc",sha256:p,skipped:!0,subject:v(a)},void 0,2)}
|
|
4
4
|
`);return}s.warn(`${b} Skipping signing (subject sha256: ${p}). Pass --require-signing to make this fatal.`);return}const i=J(v(a),p,c),g=Buffer.from(JSON.stringify(i)),o=await(await R({workspaceRoot:c})).attest(g,"application/vnd.in-toto+json"),h=n.output?k(n.output)?n.output:S(c,n.output):`${a}.sigstore`;if(await t.writeFile(h,`${JSON.stringify(o,void 0,2)}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import{c as $,a as l,D as d,T as y}from"../packem_shared/ai-analysis-
|
|
1
|
+
import{c as $,a as l,D as d,T as y}from"../packem_shared/ai-analysis-CO4rT3Nd.js";import{O as g}from"../packem_shared/renderToString-DR0zDUjh-DeiCwydO.js";import{q as x}from"../packem_shared/table-bu4cV-it.js";import{R as S}from"../packem_shared/registry-CndByNx9.js";import{j as w,F as u,q as E,J as I,b as A}from"../packem_shared/index.server-Ca_EEVfw.js";const p={command:"ai",description:"AI-assisted commands: provider detection, cache management, and failure-fix proposals."},D=e=>{if(typeof e!="function")return String(e);const{name:t}=e;return t==="Boolean"?"boolean":t==="Number"?"number":t==="String"?"string":t??"unknown"},O=e=>e===void 0?[]:Array.isArray(e)?e.map(t=>[t.name,t]):Object.entries(e),R=e=>{const t=[...e.commandPath??[],e.name].join(" "),s=(e.examples??[]).map(([n,a])=>({command:n??"",description:a??""})),o=O(e.options).map(([n,a])=>({defaultValue:a.defaultValue,description:a.description,name:n,type:D(a.type)}));return{argument:e.argument?{description:e.argument.description,name:e.argument.name}:void 0,description:e.description??"",examples:s,name:e.name,options:o,path:t}},f=(e,t=p)=>({command:t.command,description:t.description,subcommands:e.map(s=>R(s))}),P=(e,t=p)=>`${JSON.stringify(f(e,t),void 0,2)}
|
|
2
2
|
`,T=(e,t=p)=>{const s=f(e,t),o=[w(`vis ${s.command} — ${s.description}`),"",u("Subcommands:")];for(const n of s.subcommands){const a=n.argument?` ${E(`<${n.argument.name}>`)}`:"";if(o.push(""),o.push(` ${I(`vis ${n.path}`)}${a}`),n.description&&o.push(` ${n.description}`),n.options.length>0){const i=n.options.map(c=>`--${c.name}${c.type==="boolean"?"":`=<${c.type}>`}`).join(", ");o.push(u(` options: ${i}`))}if(n.examples.length>0){o.push(u(" examples:"));for(const i of n.examples){const c=i.description?u(` — ${i.description}`):"";o.push(` ${A(i.command)}${c}`)}}}return o.push(""),o.push(u(`Run \`vis ${s.command} discover-help\` for the machine-readable JSON catalogue (designed for AI agents).`)),o.push(u(`Run \`vis ${s.command} <subcommand> --help\` for full usage of a specific subcommand.`)),`${o.join(`
|
|
3
3
|
`)}
|
|
4
|
-
`},h=async()=>{const{default:e}=await import("./cli-main.js").then(t=>t.
|
|
4
|
+
`},h=async()=>{const{default:e}=await import("./cli-main.js").then(t=>t.ao);return e.filter(t=>t.name!=="ai")},M=async()=>{const e=await h();process.stderr.write(T(e))},q=async()=>{const e=await h();process.stdout.write(P(e))},L=async({logger:e,visConfig:t})=>{const s=t?.ai,o=l(s);if(!o){e.error("No AI provider available to test."),process.exitCode=1;return}e.info(`Testing ${o.name}...`);try{const n=await y(o,"Reply with exactly: OK",{timeoutMs:3e4});e.info(`Provider ${o.name} responded: ${n.stdout.trim().slice(0,200)}`)}catch(n){const a=n instanceof Error?n.message:String(n);e.error(`Provider ${o.name} failed: ${a}`),process.exitCode=1}},V=({logger:e,options:t,visConfig:s})=>{const o=t.format??"table",n=s?.ai,a=$(),i=l(n);if(o==="json"){const r=a.map(m=>({available:m.available,method:m.detectionMethod,name:m.name,path:m.path,priority:d[m.name]??0,selected:m.name===i?.name,version:m.version}));process.stdout.write(`${JSON.stringify(r,void 0,2)}
|
|
5
5
|
`);return}const c=a.map(r=>({method:r.detectionMethod??"-",path:r.path??"-",priority:String(d[r.name]??0),provider:r.name,selected:r.name===i?.name?">>>":"",status:r.available?"available":"not found",version:r.version??"-"})),v=process.stdout.columns||80,b=g(S.createElement(x,{data:c}),{columns:v});e.info(b),i?e.info(`
|
|
6
6
|
Selected provider: ${i.name} (priority ${String(d[i.name]??0)})`):e.info(`
|
|
7
7
|
No AI provider available. Install one of the supported AI CLI tools.`)},_=async e=>{const{aiFix:t}=await import("./fix.js");await t(e)};export{q as aiDiscoverHelpExecute,_ as aiFixExecute,V as aiProvidersExecute,M as aiRootExecute,L as aiTestExecute};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as B}from"node:module";import{z as E}from"../packem_shared/index-
|
|
1
|
+
import{createRequire as B}from"node:module";import{z as E}from"../packem_shared/index-0dnGN3GP.js";import{findVisConfigFile as D}from"./CONFIG_FILES.js";import{y as V}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{U as w}from"../packem_shared/env-BymuoTL8.js";import{p as e}from"./cli-main.js";import{d as C}from"../packem_shared/pm-runner-Dboj-wZG.js";import{a as F}from"../packem_shared/build-scripts-BeMIA-_q.js";import{s as O}from"../packem_shared/native-config-sync-DDGt3vvd.js";let N;const M=c=>(N??=B(import.meta.url))(c),$=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=c=>{if(typeof $<"u"&&$.versions&&$.versions.node){const[t,s]=$.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return $.getBuiltinModule(c)}return M(c)},{spawnSync:A}=T("node:child_process"),P=/(defineConfig\s*\(\s*\{)/,q=/(export\s+default\s+\{)/,y=(c,t)=>`${t}${JSON.stringify(c)}: true,`,z=(c,t)=>{if(t.length===0)return{added:[],skipped:[],status:"noop"};const s=D(c);if(!s)return{added:[],skipped:t,status:"no-config"};if(!V(s))return{added:[],skipped:t,status:"no-config"};const n=E(s),h=n.search(/installScripts\s*:\s*\{/);let l=null,r=0;if(h!==-1){const a=n.slice(h),d=/(allow\s*:\s*\{)([^}]*)(\})/.exec(a);d?.index!==void 0&&(l=d,r=h+d.index)}if(l){const a=l[2]??"",f=new Set;for(const g of a.matchAll(/["']([^"']+)["']\s*:/g))f.add(g[1]);for(const g of a.matchAll(/(?:^|,|\{)\s*([a-z_$][\w-]*)\s*:/gi))f.add(g[1]);const d=[],k=[];for(const g of t)f.has(g)?k.push(g):d.push(g);if(d.length===0)return{added:[],configPath:s,skipped:k,status:"noop"};const x=/\n([ \t]+)\S/.exec(a)?.[1]??" ",_=`
|
|
2
2
|
${d.map(g=>y(g,x)).join(`
|
|
3
3
|
`)}`,v=a.replace(/\s+$/,""),S=a.slice(v.length),R=`${v}${v.endsWith(",")||v===""?"":","}${_}${S.length>0?S:`
|
|
4
4
|
`}`,j=`${n.slice(0,r)}${l[1]}${R}${l[3]}${n.slice(r+l[0].length)}`;return w(s,j),{added:d,configPath:s,skipped:k,status:"updated"}}const i=/(installScripts\s*:\s*\{)/;if(i.test(n)){const a=`
|