Skip to content
Open
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
35 changes: 0 additions & 35 deletions .github/workflows/docs.yml

This file was deleted.

2 changes: 0 additions & 2 deletions .vercelignore

This file was deleted.

4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,9 @@
"prepare": "husky || exit 0",
"run": "node packages/cli/bin/cli.mjs",
"watch": "node --watch packages/cli/bin/cli.mjs",
"docs:build": "bash scripts/vercel-docs-build.sh",
"build:site": "bash scripts/deployments/site/main.sh",
"build:beta": "bash scripts/deployments/beta/main.sh",
"build": "node --run build:site",
"changeset": "changeset",
"changeset:version": "changeset version",
"release": "changeset publish"
Expand Down
52 changes: 52 additions & 0 deletions scripts/deployments/beta/main.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
#!/usr/bin/env bash
set -euo pipefail

readonly NODE_REPO="https://github.com/nodejs/node.git"
readonly SRC_DIR="node"
readonly OUT_DIR="out"

cleanup() { rm -rf "$SRC_DIR"; }
trap cleanup EXIT

tags=$(git ls-remote --tags --refs --sort='-v:refname' "$NODE_REPO" 'v*')
LATEST_TAG=$(awk -F/ '$NF !~ /-/ { print $NF; exit }' <<<"$tags")

if [[ -z $LATEST_TAG ]]; then
echo "Could not determine the latest nodejs/node release tag" >&2
exit 1
fi

echo "Building docs for nodejs/node $LATEST_TAG"

clone_node_docs() {
rm -rf "$SRC_DIR"
git clone --depth 1 --no-tags --branch "$LATEST_TAG" \
--filter=blob:none --sparse "$NODE_REPO" "$SRC_DIR"
git -C "$SRC_DIR" sparse-checkout set doc lib
}

clone_node_docs &
clone_pid=$!

pnpm install --frozen-lockfile

wait "$clone_pid"

mkdir -p "$OUT_DIR"

node packages/cli/bin/cli.mjs generate \
-t orama-db \
-t legacy-json \
-t llms-txt \
-t html \
-i "./$SRC_DIR/doc/api/*.md" \
--ignore "./$SRC_DIR/doc/api/quic.md" \
-o "./$OUT_DIR" \
-c "./$SRC_DIR/CHANGELOG.md" \
-v "$LATEST_TAG" \
--type-map "./$SRC_DIR/doc/type-map.json" \
--index "./$SRC_DIR/doc/api/index.md" \
--config-file "./beta/doc-kit.config.mjs" \
--log-level debug

cp "$SRC_DIR"/doc/api/*.md "$OUT_DIR/"
21 changes: 21 additions & 0 deletions scripts/deployments/beta/wrangler.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "doc-kit",
"compatibility_date": "2026-08-11",

"assets": {
"directory": "../../../out",
"html_handling": "auto-trailing-slash",
"not_found_handling": "404-page",
},

"routes": [
{
"pattern": "beta.docs.nodejs.org",
"custom_domain": true,
},
],

"observability": {
"enabled": true,
},
}
File renamed without changes.
22 changes: 22 additions & 0 deletions scripts/deployments/site/wrangler.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
{
"name": "doc-kit",
"account_id": "07be8d2fbc940503ca1be344714cb0d1",
"compatibility_date": "2026-08-11",

"assets": {
"directory": "../../../www/out",
"html_handling": "auto-trailing-slash",
"not_found_handling": "404-page",
},

"routes": [
{
"pattern": "doc-kit.nodejs.org",
"custom_domain": true,
},
],

"observability": {
"enabled": true,
},
}
26 changes: 0 additions & 26 deletions scripts/vercel-build.sh

This file was deleted.

36 changes: 0 additions & 36 deletions scripts/vercel-prepare.sh

This file was deleted.

3 changes: 0 additions & 3 deletions vercel.json

This file was deleted.

21 changes: 21 additions & 0 deletions wrangler.jsonc
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
{
"name": "doc-kit",
"compatibility_date": "2026-08-11",

"assets": {
"directory": "./www/out",
"html_handling": "auto-trailing-slash",
"not_found_handling": "404-page",
},

"routes": [
{
"pattern": "doc-kit.nodejs.org",
"custom_domain": true,
},
],

"observability": {
"enabled": true,
},
}
Loading