feat: detect bun package manager (#2874)

pull/2880/head
Colin McDonnell 1 year ago committed by GitHub
parent 40da45d038
commit 83270fe657
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -157,6 +157,7 @@ Don't enable options like _Auto Minify_ for HTML code. It will remove comments f
with:
fetch-depth: 0 # Not needed if lastUpdated is not enabled
# - uses: pnpm/action-setup@v2 # Uncomment this if you're using pnpm
# - uses: oven-sh/setup-bun@v1 # Uncomment this if you're using Bun
- name: Setup Node
uses: actions/setup-node@v3
with:
@ -165,10 +166,10 @@ Don't enable options like _Auto Minify_ for HTML code. It will remove comments f
- name: Setup Pages
uses: actions/configure-pages@v3
- name: Install dependencies
run: npm ci # or pnpm install / yarn install
run: npm ci # or pnpm install / yarn install / bun install
- name: Build with VitePress
run: |
npm run docs:build # or pnpm docs:build / yarn docs:build
npm run docs:build # or pnpm docs:build / yarn docs:build / bun run docs:build
touch docs/.vitepress/dist/.nojekyll
- name: Upload artifact
uses: actions/upload-pages-artifact@v2

@ -29,6 +29,10 @@ $ pnpm add -D vitepress
$ yarn add -D vitepress
```
```sh [bun]
$ bun add -D vitepress
```
:::
::: details Getting missing peer deps warnings?
@ -67,6 +71,10 @@ $ npx vitepress init
$ pnpm dlx vitepress init
```
```sh [bun]
$ bunx vitepress init
```
:::
You will be greeted with a few simple questions:
@ -159,6 +167,10 @@ $ pnpm run docs:dev
$ yarn docs:dev
```
```sh [bun]
$ bun run docs:dev
```
:::
Instead of npm scripts, you can also invoke VitePress directly with:
@ -173,6 +185,10 @@ $ npx vitepress dev docs
$ pnpm exec vitepress dev docs
```
```sh [bun]
$ bunx vitepress dev docs
```
:::
More command line usage is documented in the [CLI Reference](../reference/cli).

@ -211,8 +211,9 @@ export function scaffold({
`${getPackageManger()} run docs:dev`
)} and start writing.${tip}`
} else {
const execCommand = getPackageManger() === 'bun' ? 'bunx' : 'npx'
return `You're all set! Now run ${cyan(
`npx vitepress dev${dir}`
`${execCommand} vitepress dev${dir}`
)} and start writing.${tip}`
}
}

Loading…
Cancel
Save