Skip to content

docs: finish and deploy the Astro documentation site - #650

Open
unional wants to merge 5 commits into
mainfrom
astro-website
Open

docs: finish and deploy the Astro documentation site#650
unional wants to merge 5 commits into
mainfrom
astro-website

Conversation

@unional

@unional unional commented Sep 4, 2026

Copy link
Copy Markdown
Collaborator

The site under `apps/website` was the unmodified Starlight starter with a few real pages grafted on, and it has never been deployed. This finishes it, replaces typedoc with it, and wires up deployment.

Site config

  • Set `site` + `base` so URLs resolve under `https://cyberuni.github.io/type-plus/\`. Without `base`, every internal link 404s once deployed.
  • Add `editLink` pointing at `apps/website/` on main.
  • Fix the `logo` paths — they pointed at `/public/type-plus.svg`, which Astro cannot resolve. The asset moved to `src/assets/`.
  • Add `src/env.d.ts` for the generated content types.

Documentation

  • 13 new API pages: object, array, tuple, string, number/numeric, boolean/logical, union/mix_types, function/functional, promise, nominal, type guards & assertions, math/bigint, testing. Written from the `.ts` sources — the `src/*/readme.md` files are v7-era and reference types that no longer exist.
  • Rewrite `index.mdx`: starter "Next steps" cards replaced with real entry points, dead `/api/toc` hero link removed.
  • Expand getting-started with install tabs and a branching-options primer.
  • Repoint every `unional/type-plus` GitHub link to `cyberuni/type-plus`.
  • Delete starter leftovers: `README.md`, `guides/example.md`, `houston.webp`.

typedoc is retired

A repo has exactly one Pages source, and the Astro site is taking it. The hand-written pages supersede the generated dump, so typedoc is removed rather than nested somewhere:

  • the `docgen` job in `release.yml` (pushed to the `gh-pages` branch)
  • `.config/typedoc.jsonc`
  • the `build:doc` script, its `verify:pkg` step, and its turbo task
  • `typedocOptions` in `packages/type-plus/tsconfig.json`
  • the `typedoc` devDependency — lockfile updated, since CI runs `--frozen-lockfile`

`/docs` stays in `.gitignore`: nothing generates it any more, but existing checkouts still hold ~9MB of old output that should not become committable.

Build

  • `turbo.json` referenced a `pages#build` task, but the package is named `website` — the entry never matched anything. Renamed with real inputs/outputs.
  • Add `deploy-docs.yml`.

⚠️ One manual step

Pages is on `build_type: legacy`, source `gh-pages`. `actions/deploy-pages` will fail until the Pages source is switched to GitHub Actions in repo settings. The old typedoc URLs under `/type-plus/*` go away when that happens — that is the intended outcome.

Verification

`astro build` produces 22 pages; a link check across the built output found 0 broken internal links and 0 links missing the base prefix.

Not addressed

Two likely source bugs surfaced while reading the sources, documented as-tested rather than as-specified:

  • `Xor<A, B, $O>` in `src/logical/logical.ts` drops `$O` on the `A extends true` path, so options only apply when `A` is `false`.
  • `IsAnyOrNever`'s JSDoc claims `$Then` output, but its default `$O` is `$Selection.Predicate`.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ETjy9oQGyETyFmDBdR9Egz

The site under `apps/website` was the unmodified Starlight starter with a few
real pages grafted on, and it was never deployed. This finishes it.

Site config:
- Set `site` + `base` so URLs resolve under https://cyberuni.github.io/type-plus/.
  Without `base` every internal link 404s once deployed.
- Add `editLink` pointing at `apps/website/` on main.
- Fix the `logo` paths: they pointed at `/public/type-plus.svg`, which Astro
  cannot resolve. Moved the asset to `src/assets/` and referenced it there.
- Add `src/env.d.ts` for the generated content types.

Documentation:
- 13 new API pages covering object, array, tuple, string, number/numeric,
  boolean/logical, union/mix_types, function/functional, promise, nominal,
  type guards & assertions, math/bigint, and testing. Written from the .ts
  sources rather than the v7-era `src/*/readme.md` files, which are stale.
- Rewrite index.mdx: the starter "Next steps" cards are replaced with real
  entry points, and the dead `/api/toc` hero link is removed.
- Expand getting-started with install tabs and a branching-options primer.
- Repoint every `unional/type-plus` GitHub link to `cyberuni/type-plus`.
- Delete the starter leftovers: README.md, guides/example.md, houston.webp.

Build:
- turbo.json referenced a `pages#build` task, but the package is named
  `website`, so the entry never matched anything. Renamed and given real
  inputs/outputs; `.astro/**` added to the build outputs.
