Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
acae9e2
Initial draft
ejMina226 Jan 24, 2025
273d985
Corrections.
ejMina226 Jan 24, 2025
f5dc26c
Corrections.
ejMina226 Jan 24, 2025
d5a6158
Corrections.
ejMina226 Jan 24, 2025
f92ac88
Corrections.
ejMina226 Jan 24, 2025
b69fab4
Add in Worker Start-up Flow
ejMina226 Jan 24, 2025
45aa1a1
Fix typo
ejMina226 Jan 24, 2025
6e8fb91
Fix typo
ejMina226 Jan 24, 2025
8168f61
Add in Provable events
ejMina226 Jan 24, 2025
c0cc86d
Remove typo
ejMina226 Jan 24, 2025
8173fc5
Merge branch 'main' into feature/worker-arch
maht0rz Jan 28, 2025
172e62e
wip modularity & configuration docs
maht0rz Jan 30, 2025
b0b05ee
Added typedoc reference docs
maht0rz Jan 31, 2025
7e1347e
add reference docs
maht0rz Feb 3, 2025
afc32c0
document typedoc generation
maht0rz Feb 3, 2025
747c677
remove framework from gitignore
maht0rz Feb 3, 2025
0950376
remove reference docs from version control
maht0rz Feb 4, 2025
e84e9a5
generate typedoc from framework's develop directly
maht0rz Feb 4, 2025
67e17ba
generate typedoc after installing deps
maht0rz Feb 4, 2025
0c0fdde
remove typedoc files from version control
maht0rz Feb 4, 2025
673081a
use https instead of ssh to pull the framework repo
maht0rz Feb 4, 2025
eec71e6
create a directory for references if it does not exist
maht0rz Feb 4, 2025
c2910ab
make the framework typedoc folder context dependant
maht0rz Feb 4, 2025
d06bf4c
add logging to reference meta generation for debug purposes
maht0rz Feb 4, 2025
40654a9
added a log message to typedoc meta generator script
maht0rz Feb 4, 2025
2706638
change copy paths for typedoc generation
maht0rz Feb 4, 2025
c29fbc3
update command for copying reference docs
maht0rz Feb 4, 2025
074b8aa
parametrize the typedoc generation script
maht0rz Feb 5, 2025
206472b
added a netlify build & deploy workflow
maht0rz Feb 5, 2025
d8520dd
renamed workflow
maht0rz Feb 5, 2025
1018423
fix syntax issues with workflow
maht0rz Feb 5, 2025
5476102
remove cache from workflow
maht0rz Feb 5, 2025
a42fe79
switch workflow to pnpm
maht0rz Feb 5, 2025
d5e0c09
fix syntax issues in workflow
maht0rz Feb 5, 2025
25470c9
update publish dir for website
maht0rz Feb 5, 2025
cd24b73
update publish dir for website
maht0rz Feb 5, 2025
f673271
remove workflow for deployment
maht0rz Feb 5, 2025
880a1ca
make sidebar items in 3rd level of nesting not overflow
maht0rz Feb 5, 2025
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
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
.DS_Store
.git
.idea
src/pages/docs/reference
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
enable-pre-post-scripts=true
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,10 @@ First, run `pnpm i` to install the dependencies.

Then, run `pnpm dev` to start the development server and visit localhost:3000.

## Typedoc generation

Run `pnpm run typedoc:generate` to generate reference documentation from the framework's typedoc.

## License

This project is licensed under the MIT License.
This project is licensed under the MIT License.
54 changes: 54 additions & 0 deletions generate-reference-meta.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
import fs from "fs";
const references = fs
.readdirSync("./src/pages/docs/reference")
.filter((reference) =>
fs.lstatSync(`./src/pages/docs/reference/${reference}`).isDirectory()
);

const sidebarTitles = {
README: "Overview",
classes: "Classes",
functions: "Functions",
interfaces: "Interfaces",
"type-aliases": "Type Aliases",
globals: "Globals",
variables: "Variables",
};

function categoryToSidebarTitle(category) {
return sidebarTitles[category];
}

