Skip to content

feat(cms): BlockSource abstraction + bundled fallback [fast-deploy 1/5]#226

Open
hugo-ccabral wants to merge 1 commit into
mainfrom
feat/fast-deploy-1-blocksource
Open

feat(cms): BlockSource abstraction + bundled fallback [fast-deploy 1/5]#226
hugo-ccabral wants to merge 1 commit into
mainfrom
feat/fast-deploy-1-blocksource

Conversation

@hugo-ccabral

@hugo-ccabral hugo-ccabral commented Jun 8, 2026

Copy link
Copy Markdown

Stack 1/5 — Fast Deploy (KV-first content). Base: main.

Decouples CMS content updates from worker code deploys: content served from Cloudflare KV with the bundled blocks.gen snapshot as fallback. Full design + cross-repo contracts in docs/fast-deploy.md (PR 5/5).

This PR

  • src/cms/blockSource.tsBlockSource interface (whole-snapshot model), BundledBlockSource no-op, computeRevision (matches loader.ts DJB2), KV_KEYS contract, and a local minimal KVNamespace type (no @cloudflare/workers-types dep).
  • Exports from src/cms/index.ts.

Pure addition — dead code until wired by 2/5. Zero runtime impact.

Test

npx vitest run src/cms/blockSource.test.ts (7 tests). npm run typecheck clean.

Stack

1/5 this · 2/5 read path · 3/5 write-through · 4/5 CI scripts · 5/5 docs

🤖 Generated with Claude Code


Summary by cubic

Adds a BlockSource abstraction for whole-snapshot CMS content with a no-op BundledBlockSource fallback to enable KV-first fast deploys using blocks.gen as fallback. Introduces computeRevision and a shared KV key contract for consistent revision checks.

  • New Features
    • Added src/cms/blockSource.ts: BlockSource, BundledBlockSource, computeRevision, KV_KEYS, and a minimal KVNamespace (no @cloudflare/workers-types).
    • Re-exported from src/cms/index.ts; tests in src/cms/blockSource.test.ts. No runtime change until the read path is wired.

Written for commit 8344831. Summary will update on new commits.

Review in cubic

Introduces the BlockSource interface (whole-snapshot model), BundledBlockSource no-op, computeRevision (matches loader.ts DJB2), KV_KEYS contract, and a local minimal KVNamespace type (no @cloudflare/workers-types dep). Pure addition — dead code until wired by PR2.

Co-Authored-By: Claude Opus 4.8 (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.

1 participant