diff --git a/internal-packages/dev-bindings/.eslintrc.js b/internal-packages/dev-bindings/.eslintrc.js new file mode 100644 index 000000000..8b4b7e9c1 --- /dev/null +++ b/internal-packages/dev-bindings/.eslintrc.js @@ -0,0 +1,7 @@ +module.exports = { + root: true, + extends: ['@cloudflare/eslint-config-next-on-pages'], + rules: { + 'no-console': 'off', + }, +}; diff --git a/internal-packages/dev-bindings/README.md b/internal-packages/dev-bindings/README.md new file mode 100644 index 000000000..8790aa9a1 --- /dev/null +++ b/internal-packages/dev-bindings/README.md @@ -0,0 +1,3 @@ +# Next-on-pages Dev Bindings + +## TODO: populate readme diff --git a/internal-packages/dev-bindings/package.json b/internal-packages/dev-bindings/package.json new file mode 100644 index 000000000..d9d69569b --- /dev/null +++ b/internal-packages/dev-bindings/package.json @@ -0,0 +1,34 @@ +{ + "name": "@cloudflare/next-on-pages-dev-bindings", + "version": "0.0.1", + "main": "dist/index.cjs", + "scripts": { + "lint": "eslint src", + "types-check": "tsc --noEmit", + "build:js": "esbuild --bundle --format=cjs ./src/index.ts --external:miniflare --outfile=./dist/index.cjs --platform=node", + "build:types": "tsc --emitDeclarationOnly --declaration --outDir ./dist", + "build:js:watch": "npm run build:js -- --watch=forever", + "build:types:watch": "npm run build:types -- --watch", + "build": "npm run build:js && npm run build:types", + "build:watch": "npm run build:js:watch & npm run build:types:watch", + "test": "npx vitest --config vitest.config.ts" + }, + "files": [ + "dist", + "dev-init.cjs", + "dev-init.d.ts", + "devBindingsOptions.ts" + ], + "dependencies": { + "miniflare": "^3.20231002.0" + }, + "devDependencies": { + "@cloudflare/workers-types": "4.20231002.0", + "@tsconfig/strictest": "^2.0.0", + "esbuild": "^0.15.3", + "eslint": "^8.35.0", + "tsconfig": "*", + "typescript": "^5.0.4", + "vitest": "^0.32.2" + } +} diff --git a/internal-packages/dev-bindings/src/index.ts b/internal-packages/dev-bindings/src/index.ts new file mode 100644 index 000000000..cd92f5fce --- /dev/null +++ b/internal-packages/dev-bindings/src/index.ts @@ -0,0 +1,106 @@ +import { Miniflare } from 'miniflare'; + +export async function setupDevBindings(options: DevBindingsOptions) { + // we let the user define where to persist the data, we default back + // to .wrangler/state/v3 which is the currently used wrangler path + // (this is so that when they switch to wrangler pages dev they can + // still interact with the same data) + const persist = options?.persist ?? '.wrangler/state/v3'; + + const mf = new Miniflare({ + modules: true, + script: '', + ...(persist === false + ? { + // no data persistence + } + : { + kvPersist: `${persist}/kv`, + durableObjectsPersist: `${persist}/do`, + r2Persist: `${persist}/r2`, + d1Persist: `${persist}/d1`, + }), + ...(options ?? {}), + }); + + const bindingsCollections = await Promise.all([ + collectBindings(mf, 'KV', options?.kvNamespaces ?? []), + collectBindings(mf, 'DO', options?.durableObjects ?? []), + collectBindings(mf, 'R2', options?.r2Buckets ?? []), + collectBindings(mf, 'D1', options?.d1Databases ?? []), + ]); + + const bindings = bindingsCollections.flat(); + + // eslint-disable-next-line @typescript-eslint/no-var-requires + const vmModule = require('vm'); + const originalRunInContext = vmModule.runInContext.bind(vmModule); + + vmModule.runInContext = ( + ...args: [ + string, + { process?: { env?: Record } }, + ...[unknown], + ] + ) => { + const runtimeContext = args[1]; + if ( + runtimeContext.process?.env && + !runtimeContext.process?.env?.['BINDINGS_PROXY_SET'] + ) { + for (const binding of bindings) { + runtimeContext.process.env[binding.name] = binding.binding; + } + + runtimeContext.process.env['BINDINGS_PROXY_SET'] = true; + } + + return originalRunInContext(...args); + }; +} + +async function collectBindings( + mf: Miniflare, + type: 'KV' | 'DO' | 'R2' | 'D1', + bindingsOpts: string[] | Record, +) { + const bindingNames = getBindingsNames(bindingsOpts); + const bindingGetterFn = { + KV: mf.getKVNamespace.bind(mf), + DO: mf.getDurableObjectNamespace.bind(mf), + R2: mf.getR2Bucket.bind(mf), + D1: mf.getD1Database.bind(mf), + }[type]; + return Promise.all( + bindingNames.map(async bindingName => { + return { + name: bindingName, + type, + binding: await bindingGetterFn(bindingName), + }; + }), + ); +} + +function getBindingsNames( + bindings: string[] | Record, +): string[] { + if (Array.isArray(bindings)) return bindings; + return Object.keys(bindings); +} + +export type DevBindingsOptions = { + kvNamespaces?: string[] | Record; + durableObjects?: Record< + string, + | string + | { + scriptName?: string | undefined; + unsafeUniqueKey?: string | undefined; + className: string; + } + >; + r2Buckets?: string[] | Record; + d1Databases?: string[] | Record; + persist?: false | string; +}; diff --git a/internal-packages/dev-bindings/tsconfig.json b/internal-packages/dev-bindings/tsconfig.json new file mode 100644 index 000000000..fe037d6f1 --- /dev/null +++ b/internal-packages/dev-bindings/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "@cloudflare/next-on-pages-tsconfig/tsconfig.json", + "include": [".eslintrc.js", "src", "dev-init.cjs", "devBindingsOptions.ts"] +} diff --git a/internal-packages/docs-scraper/package.json b/internal-packages/docs-scraper/package.json index 0987c6480..f650bdfd0 100644 --- a/internal-packages/docs-scraper/package.json +++ b/internal-packages/docs-scraper/package.json @@ -1,5 +1,5 @@ { - "name": "docs-scraper", + "name": "@cloudflare/next-on-pages-docs-scraper", "private": true, "scripts": { "lint": "eslint scripts", diff --git a/package-lock.json b/package-lock.json index 4c643a266..7c2fe9af9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -16,7 +16,229 @@ "turbo": "^1.10.3" } }, + "internal-packages/dev-bindings": { + "name": "@cloudflare/next-on-pages-dev-bindings", + "version": "0.0.1", + "dependencies": { + "miniflare": "^3.20231002.0" + }, + "devDependencies": { + "@cloudflare/workers-types": "4.20231002.0", + "@tsconfig/strictest": "^2.0.0", + "esbuild": "^0.15.3", + "eslint": "^8.35.0", + "tsconfig": "*", + "typescript": "^5.0.4", + "vitest": "^0.32.2" + } + }, + "internal-packages/dev-bindings/node_modules/@cloudflare/workerd-darwin-64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20231002.0.tgz", + "integrity": "sha512-sgtjzVO/wtI/6S7O0bk4zQAv2xlvqOxB18AXzlit6uXgbYFGeQedRHjhKVMOacGmWEnM4C3ir/fxJGsc3Pyxng==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "internal-packages/dev-bindings/node_modules/@cloudflare/workerd-darwin-arm64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20231002.0.tgz", + "integrity": "sha512-dv8nztYFaTYYgBpyy80vc4hdMYv9mhyNbvBsZywm8S7ivcIpzogi0UKkGU4E/G0lYK6W3WtwTBqwRe+pXJ1+Ww==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "internal-packages/dev-bindings/node_modules/@cloudflare/workerd-linux-64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20231002.0.tgz", + "integrity": "sha512-UG8SlLcGzaQDSSw6FR4+Zf408925wkLOCAi8w5qEoFYu3g4Ef7ZenstesCOsyWL7qBDKx0/iwk6+a76W5IHI0Q==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "internal-packages/dev-bindings/node_modules/@cloudflare/workerd-linux-arm64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20231002.0.tgz", + "integrity": "sha512-GPaa66ZSq1gK09r87c5CJbHIApcIU//LVHz3rnUxK0//00YCwUuGUUK1dn/ylg+fVqDQxIDmH+ABnobBanvcDA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "internal-packages/dev-bindings/node_modules/@cloudflare/workerd-windows-64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20231002.0.tgz", + "integrity": "sha512-ybIy+sCme0VO0RscndXvqWNBaRMUOc8vhi+1N2h/KDsKfNLsfEQph+XWecfKzJseUy1yE2rV1xei3BaNmaa6vg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16" + } + }, + "internal-packages/dev-bindings/node_modules/@esbuild/android-arm": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.18.tgz", + "integrity": "sha512-5GT+kcs2WVGjVs7+boataCkO5Fg0y4kCjzkB5bAip7H4jfnOS3dA6KPiww9W1OEKTKeAcUVhdZGvgI65OXmUnw==", + "cpu": [ + "arm" + ], + "dev": true, + "optional": true, + "os": [ + "android" + ], + "engines": { + "node": ">=12" + } + }, + "internal-packages/dev-bindings/node_modules/@esbuild/linux-loong64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.18.tgz", + "integrity": "sha512-L4jVKS82XVhw2nvzLg/19ClLWg0y27ulRwuP7lcyL6AbUWB5aPglXY3M21mauDQMDfRLs8cQmeT03r/+X3cZYQ==", + "cpu": [ + "loong64" + ], + "dev": true, + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=12" + } + }, + "internal-packages/dev-bindings/node_modules/esbuild": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.18.tgz", + "integrity": "sha512-x/R72SmW3sSFRm5zrrIjAhCeQSAWoni3CmHEqfQrZIQTM3lVCdehdwuIqaOtfC2slvpdlLa62GYoN8SxT23m6Q==", + "dev": true, + "hasInstallScript": true, + "bin": { + "esbuild": "bin/esbuild" + }, + "engines": { + "node": ">=12" + }, + "optionalDependencies": { + "@esbuild/android-arm": "0.15.18", + "@esbuild/linux-loong64": "0.15.18", + "esbuild-android-64": "0.15.18", + "esbuild-android-arm64": "0.15.18", + "esbuild-darwin-64": "0.15.18", + "esbuild-darwin-arm64": "0.15.18", + "esbuild-freebsd-64": "0.15.18", + "esbuild-freebsd-arm64": "0.15.18", + "esbuild-linux-32": "0.15.18", + "esbuild-linux-64": "0.15.18", + "esbuild-linux-arm": "0.15.18", + "esbuild-linux-arm64": "0.15.18", + "esbuild-linux-mips64le": "0.15.18", + "esbuild-linux-ppc64le": "0.15.18", + "esbuild-linux-riscv64": "0.15.18", + "esbuild-linux-s390x": "0.15.18", + "esbuild-netbsd-64": "0.15.18", + "esbuild-openbsd-64": "0.15.18", + "esbuild-sunos-64": "0.15.18", + "esbuild-windows-32": "0.15.18", + "esbuild-windows-64": "0.15.18", + "esbuild-windows-arm64": "0.15.18" + } + }, + "internal-packages/dev-bindings/node_modules/miniflare": { + "version": "3.20231002.1", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20231002.1.tgz", + "integrity": "sha512-4xJ8FezJkQqHzCm71lovb9L/wJ0VV/odMFf5CIxfLTunsx97kTIlZnhS6aHuvcbzdztbWp1RR71K/1qFUHdpdQ==", + "dependencies": { + "acorn": "^8.8.0", + "acorn-walk": "^8.2.0", + "capnp-ts": "^0.7.0", + "exit-hook": "^2.2.1", + "glob-to-regexp": "^0.4.1", + "source-map-support": "0.5.21", + "stoppable": "^1.1.0", + "undici": "^5.22.1", + "workerd": "1.20231002.0", + "ws": "^8.11.0", + "youch": "^3.2.2", + "zod": "^3.20.6" + }, + "engines": { + "node": ">=16.13" + } + }, + "internal-packages/dev-bindings/node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "internal-packages/dev-bindings/node_modules/undici": { + "version": "5.25.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.25.4.tgz", + "integrity": "sha512-450yJxT29qKMf3aoudzFpIciqpx6Pji3hEWaXqXmanbXF58LTAGCKxcJjxMXWu3iG+Mudgo3ZUfDB6YDFd/dAw==", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "internal-packages/dev-bindings/node_modules/workerd": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20231002.0.tgz", + "integrity": "sha512-NFuUQBj30ZguDoPZ6bL40hINiu8aP2Pvxr/3xAdhWOwVFLuObPOiSdQ8qm4JYZ7jovxWjWE4Z7VR2avjIzEksQ==", + "hasInstallScript": true, + "bin": { + "workerd": "bin/workerd" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "@cloudflare/workerd-darwin-64": "1.20231002.0", + "@cloudflare/workerd-darwin-arm64": "1.20231002.0", + "@cloudflare/workerd-linux-64": "1.20231002.0", + "@cloudflare/workerd-linux-arm64": "1.20231002.0", + "@cloudflare/workerd-windows-64": "1.20231002.0" + } + }, "internal-packages/docs-scraper": { + "name": "@cloudflare/next-on-pages-docs-scraper", "dependencies": { "@actions/core": "^1.10.0", "@actions/github": "^5.1.1", @@ -2546,6 +2768,14 @@ "resolved": "packages/next-on-pages", "link": true }, + "node_modules/@cloudflare/next-on-pages-dev-bindings": { + "resolved": "internal-packages/dev-bindings", + "link": true + }, + "node_modules/@cloudflare/next-on-pages-docs-scraper": { + "resolved": "internal-packages/docs-scraper", + "link": true + }, "node_modules/@cloudflare/next-on-pages-tsconfig": { "resolved": "internal-packages/next-on-pages-tsconfig", "link": true @@ -2626,9 +2856,10 @@ } }, "node_modules/@cloudflare/workers-types": { - "version": "4.20230518.0", - "dev": true, - "license": "MIT OR Apache-2.0" + "version": "4.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20231002.0.tgz", + "integrity": "sha512-gQMKf3THqAFWH426OXXfVx0gFLXiSiL2fo6mKjQYx4PU74MgmVDFh25NvpAIBK+XN+xXlrImClfYeqErXIT7jA==", + "dev": true }, "node_modules/@cspotcode/source-map-support": { "version": "0.8.1", @@ -3080,6 +3311,14 @@ "node": "^12.22.0 || ^14.17.0 || >=16.0.0" } }, + "node_modules/@fastify/busboy": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz", + "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==", + "engines": { + "node": ">=14" + } + }, "node_modules/@gar/promisify": { "version": "1.1.3", "license": "MIT", @@ -4877,6 +5116,18 @@ "license": "MIT", "peer": true }, + "node_modules/@types/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-xevGOReSYGM7g/kUBZzPqCrR/KYAo+F0yiPc85WFTJa0MSLtyFTVTU6cJu/aV4mid7IffDIWqo69THF2o4JiEQ==", + "dev": true + }, + "node_modules/@types/strip-json-comments": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz", + "integrity": "sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==", + "dev": true + }, "node_modules/@types/unist": { "version": "2.0.6", "license": "MIT", @@ -7626,10 +7877,6 @@ "node": ">=8" } }, - "node_modules/docs-scraper": { - "resolved": "internal-packages/docs-scraper", - "link": true - }, "node_modules/doctrine": { "version": "3.0.0", "license": "Apache-2.0", @@ -17067,6 +17314,18 @@ "license": "Apache-2.0", "peer": true }, + "node_modules/tsconfig": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-7.0.0.tgz", + "integrity": "sha512-vZXmzPrL+EmC4T/4rVlT2jNVMWCi/O4DIiSj3UHg1OE5kCKbk4mfrXc6dZksLgRM/TZlKnousKH9bbTazUWRRw==", + "dev": true, + "dependencies": { + "@types/strip-bom": "^3.0.0", + "@types/strip-json-comments": "0.0.30", + "strip-bom": "^3.0.0", + "strip-json-comments": "^2.0.0" + } + }, "node_modules/tsconfig-paths": { "version": "4.2.0", "license": "MIT", @@ -17088,6 +17347,24 @@ "node": ">=4" } }, + "node_modules/tsconfig/node_modules/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true, + "engines": { + "node": ">=4" + } + }, + "node_modules/tsconfig/node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/tslib": { "version": "2.5.3", "license": "0BSD" @@ -20577,6 +20854,7 @@ "cookie": "^0.5.0", "esbuild": "^0.15.3", "js-yaml": "^4.1.0", + "miniflare": "^3.20231002.1", "package-manager-manager": "^0.1.2", "pcre-to-regexp": "^1.1.0", "semver": "^7.5.2", @@ -20588,6 +20866,7 @@ }, "devDependencies": { "@changesets/cli": "^2.26.0", + "@cloudflare/next-on-pages-dev-bindings": "*", "@cloudflare/next-on-pages-tsconfig": "*", "@cloudflare/workers-types": "^4.20230404.0", "@tsconfig/strictest": "^2.0.0", @@ -20610,6 +20889,81 @@ "wrangler": "^3.0.0" } }, + "packages/next-on-pages/node_modules/@cloudflare/workerd-darwin-64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20231002.0.tgz", + "integrity": "sha512-sgtjzVO/wtI/6S7O0bk4zQAv2xlvqOxB18AXzlit6uXgbYFGeQedRHjhKVMOacGmWEnM4C3ir/fxJGsc3Pyxng==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "packages/next-on-pages/node_modules/@cloudflare/workerd-darwin-arm64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20231002.0.tgz", + "integrity": "sha512-dv8nztYFaTYYgBpyy80vc4hdMYv9mhyNbvBsZywm8S7ivcIpzogi0UKkGU4E/G0lYK6W3WtwTBqwRe+pXJ1+Ww==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "darwin" + ], + "engines": { + "node": ">=16" + } + }, + "packages/next-on-pages/node_modules/@cloudflare/workerd-linux-64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20231002.0.tgz", + "integrity": "sha512-UG8SlLcGzaQDSSw6FR4+Zf408925wkLOCAi8w5qEoFYu3g4Ef7ZenstesCOsyWL7qBDKx0/iwk6+a76W5IHI0Q==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "packages/next-on-pages/node_modules/@cloudflare/workerd-linux-arm64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20231002.0.tgz", + "integrity": "sha512-GPaa66ZSq1gK09r87c5CJbHIApcIU//LVHz3rnUxK0//00YCwUuGUUK1dn/ylg+fVqDQxIDmH+ABnobBanvcDA==", + "cpu": [ + "arm64" + ], + "optional": true, + "os": [ + "linux" + ], + "engines": { + "node": ">=16" + } + }, + "packages/next-on-pages/node_modules/@cloudflare/workerd-windows-64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20231002.0.tgz", + "integrity": "sha512-ybIy+sCme0VO0RscndXvqWNBaRMUOc8vhi+1N2h/KDsKfNLsfEQph+XWecfKzJseUy1yE2rV1xei3BaNmaa6vg==", + "cpu": [ + "x64" + ], + "optional": true, + "os": [ + "win32" + ], + "engines": { + "node": ">=16" + } + }, "packages/next-on-pages/node_modules/@esbuild/android-arm": { "version": "0.15.18", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.18.tgz", @@ -20681,6 +21035,28 @@ "esbuild-windows-arm64": "0.15.18" } }, + "packages/next-on-pages/node_modules/miniflare": { + "version": "3.20231002.1", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20231002.1.tgz", + "integrity": "sha512-4xJ8FezJkQqHzCm71lovb9L/wJ0VV/odMFf5CIxfLTunsx97kTIlZnhS6aHuvcbzdztbWp1RR71K/1qFUHdpdQ==", + "dependencies": { + "acorn": "^8.8.0", + "acorn-walk": "^8.2.0", + "capnp-ts": "^0.7.0", + "exit-hook": "^2.2.1", + "glob-to-regexp": "^0.4.1", + "source-map-support": "0.5.21", + "stoppable": "^1.1.0", + "undici": "^5.22.1", + "workerd": "1.20231002.0", + "ws": "^8.11.0", + "youch": "^3.2.2", + "zod": "^3.20.6" + }, + "engines": { + "node": ">=16.13" + } + }, "packages/next-on-pages/node_modules/prettier": { "version": "2.8.8", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", @@ -20696,6 +21072,45 @@ "url": "https://github.com/prettier/prettier?sponsor=1" } }, + "packages/next-on-pages/node_modules/source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "dependencies": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "packages/next-on-pages/node_modules/undici": { + "version": "5.25.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.25.4.tgz", + "integrity": "sha512-450yJxT29qKMf3aoudzFpIciqpx6Pji3hEWaXqXmanbXF58LTAGCKxcJjxMXWu3iG+Mudgo3ZUfDB6YDFd/dAw==", + "dependencies": { + "@fastify/busboy": "^2.0.0" + }, + "engines": { + "node": ">=14.0" + } + }, + "packages/next-on-pages/node_modules/workerd": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20231002.0.tgz", + "integrity": "sha512-NFuUQBj30ZguDoPZ6bL40hINiu8aP2Pvxr/3xAdhWOwVFLuObPOiSdQ8qm4JYZ7jovxWjWE4Z7VR2avjIzEksQ==", + "hasInstallScript": true, + "bin": { + "workerd": "bin/workerd" + }, + "engines": { + "node": ">=16" + }, + "optionalDependencies": { + "@cloudflare/workerd-darwin-64": "1.20231002.0", + "@cloudflare/workerd-darwin-arm64": "1.20231002.0", + "@cloudflare/workerd-linux-64": "1.20231002.0", + "@cloudflare/workerd-linux-arm64": "1.20231002.0", + "@cloudflare/workerd-windows-64": "1.20231002.0" + } + }, "pages-e2e": { "dependencies": { "@cfpreview/pages-e2e-test-runner-cli": "^0.0.25", @@ -22348,6 +22763,7 @@ "version": "file:packages/next-on-pages", "requires": { "@changesets/cli": "^2.26.0", + "@cloudflare/next-on-pages-dev-bindings": "*", "@cloudflare/next-on-pages-tsconfig": "*", "@cloudflare/workers-types": "^4.20230404.0", "@tsconfig/strictest": "^2.0.0", @@ -22365,6 +22781,7 @@ "eslint": "^8.35.0", "image-to-base64": "^2.2.0", "js-yaml": "^4.1.0", + "miniflare": "^3.20231002.1", "mock-fs": "^5.2.0", "p-limit": "^4.0.0", "package-manager-manager": "^0.1.2", @@ -22378,6 +22795,36 @@ "zodcli": "^0.0.4" }, "dependencies": { + "@cloudflare/workerd-darwin-64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20231002.0.tgz", + "integrity": "sha512-sgtjzVO/wtI/6S7O0bk4zQAv2xlvqOxB18AXzlit6uXgbYFGeQedRHjhKVMOacGmWEnM4C3ir/fxJGsc3Pyxng==", + "optional": true + }, + "@cloudflare/workerd-darwin-arm64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20231002.0.tgz", + "integrity": "sha512-dv8nztYFaTYYgBpyy80vc4hdMYv9mhyNbvBsZywm8S7ivcIpzogi0UKkGU4E/G0lYK6W3WtwTBqwRe+pXJ1+Ww==", + "optional": true + }, + "@cloudflare/workerd-linux-64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20231002.0.tgz", + "integrity": "sha512-UG8SlLcGzaQDSSw6FR4+Zf408925wkLOCAi8w5qEoFYu3g4Ef7ZenstesCOsyWL7qBDKx0/iwk6+a76W5IHI0Q==", + "optional": true + }, + "@cloudflare/workerd-linux-arm64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20231002.0.tgz", + "integrity": "sha512-GPaa66ZSq1gK09r87c5CJbHIApcIU//LVHz3rnUxK0//00YCwUuGUUK1dn/ylg+fVqDQxIDmH+ABnobBanvcDA==", + "optional": true + }, + "@cloudflare/workerd-windows-64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20231002.0.tgz", + "integrity": "sha512-ybIy+sCme0VO0RscndXvqWNBaRMUOc8vhi+1N2h/KDsKfNLsfEQph+XWecfKzJseUy1yE2rV1xei3BaNmaa6vg==", + "optional": true + }, "@esbuild/android-arm": { "version": "0.15.18", "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.18.tgz", @@ -22423,14 +22870,210 @@ "esbuild-windows-arm64": "0.15.18" } }, + "miniflare": { + "version": "3.20231002.1", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20231002.1.tgz", + "integrity": "sha512-4xJ8FezJkQqHzCm71lovb9L/wJ0VV/odMFf5CIxfLTunsx97kTIlZnhS6aHuvcbzdztbWp1RR71K/1qFUHdpdQ==", + "requires": { + "acorn": "^8.8.0", + "acorn-walk": "^8.2.0", + "capnp-ts": "^0.7.0", + "exit-hook": "^2.2.1", + "glob-to-regexp": "^0.4.1", + "source-map-support": "0.5.21", + "stoppable": "^1.1.0", + "undici": "^5.22.1", + "workerd": "1.20231002.0", + "ws": "^8.11.0", + "youch": "^3.2.2", + "zod": "^3.20.6" + } + }, "prettier": { "version": "2.8.8", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.8.8.tgz", "integrity": "sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q==", "dev": true + }, + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "undici": { + "version": "5.25.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.25.4.tgz", + "integrity": "sha512-450yJxT29qKMf3aoudzFpIciqpx6Pji3hEWaXqXmanbXF58LTAGCKxcJjxMXWu3iG+Mudgo3ZUfDB6YDFd/dAw==", + "requires": { + "@fastify/busboy": "^2.0.0" + } + }, + "workerd": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20231002.0.tgz", + "integrity": "sha512-NFuUQBj30ZguDoPZ6bL40hINiu8aP2Pvxr/3xAdhWOwVFLuObPOiSdQ8qm4JYZ7jovxWjWE4Z7VR2avjIzEksQ==", + "requires": { + "@cloudflare/workerd-darwin-64": "1.20231002.0", + "@cloudflare/workerd-darwin-arm64": "1.20231002.0", + "@cloudflare/workerd-linux-64": "1.20231002.0", + "@cloudflare/workerd-linux-arm64": "1.20231002.0", + "@cloudflare/workerd-windows-64": "1.20231002.0" + } } } }, + "@cloudflare/next-on-pages-dev-bindings": { + "version": "file:internal-packages/dev-bindings", + "requires": { + "@cloudflare/workers-types": "4.20231002.0", + "@tsconfig/strictest": "^2.0.0", + "esbuild": "^0.15.3", + "eslint": "^8.35.0", + "miniflare": "^3.20231002.0", + "tsconfig": "*", + "typescript": "^5.0.4", + "vitest": "^0.32.2" + }, + "dependencies": { + "@cloudflare/workerd-darwin-64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-64/-/workerd-darwin-64-1.20231002.0.tgz", + "integrity": "sha512-sgtjzVO/wtI/6S7O0bk4zQAv2xlvqOxB18AXzlit6uXgbYFGeQedRHjhKVMOacGmWEnM4C3ir/fxJGsc3Pyxng==", + "optional": true + }, + "@cloudflare/workerd-darwin-arm64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-darwin-arm64/-/workerd-darwin-arm64-1.20231002.0.tgz", + "integrity": "sha512-dv8nztYFaTYYgBpyy80vc4hdMYv9mhyNbvBsZywm8S7ivcIpzogi0UKkGU4E/G0lYK6W3WtwTBqwRe+pXJ1+Ww==", + "optional": true + }, + "@cloudflare/workerd-linux-64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-64/-/workerd-linux-64-1.20231002.0.tgz", + "integrity": "sha512-UG8SlLcGzaQDSSw6FR4+Zf408925wkLOCAi8w5qEoFYu3g4Ef7ZenstesCOsyWL7qBDKx0/iwk6+a76W5IHI0Q==", + "optional": true + }, + "@cloudflare/workerd-linux-arm64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-linux-arm64/-/workerd-linux-arm64-1.20231002.0.tgz", + "integrity": "sha512-GPaa66ZSq1gK09r87c5CJbHIApcIU//LVHz3rnUxK0//00YCwUuGUUK1dn/ylg+fVqDQxIDmH+ABnobBanvcDA==", + "optional": true + }, + "@cloudflare/workerd-windows-64": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workerd-windows-64/-/workerd-windows-64-1.20231002.0.tgz", + "integrity": "sha512-ybIy+sCme0VO0RscndXvqWNBaRMUOc8vhi+1N2h/KDsKfNLsfEQph+XWecfKzJseUy1yE2rV1xei3BaNmaa6vg==", + "optional": true + }, + "@esbuild/android-arm": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/@esbuild/android-arm/-/android-arm-0.15.18.tgz", + "integrity": "sha512-5GT+kcs2WVGjVs7+boataCkO5Fg0y4kCjzkB5bAip7H4jfnOS3dA6KPiww9W1OEKTKeAcUVhdZGvgI65OXmUnw==", + "dev": true, + "optional": true + }, + "@esbuild/linux-loong64": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/@esbuild/linux-loong64/-/linux-loong64-0.15.18.tgz", + "integrity": "sha512-L4jVKS82XVhw2nvzLg/19ClLWg0y27ulRwuP7lcyL6AbUWB5aPglXY3M21mauDQMDfRLs8cQmeT03r/+X3cZYQ==", + "dev": true, + "optional": true + }, + "esbuild": { + "version": "0.15.18", + "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.15.18.tgz", + "integrity": "sha512-x/R72SmW3sSFRm5zrrIjAhCeQSAWoni3CmHEqfQrZIQTM3lVCdehdwuIqaOtfC2slvpdlLa62GYoN8SxT23m6Q==", + "dev": true, + "requires": { + "@esbuild/android-arm": "0.15.18", + "@esbuild/linux-loong64": "0.15.18", + "esbuild-android-64": "0.15.18", + "esbuild-android-arm64": "0.15.18", + "esbuild-darwin-64": "0.15.18", + "esbuild-darwin-arm64": "0.15.18", + "esbuild-freebsd-64": "0.15.18", + "esbuild-freebsd-arm64": "0.15.18", + "esbuild-linux-32": "0.15.18", + "esbuild-linux-64": "0.15.18", + "esbuild-linux-arm": "0.15.18", + "esbuild-linux-arm64": "0.15.18", + "esbuild-linux-mips64le": "0.15.18", + "esbuild-linux-ppc64le": "0.15.18", + "esbuild-linux-riscv64": "0.15.18", + "esbuild-linux-s390x": "0.15.18", + "esbuild-netbsd-64": "0.15.18", + "esbuild-openbsd-64": "0.15.18", + "esbuild-sunos-64": "0.15.18", + "esbuild-windows-32": "0.15.18", + "esbuild-windows-64": "0.15.18", + "esbuild-windows-arm64": "0.15.18" + } + }, + "miniflare": { + "version": "3.20231002.1", + "resolved": "https://registry.npmjs.org/miniflare/-/miniflare-3.20231002.1.tgz", + "integrity": "sha512-4xJ8FezJkQqHzCm71lovb9L/wJ0VV/odMFf5CIxfLTunsx97kTIlZnhS6aHuvcbzdztbWp1RR71K/1qFUHdpdQ==", + "requires": { + "acorn": "^8.8.0", + "acorn-walk": "^8.2.0", + "capnp-ts": "^0.7.0", + "exit-hook": "^2.2.1", + "glob-to-regexp": "^0.4.1", + "source-map-support": "0.5.21", + "stoppable": "^1.1.0", + "undici": "^5.22.1", + "workerd": "1.20231002.0", + "ws": "^8.11.0", + "youch": "^3.2.2", + "zod": "^3.20.6" + } + }, + "source-map-support": { + "version": "0.5.21", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.21.tgz", + "integrity": "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==", + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + } + }, + "undici": { + "version": "5.25.4", + "resolved": "https://registry.npmjs.org/undici/-/undici-5.25.4.tgz", + "integrity": "sha512-450yJxT29qKMf3aoudzFpIciqpx6Pji3hEWaXqXmanbXF58LTAGCKxcJjxMXWu3iG+Mudgo3ZUfDB6YDFd/dAw==", + "requires": { + "@fastify/busboy": "^2.0.0" + } + }, + "workerd": { + "version": "1.20231002.0", + "resolved": "https://registry.npmjs.org/workerd/-/workerd-1.20231002.0.tgz", + "integrity": "sha512-NFuUQBj30ZguDoPZ6bL40hINiu8aP2Pvxr/3xAdhWOwVFLuObPOiSdQ8qm4JYZ7jovxWjWE4Z7VR2avjIzEksQ==", + "requires": { + "@cloudflare/workerd-darwin-64": "1.20231002.0", + "@cloudflare/workerd-darwin-arm64": "1.20231002.0", + "@cloudflare/workerd-linux-64": "1.20231002.0", + "@cloudflare/workerd-linux-arm64": "1.20231002.0", + "@cloudflare/workerd-windows-64": "1.20231002.0" + } + } + } + }, + "@cloudflare/next-on-pages-docs-scraper": { + "version": "file:internal-packages/docs-scraper", + "requires": { + "@actions/core": "^1.10.0", + "@actions/github": "^5.1.1", + "eslint": "^8.35.0", + "puppeteer": "^20.7.4", + "ts-node": "^10.9.1", + "typescript": "^5.1.6" + } + }, "@cloudflare/next-on-pages-tsconfig": { "version": "file:internal-packages/next-on-pages-tsconfig" }, @@ -22465,7 +23108,9 @@ "optional": true }, "@cloudflare/workers-types": { - "version": "4.20230518.0", + "version": "4.20231002.0", + "resolved": "https://registry.npmjs.org/@cloudflare/workers-types/-/workers-types-4.20231002.0.tgz", + "integrity": "sha512-gQMKf3THqAFWH426OXXfVx0gFLXiSiL2fo6mKjQYx4PU74MgmVDFh25NvpAIBK+XN+xXlrImClfYeqErXIT7jA==", "dev": true }, "@cspotcode/source-map-support": { @@ -22678,6 +23323,11 @@ "resolved": "https://registry.npmjs.org/@eslint/js/-/js-8.43.0.tgz", "integrity": "sha512-s2UHCoiXfxMvmfzqoN+vrQ84ahUSYde9qNO1MdxmoEhyHWsfmwOpFlwYV+ePJEVc7gFnATGUi376WowX1N7tFg==" }, + "@fastify/busboy": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@fastify/busboy/-/busboy-2.0.0.tgz", + "integrity": "sha512-JUFJad5lv7jxj926GPgymrWQxxjPYuJNiNjNMzqT+HiuP6Vl3dk5xzG+8sTX96np0ZAluvaMzPsjhHZ5rNuNQQ==" + }, "@gar/promisify": { "version": "1.1.3", "peer": true @@ -24032,6 +24682,18 @@ "dev": true, "peer": true }, + "@types/strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-xevGOReSYGM7g/kUBZzPqCrR/KYAo+F0yiPc85WFTJa0MSLtyFTVTU6cJu/aV4mid7IffDIWqo69THF2o4JiEQ==", + "dev": true + }, + "@types/strip-json-comments": { + "version": "0.0.30", + "resolved": "https://registry.npmjs.org/@types/strip-json-comments/-/strip-json-comments-0.0.30.tgz", + "integrity": "sha512-7NQmHra/JILCd1QqpSzl8+mJRc8ZHz3uDm8YV1Ks9IhK0epEiTw8aIErbvH9PI+6XbqhyIQy3462nEsn7UVzjQ==", + "dev": true + }, "@types/unist": { "version": "2.0.6", "peer": true @@ -25711,17 +26373,6 @@ "path-type": "^4.0.0" } }, - "docs-scraper": { - "version": "file:internal-packages/docs-scraper", - "requires": { - "@actions/core": "^1.10.0", - "@actions/github": "^5.1.1", - "eslint": "^8.35.0", - "puppeteer": "^20.7.4", - "ts-node": "^10.9.1", - "typescript": "^5.1.6" - } - }, "doctrine": { "version": "3.0.0", "requires": { @@ -31608,6 +32259,32 @@ "version": "6.15.5", "peer": true }, + "tsconfig": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/tsconfig/-/tsconfig-7.0.0.tgz", + "integrity": "sha512-vZXmzPrL+EmC4T/4rVlT2jNVMWCi/O4DIiSj3UHg1OE5kCKbk4mfrXc6dZksLgRM/TZlKnousKH9bbTazUWRRw==", + "dev": true, + "requires": { + "@types/strip-bom": "^3.0.0", + "@types/strip-json-comments": "0.0.30", + "strip-bom": "^3.0.0", + "strip-json-comments": "^2.0.0" + }, + "dependencies": { + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", + "dev": true + }, + "strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "dev": true + } + } + }, "tsconfig-paths": { "version": "4.2.0", "peer": true, diff --git a/packages/next-on-pages/package.json b/packages/next-on-pages/package.json index 467975aaa..b1b0e549d 100644 --- a/packages/next-on-pages/package.json +++ b/packages/next-on-pages/package.json @@ -2,13 +2,24 @@ "name": "@cloudflare/next-on-pages", "version": "1.6.3", "bin": "./bin/index.js", + "exports": { + "./dev-bindings": "./dist/dev-bindings/index.cjs" + }, + "typesVersions": { + "*": { + "dev-bindings": [ + "./dist/dev-bindings/index.d.ts" + ] + } + }, "scripts": { "lint": "eslint src templates", "types-check": "tsc --noEmit", "build": "esbuild --bundle --platform=node ./src/index.ts --external:esbuild --external:chokidar --outfile=./dist/index.js", "build:watch": "npm run build -- --watch=forever", - "postbuild": "node ./build-no-nodejs-compat-flag-static-error-page.mjs", - "prepare": "npm run build", + "build:no-nodejs-compat-error-page": "node ./build-no-nodejs-compat-flag-static-error-page.mjs", + "build:dev-bindings": "npm run build --workspace @cloudflare/next-on-pages-dev-bindings && rm -rf ./dist/dev-bindings && cp -R ../../internal-packages/dev-bindings/dist ./dist/dev-bindings", + "prepare": "npm run build && npm run build:no-nodejs-compat-error-page && npm run build:dev-bindings", "test:unit": "npx vitest --config vitest.config.ts" }, "files": [ @@ -44,7 +55,8 @@ "pcre-to-regexp": "^1.1.0", "semver": "^7.5.2", "zod": "^3.21.4", - "zodcli": "^0.0.4" + "zodcli": "^0.0.4", + "miniflare": "^3.20231002.1" }, "peerDependencies": { "vercel": ">=30.0.0", @@ -53,6 +65,7 @@ "devDependencies": { "@changesets/cli": "^2.26.0", "@cloudflare/next-on-pages-tsconfig": "*", + "@cloudflare/next-on-pages-dev-bindings": "*", "@cloudflare/workers-types": "^4.20230404.0", "@tsconfig/strictest": "^2.0.0", "@types/cookie": "^0.5.1",