@visulima/vis 2.0.0 → 2.0.2
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 +41 -0
- package/LICENSE.md +862 -170
- package/README.md +1 -1
- package/dist/bin.js +1 -1
- package/dist/binx.js +2 -2
- package/dist/config/index.d.ts +1817 -1811
- package/dist/generate/index.d.ts +39 -39
- package/dist/packem_chunks/CONFIG_FILES.js +5 -5
- package/dist/packem_chunks/bloom-status.js +1 -1
- package/dist/packem_chunks/bloom-sync.js +1 -1
- package/dist/packem_chunks/cache-attestation.js +1 -1
- package/dist/packem_chunks/catalog.js +69 -67
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +150 -145
- package/dist/packem_chunks/detect.js +3 -3
- package/dist/packem_chunks/detect2.js +4 -4
- package/dist/packem_chunks/dispatch.js +3 -3
- package/dist/packem_chunks/doctor-probe.js +1 -1
- package/dist/packem_chunks/extra-files.js +3 -3
- package/dist/packem_chunks/fix.js +9 -9
- package/dist/packem_chunks/handler.js +1 -1
- package/dist/packem_chunks/handler10.js +5 -5
- package/dist/packem_chunks/handler11.js +1 -1
- package/dist/packem_chunks/handler12.js +6 -6
- 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 +2 -2
- package/dist/packem_chunks/handler22.js +10 -10
- package/dist/packem_chunks/handler23.js +1 -1
- package/dist/packem_chunks/handler24.js +1 -1
- package/dist/packem_chunks/handler25.js +1 -1
- package/dist/packem_chunks/handler26.js +5 -5
- package/dist/packem_chunks/handler27.js +1 -1
- package/dist/packem_chunks/handler28.js +3 -3
- package/dist/packem_chunks/handler29.js +1 -1
- package/dist/packem_chunks/handler3.js +2 -3
- package/dist/packem_chunks/handler30.js +1 -1
- package/dist/packem_chunks/handler31.js +2 -2
- package/dist/packem_chunks/handler35.js +3 -3
- package/dist/packem_chunks/handler4.js +4 -4
- package/dist/packem_chunks/handler40.js +10 -10
- package/dist/packem_chunks/handler42.js +3 -3
- package/dist/packem_chunks/handler43.js +3 -3
- package/dist/packem_chunks/handler5.js +5 -5
- package/dist/packem_chunks/handler50.js +5 -5
- package/dist/packem_chunks/handler51.js +13 -13
- 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/handler57.js +5 -5
- package/dist/packem_chunks/handler58.js +4 -4
- package/dist/packem_chunks/handler59.js +8 -8
- package/dist/packem_chunks/handler6.js +7 -7
- package/dist/packem_chunks/handler60.js +2 -2
- package/dist/packem_chunks/handler61.js +13 -13
- package/dist/packem_chunks/handler62.js +4 -4
- package/dist/packem_chunks/handler63.js +3 -3
- package/dist/packem_chunks/handler64.js +4 -4
- package/dist/packem_chunks/handler65.js +6 -6
- package/dist/packem_chunks/handler66.js +2 -2
- package/dist/packem_chunks/handler67.js +9 -9
- package/dist/packem_chunks/handler68.js +7 -7
- package/dist/packem_chunks/handler69.js +24 -24
- package/dist/packem_chunks/handler7.js +1 -1
- package/dist/packem_chunks/handler70.js +6 -6
- package/dist/packem_chunks/handler71.js +14 -14
- package/dist/packem_chunks/handler72.js +47 -47
- package/dist/packem_chunks/handler73.js +9 -9
- package/dist/packem_chunks/handler74.js +27 -27
- package/dist/packem_chunks/handler75.js +3 -3
- package/dist/packem_chunks/handler76.js +8 -8
- package/dist/packem_chunks/handler77.js +63 -64
- package/dist/packem_chunks/handler78.js +25 -25
- package/dist/packem_chunks/handler8.js +1 -1
- package/dist/packem_chunks/handler9.js +1 -1
- package/dist/packem_chunks/heal-accept.js +5 -5
- package/dist/packem_chunks/heal.js +8 -8
- package/dist/packem_chunks/help-command.js +46 -46
- package/dist/packem_chunks/index2.js +5 -5
- package/dist/packem_chunks/index3.js +3 -3
- package/dist/packem_chunks/index4.js +11 -11
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +2 -2
- package/dist/packem_chunks/list.js +2 -2
- package/dist/packem_chunks/loader.js +4 -4
- package/dist/packem_chunks/orchestrator.js +14 -14
- package/dist/packem_chunks/pre-mode.js +2 -2
- package/dist/packem_chunks/prompts.js +3 -3
- package/dist/packem_chunks/prune.js +1 -1
- package/dist/packem_chunks/publish-guards.js +1 -1
- package/dist/packem_chunks/registry.js +17 -17
- package/dist/packem_chunks/resolveFormatter.js +5 -5
- package/dist/packem_chunks/shell-runner.js +1 -1
- package/dist/packem_chunks/snapshot.js +2 -2
- package/dist/packem_chunks/stage-publisher.js +1 -1
- package/dist/packem_chunks/staged-registry.js +2 -2
- 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/tar.js +3 -3
- package/dist/packem_chunks/tripwire.js +2 -2
- package/dist/packem_chunks/ts-loader.js +9 -9
- package/dist/packem_chunks/verify-lockfile.js +2 -2
- package/dist/packem_chunks/workspace.js +2 -2
- package/dist/packem_shared/advisories-CCBGdU8U.js +1 -0
- package/dist/packem_shared/affected-selection-Dj-ymxhw.js +1 -0
- package/dist/packem_shared/affected-shas-PwkVbPch.js +1 -0
- package/dist/packem_shared/ai-analysis-bGCAc1jR.js +68 -0
- package/dist/packem_shared/{ai-fix-CLfWbyqY.js → ai-fix-DV5-dHBY.js} +9 -9
- package/dist/packem_shared/{augment-BVuj3ee7.js → augment-24KX2nkI.js} +4 -4
- package/dist/packem_shared/bin-CtzhnYMp.js +1 -0
- package/dist/packem_shared/build-scripts-w4SNeR7D.js +1 -0
- package/dist/packem_shared/{command-runtime-DTbo12cP.js → command-runtime-BLFPUYAT.js} +1 -1
- package/dist/packem_shared/cyclonedx-C4KaVTn1.js +4 -0
- package/dist/packem_shared/{dependency-scan-DZcSlSFp.js → dependency-scan-D_ona0Qm.js} +1 -1
- package/dist/packem_shared/{docker-69ybb6g7.js → docker-DaVs-9wK.js} +40 -40
- package/dist/packem_shared/{en-C26W78--.js → en-D3CfXlO7.js} +13 -13
- package/dist/packem_shared/failure-log-CTneNcio.js +2 -0
- package/dist/packem_shared/giget-CAxjpwew.js +2 -0
- package/dist/packem_shared/glob-BUjyjdE8-C4M8e02u.js +1 -0
- package/dist/packem_shared/index-BWl4DbMp.js +1 -0
- package/dist/packem_shared/index-CTMU29dI.js +1 -0
- package/dist/packem_shared/index-uBVnF4ji.js +35 -0
- package/dist/packem_shared/index.server-CusjRLCh.js +2 -0
- package/dist/packem_shared/{interface.d-B7VK2rcH.d.ts → interface.d-CRqRz4jt.d.ts} +39 -39
- package/dist/packem_shared/{interface.d-Cezzifoh.d.ts → interface.d-CrHOtJc1.d.ts} +37 -37
- package/dist/packem_shared/lifecycle-B8A2T3gx.js +2 -0
- package/dist/packem_shared/lockfile-Bccery3L.js +1 -0
- package/dist/packem_shared/main-D_cam4hv.js +1 -0
- package/dist/packem_shared/manifests-BDkwiVbh.js +1 -0
- package/dist/packem_shared/{min-release-age-hK604veF.js → min-release-age-OaYpLwux.js} +2 -2
- package/dist/packem_shared/missing-package-json-BqS-OnKd.js +1 -0
- package/dist/packem_shared/{native-config-sync-DDKjAy0i.js → native-config-sync-Ds1FtcrM.js} +7 -7
- package/dist/packem_shared/osv-bloom-pKp7urSB.js +2 -0
- package/dist/packem_shared/package-version-C47v64aB.js +4 -0
- package/dist/packem_shared/packument-HBVbyf7x.js +1 -0
- package/dist/packem_shared/pm-runner-C6eTANt1.js +1 -0
- package/dist/packem_shared/project-name-filter-CJ3XX2TI.js +7 -0
- package/dist/packem_shared/prompt-BSAy8SMH.js +1 -0
- package/dist/packem_shared/{provenance-CRBV9cko.js → provenance-D4Cza8cp.js} +1 -1
- package/dist/packem_shared/{readJsonSync-DuMMeB3s-B9cGBVbJ.js → readJsonSync-DweZd5ZA-0eZh9sGm.js} +1 -1
- package/dist/packem_shared/registry-keys-C0ez2VND.js +1 -0
- package/dist/packem_shared/{resolve-explicit-BX6aMYl-.js → resolve-explicit-BbT764KS.js} +1 -1
- package/dist/packem_shared/{resolve-runtime-COyiEML3.js → resolve-runtime-D_vZovbB.js} +1 -1
- package/dist/packem_shared/run-file-DyPFFN9U.js +1 -0
- package/dist/packem_shared/{runtime-check-fzDkedMW.js → runtime-check-D4um-yQq.js} +1 -1
- package/dist/packem_shared/s1ngularity-St6dhKiq.js +1 -0
- package/dist/packem_shared/scan-progress-q-N2JtIp.js +2 -0
- package/dist/packem_shared/selectors-Ce_6UAoY.js +3 -0
- package/dist/packem_shared/signatures-Dyeyg1q9.js +2 -0
- package/dist/packem_shared/subtree-DSm0QEoE.js +2 -0
- package/dist/packem_shared/target-merge-Cfy7c__2.js +11 -0
- package/dist/packem_shared/target-options-7XcbqGDe.js +1 -0
- package/dist/packem_shared/toolchain-C_pNMBM6.js +5 -0
- package/dist/packem_shared/typosquats-xzcAGPiM.js +1 -0
- package/dist/packem_shared/{use-measured-height-DfNxp6nf.js → use-measured-height-CBjN0fle.js} +1 -1
- package/dist/packem_shared/verify-Dve9PQj3.js +1 -0
- package/dist/packem_shared/{vis-update-app-De8JjZm0.js → vis-update-app-DMAC2pPf.js} +1 -1
- package/dist/packem_shared/vis-user-error-xmha3L4n.js +30 -0
- package/dist/packem_shared/watch-BXOOX7lx.js +1 -0
- package/dist/packem_shared/watch-loop-Q7UpkVbr.js +11 -0
- package/dist/release/core/package-managers/index.d.ts +2 -2
- package/dist/release/core/version-actions/index.d.ts +10 -10
- package/dist/release/index.d.ts +60 -60
- package/dist/release/plugin-sdk.d.ts +80 -80
- package/dist/release/presets.d.ts +148 -148
- package/dist/release/types.d.ts +840 -840
- package/dist/runtime/preload.js +1 -1
- package/index.d.ts +204 -204
- package/index.js +52 -52
- package/package.json +16 -16
- package/schemas/project.schema.json +4 -1
- package/schemas/vis-config.schema.json +9 -3
- package/dist/packem_shared/advisories-B76fBVL-.js +0 -1
- package/dist/packem_shared/affected-shas-BOeR4vEc.js +0 -1
- package/dist/packem_shared/ai-analysis-D7HOdUwd.js +0 -68
- package/dist/packem_shared/bin-CkfFJCAM.js +0 -1
- package/dist/packem_shared/build-scripts-CfAqHBlq.js +0 -1
- package/dist/packem_shared/cyclonedx--L7NbMBH.js +0 -4
- package/dist/packem_shared/failure-log-BZQqxffZ.js +0 -2
- package/dist/packem_shared/giget-DVTFJlbR.js +0 -2
- package/dist/packem_shared/glob-DMbPwGSj-D2Hk3lFG.js +0 -1
- package/dist/packem_shared/index-2LCHaVNX.js +0 -35
- package/dist/packem_shared/index-B0EsgdzO.js +0 -1
- package/dist/packem_shared/index-Bhzio2RB.js +0 -1
- package/dist/packem_shared/index-Bq6YEpiq.js +0 -28
- package/dist/packem_shared/index.server-qvZ-cy29.js +0 -2
- package/dist/packem_shared/lifecycle-BcCMt9wn.js +0 -2
- package/dist/packem_shared/lockfile-Cwt0Nwr0.js +0 -1
- package/dist/packem_shared/main-B3juSU5z.js +0 -1
- package/dist/packem_shared/manifests-BshBdSb-.js +0 -1
- package/dist/packem_shared/missing-package-json-Cu0iWMT2.js +0 -1
- package/dist/packem_shared/osv-bloom-DMhXP184.js +0 -2
- package/dist/packem_shared/package-version-TsxLc6w2.js +0 -4
- package/dist/packem_shared/packument-CtVAoNo7.js +0 -1
- package/dist/packem_shared/pm-runner-CfyxALPK.js +0 -1
- package/dist/packem_shared/prompt-DjXHVgYU.js +0 -1
- package/dist/packem_shared/registry-keys-Ci2keQNi.js +0 -1
- package/dist/packem_shared/run-file-CTJfIZ0I.js +0 -1
- package/dist/packem_shared/s1ngularity-Cq1cCSpU.js +0 -1
- package/dist/packem_shared/scan-progress-DQ9qIGzr.js +0 -2
- package/dist/packem_shared/selectors-B9dOMIMq.js +0 -3
- package/dist/packem_shared/signatures-DvD1E8Xa.js +0 -2
- package/dist/packem_shared/subtree-C7bZuiSQ.js +0 -2
- package/dist/packem_shared/target-merge-Dg25Izl5.js +0 -11
- package/dist/packem_shared/target-options-aPqByoww.js +0 -1
- package/dist/packem_shared/toolchain-CiaW3bx4.js +0 -5
- package/dist/packem_shared/typosquats-CRnvlYPw.js +0 -1
- package/dist/packem_shared/verify-23b6IfSg.js +0 -1
- package/dist/packem_shared/watch-B3P2dwoG.js +0 -1
- package/dist/packem_shared/watch-loop-B3_O8hF-.js +0 -11
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as N}from"node:module";import{f as j,m as v,H as S,j as R,v as J}from"./index-2LCHaVNX.js";import{withEnhancedPath as z,collectNodeModulesBinDirs as H}from"@visulima/task-runner";import{s as $}from"./index-BAe6e0XE.js";import{resolveDlx as F,whichBin as V,detectPackageManager as Y,execPmCommandInteractive as G,resolveAdd as K,resolveRemove as Q,resolveDedupe as X,resolveWhy as Z,resolveLink as ee,resolveUnlink as ne,resolvePmCommand as se,resolveInstall as re,resolveExec as ae}from"#native";const T=N(import.meta.url),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,B=e=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[n,s]=b.versions.node.split(".").map(Number);if(n>22||n===22&&s>=3||n===20&&s>=16)return b.getBuiltinModule(e)}return T(e)},{spawn:q,spawnSync:E}=B("node:child_process"),h=(e,n,s,r)=>{for(const a of n)e.push("--filter",a);s&&e.push("--recursive"),r&&e.push("--workspace-root")},oe=e=>{const n=[],s=[];return h(n,e.filter,e.recursive,e.workspaceRoot),e.silent&&n.push("--silent"),e.frozenLockfile&&n.push("--frozen-lockfile"),n.push("install"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.force&&n.push("--force"),e.ignoreScripts&&n.push("--ignore-scripts"),e.lockfileOnly&&n.push("--lockfile-only"),e.noOptional&&n.push("--no-optional"),e.offline&&n.push("--offline"),{args:n,bin:"aube",warnings:s}},ie=e=>{const n=[],s=[];return h(n,e.filter,!1,!1),n.push("add"),e.saveDev&&n.push("--save-dev"),e.exact&&n.push("--save-exact"),e.global&&n.push("--global"),e.optional&&n.push("--save-optional"),e.peer&&n.push("--save-peer"),e.workspace&&s.push("aube has no flag for the `workspace:` protocol; it auto-detects local workspace members during add. Ignoring --workspace."),e.workspaceRoot&&n.push("--workspace"),n.push(...e.packages),{args:n,bin:"aube",warnings:s}},te=e=>{const n=[];return h(n,e.filter,e.recursive,!1),n.push("remove"),e.saveDev&&n.push("--save-dev"),e.global&&n.push("--global"),e.workspaceRoot&&n.push("--workspace"),n.push(...e.packages),{args:n,bin:"aube",warnings:[]}},pe=e=>{const n=["dedupe"];return e&&n.push("--check"),{args:n,bin:"aube",warnings:[]}},ue=e=>{const n=[],s=[];h(n,e.filter,e.recursive,!1),n.push("why"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.json&&n.push("--json"),e.long&&n.push("--long"),e.parseable&&n.push("--parseable"),e.depth!==void 0&&s.push("aube why does not accept --depth; ignoring."),e.noOptional&&s.push("aube why does not accept --no-optional; ignoring."),e.global&&s.push("aube why does not accept --global; ignoring.");const[r,...a]=e.packages;return r===void 0?s.push("aube why requires a package name; none provided."):(a.length>0&&s.push("aube why takes a single package; using the first."),n.push(r)),{args:n,bin:"aube",warnings:s}},ce=e=>{const n=[];e.silent&&n.push("--silent"),n.push("dlx");for(const s of e.additionalPackages)n.push("--package",s);return e.shellMode&&n.push("--shell-mode"),n.push(e.package),n.push(...e.args),{args:n,bin:"aube",warnings:[]}},le=e=>{const n=[];return h(n,e.filter,e.recursive,e.workspaceRoot),n.push("exec"),e.parallel&&n.push("--parallel"),e.reverse&&n.push("--reverse"),e.shellMode&&n.push("--shell-mode"),n.push(e.command),n.push(...e.args),{args:n,bin:"aube",warnings:[]}},ge=e=>{const n=["link"];return e!==null&&n.push(e),{args:n,bin:"aube",warnings:[]}},de=(e,n)=>{const s=[],r=[];return n&&s.push("--recursive"),s.push("unlink"),e.length>1&&r.push("aube unlink takes a single package; using the first."),e.length>0&&s.push(e[0]),{args:s,bin:"aube",warnings:r}},he=e=>{const n=["view","--",e.package],s=[],[r,...a]=e.fields;return r!==void 0?(a.length>0&&s.push("aube view only supports a single field; using the first."),e.json&&s.push("aube view does not support --json with a field selector; printing the field without --json."),n.push(r)):e.json&&n.push("--json"),{args:n,bin:"aube",warnings:s}},Je=e=>{const n=[],s=[];return h(n,e.filters,e.recursive,e.workspaceRoot),n.push("update"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.global&&n.push("--global"),e.interactive&&n.push("--interactive"),e.latest&&n.push("--latest"),e.noOptional&&n.push("--no-optional"),e.noSave&&n.push("--no-save"),n.push(...e.packages),{args:n,bin:"aube",warnings:s}},fe=new Set(["fund","ping","search","token"]),me=(e,n)=>fe.has(e)?{args:[e,...n],bin:"npm",warnings:[`'${e}' is not natively supported by aube. Delegating to npm.`]}:{args:[e,...n],bin:"aube",warnings:[]},k=256*1024,be=e=>{const n=e?{...process.env,...e}:{...process.env};return process.stderr.isTTY&&n.FORCE_COLOR===void 0&&n.NO_COLOR===void 0&&(n.FORCE_COLOR="1"),n},W=e=>e!==""&&!/[\s"&()<>^|%!]/u.test(e)?e:`"${e.replaceAll(/(\\*)"/gu,String.raw`$1$1\"`).replace(/(\\+)$/u,"$1$1").replaceAll(/[&()<>^|%!]/gu,String.raw`^$&`)}"`,ke=async(e,n,s)=>new Promise((r,a)=>{const o=process.platform==="win32",i=q(o?W(e):e,o?n.map(t=>W(t)):[...n],{cwd:s.cwd,env:be(s.env),shell:o,stdio:["inherit","pipe","pipe"],windowsHide:!0});let u=[],l=0;const g=t=>{if(u.push(t),l+=t.length,!(l<=k)){for(;u.length>1&&l-u[0].length>k;)l-=u.shift().length;if(u.length===1&&l>k){const d=u[0];u[0]=d.subarray(d.length-k),l=k}}},m=()=>Buffer.concat(u).toString("utf8");i.stdout?.on("data",t=>{process.stdout.write(t),g(t)}),i.stderr?.on("data",t=>{process.stderr.write(t),g(t)}),i.on("error",a),i.on("close",t=>{const d=m();u=[],r({code:t??1,output:d})})}),w=e=>{const n=$.coerce(e);return n?$.gte(n,"11.0.0"):!1},c=e=>e.name==="yarn"&&!e.version.startsWith("1."),x=e=>e.name==="yarn"&&e.version.startsWith("1."),we=e=>e[0]==="rm"?["remove",...e.slice(1)]:e,ve=(e,n,s)=>{switch(n){case"audit":return c(e)?{args:["npm","audit",...s],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"config":{if(c(e)){const[r,...a]=s;return r==="delete"?{args:["config","unset",...a],bin:"yarn",kind:"rewrite",warning:"yarn berry uses `config unset`, not `config delete`."}:{kind:"passthrough"}}return e.name==="bun"?{kind:"skip",warning:"bun has no `config` CLI. Edit bunfig.toml or .npmrc directly."}:e.name==="deno"?{kind:"skip",warning:"deno has no registry-config CLI. Edit deno.json directly."}:{kind:"passthrough"}}case"dist-tag":return x(e)?{args:["tag",...s],bin:"yarn",kind:"rewrite",warning:"yarn 1 has no `dist-tag`; using `yarn tag`."}:c(e)?{args:["npm","tag",...we(s)],bin:"yarn",kind:"rewrite"}:e.name==="bun"||e.name==="deno"?{kind:"skip",warning:`${e.name} has no \`dist-tag\`. Use \`npm dist-tag\` instead.`}:{kind:"passthrough"};case"login":case"logout":return c(e)?{args:["npm",n,...s],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:[n,...s],bin:"npm",kind:"rewrite",warning:`bun has no \`${n}\`; falling back to \`npm ${n}\` (writes ~/.npmrc, which bun reads).`}:e.name==="deno"?{kind:"skip",warning:`deno has no \`${n}\`. JSR uses browser OAuth via \`deno publish\`.`}:{kind:"passthrough"};case"owner":return e.name==="pnpm"&&w(e.version)?{args:["owner",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `owner`; falling back to `npm owner`."}:c(e)?{args:["owner",...s],bin:"npm",kind:"rewrite",warning:"yarn berry has no `owner` (not in `yarn npm`); falling back to `npm owner`."}:e.name==="bun"?{args:["owner",...s],bin:"npm",kind:"rewrite",warning:"bun has no `owner`; falling back to `npm owner`."}:e.name==="deno"?{kind:"skip",warning:"deno has no `owner`. JSR uses scope-member roles via the web UI."}:{kind:"passthrough"};case"ping":return e.name==="pnpm"&&w(e.version)?{args:["ping",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `ping`; falling back to `npm ping`."}:{kind:"passthrough"};case"plugin":return c(e)?{kind:"passthrough"}:{kind:"skip",warning:`${e.name} does not support yarn-style plugins. Skipping (no-op).`};case"prune":return x(e)?{kind:"skip",warning:"yarn 1 has no `prune`. Use `yarn install --production` for a prod-only tree."}:c(e)?{kind:"skip",warning:"yarn berry has no `prune`. Use `yarn workspaces focus --production` instead."}:e.name==="bun"||e.name==="deno"?{kind:"skip",warning:`${e.name} has no \`prune\`. Pruning happens automatically on install.`}:{kind:"passthrough"};case"publish":return c(e)?{args:["npm","publish",...s],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"rebuild":return x(e)?{kind:"skip",warning:"yarn 1 has no `rebuild`. Re-install instead."}:e.name==="bun"?{kind:"skip",warning:"bun has no `rebuild`. Use `bun install --force` instead."}:e.name==="deno"?{kind:"skip",warning:"deno has no `rebuild`."}:{kind:"passthrough"};case"search":return e.name==="pnpm"&&w(e.version)?{args:["search",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `search`; falling back to `npm search`."}:{kind:"passthrough"};case"token":return e.name==="pnpm"&&w(e.version)?{args:["token",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `token`; falling back to `npm token`."}:{kind:"passthrough"};case"whoami":return e.name==="pnpm"&&w(e.version)?{args:["whoami",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `whoami`; falling back to `npm whoami`."}:c(e)?{args:["npm","whoami",...s],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:["pm","whoami",...s],bin:"bun",kind:"rewrite"}:e.name==="deno"?{kind:"skip",warning:"deno has no `whoami`. JSR uses browser auth."}:{kind:"passthrough"};default:return{kind:"passthrough"}}},O=e=>V(e)!==null,ye=e=>{const n=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"],["bun.lock","bun"],["bun.lockb","bun"],["deno.lock","deno"]];let s=e;for(;;){for(const[a,o]of n)if(j(v(s,a)))return o;const r=S(s);if(r===s||R(s).root===s)return;s=r}},ze=(e,n)=>{if(n.name!=="aube")return;const s=ye(e);if(s!==void 0)return`Resolved installer is aube but the workspace has a ${s} lockfile. Aube reads and writes ${s}'s lockfile format in place, but its byte output may differ subtly — expect a one-time churn diff on the first install, and ongoing drift if your team mixes tools on the same lockfile. To pin the choice across the team, set \`install.backend\` in vis.config; to bypass aube for this run, pass --no-aube.`},C=e=>{if(j(e))try{return JSON.parse(J(e,{buffer:!1}))}catch{return}},$e=e=>{let n=e;for(;;){const s=v(n,"package.json"),r=C(s);if(r&&typeof r.packageManager=="string"&&r.packageManager.length>0)return r.packageManager;const a=S(n);if(a===n||R(n).root===n)return;n=a}},P=new Set(["npm","pnpm","yarn"]),M=(e,n,s)=>s===!1||!P.has(n)||!O("corepack")?!1:s===!0?!0:$e(e)!==void 0,He=(e,n)=>{const s=n.backend,r=process.env.VIS_INSTALLER,a=s??r??n.configBackend,o=n.configCorepack??"auto";if(a&&a!=="auto"){if(a==="aube"&&!O("aube"))throw new Error('install.backend is set to "aube" but the `aube` binary is not on PATH. Install it via `npm i -g @endevco/aube`, `mise use -g aube`, or `brew install endevco/tap/aube`.');return{name:a,useCorepack:M(e,a,o),version:"latest"}}if(O("aube"))return{name:"aube",useCorepack:!1,version:"latest"};const i=je(e);return{...i,useCorepack:M(e,i.name,o)}},je=e=>{if(!j(e))throw new Error(`Could not detect package manager in ${e}. Directory does not exist.`);const n=Y(e);return{name:n.name,version:n.version||"latest"}},L=(e,n)=>n.useCorepack!==!0||!P.has(n.name)||e.bin==="corepack"||e.bin!==n.name?e:{...e,args:[n.name,...e.args],bin:"corepack"},xe=(e,n,s)=>{if(s===void 0)return G(e.bin,e.args,n);const r=E(e.bin,e.args,{cwd:n,env:{...process.env,...s},stdio:"inherit"});if(r.error)throw r.error;return r.status??1},p=(e,n,s,r,a={})=>{const o=L(n,e);for(const i of o.warnings)r.warn(`warning: ${i}`);return a.dry?(r.log(`[dry-run] ${o.bin} ${o.args.join(" ")}`),0):xe(o,s,a.env)},f=(e,n,s,r,a={})=>p(e,n(),s,r,a),Oe=(e,n)=>n==="aube"||n==="deno"?e:{...e,args:[...e.args,"--prefer-offline"]},Se=(e,n,s)=>n!=="yarn"||s.startsWith("1.")||!e.args.includes("--immutable")||e.args.includes("--immutable-cache")?e:{...e,args:[...e.args,"--immutable-cache"]},I=(e,n,s)=>{let r=e.name==="aube"?oe(n):re(e.name,e.version,{...n,silent:n.silent||s.silent===!0});return s.preferOffline&&(r=Oe(r,e.name)),s.ciMode&&(r=Se(r,e.name,e.version)),r},Fe=(e,n,s,r,a={})=>{const o=I(e,n,a);return D(e,o,s,r,{dry:a.dry,env:a.env})},Ve=async(e,n,s,r,a={})=>{const o=L(I(e,n,a),e);for(const i of o.warnings)r.warn(`warning: ${i}`);return a.dry?(r.log(`[dry-run] ${o.bin} ${o.args.join(" ")}`),{code:0,output:""}):ke(o.bin,o.args,{cwd:s,env:a.env?{...process.env,...a.env}:process.env})},A=(e,n)=>{const s=n==="deno"?"--quiet":"--silent";return{...e,args:[...e.args,s]}},Re=(e,n)=>n==="yarn"||n==="aube"?null:{...e,args:[...e.args,"--dry-run"]},D=(e,n,s,r,a)=>{if(a.dry!==!0)return p(e,n,s,r,a);const o=Re(n,e.name);return o===null?p(e,n,s,r,a):p(e,o,s,r,{env:a.env})},Ce=(e,n)=>n==="aube"?{...e,args:[...e.args,"--ignore-scripts"]}:n==="deno"?e:{...e,args:[...e.args,"--ignore-scripts"]},De=(e,n,s,r,a={})=>{let o=e.name==="aube"?ie(n):K(e.name,e.version,n);a.ignoreScripts&&(o=Ce(o,e.name)),a.silent&&(o=A(o,e.name));const i=D(e,o,s,r,{dry:a.dry,env:a.env});return i===0&&a.autoInstallPeers&&Ee(e,n,s,r,a),i},_e=e=>{if(e.startsWith("@")){const s=e.indexOf("/");if(s===-1)return e;const r=e.indexOf("@",s);return r===-1?e:e.slice(0,r)}const n=e.indexOf("@");return n===-1?e:e.slice(0,n)},We=(e,n)=>{let s=e;for(;;){const r=v(s,"node_modules",n,"package.json"),a=C(r);if(a)return a;const o=S(s);if(o===s||R(s).root===s)return;s=o}},Me=e=>{const n=C(v(e,"package.json")),s=new Set;if(!n)return s;for(const r of["dependencies","devDependencies","peerDependencies","optionalDependencies"]){const a=n[r];if(a)for(const o of Object.keys(a))s.add(o)}return s},Ee=(e,n,s,r,a)=>{if(e.name==="deno")return;const o=Me(s),i=new Map;for(const g of n.packages){const m=_e(g),t=We(s,m);if(!t?.peerDependencies)continue;const d=t.peerDependenciesMeta??{};for(const[y,U]of Object.entries(t.peerDependencies))d[y]?.optional||o.has(y)||i.has(y)||i.set(y,U)}if(i.size===0)return;const u=[...i.entries()].map(([g,m])=>`${g}@${m}`);r.log(`auto-installing peer dependencies: ${u.join(", ")}`);const l={exact:!1,filter:n.filter,global:!1,optional:!1,packages:u,peer:!1,saveDev:n.saveDev,workspace:!1,workspaceRoot:n.workspaceRoot};De(e,l,s,r,{ignoreScripts:a.ignoreScripts})},Ye=(e,n,s,r,a={})=>{let o=e.name==="aube"?te(n):Q(e.name,e.version,n);return a.silent&&(o=A(o,e.name)),D(e,o,s,r,{dry:a.dry,env:a.env})},Ge=(e,n,s,r,a={})=>e.name==="aube"?p(e,pe(n),s,r,a):f(e,()=>X(e.name,e.version,n),s,r,a),Ke=(e,n,s,r,a={})=>e.name==="aube"?p(e,ue(n),s,r,a):f(e,()=>Z(e.name,e.version,n),s,r,a),Pe=(e,n)=>{if(e.name==="aube")return he(n);const s=[],r=[],a=e.name;switch(e.name){case"bun":{const o=$.coerce(e.version);o&&$.lt(o,"1.3.0")&&r.push(`bun ${e.version} does not support \`bun pm view\` (added in bun 1.3). Upgrade bun, or run \`npm view ${n.package}\` instead.`),s.push("pm","view","--",n.package,...n.fields),n.json&&s.push("--json");break}case"deno":{const o=n.package.startsWith("npm:")||n.package.startsWith("jsr:")||n.package.startsWith("https://")||n.package.startsWith("http://")||n.package.startsWith("file:")?n.package:`npm:${n.package}`;s.push("info","--",o),n.json&&s.push("--json"),n.fields.length>0&&r.push("deno info does not accept field selectors; ignoring.");break}case"npm":case"pnpm":{s.push("view","--",n.package,...n.fields),n.json&&s.push("--json");break}case"yarn":{if(e.version.startsWith("1.")){s.push("info","--",n.package);const[o,...i]=n.fields;o!==void 0&&(i.length>0&&r.push("yarn v1 only supports querying one field at a time; using the first."),s.push(o)),n.json&&s.push("--json")}else s.push("npm","info","--",n.package),n.fields.length>0&&r.push("yarn berry does not support field arguments to 'npm info'; ignoring."),n.json&&s.push("--json");break}default:{const o=e.name;throw new Error(`Unsupported package manager: ${o}`)}}return{args:s,bin:a,warnings:r}},Qe=(e,n,s,r,a={})=>p(e,Pe(e,n),s,r,a),Xe=(e,n,s,r,a={})=>e.name==="aube"?p(e,ge(n),s,r,a):f(e,()=>ee(e.name,e.version,n),s,r,a),Ze=(e,n,s,r,a,o={})=>e.name==="aube"?p(e,de(n,s),r,a,o):f(e,()=>ne(e.name,e.version,n,s),r,a,o),Le=(e,n,s)=>{if(e.args.includes("--offline")||e.args.includes("--cached-only"))return e;const r=(a,o)=>{const i=[...e.args];return i.splice(o,0,a),{...e,args:i}};switch(n){case"aube":case"pnpm":return r("--offline",1);case"bun":return{...e,warnings:[...e.warnings,"bun x does not support --offline. Pre-install the package via `vis install` so bun x resolves from the local cache."]};case"deno":return r("--cached-only",1);case"npm":return r("--offline",1);case"yarn":return s.startsWith("1.")?r("--offline",0):{...e,warnings:[...e.warnings,"yarn berry has no --offline flag for dlx. Configure `enableNetwork: false` in .yarnrc.yml or set `enableMirror: true` for offline-first behavior."]};default:{const a=n;return{...e,warnings:[...e.warnings,`applyDlxOffline: unsupported pm ${String(a)}`]}}}},en=(e,n,s,r,a={})=>{let o=e.name==="aube"?ce(n):F(e.name,e.version,n);return a.offline&&(o=Le(o,e.name,e.version)),p(e,o,s,r,{dry:a.dry,env:a.env})},_=process.platform==="win32",Ie=_?[".exe",".cmd",".bat",".ps1",""]:[""],Ae=(e,n)=>{if(!(e.includes("/")||e.includes("\\")))for(const s of H(n))for(const r of Ie){const a=v(s,`${e}${r}`);if(j(a))return _?a.replaceAll("/","\\"):a}},nn=(e,n,s)=>{const r=Ae(e,s);if(r===void 0||_&&!r.toLowerCase().endsWith(".exe"))return null;const a=E(r,n,{cwd:s,env:z({...process.env},s),stdio:"inherit"});if(a.error)throw a.error;return a.status??1},sn=(e,n,s,r,a={})=>e.name==="aube"?p(e,le(n),s,r,a):f(e,()=>ae(e.name,e.version,n),s,r,a),rn=(e,n,s,r,a,o={})=>{if(e.name==="aube")return p(e,me(n,s),r,a,o);const i=ve(e,n,s);return i.kind==="skip"?(a.warn(`warning: ${i.warning}`),0):i.kind==="rewrite"?p(e,{args:i.args,bin:i.bin,warnings:i.warning?[i.warning]:[]},r,a,o):f(e,()=>se(e.name,e.version,n,s),r,a,o)};export{Ze as $,je as A,Ve as C,Ye as E,ze as I,nn as L,Ge as M,sn as N,Ke as P,Xe as S,rn as U,en as W,Qe as a,He as h,De as j,ke as s,Je as v,Fe as y};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as n}from"node:module";const i=n(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,a=t=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[e,s]=o.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return o.getBuiltinModule(t)}return i(t)},{createInterface:c}=a("node:readline"),u=async t=>{const e=c({input:process.stdin,output:process.stdout});try{return await new Promise(s=>{e.question(t,r=>{s(r.trim().toLowerCase())})})}finally{e.close()}},l=async(t,e=u)=>{const s=(await e(t)).trim().toLowerCase();return s==="y"||s==="yes"};export{u as d,l as p};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as g}from"node:module";import{f as l,m,a as v}from"./index-2LCHaVNX.js";import{g as b}from"./en-C26W78--.js";import{a as j}from"./readJsonSync-DuMMeB3s-B9cGBVbJ.js";const h=g(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=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 h(e)},{rmSync:u,writeFileSync:k}=_("node:fs"),C=1440*60*1e3,R=15e3,w="https://registry.npmjs.org/-/npm/v1/keys",p=()=>m(b(),"registry-keys"),i=()=>m(p(),"npmjs.json"),A=()=>{const e=i();if(l(e))try{const t=j(e),r=Date.now()-t.createdAt>t.ttlMs;return{entry:t,expired:r}}catch{u(e,{force:!0});return}},M=(e,t)=>{v(p());const r={createdAt:Date.now(),keys:e,ttlMs:t};k(i(),JSON.stringify(r),"utf8")},q=async(e={})=>{const t=e.ttlMs??C,r=e.keysUrl??process.env.VIS_NPM_KEYS_URL??w,s=A();if(s!==void 0&&!s.expired&&e.forceRefresh!==!0)return{fromCache:!0,keys:s.entry.keys};const n=new AbortController,d=setTimeout(()=>{n.abort()},R),a=()=>{n.abort()};e.signal?.addEventListener("abort",a,{once:!0});try{const c=await fetch(r,{headers:{Accept:"application/json"},signal:n.signal});if(!c.ok)return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0;const y=await c.json(),f=Array.isArray(y.keys)?y.keys:[];return M(f,t),{fromCache:!1,keys:f}}catch{return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0}finally{clearTimeout(d),e.signal?.removeEventListener("abort",a)}},x=()=>{const e=i();return l(e)?(u(e,{force:!0}),!0):!1};export{x as c,q as f};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as S}from"node:module";import{m as i,H as l}from"./index-2LCHaVNX.js";import{p as h}from"./augment-BVuj3ee7.js";const b=S(import.meta.url),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,d=s=>{if(typeof a<"u"&&a.versions&&a.versions.node){const[e,r]=a.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return a.getBuiltinModule(s)}return b(s)},{spawnSync:u}=d("node:child_process"),{existsSync:p}=d("node:fs"),y=s=>{let e=s;for(;;){const r=i(e,".pnp.cjs");if(p(r)){const t=i(e,".pnp.loader.mjs");return{esmLoader:p(t)?t:void 0,pnpCjs:r}}const o=l(e);if(o===e)return;e=o}},w=s=>{const e=y(s);if(e===void 0)return[];const r=["--require",e.pnpCjs];return e.esmLoader!==void 0&&r.push("--import",e.esmLoader),r},x=[{flag:"--enable-source-maps",key:"sourcemaps",min:[22,0]},{flag:"--experimental-sqlite",key:"sqlite",min:[22,5]},{flag:"--experimental-webstorage",key:"webstorage",min:[22,4]},{flag:"--experimental-eventsource",key:"eventsource",min:[22,3]},{flag:"--experimental-websocket",key:"websocket",max:[21,999],min:[20,10]},{flag:"--experimental-vm-modules",key:"vm-modules",min:[22,0]}],E=[22,4],I=s=>{const[e,r]=s.split(".").map(o=>Number.parseInt(o,10));return[e??0,r??0]},f=(s,e)=>s[0]>e[0]||s[0]===e[0]&&s[1]>=e[1],P=(s,e)=>s[0]<e[0]||s[0]===e[0]&&s[1]<=e[1],j=(s,e)=>f(s,e.min)&&(e.max===void 0||P(s,e.max)),T=s=>{const e=s.trim().toLowerCase();return e===""||e==="all"||e==="1"||e==="true"},m=(s,e)=>T(s)||s.split(",").some(r=>r.trim().toLowerCase()===e),g=(s,e,r)=>{const o=I(e),t=[];for(const n of x)m(s,n.key)&&j(o,n)&&t.push(n.flag);return m(s,"localstorage")&&f(o,E)&&(t.includes("--experimental-webstorage")||t.push("--experimental-webstorage"),t.push(`--localstorage-file=${r}`)),t},v="VIS_X_REEXEC",L=(s,e,r)=>{const o={...process.env},t=i(l(process.argv[1]),"runtime","preload.js");if(o.NODE_OPTIONS){const c=o.NODE_OPTIONS.replace(`--import ${JSON.stringify(t)}`,"").replace(`--import ${t}`,"").replaceAll(/\s+/gu," ").trim();c===""?delete o.NODE_OPTIONS:o.NODE_OPTIONS=c}delete o.VIS_AUGMENT_SUBPROCESS,delete o.VIS_UNFLAG,delete o.VIS_POLYFILL;const n=u(process.execPath,[s,...e],{cwd:r,env:o,stdio:"inherit"});if(n.error)throw n.error;return n.status??(n.signal===null?0:1)},_=s=>{let e=s;for(;;){if(p(i(e,"package.json"))||p(i(e,".pnp.cjs")))return i(e,".vis","localstorage");const r=l(e);if(r===e)return i(s,".vis","localstorage");e=r}},k=s=>{const e=process.env.VIS_UNFLAG;return[...e===void 0?[]:g(e,process.versions.node,_(s)),...w(s)]},A=(s,e,r)=>{const o=u("bun",["run",s,...e],{cwd:r,stdio:"inherit"});if(o.error)throw o.error.code==="ENOENT"?new Error("Runtime is set to bun but the `bun` binary is not on PATH. Install it from https://bun.sh."):o.error;return o.status??(o.signal===null?0:1)},C=(s,e,r,o)=>{const t=u(process.execPath,[...s,process.argv[1],"x",e,...r],{cwd:o,env:{...process.env,[v]:"1"},stdio:"inherit"});return t.status??(t.signal===null?0:1)},R=async(s,e,r)=>{if(process.env[v]===void 0){const n=k(r);if(n.length>0)return C(n,s,e,r)}if(process.env.VIS_AUGMENT_SUBPROCESS!==void 0){const n=i(l(process.argv[1]),"runtime","preload.js"),c=process.env.VIS_UNFLAG,O=c===void 0?[]:g(c,process.versions.node,_(r)),N=[process.env.NODE_OPTIONS??"",...O,`--import ${JSON.stringify(n)}`].filter(Boolean);process.env.NODE_OPTIONS=N.join(" ").trim()}const{importTs:o}=await import("../packem_chunks/ts-loader.js").then(n=>n.t);await h(r);const t=process.argv;process.argv=[process.execPath,s,...e];try{await o(s)}finally{process.argv=t}return typeof process.exitCode=="number"?process.exitCode:0},D=async(s,e,r,o,t={})=>t.node?L(s,e,o):r==="bun"?A(s,e,o):R(s,e,o);export{D as r};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as K}from"node:module";import{V,s as A}from"./index.server-qvZ-cy29.js";import{f as _,a as j,m as $}from"./index-2LCHaVNX.js";import{g as x}from"./en-C26W78--.js";import{m as p,D as g}from"./provenance-CRBV9cko.js";import{g as b}from"./packument-CtVAoNo7.js";import{i as w}from"../packem_chunks/cli-main.js";import{a as O}from"./readJsonSync-DuMMeB3s-B9cGBVbJ.js";import{s as v}from"./index-BAe6e0XE.js";const X=K(import.meta.url),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,T=r=>{if(typeof M<"u"&&M.versions&&M.versions.node){const[e,t]=M.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return M.getBuiltinModule(r)}return X(r)},{rmSync:k,writeFileSync:E}=T("node:fs"),{createHash:Y}=T("node:crypto"),{Resolver:Q}=T("node:dns/promises");class Ye{entries=[];add(e){this.entries.push(e)}addMany(e){for(const t of e)this.entries.push(t)}all(){return this.entries}errors(){return this.entries.filter(e=>e.severity==="error")}warnings(){return this.entries.filter(e=>e.severity==="warning")}hasErrors(){return this.entries.some(e=>e.severity==="error")}hasWarnings(){return this.entries.some(e=>e.severity==="warning")}isEmpty(){return this.entries.length===0}size(){return this.entries.length}}const Qe=r=>{if(r.length===0)return[];const e=[],t=r.filter(s=>s.severity==="error"),n=r.filter(s=>s.severity==="warning");if(t.length>0){e.push(V(`${String(t.length)} error${t.length===1?"":"s"}:`));for(const s of t)e.push(` ${V("✗")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${A("→")} ${s.suggestedAction}`)}if(n.length>0){t.length>0&&e.push(""),e.push(A(`${String(n.length)} warning${n.length===1?"":"s"}:`));for(const s of n)e.push(` ${A("⚠")} [${s.marshall}] ${s.packageName}: ${s.message}`),s.suggestedAction!==void 0&&e.push(` ${A("→")} ${s.suggestedAction}`)}return e},Ze=r=>({errors:r.filter(e=>e.severity==="error"),findings:[...r],summary:{errorCount:r.filter(e=>e.severity==="error").length,warningCount:r.filter(e=>e.severity==="warning").length},warnings:r.filter(e=>e.severity==="warning")}),Z=1440*60*1e3,ee=15e3,re="https://api.github.com/repos",B=()=>$(x(),"archived-repo"),H=(r,e)=>$(B(),`${encodeURIComponent(r)}__${encodeURIComponent(e)}.json`),te=(r,e)=>{const t=H(r,e);if(_(t))try{const n=O(t);if(Date.now()-n.createdAt>n.ttlMs){k(t,{force:!0});return}return n}catch{k(t,{force:!0});return}},W=(r,e,t,n)=>{j(B());const s={createdAt:Date.now(),ttlMs:n,...t};E(H(r,e),JSON.stringify(s),"utf8")},ne=r=>{if(typeof r!="string"||r.trim()==="")return;const e=r.trim().replace(/^git\+/,""),t=/^git@github\.com:([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(t)return{owner:t[1],repo:t[2]};const n=/^ssh:\/\/git@github\.com\/([^/]+)\/(.+?)(?:\.git)?\/?$/i.exec(e);if(n)return{owner:n[1],repo:n[2]};const s=/^https?:\/\/(?:www\.)?github\.com\/([^/]+)\/([^/?#]+?)(?:\.git)?\/?$/i.exec(e);if(s)return{owner:s[1],repo:s[2]}},se=async(r,e,t,n)=>{const s=`${re}/${encodeURIComponent(r)}/${encodeURIComponent(e)}`,c=new AbortController,o=setTimeout(()=>{c.abort()},ee),i=()=>{c.abort()};n?.addEventListener("abort",i,{once:!0});const a={Accept:"application/vnd.github+json","User-Agent":"visulima-vis-marshall"};t!==void 0&&t!==""&&(a.Authorization=`Bearer ${t}`);try{const d=await fetch(s,{headers:a,signal:c.signal});if(d.status===404)return{kind:"missing"};if(!d.ok)return{kind:"transient-error"};const l=await d.json(),u=l.archived===!0,f=typeof l.archived_at=="string"?l.archived_at:void 0;return{archived:u,archivedAt:f,kind:"ok"}}catch{return{kind:"transient-error"}}finally{clearTimeout(o),n?.removeEventListener("abort",i)}},ie=(r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),er=async(r,e={})=>{if(w("archivedRepo"))return[];const t=new Set(e.allowlist),n=e.cacheTtlMs??Z,s=e.githubToken??process.env.GITHUB_TOKEN,c=e.concurrency??g,o=new Map,i=async(a,d)=>{const l=`${a}/${d}`;let u=o.get(l);return u===void 0&&(u=(async()=>{const f=te(a,d);if(f!==void 0)return f.missing===!0?{archived:!1,kind:"missing"}:{archived:f.archived,archivedAt:f.archivedAt,kind:"ok"};const m=await se(a,d,s,e.signal);return m.kind==="missing"?W(a,d,{archived:!1,missing:!0},n):m.kind==="ok"&&W(a,d,{archived:m.archived===!0,archivedAt:m.archivedAt},n),m})(),o.set(l,u)),u};return(await p(r,c,async({name:a,version:d})=>{if(t.has(a))return;const l=await b(a,{workspaceRoot:e.workspaceRoot});if(l===void 0)return;const u=l.versions[d]??l.versions[ie(Object.keys(l.versions),l["dist-tags"]?.latest)??""];if(u===void 0)return;const f=ne(u.repository?.url);if(f===void 0)return;const m=await i(f.owner,f.repo);if(m.kind!=="transient-error"){if(m.kind==="missing")return{kind:"missing-repo",owner:f.owner,packageName:a,repo:f.repo};if(m.archived===!0)return{...m.archivedAt===void 0?{}:{archivedAt:m.archivedAt},kind:"archived",owner:f.owner,packageName:a,repo:f.repo}}})).filter(a=>a!==void 0)},oe={dormantErrorDays:274,dormantWarnDays:183,newPublisherWindowDays:21,recentVersionErrorDays:7,recentVersionWarnDays:30},ae=1440*60*1e3,U=(r,e)=>(r-e)/ae,R=r=>{if(r!==void 0)return r.email??r.name},ce=(r,e,t,n,s)=>{const c=r.time?.[t];if(c===void 0)return;const o=new Date(c).getTime();if(!Number.isFinite(o))return;const i=U(n,o);if(i<s.recentVersionErrorDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (error threshold: ${String(s.recentVersionErrorDays)})`,packageName:e,severity:"error",version:t};if(i<s.recentVersionWarnDays)return{kind:"recent-version",message:`published ${i.toFixed(1)} days ago (warn threshold: ${String(s.recentVersionWarnDays)})`,packageName:e,severity:"warning",version:t}},de=(r,e,t,n,s)=>{const c=r.versions[t],o=R(c?._npmUser);if(o===void 0)return;const i=Object.keys(r.versions).filter(u=>v.valid(u)!==null).filter(u=>v.lt(u,t));if(i.length===0||i.some(u=>R(r.versions[u]?._npmUser)===o))return;const a=r.time?.[i[0]??""];if(a===void 0)return;const d=new Date(a).getTime();if(!Number.isFinite(d))return;const l=U(n,d);if(!(l<=s.newPublisherWindowDays))return{kind:"new-publisher",message:`first publish by ${o} on a ${l.toFixed(0)}-day-old package`,packageName:e,severity:"error",version:t}},le=(r,e,t,n,s)=>{const c=r.versions[t],o=R(c?._npmUser);if(o===void 0)return;const i=[];for(const[l,u]of Object.entries(r.versions)){if(l===t||R(u._npmUser)!==o)continue;const f=r.time?.[l];if(f===void 0)continue;const m=new Date(f).getTime();Number.isFinite(m)&&i.push(m)}if(i.length===0)return;const a=Math.max(...i),d=U(n,a);if(d>=s.dormantErrorDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${d.toFixed(0)} days ago (error threshold: ${String(s.dormantErrorDays)})`,packageName:e,severity:"error",version:t};if(d>=s.dormantWarnDays)return{kind:"dormant-maintainer",message:`previous release by ${o} was ${d.toFixed(0)} days ago (warn threshold: ${String(s.dormantWarnDays)})`,packageName:e,severity:"warning",version:t}},rr=async(r,e={})=>{if(w("author"))return[];const t=new Set(e.allowlist),n={...oe,...e.thresholds},s=e.now??(()=>Date.now()),c=e.concurrency??g;return(await p(r,c,async({name:o,version:i})=>{if(t.has(o))return[];const a=await b(o,{cacheTtlMs:e.cacheTtlMs,signal:e.signal,workspaceRoot:e.workspaceRoot});if(a===void 0)return[];const d=s(),l=[],u=ce(a,o,i,d,n);u!==void 0&&l.push(u);const f=de(a,o,i,d,n);f!==void 0&&l.push(f);const m=le(a,o,i,d,n);return m!==void 0&&l.push(m),l})).flat()},ue=1440*60*1e3,fe=15e3,me=20,he=1e4,ve="https://api.npmjs.org/downloads/point/last-month",J=()=>$(x(),"downloads"),q=r=>$(J(),`${encodeURIComponent(r)}.json`),pe=r=>{const e=q(r);if(_(e))try{const t=O(e);if(Date.now()-t.createdAt>t.ttlMs){k(e,{force:!0});return}return t.downloads}catch{k(e,{force:!0});return}},ge=(r,e,t)=>{j(J());const n={createdAt:Date.now(),downloads:e,observedAt:new Date().toISOString(),ttlMs:t};E(q(r),JSON.stringify(n),"utf8")},we=async(r,e)=>{const t=`${ve}/${encodeURIComponent(r)}`,n=new AbortController,s=setTimeout(()=>{n.abort()},fe),c=()=>{n.abort()};e?.addEventListener("abort",c,{once:!0});try{const o=await fetch(t,{signal:n.signal});if(o.status===404)return{kind:"no-data"};if(!o.ok)return{kind:"error"};const i=await o.json();return typeof i.downloads=="number"?{downloads:i.downloads,kind:"ok"}:{kind:"no-data"}}catch{return{kind:"error"}}finally{clearTimeout(s),e?.removeEventListener("abort",c)}},tr=async(r,e={})=>{if(w("downloads"))return[];const t=new Set(e.allowlist),n=e.errorThreshold??me,s=e.warnThreshold??he,c=e.cacheTtlMs??ue,o=e.concurrency??g;return(await p(r,o,async i=>{if(t.has(i))return;let a=pe(i);if(a===void 0){const d=await we(i,e.signal);if(d.kind==="no-data"||d.kind==="error")return{downloadsLastMonth:void 0,kind:"no-data",packageName:i,severity:"warning"};a=d.downloads??0,ge(i,a,c)}if(a<n)return{downloadsLastMonth:a,kind:"below-error",packageName:i,severity:"error"};if(a<s)return{downloadsLastMonth:a,kind:"below-warning",packageName:i,severity:"warning"}})).filter(i=>i!==void 0)},ye=1440*60*1e3,ke=4e3,$e=["1.1.1.1","8.8.8.8"],z=()=>$(x(),"expired-domains"),G=r=>{const e=Y("sha256").update(r).digest("hex").slice(0,12);return $(z(),`${e}.json`)},be=r=>{const e=G(r);if(_(e))try{const t=O(e);if(Date.now()-t.createdAt>t.ttlMs){k(e,{force:!0});return}return t}catch{k(e,{force:!0});return}},Me=(r,e,t)=>{j(z());const n={createdAt:Date.now(),outcome:e,ttlMs:t};E(G(r),JSON.stringify(n),"utf8")},De=r=>{if(typeof r!="string")return;const e=r.lastIndexOf("@");if(e===-1||e===r.length-1)return;const t=r.slice(e+1).trim().toLowerCase();return t===""?void 0:t},Ae=(r,e)=>{const t=[];e!==void 0&&t.push(e);for(const n of r??[])t.push(n);return t},Re=async(r,e)=>{let t;try{return await Promise.race([r,new Promise((n,s)=>{t=setTimeout(()=>{s(new Error("ETIMEDOUT"))},e)})])}finally{t!==void 0&&clearTimeout(t)}},Ne=r=>{if(r===null||typeof r!="object")return!1;const{code:e}=r;return e==="ENOTFOUND"||e==="ENODATA"||e==="NXDOMAIN"},Se=async(r,e,t)=>{try{const n=await Re(r.resolveNs(e),t);return Array.isArray(n)&&n.length>0?{kind:"ok"}:{kind:"expired"}}catch(n){return Ne(n)?{kind:"expired"}:{kind:"transient-error"}}},Te=(r,e)=>e!==void 0&&r.includes(e)?e:r.at(-1),nr=async(r,e={})=>{if(w("expiredDomains"))return[];const t=new Set(e.allowlist),n=new Set((e.allowDomains??[]).map(u=>u.toLowerCase())),s=e.cacheTtlMs??ye,c=e.perDomainTimeoutMs??ke,o=e.dnsServers??$e,i=e.concurrency??g,a=e.createResolver===void 0?new Q:e.createResolver();typeof a.setServers=="function"&&a.setServers(o);const d=new Map,l=async u=>{let f=d.get(u);return f===void 0&&(f=(async()=>{const m=be(u);if(m!==void 0)return{kind:m.outcome==="ok"?"ok":"expired"};const h=await Se(a,u,c);return h.kind!=="transient-error"&&Me(u,h.kind,s),h})(),d.set(u,f)),f};return(await p(r,i,async({name:u,version:f})=>{if(t.has(u))return[];const m=await b(u,{workspaceRoot:e.workspaceRoot});if(m===void 0)return[];const h=m.versions[f]??m.versions[Te(Object.keys(m.versions),m["dist-tags"]?.latest)??""];if(h===void 0)return[];const N=Ae(h.maintainers,h._npmUser),C=new Set,S=[];for(const D of N){const y=De(D.email);if(y===void 0||n.has(y))continue;const F=`${y}:${D.email??""}`;if(C.has(F))continue;C.add(F);const L=await l(y);L.kind==="expired"?S.push({domain:y,kind:"expired",maintainer:D.email??"",packageName:u,severity:"error"}):L.kind==="transient-error"&&S.push({domain:y,kind:"unresolved",maintainer:D.email??"",packageName:u,severity:"warning"})}return S})).flat()},Ee=["readme","license","repo"],_e=["ERROR: No README data found!","# Security holding package"],je=r=>{const e=r.trim();return e===""?!0:_e.some(t=>e.startsWith(t))},xe=(r,e)=>{if(typeof e.readme=="string")return e.readme;if(typeof r.readme=="string")return r.readme},Oe=(r,e)=>{const t=xe(r,e);if(t===void 0)return"missing-readme";if(je(t))return"placeholder-readme"},Ue=r=>{const{license:e}=r;return e===void 0?"missing-license":typeof e=="string"?e.trim()===""?"missing-license":void 0:typeof e.type=="string"&&e.type.trim()!==""?void 0:"missing-license"},Ce=r=>{const{repository:e}=r;if(e===void 0)return"missing-repo";const t=typeof e.url=="string"?e.url.trim():"";if(t==="")return"missing-repo";let n=t.replace(/^git\+/,"");const s=/^git@([^:]+):(.+?)(?:\.git)?$/.exec(n);return s&&(n=`https://${s[1]}/${s[2]}`),URL.canParse(n)?void 0:"invalid-repo-url"},Fe=r=>{const e=r["dist-tags"]?.latest;return e!==void 0&&Object.hasOwn(r.versions,e)?e:Object.keys(r.versions).at(-1)},sr=async(r,e={})=>{if(w("metadata"))return[];const t=new Set(e.allowlist),n=new Set(e.checks??Ee),s=e.concurrency??g;return(await p(r,s,async({name:c,version:o})=>{if(t.has(c))return;const i=await b(c,{workspaceRoot:e.workspaceRoot});if(i===void 0)return;const a=i.versions[o]??i.versions[Fe(i)??""];if(a===void 0||a.private===!0)return;const d=[];if(n.has("readme")){const l=Oe(i,a);l!==void 0&&d.push(l)}if(n.has("license")){const l=Ue(a);l!==void 0&&d.push(l)}if(n.has("repo")){const l=Ce(a);l!==void 0&&d.push(l)}if(d.length!==0)return{issues:d,packageName:c,version:o}})).filter(c=>c!==void 0)},I=(r,e)=>r===void 0?{}:typeof r=="string"?{[e.startsWith("@")?e.split("/").at(1)??e:e]:r}:{...r},Le=(r,e)=>v.valid(e)?Object.keys(r.versions).filter(t=>v.valid(t)!==null&&v.lt(t,e)).sort((t,n)=>v.lt(t,n)?1:-1)[0]:void 0,ir=async(r,e={})=>{if(w("newBin"))return[];const t=new Set(e.allowlist),n=new Set(e.allowBins),s=e.concurrency??g;return(await p(r,s,async({name:c,version:o})=>{if(t.has(c))return;const i=await b(c,{workspaceRoot:e.workspaceRoot});if(i===void 0)return;const a=i.versions[o];if(a===void 0)return;const d=Le(i,o);if(d===void 0)return;const l=i.versions[d];if(l===void 0)return;const u=I(a.bin,c),f=I(l.bin,c),m=Object.entries(u).filter(([h])=>!(h in f)).filter(([h])=>!n.has(h)).map(([h,N])=>({command:N,name:h}));if(m.length!==0)return{fromVersion:d,newBins:m,packageName:c,toVersion:o}})).filter(c=>c!==void 0)},Ve=["preinstall","install","postinstall"],P=(r,e)=>r.versions[e]?.dist?.attestations?.provenance!==void 0,We=(r,e)=>{if(v.valid(e)!==null)return Object.keys(r.versions).filter(t=>v.valid(t)!==null&&v.prerelease(t)===null&&v.lt(t,e)).sort((t,n)=>v.lt(t,n)?1:-1)[0]},Ie=(r,e)=>{const t=r??{},n=e??{},s=[];for(const c of Ve){const o=t[c];if(o===void 0||o==="")continue;const i=n[c];i===void 0||i===""?s.push({command:o,hook:c,kind:"introduced"}):i!==o&&s.push({command:o,hook:c,kind:"changed"})}return s},or=async(r,e={})=>{if(w("s1ngularity"))return[];const t=new Set(e.allowlist),n=e.concurrency??g;return(await p(r,n,async({name:s,version:c})=>{if(t.has(s))return;const o=await b(s,{workspaceRoot:e.workspaceRoot});if(o?.versions[c]===void 0)return;const i=We(o,c);if(i===void 0||!P(o,i)||P(o,c))return;const a=Ie(o.versions[c]?.scripts,o.versions[i]?.scripts);if(a.length!==0)return{hookChanges:a,packageName:s,priorVersion:i,trustSignal:"provenance-dropped",version:c}})).filter(s=>s!==void 0)};export{Ye as M,or as a,ir as b,sr as c,tr as d,nr as e,er as f,Ze as g,Qe as h,rr as r};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{E as x,s as $,I as k,V as y}from"./index.server-qvZ-cy29.js";import{l as e,m as c,g as i,$ as S,d as g}from"../packem_chunks/catalog.js";import"./en-C26W78--.js";import{I as C}from"./index-B0EsgdzO.js";import{S as m}from"../packem_chunks/cli-main.js";import{Spinner as T}from"@visulima/tui-kit/spinner";import{D as j,W as I,T as E,C as R}from"./symbols-DPTlrJ3B.js";const w=({rows:a})=>e.jsx(c,{flexDirection:"column",children:a.map(t=>{let r;switch(t.status){case"error":{r=e.jsx(i,{color:"red",children:R});break}case"ok":{r=e.jsx(i,{color:"green",children:E});break}case"running":{r=e.jsx(i,{color:"white",children:e.jsx(T,{type:"dots"})});break}case"warn":{r=e.jsx(i,{color:"yellow",children:I});break}default:{r=e.jsx(i,{dimColor:!0,children:j});break}}return e.jsxs(c,{children:[e.jsx(c,{width:3,children:r}),e.jsx(c,{flexGrow:1,children:e.jsx(i,{children:t.label})}),t.summary?e.jsx(c,{children:e.jsxs(i,{dimColor:!0,children:[j," ",t.summary]})}):null]},t.id)})}),v={error:y(m.failure),ok:k(m.success),pending:x(m.dash),skip:x(m.dash),warn:$(m.warning)},D=(a,t,r)=>{const h=r?`${a} ${x(`— ${r}`)}`:a;return` ${v[t]} ${h}
|
|
2
|
-
`},W=(a,t={})=>{const r=t.stream??process.stderr,h=typeof r.isTTY=="boolean"&&r.isTTY&&!C,b=t.live??h,o=new Map;for(const s of a)o.set(s.id,{id:s.id,label:s.label,status:"pending"});if(!b||a.length===0)return{finish:(s,n,u)=>{const l=o.get(s);l&&(o.set(s,{...l,status:n,summary:u}),r.write(D(l.label,n,u)))},start:s=>{const n=o.get(s);n&&o.set(s,{...n,status:"running"})},stop:()=>{}};const f=()=>a.map(s=>o.get(s.id));let d=S(g.createElement(w,{rows:f()}),{interactive:!0,patchConsole:!1});const p=()=>{d?.rerender(g.createElement(w,{rows:f()}))};return{finish:(s,n,u)=>{const l=o.get(s);l&&(o.set(s,{...l,status:n,summary:u}),p())},start:s=>{const n=o.get(s);n&&(o.set(s,{...n,status:"running"}),p())},stop:()=>{d&&(p(),d.unmount(),d=void 0)}}};export{W as s};
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import{createRequire as y}from"node:module";import{y as v}from"./index-2LCHaVNX.js";const h=y(import.meta.url),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=t=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[r,e]=d.versions.node.split(".").map(Number);if(r>22||r===22&&e>=3||r===20&&e>=16)return d.getBuiltinModule(t)}return h(t)},{createInterface:k}=w("node:readline"),_=/^#([\w\-/]+):(.+)$/,$=/^([@\w\-/]+):(.+)$/,b=t=>{if(t==="")return;if(t.startsWith(":"))return{kind:"all",target:t.slice(1)};if(t.startsWith("~:"))return{kind:"closest",target:t.slice(2)};const r=_.exec(t);if(r?.[1]&&r[2])return{kind:"tag",tag:r[1],target:r[2]};const e=$.exec(t);return e?.[1]&&e[2]&&(e[1].startsWith("@")||e[1].includes("/")||e[1].includes("-"))?{kind:"project",projects:[e[1]],target:e[2]}:{kind:"all",target:t}},P=async(t,r,e,a)=>{const s=b(t);if(!s)throw new Error(`Invalid target selector: "${t}"`);const c=Object.keys(r.projects);if(s.kind==="all")return{projects:c,target:s.target};if(s.kind==="project")return{projects:s.projects??[],target:s.target};if(s.kind==="tag"){const o=s.tag;return{projects:c.filter(i=>r.projects[i]?.tags?.includes(o)??!1),target:s.target}}const n=v(a,e)||".";let p,l=-1;for(const[o,i]of Object.entries(r.projects)){const u=i.root;u&&(n===u||n.startsWith(`${u}/`))&&u.length>l&&(l=u.length,p=o)}if(!p){if(process.stdout.isTTY){const o=k({input:process.stdin,output:process.stderr}),i=Object.keys(r.projects).sort();process.stderr.write(`No project found at ${n}. Pick one:
|
|
2
|
-
`);for(const[g,m]of i.entries())process.stderr.write(` ${String(g+1)}) ${m}
|
|
3
|
-
`);const u=await new Promise(g=>{o.question("> ",g)});o.close();const f=Number.parseInt(u,10)-1;if(f>=0&&f<i.length)return{projects:[i[f]],target:s.target}}throw new Error(`No project found at or above ${n} for selector "${t}".`)}return{projects:[p],target:s.target}},T=/^(\w+)\s*(!?=)\s*(.+)$/,q=t=>{const r=t.trim();if(r==="")return;const e=r.split("&&").map(o=>o.trim()),a=r.split("||").map(o=>o.trim()),s=e.length>1,c=a.length>1;if(s&&c)throw new Error("Query language does not support mixed && / || — split into multiple --query flags or simplify.");const n=c?a:e,p=c?"||":"&&",l=[];for(const o of n){const i=T.exec(o);if(!i)throw new Error(`Invalid query clause: "${o}". Expected <field>=<value> or <field>!=<value>.`);const[,u,f,g]=i;l.push({field:u,op:f==="!="?"!=":"=",value:g.trim().replaceAll(/^["']|["']$/g,"")})}return{clauses:l,op:p}},j=(t,r,e)=>{const{field:a,op:s,value:c}=t,n=l=>{const o=l===c;return s==="="?o:!o},p=l=>{const o=(l??[]).includes(c);return s==="="?o:!o};switch(a){case"id":case"project":return n(r);case"language":return n(e.language);case"layer":return n(e.layer);case"projectType":case"type":return n(e.projectType);case"stack":return n(e.stack);case"tag":case"tags":return p(e.tags);default:return!1}},I=(t,r,e)=>{if(!e||e.trim()==="")return t;const a=q(e);return a?t.filter(s=>{const c=r.projects[s];return c?a.op==="&&"?a.clauses.every(n=>j(n,s,c)):a.clauses.some(n=>j(n,s,c)):!1}):t};export{I as f,b as p,P as r};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as h}from"node:module";import{m as N,D as _}from"./provenance-CRBV9cko.js";import{g as b}from"./packument-CtVAoNo7.js";import{i as B}from"../packem_chunks/cli-main.js";import{f as P}from"./registry-keys-Ci2keQNi.js";const w=h(import.meta.url),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$=i=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[e,t]=g.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return g.getBuiltinModule(i)}return w(i)},{createPublicKey:x,createVerify:M}=$("node:crypto"),E=i=>{const e=["-----BEGIN PUBLIC KEY-----"],t=i.replaceAll(/\s+/g,"");for(let a=0;a<t.length;a+=64)e.push(t.slice(a,a+64));return e.push("-----END PUBLIC KEY-----"),e.join(`
|
|
2
|
-
`)},R=({keyBase64:i,message:e,signatureBase64:t})=>{try{const a=x({format:"pem",key:E(i)}),o=M("SHA256");return o.update(e),o.end(),o.verify(a,Buffer.from(t,"base64"))}catch{return!1}},j=(i,e)=>{if(i.expires===void 0||i.expires==="")return!1;const t=Date.parse(i.expires);return Number.isNaN(t)?!1:t<=e},C=(i,e,t)=>`${i}@${e}:${t}`,A=(i,e)=>e!==void 0&&i.includes(e)?e:i.at(-1),K=async(i,e={})=>{if(B("signatures"))return[];const t=new Set(e.allowlist),a=e.treatExpiredAs??"warning",o=e.concurrency??_,l=await P({keysUrl:e.keysUrl,signal:e.signal,ttlMs:e.keysTtlMs});if(l===void 0)return i.filter(({name:s})=>!t.has(s)).map(({name:s,version:r})=>({code:"fetch-failed",message:"Could not fetch registry signing keys.",packageName:s,severity:"warning",version:r}));const m=new Map;for(const s of l.keys)m.set(s.keyid,s);const k=Date.now();return(await N(i,o,async({name:s,version:r})=>{if(t.has(s))return[];const c=await b(s,{workspaceRoot:e.workspaceRoot});if(c===void 0)return[];const y=c.versions[r]??c.versions[A(Object.keys(c.versions),c["dist-tags"]?.latest)??""];if(y===void 0)return[];const f=y.dist?.signatures,p=y.dist?.integrity;if(f===void 0||f.length===0)return[{code:"missing-signature",message:`Package ${s}@${r} has no dist.signatures from the registry.`,packageName:s,severity:"warning",version:r}];if(typeof p!="string"||p==="")return[{code:"missing-signature",message:`Package ${s}@${r} has signatures but no dist.integrity to verify against.`,packageName:s,severity:"warning",version:r}];const v=C(s,r,p),u=[];for(const n of f){const d=m.get(n.keyid);if(d===void 0){u.push({code:"unknown-keyid",keyid:n.keyid,message:`Package ${s}@${r} was signed with an unrecognized keyid (${n.keyid}).`,packageName:s,severity:"error",version:r});continue}if(j(d,k)){u.push({code:"expired-key",keyid:n.keyid,message:`Package ${s}@${r} was signed with an expired key (${n.keyid}, expired ${d.expires??"unknown"}).`,packageName:s,severity:a,version:r});continue}R({keyBase64:d.key,message:v,signatureBase64:n.sig})||u.push({code:"invalid-signature",keyid:n.keyid,message:`Package ${s}@${r} signature did not verify against ${n.keyid}.`,packageName:s,severity:"error",version:r})}return u})).flat()};export{K as r};
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
import{createRequire as p}from"node:module";const m=p(import.meta.url),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=r=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[t,e]=u.versions.node.split(".").map(Number);if(t>22||t===22&&e>=3||t===20&&e>=16)return u.getBuiltinModule(r)}return m(r)},{spawnSync:f}=h("node:child_process"),l=64*1024*1024,n=(r,t)=>{const e=f("git",r,{cwd:t,encoding:"utf8",maxBuffer:l});if(e.error)throw new Error(`Failed to spawn git ${r.join(" ")}: ${e.error.message}`,{cause:e.error});return{status:typeof e.status=="number"?e.status:1,stderr:typeof e.stderr=="string"?e.stderr:"",stdout:typeof e.stdout=="string"?e.stdout:""}},g=(r,t)=>{const e=(t.stderr||t.stdout).trim();return`git ${r.join(" ")} failed (exit ${t.status})${e?`:
|
|
2
|
-
${e}`:""}`},o=(r,t,e=n)=>{const s=e(r,t);if(s.status!==0)throw new Error(g(r,s));return s.stdout.trim()},_=(r,t=n)=>{const e=t(["rev-parse","--is-inside-work-tree"],r);if(e.status!==0||e.stdout.trim()!=="true")throw new Error(`Not a git repository: ${r}. Run inside a git working tree.`)},b=(r,t=n)=>o(["status","--porcelain"],r,t).length===0,$=(r,t=n)=>{if(!b(r,t))throw new Error("Working tree has uncommitted changes. Commit or stash them before running this command.")},y=({annotate:r,branch:t,cwd:e,prefix:s,runner:i=n})=>{const a=["subtree","split",`--prefix=${s}`];return r&&a.push(`--annotate=${r}`),a.push("-b",t),o(a,e,i),o(["rev-parse",t],e,i)},j=({cwd:r,message:t,prefix:e,ref:s,repo:i,runner:a=n,squash:d})=>{const c=["subtree","add",`--prefix=${e}`];d&&c.push("--squash"),t&&c.push("-m",t),c.push(i,s),o(c,r,a)},v=({branch:r,runner:t=n,source:e,sourceBranch:s,target:i})=>{o(["init","-b",r],i,t),o(["pull",e,s],i,t)},x=(r,t,e=n)=>{o(["branch","-D",r],t,e)},B=(r,t,e,s=n)=>{o(["remote","add",r,t],e,s)},R=(r,t,e,s=n)=>{o(["push","-u",r,t],e,s)},N=(r,t,e=n)=>{const s=o(["rev-list","--count",r],t,e),i=Number.parseInt(s,10);return Number.isNaN(i)?0:i},k=(r,t,e,s=n)=>{o(["rm","-r",r],e,s),o(["commit","-m",t],e,s)};export{_ as a,$ as b,B as c,N as d,x as e,j as f,v as i,R as p,k as r,y as s};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{createRequire as ao}from"node:module";const po=ao(import.meta.url),de=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,co=e=>{if(typeof de<"u"&&de.versions&&de.versions.node){const[t,o]=de.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return de.getBuiltinModule(e)}return po(e)},{createRequire:fo}=co("node:module"),go=fo(import.meta.url),be=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Xt=e=>{if(typeof be<"u"&&be.versions&&be.versions.node){const[t,o]=be.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return be.getBuiltinModule(e)}return go(e)},{homedir:ho,tmpdir:pt}=Xt("node:os"),{env:et,cwd:bo,platform:St}=be,{createRequire:k}=Xt("node:module"),yo=0,Wt=2,mo=Symbol("findUpStop"),vo=/^[A-Z]:\//i,ot=(e="")=>e&&e.replaceAll("\\","/").replace(vo,t=>t.toUpperCase()),Ao=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,Ro=/^[A-Z]:$/i,Eo=/.(\.[^./]+)$/,_o=/^[/\\]|^[a-z]:[/\\]/i,xo=/\/$/,To=()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/",Co=(e,t)=>{let o="",c=0,p=-1,r=0,u;for(let a=0;a<=e.length;++a){if(a<e.length)u=e[a];else{if(u==="/")break;u="/"}if(u==="/"){if(!(p===a-1||r===1))if(r===2){if(o.length<2||c!==2||!o.endsWith(".")||o.at(-2)!=="."){if(o.length>2){const f=o.lastIndexOf("/");f===-1?(o="",c=0):(o=o.slice(0,f),c=o.length-1-o.lastIndexOf("/")),p=a,r=0;continue}else if(o.length>0){o="",c=0,p=a,r=0;continue}}t&&(o+=o.length>0?"/..":"..",c=2)}else o.length>0?o+=`/${e.slice(p+1,a)}`:o=e.slice(p+1,a),c=a-p-1;p=a,r=0}else u==="."&&r!==-1?++r:r=-1}return o},tt=e=>Ao.test(e),ct=function(...e){e=e.map(c=>ot(c));let t="",o=!1;for(let c=e.length-1;c>=-1&&!o;c--){const p=c>=0?e[c]:To();!p||p.length===0||(t=`${p}/${t}`,o=tt(p))}return t=Co(t,!o),o&&!tt(t)?`/${t}`:t.length>0?t:"."},So=function(e){return Eo.exec(ot(e))?.[1]??""},Qt=e=>{const t=ot(e).replace(xo,""),o=t.lastIndexOf("/");if(o===-1)return tt(e)?"/":".";const c=t.slice(0,o);return Ro.test(c)?`${c}/`:c||(tt(e)?"/":".")},$o=(e,t)=>{const o=ot(e);return o.slice(o.lastIndexOf("/")+1)},Oo=function(e){const t=_o.exec(e)?.[0]?.replaceAll("\\","/")??"",o=$o(e),c=So(o);return{base:o,dir:Qt(e),ext:c,name:o.slice(0,o.length-c.length),root:t}},ko=k(import.meta.url),ye=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,wo=e=>{if(typeof ye<"u"&&ye.versions&&ye.versions.node){const[t,o]=ye.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return ye.getBuiltinModule(e)}return ko(e)},{fileURLToPath:Ho}=wo("node:url");function No(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var $t,Ot;function Lo(){return Ot||(Ot=1,$t=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),$t}var Bo=Lo();const Mo=No(Bo);new Set(Mo);const ut=e=>ot(e instanceof URL?Ho(e):e),qt=e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},Io=k(import.meta.url),me=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Do=e=>{if(typeof me<"u"&&me.versions&&me.versions.node){const[t,o]=me.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return me.getBuiltinModule(e)}return Io(e)};Do("node:fs/promises");const Go=k(import.meta.url),ve=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Po=e=>{if(typeof ve<"u"&&ve.versions&&ve.versions.node){const[t,o]=ve.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return ve.getBuiltinModule(e)}return Go(e)};Po("node:fs");const kt=e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},Uo=k(import.meta.url),Ae=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Fo=e=>{if(typeof Ae<"u"&&Ae.versions&&Ae.versions.node){const[t,o]=Ae.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ae.getBuiltinModule(e)}return Uo(e)};Fo("node:fs/promises");const jo=k(import.meta.url),Re=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,zo=e=>{if(typeof Re<"u"&&Re.versions&&Re.versions.node){const[t,o]=Re.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Re.getBuiltinModule(e)}return jo(e)},{lstatSync:wt,mkdirSync:Ko}=zo("node:fs"),Ee=e=>{qt(e);try{const t=wt(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(kt(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{Ko(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const o=wt(e);if(!o.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(kt(o))}'`,{cause:t})}},Xo=k(import.meta.url),_e=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Wo=e=>{if(typeof _e<"u"&&_e.versions&&_e.versions.node){const[t,o]=_e.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return _e.getBuiltinModule(e)}return Xo(e)};Wo("node:fs/promises");const Qo=k(import.meta.url),xe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,qo=e=>{if(typeof xe<"u"&&xe.versions&&xe.versions.node){const[t,o]=xe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return xe.getBuiltinModule(e)}return Qo(e)};qo("node:fs");const Zo=k(import.meta.url),Te=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Yo=e=>{if(typeof Te<"u"&&Te.versions&&Te.versions.node){const[t,o]=Te.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Te.getBuiltinModule(e)}return Zo(e)};Yo("node:fs/promises");const Vo=k(import.meta.url),Ce=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Jo=e=>{if(typeof Ce<"u"&&Ce.versions&&Ce.versions.node){const[t,o]=Ce.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ce.getBuiltinModule(e)}return Vo(e)};Jo("node:fs");const er=k(import.meta.url),Se=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,tr=e=>{if(typeof Se<"u"&&Se.versions&&Se.versions.node){const[t,o]=Se.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Se.getBuiltinModule(e)}return er(e)};tr("node:fs/promises");const or=k(import.meta.url),$e=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,rr=e=>{if(typeof $e<"u"&&$e.versions&&$e.versions.node){const[t,o]=$e.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return $e.getBuiltinModule(e)}return or(e)};rr("node:fs");k(import.meta.url);const sr=k(import.meta.url),Oe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,nr=e=>{if(typeof Oe<"u"&&Oe.versions&&Oe.versions.node){const[t,o]=Oe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Oe.getBuiltinModule(e)}return sr(e)};nr("node:fs/promises");const ur=k(import.meta.url),ke=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ir=e=>{if(typeof ke<"u"&&ke.versions&&ke.versions.node){const[t,o]=ke.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return ke.getBuiltinModule(e)}return ur(e)};ir("node:fs");const lr=k(import.meta.url),we=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ar=e=>{if(typeof we<"u"&&we.versions&&we.versions.node){const[t,o]=we.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return we.getBuiltinModule(e)}return lr(e)};ar("node:fs/promises");const pr=k(import.meta.url),He=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,cr=e=>{if(typeof He<"u"&&He.versions&&He.versions.node){const[t,o]=He.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return He.getBuiltinModule(e)}return pr(e)},{statSync:fr,lstatSync:gr}=cr("node:fs"),hr=(e,t={})=>{const o=t.cwd?ut(t.cwd):process.cwd();let c=ct(o);const{root:p}=Oo(c),r=ut(t.stopAt??p),u=ct(c,r),a=t.type??"file",f=function(h){return[e]};t.allowSymlinks??=!0;const S=t.allowSymlinks?fr:gr;for(;c&&c!==u&&c!==p;){for(let h of f()){if(h===mo)return;if(h===void 0)continue;Buffer.isBuffer(h)?h=h.toString():h instanceof URL&&(h=ut(h));const x=tt(h)?h:ct(c,h);try{const T=S(x);if(a==="file"&&T.isFile()||a==="directory"&&T.isDirectory())return x}catch{}}c=Qt(c)}};function xt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ht={},ft,Nt;function lt(){if(Nt)return ft;Nt=1;const e="[^\\\\/]",t=Symbol("unignore"),o="\\.",c="\\+",p="\\?",r="\\/",u="(?=.)",a="[^/]",f=`(?:${r}|$)`,S=`(?:^|${r})`,h=`${o}{1,2}${f}`,x=`(?!${o})`,T=`(?!${S}${h})`,E=`(?!${o}{0,1}${f})`,B=`(?!${h})`,te=`[^.${r}]`,q=`${a}*?`,K="/",b={DOT_LITERAL:o,PLUS_LITERAL:c,QMARK_LITERAL:p,SLASH_LITERAL:r,ONE_CHAR:u,QMARK:a,END_ANCHOR:f,DOTS_SLASH:h,NO_DOT:x,NO_DOTS:T,NO_DOT_SLASH:E,NO_DOTS_SLASH:B,QMARK_NO_DOT:te,STAR:q,START_ANCHOR:S,SEP:K},y={...b,SLASH_LITERAL:"[\\\\/]",QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${o}{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!${o})`,NO_DOTS:`(?!(?:^|[\\\\/])${o}{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!${o}{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!${o}{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},s={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return ft={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:s,UNIGNORE:t,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(m){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${m.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(m){return m===!0?y:b}},ft}var Lt;function at(){return Lt||(Lt=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:c,REGEX_SPECIAL_CHARS_GLOBAL:p}=lt();e.isObject=r=>r!==null&&typeof r=="object"&&!Array.isArray(r),e.hasRegexChars=r=>c.test(r),e.isRegexChar=r=>r.length===1&&e.hasRegexChars(r),e.escapeRegex=r=>r.replace(p,"\\$1"),e.toPosixSlashes=r=>r.replace(t,"/"),e.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const r=navigator.platform.toLowerCase();return r==="win32"||r==="windows"}return process.platform?process.platform==="win32":!1},e.removeBackslashes=r=>r.replace(o,u=>u==="\\"?"":u),e.escapeLast=(r,u,a)=>{const f=r.lastIndexOf(u,a);return f===-1?r:r[f-1]==="\\"?e.escapeLast(r,u,f-1):`${r.slice(0,f)}\\${r.slice(f)}`},e.removePrefix=(r,u={})=>{let a=r;return a.startsWith("./")&&(a=a.slice(2),u.prefix="./"),a},e.wrapOutput=(r,u={},a={})=>{const f=a.contains?"":"^",S=a.contains?"":"$";let h=`${f}(?:${r})${S}`;return u.negated===!0&&(h=`(?:^(?!${h}).*$)`),h},e.basename=(r,{windows:u}={})=>{const a=r.split(u?/[\\/]/:"/"),f=a[a.length-1];return f===""?a[a.length-2]:f}})(Ht)),Ht}var gt,Bt;function br(){if(Bt)return gt;Bt=1;const e=at(),{CHAR_ASTERISK:t,CHAR_AT:o,CHAR_BACKWARD_SLASH:c,CHAR_COMMA:p,CHAR_DOT:r,CHAR_EXCLAMATION_MARK:u,CHAR_FORWARD_SLASH:a,CHAR_LEFT_CURLY_BRACE:f,CHAR_LEFT_PARENTHESES:S,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:x,CHAR_QUESTION_MARK:T,CHAR_RIGHT_CURLY_BRACE:E,CHAR_RIGHT_PARENTHESES:B,CHAR_RIGHT_SQUARE_BRACKET:te}=lt(),q=b=>b===a||b===c,K=b=>{b.isPrefix!==!0&&(b.depth=b.isGlobstar?1/0:1)};return gt=(b,y)=>{const s=y||{},m=b.length-1,A=s.parts===!0||s.scanToEnd===!0,R=[],v=[],w=[];let X=b,Z=-1,U=0,re=0,W=!1,se=!1,I=!1,ae=!1,ge=!1,ne=!1,L=!1,ue=!1,he=!1,Q=!1,z=0,V,_,O={value:"",depth:0,isGlob:!1};const l=()=>Z>=m,Y=()=>X.charCodeAt(Z+1),F=()=>(V=_,X.charCodeAt(++Z));for(;Z<m;){_=F();let H;if(_===c){L=O.backslashes=!0,_=F(),_===f&&(ne=!0);continue}if(ne===!0||_===f){for(z++;l()!==!0&&(_=F());){if(_===c){L=O.backslashes=!0,F();continue}if(_===f){z++;continue}if(ne!==!0&&_===r&&(_=F())===r){if(W=O.isBrace=!0,I=O.isGlob=!0,Q=!0,A===!0)continue;break}if(ne!==!0&&_===p){if(W=O.isBrace=!0,I=O.isGlob=!0,Q=!0,A===!0)continue;break}if(_===E&&(z--,z===0)){ne=!1,W=O.isBrace=!0,Q=!0;break}}if(A===!0)continue;break}if(_===a){if(R.push(Z),v.push(O),O={value:"",depth:0,isGlob:!1},Q===!0)continue;if(V===r&&Z===U+1){U+=2;continue}re=Z+1;continue}if(s.noext!==!0&&(_===x||_===o||_===t||_===T||_===u)&&Y()===S){if(I=O.isGlob=!0,ae=O.isExtglob=!0,Q=!0,_===u&&Z===U&&(he=!0),A===!0){for(;l()!==!0&&(_=F());){if(_===c){L=O.backslashes=!0,_=F();continue}if(_===B){I=O.isGlob=!0,Q=!0;break}}continue}break}if(_===t){if(V===t&&(ge=O.isGlobstar=!0),I=O.isGlob=!0,Q=!0,A===!0)continue;break}if(_===T){if(I=O.isGlob=!0,Q=!0,A===!0)continue;break}if(_===h){for(;l()!==!0&&(H=F());){if(H===c){L=O.backslashes=!0,F();continue}if(H===te){se=O.isBracket=!0,I=O.isGlob=!0,Q=!0;break}}if(A===!0)continue;break}if(s.nonegate!==!0&&_===u&&Z===U){ue=O.negated=!0,U++;continue}if(s.noparen!==!0&&_===S){if(I=O.isGlob=!0,A===!0){for(;l()!==!0&&(_=F());){if(_===S){L=O.backslashes=!0,_=F();continue}if(_===B){Q=!0;break}}continue}break}if(I===!0){if(Q=!0,A===!0)continue;break}}s.noext===!0&&(ae=!1,I=!1);let P=X,n="",i="";U>0&&(n=X.slice(0,U),X=X.slice(U),re-=U),P&&I===!0&&re>0?(P=X.slice(0,re),i=X.slice(re)):I===!0?(P="",i=X):P=X,P&&P!==""&&P!=="/"&&P!==X&&q(P.charCodeAt(P.length-1))&&(P=P.slice(0,-1)),s.unescape===!0&&(i&&(i=e.removeBackslashes(i)),P&&L===!0&&(P=e.removeBackslashes(P)));const ee={prefix:n,input:b,start:U,base:P,glob:i,isBrace:W,isBracket:se,isGlob:I,isExtglob:ae,isGlobstar:ge,negated:ue,negatedExtglob:he};if(s.tokens===!0&&(ee.maxDepth=0,q(_)||v.push(O),ee.tokens=v),s.parts===!0||s.tokens===!0){let H;for(let D=0;D<R.length;D++){const pe=H?H+1:U,J=R[D],ce=b.slice(pe,J);s.tokens&&(D===0&&U!==0?(v[D].isPrefix=!0,v[D].value=n):v[D].value=ce,K(v[D]),ee.maxDepth+=v[D].depth),(D!==0||ce!=="")&&w.push(ce),H=J}if(H&&H+1<b.length){const D=b.slice(H+1);w.push(D),s.tokens&&(v[v.length-1].value=D,K(v[v.length-1]),ee.maxDepth+=v[v.length-1].depth)}ee.slashes=R,ee.parts=w}return ee},gt}var ht,Mt;function dr(){if(Mt)return ht;Mt=1;const e=lt(),t=at(),{MAX_LENGTH:o,POSIX_REGEX_SOURCE:c,REGEX_NON_SPECIAL_CHARS:p,REGEX_SPECIAL_CHARS_BACKREF:r,REPLACEMENTS:u}=e,a=(b,y)=>typeof y.expandRange=="function"?y.expandRange(...b,y):(b.sort(),`[${b.join("-")}]`),f=(b,y)=>`Missing ${b}: "${y}" - use "\\\\${y}" to match literal characters`,S=b=>{const y=[];let s=0,m=0,A=0,R="",v=!1;for(const w of b){if(v===!0){R+=w,v=!1;continue}if(w==="\\"){R+=w,v=!0;continue}if(w==='"'){A=A===1?0:1,R+=w;continue}if(A===0){if(w==="[")s++;else if(w==="]"&&s>0)s--;else if(s===0){if(w==="(")m++;else if(w===")"&&m>0)m--;else if(w==="|"&&m===0){y.push(R),R="";continue}}}R+=w}return y.push(R),y},h=b=>{let y=!1;for(const s of b){if(y===!0){y=!1;continue}if(s==="\\"){y=!0;continue}if(/[?*+@!()[\]{}]/.test(s))return!1}return!0},x=b=>{let y=b.trim(),s=!0;for(;s===!0;)s=!1,/^@\([^\\()[\]{}|]+\)$/.test(y)&&(y=y.slice(2,-1),s=!0);if(h(y))return y.replace(/\\(.)/g,"$1")},T=b=>{const y=b.map(x).filter(Boolean);for(let s=0;s<y.length;s++)for(let m=s+1;m<y.length;m++){const A=y[s],R=y[m],v=A[0];if(!(!v||A!==v.repeat(A.length)||R!==v.repeat(R.length))&&(A===R||A.startsWith(R)||R.startsWith(A)))return!0}return!1},E=(b,y=!0)=>{if(b[0]!=="+"&&b[0]!=="*"||b[1]!=="(")return;let s=0,m=0,A=0,R=!1;for(let v=1;v<b.length;v++){const w=b[v];if(R===!0){R=!1;continue}if(w==="\\"){R=!0;continue}if(w==='"'){A=A===1?0:1;continue}if(A!==1){if(w==="["){s++;continue}if(w==="]"&&s>0){s--;continue}if(!(s>0)){if(w==="("){m++;continue}if(w===")"&&(m--,m===0))return y===!0&&v!==b.length-1?void 0:{type:b[0],body:b.slice(2,v),end:v}}}}},B=b=>{let y=0;const s=[];for(;y<b.length;){const m=E(b.slice(y),!1);if(!m||m.type!=="*")return;const A=S(m.body).map(v=>v.trim());if(A.length!==1)return;const R=x(A[0]);if(!R||R.length!==1)return;s.push(R),y+=m.end+1}return s.length<1?void 0:`${s.length===1?t.escapeRegex(s[0]):`[${s.map(m=>t.escapeRegex(m)).join("")}]`}*`},te=b=>{let y=0,s=b.trim(),m=E(s);for(;m;)y++,s=m.body.trim(),m=E(s);return y},q=(b,y)=>{if(y.maxExtglobRecursion===!1)return{risky:!1};const s=typeof y.maxExtglobRecursion=="number"?y.maxExtglobRecursion:e.DEFAULT_MAX_EXTGLOB_RECURSION,m=S(b).map(A=>A.trim());if(m.length>1&&(m.some(A=>A==="")||m.some(A=>/^[*?]+$/.test(A))||T(m)))return{risky:!0};for(const A of m){const R=B(A);if(R)return{risky:!0,safeOutput:R};if(te(A)>s)return{risky:!0}}return{risky:!1}},K=(b,y)=>{if(typeof b!="string")throw new TypeError("Expected a string");b=u[b]||b;const s={...y},m=typeof s.maxLength=="number"?Math.min(o,s.maxLength):o;let A=b.length;if(A>m)throw new SyntaxError(`Input length: ${A}, exceeds maximum allowed length: ${m}`);const R={type:"bos",value:"",output:s.prepend||""},v=[R],w=s.capture?"":"?:",X=e.globChars(s.windows),Z=e.extglobChars(X),{DOT_LITERAL:U,PLUS_LITERAL:re,SLASH_LITERAL:W,ONE_CHAR:se,DOTS_SLASH:I,NO_DOT:ae,NO_DOT_SLASH:ge,NO_DOTS_SLASH:ne,QMARK:L,QMARK_NO_DOT:ue,STAR:he,START_ANCHOR:Q}=X,z=d=>`(${w}(?:(?!${Q}${d.dot?I:U}).)*?)`,V=s.dot?"":ae,_=s.dot?L:ue;let O=s.bash===!0?z(s):he;s.capture&&(O=`(${O})`),typeof s.noext=="boolean"&&(s.noextglob=s.noext);const l={input:b,index:-1,start:0,dot:s.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:v};b=t.removePrefix(b,l),A=b.length;const Y=[],F=[],P=[];let n=R,i;const ee=()=>l.index===A-1,H=l.peek=(d=1)=>b[l.index+d],D=l.advance=()=>b[++l.index]||"",pe=()=>b.slice(l.index+1),J=(d="",M=0)=>{l.consumed+=d,l.index+=M},ce=d=>{l.output+=d.output!=null?d.output:d.value,J(d.value)},io=()=>{let d=1;for(;H()==="!"&&(H(2)!=="("||H(3)==="?");)D(),l.start++,d++;return d%2===0?!1:(l.negated=!0,l.start++,!0)},st=d=>{l[d]++,P.push(d)},fe=d=>{l[d]--,P.pop()},C=d=>{if(n.type==="globstar"){const M=l.braces>0&&(d.type==="comma"||d.type==="brace"),g=d.extglob===!0||Y.length&&(d.type==="pipe"||d.type==="paren");d.type!=="slash"&&d.type!=="paren"&&!M&&!g&&(l.output=l.output.slice(0,-n.output.length),n.type="star",n.value="*",n.output=O,l.output+=n.output)}if(Y.length&&d.type!=="paren"&&(Y[Y.length-1].inner+=d.value),(d.value||d.output)&&ce(d),n&&n.type==="text"&&d.type==="text"){n.output=(n.output||n.value)+d.value,n.value+=d.value;return}d.prev=n,v.push(d),n=d},nt=(d,M)=>{const g={...Z[M],conditions:1,inner:""};g.prev=n,g.parens=l.parens,g.output=l.output,g.startIndex=l.index,g.tokensIndex=v.length;const $=(s.capture?"(":"")+g.open;st("parens"),C({type:d,value:M,output:l.output?"":se}),C({type:"paren",extglob:!0,value:D(),output:$}),Y.push(g)},lo=d=>{const M=b.slice(d.startIndex,l.index+1),g=b.slice(d.startIndex+2,l.index),$=q(g,s);if((d.type==="plus"||d.type==="star")&&$.risky){const N=$.safeOutput?(d.output?"":se)+(s.capture?`(${$.safeOutput})`:$.safeOutput):void 0,ie=v[d.tokensIndex];ie.type="text",ie.value=M,ie.output=N||t.escapeRegex(M);for(let le=d.tokensIndex+1;le<v.length;le++)v[le].value="",v[le].output="",delete v[le].suffix;l.output=d.output+ie.output,l.backtrack=!0,C({type:"paren",extglob:!0,value:i,output:""}),fe("parens");return}let G=d.close+(s.capture?")":""),j;if(d.type==="negate"){let N=O;if(d.inner&&d.inner.length>1&&d.inner.includes("/")&&(N=z(s)),(N!==O||ee()||/^\)+$/.test(pe()))&&(G=d.close=`)$))${N}`),d.inner.includes("*")&&(j=pe())&&/^\.[^\\/.]+$/.test(j)){const ie=K(j,{...y,fastpaths:!1}).output;G=d.close=`)${ie})${N})`}d.prev.type==="bos"&&(l.negatedExtglob=!0)}C({type:"paren",extglob:!0,value:i,output:G}),fe("parens")};if(s.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(b)){let d=!1,M=b.replace(r,(g,$,G,j,N,ie)=>j==="\\"?(d=!0,g):j==="?"?$?$+j+(N?L.repeat(N.length):""):ie===0?_+(N?L.repeat(N.length):""):L.repeat(G.length):j==="."?U.repeat(G.length):j==="*"?$?$+j+(N?O:""):O:$?g:`\\${g}`);return d===!0&&(s.unescape===!0?M=M.replace(/\\/g,""):M=M.replace(/\\+/g,g=>g.length%2===0?"\\\\":g?"\\":"")),M===b&&s.contains===!0?(l.output=b,l):(l.output=t.wrapOutput(M,l,y),l)}for(;!ee();){if(i=D(),i==="\0")continue;if(i==="\\"){const g=H();if(g==="/"&&s.bash!==!0||g==="."||g===";")continue;if(!g){i+="\\",C({type:"text",value:i});continue}const $=/^\\+/.exec(pe());let G=0;if($&&$[0].length>2&&(G=$[0].length,l.index+=G,G%2!==0&&(i+="\\")),s.unescape===!0?i=D():i+=D(),l.brackets===0){C({type:"text",value:i});continue}}if(l.brackets>0&&(i!=="]"||n.value==="["||n.value==="[^")){if(s.posix!==!1&&i===":"){const g=n.value.slice(1);if(g.includes("[")&&(n.posix=!0,g.includes(":"))){const $=n.value.lastIndexOf("["),G=n.value.slice(0,$),j=n.value.slice($+2),N=c[j];if(N){n.value=G+N,l.backtrack=!0,D(),!R.output&&v.indexOf(n)===1&&(R.output=se);continue}}}(i==="["&&H()!==":"||i==="-"&&H()==="]")&&(i=`\\${i}`),i==="]"&&(n.value==="["||n.value==="[^")&&(i=`\\${i}`),s.posix===!0&&i==="!"&&n.value==="["&&(i="^"),n.value+=i,ce({value:i});continue}if(l.quotes===1&&i!=='"'){i=t.escapeRegex(i),n.value+=i,ce({value:i});continue}if(i==='"'){l.quotes=l.quotes===1?0:1,s.keepQuotes===!0&&C({type:"text",value:i});continue}if(i==="("){st("parens"),C({type:"paren",value:i});continue}if(i===")"){if(l.parens===0&&s.strictBrackets===!0)throw new SyntaxError(f("opening","("));const g=Y[Y.length-1];if(g&&l.parens===g.parens+1){lo(Y.pop());continue}C({type:"paren",value:i,output:l.parens?")":"\\)"}),fe("parens");continue}if(i==="["){if(s.nobracket===!0||!pe().includes("]")){if(s.nobracket!==!0&&s.strictBrackets===!0)throw new SyntaxError(f("closing","]"));i=`\\${i}`}else st("brackets");C({type:"bracket",value:i});continue}if(i==="]"){if(s.nobracket===!0||n&&n.type==="bracket"&&n.value.length===1){C({type:"text",value:i,output:`\\${i}`});continue}if(l.brackets===0){if(s.strictBrackets===!0)throw new SyntaxError(f("opening","["));C({type:"text",value:i,output:`\\${i}`});continue}fe("brackets");const g=n.value.slice(1);if(n.posix!==!0&&g[0]==="^"&&!g.includes("/")&&(i=`/${i}`),n.value+=i,ce({value:i}),s.literalBrackets===!1||t.hasRegexChars(g))continue;const $=t.escapeRegex(n.value);if(l.output=l.output.slice(0,-n.value.length),s.literalBrackets===!0){l.output+=$,n.value=$;continue}n.value=`(${w}${$}|${n.value})`,l.output+=n.value;continue}if(i==="{"&&s.nobrace!==!0){st("braces");const g={type:"brace",value:i,output:"(",outputIndex:l.output.length,tokensIndex:l.tokens.length};F.push(g),C(g);continue}if(i==="}"){const g=F[F.length-1];if(s.nobrace===!0||!g){C({type:"text",value:i,output:i});continue}let $=")";if(g.dots===!0){const G=v.slice(),j=[];for(let N=G.length-1;N>=0&&(v.pop(),G[N].type!=="brace");N--)G[N].type!=="dots"&&j.unshift(G[N].value);$=a(j,s),l.backtrack=!0}if(g.comma!==!0&&g.dots!==!0){const G=l.output.slice(0,g.outputIndex),j=l.tokens.slice(g.tokensIndex);g.value=g.output="\\{",i=$="\\}",l.output=G;for(const N of j)l.output+=N.output||N.value}C({type:"brace",value:i,output:$}),fe("braces"),F.pop();continue}if(i==="|"){Y.length>0&&Y[Y.length-1].conditions++,C({type:"text",value:i});continue}if(i===","){let g=i;const $=F[F.length-1];$&&P[P.length-1]==="braces"&&($.comma=!0,g="|"),C({type:"comma",value:i,output:g});continue}if(i==="/"){if(n.type==="dot"&&l.index===l.start+1){l.start=l.index+1,l.consumed="",l.output="",v.pop(),n=R;continue}C({type:"slash",value:i,output:W});continue}if(i==="."){if(l.braces>0&&n.type==="dot"){n.value==="."&&(n.output=U);const g=F[F.length-1];n.type="dots",n.output+=i,n.value+=i,g.dots=!0;continue}if(l.braces+l.parens===0&&n.type!=="bos"&&n.type!=="slash"){C({type:"text",value:i,output:U});continue}C({type:"dot",value:i,output:U});continue}if(i==="?"){if(!(n&&n.value==="(")&&s.noextglob!==!0&&H()==="("&&H(2)!=="?"){nt("qmark",i);continue}if(n&&n.type==="paren"){const g=H();let $=i;(n.value==="("&&!/[!=<:]/.test(g)||g==="<"&&!/<([!=]|\w+>)/.test(pe()))&&($=`\\${i}`),C({type:"text",value:i,output:$});continue}if(s.dot!==!0&&(n.type==="slash"||n.type==="bos")){C({type:"qmark",value:i,output:ue});continue}C({type:"qmark",value:i,output:L});continue}if(i==="!"){if(s.noextglob!==!0&&H()==="("&&(H(2)!=="?"||!/[!=<:]/.test(H(3)))){nt("negate",i);continue}if(s.nonegate!==!0&&l.index===0){io();continue}}if(i==="+"){if(s.noextglob!==!0&&H()==="("&&H(2)!=="?"){nt("plus",i);continue}if(n&&n.value==="("||s.regex===!1){C({type:"plus",value:i,output:re});continue}if(n&&(n.type==="bracket"||n.type==="paren"||n.type==="brace")||l.parens>0){C({type:"plus",value:i});continue}C({type:"plus",value:re});continue}if(i==="@"){if(s.noextglob!==!0&&H()==="("&&H(2)!=="?"){C({type:"at",extglob:!0,value:i,output:""});continue}C({type:"text",value:i});continue}if(i!=="*"){(i==="$"||i==="^")&&(i=`\\${i}`);const g=p.exec(pe());g&&(i+=g[0],l.index+=g[0].length),C({type:"text",value:i});continue}if(n&&(n.type==="globstar"||n.star===!0)){n.type="star",n.star=!0,n.value+=i,n.output=O,l.backtrack=!0,l.globstar=!0,J(i);continue}let d=pe();if(s.noextglob!==!0&&/^\([^?]/.test(d)){nt("star",i);continue}if(n.type==="star"){if(s.noglobstar===!0){J(i);continue}const g=n.prev,$=g.prev,G=g.type==="slash"||g.type==="bos",j=$&&($.type==="star"||$.type==="globstar");if(s.bash===!0&&(!G||d[0]&&d[0]!=="/")){C({type:"star",value:i,output:""});continue}const N=l.braces>0&&(g.type==="comma"||g.type==="brace"),ie=Y.length&&(g.type==="pipe"||g.type==="paren");if(!G&&g.type!=="paren"&&!N&&!ie){C({type:"star",value:i,output:""});continue}for(;d.slice(0,3)==="/**";){const le=b[l.index+4];if(le&&le!=="/")break;d=d.slice(3),J("/**",3)}if(g.type==="bos"&&ee()){n.type="globstar",n.value+=i,n.output=z(s),l.output=n.output,l.globstar=!0,J(i);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&!j&&ee()){l.output=l.output.slice(0,-(g.output+n.output).length),g.output=`(?:${g.output}`,n.type="globstar",n.output=z(s)+(s.strictSlashes?")":"|$)"),n.value+=i,l.globstar=!0,l.output+=g.output+n.output,J(i);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&d[0]==="/"){const le=d[1]!==void 0?"|$":"";l.output=l.output.slice(0,-(g.output+n.output).length),g.output=`(?:${g.output}`,n.type="globstar",n.output=`${z(s)}${W}|${W}${le})`,n.value+=i,l.output+=g.output+n.output,l.globstar=!0,J(i+D()),C({type:"slash",value:"/",output:""});continue}if(g.type==="bos"&&d[0]==="/"){n.type="globstar",n.value+=i,n.output=`(?:^|${W}|${z(s)}${W})`,l.output=n.output,l.globstar=!0,J(i+D()),C({type:"slash",value:"/",output:""});continue}if(N&&d[0]==="/"){n.type="globstar",n.value+=i,n.output=`(?:^|${W}|${z(s)}${W})`,l.output+=n.output,l.globstar=!0,J(i+D()),C({type:"slash",value:"/",output:""});continue}l.output=l.output.slice(0,-n.output.length),n.type="globstar",n.output=z(s),n.value+=i,l.output+=n.output,l.globstar=!0,J(i);continue}const M={type:"star",value:i,output:O};if(s.bash===!0){M.output=".*?",(n.type==="bos"||n.type==="slash")&&(M.output=V+M.output),C(M);continue}if(n&&(n.type==="bracket"||n.type==="paren")&&s.regex===!0){M.output=i,C(M);continue}(l.index===l.start||n.type==="slash"||n.type==="dot")&&(n.type==="dot"?(l.output+=ge,n.output+=ge):s.dot===!0?(l.output+=ne,n.output+=ne):(l.output+=V,n.output+=V),H()!=="*"&&(l.output+=se,n.output+=se)),C(M)}for(;l.brackets>0;){if(s.strictBrackets===!0)throw new SyntaxError(f("closing","]"));l.output=t.escapeLast(l.output,"["),fe("brackets")}for(;l.parens>0;){if(s.strictBrackets===!0)throw new SyntaxError(f("closing",")"));l.output=t.escapeLast(l.output,"("),fe("parens")}for(;l.braces>0;){if(s.strictBrackets===!0)throw new SyntaxError(f("closing","}"));l.output=t.escapeLast(l.output,"{"),fe("braces")}if(s.strictSlashes!==!0&&(n.type==="star"||n.type==="bracket")&&C({type:"maybe_slash",value:"",output:`${W}?`}),l.backtrack===!0){l.output="";for(const d of l.tokens)l.output+=d.output!=null?d.output:d.value,d.suffix&&(l.output+=d.suffix)}return l};return K.fastpaths=(b,y)=>{const s={...y},m=typeof s.maxLength=="number"?Math.min(o,s.maxLength):o,A=b.length;if(A>m)throw new SyntaxError(`Input length: ${A}, exceeds maximum allowed length: ${m}`);b=u[b]||b;const{DOT_LITERAL:R,SLASH_LITERAL:v,ONE_CHAR:w,DOTS_SLASH:X,NO_DOT:Z,NO_DOTS:U,NO_DOTS_SLASH:re,STAR:W,START_ANCHOR:se}=e.globChars(s.windows),I=s.dot?U:Z,ae=s.dot?re:Z,ge=s.capture?"":"?:",ne={negated:!1,prefix:""};let L=s.bash===!0?".*?":W;s.capture&&(L=`(${L})`);const ue=V=>V.noglobstar===!0?L:`(${ge}(?:(?!${se}${V.dot?X:R}).)*?)`,he=V=>{switch(V){case"*":return`${I}${w}${L}`;case".*":return`${R}${w}${L}`;case"*.*":return`${I}${L}${R}${w}${L}`;case"*/*":return`${I}${L}${v}${w}${ae}${L}`;case"**":return I+ue(s);case"**/*":return`(?:${I}${ue(s)}${v})?${ae}${w}${L}`;case"**/*.*":return`(?:${I}${ue(s)}${v})?${ae}${L}${R}${w}${L}`;case"**/.*":return`(?:${I}${ue(s)}${v})?${R}${w}${L}`;default:{const _=/^(.*?)\.(\w+)$/.exec(V);if(!_)return;const O=he(_[1]);return O?O+R+_[2]:void 0}}},Q=t.removePrefix(b,ne);let z=he(Q);return z&&s.strictSlashes!==!0&&(z+=`${v}?`),z},ht=K,ht}var bt,It;function yr(){if(It)return bt;It=1;const e=br(),t=dr(),o=at(),c=lt(),p=u=>u&&typeof u=="object"&&!Array.isArray(u),r=(u,a,f=!1)=>{if(Array.isArray(u)){const q=u.map(K=>r(K,a,f));return K=>{for(const b of q){const y=b(K);if(y)return y}return!1}}const S=p(u)&&u.tokens&&u.input;if(u===""||typeof u!="string"&&!S)throw new TypeError("Expected pattern to be a non-empty string");const h=a||{},x=h.windows,T=S?r.compileRe(u,a):r.makeRe(u,a,!1,!0),E=T.state;delete T.state;let B=()=>!1;if(h.ignore){const q={...a,ignore:null,onMatch:null,onResult:null};B=r(h.ignore,q,f)}const te=(q,K=!1)=>{const{isMatch:b,match:y,output:s}=r.test(q,T,a,{glob:u,posix:x}),m={glob:u,state:E,regex:T,posix:x,input:q,output:s,match:y,isMatch:b};if(typeof h.onResult=="function"&&h.onResult(m),b===!1)return m.isMatch=!1,K?m:!1;e:if(B(q)){if(typeof h.onIgnore=="function"&&h.onIgnore(m)===c.UNIGNORE){m.isMatch=!0;break e}return m.isMatch=!1,K?m:!1}return typeof h.onMatch=="function"&&h.onMatch(m),K?m:!0};return f&&(te.state=E),te};return r.test=(u,a,f,{glob:S,posix:h}={})=>{if(typeof u!="string")throw new TypeError("Expected input to be a string");if(u==="")return{isMatch:!1,output:""};const x=f||{},T=x.format||(h?o.toPosixSlashes:null);let E=u===S,B=E&&T?T(u):u;return E===!1&&(B=T?T(u):u,E=B===S),(E===!1||x.capture===!0)&&(x.matchBase===!0||x.basename===!0?E=r.matchBase(u,a,f,h):E=a.exec(B)),{isMatch:!!E,match:E,output:B}},r.matchBase=(u,a,f)=>(a instanceof RegExp?a:r.makeRe(a,f)).test(o.basename(u)),r.isMatch=(u,a,f)=>r(a,f)(u),r.parse=(u,a)=>Array.isArray(u)?u.map(f=>r.parse(f,a)):t(u,{...a,fastpaths:!1}),r.scan=(u,a)=>e(u,a),r.compileRe=(u,a,f=!1,S=!1)=>{if(f===!0)return u.output;const h=a||{},x=h.contains?"":"^",T=h.contains?"":"$";let E=`${x}(?:${u.output})${T}`;u&&u.negated===!0&&(E=`^(?!${E}).*$`);const B=r.toRegex(E,a);return S===!0&&(B.state=u),B},r.makeRe=(u,a={},f=!1,S=!1)=>{if(!u||typeof u!="string")throw new TypeError("Expected a non-empty string");let h={negated:!1,fastpaths:!0};return a.fastpaths!==!1&&(u[0]==="."||u[0]==="*")&&(h.output=t.fastpaths(u,a)),h.output||(h=t(u,a)),r.compileRe(h,a,f,S)},r.toRegex=(u,a)=>{try{const f=a||{};return new RegExp(u,f.flags||(f.nocase?"i":""))}catch(f){if(a&&a.debug===!0)throw f;return/$^/}},r.constants=c,bt=r,bt}var dt,Dt;function mr(){if(Dt)return dt;Dt=1;const e=yr(),t=at();function o(c,p,r=!1){return p&&(p.windows===null||p.windows===void 0)&&(p={...p,windows:t.isWindows()}),e(c,p,r)}return Object.assign(o,e),dt=o,dt}var vr=mr();xt(vr);const Ar=k(import.meta.url),Ne=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,rt=e=>{if(typeof Ne<"u"&&Ne.versions&&Ne.versions.node){const[t,o]=Ne.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ne.getBuiltinModule(e)}return Ar(e)};rt("fs");rt("fs");rt("path");rt("url");const{createRequire:Rr}=rt("module");var Gt=Rr(import.meta.url);try{Gt.resolve("picomatch"),Gt("picomatch")}catch{}var yt,Pt;function Er(){if(Pt)return yt;Pt=1;/*!
|
|
2
|
-
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
3
|
-
*
|
|
4
|
-
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
5
|
-
* Licensed under the MIT License.
|
|
6
|
-
*/return yt=function(e){if(typeof e!="string"||e==="")return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1},yt}var mt,Ut;function Zt(){if(Ut)return mt;Ut=1;/*!
|
|
7
|
-
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
8
|
-
*
|
|
9
|
-
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
10
|
-
* Released under the MIT License.
|
|
11
|
-
*/var e=Er(),t={"{":"}","(":")","[":"]"},o=function(p){if(p[0]==="!")return!0;for(var r=0,u=-2,a=-2,f=-2,S=-2,h=-2;r<p.length;){if(p[r]==="*"||p[r+1]==="?"&&/[\].+)]/.test(p[r])||a!==-1&&p[r]==="["&&p[r+1]!=="]"&&(a<r&&(a=p.indexOf("]",r)),a>r&&(h===-1||h>a||(h=p.indexOf("\\",r),h===-1||h>a)))||f!==-1&&p[r]==="{"&&p[r+1]!=="}"&&(f=p.indexOf("}",r),f>r&&(h=p.indexOf("\\",r),h===-1||h>f))||S!==-1&&p[r]==="("&&p[r+1]==="?"&&/[:!=]/.test(p[r+2])&&p[r+3]!==")"&&(S=p.indexOf(")",r),S>r&&(h=p.indexOf("\\",r),h===-1||h>S))||u!==-1&&p[r]==="("&&p[r+1]!=="|"&&(u<r&&(u=p.indexOf("|",r)),u!==-1&&p[u+1]!==")"&&(S=p.indexOf(")",u),S>u&&(h=p.indexOf("\\",u),h===-1||h>S))))return!0;if(p[r]==="\\"){var x=p[r+1];r+=2;var T=t[x];if(T){var E=p.indexOf(T,r);E!==-1&&(r=E+1)}if(p[r]==="!")return!0}else r++}return!1},c=function(p){if(p[0]==="!")return!0;for(var r=0;r<p.length;){if(/[*?{}()[\]]/.test(p[r]))return!0;if(p[r]==="\\"){var u=p[r+1];r+=2;var a=t[u];if(a){var f=p.indexOf(a,r);f!==-1&&(r=f+1)}if(p[r]==="!")return!0}else r++}return!1};return mt=function(p,r){if(typeof p!="string"||p==="")return!1;if(e(p))return!0;var u=o;return r&&r.strict===!1&&(u=c),u(p)},mt}const _r=k(import.meta.url),Le=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Yt=e=>{if(typeof Le<"u"&&Le.versions&&Le.versions.node){const[t,o]=Le.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Le.getBuiltinModule(e)}return _r(e)},xr=Yt("path"),Tr=Yt("os");var vt,Ft;function Cr(){if(Ft)return vt;Ft=1;var e=Zt(),t=xr.posix.dirname,o=Tr.platform()==="win32",c="/",p=/\\/g,r=/\\([!*?|[\](){}])/g;vt=function(f,S){var h=Object.assign({flipBackslashes:!0},S);h.flipBackslashes&&o&&f.indexOf(c)<0&&(f=f.replace(p,c)),u(f)&&(f+=c),f+="a";do f=t(f);while(a(f));return f.replace(r,"$1")};function u(f){var S=f.slice(-1),h;switch(S){case"}":h="{";break;case"]":h="[";break;default:return!1}var x=f.indexOf(h);return x<0?!1:f.slice(x+1,-1).includes(c)}function a(f){return/\([^()]+$/.test(f)||f[0]==="{"||f[0]==="["||/[^\\][{[]/.test(f)?!0:e(f)}return vt}var Sr=Cr();xt(Sr);const $r=k(import.meta.url),Be=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Or=e=>{if(typeof Be<"u"&&Be.versions&&Be.versions.node){const[t,o]=Be.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Be.getBuiltinModule(e)}return $r(e)};Or("node:fs/promises");const kr=k(import.meta.url),Me=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,wr=e=>{if(typeof Me<"u"&&Me.versions&&Me.versions.node){const[t,o]=Me.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Me.getBuiltinModule(e)}return kr(e)},{accessSync:Hr}=wr("node:fs");function _t(e,t=yo){qt(e),e=ut(e);try{return Hr(e,t),!0}catch{return!1}}var Nr=Zt();xt(Nr);const Lr=k(import.meta.url),Ie=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Vt=e=>{if(typeof Ie<"u"&&Ie.versions&&Ie.versions.node){const[t,o]=Ie.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ie.getBuiltinModule(e)}return Lr(e)};Vt("node:fs/promises");Vt("node:fs");let Br=class extends Error{constructor(e){super(`ENOENT: ${e}`)}get code(){return"ENOENT"}set code(e){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(e){throw new Error("Cannot overwrite name of NotFoundError")}};const Mr=k(import.meta.url),De=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Jt=e=>{if(typeof De<"u"&&De.versions&&De.versions.node){const[t,o]=De.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return De.getBuiltinModule(e)}return Mr(e)};Jt("node:fs/promises");Jt("node:zlib");const Ir=k(import.meta.url),Ge=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,eo=e=>{if(typeof Ge<"u"&&Ge.versions&&Ge.versions.node){const[t,o]=Ge.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ge.getBuiltinModule(e)}return Ir(e)};eo("node:fs");eo("node:zlib");const Dr=k(import.meta.url),Pe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Gr=e=>{if(typeof Pe<"u"&&Pe.versions&&Pe.versions.node){const[t,o]=Pe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Pe.getBuiltinModule(e)}return Dr(e)},{createRequire:to}=Gr("node:module"),Pr=new Map([["Error",Error],["EvalError",EvalError],["RangeError",RangeError],["ReferenceError",ReferenceError],["SyntaxError",SyntaxError],["TypeError",TypeError],["URIError",URIError]]);typeof AggregateError<"u"&&Pr.set("AggregateError",AggregateError);const Ur=to(import.meta.url),Ue=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Fr=e=>{if(typeof Ue<"u"&&Ue.versions&&Ue.versions.node){const[t,o]=Ue.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ue.getBuiltinModule(e)}return Ur(e)};Fr("node:util");const jr=to(import.meta.url),Fe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Tt=e=>{if(typeof Fe<"u"&&Fe.versions&&Fe.versions.node){const[t,o]=Fe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Fe.getBuiltinModule(e)}return jr(e)};Tt("node:fs");Tt("node:path");Tt("node:url");const zr=k(import.meta.url),je=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,oo=e=>{if(typeof je<"u"&&je.versions&&je.versions.node){const[t,o]=je.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return je.getBuiltinModule(e)}return zr(e)};oo("node:fs");oo("node:fs/promises");const Kr=k(import.meta.url),ze=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Xr=e=>{if(typeof ze<"u"&&ze.versions&&ze.versions.node){const[t,o]=ze.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return ze.getBuiltinModule(e)}return Kr(e)};Xr("node:fs");const Wr=k(import.meta.url),Ke=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Qr=e=>{if(typeof Ke<"u"&&Ke.versions&&Ke.versions.node){const[t,o]=Ke.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ke.getBuiltinModule(e)}return Wr(e)};Qr("node:fs/promises");const qr=k(import.meta.url),Xe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Zr=e=>{if(typeof Xe<"u"&&Xe.versions&&Xe.versions.node){const[t,o]=Xe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Xe.getBuiltinModule(e)}return qr(e)};Zr("node:fs");k(import.meta.url);const Yr=k(import.meta.url),We=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Vr=e=>{if(typeof We<"u"&&We.versions&&We.versions.node){const[t,o]=We.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return We.getBuiltinModule(e)}return Yr(e)};Vr("node:crypto");new TextEncoder;const Jr=k(import.meta.url),Qe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,es=e=>{if(typeof Qe<"u"&&Qe.versions&&Qe.versions.node){const[t,o]=Qe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Qe.getBuiltinModule(e)}return Jr(e)};es("node:fs/promises");const ts=k(import.meta.url),qe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,os=e=>{if(typeof qe<"u"&&qe.versions&&qe.versions.node){const[t,o]=qe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return qe.getBuiltinModule(e)}return ts(e)};os("node:fs");const rs=k(import.meta.url),Ze=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ss=e=>{if(typeof Ze<"u"&&Ze.versions&&Ze.versions.node){const[t,o]=Ze.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ze.getBuiltinModule(e)}return rs(e)};ss("node:fs/promises");const ns=k(import.meta.url),Ye=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,us=e=>{if(typeof Ye<"u"&&Ye.versions&&Ye.versions.node){const[t,o]=Ye.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ye.getBuiltinModule(e)}return ns(e)};us("node:fs");const is=k(import.meta.url),Ve=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ct=e=>{if(typeof Ve<"u"&&Ve.versions&&Ve.versions.node){const[t,o]=Ve.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ve.getBuiltinModule(e)}return is(e)},ls=Ct("fs"),as=Ct("os"),ps=Ct("path");var At={},jt;function cs(){if(jt)return At;jt=1;var e=Object.defineProperty,t=(h,x)=>e(h,"name",{value:x,configurable:!0}),o=ls,c=as,p=ps;const r=t(h=>{let x="";for(let T=0;T<h.length;T+=1){const E=h[T],B=E.toUpperCase();x+=E===B?E.toLowerCase():B}return x},"invertCase"),u=new Map,a=t((h,x)=>{const T=p.join(h,`.is-fs-case-sensitive-test-${process.pid}`);try{return x.writeFileSync(T,""),!x.existsSync(r(T))}finally{try{x.unlinkSync(T)}catch{}}},"checkDirectoryCaseWithWrite"),f=t((h,x,T)=>{try{return a(h,T)}catch(E){if(x===void 0)return a(c.tmpdir(),T);throw E}},"checkDirectoryCaseWithFallback"),S=t((h,x=o,T=!0)=>{const E=h??process.cwd();if(T&&u.has(E))return u.get(E);let B;const te=r(E);return te!==E&&x.existsSync(E)?B=!x.existsSync(te):B=f(E,h,x),T&&u.set(E,B),B},"isFsCaseSensitive");return At.isFsCaseSensitive=S,At}cs();const fs=/^[A-Z]:\//i,ro=(e="")=>e&&e.replaceAll("\\","/").replace(fs,t=>t.toUpperCase()),gs=/^[/\\]{2}/,hs=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,so=/^[A-Z]:$/i,bs=/\/$/,Rt="/",ds=(e,t)=>{let o="",c=0,p=-1,r=0,u;for(let a=0;a<=e.length;++a){if(a<e.length)u=e[a];else{if(u==="/")break;u="/"}if(u==="/"){if(!(p===a-1||r===1))if(r===2){if(o.length<2||c!==2||!o.endsWith(".")||o.at(-2)!=="."){if(o.length>2){const f=o.lastIndexOf("/");f===-1?(o="",c=0):(o=o.slice(0,f),c=o.length-1-o.lastIndexOf("/")),p=a,r=0;continue}else if(o.length>0){o="",c=0,p=a,r=0;continue}}t&&(o+=o.length>0?"/..":"..",c=2)}else o.length>0?o+=`/${e.slice(p+1,a)}`:o=e.slice(p+1,a),c=a-p-1;p=a,r=0}else u==="."&&r!==-1?++r:r=-1}return o},it=e=>hs.test(e),no=function(e){if(e.length===0)return".";e=ro(e);const t=gs.exec(e),o=it(e),c=e.at(-1)==="/";return e=ds(e,!o),e.length===0?o?"/":c?"./":".":(c&&(e+="/"),so.test(e)&&(e+="/"),t?o?`//${e}`:`//./${e}`:o&&!it(e)?`/${e}`:e)},oe=(...e)=>{let t="";for(const o of e)if(o)if(t.length>0){const c=t.at(-1)==="/",p=o[0]==="/";c&&p?t+=o.slice(1):t+=c||p?o:`/${o}`}else t+=o;return no(t)},ys=e=>{const t=ro(e).replace(bs,""),o=t.lastIndexOf("/");if(o===-1)return it(e)?"/":".";const c=t.slice(0,o);return so.test(c)?`${c}/`:c||(it(e)?"/":".")},uo=e=>e instanceof URL?new URL(e).pathname:e,zt=e=>{const t=ho();if(St==="win32"){const c=et.LOCALAPPDATA??(t?oe(t,"AppData","Local"):pt());return oe(c,e,"Cache")}if(St==="darwin"){const c=t?oe(t,"Library","Caches"):pt();return oe(c,e)}const o=et.XDG_CACHE_HOME??(t?oe(t,".cache"):pt());return oe(o,e)},ms=e=>{if(e.length===0)return;const t=e.map(r=>no(uo(r)).split(Rt));let o=Number.POSITIVE_INFINITY;for(const r of t)r.length<o&&(o=r.length);const c=[];for(let r=0;r<o;r+=1){const u=t[0][r];if(t.every(a=>a[r]===u))c.push(u);else break}const p=c.join(Rt);return p===""?Rt:p},Je=(e,t)=>{if(e!==void 0)return t?(...o)=>oe(e,...o):e},vs=e=>{if(e?.files&&e.files.length>0){const t=ms(e.files);if(t!==void 0)return t}return e?.cwd??bo()},As=e=>new Br(`No package.json found searching upwards from '${uo(e)}'.`),Et=e=>!_t(e,Wt)&&_t(e),Rs=(e,t)=>{if(et.CACHE_DIR&&!["0","1","false","true"].includes(et.CACHE_DIR)){const a=oe(et.CACHE_DIR,e);return t?.create&&Ee(a),Je(a,t?.thunk)}const o=vs(t),c=hr("package.json",{cwd:o,type:"file"});if(!c){if(t?.useGlobalCacheFallback){const a=zt(e);return t.create&&Ee(a),Je(a,t.thunk)}if(t?.throwError)throw As(o);return}const p=oe(ys(c),"node_modules"),r=oe(p,".cache"),u=oe(r,e);if(_t(u,Wt))return t?.create&&Ee(u),Je(u,t?.thunk);if(Et(u)||Et(r)||Et(p)){if(t?.useGlobalCacheFallback){const a=zt(e);return t.create&&Ee(a),Je(a,t.thunk)}return}return t?.create&&Ee(u),Je(u,t?.thunk)},Ts=Rs,Kt="@inherit",Es=["aliases","dependsOn","inputs","outputs"],_s=(e,t)=>{if(t===void 0)return e===void 0?void 0:[...e];if(!t.includes(Kt))return[...t];const o=[];for(const c of t){if(c===Kt){e!==void 0&&o.push(...e);continue}o.push(c)}return o},Cs=(e,t)=>{const o={...e,...t};for(const c of Es){const p=e?.[c],r=t?.[c],u=_s(p,r);u===void 0?delete o[c]:o[c]=u}return o};export{Cs as m,Ts as w};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as _}from"node:module";import{A as m,m as v,f as C,v as I}from"./index-2LCHaVNX.js";const y=_(import.meta.url),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=s=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[e,r]=h.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return h.getBuiltinModule(s)}return y(s)},{platform:T}=b("node:os"),x={server:{cache:!1,interactive:!1,persistent:!0,runInCI:!1},utility:{cache:!1,runInCI:!1}},A=s=>{const e=s.preset??s.options?.preset;if(!e)return s;const r=x[e];if(!r)return s;const{cache:n,...t}=r;return{...s,cache:s.cache??n,options:{...t,...s.options}}},j=()=>{const s=T();return s==="darwin"?"macos":s==="win32"?"windows":"linux"},R=(s,e)=>{if(!e||e.size===0)return!0;const r=s?.runnerTags;return!r||r.length===0?!0:r.some(n=>e.has(n))},k=(s,e,r=!0)=>{const n=s?.runInCI??!0;return n===!0||n==="always"?!0:n===!1?!e:n==="affected"?!e||r:!0},q=(s,e,r)=>r||!e?s:m(e)?e:v(s,e),B=(s,e)=>{if(e===!1)return{};const r=e===!0?$("production"):Array.isArray(e)?e:[e],n={};for(const t of r)Object.assign(n,O(s,t,n));return n},g=(s,e)=>{const r=t=>{const c=e[t];return c!==void 0?c:process.env[t]??""};let n="";for(let t=0;t<s.length;t+=1){const c=s[t];if(c==="\\"&&s[t+1]==="$"){n+="$",t+=1;continue}if(c!=="$"){n+=c;continue}const a=s[t+1];if(a==="{"){let o=1,l=t+2;for(;l<s.length;){const d=s[l];if(d==="}"){if(o-=1,o===0)break}else d==="{"&&s[l-1]==="$"&&(o+=1);l+=1}if(o!==0){n+=s.slice(t);break}const f=l,i=s.slice(t+2,f),u=i.indexOf(":-");if(u===-1)n+=r(i);else{const d=i.slice(0,u),w=i.slice(u+2),p=e[d]??process.env[d];n+=p!==void 0&&p!==""?p:g(w,e)}t=f;continue}if(a!==void 0&&/[A-Z_]/i.test(a)){let o=t+1;for(;o<s.length&&/\w/.test(s[o]);)o+=1;n+=r(s.slice(t+1,o)),t=o-1;continue}n+=c}return n},$=s=>{const e=[".env"];return s&&e.push(`.env.${s}`),s!=="test"&&e.push(".env.local"),s&&s!=="test"&&e.push(`.env.${s}.local`),e},O=(s,e,r={})=>{const n=m(e)?e:v(s,e);if(!C(n))return{};let t;try{t=I(n)}catch{return{}}const c={};for(const a of t.split(/\r?\n/)){const o=a.trim();if(o===""||o.startsWith("#"))continue;const l=o.indexOf("=");if(l===-1)continue;const f=o.slice(0,l).trim();if(f==="")continue;let i=o.slice(l+1).trim();const u=i.length>=2&&i.startsWith("'")&&i.endsWith("'");(i.startsWith('"')&&i.endsWith('"')||u)&&(i=i.slice(1,-1)),u||(i=g(i,{...r,...c})),c[f]=i}return c},F=(s,e=j())=>{if(s)return e==="windows"&&s.windowsShell?s.windowsShell:(e==="linux"||e==="macos")&&s.unixShell?s.unixShell:s.shell},M=s=>{if(s==="run")return!1;if(s==="build"||s==="test")return!0};export{F as a,M as b,A as c,j as d,B as l,R as m,q as r,k as s};
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import{createRequire as F}from"node:module";import{m as v,f as m,o as R,v as y}from"./index-2LCHaVNX.js";import{a as W}from"./readJsonSync-DuMMeB3s-B9cGBVbJ.js";const D=F(import.meta.url),w=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,M=o=>{if(typeof w<"u"&&w.versions&&w.versions.node){const[e,n]=w.versions.node.split(".").map(Number);if(e>22||e===22&&n>=3||e===20&&n>=16)return w.getBuiltinModule(o)}return D(o)},{execFileSync:x}=M("node:child_process"),{randomBytes:B}=M("node:crypto"),{writeFileSync:I,renameSync:U,unlinkSync:q}=M("node:fs"),{delimiter:J}=M("node:path"),H=["proto","mise","fnm","volta","asdf","nvm","corepack"],z={asdf:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],corepack:["npm","pnpm","yarn"],fnm:["node"],mise:["aube","bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],nvm:["node"],proto:["bun","deno","go","node","npm","pnpm","python","ruby","rust","yarn"],volta:["node","npm","pnpm","yarn"]},Z=["proto","mise","fnm","volta","asdf","nvm","corepack"],A={asdf:[".tool-versions"],corepack:[],fnm:[".nvmrc",".node-version"],mise:[".mise.toml",".config/mise.toml","mise.toml"],nvm:[".nvmrc"],proto:[".prototools"],volta:[]},$=new Map,h=o=>{const e=$.get(o);if(e!==void 0||$.has(o))return e;const n=process.env.PATH;if(!n){$.set(o,void 0);return}const t=process.platform==="win32"?["",...(process.env.PATHEXT??".COM;.EXE;.BAT;.CMD").split(";")]:[""];for(const r of n.split(J)){const i=r.replaceAll(/^["']|["']$/g,"").trim();if(i!=="")for(const l of t){const s=`${i}${R}${o}${l}`;if(m(s))return $.set(o,s),s}}$.set(o,void 0)},S=(o,e=["--version"])=>{try{const n=x(o,e,{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}),t=/\d+\.\d+(?:\.\d+)?/.exec(n);return t?t[0]:n.trim()||void 0}catch{return}},_=(o,e)=>{const n=v(o,"package.json");if(!m(n))return[];try{const t=W(n)[e];if(e==="volta"&&typeof t=="object"&&t!==null&&Object.keys(t).length>0)return["package.json"];if(e==="packageManager"&&typeof t=="string"&&t.length>0)return["package.json"]}catch{}return[]},X=(o,e)=>o==="volta"?_(e,"volta"):o==="corepack"?_(e,"packageManager"):A[o].filter(n=>m(v(e,n))),P=new Map,G=()=>{P.clear(),$.clear()},O=(o,e)=>{{const i=P.get(o);if(i)return i}const n=[],t=!!h("pnpm")||!!h("yarn");for(const i of Z){const l=i==="nvm"?void 0:h(i),s=i==="nvm"&&!!process.env.NVM_DIR,c=X(i,o),a=!!l||s;i==="corepack"&&!a&&(!(c.length>0)||t)||!a&&c.length===0||n.push({binPath:l,configFiles:c,installed:a,name:i,version:l?S(l):void 0})}const r=Object.freeze(n);return P.set(o,r),r},ve=(o,e,n)=>{const t=O(o);return e?.preferredManager&&e.preferredManager!=="none"?t.find(r=>r.name===e.preferredManager)??{configFiles:[],installed:!1,name:e.preferredManager}:t.find(r=>r.installed&&r.configFiles.length>0)??t.find(r=>r.installed)??t.find(r=>r.configFiles.length>0)??{configFiles:[],installed:!1,name:"none"}},L=(o,e)=>{for(const n of e){const t=v(o,n);if(m(t))try{const r=y(t).trim();if(r!=="")return{name:n,value:r.replace(/^v/,"")}}catch{}}},V=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,K=o=>{const e=v(o,".prototools");if(!m(e))return[];const n=y(e),t=[];let r=!1;for(const i of n.split(/\r?\n/)){const l=i.trim();if(l===""||l.startsWith("#"))continue;if(l.startsWith("[")){r=!0;continue}if(r)continue;const s=V.exec(l);if(!s)continue;const[,c,a]=s,p=g(c);p&&t.push({source:".prototools",tool:p,version:a.trim()})}return t},Y=/^\[tools\]\s*$/i,Q=/^([a-z][\w-]*)\s*=\s*"?([^"\n#]+?)"?\s*(?:#.*)?$/i,ee=o=>{for(const e of A.mise){const n=v(o,e);if(!m(n))continue;const t=[],r=y(n);let i=!1;for(const l of r.split(/\r?\n/)){const s=l.trim();if(s===""||s.startsWith("#"))continue;if(s.startsWith("[")){i=Y.test(s);continue}if(!i)continue;const c=Q.exec(s);if(!c)continue;const[,a,p]=c,d=g(a);d&&t.push({source:".mise.toml",tool:d,version:p.trim()})}if(t.length>0)return t}return[]},oe=o=>{const e=v(o,".tool-versions");if(!m(e))return[];const n=y(e),t=[];for(const r of n.split(/\r?\n/)){const i=r.trim();if(i===""||i.startsWith("#"))continue;const l=i.split(/\s+/);if(l.length<2)continue;const[s,...c]=l,a=g(s);a&&c[0]&&t.push({source:".tool-versions",tool:a,version:c[0]})}return t},g=o=>{switch(o.toLowerCase()){case"aube":return"aube";case"bun":return"bun";case"deno":return"deno";case"go":case"golang":return"go";case"node":case"nodejs":return"node";case"npm":return"npm";case"pnpm":return"pnpm";case"python":case"python3":return"python";case"ruby":return"ruby";case"rust":case"rustc":return"rust";case"yarn":return"yarn";default:return}},ne=o=>{const[e]=o.split("+",1),n=/^(pnpm|yarn|npm|bun)@(.+)$/.exec(e??"");if(!n)return;const t=g(n[1]);if(t)return{source:"packageManager",tool:t,version:n[2]}},te=(o,e)=>{const n=new Map,t=s=>{n.set(s.tool,s)},r=v(o,"package.json");let i={};try{m(r)&&(i=W(r))}catch{}if(i.engines)for(const[s,c]of Object.entries(i.engines)){const a=g(s);a&&typeof c=="string"&&t({source:"engines",tool:a,version:c})}if(i.packageManager){const s=ne(i.packageManager);s&&t(s)}if(i.volta)for(const[s,c]of Object.entries(i.volta)){const a=g(s);a&&typeof c=="string"&&t({source:"volta",tool:a,version:c})}const l=L(o,[".nvmrc",".node-version"]);l&&t({source:l.name===".nvmrc"?".nvmrc":".node-version",tool:"node",version:l.value});for(const s of oe(o))t(s);for(const s of ee(o))t(s);for(const s of K(o))t(s);if(e?.tools)for(const[s,c]of Object.entries(e.tools)){const a=g(s);a&&typeof c=="string"&&t({source:"vis.config.ts",tool:a,version:c})}return[...n.values()]},T={aube:{args:["--version"],binaries:["aube"]},bun:{args:["--version"],binaries:["bun"]},deno:{args:["--version"],binaries:["deno"]},go:{args:["version"],binaries:["go"]},node:{args:["--version"],binaries:["node"]},npm:{args:["--version"],binaries:["npm"]},pnpm:{args:["--version"],binaries:["pnpm"]},python:{args:["--version"],binaries:["python","python3"]},ruby:{args:["--version"],binaries:["ruby"]},rust:{args:["--version"],binaries:["rustc"]},yarn:{args:["--version"],binaries:["yarn"]}},E=o=>{const e=T[o];for(const n of e.binaries){const t=h(n);if(t)return S(t,e.args)}if(o==="node")return process.versions.node},N=(o,e)=>{const n=e.trim();if(n===""||n==="*"||n==="latest")return!0;if(/^\d[\d.]*$/.test(n))return o===n||o.startsWith(`${n}.`);const t=s=>s.split(/[.\-+]/).map(c=>Number.parseInt(c,10)||0),r=(s,c)=>{const a=t(s),p=t(c),d=Math.max(a.length,p.length);for(let f=0;f<d;f++){const b=a[f]??0,u=p[f]??0;if(b!==u)return b-u}return 0},i=s=>{for(const c of s)if(c.startsWith(">=")){if(r(o,c.slice(2).trim())<0)return!1}else if(c.startsWith("<=")){if(r(o,c.slice(2).trim())>0)return!1}else if(c.startsWith(">")){if(r(o,c.slice(1).trim())<=0)return!1}else if(c.startsWith("<")){if(r(o,c.slice(1).trim())>=0)return!1}else if(c.startsWith("^")||c.startsWith("~")){const a=c.slice(1).trim(),[p,d]=t(a),[f,b]=t(o);if(f!==p||c.startsWith("~")&&b!==d||r(o,a)<0)return!1}return!0},l=n.split("||").map(s=>s.trim().split(/\s+/).filter(Boolean)).filter(s=>s.length>0);return l.length===0?!0:l.some(s=>i(s))},re=(o,e)=>{switch(o){case".mise.toml":return["mise"];case".node-version":case".nvmrc":return["fnm","nvm","volta","proto","mise","asdf"];case".prototools":return["proto"];case".tool-versions":return["asdf","mise"];case"packageManager":return e==="pnpm"||e==="yarn"?["self-activate","volta","proto","mise","corepack"]:e==="npm"?["volta","proto","mise","asdf","corepack"]:e==="aube"?["mise"]:e==="bun"?["proto","mise","asdf"]:["volta","proto","mise"];case"volta":return["volta"];default:return["proto","mise","fnm","volta","asdf","nvm","corepack"]}},se=(o,e,n)=>{if(n?.preferredManager&&n.preferredManager!=="none"&&j(n.preferredManager,o.tool)){const r=e.find(i=>i.name===n.preferredManager);return r?{installed:r.installed,name:r.name}:{installed:!1,name:n.preferredManager,note:`${n.preferredManager} is the preferred manager but isn't on PATH`}}const t=re(o.source,o.tool);for(const r of t){if(r==="self-activate"){if((o.tool==="pnpm"||o.tool==="yarn")&&h(o.tool))return{installed:!0,name:"self-activate",note:`${o.tool} will activate ${o.version} from the packageManager field on next invocation`};continue}if(j(r,o.tool)&&e.find(i=>i.name===r)?.installed)return{installed:!0,name:r}}for(const r of t)if(!(r==="self-activate"||!j(r,o.tool)))return{installed:!1,name:r,note:`${r} can install ${o.tool} — run \`vis toolchain install\` after adding it to PATH`};return{installed:!1,name:"none",note:"No manager knows how to install this tool"}},j=(o,e)=>o==="none"?!1:o==="self-activate"?e==="pnpm"||e==="yarn":z[o].includes(e),ie=(o,e)=>{const n=O(o),t=te(o,e).map(r=>{const i=E(r.tool),l=i!==void 0&&N(i,r.version),s=se(r,n,e);return{actual:i,expected:r,manager:s,matches:l}});return{detected:n,tools:t}},ae=(o,e)=>{switch(o){case"asdf":return e?{args:["install",e.tool,e.version],bin:"asdf"}:void 0;case"corepack":return e?{args:["prepare",`${e.tool}@${e.version}`,"--activate"],bin:"corepack"}:{args:["prepare","--activate"],bin:"corepack",hint:"reads the packageManager field in package.json"};case"fnm":return e?.tool!=="node"?void 0:{args:["install",e.version],bin:"fnm"};case"mise":return e?{args:["install",`${e.tool}@${e.version}`],bin:"mise"}:void 0;case"none":return;case"nvm":return{args:[],bin:"nvm",hint:"nvm is a shell function — run `nvm install` / `nvm use` from your shell"};case"proto":return e?{args:["install",e.tool,e.version],bin:"proto"}:void 0;case"self-activate":return{args:[],bin:e?.tool??"pnpm",hint:`${e?.tool??"pnpm"} will self-activate on next invocation — no install needed`};case"volta":return e?{args:["install",`${e.tool}@${e.version}`],bin:"volta"}:{args:["install","node@lts"],bin:"volta",hint:"volta pins per-tool; specify <tool>@<version>"};default:{const n=o;throw new Error(`Unknown manager: ${n}`)}}},de=(o,e)=>{switch(o){case"asdf":return{args:["local",e.tool,e.version],bin:"asdf",configChange:{file:".tool-versions",hint:`Pins ${e.tool} ${e.version}`}};case"corepack":return e.tool!=="npm"&&e.tool!=="pnpm"&&e.tool!=="yarn"?void 0:{args:["use",`${e.tool}@${e.version}`],bin:"corepack",configChange:{file:"package.json",hint:`Writes packageManager: "${e.tool}@${e.version}"`}};case"fnm":return e.tool==="node"?{args:["use",e.version],bin:"fnm"}:void 0;case"mise":return{args:["use","--",`${e.tool}@${e.version}`],bin:"mise",configChange:{file:".mise.toml",hint:`Pins ${e.tool} ${e.version}`}};case"none":return;case"nvm":return e.tool==="node"?{args:[],bin:"nvm",configChange:{file:".nvmrc",hint:"Write version to .nvmrc manually (nvm doesn't persist)."}}:void 0;case"proto":return{args:["pin",e.tool,e.version],bin:"proto",configChange:{file:".prototools",hint:`Pins ${e.tool} ${e.version}`}};case"self-activate":return{args:[],bin:e.tool,configChange:{file:"package.json",hint:`Set packageManager: "${e.tool}@${e.version}" — ${e.tool} will self-activate on next invocation`}};case"volta":return{args:["pin",`${e.tool}@${e.version}`],bin:"volta",configChange:{file:"package.json",hint:`Writes volta.${e.tool}`}};default:{const n=o;throw new Error(`Unknown manager: ${n}`)}}},ge=o=>{for(const e of T[o].binaries){const n=h(e);if(n)return n}},he=(o,e)=>{const n=T[e].binaries;if(o.installed&&o.binPath&&(o.name==="proto"||o.name==="mise"||o.name==="asdf"||o.name==="volta"||o.name==="fnm"))for(const t of n)try{const r=x(o.binPath,["which",t],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3}).trim();if(r)return r}catch{}for(const t of n){const r=h(t);if(r)return r}},C=(o,e)=>{const n=`${o}.${process.pid}.${B(6).toString("hex")}.tmp`;I(n,e);try{U(n,o)}catch(t){try{q(n)}catch{}throw t}},ce=(o,e)=>{if("packageManager"in o)return o.packageManager=e,o;const n={};let t=!1;for(const[r,i]of Object.entries(o))!t&&(r==="dependencies"||r==="devDependencies"||r==="peerDependencies"||r==="optionalDependencies")&&(n.packageManager=e,t=!0),n[r]=i;return t||(n.packageManager=e),n},be=(o,e)=>{if(e.tool!=="pnpm"&&e.tool!=="yarn"&&e.tool!=="npm"&&e.tool!=="bun")return;const n=v(o,"package.json");if(!m(n))throw new Error(`Cannot pin ${e.tool}: ${n} does not exist.`);const t=y(n),r=/\n([ \t]+)/.exec(t)?.[1]??" ";let i;try{i=JSON.parse(t)}catch(a){throw new Error(`${n} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${a.message}`,{cause:a})}const l=`${e.tool}@${e.version}`,s=ce(i,l),c=t.endsWith(`
|
|
2
|
-
`)?`
|
|
3
|
-
`:"";return C(n,`${JSON.stringify(s,void 0,r)}${c}`),l},$e=(o,e)=>{const n=v(o,"package.json");if(!m(n))return;const t=y(n);let r;try{r=JSON.parse(t)}catch(s){throw new Error(`${n} is not valid JSON — fix it before running \`vis toolchain use\`. Underlying error: ${s.message}`,{cause:s})}if(r.engines?.[e.tool]===void 0||r.engines[e.tool]===e.version)return;r.engines[e.tool]=e.version;const i=/\n([ \t]+)/.exec(t)?.[1]??" ",l=t.endsWith(`
|
|
4
|
-
`)?`
|
|
5
|
-
`:"";return C(n,`${JSON.stringify(r,void 0,i)}${l}`),e.version},ye=o=>{const e=/^([a-z][\w-]*)@(.+)$/i.exec(o.trim());if(!e)return;const n=g(e[1]);if(n)return{source:"vis.config.ts",tool:n,version:e[2]}},le=async(o,e,n)=>{const t=ie(o,e),r=t.tools.filter(a=>!a.matches);if(r.length===0)return{attempted:[],failed:[],upToDate:!0};const i=t.detected.some(a=>a.installed);if(!(e?.autoInstall??i))return{attempted:[],failed:[],upToDate:!1};const l=[],s=[],c=new Map;for(const a of r){const p=c.get(a.manager.name);p?p.push(a):c.set(a.manager.name,[a])}for(const[a,p]of c){if(a==="self-activate"){for(const{expected:f}of p)n.info(`toolchain: ${f.tool} ${f.version} will self-activate on next ${f.tool} invocation`),l.push(f);continue}if(a==="none"){for(const{expected:f}of p)s.push({error:`no manager can install ${f.tool} — install one of ${H.join(", ")}`,spec:f});continue}if(!t.detected.find(f=>f.name===a)?.installed){for(const{expected:f}of p)s.push({error:`${a} is not on PATH`,spec:f});continue}const d=p.map(f=>({invocation:ae(a,f.expected),tool:f})).filter(f=>f.invocation!==void 0);for(const{invocation:f,tool:b}of d){const{expected:u}=b;if(f.bin==="nvm"&&f.args.length===0){const k=E(u.tool);if(k!==void 0&&N(k,u.version)){n.info(`toolchain: ${u.tool} ${k} already satisfies ${u.version}; skipping nvm shell activation`),l.push(u);continue}n.warn(`toolchain: nvm requires a shell-side activation for ${u.tool} ${u.version}. Run \`nvm install\` / \`nvm use\` manually.`),s.push({error:"nvm requires shell-side activation",spec:u});continue}n.info(`toolchain: $ ${f.bin} ${f.args.join(" ")}`);try{x(f.bin,f.args,{cwd:o,stdio:"inherit"}),l.push(u),a==="fnm"&&fe(f.bin,n)}catch(k){s.push({error:k.message,spec:u});break}}}return G(),{attempted:l,failed:s,upToDate:!1}},ke=async(o,e,n,t=!1)=>{if(t)return;const r=await le(o,e,n);for(const i of r.failed)n.warn(`toolchain: ${i.spec.tool} ${i.spec.version} — ${i.error}`)},fe=(o,e)=>{const n=process.platform==="win32"?"powershell":"bash";try{const t=x(o,["env","--shell",n],{encoding:"utf8",stdio:["ignore","pipe","ignore"],timeout:2e3});for(const r of t.split(/\r?\n/)){const i=r.trim();if(i==="")continue;const l=/^\$env:([A-Z_]\w*)\s*=\s*(.+)$/i.exec(i);if(l){const[,a,p]=l;process.env[a]=p.replaceAll(/^["']|["']$/g,"");continue}const s=/^set\s+"?([A-Z_]\w*)=(.*?)"?$/i.exec(i);if(s){const[,a,p]=s;process.env[a]=p;continue}const c=/^(?:export\s+)?([A-Z_]\w*)=(.+)$/i.exec(i);if(c){const[,a,p]=c;process.env[a]=p.replaceAll(/^["']|["']$/g,"")}}}catch(t){e.warn(`toolchain: could not activate fnm env (${t.message}). Subsequent tasks may use the previous Node version.`)}};export{H as S,ye as a,ae as b,se as c,de as d,he as e,O as f,ie as g,ge as h,ve as p,ke as r,$e as u,be as w};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as q}from"node:module";import{V as j,s as b}from"./index.server-qvZ-cy29.js";import{m as M,f as T}from"./index-2LCHaVNX.js";import{g as A}from"./_commonjsHelpers-B5Y90VFO.js";import{i as g,p as c}from"../packem_chunks/cli-main.js";import{a as C}from"./readJsonSync-DuMMeB3s-B9cGBVbJ.js";const $=q(import.meta.url),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,z=e=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[s,r]=d.versions.node.split(".").map(Number);if(s>22||s===22&&r>=3||s===20&&r>=16)return d.getBuiltinModule(e)}return $(e)},{createInterface:_}=z("node:readline");var D=["aj","aju","av","avj","ejv","jav","jv"],O=["angula","angular-node","angularjs"],N=["auto-prefixer"],R=["aaxios","aios","axio","axioos","axios-node","axioss","axis","axiso","axois","axos","axxios"],S=["abel","babbel","babe","babel-js","babel-node","babl","bable","bbael","bebel"],B=["bcrpyt","bcrypt-node","brcypt","crypt","dcrypt"],F=["bcryptjs-node","dcryptjs"],P=["bunan","bunya","bunyan-node","buynan"],W=["cai","cha","chaijs","chal","chi","chia","hai"],E=["cahlk","calk","cchalk","ch4lk","cha1k","chaalk","chaik","chak","chakl","chalk-node","chalkk","challk","chhalk","chlak","chlk","halk","hcalk"],L=["cheero","cherio"],U=["c0lor","ccolor","clor","colo","coloor","color-js","colorjs","colorr","colr","coolor","coolr"],V=["ccolors","colors-node","colorss","colorz","colrs","coolors"],I=["c0mmander","ccommander","cmmander","cmomander","co-mmander","comamnder","comander","comm4nder","commaander","commader","commadner","commamder","command3r","commandder","commande","commandeer","commander-js","commanderr","commandr","commandre","commanedr","commaner","commannder","commender","commmander","commnader","commnder","coommander","ocmmander","ommander"],Y=["cor","corss","cos","cosr","cros","crs","ors"],G=["days"],H=["d3bug","dbeug","dbug","ddebug","debbug","debg","debgu","debu","debu9","debug-js","debug-node","debugg","debugjs","debuug","deebug","deubg","deug","ebug","edbug"],J=["dot-env","dotenv-node","dotenvjs","dotevn"],K=["3lectron","eectron","eelctron","eelectron","el3ctron","elcetron","elctron","elecctron","elecron","elecrton","electon","electorn","electr0n","electrn","electrno","electro","electrom","electron-node","electronn","electroon","electrron","electtron","eleectron","eletcron","eletron","ellectron","lectron","leectron"],Q=["asbuild","ebuild","esbuild-node","esbuildjs","ezbuild","sbuild"],X=["aslint","elint","eslint-js","eslint-node","eslit","ezlint","slint"],Z=["eexpress","epress","epxress","experss","expess","exppress","expreess","expres","express-node","expressjs","expresss","exprress","exprses","exprss","exress","exrpess","exxpress","xepress","xpress"],ee=["astify"],oe=["firebasejs"],se=["form1dable"],re=["glb","glo","glob-js","globjs","gob","golb","lob"],ae=["go","goot","gotjs","gott","gt","gto","ogt","ot","qot"],te=["helmetjs","helnet"],ne=["homo","hon","hoo","hoon","ohno","ono"],ce=["inquire","inquirer-js","nquirer"],ie=["iredis"],de=["ejst","est","jast","jes","jestjs","jestt","jet","jets","jst"],me=["imp","jim","jip","jmp"],le=["ji","jio","jo","joii","jol","oi","oji"],pe=["jdom","jsdm","jsdo","jsdom-js","jsdon","jsom","sdom"],ue=["jsonwebtoken-js","jsonwebtoken-node"],ve=["ka","kao","ko","koaa","koajs","koe","oa","oka"],he=["1odash","iodash","l0dash","ldash","ldoash","llodash","lo-dash","loadsh","loash","lobash","lod4sh","lodaash","lodah","lodahs","lodas","lodash-node","lodashh","lodassh","loddash","lodesh","lodsah","lodsh","loodash","odash","oldash"],je=["luca","luci","lucie"],be=["luon","luxo","luxon-js"],ke=["imcromatch","mciromatch","micormatch","micrmoatch","micro-match","microamtch","micromacth","micromathc","micromtach","mircomatch"],ge=["minimath"],fe=["mcha","mmocha","moca","moch","mocha-js","moha","nocha","ocha"],ye=["m0ment","mment","mmoent","mmoment","moemnt","moent","mom3nt","momeent","momemt","momen","momen7","momennt","moment-js","momentjs","momentt","momet","mometn","momment","momnet","momnt","monent","mooment","oment","omment"],xe=["mognoose","mogoose","mongoos","mongose","monqoose","moongoose"],we=["moran","organ"],qe=["muler","multer-js","muter"],$e=["mysql"],ze=["ext","mext","n3xt","naxt","net","netx","nex","next-js","next-node","nextjs","nxt"],_e=["node-mailer","nodemailer-js"],Me=["nodemo","nodemonjs","nodmeon"],Te=["oar","or","ora-node","ore","ra","roa"],Ae=["arcel","parce","parceljs"],Ce=["passport-js"],De=["phase","phaser-node"],Oe=["ino","pimo","pin","pino-node","pinojs","pio","pion"],Ne=["playright","playwright-js"],Re=["postcss-js","postcss-node","potscss"],Se=["pettier","pprettier","pretier","prettierjs","prettierr","prtetier"],Be=["prima","prism","prisma-js","prismajs","prizma"],Fe=["pupeteer"],Pe=["rada","rama","ramd","randa"],We=["eact","eract","r3act","raact","ract","raect","re4ct","reaact","reac","reac7","reacct","react-node","reactjs","reactt","reat","reatc","recat","rect","reeact","reect","rreact"],Ee=["erdis","radis","rdis","redi","redis-js","redis-node","rediss","rediz","reds","reis","rredis"],Le=["resen","rsend"],Ue=["ollup","rollup-js","rollup-node"],Ve=["ass","asss","sas","sass-node","sess","ssas","sss"],Ie=["emver","seemver","semver-node","semvre","senver","sever"],Ye=["sequelize-js","sequelize-node"],Ge=["harp","shap","shar","sharp-js","sharpjs"],He=["stipe","strip","stripe-node","tripe"],Je=["supabase-js"],Ke=["suelte","svelt3","svelte-js","sveltejs","velte"],Qe=["tailwindcss-js"],Xe=["auri","taui"],Ze=["hree","htree","thee","there","three-js","three-node","tree"],eo=["stx","sx","ts","tsxx","ttsx","tx","txs","tzx"],oo=["ttypescript","typecript","typescipt","typescript-node","typescriptjs","typescrit","typescritp"],so=["udnerscore","undercore","underscoer","underscore-node","underscroe","undersocre","undesrcore"],ro=["uid","uud","uudi","uui","uuid-js","uuid-node","uuidjs","vuid"],ao=["ite","vie","vit","vita","vite-node","vitee","vlte","vte"],to=["itest","uitest","vitestjs","vitezt","vittest","vtest"],no=["ue","uue","uve","ve","veu","vu","vu3","vua","vue-node","vuee","vuejs","vuue","vve","vvue"],co=["web-pack","weback","webpac","webpack-node","webpackjs","webpak","weebpack","wepack","wepback"],io=["winson","winston-js","winstoon"],mo=["up","uyp","yp","yu","yupjs","yupp"],lo=["od","zd","zdo","zo","zob","zod-js","zodjs"];const po={ajv:D,angular:O,autoprefixer:N,"aws-sdk":["awssdk","ews-sdk"],axios:R,babel:S,bcrypt:B,bcryptjs:F,"body-parser":["body-paresr","body-parse","body-parser-js","body_parser"],bunyan:P,chai:W,chalk:E,cheerio:L,color:U,colors:V,commander:I,"cookie-parser":["cookie-parse","cookieparser"],cors:Y,"cross-env":["crossenv"],"date-fns":["data-fns","date-fn"],dayjs:G,debug:H,dotenv:J,electron:K,esbuild:Q,eslint:X,express:Z,fastify:ee,firebase:oe,formidable:se,glob:re,got:ae,helmet:te,hono:ne,inquirer:ce,ioredis:ie,jest:de,jimp:me,joi:le,jsdom:pe,jsonwebtoken:ue,koa:ve,lodash:he,lucia:je,luxon:be,micromatch:ke,minimatch:ge,mocha:fe,moment:ye,mongoose:xe,morgan:we,multer:qe,mysql2:$e,next:ze,"node-fetch":["node-fecth","node-fethc","node.fetch"],nodemailer:_e,nodemon:Me,ora:Te,parcel:Ae,passport:Ce,phaser:De,pino:Oe,playwright:Ne,postcss:Re,prettier:Se,prisma:Be,puppeteer:Fe,ramda:Pe,react:We,"react-dom":["eact-dom","eract-dom","r3act-dom","ract-dom","raect-dom","re4ct-dom","reaact-dom","reac-dom","reac7-dom","reacct-dom","react-bom","react-d0m","react-ddom","react-dm","react-dmo","react-do","react-domm","react-don","react-doom","react-odm","react-om","react.dom","reactdom","reactt-dom","reat-dom","reatc-dom","recat-dom","rect-dom","reeact-dom","rreact-dom"],redis:Ee,resend:Le,rollup:Ue,sass:Ve,semver:Ie,sequelize:Ye,sharp:Ge,"socket.io":["ocket.io","oscket.io","scket.io","scoket.io","soccket.io","socekt.io","socet.io","sock3t.io","socke.io","socke7.io","sockeet.io","socket.1o","socket.i","socket.iio","socket.ioo","socket.lo","socket.o","socket.oi","sockett.io","sockket.io","sockt.io","sockte.io","sokcet.io","soket.io","soocket.io","ssocket.io"],stripe:He,supabase:Je,svelte:Ke,tailwindcss:Qe,tauri:Xe,three:Ze,"ts-node":["tts-node"],tsx:eo,typescript:oo,underscore:so,uuid:ro,vite:ao,vitest:to,vue:no,webpack:co,winston:io,yup:mo,zod:lo};var u,k;function uo(){return k||(k=1,u={"@tanstack/start":["start-tanstack-app","tanstack","tanstack-app","tanstack-start"]}),u}var vo=uo();const ho=A(vo),jo={a:["4","e"],b:["d"],d:["b"],e:["3","a"],g:["9","q"],i:["1","l"],l:["1","i"],m:["n"],n:["m"],o:["0"],s:["5","z"],t:["7"],u:["v"],v:["u"]},bo=["app","cli","core","kit","lib","pkg","sdk"],ko=e=>{const s=new Set;if(e.length<3)return s;for(let o=0;o<e.length;o++){const a=e[o],t=a==="-"||a==="."||a==="_";if(t||s.add(e.slice(0,o)+e.slice(o+1)),t||s.add(e.slice(0,o)+a+e.slice(o)),o<e.length-1&&e[o]!==e[o+1]){const p=e[o+1]==="-"||e[o+1]==="."||e[o+1]==="_";if(!t&&!p){const i=[...e];[i[o],i[o+1]]=[i[o+1],i[o]],s.add(i.join(""))}}const n=e[o].toLowerCase(),h=jo[n];if(h)for(const p of h)s.add(e.slice(0,o)+p+e.slice(o+1))}const r=/[-._]/g;if(r.test(e))s.add(e.replaceAll(r,"")),s.add(e.replaceAll(r,"-")),s.add(e.replaceAll(r,".")),s.add(e.replaceAll(r,"_"));else if(e.length>5)for(let o=2;o<e.length-2;o++)s.add(`${e.slice(0,o)}-${e.slice(o)}`),s.add(`${e.slice(0,o)}.${e.slice(o)}`),s.add(`${e.slice(0,o)}_${e.slice(o)}`);if(e.startsWith("@")||(s.add(`${e}-js`),s.add(`${e}js`),s.add(`${e}-node`)),e.startsWith("@")){const o=e.indexOf("/");if(o>1&&o<e.length-1){const a=e.slice(1,o),t=e.slice(o+1);a.length>=3&&s.add(a);for(const n of["","-",".","_"])s.add(`${a}${n}${t}`),s.add(`${t}${n}${a}`);for(const n of bo)s.add(`${a}-${n}`),s.add(`${t}-${a}-${n}`),s.add(`${n}-${a}-${t}`)}}return s.delete(e),s};let v,l,m;const f=()=>{if(!v){const e={};for(const s of[po,ho])for(const[r,o]of Object.entries(s)){const a=e[r]??(e[r]=[]);for(const t of o)a.includes(t)||a.push(t)}v=e}return v},go=()=>{if(!l){l=new Map;for(const[e,s]of Object.entries(f()))for(const r of s)l.set(r,e)}return l},fo=()=>{if(!m){m=new Map;for(const e of Object.keys(f()))for(const s of ko(e))m.has(s)||m.set(s,e)}return m},yo=e=>e.startsWith("@")?e.split("/")[1]??e:e,xo=e=>{const s=yo(e),r=go().get(s);if(r)return{input:e,legitimate:r,method:"blocklist"};const o=fo().get(s);if(o)return{input:e,legitimate:o,method:"heuristic"}},y=(e,s)=>{const r=s?new Set(s):void 0,o=[];for(const a of e){if(r?.has(a))continue;const t=xo(a);t&&o.push(t)}return o},x=(e,s)=>{c.warn(""),c.warn(j(`Possible typosquat${e.length===1?"":"s"} ${s}:`));for(const r of e){const o=r.method==="blocklist"?"known typosquat":"similar name";c.warn(` ${b("⚠")} ${j(r.input)} — did you mean ${b(r.legitimate)}? (${o})`)}c.warn("")},w=async e=>{if(!process.stdin.isTTY){c.warn("Aborting: potential typosquat detected in non-interactive mode. Use --no-typosquat-check to skip.");return}const s=_({input:process.stdin,output:process.stdout}),r=await new Promise(o=>{s.question(e,a=>{o(a.trim().toLowerCase())})});return s.close(),r},Do=async(e,s)=>{if(g("typosquats"))return{ok:!0,packages:e};const r=y(e,s);if(r.length===0)return{ok:!0,packages:e};x(r,"detected");const o=await w(`Use suggested package${r.length===1?"":"s"} instead? [S]uggested / [y]es, keep original / [N]o, abort (default: N) `);if(o===void 0)return{ok:!1,packages:e};if(o==="s"||o==="suggested"){const a=new Map(r.map(t=>[t.input,t.legitimate]));return{ok:!0,packages:e.map(t=>a.get(t)??t)}}return o==="y"||o==="yes"?{ok:!0,packages:e}:{ok:!1,packages:e}},wo=/^(?:npm|pnpm|yarn):(.+?)(?:@.*)?$/,qo=e=>wo.exec(e)?.[1],$o=e=>{if(!T(e))return[];const s=C(e),r={...s.dependencies,...s.devDependencies,...s.optionalDependencies,...s.peerDependencies},o=new Set;for(const[a,t]of Object.entries(r)){o.add(a);const n=qo(t);n&&o.add(n)}return[...o]},Oo=async(e,s)=>{if(g("typosquats"))return!0;const r=M(e,"package.json"),o=$o(r);if(o.length===0)return!0;const a=y(o,s);if(a.length===0)return!0;x(a,"in package.json dependencies"),c.warn("Fix the package name in package.json before proceeding.");const t=await w("Continue anyway? [y/N] ");return t==="y"||t==="yes"};export{Do as r,Oo as s};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as g}from"node:module";import{m as i,f as a,v as d,u as j}from"./index-2LCHaVNX.js";import"./public-api-WqUCiyIe.js";const h=g(import.meta.url),p=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=c=>{if(typeof p<"u"&&p.versions&&p.versions.node){const[s,o]=p.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return p.getBuiltinModule(c)}return h(c)},{readdirSync:m}=u("node:fs"),b=[".husky/pre-commit",".vis/hooks/pre-commit",".git/hooks/pre-commit"],v=[".secretlintrc",".secretlintrc.json",".secretlintrc.js",".secretlintrc.mjs",".secretlintrc.cjs",".secretlintrc.yml",".secretlintrc.yaml"],$=[".syncpackrc",".syncpackrc.json",".syncpackrc.yaml",".syncpackrc.yml",".syncpackrc.cjs",".syncpackrc.js",".syncpackrc.mjs",".syncpackrc.ts","syncpack.config.cjs","syncpack.config.js","syncpack.config.mjs","syncpack.config.ts"],w=c=>{const s=i(c,"package.json");if(!a(s))return[];let o;try{o=JSON.parse(d(s))}catch{return[]}const e=[];if(o.scripts)for(const[t,n]of Object.entries(o.scripts))typeof n=="string"&&(/\bgitleaks\b/.test(n)&&e.push({detail:`Script "${t}" still invokes gitleaks: ${n}`,kind:"script",location:"package.json",tool:"gitleaks"}),/\bsecretlint\b/.test(n)&&e.push({detail:`Script "${t}" still invokes secretlint: ${n}`,kind:"script",location:"package.json",tool:"secretlint"}),/\bsyncpack\b/.test(n)&&e.push({detail:`Script "${t}" still invokes syncpack: ${n}`,kind:"script",location:"package.json",tool:"syncpack"}),/\bsherif\b/.test(n)&&e.push({detail:`Script "${t}" still invokes sherif: ${n}`,kind:"script",location:"package.json",tool:"sherif"}));if(o.devDependencies)for(const t of Object.keys(o.devDependencies))(t==="gitleaks"||t==="@gitleaks/cli")&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"gitleaks"}),(t==="secretlint"||t.startsWith("@secretlint/"))&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"secretlint"}),t==="syncpack"&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"syncpack"}),t==="sherif"&&e.push({detail:`devDependency \`${t}\` is still installed`,kind:"devDep",location:"package.json",tool:"sherif"});return o.sherif&&e.push({detail:"`sherif` config block still present in package.json",kind:"config",location:"package.json",tool:"sherif"}),e},_=c=>{const s=[];for(const o of b){const e=i(c,o);if(!a(e))continue;const t=d(e);/\bgitleaks\b/.test(t)&&s.push({detail:"gitleaks invocation still present in hook",kind:"hook",location:o,tool:"gitleaks"}),/\bsecretlint\b/.test(t)&&s.push({detail:"secretlint invocation still present in hook",kind:"hook",location:o,tool:"secretlint"}),/\bsyncpack\b/.test(t)&&s.push({detail:"syncpack invocation still present in hook",kind:"hook",location:o,tool:"syncpack"}),/\bsherif\b/.test(t)&&s.push({detail:"sherif invocation still present in hook",kind:"hook",location:o,tool:"sherif"})}return s},D=c=>{const s=[];for(const o of v)a(i(c,o))&&s.push({detail:"secretlint config should be removed after migration",kind:"config",location:o,tool:"secretlint"});for(const o of $)a(i(c,o))&&s.push({detail:"syncpack config should be removed after migration",kind:"config",location:o,tool:"syncpack"});return s},S=[".github/workflows",".gitlab-ci.yml",".circleci/config.yml",".woodpecker.yml",".drone.yml"],O=c=>{const s=[],o=e=>{const t=i(c,e);if(!a(t))return;const n=d(t);/\bsyncpack\b/.test(n)&&s.push({detail:"syncpack invocation still present in CI",kind:"ci",location:e,tool:"syncpack"}),/\bsherif\b/.test(n)&&s.push({detail:"sherif invocation still present in CI",kind:"ci",location:e,tool:"sherif"})};for(const e of S){const t=i(c,e);if(a(t)){if(e===".github/workflows"){try{for(const n of m(t))(n.endsWith(".yml")||n.endsWith(".yaml"))&&o(`.github/workflows/${n}`)}catch{}continue}o(e)}}return s},M=c=>{const s=[],o=i(c,"pnpm-workspace.yaml");if(a(o)){let t;try{t=j(o)}catch{t=void 0}if(t&&typeof t=="object"){const n=t.catalog;n&&typeof n.syncpack=="string"&&s.push({detail:"`syncpack` still listed in pnpm-workspace.yaml#catalog",kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"});const l=t.catalogs;if(l&&typeof l=="object")for(const[k,r]of Object.entries(l))r&&typeof r.syncpack=="string"&&s.push({detail:`\`syncpack\` still listed in pnpm-workspace.yaml#catalogs.${k}`,kind:"catalog",location:"pnpm-workspace.yaml",tool:"syncpack"})}}const e=i(c,"package.json");if(a(e)){let t;try{t=JSON.parse(d(e))}catch{return s}const n=t.workspaces;if(n&&typeof n=="object"&&!Array.isArray(n)){const k=n.catalog;k&&typeof k.syncpack=="string"&&s.push({detail:"`syncpack` still listed in package.json#workspaces.catalog",kind:"catalog",location:"package.json",tool:"syncpack"});const r=n.catalogs;if(r&&typeof r=="object")for(const[y,f]of Object.entries(r))f&&typeof f.syncpack=="string"&&s.push({detail:`\`syncpack\` still listed in package.json#workspaces.catalogs.${y}`,kind:"catalog",location:"package.json",tool:"syncpack"})}const l=t.catalog;l&&typeof l.syncpack=="string"&&s.push({detail:"`syncpack` still listed in package.json#catalog",kind:"catalog",location:"package.json",tool:"syncpack"})}return s},N=c=>[...w(c),..._(c),...D(c),...O(c),...M(c)],W=(c,s)=>{const o=N(c);if(o.length===0)return s.info("✓ No unmigrated gitleaks/secretlint/sherif/syncpack references found."),[];s.warn(`Found ${String(o.length)} unmigrated reference(s):`);for(const e of o)s.warn(` [${e.kind}] ${e.location} — ${e.detail}`);return o};export{N as s,W as v};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
import{createRequire as b}from"node:module";import{B as v,H as T,y as W}from"./index-2LCHaVNX.js";import{p as h}from"../packem_chunks/cli-main.js";const $=b(import.meta.url),m=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,p=a=>{if(typeof m<"u"&&m.versions&&m.versions.node){const[n,o]=m.versions.node.split(".").map(Number);if(n>22||n===22&&o>=3||n===20&&o>=16)return m.getBuiltinModule(a)}return $(a)},{watch:y}=p("node:fs"),{execFileSync:j}=p("node:child_process"),{createRequire:S}=p("node:module"),_=S(import.meta.url);let w;const k=()=>{if(w!==void 0)return w;try{_.resolve("fb-watchman")}catch{return w=!1,!1}try{j("watchman",["--version"],{stdio:"ignore",timeout:2e3})}catch{return w=!1,!1}return w=!0,!0},q=(a,n)=>{if(!k())return;let o;try{o=_("fb-watchman")}catch(s){h.warn(`[vis watch] fb-watchman failed to load, using native watcher: ${s.message}`);return}const c=new o.Client;c.on("error",s=>{h.warn(`[vis watch] watchman error: ${s.message}`)}),c.on("subscription",s=>{const t=s;if(!t.is_fresh_instance)for(const e of t.files??[])n(e)});for(const[s,t]of a.entries()){const e=v(t),i=`vis-watch-${s}-${process.pid}`;c.command(["watch-project",e],(l,f)=>{if(l){h.warn(`[vis watch] watchman could not watch ${t}: ${l.message}`);return}const u={expression:["allof",["type","f"]],fields:["name"]};f.relative_path&&(u.relative_root=f.relative_path),c.command(["subscribe",f.watch,i,u],r=>{r&&h.warn(`[vis watch] watchman subscribe failed for ${t}: ${r.message}`)})})}return{close:()=>{try{c.end()}catch{}}}},x=[/node_modules(?:\/|$)/,/\.git(?:\/|$)/,/\.vis(?:\/|$)/],R=(a,n)=>{const o=new Set,c=new Set;for(const[,e]of a){const i=e.task.hashDetails?.nodes;if(i)for(const l of Object.keys(i))o.add(l),c.add(T(v(n,l)))}const s=[...c].sort(),t=[];for(const e of s)t.some(i=>e===i||e.startsWith(`${i}/`))||t.push(e);return{directories:t,files:o}},P=(a,n,o)=>{const c=new Set;for(const s of a){const t=v(n,s);for(const e of o)if(t===e||t.startsWith(`${e}/`)){const i=W(e,t);i.length>0&&c.add(i)}}return s=>{const t=s.replaceAll("\\","/");return c.has(t)}},A=a=>{const n=a.replaceAll("\\","/");return x.some(o=>o.test(n))},D=a=>{const{debounceMs:n=150,filter:o,onChange:c,paths:s}=a;let t=new Set,e;const i=()=>{e=void 0;const r=[...t];t=new Set,r.length!==0&&Promise.resolve(c(r)).catch(d=>{h.error("[vis watch] onChange handler failed:",d)})},l=r=>{A(r)||o&&!o(r)||(t.add(r),e&&clearTimeout(e),e=setTimeout(i,n))},f=q(s,l);if(f)return{close:()=>{e&&clearTimeout(e),f.close()}};const u=[];for(const r of s)try{const d=y(r,{recursive:!0},(B,g)=>{g&&l(g)});u.push(d)}catch(d){h.warn(`[vis watch] unable to watch ${r}: ${d.message}`)}return{close:()=>{e&&clearTimeout(e);for(const r of u)try{r.close()}catch{}}}};export{P as a,R as c,D as s};
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
import{createRequire as K}from"node:module";import{m as g,f as C,v as G,A as S,B as U,a as Q,H as X}from"./index-2LCHaVNX.js";import{n as w}from"../packem_chunks/catalog.js";import{a as ee}from"./readJsonSync-DuMMeB3s-B9cGBVbJ.js";import{s as le}from"./watch-B3P2dwoG.js";const H=K(import.meta.url),x=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,v=e=>{if(typeof x<"u"&&x.versions&&x.versions.node){const[t,s]=x.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return x.getBuiltinModule(e)}return H(e)},{createHash:m}=v("node:crypto"),{fileURLToPath:Y,pathToFileURL:Z}=v("node:url"),{spawnSync:te,spawn:se}=v("node:child_process"),{openSync:ne,writeSync:re,closeSync:oe,statSync:ie,readFileSync:N,mkdirSync:ae,writeFileSync:ce}=v("node:fs"),{availableParallelism:b}=v("node:os"),W=(e,t)=>{for(const s of["dependencies","devDependencies","optionalDependencies","peerDependencies"]){const n=e[s];if(n&&typeof n[t]=="string")return n[t]}},k=(e,t)=>{for(const s of t){const n=g(e,s);if(C(n))return n}},ue=e=>{const t=g(e,"package.json");if(!C(t))return{};try{return ee(t)}catch{return{}}},tt=(e,t)=>{const s=ue(e),n=new Map;for(const o of t){const r=o.detect(e,s);r&&n.set(o.id,r)}return n},de={error:"error",info:"info",information:"info",warning:"warning"},st={argsCheck:(e,t)=>j(e,t,!1),argsFix:(e,t)=>j(e,t,!0),bin:()=>["pnpm","exec","biome"],cacheKey:(e,t)=>{const s=["biome",e.declaredVersion??"unknown",e.configFile??"no-config",t.maxWarnings===void 0?"":`mw=${t.maxWarnings}`,t.quiet?"q":"",...t.extraArgs??[]];return m("sha256").update(s.join("|")).digest("hex").slice(0,16)},detect:(e,t)=>{const s=W(t,w.biome.packageNames[0]),n=k(e,w.biome.configFiles);if(!(!s&&!n))return{adapter:"biome",configFile:n,declared:!!s,declaredVersion:s,root:e}},extensions:["astro","cjs","css","cts","js","json","jsonc","jsx","mjs","mts","svelte","ts","tsx","vue"],id:"biome",kind:"both",parse:(e,t)=>{if(!e.stdout.trim())return[];let s;try{s=JSON.parse(e.stdout)}catch{return[{adapter:"biome",file:t.root,fixable:!1,message:`biome output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const n=[];for(const o of s.diagnostics??[]){const r=o.location?.start,i=o.location?.end,a=fe(t.root,o.location?.path),c=o.category??"",l=c==="format"||c.startsWith("format/");n.push({adapter:"biome",column:r?.column&&r.column>0?r.column:void 0,endColumn:i?.column&&i.column>0?i.column:void 0,endLine:i?.line&&i.line>0?i.line:void 0,file:a,fixable:!0,line:r?.line&&r.line>0?r.line:void 0,message:l?"Code style issues would be auto-fixed":o.message??"",ruleId:c||void 0,severity:de[o.severity??""]??"warning"})}return n}},j=(e,t,s)=>{const n=["check","--reporter=json"];return s&&n.push("--write"),typeof t.maxWarnings=="number"&&n.push(`--max-diagnostics=${String(t.maxWarnings)}`),t.extraArgs?.length&&n.push(...t.extraArgs),n.push(...e),n},fe=(e,t)=>{const s=typeof t=="string"?t:t?.file;return s?s.startsWith("/")||/^[a-z]:[\\/]/i.test(s)?s:g(e,s):e},B=e=>t=>{const s=k(t,w.deno.configFiles);if(s)return{adapter:e,configFile:s,declared:!1,root:t}},D=e=>e.startsWith("/")||/^[a-z]:[\\/]/i.test(e),nt={argsCheck:(e,t)=>F(e,t,!1),argsFix:(e,t)=>F(e,t,!0),bin:()=>["deno","lint"],cacheKey:(e,t)=>{const s=["deno-lint",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return m("sha256").update(s.join("|")).digest("hex").slice(0,16)},detect:B("deno-lint"),extensions:["js","jsx","mjs","mts","ts","tsx"],id:"deno-lint",kind:"lint",parse:(e,t)=>{if(!e.stdout.trim())return[];let s;try{s=JSON.parse(e.stdout)}catch{return[{adapter:"deno-lint",file:t.root,fixable:!1,message:`deno lint output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const n=[];for(const o of s.diagnostics??[]){const r=o.range?.start,i=o.range?.end;n.push({adapter:"deno-lint",column:r?.col===void 0?void 0:r.col+1,endColumn:i?.col===void 0?void 0:i.col+1,endLine:i?.line===void 0?void 0:i.line+1,file:pe(o.filename??t.root,t.root),fixable:!1,line:r?.line===void 0?void 0:r.line+1,message:o.message??"",ruleId:o.code,severity:"warning"})}return n}},rt={argsCheck:(e,t)=>I(e,t,!1),argsFix:(e,t)=>I(e,t,!0),bin:()=>["deno","fmt"],cacheKey:(e,t)=>{const s=["deno-fmt",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return m("sha256").update(s.join("|")).digest("hex").slice(0,16)},detect:B("deno-fmt"),extensions:["astro","cjs","css","cts","html","ipynb","js","json","jsonc","jsx","less","md","mjs","mts","sass","scss","sql","svelte","ts","tsx","vue","yaml","yml"],id:"deno-fmt",kind:"fmt",parse:(e,t)=>{if(e.exitCode===0)return[];const s=[],n=new Set;for(const o of e.stdout.split(/\r?\n/)){const r=/^from (.+):$/.exec(o);if(!r)continue;const i=r[1];n.has(i)||(n.add(i),s.push({adapter:"deno-fmt",file:D(i)?i:`${t.root}/${i}`,fixable:!0,message:"Code style issues would be auto-fixed",severity:"info"}))}return s}},F=(e,t,s)=>{const n=["--json"];return s&&n.push("--fix"),t.extraArgs?.length&&n.push(...t.extraArgs),n.push(...e),n},I=(e,t,s)=>{const n=[];return s||n.push("--check"),t.quiet&&n.push("--quiet"),t.extraArgs?.length&&n.push(...t.extraArgs),n.push(...e),n},pe=(e,t)=>e.startsWith("file://")?Y(e):D(e)?e:`${t}/${e}`,J="pyproject.toml",ge=/^\[tool\.ruff(?:\.[\w-]+)*\]\s*$/m,he=/^Would reformat:?\s+(.+)$/,me=e=>{const t=g(e,J);if(!C(t))return!1;try{const s=G(t);return ge.test(s)}catch{return!1}},E=e=>(t,s)=>{const n=w.ruff.packageNames.map(a=>W(s,a)).find(a=>a!==void 0),o=k(t,w.ruff.configFiles),r=o?void 0:me(t)?g(t,J):void 0,i=o??r;if(!(!n&&!i))return{adapter:e,configFile:i,declared:!!n,declaredVersion:n,root:t}},ye=e=>e.startsWith("/")||/^[a-z]:[\\/]/i.test(e),P=(e,t)=>e?ye(e)?e:g(t,e):t,xe=e=>he.exec(e)?.[1]?.trim(),ot={argsCheck:(e,t)=>L(e,t,!1),argsFix:(e,t)=>L(e,t,!0),bin:()=>["ruff","check"],cacheKey:(e,t)=>{const s=["ruff-check",e.declaredVersion??"unknown",e.configFile??"no-config",t.maxWarnings===void 0?"":`mw=${t.maxWarnings}`,t.quiet?"q":"",...t.extraArgs??[]];return m("sha256").update(s.join("|")).digest("hex").slice(0,16)},detect:E("ruff-check"),extensions:["py","pyi"],id:"ruff-check",kind:"lint",parse:(e,t)=>{if(!e.stdout.trim())return[];let s;try{s=JSON.parse(e.stdout)}catch{return[{adapter:"ruff-check",file:t.root,fixable:!1,message:`ruff check output was not valid JSON (exit ${e.exitCode})`,severity:"error"}]}const n=[];for(const o of s){const r=o.location,i=o.end_location;n.push({adapter:"ruff-check",column:r?.column,endColumn:i?.column,endLine:i?.row,file:P(o.filename,t.root),fixable:!!o.fix,line:r?.row,message:o.message??"",ruleId:o.code,severity:"warning"})}return n}},it={argsCheck:(e,t)=>R(e,t,!1),argsFix:(e,t)=>R(e,t,!0),bin:()=>["ruff","format"],cacheKey:(e,t)=>{const s=["ruff-fmt",e.declaredVersion??"unknown",e.configFile??"no-config",t.quiet?"q":"",...t.extraArgs??[]];return m("sha256").update(s.join("|")).digest("hex").slice(0,16)},detect:E("ruff-fmt"),extensions:["py","pyi"],id:"ruff-fmt",kind:"fmt",parse:(e,t)=>{if(e.exitCode===0)return[];const s=[],n=new Set;for(const o of e.stdout.split(/\r?\n/)){const r=xe(o);!r||n.has(r)||(n.add(r),s.push({adapter:"ruff-fmt",file:P(r,t.root),fixable:!0,message:"Code style issues would be auto-fixed",severity:"info"}))}return s}},L=(e,t,s)=>{const n=["--output-format=json"];return s&&n.push("--fix"),t.quiet&&n.push("--quiet"),t.extraArgs?.length&&n.push(...t.extraArgs),n.push(...e),n},R=(e,t,s)=>{const n=[];return s||n.push("--check"),t.quiet&&n.push("--quiet"),t.extraArgs?.length&&n.push(...t.extraArgs),n.push(...e),n},at=(e,t)=>{const s=$(e,["diff","--name-only","--diff-filter=ACMR","-z",`${t}...HEAD`]);if(s===void 0)return;const n=$(e,["diff","--name-only","--diff-filter=ACMR","-z"]),o=$(e,["diff","--name-only","--diff-filter=ACMR","--cached","-z"]),r=$(e,["ls-files","--others","--exclude-standard","-z"]),i=new Set;for(const a of[s,n??"",o??"",r??""])for(const c of a.split("\0"))c.length!==0&&i.add(S(c)?c:g(e,c));return[...i].sort()},ct=e=>{const t=$(e,["diff","--name-only","--diff-filter=ACMR","--cached","-z"]);if(t===void 0)return;const s=new Set;for(const n of t.split("\0"))n.length!==0&&s.add(S(n)?n:g(e,n));return[...s].sort()},$=(e,t)=>{const s=te("git",[...t],{cwd:e,encoding:"utf8",timeout:1e4});if(s.status===0)return s.stdout},lt=(e,t)=>{const s=new Set(t.map(r=>r.toLowerCase())),n=[],o=new Set;for(const r of e){const i=r.lastIndexOf(".");if(i===-1||i===r.length-1)continue;const a=r.slice(i+1).toLowerCase();s.has(a)&&(o.has(r)||(o.add(r),n.push(r)))}return n},$e=new Set(["-","stdout"]),M=e=>({close:()=>{},write:t=>{e.write(t)}}),we=e=>{Q(X(e));const t=ne(e,"w");let s=[];return{close:()=>{s.length>0&&(re(t,s.join("")),s=[]),oe(t)},write:n=>{s.push(n)}}},ut=e=>{const{cwd:t,target:s}=e;if(s===void 0||$e.has(s))return M(process.stdout);if(s==="stderr")return M(process.stderr);const n=S(s)?s:U(t,s);return we(n)},q=["oxlint","oxfmt","biome","eslint","dprint","prettier","stylelint","ruff-check","ruff-fmt","markdownlint","shellcheck","deno-lint","deno-fmt"],dt=(e,t)=>{const s=new Map(e.map(i=>[i.id,i])),n=[],o=new Set,r=t&&t.length>0?t:q;for(const i of r){const a=s.get(i);a&&!o.has(i)&&(n.push(a),o.add(i))}if(t&&t.length>0)for(const i of q){const a=s.get(i);a&&!o.has(i)&&(n.push(a),o.add(i))}for(const i of e)o.has(i.id)||(n.push(i),o.add(i.id));return n},ft=(e,t,s)=>{const n=[];for(const o of t){const r=e.get(o.id);r&&ve(o.kind,s)&&n.push({adapter:o,presence:r})}return n},ve=(e,t)=>e===t||e==="both",pt=(e,t,s={})=>{const n=new Map;for(const o of e){const r=Se(o),i=Ae(r,t,s);if(!i)continue;const a=n.get(i);a?a.push(o):n.set(i,[o])}return n},Se=e=>{const t=e.lastIndexOf(".");return t===-1||t===e.length-1?"":e.slice(t+1).toLowerCase()},Ae=(e,t,s)=>{const n=s[e];if(n&&t.some(o=>o.adapter.id===n))return n;for(const{adapter:o}of t)if(o.extensions.includes(e))return o.id},Ce=e=>e==="error"?"error":e==="warning"?"warning":"notice",V=e=>e.replaceAll("%","%25").replaceAll("\r","%0D").replaceAll(`
|
|
2
|
-
`,"%0A"),T=e=>V(e).replaceAll(",","%2C").replaceAll(":","%3A").replaceAll("=","%3D"),ke=(e,t)=>t&&e.startsWith(`${t}/`)?e.slice(t.length+1):e,be=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),je=(e,t)=>{const s=Ce(e.severity),n=ke(e.file,t),o=e.ruleId?`${e.adapter}(${e.ruleId})`:e.adapter,r=[`file=${T(n)}`];return e.line!==void 0&&r.push(`line=${String(e.line)}`),e.endLine!==void 0&&r.push(`endLine=${String(e.endLine)}`),e.column!==void 0&&r.push(`col=${String(e.column)}`),e.endColumn!==void 0&&r.push(`endColumn=${String(e.endColumn)}`),r.push(`title=${T(o)}`),`::${s} ${r.join(",")}::${V(e.message)}
|
|
3
|
-
`},gt=e=>e.runs.flatMap(t=>[...t.findings]).sort(be).map(t=>je(t,e.workspaceRoot)).join(""),y=e=>e.replaceAll("&","&").replaceAll("<","<").replaceAll(">",">").replaceAll('"',""").replaceAll("'","'"),Fe=e=>`<![CDATA[${e.replaceAll("]]>","]]]]><![CDATA[>")}]]>`,Ie=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),Le=e=>e==="error"?"error":e==="warning"?"warning":"info",Re=(e,t)=>{let{file:s}=e;return t&&e.file.startsWith(`${t}/`)&&(s=e.file.slice(t.length+1)),e.line===void 0?s:e.column===void 0?`${s}:${String(e.line)}`:`${s}:${String(e.line)}:${String(e.column)}`},Me=(e,t,s)=>{const n=Re(e,s),o=Le(e.severity),r=e.ruleId?`[${e.ruleId}] ${e.message}`:e.message;return[` <testcase classname="${y(t)}" name="${y(n)}">`,` <failure type="${y(o)}" message="${y(r)}">${Fe(e.message)}</failure>`," </testcase>",""].join(`
|
|
4
|
-
`)},qe=(e,t,s)=>{const n=[...e.findings].sort(Ie),o=n.filter(l=>l.severity==="error").length,r=n.filter(l=>l.severity==="warning").length,i=n.length,a=(e.durationMs/1e3).toFixed(3),c=n.map(l=>Me(l,e.adapter,s)).join("");return` <testsuite ${[`name="${y(e.adapter)}"`,`tests="${String(i)}"`,`failures="${String(o)}"`,'errors="0"',`skipped="${String(r)}"`,`time="${a}"`,`timestamp="${t}"`].join(" ")}>
|
|
5
|
-
${c} </testsuite>
|
|
6
|
-
`},ht=e=>{const t=(e.now??new Date).toISOString(),s=e.suiteName??"vis-lint-fmt",n=e.runs.map(c=>qe(c,t,e.workspaceRoot)).join(""),o=e.runs.reduce((c,l)=>c+l.findings.length,0),r=e.runs.reduce((c,l)=>c+l.findings.filter(p=>p.severity==="error").length,0),i=e.runs.reduce((c,l)=>c+l.findings.filter(p=>p.severity==="warning").length,0),a=(e.runs.reduce((c,l)=>c+l.durationMs,0)/1e3).toFixed(3);return`<?xml version="1.0" encoding="UTF-8"?>
|
|
7
|
-
<testsuites ${[`name="${y(s)}"`,`tests="${String(o)}"`,`failures="${String(r)}"`,'errors="0"',`skipped="${String(i)}"`,`time="${a}"`].join(" ")}>
|
|
8
|
-
${n}</testsuites>
|
|
9
|
-
`},Te="2.1.0",Oe="https://json.schemastore.org/sarif-2.1.0.json",_e=e=>e==="error"?"error":e==="warning"?"warning":"note",Ne=(e,t)=>t&&e.startsWith(`${t}/`)?{uri:e.slice(t.length+1),uriBaseId:"SRCROOT"}:{uri:e},We=e=>{const{href:t}=Z(e);return t.endsWith("/")?t:`${t}/`},Be=(e,t)=>e.file!==t.file?e.file<t.file?-1:1:(e.line??0)-(t.line??0)||(e.column??0)-(t.column??0),De=e=>{const t=new Map;for(const s of e)s.ruleId&&(t.has(s.ruleId)||t.set(s.ruleId,{id:s.ruleId,name:s.ruleId}));return[...t.values()]},Je=(e,t)=>{const{uri:s,uriBaseId:n}=Ne(e.file,t),o={artifactLocation:n?{uri:s,uriBaseId:n}:{uri:s}};if(e.line!==void 0){const i={startLine:e.line};e.column!==void 0&&(i.startColumn=e.column),e.endLine!==void 0&&(i.endLine=e.endLine),e.endColumn!==void 0&&(i.endColumn=e.endColumn),o.region=i}const r={level:_e(e.severity),locations:[{physicalLocation:o}],message:{text:e.message}};return e.ruleId&&(r.ruleId=e.ruleId),r},Ee=(e,t)=>{const s=[...e.findings].sort(Be),n=De(s),o={name:e.adapter,rules:n};e.presence?.declaredVersion&&(o.version=e.presence.declaredVersion);const r={results:s.map(i=>Je(i,t)),tool:{driver:o}};return t&&(r.originalUriBaseIds={SRCROOT:{uri:We(t)}}),r},mt=e=>{const t={$schema:Oe,runs:e.runs.map(s=>Ee(s,e.workspaceRoot)),version:Te};return`${JSON.stringify(t,void 0,2)}
|
|
10
|
-
`},O={error:3,info:1,warning:2},yt=e=>{const t=[],s=[];let n,o=!1;for(const r of e){s.push({adapter:r.adapter,durationMs:r.durationMs,exitCode:r.exitCode,findingCount:r.findings.length}),r.exitCode!==0&&r.exitCode!==null&&r.findings.length===0&&(o=!0);for(const i of r.findings)t.push(i),(!n||O[i.severity]>O[n])&&(n=i.severity)}return{findings:t,hadProcessFailure:o,maxSeverity:n,runs:s}},xt=e=>{const t=new Map;for(const s of e){const n=t.get(s.file);n?n.push(s):t.set(s.file,[s])}return t},$t=e=>e.hadProcessFailure||e.maxSeverity==="error"?1:0,Pe=(e,t)=>{if(t==="fix"||process.env.VIS_NO_CACHE==="1"||e.length===0)return!1;for(const s of e)if(s==="."||s==="./"||s==="..")return!1;return!0},Ve=e=>{try{const t=N(e);return m("sha256").update(t).digest("hex")}catch{return}},ze=(e,t,s,n,o)=>{const r=e.cacheKey(t,n),i=[];for(const c of[...s].sort()){const l=S(c)?c:g(t.root,c);try{ie(l)}catch{return}const p=Ve(l);if(!p)return;i.push({hash:p,path:l})}const a=m("sha256");a.update(e.id),a.update("\0"),a.update(r),a.update("\0"),a.update(o);for(const c of i)a.update("\0"),a.update(c.path),a.update("\0"),a.update(c.hash);return{fileHashes:i,key:a.digest("hex")}},z=(e,t)=>g(e,"lint-fmt",t),Ke=(e,t,s)=>{const n=g(z(e,t.id),`${s}.json`);try{const o=N(n,"utf8"),r=JSON.parse(o);return r.schema!==1?void 0:r}catch{return}},He=(e,t,s,n,o)=>{const r=z(e,t.id),i={fileHashes:o,result:n,savedAt:Date.now(),schema:1};try{ae(r,{recursive:!0}),ce(g(r,`${s}.json`),JSON.stringify(i))}catch{}},_=async(e,t,s,n,o)=>{const r=e.bin(t),i=[...r.slice(1),...o==="fix"?e.argsFix(s,n):e.argsCheck(s,n)];return new Promise(a=>{const c=Date.now(),l=se(r[0],i,{cwd:t.root}),p=[],u=[];let h=!1;const f=setTimeout(()=>{h=!0,l.kill("SIGKILL")},6e4);l.stdout.on("data",d=>p.push(d)),l.stderr.on("data",d=>u.push(d)),l.on("error",d=>{clearTimeout(f),a({durationMs:Date.now()-c,exitCode:null,stderr:d.message,stdout:""})}),l.on("close",d=>{clearTimeout(f),a({durationMs:Date.now()-c,exitCode:h?null:d,stderr:Buffer.concat(u).toString("utf8"),stdout:Buffer.concat(p).toString("utf8")})})})},wt=async(e,t,s,n=b())=>{if(e.length===0)return[];const{cacheRoot:o,concurrency:r}=typeof n=="number"?{concurrency:n}:{cacheRoot:n.cacheRoot,concurrency:n.concurrency??b()},i=async u=>{const h=u.options??t;if(o&&Pe(u.files,s)){const f=ze(u.adapter,u.presence,u.files,h,s);if(f){const d=Ke(o,u.adapter,f.key);if(d)return d.result;const A=await _(u.adapter,u.presence,u.files,h,s);return A.exitCode!==null&&He(o,u.adapter,f.key,A,f.fileHashes),A}}return _(u.adapter,u.presence,u.files,h,s)};if(process.env.VIS_LINT_FMT_SERIAL==="1"){const u=[];for(const h of e)u.push(await i(h));return u}const a=Math.max(1,Math.min(r,e.length)),c=Array.from({length:e.length});let l=0;const p=async()=>{for(;;){const u=l;if(l+=1,u>=e.length)return;c[u]=await i(e[u])}};return await Promise.all(Array.from({length:a},()=>p())),c},Ge=e=>{const t=new Set;for(const s of e)t.add(s.toLowerCase());return t},Ue=(e,t)=>{const s=e.lastIndexOf(".");return s===-1||s===e.length-1?!1:t.has(e.slice(s+1).toLowerCase())},vt=async e=>{const{extensions:t,initialFiles:s,label:n,log:o,runCycle:r,workspaceRoot:i}=e,a=o??(f=>{process.stdout.write(`${f}
|
|
11
|
-
`)}),c=Ge(t);await r(s),a(`▸ ${n}: watching workspace — press Ctrl-C to exit`);let l=new Set,p=!1;const u=async()=>{for(;l.size>0;){const f=[...l];l=new Set;try{await r(f)}catch(d){a(`✗ ${n}: watch cycle failed — ${d.message}`)}}},h=le({debounceMs:200,filter:f=>Ue(f,c),onChange:async f=>{for(const d of f)l.add(S(d)?d:g(i,d));if(!p){p=!0;try{await u()}finally{p=!1}}},paths:[i]});await new Promise(f=>{const d=()=>{h.close(),process.off("SIGINT",d),process.off("SIGTERM",d),f()};process.once("SIGINT",d),process.once("SIGTERM",d)})};export{tt as a,ft as b,at as c,W as d,vt as e,k as f,pt as g,wt as h,yt as i,ut as j,mt as k,ht as l,gt as m,st as n,it as o,rt as p,xt as q,dt as r,ct as s,$t as t,lt as u,ot as v,nt as w};
|