@visulima/vis 4.1.20 → 4.3.0
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 +42 -0
- package/LICENSE.md +804 -360
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +117 -0
- package/dist/packem_chunks/CONFIG_FILES.js +1 -1
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/cargo-plan.js +3 -0
- package/dist/packem_chunks/catalog.js +50 -50
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +146 -142
- package/dist/packem_chunks/composer-projects.js +2 -0
- package/dist/packem_chunks/dart-plan.js +1 -0
- package/dist/packem_chunks/dart-projects.js +1 -0
- package/dist/packem_chunks/dispatch.js +1 -1
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/gem-plan.js +2 -0
- package/dist/packem_chunks/gem-projects.js +1 -0
- package/dist/packem_chunks/git.js +5 -5
- package/dist/packem_chunks/go-plan.js +1 -0
- package/dist/packem_chunks/go-projects.js +2 -0
- package/dist/packem_chunks/gradle-plan.js +1 -0
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +1 -1
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +2 -2
- 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/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/handler39.js +6 -6
- package/dist/packem_chunks/handler4.js +3 -3
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler50.js +1 -1
- package/dist/packem_chunks/handler51.js +1 -1
- package/dist/packem_chunks/handler52.js +3 -3
- package/dist/packem_chunks/handler53.js +1 -1
- package/dist/packem_chunks/handler54.js +2 -2
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler58.js +3 -3
- package/dist/packem_chunks/handler59.js +1 -1
- package/dist/packem_chunks/handler6.js +5 -5
- package/dist/packem_chunks/handler60.js +1 -1
- package/dist/packem_chunks/handler61.js +1 -1
- package/dist/packem_chunks/handler62.js +1 -1
- package/dist/packem_chunks/handler63.js +1 -1
- package/dist/packem_chunks/handler64.js +1 -1
- package/dist/packem_chunks/handler65.js +4 -4
- package/dist/packem_chunks/handler66.js +1 -1
- package/dist/packem_chunks/handler67.js +10 -10
- package/dist/packem_chunks/handler68.js +1 -1
- package/dist/packem_chunks/handler69.js +1 -1
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +4 -4
- package/dist/packem_chunks/handler71.js +6 -6
- package/dist/packem_chunks/handler72.js +1 -1
- package/dist/packem_chunks/handler73.js +87 -86
- package/dist/packem_chunks/handler74.js +1 -1
- package/dist/packem_chunks/handler75.js +31 -31
- package/dist/packem_chunks/handler76.js +4 -4
- package/dist/packem_chunks/handler77.js +1 -1
- package/dist/packem_chunks/handler78.js +64 -64
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +7 -7
- package/dist/packem_chunks/hex-plan.js +3 -0
- package/dist/packem_chunks/hex-projects.js +1 -0
- package/dist/packem_chunks/index2.js +52 -42
- package/dist/packem_chunks/index4.js +58 -802
- package/dist/packem_chunks/index5.js +802 -7
- package/dist/packem_chunks/index6.js +7 -59
- 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/maven-plan.js +1 -0
- package/dist/packem_chunks/maven-projects.js +1 -0
- package/dist/packem_chunks/nuget-plan.js +1 -0
- package/dist/packem_chunks/nuget-projects.js +1 -0
- package/dist/packem_chunks/orchestrator.js +33 -33
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/python-plan.js +3 -0
- package/dist/packem_chunks/python-projects.js +1 -0
- package/dist/packem_chunks/security.js +1 -1
- package/dist/packem_chunks/snapshot.js +2 -2
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/swift-projects.js +1 -0
- package/dist/packem_chunks/sync.js +3 -2
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/ts-loader.js +5 -5
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_chunks/version-resolver.js +3 -3
- package/dist/packem_chunks/zig-plan.js +1 -0
- package/dist/packem_chunks/zig-projects.js +1 -0
- package/dist/packem_shared/Table-BB8xHTU5-BLPS917D.js +11 -0
- package/dist/packem_shared/affected-selection-BzIbfpA1.js +1 -0
- package/dist/packem_shared/{affected-shas-Dd0P7fGD.js → affected-shas-B2V84O0g.js} +1 -1
- package/dist/packem_shared/{ai-analysis-DSQQDFU9.js → ai-analysis-Cfj24UAy.js} +1 -1
- package/dist/packem_shared/{ai-fix-BHyx1F1j.js → ai-fix-DeRUtT-s.js} +1 -1
- package/dist/packem_shared/{augment-COAiXSIx.js → augment-B9kSZuvW.js} +1 -1
- package/dist/packem_shared/{bin-Bq3tJmvE.js → bin-D9TsVhq2.js} +1 -1
- package/dist/packem_shared/{build-scripts-pdVmqXRm.js → build-scripts-CEDx_nJp.js} +1 -1
- package/dist/packem_shared/{command-runtime-CiLVo4ED.js → command-runtime-p4IXiIf6.js} +1 -1
- package/dist/packem_shared/composer-DR3D-Psb.js +1 -0
- package/dist/packem_shared/dart-pubspec-BK_cK2EP.js +2 -0
- package/dist/packem_shared/{dependency-scan-DBH2Qo4I.js → dependency-scan-B8jroa1D.js} +1 -1
- package/dist/packem_shared/{docker-Dy-X_BuM.js → docker-DXqV-07f.js} +1 -1
- package/dist/packem_shared/ecosystem-gate-1M3wnsTr.js +6 -0
- package/dist/packem_shared/{failure-log-3R522Vb5.js → failure-log-D2x5BT8S.js} +1 -1
- package/dist/packem_shared/{formatBytes-BHAzNIrn-XohRrPdt.js → formatBytes-BHAzNIrn-CrusHOew.js} +1 -1
- package/dist/packem_shared/gemspec-K7N05xxc.js +3 -0
- package/dist/packem_shared/glob-Cyk1H9ZL-Dxlf9Swz.js +1 -0
- package/dist/packem_shared/go-modules-BsVqtyeC.js +1 -0
- package/dist/packem_shared/gradle-build-CHZDHyjI.js +8 -0
- package/dist/packem_shared/index-BO8qIogg.js +1 -0
- package/dist/packem_shared/index-BzhrR_iC.js +22 -0
- package/dist/packem_shared/{index-Vm90Te96.js → index-CNYv9D8g.js} +1 -1
- package/dist/packem_shared/{isAccessibleSync-DYKTrrvc-CSnBISfV.js → isAccessibleSync-DYKTrrvc-C-_5cgwu.js} +1 -1
- package/dist/packem_shared/{lifecycle-CAIJbxIa.js → lifecycle-D6PMPor-.js} +1 -1
- package/dist/packem_shared/{lockfile-DVFySxTS.js → lockfile-CiUtEbnt.js} +1 -1
- package/dist/packem_shared/{manifests-BNSmpPF_.js → manifests-Du4yKlf_.js} +1 -1
- package/dist/packem_shared/maven-pom-B0KG9kJQ.js +1 -0
- package/dist/packem_shared/{min-release-age-ChzTC7_I.js → min-release-age-JViyQuBM.js} +1 -1
- package/dist/packem_shared/missing-package-json-DnHMxRnG.js +1 -0
- package/dist/packem_shared/mix-project-RYvdZp3_.js +2 -0
- package/dist/packem_shared/multi-eco-lockfiles-CUUxUjHK.js +1 -0
- package/dist/packem_shared/{native-config-sync-BSzU4qUO.js → native-config-sync-TdTWjVgI.js} +2 -2
- package/dist/packem_shared/nuget-project-RApYSW_y.js +4 -0
- package/dist/packem_shared/{osv-bloom-JYIWcH3F.js → osv-bloom-BCAX5ARR.js} +1 -1
- package/dist/packem_shared/package-version-DUcG-b7S.js +4 -0
- package/dist/packem_shared/{packument-DyuhH1Gz.js → packument-CyGSNquL.js} +1 -1
- package/dist/packem_shared/{pm-runner-d93_73O6.js → pm-runner-CMSml1Bj.js} +1 -1
- package/dist/packem_shared/{project-name-filter-CC5FF49q.js → project-name-filter--bq-FL2f.js} +1 -1
- package/dist/packem_shared/{provenance-BH80RHXx.js → provenance-DyF0b6KX.js} +1 -1
- package/dist/packem_shared/{readJsonSync-CbryXYxN-B2aSeDpC.js → readJsonSync-CbryXYxN-EWl7_7KX.js} +1 -1
- package/dist/packem_shared/{registry-keys-BWHRFWbb.js → registry-keys-DwB3ZXS_.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-DuJ3mbzt.js → resolve-explicit-BjCEm0s-.js} +1 -1
- package/dist/packem_shared/resolve-runtime-CNiHcVtx.js +1 -0
- package/dist/packem_shared/{run-file-jMngGQhs.js → run-file-UBukWaha.js} +1 -1
- package/dist/packem_shared/{runtime-check-BklgEMkC.js → runtime-check-1U8HrQd9.js} +1 -1
- package/dist/packem_shared/{s1ngularity-BJ5j2vbJ.js → s1ngularity-YfmkD_AH.js} +1 -1
- package/dist/packem_shared/scan-progress-C_zaZjyY.js +2 -0
- package/dist/packem_shared/{selectors-B7lSFz7l.js → selectors-edwcgNl3.js} +1 -1
- package/dist/packem_shared/{signatures-BP042BlB.js → signatures-CL3ckp_Y.js} +1 -1
- package/dist/packem_shared/{spinner-BM_0Bj6x.js → spinner-DuB0K0Am.js} +1 -1
- package/dist/packem_shared/swift-package-B6X5kzQE.js +1 -0
- package/dist/packem_shared/{tabs-UDYQ3tqt.js → tabs-RZd_e1M0.js} +1 -1
- package/dist/packem_shared/{target-merge-B4No-LHM.js → target-merge-DVJl-7Qz.js} +1 -1
- package/dist/packem_shared/{target-options-d_rIrLyq.js → target-options-DsHFmRZH.js} +1 -1
- package/dist/packem_shared/{toolchain-DY11tPCw.js → toolchain-BRdpaAC4.js} +1 -1
- package/dist/packem_shared/{typosquats-CSkIFgF5.js → typosquats-8u0drCqQ.js} +1 -1
- package/dist/packem_shared/{use-measured-height-BPQg2q_p.js → use-measured-height-DWkDV9Dj.js} +1 -1
- package/dist/packem_shared/verify-B_MblU_Q.js +1 -0
- package/dist/packem_shared/{vis-update-app-CR21zyht.js → vis-update-app-D73C__fx.js} +1 -1
- package/dist/packem_shared/{vis-user-error-qqqhLoF6.js → vis-user-error-Cpg2FqA4.js} +15 -15
- package/dist/packem_shared/{watch-Dswvj6Zp.js → watch-CcTketln.js} +1 -1
- package/dist/packem_shared/{watch-loop-COWvvSbR.js → watch-loop-qRn0IHPG.js} +1 -1
- package/dist/packem_shared/{writeFileSync-DJoHk3Ks-CgQ-VNNT.js → writeFileSync-DJoHk3Ks-BPRoepNw.js} +1 -1
- package/dist/packem_shared/zig-manifest-P7ydLEOa.js +7 -0
- package/dist/release/plugin-sdk.d.ts +1 -1
- package/dist/release/types.d.ts +133 -7
- package/dist/runtime/preload.js +1 -1
- package/index.js +52 -52
- package/package.json +12 -12
- package/schemas/vis-config.schema.json +279 -5
- package/schemas/vis-release-config.schema.json +132 -5
- package/dist/packem_shared/Table-kgZ-Cd21-DdNsp69H.js +0 -9
- package/dist/packem_shared/advisories-0ScpWAHV.js +0 -1
- package/dist/packem_shared/affected-selection-Bt4qkPUb.js +0 -1
- package/dist/packem_shared/cyclonedx-CX2fFvDi.js +0 -4
- package/dist/packem_shared/glob-Cyk1H9ZL-ox19CSsT.js +0 -1
- package/dist/packem_shared/index-Czrll7SU.js +0 -1
- package/dist/packem_shared/index-DHD8wb6Z.js +0 -22
- package/dist/packem_shared/missing-package-json-C0keIt78.js +0 -1
- package/dist/packem_shared/package-version-DFlytdgJ.js +0 -4
- package/dist/packem_shared/resolve-runtime-C7NBCA1C.js +0 -1
- package/dist/packem_shared/scan-progress-DRIGQRMr.js +0 -2
- package/dist/packem_shared/verify-D8wYvB85.js +0 -1
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as _}from"node:module";import{a as g}from"../packem_shared/index-B4AjSxHU.js";import{f as k,p as C,r as P}from"../packem_shared/composer-DR3D-Psb.js";import{VisReleaseError as R}from"../packem_shared/VisReleaseError-DZtgcKf8.js";import{isValidPackageName as q}from"./security.js";import{createShellRunner as M}from"./shell-runner.js";let w;const $=e=>(w??=_(import.meta.url))(e),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=e=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[o,n]=u.versions.node.split(".").map(Number);if(o>22||o===22&&n>=3||o===20&&n>=16)return u.getBuiltinModule(e)}return $(e)},{readFileSync:b}=v("node:fs"),{resolve:j,join:y}=v("node:path"),l=(e,o)=>new R({code:"CONFIG_INVALID",file:e,message:o}),h=(e,o,n)=>l(e,`Could not read the git tags in ${o} (${n}). The checkout may be shallow. Run \`git fetch --tags --unshallow\` and re-run the release.`),N=/^[a-z0-9]+(?:[_.-][a-z0-9]+)*\/[a-z0-9]+(?:[_.-][a-z0-9]+)*$/u,T=async(e,o)=>{const n=y(o,"composer.json");let c;try{c=await e.run("git",["tag","--list"],{cwd:o,silent:!0})}catch(a){throw h(n,o,a.message)}if(c.exitCode!==0)throw h(n,o,`git tag --list exited ${c.exitCode}`);const m=[];for(const a of c.stdout.split(`
|
|
2
|
+
`)){const t=/^v(\d+\.\d+\.\d+)$/u.exec(a.trim());t?.[1]!==void 0&&g.valid(t[1])!==null&&m.push(t[1])}return m.length===0?void 0:g.rsort(m)[0]},D=async e=>{const{claimedDirs:o}=e,n=j(e.cwd),c=e.runner??M(),m=[],a=new Map;for(const t of k(n)){if(o.has(t))continue;const s=y(t,"composer.json");let r;try{r=C(b(s,"utf8"))}catch(f){throw l(s,`${s} is not a valid JSON object: ${f.message}.`)}if(r.name===void 0)continue;if(typeof r.name!="string"||!N.test(r.name)||!q(r.name))throw l(s,`${JSON.stringify(r.name)} is not a valid Composer name. Use lowercase "vendor/package", with segments of [a-z0-9] joined by "-", "." or "_".`);const{name:i}=r;if(t!==n)throw l(s,`${i} is in a subdirectory. Packagist reads a package from its repository root, so its tag would never reach Packagist. Move it to its own repository, or remove its name.`);if("version"in r)throw l(s,`${s} sets "version". Packagist ignores it and reads the version from the git tag. Remove the key; vis releases from the tag.`);const d=a.get(i);if(d!==void 0)throw l(s,`${i} is declared by both ${d} and ${s}. A Composer name must be unique to release it.`);a.set(i,s),m.push({dir:t,manifest:r,manifestPath:s,name:i})}return Promise.all(m.map(async({dir:t,manifest:s,manifestPath:r,name:i})=>{const d=await T(c,t)??"0.0.0",f={};for(const p of P(s,"require"))a.has(p)&&p!==i&&(f[p]="*");return{name:i,package:{dir:t,ecosystem:"composer",manifest:{dependencies:f,name:i,private:!1,version:d},manifestPath:r,name:i,private:!1,version:d},perPackage:{currentVersionResolver:"disk",managed:!0,releaseTagPattern:"v{version}",versionActions:"composer"}}}))};export{D as discoverComposerProjects,T as latestComposerTag};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as l}from"node:module";import{r as w,D as h}from"../packem_shared/dart-pubspec-BK_cK2EP.js";import{VisReleaseError as d}from"../packem_shared/VisReleaseError-DZtgcKf8.js";let f;const u=r=>(f??=l(import.meta.url))(r),t=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=r=>{if(typeof t<"u"&&t.versions&&t.versions.node){const[e,a]=t.versions.node.split(".").map(Number);if(e>22||e===22&&a>=3||e===20&&a>=16)return t.getBuiltinModule(r)}return u(r)},{readFile:g}=_("node:fs/promises"),j=async(r,e)=>r.get(e)??g(e,"utf8"),v=async r=>{const{pending:e,projects:a,releases:p}=r,c=new Set;for(const o of p){const s=a.find(n=>n.name===o.name);if(s===void 0)throw new d({code:"CONFIG_INVALID",message:`${o.name} is planned as a Dart release, but no Dart package with that name was discovered. Re-run the release from a fresh context.`,packageName:o.name});const m=await j(e,s.owner);let i;try{i=w(m,s.package.version,o.newVersion)}catch(n){throw n instanceof h?new d({code:"CONFIG_INVALID",file:s.owner,message:`${s.owner}: ${n.message}.`,packageName:o.name}):n}e.set(s.owner,i),c.add(s.owner)}return c};export{v as planDartWorkspace};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as $}from"node:module";import{e as D,D as g,s as j}from"../packem_shared/dart-pubspec-BK_cK2EP.js";import{VisReleaseError as N}from"../packem_shared/VisReleaseError-DZtgcKf8.js";import{isValidPackageName as T}from"./security.js";let y;const k=n=>(y??=$(import.meta.url))(n),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=n=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[r,a]=p.versions.node.split(".").map(Number);if(r>22||r===22&&a>=3||r===20&&a>=16)return p.getBuiltinModule(n)}return k(n)},{existsSync:f,readFileSync:P}=_("node:fs"),{join:u,resolve:v}=_("node:path"),b="https://pub.dev",i=(n,r)=>new N({code:"CONFIG_INVALID",file:n,message:r}),R=n=>{const{claimedDirs:r,cwd:a}=n,c=u(a,"pubspec.yaml");if(!f(c))return[];const l=w(c),h=[a];if(l.workspace!==void 0)for(const e of l.workspace){if(!e.includes("*")&&!f(u(a,e,"pubspec.yaml")))throw i(c,`${c} lists "${e}" in workspace, but that directory has no pubspec.yaml.`);let o;try{o=D(a,e)}catch(t){throw t instanceof g?i(c,`${c}: ${t.message}.`):t}h.push(...o.map(t=>v(t)))}const m=[];for(const e of new Set(h.map(s=>v(s)))){const s=u(e,"pubspec.yaml"),o=w(s);if(!(o.publishTo==="none"||o.version===void 0||r.has(e))){if(o.publishTo!==void 0&&o.publishTo!==b)throw i(s,`${s} sets publish_to to "${o.publishTo}". vis checks and publishes only to ${b}; remove publish_to or release the package with a shell publish.`);if(o.name===void 0)throw i(s,`${s} sets version but has no name. Declare name: your_package in it.`);if(!T(o.name))throw i(s,`${s} names the package "${o.name}", which is not a valid release name.`);m.push({dependencyNames:o.dependencyNames,dir:e,name:o.name,owner:s,version:o.version.value})}}const d=new Map;for(const e of m){const s=d.get(e.name);if(s!==void 0)throw i(e.owner,`${e.name} is declared by both ${s} and ${e.owner}. Package names must be unique to release them.`);d.set(e.name,e.owner)}return m.map(e=>{const s={};for(const t of e.dependencyNames)d.has(t)&&t!==e.name&&(s[t]="*");const o={dependencies:s,name:e.name,private:!1,version:e.version};return{name:e.name,owner:e.owner,package:{dir:e.dir,ecosystem:"dart",manifest:o,manifestPath:e.owner,name:e.name,private:!1,version:e.version}}})},w=n=>{try{return j(P(n,"utf8"))}catch(r){throw r instanceof g?i(n,`${n}: ${r.message}.`):r}};export{R as discoverDartProjects};
|
|
@@ -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-BzhrR_iC.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-sXNQYpsl.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-sXNQYpsl.js";import{a as N}from"../packem_shared/index-BzhrR_iC.js";import{a as B,r as D,b as y,c as M}from"../packem_shared/ai-fix-DeRUtT-s.js";import{p as c}from"./cli-main.js";import{l as _}from"../packem_shared/failure-log-D2x5BT8S.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(`
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as I}from"node:module";import{a as j}from"../packem_shared/gemspec-K7N05xxc.js";import{VisReleaseError as a}from"../packem_shared/VisReleaseError-DZtgcKf8.js";let N;const $=n=>(N??=I(import.meta.url))(n),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=n=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[o,t]=r.versions.node.split(".").map(Number);if(o>22||o===22&&t>=3||o===20&&t>=16)return r.getBuiltinModule(n)}return $(n)},{readFile:b}=v("node:fs/promises"),u=n=>`${n.owner}\0${n.line}`,y=/^[0-9A-Z]+(?:\.[0-9A-Z]+)*$/i,G=async(n,o)=>n.get(o)??b(o,"utf8"),F=async n=>{const{pending:o,projects:t,releases:l}=n,d=new Set,h=new Set(t.map(e=>e.name));for(const e of l){if(!h.has(e.name))throw new a({code:"CONFIG_INVALID",message:`${e.name} is planned as a gem release, but no gem with that name was discovered. Re-run the release from a fresh context.`,packageName:e.name});if(!y.test(e.newVersion))throw new a({code:"CONFIG_INVALID",message:`${e.newVersion} cannot be written as a gem version for ${e.name}. Gem versions are dot-separated alphanumerics (1.2.3, 1.2.3.beta.1); a semver prerelease with "-" is not one.`,packageName:e.name})}const p=new Map(l.map(e=>[e.name,e.newVersion])),i=new Map;for(const e of t){const s=u(e);i.set(s,[...i.get(s)??[],e])}const f=new Set;for(const e of t){const s=p.get(e.name),c=u(e);if(s===void 0||f.has(c))continue;f.add(c);const w=(i.get(c)??[]).filter(m=>p.get(m.name)!==s);if(w.length>0)throw new a({code:"CONFIG_INVALID",file:e.owner,message:`Gems share the version declared at ${e.owner}:${e.line}, so they must release together at ${s}. Not released at that version: ${w.map(m=>m.name).join(", ")}.`});const g=await G(o,e.owner),_=g.split(`
|
|
2
|
+
`)[e.line-1]??"";if(!/=\s*(["'])[^"'\\]*\1/.test(_))throw new a({code:"CONFIG_INVALID",file:e.owner,message:`${e.owner} has no version literal on line ${e.line} to bump for ${e.name}.`});o.set(e.owner,j(g,e.line,s)),d.add(e.owner)}return d};export{F as planGemWorkspace};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as G}from"node:module";import{f as R,p as V,G as y,g as q,r as F}from"../packem_shared/gemspec-K7N05xxc.js";import{VisReleaseError as I}from"../packem_shared/VisReleaseError-DZtgcKf8.js";import{isValidPackageName as M}from"./security.js";let P;const j=a=>(P??=G(import.meta.url))(a),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=a=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[i,m]=d.versions.node.split(".").map(Number);if(i>22||i===22&&m>=3||i===20&&m>=16)return d.getBuiltinModule(a)}return j(a)},{readFile:k}=b("node:fs/promises"),{dirname:N}=b("node:path"),c=(a,i,m)=>new I({code:"CONFIG_INVALID",file:a,message:i,packageName:m}),T=async a=>{const{claimedDirs:i,cwd:m}=a,f=[],h=new Map,u=new Set;for(const e of R(m)){const t=N(e);if(u.has(t))throw c(e,`${t} holds more than one gemspec. vis builds one gem per directory; move one of them to its own directory.`);if(u.add(t),i.has(t))continue;let n;try{n=V(await k(e,"utf8"),e)}catch(o){throw o instanceof y?c(o.file,o.message):o}if(n.version===void 0)continue;if(n.name===void 0)throw c(e,`${e} sets a version but no name. Declare spec.name = "my-gem" in the gemspec.`);const s=n.name.value;if(!M(s))throw c(e,`${e} names the gem "${s}", which is not a valid package name (lowercase letters, digits, ".", "_" and "-").`,s);let v=e,p,l;if(n.version.kind==="literal")p=n.version.line,l=n.version.value;else{const o=q(t,s);let _;try{_=await k(o,"utf8")}catch{throw c(e,`${e} sets spec.version to ${n.version.constant}, but ${o} does not exist. Put VERSION = "1.0.0" in that file, or set spec.version to a string literal.`,s)}try{const r=F(_,o);v=o,p=r.line,l=r.value}catch(r){throw r instanceof y?c(r.file,r.message,s):r}}const w={kind:n.version.kind,line:p,name:s,owner:v,package:{dir:t,ecosystem:"gem",manifest:{dependencies:{},name:s,private:!1,version:l},manifestPath:e,name:s,private:!1,version:l}};f.push(w),h.set(w,n.dependencies)}const g=new Map;for(const e of f){const t=g.get(e.name);if(t!==void 0)throw c(e.package.manifestPath,`${e.name} is declared by both ${t} and ${e.package.manifestPath}. Gem names must be unique to release them.`,e.name);g.set(e.name,e.package.manifestPath)}const $=new Set(f.map(e=>e.name));return f.map(e=>{const t={};for(const s of h.get(e)??[])$.has(s)&&s!==e.name&&(t[s]="*");const n={...e.package.manifest,dependencies:t};return{...e,package:{...e.package,manifest:n}}})};export{T as discoverGemProjects};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`).map(r=>r.replace(/\r$/,"")).filter(r=>r.trim()!=="").map(r=>{const i=r.length>3?r.slice(3):r.trim(),o=i.lastIndexOf(" -> "),n=o===-1?i:i.slice(o+4);return s(n.trim())}).filter(Boolean)},
|
|
3
|
-
`)}const o=["tag"];i&&(i.key&&i.mode==="gpg"?o.push("-u",i.key):o.push("-s")),s?o.push("-a",e,"-m",s):o.push(e);const n=await d(t,o);if(n.exitCode!==0)throw new c({code:"GIT_OPERATION_FAILED",message:`git tag ${e} failed: ${n.stderr||n.stdout}`})},
|
|
4
|
-
`)}const i=["tag","-f"];r&&(r.key&&r.mode==="gpg"?i.push("-u",r.key):i.push("-s")),i.push(e);const o=await d(t,i);if(o.exitCode!==0)throw new c({code:"GIT_OPERATION_FAILED",message:`git tag -f ${e} failed: ${o.stderr||o.stdout}`});if(s.push===!1)return;const n=await h(t,s.remote??"origin",["--force",`refs/tags/${e}:refs/tags/${e}`]);if(n.exitCode!==0)throw new c({code:"TAG_PUSH_FAILED",hint:"After resolving, re-run with --resume to retry the push.",message:`git push --force refs/tags/${e} failed: ${n.stderr||n.stdout}`})},
|
|
5
|
-
`).map(n=>n.replace(/\r$/u,"")).some(n=>n===`! ${r} [rejected] (fetch first)`||n===`! ${r} [rejected] (non-fast-forward)`);if(!(i.exitCode===0||o))return i.stderr.trim()||i.stdout.trim()||`git push --dry-run exited with ${String(i.exitCode)}`};export{
|
|
1
|
+
import{createRequire as C}from"node:module";import{VisReleaseError as c}from"../packem_shared/VisReleaseError-DZtgcKf8.js";let O;const $=t=>(O??=C(import.meta.url))(t),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,I=t=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[e,s]=f.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return f.getBuiltinModule(t)}return $(t)},{realpathSync:R}=I("node:fs"),{relative:p,isAbsolute:G,resolve:y,join:N,dirname:b,basename:S}=I("node:path"),d=async(t,e,s=!0)=>t.runner.run("git",e,{cwd:t.cwd,silent:s}),T={github:{user:"x-access-token",vars:["VIS_GH_TOKEN","GITHUB_TOKEN","GH_TOKEN"]},gitlab:{user:"oauth2",vars:["GITLAB_TOKEN","GL_TOKEN","VIS_GH_TOKEN"]}},m=t=>{if(!(t===void 0||t.trim()===""))try{return new URL(t.includes("://")?t:`https://${t}`).host.toLowerCase()}catch{return}},H=(t,e)=>{const s=new Set(["github.com",m(e.GH_HOST),m(e.GITHUB_SERVER_URL)]),r=new Set(["gitlab.com",m(e.CI_SERVER_HOST),m(e.CI_SERVER_URL),m(e.GITLAB_HOST)]);if(s.has(t))return T.github;if(r.has(t))return T.gitlab},L=async(t,e="origin")=>{const s=t.env??process.env;let r=e;if(!/^[a-z][\w+.-]*:\/\//iu.test(e)){const a=await d(t,["remote","get-url","--push",e]);if(a.exitCode!==0)return;r=a.stdout.trim()}let i;if(r.includes("\\"))return;try{i=new URL(r)}catch{return}if(i.protocol!=="https:"||i.username!=="")return;const o=H(i.host.toLowerCase(),s),n=o?.vars.map(a=>s[a]).find(a=>a!==void 0&&a!=="");if(o===void 0||n===void 0)return;const u=await d(t,["config","--get-urlmatch","http.extraheader",i.href]);if(!(u.exitCode===0&&u.stdout.trim()!==""))return{origin:i.origin,token:n,user:o.user}},F=async(t,e="origin")=>{const s=await L(t,e);if(s===void 0)return;const r=(t.env??process.env).GIT_CONFIG_COUNT??"0";if(!/^\d+$/u.test(r))return;const i=Number(r),o=Buffer.from(`${s.user}:${s.token}`).toString("base64");return{[`GIT_CONFIG_KEY_${i}`]:`http.${s.origin}/.extraheader`,[`GIT_CONFIG_VALUE_${i}`]:`AUTHORIZATION: basic ${o}`,GIT_CONFIG_COUNT:String(i+1)}},h=async(t,e,s,r=!1)=>{const i=await F(t,e);return t.runner.run("git",["push",e,...s],{cwd:t.cwd,env:i,silent:r})},v=async t=>{const e=await d(t,["rev-parse","--abbrev-ref","HEAD"]);if(e.exitCode!==0)return;const s=e.stdout.trim();return s==="HEAD"||s===""?void 0:s},P=async t=>{const e=await d(t,["rev-parse","HEAD"]);return e.exitCode===0?e.stdout.trim():void 0},k=async t=>{const e=await d(t,["rev-parse","--short","HEAD"]);return e.exitCode===0?e.stdout.trim():void 0},V=async t=>{const e=await d(t,["status","--porcelain","--untracked-files=all"]);if(e.exitCode!==0)return[];const s=r=>{if(!r.startsWith(String.raw`"`)||!r.endsWith(String.raw`"`)||r.length<2)return r;const i=r.slice(1,-1);try{return JSON.parse(`"${i}"`)}catch{return i}};return e.stdout.split(`
|
|
2
|
+
`).map(r=>r.replace(/\r$/,"")).filter(r=>r.trim()!=="").map(r=>{const i=r.length>3?r.slice(3):r.trim(),o=i.lastIndexOf(" -> "),n=o===-1?i:i.slice(o+4);return s(n.trim())}).filter(Boolean)},D=async(t,e)=>(await d(t,["rev-parse","--verify","--quiet",`refs/tags/${e}`])).exitCode===0,U=async(t,e,s="origin")=>{const r=await d(t,["ls-remote","--tags",s,e]);return r.exitCode===0&&r.stdout.trim()!==""},q=async(t,e)=>{const s=await d(t,["rev-parse","--show-toplevel"]),r=s.exitCode===0&&s.stdout.trim()?s.stdout.trim():t.cwd,i=p(r,e);return i.startsWith("..")?p(A(r),A(e)).replaceAll("\\","/"):i.replaceAll("\\","/")},A=t=>{const e=G(t)?t:y(t),s=[];let r=e;for(;;)try{const i=R.native(r);return s.length===0?i:N(i,...s.toReversed())}catch{const i=b(r);if(i===r)return e;s.push(S(r)),r=i}},W=async(t,e,s,r={})=>{if(e.length===0&&!r.allowEmpty)throw new c({code:"CONFIG_INVALID",message:"stageAndCommit called with no files (and allowEmpty=false)."});if(e.length>0){const a=await t.runner.run("git",["add","--",...e],{cwd:t.cwd,silent:!0});if(a.exitCode!==0)throw new c({code:"GIT_OPERATION_FAILED",message:`git add failed: ${a.stderr||a.stdout}`})}const i={...process.env};r.author&&(i.GIT_AUTHOR_NAME=r.author.name,i.GIT_AUTHOR_EMAIL=r.author.email,i.GIT_COMMITTER_NAME=r.author.name,i.GIT_COMMITTER_EMAIL=r.author.email);const o=["commit","-m",s];r.allowEmpty&&o.push("--allow-empty");const n=await t.runner.run("git",o,{cwd:t.cwd,env:i,silent:!0});if(n.exitCode!==0)throw new c({code:"GIT_OPERATION_FAILED",message:`git commit failed: ${n.stderr||n.stdout}`});const u=await P(t);if(!u)throw new c({code:"GIT_OPERATION_FAILED",message:"git commit succeeded but HEAD is not resolvable."});return u},M=6e4;let g;const E=async t=>{const e=Date.now();if(g!==void 0&&e-g.cachedAtMs<M)return g.value;const s=await t.runner.run("gitsign",["--version"],{cwd:t.cwd,silent:!0});return g={cachedAtMs:e,value:s.exitCode===0},g.value},j=()=>{g=void 0},z=j,J=async(t,e,s,r={})=>{if(await D(t,e))throw new c({code:"TAG_COLLISION",message:`Tag "${e}" already exists locally. Resolve manually before re-running.`});if(!r.skipRemoteCheck&&await U(t,e,r.remote??"origin"))throw new c({code:"TAG_COLLISION",message:`Tag "${e}" already exists on remote "${r.remote??"origin"}". A previous run may have pushed tags but failed mid-publish — inspect the remote and either re-use the existing tag or delete it before re-running.`});const{signing:i}=r;if(i?.mode==="sigstore"){if(await E(t)){const u=["tag","-a",e];s&&u.push("-m",s);const a=await t.runner.run("gitsign",u,{cwd:t.cwd,silent:!0});if(a.exitCode!==0)throw new c({code:"GIT_OPERATION_FAILED",message:`gitsign tag ${e} failed: ${a.stderr||a.stdout}`});return}process.stderr.write(`[vis release] Warning: signing.mode is "sigstore" but \`gitsign\` is not on PATH; falling back to GPG signing for tag ${e}.
|
|
3
|
+
`)}const o=["tag"];i&&(i.key&&i.mode==="gpg"?o.push("-u",i.key):o.push("-s")),s?o.push("-a",e,"-m",s):o.push(e);const n=await d(t,o);if(n.exitCode!==0)throw new c({code:"GIT_OPERATION_FAILED",message:`git tag ${e} failed: ${n.stderr||n.stdout}`})},Y=async(t,e={})=>{const s=e.atomic?["--atomic","--tags"]:["--tags"],r=await h(t,e.remote??"origin",s);if(r.exitCode!==0)throw new c({code:"TAG_PUSH_FAILED",hint:"After resolving, re-run with --resume to retry the push.",message:`git push --tags failed: ${r.stderr||r.stdout}`})},Z=async(t,e,s={})=>{const{signing:r}=s;if(r?.mode==="sigstore"){if(await E(t)){const a=["tag","-f","-a","-m",`Floating tag ${e}`,e],l=await t.runner.run("gitsign",a,{cwd:t.cwd,silent:!0});if(l.exitCode!==0)throw new c({code:"GIT_OPERATION_FAILED",message:`gitsign tag -f ${e} failed: ${l.stderr||l.stdout}`});if(s.push===!1)return;const w=await h(t,s.remote??"origin",["--force",`refs/tags/${e}:refs/tags/${e}`]);if(w.exitCode!==0)throw new c({code:"TAG_PUSH_FAILED",hint:"After resolving, re-run with --resume to retry the push.",message:`git push --force refs/tags/${e} failed: ${w.stderr||w.stdout}`});return}process.stderr.write(`[vis release] Warning: signing.mode is "sigstore" but \`gitsign\` is not on PATH; falling back to GPG signing for floating tag ${e}.
|
|
4
|
+
`)}const i=["tag","-f"];r&&(r.key&&r.mode==="gpg"?i.push("-u",r.key):i.push("-s")),i.push(e);const o=await d(t,i);if(o.exitCode!==0)throw new c({code:"GIT_OPERATION_FAILED",message:`git tag -f ${e} failed: ${o.stderr||o.stdout}`});if(s.push===!1)return;const n=await h(t,s.remote??"origin",["--force",`refs/tags/${e}:refs/tags/${e}`]);if(n.exitCode!==0)throw new c({code:"TAG_PUSH_FAILED",hint:"After resolving, re-run with --resume to retry the push.",message:`git push --force refs/tags/${e} failed: ${n.stderr||n.stdout}`})},Q=async(t,e,s,r={})=>{const i=await t.runner.run("git",["add","-A","--",e],{cwd:t.cwd,silent:!0});if(i.exitCode!==0)throw new c({code:"GIT_OPERATION_FAILED",message:`git add ${e} failed: ${i.stderr||i.stdout}`});if((await t.runner.run("git",["diff","--cached","--quiet","--",e],{cwd:t.cwd,silent:!0})).exitCode===0)return{committed:!1,pushed:!1};const n={...process.env};r.author&&(n.GIT_AUTHOR_NAME=r.author.name,n.GIT_AUTHOR_EMAIL=r.author.email,n.GIT_COMMITTER_NAME=r.author.name,n.GIT_COMMITTER_EMAIL=r.author.email);const u=["commit","-m",s];r.sign&&u.push("-S");const a=await t.runner.run("git",u,{cwd:t.cwd,env:n,silent:!0});if(a.exitCode!==0)throw new c({code:"GIT_OPERATION_FAILED",message:`git commit failed: ${a.stderr||a.stdout}`});if(!r.push)return{committed:!0,pushed:!1};const l=r.branch??await v(t);return l?{committed:!0,pushed:(await h(t,r.remote??"origin",[`HEAD:${l}`])).exitCode===0}:{committed:!0,pushed:!1}},X=async(t,e,s={})=>{const r=[`HEAD:${e}`];s.force&&r.push("--force-with-lease");const i=await h(t,s.remote??"origin",r);if(i.exitCode!==0)throw new c({code:"TAG_PUSH_FAILED",message:`git push ${e} failed: ${i.stderr||i.stdout}`})},_=t=>t.replaceAll(":","/"),ee=(t,e)=>`${_(t)}@${e}`,te=(t,e)=>{const s=e.split(/[-+]/u,1)[0].split(".")[0],r=t.replace(/^@/u,"").replaceAll("/","-").replaceAll(":","-");return s===void 0||s===""||r===""?void 0:`${r}-v${s}`},B=/\{(name|unscopedName|version|major|minor|patch|date|channel)\}/g,re=(t,e)=>{const s=e.version??"",[r="",i="",o=""]=s.split(/[-+]/,1)[0].split("."),n={channel:e.channel??"",date:e.date??new Date().toISOString().slice(0,10),major:r,minor:i,name:e.name?_(e.name):"",patch:o,unscopedName:e.name?_(e.name.replace(/^@[^/]+\//,"")):"",version:s};return t.replaceAll(B,(u,a)=>n[a]??"")},se=async(t,e={})=>{const r=`HEAD:refs/heads/${e.branch??await v(t)??"vis-release-push-check"}`,i=await h(t,e.remote??"origin",["--porcelain","--dry-run","--no-verify",r],!0),o=i.stdout.split(`
|
|
5
|
+
`).map(n=>n.replace(/\r$/u,"")).some(n=>n===`! ${r} [rejected] (fetch first)`||n===`! ${r} [rejected] (non-fast-forward)`);if(!(i.exitCode===0||o))return i.stderr.trim()||i.stdout.trim()||`git push --dry-run exited with ${String(i.exitCode)}`};export{Z as createOrUpdateFloatingTag,J as createTag,ee as defaultTagFor,te as floatingMajorTagFor,v as getCurrentBranch,P as getCurrentSha,k as getShortSha,E as gitsignAvailable,V as listUncommittedPaths,X as pushBranch,Y as pushTags,re as renderTagPattern,j as resetGitsignCache,z as resetGitsignCacheForTests,F as resolvePushAuthEnv,L as resolvePushCredentials,W as stageAndCommit,Q as stageAndCommitFile,D as tagExists,U as tagExistsRemote,_ as tagSafeName,q as toRepoRelativePath,se as verifyPushAccess};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{a as i}from"../packem_shared/index-B4AjSxHU.js";import{VisReleaseError as s}from"../packem_shared/VisReleaseError-DZtgcKf8.js";const d=n=>{const{projects:r,releases:m}=n,t=new Map(r.map(e=>[e.name,e]));for(const e of m){const a=t.get(e.name);if(a===void 0)throw new s({code:"CONFIG_INVALID",message:`${e.name} is planned as a Go release, but no Go module with that name was discovered. Re-run the release from a fresh context.`,packageName:e.name});const o=i.major(e.newVersion);if(a.suffixMajor===void 0){if(o>=2)throw new s({code:"CONFIG_INVALID",message:`${e.name} would release ${e.newVersion}. A major version 2 or higher needs a /v${o} module path (for example ${e.name}/v${o}); this module path has no major suffix.`,packageName:e.name});continue}if(o!==a.suffixMajor)throw new s({code:"CONFIG_INVALID",message:`${e.name} ends in /v${a.suffixMajor}, so its releases must be ${a.suffixMajor}.x.y. ${e.newVersion} is major ${o}; a new major needs a new /vN module path.`,packageName:e.name})}};export{d as planGoWorkspace};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as P}from"node:module";import{a as $}from"../packem_shared/index-B4AjSxHU.js";import{p as V,a as D}from"../packem_shared/go-modules-BsVqtyeC.js";import{VisReleaseError as E}from"../packem_shared/VisReleaseError-DZtgcKf8.js";import{toRepoRelativePath as I}from"./git.js";import{isValidPackageName as S}from"./security.js";import{createShellRunner as W}from"./shell-runner.js";let M;const T=e=>(M??=P(import.meta.url))(e),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,R=e=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[o,r]=f.versions.node.split(".").map(Number);if(o>22||o===22&&r>=3||o===20&&r>=16)return f.getBuiltinModule(e)}return T(e)},{readFile:N}=R("node:fs/promises"),{join:l,isAbsolute:q,resolve:A,relative:C,sep:G}=R("node:path"),a=(e,o)=>new E({code:"CONFIG_INVALID",file:e,message:o}),j=(e,o,r)=>a(e,`Could not read the git tags in ${o} (${r}). The checkout may be shallow. Run \`git fetch --tags --unshallow\` and re-run the release.`),v=async e=>{try{return await N(e,"utf8")}catch{return}},B=e=>e.replaceAll(/[$()*+.?[\\\]^{|}]/gu,String.raw`\$&`),F=async e=>{const o=await v(l(e,"go.work"));if(o===void 0)return await v(l(e,"go.mod"))===void 0?[]:[e];const r=[];for(const i of D(o)){if(q(i))throw a(l(e,"go.work"),`go.work uses ${i}, an absolute path. vis reads only directories inside the workspace.`);const n=A(e,i),d=C(e,n);if(d===".."||d.startsWith(`..${G}`))throw a(l(e,"go.work"),`go.work uses ${i}, which is outside the workspace.`);if(await v(l(n,"go.mod"))===void 0)throw a(l(e,"go.work"),`go.work uses ${i}, which has no go.mod.`);r.push(n)}return r},Y=async e=>{const{claimedDirs:o,cwd:r}=e,i=e.runner??W(),n=await F(r);if(n.length===0)return[];const d=new Map,h=[];for(const c of n){if(o.has(c))continue;const t=l(c,"go.mod"),g=await v(t);if(g===void 0)throw a(t,`${t} is missing.`);const s=V(g);if(s===void 0)throw a(t,`${t} has no module directive.`);if(s.startsWith("gopkg.in/"))throw a(t,`${s} is a gopkg.in path. vis releases only modules whose tags follow the module path rules; release it with a shell tag.`);if(!S(s))throw a(t,`${s} is not a valid release name. Module paths are lowercase segments of [a-z0-9._-] joined by "/".`);const k=d.get(s);if(k!==void 0)throw a(t,`${s} is declared by both ${k} and ${t}. A module path must be unique to release it.`);d.set(s,t);const m=/\/v(\d+)$/u.exec(s);if(m?.[1]!==void 0&&Number(m[1])<2)throw a(t,`${s} ends in /v${m[1]}. Go allows a major version suffix only from v2 on.`);const u=m?.[1]===void 0?void 0:Number(m[1]),p=(await I({cwd:r,runner:i},c)).split("/").filter(b=>b!==""&&b!==".");u!==void 0&&p.at(-1)===`v${u}`&&p.pop();const w=p.length===0?"":`${p.join("/")}/`,y=await O(i,c,w,u);if(y===void 0&&u!==void 0)throw a(t,`${s} needs a major version ${u} tag before vis can release it. Create ${w}v${u}.0.0 by hand, then re-run the release.`);const _=y??"0.0.0",x=`${w}v{version}`;h.push({name:s,package:{dir:c,ecosystem:"go",manifest:{dependencies:{},name:s,private:!1,version:_},manifestPath:t,name:s,private:!1,version:_},perPackage:{currentVersionResolver:"disk",managed:!0,releaseTagPattern:x,versionActions:"go"},suffixMajor:u})}return h},O=async(e,o,r,i)=>{let n;try{n=await e.run("git",["tag","--list"],{cwd:o,silent:!0})}catch(c){throw j(l(o,"go.mod"),o,c.message)}if(n.exitCode!==0)throw j(l(o,"go.mod"),o,`git tag --list exited ${n.exitCode}`);const d=new RegExp(String.raw`^${B(r)}v(\d+\.\d+\.\d+)$`,"u"),h=[];for(const c of n.stdout.split(`
|
|
2
|
+
`)){const t=d.exec(c.trim());if(t?.[1]===void 0||$.valid(t[1])===null)continue;const g=$.major(t[1]);(i===void 0?g<=1:g===i)&&h.push(t[1])}return h.length===0?void 0:$.rsort(h)[0]};export{Y as discoverGoProjects,O as latestTagVersion};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as v}from"node:module";import{s as I,r as N}from"../packem_shared/gradle-build-CHZDHyjI.js";import{VisReleaseError as l}from"../packem_shared/VisReleaseError-DZtgcKf8.js";let $;const j=n=>($??=v(import.meta.url))(n),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,y=n=>{if(typeof a<"u"&&a.versions&&a.versions.node){const[o,r]=a.versions.node.split(".").map(Number);if(o>22||o===22&&r>=3||o===20&&r>=16)return a.getBuiltinModule(n)}return j(n)},{readFile:G}=y("node:fs/promises"),h=n=>`${n.owner}\0${n.line}`,b=async(n,o)=>n.get(o)??G(o,"utf8"),F=async n=>{const{pending:o,projects:r,releases:d}=n,m=new Set,_=new Set(r.map(e=>e.name));for(const e of d)if(!_.has(e.name))throw new l({code:"CONFIG_INVALID",message:`${e.name} is planned as a Gradle release, but no Gradle module with that name was discovered. Re-run the release from a fresh context.`,packageName:e.name});const f=new Map(d.map(e=>[e.name,e.newVersion])),i=new Map;for(const e of r){const s=h(e);i.set(s,[...i.get(s)??[],e])}const p=new Set;for(const e of r){const s=f.get(e.name),c=h(e);if(s===void 0||p.has(c))continue;p.add(c);const u=(i.get(c)??[]).filter(t=>f.get(t.name)!==s);if(u.length>0)throw new l({code:"CONFIG_INVALID",file:e.owner,message:`Gradle modules share the version declared at ${e.owner}:${e.line}, so they must release together at ${s}. Not released at that version: ${u.map(t=>t.name).join(", ")}.`});const w=await b(o,e.owner),g=I(w).assignments.find(t=>t.name==="version"&&t.line===e.line);if(g?.literal===void 0)throw new l({code:"CONFIG_INVALID",file:e.owner,message:`${e.owner} has no version literal on line ${e.line} to bump for ${e.name}.`});o.set(e.owner,N(w,g.literal,s)),m.add(e.owner)}return m};export{F as planGradleWorkspace};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{r as g,a as p,b as v}from"../packem_shared/pm-runner-
|
|
1
|
+
import{r as g,a as p,b as v}from"../packem_shared/pm-runner-CMSml1Bj.js";import{r as h,a as x}from"../packem_shared/command-runtime-p4IXiIf6.js";import{t as R}from"../packem_shared/utils-DQFHJn72.js";const B=async({argument:f,logger:c,options:e,rawUnknown:i,visConfig:s,workspaceRoot:k})=>{const l=f;if(!l||l.length===0)throw new Error("No command specified. Usage: vis exec <command> [args...]");const[o,...n]=l,t=i??[],m=t[0]==="--"?n:[...n,...t],a=k??process.cwd(),d=R(e.filter);let r=!e.recursive&&!e.workspaceRoot&&!e.parallel&&!e.reverse&&!e.shellMode&&d.length===0?g(o,m,a):null;if(r===null){const u=h({logger:c,options:e,visConfig:s},a),w=p(a,{backend:x(u),configBackend:s?.install?.backend,configCorepack:s?.install?.corepack});r=v(w,{args:m,command:o,filter:d,parallel:e.parallel||!1,recursive:e.recursive||!1,reverse:e.reverse||!1,shellMode:e.shellMode||!1,workspaceRoot:e.workspaceRoot||!1},a,c)}r!==0&&(process.exitCode=r)};export{B as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as _}from"node:module";import{z as m,e as t}from"../packem_shared/index-
|
|
1
|
+
import{createRequire as _}from"node:module";import{z as m,e as t}from"../packem_shared/index-BzhrR_iC.js";import{b}from"../packem_shared/formatBytes-BHAzNIrn-CrusHOew.js";import{y as a}from"../packem_shared/isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{U as j}from"../packem_shared/writeFileSync-DJoHk3Ks-BPRoepNw.js";let v;const w=s=>(v??=_(import.meta.url))(s),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=s=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[n,o]=c.versions.node.split(".").map(Number);if(n>22||n===22&&o>=3||n===20&&o>=16)return c.getBuiltinModule(s)}return w(s)},{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=s=>{const n=[];for(const o of p)if(a(o))try{const l=m(o).split(`
|
|
2
2
|
`),e=l.filter(r=>!r.includes(".vis/bin")&&!r.includes("VIS_HOME")&&!r.includes("# vis "));e.length!==l.length&&(j(o,e.join(`
|
|
3
3
|
`)),n.push(o))}catch{s.warn(`warning: could not clean ${o}`)}return n},H=async({fs:s,logger:n,options:o})=>{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(!o.yes){if(!process.stdin.isTTY)throw new Error("Non-interactive terminal. Use --yes to confirm.");const e=y({input:process.stdin,output:process.stdout}),r=await new Promise(h=>{e.question(`
|
|
4
4
|
Type "uninstall" to confirm: `,h)});if(e.close(),r.trim()!=="uninstall"){n.info("Aborted.");return}}const l=E(n);for(const e of l)n.info(`Cleaned ${e}`);try{await s.rm(f,{force:!0,recursive:!0}),n.info(`
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{a as f,f as k}from"../packem_shared/pm-runner-
|
|
1
|
+
import{a as f,f as k}from"../packem_shared/pm-runner-CMSml1Bj.js";import{r as m,a as w}from"../packem_shared/command-runtime-p4IXiIf6.js";const I=async({argument:e,logger:s,options:n,process:r,visConfig:a,workspaceRoot:t})=>{if(!e||e.length===0)throw new Error("No package specified. Usage: vis info <package> [field...]");const[l,...d]=e,c=t??r.cwd,i=m({logger:s,options:n,visConfig:a},c),p=f(c,{backend:w(i),configBackend:a?.install?.backend,configCorepack:a?.install?.corepack}),o=k(p,{fields:d,json:n.json||!1,package:l},c,s);o!==0&&o!==1&&(process.exitCode=o)};export{I 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-BzhrR_iC.js";import{findVisConfigFile as F,DEFAULT_MIN_RELEASE_AGE_MINUTES as h}from"./CONFIG_FILES.js";import{p as e,e as q}from"./cli-main.js";import{d as G}from"../packem_shared/pm-runner-CMSml1Bj.js";import{s as K}from"../packem_shared/build-scripts-CEDx_nJp.js";import{y as S}from"../packem_shared/isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{U as j}from"../packem_shared/writeFileSync-DJoHk3Ks-BPRoepNw.js";import{s as T}from"../packem_shared/native-config-sync-TdTWjVgI.js";import{s as R}from"../packem_shared/min-release-age-JViyQuBM.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:D}=x("node:child_process"),{createInterface:I}=x("node:readline"),U=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-sXNQYpsl.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-sXNQYpsl.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-YfmkD_AH.js";import{g as B,r as D}from"../packem_shared/packument-CyGSNquL.js";import{r as E}from"../packem_shared/provenance-DyF0b6KX.js";import{r as O}from"../packem_shared/signatures-CL3ckp_Y.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,
|
|
1
|
+
import{e as w,m as F,b as _}from"../packem_shared/index-BzhrR_iC.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-CMSml1Bj.js";import{a as $,r as K}from"../packem_shared/command-runtime-p4IXiIf6.js";import{s as M}from"../packem_shared/typosquats-8u0drCqQ.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-C-_5cgwu.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 c of Q)if(J(w(t,c)))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:c,options:e,visConfig:l,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,l?.security?.typosquatAllowlist)){process.exitCode=1;return}const i=e.installer;if(i&&!g.has(i)){r.error(`Invalid --installer value: "${i}". Expected one of: ${[...g].join(", ")}.`),process.exitCode=1;return}const y=i,O=e.aube===!1,f=$(K({logger:c,options:e,visConfig:l},s));let p;try{p=O?f===void 0?j(s):v(s,{backend:f}):v(s,{backend:y??f,configBackend:l?.install?.backend,configCorepack:l?.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,c,{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 A}from"node:module";import{J as P,F as
|
|
1
|
+
import{createRequire as A}from"node:module";import{J as P,F as j,X as O,b as I}from"../packem_shared/index.server-sXNQYpsl.js";import{e as q}from"../packem_shared/index-BzhrR_iC.js";import{c as b,p,O as N}from"./cli-main.js";import{i as B,j as U,d as z,a as H,F as V}from"./catalog.js";import{V as W}from"../packem_shared/vis-user-error-Cpg2FqA4.js";import{a as G,c as X,n as Y}from"../packem_shared/pm-runner-CMSml1Bj.js";import{r as J,a as K}from"../packem_shared/command-runtime-p4IXiIf6.js";import{r as _,a as Q,p as Z,b as ee}from"../packem_shared/resolve-explicit-BjCEm0s-.js";import{D as te,e as y,f as re,h as S,i as se,j as oe,s as ne}from"../packem_shared/formatBytes-BHAzNIrn-CrusHOew.js";import{r as ae}from"../packem_shared/typosquats-8u0drCqQ.js";import{p as E,t as C}from"../packem_shared/utils-DQFHJn72.js";import{y as ce}from"../packem_shared/isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as ie}from"../packem_shared/readJsonSync-CbryXYxN-EWl7_7KX.js";import{T as le}from"../packem_shared/target-merge-DVJl-7Qz.js";let L;const T=r=>(L??=A(import.meta.url))(r),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,F=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:M}=F("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"?O:s==="yellow"?I: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=M({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=q(o,c.root,"package.json");if(!ce(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=H(o,f),u=ke(e),k=e.exact??!1,h=await we(n,m);if(h.length===0)return 0;const $=ie(d);ve($,h,u,k),le(d,$,{indent:V(d,{useEditorconfig:s?.editorconfig??!0}),overwrite:!0});for(const g of h){const D=R(g.spec,k);p.info(`${P("+")} ${g.name}@${D} → ${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)},Me=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({logger:i,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{Me 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-CMSml1Bj.js";import{r as p,a as k}from"../packem_shared/command-runtime-p4IXiIf6.js";const w=async({argument:o,logger:a,options:t,visConfig:e,workspaceRoot:s})=>{const r=o?.[0]??null,c=s??process.cwd(),l=p({logger:a,options:t,visConfig:e},c),d=m(c,{backend:k(l),configBackend:e?.install?.backend,configCorepack:e?.install?.corepack}),n=i(d,r,c,a);n!==0&&(process.exitCode=n)};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-CMSml1Bj.js";import{r as f,a as h}from"../packem_shared/command-runtime-p4IXiIf6.js";const R=async({argument:r,logger:c,options:i,rawUnknown:l,visConfig:o,workspaceRoot:d})=>{const e=r;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,...s]=e,t=l??[],p=t[0]==="--"?s:[...s,...t],n=d??process.cwd(),u=f({logger:c,options:i,visConfig:o},n),k=w(n,{backend:h(u),configBackend:o?.install?.backend,configCorepack:o?.install?.corepack}),a=b(k,m,p,n,c);a!==0&&(process.exitCode=a)};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-CMSml1Bj.js";import{r as i,a as p}from"../packem_shared/command-runtime-p4IXiIf6.js";import{m as v,t as g}from"../packem_shared/utils-DQFHJn72.js";const R=async({argument:l,logger:s,options:e,rawUnknown:n,visConfig:a,workspaceRoot:c})=>{const o=v(l,n);if(o.length===0)throw new Error("No packages specified. Usage: vis remove <packages...>");const r=process.cwd(),m=i({logger:s,options:e,visConfig:a},c??r),k=d(c??r,{backend:p(m),configBackend:a?.install?.backend,configCorepack:a?.install?.corepack}),t=f(k,{filter:g(e.filter),global:e.global||!1,packages:o,recursive:e.recursive||!1,saveDev:e.saveDev||!1,workspaceRoot:e.workspaceRoot||!1},r,s);t!==0&&(process.exitCode=t)};export{R as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{readLastRunSummary as S,getLastRunSummaryPath as I}from"@visulima/task-runner";import{p as f,l as x,f as w}from"./cli-main.js";import{c as $,d as m}from"../packem_shared/formatBytes-BHAzNIrn-
|
|
1
|
+
import{readLastRunSummary as S,getLastRunSummaryPath as I}from"@visulima/task-runner";import{p as f,l as x,f as w}from"./cli-main.js";import{c as $,d as m}from"../packem_shared/formatBytes-BHAzNIrn-CrusHOew.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)})`,r=(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 i=t.map(n=>({duration:h(n.duration),hash:n.hash?n.hash.slice(0,12):"-",status:p(n),taskId:n.taskId})),a={duration:Math.max(8,...i.map(n=>n.duration.length)),hash:Math.max(4,...i.map(n=>n.hash.length)),status:Math.max(6,...i.map(n=>n.status.length)),taskId:Math.max(4,...i.map(n=>n.taskId.length))};e.info(` ${r("task",a.taskId)} ${r("status",a.status)} ${r("duration",a.duration)} ${r("hash",a.hash)}`),e.info(` ${"-".repeat(a.taskId)} ${"-".repeat(a.status)} ${"-".repeat(a.duration)} ${"-".repeat(a.hash)}`);for(const n of i)e.info(` ${r(n.taskId,a.taskId)} ${r(n.status,a.status)} ${r(n.duration,a.duration)} ${r(n.hash,a.hash)}`)},R=(t,e,i)=>{l(t,i),i.info(`Task ${e.taskId}`),i.info(` status: ${p(e)}`),i.info(` cache: ${e.cacheStatus}`),i.info(` duration: ${h(e.duration)}`),i.info(` exit: ${e.exitCode===void 0?"-":String(e.exitCode)}`),i.info(` hash: ${e.hash??"(none)"}`),i.info(` start: ${e.startTime??"-"}`),i.info(` end: ${e.endTime??"-"}`),e.dependencies.length>0&&i.info(` deps: ${e.dependencies.join(", ")}`),i.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,i)=>{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(n=>n.id.length)),mtime:24};i.info(` ${r("id",a.id)} ${r("mtime",a.mtime)}`),i.info(` ${"-".repeat(a.id)} ${"-".repeat(a.mtime)}`);for(const n of t)i.info(` ${r(n.id,a.id)} ${new Date(n.mtimeMs).toISOString()}`)},O=(t,e)=>{let{tasks:i}=t;return e.task!==void 0&&(i=i.filter(a=>a.taskId===e.task)),e.failed&&(i=i.filter(a=>v(a))),i},j=async(t,e)=>{const{failed:i,format:a,runId:n,task:o,workspaceRoot:d}=t,s=n===void 0?await S(d,{dataDirectory:$(d)}):await w(d,n);if(!s){if(a==="json"){process.stdout.write(`${JSON.stringify({error:"no-summary",runId:n??null},void 0,2)}
|
|
3
3
|
`),process.exitCode=1;return}n===void 0?f.error(`No previous run summary found. Run a task first to populate \`${I(d,{dataDirectory:$(d)})}\`.`):f.error(`Run summary "${n}" not found in ${m(d)}/.`),process.exitCode=1;return}const c=O(s,{failed:i,task:o});if(o!==void 0&&c.length===0){if(a==="json"){process.stdout.write(`${JSON.stringify({error:"task-not-in-summary",runId:s.id,taskId:o},void 0,2)}
|
|
4
4
|
`),process.exitCode=1;return}f.error(`Task "${o}" was not part of run ${s.id}.`),process.exitCode=1;return}if(s.stats.failed>0&&(process.exitCode=1),a==="json"){process.stdout.write(`${JSON.stringify({duration:s.duration,endTime:s.endTime,environment:s.environment,runId:s.id,startTime:s.startTime,stats:s.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"./catalog.js";import{f as P}from"../packem_shared/project-name-filter-
|
|
1
|
+
import{createTaskGraph as $}from"@visulima/task-runner";import{d as b,b as O}from"./catalog.js";import{f as P}from"../packem_shared/project-name-filter--bq-FL2f.js";import{r as S,f as E,a as G}from"../packem_shared/selectors-edwcgNl3.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
|
|
2
|
-
`,
|
|
1
|
+
import{U as B,m as E}from"../packem_shared/index-BzhrR_iC.js";import{d as $,b as v}from"./catalog.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-1M3wnsTr.js";import{h as F}from"../packem_shared/writeFileSync-DJoHk3Ks-BPRoepNw.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
|
+
`,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 C}from"node:module";import"../packem_shared/index-
|
|
1
|
+
import{createRequire as C}from"node:module";import"../packem_shared/index-BzhrR_iC.js";import{C as A,d as I}from"./catalog.js";import{p as c,j 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-D6PMPor-.js";import{r as q,l as z}from"../packem_shared/target-options-DsHFmRZH.js";let T;const j=s=>(T??=C(import.meta.url))(s),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=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 j(s)},{open:E,stat:$,watch:F}=_("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-BzhrR_iC.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-sXNQYpsl.js";import{v as R,e as y}from"../packem_shared/index-
|
|
1
|
+
import{F as v}from"../packem_shared/index.server-sXNQYpsl.js";import{v as R,e as y}from"../packem_shared/index-BzhrR_iC.js";import{d as j}from"./catalog.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-sXNQYpsl.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-sXNQYpsl.js";import{e as V}from"../packem_shared/index-BzhrR_iC.js";import{enforceProjectConstraints as v}from"@visulima/task-runner";import{d as x,b as J}from"./catalog.js";import{k as w}from"./cli-main.js";import{c as z}from"../packem_shared/runtime-check-1U8HrQd9.js";import{d as D}from"../packem_shared/formatBytes-BHAzNIrn-CrusHOew.js";import{y as G}from"../packem_shared/isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as H}from"../packem_shared/readJsonSync-CbryXYxN-EWl7_7KX.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,d=new Set(Object.values(f.projects).flatMap($=>Object.keys($.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:d},null,2));return}t.info(""),t.info(` ${T("VIS STATUS")}`),t.info(""),t.info(` ${e(!0)} ${String(k)} projects · ${String(d)} 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,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as P}from"node:module";import{F as d,J as k,X as W,b as A}from"../packem_shared/index.server-sXNQYpsl.js";import{e as S}from"../packem_shared/index-
|
|
1
|
+
import{createRequire as P}from"node:module";import{F as d,J as k,X as W,b as A}from"../packem_shared/index.server-sXNQYpsl.js";import{e as S}from"../packem_shared/index-BzhrR_iC.js";import{p as t}from"./cli-main.js";import{p as R,g as C,S as x,w,b as B,a as O,f as j,c as M,d as q,u as b,e as H,h as K}from"../packem_shared/toolchain-BRdpaAC4.js";let I;const F=e=>(I??=P(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","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],L=e=>y.includes(e),v=e=>e?k("✓"):W("✗"),_=A("⚠"),D=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.name} — referenced by ${e.configFiles.join(", ")} but not installed`},J=e=>{if(e.matches)return"";const{manager:n}=e;return n.name==="none"?d("→ (no manager)"):n.name==="self-activate"?"":n.installed?d(`→ ${n.name}`):d(`→ ${n.name} (missing)`)},z=e=>e.matches?v(!0):e.actual?_:v(!1),G=e=>{if(t.info(""),t.info(d("── Toolchain ───────────────────────")),e.detected.length===0)t.info(` ${v(!1)} No version manager detected`),t.notice(` Install one of: ${x.join(", ")}`);else for(const n of e.detected)t.info(` ${D(n)}`);if(t.info(""),e.tools.length===0){t.info(` ${d("No tool pins found — add engines.node, .nvmrc, or a manager config file.")}`);return}t.info(d("── Tools ───────────────────────────"));for(const n of e.tools){const i=`${n.expected.tool} ${n.expected.version}`,r=n.actual?`actual ${n.actual}`:"not installed",c=n.matches?"":d(` [${n.expected.source}]`),o=J(n),g=o===""?"":` ${o}`;t.info(` ${z(n)} ${i} — ${r}${c}${g}`),n.manager.note&&t.notice(` ${n.manager.note}`)}},X=(e,n,i)=>{const r=C(e,n);if(i.json){process.stdout.write(`${JSON.stringify({detected:r.detected.map(o=>({binPath:o.binPath??null,configFiles:o.configFiles,installed:o.installed,name:o.name,version:o.version??null})),tools:r.tools.map(o=>({actual:o.actual??null,expected:o.expected.version,manager:o.manager.name,managerInstalled:o.manager.installed,matches:o.matches,note:o.manager.note??null,source:o.expected.source,tool:o.expected.tool}))},void 0,2)}
|
|
2
2
|
`);return}G(r);const c=r.tools.filter(o=>!o.matches);c.length>0&&(t.info(""),t.notice(" Run `vis toolchain install` to install pinned versions.")),i.exitCode&&c.length>0&&(process.exitCode=1)},Q=e=>{const n=new Map;for(const i of e){const r=n.get(i.manager.name);r?r.push(i):n.set(i.manager.name,[i])}return n},E=(e,n,i)=>U(e,n,{cwd:i,stdio:"inherit"}).status??1,V=(e,n,i)=>{const r=C(e,n),c=r.tools.filter(f=>!f.matches);if(c.length===0){t.success("Everything already matches — nothing to install.");return}const o=c.some(f=>f.manager.name!=="self-activate"&&f.manager.name!=="none");if(r.detected.length===0&&o){t.error(`No version manager detected. Install one of: ${x.join(", ")}.`),process.exitCode=1;return}const g=Q(c);let l=!1,a=0;for(const[f,u]of g){if(f==="self-activate"){for(const{expected:s}of u){if(s.source==="packageManager")t.info(`${d("$")} (${s.tool} will self-activate from packageManager on next invocation)`);else if(t.info(`${d("$")} Writing packageManager=${s.tool}@${s.version}`),i.dryRun)l=!0;else try{w(e,s),l=!0}catch(p){t.error(p.message),a=1}t.notice(` ${s.tool} ${s.version} — no install needed`)}continue}if(f==="none"){for(const{expected:s}of u)t.warn(`Cannot install ${s.tool} ${s.version} — no manager can handle it.`);a=1;continue}if(!r.detected.find(s=>s.name===f)?.installed){t.error(`${f} is referenced but not on PATH — install it first, then rerun \`vis toolchain install\`.`),a=1;continue}const T=u.map(s=>B(f,s.expected)).filter(Boolean);for(const s of T){if(!s)continue;if(s.bin==="nvm"&&s.args.length===0){t.error("nvm is a shell function — run `nvm install` in your shell, then rerun `vis toolchain install`."),s.hint&&t.notice(` ${s.hint}`),a=1;continue}if(t.info(`${d("$")} ${s.bin} ${s.args.join(" ")}`),s.hint&&t.notice(` ${s.hint}`),i.dryRun){l=!0;continue}const p=E(s.bin,s.args,e);if(l=!0,p!==0){a=p;break}}}if(a!==0){process.exitCode=a;return}l&&t.success("Toolchain installed.")},Y=async(e,n,i,r,c)=>{if(!r)throw new Error("Usage: vis toolchain use <tool>@<version> (e.g. vis toolchain use node@22.13.0)");const o=O(r);if(!o)throw new Error(`Could not parse "${r}". Expected "<tool>@<version>" where <tool> is one of ${y.join(", ")}.`);const g=j(n),l=M(o,g,i);if(l.name==="none"){t.error(`No manager can pin ${o.tool}. Install one of: ${x.join(", ")}.`),process.exitCode=1;return}if(!l.installed){t.error(`The best manager for ${o.tool} (${l.name}) is not on PATH. ${l.note??""}`),process.exitCode=1;return}const a=q(l.name,o);if(!a){t.error(`${l.name} cannot pin ${o.tool}. Use a different manager, or set \`toolchain.tools.${o.tool}\` in vis.config.ts.`),process.exitCode=1;return}if(l.name==="self-activate"){if(t.info(`${d("→")} Writing packageManager field to package.json...`),c.dryRun){t.notice(` Would set packageManager: "${o.tool}@${o.version}"`);return}try{const u=w(n,o);if(!u){t.error(`Refusing to pin non-package-manager tool ${o.tool} via the packageManager field.`),process.exitCode=1;return}if(t.success(`Set packageManager: "${u}" — ${o.tool} will activate this version on next invocation.`),c.engines!==!1){const m=b(n,o);m&&t.success(`Updated package.json engines.${o.tool} → ${m}.`)}}catch(u){t.error(u.message),process.exitCode=1}return}if(a.args.length===0&&l.name==="nvm"&&o.tool==="node"){const u=S(n,".nvmrc");if(t.info(`${d("→")} Writing ${u}...`),c.dryRun){t.notice(` Would write ${o.version} to .nvmrc`);return}try{await e.writeFile(u,`${o.version}
|
|
3
3
|
`)}catch(m){t.error(`Failed to write .nvmrc: ${m.message}`),process.exitCode=1;return}t.success(`Wrote ${o.version} to .nvmrc.`),t.notice(" nvm is a shell function — run `nvm use` to activate it in this shell.");return}if(a.args.length===0){t.error(`${l.name} cannot pin ${o.tool} from a subprocess. ${a.configChange?.hint??""}`),a.configChange&&t.notice(` Edit ${a.configChange.file} by hand and rerun \`vis toolchain status\` to verify.`),process.exitCode=1;return}if(t.info(`${d("$")} ${a.bin} ${a.args.join(" ")}`),a.configChange&&t.notice(` Will update ${a.configChange.file} — ${a.configChange.hint}`),c.dryRun)return;const f=E(a.bin,a.args,n);if(f!==0){process.exitCode=f;return}if(t.success(`Pinned ${o.tool} to ${o.version}.`),c.engines!==!1)try{const u=b(n,o);u&&t.success(`Updated package.json engines.${o.tool} → ${u}.`)}catch(u){t.warn(`Could not update engines.${o.tool}: ${u.message}`)}},Z=(e,n,i)=>{if(!i)throw new Error("Usage: vis toolchain which <tool> (e.g. vis toolchain which node)");const r=i.toLowerCase();if(!L(r))throw new Error(`Unknown tool "${i}". Known: ${y.join(", ")}.`);const c=j(e),o=M({source:"vis.config.ts",tool:r,version:"*"},c,n),g=o.installed&&o.name!=="self-activate"&&o.name!=="none"?c.find(a=>a.name===o.name):void 0,l=g?H(g,r):K(r);if(!l){t.error(`${i} not found in PATH${g?` or via ${g.name}`:""}.`),process.exitCode=1;return}process.stdout.write(`${l}
|
|
4
4
|
`)},ee=(e,n)=>{const i=R(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-CMSml1Bj.js";import{r as i,a as u}from"../packem_shared/command-runtime-p4IXiIf6.js";import{m as f}from"../packem_shared/utils-DQFHJn72.js";const B=async({argument:o,logger:c,options:s,rawUnknown:n,visConfig:e,workspaceRoot:t})=>{const m=f(o,n),a=t??process.cwd(),l=i({logger:c,options:s,visConfig:e},a),d=k(a,{backend:u(l),configBackend:e?.install?.backend,configCorepack:e?.install?.corepack}),r=p(d,m,s.recursive||!1,a,c);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-DUcG-b7S.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 p,m as k}from"../packem_shared/pm-runner-
|
|
1
|
+
import{a as p,m as k}from"../packem_shared/pm-runner-CMSml1Bj.js";import{r as g,a as i}from"../packem_shared/command-runtime-p4IXiIf6.js";import{m as u,t as b}from"../packem_shared/utils-DQFHJn72.js";const y=async({argument:d,logger:l,options:e,process:t,rawUnknown:o,visConfig:a,workspaceRoot:n})=>{const c=u(d,o);if(c.length===0)throw new Error("No packages specified. Usage: vis why <package...>");const r=n??t.cwd,f=g({logger:l,options:e,visConfig:a},r),m=p(r,{backend:i(f),configBackend:a?.install?.backend,configCorepack:a?.install?.corepack}),s=k(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:c,parseable:e.parseable||!1,prod:e.prod||!1,recursive:e.recursive||!1},r,l);s!==0&&s!==1&&(process.exitCode=s)};export{y as default};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{d as
|
|
1
|
+
import{d as j,b as k}from"./catalog.js";import{V as n}from"../packem_shared/vis-user-error-Cpg2FqA4.js";import{s as P}from"../packem_shared/affected-selection-BzIbfpA1.js";import{f as y,a as b}from"../packem_shared/selectors-edwcgNl3.js";const x=(r,e)=>{if(r.length>0)return[...r];const a=e.indexOf("affected",2);return a===-1?[]:e.slice(a+1)},M=async({argument:r,options:e,process:a,rawArgv:u,runtime:g,visConfig:o,workspaceRoot:d})=>{if(!r[0])throw new n("Missing target. Usage: vis affected <target>");if(!d)throw new n("Could not determine workspace root. Run this command inside a monorepo.");if(e.sparseCheckout){const c=d,{fileOwners:p,packageJsons:l,workspace:t}=j(c,o),w=k(c,t,l),h=await P({base:e.base,downstream:e.downstream,head:e.head,uncommitted:e.uncommitted,upstream:e.upstream},{fileOwners:p,projectGraph:w,projects:t.projects,workspaceRoot:c},{affectedIgnore:o?.affectedIgnore,defaultBase:o?.defaultBase});let f=y(h.affectedProjects,t,e.query);f=b(f,t,e.tag);const m=[...new Set(f.map(i=>t.projects[i]?.root??i))].sort();process.stdout.write(m.length>0?`${m.join(`
|
|
2
2
|
`)}
|
|
3
|
-
`:"");return}const
|
|
3
|
+
`:"");return}const s=x(u??[],a?.argv??[]);if(s.length===0)throw new n("Missing target. Usage: vis affected <target>");await g.runCommand("run",{argv:s.includes("--affected")?s:[...s,"--affected"]})};export{M as default,x as forwardedArgv};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{v as u,U as w}from"../packem_shared/index-
|
|
1
|
+
import{v as u,U as w}from"../packem_shared/index-BzhrR_iC.js";import{r as v}from"../packem_shared/command-runtime-p4IXiIf6.js";import{r as x}from"../packem_shared/run-file-UBukWaha.js";const R=async({argument:t,logger:r,options:i,rawUnknown:c,visConfig:n,workspaceRoot:a})=>{const m=t??[],[o,...f]=m;if(o===void 0)throw new Error("No file specified. Usage: vis x <file> [args...]");const s=process.cwd(),p=u(o)?o:w(s,o),l=[...f,...c??[]],{runtime:d}=v({logger:r,options:i,visConfig:n},a??s),e=await x(p,l,d,s);e!==0&&(process.exitCode=e)};export{R as default};
|