@visulima/vis 6.7.0 → 7.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (130) hide show
  1. package/CHANGELOG.md +68 -0
  2. package/README.md +31 -0
  3. package/bin/route.mjs +256 -0
  4. package/bin/vis +7 -0
  5. package/bin/vis.mjs +25 -31
  6. package/dist/bin.js +1 -1
  7. package/dist/binx.js +1 -1
  8. package/dist/config/index.d.ts +16 -1
  9. package/dist/packem_chunks/bloom-sync.js +1 -1
  10. package/dist/packem_chunks/catalog.js +1 -1
  11. package/dist/packem_chunks/cli-exec.js +1 -1
  12. package/dist/packem_chunks/cli-main.js +88 -88
  13. package/dist/packem_chunks/fix.js +1 -1
  14. package/dist/packem_chunks/handler10.js +1 -1
  15. package/dist/packem_chunks/handler12.js +1 -1
  16. package/dist/packem_chunks/handler13.js +1 -1
  17. package/dist/packem_chunks/handler14.js +1 -1
  18. package/dist/packem_chunks/handler15.js +1 -1
  19. package/dist/packem_chunks/handler19.js +1 -1
  20. package/dist/packem_chunks/handler2.js +1 -1
  21. package/dist/packem_chunks/handler20.js +1 -1
  22. package/dist/packem_chunks/handler21.js +1 -1
  23. package/dist/packem_chunks/handler23.js +1 -1
  24. package/dist/packem_chunks/handler24.js +1 -1
  25. package/dist/packem_chunks/handler25.js +1 -1
  26. package/dist/packem_chunks/handler26.js +1 -1
  27. package/dist/packem_chunks/handler28.js +1 -1
  28. package/dist/packem_chunks/handler3.js +1 -1
  29. package/dist/packem_chunks/handler4.js +1 -1
  30. package/dist/packem_chunks/handler46.js +1 -1
  31. package/dist/packem_chunks/handler5.js +1 -1
  32. package/dist/packem_chunks/handler50.js +1 -1
  33. package/dist/packem_chunks/handler51.js +1 -1
  34. package/dist/packem_chunks/handler52.js +1 -1
  35. package/dist/packem_chunks/handler54.js +1 -1
  36. package/dist/packem_chunks/handler55.js +1 -1
  37. package/dist/packem_chunks/handler56.js +1 -1
  38. package/dist/packem_chunks/handler58.js +1 -1
  39. package/dist/packem_chunks/handler59.js +1 -1
  40. package/dist/packem_chunks/handler6.js +1 -1
  41. package/dist/packem_chunks/handler60.js +1 -1
  42. package/dist/packem_chunks/handler61.js +1 -1
  43. package/dist/packem_chunks/handler62.js +1 -1
  44. package/dist/packem_chunks/handler63.js +1 -1
  45. package/dist/packem_chunks/handler64.js +1 -1
  46. package/dist/packem_chunks/handler65.js +1 -1
  47. package/dist/packem_chunks/handler66.js +1 -1
  48. package/dist/packem_chunks/handler67.js +1 -1
  49. package/dist/packem_chunks/handler68.js +1 -1
  50. package/dist/packem_chunks/handler69.js +25 -37
  51. package/dist/packem_chunks/handler7.js +1 -1
  52. package/dist/packem_chunks/handler70.js +50 -25
  53. package/dist/packem_chunks/handler71.js +1 -1
  54. package/dist/packem_chunks/handler72.js +1 -1
  55. package/dist/packem_chunks/handler73.js +6 -6
  56. package/dist/packem_chunks/handler74.js +1 -1
  57. package/dist/packem_chunks/handler75.js +1 -1
  58. package/dist/packem_chunks/handler76.js +1 -1
  59. package/dist/packem_chunks/handler77.js +1 -1
  60. package/dist/packem_chunks/handler78.js +1 -1
  61. package/dist/packem_chunks/handler79.js +1 -1
  62. package/dist/packem_chunks/handler8.js +1 -1
  63. package/dist/packem_chunks/heal.js +1 -1
  64. package/dist/packem_chunks/help-command.js +1 -1
  65. package/dist/packem_chunks/index7.js +1 -1
  66. package/dist/packem_chunks/keys-refresh.js +1 -1
  67. package/dist/packem_chunks/list.js +1 -1
  68. package/dist/packem_chunks/prune.js +1 -1
  69. package/dist/packem_chunks/status.js +1 -1
  70. package/dist/packem_chunks/sync.js +1 -1
  71. package/dist/packem_chunks/sync2.js +1 -1
  72. package/dist/packem_chunks/tripwire.js +1 -1
  73. package/dist/packem_chunks/verify-lockfile.js +1 -1
  74. package/dist/packem_shared/{advisories-CtqvyYvO.js → advisories-Vd2kwoSf.js} +1 -1
  75. package/dist/packem_shared/{affected-selection-Br8c1wPb.js → affected-selection-Dbbli-Ot.js} +1 -1
  76. package/dist/packem_shared/{ai-analysis-CouDH8gG.js → ai-analysis-DZEjy6lu.js} +1 -1
  77. package/dist/packem_shared/{ai-cache-Dw2Ob8Wr.js → ai-cache-Q7TuGULh.js} +1 -1
  78. package/dist/packem_shared/{ai-fix-C0xvBoNB.js → ai-fix-Cagw3I4D.js} +1 -1
  79. package/dist/packem_shared/{bin-By7Verav.js → bin-gxaewUwv.js} +1 -1
  80. package/dist/packem_shared/{build-scripts-B_9mXJug.js → build-scripts-B5sROJPn.js} +1 -1
  81. package/dist/packem_shared/{dependency-scan-C8znTO5f.js → dependency-scan-Cpk1Z6Wj.js} +1 -1
  82. package/dist/packem_shared/{detect-CyMwuNhc.js → detect-D8zxVYrU.js} +1 -1
  83. package/dist/packem_shared/{docker-CHjGzCjg.js → docker-2ZjBNNeE.js} +1 -1
  84. package/dist/packem_shared/{ecosystem-gate-Dz4eMiQ0.js → ecosystem-gate-BF9glH2Q.js} +1 -1
  85. package/dist/packem_shared/{env-UwvvHfsx.js → env-5cWSxQ96.js} +1 -1
  86. package/dist/packem_shared/{env-consistency-CTM_WJnR.js → env-consistency-DkH7lUU7.js} +1 -1
  87. package/dist/packem_shared/{failure-log-BH4ck8I4.js → failure-log-Dj9b94ax.js} +1 -1
  88. package/dist/packem_shared/github-workflow-command-Bn0MgB78.js +3 -0
  89. package/dist/packem_shared/glob-Cyk1H9ZL-CYVM7sl3.js +1 -0
  90. package/dist/packem_shared/{index-BhcT3PpQ.js → index-Bu_rMPKl.js} +1 -1
  91. package/dist/packem_shared/{index-BhFtXNNB.js → index-Dn_z9DYf.js} +1 -1
  92. package/dist/packem_shared/{lifecycle-DNWes81J.js → lifecycle-BGTRxc9n.js} +1 -1
  93. package/dist/packem_shared/{manifests-B4s51bMW.js → manifests-C1FhhaNX.js} +1 -1
  94. package/dist/packem_shared/{min-release-age-P0ls4pAF.js → min-release-age-BbppxofB.js} +1 -1
  95. package/dist/packem_shared/{missing-package-json-BcKnQERZ.js → missing-package-json-DLTSyp4H.js} +1 -1
  96. package/dist/packem_shared/{multi-eco-lockfiles-CGC9DH_l.js → multi-eco-lockfiles-CxwaJO4v.js} +1 -1
  97. package/dist/packem_shared/{native-config-sync-DnuL1Ck8.js → native-config-sync-Di-76fQc.js} +1 -1
  98. package/dist/packem_shared/{osv-CgEeaSxd.js → osv-DrEbiNXB.js} +1 -1
  99. package/dist/packem_shared/{package-version-CwpMpdja.js → package-version-lWlrF9Wk.js} +1 -1
  100. package/dist/packem_shared/{packument-CzXKq5Uj.js → packument-CW9GbXrT.js} +1 -1
  101. package/dist/packem_shared/{project-name-filter-DXEnW3Uz.js → project-name-filter-DQ323iaJ.js} +1 -1
  102. package/dist/packem_shared/{provenance-Bd0CbKIp.js → provenance-DnK4Z14A.js} +1 -1
  103. package/dist/packem_shared/publish-report-C-f7hkwx.js +1 -0
  104. package/dist/packem_shared/{registry-DBYHez15.js → registry-DqBIZZSL.js} +1 -1
  105. package/dist/packem_shared/{registry-keys-xPdrNru6.js → registry-keys-fVgmcPXl.js} +1 -1
  106. package/dist/packem_shared/{renderToString-DR0zDUjh-DYOVAAfx.js → renderToString-DR0zDUjh-C8HCAyYP.js} +1 -1
  107. package/dist/packem_shared/{resolve-explicit-BiX9lIh4.js → resolve-explicit-B9zDWjx_.js} +1 -1
  108. package/dist/packem_shared/{run-summary-utils-CkEtzBQD.js → run-summary-utils-H2tE2PUC.js} +1 -1
  109. package/dist/packem_shared/{runtime-check-Byzd_Jc9.js → runtime-check-B7ptIHX7.js} +1 -1
  110. package/dist/packem_shared/{s1ngularity-F2Tr5TBZ.js → s1ngularity-27TGL2H3.js} +1 -1
  111. package/dist/packem_shared/{scaffold-files-qM0oCb1Z.js → scaffold-files-BFWgtMR2.js} +1 -1
  112. package/dist/packem_shared/{scan-progress-e2fK9W0r.js → scan-progress-BwacnpFH.js} +1 -1
  113. package/dist/packem_shared/{selectors-BZF_PAg-.js → selectors-BisxDyYw.js} +1 -1
  114. package/dist/packem_shared/{signatures-FAEkrfxp.js → signatures-Bl3Y1qG3.js} +1 -1
  115. package/dist/packem_shared/{spinner-C14Fwarr.js → spinner-OBWz4yeR.js} +1 -1
  116. package/dist/packem_shared/{table-CXYb0Lek.js → table-BwL7to1g.js} +1 -1
  117. package/dist/packem_shared/{tabs-DbxzN8lr.js → tabs-Cr6uwTNJ.js} +1 -1
  118. package/dist/packem_shared/{toolchain-frFbcqqd.js → toolchain-DVLvBR49.js} +1 -1
  119. package/dist/packem_shared/{typosquats-CQMG0xHf.js → typosquats-DpcdyKGi.js} +1 -1
  120. package/dist/packem_shared/{use-measured-height-6ITmRvS-.js → use-measured-height-CVzcGyKB.js} +1 -1
  121. package/dist/packem_shared/{vis-update-app-_vu7O4s-.js → vis-update-app-0dbSUY-u.js} +1 -1
  122. package/dist/packem_shared/{vis-user-error-Dqv0he0c.js → vis-user-error-pMP1p7q1.js} +1 -1
  123. package/dist/packem_shared/watch-loop-ZjcOW5Qx.js +9 -0
  124. package/index.js +54 -54
  125. package/package.json +17 -13
  126. package/schemas/vis-config.schema.json +69 -0
  127. package/scripts/install-native.cjs +250 -0
  128. package/dist/packem_shared/glob-Cyk1H9ZL-CoeGrbCO.js +0 -1
  129. package/dist/packem_shared/publish-report-DOXKGOAj.js +0 -3
  130. package/dist/packem_shared/watch-loop-CgxpnVYG.js +0 -11
