@visulima/vis 1.0.0-alpha.44 → 1.0.0-alpha.46
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.
- package/CHANGELOG.md +57 -0
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/packem_chunks/CONFIG_FILES.js +3 -3
- package/dist/packem_chunks/agent-instructions.js +11 -0
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/catalog.js +63 -62
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +172 -973
- package/dist/packem_chunks/defineReleasePlugin.js +3 -0
- package/dist/packem_chunks/detect.js +1 -1
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/group-tags.js +1 -0
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +1 -1
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +2 -2
- package/dist/packem_chunks/handler13.js +1 -1
- package/dist/packem_chunks/handler14.js +1 -1
- package/dist/packem_chunks/handler15.js +1 -1
- package/dist/packem_chunks/handler16.js +1 -1
- package/dist/packem_chunks/handler17.js +1 -1
- package/dist/packem_chunks/handler18.js +1 -1
- package/dist/packem_chunks/handler19.js +1 -1
- package/dist/packem_chunks/handler20.js +1 -1
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler26.js +1 -1
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +1 -1
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +1 -1
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler32.js +1 -1
- package/dist/packem_chunks/handler4.js +1 -1
- package/dist/packem_chunks/handler40.js +19 -19
- package/dist/packem_chunks/handler5.js +3 -3
- package/dist/packem_chunks/handler50.js +4 -4
- package/dist/packem_chunks/handler51.js +3 -3
- package/dist/packem_chunks/handler54.js +1 -1
- package/dist/packem_chunks/handler57.js +11 -5
- package/dist/packem_chunks/handler58.js +5 -11
- package/dist/packem_chunks/handler59.js +11 -3
- package/dist/packem_chunks/handler6.js +6 -6
- package/dist/packem_chunks/handler60.js +3 -22
- package/dist/packem_chunks/handler61.js +21 -60
- package/dist/packem_chunks/handler62.js +61 -3
- package/dist/packem_chunks/handler63.js +3 -6
- package/dist/packem_chunks/handler64.js +6 -9
- package/dist/packem_chunks/handler65.js +9 -2
- package/dist/packem_chunks/handler66.js +2 -24
- package/dist/packem_chunks/handler67.js +24 -25
- package/dist/packem_chunks/handler68.js +25 -153
- package/dist/packem_chunks/handler69.js +153 -10
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +10 -23
- package/dist/packem_chunks/handler71.js +23 -322
- package/dist/packem_chunks/handler72.js +273 -659
- package/dist/packem_chunks/handler73.js +708 -48
- package/dist/packem_chunks/handler74.js +48 -27
- package/dist/packem_chunks/handler75.js +27 -3
- package/dist/packem_chunks/handler76.js +3 -190
- package/dist/packem_chunks/handler77.js +189 -37
- package/dist/packem_chunks/handler78.js +38 -0
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +1 -1
- package/dist/packem_chunks/heal.js +1 -1
- package/dist/packem_chunks/help-command.js +1 -1
- package/dist/packem_chunks/index2.js +802 -7
- package/dist/packem_chunks/index3.js +7 -135
- package/dist/packem_chunks/index4.js +134 -73
- package/dist/packem_chunks/index5.js +74 -0
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +1 -1
- package/dist/packem_chunks/list.js +1 -1
- package/dist/packem_chunks/loader.js +1 -1
- package/dist/packem_chunks/orchestrator.js +26 -23
- package/dist/packem_chunks/print-config.js +1 -1
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/registry.js +2 -2
- package/dist/packem_chunks/shell-runner.js +1 -1
- package/dist/packem_chunks/state.js +3 -3
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/sync.js +1 -1
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +2 -2
- package/dist/packem_chunks/ts-loader.js +1 -1
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_chunks/version-resolver.js +2 -2
- package/dist/packem_shared/ReleaseClient-BY4OZNCK.js +1 -0
- package/dist/packem_shared/{advisories-CefYKEPe.js → advisories-B76fBVL-.js} +1 -1
- package/dist/packem_shared/affected-shas-CCxG4tvm.js +1 -0
- package/dist/packem_shared/{ai-analysis-CO6S0afy.js → ai-analysis-DF_AfeS3.js} +4 -4
- package/dist/packem_shared/{ai-fix-CI0Vvqld.js → ai-fix-D1bFLkfk.js} +3 -3
- package/dist/packem_shared/bin-BlGVEhl8.js +1 -0
- package/dist/packem_shared/{build-scripts-MTSK6TNr.js → build-scripts-q__dKE2y.js} +1 -1
- package/dist/packem_shared/{command-runtime-BE-vKsGH.js → command-runtime-3FTGuUsK.js} +1 -1
- package/dist/packem_shared/{cyclonedx-BeUmPgfO.js → cyclonedx-CmrYQ0vx.js} +1 -1
- package/dist/packem_shared/{docker-CViFYtmM.js → docker-BYqiD711.js} +1 -1
- package/dist/packem_shared/{env-C2ZCnfP_.js → env-DJlbJiFh.js} +2 -2
- package/dist/packem_shared/{failure-log-jFfZRJK9.js → failure-log-Bt7sW4p7.js} +1 -1
- package/dist/packem_shared/{index-D7EZ612R.js → index-C6tpgeIV.js} +2 -2
- package/dist/packem_shared/{index-CQjzW7m8.js → index-D6fJJDli.js} +1 -1
- package/dist/packem_shared/{lifecycle-Dyb47wbD.js → lifecycle-XeMei1ED.js} +1 -1
- package/dist/packem_shared/{manifests-WBnsV_Eb.js → manifests-DSBr3-dw.js} +1 -1
- package/dist/packem_shared/{native-config-sync-BFDVK9LH.js → native-config-sync-D-z2Uwqu.js} +1 -1
- package/dist/packem_shared/{osv-bloom-BsQ-aFiM.js → osv-bloom-DMhXP184.js} +2 -2
- package/dist/packem_shared/{packument-DquNPIq9.js → packument-CY2QDFml.js} +1 -1
- package/dist/packem_shared/plugins.d-ND23R9I3.d.ts +4 -0
- package/dist/packem_shared/pm-runner-CQcraCcu.js +1 -0
- package/dist/packem_shared/{provenance-DIq8KyBV.js → provenance-DVHiWZrW.js} +1 -1
- package/dist/packem_shared/{registry-keys-C8K11ets.js → registry-keys-BKEq72qX.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-Dr4kIybR.js → resolve-explicit-UtkNrGKq.js} +1 -1
- package/dist/packem_shared/resolve-runtime-QRaQucfL.js +1 -0
- package/dist/packem_shared/{runtime-check-BXehSP06.js → runtime-check-qnrPTlma.js} +1 -1
- package/dist/packem_shared/{s1ngularity-CtMmtXJo.js → s1ngularity-DUZtU95L.js} +1 -1
- package/dist/packem_shared/scan-progress-BgtHexnt.js +2 -0
- package/dist/packem_shared/{signatures-CE8OAK-i.js → signatures-QoCuUv9E.js} +1 -1
- package/dist/packem_shared/target-merge-Dg25Izl5.js +11 -0
- package/dist/packem_shared/{toolchain-C44mPKPu.js → toolchain-Zb3VzZb4.js} +1 -1
- package/dist/packem_shared/{typosquats-CQz-1Y6K.js → typosquats-C12CP_2G.js} +1 -1
- package/dist/packem_shared/use-measured-height-BpKmrlkw.js +1 -0
- package/dist/packem_shared/{vis-update-app-Cpme_3Du.js → vis-update-app-BoCQ4ute.js} +1 -1
- package/dist/packem_shared/{watch-loop-JfGKIgKB.js → watch-loop-BZudYfcl.js} +1 -1
- package/dist/release/index.d.ts +39 -2
- package/dist/release/index.js +1 -1
- package/dist/release/plugin-sdk.d.ts +2 -1
- package/dist/release/plugin-sdk.js +1 -1
- package/dist/release/types.d.ts +117 -1
- package/dist/release/types.js +1 -1
- package/index.js +52 -52
- package/package.json +11 -11
- package/schemas/vis-config.schema.json +33 -0
- package/schemas/vis-release-config.schema.json +33 -0
- package/dist/packem_shared/ReleaseClient-YHzBIxYS.js +0 -1
- package/dist/packem_shared/affected-shas-CwRY5aoc.js +0 -1
- package/dist/packem_shared/bin-P6Q5tKrP.js +0 -1
- package/dist/packem_shared/pm-runner-D4jM58Oz.js +0 -1
- package/dist/packem_shared/resolve-runtime-Tx0bvg0h.js +0 -1
- package/dist/packem_shared/scan-progress-D4yywI6P.js +0 -2
- package/dist/packem_shared/target-merge-DOm6h6tW.js +0 -11
- package/dist/packem_shared/use-measured-height-XK9YSwtv.js +0 -1
- package/dist/packem_shared/window-ops-DDePlWLV.js +0 -2
- /package/dist/packem_shared/{readJsonSync-CvkZyKmL-ihoybKvs.js → readJsonSync-DuMMeB3s-ihoybKvs.js} +0 -0
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/*!
|
|
2
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
3
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
4
|
+
*
|
|
5
|
+
* Redistribution and use in source and binary forms, with or without
|
|
6
|
+
* modification, are permitted provided that the following conditions are met:
|
|
7
|
+
*
|
|
8
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
9
|
+
* list of conditions and the following disclaimer.
|
|
10
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
11
|
+
* this list of conditions and the following disclaimer in the
|
|
12
|
+
* documentation and/or other materials provided with the distribution.
|
|
13
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
14
|
+
* may be used to endorse or promote products derived from this software without
|
|
15
|
+
* specific prior written permission.
|
|
16
|
+
*
|
|
17
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
18
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
19
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
20
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
21
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
22
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
23
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
24
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
25
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
26
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
27
|
+
*/function T(e,t){let r=e.slice(0,t).split(/\r\n|\n|\r/g);return[r.length,r.pop().length+1]}function A(e,t,r){let l=e.split(/\r\n|\n|\r/g),o="",i=(Math.log10(t+1)|0)+1;for(let n=t-1;n<=t+1;n++){let s=l[n-1];s&&(o+=n.toString().padEnd(i," "),o+=": ",o+=s,o+=`
|
|
28
|
+
`,n===t&&(o+=" ".repeat(i+r+2),o+=`^
|
|
29
|
+
`))}return o}class u extends Error{line;column;codeblock;constructor(t,r){const[l,o]=T(r.toml,r.ptr),i=A(r.toml,l,o);super(`Invalid TOML document: ${t}
|
|
30
|
+
|
|
31
|
+
${i}`,r),this.line=l,this.column=o,this.codeblock=i}}function I(e,t){let r=0;for(;e[t-++r]==="\\";);return--r&&r%2}function m(e,t=0,r=e.length){let l=e.indexOf(`
|
|
32
|
+
`,t);return e[l-1]==="\r"&&l--,l<=r?l:-1}function p(e,t){for(let r=t;r<e.length;r++){let l=e[r];if(l===`
|
|
33
|
+
`)return r;if(l==="\r"&&e[r+1]===`
|
|
34
|
+
`)return r+1;if(l<" "&&l!==" "||l==="")throw new u("control characters are not allowed in comments",{toml:e,ptr:t})}return e.length}function d(e,t,r,l){let o;for(;;){for(;(o=e[t])===" "||o===" "||!r&&(o===`
|
|
35
|
+
`||o==="\r"&&e[t+1]===`
|
|
36
|
+
`);)t++;if(l||o!=="#")break;t=p(e,t)}return t}function $(e,t,r,l,o=!1){if(!l)return t=m(e,t),t<0?e.length:t;for(let i=t;i<e.length;i++){let n=e[i];if(n==="#")i=m(e,i);else{if(n===r)return i+1;if(n===l||o&&(n===`
|
|
37
|
+
`||n==="\r"&&e[i+1]===`
|
|
38
|
+
`))return i}}throw new u("cannot find end of structure",{toml:e,ptr:t})}function O(e,t){let r=e[t],l=r===e[t+1]&&e[t+1]===e[t+2]?e.slice(t,t+3):r;t+=l.length-1;do t=e.indexOf(l,++t);while(t>-1&&r!=="'"&&I(e,t));return t>-1&&(t+=l.length,l.length>1&&(e[t]===r&&t++,e[t]===r&&t++)),t}/*!
|
|
39
|
+
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
40
|
+
* SPDX-License-Identifier: BSD-3-Clause
|
|
41
|
+
*
|
|
42
|
+
* Redistribution and use in source and binary forms, with or without
|
|
43
|
+
* modification, are permitted provided that the following conditions are met:
|
|
44
|
+
*
|
|
45
|
+
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
46
|
+
* list of conditions and the following disclaimer.
|
|
47
|
+
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
48
|
+
* this list of conditions and the following disclaimer in the
|
|
49
|
+
* documentation and/or other materials provided with the distribution.
|
|
50
|
+
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
51
|
+
* may be used to endorse or promote products derived from this software without
|
|
52
|
+
* specific prior written permission.
|
|
53
|
+
*
|
|
54
|
+
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
55
|
+
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
56
|
+
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
57
|
+
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
58
|
+
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
59
|
+
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
60
|
+
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
61
|
+
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
62
|
+
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
63
|
+
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
64
|
+
*/let E=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;class h extends Date{#t=!1;#r=!1;#e=null;constructor(t){let r=!0,l=!0,o="Z";if(typeof t=="string"){let i=t.match(E);i?(i[1]||(r=!1,t=`0000-01-01T${t}`),l=!!i[2],l&&t[10]===" "&&(t=t.replace(" ","T")),i[2]&&+i[2]>23?t="":(o=i[3]||null,t=t.toUpperCase(),!o&&l&&(t+="Z"))):t=""}super(t),isNaN(this.getTime())||(this.#t=r,this.#r=l,this.#e=o)}isDateTime(){return this.#t&&this.#r}isLocal(){return!this.#t||!this.#r||!this.#e}isDate(){return this.#t&&!this.#r}isTime(){return this.#r&&!this.#t}isValid(){return this.#t||this.#r}toISOString(){let t=super.toISOString();if(this.isDate())return t.slice(0,10);if(this.isTime())return t.slice(11,23);if(this.#e===null)return t.slice(0,-1);if(this.#e==="Z")return t;let r=+this.#e.slice(1,3)*60+ +this.#e.slice(4,6);return r=this.#e[0]==="-"?r:-r,new Date(this.getTime()-r*6e4).toISOString().slice(0,-1)+this.#e}static wrapAsOffsetDateTime(t,r="Z"){let l=new h(t);return l.#e=r,l}static wrapAsLocalDateTime(t){let r=new h(t);return r.#e=null,r}static wrapAsLocalDate(t){let r=new h(t);return r.#r=!1,r.#e=null,r}static wrapAsLocalTime(t){let r=new h(t);return r.#t=!1,r.#e=null,r}}let N=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,j=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,D=/^[+-]?0[0-9_]/,Z=/^[0-9a-f]{2,8}$/i,x={b:"\b",t:" ",n:`
|
|
65
|
+
`,f:"\f",r:"\r",e:"\x1B",'"':'"',"\\":"\\"};function k(e,t=0,r=e.length){let l=e[t]==="'",o=e[t++]===e[t]&&e[t]===e[t+1];o&&(r-=2,e[t+=2]==="\r"&&t++,e[t]===`
|
|
66
|
+
`&&t++);let i=0,n,s="",f=t;for(;t<r-1;){let a=e[t++];if(a===`
|
|
67
|
+
`||a==="\r"&&e[t]===`
|
|
68
|
+
`){if(!o)throw new u("newlines are not allowed in strings",{toml:e,ptr:t-1})}else if(a<" "&&a!==" "||a==="")throw new u("control characters are not allowed in strings",{toml:e,ptr:t-1});if(n){if(n=!1,a==="x"||a==="u"||a==="U"){let c=e.slice(t,t+=a==="x"?2:a==="u"?4:8);if(!Z.test(c))throw new u("invalid unicode escape",{toml:e,ptr:i});try{s+=String.fromCodePoint(parseInt(c,16))}catch{throw new u("invalid unicode escape",{toml:e,ptr:i})}}else if(o&&(a===`
|
|
69
|
+
`||a===" "||a===" "||a==="\r")){if(t=d(e,t-1,!0),e[t]!==`
|
|
70
|
+
`&&e[t]!=="\r")throw new u("invalid escape: only line-ending whitespace may be escaped",{toml:e,ptr:i});t=d(e,t)}else if(a in x)s+=x[a];else throw new u("unrecognized escape sequence",{toml:e,ptr:i});f=t}else!l&&a==="\\"&&(i=t-1,n=!0,s+=e.slice(f,i))}return s+e.slice(f,r-1)}function L(e,t,r,l){if(e==="true")return!0;if(e==="false")return!1;if(e==="-inf")return-1/0;if(e==="inf"||e==="+inf")return 1/0;if(e==="nan"||e==="+nan"||e==="-nan")return NaN;if(e==="-0")return l?0n:0;let o=N.test(e);if(o||j.test(e)){if(D.test(e))throw new u("leading zeroes are not allowed",{toml:t,ptr:r});e=e.replace(/_/g,"");let n=+e;if(isNaN(n))throw new u("invalid number",{toml:t,ptr:r});if(o){if((o=!Number.isSafeInteger(n))&&!l)throw new u("integer value cannot be represented losslessly",{toml:t,ptr:r});(o||l===!0)&&(n=BigInt(e))}return n}const i=new h(e);if(!i.isValid())throw new u("invalid value",{toml:t,ptr:r});return i}function V(e,t,r){let l=e.slice(t,r),o=l.indexOf("#");return o>-1&&(p(e,o),l=l.slice(0,o)),[l.trimEnd(),o]}function b(e,t,r,l,o){if(l===0)throw new u("document contains excessively nested structures. aborting.",{toml:e,ptr:t});let i=e[t];if(i==="["||i==="{"){let[f,a]=i==="["?B(e,t,l,o):z(e,t,l,o);if(r){if(a=d(e,a),e[a]===",")a++;else if(e[a]!==r)throw new u("expected comma or end of structure",{toml:e,ptr:a})}return[f,a]}let n;if(i==='"'||i==="'"){n=O(e,t);let f=k(e,t,n);if(r){if(n=d(e,n),e[n]&&e[n]!==","&&e[n]!==r&&e[n]!==`
|
|
71
|
+
`&&e[n]!=="\r")throw new u("unexpected character encountered",{toml:e,ptr:n});n+=+(e[n]===",")}return[f,n]}n=$(e,t,",",r);let s=V(e,t,n-+(e[n-1]===","));if(!s[0])throw new u("incomplete key-value declaration: no value specified",{toml:e,ptr:t});return r&&s[1]>-1&&(n=d(e,t+s[1]),n+=+(e[n]===",")),[L(s[0],e,t,o),n]}let P=/^[a-zA-Z0-9-_]+[ \t]*$/;function g(e,t,r="="){let l=t-1,o=[],i=e.indexOf(r,t);if(i<0)throw new u("incomplete key-value: cannot find end of key",{toml:e,ptr:t});do{let n=e[t=++l];if(n!==" "&&n!==" ")if(n==='"'||n==="'"){if(n===e[t+1]&&n===e[t+2])throw new u("multiline strings are not allowed in keys",{toml:e,ptr:t});let s=O(e,t);if(s<0)throw new u("unfinished string encountered",{toml:e,ptr:t});l=e.indexOf(".",s);let f=e.slice(s,l<0||l>i?i:l),a=m(f);if(a>-1)throw new u("newlines are not allowed in keys",{toml:e,ptr:t+l+a});if(f.trimStart())throw new u("found extra tokens after the string part",{toml:e,ptr:s});if(i<s&&(i=e.indexOf(r,s),i<0))throw new u("incomplete key-value: cannot find end of key",{toml:e,ptr:t});o.push(k(e,t,s))}else{l=e.indexOf(".",t);let s=e.slice(t,l<0||l>i?i:l);if(!P.test(s))throw new u("only letter, numbers, dashes and underscores are allowed in keys",{toml:e,ptr:t});o.push(s.trimEnd())}}while(l+1&&l<i);return[o,d(e,i+1,!0,!0)]}function z(e,t,r,l){let o={},i=new Set,n;for(t++;(n=e[t++])!=="}"&&n;){if(n===",")throw new u("expected value, found comma",{toml:e,ptr:t-1});if(n==="#")t=p(e,t);else if(n!==" "&&n!==" "&&n!==`
|
|
72
|
+
`&&n!=="\r"){let s,f=o,a=!1,[c,S]=g(e,t-1);for(let w=0;w<c.length;w++){if(w&&(f=a?f[s]:f[s]={}),s=c[w],(a=Object.hasOwn(f,s))&&(typeof f[s]!="object"||i.has(f[s])))throw new u("trying to redefine an already defined value",{toml:e,ptr:t});!a&&s==="__proto__"&&Object.defineProperty(f,s,{enumerable:!0,configurable:!0,writable:!0})}if(a)throw new u("trying to redefine an already defined value",{toml:e,ptr:t});let[y,_]=b(e,S,"}",r-1,l);i.add(y),f[s]=y,t=_}}if(!n)throw new u("unfinished table encountered",{toml:e,ptr:t});return[o,t]}function B(e,t,r,l){let o=[],i;for(t++;(i=e[t++])!=="]"&&i;){if(i===",")throw new u("expected value, found comma",{toml:e,ptr:t-1});if(i==="#")t=p(e,t);else if(i!==" "&&i!==" "&&i!==`
|
|
73
|
+
`&&i!=="\r"){let n=b(e,t-1,"]",r-1,l);o.push(n[0]),t=n[1]}}if(!i)throw new u("unfinished array encountered",{toml:e,ptr:t});return[o,t]}function v(e,t,r,l){let o=t,i=r,n,s=!1,f;for(let a=0;a<e.length;a++){if(a){if(o=s?o[n]:o[n]={},i=(f=i[n]).c,l===0&&(f.t===1||f.t===2))return null;if(f.t===2){let c=o.length-1;o=o[c],i=i[c].c}}if(n=e[a],(s=Object.hasOwn(o,n))&&i[n]?.t===0&&i[n]?.d)return null;s||(n==="__proto__"&&(Object.defineProperty(o,n,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(i,n,{enumerable:!0,configurable:!0,writable:!0})),i[n]={t:a<e.length-1&&l===2?3:l,d:!1,i:0,c:{}})}if(f=i[n],f.t!==l&&!(l===1&&f.t===3)||(l===2&&(f.d||(f.d=!0,o[n]=[]),o[n].push(o={}),f.c[f.i++]=f={t:1,d:!1,i:0,c:{}}),f.d))return null;if(f.d=!0,l===1)o=s?o[n]:o[n]={};else if(l===0&&s)return null;return[n,o,f.c]}function C(e,{maxDepth:t=1e3,integersAsBigInt:r}={}){let l={},o={},i=l,n=o;for(let s=d(e,0);s<e.length;){if(e[s]==="["){let f=e[++s]==="[",a=g(e,s+=+f,"]");if(f){if(e[a[1]-1]!=="]")throw new u("expected end of table declaration",{toml:e,ptr:a[1]-1});a[1]++}let c=v(a[0],l,o,f?2:1);if(!c)throw new u("trying to redefine an already defined table or value",{toml:e,ptr:s});n=c[2],i=c[1],s=a[1]}else{let f=g(e,s),a=v(f[0],i,n,0);if(!a)throw new u("trying to redefine an already defined table or value",{toml:e,ptr:s});let c=b(e,f[1],void 0,t,r);a[1][a[0]]=c[0],s=c[1]}if(s=d(e,s,!0),e[s]&&e[s]!==`
|
|
74
|
+
`&&e[s]!=="\r")throw new u("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:s});s=d(e,s)}return l}export{h as TomlDate,u as TomlError,C as parse};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as r}from"./cli-main.js";import{c as i,f as a}from"../packem_shared/registry-keys-
|
|
1
|
+
import{p as r}from"./cli-main.js";import{c as i,f as a}from"../packem_shared/registry-keys-BKEq72qX.js";const n=async({options:s})=>{if(s.clear){const t=i();if(s.json){process.stdout.write(`${JSON.stringify({cleared:t,refetched:!1},void 0,2)}
|
|
2
2
|
`);return}r.success(t?"Cleared cached npm signing keys.":"No cached npm signing keys to clear.");return}const e=await a({forceRefresh:!0});if(e===void 0){if(s.json){process.stdout.write(`${JSON.stringify({cleared:!1,error:"fetch-failed",refetched:!1},void 0,2)}
|
|
3
3
|
`),process.exitCode=1;return}r.error("Failed to fetch npm signing keys (network error and no cached keys available)."),process.exitCode=1;return}if(s.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){r.warn(`Network fetch failed — falling back to expired cache (${String(e.keys.length)} keys).`);return}r.success(`Refreshed npm signing keys (${String(e.keys.length)} keys).`)};export{n as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{A as a,B as p}from"../packem_shared/index-CE6MsgcV.js";import{r as l}from"../packem_shared/resolve-runtime-
|
|
1
|
+
import{A as a,B as p}from"../packem_shared/index-CE6MsgcV.js";import{r as l}from"../packem_shared/resolve-runtime-QRaQucfL.js";import{r as f}from"../packem_shared/run-file-DD7Ne23Z.js";const m=o=>{let t,n=!1,i;const s=[];for(let e=0;e<o.length;e+=1){const r=o[e];if(i===void 0){if(r==="--node"){n=!0;continue}if(r==="--runtime"){t=o[e+1],e+=1;continue}if(r.startsWith("--runtime=")){t=r.slice(10);continue}i=r;continue}s.push(r)}return s[0]==="--"&&s.shift(),{file:i,node:n,runtimeFlag:t,scriptArguments:s}},h=async o=>{const{file:t,node:n,runtimeFlag:i,scriptArguments:s}=m(o);if(t===void 0){process.stderr.write(`No file specified. Usage: vis x <file> [args...]
|
|
2
2
|
`),process.exitCode=1;return}const e=process.cwd(),r=a(t)?t:p(e,t);if(n){const d=await f(r,s,"node",e,{node:!0});d!==0&&(process.exitCode=d);return}let c;try{c=l(e,{flag:i})}catch(d){process.stderr.write(`${d.message}
|
|
3
3
|
`),process.exitCode=1;return}c.deferredNotice!==void 0&&process.stderr.write(`${c.deferredNotice}
|
|
4
4
|
`);const u=await f(r,s,c.runtime,e);u!==0&&(process.exitCode=u)};export{m as parseLeanXArgs,h as runLeanX};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as _}from"node:module";import{h as x,p as o,v as B}from"./cli-main.js";import{
|
|
1
|
+
import{createRequire as _}from"node:module";import{h as x,p as o,v as B}from"./cli-main.js";import{A as R}from"../packem_shared/pm-runner-CQcraCcu.js";import{W as V}from"../packem_shared/build-scripts-q__dKE2y.js";import{m as y,f as w}from"../packem_shared/index-CE6MsgcV.js";import{a as W}from"../packem_shared/readJsonSync-DuMMeB3s-ihoybKvs.js";const j=_(import.meta.url),v=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,D=c=>{if(typeof v<"u"&&v.versions&&v.versions.node){const[r,f]=v.versions.node.split(".").map(Number);if(r>22||r===22&&f>=3||r===20&&f>=16)return v.getBuiltinModule(c)}return j(c)},{readdirSync:S,statSync:M}=D("node:fs"),q=(c,r={})=>{const f=y(c,"node_modules");if(!w(f))return[];const l=new Map,p=new Set,$=(n,s,t)=>{const e=`${s}@${t}`;if(p.has(e))return;p.add(e);const i=t.startsWith(c)?t.slice(c.length+1):t;let u=l.get(n);u||(u=[],l.set(n,u)),u.some(b=>b.name===s)||u.push({name:s,relativePath:i})},d=(n,s="")=>{let t;try{t=S(n)}catch{return}for(const e of t){const i=y(n,e);if(e.startsWith("@")){d(i,`${e}/`);continue}if(e===".pnpm"&&s===""){let a;try{a=S(i)}catch{continue}for(const m of a){const h=y(i,m,"node_modules");w(h)&&d(h)}continue}if(e.startsWith("."))continue;const u=s+e,b=y(i,"package.json");try{if(!M(i).isDirectory()||!w(b))continue;const a=W(b),m=typeof a.name=="string"?a.name:u;if(typeof a.bin=="string"){const k=m.includes("/")?m.split("/").pop():m;$(k,m,i)}else if(a.bin&&typeof a.bin=="object")for(const k of Object.keys(a.bin))$(k,m,i);const h=y(i,"node_modules");w(h)&&d(h)}catch{}}};d(f);const g=[];for(const[n,s]of l)s.length<2||r[n]===!0||s.every(t=>r[`${t.name}#${n}`]===!0)||g.push({bin:n,packages:s});return g.sort((n,s)=>n.bin.localeCompare(s.bin))},A=new Set(["bun","npm","pnpm","yarn"]),J=({options:c,visConfig:r,workspaceRoot:f})=>{const l=f??process.cwd(),p=R(l),$=r?.security?.policies?.installScripts?.allow??{},d=r?.security?.allowBins??{},g=r?.security?.pinVersions===!0,n=V(l,$,{pinVersions:g}),s=q(l,d),t=r&&A.has(p.name)?x(r,p.name,l):void 0;if(c.json){process.stdout.write(`${JSON.stringify({binConflicts:s,drift:t,excess:n.excess,installed:n.installed.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),packageManager:p.name,pinVersions:g,unapproved:n.unapproved.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),versionDrift:n.versionDrift},void 0,2)}
|
|
2
2
|
`);return}if(o.info(`Build-script status (${p.name}):
|
|
3
3
|
`),n.installed.length===0&&n.unapproved.length===0&&o.success(" No installed packages declare lifecycle scripts."),n.installed.length>0){o.success(` Approved (${String(n.installed.length)}):`);for(const e of n.installed)o.info(` ✓ ${e.name} — ${e.hooks.join(", ")}`)}if(n.unapproved.length>0){o.info(""),o.warn(` Unapproved (${String(n.unapproved.length)}):`);for(const e of n.unapproved)o.info(` ✗ ${e.name} — ${e.hooks.join(", ")}`);o.notice(" Run 'vis approve-builds' to review.")}if(n.excess.length>0){o.info(""),o.warn(` Stale allowlist entries (${String(n.excess.length)}):`);for(const e of n.excess)o.info(` ! ${e}`);o.notice(" Remove these from vis.config.ts security.policies.installScripts.allow.")}if(n.versionDrift.length>0){o.info(""),o.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:i}of n.versionDrift)o.info(` ${e} → ${i}`);o.notice(" Update vis.config.ts security.policies.installScripts.allow keys to migrate.")}if(s.length>0){o.info(""),o.warn(` Bin conflicts (${String(s.length)}) — multiple packages expose the same bin name:`);for(const e of s)o.info(` ${e.bin} ← ${e.packages.map(i=>i.name).join(", ")}`);o.notice(" Add the bin (or 'pkg#bin') to vis.config.ts security.allowBins to silence this.")}if(t?.hasDrift){o.info("");for(const e of B(t))o.warn(e)}};export{J as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as m}from"node:module";import{
|
|
1
|
+
import{createRequire as m}from"node:module";import{A as d,j as _}from"../packem_shared/pm-runner-CQcraCcu.js";const w=m(import.meta.url),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",$=()=>!!process.stdout.isTTY&&process.env.CI!=="true",v=e=>new Promise(t=>{const r=y({input:process.stdin,output:process.stderr});r.question(`${e} (Y/n) `,i=>{r.close();const n=i.trim().toLowerCase();t(n===""||n==="y"||n==="yes")})}),h=e=>{const t=d(e),r=_(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})},R=()=>{try{return import.meta.resolve(s),!0}catch{return!1}},I=e=>{let t="pnpm";try{t=d(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"),T=async(e={})=>{const t=e.interactive??$(),r=e.prompt??v,i=e.runInstall??h,n=e.importImpl??D,l=e.workspaceRoot??process.cwd(),a=I(l);try{return await n()}catch(p){const{code:u,message:f}=p;if(!(u==="ERR_MODULE_NOT_FOUND"||u==="MODULE_NOT_FOUND")||!f.includes(s))throw p}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
|
${a}`);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
|
${a}`);const c=await i(l);if(c.exitCode!==0)throw new Error(`Install of ${s} failed (exit ${String(c.exitCode)}). Install manually and retry:
|
|
4
4
|
${a}`);return await n()};export{I as installCommandFor,R as isSigstoreInstalled,T as loadOptionalSigstore};
|
|
@@ -1,39 +1,42 @@
|
|
|
1
|
-
import{createRequire as
|
|
2
|
-
`).trim();return{meta:Object.keys(t).length>0?t:void 0,remainder:s}},
|
|
3
|
-
`):"{}"}else{const n=[`${
|
|
1
|
+
import{createRequire as Ge}from"node:module";import{u as H}from"../packem_shared/index-Cg0IHaFI.js";import{DEFAULT_CHANGES_DIR as ae,DEFAULT_DEPENDENCY_BUMP_RULES as ze,DEFAULT_CONFIG as qe}from"./DEFAULT_CLEAN_KEEP.js";import{VisReleaseError as C}from"../packem_shared/VisReleaseError-DMGRBTNO.js";import{e as Xe,p as Ke,c as Ze}from"./registry.js";import{E as ea}from"../packem_shared/public-api-WqUCiyIe.js";import{BUMP_LEVELS as ye,maxBump as me,bumpRank as te,normaliseGroup as $e}from"../release/types.js";import{isValidPackageName as aa,escapeMarkdown as ta,assertValidPackageName as na}from"./security.js";import ne from"./index.js";import{d as sa,c as ra}from"./detect.js";import{createShellRunner as Q}from"./shell-runner.js";const Ue=Ge(import.meta.url),X=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,we=e=>{if(typeof X<"u"&&X.versions&&X.versions.node){const[a,t]=X.versions.node.split(".").map(Number);if(a>22||a===22&&t>=3||a===20&&t>=16)return X.getBuiltinModule(e)}return Ue(e)},{readdir:He,readFile:We,writeFile:Je,unlink:Ye}=we("node:fs/promises"),{resolve:ge,sep:K,join:Qe}=we("node:path"),{realpathSync:ve}=we("node:fs"),oa=/^exit[\s-]prerelease\s*:\s*(.+)$/i,ia=/^(.+)@(\d+\.\d+\.\d+(?:[-+].*)?)$/,ke=(e,a,t)=>{if(!aa(e))throw new C({code:"BUMP_FILE_INVALID",file:t,message:`Invalid replay condition "${a}": ${JSON.stringify(e)} is not a valid package name.`,packageName:e||void 0});return e},ca=(e,a)=>{if(typeof e!="string"||e.trim()==="")throw new C({code:"BUMP_FILE_INVALID",file:a,message:`Invalid replay condition: ${JSON.stringify(e)}. Expected "name@1.2.0" or "exit-prerelease:name".`});const t=e.trim(),n=oa.exec(t);if(n)return{kind:"exit-prerelease",package:ke((n[1]??"").trim(),t,a)};const s=ia.exec(t);if(s)return{kind:"version",package:ke((s[1]??"").trim(),t,a),version:s[2]??""};throw new C({code:"BUMP_FILE_INVALID",file:a,message:`Invalid replay condition "${t}". Expected "name@1.2.0" or "exit-prerelease:name".`})},la=(e,a)=>{if(!Array.isArray(e))throw new C({code:"BUMP_FILE_INVALID",file:a,message:'`replay` must be a list of conditions (e.g. ["name@1.2.0", "exit-prerelease:name"]).'});return e.map(t=>ca(t,a))},ue=e=>!("bumps"in e.payload)&&Array.isArray(e.payload.replay)&&e.payload.replay.length>0,Pe=e=>/^\d+\.\d+\.\d+-/.test(e),pa=(e,a)=>e.package!==a.name?!1:e.kind==="version"?a.newVersion===e.version:Pe(a.oldVersion)&&!Pe(a.newVersion),da=(e,a)=>{const t=new Map,n=[],s=[];for(const i of e){if(!ue(i))continue;const l=i.payload.replay;let c=!0;for(const o of l){const r=a.find(u=>pa(o,u));if(r){const u=t.get(r.name)??[];u.some(g=>g.id===i.id)||u.push(i),t.set(r.name,u)}else c=!1}c?n.push(i):s.push(i)}return{consumed:n,injectionsByPackage:t,retained:s}},ga=/^---\r?\n([\s\S]*?)\r?\n---\r?\n?([\s\S]*)$/,ma=e=>{const a=ga.exec(e);return a?{body:(a[2]??"").trim(),frontmatter:a[1]??""}:null},ua=/^(?:@[a-z0-9-]+\/)?[\w.-]+$/i,fa=214,ha=e=>e.length===0||e.length>fa||e.startsWith(".")||e.startsWith("_")||e.startsWith("-")?!1:ua.test(e),fe=e=>typeof e=="string"&&ye.includes(e),wa=/^ {0,3}(#{1,3})\s+\S/,ya=/^ {0,3}(?:```|~~~)/,ba=e=>{let a,t=0,n=!1;for(const s of e.split(/\r?\n/)){if(ya.test(s)){n=!n;continue}if(n)continue;const i=wa.exec(s);if(!i)continue;const l=(i[1]??"").length,c=4-l;c>t&&(t=c,a=l===1?"major":l===2?"minor":"patch")}return a},$a=/^\s*(pr|commit|author)\s*:\s*(.+?)\s*$/i,va=e=>{const a=e.split(/\r?\n/),t={};let n=0;for(const i of a){if(i.trim()===""){n+=1;continue}const l=$a.exec(i);if(!l)break;const[,c="",o=""]=l;switch(c.toLowerCase()){case"author":{t.author=o.startsWith("@")?o:`@${o}`;break}case"commit":{t.commit=o;break}case"pr":{const r=Number.parseInt(o,10);!Number.isNaN(r)&&r>0&&(t.pr=r);break}}n+=1}const s=a.slice(n).join(`
|
|
2
|
+
`).trim();return{meta:Object.keys(t).length>0?t:void 0,remainder:s}},Ce=e=>typeof e=="object"&&e!==null&&!Array.isArray(e)&&("bump"in e||"replay"in e),ka=(e,a,t)=>{const n=a.replay!==void 0;if(n&&a.bump!==void 0)throw new C({code:"BUMP_FILE_INVALID",file:t,message:`"${e}" sets both \`bump\` and \`replay\`. Replay files are changelog-only and never bump — remove \`bump\`, or drop \`replay\` to make this a normal change file.`,packageName:e});const s=a.bump===void 0&&n?"none":a.bump;if(!fe(s))throw new C({code:"BUMP_FILE_INVALID",file:t,message:`Invalid bump level for "${e}": ${JSON.stringify(a.bump)}. Expected one of: ${ye.join(", ")}`,packageName:e});const i={bump:s,package:e};if(n&&(i.replay=la(a.replay,t)),a.releaseAs!==void 0){if(typeof a.releaseAs!="string"||!/^\d+\.\d+\.\d+(?:[-+].*)?$/.test(a.releaseAs))throw new C({code:"BUMP_FILE_INVALID",file:t,message:`Invalid releaseAs for "${e}": ${JSON.stringify(a.releaseAs)}. Expected a semver string like "2.0.0" or "2.0.0-rc.1".`,packageName:e});i.releaseAs=a.releaseAs}if(a.cascade!==void 0){if(typeof a.cascade!="object"||a.cascade===null||Array.isArray(a.cascade))throw new C({code:"BUMP_FILE_INVALID",file:t,message:`Cascade block for "${e}" must be an object mapping package globs to bump levels.`,packageName:e});const l={};for(const[c,o]of Object.entries(a.cascade)){if(!fe(o))throw new C({code:"BUMP_FILE_INVALID",file:t,message:`Invalid cascade bump level for "${c}": ${JSON.stringify(o)}.`,packageName:e});l[c]=o}i.cascade=l}return i},ce=e=>e.replaceAll(/^.*[/\\]/g,"").replace(/\.md$/i,""),Pa=(e,a)=>{const t=ma(e);if(!t)throw new C({code:"BUMP_FILE_INVALID",file:a,message:"Change file is missing YAML frontmatter (expected `---` delimiters)."});let n;try{n=ea(t.frontmatter,{schema:"core",strict:!0})}catch(o){throw new C({cause:o,code:"BUMP_FILE_INVALID",file:a,message:`YAML parse failed: ${o.message}`})}if(n==null)return{body:t.body.trim(),id:ce(a),path:a,payload:{bumps:{}}};if(typeof n!="object"||Array.isArray(n))throw new C({code:"BUMP_FILE_INVALID",file:a,message:"Frontmatter must be a YAML object mapping package names to bump levels."});const s=Object.entries(n);if(s.length===0)return{body:t.body.trim(),id:ce(a),path:a,payload:{bumps:{}}};for(const[o]of s)if(!ha(o))throw new C({code:"BUMP_FILE_INVALID",file:a,message:`Invalid package name: ${JSON.stringify(o)}.`,packageName:o});let i;if(s.length===1&&Ce(s[0][1])){const[o,r]=s[0];i=ka(o,r,a)}else{const o={},r=[];for(const[u,g]of s){if(Ce(g))throw new C({code:"BUMP_FILE_INVALID",file:a,message:`Mixed simple + nested entries are not allowed. Package "${u}" uses the nested shape but the file has multiple top-level entries.`,packageName:u});if(g==null||g===""){r.push(u);continue}if(!fe(g))throw new C({code:"BUMP_FILE_INVALID",file:a,message:`Invalid bump level for "${u}": ${JSON.stringify(g)}. Expected one of: ${ye.join(", ")}`,packageName:u});o[u]=g}if(r.length>0){const u=ba(t.body);if(!u)throw new C({code:"BUMP_FILE_INVALID",file:a,message:`No bump level for ${r.map(g=>`"${g}"`).join(", ")}: the entry is empty and the body has no markdown heading to infer one from. Add an explicit level (e.g. \`${r[0]}: minor\`) or a heading (\`# major\`, \`## minor\`, \`### patch\`).`,packageName:r[0]});for(const g of r)o[g]=u}i={bumps:o}}const{meta:l,remainder:c}=va(t.body);return{body:c,id:ce(a),meta:l,path:a,payload:i}},gt=(e,a)=>{let t;if("bumps"in e){const n=Object.entries(e.bumps).map(([s,i])=>`${le(s)}: ${i}`);t=n.length>0?n.join(`
|
|
3
|
+
`):"{}"}else{const n=[`${le(e.package)}:`,` bump: ${e.bump}`];if(e.releaseAs&&n.push(` releaseAs: ${e.releaseAs}`),e.cascade){n.push(" cascade:");for(const[s,i]of Object.entries(e.cascade))n.push(` ${le(s)}: ${i}`)}if(e.replay&&e.replay.length>0){n.push(" replay:");for(const s of e.replay){const i=s.kind==="version"?`${s.package}@${s.version}`:`exit-prerelease:${s.package}`;n.push(` - "${i}"`)}}t=n.join(`
|
|
4
4
|
`)}return`---
|
|
5
5
|
${t}
|
|
6
6
|
---
|
|
7
7
|
${a.trim()===""?"":`${a.trim()}
|
|
8
|
-
`}`},
|
|
9
|
-
`)},Z=e=>{const{current:a,prerelease:t}=e;let{bump:n}=e;if(!x.valid(a))throw new R({code:"CONFIG_INVALID",message:`Invalid current version: ${JSON.stringify(a)}`});const s=x.parse(a),c=s.prerelease[0],d=s.prerelease.length>0;if(s.major===0&&e.bumpMinorPreMajor&&(n==="major"&&(n="minor"),n==="minor"&&e.bumpPatchForMinorPreMajor&&(n="patch")),n==="none")return(c??void 0)===(t??void 0)?a:!d&&t?`${s.major}.${s.minor}.${s.patch}-${t}.0`:d&&!t?`${s.major}.${s.minor}.${s.patch}`:d&&t?`${s.major}.${s.minor}.${s.patch}-${t}.0`:a;if(d&&t&&c===t){const o=ha(s);if(ye[n]<=ye[o]){const i=x.inc(a,"prerelease",t);if(!i)throw new R({code:"CONFIG_INVALID",message:`semver.inc returned null for prerelease bump on ${a}`});return i}const r=`${s.major}.${s.minor}.${s.patch}`,m=x.inc(r,n);if(!m)throw new R({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${r}`});return`${m}-${t}.0`}if(t){const o=`${s.major}.${s.minor}.${s.patch}`,r=x.inc(o,n);if(!r)throw new R({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${o}`});return`${r}-${t}.0`}if(d){const o=`${s.major}.${s.minor}.${s.patch}`,r=x.inc(o,n);if(!r)throw new R({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${o}`});return r}const l=x.inc(a,n);if(!l)throw new R({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${a}`});return l},ye={major:3,minor:2,patch:1},ha=e=>e.minor===0&&e.patch===0?"major":e.patch===0?"minor":"patch",wa=(e,a)=>{const t=Pe(a);return t?x.satisfies(e,t,{includePrerelease:!0}):!0},Pe=e=>{if(!e||e.startsWith("catalog:")||e==="*"||e==="workspace:*"||e==="workspace:^"||e==="workspace:~")return null;if(e.startsWith("workspace:")){const a=e.slice(10);return a==="*"||a==="^"||a==="~"?null:a}if(e.startsWith("npm:")){const a=e.lastIndexOf("@");return a>4?e.slice(a+1):null}return e},se=100,G=(e,a,t,n,{isCascadeBump:s=!1,isDependencyBump:c=!1,isGroupBump:d=!1,source:l}={})=>{const o=e.get(a);if(o){const r=o.type;return o.type=oe(o.type,t),o.reasons.add(n),c&&(o.isDependencyBump=!0),d&&(o.isGroupBump=!0),s&&(o.isCascadeBump=!0),l&&o.sources.set(l.name,{bumpType:l.bumpType,newVersion:l.newVersion}),o.type!==r}return e.set(a,{isCascadeBump:s,isDependencyBump:c,isGroupBump:d,name:a,proactiveSeen:!1,reasons:new Set([n]),sources:l?new Map([[l.name,{bumpType:l.bumpType,newVersion:l.newVersion}]]):new Map,type:t}),!0},ya=(e,a,t,n)=>{const s=t?.get(e)?.dependencyBumpRules?.[a];if(s!==void 0)return s;const c=n.dependencyBumpRules?.[a];return c!==void 0?c:Le[a]??!1},be=(e,a)=>K(e)>=K(a),ve=(e,a)=>a==="match"?e:a,ba=(e,a)=>a===!0?!0:Array.isArray(a)?a.includes(e):!1,va=10,$a=(e,a,t,n,s,c,d)=>{let l=!1;for(const o of e.values()){const r=a.getPackage(o.name);if(!r)continue;const m=n.currentVersions?.get(o.name)??r.version,i=t.get(o.name)??Z({bump:o.type,bumpMinorPreMajor:n.bumpMinorPreMajor,bumpPatchForMinorPreMajor:n.bumpPatchForMinorPreMajor,current:m,prerelease:n.prerelease});t.set(o.name,i);for(const p of a.getDependents(o.name)){if(p.kind==="devDependencies"){if(!ba(o.name,c.bumpDevDependencies))continue;if(G(e,p.name,"patch","DEVDEPENDENCY_BUMPED",{isDependencyBump:!0,source:{bumpType:o.type,name:o.name,newVersion:i}})&&(l=!0,t.delete(p.name)),c.bumpDevDependencies===!0){let w=d.get(o.name);w||(w=new Set,d.set(o.name,w)),w.add(p.name)}continue}const h=Pe(p.range);if(h===null||wa(i,h))continue;let u,P="DEPENDENCY_OUT_OF_RANGE";p.kind==="peerDependencies"?(u=o.type==="none"?"patch":o.type,P="PEER_DEP_MATCH",h.startsWith("^0.")&&u!=="patch"&&s.push(`^0.x peer dep "${o.name}" → "${p.name}" produced a ${u} bump. Consider widening the range manually.`)):u="patch",G(e,p.name,u,P,{isDependencyBump:!0,source:{bumpType:o.type,name:o.name,newVersion:i}})&&(l=!0,t.delete(p.name))}}return l},ka=(e,a,t)=>{let n=!1;for(const s of t.fixed??[]){const c=ge(s),d=ee(c.packages,a),l=d.filter(r=>e.has(r));if(l.length===0)continue;let o="none";for(const r of l)o=oe(o,e.get(r).type);for(const r of d)a.isInternal(r)&&G(e,r,o,"FIXED_GROUP",{isGroupBump:!0})&&(n=!0)}for(const s of t.linked??[]){const c=ge(s),d=ee(c.packages,a).filter(o=>e.has(o));if(d.length===0)continue;let l="none";for(const o of d)l=oe(l,e.get(o).type);for(const o of d)G(e,o,l,"LINKED_GROUP",{isGroupBump:!0})&&(n=!0)}return n},$e=new WeakMap,Pa=/[!()*+?@[\]{|}]/,ee=(e,a)=>{let t=$e.get(a);t||(t={allNames:a.allPackages().map(s=>s.name),matched:new Map},$e.set(a,t));const n=new Set;for(const s of e){if(!Pa.test(s)){n.add(s);continue}let c=t.matched.get(s);c||(c=t.allNames.filter(d=>Q(s,d)),t.matched.set(s,c));for(const d of c)n.add(d)}return[...n]},Ca=(e,a,t,n,s,c)=>{let d=!1;const l=n.updateInternalDependencies??"out-of-range",o=r=>{const m=c.get(r.name);if(m!==void 0)return m;const i=Z({bump:r.type,bumpMinorPreMajor:s.bumpMinorPreMajor,bumpPatchForMinorPreMajor:s.bumpPatchForMinorPreMajor,current:s.currentVersions?.get(r.name)??t.getPackage(r.name).version,prerelease:s.prerelease});return c.set(r.name,i),i};for(const r of a){if("bumps"in r.payload||!r.payload.cascade)continue;const m=e.get(r.payload.package);if(!m)continue;const i=c.get(m.name)??Z({bump:m.type,bumpMinorPreMajor:s.bumpMinorPreMajor,bumpPatchForMinorPreMajor:s.bumpPatchForMinorPreMajor,current:s.currentVersions?.get(m.name)??t.getPackage(m.name).version,prerelease:s.prerelease});c.set(m.name,i);for(const[p,h]of Object.entries(r.payload.cascade))for(const u of ee([p],t))t.isInternal(u)&&G(e,u,h,"CASCADE",{isCascadeBump:!0,source:{bumpType:m.type,name:m.name,newVersion:i}})&&(d=!0)}for(const r of e.values()){const m=s.perPackageConfig?.get(r.name)?.cascadeTo;if(m)for(const[i,p]of Object.entries(m)){if(!be(r.type,p.trigger))continue;const h=ve(r.type,p.bumpAs),u=o(r);for(const P of ee([i],t))t.isInternal(P)&&G(e,P,h,"CASCADE_TO",{isCascadeBump:!0,source:{bumpType:r.type,name:r.name,newVersion:u}})&&(d=!0)}}if(l==="out-of-range")return d;for(const r of e.values())if(!r.proactiveSeen&&!(l==="minor"&&K(r.type)<K("minor"))){for(const m of t.getDependents(r.name)){const i=ya(m.name,m.kind,s.perPackageConfig,n);if(i===!1||!be(r.type,i.trigger))continue;const p=ve(r.type,i.bumpAs);if(p==="none")continue;const h=o(r);G(e,m.name,p,"DEPENDENCY_BUMPED",{isDependencyBump:!0,source:{bumpType:r.type,name:r.name,newVersion:h}})&&(d=!0)}r.proactiveSeen=!0}return d},Na=(e,a,t,n={})=>{const s=new Map,c=[],d=new Map;for(const[i,p]of sa(e).entries()){if(!a.isInternal(i)){c.push(`Change file references non-workspace package "${i}" — ignored.`);continue}p!=="none"&&G(s,i,p,"EXPLICIT")}for(const i of n.catalogConsumers??[]){if(!a.isInternal(i.packageName))continue;const p=`catalog:${i.catalog}/${i.dep}`;G(s,i.packageName,"patch","CATALOG_CHANGED",{isDependencyBump:!0,source:{bumpType:"patch",name:p,newVersion:i.newVersion??""}})}const l=new Map,o=i=>{const p=fe(i,e).map(u=>"releaseAs"in u.payload?{file:u.path,version:u.payload.releaseAs}:void 0).filter(u=>u!==void 0&&typeof u.version=="string"),h=new Set(p.map(u=>u.version));if(h.size>1)throw new R({code:"BUMP_FILE_INVALID",message:`Conflicting releaseAs values for ${i}: ${[...h].join(", ")}. Found in: ${p.map(u=>u.file).join(", ")}. Consolidate the change files to a single override.`,packageName:i});return p[0]?.version},r=new Map;for(const i of s.values()){if(i.type==="none")continue;const p=o(i.name);p&&(r.set(i.name,p),d.set(i.name,p))}for(let i=0;i<se;i+=1){const p=$a(s,a,d,n,c,t,l),h=ka(s,a,t),u=Ca(s,e,a,t,n,d);if(!p&&!h&&!u)break;i===se-1&&c.push(`Release plan did not converge after ${se} iterations — releasing the current best plan. This usually indicates a config bug (cyclic cascade?).`)}for(const[i,p]of l){const h=p.size;h>va&&c.push(`bumpDevDependencies: true triggered ${h} patch-cascades to distinct dependents from a single devdep bump (${i}). Consider scoping with the array form ['only', 'these', 'sources'].`)}const m=[];for(const i of s.values()){if(i.type==="none")continue;const p=a.getPackage(i.name);if(!p)continue;const h=fe(i.name,e),u=r.get(i.name),P=n.currentVersions?.get(i.name)??p.version,w=u??d.get(i.name)??Z({bump:i.type,bumpMinorPreMajor:n.bumpMinorPreMajor,bumpPatchForMinorPreMajor:n.bumpPatchForMinorPreMajor,current:P,prerelease:n.prerelease});m.push({changeFiles:h,isCascadeBump:i.isCascadeBump,isDependencyBump:i.isDependencyBump,isGroupBump:i.isGroupBump,name:i.name,newVersion:w,oldVersion:P,reasons:[...i.reasons],sources:[...i.sources.entries()].map(([$,y])=>({name:$,...y})),type:i.type})}return m.sort((i,p)=>i.name.localeCompare(p.name)),{consumedChangeFiles:e,releases:m,warnings:c}},Ce=async(e,a,t={})=>{const n=await e.listPackages(),s=[],c=new Map,d=new Map,l=i=>{const p=re(i);try{return me.native(p)}catch{try{return me(p)}catch{return p}}},o=t.cwd===void 0?void 0:l(t.cwd),r=i=>i.replaceAll("\\","/"),m=[];for(const{manifest:i,manifestPath:p}of n){const h=ce(typeof i.name=="string"?i.name:"",i,a);if(i.napi!==void 0||h.versionActions==="native-addon"){const u=r(p.replace(/[/\\]package\.json$/i,""));m.push(`${u}/npm/`)}}for(const{manifest:i,manifestPath:p}of n){if(typeof i.name!="string"||i.name==="")continue;const h=r(p.replace(/[/\\]package\.json$/i,""));if(m.some(w=>h.startsWith(w)))continue;if(ze(i.name),d.has(i.name))throw new R({code:"DUPLICATE_PACKAGE_NAME",message:`Duplicate package name "${i.name}" — at ${d.get(i.name)} and ${p}.`,packageName:i.name});if(d.set(i.name,p),o!==void 0){const w=l(p),$=o.endsWith(Y)?o:`${o}${Y}`,y=b=>Y==="\\"?b.toLowerCase():b,k=y(w);if(k!==y(o)&&!k.startsWith(y($)))throw new R({code:"CONFIG_INVALID",message:`Package manifest is outside the workspace: ${p} (workspace: ${o}).`,packageName:i.name})}const u=ce(i.name,i,a);if(!Ne(i.name,i,u,a))continue;const P=p.replace(/[/\\]package\.json$/i,"");s.push({dir:P,manifest:i,manifestPath:p,name:i.name,private:i.private===!0,version:typeof i.version=="string"?i.version:"0.0.0"}),c.set(i.name,u)}return{packages:s,perPackageConfig:c}},ce=(e,a,t)=>{const n=t.packages?.[e]??{},s=a["vis-release"]??{};return{...n,...s}},Ne=(e,a,t,n)=>t.managed===!1?!1:t.managed===!0?!0:ke(e,n.ignore??[])?!1:ke(e,n.include??[])?!0:a.private===!0&&!(n.privatePackages?.version??!1)?!1:n.defaultManaged??!1,ke=(e,a)=>a.some(t=>Q(t,e)),Ae=(e,a)=>a.versionActions!==void 0?a.versionActions:e.manifest.napi!==void 0?"native-addon":e.private?"private":"npm",Ja=Object.defineProperty({__proto__:null,discoverPackages:Ce,isPackageManaged:Ne,mergePerPackageConfig:ce,resolveVersionActionsId:Ae},Symbol.toStringTag,{value:"Module"}),za=async(e={})=>{const a=e.cwd??process.cwd(),t=z(),n=await We(a),s=Ye(n,t),c=await s.detectVersion(a);if(c&&!Ia(c,s.minVersion))throw new R({code:"PM_VERSION_TOO_LOW",hint:`pnpm install -g ${s.id}@latest (or your equivalent)`,message:`${s.id} version ${c} is below the required minimum ${s.minVersion}. Upgrade ${s.id} to enable release operations.`});let d={};try{const{loadVisConfig:A}=await import("./CONFIG_FILES.js"),C=await A(a);C.release&&(d=C.release)}catch(A){const{code:C}=A,g=A.message??"";if(!(C==="ENOENT"||C==="MODULE_NOT_FOUND"||/cannot find module/i.test(g)))throw A}const l=Aa(d,e.config??{});!l.acknowledgeUnstable&&process.env.VIS_RELEASE_SUPPRESS_UNSTABLE!=="1"&&process.stderr.write("[vis release] ⚠ This subsystem is flagged unstable. Set `release.acknowledgeUnstable: true` in vis.config.ts to suppress this warning. (RFC §21.2)\n");const o=e.channel??await la(a,t),r=o?ia(o,l.channels):void 0,m=await import("node:fs/promises"),i={listPackages:async()=>{const A=await s.listWorkspacePackages(a);return(await Promise.all(A.map(async C=>{const g=`${C.path}/package.json`;try{const v=await m.readFile(g,"utf8");return{manifest:JSON.parse(v),manifestPath:g}}catch{return}}))).filter(C=>C!==void 0)}},{packages:p,perPackageConfig:h}=await Ce(i,l,{cwd:a}),u=new ga(p),{files:P}=await oa({changesDir:l.changesDir,cwd:a}),{readPreMode:w}=await import("./pre-mode.js"),$=await w(a,l.changesDir??".vis/release");let y;$?.mode==="pre"?y=$.tag:$?.mode==="exit-pending"?y=void 0:y=r?.prerelease;const k=e.firstRelease===!0,{resolveCurrentVersionsForWorkspace:b}=await import("./version-resolver.js"),{versions:B,warnings:V}=await b(p,u,l,h,{cwd:a,firstRelease:k,pm:s,runner:t,skipRegistryLookup:e.skipRegistryLookup===!0}),T=[],N=[];if(l.detectCatalogChanges===!0)try{const{detectCatalogChanges:A,findCatalogConsumers:C,parseCatalogs:g}=await import("./catalog-detector.js"),v=await s.readCatalogYaml(a),j=g(v);let L;try{const _=await t.run("git",["show","HEAD~1:pnpm-workspace.yaml"],{cwd:a,silent:!0});_.exitCode===0&&(L=_.stdout)}catch{}const S=g(L),D=A(S,j).filter(_=>_.oldVersion!==void 0&&_.newVersion!==void 0);if(D.length>0){const _=C(p,j);for(const M of D){const I=_.get(M.catalog)?.get(M.dep)??[];for(const f of I)T.push({catalog:M.catalog,dep:M.dep,newVersion:M.newVersion,oldVersion:M.oldVersion,packageName:f.packageName})}T.length>0&&N.push(`Catalog change-detection: ${D.length} catalog dep(s) moved; ${T.length} consumer-package patch bump(s) tagged CATALOG_CHANGED.`)}}catch(A){N.push(`Catalog change-detection skipped: ${A.message}.`)}const E=Na(P,u,l,{bumpMinorPreMajor:l.bumpMinorPreMajor,bumpPatchForMinorPreMajor:l.bumpPatchForMinorPreMajor,catalogConsumers:T,currentVersions:B,perPackageConfig:h,prerelease:y});if(N.length>0&&E.warnings.push(...N),V.length>0&&E.warnings.push(...V),k&&E.warnings.push('First-release mode: currentVersionResolver forced to "disk", remote tag-collision checks skipped. Drop --first-release after the initial wave lands.'),$?.mode==="pre"&&E.warnings.push(`Pre-mode is ACTIVE (tag "${$.tag}"); every version produces a prerelease. Exit with \`vis release pre exit\` when ready to ship stable.`),$?.mode==="exit-pending"&&E.warnings.push(`Pre-mode is EXIT-PENDING (was "${$.tag}"); the next \`vis release version\` will consolidate the prerelease and delete pre.json.`),r?.overlapping&&r.overlapping.length>0&&E.warnings.push(`Branch "${o}" matches multiple channel patterns: "${r.branch}" (active) plus ${r.overlapping.map(A=>`"${A}"`).join(", ")}. Reorder channels in vis.config.ts if this is unintentional.`),e.projects&&e.projects.length>0){const{default:A}=await import("./index.js"),C=e.projects;E.releases=E.releases.filter(g=>C.some(v=>g.name===v||A(v,g.name)))}return{branch:o,channel:r?{mode:r.mode,prerelease:r.prerelease,tag:r.tag}:void 0,config:l,cwd:a,depGraph:u,firstRelease:k,packages:p,perPackageConfig:h,plan:E,pm:s,preMode:$}},Aa=(...e)=>{let a={...Be};for(const t of e)a={...a,...t};return a},Ia=(e,a)=>{const t=x.coerce(e)?.version??e;try{return x.gte(t,a)}catch{return!0}},J=async(e,a,t)=>{if(!a||a.trim()==="")return;const n=z(),s=process.platform==="win32",c=s?"cmd":"sh",d=s?["/c",a]:["-c",a],l=await n.run(c,d,{cwd:e,silent:!1});if(l.exitCode!==0)throw new Error(`${t} failed (exit ${l.exitCode}): ${a}`)},Ie=async(e,a,t,n={})=>{const{findConflictingPendingStages:s,readStagedRegistry:c,removePendingStages:d,writeStagedRegistry:l}=await import("./staged-registry.js"),o=e.config.changesDir??X;let r=t??await c(e.cwd,o);if(r.pending.length===0)return;const m=new Map(e.plan.releases.map(w=>[w.name,w.newVersion])),i=[...m.keys()];let p=s(r,i).filter(w=>m.get(w.name)!==w.version);if(p.length===0)return;let h=[];if(!n.skipSelfHeal){const w=n.runner??z();h=(await Promise.all(p.map(async $=>{const y=await w.run("npm",["view",`${$.name}@${$.version}`,"dist.tarball","--silent"],{cwd:e.cwd,silent:!0});return y.exitCode===0&&y.stdout.trim().length>0?$.id:void 0}))).filter($=>$!==void 0)}if(h.length>0){if(r=d(r,h),n.persistSelfHeal!==!1)try{await l(e.cwd,o,r)}catch{}if(p=s(r,i).filter(w=>m.get(w.name)!==w.version),p.length===0)return}const u=p.map(w=>` • ${w.name}@${w.version} — stage ${w.id} (${w.reason}, recorded ${w.stagedAt})`).join(`
|
|
10
|
-
`)
|
|
11
|
-
${
|
|
8
|
+
`}`},le=e=>/^[a-z0-9-]/.test(e)?e:`"${e}"`,Ca=e=>{const a=new Map,t=s=>s==="major"?3:s==="minor"?2:s==="patch"?1:0,n=(s,i)=>{const l=a.get(s);(l===void 0||t(i)>t(l))&&a.set(s,i)};for(const s of e)if("bumps"in s.payload)for(const[i,l]of Object.entries(s.payload.bumps))n(i,l);else n(s.payload.package,s.payload.bump);return a},Ae=(e,a)=>a.filter(t=>"bumps"in t.payload?Object.hasOwn(t.payload.bumps,e):t.payload.package===e),Aa=new Set(["README.md","readme.md"]),Ia=async e=>{const a=e.changesDir??ae,t=ge(e.cwd),n=ge(e.cwd,a),s=n,i=t.endsWith(K)?t:`${t}${K}`;if(n!==t&&!n.startsWith(i))throw new C({code:"CONFIG_INVALID",message:`changesDir resolves outside the workspace: ${n} (workspace: ${t}). Set release.changesDir to a path inside the repo.`});const l=[];let c;try{c=await He(s)}catch(r){if(r.code==="ENOENT")return{files:[],warnings:[]};throw new C({cause:r,code:"CONFIG_INVALID",message:`Cannot read change-files directory ${s}: ${r.message}`})}const o=c.filter(r=>!Aa.has(r)&&r.endsWith(".md"));return{files:await Promise.all(o.map(async r=>{const u=Qe(s,r),g=await We(u,"utf8");return Pa(g,u)})),warnings:l}},Na=(e,a)=>{if(!a)return;if(Object.hasOwn(a,e)){const n=Object.keys(a).filter(s=>s!==e&&Ne(s)&&ne(s,e));return Ie(e,a[e],n)}const t=[];for(const[n]of Object.entries(a))Ne(n)&&ne(n,e)&&t.push(n);if(t.length>0){const[n,...s]=t;return Ie(e,a[n],s)}},Ie=(e,a,t=[])=>{let{tag:n}=a;return n==="branch-name"&&(n=Ra(e)),{branch:e,mode:a.mode??"auto-publish",...t.length>0?{overlapping:t}:{},prerelease:a.prerelease,range:a.range,tag:n}},Ra=e=>e.toLowerCase().replaceAll(/[^a-z0-9.-]/g,"-").replaceAll(/^-+|-+$/g,"")||"branch",Ma=/[!()*+?@[\]{|}]/,Ne=e=>Ma.test(e),ja=async(e,a)=>{try{const t=await a.run("git",["rev-parse","--abbrev-ref","HEAD"],{cwd:e,silent:!0});if(t.exitCode!==0)return;const n=t.stdout.trim();return n==="HEAD"||n===""?void 0:n}catch{return}},Da=["dependencies","devDependencies","peerDependencies","optionalDependencies"];class Va{dependents;dependenciesByPackage;packagesByName;constructor(a){this.dependents=new Map,this.dependenciesByPackage=new Map,this.packagesByName=new Map;for(const t of a){if(this.packagesByName.has(t.name))throw new C({code:"DUPLICATE_PACKAGE_NAME",message:`Duplicate package name "${t.name}" — found at ${this.packagesByName.get(t.name).dir} and ${t.dir}.`,packageName:t.name});this.packagesByName.set(t.name,t),this.dependents.set(t.name,[]),this.dependenciesByPackage.set(t.name,[])}for(const t of a)for(const n of Da){const s=t.manifest[n];if(!(!s||typeof s!="object"))for(const[i,l]of Object.entries(s))this.packagesByName.has(i)&&(this.dependents.get(i).push({kind:n,name:t.name,range:l}),this.dependenciesByPackage.get(t.name).push({kind:n,name:i,range:l}))}}getPackage(a){return this.packagesByName.get(a)}allPackages(){return[...this.packagesByName.values()]}isInternal(a){return this.packagesByName.has(a)}getDependents(a){return this.dependents.get(a)??[]}getDependencies(a){return this.dependenciesByPackage.get(a)??[]}topologicalSort(a){const t=a?new Set(a):new Set(this.packagesByName.keys()),n=new Set,s=new Set,i=[],l=(c,o)=>{if(!n.has(c)){if(s.has(c)){const r=o.indexOf(c),u=r===-1?[...o,c]:[...o.slice(r),c];throw new C({code:"CYCLIC_DEPENDENCY",message:`Cyclic dependency detected: ${u.join(" → ")}`})}s.add(c);for(const r of this.getDependencies(c))t.has(r.name)&&r.kind!=="devDependencies"&&l(r.name,[...o,c]);s.delete(c),n.add(c),i.push(c)}};for(const c of t)l(c,[]);return i}get size(){return this.packagesByName.size}}const Fa=/\{(name|version|previousVersion|date|repo|contributors)\}/g,Ea=(e,a)=>e.replaceAll(Fa,(t,n)=>a[n]??""),_a=(e,a={})=>{const t=new Set;for(const i of a.internalAuthors??[]){const l=i.trim().toLowerCase().replace(/^@/,"");l.length>0&&t.add(l)}const n=new Set,s=[];for(const i of e){const l=i.meta?.author;if(l)for(const c of l.split(",")){const o=c.trim();if(!o)continue;const r=o.replace(/^@/,"");if(r.length===0)continue;const u=r.toLowerCase();n.has(u)||t.has(u)||(n.add(u),s.push(ta(o)))}}return s.length===0?"":s.map(i=>`- ${i}`).join(`
|
|
9
|
+
`)},se=e=>{const{current:a,prerelease:t}=e;let{bump:n}=e;if(!H.valid(a))throw new C({code:"CONFIG_INVALID",message:`Invalid current version: ${JSON.stringify(a)}`});const s=H.parse(a),i=s.prerelease[0],l=s.prerelease.length>0;if(s.major===0&&e.bumpMinorPreMajor&&(n==="major"&&(n="minor"),n==="minor"&&e.bumpPatchForMinorPreMajor&&(n="patch")),n==="none")return(i??void 0)===(t??void 0)?a:!l&&t?`${s.major}.${s.minor}.${s.patch}-${t}.0`:l&&!t?`${s.major}.${s.minor}.${s.patch}`:l&&t?`${s.major}.${s.minor}.${s.patch}-${t}.0`:a;if(l&&t&&i===t){const o=Sa(s);if(Re[n]<=Re[o]){const g=H.inc(a,"prerelease",t);if(!g)throw new C({code:"CONFIG_INVALID",message:`semver.inc returned null for prerelease bump on ${a}`});return g}const r=`${s.major}.${s.minor}.${s.patch}`,u=H.inc(r,n);if(!u)throw new C({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${r}`});return`${u}-${t}.0`}if(t){const o=`${s.major}.${s.minor}.${s.patch}`,r=H.inc(o,n);if(!r)throw new C({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${o}`});return`${r}-${t}.0`}if(l){const o=`${s.major}.${s.minor}.${s.patch}`,r=H.inc(o,n);if(!r)throw new C({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${o}`});return r}const c=H.inc(a,n);if(!c)throw new C({code:"CONFIG_INVALID",message:`semver.inc returned null for ${n} bump on ${a}`});return c},Re={major:3,minor:2,patch:1},Sa=e=>e.minor===0&&e.patch===0?"major":e.patch===0?"minor":"patch",La=(e,a)=>{const t=Fe(a);return t?H.satisfies(e,t,{includePrerelease:!0}):!0},Fe=e=>{if(!e||e.startsWith("catalog:")||e==="*"||e==="workspace:*"||e==="workspace:^"||e==="workspace:~")return null;if(e.startsWith("workspace:")){const a=e.slice(10);return a==="*"||a==="^"||a==="~"?null:a}if(e.startsWith("npm:")){const a=e.lastIndexOf("@");return a>4?e.slice(a+1):null}return e},pe=100,W=(e,a,t,n,{isCascadeBump:s=!1,isDependencyBump:i=!1,isGroupBump:l=!1,source:c}={})=>{const o=e.get(a);if(o){const r=o.type;return o.type=me(o.type,t),o.reasons.add(n),i&&(o.isDependencyBump=!0),l&&(o.isGroupBump=!0),s&&(o.isCascadeBump=!0),c&&o.sources.set(c.name,{bumpType:c.bumpType,newVersion:c.newVersion}),o.type!==r}return e.set(a,{isCascadeBump:s,isDependencyBump:i,isGroupBump:l,name:a,proactiveSeen:!1,reasons:new Set([n]),sources:c?new Map([[c.name,{bumpType:c.bumpType,newVersion:c.newVersion}]]):new Map,type:t}),!0},Ba=(e,a,t,n)=>{const s=t?.get(e)?.dependencyBumpRules?.[a];if(s!==void 0)return s;const i=n.dependencyBumpRules?.[a];return i!==void 0?i:ze[a]??!1},Me=(e,a)=>te(e)>=te(a),je=(e,a)=>a==="match"?e:a,Oa=(e,a)=>a===!0?!0:Array.isArray(a)?a.includes(e):!1,Ta=10,xa=(e,a,t,n,s,i,l)=>{let c=!1;for(const o of e.values()){const r=a.getPackage(o.name);if(!r)continue;const u=n.currentVersions?.get(o.name)??r.version,g=t.get(o.name)??se({bump:o.type,bumpMinorPreMajor:n.bumpMinorPreMajor,bumpPatchForMinorPreMajor:n.bumpPatchForMinorPreMajor,current:u,prerelease:n.prerelease});t.set(o.name,g);for(const p of a.getDependents(o.name)){if(p.kind==="devDependencies"){if(!Oa(o.name,i.bumpDevDependencies))continue;if(W(e,p.name,"patch","DEVDEPENDENCY_BUMPED",{isDependencyBump:!0,source:{bumpType:o.type,name:o.name,newVersion:g}})&&(c=!0,t.delete(p.name)),i.bumpDevDependencies===!0){let y=l.get(o.name);y||(y=new Set,l.set(o.name,y)),y.add(p.name)}continue}const d=Fe(p.range);if(d===null||La(g,d))continue;let f,$="DEPENDENCY_OUT_OF_RANGE";p.kind==="peerDependencies"?(f=o.type==="none"?"patch":o.type,$="PEER_DEP_MATCH",d.startsWith("^0.")&&f!=="patch"&&s.push(`^0.x peer dep "${o.name}" → "${p.name}" produced a ${f} bump. Consider widening the range manually.`)):f="patch",W(e,p.name,f,$,{isDependencyBump:!0,source:{bumpType:o.type,name:o.name,newVersion:g}})&&(c=!0,t.delete(p.name))}}return c},Ga=(e,a,t)=>{let n=!1;for(const s of t.fixed??[]){const i=$e(s),l=re(i.packages,a),c=l.filter(r=>e.has(r));if(c.length===0)continue;let o="none";for(const r of c)o=me(o,e.get(r).type);for(const r of l)a.isInternal(r)&&W(e,r,o,"FIXED_GROUP",{isGroupBump:!0})&&(n=!0)}for(const s of t.linked??[]){const i=$e(s),l=re(i.packages,a).filter(o=>e.has(o));if(l.length===0)continue;let c="none";for(const o of l)c=me(c,e.get(o).type);for(const o of l)W(e,o,c,"LINKED_GROUP",{isGroupBump:!0})&&(n=!0)}return n},De=new WeakMap,Ua=/[!()*+?@[\]{|}]/,re=(e,a)=>{let t=De.get(a);t||(t={allNames:a.allPackages().map(s=>s.name),matched:new Map},De.set(a,t));const n=new Set;for(const s of e){if(!Ua.test(s)){n.add(s);continue}let i=t.matched.get(s);i||(i=t.allNames.filter(l=>ne(s,l)),t.matched.set(s,i));for(const l of i)n.add(l)}return[...n]},Ha=(e,a,t,n,s,i)=>{let l=!1;const c=n.updateInternalDependencies??"out-of-range",o=r=>{const u=i.get(r.name);if(u!==void 0)return u;const g=se({bump:r.type,bumpMinorPreMajor:s.bumpMinorPreMajor,bumpPatchForMinorPreMajor:s.bumpPatchForMinorPreMajor,current:s.currentVersions?.get(r.name)??t.getPackage(r.name).version,prerelease:s.prerelease});return i.set(r.name,g),g};for(const r of a){if("bumps"in r.payload||!r.payload.cascade)continue;const u=e.get(r.payload.package);if(!u)continue;const g=i.get(u.name)??se({bump:u.type,bumpMinorPreMajor:s.bumpMinorPreMajor,bumpPatchForMinorPreMajor:s.bumpPatchForMinorPreMajor,current:s.currentVersions?.get(u.name)??t.getPackage(u.name).version,prerelease:s.prerelease});i.set(u.name,g);for(const[p,d]of Object.entries(r.payload.cascade))for(const f of re([p],t))t.isInternal(f)&&W(e,f,d,"CASCADE",{isCascadeBump:!0,source:{bumpType:u.type,name:u.name,newVersion:g}})&&(l=!0)}for(const r of e.values()){const u=s.perPackageConfig?.get(r.name)?.cascadeTo;if(u)for(const[g,p]of Object.entries(u)){if(!Me(r.type,p.trigger))continue;const d=je(r.type,p.bumpAs),f=o(r);for(const $ of re([g],t))t.isInternal($)&&W(e,$,d,"CASCADE_TO",{isCascadeBump:!0,source:{bumpType:r.type,name:r.name,newVersion:f}})&&(l=!0)}}if(c==="out-of-range")return l;for(const r of e.values())if(!r.proactiveSeen&&!(c==="minor"&&te(r.type)<te("minor"))){for(const u of t.getDependents(r.name)){const g=Ba(u.name,u.kind,s.perPackageConfig,n);if(g===!1||!Me(r.type,g.trigger))continue;const p=je(r.type,g.bumpAs);if(p==="none")continue;const d=o(r);W(e,u.name,p,"DEPENDENCY_BUMPED",{isDependencyBump:!0,source:{bumpType:r.type,name:r.name,newVersion:d}})&&(l=!0)}r.proactiveSeen=!0}return l},Wa=(e,a,t,n={})=>{const s=e.filter(d=>ue(d)),i=s.length>0?e.filter(d=>!ue(d)):e,l=new Map,c=[],o=new Map;for(const[d,f]of Ca(i).entries()){if(!a.isInternal(d)){c.push(`Change file references non-workspace package "${d}" — ignored.`);continue}f!=="none"&&W(l,d,f,"EXPLICIT")}for(const d of n.catalogConsumers??[]){if(!a.isInternal(d.packageName))continue;const f=`catalog:${d.catalog}/${d.dep}`;W(l,d.packageName,"patch","CATALOG_CHANGED",{isDependencyBump:!0,source:{bumpType:"patch",name:f,newVersion:d.newVersion??""}})}const r=new Map,u=d=>{const f=Ae(d,i).map(y=>"releaseAs"in y.payload?{file:y.path,version:y.payload.releaseAs}:void 0).filter(y=>y!==void 0&&typeof y.version=="string"),$=new Set(f.map(y=>y.version));if($.size>1)throw new C({code:"BUMP_FILE_INVALID",message:`Conflicting releaseAs values for ${d}: ${[...$].join(", ")}. Found in: ${f.map(y=>y.file).join(", ")}. Consolidate the change files to a single override.`,packageName:d});return f[0]?.version},g=new Map;for(const d of l.values()){if(d.type==="none")continue;const f=u(d.name);f&&(g.set(d.name,f),o.set(d.name,f))}for(let d=0;d<pe;d+=1){const f=xa(l,a,o,n,c,t,r),$=Ga(l,a,t),y=Ha(l,i,a,t,n,o);if(!f&&!$&&!y)break;d===pe-1&&c.push(`Release plan did not converge after ${pe} iterations — releasing the current best plan. This usually indicates a config bug (cyclic cascade?).`)}for(const[d,f]of r){const $=f.size;$>Ta&&c.push(`bumpDevDependencies: true triggered ${$} patch-cascades to distinct dependents from a single devdep bump (${d}). Consider scoping with the array form ['only', 'these', 'sources'].`)}const p=[];for(const d of l.values()){if(d.type==="none")continue;const f=a.getPackage(d.name);if(!f)continue;const $=Ae(d.name,i),y=g.get(d.name),b=n.currentVersions?.get(d.name)??f.version,P=y??o.get(d.name)??se({bump:d.type,bumpMinorPreMajor:n.bumpMinorPreMajor,bumpPatchForMinorPreMajor:n.bumpPatchForMinorPreMajor,current:b,prerelease:n.prerelease});p.push({changeFiles:$,isCascadeBump:d.isCascadeBump,isDependencyBump:d.isDependencyBump,isGroupBump:d.isGroupBump,name:d.name,newVersion:P,oldVersion:b,reasons:[...d.reasons],sources:[...d.sources.entries()].map(([k,V])=>({name:k,...V})),type:d.type})}if(p.sort((d,f)=>d.name.localeCompare(f.name)),s.length>0){const d=da(s,p);for(const[f,$]of d.injectionsByPackage){const y=p.find(b=>b.name===f);y&&(y.changeFiles=[...y.changeFiles,...$])}return{consumedChangeFiles:[...i,...d.consumed],releases:p,warnings:c}}return{consumedChangeFiles:i,releases:p,warnings:c}},Ee=async(e,a,t={})=>{const n=await e.listPackages(),s=[],i=new Map,l=new Map,c=g=>{const p=ge(g);try{return ve.native(p)}catch{try{return ve(p)}catch{return p}}},o=t.cwd===void 0?void 0:c(t.cwd),r=g=>g.replaceAll("\\","/"),u=[];for(const{manifest:g,manifestPath:p}of n){const d=he(typeof g.name=="string"?g.name:"",g,a);if(g.napi!==void 0||d.versionActions==="native-addon"){const f=r(p.replace(/[/\\]package\.json$/i,""));u.push(`${f}/npm/`)}}for(const{manifest:g,manifestPath:p}of n){if(typeof g.name!="string"||g.name==="")continue;const d=r(p.replace(/[/\\]package\.json$/i,""));if(u.some(y=>d.startsWith(y)))continue;if(na(g.name),l.has(g.name))throw new C({code:"DUPLICATE_PACKAGE_NAME",message:`Duplicate package name "${g.name}" — at ${l.get(g.name)} and ${p}.`,packageName:g.name});if(l.set(g.name,p),o!==void 0){const y=c(p),b=o.endsWith(K)?o:`${o}${K}`,P=V=>K==="\\"?V.toLowerCase():V,k=P(y);if(k!==P(o)&&!k.startsWith(P(b)))throw new C({code:"CONFIG_INVALID",message:`Package manifest is outside the workspace: ${p} (workspace: ${o}).`,packageName:g.name})}const f=he(g.name,g,a);if(!_e(g.name,g,f,a))continue;const $=p.replace(/[/\\]package\.json$/i,"");s.push({dir:$,manifest:g,manifestPath:p,name:g.name,private:g.private===!0,version:typeof g.version=="string"?g.version:"0.0.0"}),i.set(g.name,f)}return{packages:s,perPackageConfig:i}},he=(e,a,t)=>{const n=t.packages?.[e]??{},s=a["vis-release"]??{};return{...n,...s}},_e=(e,a,t,n)=>t.managed===!1?!1:t.managed===!0?!0:Ve(e,n.ignore??[])?!1:Ve(e,n.include??[])?!0:a.private===!0&&!(n.privatePackages?.version??!1)?!1:n.defaultManaged??!1,Ve=(e,a)=>a.some(t=>ne(t,e)),Se=(e,a)=>a.versionActions!==void 0?a.versionActions:e.manifest.napi!==void 0?"native-addon":e.private?"private":"npm",mt=Object.defineProperty({__proto__:null,discoverPackages:Ee,isPackageManaged:_e,mergePerPackageConfig:he,resolveVersionActionsId:Se},Symbol.toStringTag,{value:"Module"}),ut=async(e={})=>{const a=e.cwd??process.cwd(),t=Q(),n=await sa(a),s=ra(n,t),i=await s.detectVersion(a);if(i&&!Ya(i,s.minVersion))throw new C({code:"PM_VERSION_TOO_LOW",hint:`pnpm install -g ${s.id}@latest (or your equivalent)`,message:`${s.id} version ${i} is below the required minimum ${s.minVersion}. Upgrade ${s.id} to enable release operations.`});let l={};try{const{loadVisConfig:R}=await import("./CONFIG_FILES.js"),F=await R(a);F.release&&(l=F.release)}catch(R){const{code:F}=R,N=R.message??"";if(!(F==="ENOENT"||F==="MODULE_NOT_FOUND"||/cannot find module/i.test(N)))throw R}const c=Ja(l,e.config??{});!c.acknowledgeUnstable&&process.env.VIS_RELEASE_SUPPRESS_UNSTABLE!=="1"&&process.stderr.write("[vis release] ⚠ This subsystem is flagged unstable. Set `release.acknowledgeUnstable: true` in vis.config.ts to suppress this warning. (RFC §21.2)\n");const o=e.channel??await ja(a,t),r=o?Na(o,c.channels):void 0,u=await import("node:fs/promises"),g={listPackages:async()=>{const R=await s.listWorkspacePackages(a);return(await Promise.all(R.map(async F=>{const N=`${F.path}/package.json`;try{const _=await u.readFile(N,"utf8");return{manifest:JSON.parse(_),manifestPath:N}}catch{return}}))).filter(F=>F!==void 0)}},{packages:p,perPackageConfig:d}=await Ee(g,c,{cwd:a}),f=new Va(p),{files:$}=await Ia({changesDir:c.changesDir,cwd:a}),{readPreMode:y}=await import("./pre-mode.js"),b=await y(a,c.changesDir??".vis/release");let P;b?.mode==="pre"?P=b.tag:b?.mode==="exit-pending"?P=void 0:P=r?.prerelease;const k=e.firstRelease===!0,{resolveCurrentVersionsForWorkspace:V}=await import("./version-resolver.js"),{versions:h,warnings:L}=await V(p,f,c,d,{cwd:a,firstRelease:k,pm:s,runner:t,skipRegistryLookup:e.skipRegistryLookup===!0}),I=[],B=[];if(c.detectCatalogChanges===!0)try{const{detectCatalogChanges:R,findCatalogConsumers:F,parseCatalogs:N}=await import("./catalog-detector.js"),_=await s.readCatalogYaml(a),J=N(_);let G;try{const m=await t.run("git",["show","HEAD~1:pnpm-workspace.yaml"],{cwd:a,silent:!0});m.exitCode===0&&(G=m.stdout)}catch{}const oe=N(G),Y=R(oe,J).filter(m=>m.oldVersion!==void 0&&m.newVersion!==void 0);if(Y.length>0){const m=F(p,J);for(const v of Y){const j=m.get(v.catalog)?.get(v.dep)??[];for(const x of j)I.push({catalog:v.catalog,dep:v.dep,newVersion:v.newVersion,oldVersion:v.oldVersion,packageName:x.packageName})}I.length>0&&B.push(`Catalog change-detection: ${Y.length} catalog dep(s) moved; ${I.length} consumer-package patch bump(s) tagged CATALOG_CHANGED.`)}}catch(R){B.push(`Catalog change-detection skipped: ${R.message}.`)}const A=Wa($,f,c,{bumpMinorPreMajor:c.bumpMinorPreMajor,bumpPatchForMinorPreMajor:c.bumpPatchForMinorPreMajor,catalogConsumers:I,currentVersions:h,perPackageConfig:d,prerelease:P});if(B.length>0&&A.warnings.push(...B),L.length>0&&A.warnings.push(...L),k&&A.warnings.push('First-release mode: currentVersionResolver forced to "disk", remote tag-collision checks skipped. Drop --first-release after the initial wave lands.'),b?.mode==="pre"&&A.warnings.push(`Pre-mode is ACTIVE (tag "${b.tag}"); every version produces a prerelease. Exit with \`vis release pre exit\` when ready to ship stable.`),b?.mode==="exit-pending"&&A.warnings.push(`Pre-mode is EXIT-PENDING (was "${b.tag}"); the next \`vis release version\` will consolidate the prerelease and delete pre.json.`),r?.overlapping&&r.overlapping.length>0&&A.warnings.push(`Branch "${o}" matches multiple channel patterns: "${r.branch}" (active) plus ${r.overlapping.map(R=>`"${R}"`).join(", ")}. Reorder channels in vis.config.ts if this is unintentional.`),e.projects&&e.projects.length>0){const{default:R}=await import("./index.js"),F=e.projects;A.releases=A.releases.filter(N=>F.some(_=>N.name===_||R(_,N.name)))}return{branch:o,channel:r?{mode:r.mode,prerelease:r.prerelease,tag:r.tag}:void 0,config:c,cwd:a,depGraph:f,firstRelease:k,packages:p,perPackageConfig:d,plan:A,pm:s,preMode:b}},Ja=(...e)=>{let a={...qe};for(const t of e)a={...a,...t};return a},Ya=(e,a)=>{const t=H.coerce(e)?.version??e;try{return H.gte(t,a)}catch{return!0}},Z=async(e,a,t)=>{if(!a||a.trim()==="")return;const n=Q(),s=process.platform==="win32",i=s?"cmd":"sh",l=s?["/c",a]:["-c",a],c=await n.run(i,l,{cwd:e,silent:!1});if(c.exitCode!==0)throw new Error(`${t} failed (exit ${c.exitCode}): ${a}`)},Le=async(e,a,t,n={})=>{const{findConflictingPendingStages:s,readStagedRegistry:i,removePendingStages:l,writeStagedRegistry:c}=await import("./staged-registry.js"),o=e.config.changesDir??ae;let r=t??await i(e.cwd,o);if(r.pending.length===0)return;const u=new Map(e.plan.releases.map(y=>[y.name,y.newVersion])),g=[...u.keys()];let p=s(r,g).filter(y=>u.get(y.name)!==y.version);if(p.length===0)return;let d=[];if(!n.skipSelfHeal){const y=n.runner??Q();d=(await Promise.all(p.map(async b=>{const P=await y.run("npm",["view",`${b.name}@${b.version}`,"dist.tarball","--silent"],{cwd:e.cwd,silent:!0});return P.exitCode===0&&P.stdout.trim().length>0?b.id:void 0}))).filter(b=>b!==void 0)}if(d.length>0){if(r=l(r,d),n.persistSelfHeal!==!1)try{await c(e.cwd,o,r)}catch{}if(p=s(r,g).filter(y=>u.get(y.name)!==y.version),p.length===0)return}const f=p.map(y=>` • ${y.name}@${y.version} — stage ${y.id} (${y.reason}, recorded ${y.stagedAt})`).join(`
|
|
10
|
+
`),$=a==="version"?"version":"publish";throw new C({code:"STAGE_PENDING",hint:"Resolve via `vis release stage approve <id>` / `--all` or `vis release stage reject <id>`, commit the updated staged.json, then retry.",message:`Refusing to ${$} — ${p.length} package(s) have a pending stage from a prior wave:
|
|
11
|
+
${f}`})},ft=async(e,a={})=>{if(e.plan.releases.length===0)return{changedFiles:[],deletedFiles:[],plan:e.plan};if(await Le(e,"version",void 0,{persistSelfHeal:!1}),!a.dryRun&&e.config.preVersionCommand&&await Z(e.cwd,e.config.preVersionCommand,"preVersionCommand"),!a.dryRun&&e.config.groupPreVersionCommands){const{normaliseGroup:p}=await import("../release/types.js"),d=[...e.config.fixed??[],...e.config.linked??[]].map($=>p($)),{default:f}=await import("./index.js");for(const[$,y]of Object.entries(e.config.groupPreVersionCommands)){const b=Number.parseInt($.replace(/^group-/,""),10),P=d[b];!P||!e.plan.releases.some(k=>P.packages.some(V=>k.name===V||f(V,k.name)))||await Z(e.cwd,y,`groupPreVersionCommand[${$}]`)}}const t=await import("node:fs/promises"),{readFileSync:n}=await import("node:fs"),{resolveFormatter:s}=await import("./resolveFormatter.js"),{resolveGroupChangelogRouting:i}=await import("./workspace.js"),l=await s(e.config.changelog,e.cwd),c=new Date().toISOString().slice(0,10),o=i(e.config,e.packages,e.cwd),r=await Xe(e.plan,e.depGraph,{changelogPath:p=>o.get(p.name)??`${p.dir}/CHANGELOG.md`,readChangelog:p=>{try{return n(p,"utf8")}catch{return}},readManifest:p=>{try{return n(p,"utf8")}catch{return}},renderChangelogEntry:p=>l({changeFiles:p.changeFiles,date:c,release:p,target:"changelog"})}),u=[];{const{applyExtraFilesForRelease:p}=await import("./extra-files.js"),d=await Promise.all(e.plan.releases.map(async f=>{const $=e.depGraph.getPackage(f.name);if(!$)return{warnings:[],writes:[]};const y=e.perPackageConfig.get(f.name)?.extraFiles??[],b=e.config.publish?.extraFiles??[];return y.length===0&&b.length===0?{warnings:[],writes:[]}:p(e.cwd,$.dir,f.newVersion,f.name,b,y)}));for(const f of d){for(const $ of f.writes)r.writes.push({content:$.content,path:$.path});u.push(...f.warnings)}u.length>0&&e.plan.warnings.push(...u)}if(a.dryRun)return{changedFiles:r.writes.map(p=>p.path),deletedFiles:r.deletions,plan:e.plan};await Promise.all([...r.writes.map(p=>Je(p.path,p.content)),...r.deletions.map(async p=>{try{await Ye(p)}catch{}})]);try{await e.pm.installLockfileOnly({cwd:e.cwd,silent:!0})}catch{}if(!a.dryRun&&e.config.formatChangedFiles&&await za(r.writes.map(p=>p.path),e.cwd),e.config.plugins?.length){const{runApplyDraftHooks:p}=await import("./defineReleasePlugin.js");await p({config:e.config,cwd:e.cwd},e.plan)}let g;if(a.commit){const{stageAndCommit:p}=await import("./git.js"),d=Q(),f=["pnpm-lock.yaml","package-lock.json","yarn.lock","bun.lock","bun.lockb"],$=await import("node:path"),y=[];for(const P of f)try{await t.access($.join(e.cwd,P)),y.push($.join(e.cwd,P))}catch{}const b=e.config.aggregateRelease===!0||typeof e.config.aggregateRelease=="object"&&e.config.aggregateRelease.enabled;if(e.config.oneCommitPerPackage===!0&&!b&&e.plan.releases.length>0){const P=e.channel?.tag??e.branch??"main",k=r.writes.map(L=>L.path),V=new Set,{releases:h}=e.plan;for(let L=0;L<h.length;L+=1){const I=h[L],B=e.depGraph.getPackage(I.name),A=B?`${B.dir}${$.sep}`:void 0,R=A?k.filter(_=>_.startsWith(A)):[];for(const _ of R)V.add(_);const F=L===h.length-1?[...k.filter(_=>!V.has(_)),...r.deletions,...y]:[],N=[...R,...F];N.length!==0&&(g=await p({cwd:e.cwd,runner:d},N,`release(${P}): ${I.name}@${I.newVersion} [skip ci]`,{author:e.config.gitUser}))}}else{const P=a.commitMessage??qa(e),k=[...r.writes.map(V=>V.path),...r.deletions,...y];g=await p({cwd:e.cwd,runner:d},k,P,{author:e.config.gitUser})}}if(!a.dryRun&&e.config.postVersionCommand&&await Z(e.cwd,e.config.postVersionCommand,"postVersionCommand"),!a.dryRun&&e.preMode?.mode==="exit-pending"){const{deletePreMode:p,preModeFilePath:d}=await import("./pre-mode.js"),f=e.config.changesDir??".vis/release";await p(e.cwd,f)&&e.plan.warnings.push(`Pre-mode exited: \`${d(e.cwd,f)}\` was deleted. Commit the deletion so the registry stays consistent across CI runs.`)}return{changedFiles:r.writes.map(p=>p.path),commitSha:g,deletedFiles:r.deletions,plan:e.plan}},za=async(e,a)=>{if(e.length===0)return;const{join:t}=await import("node:path");let n;try{const{createRequire:i}=await import("node:module"),{pathToFileURL:l}=await import("node:url"),c=i(t(a,"package.json"));n=await import(l(c.resolve("prettier")).href)}catch{return}const s=await import("node:fs/promises");for(const i of e)try{const l=await n.getFileInfo(i);if(l.ignored||!l.inferredParser)continue;const c=await s.readFile(i,"utf8"),o=await n.resolveConfig(i),r=await n.format(c,{...o,filepath:i});r!==c&&await s.writeFile(i,r)}catch{}},qa=e=>{const a=e.channel?.tag??e.branch??"main",{releases:t}=e.plan,n=t.length<=3?t.map(i=>`${i.name}@${i.newVersion}`).join(", "):`version ${t.length} packages`,s=t.map(i=>`- ${i.name}: ${i.oldVersion} → ${i.newVersion}`).join(`
|
|
12
12
|
`);return`release(${a}): ${n} [skip ci]
|
|
13
13
|
|
|
14
|
-
${s}`},
|
|
15
|
-
`)}
|
|
16
|
-
`)}}catch(L){process.stderr.write(`[vis release] Warning: could not
|
|
17
|
-
`)}}if(!a.dryRun&&t.published.length>0&&
|
|
18
|
-
`)}}
|
|
19
|
-
`)}}if(!a.dryRun&&e.config.
|
|
14
|
+
${s}`},de=async(e,a,t,n,s)=>{const{stageAndCommitFile:i}=await import("./git.js"),{stateFilePath:l}=await import("./state.js");try{const c=await i({cwd:e.cwd,runner:a},l(e.cwd,t,!0),`chore(release): ${n} publish lock [skip ci]`,{author:e.config.gitUser,push:!s.noPush,sign:e.config.gitSignCommits===!0});!s.noPush&&c.committed&&!c.pushed&&process.stderr.write(`[vis release] Warning: publish lock (${n}) was committed locally but could not be pushed — cross-runner resume may use a stale lock.
|
|
15
|
+
`)}catch(c){process.stderr.write(`[vis release] Warning: could not commit publish lock (${n}): ${c.message}
|
|
16
|
+
`)}},ht=async(e,a={})=>{const t={failed:[],published:[],skipped:[],tags:[],tagsPushed:!1},n=Q();if(e.plan.releases.length===0)return t;if(!a.dryRun&&e.channel?.mode==="version-pr"){const{createRemoteClient:o,detectRemoteProvider:r}=await import("./detect2.js"),u=await r(e.cwd,n,e.config.provider),g=await o(u,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}).detectRepoSlug(e.cwd,n),p=e.config.versionPr?.branch??"vis-release/version-packages";if(g)try{const d=await n.run("gh",["pr","list","--head",p,"--state","open","--json","number"],{cwd:e.cwd,silent:!0});if(d.exitCode===0&&d.stdout.trim()&&d.stdout.trim()!=="[]"){const f=JSON.parse(d.stdout);if(f[0])return t.failed.push({name:"_preflight",reason:`Open release PR #${f[0].number} exists. Merge or close it before publishing locally. (Override: --no-push then \`git push --tags\` manually.)`}),t}}catch{}}if(!a.dryRun&&e.config.prePublishCommand)try{await Z(e.cwd,e.config.prePublishCommand,"prePublishCommand")}catch(o){return t.failed.push({name:"_prePublishCommand",reason:o.message}),t}const s=e.config.changesDir??ae,{acquireLock:i,releaseLock:l}=await import("./state.js");let c=!1;if(!a.dryRun)try{await i(e.cwd,s),c=!0}catch(o){return t.failed.push({name:"_lock",reason:o.message}),t}try{const{clearState:o,filterPlanByState:r,newState:u,readState:g,writeState:p}=await import("./state.js"),{readStagedRegistry:d,removePendingStages:f,upsertPendingStages:$,writeStagedRegistry:y}=await import("./staged-registry.js"),b=e.config.changesDir??ae,P=e.config.publish?.lockInGit===!0;let k=a.resume||P?await g(e.cwd,b,P):void 0;k&&P&&(k.channel=e.channel?.tag);const V=async()=>{a.dryRun||!k||(await p(e.cwd,b,k,P),P&&await de(e,n,b,"progress",{noPush:a.noPush}))};let h=await d(e.cwd,b);await Le(e,"publish",h,{runner:n}),h=await d(e.cwd,b);const L={pending:[...h.pending]};let{releases:I}=e.plan;k?I=r(I,k):(k=u(e.channel?.tag,e.plan.releases),a.dryRun||(await p(e.cwd,b,k,P),P&&await de(e,n,b,"open",{noPush:a.noPush})));const B=await e.pm.readCatalogYaml(e.cwd),A=Ke(B),R=e.depGraph.topologicalSort(I.map(m=>m.name)),F=new Map(I.map(m=>[m.name,m])),N=new Set,_=new Map;for(const m of e.plan.releases){const v=e.depGraph.getPackage(m.name);v&&_.set(m.name,{...v.manifest,version:m.newVersion})}const J={config:e.config,cwd:e.cwd},G=e.config.plugins?.length?await import("./defineReleasePlugin.js"):void 0;for(const m of R){const v=F.get(m);if(!v){t.skipped.push({name:m,reason:"topo-sort returned a name not in the release plan (internal bug)"});continue}const j=e.depGraph.getPackage(m);if(!j)continue;const x=[...new Set(e.depGraph.getDependencies(m).filter(w=>w.kind!=="devDependencies"&&N.has(w.name)).map(w=>w.name))];if(x.length>0){t.skipped.push({name:m,reason:`dependency-failed: not published because ${x.join(", ")} failed to publish (publishing would orphan this package's dependency range)`}),N.add(m);continue}const O=e.perPackageConfig.get(m)??{},E=Se(j,O),U=a.publishActionsOverride??Ze(E),T=a.tag??e.channel?.tag;if(G){const w=await G.runWillPublishHooks(J,{dir:j.dir,name:m,oldVersion:v.oldVersion,version:v.newVersion});if(w.skip){t.skipped.push({name:m,reason:`plugin-skipped${w.by?` by "${w.by}"`:""}`}),N.add(m);continue}}const M=h.pending.find(w=>w.name===m&&w.version===v.newVersion);try{const w=await U.publish({catalogs:A,cleanPackageJsonConfig:e.config.publish?.cleanPackageJson,dryRun:a.dryRun,otp:a.otp,perPackageConfig:O,pkg:j,pm:e.pm,provenance:et(e),registry:O.registry,release:v,resumeStageId:M?.id,tag:T,versionedManifestByName:_,workspaceConfig:e.config});if(w.published||w.alreadyPublished){const D=h.pending.filter(S=>S.name===m&&S.version===v.newVersion).map(S=>S.id);D.length>0&&(h=f(h,D))}if(w.published)t.published.push({name:m,stageId:w.stageId,tarball:w.tarball,version:v.newVersion}),k.published.push(`${m}@${v.newVersion}`),G&&await G.runAfterPublishHooks(J,{dir:j.dir,name:m,oldVersion:v.oldVersion,version:v.newVersion});else if(w.alreadyPublished)t.skipped.push({name:m,reason:"already-published"}),k.published.push(`${m}@${v.newVersion}`);else if(t.skipped.push({name:m,reason:w.output??"skipped"}),w.stageId){const D=(w.output??"").startsWith("stage-rejected")?"rejected":"timeout";h=$(h,[{id:w.stageId,name:m,reason:D,stagedAt:new Date().toISOString(),tag:T??"latest",version:v.newVersion}])}await V()}catch(w){t.failed.push({name:m,reason:w.message}),N.add(m)}}G&&await G.runAfterPublishAllHooks(J,{failed:t.failed.map(m=>({name:m.name,reason:m.reason})),published:t.published.map(m=>({name:m.name,version:m.version})),skipped:t.skipped.map(m=>({name:m.name,reason:m.reason}))});const{resolveSyncTagGroups:oe}=await import("./group-tags.js"),Y=oe(e.config,t.published);if(!a.dryRun&&!a.noTag&&t.published.length>0){const{createOrUpdateFloatingTag:m,createTag:v,defaultTagFor:j,pushTags:x,renderTagPattern:O}=await import("./git.js"),E=e.config.releaseTagPattern,U=e.channel?.tag,T=e.config.floatingMajorTag===!0,M=!!e.channel?.prerelease||!!e.preMode;for(const{name:w,version:D}of t.published){if(Y.grouped.has(w))continue;const S=e.perPackageConfig.get(w)?.releaseTagPattern??E,z=S?O(S,{channel:U,name:w,version:D}):j(w,D);try{await v({cwd:e.cwd,runner:n},z,`Release ${w}@${D}`,{signing:e.config.signing,skipRemoteCheck:e.firstRelease}),t.tags.push(z)}catch(q){e.firstRelease&&q instanceof C&&q.code==="TAG_COLLISION"?t.skipped.push({name:z,reason:"tag-creation: tag already exists (first-release — skipped)"}):t.skipped.push({name:z,reason:`tag-creation: ${q.message}`})}const ee=e.depGraph.getPackage(w),Be=e.perPackageConfig.get(w),Oe=ee?.manifest?.private===!0,Te=Be?.skipNpmPublish===!0;if(T&&!M&&!S?.includes("{major}")&&!Oe&&!Te){const q=D.split(/[-+]/,1)[0].split(".")[0];if(q!==void 0&&q!==""){const be=w.replace(/^@/,"").replaceAll("/","-");if(be!==""){const ie=`${be}-v${q}`;try{await m({cwd:e.cwd,runner:n},ie,{push:!a.noPush,signing:e.config.signing}),t.tags.push(ie)}catch(xe){t.skipped.push({name:ie,reason:`floating-major-tag: ${xe.message}`})}}}}}for(const w of Y.groups)try{await v({cwd:e.cwd,runner:n},w.tag,`Release ${w.name} ${w.version}`,{signing:e.config.signing,skipRemoteCheck:e.firstRelease}),t.tags.push(w.tag)}catch(D){e.firstRelease&&D instanceof C&&D.code==="TAG_COLLISION"?t.skipped.push({name:w.tag,reason:"tag-creation: tag already exists (first-release — skipped)"}):t.skipped.push({name:w.tag,reason:`tag-creation: ${D.message}`})}if(!a.noPush&&t.tags.length>0)try{await x({cwd:e.cwd,runner:n}),t.tagsPushed=!0}catch(w){t.tagsPushed=!1,t.failed.push({name:"_pushTags",reason:`git push --tags failed: ${w.message}. Retry with: git push --tags`})}k.tagged=[...t.tags],k.pushed=t.tagsPushed,await V(),t.failed.length===0&&!a.dryRun&&(await o(e.cwd,b,P),P&&await de(e,n,b,"close",{noPush:a.noPush}))}if(!a.dryRun){const m=L.pending.length,v=h.pending.length,j=await y(e.cwd,b,h);if(j.changed){const{stageAndCommitFile:x}=await import("./git.js");let O;if(j.removed)O="chore(release): clear pending stage registry [skip ci]";else if(v>m){const E=v-m;O=`chore(release): record ${E} new pending stage${E===1?"":"s"} [skip ci]`}else if(v<m){const E=m-v;O=`chore(release): drain ${E} resolved stage${E===1?"":"s"} [skip ci]`}else O=`chore(release): update pending stage registry (${v} pending) [skip ci]`;try{await x({cwd:e.cwd,runner:n},j.path,O,{author:e.config.gitUser,push:!a.noPush,sign:e.config.gitSignCommits===!0})}catch(E){process.stderr.write(`[vis release] Warning: could not commit ${j.path}: ${E.message}
|
|
17
|
+
`)}}}if(!a.dryRun&&t.published.length>0&&e.config.workspaceChangelog!==!1){const m=e.config.workspaceChangelog,v=typeof m=="object"?m:void 0,j=typeof e.config.aggregateRelease=="object"?e.config.aggregateRelease.enabled:e.config.aggregateRelease===!0;if(v!==void 0||j)try{const{writeWorkspaceChangelogWave:x}=await import("./workspace.js"),O=new Set(t.published.map(T=>T.name)),E=e.plan.releases.filter(T=>O.has(T.name)),U=await x({changelogConfig:e.config.changelog,cwd:e.cwd,workspaceChangelog:e.config.workspaceChangelog},E);if(U)try{const{stageAndCommitFile:T}=await import("./git.js");await T({cwd:e.cwd,runner:n},U,"chore(release): record wave [skip ci]",{author:e.config.gitUser,push:!a.noPush,sign:e.config.gitSignCommits===!0})}catch(T){process.stderr.write(`[vis release] Warning: could not commit workspace CHANGELOG.md: ${T.message}
|
|
18
|
+
`)}}catch(x){process.stderr.write(`[vis release] Warning: could not write workspace CHANGELOG.md wave entry: ${x.message}
|
|
19
|
+
`)}}if(!a.dryRun&&t.published.length>0&&t.tagsPushed){e.config.publish?.noRelease!==!0&&await Qa(e,t,n,Y);try{const{walkSuccessfulRelease:m}=await import("./success-walk.js"),{createRemoteClient:v,detectRemoteProvider:j}=await import("./detect2.js"),{resolveFormatter:x}=await import("./resolveFormatter.js"),O=await j(e.cwd,n,e.config.provider),E=v(O,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}),U=await E.detectRepoSlug(e.cwd,n),T=await x(e.config.changelog,e.cwd),{recordRecentlyWalked:M}=await import("./staged-registry.js"),w=new Set([...k.walked??[],...(h.recentlyWalked??[]).map(S=>S.key)]),D={...t,published:t.published.filter(S=>!w.has(`${S.name}@${S.version}`))};if(D.published.length>0){const S=await m(e,D,n,{client:E,formatter:T,repo:U}),z=D.published.map(ee=>`${ee.name}@${ee.version}`);k.walked=[...k.walked??[],...z],await V(),h=M(h,z),S.warnings.length>0&&e.plan.warnings.push(...S.warnings)}}catch(m){e.plan.warnings.push(`successWalk: could not run post-release walk: ${m.message}`)}if(e.config.notifications)try{const{dispatchNotifications:m}=await import("./interface.js"),{createRemoteClient:v,detectRemoteProvider:j}=await import("./detect2.js"),x=await j(e.cwd,n,e.config.provider),O=await v(x,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}).detectRepoSlug(e.cwd,n);let E;try{const M=`${e.cwd}/package.json`,w=await import("node:fs/promises");E=JSON.parse(await w.readFile(M,"utf8")).name}catch{}const U=new Set([...k.notified??[],...(h.recentlyNotified??[]).map(M=>M.key)]),T=t.published.filter(M=>!U.has(`${M.name}@${M.version}`));if(T.length>0){const M=await m(e.config.notifications,{channel:e.channel?.tag,completedAt:new Date().toISOString(),...E===void 0?{}:{monorepoName:E},published:T.map(w=>({name:w.name,tag:e.channel?.tag,...w.url===void 0?{}:{url:w.url},version:w.version})),...O===void 0?{}:{repo:O},skipped:t.skipped.map(w=>({name:w.name,reason:w.reason}))},{warn:w=>e.plan.warnings.push(w)});if(M.succeeded.length>0){const w=T.map(S=>`${S.name}@${S.version}`);k.notified=[...k.notified??[],...w],await V();const{recordRecentlyNotified:D}=await import("./staged-registry.js");h=D(h,w)}if(M.failed.length>0||M.succeeded.length>0){const w=M.succeeded.length+M.failed.length;if(M.failed.length>0){e.plan.warnings.push(`[notifications] dispatched ${M.succeeded.length}/${w} channels${M.succeeded.length>0?` (succeeded: ${M.succeeded.join(", ")})`:""}; ${M.failed.length} failed.`);for(const D of M.failed)e.plan.warnings.push(`[notifications:${D.id}] ${D.error}`)}}}}catch(m){e.plan.warnings.push(`notifications: dispatch failed: ${m.message}`)}if(!a.dryRun)try{const m=await y(e.cwd,b,h);if(m.changed){const{stageAndCommitFile:v}=await import("./git.js");try{await v({cwd:e.cwd,runner:n},m.path,"chore(release): record cross-runner notify/walk dedupe [skip ci]",{author:e.config.gitUser,push:!a.noPush,sign:e.config.gitSignCommits===!0})}catch(j){process.stderr.write(`[vis release] Warning: could not commit ${m.path} (notify/walk dedupe): ${j.message}
|
|
20
|
+
`)}}}catch(m){process.stderr.write(`[vis release] Warning: could not update cross-runner dedupe registry: ${m.message}
|
|
21
|
+
`)}}if(!a.dryRun&&e.config.postPublishCommand)try{await Z(e.cwd,e.config.postPublishCommand,"postPublishCommand")}catch(m){t.failed.push({name:"_postPublishCommand",reason:m.message})}return t}finally{c&&await l(e.cwd,s)}},Xa=e=>e.length===0?"":`## Related releases
|
|
20
22
|
|
|
21
23
|
${e.map(a=>`- [${a.name}](${a.url})`).join(`
|
|
22
|
-
`)}`,
|
|
24
|
+
`)}`,Ka=(e,a,t)=>{if(!a||!a.header&&!a.footer)return e;const n=i=>Ea(i,{contributors:t.contributors??"",date:t.date,name:t.name,previousVersion:t.previousVersion,repo:t.repo,version:t.version}).replaceAll(/\n{3,}/g,`
|
|
23
25
|
|
|
24
|
-
`).replace(/\s+$/,""),s=[];if(a.header){const
|
|
26
|
+
`).replace(/\s+$/,""),s=[];if(a.header){const i=n(a.header);i.length>0&&s.push(i)}if(s.push(e),a.footer){const i=n(a.footer);i.length>0&&s.push(i)}return s.join(`
|
|
25
27
|
|
|
26
|
-
`)},
|
|
27
|
-
`);try{const
|
|
28
|
+
`)},Za=e=>{if(!Array.isArray(e))return;const[a,t]=e;if(a!=="github"||typeof t!="object"||t===null)return;const{internalAuthors:n}=t;if(Array.isArray(n))return n.filter(s=>typeof s=="string")},Qa=async(e,a,t,n)=>{const{createRemoteClient:s,detectRemoteProvider:i}=await import("./detect2.js"),l=await i(e.cwd,t,e.config.provider),c=s(l,{githubHost:e.config.githubHost,gitlabHost:e.config.gitlabHost,httpProxy:e.config.httpProxy}),o=await c.detectRepoSlug(e.cwd,t);if(!o)return;const r=typeof e.config.aggregateRelease=="object"?e.config.aggregateRelease:{enabled:e.config.aggregateRelease===!0},u=e.config.publish?.draftRelease===!0,g=e.config.publish?.discussionCategory,p=e.config.publish?.addReleases;if(r.enabled){const h=new Date().toISOString().slice(0,10),L=(r.title??"Release {date}").replaceAll("{date}",h),I=`release-${h}`,B=a.published.map(A=>`- \`${A.name}\` → ${A.version}`).join(`
|
|
29
|
+
`);try{const A=await c.createRelease(t,{body:B,cwd:e.cwd,discussionCategory:g,draft:u,repo:o,tag:I,title:L});if(A?.url)for(const R of a.published)R.url=A.url}catch{}return}const{defaultTagFor:d,renderTagPattern:f}=await import("./git.js"),$=e.config.releaseTagPattern,y=e.channel?.tag,b=e.config.publish?.releaseAssets??{},P=new Date().toISOString().slice(0,10),k=Za(e.config.changelog),V=_a(e.plan.consumedChangeFiles??[],{internalAuthors:k});for(const h of n.groups){const L=h.members.map(I=>`- \`${I}\` → ${a.published.find(B=>B.name===I)?.version??h.version}`).join(`
|
|
30
|
+
`);try{const I=await c.createRelease(t,{body:L,cwd:e.cwd,discussionCategory:g,draft:u,prerelease:h.version.includes("-"),repo:o,tag:h.tag,title:`${h.name} ${h.version}`});if(I?.url)for(const B of a.published)h.members.includes(B.name)&&(B.url=I.url)}catch(I){console.warn(`createRelease failed for group ${h.name} (tag ${h.tag}): ${I.message}`)}}for(const h of a.published){if(n.grouped.has(h.name))continue;const L=e.perPackageConfig.get(h.name)?.releaseTagPattern??$,I=L?f(L,{channel:y,name:h.name,version:h.version}):d(h.name,h.version),B=h.version.includes("-");let A=`Release of ${h.name}@${h.version}.`;if(h.stageId&&(A=`${A}
|
|
28
31
|
|
|
29
|
-
> ⏳ **Staged — not yet installable.** Approve via \`vis release stage approve ${
|
|
32
|
+
> ⏳ **Staged — not yet installable.** Approve via \`vis release stage approve ${h.stageId}\` or the npmjs.com web UI.`),b.stampHashes&&h.tarball&&(A=`${A}
|
|
30
33
|
|
|
31
34
|
### Tarball integrity
|
|
32
35
|
|
|
33
|
-
- size: \`${
|
|
34
|
-
- sha256: \`${
|
|
35
|
-
- sha512: \`${
|
|
36
|
+
- size: \`${h.tarball.size}\` bytes
|
|
37
|
+
- sha256: \`${h.tarball.sha256}\`
|
|
38
|
+
- sha512: \`${h.tarball.sha512}\``),p!==void 0&&p!==!1)try{const N=I.lastIndexOf("@"),_=N>0?I.slice(0,N+1):"",J=await c.listRecentReleases(t,{cwd:e.cwd,excludeTag:I,limit:5,repo:o,tagPrefix:_}),G=Xa(J);G&&(A=p==="top"?`${G}
|
|
36
39
|
|
|
37
|
-
${
|
|
40
|
+
${A}`:`${A}
|
|
38
41
|
|
|
39
|
-
${
|
|
42
|
+
${G}`)}catch{}const{releaseNoteTemplate:R}=e.config;if(R){const N=e.plan.releases.find(_=>_.name===h.name)?.oldVersion??"";A=Ka(A,R,{contributors:V,date:P,name:h.name,previousVersion:N,repo:o,version:h.version})}const F=[];b.uploadTarball&&h.tarball&&F.push(h.tarball.path);try{const N=await c.createRelease(t,{assets:F.length>0?F:void 0,body:A,cwd:e.cwd,discussionCategory:g,draft:u,prerelease:B,repo:o,tag:I,title:`${h.name} v${h.version}`});N?.url&&(h.url=N.url)}catch(N){console.warn(`createRelease failed for ${h.name}@${h.version} (tag ${I}): ${N.message}`)}}},et=e=>(e.config.publish?.publishArgs??[]).includes("--provenance")&&e.pm.id!=="bun";export{ft as a,ut as b,Ia as c,Ca as d,gt as f,ht as p,Se as r,mt as w};
|
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import{normaliseGroup as
|
|
1
|
+
import{normaliseGroup as l}from"../release/types.js";const d=o=>o==="debug",m=o=>/[\\/]/.test(o)||/\.(?:pem|gpg|key|asc|p12|pfx)$/i.test(o)||o.length<8?"(key: configured)":`…${o.slice(-4)}`,i=o=>{try{const a=new URL(o);a.username="",a.password="";const s=a.pathname!==""&&a.pathname!=="/"?"/…REDACTED…":"";return`${a.origin}${s}`}catch{return o.replace(/(:\/\/)[^@/]+@/,"$1")||"[REDACTED]"}},h=o=>{if(!o)return o;const a={};for(const s of Object.keys(o))a[s]="[REDACTED]";return a},u=o=>{const a=structuredClone(o);if(a.signing?.key&&(a.signing={...a.signing,key:m(a.signing.key)}),a.httpProxy&&(a.httpProxy=i(a.httpProxy)),a.notifications){const s=a.notifications,n=r=>({...r,webhook:i(r.webhook)}),t=r=>({...r,webhook:i(r.webhook)}),e=r=>({...r,headers:h(r.headers),url:i(r.url)});s.slack&&(s.slack=Array.isArray(s.slack)?s.slack.map(r=>n(r)):n(s.slack)),s.discord&&(s.discord=Array.isArray(s.discord)?s.discord.map(r=>t(r)):t(s.discord)),s.webhook&&(s.webhook=Array.isArray(s.webhook)?s.webhook.map(r=>e(r)):e(s.webhook))}return a},g=o=>o&&o.map(a=>l(a)),b=(o,a,s)=>{const n=o.printConfig;if(n===void 0||n===!1||n==="")return!1;const t=d(n),e=u(a.config),r=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:r,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(p=>p.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 d}from"../packem_shared/advisories-
|
|
1
|
+
import{p as o}from"./cli-main.js";import{r as d}from"../packem_shared/advisories-B76fBVL-.js";const f=async({fs:c,logger:u,options:e,workspaceRoot:s})=>{if(!s)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const r=e.db??d(s),t=e.format==="json";if(!e.force){o.warn(`Prune is destructive. Will remove: ${r}`),o.info("Re-run with --force to proceed."),t&&process.stdout.write(`${JSON.stringify({dbPath:r,reason:"needs --force",removed:!1})}
|
|
2
2
|
`);return}const a=[r,`${r}-wal`,`${r}-shm`,`${r}-journal`],i=[];for(const n of a)try{await c.rm(n,{force:!0}),i.push(n)}catch{}if(t){process.stdout.write(`${JSON.stringify({dbPath:r,files:i,removed:!0})}
|
|
3
3
|
`);return}o.success(`Removed ${r}.`)},w=f;export{w as advisoriesPruneExecute};
|