Skip to content

[CTX-0002] feat(app): Vite + vanilla TS registry viewer and Cloudflare Pages deploy - #3

Merged
Xuepoo merged 2 commits into
mainfrom
ctx-0002/feat-vite-registry-viewer
Sep 13, 2026
Merged

Xuepoo merged 2 commits into
mainfrom
ctx-0002/feat-vite-registry-viewer

Conversation

@Xuepoo

@Xuepoo Xuepoo commented Sep 13, 2026

Copy link
Copy Markdown
Contributor

Priority: P1 | Area: docs | Labels: feat, area:docs, P1 | Milestone: v0.1.0 | RFC: none | Task: CTX-0002

Closes #2

What & why

Owner direction (2026-09-14): replace the custom Bun-bundled app/ prototype with a Vite + TypeScript storefront (vanilla DOM / Web Components, no UI framework) and activate a Cloudflare Pages deploy path for the newly registered plugins.bitty.run domain.

Changes

  • app/ is now a Vite + TS project: index.html, vite.config.ts, package.json (dev/build/preview/type-check), tsconfig.json, src/{main,registry,search,router,pages}.ts, small custom elements (plugin-card, plugin-search, plugin-filters, plugin-detail, install-command), and split styles.
  • vite.config.ts adds a bitty-registry plugin that serves /registry.json in development and emits generated/registry.json beside index.html at build time; no copy is committed under app/.
  • Bun workspaces: app is a workspace member (single root bun.lock); root bun-types is now declared directly because isolated workspace linking no longer hoists it. .markdownlint-cli2.jsonc ignores **/node_modules/**.
  • justfile: type-check and app-build run the app scripts; added app-dev and app-preview.
  • .github/workflows/deploy.yml: push to main (app/registry-relevant paths) and workflow_dispatch; builds with Bun; deploys via pinned wrangler to the bitty-plugins Pages project. CLOUDFLARE_API_TOKEN comes from the repository/organization secret with an organization-variable fallback, CLOUDFLARE_ACCOUNT_ID from the organization variable; without both, the deploy step is skipped fail-closed with a run-summary notice while the build still runs.
  • Domain facts recorded in README.md (Production URLs), AGENTS.md, TODO.md, CHANGELOG.md, and workflow comments: product website https://bitty.run; plugin store https://plugins.bitty.run; domain registered 2026-09-14; Cloudflare verification may still be pending. registry/schema.json $id points at the store domain.
  • Storefront quality: SVG favicon, robots.txt, sequential heading order, and a boot sequence that reveals the shell only when the registry is ready (eliminates layout shift).

Evidence

  • REGISTRY_SKIP_NETWORK=1 just check — pass: prettier fmt-check; markdownlint 0 issues (14 files); root + app tsc --noEmit; bun test 18 pass; registry validation 0 errors; generate-index --check up to date; Vite build.
  • just registry-validate with network — 0 errors (repository URL existence checks reachable).
  • just app-build — vite v8.3.0, 15 modules; output dist/{index.html,assets/*,registry.json,_redirects,robots.txt,favicon.svg}.
  • Dev/preview smoke: /, /registry.json, /plugins/bitty-featured.activity, /sdk return 200; headless Chrome renders the plugin card, install command, and detail text.
  • Lighthouse against the preview build: performance 100, accessibility 100, best-practices 100, SEO 100; FCP 0.9 s, LCP 1.2 s, TBT 0 ms, CLS 0.
  • actionlint .github/workflows/*.yml — pass; act -n -W .github/workflows/deploy.yml workflow_dispatch — job succeeded (deploy step correctly not planned without credentials); the preflight script was simulated for both branches (provisioned=false + skip notice; provisioned=true).
  • gitleaks detect --source . --redact — no leaks found.

Registry impact

  • generated/registry.json unchanged and verified idempotent (just registry-check)
  • No derived metadata added to registry entries
  • Official/community boundary untouched

Testing

  • just check passes (fmt, lint, type-check, tests, registry, Vite build)
  • actionlint passes and act -n dry run succeeds
  • Storefront checked in a headless browser (home + detail) and with Lighthouse

Checklist

  • No secrets, credentials, or local paths committed
  • Documentation synchronized (README/AGENTS/TODO/CHANGELOG); canonical store docs remain in bitty-plugins-docs

Risks

  • Deployment remains unproven against real Cloudflare: the bitty-plugins Pages project, the plugins.bitty.run binding, and secret propagation must be verified after provisioning; the domain is newly registered and verification may still be pending.
  • Without credentials the workflow stays green but does not deploy; the skip notice is the only signal (intentional fail-closed deploy, graceful degradation).
  • App runtime behavior is verified by headless Chrome and Lighthouse, not by an app/ unit-test suite (none exists yet).
  • The Vite build is pinned to 8.3.0 but has not yet run on GitHub Actions runners; local runs used Bun 1.4.2 while CI pins Bun 1.4.0.

@Xuepoo Xuepoo added this to the v0.1.0 milestone Sep 13, 2026
@Xuepoo Xuepoo added feat Feature P1 Priority: high area:docs Documentation area labels Sep 13, 2026
@Xuepoo

Xuepoo commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

Review response — credential scoping (Medium) — fixed in c301668.

  • Removed the job-level env: CLOUDFLARE_API_TOKEN / CLOUDFLARE_ACCOUNT_ID are no longer present during bun install (third-party lifecycle scripts) or the build.
  • Credentials are now step-scoped to exactly the two steps that need them (Check Cloudflare provisioning, Deploy to Cloudflare Pages). The fail-closed provisioned gate and the secrets.CLOUDFLARE_API_TOKEN || vars.CLOUDFLARE_API_TOKEN pattern are unchanged.
  • Added a risk callout: a token stored in organization vars is not secret-masked in logs and should be migrated to secrets when possible (documentation only, no behavior change).

Evidence: just check green (fmt, markdownlint, tsc, 18 tests, registry validate/generate, app-build); just actionlint clean; act -n exit 0 and act -l resolves the deploy job; gitleaks detect no leaks.

Label: switched area:docs to area:ui (closest app/frontend area label; docs files are touched, but the change is the Vite storefront).

No merge; awaiting re-review.

@Xuepoo Xuepoo added area:ui Area: UI / layout and removed area:docs Documentation area labels Sep 13, 2026
…eploy

Rework app/ into a Vite + TypeScript project rendering the committed
generated/registry.json through small custom elements (plugin-card,
plugin-search, plugin-filters, plugin-detail, install-command) with no UI
framework. The Vite config serves the registry in development and emits it
beside index.html at build time; client routes keep the Cloudflare Pages SPA
fallback in app/public/_redirects.

Build the store with Bun workspaces (app/ is a workspace member, single
bun.lock) and keep just check covering type-check and app-build. Update
justfile recipes (app-dev, app-preview).

Add deploy.yml: on push to main and workflow_dispatch, build app/ and deploy
to the bitty-plugins Cloudflare Pages project (plugins.bitty.run) with pinned
wrangler. Credentials resolve from the CLOUDFLARE_API_TOKEN secret with a
variable fallback plus the CLOUDFLARE_ACCOUNT_ID variable; without them the
deploy step is skipped with a clear notice and the workflow stays green.

Record production URLs (bitty.run, plugins.bitty.run; domain registered
2026-09-14, Cloudflare verification pending) in README, AGENTS, TODO, the
CHANGELOG, and the workflow comments; point the registry schema $id at the
store domain.

Refs: #2
CTX-0002
@Xuepoo
Xuepoo force-pushed the ctx-0002/feat-vite-registry-viewer branch from c301668 to ad8480e Compare September 13, 2026 20:04
@Xuepoo

Xuepoo commented Sep 13, 2026

Copy link
Copy Markdown
Contributor Author

Rebased onto main at b72e079 (post-#4 docs-submodule mount).

  • Conflict: README.md only (ownership table). Resolved keeping both intents:
    the Vite store description, production URLs (https://plugins.bitty.run),
    and org CLOUDFLARE_* variables, plus the docs/ (bitty-plugins-docs)
    submodule mount documentation.
  • AGENTS.md and .markdownlint-cli2.jsonc auto-merged; both the Vite
    storefront rules and the docs/ ignore/mount notes are preserved.
  • Commit subjects and bodies preserved with [CTX-0002] prefixes; deploy.yml
    is byte-identical to the pre-rebase head.

Gates on the rebased head (ad8480e): just check (prettier, markdownlint,
tsc, 18 tests, registry-validate, registry-check, Vite build), just actionlint, and act -n all pass.

@Xuepoo
Xuepoo merged commit 22492b3 into main Sep 13, 2026
5 checks passed
@Xuepoo
Xuepoo deleted the ctx-0002/feat-vite-registry-viewer branch September 13, 2026 20:21
Xuepoo added a commit that referenced this pull request Oct 7, 2026
… readiness (#75)

Annotate TODO beacon item with W-121/CTX-0030/Issue #64 tracking and blocked
state: beacon #3/#2/#1 open behind umbrella bitty#1629; only #4 closed
(#7 merged). No repository creation or registry entry until contracts are
accepted. just check green in clean worktree.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ui Area: UI / layout feat Feature P1 Priority: high

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(app): Vite + vanilla TS registry viewer and Cloudflare Pages deploy

1 participant