@visulima/vis 6.1.0 → 6.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +43 -0
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +1226 -1216
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/cargo-lock.js +5 -0
- package/dist/packem_chunks/cargo-plan.js +3 -3
- package/dist/packem_chunks/catalog-detector.js +1 -1
- package/dist/packem_chunks/catalog.js +1 -94
- package/dist/packem_chunks/catalog2.js +11 -0
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +156 -174
- package/dist/packem_chunks/context.js +8 -0
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/handler10.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/handler19.js +5 -5
- package/dist/packem_chunks/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler31.js +1 -1
- package/dist/packem_chunks/handler32.js +1 -1
- package/dist/packem_chunks/handler33.js +1 -1
- package/dist/packem_chunks/handler34.js +3 -3
- package/dist/packem_chunks/handler35.js +1 -1
- package/dist/packem_chunks/handler36.js +1 -1
- package/dist/packem_chunks/handler38.js +2 -2
- package/dist/packem_chunks/handler39.js +5 -5
- package/dist/packem_chunks/handler4.js +4 -4
- package/dist/packem_chunks/handler40.js +1 -1
- package/dist/packem_chunks/handler41.js +1 -1
- package/dist/packem_chunks/handler42.js +1 -1
- package/dist/packem_chunks/handler43.js +1 -1
- package/dist/packem_chunks/handler44.js +1 -1
- package/dist/packem_chunks/handler45.js +1 -1
- package/dist/packem_chunks/handler46.js +1 -1
- package/dist/packem_chunks/handler47.js +1 -1
- package/dist/packem_chunks/handler48.js +1 -1
- package/dist/packem_chunks/handler49.js +1 -1
- package/dist/packem_chunks/handler5.js +4 -4
- package/dist/packem_chunks/handler50.js +5 -5
- package/dist/packem_chunks/handler52.js +1 -1
- package/dist/packem_chunks/handler54.js +2 -2
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler56.js +3 -3
- package/dist/packem_chunks/handler57.js +4 -4
- package/dist/packem_chunks/handler58.js +4 -4
- package/dist/packem_chunks/handler59.js +2 -2
- package/dist/packem_chunks/handler6.js +7 -7
- package/dist/packem_chunks/handler60.js +1 -1
- package/dist/packem_chunks/handler61.js +2 -2
- package/dist/packem_chunks/handler62.js +1 -1
- package/dist/packem_chunks/handler63.js +3 -3
- package/dist/packem_chunks/handler64.js +3 -3
- package/dist/packem_chunks/handler65.js +2 -2
- package/dist/packem_chunks/handler66.js +2 -2
- package/dist/packem_chunks/handler67.js +5 -5
- package/dist/packem_chunks/handler68.js +12 -25
- package/dist/packem_chunks/handler69.js +25 -22
- package/dist/packem_chunks/handler70.js +22 -10
- package/dist/packem_chunks/handler71.js +10 -133
- package/dist/packem_chunks/handler72.js +133 -23
- package/dist/packem_chunks/handler73.js +23 -323
- package/dist/packem_chunks/handler74.js +274 -659
- package/dist/packem_chunks/handler75.js +708 -48
- package/dist/packem_chunks/handler76.js +48 -27
- package/dist/packem_chunks/handler77.js +27 -3
- package/dist/packem_chunks/handler78.js +3 -191
- package/dist/packem_chunks/handler79.js +191 -0
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/heal.js +2 -2
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/index2.js +3 -58
- package/dist/packem_chunks/index3.js +40 -3
- package/dist/packem_chunks/index6.js +135 -7
- package/dist/packem_chunks/index7.js +7 -135
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/list.js +2 -2
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/python-plan.js +3 -3
- package/dist/packem_chunks/python-projects.js +1 -1
- package/dist/packem_chunks/python.js +1 -0
- package/dist/packem_chunks/run.js +1 -1
- package/dist/packem_chunks/snapshot.js +2 -2
- package/dist/packem_chunks/state.js +2 -2
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_chunks/version-resolver.js +1 -1
- package/dist/packem_chunks/workspace.js +2 -2
- package/dist/packem_shared/ReleaseClient-CWD9BC5w.js +1 -0
- package/dist/packem_shared/advisories-BodWQ5DQ.js +1 -0
- package/dist/packem_shared/{affected-selection-DGb6Xu5K.js → affected-selection-QaMUnFqe.js} +1 -1
- package/dist/packem_shared/{ai-analysis-pldoS_N4.js → ai-analysis-D7jlbJky.js} +3 -3
- package/dist/packem_shared/ai-cache-iSIyY3So.js +1 -0
- package/dist/packem_shared/{ai-fix-D9MxigBQ.js → ai-fix-CgCyO65Q.js} +6 -6
- package/dist/packem_shared/apply-DoeQAAGm.js +6 -0
- package/dist/packem_shared/apply-release-plan-BalHtK-g.js +15 -0
- package/dist/packem_shared/{bin-AZQv95jh.js → bin-LyW9KY0i.js} +1 -1
- package/dist/packem_shared/clean-package-json-rutwkKl-.js +1 -0
- package/dist/packem_shared/createAdapter-DMK4bBET.js +1 -0
- package/dist/packem_shared/createVersionActions-DXo4z8VN.js +1 -0
- package/dist/packem_shared/dependency-scan-DFnt1mni.js +1 -0
- package/dist/packem_shared/{ecosystem-gate-DiqQj0LJ.js → ecosystem-gate-Bdz-gK_Y.js} +1 -1
- package/dist/packem_shared/env-BSXG3QKH.js +4 -0
- package/dist/packem_shared/failure-log-DIsKBKaI.js +2 -0
- package/dist/packem_shared/formatBytes-_HvjOy8a-iHCer6uX.js +1 -0
- package/dist/packem_shared/glob-Cyk1H9ZL-DRlUeuow.js +1 -0
- package/dist/packem_shared/{index-JRb5wabN.js → index-B1ZsG3oa.js} +1 -1
- package/dist/packem_shared/index-CgNfNk12.js +1 -0
- package/dist/packem_shared/lifecycle-CQjeMPY0.js +2 -0
- package/dist/packem_shared/missing-package-json-dtwl6w-S.js +1 -0
- package/dist/packem_shared/multi-eco-lockfiles-CyIfYw4u.js +1 -0
- package/dist/packem_shared/npmrc-CHsOyMvA.js +2 -0
- package/dist/packem_shared/osv-C53WUoSW.js +1 -0
- package/dist/packem_shared/{package-version-KLwH0Ivy.js → package-version-DqYSd_ia.js} +1 -1
- package/dist/packem_shared/packument-CbTmbHU4.js +1 -0
- package/dist/packem_shared/{project-name-filter-B1ZCsbOW.js → project-name-filter-mwTJC1IK.js} +1 -1
- package/dist/packem_shared/{provenance-L1M2FPy_.js → provenance-SX1MxPUZ.js} +1 -1
- package/dist/packem_shared/publish-Dc0XGH3K.js +34 -0
- package/dist/packem_shared/registry-CkoaWkjP.js +81 -0
- package/dist/packem_shared/registry-keys-z038Ecb4.js +1 -0
- package/dist/packem_shared/removeSync-g1D5kONg-LbjATA8v.js +1 -0
- package/dist/packem_shared/renderToString-DR0zDUjh-C7p-L6AO.js +3 -0
- package/dist/packem_shared/{resolve-explicit-CQa37JSq.js → resolve-explicit-D9kdTNvl.js} +1 -1
- package/dist/packem_shared/{run-D-uVGHQ4.js → run-DLvd3RIZ.js} +1 -1
- package/dist/packem_shared/run-summary-utils-CMeURYtS.js +1 -0
- package/dist/packem_shared/s1ngularity-BuU9Cxpy.js +1 -0
- package/dist/packem_shared/{scaffold-files-DVyfB0yz.js → scaffold-files-Bje3_Ixv.js} +1 -1
- package/dist/packem_shared/scan-progress-D8ojNcKt.js +2 -0
- package/dist/packem_shared/{signatures-DIqFUOfs.js → signatures-CeL0bOEo.js} +1 -1
- package/dist/packem_shared/spinner-Bqjpz3i4.js +1 -0
- package/dist/packem_shared/table-DDAJalPF.js +1 -0
- package/dist/packem_shared/tabs-CC0GJLww.js +1 -0
- package/dist/packem_shared/{task-env-DzR4RkOj.js → task-env-C2lmxvzA.js} +1 -1
- package/dist/packem_shared/typosquats-BFKus_aM.js +1 -0
- package/dist/packem_shared/use-measured-height-_nYuZ-Au.js +1 -0
- package/dist/packem_shared/vis-update-app-Ba5ce8Jd.js +1 -0
- package/dist/packem_shared/{vis-user-error-CRmrBaD1.js → vis-user-error-D_ekz9rF.js} +1 -1
- package/dist/packem_shared/{watch-loop-D1_e-qIl.js → watch-loop-DWr41vHM.js} +1 -1
- package/dist/packem_shared/xxh3-BLHlvhgT.js +1 -0
- package/dist/release/core/package-managers/index.js +1 -1
- package/dist/release/core/version-actions/index.js +1 -1
- package/dist/release/index.js +1 -1
- package/index.js +26 -26
- package/package.json +9 -9
- package/dist/packem_chunks/orchestrator.js +0 -46
- package/dist/packem_shared/ReleaseClient-DAvbxCdo.js +0 -1
- package/dist/packem_shared/createAdapter-F7GidOzU.js +0 -1
- package/dist/packem_shared/createVersionActions-ByaJ1Nbv.js +0 -1
- package/dist/packem_shared/dependency-scan-CawAKoU_.js +0 -1
- package/dist/packem_shared/failure-log-BP-gCUb5.js +0 -2
- package/dist/packem_shared/formatBytes-_HvjOy8a-B_qQr4Hw.js +0 -4
- package/dist/packem_shared/glob-Cyk1H9ZL-Dxlf9Swz.js +0 -1
- package/dist/packem_shared/index-CDHP1kby.js +0 -1
- package/dist/packem_shared/lifecycle-DvmDIRbb.js +0 -2
- package/dist/packem_shared/missing-package-json-Cu5YVAot.js +0 -1
- package/dist/packem_shared/multi-eco-lockfiles-B2X3yhyo.js +0 -1
- package/dist/packem_shared/packument-zb18Jnlw.js +0 -1
- package/dist/packem_shared/registry-keys-DxdqMzyp.js +0 -1
- package/dist/packem_shared/s1ngularity-CO5GkkqX.js +0 -1
- package/dist/packem_shared/scan-progress-RwCRxJdX.js +0 -2
- package/dist/packem_shared/spinner-BJjbNl1F.js +0 -1
- package/dist/packem_shared/tabs--uxJGL8N.js +0 -1
- package/dist/packem_shared/typosquats-D4DEHhFy.js +0 -1
- package/dist/packem_shared/use-measured-height-DUZyyias.js +0 -1
- package/dist/packem_shared/vis-update-app-9b2kSk9f.js +0 -1
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{F as f}from"../packem_shared/index.server-Ca_EEVfw.js";import{p as i}from"./cli-main.js";import{s as d}from"../packem_shared/scan-progress-
|
|
1
|
+
import{F as f}from"../packem_shared/index.server-Ca_EEVfw.js";import{p as i}from"./cli-main.js";import{s as d}from"../packem_shared/scan-progress-D8ojNcKt.js";import{D as p,s as D}from"../packem_shared/osv-bloom-BCAX5ARR.js";const h=o=>o?.security?.audit?.advisories?.bloom??{},u=o=>o>=1e3?`${(o/1e3).toFixed(1)}s`:`${Math.round(o)}ms`,$=o=>o<1024?`${o} B`:o<1024*1024?`${(o/1024).toFixed(1)} KB`:`${(o/(1024*1024)).toFixed(1)} MB`,b=async({options:o,visConfig:m,workspaceRoot:n})=>{if(!n)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const a=o.format==="json",c=h(m),l=o.source??c.source??p,r=d([{id:"bloom",label:"Sync osv-bloom prefilter"}],{live:!a});let e,t;try{r.start("bloom");const s=Date.now();e=await D({allowedHosts:c.allowedHosts,cacheDir:o.cacheDir,force:!!o.force,source:l,workspaceRoot:n}),e.upToDate?r.finish("bloom","ok",`up to date · ${u(Date.now()-s)}`):r.finish("bloom","ok",`${e.manifest.entryCount.toLocaleString()} entries · ${$(e.bytesOnDisk)} · ${u(e.durationMs)}`)}catch(s){t=s instanceof Error?s.message:String(s),r.finish("bloom","error",t)}finally{r.stop()}a?process.stdout.write(`${JSON.stringify({bytesOnDisk:e?.bytesOnDisk??0,cacheDir:e?.cacheDir??null,durationMs:e?.durationMs??0,error:t??null,manifest:e?.manifest??null,source:l,upToDate:e?.upToDate??!1},void 0,2)}
|
|
2
2
|
`):e&&(i.info(f(`Cache: ${e.cacheDir}`)),i.info(f(`Built: ${e.manifest.builtAtRfc3339}`)),t||i.success(e.upToDate?"osv-bloom prefilter up to date.":"osv-bloom prefilter synced.")),t&&(process.exitCode=1)},g=b;export{g as advisoriesBloomSyncExecute};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import{createRequire as P}from"node:module";import{VisReleaseError as _}from"../packem_shared/VisReleaseError-DZtgcKf8.js";let T;const M=t=>(T??=P(import.meta.url))(t),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=t=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[n,r]=h.versions.node.split(".").map(Number);if(n>22||n===22&&r>=3||n===20&&r>=16)return h.getBuiltinModule(t)}return M(t)},{realpathSync:D}=b("node:fs"),{readFile:y}=b("node:fs/promises"),{isAbsolute:m,join:$,dirname:N,resolve:G,relative:B}=b("node:path"),O={"Cargo.toml":"cargo","tauri.conf.json":"tauri"},S=Object.keys(O),J=t=>t.replaceAll("\\","/").split("/").pop()??t,g=t=>O[J(t)],W=new Set(["package","workspace.package"]),q=/^\s*\[\[?\s*([^\]]+?)\s*\]\]?\s*(?:#.*)?$/,K=/^(\s*version\s*=\s*)(["'])[^"']*\2/,j=(t,n,r=W)=>{const e=t.split(`
|
|
2
|
+
`);let s="",o=!1;for(let i=0;i<e.length;i++){const l=e[i],a=q.exec(l);if(a){s=a[1].replaceAll(/\s+/g,"");continue}if(!r.has(s))continue;const c=K.exec(l);c&&(o=!0,e[i]=`${c[1]}${c[2]}${n}${c[2]}${l.slice(c[0].length)}`)}return o?{content:e.join(`
|
|
3
|
+
`),found:o}:{found:o}},A=(t,n)=>{const r=[];let e,s=0;for(;s<t.length;){const o=t[s];if(o==="{"||o==="["){r.push({isObject:o==="{",key:e}),e=void 0,s++;continue}if(o==="}"||o==="]"){r.pop(),e=void 0,s++;continue}if(o===","){e=void 0,s++;continue}if(o!=='"'){s++;continue}const i=s;for(s++;s<t.length&&t[s]!=='"';)s+=t[s]==="\\"?2:1;s++;const l=t.slice(i,s);let a=s;for(;a<t.length&&/\s/.test(t[a]);)a++;if(t[a]===":"){e=JSON.parse(l),s=a+1;continue}const c=r[r.length-1];if(e!==void 0&&c?.isObject){const f=[...r.slice(1).map(u=>u.key??""),e];if(f.length===n.length&&f.every((u,d)=>u===n[d]))return{end:s,start:i,value:JSON.parse(l)}}}},F=t=>{if(typeof t!="object"||t===null)return;const n=t;if(typeof n.version=="string")return["version"];if(typeof n.package?.version=="string")return["package","version"]},I=(t,n)=>{let r;try{r=JSON.parse(t)}catch{return{delegated:!1,found:!1}}const e=F(r);if(!e)return{delegated:!1,found:!1};const s=A(t,e);return s?s.value.startsWith(".")||s.value.startsWith("/")?{delegated:!0,found:!0}:{content:`${t.slice(0,s.start)}${JSON.stringify(n)}${t.slice(s.end)}`,delegated:!1,found:!0}:{delegated:!1,found:!1}},V=async(t,n)=>{const r=g(t);if(r==="cargo"){const{parse:e}=await import("./index4.js"),s=e(n),o=s.package?.version,i=typeof o=="string"?o:s.workspace?.package?.version;return typeof i=="string"?{version:i}:void 0}if(r==="tauri"){let e;try{e=JSON.parse(n)}catch{return}const s=F(e);if(!s)return;const o=A(n,s);return o?o.value.startsWith(".")||o.value.startsWith("/")?{delegated:!0}:{version:o.value}:void 0}},E=(t,n)=>{for(const r of n)if(!g(r))throw new _({code:"CONFIG_INVALID",hint:`Supported basenames: ${S.join(", ")}. Use extraFiles for other manifests.`,message:`versionFiles entry "${r}" for ${t} is not a supported version manifest.`})},H=async(t,n,r,e,s=new Map)=>{E(e,n);const o=[];for(const i of n){const l=g(i),a=m(i)?i:$(t,i);let c=s.get(a);if(c===void 0)try{c=await y(a,"utf8")}catch(u){const d=u.code==="ENOENT"?"does not exist":`could not be read (${u.message})`;throw new _({code:"CONFIG_INVALID",file:a,message:`versionFiles: ${e} → ${a} ${d}.`})}const f=l==="cargo"?j(c,r):I(c,r);if(!f.found)throw new _({code:"CONFIG_INVALID",file:a,message:`versionFiles: ${e} → no version field found in ${a}.`});f.content!==void 0&&f.content!==c&&o.push({content:f.content,path:a})}return{writes:o}},U=async t=>{const{entry:n,packageDir:r,packageName:e,packageVersion:s}=t,o=`version-files/${e}/${n}`,i=m(n)?n:$(r,n);if(!g(n))return{message:`${e}: versionFiles entry "${n}" is not a supported manifest. Supported basenames: ${S.join(", ")}.`,name:o,severity:"warn",status:"fail"};let l;try{l=await y(i,"utf8")}catch{return{message:`${e}: versionFiles entry "${n}" doesn't exist (expected ${i}).`,name:o,severity:"warn",status:"fail"}}let a;try{a=await V(n,l)}catch(c){return{message:`${e}: could not parse ${i}: ${c.message}`,name:o,severity:"warn",status:"fail"}}return a?.delegated?{message:`${n} of ${e} delegates its version to another file.`,name:o,severity:"info",status:"pass"}:a?.version===void 0?{message:`${e}: no version field found in ${i}.`,name:o,severity:"warn",status:"fail"}:a.version===s?{message:`${n} of ${e} matches package.json (${s}).`,name:o,severity:"info",status:"pass"}:{message:`${e}: ${n} declares ${a.version} but package.json declares ${s}. Set the two to the same version by hand; the next release only rewrites them when it bumps the package.`,name:o,severity:"warn",status:"fail"}},ee=Object.defineProperty({__proto__:null,SUPPORTED_VERSION_FILES:S,applyVersionFilesForRelease:H,assertSupportedVersionFiles:E,checkVersionFile:U,readManifestVersion:V,resolveVersionFileKind:g,rewriteCargoVersion:j,rewriteTauriVersion:I},Symbol.toStringTag,{value:"Module"}),Y="[[package]]",C=(t,n,r)=>{const e=t.split(`
|
|
4
|
+
`);let s=!1,o=-1;const i=[];for(const[l,a]of e.entries())a.trim()===Y&&(o!==-1&&i.push({end:l,start:o}),o=l);o!==-1&&i.push({end:e.length,start:o});for(const{end:l,start:a}of i){let c,f=-1,u=!1;for(let d=a+1;d<l;d++){const p=e[d],v=/^name\s*=\s*"([^"]+)"\s*$/.exec(p),k=/^version\s*=\s*"[^"]*"\s*$/.exec(p);v&&c===void 0?[,c]=v:k&&f===-1?f=d:/^source\s*=/.test(p)&&(u=!0)}c!==n||u||f===-1||(e[f]=`version = "${r}"${e[f].endsWith("\r")?"\r":""}`,s=!0)}return s?{content:e.join(`
|
|
5
|
+
`),found:s}:{found:s}},w=t=>{const n=G(t);try{return D.native(n)}catch{return n}},R=async(t,n)=>L(t,n,"Cargo.lock"),L=async(t,n,r)=>{const e=w(n);let s=w(t);for(;;){const o=$(s,r);try{return await y(o,"utf8"),o}catch{}if(s===e)return;const i=N(s),l=B(e,i);if(i===s||l.startsWith("..")||m(l))return;s=i}},x=async(t,n)=>{const{parse:r}=await import("./index4.js");try{const e=r(t);return typeof e.package?.name=="string"?e.package.name:void 0}catch(e){throw new _({cause:e,code:"CONFIG_INVALID",file:n,message:`Failed to parse ${n}: ${e.message}`})}},z=(t,n)=>{const r=new Set;for(const e of n.versionFiles??[])g(e)==="cargo"&&r.add(m(e)?e:$(t,e));if(n.versionActions==="cargo"){const e=n.cargoTomlPath??"Cargo.toml";r.add(m(e)?e:$(t,e))}return[...r]},Q=async t=>{const{entries:n,pending:r,workspaceRoot:e}=t,s=[],o=[];for(const{manifestPath:i,newVersion:l}of n){let a=r.get(i);if(a===void 0)try{a=await y(i,"utf8")}catch{continue}const c=await x(a,i);if(c===void 0)continue;const f=await R(N(i),e);if(f===void 0)continue;let u=r.get(f);u===void 0&&(u=await y(f,"utf8"));const d=C(u,c,l);if(!d.found){s.push(`cargo-lock: ${c} has no workspace-member entry in ${f}; run \`cargo generate-lockfile\` or build once to add it.`);continue}if(d.content!==void 0&&d.content!==u){r.set(f,d.content);const p=o.findIndex(k=>k.path===f),v={content:d.content,path:f};p===-1?o.push(v):o[p]=v}}return{warnings:s,writes:o}},te=Object.defineProperty({__proto__:null,canonicalPath:w,cargoManifestPaths:z,findCargoLock:R,findLockfile:L,readCrateName:x,rewriteCargoLockVersion:C,syncCargoLocks:Q},Symbol.toStringTag,{value:"Module"});export{z as a,te as b,w as c,L as f,j as r,Q as s,ee as v};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as S}from"node:module";import{s as P}from"../packem_shared/index-B4AjSxHU.js";import{VisReleaseError as R}from"../packem_shared/VisReleaseError-DZtgcKf8.js";import{
|
|
2
|
-
`),i=[];let d=!1,r={kind:"none"};const u=(l,f,v,p)=>{if(f===void 0)return;if(f.includes(",")){i.push(`cargo-deps: ${p} has a compound requirement "${f}" in ${n}; left unchanged.`);return}const e=W(f,v);e!==void 0&&(o[l]=o[l].replace(C,(t,
|
|
3
|
-
`),warnings:i}:{warnings:i}},
|
|
1
|
+
import{createRequire as S}from"node:module";import{s as P}from"../packem_shared/index-B4AjSxHU.js";import{VisReleaseError as R}from"../packem_shared/VisReleaseError-DZtgcKf8.js";import{p as b,i as j}from"./index3.js";import{r as L,s as F,c as x}from"./cargo-lock.js";let O;const q=c=>(O??=S(import.meta.url))(c),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,M=c=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[n,s]=_.versions.node.split(".").map(Number);if(n>22||n===22&&s>=3||n===20&&s>=16)return _.getBuiltinModule(c)}return q(c)},{readFile:B}=M("node:fs/promises"),{dirname:$,join:D,resolve:E}=M("node:path"),G=new Set(["package"]),K=new Set(["workspace.package"]),y=new Set(["build-dependencies","dependencies","dev-dependencies"]),V=async(c,n)=>c.get(n)??B(n,"utf8"),I=async(c,n,s)=>{const o=x(n);let i=x(c);for(;;){const d=D(i,"Cargo.toml"),r=await V(s,d).catch(()=>{});if(r!==void 0&&typeof(await b(r,d)).workspace?.package?.version=="string")return d;if(i===o)return;const u=$(i);if(u===i)return;i=u}},W=(c,n)=>{const s=/^([\^~=])?\s*(.+)$/.exec(c.trim());if(!s)return;const o=s[1]??"",i=s[2];if(i.includes("*"))return;const d=o===""?`^${i}`:`${o}${i}`;if(P.validRange(d)&&!P.satisfies(n,d))return`${o}${n}`},T=c=>{const n=c.split(".").map(d=>d.trim()),s=n[n.length-1]??"",o=n[0]==="target"||n[0]==="workspace"||n.length===1||y.has(n[0]??"");if(y.has(s)&&o)return{kind:"table"};const i=n[n.length-2]??"";return y.has(i)&&(n[0]==="target"||n[0]==="workspace"||n.length===2)?{key:s,kind:"dep"}:{kind:"none"}},C=/(version\s*=\s*)(["'])([^"']*)\2/,H=(c,n,s)=>{const o=c.split(`
|
|
2
|
+
`),i=[];let d=!1,r={kind:"none"};const u=(l,f,v,p)=>{if(f===void 0)return;if(f.includes(",")){i.push(`cargo-deps: ${p} has a compound requirement "${f}" in ${n}; left unchanged.`);return}const e=W(f,v);e!==void 0&&(o[l]=o[l].replace(C,(t,a,h)=>`${a}${h}${e}${h}`),d=!0)},w=()=>{if(r.kind!=="dep"||r.path===void 0||r.versionLine===void 0||r.version===void 0)return;const l=s.get(E(n,r.path));l!==void 0&&u(r.versionLine,r.version,l,r.key)};for(const[l,f]of o.entries()){const v=/^\s*\[\[?\s*([^\]]+?)\s*\]\]?\s*(?:#.*)?$/.exec(f);if(v){w(),r=T(v[1].replaceAll(/\s+/g,""));continue}if(r.kind==="table"){const p=/^\s*([^=\s]+)\s*=\s*\{(.*)\}\s*$/.exec(f);if(!p)continue;const e=/path\s*=\s*"([^"]*)"/.exec(p[2])?.[1],t=C.exec(p[2])?.[3];if(e===void 0||t===void 0)continue;const a=s.get(E(n,e));a!==void 0&&u(l,t,a,p[1]);continue}if(r.kind==="dep"){const p=/^\s*path\s*=\s*"([^"]*)"/.exec(f)?.[1];if(p!==void 0){r.path=p;continue}const e=C.exec(f);e&&(r.versionLine=l,r.version=e.at(3))}}return w(),d?{content:o.join(`
|
|
3
|
+
`),warnings:i}:{warnings:i}},Y=async c=>{const{crateManifests:n,cwd:s,pending:o,releases:i,rewriteDependents:d=!0,scanManifests:r}=c,u=new Set,w=[],l=new Map,f=new Map;for(const e of i)for(const t of e.manifestPaths)l.set($(t),e.newVersion),f.set(t,e.newVersion);const v=new Map;for(const e of i){if(e.ecosystem!=="cargo")continue;const t=e.manifestPaths[0];if(t===void 0)continue;const a=await V(o,t),h=await b(a,t);if(!j(h.package?.version)){const g=L(a,e.newVersion,G);g.content!==void 0&&(o.set(t,g.content),u.add(t));continue}const m=await I($(t),s,o);if(m===void 0)throw new R({code:"CONFIG_INVALID",file:t,message:`${t} inherits its version, but no ancestor Cargo.toml declares [workspace.package].version.`});const k=v.get(m)??{members:[],version:e.newVersion};k.members.push(t),v.set(m,k)}for(const[e,t]of v){const a=[];for(const g of n){const A=await V(o,g).catch(()=>{});if(A===void 0)continue;const N=await b(A,g);j(N.package?.version)&&await I($(g),s,o)===e&&a.push(g)}const h=a.filter(g=>f.get(g)!==t.version);if(h.length>0)throw new R({code:"CONFIG_INVALID",file:e,message:`Crates inherit [workspace.package].version from ${e}, so they must release together at ${t.version}. Not released at that version: ${h.join(", ")}.`});const m=await V(o,e),k=L(m,t.version,K);k.content!==void 0&&(o.set(e,k.content),u.add(e))}for(const e of d?r:[]){const t=await V(o,e).catch(()=>{});if(t===void 0)continue;const a=H(t,$(e),l);w.push(...a.warnings),a.content!==void 0&&(o.set(e,a.content),u.add(e))}const p=i.flatMap(e=>e.manifestPaths.map(t=>({manifestPath:t,newVersion:e.newVersion})));if(p.length>0){const e=await F({entries:p,pending:o,workspaceRoot:s});w.push(...e.warnings);for(const t of e.writes)u.add(t.path)}return{touched:u,warnings:w}};export{W as nextRequirement,Y as planCargoWorkspace,H as rewriteCargoRequirements};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{
|
|
1
|
+
import{parseCatalogs as g}from"./catalog.js";const m=a=>{const n=g(a),t=new Map;Object.keys(n.default).length>0&&t.set("",{...n.default});for(const[s,e]of Object.entries(n.named))t.set(s,{...e});return t},d=["dependencies","devDependencies","peerDependencies","optionalDependencies"],k=a=>{const n=[];for(const t of d){const s=a.manifest[t];if(!(!s||typeof s!="object"))for(const[e,o]of Object.entries(s)){if(typeof o!="string"||!o.startsWith("catalog:"))continue;const c=o.slice(8);n.push({catalog:c,dep:e,kind:t,packageName:a.name})}}return n},N=(a,n)=>{const t=new Map;for(const s of n.keys())t.set(s,new Map);for(const s of a)for(const e of k(s)){if(!n.has(e.catalog))continue;let o=t.get(e.catalog);o||(o=new Map,t.set(e.catalog,o));const c=o.get(e.dep);c?c.push({kind:e.kind,packageName:e.packageName}):o.set(e.dep,[{kind:e.kind,packageName:e.packageName}])}return t},h=(a,n)=>{if(a.size===0&&n.size===0)return[];const t=[],s=new Set;for(const[e,o]of n){s.add(e);const c=a.get(e)??{},p=[...new Set([...Object.keys(c),...Object.keys(o)])].sort();for(const i of p){const f=c[i],l=o[i];f!==l&&t.push({catalog:e,dep:i,newVersion:l,oldVersion:f})}}for(const[e,o]of a){if(s.has(e))continue;const c=Object.keys(o).sort();for(const r of c)t.push({catalog:e,dep:r,newVersion:void 0,oldVersion:o[r]})}return t};export{h as detectCatalogChanges,k as extractCatalogRefs,N as findCatalogConsumers,m as parseCatalogs};
|