@visulima/vis 1.0.0-alpha.4 → 1.0.0-alpha.40
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 +1216 -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 +3258 -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 +2 -0
- package/dist/packem_chunks/handler31.js +2 -0
- package/dist/packem_chunks/handler32.js +2 -0
- package/dist/packem_chunks/handler33.js +3 -0
- package/dist/packem_chunks/handler34.js +6 -0
- package/dist/packem_chunks/handler35.js +1 -0
- package/dist/packem_chunks/handler36.js +42 -0
- package/dist/packem_chunks/handler37.js +8 -0
- package/dist/packem_chunks/handler38.js +9 -0
- package/dist/packem_chunks/handler39.js +75 -0
- package/dist/packem_chunks/handler4.js +6 -0
- package/dist/packem_chunks/handler40.js +5 -0
- package/dist/packem_chunks/handler41.js +4 -0
- package/dist/packem_chunks/handler42.js +3 -0
- package/dist/packem_chunks/handler43.js +2 -0
- package/dist/packem_chunks/handler44.js +1 -0
- package/dist/packem_chunks/handler45.js +1 -0
- package/dist/packem_chunks/handler46.js +1 -0
- package/dist/packem_chunks/handler47.js +3 -0
- package/dist/packem_chunks/handler48.js +1 -0
- package/dist/packem_chunks/handler49.js +7 -0
- package/dist/packem_chunks/handler5.js +8 -0
- package/dist/packem_chunks/handler50.js +33 -0
- package/dist/packem_chunks/handler51.js +3 -0
- package/dist/packem_chunks/handler52.js +8 -0
- package/dist/packem_chunks/handler53.js +4 -0
- package/dist/packem_chunks/handler54.js +1 -0
- package/dist/packem_chunks/handler55.js +12 -0
- package/dist/packem_chunks/handler56.js +7 -0
- package/dist/packem_chunks/handler57.js +5 -0
- package/dist/packem_chunks/handler58.js +11 -0
- package/dist/packem_chunks/handler59.js +3 -0
- package/dist/packem_chunks/handler6.js +1 -0
- package/dist/packem_chunks/handler60.js +22 -0
- package/dist/packem_chunks/handler61.js +61 -0
- package/dist/packem_chunks/handler62.js +3 -0
- package/dist/packem_chunks/handler63.js +6 -0
- package/dist/packem_chunks/handler64.js +708 -0
- package/dist/packem_chunks/handler65.js +24 -0
- package/dist/packem_chunks/handler66.js +25 -0
- package/dist/packem_chunks/handler67.js +153 -0
- package/dist/packem_chunks/handler68.js +10 -0
- package/dist/packem_chunks/handler69.js +24 -0
- package/dist/packem_chunks/handler7.js +1 -0
- package/dist/packem_chunks/handler70.js +322 -0
- package/dist/packem_chunks/handler71.js +48 -0
- package/dist/packem_chunks/handler72.js +27 -0
- package/dist/packem_chunks/handler73.js +3 -0
- package/dist/packem_chunks/handler74.js +190 -0
- package/dist/packem_chunks/handler75.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/createAdapter-bU4DIP3F.js +1 -0
- package/dist/packem_shared/createVersionActions-BK43SNDH.js +1 -0
- package/dist/packem_shared/cyclonedx-kYozDyxp.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-BDmTbWX1.js +19 -0
- package/dist/packem_shared/index-CgcF6_wo.js +1 -0
- package/dist/packem_shared/index-Du8RWawQ.js +1 -0
- package/dist/packem_shared/index-yBikBkHT.js +30 -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-OGResYrA.js +1 -0
- package/dist/packem_shared/provenance-_CJjMKwu.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-CMDl55Nz.js +5 -0
- package/dist/packem_shared/runtime-check-Stc9AI78.js +1 -0
- package/dist/packem_shared/s1ngularity-Dhr3bPk0.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-C730vkyK.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 +6377 -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 d,E as i,I as y}from"../packem_shared/Table-CcVkyULl-B_ef6zfS.js";import{p as a}from"./bin.js";import{r as l,g as h}from"../packem_shared/advisories-DLeO5KMN.js";const p=r=>{if(r===0)return"0 B";const n=["B","KB","MB","GB"],t=Math.min(Math.floor(Math.log(r)/Math.log(1024)),n.length-1),o=r/1024**t;return`${o.toFixed(o<10&&t>0?1:0)} ${n[t]}`},v=r=>{if(!r)return"never";const n=Date.parse(r);if(Number.isNaN(n))return r;const t=Date.now()-n;if(t<0)return r;const o=Math.floor(t/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`},g=async({logger:r,options:n,workspaceRoot:t})=>{if(!t)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const o=n.db??l(t),s=await h(t,o);if(n.format==="json"){process.stdout.write(`${JSON.stringify({dbPath:o,ecosystems:s.ecosystems.map(e=>({advisoryCount:e.advisoryCount,lastSyncIso:e.lastSyncIso,manifestEtag:e.manifestEtag??null,name:e.name})),exists:s.exists,schemaVersion:s.schemaVersion,sizeBytes:s.sizeBytes},void 0,2)}
|
|
2
|
+
`);return}if(a.info(`DB: ${o}`),!s.exists){a.warn(`No advisory DB yet. Run ${d("vis advisories sync")} to populate.`);return}if(a.info(`Schema: v${s.schemaVersion} Size: ${p(s.sizeBytes)}`),s.ecosystems.length===0){a.warn("DB exists but contains no ecosystems. Run `vis advisories sync`.");return}a.info(""),a.info("Ecosystem Advisories Last sync ETag"),a.info(i("────────── ────────── ───────────────── ──────"));for(const e of s.ecosystems){const c=e.name.padEnd(10),f=e.advisoryCount.toLocaleString().padStart(10),m=`${e.lastSyncIso||"never"} (${v(e.lastSyncIso)})`.padEnd(19),u=e.manifestEtag??i("—");a.info(`${y(c)} ${f} ${m} ${u}`)}},S=g;export{S as advisoriesStatusExecute};
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const p="<!-- vis-release-success -->",k=["released"],v=`${p}
|
|
2
|
+
:tada: This issue has been resolved in version {version} :tada:
|
|
3
|
+
|
|
4
|
+
The release is available on [GitHub release]({url}).
|
|
5
|
+
|
|
6
|
+
Your **[vis](https://github.com/visulima/visulima)** release pipeline shipped this. :rocket:`,C=(s,e)=>{const t=new Set,n=/(?:^|[\s(,;:!?])#(\d+)/g;let r;for(;(r=n.exec(s))!==null;){const a=Number.parseInt(r[1],10);Number.isFinite(a)&&a>0&&t.add(a)}const o=/\bgh-(\d+)/gi;for(;(r=o.exec(s))!==null;){const a=Number.parseInt(r[1],10);Number.isFinite(a)&&a>0&&t.add(a)}const u=/https?:\/\/([^\s/]+)\/([^\s)]*?)\/(?:pull|issues|merge_requests)\/(\d+)/gi;for(;(r=u.exec(s))!==null;){const a=Number.parseInt(r[3],10);if(Number.isFinite(a)&&a>0){if(e){const l=(r[2]??"").replaceAll(/^\/+|\/+$/g,"").replace(/\/-$/,""),m=e.replaceAll(/^\/+|\/+$/g,"");if(l.toLowerCase()!==m.toLowerCase())continue}t.add(a)}}return[...t].sort((a,l)=>a-l)},$=(s,e)=>{let t=s;if(e.url)t=t.replaceAll("{url}",e.url);else{const n=`${e.name}@${e.version}`;t=t.replaceAll(/\[[^\]]*\]\(\{url\}\)/g,n),t=t.replaceAll("{url}",n)}return t.replaceAll("{version}",e.version).replaceAll("{name}",e.name).replaceAll("{tag}",e.tag)},L=s=>{const e=s.config.successWalk??{};return{commentBody:e.commentBody??v,enabled:e.enabled!==!1,labels:e.labels??k,skipPrerelease:e.skipPrerelease!==!1}},N=async(s,e,t,n)=>{const r=new Set,o=new Map,u=new Date().toISOString().slice(0,10);for(const a of e.published){const l=s.plan.releases.find(c=>c.name===a.name);if(!l)continue;let m;try{m=await t({changeFiles:l.changeFiles,date:u,release:l,target:"github-release"})}catch{continue}const d=[m,...l.changeFiles.map(c=>c.body)].join(`
|
|
7
|
+
`);for(const c of C(d,n))o.has(c)||o.set(c,l),r.add(c)}return{firstReleaseByRef:o,refs:[...r].sort((a,l)=>a-l)}},R=(s,e)=>s?e.published.find(t=>t.name===s.name)?.url??"":"",F=s=>{let e=0;const t=[],n=()=>{if(e>=s)return;const r=t.shift();r&&(e+=1,r())};return r=>new Promise((o,u)=>{const a=()=>{e-=1,n()},l=()=>{r().then(o,u).finally(a)};t.push(l),n()})},W=s=>new Promise(e=>{setTimeout(e,s)}),_=s=>{if(!s||typeof s!="object")return!1;const e=s;return typeof e.status=="number"&&e.status===429||typeof e.statusCode=="number"&&e.statusCode===429?!0:typeof e.message=="string"?/\b429\b|rate[- ]?limit/i.test(e.message):!1},E=(s,e)=>{if(!s||typeof s!="object")return e;const t=s;if(typeof t.retryAfter=="number"&&Number.isFinite(t.retryAfter)&&t.retryAfter>=0)return Math.round(t.retryAfter*1e3);if(typeof t.message=="string"){const n=/Retry-After:\s*(\d+)/i.exec(t.message);if(n){const r=Number.parseInt(n[1],10);if(Number.isFinite(r)&&r>=0)return r*1e3}}return e},g=async(s,e=5e3)=>{try{return await s()}catch(t){if(!_(t))throw t;const n=E(t,e);return await W(n),s()}},x=async(s,e,t,n)=>{const r={commented:[],labeled:[],warnings:[]};if(s.config.successWalk===void 0)return r;const o=L(s);if(!o.enabled)return r;const u=!!s.channel?.prerelease||e.published.some(i=>i.version.includes("-"));if(o.skipPrerelease&&u||!n.repo)return r;const{firstReleaseByRef:a,refs:l}=await N(s,e,n.formatter,n.repo);if(l.length===0)return r;const m=s.channel?.tag??"",d=F(4),c=l.map(i=>d(async()=>{const f=a.get(i),y=f?.newVersion??e.published[0]?.version??"",w=f?.name??e.published[0]?.name??"",A=R(f,e),b=$(o.commentBody,{name:w,tag:m,url:A,version:y}),S=b.includes(p)?b:`${p}
|
|
8
|
+
${b}`;try{if(await g(()=>n.client.upsertStickyComment(t,{body:S,cwd:s.cwd,issueNumber:i,marker:p,repo:n.repo})))r.commented.push(i);else{r.warnings.push(`successWalk: upsertStickyComment returned undefined for #${i}; skipping label step.`);return}}catch(h){r.warnings.push(`successWalk: failed to comment on #${i}: ${h.message}`);return}if(o.labels.length!==0)try{await g(()=>n.client.addLabels(t,{cwd:s.cwd,issueNumber:i,labels:o.labels,repo:n.repo}))?r.labeled.push(i):r.warnings.push(`successWalk: addLabels returned false for #${i}; the labels may not have been applied.`)}catch(h){r.warnings.push(`successWalk: failed to label #${i}: ${h.message}`)}}));return await Promise.all(c),r.commented.sort((i,f)=>i-f),r.labeled.sort((i,f)=>i-f),r};export{v as DEFAULT_SUCCESS_WALK_COMMENT,k as DEFAULT_SUCCESS_WALK_LABELS,p as SUCCESS_WALK_MARKER,C as extractReferences,F as pLimit,x as walkSuccessfulRelease,g as withRateLimitRetry};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{E as g}from"../packem_shared/Table-CcVkyULl-B_ef6zfS.js";import{p as c}from"./bin.js";import{s as $}from"../packem_shared/scan-progress-CFhc0CMj.js";import{s as w,D as v}from"../packem_shared/advisories-DLeO5KMN.js";const S=t=>t?.security?.audit?.advisories??{},D=t=>t?t.split(",").map(r=>r.trim()).filter(r=>r.length>0):["npm"],b=async({logger:t,options:r,visConfig:h,workspaceRoot:d})=>{if(!d)throw new Error("Could not determine workspace root. Run this command inside a workspace.");const l=r.format==="json",u=S(h),m=r.source??u.source??v,p=D(r.ecosystem),y=p.map(s=>({id:s,label:`Sync ${s} advisories`})),n=$(y,{live:!l}),i=[];try{for(const s of p){n.start(s);const o=Date.now();try{const e=await w({allowedHosts:u.allowedHosts,dbPath:r.db,ecosystem:s,force:!!r.force,source:m,workspaceRoot:d});i.push({ecosystem:s,result:e}),e.upToDate?n.finish(s,"ok",`up to date · ${f(Date.now()-o)}`):n.finish(s,"ok",`${e.advisoriesIngested.toLocaleString()} advisories · ${f(e.durationMs)}`)}catch(e){const a=e instanceof Error?e.message:String(e);i.push({ecosystem:s,error:a}),n.finish(s,"error",a)}}}finally{n.stop()}if(l){const s={ecosystems:i.map(o=>({advisoriesIngested:o.result?.advisoriesIngested??0,dbPath:o.result?.dbPath??null,durationMs:o.result?.durationMs??0,ecosystem:o.ecosystem,error:o.error??null,upToDate:o.result?.upToDate??!1})),source:m};process.stdout.write(`${JSON.stringify(s,void 0,2)}
|
|
2
|
+
`)}else{const s=i.filter(a=>a.error),o=i.filter(a=>a.result),e=o[0];e?.result?.dbPath&&c.info(g(`DB: ${e.result.dbPath}`)),s.length===0?c.success(`Synced ${o.length} ecosystem${o.length===1?"":"s"}.`):c.error(`${s.length} ecosystem${s.length===1?"":"s"} failed to sync.`)}i.some(s=>s.error)&&(process.exitCode=1)},f=t=>t>=1e3?`${(t/1e3).toFixed(1)}s`:`${Math.round(t)}ms`,R=b;export{R as advisoriesSyncExecute};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as e}from"./bin.js";import{w as u}from"../packem_shared/pm-runner-OGResYrA.js";import{O as g}from"../packem_shared/native-config-sync-BEkJW7g3.js";import{S as l}from"../packem_shared/min-release-age-D1alDE3K.js";const y=new Set(["bun","npm","pnpm","yarn"]),k=({options:r,visConfig:c,workspaceRoot:f})=>{const s=f??process.cwd(),n=u(s);if(!y.has(n.name)){e.warn(`Package manager '${n.name}' has no native security config to sync.`);return}if(!c?.security){e.warn("vis.config has no `security` block — nothing to sync.");return}const t=c.security.policies??{},a=Object.fromEntries(Object.entries(t.installScripts?.allow??{}).filter(([,o])=>o)),m=t.firstSeen?.minutes,p=t.firstSeen?.exclude??[],i=[];if(Object.keys(a).length>0&&!r.skipAllowBuilds&&i.push(...g(n.name,s,a)),r.skipMinReleaseAge||i.push(...l(n.name,s,m,p)),i.length===0){e.success("Nothing to sync — vis.config and native PM config are aligned.");return}e.info(`Syncing vis.config security settings to ${n.name} native config…
|
|
2
|
+
`);for(const o of i)e.success(` ${o}`)};export{k as default};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{createRequire as nr}from"node:module";import{l as ar}from"../packem_shared/giget-DHY1sQZC.js";const or=nr(import.meta.url),Fe=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,D=e=>{if(typeof Fe<"u"&&Fe.versions&&Fe.versions.node){const[t,i]=Fe.versions.node.split(".").map(Number);if(t>22||t===22&&i>=3||t===20&&i>=16)return Fe.getBuiltinModule(e)}return or(e)},d=D("node:fs"),lr=D("node:fs/promises"),Ls=D("node:stream"),c=D("node:path"),{posix:Re,basename:dr,join:As,win32:ur}=c,Ds=D("events"),{EventEmitter:fr}=Ds,p=D("fs"),{EventEmitter:Ci}=D("node:events"),{StringDecoder:cr}=D("node:string_decoder"),st=D("path"),{parse:mr,dirname:pr}=st,mi=D("assert"),{Buffer:ge}=D("buffer"),Vi=D("zlib"),Ki={...Vi,default:Vi},yr=D("zlib"),br=D("node:assert"),{randomBytes:xs}=D("node:crypto");var en=ar({Header:()=>ae,Pack:()=>nt,PackJob:()=>Ti,PackSync:()=>Ut,Parser:()=>xe,Pax:()=>rt,ReadEntry:()=>Hs,Unpack:()=>Ft,UnpackSync:()=>Mi,WriteEntry:()=>Gi,WriteEntrySync:()=>Gs,WriteEntryTar:()=>$s,c:()=>ps,create:()=>ps,extract:()=>ks,filesFilter:()=>Hi,list:()=>Be,r:()=>be,replace:()=>be,t:()=>Be,types:()=>zs,x:()=>ks}),gr=Object.defineProperty,Er=(e,t)=>{for(var i in t)gr(e,i,{get:t[i],enumerable:!0})},Xi=process||{stdout:null,stderr:null},wr=e=>!!e&&typeof e=="object"&&(e instanceof _e||e instanceof Ls||_r(e)||Rr(e)),_r=e=>!!e&&typeof e=="object"&&e instanceof Ci&&typeof e.pipe=="function"&&e.pipe!==Ls.Writable.prototype.pipe,Rr=e=>!!e&&typeof e=="object"&&e instanceof Ci&&typeof e.write=="function"&&typeof e.end=="function",W=Symbol("EOF"),G=Symbol("maybeEmitEnd"),X=Symbol("emittedEnd"),ot=Symbol("emittingEnd"),Me=Symbol("emittedError"),at=Symbol("closed"),qi=Symbol("read"),lt=Symbol("flush"),Qi=Symbol("flushChunk"),B=Symbol("encoding"),Se=Symbol("decoder"),R=Symbol("flowing"),Ce=Symbol("paused"),ke=Symbol("resume"),S=Symbol("buffer"),A=Symbol("pipes"),v=Symbol("bufferLength"),Ht=Symbol("bufferPush"),dt=Symbol("bufferShift"),L=Symbol("objectMode"),E=Symbol("destroyed"),Zt=Symbol("error"),Wt=Symbol("emitData"),Ji=Symbol("emitEnd"),Gt=Symbol("emitEnd2"),z=Symbol("async"),$t=Symbol("abort"),ut=Symbol("aborted"),Pe=Symbol("signal"),le=Symbol("dataListeners"),x=Symbol("discarded"),ze=e=>Promise.resolve().then(e),Sr=e=>e(),vr=e=>e==="end"||e==="finish"||e==="prefinish",Or=e=>e instanceof ArrayBuffer||!!e&&typeof e=="object"&&e.constructor&&e.constructor.name==="ArrayBuffer"&&e.byteLength>=0,Tr=e=>!Buffer.isBuffer(e)&&ArrayBuffer.isView(e),Ns=class{src;dest;opts;ondrain;constructor(e,t,i){this.src=e,this.dest=t,this.opts=i,this.ondrain=()=>e[ke](),this.dest.on("drain",this.ondrain)}unpipe(){this.dest.removeListener("drain",this.ondrain)}proxyErrors(e){}end(){this.unpipe(),this.opts.end&&this.dest.end()}},kr=class extends Ns{unpipe(){this.src.removeListener("error",this.proxyErrors),super.unpipe()}constructor(e,t,i){super(e,t,i),this.proxyErrors=s=>this.dest.emit("error",s),e.on("error",this.proxyErrors)}},Lr=e=>!!e.objectMode,Ar=e=>!e.objectMode&&!!e.encoding&&e.encoding!=="buffer",_e=class extends Ci{[R]=!1;[Ce]=!1;[A]=[];[S]=[];[L];[B];[z];[Se];[W]=!1;[X]=!1;[ot]=!1;[at]=!1;[Me]=null;[v]=0;[E]=!1;[Pe];[ut]=!1;[le]=0;[x]=!1;writable=!0;readable=!0;constructor(...e){let t=e[0]||{};if(super(),t.objectMode&&typeof t.encoding=="string")throw TypeError("Encoding and objectMode may not be used together");Lr(t)?(this[L]=!0,this[B]=null):Ar(t)?(this[B]=t.encoding,this[L]=!1):(this[L]=!1,this[B]=null),this[z]=!!t.async,this[Se]=this[B]?new cr(this[B]):null,t&&t.debugExposeBuffer===!0&&Object.defineProperty(this,"buffer",{get:()=>this[S]}),t&&t.debugExposePipes===!0&&Object.defineProperty(this,"pipes",{get:()=>this[A]});let{signal:i}=t;i&&(this[Pe]=i,i.aborted?this[$t]():i.addEventListener("abort",()=>this[$t]()))}get bufferLength(){return this[v]}get encoding(){return this[B]}set encoding(e){throw Error("Encoding must be set at instantiation time")}setEncoding(e){throw Error("Encoding must be set at instantiation time")}get objectMode(){return this[L]}set objectMode(e){throw Error("objectMode must be set at instantiation time")}get async(){return this[z]}set async(e){this[z]=this[z]||!!e}[$t](){this[ut]=!0,this.emit("abort",this[Pe]?.reason),this.destroy(this[Pe]?.reason)}get aborted(){return this[ut]}set aborted(e){}write(e,t,i){if(this[ut])return!1;if(this[W])throw Error("write after end");if(this[E])return this.emit("error",Object.assign(Error("Cannot call write after a stream was destroyed"),{code:"ERR_STREAM_DESTROYED"})),!0;typeof t=="function"&&(i=t,t="utf8"),t||="utf8";let s=this[z]?ze:Sr;if(!this[L]&&!Buffer.isBuffer(e)){if(Tr(e))e=Buffer.from(e.buffer,e.byteOffset,e.byteLength);else if(Or(e))e=Buffer.from(e);else if(typeof e!="string")throw Error("Non-contiguous data written to non-objectMode stream")}return this[L]?(this[R]&&this[v]!==0&&this[lt](!0),this[R]?this.emit("data",e):this[Ht](e),this[v]!==0&&this.emit("readable"),i&&s(i),this[R]):e.length?(typeof e=="string"&&!(t===this[B]&&!this[Se]?.lastNeed)&&(e=Buffer.from(e,t)),Buffer.isBuffer(e)&&this[B]&&(e=this[Se].write(e)),this[R]&&this[v]!==0&&this[lt](!0),this[R]?this.emit("data",e):this[Ht](e),this[v]!==0&&this.emit("readable"),i&&s(i),this[R]):(this[v]!==0&&this.emit("readable"),i&&s(i),this[R])}read(e){if(this[E])return null;if(this[x]=!1,this[v]===0||e===0||e&&e>this[v])return this[G](),null;this[L]&&(e=null),this[S].length>1&&!this[L]&&(this[S]=[this[B]?this[S].join(""):Buffer.concat(this[S],this[v])]);let t=this[qi](e||null,this[S][0]);return this[G](),t}[qi](e,t){if(this[L])this[dt]();else{let i=t;e===i.length||e===null?this[dt]():typeof i=="string"?(this[S][0]=i.slice(e),t=i.slice(0,e),this[v]-=e):(this[S][0]=i.subarray(e),t=i.subarray(0,e),this[v]-=e)}return this.emit("data",t),!this[S].length&&!this[W]&&this.emit("drain"),t}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t="utf8"),e!==void 0&&this.write(e,t),i&&this.once("end",i),this[W]=!0,this.writable=!1,(this[R]||!this[Ce])&&this[G](),this}[ke](){this[E]||(!this[le]&&!this[A].length&&(this[x]=!0),this[Ce]=!1,this[R]=!0,this.emit("resume"),this[S].length?this[lt]():this[W]?this[G]():this.emit("drain"))}resume(){return this[ke]()}pause(){this[R]=!1,this[Ce]=!0,this[x]=!1}get destroyed(){return this[E]}get flowing(){return this[R]}get paused(){return this[Ce]}[Ht](e){this[L]?this[v]+=1:this[v]+=e.length,this[S].push(e)}[dt](){return this[L]?--this[v]:this[v]-=this[S][0].length,this[S].shift()}[lt](e=!1){do;while(this[Qi](this[dt]())&&this[S].length);!e&&!this[S].length&&!this[W]&&this.emit("drain")}[Qi](e){return this.emit("data",e),this[R]}pipe(e,t){if(this[E])return e;this[x]=!1;let i=this[X];return t||={},e===Xi.stdout||e===Xi.stderr?t.end=!1:t.end=t.end!==!1,t.proxyErrors=!!t.proxyErrors,i?t.end&&e.end():(this[A].push(t.proxyErrors?new kr(this,e,t):new Ns(this,e,t)),this[z]?ze(()=>this[ke]()):this[ke]()),e}unpipe(e){let t=this[A].find(i=>i.dest===e);t&&(this[A].length===1?(this[R]&&this[le]===0&&(this[R]=!1),this[A]=[]):this[A].splice(this[A].indexOf(t),1),t.unpipe())}addListener(e,t){return this.on(e,t)}on(e,t){let i=super.on(e,t);if(e==="data")this[x]=!1,this[le]++,!this[A].length&&!this[R]&&this[ke]();else if(e==="readable"&&this[v]!==0)super.emit("readable");else if(vr(e)&&this[X])super.emit(e),this.removeAllListeners(e);else if(e==="error"&&this[Me]){let s=t;this[z]?ze(()=>s.call(this,this[Me])):s.call(this,this[Me])}return i}removeListener(e,t){return this.off(e,t)}off(e,t){let i=super.off(e,t);return e==="data"&&(this[le]=this.listeners("data").length,this[le]===0&&!this[x]&&!this[A].length&&(this[R]=!1)),i}removeAllListeners(e){let t=super.removeAllListeners(e);return(e==="data"||e===void 0)&&(this[le]=0,!this[x]&&!this[A].length&&(this[R]=!1)),t}get emittedEnd(){return this[X]}[G](){!this[ot]&&!this[X]&&!this[E]&&this[S].length===0&&this[W]&&(this[ot]=!0,this.emit("end"),this.emit("prefinish"),this.emit("finish"),this[at]&&this.emit("close"),this[ot]=!1)}emit(e,...t){let i=t[0];if(e!=="error"&&e!=="close"&&e!==E&&this[E])return!1;if(e==="data")return!this[L]&&!i?!1:this[z]?(ze(()=>this[Wt](i)),!0):this[Wt](i);if(e==="end")return this[Ji]();if(e==="close"){if(this[at]=!0,!this[X]&&!this[E])return!1;let r=super.emit("close");return this.removeAllListeners("close"),r}else if(e==="error"){this[Me]=i,super.emit(Zt,i);let r=!this[Pe]||this.listeners("error").length?super.emit("error",i):!1;return this[G](),r}else if(e==="resume"){let r=super.emit("resume");return this[G](),r}else if(e==="finish"||e==="prefinish"){let r=super.emit(e);return this.removeAllListeners(e),r}let s=super.emit(e,...t);return this[G](),s}[Wt](e){for(let i of this[A])i.dest.write(e)===!1&&this.pause();let t=this[x]?!1:super.emit("data",e);return this[G](),t}[Ji](){return this[X]?!1:(this[X]=!0,this.readable=!1,this[z]?(ze(()=>this[Gt]()),!0):this[Gt]())}[Gt](){if(this[Se]){let t=this[Se].end();if(t){for(let i of this[A])i.dest.write(t);this[x]||super.emit("data",t)}}for(let t of this[A])t.end();let e=super.emit("end");return this.removeAllListeners("end"),e}async collect(){let e=Object.assign([],{dataLength:0});this[L]||(e.dataLength=0);let t=this.promise();return this.on("data",i=>{e.push(i),this[L]||(e.dataLength+=i.length)}),await t,e}async concat(){if(this[L])throw Error("cannot concat in objectMode");let e=await this.collect();return this[B]?e.join(""):Buffer.concat(e,e.dataLength)}async promise(){return new Promise((e,t)=>{this.on(E,()=>t(Error("stream destroyed"))),this.on("error",i=>t(i)),this.on("end",()=>e())})}[Symbol.asyncIterator](){this[x]=!1;let e=!1,t=async()=>(this.pause(),e=!0,{value:void 0,done:!0});return{next:()=>{if(e)return t();let i=this.read();if(i!==null)return Promise.resolve({done:!1,value:i});if(this[W])return t();let s,r,h=l=>{this.off("data",n),this.off("end",o),this.off(E,a),t(),r(l)},n=l=>{this.off("error",h),this.off("end",o),this.off(E,a),this.pause(),s({value:l,done:!!this[W]})},o=()=>{this.off("error",h),this.off("data",n),this.off(E,a),t(),s({done:!0,value:void 0})},a=()=>h(Error("stream destroyed"));return new Promise((l,f)=>{r=f,s=l,this.once(E,a),this.once("error",h),this.once("end",o),this.once("data",n)})},throw:t,return:t,[Symbol.asyncIterator](){return this},[Symbol.asyncDispose]:async()=>{}}}[Symbol.iterator](){this[x]=!1;let e=!1,t=()=>(this.pause(),this.off(Zt,t),this.off(E,t),this.off("end",t),e=!0,{done:!0,value:void 0});return this.once("end",t),this.once(Zt,t),this.once(E,t),{next:()=>{if(e)return t();let i=this.read();return i===null?t():{done:!1,value:i}},throw:t,return:t,[Symbol.iterator](){return this},[Symbol.dispose]:()=>{}}}destroy(e){if(this[E])return e?this.emit("error",e):this.emit(E),this;this[E]=!0,this[x]=!0,this[S].length=0,this[v]=0;let t=this;return typeof t.close=="function"&&!this[at]&&t.close(),e?this.emit("error",e):this.emit(E),this}static get isStream(){return wr}},Dr=p.writev,ne=Symbol("_autoClose"),P=Symbol("_close"),Ue=Symbol("_ended"),m=Symbol("_fd"),Yt=Symbol("_finished"),K=Symbol("_flags"),Vt=Symbol("_flush"),pi=Symbol("_handleChunk"),yi=Symbol("_makeBuf"),Xe=Symbol("_mode"),ft=Symbol("_needDrain"),Ne=Symbol("_onerror"),Ie=Symbol("_onopen"),Kt=Symbol("_onread"),Le=Symbol("_onwrite"),oe=Symbol("_open"),C=Symbol("_path"),te=Symbol("_pos"),U=Symbol("_queue"),Ae=Symbol("_read"),Xt=Symbol("_readSize"),V=Symbol("_reading"),je=Symbol("_remain"),qt=Symbol("_size"),Rt=Symbol("_write"),de=Symbol("_writing"),St=Symbol("_defaultFlag"),Ee=Symbol("_errored"),Pi=class extends _e{[Ee]=!1;[m];[C];[Xt];[V]=!1;[qt];[je];[ne];constructor(e,t){if(t||={},super(t),this.readable=!0,this.writable=!1,typeof e!="string")throw TypeError("path must be a string");this[Ee]=!1,this[m]=typeof t.fd=="number"?t.fd:void 0,this[C]=e,this[Xt]=t.readSize||16*1024*1024,this[V]=!1,this[qt]=typeof t.size=="number"?t.size:1/0,this[je]=this[qt],this[ne]=typeof t.autoClose=="boolean"?t.autoClose:!0,typeof this[m]=="number"?this[Ae]():this[oe]()}get fd(){return this[m]}get path(){return this[C]}write(){throw TypeError("this is a readable stream")}end(){throw TypeError("this is a readable stream")}[oe](){p.open(this[C],"r",(e,t)=>this[Ie](e,t))}[Ie](e,t){e?this[Ne](e):(this[m]=t,this.emit("open",t),this[Ae]())}[yi](){return Buffer.allocUnsafe(Math.min(this[Xt],this[je]))}[Ae](){if(!this[V]){this[V]=!0;let e=this[yi]();if(e.length===0)return process.nextTick(()=>this[Kt](null,0,e));p.read(this[m],e,0,e.length,null,(t,i,s)=>this[Kt](t,i,s))}}[Kt](e,t,i){this[V]=!1,e?this[Ne](e):this[pi](t,i)&&this[Ae]()}[P](){if(this[ne]&&typeof this[m]=="number"){let e=this[m];this[m]=void 0,p.close(e,t=>t?this.emit("error",t):this.emit("close"))}}[Ne](e){this[V]=!0,this[P](),this.emit("error",e)}[pi](e,t){let i=!1;return this[je]-=e,e>0&&(i=super.write(e<t.length?t.subarray(0,e):t)),(e===0||this[je]<=0)&&(i=!1,this[P](),super.end()),i}emit(e,...t){switch(e){case"prefinish":case"finish":return!1;case"drain":return typeof this[m]=="number"&&this[Ae](),!1;case"error":return this[Ee]?!1:(this[Ee]=!0,super.emit(e,...t));default:return super.emit(e,...t)}}},xr=class extends Pi{[oe](){let e=!0;try{this[Ie](null,p.openSync(this[C],"r")),e=!1}finally{e&&this[P]()}}[Ae](){let e=!0;try{if(!this[V]){this[V]=!0;do{let t=this[yi](),i=t.length===0?0:p.readSync(this[m],t,0,t.length,null);if(!this[pi](i,t))break}while(!0);this[V]=!1}e=!1}finally{e&&this[P]()}}[P](){if(this[ne]&&typeof this[m]=="number"){let e=this[m];this[m]=void 0,p.closeSync(e),this.emit("close")}}},Mt=class extends Ds{readable=!1;writable=!0;[Ee]=!1;[de]=!1;[Ue]=!1;[U]=[];[ft]=!1;[C];[Xe];[ne];[m];[St];[K];[Yt]=!1;[te];constructor(e,t){t||={},super(t),this[C]=e,this[m]=typeof t.fd=="number"?t.fd:void 0,this[Xe]=t.mode===void 0?438:t.mode,this[te]=typeof t.start=="number"?t.start:void 0,this[ne]=typeof t.autoClose=="boolean"?t.autoClose:!0;let i=this[te]===void 0?"w":"r+";this[St]=t.flags===void 0,this[K]=t.flags===void 0?i:t.flags,this[m]===void 0&&this[oe]()}emit(e,...t){if(e==="error"){if(this[Ee])return!1;this[Ee]=!0}return super.emit(e,...t)}get fd(){return this[m]}get path(){return this[C]}[Ne](e){this[P](),this[de]=!0,this.emit("error",e)}[oe](){p.open(this[C],this[K],this[Xe],(e,t)=>this[Ie](e,t))}[Ie](e,t){this[St]&&this[K]==="r+"&&e&&e.code==="ENOENT"?(this[K]="w",this[oe]()):e?this[Ne](e):(this[m]=t,this.emit("open",t),this[de]||this[Vt]())}end(e,t){return e&&this.write(e,t),this[Ue]=!0,!this[de]&&!this[U].length&&typeof this[m]=="number"&&this[Le](null,0),this}write(e,t){return typeof e=="string"&&(e=Buffer.from(e,t)),this[Ue]?(this.emit("error",Error("write() after end()")),!1):this[m]===void 0||this[de]||this[U].length?(this[U].push(e),this[ft]=!0,!1):(this[de]=!0,this[Rt](e),!0)}[Rt](e){p.write(this[m],e,0,e.length,this[te],(t,i)=>this[Le](t,i))}[Le](e,t){e?this[Ne](e):(this[te]!==void 0&&typeof t=="number"&&(this[te]+=t),this[U].length?this[Vt]():(this[de]=!1,this[Ue]&&!this[Yt]?(this[Yt]=!0,this[P](),this.emit("finish")):this[ft]&&(this[ft]=!1,this.emit("drain"))))}[Vt](){if(this[U].length===0)this[Ue]&&this[Le](null,0);else if(this[U].length===1)this[Rt](this[U].pop());else{let e=this[U];this[U]=[],Dr(this[m],e,this[te],(t,i)=>this[Le](t,i))}}[P](){if(this[ne]&&typeof this[m]=="number"){let e=this[m];this[m]=void 0,p.close(e,t=>t?this.emit("error",t):this.emit("close"))}}},Is=class extends Mt{[oe](){let e;if(this[St]&&this[K]==="r+")try{e=p.openSync(this[C],this[K],this[Xe])}catch(t){if(t?.code==="ENOENT")return this[K]="w",this[oe]();throw t}else e=p.openSync(this[C],this[K],this[Xe]);this[Ie](null,e)}[P](){if(this[ne]&&typeof this[m]=="number"){let e=this[m];this[m]=void 0,p.closeSync(e),this.emit("close")}}[Rt](e){let t=!0;try{this[Le](null,p.writeSync(this[m],e,0,e.length,this[te])),t=!1}finally{if(t)try{this[P]()}catch{}}}},Nr=new Map([["C","cwd"],["f","file"],["z","gzip"],["P","preservePaths"],["U","unlink"],["strip-components","strip"],["stripComponents","strip"],["keep-newer","newer"],["keepNewer","newer"],["keep-newer-files","newer"],["keepNewerFiles","newer"],["k","keep"],["keep-existing","keep"],["keepExisting","keep"],["m","noMtime"],["no-mtime","noMtime"],["p","preserveOwner"],["L","follow"],["h","follow"],["onentry","onReadEntry"]]),Ir=e=>!!e.sync&&!!e.file,Br=e=>!e.sync&&!!e.file,Fr=e=>!!e.sync&&!e.file,Mr=e=>!e.sync&&!e.file,Cr=e=>!!e.file,Pr=e=>Nr.get(e)||e,zi=(e={})=>{if(!e)return{};let t={};for(let[i,s]of Object.entries(e)){let r=Pr(i);t[r]=s}return t.chmod===void 0&&t.noChmod===!1&&(t.chmod=!0),delete t.noChmod,t},ht=(e,t,i,s,r)=>Object.assign((h=[],n,o)=>{Array.isArray(h)&&(n=h,h={}),typeof n=="function"&&(o=n,n=void 0),n=n?Array.from(n):[];let a=zi(h);if(r?.(a,n),Ir(a)){if(typeof o=="function")throw TypeError("callback not supported for sync tar functions");return e(a,n)}else if(Br(a)){let l=t(a,n);return o?l.then(()=>o(),o):l}else if(Fr(a)){if(typeof o=="function")throw TypeError("callback not supported for sync tar functions");return i(a,n)}else if(Mr(a)){if(typeof o=="function")throw TypeError("callback only supported with file option");return s(a,n)}throw Error("impossible options??")},{syncFile:e,asyncFile:t,syncNoFile:i,asyncNoFile:s,validate:r}),zr=yr.constants||{ZLIB_VERNUM:4736},Z=Object.freeze(Object.assign(Object.create(null),{Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_MEM_ERROR:-4,Z_BUF_ERROR:-5,Z_VERSION_ERROR:-6,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,DEFLATE:1,INFLATE:2,GZIP:3,GUNZIP:4,DEFLATERAW:5,INFLATERAW:6,UNZIP:7,BROTLI_DECODE:8,BROTLI_ENCODE:9,Z_MIN_WINDOWBITS:8,Z_MAX_WINDOWBITS:15,Z_DEFAULT_WINDOWBITS:15,Z_MIN_CHUNK:64,Z_MAX_CHUNK:1/0,Z_DEFAULT_CHUNK:16384,Z_MIN_MEMLEVEL:1,Z_MAX_MEMLEVEL:9,Z_DEFAULT_MEMLEVEL:8,Z_MIN_LEVEL:-1,Z_MAX_LEVEL:9,Z_DEFAULT_LEVEL:-1,BROTLI_OPERATION_PROCESS:0,BROTLI_OPERATION_FLUSH:1,BROTLI_OPERATION_FINISH:2,BROTLI_OPERATION_EMIT_METADATA:3,BROTLI_MODE_GENERIC:0,BROTLI_MODE_TEXT:1,BROTLI_MODE_FONT:2,BROTLI_DEFAULT_MODE:0,BROTLI_MIN_QUALITY:0,BROTLI_MAX_QUALITY:11,BROTLI_DEFAULT_QUALITY:11,BROTLI_MIN_WINDOW_BITS:10,BROTLI_MAX_WINDOW_BITS:24,BROTLI_LARGE_MAX_WINDOW_BITS:30,BROTLI_DEFAULT_WINDOW:22,BROTLI_MIN_INPUT_BLOCK_BITS:16,BROTLI_MAX_INPUT_BLOCK_BITS:24,BROTLI_PARAM_MODE:0,BROTLI_PARAM_QUALITY:1,BROTLI_PARAM_LGWIN:2,BROTLI_PARAM_LGBLOCK:3,BROTLI_PARAM_DISABLE_LITERAL_CONTEXT_MODELING:4,BROTLI_PARAM_SIZE_HINT:5,BROTLI_PARAM_LARGE_WINDOW:6,BROTLI_PARAM_NPOSTFIX:7,BROTLI_PARAM_NDIRECT:8,BROTLI_DECODER_RESULT_ERROR:0,BROTLI_DECODER_RESULT_SUCCESS:1,BROTLI_DECODER_RESULT_NEEDS_MORE_INPUT:2,BROTLI_DECODER_RESULT_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_PARAM_DISABLE_RING_BUFFER_REALLOCATION:0,BROTLI_DECODER_PARAM_LARGE_WINDOW:1,BROTLI_DECODER_NO_ERROR:0,BROTLI_DECODER_SUCCESS:1,BROTLI_DECODER_NEEDS_MORE_INPUT:2,BROTLI_DECODER_NEEDS_MORE_OUTPUT:3,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_NIBBLE:-1,BROTLI_DECODER_ERROR_FORMAT_RESERVED:-2,BROTLI_DECODER_ERROR_FORMAT_EXUBERANT_META_NIBBLE:-3,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_ALPHABET:-4,BROTLI_DECODER_ERROR_FORMAT_SIMPLE_HUFFMAN_SAME:-5,BROTLI_DECODER_ERROR_FORMAT_CL_SPACE:-6,BROTLI_DECODER_ERROR_FORMAT_HUFFMAN_SPACE:-7,BROTLI_DECODER_ERROR_FORMAT_CONTEXT_MAP_REPEAT:-8,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_1:-9,BROTLI_DECODER_ERROR_FORMAT_BLOCK_LENGTH_2:-10,BROTLI_DECODER_ERROR_FORMAT_TRANSFORM:-11,BROTLI_DECODER_ERROR_FORMAT_DICTIONARY:-12,BROTLI_DECODER_ERROR_FORMAT_WINDOW_BITS:-13,BROTLI_DECODER_ERROR_FORMAT_PADDING_1:-14,BROTLI_DECODER_ERROR_FORMAT_PADDING_2:-15,BROTLI_DECODER_ERROR_FORMAT_DISTANCE:-16,BROTLI_DECODER_ERROR_DICTIONARY_NOT_SET:-19,BROTLI_DECODER_ERROR_INVALID_ARGUMENTS:-20,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MODES:-21,BROTLI_DECODER_ERROR_ALLOC_TREE_GROUPS:-22,BROTLI_DECODER_ERROR_ALLOC_CONTEXT_MAP:-25,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_1:-26,BROTLI_DECODER_ERROR_ALLOC_RING_BUFFER_2:-27,BROTLI_DECODER_ERROR_ALLOC_BLOCK_TYPE_TREES:-30,BROTLI_DECODER_ERROR_UNREACHABLE:-31},zr)),Ur=ge.concat,es=Object.getOwnPropertyDescriptor(ge,"concat"),jr=e=>e,Qt=es?.writable===!0||es?.set!==void 0?e=>{ge.concat=e?jr:Ur}:e=>{},we=Symbol("_superWrite"),ct=class extends Error{code;errno;constructor(e,t){super("zlib: "+e.message,{cause:e}),this.code=e.code,this.errno=e.errno,this.code||="ZLIB_ERROR",this.message="zlib: "+e.message,Error.captureStackTrace(this,t??this.constructor)}get name(){return"ZlibError"}},Jt=Symbol("flushFlag"),Ui=class extends _e{#e=!1;#i=!1;#s;#h;#r;#t;#n;get sawError(){return this.#e}get handle(){return this.#t}get flushFlag(){return this.#s}constructor(e,t){if(!e||typeof e!="object")throw TypeError("invalid options for ZlibBase constructor");if(super(e),this.#s=e.flush??0,this.#h=e.finishFlush??0,this.#r=e.fullFlushFlag??0,typeof Ki[t]!="function")throw TypeError("Compression method not supported: "+t);try{this.#t=new Ki[t](e)}catch(i){throw new ct(i,this.constructor)}this.#n=i=>{this.#e||(this.#e=!0,this.close(),this.emit("error",i))},this.#t?.on("error",i=>this.#n(new ct(i))),this.once("end",()=>this.close)}close(){this.#t&&(this.#t.close(),this.#t=void 0,this.emit("close"))}reset(){if(!this.#e)return mi(this.#t,"zlib binding closed"),this.#t.reset?.()}flush(e){this.ended||(typeof e!="number"&&(e=this.#r),this.write(Object.assign(ge.alloc(0),{[Jt]:e})))}end(e,t,i){return typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),e&&(t?this.write(e,t):this.write(e)),this.flush(this.#h),this.#i=!0,super.end(i)}get ended(){return this.#i}[we](e){return super.write(e)}write(e,t,i){if(typeof t=="function"&&(i=t,t="utf8"),typeof e=="string"&&(e=ge.from(e,t)),this.#e)return;mi(this.#t,"zlib binding closed");let s=this.#t._handle,r=s.close;s.close=()=>{};let h=this.#t.close;this.#t.close=()=>{},Qt(!0);let n;try{let a=typeof e[Jt]=="number"?e[Jt]:this.#s;n=this.#t._processChunk(e,a),Qt(!1)}catch(a){Qt(!1),this.#n(new ct(a,this.write))}finally{this.#t&&(this.#t._handle=s,s.close=r,this.#t.close=h,this.#t.removeAllListeners("error"))}this.#t&&this.#t.on("error",a=>this.#n(new ct(a,this.write)));let o;if(n)if(Array.isArray(n)&&n.length>0){let a=n[0];o=this[we](ge.from(a));for(let l=1;l<n.length;l++)o=this[we](n[l])}else o=this[we](ge.from(n));return i&&i(),o}},Bs=class extends Ui{#e;#i;constructor(e,t){e||={},e.flush=e.flush||Z.Z_NO_FLUSH,e.finishFlush=e.finishFlush||Z.Z_FINISH,e.fullFlushFlag=Z.Z_FULL_FLUSH,super(e,t),this.#e=e.level,this.#i=e.strategy}params(e,t){if(!this.sawError){if(!this.handle)throw Error("cannot switch params when binding is closed");if(!this.handle.params)throw Error("not supported in this implementation");if(this.#e!==e||this.#i!==t){this.flush(Z.Z_SYNC_FLUSH),mi(this.handle,"zlib binding closed");let i=this.handle.flush;this.handle.flush=(s,r)=>{typeof s=="function"&&(r=s,s=this.flushFlag),this.flush(s),r?.()};try{this.handle.params(e,t)}finally{this.handle.flush=i}this.handle&&(this.#e=e,this.#i=t)}}}},Hr=class extends Bs{#e;constructor(e){super(e,"Gzip"),this.#e=e&&!!e.portable}[we](e){return this.#e?(this.#e=!1,e[9]=255,super[we](e)):super[we](e)}},Zr=class extends Bs{constructor(e){super(e,"Unzip")}},Fs=class extends Ui{constructor(e,t){e||={},e.flush=e.flush||Z.BROTLI_OPERATION_PROCESS,e.finishFlush=e.finishFlush||Z.BROTLI_OPERATION_FINISH,e.fullFlushFlag=Z.BROTLI_OPERATION_FLUSH,super(e,t)}},Wr=class extends Fs{constructor(e){super(e,"BrotliCompress")}},Gr=class extends Fs{constructor(e){super(e,"BrotliDecompress")}},Ms=class extends Ui{constructor(e,t){e||={},e.flush=e.flush||Z.ZSTD_e_continue,e.finishFlush=e.finishFlush||Z.ZSTD_e_end,e.fullFlushFlag=Z.ZSTD_e_flush,super(e,t)}},$r=class extends Ms{constructor(e){super(e,"ZstdCompress")}},Yr=class extends Ms{constructor(e){super(e,"ZstdDecompress")}},Vr=(e,t)=>{if(Number.isSafeInteger(e))e<0?Xr(e,t):Kr(e,t);else throw Error("cannot encode number outside of javascript safe integer range");return t},Kr=(e,t)=>{t[0]=128;for(var i=t.length;i>1;i--)t[i-1]=e&255,e=Math.floor(e/256)},Xr=(e,t)=>{t[0]=255;var i=!1;e*=-1;for(var s=t.length;s>1;s--){var r=e&255;e=Math.floor(e/256),i?t[s-1]=Cs(r):r===0?t[s-1]=0:(i=!0,t[s-1]=Ps(r))}},qr=e=>{let t=e[0],i=t===128?Jr(e.subarray(1,e.length)):t===255?Qr(e):null;if(i===null)throw Error("invalid base256 encoding");if(!Number.isSafeInteger(i))throw Error("parsed number outside of javascript safe integer range");return i},Qr=e=>{for(var t=e.length,i=0,s=!1,r=t-1;r>-1;r--){var h=Number(e[r]),n;s?n=Cs(h):h===0?n=h:(s=!0,n=Ps(h)),n!==0&&(i-=n*256**(t-r-1))}return i},Jr=e=>{for(var t=e.length,i=0,s=t-1;s>-1;s--){var r=Number(e[s]);r!==0&&(i+=r*256**(t-s-1))}return i},Cs=e=>(255^e)&255,Ps=e=>(255^e)+1&255,zs={};Er(zs,{code:()=>ji,isCode:()=>vt,isName:()=>eh,name:()=>Ct,normalFsTypes:()=>Us});var vt=e=>Ct.has(e),eh=e=>ji.has(e),Us=new Set(["0","","1","2","3","4","5","6","7","D"]),Ct=new Map([["0","File"],["","OldFile"],["1","Link"],["2","SymbolicLink"],["3","CharacterDevice"],["4","BlockDevice"],["5","Directory"],["6","FIFO"],["7","ContiguousFile"],["g","GlobalExtendedHeader"],["x","ExtendedHeader"],["A","SolarisACL"],["D","GNUDumpDir"],["I","Inode"],["K","NextFileHasLongLinkpath"],["L","NextFileHasLongPath"],["M","ContinuationFile"],["N","OldGnuLongPath"],["S","SparseFile"],["V","TapeVolumeHeader"],["X","OldExtendedHeader"]]),ji=new Map(Array.from(Ct).map(e=>[e[1],e[0]])),ae=class{cksumValid=!1;needPax=!1;nullBlock=!1;block;path;mode;uid;gid;size;cksum;#e="Unsupported";linkpath;uname;gname;devmaj=0;devmin=0;atime;ctime;mtime;charset;comment;constructor(e,t=0,i,s){Buffer.isBuffer(e)?this.decode(e,t||0,i,s):e&&this.#i(e)}decode(e,t,i,s){if(t||=0,!e||!(e.length>=t+512))throw Error("need 512 bytes for header");let r=ue(e,t+156,1),h=Us.has(r),n=h?i:void 0,o=h?s:void 0;if(this.path=n?.path??ue(e,t,100),this.mode=n?.mode??o?.mode??ie(e,t+100,8),this.uid=n?.uid??o?.uid??ie(e,t+108,8),this.gid=n?.gid??o?.gid??ie(e,t+116,8),this.size=n?.size??o?.size??ie(e,t+124,12),this.mtime=n?.mtime??o?.mtime??ei(e,t+136,12),this.cksum=ie(e,t+148,12),o&&this.#i(o,!0),n&&this.#i(n),vt(r)&&(this.#e=r||"0"),this.#e==="0"&&this.path.slice(-1)==="/"&&(this.#e="5"),this.#e==="5"&&(this.size=0),this.linkpath=ue(e,t+157,100),e.subarray(t+257,t+265).toString()==="ustar\x0000")if(this.uname=n?.uname??o?.uname??ue(e,t+265,32),this.gname=n?.gname??o?.gname??ue(e,t+297,32),this.devmaj=n?.devmaj??o?.devmaj??ie(e,t+329,8)??0,this.devmin=n?.devmin??o?.devmin??ie(e,t+337,8)??0,e[t+475]!==0){let l=ue(e,t+345,155);this.path=l+"/"+this.path}else{let l=ue(e,t+345,130);l&&(this.path=l+"/"+this.path),this.atime=i?.atime??s?.atime??ei(e,t+476,12),this.ctime=i?.ctime??s?.ctime??ei(e,t+488,12)}let a=256;for(let l=t;l<t+148;l++)a+=e[l];for(let l=t+156;l<t+512;l++)a+=e[l];this.cksumValid=a===this.cksum,this.cksum===void 0&&a===256&&(this.nullBlock=!0)}#i(e,t=!1){Object.assign(this,Object.fromEntries(Object.entries(e).filter(([i,s])=>!(s==null||i==="path"&&t||i==="linkpath"&&t||i==="global"))))}encode(e,t=0){if(e||=this.block=Buffer.alloc(512),this.#e==="Unsupported"&&(this.#e="0"),!(e.length>=t+512))throw Error("need 512 bytes for header");let i=this.ctime||this.atime?130:155,s=th(this.path||"",i),r=s[0],h=s[1];this.needPax=!!s[2],this.needPax=fe(e,t,100,r)||this.needPax,this.needPax=se(e,t+100,8,this.mode)||this.needPax,this.needPax=se(e,t+108,8,this.uid)||this.needPax,this.needPax=se(e,t+116,8,this.gid)||this.needPax,this.needPax=se(e,t+124,12,this.size)||this.needPax,this.needPax=ti(e,t+136,12,this.mtime)||this.needPax,e[t+156]=Number(this.#e.codePointAt(0)),this.needPax=fe(e,t+157,100,this.linkpath)||this.needPax,e.write("ustar\x0000",t+257,8),this.needPax=fe(e,t+265,32,this.uname)||this.needPax,this.needPax=fe(e,t+297,32,this.gname)||this.needPax,this.needPax=se(e,t+329,8,this.devmaj)||this.needPax,this.needPax=se(e,t+337,8,this.devmin)||this.needPax,this.needPax=fe(e,t+345,i,h)||this.needPax,e[t+475]===0?(this.needPax=fe(e,t+345,130,h)||this.needPax,this.needPax=ti(e,t+476,12,this.atime)||this.needPax,this.needPax=ti(e,t+488,12,this.ctime)||this.needPax):this.needPax=fe(e,t+345,155,h)||this.needPax;let n=256;for(let o=t;o<t+148;o++)n+=e[o];for(let o=t+156;o<t+512;o++)n+=e[o];return this.cksum=n,se(e,t+148,8,this.cksum),this.cksumValid=!0,this.needPax}get type(){return this.#e==="Unsupported"?this.#e:Ct.get(this.#e)}get typeKey(){return this.#e}set type(e){let t=String(ji.get(e));if(vt(t)||t==="Unsupported")this.#e=t;else if(vt(e))this.#e=e;else throw TypeError("invalid entry type: "+e)}},th=(e,t)=>{let i=e,s="",r,h=Re.parse(e).root||".";if(Buffer.byteLength(i)<100)r=[i,s,!1];else{s=Re.dirname(i),i=Re.basename(i);do Buffer.byteLength(i)<=100&&Buffer.byteLength(s)<=t?r=[i,s,!1]:Buffer.byteLength(i)>100&&Buffer.byteLength(s)<=t?r=[i.slice(0,99),s,!0]:(i=Re.join(Re.basename(s),i),s=Re.dirname(s));while(s!==h&&r===void 0);r||=[e.slice(0,99),"",!0]}return r},ue=(e,t,i)=>e.subarray(t,t+i).toString("utf8").replace(/\0.*/,""),ei=(e,t,i)=>ih(ie(e,t,i)),ih=e=>e===void 0?void 0:new Date(e*1e3),ie=(e,t,i)=>Number(e[t])&128?qr(e.subarray(t,t+i)):rh(e,t,i),sh=e=>isNaN(e)?void 0:e,rh=(e,t,i)=>sh(parseInt(e.subarray(t,t+i).toString("utf8").replace(/\0.*$/,"").trim(),8)),hh={12:8589934591,8:2097151},se=(e,t,i,s)=>s===void 0?!1:s>hh[i]||s<0?(Vr(s,e.subarray(t,t+i)),!0):(nh(e,t,i,s),!1),nh=(e,t,i,s)=>e.write(oh(s,i),t,i,"ascii"),oh=(e,t)=>ah(Math.floor(e).toString(8),t),ah=(e,t)=>(e.length===t-1?e:Array(t-e.length-1).join("0")+e+" ")+"\0",ti=(e,t,i,s)=>s===void 0?!1:se(e,t,i,s.getTime()/1e3),lh=Array(156).join("\0"),fe=(e,t,i,s)=>s===void 0?!1:(e.write(s+lh,t,i,"utf8"),s.length!==Buffer.byteLength(s)||s.length>i),rt=class js{atime;mtime;ctime;charset;comment;gid;uid;gname;uname;linkpath;dev;ino;nlink;path;size;mode;global;constructor(t,i=!1){this.atime=t.atime,this.charset=t.charset,this.comment=t.comment,this.ctime=t.ctime,this.dev=t.dev,this.gid=t.gid,this.global=i,this.gname=t.gname,this.ino=t.ino,this.linkpath=t.linkpath,this.mtime=t.mtime,this.nlink=t.nlink,this.path=t.path,this.size=t.size,this.uid=t.uid,this.uname=t.uname}encode(){let t=this.encodeBody();if(t==="")return Buffer.allocUnsafe(0);let i=Buffer.byteLength(t),s=512*Math.ceil(1+i/512),r=Buffer.allocUnsafe(s);for(let h=0;h<512;h++)r[h]=0;new ae({path:("PaxHeader/"+dr(this.path??"")).slice(0,99),mode:this.mode||420,uid:this.uid,gid:this.gid,size:i,mtime:this.mtime,type:this.global?"GlobalExtendedHeader":"ExtendedHeader",linkpath:"",uname:this.uname||"",gname:this.gname||"",devmaj:0,devmin:0,atime:this.atime,ctime:this.ctime}).encode(r),r.write(t,512,i,"utf8");for(let h=i+512;h<r.length;h++)r[h]=0;return r}encodeBody(){return this.encodeField("path")+this.encodeField("ctime")+this.encodeField("atime")+this.encodeField("dev")+this.encodeField("ino")+this.encodeField("nlink")+this.encodeField("charset")+this.encodeField("comment")+this.encodeField("gid")+this.encodeField("gname")+this.encodeField("linkpath")+this.encodeField("mtime")+this.encodeField("size")+this.encodeField("uid")+this.encodeField("uname")}encodeField(t){if(this[t]===void 0)return"";let i=this[t],s=i instanceof Date?i.getTime()/1e3:i,r=" "+(t==="dev"||t==="ino"||t==="nlink"?"SCHILY.":"")+t+"="+s+`
|
|
2
|
+
`,h=Buffer.byteLength(r),n=Math.floor(Math.log(h)/Math.log(10))+1;return h+n>=10**n&&(n+=1),n+h+r}static parse(t,i,s=!1){return new js(dh(uh(t),i),s)}},dh=(e,t)=>t?Object.assign({},t,e):e,uh=e=>e.replace(/\n$/,"").split(`
|
|
3
|
+
`).reduce(fh,Object.create(null)),fh=(e,t)=>{let i=parseInt(t,10);if(i!==Buffer.byteLength(t)+1)return e;t=t.slice((i+" ").length);let s=t.split("="),r=s.shift();if(!r)return e;let h=r.replace(/^SCHILY\.(dev|ino|nlink)/,"$1"),n=s.join("=");return e[h]=/^([A-Z]+\.)?([mac]|birth|creation)time$/.test(h)?new Date(Number(n)*1e3):/^[0-9]+$/.test(n)?+n:n,e},u=(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)==="win32"?e=>e&&e.replaceAll(/\\/g,"/"):e=>e,Hs=class extends _e{extended;globalExtended;header;startBlockSize;blockRemain;remain;type;meta=!1;ignore=!1;path;mode;uid;gid;uname;gname;size=0;mtime;atime;ctime;linkpath;dev;ino;nlink;invalid=!1;absolute;unsupported=!1;constructor(e,t,i){switch(super({}),this.pause(),this.extended=t,this.globalExtended=i,this.header=e,this.remain=e.size??0,this.startBlockSize=512*Math.ceil(this.remain/512),this.blockRemain=this.startBlockSize,this.type=e.type,this.type){case"File":case"OldFile":case"Link":case"SymbolicLink":case"CharacterDevice":case"BlockDevice":case"Directory":case"FIFO":case"ContiguousFile":case"GNUDumpDir":break;case"NextFileHasLongLinkpath":case"NextFileHasLongPath":case"OldGnuLongPath":case"GlobalExtendedHeader":case"ExtendedHeader":case"OldExtendedHeader":this.meta=!0;break;default:this.ignore=!0}if(!e.path)throw Error("no path provided for tar.ReadEntry");this.path=u(e.path),this.mode=e.mode,this.mode&&(this.mode&=4095),this.uid=e.uid,this.gid=e.gid,this.uname=e.uname,this.gname=e.gname,this.size=this.remain,this.mtime=e.mtime,this.atime=e.atime,this.ctime=e.ctime,this.linkpath=e.linkpath?u(e.linkpath):void 0,this.uname=e.uname,this.gname=e.gname,t&&this.#e(t),i&&this.#e(i,!0)}write(e){let t=e.length;if(t>this.blockRemain)throw Error("writing more to entry than is appropriate");let i=this.remain,s=this.blockRemain;return this.remain=Math.max(0,i-t),this.blockRemain=Math.max(0,s-t),this.ignore?!0:i>=t?super.write(e):super.write(e.subarray(0,i))}#e(e,t=!1){e.path&&=u(e.path),e.linkpath&&=u(e.linkpath),Object.assign(this,Object.fromEntries(Object.entries(e).filter(([i,s])=>!(s==null||i==="path"&&t))))}},Pt=(e,t,i,s={})=>{e.file&&(s.file=e.file),e.cwd&&(s.cwd=e.cwd),s.code=i instanceof Error&&i.code||t,s.tarCode=t,!e.strict&&s.recoverable!==!1?(i instanceof Error&&(s=Object.assign(i,s),i=i.message),e.emit("warn",t,i,s)):i instanceof Error?e.emit("error",Object.assign(i,s)):e.emit("error",Object.assign(Error(`${t}: ${i}`),s))},ch=1024*1024,bi=Buffer.from([31,139]),gi=Buffer.from([40,181,47,253]),mh=Math.max(bi.length,gi.length),N=Symbol("state"),ce=Symbol("writeEntry"),$=Symbol("readEntry"),ii=Symbol("nextEntry"),ts=Symbol("processEntry"),j=Symbol("extendedHeader"),He=Symbol("globalExtendedHeader"),q=Symbol("meta"),is=Symbol("emitMeta"),y=Symbol("buffer"),Y=Symbol("queue"),Q=Symbol("ended"),si=Symbol("emittedEnd"),me=Symbol("emit"),_=Symbol("unzip"),mt=Symbol("consumeChunk"),pt=Symbol("consumeChunkSub"),ri=Symbol("consumeBody"),ss=Symbol("consumeMeta"),rs=Symbol("consumeHeader"),Ze=Symbol("consuming"),hi=Symbol("bufferConcat"),yt=Symbol("maybeEnd"),ve=Symbol("writing"),J=Symbol("aborted"),bt=Symbol("onDone"),pe=Symbol("sawValidEntry"),gt=Symbol("sawNullBlock"),Et=Symbol("sawEOF"),hs=Symbol("closeStream"),ph=()=>!0,xe=class extends fr{file;strict;maxMetaEntrySize;filter;brotli;zstd;writable=!0;readable=!1;[Y]=[];[y];[$];[ce];[N]="begin";[q]="";[j];[He];[Q]=!1;[_];[J]=!1;[pe];[gt]=!1;[Et]=!1;[ve]=!1;[Ze]=!1;[si]=!1;constructor(e={}){super(),this.file=e.file||"",this.on(bt,()=>{(this[N]==="begin"||this[pe]===!1)&&this.warn("TAR_BAD_ARCHIVE","Unrecognized archive format")}),e.ondone?this.on(bt,e.ondone):this.on(bt,()=>{this.emit("prefinish"),this.emit("finish"),this.emit("end")}),this.strict=!!e.strict,this.maxMetaEntrySize=e.maxMetaEntrySize||ch,this.filter=typeof e.filter=="function"?e.filter:ph;let t=e.file&&(e.file.endsWith(".tar.br")||e.file.endsWith(".tbr"));this.brotli=!(e.gzip||e.zstd)&&e.brotli!==void 0?e.brotli:t?void 0:!1;let i=e.file&&(e.file.endsWith(".tar.zst")||e.file.endsWith(".tzst"));this.zstd=!(e.gzip||e.brotli)&&e.zstd!==void 0?e.zstd:i?!0:void 0,this.on("end",()=>this[hs]()),typeof e.onwarn=="function"&&this.on("warn",e.onwarn),typeof e.onReadEntry=="function"&&this.on("entry",e.onReadEntry)}warn(e,t,i={}){Pt(this,e,t,i)}[rs](e,t){this[pe]===void 0&&(this[pe]=!1);let i;try{i=new ae(e,t,this[j],this[He])}catch(s){return this.warn("TAR_ENTRY_INVALID",s)}if(i.nullBlock)this[gt]?(this[Et]=!0,this[N]==="begin"&&(this[N]="header"),this[me]("eof")):(this[gt]=!0,this[me]("nullBlock"));else if(this[gt]=!1,!i.cksumValid)this.warn("TAR_ENTRY_INVALID","checksum failure",{header:i});else if(!i.path)this.warn("TAR_ENTRY_INVALID","path is required",{header:i});else{let s=i.type;if(/^(Symbolic)?Link$/.test(s)&&!i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath required",{header:i});else if(!/^(Symbolic)?Link$/.test(s)&&!/^(Global)?ExtendedHeader$/.test(s)&&i.linkpath)this.warn("TAR_ENTRY_INVALID","linkpath forbidden",{header:i});else{let r=this[ce]=new Hs(i,this[j],this[He]);this[pe]||(r.remain?r.on("end",()=>{r.invalid||(this[pe]=!0)}):this[pe]=!0),r.meta?r.size>this.maxMetaEntrySize?(r.ignore=!0,this[me]("ignoredEntry",r),this[N]="ignore",r.resume()):r.size>0&&(this[q]="",r.on("data",h=>this[q]+=h),this[N]="meta"):(this[j]=void 0,r.ignore=r.ignore||!this.filter(r.path,r),r.ignore?(this[me]("ignoredEntry",r),this[N]=r.remain?"ignore":"header",r.resume()):(r.remain?this[N]="body":(this[N]="header",r.end()),this[$]?this[Y].push(r):(this[Y].push(r),this[ii]())))}}}[hs](){queueMicrotask(()=>this.emit("close"))}[ts](e){let t=!0;if(!e)this[$]=void 0,t=!1;else if(Array.isArray(e)){let[i,...s]=e;this.emit(i,...s)}else this[$]=e,this.emit("entry",e),e.emittedEnd||(e.on("end",()=>this[ii]()),t=!1);return t}[ii](){do;while(this[ts](this[Y].shift()));if(this[Y].length===0){let e=this[$];!e||e.flowing||e.size===e.remain?this[ve]||this.emit("drain"):e.once("drain",()=>this.emit("drain"))}}[ri](e,t){let i=this[ce];if(!i)throw Error("attempt to consume body without entry??");let s=i.blockRemain??0,r=s>=e.length&&t===0?e:e.subarray(t,t+s);return i.write(r),i.blockRemain||(this[N]="header",this[ce]=void 0,i.end()),r.length}[ss](e,t){let i=this[ce],s=this[ri](e,t);return!this[ce]&&i&&this[is](i),s}[me](e,t,i){this[Y].length===0&&!this[$]?this.emit(e,t,i):this[Y].push([e,t,i])}[is](e){switch(this[me]("meta",this[q]),e.type){case"ExtendedHeader":case"OldExtendedHeader":this[j]=rt.parse(this[q],this[j],!1);break;case"GlobalExtendedHeader":this[He]=rt.parse(this[q],this[He],!0);break;case"NextFileHasLongPath":case"OldGnuLongPath":{let t=this[j]??Object.create(null);this[j]=t,t.path=this[q].replace(/\0.*/,"");break}case"NextFileHasLongLinkpath":{let t=this[j]||Object.create(null);this[j]=t,t.linkpath=this[q].replace(/\0.*/,"");break}default:throw Error("unknown meta: "+e.type)}}abort(e){this[J]=!0,this.emit("abort",e),this.warn("TAR_ABORT",e,{recoverable:!1})}write(e,t,i){if(typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this[J])return i?.(),!1;if((this[_]===void 0||this.brotli===void 0&&this[_]===!1)&&e){if(this[y]&&(e=Buffer.concat([this[y],e]),this[y]=void 0),e.length<mh)return this[y]=e,i?.(),!0;for(let n=0;this[_]===void 0&&n<bi.length;n++)e[n]!==bi[n]&&(this[_]=!1);let r=!1;if(this[_]===!1&&this.zstd!==!1){r=!0;for(let n=0;n<gi.length;n++)if(e[n]!==gi[n]){r=!1;break}}let h=this.brotli===void 0&&!r;if(this[_]===!1&&h)if(e.length<512)if(this[Q])this.brotli=!0;else return this[y]=e,i?.(),!0;else try{new ae(e.subarray(0,512)),this.brotli=!1}catch{this.brotli=!0}if(this[_]===void 0||this[_]===!1&&(this.brotli||r)){let n=this[Q];this[Q]=!1,this[_]=this[_]===void 0?new Zr({}):r?new Yr({}):new Gr({}),this[_].on("data",a=>this[mt](a)),this[_].on("error",a=>this.abort(a)),this[_].on("end",()=>{this[Q]=!0,this[mt]()}),this[ve]=!0;let o=!!this[_][n?"end":"write"](e);return this[ve]=!1,i?.(),o}}this[ve]=!0,this[_]?this[_].write(e):this[mt](e),this[ve]=!1;let s=this[Y].length>0?!1:this[$]?this[$].flowing:!0;return!s&&this[Y].length===0&&this[$]?.once("drain",()=>this.emit("drain")),i?.(),s}[hi](e){e&&!this[J]&&(this[y]=this[y]?Buffer.concat([this[y],e]):e)}[yt](){if(this[Q]&&!this[si]&&!this[J]&&!this[Ze]){this[si]=!0;let e=this[ce];if(e&&e.blockRemain){let t=this[y]?this[y].length:0;this.warn("TAR_BAD_ARCHIVE",`Truncated input (needed ${e.blockRemain} more bytes, only ${t} available)`,{entry:e}),this[y]&&e.write(this[y]),e.end()}this[me](bt)}}[mt](e){if(this[Ze]&&e)this[hi](e);else if(!e&&!this[y])this[yt]();else if(e){if(this[Ze]=!0,this[y]){this[hi](e);let t=this[y];this[y]=void 0,this[pt](t)}else this[pt](e);for(;this[y]&&this[y]?.length>=512&&!this[J]&&!this[Et];){let t=this[y];this[y]=void 0,this[pt](t)}this[Ze]=!1}(!this[y]||this[Q])&&this[yt]()}[pt](e){let t=0,i=e.length;for(;t+512<=i&&!this[J]&&!this[Et];)switch(this[N]){case"begin":case"header":this[rs](e,t),t+=512;break;case"ignore":case"body":t+=this[ri](e,t);break;case"meta":t+=this[ss](e,t);break;default:throw Error("invalid state: "+this[N])}t<i&&(this[y]=this[y]?Buffer.concat([e.subarray(t),this[y]]):e.subarray(t))}end(e,t,i){return typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t)),i&&this.once("finish",i),this[J]||(this[_]?(e&&this[_].write(e),this[_].end()):(this[Q]=!0,(this.brotli===void 0||this.zstd===void 0)&&(e||=Buffer.alloc(0)),e&&this.write(e),this[yt]())),this}},qe=e=>{let t=e.length-1,i=-1;for(;t>-1&&e.charAt(t)==="/";)i=t,t--;return i===-1?e:e.slice(0,i)},yh=e=>{let t=e.onReadEntry;e.onReadEntry=t?i=>{t(i),i.resume()}:i=>i.resume()},Hi=(e,t)=>{let i=new Map(t.map(h=>[qe(h),!0])),s=e.filter,r=(h,n="")=>{let o=n||mr(h).root||".",a;if(h===o)a=!1;else{let l=i.get(h);a=l===void 0?r(pr(h),o):l}return i.set(h,a),a};e.filter=s?(h,n)=>s(h,n)&&r(qe(h)):h=>r(qe(h))},Be=ht(e=>{let t=new xe(e),i=e.file,s;try{s=d.openSync(i,"r");let r=d.fstatSync(s),h=e.maxReadSize||16*1024*1024;if(r.size<h){let n=Buffer.allocUnsafe(r.size),o=d.readSync(s,n,0,r.size,0);t.end(o===n.byteLength?n:n.subarray(0,o))}else{let n=0,o=Buffer.allocUnsafe(h);for(;n<r.size;){let a=d.readSync(s,o,0,h,n);if(a===0)break;n+=a,t.write(o.subarray(0,a))}t.end()}}finally{if(typeof s=="number")try{d.closeSync(s)}catch{}}},(e,t)=>{let i=new xe(e),s=e.maxReadSize||16*1024*1024,r=e.file;return new Promise((h,n)=>{i.on("error",n),i.on("end",h),d.stat(r,(o,a)=>{if(o)n(o);else{let l=new Pi(r,{readSize:s,size:a.size});l.on("error",n),l.pipe(i)}})})},e=>new xe(e),e=>new xe(e),(e,t)=>{t?.length&&Hi(e,t),e.noResume||yh(e)}),Zs=(e,t,i)=>(e&=4095,i&&(e=(e|384)&-19),t&&(e&256&&(e|=64),e&32&&(e|=8),e&4&&(e|=1)),e),{isAbsolute:bh,parse:ns}=ur,Zi=e=>{let t="",i=ns(e);for(;bh(e)||i.root;){let s=e.charAt(0)==="/"&&e.slice(0,4)!=="//?/"?"/":i.root;e=e.slice(s.length),t+=s,i=ns(e)}return[t,e]},zt=["|","<",">","?",":"],Wi=zt.map(e=>String.fromCodePoint(61440+Number(e.codePointAt(0)))),gh=new Map(zt.map((e,t)=>[e,Wi[t]])),Eh=new Map(Wi.map((e,t)=>[e,zt[t]])),os=e=>zt.reduce((t,i)=>t.split(i).join(gh.get(i)),e),wh=e=>Wi.reduce((t,i)=>t.split(i).join(Eh.get(i)),e),Ws=(e,t)=>t?(e=u(e).replace(/^\.(\/|$)/,""),qe(t)+"/"+e):u(e),_h=16*1024*1024,as=Symbol("process"),ls=Symbol("file"),ds=Symbol("directory"),Ei=Symbol("symlink"),us=Symbol("hardlink"),We=Symbol("header"),Ot=Symbol("read"),wi=Symbol("lstat"),Tt=Symbol("onlstat"),_i=Symbol("onread"),Ri=Symbol("onreadlink"),Si=Symbol("openfile"),vi=Symbol("onopenfile"),re=Symbol("close"),It=Symbol("mode"),Oi=Symbol("awaitDrain"),ni=Symbol("ondrain"),H=Symbol("prefix"),Gi=class extends _e{path;portable;myuid=process.getuid&&process.getuid()||0;myuser=process.env.USER||"";maxReadSize;linkCache;statCache;preservePaths;cwd;strict;mtime;noPax;noMtime;prefix;fd;blockLen=0;blockRemain=0;buf;pos=0;remain=0;length=0;offset=0;win32;absolute;header;type;linkpath;stat;onWriteEntry;#e=!1;constructor(e,t={}){let i=zi(t);super(),this.path=u(e),this.portable=!!i.portable,this.maxReadSize=i.maxReadSize||_h,this.linkCache=i.linkCache||new Map,this.statCache=i.statCache||new Map,this.preservePaths=!!i.preservePaths,this.cwd=u(i.cwd||process.cwd()),this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.mtime=i.mtime,this.prefix=i.prefix?u(i.prefix):void 0,this.onWriteEntry=i.onWriteEntry,typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let s=!1;if(!this.preservePaths){let[h,n]=Zi(this.path);h&&typeof n=="string"&&(this.path=n,s=h)}this.win32=!!i.win32||process.platform==="win32",this.win32&&(this.path=wh(this.path.replaceAll(/\\/g,"/")),e=e.replaceAll(/\\/g,"/")),this.absolute=u(i.absolute||st.resolve(this.cwd,e)),this.path===""&&(this.path="./"),s&&this.warn("TAR_ENTRY_INFO",`stripping ${s} from absolute path`,{entry:this,path:s+this.path});let r=this.statCache.get(this.absolute);r?this[Tt](r):this[wi]()}warn(e,t,i={}){return Pt(this,e,t,i)}emit(e,...t){return e==="error"&&(this.#e=!0),super.emit(e,...t)}[wi](){p.lstat(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[Tt](t)})}[Tt](e){this.statCache.set(this.absolute,e),this.stat=e,e.isFile()||(e.size=0),this.type=Rh(e),this.emit("stat",e),this[as]()}[as](){switch(this.type){case"File":return this[ls]();case"Directory":return this[ds]();case"SymbolicLink":return this[Ei]();default:return this.end()}}[It](e){return Zs(e,this.type==="Directory",this.portable)}[H](e){return Ws(e,this.prefix)}[We](){if(!this.stat)throw Error("cannot write header before stat");this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.onWriteEntry?.(this),this.header=new ae({path:this[H](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[H](this.linkpath):this.linkpath,mode:this[It](this.stat.mode),uid:this.portable?void 0:this.stat.uid,gid:this.portable?void 0:this.stat.gid,size:this.stat.size,mtime:this.noMtime?void 0:this.mtime||this.stat.mtime,type:this.type==="Unsupported"?void 0:this.type,uname:this.portable?void 0:this.stat.uid===this.myuid?this.myuser:"",atime:this.portable?void 0:this.stat.atime,ctime:this.portable?void 0:this.stat.ctime}),this.header.encode()&&!this.noPax&&super.write(new rt({atime:this.portable?void 0:this.header.atime,ctime:this.portable?void 0:this.header.ctime,gid:this.portable?void 0:this.header.gid,mtime:this.noMtime?void 0:this.mtime||this.header.mtime,path:this[H](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[H](this.linkpath):this.linkpath,size:this.header.size,uid:this.portable?void 0:this.header.uid,uname:this.portable?void 0:this.header.uname,dev:this.portable?void 0:this.stat.dev,ino:this.portable?void 0:this.stat.ino,nlink:this.portable?void 0:this.stat.nlink}).encode());let e=this.header?.block;if(!e)throw Error("failed to encode header");super.write(e)}[ds](){if(!this.stat)throw Error("cannot create directory entry without stat");this.path.slice(-1)!=="/"&&(this.path+="/"),this.stat.size=0,this[We](),this.end()}[Ei](){p.readlink(this.absolute,(e,t)=>{if(e)return this.emit("error",e);this[Ri](t)})}[Ri](e){this.linkpath=u(e),this[We](),this.end()}[us](e){if(!this.stat)throw Error("cannot create link entry without stat");this.type="Link",this.linkpath=u(st.relative(this.cwd,e)),this.stat.size=0,this[We](),this.end()}[ls](){if(!this.stat)throw Error("cannot create file entry without stat");if(this.stat.nlink>1){let e=`${this.stat.dev}:${this.stat.ino}`,t=this.linkCache.get(e);if(t?.indexOf(this.cwd)===0)return this[us](t);this.linkCache.set(e,this.absolute)}if(this[We](),this.stat.size===0)return this.end();this[Si]()}[Si](){p.open(this.absolute,"r",(e,t)=>{if(e)return this.emit("error",e);this[vi](t)})}[vi](e){if(this.fd=e,this.#e)return this[re]();if(!this.stat)throw Error("should stat before calling onopenfile");this.blockLen=512*Math.ceil(this.stat.size/512),this.blockRemain=this.blockLen;let t=Math.min(this.blockLen,this.maxReadSize);this.buf=Buffer.allocUnsafe(t),this.offset=0,this.pos=0,this.remain=this.stat.size,this.length=this.buf.length,this[Ot]()}[Ot](){let{fd:e,buf:t,offset:i,length:s,pos:r}=this;if(e===void 0||t===void 0)throw Error("cannot read file without first opening");p.read(e,t,i,s,r,(h,n)=>{if(h)return this[re](()=>this.emit("error",h));this[_i](n)})}[re](e=()=>{}){this.fd!==void 0&&p.close(this.fd,e)}[_i](e){if(e<=0&&this.remain>0){let i=Object.assign(Error("encountered unexpected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[re](()=>this.emit("error",i))}if(e>this.remain){let i=Object.assign(Error("did not encounter expected EOF"),{path:this.absolute,syscall:"read",code:"EOF"});return this[re](()=>this.emit("error",i))}if(!this.buf)throw Error("should have created buffer prior to reading");if(e===this.remain)for(let i=e;i<this.length&&e<this.blockRemain;i++)this.buf[i+this.offset]=0,e++,this.remain++;let t=this.offset===0&&e===this.buf.length?this.buf:this.buf.subarray(this.offset,this.offset+e);this.write(t)?this[ni]():this[Oi](()=>this[ni]())}[Oi](e){this.once("drain",e)}write(e,t,i){if(typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8")),this.blockRemain<e.length){let s=Object.assign(Error("writing more data than expected"),{path:this.absolute});return this.emit("error",s)}return this.remain-=e.length,this.blockRemain-=e.length,this.pos+=e.length,this.offset+=e.length,super.write(e,null,i)}[ni](){if(!this.remain)return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),this[re](e=>e?this.emit("error",e):this.end());if(!this.buf)throw Error("buffer lost somehow in ONDRAIN");this.offset>=this.length&&(this.buf=Buffer.allocUnsafe(Math.min(this.blockRemain,this.buf.length)),this.offset=0),this.length=this.buf.length-this.offset,this[Ot]()}},Gs=class extends Gi{sync=!0;[wi](){this[Tt](p.lstatSync(this.absolute))}[Ei](){this[Ri](p.readlinkSync(this.absolute))}[Si](){this[vi](p.openSync(this.absolute,"r"))}[Ot](){let e=!0;try{let{fd:t,buf:i,offset:s,length:r,pos:h}=this;if(t===void 0||i===void 0)throw Error("fd and buf must be set in READ method");let n=p.readSync(t,i,s,r,h);this[_i](n),e=!1}finally{if(e)try{this[re](()=>{})}catch{}}}[Oi](e){e()}[re](e=()=>{}){this.fd!==void 0&&p.closeSync(this.fd),e()}},$s=class extends _e{blockLen=0;blockRemain=0;buf=0;pos=0;remain=0;length=0;preservePaths;portable;strict;noPax;noMtime;readEntry;type;prefix;path;mode;uid;gid;uname;gname;header;mtime;atime;ctime;linkpath;size;onWriteEntry;warn(e,t,i={}){return Pt(this,e,t,i)}constructor(e,t={}){let i=zi(t);super(),this.preservePaths=!!i.preservePaths,this.portable=!!i.portable,this.strict=!!i.strict,this.noPax=!!i.noPax,this.noMtime=!!i.noMtime,this.onWriteEntry=i.onWriteEntry,this.readEntry=e;let{type:s}=e;if(s==="Unsupported")throw Error("writing entry that should be ignored");this.type=s,this.type==="Directory"&&this.portable&&(this.noMtime=!0),this.prefix=i.prefix,this.path=u(e.path),this.mode=e.mode===void 0?void 0:this[It](e.mode),this.uid=this.portable?void 0:e.uid,this.gid=this.portable?void 0:e.gid,this.uname=this.portable?void 0:e.uname,this.gname=this.portable?void 0:e.gname,this.size=e.size,this.mtime=this.noMtime?void 0:i.mtime||e.mtime,this.atime=this.portable?void 0:e.atime,this.ctime=this.portable?void 0:e.ctime,this.linkpath=e.linkpath===void 0?void 0:u(e.linkpath),typeof i.onwarn=="function"&&this.on("warn",i.onwarn);let r=!1;if(!this.preservePaths){let[n,o]=Zi(this.path);n&&typeof o=="string"&&(this.path=o,r=n)}this.remain=e.size,this.blockRemain=e.startBlockSize,this.onWriteEntry?.(this),this.header=new ae({path:this[H](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[H](this.linkpath):this.linkpath,mode:this.mode,uid:this.portable?void 0:this.uid,gid:this.portable?void 0:this.gid,size:this.size,mtime:this.noMtime?void 0:this.mtime,type:this.type,uname:this.portable?void 0:this.uname,atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime}),r&&this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute path`,{entry:this,path:r+this.path}),this.header.encode()&&!this.noPax&&super.write(new rt({atime:this.portable?void 0:this.atime,ctime:this.portable?void 0:this.ctime,gid:this.portable?void 0:this.gid,mtime:this.noMtime?void 0:this.mtime,path:this[H](this.path),linkpath:this.type==="Link"&&this.linkpath!==void 0?this[H](this.linkpath):this.linkpath,size:this.size,uid:this.portable?void 0:this.uid,uname:this.portable?void 0:this.uname,dev:this.portable?void 0:this.readEntry.dev,ino:this.portable?void 0:this.readEntry.ino,nlink:this.portable?void 0:this.readEntry.nlink}).encode());let h=this.header?.block;if(!h)throw Error("failed to encode header");super.write(h),e.pipe(this)}[H](e){return Ws(e,this.prefix)}[It](e){return Zs(e,this.type==="Directory",this.portable)}write(e,t,i){typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,typeof t=="string"?t:"utf8"));let s=e.length;if(s>this.blockRemain)throw Error("writing more to entry than is appropriate");return this.blockRemain-=s,super.write(e,i)}end(e,t,i){return this.blockRemain&&super.write(Buffer.alloc(this.blockRemain)),typeof e=="function"&&(i=e,t=void 0,e=void 0),typeof t=="function"&&(i=t,t=void 0),typeof e=="string"&&(e=Buffer.from(e,t??"utf8")),i&&this.once("finish",i),e?super.end(e,i):super.end(i),this}},Rh=e=>e.isFile()?"File":e.isDirectory()?"Directory":e.isSymbolicLink()?"SymbolicLink":"Unsupported",Sh=class De{tail;head;length=0;static create(t=[]){return new De(t)}constructor(t=[]){for(let i of t)this.push(i)}*[Symbol.iterator](){for(let t=this.head;t;t=t.next)yield t.value}removeNode(t){if(t.list!==this)throw Error("removing node which does not belong to this list");let i=t.next,s=t.prev;return i&&(i.prev=s),s&&(s.next=i),t===this.head&&(this.head=i),t===this.tail&&(this.tail=s),this.length--,t.next=void 0,t.prev=void 0,t.list=void 0,i}unshiftNode(t){if(t===this.head)return;t.list&&t.list.removeNode(t);let i=this.head;t.list=this,t.next=i,i&&(i.prev=t),this.head=t,this.tail||=t,this.length++}pushNode(t){if(t===this.tail)return;t.list&&t.list.removeNode(t);let i=this.tail;t.list=this,t.prev=i,i&&(i.next=t),this.tail=t,this.head||=t,this.length++}push(...t){for(let i=0,s=t.length;i<s;i++)Oh(this,t[i]);return this.length}unshift(...t){for(var i=0,s=t.length;i<s;i++)Th(this,t[i]);return this.length}pop(){if(!this.tail)return;let t=this.tail.value,i=this.tail;return this.tail=this.tail.prev,this.tail?this.tail.next=void 0:this.head=void 0,i.list=void 0,this.length--,t}shift(){if(!this.head)return;let t=this.head.value,i=this.head;return this.head=this.head.next,this.head?this.head.prev=void 0:this.tail=void 0,i.list=void 0,this.length--,t}forEach(t,i){i||=this;for(let s=this.head,r=0;s;r++)t.call(i,s.value,r,this),s=s.next}forEachReverse(t,i){i||=this;for(let s=this.tail,r=this.length-1;s;r--)t.call(i,s.value,r,this),s=s.prev}get(t){let i=0,s=this.head;for(;s&&i<t;i++)s=s.next;if(i===t&&s)return s.value}getReverse(t){let i=0,s=this.tail;for(;s&&i<t;i++)s=s.prev;if(i===t&&s)return s.value}map(t,i){i||=this;let s=new De;for(let r=this.head;r;)s.push(t.call(i,r.value,this)),r=r.next;return s}mapReverse(t,i){i||=this;var s=new De;for(let r=this.tail;r;)s.push(t.call(i,r.value,this)),r=r.prev;return s}reduce(t,i){let s,r=this.head;if(arguments.length>1)s=i;else if(this.head)r=this.head.next,s=this.head.value;else throw TypeError("Reduce of empty list with no initial value");for(var h=0;r;h++)s=t(s,r.value,h),r=r.next;return s}reduceReverse(t,i){let s,r=this.tail;if(arguments.length>1)s=i;else if(this.tail)r=this.tail.prev,s=this.tail.value;else throw TypeError("Reduce of empty list with no initial value");for(let h=this.length-1;r;h--)s=t(s,r.value,h),r=r.prev;return s}toArray(){let t=Array(this.length);for(let i=0,s=this.head;s;i++)t[i]=s.value,s=s.next;return t}toArrayReverse(){let t=Array(this.length);for(let i=0,s=this.tail;s;i++)t[i]=s.value,s=s.prev;return t}slice(t=0,i=this.length){i<0&&(i+=this.length),t<0&&(t+=this.length);let s=new De;if(i<t||i<0)return s;t<0&&(t=0),i>this.length&&(i=this.length);let r=this.head,h=0;for(h=0;r&&h<t;h++)r=r.next;for(;r&&h<i;h++,r=r.next)s.push(r.value);return s}sliceReverse(t=0,i=this.length){i<0&&(i+=this.length),t<0&&(t+=this.length);let s=new De;if(i<t||i<0)return s;t<0&&(t=0),i>this.length&&(i=this.length);let r=this.length,h=this.tail;for(;h&&r>i;r--)h=h.prev;for(;h&&r>t;r--,h=h.prev)s.push(h.value);return s}splice(t,i=0,...s){t>this.length&&(t=this.length-1),t<0&&(t=this.length+t);let r=this.head;for(let n=0;r&&n<t;n++)r=r.next;let h=[];for(let n=0;r&&n<i;n++)h.push(r.value),r=this.removeNode(r);r?r!==this.tail&&(r=r.prev):r=this.tail;for(let n of s)r=vh(this,r,n);return h}reverse(){let t=this.head,i=this.tail;for(let s=t;s;s=s.prev){let r=s.prev;s.prev=s.next,s.next=r}return this.head=i,this.tail=t,this}};function vh(e,t,i){let s=new $i(i,t,t?t.next:e.head,e);return s.next===void 0&&(e.tail=s),s.prev===void 0&&(e.head=s),e.length++,s}function Oh(e,t){e.tail=new $i(t,e.tail,void 0,e),e.head||=e.tail,e.length++}function Th(e,t){e.head=new $i(t,void 0,e.head,e),e.tail||=e.head,e.length++}var $i=class{list;next;prev;value;constructor(e,t,i,s){this.list=s,this.value=e,t?(t.next=this,this.prev=t):this.prev=void 0,i?(i.prev=this,this.next=i):this.next=void 0}},Ti=class{path;absolute;entry;stat;readdir;pending=!1;pendingLink=!1;ignore=!1;piped=!1;constructor(e,t){this.path=e||"./",this.absolute=t}},fs=Buffer.alloc(1024),kt=Symbol("onStat"),Ge=Symbol("ended"),F=Symbol("queue"),$e=Symbol("pendingLinks"),ee=Symbol("current"),ye=Symbol("process"),Ye=Symbol("processing"),wt=Symbol("processJob"),M=Symbol("jobs"),oi=Symbol("jobDone"),Lt=Symbol("addFSEntry"),cs=Symbol("addTarEntry"),ki=Symbol("stat"),Li=Symbol("readdir"),At=Symbol("onreaddir"),Dt=Symbol("pipe"),ms=Symbol("entry"),ai=Symbol("entryOpt"),xt=Symbol("writeEntryClass"),Ys=Symbol("write"),li=Symbol("ondrain"),nt=class extends _e{sync=!1;opt;cwd;maxReadSize;preservePaths;strict;noPax;prefix;linkCache;statCache;file;portable;zip;readdirCache;noDirRecurse;follow;noMtime;mtime;filter;jobs;[xt];onWriteEntry;[F];[$e]=new Map;[M]=0;[Ye]=!1;[Ge]=!1;constructor(e={}){if(super(),this.opt=e,this.file=e.file||"",this.cwd=e.cwd||process.cwd(),this.maxReadSize=e.maxReadSize,this.preservePaths=!!e.preservePaths,this.strict=!!e.strict,this.noPax=!!e.noPax,this.prefix=u(e.prefix||""),this.linkCache=e.linkCache||new Map,this.statCache=e.statCache||new Map,this.readdirCache=e.readdirCache||new Map,this.onWriteEntry=e.onWriteEntry,this[xt]=Gi,typeof e.onwarn=="function"&&this.on("warn",e.onwarn),this.portable=!!e.portable,e.gzip||e.brotli||e.zstd){if(+!!e.gzip+ +!!e.brotli+ +!!e.zstd>1)throw TypeError("gzip, brotli, zstd are mutually exclusive");if(e.gzip&&(typeof e.gzip!="object"&&(e.gzip={}),this.portable&&(e.gzip.portable=!0),this.zip=new Hr(e.gzip)),e.brotli&&(typeof e.brotli!="object"&&(e.brotli={}),this.zip=new Wr(e.brotli)),e.zstd&&(typeof e.zstd!="object"&&(e.zstd={}),this.zip=new $r(e.zstd)),!this.zip)throw Error("impossible");let t=this.zip;t.on("data",i=>super.write(i)),t.on("end",()=>super.end()),t.on("drain",()=>this[li]()),this.on("resume",()=>t.resume())}else this.on("drain",this[li]);this.noDirRecurse=!!e.noDirRecurse,this.follow=!!e.follow,this.noMtime=!!e.noMtime,e.mtime&&(this.mtime=e.mtime),this.filter=typeof e.filter=="function"?e.filter:()=>!0,this[F]=new Sh,this[M]=0,this.jobs=Number(e.jobs)||4,this[Ye]=!1,this[Ge]=!1}[Ys](e){return super.write(e)}add(e){return this.write(e),this}end(e,t,i){return typeof e=="function"&&(i=e,e=void 0),typeof t=="function"&&(i=t,t=void 0),e&&this.add(e),this[Ge]=!0,this[ye](),i&&i(),this}write(e){if(this[Ge])throw Error("write after end");return typeof e=="string"?this[Lt](e):this[cs](e),this.flowing}[cs](e){let t=u(st.resolve(this.cwd,e.path));if(!this.filter(e.path,e))e.resume();else{let i=new Ti(e.path,t);i.entry=new $s(e,this[ai](i)),i.entry.on("end",()=>this[oi](i)),this[M]+=1,this[F].push(i)}this[ye]()}[Lt](e){let t=u(st.resolve(this.cwd,e));this[F].push(new Ti(e,t)),this[ye]()}[ki](e){e.pending=!0,this[M]+=1,p[this.follow?"stat":"lstat"](e.absolute,(t,i)=>{e.pending=!1,--this[M],t?this.emit("error",t):this[kt](e,i)})}[kt](e,t){if(this.statCache.set(e.absolute,t),e.stat=t,!this.filter(e.path,t))e.ignore=!0;else if(t.isFile()&&t.nlink>1&&!this.linkCache.get(`${t.dev}:${t.ino}`)&&!this.sync)if(e===this[ee])this[wt](e);else{let i=`${t.dev}:${t.ino}`,s=this[$e].get(i);s?s.push(e):this[$e].set(i,[e]),e.pendingLink=!0,e.pending=!0}this[ye]()}[Li](e){e.pending=!0,this[M]+=1,p.readdir(e.absolute,(t,i)=>{if(e.pending=!1,--this[M],t)return this.emit("error",t);this[At](e,i)})}[At](e,t){this.readdirCache.set(e.absolute,t),e.readdir=t,this[ye]()}[ye](){if(!this[Ye]){this[Ye]=!0;for(let e=this[F].head;e&&this[M]<this.jobs;e=e.next)if(this[wt](e.value),e.value.ignore){let t=e.next;this[F].removeNode(e),e.next=t}this[Ye]=!1,this[Ge]&&this[F].length===0&&this[M]===0&&(this.zip?this.zip.end(fs):(super.write(fs),super.end()))}}get[ee](){return this[F]&&this[F].head&&this[F].head.value}[oi](e){this[F].shift(),--this[M];let{stat:t}=e;if(t&&t.isFile()&&t.nlink>1){let i=`${t.dev}:${t.ino}`,s=this[$e].get(i);if(s){this[$e].delete(i);for(let r of s)r.pending=!1,this[wt](r)}}this[ye]()}[wt](e){if(e.pending&&e.pendingLink&&e===this[ee]&&(e.pending=!1,e.pendingLink=!1),!e.pending){if(e.entry){e===this[ee]&&!e.piped&&this[Dt](e);return}if(!e.stat){let t=this.statCache.get(e.absolute);t?this[kt](e,t):this[ki](e)}if(e.stat&&!e.ignore){if(!this.noDirRecurse&&e.stat.isDirectory()&&!e.readdir){let t=this.readdirCache.get(e.absolute);if(t?this[At](e,t):this[Li](e),!e.readdir)return}if(e.entry=this[ms](e),!e.entry){e.ignore=!0;return}e===this[ee]&&!e.piped&&this[Dt](e)}}}[ai](e){return{onwarn:(t,i,s)=>this.warn(t,i,s),noPax:this.noPax,cwd:this.cwd,absolute:e.absolute,preservePaths:this.preservePaths,maxReadSize:this.maxReadSize,strict:this.strict,portable:this.portable,linkCache:this.linkCache,statCache:this.statCache,noMtime:this.noMtime,mtime:this.mtime,prefix:this.prefix,onWriteEntry:this.onWriteEntry}}[ms](e){this[M]+=1;try{return new this[xt](e.path,this[ai](e)).on("end",()=>this[oi](e)).on("error",t=>this.emit("error",t))}catch(t){this.emit("error",t)}}[li](){this[ee]&&this[ee].entry&&this[ee].entry.resume()}[Dt](e){e.piped=!0,e.readdir&&e.readdir.forEach(s=>{let r=e.path,h=r==="./"?"":r.replace(/\/*$/,"/");this[Lt](h+s)});let t=e.entry,i=this.zip;if(!t)throw Error("cannot pipe without source");i?t.on("data",s=>{i.write(s)||t.pause()}):t.on("data",s=>{super.write(s)||t.pause()})}pause(){return this.zip&&this.zip.pause(),super.pause()}warn(e,t,i={}){Pt(this,e,t,i)}},Ut=class extends nt{sync=!0;constructor(e){super(e),this[xt]=Gs}pause(){}resume(){}[ki](e){let t=this.follow?"statSync":"lstatSync";this[kt](e,p[t](e.absolute))}[Li](e){this[At](e,p.readdirSync(e.absolute))}[Dt](e){let t=e.entry,i=this.zip;if(e.readdir&&e.readdir.forEach(s=>{let r=e.path,h=r==="./"?"":r.replace(/\/*$/,"/");this[Lt](h+s)}),!t)throw Error("Cannot pipe without source");i?t.on("data",s=>{i.write(s)}):t.on("data",s=>{super[Ys](s)})}},kh=(e,t)=>{let i=new Ut(e),s=new Is(e.file,{mode:e.mode||438});i.pipe(s),Vs(i,t)},Lh=(e,t)=>{let i=new nt(e),s=new Mt(e.file,{mode:e.mode||438});i.pipe(s);let r=new Promise((h,n)=>{s.on("error",n),s.on("close",h),i.on("error",n)});return Ks(i,t).catch(h=>i.emit("error",h)),r},Vs=(e,t)=>{t.forEach(i=>{i.charAt(0)==="@"?Be({file:c.resolve(e.cwd,i.slice(1)),sync:!0,noResume:!0,onReadEntry:s=>e.add(s)}):e.add(i)}),e.end()},Ks=async(e,t)=>{for(let i of t)i.charAt(0)==="@"?await Be({file:c.resolve(String(e.cwd),i.slice(1)),noResume:!0,onReadEntry:s=>{e.add(s)}}):e.add(i);e.end()},ps=ht(kh,Lh,(e,t)=>{let i=new Ut(e);return Vs(i,t),i},(e,t)=>{let i=new nt(e);return Ks(i,t).catch(s=>i.emit("error",s)),i},(e,t)=>{if(!t?.length)throw TypeError("no paths specified to add to archive")}),Xs=(process.env.__FAKE_PLATFORM__||process.platform)==="win32",{O_CREAT:qs,O_NOFOLLOW:ys,O_TRUNC:Qs,O_WRONLY:Js}=p.constants,er=Number(process.env.__FAKE_FS_O_FILENAME__)||p.constants.UV_FS_O_FILEMAP||0,Ah=Xs&&!!er,Dh=512*1024,xh=er|Qs|qs|Js,bs=!Xs&&typeof ys=="number"?ys|Qs|qs|Js:null,tr=bs===null?Ah?e=>e<Dh?xh:"w":()=>"w":()=>bs,Ai=(e,t,i)=>{try{return d.lchownSync(e,t,i)}catch(s){if(s?.code!=="ENOENT")throw s}},Bt=(e,t,i,s)=>{d.lchown(e,t,i,r=>{s(r&&r?.code!=="ENOENT"?r:null)})},Nh=(e,t,i,s,r)=>{t.isDirectory()?ir(c.resolve(e,t.name),i,s,h=>{if(h)return r(h);Bt(c.resolve(e,t.name),i,s,r)}):Bt(c.resolve(e,t.name),i,s,r)},ir=(e,t,i,s)=>{d.readdir(e,{withFileTypes:!0},(r,h)=>{if(r){if(r.code==="ENOENT")return s();if(r.code!=="ENOTDIR"&&r.code!=="ENOTSUP")return s(r)}if(r||!h.length)return Bt(e,t,i,s);let n=h.length,o=null,a=l=>{if(!o){if(l)return s(o=l);if(--n===0)return Bt(e,t,i,s)}};for(let l of h)Nh(e,l,t,i,a)})},Ih=(e,t,i,s)=>{t.isDirectory()&&sr(c.resolve(e,t.name),i,s),Ai(c.resolve(e,t.name),i,s)},sr=(e,t,i)=>{let s;try{s=d.readdirSync(e,{withFileTypes:!0})}catch(r){let h=r;if(h?.code==="ENOENT")return;if(h?.code==="ENOTDIR"||h?.code==="ENOTSUP")return Ai(e,t,i);throw h}for(let r of s)Ih(e,r,t,i);return Ai(e,t,i)},rr=class extends Error{path;code;syscall="chdir";constructor(e,t){super(`${t}: Cannot cd into '${e}'`),this.path=e,this.code=t}get name(){return"CwdError"}},jt=class extends Error{path;symlink;syscall="symlink";code="TAR_SYMLINK_ERROR";constructor(e,t){super("TAR_SYMLINK_ERROR: Cannot extract through symbolic link"),this.symlink=e,this.path=t}get name(){return"SymlinkError"}},Bh=(e,t)=>{d.stat(e,(i,s)=>{(i||!s.isDirectory())&&(i=new rr(e,i?.code||"ENOTDIR")),t(i)})},Fh=(e,t,i)=>{e=u(e);let s=t.umask??18,r=t.mode|448,h=(r&s)!==0,n=t.uid,o=t.gid,a=typeof n=="number"&&typeof o=="number"&&(n!==t.processUid||o!==t.processGid),l=t.preserve,f=t.unlink,b=u(t.cwd),g=(T,w)=>{T?i(T):w&&a?ir(w,n,o,k=>g(k)):h?d.chmod(e,r,i):i()};if(e===b)return Bh(e,g);if(l)return lr.mkdir(e,{mode:r,recursive:!0}).then(T=>g(null,T??void 0),g);Di(b,u(c.relative(b,e)).split("/"),r,f,b,void 0,g)},Di=(e,t,i,s,r,h,n)=>{if(t.length===0)return n(null,h);let o=t.shift(),a=u(c.resolve(e+"/"+o));d.mkdir(a,i,hr(a,t,i,s,r,h,n))},hr=(e,t,i,s,r,h,n)=>o=>{o?d.lstat(e,(a,l)=>{if(a)a.path=a.path&&u(a.path),n(a);else if(l.isDirectory())Di(e,t,i,s,r,h,n);else if(s)d.unlink(e,f=>{if(f)return n(f);d.mkdir(e,i,hr(e,t,i,s,r,h,n))});else{if(l.isSymbolicLink())return n(new jt(e,e+"/"+t.join("/")));n(o)}}):(h||=e,Di(e,t,i,s,r,h,n))},Mh=e=>{let t=!1,i;try{t=d.statSync(e).isDirectory()}catch(s){i=s?.code}finally{if(!t)throw new rr(e,i??"ENOTDIR")}},Ch=(e,t)=>{e=u(e);let i=t.umask??18,s=t.mode|448,r=(s&i)!==0,h=t.uid,n=t.gid,o=typeof h=="number"&&typeof n=="number"&&(h!==t.processUid||n!==t.processGid),a=t.preserve,l=t.unlink,f=u(t.cwd),b=w=>{w&&o&&sr(w,h,n),r&&d.chmodSync(e,s)};if(e===f)return Mh(f),b();if(a)return b(d.mkdirSync(e,{mode:s,recursive:!0})??void 0);let g=u(c.relative(f,e)).split("/"),T;for(let w=g.shift(),k=f;w&&(k+="/"+w);w=g.shift()){k=u(c.resolve(k));try{d.mkdirSync(k,s),T||=k}catch{let Yi=d.lstatSync(k);if(Yi.isDirectory())continue;if(l){d.unlinkSync(k),d.mkdirSync(k,s),T||=k;continue}else if(Yi.isSymbolicLink())return new jt(k,k+"/"+g.join("/"))}}return b(T)},di=Object.create(null),gs=1e4,Oe=new Set,Ph=e=>{Oe.has(e)?Oe.delete(e):di[e]=e.normalize("NFD").toLocaleLowerCase("en").toLocaleUpperCase("en"),Oe.add(e);let t=di[e],i=Oe.size-gs;if(i>gs/10){for(let s of Oe)if(Oe.delete(s),delete di[s],--i<=0)break}return t},zh=(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)==="win32",Uh=e=>e.split("/").slice(0,-1).reduce((t,i)=>{let s=t.at(-1);return s!==void 0&&(i=As(s,i)),t.push(i||"/"),t},[]),jh=class{#e=new Map;#i=new Map;#s=new Set;reserve(e,t){e=zh?["win32 parallelization disabled"]:e.map(s=>qe(As(Ph(s))));let i=new Set(e.map(s=>Uh(s)).reduce((s,r)=>s.concat(r)));this.#i.set(t,{dirs:i,paths:e});for(let s of e){let r=this.#e.get(s);r?r.push(t):this.#e.set(s,[t])}for(let s of i){let r=this.#e.get(s);if(!r)this.#e.set(s,[new Set([t])]);else{let h=r.at(-1);h instanceof Set?h.add(t):r.push(new Set([t]))}}return this.#r(t)}#h(e){let t=this.#i.get(e);if(!t)throw Error("function does not have any path reservations");return{paths:t.paths.map(i=>this.#e.get(i)),dirs:[...t.dirs].map(i=>this.#e.get(i))}}check(e){let{paths:t,dirs:i}=this.#h(e);return t.every(s=>s&&s[0]===e)&&i.every(s=>s&&s[0]instanceof Set&&s[0].has(e))}#r(e){return this.#s.has(e)||!this.check(e)?!1:(this.#s.add(e),e(()=>this.#t(e)),!0)}#t(e){if(!this.#s.has(e))return!1;let t=this.#i.get(e);if(!t)throw Error("invalid reservation");let{paths:i,dirs:s}=t,r=new Set;for(let h of i){let n=this.#e.get(h);if(!n||n?.[0]!==e)continue;let o=n[1];if(!o){this.#e.delete(h);continue}if(n.shift(),typeof o=="function")r.add(o);else for(let a of o)r.add(a)}for(let h of s){let n=this.#e.get(h),o=n?.[0];if(!(!n||!(o instanceof Set)))if(o.size===1&&n.length===1){this.#e.delete(h);continue}else if(o.size===1){n.shift();let a=n[0];typeof a=="function"&&r.add(a)}else o.delete(e)}return this.#s.delete(e),r.forEach(h=>this.#r(h)),!0}},Hh=()=>process.umask(),Es=Symbol("onEntry"),xi=Symbol("checkFs"),ws=Symbol("checkFs2"),Ni=Symbol("isReusable"),I=Symbol("makeFs"),Ii=Symbol("file"),Bi=Symbol("directory"),Nt=Symbol("link"),_s=Symbol("symlink"),Rs=Symbol("hardlink"),Ke=Symbol("ensureNoSymlink"),Ss=Symbol("unsupported"),vs=Symbol("checkPath"),ui=Symbol("stripAbsolutePath"),he=Symbol("mkdir"),O=Symbol("onError"),_t=Symbol("pending"),Os=Symbol("pend"),Te=Symbol("unpend"),fi=Symbol("ended"),ci=Symbol("maybeClose"),Fi=Symbol("skip"),Qe=Symbol("doChown"),Je=Symbol("uid"),et=Symbol("gid"),tt=Symbol("checkedCwd"),it=(process.env.TESTING_TAR_FAKE_PLATFORM||process.platform)==="win32",Zh=1024,Wh=(e,t)=>{if(!it)return d.unlink(e,t);let i=e+".DELETE."+xs(16).toString("hex");d.rename(e,i,s=>{if(s)return t(s);d.unlink(i,t)})},Gh=e=>{if(!it)return d.unlinkSync(e);let t=e+".DELETE."+xs(16).toString("hex");d.renameSync(e,t),d.unlinkSync(t)},Ts=(e,t,i)=>e!==void 0&&e===e>>>0?e:t!==void 0&&t===t>>>0?t:i,Ft=class extends xe{[fi]=!1;[tt]=!1;[_t]=0;reservations=new jh;transform;writable=!0;readable=!1;uid;gid;setOwner;preserveOwner;processGid;processUid;maxDepth;forceChown;win32;newer;keep;noMtime;preservePaths;unlink;cwd;strip;processUmask;umask;dmode;fmode;chmod;constructor(e={}){if(e.ondone=()=>{this[fi]=!0,this[ci]()},super(e),this.transform=e.transform,this.chmod=!!e.chmod,typeof e.uid=="number"||typeof e.gid=="number"){if(typeof e.uid!="number"||typeof e.gid!="number")throw TypeError("cannot set owner without number uid and gid");if(e.preserveOwner)throw TypeError("cannot preserve owner in archive and also set owner explicitly");this.uid=e.uid,this.gid=e.gid,this.setOwner=!0}else this.uid=void 0,this.gid=void 0,this.setOwner=!1;this.preserveOwner=e.preserveOwner===void 0&&typeof e.uid!="number"?!!(process.getuid&&process.getuid()===0):!!e.preserveOwner,this.processUid=(this.preserveOwner||this.setOwner)&&process.getuid?process.getuid():void 0,this.processGid=(this.preserveOwner||this.setOwner)&&process.getgid?process.getgid():void 0,this.maxDepth=typeof e.maxDepth=="number"?e.maxDepth:Zh,this.forceChown=e.forceChown===!0,this.win32=!!e.win32||it,this.newer=!!e.newer,this.keep=!!e.keep,this.noMtime=!!e.noMtime,this.preservePaths=!!e.preservePaths,this.unlink=!!e.unlink,this.cwd=u(c.resolve(e.cwd||process.cwd())),this.strip=Number(e.strip)||0,this.processUmask=this.chmod?typeof e.processUmask=="number"?e.processUmask:Hh():0,this.umask=typeof e.umask=="number"?e.umask:this.processUmask,this.dmode=e.dmode||511&~this.umask,this.fmode=e.fmode||438&~this.umask,this.on("entry",t=>this[Es](t))}warn(e,t,i={}){return(e==="TAR_BAD_ARCHIVE"||e==="TAR_ABORT")&&(i.recoverable=!1),super.warn(e,t,i)}[ci](){this[fi]&&this[_t]===0&&(this.emit("prefinish"),this.emit("finish"),this.emit("end"))}[ui](e,t){let i=e[t],{type:s}=e;if(!i||this.preservePaths)return!0;let[r,h]=Zi(i),n=h.replaceAll(/\\/g,"/").split("/");if(n.includes("..")||it&&/^[a-z]:\.\.$/i.test(n[0]??"")){if(t==="path"||s==="Link")return this.warn("TAR_ENTRY_ERROR",`${t} contains '..'`,{entry:e,[t]:i}),!1;let o=c.posix.dirname(e.path),a=c.posix.normalize(c.posix.join(o,n.join("/")));if(a.startsWith("../")||a==="..")return this.warn("TAR_ENTRY_ERROR",`${t} escapes extraction directory`,{entry:e,[t]:i}),!1}return r&&(e[t]=String(h),this.warn("TAR_ENTRY_INFO",`stripping ${r} from absolute ${t}`,{entry:e,[t]:i})),!0}[vs](e){let t=u(e.path),i=t.split("/");if(this.strip){if(i.length<this.strip)return!1;if(e.type==="Link"){let s=u(String(e.linkpath)).split("/");if(s.length>=this.strip)e.linkpath=s.slice(this.strip).join("/");else return!1}i.splice(0,this.strip),e.path=i.join("/")}if(isFinite(this.maxDepth)&&i.length>this.maxDepth)return this.warn("TAR_ENTRY_ERROR","path excessively deep",{entry:e,path:t,depth:i.length,maxDepth:this.maxDepth}),!1;if(!this[ui](e,"path")||!this[ui](e,"linkpath"))return!1;if(e.absolute=c.isAbsolute(e.path)?u(c.resolve(e.path)):u(c.resolve(this.cwd,e.path)),!this.preservePaths&&typeof e.absolute=="string"&&e.absolute.indexOf(this.cwd+"/")!==0&&e.absolute!==this.cwd)return this.warn("TAR_ENTRY_ERROR","path escaped extraction target",{entry:e,path:u(e.path),resolvedPath:e.absolute,cwd:this.cwd}),!1;if(e.absolute===this.cwd&&e.type!=="Directory"&&e.type!=="GNUDumpDir")return!1;if(this.win32){let{root:s}=c.win32.parse(String(e.absolute));e.absolute=s+os(String(e.absolute).slice(s.length));let{root:r}=c.win32.parse(e.path);e.path=r+os(e.path.slice(r.length))}return!0}[Es](e){if(!this[vs](e))return e.resume();switch(br.equal(typeof e.absolute,"string"),e.type){case"Directory":case"GNUDumpDir":e.mode&&(e.mode|=448);case"File":case"OldFile":case"ContiguousFile":case"Link":case"SymbolicLink":return this[xi](e);default:return this[Ss](e)}}[O](e,t){e.name==="CwdError"?this.emit("error",e):(this.warn("TAR_ENTRY_ERROR",e,{entry:t}),this[Te](),t.resume())}[he](e,t,i){Fh(u(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:t},i)}[Qe](e){return this.forceChown||this.preserveOwner&&(typeof e.uid=="number"&&e.uid!==this.processUid||typeof e.gid=="number"&&e.gid!==this.processGid)||typeof this.uid=="number"&&this.uid!==this.processUid||typeof this.gid=="number"&&this.gid!==this.processGid}[Je](e){return Ts(this.uid,e.uid,this.processUid)}[et](e){return Ts(this.gid,e.gid,this.processGid)}[Ii](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.fmode,s=new Mt(String(e.absolute),{flags:tr(e.size),mode:i,autoClose:!1});s.on("error",o=>{s.fd&&d.close(s.fd,()=>{}),s.write=()=>!0,this[O](o,e),t()});let r=1,h=o=>{if(o){s.fd&&d.close(s.fd,()=>{}),this[O](o,e),t();return}--r===0&&s.fd!==void 0&&d.close(s.fd,a=>{a?this[O](a,e):this[Te](),t()})};s.on("finish",()=>{let o=String(e.absolute),a=s.fd;if(typeof a=="number"&&e.mtime&&!this.noMtime){r++;let l=e.atime||new Date,f=e.mtime;d.futimes(a,l,f,b=>b?d.utimes(o,l,f,g=>h(g&&b)):h())}if(typeof a=="number"&&this[Qe](e)){r++;let l=this[Je](e),f=this[et](e);typeof l=="number"&&typeof f=="number"&&d.fchown(a,l,f,b=>b?d.chown(o,l,f,g=>h(g&&b)):h())}h()});let n=this.transform&&this.transform(e)||e;n!==e&&(n.on("error",o=>{this[O](o,e),t()}),e.pipe(n)),n.pipe(s)}[Bi](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.dmode;this[he](String(e.absolute),i,s=>{if(s){this[O](s,e),t();return}let r=1,h=()=>{--r===0&&(t(),this[Te](),e.resume())};e.mtime&&!this.noMtime&&(r++,d.utimes(String(e.absolute),e.atime||new Date,e.mtime,h)),this[Qe](e)&&(r++,d.chown(String(e.absolute),Number(this[Je](e)),Number(this[et](e)),h)),h()})}[Ss](e){e.unsupported=!0,this.warn("TAR_ENTRY_UNSUPPORTED",`unsupported entry type: ${e.type}`,{entry:e}),e.resume()}[_s](e,t){let i=u(c.relative(this.cwd,c.resolve(c.dirname(String(e.absolute)),String(e.linkpath)))).split("/");this[Ke](e,this.cwd,i,()=>this[Nt](e,String(e.linkpath),"symlink",t),s=>{this[O](s,e),t()})}[Rs](e,t){let i=u(c.resolve(this.cwd,String(e.linkpath))),s=u(String(e.linkpath)).split("/");this[Ke](e,this.cwd,s,()=>this[Nt](e,i,"link",t),r=>{this[O](r,e),t()})}[Ke](e,t,i,s,r){let h=i.shift();if(this.preservePaths||h===void 0)return s();let n=c.resolve(t,h);d.lstat(n,(o,a)=>{if(o)return s();if(a?.isSymbolicLink())return r(new jt(n,c.resolve(n,i.join("/"))));this[Ke](e,n,i,s,r)})}[Os](){this[_t]++}[Te](){this[_t]--,this[ci]()}[Fi](e){this[Te](),e.resume()}[Ni](e,t){return e.type==="File"&&!this.unlink&&t.isFile()&&t.nlink<=1&&!it}[xi](e){this[Os]();let t=[e.path];e.linkpath&&t.push(e.linkpath),this.reservations.reserve(t,i=>this[ws](e,i))}[ws](e,t){let i=n=>{t(n)},s=()=>{this[he](this.cwd,this.dmode,n=>{if(n){this[O](n,e),i();return}this[tt]=!0,r()})},r=()=>{if(e.absolute!==this.cwd){let n=u(c.dirname(String(e.absolute)));if(n!==this.cwd)return this[he](n,this.dmode,o=>{if(o){this[O](o,e),i();return}h()})}h()},h=()=>{d.lstat(String(e.absolute),(n,o)=>{if(o&&(this.keep||this.newer&&o.mtime>(e.mtime??o.mtime))){this[Fi](e),i();return}if(n||this[Ni](e,o))return this[I](null,e,i);if(o.isDirectory()){if(e.type==="Directory"){let a=this.chmod&&e.mode&&(o.mode&4095)!==e.mode,l=f=>this[I](f??null,e,i);return a?d.chmod(String(e.absolute),Number(e.mode),l):l()}if(e.absolute!==this.cwd)return d.rmdir(String(e.absolute),a=>this[I](a??null,e,i))}if(e.absolute===this.cwd)return this[I](null,e,i);Wh(String(e.absolute),a=>this[I](a??null,e,i))})};this[tt]?r():s()}[I](e,t,i){if(e){this[O](e,t),i();return}switch(t.type){case"File":case"OldFile":case"ContiguousFile":return this[Ii](t,i);case"Link":return this[Rs](t,i);case"SymbolicLink":return this[_s](t,i);case"Directory":case"GNUDumpDir":return this[Bi](t,i)}}[Nt](e,t,i,s){d[i](t,String(e.absolute),r=>{r?this[O](r,e):(this[Te](),e.resume()),s()})}},Ve=e=>{try{return[null,e()]}catch(t){return[t,null]}},Mi=class extends Ft{sync=!0;[I](e,t){return super[I](e,t,()=>{})}[xi](e){if(!this[tt]){let r=this[he](this.cwd,this.dmode);if(r)return this[O](r,e);this[tt]=!0}if(e.absolute!==this.cwd){let r=u(c.dirname(String(e.absolute)));if(r!==this.cwd){let h=this[he](r,this.dmode);if(h)return this[O](h,e)}}let[t,i]=Ve(()=>d.lstatSync(String(e.absolute)));if(i&&(this.keep||this.newer&&i.mtime>(e.mtime??i.mtime)))return this[Fi](e);if(t||this[Ni](e,i))return this[I](null,e);if(i.isDirectory()){if(e.type==="Directory"){let[h]=this.chmod&&e.mode&&(i.mode&4095)!==e.mode?Ve(()=>{d.chmodSync(String(e.absolute),Number(e.mode))}):[];return this[I](h,e)}let[r]=Ve(()=>d.rmdirSync(String(e.absolute)));this[I](r,e)}let[s]=e.absolute===this.cwd?[]:Ve(()=>Gh(String(e.absolute)));this[I](s,e)}[Ii](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.fmode,s=n=>{let o;try{d.closeSync(r)}catch(a){o=a}(n||o)&&this[O](n||o,e),t()},r;try{r=d.openSync(String(e.absolute),tr(e.size),i)}catch(n){return s(n)}let h=this.transform&&this.transform(e)||e;h!==e&&(h.on("error",n=>this[O](n,e)),e.pipe(h)),h.on("data",n=>{try{d.writeSync(r,n,0,n.length)}catch(o){s(o)}}),h.on("end",()=>{let n=null;if(e.mtime&&!this.noMtime){let o=e.atime||new Date,a=e.mtime;try{d.futimesSync(r,o,a)}catch(l){try{d.utimesSync(String(e.absolute),o,a)}catch{n=l}}}if(this[Qe](e)){let o=this[Je](e),a=this[et](e);try{d.fchownSync(r,Number(o),Number(a))}catch(l){try{d.chownSync(String(e.absolute),Number(o),Number(a))}catch{n||=l}}}s(n)})}[Bi](e,t){let i=typeof e.mode=="number"?e.mode&4095:this.dmode,s=this[he](String(e.absolute),i);if(s){this[O](s,e),t();return}if(e.mtime&&!this.noMtime)try{d.utimesSync(String(e.absolute),e.atime||new Date,e.mtime)}catch{}if(this[Qe](e))try{d.chownSync(String(e.absolute),Number(this[Je](e)),Number(this[et](e)))}catch{}t(),e.resume()}[he](e,t){try{return Ch(u(e),{uid:this.uid,gid:this.gid,processUid:this.processUid,processGid:this.processGid,umask:this.processUmask,preserve:this.preservePaths,unlink:this.unlink,cwd:this.cwd,mode:t})}catch(i){return i}}[Ke](e,t,i,s,r){if(this.preservePaths||i.length===0)return s();let h=t;for(let n of i){h=c.resolve(h,n);let[o,a]=Ve(()=>d.lstatSync(h));if(o)return s();if(a.isSymbolicLink())return r(new jt(h,c.resolve(t,i.join("/"))))}s()}[Nt](e,t,i,s){let r=`${i}Sync`;try{d[r](t,String(e.absolute)),s(),e.resume()}catch(h){return this[O](h,e)}}},ks=ht(e=>{let t=new Mi(e),i=e.file,s=d.statSync(i);new xr(i,{readSize:e.maxReadSize||16*1024*1024,size:s.size}).pipe(t)},(e,t)=>{let i=new Ft(e),s=e.maxReadSize||16*1024*1024,r=e.file;return new Promise((h,n)=>{i.on("error",n),i.on("close",h),d.stat(r,(o,a)=>{if(o)n(o);else{let l=new Pi(r,{readSize:s,size:a.size});l.on("error",n),l.pipe(i)}})})},e=>new Mi(e),e=>new Ft(e),(e,t)=>{t?.length&&Hi(e,t)}),$h=(e,t)=>{let i=new Ut(e),s=!0,r,h;try{try{r=d.openSync(e.file,"r+")}catch(a){if(a?.code==="ENOENT")r=d.openSync(e.file,"w+");else throw a}let n=d.fstatSync(r),o=Buffer.alloc(512);e:for(h=0;h<n.size;h+=512){for(let f=0,b=0;f<512;f+=b){if(b=d.readSync(r,o,f,o.length-f,h+f),h===0&&o[0]===31&&o[1]===139)throw Error("cannot append to compressed archives");if(!b)break e}let a=new ae(o);if(!a.cksumValid)break;let l=512*Math.ceil((a.size||0)/512);if(h+l+512>n.size)break;h+=l,e.mtimeCache&&a.mtime&&e.mtimeCache.set(String(a.path),a.mtime)}s=!1,Yh(e,i,h,r,t)}finally{if(s)try{d.closeSync(r)}catch{}}},Yh=(e,t,i,s,r)=>{let h=new Is(e.file,{fd:s,start:i});t.pipe(h),Kh(t,r)},Vh=(e,t)=>{t=Array.from(t);let i=new nt(e),s=(r,h,n)=>{let o=(g,T)=>{g?d.close(r,w=>n(g)):n(null,T)},a=0;if(h===0)return o(null,0);let l=0,f=Buffer.alloc(512),b=(g,T)=>{if(g||T===void 0)return o(g);if(l+=T,l<512&&T)return d.read(r,f,l,f.length-l,a+l,b);if(a===0&&f[0]===31&&f[1]===139)return o(Error("cannot append to compressed archives"));if(l<512)return o(null,a);let w=new ae(f);if(!w.cksumValid)return o(null,a);let k=512*Math.ceil((w.size??0)/512);if(a+k+512>h||(a+=k+512,a>=h))return o(null,a);e.mtimeCache&&w.mtime&&e.mtimeCache.set(String(w.path),w.mtime),l=0,d.read(r,f,0,512,a,b)};d.read(r,f,0,512,a,b)};return new Promise((r,h)=>{i.on("error",h);let n="r+",o=(a,l)=>{if(a&&a.code==="ENOENT"&&n==="r+")return n="w+",d.open(e.file,n,o);if(a||!l)return h(a);d.fstat(l,(f,b)=>{if(f)return d.close(l,()=>h(f));s(l,b.size,(g,T)=>{if(g)return h(g);let w=new Mt(e.file,{fd:l,start:T});i.pipe(w),w.on("error",h),w.on("close",r),Xh(i,t)})})};d.open(e.file,n,o)})},Kh=(e,t)=>{t.forEach(i=>{i.charAt(0)==="@"?Be({file:c.resolve(e.cwd,i.slice(1)),sync:!0,noResume:!0,onReadEntry:s=>e.add(s)}):e.add(i)}),e.end()},Xh=async(e,t)=>{for(let i of t)i.charAt(0)==="@"?await Be({file:c.resolve(String(e.cwd),i.slice(1)),noResume:!0,onReadEntry:s=>e.add(s)}):e.add(i);e.end()},be=ht($h,Vh,()=>{throw TypeError("file is required")},()=>{throw TypeError("file is required")},(e,t)=>{if(!Cr(e))throw TypeError("file is required");if(e.gzip||e.brotli||e.zstd||e.file.endsWith(".br")||e.file.endsWith(".tbr"))throw TypeError("cannot append to compressed archives");if(!t?.length)throw TypeError("no paths specified to add/replace")});ht(be.syncFile,be.asyncFile,be.syncNoFile,be.asyncNoFile,(e,t=[])=>{be.validate?.(e,t),qh(e)});var qh=e=>{let t=e.filter;e.mtimeCache||=new Map,e.filter=t?(i,s)=>t(i,s)&&!((e.mtimeCache?.get(i)??s.mtime??0)>(s.mtime??0)):(i,s)=>!((e.mtimeCache?.get(i)??s.mtime??0)>(s.mtime??0))};export{en as index_min_exports};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as m}from"node:module";import{m as d,f as p,T as v}from"../packem_shared/index-BDmTbWX1.js";import{p as e}from"./bin.js";import{w as $}from"../packem_shared/pm-runner-OGResYrA.js";import{a as u}from"./config.js";const g=m(import.meta.url),c=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,w=o=>{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(o)}return g(o)},{spawnSync:y}=w("node:child_process"),n="@lavamoat/preinstall-always-fail",l=o=>{const t=d(o,"package.json");if(!p(t))return"no-package-json";try{const s=u(t);if(s.devDependencies?.[n]||s.dependencies?.[n])return"installed"}catch{}return"missing"},h=o=>{const t=d(o,"package.json");if(!p(t))return!1;try{const s=u(t);let i=!1;const a=r=>!r||!(n in r)?r:(i=!0,Object.fromEntries(Object.entries(r).filter(([f])=>f!==n)));return s.devDependencies=a(s.devDependencies),s.dependencies=a(s.dependencies),i&&v(t,`${JSON.stringify(s,null,2)}
|
|
2
|
+
`),i}catch{return!1}},D=({options:o,workspaceRoot:t})=>{const s=t??process.cwd();if(o.status){switch(l(s)){case"installed":{e.success(`Preinstall tripwire is installed (${n}).`),e.info("Removing 'ignore-scripts=true' will cause future installs to fail loudly.");break}case"missing":{e.warn("Preinstall tripwire is not installed."),e.info(`Run 'vis security tripwire' to add ${n} as a devDependency.`);break}default:e.error("No package.json found at the workspace root."),process.exitCode=1}return}if(o.remove){h(s)?e.success(`Removed ${n} from package.json. Run your PM's install to clean node_modules.`):e.info(`${n} was not present in package.json.`);return}if(l(s)==="installed"){e.info(`${n} is already installed.`);return}const i=$(s),a={bun:["add","-d",n],npm:["install","--save-dev",n],pnpm:["add","-D","-w",n],yarn:["add","-D",n]}[i.name];if(!a){e.error(`Cannot install tripwire — unsupported package manager '${i.name}'.`),process.exitCode=1;return}e.info(`Installing ${n} via ${i.name}…`);const r=y(i.name,a,{cwd:s,stdio:"inherit"});if(r.error){e.error(`Failed to install tripwire: ${r.error.message}`),process.exitCode=1;return}if(r.signal!==null){e.error(`${i.name} was terminated by signal ${r.signal}`),process.exitCode=1;return}if(r.status!==0){e.error(`${i.name} exited with code ${String(r.status)}`),process.exitCode=r.status??1;return}e.success(`Installed ${n} as a devDependency.`),e.notice(""),e.notice("How the tripwire works:"),e.notice(` ${n} declares a preinstall script that always fails.`),e.notice(" When 'ignore-scripts=true' is set (.npmrc / bunfig.toml / .yarnrc.yml),"),e.notice(" the script is skipped and installs succeed normally. If someone deletes"),e.notice(" that setting, the next install fails — loudly — instead of silently"),e.notice(" running every dependency's lifecycle scripts.")};export{D as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{D as b,p}from"./bin.js";import{w}from"../packem_shared/pm-runner-OGResYrA.js";import{r as y,l as $,L as v}from"../packem_shared/dependency-scan-DnTgYleU.js";import{v as C,m,f as S}from"../packem_shared/index-BDmTbWX1.js";import"../packem_shared/public-api-WqUCiyIe.js";import{e as x}from"../packem_shared/index-Du8RWawQ.js";const M=e=>{const s=e.trim();return s===""?!1:/^(?:git\+|git:\/\/|git@|ssh:\/\/)/i.test(s)||/^(?:github|gitlab|bitbucket|gist):/i.test(s)||/^[\w.-]+\/[\w.-]+(?:#.+)?$/.test(s)&&!s.includes("@")?!0:/^https?:\/\//i.test(s)},L=(e,s)=>{for(const t of s)if(t===e||t.endsWith("*")&&e.startsWith(t.slice(0,-1)))return!0;return!1},D=(e,s,t={})=>{const o=y(e,s);if(!o)return[];let i;try{i=C(m(e,o.file))}catch{return[]}const n=b(i,o.type);if(n.length===0)return[];const c=t.allow??[],l=[],f=new Set;for(const r of n){const a=`${r.name}@${r.version}`;for(const d of[r.dependencies,r.optionalDependencies])if(d){for(const[u,h]of Object.entries(d))if(!L(u,c))for(const k of h){if(!M(k))continue;const g=`${a}->${u}@${k}`;f.has(g)||(f.add(g),l.push({declaredBy:a,packageName:u,source:k}))}}}return l.sort((r,a)=>r.packageName.localeCompare(a.packageName)||r.declaredBy.localeCompare(a.declaredBy))},E=new Set(["firstSeen","publisherChange"]),N=e=>e.severity==="block"&&e.acceptedRisk===void 0,R=e=>{const s=e.security?.policies?.firstSeen?.minutes,t=typeof s=="number"&&s>0,o=e.security?.policies?.publisherChange?.mode==="no-downgrade",i=e.security?.blockExoticSubdeps===!0;return t||o||i},V=async e=>{const{offline:s=!1,packageManager:t,visConfig:o,workspaceRoot:i}=e,n=Date.now();if(!R(o))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!1,status:"skipped"};const c=y(i,t);if(!c||!S(m(i,c.file)))return{decisions:[],durationMs:Date.now()-n,entryCount:0,exoticViolations:[],lockfileMissing:!0,status:"fail"};const l=$(i,t,{includeDev:!0}),f=l.length,r=await x({offline:s,packageManager:t,packages:l,workspaceRoot:i},"install",{enabledPolicies:new Set(E),visConfig:o}),a=o.security?.blockExoticSubdeps===!0?D(i,t,{allow:o.security.exoticSubdepsAllow}):[],d=r.some(u=>N(u))||a.length>0;return{decisions:r,durationMs:Date.now()-n,entryCount:f,exoticViolations:a,lockfileMissing:!1,status:d?"fail":"pass"}},B=e=>e<1e3?`${String(e)}ms`:`${(e/1e3).toFixed(1)}s`,P=e=>{if(e.status==="skipped")return["– Lockfile supply-chain verification skipped (no firstSeen / publisherChange / blockExoticSubdeps policy configured)"];if(e.lockfileMissing)return["✗ Lockfile supply-chain verification failed — no lockfile found, the resolved closure cannot be attested"];const s=`(${String(e.entryCount)} ${e.entryCount===1?"entry":"entries"}, ${B(e.durationMs)})`;if(e.status==="pass")return[`✓ Lockfile passes supply-chain policies ${s}`];const t=[`✗ Lockfile failed supply-chain policy check ${s}`];for(const o of e.decisions)o.severity==="block"&&o.acceptedRisk===void 0&&t.push(` [${o.policy}] ${o.reason}`);for(const o of e.exoticViolations)t.push(` [blockExoticSubdeps] ${o.packageName} pulled from exotic source by ${o.declaredBy}: ${o.source}`);return t},J=async({options:e,visConfig:s,workspaceRoot:t})=>{const o=t??process.cwd(),i=w(o);if(!v[i.name]){p.warn(`Package manager '${i.name}' has no lockfile vis can verify.`);return}const n=await V({offline:!!e.offline,packageManager:i.name,visConfig:s??{},workspaceRoot:o});if(e.json){process.stdout.write(`${JSON.stringify(n,void 0,2)}
|
|
2
|
+
`),n.status==="fail"&&(process.exitCode=1);return}const[c,...l]=P(n);if(n.status==="skipped"){p.info(c);return}if(n.status==="pass"){p.success(c);return}p.error(c);for(const f of l)p.error(f);process.exitCode=1};export{J as default};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{p as k}from"../packem_shared/index-CgcF6_wo.js";import{c as $}from"./registry.js";import{d as w}from"./orchestrator.js";import{defaultTagFor as T,renderTagPattern as E}from"./git.js";const R=e=>{let t=0;const i=[],r=()=>{if(t>=e)return;const s=i.shift();s&&(t+=1,s())};return async s=>new Promise((c,a)=>{const m=()=>{t-=1,r()},d=()=>{s().then(c,a).finally(m)};i.push(d),r()})},b=4,p=new Map,h=(e,t)=>{const i=m=>m.replaceAll(/[$()*+.?[\\\]^{|}]/g,String.raw`\$&`);let r="^",s=0;const c=/\{(name|unscopedName|version|major|minor|patch|date|channel)\}/g;let a;for(;(a=c.exec(e))!==null;){switch(r+=i(e.slice(s,a.index)),a[1]){case"name":{r+=i(t.name);break}case"unscopedName":{r+=i(t.name.replace(/^@[^/]+\//,""));break}case"version":{r+=String.raw`(\d+\.\d+\.\d+(?:-[0-9A-Za-z.-]+)?(?:\+[0-9A-Za-z.-]+)?)`;break}default:r+="[^/]+"}s=a.index+a[0].length}return r+=`${i(e.slice(s))}$`,new RegExp(r)},y=async(e,t,i,r)=>{if(t==="disk")return{resolvedFrom:"disk",version:e.version};if(t==="registry"){const l=w(e,r.perPackageConfig??{}),n=await $(l).readPublishedVersion({pkg:e,pm:r.pm,workspaceConfig:r.workspaceConfig});return n&&k.valid(n)?{resolvedFrom:"registry",version:n}:{fallbackReason:n===void 0?`registry returned no version for ${e.name} (likely a 404 / not-yet-published); falling back to manifest version ${e.version}.`:`registry returned an invalid semver "${n}" for ${e.name}; falling back to manifest version ${e.version}.`,resolvedFrom:"disk",version:e.version}}const s=r.perPackageConfig?.releaseTagPattern??r.workspaceConfig?.releaseTagPattern??"{name}@{version}",c=s.replaceAll(/\{(name|unscopedName|version|major|minor|patch|date|channel)\}/g,(l,n)=>n==="name"?e.name:n==="unscopedName"?e.name.replace(/^@[^/]+\//,""):"*"),a=await r.runner.run("git",["tag","--list",c,"--sort=-v:refname"],{cwd:r.cwd,silent:!0});if(a.exitCode!==0)return{fallbackReason:`git tag --list ${c} failed (exit ${a.exitCode}); falling back to manifest version ${e.version}.`,resolvedFrom:"disk",version:e.version};const m=a.stdout.split(`
|
|
2
|
+
`).map(l=>l.trim()).filter(Boolean);if(m.length===0)return{fallbackReason:`no git tag matched pattern "${s}" for ${e.name}; falling back to manifest version ${e.version}. (Pass --first-release to bootstrap.)`,resolvedFrom:"disk",version:e.version};const d=h(s,e),o=[];for(const l of m){const n=d.exec(l);n?.[1]&&k.valid(n[1])&&o.push(n[1])}return o.length===0?{fallbackReason:`git tag pattern "${s}" matched tags but none yielded a valid semver for ${e.name}; falling back to manifest version ${e.version}.`,resolvedFrom:"disk",version:e.version}:(o.sort(k.rcompare),{resolvedFrom:"git-tag",version:o[0]})},C=(e,t,i)=>i?"disk":t?.currentVersionResolver??e?.currentVersionResolver??"disk",V=async(e,t,i,r,s)=>{const c=new Map,a=[],m=R(b),d=await Promise.all(e.map(async o=>m(async()=>{const l=r.get(o.name),n=C(i,l,s.firstRelease),g=s.skipRegistryLookup?"disk":n,v=`${o.name}@${g}@${o.version}`,u=p.get(v);if(u)return{mode:g,pkg:o,result:await u};const f=y(o,g,t,{...s,perPackageConfig:l,workspaceConfig:i});return p.set(v,f),f.catch(()=>{p.get(v)===f&&p.delete(v)}),{mode:g,pkg:o,result:await f}})));for(const{mode:o,pkg:l,result:n}of d)c.set(l.name,n.version),n.fallbackReason&&o!=="disk"&&a.push(`currentVersionResolver (${o}): ${n.fallbackReason}`);return{versions:c,warnings:a}};export{b as REGISTRY_LOOKUP_CONCURRENCY,h as compileReleaseTagRegex,T as defaultTagFor,E as renderTagPattern,y as resolveCurrentVersion,V as resolveCurrentVersionsForWorkspace,C as resolveModeForPackage};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{redactTokens as f}from"./security.js";import{expandNotificationTemplate as h}from"./interface.js";const c=(e,t)=>{if(typeof e=="string")return h(e,t);if(Array.isArray(e))return e.map(o=>c(o,t));if(e!==null&&typeof e=="object"){const o={};for(const[n,i]of Object.entries(e))o[n]=c(i,t);return o}return e},p=e=>({channel:e.channel,completedAt:e.completedAt,monorepoName:e.monorepoName,published:e.published.map(t=>({name:t.name,tag:t.tag,url:t.url,version:t.version})),repo:e.repo,skipped:e.skipped.map(t=>({name:t.name}))}),d=(e,t)=>{if(!e)return{};const o={};for(const[n,i]of Object.entries(e))o[n]=h(i,t);return o};class u{constructor(t){this.config=t,this.id=t.id?`webhook:${t.id}`:"webhook"}config;id;async send(t){const o=this.config.method??"POST",n={"Content-Type":"application/json",...d(this.config.headers,t)},i=this.config.body===void 0?p(t):c(this.config.body,t);let s;try{s=await fetch(this.config.url,{body:JSON.stringify(i),headers:n,method:o})}catch(r){const a=r instanceof Error?r.name:"NetworkError";throw new Error(`Webhook ${this.id} fetch failed (${a})`,{cause:r})}if(!s.ok){const r=await s.text().catch(()=>""),a=r?`: ${f(r.slice(0,200))}`:"";throw new Error(`Webhook ${this.id} POST <webhook-url> returned ${s.status} ${s.statusText}${a}`)}}}export{u as WebhookNotificationChannel};
|
|
@@ -0,0 +1,167 @@
|
|
|
1
|
+
const t=e=>{switch(e){case"bun":return"bun install --frozen-lockfile";case"npm":return"npm ci";case"pnpm":return"pnpm install --frozen-lockfile";case"yarn":return"yarn install --immutable";default:return`${e} install`}},r=e=>`${e} run build`,n=e=>e==="npm"?"npx":e==="bun"?"bunx":`${e} exec`,o=e=>{switch(e){case"bun":return"npm install -g bun";case"npm":return"";case"pnpm":return"npm install -g pnpm";case"yarn":return"corepack enable && corepack prepare yarn@stable --activate";default:return""}},l=e=>`# vis release — primary release workflow.
|
|
2
|
+
# Generated by \`vis release init --workflows\`. Edit freely.
|
|
3
|
+
|
|
4
|
+
name: vis release
|
|
5
|
+
|
|
6
|
+
on:
|
|
7
|
+
push:
|
|
8
|
+
branches:
|
|
9
|
+
${e.branches.map(s=>` - "${s}"`).join(`
|
|
10
|
+
`)}
|
|
11
|
+
workflow_dispatch:
|
|
12
|
+
|
|
13
|
+
concurrency:
|
|
14
|
+
group: vis-release-\${{ github.ref }}
|
|
15
|
+
cancel-in-progress: false
|
|
16
|
+
|
|
17
|
+
permissions:
|
|
18
|
+
contents: write
|
|
19
|
+
pull-requests: write
|
|
20
|
+
${e.useOidc?` id-token: write
|
|
21
|
+
`:""}
|
|
22
|
+
jobs:
|
|
23
|
+
release:
|
|
24
|
+
runs-on: ubuntu-latest
|
|
25
|
+
steps:
|
|
26
|
+
- uses: actions/checkout@v4
|
|
27
|
+
with:
|
|
28
|
+
fetch-depth: 0
|
|
29
|
+
token: \${{ secrets.VIS_GH_TOKEN || github.token }}
|
|
30
|
+
persist-credentials: false
|
|
31
|
+
|
|
32
|
+
- uses: actions/setup-node@v4
|
|
33
|
+
with:
|
|
34
|
+
node-version: "22"
|
|
35
|
+
|
|
36
|
+
${e.packageManager==="pnpm"?` - uses: pnpm/action-setup@v4
|
|
37
|
+
`:""}${e.packageManager==="bun"?` - uses: oven-sh/setup-bun@v2
|
|
38
|
+
`:""} - run: ${t(e.packageManager)}
|
|
39
|
+
- run: ${r(e.packageManager)}
|
|
40
|
+
|
|
41
|
+
- run: ${n(e.packageManager)} vis release ci release
|
|
42
|
+
env:
|
|
43
|
+
GH_TOKEN: \${{ github.token }}
|
|
44
|
+
VIS_GH_TOKEN: \${{ secrets.VIS_GH_TOKEN || github.token }}
|
|
45
|
+
${e.useOidc?` # OIDC trusted publishing — no publish token needed when configured on npmjs.com
|
|
46
|
+
`:" NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n"} GIT_AUTHOR_NAME: "vis-release-bot"
|
|
47
|
+
GIT_AUTHOR_EMAIL: "vis-release-bot@users.noreply.github.com"
|
|
48
|
+
GIT_COMMITTER_NAME: "vis-release-bot"
|
|
49
|
+
GIT_COMMITTER_EMAIL: "vis-release-bot@users.noreply.github.com"
|
|
50
|
+
`,g=e=>`# vis release ci check — sticky PR comment with release plan.
|
|
51
|
+
# Generated by \`vis release init --workflows\`. Edit freely.
|
|
52
|
+
|
|
53
|
+
name: vis release check
|
|
54
|
+
|
|
55
|
+
on:
|
|
56
|
+
pull_request:
|
|
57
|
+
types: [opened, synchronize, reopened]
|
|
58
|
+
|
|
59
|
+
permissions:
|
|
60
|
+
contents: read
|
|
61
|
+
pull-requests: write
|
|
62
|
+
|
|
63
|
+
jobs:
|
|
64
|
+
check:
|
|
65
|
+
runs-on: ubuntu-latest
|
|
66
|
+
steps:
|
|
67
|
+
- uses: actions/checkout@v4
|
|
68
|
+
with:
|
|
69
|
+
fetch-depth: 0
|
|
70
|
+
persist-credentials: false
|
|
71
|
+
- uses: actions/setup-node@v4
|
|
72
|
+
with:
|
|
73
|
+
node-version: "22"
|
|
74
|
+
${e.packageManager==="pnpm"?` - uses: pnpm/action-setup@v4
|
|
75
|
+
`:""}${e.packageManager==="bun"?` - uses: oven-sh/setup-bun@v2
|
|
76
|
+
`:""} - run: ${t(e.packageManager)}
|
|
77
|
+
- run: ${n(e.packageManager)} vis release ci check
|
|
78
|
+
env:
|
|
79
|
+
GH_TOKEN: \${{ github.token }}
|
|
80
|
+
`,h=e=>`# vis release ci snapshot — preview release publish + sticky PR comment.
|
|
81
|
+
# Generated by \`vis release init --workflows\`. Edit freely.
|
|
82
|
+
|
|
83
|
+
name: vis release snapshot
|
|
84
|
+
|
|
85
|
+
on:
|
|
86
|
+
pull_request:
|
|
87
|
+
types: [opened, synchronize, reopened]
|
|
88
|
+
|
|
89
|
+
concurrency:
|
|
90
|
+
group: vis-release-snapshot-\${{ github.event.pull_request.number }}
|
|
91
|
+
cancel-in-progress: true
|
|
92
|
+
|
|
93
|
+
permissions:
|
|
94
|
+
contents: read
|
|
95
|
+
pull-requests: write
|
|
96
|
+
${e.useOidc?` id-token: write
|
|
97
|
+
`:""}
|
|
98
|
+
jobs:
|
|
99
|
+
snapshot:
|
|
100
|
+
runs-on: ubuntu-latest
|
|
101
|
+
steps:
|
|
102
|
+
- uses: actions/checkout@v4
|
|
103
|
+
with:
|
|
104
|
+
fetch-depth: 0
|
|
105
|
+
persist-credentials: false
|
|
106
|
+
- uses: actions/setup-node@v4
|
|
107
|
+
with:
|
|
108
|
+
node-version: "22"
|
|
109
|
+
${e.packageManager==="pnpm"?` - uses: pnpm/action-setup@v4
|
|
110
|
+
`:""}${e.packageManager==="bun"?` - uses: oven-sh/setup-bun@v2
|
|
111
|
+
`:""} - run: ${t(e.packageManager)}
|
|
112
|
+
- run: ${r(e.packageManager)}
|
|
113
|
+
- run: ${n(e.packageManager)} vis release ci snapshot
|
|
114
|
+
env:
|
|
115
|
+
GH_TOKEN: \${{ github.token }}
|
|
116
|
+
${e.useOidc?"":" NPM_TOKEN: ${{ secrets.NPM_TOKEN }}\n"}`,b=e=>`# .gitlab-ci.yml — vis release CI pipeline.
|
|
117
|
+
# Generated by \`vis release init --workflows\`. Edit freely.
|
|
118
|
+
#
|
|
119
|
+
# Required CI/CD variables (Project Settings → CI/CD → Variables):
|
|
120
|
+
# - VIS_GH_TOKEN (or GITLAB_TOKEN) — PAT for force-pushing the version-PR branch
|
|
121
|
+
# - NPM_TOKEN — npm publish auth (until npm OIDC supports GitLab)
|
|
122
|
+
#
|
|
123
|
+
# Self-hosted GitLab: set release.gitlabHost in vis.config.ts (translates to
|
|
124
|
+
# GITLAB_HOST for every glab invocation), or export GITLAB_HOST in the job env.
|
|
125
|
+
|
|
126
|
+
stages:
|
|
127
|
+
- check
|
|
128
|
+
- release
|
|
129
|
+
|
|
130
|
+
default:
|
|
131
|
+
image: node:22
|
|
132
|
+
|
|
133
|
+
variables:
|
|
134
|
+
PM: "${e.packageManager}"
|
|
135
|
+
|
|
136
|
+
before_script:
|
|
137
|
+
${o(e.packageManager)?` - ${o(e.packageManager)}
|
|
138
|
+
`:""} - ${t(e.packageManager)}
|
|
139
|
+
|
|
140
|
+
${e.includeCheck?`vis-release-check:
|
|
141
|
+
stage: check
|
|
142
|
+
rules:
|
|
143
|
+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
144
|
+
script:
|
|
145
|
+
- ${n(e.packageManager)} vis release ci check
|
|
146
|
+
|
|
147
|
+
`:""}${e.includeSnapshot?`vis-release-snapshot:
|
|
148
|
+
stage: check
|
|
149
|
+
rules:
|
|
150
|
+
- if: $CI_PIPELINE_SOURCE == "merge_request_event"
|
|
151
|
+
script:
|
|
152
|
+
- ${r(e.packageManager)}
|
|
153
|
+
- ${n(e.packageManager)} vis release ci snapshot
|
|
154
|
+
|
|
155
|
+
`:""}vis-release:
|
|
156
|
+
stage: release
|
|
157
|
+
# Serialize releases per branch so two close-together pushes don't
|
|
158
|
+
# race on the same registry / staged.json / tag namespace. GitLab's
|
|
159
|
+
# equivalent of GitHub Actions' concurrency.group.
|
|
160
|
+
resource_group: vis-release-$CI_COMMIT_BRANCH
|
|
161
|
+
rules:
|
|
162
|
+
${e.branches.map(s=>` - if: $CI_COMMIT_BRANCH == "${s}"`).join(`
|
|
163
|
+
`)}
|
|
164
|
+
script:
|
|
165
|
+
- ${r(e.packageManager)}
|
|
166
|
+
- ${n(e.packageManager)} vis release ci release
|
|
167
|
+
`,k=(e,s={})=>{const u=s.provider??(e.provider==="github"||e.provider==="gitlab"?e.provider:"github"),p=e.channels??{},i=s.branches??Object.keys(p);i.length===0&&i.push("main");const a={branches:i,includeCheck:s.includeCheck??!0,includeSnapshot:s.includeSnapshot??!0,packageManager:s.packageManager??"pnpm",useOidc:s.useOidc??!0};if(u==="gitlab")return[{content:b(a),path:".gitlab-ci.yml"}];const c=[{content:l(a),path:".github/workflows/vis-release.yml"}];return a.includeCheck&&c.push({content:g(a),path:".github/workflows/vis-release-check.yml"}),a.includeSnapshot&&c.push({content:h(a),path:".github/workflows/vis-release-snapshot.yml"}),c};export{k as generateWorkflowFiles};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as h}from"node:module";import w from"./index.js";import{normaliseGroup as _}from"../release/types.js";import{d as C}from"./registry.js";import{resolveFormatter as v}from"./resolveFormatter.js";const m=h(import.meta.url),g=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,u=o=>{if(typeof g<"u"&&g.versions&&g.versions.node){const[n,t]=g.versions.node.split(".").map(Number);if(n>22||n===22&&t>=3||n===20&&t>=16)return g.getBuiltinModule(o)}return m(o)},{readFile:d,writeFile:f}=u("node:fs/promises"),k="## Release wave {date} ({count} packages)",$=async(o,n,t,s={})=>{const r=s.renderer??t,e=[(s.waveHeading??k).replaceAll("{date}",n).replaceAll("{count}",String(o.length)),""];for(const a of o){e.push(`### ${a.name} → ${a.newVersion}`),e.push("");const i={changeFiles:a.changeFiles,date:n,release:a,target:"github-release"},c=await r(i);c.trim()?e.push(c.trim()):e.push("_No changelog entries._"),e.push("")}return e.join(`
|
|
2
|
+
`)},j=(o,n={})=>{const t=n.file??"CHANGELOG.md";return t.startsWith("/")?t:`${o}/${t}`},y=/[!()*+?@[\]{|}]/,G=(o,n)=>{const t=[],s=new Set;for(const r of o)if(y.test(r))for(const e of n)!s.has(e.name)&&w(r,e.name)&&(s.add(e.name),t.push(e));else{const e=n.find(a=>a.name===r);e&&!s.has(e.name)&&(s.add(e.name),t.push(e))}return t},N=(o,n,t)=>{const s=new Map,r=[...o.fixed??[],...o.linked??[]];for(const e of r){const a=_(e);if(a.changelog.mode!=="shared")continue;const i=G(a.packages,n);if(i.length===0)continue;let c;a.changelog.path?c=a.changelog.path.startsWith("/")?a.changelog.path:`${t}/${a.changelog.path}`:c=`${[...i].sort((l,p)=>l.name.localeCompare(p.name))[0].dir}/GROUP-CHANGELOG.md`;for(const l of i)s.has(l.name)||s.set(l.name,c)}return s},O=async(o,n)=>{if(n.length===0)return;const t=o.workspaceChangelog,s=typeof t=="object"?t:void 0,r=await v(o.changelogConfig,o.cwd),e=new Date().toISOString().slice(0,10),a=await $(n,e,r,s),i=j(o.cwd,s),c=await d(i,"utf8").catch(()=>{});return await f(i,C(a,c)),i};export{$ as renderWorkspaceChangelog,N as resolveGroupChangelogRouting,j as workspaceChangelogPath,O as writeWorkspaceChangelogWave};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
class e{}class o{}export{o as AfterAllProjectsVersioned,e as VersionActions};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as e}from"node:module";import{m as f,q as l,C as _,h as p,k as d,r as u,o as c,b as g,j as m,Z as T,i as C}from"../packem_chunks/config.js";import"./index-BDmTbWX1.js";import"jiti";import{otelPlugin as F}from"./otelPlugin-DmKDBaPo.js";import{definePlugin as S}from"./definePlugin-DoUcoYSy.js";const i=e(import.meta.url),o=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process;export{f as CONFIG_FILES,l as DEFAULT_MIN_RELEASE_AGE_MINUTES,_ as SECURITY_DEFAULTS,p as TASK_CONFIG_FILES,d as applyDefaults,u as defineConfig,S as definePlugin,c as defineTaskConfig,g as findVisConfigFile,m as findVisTaskConfigFile,T as loadVisConfig,C as loadVisTaskConfig,F as otelPlugin};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import{createRequire as l}from"node:module";const o=l(import.meta.url),_=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,h=t=>{if(typeof _<"u"&&_.versions&&_.versions.node){const[e,r]=_.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return _.getBuiltinModule(t)}return o(t)},{createRequire:f}=h("node:module");var m={interval:80,frames:["⠋","⠙","⠹","⠸","⠼","⠴","⠦","⠧","⠇","⠏"]},v={interval:80,frames:["⣾","⣽","⣻","⢿","⡿","⣟","⣯","⣷"]},u={interval:80,frames:["⠋","⠙","⠚","⠞","⠖","⠦","⠴","⠲","⠳","⠓"]},c={interval:80,frames:["⠄","⠆","⠇","⠋","⠙","⠸","⠰","⠠","⠰","⠸","⠙","⠋","⠇","⠆"]},g={interval:80,frames:["⠋","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋"]},d={interval:80,frames:["⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠴","⠲","⠒","⠂","⠂","⠒","⠚","⠙","⠉","⠁"]},p={interval:80,frames:["⠈","⠉","⠋","⠓","⠒","⠐","⠐","⠒","⠖","⠦","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈"]},b={interval:80,frames:["⠁","⠁","⠉","⠙","⠚","⠒","⠂","⠂","⠒","⠲","⠴","⠤","⠄","⠄","⠤","⠠","⠠","⠤","⠦","⠖","⠒","⠐","⠐","⠒","⠓","⠋","⠉","⠈","⠈"]},w={interval:80,frames:["⢹","⢺","⢼","⣸","⣇","⡧","⡗","⡏"]},T={interval:80,frames:["⢄","⢂","⢁","⡁","⡈","⡐","⡠"]},$={interval:100,frames:["⠁","⠂","⠄","⡀","⢀","⠠","⠐","⠈"]},x={interval:80,frames:["⢀⠀","⡀⠀","⠄⠀","⢂⠀","⡂⠀","⠅⠀","⢃⠀","⡃⠀","⠍⠀","⢋⠀","⡋⠀","⠍⠁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⢈⠩","⡀⢙","⠄⡙","⢂⠩","⡂⢘","⠅⡘","⢃⠨","⡃⢐","⠍⡐","⢋⠠","⡋⢀","⠍⡁","⢋⠁","⡋⠁","⠍⠉","⠋⠉","⠋⠉","⠉⠙","⠉⠙","⠉⠩","⠈⢙","⠈⡙","⠈⠩","⠀⢙","⠀⡙","⠀⠩","⠀⢘","⠀⡘","⠀⠨","⠀⢐","⠀⡐","⠀⠠","⠀⢀","⠀⡀"]},y={interval:80,frames:["⣼","⣹","⢻","⠿","⡟","⣏","⣧","⣶"]},k={interval:80,frames:["⠉⠉","⠈⠙","⠀⠹","⠀⢸","⠀⣰","⢀⣠","⣀⣀","⣄⡀","⣆⠀","⡇⠀","⠏⠀","⠋⠁"]},B={interval:80,frames:["⠀","⠁","⠂","⠃","⠄","⠅","⠆","⠇","⡀","⡁","⡂","⡃","⡄","⡅","⡆","⡇","⠈","⠉","⠊","⠋","⠌","⠍","⠎","⠏","⡈","⡉","⡊","⡋","⡌","⡍","⡎","⡏","⠐","⠑","⠒","⠓","⠔","⠕","⠖","⠗","⡐","⡑","⡒","⡓","⡔","⡕","⡖","⡗","⠘","⠙","⠚","⠛","⠜","⠝","⠞","⠟","⡘","⡙","⡚","⡛","⡜","⡝","⡞","⡟","⠠","⠡","⠢","⠣","⠤","⠥","⠦","⠧","⡠","⡡","⡢","⡣","⡤","⡥","⡦","⡧","⠨","⠩","⠪","⠫","⠬","⠭","⠮","⠯","⡨","⡩","⡪","⡫","⡬","⡭","⡮","⡯","⠰","⠱","⠲","⠳","⠴","⠵","⠶","⠷","⡰","⡱","⡲","⡳","⡴","⡵","⡶","⡷","⠸","⠹","⠺","⠻","⠼","⠽","⠾","⠿","⡸","⡹","⡺","⡻","⡼","⡽","⡾","⡿","⢀","⢁","⢂","⢃","⢄","⢅","⢆","⢇","⣀","⣁","⣂","⣃","⣄","⣅","⣆","⣇","⢈","⢉","⢊","⢋","⢌","⢍","⢎","⢏","⣈","⣉","⣊","⣋","⣌","⣍","⣎","⣏","⢐","⢑","⢒","⢓","⢔","⢕","⢖","⢗","⣐","⣑","⣒","⣓","⣔","⣕","⣖","⣗","⢘","⢙","⢚","⢛","⢜","⢝","⢞","⢟","⣘","⣙","⣚","⣛","⣜","⣝","⣞","⣟","⢠","⢡","⢢","⢣","⢤","⢥","⢦","⢧","⣠","⣡","⣢","⣣","⣤","⣥","⣦","⣧","⢨","⢩","⢪","⢫","⢬","⢭","⢮","⢯","⣨","⣩","⣪","⣫","⣬","⣭","⣮","⣯","⢰","⢱","⢲","⢳","⢴","⢵","⢶","⢷","⣰","⣱","⣲","⣳","⣴","⣵","⣶","⣷","⢸","⢹","⢺","⢻","⢼","⢽","⢾","⢿","⣸","⣹","⣺","⣻","⣼","⣽","⣾","⣿"]},D={interval:80,frames:["⢎ ","⠎⠁","⠊⠑","⠈⠱"," ⡱","⢀⡰","⢄⡠","⢆⡀"]},O={interval:80,frames:["⠁","⠂","⠄","⡀","⡈","⡐","⡠","⣀","⣁","⣂","⣄","⣌","⣔","⣤","⣥","⣦","⣮","⣶","⣷","⣿","⡿","⠿","⢟","⠟","⡛","⠛","⠫","⢋","⠋","⠍","⡉","⠉","⠑","⠡","⢁"]},I={interval:130,frames:["-","\\","|","/"]},q={interval:100,frames:["⠂","-","–","—","–","-"]},N={interval:80,frames:["/ "," - "," \\ "," |"," |"," \\ "," - ","/ "]},R={interval:100,frames:["┤","┘","┴","└","├","┌","┬","┐"]},j={interval:400,frames:[". ",".. ","..."," "]},A={interval:200,frames:[". ",".. ","..."," .."," ."," "]},C={interval:70,frames:["✶","✸","✹","✺","✹","✷"]},M={interval:80,frames:["+","x","*"]},P={interval:70,frames:["_","_","_","-","`","`","'","´","-","_","_","_"]},S={interval:100,frames:["☱","☲","☴"]},U={interval:120,frames:["▁","▃","▄","▅","▆","▇","▆","▅","▄","▃"]},F={interval:120,frames:["▏","▎","▍","▌","▋","▊","▉","▊","▋","▌","▍","▎"]},E={interval:140,frames:[" ",".","o","O","@","*"," "]},H={interval:120,frames:[".","o","O","°","O","o","."]},L={interval:100,frames:["▓","▒","░"]},V={interval:120,frames:["⠁","⠂","⠄","⠂"]},Y={interval:120,frames:["▖","▘","▝","▗"]},z={interval:100,frames:["▌","▀","▐","▄"]},Q={interval:50,frames:["◢","◣","◤","◥"]},G={interval:80,frames:["010010","001100","100101","111010","111101","010111","101011","111000","110011","110101"]},K={interval:100,frames:["◜","◠","◝","◞","◡","◟"]},W={interval:120,frames:["◡","⊙","◠"]},J={interval:180,frames:["◰","◳","◲","◱"]},X={interval:120,frames:["◴","◷","◶","◵"]},Z={interval:50,frames:["◐","◓","◑","◒"]},ee={interval:100,frames:["╫","╪"]},re={interval:250,frames:["⊶","⊷"]},te={interval:80,frames:["▫","▪"]},se={interval:120,frames:["□","■"]},ie={interval:100,frames:["■","□","▪","▫"]},_e={interval:100,frames:["▮","▯"]},ae={interval:300,frames:["ဝ","၀"]},ne={interval:80,frames:["⦾","⦿"]},le={interval:100,frames:["◍","◌"]},oe={interval:100,frames:["◉","◎"]},he={interval:100,frames:["㊂","㊀","㊁"]},fe={interval:50,frames:["⧇","⧆"]},me={interval:120,frames:["☗","☖"]},ve={interval:80,frames:["=","*","-"]},ue={interval:100,frames:["←","↖","↑","↗","→","↘","↓","↙"]},ce={interval:80,frames:["⬆️ ","↗️ ","➡️ ","↘️ ","⬇️ ","↙️ ","⬅️ ","↖️ "]},ge={interval:120,frames:["▹▹▹▹▹","▸▹▹▹▹","▹▸▹▹▹","▹▹▸▹▹","▹▹▹▸▹","▹▹▹▹▸"]},de={interval:80,frames:["[ ]","[= ]","[== ]","[=== ]","[====]","[ ===]","[ ==]","[ =]","[ ]","[ =]","[ ==]","[ ===]","[====]","[=== ]","[== ]","[= ]"]},pe={interval:80,frames:["( ● )","( ● )","( ● )","( ● )","( ●)","( ● )","( ● )","( ● )","( ● )","(● )"]},be={interval:200,frames:["😄 ","😝 "]},we={interval:300,frames:["🙈 ","🙈 ","🙉 ","🙊 "]},Te={interval:100,frames:["💛 ","💙 ","💜 ","💚 ","💗 "]},$e={interval:100,frames:["🕛 ","🕐 ","🕑 ","🕒 ","🕓 ","🕔 ","🕕 ","🕖 ","🕗 ","🕘 ","🕙 ","🕚 "]},xe={interval:180,frames:["🌍 ","🌎 ","🌏 "]},ye={interval:17,frames:["█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","██████▁▁▁▁▁▁▁▁▁▁▁▁▁▁","███████▁▁▁▁▁▁▁▁▁▁▁▁▁","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","██████████▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","█████████████▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁██████████████▁▁▁▁","▁▁▁██████████████▁▁▁","▁▁▁▁█████████████▁▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁██████████████▁▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁██████████████▁","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁██████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁█████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁████████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁███████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁██████████","▁▁▁▁▁▁▁▁▁▁▁▁████████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁██████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","█▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","██▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","███▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","████▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","█████▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","██████▁▁▁▁▁▁▁▁▁▁▁▁▁█","████████▁▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","█████████▁▁▁▁▁▁▁▁▁▁▁","███████████▁▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","████████████▁▁▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","██████████████▁▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁██████████████▁▁▁▁▁","▁▁▁█████████████▁▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁████████████▁▁▁","▁▁▁▁▁▁███████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁█████████▁▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁█████████▁▁","▁▁▁▁▁▁▁▁▁▁█████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁████████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁███████▁","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁███████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁████","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁███","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁██","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁█","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁","▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁▁"]},ke={interval:80,frames:["🌑 ","🌒 ","🌓 ","🌔 ","🌕 ","🌖 ","🌗 ","🌘 "]},Be={interval:140,frames:["🚶 ","🏃 "]},De={interval:80,frames:["▐⠂ ▌","▐⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂▌","▐ ⠠▌","▐ ⡀▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐ ⠠ ▌","▐ ⠂ ▌","▐ ⠈ ▌","▐ ⠂ ▌","▐ ⠠ ▌","▐ ⡀ ▌","▐⠠ ▌"]},Oe={interval:120,frames:["▐|\\____________▌","▐_|\\___________▌","▐__|\\__________▌","▐___|\\_________▌","▐____|\\________▌","▐_____|\\_______▌","▐______|\\______▌","▐_______|\\_____▌","▐________|\\____▌","▐_________|\\___▌","▐__________|\\__▌","▐___________|\\_▌","▐____________|\\▌","▐____________/|▌","▐___________/|_▌","▐__________/|__▌","▐_________/|___▌","▐________/|____▌","▐_______/|_____▌","▐______/|______▌","▐_____/|_______▌","▐____/|________▌","▐___/|_________▌","▐__/|__________▌","▐_/|___________▌","▐/|____________▌"]},Ie={interval:100,frames:["d","q","p","b"]},qe={interval:100,frames:["☀️ ","☀️ ","☀️ ","🌤 ","⛅️ ","🌥 ","☁️ ","🌧 ","🌨 ","🌧 ","🌨 ","🌧 ","🌨 ","⛈ ","🌨 ","🌧 ","🌨 ","☁️ ","🌥 ","⛅️ ","🌤 ","☀️ ","☀️ "]},Ne={interval:400,frames:["🌲","🎄"]},Re={interval:80,frames:["، ","′ "," ´ "," ‾ "," ⸌"," ⸊"," |"," ⁎"," ⁕"," ෴ "," ⁓"," "," "," "]},je={interval:125,frames:["∙∙∙","●∙∙","∙●∙","∙∙●","∙∙∙"]},Ae={interval:150,frames:["-","=","≡"]},Ce={interval:80,frames:["ρββββββ","βρβββββ","ββρββββ","βββρβββ","ββββρββ","βββββρβ","ββββββρ"]},Me={interval:160,frames:["🤘 ","🤟 ","🖖 ","✋ ","🤚 ","👆 "]},Pe={interval:80,frames:["🤜 🤛 ","🤜 🤛 ","🤜 🤛 "," 🤜 🤛 "," 🤜🤛 "," 🤜✨🤛 ","🤜 ✨ 🤛 "]},Se={interval:80,frames:[" 🧑⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 ","🧑 ⚽️ 🧑 "]},Ue={interval:160,frames:["😐 ","😐 ","😮 ","😮 ","😦 ","😦 ","😧 ","😧 ","🤯 ","💥 ","✨ "," "," "," "]},Fe={interval:160,frames:["🔈 ","🔉 ","🔊 ","🔉 "]},Ee={interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 "]},He={interval:100,frames:["🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},Le={interval:100,frames:["🔸 ","🔶 ","🟠 ","🟠 ","🔶 ","🔹 ","🔷 ","🔵 ","🔵 ","🔷 "]},Ve={interval:100,frames:["🕛 ","🕚 ","🕙 ","🕘 ","🕗 ","🕖 ","🕕 ","🕔 ","🕓 ","🕒 ","🕑 ","🕐 "]},Ye={interval:80,frames:["▰▱▱▱▱▱▱","▰▰▱▱▱▱▱","▰▰▰▱▱▱▱","▰▰▰▰▱▱▱","▰▰▰▰▰▱▱","▰▰▰▰▰▰▱","▰▰▰▰▰▰▰","▰▱▱▱▱▱▱"]},ze={interval:80,frames:[" ██████£££ ","☺██████£££ ","☺██████£££ ","☺▓█████£££ ","☺▓█████£££ ","☺▒█████£££ ","☺▒█████£££ ","☺░█████£££ ","☺░█████£££ ","☺ █████£££ "," ☺█████£££ "," ☺█████£££ "," ☺▓████£££ "," ☺▓████£££ "," ☺▒████£££ "," ☺▒████£££ "," ☺░████£££ "," ☺░████£££ "," ☺ ████£££ "," ☺████£££ "," ☺████£££ "," ☺▓███£££ "," ☺▓███£££ "," ☺▒███£££ "," ☺▒███£££ "," ☺░███£££ "," ☺░███£££ "," ☺ ███£££ "," ☺███£££ "," ☺███£££ "," ☺▓██£££ "," ☺▓██£££ "," ☺▒██£££ "," ☺▒██£££ "," ☺░██£££ "," ☺░██£££ "," ☺ ██£££ "," ☺██£££ "," ☺██£££ "," ☺▓█£££ "," ☺▓█£££ "," ☺▒█£££ "," ☺▒█£££ "," ☺░█£££ "," ☺░█£££ "," ☺ █£££ "," ☺█£££ "," ☺█£££ "," ☺▓£££ "," ☺▓£££ "," ☺▒£££ "," ☺▒£££ "," ☺░£££ "," ☺░£££ "," ☺ £££ "," ☺£££ "," ☺£££ "," ☺▓££ "," ☺▓££ "," ☺▒££ "," ☺▒££ "," ☺░££ "," ☺░££ "," ☺ ££ "," ☺££ "," ☺££ "," ☺▓£ "," ☺▓£ "," ☺▒£ "," ☺▒£ "," ☺░£ "," ☺░£ "," ☺ £ "," ☺£ "," ☺£ "," ☺▓ "," ☺▓ "," ☺▒ "," ☺▒ "," ☺░ "," ☺░ "," ☺ "," ☺ &"," ☺ ☼&"," ☺ ☼ &"," ☺☼ &"," ☺☼ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & "," ‼ & "," ☺ & ","‼ & "," & "," & "," & ░ "," & ▒ "," & ▓ "," & £ "," & ░£ "," & ▒£ "," & ▓£ "," & ££ "," & ░££ "," & ▒££ ","& ▓££ ","& £££ "," ░£££ "," ▒£££ "," ▓£££ "," █£££ "," ░█£££ "," ▒█£££ "," ▓█£££ "," ██£££ "," ░██£££ "," ▒██£££ "," ▓██£££ "," ███£££ "," ░███£££ "," ▒███£££ "," ▓███£££ "," ████£££ "," ░████£££ "," ▒████£££ "," ▓████£££ "," █████£££ "," ░█████£££ "," ▒█████£££ "," ▓█████£££ "," ██████£££ "," ██████£££ "]},Qe={interval:80,frames:["~~~~~~~~~~~~~~~~~~~~","> ~~~~~~~~~~~~~~~~~~","º> ~~~~~~~~~~~~~~~~~","(º> ~~~~~~~~~~~~~~~~","((º> ~~~~~~~~~~~~~~~","<((º> ~~~~~~~~~~~~~~","><((º> ~~~~~~~~~~~~~"," ><((º> ~~~~~~~~~~~~","~ ><((º> ~~~~~~~~~~~","~~ <>((º> ~~~~~~~~~~","~~~ ><((º> ~~~~~~~~~","~~~~ <>((º> ~~~~~~~~","~~~~~ ><((º> ~~~~~~~","~~~~~~ <>((º> ~~~~~~","~~~~~~~ ><((º> ~~~~~","~~~~~~~~ <>((º> ~~~~","~~~~~~~~~ ><((º> ~~~","~~~~~~~~~~ <>((º> ~~","~~~~~~~~~~~ ><((º> ~","~~~~~~~~~~~~ <>((º> ","~~~~~~~~~~~~~ ><((º>","~~~~~~~~~~~~~~ <>((º","~~~~~~~~~~~~~~~ ><((","~~~~~~~~~~~~~~~~ <>(","~~~~~~~~~~~~~~~~~ ><","~~~~~~~~~~~~~~~~~~ <","~~~~~~~~~~~~~~~~~~~~"]};const Ge={dots:m,dots2:v,dots3:u,dots4:c,dots5:g,dots6:d,dots7:p,dots8:b,dots9:w,dots10:T,dots11:$,dots12:x,dots13:y,dots14:k,dots8Bit:B,dotsCircle:D,sand:O,line:I,line2:q,rollingLine:N,pipe:R,simpleDots:j,simpleDotsScrolling:A,star:C,star2:M,flip:P,hamburger:S,growVertical:U,growHorizontal:F,balloon:E,balloon2:H,noise:L,bounce:V,boxBounce:Y,boxBounce2:z,triangle:Q,binary:G,arc:K,circle:W,squareCorners:J,circleQuarters:X,circleHalves:Z,squish:ee,toggle:re,toggle2:te,toggle3:se,toggle4:ie,toggle5:_e,toggle6:ae,toggle7:ne,toggle8:le,toggle9:oe,toggle10:he,toggle11:fe,toggle12:me,toggle13:ve,arrow:ue,arrow2:ce,arrow3:ge,bouncingBar:de,bouncingBall:pe,smiley:be,monkey:we,hearts:Te,clock:$e,earth:xe,material:ye,moon:ke,runner:Be,pong:De,shark:Oe,dqpb:Ie,weather:qe,christmas:Ne,grenade:Re,point:je,layer:Ae,betaWave:Ce,fingerDance:Me,fistBump:Pe,soccerHeader:Se,mindblown:Ue,speaker:Fe,orangePulse:Ee,bluePulse:He,orangeBluePulse:Le,timeTravel:Ve,aesthetic:Ye,dwarfFortress:ze,fish:Qe},Ke={breathe:{frames:["⠀","⠂","⠌","⡑","⢕","⢝","⣫","⣟","⣿","⣟","⣫","⢝","⢕","⡑","⠌","⠂","⠀"],interval:100},cascade:{frames:["⠀⠀⠀⠀","⠁⠀⠀⠀","⠋⠀⠀⠀","⠞⠁⠀⠀","⡴⠋⠀⠀","⣠⠞⠁⠀","⢀⡴⠋⠀","⠀⣠⠞⠁","⠀⢀⡴⠋","⠀⠀⣠⠞","⠀⠀⢀⡴","⠀⠀⠀⣠","⠀⠀⠀⢀"],interval:60},checkerboard:{frames:["⢕⢕⢕","⡪⡪⡪","⢊⠔⡡","⡡⢊⠔"],interval:250},columns:{frames:["⡀⠀⠀","⡄⠀⠀","⡆⠀⠀","⡇⠀⠀","⣇⠀⠀","⣧⠀⠀","⣷⠀⠀","⣿⠀⠀","⣿⡀⠀","⣿⡄⠀","⣿⡆⠀","⣿⡇⠀","⣿⣇⠀","⣿⣧⠀","⣿⣷⠀","⣿⣿⠀","⣿⣿⡀","⣿⣿⡄","⣿⣿⡆","⣿⣿⡇","⣿⣿⣇","⣿⣿⣧","⣿⣿⣷","⣿⣿⣿","⣿⣿⣿","⠀⠀⠀"],interval:60},diagSwipe:{frames:["⠁⠀","⠋⠀","⠟⠁","⡿⠋","⣿⠟","⣿⡿","⣿⣿","⣿⣿","⣾⣿","⣴⣿","⣠⣾","⢀⣴","⠀⣠","⠀⢀","⠀⠀","⠀⠀"],interval:60},dna:{frames:["⠋⠉⠙⠚","⠉⠙⠚⠒","⠙⠚⠒⠂","⠚⠒⠂⠂","⠒⠂⠂⠒","⠂⠂⠒⠲","⠂⠒⠲⠴","⠒⠲⠴⠤","⠲⠴⠤⠄","⠴⠤⠄⠋","⠤⠄⠋⠉","⠄⠋⠉⠙"],interval:80},doubleArrow:{frames:["⇐","⇖","⇑","⇗","⇒","⇘","⇓","⇙"],interval:100},fillSweep:{frames:["⣀⣀","⣤⣤","⣶⣶","⣿⣿","⣿⣿","⣿⣿","⣶⣶","⣤⣤","⣀⣀","⠀⠀","⠀⠀"],interval:100},helix:{frames:["⢌⣉⢎⣉","⣉⡱⣉⡱","⣉⢎⣉⢎","⡱⣉⡱⣉","⢎⣉⢎⣉","⣉⡱⣉⡱","⣉⢎⣉⢎","⡱⣉⡱⣉","⢎⣉⢎⣉","⣉⡱⣉⡱","⣉⢎⣉⢎","⡱⣉⡱⣉","⢎⣉⢎⣉","⣉⡱⣉⡱","⣉⢎⣉⢎","⡱⣉⡱⣉"],interval:80},infinity:{frames:["⢎⡱⣉⠆","⢎⡱⣈⠆","⢎⡱⣀⠆","⢎⡱⣀⠄","⢎⡱⣀ ","⢎⡱⡀ ","⢎⡱ ","⢎⡱ ","⢎⡡ ","⢎⡠ ","⢆⡠ ","⢄⡠ ","⢀⡠ "," ⡠ "," ⠠ "," ⠰ "," ⠐ "," ⠐⠁ "," ⠐⠉ "," ⠐⠉⠂"," ⠐⠉⠆"," ⠐⢉⠆"," ⠐⣉⠆"," ⠰⣉⠆"," ⠰⣉⠆"," ⠱⣉⠆","⠈⠱⣉⠆","⠊⠱⣉⠆","⠎⠱⣉⠆","⢎⠱⣉⠆","⢎⡱⣉⠆","⢎⡱⣉⠆"],interval:60},orbit:{frames:["⠃","⠉","⠘","⠰","⢠","⣀","⡄","⠆"],interval:100},pulse:{frames:["⠀⠶⠀","⠰⣿⠆","⢾⣉⡷","⣏⠀⣹","⡁⠀⢈"],interval:180},rain:{frames:["⢁⠂⠔⠈","⠂⠌⡠⠐","⠄⡐⢀⠡","⡈⠠⠀⢂","⠐⢀⠁⠄","⠠⠁⠊⡀","⢁⠂⠔⠈","⠂⠌⡠⠐","⠄⡐⢀⠡","⡈⠠⠀⢂","⠐⢀⠁⠄","⠠⠁⠊⡀"],interval:100},scan:{frames:["⠀⠀⠀⠀","⡇⠀⠀⠀","⣿⠀⠀⠀","⢸⡇⠀⠀","⠀⣿⠀⠀","⠀⢸⡇⠀","⠀⠀⣿⠀","⠀⠀⢸⡇","⠀⠀⠀⣿","⠀⠀⠀⢸"],interval:70},scanline:{frames:["⠉⠉⠉","⠓⠓⠓","⠦⠦⠦","⣄⣄⣄","⠦⠦⠦","⠓⠓⠓"],interval:120},snake:{frames:["⣁⡀","⣉⠀","⡉⠁","⠉⠉","⠈⠙","⠀⠛","⠐⠚","⠒⠒","⠖⠂","⠶⠀","⠦⠄","⠤⠤","⠠⢤","⠀⣤","⢀⣠","⣀⣀"],interval:80},sparkle:{frames:["⡡⠊⢔⠡","⠊⡰⡡⡘","⢔⢅⠈⢢","⡁⢂⠆⡍","⢔⠨⢑⢐","⠨⡑⡠⠊"],interval:150},wave:{frames:["⠁⠂⠄⡀","⠂⠄⡀⢀","⠄⡀⢀⠠","⡀⢀⠠⠐","⢀⠠⠐⠈","⠠⠐⠈⠁","⠐⠈⠁⠂","⠈⠁⠂⠄"],interval:100},waveRows:{frames:["⠖⠉⠉⠑","⡠⠖⠉⠉","⣠⡠⠖⠉","⣄⣠⡠⠖","⠢⣄⣠⡠","⠙⠢⣄⣠","⠉⠙⠢⣄","⠊⠉⠙⠢","⠜⠊⠉⠙","⡤⠜⠊⠉","⣀⡤⠜⠊","⢤⣀⡤⠜","⠣⢤⣀⡤","⠑⠣⢤⣀","⠉⠑⠣⢤","⠋⠉⠑⠣"],interval:90}},n={...Ge,...Ke},We=t=>n[t],Je=()=>Object.keys(n),Xe=f(import.meta.url),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,Ze=t=>{if(typeof a<"u"&&a.versions&&a.versions.node){const[e,r]=a.versions.node.split(".").map(Number);if(e>22||e===22&&r>=3||e===20&&r>=16)return a.getBuiltinModule(t)}return Xe(t)},{styleText:er}=Ze("node:util"),rr={error:"✖",info:"ℹ",success:"✓",warning:"⚠"},tr=()=>{const{env:t}=process;return!!t.CI||t.CONTINUOUS_INTEGRATION==="true"||"BUILD_NUMBER"in t||"RUN_ID"in t},sr=t=>{const e=[];return t.bold&&e.push("bold"),t.dim&&e.push("dim"),t.italic&&e.push("italic"),t.underline&&e.push("underline"),t.strikethrough&&e.push("strikethrough"),t.color&&e.push(t.color),t.bgColor&&e.push(t.bgColor),e.length===0?r=>r:r=>er(e,r)};class _r{#_=0;#o;#e=!1;#s="";#a="";#b=0;#h=0;#r;#t;#f="";#n;#v;#i;#w;#u=0;#l;#T;constructor(e={},r){if(e.frames)this.#n=e.frames;else{const i=e.name??"dots",s=We(i);if(!s)throw new Error(`Unknown spinner "${i}". Pass a custom \`frames\` set or use one of: ${Je().join(", ")}.`);this.#n=s}this.#v=e.verbose!==!1,this.#s=e.prefixText??"",this.#r=r,this.#i=e.stream??process.stderr,this.#w=r?!0:this.#i.isTTY&&!tr(),this.#T={...rr,...e.icons},typeof e.style=="function"?this.#l=e.style:e.style&&(this.#l=sr(e.style))}get elapsedTime(){return(this.#h||Date.now())-this.#b}get text(){return this.#a}set text(e){this.#a=e,this.#e&&this.#d()}get prefixText(){return this.#s}set prefixText(e){this.#s=e,this.#e&&this.#d()}get isRunning(){return this.#e}setInteractiveManager(e){this.#r=e}setMultiSpinner(e){this.#t=e}tick(){this.#e&&(this.#_=(this.#_+1)%this.#n.frames.length)}start(e,r){return this.#e?this:this.#v?(this.#e=!0,this.#b=Date.now(),this.#h=0,this.#_=0,this.#f="",e&&(this.#a=e),r?.prefixText&&(this.#s=r.prefixText),this.#t?(this.#t.renderAll(),this):(this.#r?(this.#r.hook(),this.#$(),this.#g()):(this.#x(),this.#g()),this)):this}stop(){if(this.#e){if(this.#m(),this.#e=!1,this.#h=Date.now(),this.#f="",this.#t){this.#t.renderAll();return}this.#r?(this.#r.erase("stdout"),this.#r.unhook(!1)):this.#p()}}stopAndPersist(e){if(!this.#e||(this.#m(),this.#e=!1,this.#h=Date.now(),!this.#v))return;const r=e?.prefixText??this.#s,i=e?.text??this.#a;let s=e?.symbol??"";r&&(s=s?`${r} ${s}`:r),i&&(s=s?`${s} ${i}`:i),this.#y(s)}succeed(e){this.#c("success",e)}failed(e){this.#c("error",e)}warn(e){this.#c("warning",e)}info(e){this.#c("info",e)}pause(){this.#m()}resume(){this.#e&&(this.#m(),this.#t||this.#g())}getFrameOutput(){if(!this.#e&&this.#f)return this.#f;const e=this.#n.frames[this.#_];let r=this.#l?this.#l(e):e;return this.#s&&(r=`${this.#s} ${r}`),this.#a&&(r=`${r} ${this.#a}`),r}#g(){this.#w&&(this.#o=setInterval(()=>{this.#e&&(this.#_=(this.#_+1)%this.#n.frames.length,this.#d())},this.#n.interval),this.#o.unref())}#m(){this.#o&&(clearInterval(this.#o),this.#o=void 0)}#d(){this.#t?this.#t.renderAll():this.#r?this.#$():this.#x()}#$(){this.#r&&this.#r.update("stdout",[this.getFrameOutput()])}#x(){const e=this.getFrameOutput();this.#p(),this.#i.isTTY?(this.#i.write(e),this.#u=1):(this.#i.write(`${e}
|
|
2
|
+
`),this.#u=0)}#p(){this.#u>0&&this.#i.isTTY&&this.#i.write("\r\x1B[K"),this.#u=0}#y(e){this.#f=e,this.#t?this.#t.renderAll():this.#r?(this.#r.update("stdout",[e]),this.#r.unhook(!1)):(this.#p(),this.#i.write(`${e}
|
|
3
|
+
`))}#c(e,r){if(!this.#e||(this.#m(),this.#e=!1,this.#h=Date.now(),!this.#v))return;let i="";const s=this.#T[e];s&&(i=this.#l?this.#l(s):s),this.#s&&(i=`${this.#s} ${i}`),r&&(i=`${i} ${r}`),this.#y(i)}}export{We as V,_r as o};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{b as r,a as d,p as h}from"../packem_chunks/orchestrator.js";const w=async(a={})=>{const e=await r(a),t=await d(e,{dryRun:a.dryRun});return{changedFiles:t.changedFiles,deletedFiles:t.deletedFiles,plan:t.plan}},y=async(a={})=>{const e=await r(a),{resolveFormatter:t}=await import("../packem_chunks/resolveFormatter.js"),n=await t(e.config.changelog,e.cwd),g=new Date().toISOString().slice(0,10),o=[];for(const s of e.plan.releases){const i=e.depGraph.getPackage(s.name);if(!i)continue;const l=await n({changeFiles:s.changeFiles,date:g,release:s,target:"changelog"});o.push({content:l,file:`${i.dir}/CHANGELOG.md`,package:s.name})}return{projectChangelogs:o}},F=async(a={})=>{const e=await r(a);return await h(e,{dryRun:a.dryRun,otp:a.otp,tag:a.tag})},m=async a=>{const e=await r(a),{runSnapshot:t}=await import("../packem_chunks/snapshot.js"),n=await t({context:e,dryRun:a.dryRun,registry:a.registry,tag:a.tag});return{failed:n.failed,published:n.published,skipped:n.skipped,snapshotVersion:n.snapshotVersion,tag:n.tag}},R=async(a={})=>{const e=await r(a),t=await d(e,{dryRun:a.dryRun}),n={changedFiles:t.changedFiles,deletedFiles:t.deletedFiles,plan:t.plan},{resolveFormatter:g}=await import("../packem_chunks/resolveFormatter.js"),o=await g(e.config.changelog,e.cwd),s=new Date().toISOString().slice(0,10),i=[];for(const c of t.plan.releases){const p=e.depGraph.getPackage(c.name);if(!p)continue;const f=await o({changeFiles:c.changeFiles,date:s,release:c,target:"changelog"});i.push({content:f,file:`${p.dir}/CHANGELOG.md`,package:c.name})}const l={projectChangelogs:i};if(a.skipPublish)return{changelog:l,publish:{failed:[],published:[],skipped:[]},version:n};const u=await h(e,{dryRun:a.dryRun,otp:void 0,tag:void 0});return{changelog:l,publish:u,version:n}};class C{constructor(e={}){this.config=e}config;releaseVersion(e={}){return w({...e,config:this.config})}releaseChangelog(e={}){return y({...e,config:this.config})}releasePublish(e={}){return F({...e,config:this.config})}releaseSnapshot(e){return m({...e,config:this.config})}}export{C as ReleaseClient,R as release,y as releaseChangelog,F as releasePublish,m as releaseSnapshot,w as releaseVersion};
|