Skip to content

Commit

Permalink
fix: add prebuild:docs script to ensure dependencies are installed (#227
Browse files Browse the repository at this point in the history
)
  • Loading branch information
pevisscher authored Dec 27, 2024
1 parent d7357c7 commit c3b70fb
Show file tree
Hide file tree
Showing 5 changed files with 6 additions and 2 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/reusable-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ jobs:
env:
GITHUB_NPM_TOKEN: ${{ secrets.GITHUB_NPM_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
- run: node --run build:docs
- run: npm run build:docs
- name: Upload artifact
uses: actions/upload-pages-artifact@v3
with:
Expand Down
3 changes: 2 additions & 1 deletion examples/yargs-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,8 @@
"lint:fix": "node --run lint -- --write --unsafe",
"package": "rm -rf .dist && node --run build",
"prepare": "husky || true",
"test": "vitest run"
"test": "vitest run",
"prebuild:docs": "npm ci"
},
"dependencies": {
"yargs": "^17.7.2"
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@
"files": ["bin", ".dist", "biome.json", "package.json", "release.config.cjs", "templates", "examples", "tsconfig.base.json"],
"scripts": {
"build": "tsc -p tsconfig.dist.json",
"prebuild:docs": "npm ci",
"build:docs": "npx typedoc",
"check:coverage": "vitest run --coverage=true",
"check:project": "node-standards lint",
Expand Down
1 change: 1 addition & 0 deletions src/lib/templates/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ export const CommonTypescriptTemplate: ProjectTemplateBuilder = {
scripts: {
build: 'tsc -p tsconfig.dist.json',
'build:clean': undefined,
'prebuild:docs': 'npm ci',
'build:docs': 'npx typedoc',
'check:cost': undefined,
'check:coverage': 'vitest run --coverage=true',
Expand Down
1 change: 1 addition & 0 deletions src/lib/templates/docusaurus.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ export const DocusaurusTemplate: ProjectTemplate = {
template: {
repositoryUrl,
scripts: {
'prebuild:docs': undefined,
'build:docs': 'npm run --prefix=docs build',
},
devDependencies: {},
Expand Down

0 comments on commit c3b70fb

Please sign in to comment.