Skip to content

chore: move public docs website from private tools submodule - #119

Merged
blimmer merged 9 commits into
mainfrom
chore/website-into-public-packages
May 14, 2026
Merged

blimmer merged 9 commits into
mainfrom
chore/website-into-public-packages

Conversation

@blimmer

@blimmer blimmer commented May 14, 2026

Copy link
Copy Markdown
Contributor

Summary

Moves the Astro + Starlight marketing/docs site out of the private planbridge-private tools submodule and into this repo as a regular @contextbridge/website workspace under packages/website, so public contributors can change the site without any submodule setup. Strips the projen-generated infrastructure that only existed to manage that submodule, and adds a deploy-website job to the release workflow that publishes the built site to S3 + CloudFront on stable releases only (alpha tags are skipped so unreleased docs do not publish before the corresponding CLI release).

Review focus

  • The CI deploy job assumes three new bits of GitHub config: vars.WEBSITE_BUCKET, vars.WEBSITE_DISTRIBUTION_ID, and secrets.WEBSITE_DEPLOY_ROLE_ARN. The OIDC role is defined in private infrastructure (per chore: move public docs website from private tools submodule #99) and must exist before the next stable release tag, otherwise the new job will fail. The job runs only when !contains(github.ref_name, '-') — worth double-checking that matches how release tags are shaped.
  • Cache-control split: _astro/* gets public, max-age=31536000, immutable (fingerprinted assets), everything else gets public, max-age=300, must-revalidate. Invalidation hits /* regardless, so the immutable cache only matters for in-flight clients between deploys.
  • The generated packages/website/src/content/docs/cli/ reference is gitignored. It is regenerated by Astro lifecycle hooks (predev/prebuild/pretypecheck) from packages/cli/scripts/genCliRef.ts. The path move is also reflected in packages/annotation/scripts/recordDemo.ts (homepage demo asset output).
  • Dependabot's actions/create-github-app-token ignore was projen-specific and is dropped — dependabot will resume managing that pin directly.

Commits

Closes #99.

@blimmer
blimmer requested a review from jcarver989 as a code owner May 14, 2026 16:23
@blimmer
blimmer marked this pull request as draft May 14, 2026 16:37
@blimmer
blimmer force-pushed the chore/website-into-public-packages branch from 07885bc to 635edb4 Compare May 14, 2026 17:53
blimmer and others added 6 commits May 14, 2026 13:24
Removes the projen-generated infrastructure (`.projen/`, the
`auto-approve` workflow, the CODEOWNERS / .gitattributes / .gitignore
banners, the dependabot ignore for the projen-pinned app-token action)
and the `tools/` private-submodule wiring (`.gitmodules`, init script,
`just/infra.just`, the `tools-init` / `tools-install` justfile recipes
and the `install` recipe's submodule refresh, `package.json` lint
patterns and `synth:projen` script, the `.codex` rule allowlisting
`bun run projen`, and the `bootstrap-tools` composite action).

The marketing site has been the only reason the public repo needed any
of this; the next commit reintroduces it as a regular public workspace
under `packages/website` and the references across the tree get updated
to match.
Move the Astro + Starlight marketing/docs site out of the private
`planbridge-private` tools submodule and into this repository as a
regular `@contextbridge/website` workspace package, so public
contributors can change copy, docs, and components without any
submodule setup.

Wires the new path through the rest of the tree:
- root `test` script dispatches `packages/website` test (astro check
  + build); root `website` justfile recipe runs the new package's
  dev server.
- `eslint`/`.prettierignore`/`.gitignore` ignore Astro's `.astro/`
  output and the generated `src/content/docs/cli/` reference (still
  produced from Commander definitions by
  `packages/cli/scripts/genCliRef.ts`, just emitted into the new
  path).
- `packages/annotation/scripts/recordDemo.ts` writes the homepage
  demo asset into `packages/website/public/demo/`.
- AGENTS.md, CONTRIBUTING.md, claude rules, and package READMEs are
  refreshed to describe the new layout.

Refs #99.
After the `release` job tags a new version, build `packages/website`,
sync it to the marketing-site S3 bucket, and invalidate the
CloudFront distribution. Gated on `!contains(github.ref_name, '-')`
so alpha/pre-release tags don't publish unreleased docs ahead of a
stable CLI release.

Assumes a new OIDC role (defined in private infrastructure) plus two
GitHub repository variables:
- `vars.WEBSITE_BUCKET`
- `vars.WEBSITE_DISTRIBUTION_ID`

And the secret `secrets.WEBSITE_DEPLOY_ROLE_ARN`. Fingerprinted
assets under `_astro/` get a 1-year immutable cache; everything else
gets a 5-minute revalidating cache to keep HTML/markdown fresh.

Closes #99.
Brings in two changes Donnie landed in the private repo while the public
website workspace was being set up:

- Refresh homepage/marketing positioning around inline comments on coding
  agent plans (hero, FAQ, demo caption, FAQ nav, trust copy, OG card
  restyle, llms.txt, metadata).
- Document the default ephemeral PlanBridge browser UI port plus
  `CONTEXTBRIDGE_PORT` and `contextbridge plan --port` for fixed-port
  flows.

Originally landed as planbridge-private#17 and planbridge-private#18.
Astro 6 requires Node >=22.12.0, but the GitHub Actions runner's
preinstalled Node 20 was being picked up by `astro check` / `astro build`
through the binary shebang, failing the website typecheck on CI. The
bootstrap action installs anything in .tool-versions via asdf, so listing
nodejs here pins it in CI and locally.
Factor the S3 sync + CloudFront invalidation out of release.yml into a
workflow_call entrypoint so the main branch can deploy on website-only
changes without going through a release. Both callers serialize through
a `website-deploy` concurrency group to keep the S3 sync and invalidation
from racing.
@blimmer
blimmer force-pushed the chore/website-into-public-packages branch from 635edb4 to 1856700 Compare May 14, 2026 19:25
blimmer added 3 commits May 14, 2026 13:33
Type-aware ESLint (tseslint.configs.recommendedTypeChecked from the base
config) needs the TypeScript program to resolve `astro:content`, whose
declarations Astro generates into `packages/website/.astro/types.d.ts`
via `astro sync` (or as a side effect of dev/check/build). Locally those
artifacts persist between runs; in CI lint runs before any astro command,
so `defineCollection` resolved to `any` and `no-unsafe-call` /
`no-unsafe-assignment` fired on content.config.ts. Add prelint hooks so
the sync runs every time, matching CI to local.
Cleanup after the move out of the private submodule:

- Delete `starlight-brand.config.mjs`. Orphaned scaffolding —
  `astro.config.mjs` never imported `starlightBrand`, so the file was
  silently dead. The styles it claimed to wire up still load via
  `main.css`'s @imports of `base.css` + `starlight.css`.
- Drop the AGENTS.md mention of a `pretest` script that doesn't exist.
  The website's `test` script (`typecheck && build`) regenerates the
  CLI reference transitively through `pretypecheck` + `prebuild`, so
  behavior is unchanged — the docs were just lying about the mechanism.
- Drop the AGENTS.md line claiming the package "does not depend on a
  private tools/ submodule." Useful during the migration; meaningless
  to future readers who never knew about the submodule.
- Slim `packages/website/.gitignore` to just `.astro/` (the only entry
  not already covered by the repo-root `.gitignore`).
Extend the root format glob to .mdx so handwritten Starlight content
is consistently formatted. The generated `docs/cli/` directory stays
in .prettierignore to avoid churn against `genCliRef.ts`.

Drop the stray `bun run --cwd packages/website test` from the "Run
the website locally" section of CONTRIBUTING — `just website` already
runs the dev server and is sufficient.
Comment thread .github/workflows/auto-approve.yml Outdated

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

This was old / from projen

@@ -0,0 +1,72 @@
name: Deploy Website

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Reusable workflow used from main and release workflows

Comment thread .tool-versions
@@ -1,2 +1,3 @@
bun 1.3.13
just 1.49.0
nodejs 24.15.0

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

astro check uses a shebang for node, so we need this, unfortunately. They explicitly call out bun as out of scope for check.

@blimmer
blimmer marked this pull request as ready for review May 14, 2026 20:01
@blimmer
blimmer merged commit e5c1077 into main May 14, 2026
14 checks passed
@blimmer
blimmer deleted the chore/website-into-public-packages branch May 14, 2026 20:06
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.

chore: move public docs website from private tools submodule

2 participants