@visulima/vis 1.0.0-alpha.9 → 1.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 (278) hide show
  1. package/CHANGELOG.md +1844 -3
  2. package/LICENSE.md +13515 -10
  3. package/README.md +215 -39
  4. package/bin/resolve-binary.mjs +85 -0
  5. package/bin/vis.mjs +76 -0
  6. package/dashboard/dist/index.html +152 -0
  7. package/dist/bin.d.ts +1 -0
  8. package/dist/bin.js +1 -2
  9. package/dist/binx.js +3 -0
  10. package/dist/config/index.d.ts +3276 -0
  11. package/dist/config/index.js +1 -0
  12. package/dist/generate/index.d.ts +1 -1
  13. package/dist/generate/index.js +1 -1
  14. package/dist/packem_chunks/CONFIG_FILES.js +8 -0
  15. package/dist/packem_chunks/DEFAULT_CLEAN_KEEP.js +1 -0
  16. package/dist/packem_chunks/agent-instructions.js +11 -0
  17. package/dist/packem_chunks/bloom-status.js +2 -0
  18. package/dist/packem_chunks/bloom-sync.js +2 -0
  19. package/dist/packem_chunks/cache-attestation.js +1 -0
  20. package/dist/packem_chunks/catalog-detector.js +1 -0
  21. package/dist/packem_chunks/catalog.js +114 -0
  22. package/dist/packem_chunks/cli-exec.js +1 -0
  23. package/dist/packem_chunks/cli-main.js +268 -0
  24. package/dist/packem_chunks/defineReleasePlugin.js +3 -0
  25. package/dist/packem_chunks/detect.js +3 -0
  26. package/dist/packem_chunks/detect2.js +8 -0
  27. package/dist/packem_chunks/devtools.js +4 -0
  28. package/dist/packem_chunks/discord.js +4 -0
  29. package/dist/packem_chunks/dispatch.js +4 -0
  30. package/dist/packem_chunks/doctor-probe.js +2 -0
  31. package/dist/packem_chunks/dynamic-import.js +1 -0
  32. package/dist/packem_chunks/extra-files.js +3 -0
  33. package/dist/packem_chunks/fix.js +11 -0
  34. package/dist/packem_chunks/git.js +3 -0
  35. package/dist/packem_chunks/group-tags.js +1 -0
  36. package/dist/packem_chunks/handler.js +1 -1
  37. package/dist/packem_chunks/handler10.js +5 -1
  38. package/dist/packem_chunks/handler11.js +1 -1
  39. package/dist/packem_chunks/handler12.js +26 -152
  40. package/dist/packem_chunks/handler13.js +5 -1
  41. package/dist/packem_chunks/handler14.js +1 -3
  42. package/dist/packem_chunks/handler15.js +1 -1
  43. package/dist/packem_chunks/handler16.js +1 -2
  44. package/dist/packem_chunks/handler17.js +1 -7
  45. package/dist/packem_chunks/handler18.js +1 -1
  46. package/dist/packem_chunks/handler19.js +5 -19
  47. package/dist/packem_chunks/handler2.js +1 -1
  48. package/dist/packem_chunks/handler20.js +2 -428
  49. package/dist/packem_chunks/handler21.js +2 -22
  50. package/dist/packem_chunks/handler22.js +14 -3
  51. package/dist/packem_chunks/handler23.js +1 -5
  52. package/dist/packem_chunks/handler24.js +1 -1
  53. package/dist/packem_chunks/handler25.js +1 -20
  54. package/dist/packem_chunks/handler26.js +5 -1
  55. package/dist/packem_chunks/handler27.js +1 -1
  56. package/dist/packem_chunks/handler28.js +3 -1
  57. package/dist/packem_chunks/handler29.js +1 -2
  58. package/dist/packem_chunks/handler3.js +4 -2
  59. package/dist/packem_chunks/handler30.js +1 -22
  60. package/dist/packem_chunks/handler31.js +2 -1
  61. package/dist/packem_chunks/handler32.js +2 -1
  62. package/dist/packem_chunks/handler33.js +2 -37
  63. package/dist/packem_chunks/handler34.js +3 -3
  64. package/dist/packem_chunks/handler35.js +6 -23
  65. package/dist/packem_chunks/handler36.js +1 -5
  66. package/dist/packem_chunks/handler37.js +36 -21
  67. package/dist/packem_chunks/handler38.js +8 -1
  68. package/dist/packem_chunks/handler39.js +9 -2
  69. package/dist/packem_chunks/handler4.js +4 -5
  70. package/dist/packem_chunks/handler40.js +75 -1
  71. package/dist/packem_chunks/handler41.js +5 -5
  72. package/dist/packem_chunks/handler42.js +4 -1
  73. package/dist/packem_chunks/handler43.js +3 -24
  74. package/dist/packem_chunks/handler44.js +2 -3
  75. package/dist/packem_chunks/handler45.js +1 -1
  76. package/dist/packem_chunks/handler46.js +1 -0
  77. package/dist/packem_chunks/handler47.js +1 -0
  78. package/dist/packem_chunks/handler48.js +3 -0
  79. package/dist/packem_chunks/handler49.js +1 -0
  80. package/dist/packem_chunks/handler5.js +6 -4
  81. package/dist/packem_chunks/handler50.js +7 -0
  82. package/dist/packem_chunks/handler51.js +33 -0
  83. package/dist/packem_chunks/handler52.js +3 -0
  84. package/dist/packem_chunks/handler53.js +8 -0
  85. package/dist/packem_chunks/handler54.js +4 -0
  86. package/dist/packem_chunks/handler55.js +1 -0
  87. package/dist/packem_chunks/handler56.js +12 -0
  88. package/dist/packem_chunks/handler57.js +11 -0
  89. package/dist/packem_chunks/handler58.js +5 -0
  90. package/dist/packem_chunks/handler59.js +11 -0
  91. package/dist/packem_chunks/handler6.js +8 -2
  92. package/dist/packem_chunks/handler60.js +3 -0
  93. package/dist/packem_chunks/handler61.js +22 -0
  94. package/dist/packem_chunks/handler62.js +61 -0
  95. package/dist/packem_chunks/handler63.js +3 -0
  96. package/dist/packem_chunks/handler64.js +6 -0
  97. package/dist/packem_chunks/handler65.js +9 -0
  98. package/dist/packem_chunks/handler66.js +2 -0
  99. package/dist/packem_chunks/handler67.js +24 -0
  100. package/dist/packem_chunks/handler68.js +25 -0
  101. package/dist/packem_chunks/handler69.js +153 -0
  102. package/dist/packem_chunks/handler7.js +1 -24
  103. package/dist/packem_chunks/handler70.js +10 -0
  104. package/dist/packem_chunks/handler71.js +23 -0
  105. package/dist/packem_chunks/handler72.js +322 -0
  106. package/dist/packem_chunks/handler73.js +708 -0
  107. package/dist/packem_chunks/handler74.js +48 -0
  108. package/dist/packem_chunks/handler75.js +27 -0
  109. package/dist/packem_chunks/handler76.js +3 -0
  110. package/dist/packem_chunks/handler77.js +190 -0
  111. package/dist/packem_chunks/handler78.js +38 -0
  112. package/dist/packem_chunks/handler8.js +1 -6
  113. package/dist/packem_chunks/handler9.js +1 -8
  114. package/dist/packem_chunks/heal-accept.js +10 -0
  115. package/dist/packem_chunks/heal.js +14 -0
  116. package/dist/packem_chunks/help-command.js +31 -0
  117. package/dist/packem_chunks/index.js +1 -7
  118. package/dist/packem_chunks/index2.js +802 -0
  119. package/dist/packem_chunks/index3.js +7 -0
  120. package/dist/packem_chunks/index4.js +135 -0
  121. package/dist/packem_chunks/index5.js +74 -0
  122. package/dist/packem_chunks/interface.js +2 -0
  123. package/dist/packem_chunks/keys-refresh.js +4 -0
  124. package/dist/packem_chunks/lean.js +4 -0
  125. package/dist/packem_chunks/list.js +3 -0
  126. package/dist/packem_chunks/loader.js +4 -1
  127. package/dist/packem_chunks/loader2.js +1 -0
  128. package/dist/packem_chunks/orchestrator.js +42 -0
  129. package/dist/packem_chunks/pre-mode.js +2 -0
  130. package/dist/packem_chunks/print-config.js +2 -0
  131. package/dist/packem_chunks/prompts.js +7 -0
  132. package/dist/packem_chunks/prune.js +3 -0
  133. package/dist/packem_chunks/publish-guards.js +1 -0
  134. package/dist/packem_chunks/registry.js +48 -0
  135. package/dist/packem_chunks/resolveFormatter.js +9 -0
  136. package/dist/packem_chunks/run.js +1 -0
  137. package/dist/packem_chunks/security.js +1 -0
  138. package/dist/packem_chunks/shell-runner.js +1 -0
  139. package/dist/packem_chunks/slack.js +2 -0
  140. package/dist/packem_chunks/snapshot.js +2 -0
  141. package/dist/packem_chunks/stage-publisher.js +1 -0
  142. package/dist/packem_chunks/staged-registry.js +2 -0
  143. package/dist/packem_chunks/state.js +3 -0
  144. package/dist/packem_chunks/status.js +2 -0
  145. package/dist/packem_chunks/success-walk.js +8 -0
  146. package/dist/packem_chunks/sync.js +2 -0
  147. package/dist/packem_chunks/sync2.js +2 -0
  148. package/dist/packem_chunks/tar.js +3 -0
  149. package/dist/packem_chunks/tripwire.js +2 -0
  150. package/dist/packem_chunks/ts-loader.js +22 -0
  151. package/dist/packem_chunks/verify-lockfile.js +2 -0
  152. package/dist/packem_chunks/version-resolver.js +2 -0
  153. package/dist/packem_chunks/webhook.js +1 -0
  154. package/dist/packem_chunks/workflow-templates.js +167 -0
  155. package/dist/packem_chunks/workspace.js +2 -0
  156. package/dist/packem_shared/AfterAllProjectsVersioned-CAKI2nWf.js +1 -0
  157. package/dist/packem_shared/MultiSpinner-B9U0-aE3-B-gIXhFk.js +3 -0
  158. package/dist/packem_shared/ReleaseClient-BY4OZNCK.js +1 -0
  159. package/dist/packem_shared/Table-CcVkyULl-DLWu6XHL.js +34 -0
  160. package/dist/packem_shared/VisReleaseError-DMGRBTNO.js +1 -0
  161. package/dist/packem_shared/_commonjsHelpers-B5Y90VFO.js +1 -0
  162. package/dist/packem_shared/advisories-B76fBVL-.js +1 -0
  163. package/dist/packem_shared/affected-shas-CCxG4tvm.js +1 -0
  164. package/dist/packem_shared/ai-analysis-BpVdn20h.js +68 -0
  165. package/dist/packem_shared/ai-fix-CeGzAT9m.js +43 -0
  166. package/dist/packem_shared/anolilab-text-CAM_E6uK.js +13 -0
  167. package/dist/packem_shared/api.d-BPftyU9r.d.ts +27 -0
  168. package/dist/packem_shared/augment-DaSS2Lgs.js +4 -0
  169. package/dist/packem_shared/bin-BlGVEhl8.js +1 -0
  170. package/dist/packem_shared/build-scripts-q__dKE2y.js +1 -0
  171. package/dist/packem_shared/command-runtime-3FTGuUsK.js +1 -0
  172. package/dist/packem_shared/compile-cache-B_Vf_WxT.js +3 -0
  173. package/dist/packem_shared/createAdapter-bU4DIP3F.js +1 -0
  174. package/dist/packem_shared/createVersionActions-BK43SNDH.js +1 -0
  175. package/dist/packem_shared/cyclonedx-CmrYQ0vx.js +4 -0
  176. package/dist/packem_shared/defineFormatter-D5dCp6Kv.js +1 -0
  177. package/dist/packem_shared/definePlugin-DoUcoYSy.js +1 -0
  178. package/dist/packem_shared/dependency-scan-DpOFiZuI.js +1 -0
  179. package/dist/packem_shared/docker-BYqiD711.js +59 -0
  180. package/dist/packem_shared/env-DdQRnEIy.js +27 -0
  181. package/dist/packem_shared/failure-log-CKMhqLWr.js +2 -0
  182. package/dist/packem_shared/giget-DVTFJlbR.js +2 -0
  183. package/dist/packem_shared/glob-fqg4KepW-1S3z30c8.js +1 -0
  184. package/dist/packem_shared/index-B0EsgdzO.js +1 -0
  185. package/dist/packem_shared/index-CE6MsgcV.js +22 -0
  186. package/dist/packem_shared/index-Cg0IHaFI.js +1 -0
  187. package/dist/packem_shared/index-Cg71MisW.js +1 -0
  188. package/dist/packem_shared/index-DjTWo3sH.js +1 -0
  189. package/dist/packem_shared/index-jJNulo5i.js +28 -0
  190. package/dist/packem_shared/index.server-J83sowC4.js +2 -0
  191. package/dist/packem_shared/interface.d-B7VK2rcH.d.ts +148 -0
  192. package/dist/packem_shared/interface.d-Cezzifoh.d.ts +106 -0
  193. package/dist/packem_shared/license-t5KnNX6v.js +1 -0
  194. package/dist/packem_shared/lifecycle-aDTZ8dW1.js +2 -0
  195. package/dist/packem_shared/lockfile-C1qCKGH6.js +1 -0
  196. package/dist/packem_shared/main-B3juSU5z.js +1 -0
  197. package/dist/packem_shared/manifests-DSBr3-dw.js +1 -0
  198. package/dist/packem_shared/min-release-age-C71MO72F.js +34 -0
  199. package/dist/packem_shared/missing-package-json-CTF71tE5.js +1 -0
  200. package/dist/packem_shared/native-config-sync-D-z2Uwqu.js +21 -0
  201. package/dist/packem_shared/osv-bloom-DMhXP184.js +2 -0
  202. package/dist/packem_shared/otelPlugin-DmKDBaPo.js +1 -0
  203. package/dist/packem_shared/packument-aGzYwXKn.js +1 -0
  204. package/dist/packem_shared/peer-warnings-BXAzXqY3.js +1 -0
  205. package/dist/packem_shared/plugins.d-ND23R9I3.d.ts +4 -0
  206. package/dist/packem_shared/pm-runner-CQcraCcu.js +1 -0
  207. package/dist/packem_shared/prompt-DjXHVgYU.js +1 -0
  208. package/dist/packem_shared/provenance-S7y0BRAt.js +1 -0
  209. package/dist/packem_shared/public-api-WqUCiyIe.js +131 -0
  210. package/dist/packem_shared/readJsonSync-DuMMeB3s-ihoybKvs.js +1 -0
  211. package/dist/packem_shared/registry-keys-CRnXATt2.js +1 -0
  212. package/dist/packem_shared/resolve-explicit-CJGazevw.js +5 -0
  213. package/dist/packem_shared/resolve-runtime-QRaQucfL.js +1 -0
  214. package/dist/packem_shared/run-file-DD7Ne23Z.js +1 -0
  215. package/dist/packem_shared/runtime-check-qnrPTlma.js +1 -0
  216. package/dist/packem_shared/runtime-process-Dmz0vCJy-DUwTvH1J.js +1 -0
  217. package/dist/packem_shared/s1ngularity-BLj4Jy8z.js +1 -0
  218. package/dist/packem_shared/scan-progress-BDcl7Kty.js +2 -0
  219. package/dist/packem_shared/selectors-D4iCvITE.js +3 -0
  220. package/dist/packem_shared/signatures-DoNG2hEr.js +2 -0
  221. package/dist/packem_shared/slug-DoueYuLo.js +1 -0
  222. package/dist/packem_shared/spinner-DuJJvFTl.js +1 -0
  223. package/dist/packem_shared/sticky-comment-D6_7-w8T.js +1 -0
  224. package/dist/packem_shared/subtree-C7bZuiSQ.js +2 -0
  225. package/dist/packem_shared/symbols-DPTlrJ3B.js +1 -0
  226. package/dist/packem_shared/tabs-CgxCvjCY.js +1 -0
  227. package/dist/packem_shared/target-merge-Dg25Izl5.js +11 -0
  228. package/dist/packem_shared/target-options-CR0OuYJr.js +1 -0
  229. package/dist/packem_shared/toolchain-Zb3VzZb4.js +5 -0
  230. package/dist/packem_shared/typosquats-C12CP_2G.js +1 -0
  231. package/dist/packem_shared/use-measured-height-CjS7Tks7.js +1 -0
  232. package/dist/packem_shared/utils-CRueU43T.js +1 -0
  233. package/dist/packem_shared/verify-DStfg3nb.js +1 -0
  234. package/dist/packem_shared/vis-update-app-BlocL713.js +1 -0
  235. package/dist/packem_shared/watch-BXNI7dC6.js +1 -0
  236. package/dist/packem_shared/watch-loop-BZudYfcl.js +11 -0
  237. package/dist/release/core/changelog/index.d.ts +5 -0
  238. package/dist/release/core/changelog/index.js +1 -0
  239. package/dist/release/core/package-managers/index.d.ts +6 -0
  240. package/dist/release/core/package-managers/index.js +1 -0
  241. package/dist/release/core/version-actions/index.d.ts +14 -0
  242. package/dist/release/core/version-actions/index.js +1 -0
  243. package/dist/release/index.d.ts +233 -0
  244. package/dist/release/index.js +1 -0
  245. package/dist/release/plugin-sdk.d.ts +128 -0
  246. package/dist/release/plugin-sdk.js +1 -0
  247. package/dist/release/presets.d.ts +225 -0
  248. package/dist/release/presets.js +1 -0
  249. package/dist/release/types.d.ts +1493 -0
  250. package/dist/release/types.js +1 -0
  251. package/dist/runtime/preload.d.ts +1 -0
  252. package/dist/runtime/preload.js +1 -0
  253. package/index.d.ts +450 -0
  254. package/index.js +80 -57
  255. package/package.json +87 -44
  256. package/schemas/project.schema.json +872 -225
  257. package/schemas/vis-config.schema.json +6309 -264
  258. package/schemas/vis-release-config.schema.json +1423 -0
  259. package/skills/vis/SKILL.md +96 -0
  260. package/templates/buildkite-ci/.buildkite/pipeline.yml.tera +85 -0
  261. package/templates/buildkite-ci/template.yml +20 -0
  262. package/dist/config.d.ts +0 -1087
  263. package/dist/config.js +0 -1
  264. package/dist/packem_shared/VisUpdateApp-BBx3idMI.js +0 -1
  265. package/dist/packem_shared/ai-analysis-DDqXRFxY.js +0 -67
  266. package/dist/packem_shared/bin-BaZZ32BK.js +0 -93
  267. package/dist/packem_shared/cache-directory-DL8hfXeG.js +0 -1
  268. package/dist/packem_shared/catalog-CuSpuB_R.js +0 -12
  269. package/dist/packem_shared/dependency-scan-BoLG2Fez.js +0 -1
  270. package/dist/packem_shared/docker-BcfqH4Av.js +0 -2
  271. package/dist/packem_shared/flakiness-DSIHZGBT.js +0 -1
  272. package/dist/packem_shared/otelPlugin-DxyvBcXO.js +0 -1
  273. package/dist/packem_shared/runtime-check-CGHal8SO.js +0 -1
  274. package/dist/packem_shared/selectors-CfH9ZY08.js +0 -3
  275. package/dist/packem_shared/symbols-CIMw60-G.js +0 -1
  276. package/dist/packem_shared/toolchain-C3ZG0o_X.js +0 -5
  277. package/dist/packem_shared/typosquats-Bpq4zcWL.js +0 -1
  278. package/dist/packem_shared/utils-DrNg0XTR.js +0 -1
