-
Notifications
You must be signed in to change notification settings - Fork 906
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 to init
command
#2073
Conversation
I think it would be safer to give user an error and let them know that |
thanks, added this kind of a check 🙌 |
Will bun be used as the runtime to run metro, prettier, tsc, eslint and so on with this change? |
Nice work |
Exciting. Let me know if you run into any issues with Bun |
e027053
to
620a16d
Compare
Did you try building the project after initializing a project with Bun?
|
If postinstall of react-native dependencies is necessary, that will need to be worked around until we ship the default allowlist for |
Never mind, my workaround for oven-sh/bun#5063 didn't work properly. It works once I've fixed it. |
Seems to be working Screen.Recording.2023-09-13.at.12.06.17.mov |
89669a0
to
873c7e4
Compare
873c7e4
to
c9c3874
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's ship it
Summary:
Adding support for Bun package manager with
init
command.With template and dependencies installed via bun package manager, the JS code execution time went from ~41s to ~2,5s.
In order to make package managers easier to use, this PR deprecates
--npm
flag and introduces--pm
flag where it's possible to use one of the packagers:yarn
,npm
orbun
.Test Plan:
Follow the contributing guide
init
command as usual. It should install template and dependencies using yarn and you should haveyarn.lock
file in created project.init
command with--pm yarn
flag. Once it's done, you should haveyarn.lock
file in created project.init
command with--pm npm
flag. Once it's done, you should havepackage-lock.json
file in created project.init
command with--pm bun
flag. Once it's done, you should havebun.lockb
file in created project.init
command with--npm
flag. It should show a deprecation warning in the console.bun run ./path-to-cli init ProjectName
. It should usebun
to install dependencies and template without any additional flag passed. Should also work withbunx
once deployed.bun
is not installed on the machine, it shouldfallback tothrow an error that selected package manager is not available (only when using flag)npm
. Created project should have apackage-lock.json
file.clean command
in the created project - theBun
option should be available. It runsbun pm cache rm
under the hood.Checklist