alchemy 2.0.0-beta.84 → 2.0.0-beta.85
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/THIRD_PARTY_LICENSES.md +2 -2
- package/bin/cli.js +14 -6
- package/bin/register-oxc.js +16 -12
- package/lib/AdoptPolicy.d.ts +73 -0
- package/lib/AdoptPolicy.d.ts.map +1 -1
- package/lib/AdoptPolicy.js +54 -0
- package/lib/AdoptPolicy.js.map +1 -1
- package/lib/Alchemist/AuthRegistry.d.ts +31 -0
- package/lib/Alchemist/AuthRegistry.d.ts.map +1 -0
- package/lib/Alchemist/AuthRegistry.js +95 -0
- package/lib/Alchemist/AuthRegistry.js.map +1 -0
- package/lib/Alchemist/Drift.d.ts +70 -0
- package/lib/Alchemist/Drift.d.ts.map +1 -0
- package/lib/Alchemist/Drift.js +54 -0
- package/lib/Alchemist/Drift.js.map +1 -0
- package/lib/Alchemist/Entrypoint.d.ts +27 -3
- package/lib/Alchemist/Entrypoint.d.ts.map +1 -1
- package/lib/Alchemist/Entrypoint.js +34 -3
- package/lib/Alchemist/Entrypoint.js.map +1 -1
- package/lib/Alchemist/Errors.d.ts +1 -1
- package/lib/Alchemist/Errors.d.ts.map +1 -1
- package/lib/Alchemist/Errors.js +1 -1
- package/lib/Alchemist/Errors.js.map +1 -1
- package/lib/Alchemist/Logs.d.ts +46 -0
- package/lib/Alchemist/Logs.d.ts.map +1 -0
- package/lib/Alchemist/{routes/logs.js → Logs.js} +21 -26
- package/lib/Alchemist/Logs.js.map +1 -0
- package/lib/Alchemist/Nuke.d.ts +69 -0
- package/lib/Alchemist/Nuke.d.ts.map +1 -0
- package/lib/Alchemist/Nuke.js +35 -0
- package/lib/Alchemist/Nuke.js.map +1 -0
- package/lib/Alchemist/Operations.d.ts +168 -0
- package/lib/Alchemist/Operations.d.ts.map +1 -0
- package/lib/Alchemist/Operations.js +165 -0
- package/lib/Alchemist/Operations.js.map +1 -0
- package/lib/Alchemist/Profile.d.ts +132 -0
- package/lib/Alchemist/Profile.d.ts.map +1 -0
- package/lib/Alchemist/{routes/profile.js → Profile.js} +20 -21
- package/lib/Alchemist/Profile.js.map +1 -0
- package/lib/Alchemist/{routes/provider.d.ts → Provider.d.ts} +4 -4
- package/lib/Alchemist/Provider.d.ts.map +1 -0
- package/lib/Alchemist/{routes/provider.js → Provider.js} +7 -6
- package/lib/Alchemist/Provider.js.map +1 -0
- package/lib/Alchemist/Runtime.d.ts +10 -6
- package/lib/Alchemist/Runtime.d.ts.map +1 -1
- package/lib/Alchemist/Runtime.js +38 -2
- package/lib/Alchemist/Runtime.js.map +1 -1
- package/lib/Alchemist/{routes/state.d.ts → State.d.ts} +36 -16
- package/lib/Alchemist/State.d.ts.map +1 -0
- package/lib/Alchemist/{routes/state.js → State.js} +50 -15
- package/lib/Alchemist/State.js.map +1 -0
- package/lib/Alchemist/index.d.ts +11 -10
- package/lib/Alchemist/index.d.ts.map +1 -1
- package/lib/Alchemist/index.js +10 -9
- package/lib/Alchemist/index.js.map +1 -1
- package/lib/Apply.d.ts +2 -8
- package/lib/Apply.d.ts.map +1 -1
- package/lib/Apply.js +364 -184
- package/lib/Apply.js.map +1 -1
- package/lib/Auth/AuthProvider.d.ts +24 -11
- package/lib/Auth/AuthProvider.d.ts.map +1 -1
- package/lib/Auth/AuthProvider.js +28 -12
- package/lib/Auth/AuthProvider.js.map +1 -1
- package/lib/Auth/BrowserOAuth.d.ts +6 -8
- package/lib/Auth/BrowserOAuth.d.ts.map +1 -1
- package/lib/Auth/BrowserOAuth.js +25 -41
- package/lib/Auth/BrowserOAuth.js.map +1 -1
- package/lib/Auth/Credentials.d.ts.map +1 -1
- package/lib/Auth/Credentials.js +2 -2
- package/lib/Auth/Credentials.js.map +1 -1
- package/lib/Auth/Demand.d.ts +4 -4
- package/lib/Auth/Demand.d.ts.map +1 -1
- package/lib/Auth/Demand.js +16 -10
- package/lib/Auth/Demand.js.map +1 -1
- package/lib/Auth/Env.d.ts +2 -1
- package/lib/Auth/Env.d.ts.map +1 -1
- package/lib/Auth/Env.js +4 -2
- package/lib/Auth/Env.js.map +1 -1
- package/lib/Auth/Inspect.d.ts +2 -2
- package/lib/Auth/Inspect.d.ts.map +1 -1
- package/lib/Auth/Inspect.js +3 -1
- package/lib/Auth/Inspect.js.map +1 -1
- package/lib/Auth/Lock.d.ts.map +1 -1
- package/lib/Auth/Lock.js +4 -8
- package/lib/Auth/Lock.js.map +1 -1
- package/lib/Auth/OAuthFlow.d.ts +3 -12
- package/lib/Auth/OAuthFlow.d.ts.map +1 -1
- package/lib/Auth/OAuthFlow.js +7 -17
- package/lib/Auth/OAuthFlow.js.map +1 -1
- package/lib/Auth/Paths.d.ts +2 -1
- package/lib/Auth/Paths.d.ts.map +1 -1
- package/lib/Auth/Paths.js +3 -2
- package/lib/Auth/Paths.js.map +1 -1
- package/lib/Auth/Profile.d.ts +10 -0
- package/lib/Auth/Profile.d.ts.map +1 -1
- package/lib/Auth/Profile.js +19 -2
- package/lib/Auth/Profile.js.map +1 -1
- package/lib/Auth/Registry.d.ts +20 -0
- package/lib/Auth/Registry.d.ts.map +1 -0
- package/lib/Auth/Registry.js +17 -0
- package/lib/Auth/Registry.js.map +1 -0
- package/lib/Auth/Resolve.d.ts +34 -2
- package/lib/Auth/Resolve.d.ts.map +1 -1
- package/lib/Auth/Resolve.js +51 -3
- package/lib/Auth/Resolve.js.map +1 -1
- package/lib/Auth/StoredAuthProvider.d.ts +1 -1
- package/lib/Auth/StoredAuthProvider.d.ts.map +1 -1
- package/lib/Auth/StoredAuthProvider.js +1 -2
- package/lib/Auth/StoredAuthProvider.js.map +1 -1
- package/lib/Binding.d.ts.map +1 -1
- package/lib/Binding.js +3 -1
- package/lib/Binding.js.map +1 -1
- package/lib/Bundle/Bundle.d.ts +5 -0
- package/lib/Bundle/Bundle.d.ts.map +1 -1
- package/lib/Bundle/Bundle.js +36 -6
- package/lib/Bundle/Bundle.js.map +1 -1
- package/lib/Bundle/NamespaceImportPlugin.d.ts +55 -0
- package/lib/Bundle/NamespaceImportPlugin.d.ts.map +1 -0
- package/lib/Bundle/NamespaceImportPlugin.js +226 -0
- package/lib/Bundle/NamespaceImportPlugin.js.map +1 -0
- package/lib/Bundle/index.d.ts +1 -0
- package/lib/Bundle/index.d.ts.map +1 -1
- package/lib/Bundle/index.js +1 -0
- package/lib/Bundle/index.js.map +1 -1
- package/lib/Cli/Format.d.ts.map +1 -1
- package/lib/Cli/Format.js +2 -1
- package/lib/Cli/Format.js.map +1 -1
- package/lib/Cli/GlobalLog.d.ts +72 -26
- package/lib/Cli/GlobalLog.d.ts.map +1 -1
- package/lib/Cli/GlobalLog.js +151 -59
- package/lib/Cli/GlobalLog.js.map +1 -1
- package/lib/Cli/LoggingCli.d.ts.map +1 -1
- package/lib/Cli/LoggingCli.js +24 -18
- package/lib/Cli/LoggingCli.js.map +1 -1
- package/lib/Cli/PlainCliFormatter.d.ts.map +1 -1
- package/lib/Cli/PlainCliFormatter.js +4 -1
- package/lib/Cli/PlainCliFormatter.js.map +1 -1
- package/lib/Cli/Present.d.ts +14 -0
- package/lib/Cli/Present.d.ts.map +1 -0
- package/lib/Cli/Present.js +22 -0
- package/lib/Cli/Present.js.map +1 -0
- package/lib/Cli/SigilRenderer.d.ts +58 -0
- package/lib/Cli/SigilRenderer.d.ts.map +1 -0
- package/lib/Cli/SigilRenderer.js +39 -0
- package/lib/Cli/SigilRenderer.js.map +1 -0
- package/lib/Cli/checkVersion.d.ts +11 -14
- package/lib/Cli/checkVersion.d.ts.map +1 -1
- package/lib/Cli/checkVersion.js +19 -77
- package/lib/Cli/checkVersion.js.map +1 -1
- package/lib/Cli/commands/confirm.d.ts +2 -2
- package/lib/Cli/commands/confirm.d.ts.map +1 -1
- package/lib/Cli/commands/confirm.js +3 -3
- package/lib/Cli/commands/confirm.js.map +1 -1
- package/lib/Cli/commands/deploy.d.ts +4 -4
- package/lib/Cli/commands/deploy.d.ts.map +1 -1
- package/lib/Cli/commands/deploy.js +40 -39
- package/lib/Cli/commands/deploy.js.map +1 -1
- package/lib/Cli/commands/dev.d.ts.map +1 -1
- package/lib/Cli/commands/dev.js +41 -3
- package/lib/Cli/commands/dev.js.map +1 -1
- package/lib/Cli/commands/drift.d.ts +2 -2
- package/lib/Cli/commands/drift.d.ts.map +1 -1
- package/lib/Cli/commands/drift.js +14 -13
- package/lib/Cli/commands/drift.js.map +1 -1
- package/lib/Cli/commands/errors.d.ts.map +1 -1
- package/lib/Cli/commands/errors.js +2 -1
- package/lib/Cli/commands/errors.js.map +1 -1
- package/lib/Cli/commands/instrument.d.ts +15 -5
- package/lib/Cli/commands/instrument.d.ts.map +1 -1
- package/lib/Cli/commands/instrument.js +33 -8
- package/lib/Cli/commands/instrument.js.map +1 -1
- package/lib/Cli/commands/logs.d.ts +1 -1
- package/lib/Cli/commands/logs.d.ts.map +1 -1
- package/lib/Cli/commands/logs.js +22 -22
- package/lib/Cli/commands/logs.js.map +1 -1
- package/lib/Cli/commands/nuke.d.ts +3 -2
- package/lib/Cli/commands/nuke.d.ts.map +1 -1
- package/lib/Cli/commands/nuke.js +19 -17
- package/lib/Cli/commands/nuke.js.map +1 -1
- package/lib/Cli/commands/profile/commands.d.ts +3 -2
- package/lib/Cli/commands/profile/commands.d.ts.map +1 -1
- package/lib/Cli/commands/profile/commands.js +26 -27
- package/lib/Cli/commands/profile/commands.js.map +1 -1
- package/lib/Cli/commands/profile/flows.d.ts +6 -5
- package/lib/Cli/commands/profile/flows.d.ts.map +1 -1
- package/lib/Cli/commands/profile/flows.js +19 -17
- package/lib/Cli/commands/profile/flows.js.map +1 -1
- package/lib/Cli/commands/profile/hub.d.ts +1 -2
- package/lib/Cli/commands/profile/hub.d.ts.map +1 -1
- package/lib/Cli/commands/profile/hub.js +15 -17
- package/lib/Cli/commands/profile/hub.js.map +1 -1
- package/lib/Cli/commands/provider.d.ts +3 -1
- package/lib/Cli/commands/provider.d.ts.map +1 -1
- package/lib/Cli/commands/provider.js +4 -4
- package/lib/Cli/commands/provider.js.map +1 -1
- package/lib/Cli/commands/render.d.ts +2 -4
- package/lib/Cli/commands/render.d.ts.map +1 -1
- package/lib/Cli/commands/render.js +33 -56
- package/lib/Cli/commands/render.js.map +1 -1
- package/lib/Cli/commands/state.d.ts +1 -2
- package/lib/Cli/commands/state.d.ts.map +1 -1
- package/lib/Cli/commands/state.js +74 -27
- package/lib/Cli/commands/state.js.map +1 -1
- package/lib/Cli/components/capabilities.d.ts +4 -0
- package/lib/Cli/components/capabilities.d.ts.map +1 -0
- package/lib/Cli/components/capabilities.js +18 -0
- package/lib/Cli/components/capabilities.js.map +1 -0
- package/lib/Cli/components/types.d.ts +2 -81
- package/lib/Cli/components/types.d.ts.map +1 -1
- package/lib/Cli/components/types.js +1 -3
- package/lib/Cli/components/types.js.map +1 -1
- package/lib/Cli/components/ui/Environment.d.ts +3 -3
- package/lib/Cli/components/ui/Environment.d.ts.map +1 -1
- package/lib/Cli/components/ui/Environment.js.map +1 -1
- package/lib/Cli/components/ui/Interactive.d.ts +17 -4
- package/lib/Cli/components/ui/Interactive.d.ts.map +1 -1
- package/lib/Cli/components/ui/Interactive.js +7 -11
- package/lib/Cli/components/ui/Interactive.js.map +1 -1
- package/lib/Cli/components/ui/Layout.d.ts +1 -1
- package/lib/Cli/components/ui/Layout.d.ts.map +1 -1
- package/lib/Cli/components/ui/Layout.js +1 -1
- package/lib/Cli/components/ui/Layout.js.map +1 -1
- package/lib/Cli/components/ui/Typography.d.ts +1 -1
- package/lib/Cli/components/ui/Typography.d.ts.map +1 -1
- package/lib/Cli/components/ui/Typography.js +1 -1
- package/lib/Cli/components/ui/Typography.js.map +1 -1
- package/lib/Cli/components/ui/index.d.ts +2 -2
- package/lib/Cli/components/ui/index.js +2 -2
- package/lib/Cli/components/view/ApprovePlan.d.ts +1 -1
- package/lib/Cli/components/view/ApprovePlan.d.ts.map +1 -1
- package/lib/Cli/components/view/ApprovePlan.js +2 -1
- package/lib/Cli/components/view/ApprovePlan.js.map +1 -1
- package/lib/Cli/components/view/Format.d.ts +5 -0
- package/lib/Cli/components/view/Format.d.ts.map +1 -0
- package/lib/Cli/components/view/Format.js +39 -0
- package/lib/Cli/components/view/Format.js.map +1 -0
- package/lib/Cli/components/view/Help.d.ts +2 -2
- package/lib/Cli/components/view/Help.d.ts.map +1 -1
- package/lib/Cli/components/view/Help.js +7 -5
- package/lib/Cli/components/view/Help.js.map +1 -1
- package/lib/Cli/components/view/Logo.js +1 -1
- package/lib/Cli/components/view/Logo.js.map +1 -1
- package/lib/Cli/components/view/Nuke.d.ts +8 -9
- package/lib/Cli/components/view/Nuke.d.ts.map +1 -1
- package/lib/Cli/components/view/Nuke.js +49 -52
- package/lib/Cli/components/view/Nuke.js.map +1 -1
- package/lib/Cli/components/view/PlanDecision.d.ts +1 -1
- package/lib/Cli/components/view/PlanDecision.d.ts.map +1 -1
- package/lib/Cli/components/view/PlanDecision.js +1 -1
- package/lib/Cli/components/view/PlanDecision.js.map +1 -1
- package/lib/Cli/components/view/PlanRow.js +1 -1
- package/lib/Cli/components/view/PlanRow.js.map +1 -1
- package/lib/Cli/components/view/PlanTree.d.ts +1 -1
- package/lib/Cli/components/view/PlanTree.d.ts.map +1 -1
- package/lib/Cli/components/view/PlanTree.js +1 -1
- package/lib/Cli/components/view/PlanView.js +1 -1
- package/lib/Cli/components/view/PlanView.js.map +1 -1
- package/lib/Cli/components/view/Profile.d.ts +1 -1
- package/lib/Cli/components/view/Profile.js +2 -2
- package/lib/Cli/components/view/Profile.js.map +1 -1
- package/lib/Cli/components/view/ProfileDashboard.d.ts +4 -4
- package/lib/Cli/components/view/ProfileDashboard.d.ts.map +1 -1
- package/lib/Cli/components/view/ProfileDashboard.js +9 -8
- package/lib/Cli/components/view/ProfileDashboard.js.map +1 -1
- package/lib/Cli/components/view/Prompts.d.ts +3 -3
- package/lib/Cli/components/view/Prompts.d.ts.map +1 -1
- package/lib/Cli/components/view/Prompts.js +11 -18
- package/lib/Cli/components/view/Prompts.js.map +1 -1
- package/lib/Cli/components/view/Runtime.d.ts +5 -5
- package/lib/Cli/components/view/Runtime.d.ts.map +1 -1
- package/lib/Cli/components/view/Runtime.js +136 -219
- package/lib/Cli/components/view/Runtime.js.map +1 -1
- package/lib/Cli/components/view/SigilCli.d.ts +2 -2
- package/lib/Cli/components/view/SigilCli.d.ts.map +1 -1
- package/lib/Cli/components/view/SigilCli.js +7 -7
- package/lib/Cli/components/view/SigilCli.js.map +1 -1
- package/lib/Cli/components/view/StateExplorer.d.ts +1 -1
- package/lib/Cli/components/view/StateExplorer.d.ts.map +1 -1
- package/lib/Cli/components/view/StateExplorer.js +2 -1
- package/lib/Cli/components/view/StateExplorer.js.map +1 -1
- package/lib/Cli/components/view/statusStyle.d.ts +2 -2
- package/lib/Cli/components/view/statusStyle.d.ts.map +1 -1
- package/lib/Cli/components/view/statusStyle.js +1 -1
- package/lib/Cli/components/view/statusStyle.js.map +1 -1
- package/lib/Cli/exec.d.ts +6 -1
- package/lib/Cli/exec.d.ts.map +1 -1
- package/lib/Cli/exec.js +29 -34
- package/lib/Cli/exec.js.map +1 -1
- package/lib/Cli/main.d.ts.map +1 -1
- package/lib/Cli/main.js +35 -26
- package/lib/Cli/main.js.map +1 -1
- package/lib/Cli/selectCli.d.ts +2 -2
- package/lib/Cli/selectCli.d.ts.map +1 -1
- package/lib/Cli/selectCli.js +2 -2
- package/lib/Cli/selectCli.js.map +1 -1
- package/lib/Command/Command.js +1 -1
- package/lib/Command/Command.js.map +1 -1
- package/lib/Command/Dev.d.ts +58 -4
- package/lib/Command/Dev.d.ts.map +1 -1
- package/lib/Command/Dev.js +87 -30
- package/lib/Command/Dev.js.map +1 -1
- package/lib/Command/Local.d.ts +1 -1
- package/lib/Command/Memo.js +1 -1
- package/lib/Command/Memo.js.map +1 -1
- package/lib/Command/Providers.d.ts +1 -1
- package/lib/Command/Providers.d.ts.map +1 -1
- package/lib/Contributions.d.ts +2 -3
- package/lib/Contributions.d.ts.map +1 -1
- package/lib/Contributions.js +38 -6
- package/lib/Contributions.js.map +1 -1
- package/lib/DNS/Adapter.d.ts +204 -0
- package/lib/DNS/Adapter.d.ts.map +1 -0
- package/lib/DNS/Adapter.js +112 -0
- package/lib/DNS/Adapter.js.map +1 -0
- package/lib/DNS/index.d.ts +2 -0
- package/lib/DNS/index.d.ts.map +1 -0
- package/lib/DNS/index.js +2 -0
- package/lib/DNS/index.js.map +1 -0
- package/lib/Deploy.d.ts +7 -2
- package/lib/Deploy.d.ts.map +1 -1
- package/lib/Deploy.js +8 -3
- package/lib/Deploy.js.map +1 -1
- package/lib/Destroy.d.ts +5 -8
- package/lib/Destroy.d.ts.map +1 -1
- package/lib/Destroy.js +10 -7
- package/lib/Destroy.js.map +1 -1
- package/lib/Diff.d.ts.map +1 -1
- package/lib/Diff.js +14 -4
- package/lib/Diff.js.map +1 -1
- package/lib/Drift.d.ts +7 -7
- package/lib/Drift.d.ts.map +1 -1
- package/lib/Drift.js +184 -101
- package/lib/Drift.js.map +1 -1
- package/lib/EvalStack.d.ts +23 -0
- package/lib/EvalStack.d.ts.map +1 -0
- package/lib/EvalStack.js +47 -0
- package/lib/EvalStack.js.map +1 -0
- package/lib/Events.d.ts +210 -0
- package/lib/Events.d.ts.map +1 -0
- package/lib/Events.js +244 -0
- package/lib/Events.js.map +1 -0
- package/lib/Interaction.d.ts +159 -48
- package/lib/Interaction.d.ts.map +1 -1
- package/lib/Interaction.js +139 -58
- package/lib/Interaction.js.map +1 -1
- package/lib/Local/LocalProvider.d.ts.map +1 -1
- package/lib/Local/LocalProvider.js +31 -9
- package/lib/Local/LocalProvider.js.map +1 -1
- package/lib/Local/RpcProvider.d.ts.map +1 -1
- package/lib/Local/RpcProvider.js +10 -1
- package/lib/Local/RpcProvider.js.map +1 -1
- package/lib/Local/RpcProviderProxy.d.ts +16 -0
- package/lib/Local/RpcProviderProxy.d.ts.map +1 -1
- package/lib/Local/RpcProviderProxy.js +19 -10
- package/lib/Local/RpcProviderProxy.js.map +1 -1
- package/lib/Local/RpcSerialization.d.ts +3 -2
- package/lib/Local/RpcSerialization.d.ts.map +1 -1
- package/lib/Local/RpcSerialization.js +13 -10
- package/lib/Local/RpcSerialization.js.map +1 -1
- package/lib/Local/RpcServer.d.ts +2 -1
- package/lib/Local/RpcServer.d.ts.map +1 -1
- package/lib/Local/RpcServer.js +19 -14
- package/lib/Local/RpcServer.js.map +1 -1
- package/lib/Local/RpcServerBun.d.ts.map +1 -1
- package/lib/Local/RpcServerBun.js +8 -4
- package/lib/Local/RpcServerBun.js.map +1 -1
- package/lib/Local/RpcServerEnvironment.d.ts +2 -3
- package/lib/Local/RpcServerEnvironment.d.ts.map +1 -1
- package/lib/Local/RpcServerEnvironment.js +2 -2
- package/lib/Local/RpcServerEnvironment.js.map +1 -1
- package/lib/Local/RpcServerNode.d.ts.map +1 -1
- package/lib/Local/RpcServerNode.js +5 -1
- package/lib/Local/RpcServerNode.js.map +1 -1
- package/lib/Local/RpcServerSession.d.ts +1 -1
- package/lib/Local/RpcServerSession.d.ts.map +1 -1
- package/lib/Local/RpcServerSession.js.map +1 -1
- package/lib/Local/RpcSpawner.d.ts +6 -8
- package/lib/Local/RpcSpawner.d.ts.map +1 -1
- package/lib/Local/RpcSpawner.js +45 -36
- package/lib/Local/RpcSpawner.js.map +1 -1
- package/lib/Local/Sidecar.d.ts +23 -0
- package/lib/Local/Sidecar.d.ts.map +1 -1
- package/lib/Local/Sidecar.js +14 -9
- package/lib/Local/Sidecar.js.map +1 -1
- package/lib/Nuke.d.ts +5 -23
- package/lib/Nuke.d.ts.map +1 -1
- package/lib/Nuke.js +48 -13
- package/lib/Nuke.js.map +1 -1
- package/lib/Output.d.ts +19 -1
- package/lib/Output.d.ts.map +1 -1
- package/lib/Output.js +96 -3
- package/lib/Output.js.map +1 -1
- package/lib/Plan.d.ts +5 -1
- package/lib/Plan.d.ts.map +1 -1
- package/lib/Plan.js +111 -33
- package/lib/Plan.js.map +1 -1
- package/lib/Platform.d.ts.map +1 -1
- package/lib/Platform.js +31 -7
- package/lib/Platform.js.map +1 -1
- package/lib/Provider.d.ts +45 -0
- package/lib/Provider.d.ts.map +1 -1
- package/lib/Provider.js +2 -2
- package/lib/Provider.js.map +1 -1
- package/lib/Report.d.ts +17 -195
- package/lib/Report.d.ts.map +1 -1
- package/lib/Report.js +39 -12
- package/lib/Report.js.map +1 -1
- package/lib/Runtime/ManagedHttpShutdown.d.ts +17 -0
- package/lib/Runtime/ManagedHttpShutdown.d.ts.map +1 -1
- package/lib/Runtime/ManagedHttpShutdown.js +11 -2
- package/lib/Runtime/ManagedHttpShutdown.js.map +1 -1
- package/lib/RuntimeContext.js +1 -1
- package/lib/RuntimeContext.js.map +1 -1
- package/lib/Stack.d.ts +49 -29
- package/lib/Stack.d.ts.map +1 -1
- package/lib/Stack.js +25 -31
- package/lib/Stack.js.map +1 -1
- package/lib/State/BucketState.d.ts.map +1 -1
- package/lib/State/BucketState.js +43 -14
- package/lib/State/BucketState.js.map +1 -1
- package/lib/State/LocalState.d.ts.map +1 -1
- package/lib/State/LocalState.js +3 -3
- package/lib/State/LocalState.js.map +1 -1
- package/lib/State/Provisioning.d.ts +5 -0
- package/lib/State/Provisioning.d.ts.map +1 -1
- package/lib/State/Provisioning.js +3 -1
- package/lib/State/Provisioning.js.map +1 -1
- package/lib/State/ResourceState.d.ts +2 -0
- package/lib/State/ResourceState.d.ts.map +1 -1
- package/lib/State/State.d.ts +26 -0
- package/lib/State/State.d.ts.map +1 -1
- package/lib/State/StateEncoding.d.ts +7 -0
- package/lib/State/StateEncoding.d.ts.map +1 -1
- package/lib/State/StateEncoding.js +19 -0
- package/lib/State/StateEncoding.js.map +1 -1
- package/lib/State/index.js +2 -2
- package/lib/State/index.js.map +1 -1
- package/lib/Telemetry/Layer.d.ts +2 -5
- package/lib/Telemetry/Layer.d.ts.map +1 -1
- package/lib/Telemetry/Layer.js +3 -23
- package/lib/Telemetry/Layer.js.map +1 -1
- package/lib/Telemetry/Metrics.d.ts +1 -1
- package/lib/Telemetry/Metrics.d.ts.map +1 -1
- package/lib/TelemetryRelay.js +1 -1
- package/lib/TelemetryRelay.js.map +1 -1
- package/lib/TelemetryRuntime.d.ts +1 -1
- package/lib/TelemetryRuntime.d.ts.map +1 -1
- package/lib/TelemetryRuntime.js +4 -3
- package/lib/TelemetryRuntime.js.map +1 -1
- package/lib/Util/ConsoleSink.d.ts +23 -2
- package/lib/Util/ConsoleSink.d.ts.map +1 -1
- package/lib/Util/ConsoleSink.js +54 -14
- package/lib/Util/ConsoleSink.js.map +1 -1
- package/lib/Util/LogAnnotation.d.ts +19 -0
- package/lib/Util/LogAnnotation.d.ts.map +1 -0
- package/lib/Util/LogAnnotation.js +19 -0
- package/lib/Util/LogAnnotation.js.map +1 -0
- package/lib/Util/LogRecord.d.ts +281 -0
- package/lib/Util/LogRecord.d.ts.map +1 -0
- package/lib/Util/LogRecord.js +267 -0
- package/lib/Util/LogRecord.js.map +1 -0
- package/lib/Util/Node.d.ts +9 -0
- package/lib/Util/Node.d.ts.map +1 -1
- package/lib/Util/Node.js +10 -6
- package/lib/Util/Node.js.map +1 -1
- package/lib/Util/PlatformServices.d.ts +3 -2
- package/lib/Util/PlatformServices.d.ts.map +1 -1
- package/lib/Util/PlatformServices.js +6 -2
- package/lib/Util/PlatformServices.js.map +1 -1
- package/lib/Util/ResourceOutput.d.ts +18 -10
- package/lib/Util/ResourceOutput.d.ts.map +1 -1
- package/lib/Util/ResourceOutput.js +22 -23
- package/lib/Util/ResourceOutput.js.map +1 -1
- package/lib/Util/Shutdown.d.ts +10 -0
- package/lib/Util/Shutdown.d.ts.map +1 -0
- package/lib/Util/Shutdown.js +32 -0
- package/lib/Util/Shutdown.js.map +1 -0
- package/lib/Util/Terminal.d.ts +2 -4
- package/lib/Util/Terminal.d.ts.map +1 -1
- package/lib/Util/Terminal.js +3 -11
- package/lib/Util/Terminal.js.map +1 -1
- package/lib/Util/TraceParent.d.ts +32 -0
- package/lib/Util/TraceParent.d.ts.map +1 -0
- package/lib/Util/TraceParent.js +42 -0
- package/lib/Util/TraceParent.js.map +1 -0
- package/lib/Util/base64.d.ts +7 -0
- package/lib/Util/base64.d.ts.map +1 -0
- package/lib/Util/base64.js +24 -0
- package/lib/Util/base64.js.map +1 -0
- package/lib/Util/cached-function.d.ts +5 -0
- package/lib/Util/cached-function.d.ts.map +1 -1
- package/lib/Util/cached-function.js +13 -8
- package/lib/Util/cached-function.js.map +1 -1
- package/lib/Util/data.d.ts +1 -1
- package/lib/Util/data.d.ts.map +1 -1
- package/lib/Util/data.js +1 -1
- package/lib/Util/data.js.map +1 -1
- package/lib/Util/equal.d.ts.map +1 -1
- package/lib/Util/equal.js +3 -2
- package/lib/Util/equal.js.map +1 -1
- package/lib/Util/extraFiles.d.ts.map +1 -1
- package/lib/Util/extraFiles.js +5 -5
- package/lib/Util/extraFiles.js.map +1 -1
- package/lib/Util/interactive.js +1 -1
- package/lib/Website/AstroOutput.d.ts +42 -0
- package/lib/Website/AstroOutput.d.ts.map +1 -0
- package/lib/Website/AstroOutput.js +34 -0
- package/lib/Website/AstroOutput.js.map +1 -0
- package/lib/Website/FrontendCore.d.ts +1 -1
- package/lib/Workflows.d.ts +9 -0
- package/lib/Workflows.d.ts.map +1 -1
- package/lib/Workflows.js +8 -0
- package/lib/Workflows.js.map +1 -1
- package/lib/index.d.ts +1 -0
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +1 -0
- package/lib/index.js.map +1 -1
- package/package.json +21 -28
- package/src/AdoptPolicy.ts +76 -0
- package/src/Alchemist/AuthRegistry.ts +164 -0
- package/src/Alchemist/Drift.ts +103 -0
- package/src/Alchemist/Entrypoint.ts +51 -3
- package/src/Alchemist/Errors.ts +1 -1
- package/src/Alchemist/{routes/logs.ts → Logs.ts} +28 -30
- package/src/Alchemist/Nuke.ts +90 -0
- package/src/Alchemist/Operations.ts +309 -0
- package/src/Alchemist/{routes/profile.ts → Profile.ts} +22 -22
- package/src/Alchemist/{routes/provider.ts → Provider.ts} +7 -6
- package/src/Alchemist/Runtime.ts +46 -12
- package/src/Alchemist/{routes/state.ts → State.ts} +78 -21
- package/src/Alchemist/index.ts +32 -15
- package/src/Apply.ts +513 -274
- package/src/Auth/AuthProvider.ts +76 -23
- package/src/Auth/BrowserOAuth.ts +37 -60
- package/src/Auth/Credentials.ts +2 -4
- package/src/Auth/Demand.ts +27 -18
- package/src/Auth/Env.ts +13 -8
- package/src/Auth/Inspect.ts +5 -2
- package/src/Auth/Lock.ts +4 -8
- package/src/Auth/OAuthFlow.ts +12 -26
- package/src/Auth/Paths.ts +3 -2
- package/src/Auth/Profile.ts +30 -2
- package/src/Auth/Registry.ts +27 -0
- package/src/Auth/Resolve.ts +75 -3
- package/src/Auth/StoredAuthProvider.ts +1 -2
- package/src/Binding.ts +3 -4
- package/src/Bundle/Bundle.ts +58 -7
- package/src/Bundle/NamespaceImportPlugin.ts +259 -0
- package/src/Bundle/index.ts +1 -0
- package/src/Cli/Format.ts +2 -1
- package/src/Cli/GlobalLog.ts +206 -68
- package/src/Cli/LoggingCli.ts +33 -20
- package/src/Cli/PlainCliFormatter.ts +4 -1
- package/src/Cli/Present.ts +34 -0
- package/src/Cli/SigilRenderer.ts +75 -0
- package/src/Cli/checkVersion.ts +25 -78
- package/src/Cli/commands/confirm.ts +3 -3
- package/src/Cli/commands/deploy.ts +53 -44
- package/src/Cli/commands/dev.ts +65 -7
- package/src/Cli/commands/drift.ts +20 -16
- package/src/Cli/commands/errors.ts +2 -3
- package/src/Cli/commands/instrument.ts +39 -8
- package/src/Cli/commands/logs.ts +22 -30
- package/src/Cli/commands/nuke.ts +25 -26
- package/src/Cli/commands/profile/commands.ts +34 -34
- package/src/Cli/commands/profile/flows.ts +26 -20
- package/src/Cli/commands/profile/hub.ts +16 -18
- package/src/Cli/commands/provider.ts +4 -4
- package/src/Cli/commands/render.ts +43 -71
- package/src/Cli/commands/state.ts +113 -33
- package/src/Cli/components/capabilities.ts +20 -0
- package/src/Cli/components/types.ts +13 -99
- package/src/Cli/components/ui/Environment.tsx +5 -5
- package/src/Cli/components/ui/Interactive.tsx +24 -15
- package/src/Cli/components/ui/Layout.tsx +1 -1
- package/src/Cli/components/ui/Typography.tsx +1 -1
- package/src/Cli/components/ui/index.ts +2 -2
- package/src/Cli/components/view/ApprovePlan.tsx +2 -1
- package/src/Cli/components/view/Format.tsx +58 -0
- package/src/Cli/components/view/Help.tsx +14 -17
- package/src/Cli/components/view/Logo.tsx +1 -1
- package/src/Cli/components/view/Nuke.tsx +74 -49
- package/src/Cli/components/view/PlanDecision.tsx +1 -1
- package/src/Cli/components/view/PlanRow.tsx +1 -1
- package/src/Cli/components/view/PlanTree.ts +2 -2
- package/src/Cli/components/view/PlanView.tsx +2 -2
- package/src/Cli/components/view/Profile.tsx +2 -2
- package/src/Cli/components/view/ProfileDashboard.tsx +12 -11
- package/src/Cli/components/view/Prompts.tsx +37 -75
- package/src/Cli/components/view/Runtime.tsx +132 -238
- package/src/Cli/components/view/SigilCli.tsx +12 -12
- package/src/Cli/components/view/StateExplorer.tsx +2 -1
- package/src/Cli/components/view/statusStyle.ts +2 -2
- package/src/Cli/exec.ts +48 -41
- package/src/Cli/main.ts +52 -33
- package/src/Cli/selectCli.ts +3 -3
- package/src/Command/Command.ts +1 -1
- package/src/Command/Dev.ts +129 -36
- package/src/Command/Memo.ts +1 -1
- package/src/Contributions.ts +42 -8
- package/src/DNS/Adapter.ts +289 -0
- package/src/DNS/index.ts +1 -0
- package/src/Deploy.ts +11 -3
- package/src/Destroy.ts +19 -13
- package/src/Diff.ts +17 -4
- package/src/Drift.ts +256 -127
- package/src/EvalStack.ts +97 -0
- package/src/Events.ts +296 -0
- package/src/Interaction.ts +332 -97
- package/src/Local/LocalProvider.ts +40 -9
- package/src/Local/RpcProvider.ts +11 -1
- package/src/Local/RpcProviderProxy.ts +29 -21
- package/src/Local/RpcSerialization.ts +32 -17
- package/src/Local/RpcServer.ts +25 -17
- package/src/Local/RpcServerBun.ts +10 -6
- package/src/Local/RpcServerEnvironment.ts +2 -2
- package/src/Local/RpcServerNode.ts +8 -1
- package/src/Local/RpcServerSession.ts +2 -2
- package/src/Local/RpcSpawner.ts +61 -37
- package/src/Local/Sidecar.ts +10 -1
- package/src/Nuke.ts +66 -43
- package/src/Output.ts +120 -7
- package/src/Plan.ts +140 -52
- package/src/Platform.ts +47 -18
- package/src/Provider.ts +48 -3
- package/src/Report.ts +77 -275
- package/src/Runtime/ManagedHttpShutdown.ts +21 -4
- package/src/RuntimeContext.ts +1 -1
- package/src/Stack.ts +113 -135
- package/src/State/BucketState.ts +53 -21
- package/src/State/LocalState.ts +7 -9
- package/src/State/Provisioning.ts +8 -1
- package/src/State/ResourceState.ts +2 -0
- package/src/State/State.ts +30 -0
- package/src/State/StateEncoding.ts +22 -0
- package/src/State/index.ts +2 -2
- package/src/Telemetry/Layer.ts +3 -24
- package/src/Telemetry/Metrics.ts +1 -1
- package/src/TelemetryRelay.ts +1 -1
- package/src/TelemetryRuntime.ts +8 -8
- package/src/Util/ConsoleSink.ts +76 -13
- package/src/Util/LogAnnotation.ts +18 -0
- package/src/Util/LogRecord.ts +386 -0
- package/src/Util/Node.ts +20 -6
- package/src/Util/PlatformServices.ts +17 -4
- package/src/Util/ResourceOutput.ts +26 -25
- package/src/Util/Shutdown.ts +52 -0
- package/src/Util/Terminal.ts +3 -20
- package/src/Util/TraceParent.ts +70 -0
- package/src/Util/base64.ts +22 -0
- package/src/Util/cached-function.ts +30 -19
- package/src/Util/data.ts +2 -2
- package/src/Util/equal.ts +3 -2
- package/src/Util/extraFiles.ts +9 -8
- package/src/Util/interactive.ts +1 -1
- package/src/Website/AstroOutput.ts +83 -0
- package/src/Workflows.ts +11 -0
- package/src/index.ts +1 -0
- package/lib/Alchemist/Progress.d.ts +0 -16
- package/lib/Alchemist/Progress.d.ts.map +0 -1
- package/lib/Alchemist/Progress.js +0 -123
- package/lib/Alchemist/Progress.js.map +0 -1
- package/lib/Alchemist/Session.d.ts +0 -116
- package/lib/Alchemist/Session.d.ts.map +0 -1
- package/lib/Alchemist/Session.js +0 -212
- package/lib/Alchemist/Session.js.map +0 -1
- package/lib/Alchemist/routes/drift.d.ts +0 -55
- package/lib/Alchemist/routes/drift.d.ts.map +0 -1
- package/lib/Alchemist/routes/drift.js +0 -52
- package/lib/Alchemist/routes/drift.js.map +0 -1
- package/lib/Alchemist/routes/logs.d.ts +0 -41
- package/lib/Alchemist/routes/logs.d.ts.map +0 -1
- package/lib/Alchemist/routes/logs.js.map +0 -1
- package/lib/Alchemist/routes/nuke.d.ts +0 -46
- package/lib/Alchemist/routes/nuke.d.ts.map +0 -1
- package/lib/Alchemist/routes/nuke.js +0 -80
- package/lib/Alchemist/routes/nuke.js.map +0 -1
- package/lib/Alchemist/routes/profile.d.ts +0 -133
- package/lib/Alchemist/routes/profile.d.ts.map +0 -1
- package/lib/Alchemist/routes/profile.js.map +0 -1
- package/lib/Alchemist/routes/provider.d.ts.map +0 -1
- package/lib/Alchemist/routes/provider.js.map +0 -1
- package/lib/Alchemist/routes/stack.d.ts +0 -95
- package/lib/Alchemist/routes/stack.d.ts.map +0 -1
- package/lib/Alchemist/routes/stack.js +0 -73
- package/lib/Alchemist/routes/stack.js.map +0 -1
- package/lib/Alchemist/routes/state.d.ts.map +0 -1
- package/lib/Alchemist/routes/state.js.map +0 -1
- package/lib/Cli/CliKit/CliKit.d.ts +0 -92
- package/lib/Cli/CliKit/CliKit.d.ts.map +0 -1
- package/lib/Cli/CliKit/CliKit.js +0 -27
- package/lib/Cli/CliKit/CliKit.js.map +0 -1
- package/lib/Cli/CliKit/index.d.ts +0 -9
- package/lib/Cli/CliKit/index.d.ts.map +0 -1
- package/lib/Cli/CliKit/index.js +0 -9
- package/lib/Cli/CliKit/index.js.map +0 -1
- package/lib/Cli/CliKit/interaction.d.ts +0 -13
- package/lib/Cli/CliKit/interaction.d.ts.map +0 -1
- package/lib/Cli/CliKit/interaction.js +0 -17
- package/lib/Cli/CliKit/interaction.js.map +0 -1
- package/lib/Cli/CliKit/layer.d.ts +0 -7
- package/lib/Cli/CliKit/layer.d.ts.map +0 -1
- package/lib/Cli/CliKit/layer.js +0 -33
- package/lib/Cli/CliKit/layer.js.map +0 -1
- package/lib/Local/DevLog.d.ts +0 -32
- package/lib/Local/DevLog.d.ts.map +0 -1
- package/lib/Local/DevLog.js +0 -112
- package/lib/Local/DevLog.js.map +0 -1
- package/lib/Test/Alchemy.d.ts +0 -79
- package/lib/Test/Alchemy.d.ts.map +0 -1
- package/lib/Test/Alchemy.js +0 -193
- package/lib/Test/Alchemy.js.map +0 -1
- package/lib/Test/Bun.d.ts +0 -69
- package/lib/Test/Bun.d.ts.map +0 -1
- package/lib/Test/Bun.js +0 -126
- package/lib/Test/Bun.js.map +0 -1
- package/lib/Test/Core.d.ts +0 -277
- package/lib/Test/Core.d.ts.map +0 -1
- package/lib/Test/Core.js +0 -362
- package/lib/Test/Core.js.map +0 -1
- package/lib/Test/Http.d.ts +0 -109
- package/lib/Test/Http.d.ts.map +0 -1
- package/lib/Test/Http.js +0 -123
- package/lib/Test/Http.js.map +0 -1
- package/lib/Test/TestState.d.ts +0 -12
- package/lib/Test/TestState.d.ts.map +0 -1
- package/lib/Test/TestState.js +0 -15
- package/lib/Test/TestState.js.map +0 -1
- package/lib/Test/Vitest.d.ts +0 -60
- package/lib/Test/Vitest.d.ts.map +0 -1
- package/lib/Test/Vitest.js +0 -132
- package/lib/Test/Vitest.js.map +0 -1
- package/lib/Test/index.d.ts +0 -3
- package/lib/Test/index.d.ts.map +0 -1
- package/lib/Test/index.js +0 -3
- package/lib/Test/index.js.map +0 -1
- package/lib/Util/FileLogger.d.ts +0 -7
- package/lib/Util/FileLogger.d.ts.map +0 -1
- package/lib/Util/FileLogger.js +0 -16
- package/lib/Util/FileLogger.js.map +0 -1
- package/src/Alchemist/Progress.ts +0 -167
- package/src/Alchemist/Session.ts +0 -415
- package/src/Alchemist/routes/drift.ts +0 -87
- package/src/Alchemist/routes/nuke.ts +0 -131
- package/src/Alchemist/routes/stack.ts +0 -173
- package/src/Cli/CliKit/CliKit.ts +0 -159
- package/src/Cli/CliKit/index.ts +0 -41
- package/src/Cli/CliKit/interaction.ts +0 -19
- package/src/Cli/CliKit/layer.ts +0 -44
- package/src/Local/DevLog.ts +0 -122
- package/src/Test/Alchemy.ts +0 -334
- package/src/Test/Bun.ts +0 -230
- package/src/Test/Core.ts +0 -785
- package/src/Test/Http.ts +0 -201
- package/src/Test/TestState.ts +0 -35
- package/src/Test/Vitest.ts +0 -239
- package/src/Test/index.ts +0 -2
- package/src/Util/FileLogger.ts +0 -20
package/src/Cli/exec.ts
CHANGED
|
@@ -4,7 +4,6 @@ import { trackBunImports } from "@alchemy.run/node-utils/watch-import-bun";
|
|
|
4
4
|
import * as Cause from "effect/Cause";
|
|
5
5
|
import * as Config from "effect/Config";
|
|
6
6
|
import * as ConfigProvider from "effect/ConfigProvider";
|
|
7
|
-
import * as Console from "effect/Console";
|
|
8
7
|
import * as Effect from "effect/Effect";
|
|
9
8
|
import * as FileSystem from "effect/FileSystem";
|
|
10
9
|
import * as FetchHttpClient from "effect/http/FetchHttpClient";
|
|
@@ -13,21 +12,24 @@ import * as Option from "effect/Option";
|
|
|
13
12
|
import * as Path from "effect/Path";
|
|
14
13
|
import * as Schema from "effect/Schema";
|
|
15
14
|
import { resolveStackEntrypoint } from "../Alchemist/Entrypoint.ts";
|
|
16
|
-
import
|
|
17
|
-
import
|
|
15
|
+
import { StackModuleLoader } from "../Alchemist/Entrypoint.ts";
|
|
16
|
+
import * as Alchemist from "../Alchemist/index.ts";
|
|
18
17
|
import { AlchemyContextLive } from "../AlchemyContext.ts";
|
|
19
18
|
import { ArtifactStore, createArtifactStore } from "../Artifacts.ts";
|
|
20
19
|
import { CredentialsStoreLive } from "../Auth/Credentials.ts";
|
|
21
20
|
import { ProfileStoreLive } from "../Auth/Profile.ts";
|
|
22
|
-
import
|
|
21
|
+
import * as Interaction from "../Interaction.ts";
|
|
23
22
|
import * as RpcProviderProxy from "../Local/RpcProviderProxy.ts";
|
|
24
23
|
import { forwardSidecarLogs } from "../Local/RpcSpawner.ts";
|
|
24
|
+
import { renderApply } from "../Report.ts";
|
|
25
25
|
import { TelemetryLive } from "../Telemetry/Layer.ts";
|
|
26
|
+
import { LogProcess, parentLogLayer } from "../Util/LogRecord.ts";
|
|
26
27
|
import { initialCwd } from "../Util/Node.ts";
|
|
27
28
|
import { PlatformServices } from "../Util/PlatformServices.ts";
|
|
28
|
-
import
|
|
29
|
+
import { logShutdown } from "../Util/Shutdown.ts";
|
|
30
|
+
import { processTrace, withTraceParent } from "../Util/TraceParent.ts";
|
|
29
31
|
import { handleCliErrors, installShutdownFeedback } from "./commands/errors.ts";
|
|
30
|
-
import {
|
|
32
|
+
import { renderPlanning } from "./commands/render.ts";
|
|
31
33
|
import { stackOutputsView } from "./components/view/StackOutputs.tsx";
|
|
32
34
|
import { DEV_RELOAD_EXIT_CODE, DevOptions } from "./DevOptions.ts";
|
|
33
35
|
import { ConsoleLogLive } from "./GlobalLog.ts";
|
|
@@ -37,7 +39,7 @@ import { selectCliServices } from "./selectCli.ts";
|
|
|
37
39
|
// and other non-interactive terminals still select the append-only renderer.
|
|
38
40
|
// `ALCHEMY_TUI` remains the explicit override in either direction.
|
|
39
41
|
const services = Layer.mergeAll(
|
|
40
|
-
Layer.provideMerge(
|
|
42
|
+
Layer.provideMerge(selectCliServices(), Interaction.layer()),
|
|
41
43
|
RpcProviderProxy.fromEnv(),
|
|
42
44
|
Layer.succeed(ArtifactStore, createArtifactStore()),
|
|
43
45
|
// Dev runs live in this exec child, not the `alchemy` CLI process, so
|
|
@@ -45,13 +47,8 @@ const services = Layer.mergeAll(
|
|
|
45
47
|
// `cli.dev` span though: dev remains alive across reloads, so a wrapping
|
|
46
48
|
// span would not end (and export) until shutdown — plan/apply spans are the
|
|
47
49
|
// trace roots instead.
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
// merges with it. As `mergeAll` siblings the last `CurrentLoggers` wins,
|
|
51
|
-
// and telemetry would replace the console logger — every `Effect.log*`
|
|
52
|
-
// (plan, apply progress, stack outputs) silently vanished from the
|
|
53
|
-
// terminal whenever telemetry was enabled.
|
|
54
|
-
Layer.provideMerge(TelemetryLive, ConsoleLogLive),
|
|
50
|
+
TelemetryLive,
|
|
51
|
+
ConsoleLogLive,
|
|
55
52
|
).pipe(
|
|
56
53
|
Layer.provideMerge(Layer.mergeAll(AlchemyContextLive, ProfileStoreLive, CredentialsStoreLive)),
|
|
57
54
|
Layer.provideMerge(
|
|
@@ -70,39 +67,41 @@ const devOnce = Config.String("ALCHEMY_DEV_ONCE").pipe(
|
|
|
70
67
|
);
|
|
71
68
|
|
|
72
69
|
const runDev = Effect.fn(function* (options: DevOptions) {
|
|
73
|
-
const
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
70
|
+
const snapshot = yield* Alchemist.importStack(options.main).pipe(
|
|
71
|
+
Effect.flatMap((stack) =>
|
|
72
|
+
Alchemist.plan({
|
|
73
|
+
stack,
|
|
74
|
+
operation: "deploy",
|
|
75
|
+
stage: options.stage,
|
|
76
|
+
profile: options.profile,
|
|
77
|
+
envFile: Option.getOrUndefined(options.envFile),
|
|
78
|
+
updateStateStore: true,
|
|
79
|
+
dev: true,
|
|
80
|
+
force: options.force,
|
|
81
|
+
include: options.include,
|
|
82
|
+
exclude: options.exclude,
|
|
83
|
+
}),
|
|
84
|
+
),
|
|
85
|
+
renderPlanning({ operation: "Dev", stage: options.stage }),
|
|
86
|
+
);
|
|
88
87
|
const once = yield* devOnce;
|
|
89
|
-
const
|
|
88
|
+
const applyAndRender = Alchemist.apply(snapshot).pipe(
|
|
90
89
|
renderApply(snapshot.native, {
|
|
91
90
|
stage: options.stage,
|
|
92
91
|
dev: !once,
|
|
93
92
|
}),
|
|
94
93
|
);
|
|
95
94
|
const result = yield* once
|
|
96
|
-
?
|
|
97
|
-
:
|
|
95
|
+
? applyAndRender
|
|
96
|
+
: applyAndRender.pipe(
|
|
98
97
|
Effect.catchCause((cause) =>
|
|
99
|
-
|
|
98
|
+
Effect.logError(
|
|
100
99
|
describeFailure("apply", cause, "keeping dev alive so healthy resources keep serving"),
|
|
101
100
|
).pipe(Effect.as(undefined)),
|
|
102
101
|
),
|
|
103
102
|
);
|
|
104
103
|
if (result !== undefined && once) {
|
|
105
|
-
const kit = yield*
|
|
104
|
+
const kit = yield* Interaction.Interaction;
|
|
106
105
|
yield* kit.output.print(stackOutputsView(result));
|
|
107
106
|
}
|
|
108
107
|
return once ? undefined : yield* Effect.never;
|
|
@@ -234,7 +233,7 @@ const describeFailure = (what: string, cause: Cause.Cause<unknown>, next: string
|
|
|
234
233
|
export const devKeepAlive = <A, E, R>(effect: Effect.Effect<A, E, R>): Effect.Effect<A, E, R> =>
|
|
235
234
|
effect.pipe(
|
|
236
235
|
Effect.catchCause((cause) =>
|
|
237
|
-
|
|
236
|
+
Effect.logError(
|
|
238
237
|
describeFailure("run", cause, "waiting for the next file change to retry"),
|
|
239
238
|
).pipe(Effect.andThen(Effect.never)),
|
|
240
239
|
),
|
|
@@ -249,11 +248,10 @@ const makeExec = () => {
|
|
|
249
248
|
// Subscribe to the spawner's sidecar log stream BEFORE the stack runs:
|
|
250
249
|
// this process owns the terminal renderer, so sidecar output printed
|
|
251
250
|
// here lands in chronological order with the run's own lines instead of
|
|
252
|
-
// racing the shared tty. No-op outside dev.
|
|
253
|
-
// to
|
|
254
|
-
//
|
|
255
|
-
|
|
256
|
-
yield* forwardSidecarLogs((entry) => devLog.writeLine(`[${entry.channel}] ${entry.line}`));
|
|
251
|
+
// racing the shared tty. No-op outside dev. Like every record of this
|
|
252
|
+
// process, they also go up to the `alchemy dev` process, which writes
|
|
253
|
+
// the run log (see `parentLogLayer`).
|
|
254
|
+
yield* forwardSidecarLogs;
|
|
257
255
|
// Single-pass runs park nothing. Otherwise Node reloads the stack graph in
|
|
258
256
|
// this process; Bun exits for the supervisor to respawn (see above).
|
|
259
257
|
return yield* (yield* devOnce)
|
|
@@ -261,7 +259,16 @@ const makeExec = () => {
|
|
|
261
259
|
: process.versions.bun !== undefined
|
|
262
260
|
? runBunDevWatcher(options)
|
|
263
261
|
: runNodeDevWatcher(options);
|
|
264
|
-
}).pipe(
|
|
262
|
+
}).pipe(
|
|
263
|
+
logShutdown("exec"),
|
|
264
|
+
// Spans join the trace `alchemy dev` passed down, like the records
|
|
265
|
+
// logged outside them already do.
|
|
266
|
+
withTraceParent(processTrace),
|
|
267
|
+
Effect.provide(Layer.provideMerge(parentLogLayer(), services)),
|
|
268
|
+
Effect.provideService(LogProcess, "exec"),
|
|
269
|
+
Effect.scoped,
|
|
270
|
+
handleCliErrors,
|
|
271
|
+
);
|
|
265
272
|
};
|
|
266
273
|
|
|
267
274
|
/** Fully wired sidecar CLI program. */
|
package/src/Cli/main.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AlchemyContextLive } from "alchemy/AlchemyContext";
|
|
1
|
+
import { AlchemyContext, AlchemyContextLive } from "alchemy/AlchemyContext";
|
|
2
2
|
import { ArtifactStore, createArtifactStore } from "alchemy/Artifacts";
|
|
3
3
|
import { CredentialsStoreLive } from "alchemy/Auth/Credentials";
|
|
4
4
|
import { ProfileStoreLive } from "alchemy/Auth/Profile";
|
|
@@ -6,26 +6,32 @@ import * as Contributions from "alchemy/Contributions";
|
|
|
6
6
|
import { TelemetryLive } from "alchemy/Telemetry/Layer";
|
|
7
7
|
import { moduleExtension } from "alchemy/Util/Node";
|
|
8
8
|
import { PlatformServices } from "alchemy/Util/PlatformServices";
|
|
9
|
-
import * as Cause from "effect/Cause";
|
|
10
9
|
import * as CliConfig from "effect/cli/CliConfig";
|
|
11
10
|
import * as CliError from "effect/cli/CliError";
|
|
12
11
|
import * as Command from "effect/cli/Command";
|
|
13
12
|
import * as Flag from "effect/cli/Flag";
|
|
14
13
|
import * as GlobalFlag from "effect/cli/GlobalFlag";
|
|
15
14
|
import * as ConfigProvider from "effect/ConfigProvider";
|
|
15
|
+
import * as Context from "effect/Context";
|
|
16
16
|
import * as Effect from "effect/Effect";
|
|
17
|
+
import * as FileSystem from "effect/FileSystem";
|
|
17
18
|
import * as FetchHttpClient from "effect/http/FetchHttpClient";
|
|
19
|
+
import * as HttpClient from "effect/http/HttpClient";
|
|
18
20
|
import * as Layer from "effect/Layer";
|
|
21
|
+
import * as Path from "effect/Path";
|
|
22
|
+
import * as Scope from "effect/Scope";
|
|
19
23
|
import packageJson from "../../package.json" with { type: "json" };
|
|
24
|
+
import * as Interaction from "../Interaction.ts";
|
|
25
|
+
import { logShutdown } from "../Util/Shutdown.ts";
|
|
20
26
|
import { checkLatestVersion } from "./checkVersion.ts";
|
|
21
|
-
import * as CliKit from "./CliKit/index.ts";
|
|
22
27
|
import {
|
|
23
28
|
compatibilityCommand,
|
|
24
29
|
compatibilityCommands,
|
|
25
30
|
type CompatibilityCommand,
|
|
26
31
|
} from "./commands/compat.ts";
|
|
27
32
|
import { handleCliErrors } from "./commands/errors.ts";
|
|
28
|
-
import {
|
|
33
|
+
import { VersionCheck } from "./commands/instrument.ts";
|
|
34
|
+
import { GlobalLogLive, LogFormatFlag, LogLevelFlag } from "./GlobalLog.ts";
|
|
29
35
|
import { selectCliServices } from "./selectCli.ts";
|
|
30
36
|
|
|
31
37
|
const commandMetadata = [
|
|
@@ -107,7 +113,7 @@ const commands = await Promise.all(
|
|
|
107
113
|
commandMetadata.map(([name, description]) =>
|
|
108
114
|
loadEveryCommand || name === requestedCommand
|
|
109
115
|
? loadCommand(name)
|
|
110
|
-
: placeholderCommand(name, description),
|
|
116
|
+
: Promise.resolve(placeholderCommand(name, description)),
|
|
111
117
|
),
|
|
112
118
|
);
|
|
113
119
|
|
|
@@ -126,6 +132,21 @@ const NoInput = GlobalFlag.Setting("no-input")({
|
|
|
126
132
|
),
|
|
127
133
|
});
|
|
128
134
|
|
|
135
|
+
/**
|
|
136
|
+
* `--fast-distilled` loads distilled SDKs through their lazy service stubs
|
|
137
|
+
* under Node. The launcher (`bin/cli.js`) reads it from argv before any
|
|
138
|
+
* module loads and passes it on as `ALCHEMY_FAST_DISTILLED=1`; this
|
|
139
|
+
* registration exists so the parser accepts the flag.
|
|
140
|
+
*/
|
|
141
|
+
const FastDistilled = GlobalFlag.Setting("fast-distilled")({
|
|
142
|
+
flag: Flag.Boolean("fast-distilled").pipe(
|
|
143
|
+
Flag.withDescription(
|
|
144
|
+
"Load distilled SDK operations on first use (Node only; lowers startup memory)",
|
|
145
|
+
),
|
|
146
|
+
Flag.withDefault(false),
|
|
147
|
+
),
|
|
148
|
+
});
|
|
149
|
+
|
|
129
150
|
const root = Command.make("alchemy", {}, () =>
|
|
130
151
|
Effect.fail(CliError.ShowHelp.make({ commandPath: ["alchemy"], errors: [] })),
|
|
131
152
|
).pipe(
|
|
@@ -144,7 +165,7 @@ const root = Command.make("alchemy", {}, () =>
|
|
|
144
165
|
compatibilityCommand(name as CompatibilityCommand),
|
|
145
166
|
),
|
|
146
167
|
]),
|
|
147
|
-
Command.withGlobalFlags([NoInput]),
|
|
168
|
+
Command.withGlobalFlags([NoInput, FastDistilled, LogLevelFlag, LogFormatFlag]),
|
|
148
169
|
);
|
|
149
170
|
|
|
150
171
|
/**
|
|
@@ -170,7 +191,7 @@ const cli = Command.run(root, {
|
|
|
170
191
|
|
|
171
192
|
const services = Layer.mergeAll(
|
|
172
193
|
CliConfig.layer({
|
|
173
|
-
builtIns: [GlobalFlag.Help, GlobalFlag.Version, GlobalFlag.Completions
|
|
194
|
+
builtIns: [GlobalFlag.Help, GlobalFlag.Version, GlobalFlag.Completions],
|
|
174
195
|
}),
|
|
175
196
|
Layer.provideMerge(AlchemyContextLive, PlatformServices),
|
|
176
197
|
Layer.provide(ProfileStoreLive, PlatformServices),
|
|
@@ -181,37 +202,35 @@ const services = Layer.mergeAll(
|
|
|
181
202
|
Layer.succeed(ArtifactStore, createArtifactStore()),
|
|
182
203
|
FetchHttpClient.layer,
|
|
183
204
|
ConfigProvider.layer(ConfigProvider.fromEnv()),
|
|
184
|
-
Layer.provide(
|
|
185
|
-
|
|
186
|
-
Layer.mergeAll(selectCliServices(), CliKit.CliKitInteraction),
|
|
187
|
-
CliKit.layer(),
|
|
188
|
-
),
|
|
189
|
-
PlatformServices,
|
|
190
|
-
),
|
|
191
|
-
// Debug run log under ~/.alchemy/logs — the console noise floor stays at
|
|
205
|
+
Layer.provide(Layer.provideMerge(selectCliServices(), Interaction.layer()), PlatformServices),
|
|
206
|
+
// Debug run log in the project's .alchemy/log — the console noise floor stays at
|
|
192
207
|
// Info, but full causes and auth-flow breadcrumbs land in the file so
|
|
193
208
|
// support can ask users for it.
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
// merges with them. Listed as `mergeAll` siblings, whichever came last
|
|
197
|
-
// would win the `CurrentLoggers` slot and silently drop the other.
|
|
198
|
-
Layer.provideMerge(TelemetryLive, Layer.provide(GlobalLogLive, PlatformServices)),
|
|
209
|
+
Layer.provide(GlobalLogLive, PlatformServices),
|
|
210
|
+
TelemetryLive,
|
|
199
211
|
);
|
|
200
212
|
|
|
201
213
|
const program = Effect.gen(function* () {
|
|
202
|
-
|
|
203
|
-
//
|
|
204
|
-
// before
|
|
205
|
-
//
|
|
206
|
-
//
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
)
|
|
214
|
+
// Best-effort check for a newer published version, run by each command
|
|
215
|
+
// before its handler: the console flags are parsed by then, and the
|
|
216
|
+
// warning prints before any interactive prompt. Cached for a day and
|
|
217
|
+
// bounded by a short timeout, so it stays fast. Its fetch may finish in
|
|
218
|
+
// the background, in this scope.
|
|
219
|
+
// Only the check's own services, so the command's flags and loggers win.
|
|
220
|
+
const services = Context.pick(
|
|
221
|
+
AlchemyContext,
|
|
222
|
+
FileSystem.FileSystem,
|
|
223
|
+
HttpClient.HttpClient,
|
|
224
|
+
Path.Path,
|
|
225
|
+
Scope.Scope,
|
|
226
|
+
)(
|
|
227
|
+
yield* Effect.context<
|
|
228
|
+
AlchemyContext | FileSystem.FileSystem | HttpClient.HttpClient | Path.Path | Scope.Scope
|
|
229
|
+
>(),
|
|
230
|
+
);
|
|
231
|
+
const check = yield* Effect.cached(Effect.provideContext(checkLatestVersion, services));
|
|
232
|
+
return yield* cli.pipe(Effect.provideService(VersionCheck, check));
|
|
233
|
+
}).pipe(logShutdown("cli"));
|
|
215
234
|
|
|
216
235
|
const mainEffect = program.pipe(
|
|
217
236
|
// $USER and $ALCHEMY_STAGE are set by the environment
|
package/src/Cli/selectCli.ts
CHANGED
|
@@ -2,18 +2,18 @@ import * as CliOutput from "effect/cli/CliOutput";
|
|
|
2
2
|
import type * as Prompt from "effect/cli/Prompt";
|
|
3
3
|
import * as Effect from "effect/Effect";
|
|
4
4
|
import * as Layer from "effect/Layer";
|
|
5
|
+
import { Interaction } from "../Interaction.ts";
|
|
5
6
|
import type { Cli } from "../Report.ts";
|
|
6
|
-
import { CliKit } from "./CliKit/CliKit.ts";
|
|
7
7
|
import { LoggingCli } from "./LoggingCli.ts";
|
|
8
8
|
import { plainCliFormatter } from "./PlainCliFormatter.ts";
|
|
9
9
|
|
|
10
|
-
type SelectedCli = Layer.Layer<Cli, never,
|
|
10
|
+
type SelectedCli = Layer.Layer<Cli, never, Interaction | Prompt.Environment>;
|
|
11
11
|
|
|
12
12
|
/** Select the interactive or append-only root renderer. */
|
|
13
13
|
export const selectCliServices = () =>
|
|
14
14
|
Layer.unwrap(
|
|
15
15
|
Effect.gen(function* () {
|
|
16
|
-
const cli = yield*
|
|
16
|
+
const cli = yield* Interaction;
|
|
17
17
|
if (!cli.terminal.input) {
|
|
18
18
|
const plain: SelectedCli = Layer.mergeAll(
|
|
19
19
|
LoggingCli,
|
package/src/Command/Command.ts
CHANGED
|
@@ -170,7 +170,7 @@ const TERMINATION_SIGNAL_DISPATCH_TIMEOUT = Duration.millis(25);
|
|
|
170
170
|
const parseExecutionTimeout = (
|
|
171
171
|
props: CommandRunProps,
|
|
172
172
|
): Effect.Effect<Duration.Duration | undefined, CommandError> => {
|
|
173
|
-
if (props.timeout === undefined) return Effect.
|
|
173
|
+
if (props.timeout === undefined) return Effect.undefined;
|
|
174
174
|
const decoded = Duration.fromInput(props.timeout);
|
|
175
175
|
if (
|
|
176
176
|
Option.isNone(decoded) ||
|
package/src/Command/Dev.ts
CHANGED
|
@@ -1,21 +1,44 @@
|
|
|
1
|
+
import * as NodeNet from "node:net";
|
|
1
2
|
import { stripVTControlCharacters } from "node:util";
|
|
2
|
-
import * as ConsoleService from "effect/Console";
|
|
3
3
|
import * as Deferred from "effect/Deferred";
|
|
4
4
|
import * as Effect from "effect/Effect";
|
|
5
|
+
import { SystemError } from "effect/PlatformError";
|
|
6
|
+
import * as Schedule from "effect/Schedule";
|
|
5
7
|
import * as Stream from "effect/Stream";
|
|
6
|
-
import { FQN_SEPARATOR } from "../FQN.ts";
|
|
7
|
-
import { makeDevLogOpener } from "../Local/DevLog.ts";
|
|
8
8
|
import * as LocalProvider from "../Local/LocalProvider.ts";
|
|
9
9
|
import * as ProviderLayer from "../Local/ProviderLayer.ts";
|
|
10
10
|
import * as Provider from "../Provider.ts";
|
|
11
11
|
import { Resource } from "../Resource.ts";
|
|
12
|
-
import { Stage } from "../Stage.ts";
|
|
13
12
|
import { moduleExtension } from "../Util/Node.ts";
|
|
14
13
|
import { makeResourceOutput } from "../Util/ResourceOutput.ts";
|
|
15
14
|
import { CommandExecutor, UnexpectedExit, makeCommandError, type CommandProps } from "./Command.ts";
|
|
16
15
|
import { makeCommandRedactor } from "./Redaction.ts";
|
|
17
16
|
|
|
18
|
-
export interface DevProps extends CommandProps {
|
|
17
|
+
export interface DevProps extends CommandProps {
|
|
18
|
+
/**
|
|
19
|
+
* Make the URL required: the resource is ready only once the command
|
|
20
|
+
* prints a URL, however long that takes, and fails if the command exits
|
|
21
|
+
* first. Without it, the resource waits 5 seconds and settles with
|
|
22
|
+
* `url: undefined` when no URL appears.
|
|
23
|
+
*
|
|
24
|
+
* A localhost/IP URL is still preferred: when the first URL printed is
|
|
25
|
+
* another one, the resource waits up to 5 seconds more for a local one
|
|
26
|
+
* before settling with it.
|
|
27
|
+
*
|
|
28
|
+
* @default false
|
|
29
|
+
*/
|
|
30
|
+
waitForUrl?: boolean;
|
|
31
|
+
/**
|
|
32
|
+
* The port the command listens on. Alchemy sets `PORT` to it, over any
|
|
33
|
+
* `env.PORT`, and the resource is ready once the port accepts a
|
|
34
|
+
* connection, however long that takes. Output isn't scanned for a URL,
|
|
35
|
+
* so `waitForUrl` has no effect: `url` is `http://localhost:<port>`.
|
|
36
|
+
*
|
|
37
|
+
* The resource fails if the command exits before the port opens, or if
|
|
38
|
+
* another process already listens on the port when the command starts.
|
|
39
|
+
*/
|
|
40
|
+
port?: number;
|
|
41
|
+
}
|
|
19
42
|
|
|
20
43
|
export interface Dev extends Resource<
|
|
21
44
|
"Command.Dev",
|
|
@@ -25,7 +48,9 @@ export interface Dev extends Resource<
|
|
|
25
48
|
* URL extracted from stdout/stderr. A `localhost`/IP URL (the dev
|
|
26
49
|
* server's own address) is preferred over any other URL the command
|
|
27
50
|
* prints; a non-local URL is only used as a fallback if no local one
|
|
28
|
-
* appears. Best-effort: `undefined` if no URL appears within 5 seconds
|
|
51
|
+
* appears. Best-effort: `undefined` if no URL appears within 5 seconds,
|
|
52
|
+
* unless `waitForUrl` is set, which waits until one does. With `port`,
|
|
53
|
+
* it is `http://localhost:<port>`.
|
|
29
54
|
*/
|
|
30
55
|
url: string | undefined;
|
|
31
56
|
}
|
|
@@ -58,6 +83,36 @@ export interface Dev extends Resource<
|
|
|
58
83
|
* yield* Console.log(dev.url); // e.g. "http://localhost:5173"
|
|
59
84
|
* ```
|
|
60
85
|
*
|
|
86
|
+
* ### Requiring a URL
|
|
87
|
+
* By default the resource waits 5 seconds for a URL and settles with
|
|
88
|
+
* `url: undefined` if none appears. Set `waitForUrl` when downstream
|
|
89
|
+
* resources depend on the URL: the resource is ready only once the
|
|
90
|
+
* command prints one, however long the server takes to start, and fails
|
|
91
|
+
* if the command exits first.
|
|
92
|
+
*
|
|
93
|
+
* **Example:** Wait for a slow server's URL
|
|
94
|
+
* ```typescript
|
|
95
|
+
* const engine = yield* Dev("Engine", {
|
|
96
|
+
* command: "rivet-engine start",
|
|
97
|
+
* waitForUrl: true,
|
|
98
|
+
* });
|
|
99
|
+
* ```
|
|
100
|
+
*
|
|
101
|
+
* ### Known Port
|
|
102
|
+
* When you choose the port, pass it as `port`: Alchemy sets `PORT` to it
|
|
103
|
+
* and the resource is ready once the port accepts a connection, with no
|
|
104
|
+
* output scanning. This suits servers that print no URL, and wrappers
|
|
105
|
+
* that route the port elsewhere.
|
|
106
|
+
*
|
|
107
|
+
* **Example:** Serve on port 4000
|
|
108
|
+
* ```typescript
|
|
109
|
+
* const api = yield* Dev("Api", {
|
|
110
|
+
* command: "node server.ts",
|
|
111
|
+
* port: 4000,
|
|
112
|
+
* });
|
|
113
|
+
* yield* Console.log(api.url); // "http://localhost:4000"
|
|
114
|
+
* ```
|
|
115
|
+
*
|
|
61
116
|
* ### Working Directory
|
|
62
117
|
* Use `cwd` to run the command in a subdirectory — useful in
|
|
63
118
|
* monorepos where each package has its own dev server.
|
|
@@ -110,27 +165,36 @@ export const DevProviderLocal = () =>
|
|
|
110
165
|
import.meta.resolve(`./Local${moduleExtension(import.meta.url)}`, import.meta.url),
|
|
111
166
|
Effect.gen(function* () {
|
|
112
167
|
const { spawn } = yield* CommandExecutor;
|
|
113
|
-
const stage = yield* Stage;
|
|
114
|
-
const openDevLog = yield* makeDevLogOpener;
|
|
115
|
-
const baseConsole = yield* ConsoleService.Console;
|
|
116
168
|
|
|
117
169
|
return {
|
|
118
170
|
// The dev process is spawned into the instance scope the helper
|
|
119
171
|
// provides: it keeps running after `start` returns (readiness) and
|
|
120
172
|
// is killed when the helper closes the scope on restart/delete.
|
|
121
173
|
start: Effect.fn(function* ({ fqn, news: props, invalidate }) {
|
|
122
|
-
const
|
|
174
|
+
const { port } = props;
|
|
175
|
+
// A restart has already killed the previous process group, so a
|
|
176
|
+
// listener now is someone else's (an orphaned server, say), and
|
|
177
|
+
// the readiness probe below would mistake it for this command.
|
|
178
|
+
if (port !== undefined && (yield* isListening(port))) {
|
|
179
|
+
return yield* makeCommandError(
|
|
180
|
+
props,
|
|
181
|
+
new SystemError({
|
|
182
|
+
_tag: "Busy",
|
|
183
|
+
module: "Command",
|
|
184
|
+
method: "Dev",
|
|
185
|
+
pathOrDescriptor: port,
|
|
186
|
+
description: "another process already listens on this port",
|
|
187
|
+
}),
|
|
188
|
+
);
|
|
189
|
+
}
|
|
190
|
+
const child = yield* spawn(
|
|
191
|
+
port === undefined ? props : { ...props, env: { ...props.env, PORT: `${port}` } },
|
|
192
|
+
);
|
|
123
193
|
const redactor = makeCommandRedactor(props.env);
|
|
124
|
-
//
|
|
125
|
-
//
|
|
126
|
-
//
|
|
127
|
-
const
|
|
128
|
-
yield* Effect.log(`[${fqn}] Logs → ${devLog.path}`);
|
|
129
|
-
// Through the Console SERVICE, never a raw fd write: the process
|
|
130
|
-
// that owns the terminal runs an ink renderer, and a bare write
|
|
131
|
-
// to its stdout tears the animated region. The CLI's console
|
|
132
|
-
// capture inserts these lines above it instead.
|
|
133
|
-
const prefixed = makeResourceOutput(fqn, baseConsole);
|
|
194
|
+
// Through the logger, never a raw fd write: the process that owns
|
|
195
|
+
// the terminal renders the records and writes them to the run log
|
|
196
|
+
// (and a bare write to its stdout would tear the animated region).
|
|
197
|
+
const prefixed = yield* makeResourceOutput(fqn);
|
|
134
198
|
yield* Effect.addFinalizer(() =>
|
|
135
199
|
Effect.sync(() => {
|
|
136
200
|
prefixed.stdout.flush();
|
|
@@ -145,23 +209,21 @@ export const DevProviderLocal = () =>
|
|
|
145
209
|
// always wins if one shows up. See issue #695.
|
|
146
210
|
let fallbackUrl: string | undefined;
|
|
147
211
|
const deferred = yield* Deferred.make<string>();
|
|
212
|
+
// Done when the first URL of any kind appears.
|
|
213
|
+
const anyUrl = yield* Deferred.make<void>();
|
|
148
214
|
|
|
149
215
|
const mirror = (sink: "stdout" | "stderr") =>
|
|
150
216
|
child[sink].pipe(
|
|
151
217
|
Stream.decodeText,
|
|
152
218
|
redactor.stream,
|
|
153
|
-
Stream.tap((text) =>
|
|
154
|
-
Effect.sync(() => {
|
|
155
|
-
prefixed[sink].push(text);
|
|
156
|
-
devLog.write(text);
|
|
157
|
-
}),
|
|
158
|
-
),
|
|
219
|
+
Stream.tap((text) => Effect.sync(() => prefixed[sink].push(text))),
|
|
159
220
|
Stream.tap((text) =>
|
|
160
221
|
Effect.sync(() => {
|
|
161
222
|
if (Deferred.isDoneUnsafe(deferred)) return;
|
|
162
223
|
buffer += text;
|
|
163
224
|
const url = extractUrl(buffer);
|
|
164
225
|
if (!url) return;
|
|
226
|
+
Deferred.doneUnsafe(anyUrl, Effect.void);
|
|
165
227
|
if (isLocalUrl(url)) {
|
|
166
228
|
// The dev server's own address — resolve immediately.
|
|
167
229
|
Deferred.doneUnsafe(deferred, Effect.succeed(url));
|
|
@@ -178,17 +240,30 @@ export const DevProviderLocal = () =>
|
|
|
178
240
|
yield* mirror("stdout");
|
|
179
241
|
yield* mirror("stderr");
|
|
180
242
|
|
|
181
|
-
// Readiness: a URL appears
|
|
182
|
-
//
|
|
243
|
+
// Readiness: a localhost/IP URL appears, or 5 seconds pass and we
|
|
244
|
+
// settle with any other URL we saw (`undefined` with none). With
|
|
245
|
+
// `waitForUrl`, those 5 seconds start only once some URL appears,
|
|
246
|
+
// so the URL is required and there is no deadline: the only other
|
|
247
|
+
// way out is the process exiting, which is a failure. With `port`,
|
|
248
|
+
// readiness is the port opening instead, again with no deadline.
|
|
249
|
+
const awaitLocalUrl = Deferred.await(deferred).pipe(
|
|
250
|
+
Effect.timeoutOrElse({
|
|
251
|
+
duration: "5 seconds",
|
|
252
|
+
orElse: () => Effect.succeed(fallbackUrl),
|
|
253
|
+
}),
|
|
254
|
+
);
|
|
183
255
|
const url = yield* Effect.raceAllFirst([
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
256
|
+
port !== undefined
|
|
257
|
+
? isListening(port).pipe(
|
|
258
|
+
Effect.repeat({
|
|
259
|
+
schedule: Schedule.spaced("100 millis"),
|
|
260
|
+
until: (listening) => listening,
|
|
261
|
+
}),
|
|
262
|
+
Effect.as(`http://localhost:${port}`),
|
|
263
|
+
)
|
|
264
|
+
: props.waitForUrl
|
|
265
|
+
? Deferred.await(anyUrl).pipe(Effect.andThen(awaitLocalUrl))
|
|
266
|
+
: awaitLocalUrl,
|
|
192
267
|
child.exitCode.pipe(
|
|
193
268
|
Effect.mapError((error) => makeCommandError(props, error.reason)),
|
|
194
269
|
Effect.flatMap((exitCode) =>
|
|
@@ -245,3 +320,21 @@ export const extractUrl = (text: string) => {
|
|
|
245
320
|
};
|
|
246
321
|
|
|
247
322
|
const isLocalUrl = (url: string) => LOCAL_URL_REGEX.test(url);
|
|
323
|
+
|
|
324
|
+
// Whether a TCP connection to `port` succeeds on either loopback address:
|
|
325
|
+
// a server bound to `localhost` may listen on only one of them.
|
|
326
|
+
const isListening = (port: number) =>
|
|
327
|
+
Effect.all([connects("127.0.0.1", port), connects("::1", port)], {
|
|
328
|
+
concurrency: "unbounded",
|
|
329
|
+
}).pipe(Effect.map(([ipv4, ipv6]) => ipv4 || ipv6));
|
|
330
|
+
|
|
331
|
+
const connects = (host: string, port: number) =>
|
|
332
|
+
Effect.callback<boolean>((resume) => {
|
|
333
|
+
const socket = NodeNet.connect({ host, port });
|
|
334
|
+
socket.once("connect", () => {
|
|
335
|
+
socket.destroy();
|
|
336
|
+
resume(Effect.succeed(true));
|
|
337
|
+
});
|
|
338
|
+
socket.once("error", () => resume(Effect.succeed(false)));
|
|
339
|
+
return Effect.sync(() => socket.destroy());
|
|
340
|
+
});
|
package/src/Command/Memo.ts
CHANGED