@@ -1,153 +1,27 @@
1
- var ve=Object.defineProperty;var d=(e,t)=>ve(e,"name",{value:t,configurable:!0});import{createRequire as be}from"node:module";import{isAccessibleSync as P,ensureDirSync as w,writeFileSync as h,readJsonSync as se}from"@visulima/fs";import{resolve as _,basename as xe,relative as K,join as l,sep as $e,isAbsolute as je}from"@visulima/path";import{f as g,o as x,R as $,O as o,t as de,c as m,y as R,K as _e,I as Oe,m as Ce}from"../packem_shared/bin-BaZZ32BK.js";import{downloadTemplate as De}from"giget";const we=be(import.meta.url),I=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Y=d(e=>{if(typeof I<"u"&&I.versions&&I.versions.node){const[t,r]=I.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return I.getBuiltinModule(e)}return we(e)},"__cjs_getBuiltinModule"),{spawnSync:ke}=Y("node:child_process"),{createInterface:Ne}=Y("node:readline"),{readdirSync:Pe,chmodSync:Se}=Y("node:fs");var Ee=Object.defineProperty,U=d((e,t)=>Ee(e,"name",{value:t,configurable:!0}),"e");const qe={"vis:app":"builtin:app","vis:application":"builtin:app","vis:generator":"builtin:generator","vis:lib":"builtin:library","vis:library":"builtin:library","vis:monorepo":"builtin:monorepo"},Ie=["https://github.com/","https://gitlab.com/","https://bitbucket.org/","https://raw.githubusercontent.com/","https://git.sr.ht/","git@github.com:","git@gitlab.com:","git@bitbucket.org:","git@git.sr.ht:","github:","gh:","gitlab:","bitbucket:","sourcehut:","git:","http://","https://"],Te=U(e=>{for(const t of Ie)if(e.startsWith(t))return!0;return!!(!e.startsWith("@")&&/^[^/#@][^/#]*\/[^/#]+/.test(e))},"isGitUrl"),Re=new Set(["sv"]),Me=U(e=>{if(Re.has(e)||e.startsWith("create-")||e.startsWith("@")&&e.includes("/create-"))return e;if(e.startsWith("@")){const t=e.indexOf("/");if(t!==-1){const r=e.slice(0,t),a=e.slice(t+1);return`${r}/create-${a}`}return e}return`create-${e}`},"expandCreateShorthand"),Ae=U((e,t=[])=>{if(!e)throw new Error("No template specified.");const r=e.toLowerCase(),a=qe[r];return a?{args:t,source:r,type:a}:Te(e)?{args:t,source:e,type:"remote:git"}:{args:t,source:Me(e),type:"remote:npm"}},"discoverTemplate"),ze=U(e=>{switch(e){case"builtin:app":return"apps";case"builtin:generator":case"builtin:library":return"packages";default:return"."}},"inferParentDir");var Le=Object.defineProperty,me=d((e,t)=>Le(e,"name",{value:t,configurable:!0}),"i$2");const le=["ability","able","about","above","abroad","absence","absolute","absolutely","absorb","academic","accept","access","accompany","accomplish","according","account","accurate","achieve","achievement","acid","acknowledge","acquire","across","act","action","active","activist","activity","actor","actress","actual","actually","adapt","add","addition","additional","address","adequate","adjust","adjustment","administration","administrator","admire","admission","admit","adolescent","adopt","adult","advance","advanced","advantage","adventure","advertising","advice","advise","adviser","advocate","affair","affect","afford","after","afternoon","again","against","age","agency","agenda","agent","ago","agree","agreement","agricultural","ahead","aid","aide","aim","air","aircraft","airline","airport","album","alive","all","alliance","allow","ally","almost","alone","along","already","also","alter","alternative","although","always","amazing","among","amount","analysis","analyst","analyze","ancient","and","angle","animal","anniversary","announce","annual","another","answer","anticipate","any","anybody","anymore","anyone","anything","anyway","anywhere","apart","apartment","apparent","apparently","appeal","appear","appearance","apple","application","apply","appoint","appointment","appreciate","approach","appropriate","approval","approve","approximately","architect","area","argue","argument","arise","arm","armed","around","arrange","arrangement","arrival","arrive","art","article","artist","artistic","aside","ask","asleep","aspect","assert","assess","assessment","asset","assign","assignment","assist","assistance","assistant","associate","association","assume","assumption","assure","athlete","athletic","atmosphere","attach","attempt","attend","attention","attitude","attorney","attract","attractive","attribute","audience","author","authority","auto","available","average","avoid","award","aware","awareness","away","awesome","baby","back","background","bag","bake","balance","ball","ban","band","bank","bar","barely","barrel","base","baseball","basic","basically","basis","basket","basketball","bathroom","battery","beach","bean","bear","beat","beautiful","beauty","because","become","bed","bedroom","beer","before","begin","beginning","behavior","behind","being","belief","believe","bell","belong","below","belt","bench","bend","beneath","benefit","beside","besides","best","bet","better","between","beyond","big","bike","bill","billion","bind","biological","bird","birth","birthday","bit","bite","black","blade","blanket","blind","block","blow","blue","board","boat","body","bond","bone","book","boom","boot","border","born","borrow","boss","both","bother","bottle","bottom","boundary","bowl","box","boy","boyfriend","brain","branch","brand","bread","break","breakfast","breast","breath","breathe","brick","bridge","brief","briefly","bright","brilliant","bring","broad","brother","brown","brush","buck","budget","build","building","bullet","bunch","bury","bus","business","busy","but","butter","button","buy","buyer","cabin","cabinet","cable","cake","calculate","call","camera","camp","campaign","campus","can","candidate","cap","capability","capable","capacity","capital","captain","capture","car","carbon","card","care","career","careful","carefully","carrier","carry","case","cash","cast","cat","catch","category","cause","ceiling","celebrate","celebration","celebrity","cell","center","central","century","ceremony","certain","certainly","chain","chair","chairman","challenge","chamber","champion","championship","chance","change","changing","channel","chapter","character","characteristic","characterize","charge","charity","chart","chase","cheap","check","cheek","cheese","chef","chemical","chest","chicken","chief","child","childhood","chip","chocolate","choice","cholesterol","choose","church","cigarette","circle","circumstance","cite","citizen","city","civil","civilian","claim","class","classic","classroom","clean","clear","clearly","client","climate","climb","clinic","clinical","clock","close","closely","closer","clothes","clothing","cloud","club","clue","cluster","coach","coal","coalition","coast","coat","code","coffee","cognitive","cold","colleague","collect","collection","collective","college","colonial","color","column","combination","combine","come","comedy","comfort","comfortable","command","commander","comment","commercial","commission","commit","commitment","committee","common","communicate","communication","community","company","compare","comparison","compete","competition","competitive","competitor","complete","completely","complex","complicated","component","compose","composition","comprehensive","computer","concentrate","concentration","concept","concern","concerned","concert","conclude","conclusion","concrete","condition","conduct","conference","confidence","confident","confirm","confront","confusion","congressional","connect","connection","consciousness","consensus","consequence","conservative","consider","considerable","consideration","consist","consistent","constant","constantly","constitute","constitutional","construct","construction","consultant","consume","consumer","consumption","contact","contain","container","contemporary","content","contest","context","continue","continued","contract","contrast","contribute","contribution","control","convention","conventional","conversation","convert","conviction","convince","cook","cookie","cooking","cool","cooperation","cop","cope","copy","core","corn","corner","corporate","corporation","correct","correspondent","cost","cotton","couch","could","council","counselor","count","counter","country","county","couple","courage","course","court","cousin","cover","coverage","cow","crack","craft","cream","create","creation","creative","creature","credit","crew","criteria","crop","cross","crowd","crucial","cultural","culture","cup","curious","current","currently","curriculum","custom","customer","cut","cycle","dad","daily","dance","dare","dark","darkness","data","date","daughter","day","deal","dealer","dear","debate","decade","decide","decision","deck","declare","decrease","deep","deeply","deer","defend","defendant","defense","defensive","define","definitely","definition","degree","delay","deliver","delivery","demand","democracy","democratic","demonstrate","demonstration","deny","department","depend","dependent","depending","depict","depth","deputy","derive","describe","description","desert","deserve","design","designer","desire","desk","desperate","despite","detail","detailed","detect","determine","develop","developing","development","device","devote","dialogue","diet","differ","difference","different","differently","difficult","difficulty","dig","digital","dimension","dining","dinner","direct","direction","directly","director","disability","disagree","disappear","discipline","discourse","discover","discovery","discuss","discussion","dish","dismiss","display","distance","distant","distinct","distinction","distinguish","distribute","distribution","district","diverse","diversity","divide","division","doctor","document","dog","domestic","dominant","dominate","door","double","down","downtown","dozen","draft","drag","drama","dramatic","dramatically","draw","drawing","dream","dress","drink","drive","driver","drop","dry","due","during","dust","duty","each","eager","ear","early","earn","earnings","earth","ease","easily","east","eastern","easy","eat","economic","economics","economist","economy","edge","edition","editor","educate","education","educational","educator","effect","effective","effectively","efficiency","efficient","effort","egg","eight","either","elderly","elect","election","electric","electricity","electronic","element","elementary","eliminate","elite","else","elsewhere","embrace","emerge","emission","emotion","emotional","emphasis","emphasize","employ","employee","employer","employment","empty","enable","encounter","encourage","end","energy","enforcement","engage","engine","engineer","engineering","enhance","enjoy","enormous","enough","ensure","enter","enterprise","entertainment","entire","entirely","entrance","entry","environment","environmental","episode","equal","equally","equipment","era","escape","especially","essay","essential","essentially","establish","establishment","estate","estimate","etc","ethics","ethnic","evaluate","evaluation","even","evening","event","eventually","ever","every","everybody","everyday","everyone","everything","everywhere","evidence","evolution","evolve","exact","exactly","examination","examine","example","exceed","excellent","except","exception","exchange","exciting","executive","exercise","exhibit","exhibition","exist","existence","existing","expand","expansion","expect","expectation","expense","expensive","experience","experiment","expert","explain","explanation","explore","expose","express","expression","extend","extension","extensive","extent","external","extra","extraordinary","extreme","extremely","eye","fabric","face","facility","fact","factor","factory","faculty","fade","fair","fairly","faith","fall","false","familiar","family","famous","fan","fantasy","far","farm","farmer","fashion","fast","fate","father","favor","favorite","feature","federal","fee","feed","feel","feeling","fellow","female","fence","few","fewer","fiber","fiction","field","fifteen","fifth","fifty","figure","file","fill","film","final","finally","finance","financial","find","finding","fine","finger","finish","firm","first","fish","fishing","fit","fitness","five","fix","flag","flame","flat","flavor","flesh","flight","float","floor","flow","flower","fly","focus","folk","follow","following","food","foot","football","for","force","foreign","forest","forever","forget","form","formal","formation","former","formula","forth","fortune","forward","found","foundation","founder","four","fourth","frame","framework","free","freedom","freeze","frequency","frequent","frequently","fresh","friend","friendly","friendship","from","front","fruit","fuel","full","fully","fun","function","fund","fundamental","funding","funeral","funny","furniture","furthermore","future","gain","galaxy","gallery","game","gap","garage","garden","garlic","gas","gate","gather","gaze","gear","gender","gene","general","generally","generate","generation","genetic","gentleman","gently","gesture","get","ghost","giant","gift","gifted","girl","girlfriend","give","given","glad","glance","glass","global","glove","goal","gold","golden","golf","good","government","governor","grab","grade","gradually","graduate","grain","grand","grandfather","grandmother","grant","grass","grave","gray","great","greatest","green","grocery","ground","group","grow","growing","growth","guarantee","guard","guess","guest","guide","guideline","guy","habit","habitat","hair","half","hall","hand","handful","handle","hang","happen","happy","hard","hardly","hat","have","head","headline","headquarters","health","healthy","hear","hearing","heart","heat","heaven","heavily","heavy","heel","height","helicopter","hello","help","helpful","here","heritage","hero","herself","hey","hide","high","highlight","highly","highway","hill","himself","hip","hire","historian","historic","historical","history","hit","hold","hole","holiday","holy","home","honest","honey","honor","hope","horizon","horse","hospital","host","hot","hotel","hour","house","household","housing","how","however","huge","human","humor","hundred","hungry","hunter","hunting","husband","hypothesis","ice","idea","ideal","identification","identify","identity","ignore","illustrate","image","imagination","imagine","immediate","immediately","immigrant","immigration","impact","implement","implication","imply","importance","important","impose","impossible","impress","impression","impressive","improve","improvement","incentive","incident","include","including","income","incorporate","increase","increased","increasing","increasingly","incredible","indeed","independence","independent","index","indicate","indication","individual","industrial","industry","infant","inflation","influence","inform","information","ingredient","initial","initially","initiative","inner","innocent","inquiry","inside","insight","insist","inspire","install","instance","instead","institution","institutional","instruction","instructor","instrument","insurance","intellectual","intelligence","intend","intense","intensity","intention","interaction","interest","interested","interesting","internal","international","interpret","interpretation","intervention","interview","into","introduce","introduction","invest","investigate","investigation","investigator","investment","investor","invite","involve","involved","involvement","iron","island","issue","item","its","itself","jacket","jet","job","join","joint","joke","journal","journalist","journey","joy","judge","judgment","juice","jump","junior","jury","just","justice","justify","keep","key","kick","kid","kind","king","kiss","kitchen","knee","knife","knock","know","knowledge","lab","label","labor","laboratory","lady","lake","land","landscape","language","lap","large","largely","last","late","later","latter","laugh","launch","law","lawn","lawsuit","lawyer","lay","layer","lead","leader","leadership","leading","leaf","league","lean","learn","learning","least","leather","leave","left","leg","legacy","legal","legend","legislation","legitimate","lemon","length","less","lesson","let","letter","level","liberal","library","license","lie","life","lifestyle","lifetime","lift","light","like","likely","limit","limitation","limited","line","link","lip","list","listen","literally","literary","literature","little","live","living","load","loan","local","locate","location","lock","long","look","loose","lose","lost","lot","lots","loud","love","lovely","lover","low","lower","luck","lucky","lunch","lung","machine","magazine","mail","main","mainly","maintain","maintenance","major","majority","make","maker","makeup","male","mall","man","manage","management","manager","manner","manufacturer","manufacturing","many","map","margin","mark","market","marketing","marriage","married","marry","mask","mass","massive","master","match","material","math","matter","may","maybe","mayor","meal","mean","meaning","meanwhile","measure","measurement","meat","mechanism","media","medical","medication","medicine","medium","meet","meeting","member","membership","memory","mental","mention","menu","mere","merely","message","metal","meter","method","middle","might","military","milk","million","mind","mine","minister","minor","minority","minute","miracle","mirror","miss","missile","mission","mix","mixture","mode","model","moderate","modern","modest","mom","moment","money","monitor","month","mood","moon","moral","more","moreover","morning","mortgage","most","mostly","mother","motion","motivation","motor","mount","mountain","mouse","mouth","move","movement","movie","much","multiple","muscle","museum","music","musical","musician","must","mutual","myself","mystery","myth","naked","name","narrative","narrow","nation","national","native","natural","naturally","nature","near","nearby","nearly","necessarily","necessary","neck","need","negative","negotiate","negotiation","neighbor","neighborhood","neither","nerve","net","network","never","nevertheless","new","newly","news","newspaper","next","nice","night","nine","nobody","nod","nomination","none","nonetheless","nor","normal","normally","north","northern","nose","not","note","nothing","notice","notion","novel","now","nowhere","nuclear","number","numerous","nurse","nut","object","objective","obligation","observation","observe","observer","obtain","obvious","obviously","occasion","occasionally","occupation","occupy","occur","ocean","odd","odds","off","offer","office","officer","official","often","oil","okay","old","once","one","ongoing","onion","online","only","onto","open","opening","operate","operating","operation","operator","opinion","opponent","opportunity","oppose","opposite","opposition","option","orange","order","ordinary","organic","organization","organize","orientation","origin","original","originally","other","others","otherwise","ought","our","ourselves","out","outcome","outside","oven","over","overall","overcome","overlook","owe","own","owner","pace","pack","package","page","paint","painter","painting","pair","pale","palm","pan","panel","pant","paper","parent","park","parking","part","participant","participate","participation","particular","particularly","partly","partner","partnership","party","pass","passage","passenger","passion","past","patch","path","patient","pattern","pause","pay","payment","peace","peak","peer","people","pepper","per","perceive","percentage","perception","perfect","perfectly","perform","performance","perhaps","period","permanent","permission","permit","person","personal","personality","personally","personnel","perspective","persuade","pet","phase","phenomenon","philosophy","phone","photo","photograph","photographer","phrase","physical","physically","physician","piano","pick","picture","pie","piece","pile","pilot","pine","pink","pipe","pitch","place","plan","plane","planet","planning","plant","plastic","plate","platform","play","player","please","pleasure","plenty","plot","plus","pocket","poem","poet","poetry","point","pole","police","policy","political","politically","politician","politics","poll","pool","pop","popular","population","porch","port","portion","portrait","portray","pose","position","positive","possess","possibility","possible","possibly","post","pot","potato","potential","potentially","pound","pour","powder","power","powerful","practical","practice","pray","prayer","precisely","predict","prefer","preference","pregnancy","pregnant","preparation","prepare","prescription","presence","present","presentation","preserve","president","presidential","press","pretend","pretty","prevent","previous","previously","price","pride","priest","primarily","primary","prime","principal","principle","print","prior","priority","privacy","private","probably","procedure","proceed","process","produce","producer","product","production","profession","professional","professor","profile","profit","program","progress","project","prominent","promise","promote","prompt","proof","proper","properly","property","proportion","proposal","propose","proposed","prosecutor","prospect","protect","protection","protein","protest","proud","prove","provide","provider","province","provision","psychological","psychologist","psychology","public","publication","publicly","publish","publisher","pull","purchase","pure","purpose","pursue","push","put","qualify","quality","quarter","quarterback","question","quick","quickly","quiet","quietly","quit","quite","quote","race","racial","radical","radio","rail","rain","raise","range","rank","rapid","rapidly","rare","rarely","rate","rather","rating","ratio","raw","reach","react","reaction","read","reader","reading","ready","real","reality","realize","really","reason","reasonable","recall","receive","recent","recently","recipe","recognition","recognize","recommend","recommendation","record","recording","recover","recovery","recruit","red","reduce","reduction","refer","reference","reflect","reflection","reform","refugee","refuse","regard","regarding","regardless","regime","region","regional","register","regular","regularly","regulate","regulation","reinforce","relate","relation","relationship","relative","relatively","relax","release","relevant","relief","religion","religious","rely","remain","remaining","remarkable","remember","remind","remote","remove","repeat","repeatedly","replace","reply","report","reporter","represent","representation","representative","reputation","request","require","requirement","research","researcher","resemble","reservation","resident","resist","resolution","resolve","resort","resource","respect","respond","respondent","response","responsibility","responsible","rest","restaurant","restore","restriction","result","retain","retire","retirement","return","reveal","revenue","review","revolution","rhythm","rice","rich","rid","ride","rifle","right","ring","rise","river","road","rock","role","roll","romantic","roof","room","root","rope","rose","roughly","round","route","routine","row","rub","rule","run","running","rural","rush","sacred","safe","safety","sake","salad","salary","sale","sales","salt","same","sample","sanction","sand","satellite","satisfaction","satisfy","sauce","save","saving","say","scale","scenario","scene","schedule","scheme","scholar","scholarship","school","science","scientific","scientist","scope","score","screen","script","sea","search","season","seat","second","secret","secretary","section","sector","secure","security","see","seed","seek","seem","segment","seize","select","selection","self","sell","senator","send","senior","sense","sensitive","sentence","separate","sequence","series","serious","seriously","serve","service","session","set","setting","settle","settlement","seven","several","shade","shadow","shake","shall","shape","share","sharp","sheet","shelf","shell","shelter","shift","shine","ship","shirt","shoe","shop","shopping","shore","short","shortly","shot","should","shoulder","shout","show","shower","shrug","shut","side","sigh","sight","sign","signal","significance","significant","significantly","silence","silent","silver","similar","similarly","simple","simply","since","sing","singer","single","sink","sir","sister","sit","site","situation","six","size","ski","skill","skin","sky","sleep","slice","slide","slight","slightly","slip","slow","slowly","small","smart","smell","smile","smooth","snap","snow","soccer","social","society","soft","software","soil","solar","solid","solution","solve","some","somebody","somehow","someone","something","sometimes","somewhat","somewhere","son","song","soon","sophisticated","sorry","sort","soul","sound","soup","source","south","southern","space","speak","speaker","special","specialist","species","specific","specifically","speech","speed","spend","spending","spin","spirit","spiritual","split","spokesman","sport","spot","spread","spring","square","squeeze","stability","stable","staff","stage","stair","stake","stand","standard","standing","star","stare","start","state","statement","station","statistics","status","stay","steady","steal","steel","step","stick","still","stir","stock","stomach","stone","stop","storage","store","storm","story","straight","strange","stranger","strategic","strategy","stream","street","strength","strengthen","stretch","string","strip","strong","strongly","structure","student","studio","study","stuff","style","subject","submit","subsequent","substance","substantial","succeed","success","successful","successfully","such","sudden","suddenly","sue","sufficient","sugar","suggest","suggestion","suit","summer","summit","sun","super","supply","support","supporter","suppose","supposed","sure","surely","surface","surgery","surprise","surprised","surprising","surprisingly","surround","survey","survival","survive","survivor","sustain","swear","sweep","sweet","swim","swing","switch","symbol","system","table","tablespoon","tactic","tail","take","tale","talent","talk","tall","tank","tap","tape","target","task","taste","tax","taxpayer","tea","teach","teacher","teaching","team","tear","teaspoon","technical","technique","technology","teen","teenager","telephone","telescope","television","tell","temperature","temporary","ten","tend","tendency","tennis","tent","term","terms","territory","test","testify","testimony","testing","text","than","thank","thanks","that","the","theater","their","them","theme","themselves","then","theory","therapy","there","therefore","thick","thin","thing","think","thinking","third","thirty","though","thought","thousand","three","throat","through","throughout","throw","ticket","tie","tight","time","tiny","tip","tire","tired","tissue","title","today","toe","together","tomato","tomorrow","tone","tongue","tonight","too","tool","tooth","top","topic","toss","total","totally","touch","tough","tour","tourist","tournament","tower","town","toy","trace","track","trade","tradition","traditional","traffic","trail","train","training","transfer","transform","transformation","transition","translate","transportation","travel","treat","treatment","treaty","tree","tremendous","trend","trial","tribe","trip","troop","truck","true","truly","trust","truth","try","tube","tunnel","turn","twelve","twenty","twice","twin","two","type","typical","typically","ultimate","ultimately","unable","uncle","under","undergo","understand","understanding","unfortunately","uniform","union","unique","unit","universal","universe","university","unknown","unless","unlike","unlikely","until","unusual","upon","upper","urban","urge","use","used","useful","user","usual","usually","utility","vacation","valley","valuable","value","variable","variation","variety","various","vary","vast","vegetable","vehicle","venture","version","versus","very","vessel","veteran","via","victory","video","view","viewer","village","virtually","virtue","visible","vision","visit","visitor","visual","vital","voice","volume","volunteer","vote","voter","wage","wait","wake","walk","wall","wander","want","warm","warn","warning","wash","watch","water","wave","way","wealth","wealthy","wear","weather","wedding","week","weekend","weekly","weigh","weight","welcome","welfare","well","west","western","wet","what","whatever","wheel","when","whenever","where","whereas","whether","which","while","whisper","white","who","whole","whom","whose","why","wide","widely","widespread","wife","wild","will","willing","win","wind","window","wine","wing","winner","winter","wipe","wire","wisdom","wise","wish","with","withdraw","within","without","witness","woman","wonder","wonderful","wood","wooden","word","work","worker","working","works","workshop","world","worried","worth","would","wrap","write","writer","writing","yard","yeah","year","yell","yellow","yes","yesterday","yield","young","your","yours","yourself","youth","zone"],Ge=me((e,t)=>Math.floor(e+Math.random()*(t-e+1)),"random");function H(){return le[Ge(0,le.length-1)]}d(H,"getRandomWord");me(H,"getRandomWord");var Ue=Object.defineProperty,Fe=d((e,t)=>Ue(e,"name",{value:t,configurable:!0}),"o$1");const Be=Fe(()=>`${H()}-${H()}`,"randomName");var Je=Object.defineProperty,S=d((e,t)=>Je(e,"name",{value:t,configurable:!0}),"t");function ge(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}d(ge,"getDefaultExportFromCjs");S(ge,"getDefaultExportFromCjs");function Ve(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}d(Ve,"getDefaultExportFromNamespaceIfPresent");S(Ve,"getDefaultExportFromNamespaceIfPresent");function We(e){return e&&Object.prototype.hasOwnProperty.call(e,"default")&&Object.keys(e).length===1?e.default:e}d(We,"getDefaultExportFromNamespaceIfNotNamed");S(We,"getDefaultExportFromNamespaceIfNotNamed");function He(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var t=e.default;if(typeof t=="function"){var r=S(d(function a(){var i=!1;try{i=this instanceof a}catch{}return i?Reflect.construct(t,arguments,this.constructor):t.apply(this,arguments)},"a"),"a");r.prototype=t.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(e).forEach(function(a){var i=Object.getOwnPropertyDescriptor(e,a);Object.defineProperty(r,a,i.get?i:{enumerable:!0,get:S(function(){return e[a]},"get")})}),r}d(He,"getAugmentedNamespace");S(He,"getAugmentedNamespace");var J,ce;function Ye(){return ce||(ce=1,J=["_http_agent","_http_client","_http_common","_http_incoming","_http_outgoing","_http_server","_stream_duplex","_stream_passthrough","_stream_readable","_stream_transform","_stream_wrap","_stream_writable","_tls_common","_tls_wrap","assert","assert/strict","async_hooks","buffer","child_process","cluster","console","constants","crypto","dgram","diagnostics_channel","dns","dns/promises","domain","events","fs","fs/promises","http","http2","https","inspector","inspector/promises","module","net","os","path","path/posix","path/win32","perf_hooks","process","punycode","querystring","readline","readline/promises","repl","stream","stream/consumers","stream/promises","stream/web","string_decoder","sys","timers","timers/promises","tls","trace_events","tty","url","util","util/types","v8","vm","wasi","worker_threads","zlib","node:sea","node:sqlite","node:test","node:test/reporters"]),J}d(Ye,"requireBuiltinModules");var V,pe;function Ke(){if(pe)return V;pe=1;var e=Object.defineProperty,t=d((n,c)=>e(n,"name",{value:c,configurable:!0}),"i");const r=Ye();var a=new RegExp("^(?:@([^/]+?)[/])?([^/]+?)$"),i=["node_modules","favicon.ico"];function u(n){var c=[],s=[];if(n===null)return s.push("name cannot be null"),p(c,s);if(n===void 0)return s.push("name cannot be undefined"),p(c,s);if(typeof n!="string")return s.push("name must be a string"),p(c,s);if(n.length||s.push("name length must be greater than zero"),n.startsWith(".")&&s.push("name cannot start with a period"),n.startsWith("-")&&s.push("name cannot start with a hyphen"),n.match(/^_/)&&s.push("name cannot start with an underscore"),n.trim()!==n&&s.push("name cannot contain leading or trailing spaces"),i.forEach(function(f){n.toLowerCase()===f&&s.push(f+" is not a valid package name")}),r.includes(n.toLowerCase())&&c.push(n+" is a core module name"),n.length>214&&c.push("name can no longer contain more than 214 characters"),n.toLowerCase()!==n&&c.push("name can no longer contain capital letters"),/[~'!()*]/.test(n.split("/").slice(-1)[0])&&c.push(`name can no longer contain special characters ("~'!()*")`),encodeURIComponent(n)!==n){var k=n.match(a);if(k){var j=k[1],v=k[2];if(v.startsWith(".")&&s.push("name cannot start with a period"),encodeURIComponent(j)===j&&encodeURIComponent(v)===v)return p(c,s)}s.push("name can only contain URL-friendly characters")}return p(c,s)}d(u,"validate"),t(u,"validate");var p=t(function(n,c){var s={validForNewPackages:c.length===0&&n.length===0,validForOldPackages:c.length===0,warnings:n,errors:c};return s.warnings.length||delete s.warnings,s.errors.length||delete s.errors,s},"done");return V=u,V}d(Ke,"requireLib");var Qe=Ke();const Xe=ge(Qe);var Ze=Object.defineProperty,A=d((e,t)=>Ze(e,"name",{value:t,configurable:!0}),"r$2");const he=A(e=>e?Xe(e).validForNewPackages:!1,"isValidPackageName"),M=A(e=>e.toLowerCase().trim().replaceAll(/\s+/g,"-").replaceAll(/[^a-z\d\-~]/g,"-").replace(/^[._-]+/,"").replaceAll(/-{2,}/g,"-").replace(/-$/,""),"toValidPackageName"),et=new Set([".DS_Store",".git",".gitkeep","Thumbs.db"]),fe=A(e=>P(e)?Pe(e).every(t=>et.has(t)):!0,"isEmptyDir"),tt=A((e,t)=>{const r=_(t,e);return{packageName:M(xe(r)),targetDir:r}},"resolveTargetDir"),rt=A(e=>fe(e),"canSafelyOverwrite");var at=Object.defineProperty,F=d((e,t)=>at(e,"name",{value:t,configurable:!0}),"l$4");const T=F((e,t)=>new Promise(r=>{e.question(t,a=>{r(a.trim())})}),"ask"),W=F(async(e,t,r=!0)=>{const a=await T(e,` ${t} ${g(r?"[Y/n]":"[y/N]")} `);return a===""?r:a.toLowerCase()==="y"||a.toLowerCase()==="yes"},"confirm"),ue=F(async(e,t,r)=>{process.stderr.write(` ${t}
2
- `);for(const[a,i]of r.entries()){const u=x($(` ${String(a+1)}.`)),p=i.hint?g(` — ${i.hint}`):"";process.stderr.write(`${u} ${i.label}${p}
3
- `)}for(;;){const a=await T(e,`
4
- ${g(`Enter choice (1-${String(r.length)}):`)} `),i=Number.parseInt(a,10);if(i>=1&&i<=r.length)return r[i-1].value;const u=r.find(p=>p.value===a||p.label.toLowerCase()===a.toLowerCase());if(u)return u.value;process.stderr.write(` ${g("Invalid choice. Try again.")}
5
- `)}},"select"),it=F(async e=>{const t=Ne({input:process.stdin,output:process.stdout});try{process.stderr.write(`
6
- ${x($("vis create"))} ${g("— project scaffolding")}
7
-
8
- `);const r=e.inMonorepo?[{hint:"Scaffold via create-vite",label:"Vis Application",value:"vis:app"},{hint:"Reusable package scaffold",label:"Vis Library",value:"vis:library"},{hint:"Code generator scaffold",label:"Vis Generator",value:"vis:generator"},{hint:"Enter an npm create-* package or GitHub URL",label:"Custom template",value:"__custom__"}]:[{hint:"Full workspace setup",label:"Vis Monorepo",value:"vis:monorepo"},{hint:"Scaffold via create-vite",label:"Vis Application",value:"vis:app"},{hint:"Reusable package scaffold",label:"Vis Library",value:"vis:library"},{hint:"Code generator scaffold",label:"Vis Generator",value:"vis:generator"},{hint:"Enter an npm create-* package or GitHub URL",label:"Custom template",value:"__custom__"}];let a=await ue(t,"Select a template:",r);if(a==="__custom__"&&(a=await T(t,`
9
- ${g("Template (npm package or GitHub URL):")} `),!a))throw new Error("No template specified.");const i=Be(),u=await T(t,`
10
- ${g(`Project name (${i}):`)} `)||i;if(!he(M(u)))throw new Error(`Invalid project name: "${u}". Must be a valid npm package name.`);const p=M(u),n=await T(t,` ${g(`Target directory (${p}):`)} `)||p;let c=!1;const s=_(e.cwd,n);if(!fe(s)&&(c=await W(t,`Directory "${n}" is not empty. Overwrite?`,!1),!c))throw new Error("Aborted — directory not empty.");let k;e.inMonorepo||(e.defaultPm?(k=e.defaultPm,process.stderr.write(` ${g(`Package manager: ${k} (from config)`)}
11
- `)):k=await ue(t,"Package manager:",[{label:"pnpm",value:"pnpm"},{label:"npm",value:"npm"},{label:"yarn",value:"yarn"},{label:"bun",value:"bun"}]));let j=!1;e.inMonorepo||(j=await W(t,"Initialize a git repository?",e.defaultGitInit??!1));const v=e.defaultEditor==="vscode",f=await W(t,"Generate VS Code configuration?",v)?"vscode":void 0;return process.stderr.write(`
12
- `),{editor:f,gitInit:j,overwrite:c,pm:k,projectName:u,targetDir:n,template:a}}finally{t.close()}},"runInteractivePrompts");var nt=Object.defineProperty,N=d((e,t)=>nt(e,"name",{value:t,configurable:!0}),"i$1");const ot=N((e,t)=>{o("Scaffolding application via create-vite...");const r=[K(t.cwd,t.targetDir)||".",...e.args];return r.includes("--no-immediate")||r.push("--no-immediate"),de(t.pm,{additionalPackages:[],args:r,package:"create-vite",shellMode:!1,silent:!1},t.cwd,t.logger)},"executeApp"),st=N(e=>`${JSON.stringify({devDependencies:{typescript:"^5.0.0",vitest:"^3.0.0"},exports:{".":{default:"./dist/index.js",types:"./dist/index.d.ts"}},files:["dist"],main:"./dist/index.js",name:e,scripts:{build:"tsc",dev:"tsc --watch",test:"vitest run","test:watch":"vitest"},type:"module",types:"./dist/index.d.ts",version:"0.0.1"},null,4)}
13
- `,"libraryPackageJson"),lt=N(()=>`${JSON.stringify({compilerOptions:{declaration:!0,declarationMap:!0,esModuleInterop:!0,module:"Node16",moduleResolution:"Node16",outDir:"./dist",rootDir:"./src",skipLibCheck:!0,sourceMap:!0,strict:!0,target:"ES2022"},include:["src/**/*"]},null,4)}
14
- `,"libraryTsconfig"),ct=N(e=>`/**
15
- * ${e} — library entry point.
16
- */
17
-
18
- export const greet = (name: string): string => \`Hello from ${e}, \${name}!\`;
19
- `,"librarySrcIndex"),pt=N(e=>`import { describe, expect, it } from "vitest";
20
-
21
- import { greet } from "../src/index";
22
-
23
- describe("${e}", () => {
24
- it("should greet", () => {
25
- expect(greet("world")).toBe("Hello from ${e}, world!");
26
- });
1
+ import{createRequire as D}from"node:module";import{m,y as B,f as $,T as b}from"../packem_shared/index-CE6MsgcV.js";import{findVisConfigFile as F,DEFAULT_MIN_RELEASE_AGE_MINUTES as h}from"./CONFIG_FILES.js";import{p as e}from"./cli-main.js";import{A as I}from"../packem_shared/pm-runner-CQcraCcu.js";import{w as P}from"../packem_shared/build-scripts-q__dKE2y.js";import{O as E}from"../packem_shared/native-config-sync-D-z2Uwqu.js";import{S as R}from"../packem_shared/min-release-age-C71MO72F.js";const N=D(import.meta.url),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=t=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[s,o]=g.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return g.getBuiltinModule(t)}return N(t)},{execFileSync:M}=T("node:child_process"),{createInterface:O}=T("node:readline"),G=t=>{const s=[];return $(m(t,"turbo.json"))&&s.push("turborepo"),$(m(t,"nx.json"))&&s.push("nx"),$(m(t,".moon"))&&s.push("moon"),s},x=(t,s)=>new Promise(o=>{t.question(s,i=>{o(i.trim())})}),u=async(t,s,o=!0)=>{const i=await x(t,`${s} ${o?"[Y/n]":"[y/N]"} `);return i===""?o:i.toLowerCase()==="y"||i.toLowerCase()==="yes"},w=(t,s)=>{const o=[],i=Object.entries(s.allowBuilds).filter(([,l])=>l).map(([l])=>` "${l}": true,`).join(`
2
+ `),a=[` installScripts: {
3
+ allow: ${i?`{
4
+ ${i}
5
+ }`:"{}"},
6
+ },`];s.minimumReleaseAge!==void 0&&a.push(` firstSeen: {
7
+ minutes: ${String(s.minimumReleaseAge)},
8
+ },`);let n=` policies: {
9
+ ${a.join(`
10
+ `)}
11
+ },`;return s.enableSocket&&(n+=`
12
+ socket: { enabled: true },`),s.enableDepsDev&&(n+=`
13
+ depsDev: { enabled: true },`),o.push(` security: {
14
+ ${n}
15
+ },`),s.staged&&o.push(` staged: {
16
+ "*": ["vis lint --staged --fix", "vis fmt --staged"],
17
+ },`),`import { defineConfig } from "@visulima/vis/config";
18
+
19
+ export default defineConfig({
20
+ ${o.join(`
21
+
22
+ `)}
27
23
  });
28
- `,"libraryTestIndex"),ut=N((e,t)=>{const{projectName:r,targetDir:a}=t;return o("Scaffolding library package..."),w(a),w(l(a,"src")),w(l(a,"__tests__")),h(l(a,"package.json"),st(r)),m("Created package.json"),h(l(a,"tsconfig.json"),lt()),m("Created tsconfig.json"),h(l(a,"src","index.ts"),ct(r)),m("Created src/index.ts"),h(l(a,"__tests__","index.test.ts"),pt(r)),m("Created __tests__/index.test.ts"),h(l(a,".gitignore"),`node_modules/
29
- dist/
30
- .env
31
- .DS_Store
32
- `),m("Created .gitignore"),0},"executeLibrary"),dt=N((e,t)=>{switch(e.type){case"builtin:app":return ot(e,t);case"builtin:library":return ut(e,t);default:throw new Error(`Unknown built-in template type: ${e.type}`)}},"executeBuiltin");var mt=Object.defineProperty,z=d((e,t)=>mt(e,"name",{value:t,configurable:!0}),"n");const gt=z((e,t)=>`${JSON.stringify({bin:{[e]:"./bin/index.js"},description:t,devDependencies:{typescript:"^5.0.0"},name:e,private:!0,scripts:{build:"tsc",dev:"tsc --watch"},type:"module",version:"0.0.1"},null,4)}
33
- `,"packageJson"),ht=z(e=>`#!/usr/bin/env node
34
-
35
- /**
36
- * ${e} — code generator
37
- *
38
- * Usage: npx ${e} [options]
39
- */
40
-
41
- console.log("Hello from ${e}!");
42
- `,"binIndex"),ft=z(()=>`${JSON.stringify({compilerOptions:{declaration:!0,esModuleInterop:!0,module:"Node16",moduleResolution:"Node16",outDir:"./dist",rootDir:"./src",skipLibCheck:!0,strict:!0,target:"ES2022"},include:["src/**/*","bin/**/*"]},null,4)}
43
- `,"tsconfigJson"),yt=z(()=>`/**
44
- * Generator core logic — export functions used by the CLI entry point.
45
- */
46
-
47
- export const generate = (): void => {
48
- // TODO: Implement your generator logic here
49
- };
50
- `,"srcIndex"),vt=z((e,t="")=>{const{projectName:r,targetDir:a}=e;o("Scaffolding code generator..."),w(a),w(l(a,"bin")),w(l(a,"src")),h(l(a,"package.json"),gt(r,t||`Code generator: ${r}`)),m("Created package.json");const i=l(a,"bin","index.js");return h(i,ht(r)),Se(i,493),m("Created bin/index.js (executable)"),h(l(a,"tsconfig.json"),ft()),m("Created tsconfig.json"),h(l(a,"src","index.ts"),yt()),m("Created src/index.ts"),0},"executeGeneratorTemplate");var bt=Object.defineProperty,D=d((e,t)=>bt(e,"name",{value:t,configurable:!0}),"s");const wt=D(e=>`${JSON.stringify({devDependencies:{"@visulima/vis":"latest"},name:e,packageManager:"pnpm@latest",private:!0,scripts:{build:"vis run build",dev:"vis run dev",lint:"vis run lint",test:"vis run test"},type:"module",version:"0.0.0"},null,4)}
51
- `,"rootPackageJson"),kt=D(()=>`packages:
52
- - "apps/*"
53
- - "packages/*"
54
- `,"pnpmWorkspaceYaml"),xt=D(()=>`# Dependencies
55
- node_modules/
56
-
57
- # Build output
58
- dist/
59
- .output/
60
-
61
- # Environment
62
- .env
63
- .env.local
64
- .env.*.local
65
-
66
- # IDE
67
- .vscode/*
68
- !.vscode/settings.json
69
- !.vscode/extensions.json
70
- .idea/
71
-
72
- # OS
73
- .DS_Store
74
- Thumbs.db
75
-
76
- # Logs
77
- *.log
78
- npm-debug.log*
79
- pnpm-debug.log*
80
-
81
- # Cache
82
- .turbo/
83
- .cache/
84
- `,"gitignore"),$t=D(()=>`root = true
85
-
86
- [*]
87
- indent_style = space
88
- indent_size = 4
89
- end_of_line = lf
90
- charset = utf-8
91
- trim_trailing_whitespace = true
92
- insert_final_newline = true
93
-
94
- [*.{yml,yaml}]
95
- indent_size = 2
96
-
97
- [*.md]
98
- trim_trailing_whitespace = false
99
- `,"editorconfig"),jt=D(e=>`# ${e}
100
-
101
- A monorepo powered by [vis](https://visulima.com/packages/vis).
102
-
103
- ## Getting Started
104
-
105
- \`\`\`bash
106
- # Install dependencies
107
- pnpm install
108
-
109
- # Run all apps in development mode
110
- pnpm dev
111
-
112
- # Build all packages
113
- pnpm build
114
-
115
- # Run tests
116
- pnpm test
117
- \`\`\`
118
-
119
- ## Structure
120
-
121
- \`\`\`
122
- ├── apps/ # Applications
123
- ├── packages/ # Shared packages & libraries
124
- ├── pnpm-workspace.yaml
125
- └── package.json
126
- \`\`\`
127
- `,"readmeMd"),_t=D(e=>{const{projectName:t,targetDir:r}=e;return o("Scaffolding monorepo workspace..."),w(r),w(l(r,"apps")),w(l(r,"packages")),h(l(r,"package.json"),wt(t)),m("Created package.json"),h(l(r,"pnpm-workspace.yaml"),kt()),m("Created pnpm-workspace.yaml"),h(l(r,".gitignore"),xt()),m("Created .gitignore"),h(l(r,".editorconfig"),$t()),m("Created .editorconfig"),h(l(r,"README.md"),jt(t)),m("Created README.md"),h(l(r,"apps",".gitkeep"),""),h(l(r,"packages",".gitkeep"),""),0},"executeMonorepoTemplate");var Ot=Object.defineProperty,Q=d((e,t)=>Ot(e,"name",{value:t,configurable:!0}),"i");const Ct={"create-nuxt":{monoArgs:["--no-gitInit"]},"create-vite":{args:["--no-immediate"]},sv:{args:["--no-install"],prependCommand:"create"}},Nt=Q((e,t,r)=>{const a=Ct[e];if(!a)return t;const i=[...t];if(a.prependCommand&&!i.includes(a.prependCommand)&&i.unshift(a.prependCommand),a.args)for(const u of a.args)i.includes(u)||i.push(u);if(r&&a.monoArgs)for(const u of a.monoArgs)i.includes(u)||i.push(u);return i},"applyAutoFixes"),Pt=Q((e,t)=>{const r=K(t.cwd,t.targetDir)||".",a=[...e.args];a.includes(r)||a.unshift(r);const i=Nt(e.source,a,t.inMonorepo);return o(`Running ${e.source} via ${t.pm.name} dlx...`),de(t.pm,{additionalPackages:[],args:i,package:e.source,shellMode:!1,silent:!1},t.cwd,t.logger)},"executeRemoteNpm"),St=Q(async(e,t)=>{const{createConfig:r}=t;o(`Downloading template from ${e.source}...`);try{const a=await De(e.source,{auth:r?.auth||process.env.GIGET_AUTH||process.env.GITHUB_TOKEN||process.env.GH_TOKEN||void 0,dir:t.targetDir,force:!0,preferOffline:r?.preferOffline,provider:r?.defaultProvider,registry:r?.registry});return o(`Downloaded to ${a.dir}`),0}catch(a){const i=a instanceof Error?a.message:String(a);return R(`Failed to download template: ${i}`),1}},"executeRemoteGit");var Dt=Object.defineProperty,Et=d((e,t)=>Dt(e,"name",{value:t,configurable:!0}),"r");const qt=Et(async(e,t)=>{switch(e.type){case"builtin:app":case"builtin:library":return dt(e,t);case"builtin:generator":return vt(t);case"builtin:monorepo":return _t(t);case"remote:git":return St(e,t);case"remote:npm":return Pt(e,t);default:throw new Error(`Unknown template type: ${e.type}`)}},"executeTemplate");var It=Object.defineProperty,O=d((e,t)=>It(e,"name",{value:t,configurable:!0}),"g");const Tt=O(e=>{const t=l(e,".vscode");w(t);const r=l(t,"settings.json"),a={"editor.defaultFormatter":"oxc.oxc-vscode","editor.formatOnSave":!0};if(P(r))try{const p=se(r);h(r,`${JSON.stringify({...a,...p},null,4)}
128
- `),m("Merged .vscode/settings.json")}catch{R("Could not merge .vscode/settings.json, skipping")}else h(r,`${JSON.stringify(a,null,4)}
129
- `),m("Created .vscode/settings.json");const i=l(t,"extensions.json"),u={recommendations:["oxc.oxc-vscode"]};if(P(i))try{const p=se(i);h(i,`${JSON.stringify({...p,recommendations:[...new Set([...p.recommendations||[],...u.recommendations])]},null,4)}
130
- `),m("Merged .vscode/extensions.json")}catch{R("Could not merge .vscode/extensions.json, skipping")}else h(i,`${JSON.stringify(u,null,4)}
131
- `),m("Created .vscode/extensions.json")},"generateVscodeConfig"),Rt=O((e,t)=>{const r=l(e,".ai");w(r);const a=l(r,"instructions");if(P(a))return;const i=`# Project Instructions
132
-
133
- This project was scaffolded with vis create.
134
-
135
- ## Development
136
-
137
- - Package manager: ${t}
138
- - Build: \`${t} run build\`
139
- - Test: \`${t} run test\`
140
- - Lint: \`${t} run lint\`
141
-
142
- ## Conventions
143
-
144
- - Use TypeScript strict mode
145
- - ESM modules (\`"type": "module"\`)
146
- - Follow Angular-style conventional commits
147
- `;h(a,i),m("Created .ai/instructions")},"generateAiInstructions"),Mt=O(e=>{ke("git",["init"],{cwd:e,stdio:"pipe"}).status===0?m("Initialized git repository"):R("Failed to initialize git repository")},"initGitRepo"),At=O((e,t,r,a=!1)=>(o("Installing dependencies..."),_e(t,{dev:!1,filter:[],force:!1,frozenLockfile:!1,ignoreScripts:!1,lockfileOnly:!1,noOptional:!1,offline:a,prod:!1,recursive:!1,silent:!1,workspaceRoot:!1},e,r)===0?(m("Dependencies installed"),!0):(R("Dependency installation failed (you can run install manually)"),!1)),"installDependencies"),zt=O(e=>{const t=e.split("#")[0].split("?")[0].replace(/\/+$/,"").replace(/\.git$/,"").split("/").filter(Boolean).at(-1)??"",r=t.includes(":")?t.split(":").pop()??t:t;return M(r)||"my-project"},"extractRepoName"),Lt=O(e=>{if(o(""),o(" Built-in templates:"),o(` ${x($("vis:monorepo"))} ${g("Full pnpm workspace setup")}`),o(` ${x($("vis:app"))} ${g("Application scaffold via create-vite")}`),o(` ${x($("vis:library"))} ${g("Reusable TypeScript library package")}`),o(` ${x($("vis:generator"))} ${g("Code generator scaffold with bin entry")}`),e&&Object.keys(e).length>0){o(""),o(" Config aliases (vis.config.ts → create.templates):");for(const[t,r]of Object.entries(e))o(` ${x($(t))}${" ".repeat(Math.max(1,16-t.length))}${g(r)}`)}o(""),o(" Remote templates:"),o(` ${g("Any npm create-* package:")} vis create vite`),o(` ${g("GitHub repository:")} vis create user/repo`),o(` ${g("GitLab / Bitbucket:")} vis create gitlab:user/repo`),o(` ${g("Full URL:")} vis create https://github.com/user/repo`),o(""),o(` ${g("Template args after --:")} vis create vite -- --template react-ts`),o("")},"listTemplates"),Gt=O((e,t,r,a)=>{const i=_(t)===_(e)?"":e;process.stderr.write(`
148
- `),m("Project created successfully!"),process.stderr.write(`
149
- `),Oe("Next steps:"),i&&o(` cd ${i}`),a||o(` ${r} install`),o(` ${r} run dev`),process.stderr.write(`
150
- `)},"printNextSteps"),Ht=O(async({argument:e,logger:t,options:r,rawUnknown:a,visConfig:i,workspaceRoot:u})=>{const p=Array.isArray(e)?e:e?[e]:[],n=i?.create;if(r.list){Lt(n?.templates);return}const c=r.cwd||u||process.cwd(),s=!!u,k=!!process.stdin.isTTY,j=Ce(c);let v,f,y,E=n?.defaultEditor,L=n?.gitInit??!1,X=[],q=j,Z=!1;if(p.length===0&&k&&!r.noInteractive){const b=await it({cwd:c,defaultEditor:n?.defaultEditor,defaultGitInit:n?.gitInit,defaultPm:n?.defaultPm,inMonorepo:s});v=b.template,f=b.projectName,y=_(c,b.targetDir),E=b.editor??E,L=b.gitInit,Z=b.overwrite,b.pm&&(q={name:b.pm,version:j.version})}else{if(p.length===0)throw new Error(`No template specified. Usage: vis create <template> [name] [-- args...]
151
- Use --list to see available templates, or run interactively in a terminal.`);{let b=[...a??[]];if(b.length===0){const ne=process.argv.slice(2),oe=ne.indexOf("--");oe!==-1&&(b=ne.slice(oe+1))}const C=p.indexOf("--"),ie=C===-1?p:p.slice(0,C);X=[...C===-1?[]:p.slice(C+1),...b],v=ie[0],f=ie[1],f||(f=zt(v)),E=r.editor==="vscode"?"vscode":E,L=!!r.gitInit||L}}if(!v)throw new Error("No template specified.");const G=n?.templates?.[v]??v,ee=Ae(G,X);if(!y){const b=s?ze(ee.type):".",C=tt(f,_(c,b));y=C.targetDir,f=C.packageName}const te=M(f??"");if(!he(te))throw new Error(`Invalid project name: "${f}". Use lowercase alphanumeric characters and hyphens.`);f=te;const ye=_(y),B=K(_(c),ye);if(B===".."||B.startsWith(`..${$e}`)||je(B))throw new Error(`Target directory "${y}" is outside the working directory. Use a name without "../" path segments.`);if(!Z&&!rt(y))throw new Error(`Target directory "${y}" is not empty.
152
- Use a different name or clear the directory first.`);G!==v&&o(`Alias: ${x($(v))} → ${g(G)}`),o(`Template: ${x($(G))}`),o(`Project: ${x(f)}`),o(`Target: ${g(y)}`),process.stderr.write(`
153
- `);const re=await qt(ee,{createConfig:n,cwd:c,inMonorepo:s,logger:t,pm:q,projectName:f,targetDir:y});if(re!==0){process.exitCode=re;return}E==="vscode"&&Tt(y),P(y)&&Rt(y,q.name),L&&!s&&Mt(y);let ae=!1;n?.install!==!1&&P(l(y,"package.json"))&&(ae=At(y,q,t,n?.preferOffline)),Gt(y,c,q.name,ae)},"execute");export{Ht as default};
24
+ `},q=async(t,s,o)=>{const i=O({input:process.stdin,output:process.stdout});e.info(`
25
+ vis init — interactive setup
26
+ `);const a=await u(i," Enable Socket.dev security scanning?");a&&(e.success(" Socket.dev enabled — scores, alerts, and supply chain data active."),process.env.VIS_SOCKET_TOKEN||e.notice(" Set VIS_SOCKET_TOKEN for a custom API token (optional).")),e.info("");const n=await u(i," Enable Google deps.dev (OpenSSF Scorecard + GHSA advisories)?");n&&e.success(" deps.dev enabled — Scorecard signals and advisories merged into the security report."),e.info("");const l=await u(i," Scan for packages with build scripts?"),p={};if(l){e.info(" Scanning node_modules...");const c=P(t,{});if(c.length>0){e.info(` Found ${String(c.length)} package${c.length===1?"":"s"} with build scripts:
27
+ `);for(const r of c){const f=await u(i,` Allow ${r}?`,!1),_=r.split(" (")[0]??r;p[_]=f,f&&e.success(` ✓ ${_} approved`)}}else e.info(" No packages with build scripts found.")}e.info("");const A=await u(i," Enforce a minimum release age (block freshly-published versions)?");let d;if(A){const c=await x(i,` Minimum age in minutes (default ${String(h)} = 2 days): `),r=c===""?h:Number.parseInt(c,10);d=Number.isFinite(r)&&r>0?r:h,e.success(` minimumReleaseAge: ${String(d)} minutes`)}e.info("");const y=await u(i," Set up pre-commit hooks (lint-staged)?",!1);let S=!1;(s.name==="pnpm"||s.name==="yarn"||s.name==="npm"||s.name==="bun")&&(e.info(""),S=await u(i,` Sync security settings to ${s.name} config?`));const v=G(t);if(v.length>0&&(e.info(""),e.info(` Detected existing tools: ${v.join(", ")}`),await u(i,` Run \`vis migrate\` for ${v.join(", ")}?`,!1))){i.close();const[c,...r]=s.name==="pnpm"?["pnpm","exec"]:s.name==="yarn"?["yarn","exec"]:s.name==="bun"?["bunx"]:["npx"];for(const f of v){e.info(` Migrating from ${f}...`);try{M(c,[...r,"vis","migrate",f],{cwd:t,stdio:"inherit"})}catch{e.warn(` Migration from ${f} had issues — run \`vis migrate ${f}\` manually.`)}}if($(o))e.success(`Migrated config written to ${o}`);else{const f=w(s.name,{allowBuilds:p,enableDepsDev:n,enableSocket:a,minimumReleaseAge:d,staged:y});b(o,f),e.success(`Created ${o}`)}e.notice(" Run 'vis doctor' to see your project's full health status.");return}i.close(),e.info("");const C=w(s.name,{allowBuilds:p,enableDepsDev:n,enableSocket:a,minimumReleaseAge:d,staged:y});if(b(o,C),e.success(`Created ${o}`),S){const c=Object.fromEntries(Object.entries(p).filter(([,r])=>r));for(const r of E(s.name,t,c))e.success(` ${r}`);for(const r of R(s.name,t,d))e.success(` ${r}`)}e.info(""),e.info(" Setup complete. Your config:");const j=[a&&"Socket.dev",n&&"deps.dev"].filter(Boolean);e.info(` Security: ${j.length>0?`${j.join(" + ")} enabled`:"defaults only"}`),e.info(` Build scripts: ${Object.values(p).filter(Boolean).length} approved`),e.info(` Min age: ${d===void 0?"not enforced":`${String(d)} minutes`}`),e.info(` Git hooks: ${y?"lint-staged configured":"not configured"}`),e.info(` PM sync: ${S?"done":"skipped"}`),e.info(""),e.notice(" Run 'vis doctor' to see your project's full health status."),e.info("")},K=(t,s,o,i)=>{const a=w(s.name,{allowBuilds:{},enableDepsDev:!1,enableSocket:!1,minimumReleaseAge:h,staged:!1});if(b(i,a),e.success(`Created ${i}`),e.info(" Secure defaults are applied automatically by defineConfig()."),o.syncNative){for(const n of E(s.name,t,{}))e.success(` ${n}`);for(const n of R(s.name,t,h))e.success(` ${n}`)}e.info(""),e.notice("Run 'vis doctor' for a full health check, or 'vis init' in a terminal for guided setup.")},k=(t,s,o)=>{const i=m(t,".."),a=m(s,"node_modules","@visulima","vis","schemas",o),n=B(i,a),l=n===""?`./${o}`:n.split(/[/\\]/u).join("/");return l.startsWith(".")?l:`./${l}`},L=(t,s)=>{const o=k(m(t,"project.json"),s,"project.schema.json"),i=k(m(t,"vis.config.ts"),s,"vis-config.schema.json");e.info(""),e.info("Paste these into your config files to get editor IntelliSense:"),e.info(""),e.info(` project.json → "$schema": "${o}"`),e.info(` vis.config.ts → see ${i} (vis.config.ts is TypeScript; use the import path directly)`),e.info(""),e.notice("For nested project.json files, the `..` depth changes — run `vis migrate nx` to auto-rewrite all of them.")},X=async({options:t,workspaceRoot:s})=>{const o=s??process.cwd();if(t.schema){L(o,o);return}const i=I(o),a=F(o);if(a&&!t.force){e.warn(`Config already exists: ${a}`),e.notice("Use --force to overwrite, or edit the existing file.");return}const n=a??m(o,"vis.config.ts");process.stdin.isTTY&&t.interactive!==!1?await q(o,i,n):K(o,i,t,n)};export{k as buildSchemaRefForTesting,X as default};
@@ -1 +1,5 @@
1
- var i=Object.defineProperty;var s=(e,o)=>i(e,"name",{value:o,configurable:!0});import{a as p,Y as d}from"../packem_shared/bin-BaZZ32BK.js";var f=Object.defineProperty,l=s((e,o)=>f(e,"name",{value:o,configurable:!0}),"t");const k=l(async({logger:e,options:o,visConfig:t,workspaceRoot:r})=>{const a=r??process.cwd(),n=p(a,{configBackend:t?.install?.backend}),c=d(n,o.check||!1,a,e);c!==0&&(process.exitCode=c)},"execute");export{k as default};
1
+ import{I as $,E as u,V as k,s as y}from"../packem_shared/index.server-J83sowC4.js";import{p}from"./cli-main.js";import{r as N,M,a as R,b as S,c as x,d as A,e as V,f as b,g as C,h as E}from"../packem_shared/s1ngularity-BLj4Jy8z.js";import{g as P,r as j}from"../packem_shared/packument-aGzYwXKn.js";import{r as B}from"../packem_shared/provenance-S7y0BRAt.js";import{r as D}from"../packem_shared/signatures-DoNG2hEr.js";const v=new Set(["archivedRepo","author","downloads","expiredDomains","metadata","newBin","provenance","s1ngularity","signatures"]),I=r=>{const s=r.trim();if(s==="")return;if(s.startsWith("@")){const o=s.indexOf("@",1);return o===-1?{name:s,spec:void 0}:{name:s.slice(0,o),spec:s.slice(o+1)||void 0}}const i=s.indexOf("@");return i===-1?{name:s,spec:void 0}:{name:s.slice(0,i),spec:s.slice(i+1)||void 0}},O=r=>{if(r===void 0||r.trim()==="")return;const s=new Set;for(const i of r.split(",")){const o=i.trim();if(!v.has(o))throw new Error(`Unknown marshall in --only: ${o}. Known: ${[...v].sort().join(", ")}.`);s.add(o)}return s},m=(r,s)=>r===void 0||r.has(s),F=r=>r?.has("signatures")??!1,K=async({argument:r,options:s,workspaceRoot:i})=>{if(!r||r.length===0)throw new Error("No package specified. Usage: vis inspect <package>[@<spec>]");const o=I(r[0]);if(o===void 0)throw new Error(`Invalid package argument: "${String(r[0])}". Usage: vis inspect <package>[@<spec>]`);const t=O(s.only),f=await P(o.name,{workspaceRoot:i});if(f===void 0){p.error(`Package ${o.name} not found in the registry.`),process.exitCode=2;return}const g=j(f,o.spec);if(g===void 0){p.error(`Could not resolve ${o.name}@${o.spec??"latest"} to a published version.`),process.exitCode=2;return}const c=[{name:o.name,version:g}],n=new M;if(m(t,"author")){const e=await N(c,{workspaceRoot:i});for(const a of e)n.add({marshall:"author",message:a.message,packageName:a.packageName,severity:a.severity})}if(m(t,"provenance")){const e=await B(c);for(const a of e)n.add({marshall:"provenance",message:`Prior version ${a.priorVersionWithProvenance} had provenance but ${a.version} does not.`,packageName:a.packageName,severity:"error"})}if(m(t,"s1ngularity")){const e=await R(c,{workspaceRoot:i});for(const a of e){const d=a.hookChanges.map(w=>`${w.hook} (${w.kind})`).join(", "),l=a.hookChanges.length===1;n.add({marshall:"s1ngularity",message:`${a.version} ${l?"has an":"has"} install-script ${l?"change":"changes"} [${d}] AND dropped the provenance attestation that ${a.priorVersion} carried — this is the s1ngularity compromised-publish shape.`,packageName:a.packageName,severity:"error"})}}if(m(t,"newBin")){const e=await S(c);for(const a of e){const d=a.newBins.map(l=>l.command).join(", ");n.add({marshall:"newBin",message:`${a.toVersion} adds new bin script${a.newBins.length===1?"":"s"}: ${d} (prior: ${a.fromVersion}).`,packageName:a.packageName,severity:"warning"})}}if(m(t,"metadata")){const e=await x(c,{workspaceRoot:i});for(const a of e)n.add({marshall:"metadata",message:`Missing/invalid metadata: ${a.issues.join(", ")}.`,packageName:a.packageName,severity:"warning"})}if(m(t,"downloads")){const e=await A([o.name]);for(const a of e){const d=a.downloadsLastMonth===void 0?"unknown":String(a.downloadsLastMonth);n.add({marshall:"downloads",message:a.kind==="no-data"?"npm stats API returned no monthly download data.":`Only ${d} downloads in the past month.`,packageName:a.packageName,severity:a.severity})}}if(m(t,"expiredDomains")){const e=await V(c,{workspaceRoot:i});for(const a of e)n.add({marshall:"expiredDomains",message:a.kind==="expired"?`Maintainer email domain ${a.domain} (${a.maintainer}) is unregistered — potential hijack risk.`:`Could not verify maintainer email domain ${a.domain} (${a.maintainer}).`,packageName:a.packageName,severity:a.severity})}if(F(t)){const e=await D(c,{workspaceRoot:i});for(const a of e)n.add({marshall:"signatures",message:a.message,packageName:a.packageName,severity:a.severity})}if(m(t,"archivedRepo")){const e=await b(c,{workspaceRoot:i});for(const a of e)n.add({marshall:"archivedRepo",message:a.kind==="archived"?`Source repo ${a.owner}/${a.repo} is archived${a.archivedAt===void 0?"":` (since ${a.archivedAt})`}.`:`Source repo ${a.owner}/${a.repo} returned 404 from GitHub.`,packageName:a.packageName,severity:"warning"})}const h=n.all();if(s.json===!0)process.stdout.write(`${JSON.stringify(C(h),void 0,2)}
2
+ `);else{const e=`${o.name}@${g}`;if(h.length===0)p.info(`${$("✓")} ${e} — no findings.`);else{p.info(`${u("Inspecting")} ${e}`);for(const l of E(h))process.stdout.write(`${l}
3
+ `);const a=n.errors().length,d=n.warnings().length;process.stdout.write(`
4
+ ${u("Summary:")} ${k(`${String(a)} error${a===1?"":"s"}`)}, ${y(`${String(d)} warning${d===1?"":"s"}`)}.
5
+ `)}}(n.hasErrors()||s.strict===!0&&!n.isEmpty())&&(process.exitCode=1)};export{K as default,I as parsePackageArg};
@@ -1,3 +1 @@
1
- var Ve=Object.defineProperty;var y=(n,e)=>Ve(n,"name",{value:e,configurable:!0});import{createRequire as He}from"node:module";import{Box as c,Text as r,TextInput as he,ScrollBar as Oe,ScrollView as Ye,useApp as Ke,useWindowSize as Qe,useInput as H,Dialog as Ze,Tabs as et,Tab as tt,render as rt}from"@visulima/tui";import{C as ot,m as nt,s as it}from"../packem_shared/bin-BaZZ32BK.js";import ct,{useMemo as q,useSyncExternalStore as st,useState as C,useRef as Z,useEffect as le,useCallback as lt}from"react";import{isAccessibleSync as dt,readFileSync as ut,ensureDirSync as ht}from"@visulima/fs";import{stripJsonComments as mt}from"@visulima/fs/utils";import{join as de,dirname as gt}from"@visulima/path";import{jsxs as i,jsx as t}from"react/jsx-runtime";const Je=He(import.meta.url),V=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qe=y(n=>{if(typeof V<"u"&&V.versions&&V.versions.node){const[e,s]=V.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return V.getBuiltinModule(n)}return Je(n)},"__cjs_getBuiltinModule"),{writeFileSync:at}=qe("node:fs"),z=[{config:{customizations:{vscode:{extensions:["dbaeumer.vscode-eslint","esbenp.prettier-vscode"]}},features:{"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/github-cli:1":{}},forwardPorts:[3e3],image:"mcr.microsoft.com/devcontainers/javascript-node:22",name:"Node.js",postCreateCommand:"npm install"},description:"Node.js 22 with Git and GitHub CLI",id:"node",name:"Node.js"},{config:{customizations:{vscode:{extensions:["dbaeumer.vscode-eslint","esbenp.prettier-vscode"]}},features:{"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/github-cli:1":{}},forwardPorts:[3e3],image:"mcr.microsoft.com/devcontainers/javascript-node:22",mounts:[{source:"${localWorkspaceFolderBasename}-node_modules",target:"${containerWorkspaceFolder}/node_modules",type:"volume"},{source:"${localWorkspaceFolderBasename}-pnpm-store",target:"/home/node/.local/share/pnpm/store",type:"volume"}],name:"Node.js + pnpm Monorepo",postCreateCommand:"corepack enable && pnpm install",remoteUser:"node",workspaceFolder:"/workspaces/${localWorkspaceFolderBasename}"},description:"Node.js 22 with pnpm, corepack, and optimized volume mounts",id:"node-pnpm",name:"Node.js + pnpm"},{config:{customizations:{vscode:{extensions:["dbaeumer.vscode-eslint","esbenp.prettier-vscode","ms-azuretools.vscode-docker"]}},dockerComposeFile:"docker-compose.yml",forwardPorts:[3e3,5432],name:"Node.js + PostgreSQL",postCreateCommand:"npm install",service:"app",workspaceFolder:"/workspaces/${localWorkspaceFolderBasename}"},description:"Node.js with PostgreSQL via Docker Compose",id:"node-postgres",name:"Node.js + PostgreSQL"},{config:{customizations:{vscode:{extensions:["dbaeumer.vscode-eslint","esbenp.prettier-vscode","ms-azuretools.vscode-docker"]}},features:{"ghcr.io/devcontainers/features/docker-in-docker:2":{},"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/github-cli:1":{}},forwardPorts:[3e3],image:"mcr.microsoft.com/devcontainers/javascript-node:22",name:"Node.js + Docker",postCreateCommand:"npm install"},description:"Node.js 22 with Docker-in-Docker for container workflows",id:"node-dind",name:"Node.js + Docker-in-Docker"},{config:{customizations:{vscode:{extensions:["dbaeumer.vscode-eslint","esbenp.prettier-vscode","ms-azuretools.vscode-docker"]}},dockerComposeFile:"docker-compose.yml",features:{"ghcr.io/devcontainers/features/docker-in-docker:2":{}},forwardPorts:[3e3,5432,6379],name:"Full Stack",postCreateCommand:"npm install",service:"app",workspaceFolder:"/workspaces/${localWorkspaceFolderBasename}"},description:"Node.js + PostgreSQL + Redis + Docker via Compose",id:"fullstack",name:"Full Stack"},{config:{customizations:{vscode:{extensions:["ms-python.python","ms-python.vscode-pylance"],settings:{"editor.formatOnSave":!0,"python.defaultInterpreterPath":"/usr/local/bin/python"}}},features:{"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/github-cli:1":{},"ghcr.io/devcontainers/features/python:1":{version:"3.12"}},forwardPorts:[8e3],image:"mcr.microsoft.com/devcontainers/python:3.12",name:"Python",postCreateCommand:"pip install -r requirements.txt || true"},description:"Python 3.12 with pip and venv",id:"python",name:"Python"},{config:{customizations:{vscode:{extensions:["golang.go"],settings:{"editor.formatOnSave":!0,"go.toolsManagement.autoUpdate":!0}}},features:{"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/go:1":{version:"1.22"}},forwardPorts:[8080],image:"mcr.microsoft.com/devcontainers/go:1.22",name:"Go",postCreateCommand:"go mod download || true"},description:"Go 1.22 development environment",id:"go",name:"Go"},{config:{customizations:{vscode:{extensions:["rust-lang.rust-analyzer","tamasfe.even-better-toml"],settings:{"editor.formatOnSave":!0}}},features:{"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/rust:1":{}},image:"mcr.microsoft.com/devcontainers/rust:latest",name:"Rust",postCreateCommand:"cargo build || true"},description:"Rust development with cargo and rust-analyzer",id:"rust",name:"Rust"},{config:{customizations:{vscode:{extensions:["vscjava.vscode-java-pack","vscjava.vscode-maven"]}},features:{"ghcr.io/devcontainers/features/git:1":{},"ghcr.io/devcontainers/features/java:1":{version:"17"}},forwardPorts:[8080],image:"mcr.microsoft.com/devcontainers/java:17",name:"Java",postCreateCommand:"./mvnw install || ./gradlew build || true"},description:"Java 17 with Maven/Gradle support",id:"java",name:"Java"},{config:{customizations:{vscode:{extensions:["ms-azuretools.vscode-docker","ms-kubernetes-tools.vscode-kubernetes-tools","hashicorp.terraform"]}},features:{"ghcr.io/devcontainers/features/aws-cli:1":{},"ghcr.io/devcontainers/features/azure-cli:1":{},"ghcr.io/devcontainers/features/docker-in-docker:2":{},"ghcr.io/devcontainers/features/kubectl-helm-minikube:1":{},"ghcr.io/devcontainers/features/terraform:1":{}},image:"mcr.microsoft.com/devcontainers/base:ubuntu",name:"DevOps"},description:"Docker, Kubernetes, Terraform, AWS & Azure CLIs",id:"devops",name:"DevOps"},{config:{features:{"ghcr.io/devcontainers/features/common-utils:2":{}},image:"mcr.microsoft.com/devcontainers/base:ubuntu",name:"Minimal",remoteUser:"vscode"},description:"Bare Ubuntu with common utilities",id:"minimal",name:"Minimal"},{config:{image:"mcr.microsoft.com/devcontainers/base:ubuntu",name:"Custom"},description:"Minimal Ubuntu base - configure from scratch",id:"custom",name:"Custom (Blank)"}];var ft=Object.defineProperty,Fe=y((n,e)=>ft(n,"name",{value:e,configurable:!0}),"s$5");const pt=Fe(n=>{const e=de(n,".devcontainer","devcontainer.json");if(!dt(e))return null;const s=ut(e),a=mt(s),l=a!==s;let o;try{o=JSON.parse(a)}catch(d){const g=d instanceof Error?d.message:String(d);throw new Error(`Failed to parse ${e}: ${g}`)}return{config:o,hadComments:l}},"readDevcontainerJson"),vt=Fe((n,e,s)=>{const a=s?gt(s):de(n,".devcontainer"),l=s??de(a,"devcontainer.json");ht(a),at(l,`${JSON.stringify(e,null,2)}
2
- `,"utf8")},"writeDevcontainerJson");var yt=Object.defineProperty,bt=y((n,e)=>yt(n,"name",{value:e,configurable:!0}),"s$4");const wt={bun:[{source:"${localWorkspaceFolderBasename}-node_modules",target:"${containerWorkspaceFolder}/node_modules",type:"volume"},{source:"${localWorkspaceFolderBasename}-bun-cache",target:"/home/node/.bun/install/cache",type:"volume"}],npm:[{source:"${localWorkspaceFolderBasename}-node_modules",target:"${containerWorkspaceFolder}/node_modules",type:"volume"},{source:"${localWorkspaceFolderBasename}-npm-cache",target:"/home/node/.npm",type:"volume"}],pnpm:[{source:"${localWorkspaceFolderBasename}-node_modules",target:"${containerWorkspaceFolder}/node_modules",type:"volume"},{source:"${localWorkspaceFolderBasename}-pnpm-store",target:"/home/node/.local/share/pnpm/store",type:"volume"}],yarn:[{source:"${localWorkspaceFolderBasename}-node_modules",target:"${containerWorkspaceFolder}/node_modules",type:"volume"},{source:"${localWorkspaceFolderBasename}-yarn-cache",target:"/home/node/.yarn/cache",type:"volume"}]},xt=[{featureMatch:"docker-in-docker",mounts:[]},{featureMatch:"docker-outside-of-docker",mounts:[{source:"/var/run/docker.sock",target:"/var/run/docker.sock",type:"bind"}]},{featureMatch:"/features/git:",mounts:[{source:"${localWorkspaceFolderBasename}-git-config",target:"/home/node/.gitconfig",type:"volume"}]}],xe=bt((n,e,s)=>{const a=[],l=new Set(s.map(d=>typeof d=="string"?d:d.target));if(n)for(const d of wt[n])l.has(d.target)||a.push(d);const o=Object.keys(e);for(const{featureMatch:d,mounts:g}of xt)if(o.some(f=>f.includes(d)))for(const f of g)l.has(f.target)||a.push(f);return a},"getSuggestedMounts"),A=["general","features","ports","lifecycle","extensions","environment","mounts","compose"];var Ct=Object.defineProperty,ee=y((n,e)=>Ct(n,"name",{value:e,configurable:!0}),"c$1");const J=ee(n=>structuredClone(n),"deepClone");class kt{static{y(this,"DevcontainerStore")}static{ee(this,"DevcontainerStore")}#o=new Set;#e;constructor(e,s,a=null){const l=e===null,o=e??{name:""},d=J(o);this.#e={config:d,detectedPm:a,extensionSearch:"",featureSearch:"",fieldEditing:!1,fieldIndex:0,hadComments:s,isDirty:!1,mode:l?"create":"edit",originalConfig:l?null:J(o),section:"general",showTemplateSelector:l,suggestedMounts:xe(a,d.features??{},d.mounts??[]),templateIndex:0}}getSnapshot=ee(()=>this.#e,"getSnapshot");subscribe=ee(e=>(this.#o.add(e),()=>{this.#o.delete(e)}),"subscribe");setSection(e){e!==this.#e.section&&this.#t({...this.#e,fieldEditing:!1,fieldIndex:0,section:e})}nextSection(){const e=(A.indexOf(this.#e.section)+1)%A.length;this.setSection(A[e])}previousSection(){const e=(A.indexOf(this.#e.section)-1+A.length)%A.length;this.setSection(A[e])}setFieldIndex(e){e!==this.#e.fieldIndex&&this.#t({...this.#e,fieldIndex:Math.max(0,e)})}setFieldEditing(e){e!==this.#e.fieldEditing&&this.#t({...this.#e,fieldEditing:e})}setTemplateIndex(e){const s=Math.max(0,Math.min(e,z.length-1));s!==this.#e.templateIndex&&this.#t({...this.#e,templateIndex:s})}applyTemplate(e){const s=z.find(a=>a.id===e);s&&this.#t(this.#r({...this.#e,config:J(s.config),isDirty:!0,showTemplateSelector:!1}))}dismissTemplateSelector(){this.#t({...this.#e,showTemplateSelector:!1})}updateConfig(e){this.#t({...this.#e,config:{...this.#e.config,...e},isDirty:!0})}toggleFeature(e){const s={...this.#e.config.features};s[e]===void 0?s[e]={}:delete s[e],this.#t(this.#r({...this.#e,config:{...this.#e.config,features:s},isDirty:!0}))}setFeatureSearch(e){this.#t({...this.#e,featureSearch:e,fieldIndex:0})}addPort(e){const s=this.#e.config.forwardPorts??[];if(s.includes(e))return;const a=[...s,e];this.#t({...this.#e,config:{...this.#e.config,forwardPorts:a},isDirty:!0})}removePort(e){const s=[...this.#e.config.forwardPorts??[]];s.splice(e,1),this.#t({...this.#e,config:{...this.#e.config,forwardPorts:s.length>0?s:void 0},isDirty:!0})}toggleExtension(e){const s={...this.#e.config.customizations},a={...s.vscode},l=[...a.extensions??[]],o=l.indexOf(e);o===-1?l.push(e):l.splice(o,1),a.extensions=l.length>0?l:void 0,s.vscode=a.extensions||a.settings?a:void 0,this.#t({...this.#e,config:{...this.#e.config,customizations:s.vscode||s.jetbrains?s:void 0},isDirty:!0})}setExtensionSearch(e){this.#t({...this.#e,extensionSearch:e,fieldIndex:0})}addEnvVar(e,s,a){const l=e==="container"?"containerEnv":"remoteEnv",o={...this.#e.config[l],[s]:a};this.#t({...this.#e,config:{...this.#e.config,[l]:o},isDirty:!0})}removeEnvVar(e,s){const a=e==="container"?"containerEnv":"remoteEnv",l={...this.#e.config[a]};delete l[s],this.#t({...this.#e,config:{...this.#e.config,[a]:Object.keys(l).length>0?l:void 0},isDirty:!0})}addMount(e){const s=[...this.#e.config.mounts??[],e];this.#t(this.#r({...this.#e,config:{...this.#e.config,mounts:s},isDirty:!0}))}removeMount(e){const s=[...this.#e.config.mounts??[]];s.splice(e,1),this.#t(this.#r({...this.#e,config:{...this.#e.config,mounts:s.length>0?s:void 0},isDirty:!0}))}applySuggestedMounts(){if(this.#e.suggestedMounts.length===0)return;const e=[...this.#e.config.mounts??[],...this.#e.suggestedMounts];this.#t(this.#r({...this.#e,config:{...this.#e.config,mounts:e},isDirty:!0}))}setLifecycleCommand(e,s){this.#t({...this.#e,config:{...this.#e.config,[e]:s||void 0},isDirty:!0})}markClean(){this.#t({...this.#e,isDirty:!1,originalConfig:J(this.#e.config)})}getJsonPreview(){return JSON.stringify(this.#n(),null,2)}cleanConfig(){return this.#n()}#n(){const e=J(this.#e.config);for(const[s,a]of Object.entries(e))(a===""||a===void 0)&&delete e[s];return e.build&&(e.build.dockerfile===""&&delete e.build.dockerfile,e.build.context===""&&delete e.build.context,e.build.args&&Object.keys(e.build.args).length===0&&delete e.build.args,Object.keys(e.build).length===0&&delete e.build),e.forwardPorts?.length===0&&delete e.forwardPorts,e.mounts?.length===0&&delete e.mounts,e.runServices?.length===0&&delete e.runServices,e.capAdd?.length===0&&delete e.capAdd,e.securityOpt?.length===0&&delete e.securityOpt,e.features&&Object.keys(e.features).length===0&&delete e.features,e.customizations?.vscode?.extensions?.length===0&&delete e.customizations.vscode.extensions,e.customizations?.vscode&&Object.keys(e.customizations.vscode).length===0&&delete e.customizations.vscode,e.customizations&&Object.keys(e.customizations).length===0&&delete e.customizations,e.containerEnv&&Object.keys(e.containerEnv).length===0&&delete e.containerEnv,e.remoteEnv&&Object.keys(e.remoteEnv).length===0&&delete e.remoteEnv,e}#r(e){return{...e,suggestedMounts:xe(e.detectedPm,e.config.features??{},e.config.mounts??[])}}#t(e){this.#e=e;for(const s of this.#o)try{s()}catch{}}}const Ce=[{category:"linting",description:"Integrates ESLint into the editor",id:"dbaeumer.vscode-eslint",name:"ESLint"},{category:"linting",description:"Stylelint CSS/SCSS linting",id:"stylelint.vscode-stylelint",name:"Stylelint"},{category:"formatting",description:"Opinionated code formatter",id:"esbenp.prettier-vscode",name:"Prettier"},{category:"formatting",description:"EditorConfig file support",id:"editorconfig.editorconfig",name:"EditorConfig"},{category:"formatting",description:"Fast Rust-based formatter and linter",id:"biomejs.biome",name:"Biome"},{category:"language",description:"Rich TypeScript and JavaScript support",id:"ms-vscode.vscode-typescript-next",name:"TypeScript Nightly"},{category:"language",description:"Tailwind CSS IntelliSense",id:"bradlc.vscode-tailwindcss",name:"Tailwind CSS"},{category:"language",description:"YAML language support with schemas",id:"redhat.vscode-yaml",name:"YAML"},{category:"language",description:"TOML language support",id:"tamasfe.even-better-toml",name:"TOML"},{category:"language",description:"Dockerfile and Docker Compose support",id:"ms-azuretools.vscode-docker",name:"Docker"},{category:"language",description:"Python language support with Pylance",id:"ms-python.python",name:"Python"},{category:"language",description:"Go language support",id:"golang.go",name:"Go"},{category:"language",description:"Rust language support via rust-analyzer",id:"rust-lang.rust-analyzer",name:"rust-analyzer"},{category:"git",description:"Git supercharged: blame, history, stash, etc.",id:"eamodio.gitlens",name:"GitLens"},{category:"git",description:"GitHub Pull Requests and Issues",id:"github.vscode-pull-request-github",name:"GitHub PR"},{category:"testing",description:"Vitest test explorer integration",id:"vitest.explorer",name:"Vitest Explorer"},{category:"testing",description:"Jest test runner and assertions",id:"orta.vscode-jest",name:"Jest"},{category:"debugging",description:"REST client for testing APIs",id:"humao.rest-client",name:"REST Client"},{category:"debugging",description:"Error Lens: inline error highlighting",id:"usernamehw.errorlens",name:"Error Lens"},{category:"other",description:"Intelligent code completion with AI",id:"github.copilot",name:"GitHub Copilot"},{category:"other",description:"Path autocompletion for imports",id:"christian-kohler.path-intellisense",name:"Path Intellisense"},{category:"other",description:"Import cost display in editor",id:"wix.vscode-import-cost",name:"Import Cost"},{category:"other",description:"Todo Tree: highlight and list TODOs",id:"gruntfuggly.todo-tree",name:"Todo Tree"}],ke=[{category:"language",description:"Node.js runtime via nvm with optional pnpm/yarn",id:"ghcr.io/devcontainers/features/node:1",name:"Node.js"},{category:"language",description:"Python runtime with pip and optional tools",id:"ghcr.io/devcontainers/features/python:1",name:"Python"},{category:"language",description:"Go compiler and tools",id:"ghcr.io/devcontainers/features/go:1",name:"Go"},{category:"language",description:"Rust toolchain via rustup",id:"ghcr.io/devcontainers/features/rust:1",name:"Rust"},{category:"language",description:"Java runtime and JDK via SDKMAN",id:"ghcr.io/devcontainers/features/java:1",name:"Java"},{category:"language",description:".NET SDK and runtime",id:"ghcr.io/devcontainers/features/dotnet:2",name:".NET"},{category:"tool",description:"Common utilities: zsh, Oh My Zsh, git, curl, etc.",id:"ghcr.io/devcontainers/features/common-utils:2",name:"Common Utilities"},{category:"tool",description:"Git version control",id:"ghcr.io/devcontainers/features/git:1",name:"Git"},{category:"tool",description:"Git Large File Storage support",id:"ghcr.io/devcontainers/features/git-lfs:1",name:"Git LFS"},{category:"tool",description:"GitHub CLI for repository management",id:"ghcr.io/devcontainers/features/github-cli:1",name:"GitHub CLI"},{category:"tool",description:"Run Docker containers inside the dev container",id:"ghcr.io/devcontainers/features/docker-in-docker:2",name:"Docker-in-Docker"},{category:"tool",description:"Access host Docker daemon from inside the container",id:"ghcr.io/devcontainers/features/docker-outside-of-docker:1",name:"Docker-from-Docker"},{category:"tool",description:"kubectl, Helm, and Minikube for Kubernetes",id:"ghcr.io/devcontainers/features/kubectl-helm-minikube:1",name:"Kubernetes Tools"},{category:"tool",description:"Infrastructure as code with Terraform",id:"ghcr.io/devcontainers/features/terraform:1",name:"Terraform"},{category:"tool",description:"Nix package manager",id:"ghcr.io/devcontainers/features/nix:1",name:"Nix"},{category:"tool",description:"SSH server for remote connections to the container",id:"ghcr.io/devcontainers/features/sshd:1",name:"SSH Server"},{category:"cloud",description:"Amazon Web Services CLI v2",id:"ghcr.io/devcontainers/features/aws-cli:1",name:"AWS CLI"},{category:"cloud",description:"Microsoft Azure CLI",id:"ghcr.io/devcontainers/features/azure-cli:1",name:"Azure CLI"},{category:"cloud",description:"Google Cloud Platform CLI",id:"ghcr.io/devcontainers/features/gcloud:1",name:"Google Cloud CLI"},{category:"database",description:"PostgreSQL client tools",id:"ghcr.io/devcontainers-extra/features/postgres-client:1",name:"PostgreSQL Client"},{category:"database",description:"Redis client tools",id:"ghcr.io/devcontainers-extra/features/redis-client:1",name:"Redis Client"}];var St=Object.defineProperty,Ae=y((n,e)=>St(n,"name",{value:e,configurable:!0}),"r$1");const me=Ae(n=>{if(!n)return ke;const e=n.toLowerCase();return ke.filter(s=>s.name.toLowerCase().includes(e)||s.id.toLowerCase().includes(e)||s.description.toLowerCase().includes(e))},"filterFeatures"),ge=Ae(n=>{if(!n)return Ce;const e=n.toLowerCase();return Ce.filter(s=>s.name.toLowerCase().includes(e)||s.id.toLowerCase().includes(e)||s.description.toLowerCase().includes(e))},"filterExtensions");var Et=Object.defineProperty,It=y((n,e)=>Et(n,"name",{value:e,configurable:!0}),"l$1");const Le=["dockerComposeFile","service"],Tt={dockerComposeFile:"Compose File",service:"Service"},Se={dockerComposeFile:"docker-compose.yml",service:"app"},Dt={dockerComposeFile:"Path to Docker Compose file (relative to .devcontainer/)",service:"Which service in the compose file to connect the IDE to"},Pt=It(({config:n,fieldEditing:e,fieldIndex:s,onUpdate:a})=>{const l=!!n.dockerComposeFile,o=!!(n.image||n.build);return i(c,{flexDirection:"column",paddingX:1,children:[t(c,{marginBottom:1,children:t(r,{bold:!0,color:"cyan",children:"Docker Compose Integration"})}),o&&l&&t(c,{marginBottom:1,children:t(r,{color:"yellow",children:"Note: When using Docker Compose, the image/build settings in General are ignored."})}),Le.map((d,g)=>{const f=g===s,p=n[d]??"",x=Array.isArray(n[d])?n[d].join(", "):p;return i(c,{flexDirection:"column",marginBottom:1,children:[i(c,{children:[t(c,{width:20,children:i(r,{bold:f,color:f?"cyan":"white",children:[f?"❯ ":" ",Tt[d],":"]})}),t(c,{flexGrow:1,children:f&&e?t(he,{defaultValue:x,onChange:y(v=>{a({[d]:v||void 0})},"onChange"),placeholder:Se[d]}):t(r,{color:x?"white":"gray",children:x||Se[d]})})]}),t(c,{paddingLeft:4,children:t(r,{dimColor:!0,children:Dt[d]})})]},d)}),t(c,{marginTop:1,children:i(r,{dimColor:!0,children:[t(r,{bold:!0,color:"white",children:"Enter"})," ","edit field"," ",t(r,{bold:!0,color:"white",children:"↑↓"})," ","navigate"," ",t(r,{bold:!0,color:"white",children:"Esc"})," ","stop editing"]})})]})},"DockerComposeSection"),jt=Le.length;var Ot=Object.defineProperty,Me=y((n,e)=>Ot(n,"name",{value:e,configurable:!0}),"h$3");const Ft=Me(({config:n,fieldIndex:e})=>{const s=n.containerEnv??{},a=n.remoteEnv??{},l=Object.keys(s),o=Object.keys(a),d=l.length,g=l.length+1,f=g+o.length,p=e<=d,x=e>d;return i(c,{flexDirection:"column",paddingX:1,children:[i(c,{borderColor:p?"cyan":"gray",borderStyle:"single",flexDirection:"column",paddingX:1,paddingY:0,children:[i(c,{flexShrink:0,marginBottom:l.length>0?1:0,children:[t(r,{bold:!0,color:p?"cyan":"white",children:"containerEnv"}),t(r,{dimColor:!0,children:" — baked into the container image"})]}),l.map((v,w)=>{const k=w===e;return t(c,{flexShrink:0,children:i(r,{color:k?"cyan":void 0,inverse:k,wrap:"truncate",children:[k?" ❯ ":" ",t(r,{bold:!0,children:v}),t(r,{dimColor:!0,children:" = "}),t(r,{children:s[v]})]})},v)}),t(c,{flexShrink:0,marginTop:l.length>0?1:0,children:i(r,{color:e===d?"cyan":"gray",inverse:e===d,children:[" ","+ Add variable..."]})})]}),i(c,{borderColor:x?"cyan":"gray",borderStyle:"single",flexDirection:"column",marginTop:1,paddingX:1,paddingY:0,children:[i(c,{flexShrink:0,marginBottom:o.length>0?1:0,children:[t(r,{bold:!0,color:x?"cyan":"white",children:"remoteEnv"}),t(r,{dimColor:!0,children:" — set at runtime by the IDE"})]}),o.map((v,w)=>{const k=g+w===e;return t(c,{flexShrink:0,children:i(r,{color:k?"cyan":void 0,inverse:k,wrap:"truncate",children:[k?" ❯ ":" ",t(r,{bold:!0,children:v}),t(r,{dimColor:!0,children:" = "}),t(r,{children:a[v]})]})},v)}),t(c,{flexShrink:0,marginTop:o.length>0?1:0,children:i(r,{color:e===f?"cyan":"gray",inverse:e===f,children:[" ","+ Add variable..."]})})]}),t(c,{flexShrink:0,marginTop:1,children:i(r,{dimColor:!0,wrap:"truncate",children:[t(r,{bold:!0,color:"white",children:"a"}),"/",t(r,{bold:!0,color:"white",children:"Enter"})," ","add on + row"," ",t(r,{bold:!0,color:"white",children:"d"})," ","remove"," ",t(r,{bold:!0,color:"white",children:"↑↓"})," ","navigate"]})})]})},"EnvironmentSection"),At=Me(n=>{const e=Object.keys(n.containerEnv??{}).length,s=Object.keys(n.remoteEnv??{}).length;return e+1+s+1},"getEnvFieldCount");var Lt=Object.defineProperty,Mt=y((n,e)=>Lt(n,"name",{value:e,configurable:!0}),"h$2");const Bt=Mt(({config:n,fieldIndex:e,scrollOffset:s,searchText:a,viewportHeight:l})=>{const o=q(()=>new Set(n.customizations?.vscode?.extensions),[n.customizations?.vscode?.extensions]),d=q(()=>ge(a),[a]),g=d.length,f=g>l&&l>0;return i(c,{flexDirection:"column",flexGrow:1,children:[i(c,{flexShrink:0,gap:1,paddingX:1,children:[i(r,{bold:!0,color:"cyan",children:[o.size," ","selected"]}),a&&i(r,{dimColor:!0,children:["— filter:"," ",t(r,{color:"yellow",children:a})," ","(",d.length," ","results)"]})]}),i(c,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[t(c,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:t(c,{flexDirection:"column",marginTop:-s,children:d.map((p,x)=>{const v=x===e,w=o.has(p.id);return i(c,{flexShrink:0,height:1,children:[t(r,{children:v?">":" "}),i(r,{color:w?"white":"gray",children:[" ",w?"☑":"☐"," "]}),t(c,{flexGrow:1,children:i(r,{bold:v,inverse:v,wrap:"truncate",children:[p.name,i(r,{dimColor:!0,children:[" ","-",p.id]})]})})]},p.id)})})}),f&&t(c,{flexShrink:0,marginLeft:1,marginRight:1,children:t(Oe,{contentHeight:g,placement:"inset",scrollOffset:s,style:"block",viewportHeight:l})})]}),d.length===0&&t(c,{paddingX:1,children:t(r,{dimColor:!0,children:"No extensions match the search."})})]})},"ExtensionsSection");var Nt=Object.defineProperty,zt=y((n,e)=>Nt(n,"name",{value:e,configurable:!0}),"p$1");const Gt=zt(({config:n,fieldIndex:e,scrollOffset:s,searchText:a,viewportHeight:l})=>{const o=q(()=>new Set(Object.keys(n.features??{})),[n.features]),d=q(()=>me(a),[a]),g=d.length,f=g>l&&l>0;return i(c,{flexDirection:"column",flexGrow:1,children:[i(c,{flexShrink:0,gap:1,paddingX:1,children:[i(r,{bold:!0,color:"cyan",children:[o.size," ","selected"]}),a&&i(r,{dimColor:!0,children:["— filter:"," ",t(r,{color:"yellow",children:a})," ","(",d.length," ","results)"]})]}),i(c,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[t(c,{flexDirection:"column",flexGrow:1,overflow:"hidden",paddingLeft:1,children:t(c,{flexDirection:"column",marginTop:-s,children:d.map((p,x)=>{const v=x===e,w=o.has(p.id);return i(c,{flexShrink:0,height:1,children:[t(r,{children:v?">":" "}),i(r,{color:w?"white":"gray",children:[" ",w?"☑":"☐"," "]}),t(c,{flexGrow:1,children:i(r,{bold:v,inverse:v,wrap:"truncate",children:[p.name,i(r,{dimColor:!0,children:[" ","-",p.description]})]})})]},p.id)})})}),f&&t(c,{flexShrink:0,marginLeft:1,marginRight:1,children:t(Oe,{contentHeight:g,placement:"inset",scrollOffset:s,style:"block",viewportHeight:l})})]}),d.length===0&&t(c,{paddingX:1,children:t(r,{dimColor:!0,children:"No features match the search."})})]})},"FeaturesSection");var Rt=Object.defineProperty,_t=y((n,e)=>Rt(n,"name",{value:e,configurable:!0}),"u$1");const ue=["name","image","workspaceFolder","workspaceMount","remoteUser","containerUser","shutdownAction"],$t={containerUser:"Container User",image:"Image",name:"Name",remoteUser:"Remote User",shutdownAction:"Shutdown Action",workspaceFolder:"Workspace Folder",workspaceMount:"Workspace Mount"},Ee={containerUser:"root",image:"mcr.microsoft.com/devcontainers/javascript-node:22",name:"My Dev Container",remoteUser:"node",shutdownAction:"none | stopContainer",workspaceFolder:"/workspaces/${localWorkspaceFolderBasename}",workspaceMount:"source=${localWorkspaceFolder},target=...,type=bind"},te=["privileged","overrideCommand"],Ut={overrideCommand:"Override Command",privileged:"Privileged"},Wt=ue.length+te.length,Xt=_t(({config:n,fieldEditing:e,fieldIndex:s,onUpdate:a})=>i(c,{flexDirection:"column",paddingX:1,children:[t(c,{marginBottom:1,children:t(r,{bold:!0,color:"cyan",children:"General Configuration"})}),ue.map((l,o)=>{const d=o===s,g=n[l]??"";return i(c,{marginBottom:1,children:[t(c,{width:20,children:i(r,{bold:d,color:d?"cyan":"white",children:[d?"❯ ":" ",$t[l],":"]})}),t(c,{flexGrow:1,children:d&&e?t(he,{defaultValue:g,onChange:y(f=>{a({[l]:f})},"onChange"),placeholder:Ee[l]}):t(r,{color:g?"white":"gray",children:g||Ee[l]})})]},l)}),te.map((l,o)=>{const d=ue.length+o===s,g=n[l]??!1;return i(c,{marginBottom:o<te.length-1?1:0,children:[t(c,{width:20,children:i(r,{bold:d,color:d?"cyan":"white",children:[d?"❯ ":" ",Ut[l],":"]})}),t(c,{flexGrow:1,children:i(r,{color:g?"green":"gray",children:[g?"yes":"no",d&&t(r,{dimColor:!0,children:" (Space to toggle)"})]})})]},l)}),t(c,{marginTop:1,children:i(r,{dimColor:!0,children:[t(r,{bold:!0,color:"white",children:"Enter"})," ","edit field"," ",t(r,{bold:!0,color:"white",children:"Space"})," ","toggle"," ",t(r,{bold:!0,color:"white",children:"↑↓"})," ","navigate"," ",t(r,{bold:!0,color:"white",children:"Esc"})," ","stop editing"]})})]}),"GeneralSection"),Be=Wt,ae=te;var Vt=Object.defineProperty,Ht=y((n,e)=>Vt(n,"name",{value:e,configurable:!0}),"s$2");const Ne=["postCreateCommand","postStartCommand","postAttachCommand","onCreateCommand"],Jt={onCreateCommand:"On Create",postAttachCommand:"Post Attach",postCreateCommand:"Post Create",postStartCommand:"Post Start"},qt={onCreateCommand:"Runs once when the container is first created",postAttachCommand:"Runs each time the IDE attaches",postCreateCommand:"Runs after the container is created and workspace mounted",postStartCommand:"Runs each time the container starts"},Yt=Ht(({config:n,fieldEditing:e,fieldIndex:s,onSetCommand:a})=>i(c,{flexDirection:"column",paddingX:1,children:[t(c,{marginBottom:1,children:t(r,{bold:!0,color:"cyan",children:"Lifecycle Commands"})}),Ne.map((l,o)=>{const d=o===s,g=n[l],f=Array.isArray(g)?g.join(" && "):g??"";return i(c,{flexDirection:"column",marginBottom:1,children:[t(c,{children:i(r,{bold:d,color:d?"cyan":"white",children:[d?"❯ ":" ",Jt[l]]})}),t(c,{paddingLeft:4,children:t(r,{dimColor:!0,children:qt[l]})}),t(c,{paddingLeft:4,children:d&&e?t(he,{defaultValue:f,onChange:y(p=>{a(l,p)},"onChange"),placeholder:"e.g. npm install"}):t(r,{color:f?"green":"gray",children:f||"(not set)"})})]},l)}),t(c,{marginTop:1,children:i(r,{dimColor:!0,children:[t(r,{bold:!0,color:"white",children:"Enter"})," ","edit command"," ",t(r,{bold:!0,color:"white",children:"↑↓"})," ","navigate"," ",t(r,{bold:!0,color:"white",children:"Esc"})," ","stop editing"]})})]}),"LifecycleSection"),Kt=Ne.length;var Qt=Object.defineProperty,ze=y((n,e)=>Qt(n,"name",{value:e,configurable:!0}),"s$1");const Ie=ze(n=>typeof n=="string"?n:`[${n.type}] ${n.source} → ${n.target}`,"formatMount"),Zt=ze(({addingMount:n,config:e,detectedPm:s,fieldIndex:a,mountPhase:l,mountSource:o,mountTarget:d,mountType:g,suggestedMounts:f})=>{const p=e.mounts??[];return i(c,{flexDirection:"column",paddingX:1,children:[i(c,{flexShrink:0,gap:1,paddingX:1,children:[i(r,{bold:!0,color:"cyan",children:[p.length," ","mounts"]}),s&&i(r,{dimColor:!0,children:["— detected:"," ",t(r,{color:"white",children:s})]})]}),f.length>0&&!n&&i(c,{borderColor:"yellow",borderStyle:"single",flexDirection:"column",marginBottom:1,marginTop:1,paddingX:1,children:[i(c,{flexShrink:0,children:[t(r,{bold:!0,color:"yellow",children:"Suggested mounts"}),i(r,{dimColor:!0,children:[" ","— press"," ",t(r,{bold:!0,color:"white",children:"A"})," ","to add all"]})]}),f.map((x,v)=>t(c,{flexShrink:0,children:i(r,{dimColor:!0,wrap:"truncate",children:[" + ",Ie(x)]})},`suggestion-${String(v)}`))]}),p.length>0&&t(c,{flexDirection:"column",marginBottom:1,children:p.map((x,v)=>{const w=v===a;return i(c,{flexShrink:0,height:1,children:[t(r,{children:w?">":" "}),t(c,{flexGrow:1,children:i(r,{bold:w,inverse:w,wrap:"truncate",children:[" ",Ie(x)]})})]},`mount-${String(v)}`)})}),!n&&t(c,{flexShrink:0,children:i(r,{color:a===p.length?"cyan":"gray",inverse:a===p.length,children:[" ","+ Add mount..."]})}),n&&i(c,{borderColor:"cyan",borderStyle:"single",flexDirection:"column",marginTop:1,paddingX:1,children:[t(c,{flexShrink:0,marginBottom:1,children:t(r,{bold:!0,color:"cyan",children:"New Mount"})}),i(c,{flexShrink:0,children:[t(c,{width:12,children:i(r,{bold:l==="source",color:l==="source"?"cyan":"white",children:[l==="source"?"❯ ":" ","Source:"]})}),t(r,{color:o?"yellow":"gray",children:o||(l==="source"?"_":"(type source, Enter to continue)")})]}),i(c,{flexShrink:0,children:[t(c,{width:12,children:i(r,{bold:l==="target",color:l==="target"?"cyan":"white",children:[l==="target"?"❯ ":" ","Target:"]})}),t(r,{color:d?"yellow":"gray",children:d||(l==="target"?"_":"/container/path")})]}),i(c,{flexShrink:0,children:[t(c,{width:12,children:i(r,{bold:l==="type",color:l==="type"?"cyan":"white",children:[l==="type"?"❯ ":" ","Type:"]})}),l==="type"?i(r,{children:[t(r,{bold:g==="volume",color:g==="volume"?"cyan":"gray",children:"[1] volume"})," ",t(r,{bold:g==="bind",color:g==="bind"?"cyan":"gray",children:"[2] bind"})," ",t(r,{bold:g==="tmpfs",color:g==="tmpfs"?"cyan":"gray",children:"[3] tmpfs"})]}):t(r,{color:"gray",children:g})]}),t(c,{flexShrink:0,marginTop:1,children:t(r,{dimColor:!0,wrap:"truncate",children:l==="type"?"1/2/3 select type, Enter confirm, Esc cancel":"Type text, Enter next step, Esc cancel"})})]}),p.length===0&&!n&&f.length===0&&t(c,{marginTop:1,children:t(r,{dimColor:!0,children:"Tip: Use volume mounts for node_modules and caches to improve performance."})})]})},"MountsSection");var er=Object.defineProperty,tr=y((n,e)=>er(n,"name",{value:e,configurable:!0}),"m$1");const rr=tr(({addingPort:n,addPortValue:e,config:s,fieldIndex:a})=>{const l=s.forwardPorts??[],o=a===l.length;return i(c,{flexDirection:"column",paddingX:1,children:[i(c,{marginBottom:1,children:[t(r,{bold:!0,color:"cyan",children:"Forwarded Ports"}),i(r,{dimColor:!0,children:[" ","(",l.length," ","ports)"]})]}),l.map((d,g)=>{const f=g===a;return t(c,{children:i(r,{color:f?"cyan":void 0,inverse:f,children:[" ",String(d)]})},`port-${String(d)}`)}),t(c,{marginTop:l.length>0?1:0,children:i(r,{color:o?"cyan":"gray",inverse:o,children:[" ",o&&n?i(r,{children:["Enter port:"," ",t(r,{color:"yellow",children:e||"_"})]}):"+ Add port..."]})}),t(c,{marginTop:1,children:i(r,{dimColor:!0,children:[t(r,{bold:!0,color:"white",children:"Enter"})," ",o?"type port number, Enter to confirm":"select"," ",t(r,{bold:!0,color:"white",children:"d"})," ","remove selected"," ",t(r,{bold:!0,color:"white",children:"↑↓"})," ","navigate"]})})]})},"PortsSection");var or=Object.defineProperty,nr=y((n,e)=>or(n,"name",{value:e,configurable:!0}),"a");const ir=nr(({focused:n,hadComments:e,jsonPreview:s,mode:a,scrollRef:l})=>i(c,{borderColor:n?"cyan":"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,children:[i(c,{flexShrink:0,paddingX:1,children:[t(r,{bold:!0,color:n?"cyan":"white",children:"Preview"}),i(r,{dimColor:!0,children:[" ","(",a==="create"?"new":"edit",")"]})]}),e&&a==="edit"&&t(c,{flexShrink:0,paddingX:1,children:t(r,{color:"yellow",children:"Comments will not be preserved."})}),t(Ye,{flexGrow:1,ref:l,scrollbar:!0,scrollbarColor:"gray",children:s.split(`
3
- `).map((o,d)=>t(r,{color:"green",children:o},`line-${String(d)}`))})]}),"PreviewPanel");var cr=Object.defineProperty,sr=y((n,e)=>cr(n,"name",{value:e,configurable:!0}),"r");const lr=sr(n=>{const e=[],s=[],a=[];if(!n.image&&!n.build&&!n.dockerComposeFile&&e.push({field:"image",message:'One of "image", "build", or "dockerComposeFile" is required'}),n.build&&(n.image&&s.push({field:"image",message:'Both "image" and "build" are set; "build" takes precedence'}),n.build.dockerfile||e.push({field:"build.dockerfile",message:'"build" requires a "dockerfile" path'})),n.dockerComposeFile&&!n.service&&e.push({field:"service",message:'"service" is required when using "dockerComposeFile"'}),n.features!==void 0&&(typeof n.features!="object"||Array.isArray(n.features))&&e.push({field:"features",message:'"features" must be an object mapping feature IDs to options'}),n.forwardPorts)if(Array.isArray(n.forwardPorts))for(const[l,o]of n.forwardPorts.entries())typeof o=="number"&&(o<1||o>65535)&&e.push({field:"forwardPorts",message:`Invalid port ${String(o)} at index ${String(l)}`});else e.push({field:"forwardPorts",message:'"forwardPorts" must be an array'});return n.customizations?.vscode?.extensions&&!Array.isArray(n.customizations.vscode.extensions)&&e.push({field:"customizations.vscode.extensions",message:"Extensions must be an array"}),n.customizations?.vscode?.settings&&typeof n.customizations.vscode.settings!="object"&&e.push({field:"customizations.vscode.settings",message:"Settings must be an object"}),n.name||a.push({field:"name",message:"Consider adding a name for better identification"}),(!n.features||Object.keys(n.features).length===0)&&a.push({field:"features",message:"Consider adding features for common tools"}),(!n.customizations?.vscode?.extensions||n.customizations.vscode.extensions.length===0)&&a.push({field:"extensions",message:"Consider adding VS Code extensions for your stack"}),n.privileged&&s.push({field:"privileged",message:"Running in privileged mode is a security risk"}),{errors:e,suggestions:a,valid:e.length===0,warnings:s}},"validateConfig");var ar=Object.defineProperty,Ge=y((n,e)=>ar(n,"name",{value:e,configurable:!0}),"$");const Te=80,De=15,dr=120,Pe=[{description:"Container name, base image, workspace folder, and user",id:"general",label:"General"},{description:"Installable tools and runtimes (Node, Python, Docker, etc.)",id:"features",label:"Features"},{description:"Ports to forward from the container to your host",id:"ports",label:"Ports"},{description:"Commands to run at different stages of the container lifecycle",id:"lifecycle",label:"Lifecycle"},{description:"VS Code extensions to auto-install in the container",id:"extensions",label:"Extensions"},{description:"Environment variables for the container and IDE",id:"environment",label:"Env"},{description:"Volume and bind mounts for persistent data and caches",id:"mounts",label:"Mounts"},{description:"Docker Compose integration for multi-container setups",id:"compose",label:"Compose"}],ur=Ge((n,e,s,a)=>{switch(n){case"compose":return jt;case"environment":return At(e);case"extensions":return ge(a).length;case"features":return me(s).length;case"general":return Be;case"lifecycle":return Kt;case"mounts":return(e.mounts?.length??0)+1;case"ports":return(e.forwardPorts?.length??0)+1;default:return 0}},"getFieldCount"),hr=Ge(({onSave:n,store:e})=>{const{exit:s}=Ke(),{columns:a,rows:l}=Qe(),o=st(e.subscribe,e.getSnapshot),[d,g]=C(!1),[f,p]=C(!1),[x,v]=C(!1),[w,k]=C(null),[S,P]=C("editor"),[Y,fe]=C(0),[re,oe]=C(!1),[pe,G]=C(""),[R,_]=C(null),[$,j]=C(""),[ve,O]=C(""),[U,L]=C("key"),[ne,K]=C(!1),[ie,M]=C(""),[ce,B]=C(""),[ye,W]=C("volume"),[I,N]=C("source"),se=Z(null),F=Z(null),D=Z(null),Q=Z(!0);le(()=>(Q.current=!0,()=>{Q.current=!1,D.current&&clearTimeout(D.current)}),[]);const be=ur(o.section,o.config,o.featureSearch,o.extensionSearch),X=Math.max(1,l-9);le(()=>{o.section!=="features"&&o.section!=="extensions"||fe(h=>o.fieldIndex>=h+X?o.fieldIndex-X+1:o.fieldIndex<h?o.fieldIndex:h)},[o.fieldIndex,o.section,X]),le(()=>{fe(0)},[o.section,o.featureSearch,o.extensionSearch]);const Re=lt(()=>{const h=e.cleanConfig(),m=lr(h);if(!m.valid){const b=m.errors[0];k(b?`Error: ${b.message}`:"Validation failed"),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{Q.current&&k(null)},3e3);return}n(h),e.markClean();const u=m.warnings.length;k(u>0?`Saved! (${String(u)} warning${u>1?"s":""})`:"Saved!"),D.current&&clearTimeout(D.current),D.current=setTimeout(()=>{Q.current&&k(null)},2e3)},[n,e]);H((h,m)=>{if(m.downArrow||h==="j")e.setTemplateIndex(o.templateIndex+1);else if(m.upArrow||h==="k")e.setTemplateIndex(o.templateIndex-1);else if(m.return){const u=z[o.templateIndex];u&&e.applyTemplate(u.id)}else m.escape&&e.dismissTemplateSelector()},{isActive:o.showTemplateSelector}),H((h,m)=>{if(m.escape){oe(!1),G("");return}if(m.return){const u=Number.parseInt(pe,10);!Number.isNaN(u)&&u>0&&u<=65535&&e.addPort(u),oe(!1),G("");return}if(m.backspace){G(u=>u.slice(0,-1));return}h&&/^\d$/u.test(h)&&G(u=>u+h)},{isActive:re}),H((h,m)=>{if(m.escape){_(null),j(""),O(""),L("key");return}if(m.return){if(U==="key"&&$){L("value");return}if(U==="value"&&$){e.addEnvVar(R,$,ve),_(null),j(""),O(""),L("key");return}}if(m.backspace){U==="key"?j(u=>u.slice(0,-1)):O(u=>u.slice(0,-1));return}h&&!m.ctrl&&!m.meta&&(U==="key"?j(u=>u+h):O(u=>u+h))},{isActive:R!==null}),H((h,m)=>{if(m.escape){K(!1),M(""),B(""),N("source");return}if(m.return){if(I==="source"&&ie){N("target");return}if(I==="target"&&ce){N("type");return}if(I==="type"){e.addMount({source:ie,target:ce,type:ye}),K(!1),M(""),B(""),N("source");return}}if(I==="type"){switch(h){case"1":{W("volume");break}case"2":{W("bind");break}case"3":{W("tmpfs");break}}return}if(m.backspace){I==="source"?M(u=>u.slice(0,-1)):I==="target"&&B(u=>u.slice(0,-1));return}h&&!m.ctrl&&!m.meta&&(I==="source"?M(u=>u+h):I==="target"&&B(u=>u+h))},{isActive:ne}),H((h,m)=>{if(h==="c"&&m.ctrl){s();return}if(!f){if(d){m.escape||h==="?"?g(!1):m.downArrow||h==="j"?se.current?.scrollBy(1):m.upArrow||h==="k"?se.current?.scrollBy(-1):h==="q"&&(g(!1),p(!0));return}if(x){if(m.escape){v(!1),o.section==="features"?e.setFeatureSearch(""):e.setExtensionSearch("");return}if(m.return){v(!1);return}if(m.backspace){o.section==="features"?e.setFeatureSearch(o.featureSearch.slice(0,-1)):e.setExtensionSearch(o.extensionSearch.slice(0,-1));return}if(h&&!m.ctrl&&!m.meta){o.section==="features"?e.setFeatureSearch(o.featureSearch+h):e.setExtensionSearch(o.extensionSearch+h);return}return}if(o.fieldEditing){if(m.escape){e.setFieldEditing(!1);return}if(m.return){e.setFieldEditing(!1);return}return}if(h==="?"){g(!0);return}if(h==="q"){o.isDirty?p(!0):s();return}if(h==="s"){Re();return}if(m.tab){P(u=>u==="editor"?"preview":"editor");return}if(S==="preview"){if(m.downArrow||h==="j"){F.current?.scrollBy(1);return}if(m.upArrow||h==="k"){F.current?.scrollBy(-1);return}if(m.pageDown){F.current?.scrollBy(10);return}if(m.pageUp){F.current?.scrollBy(-10);return}if(m.home){F.current?.scrollToTop();return}if(m.end){F.current?.scrollToBottom();return}m.escape&&P("editor");return}if(m.downArrow||h==="j"){be>0&&e.setFieldIndex(Math.min(o.fieldIndex+1,be-1));return}if(m.upArrow||h==="k"){e.setFieldIndex(Math.max(o.fieldIndex-1,0));return}if(m.return){switch(o.section){case"compose":case"general":case"lifecycle":{e.setFieldEditing(!0);break}case"environment":{const u=Object.keys(o.config.containerEnv??{}).length,b=u,T=u+1+Object.keys(o.config.remoteEnv??{}).length;o.fieldIndex===b?(_("container"),j(""),O(""),L("key")):o.fieldIndex===T&&(_("remote"),j(""),O(""),L("key"));break}case"mounts":{const u=o.config.mounts??[];o.fieldIndex===u.length&&(K(!0),M(""),B(""),W("volume"),N("source"));break}case"ports":{const u=o.config.forwardPorts??[];o.fieldIndex===u.length&&(oe(!0),G(""));break}}return}if(h===" "){switch(o.section){case"extensions":{const u=ge(o.extensionSearch)[o.fieldIndex];u&&e.toggleExtension(u.id);break}case"features":{const u=me(o.featureSearch)[o.fieldIndex];u&&e.toggleFeature(u.id);break}case"general":{const u=Be-ae.length,b=o.fieldIndex-u;if(b>=0&&b<ae.length){const T=ae[b];e.updateConfig({[T]:!o.config[T]})}break}}return}if(h==="/"){(o.section==="features"||o.section==="extensions")&&v(!0);return}if(h==="A"&&o.section==="mounts"){e.applySuggestedMounts();return}if(h==="a"){if(o.section==="environment"){const u=Object.keys(o.config.containerEnv??{}).length,b=o.fieldIndex<=u?"container":"remote";_(b),j(""),O(""),L("key")}else o.section==="mounts"&&(K(!0),M(""),B(""),W("volume"),N("source"));return}if(h==="d")switch(o.section){case"environment":{const u=Object.keys(o.config.containerEnv??{}),b=Object.keys(o.config.remoteEnv??{});if(o.fieldIndex<u.length)e.removeEnvVar("container",u[o.fieldIndex]),u.length===1||o.fieldIndex>=u.length-1&&e.setFieldIndex(u.length-2);else{const T=o.fieldIndex-u.length-1;T>=0&&T<b.length&&(e.removeEnvVar("remote",b[T]),b.length===1||T>=b.length-1&&e.setFieldIndex(o.fieldIndex-1))}break}case"mounts":{const u=o.config.mounts??[];if(o.fieldIndex<u.length){e.removeMount(o.fieldIndex);const b=u.length-1;o.fieldIndex>=b&&b>0&&e.setFieldIndex(b-1)}break}case"ports":{const u=o.config.forwardPorts??[];if(o.fieldIndex<u.length){e.removePort(o.fieldIndex);const b=u.length-1;o.fieldIndex>=b&&b>0&&e.setFieldIndex(b-1)}break}}}},{isActive:!o.showTemplateSelector&&!re&&R===null&&!ne});const _e=q(()=>e.getJsonPreview(),[o.config]);if(a<Te||l<De)return t(c,{alignItems:"center",height:l,justifyContent:"center",width:a,children:i(r,{color:"yellow",children:["Terminal too small (",a,"x",l,"), need"," ",Te,"x",De]})});if(o.showTemplateSelector)return t(c,{alignItems:"center",flexDirection:"column",height:l,justifyContent:"center",width:a,children:i(c,{borderColor:"cyan",borderStyle:"round",flexDirection:"column",paddingX:2,paddingY:1,width:60,children:[t(c,{justifyContent:"center",marginBottom:1,children:t(r,{bold:!0,color:"cyan",children:"Select a Template"})}),z.map((h,m)=>{const u=m===o.templateIndex;return t(c,{children:i(r,{color:u?"cyan":void 0,inverse:u,children:[u?" ❯ ":" ",t(r,{bold:u,children:h.name}),i(r,{dimColor:!0,children:[" ","-",h.description]})]})},h.id)}),t(c,{justifyContent:"center",marginTop:1,children:i(r,{dimColor:!0,children:[t(r,{bold:!0,color:"white",children:"↑↓"})," ","navigate"," ",t(r,{bold:!0,color:"white",children:"Enter"})," ","select"," ",t(r,{bold:!0,color:"white",children:"Esc"})," ","blank"]})})]})});let E;switch(o.section){case"compose":{E=t(Pt,{config:o.config,fieldEditing:o.fieldEditing,fieldIndex:o.fieldIndex,onUpdate:y(h=>{e.updateConfig(h)},"onUpdate")});break}case"environment":{E=i(c,{flexDirection:"column",children:[t(Ft,{config:o.config,fieldIndex:o.fieldIndex}),R!==null&&t(c,{marginTop:1,paddingX:1,children:i(r,{color:"cyan",children:["Add"," ",R," ","env:"," ",U==="key"?i(r,{children:["key=",t(r,{color:"yellow",children:$||"_"})," ","(Enter to set value)"]}):i(r,{children:[$,"=",t(r,{color:"yellow",children:ve||"_"})," ","(Enter to confirm, Esc to cancel)"]})]})})]});break}case"extensions":{E=t(Bt,{config:o.config,fieldIndex:o.fieldIndex,scrollOffset:Y,searchText:o.extensionSearch,viewportHeight:X});break}case"features":{E=t(Gt,{config:o.config,fieldIndex:o.fieldIndex,scrollOffset:Y,searchText:o.featureSearch,viewportHeight:X});break}case"general":{E=t(Xt,{config:o.config,fieldEditing:o.fieldEditing,fieldIndex:o.fieldIndex,onUpdate:y(h=>{e.updateConfig(h)},"onUpdate")});break}case"lifecycle":{E=t(Yt,{config:o.config,fieldEditing:o.fieldEditing,fieldIndex:o.fieldIndex,onSetCommand:y((h,m)=>{e.setLifecycleCommand(h,m)},"onSetCommand")});break}case"mounts":{E=t(Zt,{addingMount:ne,config:o.config,detectedPm:o.detectedPm,fieldIndex:o.fieldIndex,mountPhase:I,mountSource:ie,mountTarget:ce,mountType:ye,suggestedMounts:o.suggestedMounts});break}case"ports":{E=t(rr,{addingPort:re,addPortValue:pe,config:o.config,fieldIndex:o.fieldIndex});break}default:E=t(r,{children:"Unknown section"})}const $e=i(c,{borderBottom:!1,borderColor:"gray",borderLeft:!1,borderRight:!1,borderStyle:"single",flexShrink:0,children:[i(c,{flexGrow:1,flexWrap:"wrap",gap:2,paddingX:1,children:[i(c,{gap:1,children:[t(r,{bold:!0,color:"white",children:"q"}),t(r,{dimColor:!0,children:"QUIT"})]}),i(c,{gap:1,children:[t(r,{bold:!0,color:"white",children:"?"}),t(r,{dimColor:!0,children:"HELP"})]}),i(c,{gap:1,children:[t(r,{bold:!0,color:"white",children:"↑↓"}),t(r,{dimColor:!0,children:"NAV"})]}),(o.section==="features"||o.section==="extensions")&&i(c,{gap:1,children:[t(r,{bold:!0,color:"white",children:"Space"}),t(r,{dimColor:!0,children:"CHECK"})]}),i(c,{gap:1,children:[t(r,{bold:!0,color:"white",children:"←→"}),t(r,{dimColor:!0,children:"TABS"})]}),i(c,{gap:1,children:[t(r,{bold:!0,color:"white",children:"Tab"}),t(r,{dimColor:!0,children:"PANEL"})]}),(o.section==="features"||o.section==="extensions")&&i(c,{gap:1,children:[t(r,{bold:!0,color:"white",children:"/"}),t(r,{dimColor:!0,children:"FILTER"})]}),i(c,{gap:1,children:[t(r,{bold:!0,color:"white",children:"s"}),t(r,{dimColor:!0,children:"SAVE"})]})]}),i(c,{paddingX:1,children:[w&&i(r,{color:w.startsWith("Error")?"red":"green",children:[w," "]}),o.isDirty&&t(r,{color:"yellow",children:"[modified]"}),!o.isDirty&&!w&&t(r,{dimColor:!0,children:"[saved]"})]})]}),Ue=i(Ze,{footer:i(r,{dimColor:!0,children:[t(r,{bold:!0,color:"white",children:"↑↓"})," ","scroll"," ",t(r,{bold:!0,color:"white",children:"?"}),"/",t(r,{bold:!0,color:"white",children:"Esc"})," ","close"]}),scrollRef:se,title:"KEYBOARD SHORTCUTS",visible:d,width:56,children:[i(c,{flexDirection:"column",marginBottom:1,children:[i(c,{marginBottom:1,children:[t(r,{dimColor:!0,children:"── "}),t(r,{bold:!0,color:"white",children:"NAVIGATION"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"←→"}),t(r,{dimColor:!0,children:" Switch tabs"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"↑↓"}),"/",t(r,{bold:!0,color:"white",children:"j/k"}),t(r,{dimColor:!0,children:" Navigate within section"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"Tab"}),t(r,{dimColor:!0,children:" Switch editor/preview panel"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"Enter"}),t(r,{dimColor:!0,children:" Edit selected field"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"Esc"}),t(r,{dimColor:!0,children:" Stop editing / cancel"})]})]}),i(c,{flexDirection:"column",marginBottom:1,children:[i(c,{marginBottom:1,children:[t(r,{dimColor:!0,children:"── "}),t(r,{bold:!0,color:"white",children:"FEATURES / EXTENSIONS"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"Space"}),t(r,{dimColor:!0,children:" Toggle selection"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"/"}),t(r,{dimColor:!0,children:" Search / filter"})]})]}),i(c,{flexDirection:"column",marginBottom:1,children:[i(c,{marginBottom:1,children:[t(r,{dimColor:!0,children:"── "}),t(r,{bold:!0,color:"white",children:"LISTS (Ports, Mounts, Env)"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"a"}),t(r,{dimColor:!0,children:" Add new entry"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"d"}),t(r,{dimColor:!0,children:" Delete selected entry"})]})]}),i(c,{flexDirection:"column",children:[i(c,{marginBottom:1,children:[t(r,{dimColor:!0,children:"── "}),t(r,{bold:!0,color:"white",children:"ACTIONS"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"s"}),t(r,{dimColor:!0,children:" Save configuration"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"q"}),t(r,{dimColor:!0,children:" Quit"})]}),i(r,{children:[" ",t(r,{bold:!0,color:"white",children:"?"}),t(r,{dimColor:!0,children:" Toggle help"})]})]})]}),We=t(ir,{focused:S==="preview",hadComments:o.hadComments,jsonPreview:_e,mode:o.mode,scrollRef:F}),we=a>=dr,Xe=we?Math.floor(a*.38):0;return i(c,{flexDirection:"column",height:l,width:a,children:[i(c,{flexShrink:0,gap:1,paddingX:1,children:[t(r,{bold:!0,inverse:!0,children:" VIS "}),i(r,{wrap:"truncate",children:[o.mode==="create"?"Create":"Edit"," ","devcontainer"]})]}),t(c,{flexShrink:0,paddingX:1,paddingY:1,children:t(et,{defaultValue:o.section,keyMap:{useNumbers:!1,useTab:!1},onChange:y(h=>{e.setSection(h),P("editor")},"onChange"),showIndex:!1,children:Pe.map(({id:h,label:m})=>t(tt,{name:h,children:m},h))})}),t(c,{flexShrink:0,paddingRight:2,children:t(r,{dimColor:!0,wrap:"truncate",children:Pe.find(h=>h.id===o.section)?.description??""})}),i(c,{flexDirection:"row",flexGrow:1,overflow:"hidden",children:[t(c,{borderColor:S==="editor"?"white":"gray",borderStyle:"single",flexDirection:"column",flexGrow:1,overflow:"hidden",children:E}),we&&t(c,{flexShrink:0,width:Xe,children:We})]}),$e,t(ot,{autoExitSeconds:3,onCancel:y(()=>{p(!1)},"onCancel"),visible:f}),Ue]})},"VisDevcontainerApp");var mr=Object.defineProperty,je=y((n,e)=>mr(n,"name",{value:e,configurable:!0}),"c");const kr=je(async({logger:n,options:e,workspaceRoot:s})=>{if(!s)throw new Error("Could not determine workspace root. Run this command inside a monorepo or project directory.");const a=s,l=e.template,o=e.output,d=!!process.stdout.isTTY&&!it;let g=null;try{g=nt(a).name}catch{}const f=pt(a);let p=f?.config??null;const x=f?.hadComments??!1;if(l&&!f){const S=z.find(P=>P.id===l);if(!S){const P=z.map(Y=>Y.id).join(", ");throw new Error(`Unknown template "${l}". Valid templates: ${P}`)}p=S.config}if(!d){p?n.info(JSON.stringify(p,null,2)):(n.error("No existing devcontainer.json found. Use --template to generate one in non-TTY mode."),process.exitCode=1);return}process.stdin.isTTY&&typeof process.stdin.setRawMode=="function"&&(process.stdin.setRawMode(!0),process.stdin.ref(),process.stdin.resume());const v=setInterval(()=>{},1e3),w=new kt(p,x,g);l&&!f&&w.dismissTemplateSelector();let k=null;if(await rt(ct.createElement(hr,{onSave:je(S=>{vt(a,S,o),k=S},"onSave"),store:w}),{alternateScreen:!0,exitOnCtrlC:!1,interactive:!0,patchConsole:!0}).waitUntilExit(),clearInterval(v),k){const S=o??".devcontainer/devcontainer.json";n.info(`DevContainer config saved to ${S}`)}},"execute");export{kr as default};
1
+ import{m as C,f as $,H as A,j as B}from"../packem_shared/index-CE6MsgcV.js";import{p as t}from"./cli-main.js";import{A as F,h,I as H,C as T}from"../packem_shared/pm-runner-CQcraCcu.js";import{a as M,r as N}from"../packem_shared/command-runtime-3FTGuUsK.js";import{s as Q}from"../packem_shared/typosquats-C12CP_2G.js";import{h as U,P as V}from"../packem_shared/peer-warnings-BXAzXqY3.js";import{i as W}from"../packem_shared/utils-CRueU43T.js";const G=["pnpm-lock.yaml","yarn.lock","package-lock.json","npm-shrinkwrap.json","bun.lock","bun.lockb"],J=a=>{let r=a;for(;;){for(const l of G)if($(C(r,l)))return!0;const n=A(r);if(n===r||B(r).root===r)return!1;r=n}},g=new Set(["aube","auto","bun","npm","pnpm","yarn"]),se=async a=>{const{argument:r,fs:n,logger:l,options:e,visConfig:i,workspaceRoot:w}=a,s=w??process.cwd();if(r&&r.length>0){const o=e,{default:q}=await import("./handler15.js"),I=o.marshallCheck===!1||o["no-marshall-check"]===!0?!1:void 0,z=o.socketCheck===!1||o["no-socket-check"]===!0?!1:void 0,E=o.typosquatCheck===!1||o["no-typosquat-check"]===!0?!1:void 0,P=o.runScripts===!0||o["run-scripts"]===!0,j=o.workspaceRoot===!0||o["workspace-root"]===!0,D=o.saveOptional===!0||o["save-optional"]===!0,L=e.dev===!0,_={autoInstallPeers:!1,exact:o.exact===!0,filter:e.filter,global:!1,marshallCheck:I,runScripts:P,saveDev:L,saveOptional:D,savePeer:!1,socketCheck:z,to:void 0,typosquatCheck:E,workspace:!1,workspaceRoot:j};await q({...a,argument:r,options:_});return}if(e.typosquatCheck!==!1&&!await Q(s,i?.security?.typosquatAllowlist)){process.exitCode=1;return}const c=e.installer;if(c&&!g.has(c)){t.error(`Invalid --installer value: "${c}". Expected one of: ${[...g].join(", ")}.`),process.exitCode=1;return}const y=c,b=e.aube===!1,f=M(N({logger:l,options:e,visConfig:i},s));let p;try{p=b?f===void 0?F(s):h(s,{backend:f}):h(s,{backend:y??f,configBackend:i?.install?.backend,configCorepack:i?.install?.corepack})}catch(o){t.error(o instanceof Error?o.message:String(o)),process.exitCode=1;return}const m=H(s,p);m&&t.warn(m);const x=W(e.filter),u=e.ci||!1,d=e.frozenLockfile||u,O=e.frozenLockfile===!1||e.force||e.lockfileOnly,R=J(s),v=d||!O&&R;if(!d&&v&&!e.silent&&t.info("Defaulting to frozen lockfile (pass --no-frozen-lockfile to allow lockfile updates)."),u){t.info("Clean install: removing node_modules...");try{await n.rm(C(s,"node_modules"),{force:!0,recursive:!0})}catch(o){t.error(`Failed to remove node_modules: ${o instanceof Error?o.message:String(o)}`),process.exitCode=1;return}}const{code:k,output:S}=await T(p,{dev:e.dev||!1,filter:x,force:e.force||!1,frozenLockfile:v,ignoreScripts:!e.runScripts,lockfileOnly:e.lockfileOnly||!1,noOptional:e.optional===!1,offline:e.offline||!1,prod:e.prod||!1,recursive:e.recursive||!1,silent:e.silent||!1,workspaceRoot:e.workspaceRoot||!1},s,l,{ciMode:u,preferOffline:e.preferOffline||!1});k!==0&&(process.exitCode=k),k===0&&!e.silent&&U(S)&&t.info(V)};export{se as default};
@@ -1 +1 @@
1
- var k=Object.defineProperty;var n=(e,s)=>k(e,"name",{value:s,configurable:!0});import{a as f,t as u}from"../packem_shared/bin-BaZZ32BK.js";var v=Object.defineProperty,h=n((e,s)=>v(e,"name",{value:s,configurable:!0}),"n");const x=h(async({argument:e,logger:s,options:a,visConfig:t,workspaceRoot:i})=>{const o=e;if(!o||o.length===0)throw new Error("No package specified. Usage: vis dlx <package[@version]> [args...]");const[g,...l]=o,r=i??process.cwd(),p=f(r,{configBackend:t?.install?.backend}),d=a.package?Array.isArray(a.package)?a.package:[a.package]:[],c=u(p,{additionalPackages:d,args:l,package:g,shellMode:a.shellMode||!1,silent:a.silent||!1},r,s);c!==0&&(process.exitCode=c)},"execute");export{x as default};
1
+ import{createRequire as M}from"node:module";import{I as R,E as j,V as A,s as I}from"../packem_shared/index.server-J83sowC4.js";import{m as L,O as B}from"../packem_shared/index-CE6MsgcV.js";import{i as b,p as f,P as N}from"./cli-main.js";import"../packem_shared/public-api-WqUCiyIe.js";import{c as F,f as z,b as U,R as V,l as H}from"./catalog.js";import{h as J,j as W,y as Y}from"../packem_shared/pm-runner-CQcraCcu.js";import{r as G,a as K}from"../packem_shared/command-runtime-3FTGuUsK.js";import{r as P,a as Q,p as X,b as Z}from"../packem_shared/resolve-explicit-CJGazevw.js";import{H as ee,F as C,D as oe,J as te,y,B as se,h as ne}from"../packem_shared/env-DdQRnEIy.js";import{r as re}from"../packem_shared/typosquats-C12CP_2G.js";import{f as D,i as S}from"../packem_shared/utils-CRueU43T.js";import{a as ie}from"../packem_shared/readJsonSync-DuMMeB3s-ihoybKvs.js";const q=M(import.meta.url),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,O=t=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[c,e]=w.versions.node.split(".").map(Number);if(c>22||c===22&&e>=3||c===20&&e>=16)return w.getBuiltinModule(t)}return q(t)},{createInterface:T}=O("node:readline"),x=t=>t==="default"?"catalog:":`catalog:${t}`,v=t=>t==="default"?"default catalog":`catalog "${t}"`,ae=(t,c)=>{const e=[];for(const[o,s]of c)o.includes(":")||s.has(t)&&e.push(o);if(e.length===0)return;if(e.length===1){const[o]=e;return{source:v(o),spec:x(o)}}const r=e.find(o=>o==="default")??e[0],i=e.filter(o=>o!==r);return{candidates:[...e],conflict:!0,source:`${v(r)} (also in: ${i.map(o=>v(o)).join(", ")})`,spec:x(r)}},ce=(t,c)=>{const e=new Map;for(const[a,u]of c){if(!a.includes(":"))continue;const p=u.get(t);p!==void 0&&e.set(p,(e.get(p)??0)+1)}if(e.size===0)return;const r=[...e.entries()],i=r.reduce((a,[,u])=>a+u,0);if(r.length===1){const[[a]]=r;return{source:`siblings (${String(i)} pkg${i===1?"":"s"} on ${a})`,spec:a}}const o=[...r].sort((a,u)=>u[1]-a[1]),[s,n]=o[0],l=o.slice(1).map(([a,u])=>`${a} (×${String(u)})`);return{candidates:o.map(([a])=>a),conflict:!0,source:`siblings (most common: ${s} ×${String(n)}; conflicts: ${l.join(", ")})`,spec:s}},le=(t,c)=>ae(t,c)||ce(t,c),pe=(t,c,e)=>{const r=[];for(const i of t.values()){const{overall:o}=i.score,s=se(o),n=`${String(Math.round(o*100))}%`,l=i.alerts.length,a=y(i),u=ee(a,i.version,e),p=s==="red"?A:s==="yellow"?I:R;if(u?f.info(` ${p(n)} ${C(i)} ${j(`[accepted: ${u.reason}]`)}`):f.info(` ${p(n)} ${C(i)}`),l>0){const g=i.alerts.filter(d=>d.severity==="critical"||d.severity==="high").length;g>0&&f.warn(` ${String(g)} critical/high alert${g===1?"":"s"}`)}o<c&&!u&&r.push(i)}return r},fe=async(t,c)=>{const e=T({input:process.stdin,output:process.stdout}),r=n=>new Promise(l=>{e.question(n,a=>{l(a.trim())})}),i=String(Math.round(c*100));f.warn(""),f.warn(`${String(t.length)} package${t.length===1?"":"s"} scored below the minimum threshold (${i}%):`);for(const n of t){const l=y(n),a=`${String(Math.round(n.score.overall*100))}%`;f.warn(` • ${l}@${n.version} — score: ${a} (${oe(n.score.overall)})`)}f.warn("");const o=await r("Continue adding these packages? [y/N] ");if(o.toLowerCase()!=="y"&&o.toLowerCase()!=="yes")return e.close(),!1;const s=await r("Remember this decision? (prints config snippet) [y/N] ");if(e.close(),s.toLowerCase()==="y"||s.toLowerCase()==="yes"){f.notice(""),f.notice("Add the following to security.acceptedRisks in vis.config.ts:"),f.notice("");for(const n of t){const l=y(n),a=te(l,n.version,n.score.overall,"Reviewed and accepted");f.notice(a)}f.notice("")}return!0},ue=async(t,c,e,r)=>{const i=await P(t);if(i.length===0)return!0;f.info(""),f.info(`${c.map(n=>n.displayName).join(" + ")} security check:`);const o=await z(c,i);if(o.size===0)return f.info(" Could not fetch security data. Proceeding."),!0;const s=pe(o,e,r);return s.length===0?(f.info(""),!0):process.stdin.isTTY?fe(s,e):(f.warn(`Aborting: ${String(s.length)} package${s.length===1?"":"s"} below minimum score. Use --no-socket-check to skip.`),!1)},de=["dependencies","devDependencies","peerDependencies","optionalDependencies"],ge=t=>t.savePeer?"peerDependencies":t.saveOptional?"optionalDependencies":t.saveDev?"devDependencies":"dependencies",_=(t,c)=>t.startsWith("catalog:")||!c?t:t.replace(/^[\^~]/,""),me=async(t,c)=>{const e=[];for(const o of t){const{name:s,versionSpec:n}=D(o);if(!s)continue;if(n!==void 0){e.push({explicit:n,name:s});continue}const l=le(s,c);if(l){l.conflict&&f.warn(`${s}: ambiguous constraint — picking ${l.spec} (${l.source}). Pass ${s}@<version> to override.`),e.push({entry:{name:s,source:l.source,spec:l.spec},kind:"resolved",name:s});continue}e.push({kind:"missing",name:s})}const r=e.filter(o=>"kind"in o&&o.kind==="missing").map(o=>o.name),i=r.length>0?await Z(r):new Map;return e.map(o=>{if("explicit"in o)return{name:o.name,source:"explicit",spec:o.explicit};if(o.kind==="resolved")return o.entry;const s=i.get(o.name);if(s===void 0)throw new Error(`--to: cannot resolve a version for "${o.name}" (not in any catalog or sibling, and registry lookup failed). Pass ${o.name}@<version> explicitly.`);const n=`^${s}`;return f.info(`${o.name}: no existing constraint — using registry latest (${n}). Add to a catalog to share this version across workspace packages.`),{name:o.name,source:"registry latest",spec:n}})},he=(t,c,e,r)=>{for(const{name:i,spec:o}of c){const s=_(o,r);for(const l of de){if(l===e)continue;const a=t[l];a?.[i]!==void 0&&(delete a[i],Object.keys(a).length===0&&delete t[l])}let n=t[e];n===void 0&&(n={},t[e]=n),n[i]=s}},ke=async({ignoreScripts:t,logger:c,options:e,packages:r,pm:i,target:o,visConfig:s,workspaceRoot:n})=>{const{workspace:l}=U(n,s??{}),a=l.projects[o];if(!a){const m=Object.keys(l.projects).sort();throw new Error(`--to: workspace package "${o}" not found. Available: ${m.length>0?m.slice(0,10).join(", "):"(none)"}${m.length>10?`, ... (${String(m.length-10)} more)`:""}.`)}const u=L(n,a.root,"package.json"),{packageManager:p}=N(n),g=V(n,p),d=ge(e),k=e.exact??!1,h=await me(r,g);if(h.length===0)return 0;const $=ie(u);he($,h,d,k),B(u,$,{indent:H(u,{useEditorconfig:s?.editorconfig??!0}),overwrite:!0});for(const m of h){const E=_(m.spec,k);f.info(`${R("+")} ${m.name}@${E} → ${o}/${d} (${j(m.source)})`)}return Y(i,{dev:!1,filter:[],force:!1,frozenLockfile:!1,ignoreScripts:t,lockfileOnly:!1,noOptional:!1,offline:!1,prod:!1,recursive:!1,silent:!1,workspaceRoot:!1},n,c)},Ee=async({argument:t,logger:c,options:e,visConfig:r,workspaceRoot:i})=>{let o=t;if(!o||o.length===0)throw new Error("No packages specified. Usage: vis add <packages...>");if(e.typosquatCheck!==!1){const p=o.map(d=>D(d)),g=await re(p.map(d=>d.name),r?.security?.typosquatAllowlist);if(!g.ok){process.exitCode=1;return}o=p.map((d,k)=>{const h=g.packages[k];return h!==d.name?d.versionSpec?`${h}@${d.versionSpec}`:h??"":o[k]??""})}if(e.marshallCheck!==!1){const p=await P(o);if(p.length>0){const g=await Q(p,{config:r?.security?.marshalls,workspaceRoot:i});if(!await X(g)){process.exitCode=1;return}}}if(e.socketCheck!==!1){const p=new Set;b("socket")&&p.add("socket"),b("depsDev")&&p.add("deps-dev");const g=F(r?.security,{disabled:p,minimumScore:r?.security?.policies?.score?.minimum});if(g.length>0){const d=r?.security?.policies?.score?.minimum??ne;if(!await ue(o,g,d,r?.security?.acceptedRisks)){process.exitCode=1;return}}}const s=process.cwd(),n=G({logger:c,options:e,visConfig:r},i??s),l=J(i??s,{backend:K(n),configBackend:r?.install?.backend,configCorepack:r?.install?.corepack}),a=!e.runScripts;if(e.to){if(e.global||e.workspaceRoot)throw new Error("--to is incompatible with --global / --workspace-root.");if(e.filter&&S(e.filter).length>0)throw new Error("--to and --filter are mutually exclusive — --to already targets one package.");if(!i)throw new Error("--to requires a monorepo workspace. Run from inside a pnpm/bun/yarn/npm workspace.");const p=await ke({ignoreScripts:a,logger:c,options:e,packages:o,pm:l,target:e.to,visConfig:r,workspaceRoot:i});p!==0&&(process.exitCode=p);return}const u=W(l,{exact:e.exact||!1,filter:S(e.filter),global:e.global||!1,optional:e.saveOptional||!1,packages:o,peer:e.savePeer||!1,saveDev:e.saveDev||!1,workspace:e.workspace||!1,workspaceRoot:e.workspaceRoot||!1},s,c,{autoInstallPeers:e.autoInstallPeers||!1,ignoreScripts:a});u!==0&&(process.exitCode=u)};export{Ee as default};