@visulima/vis 6.2.0 → 6.4.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 (169) hide show
  1. package/CHANGELOG.md +13 -0
  2. package/dist/bin.js +1 -1
  3. package/dist/binx.js +1 -1
  4. package/dist/packem_chunks/DEFAULT_CLEAN_KEEP.js +1 -1
  5. package/dist/packem_chunks/bloom-sync.js +1 -1
  6. package/dist/packem_chunks/cargo-lock.js +5 -5
  7. package/dist/packem_chunks/cargo-plan.js +3 -3
  8. package/dist/packem_chunks/catalog2.js +1 -1
  9. package/dist/packem_chunks/cli-exec.js +1 -1
  10. package/dist/packem_chunks/cli-main.js +1 -1
  11. package/dist/packem_chunks/composer-projects.js +2 -2
  12. package/dist/packem_chunks/context.js +4 -4
  13. package/dist/packem_chunks/detect.js +4 -4
  14. package/dist/packem_chunks/fix.js +1 -1
  15. package/dist/packem_chunks/git.js +8 -5
  16. package/dist/packem_chunks/go-plan.js +1 -1
  17. package/dist/packem_chunks/go-projects.js +1 -1
  18. package/dist/packem_chunks/group-tags.js +1 -1
  19. package/dist/packem_chunks/handler.js +1 -1
  20. package/dist/packem_chunks/handler10.js +1 -1
  21. package/dist/packem_chunks/handler11.js +1 -1
  22. package/dist/packem_chunks/handler12.js +1 -1
  23. package/dist/packem_chunks/handler13.js +1 -1
  24. package/dist/packem_chunks/handler14.js +1 -1
  25. package/dist/packem_chunks/handler15.js +1 -1
  26. package/dist/packem_chunks/handler16.js +1 -1
  27. package/dist/packem_chunks/handler17.js +1 -1
  28. package/dist/packem_chunks/handler18.js +1 -1
  29. package/dist/packem_chunks/handler19.js +1 -1
  30. package/dist/packem_chunks/handler2.js +1 -1
  31. package/dist/packem_chunks/handler20.js +1 -1
  32. package/dist/packem_chunks/handler21.js +1 -1
  33. package/dist/packem_chunks/handler23.js +1 -1
  34. package/dist/packem_chunks/handler24.js +1 -1
  35. package/dist/packem_chunks/handler25.js +1 -1
  36. package/dist/packem_chunks/handler26.js +1 -1
  37. package/dist/packem_chunks/handler27.js +1 -1
  38. package/dist/packem_chunks/handler28.js +1 -1
  39. package/dist/packem_chunks/handler29.js +1 -1
  40. package/dist/packem_chunks/handler3.js +1 -1
  41. package/dist/packem_chunks/handler32.js +1 -1
  42. package/dist/packem_chunks/handler4.js +1 -1
  43. package/dist/packem_chunks/handler46.js +1 -1
  44. package/dist/packem_chunks/handler49.js +1 -1
  45. package/dist/packem_chunks/handler5.js +1 -1
  46. package/dist/packem_chunks/handler50.js +1 -1
  47. package/dist/packem_chunks/handler51.js +1 -1
  48. package/dist/packem_chunks/handler52.js +1 -1
  49. package/dist/packem_chunks/handler54.js +1 -1
  50. package/dist/packem_chunks/handler55.js +1 -1
  51. package/dist/packem_chunks/handler56.js +4 -4
  52. package/dist/packem_chunks/handler58.js +1 -1
  53. package/dist/packem_chunks/handler59.js +1 -1
  54. package/dist/packem_chunks/handler6.js +1 -1
  55. package/dist/packem_chunks/handler60.js +1 -1
  56. package/dist/packem_chunks/handler61.js +1 -1
  57. package/dist/packem_chunks/handler62.js +1 -1
  58. package/dist/packem_chunks/handler63.js +1 -1
  59. package/dist/packem_chunks/handler64.js +1 -1
  60. package/dist/packem_chunks/handler65.js +1 -1
  61. package/dist/packem_chunks/handler66.js +1 -1
  62. package/dist/packem_chunks/handler67.js +1 -1
  63. package/dist/packem_chunks/handler68.js +1 -1
  64. package/dist/packem_chunks/handler69.js +1 -1
  65. package/dist/packem_chunks/handler7.js +1 -1
  66. package/dist/packem_chunks/handler70.js +1 -1
  67. package/dist/packem_chunks/handler71.js +1 -1
  68. package/dist/packem_chunks/handler72.js +1 -1
  69. package/dist/packem_chunks/handler73.js +1 -1
  70. package/dist/packem_chunks/handler74.js +1 -1
  71. package/dist/packem_chunks/handler75.js +1 -1
  72. package/dist/packem_chunks/handler76.js +1 -1
  73. package/dist/packem_chunks/handler77.js +1 -1
  74. package/dist/packem_chunks/handler78.js +1 -1
  75. package/dist/packem_chunks/handler79.js +1 -1
  76. package/dist/packem_chunks/handler8.js +1 -1
  77. package/dist/packem_chunks/handler9.js +1 -1
  78. package/dist/packem_chunks/heal-accept.js +1 -1
  79. package/dist/packem_chunks/heal.js +1 -1
  80. package/dist/packem_chunks/help-command.js +1 -1
  81. package/dist/packem_chunks/index2.js +3 -3
  82. package/dist/packem_chunks/index3.js +26 -26
  83. package/dist/packem_chunks/index7.js +1 -1
  84. package/dist/packem_chunks/keys-refresh.js +1 -1
  85. package/dist/packem_chunks/list.js +1 -1
  86. package/dist/packem_chunks/loader.js +1 -1
  87. package/dist/packem_chunks/print-config.js +1 -1
  88. package/dist/packem_chunks/prune.js +1 -1
  89. package/dist/packem_chunks/python-projects.js +1 -1
  90. package/dist/packem_chunks/snapshot.js +1 -1
  91. package/dist/packem_chunks/status.js +1 -1
  92. package/dist/packem_chunks/success-walk.js +16 -6
  93. package/dist/packem_chunks/sync.js +1 -1
  94. package/dist/packem_chunks/sync2.js +1 -1
  95. package/dist/packem_chunks/tripwire.js +1 -1
  96. package/dist/packem_chunks/verify-lockfile.js +1 -1
  97. package/dist/packem_chunks/version-resolver.js +1 -1
  98. package/dist/packem_chunks/workspace.js +1 -1
  99. package/dist/packem_shared/{ReleaseClient-B4xWga1q.js → ReleaseClient-1hH9OIcb.js} +1 -1
  100. package/dist/packem_shared/{advisories-3ZfSV0LH.js → advisories-DyHTz-me.js} +1 -1
  101. package/dist/packem_shared/{affected-selection-BkHUfErA.js → affected-selection-C3eYhoTa.js} +1 -1
  102. package/dist/packem_shared/{ai-analysis-CbjIaasa.js → ai-analysis-y1glEwHU.js} +1 -1
  103. package/dist/packem_shared/{ai-cache-VYBlfP7G.js → ai-cache-Bq3dQd87.js} +1 -1
  104. package/dist/packem_shared/{ai-fix-_ZbH_K45.js → ai-fix-BQUNIOMp.js} +1 -1
  105. package/dist/packem_shared/apply-DA-Dv8Pq.js +8 -0
  106. package/dist/packem_shared/apply-release-plan-BZ_E8GXQ.js +15 -0
  107. package/dist/packem_shared/{bin-KU_2tR-G.js → bin-DEQ52GkZ.js} +1 -1
  108. package/dist/packem_shared/{build-scripts-DtqsovcF.js → build-scripts-wF0ykoin.js} +1 -1
  109. package/dist/packem_shared/{dependency-scan-BUs_kdX-.js → dependency-scan-BNqHSRaA.js} +1 -1
  110. package/dist/packem_shared/{detect-DSMoIgaH.js → detect-B9mLzG9L.js} +1 -1
  111. package/dist/packem_shared/{docker-52xcbz7D.js → docker-CpJj7VQ6.js} +1 -1
  112. package/dist/packem_shared/{ecosystem-gate-Fu5__-JA.js → ecosystem-gate-DI5TKrtm.js} +1 -1
  113. package/dist/packem_shared/{env-CJVZRP-o.js → env-CsENUmRe.js} +1 -1
  114. package/dist/packem_shared/{env-consistency-cqaZf4xr.js → env-consistency-HvLV2yQ6.js} +1 -1
  115. package/dist/packem_shared/{failure-log-Ba31iSwN.js → failure-log-C8Vh0Vtk.js} +1 -1
  116. package/dist/packem_shared/glob-Cyk1H9ZL-ChoYoZKK.js +1 -0
  117. package/dist/packem_shared/{index-B4AjSxHU.js → index--eV4qIz5.js} +1 -1
  118. package/dist/packem_shared/{index-0YpDONiz.js → index-CFglig6K.js} +1 -1
  119. package/dist/packem_shared/{index-_FIeiL52.js → index-CLcQ8Xe4.js} +1 -1
  120. package/dist/packem_shared/{interface.d-CrHOtJc1.d.ts → interface.d-Bb_1pid9.d.ts} +1 -1
  121. package/dist/packem_shared/{interface.d-CRqRz4jt.d.ts → interface.d-BlaMrDqd.d.ts} +7 -0
  122. package/dist/packem_shared/{lifecycle-BUKDvgHs.js → lifecycle-DNz4d7ND.js} +1 -1
  123. package/dist/packem_shared/{manifests-p1zhN8pD.js → manifests-CgyI-i-c.js} +1 -1
  124. package/dist/packem_shared/{min-release-age-D782Z1Yw.js → min-release-age-BpvYMZuT.js} +1 -1
  125. package/dist/packem_shared/{missing-package-json-BoK5DGmG.js → missing-package-json-Bg72nt4h.js} +1 -1
  126. package/dist/packem_shared/{multi-eco-lockfiles-OaHbR4J9.js → multi-eco-lockfiles-BCGfTwHy.js} +1 -1
  127. package/dist/packem_shared/{native-config-sync-pyH7zbC_.js → native-config-sync-em22UAUQ.js} +1 -1
  128. package/dist/packem_shared/{osv-Cc5Ay6Oh.js → osv-CjtVHCRP.js} +1 -1
  129. package/dist/packem_shared/{package-version-B-FGASyU.js → package-version-BzkcrNVE.js} +1 -1
  130. package/dist/packem_shared/{packument-q5JfSrU7.js → packument-BvTjAHsy.js} +1 -1
  131. package/dist/packem_shared/{pm-runner-Dboj-wZG.js → pm-runner-BXRi4ZM9.js} +1 -1
  132. package/dist/packem_shared/{project-name-filter-DP4RCrn3.js → project-name-filter-DKFmLbwE.js} +1 -1
  133. package/dist/packem_shared/{provenance-DqvqDJn5.js → provenance-DFN3qbB3.js} +1 -1
  134. package/dist/packem_shared/publish-missing-MxqARUPC.js +35 -0
  135. package/dist/packem_shared/{registry-acz8_sxm.js → registry-CIfr2njA.js} +1 -1
  136. package/dist/packem_shared/{registry-keys-BEhcTEZZ.js → registry-keys-Cq92YoCx.js} +1 -1
  137. package/dist/packem_shared/{renderToString-DR0zDUjh-CWJW0Ktb.js → renderToString-DR0zDUjh-BUpUCnJt.js} +1 -1
  138. package/dist/packem_shared/{resolve-explicit-DlvpbFfx.js → resolve-explicit-CZlkR05q.js} +1 -1
  139. package/dist/packem_shared/{run-summary-utils-BiTJspOl.js → run-summary-utils-BYPm6bUE.js} +1 -1
  140. package/dist/packem_shared/{runtime-check-DaFcciiJ.js → runtime-check-DUxn-Idd.js} +1 -1
  141. package/dist/packem_shared/{s1ngularity-CZT2Pgbl.js → s1ngularity-CPXsMMnh.js} +1 -1
  142. package/dist/packem_shared/{scaffold-files-CkXH8tRQ.js → scaffold-files-ojq9leuZ.js} +1 -1
  143. package/dist/packem_shared/{scan-progress-Dd0DYpfJ.js → scan-progress-DBaFUryq.js} +1 -1
  144. package/dist/packem_shared/{selectors-DGWSSXWM.js → selectors-aT_XJTrh.js} +1 -1
  145. package/dist/packem_shared/{signatures-DBVHek52.js → signatures-C2HaWfZn.js} +1 -1
  146. package/dist/packem_shared/{spinner-BjxtOJJc.js → spinner-C23pifwn.js} +1 -1
  147. package/dist/packem_shared/{table-c5KdYeRx.js → table-CAjUuSN2.js} +1 -1
  148. package/dist/packem_shared/{tabs-D81GPdC_.js → tabs-CogGAIWQ.js} +1 -1
  149. package/dist/packem_shared/{toolchain-D8qgs8sr.js → toolchain-BF6NEQJ2.js} +1 -1
  150. package/dist/packem_shared/{typosquats-BxBeFNUo.js → typosquats-MPA4DNWt.js} +1 -1
  151. package/dist/packem_shared/{use-measured-height-D7d36UUm.js → use-measured-height-BHJ8aL73.js} +1 -1
  152. package/dist/packem_shared/{vis-update-app-C_wcaC7g.js → vis-update-app--aolEPqW.js} +1 -1
  153. package/dist/packem_shared/{vis-user-error-B73F9C2Z.js → vis-user-error-DUyARIaA.js} +1 -1
  154. package/dist/packem_shared/{watch-loop-BeyVtDyD.js → watch-loop-C7VCU587.js} +1 -1
  155. package/dist/release/core/changelog/index.d.ts +1 -1
  156. package/dist/release/core/package-managers/index.d.ts +2 -2
  157. package/dist/release/core/version-actions/index.d.ts +3 -3
  158. package/dist/release/index.d.ts +3 -3
  159. package/dist/release/index.js +1 -1
  160. package/dist/release/plugin-sdk.d.ts +3 -3
  161. package/dist/release/types.d.ts +67 -7
  162. package/index.js +26 -26
  163. package/package.json +9 -9
  164. package/schemas/vis-config.schema.json +31 -3
  165. package/schemas/vis-release-config.schema.json +31 -3
  166. package/dist/packem_shared/apply-DoeQAAGm.js +0 -6
  167. package/dist/packem_shared/apply-release-plan-BalHtK-g.js +0 -15
  168. package/dist/packem_shared/glob-Cyk1H9ZL-COXzOVwd.js +0 -1
  169. package/dist/packem_shared/publish-missing-Hnqkjxov.js +0 -35
