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
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alchemy",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.57.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"author": "Sam Goodwin <sam@alchemy.run>",
|
|
6
6
|
"homepage": "https://alchemy.run",
|
|
@@ -61,6 +61,34 @@
|
|
|
61
61
|
"bun": "./src/cloudflare/index.ts",
|
|
62
62
|
"import": "./lib/cloudflare/index.js"
|
|
63
63
|
},
|
|
64
|
+
"./cloudflare/astro": {
|
|
65
|
+
"bun": "./src/cloudflare/astro/plugin.ts",
|
|
66
|
+
"import": "./lib/cloudflare/astro/plugin.js"
|
|
67
|
+
},
|
|
68
|
+
"./cloudflare/nuxt": {
|
|
69
|
+
"bun": "./src/cloudflare/nuxt/plugin.ts",
|
|
70
|
+
"import": "./lib/cloudflare/nuxt/plugin.js"
|
|
71
|
+
},
|
|
72
|
+
"./cloudflare/redwood": {
|
|
73
|
+
"bun": "./src/cloudflare/redwood/plugin.ts",
|
|
74
|
+
"import": "./lib/cloudflare/redwood/plugin.js"
|
|
75
|
+
},
|
|
76
|
+
"./cloudflare/react-router": {
|
|
77
|
+
"bun": "./src/cloudflare/react-router/plugin.ts",
|
|
78
|
+
"import": "./lib/cloudflare/react-router/plugin.js"
|
|
79
|
+
},
|
|
80
|
+
"./cloudflare/sveltekit": {
|
|
81
|
+
"bun": "./src/cloudflare/sveltekit/plugin.ts",
|
|
82
|
+
"import": "./lib/cloudflare/sveltekit/plugin.js"
|
|
83
|
+
},
|
|
84
|
+
"./cloudflare/tanstack-start": {
|
|
85
|
+
"bun": "./src/cloudflare/tanstack-start/plugin.ts",
|
|
86
|
+
"import": "./lib/cloudflare/tanstack-start/plugin.js"
|
|
87
|
+
},
|
|
88
|
+
"./cloudflare/vite": {
|
|
89
|
+
"bun": "./src/cloudflare/vite/plugin.ts",
|
|
90
|
+
"import": "./lib/cloudflare/vite/plugin.js"
|
|
91
|
+
},
|
|
64
92
|
"./dns": {
|
|
65
93
|
"bun": "./src/dns/index.ts",
|
|
66
94
|
"import": "./lib/dns/index.js"
|
|
@@ -93,6 +121,10 @@
|
|
|
93
121
|
"bun": "./src/planetscale/index.ts",
|
|
94
122
|
"import": "./lib/planetscale/index.js"
|
|
95
123
|
},
|
|
124
|
+
"./random": {
|
|
125
|
+
"bun": "./src/random/index.ts",
|
|
126
|
+
"import": "./lib/random/index.js"
|
|
127
|
+
},
|
|
96
128
|
"./sentry": {
|
|
97
129
|
"bun": "./src/sentry/index.ts",
|
|
98
130
|
"import": "./lib/sentry/index.js"
|
|
@@ -143,7 +175,9 @@
|
|
|
143
175
|
"@swc/core": "^1.11.24",
|
|
144
176
|
"aws4fetch": "^1.0.20",
|
|
145
177
|
"diff": "^8.0.2",
|
|
178
|
+
"env-paths": "^3.0.0",
|
|
146
179
|
"esbuild": "^0.25.1",
|
|
180
|
+
"execa": "^9.6.0",
|
|
147
181
|
"fast-json-patch": "^3.1.1",
|
|
148
182
|
"fast-xml-parser": "^5.2.5",
|
|
149
183
|
"glob": "^10.0.0",
|
|
@@ -155,10 +189,10 @@
|
|
|
155
189
|
"open": "^10.1.2",
|
|
156
190
|
"openapi-types": "^12.1.3",
|
|
157
191
|
"pathe": "^2.0.3",
|
|
192
|
+
"signal-exit": "^4.1.0",
|
|
158
193
|
"turndown": "^7.0.0",
|
|
159
194
|
"unenv": "2.0.0-rc.15",
|
|
160
195
|
"ws": "^8.18.3",
|
|
161
|
-
"xdg-app-paths": "^8.3.0",
|
|
162
196
|
"yaml": "^2.0.0"
|
|
163
197
|
},
|
|
164
198
|
"peerDependencies": {
|
|
@@ -175,13 +209,13 @@
|
|
|
175
209
|
"@aws-sdk/client-sqs": "^3.0.0",
|
|
176
210
|
"@aws-sdk/client-ssm": "^3.0.0",
|
|
177
211
|
"@aws-sdk/client-sts": "^3.0.0",
|
|
212
|
+
"@cloudflare/vite-plugin": "^1.10.1",
|
|
178
213
|
"@libsql/client": "^0.15.9",
|
|
179
214
|
"@octokit/rest": "^21.1.1",
|
|
180
215
|
"ai": "^4.0.0",
|
|
181
216
|
"arktype": "^2.0.0",
|
|
182
217
|
"cloudflare": "^4.0.0",
|
|
183
218
|
"drizzle-orm": "^0.44.2",
|
|
184
|
-
"execa": "^9.6.0",
|
|
185
219
|
"hono": "^4.0.0",
|
|
186
220
|
"prettier": "^3.0.0",
|
|
187
221
|
"stripe": "^17.0.0"
|
|
@@ -198,6 +232,9 @@
|
|
|
198
232
|
"@cloudflare/workers-types": "^4.20250620.0",
|
|
199
233
|
"@iarna/toml": "^2.2.5",
|
|
200
234
|
"@octokit/rest": "^21.1.1",
|
|
235
|
+
"@react-router/dev": "^7.7.1",
|
|
236
|
+
"@sveltejs/adapter-cloudflare": "^7.1.2",
|
|
237
|
+
"@sentry/cloudflare": "^9.43.0",
|
|
201
238
|
"@types/bun": "latest",
|
|
202
239
|
"@types/diff": "^5.0.0",
|
|
203
240
|
"@types/fs-extra": "^11.0.4",
|
|
@@ -220,9 +257,11 @@
|
|
|
220
257
|
"libsodium-wrappers": "^0.7.15",
|
|
221
258
|
"listr2": "^8.0.0",
|
|
222
259
|
"nitro-cloudflare-dev": "^0.2.2",
|
|
260
|
+
"nitropack": "^2.12.4",
|
|
223
261
|
"openpgp": "^6.1.0",
|
|
224
262
|
"picocolors": "^1.1.1",
|
|
225
263
|
"prettier": "^3.5.3",
|
|
264
|
+
"rwsdk": "^0.1.28",
|
|
226
265
|
"trpc-cli": "^0.10.0",
|
|
227
266
|
"ts-morph": "^26.0.0",
|
|
228
267
|
"tsdown": "^0.13.0",
|
|
@@ -232,7 +271,7 @@
|
|
|
232
271
|
"typescript": "^5.8.3",
|
|
233
272
|
"vite": "^6.0.7",
|
|
234
273
|
"vitepress": "^1.6.3",
|
|
235
|
-
"wrangler": "^
|
|
274
|
+
"wrangler": "^4.27.0",
|
|
236
275
|
"yaml": "^2.7.1",
|
|
237
276
|
"zod": "^4.0.10"
|
|
238
277
|
}
|
package/src/alchemy.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import fs from "node:fs/promises";
|
|
2
2
|
import path from "node:path";
|
|
3
3
|
|
|
4
|
+
import { onExit } from "signal-exit";
|
|
4
5
|
import { ReplacedSignal } from "./apply.ts";
|
|
5
6
|
import { DestroyStrategy, DestroyedSignal, destroy } from "./destroy.ts";
|
|
6
7
|
import { env } from "./env.ts";
|
|
@@ -172,6 +173,12 @@ async function _alchemy(
|
|
|
172
173
|
password: mergedOptions?.password ?? process.env.ALCHEMY_PASSWORD,
|
|
173
174
|
telemetryClient,
|
|
174
175
|
});
|
|
176
|
+
onExit((code) => {
|
|
177
|
+
root.cleanup().then(() => {
|
|
178
|
+
process.exit(code);
|
|
179
|
+
});
|
|
180
|
+
return true;
|
|
181
|
+
});
|
|
175
182
|
const stageName = mergedOptions?.stage ?? DEFAULT_STAGE;
|
|
176
183
|
const stage = new Scope({
|
|
177
184
|
...mergedOptions,
|
package/src/apply.ts
CHANGED
|
@@ -15,7 +15,6 @@ import {
|
|
|
15
15
|
} from "./resource.ts";
|
|
16
16
|
import { Scope, type PendingDeletions } from "./scope.ts";
|
|
17
17
|
import { serialize } from "./serde.ts";
|
|
18
|
-
import type { State } from "./state.ts";
|
|
19
18
|
import { formatFQN } from "./util/cli.ts";
|
|
20
19
|
import { logger } from "./util/logger.ts";
|
|
21
20
|
import type { Telemetry } from "./util/telemetry/index.ts";
|
|
@@ -53,9 +52,7 @@ async function _apply<Out extends Resource>(
|
|
|
53
52
|
try {
|
|
54
53
|
const quiet = props?.quiet ?? scope.quiet;
|
|
55
54
|
await scope.init();
|
|
56
|
-
let state
|
|
57
|
-
resource[ResourceID],
|
|
58
|
-
))!;
|
|
55
|
+
let state = await scope.state.get(resource[ResourceID]);
|
|
59
56
|
const provider: Provider = PROVIDERS.get(resource[ResourceKind]);
|
|
60
57
|
if (provider === undefined) {
|
|
61
58
|
throw new Error(`Provider "${resource[ResourceKind]}" not found`);
|
|
@@ -280,17 +277,16 @@ async function _apply<Out extends Resource>(
|
|
|
280
277
|
replaced: isReplaced,
|
|
281
278
|
});
|
|
282
279
|
|
|
283
|
-
state =
|
|
280
|
+
state = await scope.state.get(resource[ResourceID]);
|
|
284
281
|
await scope.state.set(resource[ResourceID], {
|
|
285
282
|
kind: resource[ResourceKind],
|
|
286
283
|
id: resource[ResourceID],
|
|
287
284
|
fqn: resource[ResourceFQN],
|
|
288
285
|
seq: resource[ResourceSeq],
|
|
289
|
-
data: state
|
|
286
|
+
data: state?.data ?? {}, // TODO: this used to be force-unwrapped but that was crashing for me - is this change ok?
|
|
290
287
|
status,
|
|
291
288
|
output,
|
|
292
289
|
props,
|
|
293
|
-
// deps: [...deps],
|
|
294
290
|
});
|
|
295
291
|
return output as any;
|
|
296
292
|
} catch (error) {
|
|
@@ -1,15 +1,18 @@
|
|
|
1
|
-
import
|
|
2
|
-
import
|
|
3
|
-
import type {
|
|
4
|
-
import type {
|
|
5
|
-
import { Website } from "
|
|
6
|
-
import type { Worker } from "
|
|
1
|
+
import { join, resolve } from "node:path";
|
|
2
|
+
import { getPackageManagerRunner } from "../../util/detect-package-manager.ts";
|
|
3
|
+
import type { Assets } from "../assets.ts";
|
|
4
|
+
import type { Bindings } from "../bindings.ts";
|
|
5
|
+
import { Website, type WebsiteProps } from "../website.ts";
|
|
6
|
+
import type { Worker } from "../worker.ts";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Properties for creating an Astro resource.
|
|
10
10
|
* Extends WebsiteProps, allowing customization of the underlying Website.
|
|
11
11
|
*/
|
|
12
|
-
export interface AstroProps<B extends Bindings>
|
|
12
|
+
export interface AstroProps<B extends Bindings>
|
|
13
|
+
extends Omit<WebsiteProps<B>, "spa"> {
|
|
14
|
+
output?: "server" | "static";
|
|
15
|
+
}
|
|
13
16
|
|
|
14
17
|
/**
|
|
15
18
|
* Represents the output of an Astro resource deployment.
|
|
@@ -65,29 +68,43 @@ export async function Astro<B extends Bindings>(
|
|
|
65
68
|
id: string,
|
|
66
69
|
props: AstroProps<B> = {},
|
|
67
70
|
): Promise<Astro<B>> {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
const main = props?.main ?? path.join("dist", "_worker.js/index.js");
|
|
73
|
-
const assetsDir =
|
|
74
|
-
typeof props?.assets === "string"
|
|
75
|
-
? props?.assets
|
|
76
|
-
: (props?.assets?.dist ?? "dist");
|
|
77
|
-
|
|
78
|
-
return Website(id, {
|
|
71
|
+
const cwd = resolve(props.cwd ?? process.cwd());
|
|
72
|
+
const output = props.output ?? (await resolveOutputType(cwd));
|
|
73
|
+
const runner = await getPackageManagerRunner();
|
|
74
|
+
return await Website(id, {
|
|
79
75
|
...props,
|
|
80
|
-
command: props.command ?? "astro build",
|
|
81
|
-
dev: props.dev ?? {
|
|
82
|
-
command: "astro dev",
|
|
83
|
-
},
|
|
84
76
|
noBundle: props.noBundle ?? true,
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
wrangler,
|
|
77
|
+
build: props.build ?? `${runner} astro build`,
|
|
78
|
+
dev: props.dev ?? `${runner} astro dev`,
|
|
79
|
+
entrypoint:
|
|
80
|
+
props.entrypoint ??
|
|
81
|
+
(output === "server" ? "dist/_worker.js/index.js" : undefined),
|
|
82
|
+
assets: props.assets ?? "dist",
|
|
92
83
|
});
|
|
93
84
|
}
|
|
85
|
+
|
|
86
|
+
async function resolveOutputType(cwd: string): Promise<"server" | "static"> {
|
|
87
|
+
const candidates = [
|
|
88
|
+
"astro.config.mjs",
|
|
89
|
+
"astro.config.js",
|
|
90
|
+
"astro.config.ts",
|
|
91
|
+
"astro.config.mts",
|
|
92
|
+
];
|
|
93
|
+
for (const candidate of candidates) {
|
|
94
|
+
try {
|
|
95
|
+
const config = await import(join(cwd, candidate));
|
|
96
|
+
if (
|
|
97
|
+
typeof config.default === "object" &&
|
|
98
|
+
config.default &&
|
|
99
|
+
"output" in config.default &&
|
|
100
|
+
typeof config.default.output === "string"
|
|
101
|
+
) {
|
|
102
|
+
return config.default.output;
|
|
103
|
+
}
|
|
104
|
+
return "static";
|
|
105
|
+
} catch {
|
|
106
|
+
// ignore
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
return "static";
|
|
110
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import cloudflare, { type Options } from "@astrojs/cloudflare";
|
|
2
|
+
import { getPlatformProxyOptions } from "../cloudflare-env-proxy.ts";
|
|
3
|
+
|
|
4
|
+
const alchemy = (options?: Options) => {
|
|
5
|
+
return cloudflare({
|
|
6
|
+
platformProxy: getPlatformProxyOptions(options?.platformProxy),
|
|
7
|
+
...options,
|
|
8
|
+
});
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default alchemy;
|
|
@@ -3,11 +3,9 @@ import assert from "node:assert";
|
|
|
3
3
|
|
|
4
4
|
export interface HotReloadPluginProps {
|
|
5
5
|
onBuildStart?: () => void | Promise<void>;
|
|
6
|
-
onBuildEnd?: (result: esbuild.BuildResult) => void | Promise<void>;
|
|
7
|
-
onBuildError?: (errors: esbuild.Message[]) => void | Promise<void>;
|
|
8
6
|
}
|
|
9
7
|
|
|
10
|
-
export function createHotReloadPlugin(): {
|
|
8
|
+
export function createHotReloadPlugin(props?: HotReloadPluginProps): {
|
|
11
9
|
plugin: esbuild.Plugin;
|
|
12
10
|
iterator: AsyncIterable<esbuild.BuildResult>;
|
|
13
11
|
} {
|
|
@@ -22,6 +20,9 @@ export function createHotReloadPlugin(): {
|
|
|
22
20
|
const plugin: esbuild.Plugin = {
|
|
23
21
|
name: "alchemy-hot-reload",
|
|
24
22
|
setup(build) {
|
|
23
|
+
if (props?.onBuildStart) {
|
|
24
|
+
build.onStart(props.onBuildStart);
|
|
25
|
+
}
|
|
25
26
|
build.onEnd(async (result) => {
|
|
26
27
|
assert(_controller);
|
|
27
28
|
_controller.enqueue(result);
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import type { GetPlatformProxyOptions } from "wrangler";
|
|
2
|
+
import {
|
|
3
|
+
DEFAULT_CONFIG_PATH,
|
|
4
|
+
DEFAULT_PERSIST_PATH,
|
|
5
|
+
validateConfigPath,
|
|
6
|
+
validatePersistPath,
|
|
7
|
+
} from "./miniflare/paths.ts";
|
|
8
|
+
|
|
9
|
+
export const getCloudflareEnvProxy = async <E>(
|
|
10
|
+
options: GetPlatformProxyOptions = {},
|
|
11
|
+
) => {
|
|
12
|
+
const { getPlatformProxy } = await import("wrangler");
|
|
13
|
+
const config = getPlatformProxyOptions(options);
|
|
14
|
+
const proxy = await getPlatformProxy(config);
|
|
15
|
+
return proxy.env as E;
|
|
16
|
+
};
|
|
17
|
+
|
|
18
|
+
export const getPlatformProxyOptions = (
|
|
19
|
+
input: GetPlatformProxyOptions = {},
|
|
20
|
+
): GetPlatformProxyOptions => {
|
|
21
|
+
const persist =
|
|
22
|
+
input.persist === false
|
|
23
|
+
? false
|
|
24
|
+
: {
|
|
25
|
+
path: validatePersistPath(
|
|
26
|
+
typeof input.persist === "object" &&
|
|
27
|
+
typeof input.persist.path === "string"
|
|
28
|
+
? input.persist.path
|
|
29
|
+
: DEFAULT_PERSIST_PATH,
|
|
30
|
+
),
|
|
31
|
+
};
|
|
32
|
+
if (!persist) {
|
|
33
|
+
const message =
|
|
34
|
+
"[Alchemy] Persistence for local bindings is disabled. Some bindings may not work as expected. To enable, remove the \`persist\` option from getPlatformProxyOptions.";
|
|
35
|
+
if (!warned.has(message)) {
|
|
36
|
+
console.warn(message);
|
|
37
|
+
warned.add(message);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return {
|
|
41
|
+
...input,
|
|
42
|
+
configPath: validateConfigPath(input.configPath ?? DEFAULT_CONFIG_PATH),
|
|
43
|
+
persist,
|
|
44
|
+
experimental: input.experimental ?? {
|
|
45
|
+
remoteBindings: true,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
const warned = new Set<string>();
|
|
@@ -13,7 +13,7 @@ export const COMPATIBILITY_PRESETS = {
|
|
|
13
13
|
* Node.js compatibility preset
|
|
14
14
|
* Enables Node.js APIs and runtime compatibility
|
|
15
15
|
*/
|
|
16
|
-
node: ["nodejs_compat"],
|
|
16
|
+
node: ["nodejs_compat", "nodejs_compat_populate_process_env"],
|
|
17
17
|
} as const;
|
|
18
18
|
|
|
19
19
|
export type CompatibilityPreset = keyof typeof COMPATIBILITY_PRESETS;
|
|
@@ -13,7 +13,7 @@ export const applyLocalD1Migrations = async (
|
|
|
13
13
|
const miniflare = new mf.Miniflare({
|
|
14
14
|
script: "",
|
|
15
15
|
modules: true,
|
|
16
|
-
defaultPersistRoot: path.join(process.cwd(), ".alchemy/miniflare"),
|
|
16
|
+
defaultPersistRoot: path.join(process.cwd(), ".alchemy/miniflare/v3"), // vite plugin forces /v3 suffix
|
|
17
17
|
d1Persist: true,
|
|
18
18
|
d1Databases: { DB: options.databaseId },
|
|
19
19
|
log: process.env.DEBUG ? new mf.Log(mf.LogLevel.DEBUG) : undefined,
|
package/src/cloudflare/index.ts
CHANGED
|
@@ -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";
|