feat!: add pluggable cache adapters and remove fetchify/native - #6
Merged
Conversation
Adds a CacheAdapter interface, a createCacheAdapter factory for authoring custom adapters (Redis, Upstash, etc.), and a dependency-free in-memory adapter at fetchify/cache/memory. createFetchify's FetchifyOptions gains an optional cache field. BREAKING CHANGE: fetchify/native is removed. It has been an exact duplicate of the main fetchify entry point since the initial scaffold, with no platform-specific behavior. Import from fetchify instead — the API is identical. Co-Authored-By: Claude Sonnet 5 <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.
Summary
CacheAdapterinterface, acreateCacheAdapterfactory (analogous todefineOptions) for authoring custom cache adapters, and a dependency-free in-memory adapter published atfetchify/cache/memory.createFetchify'sFetchifyOptionsgains an optionalcachefield.create-fetchify.tsonly ever type-importsCacheAdapter, so usingcreateFetchifynever pulls in a concrete cache implementation.fetchify/nativeentry point (src/native.ts+ the"./native"export). It has been a byte-for-byte duplicate of the main entry since the initial scaffold; consumers should import fromfetchifyinstead — the API is identical.DOCS.mdand the OpenSpec specs (cache-adapters,cache-memory-adapternew;package-exports,fetchify-options,http-client,project-documentationupdated) to match.Test plan
bun test— 39/39 passbun run build— clean, producesdist/index.{js,d.ts}anddist/cache/memory.{js,d.ts}, nodist/native.*openspec validate --changes add-cache-adapters --strict— passes🤖 Generated with Claude Code