- Add deploy-docs.yml, mirroring cyber-asana's. It also runs `pnpm build:doc`
  and nests the typedoc output at `/typedoc/` so the generated reference
  survives the move off the gh-pages branch.

Verified: `astro build` produces 22 pages, and every internal link resolves
with the base prefix applied.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ETjy9oQGyETyFmDBdR9Egz
@changeset-bot

changeset-bot Bot commented Sep 4, 2026

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: 30fa535

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@codecov

codecov Bot commented Sep 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 100.00%. Comparing base (10a490e) to head (a77cf6f).

Additional details and impacted files
@@            Coverage Diff            @@
##              main      #650   +/-   ##
=========================================
  Coverage   100.00%   100.00%           
=========================================
  Files           43        43           
  Lines          232       232           
  Branches        51        51           
=========================================
  Hits           232       232           

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

unional and others added 4 commits September 4, 2026 04:06
The Astro site now carries hand-written API documentation, so the generated
typedoc dump no longer earns its place — and it cannot coexist with the new
Pages deployment anyway, since a repo has exactly one Pages source and the
Astro site is taking it.

Removed:
- the `docgen` job in release.yml, which pushed typedoc output to gh-pages
- `.config/typedoc.jsonc`
- the `build:doc` script, its `verify:pkg` step, and its turbo task
- `typedocOptions` from packages/type-plus/tsconfig.json
- the typedoc devDependency (lockfile updated; CI runs --frozen-lockfile)
- the typedoc build/copy steps from deploy-docs.yml

`/docs` stays in .gitignore. Nothing generates it any more, but existing
checkouts still hold ~9MB of old output and it should not become committable.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ETjy9oQGyETyFmDBdR9Egz
Adds `expressive-code-twoslash` to the Starlight site. Code blocks tagged
```ts twoslash are run through the real TypeScript compiler at build time, so
hovers show the types type-plus actually produces and `^?` queries print the
resolved result. For a type-level library that is the difference between
documenting behaviour and asserting it.

Two supporting changes make that possible:

- The site now depends on `type-plus` (workspace:*). twoslash resolves imports
  for real, so the docs must see the built .d.ts. This also makes turbo's
  `^build` actually build the library before the site, which it previously did
  not because no dependency existed.
- Adds `typescript` (catalog:), a twoslash peer.

It immediately earned its place. The branching-options example claimed

    IsString<any>  // boolean — `any` is both

The compiler disagrees: `IsString<any>` is `false`. `boolean` comes from union
distribution (`IsString<string | 1>`), not from `any`. The example now shows
both cases and every line is checked at build time.

Note `expressive-code-twoslash@0.6.1` declares a peer of expressive-code
`^0.41.7` while Starlight 0.41.10 brings 0.44.1. That range is stale metadata,
not a real incompatibility — verified by asserting the rendered output contains
the resolved types rather than trusting a green build.

The 13 API pages are not converted yet; they can move over incrementally.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ETjy9oQGyETyFmDBdR9Egz
`pnpm add typescript@catalog:` rewrote the shared catalog from `~5.6.0` to
`~5.6.3`, pinning it to whatever happened to be resolved at the time. That is a
repo-wide change to every package's TypeScript range and had nothing to do with
adding twoslash, so put it back.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ETjy9oQGyETyFmDBdR9Egz
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.

1 participant