Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

✨ Add typedocs for Interactor API back to the website. #306

Merged
merged 1 commit into from
Sep 23, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion .github/workflows/website.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -4,9 +4,12 @@ on:
push:
branches:
- main
- www # remove this branch once this is merged to main
paths:
- website/**
- packages/**/src/**
pull_request:
branches:
- main

jobs:
website:
Expand Down
9 changes: 8 additions & 1 deletion website/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@
"private": true,
"scripts": {
"start": "docusaurus start",
"build": "docusaurus build --out-dir build/interactors && node sitemap.mjs",
"build": "yarn build:docusaurus && yarn build:typedocs:html && yarn build:typedocs:mui && yarn build:sitemap",
"build:docusaurus": "docusaurus build --out-dir build/interactors",
"build:sitemap": "node sitemap.mjs",
"build:typedocs:html": "cd ../packages/html && npx typedoc --out ../../website/build/interactors/html/api --skipErrorChecking mod.ts",
"build:typedocs:mui": "cd ../packages/material-ui && npx typedoc --out ../../website/build/interactors/mui/api --skipErrorChecking mod.ts",
"serve": "docusaurus serve"
},
"dependencies": {
Expand Down Expand Up @@ -37,5 +41,8 @@
"volta": {
"node": "16.20.2",
"yarn": "1.22.22"
},
"devDependencies": {
"tinyexec": "^0.3.0"
}
}
11 changes: 11 additions & 0 deletions website/sitemap.mjs
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
/* Add indexes of all dynamically loaded assets so that they can be staticalized */

import { x } from "tinyexec";
import { readFileSync, writeFileSync, readdirSync } from "node:fs";
import { Parser, Builder } from "xml2js";

Expand All @@ -17,6 +18,16 @@ sitemap.urlset.url.push({
loc: 'https://interactors.deno.dev/interactors/images/index.html'
});


// add all of the typedoc files to the sitemap.
const docfiles = x('find', ['build/interactors/html','build/interactors/mui', '-name', '*.html']);
for await (const filename of docfiles) {
const path = filename.replace(/^build/,'');
sitemap.urlset.url.push({
loc: `https://interactors.deno.dev${path}`,
})
}

writeFileSync("./build/interactors/sitemap.xml", builder.buildObject(sitemap));

const assets = readdirSync("./build/interactors/assets/js");
Expand Down
5 changes: 5 additions & 0 deletions website/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -8902,6 +8902,11 @@ tiny-warning@^1.0.0, tiny-warning@^1.0.3:
resolved "https://registry.yarnpkg.com/tiny-warning/-/tiny-warning-1.0.3.tgz#94a30db453df4c643d0fd566060d60a875d84754"
integrity sha512-lBN9zLN/oAf68o3zNXYrdCt1kP8WsiGW8Oo2ka41b2IM5JL/S1CTyX1rW0mb/zSuJun0ZUrDxx4sqvYS2FWzPA==

tinyexec@^0.3.0:
version "0.3.0"
resolved "https://registry.yarnpkg.com/tinyexec/-/tinyexec-0.3.0.tgz#ed60cfce19c17799d4a241e06b31b0ec2bee69e6"
integrity sha512-tVGE0mVJPGb0chKhqmsoosjsS+qUnJVGJpZgsHYQcGoPlG3B51R3PouqTgEGH2Dc9jjFyOqOpix6ZHNMXp1FZg==

to-fast-properties@^2.0.0:
version "2.0.0"
resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e"
Expand Down
Loading