Skip to content

fix: add workspace: protocol for vlt in babylon fixture#51

Merged
darcyclarke merged 1 commit intovltpkg:mainfrom
vltbaudbot:fix/babylon-vlt-install
Mar 5, 2026
Merged

fix: add workspace: protocol for vlt in babylon fixture#51
darcyclarke merged 1 commit intovltpkg:mainfrom
vltbaudbot:fix/babylon-vlt-install

Conversation

@vltbaudbot
Copy link
Contributor

Problem

vlt install fails on the babylon fixture because vlt doesn't automatically resolve workspace packages when referenced with plain semver specs (e.g. "@dev/build-tools": "^1.0.0"). Unlike npm, yarn, and pnpm, vlt requires the explicit workspace: protocol to resolve local workspace packages.

The error:

Error: failed to fetch manifest
  spec: '@dev/shared-ui-components@1.0.0'
  url: https://registry.npmjs.org/@dev/shared-ui-components/1.0.0

vlt tries to fetch private workspace packages from the npm registry, which fails because they only exist locally.

This causes all babylon benchmark results for vlt to show as DNF (Did Not Finish) — confirmed in the latest chart data.

Root Cause

Filed as a vlt bug: vltpkg/vltpkg#1534

Solution

Added a vlt-specific setup script that rewrites inter-workspace dependency specs to use workspace:* before vlt install runs. This follows the existing pattern used by zpm/berry (which create .yarnrc.yml before their install).

Changes

  1. scripts/add-workspace-protocol.js — Node script that:

    • Discovers all workspace packages in the monorepo
    • Finds all inter-workspace dependency references across all package.json files
    • Rewrites them from "@dev/build-tools": "^1.0.0" to "@dev/build-tools": "workspace:*"
  2. scripts/variations/common.sh — Sets BENCH_SETUP_VLT to run the script before each vlt install

  3. scripts/clean-helpers.sh — Adds clean_workspace_protocol() to clean_all() to restore package.json files via git checkout after vlt runs. This prevents workspace: specs from leaking to other tools (yarn classic v1 doesn't support the protocol).

Testing

Verified locally:

  • node scripts/add-workspace-protocol.js fixtures/babylon — finds 87 workspace packages, modifies 80 package.json files
  • vlt install --view=silent — succeeds (was failing before)
  • git checkout -- packages/ package.json — correctly restores all files

vlt requires the workspace: protocol to resolve workspace packages,
unlike npm/yarn which auto-detect workspace packages by name. This adds
a setup script that rewrites inter-workspace dependency specs to use
workspace:* before vlt install runs.

Changes:
- scripts/add-workspace-protocol.js: Node script that finds all workspace
  packages and rewrites their inter-dependencies to use workspace:*
- scripts/variations/common.sh: Set BENCH_SETUP_VLT to run the script
  before each vlt install
- scripts/clean-helpers.sh: Add clean_workspace_protocol() to restore
  package.json files via git checkout after vlt runs, preventing
  workspace: specs from affecting other tools (yarn classic doesn't
  support the protocol)

Ref: vltpkg/vltpkg#1534
@darcyclarke darcyclarke merged commit 12eff77 into vltpkg:main Mar 5, 2026
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants