Improve website DX sightly (#17940)

Co-authored-by: fisker <lionkay@gmail.com>
This commit is contained in:
Tatsunori Uchinoandfisker authored and GitHub committed 2025-09-23 17:39:18 +08:00
1 parent c9df58f5f9
commit 70ec01f41a
3 files changed
+12 -8

No files matched your search

+1
View File
@@ -189,6 +189,7 @@
"fix:prettier": "yarn lint:prettier --write", "fix:prettier": "yarn lint:prettier --write",
"build": "node ./scripts/build/build.js", "build": "node ./scripts/build/build.js",
"build:website": "node ./scripts/build-website.js", "build:website": "node ./scripts/build-website.js",
"build:website:pr": "cross-env PULL_REQUEST=true yarn build:website",
"gen:changelog": "node ./scripts/generate-changelog.js", "gen:changelog": "node ./scripts/generate-changelog.js",
"debug": "node bin/prettier.js --ignore-path=.prettierignore --plugin=./packages/plugin-oxc/index.js --plugin=./packages/plugin-hermes/index.js", "debug": "node bin/prettier.js --ignore-path=.prettierignore --plugin=./packages/plugin-oxc/index.js --plugin=./packages/plugin-hermes/index.js",
"debug:watch": "node --watch bin/prettier.js --ignore-path=.prettierignore --plugin=./packages/plugin-oxc/index.js --plugin=./packages/plugin-hermes/index.js", "debug:watch": "node --watch bin/prettier.js --ignore-path=.prettierignore --plugin=./packages/plugin-oxc/index.js --plugin=./packages/plugin-hermes/index.js",
+1 -1
View File
@@ -11,7 +11,7 @@ https://prettier.io/
yarn build:website yarn build:website
``` ```
To build for the current branch, use `PULL_REQUEST=true yarn build:website`. Otherwise, a release version of Prettier from `node_modules` is used. To build for the current branch, use `yarn build:website:pr`. Otherwise, a release version of Prettier from `node_modules` is used.
2. Switch to the `website` directory and start the development server: 2. Switch to the `website` directory and start the development server:
+10 -7
View File
@@ -18,13 +18,16 @@ await fs.rm(STABLE_DOCS_DIRECTORY, { recursive: true, force: true });
await fs.mkdir(STABLE_DOCS_DIRECTORY, { recursive: true, force: true }); await fs.mkdir(STABLE_DOCS_DIRECTORY, { recursive: true, force: true });
await fs.cp(CURRENT_DOCS_DIRECTORY, STABLE_DOCS_DIRECTORY, { recursive: true }); await fs.cp(CURRENT_DOCS_DIRECTORY, STABLE_DOCS_DIRECTORY, { recursive: true });
// Replace version placeholders // PRETTIER_VERSION when PULL_REQUEST exists is a temporary one
await Promise.all( if (process.env.PULL_REQUEST !== "true") {
["browser.md"].map(async (file) => { // Replace version placeholders
file = new URL(file, STABLE_DOCS_DIRECTORY); await Promise.all(
await replaceVersionPlaceholder(file, version); ["browser.md"].map(async (file) => {
}), file = new URL(file, STABLE_DOCS_DIRECTORY);
); await replaceVersionPlaceholder(file, version);
}),
);
}
async function getPrettierVersion() { async function getPrettierVersion() {
const version = process.env.PRETTIER_VERSION; const version = process.env.PRETTIER_VERSION;