@visulima/vis 7.1.0-next.1 → 7.1.0-next.2

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 (124) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/bin/group-listing.mjs +40 -0
  3. package/bin/route.mjs +9 -0
  4. package/dist/bin.js +1 -1
  5. package/dist/binx.js +1 -1
  6. package/dist/packem_chunks/CONFIG_FILES.js +5 -5
  7. package/dist/packem_chunks/bloom-sync.js +1 -1
  8. package/dist/packem_chunks/catalog.js +1 -1
  9. package/dist/packem_chunks/cli-exec.js +1 -1
  10. package/dist/packem_chunks/cli-main.js +134 -134
  11. package/dist/packem_chunks/emit.js +3 -0
  12. package/dist/packem_chunks/fix.js +1 -1
  13. package/dist/packem_chunks/handler10.js +1 -1
  14. package/dist/packem_chunks/handler12.js +1 -1
  15. package/dist/packem_chunks/handler13.js +1 -1
  16. package/dist/packem_chunks/handler14.js +1 -1
  17. package/dist/packem_chunks/handler15.js +1 -1
  18. package/dist/packem_chunks/handler19.js +1 -1
  19. package/dist/packem_chunks/handler2.js +1 -1
  20. package/dist/packem_chunks/handler20.js +1 -1
  21. package/dist/packem_chunks/handler21.js +1 -1
  22. package/dist/packem_chunks/handler23.js +1 -1
  23. package/dist/packem_chunks/handler24.js +1 -1
  24. package/dist/packem_chunks/handler25.js +1 -1
  25. package/dist/packem_chunks/handler26.js +1 -1
  26. package/dist/packem_chunks/handler28.js +1 -1
  27. package/dist/packem_chunks/handler3.js +1 -1
  28. package/dist/packem_chunks/handler4.js +1 -1
  29. package/dist/packem_chunks/handler5.js +1 -1
  30. package/dist/packem_chunks/handler50.js +1 -1
  31. package/dist/packem_chunks/handler51.js +1 -1
  32. package/dist/packem_chunks/handler52.js +1 -1
  33. package/dist/packem_chunks/handler54.js +1 -1
  34. package/dist/packem_chunks/handler55.js +1 -1
  35. package/dist/packem_chunks/handler58.js +1 -1
  36. package/dist/packem_chunks/handler59.js +1 -1
  37. package/dist/packem_chunks/handler6.js +1 -1
  38. package/dist/packem_chunks/handler60.js +1 -1
  39. package/dist/packem_chunks/handler61.js +1 -1
  40. package/dist/packem_chunks/handler62.js +1 -1
  41. package/dist/packem_chunks/handler63.js +1 -1
  42. package/dist/packem_chunks/handler64.js +1 -1
  43. package/dist/packem_chunks/handler65.js +1 -1
  44. package/dist/packem_chunks/handler66.js +1 -1
  45. package/dist/packem_chunks/handler67.js +1 -1
  46. package/dist/packem_chunks/handler68.js +1 -1
  47. package/dist/packem_chunks/handler69.js +1 -1
  48. package/dist/packem_chunks/handler7.js +1 -1
  49. package/dist/packem_chunks/handler70.js +1 -1
  50. package/dist/packem_chunks/handler71.js +1 -1
  51. package/dist/packem_chunks/handler72.js +1 -1
  52. package/dist/packem_chunks/handler73.js +1 -1
  53. package/dist/packem_chunks/handler74.js +1 -1
  54. package/dist/packem_chunks/handler75.js +1 -1
  55. package/dist/packem_chunks/handler76.js +1 -1
  56. package/dist/packem_chunks/handler77.js +1 -1
  57. package/dist/packem_chunks/handler78.js +1 -1
  58. package/dist/packem_chunks/handler79.js +1 -1
  59. package/dist/packem_chunks/handler8.js +1 -1
  60. package/dist/packem_chunks/heal.js +1 -1
  61. package/dist/packem_chunks/help-command.js +1 -1
  62. package/dist/packem_chunks/index5.js +20 -20
  63. package/dist/packem_chunks/index7.js +1 -1
  64. package/dist/packem_chunks/keys-refresh.js +1 -1
  65. package/dist/packem_chunks/list.js +1 -1
  66. package/dist/packem_chunks/prune.js +1 -1
  67. package/dist/packem_chunks/status.js +1 -1
  68. package/dist/packem_chunks/sync.js +1 -1
  69. package/dist/packem_chunks/sync2.js +1 -1
  70. package/dist/packem_chunks/tripwire.js +1 -1
  71. package/dist/packem_chunks/ts-loader.js +5 -5
  72. package/dist/packem_chunks/verify-lockfile.js +1 -1
  73. package/dist/packem_shared/{advisories-O7twgy1s.js → advisories-Wk-RI-Lt.js} +1 -1
  74. package/dist/packem_shared/{affected-selection-eR52q-oc.js → affected-selection-BAEovubH.js} +1 -1
  75. package/dist/packem_shared/{ai-analysis-Doa-UG1c.js → ai-analysis-DoXQg-wK.js} +1 -1
  76. package/dist/packem_shared/{ai-cache-BLz0YM15.js → ai-cache-B9U5m9O9.js} +1 -1
  77. package/dist/packem_shared/{ai-fix-h4fgPlz8.js → ai-fix-DzPjdJFn.js} +1 -1
  78. package/dist/packem_shared/bin-DKJ6q_xR.js +1 -0
  79. package/dist/packem_shared/{build-scripts-zlct5Ggj.js → build-scripts-B7BgERlS.js} +1 -1
  80. package/dist/packem_shared/{dependency-scan-CpaMuJak.js → dependency-scan-DKp1Y0Sx.js} +1 -1
  81. package/dist/packem_shared/{detect-CrdazHI6.js → detect-DF0ZnX4w.js} +1 -1
  82. package/dist/packem_shared/{docker-ClRLF89f.js → docker-CxcZMIvs.js} +1 -1
  83. package/dist/packem_shared/{ecosystem-gate-Be06KMgT.js → ecosystem-gate-ChG-zNz5.js} +1 -1
  84. package/dist/packem_shared/{env-BZGqwX30.js → env-D0huQDyA.js} +1 -1
  85. package/dist/packem_shared/{env-consistency-DZmwPw-C.js → env-consistency-Dj56sHLM.js} +1 -1
  86. package/dist/packem_shared/{failure-log-zDUnBhop.js → failure-log-D6woYuZv.js} +1 -1
  87. package/dist/packem_shared/glob-Cyk1H9ZL-DC9cczJJ.js +1 -0
  88. package/dist/packem_shared/{index-BCMh-e5u.js → index-B3tiV1iu.js} +1 -1
  89. package/dist/packem_shared/{index-Byxjshm-.js → index-u2ABjmic.js} +1 -1
  90. package/dist/packem_shared/{lifecycle-DEgFG8Hl.js → lifecycle-DKTLZVXm.js} +1 -1
  91. package/dist/packem_shared/{manifests-BYQ08vX_.js → manifests-C3TL659D.js} +1 -1
  92. package/dist/packem_shared/{min-release-age-CmziMU7E.js → min-release-age-4Jf3-DDz.js} +1 -1
  93. package/dist/packem_shared/{missing-package-json-BzB16zXB.js → missing-package-json-wH6OInGG.js} +1 -1
  94. package/dist/packem_shared/{multi-eco-lockfiles-BaEL_JYF.js → multi-eco-lockfiles-szCMAPHo.js} +1 -1
  95. package/dist/packem_shared/{native-config-sync-Dkg3TMPR.js → native-config-sync-Dv4nFzvF.js} +1 -1
  96. package/dist/packem_shared/{osv-D8S_X2KZ.js → osv-BTClyx8h.js} +1 -1
  97. package/dist/packem_shared/{package-version-C7WbQEnJ.js → package-version-CtgyD_B1.js} +1 -1
  98. package/dist/packem_shared/{packument-DE9EI2oo.js → packument-BOiBtGV2.js} +1 -1
  99. package/dist/packem_shared/{project-name-filter-xCPw_fxK.js → project-name-filter-CVtU8rSE.js} +1 -1
  100. package/dist/packem_shared/{provenance-UZNpYcAR.js → provenance-DRntJArZ.js} +1 -1
  101. package/dist/packem_shared/{registry-D65qizQE.js → registry-Dmy6zBD8.js} +1 -1
  102. package/dist/packem_shared/{registry-keys-C66uhEbp.js → registry-keys-C5UDzK6U.js} +1 -1
  103. package/dist/packem_shared/{renderToString-DR0zDUjh-CS7RIyZE.js → renderToString-DR0zDUjh-BeCb092p.js} +1 -1
  104. package/dist/packem_shared/{resolve-explicit-BEsg7ZYh.js → resolve-explicit-ChxnXt-x.js} +1 -1
  105. package/dist/packem_shared/{run-summary-utils-BrgoXV-3.js → run-summary-utils-Co-yODTZ.js} +1 -1
  106. package/dist/packem_shared/{runtime-check-mhNpo3ah.js → runtime-check-CRNoD5DL.js} +1 -1
  107. package/dist/packem_shared/{s1ngularity-DFKNfAgy.js → s1ngularity-DCurn2c1.js} +1 -1
  108. package/dist/packem_shared/{scaffold-files-DAU7B6Cw.js → scaffold-files-D0whWHeH.js} +1 -1
  109. package/dist/packem_shared/{scan-progress-CgzPrpwB.js → scan-progress-B6BSwS4F.js} +1 -1
  110. package/dist/packem_shared/{selectors-CUK5421Y.js → selectors-DrrBSBOS.js} +1 -1
  111. package/dist/packem_shared/{signatures-DJcxx8KS.js → signatures-DHnVndR8.js} +1 -1
  112. package/dist/packem_shared/{spinner-DTKCtuC-.js → spinner-B9D3Fl1H.js} +1 -1
  113. package/dist/packem_shared/{table-CCIzXSUF.js → table-BT8EWIiz.js} +1 -1
  114. package/dist/packem_shared/{tabs-B9LOpICc.js → tabs-Cq8smM1S.js} +1 -1
  115. package/dist/packem_shared/{toolchain-CX-0Plms.js → toolchain-BnrrDIRc.js} +1 -1
  116. package/dist/packem_shared/{typosquats-BKUa8NgB.js → typosquats-hTQZou8a.js} +1 -1
  117. package/dist/packem_shared/{use-measured-height-BvUJvSnd.js → use-measured-height-tg-5qUrj.js} +1 -1
  118. package/dist/packem_shared/{vis-update-app-DxnZ8owK.js → vis-update-app-BUqiU_Zo.js} +1 -1
  119. package/dist/packem_shared/{vis-user-error-BurzAV6b.js → vis-user-error-DNF243LB.js} +1 -1
  120. package/dist/packem_shared/{watch-loop-CatWMg-1.js → watch-loop-TB9JRJUD.js} +1 -1
  121. package/index.js +54 -54
  122. package/package.json +9 -9
  123. package/dist/packem_shared/bin-BlwqCNwJ.js +0 -1
  124. package/dist/packem_shared/glob-Cyk1H9ZL-DVdKvjft.js +0 -1
