Skip to content
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
2 changes: 1 addition & 1 deletion packages/adapter-cloudflare/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
],
"main": "index.js",
"scripts": {
"build": "esbuild src/worker.ts --bundle --outfile=files/worker.js --external:SERVER --external:MANIFEST --format=esm",
"build": "esbuild src/worker.js --bundle --outfile=files/worker.js --external:SERVER --external:MANIFEST --format=esm",
"lint": "eslint --ignore-path .gitignore \"**/*.{ts,js,svelte}\" && npm run check-format",
"format": "npm run check-format -- --write",
"check": "tsc --skipLibCheck",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,12 @@ import { Server } from 'SERVER';
import { manifest, prerendered } from 'MANIFEST';
import * as Cache from 'worktop/cfw.cache';

import type { Module, Bindings } from 'worktop/cfw';
import type { Durable } from 'worktop/cfw.durable';

interface Environment extends Bindings {
ASSETS: Durable.Object;
}

const server = new Server(manifest);

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

const worker: Module.Worker<Environment> = {
/** @type {import('worktop/cfw').Module.Worker<{ ASSETS: import('worktop/cfw.durable').Durable.Object }>} */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Optional, free to disregard

Suggested change
/** @type {import('worktop/cfw').Module.Worker<{ ASSETS: import('worktop/cfw.durable').Durable.Object }>} */
/**
* @typedef Environment
* @property {import('worktop/cfw.durable').Durable.Object} ASSETS
*/
/** @type {import('worktop/cfw').Module.Worker<Environment>} */

const worker = {
async fetch(req, env, context) {
try {
let res = await Cache.lookup(req);
Expand Down