alchemy 0.55.3 → 0.57.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bin/alchemy.js +14245 -14406
- package/bin/commands/create.ts +7 -7
- package/bin/commands/deploy.ts +2 -2
- package/bin/commands/destroy.ts +2 -2
- package/bin/commands/dev.ts +2 -2
- package/bin/commands/init.ts +6 -6
- package/bin/commands/login.ts +3 -3
- package/bin/commands/run.ts +2 -2
- package/bin/services/execute-alchemy.ts +3 -3
- package/bin/trpc.ts +49 -0
- package/lib/alchemy.d.ts.map +1 -1
- package/lib/alchemy.js +7 -0
- package/lib/alchemy.js.map +1 -1
- package/lib/apply.d.ts.map +1 -1
- package/lib/apply.js +3 -4
- package/lib/apply.js.map +1 -1
- package/lib/cloudflare/{astro.d.ts → astro/astro.d.ts} +6 -5
- package/lib/cloudflare/astro/astro.d.ts.map +1 -0
- package/lib/cloudflare/astro/astro.js +91 -0
- package/lib/cloudflare/astro/astro.js.map +1 -0
- package/lib/cloudflare/astro/plugin.d.ts +4 -0
- package/lib/cloudflare/astro/plugin.d.ts.map +1 -0
- package/lib/cloudflare/astro/plugin.js +10 -0
- package/lib/cloudflare/astro/plugin.js.map +1 -0
- package/lib/cloudflare/bundle/plugin-hot-reload.d.ts +1 -3
- package/lib/cloudflare/bundle/plugin-hot-reload.d.ts.map +1 -1
- package/lib/cloudflare/bundle/plugin-hot-reload.js +4 -1
- package/lib/cloudflare/bundle/plugin-hot-reload.js.map +1 -1
- package/lib/cloudflare/cloudflare-env-proxy.d.ts +4 -0
- package/lib/cloudflare/cloudflare-env-proxy.d.ts.map +1 -0
- package/lib/cloudflare/cloudflare-env-proxy.js +34 -0
- package/lib/cloudflare/cloudflare-env-proxy.js.map +1 -0
- package/lib/cloudflare/compatibility-date.gen.d.ts +1 -1
- package/lib/cloudflare/compatibility-date.gen.js +1 -1
- package/lib/cloudflare/compatibility-presets.d.ts +1 -1
- package/lib/cloudflare/compatibility-presets.js +1 -1
- package/lib/cloudflare/compatibility-presets.js.map +1 -1
- package/lib/cloudflare/d1-local-migrations.js +1 -1
- package/lib/cloudflare/d1-local-migrations.js.map +1 -1
- package/lib/cloudflare/index.d.ts +8 -8
- package/lib/cloudflare/index.d.ts.map +1 -1
- package/lib/cloudflare/index.js +8 -8
- package/lib/cloudflare/index.js.map +1 -1
- package/lib/cloudflare/miniflare/build-worker-options.d.ts +22 -0
- package/lib/cloudflare/miniflare/build-worker-options.d.ts.map +1 -0
- package/lib/cloudflare/miniflare/build-worker-options.js +394 -0
- package/lib/cloudflare/miniflare/build-worker-options.js.map +1 -0
- package/lib/cloudflare/miniflare/miniflare-controller.d.ts +23 -0
- package/lib/cloudflare/miniflare/miniflare-controller.d.ts.map +1 -0
- package/lib/cloudflare/miniflare/miniflare-controller.js +111 -0
- package/lib/cloudflare/miniflare/miniflare-controller.js.map +1 -0
- package/lib/cloudflare/miniflare/miniflare-worker-proxy.d.ts.map +1 -1
- package/lib/cloudflare/miniflare/miniflare-worker-proxy.js +5 -15
- package/lib/cloudflare/miniflare/miniflare-worker-proxy.js.map +1 -1
- package/lib/cloudflare/miniflare/paths.d.ts +5 -0
- package/lib/cloudflare/miniflare/paths.d.ts.map +1 -0
- package/lib/cloudflare/miniflare/paths.js +35 -0
- package/lib/cloudflare/miniflare/paths.js.map +1 -0
- package/lib/cloudflare/miniflare/remote-binding-proxy.d.ts +1 -5
- package/lib/cloudflare/miniflare/remote-binding-proxy.d.ts.map +1 -1
- package/lib/cloudflare/miniflare/remote-binding-proxy.js +17 -22
- package/lib/cloudflare/miniflare/remote-binding-proxy.js.map +1 -1
- package/lib/cloudflare/{nuxt.d.ts → nuxt/nuxt.d.ts} +4 -4
- package/lib/cloudflare/nuxt/nuxt.d.ts.map +1 -0
- package/lib/cloudflare/{nuxt.js → nuxt/nuxt.js} +8 -13
- package/lib/cloudflare/nuxt/nuxt.js.map +1 -0
- package/lib/cloudflare/nuxt/plugin.d.ts +4 -0
- package/lib/cloudflare/nuxt/plugin.d.ts.map +1 -0
- package/lib/cloudflare/nuxt/plugin.js +14 -0
- package/lib/cloudflare/nuxt/plugin.js.map +1 -0
- package/lib/cloudflare/oauth.js +2 -2
- package/lib/cloudflare/oauth.js.map +1 -1
- package/lib/cloudflare/orange.d.ts +3 -3
- package/lib/cloudflare/orange.d.ts.map +1 -1
- package/lib/cloudflare/orange.js +11 -21
- package/lib/cloudflare/orange.js.map +1 -1
- package/lib/cloudflare/react-router/plugin.d.ts +4 -0
- package/lib/cloudflare/react-router/plugin.d.ts.map +1 -0
- package/lib/cloudflare/react-router/plugin.js +11 -0
- package/lib/cloudflare/react-router/plugin.js.map +1 -0
- package/lib/cloudflare/react-router/react-router.d.ts +17 -0
- package/lib/cloudflare/react-router/react-router.d.ts.map +1 -0
- package/lib/cloudflare/react-router/react-router.js +21 -0
- package/lib/cloudflare/react-router/react-router.js.map +1 -0
- package/lib/cloudflare/redwood/plugin.d.ts +4 -0
- package/lib/cloudflare/redwood/plugin.d.ts.map +1 -0
- package/lib/cloudflare/redwood/plugin.js +19 -0
- package/lib/cloudflare/redwood/plugin.js.map +1 -0
- package/lib/cloudflare/{redwood.d.ts → redwood/redwood.d.ts} +5 -5
- package/lib/cloudflare/redwood/redwood.d.ts.map +1 -0
- package/lib/cloudflare/{redwood.js → redwood/redwood.js} +12 -13
- package/lib/cloudflare/redwood/redwood.js.map +1 -0
- package/lib/cloudflare/sveltekit/plugin.d.ts +4 -0
- package/lib/cloudflare/sveltekit/plugin.d.ts.map +1 -0
- package/lib/cloudflare/sveltekit/plugin.js +11 -0
- package/lib/cloudflare/sveltekit/plugin.js.map +1 -0
- package/lib/cloudflare/{sveltekit.d.ts → sveltekit/sveltekit.d.ts} +5 -5
- package/lib/cloudflare/sveltekit/sveltekit.d.ts.map +1 -0
- package/lib/cloudflare/{sveltekit.js → sveltekit/sveltekit.js} +4 -4
- package/lib/cloudflare/sveltekit/sveltekit.js.map +1 -0
- package/lib/cloudflare/tanstack-start/plugin.d.ts +16 -0
- package/lib/cloudflare/tanstack-start/plugin.d.ts.map +1 -0
- package/lib/cloudflare/tanstack-start/plugin.js +28 -0
- package/lib/cloudflare/tanstack-start/plugin.js.map +1 -0
- package/lib/cloudflare/{tanstack-start.d.ts → tanstack-start/tanstack-start.d.ts} +5 -5
- package/lib/cloudflare/tanstack-start/tanstack-start.d.ts.map +1 -0
- package/lib/cloudflare/tanstack-start/tanstack-start.js +11 -0
- package/lib/cloudflare/tanstack-start/tanstack-start.js.map +1 -0
- package/lib/cloudflare/vite/plugin.d.ts +4 -0
- package/lib/cloudflare/vite/plugin.d.ts.map +1 -0
- package/lib/cloudflare/vite/plugin.js +23 -0
- package/lib/cloudflare/vite/plugin.js.map +1 -0
- package/lib/cloudflare/{vite.d.ts → vite/vite.d.ts} +4 -4
- package/lib/cloudflare/vite/vite.d.ts.map +1 -0
- package/lib/cloudflare/vite/vite.js +19 -0
- package/lib/cloudflare/vite/vite.js.map +1 -0
- package/lib/cloudflare/website.d.ts +92 -70
- package/lib/cloudflare/website.d.ts.map +1 -1
- package/lib/cloudflare/website.js +225 -94
- package/lib/cloudflare/website.js.map +1 -1
- package/lib/cloudflare/worker-bundle.d.ts +3 -1
- package/lib/cloudflare/worker-bundle.d.ts.map +1 -1
- package/lib/cloudflare/worker-bundle.js +42 -16
- package/lib/cloudflare/worker-bundle.js.map +1 -1
- package/lib/cloudflare/worker-stub.d.ts.map +1 -1
- package/lib/cloudflare/worker-stub.js +3 -6
- package/lib/cloudflare/worker-stub.js.map +1 -1
- package/lib/cloudflare/worker.d.ts +2 -7
- package/lib/cloudflare/worker.d.ts.map +1 -1
- package/lib/cloudflare/worker.js +17 -157
- package/lib/cloudflare/worker.js.map +1 -1
- package/lib/cloudflare/wrangler.json.d.ts +6 -0
- package/lib/cloudflare/wrangler.json.d.ts.map +1 -1
- package/lib/cloudflare/wrangler.json.js +23 -6
- package/lib/cloudflare/wrangler.json.js.map +1 -1
- package/lib/context.d.ts +11 -0
- package/lib/context.d.ts.map +1 -1
- package/lib/context.js +8 -0
- package/lib/context.js.map +1 -1
- package/lib/env.d.ts +2 -2
- package/lib/env.d.ts.map +1 -1
- package/lib/env.js +5 -6
- package/lib/env.js.map +1 -1
- package/lib/random/index.d.ts +2 -0
- package/lib/random/index.d.ts.map +1 -0
- package/lib/random/index.js +2 -0
- package/lib/random/index.js.map +1 -0
- package/lib/random/random-string.d.ts +87 -0
- package/lib/random/random-string.d.ts.map +1 -0
- package/lib/random/random-string.js +72 -0
- package/lib/random/random-string.js.map +1 -0
- package/lib/runtime/bind.d.ts +1 -1
- package/lib/runtime/bind.d.ts.map +1 -1
- package/lib/runtime/bind.js.map +1 -1
- package/lib/scope.d.ts +11 -0
- package/lib/scope.d.ts.map +1 -1
- package/lib/scope.js +24 -0
- package/lib/scope.js.map +1 -1
- package/lib/secret.d.ts +2 -2
- package/lib/secret.d.ts.map +1 -1
- package/lib/secret.js +2 -2
- package/lib/secret.js.map +1 -1
- package/lib/state/cloudflare-state-store.js +1 -1
- package/lib/state/cloudflare-state-store.js.map +1 -1
- package/lib/state/dofs-state-store/index.js +1 -1
- package/lib/state/dofs-state-store/index.js.map +1 -1
- package/lib/util/detect-package-manager.d.ts +1 -0
- package/lib/util/detect-package-manager.d.ts.map +1 -1
- package/lib/util/detect-package-manager.js +10 -0
- package/lib/util/detect-package-manager.js.map +1 -1
- package/lib/util/telemetry/client.d.ts +1 -1
- package/lib/util/telemetry/client.d.ts.map +1 -1
- package/lib/util/telemetry/client.js +22 -1
- package/lib/util/telemetry/client.js.map +1 -1
- package/lib/util/telemetry/constants.d.ts.map +1 -1
- package/lib/util/telemetry/constants.js +2 -3
- package/lib/util/telemetry/constants.js.map +1 -1
- package/lib/util/telemetry/context.d.ts +1 -1
- package/lib/util/telemetry/context.d.ts.map +1 -1
- package/lib/util/telemetry/types.d.ts +7 -3
- package/lib/util/telemetry/types.d.ts.map +1 -1
- package/lib/vercel/api.d.ts.map +1 -1
- package/lib/vercel/api.js +1 -1
- package/lib/vercel/api.js.map +1 -1
- package/package.json +43 -4
- package/src/alchemy.ts +7 -0
- package/src/apply.ts +3 -7
- package/src/cloudflare/{astro.ts → astro/astro.ts} +46 -29
- package/src/cloudflare/astro/plugin.ts +11 -0
- package/src/cloudflare/bundle/plugin-hot-reload.ts +4 -3
- package/src/cloudflare/cloudflare-env-proxy.ts +50 -0
- package/src/cloudflare/compatibility-date.gen.ts +1 -1
- package/src/cloudflare/compatibility-presets.ts +1 -1
- package/src/cloudflare/d1-local-migrations.ts +1 -1
- package/src/cloudflare/index.ts +8 -8
- package/src/cloudflare/miniflare/build-worker-options.ts +454 -0
- package/src/cloudflare/miniflare/miniflare-controller.ts +129 -0
- package/src/cloudflare/miniflare/miniflare-worker-proxy.ts +6 -15
- package/src/cloudflare/miniflare/paths.ts +52 -0
- package/src/cloudflare/miniflare/remote-binding-proxy.ts +18 -23
- package/src/cloudflare/{nuxt.ts → nuxt/nuxt.ts} +11 -16
- package/src/cloudflare/nuxt/plugin.ts +18 -0
- package/src/cloudflare/oauth.ts +2 -2
- package/src/cloudflare/orange.ts +13 -23
- package/src/cloudflare/react-router/plugin.ts +13 -0
- package/src/cloudflare/react-router/react-router.ts +41 -0
- package/src/cloudflare/redwood/plugin.ts +20 -0
- package/src/cloudflare/{redwood.ts → redwood/redwood.ts} +16 -19
- package/src/cloudflare/sveltekit/plugin.ts +12 -0
- package/src/cloudflare/{sveltekit.ts → sveltekit/sveltekit.ts} +9 -8
- package/src/cloudflare/tanstack-start/plugin.ts +30 -0
- package/src/cloudflare/tanstack-start/tanstack-start.ts +24 -0
- package/src/cloudflare/vite/plugin.ts +30 -0
- package/src/cloudflare/vite/vite.ts +34 -0
- package/src/cloudflare/website.ts +379 -204
- package/src/cloudflare/worker-bundle.ts +55 -16
- package/src/cloudflare/worker-stub.ts +11 -14
- package/src/cloudflare/worker.ts +23 -205
- package/src/cloudflare/wrangler.json.ts +32 -4
- package/src/context.ts +19 -0
- package/src/env.ts +8 -9
- package/src/random/index.ts +1 -0
- package/src/random/random-string.ts +126 -0
- package/src/runtime/bind.ts +2 -2
- package/src/scope.ts +25 -0
- package/src/secret.ts +4 -8
- package/src/state/cloudflare-state-store.ts +2 -2
- package/src/state/dofs-state-store/index.ts +1 -1
- package/src/util/detect-package-manager.ts +11 -0
- package/src/util/telemetry/client.ts +25 -2
- package/src/util/telemetry/constants.ts +2 -4
- package/src/util/telemetry/context.ts +1 -1
- package/src/util/telemetry/types.ts +8 -2
- package/src/vercel/api.ts +2 -4
- package/templates/astro/alchemy.run.ts +1 -3
- package/templates/astro/astro.config.mjs +2 -2
- package/templates/nuxt/alchemy.run.ts +1 -3
- package/templates/nuxt/nuxt.config.ts +4 -5
- package/templates/nuxt/package.json +0 -1
- package/templates/react-router/alchemy.run.ts +1 -4
- package/templates/react-router/vite.config.ts +2 -2
- package/templates/rwsdk/alchemy.run.ts +0 -1
- package/templates/rwsdk/package.json +0 -2
- package/templates/rwsdk/vite.config.mts +2 -2
- package/templates/sveltekit/alchemy.run.ts +1 -3
- package/templates/sveltekit/svelte.config.js +2 -2
- package/templates/tanstack-start/vite.config.ts +2 -2
- package/templates/vite/alchemy.run.ts +1 -1
- package/templates/vite/vite.config.ts +4 -5
- package/workers/cloudflare-state-store.js +12 -14
- package/lib/cloudflare/astro.d.ts.map +0 -1
- package/lib/cloudflare/astro.js +0 -69
- package/lib/cloudflare/astro.js.map +0 -1
- package/lib/cloudflare/local-dev-cloudflare-shim.d.ts +0 -13
- package/lib/cloudflare/local-dev-cloudflare-shim.d.ts.map +0 -1
- package/lib/cloudflare/local-dev-cloudflare-shim.js +0 -26
- package/lib/cloudflare/local-dev-cloudflare-shim.js.map +0 -1
- package/lib/cloudflare/miniflare/miniflare-worker-options.d.ts +0 -14
- package/lib/cloudflare/miniflare/miniflare-worker-options.d.ts.map +0 -1
- package/lib/cloudflare/miniflare/miniflare-worker-options.js +0 -468
- package/lib/cloudflare/miniflare/miniflare-worker-options.js.map +0 -1
- package/lib/cloudflare/miniflare/miniflare.d.ts +0 -40
- package/lib/cloudflare/miniflare/miniflare.d.ts.map +0 -1
- package/lib/cloudflare/miniflare/miniflare.js +0 -142
- package/lib/cloudflare/miniflare/miniflare.js.map +0 -1
- package/lib/cloudflare/nuxt.d.ts.map +0 -1
- package/lib/cloudflare/nuxt.js.map +0 -1
- package/lib/cloudflare/react-router.d.ts +0 -17
- package/lib/cloudflare/react-router.d.ts.map +0 -1
- package/lib/cloudflare/react-router.js +0 -35
- package/lib/cloudflare/react-router.js.map +0 -1
- package/lib/cloudflare/redwood.d.ts.map +0 -1
- package/lib/cloudflare/redwood.js.map +0 -1
- package/lib/cloudflare/sveltekit.d.ts.map +0 -1
- package/lib/cloudflare/sveltekit.js.map +0 -1
- package/lib/cloudflare/tanstack-start.d.ts.map +0 -1
- package/lib/cloudflare/tanstack-start.js +0 -21
- package/lib/cloudflare/tanstack-start.js.map +0 -1
- package/lib/cloudflare/vite.d.ts.map +0 -1
- package/lib/cloudflare/vite.js +0 -20
- package/lib/cloudflare/vite.js.map +0 -1
- package/src/cloudflare/local-dev-cloudflare-shim.ts +0 -25
- package/src/cloudflare/miniflare/miniflare-worker-options.ts +0 -599
- package/src/cloudflare/miniflare/miniflare.ts +0 -183
- package/src/cloudflare/react-router.ts +0 -56
- package/src/cloudflare/tanstack-start.ts +0 -35
- package/src/cloudflare/vite.ts +0 -35
- package/templates/react-router/wrangler.jsonc +0 -6
- package/templates/rwsdk/wrangler.jsonc +0 -31
- package/templates/sveltekit/wrangler.jsonc +0 -7
- package/templates/tanstack-start/wrangler.jsonc +0 -7
- package/templates/typescript/index.ts +0 -1
- package/templates/vite/wrangler.jsonc +0 -6
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { DEFAULT_CONFIG_PATH, DEFAULT_PERSIST_PATH, validateConfigPath, validatePersistPath, } from "./miniflare/paths.js";
|
|
2
|
+
export const getCloudflareEnvProxy = async (options = {}) => {
|
|
3
|
+
const { getPlatformProxy } = await import("wrangler");
|
|
4
|
+
const config = getPlatformProxyOptions(options);
|
|
5
|
+
const proxy = await getPlatformProxy(config);
|
|
6
|
+
return proxy.env;
|
|
7
|
+
};
|
|
8
|
+
export const getPlatformProxyOptions = (input = {}) => {
|
|
9
|
+
const persist = input.persist === false
|
|
10
|
+
? false
|
|
11
|
+
: {
|
|
12
|
+
path: validatePersistPath(typeof input.persist === "object" &&
|
|
13
|
+
typeof input.persist.path === "string"
|
|
14
|
+
? input.persist.path
|
|
15
|
+
: DEFAULT_PERSIST_PATH),
|
|
16
|
+
};
|
|
17
|
+
if (!persist) {
|
|
18
|
+
const message = "[Alchemy] Persistence for local bindings is disabled. Some bindings may not work as expected. To enable, remove the \`persist\` option from getPlatformProxyOptions.";
|
|
19
|
+
if (!warned.has(message)) {
|
|
20
|
+
console.warn(message);
|
|
21
|
+
warned.add(message);
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
...input,
|
|
26
|
+
configPath: validateConfigPath(input.configPath ?? DEFAULT_CONFIG_PATH),
|
|
27
|
+
persist,
|
|
28
|
+
experimental: input.experimental ?? {
|
|
29
|
+
remoteBindings: true,
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
};
|
|
33
|
+
const warned = new Set();
|
|
34
|
+
//# sourceMappingURL=cloudflare-env-proxy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cloudflare-env-proxy.js","sourceRoot":"","sources":["../../src/cloudflare/cloudflare-env-proxy.ts"],"names":[],"mappings":"AACA,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,kBAAkB,EAClB,mBAAmB,GACpB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,CAAC,MAAM,qBAAqB,GAAG,KAAK,EACxC,UAAmC,EAAE,EACrC,EAAE;IACF,MAAM,EAAE,gBAAgB,EAAE,GAAG,MAAM,MAAM,CAAC,UAAU,CAAC,CAAC;IACtD,MAAM,MAAM,GAAG,uBAAuB,CAAC,OAAO,CAAC,CAAC;IAChD,MAAM,KAAK,GAAG,MAAM,gBAAgB,CAAC,MAAM,CAAC,CAAC;IAC7C,OAAO,KAAK,CAAC,GAAQ,CAAC;AACxB,CAAC,CAAC;AAEF,MAAM,CAAC,MAAM,uBAAuB,GAAG,CACrC,QAAiC,EAAE,EACV,EAAE;IAC3B,MAAM,OAAO,GACX,KAAK,CAAC,OAAO,KAAK,KAAK;QACrB,CAAC,CAAC,KAAK;QACP,CAAC,CAAC;YACE,IAAI,EAAE,mBAAmB,CACvB,OAAO,KAAK,CAAC,OAAO,KAAK,QAAQ;gBAC/B,OAAO,KAAK,CAAC,OAAO,CAAC,IAAI,KAAK,QAAQ;gBACtC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,IAAI;gBACpB,CAAC,CAAC,oBAAoB,CACzB;SACF,CAAC;IACR,IAAI,CAAC,OAAO,EAAE,CAAC;QACb,MAAM,OAAO,GACX,sKAAsK,CAAC;QACzK,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,EAAE,CAAC;YACzB,OAAO,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;YACtB,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;QACtB,CAAC;IACH,CAAC;IACD,OAAO;QACL,GAAG,KAAK;QACR,UAAU,EAAE,kBAAkB,CAAC,KAAK,CAAC,UAAU,IAAI,mBAAmB,CAAC;QACvE,OAAO;QACP,YAAY,EAAE,KAAK,CAAC,YAAY,IAAI;YAClC,cAAc,EAAE,IAAI;SACrB;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,MAAM,GAAG,IAAI,GAAG,EAAU,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The default Cloudflare Workers compatibility date, set based on the latest workerd release at the time of build.
|
|
3
3
|
*/
|
|
4
|
-
export declare const DEFAULT_COMPATIBILITY_DATE = "2025-
|
|
4
|
+
export declare const DEFAULT_COMPATIBILITY_DATE = "2025-08-03";
|
|
5
5
|
//# sourceMappingURL=compatibility-date.gen.d.ts.map
|
|
@@ -3,5 +3,5 @@
|
|
|
3
3
|
/**
|
|
4
4
|
* The default Cloudflare Workers compatibility date, set based on the latest workerd release at the time of build.
|
|
5
5
|
*/
|
|
6
|
-
export const DEFAULT_COMPATIBILITY_DATE = "2025-
|
|
6
|
+
export const DEFAULT_COMPATIBILITY_DATE = "2025-08-03";
|
|
7
7
|
//# sourceMappingURL=compatibility-date.gen.js.map
|
|
@@ -12,7 +12,7 @@ export declare const COMPATIBILITY_PRESETS: {
|
|
|
12
12
|
* Node.js compatibility preset
|
|
13
13
|
* Enables Node.js APIs and runtime compatibility
|
|
14
14
|
*/
|
|
15
|
-
readonly node: readonly ["nodejs_compat"];
|
|
15
|
+
readonly node: readonly ["nodejs_compat", "nodejs_compat_populate_process_env"];
|
|
16
16
|
};
|
|
17
17
|
export type CompatibilityPreset = keyof typeof COMPATIBILITY_PRESETS;
|
|
18
18
|
/**
|
|
@@ -12,7 +12,7 @@ export const COMPATIBILITY_PRESETS = {
|
|
|
12
12
|
* Node.js compatibility preset
|
|
13
13
|
* Enables Node.js APIs and runtime compatibility
|
|
14
14
|
*/
|
|
15
|
-
node: ["nodejs_compat"],
|
|
15
|
+
node: ["nodejs_compat", "nodejs_compat_populate_process_env"],
|
|
16
16
|
};
|
|
17
17
|
/**
|
|
18
18
|
* Union preset compatibility flags with user-provided flags
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compatibility-presets.js","sourceRoot":"","sources":["../../src/cloudflare/compatibility-presets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC;;;OAGG;IACH,IAAI,EAAE,CAAC,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"compatibility-presets.js","sourceRoot":"","sources":["../../src/cloudflare/compatibility-presets.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,CAAC,MAAM,qBAAqB,GAAG;IACnC;;;OAGG;IACH,IAAI,EAAE,CAAC,eAAe,EAAE,oCAAoC,CAAC;CACrD,CAAC;AAIX;;GAEG;AACH,MAAM,UAAU,uBAAuB,CACrC,MAAuC,EACvC,YAAsB,EAAE;IAExB,IAAI,CAAC,MAAM,EAAE,CAAC;QACZ,OAAO,SAAS,CAAC;IACnB,CAAC;IAED,MAAM,WAAW,GAAG,qBAAqB,CAAC,MAAM,CAAC,CAAC;IAClD,OAAO,KAAK,CAAC,IAAI,CAAC,IAAI,GAAG,CAAC,CAAC,GAAG,WAAW,EAAE,GAAG,SAAS,CAAC,CAAC,CAAC,CAAC;AAC7D,CAAC"}
|
|
@@ -4,7 +4,7 @@ export const applyLocalD1Migrations = async (options) => {
|
|
|
4
4
|
const miniflare = new mf.Miniflare({
|
|
5
5
|
script: "",
|
|
6
6
|
modules: true,
|
|
7
|
-
defaultPersistRoot: path.join(process.cwd(), ".alchemy/miniflare"),
|
|
7
|
+
defaultPersistRoot: path.join(process.cwd(), ".alchemy/miniflare/v3"), // vite plugin forces /v3 suffix
|
|
8
8
|
d1Persist: true,
|
|
9
9
|
d1Databases: { DB: options.databaseId },
|
|
10
10
|
log: process.env.DEBUG ? new mf.Log(mf.LogLevel.DEBUG) : undefined,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"d1-local-migrations.js","sourceRoot":"","sources":["../../src/cloudflare/d1-local-migrations.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,IAAI,MAAM,WAAW,CAAC;AAQ7B,MAAM,CAAC,MAAM,sBAAsB,GAAG,KAAK,EACzC,OAAgC,EAChC,EAAE;IACF,MAAM,SAAS,GAAG,IAAI,EAAE,CAAC,SAAS,CAAC;QACjC,MAAM,EAAE,EAAE;QACV,OAAO,EAAE,IAAI;QACb,kBAAkB,EAAE,IAAI,CAAC,IAAI,CAAC,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D,CAAC;QACF,KAAK,MAAM,SAAS,IAAI,OAAO,CAAC,UAAU,EAAE,CAAC;YAC3C,IAAI,iBAAiB,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,KAAK,SAAS,CAAC,EAAE,CAAC,EAAE,CAAC;gBACnE,SAAS;YACX,CAAC;YACD,MAAM,OAAO,CAAC,OAAO,CAAC,SAAS,CAAC,GAAG,CAAC,CAAC,GAAG,EAAE,CAAC;YAC3C,MAAM,YAAY,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC;QAC9C,CAAC;IACH,CAAC;YAAS,CAAC;QACT,MAAM,SAAS,CAAC,OAAO,EAAE,CAAC;IAC5B,CAAC;AACH,CAAC,CAAC"}
|
|
@@ -9,12 +9,13 @@ export * from "./api-schema.ts";
|
|
|
9
9
|
export * from "./api-shield.ts";
|
|
10
10
|
export * from "./api.ts";
|
|
11
11
|
export * from "./assets.ts";
|
|
12
|
-
export * from "./astro.ts";
|
|
12
|
+
export * from "./astro/astro.ts";
|
|
13
13
|
export * from "./bindings.ts";
|
|
14
14
|
export * from "./bound.ts";
|
|
15
15
|
export * from "./browser-rendering.ts";
|
|
16
16
|
export * from "./bucket.ts";
|
|
17
17
|
export * from "./certificate-pack.ts";
|
|
18
|
+
export * from "./cloudflare-env-proxy.ts";
|
|
18
19
|
export * from "./compatibility-date.gen.ts";
|
|
19
20
|
export * from "./container.ts";
|
|
20
21
|
export * from "./custom-domain.ts";
|
|
@@ -32,28 +33,27 @@ export * from "./email-rule.ts";
|
|
|
32
33
|
export * from "./hyperdrive.ts";
|
|
33
34
|
export * from "./images.ts";
|
|
34
35
|
export * from "./kv-namespace.ts";
|
|
35
|
-
export * from "./
|
|
36
|
-
export * from "./nuxt.ts";
|
|
36
|
+
export * from "./nuxt/nuxt.ts";
|
|
37
37
|
export * from "./orange.ts";
|
|
38
38
|
export * from "./permission-groups.ts";
|
|
39
39
|
export * from "./pipeline.ts";
|
|
40
40
|
export * from "./queue-consumer.ts";
|
|
41
41
|
export * from "./queue.ts";
|
|
42
42
|
export * from "./rate-limit.ts";
|
|
43
|
-
export * from "./react-router.ts";
|
|
43
|
+
export * from "./react-router/react-router.ts";
|
|
44
44
|
export * from "./redirect-rule.ts";
|
|
45
|
-
export * from "./redwood.ts";
|
|
45
|
+
export * from "./redwood/redwood.ts";
|
|
46
46
|
export * from "./route.ts";
|
|
47
47
|
export * from "./secret-key.ts";
|
|
48
48
|
export * from "./secret.ts";
|
|
49
49
|
export * from "./secrets-store.ts";
|
|
50
50
|
export * from "./state.ts";
|
|
51
|
-
export * from "./sveltekit.ts";
|
|
52
|
-
export * from "./tanstack-start.ts";
|
|
51
|
+
export * from "./sveltekit/sveltekit.ts";
|
|
52
|
+
export * from "./tanstack-start/tanstack-start.ts";
|
|
53
53
|
export * from "./vectorize-index.ts";
|
|
54
54
|
export * from "./vectorize-metadata-index.ts";
|
|
55
55
|
export * from "./version-metadata.ts";
|
|
56
|
-
export * from "./vite.ts";
|
|
56
|
+
export * from "./vite/vite.ts";
|
|
57
57
|
export * from "./website.ts";
|
|
58
58
|
export * from "./worker-ref.ts";
|
|
59
59
|
export * from "./worker-stub.ts";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/cloudflare/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","s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Ac,YAAY,CAAC;AAC3B,cAAc,iBAAiB,CAAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC"}
|
package/lib/cloudflare/index.js
CHANGED
|
@@ -9,12 +9,13 @@ export * from "./api-schema.js";
|
|
|
9
9
|
export * from "./api-shield.js";
|
|
10
10
|
export * from "./api.js";
|
|
11
11
|
export * from "./assets.js";
|
|
12
|
-
export * from "./astro.js";
|
|
12
|
+
export * from "./astro/astro.js";
|
|
13
13
|
export * from "./bindings.js";
|
|
14
14
|
export * from "./bound.js";
|
|
15
15
|
export * from "./browser-rendering.js";
|
|
16
16
|
export * from "./bucket.js";
|
|
17
17
|
export * from "./certificate-pack.js";
|
|
18
|
+
export * from "./cloudflare-env-proxy.js";
|
|
18
19
|
export * from "./compatibility-date.gen.js";
|
|
19
20
|
export * from "./container.js";
|
|
20
21
|
export * from "./custom-domain.js";
|
|
@@ -32,28 +33,27 @@ export * from "./email-rule.js";
|
|
|
32
33
|
export * from "./hyperdrive.js";
|
|
33
34
|
export * from "./images.js";
|
|
34
35
|
export * from "./kv-namespace.js";
|
|
35
|
-
export * from "./
|
|
36
|
-
export * from "./nuxt.js";
|
|
36
|
+
export * from "./nuxt/nuxt.js";
|
|
37
37
|
export * from "./orange.js";
|
|
38
38
|
export * from "./permission-groups.js";
|
|
39
39
|
export * from "./pipeline.js";
|
|
40
40
|
export * from "./queue-consumer.js";
|
|
41
41
|
export * from "./queue.js";
|
|
42
42
|
export * from "./rate-limit.js";
|
|
43
|
-
export * from "./react-router.js";
|
|
43
|
+
export * from "./react-router/react-router.js";
|
|
44
44
|
export * from "./redirect-rule.js";
|
|
45
|
-
export * from "./redwood.js";
|
|
45
|
+
export * from "./redwood/redwood.js";
|
|
46
46
|
export * from "./route.js";
|
|
47
47
|
export * from "./secret-key.js";
|
|
48
48
|
export * from "./secret.js";
|
|
49
49
|
export * from "./secrets-store.js";
|
|
50
50
|
export * from "./state.js";
|
|
51
|
-
export * from "./sveltekit.js";
|
|
52
|
-
export * from "./tanstack-start.js";
|
|
51
|
+
export * from "./sveltekit/sveltekit.js";
|
|
52
|
+
export * from "./tanstack-start/tanstack-start.js";
|
|
53
53
|
export * from "./vectorize-index.js";
|
|
54
54
|
export * from "./vectorize-metadata-index.js";
|
|
55
55
|
export * from "./version-metadata.js";
|
|
56
|
-
export * from "./vite.js";
|
|
56
|
+
export * from "./vite/vite.js";
|
|
57
57
|
export * from "./website.js";
|
|
58
58
|
export * from "./worker-ref.js";
|
|
59
59
|
export * from "./worker-stub.js";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cloudflare/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAC;AACvC,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,SAAS,CAAC;AACxB,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,4BAA4B,CAAC;AAC3C,cAAc,iBAAiB,CAAC;AAChC,cAAc,iBAAiB,CAAC;AAChC,cAAc,UAAU,CAAC;AACzB,cAAc,aAAa,CAAC;AAC5B,cAAc,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/cloudflare/index.ts"],"names":[],"mappings":"AA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AAC;AAChC,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,YAAY,CAAC;AAC3B,cAAc,0BAA0B,CAAC;AACzC,cAAc,oCAAoC,CAAC;AACnD,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,uBAAuB,CAAC;AACtC,cAAc,gBAAgB,CAAC;AAC/B,cAAc,cAAc,CAAC;AAC7B,cAAc,iBAAiB,CAAC;AAChC,cAAc,kBAAkB,CAAC;AACjC,cAAc,uBAAuB,CAAC;AACtC,cAAc,aAAa,CAAC;AAC5B,OAAO,EAAE,QAAQ,EAAE,MAAM,eAAe,CAAC;AACzC,cAAc,oBAAoB,CAAC;AACnC,cAAc,WAAW,CAAC"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import * as miniflare from "miniflare";
|
|
2
|
+
import type { HTTPServer } from "../../util/http.ts";
|
|
3
|
+
import { type Bindings } from "../bindings.ts";
|
|
4
|
+
import { type EventSource } from "../event-source.ts";
|
|
5
|
+
import type { WorkerBundleSource } from "../worker-bundle.ts";
|
|
6
|
+
import type { AssetsConfig } from "../worker.ts";
|
|
7
|
+
export interface MiniflareWorkerInput {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
compatibilityDate: string | undefined;
|
|
11
|
+
compatibilityFlags: string[] | undefined;
|
|
12
|
+
bindings: Bindings | undefined;
|
|
13
|
+
eventSources: EventSource[] | undefined;
|
|
14
|
+
assets: AssetsConfig | undefined;
|
|
15
|
+
bundle: WorkerBundleSource;
|
|
16
|
+
port: number | undefined;
|
|
17
|
+
}
|
|
18
|
+
export declare const buildWorkerOptions: (input: MiniflareWorkerInput) => Promise<{
|
|
19
|
+
watch: (signal: AbortSignal) => AsyncGenerator<miniflare.WorkerOptions>;
|
|
20
|
+
remoteProxy: HTTPServer | undefined;
|
|
21
|
+
}>;
|
|
22
|
+
//# sourceMappingURL=build-worker-options.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-worker-options.d.ts","sourceRoot":"","sources":["../../../src/cloudflare/miniflare/build-worker-options.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,SAAS,MAAM,WAAW,CAAC;AAEvC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAGL,KAAK,QAAQ,EAGd,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAsB,KAAK,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC1E,OAAO,KAAK,EAAgB,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAC5E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAGjD,MAAM,WAAW,oBAAoB;IACnC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,iBAAiB,EAAE,MAAM,GAAG,SAAS,CAAC;IACtC,kBAAkB,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACzC,QAAQ,EAAE,QAAQ,GAAG,SAAS,CAAC;IAC/B,YAAY,EAAE,WAAW,EAAE,GAAG,SAAS,CAAC;IACxC,MAAM,EAAE,YAAY,GAAG,SAAS,CAAC;IACjC,MAAM,EAAE,kBAAkB,CAAC;IAC3B,IAAI,EAAE,MAAM,GAAG,SAAS,CAAC;CAC1B;AAiCD,eAAO,MAAM,kBAAkB,GAC7B,OAAO,oBAAoB,KAC1B,OAAO,CAAC;IACT,KAAK,EAAE,CAAC,MAAM,EAAE,WAAW,KAAK,cAAc,CAAC,SAAS,CAAC,aAAa,CAAC,CAAC;IACxE,WAAW,EAAE,UAAU,GAAG,SAAS,CAAC;CACrC,CAiWA,CAAC"}
|
|
@@ -0,0 +1,394 @@
|
|
|
1
|
+
import * as miniflare from "miniflare";
|
|
2
|
+
import { assertNever } from "../../util/assert-never.js";
|
|
3
|
+
import { Self, } from "../bindings.js";
|
|
4
|
+
import { isQueueEventSource } from "../event-source.js";
|
|
5
|
+
import { createRemoteProxyWorker } from "./remote-binding-proxy.js";
|
|
6
|
+
export const buildWorkerOptions = async (input) => {
|
|
7
|
+
const remoteBindings = [];
|
|
8
|
+
const options = {
|
|
9
|
+
name: input.name,
|
|
10
|
+
compatibilityDate: input.compatibilityDate,
|
|
11
|
+
compatibilityFlags: input.compatibilityFlags,
|
|
12
|
+
// TODO: Setting `proxy: true` here causes the following error when connecting via a websocket:
|
|
13
|
+
// workerd/io/worker.c++:2164: info: uncaught exception; source = Uncaught (in promise); stack = TypeError: Invalid URL string.
|
|
14
|
+
unsafeDirectSockets: [{ proxy: false }],
|
|
15
|
+
containerEngine: {
|
|
16
|
+
localDocker: {
|
|
17
|
+
socketPath: process.platform === "win32"
|
|
18
|
+
? "//./pipe/docker_engine"
|
|
19
|
+
: "unix:///var/run/docker.sock",
|
|
20
|
+
},
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
for (const [key, binding] of Object.entries(input.bindings ?? {})) {
|
|
24
|
+
if (typeof binding === "string") {
|
|
25
|
+
(options.bindings ??= {})[key] = binding;
|
|
26
|
+
continue;
|
|
27
|
+
}
|
|
28
|
+
if (binding === Self) {
|
|
29
|
+
(options.serviceBindings ??= {})[key] = miniflare.kCurrentWorker;
|
|
30
|
+
continue;
|
|
31
|
+
}
|
|
32
|
+
switch (binding.type) {
|
|
33
|
+
case "ai":
|
|
34
|
+
case "ai_gateway": {
|
|
35
|
+
remoteBindings.push({
|
|
36
|
+
type: "ai",
|
|
37
|
+
name: key,
|
|
38
|
+
raw: true,
|
|
39
|
+
});
|
|
40
|
+
break;
|
|
41
|
+
}
|
|
42
|
+
case "analytics_engine": {
|
|
43
|
+
(options.analyticsEngineDatasets ??= {})[key] = {
|
|
44
|
+
dataset: binding.dataset,
|
|
45
|
+
};
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
case "assets": {
|
|
49
|
+
options.assets = {
|
|
50
|
+
binding: key,
|
|
51
|
+
directory: binding.path,
|
|
52
|
+
assetConfig: {
|
|
53
|
+
html_handling: input.assets?.html_handling,
|
|
54
|
+
not_found_handling: input.assets?.not_found_handling,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
break;
|
|
58
|
+
}
|
|
59
|
+
case "browser": {
|
|
60
|
+
remoteBindings.push({
|
|
61
|
+
type: "browser",
|
|
62
|
+
name: key,
|
|
63
|
+
raw: true,
|
|
64
|
+
});
|
|
65
|
+
break;
|
|
66
|
+
}
|
|
67
|
+
case "container": {
|
|
68
|
+
(options.durableObjects ??= {})[key] = {
|
|
69
|
+
className: binding.className,
|
|
70
|
+
scriptName: binding.scriptName,
|
|
71
|
+
useSQLite: binding.sqlite,
|
|
72
|
+
container: {
|
|
73
|
+
imageName: binding.image.imageRef,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
break;
|
|
77
|
+
}
|
|
78
|
+
case "d1": {
|
|
79
|
+
if (isRemoteBinding(binding)) {
|
|
80
|
+
remoteBindings.push({
|
|
81
|
+
type: "d1",
|
|
82
|
+
name: key,
|
|
83
|
+
id: binding.id,
|
|
84
|
+
raw: true,
|
|
85
|
+
});
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
(options.d1Databases ??= {})[key] = binding.id;
|
|
89
|
+
}
|
|
90
|
+
break;
|
|
91
|
+
}
|
|
92
|
+
case "dispatch_namespace": {
|
|
93
|
+
remoteBindings.push({
|
|
94
|
+
type: "dispatch_namespace",
|
|
95
|
+
name: key,
|
|
96
|
+
namespace: binding.namespace,
|
|
97
|
+
raw: true,
|
|
98
|
+
});
|
|
99
|
+
break;
|
|
100
|
+
}
|
|
101
|
+
case "durable_object_namespace": {
|
|
102
|
+
(options.durableObjects ??= {})[key] = {
|
|
103
|
+
className: binding.className,
|
|
104
|
+
scriptName: binding.scriptName,
|
|
105
|
+
useSQLite: binding.sqlite,
|
|
106
|
+
};
|
|
107
|
+
break;
|
|
108
|
+
}
|
|
109
|
+
case "hyperdrive": {
|
|
110
|
+
throw new Error("Hyperdrive bindings are not supported in local mode");
|
|
111
|
+
}
|
|
112
|
+
case "images": {
|
|
113
|
+
if (isRemoteBinding(binding)) {
|
|
114
|
+
remoteBindings.push({
|
|
115
|
+
type: "images",
|
|
116
|
+
name: key,
|
|
117
|
+
raw: true,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
else {
|
|
121
|
+
options.images = {
|
|
122
|
+
binding: key,
|
|
123
|
+
};
|
|
124
|
+
}
|
|
125
|
+
break;
|
|
126
|
+
}
|
|
127
|
+
case "kv_namespace": {
|
|
128
|
+
const namespaceId = "namespaceId" in binding ? binding.namespaceId : binding.id;
|
|
129
|
+
if (isRemoteBinding(binding)) {
|
|
130
|
+
remoteBindings.push({
|
|
131
|
+
type: "kv_namespace",
|
|
132
|
+
name: key,
|
|
133
|
+
namespace_id: namespaceId,
|
|
134
|
+
raw: true,
|
|
135
|
+
});
|
|
136
|
+
}
|
|
137
|
+
else {
|
|
138
|
+
(options.kvNamespaces ??= {})[key] = namespaceId;
|
|
139
|
+
}
|
|
140
|
+
break;
|
|
141
|
+
}
|
|
142
|
+
case "json": {
|
|
143
|
+
(options.bindings ??= {})[key] = binding.json;
|
|
144
|
+
break;
|
|
145
|
+
}
|
|
146
|
+
case "queue": {
|
|
147
|
+
if (isRemoteBinding(binding)) {
|
|
148
|
+
remoteBindings.push({
|
|
149
|
+
type: "queue",
|
|
150
|
+
name: key,
|
|
151
|
+
queue_name: binding.name,
|
|
152
|
+
raw: true,
|
|
153
|
+
});
|
|
154
|
+
}
|
|
155
|
+
else {
|
|
156
|
+
(options.queueProducers ??= {})[key] = {
|
|
157
|
+
queueName: binding.name,
|
|
158
|
+
deliveryDelay: binding.settings?.deliveryDelay,
|
|
159
|
+
};
|
|
160
|
+
}
|
|
161
|
+
break;
|
|
162
|
+
}
|
|
163
|
+
case "pipeline": {
|
|
164
|
+
(options.pipelines ??= {})[key] = binding.id;
|
|
165
|
+
break;
|
|
166
|
+
}
|
|
167
|
+
case "ratelimit": {
|
|
168
|
+
(options.ratelimits ??= {})[key] = {
|
|
169
|
+
simple: binding.simple,
|
|
170
|
+
};
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
case "secret": {
|
|
174
|
+
(options.bindings ??= {})[key] = binding.unencrypted;
|
|
175
|
+
break;
|
|
176
|
+
}
|
|
177
|
+
case "secret_key": {
|
|
178
|
+
throw new Error("Secret keys are not supported in local mode");
|
|
179
|
+
}
|
|
180
|
+
case "secrets_store_secret": {
|
|
181
|
+
(options.secretsStoreSecrets ??= {})[key] = {
|
|
182
|
+
store_id: binding.storeId,
|
|
183
|
+
secret_name: binding.name,
|
|
184
|
+
};
|
|
185
|
+
break;
|
|
186
|
+
}
|
|
187
|
+
case "r2_bucket": {
|
|
188
|
+
if (isRemoteBinding(binding)) {
|
|
189
|
+
remoteBindings.push({
|
|
190
|
+
type: "r2_bucket",
|
|
191
|
+
name: key,
|
|
192
|
+
bucket_name: binding.name,
|
|
193
|
+
raw: true,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
else {
|
|
197
|
+
(options.r2Buckets ??= {})[key] = binding.name;
|
|
198
|
+
}
|
|
199
|
+
break;
|
|
200
|
+
}
|
|
201
|
+
case "service": {
|
|
202
|
+
const service = "service" in binding ? binding.service : binding.name;
|
|
203
|
+
const normalized = {
|
|
204
|
+
type: "service",
|
|
205
|
+
name: key,
|
|
206
|
+
service,
|
|
207
|
+
environment: "environment" in binding ? binding.environment : undefined,
|
|
208
|
+
};
|
|
209
|
+
if (isRemoteBinding(binding)) {
|
|
210
|
+
remoteBindings.push(normalized);
|
|
211
|
+
}
|
|
212
|
+
else {
|
|
213
|
+
(options.serviceBindings ??= {})[key] = service;
|
|
214
|
+
}
|
|
215
|
+
break;
|
|
216
|
+
}
|
|
217
|
+
case "vectorize": {
|
|
218
|
+
remoteBindings.push({
|
|
219
|
+
type: "vectorize",
|
|
220
|
+
name: key,
|
|
221
|
+
index_name: binding.name,
|
|
222
|
+
raw: true,
|
|
223
|
+
});
|
|
224
|
+
break;
|
|
225
|
+
}
|
|
226
|
+
case "version_metadata": {
|
|
227
|
+
(options.bindings ??= {})[key] = {
|
|
228
|
+
id: crypto.randomUUID(),
|
|
229
|
+
tag: "",
|
|
230
|
+
timestamp: "0",
|
|
231
|
+
};
|
|
232
|
+
break;
|
|
233
|
+
}
|
|
234
|
+
case "workflow": {
|
|
235
|
+
(options.workflows ??= {})[key] = {
|
|
236
|
+
name: binding.workflowName,
|
|
237
|
+
className: binding.className,
|
|
238
|
+
scriptName: binding.scriptName,
|
|
239
|
+
};
|
|
240
|
+
break;
|
|
241
|
+
}
|
|
242
|
+
default: {
|
|
243
|
+
assertNever(binding);
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
}
|
|
247
|
+
for (const eventSource of input.eventSources ?? []) {
|
|
248
|
+
const queue = "queue" in eventSource ? eventSource.queue : eventSource;
|
|
249
|
+
if (queue.dev?.remote) {
|
|
250
|
+
throw new Error(`Locally emulated workers cannot consume remote queues. Worker "${input.name}" is locally emulated but is consuming remote queue "${queue.name}".`);
|
|
251
|
+
}
|
|
252
|
+
if (isQueueEventSource(eventSource)) {
|
|
253
|
+
(options.queueConsumers ??= {})[queue.name] = {
|
|
254
|
+
maxBatchSize: eventSource.settings?.batchSize,
|
|
255
|
+
maxBatchTimeout: eventSource.settings?.maxWaitTimeMs,
|
|
256
|
+
maxRetries: eventSource.settings?.maxRetries,
|
|
257
|
+
retryDelay: eventSource.settings?.retryDelay,
|
|
258
|
+
};
|
|
259
|
+
}
|
|
260
|
+
else {
|
|
261
|
+
(options.queueConsumers ??= {})[eventSource.name] = {};
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
async function* watch(signal) {
|
|
265
|
+
for await (const bundle of input.bundle.watch(signal)) {
|
|
266
|
+
const { modules, rootPath } = normalizeBundle(bundle);
|
|
267
|
+
yield {
|
|
268
|
+
...options,
|
|
269
|
+
modules,
|
|
270
|
+
rootPath,
|
|
271
|
+
};
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
if (remoteBindings.length > 0) {
|
|
275
|
+
const remoteProxy = await createRemoteProxyWorker({
|
|
276
|
+
name: input.name,
|
|
277
|
+
bindings: remoteBindings,
|
|
278
|
+
});
|
|
279
|
+
for (const binding of remoteBindings) {
|
|
280
|
+
switch (binding.type) {
|
|
281
|
+
case "ai":
|
|
282
|
+
options.ai = {
|
|
283
|
+
binding: binding.name,
|
|
284
|
+
remoteProxyConnectionString: remoteProxy.connectionString,
|
|
285
|
+
};
|
|
286
|
+
break;
|
|
287
|
+
case "browser":
|
|
288
|
+
options.browserRendering = {
|
|
289
|
+
binding: binding.name,
|
|
290
|
+
remoteProxyConnectionString: remoteProxy.connectionString,
|
|
291
|
+
};
|
|
292
|
+
break;
|
|
293
|
+
case "d1":
|
|
294
|
+
(options.d1Databases ??= {})[binding.name] = {
|
|
295
|
+
id: binding.id,
|
|
296
|
+
remoteProxyConnectionString: remoteProxy.connectionString,
|
|
297
|
+
};
|
|
298
|
+
break;
|
|
299
|
+
case "dispatch_namespace":
|
|
300
|
+
(options.dispatchNamespaces ??= {})[binding.name] = {
|
|
301
|
+
namespace: binding.namespace,
|
|
302
|
+
remoteProxyConnectionString: remoteProxy.connectionString,
|
|
303
|
+
};
|
|
304
|
+
break;
|
|
305
|
+
case "kv_namespace":
|
|
306
|
+
(options.kvNamespaces ??= {})[binding.name] = {
|
|
307
|
+
id: binding.namespace_id,
|
|
308
|
+
remoteProxyConnectionString: remoteProxy.connectionString,
|
|
309
|
+
};
|
|
310
|
+
break;
|
|
311
|
+
case "images":
|
|
312
|
+
options.images = {
|
|
313
|
+
binding: binding.name,
|
|
314
|
+
remoteProxyConnectionString: remoteProxy.connectionString,
|
|
315
|
+
};
|
|
316
|
+
break;
|
|
317
|
+
case "mtls_certificate":
|
|
318
|
+
(options.mtlsCertificates ??= {})[binding.name] = {
|
|
319
|
+
certificate_id: binding.certificate_id,
|
|
320
|
+
remoteProxyConnectionString: remoteProxy.connectionString,
|
|
321
|
+
};
|
|
322
|
+
break;
|
|
323
|
+
case "queue":
|
|
324
|
+
(options.queueProducers ??= {})[binding.name] = {
|
|
325
|
+
queueName: binding.queue_name,
|
|
326
|
+
remoteProxyConnectionString: remoteProxy.connectionString,
|
|
327
|
+
};
|
|
328
|
+
break;
|
|
329
|
+
case "r2_bucket":
|
|
330
|
+
(options.r2Buckets ??= {})[binding.name] = {
|
|
331
|
+
id: binding.bucket_name,
|
|
332
|
+
remoteProxyConnectionString: remoteProxy.connectionString,
|
|
333
|
+
};
|
|
334
|
+
break;
|
|
335
|
+
case "service":
|
|
336
|
+
(options.serviceBindings ??= {})[binding.name] = {
|
|
337
|
+
name: binding.name,
|
|
338
|
+
remoteProxyConnectionString: remoteProxy.connectionString,
|
|
339
|
+
};
|
|
340
|
+
break;
|
|
341
|
+
case "vectorize":
|
|
342
|
+
(options.vectorize ??= {})[binding.name] = {
|
|
343
|
+
index_name: binding.index_name,
|
|
344
|
+
remoteProxyConnectionString: remoteProxy.connectionString,
|
|
345
|
+
};
|
|
346
|
+
break;
|
|
347
|
+
default: {
|
|
348
|
+
assertNever(binding);
|
|
349
|
+
}
|
|
350
|
+
}
|
|
351
|
+
}
|
|
352
|
+
return {
|
|
353
|
+
watch,
|
|
354
|
+
remoteProxy: remoteProxy.server,
|
|
355
|
+
};
|
|
356
|
+
}
|
|
357
|
+
return {
|
|
358
|
+
watch,
|
|
359
|
+
remoteProxy: undefined,
|
|
360
|
+
};
|
|
361
|
+
};
|
|
362
|
+
const moduleTypes = {
|
|
363
|
+
esm: "ESModule",
|
|
364
|
+
cjs: "CommonJS",
|
|
365
|
+
text: "Text",
|
|
366
|
+
data: "Data",
|
|
367
|
+
wasm: "CompiledWasm",
|
|
368
|
+
sourcemap: "Text",
|
|
369
|
+
};
|
|
370
|
+
const normalizeBundle = (bundle) => {
|
|
371
|
+
const modules = bundle.modules.map((module) => ({
|
|
372
|
+
type: moduleTypes[module.type],
|
|
373
|
+
path: module.path,
|
|
374
|
+
contents: module.content,
|
|
375
|
+
}));
|
|
376
|
+
const entry = modules.find((module) => module.path === bundle.entrypoint);
|
|
377
|
+
if (!entry) {
|
|
378
|
+
throw new Error(`Entrypoint "${bundle.entrypoint}" not found in bundle.`);
|
|
379
|
+
}
|
|
380
|
+
return {
|
|
381
|
+
modules: [entry, ...modules.filter((module) => module.path !== entry.path)],
|
|
382
|
+
rootPath: bundle.root,
|
|
383
|
+
};
|
|
384
|
+
};
|
|
385
|
+
const isRemoteBinding = (binding) => {
|
|
386
|
+
if (typeof binding === "string" || binding === Self) {
|
|
387
|
+
return false;
|
|
388
|
+
}
|
|
389
|
+
return ("dev" in binding &&
|
|
390
|
+
typeof binding.dev === "object" &&
|
|
391
|
+
"remote" in binding.dev &&
|
|
392
|
+
!!binding.dev.remote);
|
|
393
|
+
};
|
|
394
|
+
//# sourceMappingURL=build-worker-options.js.map
|