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

Check that dependencies are install before running scripts #14245

Open
Nick-Mazuk opened this issue Sep 29, 2024 · 0 comments
Open

Check that dependencies are install before running scripts #14245

Nick-Mazuk opened this issue Sep 29, 2024 · 0 comments
Labels
enhancement New feature or request

Comments

@Nick-Mazuk
Copy link

What is the problem this feature would solve?

It's easy to begin development with the wrong dependencies installed. Here's some examples:

  • Switch branches, where the new branch has different dependencies
  • Pull the repo for the first time

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

Normally you'd have to remember to run bun i in these scenarios. I'd like bun to "remember" for me.

Before I run a script in the "scripts" field of the package.json (or bun test, etc.), I'd like bun to check that the correct dependencies are installed then either:

  • Error out, notifying me that I should run bun i
  • Automatically install the dependencies for me (i.e., run bun i in the background).

Drawbacks:

  • This will increase the latency of every command. It may be possible to utilize caching to speed this up for subsequent bun invocations.
  • Automatically running bun i can pose security risks (because postinstall scripts can run arbitrary code), so doing this should be opt-in on the developer-level in my opinion.

What alternatives have you considered?

Keep the status quo.

@Nick-Mazuk Nick-Mazuk added the enhancement New feature or request label Sep 29, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant