@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,148 @@
|
|
|
1
|
+
interface PackResult {
|
|
2
|
+
/** Whatever metadata the manager emitted (e.g. file list). Optional. */
|
|
3
|
+
raw?: unknown;
|
|
4
|
+
/** Absolute path to the produced `.tgz` file. */
|
|
5
|
+
tarball: string;
|
|
6
|
+
}
|
|
7
|
+
interface PackOptions {
|
|
8
|
+
/** Working directory of the package. */
|
|
9
|
+
cwd: string;
|
|
10
|
+
/** Output directory for the tarball. Default: cwd. */
|
|
11
|
+
destination?: string;
|
|
12
|
+
/** Override output filename — useful to normalise yarn's `package.tgz` default. */
|
|
13
|
+
filename?: string;
|
|
14
|
+
}
|
|
15
|
+
interface InstallLockfileOnlyOptions {
|
|
16
|
+
/** Workspace root (or any dir within the workspace). */
|
|
17
|
+
cwd: string;
|
|
18
|
+
/** Avoid emitting noise to stdout/stderr. */
|
|
19
|
+
silent?: boolean;
|
|
20
|
+
}
|
|
21
|
+
interface PublishOptions {
|
|
22
|
+
/** `public` or `restricted`. */
|
|
23
|
+
access?: "public" | "restricted";
|
|
24
|
+
/** Extra args passed through to the publisher. */
|
|
25
|
+
extraArgs?: string[];
|
|
26
|
+
/** 2FA token. */
|
|
27
|
+
otp?: string;
|
|
28
|
+
/** Provenance attestation (npm/pnpm/yarn only). */
|
|
29
|
+
provenance?: boolean;
|
|
30
|
+
/** Override registry URL. */
|
|
31
|
+
registry?: string;
|
|
32
|
+
/**
|
|
33
|
+
* Stage the publish for human review instead of going live. Requires
|
|
34
|
+
* npm CLI ≥ 11.15.0 and npmjs.com as the registry. Adapters that don't
|
|
35
|
+
* support staging silently fall through to a regular publish; the
|
|
36
|
+
* orchestrator's doctor + workflow text steer operators around this.
|
|
37
|
+
*/
|
|
38
|
+
stage?: boolean;
|
|
39
|
+
/** npm dist-tag. */
|
|
40
|
+
tag?: string;
|
|
41
|
+
/** Path to the `.tgz` to publish. */
|
|
42
|
+
tarball: string;
|
|
43
|
+
}
|
|
44
|
+
interface PublishNativeOptions {
|
|
45
|
+
/** `public` or `restricted`. */
|
|
46
|
+
access?: "public" | "restricted";
|
|
47
|
+
/** Package directory — the manager packs + publishes from here. */
|
|
48
|
+
cwd: string;
|
|
49
|
+
/** Extra args passed through to the publisher. */
|
|
50
|
+
extraArgs?: string[];
|
|
51
|
+
/** 2FA token (managers that support it on their native publish path). */
|
|
52
|
+
otp?: string;
|
|
53
|
+
/** Provenance attestation (npm/pnpm/yarn only; bun ignores). */
|
|
54
|
+
provenance?: boolean;
|
|
55
|
+
/** Override registry URL. */
|
|
56
|
+
registry?: string;
|
|
57
|
+
/** npm dist-tag. */
|
|
58
|
+
tag?: string;
|
|
59
|
+
}
|
|
60
|
+
interface PublishResult {
|
|
61
|
+
/** Whether the registry rejected because the tarball was already there. */
|
|
62
|
+
alreadyPublished?: boolean;
|
|
63
|
+
/** Captured stdout/stderr for diagnostics. */
|
|
64
|
+
output?: string;
|
|
65
|
+
/** Whether the publish succeeded. False if "already published" was detected. */
|
|
66
|
+
published: boolean;
|
|
67
|
+
/**
|
|
68
|
+
* `npm stage publish` returns a stage id (uuid). Surfaced so the
|
|
69
|
+
* orchestrator can list it in the state file and so `vis release stage
|
|
70
|
+
* approve` can promote the wave atomically.
|
|
71
|
+
*/
|
|
72
|
+
stageId?: string;
|
|
73
|
+
/**
|
|
74
|
+
* Path + hashes of the tarball that was published (or would have been, in
|
|
75
|
+
* dry-run). Set when the version-actions implementation can surface them;
|
|
76
|
+
* consumed by the orchestrator's release-asset attestation step.
|
|
77
|
+
*/
|
|
78
|
+
tarball?: {
|
|
79
|
+
path: string;
|
|
80
|
+
sha256: string;
|
|
81
|
+
sha512: string;
|
|
82
|
+
size: number;
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
interface CommandRunner {
|
|
86
|
+
/** Spawn a child process. Returns combined stdout for downstream parsing. */
|
|
87
|
+
run: (command: string, args: ReadonlyArray<string>, options: {
|
|
88
|
+
cwd: string;
|
|
89
|
+
env?: NodeJS.ProcessEnv;
|
|
90
|
+
silent?: boolean;
|
|
91
|
+
}) => Promise<{
|
|
92
|
+
exitCode: number;
|
|
93
|
+
stderr: string;
|
|
94
|
+
stdout: string;
|
|
95
|
+
}>;
|
|
96
|
+
}
|
|
97
|
+
interface WorkspaceListEntry {
|
|
98
|
+
name: string;
|
|
99
|
+
/** Absolute directory of the package. */
|
|
100
|
+
path: string;
|
|
101
|
+
private: boolean;
|
|
102
|
+
version: string;
|
|
103
|
+
}
|
|
104
|
+
/**
|
|
105
|
+
* Per-pm primitives: pack, install, publish, list workspaces, resolve
|
|
106
|
+
* `catalog:` (only pnpm — others throw if asked).
|
|
107
|
+
*
|
|
108
|
+
* Implementations are stateless. Construct via `detectPackageManager(cwd)`.
|
|
109
|
+
*/
|
|
110
|
+
declare abstract class PackageManagerAdapter {
|
|
111
|
+
readonly runner: CommandRunner;
|
|
112
|
+
abstract readonly id: "npm" | "pnpm" | "yarn" | "bun";
|
|
113
|
+
abstract readonly minVersion: string;
|
|
114
|
+
constructor(runner: CommandRunner);
|
|
115
|
+
abstract pack(options: PackOptions): Promise<PackResult>;
|
|
116
|
+
abstract installLockfileOnly(options: InstallLockfileOnlyOptions): Promise<void>;
|
|
117
|
+
abstract listWorkspacePackages(cwd: string): Promise<WorkspaceListEntry[]>;
|
|
118
|
+
/**
|
|
119
|
+
* Publish a tarball. Default impl in the `npm` adapter — yarn/bun/pnpm
|
|
120
|
+
* may simply re-call `npm publish <tarball>` per RFC §11.3 when the
|
|
121
|
+
* configured `publishStrategy` is `"npm-publish-tarball"` (default).
|
|
122
|
+
*/
|
|
123
|
+
abstract publish(options: PublishOptions): Promise<PublishResult>;
|
|
124
|
+
/**
|
|
125
|
+
* Native publish: run the package manager's own `publish` command directly
|
|
126
|
+
* from the package directory (the manager packs + publishes itself), used
|
|
127
|
+
* when the project opts into `publish.publishStrategy: "native"`. The
|
|
128
|
+
* default LCD path is `publish` (an `npm publish` of a packed tarball).
|
|
129
|
+
* Each adapter overrides this with its own publish command + flag surface;
|
|
130
|
+
* the default throws so an adapter that genuinely can't publish natively
|
|
131
|
+
* fails loudly rather than silently no-opping.
|
|
132
|
+
*
|
|
133
|
+
* Caveat (RFC §11.3): native publish lets the manager resolve
|
|
134
|
+
* `workspace:`/`catalog:` itself. Only pnpm rewrites `catalog:` — on
|
|
135
|
+
* npm/yarn/bun the operator must set `catalogResolution: "in-place"` (or
|
|
136
|
+
* have no catalog refs) or the published tarball will carry literal
|
|
137
|
+
* `catalog:` specifiers.
|
|
138
|
+
*/
|
|
139
|
+
publishNative(_options: PublishNativeOptions): Promise<PublishResult>;
|
|
140
|
+
/** Native pm version detection (e.g. `<pm> --version`). */
|
|
141
|
+
abstract detectVersion(cwd: string): Promise<string | undefined>;
|
|
142
|
+
/**
|
|
143
|
+
* Read this manager's catalog block (only pnpm has them). Default impl
|
|
144
|
+
* returns `undefined` — adapters override to provide raw YAML/JSON.
|
|
145
|
+
*/
|
|
146
|
+
readCatalogYaml(_cwd: string): Promise<string | undefined>;
|
|
147
|
+
}
|
|
148
|
+
export { CommandRunner as C, InstallLockfileOnlyOptions as I, PackageManagerAdapter as P, WorkspaceListEntry as W, PackOptions as a, PackResult as b, PublishNativeOptions as c, PublishOptions as d, PublishResult as e };
|
|
@@ -0,0 +1,106 @@
|
|
|
1
|
+
import { PlannedRelease, PerPackageReleaseConfig, WorkspacePackage, PackageManifest, VisReleaseConfig } from "../release/types.js";
|
|
2
|
+
import { P as PackageManagerAdapter, e as PublishResult } from "./interface.d-B7VK2rcH.js";
|
|
3
|
+
/**
|
|
4
|
+
* Parsed `pnpm-workspace.yaml` catalogs.
|
|
5
|
+
* - `default` is the top-level `catalog:` block (referenced as `catalog:` in deps).
|
|
6
|
+
* - `named` is the `catalogs:` map (referenced as `catalog:<name>`).
|
|
7
|
+
*/
|
|
8
|
+
interface Catalogs {
|
|
9
|
+
default: Record<string, string>;
|
|
10
|
+
named: Record<string, Record<string, string>>;
|
|
11
|
+
}
|
|
12
|
+
interface PublishContext {
|
|
13
|
+
/** Catalog blocks for `catalog:` rewriting. */
|
|
14
|
+
catalogs: Catalogs;
|
|
15
|
+
/** Strip non-publishable fields (`scripts`, `devDependencies`, etc.). */
|
|
16
|
+
cleanPackageJsonConfig?: boolean | {
|
|
17
|
+
keep?: string[];
|
|
18
|
+
strip?: string[];
|
|
19
|
+
};
|
|
20
|
+
/** Dry-run mode — perform no writes / no network calls. */
|
|
21
|
+
dryRun?: boolean;
|
|
22
|
+
/** OTP for 2FA-protected publishes. */
|
|
23
|
+
otp?: string;
|
|
24
|
+
/** Per-package config (incl. custom commands subject to trust gate). */
|
|
25
|
+
perPackageConfig?: PerPackageReleaseConfig;
|
|
26
|
+
/** Pre-bump source-tree manifest (read-only). */
|
|
27
|
+
pkg: WorkspacePackage;
|
|
28
|
+
/** Active package-manager adapter for this workspace. */
|
|
29
|
+
pm: PackageManagerAdapter;
|
|
30
|
+
/** Provenance attestation requested? (Skipped for managers that don't support it.) */
|
|
31
|
+
provenance?: boolean;
|
|
32
|
+
/** Resolved registry (per-pkg override or global). */
|
|
33
|
+
registry?: string;
|
|
34
|
+
/** The plan entry for this package (with the new version etc.). */
|
|
35
|
+
release: PlannedRelease;
|
|
36
|
+
/**
|
|
37
|
+
* When set, the tarball is already staged on the registry under this
|
|
38
|
+
* id; skip pack + publish and resume waiting on the existing decision.
|
|
39
|
+
* Carried by `vis release publish --resume` / re-runs after a timeout
|
|
40
|
+
* so we don't try to re-upload a version npm already has staged.
|
|
41
|
+
*/
|
|
42
|
+
resumeStageId?: string;
|
|
43
|
+
/** Channel-derived dist-tag. */
|
|
44
|
+
tag?: string;
|
|
45
|
+
/** Map of every package being released this wave (for workspace: rewriting). */
|
|
46
|
+
versionedManifestByName: ReadonlyMap<string, PackageManifest>;
|
|
47
|
+
/** Workspace-wide config (for trust-gate evaluation, etc.). */
|
|
48
|
+
workspaceConfig?: VisReleaseConfig;
|
|
49
|
+
}
|
|
50
|
+
interface AfterAllVersionedContext {
|
|
51
|
+
/** Workspace root. */
|
|
52
|
+
cwd: string;
|
|
53
|
+
/** Active package-manager adapter. */
|
|
54
|
+
pm: PackageManagerAdapter;
|
|
55
|
+
/** All releases in this wave. */
|
|
56
|
+
releases: ReadonlyArray<PlannedRelease>;
|
|
57
|
+
}
|
|
58
|
+
interface AfterAllVersionedResult {
|
|
59
|
+
changedFiles: string[];
|
|
60
|
+
deletedFiles: string[];
|
|
61
|
+
}
|
|
62
|
+
/**
|
|
63
|
+
* Per-package versioning + publishing contract.
|
|
64
|
+
*
|
|
65
|
+
* Concrete implementations are stateless. Construct one instance per
|
|
66
|
+
* package per release wave; the orchestrator passes context per call.
|
|
67
|
+
*/
|
|
68
|
+
declare abstract class VersionActions {
|
|
69
|
+
/**
|
|
70
|
+
* Stable id for resolution (`"npm"`, `"native-addon"`, `"private"`,
|
|
71
|
+
* or a path for custom impls).
|
|
72
|
+
*/
|
|
73
|
+
abstract readonly id: string;
|
|
74
|
+
/**
|
|
75
|
+
* Read the current published version of this package from the registry.
|
|
76
|
+
* Returns `undefined` for private packages or fresh packages never published.
|
|
77
|
+
*
|
|
78
|
+
* The optional `workspaceConfig` field threads workspace-level
|
|
79
|
+
* knobs (currently only `httpProxy`) so adapters can route registry
|
|
80
|
+
* probes through an enterprise proxy. Older adapters that ignore
|
|
81
|
+
* the field continue to work.
|
|
82
|
+
*/
|
|
83
|
+
abstract readPublishedVersion(context: {
|
|
84
|
+
pkg: WorkspacePackage;
|
|
85
|
+
pm: PackageManagerAdapter;
|
|
86
|
+
workspaceConfig?: VisReleaseConfig;
|
|
87
|
+
}): Promise<string | undefined>;
|
|
88
|
+
/**
|
|
89
|
+
* Publish this package (and any sidecars). Implementations are responsible
|
|
90
|
+
* for: protocol resolution, catalog rewriting, clean-package-json,
|
|
91
|
+
* pack-then-publish via the active adapter.
|
|
92
|
+
*/
|
|
93
|
+
abstract publish(context: PublishContext): Promise<PublishResult>;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* Optional companion hook — runs once per workspace after every package's
|
|
97
|
+
* `bumpVersion` step has completed and before the prettier/commit phase.
|
|
98
|
+
*
|
|
99
|
+
* Used to update sidecar files that span packages (e.g. NAPI platform
|
|
100
|
+
* `optionalDependencies` blocks, lockfile re-sync). Returned files are
|
|
101
|
+
* auto-staged into the release commit.
|
|
102
|
+
*/
|
|
103
|
+
declare abstract class AfterAllProjectsVersioned {
|
|
104
|
+
abstract afterAllVersioned(context: AfterAllVersionedContext): Promise<AfterAllVersionedResult>;
|
|
105
|
+
}
|
|
106
|
+
export { AfterAllProjectsVersioned as A, PublishContext as P, VersionActions as V, AfterAllVersionedContext as a, AfterAllVersionedResult as b };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const r=new Set(["0BSD","AGPL-3.0","AGPL-3.0-only","AGPL-3.0-or-later","Apache-1.1","Apache-2.0","Artistic-2.0","BlueOak-1.0.0","BSD-2-Clause","BSD-3-Clause","BSL-1.0","CC0-1.0","CC-BY-3.0","CC-BY-4.0","CDDL-1.0","CDDL-1.1","EPL-1.0","EPL-2.0","GPL-2.0","GPL-2.0-only","GPL-2.0-or-later","GPL-3.0","GPL-3.0-only","GPL-3.0-or-later","ISC","LGPL-2.0","LGPL-2.1","LGPL-3.0","MIT","MIT-0","MPL-1.1","MPL-2.0","Python-2.0","Unlicense","WTFPL","Zlib"]),c={apache2:"Apache-2.0","apache 2.0":"Apache-2.0",bsd:"BSD-3-Clause","bsd-2":"BSD-2-Clause","bsd-3":"BSD-3-Clause",mit:"MIT",public:"Unlicense","public domain":"Unlicense"},l=(()=>{const e=new Map;for(const n of r)e.set(n.toLowerCase(),n);for(const[n,s]of Object.entries(c))e.set(n,s);return e})(),o=e=>{const n=e.trim();if(n.length!==0)return r.has(n)?n:l.get(n.toLowerCase())},a=e=>{let n;if(typeof e.license=="string")n=e.license;else if(e.license&&typeof e.license=="object"&&typeof e.license.type=="string")n=e.license.type;else if(Array.isArray(e.licenses)&&e.licenses.length>0){const t=e.licenses[0];t&&typeof t.type=="string"&&(n=t.type)}if(!n)return;const s=n.trim();if(s.length===0)return;if(/[()]|\b(?:and|or|with)\b/i.test(s))return[{expression:s}];const i=o(s);return i?[{license:{id:i}}]:[{license:{name:s}}]};export{a as e,o as n};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as A}from"node:module";import{z as L,L as N,m as c,c as W,b as C}from"./index-BDmTbWX1.js";import{aQ as Q}from"../packem_chunks/bin.js";import{N as U}from"../packem_chunks/config.js";import{withEnhancedPath as ot}from"@visulima/task-runner";const F=A(import.meta.url),d=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,l=t=>{if(typeof d<"u"&&d.versions&&d.versions.node){const[o,e]=d.versions.node.split(".").map(Number);if(o>22||o===22&&e>=3||o===20&&e>=16)return d.getBuiltinModule(t)}return F(t)},{Socket:G}=l("node:net"),{randomBytes:V}=l("node:crypto"),{readdir:q,rm:k,unlink:v,open:B,readFile:Y,stat:z,writeFile:J,rename:K}=l("node:fs/promises"),{spawn:X}=l("node:child_process"),{openSync:Z,closeSync:tt}=l("node:fs");async function $(t,o,e){const s=await L(t,{buffer:!0,encoding:void 0});let i=new TextDecoder().decode(s);const{beforeParse:r,color:n}={};return typeof r=="function"&&(i=r(i)),U(i,o,N(t),{color:n})}const et=3e4,E=100;class st extends Error{constructor(o,e){super(o),this.elapsedMs=e,this.name="ServiceReadinessError"}elapsedMs}const it=async t=>{const o=t.host??"127.0.0.1",{port:e}=t,s=t.timeoutMs??et,i=Date.now();for(;Date.now()-i<s;){if(await rt(o,e))return;await nt(E)}throw new st(`Timed out waiting for ${o}:${String(e)} to accept TCP connections (${String(s)}ms)`,Date.now()-i)},rt=(t,o)=>new Promise(e=>{const s=new G,i=r=>{s.removeAllListeners(),s.destroy(),e(r)};s.once("connect",()=>{i(!0)}),s.once("error",()=>{i(!1)}),s.setTimeout(E,()=>{i(!1)});try{s.connect(o,t)}catch{i(!1)}}),nt=t=>new Promise(o=>{setTimeout(o,t)}),at=async(t,o)=>{const e=t.readiness??(t.port===void 0?void 0:{tcp:{port:t.port}});e&&await it({host:e.tcp.host,port:e.tcp.port,timeoutMs:o?.timeoutMs??e.tcp.timeoutMs})},y=384,b=5e3,ct=50,ht=3e4,h=async t=>{const o=c(Q(t),"services");try{await W(o)}catch(e){throw e.code==="ENOTDIR"?new Error(`Service registry path ${o} exists but is not a directory. Remove it or move the conflicting file before running \`vis service\`.`,{cause:e}):e}return o},_=t=>t.replaceAll("/","_").replaceAll(":","__"),g=(t,o)=>c(t,`${_(o)}.json`),dt=(t,o)=>c(t,`${_(o)}.lock`),u=async(t,o)=>{const e=await h(t),s=g(e,o);if(await C(s))try{return await $(s)}catch{return}},ft=async t=>{const o=await h(t);let e;try{e=await q(o)}catch{return[]}const s=[];for(const i of e)if(i.endsWith(".json"))try{const r=await $(c(o,i));s.push(r)}catch{}return s},lt=async(t,o)=>{const e=await h(t),s=g(e,o.id),i=c(e,`.${V(8).toString("hex")}.tmp`);await J(i,`${JSON.stringify(o,void 0,2)}
|
|
2
|
+
`,{mode:y});try{await kt(i,s)}catch(r){throw await k(i,{force:!0}).catch(()=>{}),r}},ut=new Set(["EACCES","EBUSY","EPERM"]),pt=8,wt=20,kt=async(t,o)=>{let e=0;for(;;)try{await K(t,o);return}catch(s){const{code:i}=s;if(!(i!==void 0&&ut.has(i))||e>=pt)throw s;const r=wt*2**e;await new Promise(n=>{setTimeout(n,r)}),e+=1}},f=async(t,o,e)=>{const s=await h(t),i=e??await u(t,o);await k(g(s,o),{force:!0}),i&&await k(i.logFile,{force:!0}).catch(()=>{})},a=t=>{try{return process.kill(t,0),!0}catch{return!1}},Dt=async t=>{const o=await ft(t),e=[],s=[];for(const i of o){if(a(i.pid)){s.push(i);continue}const r=await u(t,i.id);if(r&&r.pid!==i.pid){s.push(r);continue}await f(t,i.id,i).catch(()=>{}),e.push(i.id)}return{pruned:e,surviving:s}},mt=t=>new Promise(o=>{setTimeout(o,t)}),yt=async t=>{try{const o=await B(t,"wx",y);try{await o.writeFile(String(process.pid))}finally{await o.close().catch(()=>{})}return!0}catch(o){if(o.code==="EEXIST")return!1;throw o}},_t=async t=>{let o;try{const e=await Y(t,"utf8"),s=Number.parseInt(e.trim(),10);o=Number.isFinite(s)?s:void 0}catch{return!0}if(o!==void 0&&!a(o))return!0;try{const e=await z(t);return Date.now()-e.mtimeMs>ht}catch{return!0}},M=async(t,o,e)=>{const s=await h(t),i=dt(s,o),r=Date.now();for(;!await yt(i);){if(await _t(i)){await v(i).catch(()=>{});continue}if(Date.now()-r>=b)throw new Error(`Could not acquire service lock for ${o} within ${String(b)}ms — another \`vis service\` invocation appears to be holding it.`);await mt(ct)}try{return await e()}finally{await v(i).catch(()=>{})}};function m(t,o={},e){for(const s in t){const i=t[s],r=e?`${e}:${s}`:s;typeof i=="object"&&i!==null?m(i,o,r):typeof i=="function"&&(o[r]=i)}return o}const R=(()=>{if(console.createTask)return console.createTask;const t={run:o=>o()};return()=>t})();function T(t,o,e,s){for(let i=e;i<t.length;i+=1)try{const r=s?s.run(()=>t[i](...o)):t[i](...o);if(r&&typeof r.then=="function")return Promise.resolve(r).then(()=>T(t,o,i+1,s))}catch(r){return Promise.reject(r)}}function gt(t,o,e){if(t.length>0)return T(t,o,0,R(e))}function vt(t,o,e){if(t.length>0){const s=R(e);return Promise.all(t.map(i=>s.run(()=>i(...o))))}}function w(t,o){for(const e of[...t])e(o)}var bt=class{_hooks;_before;_after;_deprecatedHooks;_deprecatedMessages;constructor(){this._hooks={},this._before=void 0,this._after=void 0,this._deprecatedMessages=void 0,this._deprecatedHooks={},this.hook=this.hook.bind(this),this.callHook=this.callHook.bind(this),this.callHookWith=this.callHookWith.bind(this)}hook(t,o,e={}){if(!t||typeof o!="function")return()=>{};const s=t;let i;for(;this._deprecatedHooks[t];)i=this._deprecatedHooks[t],t=i.to;if(i&&!e.allowDeprecated){let r=i.message;r||(r=`${s} hook has been deprecated`+(i.to?`, please use ${i.to}`:"")),this._deprecatedMessages||(this._deprecatedMessages=new Set),this._deprecatedMessages.has(r)||(console.warn(r),this._deprecatedMessages.add(r))}if(!o.name)try{Object.defineProperty(o,"name",{get:()=>"_"+t.replace(/\W+/g,"_")+"_hook_cb",configurable:!0})}catch{}return this._hooks[t]=this._hooks[t]||[],this._hooks[t].push(o),()=>{o&&(this.removeHook(t,o),o=void 0)}}hookOnce(t,o){let e,s=(...i)=>(typeof e=="function"&&e(),e=void 0,s=void 0,o(...i));return e=this.hook(t,s),e}removeHook(t,o){const e=this._hooks[t];if(e){const s=e.indexOf(o);s!==-1&&e.splice(s,1),e.length===0&&(this._hooks[t]=void 0)}}clearHook(t){this._hooks[t]=void 0}deprecateHook(t,o){this._deprecatedHooks[t]=typeof o=="string"?{to:o}:o;const e=this._hooks[t]||[];this._hooks[t]=void 0;for(const s of e)this.hook(t,s)}deprecateHooks(t){for(const o in t)this.deprecateHook(o,t[o])}addHooks(t){const o=m(t),e=Object.keys(o).map(s=>this.hook(s,o[s]));return()=>{for(const s of e)s();e.length=0}}removeHooks(t){const o=m(t);for(const e in o)this.removeHook(e,o[e])}removeAllHooks(){this._hooks={}}callHook(t,...o){return this.callHookWith(gt,t,o)}callHookParallel(t,...o){return this.callHookWith(vt,t,o)}callHookWith(t,o,e){const s=this._before||this._after?{name:o,args:e,context:{}}:void 0;this._before&&w(this._before,s);const i=t(this._hooks[o]?[...this._hooks[o]]:[],e,o);return i instanceof Promise?i.finally(()=>{this._after&&s&&w(this._after,s)}):(this._after&&s&&w(this._after,s),i)}beforeEach(t){return this._before=this._before||[],this._before.push(t),()=>{if(this._before!==void 0){const o=this._before.indexOf(t);o!==-1&&this._before.splice(o,1)}}}afterEach(t){return this._after=this._after||[],this._after.push(t),()=>{if(this._after!==void 0){const o=this._after.indexOf(t);o!==-1&&this._after.splice(o,1)}}}};function St(){return new bt}const xt=()=>St(),Ot=async(t,o)=>{if(!(!o||o.length===0))for(const e of o){if(e.hooks)for(const[s,i]of Object.entries(e.hooks)){const r=Array.isArray(i)?i:[i];for(const n of r)t.hook(s,n)}e.setup&&await e.setup(t)}};class jt{#e;#o;#s=new Map;constructor(o,e){this.#e=o,this.#o=e}startTasks(o){for(const e of o)this.#s.set(e.id,e),this.#t("task:before",e)}endTasks(o){for(const e of o)this.#s.delete(e.task.id),this.#t("task:after",e.task,e),e.status==="failure"?this.#t("task:failure",e.task,e):Ht(e.status)&&this.#t("task:cacheHit",e.task,e)}printCacheMiss(o,e){this.#t("task:cacheMiss",o,e)}onTaskStdout(o,e){this.#t("task:stdout",o,e)}onTaskStderr(o,e){this.#t("task:stderr",o,e)}#t(o,...e){Promise.resolve(this.#e.callHook(o,...e)).catch(s=>{if(this.#o)try{this.#o(o,s)}catch{}})}}const Ht=t=>t==="local-cache"||t==="local-cache-kept-existing"||t==="remote-cache",S=process.platform==="win32",$t=async t=>{const{command:o,cwd:e,env:s,logFile:i}=t,r=Z(i,"a",y);let n;const p=S?"cmd":"/bin/sh",x=S?["/d","/s","/c",o]:["-c",o];try{n=X(p,x,{cwd:e,detached:!0,env:ot({...process.env,...s},e),stdio:["ignore",r,r],windowsHide:!0})}finally{tt(r)}if(n.pid===void 0&&await new Promise((O,j)=>{n.once("spawn",()=>{O()}),n.once("error",I=>{j(I)})}),n.pid===void 0)throw new Error(`Failed to spawn detached process for command: ${o}`);return n.unref(),{pid:n.pid}},P=5e3,It=async t=>M(t.workspaceRoot,t.id,async()=>{const o=await u(t.workspaceRoot,t.id);if(o&&a(o.pid))throw new Error(`Service ${t.id} is already running (pid ${String(o.pid)})`);o&&await f(t.workspaceRoot,t.id,o);const e=await h(t.workspaceRoot),s=_(t.id),i=c(e,`${s}.log`),{pid:r}=await $t({command:t.command,cwd:t.cwd,env:t.env,logFile:i}),n={command:t.command,config:t.config,cwd:t.cwd,env:t.config.env??{},id:t.id,logFile:i,pid:r,slug:s,startedAt:new Date().toISOString(),visVersion:process.env.VIS_VERSION??"0.0.0"};if(await lt(t.workspaceRoot,n),t.skipReadiness!==!0)try{await at(t.config,{timeoutMs:t.readinessTimeoutMs})}catch(p){throw await D(r,t.config.killGracePeriodMs??P).catch(()=>{}),await f(t.workspaceRoot,t.id,n).catch(()=>{}),p}return{entry:n}}),At=async t=>M(t.workspaceRoot,t.id,async()=>{const o=await u(t.workspaceRoot,t.id);if(!o)return{stopped:!1};if(!a(o.pid))return await f(t.workspaceRoot,t.id,o),{stopped:!1};const e=t.graceMs??o.config.killGracePeriodMs??P;return await D(o.pid,e),await f(t.workspaceRoot,t.id,o),{stopped:!0}}),D=async(t,o)=>{H(t,"SIGTERM");const e=Date.now();for(;Date.now()-e<o;){if(!a(t))return;await new Promise(s=>{setTimeout(s,100)})}a(t)&&H(t,"SIGKILL")},H=(t,o)=>{try{process.platform==="win32"?process.kill(t,o):process.kill(-t,o)}catch(e){if(e.code==="ESRCH")return;throw e}};export{jt as H,st as S,It as a,at as b,ft as c,xt as d,Ot as e,f,a as i,Dt as p,u as r,At as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as f}from"node:module";import{m as c}from"./index-BDmTbWX1.js";const p=f(import.meta.url),a=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,k=n=>{if(typeof a<"u"&&a.versions&&a.versions.node){const[t,e]=a.versions.node.split(".").map(Number);if(t>22||t===22&&e>=3||t===20&&e>=16)return a.getBuiltinModule(n)}return p(n)},{statSync:m,existsSync:d}=k("node:fs"),g={aube:["aube-lock.yaml"],bun:["bun.lock","bun.lockb"],npm:["npm-shrinkwrap.json","package-lock.json"],pnpm:["pnpm-lock.yaml"],yarn:["yarn.lock"]},b={aube:["node_modules/.aube-state","node_modules/.modules.yaml"],bun:["node_modules/.bun-tag"],npm:["node_modules/.package-lock.json"],pnpm:["node_modules/.modules.yaml","node_modules/.pnpm/lock.yaml"],yarn:["node_modules/.yarn-integrity","node_modules/.yarn-state.yml",".yarn/install-state.gz"]},y={ci:{aube:"aube ci",bun:"bun install --frozen-lockfile",npm:"npm ci",pnpm:"pnpm install --frozen-lockfile",yarn:"yarn install --immutable"},tty:{aube:"aube install",bun:"bun install",npm:"npm install",pnpm:"pnpm install",yarn:"yarn install"}},h=1e3,_=n=>{for(const[t,e]of Object.entries(g))for(const s of e)if(d(c(n,s)))return{lockfileFile:s,manager:t}},M=(n,t)=>{let e;for(const s of b[t]){const o=c(n,s);if(!d(o))continue;const{mtimeMs:i}=m(o);(!e||i>e.mtimeMs)&&(e={mtimeMs:i,path:s})}return e},j=(n,t={})=>{const e=_(n);if(!e)return{checked:!1};const{lockfileFile:s,manager:o}=e,i=m(c(n,s)).mtimeMs,l=M(n,o),u=y[t.inCi?"ci":"tty"][o],r={installMarkerMtimeMs:l?.mtimeMs,lockfileMtimeMs:i,lockfilePath:s,marker:l?.path,packageManager:o};return l?i>l.mtimeMs+h?{checked:!0,detail:r,failure:"stale-install",message:`${s} is newer than node_modules (${l.path}) — run \`${u}\` to sync.`}:{checked:!0,detail:r}:{checked:!0,detail:r,failure:"missing-install",message:`lockfile detected but node_modules looks uninitialised — run \`${u}\` before \`vis run\`.`}},v=(n,t,e,s={})=>{if(s.skip)return{checked:!1,shouldContinue:!0};const o=j(n,{inCi:t});if(!o.failure)return{...o,shouldContinue:!0};const i=`preflight: ${o.message??"lockfile drift detected"}`;return t&&!s.ciAsWarning?{...o,formattedMessage:i,shouldContinue:!1}:(e.warn(i),{...o,formattedMessage:i,shouldContinue:!0})};export{_ as d,v as r};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as j}from"node:module";import{m as d,f as y}from"./index-BDmTbWX1.js";import{a as A}from"../packem_chunks/config.js";const M=j(import.meta.url),l=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,b=i=>{if(typeof l<"u"&&l.versions&&l.versions.node){const[e,t]=l.versions.node.split(".").map(Number);if(e>22||e===22&&t>=3||e===20&&t>=16)return l.getBuiltinModule(i)}return M(i)},{readdirSync:_,lstatSync:S}=b("node:fs"),$=/^([^<(]+?)?(?:<([^>]+)>)?\s*(?:\(([^)]+)\))?\s*$/u,q=i=>{const e=i.match($);if(!e)return;const t=e[1]?.trim(),n=e[2]?.trim(),o=e[3]?.trim();if(!(!t&&!n&&!o))return{email:n||void 0,name:t||void 0,url:o||void 0}},w=i=>{if(!Array.isArray(i)||i.length===0)return;const e=[];for(const t of i)if(typeof t=="string"){const n=q(t);n&&e.push(n)}else if(t&&typeof t=="object"){const n=t,o=typeof n.name=="string"?n.name:void 0,r=typeof n.email=="string"?n.email:void 0,f=typeof n.url=="string"?n.url:void 0;(o||r||f)&&e.push({email:r,name:o,url:f})}return e.length>0?e:void 0},D=i=>{const e=d(i,"node_modules");if(!y(e))return new Map;const t=new Map,n=new Set,o=(r,f="")=>{if(n.has(r))return;n.add(r);let v;try{v=_(r)}catch{return}for(const a of v){const c=d(r,a);let m;try{m=S(c)}catch{continue}if(m.isSymbolicLink())continue;if(a.startsWith("@")){m.isDirectory()&&o(c,`${a}/`);continue}if(a===".pnpm"&&f===""){let s;try{s=_(c)}catch{continue}for(const p of s){const u=d(c,p,"node_modules");y(u)&&o(u)}continue}if(a.startsWith(".")||!m.isDirectory())continue;const g=f+a,h=d(c,"package.json");try{if(!y(h))continue;const s=A(h);if(typeof s.version!="string")continue;const p=`${g}@${s.version}`;t.has(p)||t.set(p,{directory:c,license:s.license,licenses:Array.isArray(s.licenses)?s.licenses:void 0,maintainers:w(s.maintainers),name:g,scripts:s.scripts&&typeof s.scripts=="object"?s.scripts:void 0,version:s.version});const u=d(c,"node_modules");y(u)&&o(u)}catch{}}};return o(e),t};export{w as n,D as r};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import{m as d,f as u,v as o,T as $}from"./index-BDmTbWX1.js";import{x}from"../packem_chunks/bin.js";const E=(k,g,h,m=[])=>{const t=[];if(h===void 0)return t.push("minimumReleaseAge not set in vis.config; skipping native sync."),t;const l=Number.isFinite(h)?Math.max(0,Math.round(h)):0;switch(k){case"bun":{const n=d(g,"bunfig.toml");let e=u(n)?o(n):"";const a=l*60,i=`minimumReleaseAge = ${String(a)}`,s=m.length>0?`minimumReleaseAgeExcludes = [${m.map(p=>`"${p.replaceAll(String.raw`"`,String.raw`\"`)}"`).join(", ")}]`:void 0,c=/^\[install\][ \t]*\n/m.exec(e);if(c?.index===void 0){const p=s?`${i}
|
|
2
|
+
${s}`:i;e=`${e.trimEnd()?`${e.trimEnd()}
|
|
3
|
+
|
|
4
|
+
`:""}[install]
|
|
5
|
+
${p}
|
|
6
|
+
`}else{const p=c.index+c[0].length,f=e.slice(p),A=/^\[/m.exec(f),y=A?.index===void 0?e.length:p+A.index;let r=e.slice(p,y);r=/^[ \t]*minimumReleaseAge[ \t]*=/m.test(r)?r.replace(/^[ \t]*minimumReleaseAge[ \t]*=.*$/m,i):`${i}
|
|
7
|
+
${r}`,s&&(r=/^[ \t]*minimumReleaseAgeExcludes[ \t]*=/m.test(r)?r.replace(/^[ \t]*minimumReleaseAgeExcludes[ \t]*=.*$/m,s):`${s}
|
|
8
|
+
${r}`),e=`${e.slice(0,p)}${r}${e.slice(y)}`}$(n,e.endsWith(`
|
|
9
|
+
`)?e:`${e}
|
|
10
|
+
`),t.push(`Updated bunfig.toml [install] minimumReleaseAge = ${String(a)} (${String(l)} minutes)`),s&&t.push(`Updated bunfig.toml [install] minimumReleaseAgeExcludes (${String(m.length)} entries)`);break}case"npm":{const n=d(g,".npmrc");let e=u(n)?o(n):"";const a=l===0?0:Math.max(1,Math.ceil(l/1440)),i=`min-release-age=${String(a)}`;e=/^\s*min-release-age\s*=/m.test(e)?e.replace(/^\s*min-release-age\s*=.*$/m,i):`${e.trimEnd()}
|
|
11
|
+
${i}
|
|
12
|
+
`,$(n,e.endsWith(`
|
|
13
|
+
`)?e:`${e}
|
|
14
|
+
`),t.push(`Updated .npmrc min-release-age=${String(a)} (rounded up from ${String(l)} minutes; npm's unit is days)`),m.length>0&&t.push("npm has no native per-package exclude list; skipped excludes sync.");break}case"pnpm":{const n=d(g,"pnpm-workspace.yaml");if(!u(n)){t.push("pnpm-workspace.yaml not found. Cannot sync minimumReleaseAge.");break}let e=o(n);e.endsWith(`
|
|
15
|
+
`)||(e+=`
|
|
16
|
+
`);const a=`minimumReleaseAge: ${String(l)}
|
|
17
|
+
`;if(e=/^minimumReleaseAge[ \t]*:.*$/m.test(e)?e.replace(/^minimumReleaseAge[ \t]*:.*$/m,a.trimEnd()):`${e.trimEnd()}
|
|
18
|
+
|
|
19
|
+
${a}`,m.length>0){const i=`minimumReleaseAgeExclude:
|
|
20
|
+
${m.map(c=>` - ${x(c)}`).join(`
|
|
21
|
+
`)}
|
|
22
|
+
`,s=/^minimumReleaseAgeExclude:[ \t]*\n(?:[ \t]{2}[^\n]*\n)*/m;e=s.test(e)?e.replace(s,i):`${e.trimEnd()}
|
|
23
|
+
|
|
24
|
+
${i}`}$(n,e),t.push(`Updated pnpm-workspace.yaml minimumReleaseAge: ${String(l)} minutes`),m.length>0&&t.push(`Updated pnpm-workspace.yaml minimumReleaseAgeExclude (${String(m.length)} entries)`);break}case"yarn":{const n=d(g,".yarnrc.yml");if(!u(n)){t.push("yarn classic lacks npmMinimalAgeGate; .yarnrc.yml not found, skipping.");break}let e=o(n);const a=`npmMinimalAgeGate: ${String(l)}`;if(e.endsWith(`
|
|
25
|
+
`)||(e+=`
|
|
26
|
+
`),e=/^npmMinimalAgeGate[ \t]*:.*$/m.test(e)?e.replace(/^npmMinimalAgeGate[ \t]*:.*$/m,a):`${e.trimEnd()}
|
|
27
|
+
|
|
28
|
+
${a}
|
|
29
|
+
`,m.length>0){const i=`npmPreapprovedPackages:
|
|
30
|
+
${m.map(c=>` - ${x(c)}`).join(`
|
|
31
|
+
`)}
|
|
32
|
+
`,s=/^npmPreapprovedPackages:[ \t]*\n(?:[ \t]{2}[^\n]*\n)*/m;e=s.test(e)?e.replace(s,i):`${e.trimEnd()}
|
|
33
|
+
|
|
34
|
+
${i}`}$(n,e),t.push(`Updated .yarnrc.yml npmMinimalAgeGate: ${String(l)} (minutes; bare integer dodges yarn duration-string bug)`),m.length>0&&t.push(`Updated .yarnrc.yml npmPreapprovedPackages (${String(m.length)} entries)`);break}}return t};export{E as S};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{f as a,m as h,B as l,I as f}from"./index-BDmTbWX1.js";import{i as d,t as $}from"../packem_chunks/bin.js";const g=/\/+$/,p=/node_modules/,u=/\.git/,k=/[$()+.?[\\\]^{|}]/g,S=/\/\*\*$|\/\*\/\*$/,W=(i,c)=>{const e=c.replace(g,"");if(e.startsWith("!"))return[];const n=[];if(e.endsWith("/*")){const s=e.slice(0,-2),t=l(i,s);if(!a(t))return[];for(const r of f(t,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[p,u]}))r.path===t||r.name.startsWith(".")||n.push(h(s,r.name));return n}if(e.endsWith("/**")||e.endsWith("/*/*")){const s=e.replace(S,""),t=l(i,s);if(!a(t))return[];for(const r of f(t,{includeFiles:!1,includeSymlinks:!1,skip:[p,u]})){if(r.path===t)continue;const m=r.path.slice(t.length+1);n.push(`${s}/${m}`)}return n}if(!e.includes("/")&&e.includes("*")){const s=e.replaceAll(k,String.raw`\$&`).replaceAll("*",".*"),t=new RegExp(`^${s}$`);for(const r of f(i,{includeFiles:!1,includeSymlinks:!1,maxDepth:1,skip:[p,u]}))r.path!==i&&t.test(r.name)&&n.push(r.name);return n}const o=l(i,e);return a(o)&&n.push(e),n},y=i=>{const c=d(i)??$(i)??[],e=new Set,n=[];for(const o of c)for(const s of W(i,o))s==="."||e.has(s)||(e.add(s),a(h(i,s,"package.json"))||n.push({packageDir:s}));return n};export{y as l};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import{m as c,v as f,T as i,f as y}from"./index-BDmTbWX1.js";import"./public-api-WqUCiyIe.js";import{n as O,u as C}from"../packem_chunks/bin.js";import{a as D}from"../packem_chunks/config.js";const W=(E,a,o)=>{const s=[],$=Object.entries(o).filter(([,n])=>n).map(([n])=>n);switch(E){case"bun":{const n=c(a,"package.json");if(y(n))try{const e=D(n);e.trustedDependencies=$,i(n,`${JSON.stringify(e,null,2)}
|
|
2
|
+
`),s.push(`Updated package.json trustedDependencies with ${$.length} packages`)}catch(e){s.push(`Failed to update package.json: ${e instanceof Error?e.message:String(e)}`)}break}case"npm":{const n=c(a,".npmrc");let e=y(n)?f(n):"";/^\s*ignore-scripts\s*=\s*true\s*$/m.test(e)?s.push(".npmrc already has ignore-scripts=true"):(e=`${e.trimEnd()}
|
|
3
|
+
ignore-scripts=true
|
|
4
|
+
`,i(n,e),s.push("Added ignore-scripts=true to .npmrc"));break}case"pnpm":{const n=c(a,"pnpm-workspace.yaml");if(!y(n)){s.push("pnpm-workspace.yaml not found. Cannot sync allowBuilds.");break}let e={},m=[];try{const t=C(n);e=t?.allowBuilds??{},m=Array.isArray(t?.onlyBuiltDependencies)?t.onlyBuiltDependencies:[]}catch{}const g={...e,...o},j=Object.keys(o).filter(t=>e[t]!==o[t]).length,d=$.toSorted((t,p)=>t.localeCompare(p)),k=[...new Set([...m,...d])].toSorted((t,p)=>t.localeCompare(p)),b=d.filter(t=>!m.includes(t)).length;if(j===0&&b===0)s.push(`All ${String(Object.keys(o).length)} allowBuilds entries already present in pnpm-workspace.yaml.`);else{const t=Object.keys(g).sort(),p=l=>l.startsWith("@")||l.includes("/")||/[:#\s]/.test(l),h=l=>p(l)?`'${l.replaceAll("'","''")}'`:l,u=`allowBuilds:
|
|
5
|
+
${t.map(l=>` ${h(l)}: ${String(g[l])}`).join(`
|
|
6
|
+
`)}
|
|
7
|
+
`;let r=f(n);r.endsWith(`
|
|
8
|
+
`)||(r+=`
|
|
9
|
+
`);const S=/^allowBuilds:[ \t]*\n(?:[ \t]{2}[^\n]*\n)*/m;if(r=S.test(r)?r.replace(S,u):`${r.trimEnd()}
|
|
10
|
+
|
|
11
|
+
${u}`,k.length>0){const l=`onlyBuiltDependencies:
|
|
12
|
+
${k.map(B=>` - ${p(B)?`'${B.replaceAll("'","''")}'`:B}`).join(`
|
|
13
|
+
`)}
|
|
14
|
+
`,A=/^onlyBuiltDependencies:[ \t]*\n(?:[ \t]{2}[^\n]*\n)*/m;r=A.test(r)?r.replace(A,l):`${r.trimEnd()}
|
|
15
|
+
|
|
16
|
+
${l}`}i(n,r),s.push(`Updated pnpm-workspace.yaml allowBuilds (${String(j)} new, ${String(t.length)} total)`),b>0&&s.push(`Updated pnpm-workspace.yaml onlyBuiltDependencies (${String(b)} new, ${String(k.length)} total)`)}const w=c(a,"package.json");if(y(w)&&d.length>0)try{const t=D(w),p=Array.isArray(t.pnpm?.onlyBuiltDependencies)?t.pnpm.onlyBuiltDependencies:[],h=[...new Set([...p,...d])].toSorted((r,S)=>r.localeCompare(S)),u=d.filter(r=>!p.includes(r)).length;u>0&&(t.pnpm={...t.pnpm,onlyBuiltDependencies:h},i(w,`${JSON.stringify(t,null,2)}
|
|
17
|
+
`),s.push(`Updated package.json pnpm.onlyBuiltDependencies (${String(u)} new, ${String(h.length)} total)`))}catch(t){s.push(`Failed to update package.json pnpm.onlyBuiltDependencies: ${t instanceof Error?t.message:String(t)}`)}break}case"yarn":{if(O(a)){const n=c(a,".yarnrc.yml");let e=f(n);const m=/^\s*enableScripts\s*:/m.test(e),g=/^\s*enableScripts\s*:\s*false\s*$/m.test(e);m?g?s.push(".yarnrc.yml already has enableScripts: false"):(e=e.replace(/^\s*enableScripts\s*:.+$/m,"enableScripts: false"),i(n,e),s.push("Changed enableScripts to false in .yarnrc.yml")):(e=`${e.trimEnd()}
|
|
18
|
+
enableScripts: false
|
|
19
|
+
`,i(n,e),s.push("Added enableScripts: false to .yarnrc.yml"))}else{const n=c(a,".npmrc");let e=y(n)?f(n):"";/^\s*ignore-scripts\s*=\s*true\s*$/m.test(e)?s.push(".npmrc already has ignore-scripts=true"):(e=`${e.trimEnd()}
|
|
20
|
+
ignore-scripts=true
|
|
21
|
+
`,i(n,e),s.push("Added ignore-scripts=true to .npmrc (yarn classic lacks enableScripts)"))}break}}return s};export{W as O};
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import{createRequire as j}from"node:module";import{E as W}from"../packem_chunks/config.js";import{osvBloomDecode as q,osvBloomProbeBatch as J,NATIVE_BINDING_VERSION as D}from"#native";const C=j(import.meta.url),h=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,p=e=>{if(typeof h<"u"&&h.versions&&h.versions.node){const[o,t]=h.versions.node.split(".").map(Number);if(o>22||o===22&&t>=3||o===20&&t>=16)return h.getBuiltinModule(e)}return C(e)},{createHash:U,randomUUID:V}=p("node:crypto"),{existsSync:g}=p("node:fs"),{readFile:O,mkdir:M,stat:B,writeFile:F,rename:H,unlink:G}=p("node:fs/promises"),{join:d,dirname:P}=p("node:path"),I=5;if(D!==I)throw new Error(`vis native binding ABI mismatch in osv-bloom: expected ${I}, got ${D}. Rebuild via \`pnpm --filter @visulima/vis run build:native\` or reinstall the platform binding package.`);const st="https://endevco.github.io/osv-bloom",z=new Set(["endevco.github.io"]);class w extends Error{cause="OSV_BLOOM_SOURCE_NOT_ALLOWED";constructor(o){super(`osv-bloom source host '${o}' is not in the built-in allowlist. Add it to \`security.audit.advisories.bloom.allowedHosts\` if intentional.`),this.name="OsvBloomSourceNotAllowedError"}}class _ extends Error{cause="OSV_BLOOM_NETWORK";constructor(o,t){super(`osv-bloom fetch failed for ${o}: ${t}. Check connectivity, proxy env vars, or --source.`),this.name="OsvBloomNetworkError"}}class K extends Error{cause="OSV_BLOOM_INTEGRITY";constructor(o,t){super(`osv-bloom filter.bin sha256 mismatch (expected ${o}, got ${t}). Refusing to install a corrupted filter.`),this.name="OsvBloomIntegrityError"}}class m extends Error{cause="OSV_BLOOM_MANIFEST";constructor(o){super(`osv-bloom manifest invalid: ${o}`),this.name="OsvBloomManifestError"}}class Y extends Error{cause="OSV_BLOOM_CACHE_MISS";constructor(o){super(`No osv-bloom cache at ${o}. Run 'vis advisories bloom sync' first.`),this.name="OsvBloomCacheMissError"}}const y=e=>{const o=W("vis",{create:!0,cwd:e})??d(e,"node_modules",".cache","vis");return d(o,"osv-bloom")},l=e=>d(e,"filter.bin"),x=e=>d(e,"manifest.json"),R=e=>d(e,"state.json"),Q=(e,o)=>{let t;try{t=new URL(e)}catch{throw new w(e)}if(!t.host)throw new w(e);if(t.protocol!=="https:")throw new w(`${t.protocol}//${t.host}`);if(!new Set([...z,...o??[]]).has(t.host))throw new w(t.host);return t},rt=async e=>{const o=Date.now(),t=e.cacheDir??y(e.workspaceRoot);await M(t,{recursive:!0});const s=Q(e.source,e.allowedHosts),i=new URL("manifest.json",N(s.toString())),r=new URL("filter.bin",N(s.toString())),n=await A(i,{method:"GET"});if(!n.ok)throw new _(i.toString(),n.status);const v=await n.text(),a=L(v),u=await T(t);if(!e.force&&u?.setDigestSha256===a.setDigestSha256&&g(l(t)))return{bytesOnDisk:(await B(l(t))).size,cacheDir:t,durationMs:Date.now()-o,manifest:a,upToDate:!0};const S={};!e.force&&u?.filterEtag&&(S.headers={"if-none-match":u.filterEtag});const f=await A(r,{...S,method:"GET"});if(f.status===304&&u&&g(l(t)))return await $(t,v,{fetchedAtIso:new Date().toISOString(),filterEtag:u.filterEtag,setDigestSha256:a.setDigestSha256}),{bytesOnDisk:(await B(l(t))).size,cacheDir:t,durationMs:Date.now()-o,manifest:a,upToDate:!0};if(!f.ok||!f.body)throw new _(r.toString(),f.status);const c=Buffer.from(await f.arrayBuffer());e.onProgress&&e.onProgress(c.length,c.length);const E=X(c);if(E!==a.filterSha256)throw new K(a.filterSha256,E);if(c.length!==a.bloomByteLen)throw new m(`filter.bin length ${c.length} does not match manifest.bloom_byte_len ${a.bloomByteLen}`);const k=f.headers.get("etag")??void 0;return await b(l(t),c),await $(t,v,{fetchedAtIso:new Date().toISOString(),filterEtag:k,setDigestSha256:a.setDigestSha256}),{bytesOnDisk:c.length,cacheDir:t,durationMs:Date.now()-o,manifest:a,upToDate:!1}},it=async(e,o)=>{const t=o?.cacheDir??y(e),s=l(t);if(!g(s)){if(o?.softFail)return null;throw new Y(t)}const i=await O(s);return q(i)},nt=(e,o)=>J(e,o),at=async(e,o)=>{const t=o??y(e);if(!g(l(t)))return{cacheDir:t,present:!1};let s,i;try{s=L(await O(x(t),"utf8"))}catch{}try{i=await T(t)}catch{}return{cacheDir:t,fetchedAtIso:i?.fetchedAtIso,manifest:s,present:!0}},L=e=>{let o;try{o=JSON.parse(e)}catch(r){throw new m(r instanceof Error?r.message:String(r))}const t=r=>{const n=o[r];if(typeof n!="number"||Number.isNaN(n))throw new m(`field '${r}' missing or non-numeric`);return n},s=r=>{const n=o[r];if(typeof n!="string"||n.length===0)throw new m(`field '${r}' missing or empty`);return n},i=t("format_version");if(i!==1)throw new m(`unsupported format_version ${i} (this build expects v1)`);return{advisoryCount:t("advisory_count"),bloomByteLen:t("bloom_byte_len"),bloomKHashes:t("bloom_k_hashes"),bloomMBits:t("bloom_m_bits"),builtAtRfc3339:s("built_at_rfc3339"),builtAtUnix:t("built_at_unix"),entryCount:t("entry_count"),filterSha256:s("filter_sha256"),formatVersion:i,setDigestSha256:s("set_digest_sha256"),sourceUrl:s("source_url"),targetFpr:t("target_fpr")}},T=async e=>{try{const o=await O(R(e),"utf8"),t=JSON.parse(o);return typeof t.setDigestSha256!="string"||typeof t.fetchedAtIso!="string"?void 0:{fetchedAtIso:t.fetchedAtIso,filterEtag:typeof t.filterEtag=="string"?t.filterEtag:void 0,setDigestSha256:t.setDigestSha256}}catch{return}},$=async(e,o,t)=>{await b(x(e),Buffer.from(o,"utf8")),await b(R(e),Buffer.from(`${JSON.stringify(t,void 0,2)}
|
|
2
|
+
`,"utf8"))},b=async(e,o)=>{await M(P(e),{recursive:!0});const t=`${e}.${process.pid}.${V()}.tmp`;try{await F(t,o),await H(t,e)}catch(s){throw await G(t).catch(()=>{}),s}},X=e=>U("sha256").update(e).digest("hex"),N=e=>e.endsWith("/")?e:`${e}/`,Z=3e4,A=async(e,o)=>{try{return await fetch(e,{...o,signal:AbortSignal.timeout(Z)})}catch(t){throw new _(e.toString(),t instanceof Error?t.message:String(t))}};export{st as D,Y as O,at as g,it as l,nt as p,rt as s};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{c as Te}from"./_commonjsHelpers-B5Y90VFO.js";import{definePlugin as Tt}from"./definePlugin-DoUcoYSy.js";var ne={},S={},I={},m={},T={},L={},Se;function dt(){return Se||(Se=1,Object.defineProperty(L,"__esModule",{value:!0}),L.VERSION=void 0,L.VERSION="1.9.1"),L}var M={},Me;function St(){if(Me)return M;Me=1,Object.defineProperty(M,"__esModule",{value:!0}),M.isCompatible=M._makeCompatibilityCheck=void 0;const e=dt(),t=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;function u(r){const n=new Set([r]),i=new Set,c=r.match(t);if(!c)return()=>!1;const a={major:+c[1],minor:+c[2],patch:+c[3],prerelease:c[4]};if(a.prerelease!=null)return function(s){return s===r};function o(s){return i.add(s),!1}function g(s){return n.add(s),!0}return function(s){if(n.has(s))return!0;if(i.has(s))return!1;const l=s.match(t);if(!l)return o(s);const d={major:+l[1],minor:+l[2],patch:+l[3],prerelease:l[4]};return d.prerelease!=null||a.major!==d.major?o(s):a.major===0?a.minor===d.minor&&a.patch<=d.patch?g(s):o(s):a.minor<=d.minor?g(s):o(s)}}return M._makeCompatibilityCheck=u,M.isCompatible=u(e.VERSION),M}var Re;function h(){if(Re)return T;Re=1,Object.defineProperty(T,"__esModule",{value:!0}),T.unregisterGlobal=T.getGlobal=T.registerGlobal=void 0;const e=dt(),t=St(),u=e.VERSION.split(".")[0],r=Symbol.for(`opentelemetry.js.api.${u}`),n=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof Te=="object"?Te:{};function i(o,g,s,l=!1){var d;const _=n[r]=(d=n[r])!==null&&d!==void 0?d:{version:e.VERSION};if(!l&&_[o]){const p=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${o}`);return s.error(p.stack||p.message),!1}if(_.version!==e.VERSION){const p=new Error(`@opentelemetry/api: Registration of version v${_.version} for ${o} does not match previously registered API v${e.VERSION}`);return s.error(p.stack||p.message),!1}return _[o]=g,s.debug(`@opentelemetry/api: Registered a global for ${o} v${e.VERSION}.`),!0}T.registerGlobal=i;function c(o){var g,s;const l=(g=n[r])===null||g===void 0?void 0:g.version;if(!(!l||!(0,t.isCompatible)(l)))return(s=n[r])===null||s===void 0?void 0:s[o]}T.getGlobal=c;function a(o,g){g.debug(`@opentelemetry/api: Unregistering a global for ${o} v${e.VERSION}.`);const s=n[r];s&&delete s[o]}return T.unregisterGlobal=a,T}var Ee;function Mt(){if(Ee)return m;Ee=1,Object.defineProperty(m,"__esModule",{value:!0}),m.DiagComponentLogger=void 0;const e=h();class t{constructor(n){this._namespace=n.namespace||"DiagComponentLogger"}debug(...n){return u("debug",this._namespace,n)}error(...n){return u("error",this._namespace,n)}info(...n){return u("info",this._namespace,n)}warn(...n){return u("warn",this._namespace,n)}verbose(...n){return u("verbose",this._namespace,n)}}m.DiagComponentLogger=t;function u(r,n,i){const c=(0,e.getGlobal)("diag");if(c)return c[r](n,...i)}return m}var D={},ae={},Ce;function _e(){return Ce||(Ce=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiagLogLevel=void 0,(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(e.DiagLogLevel||(e.DiagLogLevel={}))})(ae)),ae}var ye;function Rt(){if(ye)return D;ye=1,Object.defineProperty(D,"__esModule",{value:!0}),D.createLogLevelDiagLogger=void 0;const e=_e();function t(u,r){u<e.DiagLogLevel.NONE?u=e.DiagLogLevel.NONE:u>e.DiagLogLevel.ALL&&(u=e.DiagLogLevel.ALL),r=r||{};function n(i,c){const a=r[i];return typeof a=="function"&&u>=c?a.bind(r):function(){}}return{error:n("error",e.DiagLogLevel.ERROR),warn:n("warn",e.DiagLogLevel.WARN),info:n("info",e.DiagLogLevel.INFO),debug:n("debug",e.DiagLogLevel.DEBUG),verbose:n("verbose",e.DiagLogLevel.VERBOSE)}}return D.createLogLevelDiagLogger=t,D}var he;function A(){if(he)return I;he=1,Object.defineProperty(I,"__esModule",{value:!0}),I.DiagAPI=void 0;const e=Mt(),t=Rt(),u=_e(),r=h(),n="diag";class i{static instance(){return this._instance||(this._instance=new i),this._instance}constructor(){function a(s){return function(...l){const d=(0,r.getGlobal)("diag");if(d)return d[s](...l)}}const o=this,g=(s,l={logLevel:u.DiagLogLevel.INFO})=>{var d,_,p;if(s===o){const P=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return o.error((d=P.stack)!==null&&d!==void 0?d:P.message),!1}typeof l=="number"&&(l={logLevel:l});const b=(0,r.getGlobal)("diag"),N=(0,t.createLogLevelDiagLogger)((_=l.logLevel)!==null&&_!==void 0?_:u.DiagLogLevel.INFO,s);if(b&&!l.suppressOverrideMessage){const P=(p=new Error().stack)!==null&&p!==void 0?p:"<failed to generate stacktrace>";b.warn(`Current logger will be overwritten from ${P}`),N.warn(`Current logger will overwrite one already registered from ${P}`)}return(0,r.registerGlobal)("diag",N,o,!0)};o.setLogger=g,o.disable=()=>{(0,r.unregisterGlobal)(n,o)},o.createComponentLogger=s=>new e.DiagComponentLogger(s),o.verbose=a("verbose"),o.debug=a("debug"),o.info=a("info"),o.warn=a("warn"),o.error=a("error")}}return I.DiagAPI=i,I}var V={},Ae;function Et(){if(Ae)return V;Ae=1,Object.defineProperty(V,"__esModule",{value:!0}),V.BaggageImpl=void 0;class e{constructor(u){this._entries=u?new Map(u):new Map}getEntry(u){const r=this._entries.get(u);if(r)return Object.assign({},r)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(u,r){const n=new e(this._entries);return n._entries.set(u,r),n}removeEntry(u){const r=new e(this._entries);return r._entries.delete(u),r}removeEntries(...u){const r=new e(this._entries);for(const n of u)r._entries.delete(n);return r}clear(){return new e}}return V.BaggageImpl=e,V}var w={},Ie;function Ct(){return Ie||(Ie=1,Object.defineProperty(w,"__esModule",{value:!0}),w.baggageEntryMetadataSymbol=void 0,w.baggageEntryMetadataSymbol=Symbol("BaggageEntryMetadata")),w}var me;function _t(){if(me)return S;me=1,Object.defineProperty(S,"__esModule",{value:!0}),S.baggageEntryMetadataFromString=S.createBaggage=void 0;const e=A(),t=Et(),u=Ct(),r=e.DiagAPI.instance();function n(c={}){return new t.BaggageImpl(new Map(Object.entries(c)))}S.createBaggage=n;function i(c){return typeof c!="string"&&(r.error(`Cannot create baggage metadata from unknown type: ${typeof c}`),c=""),{__TYPE__:u.baggageEntryMetadataSymbol,toString(){return c}}}return S.baggageEntryMetadataFromString=i,S}var R={},Le;function te(){if(Le)return R;Le=1,Object.defineProperty(R,"__esModule",{value:!0}),R.ROOT_CONTEXT=R.createContextKey=void 0;function e(u){return Symbol.for(u)}R.createContextKey=e;class t{constructor(r){const n=this;n._currentContext=r?new Map(r):new Map,n.getValue=i=>n._currentContext.get(i),n.setValue=(i,c)=>{const a=new t(n._currentContext);return a._currentContext.set(i,c),a},n.deleteValue=i=>{const c=new t(n._currentContext);return c._currentContext.delete(i),c}}}return R.ROOT_CONTEXT=new t,R}var oe={},De;function yt(){return De||(De=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.DiagConsoleLogger=e._originalConsoleMethods=void 0;const t=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}];if(e._originalConsoleMethods={},typeof console<"u"){const r=["error","warn","info","debug","trace","log"];for(const n of r)typeof console[n]=="function"&&(e._originalConsoleMethods[n]=console[n])}class u{constructor(){function n(i){return function(...c){let a=e._originalConsoleMethods[i];if(typeof a!="function"&&(a=e._originalConsoleMethods.log),typeof a!="function"&&console&&(a=console[i],typeof a!="function"&&(a=console.log)),typeof a=="function")return a.apply(console,c)}}for(let i=0;i<t.length;i++)this[t[i].n]=n(t[i].c)}}e.DiagConsoleLogger=u})(oe)),oe}var ie={},Ve;function pt(){return Ve||(Ve=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.createNoopMeter=e.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=e.NOOP_OBSERVABLE_GAUGE_METRIC=e.NOOP_OBSERVABLE_COUNTER_METRIC=e.NOOP_UP_DOWN_COUNTER_METRIC=e.NOOP_HISTOGRAM_METRIC=e.NOOP_GAUGE_METRIC=e.NOOP_COUNTER_METRIC=e.NOOP_METER=e.NoopObservableUpDownCounterMetric=e.NoopObservableGaugeMetric=e.NoopObservableCounterMetric=e.NoopObservableMetric=e.NoopHistogramMetric=e.NoopGaugeMetric=e.NoopUpDownCounterMetric=e.NoopCounterMetric=e.NoopMetric=e.NoopMeter=void 0;class t{constructor(){}createGauge(_,p){return e.NOOP_GAUGE_METRIC}createHistogram(_,p){return e.NOOP_HISTOGRAM_METRIC}createCounter(_,p){return e.NOOP_COUNTER_METRIC}createUpDownCounter(_,p){return e.NOOP_UP_DOWN_COUNTER_METRIC}createObservableGauge(_,p){return e.NOOP_OBSERVABLE_GAUGE_METRIC}createObservableCounter(_,p){return e.NOOP_OBSERVABLE_COUNTER_METRIC}createObservableUpDownCounter(_,p){return e.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC}addBatchObservableCallback(_,p){}removeBatchObservableCallback(_){}}e.NoopMeter=t;class u{}e.NoopMetric=u;class r extends u{add(_,p){}}e.NoopCounterMetric=r;class n extends u{add(_,p){}}e.NoopUpDownCounterMetric=n;class i extends u{record(_,p){}}e.NoopGaugeMetric=i;class c extends u{record(_,p){}}e.NoopHistogramMetric=c;class a{addCallback(_){}removeCallback(_){}}e.NoopObservableMetric=a;class o extends a{}e.NoopObservableCounterMetric=o;class g extends a{}e.NoopObservableGaugeMetric=g;class s extends a{}e.NoopObservableUpDownCounterMetric=s,e.NOOP_METER=new t,e.NOOP_COUNTER_METRIC=new r,e.NOOP_GAUGE_METRIC=new i,e.NOOP_HISTOGRAM_METRIC=new c,e.NOOP_UP_DOWN_COUNTER_METRIC=new n,e.NOOP_OBSERVABLE_COUNTER_METRIC=new o,e.NOOP_OBSERVABLE_GAUGE_METRIC=new g,e.NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC=new s;function l(){return e.NOOP_METER}e.createNoopMeter=l})(ie)),ie}var ue={},we;function ht(){return we||(we=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.ValueType=void 0,(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(e.ValueType||(e.ValueType={}))})(ue)),ue}var E={},je;function vt(){return je||(je=1,Object.defineProperty(E,"__esModule",{value:!0}),E.defaultTextMapSetter=E.defaultTextMapGetter=void 0,E.defaultTextMapGetter={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},E.defaultTextMapSetter={set(e,t,u){e!=null&&(e[t]=u)}}),E}var j={},q={},G={},U={},qe;function At(){if(qe)return U;qe=1,Object.defineProperty(U,"__esModule",{value:!0}),U.NoopContextManager=void 0;const e=te();let t=class{active(){return e.ROOT_CONTEXT}with(r,n,i,...c){return n.call(i,...c)}bind(r,n){return n}enable(){return this}disable(){return this}};return U.NoopContextManager=t,U}var Ge;function re(){if(Ge)return G;Ge=1,Object.defineProperty(G,"__esModule",{value:!0}),G.ContextAPI=void 0;const e=At(),t=h(),u=A(),r="context",n=new e.NoopContextManager;class i{constructor(){}static getInstance(){return this._instance||(this._instance=new i),this._instance}setGlobalContextManager(a){return(0,t.registerGlobal)(r,a,u.DiagAPI.instance())}active(){return this._getContextManager().active()}with(a,o,g,...s){return this._getContextManager().with(a,o,g,...s)}bind(a,o){return this._getContextManager().bind(a,o)}_getContextManager(){return(0,t.getGlobal)(r)||n}disable(){this._getContextManager().disable(),(0,t.unregisterGlobal)(r,u.DiagAPI.instance())}}return G.ContextAPI=i,G}var v={},B={},ce={},se={},Ue;function ft(){return Ue||(Ue=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.TraceFlags=void 0,(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(e.TraceFlags||(e.TraceFlags={}))})(se)),se}var Be;function pe(){return Be||(Be=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.INVALID_SPAN_CONTEXT=e.INVALID_TRACEID=e.INVALID_SPANID=void 0;const t=ft();e.INVALID_SPANID="0000000000000000",e.INVALID_TRACEID="00000000000000000000000000000000",e.INVALID_SPAN_CONTEXT={traceId:e.INVALID_TRACEID,spanId:e.INVALID_SPANID,traceFlags:t.TraceFlags.NONE}})(ce)),ce}var xe;function ve(){if(xe)return B;xe=1,Object.defineProperty(B,"__esModule",{value:!0}),B.NonRecordingSpan=void 0;const e=pe();let t=class{constructor(r=e.INVALID_SPAN_CONTEXT){this._spanContext=r}spanContext(){return this._spanContext}setAttribute(r,n){return this}setAttributes(r){return this}addEvent(r,n){return this}addLink(r){return this}addLinks(r){return this}setStatus(r){return this}updateName(r){return this}end(r){}isRecording(){return!1}recordException(r,n){}};return B.NonRecordingSpan=t,B}var ke;function Ot(){if(ke)return v;ke=1,Object.defineProperty(v,"__esModule",{value:!0}),v.getSpanContext=v.setSpanContext=v.deleteSpan=v.setSpan=v.getActiveSpan=v.getSpan=void 0;const e=te(),t=ve(),u=re(),r=(0,e.createContextKey)("OpenTelemetry Context Key SPAN");function n(s){return s.getValue(r)||void 0}v.getSpan=n;function i(){return n(u.ContextAPI.getInstance().active())}v.getActiveSpan=i;function c(s,l){return s.setValue(r,l)}v.setSpan=c;function a(s){return s.deleteValue(r)}v.deleteSpan=a;function o(s,l){return c(s,new t.NonRecordingSpan(l))}v.setSpanContext=o;function g(s){var l;return(l=n(s))===null||l===void 0?void 0:l.spanContext()}return v.getSpanContext=g,v}var f={},$e;function fe(){if($e)return f;$e=1,Object.defineProperty(f,"__esModule",{value:!0}),f.wrapSpanContext=f.isSpanContextValid=f.isValidSpanId=f.isValidTraceId=void 0;const e=pe(),t=ve(),u=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1]);function r(o,g){if(typeof o!="string"||o.length!==g)return!1;let s=0;for(let l=0;l<o.length;l+=4)s+=(u[o.charCodeAt(l)]|0)+(u[o.charCodeAt(l+1)]|0)+(u[o.charCodeAt(l+2)]|0)+(u[o.charCodeAt(l+3)]|0);return s===g}function n(o){return r(o,32)&&o!==e.INVALID_TRACEID}f.isValidTraceId=n;function i(o){return r(o,16)&&o!==e.INVALID_SPANID}f.isValidSpanId=i;function c(o){return n(o.traceId)&&i(o.spanId)}f.isSpanContextValid=c;function a(o){return new t.NonRecordingSpan(o)}return f.wrapSpanContext=a,f}var Ke;function Pt(){if(Ke)return q;Ke=1,Object.defineProperty(q,"__esModule",{value:!0}),q.NoopTracer=void 0;const e=re(),t=Ot(),u=ve(),r=fe(),n=e.ContextAPI.getInstance();let i=class{startSpan(o,g,s=n.active()){if(g?.root)return new u.NonRecordingSpan;const l=s&&(0,t.getSpanContext)(s);return c(l)&&(0,r.isSpanContextValid)(l)?new u.NonRecordingSpan(l):new u.NonRecordingSpan}startActiveSpan(o,g,s,l){let d,_,p;if(arguments.length<2)return;arguments.length===2?p=g:arguments.length===3?(d=g,p=s):(d=g,_=s,p=l);const b=_??n.active(),N=this.startSpan(o,d,b),P=(0,t.setSpan)(b,N);return n.with(P,p,void 0,N)}};q.NoopTracer=i;function c(a){return a!==null&&typeof a=="object"&&"spanId"in a&&typeof a.spanId=="string"&&"traceId"in a&&typeof a.traceId=="string"&&"traceFlags"in a&&typeof a.traceFlags=="number"}return q}var Fe;function bt(){if(Fe)return j;Fe=1,Object.defineProperty(j,"__esModule",{value:!0}),j.ProxyTracer=void 0;const e=Pt(),t=new e.NoopTracer;let u=class{constructor(n,i,c,a){this._provider=n,this.name=i,this.version=c,this.options=a}startSpan(n,i,c){return this._getTracer().startSpan(n,i,c)}startActiveSpan(n,i,c,a){const o=this._getTracer();return Reflect.apply(o.startActiveSpan,o,arguments)}_getTracer(){if(this._delegate)return this._delegate;const n=this._provider.getDelegateTracer(this.name,this.version,this.options);return n?(this._delegate=n,this._delegate):t}};return j.ProxyTracer=u,j}var x={},k={},Xe;function It(){if(Xe)return k;Xe=1,Object.defineProperty(k,"__esModule",{value:!0}),k.NoopTracerProvider=void 0;const e=Pt();let t=class{getTracer(r,n,i){return new e.NoopTracer}};return k.NoopTracerProvider=t,k}var He;function Nt(){if(He)return x;He=1,Object.defineProperty(x,"__esModule",{value:!0}),x.ProxyTracerProvider=void 0;const e=bt(),t=It(),u=new t.NoopTracerProvider;let r=class{getTracer(i,c,a){var o;return(o=this.getDelegateTracer(i,c,a))!==null&&o!==void 0?o:new e.ProxyTracer(this,i,c,a)}getDelegate(){var i;return(i=this._delegate)!==null&&i!==void 0?i:u}setDelegate(i){this._delegate=i}getDelegateTracer(i,c,a){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(i,c,a)}};return x.ProxyTracerProvider=r,x}var le={},Ye;function mt(){return Ye||(Ye=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SamplingDecision=void 0,(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(e.SamplingDecision||(e.SamplingDecision={}))})(le)),le}var ge={},We;function Lt(){return We||(We=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SpanKind=void 0,(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(e.SpanKind||(e.SpanKind={}))})(ge)),ge}var de={},ze;function Dt(){return ze||(ze=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.SpanStatusCode=void 0,(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(e.SpanStatusCode||(e.SpanStatusCode={}))})(de)),de}var $={},K={},C={},Qe;function Vt(){if(Qe)return C;Qe=1,Object.defineProperty(C,"__esModule",{value:!0}),C.validateValue=C.validateKey=void 0;const e="[_0-9a-z-*/]",t=`[a-z]${e}{0,255}`,u=`[a-z0-9]${e}{0,240}@[a-z]${e}{0,13}`,r=new RegExp(`^(?:${t}|${u})$`),n=/^[ -~]{0,255}[!-~]$/,i=/,|=/;function c(o){return r.test(o)}C.validateKey=c;function a(o){return n.test(o)&&!i.test(o)}return C.validateValue=a,C}var Je;function wt(){if(Je)return K;Je=1,Object.defineProperty(K,"__esModule",{value:!0}),K.TraceStateImpl=void 0;const e=Vt(),t=32,u=512,r=",",n="=";class i{constructor(a){this._internalState=new Map,a&&this._parse(a)}set(a,o){const g=this._clone();return g._internalState.has(a)&&g._internalState.delete(a),g._internalState.set(a,o),g}unset(a){const o=this._clone();return o._internalState.delete(a),o}get(a){return this._internalState.get(a)}serialize(){return Array.from(this._internalState.keys()).reduceRight((a,o)=>(a.push(o+n+this.get(o)),a),[]).join(r)}_parse(a){a.length>u||(this._internalState=a.split(r).reduceRight((o,g)=>{const s=g.trim(),l=s.indexOf(n);if(l!==-1){const d=s.slice(0,l),_=s.slice(l+1,g.length);(0,e.validateKey)(d)&&(0,e.validateValue)(_)&&o.set(d,_)}return o},new Map),this._internalState.size>t&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,t))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){const a=new i;return a._internalState=new Map(this._internalState),a}}return K.TraceStateImpl=i,K}var Ze;function jt(){if(Ze)return $;Ze=1,Object.defineProperty($,"__esModule",{value:!0}),$.createTraceState=void 0;const e=wt();function t(u){return new e.TraceStateImpl(u)}return $.createTraceState=t,$}var F={},et;function qt(){if(et)return F;et=1,Object.defineProperty(F,"__esModule",{value:!0}),F.context=void 0;const e=re();return F.context=e.ContextAPI.getInstance(),F}var X={},tt;function Gt(){if(tt)return X;tt=1,Object.defineProperty(X,"__esModule",{value:!0}),X.diag=void 0;const e=A();return X.diag=e.DiagAPI.instance(),X}var H={},Y={},y={},rt;function Ut(){if(rt)return y;rt=1,Object.defineProperty(y,"__esModule",{value:!0}),y.NOOP_METER_PROVIDER=y.NoopMeterProvider=void 0;const e=pt();let t=class{getMeter(r,n,i){return e.NOOP_METER}};return y.NoopMeterProvider=t,y.NOOP_METER_PROVIDER=new t,y}var nt;function Bt(){if(nt)return Y;nt=1,Object.defineProperty(Y,"__esModule",{value:!0}),Y.MetricsAPI=void 0;const e=Ut(),t=h(),u=A(),r="metrics";class n{constructor(){}static getInstance(){return this._instance||(this._instance=new n),this._instance}setGlobalMeterProvider(c){return(0,t.registerGlobal)(r,c,u.DiagAPI.instance())}getMeterProvider(){return(0,t.getGlobal)(r)||e.NOOP_METER_PROVIDER}getMeter(c,a,o){return this.getMeterProvider().getMeter(c,a,o)}disable(){(0,t.unregisterGlobal)(r,u.DiagAPI.instance())}}return Y.MetricsAPI=n,Y}var at;function xt(){if(at)return H;at=1,Object.defineProperty(H,"__esModule",{value:!0}),H.metrics=void 0;const e=Bt();return H.metrics=e.MetricsAPI.getInstance(),H}var W={},z={},Q={},ot;function kt(){if(ot)return Q;ot=1,Object.defineProperty(Q,"__esModule",{value:!0}),Q.NoopTextMapPropagator=void 0;let e=class{inject(u,r){}extract(u,r){return u}fields(){return[]}};return Q.NoopTextMapPropagator=e,Q}var O={},it;function $t(){if(it)return O;it=1,Object.defineProperty(O,"__esModule",{value:!0}),O.deleteBaggage=O.setBaggage=O.getActiveBaggage=O.getBaggage=void 0;const e=re(),t=te(),u=(0,t.createContextKey)("OpenTelemetry Baggage Key");function r(a){return a.getValue(u)||void 0}O.getBaggage=r;function n(){return r(e.ContextAPI.getInstance().active())}O.getActiveBaggage=n;function i(a,o){return a.setValue(u,o)}O.setBaggage=i;function c(a){return a.deleteValue(u)}return O.deleteBaggage=c,O}var ut;function Kt(){if(ut)return z;ut=1,Object.defineProperty(z,"__esModule",{value:!0}),z.PropagationAPI=void 0;const e=h(),t=kt(),u=vt(),r=$t(),n=_t(),i=A(),c="propagation",a=new t.NoopTextMapPropagator;class o{constructor(){this.createBaggage=n.createBaggage,this.getBaggage=r.getBaggage,this.getActiveBaggage=r.getActiveBaggage,this.setBaggage=r.setBaggage,this.deleteBaggage=r.deleteBaggage}static getInstance(){return this._instance||(this._instance=new o),this._instance}setGlobalPropagator(s){return(0,e.registerGlobal)(c,s,i.DiagAPI.instance())}inject(s,l,d=u.defaultTextMapSetter){return this._getGlobalPropagator().inject(s,l,d)}extract(s,l,d=u.defaultTextMapGetter){return this._getGlobalPropagator().extract(s,l,d)}fields(){return this._getGlobalPropagator().fields()}disable(){(0,e.unregisterGlobal)(c,i.DiagAPI.instance())}_getGlobalPropagator(){return(0,e.getGlobal)(c)||a}}return z.PropagationAPI=o,z}var ct;function Ft(){if(ct)return W;ct=1,Object.defineProperty(W,"__esModule",{value:!0}),W.propagation=void 0;const e=Kt();return W.propagation=e.PropagationAPI.getInstance(),W}var J={},Z={},st;function Xt(){if(st)return Z;st=1,Object.defineProperty(Z,"__esModule",{value:!0}),Z.TraceAPI=void 0;const e=h(),t=Nt(),u=fe(),r=Ot(),n=A(),i="trace";class c{constructor(){this._proxyTracerProvider=new t.ProxyTracerProvider,this.wrapSpanContext=u.wrapSpanContext,this.isSpanContextValid=u.isSpanContextValid,this.deleteSpan=r.deleteSpan,this.getSpan=r.getSpan,this.getActiveSpan=r.getActiveSpan,this.getSpanContext=r.getSpanContext,this.setSpan=r.setSpan,this.setSpanContext=r.setSpanContext}static getInstance(){return this._instance||(this._instance=new c),this._instance}setGlobalTracerProvider(o){const g=(0,e.registerGlobal)(i,this._proxyTracerProvider,n.DiagAPI.instance());return g&&this._proxyTracerProvider.setDelegate(o),g}getTracerProvider(){return(0,e.getGlobal)(i)||this._proxyTracerProvider}getTracer(o,g){return this.getTracerProvider().getTracer(o,g)}disable(){(0,e.unregisterGlobal)(i,n.DiagAPI.instance()),this._proxyTracerProvider=new t.ProxyTracerProvider}}return Z.TraceAPI=c,Z}var lt;function Ht(){if(lt)return J;lt=1,Object.defineProperty(J,"__esModule",{value:!0}),J.trace=void 0;const e=Xt();return J.trace=e.TraceAPI.getInstance(),J}var gt;function Yt(){return gt||(gt=1,(function(e){Object.defineProperty(e,"__esModule",{value:!0}),e.trace=e.propagation=e.metrics=e.diag=e.context=e.INVALID_SPAN_CONTEXT=e.INVALID_TRACEID=e.INVALID_SPANID=e.isValidSpanId=e.isValidTraceId=e.isSpanContextValid=e.createTraceState=e.TraceFlags=e.SpanStatusCode=e.SpanKind=e.SamplingDecision=e.ProxyTracerProvider=e.ProxyTracer=e.defaultTextMapSetter=e.defaultTextMapGetter=e.ValueType=e.createNoopMeter=e.DiagLogLevel=e.DiagConsoleLogger=e.ROOT_CONTEXT=e.createContextKey=e.baggageEntryMetadataFromString=void 0;var t=_t();Object.defineProperty(e,"baggageEntryMetadataFromString",{enumerable:!0,get:function(){return t.baggageEntryMetadataFromString}});var u=te();Object.defineProperty(e,"createContextKey",{enumerable:!0,get:function(){return u.createContextKey}}),Object.defineProperty(e,"ROOT_CONTEXT",{enumerable:!0,get:function(){return u.ROOT_CONTEXT}});var r=yt();Object.defineProperty(e,"DiagConsoleLogger",{enumerable:!0,get:function(){return r.DiagConsoleLogger}});var n=_e();Object.defineProperty(e,"DiagLogLevel",{enumerable:!0,get:function(){return n.DiagLogLevel}});var i=pt();Object.defineProperty(e,"createNoopMeter",{enumerable:!0,get:function(){return i.createNoopMeter}});var c=ht();Object.defineProperty(e,"ValueType",{enumerable:!0,get:function(){return c.ValueType}});var a=vt();Object.defineProperty(e,"defaultTextMapGetter",{enumerable:!0,get:function(){return a.defaultTextMapGetter}}),Object.defineProperty(e,"defaultTextMapSetter",{enumerable:!0,get:function(){return a.defaultTextMapSetter}});var o=bt();Object.defineProperty(e,"ProxyTracer",{enumerable:!0,get:function(){return o.ProxyTracer}});var g=Nt();Object.defineProperty(e,"ProxyTracerProvider",{enumerable:!0,get:function(){return g.ProxyTracerProvider}});var s=mt();Object.defineProperty(e,"SamplingDecision",{enumerable:!0,get:function(){return s.SamplingDecision}});var l=Lt();Object.defineProperty(e,"SpanKind",{enumerable:!0,get:function(){return l.SpanKind}});var d=Dt();Object.defineProperty(e,"SpanStatusCode",{enumerable:!0,get:function(){return d.SpanStatusCode}});var _=ft();Object.defineProperty(e,"TraceFlags",{enumerable:!0,get:function(){return _.TraceFlags}});var p=jt();Object.defineProperty(e,"createTraceState",{enumerable:!0,get:function(){return p.createTraceState}});var b=fe();Object.defineProperty(e,"isSpanContextValid",{enumerable:!0,get:function(){return b.isSpanContextValid}}),Object.defineProperty(e,"isValidTraceId",{enumerable:!0,get:function(){return b.isValidTraceId}}),Object.defineProperty(e,"isValidSpanId",{enumerable:!0,get:function(){return b.isValidSpanId}});var N=pe();Object.defineProperty(e,"INVALID_SPANID",{enumerable:!0,get:function(){return N.INVALID_SPANID}}),Object.defineProperty(e,"INVALID_TRACEID",{enumerable:!0,get:function(){return N.INVALID_TRACEID}}),Object.defineProperty(e,"INVALID_SPAN_CONTEXT",{enumerable:!0,get:function(){return N.INVALID_SPAN_CONTEXT}});const P=qt();Object.defineProperty(e,"context",{enumerable:!0,get:function(){return P.context}});const Oe=Gt();Object.defineProperty(e,"diag",{enumerable:!0,get:function(){return Oe.diag}});const Pe=xt();Object.defineProperty(e,"metrics",{enumerable:!0,get:function(){return Pe.metrics}});const be=Ft();Object.defineProperty(e,"propagation",{enumerable:!0,get:function(){return be.propagation}});const Ne=Ht();Object.defineProperty(e,"trace",{enumerable:!0,get:function(){return Ne.trace}}),e.default={context:P.context,diag:Oe.diag,metrics:Pe.metrics,propagation:be.propagation,trace:Ne.trace}})(ne)),ne}var ee=Yt();const or=e=>{const{renameSpan:t,tracer:u}=e;let r;const n=new Map;return Tt({hooks:{"run:after":i=>{if(!r)return;const c=[...i.values()].filter(a=>a.status==="failure").length;r.setAttribute("vis.run.tasks_total",i.size),r.setAttribute("vis.run.tasks_failed",c),c>0?r.setStatus({code:ee.SpanStatusCode.ERROR,message:`${String(c)} task(s) failed`}):r.setStatus({code:ee.SpanStatusCode.OK}),r.end(),r=void 0;for(const a of n.values())a.end();n.clear()},"run:before":i=>{r&&(r.setStatus({code:ee.SpanStatusCode.ERROR,message:"run:before fired while previous run was still active"}),r.end());for(const c of n.values())c.end();n.clear(),r=u.startSpan("vis.run",{attributes:{"vis.run.task_count":i.tasks.length,"vis.workspace_root":i.workspaceRoot}})},"task:after":(i,c)=>{const a=n.get(i.id);a&&(a.setAttribute("vis.task.exit_code",c.code??0),a.setAttribute("vis.task.cache_status",c.status),a.end(),n.delete(i.id))},"task:before":i=>{const c=n.get(i.id);c&&(c.setStatus({code:ee.SpanStatusCode.ERROR,message:"retried — superseded by new attempt"}),c.end());const a=u.startSpan(t?t(i):i.id,{attributes:{"vis.task.id":i.id,"vis.task.project":i.target.project,"vis.task.target":i.target.target}});n.set(i.id,a)},"task:failure":(i,c)=>{const a=n.get(i.id);a&&a.setStatus({code:ee.SpanStatusCode.ERROR,message:`Task failed with exit code ${String(c.code??-1)}`})}},name:"otel"})};export{or as otelPlugin};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
const s=[/Issues with peer dependencies found/i,/\bunmet peer\b/i,/\bERESOLVE\b/,/unmet peer dependency/i,/\bYN0060\b/,/incorrect peer dependency/i],d="Peer dependency issues detected. Run `vis update --peer` to inspect and bump mismatched peer dependencies.",p=e=>e?s.some(n=>n.test(e)):!1;export{d as P,p as h};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as L}from"node:module";import{f as R,m as $,H as S,j as x,v as N}from"./index-BDmTbWX1.js";import{s as y}from"./index-CgcF6_wo.js";import{detectPackageManager as J,resolveAdd as z,resolveRemove as H,resolveDlx as F,whichBin as V,resolveInstall as Y,execPmCommandInteractive as G,resolveDedupe as K,resolveWhy as Q,resolveLink as X,resolveUnlink as Z,resolveExec as ee,resolvePmCommand as ne}from"#native";const T=L(import.meta.url),b=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,U=e=>{if(typeof b<"u"&&b.versions&&b.versions.node){const[n,s]=b.versions.node.split(".").map(Number);if(n>22||n===22&&s>=3||n===20&&s>=16)return b.getBuiltinModule(e)}return T(e)},{spawn:q,spawnSync:B}=U("node:child_process"),h=(e,n,s,r)=>{for(const a of n)e.push("--filter",a);s&&e.push("--recursive"),r&&e.push("--workspace-root")},se=e=>{const n=[],s=[];return h(n,e.filter,e.recursive,e.workspaceRoot),e.silent&&n.push("--silent"),e.frozenLockfile&&n.push("--frozen-lockfile"),n.push("install"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.force&&n.push("--force"),e.ignoreScripts&&n.push("--ignore-scripts"),e.lockfileOnly&&n.push("--lockfile-only"),e.noOptional&&n.push("--no-optional"),e.offline&&n.push("--offline"),{args:n,bin:"aube",warnings:s}},re=e=>{const n=[],s=[];return h(n,e.filter,!1,!1),n.push("add"),e.saveDev&&n.push("--save-dev"),e.exact&&n.push("--save-exact"),e.global&&n.push("--global"),e.optional&&n.push("--save-optional"),e.peer&&n.push("--save-peer"),e.workspace&&s.push("aube has no flag for the `workspace:` protocol; it auto-detects local workspace members during add. Ignoring --workspace."),e.workspaceRoot&&n.push("--workspace"),n.push(...e.packages),{args:n,bin:"aube",warnings:s}},ae=e=>{const n=[];return h(n,e.filter,e.recursive,!1),n.push("remove"),e.saveDev&&n.push("--save-dev"),e.global&&n.push("--global"),e.workspaceRoot&&n.push("--workspace"),n.push(...e.packages),{args:n,bin:"aube",warnings:[]}},oe=e=>{const n=["dedupe"];return e&&n.push("--check"),{args:n,bin:"aube",warnings:[]}},ie=e=>{const n=[],s=[];h(n,e.filter,e.recursive,!1),n.push("why"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.json&&n.push("--json"),e.long&&n.push("--long"),e.parseable&&n.push("--parseable"),e.depth!==void 0&&s.push("aube why does not accept --depth; ignoring."),e.noOptional&&s.push("aube why does not accept --no-optional; ignoring."),e.global&&s.push("aube why does not accept --global; ignoring.");const[r,...a]=e.packages;return r===void 0?s.push("aube why requires a package name; none provided."):(a.length>0&&s.push("aube why takes a single package; using the first."),n.push(r)),{args:n,bin:"aube",warnings:s}},te=e=>{const n=[];e.silent&&n.push("--silent"),n.push("dlx");for(const s of e.additionalPackages)n.push("--package",s);return e.shellMode&&n.push("--shell-mode"),n.push(e.package),n.push(...e.args),{args:n,bin:"aube",warnings:[]}},pe=e=>{const n=[];return h(n,e.filter,e.recursive,e.workspaceRoot),n.push("exec"),e.parallel&&n.push("--parallel"),e.reverse&&n.push("--reverse"),e.shellMode&&n.push("--shell-mode"),n.push(e.command),n.push(...e.args),{args:n,bin:"aube",warnings:[]}},ue=e=>{const n=["link"];return e!==null&&n.push(e),{args:n,bin:"aube",warnings:[]}},ce=(e,n)=>{const s=[],r=[];return n&&s.push("--recursive"),s.push("unlink"),e.length>1&&r.push("aube unlink takes a single package; using the first."),e.length>0&&s.push(e[0]),{args:s,bin:"aube",warnings:r}},le=e=>{const n=["view","--",e.package],s=[],[r,...a]=e.fields;return r!==void 0?(a.length>0&&s.push("aube view only supports a single field; using the first."),e.json&&s.push("aube view does not support --json with a field selector; printing the field without --json."),n.push(r)):e.json&&n.push("--json"),{args:n,bin:"aube",warnings:s}},Le=e=>{const n=[],s=[];return h(n,e.filters,e.recursive,e.workspaceRoot),n.push("update"),e.dev&&n.push("--dev"),e.prod&&n.push("--prod"),e.global&&n.push("--global"),e.interactive&&n.push("--interactive"),e.latest&&n.push("--latest"),e.noOptional&&n.push("--no-optional"),e.noSave&&n.push("--no-save"),n.push(...e.packages),{args:n,bin:"aube",warnings:s}},ge=new Set(["fund","ping","search","token"]),de=(e,n)=>ge.has(e)?{args:[e,...n],bin:"npm",warnings:[`'${e}' is not natively supported by aube. Delegating to npm.`]}:{args:[e,...n],bin:"aube",warnings:[]},k=256*1024,he=e=>{const n=e?{...process.env,...e}:{...process.env};return process.stderr.isTTY&&n.FORCE_COLOR===void 0&&n.NO_COLOR===void 0&&(n.FORCE_COLOR="1"),n},_=e=>e!==""&&!/[\s"&()<>^|%!]/u.test(e)?e:`"${e.replaceAll(/(\\*)"/gu,String.raw`$1$1\"`).replace(/(\\+)$/u,"$1$1").replaceAll(/[&()<>^|%!]/gu,String.raw`^$&`)}"`,fe=async(e,n,s)=>new Promise((r,a)=>{const o=process.platform==="win32",i=q(o?_(e):e,o?n.map(t=>_(t)):[...n],{cwd:s.cwd,env:he(s.env),shell:o,stdio:["inherit","pipe","pipe"],windowsHide:!0});let u=[],l=0;const g=t=>{if(u.push(t),l+=t.length,!(l<=k)){for(;u.length>1&&l-u[0].length>k;)l-=u.shift().length;if(u.length===1&&l>k){const d=u[0];u[0]=d.subarray(d.length-k),l=k}}},m=()=>Buffer.concat(u).toString("utf8");i.stdout?.on("data",t=>{process.stdout.write(t),g(t)}),i.stderr?.on("data",t=>{process.stderr.write(t),g(t)}),i.on("error",a),i.on("close",t=>{const d=m();u=[],r({code:t??1,output:d})})}),w=e=>{const n=y.coerce(e);return n?y.gte(n,"11.0.0"):!1},c=e=>e.name==="yarn"&&!e.version.startsWith("1."),j=e=>e.name==="yarn"&&e.version.startsWith("1."),me=e=>e[0]==="rm"?["remove",...e.slice(1)]:e,be=(e,n,s)=>{switch(n){case"audit":return c(e)?{args:["npm","audit",...s],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"config":{if(c(e)){const[r,...a]=s;return r==="delete"?{args:["config","unset",...a],bin:"yarn",kind:"rewrite",warning:"yarn berry uses `config unset`, not `config delete`."}:{kind:"passthrough"}}return e.name==="bun"?{kind:"skip",warning:"bun has no `config` CLI. Edit bunfig.toml or .npmrc directly."}:e.name==="deno"?{kind:"skip",warning:"deno has no registry-config CLI. Edit deno.json directly."}:{kind:"passthrough"}}case"dist-tag":return j(e)?{args:["tag",...s],bin:"yarn",kind:"rewrite",warning:"yarn 1 has no `dist-tag`; using `yarn tag`."}:c(e)?{args:["npm","tag",...me(s)],bin:"yarn",kind:"rewrite"}:e.name==="bun"||e.name==="deno"?{kind:"skip",warning:`${e.name} has no \`dist-tag\`. Use \`npm dist-tag\` instead.`}:{kind:"passthrough"};case"login":case"logout":return c(e)?{args:["npm",n,...s],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:[n,...s],bin:"npm",kind:"rewrite",warning:`bun has no \`${n}\`; falling back to \`npm ${n}\` (writes ~/.npmrc, which bun reads).`}:e.name==="deno"?{kind:"skip",warning:`deno has no \`${n}\`. JSR uses browser OAuth via \`deno publish\`.`}:{kind:"passthrough"};case"owner":return e.name==="pnpm"&&w(e.version)?{args:["owner",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `owner`; falling back to `npm owner`."}:c(e)?{args:["owner",...s],bin:"npm",kind:"rewrite",warning:"yarn berry has no `owner` (not in `yarn npm`); falling back to `npm owner`."}:e.name==="bun"?{args:["owner",...s],bin:"npm",kind:"rewrite",warning:"bun has no `owner`; falling back to `npm owner`."}:e.name==="deno"?{kind:"skip",warning:"deno has no `owner`. JSR uses scope-member roles via the web UI."}:{kind:"passthrough"};case"ping":return e.name==="pnpm"&&w(e.version)?{args:["ping",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `ping`; falling back to `npm ping`."}:{kind:"passthrough"};case"plugin":return c(e)?{kind:"passthrough"}:{kind:"skip",warning:`${e.name} does not support yarn-style plugins. Skipping (no-op).`};case"prune":return j(e)?{kind:"skip",warning:"yarn 1 has no `prune`. Use `yarn install --production` for a prod-only tree."}:c(e)?{kind:"skip",warning:"yarn berry has no `prune`. Use `yarn workspaces focus --production` instead."}:e.name==="bun"||e.name==="deno"?{kind:"skip",warning:`${e.name} has no \`prune\`. Pruning happens automatically on install.`}:{kind:"passthrough"};case"publish":return c(e)?{args:["npm","publish",...s],bin:"yarn",kind:"rewrite"}:{kind:"passthrough"};case"rebuild":return j(e)?{kind:"skip",warning:"yarn 1 has no `rebuild`. Re-install instead."}:e.name==="bun"?{kind:"skip",warning:"bun has no `rebuild`. Use `bun install --force` instead."}:e.name==="deno"?{kind:"skip",warning:"deno has no `rebuild`."}:{kind:"passthrough"};case"search":return e.name==="pnpm"&&w(e.version)?{args:["search",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `search`; falling back to `npm search`."}:{kind:"passthrough"};case"token":return e.name==="pnpm"&&w(e.version)?{args:["token",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `token`; falling back to `npm token`."}:{kind:"passthrough"};case"whoami":return e.name==="pnpm"&&w(e.version)?{args:["whoami",...s],bin:"npm",kind:"rewrite",warning:"pnpm 11 removed `whoami`; falling back to `npm whoami`."}:c(e)?{args:["npm","whoami",...s],bin:"yarn",kind:"rewrite"}:e.name==="bun"?{args:["pm","whoami",...s],bin:"bun",kind:"rewrite"}:e.name==="deno"?{kind:"skip",warning:"deno has no `whoami`. JSR uses browser auth."}:{kind:"passthrough"};default:return{kind:"passthrough"}}},O=e=>V(e)!==null,ke=e=>{const n=[["pnpm-lock.yaml","pnpm"],["yarn.lock","yarn"],["package-lock.json","npm"],["npm-shrinkwrap.json","npm"],["bun.lock","bun"],["bun.lockb","bun"],["deno.lock","deno"]];let s=e;for(;;){for(const[a,o]of n)if(R($(s,a)))return o;const r=S(s);if(r===s||x(s).root===s)return;s=r}},Te=(e,n)=>{if(n.name!=="aube")return;const s=ke(e);if(s!==void 0)return`Resolved installer is aube but the workspace has a ${s} lockfile. Aube reads and writes ${s}'s lockfile format in place, but its byte output may differ subtly — expect a one-time churn diff on the first install, and ongoing drift if your team mixes tools on the same lockfile. To pin the choice across the team, set \`install.backend\` in vis.config; to bypass aube for this run, pass --no-aube.`},C=e=>{if(R(e))try{return JSON.parse(N(e,{buffer:!1}))}catch{return}},we=e=>{let n=e;for(;;){const s=$(n,"package.json"),r=C(s);if(r&&typeof r.packageManager=="string"&&r.packageManager.length>0)return r.packageManager;const a=S(n);if(a===n||x(n).root===n)return;n=a}},E=new Set(["npm","pnpm","yarn"]),W=(e,n,s)=>s===!1||!E.has(n)||!O("corepack")?!1:s===!0?!0:we(e)!==void 0,Ue=(e,n)=>{const s=n.backend,r=process.env.VIS_INSTALLER,a=s??r??n.configBackend,o=n.configCorepack??"auto";if(a&&a!=="auto"){if(a==="aube"&&!O("aube"))throw new Error('install.backend is set to "aube" but the `aube` binary is not on PATH. Install it via `npm i -g @endevco/aube`, `mise use -g aube`, or `brew install endevco/tap/aube`.');return{name:a,useCorepack:W(e,a,o),version:"latest"}}if(O("aube"))return{name:"aube",useCorepack:!1,version:"latest"};const i=ve(e);return{...i,useCorepack:W(e,i.name,o)}},ve=e=>{if(!R(e))throw new Error(`Could not detect package manager in ${e}. Directory does not exist.`);const n=J(e);return{name:n.name,version:n.version||"latest"}},M=(e,n)=>n.useCorepack!==!0||!E.has(n.name)||e.bin==="corepack"||e.bin!==n.name?e:{...e,args:[n.name,...e.args],bin:"corepack"},ye=(e,n,s)=>{if(s===void 0)return G(e.bin,e.args,n);const r=B(e.bin,e.args,{cwd:n,env:{...process.env,...s},stdio:"inherit"});if(r.error)throw r.error;return r.status??1},p=(e,n,s,r,a={})=>{const o=M(n,e);for(const i of o.warnings)r.warn(`warning: ${i}`);return a.dry?(r.log(`[dry-run] ${o.bin} ${o.args.join(" ")}`),0):ye(o,s,a.env)},f=(e,n,s,r,a={})=>p(e,n(),s,r,a),$e=(e,n)=>n==="aube"||n==="deno"?e:{...e,args:[...e.args,"--prefer-offline"]},je=(e,n,s)=>n!=="yarn"||s.startsWith("1.")||!e.args.includes("--immutable")||e.args.includes("--immutable-cache")?e:{...e,args:[...e.args,"--immutable-cache"]},P=(e,n,s)=>{let r=e.name==="aube"?se(n):Y(e.name,e.version,{...n,silent:n.silent||s.silent===!0});return s.preferOffline&&(r=$e(r,e.name)),s.ciMode&&(r=je(r,e.name,e.version)),r},qe=(e,n,s,r,a={})=>{const o=P(e,n,a);return D(e,o,s,r,{dry:a.dry,env:a.env})},Be=async(e,n,s,r,a={})=>{const o=M(P(e,n,a),e);for(const i of o.warnings)r.warn(`warning: ${i}`);return a.dry?(r.log(`[dry-run] ${o.bin} ${o.args.join(" ")}`),{code:0,output:""}):fe(o.bin,o.args,{cwd:s,env:a.env?{...process.env,...a.env}:process.env})},I=(e,n)=>{const s=n==="deno"?"--quiet":"--silent";return{...e,args:[...e.args,s]}},Oe=(e,n)=>n==="yarn"||n==="aube"?null:{...e,args:[...e.args,"--dry-run"]},D=(e,n,s,r,a)=>{if(a.dry!==!0)return p(e,n,s,r,a);const o=Oe(n,e.name);return o===null?p(e,n,s,r,a):p(e,o,s,r,{env:a.env})},Re=(e,n)=>n==="aube"?{...e,args:[...e.args,"--ignore-scripts"]}:n==="deno"?e:{...e,args:[...e.args,"--ignore-scripts"]},Se=(e,n,s,r,a={})=>{let o=e.name==="aube"?re(n):z(e.name,e.version,n);a.ignoreScripts&&(o=Re(o,e.name)),a.silent&&(o=I(o,e.name));const i=D(e,o,s,r,{dry:a.dry,env:a.env});return i===0&&a.autoInstallPeers&&_e(e,n,s,r,a),i},xe=e=>{if(e.startsWith("@")){const s=e.indexOf("/");if(s===-1)return e;const r=e.indexOf("@",s);return r===-1?e:e.slice(0,r)}const n=e.indexOf("@");return n===-1?e:e.slice(0,n)},Ce=(e,n)=>{let s=e;for(;;){const r=$(s,"node_modules",n,"package.json"),a=C(r);if(a)return a;const o=S(s);if(o===s||x(s).root===s)return;s=o}},De=e=>{const n=C($(e,"package.json")),s=new Set;if(!n)return s;for(const r of["dependencies","devDependencies","peerDependencies","optionalDependencies"]){const a=n[r];if(a)for(const o of Object.keys(a))s.add(o)}return s},_e=(e,n,s,r,a)=>{if(e.name==="deno")return;const o=De(s),i=new Map;for(const g of n.packages){const m=xe(g),t=Ce(s,m);if(!t?.peerDependencies)continue;const d=t.peerDependenciesMeta??{};for(const[v,A]of Object.entries(t.peerDependencies))d[v]?.optional||o.has(v)||i.has(v)||i.set(v,A)}if(i.size===0)return;const u=[...i.entries()].map(([g,m])=>`${g}@${m}`);r.log(`auto-installing peer dependencies: ${u.join(", ")}`);const l={exact:!1,filter:n.filter,global:!1,optional:!1,packages:u,peer:!1,saveDev:n.saveDev,workspace:!1,workspaceRoot:n.workspaceRoot};Se(e,l,s,r,{ignoreScripts:a.ignoreScripts})},Ne=(e,n,s,r,a={})=>{let o=e.name==="aube"?ae(n):H(e.name,e.version,n);return a.silent&&(o=I(o,e.name)),D(e,o,s,r,{dry:a.dry,env:a.env})},Je=(e,n,s,r,a={})=>e.name==="aube"?p(e,oe(n),s,r,a):f(e,()=>K(e.name,e.version,n),s,r,a),ze=(e,n,s,r,a={})=>e.name==="aube"?p(e,ie(n),s,r,a):f(e,()=>Q(e.name,e.version,n),s,r,a),We=(e,n)=>{if(e.name==="aube")return le(n);const s=[],r=[],a=e.name;switch(e.name){case"bun":{const o=y.coerce(e.version);o&&y.lt(o,"1.3.0")&&r.push(`bun ${e.version} does not support \`bun pm view\` (added in bun 1.3). Upgrade bun, or run \`npm view ${n.package}\` instead.`),s.push("pm","view","--",n.package,...n.fields),n.json&&s.push("--json");break}case"deno":{const o=n.package.startsWith("npm:")||n.package.startsWith("jsr:")||n.package.startsWith("https://")||n.package.startsWith("http://")||n.package.startsWith("file:")?n.package:`npm:${n.package}`;s.push("info","--",o),n.json&&s.push("--json"),n.fields.length>0&&r.push("deno info does not accept field selectors; ignoring.");break}case"npm":case"pnpm":{s.push("view","--",n.package,...n.fields),n.json&&s.push("--json");break}case"yarn":{if(e.version.startsWith("1.")){s.push("info","--",n.package);const[o,...i]=n.fields;o!==void 0&&(i.length>0&&r.push("yarn v1 only supports querying one field at a time; using the first."),s.push(o)),n.json&&s.push("--json")}else s.push("npm","info","--",n.package),n.fields.length>0&&r.push("yarn berry does not support field arguments to 'npm info'; ignoring."),n.json&&s.push("--json");break}default:{const o=e.name;throw new Error(`Unsupported package manager: ${o}`)}}return{args:s,bin:a,warnings:r}},He=(e,n,s,r,a={})=>p(e,We(e,n),s,r,a),Fe=(e,n,s,r,a={})=>e.name==="aube"?p(e,ue(n),s,r,a):f(e,()=>X(e.name,e.version,n),s,r,a),Ve=(e,n,s,r,a,o={})=>e.name==="aube"?p(e,ce(n,s),r,a,o):f(e,()=>Z(e.name,e.version,n,s),r,a,o),Ee=(e,n,s)=>{if(e.args.includes("--offline")||e.args.includes("--cached-only"))return e;const r=(a,o)=>{const i=[...e.args];return i.splice(o,0,a),{...e,args:i}};switch(n){case"aube":case"pnpm":return r("--offline",1);case"bun":return{...e,warnings:[...e.warnings,"bun x does not support --offline. Pre-install the package via `vis install` so bun x resolves from the local cache."]};case"deno":return r("--cached-only",1);case"npm":return r("--offline",1);case"yarn":return s.startsWith("1.")?r("--offline",0):{...e,warnings:[...e.warnings,"yarn berry has no --offline flag for dlx. Configure `enableNetwork: false` in .yarnrc.yml or set `enableMirror: true` for offline-first behavior."]};default:{const a=n;return{...e,warnings:[...e.warnings,`applyDlxOffline: unsupported pm ${String(a)}`]}}}},Ye=(e,n,s,r,a={})=>{let o=e.name==="aube"?te(n):F(e.name,e.version,n);return a.offline&&(o=Ee(o,e.name,e.version)),p(e,o,s,r,{dry:a.dry,env:a.env})},Ge=(e,n,s,r,a={})=>e.name==="aube"?p(e,pe(n),s,r,a):f(e,()=>ee(e.name,e.version,n),s,r,a),Ke=(e,n,s,r,a,o={})=>{if(e.name==="aube")return p(e,de(n,s),r,a,o);const i=be(e,n,s);return i.kind==="skip"?(a.warn(`warning: ${i.warning}`),0):i.kind==="rewrite"?p(e,{args:i.args,bin:i.bin,warnings:i.warning?[i.warning]:[]},r,a,o):f(e,()=>ne(e.name,e.version,n,s),r,a,o)};export{Ye as $,Ke as B,Ne as D,ze as E,Ue as I,Se as M,He as P,qe as R,Ve as S,Ge as W,Be as h,Fe as j,Te as p,fe as s,Le as v,ve as w,Je as x};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{createRequire as w}from"node:module";import{s as l}from"./index-CgcF6_wo.js";import{f as T,a as R,m as p}from"./index-BDmTbWX1.js";import{g as A,l as M}from"../packem_chunks/bin.js";import{a as P}from"../packem_chunks/config.js";const k=w(import.meta.url),u=typeof globalThis<"u"&&typeof globalThis.process<"u"?globalThis.process:process,_=t=>{if(typeof u<"u"&&u.versions&&u.versions.node){const[e,s]=u.versions.node.split(".").map(Number);if(e>22||e===22&&s>=3||e===20&&s>=16)return u.getBuiltinModule(t)}return k(t)},{rmSync:f,writeFileSync:j}=_("node:fs"),U=8,$=async(t,e,s)=>{if(t.length===0)return[];const o=Math.max(1,Math.min(e,t.length)),a=Array.from({length:t.length});let r=0;const i=async()=>{for(;r<t.length;){const n=r;r+=1;const c=t[n];a[n]=await s(c,n)}};return await Promise.all(Array.from({length:o},()=>i())),a},g=2,C=1800*1e3,S=15e3,v=()=>p(A(),"packuments"),y=t=>p(v(),`${encodeURIComponent(t)}.json`),D=t=>{const e=y(t);if(T(e))try{const s=P(e);if(s.cacheVersion!==g){f(e,{force:!0});return}if(Date.now()-s.createdAt>s.ttlMs){f(e,{force:!0});return}return s.packument}catch{f(e,{force:!0});return}},N=(t,e,s)=>{R(v());const o={cacheVersion:g,createdAt:Date.now(),packument:e,ttlMs:s};j(y(t),JSON.stringify(o),"utf8")},O=t=>{const e={},s=t.versions??{};for(const[a,r]of Object.entries(s)){const i=r.dist,n={version:a};if(r._npmUser!==void 0&&(n._npmUser=r._npmUser),r.maintainers!==void 0&&(n.maintainers=r.maintainers),r.bin!==void 0&&(n.bin=r.bin),i!==void 0){const c={};i.signatures!==void 0&&(c.signatures=i.signatures),i.attestations!==void 0&&(c.attestations=i.attestations),typeof i.integrity=="string"&&(c.integrity=i.integrity),typeof i.tarball=="string"&&(c.tarball=i.tarball),n.dist=c}r.repository!==void 0&&(n.repository=r.repository),r.license!==void 0&&(n.license=r.license),typeof r.readme=="string"&&(n.readme=r.readme),typeof r.readmeFilename=="string"&&(n.readmeFilename=r.readmeFilename),typeof r.private=="boolean"&&(n.private=r.private),typeof r.deprecated=="string"&&(n.deprecated=r.deprecated),r.scripts!==void 0&&typeof r.scripts=="object"&&(n.scripts=r.scripts),e[a]=n}const o={name:typeof t.name=="string"?t.name:"",versions:e};return t["dist-tags"]!==void 0&&(o["dist-tags"]=t["dist-tags"]),t.time!==void 0&&(o.time=t.time),typeof t.readme=="string"&&(o.readme=t.readme),o},E=t=>{const e={Accept:"application/json"};return t!==void 0&&t!==""&&(e.Authorization=`Bearer ${t}`),e},F=async(t,e)=>{if(e.registryUrl!==void 0)return{authToken:e.authToken,url:e.registryUrl};if(e.workspaceRoot!==void 0){const{getRegistryForPackage:s,loadNpmrc:o}=await import("../packem_chunks/bin.js").then(n=>n.bx),a=o(e.workspaceRoot),{token:r,url:i}=s(t,a);return{authToken:e.authToken??r,url:i}}return{authToken:e.authToken,url:"https://registry.npmjs.org"}},V=async(t,e={})=>{const s=e.cacheTtlMs??C,o=D(t);if(o!==void 0)return o;const a=await F(t,e),r=`${a.url.endsWith("/")?a.url.slice(0,-1):a.url}/${t.replace("/","%2f")}`,i=new AbortController,n=setTimeout(()=>{i.abort()},S),c=()=>{i.abort()};e.signal?.addEventListener("abort",c,{once:!0});try{const d=await fetch(r,{headers:E(a.authToken),signal:i.signal});if(d.status===404)return;if(!d.ok)throw new Error(`Registry returned ${String(d.status)} for ${t}`);const b=await d.json(),m=O(b);return N(t,m,s),m}finally{clearTimeout(n),e.signal?.removeEventListener("abort",c)}},H=(t,e)=>{const s=Object.keys(t.versions);if(s.length===0)return;if(e===void 0||e===""||e==="latest")return t["dist-tags"]?.latest??s.at(-1);const o=t["dist-tags"]?.[e];return o!==void 0?o:Object.hasOwn(t.versions,e)?e:l.maxSatisfying(s,e)??void 0},h=(t,e)=>t.versions[e]?.dist?.attestations?.provenance!==void 0,x=(t,e)=>l.valid(e)?Object.keys(t.versions).filter(s=>l.valid(s)!==null&&l.lt(s,e)).filter(s=>l.satisfies(s,"*",{includePrerelease:!1})).filter(s=>h(t,s)).sort((s,o)=>l.lt(s,o)?1:-1)[0]:void 0,I=async(t,e={})=>{if(M("provenance"))return[];const s=new Set(e.allowlist),o=e.concurrency??U;return(await $(t,o,async({name:a,version:r})=>{if(s.has(a))return;const i=await V(a,{workspaceRoot:e.workspaceRoot});if(i===void 0||h(i,r))return;const n=x(i,r);if(n!==void 0)return{packageName:a,priorVersionWithProvenance:n,version:r}})).filter(a=>a!==void 0)};export{U as D,H as a,x as f,V as g,$ as m,I as r};
|