Merge pull request #19297 from antobinary/docs-drop-yarn

docs: use npm only - drop yarn
This commit is contained in:
Anton Georgiev 2023-12-06 15:48:02 -05:00 committed by GitHub
commit 30524c1ee0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
8 changed files with 594 additions and 9042 deletions

View File

@ -25,17 +25,17 @@ jobs:
- uses: actions/checkout@v3 - uses: actions/checkout@v3
- uses: actions/setup-node@v3 - uses: actions/setup-node@v3
with: with:
node-version: 18 node-version: 20
cache: yarn cache: npm
cache-dependency-path: ./docs/yarn.lock cache-dependency-path: ./docs/package-lock.json
- name: Install dependencies - name: Install dependencies
run: yarn install --frozen-lockfile run: npm ci
# Build static docs # Build static docs
- name: Build all versions - name: Build all versions
run: ./build.sh run: ./build.sh
- name: Build website - name: Build website
run: yarn build run: npm run docusaurus build
- name: upload build artifact - name: upload build artifact
uses: actions/upload-pages-artifact@v1 uses: actions/upload-pages-artifact@v1
with: with:

View File

@ -5,11 +5,34 @@ and GitHub Actions (see [deploy-docs.yml](../.github/workflows/deploy-docs.yml))
## Local Development ## Local Development
To test build the docs locally you can either use `yarn` or `npm`. To test build the docs locally use:
```bash
$ npm ci # install docusaurus and dependencies (based on the package-lock.json file)
$ npx docusaurus start # start local dev server
```
By default `docusaurus.config.js` contains instructions for the building of a few extra branches. You may want to drop all but the current branch. For example:
``` ```
$ yarn install # install docusaurus and dependencies diff --git a/docs/docusaurus.config.js b/docs/docusaurus.config.js
$ yarn start # start local dev server index 50b72b12ec..04f360a955 100644
--- a/docs/docusaurus.config.js
+++ b/docs/docusaurus.config.js
@@ -38,12 +38,6 @@ const config = {
lastVersion: '2.7',
includeCurrentVersion: false,
versions: {
- '2.5-legacy': {
- banner: 'none'
- },
- '2.6': {
- banner: 'none'
- },
'2.7': {
banner: 'none'
},
``` ```
The last command starts a local development server and opens up a browser window. The last command starts a local development server and opens up a browser window.
@ -23,15 +46,15 @@ otherwise git will refuse to change branches.
This step is optional and if you don't run it, docusaurus will only build the This step is optional and if you don't run it, docusaurus will only build the
currently checkout out version which is recommended for local development currently checkout out version which is recommended for local development
(building all the versions locally can lead to problems with the live (building all the versions locally can lead to problems with the live
updates when using `yarn start`). updates when using `npx docusaurus start`).
### Build ### Build
If you only want to build the docs you can run: If you only want to build the docs you can run:
``` ```
$ yarn clear # ensure cached content is not interfering with your changes $ npm clear # ensure cached content is not interfering with your changes
$ yarn build $ npx docusaurus build
``` ```
This command generates static content into the `build` directory This command generates static content into the `build` directory
@ -44,7 +67,7 @@ in development or when building the docs.
To avoid this you can run: To avoid this you can run:
``` ```
$ yarn clear # ensure cached content is not interfering with your changes $ npx docusaurus clear # ensure cached content is not interfering with your changes
$ rm -r versioned_docs versioned_sidebars versions.json # if you build multiple versions $ rm -r versioned_docs versioned_sidebars versions.json # if you build multiple versions
``` ```

5
docs/build.sh Executable file → Normal file
View File

@ -13,7 +13,6 @@ TAGS=(
BRANCHES=( BRANCHES=(
v2.6.x-release v2.6.x-release
v2.7.x-release v2.7.x-release
# v2.8.x-release
) )
REMOTE="origin" REMOTE="origin"
@ -31,7 +30,7 @@ for tag in "${TAGS[@]}"; do
if [ -f docusaurus.config.js ]; then if [ -f docusaurus.config.js ]; then
version=${tag:1:3}-legacy version=${tag:1:3}-legacy
echo "Adding documentation for $version" echo "Adding documentation for $version"
yarn docusaurus docs:version "${version}" npm run docusaurus docs:version "${version}"
else else
echo "Warning: branch/tag $(version) does not contain a docusaurus.config.js!" echo "Warning: branch/tag $(version) does not contain a docusaurus.config.js!"
fi fi
@ -48,7 +47,7 @@ for branch in "${BRANCHES[@]}"; do
if [ -f docusaurus.config.js ]; then if [ -f docusaurus.config.js ]; then
version=${branch:1:3} version=${branch:1:3}
echo "Adding documentation for $version" echo "Adding documentation for $version"
yarn docusaurus docs:version "${version}" npm run docusaurus docs:version "${version}"
else else
echo "Warning: branch $(branch) does not contain a docusaurus.config.js!" echo "Warning: branch $(branch) does not contain a docusaurus.config.js!"
fi fi

View File

@ -237,7 +237,7 @@ In Greenlight, room URLs contain the username of the owner, which might also be
### Terms of Service ### Terms of Service
Greenlight supports displaying of terms and conditions for registered users or upon registration. See [adding-terms-and-conditions](/greenlight/config#adding-terms-and-conditions) Greenlight supports displaying of terms and conditions for registered users or upon registration.
### All recordings are always accessible ### All recordings are always accessible

View File

@ -1,8 +1,8 @@
// @ts-check // @ts-check
// Note: type annotations allow type checking and IDEs autocompletion // Note: type annotations allow type checking and IDEs autocompletion
const lightCodeTheme = require('prism-react-renderer/themes/github'); const lightCodeTheme = require('prism-react-renderer').themes.github;
const darkCodeTheme = require('prism-react-renderer/themes/dracula'); const darkCodeTheme = require('prism-react-renderer').themes.dracula;
/** @type {import('@docusaurus/types').Config} */ /** @type {import('@docusaurus/types').Config} */
const config = { const config = {

1040
docs/package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -3,32 +3,26 @@
"version": "0.0.1", "version": "0.0.1",
"private": false, "private": false,
"scripts": { "scripts": {
"docusaurus": "docusaurus", "docusaurus": "npx docusaurus",
"start": "docusaurus start", "start": "npx docusaurus start",
"build": "docusaurus build", "build": "npx docusaurus build",
"swizzle": "docusaurus swizzle", "deploy": "npx docusaurus deploy",
"deploy": "docusaurus deploy", "serve": "npx docusaurus serve"
"clear": "docusaurus clear",
"serve": "docusaurus serve",
"write-translations": "docusaurus write-translations",
"write-heading-ids": "docusaurus write-heading-ids",
"typecheck": "tsc"
}, },
"dependencies": { "dependencies": {
"@cmfcmf/docusaurus-search-local": "^0.11.0", "@cmfcmf/docusaurus-search-local": "^1.1.0",
"@docusaurus/core": "^3.0.1", "@docusaurus/core": "3.0.1",
"@docusaurus/plugin-client-redirects": "^3.0.1", "@docusaurus/plugin-client-redirects": "^3.0.1",
"@docusaurus/preset-classic": "^3.0.1", "@docusaurus/preset-classic": "3.0.1",
"@mdx-js/react": "^1.6.22", "@mdx-js/react": "^3.0.0",
"clsx": "^1.2.1", "clsx": "^2.0.0",
"prism-react-renderer": "^1.3.5", "prism-react-renderer": "^2.3.0",
"react": "^18.0.2", "react": "^18.0.0",
"react-dom": "^18.0.2" "react-dom": "^18.0.0"
}, },
"devDependencies": { "devDependencies": {
"@docusaurus/module-type-aliases": "^3.0.1", "@docusaurus/module-type-aliases": "3.0.1",
"@tsconfig/docusaurus": "^1.0.6", "@docusaurus/types": "3.0.1"
"typescript": "^4.9.4"
}, },
"browserslist": { "browserslist": {
"production": [ "production": [
@ -43,6 +37,11 @@
] ]
}, },
"engines": { "engines": {
"node": ">=16.14" "node": ">=18.0"
},
"overrides": {
"@cmfcmf/docusaurus-search-local": {
"@docusaurus/core": "^3.0.0-rc.0"
}
} }
} }

File diff suppressed because it is too large Load Diff