function referenceToSidebarTitle(reference) {
return `@proto-kit/${reference}`;
}

console.log("generating typedoc meta files...");

references.forEach((reference) => {
const metaTsxPath = `./src/pages/docs/reference/${reference}/_meta.tsx`;
fs.rmSync(metaTsxPath, { force: true });

const categories = fs.readdirSync(
`./src/pages/docs/reference/${reference}`,
"utf8"
);

const metaTsx = `export default {
${categories.map((category) => {
category = category.replace(".md", "");
return `"${category}": "${categoryToSidebarTitle(category) ?? category}"`;
})}
};`;

fs.writeFileSync(metaTsxPath, metaTsx);
});

const metaTsxPath = `./src/pages/docs/reference/_meta.tsx`;
const metaTsx = `export default {
${references.map((reference) => {
return `"${reference}": "${referenceToSidebarTitle(reference)}"`;
})}
};`;

fs.writeFileSync(metaTsxPath, metaTsx);
22 changes: 22 additions & 0 deletions generate-typedoc.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# needs to be cloned to a one-up directory, otherwise README.md auto-discovery
# in framework's typedoc includes website's README.md, which is not desired
REPO=$(pwd)
: "${FRAMEWORK_TYPEDOC_FOLDER:=./../framework-typedoc}"
: "${FRAMEWORK_BRANCH:=develop}"
: "${WEBSITE_REFERENCE_DOCS:=./src/pages/docs/reference/}"
echo "Generating typedoc for framework branch \"$FRAMEWORK_BRANCH\" in \"$FRAMEWORK_TYPEDOC_FOLDER\"";
rm -rf $FRAMEWORK_TYPEDOC_FOLDER
git clone https://github.com/proto-kit/framework.git $FRAMEWORK_TYPEDOC_FOLDER
cd "$FRAMEWORK_TYPEDOC_FOLDER"
git checkout $FRAMEWORK_BRANCH
npm ci --force
npm run prisma:generate
npm run build
npm run typedoc
cd $REPO
rm -rf $WEBSITE_REFERENCE_DOCS
mkdir -p $WEBSITE_REFERENCE_DOCS
cp -r "$FRAMEWORK_TYPEDOC_FOLDER/docs/@proto-kit/." $WEBSITE_REFERENCE_DOCS
node generate-reference-meta.mjs
rm -rf $FRAMEWORK_TYPEDOC_FOLDER
echo "Typedoc generated successfully"
6 changes: 0 additions & 6 deletions next.config.js

This file was deleted.

14 changes: 14 additions & 0 deletions next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import nextra from "nextra";

const withNextra = nextra({
theme: "nextra-theme-docs",
themeConfig: "./theme.config.tsx",
latex: true,
search: {
codeblocks: false,
},
});

export default withNextra({
reactStrictMode: true,
});
8 changes: 6 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
"name": "@protokit/website",
"version": "0.0.1",
"scripts": {
"postinstall": "pnpm run typedoc:generate",
"typedoc:generate": "./generate-typedoc.sh",
"dev": "next dev",
"build": "next build",
"start": "next start"
Expand Down Expand Up @@ -51,8 +53,8 @@
"lucide-react": "^0.279.0",
"next": "^13.4.0",
"next-themes": "^0.2.1",
"nextra": "^2.0.0",
"nextra-theme-docs": "^2.0.0",
"nextra": "3",
"nextra-theme-docs": "3",
"node-fetch": "2.6.1",
"react": "^18.2.0",
"react-day-picker": "^8.8.2",
Expand All @@ -61,10 +63,12 @@
"react-youtube": "^10.1.0",
"tailwind-merge": "^1.14.0",
"tailwindcss-animate": "^1.0.7",
"typedoc": "^0.27.6",
"zod": "^3.22.2"
},
"devDependencies": {
"@types/node": "18.11.10",
"@types/react": "19.0.8",
"autoprefixer": "^10.4.16",
"postcss": "^8.4.31",
"tailwindcss": "^3.3.3",
Expand Down
Loading