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

feat: support bun package manager in create-docusaurus #9241

Merged
merged 3 commits into from
Aug 24, 2023

Conversation

colinhacks
Copy link
Contributor

@colinhacks colinhacks commented Aug 18, 2023

Pre-flight checklist

Motivation

Detect usage of the bun package manager when executing the create-docusaurus CLI.

Test Plan

I couldn't find tests for the other package manager detection logic. Below are some successful run on my local machine.

With npm_config_user_agent set appropriately:

$ npm_config_user_agent=bun/1.0 node bin/index.js
✔ What should we name this site? … mysite
✔ Select a template below... › classic (recommended)
✔ This template is available in TypeScript. Do you want to use the TS variant? … yes
[INFO] Creating new Docusaurus project...
[INFO] Installing dependencies with bun...
bun install v0.7.4 (f74585ff)
 Saved lockfile
 + @docusaurus/[email protected]
 + @docusaurus/[email protected]
 + @docusaurus/[email protected]
 + @docusaurus/[email protected]
 + @mdx-js/[email protected]
 + [email protected]
 + [email protected]
 + [email protected]
 + [email protected]

 1099 packages installed [736.00ms]
[SUCCESS] Created mysite.
[INFO] Inside that directory, you can run several commands:

  `bun start`
    Starts the development server.

  `bun run build`
    Bundles your website into static files for production.

  `bun run serve`
    Serves the built website locally.

  `bun run deploy`
    Publishes the website to GitHub pages.

We recommend that you begin by typing:

  `cd mysite`
  `bun start`

Happy building awesome websites!

With the --package-manager flag.

$ node bin/index.js --package-manager bun
✔ What should we name this site? … mysite2
✔ Select a template below... › classic (recommended)
✔ This template is available in TypeScript. Do you want to use the TS variant? … yes
[INFO] Creating new Docusaurus project...
[INFO] Installing dependencies with bun...
bun install v0.7.4 (f74585ff)
 Resolving dependencies
 Resolved, downloaded and extracted [900]
 Saved lockfile
 + @docusaurus/[email protected]
 + @docusaurus/[email protected]
 + @docusaurus/[email protected]
 + @docusaurus/[email protected]
 + @mdx-js/[email protected]
 + [email protected]
 + [email protected]
 + [email protected]
 + [email protected]

 1099 packages installed [2.42s]
[SUCCESS] Created mysite2.

Detecting bun.lockb in the current repo:

$ touch bun.lockb
$ node bin/index.js --package-manager bun
✔ What should we name this site? … mysite3
✔ Select a template below... › classic (recommended)
✔ This template is available in TypeScript. Do you want to use the TS variant? … yes
[INFO] Creating new Docusaurus project...
[INFO] Installing dependencies with bun...
bun install v0.7.4 (f74585ff)
 Saved lockfile
 + @docusaurus/[email protected]
 + @docusaurus/[email protected]
 + @docusaurus/[email protected]
 + @docusaurus/[email protected]
 + @mdx-js/[email protected]
 + [email protected]
 + [email protected]
 + [email protected]
 + [email protected]

 1099 packages installed [736.00ms]
[SUCCESS] Created mysite3.

Test links

Deploy preview:

Related issues/PRs

@netlify
Copy link

netlify bot commented Aug 18, 2023

[V2]

Built without sensitive environment variables

Name Link
🔨 Latest commit ac7e9fb
🔍 Latest deploy log https://app.netlify.com/sites/docusaurus-2/deploys/64df0fe2cbb8190008f0665a
😎 Deploy Preview https://deploy-preview-9241--docusaurus-2.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site configuration.

@github-actions
Copy link

⚡️ Lighthouse report for the deploy preview of this PR

URL Performance Accessibility Best Practices SEO PWA Report
/ 🟠 89 🟢 97 🟢 92 🟢 100 🟠 89 Report
/docs/installation 🟠 70 🟢 98 🟢 92 🟢 100 🟠 89 Report

Copy link
Collaborator

@Josh-Cena Josh-Cena 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 the contribution, Colin! The implementation looks good to me.

@slorber slorber added the pr: new feature This PR adds a new API or behavior. label Aug 24, 2023
@slorber
Copy link
Collaborator

slorber commented Aug 24, 2023

LGTM thanks 👍

@slorber slorber merged commit 13a8ba1 into facebook:main Aug 24, 2023
28 of 29 checks passed
This was referenced Oct 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
CLA Signed Signed Facebook CLA pr: new feature This PR adds a new API or behavior.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants