From 6887d6206944bc165b55d85467ff25933e2911cf Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Fri, 19 Apr 2024 11:47:44 +0800 Subject: [PATCH 1/3] chore: update docs script --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index ec47953defb963..5a887a4dc616fd 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "test-docs": "pnpm run docs-build", "debug-serve": "VITE_DEBUG_SERVE=1 vitest run -c vitest.config.e2e.ts", "debug-build": "VITE_TEST_BUILD=1 VITE_PRESERVE_BUILD_ARTIFACTS=1 vitest run -c vitest.config.e2e.ts", - "docs": "pnpm --filter=docs run docs", + "docs": "pnpm build && pnpm --filter=docs run docs", "docs-build": "pnpm --filter=docs run docs-build", "docs-serve": "pnpm --filter=docs run docs-serve", "build": "pnpm -r --filter='./packages/*' run build", From 4e2f832a6187ecb2b74c8a7a2c3b40946e6c6656 Mon Sep 17 00:00:00 2001 From: btea <2356281422@qq.com> Date: Tue, 30 Apr 2024 09:24:14 +0800 Subject: [PATCH 2/3] chore: update --- CONTRIBUTING.md | 10 +++++++++- package.json | 2 +- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 4a7e364a42be68..9b05265bbf28e8 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,6 +31,14 @@ To make this file used by `git blame`, you need to run the following command. git config --local blame.ignoreRevsFile .git-blame-ignore-revs ``` +## docs + +For local development check out the documentation: + +1. Run `pnpm run build` in Vite's root folder.(Since `twoslash` is configured in the document, to prevent errors, perform a global build before starting the document) + +2. Run `pnpm run docs` in Vite's root folder.. + ## Debugging To use breakpoints and explore code execution, you can use the ["Run and Debug"](https://code.visualstudio.com/docs/editor/debugging) feature from VS Code. @@ -166,7 +174,7 @@ For a mock dependency, make sure you add a `@vitejs/test-` prefix to the package ## Debug Logging -You can set the `DEBUG` environment variable to turn on debugging logs (e.g. `DEBUG="vite:resolve"`). To see all debug logs, you can set `DEBUG="vite:*"`, but be warned that it will be quite noisy. You can run `grep -r "createDebugger('vite:" packages/vite/src/` to see a list of available debug scopes. +You can set the `--debug` option to turn on debugging logs (e.g. `vite --debug resolve`). To see all debug logs, you can set `vite --debug *`, but be warned that it will be quite noisy. You can run `grep -r "createDebugger('vite:" packages/vite/src/` to see a list of available debug scopes. ## Pull Request Guidelines diff --git a/package.json b/package.json index 5a887a4dc616fd..ec47953defb963 100644 --- a/package.json +++ b/package.json @@ -30,7 +30,7 @@ "test-docs": "pnpm run docs-build", "debug-serve": "VITE_DEBUG_SERVE=1 vitest run -c vitest.config.e2e.ts", "debug-build": "VITE_TEST_BUILD=1 VITE_PRESERVE_BUILD_ARTIFACTS=1 vitest run -c vitest.config.e2e.ts", - "docs": "pnpm build && pnpm --filter=docs run docs", + "docs": "pnpm --filter=docs run docs", "docs-build": "pnpm --filter=docs run docs-build", "docs-serve": "pnpm --filter=docs run docs-serve", "build": "pnpm -r --filter='./packages/*' run build", From dd281ebcb9ddf958edcc22859583d89b3b80f6f6 Mon Sep 17 00:00:00 2001 From: Bjorn Lu Date: Tue, 30 Apr 2024 15:38:02 +0800 Subject: [PATCH 3/3] docs: update --- CONTRIBUTING.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 9b05265bbf28e8..f624e76897e578 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -31,13 +31,13 @@ To make this file used by `git blame`, you need to run the following command. git config --local blame.ignoreRevsFile .git-blame-ignore-revs ``` -## docs +## Documentation -For local development check out the documentation: +To develop the `docs/` site: -1. Run `pnpm run build` in Vite's root folder.(Since `twoslash` is configured in the document, to prevent errors, perform a global build before starting the document) +1. Run `pnpm run build` in Vite's root folder. This will generate the types for `twoslash` to work in the code examples. If the types are not available, errors will be logged in step 2 but does not prevent the site from working. -2. Run `pnpm run docs` in Vite's root folder.. +2. Run `pnpm run docs` in Vite's root folder. ## Debugging