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
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type * as cf from "@cloudflare/workers-types";
|
|
2
2
|
import * as workers from "@distilled.cloud/cloudflare/workers";
|
|
3
3
|
import * as zones from "@distilled.cloud/cloudflare/zones";
|
|
4
|
+
import * as Config from "effect/Config";
|
|
4
5
|
import * as Context from "effect/Context";
|
|
5
6
|
import * as Data from "effect/Data";
|
|
6
7
|
import * as Effect from "effect/Effect";
|
|
@@ -8,6 +9,7 @@ import * as Layer from "effect/Layer";
|
|
|
8
9
|
import * as Path from "effect/Path";
|
|
9
10
|
import * as Redacted from "effect/Redacted";
|
|
10
11
|
import * as Schedule from "effect/Schedule";
|
|
12
|
+
import * as crypto from "node:crypto";
|
|
11
13
|
import { Unowned } from "../../AdoptPolicy.ts";
|
|
12
14
|
import { AlchemyContext } from "../../AlchemyContext.ts";
|
|
13
15
|
import * as Artifacts from "../../Artifacts.ts";
|
|
@@ -22,7 +24,6 @@ import { Resource, type ResourceBinding } from "../../Resource.ts";
|
|
|
22
24
|
import { Stack } from "../../Stack.ts";
|
|
23
25
|
import { CloudflareEnvironment } from "../CloudflareEnvironment.ts";
|
|
24
26
|
import type { HyperdriveDevOrigin } from "../Hyperdrive/Hyperdrive.ts";
|
|
25
|
-
import { SidecarLive } from "../Local/Sidecar.ts";
|
|
26
27
|
import { CloudflareLogs } from "../Logs.ts";
|
|
27
28
|
import type { Providers } from "../Providers.ts";
|
|
28
29
|
import {
|
|
@@ -34,7 +35,10 @@ import {
|
|
|
34
35
|
} from "./Assets.ts";
|
|
35
36
|
import { getCompatibility } from "./Compatibility.ts";
|
|
36
37
|
import { isDurableObjectExport } from "./DurableObjectNamespace.ts";
|
|
37
|
-
import {
|
|
38
|
+
import {
|
|
39
|
+
LocalWorkerProvider,
|
|
40
|
+
localRuntimeServices,
|
|
41
|
+
} from "./LocalWorkerProvider.ts";
|
|
38
42
|
import { Request } from "./Request.ts";
|
|
39
43
|
import * as Vite from "./Vite.ts";
|
|
40
44
|
import {
|
|
@@ -170,7 +174,9 @@ type NormalizedBindings<
|
|
|
170
174
|
any,
|
|
171
175
|
any
|
|
172
176
|
>
|
|
173
|
-
? T
|
|
177
|
+
? T extends Redacted.Redacted<infer T> | Config.Config<infer T>
|
|
178
|
+
? T
|
|
179
|
+
: T
|
|
174
180
|
: Extract<Bindings[B], WorkerBindingResource>;
|
|
175
181
|
} & (undefined extends AssetsConfig ? {} : { ASSETS: Assets });
|
|
176
182
|
|
|
@@ -178,7 +184,6 @@ export type WorkerAssetsConfig = string | AssetsProps | AssetsWithHash;
|
|
|
178
184
|
|
|
179
185
|
export interface WorkerProps<
|
|
180
186
|
Bindings extends WorkerBindingProps = any,
|
|
181
|
-
Env extends WorkerEnv = WorkerEnv,
|
|
182
187
|
Assets extends WorkerAssetsConfig | undefined =
|
|
183
188
|
| WorkerAssetsConfig
|
|
184
189
|
| undefined,
|
|
@@ -221,16 +226,46 @@ export interface WorkerProps<
|
|
|
221
226
|
*/
|
|
222
227
|
observability?: WorkerObservability;
|
|
223
228
|
tags?: string[];
|
|
224
|
-
|
|
229
|
+
/**
|
|
230
|
+
* Path to the Worker's entry module. Bundled with rolldown before
|
|
231
|
+
* upload. Mutually exclusive with {@link script} — provide exactly one.
|
|
232
|
+
*/
|
|
233
|
+
main?: string;
|
|
234
|
+
/**
|
|
235
|
+
* Raw module source for the Worker. When provided, bundling is bypassed
|
|
236
|
+
* entirely and this string is uploaded as a single ESM module
|
|
237
|
+
* (`main.js`). Useful for tiny inline workers (tests, fixtures,
|
|
238
|
+
* one-offs) and any case where you've already produced the final
|
|
239
|
+
* bundle elsewhere. Mutually exclusive with {@link main}.
|
|
240
|
+
*/
|
|
241
|
+
script?: string;
|
|
225
242
|
compatibility?: {
|
|
226
243
|
date?: string;
|
|
227
244
|
flags?: ("nodejs_compat" | "nodejs_als" | (string & {}))[];
|
|
228
245
|
};
|
|
229
246
|
limits?: WorkerLimits;
|
|
230
247
|
placement?: WorkerPlacement;
|
|
231
|
-
env?: Env;
|
|
232
248
|
exports?: string[];
|
|
233
|
-
|
|
249
|
+
/**
|
|
250
|
+
* Environment variables and native Cloudflare Bindings to bind to
|
|
251
|
+
* the Worker. Accepts:
|
|
252
|
+
*
|
|
253
|
+
* - Resource references (R2 bucket, KV namespace, D1 database,
|
|
254
|
+
* another Worker, Durable Object, etc.) — emitted as the
|
|
255
|
+
* corresponding native binding.
|
|
256
|
+
* - `effect/Config` values (`Config.redacted`, `Config.string`,
|
|
257
|
+
* `Config.number`, …) — resolved at deploy time and bound as
|
|
258
|
+
* `secret_text` on Cloudflare regardless of the `Config`
|
|
259
|
+
* constructor used. See
|
|
260
|
+
* {@link https://v2.alchemy.run/concepts/secrets | Concepts › Secrets and Variables}.
|
|
261
|
+
* - Literal values — routed by shape: `Redacted<string>` →
|
|
262
|
+
* `secret_text`, `string` → `plain_text`, anything else → `json`.
|
|
263
|
+
*
|
|
264
|
+
* In Effect-native Workers you can alternatively `yield*` a
|
|
265
|
+
* `Config` in the Init phase to register the binding implicitly;
|
|
266
|
+
* `env` is the only option for async (non-Effect) Workers.
|
|
267
|
+
*/
|
|
268
|
+
env?: Bindings;
|
|
234
269
|
/**
|
|
235
270
|
* Cron expressions that trigger the Worker's scheduled handler.
|
|
236
271
|
*
|
|
@@ -243,23 +278,33 @@ export interface WorkerProps<
|
|
|
243
278
|
* already exist in the account.
|
|
244
279
|
*/
|
|
245
280
|
domain?: string | string[];
|
|
246
|
-
|
|
281
|
+
/**
|
|
282
|
+
* Extra bundler options applied on top of the standard rolldown input/output
|
|
283
|
+
* options used to build this Worker. See {@link Bundle.BundleExtraOptions}.
|
|
284
|
+
*/
|
|
285
|
+
build?: Bundle.BundleExtraOptions;
|
|
286
|
+
/**
|
|
287
|
+
* Options for the local dev server that runs this Worker under `alchemy dev`.
|
|
288
|
+
* Each Worker is served on its own port.
|
|
289
|
+
*/
|
|
290
|
+
dev?: {
|
|
247
291
|
/**
|
|
248
|
-
*
|
|
249
|
-
* @default
|
|
292
|
+
* Host the local dev server binds to.
|
|
293
|
+
* @default "localhost"
|
|
250
294
|
*/
|
|
251
|
-
|
|
295
|
+
host?: string;
|
|
252
296
|
/**
|
|
253
|
-
*
|
|
254
|
-
*
|
|
255
|
-
*
|
|
256
|
-
*
|
|
257
|
-
* - `undefined` (default): plugin is enabled with default packages
|
|
258
|
-
* (`effect`, `@effect/*`).
|
|
259
|
-
* - `PurePluginOptions`: plugin is enabled with the provided options.
|
|
260
|
-
* - `false`: plugin is disabled.
|
|
297
|
+
* Port the local dev server listens on. If the port is unavailable, the
|
|
298
|
+
* next free port is used unless {@link strictPort} is `true`.
|
|
299
|
+
* @default 1337
|
|
261
300
|
*/
|
|
262
|
-
|
|
301
|
+
port?: number;
|
|
302
|
+
/**
|
|
303
|
+
* When `true`, fail instead of falling back to another port if {@link port}
|
|
304
|
+
* is already in use.
|
|
305
|
+
* @default false
|
|
306
|
+
*/
|
|
307
|
+
strictPort?: boolean;
|
|
263
308
|
};
|
|
264
309
|
}
|
|
265
310
|
|
|
@@ -274,7 +319,7 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
|
|
|
274
319
|
tags: string[] | undefined;
|
|
275
320
|
durableObjectNamespaces: Record<string, string>;
|
|
276
321
|
accountId: string;
|
|
277
|
-
domains:
|
|
322
|
+
domains: string[];
|
|
278
323
|
crons: string[];
|
|
279
324
|
hash?: {
|
|
280
325
|
assets: string | undefined;
|
|
@@ -330,9 +375,10 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
|
|
|
330
375
|
* as-is. Your handler is a plain `async fetch` — no Effect runtime
|
|
331
376
|
* is included in the bundle.
|
|
332
377
|
*
|
|
333
|
-
* Use the `
|
|
334
|
-
*
|
|
335
|
-
* `env` object from
|
|
378
|
+
* Use the `env` prop to declare which resources, `Config` values,
|
|
379
|
+
* and literal env vars are available at runtime, and
|
|
380
|
+
* `Cloudflare.InferEnv` to extract a fully typed `env` object from
|
|
381
|
+
* them.
|
|
336
382
|
*
|
|
337
383
|
* See the {@link https://alchemy.run/guides/async-worker | Async Workers Guide}
|
|
338
384
|
* for a comprehensive walkthrough of all binding types (R2, D1,
|
|
@@ -348,7 +394,7 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
|
|
|
348
394
|
*
|
|
349
395
|
* export const Worker = Cloudflare.Worker("Worker", {
|
|
350
396
|
* main: "./src/worker.ts",
|
|
351
|
-
*
|
|
397
|
+
* env: { db, bucket },
|
|
352
398
|
* });
|
|
353
399
|
* ```
|
|
354
400
|
*
|
|
@@ -605,7 +651,7 @@ export type Worker<Bindings extends WorkerBindings = any> = Resource<
|
|
|
605
651
|
* const sandbox = yield* Cloudflare.Container.bind(Sandbox);
|
|
606
652
|
*
|
|
607
653
|
* return Effect.gen(function* () {
|
|
608
|
-
* const container = yield* Cloudflare.start(sandbox);
|
|
654
|
+
* const container = yield* Cloudflare.start(sandbox, { enableInternet: true });
|
|
609
655
|
*
|
|
610
656
|
* return {
|
|
611
657
|
* exec: (cmd: string) => container.exec(cmd),
|
|
@@ -656,31 +702,20 @@ export const Worker: Platform<
|
|
|
656
702
|
> & {
|
|
657
703
|
<
|
|
658
704
|
const Bindings extends WorkerBindingProps = {},
|
|
659
|
-
const Env extends WorkerEnv = {},
|
|
660
705
|
const Assets extends WorkerAssetsConfig | undefined = undefined,
|
|
661
706
|
Req = never,
|
|
662
707
|
>(
|
|
663
708
|
id: string,
|
|
664
709
|
props:
|
|
665
|
-
| InputProps<WorkerProps<Bindings,
|
|
666
|
-
| Effect.Effect<
|
|
667
|
-
InputProps<WorkerProps<Bindings, Env, Assets>>,
|
|
668
|
-
never,
|
|
669
|
-
Req
|
|
670
|
-
>,
|
|
710
|
+
| InputProps<WorkerProps<Bindings, Assets>>
|
|
711
|
+
| Effect.Effect<InputProps<WorkerProps<Bindings, Assets>>, never, Req>,
|
|
671
712
|
): Effect.Effect<
|
|
672
|
-
Worker<
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
} & {
|
|
679
|
-
[K in keyof Env]: Env[K] extends Redacted.Redacted<infer T>
|
|
680
|
-
? T
|
|
681
|
-
: Env[K];
|
|
682
|
-
}
|
|
683
|
-
>,
|
|
713
|
+
Worker<{
|
|
714
|
+
[binding in keyof NormalizedBindings<
|
|
715
|
+
Bindings,
|
|
716
|
+
Assets
|
|
717
|
+
>]: NormalizedBindings<Bindings, Assets>[binding];
|
|
718
|
+
}>,
|
|
684
719
|
never,
|
|
685
720
|
Req | Providers
|
|
686
721
|
>;
|
|
@@ -724,7 +759,7 @@ const selectLayer = <
|
|
|
724
759
|
export const WorkerProvider = () =>
|
|
725
760
|
selectLayer({
|
|
726
761
|
live: LiveWorkerProvider,
|
|
727
|
-
dev: () => Layer.provide(LocalWorkerProvider(),
|
|
762
|
+
dev: () => Layer.provide(LocalWorkerProvider(), localRuntimeServices()),
|
|
728
763
|
});
|
|
729
764
|
|
|
730
765
|
export const LiveWorkerProvider = () =>
|
|
@@ -881,11 +916,7 @@ export const LiveWorkerProvider = () =>
|
|
|
881
916
|
);
|
|
882
917
|
});
|
|
883
918
|
|
|
884
|
-
const reconcileDomains = (
|
|
885
|
-
scriptName: string,
|
|
886
|
-
desired: string[],
|
|
887
|
-
_previous: Worker["Attributes"]["domains"],
|
|
888
|
-
) =>
|
|
919
|
+
const reconcileDomains = (scriptName: string, desired: string[]) =>
|
|
889
920
|
Effect.gen(function* () {
|
|
890
921
|
// Always query the live state of domains attached to *this*
|
|
891
922
|
// Worker rather than trusting `_previous` from local state.
|
|
@@ -1035,11 +1066,15 @@ export const LiveWorkerProvider = () =>
|
|
|
1035
1066
|
|
|
1036
1067
|
const getExpectedDurableObjectClassNames = (
|
|
1037
1068
|
bindings: readonly WorkerBinding[] | undefined,
|
|
1069
|
+
workerName: string,
|
|
1038
1070
|
) =>
|
|
1039
1071
|
Array.from(
|
|
1040
1072
|
new Set(
|
|
1041
1073
|
bindings?.flatMap((binding) =>
|
|
1042
|
-
binding.type === "durable_object_namespace" &&
|
|
1074
|
+
binding.type === "durable_object_namespace" &&
|
|
1075
|
+
binding.className &&
|
|
1076
|
+
(binding.scriptName === undefined ||
|
|
1077
|
+
binding.scriptName === workerName)
|
|
1043
1078
|
? [binding.className]
|
|
1044
1079
|
: [],
|
|
1045
1080
|
) ?? [],
|
|
@@ -1110,7 +1145,7 @@ export const LiveWorkerProvider = () =>
|
|
|
1110
1145
|
bundler
|
|
1111
1146
|
.build({
|
|
1112
1147
|
id,
|
|
1113
|
-
main: props.main
|
|
1148
|
+
main: props.main!,
|
|
1114
1149
|
compatibility: getCompatibility(props),
|
|
1115
1150
|
entry: props.isExternal
|
|
1116
1151
|
? {
|
|
@@ -1121,15 +1156,38 @@ export const LiveWorkerProvider = () =>
|
|
|
1121
1156
|
exports: (props.exports ?? {}) as any,
|
|
1122
1157
|
},
|
|
1123
1158
|
stack: { name: stack.name, stage: stack.stage },
|
|
1124
|
-
|
|
1159
|
+
extraOptions: props.build,
|
|
1125
1160
|
})
|
|
1126
1161
|
.pipe(Artifacts.cached("build"));
|
|
1127
1162
|
|
|
1163
|
+
const hashScript = (script: string) =>
|
|
1164
|
+
Effect.sync(() =>
|
|
1165
|
+
crypto.createHash("sha256").update(script).digest("hex"),
|
|
1166
|
+
);
|
|
1167
|
+
|
|
1128
1168
|
const viteBuild = Effect.fnUntraced(function* (props: WorkerProps) {
|
|
1129
1169
|
const compatibility = getCompatibility(props);
|
|
1130
1170
|
const { assetsDirectory, serverBundle } = yield* Vite.viteBuild(
|
|
1131
1171
|
props.vite?.rootDir,
|
|
1132
|
-
|
|
1172
|
+
Object.fromEntries(
|
|
1173
|
+
(yield* Effect.all(
|
|
1174
|
+
Object.entries(props.env ?? {}).map(
|
|
1175
|
+
Effect.fnUntraced(function* ([key, value]) {
|
|
1176
|
+
return [
|
|
1177
|
+
key,
|
|
1178
|
+
typeof value === "string"
|
|
1179
|
+
? value
|
|
1180
|
+
: Redacted.isRedacted(value) &&
|
|
1181
|
+
typeof Redacted.value(value) === "string"
|
|
1182
|
+
? Redacted.value(value)
|
|
1183
|
+
: Config.isConfig(value) || Effect.isEffect(value)
|
|
1184
|
+
? yield* value
|
|
1185
|
+
: undefined,
|
|
1186
|
+
];
|
|
1187
|
+
}),
|
|
1188
|
+
),
|
|
1189
|
+
)).filter(([_, value]) => value !== undefined),
|
|
1190
|
+
),
|
|
1133
1191
|
{
|
|
1134
1192
|
compatibilityDate: compatibility.date,
|
|
1135
1193
|
compatibilityFlags: compatibility.flags,
|
|
@@ -1167,6 +1225,24 @@ export const LiveWorkerProvider = () =>
|
|
|
1167
1225
|
opts: { skipAssetsRead?: boolean } = {},
|
|
1168
1226
|
) =>
|
|
1169
1227
|
Effect.gen(function* () {
|
|
1228
|
+
if (props.script !== undefined) {
|
|
1229
|
+
const [assets, bundleHash] = yield* Effect.all(
|
|
1230
|
+
[
|
|
1231
|
+
opts.skipAssetsRead
|
|
1232
|
+
? Effect.succeed(undefined)
|
|
1233
|
+
: prepareAssets(props.assets),
|
|
1234
|
+
hashScript(props.script),
|
|
1235
|
+
],
|
|
1236
|
+
{ concurrency: "unbounded" },
|
|
1237
|
+
);
|
|
1238
|
+
return {
|
|
1239
|
+
assets,
|
|
1240
|
+
bundle: {
|
|
1241
|
+
files: [{ path: "main.js", content: props.script }],
|
|
1242
|
+
hash: bundleHash,
|
|
1243
|
+
},
|
|
1244
|
+
};
|
|
1245
|
+
}
|
|
1170
1246
|
if (props.vite) {
|
|
1171
1247
|
const [{ assets, bundle }, input] = yield* Effect.all(
|
|
1172
1248
|
[
|
|
@@ -1269,7 +1345,7 @@ export const LiveWorkerProvider = () =>
|
|
|
1269
1345
|
} satisfies Worker["Attributes"]["hash"];
|
|
1270
1346
|
const metadataBindings = bindings.flatMap((b) => b.data.bindings ?? []);
|
|
1271
1347
|
const expectedDurableObjectClassNames =
|
|
1272
|
-
getExpectedDurableObjectClassNames(metadataBindings);
|
|
1348
|
+
getExpectedDurableObjectClassNames(metadataBindings, name);
|
|
1273
1349
|
let metadataAssets:
|
|
1274
1350
|
| workers.PutScriptRequest["metadata"]["assets"]
|
|
1275
1351
|
| undefined;
|
|
@@ -1323,6 +1399,11 @@ export const LiveWorkerProvider = () =>
|
|
|
1323
1399
|
});
|
|
1324
1400
|
}
|
|
1325
1401
|
metadataBindings.push(
|
|
1402
|
+
{
|
|
1403
|
+
type: "plain_text",
|
|
1404
|
+
name: "ALCHEMY_PHASE",
|
|
1405
|
+
text: "runtime",
|
|
1406
|
+
},
|
|
1326
1407
|
{
|
|
1327
1408
|
type: "plain_text",
|
|
1328
1409
|
name: "ALCHEMY_STACK_NAME",
|
|
@@ -1338,11 +1419,16 @@ export const LiveWorkerProvider = () =>
|
|
|
1338
1419
|
if (news.env) {
|
|
1339
1420
|
for (const [key, value] of Object.entries(news.env)) {
|
|
1340
1421
|
if (value === undefined) continue;
|
|
1422
|
+
if (metadataBindings.some((b) => b.name === key)) continue;
|
|
1341
1423
|
if (Redacted.isRedacted(value)) {
|
|
1424
|
+
const unredacted = Redacted.value(value);
|
|
1342
1425
|
metadataBindings.push({
|
|
1343
1426
|
type: "secret_text",
|
|
1344
1427
|
name: key,
|
|
1345
|
-
text:
|
|
1428
|
+
text:
|
|
1429
|
+
typeof unredacted === "string"
|
|
1430
|
+
? unredacted
|
|
1431
|
+
: JSON.stringify(unredacted),
|
|
1346
1432
|
});
|
|
1347
1433
|
} else if (typeof value === "string") {
|
|
1348
1434
|
metadataBindings.push({
|
|
@@ -1414,16 +1500,19 @@ export const LiveWorkerProvider = () =>
|
|
|
1414
1500
|
}
|
|
1415
1501
|
|
|
1416
1502
|
// Backward compatibility for old workers that have DO bindings but no
|
|
1417
|
-
// alchemy:do tags yet.
|
|
1503
|
+
// alchemy:do tags yet. Cross-script bindings (`scriptName` set to
|
|
1504
|
+
// anything other than this worker) are NEVER candidates for
|
|
1505
|
+
// delete-class migrations — the class lives on the foreign script
|
|
1506
|
+
// and we don't own its lifecycle.
|
|
1418
1507
|
if (Object.keys(oldDoClassNameByLogicalId).length === 0) {
|
|
1419
1508
|
for (const oldBinding of oldBindings) {
|
|
1509
|
+
const ownedLocally =
|
|
1510
|
+
!("scriptName" in oldBinding) || oldBinding.scriptName === name;
|
|
1420
1511
|
if (
|
|
1421
1512
|
oldBinding.type === "durable_object_namespace" &&
|
|
1422
1513
|
"className" in oldBinding &&
|
|
1423
1514
|
oldBinding.className &&
|
|
1424
|
-
|
|
1425
|
-
!oldBinding.scriptName ||
|
|
1426
|
-
oldBinding.scriptName === name) &&
|
|
1515
|
+
ownedLocally &&
|
|
1427
1516
|
!currentDoBindings.some(
|
|
1428
1517
|
(binding) => binding.bindingName === oldBinding.name,
|
|
1429
1518
|
)
|
|
@@ -1585,27 +1674,36 @@ export const LiveWorkerProvider = () =>
|
|
|
1585
1674
|
// Cloudflare currently has it (disabled by default, or whatever
|
|
1586
1675
|
// a previous failed/external action left it as).
|
|
1587
1676
|
const desiredSubdomainEnabled = news.url !== false;
|
|
1588
|
-
const
|
|
1677
|
+
const observedSubdomain = yield* getScriptSubdomain({
|
|
1589
1678
|
accountId,
|
|
1590
1679
|
scriptName: name,
|
|
1591
1680
|
}).pipe(
|
|
1592
|
-
Effect.
|
|
1593
|
-
|
|
1681
|
+
Effect.orElseSucceed<workers.GetScriptSubdomainResponse>(() => ({
|
|
1682
|
+
enabled: false,
|
|
1683
|
+
previewsEnabled: false,
|
|
1684
|
+
})),
|
|
1594
1685
|
);
|
|
1595
|
-
if (
|
|
1686
|
+
if (
|
|
1687
|
+
desiredSubdomainEnabled !== observedSubdomain.enabled ||
|
|
1688
|
+
desiredSubdomainEnabled !== observedSubdomain.previewsEnabled
|
|
1689
|
+
) {
|
|
1596
1690
|
yield* session.note(
|
|
1597
1691
|
`${desiredSubdomainEnabled ? "Enabling" : "Disabling"} workers.dev subdomain...`,
|
|
1598
1692
|
);
|
|
1599
1693
|
// Cloudflare's script registry is eventually consistent — for the
|
|
1600
1694
|
// first few hundred ms after `putScript` returns, POST /subdomain
|
|
1601
1695
|
// can still get back `WorkerNotFound` (a generic "unknown error"
|
|
1602
|
-
// body)
|
|
1603
|
-
//
|
|
1604
|
-
//
|
|
1696
|
+
// body), or a bare 500 surfaced as `InternalServerError` /
|
|
1697
|
+
// `UnknownCloudflareError` (code 10013). Bigger uploads race harder.
|
|
1698
|
+
// Retry the subdomain toggle on those transient tags with a short
|
|
1699
|
+
// exponential backoff; same pattern we use elsewhere in this
|
|
1700
|
+
// provider for DO-namespace propagation and for `putScript` itself.
|
|
1605
1701
|
yield* setWorkerSubdomain(name, desiredSubdomainEnabled).pipe(
|
|
1606
1702
|
Effect.retry({
|
|
1607
1703
|
while: (error: { _tag?: string }) =>
|
|
1608
|
-
error?._tag === "WorkerNotFound"
|
|
1704
|
+
error?._tag === "WorkerNotFound" ||
|
|
1705
|
+
error?._tag === "InternalServerError" ||
|
|
1706
|
+
error?._tag === "UnknownCloudflareError",
|
|
1609
1707
|
schedule: Schedule.exponential(200).pipe(
|
|
1610
1708
|
Schedule.both(Schedule.recurs(15)),
|
|
1611
1709
|
),
|
|
@@ -1619,11 +1717,15 @@ export const LiveWorkerProvider = () =>
|
|
|
1619
1717
|
`Reconciling custom domains (${desiredDomains.length}) ...`,
|
|
1620
1718
|
);
|
|
1621
1719
|
}
|
|
1622
|
-
const
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1720
|
+
const reconciled = yield* reconcileDomains(name, desiredDomains);
|
|
1721
|
+
const workersDevUrl =
|
|
1722
|
+
news.url !== false
|
|
1723
|
+
? `https://${name}.${yield* getAccountSubdomain(accountId)}.workers.dev`
|
|
1724
|
+
: undefined;
|
|
1725
|
+
const domains = [
|
|
1726
|
+
...reconciled.map((d) => `https://${d.hostname}`),
|
|
1727
|
+
...(workersDevUrl ? [workersDevUrl] : []),
|
|
1728
|
+
];
|
|
1627
1729
|
const crons = yield* reconcileCrons(
|
|
1628
1730
|
name,
|
|
1629
1731
|
normalizeCrons([...getCronBindings(bindings), ...(news.crons ?? [])]),
|
|
@@ -1634,10 +1736,7 @@ export const LiveWorkerProvider = () =>
|
|
|
1634
1736
|
workerId: worker.id ?? name,
|
|
1635
1737
|
workerName: name,
|
|
1636
1738
|
logpush: worker.logpush ?? undefined,
|
|
1637
|
-
url:
|
|
1638
|
-
news.url !== false
|
|
1639
|
-
? `https://${name}.${yield* getAccountSubdomain(accountId)}.workers.dev`
|
|
1640
|
-
: undefined,
|
|
1739
|
+
url: domains[0],
|
|
1641
1740
|
tags: settings.tags ?? metadata.tags,
|
|
1642
1741
|
durableObjectNamespaces,
|
|
1643
1742
|
accountId,
|
|
@@ -1652,6 +1751,25 @@ export const LiveWorkerProvider = () =>
|
|
|
1652
1751
|
props: WorkerProps,
|
|
1653
1752
|
output: Worker["Attributes"],
|
|
1654
1753
|
) {
|
|
1754
|
+
if (props.script !== undefined) {
|
|
1755
|
+
const scriptHash = yield* hashScript(props.script);
|
|
1756
|
+
if (scriptHash !== output.hash?.bundle) {
|
|
1757
|
+
return true;
|
|
1758
|
+
}
|
|
1759
|
+
if (!props.assets) {
|
|
1760
|
+
return false;
|
|
1761
|
+
}
|
|
1762
|
+
const assetsHash =
|
|
1763
|
+
typeof props.assets === "object" &&
|
|
1764
|
+
"path" in props.assets &&
|
|
1765
|
+
"hash" in props.assets
|
|
1766
|
+
? (props.assets.hash as string)
|
|
1767
|
+
: undefined;
|
|
1768
|
+
if (assetsHash === undefined) {
|
|
1769
|
+
return true;
|
|
1770
|
+
}
|
|
1771
|
+
return assetsHash !== output.hash?.assets;
|
|
1772
|
+
}
|
|
1655
1773
|
if (props.vite) {
|
|
1656
1774
|
const input = yield* hashDirectory({
|
|
1657
1775
|
cwd: props.vite.rootDir,
|
|
@@ -1719,9 +1837,11 @@ export const LiveWorkerProvider = () =>
|
|
|
1719
1837
|
if (!output) {
|
|
1720
1838
|
return;
|
|
1721
1839
|
}
|
|
1722
|
-
const newDomains = normalizeDomains(news.domain)
|
|
1840
|
+
const newDomains = normalizeDomains(news.domain)
|
|
1841
|
+
.map((h) => `https://${h}`)
|
|
1842
|
+
.sort();
|
|
1723
1843
|
const oldDomains = (output?.domains ?? [])
|
|
1724
|
-
.
|
|
1844
|
+
.filter((u) => !u.endsWith(".workers.dev"))
|
|
1725
1845
|
.sort();
|
|
1726
1846
|
const domainsChanged =
|
|
1727
1847
|
newDomains.length !== oldDomains.length ||
|
|
@@ -1916,6 +2036,30 @@ export const LiveWorkerProvider = () =>
|
|
|
1916
2036
|
service: workerName,
|
|
1917
2037
|
}).pipe(Effect.map((r) => r.result ?? [])),
|
|
1918
2038
|
]);
|
|
2039
|
+
// Preserve the order the user provided in `olds.domain`. The
|
|
2040
|
+
// Cloudflare API returns domains in non-deterministic order,
|
|
2041
|
+
// which would cause downstream `worker.domains[0]` reads to flip
|
|
2042
|
+
// between deploys. Drift (domains we don't know about) is
|
|
2043
|
+
// appended after the user-ordered ones.
|
|
2044
|
+
const userOrder = normalizeDomains(olds?.domain);
|
|
2045
|
+
const orderedHostnames = [
|
|
2046
|
+
...userOrder.flatMap(
|
|
2047
|
+
(h) =>
|
|
2048
|
+
domainsList.find((d) => d.hostname === h)?.hostname ?? [],
|
|
2049
|
+
),
|
|
2050
|
+
...domainsList.flatMap((d) =>
|
|
2051
|
+
d.hostname && !userOrder.includes(d.hostname)
|
|
2052
|
+
? [d.hostname]
|
|
2053
|
+
: [],
|
|
2054
|
+
),
|
|
2055
|
+
];
|
|
2056
|
+
const workersDevUrl = subdomain.enabled
|
|
2057
|
+
? `https://${workerName}.${yield* getAccountSubdomain(accountId)}.workers.dev`
|
|
2058
|
+
: undefined;
|
|
2059
|
+
const domains = [
|
|
2060
|
+
...orderedHostnames.map((h) => `https://${h}`),
|
|
2061
|
+
...(workersDevUrl ? [workersDevUrl] : []),
|
|
2062
|
+
];
|
|
1919
2063
|
const crons = yield* getWorkerCrons(workerName);
|
|
1920
2064
|
yield* Effect.logInfo(
|
|
1921
2065
|
`Cloudflare Worker read: found ${workerName}`,
|
|
@@ -1925,18 +2069,12 @@ export const LiveWorkerProvider = () =>
|
|
|
1925
2069
|
workerId: workerName,
|
|
1926
2070
|
workerName,
|
|
1927
2071
|
logpush: settings.logpush ?? undefined,
|
|
1928
|
-
url:
|
|
1929
|
-
? `https://${workerName}.${yield* getAccountSubdomain(accountId)}.workers.dev`
|
|
1930
|
-
: undefined,
|
|
2072
|
+
url: domains[0],
|
|
1931
2073
|
tags: settings.tags ?? undefined,
|
|
1932
2074
|
durableObjectNamespaces: getDurableObjectNamespaces(
|
|
1933
2075
|
settings.bindings,
|
|
1934
2076
|
),
|
|
1935
|
-
domains
|
|
1936
|
-
d.id && d.hostname && d.zoneId
|
|
1937
|
-
? [{ id: d.id, hostname: d.hostname, zoneId: d.zoneId }]
|
|
1938
|
-
: [],
|
|
1939
|
-
),
|
|
2077
|
+
domains,
|
|
1940
2078
|
crons,
|
|
1941
2079
|
} satisfies Worker["Attributes"];
|
|
1942
2080
|
|
|
@@ -2021,13 +2159,30 @@ export const LiveWorkerProvider = () =>
|
|
|
2021
2159
|
yield* Effect.logInfo(
|
|
2022
2160
|
`Cloudflare Worker delete: deleting ${output.workerName}`,
|
|
2023
2161
|
);
|
|
2024
|
-
|
|
2162
|
+
// Look up live domain IDs rather than trusting persisted state.
|
|
2163
|
+
// We no longer track `{ id, zoneId }` on the output; fetching
|
|
2164
|
+
// straight from Cloudflare handles both the normal case and
|
|
2165
|
+
// adopted workers whose domains we never recorded.
|
|
2166
|
+
const liveDomains = yield* listDomains({
|
|
2167
|
+
accountId: output.accountId,
|
|
2168
|
+
service: output.workerName,
|
|
2169
|
+
}).pipe(
|
|
2170
|
+
Effect.map((r) => r.result ?? []),
|
|
2171
|
+
Effect.catch(() => Effect.succeed([])),
|
|
2172
|
+
);
|
|
2173
|
+
if (liveDomains.length) {
|
|
2025
2174
|
yield* Effect.all(
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2175
|
+
liveDomains.flatMap((d) =>
|
|
2176
|
+
d.id
|
|
2177
|
+
? [
|
|
2178
|
+
deleteDomain({
|
|
2179
|
+
accountId: output.accountId,
|
|
2180
|
+
domainId: d.id,
|
|
2181
|
+
}).pipe(
|
|
2182
|
+
Effect.catchTag("DomainNotFound", () => Effect.void),
|
|
2183
|
+
),
|
|
2184
|
+
]
|
|
2185
|
+
: [],
|
|
2031
2186
|
),
|
|
2032
2187
|
{ concurrency: "unbounded" },
|
|
2033
2188
|
);
|
|
@@ -2101,23 +2256,38 @@ function getDurableObjectBindings(
|
|
|
2101
2256
|
bindings: ReadonlyArray<ResourceBinding>,
|
|
2102
2257
|
workerName: string,
|
|
2103
2258
|
) {
|
|
2259
|
+
// Resource authors (and the `make`/`yield* Tag`/plan-vs-apply machinery)
|
|
2260
|
+
// can register the same DO binding multiple times under the same logical
|
|
2261
|
+
// id — `binding()` is a plain `worker.bind` and intentionally has no
|
|
2262
|
+
// dedup. Collapse duplicates here so each `(logicalId, bindingName,
|
|
2263
|
+
// className)` tuple appears at most once. We also exclude cross-script
|
|
2264
|
+
// references: a `scriptName` pointing to *another* worker means this
|
|
2265
|
+
// worker just references a foreign class — ship the binding to
|
|
2266
|
+
// Cloudflare, but don't drive class migrations for it.
|
|
2267
|
+
const seen = new Set<string>();
|
|
2104
2268
|
return bindings.flatMap((binding) =>
|
|
2105
|
-
(binding.data.bindings ?? []).flatMap((item: WorkerBinding) =>
|
|
2106
|
-
|
|
2107
|
-
|
|
2108
|
-
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2112
|
-
|
|
2113
|
-
|
|
2114
|
-
|
|
2115
|
-
|
|
2116
|
-
|
|
2117
|
-
|
|
2118
|
-
|
|
2119
|
-
|
|
2120
|
-
|
|
2269
|
+
(binding.data.bindings ?? []).flatMap((item: WorkerBinding) => {
|
|
2270
|
+
if (
|
|
2271
|
+
item.type !== "durable_object_namespace" ||
|
|
2272
|
+
!("className" in item) ||
|
|
2273
|
+
!item.className
|
|
2274
|
+
) {
|
|
2275
|
+
return [];
|
|
2276
|
+
}
|
|
2277
|
+
if (item.scriptName !== undefined && item.scriptName !== workerName) {
|
|
2278
|
+
return [];
|
|
2279
|
+
}
|
|
2280
|
+
const dedupKey = `${binding.sid}::${item.name}::${item.className}`;
|
|
2281
|
+
if (seen.has(dedupKey)) return [];
|
|
2282
|
+
seen.add(dedupKey);
|
|
2283
|
+
return [
|
|
2284
|
+
{
|
|
2285
|
+
logicalId: binding.sid,
|
|
2286
|
+
bindingName: item.name,
|
|
2287
|
+
className: item.className,
|
|
2288
|
+
},
|
|
2289
|
+
];
|
|
2290
|
+
}),
|
|
2121
2291
|
);
|
|
2122
2292
|
}
|
|
2123
2293
|
|