package/CHANGELOG.md CHANGED
@@ -1,3 +1,14 @@
1
+ ## @visulima/vis [7.1.0-next.2](https://github.com/visulima/vis/compare/@visulima/vis@7.1.0-next.1...@visulima/vis@7.1.0-next.2) (2026-11-22)
2
+
3
+ ### Features
4
+
5
+ * **vis:** list the cache subcommands for `vis cache`, `cache --help` and `cache -h` ([#149](https://github.com/visulima/vis/issues/149)) ([6b800ee](https://github.com/visulima/vis/commit/6b800eeea1c0aa3d8b16ee2299d8ee4dea91ce20))
6
+ * **vis:** serve an evaluated vis.config from a revalidating cache in the native CLI ([#150](https://github.com/visulima/vis/issues/150)) ([0c4781f](https://github.com/visulima/vis/commit/0c4781fa90a2c21c06eeb375ebcfc8d5e113f513))
7
+
8
+ ### Tests
9
+
10
+ * **vis:** share one routing fixture between the launcher and the native binary ([#148](https://github.com/visulima/vis/issues/148)) ([25de704](https://github.com/visulima/vis/commit/25de704151b3be74d62c26f9b54c287c3ec8d51e))
11
+
1
12
  ## @visulima/vis [7.1.0-next.1](https://github.com/visulima/vis/compare/@visulima/vis@7.0.0...@visulima/vis@7.1.0-next.1) (2026-11-22)
2
13
 
3
14
  ### Features
@@ -0,0 +1,40 @@
1
+ // Command groups that have no command of their own (`cache`): the parser finds nothing to run for
2
+ // `vis <group>`, `vis <group> --help` and `vis <group> -h`, so the Node CLI answers them with the
3
+ // output of `vis help <group>`. The native binary does the same (`GROUP_LISTINGS` in
4
+ // `native/cli/src/surface.rs`, which has to list the same groups) and the launcher
5
+ // (`bin/route.mjs`) hands the bare group to it. Free of side effects, like `route.mjs`.
6
+
7
+ const GROUP_LISTINGS = ["cache"];
8
+
9
+ const VALUELESS_GLOBAL_FLAGS = new Set(["--color", "--debug", "--no-color", "--quiet", "--verbose", "-q", "-v"]);
10
+ const HELP_FLAGS = new Set(["--help", "-h"]);
11
+
12
+ /**
13
+ * The invocation `vis help <group>` that stands in for a group invocation, with the exit code to
14
+ * finish with: 0 when help was asked for, 1 for the bare group, which is a usage error.
15
+ *
16
+ * Returns `undefined` for anything else; only valueless global flags may accompany the group.
17
+ * @param {ReadonlyArray<string>} argv the arguments after `vis`
18
+ * @returns {{ argv: string[]; exitCode: 0 | 1 } | undefined} the stand-in invocation and exit code
19
+ */
20
+ const groupListing = (argv) => {
21
+ const start = argv.findIndex((argument) => !VALUELESS_GLOBAL_FLAGS.has(argument));
22
+ const group = argv[start];
23
+
24
+ if (group === undefined || !GROUP_LISTINGS.includes(group)) {
25
+ return undefined;
26
+ }
27
+
28
+ const flags = argv.slice(start + 1);
29
+
30
+ if (!flags.every((flag) => HELP_FLAGS.has(flag) || VALUELESS_GLOBAL_FLAGS.has(flag))) {
31
+ return undefined;
32
+ }
33
+
34
+ // The global flags carry over to the help invocation, in their order.
35
+ const carried = argv.filter((argument) => argument !== group && !HELP_FLAGS.has(argument));
36
+
37
+ return { argv: ["help", group, ...carried], exitCode: flags.some((flag) => HELP_FLAGS.has(flag)) ? 0 : 1 };
38
+ };
39
+
40
+ export { GROUP_LISTINGS, groupListing };
package/bin/route.mjs CHANGED
@@ -1,6 +1,8 @@
1
1
  import { existsSync } from "node:fs";
2
2
  import { dirname, join } from "node:path";
3
3
 
4
+ import { GROUP_LISTINGS } from "./group-listing.mjs";
5
+
4
6
  // Which `vis` invocations the Node launcher (`bin/vis.mjs`) hands to the native
5
7
  // binary. Kept free of side effects so the routing table is unit-testable without
6
8
  // a binary, the same way `resolve-binary.mjs` is shared.
@@ -210,6 +212,13 @@ const routesCommandToNative = (args, platform, environment, cwd, interactive, ho
210
212
  return helpOrNative(args, () => cleanMayRunNatively(platform, environment, args, interactive));
211
213
  }
212
214
 
215
+ // A bare command group lists its subcommands, which the binary answers like `<group> --help` (any
216
+ // other shape is Node's, which prints the same listing). The binary enables virtual-terminal
217
+ // processing, so Windows answers it natively too.
218
+ if (GROUP_LISTINGS.includes(command) && args.length === 1) {
219
+ return true;
220
+ }
221
+
213
222
  // `complete --` is the dynamic endpoint the generated completion scripts call on
214
223
  // every <TAB>; any other `complete` shape is not a native command, so it stays
215
224
  // in-process (script generation is `vis completion --shell=<shell>`, Node's too).
package/dist/bin.js CHANGED
@@ -1 +1 @@
1
- import"./packem_shared/compile-cache-DoMHRsRZ.js";import"./packem_shared/bin-BlwqCNwJ.js";
1
+ import"./packem_shared/compile-cache-DoMHRsRZ.js";import"./packem_shared/bin-DKJ6q_xR.js";
package/dist/binx.js CHANGED
@@ -1,3 +1,3 @@
1
1
  #!/usr/bin/env node
2
- import{a as r,x as i,i as c,d as a,r as d}from"./packem_shared/vis-user-error-BurzAV6b.js";import{t as n}from"./packem_shared/compile-cache-DoMHRsRZ.js";import{g as o}from"./packem_shared/package-version-C7WbQEnJ.js";process.argv.includes("--no-color")&&(process.env.NO_COLOR="1",process.env.FORCE_COLOR="0");process.argv.slice(2).some(s=>s==="--version"||s==="-v"||s==="-V")&&(process.stdout.write(`${o()}
2
+ import{a as r,x as i,i as c,d as a,r as d}from"./packem_shared/vis-user-error-DNF243LB.js";import{t as n}from"./packem_shared/compile-cache-DoMHRsRZ.js";import{g as o}from"./packem_shared/package-version-CtgyD_B1.js";process.argv.includes("--no-color")&&(process.env.NO_COLOR="1",process.env.FORCE_COLOR="0");process.argv.slice(2).some(s=>s==="--version"||s==="-v"||s==="-V")&&(process.stdout.write(`${o()}
3
3
  `),process.exit(0));process.argv.splice(2,0,"dlx");n();const e=r("visx",{packageName:"visx",packageVersion:o()}),p=process.argv.includes("--debug")||!!process.env.DEBUG;e.addPlugin(i({concise:c,detailed:p,exitOnError:!1}));e.addCommand(a);d(e);
@@ -1,8 +1,8 @@
1
- import{createRequire as x}from"node:module";import{v as b,e as l,m as A}from"../packem_shared/index-0dnGN3GP.js";import{i as R}from"./ts-loader.js";import{m as V}from"../packem_shared/target-merge-ya19LiWB.js";import{otelPlugin as fe}from"../packem_shared/otelPlugin-D8LL2-4L.js";import{definePlugin as de}from"../packem_shared/definePlugin-DoUcoYSy.js";import{y as T}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";let _;const E=e=>(_??=x(import.meta.url))(e),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,g=e=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[s,t]=c.versions.node.split(".").map(Number);if(s>22||s===22&&t>=3||s===20&&t>=16)return c.getBuiltinModule(e)}return E(e)},{readdirSync:j}=g("node:fs"),{createRequire:S}=g("node:module");class f extends Error{chain;constructor(s,t,o){super(s,o),this.name=this.constructor.name,this.chain=t}}class D extends f{constructor(s,t){const o=[...t,`${s} (re-enters)`].join(" → ");super(`Config cycle: ${o}`,t)}}class v extends f{filePath;removedKeys;constructor(s,t,o){const n=[`${s} uses removed keys.`,""];for(const r of o){const i=r.location?` (at ${r.location})`:"";n.push(` • ${r.name}${i} → renamed to \`${r.renamedTo}\``);for(const a of r.children??[])n.push(` ↳ ${a.name} → renamed to \`${a.renamedTo}\``)}n.push("","Run `vis migrate self` to auto-rewrite the config (use --dry-run to preview)."),super(n.join(`
2
- `),t),this.filePath=s,this.removedKeys=o}}class h extends f{constructor(s,t,o){const n=o instanceof Error?o.message:String(o),r=t.length>0?`
3
- Chain: ${t.join(" → ")}`:"";super(`Failed to load ${s}: ${n}${r}`,t,{cause:o})}}const G=e=>e.join(" → ");class p extends f{constructor(s,t,o){const n=t.length>0?t[t.length-1]:"<unknown>",r=o.length>0?`
1
+ import{createRequire as O}from"node:module";import{v as j,e as l,m as S}from"../packem_shared/index-0dnGN3GP.js";import{i as A}from"./ts-loader.js";import{m as R}from"../packem_shared/target-merge-ya19LiWB.js";import{otelPlugin as ue}from"../packem_shared/otelPlugin-D8LL2-4L.js";import{definePlugin as le}from"../packem_shared/definePlugin-DoUcoYSy.js";import{y as b}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";let x;const _=e=>(x??=O(import.meta.url))(e),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=e=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[s,t]=c.versions.node.split(".").map(Number);if(s>22||s===22&&t>=3||s===20&&t>=16)return c.getBuiltinModule(e)}return _(e)},{readdirSync:g}=h("node:fs"),{createRequire:E}=h("node:module");class f extends Error{chain;constructor(s,t,o){super(s,o),this.name=this.constructor.name,this.chain=t}}class V extends f{constructor(s,t){const o=[...t,`${s} (re-enters)`].join(" → ");super(`Config cycle: ${o}`,t)}}class T extends f{filePath;removedKeys;constructor(s,t,o){const n=[`${s} uses removed keys.`,""];for(const r of o){const i=r.location?` (at ${r.location})`:"";n.push(` • ${r.name}${i} → renamed to \`${r.renamedTo}\``);for(const a of r.children??[])n.push(` ↳ ${a.name} → renamed to \`${a.renamedTo}\``)}n.push("","Run `vis migrate self` to auto-rewrite the config (use --dry-run to preview)."),super(n.join(`
2
+ `),t),this.filePath=s,this.removedKeys=o}}class y extends f{constructor(s,t,o){const n=o instanceof Error?o.message:String(o),r=t.length>0?`
3
+ Chain: ${t.join(" → ")}`:"";super(`Failed to load ${s}: ${n}${r}`,t,{cause:o})}}const D=e=>e.join(" → ");class p extends f{constructor(s,t,o){const n=t.length>0?t[t.length-1]:"<unknown>",r=o.length>0?`
4
4
  Tried:
5
5
  ${o.join(`
6
6
  `)}`:"";super(`Cannot resolve "${s}" extended from ${n}.${r}
7
- Chain: ${G(t)}`,t)}}class I extends f{filePath;violations;constructor(s,t,o){const n=[`${s} has an invalid value.`,""];for(const r of o)n.push(` • ${r.location} — expected ${r.expected}, found ${r.found}`);n.push("","See https://visulima.com/docs/packages/vis/configuration for the expected shape."),super(n.join(`
8
- `),t),this.filePath=s,this.violations=o}}const N=e=>{const s=[];if(Object.hasOwn(e,"targetDefaults")&&s.push({name:"targetDefaults",renamedTo:"tasks"}),Object.hasOwn(e,"taskRunnerOptions")&&s.push({name:"taskRunnerOptions",renamedTo:"taskRunner"}),Object.hasOwn(e,"taskDefaults")){const{taskDefaults:t}=e,o=[];if(Array.isArray(t))for(const[n,r]of t.entries())r&&typeof r=="object"&&(Object.hasOwn(r,"scope")&&o.push({location:`taskDefaults[${n}].scope`,name:"scope",renamedTo:"match"}),Object.hasOwn(r,"targets")&&o.push({location:`taskDefaults[${n}].targets`,name:"targets",renamedTo:"tasks"}));s.push({children:o.length>0?o:void 0,name:"taskDefaults",renamedTo:"scopedTasks"})}else if(Array.isArray(e.scopedTasks))for(const[t,o]of e.scopedTasks.entries())o&&typeof o=="object"&&(Object.hasOwn(o,"scope")&&s.push({location:`scopedTasks[${t}].scope`,name:"scope",renamedTo:"match"}),Object.hasOwn(o,"targets")&&s.push({location:`scopedTasks[${t}].targets`,name:"targets",renamedTo:"tasks"}));return s},F=e=>Object.hasOwn(e,"targets")&&!Object.hasOwn(e,"tasks")?[{name:"targets",renamedTo:"tasks"}]:[],L=(e,s,t)=>{if(!t||typeof t!="object")return;const o=N(t);if(o.length>0)throw new v(e,s,o)},q=(e,s,t)=>{if(!t||typeof t!="object")return;const o=F(t);if(o.length>0)throw new v(e,s,o)},d=e=>{if(e===null)return"null";if(Array.isArray(e))return"an array";if(typeof e=="object"){const s=Object.keys(e);return s.length>0?`an object with { ${s.join(", ")} }`:"an empty object"}return typeof e},k=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),K=e=>{const s=[];if(!Object.hasOwn(e,"scopedTasks")||e.scopedTasks===void 0)return s;const{scopedTasks:t}=e;if(!Array.isArray(t))return s.push({expected:"an array of `{ match?, tasks }` blocks",found:d(t),location:"scopedTasks"}),s;for(const[o,n]of t.entries()){const r=`scopedTasks[${o}]`;if(!k(n)){s.push({expected:"a `{ match?, tasks }` block",found:d(n),location:r});continue}k(n.tasks)||s.push({expected:"`tasks` to be an object keyed by target name",found:n.tasks===void 0?`a block with { ${Object.keys(n).join(", ")} }`:d(n.tasks),location:`${r}.tasks`}),n.match!==void 0&&!k(n.match)&&s.push({expected:"`match` to be an object of project constraints",found:d(n.match),location:`${r}.match`})}return s},P=(e,s,t)=>{if(!t||typeof t!="object")return;const o=K(t);if(o.length>0)throw new I(e,s,o)},w=["vis.config.ts","vis.config.mts","vis.config.cts","vis.config.js","vis.config.mjs","vis.config.cjs"],M=new Set(w),C=["vis.task.ts","vis.task.mts","vis.task.cts","vis.task.js","vis.task.mjs","vis.task.cjs"],U=new Set(C),te=2880,m={blockExoticSubdeps:!0,policies:{installScripts:{strict:!0},publisherChange:{ignoreAfter:43200,mode:"no-downgrade"}}},W=e=>{if(!e)return{...m};const s=m.policies??{},t=e.policies??{},o={...s,...t};for(const n of Object.keys(s)){const r=s[n],i=t[n];r!==void 0&&i!==void 0&&(o[n]={...r,...i})}return{...m,...e,policies:o}},y=e=>({...e,security:W(e.security),update:{security:!0,target:"minor",...e.update}}),B=e=>{let s;try{s=j(e)}catch{return}const t=new Set(s.filter(o=>M.has(o)));for(const o of w)if(t.has(o))return l(e,o)},z=e=>{let s;try{s=j(e)}catch{return}const t=new Set(s.filter(o=>U.has(o)));for(const o of C)if(t.has(o))return l(e,o)},Y=e=>e===void 0?[]:Array.isArray(e)?e:[e],H=(e,s,t)=>{if(b(e))throw new p(e,[...t,s],["Absolute paths in `extends` are not supported. Use a relative path or an npm package name."]);const o=[];if(e.startsWith("./")||e.startsWith("../")){const n=A(s),r=l(n,e);if(o.push(r),T(r))return r;throw new p(e,[...t,s],o)}try{return S(s).resolve(e)}catch{throw o.push(`require.resolve("${e}") from ${s}`),new p(e,[...t,s],o)}},$=async(e,s)=>{let t;try{t=(await R(e)).default??{}}catch(o){throw new h(e,s,o)}try{return(typeof t=="function"?await t()??{}:t)??{}}catch(o){throw new h(e,s,o)}},J=(e,s)=>{const t={...e,...s};if(e.tasks||s.tasks){const o=new Set([...Object.keys(e.tasks??{}),...Object.keys(s.tasks??{})]),n={};for(const r of o)n[r]=V(e.tasks?.[r],s.tasks?.[r]);t.tasks=n}if((e.scopedTasks||s.scopedTasks)&&(t.scopedTasks=[...e.scopedTasks??[],...s.scopedTasks??[]]),(e.fileGroups||s.fileGroups)&&(t.fileGroups={...e.fileGroups,...s.fileGroups}),(e.taskGroups||s.taskGroups)&&(t.taskGroups={...e.taskGroups,...s.taskGroups}),e.security||s.security){const o=e.security?.policies??{},n=s.security?.policies??{},r={...o,...n};for(const i of Object.keys(o)){const a=o[i],u=n[i];a!==void 0&&u!==void 0&&(r[i]={...a,...u})}t.security={...e.security,...s.security,acceptedRisks:{...e.security?.acceptedRisks,...s.security?.acceptedRisks},policies:r}}return(e.update||s.update)&&(t.update={...e.update,...s.update}),(e.taskRunner||s.taskRunner)&&(t.taskRunner={...e.taskRunner,...s.taskRunner}),delete t.extends,t},O=async(e,s,t,o,n)=>{if(t.has(e))throw new D(e,s);if(!o.has(e)){t.add(e);try{const r=await $(e,s);L(e,s,r),P(e,s,r);const i=Y(r.extends);for(const a of i){const u=H(a,e,s);await O(u,[...s,e],t,o,n)}o.set(e,r),n.push(e)}finally{t.delete(e)}}},oe=async(e,s)=>{let t;if(s?.explicitConfigPath){const a=b(s.explicitConfigPath)?s.explicitConfigPath:l(e,s.explicitConfigPath);if(!T(a))throw new Error(`Cannot find config file at ${a}`);t=a}else t=B(e);if(!t)return y({});const o=new Set,n=new Map,r=[];await O(t,[],o,n,r);let i={};for(const a of r)i=J(i,n.get(a));return y(i)},ne=async(e,s,t)=>{const o=z(s);if(!o)return;const n=await $(o,[]);return q(o,[],n),n},re=e=>e,ie=e=>e;export{w as CONFIG_FILES,te as DEFAULT_MIN_RELEASE_AGE_MINUTES,m as SECURITY_DEFAULTS,C as TASK_CONFIG_FILES,y as applyDefaults,ie as defineConfig,de as definePlugin,re as defineTaskConfig,B as findVisConfigFile,z as findVisTaskConfigFile,oe as loadVisConfig,ne as loadVisTaskConfig,fe as otelPlugin};
7
+ Chain: ${D(t)}`,t)}}class G extends f{filePath;violations;constructor(s,t,o){const n=[`${s} has an invalid value.`,""];for(const r of o)n.push(` • ${r.location} — expected ${r.expected}, found ${r.found}`);n.push("","See https://visulima.com/docs/packages/vis/configuration for the expected shape."),super(n.join(`
8
+ `),t),this.filePath=s,this.violations=o}}const I=e=>{const s=[];if(Object.hasOwn(e,"targetDefaults")&&s.push({name:"targetDefaults",renamedTo:"tasks"}),Object.hasOwn(e,"taskRunnerOptions")&&s.push({name:"taskRunnerOptions",renamedTo:"taskRunner"}),Object.hasOwn(e,"taskDefaults")){const{taskDefaults:t}=e,o=[];if(Array.isArray(t))for(const[n,r]of t.entries())r&&typeof r=="object"&&(Object.hasOwn(r,"scope")&&o.push({location:`taskDefaults[${n}].scope`,name:"scope",renamedTo:"match"}),Object.hasOwn(r,"targets")&&o.push({location:`taskDefaults[${n}].targets`,name:"targets",renamedTo:"tasks"}));s.push({children:o.length>0?o:void 0,name:"taskDefaults",renamedTo:"scopedTasks"})}else if(Array.isArray(e.scopedTasks))for(const[t,o]of e.scopedTasks.entries())o&&typeof o=="object"&&(Object.hasOwn(o,"scope")&&s.push({location:`scopedTasks[${t}].scope`,name:"scope",renamedTo:"match"}),Object.hasOwn(o,"targets")&&s.push({location:`scopedTasks[${t}].targets`,name:"targets",renamedTo:"tasks"}));return s},N=e=>Object.hasOwn(e,"targets")&&!Object.hasOwn(e,"tasks")?[{name:"targets",renamedTo:"tasks"}]:[],F=(e,s,t)=>{if(!t||typeof t!="object")return;const o=I(t);if(o.length>0)throw new T(e,s,o)},L=(e,s,t)=>{if(!t||typeof t!="object")return;const o=N(t);if(o.length>0)throw new T(e,s,o)},d=e=>{if(e===null)return"null";if(Array.isArray(e))return"an array";if(typeof e=="object"){const s=Object.keys(e);return s.length>0?`an object with { ${s.join(", ")} }`:"an empty object"}return typeof e},k=e=>typeof e=="object"&&e!==null&&!Array.isArray(e),q=e=>{const s=[];if(!Object.hasOwn(e,"scopedTasks")||e.scopedTasks===void 0)return s;const{scopedTasks:t}=e;if(!Array.isArray(t))return s.push({expected:"an array of `{ match?, tasks }` blocks",found:d(t),location:"scopedTasks"}),s;for(const[o,n]of t.entries()){const r=`scopedTasks[${o}]`;if(!k(n)){s.push({expected:"a `{ match?, tasks }` block",found:d(n),location:r});continue}k(n.tasks)||s.push({expected:"`tasks` to be an object keyed by target name",found:n.tasks===void 0?`a block with { ${Object.keys(n).join(", ")} }`:d(n.tasks),location:`${r}.tasks`}),n.match!==void 0&&!k(n.match)&&s.push({expected:"`match` to be an object of project constraints",found:d(n.match),location:`${r}.match`})}return s},K=(e,s,t)=>{if(!t||typeof t!="object")return;const o=q(t);if(o.length>0)throw new G(e,s,o)},v=["vis.config.ts","vis.config.mts","vis.config.cts","vis.config.js","vis.config.mjs","vis.config.cjs"],M=new Set(v),w=["vis.task.ts","vis.task.mts","vis.task.cts","vis.task.js","vis.task.mjs","vis.task.cjs"],P=new Set(w),oe=2880,m={blockExoticSubdeps:!0,policies:{installScripts:{strict:!0},publisherChange:{ignoreAfter:43200,mode:"no-downgrade"}}},U=e=>{if(!e)return{...m};const s=m.policies??{},t=e.policies??{},o={...s,...t};for(const n of Object.keys(s)){const r=s[n],i=t[n];r!==void 0&&i!==void 0&&(o[n]={...r,...i})}return{...m,...e,policies:o}},W=e=>({...e,security:U(e.security),update:{security:!0,target:"minor",...e.update}}),B=e=>{let s;try{s=g(e)}catch{return}const t=new Set(s.filter(o=>M.has(o)));for(const o of v)if(t.has(o))return l(e,o)},z=e=>{let s;try{s=g(e)}catch{return}const t=new Set(s.filter(o=>P.has(o)));for(const o of w)if(t.has(o))return l(e,o)},Y=e=>e===void 0?[]:Array.isArray(e)?e:[e],H=(e,s,t)=>{if(j(e))throw new p(e,[...t,s],["Absolute paths in `extends` are not supported. Use a relative path or an npm package name."]);const o=[];if(e.startsWith("./")||e.startsWith("../")){const n=S(s),r=l(n,e);if(o.push(r),b(r))return r;throw new p(e,[...t,s],o)}try{return E(s).resolve(e)}catch{throw o.push(`require.resolve("${e}") from ${s}`),new p(e,[...t,s],o)}},C=async(e,s)=>{let t;try{t=(await A(e)).default??{}}catch(o){throw new y(e,s,o)}try{return(typeof t=="function"?await t()??{}:t)??{}}catch(o){throw new y(e,s,o)}},J=(e,s)=>{const t={...e,...s};if(e.tasks||s.tasks){const o=new Set([...Object.keys(e.tasks??{}),...Object.keys(s.tasks??{})]),n={};for(const r of o)n[r]=R(e.tasks?.[r],s.tasks?.[r]);t.tasks=n}if((e.scopedTasks||s.scopedTasks)&&(t.scopedTasks=[...e.scopedTasks??[],...s.scopedTasks??[]]),(e.fileGroups||s.fileGroups)&&(t.fileGroups={...e.fileGroups,...s.fileGroups}),(e.taskGroups||s.taskGroups)&&(t.taskGroups={...e.taskGroups,...s.taskGroups}),e.security||s.security){const o=e.security?.policies??{},n=s.security?.policies??{},r={...o,...n};for(const i of Object.keys(o)){const a=o[i],u=n[i];a!==void 0&&u!==void 0&&(r[i]={...a,...u})}t.security={...e.security,...s.security,acceptedRisks:{...e.security?.acceptedRisks,...s.security?.acceptedRisks},policies:r}}return(e.update||s.update)&&(t.update={...e.update,...s.update}),(e.taskRunner||s.taskRunner)&&(t.taskRunner={...e.taskRunner,...s.taskRunner}),delete t.extends,t},$=async(e,s,t,o,n)=>{if(t.has(e))throw new V(e,s);if(!o.has(e)){t.add(e);try{const r=await C(e,s);F(e,s,r),K(e,s,r);const i=Y(r.extends);for(const a of i){const u=H(a,e,s);await $(u,[...s,e],t,o,n)}o.set(e,r),n.push(e)}finally{t.delete(e)}}},Q=async(e,s)=>{let t;if(s?.explicitConfigPath){const a=j(s.explicitConfigPath)?s.explicitConfigPath:l(e,s.explicitConfigPath);if(!b(a))throw new Error(`Cannot find config file at ${a}`);t=a}else t=B(e);if(!t)return{};const o=new Set,n=new Map,r=[];await $(t,[],o,n,r);let i={};for(const a of r)i=J(i,n.get(a));return i},ne=async(e,s)=>W(await Q(e,s)),re=async(e,s,t)=>{const o=z(s);if(!o)return;const n=await C(o,[]);return L(o,[],n),n},ie=e=>e,ae=e=>e;export{v as CONFIG_FILES,oe as DEFAULT_MIN_RELEASE_AGE_MINUTES,m as SECURITY_DEFAULTS,w as TASK_CONFIG_FILES,W as applyDefaults,ae as defineConfig,le as definePlugin,ie as defineTaskConfig,B as findVisConfigFile,z as findVisTaskConfigFile,Q as loadMergedVisConfig,ne as loadVisConfig,re as loadVisTaskConfig,ue as otelPlugin};
@@ -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-CgzPrpwB.js";import{D as p,s as D}from"../packem_shared/osv-bloom-DU6avR2k.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)}
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-B6BSwS4F.js";import{D as p,s as D}from"../packem_shared/osv-bloom-DU6avR2k.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};
@@ -1,4 +1,4 @@
1
- import{createRequire as je}from"node:module";import{z as N,e as g,$ as _e,m as V}from"../packem_shared/index-0dnGN3GP.js";import{L as Re,q as X,u as oe,R as C,O as W,X as De,e as J,p as P,g as ce,F as I,f as Oe,G as ie,J as H,h as le,i as D}from"../packem_shared/registry-D65qizQE.js";import{L as ue}from"../packem_shared/index-CIdjkZgt.js";import{y as h}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{U as A,h as O,e as Le,i as Me}from"../packem_shared/env-BZGqwX30.js";import{f as Ue}from"../packem_shared/removeSync-g1D5kONg-jOsRSIIv.js";import{p as b}from"../packem_shared/package-version-C7WbQEnJ.js";import{g as pe,T as fe,l as Wt}from"../packem_shared/npmrc-CIvOb61L.js";import{p as cn}from"../packem_shared/npmrc-CIvOb61L.js";import{O as ge}from"../packem_shared/renderToString-DR0zDUjh-CS7RIyZE.js";import{q as We}from"../packem_shared/table-CCIzXSUF.js";import{f as Ie}from"../packem_shared/osv-D8S_X2KZ.js";import{a as Be}from"../packem_shared/index--eV4qIz5.js";import{a as Z}from"../packem_shared/advisories-O7twgy1s.js";let Ce;const Ae=t=>(Ce??=je(import.meta.url))(t),j=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xe=t=>{if(typeof j<"u"&&j.versions&&j.versions.node){const[e,n]=j.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return j.getBuiltinModule(t)}return Ae(t)},{createInterface:Fe}=xe("node:readline"),G=["dependencies","devDependencies","optionalDependencies"],Ge=new Set([...G,"overrides","peerDependencies","pnpm.overrides","resolutions"]),x=t=>{const e=t.lastIndexOf(":");if(e===-1)return;const n=t.slice(e+1);if(Ge.has(n))return{depType:n,relativePath:t.slice(0,e)}},L=t=>{const e=ue("vis",{create:!0,cwd:t});if(!e)throw new Error("Cannot resolve cache directory. Ensure node_modules exists in your workspace. Run your package manager's install command first.");return g(e,"backup")},Y=(t,e)=>e==="bun"?g(t,"package.json"):g(t,"pnpm-workspace.yaml"),K=(t,e)=>{const n=L(t),s=new Set;for(const a of e){const r=x(a.catalogName);r&&s.add(r.relativePath==="."?"package.json":g(r.relativePath,"package.json"))}if(s.size!==0){O(n);for(const a of s){const r=g(t,a);if(h(r)){const o=g(n,a),c=V(o);O(c),A(o,N(r))}}return n}},q=(t,e)=>{const n=Y(t,e),s=L(t);return g(s,`${_e(n)}.bak`)},Ve=(t,e,n)=>{if((e==="npm"||e==="yarn")&&n)return K(t,n);let s;const a=Y(t,e);if(h(a)&&(s=q(t,e),O(V(s)),A(s,N(a))),n){const r=n.filter(o=>x(o.catalogName));r.length>0&&K(t,r)}return s},Xe=t=>{const e=L(t);if(!h(e))return!1;for(const n of Re(e,{includeDirs:!1})){const s=n.path.slice(e.length+1),a=g(t,s);A(a,N(n.path))}return Ue(e),!0},Xt=(t,e)=>{if(e==="npm"||e==="yarn")return Xe(t);const n=Y(t,e),s=q(t,e);if(!h(s))return!1;const a=N(s);return A(n,a),!0},Jt=(t,e)=>{if(e==="npm"||e==="yarn")try{const n=L(t);return h(n)}catch{return!1}try{return h(q(t,e))}catch{return!1}},de=t=>{if(h(t))try{return b(t)}catch{return}},Je=t=>{const e=de(g(t,"package.json"));return!!(e?.workspaces?.catalog||e?.workspaces?.catalogs)},He=t=>{const e=new Map;if(t.workspaces?.catalog&&typeof t.workspaces.catalog=="object"&&e.set("default",new Map(Object.entries(t.workspaces.catalog))),t.workspaces?.catalogs&&typeof t.workspaces.catalogs=="object")for(const[n,s]of Object.entries(t.workspaces.catalogs))s&&typeof s=="object"&&e.set(n,new Map(Object.entries(s)));return e},Ye=t=>{const e=de(g(t,"package.json"));return e?He(e):new Map},qe=(t,e,n)=>{const s=g(t,"package.json"),a=b(s);for(const r of e)if(r.catalogName==="default")a.workspaces?.catalog&&(a.workspaces.catalog[r.packageName]=r.newRange);else{const o=a.workspaces?.catalogs?.[r.catalogName];o&&(o[r.packageName]=r.newRange)}X(s,a,{indent:oe(s,{useEditorconfig:n}),overwrite:!0})},ze=/\*+/g,Qe=/[.+^${}()|[\]\\]/g,ee=new Map,E=(t,e)=>{let n=ee.get(e);if(!n){const a=e.replaceAll(ze,"*").replaceAll(Qe,String.raw`\$&`);n=new RegExp(`^${a.replaceAll("*",".*").replaceAll("?",".")}$`),ee.set(e,n)}return n.test(t)},me=(t,e,n)=>n.some(s=>E(t,s))?!1:e.length>0?e.some(s=>E(t,s)):!0,te=new Map,he=(t,e,n)=>{if(!n)return e;const s=n[t];if(s!==void 0)return s;for(const[a,r]of Object.entries(n))if(a!==t){if(a.startsWith("/")&&a.endsWith("/")){let o=te.get(a);if(o||(o=new RegExp(a.slice(1,-1)),te.set(a,o)),o.test(t))return r}else if(E(t,a))return r}return e},Ze=/^(?:'([^']+)'|"([^"]+)"|([^:\s]+)):\s*(?:'([^']+)'|"([^"]+)"|(\S+))/,Ke=/^catalog:/m,et=/^catalogs:/m,ke=/^['"]|['"]$/g,we=t=>{const e=Ze.exec(t);if(!e)return;const n=e[1]??e[2]??e[3],s=e[4]??e[5]??e[6];if(!(!n||!s))return[n,s]},ye=(t,e,n,s)=>{t.has(e)||t.set(e,new Map);const a=t.get(e);a&&a.set(n,s)},tt=(t,e,n)=>{if(n<2)return;const s=we(e);s&&ye(t,"default",s[0],s[1])},nt=(t,e,n,s)=>{if(n===2&&e.endsWith(":"))return e.slice(0,-1).trim().replaceAll(ke,"");if(n>=4&&s){const a=we(e);a&&ye(t,s,a[0],a[1])}return s},$e=t=>t==="catalog:"||t.startsWith("catalog:")?"catalog":t==="catalogs:"||t.startsWith("catalogs:")?"catalogs":"none",st=t=>{const e=new Map;let n="none",s="";for(const a of t.split(`
1
+ import{createRequire as je}from"node:module";import{z as N,e as g,$ as _e,m as V}from"../packem_shared/index-0dnGN3GP.js";import{L as Re,q as X,u as oe,R as C,O as W,X as De,e as J,p as P,g as ce,F as I,f as Oe,G as ie,J as H,h as le,i as D}from"../packem_shared/registry-Dmy6zBD8.js";import{L as ue}from"../packem_shared/index-CIdjkZgt.js";import{y as h}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{U as A,h as O,e as Le,i as Me}from"../packem_shared/env-D0huQDyA.js";import{f as Ue}from"../packem_shared/removeSync-g1D5kONg-jOsRSIIv.js";import{p as b}from"../packem_shared/package-version-CtgyD_B1.js";import{g as pe,T as fe,l as Wt}from"../packem_shared/npmrc-CIvOb61L.js";import{p as cn}from"../packem_shared/npmrc-CIvOb61L.js";import{O as ge}from"../packem_shared/renderToString-DR0zDUjh-BeCb092p.js";import{q as We}from"../packem_shared/table-BT8EWIiz.js";import{f as Ie}from"../packem_shared/osv-BTClyx8h.js";import{a as Be}from"../packem_shared/index--eV4qIz5.js";import{a as Z}from"../packem_shared/advisories-Wk-RI-Lt.js";let Ce;const Ae=t=>(Ce??=je(import.meta.url))(t),j=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xe=t=>{if(typeof j<"u"&&j.versions&&j.versions.node){const[e,n]=j.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return j.getBuiltinModule(t)}return Ae(t)},{createInterface:Fe}=xe("node:readline"),G=["dependencies","devDependencies","optionalDependencies"],Ge=new Set([...G,"overrides","peerDependencies","pnpm.overrides","resolutions"]),x=t=>{const e=t.lastIndexOf(":");if(e===-1)return;const n=t.slice(e+1);if(Ge.has(n))return{depType:n,relativePath:t.slice(0,e)}},L=t=>{const e=ue("vis",{create:!0,cwd:t});if(!e)throw new Error("Cannot resolve cache directory. Ensure node_modules exists in your workspace. Run your package manager's install command first.");return g(e,"backup")},Y=(t,e)=>e==="bun"?g(t,"package.json"):g(t,"pnpm-workspace.yaml"),K=(t,e)=>{const n=L(t),s=new Set;for(const a of e){const r=x(a.catalogName);r&&s.add(r.relativePath==="."?"package.json":g(r.relativePath,"package.json"))}if(s.size!==0){O(n);for(const a of s){const r=g(t,a);if(h(r)){const o=g(n,a),c=V(o);O(c),A(o,N(r))}}return n}},q=(t,e)=>{const n=Y(t,e),s=L(t);return g(s,`${_e(n)}.bak`)},Ve=(t,e,n)=>{if((e==="npm"||e==="yarn")&&n)return K(t,n);let s;const a=Y(t,e);if(h(a)&&(s=q(t,e),O(V(s)),A(s,N(a))),n){const r=n.filter(o=>x(o.catalogName));r.length>0&&K(t,r)}return s},Xe=t=>{const e=L(t);if(!h(e))return!1;for(const n of Re(e,{includeDirs:!1})){const s=n.path.slice(e.length+1),a=g(t,s);A(a,N(n.path))}return Ue(e),!0},Xt=(t,e)=>{if(e==="npm"||e==="yarn")return Xe(t);const n=Y(t,e),s=q(t,e);if(!h(s))return!1;const a=N(s);return A(n,a),!0},Jt=(t,e)=>{if(e==="npm"||e==="yarn")try{const n=L(t);return h(n)}catch{return!1}try{return h(q(t,e))}catch{return!1}},de=t=>{if(h(t))try{return b(t)}catch{return}},Je=t=>{const e=de(g(t,"package.json"));return!!(e?.workspaces?.catalog||e?.workspaces?.catalogs)},He=t=>{const e=new Map;if(t.workspaces?.catalog&&typeof t.workspaces.catalog=="object"&&e.set("default",new Map(Object.entries(t.workspaces.catalog))),t.workspaces?.catalogs&&typeof t.workspaces.catalogs=="object")for(const[n,s]of Object.entries(t.workspaces.catalogs))s&&typeof s=="object"&&e.set(n,new Map(Object.entries(s)));return e},Ye=t=>{const e=de(g(t,"package.json"));return e?He(e):new Map},qe=(t,e,n)=>{const s=g(t,"package.json"),a=b(s);for(const r of e)if(r.catalogName==="default")a.workspaces?.catalog&&(a.workspaces.catalog[r.packageName]=r.newRange);else{const o=a.workspaces?.catalogs?.[r.catalogName];o&&(o[r.packageName]=r.newRange)}X(s,a,{indent:oe(s,{useEditorconfig:n}),overwrite:!0})},ze=/\*+/g,Qe=/[.+^${}()|[\]\\]/g,ee=new Map,E=(t,e)=>{let n=ee.get(e);if(!n){const a=e.replaceAll(ze,"*").replaceAll(Qe,String.raw`\$&`);n=new RegExp(`^${a.replaceAll("*",".*").replaceAll("?",".")}$`),ee.set(e,n)}return n.test(t)},me=(t,e,n)=>n.some(s=>E(t,s))?!1:e.length>0?e.some(s=>E(t,s)):!0,te=new Map,he=(t,e,n)=>{if(!n)return e;const s=n[t];if(s!==void 0)return s;for(const[a,r]of Object.entries(n))if(a!==t){if(a.startsWith("/")&&a.endsWith("/")){let o=te.get(a);if(o||(o=new RegExp(a.slice(1,-1)),te.set(a,o)),o.test(t))return r}else if(E(t,a))return r}return e},Ze=/^(?:'([^']+)'|"([^"]+)"|([^:\s]+)):\s*(?:'([^']+)'|"([^"]+)"|(\S+))/,Ke=/^catalog:/m,et=/^catalogs:/m,ke=/^['"]|['"]$/g,we=t=>{const e=Ze.exec(t);if(!e)return;const n=e[1]??e[2]??e[3],s=e[4]??e[5]??e[6];if(!(!n||!s))return[n,s]},ye=(t,e,n,s)=>{t.has(e)||t.set(e,new Map);const a=t.get(e);a&&a.set(n,s)},tt=(t,e,n)=>{if(n<2)return;const s=we(e);s&&ye(t,"default",s[0],s[1])},nt=(t,e,n,s)=>{if(n===2&&e.endsWith(":"))return e.slice(0,-1).trim().replaceAll(ke,"");if(n>=4&&s){const a=we(e);a&&ye(t,s,a[0],a[1])}return s},$e=t=>t==="catalog:"||t.startsWith("catalog:")?"catalog":t==="catalogs:"||t.startsWith("catalogs:")?"catalogs":"none",st=t=>{const e=new Map;let n="none",s="";for(const a of t.split(`
2
2
  `)){const r=a.trimStart(),o=a.length-r.length;if(o===0&&r.length>0&&!r.startsWith("#")){n=$e(r),n==="catalogs"&&(s="");continue}r.length===0||r.startsWith("#")||(n==="catalog"&&tt(e,r,o),n==="catalogs"&&(s=nt(e,r,o,s)))}return e},at=t=>{const e=g(t,"pnpm-workspace.yaml");if(!h(e))return!1;const n=N(e);return Ke.test(n)||et.test(n)},rt=t=>{const e=g(t,"pnpm-workspace.yaml");if(!h(e))return new Map;const n=N(e);return st(n)},ne=/[.*+?^${}()|[\]\\]/g,ot=(t,e)=>{const n=t.replaceAll(ne,String.raw`\$&`),s=e.replaceAll(ne,String.raw`\$&`);return new RegExp(String.raw`^(?:'${n}'|"${n}"|${n}):\s*['"]?${s}['"]?`)},ct=(t,e,n)=>ot(e,n).test(t),it=t=>{const e=new Map;for(const n of t){e.has(n.catalogName)||e.set(n.catalogName,new Map);const s=e.get(n.catalogName);s&&s.set(n.packageName,{newRange:n.newRange,oldRange:n.currentRange})}return e},se=(t,e,n)=>{if(!n)return t;for(const[s,{newRange:a,oldRange:r}]of n)if(ct(e,s,r))return t.replace(r,a);return t},lt=(t,e,n,s)=>{const a=t.trimStart(),r=t.length-a.length;return a.length===0||a.startsWith("#")?t:e==="catalog"&&r>=2?se(t,a,s.get("default")):e==="catalogs"&&r>=4&&n?se(t,a,s.get(n)):t},ut=(t,e)=>{const n=g(t,"pnpm-workspace.yaml"),a=N(n).split(`
3
3
  `),r=it(e);let o="none",c="";const i=[];for(const l of a){const u=l.trimStart(),p=l.length-u.length;p===0&&u.length>0&&!u.startsWith("#")&&(o=$e(u),o==="catalogs"&&(c="")),o==="catalogs"&&p===2&&u.endsWith(":")&&(c=u.slice(0,-1).trim().replaceAll(ke,"")),i.push(lt(l,o,c,r))}A(n,i.join(`
4
4
  `))},pt=/github\.com[/:]([\w.-]+)\/([\w.-]+?)(?:\.git|\/|$)/,Ht=async(t,e=1e4,n)=>{const s=[],a=new AbortController,r=setTimeout(()=>{a.abort()},e),o=async u=>{const p=`https://www.npmjs.com/package/${u.packageName}`;try{const f=n?pe(u.packageName,n):{url:"https://registry.npmjs.org"},w=f.url.replace(fe,""),y={Accept:"application/json"};f.token&&(y.Authorization=`Bearer ${f.token}`);const m=await fetch(`${w}/${u.packageName}/latest`,{headers:y,signal:a.signal});if(!m.ok)return{npmUrl:p,packageName:u.packageName};const $=(await m.json()).repository?.url;if(!$)return{npmUrl:p,packageName:u.packageName};const d=pt.exec($);if(!d)return{npmUrl:p,packageName:u.packageName,repoUrl:$};const v=d[1],T=d[2],k=`https://github.com/${v}/${T}/releases/tag/v${u.targetVersion}`;return{npmUrl:p,packageName:u.packageName,releaseUrl:k,repoUrl:`https://github.com/${v}/${T}`}}catch{return{npmUrl:p,packageName:u.packageName}}},c=Math.min(8,t.length);let i=0;const l=async()=>{for(;i<t.length;){const u=i;i+=1,s[u]=await o(t[u])}};try{await Promise.all(Array.from({length:c},()=>l()))}finally{clearTimeout(r)}return s},Yt=t=>JSON.stringify(t,void 0,2),qt=t=>t.map(e=>`${e.packageName} ${e.currentRange} → ${e.newRange}`).join(`
@@ -1 +1 @@
1
- import{a as r,x as o,d as i,r as n,i as s}from"../packem_shared/vis-user-error-BurzAV6b.js";import{e as t}from"../packem_shared/index-BCMh-e5u.js";import{g as d}from"../packem_shared/package-version-C7WbQEnJ.js";const g=async()=>{const e=r("vis",{packageName:"vis",packageVersion:d()}),a=process.argv.includes("--debug")||!!process.env.DEBUG;e.addPlugin(o({concise:s,detailed:a,exitOnError:!1})),e.addGlobalOption({description:"Target JS runtime: node (default) or bun. Overrides VIS_RUNTIME; falls back to lockfile detection.",name:"runtime",type:String}),e.addCommand(t),e.addCommand(i),await n(e)};export{g as runExecCli};
1
+ import{a as r,x as o,d as i,r as n,i as s}from"../packem_shared/vis-user-error-DNF243LB.js";import{e as t}from"../packem_shared/index-B3tiV1iu.js";import{g as d}from"../packem_shared/package-version-CtgyD_B1.js";const g=async()=>{const e=r("vis",{packageName:"vis",packageVersion:d()}),a=process.argv.includes("--debug")||!!process.env.DEBUG;e.addPlugin(o({concise:s,detailed:a,exitOnError:!1})),e.addGlobalOption({description:"Target JS runtime: node (default) or bun. Overrides VIS_RUNTIME; falls back to lockfile detection.",name:"runtime",type:String}),e.addCommand(t),e.addCommand(i),await n(e)};export{g as runExecCli};