bun icon indicating copy to clipboard operation
bun copied to clipboard

`bun ci` Clean Install Subcommand

Open Pandapip1 opened this issue 1 year ago • 6 comments

What is the problem this feature would solve?

NPM has a command, npm ci, that installs the exact packages in the lockfile for reprocucable builds.

What is the feature you are proposing to solve the problem?

A new subcommand, bun ci, that does the exact same thing as npm ci but for bun.

What alternatives have you considered?

Maybe bun install could do a clean install by default. That would be nice.

Pandapip1 avatar Sep 13 '23 15:09 Pandapip1

I believe this already exists in Bun as an option:

bun install --frozen-lockfile

From the docs:

To install with reproducible dependencies, use --frozen-lockfile. If your package.json disagrees with bun.lockb, Bun will exit with an error. This is useful for production builds and CI environments.

madwau avatar Sep 15 '23 04:09 madwau

Could you make bun ci an alias of that, since I wasn't easily able to find that subcommand and it's one that would see really common use?

Pandapip1 avatar Sep 15 '23 14:09 Pandapip1

I believe this already exists in Bun as an option:

bun install --frozen-lockfile

From the docs:

To install with reproducible dependencies, use --frozen-lockfile. If your package.json disagrees with bun.lockb, Bun will exit with an error. This is useful for production builds and CI environments.

im getting error

error: lockfile had changes, but lockfile is frozen

when trying to execute it in my github actions like this - run: bun install --frozen-lockfile && bun run build

nrmnqdds avatar Oct 07 '23 04:10 nrmnqdds

I believe this already exists in Bun as an option:

bun install --frozen-lockfile

From the docs:

To install with reproducible dependencies, use --frozen-lockfile. If your package.json disagrees with bun.lockb, Bun will exit with an error. This is useful for production builds and CI environments.

im getting error

error: lockfile had changes, but lockfile is frozen

when trying to execute it in my github actions like this - run: bun install --frozen-lockfile && bun run build

That would happen with npm ci too - both fail with an error if your lockfile doesn't match package.json.

kurucu avatar Nov 09 '23 00:11 kurucu

Lots of CI scripts already use npm ci, of course bun has flag, but I'm sure that change npm to bun will be more clear for non JS developers or DevOpsers. Moreover, bun already do it for other npm commands.

VasiliyRusin avatar Dec 22 '23 13:12 VasiliyRusin

make it please, it makes sense

applemate avatar Apr 07 '24 08:04 applemate