@visulima/vis 1.0.0-alpha.4 → 1.0.0-alpha.41
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 +1243 -78
- package/LICENSE.md +13068 -6
- package/README.md +388 -26
- package/dashboard/dist/index.html +152 -0
- package/dist/bin.js +1 -853
- package/dist/binx.js +3 -0
- package/dist/config/index.d.ts +3276 -0
- package/dist/config/index.js +1 -0
- package/dist/generate/index.d.ts +157 -0
- package/dist/generate/index.js +1 -0
- package/dist/packem_chunks/DEFAULT_CLEAN_KEEP.js +1 -0
- package/dist/packem_chunks/bin.js +1198 -0
- package/dist/packem_chunks/bloom-status.js +2 -0
- package/dist/packem_chunks/bloom-sync.js +2 -0
- package/dist/packem_chunks/cache-attestation.js +1 -0
- package/dist/packem_chunks/catalog-detector.js +1 -0
- package/dist/packem_chunks/config.js +21 -0
- package/dist/packem_chunks/detect.js +3 -0
- package/dist/packem_chunks/detect2.js +8 -0
- package/dist/packem_chunks/devtools.js +81 -0
- package/dist/packem_chunks/discord.js +4 -0
- package/dist/packem_chunks/doctor-probe.js +2 -0
- package/dist/packem_chunks/dynamic-import.js +1 -0
- package/dist/packem_chunks/extra-files.js +3 -0
- package/dist/packem_chunks/fix.js +11 -0
- package/dist/packem_chunks/git.js +3 -0
- package/dist/packem_chunks/handler.js +1 -0
- package/dist/packem_chunks/handler10.js +1 -0
- package/dist/packem_chunks/handler11.js +5 -0
- package/dist/packem_chunks/handler12.js +1 -0
- package/dist/packem_chunks/handler13.js +27 -0
- package/dist/packem_chunks/handler14.js +5 -0
- package/dist/packem_chunks/handler15.js +1 -0
- package/dist/packem_chunks/handler16.js +1 -0
- package/dist/packem_chunks/handler17.js +1 -0
- package/dist/packem_chunks/handler18.js +1 -0
- package/dist/packem_chunks/handler19.js +1 -0
- package/dist/packem_chunks/handler2.js +4 -0
- package/dist/packem_chunks/handler20.js +5 -0
- package/dist/packem_chunks/handler21.js +2 -0
- package/dist/packem_chunks/handler22.js +2 -0
- package/dist/packem_chunks/handler23.js +1 -0
- package/dist/packem_chunks/handler24.js +1 -0
- package/dist/packem_chunks/handler25.js +1 -0
- package/dist/packem_chunks/handler26.js +5 -0
- package/dist/packem_chunks/handler27.js +1 -0
- package/dist/packem_chunks/handler28.js +3 -0
- package/dist/packem_chunks/handler29.js +1 -0
- package/dist/packem_chunks/handler3.js +4 -0
- package/dist/packem_chunks/handler30.js +1 -0
- package/dist/packem_chunks/handler31.js +2 -0
- package/dist/packem_chunks/handler32.js +2 -0
- package/dist/packem_chunks/handler33.js +2 -0
- package/dist/packem_chunks/handler34.js +3 -0
- package/dist/packem_chunks/handler35.js +6 -0
- package/dist/packem_chunks/handler36.js +1 -0
- package/dist/packem_chunks/handler37.js +42 -0
- package/dist/packem_chunks/handler38.js +8 -0
- package/dist/packem_chunks/handler39.js +9 -0
- package/dist/packem_chunks/handler4.js +6 -0
- package/dist/packem_chunks/handler40.js +75 -0
- package/dist/packem_chunks/handler41.js +5 -0
- package/dist/packem_chunks/handler42.js +4 -0
- package/dist/packem_chunks/handler43.js +3 -0
- package/dist/packem_chunks/handler44.js +2 -0
- package/dist/packem_chunks/handler45.js +1 -0
- package/dist/packem_chunks/handler46.js +1 -0
- package/dist/packem_chunks/handler47.js +1 -0
- package/dist/packem_chunks/handler48.js +3 -0
- package/dist/packem_chunks/handler49.js +1 -0
- package/dist/packem_chunks/handler5.js +8 -0
- package/dist/packem_chunks/handler50.js +7 -0
- package/dist/packem_chunks/handler51.js +33 -0
- package/dist/packem_chunks/handler52.js +3 -0
- package/dist/packem_chunks/handler53.js +8 -0
- package/dist/packem_chunks/handler54.js +4 -0
- package/dist/packem_chunks/handler55.js +1 -0
- package/dist/packem_chunks/handler56.js +12 -0
- package/dist/packem_chunks/handler57.js +7 -0
- package/dist/packem_chunks/handler58.js +5 -0
- package/dist/packem_chunks/handler59.js +11 -0
- package/dist/packem_chunks/handler6.js +1 -0
- package/dist/packem_chunks/handler60.js +3 -0
- package/dist/packem_chunks/handler61.js +22 -0
- package/dist/packem_chunks/handler62.js +61 -0
- package/dist/packem_chunks/handler63.js +3 -0
- package/dist/packem_chunks/handler64.js +6 -0
- package/dist/packem_chunks/handler65.js +708 -0
- package/dist/packem_chunks/handler66.js +24 -0
- package/dist/packem_chunks/handler67.js +25 -0
- package/dist/packem_chunks/handler68.js +153 -0
- package/dist/packem_chunks/handler69.js +10 -0
- package/dist/packem_chunks/handler7.js +1 -0
- package/dist/packem_chunks/handler70.js +24 -0
- package/dist/packem_chunks/handler71.js +322 -0
- package/dist/packem_chunks/handler72.js +48 -0
- package/dist/packem_chunks/handler73.js +27 -0
- package/dist/packem_chunks/handler74.js +3 -0
- package/dist/packem_chunks/handler75.js +190 -0
- package/dist/packem_chunks/handler76.js +38 -0
- package/dist/packem_chunks/handler8.js +1 -0
- package/dist/packem_chunks/handler9.js +1 -0
- package/dist/packem_chunks/heal-accept.js +10 -0
- package/dist/packem_chunks/heal.js +14 -0
- package/dist/packem_chunks/help-command.js +31 -0
- package/dist/packem_chunks/index.js +1 -0
- package/dist/packem_chunks/index2.js +7 -0
- package/dist/packem_chunks/interface.js +2 -0
- package/dist/packem_chunks/keys-refresh.js +4 -0
- package/dist/packem_chunks/list.js +3 -0
- package/dist/packem_chunks/loader.js +4 -0
- package/dist/packem_chunks/loader2.js +1 -0
- package/dist/packem_chunks/orchestrator.js +39 -0
- package/dist/packem_chunks/pre-mode.js +2 -0
- package/dist/packem_chunks/print-config.js +2 -0
- package/dist/packem_chunks/prompts.js +7 -0
- package/dist/packem_chunks/prune.js +3 -0
- package/dist/packem_chunks/publish-guards.js +1 -0
- package/dist/packem_chunks/registry.js +48 -0
- package/dist/packem_chunks/resolveFormatter.js +9 -0
- package/dist/packem_chunks/run.js +1 -0
- package/dist/packem_chunks/security.js +1 -0
- package/dist/packem_chunks/shell-runner.js +1 -0
- package/dist/packem_chunks/slack.js +2 -0
- package/dist/packem_chunks/snapshot.js +2 -0
- package/dist/packem_chunks/stage-publisher.js +1 -0
- package/dist/packem_chunks/staged-registry.js +2 -0
- package/dist/packem_chunks/state.js +3 -0
- package/dist/packem_chunks/status.js +2 -0
- package/dist/packem_chunks/success-walk.js +8 -0
- package/dist/packem_chunks/sync.js +2 -0
- package/dist/packem_chunks/sync2.js +2 -0
- package/dist/packem_chunks/tar.js +3 -0
- package/dist/packem_chunks/tripwire.js +2 -0
- package/dist/packem_chunks/verify-lockfile.js +2 -0
- package/dist/packem_chunks/version-resolver.js +2 -0
- package/dist/packem_chunks/webhook.js +1 -0
- package/dist/packem_chunks/workflow-templates.js +167 -0
- package/dist/packem_chunks/workspace.js +2 -0
- package/dist/packem_shared/AfterAllProjectsVersioned-CAKI2nWf.js +1 -0
- package/dist/packem_shared/CONFIG_FILES-BfaR0jKT.js +1 -0
- package/dist/packem_shared/MultiSpinner-B9U0-aE3-B-gIXhFk.js +3 -0
- package/dist/packem_shared/ReleaseClient-YHzBIxYS.js +1 -0
- package/dist/packem_shared/Table-CcVkyULl-B_ef6zfS.js +35 -0
- package/dist/packem_shared/VisReleaseError-DMGRBTNO.js +1 -0
- package/dist/packem_shared/_commonjsHelpers-B5Y90VFO.js +1 -0
- package/dist/packem_shared/advisories-DLeO5KMN.js +1 -0
- package/dist/packem_shared/affected-shas-cVnX8-zs.js +1 -0
- package/dist/packem_shared/ai-analysis-BUeX2J2H.js +68 -0
- package/dist/packem_shared/ai-fix-9Vzlp6XU.js +43 -0
- package/dist/packem_shared/anolilab-text-CAM_E6uK.js +13 -0
- package/dist/packem_shared/api.d-BPftyU9r.d.ts +27 -0
- package/dist/packem_shared/build-scripts-CCCi8U66.js +1 -0
- package/dist/packem_shared/command-runtime-CR70qSUM.js +1 -0
- package/dist/packem_shared/createAdapter-bU4DIP3F.js +1 -0
- package/dist/packem_shared/createVersionActions-BK43SNDH.js +1 -0
- package/dist/packem_shared/cyclonedx-Cadls41z.js +4 -0
- package/dist/packem_shared/defineFormatter-D5dCp6Kv.js +1 -0
- package/dist/packem_shared/definePlugin-DoUcoYSy.js +1 -0
- package/dist/packem_shared/dependency-scan-DnTgYleU.js +1 -0
- package/dist/packem_shared/docker-BMLrNtWm.js +59 -0
- package/dist/packem_shared/failure-log-CEWP3bP0.js +2 -0
- package/dist/packem_shared/giget-DHY1sQZC.js +2 -0
- package/dist/packem_shared/glob-fqg4KepW-B7EjLRvw.js +1 -0
- package/dist/packem_shared/index-3jMNqQom.js +1 -0
- package/dist/packem_shared/index-BDmTbWX1.js +19 -0
- package/dist/packem_shared/index-Bt521H5J.js +30 -0
- package/dist/packem_shared/index-DGSsjmpV.js +1 -0
- package/dist/packem_shared/interface.d-B7VK2rcH.d.ts +148 -0
- package/dist/packem_shared/interface.d-Cezzifoh.d.ts +106 -0
- package/dist/packem_shared/license-t5KnNX6v.js +1 -0
- package/dist/packem_shared/lifecycle-4z9hHE5b.js +2 -0
- package/dist/packem_shared/lockfile-C8Q1_4KK.js +1 -0
- package/dist/packem_shared/manifests-Dj3pRKBT.js +1 -0
- package/dist/packem_shared/min-release-age-D1alDE3K.js +34 -0
- package/dist/packem_shared/missing-package-json-8vNHwbqw.js +1 -0
- package/dist/packem_shared/native-config-sync-BEkJW7g3.js +21 -0
- package/dist/packem_shared/osv-bloom-B03tUWf3.js +2 -0
- package/dist/packem_shared/otelPlugin-DmKDBaPo.js +1 -0
- package/dist/packem_shared/peer-warnings-BXAzXqY3.js +1 -0
- package/dist/packem_shared/pm-runner-BKZQo7Ts.js +1 -0
- package/dist/packem_shared/provenance-BFEwKgI3.js +1 -0
- package/dist/packem_shared/public-api-WqUCiyIe.js +131 -0
- package/dist/packem_shared/registry-keys-BfFto6vI.js +1 -0
- package/dist/packem_shared/resolve-explicit-C6WM-I2u.js +5 -0
- package/dist/packem_shared/runtime-check-Stc9AI78.js +1 -0
- package/dist/packem_shared/s1ngularity-DCPmPE5M.js +1 -0
- package/dist/packem_shared/scan-progress-CFhc0CMj.js +2 -0
- package/dist/packem_shared/selectors-GCJIe342.js +3 -0
- package/dist/packem_shared/signatures-Xpd6HjG_.js +2 -0
- package/dist/packem_shared/slug-DoueYuLo.js +1 -0
- package/dist/packem_shared/spinner-CV3WVJLv.js +1 -0
- package/dist/packem_shared/sticky-comment-D6_7-w8T.js +1 -0
- package/dist/packem_shared/subtree-C7bZuiSQ.js +2 -0
- package/dist/packem_shared/symbols-DPTlrJ3B.js +1 -0
- package/dist/packem_shared/tabs-BuTy5gPV.js +1 -0
- package/dist/packem_shared/toolchain-pR7AJ-tB.js +5 -0
- package/dist/packem_shared/typosquats-DN78xx1x.js +1 -0
- package/dist/packem_shared/use-measured-height-_eVGWtWt.js +1 -0
- package/dist/packem_shared/utils-Cxree603.js +1 -0
- package/dist/packem_shared/verify-6WCmFmy8.js +1 -0
- package/dist/packem_shared/vis-update-app-k3fDxech.js +1 -0
- package/dist/packem_shared/watch-BvIwLG4N.js +1 -0
- package/dist/packem_shared/watch-loop-DWkvv2tK.js +11 -0
- package/dist/release/core/changelog/index.d.ts +5 -0
- package/dist/release/core/changelog/index.js +1 -0
- package/dist/release/core/package-managers/index.d.ts +6 -0
- package/dist/release/core/package-managers/index.js +1 -0
- package/dist/release/core/version-actions/index.d.ts +14 -0
- package/dist/release/core/version-actions/index.js +1 -0
- package/dist/release/index.d.ts +196 -0
- package/dist/release/index.js +1 -0
- package/dist/release/plugin-sdk.d.ts +127 -0
- package/dist/release/plugin-sdk.js +1 -0
- package/dist/release/presets.d.ts +225 -0
- package/dist/release/presets.js +1 -0
- package/dist/release/types.d.ts +1377 -0
- package/dist/release/types.js +1 -0
- package/index.d.ts +436 -0
- package/index.js +80 -57
- package/package.json +109 -45
- package/schemas/project.schema.json +991 -0
- package/schemas/vis-config.schema.json +6389 -0
- package/schemas/vis-release-config.schema.json +1390 -0
- package/skills/vis/SKILL.md +96 -0
- package/templates/buildkite-ci/.buildkite/pipeline.yml.tera +85 -0
- package/templates/buildkite-ci/template.yml +20 -0
- package/dist/ai-analysis.d.ts +0 -40
- package/dist/ai-cache.d.ts +0 -21
- package/dist/audit-config.d.ts +0 -24
- package/dist/bin.d.ts +0 -1
- package/dist/catalog.d.ts +0 -118
- package/dist/commands/add.d.ts +0 -3
- package/dist/commands/affected.d.ts +0 -3
- package/dist/commands/ai.d.ts +0 -3
- package/dist/commands/analyze.d.ts +0 -3
- package/dist/commands/approve-builds.d.ts +0 -3
- package/dist/commands/audit.d.ts +0 -23
- package/dist/commands/check.d.ts +0 -3
- package/dist/commands/clean.d.ts +0 -3
- package/dist/commands/create/discovery.d.ts +0 -42
- package/dist/commands/create/index.d.ts +0 -13
- package/dist/commands/create/prompts.d.ts +0 -31
- package/dist/commands/create/random-name.d.ts +0 -15
- package/dist/commands/create/templates/builtin.d.ts +0 -15
- package/dist/commands/create/templates/generator.d.ts +0 -14
- package/dist/commands/create/templates/index.d.ts +0 -13
- package/dist/commands/create/templates/monorepo.d.ts +0 -16
- package/dist/commands/create/templates/remote.d.ts +0 -41
- package/dist/commands/create/templates/types.d.ts +0 -46
- package/dist/commands/create/utils.d.ts +0 -42
- package/dist/commands/dedupe.d.ts +0 -3
- package/dist/commands/devcontainer.d.ts +0 -3
- package/dist/commands/dlx.d.ts +0 -3
- package/dist/commands/doctor.d.ts +0 -15
- package/dist/commands/exec.d.ts +0 -3
- package/dist/commands/graph.d.ts +0 -3
- package/dist/commands/hook/constants.d.ts +0 -8
- package/dist/commands/hook/index.d.ts +0 -3
- package/dist/commands/hook/install.d.ts +0 -7
- package/dist/commands/hook/migrate.d.ts +0 -27
- package/dist/commands/hook/uninstall.d.ts +0 -3
- package/dist/commands/implode.d.ts +0 -3
- package/dist/commands/init.d.ts +0 -14
- package/dist/commands/install.d.ts +0 -3
- package/dist/commands/link.d.ts +0 -3
- package/dist/commands/migrate/constants.d.ts +0 -12
- package/dist/commands/migrate/deps.d.ts +0 -32
- package/dist/commands/migrate/index.d.ts +0 -3
- package/dist/commands/migrate/json.d.ts +0 -20
- package/dist/commands/migrate/lint-staged.d.ts +0 -62
- package/dist/commands/migrate/types.d.ts +0 -20
- package/dist/commands/optimize.d.ts +0 -38
- package/dist/commands/pm.d.ts +0 -3
- package/dist/commands/remove.d.ts +0 -3
- package/dist/commands/run.d.ts +0 -3
- package/dist/commands/sort-package-json.d.ts +0 -3
- package/dist/commands/staged.d.ts +0 -3
- package/dist/commands/unlink.d.ts +0 -3
- package/dist/commands/update.d.ts +0 -3
- package/dist/commands/upgrade.d.ts +0 -3
- package/dist/commands/why.d.ts +0 -3
- package/dist/config.d.ts +0 -67
- package/dist/config.js +0 -1
- package/dist/native-binding.d.ts +0 -151
- package/dist/output.d.ts +0 -40
- package/dist/overrides.d.ts +0 -82
- package/dist/package-manager.d.ts +0 -23
- package/dist/plugins/config-loader.d.ts +0 -3
- package/dist/plugins/post-command.d.ts +0 -3
- package/dist/plugins/security-enforcement.d.ts +0 -3
- package/dist/pm-runner.d.ts +0 -23
- package/dist/security.d.ts +0 -64
- package/dist/socket-security.d.ts +0 -129
- package/dist/tips.d.ts +0 -41
- package/dist/tui/components/CheckProgressApp.d.ts +0 -6
- package/dist/tui/components/CommandSummary.d.ts +0 -17
- package/dist/tui/components/Header.d.ts +0 -13
- package/dist/tui/components/OutputPanel.d.ts +0 -16
- package/dist/tui/components/QuitDialog.d.ts +0 -15
- package/dist/tui/components/TaskListPanel.d.ts +0 -19
- package/dist/tui/components/TaskRow.d.ts +0 -12
- package/dist/tui/components/TaskStore.d.ts +0 -80
- package/dist/tui/components/VisTaskRunnerApp.d.ts +0 -17
- package/dist/tui/components/devcontainer/DevcontainerStore.d.ts +0 -66
- package/dist/tui/components/devcontainer/VisDevcontainerApp.d.ts +0 -9
- package/dist/tui/components/devcontainer/catalogs/extensions.d.ts +0 -8
- package/dist/tui/components/devcontainer/catalogs/features.d.ts +0 -8
- package/dist/tui/components/devcontainer/catalogs/filters.d.ts +0 -4
- package/dist/tui/components/devcontainer/catalogs/mount-suggestions.d.ts +0 -19
- package/dist/tui/components/devcontainer/catalogs/templates.d.ts +0 -8
- package/dist/tui/components/devcontainer/devcontainer-io.d.ts +0 -14
- package/dist/tui/components/devcontainer/sections/DockerComposeSection.d.ts +0 -11
- package/dist/tui/components/devcontainer/sections/EnvironmentSection.d.ts +0 -16
- package/dist/tui/components/devcontainer/sections/ExtensionsSection.d.ts +0 -11
- package/dist/tui/components/devcontainer/sections/FeaturesSection.d.ts +0 -11
- package/dist/tui/components/devcontainer/sections/GeneralSection.d.ts +0 -12
- package/dist/tui/components/devcontainer/sections/LifecycleSection.d.ts +0 -13
- package/dist/tui/components/devcontainer/sections/MountsSection.d.ts +0 -16
- package/dist/tui/components/devcontainer/sections/PortsSection.d.ts +0 -10
- package/dist/tui/components/devcontainer/sections/PreviewPanel.d.ts +0 -11
- package/dist/tui/components/devcontainer/types.d.ts +0 -53
- package/dist/tui/components/devcontainer/validate.d.ts +0 -16
- package/dist/tui/components/graph/GraphStore.d.ts +0 -42
- package/dist/tui/components/graph/ProjectDetailPanel.d.ts +0 -10
- package/dist/tui/components/graph/ProjectListPanel.d.ts +0 -20
- package/dist/tui/components/graph/VisGraphApp.d.ts +0 -8
- package/dist/tui/components/optimize/OptimizeDetailPanel.d.ts +0 -9
- package/dist/tui/components/optimize/OptimizeListPanel.d.ts +0 -16
- package/dist/tui/components/optimize/OptimizeStore.d.ts +0 -50
- package/dist/tui/components/optimize/VisOptimizeApp.d.ts +0 -8
- package/dist/tui/components/optimize/constants.d.ts +0 -7
- package/dist/tui/components/update/PackageDetailPanel.d.ts +0 -12
- package/dist/tui/components/update/PackageListPanel.d.ts +0 -18
- package/dist/tui/components/update/UpdateStore.d.ts +0 -62
- package/dist/tui/components/update/VisUpdateApp.d.ts +0 -11
- package/dist/tui/dynamic-life-cycle.d.ts +0 -21
- package/dist/tui/formatting-utils.d.ts +0 -17
- package/dist/tui/pretty-time.d.ts +0 -8
- package/dist/tui/static-life-cycle.d.ts +0 -22
- package/dist/tui/status-utils.d.ts +0 -20
- package/dist/tui/symbols.d.ts +0 -7
- package/dist/tui/types.d.ts +0 -11
- package/dist/typosquats.d.ts +0 -70
- package/dist/upgrade-check.d.ts +0 -30
- package/dist/utils.d.ts +0 -22
- package/dist/workspace.d.ts +0 -315
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{s as c,E as n,I as f}from"../packem_shared/Table-CcVkyULl-B_ef6zfS.js";import{p as i}from"./bin.js";import{g as l}from"../packem_shared/osv-bloom-B03tUWf3.js";const a=t=>{if(!t)return"never";const r=Date.parse(t);if(Number.isNaN(r))return t;const e=Date.now()-r;if(e<0)return t;const o=Math.floor(e/6e4);if(o<1)return"just now";if(o<60)return`${o}m ago`;const s=Math.floor(o/60);return s<24?`${s}h ago`:`${Math.floor(s/24)}d ago`},m=t=>t<1024?`${t} B`:t<1024*1024?`${(t/1024).toFixed(1)} KB`:`${(t/(1024*1024)).toFixed(1)} MB`,u=async({options:t,workspaceRoot:r})=>{if(!r)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const e=await l(r,t.cacheDir);if(t.format==="json"){process.stdout.write(`${JSON.stringify(e,void 0,2)}
|
|
2
|
+
`);return}if(i.info(`Cache: ${e.cacheDir}`),!e.present){i.warn(`No osv-bloom filter yet. Run ${c("vis advisories bloom sync")} to populate.`);return}if(e.manifest){const{manifest:o}=e;i.info(`Built: ${o.builtAtRfc3339} (${a(o.builtAtRfc3339)})`),i.info(`Fetch: ${e.fetchedAtIso??n("—")} (${a(e.fetchedAtIso)})`),i.info(`Filter: ${f(m(o.bloomByteLen))} m=${o.bloomMBits.toLocaleString()} bits k=${String(o.bloomKHashes)}`),i.info(`Set: ${o.entryCount.toLocaleString()} entries from ${o.advisoryCount.toLocaleString()} advisories (target FPR ${o.targetFpr})`),i.info(n(`Digest: ${o.setDigestSha256}`))}else i.warn("filter.bin present but manifest.json missing — `vis advisories bloom sync` will rewrite the cache.")},h=u;export{h as advisoriesBloomStatusExecute};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{E as m}from"../packem_shared/Table-CcVkyULl-B_ef6zfS.js";import{p as i}from"./bin.js";import{s as p}from"../packem_shared/scan-progress-CFhc0CMj.js";import{s as d,D}from"../packem_shared/osv-bloom-B03tUWf3.js";const b=o=>o?.security?.audit?.advisories?.bloom??{},u=o=>o>=1e3?`${(o/1e3).toFixed(1)}s`:`${Math.round(o)}ms`,y=o=>o<1024?`${o} B`:o<1024*1024?`${(o/1024).toFixed(1)} KB`:`${(o/(1024*1024)).toFixed(1)} MB`,h=async({options:o,visConfig:f,workspaceRoot:a})=>{if(!a)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const n=o.format==="json",c=b(f),l=o.source??c.source??D,s=p([{id:"bloom",label:"Sync osv-bloom prefilter"}],{live:!n});let e,t;try{s.start("bloom");const r=Date.now();e=await d({allowedHosts:c.allowedHosts,cacheDir:o.cacheDir,force:!!o.force,source:l,workspaceRoot:a}),e.upToDate?s.finish("bloom","ok",`up to date · ${u(Date.now()-r)}`):s.finish("bloom","ok",`${e.manifest.entryCount.toLocaleString()} entries · ${y(e.bytesOnDisk)} · ${u(e.durationMs)}`)}catch(r){t=r instanceof Error?r.message:String(r),s.finish("bloom","error",t)}finally{s.stop()}n?process.stdout.write(`${JSON.stringify({bytesOnDisk:e?.bytesOnDisk??0,cacheDir:e?.cacheDir??null,durationMs:e?.durationMs??0,error:t??null,manifest:e?.manifest??null,source:l,upToDate:e?.upToDate??!1},void 0,2)}
|
|
2
|
+
`):e&&(i.info(m(`Cache: ${e.cacheDir}`)),i.info(m(`Built: ${e.manifest.builtAtRfc3339}`)),t||i.success(e.upToDate?"osv-bloom prefilter up to date.":"osv-bloom prefilter synced.")),t&&(process.exitCode=1)},O=h;export{O as advisoriesBloomSyncExecute};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as _}from"node:module";import{loadOptionalSigstore as g}from"./loader.js";const R=_(import.meta.url),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,m=e=>{if(typeof c<"u"&&c.versions&&c.versions.node){const[t,s]=c.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return c.getBuiltinModule(e)}return R(e)},{createHash:w}=m("node:crypto"),{createReadStream:I}=m("node:fs"),v="https://token.actions.githubusercontent.com",h=e=>e.replaceAll(/[$()*+.?[\\\]^{|}]/g,String.raw`\$&`),S=e=>{if("github"in e){const{ref:t,repo:s,workflow:r}=e.github;return{issuer:v,sanPattern:`^${h(`https://github.com/${s}/${r}@${t}`)}$`}}return"sanRegex"in e?{issuer:e.oidcIssuer,sanPattern:e.sanRegex}:{issuer:e.oidcIssuer,sanPattern:`^${h(e.san)}$`}},$=()=>process.env.CI==="true"||typeof process.env.ACTIONS_ID_TOKEN_REQUEST_URL=="string"||typeof process.env.SIGSTORE_ID_TOKEN=="string",y=e=>new Promise((t,s)=>{const r=w("sha256"),i=I(e);i.on("error",s),i.on("data",n=>r.update(n)),i.on("end",()=>{t(Buffer.from(r.digest("hex")))})}),x=1024,P=e=>{const{issuer:t,sanPattern:s}=S(e.expectedIdentity),r=new Map,i=(n,o)=>{let u;try{u=JSON.parse(o)}catch{return Promise.resolve(!1)}return(async()=>{let a;try{a=await y(n)}catch{return!1}const p=`${a.toString("utf8")}:${w("sha256").update(o).digest("hex")}`,d=r.get(p);if(d)return d;const l=(async()=>{try{return await(await g({workspaceRoot:e.workspaceRoot})).verify(u,a,{certificateIdentityURI:s,certificateIssuer:t}),!0}catch(f){return e.onVerifyFailure?.(f instanceof Error?f.message:String(f)),!1}})();return r.size>=x&&r.clear(),r.set(p,l),l})()};return{expectedIdentity:e.expectedIdentity,onReject:e.onReject,requireOnDownload:e.requireOnDownload??!1,signArtifact:async({archivePath:n})=>{if(!$())return null;const o=await g({workspaceRoot:e.workspaceRoot}),u=await y(n),a=await o.sign(u);return JSON.stringify(a)},verifyArtifact:({archivePath:n,attestation:o})=>i(n,o)}};export{P as buildCacheAttestationHooks,S as normalizeExpectedIdentity};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{p as d}from"./registry.js";const u=a=>{const n=d(a),t=new Map;Object.keys(n.default).length>0&&t.set("",{...n.default});for(const[s,e]of Object.entries(n.named))t.set(s,{...e});return t},g=["dependencies","devDependencies","peerDependencies","optionalDependencies"],l=a=>{const n=[];for(const t of g){const s=a.manifest[t];if(!(!s||typeof s!="object"))for(const[e,o]of Object.entries(s)){if(typeof o!="string"||!o.startsWith("catalog:"))continue;const c=o.slice(8);n.push({catalog:c,dep:e,kind:t,packageName:a.name})}}return n},m=(a,n)=>{const t=new Map;for(const s of n.keys())t.set(s,new Map);for(const s of a)for(const e of l(s)){if(!n.has(e.catalog))continue;let o=t.get(e.catalog);o||(o=new Map,t.set(e.catalog,o));const c=o.get(e.dep);c?c.push({kind:e.kind,packageName:e.packageName}):o.set(e.dep,[{kind:e.kind,packageName:e.packageName}])}return t},h=(a,n)=>{if(a.size===0&&n.size===0)return[];const t=[],s=new Set;for(const[e,o]of n){s.add(e);const c=a.get(e)??{},r=[...new Set([...Object.keys(c),...Object.keys(o)])].sort();for(const i of r){const f=c[i],p=o[i];f!==p&&t.push({catalog:e,dep:i,newVersion:p,oldVersion:f})}}for(const[e,o]of a){if(s.has(e))continue;const c=Object.keys(o).sort();for(const r of c)t.push({catalog:e,dep:r,newVersion:void 0,oldVersion:o[r]})}return t};export{h as detectCatalogChanges,l as extractCatalogRefs,m as findCatalogConsumers,u as parseCatalogs};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{createRequire as Ho}from"node:module";import{d as Do,U as Go,v as jo,L as Po,m as ee,A as uo,f as ye,a as lt,H as ct,O as io}from"../packem_shared/index-BDmTbWX1.js";import{createJiti as ao}from"jiti";import"../packem_shared/otelPlugin-DmKDBaPo.js";import"../packem_shared/definePlugin-DoUcoYSy.js";const Lo=Ho(import.meta.url),Ae=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,wt=e=>{if(typeof Ae<"u"&&Ae.versions&&Ae.versions.node){const[t,o]=Ae.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ae.getBuiltinModule(e)}return Lo(e)},{createHash:so}=wt("node:crypto"),{readdirSync:ro,copyFileSync:Bo,unlinkSync:Mo,readFileSync:Io}=wt("node:fs"),{createRequire:no}=wt("node:module");class Uo extends Error{fileName;codeFrame;name="JSONError";#e;constructor(t){super(),this.#e=t}get message(){return`${this.#e}${this.fileName?` in ${this.fileName}`:""}${this.codeFrame?`
|
|
2
|
+
|
|
3
|
+
${this.codeFrame}
|
|
4
|
+
`:""}`}set message(t){this.#e=t}}const Fo=e=>String.raw`\u{${e.codePointAt(0).toString(16)}}`,Ko=(e,t,o)=>Go(e,{start:t},{tabWidth:!1,...o}),zo=/in JSON at position (\d+)(?: \(line (\d+) column (\d+)\))?$/,Xo=(e,t)=>{const o=zo.exec(t);if(!o)return;const[,r,u,s]=o;if(u&&s)return{column:Number(s),line:Number(u)};let n=Number(r);return n===e.length&&(n=e.length-1),Do(e,n)},Wo=/(?<=^Unexpected token )(?<quote>')?(.)\k<quote>/,qo=e=>e.replace(Wo,(t,o,r)=>`"${r}"(${Fo(r)})`);function Qo(e,t,o,r){let u;try{return JSON.parse(e,t)}catch(c){u=c.message}let s;e?(s=Xo(e,u),u=qo(u)):u+=" while parsing empty string";const n=new Uo(u);throw n.fileName=o,s&&(n.codeFrame=Ko(e,s,r)),n}function lo(e,t,o){const r=jo(e,{buffer:!0,encoding:void 0});let u=new TextDecoder().decode(r);const{beforeParse:s,color:n}={};return typeof s=="function"&&(u=s(u)),Qo(u,t,Po(e),{color:n})}const Mt="@inherit",Zo=["aliases","dependsOn","inputs","outputs"],Vo=(e,t)=>{if(t===void 0)return e===void 0?void 0:[...e];if(!t.includes(Mt))return[...t];const o=[];for(const r of t){if(r===Mt){e!==void 0&&o.push(...e);continue}o.push(r)}return o},Yo=(e,t)=>{const o={...e,...t};for(const r of Zo){const u=e?.[r],s=t?.[r],n=Vo(u,s);n===void 0?delete o[r]:o[r]=n}return o},Jo=no(import.meta.url),me=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,co=e=>{if(typeof me<"u"&&me.versions&&me.versions.node){const[t,o]=me.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return me.getBuiltinModule(e)}return Jo(e)},{homedir:es,tmpdir:gt}=co("node:os"),{env:rt,cwd:ts,platform:It}=me,{createRequire:w}=co("node:module"),os=0,po=2,ss=Symbol("findUpStop"),rs=/^[A-Z]:\//i,ve=(e="")=>e&&e.replaceAll("\\","/").replace(rs,t=>t.toUpperCase()),ns=/^[/\\]{2}/,us=/^[/\\](?![/\\])|^[/\\]{2}(?!\.)|^[A-Z]:[/\\]/i,fo=/^[A-Z]:$/i,is=/.(\.[^./]+)$/,as=/^[/\\]|^[a-z]:[/\\]/i,ls=/\/$/,cs=()=>typeof process.cwd=="function"?process.cwd().replaceAll("\\","/"):"/",dt="/",ho=(e,t)=>{let o="",r=0,u=-1,s=0,n;for(let c=0;c<=e.length;++c){if(c<e.length)n=e[c];else{if(n==="/")break;n="/"}if(n==="/"){if(!(u===c-1||s===1))if(s===2){if(o.length<2||r!==2||!o.endsWith(".")||o.at(-2)!=="."){if(o.length>2){const f=o.lastIndexOf("/");f===-1?(o="",r=0):(o=o.slice(0,f),r=o.length-1-o.lastIndexOf("/")),u=c,s=0;continue}else if(o.length>0){o="",r=0,u=c,s=0;continue}}t&&(o+=o.length>0?"/..":"..",r=2)}else o.length>0?o+=`/${e.slice(u+1,c)}`:o=e.slice(u+1,c),r=c-u-1;u=c,s=0}else n==="."&&s!==-1?++s:s=-1}return o},be=e=>us.test(e),go=function(e){if(e.length===0)return".";e=ve(e);const t=ns.exec(e),o=be(e),r=e.at(-1)==="/";return e=ho(e,!o),e.length===0?o?"/":r?"./":".":(r&&(e+="/"),fo.test(e)&&(e+="/"),t?o?`//${e}`:`//./${e}`:o&&!be(e)?`/${e}`:e)},se=(...e)=>{let t="";for(const o of e)if(o)if(t.length>0){const r=t.at(-1)==="/",u=o[0]==="/";r&&u?t+=o.slice(1):t+=r||u?o:`/${o}`}else t+=o;return go(t)},bt=function(...e){e=e.map(r=>ve(r));let t="",o=!1;for(let r=e.length-1;r>=-1&&!o;r--){const u=r>=0?e[r]:cs();!u||u.length===0||(t=`${u}/${t}`,o=be(u))}return t=ho(t,!o),o&&!be(t)?`/${t}`:t.length>0?t:"."},ps=function(e){return is.exec(ve(e))?.[1]??""},Ot=e=>{const t=ve(e).replace(ls,""),o=t.lastIndexOf("/");if(o===-1)return be(e)?"/":".";const r=t.slice(0,o);return fo.test(r)?`${r}/`:r||(be(e)?"/":".")},fs=(e,t)=>{const o=ve(e);return o.slice(o.lastIndexOf("/")+1)},hs=function(e){const t=as.exec(e)?.[0]?.replaceAll("\\","/")??"",o=fs(e),r=ps(o);return{base:o,dir:Ot(e),ext:r,name:o.slice(0,o.length-r.length),root:t}},gs=w(import.meta.url),Re=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,ds=e=>{if(typeof Re<"u"&&Re.versions&&Re.versions.node){const[t,o]=Re.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Re.getBuiltinModule(e)}return gs(e)},{fileURLToPath:bs}=ds("node:url");function ms(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Dt,Gt;function ys(){return Gt||(Gt=1,Dt=["3dm","3ds","3g2","3gp","7z","a","aac","adp","afdesign","afphoto","afpub","ai","aif","aiff","alz","ape","apk","appimage","ar","arj","asf","au","avi","bak","baml","bh","bin","bk","bmp","btif","bz2","bzip2","cab","caf","cgm","class","cmx","cpio","cr2","cr3","cur","dat","dcm","deb","dex","djvu","dll","dmg","dng","doc","docm","docx","dot","dotm","dra","DS_Store","dsk","dts","dtshd","dvb","dwg","dxf","ecelp4800","ecelp7470","ecelp9600","egg","eol","eot","epub","exe","f4v","fbs","fh","fla","flac","flatpak","fli","flv","fpx","fst","fvt","g3","gh","gif","graffle","gz","gzip","h261","h263","h264","icns","ico","ief","img","ipa","iso","jar","jpeg","jpg","jpgv","jpm","jxr","key","ktx","lha","lib","lvp","lz","lzh","lzma","lzo","m3u","m4a","m4v","mar","mdi","mht","mid","midi","mj2","mka","mkv","mmr","mng","mobi","mov","movie","mp3","mp4","mp4a","mpeg","mpg","mpga","mxu","nef","npx","numbers","nupkg","o","odp","ods","odt","oga","ogg","ogv","otf","ott","pages","pbm","pcx","pdb","pdf","pea","pgm","pic","png","pnm","pot","potm","potx","ppa","ppam","ppm","pps","ppsm","ppsx","ppt","pptm","pptx","psd","pya","pyc","pyo","pyv","qt","rar","ras","raw","resources","rgb","rip","rlc","rmf","rmvb","rpm","rtf","rz","s3m","s7z","scpt","sgi","shar","snap","sil","sketch","slk","smv","snk","so","stl","suo","sub","swf","tar","tbz","tbz2","tga","tgz","thmx","tif","tiff","tlz","ttc","ttf","txz","udf","uvh","uvi","uvm","uvp","uvs","uvu","viv","vob","war","wav","wax","wbmp","wdp","weba","webm","webp","whl","wim","wm","wma","wmv","wmx","woff","woff2","wrm","wvx","xbm","xif","xla","xlam","xls","xlsb","xlsm","xlsx","xlt","xltm","xltx","xm","xmind","xpi","xpm","xwd","xz","z","zip","zipx"]),Dt}var vs=ys();const As=ms(vs);new Set(As);const at=e=>ve(e instanceof URL?bs(e):e),bo=e=>{if(!e||!(e instanceof URL)&&typeof e!="string")throw new TypeError("Path must be a non-empty string or URL.")},Rs=w(import.meta.url),Ee=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Es=e=>{if(typeof Ee<"u"&&Ee.versions&&Ee.versions.node){const[t,o]=Ee.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ee.getBuiltinModule(e)}return Rs(e)};Es("node:fs/promises");const Ts=w(import.meta.url),Te=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,xs=e=>{if(typeof Te<"u"&&Te.versions&&Te.versions.node){const[t,o]=Te.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Te.getBuiltinModule(e)}return Ts(e)};xs("node:fs");const jt=e=>{if(e.isFile())return"file";if(e.isDirectory())return"dir";if(e.isSymbolicLink())return"symlink"},_s=w(import.meta.url),xe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$s=e=>{if(typeof xe<"u"&&xe.versions&&xe.versions.node){const[t,o]=xe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return xe.getBuiltinModule(e)}return _s(e)};$s("node:fs/promises");const ks=w(import.meta.url),_e=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Cs=e=>{if(typeof _e<"u"&&_e.versions&&_e.versions.node){const[t,o]=_e.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return _e.getBuiltinModule(e)}return ks(e)},{lstatSync:Pt,mkdirSync:Ss}=Cs("node:fs"),$e=e=>{bo(e);try{const t=Pt(e);if(!t.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(jt(t))}'`);return}catch(t){if(t.code!=="ENOENT")throw t}try{Ss(e,{recursive:!0})}catch(t){if(t.code!=="EEXIST")throw t;const o=Pt(e);if(!o.isDirectory())throw new Error(`Ensure path exists, expected 'dir', got '${String(jt(o))}'`,{cause:t})}},ws=w(import.meta.url),ke=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Os=e=>{if(typeof ke<"u"&&ke.versions&&ke.versions.node){const[t,o]=ke.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return ke.getBuiltinModule(e)}return ws(e)};Os("node:fs/promises");const Ns=w(import.meta.url),Ce=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Hs=e=>{if(typeof Ce<"u"&&Ce.versions&&Ce.versions.node){const[t,o]=Ce.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ce.getBuiltinModule(e)}return Ns(e)};Hs("node:fs");const Ls=w(import.meta.url),Se=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Bs=e=>{if(typeof Se<"u"&&Se.versions&&Se.versions.node){const[t,o]=Se.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Se.getBuiltinModule(e)}return Ls(e)};Bs("node:fs/promises");const Ms=w(import.meta.url),we=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Is=e=>{if(typeof we<"u"&&we.versions&&we.versions.node){const[t,o]=we.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return we.getBuiltinModule(e)}return Ms(e)};Is("node:fs");const Ds=w(import.meta.url),Oe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Gs=e=>{if(typeof Oe<"u"&&Oe.versions&&Oe.versions.node){const[t,o]=Oe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Oe.getBuiltinModule(e)}return Ds(e)};Gs("node:fs/promises");const js=w(import.meta.url),Ne=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ps=e=>{if(typeof Ne<"u"&&Ne.versions&&Ne.versions.node){const[t,o]=Ne.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ne.getBuiltinModule(e)}return js(e)};Ps("node:fs");w(import.meta.url);const Us=w(import.meta.url),He=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Fs=e=>{if(typeof He<"u"&&He.versions&&He.versions.node){const[t,o]=He.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return He.getBuiltinModule(e)}return Us(e)};Fs("node:fs/promises");const Ks=w(import.meta.url),Le=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,zs=e=>{if(typeof Le<"u"&&Le.versions&&Le.versions.node){const[t,o]=Le.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Le.getBuiltinModule(e)}return Ks(e)};zs("node:fs");const Xs=w(import.meta.url),Be=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ws=e=>{if(typeof Be<"u"&&Be.versions&&Be.versions.node){const[t,o]=Be.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Be.getBuiltinModule(e)}return Xs(e)};Ws("node:fs/promises");const qs=w(import.meta.url),Me=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Qs=e=>{if(typeof Me<"u"&&Me.versions&&Me.versions.node){const[t,o]=Me.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Me.getBuiltinModule(e)}return qs(e)},{statSync:Zs,lstatSync:Vs}=Qs("node:fs"),Ys=(e,t={})=>{const o=t.cwd?at(t.cwd):process.cwd();let r=bt(o);const{root:u}=hs(r),s=at(t.stopAt??u),n=bt(r,s),c=t.type??"file",f=function(h){return[e]};t.allowSymlinks??=!0;const R=t.allowSymlinks?Zs:Vs;for(;r&&r!==n&&r!==u;){for(let h of f()){if(h===ss)return;if(h===void 0)continue;Buffer.isBuffer(h)?h=h.toString():h instanceof URL&&(h=at(h));const A=be(h)?h:bt(r,h);try{const $=R(A);if(c==="file"&&$.isFile()||c==="directory"&&$.isDirectory())return A}catch{}}r=Ot(r)}};function Nt(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Ut={},mt,Ft;function pt(){if(Ft)return mt;Ft=1;const e="[^\\\\/]",t=Symbol("unignore"),o="\\.",r="\\+",u="\\?",s="\\/",n="(?=.)",c="[^/]",f=`(?:${s}|$)`,R=`(?:^|${s})`,h=`${o}{1,2}${f}`,A=`(?!${o})`,$=`(?!${R}${h})`,x=`(?!${o}{0,1}${f})`,B=`(?!${h})`,oe=`[^.${s}]`,Q=`${c}*?`,z="/",d={DOT_LITERAL:o,PLUS_LITERAL:r,QMARK_LITERAL:u,SLASH_LITERAL:s,ONE_CHAR:n,QMARK:c,END_ANCHOR:f,DOTS_SLASH:h,NO_DOT:A,NO_DOTS:$,NO_DOT_SLASH:x,NO_DOTS_SLASH:B,QMARK_NO_DOT:oe,STAR:Q,START_ANCHOR:R,SEP:z},m={...d,SLASH_LITERAL:"[\\\\/]",QMARK:e,STAR:`${e}*?`,DOTS_SLASH:`${o}{1,2}(?:[\\\\/]|$)`,NO_DOT:`(?!${o})`,NO_DOTS:`(?!(?:^|[\\\\/])${o}{1,2}(?:[\\\\/]|$))`,NO_DOT_SLASH:`(?!${o}{0,1}(?:[\\\\/]|$))`,NO_DOTS_SLASH:`(?!${o}{1,2}(?:[\\\\/]|$))`,QMARK_NO_DOT:"[^.\\\\/]",START_ANCHOR:"(?:^|[\\\\/])",END_ANCHOR:"(?:[\\\\/]|$)",SEP:"\\"},i={__proto__:null,alnum:"a-zA-Z0-9",alpha:"a-zA-Z",ascii:"\\x00-\\x7F",blank:" \\t",cntrl:"\\x00-\\x1F\\x7F",digit:"0-9",graph:"\\x21-\\x7E",lower:"a-z",print:"\\x20-\\x7E ",punct:"\\-!\"#$%&'()\\*+,./:;<=>?@[\\]^_`{|}~",space:" \\t\\r\\n\\v\\f",upper:"A-Z",word:"A-Za-z0-9_",xdigit:"A-Fa-f0-9"};return mt={DEFAULT_MAX_EXTGLOB_RECURSION:0,MAX_LENGTH:1024*64,POSIX_REGEX_SOURCE:i,UNIGNORE:t,REGEX_BACKSLASH:/\\(?![*+?^${}(|)[\]])/g,REGEX_NON_SPECIAL_CHARS:/^[^@![\].,$*+?^{}()|\\/]+/,REGEX_SPECIAL_CHARS:/[-*+?.^${}(|)[\]]/,REGEX_SPECIAL_CHARS_BACKREF:/(\\?)((\W)(\3*))/g,REGEX_SPECIAL_CHARS_GLOBAL:/([-*+?.^${}(|)[\]])/g,REGEX_REMOVE_BACKSLASH:/(?:\[.*?[^\\]\]|\\(?=.))/g,REPLACEMENTS:{__proto__:null,"***":"*","**/**":"**","**/**/**":"**"},CHAR_0:48,CHAR_9:57,CHAR_UPPERCASE_A:65,CHAR_LOWERCASE_A:97,CHAR_UPPERCASE_Z:90,CHAR_LOWERCASE_Z:122,CHAR_LEFT_PARENTHESES:40,CHAR_RIGHT_PARENTHESES:41,CHAR_ASTERISK:42,CHAR_AMPERSAND:38,CHAR_AT:64,CHAR_BACKWARD_SLASH:92,CHAR_CARRIAGE_RETURN:13,CHAR_CIRCUMFLEX_ACCENT:94,CHAR_COLON:58,CHAR_COMMA:44,CHAR_DOT:46,CHAR_DOUBLE_QUOTE:34,CHAR_EQUAL:61,CHAR_EXCLAMATION_MARK:33,CHAR_FORM_FEED:12,CHAR_FORWARD_SLASH:47,CHAR_GRAVE_ACCENT:96,CHAR_HASH:35,CHAR_HYPHEN_MINUS:45,CHAR_LEFT_ANGLE_BRACKET:60,CHAR_LEFT_CURLY_BRACE:123,CHAR_LEFT_SQUARE_BRACKET:91,CHAR_LINE_FEED:10,CHAR_NO_BREAK_SPACE:160,CHAR_PERCENT:37,CHAR_PLUS:43,CHAR_QUESTION_MARK:63,CHAR_RIGHT_ANGLE_BRACKET:62,CHAR_RIGHT_CURLY_BRACE:125,CHAR_RIGHT_SQUARE_BRACKET:93,CHAR_SEMICOLON:59,CHAR_SINGLE_QUOTE:39,CHAR_SPACE:32,CHAR_TAB:9,CHAR_UNDERSCORE:95,CHAR_VERTICAL_LINE:124,CHAR_ZERO_WIDTH_NOBREAK_SPACE:65279,extglobChars(y){return{"!":{type:"negate",open:"(?:(?!(?:",close:`))${y.STAR})`},"?":{type:"qmark",open:"(?:",close:")?"},"+":{type:"plus",open:"(?:",close:")+"},"*":{type:"star",open:"(?:",close:")*"},"@":{type:"at",open:"(?:",close:")"}}},globChars(y){return y===!0?m:d}},mt}var Kt;function ft(){return Kt||(Kt=1,(function(e){const{REGEX_BACKSLASH:t,REGEX_REMOVE_BACKSLASH:o,REGEX_SPECIAL_CHARS:r,REGEX_SPECIAL_CHARS_GLOBAL:u}=pt();e.isObject=s=>s!==null&&typeof s=="object"&&!Array.isArray(s),e.hasRegexChars=s=>r.test(s),e.isRegexChar=s=>s.length===1&&e.hasRegexChars(s),e.escapeRegex=s=>s.replace(u,"\\$1"),e.toPosixSlashes=s=>s.replace(t,"/"),e.isWindows=()=>{if(typeof navigator<"u"&&navigator.platform){const s=navigator.platform.toLowerCase();return s==="win32"||s==="windows"}return process.platform?process.platform==="win32":!1},e.removeBackslashes=s=>s.replace(o,n=>n==="\\"?"":n),e.escapeLast=(s,n,c)=>{const f=s.lastIndexOf(n,c);return f===-1?s:s[f-1]==="\\"?e.escapeLast(s,n,f-1):`${s.slice(0,f)}\\${s.slice(f)}`},e.removePrefix=(s,n={})=>{let c=s;return c.startsWith("./")&&(c=c.slice(2),n.prefix="./"),c},e.wrapOutput=(s,n={},c={})=>{const f=c.contains?"":"^",R=c.contains?"":"$";let h=`${f}(?:${s})${R}`;return n.negated===!0&&(h=`(?:^(?!${h}).*$)`),h},e.basename=(s,{windows:n}={})=>{const c=s.split(n?/[\\/]/:"/"),f=c[c.length-1];return f===""?c[c.length-2]:f}})(Ut)),Ut}var yt,zt;function Js(){if(zt)return yt;zt=1;const e=ft(),{CHAR_ASTERISK:t,CHAR_AT:o,CHAR_BACKWARD_SLASH:r,CHAR_COMMA:u,CHAR_DOT:s,CHAR_EXCLAMATION_MARK:n,CHAR_FORWARD_SLASH:c,CHAR_LEFT_CURLY_BRACE:f,CHAR_LEFT_PARENTHESES:R,CHAR_LEFT_SQUARE_BRACKET:h,CHAR_PLUS:A,CHAR_QUESTION_MARK:$,CHAR_RIGHT_CURLY_BRACE:x,CHAR_RIGHT_PARENTHESES:B,CHAR_RIGHT_SQUARE_BRACKET:oe}=pt(),Q=d=>d===c||d===r,z=d=>{d.isPrefix!==!0&&(d.depth=d.isGlobstar?1/0:1)};return yt=(d,m)=>{const i=m||{},y=d.length-1,E=i.parts===!0||i.scanToEnd===!0,T=[],v=[],O=[];let X=d,Z=-1,P=0,re=0,W=!1,ne=!1,I=!1,ce=!1,ge=!1,ue=!1,L=!1,ie=!1,de=!1,q=!1,K=0,Y,_,S={value:"",depth:0,isGlob:!1};const p=()=>Z>=y,V=()=>X.charCodeAt(Z+1),U=()=>(Y=_,X.charCodeAt(++Z));for(;Z<y;){_=U();let N;if(_===r){L=S.backslashes=!0,_=U(),_===f&&(ue=!0);continue}if(ue===!0||_===f){for(K++;p()!==!0&&(_=U());){if(_===r){L=S.backslashes=!0,U();continue}if(_===f){K++;continue}if(ue!==!0&&_===s&&(_=U())===s){if(W=S.isBrace=!0,I=S.isGlob=!0,q=!0,E===!0)continue;break}if(ue!==!0&&_===u){if(W=S.isBrace=!0,I=S.isGlob=!0,q=!0,E===!0)continue;break}if(_===x&&(K--,K===0)){ue=!1,W=S.isBrace=!0,q=!0;break}}if(E===!0)continue;break}if(_===c){if(T.push(Z),v.push(S),S={value:"",depth:0,isGlob:!1},q===!0)continue;if(Y===s&&Z===P+1){P+=2;continue}re=Z+1;continue}if(i.noext!==!0&&(_===A||_===o||_===t||_===$||_===n)&&V()===R){if(I=S.isGlob=!0,ce=S.isExtglob=!0,q=!0,_===n&&Z===P&&(de=!0),E===!0){for(;p()!==!0&&(_=U());){if(_===r){L=S.backslashes=!0,_=U();continue}if(_===B){I=S.isGlob=!0,q=!0;break}}continue}break}if(_===t){if(Y===t&&(ge=S.isGlobstar=!0),I=S.isGlob=!0,q=!0,E===!0)continue;break}if(_===$){if(I=S.isGlob=!0,q=!0,E===!0)continue;break}if(_===h){for(;p()!==!0&&(N=U());){if(N===r){L=S.backslashes=!0,U();continue}if(N===oe){ne=S.isBracket=!0,I=S.isGlob=!0,q=!0;break}}if(E===!0)continue;break}if(i.nonegate!==!0&&_===n&&Z===P){ie=S.negated=!0,P++;continue}if(i.noparen!==!0&&_===R){if(I=S.isGlob=!0,E===!0){for(;p()!==!0&&(_=U());){if(_===R){L=S.backslashes=!0,_=U();continue}if(_===B){q=!0;break}}continue}break}if(I===!0){if(q=!0,E===!0)continue;break}}i.noext===!0&&(ce=!1,I=!1);let j=X,a="",l="";P>0&&(a=X.slice(0,P),X=X.slice(P),re-=P),j&&I===!0&&re>0?(j=X.slice(0,re),l=X.slice(re)):I===!0?(j="",l=X):j=X,j&&j!==""&&j!=="/"&&j!==X&&Q(j.charCodeAt(j.length-1))&&(j=j.slice(0,-1)),i.unescape===!0&&(l&&(l=e.removeBackslashes(l)),j&&L===!0&&(j=e.removeBackslashes(j)));const te={prefix:a,input:d,start:P,base:j,glob:l,isBrace:W,isBracket:ne,isGlob:I,isExtglob:ce,isGlobstar:ge,negated:ie,negatedExtglob:de};if(i.tokens===!0&&(te.maxDepth=0,Q(_)||v.push(S),te.tokens=v),i.parts===!0||i.tokens===!0){let N;for(let D=0;D<T.length;D++){const pe=N?N+1:P,J=T[D],fe=d.slice(pe,J);i.tokens&&(D===0&&P!==0?(v[D].isPrefix=!0,v[D].value=a):v[D].value=fe,z(v[D]),te.maxDepth+=v[D].depth),(D!==0||fe!=="")&&O.push(fe),N=J}if(N&&N+1<d.length){const D=d.slice(N+1);O.push(D),i.tokens&&(v[v.length-1].value=D,z(v[v.length-1]),te.maxDepth+=v[v.length-1].depth)}te.slashes=T,te.parts=O}return te},yt}var vt,Xt;function er(){if(Xt)return vt;Xt=1;const e=pt(),t=ft(),{MAX_LENGTH:o,POSIX_REGEX_SOURCE:r,REGEX_NON_SPECIAL_CHARS:u,REGEX_SPECIAL_CHARS_BACKREF:s,REPLACEMENTS:n}=e,c=(d,m)=>typeof m.expandRange=="function"?m.expandRange(...d,m):(d.sort(),`[${d.join("-")}]`),f=(d,m)=>`Missing ${d}: "${m}" - use "\\\\${m}" to match literal characters`,R=d=>{const m=[];let i=0,y=0,E=0,T="",v=!1;for(const O of d){if(v===!0){T+=O,v=!1;continue}if(O==="\\"){T+=O,v=!0;continue}if(O==='"'){E=E===1?0:1,T+=O;continue}if(E===0){if(O==="[")i++;else if(O==="]"&&i>0)i--;else if(i===0){if(O==="(")y++;else if(O===")"&&y>0)y--;else if(O==="|"&&y===0){m.push(T),T="";continue}}}T+=O}return m.push(T),m},h=d=>{let m=!1;for(const i of d){if(m===!0){m=!1;continue}if(i==="\\"){m=!0;continue}if(/[?*+@!()[\]{}]/.test(i))return!1}return!0},A=d=>{let m=d.trim(),i=!0;for(;i===!0;)i=!1,/^@\([^\\()[\]{}|]+\)$/.test(m)&&(m=m.slice(2,-1),i=!0);if(h(m))return m.replace(/\\(.)/g,"$1")},$=d=>{const m=d.map(A).filter(Boolean);for(let i=0;i<m.length;i++)for(let y=i+1;y<m.length;y++){const E=m[i],T=m[y],v=E[0];if(!(!v||E!==v.repeat(E.length)||T!==v.repeat(T.length))&&(E===T||E.startsWith(T)||T.startsWith(E)))return!0}return!1},x=(d,m=!0)=>{if(d[0]!=="+"&&d[0]!=="*"||d[1]!=="(")return;let i=0,y=0,E=0,T=!1;for(let v=1;v<d.length;v++){const O=d[v];if(T===!0){T=!1;continue}if(O==="\\"){T=!0;continue}if(O==='"'){E=E===1?0:1;continue}if(E!==1){if(O==="["){i++;continue}if(O==="]"&&i>0){i--;continue}if(!(i>0)){if(O==="("){y++;continue}if(O===")"&&(y--,y===0))return m===!0&&v!==d.length-1?void 0:{type:d[0],body:d.slice(2,v),end:v}}}}},B=d=>{let m=0;const i=[];for(;m<d.length;){const y=x(d.slice(m),!1);if(!y||y.type!=="*")return;const E=R(y.body).map(v=>v.trim());if(E.length!==1)return;const T=A(E[0]);if(!T||T.length!==1)return;i.push(T),m+=y.end+1}return i.length<1?void 0:`${i.length===1?t.escapeRegex(i[0]):`[${i.map(y=>t.escapeRegex(y)).join("")}]`}*`},oe=d=>{let m=0,i=d.trim(),y=x(i);for(;y;)m++,i=y.body.trim(),y=x(i);return m},Q=(d,m)=>{if(m.maxExtglobRecursion===!1)return{risky:!1};const i=typeof m.maxExtglobRecursion=="number"?m.maxExtglobRecursion:e.DEFAULT_MAX_EXTGLOB_RECURSION,y=R(d).map(E=>E.trim());if(y.length>1&&(y.some(E=>E==="")||y.some(E=>/^[*?]+$/.test(E))||$(y)))return{risky:!0};for(const E of y){const T=B(E);if(T)return{risky:!0,safeOutput:T};if(oe(E)>i)return{risky:!0}}return{risky:!1}},z=(d,m)=>{if(typeof d!="string")throw new TypeError("Expected a string");d=n[d]||d;const i={...m},y=typeof i.maxLength=="number"?Math.min(o,i.maxLength):o;let E=d.length;if(E>y)throw new SyntaxError(`Input length: ${E}, exceeds maximum allowed length: ${y}`);const T={type:"bos",value:"",output:i.prepend||""},v=[T],O=i.capture?"":"?:",X=e.globChars(i.windows),Z=e.extglobChars(X),{DOT_LITERAL:P,PLUS_LITERAL:re,SLASH_LITERAL:W,ONE_CHAR:ne,DOTS_SLASH:I,NO_DOT:ce,NO_DOT_SLASH:ge,NO_DOTS_SLASH:ue,QMARK:L,QMARK_NO_DOT:ie,STAR:de,START_ANCHOR:q}=X,K=b=>`(${O}(?:(?!${q}${b.dot?I:P}).)*?)`,Y=i.dot?"":ce,_=i.dot?L:ie;let S=i.bash===!0?K(i):de;i.capture&&(S=`(${S})`),typeof i.noext=="boolean"&&(i.noextglob=i.noext);const p={input:d,index:-1,start:0,dot:i.dot===!0,consumed:"",output:"",prefix:"",backtrack:!1,negated:!1,brackets:0,braces:0,parens:0,quotes:0,globstar:!1,tokens:v};d=t.removePrefix(d,p),E=d.length;const V=[],U=[],j=[];let a=T,l;const te=()=>p.index===E-1,N=p.peek=(b=1)=>d[p.index+b],D=p.advance=()=>d[++p.index]||"",pe=()=>d.slice(p.index+1),J=(b="",M=0)=>{p.consumed+=b,p.index+=M},fe=b=>{p.output+=b.output!=null?b.output:b.value,J(b.value)},Oo=()=>{let b=1;for(;N()==="!"&&(N(2)!=="("||N(3)==="?");)D(),p.start++,b++;return b%2===0?!1:(p.negated=!0,p.start++,!0)},ut=b=>{p[b]++,j.push(b)},he=b=>{p[b]--,j.pop()},k=b=>{if(a.type==="globstar"){const M=p.braces>0&&(b.type==="comma"||b.type==="brace"),g=b.extglob===!0||V.length&&(b.type==="pipe"||b.type==="paren");b.type!=="slash"&&b.type!=="paren"&&!M&&!g&&(p.output=p.output.slice(0,-a.output.length),a.type="star",a.value="*",a.output=S,p.output+=a.output)}if(V.length&&b.type!=="paren"&&(V[V.length-1].inner+=b.value),(b.value||b.output)&&fe(b),a&&a.type==="text"&&b.type==="text"){a.output=(a.output||a.value)+b.value,a.value+=b.value;return}b.prev=a,v.push(b),a=b},it=(b,M)=>{const g={...Z[M],conditions:1,inner:""};g.prev=a,g.parens=p.parens,g.output=p.output,g.startIndex=p.index,g.tokensIndex=v.length;const C=(i.capture?"(":"")+g.open;ut("parens"),k({type:b,value:M,output:p.output?"":ne}),k({type:"paren",extglob:!0,value:D(),output:C}),V.push(g)},No=b=>{const M=d.slice(b.startIndex,p.index+1),g=d.slice(b.startIndex+2,p.index),C=Q(g,i);if((b.type==="plus"||b.type==="star")&&C.risky){const H=C.safeOutput?(b.output?"":ne)+(i.capture?`(${C.safeOutput})`:C.safeOutput):void 0,ae=v[b.tokensIndex];ae.type="text",ae.value=M,ae.output=H||t.escapeRegex(M);for(let le=b.tokensIndex+1;le<v.length;le++)v[le].value="",v[le].output="",delete v[le].suffix;p.output=b.output+ae.output,p.backtrack=!0,k({type:"paren",extglob:!0,value:l,output:""}),he("parens");return}let G=b.close+(i.capture?")":""),F;if(b.type==="negate"){let H=S;if(b.inner&&b.inner.length>1&&b.inner.includes("/")&&(H=K(i)),(H!==S||te()||/^\)+$/.test(pe()))&&(G=b.close=`)$))${H}`),b.inner.includes("*")&&(F=pe())&&/^\.[^\\/.]+$/.test(F)){const ae=z(F,{...m,fastpaths:!1}).output;G=b.close=`)${ae})${H})`}b.prev.type==="bos"&&(p.negatedExtglob=!0)}k({type:"paren",extglob:!0,value:l,output:G}),he("parens")};if(i.fastpaths!==!1&&!/(^[*!]|[/()[\]{}"])/.test(d)){let b=!1,M=d.replace(s,(g,C,G,F,H,ae)=>F==="\\"?(b=!0,g):F==="?"?C?C+F+(H?L.repeat(H.length):""):ae===0?_+(H?L.repeat(H.length):""):L.repeat(G.length):F==="."?P.repeat(G.length):F==="*"?C?C+F+(H?S:""):S:C?g:`\\${g}`);return b===!0&&(i.unescape===!0?M=M.replace(/\\/g,""):M=M.replace(/\\+/g,g=>g.length%2===0?"\\\\":g?"\\":"")),M===d&&i.contains===!0?(p.output=d,p):(p.output=t.wrapOutput(M,p,m),p)}for(;!te();){if(l=D(),l==="\0")continue;if(l==="\\"){const g=N();if(g==="/"&&i.bash!==!0||g==="."||g===";")continue;if(!g){l+="\\",k({type:"text",value:l});continue}const C=/^\\+/.exec(pe());let G=0;if(C&&C[0].length>2&&(G=C[0].length,p.index+=G,G%2!==0&&(l+="\\")),i.unescape===!0?l=D():l+=D(),p.brackets===0){k({type:"text",value:l});continue}}if(p.brackets>0&&(l!=="]"||a.value==="["||a.value==="[^")){if(i.posix!==!1&&l===":"){const g=a.value.slice(1);if(g.includes("[")&&(a.posix=!0,g.includes(":"))){const C=a.value.lastIndexOf("["),G=a.value.slice(0,C),F=a.value.slice(C+2),H=r[F];if(H){a.value=G+H,p.backtrack=!0,D(),!T.output&&v.indexOf(a)===1&&(T.output=ne);continue}}}(l==="["&&N()!==":"||l==="-"&&N()==="]")&&(l=`\\${l}`),l==="]"&&(a.value==="["||a.value==="[^")&&(l=`\\${l}`),i.posix===!0&&l==="!"&&a.value==="["&&(l="^"),a.value+=l,fe({value:l});continue}if(p.quotes===1&&l!=='"'){l=t.escapeRegex(l),a.value+=l,fe({value:l});continue}if(l==='"'){p.quotes=p.quotes===1?0:1,i.keepQuotes===!0&&k({type:"text",value:l});continue}if(l==="("){ut("parens"),k({type:"paren",value:l});continue}if(l===")"){if(p.parens===0&&i.strictBrackets===!0)throw new SyntaxError(f("opening","("));const g=V[V.length-1];if(g&&p.parens===g.parens+1){No(V.pop());continue}k({type:"paren",value:l,output:p.parens?")":"\\)"}),he("parens");continue}if(l==="["){if(i.nobracket===!0||!pe().includes("]")){if(i.nobracket!==!0&&i.strictBrackets===!0)throw new SyntaxError(f("closing","]"));l=`\\${l}`}else ut("brackets");k({type:"bracket",value:l});continue}if(l==="]"){if(i.nobracket===!0||a&&a.type==="bracket"&&a.value.length===1){k({type:"text",value:l,output:`\\${l}`});continue}if(p.brackets===0){if(i.strictBrackets===!0)throw new SyntaxError(f("opening","["));k({type:"text",value:l,output:`\\${l}`});continue}he("brackets");const g=a.value.slice(1);if(a.posix!==!0&&g[0]==="^"&&!g.includes("/")&&(l=`/${l}`),a.value+=l,fe({value:l}),i.literalBrackets===!1||t.hasRegexChars(g))continue;const C=t.escapeRegex(a.value);if(p.output=p.output.slice(0,-a.value.length),i.literalBrackets===!0){p.output+=C,a.value=C;continue}a.value=`(${O}${C}|${a.value})`,p.output+=a.value;continue}if(l==="{"&&i.nobrace!==!0){ut("braces");const g={type:"brace",value:l,output:"(",outputIndex:p.output.length,tokensIndex:p.tokens.length};U.push(g),k(g);continue}if(l==="}"){const g=U[U.length-1];if(i.nobrace===!0||!g){k({type:"text",value:l,output:l});continue}let C=")";if(g.dots===!0){const G=v.slice(),F=[];for(let H=G.length-1;H>=0&&(v.pop(),G[H].type!=="brace");H--)G[H].type!=="dots"&&F.unshift(G[H].value);C=c(F,i),p.backtrack=!0}if(g.comma!==!0&&g.dots!==!0){const G=p.output.slice(0,g.outputIndex),F=p.tokens.slice(g.tokensIndex);g.value=g.output="\\{",l=C="\\}",p.output=G;for(const H of F)p.output+=H.output||H.value}k({type:"brace",value:l,output:C}),he("braces"),U.pop();continue}if(l==="|"){V.length>0&&V[V.length-1].conditions++,k({type:"text",value:l});continue}if(l===","){let g=l;const C=U[U.length-1];C&&j[j.length-1]==="braces"&&(C.comma=!0,g="|"),k({type:"comma",value:l,output:g});continue}if(l==="/"){if(a.type==="dot"&&p.index===p.start+1){p.start=p.index+1,p.consumed="",p.output="",v.pop(),a=T;continue}k({type:"slash",value:l,output:W});continue}if(l==="."){if(p.braces>0&&a.type==="dot"){a.value==="."&&(a.output=P);const g=U[U.length-1];a.type="dots",a.output+=l,a.value+=l,g.dots=!0;continue}if(p.braces+p.parens===0&&a.type!=="bos"&&a.type!=="slash"){k({type:"text",value:l,output:P});continue}k({type:"dot",value:l,output:P});continue}if(l==="?"){if(!(a&&a.value==="(")&&i.noextglob!==!0&&N()==="("&&N(2)!=="?"){it("qmark",l);continue}if(a&&a.type==="paren"){const g=N();let C=l;(a.value==="("&&!/[!=<:]/.test(g)||g==="<"&&!/<([!=]|\w+>)/.test(pe()))&&(C=`\\${l}`),k({type:"text",value:l,output:C});continue}if(i.dot!==!0&&(a.type==="slash"||a.type==="bos")){k({type:"qmark",value:l,output:ie});continue}k({type:"qmark",value:l,output:L});continue}if(l==="!"){if(i.noextglob!==!0&&N()==="("&&(N(2)!=="?"||!/[!=<:]/.test(N(3)))){it("negate",l);continue}if(i.nonegate!==!0&&p.index===0){Oo();continue}}if(l==="+"){if(i.noextglob!==!0&&N()==="("&&N(2)!=="?"){it("plus",l);continue}if(a&&a.value==="("||i.regex===!1){k({type:"plus",value:l,output:re});continue}if(a&&(a.type==="bracket"||a.type==="paren"||a.type==="brace")||p.parens>0){k({type:"plus",value:l});continue}k({type:"plus",value:re});continue}if(l==="@"){if(i.noextglob!==!0&&N()==="("&&N(2)!=="?"){k({type:"at",extglob:!0,value:l,output:""});continue}k({type:"text",value:l});continue}if(l!=="*"){(l==="$"||l==="^")&&(l=`\\${l}`);const g=u.exec(pe());g&&(l+=g[0],p.index+=g[0].length),k({type:"text",value:l});continue}if(a&&(a.type==="globstar"||a.star===!0)){a.type="star",a.star=!0,a.value+=l,a.output=S,p.backtrack=!0,p.globstar=!0,J(l);continue}let b=pe();if(i.noextglob!==!0&&/^\([^?]/.test(b)){it("star",l);continue}if(a.type==="star"){if(i.noglobstar===!0){J(l);continue}const g=a.prev,C=g.prev,G=g.type==="slash"||g.type==="bos",F=C&&(C.type==="star"||C.type==="globstar");if(i.bash===!0&&(!G||b[0]&&b[0]!=="/")){k({type:"star",value:l,output:""});continue}const H=p.braces>0&&(g.type==="comma"||g.type==="brace"),ae=V.length&&(g.type==="pipe"||g.type==="paren");if(!G&&g.type!=="paren"&&!H&&!ae){k({type:"star",value:l,output:""});continue}for(;b.slice(0,3)==="/**";){const le=d[p.index+4];if(le&&le!=="/")break;b=b.slice(3),J("/**",3)}if(g.type==="bos"&&te()){a.type="globstar",a.value+=l,a.output=K(i),p.output=a.output,p.globstar=!0,J(l);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&!F&&te()){p.output=p.output.slice(0,-(g.output+a.output).length),g.output=`(?:${g.output}`,a.type="globstar",a.output=K(i)+(i.strictSlashes?")":"|$)"),a.value+=l,p.globstar=!0,p.output+=g.output+a.output,J(l);continue}if(g.type==="slash"&&g.prev.type!=="bos"&&b[0]==="/"){const le=b[1]!==void 0?"|$":"";p.output=p.output.slice(0,-(g.output+a.output).length),g.output=`(?:${g.output}`,a.type="globstar",a.output=`${K(i)}${W}|${W}${le})`,a.value+=l,p.output+=g.output+a.output,p.globstar=!0,J(l+D()),k({type:"slash",value:"/",output:""});continue}if(g.type==="bos"&&b[0]==="/"){a.type="globstar",a.value+=l,a.output=`(?:^|${W}|${K(i)}${W})`,p.output=a.output,p.globstar=!0,J(l+D()),k({type:"slash",value:"/",output:""});continue}if(H&&b[0]==="/"){a.type="globstar",a.value+=l,a.output=`(?:^|${W}|${K(i)}${W})`,p.output+=a.output,p.globstar=!0,J(l+D()),k({type:"slash",value:"/",output:""});continue}p.output=p.output.slice(0,-a.output.length),a.type="globstar",a.output=K(i),a.value+=l,p.output+=a.output,p.globstar=!0,J(l);continue}const M={type:"star",value:l,output:S};if(i.bash===!0){M.output=".*?",(a.type==="bos"||a.type==="slash")&&(M.output=Y+M.output),k(M);continue}if(a&&(a.type==="bracket"||a.type==="paren")&&i.regex===!0){M.output=l,k(M);continue}(p.index===p.start||a.type==="slash"||a.type==="dot")&&(a.type==="dot"?(p.output+=ge,a.output+=ge):i.dot===!0?(p.output+=ue,a.output+=ue):(p.output+=Y,a.output+=Y),N()!=="*"&&(p.output+=ne,a.output+=ne)),k(M)}for(;p.brackets>0;){if(i.strictBrackets===!0)throw new SyntaxError(f("closing","]"));p.output=t.escapeLast(p.output,"["),he("brackets")}for(;p.parens>0;){if(i.strictBrackets===!0)throw new SyntaxError(f("closing",")"));p.output=t.escapeLast(p.output,"("),he("parens")}for(;p.braces>0;){if(i.strictBrackets===!0)throw new SyntaxError(f("closing","}"));p.output=t.escapeLast(p.output,"{"),he("braces")}if(i.strictSlashes!==!0&&(a.type==="star"||a.type==="bracket")&&k({type:"maybe_slash",value:"",output:`${W}?`}),p.backtrack===!0){p.output="";for(const b of p.tokens)p.output+=b.output!=null?b.output:b.value,b.suffix&&(p.output+=b.suffix)}return p};return z.fastpaths=(d,m)=>{const i={...m},y=typeof i.maxLength=="number"?Math.min(o,i.maxLength):o,E=d.length;if(E>y)throw new SyntaxError(`Input length: ${E}, exceeds maximum allowed length: ${y}`);d=n[d]||d;const{DOT_LITERAL:T,SLASH_LITERAL:v,ONE_CHAR:O,DOTS_SLASH:X,NO_DOT:Z,NO_DOTS:P,NO_DOTS_SLASH:re,STAR:W,START_ANCHOR:ne}=e.globChars(i.windows),I=i.dot?P:Z,ce=i.dot?re:Z,ge=i.capture?"":"?:",ue={negated:!1,prefix:""};let L=i.bash===!0?".*?":W;i.capture&&(L=`(${L})`);const ie=Y=>Y.noglobstar===!0?L:`(${ge}(?:(?!${ne}${Y.dot?X:T}).)*?)`,de=Y=>{switch(Y){case"*":return`${I}${O}${L}`;case".*":return`${T}${O}${L}`;case"*.*":return`${I}${L}${T}${O}${L}`;case"*/*":return`${I}${L}${v}${O}${ce}${L}`;case"**":return I+ie(i);case"**/*":return`(?:${I}${ie(i)}${v})?${ce}${O}${L}`;case"**/*.*":return`(?:${I}${ie(i)}${v})?${ce}${L}${T}${O}${L}`;case"**/.*":return`(?:${I}${ie(i)}${v})?${T}${O}${L}`;default:{const _=/^(.*?)\.(\w+)$/.exec(Y);if(!_)return;const S=de(_[1]);return S?S+T+_[2]:void 0}}},q=t.removePrefix(d,ue);let K=de(q);return K&&i.strictSlashes!==!0&&(K+=`${v}?`),K},vt=z,vt}var At,Wt;function tr(){if(Wt)return At;Wt=1;const e=Js(),t=er(),o=ft(),r=pt(),u=n=>n&&typeof n=="object"&&!Array.isArray(n),s=(n,c,f=!1)=>{if(Array.isArray(n)){const Q=n.map(z=>s(z,c,f));return z=>{for(const d of Q){const m=d(z);if(m)return m}return!1}}const R=u(n)&&n.tokens&&n.input;if(n===""||typeof n!="string"&&!R)throw new TypeError("Expected pattern to be a non-empty string");const h=c||{},A=h.windows,$=R?s.compileRe(n,c):s.makeRe(n,c,!1,!0),x=$.state;delete $.state;let B=()=>!1;if(h.ignore){const Q={...c,ignore:null,onMatch:null,onResult:null};B=s(h.ignore,Q,f)}const oe=(Q,z=!1)=>{const{isMatch:d,match:m,output:i}=s.test(Q,$,c,{glob:n,posix:A}),y={glob:n,state:x,regex:$,posix:A,input:Q,output:i,match:m,isMatch:d};if(typeof h.onResult=="function"&&h.onResult(y),d===!1)return y.isMatch=!1,z?y:!1;e:if(B(Q)){if(typeof h.onIgnore=="function"&&h.onIgnore(y)===r.UNIGNORE){y.isMatch=!0;break e}return y.isMatch=!1,z?y:!1}return typeof h.onMatch=="function"&&h.onMatch(y),z?y:!0};return f&&(oe.state=x),oe};return s.test=(n,c,f,{glob:R,posix:h}={})=>{if(typeof n!="string")throw new TypeError("Expected input to be a string");if(n==="")return{isMatch:!1,output:""};const A=f||{},$=A.format||(h?o.toPosixSlashes:null);let x=n===R,B=x&&$?$(n):n;return x===!1&&(B=$?$(n):n,x=B===R),(x===!1||A.capture===!0)&&(A.matchBase===!0||A.basename===!0?x=s.matchBase(n,c,f,h):x=c.exec(B)),{isMatch:!!x,match:x,output:B}},s.matchBase=(n,c,f)=>(c instanceof RegExp?c:s.makeRe(c,f)).test(o.basename(n)),s.isMatch=(n,c,f)=>s(c,f)(n),s.parse=(n,c)=>Array.isArray(n)?n.map(f=>s.parse(f,c)):t(n,{...c,fastpaths:!1}),s.scan=(n,c)=>e(n,c),s.compileRe=(n,c,f=!1,R=!1)=>{if(f===!0)return n.output;const h=c||{},A=h.contains?"":"^",$=h.contains?"":"$";let x=`${A}(?:${n.output})${$}`;n&&n.negated===!0&&(x=`^(?!${x}).*$`);const B=s.toRegex(x,c);return R===!0&&(B.state=n),B},s.makeRe=(n,c={},f=!1,R=!1)=>{if(!n||typeof n!="string")throw new TypeError("Expected a non-empty string");let h={negated:!1,fastpaths:!0};return c.fastpaths!==!1&&(n[0]==="."||n[0]==="*")&&(h.output=t.fastpaths(n,c)),h.output||(h=t(n,c)),s.compileRe(h,c,f,R)},s.toRegex=(n,c)=>{try{const f=c||{};return new RegExp(n,f.flags||(f.nocase?"i":""))}catch(f){if(c&&c.debug===!0)throw f;return/$^/}},s.constants=r,At=s,At}var Rt,qt;function or(){if(qt)return Rt;qt=1;const e=tr(),t=ft();function o(r,u,s=!1){return u&&(u.windows===null||u.windows===void 0)&&(u={...u,windows:t.isWindows()}),e(r,u,s)}return Object.assign(o,e),Rt=o,Rt}var sr=or();Nt(sr);const rr=w(import.meta.url),Ie=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,nt=e=>{if(typeof Ie<"u"&&Ie.versions&&Ie.versions.node){const[t,o]=Ie.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ie.getBuiltinModule(e)}return rr(e)};nt("fs");nt("fs");nt("path");nt("url");const{createRequire:nr}=nt("module");var Qt=nr(import.meta.url);try{Qt.resolve("picomatch"),Qt("picomatch")}catch{}var Et,Zt;function ur(){if(Zt)return Et;Zt=1;/*!
|
|
5
|
+
* is-extglob <https://github.com/jonschlinkert/is-extglob>
|
|
6
|
+
*
|
|
7
|
+
* Copyright (c) 2014-2016, Jon Schlinkert.
|
|
8
|
+
* Licensed under the MIT License.
|
|
9
|
+
*/return Et=function(e){if(typeof e!="string"||e==="")return!1;for(var t;t=/(\\).|([@?!+*]\(.*\))/g.exec(e);){if(t[2])return!0;e=e.slice(t.index+t[0].length)}return!1},Et}var Tt,Vt;function mo(){if(Vt)return Tt;Vt=1;/*!
|
|
10
|
+
* is-glob <https://github.com/jonschlinkert/is-glob>
|
|
11
|
+
*
|
|
12
|
+
* Copyright (c) 2014-2017, Jon Schlinkert.
|
|
13
|
+
* Released under the MIT License.
|
|
14
|
+
*/var e=ur(),t={"{":"}","(":")","[":"]"},o=function(u){if(u[0]==="!")return!0;for(var s=0,n=-2,c=-2,f=-2,R=-2,h=-2;s<u.length;){if(u[s]==="*"||u[s+1]==="?"&&/[\].+)]/.test(u[s])||c!==-1&&u[s]==="["&&u[s+1]!=="]"&&(c<s&&(c=u.indexOf("]",s)),c>s&&(h===-1||h>c||(h=u.indexOf("\\",s),h===-1||h>c)))||f!==-1&&u[s]==="{"&&u[s+1]!=="}"&&(f=u.indexOf("}",s),f>s&&(h=u.indexOf("\\",s),h===-1||h>f))||R!==-1&&u[s]==="("&&u[s+1]==="?"&&/[:!=]/.test(u[s+2])&&u[s+3]!==")"&&(R=u.indexOf(")",s),R>s&&(h=u.indexOf("\\",s),h===-1||h>R))||n!==-1&&u[s]==="("&&u[s+1]!=="|"&&(n<s&&(n=u.indexOf("|",s)),n!==-1&&u[n+1]!==")"&&(R=u.indexOf(")",n),R>n&&(h=u.indexOf("\\",n),h===-1||h>R))))return!0;if(u[s]==="\\"){var A=u[s+1];s+=2;var $=t[A];if($){var x=u.indexOf($,s);x!==-1&&(s=x+1)}if(u[s]==="!")return!0}else s++}return!1},r=function(u){if(u[0]==="!")return!0;for(var s=0;s<u.length;){if(/[*?{}()[\]]/.test(u[s]))return!0;if(u[s]==="\\"){var n=u[s+1];s+=2;var c=t[n];if(c){var f=u.indexOf(c,s);f!==-1&&(s=f+1)}if(u[s]==="!")return!0}else s++}return!1};return Tt=function(u,s){if(typeof u!="string"||u==="")return!1;if(e(u))return!0;var n=o;return s&&s.strict===!1&&(n=r),n(u)},Tt}const ir=w(import.meta.url),De=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,yo=e=>{if(typeof De<"u"&&De.versions&&De.versions.node){const[t,o]=De.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return De.getBuiltinModule(e)}return ir(e)},ar=yo("path"),lr=yo("os");var xt,Yt;function cr(){if(Yt)return xt;Yt=1;var e=mo(),t=ar.posix.dirname,o=lr.platform()==="win32",r="/",u=/\\/g,s=/\\([!*?|[\](){}])/g;xt=function(f,R){var h=Object.assign({flipBackslashes:!0},R);h.flipBackslashes&&o&&f.indexOf(r)<0&&(f=f.replace(u,r)),n(f)&&(f+=r),f+="a";do f=t(f);while(c(f));return f.replace(s,"$1")};function n(f){var R=f.slice(-1),h;switch(R){case"}":h="{";break;case"]":h="[";break;default:return!1}var A=f.indexOf(h);return A<0?!1:f.slice(A+1,-1).includes(r)}function c(f){return/\([^()]+$/.test(f)||f[0]==="{"||f[0]==="["||/[^\\][{[]/.test(f)?!0:e(f)}return xt}var pr=cr();Nt(pr);const fr=w(import.meta.url),Ge=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,hr=e=>{if(typeof Ge<"u"&&Ge.versions&&Ge.versions.node){const[t,o]=Ge.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ge.getBuiltinModule(e)}return fr(e)};hr("node:fs/promises");const gr=w(import.meta.url),je=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,dr=e=>{if(typeof je<"u"&&je.versions&&je.versions.node){const[t,o]=je.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return je.getBuiltinModule(e)}return gr(e)},{accessSync:br}=dr("node:fs");function St(e,t=os){bo(e),e=at(e);try{return br(e,t),!0}catch{return!1}}var mr=mo();Nt(mr);const yr=w(import.meta.url),Pe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,vo=e=>{if(typeof Pe<"u"&&Pe.versions&&Pe.versions.node){const[t,o]=Pe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Pe.getBuiltinModule(e)}return yr(e)};vo("node:fs/promises");vo("node:fs");let vr=class extends Error{constructor(e){super(`ENOENT: ${e}`)}get code(){return"ENOENT"}set code(e){throw new Error("Cannot overwrite code ENOENT")}get name(){return"NotFoundError"}set name(e){throw new Error("Cannot overwrite name of NotFoundError")}};const Ar=w(import.meta.url),Ue=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ao=e=>{if(typeof Ue<"u"&&Ue.versions&&Ue.versions.node){const[t,o]=Ue.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ue.getBuiltinModule(e)}return Ar(e)};Ao("node:fs/promises");Ao("node:zlib");const Rr=w(import.meta.url),Fe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ro=e=>{if(typeof Fe<"u"&&Fe.versions&&Fe.versions.node){const[t,o]=Fe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Fe.getBuiltinModule(e)}return Rr(e)};Ro("node:fs");Ro("node:zlib");const Er=w(import.meta.url),Ke=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Tr=e=>{if(typeof Ke<"u"&&Ke.versions&&Ke.versions.node){const[t,o]=Ke.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ke.getBuiltinModule(e)}return Er(e)},{createRequire:Eo}=Tr("node:module"),xr=new Map([["Error",Error],["EvalError",EvalError],["RangeError",RangeError],["ReferenceError",ReferenceError],["SyntaxError",SyntaxError],["TypeError",TypeError],["URIError",URIError]]);typeof AggregateError<"u"&&xr.set("AggregateError",AggregateError);const _r=Eo(import.meta.url),ze=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,$r=e=>{if(typeof ze<"u"&&ze.versions&&ze.versions.node){const[t,o]=ze.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return ze.getBuiltinModule(e)}return _r(e)};$r("node:util");const kr=Eo(import.meta.url),Xe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ht=e=>{if(typeof Xe<"u"&&Xe.versions&&Xe.versions.node){const[t,o]=Xe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Xe.getBuiltinModule(e)}return kr(e)};Ht("node:fs");Ht("node:path");Ht("node:url");const Cr=w(import.meta.url),We=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,To=e=>{if(typeof We<"u"&&We.versions&&We.versions.node){const[t,o]=We.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return We.getBuiltinModule(e)}return Cr(e)};To("node:fs");To("node:fs/promises");const Sr=w(import.meta.url),qe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,wr=e=>{if(typeof qe<"u"&&qe.versions&&qe.versions.node){const[t,o]=qe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return qe.getBuiltinModule(e)}return Sr(e)};wr("node:fs");const Or=w(import.meta.url),Qe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Nr=e=>{if(typeof Qe<"u"&&Qe.versions&&Qe.versions.node){const[t,o]=Qe.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Qe.getBuiltinModule(e)}return Or(e)};Nr("node:fs/promises");const Hr=w(import.meta.url),Ze=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Lr=e=>{if(typeof Ze<"u"&&Ze.versions&&Ze.versions.node){const[t,o]=Ze.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ze.getBuiltinModule(e)}return Hr(e)};Lr("node:fs");w(import.meta.url);const Br=w(import.meta.url),Ve=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Mr=e=>{if(typeof Ve<"u"&&Ve.versions&&Ve.versions.node){const[t,o]=Ve.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ve.getBuiltinModule(e)}return Br(e)};Mr("node:crypto");new TextEncoder;const Ir=w(import.meta.url),Ye=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Dr=e=>{if(typeof Ye<"u"&&Ye.versions&&Ye.versions.node){const[t,o]=Ye.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Ye.getBuiltinModule(e)}return Ir(e)};Dr("node:fs/promises");const Gr=w(import.meta.url),Je=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,jr=e=>{if(typeof Je<"u"&&Je.versions&&Je.versions.node){const[t,o]=Je.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return Je.getBuiltinModule(e)}return Gr(e)};jr("node:fs");const Pr=w(import.meta.url),et=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ur=e=>{if(typeof et<"u"&&et.versions&&et.versions.node){const[t,o]=et.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return et.getBuiltinModule(e)}return Pr(e)};Ur("node:fs/promises");const Fr=w(import.meta.url),tt=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Kr=e=>{if(typeof tt<"u"&&tt.versions&&tt.versions.node){const[t,o]=tt.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return tt.getBuiltinModule(e)}return Fr(e)};Kr("node:fs");const zr=w(import.meta.url),ot=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Lt=e=>{if(typeof ot<"u"&&ot.versions&&ot.versions.node){const[t,o]=ot.versions.node.split(".").map(Number);if(t>22||t===22&&o>=3||t===20&&o>=16)return ot.getBuiltinModule(e)}return zr(e)},Xr=Lt("fs"),Wr=Lt("os"),qr=Lt("path");var _t={},Jt;function Qr(){if(Jt)return _t;Jt=1;var e=Object.defineProperty,t=(h,A)=>e(h,"name",{value:A,configurable:!0}),o=Xr,r=Wr,u=qr;const s=t(h=>{let A="";for(let $=0;$<h.length;$+=1){const x=h[$],B=x.toUpperCase();A+=x===B?x.toLowerCase():B}return A},"invertCase"),n=new Map,c=t((h,A)=>{const $=u.join(h,`.is-fs-case-sensitive-test-${process.pid}`);try{return A.writeFileSync($,""),!A.existsSync(s($))}finally{try{A.unlinkSync($)}catch{}}},"checkDirectoryCaseWithWrite"),f=t((h,A,$)=>{try{return c(h,$)}catch(x){if(A===void 0)return c(r.tmpdir(),$);throw x}},"checkDirectoryCaseWithFallback"),R=t((h,A=o,$=!0)=>{const x=h??process.cwd();if($&&n.has(x))return n.get(x);let B;const oe=s(x);return oe!==x&&A.existsSync(x)?B=!A.existsSync(oe):B=f(x,h,A),$&&n.set(x,B),B},"isFsCaseSensitive");return _t.isFsCaseSensitive=R,_t}Qr();const xo=e=>e instanceof URL?new URL(e).pathname:e,eo=e=>{const t=es();if(It==="win32"){const r=rt.LOCALAPPDATA??(t?se(t,"AppData","Local"):gt());return se(r,e,"Cache")}if(It==="darwin"){const r=t?se(t,"Library","Caches"):gt();return se(r,e)}const o=rt.XDG_CACHE_HOME??(t?se(t,".cache"):gt());return se(o,e)},Zr=e=>{if(e.length===0)return;const t=e.map(s=>go(xo(s)).split(dt));let o=Number.POSITIVE_INFINITY;for(const s of t)s.length<o&&(o=s.length);const r=[];for(let s=0;s<o;s+=1){const n=t[0][s];if(t.every(c=>c[s]===n))r.push(n);else break}const u=r.join(dt);return u===""?dt:u},st=(e,t)=>{if(e!==void 0)return t?(...o)=>se(e,...o):e},Vr=e=>{if(e?.files&&e.files.length>0){const t=Zr(e.files);if(t!==void 0)return t}return e?.cwd??ts()},Yr=e=>new vr(`No package.json found searching upwards from '${xo(e)}'.`),$t=e=>!St(e,po)&&St(e),Jr=(e,t)=>{if(rt.CACHE_DIR&&!["0","1","false","true"].includes(rt.CACHE_DIR)){const c=se(rt.CACHE_DIR,e);return t?.create&&$e(c),st(c,t?.thunk)}const o=Vr(t),r=Ys("package.json",{cwd:o,type:"file"});if(!r){if(t?.useGlobalCacheFallback){const c=eo(e);return t.create&&$e(c),st(c,t.thunk)}if(t?.throwError)throw Yr(o);return}const u=se(Ot(r),"node_modules"),s=se(u,".cache"),n=se(s,e);if(St(n,po))return t?.create&&$e(n),st(n,t?.thunk);if($t(n)||$t(s)||$t(u)){if(t?.useGlobalCacheFallback){const c=eo(e);return t.create&&$e(c),st(c,t.thunk)}return}return t?.create&&$e(n),st(n,t?.thunk)},_o=Jr;class ht extends Error{chain;constructor(t,o,r){super(t,r),this.name=this.constructor.name,this.chain=o}}class en extends ht{constructor(t,o){const r=[...o,`${t} (re-enters)`].join(" → ");super(`Config cycle: ${r}`,o)}}class $o extends ht{filePath;removedKeys;constructor(t,o,r){const u=[`${t} uses removed keys.`,""];for(const s of r){const n=s.location?` (at ${s.location})`:"";u.push(` • ${s.name}${n} → renamed to \`${s.renamedTo}\``);for(const c of s.children??[])u.push(` ↳ ${c.name} → renamed to \`${c.renamedTo}\``)}u.push("","Run `vis migrate self` to auto-rewrite the config (use --dry-run to preview)."),super(u.join(`
|
|
15
|
+
`),o),this.filePath=t,this.removedKeys=r}}class to extends ht{constructor(t,o,r){const u=r instanceof Error?r.message:String(r),s=o.length>0?`
|
|
16
|
+
Chain: ${o.join(" → ")}`:"";super(`Failed to load ${t}: ${u}${s}`,o,{cause:r})}}const tn=e=>e.join(" → ");class kt extends ht{constructor(t,o,r){const u=o.length>0?o[o.length-1]:"<unknown>",s=r.length>0?`
|
|
17
|
+
Tried:
|
|
18
|
+
${r.join(`
|
|
19
|
+
`)}`:"";super(`Cannot resolve "${t}" extended from ${u}.${s}
|
|
20
|
+
Chain: ${tn(o)}`,o)}}const on=e=>{const t=[];if(Object.hasOwn(e,"targetDefaults")&&t.push({name:"targetDefaults",renamedTo:"tasks"}),Object.hasOwn(e,"taskRunnerOptions")&&t.push({name:"taskRunnerOptions",renamedTo:"taskRunner"}),Object.hasOwn(e,"taskDefaults")){const{taskDefaults:o}=e,r=[];if(Array.isArray(o))for(const[u,s]of o.entries())s&&typeof s=="object"&&(Object.hasOwn(s,"scope")&&r.push({location:`taskDefaults[${u}].scope`,name:"scope",renamedTo:"match"}),Object.hasOwn(s,"targets")&&r.push({location:`taskDefaults[${u}].targets`,name:"targets",renamedTo:"tasks"}));t.push({children:r.length>0?r:void 0,name:"taskDefaults",renamedTo:"scopedTasks"})}else if(Array.isArray(e.scopedTasks))for(const[o,r]of e.scopedTasks.entries())r&&typeof r=="object"&&(Object.hasOwn(r,"scope")&&t.push({location:`scopedTasks[${o}].scope`,name:"scope",renamedTo:"match"}),Object.hasOwn(r,"targets")&&t.push({location:`scopedTasks[${o}].targets`,name:"targets",renamedTo:"tasks"}));return t},sn=e=>Object.hasOwn(e,"targets")&&!Object.hasOwn(e,"tasks")?[{name:"targets",renamedTo:"tasks"}]:[],rn=(e,t,o)=>{if(!o||typeof o!="object")return;const r=on(o);if(r.length>0)throw new $o(e,t,r)},nn=(e,t,o)=>{if(!o||typeof o!="object")return;const r=sn(o);if(r.length>0)throw new $o(e,t,r)},ko=["vis.config.ts","vis.config.mts","vis.config.cts","vis.config.js","vis.config.mjs","vis.config.cjs"],un=new Set(ko),Co=["vis.task.ts","vis.task.mts","vis.task.cts","vis.task.js","vis.task.mjs","vis.task.cjs"],an=new Set(Co),Cn=2880,Ct={blockExoticSubdeps:!0,policies:{installScripts:{strict:!0},publisherChange:{ignoreAfter:43200,mode:"no-downgrade"}}},ln=e=>{if(!e)return{...Ct};const t=Ct.policies??{},o=e.policies??{},r={...t,...o};for(const u of Object.keys(t)){const s=t[u],n=o[u];s!==void 0&&n!==void 0&&(r[u]={...s,...n})}return{...Ct,...e,policies:r}},oo=e=>({...e,security:ln(e.security),update:{security:!0,target:"minor",...e.update}}),cn=e=>{let t;try{t=ro(e)}catch{return}const o=new Set(t.filter(r=>un.has(r)));for(const r of ko)if(o.has(r))return ee(e,r)},pn=e=>{let t;try{t=ro(e)}catch{return}const o=new Set(t.filter(r=>an.has(r)));for(const r of Co)if(o.has(r))return ee(e,r)},Bt=e=>so("sha256").update(Io(e)).digest("hex"),fn=e=>{const t=so("sha256"),o=[...e].sort();for(const r of o)t.update(r),t.update(":"),t.update(Bt(r)),t.update(`
|
|
21
|
+
`);return t.digest("hex")},hn=e=>{const t=ee(e,"node_modules");if(ye(t)){const r=ee(t,".cache","vis");return lt(r),ee(r,"vis-config-cache.json")}const o=_o("vis",{create:!0,cwd:e});return o?ee(o,"vis-config-cache.json"):void 0},gn=(e,t)=>{if(ye(e))try{const o=lo(e);if(o.hash===t)return o.config}catch{}},dn=(e,t,o)=>{try{lt(ct(e)),io(e,{config:o,hash:t})}catch{}},bn=e=>e===void 0?[]:Array.isArray(e)?e:[e],mn=(e,t,o)=>{if(uo(e))throw new kt(e,[...o,t],["Absolute paths in `extends` are not supported. Use a relative path or an npm package name."]);const r=[];if(e.startsWith("./")||e.startsWith("../")){const u=ct(t),s=ee(u,e);if(r.push(s),ye(s))return s;throw new kt(e,[...o,t],r)}try{return no(t).resolve(e)}catch{throw r.push(`require.resolve("${e}") from ${t}`),new kt(e,[...o,t],r)}},So=async(e,t,o)=>{const r=Bt(t),u=t.slice(t.lastIndexOf(".")),s=ee(ct(t),`.vis-config-tmp-${r}${u}`);Bo(t,s);let n;try{n=await e.import(s,{default:!0,try:!0})??{}}catch(c){throw new to(t,o,c)}finally{try{Mo(s)}catch{}}try{return(typeof n=="function"?await n()??{}:n)??{}}catch(c){throw new to(t,o,c)}},yn=(e,t)=>{const o={...e,...t};if(e.tasks||t.tasks){const r=new Set([...Object.keys(e.tasks??{}),...Object.keys(t.tasks??{})]),u={};for(const s of r)u[s]=Yo(e.tasks?.[s],t.tasks?.[s]);o.tasks=u}if((e.scopedTasks||t.scopedTasks)&&(o.scopedTasks=[...e.scopedTasks??[],...t.scopedTasks??[]]),(e.fileGroups||t.fileGroups)&&(o.fileGroups={...e.fileGroups,...t.fileGroups}),(e.taskGroups||t.taskGroups)&&(o.taskGroups={...e.taskGroups,...t.taskGroups}),e.security||t.security){const r=e.security?.policies??{},u=t.security?.policies??{},s={...r,...u};for(const n of Object.keys(r)){const c=r[n],f=u[n];c!==void 0&&f!==void 0&&(s[n]={...c,...f})}o.security={...e.security,...t.security,acceptedRisks:{...e.security?.acceptedRisks,...t.security?.acceptedRisks},policies:s}}return(e.update||t.update)&&(o.update={...e.update,...t.update}),(e.taskRunner||t.taskRunner)&&(o.taskRunner={...e.taskRunner,...t.taskRunner}),delete o.extends,o},wo=async(e,t,o,r,u,s)=>{if(r.has(t))throw new en(t,o);if(!u.has(t)){r.add(t);try{const n=await So(e,t,o);rn(t,o,n);const c=bn(n.extends);for(const f of c){const R=mn(f,t,o);await wo(e,R,[...o,t],r,u,s)}u.set(t,n),s.push(t)}finally{r.delete(t)}}},Sn=async(e,t)=>{let o;if(t?.explicitConfigPath){const A=uo(t.explicitConfigPath)?t.explicitConfigPath:ee(e,t.explicitConfigPath);if(!ye(A))throw new Error(`Cannot find config file at ${A}`);o=A}else o=cn(e);if(!o)return oo({});const r=ao(e,{fsCache:!1,moduleCache:!1}),u=new Set,s=new Map,n=[];await wo(r,o,[],u,s,n);const c=fn(n),f=hn(e);if(f){const A=gn(f,c);if(A)return A}let R={};for(const A of n)R=yn(R,s.get(A));const h=oo(R);return f&&dn(f,c,h),h},vn=e=>e.replaceAll(/[^\w.-]+/g,"_"),An=(e,t)=>{const o=ee(e,"node_modules"),r=vn(t);if(ye(o)){const s=ee(o,".cache","vis","task-configs");return lt(s),ee(s,`${r}.json`)}const u=_o("vis",{create:!0,cwd:e});return u?ee(u,"task-configs",`${r}.json`):void 0},Rn=(e,t)=>{if(ye(e))try{const o=lo(e);if(o.hash===t)return o.config}catch{}},En=(e,t,o)=>{try{lt(ct(e)),io(e,{config:o,hash:t})}catch{}},wn=async(e,t,o)=>{const r=pn(t);if(!r)return;const u=Bt(r),s=An(e,o);if(s){const R=Rn(s,u);if(R)return R}const n=ao(t,{fsCache:!1,moduleCache:!1}),c=await So(n,r,[]);nn(r,[],c);const f=c;return s&&En(s,u,f),f},On=e=>e,Nn=e=>e;export{Ct as C,_o as E,Qo as N,Sn as Z,lo as a,cn as b,Yo as c,Co as h,wn as i,pn as j,oo as k,ko as m,On as o,Cn as q,Nn as r};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{createRequire as I}from"node:module";import C from"./index.js";import{VisReleaseError as u}from"../packem_shared/VisReleaseError-DMGRBTNO.js";const N=I(import.meta.url),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=c=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[t,s]=h.versions.node.split(".").map(Number);if(t>22||t===22&&s>=3||t===20&&s>=16)return h.getBuiltinModule(c)}return N(c)},{readFile:b,rename:A,readdir:x}=k("node:fs/promises"),{join:o,basename:L}=k("node:path");class m{constructor(t){this.runner=t}runner;async publishNative(t){throw new u({code:"CONFIG_INVALID",hint:'Set publish.publishStrategy back to "npm-publish-tarball" (the default), or use a package manager whose adapter implements native publish.',message:`publishStrategy "native" is not supported by the "${this.id}" adapter.`})}async readCatalogYaml(t){}}const f=(c,t)=>{if(c.exitCode===0)return{output:c.stdout,published:!0};const s=`${c.stdout}
|
|
2
|
+
${c.stderr}`;if(/EPUBLISHCONFLICT|cannot publish over the previously published versions|forbidden.*409/i.test(s))return{alreadyPublished:!0,output:s,published:!1};throw new u({code:"PUBLISH_FAILED",message:`${t} failed: ${s}`})};class g extends m{id="npm";minVersion="11.5.1";async pack(t){const s=["pack","--json"];t.destination&&s.push("--pack-destination",t.destination);const e=await this.runner.run("npm",s,{cwd:t.cwd,silent:!0});if(e.exitCode!==0)throw new u({code:"PUBLISH_FAILED",message:`npm pack failed: ${e.stderr||e.stdout}`});const a=JSON.parse(e.stdout),n=a[0]?.filename;if(!n)throw new u({code:"PUBLISH_FAILED",hint:"Upgrade npm to a version that emits --json output, or report this with the raw stdout.",message:`npm pack: could not parse output: ${e.stdout}`});const r=t.destination??t.cwd;let i=o(r,n);return t.filename&&(await(await import("node:fs/promises")).rename(i,o(r,t.filename)),i=o(r,t.filename)),{raw:a,tarball:i}}async installLockfileOnly(t){const s=await this.runner.run("npm",["install","--package-lock-only"],{cwd:t.cwd,silent:t.silent});if(s.exitCode!==0)throw new u({code:"CONFIG_INVALID",message:`npm install --package-lock-only failed: ${s.stderr||s.stdout}`})}async listWorkspacePackages(t){const s=await this.runner.run("npm",["query",".workspace","--json"],{cwd:t,silent:!0});if(s.exitCode!==0)return[];try{return JSON.parse(s.stdout).filter(e=>typeof e.name=="string").map(e=>({name:e.name,path:e.path??e.location??t,private:e.private??!1,version:e.version??"0.0.0"}))}catch{return[]}}async publish(t){const s=t.stage?["stage","publish",t.tarball]:["publish",t.tarball];t.tag&&s.push("--tag",t.tag),t.access&&s.push("--access",t.access),t.registry&&s.push("--registry",t.registry),t.otp&&s.push("--otp",t.otp),t.provenance&&s.push("--provenance"),t.stage&&s.push("--json");for(const n of t.extraArgs??[])s.push(n);const e=await this.runner.run("npm",s,{cwd:process.cwd(),silent:!0});if(e.exitCode===0){const n={output:e.stdout,published:!0};if(t.stage)try{const r=JSON.parse(e.stdout);n.stageId=r.id??r.stageId}catch{}return n}const a=`${e.stdout}
|
|
3
|
+
${e.stderr}`;if(/EPUBLISHCONFLICT|cannot publish over the previously published versions|forbidden.*409/i.test(a))return{alreadyPublished:!0,output:a,published:!1};throw new u({code:"PUBLISH_FAILED",message:`npm publish failed: ${a}`})}async publishNative(t){const s=["publish"];t.tag&&s.push("--tag",t.tag),t.access&&s.push("--access",t.access),t.registry&&s.push("--registry",t.registry),t.otp&&s.push("--otp",t.otp),t.provenance&&s.push("--provenance");for(const a of t.extraArgs??[])s.push(a);const e=await this.runner.run("npm",s,{cwd:t.cwd,silent:!0});return f(e,"npm publish")}async detectVersion(t){const s=await this.runner.run("npm",["--version"],{cwd:t,silent:!0});return s.exitCode===0?s.stdout.trim():void 0}}class S extends m{id="bun";minVersion="1.1.36";async pack(t){const s=["pm","pack"];t.destination&&s.push("--destination",t.destination);const e=await this.runner.run("bun",s,{cwd:t.cwd,silent:!0});if(e.exitCode!==0)throw new u({code:"PUBLISH_FAILED",message:`bun pm pack failed: ${e.stderr||e.stdout}`});const a=/(?:^|["'\s])([^\s"']*\.tgz)/m.exec(e.stdout),n=t.destination??t.cwd;let r;if(a?.[1]){const i=a[1];r=i.startsWith("/")?i:o(n,i)}else{const i=JSON.parse(await b(o(t.cwd,"package.json"),"utf8")),d=(i.name??"package").replaceAll("/","-").replace(/^@/,"");r=o(n,`${d}-${i.version??"0.0.0"}.tgz`)}if(t.filename&&L(r)!==t.filename){const i=o(n,t.filename);await A(r,i),r=i}return{raw:e.stdout,tarball:r}}async installLockfileOnly(t){const s=await this.runner.run("bun",["install","--lockfile-only"],{cwd:t.cwd,silent:t.silent});if(s.exitCode!==0)throw new u({code:"CONFIG_INVALID",message:`bun install --lockfile-only failed: ${s.stderr||s.stdout}`})}async listWorkspacePackages(t){try{const s=JSON.parse(await b(o(t,"package.json"),"utf8")),e=Array.isArray(s.workspaces)?s.workspaces:s.workspaces?.packages??[];if(e.length===0)return[];const a=new Set,n=["."],r=5,i=new Set;for(;n.length>0;){const p=n.shift();if(i.has(p)||(i.add(p),(p==="."?0:p.split("/").length)>r))continue;let w;try{w=await x(o(t,p),{withFileTypes:!0})}catch{continue}for(const l of w){if(!l.isDirectory()||l.name==="node_modules"||l.name.startsWith("."))continue;const y=p==="."?l.name:`${p}/${l.name}`;e.some(v=>C(v,y))&&a.add(y),n.push(y)}}const d=[];for(const p of a){const w=o(t,p,"package.json");try{const l=JSON.parse(await b(w,"utf8"));if(typeof l.name!="string")continue;d.push({name:l.name,path:o(t,p),private:l.private??!1,version:l.version??"0.0.0"})}catch{}}return d}catch{return[]}}async publish(t){return new g(this.runner).publish(t)}async publishNative(t){const s=["publish"];t.tag&&s.push("--tag",t.tag),t.access&&s.push("--access",t.access),t.registry&&s.push("--registry",t.registry);for(const a of t.extraArgs??[])s.push(a);const e=await this.runner.run("bun",s,{cwd:t.cwd,silent:!0});return f(e,"bun publish")}async detectVersion(t){const s=await this.runner.run("bun",["--version"],{cwd:t,silent:!0});return s.exitCode===0?s.stdout.trim():void 0}}class _ extends m{id="pnpm";minVersion="9.5.0";async pack(t){const s=["pack","--json"];t.destination&&s.push("--pack-destination",t.destination);const e=await this.runner.run("pnpm",s,{cwd:t.cwd,silent:!0});if(e.exitCode!==0)throw new u({code:"PUBLISH_FAILED",message:`pnpm pack failed: ${e.stderr||e.stdout}`});const a=JSON.parse(e.stdout),{filename:n}=a;if(!n)throw new u({code:"PUBLISH_FAILED",message:`pnpm pack: could not parse output: ${e.stdout}`});const r=t.destination??t.cwd;let i=n.startsWith("/")?n:o(r,n);return t.filename&&(await(await import("node:fs/promises")).rename(i,o(r,t.filename)),i=o(r,t.filename)),{raw:a,tarball:i}}async installLockfileOnly(t){const s=await this.runner.run("pnpm",["install","--lockfile-only"],{cwd:t.cwd,silent:t.silent});if(s.exitCode!==0)throw new u({code:"CONFIG_INVALID",message:`pnpm install --lockfile-only failed: ${s.stderr||s.stdout}`})}async listWorkspacePackages(t){const s=await this.runner.run("pnpm",["-r","ls","--depth","-1","--json"],{cwd:t,silent:!0});if(s.exitCode!==0)return[];try{return JSON.parse(s.stdout).filter(e=>typeof e.name=="string").map(e=>({name:e.name,path:e.path??t,private:e.private??!1,version:e.version??"0.0.0"}))}catch{return[]}}async publish(t){return new g(this.runner).publish(t)}async publishNative(t){const s=["publish","--no-git-checks"];t.tag&&s.push("--tag",t.tag),t.access&&s.push("--access",t.access),t.registry&&s.push("--registry",t.registry),t.otp&&s.push("--otp",t.otp),t.provenance&&s.push("--provenance");for(const a of t.extraArgs??[])s.push(a);const e=await this.runner.run("pnpm",s,{cwd:t.cwd,silent:!0});return f(e,"pnpm publish")}async detectVersion(t){const s=await this.runner.run("pnpm",["--version"],{cwd:t,silent:!0});return s.exitCode===0?s.stdout.trim():void 0}async readCatalogYaml(t){const s=await import("node:fs/promises");try{return await s.readFile(o(t,"pnpm-workspace.yaml"),"utf8")}catch{return}}}class O extends m{id="yarn";minVersion="4.0.0";async pack(t){const s=t.destination??t.cwd,e=t.filename??"%s-%v.tgz",a=["pack","--out",o(s,e)],n=await this.runner.run("yarn",a,{cwd:t.cwd,silent:!0});if(n.exitCode!==0)throw new u({code:"PUBLISH_FAILED",message:`yarn pack failed: ${n.stderr||n.stdout}`});const r=await import("node:fs/promises"),i=await import("node:path"),d=JSON.parse(await r.readFile(i.join(t.cwd,"package.json"),"utf8")),p=e.replaceAll("%s",(d.name??"package").replaceAll("/","-").replace(/^@/,"")).replaceAll("%v",d.version??"0.0.0");return{raw:n.stdout,tarball:o(s,p)}}async installLockfileOnly(t){const s=await this.runner.run("yarn",["install","--mode","update-lockfile"],{cwd:t.cwd,silent:t.silent});if(s.exitCode!==0)throw new u({code:"CONFIG_INVALID",message:`yarn install --mode update-lockfile failed: ${s.stderr||s.stdout}`})}async listWorkspacePackages(t){const s=await this.runner.run("yarn",["workspaces","list","--json"],{cwd:t,silent:!0});if(s.exitCode!==0)return[];const e=[];for(const a of s.stdout.split(/\r?\n/)){const n=a.trim();if(n)try{const r=JSON.parse(n);if(typeof r.name!="string"||r.name==="")continue;e.push({name:r.name,path:r.location?o(t,r.location):t,private:!1,version:"0.0.0"})}catch{}}return e}async publish(t){return new g(this.runner).publish(t)}async publishNative(t){const s=["npm","publish"];t.tag&&s.push("--tag",t.tag),t.access&&s.push("--access",t.access),t.provenance&&s.push("--provenance");for(const a of t.extraArgs??[])s.push(a);const e=await this.runner.run("yarn",s,{cwd:t.cwd,silent:!0});return f(e,"yarn npm publish")}async detectVersion(t){const s=await this.runner.run("yarn",["--version"],{cwd:t,silent:!0});return s.exitCode===0?s.stdout.trim():void 0}}const F=async(c,t)=>{const s=await import("node:fs/promises"),e=await import("node:path");try{const n=JSON.parse(await s.readFile(e.join(c,"package.json"),"utf8"));if(typeof n.packageManager=="string"){const r=n.packageManager.indexOf("@"),i=r>0?n.packageManager.slice(0,r):n.packageManager;if(i==="pnpm"||i==="yarn"||i==="bun"||i==="npm")return i}}catch{}const a=async n=>{try{return await s.access(e.join(c,n)),!0}catch{return!1}};return await a("bun.lock")||await a("bun.lockb")?"bun":await a("pnpm-lock.yaml")?"pnpm":await a("yarn.lock")?"yarn":"npm"},D=(c,t)=>{switch(c){case"bun":return new S(t);case"pnpm":return new _(t);case"yarn":return new O(t);default:return new g(t)}};export{g as N,D as c,F as d};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import{createRequire as f}from"node:module";const y=f(import.meta.url),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=o=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[e,t]=d.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return d.getBuiltinModule(o)}return y(o)},{basename:$}=w("node:path"),O=o=>{const e=[],t=[];for(const s of o??[]){if(typeof s=="string"){e.push(s);continue}if(s.path){const r=s.label??s.name;e.push(r?`${s.path}#${r}`:s.path)}else if(s.linkUrl){const r=s.label??s.name??s.linkUrl;t.push(`- [${r}](${s.linkUrl})`)}}return{linkAppendix:t.length>0?`
|
|
2
|
+
|
|
3
|
+
### Additional links
|
|
4
|
+
|
|
5
|
+
${t.join(`
|
|
6
|
+
`)}`:"",paths:e}},x=(o,e)=>{if(o!==0)return[];try{return JSON.parse(e).filter(t=>typeof t.body=="string").map(t=>({body:t.body??"",id:t.id}))}catch{return[]}};class C{id="github";host;httpProxy;constructor(e={}){this.host=e.host,this.httpProxy=e.httpProxy}runOpts(e){if(!this.host&&!this.httpProxy)return{cwd:e,silent:!0};const t={...process.env};return this.host&&(t.GH_HOST=this.host),this.httpProxy&&(t.HTTPS_PROXY=this.httpProxy,t.HTTP_PROXY=this.httpProxy),{cwd:e,env:t,silent:!0}}async listRecentReleases(e,t){const s=Math.max(1,t.limit),r=t.tagPrefix?Math.min(100,s*4):s,n=await e.run("gh",["release","list","--repo",t.repo,"--limit",String(r),"--json","tagName,url,name"],this.runOpts(t.cwd));if(n.exitCode!==0)return[];let i;try{i=JSON.parse(n.stdout)}catch{return[]}const a=[];for(const u of i)if(!(typeof u.tagName!="string"||typeof u.url!="string")&&!(t.tagPrefix&&!u.tagName.startsWith(t.tagPrefix))&&!(t.excludeTag&&u.tagName===t.excludeTag)&&(a.push({name:u.name??u.tagName,tag:u.tagName,url:u.url}),a.length>=s))break;return a}async detectRepoSlug(e,t){const s=await t.run("gh",["repo","view","--json","nameWithOwner","-q",".nameWithOwner"],this.runOpts(e));if(s.exitCode===0)return s.stdout.trim()||void 0}detectPullRequestNumber(e){const t=e.GITHUB_REF;if(t){const r=/^refs\/pull\/(\d+)\/(?:merge|head)$/.exec(t);if(r?.[1])return Number.parseInt(r[1],10)}const s=e.PR_NUMBER??e.VIS_PR_NUMBER;if(s){const r=Number.parseInt(s,10);return Number.isNaN(r)?void 0:r}}async upsertStickyComment(e,t){const s=await e.run("gh",["api",`repos/${t.repo}/issues/${t.issueNumber}/comments`,"--paginate"],this.runOpts(t.cwd)),r=x(s.exitCode,s.stdout).find(a=>a.body.includes(t.marker)),n=t.body.includes(t.marker)?t.body:`${t.marker}
|
|
7
|
+
${t.body}`;if(r)return(await e.run("gh",["api","-X","PATCH",`repos/${t.repo}/issues/comments/${r.id}`,"-f",`body=${n}`],this.runOpts(t.cwd))).exitCode===0?{created:!1,id:r.id}:void 0;const i=await e.run("gh",["api","-X","POST",`repos/${t.repo}/issues/${t.issueNumber}/comments`,"-f",`body=${n}`],this.runOpts(t.cwd));if(i.exitCode===0)try{return{created:!0,id:JSON.parse(i.stdout).id}}catch{return}}async createRelease(e,t){const{linkAppendix:s,paths:r}=O(t.assets),n=s?`${t.body}${s}`:t.body,i=["release","create",t.tag,"--repo",t.repo,"--title",t.title,"--notes",n];t.draft&&i.push("--draft"),t.prerelease&&i.push("--prerelease"),t.discussionCategory&&i.push("--discussion-category",t.discussionCategory),r.length>0&&i.push(...r);const a=await e.run("gh",i,this.runOpts(t.cwd));if(a.exitCode===0)return{url:a.stdout.trim()||void 0}}async addLabels(e,t){if(t.labels.length===0)return!0;const s=["api","-X","POST",`repos/${t.repo}/issues/${t.issueNumber}/labels`];for(const r of t.labels)s.push("-f",`labels[]=${r}`);return(await e.run("gh",s,this.runOpts(t.cwd))).exitCode===0}async upsertIssue(e,t){const s=await e.run("gh",["issue","list","--repo",t.repo,"--state","open","--search",t.marker,"--json","number,title,url","--limit","20"],this.runOpts(t.cwd));if(s.exitCode===0&&s.stdout.trim()&&s.stdout.trim()!=="[]")try{const u=JSON.parse(s.stdout).find(c=>c.title.includes(t.marker));if(u){const c=["issue","edit",String(u.number),"--repo",t.repo,"--title",t.title,"--body",t.body];return t.labels&&t.labels.length>0&&c.push("--add-label",t.labels.join(",")),t.assignees&&t.assignees.length>0&&c.push("--add-assignee",t.assignees.join(",")),(await e.run("gh",c,this.runOpts(t.cwd))).exitCode===0?{created:!1,number:u.number,url:u.url}:void 0}}catch{}const r=["issue","create","--repo",t.repo,"--title",t.title,"--body",t.body];t.labels&&t.labels.length>0&&r.push("--label",t.labels.join(",")),t.assignees&&t.assignees.length>0&&r.push("--assignee",t.assignees.join(","));const n=await e.run("gh",r,this.runOpts(t.cwd));if(n.exitCode!==0)return;const i=n.stdout.trim(),a=/\/issues\/(\d+)/.exec(i);return a?{created:!0,number:Number.parseInt(a[1]??"0",10),url:i}:void 0}async closeIssue(e,t){return t.closingComment&&await e.run("gh",["issue","comment",String(t.issueNumber),"--repo",t.repo,"--body",t.closingComment],this.runOpts(t.cwd)),(await e.run("gh",["issue","close",String(t.issueNumber),"--repo",t.repo],this.runOpts(t.cwd))).exitCode===0}async upsertPullRequest(e,t){const s=await e.run("gh",["pr","list","--repo",t.repo,"--head",t.head,"--state","open","--json","number,url"],this.runOpts(t.cwd));if(s.exitCode===0&&s.stdout.trim()&&s.stdout.trim()!=="[]")try{const i=JSON.parse(s.stdout);if(i[0])return await e.run("gh",["pr","edit",String(i[0].number),"--repo",t.repo,"--title",t.title,"--body",t.body],this.runOpts(t.cwd)),{existing:!0,number:i[0].number,url:i[0].url}}catch{}const r=await e.run("gh",["pr","create","--repo",t.repo,"--head",t.head,"--base",t.base,"--title",t.title,"--body",t.body],this.runOpts(t.cwd));if(r.exitCode!==0)return;const n=/\/pull\/(\d+)/.exec(r.stdout);return n?{existing:!1,number:Number.parseInt(n[1]??"0",10),url:r.stdout.trim()}:void 0}}const p=o=>encodeURIComponent(o),P=o=>o.replace(/^v(?=\d)/,""),N=o=>{const e=[],t=[],s=[];for(const r of o??[]){if(typeof r=="string"){e.push(r);continue}r.path?r.target==="generic_package"?s.push({label:r.label,linkType:r.type,name:r.name,packageName:r.packageName,packageVersion:r.packageVersion,path:r.path}):e.push(r.path):r.linkUrl&&t.push({linkType:r.type,name:r.label??r.name??r.linkUrl,url:r.linkUrl})}return{genericPackages:s,links:t,uploads:e}};class b{id="gitlab";static recentReleasesWarned=!1;async listRecentReleases(e,t){return b.recentReleasesWarned||(b.recentReleasesWarned=!0,console.warn("[vis release] addReleases is not yet supported on GitLab — skipping the Related releases block.")),[]}host;httpProxy;constructor(e={}){this.host=e.host,this.httpProxy=e.httpProxy}runOpts(e){if(!this.host&&!this.httpProxy)return{cwd:e,silent:!0};const t={...process.env};return this.host&&(t.GITLAB_HOST=this.host),this.httpProxy&&(t.HTTPS_PROXY=this.httpProxy,t.HTTP_PROXY=this.httpProxy),{cwd:e,env:t,silent:!0}}async listMrNotes(e,t,s,r){const n=await e.run("glab",["api",`projects/${p(s)}/merge_requests/${r}/notes`,"--paginate"],this.runOpts(t));if(n.exitCode!==0)return[];try{return JSON.parse(n.stdout).filter(i=>typeof i.body=="string"&&i.system!==!0).map(i=>({body:i.body??"",id:i.id}))}catch{return[]}}async uploadGenericPackage(e,t,s,r,n){const i=p(s),a=$(n.path),u=n.packageName??s.split("/").pop()??"release",c=n.packageVersion??P(r),l=`projects/${i}/packages/generic/${encodeURIComponent(u)}/${encodeURIComponent(c)}/${encodeURIComponent(a)}`;if((await e.run("glab",["api","-X","PUT",l,"--input",n.path],this.runOpts(t))).exitCode!==0)return;const h=this.host?.replace(/^https?:\/\//i,"").replace(/\/+$/,""),g=`${h?`https://${h}`:"https://gitlab.com"}/api/v4/${l}`,m=["api","-X","POST",`projects/${i}/releases/${encodeURIComponent(r)}/assets/links`,"-f",`name=${n.label??n.name??a}`,"-f",`url=${g}`];n.linkType&&m.push("-f",`link_type=${n.linkType}`),await e.run("glab",m,this.runOpts(t))}async detectRepoSlug(e,t){const s=process.env.CI_PROJECT_PATH;if(s)return s;const r=await t.run("git",["config","--get","remote.origin.url"],{cwd:e,silent:!0});if(r.exitCode!==0)return;const n=r.stdout.trim();return/gitlab\.[\w.-]+[/:]([^/].*?)(?:\.git)?$/.exec(n)?.[1]}detectPullRequestNumber(e){const t=e.CI_MERGE_REQUEST_IID??e.VIS_MR_NUMBER;if(!t)return;const s=Number.parseInt(t,10);return Number.isNaN(s)?void 0:s}async upsertStickyComment(e,t){const s=(await this.listMrNotes(e,t.cwd,t.repo,t.issueNumber)).find(a=>a.body.includes(t.marker)),r=t.body.includes(t.marker)?t.body:`${t.marker}
|
|
8
|
+
${t.body}`,n=p(t.repo);if(s)return(await e.run("glab",["api","-X","PUT",`projects/${n}/merge_requests/${t.issueNumber}/notes/${s.id}`,"-f",`body=${r}`],this.runOpts(t.cwd))).exitCode===0?{created:!1,id:s.id}:void 0;const i=await e.run("glab",["api","-X","POST",`projects/${n}/merge_requests/${t.issueNumber}/notes`,"-f",`body=${r}`],this.runOpts(t.cwd));if(i.exitCode===0)try{return{created:!0,id:JSON.parse(i.stdout).id}}catch{return}}async createRelease(e,t){const{genericPackages:s,links:r,uploads:n}=N(t.assets),i=["release","create",t.tag,"--repo",t.repo,"--name",t.title,"--notes",t.body];if(t.milestones&&t.milestones.length>0)for(const c of t.milestones)i.push("--milestone",c);if((await e.run("glab",i,this.runOpts(t.cwd))).exitCode!==0)return;n.length>0&&await e.run("glab",["release","upload",t.tag,"--repo",t.repo,...n],this.runOpts(t.cwd));const a=p(t.repo);for(const c of r){const l=["api","-X","POST",`projects/${a}/releases/${encodeURIComponent(t.tag)}/assets/links`,"-f",`name=${c.name}`,"-f",`url=${c.url}`];c.linkType&&l.push("-f",`link_type=${c.linkType}`),await e.run("glab",l,this.runOpts(t.cwd))}for(const c of s)await this.uploadGenericPackage(e,t.cwd,t.repo,t.tag,c);const u=await e.run("glab",["api",`projects/${a}/releases/${encodeURIComponent(t.tag)}`],this.runOpts(t.cwd));try{return{url:JSON.parse(u.stdout)._links?.self}}catch{return{url:void 0}}}async addLabels(e,t){if(t.labels.length===0)return!0;const s=p(t.repo);return(await e.run("glab",["api","-X","PUT",`projects/${s}/issues/${t.issueNumber}`,"-f",`add_labels=${t.labels.join(",")}`],this.runOpts(t.cwd))).exitCode===0}async upsertIssue(e,t){const s=p(t.repo),r=await e.run("glab",["api",`projects/${s}/issues?state=opened&search=${encodeURIComponent(t.marker)}&in=title`],this.runOpts(t.cwd));if(r.exitCode===0)try{const c=JSON.parse(r.stdout).find(l=>l.title.includes(t.marker));if(c){const l=["api","-X","PUT",`projects/${s}/issues/${c.iid}`,"-f",`title=${t.title}`,"-f",`description=${t.body}`];if(t.labels&&t.labels.length>0&&l.push("-f",`add_labels=${t.labels.join(",")}`),t.assignees?.[0]){const h=await e.run("glab",["api",`users?username=${encodeURIComponent(t.assignees[0])}`],this.runOpts(t.cwd));try{const g=JSON.parse(h.stdout);g[0]&&l.push("-f",`assignee_id=${g[0].id}`)}catch{}}return(await e.run("glab",l,this.runOpts(t.cwd))).exitCode===0?{created:!1,number:c.iid,url:c.web_url}:void 0}}catch{}const n=["issue","create","--repo",t.repo,"--title",t.title,"--description",t.body,"--yes"];t.labels&&t.labels.length>0&&n.push("--label",t.labels.join(",")),t.assignees?.[0]&&n.push("--assignee",t.assignees[0]);const i=await e.run("glab",n,this.runOpts(t.cwd));if(i.exitCode!==0)return;const a=i.stdout.trim(),u=/\/issues\/(\d+)/.exec(a);return u?{created:!0,number:Number.parseInt(u[1]??"0",10),url:a}:void 0}async closeIssue(e,t){if(t.closingComment){const s=p(t.repo);await e.run("glab",["api","-X","POST",`projects/${s}/issues/${t.issueNumber}/notes`,"-f",`body=${t.closingComment}`],this.runOpts(t.cwd))}return(await e.run("glab",["issue","close",String(t.issueNumber),"--repo",t.repo],this.runOpts(t.cwd))).exitCode===0}async upsertPullRequest(e,t){const s=p(t.repo),r=await e.run("glab",["api",`projects/${s}/merge_requests?state=opened&source_branch=${encodeURIComponent(t.head)}&target_branch=${encodeURIComponent(t.base)}`],this.runOpts(t.cwd));if(r.exitCode===0)try{const u=JSON.parse(r.stdout);if(u[0])return(await e.run("glab",["api","-X","PUT",`projects/${s}/merge_requests/${u[0].iid}`,"-f",`title=${t.title}`,"-f",`description=${t.body}`],this.runOpts(t.cwd))).exitCode===0?{existing:!0,number:u[0].iid,url:u[0].web_url}:void 0}catch{}const n=await e.run("glab",["mr","create","--repo",t.repo,"--source-branch",t.head,"--target-branch",t.base,"--title",t.title,"--description",t.body,"--yes"],this.runOpts(t.cwd));if(n.exitCode!==0)return;const i=n.stdout.trim(),a=/\/merge_requests\/(\d+)/.exec(i);return a?{existing:!1,number:Number.parseInt(a[1]??"0",10),url:i}:void 0}}const R=o=>{if(o.GITHUB_ACTIONS==="true"||o.GITHUB_REPOSITORY)return"github";if(o.GITLAB_CI==="true"||o.CI_PROJECT_PATH)return"gitlab"},k=o=>{const e=o.trim();if(e!==""){if(!e.includes("://")){const t=e.indexOf(":"),s=e.indexOf("/");if(t>0&&(s===-1||t<s)){const r=e.slice(0,t),n=r.lastIndexOf("@");return(n===-1?r:r.slice(n+1)).toLowerCase()||void 0}return}try{return new URL(e).hostname.toLowerCase()||void 0}catch{return}}},_=async(o,e)=>{const t=await e.run("git",["config","--get","remote.origin.url"],{cwd:o,silent:!0});if(t.exitCode!==0)return;const s=k(t.stdout);if(s){if(s==="github.com"||s.endsWith(".github.com"))return"github";if(s==="gitlab.com"||s.startsWith("gitlab."))return"gitlab"}},I=async(o,e,t,s=process.env)=>R(s)??await _(o,e)??"github",S=(o,e={})=>o==="gitlab"?new b({host:e.gitlabHost,httpProxy:e.httpProxy}):new C({host:e.githubHost,httpProxy:e.httpProxy});export{S as createRemoteClient,I as detectRemoteProvider};
|