Skip to content
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

feat: add bun package manager #78

Merged
merged 1 commit into from
Nov 21, 2023

Conversation

DevDengChao
Copy link
Contributor

@DevDengChao DevDengChao commented Oct 26, 2023

Add bun as a package manager option.

@fasttime
Copy link
Member

Hi @DevDengChao, could you please edit the PR description to explain what this change does?

@DevDengChao
Copy link
Contributor Author

@fasttime Updated.

@fasttime
Copy link
Member

I would like to know what the team thinks about this change @eslint/eslint-team.

We already have pnpm and yarn as alternative package managers, and it seems that bun already gained some popularity, so I'd be in favor of this.

@nzakas
Copy link
Member

nzakas commented Nov 20, 2023

I'm not opposed to adding this, but I'm also not sure just adding bun as a choice here will do it. This is the method that actually uses the package manager:

function installSyncSaveDev(packages, packageManager = "npm") {
const packageList = Array.isArray(packages) ? packages : [packages];
const installCmd = packageManager === "yarn" ? "add" : "install";
const installProcess = spawn.sync(packageManager, [installCmd, "-D"].concat(packageList), { stdio: "inherit" });
const error = installProcess.error;
if (error && error.code === "ENOENT") {
const pluralS = packageList.length > 1 ? "s" : "";
log.error(`Could not execute ${packageManager}. Please install the following package${pluralS} with a package manager of your choice: ${packageList.join(", ")}`);
}
}

Does bun install -D work just like npm?

@DevDengChao
Copy link
Contributor Author

Bun is an npm-compatible package manager.

@nzakas Yes, bun install xxx -D works like npm install xxx -D .

Copy link
Member

@nzakas nzakas left a comment

Choose a reason for hiding this comment

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

LGTM. Thanks.

@nzakas nzakas merged commit 903f929 into eslint:main Nov 21, 2023
15 checks passed
@github-actions github-actions bot mentioned this pull request Nov 21, 2023
@DevDengChao DevDengChao deleted the feat/add-bun-package-manager branch November 22, 2023 06:54
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants