@visulima/vis 4.1.20 → 4.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/LICENSE.md +804 -360
- package/dist/bin.js +1 -1
- package/dist/binx.js +1 -1
- package/dist/config/index.d.ts +117 -0
- package/dist/packem_chunks/CONFIG_FILES.js +1 -1
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/cargo-plan.js +3 -0
- package/dist/packem_chunks/catalog.js +50 -50
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +146 -142
- package/dist/packem_chunks/composer-projects.js +2 -0
- package/dist/packem_chunks/dart-plan.js +1 -0
- package/dist/packem_chunks/dart-projects.js +1 -0
- package/dist/packem_chunks/dispatch.js +1 -1
- package/dist/packem_chunks/fix.js +1 -1
- package/dist/packem_chunks/gem-plan.js +2 -0
- package/dist/packem_chunks/gem-projects.js +1 -0
- package/dist/packem_chunks/git.js +5 -5
- package/dist/packem_chunks/go-plan.js +1 -0
- package/dist/packem_chunks/go-projects.js +2 -0
- package/dist/packem_chunks/gradle-plan.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 +1 -1
- 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/handler2.js +1 -1
- package/dist/packem_chunks/handler20.js +2 -2
- package/dist/packem_chunks/handler21.js +1 -1
- package/dist/packem_chunks/handler22.js +1 -1
- package/dist/packem_chunks/handler23.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 +2 -2
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler39.js +6 -6
- package/dist/packem_chunks/handler4.js +3 -3
- package/dist/packem_chunks/handler5.js +1 -1
- package/dist/packem_chunks/handler50.js +1 -1
- package/dist/packem_chunks/handler51.js +1 -1
- package/dist/packem_chunks/handler52.js +3 -3
- package/dist/packem_chunks/handler53.js +1 -1
- package/dist/packem_chunks/handler54.js +2 -2
- package/dist/packem_chunks/handler55.js +1 -1
- package/dist/packem_chunks/handler58.js +3 -3
- package/dist/packem_chunks/handler59.js +1 -1
- package/dist/packem_chunks/handler6.js +5 -5
- package/dist/packem_chunks/handler60.js +1 -1
- package/dist/packem_chunks/handler61.js +1 -1
- package/dist/packem_chunks/handler62.js +1 -1
- package/dist/packem_chunks/handler63.js +1 -1
- package/dist/packem_chunks/handler64.js +1 -1
- package/dist/packem_chunks/handler65.js +4 -4
- package/dist/packem_chunks/handler66.js +1 -1
- package/dist/packem_chunks/handler67.js +10 -10
- package/dist/packem_chunks/handler68.js +1 -1
- package/dist/packem_chunks/handler69.js +1 -1
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +4 -4
- package/dist/packem_chunks/handler71.js +6 -6
- package/dist/packem_chunks/handler72.js +1 -1
- package/dist/packem_chunks/handler73.js +87 -86
- package/dist/packem_chunks/handler74.js +1 -1
- package/dist/packem_chunks/handler75.js +31 -31
- package/dist/packem_chunks/handler76.js +4 -4
- package/dist/packem_chunks/handler77.js +1 -1
- package/dist/packem_chunks/handler78.js +64 -64
- package/dist/packem_chunks/handler8.js +1 -1
- 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 +7 -7
- package/dist/packem_chunks/hex-plan.js +3 -0
- package/dist/packem_chunks/hex-projects.js +1 -0
- package/dist/packem_chunks/index2.js +52 -42
- package/dist/packem_chunks/index4.js +58 -802
- package/dist/packem_chunks/index5.js +802 -7
- package/dist/packem_chunks/index6.js +7 -59
- 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/maven-plan.js +1 -0
- package/dist/packem_chunks/maven-projects.js +1 -0
- package/dist/packem_chunks/nuget-plan.js +1 -0
- package/dist/packem_chunks/nuget-projects.js +1 -0
- package/dist/packem_chunks/orchestrator.js +33 -33
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/python-plan.js +3 -0
- package/dist/packem_chunks/python-projects.js +1 -0
- package/dist/packem_chunks/security.js +1 -1
- package/dist/packem_chunks/snapshot.js +2 -2
- package/dist/packem_chunks/status.js +1 -1
- package/dist/packem_chunks/swift-projects.js +1 -0
- package/dist/packem_chunks/sync.js +3 -2
- package/dist/packem_chunks/sync2.js +1 -1
- package/dist/packem_chunks/tripwire.js +1 -1
- package/dist/packem_chunks/ts-loader.js +5 -5
- package/dist/packem_chunks/verify-lockfile.js +1 -1
- package/dist/packem_chunks/version-resolver.js +3 -3
- package/dist/packem_chunks/zig-plan.js +1 -0
- package/dist/packem_chunks/zig-projects.js +1 -0
- package/dist/packem_shared/Table-BB8xHTU5-BLPS917D.js +11 -0
- package/dist/packem_shared/affected-selection-BzIbfpA1.js +1 -0
- package/dist/packem_shared/{affected-shas-Dd0P7fGD.js → affected-shas-B2V84O0g.js} +1 -1
- package/dist/packem_shared/{ai-analysis-DSQQDFU9.js → ai-analysis-Cfj24UAy.js} +1 -1
- package/dist/packem_shared/{ai-fix-BHyx1F1j.js → ai-fix-DeRUtT-s.js} +1 -1
- package/dist/packem_shared/{augment-COAiXSIx.js → augment-B9kSZuvW.js} +1 -1
- package/dist/packem_shared/{bin-Bq3tJmvE.js → bin-D9TsVhq2.js} +1 -1
- package/dist/packem_shared/{build-scripts-pdVmqXRm.js → build-scripts-CEDx_nJp.js} +1 -1
- package/dist/packem_shared/{command-runtime-CiLVo4ED.js → command-runtime-p4IXiIf6.js} +1 -1
- package/dist/packem_shared/composer-DR3D-Psb.js +1 -0
- package/dist/packem_shared/dart-pubspec-BK_cK2EP.js +2 -0
- package/dist/packem_shared/{dependency-scan-DBH2Qo4I.js → dependency-scan-B8jroa1D.js} +1 -1
- package/dist/packem_shared/{docker-Dy-X_BuM.js → docker-DXqV-07f.js} +1 -1
- package/dist/packem_shared/ecosystem-gate-1M3wnsTr.js +6 -0
- package/dist/packem_shared/{failure-log-3R522Vb5.js → failure-log-D2x5BT8S.js} +1 -1
- package/dist/packem_shared/{formatBytes-BHAzNIrn-XohRrPdt.js → formatBytes-BHAzNIrn-CrusHOew.js} +1 -1
- package/dist/packem_shared/gemspec-K7N05xxc.js +3 -0
- package/dist/packem_shared/glob-Cyk1H9ZL-Dxlf9Swz.js +1 -0
- package/dist/packem_shared/go-modules-BsVqtyeC.js +1 -0
- package/dist/packem_shared/gradle-build-CHZDHyjI.js +8 -0
- package/dist/packem_shared/index-BO8qIogg.js +1 -0
- package/dist/packem_shared/index-BzhrR_iC.js +22 -0
- package/dist/packem_shared/{index-Vm90Te96.js → index-CNYv9D8g.js} +1 -1
- package/dist/packem_shared/{isAccessibleSync-DYKTrrvc-CSnBISfV.js → isAccessibleSync-DYKTrrvc-C-_5cgwu.js} +1 -1
- package/dist/packem_shared/{lifecycle-CAIJbxIa.js → lifecycle-D6PMPor-.js} +1 -1
- package/dist/packem_shared/{lockfile-DVFySxTS.js → lockfile-CiUtEbnt.js} +1 -1
- package/dist/packem_shared/{manifests-BNSmpPF_.js → manifests-Du4yKlf_.js} +1 -1
- package/dist/packem_shared/maven-pom-B0KG9kJQ.js +1 -0
- package/dist/packem_shared/{min-release-age-ChzTC7_I.js → min-release-age-JViyQuBM.js} +1 -1
- package/dist/packem_shared/missing-package-json-DnHMxRnG.js +1 -0
- package/dist/packem_shared/mix-project-RYvdZp3_.js +2 -0
- package/dist/packem_shared/multi-eco-lockfiles-CUUxUjHK.js +1 -0
- package/dist/packem_shared/{native-config-sync-BSzU4qUO.js → native-config-sync-TdTWjVgI.js} +2 -2
- package/dist/packem_shared/nuget-project-RApYSW_y.js +4 -0
- package/dist/packem_shared/{osv-bloom-JYIWcH3F.js → osv-bloom-BCAX5ARR.js} +1 -1
- package/dist/packem_shared/package-version-DUcG-b7S.js +4 -0
- package/dist/packem_shared/{packument-DyuhH1Gz.js → packument-CyGSNquL.js} +1 -1
- package/dist/packem_shared/{pm-runner-d93_73O6.js → pm-runner-CMSml1Bj.js} +1 -1
- package/dist/packem_shared/{project-name-filter-CC5FF49q.js → project-name-filter--bq-FL2f.js} +1 -1
- package/dist/packem_shared/{provenance-BH80RHXx.js → provenance-DyF0b6KX.js} +1 -1
- package/dist/packem_shared/{readJsonSync-CbryXYxN-B2aSeDpC.js → readJsonSync-CbryXYxN-EWl7_7KX.js} +1 -1
- package/dist/packem_shared/{registry-keys-BWHRFWbb.js → registry-keys-DwB3ZXS_.js} +1 -1
- package/dist/packem_shared/{resolve-explicit-DuJ3mbzt.js → resolve-explicit-BjCEm0s-.js} +1 -1
- package/dist/packem_shared/resolve-runtime-CNiHcVtx.js +1 -0
- package/dist/packem_shared/{run-file-jMngGQhs.js → run-file-UBukWaha.js} +1 -1
- package/dist/packem_shared/{runtime-check-BklgEMkC.js → runtime-check-1U8HrQd9.js} +1 -1
- package/dist/packem_shared/{s1ngularity-BJ5j2vbJ.js → s1ngularity-YfmkD_AH.js} +1 -1
- package/dist/packem_shared/scan-progress-C_zaZjyY.js +2 -0
- package/dist/packem_shared/{selectors-B7lSFz7l.js → selectors-edwcgNl3.js} +1 -1
- package/dist/packem_shared/{signatures-BP042BlB.js → signatures-CL3ckp_Y.js} +1 -1
- package/dist/packem_shared/{spinner-BM_0Bj6x.js → spinner-DuB0K0Am.js} +1 -1
- package/dist/packem_shared/swift-package-B6X5kzQE.js +1 -0
- package/dist/packem_shared/{tabs-UDYQ3tqt.js → tabs-RZd_e1M0.js} +1 -1
- package/dist/packem_shared/{target-merge-B4No-LHM.js → target-merge-DVJl-7Qz.js} +1 -1
- package/dist/packem_shared/{target-options-d_rIrLyq.js → target-options-DsHFmRZH.js} +1 -1
- package/dist/packem_shared/{toolchain-DY11tPCw.js → toolchain-BRdpaAC4.js} +1 -1
- package/dist/packem_shared/{typosquats-CSkIFgF5.js → typosquats-8u0drCqQ.js} +1 -1
- package/dist/packem_shared/{use-measured-height-BPQg2q_p.js → use-measured-height-DWkDV9Dj.js} +1 -1
- package/dist/packem_shared/verify-B_MblU_Q.js +1 -0
- package/dist/packem_shared/{vis-update-app-CR21zyht.js → vis-update-app-D73C__fx.js} +1 -1
- package/dist/packem_shared/{vis-user-error-qqqhLoF6.js → vis-user-error-Cpg2FqA4.js} +15 -15
- package/dist/packem_shared/{watch-Dswvj6Zp.js → watch-CcTketln.js} +1 -1
- package/dist/packem_shared/{watch-loop-COWvvSbR.js → watch-loop-qRn0IHPG.js} +1 -1
- package/dist/packem_shared/{writeFileSync-DJoHk3Ks-CgQ-VNNT.js → writeFileSync-DJoHk3Ks-BPRoepNw.js} +1 -1
- package/dist/packem_shared/zig-manifest-P7ydLEOa.js +7 -0
- package/dist/release/plugin-sdk.d.ts +1 -1
- package/dist/release/types.d.ts +133 -7
- package/dist/runtime/preload.js +1 -1
- package/index.js +52 -52
- package/package.json +12 -12
- package/schemas/vis-config.schema.json +279 -5
- package/schemas/vis-release-config.schema.json +132 -5
- package/dist/packem_shared/Table-kgZ-Cd21-DdNsp69H.js +0 -9
- package/dist/packem_shared/advisories-0ScpWAHV.js +0 -1
- package/dist/packem_shared/affected-selection-Bt4qkPUb.js +0 -1
- package/dist/packem_shared/cyclonedx-CX2fFvDi.js +0 -4
- package/dist/packem_shared/glob-Cyk1H9ZL-ox19CSsT.js +0 -1
- package/dist/packem_shared/index-Czrll7SU.js +0 -1
- package/dist/packem_shared/index-DHD8wb6Z.js +0 -22
- package/dist/packem_shared/missing-package-json-C0keIt78.js +0 -1
- package/dist/packem_shared/package-version-DFlytdgJ.js +0 -4
- package/dist/packem_shared/resolve-runtime-C7NBCA1C.js +0 -1
- package/dist/packem_shared/scan-progress-DRIGQRMr.js +0 -2
- package/dist/packem_shared/verify-D8wYvB85.js +0 -1
|
@@ -1,59 +1,7 @@
|
|
|
1
|
-
/*!
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
-
*/let O=/^(\d{4}-\d{2}-\d{2})?[T ]?(?:(\d{2}):\d{2}(?::\d{2}(?:\.\d+)?)?)?(Z|[-+]\d{2}:\d{2})?$/i;class m extends Date{#r=!1;#t=!1;#e=null;constructor(i){let r=!0,t=!0,l="Z";if(typeof i=="string"){let n=i.match(O);n?(n[1]||(r=!1,i=`0000-01-01T${i}`),t=!!n[2],t&&i[10]===" "&&(i=i.replace(" ","T")),n[2]&&+n[2]>23?i="":(l=n[3]||null,i=i.toUpperCase(),!l&&t&&(i+="Z"))):i=""}super(i),isNaN(this.getTime())||(this.#r=r,this.#t=t,this.#e=l)}isDateTime(){return this.#r&&this.#t}isLocal(){return!this.#r||!this.#t||!this.#e}isDate(){return this.#r&&!this.#t}isTime(){return this.#t&&!this.#r}isValid(){return this.#r||this.#t}toISOString(){let i=super.toISOString();if(this.isDate())return i.slice(0,10);if(this.isTime())return i.slice(11,23);if(this.#e===null)return i.slice(0,-1);if(this.#e==="Z")return i;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(i,r="Z"){let t=new m(i);return t.#e=r,t}static wrapAsLocalDateTime(i){let r=new m(i);return r.#e=null,r}static wrapAsLocalDate(i){let r=new m(i);return r.#t=!1,r.#e=null,r}static wrapAsLocalTime(i){let r=new m(i);return r.#r=!1,r.#e=null,r}}/*!
|
|
28
|
-
* Copyright (c) Squirrel Chat et al., All rights reserved.
|
|
29
|
-
* SPDX-License-Identifier: BSD-3-Clause
|
|
30
|
-
*
|
|
31
|
-
* Redistribution and use in source and binary forms, with or without
|
|
32
|
-
* modification, are permitted provided that the following conditions are met:
|
|
33
|
-
*
|
|
34
|
-
* 1. Redistributions of source code must retain the above copyright notice, this
|
|
35
|
-
* list of conditions and the following disclaimer.
|
|
36
|
-
* 2. Redistributions in binary form must reproduce the above copyright notice,
|
|
37
|
-
* this list of conditions and the following disclaimer in the
|
|
38
|
-
* documentation and/or other materials provided with the distribution.
|
|
39
|
-
* 3. Neither the name of the copyright holder nor the names of its contributors
|
|
40
|
-
* may be used to endorse or promote products derived from this software without
|
|
41
|
-
* specific prior written permission.
|
|
42
|
-
*
|
|
43
|
-
* THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|
44
|
-
* ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
|
45
|
-
* WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
|
46
|
-
* DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
|
|
47
|
-
* FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
|
|
48
|
-
* DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
|
|
49
|
-
* SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
|
|
50
|
-
* CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
|
|
51
|
-
* OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
|
|
52
|
-
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
|
53
|
-
*/function T(e,i){let r=e.slice(0,i).split(/\r\n|\n|\r/g);return[r.length,r.pop().length+1]}function E(e,i,r){let t=e.split(/\r\n|\n|\r/g),l="",n=(Math.log10(i+1)|0)+1;for(let s=i-1;s<=i+1;s++){let a=t[s-1];a&&(l+=s.toString().padEnd(n," "),l+=": ",l+=a,l+=`
|
|
54
|
-
`,s===i&&(l+=" ".repeat(n+r+2),l+=`^
|
|
55
|
-
`))}return l}class f extends Error{line;column;codeblock;constructor(i,r){const[t,l]=T(r.toml,r.ptr),n=E(r.toml,t,l);super(`Invalid TOML document: ${i}
|
|
56
|
-
|
|
57
|
-
${n}`,r),this.line=t,this.column=l,this.codeblock=n}}function k(e,i=0){let r=e.indexOf(`
|
|
58
|
-
`,i);return e.charCodeAt(r-1)===13&&r--,r}function C(e){for(;e.p<e.s.length;e.p++){let i=e.s.charCodeAt(e.p);if(i===10)break;if(i===13&&e.s.charCodeAt(e.p+1)===10){e.p++;break}if(i<32&&i!==9||i===127)throw new f("control characters are not allowed in comments",{toml:e.s,ptr:e.p})}}function w(e,i,r){let t;for(;;){for(;(t=e.s.charCodeAt(e.p))===32||t===9||!i&&(t===10||t===13&&e.s.charCodeAt(e.p+1)===10);)e.p++;if(r||t!==35)break;C(e)}}function _(e,i,r){let t=e.p;if(!r){t=k(e.s,t),e.p=t<0?e.s.length:t;return}for(;e.p<e.s.length;e.p++){let l=e.s.charCodeAt(e.p);if(l===35)C(e);else if(l===r||l===i)return}throw new f("cannot find end of structure",{toml:e.s,ptr:t})}let S=/^((0x[0-9a-fA-F](_?[0-9a-fA-F])*)|(([+-]|0[ob])?\d(_?\d)*))$/,D=/^[+-]?\d(_?\d)*(\.\d(_?\d)*)?([eE][+-]?\d(_?\d)*)?$/,L=/^[+-]?0[0-9_]/;function y(e){let i=e.p,r=e.s.charCodeAt(e.p++),t=r,l=r===39,n=r===e.s.charCodeAt(e.p)&&r===e.s.charCodeAt(e.p+1);n&&((r=e.s.charCodeAt(e.p+=2))===10?e.p++:r===13&&e.s.charCodeAt(e.p+1)===10&&(e.p+=2));let s="",a=e.p,o=0;for(;e.p<e.s.length;e.p++)if(r=e.s.charCodeAt(e.p),n&&(r===10||r===13&&e.s.charCodeAt(e.p+1)===10))o=o&&3;else{if(r<32&&r!==9||r===127)throw new f("control characters are not allowed in strings",{toml:e.s,ptr:e.p});if((!o||o===3)&&r===t&&(!n||e.s.charCodeAt(e.p+1)===t&&e.s.charCodeAt(e.p+2)===t))return n&&(e.s.charCodeAt(e.p+3)===t&&e.p++,e.s.charCodeAt(e.p+3)===t&&e.p++),o||(s+=e.s.slice(a,e.p)),e.p+=n?3:1,s;if(!o)!l&&r===92&&(s+=e.s.slice(a,a=e.p),o=1);else if(o===1)if(r===120||r===117||r===85){let p=0,d=r===120?2:r===117?4:8;for(let u=0;u<d;u++,e.p++){let h=e.s.charCodeAt(e.p+1),g=h>=48&&h<=57?h-48:h>=65&&h<=70?h-65+10:h>=97&&h<=102?h-97+10:-1;if(g<0)throw new f("invalid non-hex character in unicode escape",{toml:e.s,ptr:e.p+1});p=p<<4|g}if(p<0||p>1114111||p>=55296&&p<=57343)throw new f("invalid unicode escape",{toml:e.s,ptr:e.p});s+=String.fromCodePoint(p),a=e.p+1,o=0}else if(r===32||r===9)o=2;else{if(r===98)s+="\b";else if(r===116)s+=" ";else if(r===110)s+=`
|
|
59
|
-
`;else if(r===102)s+="\f";else if(r===114)s+="\r";else if(r===101)s+="\x1B";else if(r===34)s+='"';else if(r===92)s+="\\";else throw new f("unrecognized escape sequence",{toml:e.s,ptr:e.p});a=e.p+1,o=0}else if(r!==32&&r!==9){if(o===2)throw new f("invalid escape: only line-ending whitespace may be escaped",{toml:e.s,ptr:a});o=!l&&r===92?1:0,a=e.p}}throw new f("unfinished string",{toml:e.s,ptr:i})}function I(e,i,r){let t=e.s.slice(i,r),l=t.indexOf("#");return l>0&&(C({s:t,p:l}),t=t.slice(0,l)),t.trimEnd()}function N(e,i,r){let t=e.p,l={toml:e.s,ptr:t};_(e,44,r);let n=I(e,t,e.p);if(!n)throw new f("incomplete declaration: value expected",l);if(n==="-inf")return-1/0;if(n==="inf"||n==="+inf")return 1/0;if(n==="nan"||n==="+nan"||n==="-nan")return NaN;if(n==="-0")return i?0n:0;let s=S.test(n);if(s||D.test(n)){if(L.test(n))throw new f("leading zeroes are not allowed",l);n=n.replace(/_/g,"");let o=+n;if(isNaN(o))throw new f("invalid number",l);if(s){if((s=!Number.isSafeInteger(o))&&!i)throw new f("integer value cannot be represented losslessly",l);(s||i===!0)&&(o=BigInt(n))}return o}const a=new m(n);if(!a.isValid())throw new f("invalid value",l);return a}function b(e,i,r){let t=e.p,l=e.s.charCodeAt(t);if(l===91||l===123){if(!e.d--)throw new f("document contains excessively nested structures. aborting.",{toml:e.s,ptr:t});let n=l===91?P(e,r):j(e,r);return e.d++,n}if(l===34||l===39)return y(e);if(l===116){if(e.s.charCodeAt(++e.p)!==114||e.s.charCodeAt(++e.p)!==117||e.s.charCodeAt(++e.p)!==101)throw new f("invalid value",{toml:e.s,ptr:t});return e.p++,!0}if(l===102){if(e.s.charCodeAt(++e.p)!==97||e.s.charCodeAt(++e.p)!==108||e.s.charCodeAt(++e.p)!==115||e.s.charCodeAt(++e.p)!==101)throw new f("invalid value",{toml:e.s,ptr:t});return e.p++,!1}return N(e,r,i)}let c=/^[a-zA-Z0-9-_]+[ \t]*$/;function A(e,i="="){let r=e.p,t=r-1,l=[],n=e.s.indexOf(i,r);if(n<0)throw new f("incomplete key-value: cannot find end of key",{toml:e.s,ptr:r});do{let s=e.s.charCodeAt(e.p=++t);if(s!==32&&s!==9)if(s===34||s===39){if(s===e.s.charCodeAt(e.p+1)&&s===e.s.charCodeAt(e.p+2))throw new f("multiline strings are not allowed in keys",{toml:e.s,ptr:e.p});let a=y(e);t=e.s.indexOf(".",e.p);let o=e.s.slice(e.p,t<0||t>n?n:t),p=k(o);if(p>-1)throw new f("newlines are not allowed in keys",{toml:e.s,ptr:p});if(o.trimStart())throw new f("found extra tokens after the string part",{toml:e.s,ptr:e.p});if(n<e.p&&(n=e.s.indexOf(i,e.p),n<0))throw new f("incomplete key-value: cannot find end of key",{toml:e.s,ptr:r});l.push(a)}else{t=e.s.indexOf(".",e.p);let a=e.s.slice(e.p,t<0||t>n?n:t);if(!c.test(a))throw new f("only letter, numbers, dashes and underscores are allowed in keys",{toml:e.s,ptr:e.p});l.push(a.trimEnd())}}while(t+1&&t<n);return e.p=n+1,w(e,!0,!0),l}function j(e,i){let r={},t=new Set,l;for(e.p++;e.p<e.s.length;){if(w(e),(l=e.s.charCodeAt(e.p))===125)return e.p++,r;let n,s=r,a=!1,o=e.p,p=A(e);for(let u=0;u<p.length;u++){if(u&&(s=a?s[n]:s[n]={}),n=p[u],(a=Object.hasOwn(s,n))&&(typeof s[n]!="object"||t.has(s[n])))throw new f("trying to redefine an already defined value",{toml:e.s,ptr:o});!a&&n==="__proto__"&&Object.defineProperty(s,n,{enumerable:!0,configurable:!0,writable:!0})}if(a)throw new f("trying to redefine an already defined value",{toml:e.s,ptr:e.p});let d=b(e,125,i);if(t.add(s[n]=d),w(e),(l=e.s.charCodeAt(e.p++))===125)return r;if(l!==44)throw new f("expected comma or end of structure",{toml:e.s,ptr:e.p-1})}throw new f("unfinished table encountered",{toml:e.s,ptr:e.p})}function P(e,i){let r=[],t;for(e.p++;e.p<e.s.length;){if(w(e),(t=e.s.charCodeAt(e.p))===93)return e.p++,r;if(r.push(b(e,93,i)),w(e),(t=e.s.charCodeAt(e.p++))===93)return r;if(t!==44)throw new f("expected comma or end of structure",{toml:e.s,ptr:e.p-1})}throw new f("unfinished array encountered",{toml:e.s,ptr:e.p})}function v(e,i,r,t){let l=i,n=r,s,a=!1,o;for(let p=0;p<e.length;p++){if(p){if(l=a?l[s]:l[s]={},n=(o=n[s]).c,t===0&&(o.t===1||o.t===2))return null;if(o.t===2){let d=l.length-1;l=l[d],n=n[d].c}}if(s=e[p],(a=Object.hasOwn(l,s))&&n[s]?.t===0&&n[s]?.d)return null;a||(s==="__proto__"&&(Object.defineProperty(l,s,{enumerable:!0,configurable:!0,writable:!0}),Object.defineProperty(n,s,{enumerable:!0,configurable:!0,writable:!0})),n[s]={t:p<e.length-1&&t===2?3:t,d:!1,i:0,c:{}})}if(o=n[s],o.t!==t&&!(t===1&&o.t===3)||(t===2&&(o.d||(o.d=!0,l[s]=[]),l[s].push(l={}),o.c[o.i++]=o={t:1,d:!1,i:0,c:{}}),o.d))return null;if(o.d=!0,t===1)l=a?l[s]:l[s]={};else if(t===0&&a)return null;return[s,l,o.c]}function Z(e,{maxDepth:i=1e3,integersAsBigInt:r}={}){let t={s:e,p:0,d:i},l={},n={},s,a=l,o=n;for(w(t);t.p<e.length;){if(e.charCodeAt(t.p)===91){let p=e.charCodeAt(++t.p)===91;s=t.p+=+p;let d=A(t,"]");if(p){if(e.charCodeAt(t.p-1)!==93)throw new f("expected end of table declaration",{toml:e,ptr:t.p-1});t.p++}let u=v(d,l,n,p?2:1);if(!u)throw new f("trying to redefine an already defined table or value",{toml:e,ptr:s});o=u[2],a=u[1]}else{s=t.p;let p=A(t),d=v(p,a,o,0);if(!d)throw new f("trying to redefine an already defined table or value",{toml:e,ptr:s});d[1][d[0]]=b(t,void 0,r)}if(w(t,!0),t.p<e.length&&(s=e.charCodeAt(t.p))!==10&&s!==13)throw new f("each key-value declaration must be followed by an end-of-line",{toml:e,ptr:t.p});w(t)}return l}export{m as TomlDate,f as TomlError,Z as parse};
|
|
1
|
+
import{a as nt,e as st,z as O}from"../packem_shared/index-BzhrR_iC.js";import{l as At}from"./ts-loader.js";import{L as Et}from"../packem_shared/index-BisalDCf.js";import{p as bt}from"./cli-main.js";import{q as xt,L as Ct,T as S,R as L,B as W,U as E,O as N,K as Q,Z as V,W as jt,r as K,t as kt,F as D,u as Y,x as J,H as Lt,w as Wt,M as Ut,C as St,P as Tt,v as Ot,y as Pt,Y as _t,z as It,J as Rt,A as zt,V as Nt,E as vt,G as Ft,I as Mt,N as Bt}from"../packem_shared/formatBytes-BHAzNIrn-CrusHOew.js";import{a2 as I,L as qt}from"./catalog.js";const Gt=(t,e)=>typeof t!="string"||t===""?"":t[0].toLowerCase()+t.slice(1),Qt=new RegExp("[\\u001B\\u009B][[\\]()#;?]*(?:(?:(?:(?:;[-a-zA-Z\\d/#&.:=?%@~_]+)*|[a-zA-Z\\d]+(?:;[-a-zA-Z\\d/#&.:=?%@~_]*)*)?(?:\\u0007|\\u001B\\u005C|\\u009C))|(?:(?:\\d{1,4}(?:;\\d{0,4})*)?[\\dA-PR-TZcf-nq-uy=><~]))","g"),Vt=t=>{if(typeof t!="string")throw new TypeError(`The "value" argument must be of type string. Received ${typeof t}`);return t.replaceAll(Qt,"")},v=new I(1e3),Kt=/[.*+?^${}()|[\]\\]/g,Dt=t=>{const e=t.join("");if(v.has(e)){const r=v.get(e);return r.lastIndex=0,r}const s=t.map(r=>r.replaceAll(Kt,String.raw`\$&`)).join("|"),n=new RegExp(s,"g");return v.set(e,n),n},Yt=t=>{const e=[];let s=0,n;for(L.lastIndex=0;(n=L.exec(t))!==null;)n.index>s&&e.push(t.slice(s,n.index)),e.push(n[0]),s=L.lastIndex;return s<t.length&&e.push(t.slice(s)),e.filter(Boolean)},Jt=/[ČŠŽĐ]/i,rt=new Uint8Array(128),ot=new Uint8Array(128),it=new Uint8Array(128);for(let t=0;t<128;t++)rt[t]=t>=65&&t<=90?1:0,ot[t]=t>=97&&t<=122?1:0,it[t]=t>=48&&t<=57?1:0;const F=t=>rt[t],Z=t=>ot[t],M=t=>it[t],j=(t,e,s,n,r)=>{if(t.length===0)return[];let o=!1;const a=Object.values(e);for(const u of a)if(u(t[0])){o=!0;break}if(!o&&!s)return[t];const l=[...t],h=[];let i=l[0],p="other";const d=Object.entries(e);for(const u of d){const[f,g]=u;if(g(l[0])){p=f;break}}let c=s&&n?l[0]===l[0].toLocaleUpperCase(n):!1;for(let u=1;u<l.length;u++){const f=l[u];let g="other";for(const w of d){const[$,A]=w;if(A(f)){g=$;break}}const y=s&&n?f===f.toLocaleUpperCase(n):!1;let m=!1;r?m=r(p,g,c,y,f,u,l):(p!==g&&p!=="other"&&g!=="other"&&(m=!0),s&&g!=="other"&&!c&&y&&(m=!0)),m?(h.push(i),i=f):i+=f,p=g,s&&(c=y)}return i&&i.length>0&&h.push(i),h.length>0?h:[t]},Zt=(t,e,s,n)=>{if(s.size===0)return e;for(const r of s)if(t.startsWith(r,e))return n.push(r),e+r.length;return e},lt=(t,e=new Set)=>{if(t.length===0)return[];if(t.toUpperCase()===t)return[t];let s=0;const n=[],r=t.length;for(let o=1;o<r;o++){const a=Zt(t,s,e,n);if(a!==s){s=a,o=s-1;continue}const l=t.codePointAt(o-1),h=t.codePointAt(o),i=l&&l<128&&F(l),p=h&&h<128&&F(h),d=l&&l<128&&Z(l),c=l&&l<128&&M(l),u=h&&h<128&&M(h);if(d&&p){n.push(t.slice(s,o)),s=o;continue}if(c&&!u||!c&&u){n.push(t.slice(s,o)),s=o;continue}if(u&&!c){let f=!1,g=!1;if(o+1<r){const y=t.codePointAt(o+1);f=y&&y<128&&F(y),g=y&&y<128&&M(y)}if(!g&&f){n.push(t.slice(s,o),t.slice(o,o+1)),s=o+1;continue}}if(o+1<r){const f=t.codePointAt(o+1),g=f&&f<128&&Z(f);if(i&&p&&g){const y=t.slice(s,o+1);e.has(y)||(n.push(t.slice(s,o)),s=o)}}}return s<r&&n.push(t.slice(s)),n.filter(o=>o!=="")},at=(t,e,s)=>{if(t.length===0)return[];const n=t===t.toLocaleUpperCase(e);if(e.startsWith("de")){if(!n&&t.replaceAll("ß","SS")===t.toLocaleUpperCase(e))return[t];const i=[...t],p=i.length,d=[];let c=i[0],u=i[0]===i[0].toLocaleUpperCase(e),f=u,g=u?0:-1;for(let y=1;y<p;y++){const m=i[y],w=m===m.toLocaleUpperCase(e);if(w===u)c+=m;else if(w)c&&c.length>0&&(d.push(c),c=m),f=!0,g=y;else{if(f&&y-g>1){const $=i[y-1],A=c.slice(0,-1);A&&A.length>0&&d.push(A),c=$+m}else c+=m;f=!1,g=-1}u=w}return c&&c.length>0&&d.push(c),d}if(e.startsWith("uk")||e.startsWith("ru")||e.startsWith("bg")||e.startsWith("sr")||e.startsWith("mk")||e.startsWith("be")){if(!W.test(t)&&!E.test(t))return[t];const i=[...t],p=i.length,d=[];let c=i[0];const u=i[0];let f;W.test(u)?f=1:E.test(u)?f=2:f=0;let g=u===u.toLocaleUpperCase(e);for(let m=1;m<p;m++){const w=i[m];let $;W.test(w)?$=1:E.test(w)?$=2:$=0;const A=w===w.toLocaleUpperCase(e);f!==$&&(f===1||f===2)&&($===1||$===2)||$===f&&!g&&A?(d.push(c),c=w):c+=w,f=$,g=A}c&&c.length>0&&d.push(c);const y=[];for(let m=0;m<d.length;m++)m<d.length-1&&d[m].length===1&&E.test(d[m])&&W.test(d[m+1][0])?(y.push(d[m]+d[m+1]),m+=1):y.push(d[m]);return y}if(e.startsWith("el")){if(!N.test(t)&&!E.test(t))return[t];const i=[];Q.lastIndex=0;let p;for(;(p=Q.exec(t))!==null;)i.push(p[0]);i.length===0&&i.push(t);const d=[];if(i.length===1){const c=i[0];if(!c||!N.test(c[0])||c.length===1)return[c??t]}for(const c of i){if(!c)continue;if(!N.test(c[0])||c.length===1){d.push(c);continue}const u=c.length;let f=c[0],g=c[0]===c[0].toLocaleUpperCase(e);for(let y=1;y<u;y++){const m=c[y],w=m===m.toLocaleUpperCase(e);!g&&w?(d.push(f),f=m):f+=m,g=w}f&&d.push(f)}return d}if(e.startsWith("ja")||e.startsWith("ko")){const i=e.startsWith("ja"),p=i?{hiragana:c=>kt.test(c),kanji:c=>K.test(c),katakana:c=>jt.test(c),latin:c=>E.test(c)}:{hangul:c=>D.test(c),latin:c=>E.test(c)},d=new Set(["が","で","と","に","の","は","へ","も","や","を"]);if(i){const c=j(t,p,!1,e,(f,g)=>f==="hiragana"&&g==="katakana"||f==="katakana"&&g==="hiragana"||f==="hiragana"&&g==="latin"||f==="katakana"&&g==="latin"||f==="kanji"&&g==="latin"||f==="latin"&&(g==="hiragana"||g==="katakana"||g==="kanji")),u=[];for(const f of c){const g=f;g.length===1&&d.has(g)&&u.length>0?u[u.length-1]=u.at(-1)+g:u.push(g)}return u.length>0?u:[t]}return j(t,p,!1,e,(c,u)=>c==="hangul"&&u==="latin"||c==="latin"&&u==="hangul")}if(e.startsWith("sl")){const i=[...t],p=i.length,d=[];let c=i[0],u=i[0]===i[0].toLocaleUpperCase(e);for(let f=1;f<p;f++){const g=i[f],y=g===g.toLocaleUpperCase(e),m=Jt.test(g),w=f<p-1&&i[f+1]===i[f+1].toLocaleUpperCase(e);!u&&y||m&&w?(d.push(c),c=g,m&&w&&(d.push(c),c="")):c+=g,u=y}return c&&c.length>0&&d.push(c),d}if(e.startsWith("zh"))return j(t,{han:i=>K.test(i),latin:i=>E.test(i)},!1,e);if(["ar","fa","he","ur"].includes(e.split("-")[0])){const i=p=>Y.test(p)||J.test(p);return j(t,{latin:p=>E.test(p),rtl:p=>i(p)},!1,e)}if(["am","bn","gu","hi","km","kn","lo","ml","mr","ne","or","pa","si","ta","te","th"].includes(e.split("-")[0])){const i=p=>Lt.test(p)||Wt.test(p)||Ut.test(p)||St.test(p)||Tt.test(p)||Ot.test(p)||Pt.test(p)||_t.test(p)||It.test(p)||Rt.test(p)||zt.test(p)||Nt.test(p)||vt.test(p)||Ft.test(p)||Mt.test(p)||Bt.test(p);return j(t,{indic:p=>i(p),latin:p=>E.test(p)},!1,e)}if(["be","bg","ru","sr","uk"].includes(e))return j(t,{cyrillic:i=>W.test(i),latin:i=>E.test(i)},!0,e);if(["ar","fa","he"].includes(e))return j(t,{latin:i=>E.test(i),rtl:i=>Y.test(i)||J.test(i)},!1,e);if(e.startsWith("ko"))return j(t,{hangul:i=>D.test(i),latin:i=>E.test(i)},!1,e);if(e.startsWith("uz")){if(!W.test(t)&&!E.test(t))return[t];const i=[...t],p=i.length,d=[];let c=i[0],u=i[0]===i[0].toLocaleUpperCase(e);for(let f=1;f<p;f++){const g=i[f],y=g===g.toLocaleUpperCase(e);if(V.test(g)||V.test(i[f-1])){c+=g;continue}!u&&y?(d.push(c),c=g):c+=g,u=y}return c&&c.length>0&&d.push(c),d}const r=[...t],o=r.length,a=[];let l=r[0],h=r[0]===r[0].toLocaleUpperCase(e);for(const i of s)if(t.startsWith(i)){a.push(i),l=r[i.length],h=l===l.toLocaleUpperCase(e);break}for(let i=1;i<o;i++){const p=r[i],d=p===p.toLocaleUpperCase(e);let c=0;for(const u of s)if(t.startsWith(u,i)){a.push(l,u),c=u.length,l="";const f=u.at(-1);f&&(h=f===f.toLocaleUpperCase(e));break}if(c>0){i+=c-1;continue}!h&&d?(a.push(l),l=p):l+=p,h=d}return l&&a.push(l),a},Ht=(t,e,s)=>{const n=[],r=S.test(t)?t.split(S).filter(Boolean):[t];for(const o of r){const a=o;if(S.test(a))n.push(a);else{L.lastIndex=0;const l=L.test(a)?Yt(a).filter(Boolean):[a];for(const h of l)if(L.lastIndex=0,L.test(h))n.push(h);else if(e){const i=e.toLowerCase().split("-")[0];n.push(...at(h,i,s))}else n.push(...lt(h,s))}}return n},R=(t,e={})=>{if(!t||typeof t!="string")return[];const{handleAnsi:s=!1,handleEmoji:n=!1,knownAcronyms:r=[],locale:o,normalize:a=!1,separators:l,stripAnsi:h=!1,stripEmoji:i=!1}=e,p=new Set([...r].toSorted((m,w)=>w.length-m.length));let d=t;h&&(d=Vt(d)),i&&(d=xt(d));let c;Array.isArray(l)?c=Dt(l):l instanceof RegExp?c=l:c=Ct;const u=[];let f=d;const g=c.flags.includes("g")?c:new RegExp(c.source,`${c.flags}g`);for(;f.length>0;){const m=g.exec(f);if(!m){f===".."?u.push(".."):f==="."?u.push("."):f.length>0&&u.push(f);break}const w=m.index,$=m[0],A=$.length,T=f.slice(0,w),$t=f.slice(w+A);if($.startsWith("../"))u.push(".."),f=f.slice(w+3);else if($.startsWith("./"))u.push("."),f=f.slice(w+2);else if(w===0&&$==="..")u.push(".."),f=f.slice(2);else if(w===0&&$===".")u.push("."),f=f.slice(1);else{T.length>0&&u.push(T);let x=0;for(;(x=$.indexOf("../",x))!==-1;)u.push(".."),x+=3;for(x=0;(x=$.indexOf("./",x))!==-1;)(x===0||$[x-1]!==".")&&u.push("."),x+=2;let C=$t;for(;C.startsWith("../");)u.push(".."),C=C.slice(3);for(;C.startsWith("./");)u.push("."),C=C.slice(2);if(C===".."){u.push("..");break}else if(C==="."){u.push(".");break}else f=C}g.lastIndex=0}if(u.length===0){const m=d.split(c).filter(Boolean);u.push(...m)}let y=[];for(const m of u)s||n?y.push(...Ht(m,o,p)):o?y.push(...at(m,o,p)):y.push(...lt(m,p));return a&&(y=y.map(m=>p.has(m)?m:o&&m===m.toLocaleUpperCase(o)?m[0]+m.slice(1).toLocaleLowerCase(o):m.toUpperCase()===m&&!p.has(m)?m.slice(0,1)+m.slice(1).toLowerCase():m)),y},q=(t,e)=>typeof t!="string"||t===""?"":(e?.locale?t[0].toLocaleUpperCase(e.locale):t[0].toUpperCase())+t.slice(1),Xt=(t,e)=>`${t}::${e?.joiner??""}::${e?.locale??""}::${e?.knownAcronyms?.join(",")??""}::${e?.normalize?"true":"false"}::${e?.stripAnsi?"true":"false"}::${e?.stripEmoji?"true":"false"}::${e?.handleAnsi?"true":"false"}::${e?.handleEmoji?"true":"false"}`,z=(t,e)=>{const{length:s}=t;if(s===0)return"";if(s===1)return t[0];const n=[];let r="",o="";for(let a=0;a<s;a++){const l=t[a];if(S.test(l)){r?(n.push(r+o+l),r="",o=""):(n.length>0&&n.push(e),r=l);continue}r?(o&&(o+=e),o+=l):(n.length>0&&n.push(e),n.push(l))}return n.join("")},te=/(?<![a-zß])SS(?![a-z])/g,ee=t=>t.replaceAll(te,"ß"),ne=(t,e)=>{if(typeof t!="string"||!t)return"";let s=!0;return z(R(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(r=>{const o=r,a=o.toLowerCase();return s?(s=!1,Gt(a)):q(a,e)}),"")},se=new I(1e3),G=(t,e)=>{if(typeof t!="string")return"";const s=e?.cache??!1,n=e?.cacheStore??se;let r;if(s&&(r=Xt(t,e)),s&&r&&n.has(r))return n.get(r);const o=R(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(l=>{if(e?.handleAnsi&&S.test(l))return l;if(e?.toUpperCase)return e.locale?l.toLocaleUpperCase(e.locale):l.toUpperCase();const h=e?.locale?.startsWith("de")?ee(l):l;return e?.locale?h.toLocaleLowerCase(e.locale):h.toLowerCase()}),a=z(o,e?.joiner??"-");return s&&r&&n.set(r,a),a},re=new I(1e3),oe=(t,e)=>G(t,{cacheStore:re,...e,joiner:"_",toUpperCase:!0}),ie=(t,e)=>typeof t!="string"||!t?"":z(R(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(n=>q(n.toLowerCase(),{locale:e?.locale})),""),le=new I(1e3),ae=(t,e)=>G(t,{cacheStore:le,...e,joiner:"_"}),ce=(t,e)=>typeof t!="string"?"":z(R(t,{handleAnsi:e?.handleAnsi,handleEmoji:e?.handleEmoji,knownAcronyms:e?.knownAcronyms,locale:e?.locale,normalize:e?.normalize,separators:void 0,stripAnsi:e?.stripAnsi,stripEmoji:e?.stripEmoji}).map(n=>q(n,{locale:e?.locale})),"-"),b=t=>t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"?String(t):JSON.stringify(t),H={camel_case:t=>ne(b(t)),kebab_case:t=>G(b(t)),lower_case:t=>b(t).toLowerCase(),pascal_case:t=>ie(b(t)),path_join:(t,...e)=>{const s=[b(t),...e.map(n=>b(n))];return st(...s)},path_relative:(t,e)=>nt(b(e),b(t)),snake_case:t=>ae(b(t)),upper_case:t=>b(t).toUpperCase(),upper_kebab_case:t=>ce(b(t)),upper_snake_case:t=>oe(b(t))},ct=(t,e,s=[])=>{const n=H[t];if(!n)throw new Error(`Unknown filter "${t}". Known filters: ${Object.keys(H).sort().join(", ")}.`);return n(e,...s)},ft=t=>{const e=[];let s=0,n=0,r,o=-1;for(const a of t){if(o+=1,r){a===r&&(r=void 0);continue}if(a==='"'||a==="'"){r=a;continue}a==="("?s+=1:a===")"?s-=1:a===","&&s===0&&(e.push(t.slice(n,o)),n=o+1)}return e.push(t.slice(n)),e},fe=t=>{if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1)},ue=/\[([^\]]+)\]/g,pe=t=>{const e=t.trim(),s=e.indexOf("(");if(s===-1)return{args:[],name:e};if(!e.endsWith(")"))throw new Error(`Filter call "${t}" missing closing ")"`);const n=e.slice(0,s).trim(),r=e.slice(s+1,-1).trim();return r===""?{args:[],name:n}:{args:ft(r).map(a=>{const l=a.trim();return fe(l)??l}),name:n}},he=t=>{const e=t.split("|").map(r=>r.trim()),s=e[0]??"";if(!s)throw new Error(`Empty variable name in expression "${t}"`);return{filters:e.slice(1).map(r=>pe(r)),name:s}},de=t=>t==null?"":typeof t=="string"?t:typeof t=="number"||typeof t=="boolean"||typeof t=="bigint"?String(t):JSON.stringify(t),me=(t,e)=>{const s=t.replaceAll(ue,(n,r)=>{const{filters:o,name:a}=he(r);if(!Object.hasOwn(e,a))throw new Error(`Variable "${a}" used in filename "${t}" but not defined`);let l=e[a];for(const h of o)l=ct(h.name,l,h.args);return de(l)});return ut(s)},ut=t=>t.split("/").map(e=>e.endsWith(".tera")||e.endsWith(".twig")?e.slice(0,-5):e).join("/"),ge=t=>t.endsWith(".raw")?t.slice(0,-4):t,ye=t=>{const e=t.split("/");return(e.at(-1)??"").startsWith("_")?!0:e.slice(0,-1).includes("partials")},k="---",we=(t,e)=>{if(!t.startsWith(`${k}
|
|
2
|
+
`)&&!t.startsWith(`${k}\r
|
|
3
|
+
`))return{body:t};const s=t.indexOf(`
|
|
4
|
+
${k}`,k.length);if(s===-1)return{body:t};let n=s+1+k.length;t[n]==="\r"&&(n+=1),t[n]===`
|
|
5
|
+
`&&(n+=1);const r=t.startsWith(`${k}\r
|
|
6
|
+
`)?k.length+2:k.length+1,o=t.slice(r,s).replaceAll("\r","");let a;try{a=e(o)}catch(l){const h=l instanceof Error?l.message:String(l);throw new Error(`Failed to parse frontmatter YAML: ${h}`,{cause:l})}if(a==null)return{body:t.slice(n)};if(typeof a!="object"||Array.isArray(a))throw new TypeError(`Frontmatter must be a YAML mapping, got ${Array.isArray(a)?"array":typeof a}`);return{body:t.slice(n),frontmatter:a}},$e=/\{\{-?(.+?)-?\}\}|\{%-?(.+?)-?%\}/gs,pt=t=>{const e=[];let s=0,n=1;const r=o=>{for(const a of o)a===`
|
|
7
|
+
`&&(n+=1)};for(const o of t.matchAll($e)){const a=o.index??0;if(a>s){const i=t.slice(s,a);e.push({line:n,type:"text",value:i}),r(i)}const l=n,h=o[0];h.startsWith("{{")?e.push({line:l,type:"expr",value:(o[1]??"").trim()}):e.push({line:l,type:"stmt",value:(o[2]??"").trim()}),r(h),s=a+h.length}if(s<t.length){const o=t.slice(s);e.push({line:n,type:"text",value:o})}return e},Ae=new Set(["block","endblock","endfilter","endmacro","extends","filter","import","macro","set"]),ht=(t,e)=>{let s=0;const n=(o,a)=>{throw new Error(`${e}:${o}: ${a}`)},r=o=>{const a=[];for(;s<t.length;){const l=t[s];if(l.type==="text"){a.push({type:"text",value:l.value}),s+=1;continue}if(l.type==="expr"){a.push({expression:l.value,line:l.line,type:"expr"}),s+=1;continue}const h=l.value.split(/\s+/)[0]??"";if(o.includes(h))return a;if(Ae.has(h)&&n(l.line,`Tera feature "{% ${h} %}" is not supported. Supported: if/else/endif, for/endfor, include. Rewrite the template to avoid macros, set, extends, block, and import.`),h==="if"){s+=1;const i=l.value.slice(2).trim(),p=r(["else","endif"]);let d;s<t.length&&t[s].type==="stmt"&&t[s].value.split(/\s+/)[0]==="else"&&(s+=1,d=r(["endif"])),(s>=t.length||t[s].type!=="stmt"||t[s].value.split(/\s+/)[0]!=="endif")&&n(l.line,"Unterminated {% if %} — missing {% endif %}"),s+=1,a.push({alternate:d,condition:i,consequent:p,line:l.line,type:"if"});continue}if(h==="for"){s+=1;const i=l.value.slice(3).trim(),p=i.indexOf(" in ");p===-1&&n(l.line,"Malformed {% for %} — expected `for <name> in <collection>`");const d=i.slice(0,p).trim(),c=i.slice(p+4).trim();(!d||!c)&&n(l.line,"Malformed {% for %} — missing binding or collection");const u=r(["endfor"]);(s>=t.length||t[s].type!=="stmt"||t[s].value.split(/\s+/)[0]!=="endfor")&&n(l.line,"Unterminated {% for %} — missing {% endfor %}"),s+=1,a.push({binding:d,body:u,collection:c,line:l.line,type:"for"});continue}if(h==="include"){s+=1;const i=l.value.slice(7).trim(),p=dt(i);p===void 0&&n(l.line,"Malformed {% include %} — expected a quoted partial name"),a.push({line:l.line,name:p,type:"include"});continue}n(l.line,`Unknown tag "{% ${h} %}". Supported: if, for, include.`)}return a};return r([])},dt=t=>{if(t.startsWith('"')&&t.endsWith('"')||t.startsWith("'")&&t.endsWith("'"))return t.slice(1,-1)},Ee=t=>t==null?"":typeof t=="boolean"||typeof t=="number"?String(t):typeof t=="string"?t:JSON.stringify(t),be=t=>t==null||t===!1||t===0||t===""?!1:Array.isArray(t)?t.length>0:!0,mt=(t,e,s,n,r=!0)=>{const o=t.split(".");if(r&&o.length>0&&!Object.hasOwn(e,o[0]))throw new Error(`${n}:${s}: Variable "${t}" is not defined`);let a=e;for(const l of o){if(a==null)return;if(typeof a!="object")throw new TypeError(`${n}:${s}: Cannot read "${l}" on non-object value`);a=a[l]}return a},xe=t=>{const e=[];let s=0,n=0,r;for(let o=0;o<t.length;o+=1){const a=t[o];if(r){a===r&&(r=void 0);continue}if(a==='"'||a==="'"){r=a;continue}a==="("?s+=1:a===")"?s-=1:a==="|"&&s===0&&(e.push(t.slice(n,o)),n=o+1)}return e.push(t.slice(n)),e},Ce=t=>{const e=t.trim(),s=e.indexOf("(");if(s===-1)return{args:[],name:e};if(!e.endsWith(")"))throw new Error(`Filter call "${t}" missing closing ")"`);const n=e.slice(0,s).trim(),r=e.slice(s+1,-1).trim();return r?{args:ft(r).map(o=>o.trim()),name:n}:{args:[],name:n}},_=(t,e,s,n,r=!0)=>{const o=t.trim();if(o==="true")return!0;if(o==="false")return!1;if(o==="null"||o==="none")return null;const a=dt(o);return a!==void 0?a:/^-?\d+(?:\.\d+)?$/.test(o)?Number(o):mt(o,e,s,n,r)},gt=(t,e,s,n,r=!0)=>{const o=xe(t),a=o[0].trim();let l=_(a,e,s,n,r);for(let h=1;h<o.length;h+=1){const i=o[h].trim(),{args:p,name:d}=Ce(i),c=p.map(u=>_(u,e,s,n,r));try{l=ct(d,l,c)}catch(u){const f=u instanceof Error?u.message:String(u);throw new Error(`${n}:${s}: ${f}`,{cause:u})}}return l},yt=(t,e)=>{let s,n=0;for(let r=0;r<=t.length-e.length;r+=1){const o=t[r];if(s){o===s&&(s=void 0);continue}if(o==='"'||o==="'"){s=o;continue}if(o==="("){n+=1;continue}if(o===")"){n-=1;continue}if(n===0&&t.slice(r,r+e.length)===e)return r}return-1},X=(t,e)=>{const s=[];let n=0,r=0;for(;r<=t.length-e.length;){const o=yt(t.slice(r),e);if(o===-1)break;s.push(t.slice(n,r+o)),r+=o+e.length,n=r}return s.push(t.slice(n)),s},U=(t,e,s,n)=>{const r=t.trim();if(r==="")return!1;if(r.startsWith("(")&&r.endsWith(")")&&je(r)===r.length-1)return U(r.slice(1,-1),e,s,n);const o=X(r," or ");if(o.length>1)return o.some(l=>U(l,e,s,n));const a=X(r," and ");if(a.length>1)return a.every(l=>U(l,e,s,n));if(r.startsWith("not "))return!U(r.slice(4),e,s,n);for(const l of["==","!="]){const h=yt(r,l);if(h!==-1){const i=_(r.slice(0,h),e,n,s,!1),p=_(r.slice(h+l.length),e,n,s,!1),d=i===p;return l==="=="?d:!d}}return be(gt(r,e,n,s,!1))},je=t=>{if(t[0]!=="(")return-1;let e=0,s,n=-1;for(const r of t){if(n+=1,s){r===s&&(s=void 0);continue}if(r==='"'||r==="'"){s=r;continue}if(r==="(")e+=1;else if(r===")"&&(e-=1,e===0))return n}return-1},P=(t,e)=>{let s="";for(const n of t){if(n.type==="text"){s+=n.value;continue}if(n.type==="expr"){s+=Ee(gt(n.expression,e.scope,n.line,e.filename));continue}if(n.type==="if"){const r=U(n.condition,e.scope,e.filename,n.line)?n.consequent:n.alternate??[];s+=P(r,e);continue}if(n.type==="for"){const r=mt(n.collection,e.scope,n.line,e.filename,!1);if(r==null)continue;if(!Array.isArray(r))throw new TypeError(`${e.filename}:${n.line}: {% for %} expected an array, got ${typeof r}`);for(const o of r){const a={...e.scope,[n.binding]:o};s+=P(n.body,{...e,scope:a})}continue}if(n.type==="include"){const r=e.partials?.get(n.name);if(!r)throw new Error(`${e.filename}:${n.line}: Partial "${n.name}" not found. Available: ${[...e.partials?.keys()??[]].join(", ")||"(none)"}`);const o=e.includeStack??new Set;if(o.has(n.name)){const a=[...o,n.name].join(" → ");throw new Error(`${e.filename}:${n.line}: Circular partial include detected: ${a}`)}o.add(n.name);try{s+=P(r,{...e,filename:`<partial:${n.name}>`,includeStack:o})}finally{o.delete(n.name)}}}return s},ke=(t,e)=>ht(pt(t),e),B=(t,e)=>P(ht(pt(t),e.filename),e),tt="template.yml",Le=".raw",We=new Set([".cjs",".css",".env",".gitattributes",".gitignore",".graphql",".html",".ini",".js",".json",".json5",".jsonc",".jsx",".lock",".md",".mdx",".mjs",".prettierrc",".raw",".rs",".scss",".sh",".sql",".svg",".tera",".toml",".ts",".tsx",".twig",".txt",".vue",".xml",".yaml",".yml"]),Ue=new Set(["Brewfile","CHANGELOG","CODEOWNERS","CONTRIBUTING","COPYING","Dockerfile","Gemfile","LICENCE","LICENSE","Makefile","NOTICE","Procfile","Rakefile","README","VERSION"]),Se=t=>{const e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\")),s=e===-1?t:t.slice(e+1),n=s.lastIndexOf(".");return n===-1||n===0?"":s.slice(n).toLowerCase()},wt=t=>{const e=Math.max(t.lastIndexOf("/"),t.lastIndexOf("\\"));return e===-1?t:t.slice(e+1)},Te=t=>{const e=Se(t);if(e!=="")return We.has(e);const s=wt(t);return Ue.has(s)},Oe=t=>{const e={default:t.default,internal:t.internal,order:t.order,prompt:t.prompt,required:t.required};switch(t.type){case"array":return{...e,type:"array"};case"boolean":return{...e,default:typeof e.default=="boolean"?e.default:void 0,type:"boolean"};case"enum":return{...e,multiple:t.multiple,type:"enum",values:t.values??[]};case"number":return{...e,type:"number"};case"string":return{...e,type:"string"};default:throw new Error(`Unsupported variable type "${String(t.type)}"`)}},Pe=t=>t.replaceAll("\\","/").replace(/^\.\//,"").replaceAll(/\/+/g,"/"),_e=(t,e,s)=>{const n=e.split("/").filter(Boolean);if(n.length===0)throw new Error("Empty destination path for value");let r=t;for(let o=0;o<n.length-1;o+=1){const a=n[o],l=r[a];if(l===void 0){const h={};r[a]=h,r=h}else if(typeof l=="object"&&!Buffer.isBuffer(l))r=l;else throw new TypeError(`Path conflict: "${n.slice(0,o+1).join("/")}" is both a file and a directory`)}r[n.at(-1)]=s},et=(t,e,s)=>{if(typeof t!="string")return Ie(t);const n=t.includes("{{")||t.includes("{%")?B(t,{filename:`${s}#frontmatter`,scope:e}):t;return U(n,e,`${s}#frontmatter`,1)},Ie=t=>t==null||t===!1||t===0||t===""?!1:Array.isArray(t)?t.length>0:typeof t=="string"?t!=="false"&&t!=="0":!0,qe=(t,e)=>{const s=st(t,tt),n=At(s);if(!n||typeof n!="object")throw new Error(`${s}: must contain a YAML mapping`);const r={};if(n.variables)for(const[h,i]of Object.entries(n.variables))r[h]=Oe(i);const o=new Map,a=[];for(const h of qt(t,{includeDirs:!1,includeSymlinks:!1})){if(h.path===s)continue;const i=nt(t,h.path).replaceAll("\\","/");if(i===tt)continue;if(ye(i)){const c=O(h.path),u=ke(c,i);for(const f of Re(i))o.has(f)&&o.get(f)!==u&&bt.warn(`partial name "${f}" is declared by multiple files — last one wins. Use distinct names or fully-qualified includes.`),o.set(f,u);continue}if(i.endsWith(Le)){const c=O(h.path);a.push({binary:null,isRaw:!0,rawText:c,relativePath:i});continue}if(Te(i)){const c=O(h.path);a.push({binary:null,isRaw:!1,rawText:c,relativePath:i});continue}const d=O(h.path,{buffer:!0});a.push({binary:d,isRaw:!1,rawText:null,relativePath:i})}const l=h=>{const i={...h.builtins,...h.options},p={},d={};for(const u of a){const f=u.relativePath;let g,y,m=!1;if(u.binary)g=u.binary;else if(u.isRaw)g=u.rawText??"";else{const $=u.rawText??"",A=we($,T=>Et(T));if(A.frontmatter){if(A.frontmatter.skip!==void 0&&et(A.frontmatter.skip,i,f)||A.frontmatter.if!==void 0&&!et(A.frontmatter.if,i,f))continue;typeof A.frontmatter.to=="string"&&(y=B(A.frontmatter.to,{filename:`${f}#frontmatter.to`,partials:o,scope:i})),A.frontmatter.force===!0&&(m=!0)}g=B(A.body,{filename:f,partials:o,scope:i})}const w=Pe(y??me(ge(f),i));_e(p,w,g),m&&(d[w]={force:!0})}const c={files:p};return Object.keys(d).length>0&&(c.filesMeta=d),c};return{about:{description:n.description??`Moon-format template at ${t}`,name:n.title??e},destination:n.destination,options:r,produce:l}},Re=t=>{const e=ut(t),s=wt(e),n=new Set([s,e]);if(s.startsWith("_")){n.add(s.replace(/^_+/,""));const r=e.slice(0,e.length-s.length);n.add(`${r}${s.replace(/^_+/,"")}`)}return[...n]};export{qe as loadMoonTemplate};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{p as s}from"./cli-main.js";import{c as a,f as c}from"../packem_shared/registry-keys-
|
|
1
|
+
import{p as s}from"./cli-main.js";import{c as a,f as c}from"../packem_shared/registry-keys-DwB3ZXS_.js";const f=async({options:r})=>{if(r.clear){const t=a();if(r.json){process.stdout.write(`${JSON.stringify({cleared:t,refetched:!1},void 0,2)}
|
|
2
2
|
`);return}s.success(t?"Cleared cached npm signing keys.":"No cached npm signing keys to clear.");return}const e=await c({forceRefresh:!0});if(e===void 0){if(r.json){process.stdout.write(`${JSON.stringify({cleared:!1,error:"fetch-failed",refetched:!1},void 0,2)}
|
|
3
3
|
`),process.exitCode=1;return}s.error("Failed to fetch npm signing keys (network error and no cached keys available)."),process.exitCode=1;return}if(r.json){process.stdout.write(`${JSON.stringify({cleared:!1,fromCache:e.fromCache,keyCount:e.keys.length,refetched:!e.fromCache,stale:e.stale??!1},void 0,2)}
|
|
4
4
|
`);return}if(e.fromCache&&e.stale===!0){s.warn(`Network fetch failed — falling back to expired cache (${String(e.keys.length)} keys).`);return}s.success(`Refreshed npm signing keys (${String(e.keys.length)} keys).`)};export{f as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{v as l,U as a}from"../packem_shared/index-
|
|
1
|
+
import{v as l,U as a}from"../packem_shared/index-BzhrR_iC.js";import{r as m}from"../packem_shared/resolve-runtime-CNiHcVtx.js";import{r as u}from"../packem_shared/run-file-UBukWaha.js";const p=s=>{let r,n=!1,o;const i=[];for(let e=0;e<s.length;e+=1){const t=s[e];if(o===void 0){if(t==="--node"){n=!0;continue}if(t==="--runtime"){r=s[e+1],e+=1;continue}if(t.startsWith("--runtime=")){r=t.slice(10);continue}o=t;continue}i.push(t)}return i[0]==="--"&&i.shift(),{file:o,node:n,runtimeFlag:r,scriptArguments:i}},h=async s=>{const{file:r,node:n,runtimeFlag:o,scriptArguments:i}=p(s);if(r===void 0){process.stderr.write(`No file specified. Usage: vis x <file> [args...]
|
|
2
2
|
`),process.exitCode=1;return}const e=process.cwd(),t=l(r)?r:a(e,r);if(n){const d=await u(t,i,"node",e,{node:!0});d!==0&&(process.exitCode=d);return}let c;try{c=m(e,{flag:o})}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 f=await u(t,i,c.runtime,e);f!==0&&(process.exitCode=f)};export{p as parseLeanXArgs,h as runLeanX};
|
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import{createRequire as _}from"node:module";import{x,p as t,y as R}from"./cli-main.js";import{d as P}from"../packem_shared/pm-runner-
|
|
1
|
+
import{createRequire as _}from"node:module";import{x,p as t,y as R}from"./cli-main.js";import{d as P}from"../packem_shared/pm-runner-CMSml1Bj.js";import{a as M}from"../packem_shared/build-scripts-CEDx_nJp.js";import{e as v}from"../packem_shared/index-BzhrR_iC.js";import{y as k}from"../packem_shared/isAccessibleSync-DYKTrrvc-C-_5cgwu.js";import{p as q}from"../packem_shared/readJsonSync-CbryXYxN-EWl7_7KX.js";let j;const B=c=>(j??=_(import.meta.url))(c),y=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,D=c=>{if(typeof y<"u"&&y.versions&&y.versions.node){const[i,f]=y.versions.node.split(".").map(Number);if(i>22||i===22&&f>=3||i===20&&f>=16)return y.getBuiltinModule(c)}return B(c)},{readdirSync:S,statSync:N}=D("node:fs"),T=(c,i={})=>{const f=v(c,"node_modules");if(!k(f))return[];const l=new Map,p=new Set,b=(n,o,r)=>{const e=`${o}@${r}`;if(p.has(e))return;p.add(e);const s=r.startsWith(c)?r.slice(c.length+1):r;let u=l.get(n);u||(u=[],l.set(n,u)),u.some($=>$.name===o)||u.push({name:o,relativePath:s})},m=(n,o="")=>{let r;try{r=S(n)}catch{return}for(const e of r){const s=v(n,e);if(e.startsWith("@")){m(s,`${e}/`);continue}if(e===".pnpm"&&o===""){let a;try{a=S(s)}catch{continue}for(const d of a){const g=v(s,d,"node_modules");k(g)&&m(g)}continue}if(e.startsWith("."))continue;const u=o+e,$=v(s,"package.json");try{if(!N(s).isDirectory()||!k($))continue;const a=q($),d=typeof a.name=="string"?a.name:u;if(typeof a.bin=="string"){const w=d.includes("/")?d.split("/").pop():d;b(w,d,s)}else if(a.bin&&typeof a.bin=="object")for(const w of Object.keys(a.bin))b(w,d,s);const g=v(s,"node_modules");k(g)&&m(g)}catch{}}};m(f);const h=[];for(const[n,o]of l)o.length<2||i[n]===!0||o.every(e=>i[`${e.name}#${n}`]===!0)||h.push({bin:n,packages:o});return h.sort((n,o)=>n.bin.localeCompare(o.bin))},V=new Set(["bun","npm","pnpm","yarn"]),F=({options:c,visConfig:i,workspaceRoot:f})=>{const l=f??process.cwd(),p=P(l),b=i?.security?.policies?.installScripts?.allow??{},m=i?.security?.allowBins??{},h=i?.security?.pinVersions===!0,n=M(l,b,{pinVersions:h}),o=T(l,m),r=i&&V.has(p.name)?x(i,p.name,l):void 0;if(c.json){process.stdout.write(`${JSON.stringify({binConflicts:o,drift:r,excess:n.excess,installed:n.installed.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),packageManager:p.name,pinVersions:h,unapproved:n.unapproved.map(e=>({hooks:e.hooks,name:e.name,version:e.version})),versionDrift:n.versionDrift},void 0,2)}
|
|
2
2
|
`);return}if(t.info(`Build-script status (${p.name}):
|
|
3
3
|
`),n.installed.length===0&&n.unapproved.length===0&&t.success(" No installed packages declare lifecycle scripts."),n.installed.length>0){t.success(` Approved (${String(n.installed.length)}):`);for(const e of n.installed)t.info(` ✓ ${e.name} — ${e.hooks.join(", ")}`)}if(n.unapproved.length>0){t.info(""),t.warn(` Unapproved (${String(n.unapproved.length)}):`);for(const e of n.unapproved)t.info(` ✗ ${e.name} — ${e.hooks.join(", ")}`);t.notice(" Run 'vis approve-builds' to review.")}if(n.excess.length>0){t.info(""),t.warn(` Stale allowlist entries (${String(n.excess.length)}):`);for(const e of n.excess)t.info(` ! ${e}`);t.notice(" Remove these from vis.config.ts security.policies.installScripts.allow.")}if(n.versionDrift.length>0){t.info(""),t.warn(` Version drift (pinVersions: true) — ${String(n.versionDrift.length)} entr${n.versionDrift.length===1?"y":"ies"} point at outdated versions:`);for(const{from:e,to:s}of n.versionDrift)t.info(` ${e} → ${s}`);t.notice(" Update vis.config.ts security.policies.installScripts.allow keys to migrate.")}if(o.length>0){t.info(""),t.warn(` Bin conflicts (${String(o.length)}) — multiple packages expose the same bin name:`);for(const e of o)t.info(` ${e.bin} ← ${e.packages.map(s=>s.name).join(", ")}`);t.notice(" Add the bin (or 'pkg#bin') to vis.config.ts security.allowBins to silence this.")}if(r?.hasDrift){t.info("");for(const e of R(r))t.warn(e)}};export{F as default};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import{createRequire as f}from"node:module";import{d as p,c as I}from"../packem_shared/pm-runner-
|
|
1
|
+
import{createRequire as f}from"node:module";import{d as p,c as I}from"../packem_shared/pm-runner-CMSml1Bj.js";let _;const w=e=>(_??=f(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,g=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[t,r]=o.versions.node.split(".").map(Number);if(t>22||t===22&&r>=3||t===20&&r>=16)return o.getBuiltinModule(e)}return w(e)},{createInterface:y}=g("node:readline"),s="sigstore",v=()=>!!process.stdout.isTTY&&process.env.CI!=="true",$=e=>new Promise(t=>{const r=y({input:process.stdin,output:process.stderr});r.question(`${e} (Y/n) `,a=>{r.close();const n=a.trim().toLowerCase();t(n===""||n==="y"||n==="yes")})}),h=e=>{const t=p(e),r=I(t,{exact:!1,filter:[],global:!1,optional:!1,packages:[s],peer:!1,saveDev:!0,workspace:!1,workspaceRoot:!1},e,console);return Promise.resolve({exitCode:r})},C=()=>{try{return import.meta.resolve(s),!0}catch{return!1}},R=e=>{let t="pnpm";try{t=p(e).name}catch{}switch(t){case"bun":return`bun add -d ${s}`;case"npm":return`npm install -D ${s}`;case"yarn":return`yarn add -D ${s}`;default:return`pnpm add -D ${s}`}},D=()=>import("sigstore"),E=async(e={})=>{const t=e.interactive??v(),r=e.prompt??$,a=e.runInstall??h,n=e.importImpl??D,l=e.workspaceRoot??process.cwd(),i=R(l);try{return await n()}catch(d){const{code:u,message:m}=d;if(!(u==="ERR_MODULE_NOT_FOUND"||u==="MODULE_NOT_FOUND")||!m.includes(s))throw d}if(!t)throw new Error(`${s} is not installed. \`vis attest\` needs it for keyless signing/verification. Install it in your repo first:
|
|
2
2
|
${i}`);if(!await r(`${s} isn't installed. Install it now?`))throw new Error(`${s} install declined. Re-run \`vis attest\` after installing manually:
|
|
3
3
|
${i}`);const c=await a(l);if(c.exitCode!==0)throw new Error(`Install of ${s} failed (exit ${String(c.exitCode)}). Install manually and retry:
|
|
4
4
|
${i}`);return await n()};export{R as installCommandFor,C as isSigstoreInstalled,E as loadOptionalSigstore};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as I}from"node:module";import{s as $,d as k,i as R,b as N}from"../packem_shared/maven-pom-B0KG9kJQ.js";import{VisReleaseError as g}from"../packem_shared/VisReleaseError-DZtgcKf8.js";let b;const M=n=>(b??=I(import.meta.url))(n),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,P=n=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[o,t]=p.versions.node.split(".").map(Number);if(o>22||o===22&&t>=3||o===20&&t>=16)return p.getBuiltinModule(n)}return M(n)},{readFile:V}=P("node:fs/promises"),y=n=>`${n.owner}\0${n.property===void 0?"version":`property:${n.property}`}`,_=async(n,o)=>n.get(o)??V(o,"utf8"),q=(n,o,t)=>{const c=$(n),a=o.property===void 0?c.version:c.properties.get(o.property);if(a===void 0){const f=o.property===void 0?"a literal <version>":`a <properties> entry ${o.property}`;throw new g({code:"CONFIG_INVALID",file:o.owner,message:`${o.owner} has no ${f} to bump for ${o.name}.`})}return N(n,[{slot:a,value:t}])},j=async n=>{const{pending:o,projects:t,releases:c}=n,a=new Set,f=new Set(t.map(e=>e.name));for(const e of c)if(!f.has(e.name))throw new g({code:"CONFIG_INVALID",message:`${e.name} is planned as a Maven release, but no Maven module with that name was discovered. Re-run the release from a fresh context.`,packageName:e.name});const u=new Map(c.map(e=>[e.name,e.newVersion])),v=new Map;for(const e of t){const s=y(e);v.set(s,[...v.get(s)??[],e])}const h=new Set;for(const e of t){const s=u.get(e.name),i=y(e);if(s===void 0||h.has(i))continue;h.add(i);const d=(v.get(i)??[]).filter(r=>u.get(r.name)!==s);if(d.length>0)throw new g({code:"CONFIG_INVALID",file:e.owner,message:`Maven modules share the version at ${e.owner}, so they must release together at ${s}. Not released at that version: ${d.map(r=>r.name).join(", ")}.`});const l=await _(o,e.owner);o.set(e.owner,q(l,e,s)),a.add(e.owner)}for(const e of t){const s=await _(o,e.manifestPath),i=$(s),m=[];for(const d of i.dependencies){const l=k(i,d),r=d.version,w=l===void 0?void 0:u.get(l);w!==void 0&&r!==void 0&&R(r.value)&&r.value!==w&&m.push({slot:r,value:w})}m.length>0&&(o.set(e.manifestPath,N(s,m)),a.add(e.manifestPath))}return a};export{j as planMavenWorkspace};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as R}from"node:module";import{e as k,d as N,i as T,s as E,a as $}from"../packem_shared/maven-pom-B0KG9kJQ.js";import{VisReleaseError as F}from"../packem_shared/VisReleaseError-DZtgcKf8.js";let j;const S=t=>(j??=R(import.meta.url))(t),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,I=t=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[a,n]=p.versions.node.split(".").map(Number);if(a>22||a===22&&n>=3||a===20&&n>=16)return p.getBuiltinModule(t)}return S(t)},{readFile:q}=I("node:fs/promises"),{resolve:v,dirname:m}=I("node:path"),M=/^\$\{([^}]+)\}$/,O=async t=>{try{return await q(t,"utf8")}catch{return}},y=async t=>{const a=await O(t);return a===void 0?void 0:{manifestPath:t,scan:E(a)}},g=async t=>{const a=t.scan.parent;if(!a)return;const n=a.relativePath||"../pom.xml",f=n.endsWith(".xml")?v(m(t.manifestPath),n):v(m(t.manifestPath),n,"pom.xml"),s=await y(f);return s&&s.scan.artifactId?.value===a.artifactId?.value&&k(s.scan)===a.groupId?.value?s:void 0},l=(t,a)=>new F({code:"CONFIG_INVALID",file:t,message:a}),b=async(t,a=new Set)=>{const{manifestPath:n,scan:f}=t;if(a.has(n))throw l(n,`${n} is part of a parent cycle; vis cannot resolve its version.`);if(!f.version){const d=await g(t);if(!d)throw l(n,`${n} has no <version>, and its <parent> is not a pom on disk with matching coordinates.`);const e=await b(d,new Set([...a,n]));return e.kind==="literal"?{...e,kind:"inherited"}:e}const s=f.version.value,c=M.exec(s)?.[1];if(c===void 0){if(s===""||$(s))throw l(n,`${n} has an unresolvable <version> "${s}".`);return{kind:"literal",owner:n,version:s}}let r=t;const h=new Set;for(;r&&!h.has(r.manifestPath);){h.add(r.manifestPath);const d=r.scan.properties.get(c);if(d!==void 0){if(d.value===""||$(d.value))break;return{kind:"property",owner:r.manifestPath,property:c,version:d.value}}r=await g(r)}throw l(n,`${n} has version \${${c}}, but no literal <properties> entry ${c} in it or its parents.`)},G=async t=>{const{claimedDirs:a,cwd:n}=t,f=await y(v(n,"pom.xml"));if(!f)return[];const s=[],c=new Set,r=async e=>{if(!c.has(e.manifestPath)){c.add(e.manifestPath),s.push(e);for(const o of e.scan.modules){const i=v(m(e.manifestPath),o,"pom.xml"),u=await y(i);if(!u)throw l(e.manifestPath,`${e.manifestPath} lists module "${o}", but ${i} does not exist.`);await r(u)}}};await r(f);const h=[];for(const e of s){if(a.has(v(m(e.manifestPath))))continue;const o=k(e.scan),i=e.scan.artifactId?.value;if(o===void 0)throw l(e.manifestPath,`${e.manifestPath} has no groupId, and its <parent> does not supply one.`);if(i===void 0||i==="")throw l(e.manifestPath,`${e.manifestPath} has no <artifactId>.`);h.push({name:`${o}:${i}`,pom:e,version:await b(e)})}const d=new Set(h.map(e=>e.name));return h.map(({name:e,pom:o,version:i})=>{const u={};for(const _ of o.scan.dependencies){const w=N(o.scan,_),P=_.version?.value;w!==void 0&&P!==void 0&&d.has(w)&&(u[w]=T(P)?P:"*")}const x={dependencies:u,name:e,private:!1,version:i.version};return{kind:i.kind,manifestPath:o.manifestPath,name:e,owner:i.owner,package:{dir:m(o.manifestPath),ecosystem:"maven",manifest:x,manifestPath:o.manifestPath,name:e,private:!1,version:i.version},...i.property===void 0?{}:{property:i.property}}})};export{G as discoverMavenProjects};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as _}from"node:module";import{a as I,N as v}from"../packem_shared/nuget-project-RApYSW_y.js";import{VisReleaseError as m}from"../packem_shared/VisReleaseError-DZtgcKf8.js";let N;const j=o=>(N??=_(import.meta.url))(o),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,y=o=>{if(typeof a<"u"&&a.versions&&a.versions.node){const[r,s]=a.versions.node.split(".").map(Number);if(r>22||r===22&&s>=3||r===20&&s>=16)return a.getBuiltinModule(o)}return j(o)},{readFile:G}=y("node:fs/promises"),w=o=>`${o.owner}\0${o.line}`,k=async o=>{const{pending:r,projects:s,releases:p}=o,l=new Set,g=new Set(s.map(e=>e.name));for(const e of p)if(!g.has(e.name))throw new m({code:"CONFIG_INVALID",message:`${e.name} is planned as a NuGet release, but no NuGet project with that name was discovered. Re-run the release from a fresh context.`,packageName:e.name});const d=new Map(p.map(e=>[e.name,e.newVersion])),i=new Map;for(const e of s){const t=w(e);i.set(t,[...i.get(t)??[],e])}const u=new Set;for(const e of s){const t=d.get(e.name),c=w(e);if(t===void 0||u.has(c))continue;u.add(c);const f=(i.get(c)??[]).filter(n=>d.get(n.name)!==t);if(f.length>0)throw new m({code:"CONFIG_INVALID",file:e.owner,message:`NuGet projects share the version declared at ${e.owner}:${e.line}, so they must release together at ${t}. Not released at that version: ${f.map(n=>n.name).join(", ")}.`});const h=r.get(e.owner)??await G(e.owner,"utf8");try{r.set(e.owner,I(h,e.owner,"Version",e.line,t))}catch(n){throw n instanceof v?new m({code:"CONFIG_INVALID",file:n.file,message:n.message}):n}l.add(e.owner)}return l};export{k as planNuGetWorkspace};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as C}from"node:module";import{h as N,m as R,N as X,r as Z}from"../packem_shared/nuget-project-RApYSW_y.js";import{VisReleaseError as J}from"../packem_shared/VisReleaseError-DZtgcKf8.js";import{isValidPackageName as K}from"./security.js";let D;const q=t=>(D??=C(import.meta.url))(t),v=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,S=t=>{if(typeof v<"u"&&v.versions&&v.versions.node){const[s,i]=v.versions.node.split(".").map(Number);if(s>22||s===22&&i>=3||s===20&&i>=16)return v.getBuiltinModule(t)}return q(t)},{readFile:_,readdir:G,access:L}=S("node:fs/promises"),{resolve:E,dirname:w,basename:O,extname:T,join:x,sep:W}=S("node:path"),U=new Set([".csproj",".fsproj"]),z=new Set(["bin","node_modules","obj"]),H=/^\d+(?:\.\d+){0,3}(?:-[0-9A-Z.-]+)?(?:\+[0-9A-Z.-]+)?$/i,Q=[{message:"sets the package version through PackageVersion, which vis does not read",name:"PackageVersion"},{message:"sets VersionPrefix or VersionSuffix, which vis does not read (use a plain Version literal)",name:"VersionPrefix"},{message:"sets VersionSuffix, which vis does not read (use a plain Version literal)",name:"VersionSuffix"},{message:"imports another file, which vis does not read",name:"Import"}],u=(t,s,i)=>new J({code:"CONFIG_INVALID",file:t,message:s,packageName:i}),F=t=>{try{return t()}catch(s){throw s instanceof X?u(s.file,s.message):s}},Y=t=>L(t).then(()=>!0,()=>!1),I=async(t,s,i)=>{let o=t;for(;;){const r=x(o,i);if(await Y(r))return r;const g=w(o);if(o===s||g===o)return;o=g}},ee=(t,s)=>t===s||t.startsWith(`${s}${W}`),M=async(t,s)=>{if([...s].some(o=>ee(t,o)))return[];const i=[];for(const o of await G(t,{withFileTypes:!0})){const r=x(t,o.name);o.isDirectory()?!z.has(o.name)&&!o.name.startsWith(".")&&i.push(...await M(r,s)):o.isFile()&&U.has(T(o.name))&&i.push(r)}return[...i].sort()},p=(t,s,i)=>{const o=F(()=>Z(t,s,i));if(o.length>1)throw u(s,`${s} sets ${i} ${o.length} times (lines ${o.map(r=>r.line).join(", ")}). vis cannot tell which one applies.`);return o[0]},re=async t=>{const s=E(t.cwd),i=await M(s,t.claimedDirs),o=[];for(const e of i){const n=await _(e,"utf8"),a=await I(w(e),s,"Directory.Build.props"),c=a===void 0?void 0:await _(a,"utf8"),l=await I(w(e),s,"Directory.Build.targets"),k=l===void 0?void 0:await _(l,"utf8");for(const[d,f]of[[e,n],[a,c]])if(!(d===void 0||f===void 0)){for(const b of Q)if(N(f,b.name))throw u(d,`${d} ${b.message}. Remove it, or release this project with a shell publish.`)}if(l!==void 0&&k!==void 0&&N(k,"Version"))throw u(l,`${l} sets Version, which MSBuild applies after the project file. vis cannot follow that to a version; remove it, or release with a shell publish.`);if(F(()=>p(n,e,"IsPackable")??(c===void 0||a===void 0?void 0:p(c,a,"IsPackable")))?.value.toLowerCase()==="false"||p(n,e,"IsTestProject")?.value.toLowerCase()==="true"||/<PackageReference\s+Include="Microsoft\.NET\.Test\.Sdk"/i.test(R(n)))continue;const P=p(n,e,"Version"),V=c===void 0||a===void 0?void 0:p(c,a,"Version");if(P===void 0&&V===void 0)continue;const A=P===void 0?"inherited":"literal",j=P===void 0?a:e,h=P??V;if(!H.test(h.value))throw u(j,`${j} sets Version to "${h.value}". vis reads only a plain literal such as 1.2.0 or 1.2.0-beta.1, not an MSBuild expression.`);const $=d=>{const f=p(n,e,d)??(c===void 0||a===void 0?void 0:p(c,a,d));if(f!==void 0){if(f.value===""||f.value.includes("$("))throw u(e,`${e} sets ${d} to "${f.value}". vis reads only a plain literal for a package id.`);return f.value}},y=$("PackageId")??$("AssemblyName")??O(e,T(e)),m=y.toLowerCase();if(!K(m))throw u(e,`${e} names the package "${y}", which is not a valid package name (lowercase letters, digits, ".", "_" and "-").`,m);const B=[...R(n).matchAll(/<ProjectReference\s+Include="([^"]+)"/g)].map(d=>E(w(e),(d[1]??"").replaceAll("\\","/")));o.push({entry:{kind:A,line:h.line,name:m,owner:j,package:{dir:w(e),ecosystem:"nuget",manifest:{dependencies:{},name:m,private:!1,version:h.value},manifestPath:e,name:m,private:!1,version:h.value},projectPath:e},references:B})}const r=new Map;for(const{entry:e}of o){const n=r.get(e.name);if(n!==void 0)throw u(e.projectPath,`${e.name} is declared by both ${n} and ${e.projectPath}. NuGet ids compare case-insensitively, so they must be unique to release them.`,e.name);r.set(e.name,e.projectPath)}const g=new Map(o.map(({entry:e})=>[e.projectPath,e.name]));return o.map(({entry:e,references:n})=>{const a={};for(const c of n){const l=g.get(c);l!==void 0&&l!==e.name&&(a[l]="*")}return{...e,package:{...e.package,manifest:{...e.package.manifest,dependencies:a}}}})};export{re as discoverNuGetProjects};
|