Skip to content

Commit

Permalink
Fix doc generation build dependencies
Browse files Browse the repository at this point in the history
To generate documentation we need to make sure that we have set up the
`node_modules` for each of our packages so `typedoc` can run.
  • Loading branch information
elliotgoodrich committed Jul 3, 2024
1 parent a3a18fd commit 42295d6
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 15 deletions.
30 changes: 15 additions & 15 deletions .github/workflows/documentation.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,30 +6,30 @@ on:
- main

jobs:
build:
deploy:
runs-on: ubuntu-latest
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: latest
cache: 'npm'
- uses: seanmiddleditch/gha-setup-ninja@master
- run: cd configure && npm ci
- run: npm run configure
- run: ninja
- run: ninja -k 0 prep-for-docs
- run: npm run docs
- uses: actions/upload-pages-artifact@v3
with:
path: "./docs"
deploy:
runs-on: ubuntu-latest
needs: build
# Grant GITHUB_TOKEN the permissions required to make a Pages deployment
permissions:
pages: write
id-token: write
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v4
6 changes: 6 additions & 0 deletions configure/configure.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -247,6 +247,8 @@ format({ in: "configure/configure.mjs" });

const baseConfig = format({ in: "tsconfig.json" });

const docsDependencies = [];

const scope = "@ninjutsu-build/";
for (const cwd of workspaceJSON.workspaces) {
const localPKGJSON = JSON.parse(
Expand Down Expand Up @@ -320,6 +322,8 @@ for (const cwd of workspaceJSON.workspaces) {
in: [packageJSON, ...typeDeclarations].map(getOrderOnlyDeps),
});

docsDependencies.push(packageHasTypes);

// Type check all the tests
const testTargets = await (async () => {
if (!existsSync(join(cwd, "tsconfig.tests.json"))) {
Expand Down Expand Up @@ -393,4 +397,6 @@ for (const cwd of workspaceJSON.workspaces) {
});
}

phony({ out: "prep-for-docs", in: docsDependencies });

writeFileSync("build.ninja", ninja.output);

0 comments on commit 42295d6

Please sign in to comment.