@@ -1,3 +1,3 @@
1
- import{createRequire as N}from"node:module";import O from"./index.js";import{VisReleaseError as l}from"../packem_shared/VisReleaseError-DZtgcKf8.js";let _;const A=c=>(_??=N(import.meta.url))(c),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,x=c=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[e,t]=f.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return f.getBuiltinModule(c)}return A(c)},{readFile:b,rename:L,readdir:C}=x("node:fs/promises"),{isAbsolute:k,join:u,basename:S}=x("node:path");class m{constructor(e){this.runner=e}runner;async publishNative(e){throw new l({code:"CONFIG_INVALID",hint:'Set publish.publishStrategy back to "npm-publish-tarball" (the default), or use a package manager whose adapter implements native publish.',message:`publishStrategy "native" is not supported by the "${this.id}" adapter.`})}async readCatalogYaml(e){}}const w=(c,e)=>{if(c.exitCode===0)return{output:c.stdout,published:!0};const t=`${c.stdout}
2
- ${c.stderr}`;if(/EPUBLISHCONFLICT|cannot publish over the previously published versions|forbidden.*409/i.test(t))return{alreadyPublished:!0,output:t,published:!1};throw new l({code:"PUBLISH_FAILED",message:`${e} failed: ${t}`})};class g extends m{id="npm";minVersion="11.5.1";async pack(e){const t=["pack","--json"];e.destination&&t.push("--pack-destination",e.destination);const s=await this.runner.run("npm",t,{cwd:e.cwd,silent:!0});if(s.exitCode!==0)throw new l({code:"PUBLISH_FAILED",message:`npm pack failed: ${s.stderr||s.stdout}`});const a=JSON.parse(s.stdout),r=a[0]?.filename;if(!r)throw new l({code:"PUBLISH_FAILED",hint:"Upgrade npm to a version that emits --json output, or report this with the raw stdout.",message:`npm pack: could not parse output: ${s.stdout}`});const n=e.destination??e.cwd;let i=k(r)?r:u(n,r);return e.filename&&(await(await import("node:fs/promises")).rename(i,u(n,e.filename)),i=u(n,e.filename)),{raw:a,tarball:i}}async installLockfileOnly(e){const t=await this.runner.run("npm",["install","--package-lock-only"],{cwd:e.cwd,silent:e.silent});if(t.exitCode!==0)throw new l({code:"CONFIG_INVALID",message:`npm install --package-lock-only failed: ${t.stderr||t.stdout}`})}async listWorkspacePackages(e){const t=await this.runner.run("npm",["query",".workspace","--json"],{cwd:e,silent:!0});if(t.exitCode!==0)return[];try{return JSON.parse(t.stdout).filter(a=>typeof a.name=="string").map(a=>({name:a.name,path:a.path??a.location??e,private:a.private??!1,version:a.version??"0.0.0"}))}catch{return[]}}async publish(e){const t=e.stage?["stage","publish",e.tarball]:["publish",e.tarball];e.tag&&t.push("--tag",e.tag),e.access&&t.push("--access",e.access),e.registry&&t.push("--registry",e.registry),e.otp&&t.push("--otp",e.otp),e.provenance&&t.push("--provenance"),e.stage&&t.push("--json");for(const r of e.extraArgs??[])t.push(r);const s=await this.runner.run("npm",t,{cwd:process.cwd(),silent:!0});if(s.exitCode===0){const r={output:s.stdout,published:!0};if(e.stage)try{const n=JSON.parse(s.stdout);r.stageId=n.id??n.stageId}catch{}return r}const a=`${s.stdout}
3
- ${s.stderr}`;if(/EPUBLISHCONFLICT|cannot publish over the previously published versions|forbidden.*409/i.test(a))return{alreadyPublished:!0,output:a,published:!1};throw new l({code:"PUBLISH_FAILED",message:`npm publish failed: ${a}`})}async publishNative(e){const t=["publish"];e.tag&&t.push("--tag",e.tag),e.access&&t.push("--access",e.access),e.registry&&t.push("--registry",e.registry),e.otp&&t.push("--otp",e.otp),e.provenance&&t.push("--provenance");for(const a of e.extraArgs??[])t.push(a);const s=await this.runner.run("npm",t,{cwd:e.cwd,silent:!0});return w(s,"npm publish")}async detectVersion(e){const t=await this.runner.run("npm",["--version"],{cwd:e,silent:!0});return t.exitCode===0?t.stdout.trim():void 0}}class j extends m{id="bun";minVersion="1.1.36";async pack(e){const t=["pm","pack"];e.destination&&t.push("--destination",e.destination);const s=await this.runner.run("bun",t,{cwd:e.cwd,silent:!0});if(s.exitCode!==0)throw new l({code:"PUBLISH_FAILED",message:`bun pm pack failed: ${s.stderr||s.stdout}`});const a=/(?:^|["'\s])([^\s"']*\.tgz)/m.exec(s.stdout),r=e.destination??e.cwd;let n;if(a?.[1]){const i=a[1];n=k(i)?i:u(r,i)}else{const i=JSON.parse(await b(u(e.cwd,"package.json"),"utf8")),d=(i.name??"package").replaceAll("/","-").replace(/^@/,"");n=u(r,`${d}-${i.version??"0.0.0"}.tgz`)}if(e.filename&&S(n)!==e.filename){const i=u(r,e.filename);await L(n,i),n=i}return{raw:s.stdout,tarball:n}}async installLockfileOnly(e){const t=await this.runner.run("bun",["install","--lockfile-only"],{cwd:e.cwd,silent:e.silent});if(t.exitCode!==0)throw new l({code:"CONFIG_INVALID",message:`bun install --lockfile-only failed: ${t.stderr||t.stdout}`})}async listWorkspacePackages(e){try{const t=JSON.parse(await b(u(e,"package.json"),"utf8")),s=Array.isArray(t.workspaces)?t.workspaces:t.workspaces?.packages??[];if(s.length===0)return[];const a=new Set,r=["."],n=5,i=new Set;for(;r.length>0;){const o=r.shift();if(i.has(o)||(i.add(o),(o==="."?0:o.split("/").length)>n))continue;let p;try{p=await C(u(e,o),{withFileTypes:!0})}catch{continue}for(const h of p){if(!h.isDirectory()||h.name==="node_modules"||h.name.startsWith("."))continue;const y=o==="."?h.name:`${o}/${h.name}`;s.some(I=>O(I,y))&&a.add(y),r.push(y)}}const d=[];for(const o of a){const v=u(e,o,"package.json");try{const p=JSON.parse(await b(v,"utf8"));if(typeof p.name!="string")continue;d.push({name:p.name,path:u(e,o),private:p.private??!1,version:p.version??"0.0.0"})}catch{}}return d}catch{return[]}}async publish(e){return new g(this.runner).publish(e)}async publishNative(e){const t=["publish"];e.tag&&t.push("--tag",e.tag),e.access&&t.push("--access",e.access),e.registry&&t.push("--registry",e.registry);for(const a of e.extraArgs??[])t.push(a);const s=await this.runner.run("bun",t,{cwd:e.cwd,silent:!0});return w(s,"bun publish")}async detectVersion(e){const t=await this.runner.run("bun",["--version"],{cwd:e,silent:!0});return t.exitCode===0?t.stdout.trim():void 0}}class P extends m{id="pnpm";minVersion="9.5.0";async pack(e){const t=["pack","--json"];e.destination&&t.push("--pack-destination",e.destination);const s=await this.runner.run("pnpm",t,{cwd:e.cwd,silent:!0});if(s.exitCode!==0)throw new l({code:"PUBLISH_FAILED",message:`pnpm pack failed: ${s.stderr||s.stdout}`});const a=JSON.parse(s.stdout),{filename:r}=a;if(!r)throw new l({code:"PUBLISH_FAILED",message:`pnpm pack: could not parse output: ${s.stdout}`});const n=e.destination??e.cwd;let i=k(r)?r:u(n,r);return e.filename&&(await(await import("node:fs/promises")).rename(i,u(n,e.filename)),i=u(n,e.filename)),{raw:a,tarball:i}}async installLockfileOnly(e){const t=await this.runner.run("pnpm",["install","--lockfile-only"],{cwd:e.cwd,silent:e.silent});if(t.exitCode!==0)throw new l({code:"CONFIG_INVALID",message:`pnpm install --lockfile-only failed: ${t.stderr||t.stdout}`})}async listWorkspacePackages(e){const t=await this.runner.run("pnpm",["-r","ls","--depth","-1","--json"],{cwd:e,silent:!0});if(t.exitCode!==0)return[];try{return JSON.parse(t.stdout).filter(a=>typeof a.name=="string").map(a=>({name:a.name,path:a.path??e,private:a.private??!1,version:a.version??"0.0.0"}))}catch{return[]}}async publish(e){return new g(this.runner).publish(e)}async publishNative(e){const t=["publish","--no-git-checks"];e.tag&&t.push("--tag",e.tag),e.access&&t.push("--access",e.access),e.registry&&t.push("--registry",e.registry),e.otp&&t.push("--otp",e.otp),e.provenance&&t.push("--provenance");for(const a of e.extraArgs??[])t.push(a);const s=await this.runner.run("pnpm",t,{cwd:e.cwd,silent:!0});return w(s,"pnpm publish")}async detectVersion(e){const t=await this.runner.run("pnpm",["--version"],{cwd:e,silent:!0});return t.exitCode===0?t.stdout.trim():void 0}async readCatalogYaml(e){const t=await import("node:fs/promises");try{return await t.readFile(u(e,"pnpm-workspace.yaml"),"utf8")}catch{return}}}class $ extends m{id="yarn";minVersion="4.0.0";async pack(e){const t=e.destination??e.cwd,s=e.filename??"%s-%v.tgz",a=["pack","--out",u(t,s)],r=await this.runner.run("yarn",a,{cwd:e.cwd,silent:!0});if(r.exitCode!==0)throw new l({code:"PUBLISH_FAILED",message:`yarn pack failed: ${r.stderr||r.stdout}`});const n=await import("node:fs/promises"),i=await import("node:path"),d=JSON.parse(await n.readFile(i.join(e.cwd,"package.json"),"utf8")),o=s.replaceAll("%s",(d.name??"package").replaceAll("/","-").replace(/^@/,"")).replaceAll("%v",d.version??"0.0.0");return{raw:r.stdout,tarball:u(t,o)}}async installLockfileOnly(e){const t=await this.runner.run("yarn",["install","--mode","update-lockfile"],{cwd:e.cwd,silent:e.silent});if(t.exitCode!==0)throw new l({code:"CONFIG_INVALID",message:`yarn install --mode update-lockfile failed: ${t.stderr||t.stdout}`})}async listWorkspacePackages(e){const t=await this.runner.run("yarn",["workspaces","list","--json"],{cwd:e,silent:!0});if(t.exitCode!==0)return[];const s=[];for(const a of t.stdout.split(/\r?\n/)){const r=a.trim();if(r)try{const n=JSON.parse(r);if(typeof n.name!="string"||n.name==="")continue;s.push({name:n.name,path:n.location?u(e,n.location):e,private:!1,version:"0.0.0"})}catch{}}return s}async publish(e){return new g(this.runner).publish(e)}async publishNative(e){const t=["npm","publish"];e.tag&&t.push("--tag",e.tag),e.access&&t.push("--access",e.access),e.provenance&&t.push("--provenance");for(const a of e.extraArgs??[])t.push(a);const s=await this.runner.run("yarn",t,{cwd:e.cwd,silent:!0});return w(s,"yarn npm publish")}async detectVersion(e){const t=await this.runner.run("yarn",["--version"],{cwd:e,silent:!0});return t.exitCode===0?t.stdout.trim():void 0}}const B=async(c,e)=>{const t=await import("node:fs/promises"),s=await import("node:path");try{const r=JSON.parse(await t.readFile(s.join(c,"package.json"),"utf8"));if(typeof r.packageManager=="string"){const n=r.packageManager.indexOf("@"),i=n>0?r.packageManager.slice(0,n):r.packageManager;if(i==="pnpm"||i==="yarn"||i==="bun"||i==="npm")return i}}catch{}const a=async r=>{try{return await t.access(s.join(c,r)),!0}catch{return!1}};return await a("bun.lock")||await a("bun.lockb")?"bun":await a("pnpm-lock.yaml")||await a("pnpm-workspace.yaml")?"pnpm":await a("yarn.lock")?"yarn":"npm"},J=(c,e)=>{switch(c){case"bun":return new j(e);case"pnpm":return new P(e);case"yarn":return new $(e);default:return new g(e)}};export{g as N,J as c,B as d};
1
+ import{createRequire as N}from"node:module";import O from"./index.js";import{VisReleaseError as l}from"../packem_shared/VisReleaseError-DZtgcKf8.js";let _;const A=c=>(_??=N(import.meta.url))(c),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,I=c=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[e,t]=h.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return h.getBuiltinModule(c)}return A(c)},{readFile:b,rename:L,readdir:C}=I("node:fs/promises"),{isAbsolute:k,join:u,basename:S}=I("node:path");class m{constructor(e){this.runner=e}runner;async publishNative(e){throw new l({code:"CONFIG_INVALID",hint:'Set publish.publishStrategy back to "npm-publish-tarball" (the default), or use a package manager whose adapter implements native publish.',message:`publishStrategy "native" is not supported by the "${this.id}" adapter.`})}async readCatalogYaml(e){}}const w=(c,e)=>{if(c.exitCode===0)return{output:c.stdout,published:!0};const t=`${c.stdout}
2
+ ${c.stderr}`;if(/EPUBLISHCONFLICT|cannot publish over the previously published versions|forbidden.*409/i.test(t))return{alreadyPublished:!0,output:t,published:!1};throw new l({code:"PUBLISH_FAILED",message:`${e} failed: ${t}`})};class g extends m{id="npm";minVersion="11.5.1";async pack(e){const t=["pack","--json"];e.destination&&t.push("--pack-destination",e.destination);const a=await this.runner.run("npm",t,{cwd:e.cwd,silent:!0});if(a.exitCode!==0)throw new l({code:"PUBLISH_FAILED",message:`npm pack failed: ${a.stderr||a.stdout}`});const s=JSON.parse(a.stdout),r=s[0]?.filename;if(!r)throw new l({code:"PUBLISH_FAILED",hint:"Upgrade npm to a version that emits --json output, or report this with the raw stdout.",message:`npm pack: could not parse output: ${a.stdout}`});const n=e.destination??e.cwd;let i=k(r)?r:u(n,r);return e.filename&&(await(await import("node:fs/promises")).rename(i,u(n,e.filename)),i=u(n,e.filename)),{raw:s,tarball:i}}async installLockfileOnly(e){const t=await this.runner.run("npm",["install","--package-lock-only","--ignore-scripts"],{cwd:e.cwd,silent:e.silent});if(t.exitCode!==0)throw new l({code:"CONFIG_INVALID",message:`npm install --package-lock-only failed: ${t.stderr||t.stdout}`})}async listWorkspacePackages(e){const t=await this.runner.run("npm",["query",".workspace","--json"],{cwd:e,silent:!0});if(t.exitCode!==0)return[];try{return JSON.parse(t.stdout).filter(s=>typeof s.name=="string").map(s=>({name:s.name,path:s.path??s.location??e,private:s.private??!1,version:s.version??"0.0.0"}))}catch{return[]}}async publish(e){const t=e.stage?["stage","publish",e.tarball]:["publish",e.tarball];e.tag&&t.push("--tag",e.tag),e.access&&t.push("--access",e.access),e.registry&&t.push("--registry",e.registry),e.otp&&t.push("--otp",e.otp),e.provenance&&t.push("--provenance"),e.stage&&t.push("--json");for(const r of e.extraArgs??[])t.push(r);const a=await this.runner.run("npm",t,{cwd:process.cwd(),silent:!0});if(a.exitCode===0){const r={output:a.stdout,published:!0};if(e.stage)try{const n=JSON.parse(a.stdout);r.stageId=n.id??n.stageId}catch{}return r}const s=`${a.stdout}
3
+ ${a.stderr}`;if(/EPUBLISHCONFLICT|cannot publish over the previously published versions|forbidden.*409/i.test(s))return{alreadyPublished:!0,output:s,published:!1};throw new l({code:"PUBLISH_FAILED",message:`npm publish failed: ${s}`})}async publishNative(e){const t=["publish"];e.tag&&t.push("--tag",e.tag),e.access&&t.push("--access",e.access),e.registry&&t.push("--registry",e.registry),e.otp&&t.push("--otp",e.otp),e.provenance&&t.push("--provenance");for(const s of e.extraArgs??[])t.push(s);const a=await this.runner.run("npm",t,{cwd:e.cwd,silent:!0});return w(a,"npm publish")}async detectVersion(e){const t=await this.runner.run("npm",["--version"],{cwd:e,silent:!0});return t.exitCode===0?t.stdout.trim():void 0}}class $ extends m{id="bun";minVersion="1.1.36";async pack(e){const t=["pm","pack"];e.destination&&t.push("--destination",e.destination);const a=await this.runner.run("bun",t,{cwd:e.cwd,silent:!0});if(a.exitCode!==0)throw new l({code:"PUBLISH_FAILED",message:`bun pm pack failed: ${a.stderr||a.stdout}`});const s=/(?:^|["'\s])([^\s"']*\.tgz)/m.exec(a.stdout),r=e.destination??e.cwd;let n;if(s?.[1]){const i=s[1];n=k(i)?i:u(r,i)}else{const i=JSON.parse(await b(u(e.cwd,"package.json"),"utf8")),d=(i.name??"package").replaceAll("/","-").replace(/^@/,"");n=u(r,`${d}-${i.version??"0.0.0"}.tgz`)}if(e.filename&&S(n)!==e.filename){const i=u(r,e.filename);await L(n,i),n=i}return{raw:a.stdout,tarball:n}}async installLockfileOnly(e){const t=await this.runner.run("bun",["install","--lockfile-only","--ignore-scripts"],{cwd:e.cwd,silent:e.silent});if(t.exitCode!==0)throw new l({code:"CONFIG_INVALID",message:`bun install --lockfile-only failed: ${t.stderr||t.stdout}`})}async listWorkspacePackages(e){try{const t=JSON.parse(await b(u(e,"package.json"),"utf8")),a=Array.isArray(t.workspaces)?t.workspaces:t.workspaces?.packages??[];if(a.length===0)return[];const s=new Set,r=["."],n=5,i=new Set;for(;r.length>0;){const o=r.shift();if(i.has(o)||(i.add(o),(o==="."?0:o.split("/").length)>n))continue;let p;try{p=await C(u(e,o),{withFileTypes:!0})}catch{continue}for(const f of p){if(!f.isDirectory()||f.name==="node_modules"||f.name.startsWith("."))continue;const y=o==="."?f.name:`${o}/${f.name}`;a.some(x=>O(x,y))&&s.add(y),r.push(y)}}const d=[];for(const o of s){const v=u(e,o,"package.json");try{const p=JSON.parse(await b(v,"utf8"));if(typeof p.name!="string")continue;d.push({name:p.name,path:u(e,o),private:p.private??!1,version:p.version??"0.0.0"})}catch{}}return d}catch{return[]}}async publish(e){return new g(this.runner).publish(e)}async publishNative(e){const t=["publish"];e.tag&&t.push("--tag",e.tag),e.access&&t.push("--access",e.access),e.registry&&t.push("--registry",e.registry);for(const s of e.extraArgs??[])t.push(s);const a=await this.runner.run("bun",t,{cwd:e.cwd,silent:!0});return w(a,"bun publish")}async detectVersion(e){const t=await this.runner.run("bun",["--version"],{cwd:e,silent:!0});return t.exitCode===0?t.stdout.trim():void 0}}class j extends m{id="pnpm";minVersion="9.5.0";async pack(e){const t=["pack","--json"];e.destination&&t.push("--pack-destination",e.destination);const a=await this.runner.run("pnpm",t,{cwd:e.cwd,silent:!0});if(a.exitCode!==0)throw new l({code:"PUBLISH_FAILED",message:`pnpm pack failed: ${a.stderr||a.stdout}`});const s=JSON.parse(a.stdout),{filename:r}=s;if(!r)throw new l({code:"PUBLISH_FAILED",message:`pnpm pack: could not parse output: ${a.stdout}`});const n=e.destination??e.cwd;let i=k(r)?r:u(n,r);return e.filename&&(await(await import("node:fs/promises")).rename(i,u(n,e.filename)),i=u(n,e.filename)),{raw:s,tarball:i}}async installLockfileOnly(e){const t=await this.runner.run("pnpm",["install","--lockfile-only","--ignore-scripts"],{cwd:e.cwd,silent:e.silent});if(t.exitCode!==0)throw new l({code:"CONFIG_INVALID",message:`pnpm install --lockfile-only failed: ${t.stderr||t.stdout}`})}async verifyLockfile(e){const t=await this.runner.run("pnpm",["install","--frozen-lockfile","--lockfile-only","--ignore-scripts"],{cwd:e.cwd,silent:!0});if(t.exitCode!==0)throw new l({code:"CONFIG_INVALID",hint:"Nothing was published. Fix the lockfile on the branch (or set release.verifyLockfile: false).",message:`pnpm-lock.yaml does not satisfy the manifests after the version step (pnpm install --frozen-lockfile failed): ${t.stderr||t.stdout}`})}async listWorkspacePackages(e){const t=await this.runner.run("pnpm",["-r","ls","--depth","-1","--json"],{cwd:e,silent:!0});if(t.exitCode!==0)return[];try{return JSON.parse(t.stdout).filter(s=>typeof s.name=="string").map(s=>({name:s.name,path:s.path??e,private:s.private??!1,version:s.version??"0.0.0"}))}catch{return[]}}async publish(e){return new g(this.runner).publish(e)}async publishNative(e){const t=["publish","--no-git-checks"];e.tag&&t.push("--tag",e.tag),e.access&&t.push("--access",e.access),e.registry&&t.push("--registry",e.registry),e.otp&&t.push("--otp",e.otp),e.provenance&&t.push("--provenance");for(const s of e.extraArgs??[])t.push(s);const a=await this.runner.run("pnpm",t,{cwd:e.cwd,silent:!0});return w(a,"pnpm publish")}async detectVersion(e){const t=await this.runner.run("pnpm",["--version"],{cwd:e,silent:!0});return t.exitCode===0?t.stdout.trim():void 0}async readCatalogYaml(e){const t=await import("node:fs/promises");try{return await t.readFile(u(e,"pnpm-workspace.yaml"),"utf8")}catch{return}}}class F extends m{id="yarn";minVersion="4.0.0";async pack(e){const t=e.destination??e.cwd,a=e.filename??"%s-%v.tgz",s=["pack","--out",u(t,a)],r=await this.runner.run("yarn",s,{cwd:e.cwd,silent:!0});if(r.exitCode!==0)throw new l({code:"PUBLISH_FAILED",message:`yarn pack failed: ${r.stderr||r.stdout}`});const n=await import("node:fs/promises"),i=await import("node:path"),d=JSON.parse(await n.readFile(i.join(e.cwd,"package.json"),"utf8")),o=a.replaceAll("%s",(d.name??"package").replaceAll("/","-").replace(/^@/,"")).replaceAll("%v",d.version??"0.0.0");return{raw:r.stdout,tarball:u(t,o)}}async installLockfileOnly(e){const t=await this.runner.run("yarn",["install","--mode","update-lockfile"],{cwd:e.cwd,silent:e.silent});if(t.exitCode!==0)throw new l({code:"CONFIG_INVALID",message:`yarn install --mode update-lockfile failed: ${t.stderr||t.stdout}`})}async listWorkspacePackages(e){const t=await this.runner.run("yarn",["workspaces","list","--json"],{cwd:e,silent:!0});if(t.exitCode!==0)return[];const a=[];for(const s of t.stdout.split(/\r?\n/)){const r=s.trim();if(r)try{const n=JSON.parse(r);if(typeof n.name!="string"||n.name==="")continue;a.push({name:n.name,path:n.location?u(e,n.location):e,private:!1,version:"0.0.0"})}catch{}}return a}async publish(e){return new g(this.runner).publish(e)}async publishNative(e){const t=["npm","publish"];e.tag&&t.push("--tag",e.tag),e.access&&t.push("--access",e.access),e.provenance&&t.push("--provenance");for(const s of e.extraArgs??[])t.push(s);const a=await this.runner.run("yarn",t,{cwd:e.cwd,silent:!0});return w(a,"yarn npm publish")}async detectVersion(e){const t=await this.runner.run("yarn",["--version"],{cwd:e,silent:!0});return t.exitCode===0?t.stdout.trim():void 0}}const B=async(c,e)=>{const t=await import("node:fs/promises"),a=await import("node:path");try{const r=JSON.parse(await t.readFile(a.join(c,"package.json"),"utf8"));if(typeof r.packageManager=="string"){const n=r.packageManager.indexOf("@"),i=n>0?r.packageManager.slice(0,n):r.packageManager;if(i==="pnpm"||i==="yarn"||i==="bun"||i==="npm")return i}}catch{}const s=async r=>{try{return await t.access(a.join(c,r)),!0}catch{return!1}};return await s("bun.lock")||await s("bun.lockb")?"bun":await s("pnpm-lock.yaml")||await s("pnpm-workspace.yaml")?"pnpm":await s("yarn.lock")?"yarn":"npm"},J=(c,e)=>{switch(c){case"bun":return new $(e);case"pnpm":return new j(e);case"yarn":return new F(e);default:return new g(e)}};export{g as N,J as c,B as d};
@@ -1,40 +1,40 @@
1
- import{createRequire as Ge}from"node:module";import{VersionActions as C}from"../packem_shared/AfterAllProjectsVersioned-CAKI2nWf.js";import{VisReleaseError as l}from"../packem_shared/VisReleaseError-DZtgcKf8.js";import Se from"./index.js";import{c as J}from"./cargo-lock.js";import{s as V,r as We,P as qe}from"./python.js";import{tagExists as ae,renderTagPattern as W,defaultTagFor as _e}from"./git.js";import{a as Xe,s as ne,o as ie,i as te}from"../packem_shared/gradle-build-CHZDHyjI.js";import{rewriteCatalogRefs as Ve}from"./catalog.js";import{c as Oe}from"../packem_shared/clean-package-json-rutwkKl-.js";import{assertValidPackageName as Y,resolveCustomCommands as Q,interpolateCommand as Z}from"./security.js";import{r as Je}from"../packem_shared/apply-release-plan-BalHtK-g.js";let je;const Ue=a=>(je??=Ge(import.meta.url))(a),F=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,K=a=>{if(typeof F<"u"&&F.versions&&F.versions.node){const[e,r]=F.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return F.getBuiltinModule(a)}return Ue(a)},{readdir:re,readFile:_,rm:se,access:Ne,writeFile:E,mkdtemp:Be}=K("node:fs/promises"),{join:w,sep:Ae,dirname:U,relative:He,resolve:Ke,basename:R}=K("node:path"),{mkdtempSync:z,writeFileSync:Ye}=K("node:fs"),{tmpdir:B}=K("node:os"),ze=async(a,e)=>{let r=[a];for(const s of e.split("/").filter(n=>n!==""&&n!==".")){if(s==="**")throw new l({code:"CONFIG_INVALID",message:`Unsupported [workspace].members pattern "${e}": "**" is not supported. List the crate directories explicitly or use "dir/*".`});const n=/[*?[{]/.test(s),i=[];for(const t of r){if(!n){i.push(w(t,s));continue}const o=await re(t,{withFileTypes:!0}).catch(()=>[]);for(const d of o)d.isDirectory()&&Se(s,d.name)&&i.push(w(t,d.name))}r=i}return r},Qe=(a,e)=>{for(const r of e)if(a===r||a.startsWith(`${r}${Ae}`))return!0;return!1},De=async a=>{let e=U(J(a));for(;;){const r=w(e,"Cargo.toml"),s=await x(r);if(s!==void 0){const t=(await H(s,r)).workspace?.package?.version;if(typeof t=="string")return t}const n=U(e);if(n===e)return;e=n}},x=async a=>{try{return await _(a,"utf8")}catch{return}},H=async(a,e)=>{const{parse:r}=await import("./index4.js");try{return r(a)}catch(s){throw new l({cause:s,code:"CONFIG_INVALID",file:e,message:`Failed to parse ${e}: ${s.message}`})}},oe=a=>Array.isArray(a)?a.filter(e=>typeof e=="string"):[],q=a=>typeof a=="object"&&a!==null&&a.workspace===!0,Ze=(a,e)=>{const r=q(a.publish)?e.workspace?.package?.publish:a.publish;return r===!1||Array.isArray(r)&&r.length===0},xe=(a,e,r,s)=>{const n=[];for(const[i,t]of Object.entries(a.dependencies??{})){const o=t,d=q(o),u=d?e.workspace?.dependencies?.[i]:o,k=d?s:r;u===void 0||typeof u!="object"||typeof u.path!="string"||n.push({dir:Ke(k,u.path),name:typeof u.package=="string"?u.package:i,requirement:typeof u.version=="string"?u.version:"*"})}return n},er=async a=>{const{claimedDirs:e,cwd:r}=a,s=w(r,"Cargo.toml"),n=await x(s);if(n===void 0)return[];const i=await H(n,s),t=new Set;i.package&&t.add(r);const o=oe(i.workspace?.exclude);for(const g of oe(i.workspace?.members))for(const p of await ze(r,g)){const h=He(r,p).split(Ae).join("/");h.split("/").includes("target")||o.some(c=>Se(c,h))||t.add(p)}const d=new Set([...e].map(g=>J(g))),u=[];for(const g of[...t].sort()){if(Qe(J(g),d))continue;const p=w(g,"Cargo.toml"),h=await x(p);if(h===void 0)continue;const c=await H(h,p);if(!c.package)continue;const{name:b}=c.package;if(typeof b!="string"||b==="")throw new l({code:"CONFIG_INVALID",file:p,message:`${p} has a [package] table without a name.`});const P=c.package.version,v=typeof P=="string"?P:q(P)?i.workspace?.package?.version:void 0;if(typeof v!="string")throw new l({code:"CONFIG_INVALID",file:p,message:`${p} has no resolvable [package].version.`});u.push({dir:g,manifestPath:p,name:b,pathDeps:xe(c,i,g,r),private:Ze(c.package,i),version:v})}const k=new Map(u.map(g=>[g.dir,g]));return u.map(g=>{const p={};for(const c of g.pathDeps){const b=k.get(c.dir);b&&(p[b.name]=c.requirement)}const h={dependencies:p,name:g.name,private:g.private,version:g.version};return{dir:g.dir,ecosystem:"cargo",manifest:h,manifestPath:g.manifestPath,name:g.name,private:g.private,version:g.version}})},ms=Object.defineProperty({__proto__:null,discoverCargoCrates:er,findInheritedWorkspaceVersion:De,inheritsFromWorkspace:q,parseCargoDoc:H},Symbol.toStringTag,{value:"Module"}),rr="https://crates.io/api/v1/crates",sr="Cargo.toml",pe=async a=>{let e;try{e=await _(a,"utf8")}catch(o){throw new l({cause:o,code:"CONFIG_INVALID",file:a,message:`Failed to read Cargo.toml at ${a}: ${o.message}`})}const{parse:r}=await import("./index4.js");let s;try{s=r(e)}catch(o){throw new l({cause:o,code:"CONFIG_INVALID",file:a,message:`Failed to parse Cargo.toml at ${a}: ${o.message}`})}if(!s.package)throw new l({code:"CONFIG_INVALID",file:a,hint:"CargoVersionActions only supports publishable crates with a [package] table. For workspace roots, point per-package config at the member crate directory.",message:`Cargo.toml at ${a} has no [package] table.`});const{name:n}=s.package;if(typeof n!="string"||n.length===0)throw new l({code:"CONFIG_INVALID",file:a,message:`Cargo.toml at ${a} is missing [package].name.`});const i=s.package.version;let t;if(typeof i=="string"?t=i:i&&typeof i=="object"&&i.workspace===!0&&(t=await De(a)??s.workspace?.package?.version),typeof t!="string"||t.length===0)throw new l({code:"CONFIG_INVALID",file:a,hint:"Set [package].version explicitly, or — for workspace-inherited versions — ensure the root Cargo.toml carries [workspace.package].version and point per-package config at it.",message:`Cargo.toml at ${a} has no resolvable [package].version.`});return{name:n,version:t}},le=async(a,e)=>{const r=`${rr}/${encodeURIComponent(a)}`;try{const s=await V(r,{headers:{Accept:"application/json"},httpProxy:e});if(s.status===404||!s.ok)return;const n=await s.json();return n?.crate?.max_stable_version??n?.crate?.max_version??void 0}catch{return}},ar=(a,e)=>We({env:a,staticTokenVar:"CARGO_REGISTRY_TOKEN",workspaceConfig:e})==="oidc",nr=async(a,e)=>{const r=await a.run("cargo",["package","--list","--allow-dirty"],{cwd:e,silent:!0});return r.exitCode!==0?[]:r.stdout.split(/\r?\n/).map(s=>s.trim()).filter(s=>s.length>0)};class ir extends C{id="cargo";async readPublishedVersion(e){const r=ee(e.pkg);try{const{name:s}=await pe(r);return await le(s)}catch{return}}async publish(e){if(e.dryRun)return{output:`[dry-run / cargo] would publish ${e.pkg.name}@${e.release.newVersion}`,published:!0};const r=ee(e.pkg,e.perPackageConfig),s=tr(e.pkg,e.perPackageConfig),{name:n,version:i}=await pe(r);if(i!==e.release.newVersion)throw new l({code:"CONFIG_INVALID",file:r,hint:`Confirm the cargo() preset's crateDir points at the directory containing this Cargo.toml. Expected ${e.release.newVersion} on disk after the extra-files bump.`,message:`Cargo.toml version (${i}) does not match planned release version (${e.release.newVersion}) for ${e.pkg.name}.`,packageName:e.pkg.name});if(await le(n,e.workspaceConfig?.httpProxy)===e.release.newVersion)return{alreadyPublished:!0,output:`[cargo] ${n}@${e.release.newVersion} already on crates.io`,published:!1};const o=ar(process.env,e.workspaceConfig);if(!o&&!process.env.CARGO_REGISTRY_TOKEN)throw new l({code:"AUTH_MISSING",hint:"Set CARGO_REGISTRY_TOKEN, or run from a GH-Actions job with `permissions: id-token: write` for OIDC trusted publishing.",message:`Cannot publish ${n}@${e.release.newVersion}: neither CARGO_REGISTRY_TOKEN nor OIDC trusted publishing is available.`,packageName:e.pkg.name});const d=e.workspaceConfig?.publish?.guards;if(d?.packSecretScan){const g=await nr(e.pm.runner,s);if(g.length>0){const{runPackSecretScan:p}=await import("./publish-guards.js"),h=typeof d.packSecretScan=="object"?d.packSecretScan.ignore:void 0,c=await p({files:g,ignore:h,pkgDir:s});if(!c.passed){const{redactTokens:b}=await import("./security.js"),P=c.findings.map(v=>` • [packSecretScan] ${b(v.message)}${v.hint?`
1
+ import{createRequire as je}from"node:module";import{VersionActions as C}from"../packem_shared/AfterAllProjectsVersioned-CAKI2nWf.js";import{VisReleaseError as d}from"../packem_shared/VisReleaseError-DZtgcKf8.js";import Se from"./index.js";import{a as J}from"./cargo-lock.js";import{s as V,r as qe,P as Xe}from"./python.js";import{tagExists as ae,renderTagPattern as W,defaultTagFor as _e}from"./git.js";import{a as Ye,s as ne,o as ie,i as te}from"../packem_shared/gradle-build-CHZDHyjI.js";import{rewriteCatalogRefs as Ve}from"./catalog.js";import{c as Oe}from"../packem_shared/clean-package-json-rutwkKl-.js";import{assertValidPackageName as Y,resolveCustomCommands as Q,interpolateCommand as Z}from"./security.js";import{u as ze}from"../packem_shared/apply-release-plan-BZ_E8GXQ.js";let Ue;const Be=a=>(Ue??=je(import.meta.url))(a),F=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,K=a=>{if(typeof F<"u"&&F.versions&&F.versions.node){const[e,r]=F.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return F.getBuiltinModule(a)}return Be(a)},{readdir:re,readFile:_,rm:se,access:Ne,writeFile:E,mkdtemp:He}=K("node:fs/promises"),{join:w,sep:Ae,dirname:U,relative:Ke,resolve:We,basename:R}=K("node:path"),{mkdtempSync:z,writeFileSync:Je}=K("node:fs"),{tmpdir:B}=K("node:os"),Qe=async(a,e)=>{let r=[a];for(const s of e.split("/").filter(n=>n!==""&&n!==".")){if(s==="**")throw new d({code:"CONFIG_INVALID",message:`Unsupported [workspace].members pattern "${e}": "**" is not supported. List the crate directories explicitly or use "dir/*".`});const n=/[*?[{]/.test(s),i=[];for(const t of r){if(!n){i.push(w(t,s));continue}const o=await re(t,{withFileTypes:!0}).catch(()=>[]);for(const l of o)l.isDirectory()&&Se(s,l.name)&&i.push(w(t,l.name))}r=i}return r},Ze=(a,e)=>{for(const r of e)if(a===r||a.startsWith(`${r}${Ae}`))return!0;return!1},De=async a=>{let e=U(J(a));for(;;){const r=w(e,"Cargo.toml"),s=await x(r);if(s!==void 0){const t=(await H(s,r)).workspace?.package?.version;if(typeof t=="string")return t}const n=U(e);if(n===e)return;e=n}},x=async a=>{try{return await _(a,"utf8")}catch{return}},H=async(a,e)=>{const{parse:r}=await import("./index4.js");try{return r(a)}catch(s){throw new d({cause:s,code:"CONFIG_INVALID",file:e,message:`Failed to parse ${e}: ${s.message}`})}},oe=a=>Array.isArray(a)?a.filter(e=>typeof e=="string"):[],q=a=>typeof a=="object"&&a!==null&&a.workspace===!0,xe=(a,e)=>{const r=q(a.publish)?e.workspace?.package?.publish:a.publish;return r===!1||Array.isArray(r)&&r.length===0},er=(a,e,r,s)=>{const n=[];for(const[i,t]of Object.entries(a.dependencies??{})){const o=t,l=q(o),u=l?e.workspace?.dependencies?.[i]:o,k=l?s:r;u===void 0||typeof u!="object"||typeof u.path!="string"||n.push({dir:We(k,u.path),name:typeof u.package=="string"?u.package:i,requirement:typeof u.version=="string"?u.version:"*"})}return n},rr=async a=>{const{claimedDirs:e,cwd:r}=a,s=w(r,"Cargo.toml"),n=await x(s);if(n===void 0)return[];const i=await H(n,s),t=new Set;i.package&&t.add(r);const o=oe(i.workspace?.exclude);for(const g of oe(i.workspace?.members))for(const p of await Qe(r,g)){const h=Ke(r,p).split(Ae).join("/");h.split("/").includes("target")||o.some(c=>Se(c,h))||t.add(p)}const l=new Set([...e].map(g=>J(g))),u=[];for(const g of[...t].sort()){if(Ze(J(g),l))continue;const p=w(g,"Cargo.toml"),h=await x(p);if(h===void 0)continue;const c=await H(h,p);if(!c.package)continue;const{name:b}=c.package;if(typeof b!="string"||b==="")throw new d({code:"CONFIG_INVALID",file:p,message:`${p} has a [package] table without a name.`});const P=c.package.version,v=typeof P=="string"?P:q(P)?i.workspace?.package?.version:void 0;if(typeof v!="string")throw new d({code:"CONFIG_INVALID",file:p,message:`${p} has no resolvable [package].version.`});u.push({dir:g,manifestPath:p,name:b,pathDeps:er(c,i,g,r),private:xe(c.package,i),version:v})}const k=new Map(u.map(g=>[g.dir,g]));return u.map(g=>{const p={};for(const c of g.pathDeps){const b=k.get(c.dir);b&&(p[b.name]=c.requirement)}const h={dependencies:p,name:g.name,private:g.private,version:g.version};return{dir:g.dir,ecosystem:"cargo",manifest:h,manifestPath:g.manifestPath,name:g.name,private:g.private,version:g.version}})},ms=Object.defineProperty({__proto__:null,discoverCargoCrates:rr,findInheritedWorkspaceVersion:De,inheritsFromWorkspace:q,parseCargoDoc:H},Symbol.toStringTag,{value:"Module"}),sr="https://crates.io/api/v1/crates",ar="Cargo.toml",pe=async a=>{let e;try{e=await _(a,"utf8")}catch(o){throw new d({cause:o,code:"CONFIG_INVALID",file:a,message:`Failed to read Cargo.toml at ${a}: ${o.message}`})}const{parse:r}=await import("./index4.js");let s;try{s=r(e)}catch(o){throw new d({cause:o,code:"CONFIG_INVALID",file:a,message:`Failed to parse Cargo.toml at ${a}: ${o.message}`})}if(!s.package)throw new d({code:"CONFIG_INVALID",file:a,hint:"CargoVersionActions only supports publishable crates with a [package] table. For workspace roots, point per-package config at the member crate directory.",message:`Cargo.toml at ${a} has no [package] table.`});const{name:n}=s.package;if(typeof n!="string"||n.length===0)throw new d({code:"CONFIG_INVALID",file:a,message:`Cargo.toml at ${a} is missing [package].name.`});const i=s.package.version;let t;if(typeof i=="string"?t=i:i&&typeof i=="object"&&i.workspace===!0&&(t=await De(a)??s.workspace?.package?.version),typeof t!="string"||t.length===0)throw new d({code:"CONFIG_INVALID",file:a,hint:"Set [package].version explicitly, or — for workspace-inherited versions — ensure the root Cargo.toml carries [workspace.package].version and point per-package config at it.",message:`Cargo.toml at ${a} has no resolvable [package].version.`});return{name:n,version:t}},le=async(a,e)=>{const r=`${sr}/${encodeURIComponent(a)}`;try{const s=await V(r,{headers:{Accept:"application/json"},httpProxy:e});if(s.status===404||!s.ok)return;const n=await s.json();return n?.crate?.max_stable_version??n?.crate?.max_version??void 0}catch{return}},nr=(a,e)=>qe({env:a,staticTokenVar:"CARGO_REGISTRY_TOKEN",workspaceConfig:e})==="oidc",ir=async(a,e)=>{const r=await a.run("cargo",["package","--list","--allow-dirty"],{cwd:e,silent:!0});return r.exitCode!==0?[]:r.stdout.split(/\r?\n/).map(s=>s.trim()).filter(s=>s.length>0)};class tr extends C{id="cargo";async readPublishedVersion(e){const r=ee(e.pkg);try{const{name:s}=await pe(r);return await le(s)}catch{return}}async publish(e){if(e.dryRun)return{output:`[dry-run / cargo] would publish ${e.pkg.name}@${e.release.newVersion}`,published:!0};const r=ee(e.pkg,e.perPackageConfig),s=or(e.pkg,e.perPackageConfig),{name:n,version:i}=await pe(r);if(i!==e.release.newVersion)throw new d({code:"CONFIG_INVALID",file:r,hint:`Confirm the cargo() preset's crateDir points at the directory containing this Cargo.toml. Expected ${e.release.newVersion} on disk after the extra-files bump.`,message:`Cargo.toml version (${i}) does not match planned release version (${e.release.newVersion}) for ${e.pkg.name}.`,packageName:e.pkg.name});if(await le(n,e.workspaceConfig?.httpProxy)===e.release.newVersion)return{alreadyPublished:!0,output:`[cargo] ${n}@${e.release.newVersion} already on crates.io`,published:!1};const o=nr(process.env,e.workspaceConfig);if(!o&&!process.env.CARGO_REGISTRY_TOKEN)throw new d({code:"AUTH_MISSING",hint:"Set CARGO_REGISTRY_TOKEN, or run from a GH-Actions job with `permissions: id-token: write` for OIDC trusted publishing.",message:`Cannot publish ${n}@${e.release.newVersion}: neither CARGO_REGISTRY_TOKEN nor OIDC trusted publishing is available.`,packageName:e.pkg.name});const l=e.workspaceConfig?.publish?.guards;if(l?.packSecretScan){const g=await ir(e.pm.runner,s);if(g.length>0){const{runPackSecretScan:p}=await import("./publish-guards.js"),h=typeof l.packSecretScan=="object"?l.packSecretScan.ignore:void 0,c=await p({files:g,ignore:h,pkgDir:s});if(!c.passed){const{redactTokens:b}=await import("./security.js"),P=c.findings.map(v=>` • [packSecretScan] ${b(v.message)}${v.hint?`
2
2
  → ${b(v.hint)}`:""}`).join(`
3
- `);throw new l({code:"PUBLISH_FAILED",message:`Pre-publish secret scan failed for ${n}@${e.release.newVersion}:
4
- ${P}`,packageName:e.pkg.name})}}}const u=["publish","--allow-dirty"];e.registry&&e.registry!=="https://crates.io"&&u.push("--registry",e.registry);const k=await e.pm.runner.run("cargo",u,{cwd:s,silent:!1});if(k.exitCode!==0)throw new l({code:"PUBLISH_FAILED",hint:"Inspect the cargo output above. Common causes: missing CARGO_REGISTRY_TOKEN, OIDC permission misconfigured, version already published, crates.io rate limit. Re-runs are safe — the published-version probe short-circuits subsequent runs.",message:`cargo publish failed for ${n}@${e.release.newVersion}: exit ${k.exitCode}. stderr: ${k.stderr.trim().slice(0,500)}`,packageName:e.pkg.name});return{output:`[cargo] published ${n}@${e.release.newVersion}${o?" (trusted publishing)":""}`,published:!0}}}const ee=(a,e)=>{const r=e?.cargoTomlPath??sr;return w(a.dir,r)},tr=(a,e)=>U(ee(a,e)),or=(a,e,r)=>W(a?.releaseTagPattern??"v{version}",{name:e,version:r});class pr extends C{id="composer";async readPublishedVersion(e){}async publish(e){const{name:r}=e.pkg,s=e.release.newVersion,n=or(e.perPackageConfig,r,s);if(e.dryRun)return{output:`[dry-run / composer] would tag ${n} for ${r}@${s}`,published:!0};if(process.platform==="win32")throw new l({code:"CONFIG_INVALID",message:`${r} cannot be released from Windows yet: the Composer tag path is not tested there. Release from a POSIX runner.`,packageName:r});if((await e.pm.runner.run("git",["--version"],{cwd:e.pkg.dir,silent:!0})).exitCode!==0)throw new l({code:"CONFIG_INVALID",message:`${r} needs git on PATH to release its tag, and git --version failed.`,packageName:r});return await ae({cwd:e.pkg.dir,runner:e.pm.runner},n)?{alreadyPublished:!0,output:`[composer] ${r}@${s} is already tagged ${n}; skipped`,published:!1}:{output:`[composer] ${r}@${s} released by tag ${n}`,published:!0}}}const lr=["linux/amd64","linux/arm64"],dr=a=>{const e=a.indexOf("/");if(e===-1)return{registry:"docker.io",repository:`library/${a}`};const r=a.slice(0,e),s=a.slice(e+1);return r==="localhost"||r.includes(".")||r.includes(":")?{registry:r,repository:s}:s.includes("/")?{registry:"docker.io",repository:a}:{registry:"docker.io",repository:`${r}/${s}`}},de=(a,e)=>{const{registry:r,repository:s}=dr(a);return`https://${r==="docker.io"?"registry-1.docker.io":r}/v2/${s}/manifests/${encodeURIComponent(e)}`},Re=a=>{const e=a??{};return{buildContext:e.buildContext,containerBuildArgs:e.containerBuildArgs,containerImage:e.containerImage,containerPlatforms:e.containerPlatforms,containerSigning:e.containerSigning,containerSkipLatest:e.containerSkipLatest}},ur=(a,e)=>{const r=Re(a);if(typeof r.containerImage!="string"||r.containerImage.length===0)throw new l({code:"CONFIG_INVALID",hint:["Container packages must declare `containerImage` in their per-pkg release config:","",' release.packages["<pkg>"] = container({',' image: "ghcr.io/scope/foo",',' platforms: ["linux/amd64", "linux/arm64"],',' signing: "cosign", // optional'," })","",'Or set `versionActions: "container"` + `containerImage` directly.'].join(`
5
- `),message:`containerImage is required for versionActions: "container" on ${e}`,packageName:e});return{buildContext:r.buildContext,containerBuildArgs:r.containerBuildArgs,containerImage:r.containerImage,containerPlatforms:r.containerPlatforms,containerSigning:r.containerSigning,containerSkipLatest:r.containerSkipLatest}};class cr extends C{id="container";async readPublishedVersion(e){const r=Re(e.perPackageConfig);if(!r.containerImage)return;const s=e.pkg.version,n=de(r.containerImage,s);try{return(await V(n,{headers:{Accept:["application/vnd.oci.image.manifest.v1+json","application/vnd.oci.image.index.v1+json","application/vnd.docker.distribution.manifest.v2+json","application/vnd.docker.distribution.manifest.list.v2+json"].join(",")},httpProxy:e.workspaceConfig?.httpProxy,method:"HEAD"})).status===200?s:void 0}catch{return}}async publish(e){const r=ur(e.perPackageConfig,e.pkg.name);if(e.dryRun){const{command:i}=ue(e,r);return{output:`[dry-run / container] would run: ${i.join(" ")}`,published:!0}}try{const i=de(r.containerImage,e.release.newVersion);if((await V(i,{httpProxy:e.workspaceConfig?.httpProxy,method:"HEAD"})).status===200)return{alreadyPublished:!0,output:`[container] ${r.containerImage}:${e.release.newVersion} already published`,published:!1}}catch{}const{command:s}=ue(e,r),n=await e.pm.runner.run(s[0],s.slice(1),{cwd:e.pkg.dir,silent:!1});if(n.exitCode!==0)throw new l({code:"PUBLISH_FAILED",hint:["docker buildx build failed. Common causes:"," • Not authenticated to the registry — run `docker login <registry>` first."," For ECR: `aws ecr get-login-password --region <r> | docker login --username AWS --password-stdin <account>.dkr.ecr.<r>.amazonaws.com`"," For GCR/GAR: `gcloud auth configure-docker <region>-docker.pkg.dev`"," For GHCR: `echo $GITHUB_TOKEN | docker login ghcr.io -u <user> --password-stdin`"," • Buildx not installed / configured — `docker buildx create --use` (one-time setup)."," • Multi-arch build needs QEMU registered — `docker run --privileged --rm tonistiigi/binfmt --install all`."].join(`
6
- `),message:`docker buildx failed for ${e.pkg.name}@${e.release.newVersion}: exit ${n.exitCode}. stderr: ${n.stderr.trim().slice(0,500)}`,packageName:e.pkg.name});if(r.containerSigning==="cosign"){const i=`${r.containerImage}:${e.release.newVersion}`,t=await e.pm.runner.run("cosign",["sign","--yes",i],{cwd:e.pkg.dir,silent:!1});if(t.exitCode!==0)throw new l({code:"PUBLISH_FAILED",hint:"cosign signing failed. For keyless cosign, ensure COSIGN_EXPERIMENTAL=1 (cosign <2.0) and the CI runner has the OIDC token (`id-token: write` permission on GH Actions).",message:`cosign sign failed for ${i}: exit ${t.exitCode}. stderr: ${t.stderr.trim().slice(0,500)}`,packageName:e.pkg.name})}return{output:`[container] published ${r.containerImage}:${e.release.newVersion}${r.containerSkipLatest?"":" + :latest"}${r.containerSigning==="cosign"?" (signed via cosign)":""}`,published:!0}}}const ue=(a,e)=>{if(!e.containerImage)throw new Error("buildBuildxCommand requires config.containerImage");const r=(e.containerPlatforms??lr).join(","),s=`${e.containerImage}:${a.release.newVersion}`,n=`${e.containerImage}:latest`,i=e.buildContext??".",t=["docker","buildx","build","--platform",r,"-t",s];e.containerSkipLatest||t.push("-t",n);for(const[o,d]of Object.entries(e.containerBuildArgs??{}))t.push("--build-arg",`${o}=${d}`);return t.push("--label",`org.opencontainers.image.version=${a.release.newVersion}`),t.push("--label",`org.opencontainers.image.title=${a.pkg.name}`),t.push("--push",i),{command:t}},gr=a=>`https://pub.dev/api/packages/${encodeURIComponent(a)}`,mr=async a=>{try{const e=await V(gr(a.pkg.name),{headers:{Accept:"application/vnd.pub.v2+json"},httpProxy:a.workspaceConfig?.httpProxy});if(!e.ok)return!1;const r=JSON.parse(await e.text());return Array.isArray(r.versions)&&r.versions.some(s=>s.version===a.release.newVersion)}catch{return!1}};class hr extends C{id="dart";async readPublishedVersion(e){}async publish(e){const{dir:r,name:s}=e.pkg,n=e.release.newVersion;if(e.dryRun)return{output:`[dry-run / dart] would run dart pub publish --force in ${r} for ${s}@${n}`,published:!0};if(process.platform==="win32")throw new l({code:"CONFIG_INVALID",message:`${s} cannot be published from Windows yet: the Dart path is only verified on POSIX. Publish from a POSIX runner.`,packageName:s});try{const t=await e.pm.runner.run("dart",["--version"],{cwd:r,silent:!0});if(t.exitCode!==0)throw new Error(`exit ${t.exitCode}`)}catch{throw new l({code:"CONFIG_INVALID",message:`${s} needs the Dart SDK to publish, and "dart" is not on PATH. Install the Dart SDK on the runner.`,packageName:s})}if(await mr(e))return{alreadyPublished:!0,output:`[dart] ${s}@${n} is already on pub.dev; skipped`,published:!1};const i=await e.pm.runner.run("dart",["pub","publish","--force"],{cwd:r,silent:!1});if(i.exitCode!==0)throw new l({code:"PUBLISH_FAILED",hint:`Failing command: dart pub publish --force in ${r}
7
- Check the output above. Authenticate with "dart pub token add https://pub.dev" on this runner, or configure automated publishing (OIDC) for the pub.dev package. Errors stop the upload; warnings do not.`,message:`dart pub publish failed for ${s}@${n}: exit ${i.exitCode}. stderr: ${i.stderr.trim().slice(0,500)}`,packageName:s});return{output:`[dart] published ${s}@${n} to pub.dev`,published:!0}}}const fr="https://rubygems.org",wr=async(a,e,r)=>{const s=`${fr}/api/v1/versions/${encodeURIComponent(a)}.json`;try{const n=await V(s,{headers:{Accept:"application/json"},httpProxy:r.workspaceConfig?.httpProxy});if(!n.ok)return!1;const i=await n.json();return Array.isArray(i)&&i.some(t=>typeof t=="object"&&t!==null&&t.number===e)}catch{return!1}},br=async(a,e)=>{try{return(await a.pm.runner.run("gem",["--version"],{cwd:e,silent:!0})).exitCode===0}catch{return!1}};class kr extends C{id="gem";async readPublishedVersion(e){}async publish(e){const{name:r}=e.pkg,s=e.release.newVersion,n=R(e.pkg.manifestPath),i=`${r}-${s}.gem`,t=e.pkg.dir;if(e.dryRun)return{output:`[dry-run / gem] would run gem build ${n} and gem push ${i} for ${r}@${s}`,published:!0};if(process.platform==="win32")throw new l({code:"CONFIG_INVALID",message:`${r} cannot be published from Windows yet: the gem path is only verified on POSIX. Publish from a POSIX runner.`,packageName:r});if(!await br(e,t))throw new l({code:"CONFIG_INVALID",message:`${r} needs the gem command on PATH to publish, and "gem --version" failed. Install Ruby (which ships RubyGems) on the runner.`,packageName:r});if(await wr(r,s,e))return{alreadyPublished:!0,output:`[gem] ${r}@${s} is already on RubyGems; skipped`,published:!1};const o=await e.pm.runner.run("gem",["build",n],{cwd:t,silent:!1});if(o.exitCode!==0)throw new l({code:"PUBLISH_FAILED",hint:`Failing step: gem build ${n} in ${t}
8
- Fix the gemspec validation error above.`,message:`gem build failed for ${r}@${s}: exit ${o.exitCode}. stderr: ${o.stderr.trim().slice(0,500)}`,packageName:r});try{const d=await e.pm.runner.run("gem",["push",i],{cwd:t,silent:!1});if(d.exitCode!==0)throw new l({code:"PUBLISH_FAILED",hint:`Failing step: gem push ${i}
9
- Check the output above. Credentials come from GEM_HOST_API_KEY in the environment; a gem push to an existing version is refused by RubyGems.`,message:`gem push failed for ${r}@${s}: exit ${d.exitCode}. stderr: ${d.stderr.trim().slice(0,500)}`,packageName:r})}finally{await se(w(t,i),{force:!0})}return{output:`[gem] published ${r}@${s} (${i})`,published:!0}}}const vr=(a,e,r)=>W(a?.releaseTagPattern??"v{version}",{name:e,version:r});class $r extends C{id="go";async readPublishedVersion(e){}async publish(e){const{name:r}=e.pkg,s=e.release.newVersion,n=vr(e.perPackageConfig,r,s);if(e.dryRun)return{output:`[dry-run / go] would tag ${n} for ${r}@${s}`,published:!0};if(process.platform==="win32")throw new l({code:"CONFIG_INVALID",message:`${r} cannot be released from Windows yet: the Go tag path is not tested there. Release from a POSIX runner.`,packageName:r});if((await e.pm.runner.run("git",["--version"],{cwd:e.pkg.dir,silent:!0})).exitCode!==0)throw new l({code:"CONFIG_INVALID",message:`${r} needs git on PATH to release its tag, and git --version failed.`,packageName:r});return await ae({cwd:e.pkg.dir,runner:e.pm.runner},n)?{alreadyPublished:!0,output:`[go] ${r}@${s} is already tagged ${n}; skipped`,published:!1}:{output:`[go] ${r}@${s} released by tag ${n}`,published:!0}}}const ce=["build.gradle.kts","build.gradle"],Fe=["settings.gradle.kts","settings.gradle"],D=(a,e)=>new l({code:"CONFIG_INVALID",file:a,message:e}),yr=async(a,e)=>{for(const r of new Set([w(a,"gradle.properties"),w(e,"gradle.properties")])){let s;try{s=await _(r,"utf8")}catch{continue}if(/^\s*version\s*[=:]/m.test(s))return r}},Ir=a=>Ne(a).then(()=>!0,()=>!1),j=async(a,e)=>{for(const r of e){const s=w(a,r);try{return{path:s,raw:await _(s,"utf8")}}catch{}}},T=(a,e,r)=>{if(a.length===0)return;if(a.length>1)throw D(e,`${e} declares ${r} ${a.length} times on the path that reaches a module (lines ${a.map(n=>n.line).join(", ")}). vis cannot tell which one applies.`);const[s]=a;if(s.literal===void 0)throw D(e,`${e} sets ${r} to an expression on line ${s.line}. vis reads only a plain string literal, such as ${r} = "1.0.0".`);return{assignment:s,value:s.literal.value}},Cr=async a=>{const{claimedDirs:e,cwd:r}=a,s=await j(r,ce),n=await j(r,Fe);if(!s&&!n)return[];const i=n?Xe(n.raw):void 0;if(i?.unsupported.length)throw D(n.path,`${n.path} moves a project (${i.unsupported.join(", ")}). vis cannot follow that to a version; remove it or release the module with a shell publish.`);i?.dynamicIncludes&&process.stderr.write(`[vis release] ⚠ ${n.path} builds part of its include list from code; vis only reads literal include("…") entries.
10
- `);const t=s?ne(s.raw):void 0,o=t?.assignments??[],d=[];s&&d.push({build:s,dir:r,isRoot:!0,path:"",taskPath:""});for(const p of i?.includes??[]){const h=w(r,p),c=await j(h,ce);c&&d.push({build:c,dir:h,isRoot:!1,path:p,taskPath:`:${p.replaceAll("/",":")}`})}const u=[];for(const p of d){if(e.has(p.dir))continue;const h=p.isRoot&&t?t:ne(p.build.raw),c=T(ie(h.assignments,"version"),p.build.path,"version");if(p.isRoot&&c===void 0)continue;const b=c?void 0:T(te(o,"version",p.isRoot),s?.path??p.build.path,"version"),P=c??b;if(!P){const f=await yr(p.dir,r);if(f!==void 0)throw D(f,`${f} sets version, and vis reads only a string literal in a build script. Move it to version = "…" in ${p.build.path}, or remove it.`);continue}const v=T(ie(h.assignments,"group"),p.build.path,"group")??T(te(o,"group",p.isRoot),s?.path??p.build.path,"group");if(v===void 0)throw D(p.build.path,`${p.build.path} has a version but no group. Declare group = "…" in its build script or in the root build script's allprojects block.`);if(h.usesArchiveName||t?.usesArchiveName)throw D(p.build.path,`${p.build.path} renames its archive (archivesName). vis cannot read the artifact name from that; remove it or release the module with a shell publish.`);const O=p.isRoot?i?.rootName??R(r):R(p.dir);u.push({kind:c?"literal":"inherited",line:P.assignment.line,module:p,name:`${v.value}:${O}`,owner:c?p.build.path:s.path,scan:h,version:P.value})}const k=new Map;for(const p of u){const h=k.get(p.name);if(h!==void 0)throw D(p.module.build.path,`${p.name} is declared by both ${h} and ${p.module.build.path}. Gradle coordinates must be unique to release them.`);k.set(p.name,p.module.build.path)}const g=new Map(u.map(p=>[p.module.path,p.name]));return u.map(({kind:p,line:h,module:c,name:b,owner:P,scan:v,version:O})=>{const f={};for(const $ of v.projectRefs){const I=g.get($.replace(/^:+/,"").split(":").filter(y=>y!=="").join("/"));I!==void 0&&I!==b&&(f[I]="*")}const m={dependencies:f,name:b,private:!1,version:O};return{kind:p,line:h,name:b,owner:P,package:{dir:c.dir,ecosystem:"gradle",manifest:m,manifestPath:c.build.path,name:b,private:!1,version:O},taskPath:c.taskPath}})},Me=async a=>{let e=a;for(;;){if(await Ir(w(e,"gradlew"))||await j(e,Fe)!==void 0)return e;const r=U(e);if(r===e)return;e=r}},hs=Object.defineProperty({__proto__:null,discoverGradleProjects:Cr,findGradleRoot:Me},Symbol.toStringTag,{value:"Module"}),Pr=/<!--[\s\S]*?-->/g,Nr=/<project\b[^>]*>([\s\S]*)/i,ge=/<version>\s*([^<]+?)\s*<\/version>/i,me=/<groupId>\s*([^<]+?)\s*<\/groupId>/i,he=/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i,Ar=/<modules\b[^>]*>[\s\S]*?<module\b/i,fe=a=>{const e=a.replaceAll(Pr,""),s=Nr.exec(e)?.[1]??e,n=s.replaceAll(/<parent\b[\s\S]*?<\/parent>/gi,"").replaceAll(/<dependencyManagement\b[\s\S]*?<\/dependencyManagement>/gi,"").replaceAll(/<dependencies\b[\s\S]*?<\/dependencies>/gi,"").replaceAll(/<build\b[\s\S]*?<\/build>/gi,"").replaceAll(/<profiles\b[\s\S]*?<\/profiles>/gi,"").replaceAll(/<pluginRepositories\b[\s\S]*?<\/pluginRepositories>/gi,"").replaceAll(/<repositories\b[\s\S]*?<\/repositories>/gi,""),i=ge.exec(n)??ge.exec(s),t=me.exec(n)??me.exec(s),o=he.exec(n)??he.exec(s),d=Ar.test(s);return{artifactId:o?.[1],groupId:t?.[1],hasModules:d,version:i?.[1]}},Sr=a=>{const e=/<latest>\s*([^<]+?)\s*<\/latest>/i.exec(a);if(e?.[1])return e[1];const r=/<versions>([\s\S]*?)<\/versions>/i.exec(a);return r?[...r[1].matchAll(/<version>\s*([^<]+?)\s*<\/version>/gi)].map(n=>n[1]).at(-1):void 0},_r=a=>{const e=/<versions>([\s\S]*?)<\/versions>/i.exec(a);return e?[...e[1].matchAll(/<version>\s*([^<]+?)\s*<\/version>/gi)].map(r=>r[1]):[]},Le=(a,e)=>{const r=a.split(".").map(n=>encodeURIComponent(n)).join("/"),s=encodeURIComponent(e);return`https://repo1.maven.org/maven2/${r}/${s}/maven-metadata.xml`};class Vr extends C{id="maven";warnedMultiModule=new WeakSet;warnIfMultiModule(e,r){!r.hasModules||this.warnedMultiModule.has(e)||(this.warnedMultiModule.add(e),process.stderr.write(`[vis release] ⚠ ${e.name} (${r.groupId??"?"}:${r.artifactId??"?"}) is a multi-module Maven project (<modules> present). vis treats it as a single artifact for version-read + already-published checks. For proper reactor handling, use \`versionActions: "shell"\` with \`mvn -B -ntp deploy\`.
11
- `))}async readPublishedVersion(e){const r=e.perPackageConfig??{},s=w(e.pkg.dir,r.pomPath??"pom.xml");let n;try{n=await _(s,"utf8")}catch{return}const i=fe(n);if(this.warnIfMultiModule(e.pkg,i),!i.groupId||!i.artifactId||r.mavenMetadataUrl==="")return;const t=r.mavenMetadataUrl??Le(i.groupId,i.artifactId);try{const o=await V(t,{headers:{Accept:"text/xml,application/xml;q=0.9,*/*;q=0.8"},httpProxy:e.workspaceConfig?.httpProxy});if(o.status===404||!o.ok)return;const d=await o.text();return Sr(d)}catch{return}}async publish(e){const r=e.perPackageConfig??{},s=w(e.pkg.dir,r.pomPath??"pom.xml");let n;try{const o=await _(s,"utf8");n=fe(o)}catch{n=void 0}const i=n?.groupId&&n?.artifactId?`${n.groupId}:${n.artifactId}`:e.pkg.name;if(e.dryRun)return{output:`[dry-run / maven] would run mvn -B -N -f ${s} deploy for ${e.pkg.name}@${e.release.newVersion} (${i})`,published:!0};if(process.platform==="win32")throw new l({code:"CONFIG_INVALID",message:`${e.pkg.name} cannot be published from Windows yet: Maven publish is POSIX-only for now. Publish from a POSIX runner.`,packageName:e.pkg.name});const t=await e.pm.runner.run("mvn",["-B","-N","-f",s,"deploy"],{cwd:e.pkg.dir,silent:!1});if(t.exitCode!==0)throw new l({code:"PUBLISH_FAILED",hint:`Failing artifact: ${i}
3
+ `);throw new d({code:"PUBLISH_FAILED",message:`Pre-publish secret scan failed for ${n}@${e.release.newVersion}:
4
+ ${P}`,packageName:e.pkg.name})}}}const u=["publish","--allow-dirty"];e.registry&&e.registry!=="https://crates.io"&&u.push("--registry",e.registry);const k=await e.pm.runner.run("cargo",u,{cwd:s,silent:!1});if(k.exitCode!==0)throw new d({code:"PUBLISH_FAILED",hint:"Inspect the cargo output above. Common causes: missing CARGO_REGISTRY_TOKEN, OIDC permission misconfigured, version already published, crates.io rate limit. Re-runs are safe — the published-version probe short-circuits subsequent runs.",message:`cargo publish failed for ${n}@${e.release.newVersion}: exit ${k.exitCode}. stderr: ${k.stderr.trim().slice(0,500)}`,packageName:e.pkg.name});return{output:`[cargo] published ${n}@${e.release.newVersion}${o?" (trusted publishing)":""}`,published:!0}}}const ee=(a,e)=>{const r=e?.cargoTomlPath??ar;return w(a.dir,r)},or=(a,e)=>U(ee(a,e)),pr=(a,e,r)=>W(a?.releaseTagPattern??"v{version}",{name:e,version:r});class lr extends C{id="composer";async readPublishedVersion(e){}async publish(e){const{name:r}=e.pkg,s=e.release.newVersion,n=pr(e.perPackageConfig,r,s);if(e.dryRun)return{output:`[dry-run / composer] would tag ${n} for ${r}@${s}`,published:!0};if(process.platform==="win32")throw new d({code:"CONFIG_INVALID",message:`${r} cannot be released from Windows yet: the Composer tag path is not tested there. Release from a POSIX runner.`,packageName:r});if((await e.pm.runner.run("git",["--version"],{cwd:e.pkg.dir,silent:!0})).exitCode!==0)throw new d({code:"CONFIG_INVALID",message:`${r} needs git on PATH to release its tag, and git --version failed.`,packageName:r});return await ae({cwd:e.pkg.dir,runner:e.pm.runner},n)?{alreadyPublished:!0,output:`[composer] ${r}@${s} is already tagged ${n}; skipped`,published:!1}:{output:`[composer] ${r}@${s} released by tag ${n}`,published:!0}}}const dr=["linux/amd64","linux/arm64"],ur=a=>{const e=a.indexOf("/");if(e===-1)return{registry:"docker.io",repository:`library/${a}`};const r=a.slice(0,e),s=a.slice(e+1);return r==="localhost"||r.includes(".")||r.includes(":")?{registry:r,repository:s}:s.includes("/")?{registry:"docker.io",repository:a}:{registry:"docker.io",repository:`${r}/${s}`}},de=(a,e)=>{const{registry:r,repository:s}=ur(a);return`https://${r==="docker.io"?"registry-1.docker.io":r}/v2/${s}/manifests/${encodeURIComponent(e)}`},Re=a=>{const e=a??{};return{buildContext:e.buildContext,containerBuildArgs:e.containerBuildArgs,containerImage:e.containerImage,containerPlatforms:e.containerPlatforms,containerSigning:e.containerSigning,containerSkipLatest:e.containerSkipLatest}},cr=(a,e)=>{const r=Re(a);if(typeof r.containerImage!="string"||r.containerImage.length===0)throw new d({code:"CONFIG_INVALID",hint:["Container packages must declare `containerImage` in their per-pkg release config:","",' release.packages["<pkg>"] = container({',' image: "ghcr.io/scope/foo",',' platforms: ["linux/amd64", "linux/arm64"],',' signing: "cosign", // optional'," })","",'Or set `versionActions: "container"` + `containerImage` directly.'].join(`
5
+ `),message:`containerImage is required for versionActions: "container" on ${e}`,packageName:e});return{buildContext:r.buildContext,containerBuildArgs:r.containerBuildArgs,containerImage:r.containerImage,containerPlatforms:r.containerPlatforms,containerSigning:r.containerSigning,containerSkipLatest:r.containerSkipLatest}};class gr extends C{id="container";async readPublishedVersion(e){const r=Re(e.perPackageConfig);if(!r.containerImage)return;const s=e.pkg.version,n=de(r.containerImage,s);try{return(await V(n,{headers:{Accept:["application/vnd.oci.image.manifest.v1+json","application/vnd.oci.image.index.v1+json","application/vnd.docker.distribution.manifest.v2+json","application/vnd.docker.distribution.manifest.list.v2+json"].join(",")},httpProxy:e.workspaceConfig?.httpProxy,method:"HEAD"})).status===200?s:void 0}catch{return}}async publish(e){const r=cr(e.perPackageConfig,e.pkg.name);if(e.dryRun){const{command:i}=ue(e,r);return{output:`[dry-run / container] would run: ${i.join(" ")}`,published:!0}}try{const i=de(r.containerImage,e.release.newVersion);if((await V(i,{httpProxy:e.workspaceConfig?.httpProxy,method:"HEAD"})).status===200)return{alreadyPublished:!0,output:`[container] ${r.containerImage}:${e.release.newVersion} already published`,published:!1}}catch{}const{command:s}=ue(e,r),n=await e.pm.runner.run(s[0],s.slice(1),{cwd:e.pkg.dir,silent:!1});if(n.exitCode!==0)throw new d({code:"PUBLISH_FAILED",hint:["docker buildx build failed. Common causes:"," • Not authenticated to the registry — run `docker login <registry>` first."," For ECR: `aws ecr get-login-password --region <r> | docker login --username AWS --password-stdin <account>.dkr.ecr.<r>.amazonaws.com`"," For GCR/GAR: `gcloud auth configure-docker <region>-docker.pkg.dev`"," For GHCR: `echo $GITHUB_TOKEN | docker login ghcr.io -u <user> --password-stdin`"," • Buildx not installed / configured — `docker buildx create --use` (one-time setup)."," • Multi-arch build needs QEMU registered — `docker run --privileged --rm tonistiigi/binfmt --install all`."].join(`
6
+ `),message:`docker buildx failed for ${e.pkg.name}@${e.release.newVersion}: exit ${n.exitCode}. stderr: ${n.stderr.trim().slice(0,500)}`,packageName:e.pkg.name});if(r.containerSigning==="cosign"){const i=`${r.containerImage}:${e.release.newVersion}`,t=await e.pm.runner.run("cosign",["sign","--yes",i],{cwd:e.pkg.dir,silent:!1});if(t.exitCode!==0)throw new d({code:"PUBLISH_FAILED",hint:"cosign signing failed. For keyless cosign, ensure COSIGN_EXPERIMENTAL=1 (cosign <2.0) and the CI runner has the OIDC token (`id-token: write` permission on GH Actions).",message:`cosign sign failed for ${i}: exit ${t.exitCode}. stderr: ${t.stderr.trim().slice(0,500)}`,packageName:e.pkg.name})}return{output:`[container] published ${r.containerImage}:${e.release.newVersion}${r.containerSkipLatest?"":" + :latest"}${r.containerSigning==="cosign"?" (signed via cosign)":""}`,published:!0}}}const ue=(a,e)=>{if(!e.containerImage)throw new Error("buildBuildxCommand requires config.containerImage");const r=(e.containerPlatforms??dr).join(","),s=`${e.containerImage}:${a.release.newVersion}`,n=`${e.containerImage}:latest`,i=e.buildContext??".",t=["docker","buildx","build","--platform",r,"-t",s];e.containerSkipLatest||t.push("-t",n);for(const[o,l]of Object.entries(e.containerBuildArgs??{}))t.push("--build-arg",`${o}=${l}`);return t.push("--label",`org.opencontainers.image.version=${a.release.newVersion}`),t.push("--label",`org.opencontainers.image.title=${a.pkg.name}`),t.push("--push",i),{command:t}},mr=a=>`https://pub.dev/api/packages/${encodeURIComponent(a)}`,hr=async a=>{try{const e=await V(mr(a.pkg.name),{headers:{Accept:"application/vnd.pub.v2+json"},httpProxy:a.workspaceConfig?.httpProxy});if(!e.ok)return!1;const r=JSON.parse(await e.text());return Array.isArray(r.versions)&&r.versions.some(s=>s.version===a.release.newVersion)}catch{return!1}};class fr extends C{id="dart";async readPublishedVersion(e){}async publish(e){const{dir:r,name:s}=e.pkg,n=e.release.newVersion;if(e.dryRun)return{output:`[dry-run / dart] would run dart pub publish --force in ${r} for ${s}@${n}`,published:!0};if(process.platform==="win32")throw new d({code:"CONFIG_INVALID",message:`${s} cannot be published from Windows yet: the Dart path is only verified on POSIX. Publish from a POSIX runner.`,packageName:s});try{const t=await e.pm.runner.run("dart",["--version"],{cwd:r,silent:!0});if(t.exitCode!==0)throw new Error(`exit ${t.exitCode}`)}catch{throw new d({code:"CONFIG_INVALID",message:`${s} needs the Dart SDK to publish, and "dart" is not on PATH. Install the Dart SDK on the runner.`,packageName:s})}if(await hr(e))return{alreadyPublished:!0,output:`[dart] ${s}@${n} is already on pub.dev; skipped`,published:!1};const i=await e.pm.runner.run("dart",["pub","publish","--force"],{cwd:r,silent:!1});if(i.exitCode!==0)throw new d({code:"PUBLISH_FAILED",hint:`Failing command: dart pub publish --force in ${r}
7
+ Check the output above. Authenticate with "dart pub token add https://pub.dev" on this runner, or configure automated publishing (OIDC) for the pub.dev package. Errors stop the upload; warnings do not.`,message:`dart pub publish failed for ${s}@${n}: exit ${i.exitCode}. stderr: ${i.stderr.trim().slice(0,500)}`,packageName:s});return{output:`[dart] published ${s}@${n} to pub.dev`,published:!0}}}const wr="https://rubygems.org",br=async(a,e,r)=>{const s=`${wr}/api/v1/versions/${encodeURIComponent(a)}.json`;try{const n=await V(s,{headers:{Accept:"application/json"},httpProxy:r.workspaceConfig?.httpProxy});if(!n.ok)return!1;const i=await n.json();return Array.isArray(i)&&i.some(t=>typeof t=="object"&&t!==null&&t.number===e)}catch{return!1}},kr=async(a,e)=>{try{return(await a.pm.runner.run("gem",["--version"],{cwd:e,silent:!0})).exitCode===0}catch{return!1}};class vr extends C{id="gem";async readPublishedVersion(e){}async publish(e){const{name:r}=e.pkg,s=e.release.newVersion,n=R(e.pkg.manifestPath),i=`${r}-${s}.gem`,t=e.pkg.dir;if(e.dryRun)return{output:`[dry-run / gem] would run gem build ${n} and gem push ${i} for ${r}@${s}`,published:!0};if(process.platform==="win32")throw new d({code:"CONFIG_INVALID",message:`${r} cannot be published from Windows yet: the gem path is only verified on POSIX. Publish from a POSIX runner.`,packageName:r});if(!await kr(e,t))throw new d({code:"CONFIG_INVALID",message:`${r} needs the gem command on PATH to publish, and "gem --version" failed. Install Ruby (which ships RubyGems) on the runner.`,packageName:r});if(await br(r,s,e))return{alreadyPublished:!0,output:`[gem] ${r}@${s} is already on RubyGems; skipped`,published:!1};const o=await e.pm.runner.run("gem",["build",n],{cwd:t,silent:!1});if(o.exitCode!==0)throw new d({code:"PUBLISH_FAILED",hint:`Failing step: gem build ${n} in ${t}
8
+ Fix the gemspec validation error above.`,message:`gem build failed for ${r}@${s}: exit ${o.exitCode}. stderr: ${o.stderr.trim().slice(0,500)}`,packageName:r});try{const l=await e.pm.runner.run("gem",["push",i],{cwd:t,silent:!1});if(l.exitCode!==0)throw new d({code:"PUBLISH_FAILED",hint:`Failing step: gem push ${i}
9
+ Check the output above. Credentials come from GEM_HOST_API_KEY in the environment; a gem push to an existing version is refused by RubyGems.`,message:`gem push failed for ${r}@${s}: exit ${l.exitCode}. stderr: ${l.stderr.trim().slice(0,500)}`,packageName:r})}finally{await se(w(t,i),{force:!0})}return{output:`[gem] published ${r}@${s} (${i})`,published:!0}}}const yr=(a,e,r)=>W(a?.releaseTagPattern??"v{version}",{name:e,version:r});class $r extends C{id="go";async readPublishedVersion(e){}async publish(e){const{name:r}=e.pkg,s=e.release.newVersion,n=yr(e.perPackageConfig,r,s);if(e.dryRun)return{output:`[dry-run / go] would tag ${n} for ${r}@${s}`,published:!0};if(process.platform==="win32")throw new d({code:"CONFIG_INVALID",message:`${r} cannot be released from Windows yet: the Go tag path is not tested there. Release from a POSIX runner.`,packageName:r});if((await e.pm.runner.run("git",["--version"],{cwd:e.pkg.dir,silent:!0})).exitCode!==0)throw new d({code:"CONFIG_INVALID",message:`${r} needs git on PATH to release its tag, and git --version failed.`,packageName:r});return await ae({cwd:e.pkg.dir,runner:e.pm.runner},n)?{alreadyPublished:!0,output:`[go] ${r}@${s} is already tagged ${n}; skipped`,published:!1}:{output:`[go] ${r}@${s} released by tag ${n}`,published:!0}}}const ce=["build.gradle.kts","build.gradle"],Fe=["settings.gradle.kts","settings.gradle"],D=(a,e)=>new d({code:"CONFIG_INVALID",file:a,message:e}),Ir=async(a,e)=>{for(const r of new Set([w(a,"gradle.properties"),w(e,"gradle.properties")])){let s;try{s=await _(r,"utf8")}catch{continue}if(/^\s*version\s*[=:]/m.test(s))return r}},Cr=a=>Ne(a).then(()=>!0,()=>!1),j=async(a,e)=>{for(const r of e){const s=w(a,r);try{return{path:s,raw:await _(s,"utf8")}}catch{}}},T=(a,e,r)=>{if(a.length===0)return;if(a.length>1)throw D(e,`${e} declares ${r} ${a.length} times on the path that reaches a module (lines ${a.map(n=>n.line).join(", ")}). vis cannot tell which one applies.`);const[s]=a;if(s.literal===void 0)throw D(e,`${e} sets ${r} to an expression on line ${s.line}. vis reads only a plain string literal, such as ${r} = "1.0.0".`);return{assignment:s,value:s.literal.value}},Pr=async a=>{const{claimedDirs:e,cwd:r}=a,s=await j(r,ce),n=await j(r,Fe);if(!s&&!n)return[];const i=n?Ye(n.raw):void 0;if(i?.unsupported.length)throw D(n.path,`${n.path} moves a project (${i.unsupported.join(", ")}). vis cannot follow that to a version; remove it or release the module with a shell publish.`);i?.dynamicIncludes&&process.stderr.write(`[vis release] ⚠ ${n.path} builds part of its include list from code; vis only reads literal include("…") entries.
10
+ `);const t=s?ne(s.raw):void 0,o=t?.assignments??[],l=[];s&&l.push({build:s,dir:r,isRoot:!0,path:"",taskPath:""});for(const p of i?.includes??[]){const h=w(r,p),c=await j(h,ce);c&&l.push({build:c,dir:h,isRoot:!1,path:p,taskPath:`:${p.replaceAll("/",":")}`})}const u=[];for(const p of l){if(e.has(p.dir))continue;const h=p.isRoot&&t?t:ne(p.build.raw),c=T(ie(h.assignments,"version"),p.build.path,"version");if(p.isRoot&&c===void 0)continue;const b=c?void 0:T(te(o,"version",p.isRoot),s?.path??p.build.path,"version"),P=c??b;if(!P){const f=await Ir(p.dir,r);if(f!==void 0)throw D(f,`${f} sets version, and vis reads only a string literal in a build script. Move it to version = "…" in ${p.build.path}, or remove it.`);continue}const v=T(ie(h.assignments,"group"),p.build.path,"group")??T(te(o,"group",p.isRoot),s?.path??p.build.path,"group");if(v===void 0)throw D(p.build.path,`${p.build.path} has a version but no group. Declare group = "…" in its build script or in the root build script's allprojects block.`);if(h.usesArchiveName||t?.usesArchiveName)throw D(p.build.path,`${p.build.path} renames its archive (archivesName). vis cannot read the artifact name from that; remove it or release the module with a shell publish.`);const O=p.isRoot?i?.rootName??R(r):R(p.dir);u.push({kind:c?"literal":"inherited",line:P.assignment.line,module:p,name:`${v.value}:${O}`,owner:c?p.build.path:s.path,scan:h,version:P.value})}const k=new Map;for(const p of u){const h=k.get(p.name);if(h!==void 0)throw D(p.module.build.path,`${p.name} is declared by both ${h} and ${p.module.build.path}. Gradle coordinates must be unique to release them.`);k.set(p.name,p.module.build.path)}const g=new Map(u.map(p=>[p.module.path,p.name]));return u.map(({kind:p,line:h,module:c,name:b,owner:P,scan:v,version:O})=>{const f={};for(const y of v.projectRefs){const I=g.get(y.replace(/^:+/,"").split(":").filter($=>$!=="").join("/"));I!==void 0&&I!==b&&(f[I]="*")}const m={dependencies:f,name:b,private:!1,version:O};return{kind:p,line:h,name:b,owner:P,package:{dir:c.dir,ecosystem:"gradle",manifest:m,manifestPath:c.build.path,name:b,private:!1,version:O},taskPath:c.taskPath}})},Me=async a=>{let e=a;for(;;){if(await Cr(w(e,"gradlew"))||await j(e,Fe)!==void 0)return e;const r=U(e);if(r===e)return;e=r}},hs=Object.defineProperty({__proto__:null,discoverGradleProjects:Pr,findGradleRoot:Me},Symbol.toStringTag,{value:"Module"}),Nr=/<!--[\s\S]*?-->/g,Ar=/<project\b[^>]*>([\s\S]*)/i,ge=/<version>\s*([^<]+?)\s*<\/version>/i,me=/<groupId>\s*([^<]+?)\s*<\/groupId>/i,he=/<artifactId>\s*([^<]+?)\s*<\/artifactId>/i,Sr=/<modules\b[^>]*>[\s\S]*?<module\b/i,fe=a=>{const e=a.replaceAll(Nr,""),s=Ar.exec(e)?.[1]??e,n=s.replaceAll(/<parent\b[\s\S]*?<\/parent>/gi,"").replaceAll(/<dependencyManagement\b[\s\S]*?<\/dependencyManagement>/gi,"").replaceAll(/<dependencies\b[\s\S]*?<\/dependencies>/gi,"").replaceAll(/<build\b[\s\S]*?<\/build>/gi,"").replaceAll(/<profiles\b[\s\S]*?<\/profiles>/gi,"").replaceAll(/<pluginRepositories\b[\s\S]*?<\/pluginRepositories>/gi,"").replaceAll(/<repositories\b[\s\S]*?<\/repositories>/gi,""),i=ge.exec(n)??ge.exec(s),t=me.exec(n)??me.exec(s),o=he.exec(n)??he.exec(s),l=Sr.test(s);return{artifactId:o?.[1],groupId:t?.[1],hasModules:l,version:i?.[1]}},_r=a=>{const e=/<latest>\s*([^<]+?)\s*<\/latest>/i.exec(a);if(e?.[1])return e[1];const r=/<versions>([\s\S]*?)<\/versions>/i.exec(a);return r?[...r[1].matchAll(/<version>\s*([^<]+?)\s*<\/version>/gi)].map(n=>n[1]).at(-1):void 0},Vr=a=>{const e=/<versions>([\s\S]*?)<\/versions>/i.exec(a);return e?[...e[1].matchAll(/<version>\s*([^<]+?)\s*<\/version>/gi)].map(r=>r[1]):[]},Le=(a,e)=>{const r=a.split(".").map(n=>encodeURIComponent(n)).join("/"),s=encodeURIComponent(e);return`https://repo1.maven.org/maven2/${r}/${s}/maven-metadata.xml`};class Or extends C{id="maven";warnedMultiModule=new WeakSet;warnIfMultiModule(e,r){!r.hasModules||this.warnedMultiModule.has(e)||(this.warnedMultiModule.add(e),process.stderr.write(`[vis release] ⚠ ${e.name} (${r.groupId??"?"}:${r.artifactId??"?"}) is a multi-module Maven project (<modules> present). vis treats it as a single artifact for version-read + already-published checks. For proper reactor handling, use \`versionActions: "shell"\` with \`mvn -B -ntp deploy\`.
11
+ `))}async readPublishedVersion(e){const r=e.perPackageConfig??{},s=w(e.pkg.dir,r.pomPath??"pom.xml");let n;try{n=await _(s,"utf8")}catch{return}const i=fe(n);if(this.warnIfMultiModule(e.pkg,i),!i.groupId||!i.artifactId||r.mavenMetadataUrl==="")return;const t=r.mavenMetadataUrl??Le(i.groupId,i.artifactId);try{const o=await V(t,{headers:{Accept:"text/xml,application/xml;q=0.9,*/*;q=0.8"},httpProxy:e.workspaceConfig?.httpProxy});if(o.status===404||!o.ok)return;const l=await o.text();return _r(l)}catch{return}}async publish(e){const r=e.perPackageConfig??{},s=w(e.pkg.dir,r.pomPath??"pom.xml");let n;try{const o=await _(s,"utf8");n=fe(o)}catch{n=void 0}const i=n?.groupId&&n?.artifactId?`${n.groupId}:${n.artifactId}`:e.pkg.name;if(e.dryRun)return{output:`[dry-run / maven] would run mvn -B -N -f ${s} deploy for ${e.pkg.name}@${e.release.newVersion} (${i})`,published:!0};if(process.platform==="win32")throw new d({code:"CONFIG_INVALID",message:`${e.pkg.name} cannot be published from Windows yet: Maven publish is POSIX-only for now. Publish from a POSIX runner.`,packageName:e.pkg.name});const t=await e.pm.runner.run("mvn",["-B","-N","-f",s,"deploy"],{cwd:e.pkg.dir,silent:!1});if(t.exitCode!==0)throw new d({code:"PUBLISH_FAILED",hint:`Failing artifact: ${i}
12
12
  Pom: ${s}
13
- Check the mvn output above. Credentials come from ~/.m2/settings.xml, and the pom needs a deploy target (distributionManagement or central-publishing-maven-plugin). See docs/guides/release-maven.mdx.`,message:`mvn deploy failed for ${e.pkg.name}@${e.release.newVersion} (${i}): exit ${t.exitCode}. stderr: ${t.stderr.trim().slice(0,500)}`,packageName:e.pkg.name});return{output:`[maven] deployed ${e.pkg.name}@${e.release.newVersion} (${i})`,published:!0}}}const Or=a=>{const e=a.indexOf(":");return e===-1?void 0:{artifactId:a.slice(e+1),groupId:a.slice(0,e)}},Dr=async a=>{const e=a.perPackageConfig??{},r=Or(a.pkg.name);if(e.mavenMetadataUrl===""||r===void 0)return!1;const s=e.mavenMetadataUrl??Le(r.groupId,r.artifactId);try{const n=await V(s,{headers:{Accept:"text/xml,application/xml;q=0.9,*/*;q=0.8"},httpProxy:a.workspaceConfig?.httpProxy});return n.ok&&_r(await n.text()).includes(a.release.newVersion)}catch{return!1}};class Rr extends C{id="gradle";async readPublishedVersion(e){}async publish(e){const r=await Me(e.pkg.dir);if(r===void 0)throw new l({code:"CONFIG_INVALID",file:e.pkg.manifestPath,message:`${e.pkg.name} has no Gradle build root (no gradlew or settings.gradle above ${e.pkg.dir}).`,packageName:e.pkg.name});const s=e.pkg.dir===r?"":e.pkg.dir.slice(r.length+1).split("\\").join("/"),n=s===""?":publish":`:${s.replaceAll("/",":")}:publish`;if(e.dryRun)return{output:`[dry-run / gradle] would run ${w(r,"gradlew")} ${n} for ${e.pkg.name}@${e.release.newVersion}`,published:!0};if(process.platform==="win32")throw new l({code:"CONFIG_INVALID",message:`${e.pkg.name} cannot be published from Windows yet: vis runs ./gradlew without a shell, and gradlew.bat needs one. Publish from a POSIX runner.`,packageName:e.pkg.name});const i=w(r,"gradlew");try{await Ne(i)}catch{throw new l({code:"CONFIG_INVALID",message:`${e.pkg.name} needs ${i} to publish, and the build root has none. Add the Gradle wrapper (gradle wrapper) at the root.`,packageName:e.pkg.name})}if(await Dr(e))return{alreadyPublished:!0,output:`[gradle] ${e.pkg.name}@${e.release.newVersion} is already on the repository; skipped`,published:!1};const t=await e.pm.runner.run(i,[n],{cwd:r,silent:!1});if(t.exitCode!==0)throw new l({code:"PUBLISH_FAILED",hint:`Failing task: ${n} in ${r}
14
- Check the Gradle output above. The module needs a publishing plugin and repository (for example maven-publish). Credentials come from your Gradle properties or environment.`,message:`gradle ${n} failed for ${e.pkg.name}@${e.release.newVersion}: exit ${t.exitCode}. stderr: ${t.stderr.trim().slice(0,500)}`,packageName:e.pkg.name});return{output:`[gradle] published ${e.pkg.name}@${e.release.newVersion} (${n})`,published:!0}}}const Fr="https://hex.pm",Mr=async(a,e,r)=>{const s=`${Fr}/api/packages/${encodeURIComponent(a)}`;try{const n=await V(s,{headers:{Accept:"application/json"},httpProxy:r.workspaceConfig?.httpProxy});if(!n.ok)return!1;const i=await n.json(),t=typeof i=="object"&&i!==null?i.releases:void 0;return Array.isArray(t)&&t.some(o=>typeof o=="object"&&o!==null&&o.version===e)}catch{return!1}},Lr=async(a,e)=>{try{return(await a.pm.runner.run("mix",["help"],{cwd:e,silent:!0})).exitCode===0}catch{return!1}};class Er extends C{id="hex";async readPublishedVersion(e){}async publish(e){const{name:r}=e.pkg,s=e.release.newVersion,n=e.pkg.dir;if(e.dryRun)return{output:`[dry-run / hex] would run mix hex.publish --yes in ${R(n)} for ${r}@${s}`,published:!0};if(process.platform==="win32")throw new l({code:"CONFIG_INVALID",message:`${r} cannot be published from Windows yet: the mix path is only verified on POSIX. Publish from a POSIX runner.`,packageName:r});if(!await Lr(e,n))throw new l({code:"CONFIG_INVALID",message:`${r} needs the mix command on PATH to publish, and "mix help" failed. Install Elixir (which ships Mix) on the runner.`,packageName:r});if(await Mr(r,s,e))return{alreadyPublished:!0,output:`[hex] ${r}@${s} is already on hex.pm; skipped`,published:!1};const i=await e.pm.runner.run("mix",["hex.publish","--yes"],{cwd:n,silent:!1});if(i.exitCode!==0)throw new l({code:"PUBLISH_FAILED",hint:`Failing step: mix hex.publish --yes in ${n}
15
- Check the output above. Credentials come from HEX_API_KEY in the environment; Hex refuses to replace an existing version.`,message:`mix hex.publish failed for ${r}@${s}: exit ${i.exitCode}. stderr: ${i.stderr.trim().slice(0,500)}`,packageName:r});return{output:`[hex] published ${r}@${s}`,published:!0}}}const Ee="https://registry.npmjs.org/",Tr="npm:registry.npmjs.org",we=async a=>{const e=w(a,"npm");try{return(await re(e,{withFileTypes:!0})).filter(s=>s.isDirectory()).map(s=>s.name)}catch{return[]}},Gr=async a=>{const e=a.ACTIONS_ID_TOKEN_REQUEST_URL,r=a.ACTIONS_ID_TOKEN_REQUEST_TOKEN;if(!e||!r)return;const s=`${e}${e.includes("?")?"&":"?"}audience=${encodeURIComponent(Tr)}`,n=await fetch(s,{headers:{Authorization:`Bearer ${r}`}});if(!n.ok)return;const i=await n.json().catch(()=>({}));return typeof i.value=="string"?i.value:void 0},jr=async(a,e)=>{const r=await fetch(`${Ee}-/npm/v1/oidc/token/exchange/package/${encodeURIComponent(a)}`,{headers:{Authorization:`Bearer ${e}`},method:"POST"});if(!r.ok)return;const s=await r.json().catch(()=>({}));return typeof s.token=="string"?s.token:void 0},be=async(a,e,r)=>{if(e){const n=await jr(a,e);if(n)return{source:"oidc",token:n}}const s=r.NPM_TOKEN;if(s)return{source:"NPM_TOKEN",token:s};throw new l({code:"AUTH_MISSING",message:`Cannot publish ${a}: OIDC exchange did not succeed and NPM_TOKEN is not set.`,packageName:a})},ke=(a,e)=>{Ye(a,`//registry.npmjs.org/:_authToken=${e}
13
+ Check the mvn output above. Credentials come from ~/.m2/settings.xml, and the pom needs a deploy target (distributionManagement or central-publishing-maven-plugin). See docs/guides/release-maven.mdx.`,message:`mvn deploy failed for ${e.pkg.name}@${e.release.newVersion} (${i}): exit ${t.exitCode}. stderr: ${t.stderr.trim().slice(0,500)}`,packageName:e.pkg.name});return{output:`[maven] deployed ${e.pkg.name}@${e.release.newVersion} (${i})`,published:!0}}}const Dr=a=>{const e=a.indexOf(":");return e===-1?void 0:{artifactId:a.slice(e+1),groupId:a.slice(0,e)}},Rr=async a=>{const e=a.perPackageConfig??{},r=Dr(a.pkg.name);if(e.mavenMetadataUrl===""||r===void 0)return!1;const s=e.mavenMetadataUrl??Le(r.groupId,r.artifactId);try{const n=await V(s,{headers:{Accept:"text/xml,application/xml;q=0.9,*/*;q=0.8"},httpProxy:a.workspaceConfig?.httpProxy});return n.ok&&Vr(await n.text()).includes(a.release.newVersion)}catch{return!1}};class Fr extends C{id="gradle";async readPublishedVersion(e){}async publish(e){const r=await Me(e.pkg.dir);if(r===void 0)throw new d({code:"CONFIG_INVALID",file:e.pkg.manifestPath,message:`${e.pkg.name} has no Gradle build root (no gradlew or settings.gradle above ${e.pkg.dir}).`,packageName:e.pkg.name});const s=e.pkg.dir===r?"":e.pkg.dir.slice(r.length+1).split("\\").join("/"),n=s===""?":publish":`:${s.replaceAll("/",":")}:publish`;if(e.dryRun)return{output:`[dry-run / gradle] would run ${w(r,"gradlew")} ${n} for ${e.pkg.name}@${e.release.newVersion}`,published:!0};if(process.platform==="win32")throw new d({code:"CONFIG_INVALID",message:`${e.pkg.name} cannot be published from Windows yet: vis runs ./gradlew without a shell, and gradlew.bat needs one. Publish from a POSIX runner.`,packageName:e.pkg.name});const i=w(r,"gradlew");try{await Ne(i)}catch{throw new d({code:"CONFIG_INVALID",message:`${e.pkg.name} needs ${i} to publish, and the build root has none. Add the Gradle wrapper (gradle wrapper) at the root.`,packageName:e.pkg.name})}if(await Rr(e))return{alreadyPublished:!0,output:`[gradle] ${e.pkg.name}@${e.release.newVersion} is already on the repository; skipped`,published:!1};const t=await e.pm.runner.run(i,[n],{cwd:r,silent:!1});if(t.exitCode!==0)throw new d({code:"PUBLISH_FAILED",hint:`Failing task: ${n} in ${r}
14
+ Check the Gradle output above. The module needs a publishing plugin and repository (for example maven-publish). Credentials come from your Gradle properties or environment.`,message:`gradle ${n} failed for ${e.pkg.name}@${e.release.newVersion}: exit ${t.exitCode}. stderr: ${t.stderr.trim().slice(0,500)}`,packageName:e.pkg.name});return{output:`[gradle] published ${e.pkg.name}@${e.release.newVersion} (${n})`,published:!0}}}const Mr="https://hex.pm",Lr=async(a,e,r)=>{const s=`${Mr}/api/packages/${encodeURIComponent(a)}`;try{const n=await V(s,{headers:{Accept:"application/json"},httpProxy:r.workspaceConfig?.httpProxy});if(!n.ok)return!1;const i=await n.json(),t=typeof i=="object"&&i!==null?i.releases:void 0;return Array.isArray(t)&&t.some(o=>typeof o=="object"&&o!==null&&o.version===e)}catch{return!1}},Er=async(a,e)=>{try{return(await a.pm.runner.run("mix",["help"],{cwd:e,silent:!0})).exitCode===0}catch{return!1}};class Tr extends C{id="hex";async readPublishedVersion(e){}async publish(e){const{name:r}=e.pkg,s=e.release.newVersion,n=e.pkg.dir;if(e.dryRun)return{output:`[dry-run / hex] would run mix hex.publish --yes in ${R(n)} for ${r}@${s}`,published:!0};if(process.platform==="win32")throw new d({code:"CONFIG_INVALID",message:`${r} cannot be published from Windows yet: the mix path is only verified on POSIX. Publish from a POSIX runner.`,packageName:r});if(!await Er(e,n))throw new d({code:"CONFIG_INVALID",message:`${r} needs the mix command on PATH to publish, and "mix help" failed. Install Elixir (which ships Mix) on the runner.`,packageName:r});if(await Lr(r,s,e))return{alreadyPublished:!0,output:`[hex] ${r}@${s} is already on hex.pm; skipped`,published:!1};const i=await e.pm.runner.run("mix",["hex.publish","--yes"],{cwd:n,silent:!1});if(i.exitCode!==0)throw new d({code:"PUBLISH_FAILED",hint:`Failing step: mix hex.publish --yes in ${n}
15
+ Check the output above. Credentials come from HEX_API_KEY in the environment; Hex refuses to replace an existing version.`,message:`mix hex.publish failed for ${r}@${s}: exit ${i.exitCode}. stderr: ${i.stderr.trim().slice(0,500)}`,packageName:r});return{output:`[hex] published ${r}@${s}`,published:!0}}}const Ee="https://registry.npmjs.org/",Gr="npm:registry.npmjs.org",we=async a=>{const e=w(a,"npm");try{return(await re(e,{withFileTypes:!0})).filter(s=>s.isDirectory()).map(s=>s.name)}catch{return[]}},jr=async a=>{const e=a.ACTIONS_ID_TOKEN_REQUEST_URL,r=a.ACTIONS_ID_TOKEN_REQUEST_TOKEN;if(!e||!r)return;const s=`${e}${e.includes("?")?"&":"?"}audience=${encodeURIComponent(Gr)}`,n=await fetch(s,{headers:{Authorization:`Bearer ${r}`}});if(!n.ok)return;const i=await n.json().catch(()=>({}));return typeof i.value=="string"?i.value:void 0},Ur=async(a,e)=>{const r=await fetch(`${Ee}-/npm/v1/oidc/token/exchange/package/${encodeURIComponent(a)}`,{headers:{Authorization:`Bearer ${e}`},method:"POST"});if(!r.ok)return;const s=await r.json().catch(()=>({}));return typeof s.token=="string"?s.token:void 0},be=async(a,e,r)=>{if(e){const n=await Ur(a,e);if(n)return{source:"oidc",token:n}}const s=r.NPM_TOKEN;if(s)return{source:"NPM_TOKEN",token:s};throw new d({code:"AUTH_MISSING",message:`Cannot publish ${a}: OIDC exchange did not succeed and NPM_TOKEN is not set.`,packageName:a})},ke=(a,e)=>{Je(a,`//registry.npmjs.org/:_authToken=${e}
16
16
  registry=${Ee}
17
- `)};class Ur extends C{id="native-addon";async readPublishedVersion(e){try{Y(e.pkg.name);const{execFileSync:r}=await import("node:child_process");return r("npm",["view",e.pkg.name,"version"],{stdio:["ignore","pipe","ignore"]}).toString().trim()||void 0}catch{return}}async publish(e){if(e.dryRun){const d=await we(e.pkg.dir);return{output:`[dry-run] would publish ${e.pkg.name}@${e.release.newVersion} + ${d.length} platform package(s)`,published:!0}}const r=await we(e.pkg.dir);if(r.length===0){const{NpmVersionActions:d}=await Promise.resolve().then(()=>Wr);return new d().publish(e)}const{env:s}=process,n=await Gr(s),i=e.release.newVersion,t=new Map,o=[];try{await Promise.all(r.map(async f=>{const m=w(e.pkg.dir,"npm",f,"package.json"),$=await _(m,"utf8");t.set(m,$);const I=JSON.parse($);I.version=i,await E(m,`${JSON.stringify(I,null,4)}
18
- `)}));const{execFileSync:d}=await import("node:child_process"),u=await Promise.all(r.map(async f=>{const m=w(e.pkg.dir,"npm",f),$=w(m,"package.json"),I=await _($,"utf8"),y=JSON.parse(I);Y(y.name);const S=await be(y.name,n,s),N=z(w(B(),"vis-release-napi-"));o.push(N);const A=w(N,".npmrc");return ke(A,S.token),{manifest:y,npmrcPath:A,platform:f,platformDir:m}})),k=e.workspaceConfig?.publish?.guards;if(k&&Object.values(k).some(f=>f!==void 0&&f!==!1&&f!=="off")){const{runPublishGuards:f}=await import("./publish-guards.js");for(const{manifest:m,platformDir:$}of u){const I=d("npm",["pack","--dry-run","--json"],{cwd:$,stdio:["ignore","pipe","ignore"]}).toString();let y=[];try{y=JSON.parse(I)[0]?.files?.map(A=>A.path)??[]}catch{}const S=await f({config:k,manifest:m,packFiles:y,pkgDir:$,runner:e.pm.runner,sourceManifest:m});if(S.blockers.length>0){const N=S.blockers.flatMap(A=>A.findings.map(X=>` • [${A.gate}] ${X.message}${X.hint?`
17
+ `)};class Br extends C{id="native-addon";async readPublishedVersion(e){try{Y(e.pkg.name);const{execFileSync:r}=await import("node:child_process");return r("npm",["view",e.pkg.name,"version"],{stdio:["ignore","pipe","ignore"]}).toString().trim()||void 0}catch{return}}async publish(e){if(e.dryRun){const l=await we(e.pkg.dir);return{output:`[dry-run] would publish ${e.pkg.name}@${e.release.newVersion} + ${l.length} platform package(s)`,published:!0}}const r=await we(e.pkg.dir);if(r.length===0){const{NpmVersionActions:l}=await Promise.resolve().then(()=>Wr);return new l().publish(e)}const{env:s}=process,n=await jr(s),i=e.release.newVersion,t=new Map,o=[];try{await Promise.all(r.map(async f=>{const m=w(e.pkg.dir,"npm",f,"package.json"),y=await _(m,"utf8");t.set(m,y);const I=JSON.parse(y);I.version=i,await E(m,`${JSON.stringify(I,null,4)}
18
+ `)}));const{execFileSync:l}=await import("node:child_process"),u=await Promise.all(r.map(async f=>{const m=w(e.pkg.dir,"npm",f),y=w(m,"package.json"),I=await _(y,"utf8"),$=JSON.parse(I);Y($.name);const S=await be($.name,n,s),N=z(w(B(),"vis-release-napi-"));o.push(N);const A=w(N,".npmrc");return ke(A,S.token),{manifest:$,npmrcPath:A,platform:f,platformDir:m}})),k=e.workspaceConfig?.publish?.guards;if(k&&Object.values(k).some(f=>f!==void 0&&f!==!1&&f!=="off")){const{runPublishGuards:f}=await import("./publish-guards.js");for(const{manifest:m,platformDir:y}of u){const I=l("npm",["pack","--dry-run","--json"],{cwd:y,stdio:["ignore","pipe","ignore"]}).toString();let $=[];try{$=JSON.parse(I)[0]?.files?.map(A=>A.path)??[]}catch{}const S=await f({config:k,manifest:m,packFiles:$,pkgDir:y,runner:e.pm.runner,sourceManifest:m});if(S.blockers.length>0){const N=S.blockers.flatMap(A=>A.findings.map(X=>` • [${A.gate}] ${X.message}${X.hint?`
19
19
  → ${X.hint}`:""}`)).join(`
20
- `);throw new l({code:"PUBLISH_FAILED",message:`Pre-publish guards failed for ${m.name}@${i} (platform package):
21
- ${N}`,packageName:m.name})}}}const g=e.tag??"latest",p=(f,m)=>{const $=["publish",f,"--tag",g,"--access","public","--userconfig",m];return e.provenance&&$.push("--provenance"),$};for(const{manifest:f,npmrcPath:m,platformDir:$}of u)try{d("npm",p($,m),{env:{...s,NPM_CONFIG_USERCONFIG:m},stdio:"inherit"})}catch(I){const y=I.message;if(!y.includes("EPUBLISHCONFLICT")&&!y.includes("cannot publish over"))throw new l({cause:I,code:"PUBLISH_FAILED",message:`Failed to publish platform package ${f.name}@${i}: ${y}`,packageName:f.name})}const h=e.versionedManifestByName.get(e.pkg.name)??e.pkg.manifest,c={...h},b={...h.optionalDependencies};for(const{manifest:f}of u)Object.hasOwn(b,f.name)&&(b[f.name]=i);c.optionalDependencies=b;const P=Ve(c,e.catalogs),v=Oe(P,e.cleanPackageJsonConfig),O=await _(e.pkg.manifestPath,"utf8");try{await E(e.pkg.manifestPath,`${JSON.stringify(v,null,4)}
22
- `),Y(e.pkg.name);const f=await be(e.pkg.name,n,s),m=z(w(B(),"vis-release-napi-parent-"));o.push(m);const $=w(m,".npmrc");ke($,f.token);const I=d("npm",["pack","--pack-destination",m,"--json"],{cwd:e.pkg.dir,env:s,stdio:["ignore","pipe","ignore"]}).toString();let y;try{const N=JSON.parse(I);N[0]?.filename&&(y=w(m,N[0].filename))}catch{}const S=["publish",y??e.pkg.dir,"--tag",g,"--access","public","--userconfig",$];if(e.provenance&&S.push("--provenance"),d("npm",S,{env:{...s,NPM_CONFIG_USERCONFIG:$},stdio:"inherit"}),y){const{hashTarball:N}=await import("./publish-guards.js");return{published:!0,tarball:await N(y)}}return{published:!0}}finally{await E(e.pkg.manifestPath,O)}}finally{for(const[d,u]of t)try{await E(d,u)}catch{}for(const d of o)try{await se(d,{force:!0,recursive:!0})}catch{}}}}const Br=async(a,e)=>{const{extractPackFilesFromRaw:r}=await import("./publish-guards.js"),s=r(e.raw);if(s!==void 0)return s;const n=await a.pm.runner.run("npm",["pack","--dry-run","--json"],{cwd:a.pkg.dir,silent:!0});if(n.exitCode!==0)return[];try{return r(JSON.parse(n.stdout))??[]}catch{return[]}},ve=1800*1e3,$e=15*1e3,ye=a=>{if(a===!0)return{enabled:!0,pollIntervalMs:$e,timeoutMs:ve};if(a&&typeof a=="object"){const e=a;return{enabled:!0,pollIntervalMs:e.pollIntervalMs??$e,timeoutMs:e.timeoutMs??ve}}return{enabled:!1,pollIntervalMs:0,timeoutMs:0}};class Te extends C{id="npm";async readPublishedVersion(e){try{const r=await e.pm.runner.run("npm",["view",e.pkg.name,"version","--silent"],{cwd:e.pkg.dir,silent:!0});return r.exitCode!==0?void 0:r.stdout.trim()||void 0}catch{return}}async publish(e){if(e.dryRun)return{output:`[dry-run] would publish ${e.pkg.name}@${e.release.newVersion}`,published:!0};if(e.resumeStageId){const u=ye(e.workspaceConfig?.publish?.stage);if(!u.enabled)throw new l({code:"CONFIG_INVALID",message:`Cannot resume stage ${e.resumeStageId} for ${e.pkg.name}@${e.release.newVersion}: publish.stage is now disabled. Resolve the stage manually via \`vis release stage approve|reject ${e.resumeStageId}\`.`,packageName:e.pkg.name});return this.resumeStagedPublish(e,u)}const r=e.perPackageConfig&&e.workspaceConfig?Q(e.pkg.name,e.perPackageConfig,e.workspaceConfig):{};if(r.buildCommand){const u=Z(r.buildCommand,{name:e.pkg.name,version:e.release.newVersion}),k=await e.pm.runner.run(process.platform==="win32"?"cmd":"sh",process.platform==="win32"?["/c",u]:["-c",u],{cwd:e.pkg.dir,silent:!1});if(k.exitCode!==0)throw new Error(`buildCommand failed for ${e.pkg.name}: exit ${k.exitCode}`)}const s=e.versionedManifestByName.get(e.pkg.name)??e.pkg.manifest,n=Kr(s,e.versionedManifestByName),i=Ve(n,e.catalogs),t=Oe(i,e.cleanPackageJsonConfig),o=await import("node:fs/promises"),d=await o.readFile(e.pkg.manifestPath,"utf8");try{if(await o.writeFile(e.pkg.manifestPath,`${JSON.stringify(t,null,4)}
23
- `),r.publishCommand){const k={name:e.pkg.name,version:e.release.newVersion},g=Array.isArray(r.publishCommand)?r.publishCommand:[r.publishCommand];for(const p of g){const h=Z(p,k),c=await e.pm.runner.run(process.platform==="win32"?"cmd":"sh",process.platform==="win32"?["/c",h]:["-c",h],{cwd:e.pkg.dir,silent:!1});if(c.exitCode!==0)throw new Error(`publishCommand failed for ${e.pkg.name}: exit ${c.exitCode}`)}return{output:`[custom] published ${e.pkg.name}@${e.release.newVersion}`,published:!0}}const u=z(w(B(),"vis-release-pack-"));try{const k=await e.pm.pack({cwd:e.pkg.dir,destination:u}),g=e.workspaceConfig?.publish?.guards;if(g&&Object.values(g).some(m=>m!==void 0&&m!==!1&&m!=="off")){const{runPublishGuards:m}=await import("./publish-guards.js"),$=await Br(e,k),I=await m({config:g,manifest:t,packFiles:$,pkgDir:e.pkg.dir,runner:e.pm.runner,sourceManifest:e.pkg.manifest});if(I.blockers.length>0){const{redactTokens:y}=await import("./security.js"),S=I.blockers.flatMap(N=>N.findings.map(A=>` • [${N.gate}] ${y(A.message)}${A.hint?`
24
- → ${y(A.hint)}`:""}`)).join(`
25
- `);throw new l({code:"PUBLISH_FAILED",message:`Pre-publish guards failed for ${e.pkg.name}@${e.release.newVersion}:
20
+ `);throw new d({code:"PUBLISH_FAILED",message:`Pre-publish guards failed for ${m.name}@${i} (platform package):
21
+ ${N}`,packageName:m.name})}}}const g=e.tag??"latest",p=(f,m)=>{const y=["publish",f,"--tag",g,"--access","public","--userconfig",m];return e.provenance&&y.push("--provenance"),y};for(const{manifest:f,npmrcPath:m,platformDir:y}of u)try{l("npm",p(y,m),{env:{...s,NPM_CONFIG_USERCONFIG:m},stdio:"inherit"})}catch(I){const $=I.message;if(!$.includes("EPUBLISHCONFLICT")&&!$.includes("cannot publish over"))throw new d({cause:I,code:"PUBLISH_FAILED",message:`Failed to publish platform package ${f.name}@${i}: ${$}`,packageName:f.name})}const h=e.versionedManifestByName.get(e.pkg.name)??e.pkg.manifest,c={...h},b={...h.optionalDependencies};for(const{manifest:f}of u)Object.hasOwn(b,f.name)&&(b[f.name]=i);c.optionalDependencies=b;const P=Ve(c,e.catalogs),v=Oe(P,e.cleanPackageJsonConfig),O=await _(e.pkg.manifestPath,"utf8");try{await E(e.pkg.manifestPath,`${JSON.stringify(v,null,4)}
22
+ `),Y(e.pkg.name);const f=await be(e.pkg.name,n,s),m=z(w(B(),"vis-release-napi-parent-"));o.push(m);const y=w(m,".npmrc");ke(y,f.token);const I=l("npm",["pack","--pack-destination",m,"--json"],{cwd:e.pkg.dir,env:s,stdio:["ignore","pipe","ignore"]}).toString();let $;try{const N=JSON.parse(I);N[0]?.filename&&($=w(m,N[0].filename))}catch{}const S=["publish",$??e.pkg.dir,"--tag",g,"--access","public","--userconfig",y];if(e.provenance&&S.push("--provenance"),l("npm",S,{env:{...s,NPM_CONFIG_USERCONFIG:y},stdio:"inherit"}),$){const{hashTarball:N}=await import("./publish-guards.js");return{published:!0,tarball:await N($)}}return{published:!0}}finally{await E(e.pkg.manifestPath,O)}}finally{for(const[l,u]of t)try{await E(l,u)}catch{}for(const l of o)try{await se(l,{force:!0,recursive:!0})}catch{}}}}const Hr=async(a,e)=>{const{extractPackFilesFromRaw:r}=await import("./publish-guards.js"),s=r(e.raw);if(s!==void 0)return s;const n=await a.pm.runner.run("npm",["pack","--dry-run","--json"],{cwd:a.pkg.dir,silent:!0});if(n.exitCode!==0)return[];try{return r(JSON.parse(n.stdout))??[]}catch{return[]}},ve=1800*1e3,ye=15*1e3,$e=a=>{if(a===!0)return{enabled:!0,pollIntervalMs:ye,timeoutMs:ve};if(a&&typeof a=="object"){const e=a;return{enabled:!0,pollIntervalMs:e.pollIntervalMs??ye,timeoutMs:e.timeoutMs??ve}}return{enabled:!1,pollIntervalMs:0,timeoutMs:0}};class Te extends C{id="npm";async readPublishedVersion(e){try{const r=await e.pm.runner.run("npm",["view",e.pkg.name,"version","--silent"],{cwd:e.pkg.dir,silent:!0});return r.exitCode!==0?void 0:r.stdout.trim()||void 0}catch{return}}async publish(e){if(e.dryRun)return{output:`[dry-run] would publish ${e.pkg.name}@${e.release.newVersion}`,published:!0};if(e.resumeStageId){const u=$e(e.workspaceConfig?.publish?.stage);if(!u.enabled)throw new d({code:"CONFIG_INVALID",message:`Cannot resume stage ${e.resumeStageId} for ${e.pkg.name}@${e.release.newVersion}: publish.stage is now disabled. Resolve the stage manually via \`vis release stage approve|reject ${e.resumeStageId}\`.`,packageName:e.pkg.name});return this.resumeStagedPublish(e,u)}const r=e.perPackageConfig&&e.workspaceConfig?Q(e.pkg.name,e.perPackageConfig,e.workspaceConfig):{};if(r.buildCommand){const u=Z(r.buildCommand,{name:e.pkg.name,version:e.release.newVersion}),k=await e.pm.runner.run(process.platform==="win32"?"cmd":"sh",process.platform==="win32"?["/c",u]:["-c",u],{cwd:e.pkg.dir,silent:!1});if(k.exitCode!==0)throw new Error(`buildCommand failed for ${e.pkg.name}: exit ${k.exitCode}`)}const s=e.versionedManifestByName.get(e.pkg.name)??e.pkg.manifest,n=Ge(s,e.versionedManifestByName,e.workspaceConfig?.internalDependencyRanges),i=Ve(n,e.catalogs),t=Oe(i,e.cleanPackageJsonConfig),o=await import("node:fs/promises"),l=await o.readFile(e.pkg.manifestPath,"utf8");try{if(await o.writeFile(e.pkg.manifestPath,`${JSON.stringify(t,null,4)}
23
+ `),r.publishCommand){const k={name:e.pkg.name,version:e.release.newVersion},g=Array.isArray(r.publishCommand)?r.publishCommand:[r.publishCommand];for(const p of g){const h=Z(p,k),c=await e.pm.runner.run(process.platform==="win32"?"cmd":"sh",process.platform==="win32"?["/c",h]:["-c",h],{cwd:e.pkg.dir,silent:!1});if(c.exitCode!==0)throw new Error(`publishCommand failed for ${e.pkg.name}: exit ${c.exitCode}`)}return{output:`[custom] published ${e.pkg.name}@${e.release.newVersion}`,published:!0}}const u=z(w(B(),"vis-release-pack-"));try{const k=await e.pm.pack({cwd:e.pkg.dir,destination:u}),g=e.workspaceConfig?.publish?.guards;if(g&&Object.values(g).some(m=>m!==void 0&&m!==!1&&m!=="off")){const{runPublishGuards:m}=await import("./publish-guards.js"),y=await Hr(e,k),I=await m({config:g,manifest:t,packFiles:y,pkgDir:e.pkg.dir,runner:e.pm.runner,sourceManifest:e.pkg.manifest});if(I.blockers.length>0){const{redactTokens:$}=await import("./security.js"),S=I.blockers.flatMap(N=>N.findings.map(A=>` • [${N.gate}] ${$(A.message)}${A.hint?`
24
+ → ${$(A.hint)}`:""}`)).join(`
25
+ `);throw new d({code:"PUBLISH_FAILED",message:`Pre-publish guards failed for ${e.pkg.name}@${e.release.newVersion}:
26
26
  ${S}`,packageName:e.pkg.name})}}const{hashTarball:p}=await import("./publish-guards.js"),h=await p(k.tarball);if((e.workspaceConfig?.publish?.publishStrategy??"npm-publish-tarball")==="native"){const m=e.pm.id;return e.provenance&&m==="bun"&&process.stderr.write(`[vis release] ⚠ publishStrategy "native": bun has no --provenance/OIDC support; ${e.pkg.name}@${e.release.newVersion} publishes without provenance.
27
27
  `),e.otp&&m==="yarn"&&process.stderr.write(`[vis release] ⚠ publishStrategy "native": \`yarn npm publish\` ignores --otp; configure 2FA via .yarnrc.yml for ${e.pkg.name}.
28
- `),{...await e.pm.publishNative({access:"public",cwd:e.pkg.dir,otp:e.otp,provenance:e.provenance,registry:e.registry,tag:e.tag}),tarball:h}}const c=ye(e.workspaceConfig?.publish?.stage);if(c.enabled){const{refuseRestrictedOidc:m}=await import("./stage-publisher.js"),$=e.pkg.manifest.publishConfig?.access;m($)}const b=await e.pm.publish({access:"public",otp:e.otp,provenance:e.provenance,registry:e.registry,stage:c.enabled,tag:e.tag,tarball:k.tarball});if(!c.enabled||!b.stageId)return{...b,tarball:h};const{waitForStageDecision:P}=await import("./stage-publisher.js"),{stageId:v}=b,O=Date.now();process.stderr.write(`[vis release] ⏳ ${e.pkg.name}@${e.release.newVersion} staged (id ${v}). Waiting up to ${Math.round(c.timeoutMs/6e4)}m for a maintainer to approve via npmjs.com or \`npm stage approve ${v}\`...
28
+ `),{...await e.pm.publishNative({access:"public",cwd:e.pkg.dir,otp:e.otp,provenance:e.provenance,registry:e.registry,tag:e.tag}),tarball:h}}const c=$e(e.workspaceConfig?.publish?.stage);if(c.enabled){const{refuseRestrictedOidc:m}=await import("./stage-publisher.js"),y=e.pkg.manifest.publishConfig?.access;m(y)}const b=await e.pm.publish({access:"public",otp:e.otp,provenance:e.provenance,registry:e.registry,stage:c.enabled,tag:e.tag,tarball:k.tarball});if(!c.enabled||!b.stageId)return{...b,tarball:h};const{waitForStageDecision:P}=await import("./stage-publisher.js"),{stageId:v}=b,O=Date.now();process.stderr.write(`[vis release] ⏳ ${e.pkg.name}@${e.release.newVersion} staged (id ${v}). Waiting up to ${Math.round(c.timeoutMs/6e4)}m for a maintainer to approve via npmjs.com or \`npm stage approve ${v}\`...
29
29
  `);const f=await P({cwd:e.pkg.dir,onProgress:m=>{m>0&&m%3e5<c.pollIntervalMs&&process.stderr.write(`[vis release] still waiting for ${e.pkg.name} stage decision (${Math.round(m/6e4)}m elapsed)...
30
30
  `)},packageName:e.pkg.name,pollIntervalMs:c.pollIntervalMs,runner:e.pm.runner,stageId:v,timeoutMs:c.timeoutMs,version:e.release.newVersion});return f==="approved"?(process.stderr.write(`[vis release] ✓ ${e.pkg.name}@${e.release.newVersion} approved + promoted (${Math.round((Date.now()-O)/1e3)}s).
31
31
  `),{...b,stageId:void 0,tarball:h}):f==="rejected"?(process.stdout.write(`::warning::Stage rejected for ${e.pkg.name}@${e.release.newVersion} (id ${v}). Re-stage by re-running the release once the review feedback is addressed.
32
32
  `),{alreadyPublished:!1,output:`stage-rejected: ${v}`,published:!1,stageId:v}):(process.stdout.write(`::warning::Stage timeout for ${e.pkg.name}@${e.release.newVersion} (id ${v}) after ${Math.round(c.timeoutMs/6e4)}m. Re-run \`vis release publish\` once a maintainer can approve, or run \`vis release stage approve ${v}\` manually.
33
- `),{alreadyPublished:!1,output:`stage-timeout: ${v}`,published:!1,stageId:v})}finally{await o.rm(u,{force:!0,recursive:!0})}}finally{await o.writeFile(e.pkg.manifestPath,d)}}async resumeStagedPublish(e,r){const s=e.resumeStageId,n=Date.now();process.stderr.write(`[vis release] ↻ Resuming wait on staged ${e.pkg.name}@${e.release.newVersion} (id ${s}) — tarball already uploaded; not re-publishing.
33
+ `),{alreadyPublished:!1,output:`stage-timeout: ${v}`,published:!1,stageId:v})}finally{await o.rm(u,{force:!0,recursive:!0})}}finally{await o.writeFile(e.pkg.manifestPath,l)}}async resumeStagedPublish(e,r){const s=e.resumeStageId,n=Date.now();process.stderr.write(`[vis release] ↻ Resuming wait on staged ${e.pkg.name}@${e.release.newVersion} (id ${s}) — tarball already uploaded; not re-publishing.
34
34
  `);const{waitForStageDecision:i}=await import("./stage-publisher.js"),t=await i({cwd:e.pkg.dir,onProgress:o=>{o>0&&o%3e5<r.pollIntervalMs&&process.stderr.write(`[vis release] still waiting for ${e.pkg.name} stage decision (resume, ${Math.round(o/6e4)}m elapsed)...
35
35
  `)},packageName:e.pkg.name,pollIntervalMs:r.pollIntervalMs,runner:e.pm.runner,stageId:s,timeoutMs:r.timeoutMs,version:e.release.newVersion});return t==="approved"?(process.stderr.write(`[vis release] ✓ ${e.pkg.name}@${e.release.newVersion} approved + promoted on resume (${Math.round((Date.now()-n)/1e3)}s).
36
36
  `),{output:`[resumed] published ${e.pkg.name}@${e.release.newVersion}`,published:!0}):t==="rejected"?(process.stdout.write(`::warning::Stage rejected on resume for ${e.pkg.name}@${e.release.newVersion} (id ${s}).
37
37
  `),{alreadyPublished:!1,output:`stage-rejected: ${s}`,published:!1,stageId:s}):(process.stdout.write(`::warning::Stage timeout on resume for ${e.pkg.name}@${e.release.newVersion} (id ${s}) after ${Math.round(r.timeoutMs/6e4)}m.
38
- `),{alreadyPublished:!1,output:`stage-timeout: ${s}`,published:!1,stageId:s})}}const Hr=["dependencies","devDependencies","peerDependencies","optionalDependencies"],Kr=(a,e)=>{const r={...a};for(const s of Hr){const n=a[s];if(!n||typeof n!="object")continue;const i={...n};for(const[t,o]of Object.entries(n)){if(!o.startsWith("workspace:"))continue;const d=e.get(t);d&&(i[t]=Je(o.slice(10)==="*"?"*":o,d.version),i[t].startsWith("workspace:")&&(i[t]=i[t].slice(10)))}r[s]=i}return r},Wr=Object.defineProperty({__proto__:null,NpmVersionActions:Te},Symbol.toStringTag,{value:"Module"}),Ie="https://api.nuget.org/v3/index.json",qr="https://api.nuget.org/v3-flatcontainer",M="NUGET_API_KEY",L=[10,0,300],Xr=a=>{const e=/^(\d+)\.(\d+)\.(\d+)(-[\w.-]+)?/.exec(a.trim());if(!e)return!1;const r=[Number(e[1]),Number(e[2]),Number(e[3])];for(const[s,n]of r.entries())if(n!==L[s])return n>L[s];return e[4]===void 0},Ce=a=>a.split("+")[0].toLowerCase(),Yr=async(a,e,r)=>{try{const s=await V(`${qr}/${encodeURIComponent(a)}/index.json`,{headers:{Accept:"application/json"},httpProxy:r.workspaceConfig?.httpProxy});if(!s.ok)return!1;const n=await s.json();return(typeof n=="object"&&n!==null&&Array.isArray(n.versions)?n.versions:[]).some(t=>typeof t=="string"&&Ce(t)===Ce(e))}catch{return!1}},Pe=(a,e)=>a.split(e).join("***").trim().slice(0,500);class Jr extends C{id="nuget";async readPublishedVersion(e){}async publish(e){const{name:r}=e.pkg,s=e.release.newVersion,n=e.pkg.manifestPath,i=e.pkg.dir;if(e.dryRun)return{output:`[dry-run / nuget] would run dotnet pack ${R(n)} -c Release, then dotnet nuget push the package to ${Ie} for ${r}@${s}`,published:!0};if(process.platform==="win32")throw new l({code:"CONFIG_INVALID",message:`${r} cannot be published from Windows yet: the NuGet path is only verified on POSIX. Publish from a POSIX runner.`,packageName:r});const t=await e.pm.runner.run("dotnet",["--version"],{cwd:i,silent:!0}).then(u=>u.exitCode===0?u.stdout:void 0).catch(()=>{});if(t===void 0)throw new l({code:"CONFIG_INVALID",message:`${r} needs the dotnet CLI on PATH to publish, and "dotnet --version" failed. Install the .NET SDK on the runner.`,packageName:r});if(!Xr(t))throw new l({code:"CONFIG_INVALID",message:`${r} publishes with the ${M} environment variable, which dotnet nuget push reads from .NET SDK ${L.join(".")} (NuGet 7.6) on. This runner has dotnet ${t.trim()}. Install .NET SDK ${L.join(".")} or later on the runner.`,packageName:r});if(await Yr(r,s,e))return{alreadyPublished:!0,output:`[nuget] ${r}@${s} is already on nuget.org; skipped`,published:!1};const o=process.env[M];if(o===void 0||o==="")throw new l({code:"CONFIG_INVALID",message:`${r} needs the API key in the ${M} environment variable to push to nuget.org. Set it on the runner; vis never logs it.`,packageName:r});const d=await Be(w(B(),"vis-nuget-"));try{const u=await e.pm.runner.run("dotnet",["pack",n,"-c","Release","-o",d],{cwd:i,silent:!1});if(u.exitCode!==0)throw new l({code:"PUBLISH_FAILED",hint:`Failing step: dotnet pack ${R(n)}
39
- Fix the build or packaging error above.`,message:`dotnet pack failed for ${r}@${s}: exit ${u.exitCode}. stderr: ${Pe(u.stderr,o)}`,packageName:r});const g=(await re(d)).filter(h=>h.endsWith(".nupkg")&&!h.endsWith(".symbols.nupkg"));if(g.length!==1)throw new l({code:"PUBLISH_FAILED",hint:`dotnet pack wrote ${g.length} packages to a temporary directory. vis pushes exactly one per project.`,message:`expected one .nupkg for ${r}@${s}, found ${g.length}`,packageName:r});const p=await e.pm.runner.run("dotnet",["nuget","push",w(d,g[0]),"--source",Ie],{cwd:i,env:{[M]:o},silent:!1});if(p.exitCode!==0)throw new l({code:"PUBLISH_FAILED",hint:`Failing step: dotnet nuget push
40
- Check the output above. A version nuget.org already has is refused. The key comes from ${M}, which dotnet nuget push reads on .NET SDK ${L.join(".")} or later.`,message:`dotnet nuget push failed for ${r}@${s}: exit ${p.exitCode}. stderr: ${Pe(p.stderr,o)}`,packageName:r})}finally{await se(d,{force:!0,recursive:!0})}return{output:`[nuget] published ${r}@${s} to nuget.org`,published:!0}}}class zr extends C{id="private";async readPublishedVersion(e){}async publish(e){return{output:`[private] skipped publish for ${e.pkg.name}@${e.release.newVersion}`,published:!1}}}const G=async(a,e,r,s)=>{const n=Z(r,s),i=process.platform==="win32",t=i?"cmd":"sh",o=i?["/c",n]:["-c",n];return a.run(t,o,{cwd:e,silent:!1})};class Qr extends C{id="shell";async readPublishedVersion(e){const r=e.perPackageConfig??{},{workspaceConfig:s}=e;if(!s)return;const n=Q(e.pkg.name,r,s);if(!n.checkPublished)return;const i=await G(e.pm.runner,e.pkg.dir,n.checkPublished,{name:e.pkg.name,version:e.pkg.version});if(i.exitCode!==0)return;const t=i.stdout.trim();return/\b\d+\.\d+\.\d+(?:[-+][\w.+-]+)?\b/.exec(t)?.[0]}async publish(e){if(e.dryRun)return{output:`[dry-run / shell] would publish ${e.pkg.name}@${e.release.newVersion}`,published:!0};const{workspaceConfig:r}=e,s=e.perPackageConfig??{};if(!r)throw new l({code:"CONFIG_INVALID",message:`Shell publish actions for ${e.pkg.name} require a workspace config (release.allowCustomCommands gate).`,packageName:e.pkg.name});const n=Q(e.pkg.name,s,r);if(!n.publishCommand)throw new l({code:"CONFIG_INVALID",hint:`Set release.allowCustomCommands (workspace-wide boolean or an allow-list including "${e.pkg.name}") and configure release.packages["${e.pkg.name}"].publishCommand.`,message:`Shell publish actions for ${e.pkg.name} require a publishCommand AND the trust gate to permit it.`,packageName:e.pkg.name});const i={name:e.pkg.name,registry:e.registry,tag:e.tag,version:e.release.newVersion};if(n.checkPublished){const o=await G(e.pm.runner,e.pkg.dir,n.checkPublished,i);if(o.exitCode===0&&/\b\d+\.\d+\.\d+(?:[-+][\w.+-]+)?\b/.exec(o.stdout.trim())?.[0]===e.release.newVersion)return{alreadyPublished:!0,output:`[shell] ${e.pkg.name}@${e.release.newVersion} already on the registry`,published:!1}}if(n.buildCommand){const o=await G(e.pm.runner,e.pkg.dir,n.buildCommand,i);if(o.exitCode!==0)throw new l({code:"PUBLISH_FAILED",message:`buildCommand failed for ${e.pkg.name}: exit ${o.exitCode}. stderr: ${o.stderr.trim().slice(0,500)}`,packageName:e.pkg.name})}const t=Array.isArray(n.publishCommand)?n.publishCommand:[n.publishCommand];for(const o of t){const d=await G(e.pm.runner,e.pkg.dir,o,i);if(d.exitCode!==0)throw new l({code:"PUBLISH_FAILED",hint:"Inspect the publishCommand output above. Common causes: missing auth token, registry unreachable, version already published (re-run safe — `checkPublished` short-circuits subsequent runs).",message:`publishCommand failed for ${e.pkg.name}@${e.release.newVersion}: exit ${d.exitCode}. stderr: ${d.stderr.trim().slice(0,500)}`,packageName:e.pkg.name})}return{output:`[shell] published ${e.pkg.name}@${e.release.newVersion}`,published:!0}}}const Zr=async(a,e)=>{try{return(await a.pm.runner.run("git",["rev-parse","--quiet","--verify",`refs/tags/${e}`],{cwd:a.pkg.dir,silent:!0})).exitCode===0}catch{return!1}};class xr extends C{id="swift";async readPublishedVersion(e){}async publish(e){const r=e.release.newVersion,s=e.perPackageConfig?.releaseTagPattern??e.workspaceConfig?.releaseTagPattern,n=s===void 0?_e(e.pkg.name,r):W(s,{name:e.pkg.name,version:r});if(e.dryRun)return{output:`[dry-run / swift] would tag ${n} for ${e.pkg.name}@${r}`,published:!0};if(process.platform==="win32")throw new l({code:"CONFIG_INVALID",message:`${e.pkg.name} cannot be released from Windows yet: SwiftPM is not run on Windows here. Release from a POSIX runner.`,packageName:e.pkg.name});return await Zr(e,n)?{alreadyPublished:!0,output:`[swift] tag ${n} already exists; ${e.pkg.name}@${r} skipped`,published:!1}:{output:`[swift] ${e.pkg.name}@${r} is released by tag ${n}, created with the release`,published:!0}}}const es=(a,e,r)=>{const s=r.perPackageConfig?.releaseTagPattern??r.workspaceConfig?.releaseTagPattern;return s?W(s,{channel:r.channel,name:a,version:e}):_e(a,e)};class rs extends C{id="zig";async readPublishedVersion(e){}async publish(e){const{name:r}=e.pkg,s=e.release.newVersion,n=es(r,s,{channel:e.tag,perPackageConfig:e.perPackageConfig,workspaceConfig:e.workspaceConfig});if(e.dryRun)return{output:`[dry-run / zig] would tag ${n} for ${r}@${s}; nothing is uploaded`,published:!0};if(process.platform==="win32")throw new l({code:"CONFIG_INVALID",message:`${r} cannot be released from Windows yet: the Zig path is only verified on POSIX. Release from a POSIX runner.`,packageName:r});return await ae({cwd:e.pkg.dir,runner:e.pm.runner},n)?{alreadyPublished:!0,output:`[zig] tag ${n} already exists for ${r}@${s}; skipped`,published:!1}:{output:`[zig] ${r}@${s} has no registry; tag ${n} is created by the release`,published:!0}}}const fs=a=>{switch(a){case"cargo":return new ir;case"composer":return new pr;case"container":return new cr;case"dart":return new hr;case"gem":return new kr;case"go":return new $r;case"gradle":return new Rr;case"hex":return new Er;case"maven":return new Vr;case"native-addon":return new Ur;case"nuget":return new Jr;case"private":return new zr;case"python":return new qe;case"shell":return new Qr;case"swift":return new xr;case"zig":return new rs;default:return new Te}};export{Qe as a,ms as b,fs as c,ze as e,hs as g,q as i,H as p};
38
+ `),{alreadyPublished:!1,output:`stage-timeout: ${s}`,published:!1,stageId:s})}}const Kr=["dependencies","devDependencies","peerDependencies","optionalDependencies"],Ge=(a,e,r)=>{const s={...a};for(const n of Kr){const i=a[n];if(!i||typeof i!="object")continue;const t={...i};for(const[o,l]of Object.entries(i)){if(!l.startsWith("workspace:"))continue;const u=e.get(o);u&&(t[o]=ze(l.slice(10)==="*"?"*":l,u.version,r,{dependent:a.name,depName:o,kind:n}),t[o].startsWith("workspace:")&&(t[o]=t[o].slice(10)))}s[n]=t}return s},Wr=Object.defineProperty({__proto__:null,NpmVersionActions:Te,resolveWorkspaceRefs:Ge},Symbol.toStringTag,{value:"Module"}),Ie="https://api.nuget.org/v3/index.json",qr="https://api.nuget.org/v3-flatcontainer",M="NUGET_API_KEY",L=[10,0,300],Xr=a=>{const e=/^(\d+)\.(\d+)\.(\d+)(-[\w.-]+)?/.exec(a.trim());if(!e)return!1;const r=[Number(e[1]),Number(e[2]),Number(e[3])];for(const[s,n]of r.entries())if(n!==L[s])return n>L[s];return e[4]===void 0},Ce=a=>a.split("+")[0].toLowerCase(),Yr=async(a,e,r)=>{try{const s=await V(`${qr}/${encodeURIComponent(a)}/index.json`,{headers:{Accept:"application/json"},httpProxy:r.workspaceConfig?.httpProxy});if(!s.ok)return!1;const n=await s.json();return(typeof n=="object"&&n!==null&&Array.isArray(n.versions)?n.versions:[]).some(t=>typeof t=="string"&&Ce(t)===Ce(e))}catch{return!1}},Pe=(a,e)=>a.split(e).join("***").trim().slice(0,500);class Jr extends C{id="nuget";async readPublishedVersion(e){}async publish(e){const{name:r}=e.pkg,s=e.release.newVersion,n=e.pkg.manifestPath,i=e.pkg.dir;if(e.dryRun)return{output:`[dry-run / nuget] would run dotnet pack ${R(n)} -c Release, then dotnet nuget push the package to ${Ie} for ${r}@${s}`,published:!0};if(process.platform==="win32")throw new d({code:"CONFIG_INVALID",message:`${r} cannot be published from Windows yet: the NuGet path is only verified on POSIX. Publish from a POSIX runner.`,packageName:r});const t=await e.pm.runner.run("dotnet",["--version"],{cwd:i,silent:!0}).then(u=>u.exitCode===0?u.stdout:void 0).catch(()=>{});if(t===void 0)throw new d({code:"CONFIG_INVALID",message:`${r} needs the dotnet CLI on PATH to publish, and "dotnet --version" failed. Install the .NET SDK on the runner.`,packageName:r});if(!Xr(t))throw new d({code:"CONFIG_INVALID",message:`${r} publishes with the ${M} environment variable, which dotnet nuget push reads from .NET SDK ${L.join(".")} (NuGet 7.6) on. This runner has dotnet ${t.trim()}. Install .NET SDK ${L.join(".")} or later on the runner.`,packageName:r});if(await Yr(r,s,e))return{alreadyPublished:!0,output:`[nuget] ${r}@${s} is already on nuget.org; skipped`,published:!1};const o=process.env[M];if(o===void 0||o==="")throw new d({code:"CONFIG_INVALID",message:`${r} needs the API key in the ${M} environment variable to push to nuget.org. Set it on the runner; vis never logs it.`,packageName:r});const l=await He(w(B(),"vis-nuget-"));try{const u=await e.pm.runner.run("dotnet",["pack",n,"-c","Release","-o",l],{cwd:i,silent:!1});if(u.exitCode!==0)throw new d({code:"PUBLISH_FAILED",hint:`Failing step: dotnet pack ${R(n)}
39
+ Fix the build or packaging error above.`,message:`dotnet pack failed for ${r}@${s}: exit ${u.exitCode}. stderr: ${Pe(u.stderr,o)}`,packageName:r});const g=(await re(l)).filter(h=>h.endsWith(".nupkg")&&!h.endsWith(".symbols.nupkg"));if(g.length!==1)throw new d({code:"PUBLISH_FAILED",hint:`dotnet pack wrote ${g.length} packages to a temporary directory. vis pushes exactly one per project.`,message:`expected one .nupkg for ${r}@${s}, found ${g.length}`,packageName:r});const p=await e.pm.runner.run("dotnet",["nuget","push",w(l,g[0]),"--source",Ie],{cwd:i,env:{[M]:o},silent:!1});if(p.exitCode!==0)throw new d({code:"PUBLISH_FAILED",hint:`Failing step: dotnet nuget push
40
+ Check the output above. A version nuget.org already has is refused. The key comes from ${M}, which dotnet nuget push reads on .NET SDK ${L.join(".")} or later.`,message:`dotnet nuget push failed for ${r}@${s}: exit ${p.exitCode}. stderr: ${Pe(p.stderr,o)}`,packageName:r})}finally{await se(l,{force:!0,recursive:!0})}return{output:`[nuget] published ${r}@${s} to nuget.org`,published:!0}}}class zr extends C{id="private";async readPublishedVersion(e){}async publish(e){return{output:`[private] skipped publish for ${e.pkg.name}@${e.release.newVersion}`,published:!1}}}const G=async(a,e,r,s)=>{const n=Z(r,s),i=process.platform==="win32",t=i?"cmd":"sh",o=i?["/c",n]:["-c",n];return a.run(t,o,{cwd:e,silent:!1})};class Qr extends C{id="shell";async readPublishedVersion(e){const r=e.perPackageConfig??{},{workspaceConfig:s}=e;if(!s)return;const n=Q(e.pkg.name,r,s);if(!n.checkPublished)return;const i=await G(e.pm.runner,e.pkg.dir,n.checkPublished,{name:e.pkg.name,version:e.pkg.version});if(i.exitCode!==0)return;const t=i.stdout.trim();return/\b\d+\.\d+\.\d+(?:[-+][\w.+-]+)?\b/.exec(t)?.[0]}async publish(e){if(e.dryRun)return{output:`[dry-run / shell] would publish ${e.pkg.name}@${e.release.newVersion}`,published:!0};const{workspaceConfig:r}=e,s=e.perPackageConfig??{};if(!r)throw new d({code:"CONFIG_INVALID",message:`Shell publish actions for ${e.pkg.name} require a workspace config (release.allowCustomCommands gate).`,packageName:e.pkg.name});const n=Q(e.pkg.name,s,r);if(!n.publishCommand)throw new d({code:"CONFIG_INVALID",hint:`Set release.allowCustomCommands (workspace-wide boolean or an allow-list including "${e.pkg.name}") and configure release.packages["${e.pkg.name}"].publishCommand.`,message:`Shell publish actions for ${e.pkg.name} require a publishCommand AND the trust gate to permit it.`,packageName:e.pkg.name});const i={name:e.pkg.name,registry:e.registry,tag:e.tag,version:e.release.newVersion};if(n.checkPublished){const o=await G(e.pm.runner,e.pkg.dir,n.checkPublished,i);if(o.exitCode===0&&/\b\d+\.\d+\.\d+(?:[-+][\w.+-]+)?\b/.exec(o.stdout.trim())?.[0]===e.release.newVersion)return{alreadyPublished:!0,output:`[shell] ${e.pkg.name}@${e.release.newVersion} already on the registry`,published:!1}}if(n.buildCommand){const o=await G(e.pm.runner,e.pkg.dir,n.buildCommand,i);if(o.exitCode!==0)throw new d({code:"PUBLISH_FAILED",message:`buildCommand failed for ${e.pkg.name}: exit ${o.exitCode}. stderr: ${o.stderr.trim().slice(0,500)}`,packageName:e.pkg.name})}const t=Array.isArray(n.publishCommand)?n.publishCommand:[n.publishCommand];for(const o of t){const l=await G(e.pm.runner,e.pkg.dir,o,i);if(l.exitCode!==0)throw new d({code:"PUBLISH_FAILED",hint:"Inspect the publishCommand output above. Common causes: missing auth token, registry unreachable, version already published (re-run safe — `checkPublished` short-circuits subsequent runs).",message:`publishCommand failed for ${e.pkg.name}@${e.release.newVersion}: exit ${l.exitCode}. stderr: ${l.stderr.trim().slice(0,500)}`,packageName:e.pkg.name})}return{output:`[shell] published ${e.pkg.name}@${e.release.newVersion}`,published:!0}}}const Zr=async(a,e)=>{try{return(await a.pm.runner.run("git",["rev-parse","--quiet","--verify",`refs/tags/${e}`],{cwd:a.pkg.dir,silent:!0})).exitCode===0}catch{return!1}};class xr extends C{id="swift";async readPublishedVersion(e){}async publish(e){const r=e.release.newVersion,s=e.perPackageConfig?.releaseTagPattern??e.workspaceConfig?.releaseTagPattern,n=s===void 0?_e(e.pkg.name,r):W(s,{name:e.pkg.name,version:r});if(e.dryRun)return{output:`[dry-run / swift] would tag ${n} for ${e.pkg.name}@${r}`,published:!0};if(process.platform==="win32")throw new d({code:"CONFIG_INVALID",message:`${e.pkg.name} cannot be released from Windows yet: SwiftPM is not run on Windows here. Release from a POSIX runner.`,packageName:e.pkg.name});return await Zr(e,n)?{alreadyPublished:!0,output:`[swift] tag ${n} already exists; ${e.pkg.name}@${r} skipped`,published:!1}:{output:`[swift] ${e.pkg.name}@${r} is released by tag ${n}, created with the release`,published:!0}}}const es=(a,e,r)=>{const s=r.perPackageConfig?.releaseTagPattern??r.workspaceConfig?.releaseTagPattern;return s?W(s,{channel:r.channel,name:a,version:e}):_e(a,e)};class rs extends C{id="zig";async readPublishedVersion(e){}async publish(e){const{name:r}=e.pkg,s=e.release.newVersion,n=es(r,s,{channel:e.tag,perPackageConfig:e.perPackageConfig,workspaceConfig:e.workspaceConfig});if(e.dryRun)return{output:`[dry-run / zig] would tag ${n} for ${r}@${s}; nothing is uploaded`,published:!0};if(process.platform==="win32")throw new d({code:"CONFIG_INVALID",message:`${r} cannot be released from Windows yet: the Zig path is only verified on POSIX. Release from a POSIX runner.`,packageName:r});return await ae({cwd:e.pkg.dir,runner:e.pm.runner},n)?{alreadyPublished:!0,output:`[zig] tag ${n} already exists for ${r}@${s}; skipped`,published:!1}:{output:`[zig] ${r}@${s} has no registry; tag ${n} is created by the release`,published:!0}}}const fs=a=>{switch(a){case"cargo":return new tr;case"composer":return new lr;case"container":return new gr;case"dart":return new fr;case"gem":return new vr;case"go":return new $r;case"gradle":return new Fr;case"hex":return new Tr;case"maven":return new Or;case"native-addon":return new Br;case"nuget":return new Jr;case"private":return new zr;case"python":return new Xe;case"shell":return new Qr;case"swift":return new xr;case"zig":return new rs;default:return new Te}};export{Ze as a,ms as b,fs as c,Qe as e,hs as g,q as i,H as p};
@@ -1,4 +1,4 @@
1
- import{a as nt,e as st,z as O}from"../packem_shared/index-0dnGN3GP.js";import{l as At}from"./ts-loader.js";import{L as Et}from"../packem_shared/index-BisalDCf.js";import{p as bt}from"./cli-main.js";import{w as xt,L as Ct,T as U,R as L,B as W,x as E,O as N,K as Q,Z as V,W as jt,y as K,z as kt,F as D,A as J,C as Y,H as Lt,E as Wt,M as St,G as Ut,P as Tt,I as Ot,J as _t,Y as Pt,N as It,Q as Rt,S as zt,V as Nt,$ as Mt,X as vt,_ as Ft,a0 as Bt}from"../packem_shared/env-CJVZRP-o.js";import{M as I,L as qt}from"../packem_shared/registry-acz8_sxm.js";const Gt=(t,e)=>typeof t!="string"||t===""?"":t[0].toLowerCase()+t.slice(1),Qt=new RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))","g"),Vt=t=>{if(typeof t!="string")throw new TypeError(`The "value" argument must be of type string. Received ${typeof t}`);return t.replaceAll(Qt,"")},M=new I(1e3),Kt=/[.*+?^${}()|[\]\\]/g,Dt=t=>{const e=t.join("");if(M.has(e)){const r=M.get(e);return r.lastIndex=0,r}const s=t.map(r=>r.replaceAll(Kt,String.raw`\$&`)).join("|"),n=new RegExp(s,"g");return M.set(e,n),n},Jt=t=>{const e=[];let s=0,n;for(L.lastIndex=0;(n=L.exec(t))!==null;)n.index>s&&e.push(t.slice(s,n.index)),e.push(n[0]),s=L.lastIndex;return s<t.length&&e.push(t.slice(s)),e.filter(Boolean)},Yt=/[ČŠŽĐ]/i,rt=new Uint8Array(128),ot=new Uint8Array(128),it=new Uint8Array(128);for(let t=0;t<128;t++)rt[t]=t>=65&&t<=90?1:0,ot[t]=t>=97&&t<=122?1:0,it[t]=t>=48&&t<=57?1:0;const v=t=>rt[t],X=t=>ot[t],F=t=>it[t],j=(t,e,s,n,r)=>{if(t.length===0)return[];let o=!1;const a=Object.values(e);for(const u of a)if(u(t[0])){o=!0;break}if(!o&&!s)return[t];const l=[...t],h=[];let i=l[0],p="other";const d=Object.entries(e);for(const u of d){const[f,g]=u;if(g(l[0])){p=f;break}}let c=s&&n?l[0]===l[0].toLocaleUpperCase(n):!1;for(let u=1;u<l.length;u++){const f=l[u];let g="other";for(const w of d){const[$,A]=w;if(A(f)){g=$;break}}const y=s&&n?f===f.toLocaleUpperCase(n):!1;let m=!1;r?m=r(p,g,c,y,f,u,l):(p!==g&&p!=="other"&&g!=="other"&&(m=!0),s&&g!=="other"&&!c&&y&&(m=!0)),m?(h.push(i),i=f):i+=f,p=g,s&&(c=y)}return i&&i.length>0&&h.push(i),h.length>0?h:[t]},Xt=(t,e,s,n)=>{if(s.size===0)return e;for(const r of s)if(t.startsWith(r,e))return n.push(r),e+r.length;return e},lt=(t,e=new Set)=>{if(t.length===0)return[];if(t.toUpperCase()===t)return[t];let s=0;const n=[],r=t.length;for(let o=1;o<r;o++){const a=Xt(t,s,e,n);if(a!==s){s=a,o=s-1;continue}const l=t.codePointAt(o-1),h=t.codePointAt(o),i=l&&l<128&&v(l),p=h&&h<128&&v(h),d=l&&l<128&&X(l),c=l&&l<128&&F(l),u=h&&h<128&&F(h);if(d&&p){n.push(t.slice(s,o)),s=o;continue}if(c&&!u||!c&&u){n.push(t.slice(s,o)),s=o;continue}if(u&&!c){let f=!1,g=!1;if(o+1<r){const y=t.codePointAt(o+1);f=y&&y<128&&v(y),g=y&&y<128&&F(y)}if(!g&&f){n.push(t.slice(s,o),t.slice(o,o+1)),s=o+1;continue}}if(o+1<r){const f=t.codePointAt(o+1),g=f&&f<128&&X(f);if(i&&p&&g){const y=t.slice(s,o+1);e.has(y)||(n.push(t.slice(s,o)),s=o)}}}return s<r&&n.push(t.slice(s)),n.filter(o=>o!=="")},at=(t,e,s)=>{if(t.length===0)return[];const n=t===t.toLocaleUpperCase(e);if(e.startsWith("de")){if(!n&&t.replaceAll("ß","SS")===t.toLocaleUpperCase(e))return[t];const i=[...t],p=i.length,d=[];let c=i[0],u=i[0]===i[0].toLocaleUpperCase(e),f=u,g=u?0:-1;for(let y=1;y<p;y++){const m=i[y],w=m===m.toLocaleUpperCase(e);if(w===u)c+=m;else if(w)c&&c.length>0&&(d.push(c),c=m),f=!0,g=y;else{if(f&&y-g>1){const $=i[y-1],A=c.slice(0,-1);A&&A.length>0&&d.push(A),c=$+m}else c+=m;f=!1,g=-1}u=w}return c&&c.length>0&&d.push(c),d}if(e.startsWith("uk")||e.startsWith("ru")||e.startsWith("bg")||e.startsWith("sr")||e.startsWith("mk")||e.startsWith("be")){if(!W.test(t)&&!E.test(t))return[t];const i=[...t],p=i.length,d=[];let c=i[0];const u=i[0];let f;W.test(u)?f=1:E.test(u)?f=2:f=0;let g=u===u.toLocaleUpperCase(e);for(let m=1;m<p;m++){const w=i[m];let $;W.test(w)?$=1:E.test(w)?$=2:$=0;const A=w===w.toLocaleUpperCase(e);f!==$&&(f===1||f===2)&&($===1||$===2)||$===f&&!g&&A?(d.push(c),c=w):c+=w,f=$,g=A}c&&c.length>0&&d.push(c);const y=[];for(let m=0;m<d.length;m++)m<d.length-1&&d[m].length===1&&E.test(d[m])&&W.test(d[m+1][0])?(y.push(d[m]+d[m+1]),m+=1):y.push(d[m]);return y}if(e.startsWith("el")){if(!N.test(t)&&!E.test(t))return[t];const i=[];Q.lastIndex=0;let p;for(;(p=Q.exec(t))!==null;)i.push(p[0]);i.length===0&&i.push(t);const d=[];if(i.length===1){const c=i[0];if(!c||!N.test(c[0])||c.length===1)return[c??t]}for(const c of i){if(!c)continue;if(!N.test(c[0])||c.length===1){d.push(c);continue}const u=c.length;let f=c[0],g=c[0]===c[0].toLocaleUpperCase(e);for(let y=1;y<u;y++){const m=c[y],w=m===m.toLocaleUpperCase(e);!g&&w?(d.push(f),f=m):f+=m,g=w}f&&d.push(f)}return d}if(e.startsWith("ja")||e.startsWith("ko")){const i=e.startsWith("ja"),p=i?{hiragana:c=>kt.test(c),kanji:c=>K.test(c),katakana:c=>jt.test(c),latin:c=>E.test(c)}:{hangul:c=>D.test(c),latin:c=>E.test(c)},d=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(i){const c=j(t,p,!1,e,(f,g)=>f==="hiragana"&&g==="katakana"||f==="katakana"&&g==="hiragana"||f==="hiragana"&&g==="latin"||f==="katakana"&&g==="latin"||f==="kanji"&&g==="latin"||f==="latin"&&(g==="hiragana"||g==="katakana"||g==="kanji")),u=[];for(const f of c){const g=f;g.length===1&&d.has(g)&&u.length>0?u[u.length-1]=u.at(-1)+g:u.push(g)}return u.length>0?u:[t]}return j(t,p,!1,e,(c,u)=>c==="hangul"&&u==="latin"||c==="latin"&&u==="hangul")}if(e.startsWith("sl")){const i=[...t],p=i.length,d=[];let c=i[0],u=i[0]===i[0].toLocaleUpperCase(e);for(let f=1;f<p;f++){const g=i[f],y=g===g.toLocaleUpperCase(e),m=Yt.test(g),w=f<p-1&&i[f+1]===i[f+1].toLocaleUpperCase(e);!u&&y||m&&w?(d.push(c),c=g,m&&w&&(d.push(c),c="")):c+=g,u=y}return c&&c.length>0&&d.push(c),d}if(e.startsWith("zh"))return j(t,{han:i=>K.test(i),latin:i=>E.test(i)},!1,e);if(["ar","fa","he","ur"].includes(e.split("-")[0])){const i=p=>J.test(p)||Y.test(p);return j(t,{latin:p=>E.test(p),rtl:p=>i(p)},!1,e)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(e.split("-")[0])){const i=p=>Lt.test(p)||Wt.test(p)||St.test(p)||Ut.test(p)||Tt.test(p)||Ot.test(p)||_t.test(p)||Pt.test(p)||It.test(p)||Rt.test(p)||zt.test(p)||Nt.test(p)||Mt.test(p)||vt.test(p)||Ft.test(p)||Bt.test(p);return j(t,{indic:p=>i(p),latin:p=>E.test(p)},!1,e)}if(["be","bg","ru","sr","uk"].includes(e))return j(t,{cyrillic:i=>W.test(i),latin:i=>E.test(i)},!0,e);if(["ar","fa","he"].includes(e))return j(t,{latin:i=>E.test(i),rtl:i=>J.test(i)||Y.test(i)},!1,e);if(e.startsWith("ko"))return j(t,{hangul:i=>D.test(i),latin:i=>E.test(i)},!1,e);if(e.startsWith("uz")){if(!W.test(t)&&!E.test(t))return[t];const i=[...t],p=i.length,d=[];let c=i[0],u=i[0]===i[0].toLocaleUpperCase(e);for(let f=1;f<p;f++){const g=i[f],y=g===g.toLocaleUpperCase(e);if(V.test(g)||V.test(i[f-1])){c+=g;continue}!u&&y?(d.push(c),c=g):c+=g,u=y}return c&&c.length>0&&d.push(c),d}const r=[...t],o=r.length,a=[];let l=r[0],h=r[0]===r[0].toLocaleUpperCase(e);for(const i of s)if(t.startsWith(i)){a.push(i),l=r[i.length],h=l===l.toLocaleUpperCase(e);break}for(let i=1;i<o;i++){const p=r[i],d=p===p.toLocaleUpperCase(e);let c=0;for(const u of s)if(t.startsWith(u,i)){a.push(l,u),c=u.length,l="";const f=u.at(-1);f&&(h=f===f.toLocaleUpperCase(e));break}if(c>0){i+=c-1;continue}!h&&d?(a.push(l),l=p):l+=p,h=d}return l&&a.push(l),a},Zt=(t,e,s)=>{const n=[],r=U.test(t)?t.split(U).filter(Boolean):[t];for(const o of r){const a=o;if(U.test(a))n.push(a);else{L.lastIndex=0;const l=L.test(a)?Jt(a).filter(Boolean):[a];for(const h of l)if(L.lastIndex=0,L.test(h))n.push(h);else if(e){const i=e.toLowerCase().split("-")[0];n.push(...at(h,i,s))}else n.push(...lt(h,s))}}return n},R=(t,e={})=>{if(!t||typeof t!="string")return[];const{handleAnsi:s=!1,handleEmoji:n=!1,knownAcronyms:r=[],locale:o,normalize:a=!1,separators:l,stripAnsi:h=!1,stripEmoji:i=!1}=e,p=new Set([...r].toSorted((m,w)=>w.length-m.length));let d=t;h&&(d=Vt(d)),i&&(d=xt(d));let c;Array.isArray(l)?c=Dt(l):l instanceof RegExp?c=l:c=Ct;const u=[];let f=d;const g=c.flags.includes("g")?c:new RegExp(c.source,`${c.flags}g`);for(;f.length>0;){const m=g.exec(f);if(!m){f===".."?u.push(".."):f==="."?u.push("."):f.length>0&&u.push(f);break}const w=m.index,$=m[0],A=$.length,T=f.slice(0,w),$t=f.slice(w+A);if($.startsWith("../"))u.push(".."),f=f.slice(w+3);else if($.startsWith("./"))u.push("."),f=f.slice(w+2);else if(w===0&&$==="..")u.push(".."),f=f.slice(2);else if(w===0&&$===".")u.push("."),f=f.slice(1);else{T.length>0&&u.push(T);let x=0;for(;(x=$.indexOf("../",x))!==-1;)u.push(".."),x+=3;for(x=0;(x=$.indexOf("./",x))!==-1;)(x===0||$[x-1]!==".")&&u.push("."),x+=2;let C=$t;for(;C.startsWith("../");)u.push(".."),C=C.slice(3);for(;C.startsWith("./");)u.push("."),C=C.slice(2);if(C===".."){u.push("..");break}else if(C==="."){u.push(".");break}else f=C}g.lastIndex=0}if(u.length===0){const m=d.split(c).filter(Boolean);u.push(...m)}let y=[];for(const m of u)s||n?y.push(...Zt(m,o,p)):o?y.push(...at(m,o,p)):y.push(...lt(m,p));return a&&(y=y.map(m=>p.has(m)?m:o&&m===m.toLocaleUpperCase(o)?m[0]+m.slice(1).toLocaleLowerCase(o):m.toUpperCase()===m&&!p.has(m)?m.slice(0,1)+m.slice(1).toLowerCase():m)),y},q=(t,e)=>typeof t!="string"||t===""?"":(e?.locale?t[0].toLocaleUpperCase(e.locale):t[0].toUpperCase())+t.slice(1),Ht=(t,e)=>`${t}::${e?.joiner??""}::${e?.locale??""}::${e?.knownAcronyms?.join(",")??""}::${e?.normalize?"true":"false"}::${e?.stripAnsi?"true":"false"}::${e?.stripEmoji?"true":"false"}::${e?.handleAnsi?"true":"false"}::${e?.handleEmoji?"true":"false"}`,z=(t,e)=>{const{length:s}=t;if(s===0)return"";if(s===1)return t[0];const n=[];let r="",o="";for(let a=0;a<s;a++){const l=t[a];if(U.test(l)){r?(n.push(r+o+l),r="",o=""):(n.length>0&&n.push(e),r=l);continue}r?(o&&(o+=e),o+=l):(n.length>0&&n.push(e),n.push(l))}return n.join("")},te=/(?<![a-zß])SS(?![a-z])/g,ee=t=>t.replaceAll(te,"ß"),ne=(t,e)=>{if(typeof t!="string"||!t)return"";let s=!0;return z(R(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(r=>{const o=r,a=o.toLowerCase();return s?(s=!1,Gt(a)):q(a,e)}),"")},se=new I(1e3),G=(t,e)=>{if(typeof t!="string")return"";const s=e?.cache??!1,n=e?.cacheStore??se;let r;if(s&&(r=Ht(t,e)),s&&r&&n.has(r))return n.get(r);const o=R(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(l=>{if(e?.handleAnsi&&U.test(l))return l;if(e?.toUpperCase)return e.locale?l.toLocaleUpperCase(e.locale):l.toUpperCase();const h=e?.locale?.startsWith("de")?ee(l):l;return e?.locale?h.toLocaleLowerCase(e.locale):h.toLowerCase()}),a=z(o,e?.joiner??"-");return s&&r&&n.set(r,a),a},re=new I(1e3),oe=(t,e)=>G(t,{cacheStore:re,...e,joiner:"_",toUpperCase:!0}),ie=(t,e)=>typeof t!="string"||!t?"":z(R(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(n=>q(n.toLowerCase(),{locale:e?.locale})),""),le=new I(1e3),ae=(t,e)=>G(t,{cacheStore:le,...e,joiner:"_"}),ce=(t,e)=>typeof t!="string"?"":z(R(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(n=>q(n,{locale:e?.locale})),"-"),b=t=>t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"?String(t):JSON.stringify(t),Z={camel_case:t=>ne(b(t)),kebab_case:t=>G(b(t)),lower_case:t=>b(t).toLowerCase(),pascal_case:t=>ie(b(t)),path_join:(t,...e)=>{const s=[b(t),...e.map(n=>b(n))];return st(...s)},path_relative:(t,e)=>nt(b(e),b(t)),snake_case:t=>ae(b(t)),upper_case:t=>b(t).toUpperCase(),upper_kebab_case:t=>ce(b(t)),upper_snake_case:t=>oe(b(t))},ct=(t,e,s=[])=>{const n=Z[t];if(!n)throw new Error(`Unknown filter "${t}". Known filters: ${Object.keys(Z).sort().join(", ")}.`);return n(e,...s)},ft=t=>{const e=[];let s=0,n=0,r,o=-1;for(const a of t){if(o+=1,r){a===r&&(r=void 0);continue}if(a==='"'||a==="'"){r=a;continue}a==="("?s+=1:a===")"?s-=1:a===","&&s===0&&(e.push(t.slice(n,o)),n=o+1)}return e.push(t.slice(n)),e},fe=t=>{if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1)},ue=/\[([^\]]+)\]/g,pe=t=>{const e=t.trim(),s=e.indexOf("(");if(s===-1)return{args:[],name:e};if(!e.endsWith(")"))throw new Error(`Filter call "${t}" missing closing ")"`);const n=e.slice(0,s).trim(),r=e.slice(s+1,-1).trim();return r===""?{args:[],name:n}:{args:ft(r).map(a=>{const l=a.trim();return fe(l)??l}),name:n}},he=t=>{const e=t.split("|").map(r=>r.trim()),s=e[0]??"";if(!s)throw new Error(`Empty variable name in expression "${t}"`);return{filters:e.slice(1).map(r=>pe(r)),name:s}},de=t=>t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"?String(t):JSON.stringify(t),me=(t,e)=>{const s=t.replaceAll(ue,(n,r)=>{const{filters:o,name:a}=he(r);if(!Object.hasOwn(e,a))throw new Error(`Variable "${a}" used in filename "${t}" but not defined`);let l=e[a];for(const h of o)l=ct(h.name,l,h.args);return de(l)});return ut(s)},ut=t=>t.split("/").map(e=>e.endsWith(".tera")||e.endsWith(".twig")?e.slice(0,-5):e).join("/"),ge=t=>t.endsWith(".raw")?t.slice(0,-4):t,ye=t=>{const e=t.split("/");return(e.at(-1)??"").startsWith("_")?!0:e.slice(0,-1).includes("partials")},k="---",we=(t,e)=>{if(!t.startsWith(`${k}
1
+ import{a as nt,e as st,z as O}from"../packem_shared/index-0dnGN3GP.js";import{l as At}from"./ts-loader.js";import{L as Et}from"../packem_shared/index-BisalDCf.js";import{p as bt}from"./cli-main.js";import{w as xt,L as Ct,T as U,R as L,B as W,x as E,O as N,K as Q,Z as V,W as jt,y as K,z as kt,F as D,A as J,C as Y,H as Lt,E as Wt,M as St,G as Ut,P as Tt,I as Ot,J as _t,Y as Pt,N as It,Q as Rt,S as zt,V as Nt,$ as Mt,X as vt,_ as Ft,a0 as Bt}from"../packem_shared/env-CsENUmRe.js";import{M as I,L as qt}from"../packem_shared/registry-CIfr2njA.js";const Gt=(t,e)=>typeof t!="string"||t===""?"":t[0].toLowerCase()+t.slice(1),Qt=new RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))","g"),Vt=t=>{if(typeof t!="string")throw new TypeError(`The "value" argument must be of type string. Received ${typeof t}`);return t.replaceAll(Qt,"")},M=new I(1e3),Kt=/[.*+?^${}()|[\]\\]/g,Dt=t=>{const e=t.join("");if(M.has(e)){const r=M.get(e);return r.lastIndex=0,r}const s=t.map(r=>r.replaceAll(Kt,String.raw`\$&`)).join("|"),n=new RegExp(s,"g");return M.set(e,n),n},Jt=t=>{const e=[];let s=0,n;for(L.lastIndex=0;(n=L.exec(t))!==null;)n.index>s&&e.push(t.slice(s,n.index)),e.push(n[0]),s=L.lastIndex;return s<t.length&&e.push(t.slice(s)),e.filter(Boolean)},Yt=/[ČŠŽĐ]/i,rt=new Uint8Array(128),ot=new Uint8Array(128),it=new Uint8Array(128);for(let t=0;t<128;t++)rt[t]=t>=65&&t<=90?1:0,ot[t]=t>=97&&t<=122?1:0,it[t]=t>=48&&t<=57?1:0;const v=t=>rt[t],X=t=>ot[t],F=t=>it[t],j=(t,e,s,n,r)=>{if(t.length===0)return[];let o=!1;const a=Object.values(e);for(const u of a)if(u(t[0])){o=!0;break}if(!o&&!s)return[t];const l=[...t],h=[];let i=l[0],p="other";const d=Object.entries(e);for(const u of d){const[f,g]=u;if(g(l[0])){p=f;break}}let c=s&&n?l[0]===l[0].toLocaleUpperCase(n):!1;for(let u=1;u<l.length;u++){const f=l[u];let g="other";for(const w of d){const[$,A]=w;if(A(f)){g=$;break}}const y=s&&n?f===f.toLocaleUpperCase(n):!1;let m=!1;r?m=r(p,g,c,y,f,u,l):(p!==g&&p!=="other"&&g!=="other"&&(m=!0),s&&g!=="other"&&!c&&y&&(m=!0)),m?(h.push(i),i=f):i+=f,p=g,s&&(c=y)}return i&&i.length>0&&h.push(i),h.length>0?h:[t]},Xt=(t,e,s,n)=>{if(s.size===0)return e;for(const r of s)if(t.startsWith(r,e))return n.push(r),e+r.length;return e},lt=(t,e=new Set)=>{if(t.length===0)return[];if(t.toUpperCase()===t)return[t];let s=0;const n=[],r=t.length;for(let o=1;o<r;o++){const a=Xt(t,s,e,n);if(a!==s){s=a,o=s-1;continue}const l=t.codePointAt(o-1),h=t.codePointAt(o),i=l&&l<128&&v(l),p=h&&h<128&&v(h),d=l&&l<128&&X(l),c=l&&l<128&&F(l),u=h&&h<128&&F(h);if(d&&p){n.push(t.slice(s,o)),s=o;continue}if(c&&!u||!c&&u){n.push(t.slice(s,o)),s=o;continue}if(u&&!c){let f=!1,g=!1;if(o+1<r){const y=t.codePointAt(o+1);f=y&&y<128&&v(y),g=y&&y<128&&F(y)}if(!g&&f){n.push(t.slice(s,o),t.slice(o,o+1)),s=o+1;continue}}if(o+1<r){const f=t.codePointAt(o+1),g=f&&f<128&&X(f);if(i&&p&&g){const y=t.slice(s,o+1);e.has(y)||(n.push(t.slice(s,o)),s=o)}}}return s<r&&n.push(t.slice(s)),n.filter(o=>o!=="")},at=(t,e,s)=>{if(t.length===0)return[];const n=t===t.toLocaleUpperCase(e);if(e.startsWith("de")){if(!n&&t.replaceAll("ß","SS")===t.toLocaleUpperCase(e))return[t];const i=[...t],p=i.length,d=[];let c=i[0],u=i[0]===i[0].toLocaleUpperCase(e),f=u,g=u?0:-1;for(let y=1;y<p;y++){const m=i[y],w=m===m.toLocaleUpperCase(e);if(w===u)c+=m;else if(w)c&&c.length>0&&(d.push(c),c=m),f=!0,g=y;else{if(f&&y-g>1){const $=i[y-1],A=c.slice(0,-1);A&&A.length>0&&d.push(A),c=$+m}else c+=m;f=!1,g=-1}u=w}return c&&c.length>0&&d.push(c),d}if(e.startsWith("uk")||e.startsWith("ru")||e.startsWith("bg")||e.startsWith("sr")||e.startsWith("mk")||e.startsWith("be")){if(!W.test(t)&&!E.test(t))return[t];const i=[...t],p=i.length,d=[];let c=i[0];const u=i[0];let f;W.test(u)?f=1:E.test(u)?f=2:f=0;let g=u===u.toLocaleUpperCase(e);for(let m=1;m<p;m++){const w=i[m];let $;W.test(w)?$=1:E.test(w)?$=2:$=0;const A=w===w.toLocaleUpperCase(e);f!==$&&(f===1||f===2)&&($===1||$===2)||$===f&&!g&&A?(d.push(c),c=w):c+=w,f=$,g=A}c&&c.length>0&&d.push(c);const y=[];for(let m=0;m<d.length;m++)m<d.length-1&&d[m].length===1&&E.test(d[m])&&W.test(d[m+1][0])?(y.push(d[m]+d[m+1]),m+=1):y.push(d[m]);return y}if(e.startsWith("el")){if(!N.test(t)&&!E.test(t))return[t];const i=[];Q.lastIndex=0;let p;for(;(p=Q.exec(t))!==null;)i.push(p[0]);i.length===0&&i.push(t);const d=[];if(i.length===1){const c=i[0];if(!c||!N.test(c[0])||c.length===1)return[c??t]}for(const c of i){if(!c)continue;if(!N.test(c[0])||c.length===1){d.push(c);continue}const u=c.length;let f=c[0],g=c[0]===c[0].toLocaleUpperCase(e);for(let y=1;y<u;y++){const m=c[y],w=m===m.toLocaleUpperCase(e);!g&&w?(d.push(f),f=m):f+=m,g=w}f&&d.push(f)}return d}if(e.startsWith("ja")||e.startsWith("ko")){const i=e.startsWith("ja"),p=i?{hiragana:c=>kt.test(c),kanji:c=>K.test(c),katakana:c=>jt.test(c),latin:c=>E.test(c)}:{hangul:c=>D.test(c),latin:c=>E.test(c)},d=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(i){const c=j(t,p,!1,e,(f,g)=>f==="hiragana"&&g==="katakana"||f==="katakana"&&g==="hiragana"||f==="hiragana"&&g==="latin"||f==="katakana"&&g==="latin"||f==="kanji"&&g==="latin"||f==="latin"&&(g==="hiragana"||g==="katakana"||g==="kanji")),u=[];for(const f of c){const g=f;g.length===1&&d.has(g)&&u.length>0?u[u.length-1]=u.at(-1)+g:u.push(g)}return u.length>0?u:[t]}return j(t,p,!1,e,(c,u)=>c==="hangul"&&u==="latin"||c==="latin"&&u==="hangul")}if(e.startsWith("sl")){const i=[...t],p=i.length,d=[];let c=i[0],u=i[0]===i[0].toLocaleUpperCase(e);for(let f=1;f<p;f++){const g=i[f],y=g===g.toLocaleUpperCase(e),m=Yt.test(g),w=f<p-1&&i[f+1]===i[f+1].toLocaleUpperCase(e);!u&&y||m&&w?(d.push(c),c=g,m&&w&&(d.push(c),c="")):c+=g,u=y}return c&&c.length>0&&d.push(c),d}if(e.startsWith("zh"))return j(t,{han:i=>K.test(i),latin:i=>E.test(i)},!1,e);if(["ar","fa","he","ur"].includes(e.split("-")[0])){const i=p=>J.test(p)||Y.test(p);return j(t,{latin:p=>E.test(p),rtl:p=>i(p)},!1,e)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(e.split("-")[0])){const i=p=>Lt.test(p)||Wt.test(p)||St.test(p)||Ut.test(p)||Tt.test(p)||Ot.test(p)||_t.test(p)||Pt.test(p)||It.test(p)||Rt.test(p)||zt.test(p)||Nt.test(p)||Mt.test(p)||vt.test(p)||Ft.test(p)||Bt.test(p);return j(t,{indic:p=>i(p),latin:p=>E.test(p)},!1,e)}if(["be","bg","ru","sr","uk"].includes(e))return j(t,{cyrillic:i=>W.test(i),latin:i=>E.test(i)},!0,e);if(["ar","fa","he"].includes(e))return j(t,{latin:i=>E.test(i),rtl:i=>J.test(i)||Y.test(i)},!1,e);if(e.startsWith("ko"))return j(t,{hangul:i=>D.test(i),latin:i=>E.test(i)},!1,e);if(e.startsWith("uz")){if(!W.test(t)&&!E.test(t))return[t];const i=[...t],p=i.length,d=[];let c=i[0],u=i[0]===i[0].toLocaleUpperCase(e);for(let f=1;f<p;f++){const g=i[f],y=g===g.toLocaleUpperCase(e);if(V.test(g)||V.test(i[f-1])){c+=g;continue}!u&&y?(d.push(c),c=g):c+=g,u=y}return c&&c.length>0&&d.push(c),d}const r=[...t],o=r.length,a=[];let l=r[0],h=r[0]===r[0].toLocaleUpperCase(e);for(const i of s)if(t.startsWith(i)){a.push(i),l=r[i.length],h=l===l.toLocaleUpperCase(e);break}for(let i=1;i<o;i++){const p=r[i],d=p===p.toLocaleUpperCase(e);let c=0;for(const u of s)if(t.startsWith(u,i)){a.push(l,u),c=u.length,l="";const f=u.at(-1);f&&(h=f===f.toLocaleUpperCase(e));break}if(c>0){i+=c-1;continue}!h&&d?(a.push(l),l=p):l+=p,h=d}return l&&a.push(l),a},Zt=(t,e,s)=>{const n=[],r=U.test(t)?t.split(U).filter(Boolean):[t];for(const o of r){const a=o;if(U.test(a))n.push(a);else{L.lastIndex=0;const l=L.test(a)?Jt(a).filter(Boolean):[a];for(const h of l)if(L.lastIndex=0,L.test(h))n.push(h);else if(e){const i=e.toLowerCase().split("-")[0];n.push(...at(h,i,s))}else n.push(...lt(h,s))}}return n},R=(t,e={})=>{if(!t||typeof t!="string")return[];const{handleAnsi:s=!1,handleEmoji:n=!1,knownAcronyms:r=[],locale:o,normalize:a=!1,separators:l,stripAnsi:h=!1,stripEmoji:i=!1}=e,p=new Set([...r].toSorted((m,w)=>w.length-m.length));let d=t;h&&(d=Vt(d)),i&&(d=xt(d));let c;Array.isArray(l)?c=Dt(l):l instanceof RegExp?c=l:c=Ct;const u=[];let f=d;const g=c.flags.includes("g")?c:new RegExp(c.source,`${c.flags}g`);for(;f.length>0;){const m=g.exec(f);if(!m){f===".."?u.push(".."):f==="."?u.push("."):f.length>0&&u.push(f);break}const w=m.index,$=m[0],A=$.length,T=f.slice(0,w),$t=f.slice(w+A);if($.startsWith("../"))u.push(".."),f=f.slice(w+3);else if($.startsWith("./"))u.push("."),f=f.slice(w+2);else if(w===0&&$==="..")u.push(".."),f=f.slice(2);else if(w===0&&$===".")u.push("."),f=f.slice(1);else{T.length>0&&u.push(T);let x=0;for(;(x=$.indexOf("../",x))!==-1;)u.push(".."),x+=3;for(x=0;(x=$.indexOf("./",x))!==-1;)(x===0||$[x-1]!==".")&&u.push("."),x+=2;let C=$t;for(;C.startsWith("../");)u.push(".."),C=C.slice(3);for(;C.startsWith("./");)u.push("."),C=C.slice(2);if(C===".."){u.push("..");break}else if(C==="."){u.push(".");break}else f=C}g.lastIndex=0}if(u.length===0){const m=d.split(c).filter(Boolean);u.push(...m)}let y=[];for(const m of u)s||n?y.push(...Zt(m,o,p)):o?y.push(...at(m,o,p)):y.push(...lt(m,p));return a&&(y=y.map(m=>p.has(m)?m:o&&m===m.toLocaleUpperCase(o)?m[0]+m.slice(1).toLocaleLowerCase(o):m.toUpperCase()===m&&!p.has(m)?m.slice(0,1)+m.slice(1).toLowerCase():m)),y},q=(t,e)=>typeof t!="string"||t===""?"":(e?.locale?t[0].toLocaleUpperCase(e.locale):t[0].toUpperCase())+t.slice(1),Ht=(t,e)=>`${t}::${e?.joiner??""}::${e?.locale??""}::${e?.knownAcronyms?.join(",")??""}::${e?.normalize?"true":"false"}::${e?.stripAnsi?"true":"false"}::${e?.stripEmoji?"true":"false"}::${e?.handleAnsi?"true":"false"}::${e?.handleEmoji?"true":"false"}`,z=(t,e)=>{const{length:s}=t;if(s===0)return"";if(s===1)return t[0];const n=[];let r="",o="";for(let a=0;a<s;a++){const l=t[a];if(U.test(l)){r?(n.push(r+o+l),r="",o=""):(n.length>0&&n.push(e),r=l);continue}r?(o&&(o+=e),o+=l):(n.length>0&&n.push(e),n.push(l))}return n.join("")},te=/(?<![a-zß])SS(?![a-z])/g,ee=t=>t.replaceAll(te,"ß"),ne=(t,e)=>{if(typeof t!="string"||!t)return"";let s=!0;return z(R(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(r=>{const o=r,a=o.toLowerCase();return s?(s=!1,Gt(a)):q(a,e)}),"")},se=new I(1e3),G=(t,e)=>{if(typeof t!="string")return"";const s=e?.cache??!1,n=e?.cacheStore??se;let r;if(s&&(r=Ht(t,e)),s&&r&&n.has(r))return n.get(r);const o=R(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(l=>{if(e?.handleAnsi&&U.test(l))return l;if(e?.toUpperCase)return e.locale?l.toLocaleUpperCase(e.locale):l.toUpperCase();const h=e?.locale?.startsWith("de")?ee(l):l;return e?.locale?h.toLocaleLowerCase(e.locale):h.toLowerCase()}),a=z(o,e?.joiner??"-");return s&&r&&n.set(r,a),a},re=new I(1e3),oe=(t,e)=>G(t,{cacheStore:re,...e,joiner:"_",toUpperCase:!0}),ie=(t,e)=>typeof t!="string"||!t?"":z(R(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(n=>q(n.toLowerCase(),{locale:e?.locale})),""),le=new I(1e3),ae=(t,e)=>G(t,{cacheStore:le,...e,joiner:"_"}),ce=(t,e)=>typeof t!="string"?"":z(R(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(n=>q(n,{locale:e?.locale})),"-"),b=t=>t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"?String(t):JSON.stringify(t),Z={camel_case:t=>ne(b(t)),kebab_case:t=>G(b(t)),lower_case:t=>b(t).toLowerCase(),pascal_case:t=>ie(b(t)),path_join:(t,...e)=>{const s=[b(t),...e.map(n=>b(n))];return st(...s)},path_relative:(t,e)=>nt(b(e),b(t)),snake_case:t=>ae(b(t)),upper_case:t=>b(t).toUpperCase(),upper_kebab_case:t=>ce(b(t)),upper_snake_case:t=>oe(b(t))},ct=(t,e,s=[])=>{const n=Z[t];if(!n)throw new Error(`Unknown filter "${t}". Known filters: ${Object.keys(Z).sort().join(", ")}.`);return n(e,...s)},ft=t=>{const e=[];let s=0,n=0,r,o=-1;for(const a of t){if(o+=1,r){a===r&&(r=void 0);continue}if(a==='"'||a==="'"){r=a;continue}a==="("?s+=1:a===")"?s-=1:a===","&&s===0&&(e.push(t.slice(n,o)),n=o+1)}return e.push(t.slice(n)),e},fe=t=>{if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1)},ue=/\[([^\]]+)\]/g,pe=t=>{const e=t.trim(),s=e.indexOf("(");if(s===-1)return{args:[],name:e};if(!e.endsWith(")"))throw new Error(`Filter call "${t}" missing closing ")"`);const n=e.slice(0,s).trim(),r=e.slice(s+1,-1).trim();return r===""?{args:[],name:n}:{args:ft(r).map(a=>{const l=a.trim();return fe(l)??l}),name:n}},he=t=>{const e=t.split("|").map(r=>r.trim()),s=e[0]??"";if(!s)throw new Error(`Empty variable name in expression "${t}"`);return{filters:e.slice(1).map(r=>pe(r)),name:s}},de=t=>t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"?String(t):JSON.stringify(t),me=(t,e)=>{const s=t.replaceAll(ue,(n,r)=>{const{filters:o,name:a}=he(r);if(!Object.hasOwn(e,a))throw new Error(`Variable "${a}" used in filename "${t}" but not defined`);let l=e[a];for(const h of o)l=ct(h.name,l,h.args);return de(l)});return ut(s)},ut=t=>t.split("/").map(e=>e.endsWith(".tera")||e.endsWith(".twig")?e.slice(0,-5):e).join("/"),ge=t=>t.endsWith(".raw")?t.slice(0,-4):t,ye=t=>{const e=t.split("/");return(e.at(-1)??"").startsWith("_")?!0:e.slice(0,-1).includes("partials")},k="---",we=(t,e)=>{if(!t.startsWith(`${k}
2
2
  `)&&!t.startsWith(`${k}\r
3
3
  `))return{body:t};const s=t.indexOf(`
4
4
  ${k}`,k.length);if(s===-1)return{body:t};let n=s+1+k.length;t[n]==="\r"&&(n+=1),t[n]===`
@@ -1,4 +1,4 @@
1
- import{p as s}from"./cli-main.js";import{c as a,f as c}from"../packem_shared/registry-keys-BEhcTEZZ.js";const f=async({options:r})=>{if(r.clear){const t=a();if(r.json){process.stdout.write(`${JSON.stringify({cleared:t,refetched:!1},void 0,2)}
1
+ import{p as s}from"./cli-main.js";import{c as a,f as c}from"../packem_shared/registry-keys-Cq92YoCx.js";const f=async({options:r})=>{if(r.clear){const t=a();if(r.json){process.stdout.write(`${JSON.stringify({cleared:t,refetched:!1},void 0,2)}
2
2
  `);return}s.success(t?"Cleared cached npm signing keys.":"No cached npm signing keys to clear.");return}const e=await c({forceRefresh:!0});if(e===void 0){if(r.json){process.stdout.write(`${JSON.stringify({cleared:!1,error:"fetch-failed",refetched:!1},void 0,2)}
3
3
  `),process.exitCode=1;return}s.error("Failed to fetch npm signing keys (network error and no cached keys available)."),process.exitCode=1;return}if(r.json){process.stdout.write(`${JSON.stringify({cleared:!1,fromCache:e.fromCache,keyCount:e.keys.length,refetched:!e.fromCache,stale:e.stale??!1},void 0,2)}
4
4
  `);return}if(e.fromCache&&e.stale===!0){s.warn(`Network fetch failed — falling back to expired cache (${String(e.keys.length)} keys).`);return}s.success(`Refreshed npm signing keys (${String(e.keys.length)} keys).`)};export{f as default};
@@ -1,3 +1,3 @@
1
- import{createRequire as _}from"node:module";import{m as R,p as t,n as x}from"./cli-main.js";import{d as P}from"../packem_shared/pm-runner-Dboj-wZG.js";import{a as M}from"../packem_shared/build-scripts-DtqsovcF.js";import{e as v}from"../packem_shared/index-0dnGN3GP.js";import{y as k}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as q}from"../packem_shared/package-version-B-FGASyU.js";let j;const B=c=>(j??=_(import.meta.url))(c),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,D=c=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[i,f]=y.versions.node.split(".").map(Number);if(i>22||i===22&&f>=3||i===20&&f>=16)return y.getBuiltinModule(c)}return B(c)},{readdirSync:S,statSync:N}=D("node:fs"),T=(c,i={})=>{const f=v(c,"node_modules");if(!k(f))return[];const l=new Map,p=new Set,b=(n,o,r)=>{const e=`${o}@${r}`;if(p.has(e))return;p.add(e);const s=r.startsWith(c)?r.slice(c.length+1):r;let u=l.get(n);u||(u=[],l.set(n,u)),u.some($=>$.name===o)||u.push({name:o,relativePath:s})},m=(n,o="")=>{let r;try{r=S(n)}catch{return}for(const e of r){const s=v(n,e);if(e.startsWith("@")){m(s,`${e}/`);continue}if(e===".pnpm"&&o===""){let a;try{a=S(s)}catch{continue}for(const d of a){const g=v(s,d,"node_modules");k(g)&&m(g)}continue}if(e.startsWith("."))continue;const u=o+e,$=v(s,"package.json");try{if(!N(s).isDirectory()||!k($))continue;const a=q($),d=typeof a.name=="string"?a.name:u;if(typeof a.bin=="string"){const w=d.includes("/")?d.split("/").pop():d;b(w,d,s)}else if(a.bin&&typeof a.bin=="object")for(const w of Object.keys(a.bin))b(w,d,s);const g=v(s,"node_modules");k(g)&&m(g)}catch{}}};m(f);const h=[];for(const[n,o]of l)o.length<2||i[n]===!0||o.every(e=>i[`${e.name}#${n}`]===!0)||h.push({bin:n,packages:o});return h.sort((n,o)=>n.bin.localeCompare(o.bin))},V=new Set(["bun","npm","pnpm","yarn"]),F=({options:c,visConfig:i,workspaceRoot:f})=>{const l=f??process.cwd(),p=P(l),b=i?.security?.policies?.installScripts?.allow??{},m=i?.security?.allowBins??{},h=i?.security?.pinVersions===!0,n=M(l,b,{pinVersions:h}),o=T(l,m),r=i&&V.has(p.name)?R(i,p.name,l):void 0;if(c.json){process.stdout.write(`${JSON.stringify({binConflicts:o,drift:r,excess:n.excess,installed:n.installed.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),packageManager:p.name,pinVersions:h,unapproved:n.unapproved.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),versionDrift:n.versionDrift},void 0,2)}
1
+ import{createRequire as _}from"node:module";import{m as R,p as t,n as x}from"./cli-main.js";import{d as P}from"../packem_shared/pm-runner-BXRi4ZM9.js";import{a as M}from"../packem_shared/build-scripts-wF0ykoin.js";import{e as v}from"../packem_shared/index-0dnGN3GP.js";import{y as k}from"../packem_shared/isAccessibleSync-DYKTrrvc-CBsMZhj-.js";import{p as q}from"../packem_shared/package-version-BzkcrNVE.js";let j;const B=c=>(j??=_(import.meta.url))(c),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,D=c=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[i,f]=y.versions.node.split(".").map(Number);if(i>22||i===22&&f>=3||i===20&&f>=16)return y.getBuiltinModule(c)}return B(c)},{readdirSync:S,statSync:N}=D("node:fs"),T=(c,i={})=>{const f=v(c,"node_modules");if(!k(f))return[];const l=new Map,p=new Set,b=(n,o,r)=>{const e=`${o}@${r}`;if(p.has(e))return;p.add(e);const s=r.startsWith(c)?r.slice(c.length+1):r;let u=l.get(n);u||(u=[],l.set(n,u)),u.some($=>$.name===o)||u.push({name:o,relativePath:s})},m=(n,o="")=>{let r;try{r=S(n)}catch{return}for(const e of r){const s=v(n,e);if(e.startsWith("@")){m(s,`${e}/`);continue}if(e===".pnpm"&&o===""){let a;try{a=S(s)}catch{continue}for(const d of a){const g=v(s,d,"node_modules");k(g)&&m(g)}continue}if(e.startsWith("."))continue;const u=o+e,$=v(s,"package.json");try{if(!N(s).isDirectory()||!k($))continue;const a=q($),d=typeof a.name=="string"?a.name:u;if(typeof a.bin=="string"){const w=d.includes("/")?d.split("/").pop():d;b(w,d,s)}else if(a.bin&&typeof a.bin=="object")for(const w of Object.keys(a.bin))b(w,d,s);const g=v(s,"node_modules");k(g)&&m(g)}catch{}}};m(f);const h=[];for(const[n,o]of l)o.length<2||i[n]===!0||o.every(e=>i[`${e.name}#${n}`]===!0)||h.push({bin:n,packages:o});return h.sort((n,o)=>n.bin.localeCompare(o.bin))},V=new Set(["bun","npm","pnpm","yarn"]),F=({options:c,visConfig:i,workspaceRoot:f})=>{const l=f??process.cwd(),p=P(l),b=i?.security?.policies?.installScripts?.allow??{},m=i?.security?.allowBins??{},h=i?.security?.pinVersions===!0,n=M(l,b,{pinVersions:h}),o=T(l,m),r=i&&V.has(p.name)?R(i,p.name,l):void 0;if(c.json){process.stdout.write(`${JSON.stringify({binConflicts:o,drift:r,excess:n.excess,installed:n.installed.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),packageManager:p.name,pinVersions:h,unapproved:n.unapproved.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),versionDrift:n.versionDrift},void 0,2)}
2
2
  `);return}if(t.info(`Build-script status (${p.name}):
3
3
  `),n.installed.length===0&&n.unapproved.length===0&&t.success(" No installed packages declare lifecycle scripts."),n.installed.length>0){t.success(` Approved (${String(n.installed.length)}):`);for(const e of n.installed)t.info(` ✓ ${e.name} — ${e.hooks.join(", ")}`)}if(n.unapproved.length>0){t.info(""),t.warn(` Unapproved (${String(n.unapproved.length)}):`);for(const e of n.unapproved)t.info(` ✗ ${e.name} — ${e.hooks.join(", ")}`);t.notice(" Run 'vis approve-builds' to review.")}if(n.excess.length>0){t.info(""),t.warn(` Stale allowlist entries (${String(n.excess.length)}):`);for(const e of n.excess)t.info(` ! ${e}`);t.notice(" Remove these from vis.config.ts security.policies.installScripts.allow.")}if(n.versionDrift.length>0){t.info(""),t.warn(` Version drift (pinVersions: true) — ${String(n.versionDrift.length)} entr${n.versionDrift.length===1?"y":"ies"} point at outdated versions:`);for(const{from:e,to:s}of n.versionDrift)t.info(` ${e} → ${s}`);t.notice(" Update vis.config.ts security.policies.installScripts.allow keys to migrate.")}if(o.length>0){t.info(""),t.warn(` Bin conflicts (${String(o.length)}) — multiple packages expose the same bin name:`);for(const e of o)t.info(` ${e.bin} ← ${e.packages.map(s=>s.name).join(", ")}`);t.notice(" Add the bin (or 'pkg#bin') to vis.config.ts security.allowBins to silence this.")}if(r?.hasDrift){t.info("");for(const e of x(r))t.warn(e)}};export{F as default};
@@ -1,4 +1,4 @@
1
- import{createRequire as f}from"node:module";import{d as p,c as I}from"../packem_shared/pm-runner-Dboj-wZG.js";let _;const w=e=>(_??=f(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,g=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,r]=o.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return o.getBuiltinModule(e)}return w(e)},{createInterface:y}=g("node:readline"),s="sigstore",v=()=>!!process.stdout.isTTY&&process.env.CI!=="true",$=e=>new Promise(t=>{const r=y({input:process.stdin,output:process.stderr});r.question(`${e} (Y/n) `,a=>{r.close();const n=a.trim().toLowerCase();t(n===""||n==="y"||n==="yes")})}),h=e=>{const t=p(e),r=I(t,{exact:!1,filter:[],global:!1,optional:!1,packages:[s],peer:!1,saveDev:!0,workspace:!1,workspaceRoot:!1},e,console);return Promise.resolve({exitCode:r})},C=()=>{try{return import.meta.resolve(s),!0}catch{return!1}},R=e=>{let t="pnpm";try{t=p(e).name}catch{}switch(t){case"bun":return`bun add -d ${s}`;case"npm":return`npm install -D ${s}`;case"yarn":return`yarn add -D ${s}`;default:return`pnpm add -D ${s}`}},D=()=>import("sigstore"),E=async(e={})=>{const t=e.interactive??v(),r=e.prompt??$,a=e.runInstall??h,n=e.importImpl??D,l=e.workspaceRoot??process.cwd(),i=R(l);try{return await n()}catch(d){const{code:u,message:m}=d;if(!(u==="ERR_MODULE_NOT_FOUND"||u==="MODULE_NOT_FOUND")||!m.includes(s))throw d}if(!t)throw new Error(`${s} is not installed. \`vis attest\` needs it for keyless signing/verification. Install it in your repo first:
1
+ import{createRequire as f}from"node:module";import{d as p,c as I}from"../packem_shared/pm-runner-BXRi4ZM9.js";let _;const w=e=>(_??=f(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,g=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,r]=o.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return o.getBuiltinModule(e)}return w(e)},{createInterface:y}=g("node:readline"),s="sigstore",v=()=>!!process.stdout.isTTY&&process.env.CI!=="true",$=e=>new Promise(t=>{const r=y({input:process.stdin,output:process.stderr});r.question(`${e} (Y/n) `,a=>{r.close();const n=a.trim().toLowerCase();t(n===""||n==="y"||n==="yes")})}),h=e=>{const t=p(e),r=I(t,{exact:!1,filter:[],global:!1,optional:!1,packages:[s],peer:!1,saveDev:!0,workspace:!1,workspaceRoot:!1},e,console);return Promise.resolve({exitCode:r})},C=()=>{try{return import.meta.resolve(s),!0}catch{return!1}},R=e=>{let t="pnpm";try{t=p(e).name}catch{}switch(t){case"bun":return`bun add -d ${s}`;case"npm":return`npm install -D ${s}`;case"yarn":return`yarn add -D ${s}`;default:return`pnpm add -D ${s}`}},D=()=>import("sigstore"),E=async(e={})=>{const t=e.interactive??v(),r=e.prompt??$,a=e.runInstall??h,n=e.importImpl??D,l=e.workspaceRoot??process.cwd(),i=R(l);try{return await n()}catch(d){const{code:u,message:m}=d;if(!(u==="ERR_MODULE_NOT_FOUND"||u==="MODULE_NOT_FOUND")||!m.includes(s))throw d}if(!t)throw new Error(`${s} is not installed. \`vis attest\` needs it for keyless signing/verification. Install it in your repo first:
2
2
  ${i}`);if(!await r(`${s} isn't installed. Install it now?`))throw new Error(`${s} install declined. Re-run \`vis attest\` after installing manually:
3
3
  ${i}`);const c=await a(l);if(c.exitCode!==0)throw new Error(`Install of ${s} failed (exit ${String(c.exitCode)}). Install manually and retry:
4
4
  ${i}`);return await n()};export{R as installCommandFor,C as isSigstoreInstalled,E as loadOptionalSigstore};
@@ -1,2 +1,2 @@
1
- import{normaliseGroup as d}from"../release/types.js";const p=r=>r==="debug",u=r=>/[\\/]/.test(r)||/\.(?:pem|gpg|key|asc|p12|pfx)$/i.test(r)||r.length<8?"(key: configured)":`…${r.slice(-4)}`,i=r=>{try{const a=new URL(r);a.username="",a.password="";const n=a.pathname!==""&&a.pathname!=="/"?"/…REDACTED…":"";return`${a.origin}${n}`}catch{return r.replace(/(:\/\/)[^@/]+@/,"$1")||"[REDACTED]"}},m=r=>{if(!r)return r;const a={};for(const n of Object.keys(r))a[n]="[REDACTED]";return a},h=r=>{const a=structuredClone(r);if(a.signing?.key&&(a.signing={...a.signing,key:u(a.signing.key)}),a.httpProxy&&(a.httpProxy=i(a.httpProxy)),a.notifications){const n=a.notifications,o=s=>({...s,webhook:i(s.webhook)}),t=s=>({...s,webhook:i(s.webhook)}),e=s=>({...s,headers:m(s.headers),url:i(s.url)});n.slack&&(n.slack=Array.isArray(n.slack)?n.slack.map(s=>o(s)):o(n.slack)),n.discord&&(n.discord=Array.isArray(n.discord)?n.discord.map(s=>t(s)):t(n.discord)),n.webhook&&(n.webhook=Array.isArray(n.webhook)?n.webhook.map(s=>e(s)):e(n.webhook))}return a},g=r=>r&&r.map(a=>d(a)),b=(r,a,n)=>{const o=r.printConfig;if(o===void 0||o===!1||o==="")return!1;const t=p(o),e=h(a.config),s=e.gitUser?{...e.gitUser,email:e.gitUser.email?"[REDACTED]":e.gitUser.email}:e.gitUser,c={access:e.access,aggregateRelease:e.aggregateRelease,allowCustomCommands:e.allowCustomCommands,baseBranch:e.baseBranch,bumpDevDependencies:e.bumpDevDependencies,bumpMinorPreMajor:e.bumpMinorPreMajor,bumpPatchForMinorPreMajor:e.bumpPatchForMinorPreMajor,changelog:e.changelog,changesDir:e.changesDir,channels:e.channels,defaultManaged:e.defaultManaged,detectCatalogChanges:e.detectCatalogChanges,fixed:g(e.fixed),floatingMajorTag:e.floatingMajorTag,githubHost:e.githubHost,gitlabHost:e.gitlabHost,gitUser:s,httpProxy:e.httpProxy,ignore:e.ignore,include:e.include,linked:g(e.linked),notifications:e.notifications,postPublishCommand:e.postPublishCommand,postVersionCommand:e.postVersionCommand,prePublishCommand:e.prePublishCommand,preVersionCommand:e.preVersionCommand,privatePackages:e.privatePackages,provider:e.provider,publish:e.publish,releaseNoteTemplate:e.releaseNoteTemplate,releaseTagPattern:e.releaseTagPattern,signing:e.signing,snapshot:e.snapshot,successWalk:e.successWalk,updateInternalDependencies:e.updateInternalDependencies,versionPr:e.versionPr};return t&&(c.__resolved__={branch:a.branch,channel:a.channel,cwd:a.cwd,packageCount:a.packages.length,packageManager:a.pm.id,packageNames:a.packages.map(l=>l.name).sort(),perPackageConfigKeys:[...a.perPackageConfig.keys()].sort()}),process.stdout.write(`${JSON.stringify(c,null,2)}
1
+ import{normaliseGroup as d}from"../release/types.js";const p=r=>r==="debug",u=r=>/[\\/]/.test(r)||/\.(?:pem|gpg|key|asc|p12|pfx)$/i.test(r)||r.length<8?"(key: configured)":`…${r.slice(-4)}`,i=r=>{try{const a=new URL(r);a.username="",a.password="";const n=a.pathname!==""&&a.pathname!=="/"?"/…REDACTED…":"";return`${a.origin}${n}`}catch{return r.replace(/(:\/\/)[^@/]+@/,"$1")||"[REDACTED]"}},m=r=>{if(!r)return r;const a={};for(const n of Object.keys(r))a[n]="[REDACTED]";return a},h=r=>{const a=structuredClone(r);if(a.signing?.key&&(a.signing={...a.signing,key:u(a.signing.key)}),a.httpProxy&&(a.httpProxy=i(a.httpProxy)),a.notifications){const n=a.notifications,o=s=>({...s,webhook:i(s.webhook)}),t=s=>({...s,webhook:i(s.webhook)}),e=s=>({...s,headers:m(s.headers),url:i(s.url)});n.slack&&(n.slack=Array.isArray(n.slack)?n.slack.map(s=>o(s)):o(n.slack)),n.discord&&(n.discord=Array.isArray(n.discord)?n.discord.map(s=>t(s)):t(n.discord)),n.webhook&&(n.webhook=Array.isArray(n.webhook)?n.webhook.map(s=>e(s)):e(n.webhook))}return a},g=r=>r&&r.map(a=>d(a)),b=(r,a,n)=>{const o=r.printConfig;if(o===void 0||o===!1||o==="")return!1;const t=p(o),e=h(a.config),s=e.gitUser?{...e.gitUser,email:e.gitUser.email?"[REDACTED]":e.gitUser.email}:e.gitUser,c={access:e.access,aggregateRelease:e.aggregateRelease,allowCustomCommands:e.allowCustomCommands,baseBranch:e.baseBranch,bumpDevDependencies:e.bumpDevDependencies,bumpMinorPreMajor:e.bumpMinorPreMajor,bumpPatchForMinorPreMajor:e.bumpPatchForMinorPreMajor,changelog:e.changelog,changesDir:e.changesDir,channels:e.channels,defaultManaged:e.defaultManaged,detectCatalogChanges:e.detectCatalogChanges,fixed:g(e.fixed),floatingMajorTag:e.floatingMajorTag,githubHost:e.githubHost,gitlabHost:e.gitlabHost,gitUser:s,httpProxy:e.httpProxy,ignore:e.ignore,include:e.include,internalDependencyRanges:e.internalDependencyRanges,linked:g(e.linked),notifications:e.notifications,postPublishCommand:e.postPublishCommand,postVersionCommand:e.postVersionCommand,prePublishCommand:e.prePublishCommand,preVersionCommand:e.preVersionCommand,privatePackages:e.privatePackages,provider:e.provider,publish:e.publish,releaseNoteTemplate:e.releaseNoteTemplate,releaseTagPattern:e.releaseTagPattern,signing:e.signing,snapshot:e.snapshot,successWalk:e.successWalk,updateInternalDependencies:e.updateInternalDependencies,versionPr:e.versionPr};return t&&(c.__resolved__={branch:a.branch,channel:a.channel,cwd:a.cwd,packageCount:a.packages.length,packageManager:a.pm.id,packageNames:a.packages.map(l=>l.name).sort(),perPackageConfigKeys:[...a.perPackageConfig.keys()].sort()}),process.stdout.write(`${JSON.stringify(c,null,2)}
2
2
  `),!0};export{b as printConfigIfRequested};
@@ -1,3 +1,3 @@
1
- import{p as o}from"./cli-main.js";import{r as f}from"../packem_shared/advisories-3ZfSV0LH.js";const d=async({fs:c,logger:u,options:r,workspaceRoot:t})=>{if(!t)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const e=r.db??f(t),s=r.format==="json";if(!r.force){o.warn(`Prune is destructive. Will remove: ${e}`),o.info("Re-run with --force to proceed."),s&&process.stdout.write(`${JSON.stringify({dbPath:e,reason:"needs --force",removed:!1})}
1
+ import{p as o}from"./cli-main.js";import{r as f}from"../packem_shared/advisories-DyHTz-me.js";const d=async({fs:c,logger:u,options:r,workspaceRoot:t})=>{if(!t)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const e=r.db??f(t),s=r.format==="json";if(!r.force){o.warn(`Prune is destructive. Will remove: ${e}`),o.info("Re-run with --force to proceed."),s&&process.stdout.write(`${JSON.stringify({dbPath:e,reason:"needs --force",removed:!1})}
2
2
  `);return}const a=[e,`${e}-wal`,`${e}-shm`,`${e}-journal`],i=[];for(const n of a)try{await c.rm(n,{force:!0}),i.push(n)}catch{}if(s){process.stdout.write(`${JSON.stringify({dbPath:e,files:i,removed:!0})}
3
3
  `);return}o.success(`Removed ${e}.`)},v=d;export{v as advisoriesPruneExecute};
@@ -1 +1 @@
1
- import{createRequire as F}from"node:module";import D from"./index.js";import{VisReleaseError as h}from"../packem_shared/VisReleaseError-DZtgcKf8.js";import{c as j}from"./cargo-lock.js";import{e as M,a as V}from"./index3.js";let L;const $=o=>(L??=F(import.meta.url))(o),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,P=o=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[t,n]=l.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return l.getBuiltinModule(o)}return $(o)},{readFile:x}=P("node:fs/promises"),{join:g,resolve:C}=P("node:path"),z="Private :: Do Not Upload",I=o=>o.toLowerCase().replaceAll(/[-_.]+/g,"-"),d=o=>Array.isArray(o)?o.filter(t=>typeof t=="string"):[],A=async o=>{try{return await x(o,"utf8")}catch{return}},N=async(o,t)=>{const{parse:n}=await import("./index4.js");try{return n(o)}catch(c){throw new h({cause:c,code:"CONFIG_INVALID",file:t,message:`Failed to parse ${t}: ${c.message}`})}},O=o=>{const t=/^\s*([A-Z0-9](?:[\w.-]*[A-Z0-9])?)\s*(?:\[[^\]]*\])?\s*(.*?)\s*$/i.exec(o);if(!t)return;const n=(t[2]??"").split(";")[0].trim();return{name:t[1],specifier:n}},B=async o=>{const{claimedDirs:t,cwd:n}=o,c=g(n,"pyproject.toml"),w=await A(c);if(w===void 0)return[];const f=await N(w,c),u=new Set;f.project&&u.add(n);const b=d(f.tool?.uv?.workspace?.exclude);for(const e of d(f.tool?.uv?.workspace?.members))for(const s of await M(n,e)){const a=s.slice(n.length+1).split("\\").join("/");b.some(i=>D(i,a))||u.add(C(s))}const v=[],R=new Set([...t].map(e=>j(e)));for(const e of[...u].sort()){if(V(j(e),R))continue;const s=g(e,"pyproject.toml"),a=await A(s);if(a===void 0)continue;const i=await N(a,s);if(!i.project)continue;const{dynamic:y,name:r,version:p}=i.project;if(typeof r!="string"||r==="")throw new h({code:"CONFIG_INVALID",file:s,message:`${s} has no [project].name.`});if(typeof p!="string"){const m=d(y).includes("version")?"a dynamic version":"no [project].version";throw new h({code:"CONFIG_INVALID",file:s,message:`${s} has ${m}; vis can only release a literal version. Pin it in pyproject.toml or leave the project out of release.python.`})}v.push({dir:e,doc:i,manifestPath:s,name:r,private:d(i.project.classifiers).includes(z),version:p})}const q=new Map(v.map(e=>[I(e.name),e.name]));return v.map(e=>{const s={},a=e.doc.tool?.uv?.sources??{};for(const y of d(e.doc.project?.dependencies)){const r=O(y);if(!r)continue;const p=I(r.name),m=a[r.name]??a[p],_=q.get(p);_!==void 0&&typeof m=="object"&&m!==null&&m.workspace===!0&&(s[_]=r.specifier===""?"*":r.specifier)}const i={dependencies:s,name:e.name,private:e.private,version:e.version};return{dir:e.dir,ecosystem:"python",manifest:i,manifestPath:e.manifestPath,name:e.name,private:e.private,version:e.version}})};export{B as discoverPythonProjects,I as normalizePythonName,N as parsePyproject,O as splitRequirement};
1
+ import{createRequire as F}from"node:module";import D from"./index.js";import{VisReleaseError as h}from"../packem_shared/VisReleaseError-DZtgcKf8.js";import{a as j}from"./cargo-lock.js";import{e as M,a as V}from"./index3.js";let L;const $=o=>(L??=F(import.meta.url))(o),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,P=o=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[t,n]=l.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return l.getBuiltinModule(o)}return $(o)},{readFile:x}=P("node:fs/promises"),{join:g,resolve:C}=P("node:path"),z="Private :: Do Not Upload",I=o=>o.toLowerCase().replaceAll(/[-_.]+/g,"-"),d=o=>Array.isArray(o)?o.filter(t=>typeof t=="string"):[],A=async o=>{try{return await x(o,"utf8")}catch{return}},N=async(o,t)=>{const{parse:n}=await import("./index4.js");try{return n(o)}catch(c){throw new h({cause:c,code:"CONFIG_INVALID",file:t,message:`Failed to parse ${t}: ${c.message}`})}},O=o=>{const t=/^\s*([A-Z0-9](?:[\w.-]*[A-Z0-9])?)\s*(?:\[[^\]]*\])?\s*(.*?)\s*$/i.exec(o);if(!t)return;const n=(t[2]??"").split(";")[0].trim();return{name:t[1],specifier:n}},B=async o=>{const{claimedDirs:t,cwd:n}=o,c=g(n,"pyproject.toml"),w=await A(c);if(w===void 0)return[];const f=await N(w,c),u=new Set;f.project&&u.add(n);const b=d(f.tool?.uv?.workspace?.exclude);for(const e of d(f.tool?.uv?.workspace?.members))for(const s of await M(n,e)){const a=s.slice(n.length+1).split("\\").join("/");b.some(i=>D(i,a))||u.add(C(s))}const v=[],R=new Set([...t].map(e=>j(e)));for(const e of[...u].sort()){if(V(j(e),R))continue;const s=g(e,"pyproject.toml"),a=await A(s);if(a===void 0)continue;const i=await N(a,s);if(!i.project)continue;const{dynamic:y,name:r,version:p}=i.project;if(typeof r!="string"||r==="")throw new h({code:"CONFIG_INVALID",file:s,message:`${s} has no [project].name.`});if(typeof p!="string"){const m=d(y).includes("version")?"a dynamic version":"no [project].version";throw new h({code:"CONFIG_INVALID",file:s,message:`${s} has ${m}; vis can only release a literal version. Pin it in pyproject.toml or leave the project out of release.python.`})}v.push({dir:e,doc:i,manifestPath:s,name:r,private:d(i.project.classifiers).includes(z),version:p})}const q=new Map(v.map(e=>[I(e.name),e.name]));return v.map(e=>{const s={},a=e.doc.tool?.uv?.sources??{};for(const y of d(e.doc.project?.dependencies)){const r=O(y);if(!r)continue;const p=I(r.name),m=a[r.name]??a[p],_=q.get(p);_!==void 0&&typeof m=="object"&&m!==null&&m.workspace===!0&&(s[_]=r.specifier===""?"*":r.specifier)}const i={dependencies:s,name:e.name,private:e.private,version:e.version};return{dir:e.dir,ecosystem:"python",manifest:i,manifestPath:e.manifestPath,name:e.name,private:e.private,version:e.version}})};export{B as discoverPythonProjects,I as normalizePythonName,N as parsePyproject,O as splitRequirement};