Skip to content

Add bun as package manager #239

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ To get started quickly, bootstrap a new project!
npm create vite-plugin-web-extension
pnpm create vite-plugin-web-extension
yarn create vite-plugin-web-extension
bun create vite-plugin-web-extension
```

### Features
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite-plugin-web-extension/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import { initProject } from "./src/initProject";
program
.argument("[project-name]")
.option("-t, --template <template>")
.option("-p, --package-manager <package-manager>", "npm, pnpm, or yarn")
.option("-p, --package-manager <package-manager>", "npm, pnpm, yarn, or bun")
.option(
"--repo <remote-url>",
"The repo to get templates from. Set this if working off a fork.",
Expand Down
3 changes: 3 additions & 0 deletions packages/create-vite-plugin-web-extension/src/initProject.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ const START_COMMANDS: Record<PackageManager, string> = {
npm: "npm run dev",
pnpm: "pnpm dev",
yarn: "yarn dev",
bun: "bun dev",
};

export async function initProject(
Expand Down Expand Up @@ -110,6 +111,8 @@ async function resolveOptions(
choices.push({ title: "PNPM", value: "pnpm" });
if (commandExists.sync("yarn"))
choices.push({ title: "Yarn", value: "yarn" });
if (commandExists.sync("bun"))
choices.push({ title: "Bun", value: "bun" });

if (choices.length > 1) {
const res = await prompt({
Expand Down
2 changes: 1 addition & 1 deletion packages/create-vite-plugin-web-extension/src/types.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const PACKAGE_MANAGERS = ["npm", "pnpm", "yarn"] as const;
export const PACKAGE_MANAGERS = ["npm", "pnpm", "yarn", "bun"] as const;
export type PackageManager = typeof PACKAGE_MANAGERS[number];

export interface InputProjectOptions {
Expand Down