@visulima/vis 1.0.0-alpha.19 → 1.0.0-alpha.20

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.
Files changed (107) hide show
  1. package/CHANGELOG.md +164 -0
  2. package/LICENSE.md +187 -779
  3. package/README.md +1 -1
  4. package/dist/config/index.d.ts +535 -121
  5. package/dist/config/index.js +1 -1
  6. package/dist/packem_chunks/bin.js +380 -286
  7. package/dist/packem_chunks/config.js +15 -14
  8. package/dist/packem_chunks/doctor-probe.js +2 -2
  9. package/dist/packem_chunks/fix.js +9 -9
  10. package/dist/packem_chunks/handler.js +1 -1
  11. package/dist/packem_chunks/handler10.js +1 -2
  12. package/dist/packem_chunks/handler11.js +5 -1
  13. package/dist/packem_chunks/handler12.js +1 -5
  14. package/dist/packem_chunks/handler13.js +27 -1
  15. package/dist/packem_chunks/handler14.js +5 -20
  16. package/dist/packem_chunks/handler15.js +1 -1
  17. package/dist/packem_chunks/handler16.js +1 -1
  18. package/dist/packem_chunks/handler17.js +1 -1
  19. package/dist/packem_chunks/handler18.js +1 -1
  20. package/dist/packem_chunks/handler19.js +1 -5
  21. package/dist/packem_chunks/handler20.js +5 -2
  22. package/dist/packem_chunks/handler21.js +2 -18
  23. package/dist/packem_chunks/handler22.js +2 -1
  24. package/dist/packem_chunks/handler23.js +18 -1
  25. package/dist/packem_chunks/handler24.js +1 -5
  26. package/dist/packem_chunks/handler25.js +1 -1
  27. package/dist/packem_chunks/handler26.js +5 -3
  28. package/dist/packem_chunks/handler27.js +1 -1
  29. package/dist/packem_chunks/handler28.js +3 -1
  30. package/dist/packem_chunks/handler29.js +1 -7
  31. package/dist/packem_chunks/handler3.js +3 -3
  32. package/dist/packem_chunks/handler30.js +6 -22
  33. package/dist/packem_chunks/handler31.js +33 -3
  34. package/dist/packem_chunks/handler32.js +3 -1
  35. package/dist/packem_chunks/handler33.js +1 -2
  36. package/dist/packem_chunks/handler34.js +25 -24
  37. package/dist/packem_chunks/handler35.js +3 -3
  38. package/dist/packem_chunks/handler36.js +6 -21
  39. package/dist/packem_chunks/handler37.js +22 -428
  40. package/dist/packem_chunks/handler38.js +428 -6
  41. package/dist/packem_chunks/handler39.js +6 -5
  42. package/dist/packem_chunks/handler4.js +8 -2
  43. package/dist/packem_chunks/handler40.js +24 -10
  44. package/dist/packem_chunks/handler41.js +10 -24
  45. package/dist/packem_chunks/handler42.js +1 -1
  46. package/dist/packem_chunks/handler43.js +6 -6
  47. package/dist/packem_chunks/handler44.js +13 -13
  48. package/dist/packem_chunks/handler45.js +213 -3
  49. package/dist/packem_chunks/handler46.js +3 -27
  50. package/dist/packem_chunks/handler47.js +21 -161
  51. package/dist/packem_chunks/handler48.js +166 -33
  52. package/dist/packem_chunks/handler49.js +34 -0
  53. package/dist/packem_chunks/handler5.js +1 -8
  54. package/dist/packem_chunks/handler6.js +1 -1
  55. package/dist/packem_chunks/handler7.js +1 -1
  56. package/dist/packem_chunks/handler8.js +1 -1
  57. package/dist/packem_chunks/handler9.js +2 -1
  58. package/dist/packem_chunks/heal-accept.js +2 -2
  59. package/dist/packem_chunks/heal.js +1 -1
  60. package/dist/packem_chunks/help-command.js +16 -16
  61. package/dist/packem_chunks/index.js +6 -6
  62. package/dist/packem_chunks/keys-refresh.js +4 -0
  63. package/dist/packem_chunks/list.js +3 -0
  64. package/dist/packem_chunks/loader.js +1 -1
  65. package/dist/packem_chunks/prune.js +3 -0
  66. package/dist/packem_chunks/run.js +1 -0
  67. package/dist/packem_chunks/status.js +2 -0
  68. package/dist/packem_chunks/sync.js +2 -0
  69. package/dist/packem_chunks/sync2.js +2 -0
  70. package/dist/packem_chunks/tripwire.js +2 -0
  71. package/dist/packem_shared/advisories-DsynpacV.js +1 -0
  72. package/dist/packem_shared/{ai-analysis-C_GpXikx.js → ai-analysis-uYuTIIXi.js} +1 -1
  73. package/dist/packem_shared/{ai-cache-DrCLD4gc.js → ai-cache-DuwHYx2O.js} +1 -1
  74. package/dist/packem_shared/{ai-fix-CWOz12Om.js → ai-fix-DzrA-dVz.js} +4 -4
  75. package/dist/packem_shared/applyDefaults-BOVDw1jD.js +1 -0
  76. package/dist/packem_shared/build-scripts-DsWMSWDs.js +1 -0
  77. package/dist/packem_shared/{cache-directory-C_U1qsIw.js → cache-directory-DQak1Vjc.js} +1 -1
  78. package/dist/packem_shared/cyclonedx-CiHXuG8M.js +4 -0
  79. package/dist/packem_shared/dependency-scan-DC3nAFHS.js +1 -0
  80. package/dist/packem_shared/{docker-B4s1fjiN.js → docker-B-CIN_nj.js} +19 -19
  81. package/dist/packem_shared/{failure-log-CSC6KfcO.js → failure-log-C3LEMmkq.js} +1 -1
  82. package/dist/packem_shared/{flakiness-DUtrm-wS.js → flakiness-Dq6K4ymq.js} +1 -1
  83. package/dist/packem_shared/glob-MHJQjR39-CQ2GC0b_.js +1 -0
  84. package/dist/packem_shared/{lifecycle-CgK8pcfa.js → lifecycle-Dv3nAtoD.js} +2 -2
  85. package/dist/packem_shared/{lockfile-i-qvq_k8.js → lockfile-C5DYMHVq.js} +1 -1
  86. package/dist/packem_shared/manifests-B0fMp872.js +1 -0
  87. package/dist/packem_shared/min-release-age-BFozFonQ.js +34 -0
  88. package/dist/packem_shared/native-config-sync-Dvi1g2nQ.js +21 -0
  89. package/dist/packem_shared/registry-keys-CewRFW0e.js +1 -0
  90. package/dist/packem_shared/resolve-explicit-CC4Kifk5.js +5 -0
  91. package/dist/packem_shared/{run-summary-utils-CJv75pla.js → run-summary-utils-BaBGP3bo.js} +1 -1
  92. package/dist/packem_shared/{runtime-check-CBU6W8qG.js → runtime-check-BusAwPb2.js} +1 -1
  93. package/dist/packem_shared/scan-progress-CMynp3eA.js +2 -0
  94. package/dist/packem_shared/signatures-5ZdjJ2Pu.js +2 -0
  95. package/dist/packem_shared/{toolchain-B7dckBQ1.js → toolchain-Cc3cwyLP.js} +3 -3
  96. package/dist/packem_shared/typosquats-BCeR-sLf.js +1 -0
  97. package/dist/packem_shared/verify-07kUNTuP.js +1 -0
  98. package/dist/packem_shared/{vis-update-app-D0uL3eO5.js → vis-update-app-CFrlJ3mW.js} +1 -1
  99. package/index.d.ts +358 -0
  100. package/index.js +56 -53
  101. package/package.json +14 -13
  102. package/schemas/vis-config.schema.json +595 -100
  103. package/dist/packem_shared/applyDefaults-DLY94gWA.js +0 -1
  104. package/dist/packem_shared/dependency-scan-YdgNVvoz.js +0 -2
  105. package/dist/packem_shared/readTomlSync-1fKo0R52-DtxWULlF.js +0 -109
  106. package/dist/packem_shared/typosquats-B3A38-qx.js +0 -1
  107. package/dist/packem_shared/verify-WDStBFvK.js +0 -1
@@ -1,25 +1,26 @@
1
- var he=Object.defineProperty;var W=(e,t)=>he(e,"name",{value:t,configurable:!0});import{createRequire as ve}from"node:module";import{au as we,u as ye,F as j,e as G,av as be,g as Re,G as Ce,H as le,aw as Se,ax as ce,f as Ae,R as xe,J as Ee,V as Te,ay as Ue,B as je,az as Ne,s as Fe,d as qe,U as Me,aA as _e,aB as Be,aC as Oe,h as Pe,aD as We}from"./bin.js";import{M as X,a as ee}from"./config.js";import{d as ze}from"../packem_shared/readTomlSync-1fKo0R52-DtxWULlF.js";import{render as te,renderToString as V}from"@visulima/tui";import{Text as b}from"@visulima/tui/components/text";import $ from"react";import{H as Le,e as Ye,Z as ne}from"../packem_shared/ai-analysis-C_GpXikx.js";import{r as De,s as Ie}from"../packem_shared/typosquats-B3A38-qx.js";import{U as He,C as Ve,a as ae}from"../packem_shared/vis-update-app-D0uL3eO5.js";import{d as Ge}from"../packem_shared/utils-DrNg0XTR.js";const $e=ve(import.meta.url),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ke=W(e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[t,n]=_.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return _.getBuiltinModule(e)}return $e(e)},"__cjs_getBuiltinModule"),{execFileSync:ie}=ke("node:child_process");var Je=Object.defineProperty,x=W((e,t)=>Je(e,"name",{value:t,configurable:!0}),"s");const Ze=x(e=>{const t=[];for(const n of e.filters)t.push("--filter",n);return e.workspaceRoot&&t.push("--filter","."),t.push("update"),e.latest&&t.push("--latest"),e.recursive&&t.push("--recursive"),e.interactive&&t.push("--interactive"),e.dev&&t.push("--dev"),e.prod&&t.push("--prod"),e.noOptional&&t.push("--no-optional"),e.noSave&&t.push("--no-save"),t.push(...e.packages),{args:t,bin:"pnpm"}},"resolvePnpm"),Ke=x(e=>{const t=[];return e.filters.length>0&&t.push("workspace",e.filters[0]),t.push("upgrade"),e.latest&&t.push("--latest"),t.push(...e.packages),{args:t,bin:"yarn"}},"resolveYarnV1"),Qe=x(e=>{const t=[];if(e.filters.length>0||e.recursive){t.push("workspaces","foreach","--all");for(const n of e.filters)t.push("--include",n)}return t.push("up"),e.interactive&&t.push("--interactive"),t.push(...e.packages),{args:t,bin:"yarn"}},"resolveYarnBerry"),Xe=x((e,t)=>{const n=["update"];e.latest&&t.push("npm does not support --latest flag. Packages will be updated within their semver range."),e.interactive&&t.push("npm does not support --interactive mode.");for(const a of e.filters)n.push("--workspace",a);return e.recursive&&n.push("--workspaces"),e.workspaceRoot&&n.push("--include-workspace-root"),e.dev&&n.push("--dev"),e.prod&&n.push("--production"),e.noOptional&&n.push("--no-optional"),e.noSave&&n.push("--no-save"),n.push(...e.packages),{args:n,bin:"npm"}},"resolveNpm"),et=x(e=>{const t=["update"];e.latest&&t.push("--latest");for(const n of e.filters)t.push("--filter",n);return t.push(...e.packages),{args:t,bin:"bun"}},"resolveBun"),tt=x((e,t)=>{const n=["outdated","--update"];return e.latest&&n.push("--latest"),e.interactive&&n.push("--interactive"),e.filters.length>0&&t.push("deno outdated has no --filter flag; ignoring."),(e.dev||e.prod)&&t.push("deno outdated has no --dev / --prod flags; dev/prod is governed by deno.json."),e.noOptional&&t.push("deno outdated has no --no-optional flag; ignoring."),e.noSave&&t.push("deno outdated has no --no-save flag; ignoring."),n.push(...e.packages),{args:n,bin:"deno"}},"resolveDeno"),nt=x((e,t,n)=>{const a=[];if(n.global&&e!=="aube"&&e!=="deno")return{command:{args:["update","--global",...n.packages],bin:"npm"},warnings:a};let i;switch(e){case"aube":{const o=we(n);i={args:o.args,bin:o.bin},a.push(...o.warnings);break}case"bun":{i=et(n);break}case"deno":{i=tt(n,a);break}case"npm":{i=Xe(n,a);break}case"pnpm":{i=Ze(n);break}case"yarn":{i=t.startsWith("1.")?Ke(n):Qe(n);break}default:{const o=e;throw new Error(`Unsupported package manager: ${String(o)}`)}}return{command:i,warnings:a}},"resolveUpdateCommand");var at=Object.defineProperty,R=W((e,t)=>at(e,"name",{value:t,configurable:!0}),"C");const ot=R((e,t)=>{try{if(t==="pnpm"){const n=X(e,"pnpm-workspace.yaml");if(ee(n)){const a=ye(n);return{excludes:Array.isArray(a?.minimumReleaseAgeExclude)?a.minimumReleaseAgeExclude:void 0,minutes:typeof a?.minimumReleaseAge=="number"?a.minimumReleaseAge:void 0}}}else if(t==="bun"){const n=X(e,"bunfig.toml");if(ee(n)){const a=ze(n);return{excludes:Array.isArray(a?.install?.minimumReleaseAgeExcludes)?a.install.minimumReleaseAgeExcludes:void 0,minutes:typeof a?.install?.minimumReleaseAge=="number"?a.install.minimumReleaseAge:void 0}}}}catch{}return{}},"readPmNativeMinimumReleaseAge"),st=R((e,t,n)=>{const a=e.latest?"latest":e.target??t.target??"latest";if(!["latest","minor","patch"].includes(a))throw new Error(`Invalid target "${a}". Use: latest, minor, or patch.`);const i=e.maxConcurrentRequests,o=typeof i=="number"&&i>0?i:t.maxConcurrentRequests,r=typeof e.releaseChannel=="string"?e.releaseChannel.toLowerCase():void 0;if(r!==void 0&&!["any","same","stable"].includes(r))throw new Error(`Invalid --release-channel "${String(e.releaseChannel)}". Use: any, same, or stable.`);const g=r??t.releaseChannel;return{exclude:[...j(e.exclude),...j(t.exclude)],ignore:j(t.ignore),include:[...j(e.include),...j(t.include),...n],includeLocked:e.includeLocked||t.includeLocked||!1,includePrerelease:e.prerelease||t.prerelease||!1,maxConcurrentRequests:o,minimumReleaseAge:t.minimumReleaseAge,minimumReleaseAgeExclude:t.minimumReleaseAgeExclude,packageMode:t.packageMode,releaseChannel:g,security:e.security||e.ai||t.security||!1,target:a}},"buildCatalogCheckOptions"),oe=R((e,t)=>{if(e.length!==0){t.info(`
2
- ${G("⚠")} ${String(e.length)} package${e.length===1?"":"s"} skipped by target constraint (use --target latest to include):`);for(const n of e)t.info(` ${n.packageName} ${n.currentRange} → ${n.newRange} (${n.updateType})`)}},"logFilteredByTarget"),se=R((e,t,n,a)=>{n==="json"?process.stdout.write(`${be({checkedCount:0,failed:t,filteredByTarget:[],ignored:[],outdated:e})}
3
- `):n==="minimal"?process.stdout.write(`${Re(e)}
4
- `):(Ce(e,a),a.info(le(e)))},"writeFormattedOutput"),re=R(async(e,t,n,a,i,o,r)=>{const g=Se(e,n,t,!0,{useEditorconfig:r}),v=t==="pnpm"?"pnpm-workspace.yaml":"package.json";if(i.info(`
5
- Updated ${v}`),g&&i.info(`Backup saved to ${g}`),a.changelog){i.info(`
6
- Fetching changelogs...`);const u=await ce(n,void 0,o);for(const d of u){const m=d.releaseUrl??d.repoUrl??d.npmUrl;i.info(` ${d.packageName}: ${m}`)}}if(a.install??!0){const u=t,d=["install"];i.info(`Running ${u} ${d.join(" ")}...
7
- `);try{ie(u,d,{cwd:e,env:process.env,stdio:"inherit"})}catch{i.warn(`${u} ${d.join(" ")} failed. You may need to run it manually.`)}}},"applyCatalogAndInstall"),rt=R(async(e,t,n,a,i,o)=>{const r=n.update??{},g=[["global","--global is not supported in catalog mode"],["recursive","--recursive is not needed in catalog mode (catalogs are workspace-level)"],["filter","--filter is not supported in catalog mode (use --include/--exclude instead)"],["no-save","--no-save is not supported in catalog mode"],["workspace-root","--workspace-root is not needed in catalog mode"],["no-optional","--no-optional is not supported in catalog mode"]];for(const[s,c]of g)a[s]&&o.warn(`${G("⚠")} ${c}, ignoring.`);const{excludes:v,minutes:u}=ot(e,t),d=r.minimumReleaseAge??u,m=r.minimumReleaseAgeExclude??v;if(r.minimumReleaseAge!==void 0&&u!==void 0&&r.minimumReleaseAge!==u){const s=t==="pnpm"?"pnpm-workspace.yaml":"bunfig.toml";o.warn(`${G("⚠")} minimumReleaseAge mismatch: vis config = ${String(r.minimumReleaseAge)} min, ${s} = ${String(u)} min. Consider keeping them in sync.`)}const C=Ae(e),E=a["include-internal"],J=a.peer,N=xe(e,t,{depFields:r.depFields,dev:a.dev,includeInternal:E,peer:J,prod:a.prod});if(N.size===0){o.info("No catalogs found.");return}const ue={...r,minimumReleaseAge:d,minimumReleaseAgeExclude:m},T=st(a,ue,i);let z=0;for(const s of N.values())z+=s.size;const B=!!process.stdout.isTTY&&!Fe;let U;const de=B?(s,c)=>{U?U.rerender($.createElement(ae,{current:s,total:c})):(process.stdout.write(`
8
- `),U=te($.createElement(ae,{current:s,total:c}),{interactive:!0,patchConsole:!1}))}:(s,c)=>{o.info(`Checking ${String(s)}/${String(c)} dependencies...`)};B||o.info(`Checking ${String(z)} catalog dependencies...
9
- `);const pe=Ee(n.security?.socket),{checkedCount:k,failed:w,filteredByTarget:f,ignored:S,outdated:p}=await Te(N,T,C,de,e,pe,n.security?.socket?.acceptedRisks);U&&(U.clear(),U.unmount());const O=E?{ignored:[],outdated:[]}:Ue(e,{depFields:r.depFields,dev:a.dev,exclude:T.exclude,ignore:T.ignore,include:T.include,packageMode:T.packageMode,peer:J,prod:a.prod,target:T.target});if(O.outdated.length>0){const s=new Set(p.map(c=>`${c.catalogName}|${c.packageName}`));for(const c of O.outdated)s.has(`${c.catalogName}|${c.packageName}`)||p.push(c)}if(O.ignored.length>0)for(const s of O.ignored)S.includes(s)||S.push(s);const Z=k-p.length-w.length;if(w.length>0&&o.warn(`Failed to fetch: ${w.join(", ")}`),S.length>0&&o.info(`Skipped ${String(S.length)} ignored package${S.length===1?"":"s"}: ${S.join(", ")}`),!B&&k>p.length){const s=[...N.values()].reduce((M,Y)=>M+Y.size,0),c=s>k?` (${String(s)} catalog entries, ${String(s-k)} duplicates)`:"";o.info(`Checked ${String(k)} unique packages${c}: ${String(p.length)} outdated, ${String(Z)} up-to-date${w.length>0?`, ${String(w.length)} failed`:""}${f.length>0?`, ${String(f.length)} skipped by target`:""}`)}if(p.length===0){f.length>0?o.info(`All catalog dependencies are up to date within the current target.
10
- ${String(f.length)} package${f.length===1?" has":"s have"} newer versions available with --target latest:
11
- ${f.map(s=>` ${s.packageName} ${s.currentRange} → ${s.newRange} (${s.updateType})`).join(`
12
- `)}`):o.info("All catalog dependencies are up to date.");return}const F=a.format??r.format??"table";let y;if(a.ai){const s=Le(a.aiType??"impact");y=await Ye(p,o,n.ai,s)}const L=!!a.dryRun;if(B&&F==="table"){const s=new He(p,y??null);let c;if(a.changelog){o.info("Fetching changelogs...");const l=await ce(p,void 0,C);c=new Map;for(const h of l){const A=h.releaseUrl??h.repoUrl??h.npmUrl;A&&c.set(h.packageName,A)}}const M=n.tui?.autoExit??!1,Y=M===!0?3:typeof M=="number"?M:0,K=await te($.createElement(Ve,{autoExitSeconds:Y,changelogUrls:c,checkedCount:k,filteredOutEntries:f,isDryRun:L,store:s,totalCatalogEntries:z}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit(),D=process.stdout.columns||80;process.stdout.write(`
13
- `);for(const l of p){const h=l.vulnerabilities?.length||l.socketReport&&l.socketReport.alerts.length>0,A=!!l.acceptedRisk,H=h?A?"✓":"⚠":"✓",me=A?"gray":l.updateType==="major"?"red":l.updateType==="minor"?"yellow":"green",P=l.socketReport?.score.overall,fe=P===void 0?"":` [${String(Math.round(P*100))}%]`,Q=P===void 0?void 0:je(P);process.stdout.write(`${V($.createElement(b,null," ",$.createElement(b,{color:me},H),` ${l.packageName} ${l.currentRange} → ${l.newRange}`,$.createElement(b,{dimColor:!0},` ${l.updateType}`),Q?$.createElement(b,{color:Q},fe):null),{columns:D})}
1
+ var Re=Object.defineProperty;var I=(e,t)=>Re(e,"name",{value:t,configurable:!0});import{createRequire as Se}from"node:module";import{am as xe,u as ae,an as Ee,F as N,e as G,ao as Te,d as Ne,G as Me,H as ge,ap as Ue,aq as me,i as se,O as je,R as Fe,J as _e,V as qe,ar as Be,W as Le,as as Oe,s as fe,a as he,U as Pe,at as Ie,au as De,av as We,f as Ge,aw as He}from"./bin.js";import{M as D,i as W,$ as Ve}from"./config.js";import{render as oe,renderToString as X}from"@visulima/tui";import{Text as S}from"@visulima/tui/components/text";import $ from"react";import{H as Ye,e as ze,Z as re}from"../packem_shared/ai-analysis-uYuTIIXi.js";import{r as Ze,b as Je,p as Xe}from"../packem_shared/resolve-explicit-CC4Kifk5.js";import{r as Ke,s as Qe}from"../packem_shared/typosquats-BCeR-sLf.js";import{U as et,C as tt,a as ie}from"../packem_shared/vis-update-app-CFrlJ3mW.js";import{d as nt}from"../packem_shared/utils-DrNg0XTR.js";const Ae=Se(import.meta.url),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,de=I(e=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[t,n]=_.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return _.getBuiltinModule(e)}return Ae(e)},"__cjs_getBuiltinModule"),{execFileSync:pe}=de("node:child_process"),{createInterface:Ce}=de("node:readline");var at=Object.defineProperty,x=I((e,t)=>at(e,"name",{value:t,configurable:!0}),"s");const st=x(e=>{const t=[];for(const n of e.filters)t.push("--filter",n);return e.workspaceRoot&&t.push("--filter","."),t.push("update"),e.latest&&t.push("--latest"),e.recursive&&t.push("--recursive"),e.interactive&&t.push("--interactive"),e.dev&&t.push("--dev"),e.prod&&t.push("--prod"),e.noOptional&&t.push("--no-optional"),e.noSave&&t.push("--no-save"),t.push(...e.packages),{args:t,bin:"pnpm"}},"resolvePnpm"),ot=x(e=>{const t=[];return e.filters.length>0&&t.push("workspace",e.filters[0]),t.push("upgrade"),e.latest&&t.push("--latest"),t.push(...e.packages),{args:t,bin:"yarn"}},"resolveYarnV1"),rt=x(e=>{const t=[];if(e.filters.length>0||e.recursive){t.push("workspaces","foreach","--all");for(const n of e.filters)t.push("--include",n)}return t.push("up"),e.interactive&&t.push("--interactive"),t.push(...e.packages),{args:t,bin:"yarn"}},"resolveYarnBerry"),it=x((e,t)=>{const n=["update"];e.latest&&t.push("npm does not support --latest flag. Packages will be updated within their semver range."),e.interactive&&t.push("npm does not support --interactive mode.");for(const a of e.filters)n.push("--workspace",a);return e.recursive&&n.push("--workspaces"),e.workspaceRoot&&n.push("--include-workspace-root"),e.dev&&n.push("--dev"),e.prod&&n.push("--production"),e.noOptional&&n.push("--no-optional"),e.noSave&&n.push("--no-save"),n.push(...e.packages),{args:n,bin:"npm"}},"resolveNpm"),lt=x(e=>{const t=["update"];e.latest&&t.push("--latest");for(const n of e.filters)t.push("--filter",n);return t.push(...e.packages),{args:t,bin:"bun"}},"resolveBun"),ct=x((e,t)=>{const n=["outdated","--update"];return e.latest&&n.push("--latest"),e.interactive&&n.push("--interactive"),e.filters.length>0&&t.push("deno outdated has no --filter flag; ignoring."),(e.dev||e.prod)&&t.push("deno outdated has no --dev / --prod flags; dev/prod is governed by deno.json."),e.noOptional&&t.push("deno outdated has no --no-optional flag; ignoring."),e.noSave&&t.push("deno outdated has no --no-save flag; ignoring."),n.push(...e.packages),{args:n,bin:"deno"}},"resolveDeno"),ut=x((e,t,n)=>{const a=[];if(n.global&&e!=="aube"&&e!=="deno")return{command:{args:["update","--global",...n.packages],bin:"npm"},warnings:a};let o;switch(e){case"aube":{const s=xe(n);o={args:s.args,bin:s.bin},a.push(...s.warnings);break}case"bun":{o=lt(n);break}case"deno":{o=ct(n,a);break}case"npm":{o=it(n,a);break}case"pnpm":{o=st(n);break}case"yarn":{o=t.startsWith("1.")?ot(n):rt(n);break}default:{const s=e;throw new Error(`Unsupported package manager: ${String(s)}`)}}return{command:o,warnings:a}},"resolveUpdateCommand");var dt=Object.defineProperty,k=I((e,t)=>dt(e,"name",{value:t,configurable:!0}),"y");const ve=k(e=>{const t=e.trim();if(t==="")return;const n=/^(\d+(?:\.\d+)?)\s*([mhdw])?$/i.exec(t);if(!n)return;const a=Number.parseFloat(n[1]);if(!(!Number.isFinite(a)||a<0))switch((n[2]??"m").toLowerCase()){case"d":return a*60*24;case"h":return a*60;case"m":return a;case"w":return a*60*24*7;default:return}},"parseTimeStringToMinutes"),pt=k(e=>{const t=e.trim();return/^\d+(?:\.\d+)?$/.test(t)?Number.parseFloat(t)*1440:ve(t)},"parseNpmReleaseAgeValue"),Nt=k(e=>!Number.isFinite(e)||e<=0?"0m":e%1440===0?`${String(e/1440)}d`:e%60===0?`${String(e/60)}h`:`${String(e)}m`,"formatMinutesAsTimeString"),gt=k((e,t)=>{try{switch(t){case"bun":{const n=D(e,"bunfig.toml");if(W(n)){const a=Ee(n),o=a?.install?.minimumReleaseAge;return{excludes:Array.isArray(a?.install?.minimumReleaseAgeExcludes)?a.install.minimumReleaseAgeExcludes:void 0,minutes:typeof o=="number"?Math.round(o/60):void 0}}break}case"npm":{const n=D(e,".npmrc");if(W(n)){const a=Ve(n),o=/^\s*min-release-age\s*=\s*([^\s#;]+)/m.exec(a);return{minutes:o?pt(o[1]):void 0}}break}case"pnpm":{const n=D(e,"pnpm-workspace.yaml");if(W(n)){const a=ae(n);return{excludes:Array.isArray(a?.minimumReleaseAgeExclude)?a.minimumReleaseAgeExclude:void 0,minutes:typeof a?.minimumReleaseAge=="number"?a.minimumReleaseAge:void 0}}break}case"yarn":{const n=D(e,".yarnrc.yml");if(W(n)){const a=ae(n)?.npmMinimalAgeGate;if(typeof a=="string")return{minutes:ve(a)};if(typeof a=="number")return{minutes:a}}break}}}catch{}return{}},"readPmNativeMinimumReleaseAge"),mt=k((e,t,n)=>{const a=e.latest?"latest":e.target??t.target??"latest";if(!["latest","minor","patch"].includes(a))throw new Error(`Invalid target "${a}". Use: latest, minor, or patch.`);const o=e.maxConcurrentRequests,s=typeof o=="number"&&o>0?o:t.maxConcurrentRequests,r=typeof e.releaseChannel=="string"?e.releaseChannel.toLowerCase():void 0;if(r!==void 0&&!["any","same","stable"].includes(r))throw new Error(`Invalid --release-channel "${String(e.releaseChannel)}". Use: any, same, or stable.`);const m=r??t.releaseChannel;return{exclude:[...N(e.exclude),...N(t.exclude)],ignore:N(t.ignore),include:[...N(e.include),...N(t.include),...n],includeLocked:e.includeLocked||t.includeLocked||!1,includePrerelease:e.prerelease||t.prerelease||!1,maxConcurrentRequests:s,minimumReleaseAge:t.minimumReleaseAge,minimumReleaseAgeExclude:t.minimumReleaseAgeExclude,packageMode:t.packageMode,releaseChannel:m,security:e.security||e.ai||t.security||!1,target:a}},"buildCatalogCheckOptions"),le=k((e,t)=>{if(e.length!==0){t.info(`
2
+ ${G("⚠")} ${String(e.length)} package${e.length===1?"":"s"} skipped by target constraint (use --target latest to include):`);for(const n of e)t.info(` ${n.packageName} ${n.currentRange} → ${n.newRange} (${n.updateType})`)}},"logFilteredByTarget"),ce=k((e,t,n,a,o)=>{n==="json"?process.stdout.write(`${Te({checkedCount:0,failed:t,filteredByTarget:[],ignored:[],outdated:e})}
3
+ `):n==="minimal"?process.stdout.write(`${Ne(e)}
4
+ `):(Me(e,a),a.info(ge(e,o)))},"writeFormattedOutput"),ue=k(async(e,t,n,a,o,s,r)=>{const m=Ue(e,n,t,!0,{useEditorconfig:r}),u=t==="pnpm"?"pnpm-workspace.yaml":"package.json";if(o.info(`
5
+ Updated ${u}`),m&&o.info(`Backup saved to ${m}`),a.changelog){o.info(`
6
+ Fetching changelogs...`);const p=await me(n,void 0,s);for(const l of p){const f=l.releaseUrl??l.repoUrl??l.npmUrl;o.info(` ${l.packageName}: ${f}`)}}if(a.install??!0){const p=t,l=["install"];o.info(`Running ${p} ${l.join(" ")}...
7
+ `);try{pe(p,l,{cwd:e,env:process.env,stdio:"inherit"})}catch{o.warn(`${p} ${l.join(" ")} failed. You may need to run it manually.`)}}},"applyCatalogAndInstall"),ft=k(async(e,t,n,a,o,s)=>{const r=n.update??{},m=[["global","--global is not supported in catalog mode"],["recursive","--recursive is not needed in catalog mode (catalogs are workspace-level)"],["filter","--filter is not supported in catalog mode (use --include/--exclude instead)"],["no-save","--no-save is not supported in catalog mode"],["workspace-root","--workspace-root is not needed in catalog mode"],["no-optional","--no-optional is not supported in catalog mode"]];for(const[i,d]of m)a[i]&&s.warn(`${G("⚠")} ${d}, ignoring.`);const u=se("minReleaseAge"),{excludes:p,minutes:l}=u?{excludes:void 0,minutes:void 0}:gt(e,t),f=u?void 0:r.minimumReleaseAge??l,q=u?void 0:r.minimumReleaseAgeExclude??p;if(u&&(r.minimumReleaseAge!==void 0||l!==void 0)&&s.info("minimumReleaseAge gate disabled via MARSHALL_DISABLE_MIN_RELEASE_AGE."),!u&&r.minimumReleaseAge!==void 0&&l!==void 0&&r.minimumReleaseAge!==l){const i=t==="pnpm"?"pnpm-workspace.yaml":"bunfig.toml";s.warn(`${G("⚠")} minimumReleaseAge mismatch: vis config = ${String(r.minimumReleaseAge)} min, ${i} = ${String(l)} min. Consider keeping them in sync.`)}const b=je(e),K=a["include-internal"],Q=a.peer,M=Fe(e,t,{depFields:r.depFields,dev:a.dev,includeInternal:K,peer:Q,prod:a.prod});if(M.size===0){s.info("No catalogs found.");return}const ke={...r,minimumReleaseAge:f,minimumReleaseAgeExclude:q},E=mt(a,ke,o);let H=0;for(const i of M.values())H+=i.size;const B=!!process.stdout.isTTY&&!fe;let T;const $e=B?(i,d)=>{T?T.rerender($.createElement(ie,{current:i,total:d})):(process.stdout.write(`
8
+ `),T=oe($.createElement(ie,{current:i,total:d}),{interactive:!0,patchConsole:!1}))}:(i,d)=>{s.info(`Checking ${String(i)}/${String(d)} dependencies...`)};B||s.info(`Checking ${String(H)} catalog dependencies...
9
+ `);const L=se("socket")?void 0:_e(n.security?.socket,n.security?.policies?.score?.minimum),{checkedCount:w,failed:y,filteredByTarget:h,ignored:A,outdated:g}=await qe(M,E,b,$e,e,L,n.security?.acceptedRisks);T&&(T.clear(),T.unmount());const O=K?{ignored:[],outdated:[]}:Be(e,{depFields:r.depFields,dev:a.dev,exclude:E.exclude,ignore:E.ignore,include:E.include,packageMode:E.packageMode,peer:Q,prod:a.prod,target:E.target});if(O.outdated.length>0){const i=new Set(g.map(d=>`${d.catalogName}|${d.packageName}`));for(const d of O.outdated)i.has(`${d.catalogName}|${d.packageName}`)||g.push(d)}if(O.ignored.length>0)for(const i of O.ignored)A.includes(i)||A.push(i);const ee=w-g.length-y.length;if(y.length>0&&s.warn(`Failed to fetch: ${y.join(", ")}`),A.length>0&&s.info(`Skipped ${String(A.length)} ignored package${A.length===1?"":"s"}: ${A.join(", ")}`),!B&&w>g.length){const i=[...M.values()].reduce((F,Y)=>F+Y.size,0),d=i>w?` (${String(i)} catalog entries, ${String(i-w)} duplicates)`:"";s.info(`Checked ${String(w)} unique packages${d}: ${String(g.length)} outdated, ${String(ee)} up-to-date${y.length>0?`, ${String(y.length)} failed`:""}${h.length>0?`, ${String(h.length)} skipped by target`:""}`)}if(g.length===0){h.length>0?s.info(`All catalog dependencies are up to date within the current target.
10
+ ${String(h.length)} package${h.length===1?" has":"s have"} newer versions available with --target latest:
11
+ ${h.map(i=>` ${i.packageName} ${i.currentRange} → ${i.newRange} (${i.updateType})`).join(`
12
+ `)}`):s.info("All catalog dependencies are up to date.");return}const U=a.format??r.format??"table";let R;if(a.ai){const i=Ye(a.aiType??"impact");R=await ze(g,s,n.ai,i)}const V=!!a.dryRun;if(B&&U==="table"){const i=new et(g,R??null);let d;if(a.changelog){s.info("Fetching changelogs...");const c=await me(g,void 0,b);d=new Map;for(const v of c){const C=v.releaseUrl??v.repoUrl??v.npmUrl;C&&d.set(v.packageName,C)}}const F=n.tui?.autoExit??!1,Y=F===!0?3:typeof F=="number"?F:0,te=await oe($.createElement(tt,{autoExitSeconds:Y,changelogUrls:d,checkedCount:w,filteredOutEntries:h,isDryRun:V,store:i,totalCatalogEntries:H}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit(),z=process.stdout.columns||80;process.stdout.write(`
13
+ `);for(const c of g){const v=c.vulnerabilities?.length||c.socketReport&&c.socketReport.alerts.length>0,C=!!c.acceptedRisk,J=v?C?"✓":"⚠":"✓",ye=C?"gray":c.updateType==="major"?"red":c.updateType==="minor"?"yellow":"green",P=c.socketReport?.score.overall,be=P===void 0?"":` [${String(Math.round(P*100))}%]`,ne=P===void 0?void 0:Le(P);process.stdout.write(`${X($.createElement(S,null," ",$.createElement(S,{color:ye},J),` ${c.packageName} ${c.currentRange} → ${c.newRange}`,$.createElement(S,{dimColor:!0},` ${c.updateType}`),ne?$.createElement(S,{color:ne},be):null),{columns:z})}
14
14
  `)}if(process.stdout.write(`
15
- `),o.info(le(p)),k>p.length){const l=[...N.values()].reduce((A,H)=>A+H.size,0),h=l>k?` (${String(l)} catalog entries, ${String(l-k)} duplicates)`:"";o.info(` Checked ${String(k)} unique packages${h}: ${String(Z)} up-to-date${w.length>0?`, ${String(w.length)} failed`:""}`)}if(f.length>0){process.stdout.write(`
16
- `);const l=`${String(f.length)} package${f.length===1?"":"s"} skipped by target constraint (use --target latest to include):`;process.stdout.write(`${V($.createElement(b,{color:"yellow"},` ${l}`),{columns:D})}
17
- `);for(const h of f)process.stdout.write(`${V($.createElement(b,null," ",$.createElement(b,{dimColor:!0},h.packageName),` ${h.currentRange} → ${h.newRange}`,$.createElement(b,{dimColor:!0},` ${h.updateType}`)),{columns:D})}
18
- `)}const I=Array.isArray(K)?K:[];if(I.length>0&&!L){o.info(`
19
- Applying ${String(I.length)} updates...
20
- `);const l={...a,install:a.install??r.install};await re(e,t,I,l,o,C,n.editorconfig??!0)}return}if(L){if(F==="json"){const s={failed:w,filteredByTarget:f,ignored:S,outdated:p};y&&(s.aiAnalysis=y),process.stdout.write(`${JSON.stringify(s,void 0,2)}
21
- `)}else o.info(`Would update ${String(p.length)} dependencies:
22
- `),se(p,w,F,o),y&&(o.info(""),o.info(ne(y))),oe(f,o);return}y&&F!=="json"&&(o.info(ne(y)),o.info(""));let q=p;if(a.interactive&&(q=await Ne(p),q.length===0)){o.info("No updates selected.");return}o.info(`Updating ${String(q.length)} catalog dependencies...
23
- `),se(q,[],F,o),oe(f,o);const ge={...a,install:a.install??r.install};await re(e,t,q,ge,o,C)},"executeCatalogUpdate"),it=R((e,t,n,a,i,o)=>{const r={dev:a.dev,filters:j(a.filter),global:a.global,interactive:a.interactive,latest:a.latest||a.target==="latest",noOptional:a.optional===!1,noSave:a.save===!1,packages:i,prod:a.prod,recursive:a.recursive,workspaceRoot:a.workspaceRoot},{command:g,warnings:v}=nt(t,n,r);for(const d of v)o.warn(d);const u=`${g.bin} ${g.args.join(" ")}`.trim();if(a.dryRun){o.info(`Would run: ${u}`);return}o.info(`Running: ${u}`);try{ie(g.bin,g.args,{cwd:e,env:process.env,stdio:"inherit"})}catch(d){const m=d.status??1;o.error(`
24
- ${qe("✖")} Update failed (exit code ${String(m)})`),o.error(` Command: ${u}`),o.error(` Directory: ${e}
25
- `),process.exitCode=m}},"executePmWrapper"),wt=R(async({argument:e,logger:t,options:n,visConfig:a,workspaceRoot:i})=>{if(!i)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");let o=e;const r=i,{packageManager:g}=Me(r);if(n.typosquatCheck!==!1){if(o.length>0){const v=o.map(m=>Ge(m)),u=a?.security?.typosquatAllowlist,d=await De(v.map(m=>m.name),u);if(!d.ok){process.exitCode=1;return}o=v.map((m,C)=>{const E=d.packages[C];return E!==m.name?m.versionSpec?`${E}@${m.versionSpec}`:E??"":o[C]??""})}else if(!await Ie(r,a?.security?.typosquatAllowlist)){process.exitCode=1;return}}if(n.rollback){if(!_e(r,g)){t.info("No backup found. Run 'vis update' first to create a backup.");return}if(Be(r,g))t.info("Restored from backup.");else throw new Error("Failed to restore from backup.");return}if(n.catalog!==!1&&Oe(r,g))await rt(r,g,a??{},n,o,t);else{const v=Pe(r,{configBackend:a?.install?.backend,configCorepack:a?.install?.corepack}),u=v.name==="aube"?"":We(v.name);it(r,v.name,u,n,o,t)}},"execute");export{wt as default,ot as readPmNativeMinimumReleaseAge};
15
+ `),s.info(ge(g,L?.minimumScore)),w>g.length){const c=[...M.values()].reduce((C,J)=>C+J.size,0),v=c>w?` (${String(c)} catalog entries, ${String(c-w)} duplicates)`:"";s.info(` Checked ${String(w)} unique packages${v}: ${String(ee)} up-to-date${y.length>0?`, ${String(y.length)} failed`:""}`)}if(h.length>0){process.stdout.write(`
16
+ `);const c=`${String(h.length)} package${h.length===1?"":"s"} skipped by target constraint (use --target latest to include):`;process.stdout.write(`${X($.createElement(S,{color:"yellow"},` ${c}`),{columns:z})}
17
+ `);for(const v of h)process.stdout.write(`${X($.createElement(S,null," ",$.createElement(S,{dimColor:!0},v.packageName),` ${v.currentRange} → ${v.newRange}`,$.createElement(S,{dimColor:!0},` ${v.updateType}`)),{columns:z})}
18
+ `)}const Z=Array.isArray(te)?te:[];if(Z.length>0&&!V){s.info(`
19
+ Applying ${String(Z.length)} updates...
20
+ `);const c={...a,install:a.install??r.install};await ue(e,t,Z,c,s,b,n.editorconfig??!0)}return}if(V){if(U==="json"){const i={failed:y,filteredByTarget:h,ignored:A,outdated:g};R&&(i.aiAnalysis=R),process.stdout.write(`${JSON.stringify(i,void 0,2)}
21
+ `)}else s.info(`Would update ${String(g.length)} dependencies:
22
+ `),ce(g,y,U,s,L?.minimumScore),R&&(s.info(""),s.info(re(R))),le(h,s);return}R&&U!=="json"&&(s.info(re(R)),s.info(""));let j=g;if(a.interactive&&(j=await Oe(g),j.length===0)){s.info("No updates selected.");return}s.info(`Updating ${String(j.length)} catalog dependencies...
23
+ `),ce(j,[],U,s,L?.minimumScore),le(h,s);const we={...a,install:a.install??r.install};await ue(e,t,j,we,s,b)},"executeCatalogUpdate"),ht=k((e,t,n,a,o,s)=>{const r={dev:a.dev,filters:N(a.filter),global:a.global,interactive:a.interactive,latest:a.latest||a.target==="latest",noOptional:a.optional===!1,noSave:a.save===!1,packages:o,prod:a.prod,recursive:a.recursive,workspaceRoot:a.workspaceRoot},{command:m,warnings:u}=ut(t,n,r);for(const l of u)s.warn(l);const p=`${m.bin} ${m.args.join(" ")}`.trim();if(a.dryRun){s.info(`Would run: ${p}`);return}s.info(`Running: ${p}`);try{pe(m.bin,m.args,{cwd:e,env:process.env,stdio:"inherit"})}catch(l){const f=l.status??1;s.error(`
24
+ ${he("✖")} Update failed (exit code ${String(f)})`),s.error(` Command: ${p}`),s.error(` Directory: ${e}
25
+ `),process.exitCode=f}},"executePmWrapper"),vt=k(async(e,t,n)=>{const a=e.latest===!0||e.target==="latest";if(t||!a||e.dryRun===!0||e.yes===!0||e.interactive===!0)return!0;if(!(process.stdout.isTTY&&!fe))return n.error(`${he("")} Refusing to run blanket --latest update in a non-interactive context.`),n.error(" Re-run with --yes to confirm, --dry-run to preview, or pass explicit package names."),process.exitCode=1,!1;const o=Ce({input:process.stdin,output:process.stdout});try{const s=(await new Promise(r=>{o.question(`${G("")} About to upgrade ALL dependencies to their latest versions. This may include breaking changes.
26
+ Continue? [y/N] `,r)})).trim().toLowerCase();return s==="y"||s==="yes"?!0:(n.info("Aborted."),!1)}finally{o.close()}},"requireBlanketUpdateConfirmation"),Mt=k(async({argument:e,logger:t,options:n,visConfig:a,workspaceRoot:o})=>{if(!o)throw new Error("Could not determine workspace root. Run this command inside a monorepo.");let s=e;const r=o,{packageManager:m}=Pe(r);if(n.typosquatCheck!==!1){if(s.length>0){const u=s.map(f=>nt(f)),p=a?.security?.typosquatAllowlist,l=await Ke(u.map(f=>f.name),p);if(!l.ok){process.exitCode=1;return}s=u.map((f,q)=>{const b=l.packages[q];return b!==f.name?f.versionSpec?`${b}@${f.versionSpec}`:b??"":s[q]??""})}else if(!await Qe(r,a?.security?.typosquatAllowlist)){process.exitCode=1;return}}if(n.rollback){if(!Ie(r,m)){t.info("No backup found. Run 'vis update' first to create a backup.");return}if(De(r,m))t.info("Restored from backup.");else throw new Error("Failed to restore from backup.");return}if(s.length>0&&n.marshallCheck!==!1){const u=await Ze(s);if(u.length>0){const p=await Je(u,{config:a?.security?.marshalls,workspaceRoot:r});if(!await Xe(p)){process.exitCode=1;return}}}if(await vt(n,s.length>0,t))if(n.catalog!==!1&&We(r,m))await ft(r,m,a??{},n,s,t);else{const u=Ge(r,{configBackend:a?.install?.backend,configCorepack:a?.install?.corepack}),p=u.name==="aube"?"":He(u.name);ht(r,u.name,p,n,s,t)}},"execute");export{Mt as default,Nt as formatMinutesAsTimeString,pt as parseNpmReleaseAgeValue,ve as parseTimeStringToMinutes,gt as readPmNativeMinimumReleaseAge,vt as requireBlanketUpdateConfirmation};
@@ -1,3 +1,3 @@
1
- var J=Object.defineProperty;var y=(e,o)=>J(e,"name",{value:o,configurable:!0});import{createRequire as S}from"node:module";import{M as w,B as q,z as T,w as I}from"./config.js";import{o as L}from"../packem_shared/index-DH-5hsrC.js";import{y as U,aF as O,aG as W,a9 as B}from"./bin.js";const x=S(import.meta.url),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,D=y(e=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[o,t]=k.versions.node.split(".").map(Number);if(o>22||o===22&&t>=3||o===20&&t>=16)return k.getBuiltinModule(e)}return x(e)},"__cjs_getBuiltinModule"),{readFileSync:M}=D("node:fs");var z=Object.defineProperty,C=y((e,o)=>z(e,"name",{value:o,configurable:!0}),"i");const G=C((e,o)=>{const t=o.replace(/^\.?\//,"");return t===""||t==="."?`/${e}/`:e===""||e==="."?`/${t}`:`/${e}/${t}`},"toWorkspacePath"),K=C((e,o)=>{const t=[];for(const[r,n]of Object.entries(o?.globalPaths??{}))t.push({owners:n,path:r});for(const[r,n]of Object.entries(e.projects)){const i=n.owners??[];for(const a of i)t.push({channel:a.channel,owners:a.owners,path:G(n.root??r,a.path),projectId:r})}return(o?.orderBy??"file-source")==="project-id"?t.sort((r,n)=>(r.projectId??"").localeCompare(n.projectId??"")||r.path.localeCompare(n.path)):t.sort((r,n)=>r.path.localeCompare(n.path)),t},"buildCodeownersLines"),V=["# CODEOWNERS generated by `vis sync codeowners`. Do not edit by hand.","# Update each project's project.json `owners` field and re-run the command.",""],Y=C((e,o="github")=>{const t=[...V];for(const r of e){const n=r.owners.join(" "),i=r.channel?` # notify: ${r.channel}`:"";t.push(`${r.path} ${n}${i}`)}return t.push(""),t.join(`
2
- `)},"renderCodeowners");var H=Object.defineProperty,u=y((e,o)=>H(e,"name",{value:o,configurable:!0}),"s");const Q=["author","bugs","homepage","license","repository","engines"],E=u(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isPlainObject"),b=u((e,o)=>{if(e===o)return!0;if(typeof e!=typeof o||e===null||o===null)return!1;if(Array.isArray(e)){if(!Array.isArray(o)||e.length!==o.length)return!1;for(const[t,r]of e.entries())if(!b(r,o[t]))return!1;return!0}if(typeof e=="object"&&typeof o=="object"){const t=Object.keys(e),r=Object.keys(o);if(t.length!==r.length)return!1;for(const n of t)if(!b(e[n],o[n]))return!1;return!0}return!1},"deepEqual"),N=u(e=>e===void 0?e:structuredClone(e),"cloneJson"),X=u((e,o,t)=>{if(e==="repository"&&E(o)&&E(t)){const r={};for(const[n,i]of Object.entries(o))n!=="directory"&&(r[n]=N(i));return typeof t.directory=="string"&&(r.directory=t.directory),r}return N(o)},"buildTargetValue"),Z=u((e,o,t)=>{const r=[];for(const n of t.fields){if(!Object.hasOwn(e,n))continue;const i=e[n],a=o[n],c=X(n,i,a);b(c,a)||r.push({after:c,before:a,field:n,packageJsonPath:""})}return r},"computeFieldChanges"),ee=u((e,o)=>{for(const t of o)e[t.field]=t.after},"applyFieldChanges");var oe=Object.defineProperty,m=y((e,o)=>oe(e,"name",{value:o,configurable:!0}),"p");const _=["codeowners","package-json-fields"],te=m(e=>{const o=new Set,t=[];for(const r of e??[])for(const n of r.split(",")){const i=n.trim();i.length===0||o.has(i)||(o.add(i),t.push(i))}return t.length>0?t:[...Q]},"parseFieldsOption"),re=m((e,o)=>o.some(t=>L(t,e)),"matchesAnyGlob"),ne=m(({logger:e,options:o,visConfig:t,workspaceRoot:r})=>{const{workspace:n}=U(r,t),i=K(n,t?.codeowners);if(i.length===0){e.info("No `owners` entries found in any project. Nothing to sync.");return}const a=Y(i,t?.codeowners?.provider??"github"),c=o.out?w(r,o.out):w(r,"CODEOWNERS");if(o.check){let g="";try{g=M(c,"utf8")}catch(d){if(d.code!=="ENOENT")throw d}if(g.trim()!==a.trim()){e.error(`${c} is out of date. Run \`vis sync codeowners\` to update it.`),process.exitCode=1;return}e.info(`${c} is up to date.`);return}q(c,a),e.info(`Wrote ${i.length} entries to ${c}`)},"runCodeowners"),se=m(({logger:e,options:o,visConfig:t,workspaceRoot:r})=>{const n=r,i=t?.editorconfig??!0,a=O(w(n,"package.json"));if(!a){e.error("Could not read root package.json. Nothing to sync."),process.exitCode=1;return}const c=te(o.fields),g=o.ignorePackageName??[],d=o.check===!0,F=(o.format??"human").toLowerCase(),v=o.quiet===!0,R=W(n).filter(s=>s!=="."),p=[];let j=0;for(const s of R){const l=w(n,s,"package.json"),h=O(l);if(!h)continue;const $=typeof h.name=="string"?h.name:void 0;if($!==void 0&&g.length>0&&re($,g))continue;j+=1;const P=Z(a,h,{fields:c});P.length!==0&&p.push({filePath:l,packageJsonPath:T(n,l),packageName:$,pkg:h,pkgChanges:P})}if(!d)for(const s of p)ee(s.pkg,s.pkgChanges),I(s.filePath,s.pkg,{indent:B(s.filePath,{useEditorconfig:i}),overwrite:!0});const f=p.flatMap(s=>s.pkgChanges.map(l=>({after:l.after,before:l.before,field:l.field,packageJsonPath:s.packageJsonPath,packageName:s.packageName}))),A={changes:f,fields:c,kind:"package-json-fields",mode:d?"check":"write",totalChanges:f.length,totalPackages:j};if(F==="json")process.stdout.write(`${JSON.stringify(A,null,4)}
3
- `);else if(f.length===0)e.info(`All ${j} package${j===1?"":"s"} in sync (fields: ${c.join(", ")}).`);else if(d){if(!v)for(const s of f)e.error(`${s.packageJsonPath}: ${s.field} drifts from root`);e.error(`Found ${f.length} field drift${f.length===1?"":"s"} across ${p.length} package${p.length===1?"":"s"}. Run \`vis sync package-json-fields\` to fix.`)}else{if(!v)for(const s of p)e.info(`${s.packageJsonPath}: synced ${s.pkgChanges.map(l=>l.field).join(", ")}`);e.info(`Synced ${f.length} field${f.length===1?"":"s"} across ${p.length} package${p.length===1?"":"s"}.`)}d&&f.length>0&&(process.exitCode=1)},"runPackageJsonFields"),pe=m(async e=>{const o=e.argument[0];if(!o)throw new Error(`Missing sync kind. Usage: vis sync <kind> (known kinds: ${_.join(", ")})`);if(!e.workspaceRoot)throw new Error("Could not determine workspace root. Run inside a monorepo.");if(o==="codeowners"){ne(e);return}if(o==="package-json-fields"){se(e);return}throw new Error(`Unknown sync kind: "${o}". Known kinds: ${_.join(", ")}.`)},"execute");export{pe as default};
1
+ var M=Object.defineProperty;var R=(e,o)=>M(e,"name",{value:o,configurable:!0});import{createRequire as j}from"node:module";import{ay as _,az as v,aA as C,aB as B,aC as A,aD as p,aE as D,aF as V,aG as N,aH as F,aI as P,aJ as K,aK as O,aL as q,aM as Q,aN as G,aO as L,aP as W}from"./bin.js";import{M as J,i as b,Q as Y,$ as E,B as $}from"./config.js";import{v as U}from"../packem_shared/verify-07kUNTuP.js";const T=j(import.meta.url),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,I=R(e=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[o,i]=y.versions.node.split(".").map(Number);if(o>22||o===22&&i>=3||o===20&&i>=16)return y.getBuiltinModule(e)}return T(e)},"__cjs_getBuiltinModule"),{stdin:x,stdout:z}=y,{createInterface:H}=I("node:readline/promises");var X=Object.defineProperty,Z=R((e,o)=>X(e,"name",{value:o,configurable:!0}),"n");const S=Z(async e=>{if(!x.isTTY)return!0;const o=H({input:x,output:z});try{const i=(await o.question(`${e} [Y/n] `)).trim().toLowerCase();return i===""||i==="y"||i==="yes"}finally{o.close()}},"confirm");var ee=Object.defineProperty,k=R((e,o)=>ee(e,"name",{value:o,configurable:!0}),"p");const te=[{description:"VisConfig.targetDefaults → VisConfig.tasks",next:"tasks",previous:"targetDefaults"},{description:"VisConfig.taskDefaults → VisConfig.scopedTasks",next:"scopedTasks",previous:"taskDefaults"},{description:"VisConfig.taskRunnerOptions → VisConfig.taskRunner",next:"taskRunner",previous:"taskRunnerOptions"},{description:"ScopedTasksBlock.scope → ScopedTasksBlock.match",next:"match",previous:"scope"},{description:"ScopedTasksBlock.targets → ScopedTasksBlock.tasks",next:"tasks",previous:"targets"}],oe=[{description:"VisTaskConfig.targets → VisTaskConfig.tasks",next:"tasks",previous:"targets"}],ie=k(e=>new RegExp(String.raw`(^|[\s,{(\[])(["']?)${e}\2(\s*:)`,"gmu"),"buildKeyRegex"),re=k((e,o)=>{let i=e;const r=[];for(const t of o){const d=ie(t.previous);d.test(i)&&(d.lastIndex=0,i=i.replace(d,(s,c,a,g)=>`${c}${a}${t.next}${a}${g}`),r.push(t))}return{applied:r,output:i}},"applyRenames"),h=k((e,o)=>re(e,o),"rewriteSource"),ne=["vis.config.ts","vis.config.mts","vis.config.cts","vis.config.js","vis.config.mjs","vis.config.cjs"],se=new Set(["vis.task.cjs","vis.task.cts","vis.task.js","vis.task.mjs","vis.task.mts","vis.task.ts"]),ae=k(e=>{for(const o of ne){const i=J(e,o);if(b(i))return i}},"findConfigFile"),ce=k(e=>{const o=[];try{for(const i of _(e,{includeDirs:!1,includeFiles:!0,includeSymlinks:!1,skip:[/node_modules/,/\.git/,/\.vis\b/,/dist\b/,/\.next\b/,/\.nuxt\b/]}))se.has(Y(i.path))&&o.push(i.path)}catch{}return o},"findTaskConfigFiles"),ge=k((e,o,i,r)=>{const t=ae(e);if(t){const s=E(t),{applied:c,output:a}=h(s,te);if(c.length===0)i.info(`${t} already uses the current schema — no rewrite needed.`);else if(o.dryRun)i.info(`── ${t} (preview) ──`),i.info(a),i.info("── end preview ──"),i.info(`Would apply ${String(c.length)} rename(s): ${c.map(g=>g.description).join(", ")}`);else{v(t,r),$(t,a),i.info(`Rewrote ${t} (backup at ${t}.bak). Applied ${String(c.length)} rename(s).`);for(const g of c)r.manualSteps.push(`Renamed ${g.description} in ${t}`)}}else i.warn("No vis.config.ts found at workspace root nothing to migrate."),r.warnings.push("No vis.config.{ts,mts,cts,js,mjs,cjs} at workspace root.");const d=o.taskConfigPaths??ce(e);for(const s of d){if(!b(s))continue;const c=E(s),a=h(c,oe);if(a.applied.length!==0)if(o.dryRun)i.info(`── ${s} (preview) ──`),i.info(a.output),i.info("── end preview ──"),i.info(`Would apply ${String(a.applied.length)} rename(s): ${a.applied.map(g=>g.description).join(", ")}`);else{v(s,r),$(s,a.output),i.info(`Rewrote ${s} (backup at ${s}.bak). Applied ${String(a.applied.length)} rename(s).`);for(const g of a.applied)r.manualSteps.push(`Renamed ${g.description} in ${s}`)}}},"migrateSelf");var pe=Object.defineProperty,n=R((e,o)=>pe(e,"name",{value:o,configurable:!0}),"r");const f=n(e=>{const o=e.workspaceRoot??process.cwd(),i=e.visConfig??{};return{config:i,dryRun:!!e.options.dryRun,logger:e.logger,packageManager:B(o),report:C(),root:o,useEditorconfig:typeof i.editorconfig=="boolean"?i.editorconfig:!0}},"buildContext"),u=n(async(e,o,i)=>{if(o.yes||o.dryRun)return!0;const r=await S(`This will edit files, scripts, and hooks for "${e}". Backups (.bak) will be created. Continue?`);return r||i.info("Aborted."),r},"maybeConfirm"),l=n(e=>{e.dryRun&&e.logger.info(`Running in dry-run mode — no changes will be made.
2
+ `)},"announceDryRun"),fe=n(async({logger:e,options:o,visConfig:i,workspaceRoot:r})=>{if(!await u("deps",o,e))return;const t=f({logger:e,options:o,visConfig:i,workspaceRoot:r});l(t),e.info("── Migrating dependencies and scripts ──"),A(t.root,t.packageManager,t.config,{dryRun:t.dryRun},e,t.report),e.info(""),p(t.report,e)},"migrateDepsExecuteImpl"),ue=n(async({logger:e,options:o,visConfig:i,workspaceRoot:r})=>{if(!await u("lint-staged",o,e))return;const t=f({logger:e,options:o,visConfig:i,workspaceRoot:r});l(t),e.info("── Migrating lint-staged ──"),D(t.root,{dryRun:t.dryRun,useEditorconfig:t.useEditorconfig},e,t.report),e.info(""),p(t.report,e)},"migrateLintStagedExecuteImpl"),le=n(async({logger:e,options:o,visConfig:i,workspaceRoot:r})=>{if(!await u("nano-staged",o,e))return;const t=f({logger:e,options:o,visConfig:i,workspaceRoot:r});l(t),e.info("── Migrating nano-staged ──"),V(t.root,{dryRun:t.dryRun,useEditorconfig:t.useEditorconfig},e,t.report),e.info(""),p(t.report,e)},"migrateNanoStagedExecuteImpl"),de=n(async({logger:e,options:o,visConfig:i,workspaceRoot:r})=>{if(!await u("turborepo",o,e))return;const t=f({logger:e,options:o,visConfig:i,workspaceRoot:r});l(t),e.info("── Migrating turborepo ──"),N(t.root,{dryRun:t.dryRun,useEditorconfig:t.useEditorconfig},e,t.report),e.info(""),p(t.report,e)},"migrateTurborepoExecuteImpl"),me=n(async({logger:e,options:o,visConfig:i,workspaceRoot:r})=>{if(!await u("nx",o,e))return;const t=f({logger:e,options:o,visConfig:i,workspaceRoot:r});l(t),e.info("── Migrating nx ──"),F(t.root,{dryRun:t.dryRun,force:!!o.force,useEditorconfig:t.useEditorconfig},e,t.report),e.info(""),p(t.report,e)},"migrateNxExecuteImpl"),ye=n(async({logger:e,options:o,visConfig:i,workspaceRoot:r})=>{if(!await u("moon",o,e))return;const t=f({logger:e,options:o,visConfig:i,workspaceRoot:r});l(t),e.info("── Migrating moon ──"),P(t.root,{copyTemplates:!!o.copyTemplates,dryRun:t.dryRun,useEditorconfig:t.useEditorconfig},e,t.report),e.info(""),p(t.report,e)},"migrateMoonExecuteImpl"),ke=n(async({logger:e,options:o,visConfig:i,workspaceRoot:r})=>{if(!await u("gitleaks",o,e))return;const t=f({logger:e,options:o,visConfig:i,workspaceRoot:r});l(t),e.info("── Migrating gitleaks ──"),K(t.root,{dryRun:t.dryRun,useEditorconfig:t.useEditorconfig},e,t.report),e.info(""),p(t.report,e)},"migrateGitleaksExecuteImpl"),Re=n(async({logger:e,options:o,visConfig:i,workspaceRoot:r})=>{if(!await u("kingfisher",o,e))return;const t=f({logger:e,options:o,visConfig:i,workspaceRoot:r});l(t),e.info("── Migrating Kingfisher ──"),O(t.root,{dryRun:t.dryRun,useEditorconfig:t.useEditorconfig},e,t.report),e.info(""),p(t.report,e)},"migrateKingfisherExecuteImpl"),we=n(async({logger:e,options:o,visConfig:i,workspaceRoot:r})=>{if(!await u("secretlint",o,e))return;const t=f({logger:e,options:o,visConfig:i,workspaceRoot:r});l(t),e.info("── Migrating secretlint ──"),q(t.root,{dryRun:t.dryRun,useEditorconfig:t.useEditorconfig},e,t.report),e.info(""),p(t.report,e)},"migrateSecretlintExecuteImpl"),ve=n(async({logger:e,options:o,visConfig:i,workspaceRoot:r})=>{if(!await u("syncpack",o,e))return;const t=f({logger:e,options:o,visConfig:i,workspaceRoot:r});l(t),e.info("── Migrating syncpack ──"),Q(t.root,{dryRun:t.dryRun,useEditorconfig:t.useEditorconfig},e,t.report),e.info(""),p(t.report,e)},"migrateSyncpackExecuteImpl"),xe=n(async({logger:e,options:o,visConfig:i,workspaceRoot:r})=>{if(!await u("sherif",o,e))return;const t=f({logger:e,options:o,visConfig:i,workspaceRoot:r});l(t),e.info("── Migrating sherif ──"),G(t.root,{dryRun:t.dryRun,useEditorconfig:t.useEditorconfig},e,t.report),e.info(""),p(t.report,e)},"migrateSherifExecuteImpl"),Ee=n(async({logger:e,options:o,visConfig:i,workspaceRoot:r})=>{if(!await u("self",o,e))return;const t=f({logger:e,options:o,visConfig:i,workspaceRoot:r});l(t),e.info("── Migrating vis.config.ts to current schema ──"),ge(t.root,{dryRun:t.dryRun},e,t.report),e.info(""),p(t.report,e)},"migrateSelfExecuteImpl"),$e=n(({logger:e,workspaceRoot:o})=>{const i=o??process.cwd();U(i,e).length>0&&(process.exitCode=1)},"migrateVerifyExecuteImpl"),he=n(async({logger:e,options:o,visConfig:i,workspaceRoot:r})=>{const t=r??process.cwd(),d=L(t,i??{}),s=W(d);if(s.length===0){e.info("No applicable migrations detected in this workspace.");return}const c=!!o.dryRun;e.info(`Detected ${String(s.length)} migration(s):`);for(const m of s)e.info(` • ${m.title} — ${m.description}`);if(e.info(""),!o.yes&&!c&&!await S("Apply all detected migrations? Backups (.bak) will be created.")){e.info("Aborted.");return}c&&e.info(`Running in dry-run mode — no changes will be made.
3
+ `);const a=C(),g=[];for(const m of s)try{if(e.info(`── Applying ${m.title} ──`),c)for(const w of m.probe(d))e.info(w);else m.apply(d,a,e);e.info("")}catch(w){g.push({error:w,id:m.id}),e.warn(`Failed to apply ${m.title}: ${w.message}`)}p(a,e),g.length>0&&(e.warn(""),e.warn(`${String(g.length)} migration(s) failed see messages above.`),process.exitCode=1)},"migrateAllExecuteImpl"),Te=fe,Ie=ue,_e=le,Be=de,Ae=me,De=ye,Ve=ke,Ne=Re,Fe=we,Pe=ve,Ke=xe,Oe=Ee,qe=$e,Qe=he;export{Qe as migrateAllExecute,Te as migrateDepsExecute,Ve as migrateGitleaksExecute,Ne as migrateKingfisherExecute,Ie as migrateLintStagedExecute,De as migrateMoonExecute,_e as migrateNanoStagedExecute,Ae as migrateNxExecute,Fe as migrateSecretlintExecute,Oe as migrateSelfExecute,Ke as migrateSherifExecute,Pe as migrateSyncpackExecute,Be as migrateTurborepoExecute,qe as migrateVerifyExecute};
@@ -1,22 +1,7 @@
1
- var ae=Object.defineProperty;var j=(t,e)=>ae(t,"name",{value:e,configurable:!0});import{createRequire as ce}from"node:module";import{aI as Y,E as p,j as b,q as T,p as l}from"./bin.js";import{a as _,M as N,K as Q,b as L,z as X,y as pe,h as Z,B as fe,C as ue}from"./config.js";import{f as we}from"../packem_shared/giget-CcEy_Elm.js";const le=ce(import.meta.url),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,P=j(t=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[e,r]=x.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return x.getBuiltinModule(t)}return le(t)},"__cjs_getBuiltinModule"),{fileURLToPath:de}=P("node:url"),{createInterface:me}=P("node:readline"),{mkdtempSync:he,rmSync:ge}=P("node:fs"),{tmpdir:$e}=P("node:os"),{spawnSync:ye}=P("node:child_process");var ve=Object.defineProperty,y=j((t,e)=>ve(t,"name",{value:e,configurable:!0}),"i");const ee=[".ts",".mts",".cts",".js",".mjs",".cjs"],be="template.yml",Te=[".d",".test",".spec",".config",".bench",".stories"],Se=[".d.ts",".d.mts",".d.cts",".js.map",".mjs.map",".cjs.map",".ts.map"],te=y(t=>{for(const e of ee)if(t.endsWith(e))return t.slice(0,-e.length);return t},"stripExtension"),Oe=y(t=>{if(Se.some(r=>t.endsWith(r))||!ee.some(r=>t.endsWith(r)))return!1;const e=te(t);return!Te.some(r=>e.endsWith(r))},"isNativeFile"),J=y((t,e)=>{const r=[];if(!_(t))return r;for(const s of Y(t,{includeDirs:!1,includeSymlinks:!1,maxDepth:1})){if(!Oe(s.name))continue;const n=te(s.name);r.push({load:y(()=>Ne(s.path),"load"),name:n,path:s.path,source:e})}return r},"scanNativeDirectory"),I=y((t,e)=>{const r=[];if(!_(t))return r;for(const s of Y(t,{includeFiles:!1,includeSymlinks:!1,maxDepth:1})){if(s.path===t)continue;const n=N(s.path,be);_(n)&&r.push({load:y(()=>Re(s.path,s.name),"load"),name:s.name,path:s.path,source:e})}return r},"scanMoonDirectory"),je=y(()=>{try{const t=de(import.meta.url),e=N(Q(t),"..","..","templates");return _(e)?e:void 0}catch{return}},"resolveBuiltinTemplatesDirectory"),q=y(t=>{const{extraDirectories:e=[],onWarning:r,workspaceRoot:s}=t,n=[...J(N(s,".vis","templates"),"native"),...I(N(s,".vis","templates"),"moon"),...I(N(s,".moon","templates"),"moon")];for(const o of e)n.push(...I(o,"config")),n.push(...J(o,"config"));const i=je();i&&n.push(...I(i,"builtin"));const a=new Map;for(const o of n){const c=a.get(o.name);if(!c){a.set(o.name,o);continue}r&&r(`Template "${o.name}" exists in multiple sources — using ${c.source} (${c.path}), ignoring ${o.source} (${o.path}).`)}return[...a.values()].sort((o,c)=>o.name.localeCompare(c.name))},"discoverTemplates"),Ne=y(async t=>{const{loadNativeTemplate:e}=await import("./loader.js");return e(t)},"loadNativeFromPath"),Re=y(async(t,e)=>{const{loadMoonTemplate:r}=await import("./index.js");return r(t,e)},"loadMoonFromPath");var Ee=Object.defineProperty,v=j((t,e)=>Ee(t,"name",{value:e,configurable:!0}),"c");const M=v((t,e)=>new Promise(r=>{t.question(e,s=>{r(s.trim())})}),"ask"),ke=v(async(t,e,r)=>{const s=await M(t,` ${e} ${p(r?"[Y/n]":"[y/N]")} `);return s===""?r:s.toLowerCase()==="y"||s.toLowerCase()==="yes"},"confirm"),xe=v(async(t,e,r,s)=>{process.stderr.write(` ${e}
2
- `);for(const[n,i]of r.entries()){const a=b(T(` ${String(n+1)}.`)),o=i===s?p(" (default)"):"";process.stderr.write(`${a} ${i}${o}
3
- `)}for(;;){const n=await M(t,`
4
- ${p(`Enter choice (1-${String(r.length)}):`)} `);if(n===""&&s!==void 0)return s;const i=Number.parseInt(n,10);if(Number.isInteger(i)&&i>=1&&i<=r.length)return r[i-1];const a=r.find(o=>o===n);if(a)return a;process.stderr.write(` ${p("Invalid choice. Try again.")}
5
- `)}},"selectOne"),_e=v(async(t,e,r,s)=>{process.stderr.write(` ${e} ${p("(comma-separated numbers)")}
6
- `);for(const[n,i]of r.entries()){const a=b(T(` ${String(n+1)}.`)),o=s.includes(i)?p(" (default)"):"";process.stderr.write(`${a} ${i}${o}
7
- `)}for(;;){const n=await M(t,`
8
- ${p("Enter choices:")} `);if(n===""&&s.length>0)return s;const i=n.split(",").map(a=>Number.parseInt(a.trim(),10)).filter(a=>Number.isInteger(a)&&a>=1&&a<=r.length);if(i.length>0)return i.map(a=>r[a-1]);process.stderr.write(` ${p("Invalid choice. Try again.")}
9
- `)}},"selectMany"),Pe=v(t=>` ${p(`${t}:`)} `,"promptText"),De=v((t,e)=>e.prompt??t,"variableLabel"),We=v(t=>Object.entries(t).sort(([e,r],[s,n])=>{const i=r.order??0,a=n.order??0;return i!==a?i-a:e.localeCompare(s)}),"sortVariables"),H=v((t,e)=>{switch(t.type){case"array":return e.split(",").map(r=>r.trim()).filter(Boolean);case"boolean":return e==="true"||e==="1"||e==="yes"||e==="y";case"enum":return t.multiple?e.split(",").map(r=>r.trim()).filter(Boolean):e;case"number":{const r=Number(e);if(Number.isNaN(r))throw new TypeError(`Expected a number, got "${e}"`);return r}default:return e}},"parseValue"),F=v((t,e,r)=>{if(e.type==="enum"){const s=Array.isArray(r)?r:[r];for(const n of s)if(typeof n!="string"||!e.values.includes(n))throw new Error(`Variable "${t}" must be one of: ${e.values.join(", ")} (got "${String(n)}")`)}},"validateValue"),Be=v(async t=>{const{defaults:e,interactive:r,overrides:s,variables:n}=t,i={},a=r?me({input:process.stdin,output:process.stderr}):null;try{for(const[o,c]of We(n)){if(Object.hasOwn(s,o)){const $=H(c,s[o]??"");F(o,c,$),i[o]=$;continue}if(e||!r||c.internal){if(c.default!==void 0){F(o,c,c.default),i[o]=c.default;continue}if(c.required)throw new Error(`Required variable "${o}" not provided. Pass --${o}=<value> or remove --defaults.`);continue}const g=De(o,c);let m;if(c.type==="boolean")m=await ke(a,g,!!(c.default??!1));else if(c.type==="enum")if(c.multiple){const $=Array.isArray(c.default)?c.default:[];m=await _e(a,g,c.values,$)}else{const $=typeof c.default=="string"?c.default:void 0;m=await xe(a,g,c.values,$)}else{const $=c.default===void 0?"":` (${String(c.default)})`,S=await M(a,Pe(`${g}${$}`));if(S===""&&c.default!==void 0)m=c.default;else if(S===""){if(c.required)throw new Error(`Variable "${o}" is required`);continue}else m=H(c,S)}F(o,c,m),i[o]=m}return i}finally{a?.close()}},"collectOptions");var Ie=Object.defineProperty,V=j((t,e)=>Ie(t,"name",{value:e,configurable:!0}),"o");const qe=["git://","npm://","https://","github:","gitlab:","bitbucket:","sourcehut:"],Me=V(t=>qe.some(e=>t.startsWith(e)),"isRemoteSource"),Ce=V(async(t,e={})=>{const r=e.targetDirectory===void 0,s=e.targetDirectory??he(N($e(),"vis-generate-")),n=V(()=>{if(r)try{ge(s,{force:!0,recursive:!0})}catch{}},"cleanup");l.info(`Downloading ${t}…`);try{const i=await we(t,{auth:e.auth||process.env.GIGET_AUTH||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,dir:s,force:!0,preferOffline:e.preferOffline});return{cleanup:n,directory:i.dir}}catch(i){n();const a=i instanceof Error?i.message:String(i);throw l.warn(`Failed to download template: ${a}`),i}},"fetchRemoteTemplate");var Ae=Object.defineProperty,R=j((t,e)=>Ae(t,"name",{value:e,configurable:!0}),"a");const re=R((t,e="")=>{const r=[];for(const[s,n]of Object.entries(t)){const i=e?`${e}/${s}`:s;typeof n=="string"||Buffer.isBuffer(n)?r.push({content:n,path:i}):n&&typeof n=="object"&&r.push(...re(n,i))}return r},"flattenTree"),Fe=R(t=>t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`,"formatSize"),Le=R((t,e)=>{if(L(e))throw new Error(`Refusing to write outside destination: template produced absolute path "${e}".`);const r=N(t,e),s=X(t,r);if(s===".."||s.startsWith(`..${pe}`)||L(s))throw new Error(`Refusing to write outside destination: "${e}" resolves to "${r}" which escapes "${t}".`);return r},"safeJoinDestination"),Ve=R((t,e)=>{Z(Q(t)),fe(t,e)},"writeOne"),Ke=R((t,e,r=!1)=>{const s=typeof t=="string"?[t]:t.commands,n=typeof t=="string"?r:t.silent??r;for(const i of s){n||l.info(`$ ${i}`);const a=ye(i,{cwd:e,shell:!0,stdio:n?"ignore":"inherit"});if(a.status!==0)return l.warn(`Script failed (exit ${String(a.status)}): ${i}`),!1}return!0},"runScript"),ze=R(t=>{const e=new Map;for(const r of t){const s=typeof r=="string"?0:r.phase??0,n=e.get(s);n?n.push(r):e.set(s,[r])}return[...e.entries()].sort(([r],[s])=>r-s)},"groupByPhase"),Ue=R(async(t,e)=>{const r={builtins:{dest_dir:e.destination,dest_rel_dir:X(e.workspaceRoot,e.destination)||".",working_dir:e.cwd,workspace_root:e.workspaceRoot},options:e.options},s=await t.produce(r),n=s.files?re(s.files):[],i=s.filesMeta??{},a=[];for(const o of n){const c=Le(e.destination,o.path);a.push({file:o,meta:i[o.path]??{},target:c})}if(e.dryRun){l.info(`${b(T("Plan"))} ${p("(dry-run, no files written)")}`);for(const o of a){const c=Buffer.isBuffer(o.file.content)?o.file.content.length:Buffer.byteLength(o.file.content,"utf8");process.stderr.write(` ${p("write")} ${o.file.path} ${p(`(${Fe(c)})`)}
10
- `)}}else{Z(e.destination);let o=0,c=0;for(const g of a){const{file:m,meta:$,target:S}=g,C=_(S),O=e.force||$.force===!0;if(C&&!O){l.warn(`Skipped existing file: ${m.path} (use --force or set frontmatter force: true to overwrite)`),c+=1;continue}Ve(S,m.content),o+=1}l.success(`Wrote ${String(o)} file${o===1?"":"s"}${c>0?`, skipped ${String(c)}`:""}`)}if(!e.dryRun&&!e.skipScripts&&s.scripts&&s.scripts.length>0){const o=ze(s.scripts);l.info(`Running ${String(s.scripts.length)} script${s.scripts.length===1?"":"s"} across ${String(o.length)} phase${o.length===1?"":"s"}…`);for(const[,c]of o)if((await Promise.all(c.map(g=>Promise.resolve(Ke(g,e.destination))))).includes(!1))throw new Error("Script failed — aborting.")}if(s.suggestions&&s.suggestions.length>0){process.stderr.write(`
11
- `),l.notice("Next steps:");for(const o of s.suggestions)process.stderr.write(` ${p("•")} ${o}
12
- `)}},"runTemplate");var Ge=Object.defineProperty,w=j((t,e)=>Ge(t,"name",{value:e,configurable:!0}),"u");const Je=w(async t=>{let e;try{e=(await t.load()).about?.description}catch{}return{description:e,name:t.name,path:t.path,source:t.source}},"toListEntry"),He=w((t,e)=>{const r={default:e.default,name:t,order:e.order,prompt:e.prompt,required:e.required,type:e.type};return e.type==="enum"&&(r.multiple=e.multiple,r.values=e.values),r},"summarizeVariable"),Ye=w(async t=>{const e=await t.load(),r=Object.entries(e.options??{}).sort(([s,n],[i,a])=>{const o=n.order??0,c=a.order??0;return o===c?s.localeCompare(i):o-c}).map(([s,n])=>He(s,n));return{description:e.about?.description??"",destination:e.destination,name:t.name,path:t.path,source:t.source,variables:r}},"describeTemplate"),Qe=w(t=>{if(t.length===0){l.info("No templates found."),l.notice("Create one at .vis/templates/<name>.ts (programmatic) or .vis/templates/<name>/ (moon-format with template.yml).");return}l.info("Available templates:");for(const e of t){const r=p(`(${e.source})`);process.stderr.write(` ${b(T(e.name))} ${r}
13
- `)}},"printList"),Xe=w(t=>{const e={},r=[];for(const s of t){if(!s.startsWith("--")){r.push(s);continue}const n=s.indexOf("=");if(n===-1){const o=s.slice(2);o.startsWith("no-")?e[o.slice(3)]="false":e[o]="true";continue}const i=s.slice(2,n),a=s.slice(n+1);e[i]=a}return{overrides:e,remaining:r}},"parsePassthroughOverrides"),Ze=w(async t=>{const{createInterface:e}=await import("node:readline"),r=e({input:process.stdin,output:process.stderr});try{process.stderr.write(` ${b(T("vis generate"))} ${p("— pick a template")}
1
+ var J=Object.defineProperty;var $=(e,o)=>J(e,"name",{value:o,configurable:!0});import{createRequire as T}from"node:module";import{$ as U,g as q,z as L,M as P,B as K,w as z}from"./config.js";import{o as V}from"../packem_shared/index-DH-5hsrC.js";import{aR as N,y as Y,aS as Q,ad as X}from"./bin.js";import{i as Z}from"../packem_shared/glob-MHJQjR39-CQ2GC0b_.js";import{n as ee}from"../packem_shared/manifests-B0fMp872.js";const W=T(import.meta.url),E=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,G=$(e=>{if(typeof E<"u"&&E.versions&&E.versions.node){const[o,n]=E.versions.node.split(".").map(Number);if(o>22||o===22&&n>=3||o===20&&n>=16)return E.getBuiltinModule(e)}return W(e)},"__cjs_getBuiltinModule"),{readFileSync:H}=G("node:fs");var oe=Object.defineProperty,j=$((e,o)=>oe(e,"name",{value:o,configurable:!0}),"c");const ne=j((e,o)=>{const n=o.replace(/^\.?\//,"");return n===""||n==="."?`/${e}/`:e===""||e==="."?`/${n}`:`/${e}/${n}`},"toWorkspacePath"),F=j((e,o,n=[])=>{const r=[],t=new Set;for(const[s,i]of Object.entries(o?.globalPaths??{}))r.push({owners:i,path:s,source:"project-json"}),t.add(s);for(const[s,i]of Object.entries(e.projects)){const c=i.owners??[];for(const a of c){const d=ne(i.root??s,a.path);r.push({channel:a.channel,owners:a.owners,path:d,projectId:s,source:"project-json"}),t.add(d)}}for(const s of n)t.has(s.path)||(r.push(s),t.add(s.path));return(o?.orderBy??"file-source")==="project-id"?r.sort((s,i)=>(s.projectId??"").localeCompare(i.projectId??"")||s.path.localeCompare(i.path)):r.sort((s,i)=>s.path.localeCompare(i.path)),r},"buildCodeownersLines"),te="Update each project's project.json `owners` field and re-run the command.",re=j(e=>["# CODEOWNERS — generated by `vis sync codeowners`. Do not edit by hand.",e?`# Re-run with: ${e}`:`# ${te}`,""],"buildHeader"),M=j(e=>{const o=[];for(const n of e){const r=n.owners.join(" "),t=n.channel?` # notify: ${n.channel}`:"";o.push(`${n.path} ${r}${t}`)}return o},"renderEntries"),se=j((e,o={})=>[...re(o.regenerationCommand),...M(e),""].join(`
2
+ `),"renderCodeowners"),_={begin:"# BEGIN vis-codeowners",end:"# END vis-codeowners"},ie=j((e,o=_,n={})=>{const r=n.regenerationCommand?`# Generated by vis sync codeowners — re-run with: ${n.regenerationCommand}`:"# Generated by `vis sync codeowners` — do not edit by hand.";return[o.begin,r,...M(e),o.end].join(`
3
+ `)},"renderCodeownersBlock"),ce=j((e,o,n=_)=>{const r=e.indexOf(n.begin),t=e.indexOf(n.end);if(r!==-1&&t!==-1&&t>r){const i=e.slice(0,r),c=t+n.end.length,a=e.slice(c);return`${i}${o}${a}`}const s=e.replace(/\s+$/u,"");return`${s.length===0?"":`${s}
14
4
 
15
- `);for(const[s,n]of t.entries()){const i=b(T(` ${String(s+1)}.`));process.stderr.write(`${i} ${n.name} ${p(`(${n.source})`)}
16
- `)}return new Promise((s,n)=>{r.question(`
17
- ${p(`Enter choice (1-${String(t.length)}):`)} `,i=>{const a=Number.parseInt(i.trim(),10);Number.isInteger(a)&&a>=1&&a<=t.length?s(t[a-1].name):n(new Error("Invalid choice."))})})}finally{r.close()}},"pickInteractive"),nt=w(async({argument:t,options:e,rawUnknown:r,visConfig:s,workspaceRoot:n})=>{const i=e.cwd||n||process.cwd(),a=n??i,o=s?.generator,c=Array.isArray(t)?t:t?[t]:[];if(e.list){const u=q({extraDirectories:o?.templates??[],onWarning:w(f=>{l.warn(f)},"onWarning"),workspaceRoot:a});if(e.json){const f=await Promise.all(u.map(d=>Je(d)));process.stdout.write(`${JSON.stringify(f,null,2)}
18
- `);return}Qe(u);return}if(e.describe){const u=c[0];if(!u)throw new Error("`--describe` requires a template name. Run `vis generate --list` to see available templates.");const f=q({extraDirectories:o?.templates??[],onWarning:w(h=>{l.warn(h)},"onWarning"),workspaceRoot:a}).find(h=>h.name===u);if(!f)throw new Error(`Template "${u}" not found. Run \`vis generate --list\` to see available templates.`);const d=await Ye(f);if(e.json){process.stdout.write(`${JSON.stringify(d,null,2)}
19
- `);return}if(l.info(`Template: ${b(T(d.name))} ${p(`(${d.source})`)}`),d.description&&l.info(d.description),d.destination&&l.info(`Destination: ${p(d.destination)}`),d.variables.length===0)l.info("No variables.");else{l.info("Variables:");for(const h of d.variables){const B=[h.type];h.required&&B.push("required"),h.default!==void 0&&B.push(`default=${JSON.stringify(h.default)}`),h.values&&B.push(`values=${h.values.join("|")}`),process.stderr.write(` ${b(T(h.name))} ${p(`(${B.join(", ")})`)}
20
- `)}}return}let g=[...r??[]];if(g.length===0){const u=process.argv.slice(2),f=u.indexOf("--");f!==-1&&(g=u.slice(f+1))}const m=c.indexOf("--"),$=m===-1?[]:c.slice(m+1),S=m===-1?c:c.slice(0,m),{overrides:C}=Xe([...$,...g]);let O,D,W;const k=S[0];let A;if(k&&Me(k)){const u=await Ce(k,{auth:o?.auth,preferOffline:!!e.preferOffline||o?.preferOffline});A=u.cleanup;try{const f=q({extraDirectories:[u.directory],workspaceRoot:a}).find(d=>d.path.startsWith(u.directory));if(!f)throw new Error(`Downloaded template at ${u.directory} contains no template.yml or *.ts entrypoint.`);O=await f.load(),D=f.name,W=O.destination}catch(f){throw A(),f}}else{const u=q({extraDirectories:o?.templates??[],onWarning:w(h=>{l.warn(h)},"onWarning"),workspaceRoot:a});if(u.length===0)throw new Error("No templates found. Create one at .vis/templates/<name>.ts or .vis/templates/<name>/template.yml.");let f;if(k)f=k;else{if(e.interactive===!1||!process.stdin.isTTY)throw new Error("No template specified. Pass a template name (see `vis generate --list`) or run interactively in a terminal.");f=await Ze(u)}const d=u.find(h=>h.name===f);if(!d)throw new Error(`Template "${f}" not found. Run 'vis generate --list' to see available templates.`);O=await d.load(),D=d.name,W=O.destination}const K=e.to,z=!!e.dryRun,se=!!e.force,U=!!e.defaults,oe=!!e.skipScripts,ne=e.interactive!==!1&&!!process.stdin.isTTY&&!U;let E;K?E=K:W?E=W:E=".";const G=L(E)?E:ue(i,E);l.info(`Template: ${b(T(D))}`),l.info(`Target: ${p(G)}`),process.stderr.write(`
21
- `);const ie=await Be({defaults:U,interactive:ne,overrides:C,variables:O.options??{}});try{await Ue(O,{cwd:i,destination:G,dryRun:z,force:se,options:ie,skipScripts:oe,workspaceRoot:a}),z||(process.stderr.write(`
22
- `),l.success(`Template '${D}' applied.`))}finally{A?.()}},"execute");export{nt as default};
5
+ `}${o}
6
+ `},"mergeIntoExisting");var ae=Object.defineProperty,O=$((e,o)=>ae(e,"name",{value:o,configurable:!0}),"f$1");const le=["**/CODEOWNERS"],de=["**/node_modules/**","**/dist/**","**/build/**","**/coverage/**","**/.git/**","**/.next/**","**/.nuxt/**"],fe=O(e=>{const o=[];for(const n of e.split(/\r?\n/u)){const r=n.indexOf("#"),t=(r===-1?n:n.slice(0,r)).trim();if(t.length===0)continue;const s=t.split(/\s+/u);if(s.length<2)continue;const[i,...c]=s,a=c.filter(d=>d.length>0);!i||a.length===0||o.push({owners:a,path:i})}return o},"parseCodeownersFile"),ue=O((e,o)=>{const n=o.replace(/^\.\/?/,"").replace(/\/$/,"");return e.startsWith("/")?n===""?e:`/${n}${e}`:n===""?`/${e}`:`/${n}/${e}`},"rewriteNestedPath"),pe=O(async(e,o,n)=>{const r=o&&o.length>0?[...o]:[...le],t=[...de];if(n){const c=n.replace(/^\.\/?/,"").replace(/^\/+/,"");c.length>0&&t.push(c)}const s=await Z(r,{absolute:!0,cwd:e,ignore:t}),i=[];for(const c of s){let a;try{a=U(c)}catch{continue}const d=q(c),h=L(e,d);for(const w of fe(a))i.push({owners:w.owners,path:ue(w.path,h)})}return i},"collectNestedCodeownersLines"),ge=/^(?:https?:\/\/)?(?:www\.)?github\.com\/([^/?#]+)/iu,he=O(e=>{if(!e)return;const o=e.match(ge);if(!o?.[1])return;const n=o[1].trim();if(!(n===""||n.includes(" ")))return`@${n.replace(/^@/,"")}`},"extractGitHubHandle"),we=O((e,o)=>{const n=[];for(const[r,t]of Object.entries(e.projects)){if(t.owners&&t.owners.length>0)continue;const s=t.root??r,i=P(o,s,"package.json"),c=N(i);if(!c)continue;const a=ee(c.maintainers);if(!a||a.length===0)continue;const d=[],h=new Set;for(const w of a){const m=he(w.url);m&&!h.has(m)&&(h.add(m),d.push(m))}d.length!==0&&n.push({owners:d,path:s===""||s==="."?"/":`/${s}/`,projectId:r})}return n},"collectMaintainerLines");var me=Object.defineProperty,b=$((e,o)=>me(e,"name",{value:o,configurable:!0}),"s");const ye=["author","bugs","homepage","license","repository","engines"],S=b(e=>typeof e=="object"&&e!==null&&!Array.isArray(e),"isPlainObject"),x=b((e,o)=>{if(e===o)return!0;if(typeof e!=typeof o||e===null||o===null)return!1;if(Array.isArray(e)){if(!Array.isArray(o)||e.length!==o.length)return!1;for(const[n,r]of e.entries())if(!x(r,o[n]))return!1;return!0}if(typeof e=="object"&&typeof o=="object"){const n=Object.keys(e),r=Object.keys(o);if(n.length!==r.length)return!1;for(const t of n)if(!x(e[t],o[t]))return!1;return!0}return!1},"deepEqual"),A=b(e=>e===void 0?e:structuredClone(e),"cloneJson"),ke=b((e,o,n)=>{if(e==="repository"&&S(o)&&S(n)){const r={};for(const[t,s]of Object.entries(o))t!=="directory"&&(r[t]=A(s));return typeof n.directory=="string"&&(r.directory=n.directory),r}return A(o)},"buildTargetValue"),je=b((e,o,n)=>{const r=[];for(const t of n.fields){if(!Object.hasOwn(e,t))continue;const s=e[t],i=o[t],c=ke(t,s,i);x(c,i)||r.push({after:c,before:i,field:t,packageJsonPath:""})}return r},"computeFieldChanges"),$e=b((e,o)=>{for(const n of o)e[n.field]=n.after},"applyFieldChanges");var be=Object.defineProperty,C=$((e,o)=>be(e,"name",{value:o,configurable:!0}),"u");const B=new Set(["nested-codeowners","package-json-maintainers","project-json"]),D=C((e,o,n)=>{const r=new Set,t=[];for(const s of e??[])for(const i of s.split(",")){const c=i.trim();if(c.length===0)continue;if(n&&!n(c))throw new Error(`Unknown codeowners source: "${c}". Known: ${[...B].join(", ")}.`);const a=c;r.has(a)||(r.add(a),t.push(a))}return t.length>0?t:[...o]},"parseCsvOption"),Ce=C(e=>B.has(e),"isCodeownersSource"),I=["codeowners","package-json-fields"],ve=C((e,o)=>o.some(n=>V(n,e)),"matchesAnyGlob"),Ee=C(async({logger:e,options:o,visConfig:n,workspaceRoot:r})=>{const t=r,{workspace:s}=Y(t,n),i=n?.codeowners,c=D(o.from,i?.sources??["project-json"],Ce),a=o.regenerationCommand??i?.regenerationCommand,d=o.preserveBlock===!0||i?.preserveBlock===!0,h=i?.blockMarker??_,w=o.nestedIncludes??i?.nestedIncludes,m=o.out??"CODEOWNERS",u=[];if(c.includes("nested-codeowners")){const g=await pe(t,w,m);for(const k of g)u.push({...k,source:"nested"})}if(c.includes("package-json-maintainers")){const g=we(s,t);for(const k of g)u.push({...k,source:"maintainers"})}const y=c.includes("project-json")?F(s,i,u):F({projects:{}},i,u);if(y.length===0){e.info("No `owners` entries found in any source. Nothing to sync.");return}const f=P(t,m);let v="";try{v=H(f,"utf8")}catch(g){if(g.code!=="ENOENT")throw g}const l={regenerationCommand:a},p=d?ce(v,ie(y,h,l),h):se(y,l);if(o.check){if(v.trim()!==p.trim()){e.error(`${f} is out of date. Run \`vis sync codeowners\` to update it.`),process.exitCode=1;return}e.info(`${f} is up to date.`);return}K(f,p),e.info(`Wrote ${y.length} entries to ${f}`)},"runCodeowners"),Oe=C(({logger:e,options:o,visConfig:n,workspaceRoot:r})=>{const t=r,s=n?.editorconfig??!0,i=N(P(t,"package.json"));if(!i){e.error("Could not read root package.json. Nothing to sync."),process.exitCode=1;return}const c=D(o.fields,ye),a=o.ignorePackageName??[],d=o.check===!0,h=(o.format??"human").toLowerCase(),w=o.quiet===!0,m=Q(t).filter(l=>l!=="."),u=[];let y=0;for(const l of m){const p=P(t,l,"package.json"),g=N(p);if(!g)continue;const k=typeof g.name=="string"?g.name:void 0;if(k!==void 0&&a.length>0&&ve(k,a))continue;y+=1;const R=je(i,g,{fields:c});R.length!==0&&u.push({filePath:p,packageJsonPath:L(t,p),packageName:k,pkg:g,pkgChanges:R})}if(!d)for(const l of u)$e(l.pkg,l.pkgChanges),z(l.filePath,l.pkg,{indent:X(l.filePath,{useEditorconfig:s}),overwrite:!0});const f=u.flatMap(l=>l.pkgChanges.map(p=>({after:p.after,before:p.before,field:p.field,packageJsonPath:l.packageJsonPath,packageName:l.packageName}))),v={changes:f,fields:c,kind:"package-json-fields",mode:d?"check":"write",totalChanges:f.length,totalPackages:y};if(h==="json")process.stdout.write(`${JSON.stringify(v,null,4)}
7
+ `);else if(f.length===0)e.info(`All ${y} package${y===1?"":"s"} in sync (fields: ${c.join(", ")}).`);else if(d){if(!w)for(const l of f)e.error(`${l.packageJsonPath}: ${l.field} drifts from root`);e.error(`Found ${f.length} field drift${f.length===1?"":"s"} across ${u.length} package${u.length===1?"":"s"}. Run \`vis sync package-json-fields\` to fix.`)}else{if(!w)for(const l of u)e.info(`${l.packageJsonPath}: synced ${l.pkgChanges.map(p=>p.field).join(", ")}`);e.info(`Synced ${f.length} field${f.length===1?"":"s"} across ${u.length} package${u.length===1?"":"s"}.`)}d&&f.length>0&&(process.exitCode=1)},"runPackageJsonFields"),Ae=C(async e=>{const o=e.argument[0];if(!o)throw new Error(`Missing sync kind. Usage: vis sync <kind> (known kinds: ${I.join(", ")})`);if(!e.workspaceRoot)throw new Error("Could not determine workspace root. Run inside a monorepo.");if(o==="codeowners"){await Ee(e);return}if(o==="package-json-fields"){Oe(e);return}throw new Error(`Unknown sync kind: "${o}". Known kinds: ${I.join(", ")}.`)},"execute");export{Ae as default};