-
-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Detect Bun package manager in create-astro #7944
Conversation
🦋 Changeset detectedLatest commit: 3e8edde The changes in this PR will be included in the next version bump. Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
Thanks! Not sure if will want the readme change, as that implies more support than I think we can offer at the moment. No issues with the code change though. Will discuss with the team and get back to you. |
Just noting that current bun support only uses bun as a package manager, partially too, at this moment this still requires to have node and npm !! installed. |
@matthewp Yep, this is primarily aimed at users who are using Bun as a standalone package manager/script runner. As @kanashimia says, this is only using Bun as a package manager. Worth noting that post-1.0 |
Removed the readme change. Just to clarify w.r.t. @kanashimia's point, users do not need npm installed to use $ alias npm=asdfasdf
$ npm_config_user_agent=bun/1.0 node create-astro.mjs
╭─────╮ Houston:
│ ◠ ◡ ◠ Let's make the web weird!
╰─────╯
astro v2.10.2 Launch sequence initiated.
dir Where should we create your new project?
./tested-transit
tmpl How would you like to start your new project?
Include sample files
✔ Template copied
deps Install dependencies?
Yes
✔ Dependencies installed
ts Do you plan to write TypeScript?
Yes
use How strict should TypeScript be?
Strict
✔ TypeScript customized
git Initialize a new git repository?
Yes
✔ Git initialized
next Liftoff confirmed. Explore your project!
Enter your project directory using cd ./tested-transit
Run bun run dev to start the dev server. CTRL+C to stop.
Add frameworks like react or tailwind using astro add.
Stuck? Join us at https://astro.build/chat
╭─────╮ Houston:
│ ◠ ◡ ◠ Good luck out there, astronaut! 🚀
╰─────╯
$ cd tested-transit
$ bun run dev
$ astro dev
🚀 astro v2.10.2 started in 73ms
┃ Local http://localhost:3000/
┃ Network use --host to expose
|
This isn't a correct way to test this, aliases are shell specific, they do nothing inside of the command you are trying to execute, correct way would be to remove the path to the folder where the binary is located from the PATH environment variable. |
Also it seems that bun still tries to execute scripts when you do not have node installed, using its own runtime. |
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.
I'm cool with this change, thanks for contributing.
Excited for the Astro × Bun story to evolve!
Changes
Better support for Bun users when using
create-astro
.bun run dev
)bunx create-astro
to readmeTesting
I didn't see tests for
pnpm
oryarn
. Bun setsnpm_config_user_agent
like Yarn/pnpm, andwhich-pm-runs
detects this as expected. Here's a sample run showing everything working with Bun:Docs
Sister documentation PR: withastro/docs#4052