chore: rename docusaurus-2-website package + refactor scripts (#5397)

This commit is contained in:
Sébastien Lorber 2021-08-20 18:11:13 +02:00 committed by GitHub
parent 8e1cde135c
commit 631c4685fb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
8 changed files with 38 additions and 38 deletions

View file

@ -20,4 +20,4 @@ jobs:
with:
install-command: yarn
- name: Build blog-only
run: yarn workspace docusaurus-2-website build:blogOnly
run: yarn workspace website build:blogOnly

View file

@ -24,7 +24,7 @@ jobs:
- uses: preactjs/compressed-size-action@v2
with:
repo-token: '${{ secrets.GITHUB_TOKEN }}'
build-script: 'build:v2:en'
build-script: 'build:website:en'
pattern: '{website/build/assets/js/main*js,website/build/assets/css/styles*css,website/.docusaurus/globalData.json,website/build/index.html,website/build/blog/index.html,website/build/blog/**/introducing-docusaurus/*,website/build/docs/index.html,website/build/docs/installation/index.html,website/build/tests/docs/index.html,website/build/tests/docs/standalone/index.html}'
strip-hash: '\.([^;]\w{7})\.'
minimum-change-threshold: 30

View file

@ -24,11 +24,11 @@ jobs:
# Ensure build with a cold cache does not increase too much
- name: Build (cold cache)
run: yarn workspace docusaurus-2-website build --locale en
run: yarn workspace website build --locale en
timeout-minutes: 8
# Ensure build with a warm cache does not increase too much
- name: Build (warm cache)
run: yarn workspace docusaurus-2-website build --locale en
run: yarn workspace website build --locale en
timeout-minutes: 2
# TODO post a Github comment with build with perf warnings?

View file

@ -31,7 +31,7 @@ jobs:
install-command: yarn
- name: Generate test-website project against main branch
run: |
KEEP_CONTAINER=true yarn test:build:v2 -s
KEEP_CONTAINER=true yarn test:build:website -s
mv test-website ../test-website
- name: Install test-website project with Yarn v1
run: |
@ -68,7 +68,7 @@ jobs:
- name: Generate test-website project against main branch
run: |
KEEP_CONTAINER=true yarn test:build:v2 -s
KEEP_CONTAINER=true yarn test:build:website -s
mv test-website ../test-website
- name: Install test-website project with Yarn Berry and nodeLinker = ${{ matrix.nodeLinker }}
run: |

View file

@ -29,6 +29,6 @@ jobs:
- name: Docusaurus Jest Tests
run: yarn test
- name: Docusaurus Build
run: yarn build:v2 --locale en
run: yarn build:website --locale en
env:
CI: true

View file

@ -57,7 +57,7 @@ yarn install
```sh
# This will build all the packages and publish them in a local Verdaccio npm registry
# and then initialize a new website in the `test-website` directory using those locally published packages
yarn test:build:v2
yarn test:build:website
# Now you can test the site in dev/prod mode
cd test-website
@ -103,7 +103,7 @@ yarn changelog --from v2.0.0-beta.0
### 4. Cut a new version of the docs
```sh
yarn workspace docusaurus-2-website docusaurus docs:version 2.0.0-beta.0
yarn workspace website docusaurus docs:version 2.0.0-beta.0
```
Test running the website with the new version locally.

View file

@ -7,30 +7,30 @@
"admin/new.docusaurus.io"
],
"scripts": {
"start": "yarn build:packages && yarn start:v2",
"start:v2": "yarn workspace docusaurus-2-website start",
"start:v2:watch": "nodemon --watch \"./packages/*/lib/**/*.*\" --exec \"yarn start:v2\"",
"start:v2:baseUrl": "yarn workspace docusaurus-2-website start:baseUrl",
"start:v2:bootstrap": "yarn workspace docusaurus-2-website start:bootstrap",
"start:v2:blogOnly": "yarn workspace docusaurus-2-website start:blogOnly",
"start:v2:deployPreview": "cross-env NETLIFY=true CONTEXT='deploy-preview' yarn workspace docusaurus-2-website start",
"start": "yarn build:packages && yarn start:website",
"start:website": "yarn workspace website start",
"start:website:watch": "nodemon --watch \"./packages/*/lib/**/*.*\" --exec \"yarn start:website\"",
"start:website:baseUrl": "yarn workspace website start:baseUrl",
"start:website:bootstrap": "yarn workspace website start:bootstrap",
"start:website:blogOnly": "yarn workspace website start:blogOnly",
"start:website:deployPreview": "cross-env NETLIFY=true CONTEXT='deploy-preview' yarn workspace website start",
"examples:generate": "node generateExamples",
"build": "yarn build:packages && yarn build:v2",
"build": "yarn build:packages && yarn build:website",
"build:packages": "lerna run build --no-private",
"build:v2": "yarn workspace docusaurus-2-website build",
"build:v2:baseUrl": "yarn workspace docusaurus-2-website build:baseUrl",
"build:v2:blogOnly": "yarn workspace docusaurus-2-website build:blogOnly",
"build:v2:deployPreview": "cross-env NETLIFY=true CONTEXT='deploy-preview' yarn workspace docusaurus-2-website build",
"build:v2:en": "yarn workspace docusaurus-2-website build --locale en",
"clear:v2": "yarn workspace docusaurus-2-website clear",
"serve:v2": "yarn workspace docusaurus-2-website serve",
"serve:v2:baseUrl": "serve website",
"serve:v2:ssl": "yarn serve:v2:ssl:gencert && yarn serve:v2:ssl:message && yarn serve:v2:ssl:serve",
"serve:v2:ssl:gencert": "openssl req -x509 -nodes -days 365 -newkey rsa:4096 -subj \"/C=US/ST=Docusaurus/L=Anywhere/O=Dis/CN=localhost\" -keyout ./website/.docusaurus/selfsigned.key -out ./website/.docusaurus/selfsigned.crt",
"serve:v2:ssl:message": "echo '\n\n\nServing Docusaurus with HTTPS on localhost requires to disable the Chrome security: chrome://flags/#allow-insecure-localhost\n\n\n'",
"serve:v2:ssl:serve": "serve website/build --ssl-cert ./website/.docusaurus/selfsigned.crt --ssl-key ./website/.docusaurus/selfsigned.key",
"crowdin:upload:v2": "crowdin upload sources --config ./crowdin-v2.yaml",
"crowdin:download:v2": "crowdin download --config ./crowdin-v2.yaml",
"build:website": "yarn workspace website build",
"build:website:baseUrl": "yarn workspace website build:baseUrl",
"build:website:blogOnly": "yarn workspace website build:blogOnly",
"build:website:deployPreview": "cross-env NETLIFY=true CONTEXT='deploy-preview' yarn workspace website build",
"build:website:en": "yarn workspace website build --locale en",
"clear:website": "yarn workspace website clear",
"serve:website": "yarn workspace website serve",
"serve:website:baseUrl": "serve website",
"serve:website:ssl": "yarn serve:website:ssl:gencert && yarn serve:website:ssl:message && yarn serve:website:ssl:serve",
"serve:website:ssl:gencert": "openssl req -x509 -nodes -days 365 -newkey rsa:4096 -subj \"/C=US/ST=Docusaurus/L=Anywhere/O=Dis/CN=localhost\" -keyout ./website/.docusaurus/selfsigned.key -out ./website/.docusaurus/selfsigned.crt",
"serve:website:ssl:message": "echo '\n\n\nServing Docusaurus with HTTPS on localhost requires to disable the Chrome security: chrome://flags/#allow-insecure-localhost\n\n\n'",
"serve:website:ssl:serve": "serve website/build --ssl-cert ./website/.docusaurus/selfsigned.crt --ssl-key ./website/.docusaurus/selfsigned.key",
"crowdin:upload:website": "crowdin upload sources --config ./crowdin-v2.yaml",
"crowdin:download:website": "crowdin download --config ./crowdin-v2.yaml",
"canary": "yarn canary:bumpVersion && yarn canary:publish",
"canary:version": "echo 0.0.0-`git rev-list --count HEAD`+`git rev-parse --short HEAD`",
"canary:bumpVersion": "yarn lerna version `yarn --silent canary:version` --exact --no-push --yes",
@ -49,10 +49,10 @@
"lint:style": "stylelint \"**/*.css\"",
"lerna": "lerna",
"test": "cross-env TZ=UTC jest",
"test:build:v2": "./admin/scripts/test-release.sh",
"test:build:website": "./admin/scripts/test-release.sh",
"watch": "yarn lerna run --parallel --no-private watch",
"clear": "(yarn workspace docusaurus-2-website clear || echo 'Failure while running docusaurus clear') && yarn lerna exec --ignore docusaurus yarn rimraf lib lib-next",
"test:baseUrl": "yarn build:v2:baseUrl && yarn serve:v2:baseUrl",
"clear": "(yarn workspace website clear || echo 'Failure while running docusaurus clear') && yarn lerna exec --ignore docusaurus yarn rimraf lib lib-next",
"test:baseUrl": "yarn build:website:baseUrl && yarn serve:website:baseUrl",
"lock:update": "npx yarn-deduplicate"
},
"devDependencies": {

View file

@ -1,5 +1,5 @@
{
"name": "docusaurus-2-website",
"name": "website",
"version": "2.0.0-beta.4",
"private": true,
"scripts": {
@ -22,9 +22,9 @@
"netlify:build:deployPreview": "yarn docusaurus write-translations --locale fr --messagePrefix '(fr) ' && yarn build",
"netlify:crowdin:delay": "node delayCrowdin.js",
"netlify:crowdin:wait": "node waitForCrowdin.js",
"netlify:crowdin:downloadTranslations": "yarn netlify:crowdin:wait && yarn --cwd .. crowdin:download:v2",
"netlify:crowdin:downloadTranslationsFailSafe": "yarn netlify:crowdin:wait && (yarn --cwd .. crowdin:download:v2 || echo 'Crowdin translation download failure (only internal PRs have access to the Crowdin env token)')",
"netlify:crowdin:uploadSources": "yarn --cwd .. crowdin:upload:v2",
"netlify:crowdin:downloadTranslations": "yarn netlify:crowdin:wait && yarn --cwd .. crowdin:download:website",
"netlify:crowdin:downloadTranslationsFailSafe": "yarn netlify:crowdin:wait && (yarn --cwd .. crowdin:download:website || echo 'Crowdin translation download failure (only internal PRs have access to the Crowdin env token)')",
"netlify:crowdin:uploadSources": "yarn --cwd .. crowdin:upload:website",
"netlify:test": "yarn netlify:build:deployPreview && yarn netlify dev --debug"
},
"dependencies": {