Skip to content

Conversation

hamlim
Copy link
Contributor

@hamlim hamlim commented Feb 13, 2025

Closes: #1228

This change adds support for the bun package manager when running create-waku.

From some local testing, it seemed like bun didn't set the process.env.npm_config_user_agent variable correctly (it does so when running bun repl though...), so instead I opted to fallback to checking if the Bun global was defined, which seems to be present when running the package via bun.

I was also considering checking against process.argv0 which I think would be 'bun', however I'm not 100% sure since I was running the cli manually via bun ./path/to/cli.js vs bun create waku.

Copy link

vercel bot commented Feb 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Updated (UTC)
waku ✅ Ready (Inspect) Visit Preview Feb 13, 2025 11:41pm
Copy link

codesandbox-ci bot commented Feb 13, 2025

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

@dai-shi dai-shi changed the title Add support for bun package manager in create-waku Feb 13, 2025
@dai-shi dai-shi mentioned this pull request Feb 13, 2025
Copy link
Member

@dai-shi dai-shi left a comment

Choose a reason for hiding this comment

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

Thanks for your contribution!

@dai-shi dai-shi merged commit 9cc7559 into wakujs:main Feb 13, 2025
26 checks passed
@hamlim hamlim deleted the feat-support-bun-package-manager branch February 14, 2025 02:36
dai-shi pushed a commit that referenced this pull request Feb 26, 2025
…v var (#1268)

I noticed that running `bun create waku@latest` and `bunx
create-waku@latest` didn't seem to detect `bun` as the package manager
as expected based on my changes in #1229.

However - I was able to verify that both formats should work when I
tested with a new dummy package: `create-debug-create`

```sh
bun create debug-create@latest
# and
bunx create-debug-create@latest
```

will print some things to the console (e.g. `process.env`, `process`,
etc).

Based on running both of those - it seems like the
`npm_config_user_agent` env var _does_ get populated with `bun` as
expected (not sure how I was testing before where it didn't work - maybe
just with running the CLI directly via `bun ./cli.mjs`?)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants