Skip to content

Commit

Permalink
chore(build): Update Cloudflare worker types to the recommended defau…
Browse files Browse the repository at this point in the history
…lt compatibility date of 2023-07-01 (#167)

* chore(deps): Rebuild pnpm-lock.yml

* chore(build): Update build system to vite-plugin-dts

* Add changeset
  • Loading branch information
AdiRishi committed May 4, 2024
1 parent 744dfed commit 8547aa0
Show file tree
Hide file tree
Showing 9 changed files with 878 additions and 408 deletions.
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

0 comments on commit 8547aa0

Please sign in to comment.