@visulima/vis 2.0.0 → 2.0.1
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 +13 -0
- 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 +63 -61
- package/dist/packem_chunks/cli-exec.js +1 -1
- package/dist/packem_chunks/cli-main.js +133 -130
- 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/extra-files.js +3 -3
- package/dist/packem_chunks/fix.js +8 -8
- 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 +3 -3
- 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 +2 -2
- 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 +6 -6
- package/dist/packem_chunks/handler60.js +2 -2
- package/dist/packem_chunks/handler61.js +13 -13
- package/dist/packem_chunks/handler62.js +3 -3
- 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 +16 -16
- package/dist/packem_chunks/handler68.js +7 -7
- package/dist/packem_chunks/handler69.js +25 -25
- 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 +42 -42
- package/dist/packem_chunks/handler73.js +9 -9
- package/dist/packem_chunks/handler74.js +21 -21
- 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 +22 -22
- 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 +26 -26
- package/dist/packem_chunks/index2.js +5 -5
- package/dist/packem_chunks/index3.js +2 -2
- package/dist/packem_chunks/index4.js +11 -11
- package/dist/packem_chunks/keys-refresh.js +1 -1
- package/dist/packem_chunks/lean.js +1 -1
- 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 +8 -8
- package/dist/packem_chunks/verify-lockfile.js +2 -2
- package/dist/packem_chunks/workspace.js +2 -2
- package/dist/packem_shared/advisories-BGeuHJQg.js +1 -0
- package/dist/packem_shared/affected-selection-B85ND6JV.js +1 -0
- package/dist/packem_shared/affected-shas-BWRRAB47.js +1 -0
- package/dist/packem_shared/ai-analysis-oNMAj1wd.js +68 -0
- package/dist/packem_shared/{ai-fix-CLfWbyqY.js → ai-fix-BgBU0TOz.js} +9 -9
- package/dist/packem_shared/{augment-BVuj3ee7.js → augment-HVeX6LpU.js} +4 -4
- package/dist/packem_shared/bin-DKod8Iqo.js +1 -0
- package/dist/packem_shared/build-scripts-CM8M1xcG.js +1 -0
- package/dist/packem_shared/{command-runtime-DTbo12cP.js → command-runtime-BVi4lL8k.js} +1 -1
- package/dist/packem_shared/cyclonedx-y7VLI-1d.js +4 -0
- package/dist/packem_shared/{dependency-scan-DZcSlSFp.js → dependency-scan-BAzKpXdW.js} +1 -1
- package/dist/packem_shared/{docker-69ybb6g7.js → docker-D1LStSlH.js} +36 -36
- package/dist/packem_shared/{en-C26W78--.js → en-BxrK-n-J.js} +10 -10
- package/dist/packem_shared/failure-log-ChuFC-8f.js +2 -0
- package/dist/packem_shared/giget-CAxjpwew.js +2 -0
- package/dist/packem_shared/glob-BUjyjdE8-BSrdzgma.js +1 -0
- package/dist/packem_shared/{index-Bhzio2RB.js → index-BJw7gKD1.js} +1 -1
- package/dist/packem_shared/index-BWl4DbMp.js +1 -0
- package/dist/packem_shared/index-DND6ptxQ.js +35 -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-Db0qh6vR.js +2 -0
- package/dist/packem_shared/lockfile-CDQ0n4P5.js +1 -0
- package/dist/packem_shared/main-D_cam4hv.js +1 -0
- package/dist/packem_shared/manifests-Da_no4ZH.js +1 -0
- package/dist/packem_shared/{min-release-age-hK604veF.js → min-release-age-V6L6dpiP.js} +2 -2
- package/dist/packem_shared/missing-package-json-Jw8IEHct.js +1 -0
- package/dist/packem_shared/{native-config-sync-DDKjAy0i.js → native-config-sync-C0pUePad.js} +6 -6
- package/dist/packem_shared/osv-bloom-DNFpvSSO.js +2 -0
- package/dist/packem_shared/package-version-DjHDww_5.js +4 -0
- package/dist/packem_shared/packument-N3EWbZpL.js +1 -0
- package/dist/packem_shared/pm-runner-Bssje5qH.js +1 -0
- package/dist/packem_shared/project-name-filter-u2Q7YpQH.js +7 -0
- package/dist/packem_shared/prompt-BSAy8SMH.js +1 -0
- package/dist/packem_shared/{provenance-CRBV9cko.js → provenance-9OT8sTqn.js} +1 -1
- package/dist/packem_shared/{readJsonSync-DuMMeB3s-B9cGBVbJ.js → readJsonSync-BnWiH5-R-BpnwAB0Z.js} +1 -1
- package/dist/packem_shared/registry-keys-CYHd7qU2.js +1 -0
- package/dist/packem_shared/{resolve-explicit-BX6aMYl-.js → resolve-explicit-DC3XssJa.js} +1 -1
- package/dist/packem_shared/{resolve-runtime-COyiEML3.js → resolve-runtime-f5l4ODsH.js} +1 -1
- package/dist/packem_shared/run-file-zB4ACnUy.js +1 -0
- package/dist/packem_shared/{runtime-check-fzDkedMW.js → runtime-check-CWvAfu5u.js} +1 -1
- package/dist/packem_shared/s1ngularity-DsmC71xt.js +1 -0
- package/dist/packem_shared/{scan-progress-DQ9qIGzr.js → scan-progress-Ch8s3Uwl.js} +2 -2
- package/dist/packem_shared/selectors-CtxnIT4X.js +3 -0
- package/dist/packem_shared/signatures-Dwx5fD4g.js +2 -0
- package/dist/packem_shared/subtree-DSm0QEoE.js +2 -0
- package/dist/packem_shared/target-merge-b7bE1AEx.js +11 -0
- package/dist/packem_shared/target-options-BO4Uxt0k.js +1 -0
- package/dist/packem_shared/toolchain-BY8lJaSN.js +5 -0
- package/dist/packem_shared/typosquats-BUGgotNu.js +1 -0
- package/dist/packem_shared/{use-measured-height-DfNxp6nf.js → use-measured-height-BLZt9dW2.js} +1 -1
- package/dist/packem_shared/verify-B0ztxKMa.js +1 -0
- package/dist/packem_shared/vis-update-app-D1gLJB1O.js +1 -0
- package/dist/packem_shared/vis-user-error-DjFv8uxy.js +28 -0
- package/dist/packem_shared/watch-CGrUW_JD.js +1 -0
- package/dist/packem_shared/watch-loop-DIwSMjlA.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 +12 -12
- 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-Bq6YEpiq.js +0 -28
- 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/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/vis-update-app-De8JjZm0.js +0 -1
- package/dist/packem_shared/watch-B3P2dwoG.js +0 -1
- package/dist/packem_shared/watch-loop-B3_O8hF-.js +0 -11
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PlannedRelease, PerPackageReleaseConfig, WorkspacePackage, PackageManifest, VisReleaseConfig } from "../release/types.js";
|
|
2
|
-
import { P as PackageManagerAdapter, e as PublishResult } from "./interface.d-
|
|
2
|
+
import { P as PackageManagerAdapter, e as PublishResult } from "./interface.d-CRqRz4jt.js";
|
|
3
3
|
/**
|
|
4
|
-
* Parsed `pnpm-workspace.yaml` catalogs.
|
|
5
|
-
* - `default` is the top-level `catalog:` block (referenced as `catalog:` in deps).
|
|
6
|
-
* - `named` is the `catalogs:` map (referenced as `catalog:<name>`).
|
|
7
|
-
*/
|
|
4
|
+
* Parsed `pnpm-workspace.yaml` catalogs.
|
|
5
|
+
* - `default` is the top-level `catalog:` block (referenced as `catalog:` in deps).
|
|
6
|
+
* - `named` is the `catalogs:` map (referenced as `catalog:<name>`).
|
|
7
|
+
*/
|
|
8
8
|
interface Catalogs {
|
|
9
9
|
default: Record<string, string>;
|
|
10
10
|
named: Record<string, Record<string, string>>;
|
|
@@ -34,11 +34,11 @@ interface PublishContext {
|
|
|
34
34
|
/** The plan entry for this package (with the new version etc.). */
|
|
35
35
|
release: PlannedRelease;
|
|
36
36
|
/**
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
37
|
+
* When set, the tarball is already staged on the registry under this
|
|
38
|
+
* id; skip pack + publish and resume waiting on the existing decision.
|
|
39
|
+
* Carried by `vis release publish --resume` / re-runs after a timeout
|
|
40
|
+
* so we don't try to re-upload a version npm already has staged.
|
|
41
|
+
*/
|
|
42
42
|
resumeStageId?: string;
|
|
43
43
|
/** Channel-derived dist-tag. */
|
|
44
44
|
tag?: string;
|
|
@@ -60,46 +60,46 @@ interface AfterAllVersionedResult {
|
|
|
60
60
|
deletedFiles: string[];
|
|
61
61
|
}
|
|
62
62
|
/**
|
|
63
|
-
* Per-package versioning + publishing contract.
|
|
64
|
-
*
|
|
65
|
-
* Concrete implementations are stateless. Construct one instance per
|
|
66
|
-
* package per release wave; the orchestrator passes context per call.
|
|
67
|
-
*/
|
|
63
|
+
* Per-package versioning + publishing contract.
|
|
64
|
+
*
|
|
65
|
+
* Concrete implementations are stateless. Construct one instance per
|
|
66
|
+
* package per release wave; the orchestrator passes context per call.
|
|
67
|
+
*/
|
|
68
68
|
declare abstract class VersionActions {
|
|
69
69
|
/**
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
70
|
+
* Stable id for resolution (`"npm"`, `"native-addon"`, `"private"`,
|
|
71
|
+
* or a path for custom impls).
|
|
72
|
+
*/
|
|
73
73
|
abstract readonly id: string;
|
|
74
74
|
/**
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
75
|
+
* Read the current published version of this package from the registry.
|
|
76
|
+
* Returns `undefined` for private packages or fresh packages never published.
|
|
77
|
+
*
|
|
78
|
+
* The optional `workspaceConfig` field threads workspace-level
|
|
79
|
+
* knobs (currently only `httpProxy`) so adapters can route registry
|
|
80
|
+
* probes through an enterprise proxy. Older adapters that ignore
|
|
81
|
+
* the field continue to work.
|
|
82
|
+
*/
|
|
83
83
|
abstract readPublishedVersion(context: {
|
|
84
84
|
pkg: WorkspacePackage;
|
|
85
85
|
pm: PackageManagerAdapter;
|
|
86
86
|
workspaceConfig?: VisReleaseConfig;
|
|
87
87
|
}): Promise<string | undefined>;
|
|
88
88
|
/**
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
89
|
+
* Publish this package (and any sidecars). Implementations are responsible
|
|
90
|
+
* for: protocol resolution, catalog rewriting, clean-package-json,
|
|
91
|
+
* pack-then-publish via the active adapter.
|
|
92
|
+
*/
|
|
93
93
|
abstract publish(context: PublishContext): Promise<PublishResult>;
|
|
94
94
|
}
|
|
95
95
|
/**
|
|
96
|
-
* Optional companion hook — runs once per workspace after every package's
|
|
97
|
-
* `bumpVersion` step has completed and before the prettier/commit phase.
|
|
98
|
-
*
|
|
99
|
-
* Used to update sidecar files that span packages (e.g. NAPI platform
|
|
100
|
-
* `optionalDependencies` blocks, lockfile re-sync). Returned files are
|
|
101
|
-
* auto-staged into the release commit.
|
|
102
|
-
*/
|
|
96
|
+
* Optional companion hook — runs once per workspace after every package's
|
|
97
|
+
* `bumpVersion` step has completed and before the prettier/commit phase.
|
|
98
|
+
*
|
|
99
|
+
* Used to update sidecar files that span packages (e.g. NAPI platform
|
|
100
|
+
* `optionalDependencies` blocks, lockfile re-sync). Returned files are
|
|
101
|
+
* auto-staged into the release commit.
|
|
102
|
+
*/
|
|
103
103
|
declare abstract class AfterAllProjectsVersioned {
|
|
104
104
|
abstract afterAllVersioned(context: AfterAllVersionedContext): Promise<AfterAllVersionedResult>;
|
|
105
105
|
}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as A}from"node:module";import{e as W,_ as C,m as c,f as L,a as q}from"./index-DND6ptxQ.js";import{e as z}from"./en-BxrK-n-J.js";import{N as Q}from"./readJsonSync-BnWiH5-R-BpnwAB0Z.js";import{withEnhancedPath as et}from"@visulima/task-runner";let F;const N=t=>(F??=A(import.meta.url))(t),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=t=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[o,e]=d.versions.node.split(".").map(Number);if(o>22||o===22&&e>=3||o===20&&e>=16)return d.getBuiltinModule(t)}return N(t)},{Socket:G}=l("node:net"),{randomBytes:V}=l("node:crypto"),{readdir:B,rm:k,unlink:v,open:Y,readFile:J,stat:K,writeFile:U,rename:X}=l("node:fs/promises"),{spawn:Z}=l("node:child_process"),{openSync:tt,closeSync:ot}=l("node:fs");async function $(t,o,e){const s=await W(t,{buffer:!0,encoding:void 0});let i=new TextDecoder().decode(s);const{beforeParse:r,color:n}={};return typeof r=="function"&&(i=r(i)),Q(i,o,C(t),{color:n})}const st=3e4,E=100;class it extends Error{constructor(o,e){super(o),this.elapsedMs=e,this.name="ServiceReadinessError"}elapsedMs}const rt=async t=>{const o=t.host??"127.0.0.1",{port:e}=t,s=t.timeoutMs??st,i=Date.now();for(;Date.now()-i<s;){if(await nt(o,e))return;await at(E)}throw new it(`Timed out waiting for ${o}:${String(e)} to accept TCP connections (${String(s)}ms)`,Date.now()-i)},nt=(t,o)=>new Promise(e=>{const s=new G,i=r=>{s.removeAllListeners(),s.destroy(),e(r)};s.once("connect",()=>{i(!0)}),s.once("error",()=>{i(!1)}),s.setTimeout(E,()=>{i(!1)});try{s.connect(o,t)}catch{i(!1)}}),at=t=>new Promise(o=>{setTimeout(o,t)}),ct=async(t,o)=>{const e=t.readiness??(t.port===void 0?void 0:{tcp:{port:t.port}});e&&await rt({host:e.tcp.host,port:e.tcp.port,timeoutMs:o?.timeoutMs??e.tcp.timeoutMs})},_=384,b=5e3,ht=50,dt=3e4,h=async t=>{const o=c(z(t),"services");try{await L(o)}catch(e){throw e.code==="ENOTDIR"?new Error(`Service registry path ${o} exists but is not a directory. Remove it or move the conflicting file before running \`vis service\`.`,{cause:e}):e}return o},y=t=>t.replaceAll("/","_").replaceAll(":","__"),g=(t,o)=>c(t,`${y(o)}.json`),ft=(t,o)=>c(t,`${y(o)}.lock`),u=async(t,o)=>{const e=await h(t),s=g(e,o);if(await q(s))try{return await $(s)}catch{return}},lt=async t=>{const o=await h(t);let e;try{e=await B(o)}catch{return[]}const s=[];for(const i of e)if(i.endsWith(".json"))try{const r=await $(c(o,i));s.push(r)}catch{}return s},ut=async(t,o)=>{const e=await h(t),s=g(e,o.id),i=c(e,`.${V(8).toString("hex")}.tmp`);await U(i,`${JSON.stringify(o,void 0,2)}
|
|
2
|
+
`,{mode:_});try{await mt(i,s)}catch(r){throw await k(i,{force:!0}).catch(()=>{}),r}},pt=new Set(["EACCES","EBUSY","EPERM"]),wt=8,kt=20,mt=async(t,o)=>{let e=0;for(;;)try{await X(t,o);return}catch(s){const{code:i}=s;if(!(i!==void 0&&pt.has(i))||e>=wt)throw s;const r=kt*2**e;await new Promise(n=>{setTimeout(n,r)}),e+=1}},f=async(t,o,e)=>{const s=await h(t),i=e??await u(t,o);await k(g(s,o),{force:!0}),i&&await k(i.logFile,{force:!0}).catch(()=>{})},a=t=>{try{return process.kill(t,0),!0}catch{return!1}},jt=async t=>{const o=await lt(t),e=[],s=[];for(const i of o){if(a(i.pid)){s.push(i);continue}const r=await u(t,i.id);if(r&&r.pid!==i.pid){s.push(r);continue}await f(t,i.id,i).catch(()=>{}),e.push(i.id)}return{pruned:e,surviving:s}},_t=t=>new Promise(o=>{setTimeout(o,t)}),yt=async t=>{try{const o=await Y(t,"wx",_);try{await o.writeFile(String(process.pid))}finally{await o.close().catch(()=>{})}return!0}catch(o){if(o.code==="EEXIST")return!1;throw o}},gt=async t=>{let o;try{const e=await J(t,"utf8"),s=Number.parseInt(e.trim(),10);o=Number.isFinite(s)?s:void 0}catch{return!0}if(o!==void 0&&!a(o))return!0;try{const e=await K(t);return Date.now()-e.mtimeMs>dt}catch{return!0}},M=async(t,o,e)=>{const s=await h(t),i=ft(s,o),r=Date.now();for(;!await yt(i);){if(await gt(i)){await v(i).catch(()=>{});continue}if(Date.now()-r>=b)throw new Error(`Could not acquire service lock for ${o} within ${String(b)}ms — another \`vis service\` invocation appears to be holding it.`);await _t(ht)}try{return await e()}finally{await v(i).catch(()=>{})}};function m(t,o={},e){for(const s in t){const i=t[s],r=e?`${e}:${s}`:s;typeof i=="object"&&i!==null?m(i,o,r):typeof i=="function"&&(o[r]=i)}return o}const R=(()=>{if(console.createTask)return console.createTask;const t={run:o=>o()};return()=>t})();function T(t,o,e,s){for(let i=e;i<t.length;i+=1)try{const r=s?s.run(()=>t[i](...o)):t[i](...o);if(r&&typeof r.then=="function")return Promise.resolve(r).then(()=>T(t,o,i+1,s))}catch(r){return Promise.reject(r)}}function vt(t,o,e){if(t.length>0)return T(t,o,0,R(e))}function bt(t,o,e){if(t.length>0){const s=R(e);return Promise.all(t.map(i=>s.run(()=>i(...o))))}}function w(t,o){for(const e of[...t])e(o)}var St=class{_hooks;_before;_after;_deprecatedHooks;_deprecatedMessages;constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(t,o,e={}){if(!t||typeof o!="function")return()=>{};const s=t;let i;for(;this._deprecatedHooks[t];)i=this._deprecatedHooks[t],t=i.to;if(i&&!e.allowDeprecated){let r=i.message;r||(r=`${s} hook has been deprecated`+(i.to?`, please use ${i.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(r)||(console.warn(r),this._deprecatedMessages.add(r))}if(!o.name)try{Object.defineProperty(o,"name",{get:()=>"_"+t.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(o),()=>{o&&(this.removeHook(t,o),o=void 0)}}hookOnce(t,o){let e,s=(...i)=>(typeof e=="function"&&e(),e=void 0,s=void 0,o(...i));return e=this.hook(t,s),e}removeHook(t,o){const e=this._hooks[t];if(e){const s=e.indexOf(o);s!==-1&&e.splice(s,1),e.length===0&&(this._hooks[t]=void 0)}}clearHook(t){this._hooks[t]=void 0}deprecateHook(t,o){this._deprecatedHooks[t]=typeof o=="string"?{to:o}:o;const e=this._hooks[t]||[];this._hooks[t]=void 0;for(const s of e)this.hook(t,s)}deprecateHooks(t){for(const o in t)this.deprecateHook(o,t[o])}addHooks(t){const o=m(t),e=Object.keys(o).map(s=>this.hook(s,o[s]));return()=>{for(const s of e)s();e.length=0}}removeHooks(t){const o=m(t);for(const e in o)this.removeHook(e,o[e])}removeAllHooks(){this._hooks={}}callHook(t,...o){return this.callHookWith(vt,t,o)}callHookParallel(t,...o){return this.callHookWith(bt,t,o)}callHookWith(t,o,e){const s=this._before||this._after?{name:o,args:e,context:{}}:void 0;this._before&&w(this._before,s);const i=t(this._hooks[o]?[...this._hooks[o]]:[],e,o);return i instanceof Promise?i.finally(()=>{this._after&&s&&w(this._after,s)}):(this._after&&s&&w(this._after,s),i)}beforeEach(t){return this._before=this._before||[],this._before.push(t),()=>{if(this._before!==void 0){const o=this._before.indexOf(t);o!==-1&&this._before.splice(o,1)}}}afterEach(t){return this._after=this._after||[],this._after.push(t),()=>{if(this._after!==void 0){const o=this._after.indexOf(t);o!==-1&&this._after.splice(o,1)}}}};function Ht(){return new St}const xt=()=>Ht(),Ot=async(t,o)=>{if(!(!o||o.length===0))for(const e of o){if(e.hooks)for(const[s,i]of Object.entries(e.hooks)){const r=Array.isArray(i)?i:[i];for(const n of r)t.hook(s,n)}e.setup&&await e.setup(t)}};class It{#e;#o;#s=new Map;constructor(o,e){this.#e=o,this.#o=e}startTasks(o){for(const e of o)this.#s.set(e.id,e),this.#t("task:before",e)}endTasks(o){for(const e of o)this.#s.delete(e.task.id),this.#t("task:after",e.task,e),e.status==="failure"?this.#t("task:failure",e.task,e):$t(e.status)&&this.#t("task:cacheHit",e.task,e)}printCacheMiss(o,e){this.#t("task:cacheMiss",o,e)}onTaskStdout(o,e){this.#t("task:stdout",o,e)}onTaskStderr(o,e){this.#t("task:stderr",o,e)}#t(o,...e){Promise.resolve(this.#e.callHook(o,...e)).catch(s=>{if(this.#o)try{this.#o(o,s)}catch{}})}}const $t=t=>t==="local-cache"||t==="local-cache-kept-existing"||t==="remote-cache",S=process.platform==="win32",Et=async t=>{const{command:o,cwd:e,env:s,logFile:i}=t,r=tt(i,"a",_);let n;const p=S?"cmd":"/bin/sh",j=S?["/d","/s","/c",o]:["-c",o];try{n=Z(p,j,{cwd:e,detached:!0,env:et({...process.env,...s},e),stdio:["ignore",r,r],windowsHide:!0})}finally{ot(r)}if(n.pid===void 0&&await new Promise((x,O)=>{n.once("spawn",()=>{x()}),n.once("error",I=>{O(I)})}),n.pid===void 0)throw new Error(`Failed to spawn detached process for command: ${o}`);return n.unref(),{pid:n.pid}},P=5e3,At=async t=>M(t.workspaceRoot,t.id,async()=>{const o=await u(t.workspaceRoot,t.id);if(o&&a(o.pid))throw new Error(`Service ${t.id} is already running (pid ${String(o.pid)})`);o&&await f(t.workspaceRoot,t.id,o);const e=await h(t.workspaceRoot),s=y(t.id),i=c(e,`${s}.log`),{pid:r}=await Et({command:t.command,cwd:t.cwd,env:t.env,logFile:i}),n={command:t.command,config:t.config,cwd:t.cwd,env:t.config.env??{},id:t.id,logFile:i,pid:r,slug:s,startedAt:new Date().toISOString(),visVersion:process.env.VIS_VERSION??"0.0.0"};if(await ut(t.workspaceRoot,n),t.skipReadiness!==!0)try{await ct(t.config,{timeoutMs:t.readinessTimeoutMs})}catch(p){throw await D(r,t.config.killGracePeriodMs??P).catch(()=>{}),await f(t.workspaceRoot,t.id,n).catch(()=>{}),p}return{entry:n}}),Ft=async t=>M(t.workspaceRoot,t.id,async()=>{const o=await u(t.workspaceRoot,t.id);if(!o)return{stopped:!1};if(!a(o.pid))return await f(t.workspaceRoot,t.id,o),{stopped:!1};const e=t.graceMs??o.config.killGracePeriodMs??P;return await D(o.pid,e),await f(t.workspaceRoot,t.id,o),{stopped:!0}}),D=async(t,o)=>{H(t,"SIGTERM");const e=Date.now();for(;Date.now()-e<o;){if(!a(t))return;await new Promise(s=>{setTimeout(s,100)})}a(t)&&H(t,"SIGKILL")},H=(t,o)=>{try{process.platform==="win32"?process.kill(t,o):process.kill(-t,o)}catch(e){if(e.code==="ESRCH")return;throw e}};export{It as H,it as S,At as a,ct as b,lt as c,xt as d,Ot as e,f,a as i,jt as p,u as r,Ft as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as f}from"node:module";import{m as c}from"./index-DND6ptxQ.js";let p;const k=e=>(p??=f(import.meta.url))(e),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,g=e=>{if(typeof a<"u"&&a.versions&&a.versions.node){const[t,n]=a.versions.node.split(".").map(Number);if(t>22||t===22&&n>=3||t===20&&n>=16)return a.getBuiltinModule(e)}return k(e)},{statSync:m,existsSync:d}=g("node:fs"),b={aube:["aube-lock.yaml"],bun:["bun.lock","bun.lockb"],npm:["npm-shrinkwrap.json","package-lock.json"],pnpm:["pnpm-lock.yaml"],yarn:["yarn.lock"]},y={aube:["node_modules/.aube-state","node_modules/.modules.yaml"],bun:["node_modules/.bun-tag"],npm:["node_modules/.package-lock.json"],pnpm:["node_modules/.modules.yaml","node_modules/.pnpm/lock.yaml"],yarn:["node_modules/.yarn-integrity","node_modules/.yarn-state.yml",".yarn/install-state.gz"]},_={ci:{aube:"aube ci",bun:"bun install --frozen-lockfile",npm:"npm ci",pnpm:"pnpm install --frozen-lockfile",yarn:"yarn install --immutable"},tty:{aube:"aube install",bun:"bun install",npm:"npm install",pnpm:"pnpm install",yarn:"yarn install"}},h=1e3,M=e=>{for(const[t,n]of Object.entries(b))for(const s of n)if(d(c(e,s)))return{lockfileFile:s,manager:t}},j=(e,t)=>{let n;for(const s of y[t]){const o=c(e,s);if(!d(o))continue;const{mtimeMs:i}=m(o);(!n||i>n.mtimeMs)&&(n={mtimeMs:i,path:s})}return n},C=(e,t={})=>{const n=M(e);if(!n)return{checked:!1};const{lockfileFile:s,manager:o}=n,i=m(c(e,s)).mtimeMs,l=j(e,o),u=_[t.inCi?"ci":"tty"][o],r={installMarkerMtimeMs:l?.mtimeMs,lockfileMtimeMs:i,lockfilePath:s,marker:l?.path,packageManager:o};return l?i>l.mtimeMs+h?{checked:!0,detail:r,failure:"stale-install",message:`${s} is newer than node_modules (${l.path}) — run \`${u}\` to sync.`}:{checked:!0,detail:r}:{checked:!0,detail:r,failure:"missing-install",message:`lockfile detected but node_modules looks uninitialised — run \`${u}\` before \`vis run\`.`}},v=(e,t,n,s={})=>{if(s.skip)return{checked:!1,shouldContinue:!0};const o=C(e,{inCi:t});if(!o.failure)return{...o,shouldContinue:!0};const i=`preflight: ${o.message??"lockfile drift detected"}`;return t&&!s.ciAsWarning?{...o,formattedMessage:i,shouldContinue:!1}:(n.warn(i),{...o,formattedMessage:i,shouldContinue:!0})};export{M as d,v as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as O}from"node:module";let $;const P=t=>($??=O(import.meta.url))(t),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=t=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,s]=u.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return u.getBuiltinModule(t)}return P(t)},{spawn:S}=h("node:child_process"),{cwd:y}=u,{basename:A,normalize:T,delimiter:p,resolve:E,dirname:f}=h("node:path"),{pipeline:k}=h("node:stream/promises"),{PassThrough:j}=h("node:stream"),q=h("node:readline"),{openSync:B,readSync:H,closeSync:M,statSync:R}=h("node:fs"),F=/^path$/i,w={key:"PATH",value:""};function b(t){for(const e in t){if(!Object.prototype.hasOwnProperty.call(t,e)||!F.test(e))continue;const s=t[e];return s?{key:e,value:s}:w}return w}function L(t,e){const s=e.value.split(p),r=[];let n=t,i;do r.push(E(n,"node_modules",".bin")),i=n,n=f(n);while(n!==i);r.push(f(process.execPath));const o=r.concat(s).join(p);return{key:e.key,value:o}}function W(t,e,s=!0){const r={...process.env,...e};if(!s)return r;const n=L(t,b(r));return r[n.key]=n.value,r}const X=t=>{let e=t.length;const s=new j,r=()=>{--e===0&&s.end()};for(const n of t)k(n,s,{end:!1}).then(r).catch(r);return s},_=/([()\][%!^"`<>&|;, *?])/g,z=/^#!\s*(.+)/,D=/\.(?:com|exe)$/i,I=/node_modules[\\/]\.bin[\\/][^\\/]+\.cmd$/i,N=process.platform==="win32",V=[".EXE",".CMD",".BAT",".COM"];function G(t,e=[],s={}){if(s.shell===!0||!N)return{command:t,args:e,options:s};let r=g(t,s),n=null;if(r!==null){const i=Buffer.alloc(150);let o=null;try{o=B(r,"r"),H(o,i,0,150,0)}catch{}finally{o!==null&&M(o)}const c=i.toString().match(z);if(c!==null){const l=c[1].trim(),a=l.indexOf(" "),d=a!==-1?l.slice(0,a):l,x=a!==-1?l.slice(a+1):"",m=A(d);n=m==="env"?x||null:m}}if(n!==null&&r!==null&&(e=[r,...e],t=n,r=g(t,s)),r===null||!D.test(r)){const i=r!==null&&I.test(r);t=T(t),t=t.replace(_,"^$1"),e=e.map(o=>(o=o.replace(/(?=(\\+?)?)\1"/g,'$1$1\\"'),o=o.replace(/(?=(\\+?)?)\1$/,"$1$1"),o=`"${o}"`,o=o.replace(_,"^$1"),i&&(o=o.replace(_,"^$1")),o)),e=["/d","/s","/c",`"${[t,...e].join(" ")}"`],t=s.env?.comspec??"cmd.exe",s={...s,windowsVerbatimArguments:!0}}return{command:t,args:e,options:s}}function g(t,e){const s=(e.cwd??y()).toString(),r=e.env??process.env,n=b(r).value,i=t.includes("/")||t.includes("\\")?[""]:[s,...n.split(p)],o=r.PATHEXT?r.PATHEXT.split(p):V;t.includes(".")&&o[0]!==""&&o.unshift("");for(const c of i){const l=E(s,c.startsWith('"')&&c.endsWith('"')&&c.length>1?c.slice(1,-1):c,t);for(const a of o){const d=l+a;try{if(R(d).isFile())return d}catch{}}}return null}var v=class extends Error{result;output;get exitCode(){if(this.result.exitCode!==null)return this.result.exitCode}constructor(t,e){super(`Process exited with non-zero status (${t.exitCode})`),this.result=t,this.output=e}};const J={timeout:void 0,persist:!1},Q={windowsHide:!0};function Y(t){const e=new AbortController;for(const s of t){if(s.aborted)return e.abort(),s;const r=()=>{e.abort(s.reason)};s.addEventListener("abort",r,{signal:e.signal})}return e.signal}async function C(t){let e="";try{for await(const s of t)e+=s.toString()}catch{}return e}var Z=class{_process;_aborted=!1;_options;_command;_args;_resolveClose;_processClosed;_thrownError;get process(){return this._process}get pid(){return this._process?.pid}get exitCode(){if(this._process&&this._process.exitCode!==null)return this._process.exitCode}constructor(t,e,s){this._options={...J,...s},this._command=t,this._args=e??[],this._processClosed=new Promise(r=>{this._resolveClose=r})}kill(t){return this._process?.kill(t)===!0}get aborted(){return this._aborted}get killed(){return this._process?.killed===!0}pipe(t,e,s){return U(t,e,{...s,stdin:this})}async*[Symbol.asyncIterator](){const t=this._process;if(!t)return;const e=[];this._streamErr&&e.push(this._streamErr),this._streamOut&&e.push(this._streamOut);const s=X(e),r=q.createInterface({input:s});for await(const n of r)yield n.toString();if(await this._processClosed,t.removeAllListeners(),this._thrownError)throw this._thrownError;if(this._options?.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new v(this)}async _waitForOutput(){const t=this._process;if(!t)throw new Error("No process was started");const[e,s]=await Promise.all([this._streamOut?C(this._streamOut):"",this._streamErr?C(this._streamErr):""]);await this._processClosed;const{stdin:r}=this._options;if(r&&typeof r!="string"&&await r,t.removeAllListeners(),this._thrownError)throw this._thrownError;const n={stderr:s,stdout:e,exitCode:this.exitCode};if(this._options.throwOnError&&this.exitCode!==0&&this.exitCode!==void 0)throw new v(this,n);return n}then(t,e){return this._waitForOutput().then(t,e)}_streamOut;_streamErr;spawn(){const t=y(),e=this._options,s={...Q,...e.nodeOptions},r=[];this._resetState(),e.timeout!==void 0&&r.push(AbortSignal.timeout(e.timeout)),e.signal!==void 0&&r.push(e.signal),e.persist===!0&&(s.detached=!0),r.length>0&&(s.signal=Y(r)),s.env=W(t,s.env,e.nodePath);const n=G(this._command,this._args,s),i=S(n.command,n.args,n.options);if(i.stderr&&(this._streamErr=i.stderr),i.stdout&&(this._streamOut=i.stdout),this._process=i,i.once("error",this._onError),i.once("close",this._onClose),i.stdin){const{stdin:o}=e;typeof o=="string"?i.stdin.end(o):o?.process?.stdout?.pipe(i.stdin)}}_resetState(){this._aborted=!1,this._processClosed=new Promise(t=>{this._resolveClose=t}),this._thrownError=void 0}_onError=t=>{if(t.name==="AbortError"&&(!(t.cause instanceof Error)||t.cause.name!=="TimeoutError")){this._aborted=!0;return}this._thrownError=t};_onClose=()=>{this._resolveClose&&this._resolveClose()}};const K=(t,e,s)=>{const r=new Z(t,e,s);return r.spawn(),r},U=K;export{K as k};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as j}from"node:module";import{m as d,l as y}from"./index-DND6ptxQ.js";import{a as q}from"./readJsonSync-BnWiH5-R-BpnwAB0Z.js";let M;const b=i=>(M??=j(import.meta.url))(i),f=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$=i=>{if(typeof f<"u"&&f.versions&&f.versions.node){const[e,t]=f.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return f.getBuiltinModule(i)}return b(i)},{readdirSync:g,lstatSync:S}=$("node:fs"),A=/^([^<(]+?)?(?:<([^>]+)>)?\s*(?:\(([^)]+)\))?\s*$/u,w=i=>{const e=i.match(A);if(!e)return;const t=e[1]?.trim(),n=e[2]?.trim(),r=e[3]?.trim();if(!(!t&&!n&&!r))return{email:n||void 0,name:t||void 0,url:r||void 0}},R=i=>{if(!Array.isArray(i)||i.length===0)return;const e=[];for(const t of i)if(typeof t=="string"){const n=w(t);n&&e.push(n)}else if(t&&typeof t=="object"){const n=t,r=typeof n.name=="string"?n.name:void 0,o=typeof n.email=="string"?n.email:void 0,u=typeof n.url=="string"?n.url:void 0;(r||o||u)&&e.push({email:o,name:r,url:u})}return e.length>0?e:void 0},D=i=>{const e=d(i,"node_modules");if(!y(e))return new Map;const t=new Map,n=new Set,r=(o,u="")=>{if(n.has(o))return;n.add(o);let _;try{_=g(o)}catch{return}for(const a of _){const c=d(o,a);let m;try{m=S(c)}catch{continue}if(m.isSymbolicLink())continue;if(a.startsWith("@")){m.isDirectory()&&r(c,`${a}/`);continue}if(a===".pnpm"&&u===""){let s;try{s=g(c)}catch{continue}for(const p of s){const l=d(c,p,"node_modules");y(l)&&r(l)}continue}if(a.startsWith(".")||!m.isDirectory())continue;const h=u+a,v=d(c,"package.json");try{if(!y(v))continue;const s=q(v);if(typeof s.version!="string")continue;const p=`${h}@${s.version}`;t.has(p)||t.set(p,{directory:c,license:s.license,licenses:Array.isArray(s.licenses)?s.licenses:void 0,maintainers:R(s.maintainers),name:h,scripts:s.scripts&&typeof s.scripts=="object"?s.scripts:void 0,version:s.version});const l=d(c,"node_modules");y(l)&&r(l)}catch{}}};return r(e),t};export{R as n,D as r};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
|
-
import{m as d,
|
|
1
|
+
import{m as d,l as u,z as o,q as $}from"./index-DND6ptxQ.js";import{a as k}from"../packem_chunks/cli-main.js";const E=(x,g,h,m=[])=>{const t=[];if(h===void 0)return t.push("minimumReleaseAge not set in vis.config; skipping native sync."),t;const l=Number.isFinite(h)?Math.max(0,Math.round(h)):0;switch(x){case"bun":{const n=d(g,"bunfig.toml");let e=u(n)?o(n):"";const a=l*60,i=`minimumReleaseAge = ${String(a)}`,s=m.length>0?`minimumReleaseAgeExcludes = [${m.map(p=>`"${p.replaceAll(String.raw`"`,String.raw`\"`)}"`).join(", ")}]`:void 0,c=/^\[install\][ \t]*\n/m.exec(e);if(c?.index===void 0){const p=s?`${i}
|
|
2
2
|
${s}`:i;e=`${e.trimEnd()?`${e.trimEnd()}
|
|
3
3
|
|
|
4
4
|
`:""}[install]
|
|
5
5
|
${p}
|
|
6
|
-
`}else{const p=c.index+c[0].length,
|
|
6
|
+
`}else{const p=c.index+c[0].length,R=e.slice(p),A=/^\[/m.exec(R),y=A?.index===void 0?e.length:p+A.index;let r=e.slice(p,y);r=/^[ \t]*minimumReleaseAge[ \t]*=/m.test(r)?r.replace(/^[ \t]*minimumReleaseAge[ \t]*=.*$/m,i):`${i}
|
|
7
7
|
${r}`,s&&(r=/^[ \t]*minimumReleaseAgeExcludes[ \t]*=/m.test(r)?r.replace(/^[ \t]*minimumReleaseAgeExcludes[ \t]*=.*$/m,s):`${s}
|
|
8
8
|
${r}`),e=`${e.slice(0,p)}${r}${e.slice(y)}`}$(n,e.endsWith(`
|
|
9
9
|
`)?e:`${e}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{l as c,m as h,B as a,I as f}from"./index-DND6ptxQ.js";import{x as d,P as g}from"../packem_chunks/catalog.js";const k=/\/+$/,p=/node_modules/,u=/\.git/,$=/[$()+.?[\\\]^{|}]/g,S=/\/\*\*$|\/\*\/\*$/,x=(i,l)=>{const e=l.replace(k,"");if(e.startsWith("!"))return[];const n=[];if(e.endsWith("/*")){const s=e.slice(0,-2),t=a(i,s);if(!c(t))return[];for(const r of f(t,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[p,u]}))r.path===t||r.name.startsWith(".")||n.push(h(s,r.name));return n}if(e.endsWith("/**")||e.endsWith("/*/*")){const s=e.replace(S,""),t=a(i,s);if(!c(t))return[];for(const r of f(t,{includeFiles:!1,includeSymlinks:!1,skip:[p,u]})){if(r.path===t)continue;const m=r.path.slice(t.length+1);n.push(`${s}/${m}`)}return n}if(!e.includes("/")&&e.includes("*")){const s=e.replaceAll($,String.raw`\$&`).replaceAll("*",".*"),t=new RegExp(`^${s}$`);for(const r of f(i,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[p,u]}))r.path!==i&&t.test(r.name)&&n.push(r.name);return n}const o=a(i,e);return c(o)&&n.push(e),n},w=i=>{const l=d(i)??g(i)??[],e=new Set,n=[];for(const o of l)for(const s of x(i,o))s==="."||e.has(s)||(e.add(s),c(h(i,s,"package.json"))||n.push({packageDir:s}));return n};export{w as l};
|
package/dist/packem_shared/{native-config-sync-DDKjAy0i.js → native-config-sync-C0pUePad.js}
RENAMED
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import{m as c,
|
|
2
|
-
`),s.push(`Updated package.json trustedDependencies with ${
|
|
1
|
+
import{m as c,z as $,q as i,l as y,u as O}from"./index-DND6ptxQ.js";import"./public-api-WqUCiyIe.js";import{n as C}from"../packem_chunks/cli-main.js";import{a as D}from"./readJsonSync-BnWiH5-R-BpnwAB0Z.js";const W=(E,a,o)=>{const s=[],f=Object.entries(o).filter(([,n])=>n).map(([n])=>n);switch(E){case"bun":{const n=c(a,"package.json");if(y(n))try{const e=D(n);e.trustedDependencies=f,i(n,`${JSON.stringify(e,null,2)}
|
|
2
|
+
`),s.push(`Updated package.json trustedDependencies with ${f.length} packages`)}catch(e){s.push(`Failed to update package.json: ${e instanceof Error?e.message:String(e)}`)}break}case"npm":{const n=c(a,".npmrc");let e=y(n)?$(n):"";/^\s*ignore-scripts\s*=\s*true\s*$/m.test(e)?s.push(".npmrc already has ignore-scripts=true"):(e=`${e.trimEnd()}
|
|
3
3
|
ignore-scripts=true
|
|
4
|
-
`,i(n,e),s.push("Added ignore-scripts=true to .npmrc"));break}case"pnpm":{const n=c(a,"pnpm-workspace.yaml");if(!y(n)){s.push("pnpm-workspace.yaml not found. Cannot sync allowBuilds.");break}let e={},m=[];try{const t=O(n);e=t?.allowBuilds??{},m=Array.isArray(t?.onlyBuiltDependencies)?t.onlyBuiltDependencies:[]}catch{}const g={...e,...o},j=Object.keys(o).filter(t=>e[t]!==o[t]).length,d
|
|
4
|
+
`,i(n,e),s.push("Added ignore-scripts=true to .npmrc"));break}case"pnpm":{const n=c(a,"pnpm-workspace.yaml");if(!y(n)){s.push("pnpm-workspace.yaml not found. Cannot sync allowBuilds.");break}let e={},m=[];try{const t=O(n);e=t?.allowBuilds??{},m=Array.isArray(t?.onlyBuiltDependencies)?t.onlyBuiltDependencies:[]}catch{}const g={...e,...o},j=Object.keys(o).filter(t=>e[t]!==o[t]).length,d=f.toSorted((t,p)=>t.localeCompare(p)),k=[...new Set([...m,...d])].toSorted((t,p)=>t.localeCompare(p)),b=d.filter(t=>!m.includes(t)).length;if(j===0&&b===0)s.push(`All ${String(Object.keys(o).length)} allowBuilds entries already present in pnpm-workspace.yaml.`);else{const t=Object.keys(g).sort(),p=l=>l.startsWith("@")||l.includes("/")||/[:#\s]/.test(l),h=l=>p(l)?`'${l.replaceAll("'","''")}'`:l,u=`allowBuilds:
|
|
5
5
|
${t.map(l=>` ${h(l)}: ${String(g[l])}`).join(`
|
|
6
6
|
`)}
|
|
7
|
-
`;let r
|
|
7
|
+
`;let r=$(n);r.endsWith(`
|
|
8
8
|
`)||(r+=`
|
|
9
9
|
`);const S=/^allowBuilds:[ \t]*\n(?:[ \t]{2}[^\n]*\n)*/m;if(r=S.test(r)?r.replace(S,u):`${r.trimEnd()}
|
|
10
10
|
|
|
@@ -14,8 +14,8 @@ ${k.map(B=>` - ${p(B)?`'${B.replaceAll("'","''")}'`:B}`).join(`
|
|
|
14
14
|
`,A=/^onlyBuiltDependencies:[ \t]*\n(?:[ \t]{2}[^\n]*\n)*/m;r=A.test(r)?r.replace(A,l):`${r.trimEnd()}
|
|
15
15
|
|
|
16
16
|
${l}`}i(n,r),s.push(`Updated pnpm-workspace.yaml allowBuilds (${String(j)} new, ${String(t.length)} total)`),b>0&&s.push(`Updated pnpm-workspace.yaml onlyBuiltDependencies (${String(b)} new, ${String(k.length)} total)`)}const w=c(a,"package.json");if(y(w)&&d.length>0)try{const t=D(w),p=Array.isArray(t.pnpm?.onlyBuiltDependencies)?t.pnpm.onlyBuiltDependencies:[],h=[...new Set([...p,...d])].toSorted((r,S)=>r.localeCompare(S)),u=d.filter(r=>!p.includes(r)).length;u>0&&(t.pnpm={...t.pnpm,onlyBuiltDependencies:h},i(w,`${JSON.stringify(t,null,2)}
|
|
17
|
-
`),s.push(`Updated package.json pnpm.onlyBuiltDependencies (${String(u)} new, ${String(h.length)} total)`))}catch(t){s.push(`Failed to update package.json pnpm.onlyBuiltDependencies: ${t instanceof Error?t.message:String(t)}`)}break}case"yarn":{if(C(a)){const n=c(a,".yarnrc.yml");let e
|
|
17
|
+
`),s.push(`Updated package.json pnpm.onlyBuiltDependencies (${String(u)} new, ${String(h.length)} total)`))}catch(t){s.push(`Failed to update package.json pnpm.onlyBuiltDependencies: ${t instanceof Error?t.message:String(t)}`)}break}case"yarn":{if(C(a)){const n=c(a,".yarnrc.yml");let e=$(n);const m=/^\s*enableScripts\s*:/m.test(e),g=/^\s*enableScripts\s*:\s*false\s*$/m.test(e);m?g?s.push(".yarnrc.yml already has enableScripts: false"):(e=e.replace(/^\s*enableScripts\s*:.+$/m,"enableScripts: false"),i(n,e),s.push("Changed enableScripts to false in .yarnrc.yml")):(e=`${e.trimEnd()}
|
|
18
18
|
enableScripts: false
|
|
19
|
-
`,i(n,e),s.push("Added enableScripts: false to .yarnrc.yml"))}else{const n=c(a,".npmrc");let e=y(n)
|
|
19
|
+
`,i(n,e),s.push("Added enableScripts: false to .yarnrc.yml"))}else{const n=c(a,".npmrc");let e=y(n)?$(n):"";/^\s*ignore-scripts\s*=\s*true\s*$/m.test(e)?s.push(".npmrc already has ignore-scripts=true"):(e=`${e.trimEnd()}
|
|
20
20
|
ignore-scripts=true
|
|
21
21
|
`,i(n,e),s.push("Added ignore-scripts=true to .npmrc (yarn classic lacks enableScripts)"))}break}}return s};export{W as O};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as j}from"node:module";import{k as W}from"./target-merge-b7bE1AEx.js";import{osvBloomDecode as J,osvBloomProbeBatch as z,NATIVE_BINDING_VERSION as D}from"#native";let C;const U=e=>(C??=j(import.meta.url))(e),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,p=e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[o,t]=h.versions.node.split(".").map(Number);if(o>22||o===22&&t>=3||o===20&&t>=16)return h.getBuiltinModule(e)}return U(e)},{createHash:V,randomUUID:F}=p("node:crypto"),{existsSync:g}=p("node:fs"),{readFile:O,mkdir:M,stat:B,writeFile:H,rename:G,unlink:q}=p("node:fs/promises"),{join:d,dirname:P}=p("node:path"),I=6;if(D!==I)throw new Error(`vis native binding ABI mismatch in osv-bloom: expected ${I}, got ${D}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const rt="https://endevco.github.io/osv-bloom",K=new Set(["endevco.github.io"]);class w extends Error{cause="OSV_BLOOM_SOURCE_NOT_ALLOWED";constructor(o){super(`osv-bloom source host '${o}' is not in the built-in allowlist. Add it to \`security.audit.advisories.bloom.allowedHosts\` if intentional.`),this.name="OsvBloomSourceNotAllowedError"}}class _ extends Error{cause="OSV_BLOOM_NETWORK";constructor(o,t){super(`osv-bloom fetch failed for ${o}: ${t}. Check connectivity, proxy env vars, or --source.`),this.name="OsvBloomNetworkError"}}class Y extends Error{cause="OSV_BLOOM_INTEGRITY";constructor(o,t){super(`osv-bloom filter.bin sha256 mismatch (expected ${o}, got ${t}). Refusing to install a corrupted filter.`),this.name="OsvBloomIntegrityError"}}class m extends Error{cause="OSV_BLOOM_MANIFEST";constructor(o){super(`osv-bloom manifest invalid: ${o}`),this.name="OsvBloomManifestError"}}class Q extends Error{cause="OSV_BLOOM_CACHE_MISS";constructor(o){super(`No osv-bloom cache at ${o}. Run 'vis advisories bloom sync' first.`),this.name="OsvBloomCacheMissError"}}const y=e=>{const o=W("vis",{create:!0,cwd:e})??d(e,"node_modules",".cache","vis");return d(o,"osv-bloom")},l=e=>d(e,"filter.bin"),R=e=>d(e,"manifest.json"),x=e=>d(e,"state.json"),X=(e,o)=>{let t;try{t=new URL(e)}catch{throw new w(e)}if(!t.host)throw new w(e);if(t.protocol!=="https:")throw new w(`${t.protocol}//${t.host}`);if(!new Set([...K,...o??[]]).has(t.host))throw new w(t.host);return t},it=async e=>{const o=Date.now(),t=e.cacheDir??y(e.workspaceRoot);await M(t,{recursive:!0});const s=X(e.source,e.allowedHosts),i=new URL("manifest.json",N(s.toString())),r=new URL("filter.bin",N(s.toString())),n=await A(i,{method:"GET"});if(!n.ok)throw new _(i.toString(),n.status);const v=await n.text(),a=k(v),f=await L(t);if(!e.force&&f?.setDigestSha256===a.setDigestSha256&&g(l(t)))return{bytesOnDisk:(await B(l(t))).size,cacheDir:t,durationMs:Date.now()-o,manifest:a,upToDate:!0};const S={};!e.force&&f?.filterEtag&&(S.headers={"if-none-match":f.filterEtag});const u=await A(r,{...S,method:"GET"});if(u.status===304&&f&&g(l(t)))return await $(t,v,{fetchedAtIso:new Date().toISOString(),filterEtag:f.filterEtag,setDigestSha256:a.setDigestSha256}),{bytesOnDisk:(await B(l(t))).size,cacheDir:t,durationMs:Date.now()-o,manifest:a,upToDate:!0};if(!u.ok||!u.body)throw new _(r.toString(),u.status);const c=Buffer.from(await u.arrayBuffer());e.onProgress&&e.onProgress(c.length,c.length);const E=Z(c);if(E!==a.filterSha256)throw new Y(a.filterSha256,E);if(c.length!==a.bloomByteLen)throw new m(`filter.bin length ${c.length} does not match manifest.bloom_byte_len ${a.bloomByteLen}`);const T=u.headers.get("etag")??void 0;return await b(l(t),c),await $(t,v,{fetchedAtIso:new Date().toISOString(),filterEtag:T,setDigestSha256:a.setDigestSha256}),{bytesOnDisk:c.length,cacheDir:t,durationMs:Date.now()-o,manifest:a,upToDate:!1}},nt=async(e,o)=>{const t=o?.cacheDir??y(e),s=l(t);if(!g(s)){if(o?.softFail)return null;throw new Q(t)}const i=await O(s);return J(i)},at=(e,o)=>z(e,o),ct=async(e,o)=>{const t=o??y(e);if(!g(l(t)))return{cacheDir:t,present:!1};let s,i;try{s=k(await O(R(t),"utf8"))}catch{}try{i=await L(t)}catch{}return{cacheDir:t,fetchedAtIso:i?.fetchedAtIso,manifest:s,present:!0}},k=e=>{let o;try{o=JSON.parse(e)}catch(r){throw new m(r instanceof Error?r.message:String(r))}const t=r=>{const n=o[r];if(typeof n!="number"||Number.isNaN(n))throw new m(`field '${r}' missing or non-numeric`);return n},s=r=>{const n=o[r];if(typeof n!="string"||n.length===0)throw new m(`field '${r}' missing or empty`);return n},i=t("format_version");if(i!==1)throw new m(`unsupported format_version ${i} (this build expects v1)`);return{advisoryCount:t("advisory_count"),bloomByteLen:t("bloom_byte_len"),bloomKHashes:t("bloom_k_hashes"),bloomMBits:t("bloom_m_bits"),builtAtRfc3339:s("built_at_rfc3339"),builtAtUnix:t("built_at_unix"),entryCount:t("entry_count"),filterSha256:s("filter_sha256"),formatVersion:i,setDigestSha256:s("set_digest_sha256"),sourceUrl:s("source_url"),targetFpr:t("target_fpr")}},L=async e=>{try{const o=await O(x(e),"utf8"),t=JSON.parse(o);return typeof t.setDigestSha256!="string"||typeof t.fetchedAtIso!="string"?void 0:{fetchedAtIso:t.fetchedAtIso,filterEtag:typeof t.filterEtag=="string"?t.filterEtag:void 0,setDigestSha256:t.setDigestSha256}}catch{return}},$=async(e,o,t)=>{await b(R(e),Buffer.from(o,"utf8")),await b(x(e),Buffer.from(`${JSON.stringify(t,void 0,2)}
|
|
2
|
+
`,"utf8"))},b=async(e,o)=>{await M(P(e),{recursive:!0});const t=`${e}.${process.pid}.${F()}.tmp`;try{await H(t,o),await G(t,e)}catch(s){throw await q(t).catch(()=>{}),s}},Z=e=>V("sha256").update(e).digest("hex"),N=e=>e.endsWith("/")?e:`${e}/`,tt=3e4,A=async(e,o)=>{try{return await fetch(e,{...o,signal:AbortSignal.timeout(tt)})}catch(t){throw new _(e.toString(),t instanceof Error?t.message:String(t))}};export{rt as D,Q as O,ct as g,nt as l,at as p,it as s};
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import{createRequire as Bt}from"node:module";import{k as X,m as B,g as K,H as $,u as He,y as Mt,z as jt,i as Wt}from"./index-DND6ptxQ.js";import{N as _t,a as ze}from"./readJsonSync-BnWiH5-R-BpnwAB0Z.js";import"./public-api-WqUCiyIe.js";import{a as ve,g as Ht}from"./_commonjsHelpers-B5Y90VFO.js";import{r as zt,a as Yt}from"./clean-DWjQl14S.js";let Rt;const It=o=>(Rt??=Bt(import.meta.url))(o),I=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,J=o=>{if(typeof I<"u"&&I.versions&&I.versions.node){const[e,t]=I.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return I.getBuiltinModule(o)}return It(o)},{dirname:kt}=J("node:path"),We=J("node:url"),{fileURLToPath:Ut}=We,_e=J("node:module"),{createRequire:Y}=_e,qt=J("util"),O=o=>"Deno"in o,N=o=>"Bun"in o,ws=()=>{if(O(globalThis)){const o=globalThis.Deno,e=o.execPath();let t=e;try{const{importMeta:i}=globalThis;i?.url&&(t=i.url)}catch{}return[e,t,...o.args]}return N(globalThis)?globalThis.Bun.process.argv:process.argv},xs=()=>O(globalThis)?globalThis.Deno.cwd():N(globalThis)?globalThis.Bun.process.cwd():process.cwd(),As=()=>{if(O(globalThis)){const o=globalThis.Deno;return new Proxy(o.env.toObject(),{get:(e,t)=>typeof t=="string"?o.env.get(t):e[t],has:(e,t)=>typeof t=="string"?o.env.has(t):t in e,set:(e,t,i)=>typeof t=="string"?(i===void 0||o.env.set(t,i),!0):!1})}return N(globalThis)?globalThis.Bun.process.env:process.env},Es=()=>O(globalThis)?[]:N(globalThis)?globalThis.Bun.process.execArgv:process.execArgv,$s=()=>O(globalThis)?globalThis.Deno.execPath():N(globalThis)?globalThis.Bun.process.execPath:process.execPath,Os=()=>{if(O(globalThis)){const o=globalThis.Deno.build?.os??"unknown";return o==="windows"?"win32":o}return N(globalThis)?globalThis.Bun.platform??"unknown":process.platform},Ns=()=>{if(O(globalThis)){const o=globalThis.Deno.build?.arch??"unknown";return o==="x86_64"?"x64":o==="aarch64"?"arm64":o}return N(globalThis)?globalThis.Bun.process.arch:process.arch},Fs=(o=0)=>{if(O(globalThis))throw globalThis.Deno.exit(o),new Error("Deno exit failed");if(N(globalThis))throw globalThis.Bun.process.exit(o),new Error("Bun exit failed");process.exit(o)},Ts=(o,e)=>{if(O(globalThis))return()=>{};if(N(globalThis)){try{const i=globalThis.Bun;if(i.process?.on)return i.process.on(o,e),()=>{i.process?.removeListener&&i.process.removeListener(o,e)}}catch{}return()=>{}}const t=process;return t.on(o,e),()=>{t.removeListener(o,e)}};let Vt;const Kt=o=>(Vt??=Y(import.meta.url))(o),k=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ye=o=>{if(typeof k<"u"&&k.versions&&k.versions.node){const[e,t]=k.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return k.getBuiltinModule(o)}return Kt(o)},{execFileSync:Jt}=Ye("node:child_process"),{existsSync:be,readFileSync:Xt}=Ye("node:fs"),Zt=["yarn.lock","package-lock.json","pnpm-lock.yaml","npm-shrinkwrap.json","bun.lock","bun.lockb"],Ce=new Set(["bun","npm","pnpm","yarn"]),qe=o=>{const e=_t(Xt(o,"utf8"));return typeof e?.packageManager=="string"?e.packageManager:void 0},Qt=o=>{let e;if(Zt.forEach(i=>{!e&&be(B(o,i))&&(e=B(o,i))}),e)return e;const t=B(o,"package.json");if(be(t)&&qe(t)!==void 0)return t},ei=o=>{if(!o)throw new K("Could not find a package manager");if(o.endsWith("package.json")){const e=qe(o);if(e){const t=["npm","yarn","pnpm","bun"].find(i=>e.startsWith(i));if(t)return{packageManager:t,path:$(o)}}}if(o.endsWith("yarn.lock"))return{packageManager:"yarn",path:$(o)};if(o.endsWith("package-lock.json")||o.endsWith("npm-shrinkwrap.json"))return{packageManager:"npm",path:$(o)};if(o.endsWith("pnpm-lock.yaml"))return{packageManager:"pnpm",path:$(o)};if(o.endsWith("bun.lock")||o.endsWith("bun.lockb"))return{packageManager:"bun",path:$(o)};throw new K("Could not find a package manager")},ti=o=>{const e=X(Qt,{...o&&{cwd:o}});return ei(e)},Gs=o=>{if(!Ce.has(o))throw new Error(`Unsupported package manager "${o}". Expected one of: ${[...Ce].join(", ")}.`);return Jt(o,["--version"]).toString("utf8").trim()};let ii;const si=o=>(ii??=Y(import.meta.url))(o),U=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ve=o=>{if(typeof U<"u"&&U.versions&&U.versions.node){const[e,t]=U.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return U.getBuiltinModule(o)}return si(o)};Ve("node:fs");Ve("node:fs/promises");const ri={sha256:"sha256",sha384:"sha384",sha512:"sha512"},ni=1024,oi=/^[A-Z0-9+/]+={0,2}$/i,Pe="node_modules/",H=/^['"]/,z=/['"]$/,ai=/^[a-z][a-zA-Z0-9]*:\s*$/m,li=/resolution:\s*\{[^}]*integrity:\s*([^,}\s]+)/,ci=/^["']?((?:@[^/@"']+\/)?[^@"'\n]+)@[^\n]+\n((?:[\t ][^\n]*(?:\n|$))+)/gm,hi=/^\s+version:?\s+"?([^"\n]+)"?/m,ui=/^\s+integrity[\s:]+"?([^"\s]+)"?/m,Z=o=>{if(o.length>ni)return;const e=o.indexOf("-");if(e<=0)return;const t=ri[o.slice(0,e).toLowerCase()];if(!t)return;const i=o.slice(e+1);if(oi.test(i))try{const r=Buffer.from(i,"base64");return r.length===0?void 0:{algorithm:t,hex:r.toString("hex")}}catch{return}},Q=(o,e,t)=>{const i=`${t.name}@${t.version}`;e.has(i)||(e.add(i),o.push(t))},x=(o,e,t)=>{t&&Object.keys(t).length>0&&(o[e]={...t})},R=o=>{if(!o)return;const e={};for(const[t,i]of Object.entries(o))e[t]=[i];return Object.keys(e).length>0?e:void 0},pi=o=>{const e=[],t=new Set;let i;try{i=JSON.parse(o)}catch{return e}if(!i.packages)return e;for(const[r,s]of Object.entries(i.packages)){if(!r||!s.version)continue;const a=r.lastIndexOf(Pe);if(a===-1)continue;const n=r.slice(a+Pe.length);if(n.length===0)continue;const l=n.split("/"),u=n.startsWith("@")?2:1;if(l.length!==u||l.some(v=>v.length===0))continue;const f=s.name??n;if(f.startsWith("."))continue;const g={name:f,version:s.version};if(s.integrity){const v=Z(s.integrity);v&&(g.integrity=v)}x(g,"dependencies",R(s.dependencies)),x(g,"peerDependencies",R(s.peerDependencies)),x(g,"optionalDependencies",R(s.optionalDependencies)),Q(e,t,g)}return e},Ke=o=>{let e=o.trim();e.startsWith("/")&&(e=e.slice(1)),e=e.replace(H,"").replace(z,"");const t=e.indexOf("(");t>0&&(e=e.slice(0,t));const i=e.lastIndexOf("@");if(i<=0)return;const r=e.slice(0,i),s=e.slice(i+1);if(!(!r||!s||s.startsWith("link:")||s.startsWith("workspace:")||s.startsWith("file:")))return{name:r,version:s}},Je=(o,e)=>{const t=new RegExp(String.raw`^${e}:\s*$`,"m").exec(o);if(!t)return;const i=t.index+t[0].length,r=ai.exec(o.slice(i));return o.slice(i,r?i+r.index:o.length)},fi=o=>{const e=new Map,t=Je(o,"snapshots");if(!t)return e;const i=/^ {2}(['"]?[^\s:][^:\n]*?['"]?):\s*\n((?: {4}[^\n]*\n?)+)/gm;let r;for(;(r=i.exec(t)??void 0)!==void 0;){const s=Ke(r[1]);if(!s)continue;const a=`${s.name}@${s.version}`,n=r[2],l=e.get(a)??{};for(const u of["dependencies","peerDependencies","optionalDependencies"]){const f=q(n,u);if(!f)continue;const g=l[u]??{};for(const[v,y]of Object.entries(f)){const b=g[v]??[];for(const m of y)b.includes(m)||b.push(m);g[v]=b}l[u]=g}e.set(a,l)}return e},di=o=>{const e=[],t=new Set,i=Je(o,"packages");if(!i)return e;const r=fi(o),s=/^ {2}(['"]?[^\s:][^:\n]*?['"]?):\s*\n((?: {4}[^\n]*\n?)+)/gm;let a;for(;(a=s.exec(i)??void 0)!==void 0;){const n=Ke(a[1]);if(!n)continue;const l=a[2],u=li.exec(l),f={name:n.name,version:n.version};if(u?.[1]){const v=Z(u[1]);v&&(f.integrity=v)}const g=r.get(`${n.name}@${n.version}`);x(f,"dependencies",g?.dependencies??q(l,"dependencies")),x(f,"peerDependencies",g?.peerDependencies??q(l,"peerDependencies")),x(f,"optionalDependencies",g?.optionalDependencies??q(l,"optionalDependencies")),Q(e,t,f)}return e},q=(o,e)=>{const t=new RegExp(String.raw`^ {4}${e}:\s*\n((?: {6,}[^\n]*\n?)+)`,"m").exec(o);if(!t?.[1])return;const i={},r=/^ {6}([^\s:]+):\s*([^\n]+)/gm;let s;for(;(s=r.exec(t[1])??void 0)!==void 0;){const a=s[1].replace(H,"").replace(z,"");let n=s[2].trim();n=n.replace(H,"").replace(z,"");const l=n.indexOf("(");if(l>0&&(n=n.slice(0,l).trim()),!a||!n)continue;const u=i[a]??[];u.includes(n)||u.push(n),i[a]=u}return Object.keys(i).length>0?i:void 0},mi=o=>{const e=[],t=new Set,i=ci;i.lastIndex=0;let r;for(;(r=i.exec(o)??void 0)!==void 0;){const s=r[1].replace(H,"").replace(z,"");if(!s)continue;const a=r[2],n=hi.exec(a);if(!n?.[1])continue;const l={name:s,version:n[1].trim()},u=ui.exec(a);if(u?.[1]){const f=Z(u[1]);f&&(l.integrity=f)}x(l,"dependencies",te(a,"dependencies")),x(l,"peerDependencies",te(a,"peerDependencies")),x(l,"optionalDependencies",te(a,"optionalDependencies")),Q(e,t,l)}return e},te=(o,e)=>{const t=new RegExp(String.raw`^ {2}${e}:\s*\n((?: {4,}[^\n]*\n?)+)`,"m").exec(o);if(!t?.[1])return;const i={},r=/^ {4}(['"]?[^\s:'"]+['"]?)\s*(?::\s*)?['"]([^'"\n]+)['"]/gm;let s;for(;(s=r.exec(t[1])??void 0)!==void 0;){const a=s[1].replace(H,"").replace(z,""),n=s[2];if(a&&n){const l=i[a]??[];l.includes(n)||l.push(n),i[a]=l}}return Object.keys(i).length>0?i:void 0},gi=/,(?=\s*[}\]])/g,Li=o=>{const e=[],t=new Set;let i;try{i=JSON.parse(o.replaceAll(gi,""))}catch{return e}if(!i.packages)return e;for(const r of Object.values(i.packages)){const s=r[0];if(typeof s!="string")continue;const a=s.indexOf("@",1);if(a<=0)continue;const n=s.slice(0,a),l=s.slice(a+1);if(!n||!l||l.startsWith("workspace:")||l.startsWith("link:")||l.startsWith("file:"))continue;const u={name:n,version:l},f=r[3];if(typeof f=="string"&&f.length>0){const v=Z(f);v&&(u.integrity=v)}const g=r[2];if(g&&typeof g=="object"&&!Array.isArray(g)){const v=g;x(u,"dependencies",R(v.dependencies)),x(u,"peerDependencies",R(v.peerDependencies)),x(u,"optionalDependencies",R(v.optionalDependencies))}Q(e,t,u)}return e},Bs=(o,e)=>{switch(e){case"bun":return Li(o);case"npm":return pi(o);case"pnpm":return di(o);case"yarn":return mi(o);default:return[]}};let Si;const vi=o=>(Si??=Y(import.meta.url))(o),M=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,yi=o=>{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(o)}return vi(o)},{existsSync:De,readFileSync:bi}=yi("node:fs"),Rs=o=>{const e=X(["lerna.json","turbo.json"],{type:"file",...o&&{cwd:o}});if(e?.endsWith("lerna.json")){const i=ze(e);if(i.useWorkspaces||i.packages)return{path:$(e),strategy:"lerna"}}const t=e?.endsWith("turbo.json");try{const{packageManager:i,path:r}=ti(o);if(["npm","yarn"].includes(i)){const s=B(r,"package.json");if(De(s)&&bi(B(r,"package.json"),"utf8").includes("workspaces"))return{path:r,strategy:t?"turbo":i}}else if(i==="pnpm"){const s=B(r,"pnpm-workspace.yaml");if(De(s))return{path:r,strategy:t?"turbo":"pnpm"}}}catch(i){if(!(i instanceof K))throw i}throw new Error(`No monorepo root could be found upwards from the directory ${String(o??process.cwd())} using lerna, yarn, pnpm, or npm as indicators.`)};let Ci;const Pi=o=>(Ci??=Y(import.meta.url))(o),j=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Di=o=>{if(typeof j<"u"&&j.versions&&j.versions.node){const[e,t]=j.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return j.getBuiltinModule(o)}return Pi(o)};Di("node:fs");var ie,we;function Xe(){return we||(we=1,ie=["0BSD","3D-Slicer-1.0","AAL","ADSL","AFL-1.1","AFL-1.2","AFL-2.0","AFL-2.1","AFL-3.0","AGPL-1.0-only","AGPL-1.0-or-later","AGPL-3.0-only","AGPL-3.0-or-later","ALGLIB-Documentation","AMD-newlib","AMDPLPA","AML","AML-glslang","AMPAS","ANTLR-PD","ANTLR-PD-fallback","APAFML","APL-1.0","APSL-1.0","APSL-1.1","APSL-1.2","APSL-2.0","ASWF-Digital-Assets-1.0","ASWF-Digital-Assets-1.1","Abstyles","AdaCore-doc","Adobe-2006","Adobe-Display-PostScript","Adobe-Glyph","Adobe-Utopia","Advanced-Cryptics-Dictionary","Afmparse","Aladdin","Apache-1.0","Apache-1.1","Apache-2.0","App-s2p","Arphic-1999","Artistic-1.0","Artistic-1.0-Perl","Artistic-1.0-cl8","Artistic-2.0","Artistic-dist","Aspell-RU","BOLA-1.1","BSD-1-Clause","BSD-2-Clause","BSD-2-Clause-Darwin","BSD-2-Clause-Patent","BSD-2-Clause-Views","BSD-2-Clause-first-lines","BSD-2-Clause-pkgconf-disclaimer","BSD-3-Clause","BSD-3-Clause-Attribution","BSD-3-Clause-Clear","BSD-3-Clause-HP","BSD-3-Clause-LBNL","BSD-3-Clause-Modification","BSD-3-Clause-No-Military-License","BSD-3-Clause-No-Nuclear-License","BSD-3-Clause-No-Nuclear-License-2014","BSD-3-Clause-No-Nuclear-Warranty","BSD-3-Clause-Open-MPI","BSD-3-Clause-Sun","BSD-3-Clause-Tso","BSD-3-Clause-acpica","BSD-3-Clause-flex","BSD-4-Clause","BSD-4-Clause-Shortened","BSD-4-Clause-UC","BSD-4.3RENO","BSD-4.3TAHOE","BSD-Advertising-Acknowledgement","BSD-Attribution-HPND-disclaimer","BSD-Inferno-Nettverk","BSD-Mark-Modifications","BSD-Protection","BSD-Source-Code","BSD-Source-beginning-file","BSD-Systemics","BSD-Systemics-W3Works","BSL-1.0","BUSL-1.1","Baekmuk","Bahyph","Barr","Beerware","BitTorrent-1.0","BitTorrent-1.1","Bitstream-Charter","Bitstream-Vera","BlueOak-1.0.0","Boehm-GC","Boehm-GC-without-fee","Borceux","Brian-Gladman-2-Clause","Brian-Gladman-3-Clause","Buddy","C-UDA-1.0","CAL-1.0","CAL-1.0-Combined-Work-Exception","CAPEC-tou","CATOSL-1.1","CC-BY-1.0","CC-BY-2.0","CC-BY-2.5","CC-BY-2.5-AU","CC-BY-3.0","CC-BY-3.0-AT","CC-BY-3.0-AU","CC-BY-3.0-DE","CC-BY-3.0-IGO","CC-BY-3.0-NL","CC-BY-3.0-US","CC-BY-4.0","CC-BY-NC-1.0","CC-BY-NC-2.0","CC-BY-NC-2.5","CC-BY-NC-3.0","CC-BY-NC-3.0-DE","CC-BY-NC-4.0","CC-BY-NC-ND-1.0","CC-BY-NC-ND-2.0","CC-BY-NC-ND-2.5","CC-BY-NC-ND-3.0","CC-BY-NC-ND-3.0-DE","CC-BY-NC-ND-3.0-IGO","CC-BY-NC-ND-4.0","CC-BY-NC-SA-1.0","CC-BY-NC-SA-2.0","CC-BY-NC-SA-2.0-DE","CC-BY-NC-SA-2.0-FR","CC-BY-NC-SA-2.0-UK","CC-BY-NC-SA-2.5","CC-BY-NC-SA-3.0","CC-BY-NC-SA-3.0-DE","CC-BY-NC-SA-3.0-IGO","CC-BY-NC-SA-4.0","CC-BY-ND-1.0","CC-BY-ND-2.0","CC-BY-ND-2.5","CC-BY-ND-3.0","CC-BY-ND-3.0-DE","CC-BY-ND-4.0","CC-BY-SA-1.0","CC-BY-SA-2.0","CC-BY-SA-2.0-UK","CC-BY-SA-2.1-JP","CC-BY-SA-2.5","CC-BY-SA-3.0","CC-BY-SA-3.0-AT","CC-BY-SA-3.0-DE","CC-BY-SA-3.0-IGO","CC-BY-SA-4.0","CC-PDDC","CC-PDM-1.0","CC-SA-1.0","CC0-1.0","CDDL-1.0","CDDL-1.1","CDL-1.0","CDLA-Permissive-1.0","CDLA-Permissive-2.0","CDLA-Sharing-1.0","CECILL-1.0","CECILL-1.1","CECILL-2.0","CECILL-2.1","CECILL-B","CECILL-C","CERN-OHL-1.1","CERN-OHL-1.2","CERN-OHL-P-2.0","CERN-OHL-S-2.0","CERN-OHL-W-2.0","CFITSIO","CMU-Mach","CMU-Mach-nodoc","CNRI-Jython","CNRI-Python","CNRI-Python-GPL-Compatible","COIL-1.0","CPAL-1.0","CPL-1.0","CPOL-1.02","CUA-OPL-1.0","Caldera","Caldera-no-preamble","Catharon","ClArtistic","Clips","Community-Spec-1.0","Condor-1.1","Cornell-Lossless-JPEG","Cronyx","Crossword","CryptoSwift","CrystalStacker","Cube","D-FSL-1.0","DEC-3-Clause","DL-DE-BY-2.0","DL-DE-ZERO-2.0","DOC","DRL-1.0","DRL-1.1","DSDP","DocBook-DTD","DocBook-Schema","DocBook-Stylesheet","DocBook-XML","Dotseqn","ECL-1.0","ECL-2.0","EFL-1.0","EFL-2.0","EPICS","EPL-1.0","EPL-2.0","ESA-PL-permissive-2.4","ESA-PL-strong-copyleft-2.4","ESA-PL-weak-copyleft-2.4","EUDatagrid","EUPL-1.0","EUPL-1.1","EUPL-1.2","Elastic-2.0","Entessa","ErlPL-1.1","Eurosym","FBM","FDK-AAC","FSFAP","FSFAP-no-warranty-disclaimer","FSFUL","FSFULLR","FSFULLRSD","FSFULLRWD","FSL-1.1-ALv2","FSL-1.1-MIT","FTL","Fair","Ferguson-Twofish","Frameworx-1.0","FreeBSD-DOC","FreeImage","Furuseth","GCR-docs","GD","GFDL-1.1-invariants-only","GFDL-1.1-invariants-or-later","GFDL-1.1-no-invariants-only","GFDL-1.1-no-invariants-or-later","GFDL-1.1-only","GFDL-1.1-or-later","GFDL-1.2-invariants-only","GFDL-1.2-invariants-or-later","GFDL-1.2-no-invariants-only","GFDL-1.2-no-invariants-or-later","GFDL-1.2-only","GFDL-1.2-or-later","GFDL-1.3-invariants-only","GFDL-1.3-invariants-or-later","GFDL-1.3-no-invariants-only","GFDL-1.3-no-invariants-or-later","GFDL-1.3-only","GFDL-1.3-or-later","GL2PS","GLWTPL","GPL-1.0-only","GPL-1.0-or-later","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0-only","GPL-3.0-or-later","Game-Programming-Gems","Giftware","Glide","Glulxe","Graphics-Gems","Gutmann","HDF5","HIDAPI","HP-1986","HP-1989","HPND","HPND-DEC","HPND-Fenneberg-Livingston","HPND-INRIA-IMAG","HPND-Intel","HPND-Kevlin-Henney","HPND-MIT-disclaimer","HPND-Markus-Kuhn","HPND-Netrek","HPND-Pbmplus","HPND-SMC","HPND-UC","HPND-UC-export-US","HPND-doc","HPND-doc-sell","HPND-export-US","HPND-export-US-acknowledgement","HPND-export-US-modify","HPND-export2-US","HPND-merchantability-variant","HPND-sell-MIT-disclaimer-xserver","HPND-sell-regexpr","HPND-sell-variant","HPND-sell-variant-MIT-disclaimer","HPND-sell-variant-MIT-disclaimer-rev","HPND-sell-variant-critical-systems","HTMLTIDY","HaskellReport","Hippocratic-2.1","IBM-pibs","ICU","IEC-Code-Components-EULA","IJG","IJG-short","IPA","IPL-1.0","ISC","ISC-Veillard","ISO-permission","ImageMagick","Imlib2","Info-ZIP","Inner-Net-2.0","InnoSetup","Intel","Intel-ACPI","Interbase-1.0","JPL-image","JPNIC","JSON","Jam","JasPer-2.0","Kastrup","Kazlib","Knuth-CTAN","LAL-1.2","LAL-1.3","LGPL-2.0-only","LGPL-2.0-or-later","LGPL-2.1-only","LGPL-2.1-or-later","LGPL-3.0-only","LGPL-3.0-or-later","LGPLLR","LOOP","LPD-document","LPL-1.0","LPL-1.02","LPPL-1.0","LPPL-1.1","LPPL-1.2","LPPL-1.3a","LPPL-1.3c","LZMA-SDK-9.11-to-9.20","LZMA-SDK-9.22","Latex2e","Latex2e-translated-notice","Leptonica","LiLiQ-P-1.1","LiLiQ-R-1.1","LiLiQ-Rplus-1.1","Libpng","Linux-OpenIB","Linux-man-pages-1-para","Linux-man-pages-copyleft","Linux-man-pages-copyleft-2-para","Linux-man-pages-copyleft-var","Lucida-Bitmap-Fonts","MIPS","MIT","MIT-0","MIT-CMU","MIT-Click","MIT-Festival","MIT-Khronos-old","MIT-Modern-Variant","MIT-STK","MIT-Wu","MIT-advertising","MIT-enna","MIT-feh","MIT-open-group","MIT-testregex","MITNFA","MMIXware","MMPL-1.0.1","MPEG-SSG","MPL-1.0","MPL-1.1","MPL-2.0","MPL-2.0-no-copyleft-exception","MS-LPL","MS-PL","MS-RL","MTLL","Mackerras-3-Clause","Mackerras-3-Clause-acknowledgment","MakeIndex","Martin-Birgmeier","McPhee-slideshow","Minpack","MirOS","Motosoto","MulanPSL-1.0","MulanPSL-2.0","Multics","Mup","NAIST-2003","NASA-1.3","NBPL-1.0","NCBI-PD","NCGL-UK-2.0","NCL","NCSA","NGPL","NICTA-1.0","NIST-PD","NIST-PD-TNT","NIST-PD-fallback","NIST-Software","NLOD-1.0","NLOD-2.0","NLPL","NOSL","NPL-1.0","NPL-1.1","NPOSL-3.0","NRL","NTIA-PD","NTP","NTP-0","Naumen","NetCDF","Newsletr","Nokia","Noweb","O-UDA-1.0","OAR","OCCT-PL","OCLC-2.0","ODC-By-1.0","ODbL-1.0","OFFIS","OFL-1.0","OFL-1.0-RFN","OFL-1.0-no-RFN","OFL-1.1","OFL-1.1-RFN","OFL-1.1-no-RFN","OGC-1.0","OGDL-Taiwan-1.0","OGL-Canada-2.0","OGL-UK-1.0","OGL-UK-2.0","OGL-UK-3.0","OGTSL","OLDAP-1.1","OLDAP-1.2","OLDAP-1.3","OLDAP-1.4","OLDAP-2.0","OLDAP-2.0.1","OLDAP-2.1","OLDAP-2.2","OLDAP-2.2.1","OLDAP-2.2.2","OLDAP-2.3","OLDAP-2.4","OLDAP-2.5","OLDAP-2.6","OLDAP-2.7","OLDAP-2.8","OLFL-1.3","OML","OPL-1.0","OPL-UK-3.0","OPUBL-1.0","OSC-1.0","OSET-PL-2.1","OSL-1.0","OSL-1.1","OSL-2.0","OSL-2.1","OSL-3.0","OSSP","OpenMDW-1.0","OpenPBS-2.3","OpenSSL","OpenSSL-standalone","OpenVision","PADL","PDDL-1.0","PHP-3.0","PHP-3.01","PPL","PSF-2.0","ParaType-Free-Font-1.3","Parity-6.0.0","Parity-7.0.0","Pixar","Plexus","PolyForm-Noncommercial-1.0.0","PolyForm-Small-Business-1.0.0","PostgreSQL","Python-2.0","Python-2.0.1","QPL-1.0","QPL-1.0-INRIA-2004","Qhull","RHeCos-1.1","RPL-1.1","RPL-1.5","RPSL-1.0","RSA-MD","RSCPL","Rdisc","Ruby","Ruby-pty","SAX-PD","SAX-PD-2.0","SCEA","SGI-B-1.0","SGI-B-1.1","SGI-B-2.0","SGI-OpenGL","SGMLUG-PM","SGP4","SHL-0.5","SHL-0.51","SISSL","SISSL-1.2","SL","SMAIL-GPL","SMLNJ","SMPPL","SNIA","SOFA","SPL-1.0","SSH-OpenSSH","SSH-short","SSLeay-standalone","SSPL-1.0","SUL-1.0","SWL","Saxpath","SchemeReport","Sendmail","Sendmail-8.23","Sendmail-Open-Source-1.1","SimPL-2.0","Sleepycat","Soundex","Spencer-86","Spencer-94","Spencer-99","SugarCRM-1.1.3","Sun-PPP","Sun-PPP-2000","SunPro","Symlinks","TAPR-OHL-1.0","TCL","TCP-wrappers","TGPPL-1.0","TMate","TORQUE-1.1","TOSL","TPDL","TPL-1.0","TTWL","TTYP0","TU-Berlin-1.0","TU-Berlin-2.0","TekHVC","TermReadKey","ThirdEye","TrustedQSL","UCAR","UCL-1.0","UMich-Merit","UPL-1.0","URT-RLE","Ubuntu-font-1.0","UnRAR","Unicode-3.0","Unicode-DFS-2015","Unicode-DFS-2016","Unicode-TOU","UnixCrypt","Unlicense","Unlicense-libtelnet","Unlicense-libwhirlpool","VOSTROM","VSL-1.0","Vim","Vixie-Cron","W3C","W3C-19980720","W3C-20150513","WTFNMFPL","WTFPL","Watcom-1.0","Widget-Workshop","WordNet","Wsuipa","X11","X11-distribute-modifications-variant","X11-no-permit-persons","X11-swapped","XFree86-1.1","XSkat","Xdebug-1.03","Xerox","Xfig","Xnet","YPL-1.0","YPL-1.1","ZPL-1.1","ZPL-2.0","ZPL-2.1","Zed","Zeeff","Zend-2.0","Zimbra-1.3","Zimbra-1.4","Zlib","any-OSI","any-OSI-perl-modules","bcrypt-Solar-Designer","blessing","bzip2-1.0.6","check-cvs","checkmk","copyleft-next-0.3.0","copyleft-next-0.3.1","curl","cve-tou","diffmark","dtoa","dvipdfm","eGenix","etalab-2.0","fwlw","gSOAP-1.3b","generic-xts","gnuplot","gtkbook","hdparm","hyphen-bulgarian","iMatix","jove","libpng-1.6.35","libpng-2.0","libselinux-1.0","libtiff","libutil-David-Nugent","lsof","magaz","mailprio","man2html","metamail","mpi-permissive","mpich2","mplus","ngrep","pkgconf","pnmstitch","psfrag","psutils","python-ldap","radvd","snprintf","softSurfer","ssh-keyscan","swrule","threeparttable","ulem","w3m","wwl","xinetd","xkeyboard-config-Zinoviev","xlock","xpp","xzoom","zlib-acknowledgement"]),ie}var se,xe;function wi(){return xe||(xe=1,se=["AGPL-1.0","AGPL-3.0","BSD-2-Clause-FreeBSD","BSD-2-Clause-NetBSD","GFDL-1.1","GFDL-1.2","GFDL-1.3","GPL-1.0","GPL-2.0","GPL-2.0-with-GCC-exception","GPL-2.0-with-autoconf-exception","GPL-2.0-with-bison-exception","GPL-2.0-with-classpath-exception","GPL-2.0-with-font-exception","GPL-3.0","GPL-3.0-with-GCC-exception","GPL-3.0-with-autoconf-exception","LGPL-2.0","LGPL-2.1","LGPL-3.0","Net-SNMP","Nunit","StandardML-NJ","bzip2-1.0.5","eCos-2.0","wxWindows"]),se}var re,Ae;function xi(){return Ae||(Ae=1,re=["389-exception","Asterisk-exception","Autoconf-exception-2.0","Autoconf-exception-3.0","Autoconf-exception-generic","Autoconf-exception-generic-3.0","Autoconf-exception-macro","Bison-exception-1.24","Bison-exception-2.2","Bootloader-exception","Classpath-exception-2.0","CLISP-exception-2.0","cryptsetup-OpenSSL-exception","DigiRule-FOSS-exception","eCos-exception-2.0","Fawkes-Runtime-exception","FLTK-exception","fmt-exception","Font-exception-2.0","freertos-exception-2.0","GCC-exception-2.0","GCC-exception-2.0-note","GCC-exception-3.1","Gmsh-exception","GNAT-exception","GNOME-examples-exception","GNU-compiler-exception","gnu-javamail-exception","GPL-3.0-interface-exception","GPL-3.0-linking-exception","GPL-3.0-linking-source-exception","GPL-CC-1.0","GStreamer-exception-2005","GStreamer-exception-2008","i2p-gpl-java-exception","KiCad-libraries-exception","LGPL-3.0-linking-exception","libpri-OpenH323-exception","Libtool-exception","Linux-syscall-note","LLGPL","LLVM-exception","LZMA-exception","mif-exception","OCaml-LGPL-linking-exception","OCCT-exception-1.0","OpenJDK-assembly-exception-1.0","openvpn-openssl-exception","PS-or-PDF-font-exception-20170817","QPL-1.0-INRIA-2004-exception","Qt-GPL-exception-1.0","Qt-LGPL-exception-1.1","Qwt-exception-1.0","SANE-exception","SHL-2.0","SHL-2.1","stunnel-exception","SWI-exception","Swift-exception","Texinfo-exception","u-boot-exception-2.0","UBDL-exception","Universal-FOSS-exception-1.0","vsftpd-openssl-exception","WxWindows-exception-3.1","x11vnc-openssl-exception"]),re}var ne,Ee;function Ai(){if(Ee)return ne;Ee=1;var o=[].concat(Xe()).concat(wi()),e=xi();return ne=function(t){var i=0;function r(){return i<t.length}function s(L){if(L instanceof RegExp){var h=t.slice(i),S=h.match(L);if(S)return i+=S[0].length,S[0]}else if(t.indexOf(L,i)===i)return i+=L.length,L}function a(){s(/[ ]*/)}function n(){for(var L,h=["WITH","AND","OR","(",")",":","+"],S=0;S<h.length&&(L=s(h[S]),!L);S++);if(L==="+"&&i>1&&t[i-2]===" ")throw new Error("Space before `+`");return L&&{type:"OPERATOR",string:L}}function l(){return s(/[A-Za-z0-9-.]+/)}function u(){var L=l();if(!L)throw new Error("Expected idstring at offset "+i);return L}function f(){if(s("DocumentRef-")){var L=u();return{type:"DOCUMENTREF",string:L}}}function g(){if(s("LicenseRef-")){var L=u();return{type:"LICENSEREF",string:L}}}function v(){var L=i,h=l();if(o.indexOf(h)!==-1)return{type:"LICENSE",string:h};if(e.indexOf(h)!==-1)return{type:"EXCEPTION",string:h};i=L}function y(){return n()||f()||g()||v()}for(var b=[];r()&&(a(),!!r());){var m=y();if(!m)throw new Error("Unexpected `"+t[i]+"` at offset "+i);b.push(m)}return b},ne}var oe,$e;function Ei(){return $e||($e=1,oe=function(o){var e=0;function t(){return e<o.length}function i(){return t()?o[e]:null}function r(){if(!t())throw new Error;e++}function s(m){var L=i();if(L&&L.type==="OPERATOR"&&m===L.string)return r(),L.string}function a(){if(s("WITH")){var m=i();if(m&&m.type==="EXCEPTION")return r(),m.string;throw new Error("Expected exception after `WITH`")}}function n(){var m=e,L="",h=i();if(h.type==="DOCUMENTREF"&&(r(),L+="DocumentRef-"+h.string+":",!s(":")))throw new Error("Expected `:` after `DocumentRef-...`");if(h=i(),h.type==="LICENSEREF")return r(),L+="LicenseRef-"+h.string,{license:L};e=m}function l(){var m=i();if(m&&m.type==="LICENSE"){r();var L={license:m.string};s("+")&&(L.plus=!0);var h=a();return h&&(L.exception=h),L}}function u(){var m=s("(");if(m){var L=y();if(!s(")"))throw new Error("Expected `)`");return L}}function f(){return u()||n()||l()}function g(m,L){return function h(){var S=L();if(S){if(!s(m))return S;var C=h();if(!C)throw new Error("Expected expression");return{left:S,conjunction:m.toLowerCase(),right:C}}}}var v=g("AND",f),y=g("OR",v),b=y();if(!b||t())throw new Error("Syntax error");return b}),oe}var ae,Oe;function Ze(){if(Oe)return ae;Oe=1;var o=Ai(),e=Ei();return ae=function(t){return e(o(t))},ae}var le,Ne;function $i(){if(Ne)return le;Ne=1;var o=Ze(),e=Xe();function t(h){try{return o(h),!0}catch{return!1}}function i(h,S){var C=S[0].length-h[0].length;return C!==0?C:h[0].toUpperCase().localeCompare(S[0].toUpperCase())}var r=[["APGL","AGPL"],["Gpl","GPL"],["GLP","GPL"],["APL","Apache"],["ISD","ISC"],["GLP","GPL"],["IST","ISC"],["Claude","Clause"],[" or later","+"],[" International",""],["GNU","GPL"],["GUN","GPL"],["+",""],["GNU GPL","GPL"],["GNU LGPL","LGPL"],["GNU/GPL","GPL"],["GNU GLP","GPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL"],["GNU Lesser General Public License","LGPL"],["GNU LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["GNU Lesser General Public License","LGPL-2.1"],["LESSER GENERAL PUBLIC LICENSE","LGPL"],["Lesser General Public License","LGPL"],["LESSER GENERAL PUBLIC LICENSE","LGPL-2.1"],["Lesser General Public License","LGPL-2.1"],["GNU General Public License","GPL"],["Gnu public license","GPL"],["GNU Public License","GPL"],["GNU GENERAL PUBLIC LICENSE","GPL"],["MTI","MIT"],["Mozilla Public License","MPL"],["Universal Permissive License","UPL"],["WTH","WTF"],["WTFGPL","WTFPL"],["-License",""]].sort(i),s=0,a=1,n=[function(h){return h.toUpperCase()},function(h){return h.trim()},function(h){return h.replace(/\./g,"")},function(h){return h.replace(/\s+/g,"")},function(h){return h.replace(/\s+/g,"-")},function(h){return h.replace("v","-")},function(h){return h.replace(/,?\s*(\d)/,"-$1")},function(h){return h.replace(/,?\s*(\d)/,"-$1.0")},function(h){return h.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2")},function(h){return h.replace(/,?\s*(V\.|v\.|V|v|Version|version)\s*(\d)/,"-$2.0")},function(h){return h[0].toUpperCase()+h.slice(1)},function(h){return h.replace("/","-")},function(h){return h.replace(/\s*V\s*(\d)/,"-$1").replace(/(\d)$/,"$1.0")},function(h){return h.indexOf("3.0")!==-1?h+"-or-later":h+"-only"},function(h){return h+"only"},function(h){return h.replace(/(\d)$/,"-$1.0")},function(h){return h.replace(/(-| )?(\d)$/,"-$2-Clause")},function(h){return h.replace(/(-| )clause(-| )(\d)/,"-$3-Clause")},function(h){return h.replace(/\b(Modified|New|Revised)(-| )?BSD((-| )License)?/i,"BSD-3-Clause")},function(h){return h.replace(/\bSimplified(-| )?BSD((-| )License)?/i,"BSD-2-Clause")},function(h){return h.replace(/\b(Free|Net)(-| )?BSD((-| )License)?/i,"BSD-2-Clause-$1BSD")},function(h){return h.replace(/\bClear(-| )?BSD((-| )License)?/i,"BSD-3-Clause-Clear")},function(h){return h.replace(/\b(Old|Original)(-| )?BSD((-| )License)?/i,"BSD-4-Clause")},function(h){return"CC-"+h},function(h){return"CC-"+h+"-4.0"},function(h){return h.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")},function(h){return"CC-"+h.replace("Attribution","BY").replace("NonCommercial","NC").replace("NoDerivatives","ND").replace(/ (\d)/,"-$1").replace(/ ?International/,"")+"-4.0"}],l=e.map(function(h){var S=/^(.*)-\d+\.\d+$/.exec(h);return S?[S[0],S[1]]:[h,null]}).reduce(function(h,S){var C=S[1];return h[C]=h[C]||[],h[C].push(S[0]),h},{}),u=Object.keys(l).map(function(h){return[h,l[h]]}).filter(function(h){return h[1].length===1&&h[0]!==null&&h[0]!=="APL"}).map(function(h){return[h[0],h[1][0]]});l=void 0;var f=[["UNLI","Unlicense"],["WTF","WTFPL"],["2 CLAUSE","BSD-2-Clause"],["2-CLAUSE","BSD-2-Clause"],["3 CLAUSE","BSD-3-Clause"],["3-CLAUSE","BSD-3-Clause"],["AFFERO","AGPL-3.0-or-later"],["AGPL","AGPL-3.0-or-later"],["APACHE","Apache-2.0"],["ARTISTIC","Artistic-2.0"],["Affero","AGPL-3.0-or-later"],["BEER","Beerware"],["BOOST","BSL-1.0"],["BSD","BSD-2-Clause"],["CDDL","CDDL-1.1"],["ECLIPSE","EPL-1.0"],["FUCK","WTFPL"],["GNU","GPL-3.0-or-later"],["LGPL","LGPL-3.0-or-later"],["GPLV1","GPL-1.0-only"],["GPL-1","GPL-1.0-only"],["GPLV2","GPL-2.0-only"],["GPL-2","GPL-2.0-only"],["GPL","GPL-3.0-or-later"],["MIT +NO-FALSE-ATTRIBS","MITNFA"],["MIT","MIT"],["MPL","MPL-2.0"],["X11","X11"],["ZLIB","Zlib"]].concat(u).sort(i),g=0,v=1,y=function(h){for(var S=0;S<n.length;S++){var C=n[S](h).trim();if(C!==h&&t(C))return C}return null},b=function(h){for(var S=h.toUpperCase(),C=0;C<f.length;C++){var c=f[C];if(S.indexOf(c[g])>-1)return c[v]}return null},m=function(h,S){for(var C=0;C<r.length;C++){var c=r[C],p=c[s];if(h.indexOf(p)>-1){var d=h.replace(p,c[a]),P=S(d);if(P!==null)return P}}return null};le=function(h,S){S=S||{};var C=S.upgrade===void 0?!0:!!S.upgrade;function c(D){return C?L(D):D}var p=typeof h=="string"&&h.trim().length!==0;if(!p)throw Error("Invalid argument. Expected non-empty string.");if(h=h.trim(),t(h))return c(h);var d=h.replace(/\+$/,"").trim();if(t(d))return c(d);var P=y(h);return P!==null||(P=m(h,function(D){return t(D)?D:y(D)}),P!==null)||(P=b(h),P!==null)||(P=m(h,b),P!==null)?c(P):null};function L(h){return["GPL-1.0","LGPL-1.0","AGPL-1.0","GPL-2.0","LGPL-2.0","AGPL-2.0","LGPL-2.1"].indexOf(h)!==-1?h+"-only":["GPL-1.0+","GPL-2.0+","GPL-3.0+","LGPL-2.0+","LGPL-2.1+","LGPL-3.0+","AGPL-1.0+","AGPL-3.0+"].indexOf(h)!==-1?h.replace(/\+$/,"-or-later"):["GPL-3.0","LGPL-3.0","AGPL-3.0"].indexOf(h)!==-1?h+"-or-later":h}return le}var ce,Fe;function Oi(){if(Fe)return ce;Fe=1;var o=Ze(),e=$i(),t='license should be a valid SPDX license expression (without "LicenseRef"), "UNLICENSED", or "SEE LICENSE IN <filename>"',i=/^SEE LICEN[CS]E IN (.+)$/;function r(a,n){return n.slice(0,a.length)===a}function s(a){if(a.hasOwnProperty("license")){var n=a.license;return r("LicenseRef",n)||r("DocumentRef",n)}else return s(a.left)||s(a.right)}return ce=function(a){var n;try{n=o(a)}catch{var l;if(a==="UNLICENSED"||a==="UNLICENCED")return{validForOldPackages:!0,validForNewPackages:!0,unlicensed:!0};if(l=i.exec(a))return{validForOldPackages:!0,validForNewPackages:!0,inFile:l[1]};var u={validForOldPackages:!1,validForNewPackages:!1,warnings:[t]};if(a.trim().length!==0){var f=e(a);f&&u.warnings.push('license is similar to the valid expression "'+f+'"')}return u}return s(n)?{validForNewPackages:!1,validForOldPackages:!1,spdx:!0,warnings:[t]}:{validForNewPackages:!0,validForOldPackages:!0,spdx:!0}},ce}var Qe={hasSubscribers:!1},w=Qe,G=Qe;import("node:diagnostics_channel").then(o=>{w=o.channel("lru-cache:metrics"),G=o.tracingChannel("lru-cache")}).catch(()=>{});var Ni=typeof performance=="object"&&performance&&typeof performance.now=="function"?performance:Date,he=()=>w.hasSubscribers||G.hasSubscribers,et=new Set,Te=process||{},Fi=(o,e,t,i)=>{typeof Te.emitWarning=="function"?Te.emitWarning(o,e,t,i):console.error(`[${t}] ${e}: ${o}`)},Ti=o=>!et.has(o),T=o=>!!o&&o===Math.floor(o)&&o>0&&isFinite(o),tt=o=>T(o)?o<=Math.pow(2,8)?Uint8Array:o<=Math.pow(2,16)?Uint16Array:o<=Math.pow(2,32)?Uint32Array:o<=Number.MAX_SAFE_INTEGER?V:null:null,V=class extends Array{constructor(o){super(o),this.fill(0)}},Gi=class _{heap;length;static#r=!1;static create(e){let t=tt(e);if(!t)return[];_.#r=!0;let i=new _(e,t);return _.#r=!1,i}constructor(e,t){if(!_.#r)throw new TypeError("instantiate Stack using Stack.create(n)");this.heap=new t(e),this.length=0}push(e){this.heap[this.length++]=e}pop(){return this.heap[--this.length]}},Bi=class it{#r;#c;#t;#$;#L;#B;#R;#S;get perf(){return this.#S}ttl;ttlResolution;ttlAutopurge;updateAgeOnGet;updateAgeOnHas;allowStale;noDisposeOnSet;noUpdateTTL;maxEntrySize;sizeCalculation;noDeleteOnFetchRejection;noDeleteOnStaleGet;allowStaleOnFetchAbort;allowStaleOnFetchRejection;ignoreFetchAbort;backgroundFetchSize;#o;#v;#n;#s;#e;#u;#f;#h;#a;#y;#l;#b;#C;#d;#m;#P;#I;#p;#O;static unsafeExposeInternals(e){return{starts:e.#C,ttls:e.#d,autopurgeTimers:e.#m,sizes:e.#b,keyMap:e.#n,keyList:e.#s,valList:e.#e,next:e.#u,prev:e.#f,get head(){return e.#h},get tail(){return e.#a},free:e.#y,isBackgroundFetch:t=>e.#i(t),backgroundFetch:(t,i,r,s)=>e.#M(t,i,r,s),moveToTail:t=>e.#G(t),indexes:t=>e.#D(t),rindexes:t=>e.#w(t),isStale:t=>e.#g(t)}}get max(){return this.#r}get maxSize(){return this.#c}get calculatedSize(){return this.#v}get size(){return this.#o}get fetchMethod(){return this.#B}get memoMethod(){return this.#R}get dispose(){return this.#t}get onInsert(){return this.#$}get disposeAfter(){return this.#L}constructor(e){let{max:t=0,ttl:i,ttlResolution:r=1,ttlAutopurge:s,updateAgeOnGet:a,updateAgeOnHas:n,allowStale:l,dispose:u,onInsert:f,disposeAfter:g,noDisposeOnSet:v,noUpdateTTL:y,maxSize:b=0,maxEntrySize:m=0,sizeCalculation:L,fetchMethod:h,memoMethod:S,noDeleteOnFetchRejection:C,noDeleteOnStaleGet:c,allowStaleOnFetchRejection:p,allowStaleOnFetchAbort:d,ignoreFetchAbort:P,backgroundFetchSize:D=1,perf:A}=e;if(this.backgroundFetchSize=D,A!==void 0&&typeof A?.now!="function")throw new TypeError("perf option must have a now() method if specified");if(this.#S=A??Ni,t!==0&&!T(t))throw new TypeError("max option must be a nonnegative integer");let E=t?tt(t):Array;if(!E)throw new Error("invalid max value: "+t);if(this.#r=t,this.#c=b,this.maxEntrySize=m||this.#c,this.sizeCalculation=L,this.sizeCalculation){if(!this.#c&&!this.maxEntrySize)throw new TypeError("cannot set sizeCalculation without setting maxSize or maxEntrySize");if(typeof this.sizeCalculation!="function")throw new TypeError("sizeCalculation set to non-function")}if(S!==void 0&&typeof S!="function")throw new TypeError("memoMethod must be a function if defined");if(this.#R=S,h!==void 0&&typeof h!="function")throw new TypeError("fetchMethod must be a function if specified");if(this.#B=h,this.#I=!!h,this.#n=new Map,this.#s=Array.from({length:t}).fill(void 0),this.#e=Array.from({length:t}).fill(void 0),this.#u=new E(t),this.#f=new E(t),this.#h=0,this.#a=0,this.#y=Gi.create(t),this.#o=0,this.#v=0,typeof u=="function"&&(this.#t=u),typeof f=="function"&&(this.#$=f),typeof g=="function"?(this.#L=g,this.#l=[]):(this.#L=void 0,this.#l=void 0),this.#P=!!this.#t,this.#O=!!this.#$,this.#p=!!this.#L,this.noDisposeOnSet=!!v,this.noUpdateTTL=!!y,this.noDeleteOnFetchRejection=!!C,this.allowStaleOnFetchRejection=!!p,this.allowStaleOnFetchAbort=!!d,this.ignoreFetchAbort=!!P,this.maxEntrySize!==0){if(this.#c!==0&&!T(this.#c))throw new TypeError("maxSize must be a positive integer if specified");if(!T(this.maxEntrySize))throw new TypeError("maxEntrySize must be a positive integer if specified");this.#V()}if(this.allowStale=!!l,this.noDeleteOnStaleGet=!!c,this.updateAgeOnGet=!!a,this.updateAgeOnHas=!!n,this.ttlResolution=T(r)||r===0?r:1,this.ttlAutopurge=!!s,this.ttl=i||0,this.ttl){if(!T(this.ttl))throw new TypeError("ttl must be a positive integer if specified");this.#j()}if(this.#r===0&&this.ttl===0&&this.#c===0)throw new TypeError("At least one of max, maxSize, or ttl is required");if(!this.ttlAutopurge&&!this.#r&&!this.#c){let ee="LRU_CACHE_UNBOUNDED";Ti(ee)&&(et.add(ee),Fi("TTL caching without ttlAutopurge, max, or maxSize can result in unbounded memory consumption.","UnboundedCacheWarning",ee,it))}}getRemainingTTL(e){return this.#n.has(e)?1/0:0}#j(){let e=new V(this.#r),t=new V(this.#r);this.#d=e,this.#C=t;let i=this.ttlAutopurge?Array.from({length:this.#r}):void 0;this.#m=i,this.#W=(n,l,u=this.#S.now())=>{t[n]=l!==0?u:0,e[n]=l,r(n,l)},this.#N=n=>{t[n]=e[n]!==0?this.#S.now():0,r(n,e[n])};let r=this.ttlAutopurge?(n,l)=>{if(i?.[n]&&(clearTimeout(i[n]),i[n]=void 0),l&&l!==0&&i){let u=setTimeout(()=>{this.#g(n)&&this.#x(this.#s[n],"expire")},l+1);u.unref&&u.unref(),i[n]=u}}:()=>{};this.#A=(n,l)=>{if(e[l]){let u=e[l],f=t[l];if(!u||!f)return;n.ttl=u,n.start=f,n.now=s||a();let g=n.now-f;n.remainingTTL=u-g}};let s=0,a=()=>{let n=this.#S.now();if(this.ttlResolution>0){s=n;let l=setTimeout(()=>s=0,this.ttlResolution);l.unref&&l.unref()}return n};this.getRemainingTTL=n=>{let l=this.#n.get(n);if(l===void 0)return 0;let u=e[l],f=t[l];if(!u||!f)return 1/0;let g=(s||a())-f;return u-g},this.#g=n=>{let l=t[n],u=e[n];return!!u&&!!l&&(s||a())-l>u}}#N=()=>{};#A=()=>{};#W=()=>{};#g=()=>!1;#V(){let e=new V(this.#r);this.#v=0,this.#b=e,this.#F=t=>{this.#v-=e[t],e[t]=0},this.#_=(t,i,r,s)=>{if(!T(r)){if(this.#i(i))return this.backgroundFetchSize;if(s){if(typeof s!="function")throw new TypeError("sizeCalculation must be a function");if(r=s(i,t),!T(r))throw new TypeError("sizeCalculation return invalid (expect positive integer)")}else throw new TypeError("invalid size value (must be positive integer). When maxSize or maxEntrySize is used, sizeCalculation or size must be set.")}return r},this.#k=(t,i,r)=>{if(e[t]=i,this.#c){let s=this.#c-e[t];for(;this.#v>s;)this.#U(!0)}this.#v+=e[t],r&&(r.entrySize=i,r.totalCalculatedSize=this.#v)}}#F=e=>{};#k=(e,t,i)=>{};#_=(e,t,i,r)=>{if(i||r)throw new TypeError("cannot set size without setting maxSize or maxEntrySize on cache");return 0};*#D({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#a;this.#H(t)&&((e||!this.#g(t))&&(yield t),t!==this.#h);)t=this.#f[t]}*#w({allowStale:e=this.allowStale}={}){if(this.#o)for(let t=this.#h;this.#H(t)&&((e||!this.#g(t))&&(yield t),t!==this.#a);)t=this.#u[t]}#H(e){return e!==void 0&&this.#n.get(this.#s[e])===e}*entries(){for(let e of this.#D())this.#e[e]!==void 0&&this.#s[e]!==void 0&&!this.#i(this.#e[e])&&(yield[this.#s[e],this.#e[e]])}*rentries(){for(let e of this.#w())this.#e[e]!==void 0&&this.#s[e]!==void 0&&!this.#i(this.#e[e])&&(yield[this.#s[e],this.#e[e]])}*keys(){for(let e of this.#D()){let t=this.#s[e];t!==void 0&&!this.#i(this.#e[e])&&(yield t)}}*rkeys(){for(let e of this.#w()){let t=this.#s[e];t!==void 0&&!this.#i(this.#e[e])&&(yield t)}}*values(){for(let e of this.#D())this.#e[e]!==void 0&&!this.#i(this.#e[e])&&(yield this.#e[e])}*rvalues(){for(let e of this.#w())this.#e[e]!==void 0&&!this.#i(this.#e[e])&&(yield this.#e[e])}[Symbol.iterator](){return this.entries()}[Symbol.toStringTag]="LRUCache";find(e,t={}){for(let i of this.#D()){let r=this.#e[i],s=this.#i(r)?r.__staleWhileFetching:r;if(s!==void 0&&e(s,this.#s[i],this))return this.#T(this.#s[i],t)}}forEach(e,t=this){for(let i of this.#D()){let r=this.#e[i],s=this.#i(r)?r.__staleWhileFetching:r;s!==void 0&&e.call(t,s,this.#s[i],this)}}rforEach(e,t=this){for(let i of this.#w()){let r=this.#e[i],s=this.#i(r)?r.__staleWhileFetching:r;s!==void 0&&e.call(t,s,this.#s[i],this)}}purgeStale(){let e=!1;for(let t of this.#w({allowStale:!0}))this.#g(t)&&(this.#x(this.#s[t],"expire"),e=!0);return e}info(e){let t=this.#n.get(e);if(t===void 0)return;let i=this.#e[t],r=this.#i(i)?i.__staleWhileFetching:i;if(r===void 0)return;let s={value:r};if(this.#d&&this.#C){let a=this.#d[t],n=this.#C[t];if(a&&n){let l=a-(this.#S.now()-n);s.ttl=l,s.start=Date.now()}}return this.#b&&(s.size=this.#b[t]),s}dump(){let e=[];for(let t of this.#D({allowStale:!0})){let i=this.#s[t],r=this.#e[t],s=this.#i(r)?r.__staleWhileFetching:r;if(s===void 0||i===void 0)continue;let a={value:s};if(this.#d&&this.#C){a.ttl=this.#d[t];let n=this.#S.now()-this.#C[t];a.start=Math.floor(Date.now()-n)}this.#b&&(a.size=this.#b[t]),e.unshift([i,a])}return e}load(e){this.clear();for(let[t,i]of e){if(i.start){let r=Date.now()-i.start;i.start=this.#S.now()-r}this.#E(t,i.value,i)}}set(e,t,i={}){let{status:r=w.hasSubscribers?{}:void 0}=i;i.status=r,r&&(r.op="set",r.key=e,t!==void 0&&(r.value=t),r.cache=this);let s=this.#E(e,t,i);return r&&w.hasSubscribers&&w.publish(r),s}#E(e,t,i,r){let{ttl:s=this.ttl,start:a,noDisposeOnSet:n=this.noDisposeOnSet,sizeCalculation:l=this.sizeCalculation,status:u}=i,f=this.#i(t);if(t===void 0)return u&&(u.set="deleted"),this.delete(e),this;let{noUpdateTTL:g=this.noUpdateTTL}=i;u&&!f&&(u.value=t);let v=this.#_(e,t,i.size||0,l,u);if(this.maxEntrySize&&v>this.maxEntrySize)return this.#x(e,"set"),u&&(u.set="miss",u.maxEntrySizeExceeded=!0),this;let y=this.#o===0?void 0:this.#n.get(e);if(y===void 0)y=this.#o===0?this.#a:this.#y.length!==0?this.#y.pop():this.#o===this.#r?this.#U(!1):this.#o,this.#s[y]=e,this.#e[y]=t,this.#n.set(e,y),this.#u[this.#a]=y,this.#f[y]=this.#a,this.#a=y,this.#o++,this.#k(y,v,u),u&&(u.set="add"),g=!1,this.#O&&!f&&this.#$?.(t,e,"add");else{this.#G(y);let b=this.#e[y];if(t!==b){if(!n)if(this.#i(b)){b!==r&&b.__abortController.abort(new Error("replaced"));let{__staleWhileFetching:m}=b;m!==void 0&&m!==t&&(this.#P&&this.#t?.(m,e,"set"),this.#p&&this.#l?.push([m,e,"set"]))}else this.#P&&this.#t?.(b,e,"set"),this.#p&&this.#l?.push([b,e,"set"]);if(this.#F(y),this.#k(y,v,u),this.#e[y]=t,!f){let m=b&&this.#i(b)?b.__staleWhileFetching:b,L=m===void 0?"add":t!==m?"replace":"update";u&&(u.set=L,m!==void 0&&(u.oldValue=m)),this.#O&&this.onInsert?.(t,e,L)}}else f||(u&&(u.set="update"),this.#O&&this.onInsert?.(t,e,"update"))}if(s!==0&&!this.#d&&this.#j(),this.#d&&(g||this.#W(y,s,a),u&&this.#A(u,y)),!n&&this.#p&&this.#l){let b=this.#l,m;for(;m=b?.shift();)this.#L?.(...m)}return this}pop(){try{for(;this.#o;){let e=this.#e[this.#h];if(this.#U(!0),this.#i(e)){if(e.__staleWhileFetching)return e.__staleWhileFetching}else if(e!==void 0)return e}}finally{if(this.#p&&this.#l){let e=this.#l,t;for(;t=e?.shift();)this.#L?.(...t)}}}#U(e){let t=this.#h,i=this.#s[t],r=this.#e[t],s=this.#i(r);s&&r.__abortController.abort(new Error("evicted"));let a=s?r.__staleWhileFetching:r;return(this.#P||this.#p)&&a!==void 0&&(this.#P&&this.#t?.(a,i,"evict"),this.#p&&this.#l?.push([a,i,"evict"])),this.#F(t),this.#m?.[t]&&(clearTimeout(this.#m[t]),this.#m[t]=void 0),e&&(this.#s[t]=void 0,this.#e[t]=void 0,this.#y.push(t)),this.#o===1?(this.#h=this.#a=0,this.#y.length=0):this.#h=this.#u[t],this.#n.delete(i),this.#o--,t}has(e,t={}){let{status:i=w.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="has",i.key=e,i.cache=this);let r=this.#K(e,t);return w.hasSubscribers&&w.publish(i),r}#K(e,t={}){let{updateAgeOnHas:i=this.updateAgeOnHas,status:r}=t,s=this.#n.get(e);if(s!==void 0){let a=this.#e[s];if(this.#i(a)&&a.__staleWhileFetching===void 0)return!1;if(this.#g(s))r&&(r.has="stale",this.#A(r,s));else return i&&this.#N(s),r&&(r.has="hit",this.#A(r,s)),!0}else r&&(r.has="miss");return!1}peek(e,t={}){let{status:i=he()?{}:void 0}=t;i&&(i.op="peek",i.key=e,i.cache=this),t.status=i;let r=this.#J(e,t);return w.hasSubscribers&&w.publish(i),r}#J(e,t){let{status:i,allowStale:r=this.allowStale}=t,s=this.#n.get(e);if(s===void 0||!r&&this.#g(s)){i&&(i.peek=s===void 0?"miss":"stale");return}let a=this.#e[s],n=this.#i(a)?a.__staleWhileFetching:a;return i&&(n!==void 0?(i.peek="hit",i.value=n):i.peek="miss"),n}#M(e,t,i,r){let s=t===void 0?void 0:this.#e[t];if(this.#i(s))return s;let a=new AbortController,{signal:n}=i;n?.addEventListener("abort",()=>a.abort(n.reason),{signal:a.signal});let l={signal:a.signal,options:i,context:r},u=(m,L=!1)=>{let{aborted:h}=a.signal,S=i.ignoreFetchAbort&&m!==void 0,C=i.ignoreFetchAbort||!!(i.allowStaleOnFetchAbort&&m!==void 0);if(i.status&&(h&&!L?(i.status.fetchAborted=!0,i.status.fetchError=a.signal.reason,S&&(i.status.fetchAbortIgnored=!0)):i.status.fetchResolved=!0),h&&!S&&!L)return g(a.signal.reason,C);let c=y,p=this.#e[t];return(p===y||p===void 0&&S&&L)&&(m===void 0?c.__staleWhileFetching!==void 0?this.#e[t]=c.__staleWhileFetching:this.#x(e,"fetch"):(i.status&&(i.status.fetchUpdated=!0),this.#E(e,m,l.options,c))),m},f=m=>(i.status&&(i.status.fetchRejected=!0,i.status.fetchError=m),g(m,!1)),g=(m,L)=>{let{aborted:h}=a.signal,S=h&&i.allowStaleOnFetchAbort,C=S||i.allowStaleOnFetchRejection,c=C||i.noDeleteOnFetchRejection,p=y;if(this.#e[t]===y&&(!c||!L&&p.__staleWhileFetching===void 0?this.#x(e,"fetch"):S||(this.#e[t]=p.__staleWhileFetching)),C)return i.status&&p.__staleWhileFetching!==void 0&&(i.status.returnedStale=!0),p.__staleWhileFetching;if(p.__returned===p)throw m},v=(m,L)=>{let h=this.#B?.(e,s,l);a.signal.addEventListener("abort",()=>{(!i.ignoreFetchAbort||i.allowStaleOnFetchAbort)&&(m(void 0),i.allowStaleOnFetchAbort&&(m=S=>u(S,!0)))}),h&&h instanceof Promise?h.then(S=>m(S===void 0?void 0:S),L):h!==void 0&&m(h)};i.status&&(i.status.fetchDispatched=!0);let y=new Promise(v).then(u,f),b=Object.assign(y,{__abortController:a,__staleWhileFetching:s,__returned:void 0});return t===void 0?(this.#E(e,b,{...l.options,status:void 0}),t=this.#n.get(e)):this.#e[t]=b,b}#i(e){if(!this.#I)return!1;let t=e;return!!t&&t instanceof Promise&&t.hasOwnProperty("__staleWhileFetching")&&t.__abortController instanceof AbortController}fetch(e,t={}){let i=G.hasSubscribers,{status:r=he()?{}:void 0}=t;t.status=r,r&&t.context&&(r.context=t.context);let s=this.#z(e,t);return r&&i&&(r.trace=!0,G.tracePromise(()=>s,r).catch(()=>{})),s}async#z(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,ttl:a=this.ttl,noDisposeOnSet:n=this.noDisposeOnSet,size:l=0,sizeCalculation:u=this.sizeCalculation,noUpdateTTL:f=this.noUpdateTTL,noDeleteOnFetchRejection:g=this.noDeleteOnFetchRejection,allowStaleOnFetchRejection:v=this.allowStaleOnFetchRejection,ignoreFetchAbort:y=this.ignoreFetchAbort,allowStaleOnFetchAbort:b=this.allowStaleOnFetchAbort,context:m,forceRefresh:L=!1,status:h,signal:S}=t;if(h&&(h.op="fetch",h.key=e,L&&(h.forceRefresh=!0),h.cache=this),!this.#I)return h&&(h.fetch="get"),this.#T(e,{allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:s,status:h});let C={allowStale:i,updateAgeOnGet:r,noDeleteOnStaleGet:s,ttl:a,noDisposeOnSet:n,size:l,sizeCalculation:u,noUpdateTTL:f,noDeleteOnFetchRejection:g,allowStaleOnFetchRejection:v,allowStaleOnFetchAbort:b,ignoreFetchAbort:y,status:h,signal:S},c=this.#n.get(e);if(c===void 0){h&&(h.fetch="miss");let p=this.#M(e,c,C,m);return p.__returned=p}else{let p=this.#e[c];if(this.#i(p)){let A=i&&p.__staleWhileFetching!==void 0;return h&&(h.fetch="inflight",A&&(h.returnedStale=!0)),A?p.__staleWhileFetching:p.__returned=p}let d=this.#g(c);if(!L&&!d)return h&&(h.fetch="hit"),this.#G(c),r&&this.#N(c),h&&this.#A(h,c),p;let P=this.#M(e,c,C,m),D=P.__staleWhileFetching!==void 0&&i;return h&&(h.fetch=d?"stale":"refresh",D&&d&&(h.returnedStale=!0)),D?P.__staleWhileFetching:P.__returned=P}}forceFetch(e,t={}){let i=G.hasSubscribers,{status:r=he()?{}:void 0}=t;t.status=r,r&&t.context&&(r.context=t.context);let s=this.#X(e,t);return r&&i&&(r.trace=!0,G.tracePromise(()=>s,r).catch(()=>{})),s}async#X(e,t={}){let i=await this.#z(e,t);if(i===void 0)throw new Error("fetch() returned undefined");return i}memo(e,t={}){let{status:i=w.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="memo",i.key=e,t.context&&(i.context=t.context),i.cache=this);let r=this.#Z(e,t);return i&&(i.value=r),w.hasSubscribers&&w.publish(i),r}#Z(e,t={}){let i=this.#R;if(!i)throw new Error("no memoMethod provided to constructor");let{context:r,status:s,forceRefresh:a,...n}=t;s&&a&&(s.forceRefresh=!0);let l=this.#T(e,n),u=a||l===void 0;if(s&&(s.memo=u?"miss":"hit",u||(s.value=l)),!u)return l;let f=i(e,l,{options:n,context:r});return s&&(s.value=f),this.#E(e,f,n),f}get(e,t={}){let{status:i=w.hasSubscribers?{}:void 0}=t;t.status=i,i&&(i.op="get",i.key=e,i.cache=this);let r=this.#T(e,t);return i&&(r!==void 0&&(i.value=r),w.hasSubscribers&&w.publish(i)),r}#T(e,t={}){let{allowStale:i=this.allowStale,updateAgeOnGet:r=this.updateAgeOnGet,noDeleteOnStaleGet:s=this.noDeleteOnStaleGet,status:a}=t,n=this.#n.get(e);if(n===void 0){a&&(a.get="miss");return}let l=this.#e[n],u=this.#i(l);return a&&this.#A(a,n),this.#g(n)?u?(a&&(a.get="stale-fetching"),i&&l.__staleWhileFetching!==void 0?(a&&(a.returnedStale=!0),l.__staleWhileFetching):void 0):(s||this.#x(e,"expire"),a&&(a.get="stale"),i?(a&&(a.returnedStale=!0),l):void 0):(a&&(a.get=u?"fetching":"hit"),this.#G(n),r&&this.#N(n),u?l.__staleWhileFetching:l)}#Y(e,t){this.#f[t]=e,this.#u[e]=t}#G(e){e!==this.#a&&(e===this.#h?this.#h=this.#u[e]:this.#Y(this.#f[e],this.#u[e]),this.#Y(this.#a,e),this.#a=e)}delete(e){return this.#x(e,"delete")}#x(e,t){w.hasSubscribers&&w.publish({op:"delete",delete:t,key:e,cache:this});let i=!1;if(this.#o!==0){let r=this.#n.get(e);if(r!==void 0)if(this.#m?.[r]&&(clearTimeout(this.#m?.[r]),this.#m[r]=void 0),i=!0,this.#o===1)this.#q(t);else{this.#F(r);let s=this.#e[r];if(this.#i(s)?s.__abortController.abort(new Error("deleted")):(this.#P||this.#p)&&(this.#P&&this.#t?.(s,e,t),this.#p&&this.#l?.push([s,e,t])),this.#n.delete(e),this.#s[r]=void 0,this.#e[r]=void 0,r===this.#a)this.#a=this.#f[r];else if(r===this.#h)this.#h=this.#u[r];else{let a=this.#f[r];this.#u[a]=this.#u[r];let n=this.#u[r];this.#f[n]=this.#f[r]}this.#o--,this.#y.push(r)}}if(this.#p&&this.#l?.length){let r=this.#l,s;for(;s=r?.shift();)this.#L?.(...s)}return i}clear(){return this.#q("delete")}#q(e){for(let t of this.#w({allowStale:!0})){let i=this.#e[t];if(this.#i(i))i.__abortController.abort(new Error("deleted"));else{let r=this.#s[t];this.#P&&this.#t?.(i,r,e),this.#p&&this.#l?.push([i,r,e])}}if(this.#n.clear(),this.#e.fill(void 0),this.#s.fill(void 0),this.#d&&this.#C){this.#d.fill(0),this.#C.fill(0);for(let t of this.#m??[])t!==void 0&&clearTimeout(t);this.#m?.fill(void 0)}if(this.#b&&this.#b.fill(0),this.#h=0,this.#a=0,this.#y.length=0,this.#v=0,this.#o=0,this.#p&&this.#l){let t=this.#l,i;for(;i=t?.shift();)this.#L?.(...i)}}};const Ri=Object.defineProperty({__proto__:null,LRUCache:Bi},Symbol.toStringTag,{value:"Module"}),Ii=ve(Ri);var ue,Ge;function ki(){if(Ge)return ue;Ge=1;const o=(...s)=>s.every(a=>a)?s.join(""):"",e=s=>s?encodeURIComponent(s):"",t=s=>s.toLowerCase().replace(/^\W+/g,"").replace(/(?<!\W)\W+$/,"").replace(/\//g,"").replace(/\W+/g,"-"),i={sshtemplate:({domain:s,user:a,project:n,committish:l})=>`git@${s}:${a}/${n}.git${o("#",l)}`,sshurltemplate:({domain:s,user:a,project:n,committish:l})=>`git+ssh://git@${s}/${a}/${n}.git${o("#",l)}`,edittemplate:({domain:s,user:a,project:n,committish:l,editpath:u,path:f})=>`https://${s}/${a}/${n}${o("/",u,"/",e(l||"HEAD"),"/",f)}`,browsetemplate:({domain:s,user:a,project:n,committish:l,treepath:u})=>`https://${s}/${a}/${n}${o("/",u,"/",e(l))}`,browsetreetemplate:({domain:s,user:a,project:n,committish:l,treepath:u,path:f,fragment:g,hashformat:v})=>`https://${s}/${a}/${n}/${u}/${e(l||"HEAD")}/${f}${o("#",v(g||""))}`,browseblobtemplate:({domain:s,user:a,project:n,committish:l,blobpath:u,path:f,fragment:g,hashformat:v})=>`https://${s}/${a}/${n}/${u}/${e(l||"HEAD")}/${f}${o("#",v(g||""))}`,docstemplate:({domain:s,user:a,project:n,treepath:l,committish:u})=>`https://${s}/${a}/${n}${o("/",l,"/",e(u))}#readme`,httpstemplate:({auth:s,domain:a,user:n,project:l,committish:u})=>`git+https://${o(s,"@")}${a}/${n}/${l}.git${o("#",u)}`,filetemplate:({domain:s,user:a,project:n,committish:l,path:u})=>`https://${s}/${a}/${n}/raw/${e(l||"HEAD")}/${u}`,shortcuttemplate:({type:s,user:a,project:n,committish:l})=>`${s}:${a}/${n}${o("#",l)}`,pathtemplate:({user:s,project:a,committish:n})=>`${s}/${a}${o("#",n)}`,bugstemplate:({domain:s,user:a,project:n})=>`https://${s}/${a}/${n}/issues`,hashformat:t},r={};r.github={protocols:["git:","http:","git+ssh:","git+https:","ssh:","https:"],domain:"github.com",treepath:"tree",blobpath:"blob",editpath:"edit",filetemplate:({auth:s,user:a,project:n,committish:l,path:u})=>`https://${o(s,"@")}raw.githubusercontent.com/${a}/${n}/${e(l||"HEAD")}/${u}`,gittemplate:({auth:s,domain:a,user:n,project:l,committish:u})=>`git://${o(s,"@")}${a}/${n}/${l}.git${o("#",u)}`,tarballtemplate:({domain:s,user:a,project:n,committish:l})=>`https://codeload.${s}/${a}/${n}/tar.gz/${e(l||"HEAD")}`,extract:s=>{let[,a,n,l,u]=s.pathname.split("/",5);if(!(l&&l!=="tree")&&(l||(u=s.hash.slice(1)),n&&n.endsWith(".git")&&(n=n.slice(0,-4)),!(!a||!n)))return{user:a,project:n,committish:u}}},r.bitbucket={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"bitbucket.org",treepath:"src",blobpath:"src",editpath:"?mode=edit",edittemplate:({domain:s,user:a,project:n,committish:l,treepath:u,path:f,editpath:g})=>`https://${s}/${a}/${n}${o("/",u,"/",e(l||"HEAD"),"/",f,g)}`,tarballtemplate:({domain:s,user:a,project:n,committish:l})=>`https://${s}/${a}/${n}/get/${e(l||"HEAD")}.tar.gz`,extract:s=>{let[,a,n,l]=s.pathname.split("/",4);if(!["get"].includes(l)&&(n&&n.endsWith(".git")&&(n=n.slice(0,-4)),!(!a||!n)))return{user:a,project:n,committish:s.hash.slice(1)}}},r.gitlab={protocols:["git+ssh:","git+https:","ssh:","https:"],domain:"gitlab.com",treepath:"tree",blobpath:"tree",editpath:"-/edit",tarballtemplate:({domain:s,user:a,project:n,committish:l})=>`https://${s}/api/v4/projects/${e(a+"/"+n)}/repository/archive.tar.gz?sha=${e(l||"HEAD")}`,extract:s=>{const a=s.pathname.slice(1);if(a.includes("/-/")||a.includes("/archive.tar.gz"))return;const n=a.split("/");let l=n.pop();l.endsWith(".git")&&(l=l.slice(0,-4));const u=n.join("/");if(!(!u||!l))return{user:u,project:l,committish:s.hash.slice(1)}}},r.gist={protocols:["git:","git+ssh:","git+https:","ssh:","https:"],domain:"gist.github.com",editpath:"edit",sshtemplate:({domain:s,project:a,committish:n})=>`git@${s}:${a}.git${o("#",n)}`,sshurltemplate:({domain:s,project:a,committish:n})=>`git+ssh://git@${s}/${a}.git${o("#",n)}`,edittemplate:({domain:s,user:a,project:n,committish:l,editpath:u})=>`https://${s}/${a}/${n}${o("/",e(l))}/${u}`,browsetemplate:({domain:s,project:a,committish:n})=>`https://${s}/${a}${o("/",e(n))}`,browsetreetemplate:({domain:s,project:a,committish:n,path:l,hashformat:u})=>`https://${s}/${a}${o("/",e(n))}${o("#",u(l))}`,browseblobtemplate:({domain:s,project:a,committish:n,path:l,hashformat:u})=>`https://${s}/${a}${o("/",e(n))}${o("#",u(l))}`,docstemplate:({domain:s,project:a,committish:n})=>`https://${s}/${a}${o("/",e(n))}`,httpstemplate:({domain:s,project:a,committish:n})=>`git+https://${s}/${a}.git${o("#",n)}`,filetemplate:({user:s,project:a,committish:n,path:l})=>`https://gist.githubusercontent.com/${s}/${a}/raw${o("/",e(n))}/${l}`,shortcuttemplate:({type:s,project:a,committish:n})=>`${s}:${a}${o("#",n)}`,pathtemplate:({project:s,committish:a})=>`${s}${o("#",a)}`,bugstemplate:({domain:s,project:a})=>`https://${s}/${a}`,gittemplate:({domain:s,project:a,committish:n})=>`git://${s}/${a}.git${o("#",n)}`,tarballtemplate:({project:s,committish:a})=>`https://codeload.github.com/gist/${s}/tar.gz/${e(a||"HEAD")}`,extract:s=>{let[,a,n,l]=s.pathname.split("/",4);if(l!=="raw"){if(!n){if(!a)return;n=a,a=null}return n.endsWith(".git")&&(n=n.slice(0,-4)),{user:a,project:n,committish:s.hash.slice(1)}}},hashformat:function(s){return s&&"file-"+t(s)}},r.sourcehut={protocols:["git+ssh:","https:"],domain:"git.sr.ht",treepath:"tree",blobpath:"tree",filetemplate:({domain:s,user:a,project:n,committish:l,path:u})=>`https://${s}/${a}/${n}/blob/${e(l)||"HEAD"}/${u}`,httpstemplate:({domain:s,user:a,project:n,committish:l})=>`https://${s}/${a}/${n}${o("#",l)}`,tarballtemplate:({domain:s,user:a,project:n,committish:l})=>`https://${s}/${a}/${n}/archive/${e(l)||"HEAD"}.tar.gz`,bugstemplate:()=>null,extract:s=>{let[,a,n,l]=s.pathname.split("/",4);if(!["archive"].includes(l)&&(n&&n.endsWith(".git")&&(n=n.slice(0,-4)),!(!a||!n)))return{user:a,project:n,committish:s.hash.slice(1)}}};for(const[s,a]of Object.entries(r))r[s]=Object.assign({},i,a);return ue=r,ue}var pe,Be;function st(){if(Be)return pe;Be=1;const o=(r,s,a)=>{const n=r.indexOf(a);return r.lastIndexOf(s,n>-1?n:1/0)},e=r=>{try{return new URL(r)}catch{}},t=(r,s)=>{const a=r.indexOf(":"),n=r.slice(0,a+1);if(Object.prototype.hasOwnProperty.call(s,n)||r.substr(a,3)==="://")return r;const l=r.indexOf("@");return l>-1?l>a?`git+ssh://${r}`:r:`${r.slice(0,a+1)}//${r.slice(a+1)}`},i=r=>{const s=o(r,"@","#"),a=o(r,":","#");return a>s&&(r=r.slice(0,a)+"/"+r.slice(a+1)),o(r,":","#")===-1&&r.indexOf("//")===-1&&(r=`git+ssh://${r}`),r};return pe=(r,s)=>{const a=s?t(r,s):r;return e(a)||e(i(a))},pe}var fe,Re;function Ui(){if(Re)return fe;Re=1;const o=st(),e=t=>{const i=t.indexOf("#"),r=t.indexOf("/"),s=t.indexOf("/",r+1),a=t.indexOf(":"),n=/\s/.exec(t),l=t.indexOf("@"),u=!n||i>-1&&n.index>i,f=l===-1||i>-1&&l>i,g=a===-1||i>-1&&a>i,v=s===-1||i>-1&&s>i,y=r>0,b=i>-1?t[i-1]!=="/":!t.endsWith("/"),m=!t.startsWith(".");return u&&y&&b&&m&&f&&g&&v};return fe=(t,i,{gitHosts:r,protocols:s})=>{if(!t)return;const a=e(t)?`github:${t}`:t,n=o(a,s);if(!n)return;const l=r.byShortcut[n.protocol],u=r.byDomain[n.hostname.startsWith("www.")?n.hostname.slice(4):n.hostname],f=l||u;if(!f)return;const g=r[l||u];let v=null;s[n.protocol]?.auth&&(n.username||n.password)&&(v=`${n.username}${n.password?":"+n.password:""}`);let y=null,b=null,m=null,L=null;try{if(l){let h=n.pathname.startsWith("/")?n.pathname.slice(1):n.pathname;const S=h.indexOf("@");S>-1&&(h=h.slice(S+1));const C=h.lastIndexOf("/");C>-1?(b=decodeURIComponent(h.slice(0,C)),b||(b=null),m=decodeURIComponent(h.slice(C+1))):m=decodeURIComponent(h),m.endsWith(".git")&&(m=m.slice(0,-4)),n.hash&&(y=decodeURIComponent(n.hash.slice(1))),L="shortcut"}else{if(!g.protocols.includes(n.protocol))return;const h=g.extract(n);if(!h)return;b=h.user&&decodeURIComponent(h.user),m=decodeURIComponent(h.project),y=decodeURIComponent(h.committish),L=s[n.protocol]?.name||n.protocol.slice(0,-1)}}catch(h){if(h instanceof URIError)return;throw h}return[f,b,v,m,y,L,i]},fe}var de,Ie;function Mi(){if(Ie)return de;Ie=1;const{LRUCache:o}=Ii,e=ki(),t=Ui(),i=st(),r=new o({max:1e3});function s(n){try{const{protocol:l,hostname:u,pathname:f}=new URL(n);if(!u)return null;const g=/(?:git\+)http:$/.test(l)?"http:":"https:",v=f.replace(/\.git$/,"");return`${g}//${u}${v}`}catch{return null}}class a{constructor(l,u,f,g,v,y,b={}){Object.assign(this,a.#r[l],{type:l,user:u,auth:f,project:g,committish:v,default:y,opts:b})}static#r={byShortcut:{},byDomain:{}};static#c={"git+ssh:":{name:"sshurl"},"ssh:":{name:"sshurl"},"git+https:":{name:"https",auth:!0},"git:":{auth:!0},"http:":{auth:!0},"https:":{auth:!0},"git+http:":{auth:!0}};static addHost(l,u){a.#r[l]=u,a.#r.byDomain[u.domain]=l,a.#r.byShortcut[`${l}:`]=l,a.#c[`${l}:`]={name:l}}static fromUrl(l,u){if(typeof l!="string")return;const f=l+JSON.stringify(u||{});if(!r.has(f)){const g=t(l,u,{gitHosts:a.#r,protocols:a.#c});r.set(f,g?new a(...g):void 0)}return r.get(f)}static fromManifest(l,u={}){if(!l||typeof l!="object")return;const f=l.repository,g=f&&(typeof f=="string"?f:typeof f=="object"&&typeof f.url=="string"?f.url:null);if(!g)throw new Error("no repository");const v=g&&a.fromUrl(g.replace(/^git\+/,""),u)||null;if(v)return v;const y=s(g);return a.fromUrl(y,u)||y}static parseUrl(l){return i(l)}#t(l,u){if(typeof l!="function")return null;const f={...this,...this.opts,...u};f.path||(f.path=""),f.path.startsWith("/")&&(f.path=f.path.slice(1)),f.noCommittish&&(f.committish=null);const g=l(f);return f.noGitPlus&&g.startsWith("git+")?g.slice(4):g}hash(){return this.committish?`#${this.committish}`:""}ssh(l){return this.#t(this.sshtemplate,l)}sshurl(l){return this.#t(this.sshurltemplate,l)}browse(l,...u){return typeof l!="string"?this.#t(this.browsetemplate,l):typeof u[0]!="string"?this.#t(this.browsetreetemplate,{...u[0],path:l}):this.#t(this.browsetreetemplate,{...u[1],fragment:u[0],path:l})}browseFile(l,...u){return typeof u[0]!="string"?this.#t(this.browseblobtemplate,{...u[0],path:l}):this.#t(this.browseblobtemplate,{...u[1],fragment:u[0],path:l})}docs(l){return this.#t(this.docstemplate,l)}bugs(l){return this.#t(this.bugstemplate,l)}https(l){return this.#t(this.httpstemplate,l)}git(l){return this.#t(this.gittemplate,l)}shortcut(l){return this.#t(this.shortcuttemplate,l)}path(l){return this.#t(this.pathtemplate,l)}tarball(l){return this.#t(this.tarballtemplate,{...l,noCommittish:!1})}file(l,u){return this.#t(this.filetemplate,{...u,path:l})}edit(l,u){return this.#t(this.edittemplate,{...u,path:l})}getDefaultRepresentation(){return this.default}toString(l){return this.default&&typeof this[this.default]=="function"?this[this.default](l):this.sshurl(l)}}for(const[n,l]of Object.entries(e))a.addHost(n,l);return de=a,de}var me,ke;function ji(){if(ke)return me;ke=1,me=o;function o(e){if(!e||e==="ERROR: No README data found!")return;e=e.trim().split(`
|
|
2
|
+
`);let t=0;for(;e[t]&&e[t].trim().match(/^(#|$)/);)t++;const i=e.length;let r=t+1;for(;r<i&&e[r].trim();)r++;return e.slice(t,r).join(" ").trim()}return me}var rt={dependancies:"dependencies",dependecies:"dependencies",depdenencies:"dependencies",devEependencies:"devDependencies",depends:"dependencies","dev-dependencies":"devDependencies",devDependences:"devDependencies",devDepenencies:"devDependencies",devdependencies:"devDependencies",repostitory:"repository",repo:"repository",prefereGlobal:"preferGlobal",hompage:"homepage",hampage:"homepage",autohr:"author",autor:"author",contributers:"contributors",publicationConfig:"publishConfig",script:"scripts"},nt={web:"url",name:"url"},ot={server:"start",tests:"test"};const Wi={topLevel:rt,bugs:nt,script:ot},_i=Object.defineProperty({__proto__:null,bugs:nt,default:Wi,script:ot,topLevel:rt},Symbol.toStringTag,{value:"Module"}),Hi=ve(_i);var ge,Ue;function zi(){if(Ue)return ge;Ue=1;var{URL:o}=We,e=zt(),t=Yt(),i=Oi(),r=Mi(),{isBuiltin:s}=_e,a=["dependencies","devDependencies","optionalDependencies"],n=ji(),l=Hi,u=c=>c.includes("@")&&c.indexOf("@")<c.lastIndexOf(".");ge={warn:function(){},fixRepositoryField:function(c){if(c.repositories&&(this.warn("repositories"),c.repository=c.repositories[0]),!c.repository)return this.warn("missingRepository");typeof c.repository=="string"&&(c.repository={type:"git",url:c.repository});var p=c.repository.url||"";if(p){var d=r.fromUrl(p);d&&(p=c.repository.url=d.getDefaultRepresentation()==="shortcut"?d.https():d.toString())}p.match(/github.com\/[^/]+\/[^/]+\.git\.git$/)&&this.warn("brokenGitUrl",p)},fixTypos:function(c){Object.keys(l.topLevel).forEach(function(p){Object.prototype.hasOwnProperty.call(c,p)&&this.warn("typo",p,l.topLevel[p])},this)},fixScriptsField:function(c){if(c.scripts){if(typeof c.scripts!="object"){this.warn("nonObjectScripts"),delete c.scripts;return}Object.keys(c.scripts).forEach(function(p){typeof c.scripts[p]!="string"?(this.warn("nonStringScript"),delete c.scripts[p]):l.script[p]&&!c.scripts[l.script[p]]&&this.warn("typo",p,l.script[p],"scripts")},this)}},fixFilesField:function(c){var p=c.files;p&&!Array.isArray(p)?(this.warn("nonArrayFiles"),delete c.files):c.files&&(c.files=c.files.filter(function(d){return!d||typeof d!="string"?(this.warn("invalidFilename",d),!1):!0},this))},fixBinField:function(c){if(c.bin&&typeof c.bin=="string"){var p={},d;(d=c.name.match(/^@[^/]+[/](.*)$/))?p[d[1]]=c.bin:p[c.name]=c.bin,c.bin=p}},fixManField:function(c){c.man&&typeof c.man=="string"&&(c.man=[c.man])},fixBundleDependenciesField:function(c){var p="bundledDependencies",d="bundleDependencies";c[p]&&!c[d]&&(c[d]=c[p],delete c[p]),c[d]&&!Array.isArray(c[d])?(this.warn("nonArrayBundleDependencies"),delete c[d]):c[d]&&(c[d]=c[d].filter(function(P){return!P||typeof P!="string"?(this.warn("nonStringBundleDependency",P),!1):(c.dependencies||(c.dependencies={}),Object.prototype.hasOwnProperty.call(c.dependencies,P)||(this.warn("nonDependencyBundleDependency",P),c.dependencies[P]="*"),!0)},this))},fixDependencies:function(c){S(c,this.warn),L(c),this.fixBundleDependenciesField(c),["dependencies","devDependencies"].forEach(function(p){if(p in c){if(!c[p]||typeof c[p]!="object"){this.warn("nonObjectDependencies",p),delete c[p];return}Object.keys(c[p]).forEach(function(d){var P=c[p][d];typeof P!="string"&&(this.warn("nonStringDependency",d,JSON.stringify(P)),delete c[p][d]);var D=r.fromUrl(c[p][d]);D&&(c[p][d]=D.toString())},this)}},this)},fixModulesField:function(c){c.modules&&(this.warn("deprecatedModules"),delete c.modules)},fixKeywordsField:function(c){typeof c.keywords=="string"&&(c.keywords=c.keywords.split(/,\s+/)),c.keywords&&!Array.isArray(c.keywords)?(delete c.keywords,this.warn("nonArrayKeywords")):c.keywords&&(c.keywords=c.keywords.filter(function(p){return typeof p!="string"||!p?(this.warn("nonStringKeyword"),!1):!0},this))},fixVersionField:function(c,p){var d=!p;if(!c.version)return c.version="",!0;if(!e(c.version,d))throw new Error('Invalid version: "'+c.version+'"');return c.version=t(c.version,d),!0},fixPeople:function(c){y(c,b),y(c,m)},fixNameField:function(c,p){typeof p=="boolean"?p={strict:p}:typeof p>"u"&&(p={});var d=p.strict;if(!c.name&&!d){c.name="";return}if(typeof c.name!="string")throw new Error("name field must be a string.");d||(c.name=c.name.trim()),v(c.name,d,p.allowLegacyCase),s(c.name)&&this.warn("conflictingName",c.name)},fixDescriptionField:function(c){c.description&&typeof c.description!="string"&&(this.warn("nonStringDescription"),delete c.description),c.readme&&!c.description&&(c.description=n(c.readme)),c.description===void 0&&delete c.description,c.description||this.warn("missingDescription")},fixReadmeField:function(c){c.readme||(this.warn("missingReadme"),c.readme="ERROR: No README data found!")},fixBugsField:function(c){if(!c.bugs&&c.repository&&c.repository.url){var p=r.fromUrl(c.repository.url);p&&p.bugs()&&(c.bugs={url:p.bugs()})}else if(c.bugs){if(typeof c.bugs=="string")u(c.bugs)?c.bugs={email:c.bugs}:o.canParse(c.bugs)?c.bugs={url:c.bugs}:this.warn("nonEmailUrlBugsString");else{C(c.bugs,this.warn);var d=c.bugs;c.bugs={},d.url&&(o.canParse(d.url)?c.bugs.url=d.url:this.warn("nonUrlBugsUrlField")),d.email&&(typeof d.email=="string"&&u(d.email)?c.bugs.email=d.email:this.warn("nonEmailBugsEmailField"))}!c.bugs.email&&!c.bugs.url&&(delete c.bugs,this.warn("emptyNormalizedBugs"))}},fixHomepageField:function(c){if(!c.homepage&&c.repository&&c.repository.url){var p=r.fromUrl(c.repository.url);p&&p.docs()&&(c.homepage=p.docs())}if(c.homepage){if(typeof c.homepage!="string")return this.warn("nonUrlHomepage"),delete c.homepage;o.canParse(c.homepage)||(c.homepage="http://"+c.homepage)}},fixLicenseField:function(c){const p=c.license||c.licence;if(!p)return this.warn("missingLicense");if(typeof p!="string"||p.length<1||p.trim()==="")return this.warn("invalidLicense");if(!i(p).validForNewPackages)return this.warn("invalidLicense")}};function f(c){if(c.charAt(0)!=="@")return!1;var p=c.slice(1).split("/");return p.length!==2?!1:p[0]&&p[1]&&p[0]===encodeURIComponent(p[0])&&p[1]===encodeURIComponent(p[1])}function g(c){return!c.match(/[/@\s+%:]/)&&c===encodeURIComponent(c)}function v(c,p,d){if(c.charAt(0)==="."||!(f(c)||g(c))||p&&!d&&c!==c.toLowerCase()||c.toLowerCase()==="node_modules"||c.toLowerCase()==="favicon.ico")throw new Error("Invalid name: "+JSON.stringify(c))}function y(c,p){return c.author&&(c.author=p(c.author)),["maintainers","contributors"].forEach(function(d){Array.isArray(c[d])&&(c[d]=c[d].map(p))}),c}function b(c){if(typeof c=="string")return c;var p=c.name||"",d=c.url||c.web,P=d?" ("+d+")":"",D=c.email||c.mail,A=D?" <"+D+">":"";return p+A+P}function m(c){if(typeof c!="string")return c;var p=c.match(/^([^(<]+)/),d=c.match(/\(([^()]+)\)/),P=c.match(/<([^<>]+)>/),D={};return p&&p[0].trim()&&(D.name=p[0].trim()),P&&(D.email=P[1]),d&&(D.url=d[1]),D}function L(c){var p=c.optionalDependencies;if(p){var d=c.dependencies||{};Object.keys(p).forEach(function(P){d[P]=p[P]}),c.dependencies=d}}function h(c,p,d){if(!c)return{};if(typeof c=="string"&&(c=c.trim().split(/[\n\r\s\t ,]+/)),!Array.isArray(c))return c;d("deprecatedArrayDependencies",p);var P={};return c.filter(function(D){return typeof D=="string"}).forEach(function(D){D=D.trim().split(/(:?[@\s><=])/);var A=D.shift(),E=D.join("");E=E.trim(),E=E.replace(/^@/,""),P[A]=E}),P}function S(c,p){a.forEach(function(d){c[d]&&(c[d]=h(c[d],d,p))})}function C(c,p){c&&Object.keys(c).forEach(function(d){l.bugs[d]&&(p("typo",d,l.bugs[d],"bugs"),c[l.bugs[d]]=c[d],delete c[d])})}return ge}var at="'repositories' (plural) Not supported. Please pick one as the 'repository' field",lt="No repository field.",ct="Probably broken git url: %s",ht="scripts must be an object",ut="script values must be string commands",pt="Invalid 'files' member",ft="Invalid filename in 'files' list: %s",dt="Invalid 'bundleDependencies' list. Must be array of package names",mt="Invalid bundleDependencies member: %s",gt="Non-dependency in bundleDependencies: %s",Lt="%s field must be an object",St="Invalid dependency: %s %s",vt="specifying %s as array is deprecated",yt="modules field is deprecated",bt="keywords should be an array of strings",Ct="keywords should be an array of strings",Pt="%s is also the name of a node core module.",Dt="'description' field should be a string",wt="No description",xt="No README data",At="No license field.",Et="Bug string field must be url, email, or {email,url}",$t="bugs.url field must be a string url. Deleted.",Ot="bugs.email field must be a string email. Deleted.",Nt="Normalized value of bugs field is an empty object. Deleted.",Ft="homepage field must be a string url. Deleted.",Tt="license should be a valid SPDX license expression",Gt="%s should probably be %s.";const Yi={repositories:at,missingRepository:lt,brokenGitUrl:ct,nonObjectScripts:ht,nonStringScript:ut,nonArrayFiles:pt,invalidFilename:ft,nonArrayBundleDependencies:dt,nonStringBundleDependency:mt,nonDependencyBundleDependency:gt,nonObjectDependencies:Lt,nonStringDependency:St,deprecatedArrayDependencies:vt,deprecatedModules:yt,nonArrayKeywords:bt,nonStringKeyword:Ct,conflictingName:Pt,nonStringDescription:Dt,missingDescription:wt,missingReadme:xt,missingLicense:At,nonEmailUrlBugsString:Et,nonUrlBugsUrlField:$t,nonEmailBugsEmailField:Ot,emptyNormalizedBugs:Nt,nonUrlHomepage:Ft,invalidLicense:Tt,typo:Gt},qi=Object.defineProperty({__proto__:null,brokenGitUrl:ct,conflictingName:Pt,default:Yi,deprecatedArrayDependencies:vt,deprecatedModules:yt,emptyNormalizedBugs:Nt,invalidFilename:ft,invalidLicense:Tt,missingDescription:wt,missingLicense:At,missingReadme:xt,missingRepository:lt,nonArrayBundleDependencies:dt,nonArrayFiles:pt,nonArrayKeywords:bt,nonDependencyBundleDependency:gt,nonEmailBugsEmailField:Ot,nonEmailUrlBugsString:Et,nonObjectDependencies:Lt,nonObjectScripts:ht,nonStringBundleDependency:mt,nonStringDependency:St,nonStringDescription:Dt,nonStringKeyword:Ct,nonStringScript:ut,nonUrlBugsUrlField:$t,nonUrlHomepage:Ft,repositories:at,typo:Gt},Symbol.toStringTag,{value:"Module"}),Vi=ve(qi);var Le,Me;function Ki(){if(Me)return Le;Me=1;var o=qt,e=Vi;Le=function(){var i=Array.prototype.slice.call(arguments,0),r=i.shift();if(r==="typo")return t.apply(null,i);var s=e[r]?e[r]:r+": '%s'";return i.unshift(s),o.format.apply(null,i)};function t(i,r,s){return s&&(i=s+"['"+i+"']",r=s+"['"+r+"']"),o.format(e.typo,i,r)}return Le}var Se,je;function Ji(){if(je)return Se;je=1,Se=s;var o=zi();s.fixer=o;var e=Ki(),t=["name","version","description","repository","modules","scripts","files","bin","man","bugs","keywords","readme","homepage","license"],i=["dependencies","people","typos"],r=t.map(function(n){return a(n)+"Field"});r=r.concat(i);function s(n,l,u){l===!0&&(l=null,u=!0),u||(u=!1),(!l||n.private)&&(l=function(){}),n.scripts&&n.scripts.install==="node-gyp rebuild"&&!n.scripts.preinstall&&(n.gypfile=!0),o.warn=function(){l(e.apply(null,arguments))},r.forEach(function(f){o["fix"+a(f)](n,u)}),n._id=n.name+"@"+n.version}function a(n){return n.charAt(0).toUpperCase()+n.slice(1)}return Se}var Xi=Ji();const Zi=Ht(Xi),Qi=(o,e,t)=>{const i=$(o),r=$(e),s=r===i?".":Mt(i,r);return t.some(a=>{const n=a.startsWith("./")?a.slice(2):a,l=s.startsWith("./")?s.slice(2):s;if(n==="."&&l===".")return!0;if(n.endsWith("/**")){const u=n.slice(0,-3);return l===u||l.startsWith(`${u}/`)}if(n.endsWith("/*")){const u=n.slice(0,-2);return u===""?l!=="."&&!l.includes("/"):l.startsWith(`${u}/`)||l===u}return l===n||l.startsWith(`${n}/`)})},es=o=>{const e=X("pnpm-workspace.yaml",{cwd:$(o),type:"file"});if(!e)return;const t=He(e),i=Array.isArray(t.packages)?t.packages:[];if(!Qi(e,o,i))return;const r={};return t.catalog&&typeof t.catalog=="object"&&(r.catalog=t.catalog),t.catalogs&&typeof t.catalogs=="object"&&(r.catalogs=t.catalogs),Object.keys(r).length>0?r:void 0},ts=(o,e,t)=>{if(e==="catalog:")return t.catalog?.[o];if(e.startsWith("catalog:")){const i=e.slice(8);return t.catalogs?.[i]?.[o]}},is=(o,e)=>{for(const[t,i]of Object.entries(o)){if(typeof i!="string")continue;const r=ts(t,i,e);r&&(o[t]=r)}},ss=(o,e)=>{const t=["dependencies","devDependencies","peerDependencies","optionalDependencies"];for(const i of t){if(!o[i]||typeof o[i]!="object")continue;const r=o[i];is(r,e)}};let rs;const ns=o=>(rs??=Y(import.meta.url))(o),W=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ye=o=>{if(typeof W<"u"&&W.versions&&W.versions.node){const[e,t]=W.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return W.getBuiltinModule(o)}return ns(o)};ye("node:fs");ye("node:readline");ye("node:util");const os=/, ([^,]*)$/,as=new Map,ls=(o,e={})=>`${o}|s${String(e.strict?1:0)}|c${String(e.resolveCatalogs?1:0)}|j${String(e.json5===!1?0:1)}|y${String(e.yaml===!1?0:1)}|w${String(e.ignoreWarnings?1:0)}`;class cs extends Error{constructor(e){super(`The following warnings were encountered while normalizing package data:
|
|
3
|
+
- ${e.join(`
|
|
4
|
+
- `)}`),this.name="PackageJsonValidationError"}}const hs=(o,e,t=[])=>{const i=[];if(Zi(o,r=>{i.push(r)},e),e&&i.length>0){const r=i.filter(s=>!t.some(a=>a instanceof RegExp?a.test(s):a===s));if(r.length>0)throw new cs(r)}return o},us=o=>He(o),ps=o=>{const e=jt(o);return Wt.parse(e)},fs=(o,e)=>e?.yaml!==!1&&(o.endsWith(".yaml")||o.endsWith(".yml"))?us(o):e?.json5!==!1&&o.endsWith(".json5")?ps(o):ze(o),ds=(o,e={})=>{const t={type:"file"};o&&(t.cwd=o);const i=["package.json"];e.yaml!==!1&&i.push("package.yaml","package.yml"),e.json5!==!1&&i.push("package.json5");const r=X(i,t);if(!r)throw new K(`No such file or directory, for ${i.join(", ").replace(os," or $1")} found.`);const s=e.cache&&typeof e.cache!="boolean"?e.cache:as,a=ls(r,e);if(e.cache&&s.has(a))return s.get(a);const n=fs(r,e);if(e.resolveCatalogs){const u=es(r);u&&ss(n,u)}hs(n,e.strict??!1,e.ignoreWarnings);const l={packageJson:n,path:r};return e.cache&&s.set(a,l),l};var ms="2.0.0";const gs={version:ms},Ls=gs.version,Ss="@visulima/vis";let F;const Is=()=>{if(F!==void 0)return F;const o=process.env.VIS_VERSION;if(o)return F=o,F;try{const{packageJson:e}=ds(kt(Ut(import.meta.url)),{json5:!1,yaml:!1});if(e.name===Ss&&typeof e.version=="string")return F=e.version,F}catch{}return F=Ls,F};export{Bs as D,Rs as M,ti as T,Gs as U,xs as a,Ns as b,Es as c,Os as g,$s as h,ws as i,Is as m,Fs as p,As as t,Ts as u};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as h}from"node:module";import{l as w,d as T,m}from"./index-DND6ptxQ.js";import{s as S}from"./index-BAe6e0XE.js";import{g as R}from"./en-BxrK-n-J.js";import{a as C}from"./readJsonSync-BnWiH5-R-BpnwAB0Z.js";let b;const k=t=>(b??=h(import.meta.url))(t),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=t=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,s]=u.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return u.getBuiltinModule(t)}return k(t)},{rmSync:l,writeFileSync:j}=_("node:fs"),f=3,U=1800*1e3,z=15e3,g=()=>m(R(),"packuments"),y=t=>m(g(),`${encodeURIComponent(t)}.json`),F=t=>{const e=y(t);if(w(e))try{const s=C(e);if(s.cacheVersion!==f){l(e,{force:!0});return}if(Date.now()-s.createdAt>s.ttlMs){l(e,{force:!0});return}return s.packument}catch{l(e,{force:!0});return}},M=(t,e,s)=>{T(g());const n={cacheVersion:f,createdAt:Date.now(),packument:e,ttlMs:s};j(y(t),JSON.stringify(n),"utf8")},$=t=>{const e={},s=t.versions??{};for(const[c,r]of Object.entries(s)){const i=r.dist,o={version:c};if(r._npmUser!==void 0&&(o._npmUser=r._npmUser),r.maintainers!==void 0&&(o.maintainers=r.maintainers),r.bin!==void 0&&(o.bin=r.bin),i!==void 0){const a={};i.signatures!==void 0&&(a.signatures=i.signatures),i.attestations!==void 0&&(a.attestations=i.attestations),typeof i.integrity=="string"&&(a.integrity=i.integrity),typeof i.tarball=="string"&&(a.tarball=i.tarball),typeof i.unpackedSize=="number"&&Number.isFinite(i.unpackedSize)&&i.unpackedSize>=0&&(a.unpackedSize=i.unpackedSize),typeof i.fileCount=="number"&&Number.isInteger(i.fileCount)&&i.fileCount>=0&&(a.fileCount=i.fileCount),o.dist=a}r.repository!==void 0&&(o.repository=r.repository),r.license!==void 0&&(o.license=r.license),typeof r.readme=="string"&&(o.readme=r.readme),typeof r.readmeFilename=="string"&&(o.readmeFilename=r.readmeFilename),typeof r.private=="boolean"&&(o.private=r.private),typeof r.deprecated=="string"&&(o.deprecated=r.deprecated),r.scripts!==void 0&&typeof r.scripts=="object"&&(o.scripts=r.scripts),e[c]=o}const n={name:typeof t.name=="string"?t.name:"",versions:e};return t["dist-tags"]!==void 0&&(n["dist-tags"]=t["dist-tags"]),t.time!==void 0&&(n.time=t.time),typeof t.readme=="string"&&(n.readme=t.readme),n},A=t=>{const e={Accept:"application/json"};return t!==void 0&&t!==""&&(e.Authorization=`Bearer ${t}`),e},N=async(t,e)=>{if(e.registryUrl!==void 0)return{authToken:e.authToken,url:e.registryUrl};if(e.workspaceRoot!==void 0){const{getRegistryForPackage:s,loadNpmrc:n}=await import("../packem_chunks/catalog.js").then(o=>o.a0),c=n(e.workspaceRoot),{token:r,url:i}=s(t,c);return{authToken:e.authToken??r,url:i}}return{authToken:e.authToken,url:"https://registry.npmjs.org"}},P=async(t,e={})=>{const s=e.cacheTtlMs??U,n=F(t);if(n!==void 0)return n;if(e.offline)return;const c=await N(t,e),r=`${c.url.endsWith("/")?c.url.slice(0,-1):c.url}/${t.replace("/","%2f")}`,i=new AbortController,o=setTimeout(()=>{i.abort()},z),a=()=>{i.abort()};e.signal?.addEventListener("abort",a,{once:!0});try{const d=await fetch(r,{headers:A(c.authToken),signal:i.signal});if(d.status===404)return;if(!d.ok)throw new Error(`Registry returned ${String(d.status)} for ${t}`);const v=await d.json(),p=$(v);return M(t,p,s),p}finally{clearTimeout(o),e.signal?.removeEventListener("abort",a)}},x=(t,e)=>{const s=Object.keys(t.versions);if(s.length===0)return;if(e===void 0||e===""||e==="latest")return t["dist-tags"]?.latest??s.at(-1);const n=t["dist-tags"]?.[e];return n!==void 0?n:Object.hasOwn(t.versions,e)?e:S.maxSatisfying(s,e)??void 0};export{P as g,x as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as N}from"node:module";import{l as j,m as v,H as R,j as S,z as J}from"./index-DND6ptxQ.js";import{withEnhancedPath as H,collectNodeModulesBinDirs as F}from"@visulima/task-runner";import{s as $}from"./index-BAe6e0XE.js";import{resolveDlx as V,whichBin as Y,detectPackageManager as G,execPmCommandInteractive as K,resolveAdd as Q,resolveRemove as X,resolveDedupe as Z,resolveWhy as ee,resolveLink as ne,resolveUnlink as se,resolvePmCommand as re,resolveInstall as ae,resolveExec as oe}from"#native";let T;const q=e=>(T??=N(import.meta.url))(e),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 q(e)},{spawn:z,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")},ie=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}},te=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}},pe=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:[]}},ue=e=>{const n=["dedupe"];return e&&n.push("--check"),{args:n,bin:"aube",warnings:[]}},ce=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}},le=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:[]}},ge=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:[]}},de=e=>{const n=["link"];return e!==null&&n.push(e),{args:n,bin:"aube",warnings:[]}},he=(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}},fe=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}},me=new Set(["fund","ping","search","token"]),be=(e,n)=>me.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,ke=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`^$&`)}"`,we=async(e,n,s)=>new Promise((r,a)=>{const o=process.platform==="win32",i=z(o?W(e):e,o?n.map(t=>W(t)):[...n],{cwd:s.cwd,env:ke(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."),ve=e=>e[0]==="rm"?["remove",...e.slice(1)]:e,ye=(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",...ve(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=>Y(e)!==null,$e=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=R(s);if(r===s||S(s).root===s)return;s=r}},He=(e,n)=>{if(n.name!=="aube")return;const s=$e(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.`},_=e=>{if(j(e))try{return JSON.parse(J(e,{buffer:!1}))}catch{return}},je=e=>{let n=e;for(;;){const s=v(n,"package.json"),r=_(s);if(r&&typeof r.packageManager=="string"&&r.packageManager.length>0)return r.packageManager;const a=R(n);if(a===n||S(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:je(e)!==void 0,Fe=(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=xe(e);return{...i,useCorepack:M(e,i.name,o)}},xe=e=>{if(!j(e))throw new Error(`Could not detect package manager in ${e}. Directory does not exist.`);const n=G(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"},Oe=(e,n,s)=>{if(s===void 0)return K(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):Oe(o,s,a.env)},f=(e,n,s,r,a={})=>p(e,n(),s,r,a),Re=(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"?ie(n):ae(e.name,e.version,{...n,silent:n.silent||s.silent===!0});return s.preferOffline&&(r=Re(r,e.name)),s.ciMode&&(r=Se(r,e.name,e.version)),r},Ve=(e,n,s,r,a={})=>{const o=I(e,n,a);return C(e,o,s,r,{dry:a.dry,env:a.env})},Ye=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:""}):we(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]}},_e=(e,n)=>n==="yarn"||n==="aube"?null:{...e,args:[...e.args,"--dry-run"]},C=(e,n,s,r,a)=>{if(a.dry!==!0)return p(e,n,s,r,a);const o=_e(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"?te(n):Q(e.name,e.version,n);a.ignoreScripts&&(o=Ce(o,e.name)),a.silent&&(o=A(o,e.name));const i=C(e,o,s,r,{dry:a.dry,env:a.env});return i===0&&a.autoInstallPeers&&Pe(e,n,s,r,a),i},We=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)},Me=(e,n)=>{let s=e;for(;;){const r=v(s,"node_modules",n,"package.json"),a=_(r);if(a)return a;const o=R(s);if(o===s||S(s).root===s)return;s=o}},Ee=e=>{const n=_(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},Pe=(e,n,s,r,a)=>{if(e.name==="deno")return;const o=Ee(s),i=new Map;for(const g of n.packages){const m=We(g),t=Me(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})},Ge=(e,n,s,r,a={})=>{let o=e.name==="aube"?pe(n):X(e.name,e.version,n);return a.silent&&(o=A(o,e.name)),C(e,o,s,r,{dry:a.dry,env:a.env})},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),Qe=(e,n,s,r,a={})=>e.name==="aube"?p(e,ce(n),s,r,a):f(e,()=>ee(e.name,e.version,n),s,r,a),Le=(e,n)=>{if(e.name==="aube")return fe(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}},Xe=(e,n,s,r,a={})=>p(e,Le(e,n),s,r,a),Ze=(e,n,s,r,a={})=>e.name==="aube"?p(e,de(n),s,r,a):f(e,()=>ne(e.name,e.version,n),s,r,a),en=(e,n,s,r,a,o={})=>e.name==="aube"?p(e,he(n,s),r,a,o):f(e,()=>se(e.name,e.version,n,s),r,a,o),Ie=(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)}`]}}}},nn=(e,n,s,r,a={})=>{let o=e.name==="aube"?le(n):V(e.name,e.version,n);return a.offline&&(o=Ie(o,e.name,e.version)),p(e,o,s,r,{dry:a.dry,env:a.env})},D=process.platform==="win32",Ae=D?[".exe",".cmd",".bat",".ps1",""]:[""],Ue=(e,n)=>{if(!(e.includes("/")||e.includes("\\")))for(const s of F(n))for(const r of Ae){const a=v(s,`${e}${r}`);if(j(a))return D?a.replaceAll("/","\\"):a}},sn=(e,n,s)=>{const r=Ue(e,s);if(r===void 0||D&&!r.toLowerCase().endsWith(".exe"))return null;const a=E(r,n,{cwd:s,env:H({...process.env},s),stdio:"inherit"});if(a.error)throw a.error;return a.status??1},rn=(e,n,s,r,a={})=>e.name==="aube"?p(e,ge(n),s,r,a):f(e,()=>oe(e.name,e.version,n),s,r,a),an=(e,n,s,r,a,o={})=>{if(e.name==="aube")return p(e,be(n,s),r,a,o);const i=ye(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,()=>re(e.name,e.version,n,s),r,a,o)};export{en as $,xe as A,Ye as C,Ge as E,He as I,sn as L,Ke as M,rn as N,Qe as P,Ze as S,an as U,nn as W,Xe as a,Fe as h,De as j,we as s,Je as v,Ve as y};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import{createRequire as p}from"node:module";import{a as l}from"./vis-user-error-DjFv8uxy.js";let m;const d=t=>(m??=p(import.meta.url))(t),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=t=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[s,o]=c.versions.node.split(".").map(Number);if(s>22||s===22&&o>=3||s===20&&o>=16)return c.getBuiltinModule(t)}return d(t)},{createInterface:j}=h("node:readline"),v=t=>{const s=new Set;for(const o of Object.values(t.projects))for(const e of Object.keys(o.targets??{}))s.add(e);return[...s].sort()},y=t=>{const s=new Map;for(const o of t.values())for(const[e,r]of Object.entries(o))for(const n of r.aliases??[])s.has(n)||s.set(n,e);return s},$=(t,s)=>s.get(t)??t,w=(t,s)=>{if(t.length===0)return s.length;if(s.length===0)return t.length;const o=[];for(let e=0;e<=s.length;e++)o[e]=[e];for(let e=0;e<=t.length;e++)o[0][e]=e;for(let e=1;e<=s.length;e++)for(let r=1;r<=t.length;r++){const n=s[e-1]===t[r-1]?0:1;o[e][r]=Math.min(o[e-1][r]+1,o[e][r-1]+1,o[e-1][r-1]+n)}return o[s.length][t.length]},b=(t,s,o=3)=>u(t,s,1,o)[0],u=(t,s,o=3,e=3)=>{const r=[];for(const n of s){const a=w(t.toLowerCase(),n.toLowerCase());a<=e&&r.push({distance:a,name:n})}return r.sort((n,a)=>n.distance-a.distance||n.name.localeCompare(a.name)),r.slice(0,o).map(n=>n.name)},M=t=>t.length===0?" (no targets found)":t.map(s=>` - ${s}`).join(`
|
|
2
|
+
`),S=async t=>{if(t.length===0||!process.stdin.isTTY||!process.stdout.isTTY)return;const s=j({input:process.stdin,output:process.stdout});try{process.stdout.write(`Available targets:
|
|
3
|
+
`);for(const[r,n]of t.entries())process.stdout.write(` ${String(r+1).padStart(2," ")}. ${n}
|
|
4
|
+
`);process.stdout.write(`
|
|
5
|
+
`);const o=(await new Promise(r=>{s.question("Select a target (number or name, blank to cancel): ",r)})).trim();if(o.length===0)return;const e=Number.parseInt(o,10);return Number.isFinite(e)&&e>=1&&e<=t.length?t[e-1]:t.includes(o)?o:b(o,t)}finally{s.close()}},q=(t,s,o)=>{const e=new Set(s.split(",").map(i=>i.trim()).filter(Boolean));if(e.size===0)throw new l("--projects was given no project names. Pass a comma-separated list, or omit the flag to include every project.");const r=t.filter(i=>e.has(i));if(r.length>0)return r;const n=[...e].flatMap(i=>u(i,o)).filter((i,f,g)=>g.indexOf(i)===f),a=n.length>0?`
|
|
6
|
+
Did you mean: ${n.slice(0,3).join(", ")}?`:`
|
|
7
|
+
Run \`vis list\` to see the ${String(o.length)} known project name(s).`;throw new l(`No matching projects found for: ${s}${a}`)};export{M as a,y as b,v as c,q as f,S as p,$ as r,u as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as n}from"node:module";let i;const c=e=>(i??=n(import.meta.url))(e),r=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,a=e=>{if(typeof r<"u"&&r.versions&&r.versions.node){const[s,t]=r.versions.node.split(".").map(Number);if(s>22||s===22&&t>=3||s===20&&t>=16)return r.getBuiltinModule(e)}return c(e)},{createInterface:u}=a("node:readline"),l=async e=>{const s=u({input:process.stdin,output:process.stdout});try{return await new Promise(t=>{s.question(e,o=>{t(o.trim().toLowerCase())})})}finally{s.close()}},d=async(e,s=l)=>{const t=(await s(e)).trim().toLowerCase();return t==="y"||t==="yes"};export{l as d,d as p};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as c}from"./index-BAe6e0XE.js";import{g as m}from"./packument-
|
|
1
|
+
import{s as c}from"./index-BAe6e0XE.js";import{g as m}from"./packument-N3EWbZpL.js";import{i as v}from"../packem_chunks/cli-main.js";const h=8,u=async(t,r,e)=>{if(t.length===0)return[];const o=Math.max(1,Math.min(r,t.length)),s=Array.from({length:t.length});let n=0;const i=async()=>{for(;n<t.length;){const a=n;n+=1;const f=t[a];s[a]=await e(f,a)}};return await Promise.all(Array.from({length:o},()=>i())),s},l=(t,r)=>t.versions[r]?.dist?.attestations?.provenance!==void 0,p=(t,r)=>c.valid(r)?Object.keys(t.versions).filter(e=>c.valid(e)!==null&&c.lt(e,r)).filter(e=>c.satisfies(e,"*",{includePrerelease:!1})).filter(e=>l(t,e)).sort((e,o)=>c.lt(e,o)?1:-1)[0]:void 0,y=async(t,r={})=>{if(v("provenance"))return[];const e=new Set(r.allowlist),o=r.concurrency??h;return(await u(t,o,async({name:s,version:n})=>{if(e.has(s))return;const i=await m(s,{workspaceRoot:r.workspaceRoot});if(i===void 0||l(i,n))return;const a=p(i,n);if(a!==void 0)return{packageName:s,priorVersionWithProvenance:a,version:n}})).filter(s=>s!==void 0)};export{h as D,p as f,u as m,y as r};
|
package/dist/packem_shared/{readJsonSync-DuMMeB3s-B9cGBVbJ.js → readJsonSync-BnWiH5-R-BpnwAB0Z.js}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
import{s as a,
|
|
1
|
+
import{s as a,b as s,P as l,z as f,_ as d}from"./index-DND6ptxQ.js";const m=e=>String.raw`\u{${e.codePointAt(0).toString(16)}}`,p=(e,o,c)=>l(e,{start:o},{tabWidth:!1,...c}),g=/in JSON at position (\d+)(?: \(line (\d+) column (\d+)\))?$/,b=(e,o)=>{const c=g.exec(o);if(!c)return;const[,i,t,n]=c;if(t&&n)return{column:Number(n),line:Number(t)};let r=Number(i);return r===e.length&&(r=e.length-1),s(e,r)},h=/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,N=e=>e.replace(h,(o,c,i)=>`"${i}"(${m(i)})`);function w(e,o,c,i){let t;try{return JSON.parse(e,o)}catch(u){t=u.message}let n;e?(n=b(e,t),t=N(t)):t+=" while parsing empty string";const r=new a(t);throw r.fileName=c,n&&(r.codeFrame=p(e,n,i)),r}function S(e,o,c){const i=f(e,{buffer:!0,encoding:void 0});let t=new TextDecoder().decode(i);const{beforeParse:n,color:r}={};return typeof n=="function"&&(t=n(t)),w(t,o,d(e),{color:r})}export{w as N,S as a};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as g}from"node:module";import{l as f,m as d,d as j}from"./index-DND6ptxQ.js";import{g as b}from"./en-BxrK-n-J.js";import{a as C}from"./readJsonSync-BnWiH5-R-BpnwAB0Z.js";let _;const h=e=>(_??=g(import.meta.url))(e),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=e=>{if(typeof o<"u"&&o.versions&&o.versions.node){const[r,t]=o.versions.node.split(".").map(Number);if(r>22||r===22&&t>=3||r===20&&t>=16)return o.getBuiltinModule(e)}return h(e)},{rmSync:l,writeFileSync:v}=k("node:fs"),R=1440*60*1e3,w=15e3,A="https://registry.npmjs.org/-/npm/v1/keys",m=()=>d(b(),"registry-keys"),i=()=>d(m(),"npmjs.json"),M=()=>{const e=i();if(f(e))try{const r=C(e),t=Date.now()-r.createdAt>r.ttlMs;return{entry:r,expired:t}}catch{l(e,{force:!0});return}},S=(e,r)=>{j(m());const t={createdAt:Date.now(),keys:e,ttlMs:r};v(i(),JSON.stringify(t),"utf8")},x=async(e={})=>{const r=e.ttlMs??R,t=e.keysUrl??process.env.VIS_NPM_KEYS_URL??A,s=M();if(s!==void 0&&!s.expired&&e.forceRefresh!==!0)return{fromCache:!0,keys:s.entry.keys};const n=new AbortController,p=setTimeout(()=>{n.abort()},w),c=()=>{n.abort()};e.signal?.addEventListener("abort",c,{once:!0});try{const a=await fetch(t,{headers:{Accept:"application/json"},signal:n.signal});if(!a.ok)return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0;const y=await a.json(),u=Array.isArray(y.keys)?y.keys:[];return S(u,r),{fromCache:!1,keys:u}}catch{return s!==void 0?{fromCache:!0,keys:s.entry.keys,stale:!0}:void 0}finally{clearTimeout(p),e.signal?.removeEventListener("abort",c)}},D=()=>{const e=i();return f(e)?(l(e,{force:!0}),!0):!1};export{D as c,x as f};
|