Skip to content

Fix CLI discovery in Bun-compiled workspace apps - #1060

Merged
theoephraim merged 4 commits into
mainfrom
fix-bun-compiled-cli-resolution
Sep 3, 2026
Merged

Fix CLI discovery in Bun-compiled workspace apps#1060
theoephraim merged 4 commits into
mainfrom
fix-bun-compiled-cli-resolution

Conversation

@theoephraim

Copy link
Copy Markdown
Member

Summary

  • search for the project Varlock CLI relative to the running executable
  • cover Bun compiled executables whose module paths use the virtual /$bunfs filesystem
  • document runtime CLI requirements for compiled Bun applications

Why

A compiled Bun application can run from a package such as /app/apps/server/dist/server while import.meta.dirname points into /$bunfs and the process working directory is /app. In an isolated workspace install, the CLI remains at /app/apps/server/node_modules/.bin/varlock, so the existing search paths miss it.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

bumpy-frog

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

patch Patch releases

  • @varlock/native-helper-darwin 1.18.0 → 1.18.1
  • @varlock/native-helper-linux-arm64 1.18.0 → 1.18.1
  • @varlock/native-helper-linux-x64 1.18.0 → 1.18.1
  • @varlock/native-helper-win32-x64 1.18.0 → 1.18.1
  • varlock 1.18.0 → 1.18.1

Bump files in this PR

Click here if you want to add another bump file to this PR


This comment is maintained by bumpy.

@github-actions

github-actions Bot commented Sep 3, 2026

Copy link
Copy Markdown
Contributor

📦 Bundle size

⚠️ grows the bundle by 3.1 KB (+0.1%)

Metric main This PR Δ
Total dist 4438.8 KB 4441.9 KB +3.1 KB (+0.1%)
JS 1687.9 KB 1689.2 KB +1.3 KB (+0.1%)
Sourcemaps 2642.7 KB 2644.5 KB +1.8 KB (+0.1%)
Type defs 108.2 KB 108.2 KB
Other 0.0 KB 0.0 KB

dist/ only; native binaries are versioned separately and not counted here.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Sep 3, 2026

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
varlock-website fd80556 Commit Preview URL

Branch Preview URL
Sep 03 2026, 05:42 AM

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Important

Restrict executable-relative discovery to the compiled Bun case so ordinary runtime lookup keeps selecting the project-local CLI.

Reviewed changes in f496fa3c, covering the CLI fallback search, its regression test, Bun deployment documentation, and the release entry.

  • Executable-relative discovery: Adds process.execPath as a search origin for bundled modules whose callerDir is inside Bun's virtual filesystem.
  • Regression coverage: Simulates a compiled workspace executable and verifies selection of its package-local node_modules/.bin/varlock.
  • Runtime documentation: Explains how compiled Bun applications retain or launch the separate Varlock CLI.
  • Release metadata: Adds a patch changeset for the corrected discovery behavior.

Pullfrog  | Fix all ➔Fix 👍s ➔View workflow run | Using azure/gpt-5.6-sol𝕏

Comment thread packages/varlock/src/lib/exec-sync-varlock.ts Outdated
@pkg-pr-new

pkg-pr-new Bot commented Sep 3, 2026

Copy link
Copy Markdown

Open in StackBlitz

varlock

npm i https://pkg.pr.new/dmno-dev/varlock@1060

@varlock/native-helper-darwin

npm i https://pkg.pr.new/dmno-dev/varlock/@varlock/native-helper-darwin@1060

@varlock/native-helper-linux-arm64

npm i https://pkg.pr.new/dmno-dev/varlock/@varlock/native-helper-linux-arm64@1060

@varlock/native-helper-linux-x64

npm i https://pkg.pr.new/dmno-dev/varlock/@varlock/native-helper-linux-x64@1060

@varlock/native-helper-win32-x64

npm i https://pkg.pr.new/dmno-dev/varlock/@varlock/native-helper-win32-x64@1060

@varlock/aws-sigv4-plugin

npm i https://pkg.pr.new/dmno-dev/varlock/@varlock/aws-sigv4-plugin@1060

commit: fd80556

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes since the prior Pullfrog review, focused on the executable lookup correction and its regression coverage.

  • Restricted executable lookup: Gated the process.execPath search origin on Bun.isStandaloneExecutable, preserving project-local CLI selection in Node and ordinary Bun processes.
  • Expanded regression coverage: Marked the compiled-app fixture as standalone and added a negative test proving ordinary runtimes skip executable-relative discovery.

Pullfrog  | View workflow run | Using azure/gpt-5.6-sol𝕏

@pullfrog pullfrog Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ No new issues found.

Reviewed changes since the prior Pullfrog review, focused on the revised compiled Bun deployment guidance.

  • Clarified runtime requirements: Documented that the installed varlock package and its dependencies must accompany a compiled application when it resolves configuration at startup.
  • Explained discovery layout: Added a concrete workspace example and clarified that executable-relative discovery walks upward through parent directories for node_modules/.bin/varlock.
  • Covered deployment pruning: Explained where to declare the production dependency and retained the standalone-binary alternative for executable-only deployments.

Pullfrog  | View workflow run | Using azure/gpt-5.6-sol𝕏

@theoephraim
theoephraim merged commit 8b6d33f into main Sep 3, 2026
28 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant