Skip to content

Add version mismatch warning between standalone binary and local node_modules install#534

Open
Copilot wants to merge 3 commits intomainfrom
copilot/check-version-between-node-modules-and-binary
Open

Add version mismatch warning between standalone binary and local node_modules install#534
Copilot wants to merge 3 commits intomainfrom
copilot/check-version-between-node-modules-and-binary

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 2, 2026

When users have both a standalone binary (homebrew/curl) and a project-level npm install of varlock at different versions, the CLI silently uses whichever is on PATH, producing confusing errors from version incompatibilities.

Changes

  • packages/varlock/src/lib/check-local-version.ts — New checkLocalVersionMismatch() that walks up from cwd looking for node_modules/varlock/package.json and compares its version against the running binary's version
  • packages/varlock/src/cli/cli-executable.ts — Calls the check on SEA builds only, skipping --version/--help for clean output
  • packages/varlock/src/lib/test/check-local-version.test.ts — 9 tests covering match, mismatch, parent directory traversal, malformed package.json, and missing version field

Behavior

Only triggers when __VARLOCK_SEA_BUILD__ is true and a local install exists with a differing version:

⚠️  Varlock version mismatch detected!
  Standalone binary version: 0.4.0
  Local installed version:   0.6.3
You are running the standalone binary, but a different version of varlock is installed in this project's node_modules.
This can cause unexpected errors. Please update your standalone binary or use the locally installed version instead
(e.g. via npx varlock, pnpm exec varlock, or bunx varlock).

Silently no-ops when: no local install exists, versions match, or package.json is unreadable.

@changeset-bot
Copy link
Copy Markdown

changeset-bot bot commented Apr 2, 2026

🦋 Changeset detected

Latest commit: d6df257

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 18 packages
Name Type
varlock Patch
@varlock/astro-integration Patch
@varlock/cloudflare-integration Patch
@varlock/expo-integration Patch
@varlock/nextjs-integration Patch
@varlock/vite-integration Patch
@varlock/1password-plugin Patch
@varlock/aws-secrets-plugin Patch
@varlock/azure-key-vault-plugin Patch
@varlock/bitwarden-plugin Patch
@varlock/dashlane-plugin Patch
@varlock/google-secret-manager-plugin Patch
@varlock/hashicorp-vault-plugin Patch
@varlock/infisical-plugin Patch
@varlock/keepass-plugin Patch
@varlock/pass-plugin Patch
@varlock/passbolt-plugin Patch
@varlock/proton-pass-plugin Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copilot AI and others added 2 commits April 2, 2026 04:51
…cal node_modules install

Agent-Logs-Url: https://github.com/dmno-dev/varlock/sessions/9c46e44c-4e1e-41a8-bb8b-475279f531dc

Co-authored-by: theoephraim <1158956+theoephraim@users.noreply.github.com>
…kip warning for --version/--help

Agent-Logs-Url: https://github.com/dmno-dev/varlock/sessions/9c46e44c-4e1e-41a8-bb8b-475279f531dc

Co-authored-by: theoephraim <1158956+theoephraim@users.noreply.github.com>
Copilot AI changed the title [WIP] Fix version check between node_modules and standalone binary Add version mismatch warning between standalone binary and local node_modules install Apr 2, 2026
Copilot AI requested a review from theoephraim April 2, 2026 04:54
@theoephraim theoephraim marked this pull request as ready for review April 2, 2026 17:06
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.

[Feature Request] Check version between ./node_modules and standalone binary

3 participants