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 in create-gatsby #38471

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

colinhacks
Copy link

Description

Detect bun in npm_config_user_agent; if detected, use bun for package management.

Documentation

Tests

Tests have been added in packages/create-gatsby/src/__tests__.

Here's a successful run on my local machine detecting bun in the user agent. Bun is uses to install the packages and the printed command for starting the dev server is bun run develop.

$ npm_config_user_agent=bun/1.0 node cli.js
create-gatsby version 3.13.0-next.0



                                                                                        Welcome to Gatsby!



This command will generate a new Gatsby site for you in /Users/colinmcd94/Documents/repos/gatsby/packages/create-gatsby with the setup you select. Let's answer some questions:


What would you like to call your site?
✔ · asd
What would you like to name the folder where your site will be created?
✔ create-gatsby/ asdf
✔ Will you be using JavaScript or TypeScript?
· JavaScript
✔ Will you be using a CMS?
· No (or I'll add it later)
✔ Would you like to install a styling system?
· No (or I'll add it later)
✔ Would you like to install additional features with other plugins?
· Add the Google gtag script for e.g. Google Analytics
· Add responsive images
· Add an automatic sitemap
· Generate a manifest file
· Add Markdown and MDX support


Thanks! Here's what we'll now do:

    🛠  Create a new Gatsby site in the folder asdf
    🔌 Install gatsby-plugin-google-gtag, gatsby-plugin-image, gatsby-plugin-sitemap, gatsby-plugin-manifest, gatsby-plugin-mdx
  
✔ Shall we do this? (Y/n) · Yes
✔ Created site from template
❯ Installing Gatsby...
✔ Installed plugins
✔ Created site in asdf
🔌 Setting-up plugins...
info Adding gatsby-plugin-google-gtag
info Adding gatsby-plugin-image
info Adding gatsby-plugin-sitemap
info Adding gatsby-plugin-manifest
info Adding gatsby-plugin-mdx
info Adding gatsby-plugin-sharp
info Adding gatsby-transformer-sharp
info Adding gatsby-source-filesystem
info Adding gatsby-source-filesystem
info Installed gatsby-plugin-google-gtag in gatsby-config
success Adding gatsby-plugin-google-gtag to gatsby-config - 0.086s
info Installed gatsby-plugin-image in gatsby-config
success Adding gatsby-plugin-image to gatsby-config - 0.088s
info Installed gatsby-plugin-sitemap in gatsby-config
success Adding gatsby-plugin-sitemap to gatsby-config - 0.090s
info Installed gatsby-plugin-manifest in gatsby-config
success Adding gatsby-plugin-manifest to gatsby-config - 0.100s
info Installed gatsby-plugin-mdx in gatsby-config
success Adding gatsby-plugin-mdx to gatsby-config - 0.102s
info Installed gatsby-plugin-sharp in gatsby-config
success Adding gatsby-plugin-sharp to gatsby-config - 0.104s
info Installed gatsby-transformer-sharp in gatsby-config
success Adding gatsby-transformer-sharp to gatsby-config - 0.106s
info Installed gatsby-source-filesystem in gatsby-config
success Adding gatsby-source-filesystem (images) to gatsby-config - 0.109s
info Installed gatsby-source-filesystem in gatsby-config
success Adding gatsby-source-filesystem (pages) to gatsby-config - 0.113s
🎉  Your new Gatsby site asd has been successfully created
at /Users/colinmcd94/Documents/repos/gatsby/packages/create-gatsby/asdf.
Start by going to the directory with

  cd asdf

Start the local development server with

  bun run develop

See all commands at

  https://www.gatsbyjs.com/docs/reference/gatsby-cli/
@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Aug 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer
1 participant