alchemy 2.0.0-beta.43 → 2.0.0-beta.45
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/cli.js +18 -5
- package/bin/exec.js +381 -240
- package/bin/exec.js.map +1 -1
- package/lib/AWS/Lambda/Function.d.ts +17 -0
- package/lib/AWS/Lambda/Function.d.ts.map +1 -1
- package/lib/AWS/Lambda/Function.js +61 -16
- package/lib/AWS/Lambda/Function.js.map +1 -1
- package/lib/AWS/Providers.d.ts +2 -1
- package/lib/AWS/Providers.d.ts.map +1 -1
- package/lib/AWS/Providers.js +3 -1
- package/lib/AWS/Providers.js.map +1 -1
- package/lib/Apply.js +17 -1
- package/lib/Apply.js.map +1 -1
- package/lib/Auth/AuthProvider.d.ts.map +1 -1
- package/lib/Auth/AuthProvider.js +24 -6
- package/lib/Auth/AuthProvider.js.map +1 -1
- package/lib/Auth/Credentials.d.ts.map +1 -1
- package/lib/Auth/Credentials.js +3 -3
- package/lib/Auth/Credentials.js.map +1 -1
- package/lib/Auth/Lock.js +2 -2
- package/lib/Auth/Lock.js.map +1 -1
- package/lib/Bundle/Bundle.d.ts +11 -0
- package/lib/Bundle/Bundle.d.ts.map +1 -1
- package/lib/Bundle/Bundle.js +19 -12
- package/lib/Bundle/Bundle.js.map +1 -1
- package/lib/Bundle/BundleAnalyzerPlugin.d.ts +25 -0
- package/lib/Bundle/BundleAnalyzerPlugin.d.ts.map +1 -0
- package/lib/Bundle/BundleAnalyzerPlugin.js +16 -0
- package/lib/Bundle/BundleAnalyzerPlugin.js.map +1 -0
- package/lib/Bundle/RawPlugin.d.ts +36 -0
- package/lib/Bundle/RawPlugin.d.ts.map +1 -0
- package/lib/Bundle/RawPlugin.js +80 -0
- package/lib/Bundle/RawPlugin.js.map +1 -0
- package/lib/Bundle/index.d.ts +2 -0
- package/lib/Bundle/index.d.ts.map +1 -1
- package/lib/Bundle/index.js +2 -0
- package/lib/Bundle/index.js.map +1 -1
- package/lib/Cli/commands/_shared.d.ts +13 -1
- package/lib/Cli/commands/_shared.d.ts.map +1 -1
- package/lib/Cli/commands/_shared.js +33 -2
- package/lib/Cli/commands/_shared.js.map +1 -1
- package/lib/Cli/commands/dev.d.ts +3 -2
- package/lib/Cli/commands/dev.d.ts.map +1 -1
- package/lib/Cli/commands/dev.js +19 -2
- package/lib/Cli/commands/dev.js.map +1 -1
- package/lib/Cli/commands/login.d.ts.map +1 -1
- package/lib/Cli/commands/login.js +19 -5
- package/lib/Cli/commands/login.js.map +1 -1
- package/lib/Cli/commands/profile.d.ts.map +1 -1
- package/lib/Cli/commands/profile.js +7 -27
- package/lib/Cli/commands/profile.js.map +1 -1
- package/lib/Cli/exec.d.ts.map +1 -1
- package/lib/Cli/exec.js +2 -1
- package/lib/Cli/exec.js.map +1 -1
- package/lib/Cli/main.d.ts.map +1 -1
- package/lib/Cli/main.js +0 -2
- package/lib/Cli/main.js.map +1 -1
- package/lib/Cloudflare/AiGateway/AiGateway.d.ts +0 -2
- package/lib/Cloudflare/AiGateway/AiGateway.d.ts.map +1 -1
- package/lib/Cloudflare/AiGateway/AiGateway.js +2 -4
- package/lib/Cloudflare/AiGateway/AiGateway.js.map +1 -1
- package/lib/Cloudflare/BrowserRendering/BrowserRendering.d.ts +116 -0
- package/lib/Cloudflare/BrowserRendering/BrowserRendering.d.ts.map +1 -0
- package/lib/Cloudflare/BrowserRendering/BrowserRendering.js +92 -0
- package/lib/Cloudflare/BrowserRendering/BrowserRendering.js.map +1 -0
- package/lib/Cloudflare/BrowserRendering/BrowserRenderingBinding.d.ts +55 -0
- package/lib/Cloudflare/BrowserRendering/BrowserRenderingBinding.d.ts.map +1 -0
- package/lib/Cloudflare/BrowserRendering/BrowserRenderingBinding.js +55 -0
- package/lib/Cloudflare/BrowserRendering/BrowserRenderingBinding.js.map +1 -0
- package/lib/Cloudflare/BrowserRendering/index.d.ts +3 -0
- package/lib/Cloudflare/BrowserRendering/index.d.ts.map +1 -0
- package/lib/Cloudflare/BrowserRendering/index.js +3 -0
- package/lib/Cloudflare/BrowserRendering/index.js.map +1 -0
- package/lib/Cloudflare/Container/Container.d.ts +3 -3
- package/lib/Cloudflare/Container/Container.js +3 -3
- package/lib/Cloudflare/Container/StartContainer.d.ts.map +1 -1
- package/lib/Cloudflare/Container/StartContainer.js.map +1 -1
- package/lib/Cloudflare/D1/D1Database.d.ts +1 -0
- package/lib/Cloudflare/D1/D1Database.d.ts.map +1 -1
- package/lib/Cloudflare/D1/D1Database.js +2 -1
- package/lib/Cloudflare/D1/D1Database.js.map +1 -1
- package/lib/Cloudflare/D1/D1DatabaseBinding.js +1 -1
- package/lib/Cloudflare/D1/D1DatabaseBinding.js.map +1 -1
- package/lib/Cloudflare/Fetcher.d.ts.map +1 -1
- package/lib/Cloudflare/Fetcher.js +0 -2
- package/lib/Cloudflare/Fetcher.js.map +1 -1
- package/lib/Cloudflare/Hyperdrive/Hyperdrive.d.ts +1 -0
- package/lib/Cloudflare/Hyperdrive/Hyperdrive.d.ts.map +1 -1
- package/lib/Cloudflare/Hyperdrive/Hyperdrive.js +3 -0
- package/lib/Cloudflare/Hyperdrive/Hyperdrive.js.map +1 -1
- package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.d.ts +3 -2
- package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.js +32 -33
- package/lib/Cloudflare/Hyperdrive/HyperdriveBinding.js.map +1 -1
- package/lib/Cloudflare/KV/KVNamespace.d.ts +1 -0
- package/lib/Cloudflare/KV/KVNamespace.d.ts.map +1 -1
- package/lib/Cloudflare/KV/KVNamespace.js +2 -0
- package/lib/Cloudflare/KV/KVNamespace.js.map +1 -1
- package/lib/Cloudflare/Local.d.ts +2 -0
- package/lib/Cloudflare/Local.d.ts.map +1 -0
- package/lib/Cloudflare/Local.js +9 -0
- package/lib/Cloudflare/Local.js.map +1 -0
- package/lib/Cloudflare/Providers.d.ts +2 -1
- package/lib/Cloudflare/Providers.d.ts.map +1 -1
- package/lib/Cloudflare/Providers.js +23 -17
- package/lib/Cloudflare/Providers.js.map +1 -1
- package/lib/Cloudflare/Queue/Queue.d.ts +1 -0
- package/lib/Cloudflare/Queue/Queue.d.ts.map +1 -1
- package/lib/Cloudflare/Queue/Queue.js +1 -0
- package/lib/Cloudflare/Queue/Queue.js.map +1 -1
- package/lib/Cloudflare/Queue/QueueConsumer.d.ts +2 -1
- package/lib/Cloudflare/Queue/QueueConsumer.d.ts.map +1 -1
- package/lib/Cloudflare/Queue/QueueConsumer.js +11 -3
- package/lib/Cloudflare/Queue/QueueConsumer.js.map +1 -1
- package/lib/Cloudflare/Queue/QueueEventSource.d.ts +30 -4
- package/lib/Cloudflare/Queue/QueueEventSource.d.ts.map +1 -1
- package/lib/Cloudflare/Queue/QueueEventSource.js +22 -1
- package/lib/Cloudflare/Queue/QueueEventSource.js.map +1 -1
- package/lib/Cloudflare/R2/R2Bucket.d.ts +1 -0
- package/lib/Cloudflare/R2/R2Bucket.d.ts.map +1 -1
- package/lib/Cloudflare/R2/R2Bucket.js +18 -0
- package/lib/Cloudflare/R2/R2Bucket.js.map +1 -1
- package/lib/Cloudflare/SecretsStore/Secret.d.ts.map +1 -1
- package/lib/Cloudflare/SecretsStore/Secret.js +13 -34
- package/lib/Cloudflare/SecretsStore/Secret.js.map +1 -1
- package/lib/Cloudflare/SecretsStore/SecretBinding.d.ts +3 -2
- package/lib/Cloudflare/SecretsStore/SecretBinding.d.ts.map +1 -1
- package/lib/Cloudflare/SecretsStore/SecretBinding.js +3 -2
- package/lib/Cloudflare/SecretsStore/SecretBinding.js.map +1 -1
- package/lib/Cloudflare/StateStore/Api.d.ts +5 -13
- package/lib/Cloudflare/StateStore/Api.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/Api.js +14 -8
- package/lib/Cloudflare/StateStore/Api.js.map +1 -1
- package/lib/Cloudflare/StateStore/State.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/State.js +45 -9
- package/lib/Cloudflare/StateStore/State.js.map +1 -1
- package/lib/Cloudflare/StateStore/Store.d.ts.map +1 -1
- package/lib/Cloudflare/StateStore/Store.js +5 -2
- package/lib/Cloudflare/StateStore/Store.js.map +1 -1
- package/lib/Cloudflare/VpcService/VpcService.d.ts +2 -2
- package/lib/Cloudflare/VpcService/VpcService.d.ts.map +1 -1
- package/lib/Cloudflare/Website/StaticSite.d.ts +5 -5
- package/lib/Cloudflare/Website/StaticSite.d.ts.map +1 -1
- package/lib/Cloudflare/Website/StaticSite.js +3 -0
- package/lib/Cloudflare/Website/StaticSite.js.map +1 -1
- package/lib/Cloudflare/Website/Vite.d.ts +5 -5
- package/lib/Cloudflare/Website/Vite.d.ts.map +1 -1
- package/lib/Cloudflare/Website/Vite.js.map +1 -1
- package/lib/Cloudflare/Workers/Assets.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Assets.js +1 -1
- package/lib/Cloudflare/Workers/Assets.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectBridge.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectBridge.js +4 -3
- package/lib/Cloudflare/Workers/DurableObjectBridge.js.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectNamespace.d.ts +183 -6
- package/lib/Cloudflare/Workers/DurableObjectNamespace.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/DurableObjectNamespace.js +279 -76
- package/lib/Cloudflare/Workers/DurableObjectNamespace.js.map +1 -1
- package/lib/Cloudflare/Workers/HttpServer.d.ts +6 -4
- package/lib/Cloudflare/Workers/HttpServer.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/HttpServer.js +20 -15
- package/lib/Cloudflare/Workers/HttpServer.js.map +1 -1
- package/lib/Cloudflare/Workers/InferEnv.d.ts +3 -2
- package/lib/Cloudflare/Workers/InferEnv.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts +19 -3
- package/lib/Cloudflare/Workers/LocalWorkerProvider.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js +458 -21
- package/lib/Cloudflare/Workers/LocalWorkerProvider.js.map +1 -1
- package/lib/Cloudflare/Workers/Rpc.d.ts +16 -0
- package/lib/Cloudflare/Workers/Rpc.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Rpc.js +22 -0
- package/lib/Cloudflare/Workers/Rpc.js.map +1 -1
- package/lib/Cloudflare/Workers/RpcDurableObjectNamespace.d.ts +285 -0
- package/lib/Cloudflare/Workers/RpcDurableObjectNamespace.d.ts.map +1 -0
- package/lib/Cloudflare/Workers/RpcDurableObjectNamespace.js +288 -0
- package/lib/Cloudflare/Workers/RpcDurableObjectNamespace.js.map +1 -0
- package/lib/Cloudflare/Workers/RpcWorker.d.ts +305 -0
- package/lib/Cloudflare/Workers/RpcWorker.d.ts.map +1 -0
- package/lib/Cloudflare/Workers/RpcWorker.js +350 -0
- package/lib/Cloudflare/Workers/RpcWorker.js.map +1 -0
- package/lib/Cloudflare/Workers/Vite.d.ts +1 -1
- package/lib/Cloudflare/Workers/Vite.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Vite.js +2 -1
- package/lib/Cloudflare/Workers/Vite.js.map +1 -1
- package/lib/Cloudflare/Workers/Worker.d.ts +69 -37
- package/lib/Cloudflare/Workers/Worker.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Worker.js +171 -51
- package/lib/Cloudflare/Workers/Worker.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts +1 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.js +158 -97
- package/lib/Cloudflare/Workers/WorkerAsyncBindings.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBinding.d.ts +11 -23
- package/lib/Cloudflare/Workers/WorkerBinding.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBinding.js +3 -0
- package/lib/Cloudflare/Workers/WorkerBinding.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBridge.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBridge.js +8 -7
- package/lib/Cloudflare/Workers/WorkerBridge.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts +1 -2
- package/lib/Cloudflare/Workers/WorkerBundle.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerBundle.js +7 -7
- package/lib/Cloudflare/Workers/WorkerBundle.js.map +1 -1
- package/lib/Cloudflare/Workers/WorkerRuntimeContext.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/WorkerRuntimeContext.js +9 -10
- package/lib/Cloudflare/Workers/WorkerRuntimeContext.js.map +1 -1
- package/lib/Cloudflare/Workers/Workflow.d.ts +5 -3
- package/lib/Cloudflare/Workers/Workflow.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/Workflow.js +19 -1
- package/lib/Cloudflare/Workers/Workflow.js.map +1 -1
- package/lib/Cloudflare/Workers/index.d.ts +2 -0
- package/lib/Cloudflare/Workers/index.d.ts.map +1 -1
- package/lib/Cloudflare/Workers/index.js +2 -0
- package/lib/Cloudflare/Workers/index.js.map +1 -1
- package/lib/Cloudflare/Zaraz/ZarazConfig.d.ts +184 -0
- package/lib/Cloudflare/Zaraz/ZarazConfig.d.ts.map +1 -0
- package/lib/Cloudflare/Zaraz/ZarazConfig.js +216 -0
- package/lib/Cloudflare/Zaraz/ZarazConfig.js.map +1 -0
- package/lib/Cloudflare/Zaraz/ZarazEventTypes.d.ts +188 -0
- package/lib/Cloudflare/Zaraz/ZarazEventTypes.d.ts.map +1 -0
- package/lib/Cloudflare/Zaraz/ZarazEventTypes.js +4 -0
- package/lib/Cloudflare/Zaraz/ZarazEventTypes.js.map +1 -0
- package/lib/Cloudflare/Zaraz/index.d.ts +3 -0
- package/lib/Cloudflare/Zaraz/index.d.ts.map +1 -0
- package/lib/Cloudflare/Zaraz/index.js +2 -0
- package/lib/Cloudflare/Zaraz/index.js.map +1 -0
- package/lib/Cloudflare/index.d.ts +2 -0
- package/lib/Cloudflare/index.d.ts.map +1 -1
- package/lib/Cloudflare/index.js +2 -0
- package/lib/Cloudflare/index.js.map +1 -1
- package/lib/Dependencies.d.ts +10 -0
- package/lib/Dependencies.d.ts.map +1 -0
- package/lib/Dependencies.js +1 -0
- package/lib/Dependencies.js.map +1 -0
- package/lib/Deploy.d.ts +2 -1
- package/lib/Deploy.d.ts.map +1 -1
- package/lib/Deploy.js +2 -2
- package/lib/Deploy.js.map +1 -1
- package/lib/Diff.d.ts +11 -0
- package/lib/Diff.d.ts.map +1 -1
- package/lib/Diff.js +11 -0
- package/lib/Diff.js.map +1 -1
- package/lib/Input.d.ts +2 -1
- package/lib/Input.d.ts.map +1 -1
- package/lib/KeyPair.d.ts +77 -0
- package/lib/KeyPair.d.ts.map +1 -0
- package/lib/KeyPair.js +102 -0
- package/lib/KeyPair.js.map +1 -0
- package/lib/Local/RpcProvider.d.ts +56 -0
- package/lib/Local/RpcProvider.d.ts.map +1 -0
- package/lib/Local/RpcProvider.js +83 -0
- package/lib/Local/RpcProvider.js.map +1 -0
- package/lib/Local/RpcProviderProxy.d.ts +19 -0
- package/lib/Local/RpcProviderProxy.d.ts.map +1 -0
- package/lib/Local/RpcProviderProxy.js +48 -0
- package/lib/Local/RpcProviderProxy.js.map +1 -0
- package/lib/Local/RpcSerialization.d.ts +34 -0
- package/lib/Local/RpcSerialization.d.ts.map +1 -0
- package/lib/Local/RpcSerialization.js +120 -0
- package/lib/Local/RpcSerialization.js.map +1 -0
- package/lib/Local/RpcServer.d.ts +63 -0
- package/lib/Local/RpcServer.d.ts.map +1 -0
- package/lib/Local/RpcServer.js +72 -0
- package/lib/Local/RpcServer.js.map +1 -0
- package/lib/Local/RpcServerBun.d.ts +3 -0
- package/lib/Local/RpcServerBun.d.ts.map +1 -0
- package/lib/Local/RpcServerBun.js +47 -0
- package/lib/Local/RpcServerBun.js.map +1 -0
- package/lib/Local/RpcServerEnvironment.d.ts +20 -0
- package/lib/Local/RpcServerEnvironment.d.ts.map +1 -0
- package/lib/Local/RpcServerEnvironment.js +22 -0
- package/lib/Local/RpcServerEnvironment.js.map +1 -0
- package/lib/Local/RpcServerNode.d.ts +3 -0
- package/lib/Local/RpcServerNode.d.ts.map +1 -0
- package/lib/Local/RpcServerNode.js +43 -0
- package/lib/Local/RpcServerNode.js.map +1 -0
- package/lib/Local/RpcServerSession.d.ts +27 -0
- package/lib/Local/RpcServerSession.d.ts.map +1 -0
- package/lib/Local/RpcServerSession.js +68 -0
- package/lib/Local/RpcServerSession.js.map +1 -0
- package/lib/Local/RpcSpawner.d.ts +21 -0
- package/lib/Local/RpcSpawner.d.ts.map +1 -0
- package/lib/Local/RpcSpawner.js +132 -0
- package/lib/Local/RpcSpawner.js.map +1 -0
- package/lib/Neon/Project.d.ts.map +1 -1
- package/lib/Neon/Project.js +14 -3
- package/lib/Neon/Project.js.map +1 -1
- package/lib/Output.d.ts.map +1 -1
- package/lib/Output.js +9 -2
- package/lib/Output.js.map +1 -1
- package/lib/Phase.d.ts +2 -1
- package/lib/Phase.d.ts.map +1 -1
- package/lib/Phase.js +6 -1
- package/lib/Phase.js.map +1 -1
- package/lib/Plan.d.ts.map +1 -1
- package/lib/Plan.js +14 -3
- package/lib/Plan.js.map +1 -1
- package/lib/Platform.d.ts +8 -6
- package/lib/Platform.d.ts.map +1 -1
- package/lib/Platform.js +33 -3
- package/lib/Platform.js.map +1 -1
- package/lib/Random.d.ts.map +1 -1
- package/lib/Random.js +9 -14
- package/lib/Random.js.map +1 -1
- package/lib/RuntimeContext.d.ts +21 -1
- package/lib/RuntimeContext.d.ts.map +1 -1
- package/lib/RuntimeContext.js +12 -0
- package/lib/RuntimeContext.js.map +1 -1
- package/lib/Stack.d.ts +3 -3
- package/lib/Stack.d.ts.map +1 -1
- package/lib/Stack.js.map +1 -1
- package/lib/State/HttpStateApi.d.ts +2 -2
- package/lib/State/StateEncoding.d.ts +8 -0
- package/lib/State/StateEncoding.d.ts.map +1 -1
- package/lib/State/StateEncoding.js +55 -5
- package/lib/State/StateEncoding.js.map +1 -1
- package/lib/Test/Bun.d.ts.map +1 -1
- package/lib/Test/Bun.js +0 -2
- package/lib/Test/Bun.js.map +1 -1
- package/lib/Test/Vitest.d.ts.map +1 -1
- package/lib/Test/Vitest.js +0 -2
- package/lib/Test/Vitest.js.map +1 -1
- package/lib/Util/Duration.d.ts +14 -0
- package/lib/Util/Duration.d.ts.map +1 -0
- package/lib/Util/Duration.js +18 -0
- package/lib/Util/Duration.js.map +1 -0
- package/lib/Util/PlatformServices.d.ts +7 -0
- package/lib/Util/PlatformServices.d.ts.map +1 -1
- package/lib/Util/PlatformServices.js +22 -11
- package/lib/Util/PlatformServices.js.map +1 -1
- package/lib/Util/camel.d.ts.map +1 -1
- package/lib/Util/camel.js +2 -3
- package/lib/Util/camel.js.map +1 -1
- package/lib/Util/data.d.ts +5 -0
- package/lib/Util/data.d.ts.map +1 -1
- package/lib/Util/data.js +29 -0
- package/lib/Util/data.js.map +1 -1
- package/lib/Util/index.d.ts +0 -6
- package/lib/Util/index.d.ts.map +1 -1
- package/lib/Util/index.js +0 -6
- package/lib/Util/index.js.map +1 -1
- package/lib/Util/stable.d.ts.map +1 -1
- package/lib/Util/stable.js +3 -6
- package/lib/Util/stable.js.map +1 -1
- package/lib/Util/types.d.ts +3 -1
- package/lib/Util/types.d.ts.map +1 -1
- package/lib/Util/types.js +5 -1
- package/lib/Util/types.js.map +1 -1
- package/lib/index.d.ts +2 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -3
- package/lib/index.js.map +1 -1
- package/lib/tsconfig.test.tsbuildinfo +1 -1
- package/package.json +22 -23
- package/src/AWS/Lambda/Function.ts +87 -34
- package/src/AWS/Providers.ts +3 -0
- package/src/Apply.ts +18 -1
- package/src/Auth/AuthProvider.ts +25 -5
- package/src/Auth/Credentials.ts +8 -7
- package/src/Auth/Lock.ts +2 -2
- package/src/Bundle/Bundle.ts +35 -13
- package/src/Bundle/BundleAnalyzerPlugin.ts +33 -0
- package/src/Bundle/RawPlugin.ts +82 -0
- package/src/Bundle/index.ts +2 -0
- package/src/Cli/commands/_shared.ts +47 -4
- package/src/Cli/commands/dev.ts +63 -37
- package/src/Cli/commands/login.ts +20 -4
- package/src/Cli/commands/profile.ts +24 -34
- package/src/Cli/exec.ts +12 -7
- package/src/Cli/main.ts +0 -3
- package/src/Cloudflare/AiGateway/AiGateway.ts +2 -6
- package/src/Cloudflare/BrowserRendering/BrowserRendering.ts +132 -0
- package/src/Cloudflare/BrowserRendering/BrowserRenderingBinding.ts +137 -0
- package/src/Cloudflare/BrowserRendering/index.ts +11 -0
- package/src/Cloudflare/Container/Container.ts +3 -3
- package/src/Cloudflare/Container/StartContainer.ts +1 -2
- package/src/Cloudflare/D1/D1Database.ts +4 -1
- package/src/Cloudflare/D1/D1DatabaseBinding.ts +1 -1
- package/src/Cloudflare/Fetcher.ts +0 -2
- package/src/Cloudflare/Hyperdrive/Hyperdrive.ts +5 -0
- package/src/Cloudflare/Hyperdrive/HyperdriveBinding.ts +41 -43
- package/src/Cloudflare/KV/KVNamespace.ts +4 -0
- package/src/Cloudflare/Local.ts +23 -0
- package/src/Cloudflare/Providers.ts +28 -16
- package/src/Cloudflare/Queue/Queue.ts +3 -0
- package/src/Cloudflare/Queue/QueueConsumer.ts +23 -8
- package/src/Cloudflare/Queue/QueueEventSource.ts +33 -5
- package/src/Cloudflare/R2/R2Bucket.ts +26 -0
- package/src/Cloudflare/SecretsStore/Secret.ts +14 -41
- package/src/Cloudflare/SecretsStore/SecretBinding.ts +11 -11
- package/src/Cloudflare/StateStore/Api.ts +15 -15
- package/src/Cloudflare/StateStore/State.ts +68 -6
- package/src/Cloudflare/StateStore/Store.ts +5 -2
- package/src/Cloudflare/VpcService/VpcService.ts +2 -2
- package/src/Cloudflare/Website/StaticSite.ts +8 -10
- package/src/Cloudflare/Website/Vite.ts +4 -7
- package/src/Cloudflare/Workers/Assets.ts +1 -1
- package/src/Cloudflare/Workers/DurableObjectBridge.ts +7 -5
- package/src/Cloudflare/Workers/DurableObjectNamespace.ts +380 -121
- package/src/Cloudflare/Workers/HttpServer.ts +31 -25
- package/src/Cloudflare/Workers/InferEnv.ts +15 -8
- package/src/Cloudflare/Workers/LocalWorkerProvider.ts +609 -22
- package/src/Cloudflare/Workers/Rpc.ts +50 -0
- package/src/Cloudflare/Workers/RpcDurableObjectNamespace.ts +502 -0
- package/src/Cloudflare/Workers/RpcWorker.ts +562 -0
- package/src/Cloudflare/Workers/Vite.ts +2 -0
- package/src/Cloudflare/Workers/Worker.ts +280 -110
- package/src/Cloudflare/Workers/WorkerAsyncBindings.ts +158 -103
- package/src/Cloudflare/Workers/WorkerBinding.ts +10 -0
- package/src/Cloudflare/Workers/WorkerBridge.ts +10 -9
- package/src/Cloudflare/Workers/WorkerBundle.ts +8 -9
- package/src/Cloudflare/Workers/WorkerRuntimeContext.ts +8 -15
- package/src/Cloudflare/Workers/Workflow.ts +22 -3
- package/src/Cloudflare/Workers/index.ts +2 -0
- package/src/Cloudflare/Zaraz/ZarazConfig.ts +403 -0
- package/src/Cloudflare/Zaraz/ZarazEventTypes.ts +257 -0
- package/src/Cloudflare/Zaraz/index.ts +25 -0
- package/src/Cloudflare/index.ts +2 -0
- package/src/Dependencies.ts +10 -0
- package/src/Deploy.ts +3 -1
- package/src/Diff.ts +13 -0
- package/src/Input.ts +2 -0
- package/src/KeyPair.ts +146 -0
- package/src/Local/RpcProvider.ts +146 -0
- package/src/Local/RpcProviderProxy.ts +86 -0
- package/src/Local/RpcSerialization.ts +225 -0
- package/src/Local/RpcServer.ts +138 -0
- package/src/Local/RpcServerBun.ts +59 -0
- package/src/Local/RpcServerEnvironment.ts +55 -0
- package/src/Local/RpcServerNode.ts +58 -0
- package/src/Local/RpcServerSession.ts +87 -0
- package/src/Local/RpcSpawner.ts +196 -0
- package/src/Neon/Project.ts +16 -3
- package/src/Output.ts +8 -2
- package/src/Phase.ts +8 -0
- package/src/Plan.ts +16 -3
- package/src/Platform.ts +74 -27
- package/src/Random.ts +22 -27
- package/src/RuntimeContext.ts +23 -1
- package/src/Stack.ts +3 -3
- package/src/State/StateEncoding.ts +58 -7
- package/src/Test/Bun.ts +0 -3
- package/src/Test/Vitest.ts +0 -3
- package/src/Util/Duration.ts +21 -0
- package/src/Util/PlatformServices.ts +41 -27
- package/src/Util/camel.ts +3 -5
- package/src/Util/data.ts +38 -0
- package/src/Util/index.ts +0 -6
- package/src/Util/stable.ts +4 -10
- package/src/Util/types.ts +9 -2
- package/src/index.ts +2 -3
- package/lib/Cloudflare/Local/Sidecar.d.ts +0 -63
- package/lib/Cloudflare/Local/Sidecar.d.ts.map +0 -1
- package/lib/Cloudflare/Local/Sidecar.js +0 -50
- package/lib/Cloudflare/Local/Sidecar.js.map +0 -1
- package/lib/Cloudflare/Local/SidecarHandlers.d.ts +0 -8
- package/lib/Cloudflare/Local/SidecarHandlers.d.ts.map +0 -1
- package/lib/Cloudflare/Local/SidecarHandlers.js +0 -381
- package/lib/Cloudflare/Local/SidecarHandlers.js.map +0 -1
- package/lib/Cloudflare/Local/SidecarServer.d.ts +0 -2
- package/lib/Cloudflare/Local/SidecarServer.d.ts.map +0 -1
- package/lib/Cloudflare/Local/SidecarServer.js +0 -34
- package/lib/Cloudflare/Local/SidecarServer.js.map +0 -1
- package/lib/Secret.d.ts +0 -50
- package/lib/Secret.d.ts.map +0 -1
- package/lib/Secret.js +0 -23
- package/lib/Secret.js.map +0 -1
- package/lib/Sidecar/Lock.d.ts +0 -23
- package/lib/Sidecar/Lock.d.ts.map +0 -1
- package/lib/Sidecar/Lock.js +0 -39
- package/lib/Sidecar/Lock.js.map +0 -1
- package/lib/Sidecar/RpcClient.d.ts +0 -15
- package/lib/Sidecar/RpcClient.d.ts.map +0 -1
- package/lib/Sidecar/RpcClient.js +0 -78
- package/lib/Sidecar/RpcClient.js.map +0 -1
- package/lib/Sidecar/RpcHandler.d.ts +0 -51
- package/lib/Sidecar/RpcHandler.d.ts.map +0 -1
- package/lib/Sidecar/RpcHandler.js +0 -87
- package/lib/Sidecar/RpcHandler.js.map +0 -1
- package/lib/Sidecar/RpcPaths.d.ts +0 -19
- package/lib/Sidecar/RpcPaths.d.ts.map +0 -1
- package/lib/Sidecar/RpcPaths.js +0 -31
- package/lib/Sidecar/RpcPaths.js.map +0 -1
- package/lib/Sidecar/RpcServer.d.ts +0 -30
- package/lib/Sidecar/RpcServer.d.ts.map +0 -1
- package/lib/Sidecar/RpcServer.js +0 -105
- package/lib/Sidecar/RpcServer.js.map +0 -1
- package/lib/Sidecar/RpcServerBun.d.ts +0 -4
- package/lib/Sidecar/RpcServerBun.d.ts.map +0 -1
- package/lib/Sidecar/RpcServerBun.js +0 -28
- package/lib/Sidecar/RpcServerBun.js.map +0 -1
- package/lib/Sidecar/RpcServerNode.d.ts +0 -4
- package/lib/Sidecar/RpcServerNode.d.ts.map +0 -1
- package/lib/Sidecar/RpcServerNode.js +0 -39
- package/lib/Sidecar/RpcServerNode.js.map +0 -1
- package/lib/Sidecar/RpcServices.d.ts +0 -6
- package/lib/Sidecar/RpcServices.d.ts.map +0 -1
- package/lib/Sidecar/RpcServices.js +0 -29
- package/lib/Sidecar/RpcServices.js.map +0 -1
- package/lib/Trait.d.ts +0 -43
- package/lib/Trait.d.ts.map +0 -1
- package/lib/Trait.js +0 -17
- package/lib/Trait.js.map +0 -1
- package/lib/Util/LocalhostDns.d.ts +0 -23
- package/lib/Util/LocalhostDns.d.ts.map +0 -1
- package/lib/Util/LocalhostDns.js +0 -46
- package/lib/Util/LocalhostDns.js.map +0 -1
- package/lib/Util/assert-never.d.ts +0 -12
- package/lib/Util/assert-never.d.ts.map +0 -1
- package/lib/Util/assert-never.js +0 -11
- package/lib/Util/assert-never.js.map +0 -1
- package/lib/Util/class.d.ts +0 -3
- package/lib/Util/class.d.ts.map +0 -1
- package/lib/Util/class.js +0 -1
- package/lib/Util/class.js.map +0 -1
- package/lib/Util/ignore.d.ts +0 -40
- package/lib/Util/ignore.d.ts.map +0 -1
- package/lib/Util/ignore.js +0 -591
- package/lib/Util/ignore.js.map +0 -1
- package/lib/Util/instance.d.ts +0 -4
- package/lib/Util/instance.d.ts.map +0 -1
- package/lib/Util/instance.js +0 -1
- package/lib/Util/instance.js.map +0 -1
- package/lib/Util/pointer.d.ts +0 -5
- package/lib/Util/pointer.d.ts.map +0 -1
- package/lib/Util/pointer.js +0 -1
- package/lib/Util/pointer.js.map +0 -1
- package/lib/Util/schema-to-type.d.ts +0 -42
- package/lib/Util/schema-to-type.d.ts.map +0 -1
- package/lib/Util/schema-to-type.js +0 -364
- package/lib/Util/schema-to-type.js.map +0 -1
- package/lib/Util/todo.d.ts +0 -3
- package/lib/Util/todo.d.ts.map +0 -1
- package/lib/Util/todo.js +0 -3
- package/lib/Util/todo.js.map +0 -1
- package/lib/Variable.d.ts +0 -29
- package/lib/Variable.d.ts.map +0 -1
- package/lib/Variable.js +0 -9
- package/lib/Variable.js.map +0 -1
- package/src/Cloudflare/Local/Sidecar.ts +0 -81
- package/src/Cloudflare/Local/SidecarHandlers.ts +0 -491
- package/src/Cloudflare/Local/SidecarServer.ts +0 -70
- package/src/Secret.ts +0 -87
- package/src/Sidecar/Lock.ts +0 -66
- package/src/Sidecar/RpcClient.ts +0 -142
- package/src/Sidecar/RpcHandler.ts +0 -205
- package/src/Sidecar/RpcPaths.ts +0 -39
- package/src/Sidecar/RpcServer.ts +0 -153
- package/src/Sidecar/RpcServerBun.ts +0 -41
- package/src/Sidecar/RpcServerNode.ts +0 -51
- package/src/Sidecar/RpcServices.ts +0 -48
- package/src/Trait.ts +0 -105
- package/src/Util/LocalhostDns.ts +0 -52
- package/src/Util/assert-never.ts +0 -18
- package/src/Util/class.ts +0 -7
- package/src/Util/ignore.ts +0 -815
- package/src/Util/instance.ts +0 -9
- package/src/Util/pointer.ts +0 -5
- package/src/Util/schema-to-type.ts +0 -456
- package/src/Util/todo.ts +0 -4
- package/src/Variable.ts +0 -44
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "alchemy",
|
|
3
|
-
"version": "2.0.0-beta.
|
|
3
|
+
"version": "2.0.0-beta.45",
|
|
4
4
|
"homepage": "https://alchemy.run",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"author": "Sam Goodwin <sam@alchemy.run>",
|
|
@@ -288,19 +288,19 @@
|
|
|
288
288
|
"access": "public"
|
|
289
289
|
},
|
|
290
290
|
"dependencies": {
|
|
291
|
-
"@alchemy.run/node-utils": "0.0.
|
|
291
|
+
"@alchemy.run/node-utils": "0.0.4",
|
|
292
292
|
"@aws-sdk/credential-providers": "^3.0.0",
|
|
293
293
|
"@clack/prompts": "^0.11.0",
|
|
294
|
-
"@distilled.cloud/aws": "^0.
|
|
295
|
-
"@distilled.cloud/axiom": "^0.
|
|
296
|
-
"@distilled.cloud/cloudflare": "^0.
|
|
297
|
-
"@distilled.cloud/cloudflare-rolldown-plugin": "0.
|
|
298
|
-
"@distilled.cloud/cloudflare-runtime": "0.
|
|
299
|
-
"@distilled.cloud/cloudflare-vite-plugin": "0.
|
|
300
|
-
"@distilled.cloud/core": "^0.
|
|
301
|
-
"@distilled.cloud/
|
|
302
|
-
"@distilled.cloud/
|
|
303
|
-
"@effect/vitest": ">=4.0.0-beta.
|
|
294
|
+
"@distilled.cloud/aws": "^0.22.1",
|
|
295
|
+
"@distilled.cloud/axiom": "^0.22.1",
|
|
296
|
+
"@distilled.cloud/cloudflare": "^0.22.1",
|
|
297
|
+
"@distilled.cloud/cloudflare-rolldown-plugin": "0.10.1",
|
|
298
|
+
"@distilled.cloud/cloudflare-runtime": "0.10.1",
|
|
299
|
+
"@distilled.cloud/cloudflare-vite-plugin": "0.10.1",
|
|
300
|
+
"@distilled.cloud/core": "^0.22.1",
|
|
301
|
+
"@distilled.cloud/neon": "^0.22.1",
|
|
302
|
+
"@distilled.cloud/planetscale": "^0.22.1",
|
|
303
|
+
"@effect/vitest": ">=4.0.0-beta.74 || >=4.0.0",
|
|
304
304
|
"@libsql/client": "^0.17.0",
|
|
305
305
|
"@octokit/rest": "^22.0.1",
|
|
306
306
|
"@smithy/node-config-provider": "^4.0.0",
|
|
@@ -311,7 +311,6 @@
|
|
|
311
311
|
"capnweb": "^0.6.1",
|
|
312
312
|
"fast-glob": "^3.3.2",
|
|
313
313
|
"fast-xml-parser": "^5.3.4",
|
|
314
|
-
"foreground-child": "^4.0.3",
|
|
315
314
|
"ink": "^6.3.1",
|
|
316
315
|
"jszip": "^3.10.1",
|
|
317
316
|
"libsodium-wrappers": "^0.8.3",
|
|
@@ -321,17 +320,17 @@
|
|
|
321
320
|
"pg": "^8.13.0",
|
|
322
321
|
"picomatch": "^4.0.4",
|
|
323
322
|
"react": "^19.2.0",
|
|
324
|
-
"rolldown": "1.0.
|
|
325
|
-
"sonda": "^0.11.1",
|
|
323
|
+
"rolldown": "1.0.1",
|
|
326
324
|
"undici": "^7.16.0",
|
|
327
325
|
"yaml": "^2.0.0"
|
|
328
326
|
},
|
|
329
327
|
"devDependencies": {
|
|
330
328
|
"@clack/prompts": "^0.11.0",
|
|
331
329
|
"@cloudflare/workers-types": "^4.20250805.0",
|
|
332
|
-
"@
|
|
333
|
-
"@effect/platform-
|
|
334
|
-
"@effect/platform-node
|
|
330
|
+
"@cloudflare/puppeteer": "^1.1.0",
|
|
331
|
+
"@effect/platform-bun": ">=4.0.0-beta.74 || >=4.0.0",
|
|
332
|
+
"@effect/platform-node": ">=4.0.0-beta.74 || >=4.0.0",
|
|
333
|
+
"@effect/platform-node-shared": ">=4.0.0-beta.74 || >=4.0.0",
|
|
335
334
|
"@oxc-project/types": "^0.127.0",
|
|
336
335
|
"@types/pg": "^8.11.0",
|
|
337
336
|
"@types/aws-lambda": "^8.10.152",
|
|
@@ -341,7 +340,7 @@
|
|
|
341
340
|
"@types/react": "^19.2.2",
|
|
342
341
|
"@types/ws": "^8.18.1",
|
|
343
342
|
"better-auth": "^1.6.2",
|
|
344
|
-
"effect": ">=4.0.0-beta.
|
|
343
|
+
"effect": ">=4.0.0-beta.74 || >=4.0.0",
|
|
345
344
|
"react-devtools-core": "^7.0.1",
|
|
346
345
|
"solid-js": "latest",
|
|
347
346
|
"tsconfig-paths": "^4.2.0",
|
|
@@ -351,12 +350,12 @@
|
|
|
351
350
|
"ws": "^8.20.0"
|
|
352
351
|
},
|
|
353
352
|
"peerDependencies": {
|
|
354
|
-
"@effect/platform-bun": ">=4.0.0-beta.
|
|
355
|
-
"@effect/platform-node": ">=4.0.0-beta.
|
|
356
|
-
"@effect/sql-pg": ">=4.0.0-beta.
|
|
353
|
+
"@effect/platform-bun": ">=4.0.0-beta.74 || >=4.0.0",
|
|
354
|
+
"@effect/platform-node": ">=4.0.0-beta.74 || >=4.0.0",
|
|
355
|
+
"@effect/sql-pg": ">=4.0.0-beta.74 || >=4.0.0",
|
|
357
356
|
"drizzle-kit": ">=1.0.0-rc.1",
|
|
358
357
|
"drizzle-orm": ">=1.0.0-rc.1",
|
|
359
|
-
"effect": ">=4.0.0-beta.
|
|
358
|
+
"effect": ">=4.0.0-beta.74 || >=4.0.0",
|
|
360
359
|
"vite": "^8.0.7",
|
|
361
360
|
"ws": "^8.20.0"
|
|
362
361
|
},
|
|
@@ -5,8 +5,8 @@ import type { CreateFunctionRequest } from "@distilled.cloud/aws/lambda";
|
|
|
5
5
|
import * as Lambda from "@distilled.cloud/aws/lambda";
|
|
6
6
|
import { Region } from "@distilled.cloud/aws/Region";
|
|
7
7
|
import type * as lambda from "aws-lambda";
|
|
8
|
-
import * as Config from "effect/Config";
|
|
9
8
|
import * as Context from "effect/Context";
|
|
9
|
+
import * as Duration from "effect/Duration";
|
|
10
10
|
import * as Effect from "effect/Effect";
|
|
11
11
|
import * as FileSystem from "effect/FileSystem";
|
|
12
12
|
import * as Option from "effect/Option";
|
|
@@ -94,8 +94,45 @@ export interface FunctionProps extends PlatformProps {
|
|
|
94
94
|
subnetIds: string[];
|
|
95
95
|
securityGroupIds: string[];
|
|
96
96
|
};
|
|
97
|
+
/**
|
|
98
|
+
* Maximum execution time before the function is forcibly terminated.
|
|
99
|
+
* Rounded up to whole seconds.
|
|
100
|
+
*
|
|
101
|
+
* @default 3 seconds (AWS Lambda default)
|
|
102
|
+
*/
|
|
103
|
+
timeout?: Duration.Duration;
|
|
97
104
|
}
|
|
98
105
|
|
|
106
|
+
/**
|
|
107
|
+
* Normalize a {@link FunctionProps.timeout} to whole seconds.
|
|
108
|
+
*
|
|
109
|
+
* State JSON round-trips flatten a `Duration` to its `toJSON` shape
|
|
110
|
+
* (`{_id:"Duration",_tag:"Millis"|"Nanos"|"Infinity",...}`), which is not a
|
|
111
|
+
* valid `Duration.Input`. Reconstruct an input that `Duration.toSeconds`
|
|
112
|
+
* accepts before delegating.
|
|
113
|
+
*/
|
|
114
|
+
export const toTimeoutSeconds = (
|
|
115
|
+
timeout: Duration.Duration | undefined,
|
|
116
|
+
): number | undefined => {
|
|
117
|
+
if (timeout === undefined) return undefined;
|
|
118
|
+
const json = timeout as {
|
|
119
|
+
_id?: unknown;
|
|
120
|
+
_tag?: "Millis" | "Nanos" | "Infinity" | "NegativeInfinity";
|
|
121
|
+
millis?: number;
|
|
122
|
+
nanos?: string;
|
|
123
|
+
};
|
|
124
|
+
const input: Duration.Input =
|
|
125
|
+
json._id === "Duration"
|
|
126
|
+
? json._tag === "Millis"
|
|
127
|
+
? json.millis!
|
|
128
|
+
: json._tag === "Nanos"
|
|
129
|
+
? BigInt(json.nanos!)
|
|
130
|
+
: "Infinity"
|
|
131
|
+
: timeout;
|
|
132
|
+
const seconds = Duration.toSeconds(input);
|
|
133
|
+
return Number.isFinite(seconds) ? Math.max(1, Math.ceil(seconds)) : undefined;
|
|
134
|
+
};
|
|
135
|
+
|
|
99
136
|
export interface Function extends Resource<
|
|
100
137
|
FunctionTypeId,
|
|
101
138
|
FunctionProps,
|
|
@@ -368,7 +405,9 @@ export const Function: Platform<
|
|
|
368
405
|
env,
|
|
369
406
|
set: (id: string, output: Output.Output) =>
|
|
370
407
|
Effect.sync(() => {
|
|
371
|
-
|
|
408
|
+
// Key is already canonical (see RuntimeContext.sanitizeKey); store it
|
|
409
|
+
// verbatim.
|
|
410
|
+
const key = id;
|
|
372
411
|
// Preserve `Redacted`-ness across the Output → Lambda env var
|
|
373
412
|
// round-trip. `JSON.stringify(Redacted)` would emit the literal
|
|
374
413
|
// string `"<redacted>"` and lose the value, so secrets are
|
|
@@ -387,34 +426,35 @@ export const Function: Platform<
|
|
|
387
426
|
return key;
|
|
388
427
|
}),
|
|
389
428
|
get: <T>(key: string) =>
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
429
|
+
// Read the captured value straight from `process.env`. We must NOT
|
|
430
|
+
// resolve through `Config.string` here: at runtime the ambient
|
|
431
|
+
// `ConfigProvider` is the interceptor installed in `Platform.ts`,
|
|
432
|
+
// whose runtime branch calls back into `ctx.get(key)`. Going through
|
|
433
|
+
// `Config` would re-enter that interceptor for the same key and
|
|
434
|
+
// recurse forever, allocating until the Lambda init OOMs. The Worker
|
|
435
|
+
// runtime reads from `WorkerEnvironment` for the same reason.
|
|
436
|
+
Effect.sync(() => {
|
|
437
|
+
// Key is already canonical (see RuntimeContext.sanitizeKey).
|
|
438
|
+
const val = process.env[key];
|
|
439
|
+
if (val === undefined) {
|
|
440
|
+
return undefined;
|
|
441
|
+
}
|
|
442
|
+
try {
|
|
443
|
+
const value = JSON.parse(val);
|
|
444
|
+
if (
|
|
445
|
+
typeof value === "object" &&
|
|
446
|
+
value?._tag === "Redacted" &&
|
|
447
|
+
"value" in value
|
|
448
|
+
) {
|
|
449
|
+
return Redacted.make(
|
|
450
|
+
(value as { value: unknown }).value,
|
|
451
|
+
) as unknown as T;
|
|
452
|
+
}
|
|
453
|
+
return value as T;
|
|
454
|
+
} catch {
|
|
455
|
+
return val as unknown as T; // assume it's just a string
|
|
456
|
+
}
|
|
457
|
+
}),
|
|
418
458
|
serve: (handler: HttpEffect) =>
|
|
419
459
|
ctx.listen(makeFunctionHttpHandler(handler)),
|
|
420
460
|
listen: ((
|
|
@@ -872,6 +912,7 @@ export default await Effect.runPromise(handlerEffect)
|
|
|
872
912
|
}
|
|
873
913
|
: undefined,
|
|
874
914
|
Tags: tags,
|
|
915
|
+
Timeout: toTimeoutSeconds(news.timeout),
|
|
875
916
|
VpcConfig: news.vpc
|
|
876
917
|
? {
|
|
877
918
|
SubnetIds: news.vpc.subnetIds,
|
|
@@ -1121,6 +1162,11 @@ export default await Effect.runPromise(handlerEffect)
|
|
|
1121
1162
|
// code changed
|
|
1122
1163
|
return { action: "update" };
|
|
1123
1164
|
}
|
|
1165
|
+
if (
|
|
1166
|
+
toTimeoutSeconds(olds.timeout) !== toTimeoutSeconds(news.timeout)
|
|
1167
|
+
) {
|
|
1168
|
+
return { action: "update" };
|
|
1169
|
+
}
|
|
1124
1170
|
}),
|
|
1125
1171
|
read: Effect.fnUntraced(function* ({ id, olds, output }) {
|
|
1126
1172
|
const functionName =
|
|
@@ -1161,7 +1207,7 @@ export default await Effect.runPromise(handlerEffect)
|
|
|
1161
1207
|
// Reuse the persisted output where we have it (e.g. code hash) so
|
|
1162
1208
|
// diff doesn't see drift it can't reconstruct from the API.
|
|
1163
1209
|
const attrs = {
|
|
1164
|
-
...
|
|
1210
|
+
...output,
|
|
1165
1211
|
functionArn: fn.FunctionArn,
|
|
1166
1212
|
functionName: fn.FunctionName,
|
|
1167
1213
|
functionUrl,
|
|
@@ -1185,8 +1231,15 @@ export default await Effect.runPromise(handlerEffect)
|
|
|
1185
1231
|
vpc: news.vpc,
|
|
1186
1232
|
});
|
|
1187
1233
|
|
|
1188
|
-
//
|
|
1189
|
-
|
|
1234
|
+
// Mock code for the pre-created stub. It responds 503 (rather than a
|
|
1235
|
+
// bare 200) so that, during the brief window where the real
|
|
1236
|
+
// code/config update is still `InProgress`, a Function URL hit serves
|
|
1237
|
+
// an honest "not ready" signal instead of a successful-but-empty 200.
|
|
1238
|
+
// Downstream readiness probes already retry on non-200, so they wait
|
|
1239
|
+
// for the real handler to go live without the provider blocking.
|
|
1240
|
+
const code = new TextEncoder().encode(
|
|
1241
|
+
`export default () => ({ statusCode: 503, headers: { "content-type": "application/json" }, body: JSON.stringify({ error: "function initializing" }) })`,
|
|
1242
|
+
);
|
|
1190
1243
|
const archive = yield* zipCode(code);
|
|
1191
1244
|
const hash = yield* hashBundle(code);
|
|
1192
1245
|
yield* createOrUpdateFunction({
|
|
@@ -1261,7 +1314,7 @@ export default await Effect.runPromise(handlerEffect)
|
|
|
1261
1314
|
yield* session.note(summary({ code }));
|
|
1262
1315
|
|
|
1263
1316
|
return {
|
|
1264
|
-
...
|
|
1317
|
+
...output,
|
|
1265
1318
|
functionArn,
|
|
1266
1319
|
functionName,
|
|
1267
1320
|
functionUrl: functionUrl as any,
|
package/src/AWS/Providers.ts
CHANGED
|
@@ -19,6 +19,7 @@ import * as HttpClientError from "effect/unstable/http/HttpClientError";
|
|
|
19
19
|
import { CredentialsStoreLive } from "../Auth/Credentials.ts";
|
|
20
20
|
import { Command, CommandProvider } from "../Build/Command.ts";
|
|
21
21
|
import * as Provider from "../Provider.ts";
|
|
22
|
+
import { KeyPair, KeyPairProvider } from "../KeyPair.ts";
|
|
22
23
|
import { Random, RandomProvider } from "../Random.ts";
|
|
23
24
|
import * as ACM from "./ACM/index.ts";
|
|
24
25
|
import * as ApiGateway from "./ApiGateway/index.ts";
|
|
@@ -63,6 +64,7 @@ export const providers = () =>
|
|
|
63
64
|
Providers,
|
|
64
65
|
Provider.collection([
|
|
65
66
|
Command,
|
|
67
|
+
KeyPair,
|
|
66
68
|
Random,
|
|
67
69
|
ACM.Certificate,
|
|
68
70
|
ApiGateway.Account,
|
|
@@ -571,6 +573,7 @@ export const providers = () =>
|
|
|
571
573
|
Layer.provideMerge(
|
|
572
574
|
Layer.mergeAll(
|
|
573
575
|
CommandProvider(),
|
|
576
|
+
KeyPairProvider(),
|
|
574
577
|
RandomProvider(),
|
|
575
578
|
Assets.AssetsProvider(),
|
|
576
579
|
),
|
package/src/Apply.ts
CHANGED
|
@@ -280,7 +280,24 @@ const executePlan = Effect.fnUntraced(function* (
|
|
|
280
280
|
Effect.all(
|
|
281
281
|
fqns
|
|
282
282
|
.filter((fqn) => fqn in ready)
|
|
283
|
-
.map((fqn) =>
|
|
283
|
+
.map((fqn) =>
|
|
284
|
+
// Non-cycle upstreams must be observed at their TERMINAL output
|
|
285
|
+
// (`readyStable`), not their early precreate signal (`ready`). This
|
|
286
|
+
// is what makes a failed upstream actually interrupt its downstream:
|
|
287
|
+
// a resource with `precreate` resolves `ready` before its real
|
|
288
|
+
// `reconcile` runs, so a downstream waiting on `ready` would proceed
|
|
289
|
+
// (and even finish) even though the upstream's reconcile later
|
|
290
|
+
// failed. Waiting on `readyStable` means the downstream's
|
|
291
|
+
// `waitForDeps` short-circuits with the upstream's failure cause.
|
|
292
|
+
//
|
|
293
|
+
// Cycle members are the exception: peers in an SCC depend on each
|
|
294
|
+
// other, so they must rendezvous on the early `ready`/precreate
|
|
295
|
+
// signal to break the deadlock. Phase 3 (`converge`) re-runs them
|
|
296
|
+
// against final outputs once the cycle settles.
|
|
297
|
+
plan.cycleMembers.has(fqn)
|
|
298
|
+
? Deferred.await(ready[fqn])
|
|
299
|
+
: Deferred.await(readyStable[fqn]),
|
|
300
|
+
),
|
|
284
301
|
{ concurrency: "unbounded" },
|
|
285
302
|
);
|
|
286
303
|
|
package/src/Auth/AuthProvider.ts
CHANGED
|
@@ -2,6 +2,7 @@ import * as Context from "effect/Context";
|
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as Layer from "effect/Layer";
|
|
4
4
|
import * as Schema from "effect/Schema";
|
|
5
|
+
import * as Semaphore from "effect/Semaphore";
|
|
5
6
|
import { withLock } from "./Lock.ts";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -14,6 +15,20 @@ import { withLock } from "./Lock.ts";
|
|
|
14
15
|
*/
|
|
15
16
|
const LOCKED_METHODS = new Set(["read", "login", "logout", "configure"]);
|
|
16
17
|
|
|
18
|
+
/**
|
|
19
|
+
* Methods that may drive an interactive flow (prompts, browser-based
|
|
20
|
+
* OAuth, etc.). A process-wide mutex serializes these across providers
|
|
21
|
+
* so that, e.g., Cloudflare's `configure` finishes its prompt sequence
|
|
22
|
+
* before Planetscale's begins — even when the two auth provider Layers
|
|
23
|
+
* are built in parallel as part of a single `providers()` Layer.
|
|
24
|
+
*
|
|
25
|
+
* The clack prompt wrapper in `Util/Clank.ts` enforces per-prompt
|
|
26
|
+
* serialization; this mutex enforces per-flow serialization so the user
|
|
27
|
+
* sees one provider's prompts grouped together rather than interleaved.
|
|
28
|
+
*/
|
|
29
|
+
const INTERACTIVE_METHODS = new Set(["login", "configure"]);
|
|
30
|
+
const interactiveMutex = Semaphore.makeUnsafe(1);
|
|
31
|
+
|
|
17
32
|
export class AuthError extends Schema.TaggedErrorClass<AuthError>()(
|
|
18
33
|
"AuthError",
|
|
19
34
|
{
|
|
@@ -143,13 +158,18 @@ export const AuthProvider =
|
|
|
143
158
|
Object.entries(service).map(([methodName, fn]) => [
|
|
144
159
|
methodName,
|
|
145
160
|
(...args: Parameters<typeof fn>) => {
|
|
146
|
-
|
|
161
|
+
let eff = (fn as any)(...args).pipe(
|
|
147
162
|
Effect.provideContext(ctx),
|
|
148
163
|
);
|
|
149
|
-
if (
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
164
|
+
if (LOCKED_METHODS.has(methodName)) {
|
|
165
|
+
// First positional arg is always `profileName`.
|
|
166
|
+
const profileName = args[0] as string;
|
|
167
|
+
eff = withLock(`${profileName}-${name}`, eff);
|
|
168
|
+
}
|
|
169
|
+
if (INTERACTIVE_METHODS.has(methodName)) {
|
|
170
|
+
eff = Semaphore.withPermits(interactiveMutex, 1)(eff);
|
|
171
|
+
}
|
|
172
|
+
return eff;
|
|
153
173
|
},
|
|
154
174
|
]),
|
|
155
175
|
),
|
package/src/Auth/Credentials.ts
CHANGED
|
@@ -70,13 +70,14 @@ export const CredentialsStoreLive = Layer.effect(
|
|
|
70
70
|
credentials: T,
|
|
71
71
|
): Effect.Effect<void, PlatformError> => {
|
|
72
72
|
const filePath = credentialsFilePath(profile, provider);
|
|
73
|
-
return fs
|
|
74
|
-
.
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
)
|
|
79
|
-
)
|
|
73
|
+
return fs.makeDirectory(path.dirname(filePath), { recursive: true }).pipe(
|
|
74
|
+
Effect.flatMap(() => {
|
|
75
|
+
return fs.writeFileString(
|
|
76
|
+
filePath,
|
|
77
|
+
JSON.stringify(credentials, null, 2),
|
|
78
|
+
);
|
|
79
|
+
}),
|
|
80
|
+
);
|
|
80
81
|
};
|
|
81
82
|
|
|
82
83
|
const remove_ = (profile: string, provider: string): Effect.Effect<void> =>
|
package/src/Auth/Lock.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import
|
|
1
|
+
import { lock } from "@alchemy.run/node-utils/lockfile";
|
|
2
2
|
import * as Effect from "effect/Effect";
|
|
3
3
|
import * as fs from "node:fs/promises";
|
|
4
4
|
import * as path from "pathe";
|
|
@@ -24,7 +24,7 @@ export const withLock = <A, E, R>(
|
|
|
24
24
|
return Effect.acquireUseRelease(
|
|
25
25
|
Effect.promise(async () => {
|
|
26
26
|
await fs.mkdir(lockDir, { recursive: true });
|
|
27
|
-
return await
|
|
27
|
+
return await lock(lockPath, {
|
|
28
28
|
retries: { retries: 600, minTimeout: 50, maxTimeout: 50 },
|
|
29
29
|
stale: 5_000,
|
|
30
30
|
realpath: false,
|
package/src/Bundle/Bundle.ts
CHANGED
|
@@ -6,7 +6,12 @@ import * as Stream from "effect/Stream";
|
|
|
6
6
|
import assert from "node:assert";
|
|
7
7
|
import * as rolldown from "rolldown";
|
|
8
8
|
import { sha256, sha256Object } from "../Util/sha256.ts";
|
|
9
|
+
import {
|
|
10
|
+
bundleAnalyzerPlugin,
|
|
11
|
+
type BundleAnalyzerPluginOptions,
|
|
12
|
+
} from "./BundleAnalyzerPlugin.ts";
|
|
9
13
|
import { purePlugin, type PurePluginOptions } from "./PurePlugin.ts";
|
|
14
|
+
import { rawPlugin } from "./RawPlugin.ts";
|
|
10
15
|
|
|
11
16
|
/**
|
|
12
17
|
* Extra options accepted by {@link build} / {@link watch} on top of the
|
|
@@ -24,6 +29,16 @@ export interface BundleExtraOptions {
|
|
|
24
29
|
* - `false`: plugin is disabled.
|
|
25
30
|
*/
|
|
26
31
|
readonly pure?: PurePluginOptions | false;
|
|
32
|
+
/**
|
|
33
|
+
* Configures the {@link bundleAnalyzerPlugin} which emits a bundle analysis
|
|
34
|
+
* report alongside the bundle output, describing chunks, modules, and the
|
|
35
|
+
* import graph reachable from each entry point.
|
|
36
|
+
*
|
|
37
|
+
* - `undefined` / `false` (default): plugin is disabled.
|
|
38
|
+
* - `true`: plugin is enabled with default options.
|
|
39
|
+
* - `BundleAnalyzerPluginOptions`: plugin is enabled with the provided options.
|
|
40
|
+
*/
|
|
41
|
+
readonly bundleAnalyzer?: BundleAnalyzerPluginOptions | boolean;
|
|
27
42
|
}
|
|
28
43
|
|
|
29
44
|
export interface BundleOutput {
|
|
@@ -86,7 +101,7 @@ export const build = (
|
|
|
86
101
|
try: async () => {
|
|
87
102
|
const bundle = await rolldown.rolldown({
|
|
88
103
|
...inputOptions,
|
|
89
|
-
plugins:
|
|
104
|
+
plugins: [inputOptions.plugins, builtInPlugins(extra)],
|
|
90
105
|
optimization: inputOptions.optimization ?? {
|
|
91
106
|
inlineConst: {
|
|
92
107
|
mode: "smart",
|
|
@@ -94,7 +109,7 @@ export const build = (
|
|
|
94
109
|
},
|
|
95
110
|
},
|
|
96
111
|
});
|
|
97
|
-
const result = await bundle.
|
|
112
|
+
const result = await bundle.write(outputOptions);
|
|
98
113
|
await bundle.close();
|
|
99
114
|
return result.output;
|
|
100
115
|
},
|
|
@@ -128,7 +143,8 @@ export const watch = (
|
|
|
128
143
|
const watcher = rolldown.watch({
|
|
129
144
|
...inputOptions,
|
|
130
145
|
plugins: [
|
|
131
|
-
|
|
146
|
+
inputOptions.plugins,
|
|
147
|
+
builtInPlugins(extra),
|
|
132
148
|
// The watcher event listener does not receive the bundle output, so we grab it using a plugin.
|
|
133
149
|
{
|
|
134
150
|
name: "alchemy:watch-bundle",
|
|
@@ -266,19 +282,25 @@ export function bundleOutputFromRolldownOutputBundle(
|
|
|
266
282
|
}
|
|
267
283
|
|
|
268
284
|
/**
|
|
269
|
-
*
|
|
270
|
-
* {@link
|
|
285
|
+
* Returns the built-in plugins appended after the user-provided plugin chain,
|
|
286
|
+
* configured by {@link BundleExtraOptions}.
|
|
271
287
|
*
|
|
272
|
-
*
|
|
273
|
-
*
|
|
274
|
-
*
|
|
288
|
+
* These run LAST so they see module ids that have already been resolved into
|
|
289
|
+
* `node_modules/<pkg>/...` by upstream resolver plugins such as
|
|
290
|
+
* `@distilled.cloud/cloudflare-rolldown-plugin`.
|
|
275
291
|
*/
|
|
276
|
-
function
|
|
277
|
-
|
|
278
|
-
pure: PurePluginOptions | false | undefined,
|
|
292
|
+
function builtInPlugins(
|
|
293
|
+
extra?: BundleExtraOptions,
|
|
279
294
|
): rolldown.RolldownPluginOption {
|
|
280
|
-
|
|
281
|
-
|
|
295
|
+
return [
|
|
296
|
+
extra?.bundleAnalyzer
|
|
297
|
+
? bundleAnalyzerPlugin(
|
|
298
|
+
extra.bundleAnalyzer === true ? {} : extra.bundleAnalyzer,
|
|
299
|
+
)
|
|
300
|
+
: undefined,
|
|
301
|
+
extra?.pure !== false ? purePlugin(extra?.pure ?? {}) : undefined,
|
|
302
|
+
rawPlugin(),
|
|
303
|
+
];
|
|
282
304
|
}
|
|
283
305
|
|
|
284
306
|
function bundleErrorFromUnknown(error: unknown): BundleError {
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Plugin } from "rolldown";
|
|
2
|
+
import { bundleAnalyzerPlugin as rolldownBundleAnalyzerPlugin } from "rolldown/experimental";
|
|
3
|
+
|
|
4
|
+
export interface BundleAnalyzerPluginOptions {
|
|
5
|
+
/**
|
|
6
|
+
* The filename of the bundle analysis data.
|
|
7
|
+
* @default "analyze-data.md"
|
|
8
|
+
*/
|
|
9
|
+
readonly fileName?: string;
|
|
10
|
+
/**
|
|
11
|
+
* The format of the bundle analysis data.
|
|
12
|
+
* @default "md"
|
|
13
|
+
*/
|
|
14
|
+
readonly format?: "json" | "md";
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
/**
|
|
18
|
+
* Wraps rolldown's experimental bundle analyzer plugin, which emits a report
|
|
19
|
+
* describing the composition of the bundle.
|
|
20
|
+
*
|
|
21
|
+
* The report includes:
|
|
22
|
+
* - all chunks and their relationships
|
|
23
|
+
* - the modules bundled into each chunk
|
|
24
|
+
* - import dependencies between chunks
|
|
25
|
+
* - the modules reachable from each entry point
|
|
26
|
+
*/
|
|
27
|
+
export const bundleAnalyzerPlugin = (
|
|
28
|
+
options: BundleAnalyzerPluginOptions = {},
|
|
29
|
+
): Plugin =>
|
|
30
|
+
rolldownBundleAnalyzerPlugin({
|
|
31
|
+
fileName: options.fileName,
|
|
32
|
+
format: options.format ?? "md",
|
|
33
|
+
});
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type * as rolldown from "rolldown";
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Matches `?raw` or `&raw` query suffixes, mirroring Vite's `rawRE`
|
|
5
|
+
* (see `vite/src/node/utils.ts`). Used to gate both `resolveId` and
|
|
6
|
+
* `load` so the plugin only inspects ids that opt in.
|
|
7
|
+
*/
|
|
8
|
+
export const RAW_RE: RegExp = /(\?|&)raw(?:&|$)/;
|
|
9
|
+
|
|
10
|
+
/**
|
|
11
|
+
* Rolldown plugin that adds Vite-style `?raw` import support to the
|
|
12
|
+
* Alchemy bundler.
|
|
13
|
+
*
|
|
14
|
+
* Importing a file with the `?raw` suffix inlines its contents as the
|
|
15
|
+
* default export of a JS module:
|
|
16
|
+
*
|
|
17
|
+
* ```ts
|
|
18
|
+
* import sql from "./schema.sql?raw";
|
|
19
|
+
* // ^ string — the file contents read as UTF-8
|
|
20
|
+
* ```
|
|
21
|
+
*
|
|
22
|
+
* This plugin only implements `?raw`. Vite's `?url` and `?inline`
|
|
23
|
+
* variants both rely on a browser asset pipeline (URL serving / `data:`
|
|
24
|
+
* fallback) that has no analogue in the server-side bundles produced
|
|
25
|
+
* here (Cloudflare Workers, AWS Lambda), so they are intentionally
|
|
26
|
+
* omitted.
|
|
27
|
+
*/
|
|
28
|
+
export const rawPlugin = (): rolldown.Plugin => ({
|
|
29
|
+
name: "alchemy:raw",
|
|
30
|
+
resolveId: {
|
|
31
|
+
filter: { id: RAW_RE },
|
|
32
|
+
async handler(source, importer) {
|
|
33
|
+
const [base, query] = splitFileAndPostfix(source);
|
|
34
|
+
const resolved = await this.resolve(base, importer, { skipSelf: true });
|
|
35
|
+
if (!resolved || resolved.external) return null;
|
|
36
|
+
return { id: resolved.id + query, moduleSideEffects: false };
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
load: {
|
|
40
|
+
filter: { id: RAW_RE },
|
|
41
|
+
async handler(id) {
|
|
42
|
+
const file = id.replace(/[?#].*$/, "");
|
|
43
|
+
const contents = await this.fs.readFile(file, { encoding: "utf8" });
|
|
44
|
+
return {
|
|
45
|
+
code: `export default ${JSON.stringify(contents)};`,
|
|
46
|
+
// Empty mappings = "this module has no meaningful source map".
|
|
47
|
+
// The generated code is a synthetic `export default "..."` that
|
|
48
|
+
// doesn't correspond line-for-line to any source file (the
|
|
49
|
+
// underlying file isn't JS), so there's nothing to map. Supplying
|
|
50
|
+
// `{ mappings: "" }` (rather than omitting `map`) opts the module
|
|
51
|
+
// out of source-map generation without making rolldown synthesize
|
|
52
|
+
// a default one from the loaded code.
|
|
53
|
+
map: { mappings: "" },
|
|
54
|
+
// NOTE: matches Vite — avoids a double `export default` if the
|
|
55
|
+
// file extension would otherwise be picked up by another loader
|
|
56
|
+
// (e.g. `?raw&.json`).
|
|
57
|
+
moduleType: "js",
|
|
58
|
+
};
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
});
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Splits an id into its file portion and the query/hash postfix (kept
|
|
65
|
+
* with the leading `?` / `#`). Matches Vite's `splitFileAndPostfix`.
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* splitFileAndPostfix("./foo.txt?raw") // => ["./foo.txt", "?raw"]
|
|
69
|
+
* splitFileAndPostfix("./foo.txt") // => ["./foo.txt", ""]
|
|
70
|
+
*/
|
|
71
|
+
export function splitFileAndPostfix(id: string): [string, string] {
|
|
72
|
+
const queryIdx = id.indexOf("?");
|
|
73
|
+
const hashIdx = id.indexOf("#");
|
|
74
|
+
const idx =
|
|
75
|
+
queryIdx === -1
|
|
76
|
+
? hashIdx
|
|
77
|
+
: hashIdx === -1
|
|
78
|
+
? queryIdx
|
|
79
|
+
: Math.min(queryIdx, hashIdx);
|
|
80
|
+
if (idx === -1) return [id, ""];
|
|
81
|
+
return [id.slice(0, idx), id.slice(idx)];
|
|
82
|
+
}
|