Skip to content

Commit

Permalink
chore: add yarn scripts to simplify docs contribution (#6296)
Browse files Browse the repository at this point in the history
  • Loading branch information
nflaig authored Jan 15, 2024
1 parent edd83cb commit bf4969f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 8 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/docs-check.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,12 +39,12 @@ jobs:
run: scripts/wordlist_sort_check.sh

- name: Build and collect docs
run: yarn build:docs
run: yarn docs:build

# Run prettier check with fix after generating the docs. The CLI reference is formatted with prettier for
# deployed version so this will fail if not "fixable"
- name: Check docs format
run: yarn lint-docs:fix
run: yarn docs:lint:fix

# Run spellcheck AFTER building docs, in case the CLI reference has issues
- name: Spellcheck
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ jobs:
if: steps.cache-deps.outputs.cache-hit == 'true'

- name: Build and collect docs
run: yarn build:docs
run: yarn docs:build

- name: Lint built docs
run: yarn lint-docs:fix
run: yarn docs:lint:fix

- name: Set up Python
uses: actions/setup-python@v1
Expand Down
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,19 +11,21 @@
"clean": "rm -rf ./packages/*/lib ./packages/*/*.tsbuildinfo",
"clean:nm": "rm -rf ./packages/*/node_modules ./node_modules",
"build": "lerna run build",
"build:docs": "lerna run check-readme && lerna run build:docs && ./scripts/prepare-docs.sh",
"build:watch": "lerna exec --parallel -- 'yarn run build:watch'",
"build:ifchanged": "lerna exec -- ../../scripts/build_if_changed.sh",
"lint": "eslint --color --ext .ts packages/*/src packages/*/test",
"lint:fix": "yarn lint --fix",
"lint-docs": "prettier '**/*.md' --check",
"lint-docs:fix": "prettier '**/*.md' --write",
"lint-dashboards": "node scripts/lint-grafana-dashboards.mjs ./dashboards",
"check-build": "lerna run check-build",
"check-readme": "lerna run check-readme",
"check-types": "lerna run check-types",
"check-spelling": "pyspelling -c .pyspelling.yml -v",
"coverage": "lerna run coverage",
"docs:install": "pip install --user -r docs/requirements.txt",
"docs:build": "lerna run check-readme && lerna run docs:build && ./scripts/prepare-docs.sh",
"docs:lint": "prettier '**/*.md' --check",
"docs:lint:fix": "prettier '**/*.md' --write",
"docs:serve": "mkdocs serve --watch docs/pages --config-file docs/mkdocs.yml",
"test": "lerna run test --concurrency 1",
"test:unit": "lerna run test:unit --concurrency 1",
"test:browsers": "lerna run test:browsers",
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,10 +24,10 @@
"build": "tsc -p tsconfig.build.json && yarn write-git-data",
"build:release": "yarn clean && yarn run build",
"build:watch": "tsc -p tsconfig.build.json --watch",
"build:docs": "node --loader ts-node/esm ./docsgen/index.ts",
"write-git-data": "node lib/util/gitData/writeGitData.js",
"check-build": "node -e \"(async function() { await import('./lib/index.js') })()\" lodestar --help",
"check-types": "tsc",
"docs:build": "node --loader ts-node/esm ./docsgen/index.ts",
"lint": "eslint --color --ext .ts src/ test/",
"lint:fix": "yarn run lint --fix",
"pretest": "yarn run check-types",
Expand Down

0 comments on commit bf4969f

Please sign in to comment.