Add JS package manager support (pnpm, yarn, npm)#2802
Closed
mikeland73 wants to merge 5 commits intomainfrom
Closed
Add JS package manager support (pnpm, yarn, npm)#2802mikeland73 wants to merge 5 commits intomainfrom
mikeland73 wants to merge 5 commits intomainfrom
Conversation
Allow installing JS packages via `devbox add pnpm:vercel`, `devbox add npm:eslint`, etc. Packages are managed by the specified JS package manager rather than Nix, with entries in devbox.lock using a minimal `managed_by` field. Binaries are symlinked from node_modules/.bin/ to .devbox/virtenv/<manager>/bin/ and added to PATH. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Fixes revive cognitive-complexity lint (was 36, max 32). Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Enable DEVBOX_COREPACK_ENABLED in test devbox.json so pnpm is available via corepack (bundled with nodejs) rather than as a separate nix package. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Refactor util.go: replace eager initDevboxUtilityProject with on-demand addToUtilityProject that installs packages only when needed. For JSPM, install nodejs in the utility project and enable corepack to provide pnpm/yarn/npm binaries. This ensures JS package managers are always available regardless of what the user has in their devbox.json. Update services.go callsites to use addToUtilityProject directly with the process-compose package. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
pnpm:vercel,yarn:turbo,npm:eslintmanaged_bylockfile entriesnode_modules/.bin/are symlinked to.devbox/virtenv/<manager>/bin/and added to PATHTest plan
pkgtype/jspm_test.go)package_test.go- CanonicalName, Versioned, IsJSPM)go test ./internal/...)go test ./testscripts -run TestScripts/add_jspmDEVBOX_RUN_PROJECT_TESTS=1 go test ./testscripts -run TestScriptsWithProjects/jspmdevbox add pnpm:vercelwith nodejs+pnpm in packages🤖 Generated with Claude Code