Skip to content

docs: host documentation on GitHub Pages with VitePress#234

Open
robertsLando wants to merge 9 commits intomainfrom
docs/github-pages-site
Open

docs: host documentation on GitHub Pages with VitePress#234
robertsLando wants to merge 9 commits intomainfrom
docs/github-pages-site

Conversation

@robertsLando
Copy link
Copy Markdown
Member

Summary

  • Move README content into a proper documentation site built with VitePress, deployed to https://yao-pkg.github.io/pkg/ via GitHub Actions
  • Split the README into 21 focused guide pages (getting started, targets, config, bytecode, compression, SEA mode, snapshot FS, native addons, ESM, API, troubleshooting, advanced)
  • New SEA vs Standard page that leads with the stock-binary benefit and links the pkg-fetch elimination roadmap (Upstream pkg-fetch patches to Node.js core to eliminate custom binaries #231)
  • Landing page with pkg identity — amber + pink palette sampled from the org logo
  • DEVELOPMENT.md and docs/ARCHITECTURE.md canonical sources moved into docs-site/, root files replaced with stub pointers so there's a single source of truth
  • README trimmed to install + quick start + links to hosted docs

Manual follow-up

After merge, enable GitHub Pages in repo settings:

Settings → Pages → Source: GitHub Actions

The workflow at .github/workflows/docs.yml will deploy on every push to main that touches docs-site/.

Test plan

  • npm run docs:build inside docs-site/ — clean build, zero warnings
  • All internal links resolve (VitePress dead-link check passes)
  • Prettier clean on all new files
  • 21 guide pages + landing + architecture + development all render
  • Manual smoke test on deployed site (after Pages enabled)
  • Verify SEA vs Standard page renders matrix correctly in both light and dark mode

Files

  • docs-site/ — new VitePress site
  • .github/workflows/docs.yml — build + deploy workflow
  • README.md — trimmed
  • DEVELOPMENT.md, docs/ARCHITECTURE.md — stub redirects

🤖 Generated with Claude Code

Move README content into a proper documentation site built with VitePress
and deployed to https://yao-pkg.github.io/pkg/ via GitHub Actions.

- Landing page with pkg identity (amber/pink palette from logo)
- Guide split into 21 focused pages (getting started, targets, config,
  bytecode, compression, SEA mode, snapshot FS, native addons, ESM, API,
  troubleshooting, advanced)
- New SEA vs Standard page highlighting the stock-binary benefit and
  linking the pkg-fetch elimination roadmap (#231)
- DEVELOPMENT.md and docs/ARCHITECTURE.md canonical sources moved into
  docs-site/, roots replaced with stub pointers to avoid drift
- README trimmed to install + quick start + links to hosted docs
- .github/workflows/docs.yml builds and deploys on push to main

Manual follow-up: enable GitHub Pages with Source = GitHub Actions in
repo settings.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@robertsLando robertsLando requested a review from Copilot April 14, 2026 14:13
- gate docs workflow on PRs (build-only) to catch VitePress breakage before merge
- switch workflow to npm ci with cache-dependency-path for reproducible installs
- read site version from package.json so nav dropdown no longer rots each release
- reconcile SEA vs Standard messaging on the guide landing page
- fix typos and stale DEVELOPMENT.md references in copilot-instructions
- mark root DEVELOPMENT.md and docs/ARCHITECTURE.md stubs as non-canonical
- replace non-standard -webkit-linear-gradient with standard linear-gradient

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Note

Copilot was unable to run its full agentic suite in this review.

This PR migrates repository documentation into a VitePress site and adds a GitHub Actions workflow to deploy it to GitHub Pages, while trimming the root README and replacing root docs with canonical stubs.

Changes:

  • Add a new docs-site/ VitePress documentation site (landing page, guides, architecture, development docs, theme + config).
  • Add a GitHub Actions workflow to build and deploy the docs site to GitHub Pages.
  • Replace root README.md, DEVELOPMENT.md, and docs/ARCHITECTURE.md with pointers to the hosted docs / canonical sources.

Reviewed changes

Copilot reviewed 35 out of 37 changed files in this pull request and generated 3 comments.

Show a summary per file
File Description
docs/ARCHITECTURE.md Replaced full architecture doc with a stub pointing to the canonical docs-site page.
docs-site/package.json Adds a private package definition and VitePress scripts/dependency for the docs site.
docs-site/index.md Adds a VitePress home/landing page with hero content and quick-start.
docs-site/guide/troubleshooting.md Introduces a troubleshooting guide page with common runtime/build errors.
docs-site/guide/targets.md Adds a targets/cross-compilation guide page.
docs-site/guide/snapshot-fs.md Adds snapshot filesystem behavior and path mapping documentation.
docs-site/guide/sea-vs-standard.md Adds SEA vs Standard positioning, feature matrix, and pkg-fetch roadmap page.
docs-site/guide/sea-mode.md Adds SEA mode usage docs (simple vs enhanced) and trade-offs.
docs-site/guide/packaged-app.md Adds a short guide for packaged-app CLI equivalence and references.
docs-site/guide/output.md Documents output flags and debugging behavior.
docs-site/guide/options.md Documents --options for baking Node/V8 runtime options.
docs-site/guide/native-addons.md Documents native addon handling and cache configuration.
docs-site/guide/index.md Adds the guide index/intro page (“What is pkg?”).
docs-site/guide/getting-started.md Adds installation + CLI reference + examples page.
docs-site/guide/esm.md Adds ESM support documentation and SEA-related note.
docs-site/guide/environment.md Documents supported environment variables and examples.
docs-site/guide/detecting-assets.md Documents asset auto-detection heuristics.
docs-site/guide/custom-node.md Documents using a custom Node binary via env var.
docs-site/guide/configuration.md Documents pkg config (scripts, assets, ignore) with examples.
docs-site/guide/compression.md Documents compression flags and SEA-mode limitation.
docs-site/guide/bytecode.md Documents bytecode behavior, reproducibility, and public-packages constraints.
docs-site/guide/build.md Documents building base binaries from source and points to SEA direction.
docs-site/guide/api.md Documents the pkg programmatic API usage.
docs-site/guide/advanced-windows-metadata.md Adds advanced guide on post-processing Windows metadata with resedit.
docs-site/guide/advanced-debug-vfs.md Adds advanced debugging guide for inspecting the virtual filesystem.
docs-site/development.md Moves development/release/testing docs into docs site.
docs-site/architecture.md Moves full architecture doc into docs site as canonical source.
docs-site/.vitepress/theme/index.ts Adds theme entry importing custom CSS.
docs-site/.vitepress/theme/custom.css Adds custom brand styling variables and hero image tweaks.
docs-site/.vitepress/config.ts Adds VitePress site configuration (base, nav, sidebar, edit links, SEO/meta).
docs-site/.gitignore Ignores docs-site build output and caches.
README.md Trims README to quick start + links to the hosted docs.
DEVELOPMENT.md Replaces root development doc with a stub pointing to docs-site.
.github/workflows/docs.yml Adds build + deploy workflow for GitHub Pages using GitHub Actions.
.github/copilot-instructions.md Updates contributor guidance to use docs-site/ as the canonical docs source.
Files not reviewed (1)
  • docs-site/package-lock.json: Language not supported
Comments suppressed due to low confidence (1)

docs-site/guide/targets.md:1

  • There’s an extra comma before the parenthesized platform, which reads like a punctuation mistake. Consider removing it for clarity.


## Release Process

In order to create release just run the command:
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page has multiple grammatical issues that make the developer documentation look unpolished (e.g., “create release”, “have build”, “runned”, “It install”, “Foreach”). Please proofread and correct these phrases (e.g., “create a release…”, “have built…”, “run”, “It installs…”, “For each…”).

Copilot uses AI. Check for mistakes.

## Testing

Before running tests ensure you have build the project by running:
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page has multiple grammatical issues that make the developer documentation look unpolished (e.g., “create release”, “have build”, “runned”, “It install”, “Foreach”). Please proofread and correct these phrases (e.g., “create a release…”, “have built…”, “run”, “It installs…”, “For each…”).

Copilot uses AI. Check for mistakes.
Comment on lines +80 to +81
- `test-79-npm`: It's the only test runned when using `only-npm`. It install and tests all node modules listed inside that dir and verifies if they are working correctly.
- `test-42-fetch-all`: Foreach known node version verifies there is a patch existing for it using pkg-fetch.
Copy link

Copilot AI Apr 14, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This page has multiple grammatical issues that make the developer documentation look unpolished (e.g., “create release”, “have build”, “runned”, “It install”, “Foreach”). Please proofread and correct these phrases (e.g., “create a release…”, “have built…”, “run”, “It installs…”, “For each…”).

Copilot uses AI. Check for mistakes.
robertsLando and others added 6 commits April 14, 2026 16:41
New pages:
- guide/migration.md — drop-in migration from archived vercel/pkg fork
- guide/recipes.md — copy-paste cookbook for common tasks
- changelog.md — CHANGELOG.md mirrored into the docs site via include

Rewritten pages:
- guide/getting-started.md — first-binary tutorial with code groups + full
  CLI table; no more raw --help dump
- guide/sea-mode.md — leads with a hello-world walkthrough
- guide/configuration.md — full schema table + production example
- guide/targets.md — code groups + tip callout + alpine/musl section
- guide/environment.md — inlined pkg-fetch vars + PKG_EXECPATH clarification
- guide/troubleshooting.md — NODE_OPTIONS dead end replaced with a full fix,
  check-this-first preface added
- guide/bytecode|compression|options|build|output|snapshot-fs|native-addons|
  esm|api|packaged-app|custom-node|detecting-assets|advanced-debug-vfs|
  advanced-windows-metadata — expanded + frontmatter + next-step links

VitePress config:
- withMermaid for mermaid flowchart support
- sitemap.hostname for SEO
- outline level raised to [2, 4]
- Collapsed singleton sidebar groups into a Cookbook section
- Added Recipes to the top nav
- Version dropdown links to migration + changelog

Landing page:
- vercel/pkg fork banner
- Social badges (npm version, downloads, stars, CI, license)
- Code groups for CLI vs package.json vs Node.js API
- Standard vs SEA side-by-side

Architecture:
- Top-level mermaid overview comparing both build paths
- Mermaid flowcharts for traditional + SEA build pipelines
- Mermaid flow for VFS provider path resolution
- ASCII diagrams kept for readers who prefer them

Development page:
- Full docs-site local dev workflow
- Structure, mermaid how-to, new-page checklist
- Canonical-source note for the root stubs

Polish:
- Responsive hero image on small viewports
- Fork-banner CSS
- .nvmrc pinning docs-site to Node 22
- Frontmatter (title + description) on every guide page for SEO
- Twitter card meta

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
- Record a real 15s pkg session (mkdir → echo → pkg index.js → ls → run)
  with VHS as docs-site/public/hero.gif (98KB). Tape-based so it is
  reproducible in CI if we want to regenerate it later.
- Embed the GIF in the landing page as a figure under the fork banner.
- Replace the inline HTML badge anchors with Markdown image links on
  a single line so VitePress renders them inside a single <p>. The old
  setup put each anchor on its own line which the markdown processor
  wrapped in separate paragraphs, stacking the badges vertically.
- Add .landing-badges / .landing-demo / .landing-body CSS: flex layout
  for the badge row, shadow + border-radius on the demo GIF, consistent
  max-width + padding on the content block.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The previous recording ran VHS with a PATH that did not include the nvm
node bin dir, so the /tmp/bin/pkg wrapper's `env ... node ...` invocation
failed with "env: node: No such file or directory" and the session showed
three cascading errors instead of a successful build.

Fix: hardcode the absolute node path inside the wrapper so it works under
any restricted PATH. Re-recorded — now shows the real pkg build producing
three binaries and running the linux one.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Audience split: keep the detailed pipelines, binary layouts, VFS provider,
worker bootstrap and patch tables as docs/ARCHITECTURE.md (contributor /
agent reference), and replace docs-site/architecture.md with a lean ~110
line user overview that links back to it.

Also dedup SEA-vs-standard and walker explanations across index pages,
collapse the pkg-fetch roadmap down to a pointer to #231, share the
reference sidebar config, and add a jump TOC to the recipes page.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants