feat(cms): BlockSource abstraction + bundled fallback [fast-deploy 1/5]#226
Open
hugo-ccabral wants to merge 1 commit into
Open
feat(cms): BlockSource abstraction + bundled fallback [fast-deploy 1/5]#226hugo-ccabral wants to merge 1 commit into
hugo-ccabral wants to merge 1 commit into
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.gensnapshot as fallback. Full design + cross-repo contracts indocs/fast-deploy.md(PR 5/5).This PR
src/cms/blockSource.ts—BlockSourceinterface (whole-snapshot model),BundledBlockSourceno-op,computeRevision(matchesloader.tsDJB2),KV_KEYScontract, and a local minimalKVNamespacetype (no@cloudflare/workers-typesdep).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 typecheckclean.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
BlockSourceabstraction for whole-snapshot CMS content with a no-opBundledBlockSourcefallback to enable KV-first fast deploys usingblocks.genas fallback. IntroducescomputeRevisionand a shared KV key contract for consistent revision checks.src/cms/blockSource.ts:BlockSource,BundledBlockSource,computeRevision,KV_KEYS, and a minimalKVNamespace(no@cloudflare/workers-types).src/cms/index.ts; tests insrc/cms/blockSource.test.ts. No runtime change until the read path is wired.Written for commit 8344831. Summary will update on new commits.