From e871f4326db06345fa2b8b560d65394722c73895 Mon Sep 17 00:00:00 2001 From: _Kerman Date: Wed, 29 Jan 2025 23:47:43 +0800 Subject: [PATCH] docs: PNPM as default package manager (#2027) --- CONTRIBUTING.md | 2 +- docs/features/remote-access.md | 16 ++++++++-------- docs/guide/exporting.md | 8 ++++---- docs/guide/index.md | 23 +++++++++++++++-------- docs/guide/write-theme.md | 8 ++++---- packages/create-app/template/README.md | 4 ++-- 6 files changed, 34 insertions(+), 27 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 0460de08bb..3763d29b28 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -80,7 +80,7 @@ packages parser/ - parser for Slidev's extended Markdown format create-app/ - scripts and template for `npm init slidev` create-theme/ - scripts and template for `npm init slidev-theme` - theme-*/ - official themes + vscode/ - the VSCode extension ``` ## Code Style diff --git a/docs/features/remote-access.md b/docs/features/remote-access.md index 40964cfb8b..79204db034 100644 --- a/docs/features/remote-access.md +++ b/docs/features/remote-access.md @@ -14,13 +14,13 @@ You can run your presentation with remote access by using the `--remote` flag: ::: code-group -```bash [npm] -npm run dev -- --remote +```bash [pnpm] +pnpm dev --remote # i.e. slidev --remote ``` -```bash [pnpm] -pnpm dev -- --remote +```bash [npm] +npm run dev -- --remote # i.e. slidev --remote ``` @@ -41,13 +41,13 @@ You can open a [Cloudflare Quick Tunnels](https://developers.cloudflare.com/clou ::: code-group -```bash [npm] -npm run dev -- --remote --tunnel +```bash [pnpm] +pnpm dev -- --remote --tunnel # i.e. slidev --remote --tunnel ``` -```bash [pnpm] -pnpm dev -- --remote --tunnel +```bash [npm] +npm run dev -- --remote --tunnel # i.e. slidev --remote --tunnel ``` diff --git a/docs/guide/exporting.md b/docs/guide/exporting.md index 44df12b9d9..510f68d3e1 100644 --- a/docs/guide/exporting.md +++ b/docs/guide/exporting.md @@ -26,14 +26,14 @@ Exporting to PDF, PPTX, or PNG relies on [Playwright](https://playwright.dev) fo ::: code-group -```bash [npm] -$ npm i -D playwright-chromium -``` - ```bash [pnpm] $ pnpm add -D playwright-chromium ``` +```bash [npm] +$ npm i -D playwright-chromium +``` + ```bash [yarn] $ yarn add -D playwright-chromium ``` diff --git a/docs/guide/index.md b/docs/guide/index.md index 7af49f4ac4..1c616087a3 100644 --- a/docs/guide/index.md +++ b/docs/guide/index.md @@ -46,14 +46,21 @@ Run the following command to create a new Slidev project locally: ::: code-group -```bash [npm] -npm init slidev@latest -``` - ```bash [pnpm] +# If you haven't installed pnpm +npm i -g pnpm + pnpm create slidev ``` +```bash [npm] +# Not recommended - +# NPM will download the packages each time you create a new project, +# which is slow and takes up a lot of space + +npm init slidev@latest +``` + ```bash [yarn] yarn create slidev ``` @@ -68,14 +75,14 @@ If you prefer to have a single Markdown file as your slides, you can install the ::: code-group -```bash [npm] -npm i -g @slidev/cli -``` - ```bash [pnpm] pnpm i -g @slidev/cli ``` +```bash [npm] +npm i -g @slidev/cli +``` + ```bash [yarn] yarn global add @slidev/cli ``` diff --git a/docs/guide/write-theme.md b/docs/guide/write-theme.md index 1676959c8f..cbb2b95cef 100644 --- a/docs/guide/write-theme.md +++ b/docs/guide/write-theme.md @@ -8,14 +8,14 @@ To get started, we recommend you use our generator for scaffolding your first th ::: code-group -```bash [npm] -$ npm init slidev-theme@latest -``` - ```bash [pnpm] $ pnpm create slidev-theme ``` +```bash [npm] +$ npm init slidev-theme@latest +``` + ```bash [yarn] $ yarn create slidev-theme ``` diff --git a/packages/create-app/template/README.md b/packages/create-app/template/README.md index 12a7606912..fd655d1dd4 100644 --- a/packages/create-app/template/README.md +++ b/packages/create-app/template/README.md @@ -2,8 +2,8 @@ To start the slide show: -- `npm install` -- `npm run dev` +- `pnpm install` +- `pnpm dev` - visit Edit the [slides.md](./slides.md) to see the changes.