package/CHANGELOG.md CHANGED
@@ -1,3 +1,71 @@
1
+ ## @visulima/vis [7.0.0](https://github.com/visulima/vis/compare/@visulima/vis@6.7.0...@visulima/vis@7.0.0) (2026-11-21)
2
+
3
+ ### ⚠ BREAKING CHANGES
4
+
5
+ * **secrets:** mask findings by default (#120)
6
+
7
+ ### Features
8
+
9
+ * **secret-scanner:** add per-file rule overrides ([#122](https://github.com/visulima/vis/issues/122)) ([aaadd9b](https://github.com/visulima/vis/commit/aaadd9be5f23bd260d8dc5f0e0de9a275d7afa09))
10
+ * **secret-scanner:** auto-discover .secretlintignore files ([#121](https://github.com/visulima/vis/issues/121)) ([084b09e](https://github.com/visulima/vis/commit/084b09eeb7452af85d41918b747955de97af7654))
11
+ * **secret-scanner:** scope allow markers to rule ids ([#124](https://github.com/visulima/vis/issues/124)) ([6c2df64](https://github.com/visulima/vis/commit/6c2df64f501592fe81c3ed4592a609a553bc265c))
12
+ * **secrets:** add opt-in scan profiling ([#125](https://github.com/visulima/vis/issues/125)) ([e303a83](https://github.com/visulima/vis/commit/e303a83e8505746098673816850da75f17f43682))
13
+ * **secrets:** emit GitHub Actions annotations ([#126](https://github.com/visulima/vis/issues/126)) ([04a6be9](https://github.com/visulima/vis/commit/04a6be9a63b2b6386a55296f2664d0cadf3d9d64))
14
+ * **secrets:** mask findings by default ([#120](https://github.com/visulima/vis/issues/120)) ([13581c2](https://github.com/visulima/vis/commit/13581c292b6177604522a09599c627a1f42cdb83))
15
+ * **vis:** add masked working-tree secret rewrites ([#131](https://github.com/visulima/vis/issues/131)) ([f4d4964](https://github.com/visulima/vis/commit/f4d4964105beb9d2a98aa3ae253b2c08444ced31))
16
+ * **vis:** answer the plain vis list natively ([#117](https://github.com/visulima/vis/issues/117)) ([cfc7f1b](https://github.com/visulima/vis/commit/cfc7f1b7f98a91c5448e05cda4c8d57f13ab43db))
17
+ * **vis:** answer vis clean natively for the plain and dry-run shapes ([15211e8](https://github.com/visulima/vis/commit/15211e8bc64f13c4215df3067b29031b082c9bda))
18
+ * **vis:** link the native binary as the vis command on install ([#103](https://github.com/visulima/vis/issues/103)) ([afcf849](https://github.com/visulima/vis/commit/afcf84957980a19cb8ba35b34706512d73fc1082))
19
+ * **vis:** native project names and graph for JS-only workspaces ([f8fb104](https://github.com/visulima/vis/commit/f8fb1040ab992eb1b5e60f9a38f3567b8c51be97))
20
+ * **vis:** port vis ignore to the native front-end ([24ccd56](https://github.com/visulima/vis/commit/24ccd564ea9097a4988d16db45cf9b8c41710b97))
21
+ * **vis:** read package.json script targets for JS-only projects natively ([f28a3b8](https://github.com/visulima/vis/commit/f28a3b834c47743ec58c6a503aff5ddda14bf1ea))
22
+ * **vis:** read vis.config as data in the native pm commands ([c470623](https://github.com/visulima/vis/commit/c470623749bc37332070750b73fdabab6881f44e))
23
+ * **vis:** run a plain npm, pnpm or bun install.backend pin natively ([#118](https://github.com/visulima/vis/issues/118)) ([b139087](https://github.com/visulima/vis/commit/b139087b08301bda03d95347a49aadb819dbfb3a))
24
+ * **vis:** scan piped input with secrets --stdin ([#123](https://github.com/visulima/vis/issues/123)) ([a14c35f](https://github.com/visulima/vis/commit/a14c35fac1462955a7e05ef66b6ae2bbe82d03bf))
25
+
26
+ ### Bug Fixes
27
+
28
+ * **release:** patch the native loader's version comparison, not only its error message ([#151](https://github.com/visulima/vis/issues/151)) ([be73924](https://github.com/visulima/vis/commit/be7392497284c448224b0a18a9a59179923b1908))
29
+ * **vis:** address Qodo findings on the native list, clean and ignore paths ([#134](https://github.com/visulima/vis/issues/134)) ([1078fa9](https://github.com/visulima/vis/commit/1078fa9569e4a9a997578415c3ede405a7c981ed))
30
+ * **vis:** address Qodo review findings from PR [#105](https://github.com/visulima/vis/issues/105) ([#132](https://github.com/visulima/vis/issues/132)) ([a02467e](https://github.com/visulima/vis/commit/a02467ecd20e468e52db93fa885d42807db30c17))
31
+ * **vis:** address the CodeRabbit review on the native launcher ([#107](https://github.com/visulima/vis/issues/107)) ([9227cbb](https://github.com/visulima/vis/commit/9227cbbd285cab295a97330d8037bf9e2950d468))
32
+ * **vis:** close the remaining native config gaps found in review ([a756c20](https://github.com/visulima/vis/commit/a756c20e02111369ec626852601e4eafc90a9d17))
33
+ * **vis:** compute the native root gate instead of trusting VIS_MONOREPO_ROOT ([#119](https://github.com/visulima/vis/issues/119)) ([5a2d4b5](https://github.com/visulima/vis/commit/5a2d4b5e4e0dd7e1692cf24aafefeffe4f4f74a0))
34
+ * **vis:** delegate native config handling for the cases Node resolves itself ([da75fdf](https://github.com/visulima/vis/commit/da75fdf007e4c017e949c589598c0b64fedc418c))
35
+ * **vis:** detect the registry's listening line in a large output chunk ([8dce751](https://github.com/visulima/vis/commit/8dce751ad722d5686ff72ade0246666f178b48ab))
36
+ * **vis:** end the whole registry process tree in the install smoke on Windows ([#138](https://github.com/visulima/vis/issues/138)) ([2203f60](https://github.com/visulima/vis/commit/2203f6047d2ccf9fe94bc57fade9e2d512f42c09))
37
+ * **vis:** finish the native launcher hardening from PR [#105](https://github.com/visulima/vis/issues/105) review ([#106](https://github.com/visulima/vis/issues/106)) ([9432ceb](https://github.com/visulima/vis/commit/9432ceb309f3eedf0717f87e6b43c6d459a9372e))
38
+ * **vis:** give the smoke registry long enough to start on a cold runner ([#110](https://github.com/visulima/vis/issues/110)) ([1f813e6](https://github.com/visulima/vis/commit/1f813e6561b69addf0068a9dfec3553c0d906a9a))
39
+ * **vis:** keep native ignore fallbacks lossless, gate its launcher route, write atomically ([c4cf57f](https://github.com/visulima/vis/commit/c4cf57fe0b71a4ecbb53d90e792291c9c2959178))
40
+ * **vis:** match Node for bare pnpm pins and workspace-root verbs ([#133](https://github.com/visulima/vis/issues/133)) ([d2911df](https://github.com/visulima/vis/commit/d2911df786287831e9b72b07705d6431b56dde8b))
41
+ * **vis:** refuse to replace a read-only ignore file on native write ([c2f9d10](https://github.com/visulima/vis/commit/c2f9d10d1585cbfc6d3c79027d06a9c1e05015e0))
42
+ * **vis:** stop npm add from treating the package as a workspace name ([#139](https://github.com/visulima/vis/issues/139)) ([4775a81](https://github.com/visulima/vis/commit/4775a8128f5533f0cdf9c1e996daf614a39b1bf3))
43
+
44
+ ### Styles
45
+
46
+ * **vis:** fix lint in the ignore route test ([d76c879](https://github.com/visulima/vis/commit/d76c8799bbd2e026168abb1cc8abd31dc7f882ee))
47
+ * **vis:** match the repo's TOML array spacing for serde_json features ([420f9bd](https://github.com/visulima/vis/commit/420f9bd0a4453d0f8b2f886afa85170e7708a218))
48
+ * **vis:** use block bodies in the project-graph parity test ([0794c27](https://github.com/visulima/vis/commit/0794c271cb00eeb5c7049047b953d30676d40ccb))
49
+
50
+ ### Code Refactoring
51
+
52
+ * **native:** move task-runner, secret-scanner and package-manager logic into napi-free core crates ([#102](https://github.com/visulima/vis/issues/102)) ([8440280](https://github.com/visulima/vis/commit/84402805dc753dfd501ff92e6f6eff82bc008ae5))
53
+ * **vis:** drop a doc comment that restated its type ([733b677](https://github.com/visulima/vis/commit/733b6778def7cdb9786e60fe5ffe05db6b76ab7d))
54
+ * **vis:** drop enum variant docs that restate their names ([f2b810c](https://github.com/visulima/vis/commit/f2b810cda3f01486bdf4d79b00e0759ea107271d))
55
+ * **vis:** split the per-command launcher routing out of routesToNative ([#128](https://github.com/visulima/vis/issues/128)) ([4cc5313](https://github.com/visulima/vis/commit/4cc5313b9199a38a97ccf25aa0015414660fbf48))
56
+
57
+ ### Tests
58
+
59
+ * **vis:** cover the graph's own name checks and pin the fixture count ([a0d5329](https://github.com/visulima/vis/commit/a0d53290dd117e7b8d98cac92981b1bfea0ac27d))
60
+ * **vis:** fail the install smoke when a package manager named with --pm is missing ([#104](https://github.com/visulima/vis/issues/104)) ([120c2c6](https://github.com/visulima/vis/commit/120c2c6b6a1324454e1953b37005f5a1eaccf7e5))
61
+ * **vis:** give the list parity test's binary the entry and version a launcher passes ([#130](https://github.com/visulima/vis/issues/130)) ([d891c38](https://github.com/visulima/vis/commit/d891c384c8145538e82daead123a66e0e161ca50))
62
+
63
+
64
+ ### Dependencies
65
+
66
+ * **@visulima/secret-scanner:** upgraded to 3.0.0
67
+ * **@visulima/task-runner:** upgraded to 3.0.4
68
+
1
69
  ## @visulima/vis [6.7.0](https://github.com/visulima/vis/compare/@visulima/vis@6.6.1...@visulima/vis@6.7.0) (2026-11-17)
2
70
 
3
71
  ### Features
package/README.md CHANGED
@@ -104,6 +104,35 @@ yarn add @visulima/vis
104
104
  pnpm add @visulima/vis
105
105
  ```
106
106
 
107
+ **pnpm** does not run a dependency's install script until it is approved, and `@visulima/vis` uses one to link the native executable at `bin/vis`. Without the approval the files are still installed and `vis` still runs (through a Node launcher, which starts slower), but:
108
+
109
+ - **pnpm 11 and 12:** every `pnpm install` / `pnpm add` that pulls in the package exits non-zero (`ERR_PNPM_IGNORED_BUILDS`), so a CI pipeline fails. Treat the approval as required. Run `pnpm approve-builds` once, or add it to `pnpm-workspace.yaml`:
110
+
111
+ ```yaml
112
+ allowBuilds:
113
+ "@visulima/vis": true
114
+ ```
115
+
116
+ - **pnpm 10:** the install exits 0 and only warns that the build script was ignored. From 10.26 on, the `allowBuilds` entry above works the same way. Before 10.26 it is ignored, so use the legacy `onlyBuiltDependencies` (in `pnpm-workspace.yaml`, or under `"pnpm"` in `package.json`), which every 10.x release still honors. Or run `pnpm approve-builds`:
117
+
118
+ ```json
119
+ {
120
+ "pnpm": {
121
+ "onlyBuiltDependencies": ["@visulima/vis"]
122
+ }
123
+ }
124
+ ```
125
+
126
+ **bun** also skips dependency install scripts unless the package is in your `package.json` `trustedDependencies`:
127
+
128
+ ```json
129
+ {
130
+ "trustedDependencies": ["@visulima/vis"]
131
+ }
132
+ ```
133
+
134
+ An explicit `trustedDependencies` list replaces bun's default list, so keep any other packages your project relies on in it.
135
+
107
136
  ### Binaries
108
137
 
109
138
  `@visulima/vis` installs four executables:
@@ -308,6 +337,8 @@ vis secrets --exclude-rule generic-api-key # drop a noisy
308
337
  vis secrets --baseline .secrets-baseline.json # suppress triaged findings; print diff
309
338
  vis secrets --update-baseline # merge current findings into the baseline
310
339
  vis secrets --format sarif > report.sarif # SARIF for GitHub code-scanning
340
+ vis secrets --format github # inline GitHub Actions annotations
341
+ vis secrets --profile # timing by phase, rule and file (stderr)
311
342
  ```
312
343
 
313
344
  **Suppression** — inline (`// gitleaks:allow`), block (`gitleaks:allow-start` … `gitleaks:allow-end`), or a baseline JSON (sole fingerprint store). See the [secret-scanner README](../secret-scanner/README.md#suppression) for details.
package/bin/route.mjs ADDED
@@ -0,0 +1,256 @@
1
+ import { existsSync } from "node:fs";
2
+ import { dirname, join } from "node:path";
3
+
4
+ // Which `vis` invocations the Node launcher (`bin/vis.mjs`) hands to the native
5
+ // binary. Kept free of side effects so the routing table is unit-testable without
6
+ // a binary, the same way `resolve-binary.mjs` is shared.
7
+
8
+ // Commands answered by the native binary. Every entry here MUST be handled by the
9
+ // binary (natively or via its own Node delegation), with VERIFIED parity to the
10
+ // Node behavior. Unknown commands never reach the binary: they take the in-process
11
+ // path unchanged. NOTE: `-v` is cerebro's verbose flag (not version), so it is
12
+ // deliberately absent.
13
+ //
14
+ // `exec` parity was verified empirically against cerebro: tool flags after the
15
+ // command are forwarded to the tool on both the native path and the Node handler
16
+ // (src/commands/exec/handler.ts), which was fixed to stop dropping them.
17
+ const NATIVE_COMMANDS = new Set(["--version", "-V", "__native-info", "__pm-shim", "dedupe", "exec", "link", "outdated", "pm", "remove", "unlink", "why", "x"]);
18
+
19
+ // `--help` / `-h` anywhere before a `--` separator.
20
+ const asksForHelp = (args) => {
21
+ const separatorIndex = args.indexOf("--");
22
+ const optionArguments = separatorIndex === -1 ? args : args.slice(0, separatorIndex);
23
+
24
+ return optionArguments.some((argument) => argument === "--help" || argument === "-h");
25
+ };
26
+
27
+ // Environment variables that turn on colour in Node for the stdout log lines. Mirrors
28
+ // `COLOUR_ENVIRONMENT` in `native/cli/src/ignore.rs`, plus `CLICOLOR_FORCE`, which the binary
29
+ // does not check. The launcher only pre-filters, so a superset here is safe: Node answers.
30
+ const IGNORE_COLOUR_ENVIRONMENT = [
31
+ "CLICOLOR_FORCE",
32
+ "FORCE_COLOR",
33
+ "COLORTERM",
34
+ "TERM_PROGRAM",
35
+ "TERMINAL_EMULATOR",
36
+ "TEAMCITY_VERSION",
37
+ "TF_BUILD",
38
+ "PM2_HOME",
39
+ "GITEA_ACTIONS",
40
+ "CIRCLECI",
41
+ "GITHUB_WORKFLOW",
42
+ "GITHUB_ACTIONS",
43
+ "TRAVIS",
44
+ "APPVEYOR",
45
+ "GITLAB_CI",
46
+ "BUILDKITE",
47
+ "DRONE",
48
+ "CI_NAME",
49
+ ];
50
+
51
+ // Markers that Node's root search (`findMonorepoRootSync` in `@visulima/package`) reads. Same list
52
+ // as `ROOT_MARKERS` in `native/cli/src/advisories.rs`; keep them in step.
53
+ const ROOT_MARKERS = [
54
+ "lerna.json",
55
+ "turbo.json",
56
+ "pnpm-workspace.yaml",
57
+ "package.json",
58
+ "pnpm-lock.yaml",
59
+ "package-lock.json",
60
+ "npm-shrinkwrap.json",
61
+ "yarn.lock",
62
+ "bun.lock",
63
+ "bun.lockb",
64
+ ];
65
+
66
+ const holdsRootMarker = (directory) => ROOT_MARKERS.some((name) => existsSync(join(directory, name)));
67
+
68
+ // Whether Node's root search would return `cwd` itself: a marker in `cwd` and none above it. Walks
69
+ // to the filesystem root, as the Rust `ancestors()` does, so `/` is checked too.
70
+ const rootIsCwd = (cwd, holdsMarker = holdsRootMarker) => {
71
+ if (!holdsMarker(cwd)) {
72
+ return false;
73
+ }
74
+
75
+ for (let directory = dirname(cwd); ; directory = dirname(directory)) {
76
+ if (holdsMarker(directory)) {
77
+ return false;
78
+ }
79
+
80
+ if (dirname(directory) === directory) {
81
+ return true;
82
+ }
83
+ }
84
+ };
85
+
86
+ // `is-in-ci`: `CI` or `CONTINUOUS_INTEGRATION` set to anything but `0` or `false`.
87
+ const inCi = (environment) => ["CI", "CONTINUOUS_INTEGRATION"].some((key) => environment[key] !== undefined && environment[key] !== "0" && environment[key] !== "false");
88
+
89
+ // Whether `TERM` leaves Node free to colour its output: unset, dumb or mono. The binary reads the
90
+ // same variable in `colour_may_be_forced` (`ignore.rs`).
91
+ const plainTerm = (environment) => {
92
+ const term = environment.TERM?.toLowerCase();
93
+
94
+ return term === undefined || term.includes("dumb") || term.includes("mono");
95
+ };
96
+
97
+ // Whether `vis ignore` can pass the binary's native gate (`native_context` in `ignore.rs`). The
98
+ // binary re-checks everything; this only skips the extra process when it would delegate anyway.
99
+ const ignoreMayRunNatively = (platform, environment, cwd, interactive, holdsMarker) => {
100
+ if (platform === "win32" || interactive) {
101
+ return false;
102
+ }
103
+
104
+ if (!inCi(environment)) {
105
+ return false;
106
+ }
107
+
108
+ // The inherited variable is only a reason to delegate, never the root itself.
109
+ const inheritedRoot = environment.VIS_MONOREPO_ROOT;
110
+
111
+ if (inheritedRoot && inheritedRoot !== cwd) {
112
+ return false;
113
+ }
114
+
115
+ if (!rootIsCwd(cwd, holdsMarker)) {
116
+ return false;
117
+ }
118
+
119
+ if (IGNORE_COLOUR_ENVIRONMENT.some((key) => environment[key] !== undefined)) {
120
+ return false;
121
+ }
122
+
123
+ return plainTerm(environment);
124
+ };
125
+
126
+ // Whether `vis clean` can pass the binary's native gate (`plan` in `clean.rs`). The binary re-checks
127
+ // everything; this only skips the extra process when it would delegate anyway. Flags are the
128
+ // default, `--dry-run` and `--lockfile`/`-l`, each at most once.
129
+ const cleanMayRunNatively = (platform, environment, args, interactive) => {
130
+ if (platform === "win32" || interactive) {
131
+ return false;
132
+ }
133
+
134
+ if (!inCi(environment) || IGNORE_COLOUR_ENVIRONMENT.some((key) => environment[key] !== undefined) || !plainTerm(environment)) {
135
+ return false;
136
+ }
137
+
138
+ const flags = args.slice(1);
139
+ const known = new Set(["--dry-run", "--lockfile", "-l"]);
140
+
141
+ return flags.every((flag) => known.has(flag)) && new Set(flags).size === flags.length;
142
+ };
143
+
144
+ // The argument lists (after `list`) that the binary answers natively.
145
+ const LIST_NATIVE_SHAPES = [[], ["--json"], ["--format", "json"], ["--format", "table"], ["--format=json"], ["--format=table"]];
146
+
147
+ // Whether `vis list` can pass the binary's native gate (`run` in `list.rs`). Only the plain listing
148
+ // is native: no flags, `--json`, or one `--format` value. The binary re-checks the CI context and
149
+ // every other shape, so this only skips the extra process when it would delegate anyway.
150
+ const listMayRunNatively = (platform, environment, args, interactive) => {
151
+ if (platform === "win32" || interactive || !inCi(environment)) {
152
+ return false;
153
+ }
154
+
155
+ const flags = args.slice(1);
156
+
157
+ return LIST_NATIVE_SHAPES.some((shape) => shape.length === flags.length && shape.every((flag, index) => flags[index] === flag));
158
+ };
159
+
160
+ // Commands with a native gate answer help through the binary everywhere but Windows, and
161
+ // otherwise follow the gate. `mayRunNatively` is only called when the help surface is not asked for.
162
+ const helpOrNative = (args, platform, mayRunNatively) => {
163
+ if (asksForHelp(args)) {
164
+ return platform !== "win32";
165
+ }
166
+
167
+ return mayRunNatively();
168
+ };
169
+
170
+ // The routing of the commands that have their own native shapes: `true` or `false` when the
171
+ // command decides, `undefined` when it is left to the help-surface rule in `routesToNative`.
172
+ const routesCommandToNative = (args, platform, environment, cwd, interactive, holdsMarker = holdsRootMarker) => {
173
+ const [command = "", subcommand] = args;
174
+
175
+ if (NATIVE_COMMANDS.has(command)) {
176
+ return true;
177
+ }
178
+
179
+ // `hook run` is native, but the other `hook` subcommands (install, migrate, …)
180
+ // are not: sending those through the binary would only add a second Node boot.
181
+ // On Windows, `hook run --help` stays in Node, which keeps the help surface there.
182
+ if (command === "hook" && subcommand === "run") {
183
+ return platform !== "win32" || !asksForHelp(args);
184
+ }
185
+
186
+ // `advisories bloom status` is answered natively for `--format json --cache-dir <dir>`.
187
+ // The binary hands every other shape of it to Node itself, as it does for `hook run`.
188
+ if (command === "advisories" && subcommand === "bloom" && args[2] === "status") {
189
+ return platform !== "win32" || !asksForHelp(args);
190
+ }
191
+
192
+ // `ignore` is native for its plain shapes in a CI context (`native/cli/src/ignore.rs`); any
193
+ // other run would be delegated by the binary, which costs a second Node boot. Help is
194
+ // answered by the binary everywhere but Windows, as for `advisories bloom status`.
195
+ if (command === "ignore") {
196
+ return helpOrNative(args, platform, () => ignoreMayRunNatively(platform, environment, cwd, interactive, holdsMarker));
197
+ }
198
+
199
+ // `list` is native for the plain listing in a CI context (`native/cli/src/list.rs`); any other
200
+ // run would be delegated by the binary, which costs a second Node boot.
201
+ if (command === "list") {
202
+ return helpOrNative(args, platform, () => listMayRunNatively(platform, environment, args, interactive));
203
+ }
204
+
205
+ // `clean` (no flags, `--dry-run`, `--lockfile`) is answered natively; the binary hands every
206
+ // other shape to Node itself. Help stays in Node on Windows, as for `advisories`. A terminal
207
+ // stdout stays in Node too: pail colours its output there, and the binary does not.
208
+ if (command === "clean") {
209
+ return helpOrNative(args, platform, () => cleanMayRunNatively(platform, environment, args, interactive));
210
+ }
211
+
212
+ // `complete --` is the dynamic endpoint the generated completion scripts call on
213
+ // every <TAB>; any other `complete` shape is not a native command, so it stays
214
+ // in-process (script generation is `vis completion --shell=<shell>`, Node's too).
215
+ if (command === "complete" && subcommand === "--") {
216
+ return true;
217
+ }
218
+
219
+ if (command === "complete") {
220
+ return false;
221
+ }
222
+
223
+ return undefined;
224
+ };
225
+
226
+ // Whether the binary should get this invocation: `args` is `process.argv.slice(2)`. The other
227
+ // parameters default to the running process; tests pass their own.
228
+ const routesToNative = (
229
+ args,
230
+ platform = process.platform,
231
+ environment = process.env,
232
+ cwd = process.cwd(),
233
+ interactive = Boolean(process.stdout.isTTY || process.stderr.isTTY),
234
+ holdsMarker = holdsRootMarker,
235
+ ) => {
236
+ const decided = routesCommandToNative(args, platform, environment, cwd, interactive, holdsMarker);
237
+
238
+ if (decided !== undefined) {
239
+ return decided;
240
+ }
241
+
242
+ // Windows keeps the help surface in Node: the binary paints it with raw ANSI codes
243
+ // and does not enable virtual-terminal processing, which classic conhost needs.
244
+ if (platform === "win32") {
245
+ return false;
246
+ }
247
+
248
+ // The binary also renders the help surface from its generated manifest: bare
249
+ // `vis`, `help …`, and `--help` / `-h` anywhere before a `--` separator. It
250
+ // delegates whatever it cannot answer to `dist/bin.js` itself (never back through
251
+ // the launcher), so these are safe to hand over.
252
+ return args.length === 0 || args[0] === "help" || asksForHelp(args);
253
+ };
254
+
255
+ // eslint-disable-next-line import/prefer-default-export -- named like `resolve-binary.mjs`; more routing helpers will join it
256
+ export { routesToNative };
package/bin/vis ADDED
@@ -0,0 +1,7 @@
1
+ #!/usr/bin/env node
2
+ // Node launcher entry. On install, `scripts/install-native.cjs` replaces this
3
+ // file with the platform's native executable so `vis` starts without Node. This
4
+ // content stays only when that did not happen (install scripts disabled, a
5
+ // platform without a prebuilt binary, `--omit=optional`): it still works, but
6
+ // every command pays a Node start-up first. `vis doctor` reports it.
7
+ import "./vis.mjs";
package/bin/vis.mjs CHANGED
@@ -1,16 +1,17 @@
1
- #!/usr/bin/env node
2
- // Native front-end launcher for `vis`.
1
+ /* eslint-disable unicorn/no-process-exit -- CLI entry: exit codes are forwarded from the native binary */
2
+ // Native front-end launcher for `vis`, used when the install script did not put
3
+ // the native executable at `bin/vis` (see `bin/vis` and `scripts/install-native.cjs`).
4
+ // `bin/vis` imports this file; run it directly with `node bin/vis.mjs`.
3
5
  //
4
- // This is the npm `bin` entry. Its only jobs are to (1) route the small set of
5
- // natively-implemented commands to the platform Rust binary, and (2) fall
6
- // through to the existing in-process Node CLI for everything else. The
7
- // fall-through path is byte-identical to running `dist/bin.js` directly, so the
8
- // launcher adds no extra Node boot for delegated commands — it `import()`s the
9
- // same entry in the same process.
6
+ // Its only jobs are to (1) route the natively-implemented commands (and the help
7
+ // surface) to the platform Rust binary, and (2) fall through to the existing
8
+ // in-process Node CLI for everything else. The fall-through path is byte-identical
9
+ // to running `dist/bin.js` directly, so the launcher adds no extra Node boot for
10
+ // delegated commands: it `import()`s the same entry in the same process.
10
11
  //
11
- // As commands are ported off Node, their names are added to NATIVE_COMMANDS and
12
- // the binary grows to handle them; the binary itself delegates anything it does
13
- // not implement back to `dist/bin.js` via the VIS_* contract.
12
+ // As commands are ported off Node, their names are added to NATIVE_COMMANDS in
13
+ // `route.mjs` and the binary grows to handle them; the binary itself delegates
14
+ // anything it does not implement back to `dist/bin.js` via the VIS_* contract.
14
15
 
15
16
  import { spawnSync } from "node:child_process";
16
17
  import { readFileSync } from "node:fs";
@@ -19,40 +20,33 @@ import { dirname, join } from "node:path";
19
20
  import { fileURLToPath, pathToFileURL } from "node:url";
20
21
 
21
22
  import { resolveNativeBinary } from "./resolve-binary.mjs";
23
+ import { routesToNative } from "./route.mjs";
22
24
 
23
25
  const packageRoot = dirname(dirname(fileURLToPath(import.meta.url)));
24
26
 
25
- // VIS_FALLBACK_ENTRY lets tests (and the native binary's own delegation) point
26
- // the Node entry elsewhere; production resolves it next to the package.
27
- const fallbackEntry = process.env.VIS_FALLBACK_ENTRY ?? join(packageRoot, "dist", "bin.js");
27
+ // Tells the CLI (and `vis doctor`) it was started through Node rather than the
28
+ // native executable that the install script normally puts at `bin/vis`.
29
+ process.env.VIS_LAUNCHER = "node";
28
30
 
29
- // Commands answered by the native binary. Every entry here MUST be handled by
30
- // the binary (natively or via its own Node delegation), with VERIFIED parity to
31
- // the Node behavior. Unknown commands never reach the binary — they take the
32
- // in-process path below, unchanged. NOTE: `-v` is cerebro's verbose flag (not
33
- // version), so it is deliberately absent.
34
- //
35
- // `exec` parity was verified empirically against cerebro: tool flags after the
36
- // command are forwarded to the tool on both the native path and the Node handler
37
- // (src/commands/exec/handler.ts), which was fixed to stop dropping them.
38
- const NATIVE_COMMANDS = new Set(["--version", "-V", "__native-info", "__pm-shim", "dedupe", "exec", "link", "outdated", "pm", "remove", "unlink", "why", "x"]);
39
-
40
- const command = process.argv[2] ?? "";
31
+ // VIS_FALLBACK_ENTRY_OVERRIDE lets tests point the Node entry elsewhere. An inherited
32
+ // VIS_FALLBACK_ENTRY is deliberately ignored: a nested `vis` would otherwise run the entry
33
+ // of the install that started it. Production resolves the entry next to this package.
34
+ const fallbackEntry = process.env.VIS_FALLBACK_ENTRY_OVERRIDE ?? join(packageRoot, "dist", "bin.js");
41
35
 
42
- // `hook run` is native too, but the other `hook` subcommands (install, migrate, …)
43
- // are not: sending those through the binary would only add a second Node boot.
44
- const isNativeCommand = NATIVE_COMMANDS.has(command) || (command === "hook" && process.argv[3] === "run");
36
+ const userArguments = process.argv.slice(2);
45
37
 
46
- if (isNativeCommand) {
38
+ if (routesToNative(userArguments)) {
47
39
  const binary = resolveNativeBinary(packageRoot);
48
40
 
49
41
  if (binary !== undefined) {
50
42
  const { version } = JSON.parse(readFileSync(join(packageRoot, "package.json"), "utf8"));
51
43
 
52
- const { error, signal, status } = spawnSync(binary, process.argv.slice(2), {
44
+ const { error, signal, status } = spawnSync(binary, userArguments, {
53
45
  env: {
54
46
  ...process.env,
55
47
  VIS_FALLBACK_ENTRY: fallbackEntry,
48
+ VIS_HANDOFF: "launcher",
49
+ VIS_LAUNCHER: "node",
56
50
  VIS_NODE: process.execPath,
57
51
  VIS_VERSION: version,
58
52
  },
package/dist/bin.js CHANGED
@@ -1 +1 @@
1
- import"./packem_shared/compile-cache-DoMHRsRZ.js";import"./packem_shared/bin-By7Verav.js";
1
+ import"./packem_shared/compile-cache-DoMHRsRZ.js";import"./packem_shared/bin-gxaewUwv.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-Dqv0he0c.js";import{t as n}from"./packem_shared/compile-cache-DoMHRsRZ.js";import{g as o}from"./packem_shared/package-version-CwpMpdja.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-pMP1p7q1.js";import{t as n}from"./packem_shared/compile-cache-DoMHRsRZ.js";import{g as o}from"./packem_shared/package-version-lWlrF9Wk.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);
@@ -2627,7 +2627,20 @@ interface VisConfig {
2627
2627
  /** Bundled presets layered on top of the default ruleset (e.g. `"weak-passwords"`). */
2628
2628
  presets?: string[];
2629
2629
  };
2630
- /** Redact secret values in findings. */
2630
+ /** File-specific rule filters, applied after the global `rules` filters. */
2631
+ overrides?: {
2632
+ /** Gitignore-syntax globs relative to the workspace root, e.g. `*.env` or `packages/api/**`. */
2633
+ files: string | string[];
2634
+ rules?: {
2635
+ /** Enable opt-in rules for matching files only. */
2636
+ enable?: string[];
2637
+ /** Drop these rules for matching files. */
2638
+ exclude?: string[];
2639
+ /** Restrict matching files to these rules. */
2640
+ include?: string[];
2641
+ };
2642
+ }[];
2643
+ /** Mask secret values in findings and reports. Default `true`; `false` reveals them. */
2631
2644
  redact?: boolean;
2632
2645
  /** Rule-id filters applied after scanning. */
2633
2646
  rules?: {
@@ -2636,6 +2649,8 @@ interface VisConfig {
2636
2649
  /** Only report findings whose ruleId matches. */
2637
2650
  include?: string[];
2638
2651
  };
2652
+ /** `.secretlintignore` paths, or `false` to disable auto-discovery (`--secretlintignore` files still apply). */
2653
+ secretlintIgnore?: string[] | false;
2639
2654
  /** Walker / filesystem traversal. */
2640
2655
  walk?: {
2641
2656
  /**
@@ -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-e2fK9W0r.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-BwacnpFH.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-DBYHez15.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-UwvvHfsx.js";import{f as Ue}from"../packem_shared/removeSync-g1D5kONg-jOsRSIIv.js";import{p as b}from"../packem_shared/package-version-CwpMpdja.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-DYOVAAfx.js";import{q as We}from"../packem_shared/table-CXYb0Lek.js";import{f as Ie}from"../packem_shared/osv-CgEeaSxd.js";import{a as Be}from"../packem_shared/index--eV4qIz5.js";import{a as Z}from"../packem_shared/advisories-CtqvyYvO.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-DqBIZZSL.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-5cWSxQ96.js";import{f as Ue}from"../packem_shared/removeSync-g1D5kONg-jOsRSIIv.js";import{p as b}from"../packem_shared/package-version-lWlrF9Wk.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-C8HCAyYP.js";import{q as We}from"../packem_shared/table-BwL7to1g.js";import{f as Ie}from"../packem_shared/osv-DrEbiNXB.js";import{a as Be}from"../packem_shared/index--eV4qIz5.js";import{a as Z}from"../packem_shared/advisories-Vd2kwoSf.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-Dqv0he0c.js";import{e as t}from"../packem_shared/index-BhFtXNNB.js";import{g as d}from"../packem_shared/package-version-CwpMpdja.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-pMP1p7q1.js";import{e as t}from"../packem_shared/index-Dn_z9DYf.js";import{g as d}from"../packem_shared/package-version-lWlrF9Wk.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};