Skip to content

Commit 0185508

Browse files
authored
convert to JS (#4474)
1 parent 77702f9 commit 0185508

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

packages/adapter-cloudflare/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@
2323
],
2424
"main": "index.js",
2525
"scripts": {
26-
"build": "esbuild src/worker.ts --bundle --outfile=files/worker.js --external:SERVER --external:MANIFEST --format=esm",
26+
"build": "esbuild src/worker.js --bundle --outfile=files/worker.js --external:SERVER --external:MANIFEST --format=esm",
2727
"lint": "eslint --ignore-path .gitignore \"**/*.{ts,js,svelte}\" && npm run check-format",
2828
"format": "npm run check-format -- --write",
2929
"check": "tsc --skipLibCheck",

packages/adapter-cloudflare/src/worker.ts renamed to packages/adapter-cloudflare/src/worker.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,12 @@ import { Server } from 'SERVER';
22
import { manifest, prerendered } from 'MANIFEST';
33
import * as Cache from 'worktop/cfw.cache';
44

5-
import type { Module, Bindings } from 'worktop/cfw';
6-
import type { Durable } from 'worktop/cfw.durable';
7-
8-
interface Environment extends Bindings {
9-
ASSETS: Durable.Object;
10-
}
11-
125
const server = new Server(manifest);
136

147
const prefix = `/${manifest.appDir}/`;
158

16-
const worker: Module.Worker<Environment> = {
9+
/** @type {import('worktop/cfw').Module.Worker<{ ASSETS: import('worktop/cfw.durable').Durable.Object }>} */
10+
const worker = {
1711
async fetch(req, env, context) {
1812
try {
1913
let res = await Cache.lookup(req);

0 commit comments

Comments
 (0)