refactor(cf): adopt @cloudflare/workers-types#61
Open
techiejd wants to merge 4 commits into
Open
Conversation
The CF adapter's '/// <reference types="@cloudflare/workers-types" />' pulls in Workers ambient globals that redefine Request/Response (where .json() returns unknown, not the DOM's any). The root tsconfig included ./adapters/*/src/**, so 'tsc --noEmit' (build:types:all) leaked those globals into core endpoint/admin code and failed typecheck. Adapters are already typechecked independently via their own tsconfig.build.json in the CI build job, so root coverage of adapter sources was redundant.
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.
Swaps the hand-rolled Vectorize binding types for the official
@cloudflare/workers-typespackage.@cloudflare/workers-typesas a devDependency.VectorizeMatch,VectorizeQueryResult,VectorizeVector, and theCloudflareVectorizeBindinginterface;getVectorizeBindingnow returns the official globalVectorizetype (which exposesgetByIds).export type CloudflareVectorizeBinding = Vectorizeso the published export name is unchanged.types.ts(nocompilerOptions.typesnarrowing —tsconfig.build.jsonstays in parity with the pg/mongodb adapters).No behavior change. Full CF suite green (90 tests) with zero test edits.
Prerequisite for
findEmbeddingsByIds— unlocks the typedgetByIdsused by the upcoming CFfindByIds.