Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore(build): Update Cloudflare worker types to the recommended default compatibility date of 2023-07-01 #167

Merged
merged 3 commits into from
May 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/grumpy-coats-invite.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"cachified-adapter-cloudflare-kv": minor
---

Update Cloudflare worker types to the recommended default compatibility date of 2023-07-01
8 changes: 5 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
"type": "module",
"main": "dist/index.cjs",
"module": "dist/index.js",
"types": "dist/src/index.d.ts",
"types": "dist/index.d.ts",
"exports": {
".": {
"require": "./dist/index.cjs",
"import": "./dist/index.js",
"types": "./dist/src/index.d.ts"
"types": "./dist/index.d.ts"
}
},
"files": [
Expand Down Expand Up @@ -74,6 +74,7 @@
"tslib": "^2.6.2",
"typescript": "^5.4.5",
"vite": "^5.2.11",
"vite-plugin-dts": "^3.9.0",
"vitest": "^1.6.0",
"vitest-environment-miniflare": "^2.14.2"
},
Expand All @@ -85,5 +86,6 @@
"@cloudflare/workers-types": {
"optional": true
}
}
},
"packageManager": "pnpm@9.0.6"
}
1,259 changes: 861 additions & 398 deletions pnpm-lock.yaml

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion src/delete.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KVNamespace } from "@cloudflare/workers-types";
import { KVNamespace } from "@cloudflare/workers-types/2023-07-01";
import { buildCacheKey } from "./utils";

export async function deleteOperation(
Expand Down
2 changes: 1 addition & 1 deletion src/get.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KVNamespace } from "@cloudflare/workers-types";
import { KVNamespace } from "@cloudflare/workers-types/2023-07-01";
import { type CacheEntry, type CacheMetadata } from "@epic-web/cachified";
import { buildCacheKey } from "./utils";

Expand Down
2 changes: 1 addition & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { KVNamespace } from "@cloudflare/workers-types";
import type { KVNamespace } from "@cloudflare/workers-types/2023-07-01";
import { type Cache } from "@epic-web/cachified";
import { deleteOperation } from "./delete";
import { getOperation } from "./get";
Expand Down
2 changes: 1 addition & 1 deletion src/set.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KVNamespace } from "@cloudflare/workers-types";
import { KVNamespace } from "@cloudflare/workers-types/2023-07-01";
import { type CacheEntry, totalTtl } from "@epic-web/cachified";
import { buildCacheKey } from "./utils";

Expand Down
2 changes: 1 addition & 1 deletion tests/helpers.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { KVNamespace } from "@cloudflare/workers-types";
import { KVNamespace } from "@cloudflare/workers-types/2023-07-01";
import { SpyInstance } from "vitest";

export type Env = {
Expand Down
4 changes: 2 additions & 2 deletions vite.config.ts
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
/// <reference types="vitest" />
import typescript from "@rollup/plugin-typescript";
import path from "path";
import { typescriptPaths } from "rollup-plugin-typescript-paths";
import { defineConfig } from "vite";
import dts from "vite-plugin-dts";

export default defineConfig({
build: {
Expand All @@ -19,7 +19,7 @@ export default defineConfig({
external: ["@epic-web/cachified", "@cloudflare/workers-types"],
},
},
plugins: [typescriptPaths(), typescript()],
plugins: [typescriptPaths(), dts({ rollupTypes: true })],
test: {
reporters: ["verbose"],
coverage: {
Expand Down
Loading