Improve website DX sightly (#17940)
Co-authored-by: fisker <lionkay@gmail.com>
This commit is contained in:
1 parent
c9df58f5f9
commit
70ec01f41a
3 files changed
+5
-1
No files matched your search
@@ -189,6 +189,7 @@
|
||||
"fix:prettier": "yarn lint:prettier --write",
|
||||
"build": "node ./scripts/build/build.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",
|
||||
"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",
|
||||
|
||||
+1
-1
@@ -11,7 +11,7 @@ https://prettier.io/
|
||||
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:
|
||||
|
||||
|
||||
@@ -18,6 +18,8 @@ await fs.rm(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 });
|
||||
|
||||
// PRETTIER_VERSION when PULL_REQUEST exists is a temporary one
|
||||
if (process.env.PULL_REQUEST !== "true") {
|
||||
// Replace version placeholders
|
||||
await Promise.all(
|
||||
["browser.md"].map(async (file) => {
|
||||
@@ -25,6 +27,7 @@ await Promise.all(
|
||||
await replaceVersionPlaceholder(file, version);
|
||||
}),
|
||||
);
|
||||
}
|
||||
|
||||
async function getPrettierVersion() {
|
||||
const version = process.env.PRETTIER_VERSION;
|
||||
|
||||
Reference in new issue
Block a user