Skip to content

Feature Request: Add support for Bun package manager #1108

Open
@coolcline

Description

@coolcline

Is your feature request related to a problem? Please describe.
Currently, vsce hardcodes the use of npm for running prepublish scripts (npm run vscode:prepublish). This causes issues when using alternative package managers like Bun, as the command fails with "npm: command not found" even when the project is properly configured to use Bun.

Describe the solution you'd like
I propose adding support for different package managers, specifically Bun, in the following ways:

  1. Auto-detect the package manager being used in the project (by checking for bun.lockb, package-lock.json, yarn.lock, etc.)
  2. Add a configuration option to explicitly specify which package manager to use (e.g., --package-manager=bun)
  3. Use the detected/specified package manager when running scripts instead of hardcoding npm

Describe alternatives you've considered
Current workarounds include:

  • Installing npm alongside Bun (not ideal, adds unnecessary dependencies)
  • Using the --no-dependencies flag (doesn't work as the npm command is still hardcoded)

Additional context
Bun is gaining popularity as a fast, all-in-one JavaScript runtime and package manager. Supporting it would improve the developer experience for teams using Bun in their VS Code extension projects.

Example of a project using Bun:

json
{
    "scripts": {
    "vscode:prepublish": "bun run package",
    "package": "bun run build:webview && bun run check-types && bun run lint"
    }
}

Environment:

  • vsce version: 2.15.0
  • OS: macOS
  • Package Manager: Bun 1.1.42

Metadata

Metadata

Assignees

Labels

feature-requestRequest for new features or functionalityhelp wantedIssues identified as good community contribution opportunities

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions