effect-start 0.28.0 → 0.30.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -1
- package/dist/Cookies.d.ts +9 -41
- package/dist/Cookies.d.ts.map +1 -1
- package/dist/Cookies.js +2 -2
- package/dist/Cookies.js.map +1 -1
- package/dist/Development.d.ts +7 -21
- package/dist/Development.d.ts.map +1 -1
- package/dist/Development.js +6 -8
- package/dist/Development.js.map +1 -1
- package/dist/Entity.d.ts +5 -6
- package/dist/Entity.d.ts.map +1 -1
- package/dist/Entity.js +10 -7
- package/dist/Entity.js.map +1 -1
- package/dist/Fetch.d.ts +15 -4
- package/dist/Fetch.d.ts.map +1 -1
- package/dist/Fetch.js +74 -1
- package/dist/Fetch.js.map +1 -1
- package/dist/FileRouter.d.ts +4 -7
- package/dist/FileRouter.d.ts.map +1 -1
- package/dist/FileRouter.js +38 -29
- package/dist/FileRouter.js.map +1 -1
- package/dist/FileRouterCodegen.d.ts +2 -2
- package/dist/FileRouterCodegen.d.ts.map +1 -1
- package/dist/FileRouterCodegen.js +9 -21
- package/dist/FileRouterCodegen.js.map +1 -1
- package/dist/FileSystem.d.ts +39 -39
- package/dist/FileSystem.d.ts.map +1 -1
- package/dist/FileSystem.js +5 -3
- package/dist/FileSystem.js.map +1 -1
- package/dist/GlobalLayer.d.ts +2 -2
- package/dist/GlobalLayer.d.ts.map +1 -1
- package/dist/GlobalLayer.js +2 -2
- package/dist/GlobalLayer.js.map +1 -1
- package/dist/Html.d.ts +32 -0
- package/dist/Html.d.ts.map +1 -0
- package/dist/{hyper/HyperHtml.js → Html.js} +45 -26
- package/dist/Html.js.map +1 -0
- package/dist/PlatformRuntime.d.ts.map +1 -1
- package/dist/PlatformRuntime.js.map +1 -1
- package/dist/Route.d.ts +22 -9
- package/dist/Route.d.ts.map +1 -1
- package/dist/Route.js +25 -4
- package/dist/Route.js.map +1 -1
- package/dist/RouteBody.d.ts +14 -7
- package/dist/RouteBody.d.ts.map +1 -1
- package/dist/RouteBody.js +38 -27
- package/dist/RouteBody.js.map +1 -1
- package/dist/RouteError.js.map +1 -1
- package/dist/RouteHook.d.ts.map +1 -1
- package/dist/RouteHook.js.map +1 -1
- package/dist/RouteHttp.d.ts +1 -1
- package/dist/RouteHttp.d.ts.map +1 -1
- package/dist/RouteHttp.js +56 -32
- package/dist/RouteHttp.js.map +1 -1
- package/dist/RouteHttpTracer.d.ts.map +1 -1
- package/dist/RouteHttpTracer.js.map +1 -1
- package/dist/RouteMount.d.ts +2 -2
- package/dist/RouteMount.d.ts.map +1 -1
- package/dist/RouteMount.js +2 -2
- package/dist/RouteMount.js.map +1 -1
- package/dist/RouteSchema.d.ts +2 -2
- package/dist/RouteSchema.d.ts.map +1 -1
- package/dist/RouteSchema.js +2 -2
- package/dist/RouteSchema.js.map +1 -1
- package/dist/RouteSse.d.ts +9 -10
- package/dist/RouteSse.d.ts.map +1 -1
- package/dist/RouteSse.js +8 -12
- package/dist/RouteSse.js.map +1 -1
- package/dist/RouteTree.d.ts +2 -2
- package/dist/RouteTree.d.ts.map +1 -1
- package/dist/RouteTree.js +2 -2
- package/dist/RouteTree.js.map +1 -1
- package/dist/RouteTrie.js +1 -1
- package/dist/RouteTrie.js.map +1 -1
- package/dist/Socket.d.ts +13 -18
- package/dist/Socket.d.ts.map +1 -1
- package/dist/Socket.js +12 -13
- package/dist/Socket.js.map +1 -1
- package/dist/Start.d.ts +15 -23
- package/dist/Start.d.ts.map +1 -1
- package/dist/Start.js +17 -6
- package/dist/Start.js.map +1 -1
- package/dist/System.d.ts +20 -5
- package/dist/System.d.ts.map +1 -1
- package/dist/System.js +12 -42
- package/dist/System.js.map +1 -1
- package/dist/Unique.d.ts.map +1 -1
- package/dist/Unique.js.map +1 -1
- package/dist/{ChildProcess.d.ts → _ChildProcess.d.ts} +14 -15
- package/dist/_ChildProcess.d.ts.map +1 -0
- package/dist/{ChildProcess.js → _ChildProcess.js} +2 -2
- package/dist/_ChildProcess.js.map +1 -0
- package/dist/{ContentNegotiation.d.ts → _ContentNegotiation.d.ts} +1 -1
- package/dist/_ContentNegotiation.d.ts.map +1 -0
- package/dist/{ContentNegotiation.js → _ContentNegotiation.js} +1 -1
- package/dist/_ContentNegotiation.js.map +1 -0
- package/dist/{Docker.d.ts → _Docker.d.ts} +2 -2
- package/dist/_Docker.d.ts.map +1 -0
- package/dist/{Docker.js → _Docker.js} +1 -1
- package/dist/_Docker.js.map +1 -0
- package/dist/{Effectify.d.ts → _Effectify.d.ts} +1 -1
- package/dist/_Effectify.d.ts.map +1 -0
- package/dist/{Effectify.js → _Effectify.js} +1 -1
- package/dist/_Effectify.js.map +1 -0
- package/dist/{Http.d.ts → _Http.d.ts} +1 -8
- package/dist/_Http.d.ts.map +1 -0
- package/dist/{Http.js → _Http.js} +1 -17
- package/dist/_Http.js.map +1 -0
- package/dist/{PathPattern.d.ts → _PathPattern.d.ts} +12 -1
- package/dist/_PathPattern.d.ts.map +1 -0
- package/dist/{PathPattern.js → _PathPattern.js} +86 -1
- package/dist/_PathPattern.js.map +1 -0
- package/dist/_SchemaExtra.d.ts +4 -0
- package/dist/_SchemaExtra.d.ts.map +1 -0
- package/dist/{SchemaExtra.js → _SchemaExtra.js} +4 -4
- package/dist/_SchemaExtra.js.map +1 -0
- package/dist/{StartApp.d.ts → _StartApp.d.ts} +1 -1
- package/dist/_StartApp.d.ts.map +1 -0
- package/dist/{StartApp.js → _StartApp.js} +1 -1
- package/dist/_StartApp.js.map +1 -0
- package/dist/{StreamExtra.d.ts → _StreamExtra.d.ts} +5 -5
- package/dist/_StreamExtra.d.ts.map +1 -0
- package/dist/{StreamExtra.js → _StreamExtra.js} +1 -1
- package/dist/_StreamExtra.js.map +1 -0
- package/dist/{Values.d.ts → _Values.d.ts} +3 -3
- package/dist/_Values.d.ts.map +1 -0
- package/dist/{Values.js → _Values.js} +1 -1
- package/dist/_Values.js.map +1 -0
- package/dist/bun/BunBundle.d.ts +2 -2
- package/dist/bun/BunBundle.d.ts.map +1 -1
- package/dist/bun/BunBundle.js.map +1 -1
- package/dist/bun/BunChildProcessSpawner.d.ts +1 -1
- package/dist/bun/BunChildProcessSpawner.d.ts.map +1 -1
- package/dist/bun/BunChildProcessSpawner.js +9 -9
- package/dist/bun/BunChildProcessSpawner.js.map +1 -1
- package/dist/bun/BunImportTrackerPlugin.d.ts +2 -2
- package/dist/bun/BunImportTrackerPlugin.d.ts.map +1 -1
- package/dist/bun/BunImportTrackerPlugin.js.map +1 -1
- package/dist/bun/BunRoute.d.ts +2 -2
- package/dist/bun/BunRoute.d.ts.map +1 -1
- package/dist/bun/BunRoute.js +108 -40
- package/dist/bun/BunRoute.js.map +1 -1
- package/dist/bun/BunRuntime.js.map +1 -1
- package/dist/bun/BunServer.d.ts +5 -5
- package/dist/bun/BunServer.d.ts.map +1 -1
- package/dist/bun/BunServer.js +3 -3
- package/dist/bun/BunServer.js.map +1 -1
- package/dist/bun/BunVirtualFilesPlugin.js.map +1 -1
- package/dist/bun/_BunEnhancedResolve.d.ts.map +1 -1
- package/dist/bun/_BunEnhancedResolve.js.map +1 -1
- package/dist/bun/_empty.html +0 -0
- package/dist/bundler/Bundle.d.ts +2 -2
- package/dist/bundler/Bundle.d.ts.map +1 -1
- package/dist/bundler/Bundle.js.map +1 -1
- package/dist/bundler/BundleFiles.d.ts +1 -1
- package/dist/bundler/BundleFiles.d.ts.map +1 -1
- package/dist/bundler/BundleFiles.js.map +1 -1
- package/dist/bundler/BundleRoute.d.ts +6 -5
- package/dist/bundler/BundleRoute.d.ts.map +1 -1
- package/dist/bundler/BundleRoute.js +2 -2
- package/dist/bundler/BundleRoute.js.map +1 -1
- package/dist/cli/Argument.d.ts +26 -0
- package/dist/cli/Argument.d.ts.map +1 -0
- package/dist/cli/Argument.js +31 -0
- package/dist/cli/Argument.js.map +1 -0
- package/dist/cli/CliError.d.ts +15 -0
- package/dist/cli/CliError.d.ts.map +1 -0
- package/dist/cli/CliError.js +54 -0
- package/dist/cli/CliError.js.map +1 -0
- package/dist/cli/Command.d.ts +61 -0
- package/dist/cli/Command.d.ts.map +1 -0
- package/dist/cli/Command.js +453 -0
- package/dist/cli/Command.js.map +1 -0
- package/dist/cli/Flag.d.ts +32 -0
- package/dist/cli/Flag.d.ts.map +1 -0
- package/dist/cli/Flag.js +35 -0
- package/dist/cli/Flag.js.map +1 -0
- package/dist/cli/HelpDoc.d.ts +28 -0
- package/dist/cli/HelpDoc.d.ts.map +1 -0
- package/dist/cli/HelpDoc.js +40 -0
- package/dist/cli/HelpDoc.js.map +1 -0
- package/dist/cli/Param.d.ts +71 -0
- package/dist/cli/Param.d.ts.map +1 -0
- package/dist/cli/Param.js +236 -0
- package/dist/cli/Param.js.map +1 -0
- package/dist/cli/Primitive.d.ts +22 -0
- package/dist/cli/Primitive.d.ts.map +1 -0
- package/dist/cli/Primitive.js +73 -0
- package/dist/cli/Primitive.js.map +1 -0
- package/dist/cli/index.d.ts +8 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +8 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/client/Overlay.js.map +1 -1
- package/dist/client/ScrollState.js.map +1 -1
- package/dist/client/index.js.map +1 -1
- package/dist/cloudflare/CloudflareTunnel.d.ts +12 -0
- package/dist/cloudflare/CloudflareTunnel.d.ts.map +1 -0
- package/dist/{x/cloudflare → cloudflare}/CloudflareTunnel.js +1 -1
- package/dist/cloudflare/CloudflareTunnel.js.map +1 -0
- package/dist/cloudflare/index.d.ts.map +1 -0
- package/dist/cloudflare/index.js.map +1 -0
- package/dist/datastar/actions/fetch.js.map +1 -1
- package/dist/datastar/actions/peek.js.map +1 -1
- package/dist/datastar/actions/setAll.js.map +1 -1
- package/dist/datastar/actions/toggleAll.js.map +1 -1
- package/dist/datastar/attributes/attr.js.map +1 -1
- package/dist/datastar/attributes/bind.js.map +1 -1
- package/dist/datastar/attributes/class.js.map +1 -1
- package/dist/datastar/attributes/computed.js.map +1 -1
- package/dist/datastar/attributes/indicator.js.map +1 -1
- package/dist/datastar/attributes/init.js.map +1 -1
- package/dist/datastar/attributes/jsonSignals.js.map +1 -1
- package/dist/datastar/attributes/on.js.map +1 -1
- package/dist/datastar/attributes/onIntersect.js.map +1 -1
- package/dist/datastar/attributes/onInterval.js.map +1 -1
- package/dist/datastar/attributes/onSignalPatch.js.map +1 -1
- package/dist/datastar/attributes/ref.js.map +1 -1
- package/dist/datastar/attributes/show.js.map +1 -1
- package/dist/datastar/attributes/signals.js.map +1 -1
- package/dist/datastar/attributes/style.js.map +1 -1
- package/dist/datastar/attributes/text.js.map +1 -1
- package/dist/datastar/engine.d.ts +5 -5
- package/dist/datastar/engine.d.ts.map +1 -1
- package/dist/datastar/engine.js.map +1 -1
- package/dist/datastar/utils.d.ts +1 -1
- package/dist/datastar/utils.d.ts.map +1 -1
- package/dist/datastar/utils.js.map +1 -1
- package/dist/datastar/watchers/patchElements.js +3 -1
- package/dist/datastar/watchers/patchElements.js.map +1 -1
- package/dist/datastar/watchers/patchSignals.js.map +1 -1
- package/dist/experimental/EncryptedCookies.d.ts +4 -4
- package/dist/experimental/EncryptedCookies.d.ts.map +1 -1
- package/dist/experimental/EncryptedCookies.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -1
- package/dist/jsx-runtime.d.ts +8 -0
- package/dist/jsx-runtime.d.ts.map +1 -0
- package/dist/{hyper/jsx-runtime.js → jsx-runtime.js} +2 -2
- package/dist/jsx-runtime.js.map +1 -0
- package/dist/lint/plugin.d.ts +18 -15
- package/dist/lint/plugin.d.ts.map +1 -1
- package/dist/lint/plugin.js +76 -80
- package/dist/lint/plugin.js.map +1 -1
- package/dist/node/NodeFileSystem.d.ts +3 -3
- package/dist/node/NodeFileSystem.d.ts.map +1 -1
- package/dist/node/NodeFileSystem.js +8 -7
- package/dist/node/NodeFileSystem.js.map +1 -1
- package/dist/node/NodeUtils.d.ts.map +1 -1
- package/dist/node/NodeUtils.js.map +1 -1
- package/dist/sql/SqlCache.d.ts +1 -0
- package/dist/sql/SqlCache.d.ts.map +1 -1
- package/dist/sql/SqlCache.js +5 -1
- package/dist/sql/SqlCache.js.map +1 -1
- package/dist/sql/SqlClient.js +1 -1
- package/dist/sql/SqlClient.js.map +1 -1
- package/dist/{SqlIntrospect.d.ts → sql/SqlIntrospect.d.ts} +3 -3
- package/dist/sql/SqlIntrospect.d.ts.map +1 -0
- package/dist/{SqlIntrospect.js → sql/SqlIntrospect.js} +1 -1
- package/dist/sql/SqlIntrospect.js.map +1 -0
- package/dist/sql/bun/index.d.ts +3 -3
- package/dist/sql/bun/index.d.ts.map +1 -1
- package/dist/sql/bun/index.js +1 -1
- package/dist/sql/bun/index.js.map +1 -1
- package/dist/sql/index.d.ts +1 -0
- package/dist/sql/index.d.ts.map +1 -1
- package/dist/sql/index.js +1 -0
- package/dist/sql/index.js.map +1 -1
- package/dist/sql/libsql/index.d.ts +1 -1
- package/dist/sql/libsql/index.d.ts.map +1 -1
- package/dist/sql/libsql/index.js +2 -2
- package/dist/sql/libsql/index.js.map +1 -1
- package/dist/sql/mssql/index.d.ts +3 -3
- package/dist/sql/mssql/index.d.ts.map +1 -1
- package/dist/sql/mssql/index.js +1 -1
- package/dist/sql/mssql/index.js.map +1 -1
- package/dist/sql/postgres/index.d.ts +1 -1
- package/dist/sql/postgres/index.d.ts.map +1 -1
- package/dist/sql/postgres/index.js.map +1 -1
- package/dist/studio/Simulation.d.ts.map +1 -0
- package/dist/studio/Simulation.js.map +1 -0
- package/dist/{tower/Tower.d.ts → studio/Studio.d.ts} +4 -4
- package/dist/studio/Studio.d.ts.map +1 -0
- package/dist/studio/Studio.js +30 -0
- package/dist/studio/Studio.js.map +1 -0
- package/dist/studio/StudioErrors.d.ts +4 -0
- package/dist/studio/StudioErrors.d.ts.map +1 -0
- package/dist/{tower/TowerErrors.js → studio/StudioErrors.js} +6 -6
- package/dist/studio/StudioErrors.js.map +1 -0
- package/dist/{tower/TowerLogger.d.ts → studio/StudioLogger.d.ts} +1 -1
- package/dist/studio/StudioLogger.d.ts.map +1 -0
- package/dist/{tower/TowerLogger.js → studio/StudioLogger.js} +7 -7
- package/dist/studio/StudioLogger.js.map +1 -0
- package/dist/studio/StudioMetrics.d.ts +4 -0
- package/dist/studio/StudioMetrics.d.ts.map +1 -0
- package/dist/{tower/TowerMetrics.js → studio/StudioMetrics.js} +3 -3
- package/dist/studio/StudioMetrics.js.map +1 -0
- package/dist/studio/StudioProcess.d.ts +4 -0
- package/dist/studio/StudioProcess.d.ts.map +1 -0
- package/dist/{tower/TowerProcess.js → studio/StudioProcess.js} +3 -3
- package/dist/studio/StudioProcess.js.map +1 -0
- package/dist/{tower/TowerStore.d.ts → studio/StudioStore.d.ts} +33 -33
- package/dist/studio/StudioStore.d.ts.map +1 -0
- package/dist/{tower/TowerStore.js → studio/StudioStore.js} +5 -5
- package/dist/studio/StudioStore.js.map +1 -0
- package/dist/studio/StudioTracer.d.ts +4 -0
- package/dist/studio/StudioTracer.d.ts.map +1 -0
- package/dist/{tower/TowerTracer.js → studio/StudioTracer.js} +21 -21
- package/dist/studio/StudioTracer.js.map +1 -0
- package/dist/studio/index.d.ts +4 -0
- package/dist/studio/index.d.ts.map +1 -0
- package/dist/studio/index.js +4 -0
- package/dist/studio/index.js.map +1 -0
- package/dist/{tower/routes/logs → studio/routes/errors}/route.d.ts +1 -1
- package/dist/{tower/routes/metrics → studio/routes/errors}/route.d.ts.map +1 -1
- package/dist/studio/routes/errors/route.js +42 -0
- package/dist/studio/routes/errors/route.js.map +1 -0
- package/dist/{tower → studio}/routes/fiberDetail.d.ts +1 -1
- package/dist/studio/routes/fiberDetail.d.ts.map +1 -0
- package/dist/{tower → studio}/routes/fiberDetail.js +8 -9
- package/dist/studio/routes/fiberDetail.js.map +1 -0
- package/dist/{tower/routes/traces → studio/routes/fibers}/route.d.ts +1 -1
- package/dist/studio/routes/fibers/route.d.ts.map +1 -0
- package/dist/studio/routes/fibers/route.js +24 -0
- package/dist/studio/routes/fibers/route.js.map +1 -0
- package/dist/studio/routes/layout.d.ts.map +1 -0
- package/{src/tower → dist/studio}/routes/layout.html +1 -1
- package/dist/studio/routes/layout.js.map +1 -0
- package/dist/{tower/routes/errors → studio/routes/logs}/route.d.ts +1 -1
- package/dist/studio/routes/logs/route.d.ts.map +1 -0
- package/dist/studio/routes/logs/route.js +29 -0
- package/dist/studio/routes/logs/route.js.map +1 -0
- package/dist/{tower → studio}/routes/metrics/route.d.ts +1 -1
- package/dist/studio/routes/metrics/route.d.ts.map +1 -0
- package/dist/studio/routes/metrics/route.js +17 -0
- package/dist/studio/routes/metrics/route.js.map +1 -0
- package/dist/{tower → studio}/routes/route.d.ts +2 -2
- package/dist/studio/routes/route.d.ts.map +1 -0
- package/dist/studio/routes/route.js +6 -0
- package/dist/studio/routes/route.js.map +1 -0
- package/dist/{tower → studio}/routes/routes/route.d.ts +1 -1
- package/dist/studio/routes/routes/route.d.ts.map +1 -0
- package/dist/{tower → studio}/routes/routes/route.js +3 -6
- package/dist/studio/routes/routes/route.js.map +1 -0
- package/dist/{tower → studio}/routes/services/route.d.ts +1 -1
- package/dist/studio/routes/services/route.d.ts.map +1 -0
- package/dist/studio/routes/services/route.js +12 -0
- package/dist/studio/routes/services/route.js.map +1 -0
- package/dist/{tower → studio}/routes/system/route.d.ts +1 -1
- package/dist/studio/routes/system/route.d.ts.map +1 -0
- package/dist/studio/routes/system/route.js +18 -0
- package/dist/studio/routes/system/route.js.map +1 -0
- package/dist/{tower → studio}/routes/traceDetail.d.ts +1 -1
- package/dist/studio/routes/traceDetail.d.ts.map +1 -0
- package/dist/studio/routes/traceDetail.js +19 -0
- package/dist/studio/routes/traceDetail.js.map +1 -0
- package/dist/{tower/routes/fibers → studio/routes/traces}/route.d.ts +1 -1
- package/dist/studio/routes/traces/route.d.ts.map +1 -0
- package/dist/studio/routes/traces/route.js +29 -0
- package/dist/studio/routes/traces/route.js.map +1 -0
- package/dist/{tower → studio}/routes/tree.d.ts +47 -47
- package/dist/studio/routes/tree.d.ts.map +1 -0
- package/dist/studio/routes/tree.js.map +1 -0
- package/dist/studio/ui/Errors.d.ts +5 -0
- package/dist/studio/ui/Errors.d.ts.map +1 -0
- package/dist/studio/ui/Errors.js +17 -0
- package/dist/studio/ui/Errors.js.map +1 -0
- package/dist/{tower → studio}/ui/Fibers.d.ts +7 -7
- package/dist/studio/ui/Fibers.d.ts.map +1 -0
- package/dist/studio/ui/Fibers.js +134 -0
- package/dist/studio/ui/Fibers.js.map +1 -0
- package/dist/studio/ui/Logs.d.ts +5 -0
- package/dist/studio/ui/Logs.d.ts.map +1 -0
- package/dist/{tower → studio}/ui/Logs.js +2 -3
- package/dist/studio/ui/Logs.js.map +1 -0
- package/dist/studio/ui/Metrics.d.ts +5 -0
- package/dist/studio/ui/Metrics.d.ts.map +1 -0
- package/dist/{tower → studio}/ui/Metrics.js +4 -11
- package/dist/studio/ui/Metrics.js.map +1 -0
- package/dist/{tower → studio}/ui/Routes.d.ts +1 -1
- package/dist/studio/ui/Routes.d.ts.map +1 -0
- package/dist/{tower → studio}/ui/Routes.js +4 -12
- package/dist/studio/ui/Routes.js.map +1 -0
- package/dist/{tower → studio}/ui/Services.d.ts +1 -1
- package/dist/studio/ui/Services.d.ts.map +1 -0
- package/dist/{tower → studio}/ui/Services.js +2 -9
- package/dist/studio/ui/Services.js.map +1 -0
- package/dist/{tower → studio}/ui/Shell.d.ts +2 -2
- package/dist/studio/ui/Shell.d.ts.map +1 -0
- package/dist/studio/ui/Shell.js +8 -0
- package/dist/studio/ui/Shell.js.map +1 -0
- package/dist/studio/ui/System.d.ts +5 -0
- package/dist/studio/ui/System.d.ts.map +1 -0
- package/dist/studio/ui/System.js +36 -0
- package/dist/studio/ui/System.js.map +1 -0
- package/dist/studio/ui/Traces.d.ts +13 -0
- package/dist/studio/ui/Traces.d.ts.map +1 -0
- package/dist/studio/ui/Traces.js +182 -0
- package/dist/studio/ui/Traces.js.map +1 -0
- package/dist/tailscale/TailscaleTunnel.d.ts +16 -0
- package/dist/tailscale/TailscaleTunnel.d.ts.map +1 -0
- package/dist/{x/tailscale → tailscale}/TailscaleTunnel.js +4 -5
- package/dist/tailscale/TailscaleTunnel.js.map +1 -0
- package/dist/tailscale/index.d.ts.map +1 -0
- package/dist/tailscale/index.js.map +1 -0
- package/dist/{x/tailwind → tailwind}/TailwindPlugin.d.ts +5 -5
- package/dist/tailwind/TailwindPlugin.d.ts.map +1 -0
- package/dist/tailwind/TailwindPlugin.js.map +1 -0
- package/dist/tailwind/compile.d.ts.map +1 -0
- package/dist/{x/tailwind → tailwind}/compile.js +1 -1
- package/dist/tailwind/compile.js.map +1 -0
- package/dist/tailwind/index.d.ts +3 -0
- package/dist/tailwind/index.d.ts.map +1 -0
- package/dist/tailwind/index.js +3 -0
- package/dist/tailwind/index.js.map +1 -0
- package/dist/tailwind/plugin.d.ts.map +1 -0
- package/dist/{x/tailwind → tailwind}/plugin.js +1 -1
- package/dist/{x/tailwind → tailwind}/plugin.js.map +1 -1
- package/dist/testing/TestLogger.js.map +1 -1
- package/dist/testing/utils.d.ts +3 -1
- package/dist/testing/utils.d.ts.map +1 -1
- package/dist/testing/utils.js +39 -0
- package/dist/testing/utils.js.map +1 -1
- package/package.json +53 -71
- package/src/Cookies.ts +4 -8
- package/src/Development.ts +21 -21
- package/src/Entity.ts +24 -19
- package/src/Fetch.ts +101 -5
- package/src/FileRouter.ts +45 -48
- package/src/FileRouterCodegen.ts +9 -23
- package/src/FileSystem.ts +43 -63
- package/src/GlobalLayer.ts +4 -2
- package/src/{hyper/HyperHtml.ts → Html.ts} +90 -30
- package/src/Route.ts +69 -13
- package/src/RouteBody.ts +88 -63
- package/src/RouteHttp.ts +152 -114
- package/src/RouteMount.ts +4 -4
- package/src/RouteSchema.ts +2 -2
- package/src/RouteSse.ts +28 -37
- package/src/RouteTree.ts +2 -2
- package/src/RouteTrie.ts +1 -1
- package/src/Socket.ts +17 -27
- package/src/Start.ts +39 -47
- package/src/System.ts +41 -65
- package/src/{ChildProcess.ts → _ChildProcess.ts} +14 -23
- package/src/{Docker.ts → _Docker.ts} +1 -1
- package/src/{Http.ts → _Http.ts} +0 -28
- package/src/{PathPattern.ts → _PathPattern.ts} +105 -0
- package/src/{SchemaExtra.ts → _SchemaExtra.ts} +3 -4
- package/src/bun/BunChildProcessSpawner.ts +9 -9
- package/src/bun/BunRoute.ts +130 -45
- package/src/bun/BunServer.ts +4 -3
- package/src/bundler/BundleRoute.ts +2 -2
- package/src/cli/Argument.ts +45 -0
- package/src/cli/CliError.ts +68 -0
- package/src/cli/Command.ts +685 -0
- package/src/cli/Flag.ts +63 -0
- package/src/cli/HelpDoc.ts +67 -0
- package/src/cli/Param.ts +418 -0
- package/src/cli/Primitive.ts +94 -0
- package/src/cli/index.ts +7 -0
- package/src/{x/cloudflare → cloudflare}/CloudflareTunnel.ts +1 -1
- package/src/datastar/watchers/patchElements.ts +4 -2
- package/src/index.ts +2 -0
- package/src/jsx-runtime.ts +15 -0
- package/src/{hyper/jsx.d.ts → jsx.d.ts} +3 -3
- package/src/lint/plugin.js +86 -97
- package/src/node/NodeFileSystem.ts +15 -14
- package/src/sql/SqlCache.ts +14 -1
- package/src/sql/SqlClient.ts +1 -1
- package/src/{SqlIntrospect.ts → sql/SqlIntrospect.ts} +1 -1
- package/src/sql/bun/index.ts +1 -1
- package/src/sql/index.ts +1 -0
- package/src/sql/libsql/index.ts +1 -1
- package/src/sql/mssql/index.ts +1 -1
- package/src/studio/Studio.ts +47 -0
- package/src/{tower/TowerErrors.ts → studio/StudioErrors.ts} +13 -13
- package/src/{tower/TowerLogger.ts → studio/StudioLogger.ts} +10 -10
- package/src/{tower/TowerMetrics.ts → studio/StudioMetrics.ts} +5 -5
- package/src/{tower/TowerProcess.ts → studio/StudioProcess.ts} +4 -4
- package/src/{tower/TowerStore.ts → studio/StudioStore.ts} +37 -37
- package/src/{tower/TowerTracer.ts → studio/StudioTracer.ts} +25 -25
- package/src/studio/index.ts +3 -0
- package/src/{tower → studio}/routes/errors/route.tsx +7 -8
- package/src/{tower → studio}/routes/fiberDetail.tsx +9 -10
- package/src/{tower → studio}/routes/fibers/route.tsx +13 -14
- package/src/studio/routes/layout.html +340 -0
- package/src/{tower → studio}/routes/logs/route.tsx +7 -8
- package/src/{tower → studio}/routes/metrics/route.tsx +8 -9
- package/src/studio/routes/route.tsx +8 -0
- package/src/{tower → studio}/routes/routes/route.tsx +3 -4
- package/src/{tower → studio}/routes/services/route.tsx +3 -4
- package/src/{tower → studio}/routes/system/route.tsx +8 -9
- package/src/{tower → studio}/routes/traceDetail.tsx +6 -7
- package/src/{tower → studio}/routes/traces/route.tsx +8 -9
- package/src/{tower → studio}/ui/Errors.tsx +3 -3
- package/src/{tower → studio}/ui/Fibers.tsx +7 -7
- package/src/{tower → studio}/ui/Logs.tsx +3 -3
- package/src/{tower → studio}/ui/Metrics.tsx +4 -4
- package/src/{tower → studio}/ui/Shell.tsx +1 -1
- package/src/{tower → studio}/ui/System.tsx +2 -2
- package/src/{tower → studio}/ui/Traces.tsx +16 -16
- package/src/{x/tailscale → tailscale}/TailscaleTunnel.ts +4 -5
- package/src/{x/tailwind → tailwind}/compile.ts +1 -1
- package/src/tailwind/index.ts +2 -0
- package/src/{x/tailwind → tailwind}/plugin.ts +1 -1
- package/src/testing/utils.ts +59 -0
- package/dist/ChildProcess.d.ts.map +0 -1
- package/dist/ChildProcess.js.map +0 -1
- package/dist/Commander.d.ts +0 -101
- package/dist/Commander.d.ts.map +0 -1
- package/dist/Commander.js +0 -327
- package/dist/Commander.js.map +0 -1
- package/dist/ContentNegotiation.d.ts.map +0 -1
- package/dist/ContentNegotiation.js.map +0 -1
- package/dist/Docker.d.ts.map +0 -1
- package/dist/Docker.js.map +0 -1
- package/dist/Effectify.d.ts.map +0 -1
- package/dist/Effectify.js.map +0 -1
- package/dist/FilePathPattern.d.ts +0 -30
- package/dist/FilePathPattern.d.ts.map +0 -1
- package/dist/FilePathPattern.js +0 -87
- package/dist/FilePathPattern.js.map +0 -1
- package/dist/Http.d.ts.map +0 -1
- package/dist/Http.js.map +0 -1
- package/dist/PathPattern.d.ts.map +0 -1
- package/dist/PathPattern.js.map +0 -1
- package/dist/PlatformError.d.ts +0 -39
- package/dist/PlatformError.d.ts.map +0 -1
- package/dist/PlatformError.js +0 -26
- package/dist/PlatformError.js.map +0 -1
- package/dist/SchemaExtra.d.ts +0 -8
- package/dist/SchemaExtra.d.ts.map +0 -1
- package/dist/SchemaExtra.js.map +0 -1
- package/dist/SqlIntrospect.d.ts.map +0 -1
- package/dist/SqlIntrospect.js.map +0 -1
- package/dist/StartApp.d.ts.map +0 -1
- package/dist/StartApp.js.map +0 -1
- package/dist/StreamExtra.d.ts.map +0 -1
- package/dist/StreamExtra.js.map +0 -1
- package/dist/TuplePathPattern.d.ts +0 -10
- package/dist/TuplePathPattern.d.ts.map +0 -1
- package/dist/TuplePathPattern.js +0 -69
- package/dist/TuplePathPattern.js.map +0 -1
- package/dist/Values.d.ts.map +0 -1
- package/dist/Values.js.map +0 -1
- package/dist/hyper/Hyper.d.ts +0 -26
- package/dist/hyper/Hyper.d.ts.map +0 -1
- package/dist/hyper/Hyper.js +0 -24
- package/dist/hyper/Hyper.js.map +0 -1
- package/dist/hyper/HyperHtml.d.ts +0 -24
- package/dist/hyper/HyperHtml.d.ts.map +0 -1
- package/dist/hyper/HyperHtml.js.map +0 -1
- package/dist/hyper/HyperHtml.test.d.ts +0 -2
- package/dist/hyper/HyperHtml.test.d.ts.map +0 -1
- package/dist/hyper/HyperHtml.test.js +0 -283
- package/dist/hyper/HyperHtml.test.js.map +0 -1
- package/dist/hyper/HyperNode.d.ts +0 -15
- package/dist/hyper/HyperNode.d.ts.map +0 -1
- package/dist/hyper/HyperNode.js +0 -12
- package/dist/hyper/HyperNode.js.map +0 -1
- package/dist/hyper/HyperRoute.d.ts +0 -9
- package/dist/hyper/HyperRoute.d.ts.map +0 -1
- package/dist/hyper/HyperRoute.js +0 -33
- package/dist/hyper/HyperRoute.js.map +0 -1
- package/dist/hyper/HyperRoute.test.d.ts +0 -2
- package/dist/hyper/HyperRoute.test.d.ts.map +0 -1
- package/dist/hyper/HyperRoute.test.js +0 -86
- package/dist/hyper/HyperRoute.test.js.map +0 -1
- package/dist/hyper/html.d.ts +0 -11
- package/dist/hyper/html.d.ts.map +0 -1
- package/dist/hyper/html.js +0 -31
- package/dist/hyper/html.js.map +0 -1
- package/dist/hyper/index.d.ts +0 -7
- package/dist/hyper/index.d.ts.map +0 -1
- package/dist/hyper/index.js +0 -6
- package/dist/hyper/index.js.map +0 -1
- package/dist/hyper/jsx-runtime.d.ts +0 -8
- package/dist/hyper/jsx-runtime.d.ts.map +0 -1
- package/dist/hyper/jsx-runtime.js.map +0 -1
- package/dist/tower/Simulation.d.ts.map +0 -1
- package/dist/tower/Simulation.js.map +0 -1
- package/dist/tower/Tower.d.ts.map +0 -1
- package/dist/tower/Tower.js +0 -30
- package/dist/tower/Tower.js.map +0 -1
- package/dist/tower/TowerErrors.d.ts +0 -4
- package/dist/tower/TowerErrors.d.ts.map +0 -1
- package/dist/tower/TowerErrors.js.map +0 -1
- package/dist/tower/TowerLogger.d.ts.map +0 -1
- package/dist/tower/TowerLogger.js.map +0 -1
- package/dist/tower/TowerMetrics.d.ts +0 -4
- package/dist/tower/TowerMetrics.d.ts.map +0 -1
- package/dist/tower/TowerMetrics.js.map +0 -1
- package/dist/tower/TowerProcess.d.ts +0 -4
- package/dist/tower/TowerProcess.d.ts.map +0 -1
- package/dist/tower/TowerProcess.js.map +0 -1
- package/dist/tower/TowerStore.d.ts.map +0 -1
- package/dist/tower/TowerStore.js.map +0 -1
- package/dist/tower/TowerTracer.d.ts +0 -4
- package/dist/tower/TowerTracer.d.ts.map +0 -1
- package/dist/tower/TowerTracer.js.map +0 -1
- package/dist/tower/index.d.ts +0 -4
- package/dist/tower/index.d.ts.map +0 -1
- package/dist/tower/index.js +0 -4
- package/dist/tower/index.js.map +0 -1
- package/dist/tower/routes/errors/route.d.ts.map +0 -1
- package/dist/tower/routes/errors/route.js +0 -47
- package/dist/tower/routes/errors/route.js.map +0 -1
- package/dist/tower/routes/fiberDetail.d.ts.map +0 -1
- package/dist/tower/routes/fiberDetail.js.map +0 -1
- package/dist/tower/routes/fibers/route.d.ts.map +0 -1
- package/dist/tower/routes/fibers/route.js +0 -27
- package/dist/tower/routes/fibers/route.js.map +0 -1
- package/dist/tower/routes/layout.d.ts.map +0 -1
- package/dist/tower/routes/layout.js.map +0 -1
- package/dist/tower/routes/logs/route.d.ts.map +0 -1
- package/dist/tower/routes/logs/route.js +0 -36
- package/dist/tower/routes/logs/route.js.map +0 -1
- package/dist/tower/routes/metrics/route.js +0 -20
- package/dist/tower/routes/metrics/route.js.map +0 -1
- package/dist/tower/routes/route.d.ts.map +0 -1
- package/dist/tower/routes/route.js +0 -6
- package/dist/tower/routes/route.js.map +0 -1
- package/dist/tower/routes/routes/route.d.ts.map +0 -1
- package/dist/tower/routes/routes/route.js.map +0 -1
- package/dist/tower/routes/services/route.d.ts.map +0 -1
- package/dist/tower/routes/services/route.js +0 -15
- package/dist/tower/routes/services/route.js.map +0 -1
- package/dist/tower/routes/system/route.d.ts.map +0 -1
- package/dist/tower/routes/system/route.js +0 -21
- package/dist/tower/routes/system/route.js.map +0 -1
- package/dist/tower/routes/traceDetail.d.ts.map +0 -1
- package/dist/tower/routes/traceDetail.js +0 -20
- package/dist/tower/routes/traceDetail.js.map +0 -1
- package/dist/tower/routes/traces/route.d.ts.map +0 -1
- package/dist/tower/routes/traces/route.js +0 -36
- package/dist/tower/routes/traces/route.js.map +0 -1
- package/dist/tower/routes/tree.d.ts.map +0 -1
- package/dist/tower/routes/tree.js.map +0 -1
- package/dist/tower/ui/Errors.d.ts +0 -5
- package/dist/tower/ui/Errors.d.ts.map +0 -1
- package/dist/tower/ui/Errors.js +0 -30
- package/dist/tower/ui/Errors.js.map +0 -1
- package/dist/tower/ui/Fibers.d.ts.map +0 -1
- package/dist/tower/ui/Fibers.js +0 -157
- package/dist/tower/ui/Fibers.js.map +0 -1
- package/dist/tower/ui/Logs.d.ts +0 -5
- package/dist/tower/ui/Logs.d.ts.map +0 -1
- package/dist/tower/ui/Logs.js.map +0 -1
- package/dist/tower/ui/Metrics.d.ts +0 -5
- package/dist/tower/ui/Metrics.d.ts.map +0 -1
- package/dist/tower/ui/Metrics.js.map +0 -1
- package/dist/tower/ui/Routes.d.ts.map +0 -1
- package/dist/tower/ui/Routes.js.map +0 -1
- package/dist/tower/ui/Services.d.ts.map +0 -1
- package/dist/tower/ui/Services.js.map +0 -1
- package/dist/tower/ui/Shell.d.ts.map +0 -1
- package/dist/tower/ui/Shell.js +0 -12
- package/dist/tower/ui/Shell.js.map +0 -1
- package/dist/tower/ui/System.d.ts +0 -5
- package/dist/tower/ui/System.d.ts.map +0 -1
- package/dist/tower/ui/System.js +0 -65
- package/dist/tower/ui/System.js.map +0 -1
- package/dist/tower/ui/Traces.d.ts +0 -13
- package/dist/tower/ui/Traces.d.ts.map +0 -1
- package/dist/tower/ui/Traces.js +0 -219
- package/dist/tower/ui/Traces.js.map +0 -1
- package/dist/x/cloudflare/CloudflareTunnel.d.ts +0 -11
- package/dist/x/cloudflare/CloudflareTunnel.d.ts.map +0 -1
- package/dist/x/cloudflare/CloudflareTunnel.js.map +0 -1
- package/dist/x/cloudflare/index.d.ts.map +0 -1
- package/dist/x/cloudflare/index.js.map +0 -1
- package/dist/x/tailscale/TailscaleTunnel.d.ts +0 -16
- package/dist/x/tailscale/TailscaleTunnel.d.ts.map +0 -1
- package/dist/x/tailscale/TailscaleTunnel.js.map +0 -1
- package/dist/x/tailscale/index.d.ts.map +0 -1
- package/dist/x/tailscale/index.js.map +0 -1
- package/dist/x/tailwind/TailwindPlugin.d.ts.map +0 -1
- package/dist/x/tailwind/TailwindPlugin.js.map +0 -1
- package/dist/x/tailwind/compile.d.ts.map +0 -1
- package/dist/x/tailwind/compile.js.map +0 -1
- package/dist/x/tailwind/plugin.d.ts.map +0 -1
- package/src/Commander.ts +0 -585
- package/src/FilePathPattern.ts +0 -115
- package/src/PlatformError.ts +0 -73
- package/src/TuplePathPattern.ts +0 -75
- package/src/hyper/Hyper.ts +0 -55
- package/src/hyper/HyperNode.ts +0 -34
- package/src/hyper/HyperRoute.ts +0 -59
- package/src/hyper/html.ts +0 -47
- package/src/hyper/index.ts +0 -6
- package/src/hyper/jsx-runtime.ts +0 -15
- package/src/tower/Tower.ts +0 -47
- package/src/tower/index.ts +0 -3
- package/src/tower/routes/route.tsx +0 -8
- /package/dist/{x/cloudflare → cloudflare}/index.d.ts +0 -0
- /package/dist/{x/cloudflare → cloudflare}/index.js +0 -0
- /package/dist/{tower → studio}/Simulation.d.ts +0 -0
- /package/dist/{tower → studio}/Simulation.js +0 -0
- /package/dist/{tower → studio}/routes/layout.d.ts +0 -0
- /package/dist/{tower → studio}/routes/layout.js +0 -0
- /package/dist/{tower → studio}/routes/tree.js +0 -0
- /package/dist/{x/tailscale → tailscale}/index.d.ts +0 -0
- /package/dist/{x/tailscale → tailscale}/index.js +0 -0
- /package/dist/{x/tailwind → tailwind}/TailwindPlugin.js +0 -0
- /package/dist/{x/tailwind → tailwind}/compile.d.ts +0 -0
- /package/dist/{x/tailwind → tailwind}/plugin.d.ts +0 -0
- /package/src/{ContentNegotiation.ts → _ContentNegotiation.ts} +0 -0
- /package/src/{Effectify.ts → _Effectify.ts} +0 -0
- /package/src/{StartApp.ts → _StartApp.ts} +0 -0
- /package/src/{StreamExtra.ts → _StreamExtra.ts} +0 -0
- /package/src/{Values.ts → _Values.ts} +0 -0
- /package/src/{x/cloudflare → cloudflare}/index.ts +0 -0
- /package/src/{tower → studio}/Simulation.ts +0 -0
- /package/src/{tower → studio}/routes/layout.tsx +0 -0
- /package/src/{tower → studio}/routes/tree.ts +0 -0
- /package/src/{tower → studio}/ui/Routes.tsx +0 -0
- /package/src/{tower → studio}/ui/Services.tsx +0 -0
- /package/src/{x/tailscale → tailscale}/index.ts +0 -0
- /package/src/{x/tailwind → tailwind}/TailwindPlugin.ts +0 -0
package/src/Start.ts
CHANGED
|
@@ -9,26 +9,14 @@ import * as Function from "effect/Function"
|
|
|
9
9
|
import * as Layer from "effect/Layer"
|
|
10
10
|
import * as Scope from "effect/Scope"
|
|
11
11
|
import * as SynchronizedRef from "effect/SynchronizedRef"
|
|
12
|
-
import type * as ChildProcess from "./
|
|
12
|
+
import type * as ChildProcess from "./_ChildProcess.ts"
|
|
13
13
|
import * as MutableRef from "effect/MutableRef"
|
|
14
14
|
import * as BunRuntime from "./bun/BunRuntime.ts"
|
|
15
15
|
import * as BunServer from "./bun/BunServer.ts"
|
|
16
16
|
import * as NodeFileSystem from "./node/NodeFileSystem.ts"
|
|
17
17
|
import * as BunChildProcessSpawner from "./bun/BunChildProcessSpawner.ts"
|
|
18
18
|
import * as PlatformRuntime from "./PlatformRuntime.ts"
|
|
19
|
-
import * as StartApp from "./
|
|
20
|
-
|
|
21
|
-
export function layer<
|
|
22
|
-
Layers extends [Layer.Layer<never, any, any>, ...Array<Layer.Layer<never, any, any>>],
|
|
23
|
-
>(
|
|
24
|
-
...layers: Layers
|
|
25
|
-
): Layer.Layer<
|
|
26
|
-
{ [k in keyof Layers]: Layer.Layer.Success<Layers[k]> }[number],
|
|
27
|
-
{ [k in keyof Layers]: Layer.Layer.Error<Layers[k]> }[number],
|
|
28
|
-
{ [k in keyof Layers]: Layer.Layer.Context<Layers[k]> }[number]
|
|
29
|
-
> {
|
|
30
|
-
return Layer.mergeAll(...layers)
|
|
31
|
-
}
|
|
19
|
+
import * as StartApp from "./_StartApp.ts"
|
|
32
20
|
|
|
33
21
|
/**
|
|
34
22
|
* Bundles layers together, wiring their dependencies automatically.
|
|
@@ -96,18 +84,6 @@ type OrderedPack<
|
|
|
96
84
|
]
|
|
97
85
|
: []
|
|
98
86
|
|
|
99
|
-
/**
|
|
100
|
-
* Like `pack`, but accepts layers in any order.
|
|
101
|
-
*
|
|
102
|
-
* ```ts
|
|
103
|
-
* // These all produce the same result:
|
|
104
|
-
* Start.build(LoggerLive, DatabaseLive, UserRepoLive)
|
|
105
|
-
* Start.build(UserRepoLive, DatabaseLive, LoggerLive)
|
|
106
|
-
* ```
|
|
107
|
-
*
|
|
108
|
-
* @since 1.0.0
|
|
109
|
-
* @category constructors
|
|
110
|
-
*/
|
|
111
87
|
type BuildSuccess<Layers extends readonly Layer.Layer.Any[]> = {
|
|
112
88
|
[K in keyof Layers]: Layer.Layer.Success<Layers[K]>
|
|
113
89
|
}[number]
|
|
@@ -121,6 +97,18 @@ type BuildContext<Layers extends readonly Layer.Layer.Any[]> = Exclude<
|
|
|
121
97
|
{ [K in keyof Layers]: Layer.Layer.Success<Layers[K]> }[number]
|
|
122
98
|
>
|
|
123
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Like `pack`, but accepts layers in any order.
|
|
102
|
+
*
|
|
103
|
+
* ```ts
|
|
104
|
+
* // These all produce the same result:
|
|
105
|
+
* Start.build(LoggerLive, DatabaseLive, UserRepoLive)
|
|
106
|
+
* Start.build(UserRepoLive, DatabaseLive, LoggerLive)
|
|
107
|
+
* ```
|
|
108
|
+
*
|
|
109
|
+
* @since 1.0.0
|
|
110
|
+
* @category constructors
|
|
111
|
+
*/
|
|
124
112
|
export function build<const Layers extends readonly [Layer.Layer.Any, ...Array<Layer.Layer.Any>]>(
|
|
125
113
|
...layers: Layers
|
|
126
114
|
): Layer.Layer<BuildSuccess<Layers>, BuildError<Layers>, BuildContext<Layers>> {
|
|
@@ -170,26 +158,19 @@ export function build<const Layers extends readonly [Layer.Layer.Any, ...Array<L
|
|
|
170
158
|
)
|
|
171
159
|
}
|
|
172
160
|
|
|
173
|
-
export
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
Layer.effect(
|
|
187
|
-
StartApp.StartApp,
|
|
188
|
-
Deferred.make<BunServer.BunServer>().pipe(Effect.map((server) => ({ server }))),
|
|
189
|
-
),
|
|
190
|
-
)
|
|
191
|
-
|
|
192
|
-
export function serve<ROut, E, RIn extends PlatformServices>(
|
|
161
|
+
export function layerDev() {
|
|
162
|
+
return Layer.mergeAll(NodeFileSystem.layer, BunChildProcessSpawner.layer)
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
export function serve<
|
|
166
|
+
ROut,
|
|
167
|
+
E,
|
|
168
|
+
RIn extends
|
|
169
|
+
| BunServer.BunServer
|
|
170
|
+
| FileSystem.FileSystem
|
|
171
|
+
| ChildProcess.ChildProcessSpawner
|
|
172
|
+
| StartApp.StartApp,
|
|
173
|
+
>(
|
|
193
174
|
load: () => Promise<{
|
|
194
175
|
default: Layer.Layer<ROut, E, RIn>
|
|
195
176
|
}>,
|
|
@@ -201,7 +182,18 @@ export function serve<ROut, E, RIn extends PlatformServices>(
|
|
|
201
182
|
Layer.unwrapEffect,
|
|
202
183
|
)
|
|
203
184
|
|
|
204
|
-
const appLayerResolved = Function.pipe(
|
|
185
|
+
const appLayerResolved = Function.pipe(
|
|
186
|
+
appLayer,
|
|
187
|
+
Layer.provideMerge(
|
|
188
|
+
Layer.mergeAll(
|
|
189
|
+
layerDev(),
|
|
190
|
+
Layer.effect(
|
|
191
|
+
StartApp.StartApp,
|
|
192
|
+
Deferred.make<BunServer.BunServer>().pipe(Effect.map((server) => ({ server }))),
|
|
193
|
+
),
|
|
194
|
+
),
|
|
195
|
+
),
|
|
196
|
+
)
|
|
205
197
|
|
|
206
198
|
const composed = Function.pipe(
|
|
207
199
|
BunServer.layerStart(),
|
package/src/System.ts
CHANGED
|
@@ -1,75 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Adapted from @effect/platform
|
|
3
|
+
*/
|
|
4
|
+
import * as Data from "effect/Data"
|
|
1
5
|
import * as Effect from "effect/Effect"
|
|
2
6
|
import type * as Scope from "effect/Scope"
|
|
3
|
-
import * as
|
|
7
|
+
import * as ChildProcess from "./_ChildProcess.ts"
|
|
4
8
|
|
|
5
|
-
|
|
6
|
-
import * as PlatformError from "./PlatformError.ts"
|
|
9
|
+
export type Spawner = ChildProcess.ChildProcessSpawner
|
|
7
10
|
|
|
8
|
-
export
|
|
11
|
+
export type SystemErrorReason =
|
|
12
|
+
| "AlreadyExists"
|
|
13
|
+
| "BadArgument"
|
|
14
|
+
| "BadResource"
|
|
15
|
+
| "Busy"
|
|
16
|
+
| "InvalidData"
|
|
17
|
+
| "NotFound"
|
|
18
|
+
| "PermissionDenied"
|
|
19
|
+
| "TimedOut"
|
|
20
|
+
| "UnexpectedEof"
|
|
21
|
+
| "Unknown"
|
|
22
|
+
| "WouldBlock"
|
|
23
|
+
| "WriteZero"
|
|
9
24
|
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
),
|
|
28
|
-
)
|
|
29
|
-
server.listen(0, "127.0.0.1", () => {
|
|
30
|
-
const address = server.address()
|
|
31
|
-
if (!address || typeof address === "string") {
|
|
32
|
-
server.close(() =>
|
|
33
|
-
resume(
|
|
34
|
-
Effect.fail(
|
|
35
|
-
new PlatformError.SystemError({
|
|
36
|
-
reason: "Unknown",
|
|
37
|
-
module: "System",
|
|
38
|
-
method: "randomFreePort",
|
|
39
|
-
description: "Failed to allocate a free port",
|
|
40
|
-
}),
|
|
41
|
-
),
|
|
42
|
-
),
|
|
43
|
-
)
|
|
44
|
-
return
|
|
45
|
-
}
|
|
46
|
-
const port = address.port
|
|
47
|
-
server.close((err) => {
|
|
48
|
-
if (err) {
|
|
49
|
-
resume(
|
|
50
|
-
Effect.fail(
|
|
51
|
-
new PlatformError.SystemError({
|
|
52
|
-
reason: "Unknown",
|
|
53
|
-
module: "System",
|
|
54
|
-
method: "randomFreePort",
|
|
55
|
-
description: err.message,
|
|
56
|
-
cause: err,
|
|
57
|
-
}),
|
|
58
|
-
),
|
|
59
|
-
)
|
|
60
|
-
return
|
|
61
|
-
}
|
|
62
|
-
resume(Effect.succeed(port))
|
|
63
|
-
})
|
|
64
|
-
})
|
|
65
|
-
})
|
|
25
|
+
export class SystemError extends Data.TaggedError("SystemError")<{
|
|
26
|
+
reason: SystemErrorReason
|
|
27
|
+
module: string
|
|
28
|
+
method: string
|
|
29
|
+
description?: string | undefined
|
|
30
|
+
syscall?: string | undefined
|
|
31
|
+
pathOrDescriptor?: string | number | undefined
|
|
32
|
+
cause?: unknown
|
|
33
|
+
}> {
|
|
34
|
+
get message(): string {
|
|
35
|
+
return `${this.reason}: ${this.module}.${this.method}${
|
|
36
|
+
this.pathOrDescriptor !== undefined ? ` (${this.pathOrDescriptor})` : ""
|
|
37
|
+
}${this.description ? `: ${this.description}` : ""}`
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export const cwd: Effect.Effect<string> = Effect.sync(() => process.cwd())
|
|
66
42
|
|
|
67
|
-
export const which = (name: string): Effect.Effect<string,
|
|
43
|
+
export const which = (name: string): Effect.Effect<string, SystemError> =>
|
|
68
44
|
Effect.flatMap(
|
|
69
45
|
Effect.try({
|
|
70
46
|
try: () => Bun.which(name),
|
|
71
47
|
catch: (err) =>
|
|
72
|
-
new
|
|
48
|
+
new SystemError({
|
|
73
49
|
reason: "Unknown",
|
|
74
50
|
module: "System",
|
|
75
51
|
method: "which",
|
|
@@ -80,7 +56,7 @@ export const which = (name: string): Effect.Effect<string, PlatformError.SystemE
|
|
|
80
56
|
(path) =>
|
|
81
57
|
path === null
|
|
82
58
|
? Effect.fail(
|
|
83
|
-
new
|
|
59
|
+
new SystemError({
|
|
84
60
|
reason: "NotFound",
|
|
85
61
|
module: "System",
|
|
86
62
|
method: "which",
|
|
@@ -91,10 +67,10 @@ export const which = (name: string): Effect.Effect<string, PlatformError.SystemE
|
|
|
91
67
|
)
|
|
92
68
|
|
|
93
69
|
export const spawn = (
|
|
94
|
-
cmd:
|
|
70
|
+
cmd: [string, ...Array<string>] | string[],
|
|
95
71
|
options?: ChildProcess.Command.Options,
|
|
96
72
|
): Effect.Effect<
|
|
97
73
|
ChildProcess.ChildProcessHandle,
|
|
98
|
-
|
|
74
|
+
SystemError,
|
|
99
75
|
ChildProcess.ChildProcessSpawner | Scope.Scope
|
|
100
76
|
> => ChildProcess.spawn(ChildProcess.make(cmd, options))
|
|
@@ -13,16 +13,14 @@ import type * as Sink from "effect/Sink"
|
|
|
13
13
|
import type * as Stream from "effect/Stream"
|
|
14
14
|
import * as Utils from "effect/Utils"
|
|
15
15
|
|
|
16
|
-
import type * as
|
|
16
|
+
import type * as System from "./System.ts"
|
|
17
17
|
|
|
18
|
-
const TypeId
|
|
19
|
-
|
|
20
|
-
type TypeId = typeof TypeId
|
|
18
|
+
const TypeId = "~effect-start/ChildProcess/Command" as const
|
|
21
19
|
|
|
22
20
|
type Stdio = "pipe" | "inherit" | "ignore"
|
|
23
21
|
|
|
24
22
|
export interface Command extends Pipeable.Pipeable {
|
|
25
|
-
readonly [TypeId]: TypeId
|
|
23
|
+
readonly [TypeId]: typeof TypeId
|
|
26
24
|
readonly cmd: readonly [string, ...Array<string>]
|
|
27
25
|
readonly cwd?: string
|
|
28
26
|
readonly env?: Record<string, string>
|
|
@@ -31,11 +29,7 @@ export interface Command extends Pipeable.Pipeable {
|
|
|
31
29
|
readonly stderr?: Stdio
|
|
32
30
|
readonly detached?: boolean
|
|
33
31
|
[Symbol.iterator](): Effect.EffectGenerator<
|
|
34
|
-
Effect.Effect<
|
|
35
|
-
ChildProcessHandle,
|
|
36
|
-
PlatformError.PlatformError,
|
|
37
|
-
ChildProcessSpawner | Scope.Scope
|
|
38
|
-
>
|
|
32
|
+
Effect.Effect<ChildProcessHandle, System.SystemError, ChildProcessSpawner | Scope.Scope>
|
|
39
33
|
>
|
|
40
34
|
}
|
|
41
35
|
|
|
@@ -63,7 +57,7 @@ const CommandProto = {
|
|
|
63
57
|
export const isCommand = (u: unknown): u is Command => Predicate.hasProperty(u, TypeId)
|
|
64
58
|
|
|
65
59
|
export const make = (
|
|
66
|
-
cmd:
|
|
60
|
+
cmd: [string, ...Array<string>] | string[],
|
|
67
61
|
options?: Command.Options,
|
|
68
62
|
): Command =>
|
|
69
63
|
Object.assign(Object.create(CommandProto), {
|
|
@@ -116,12 +110,12 @@ export interface KillOptions {
|
|
|
116
110
|
|
|
117
111
|
export interface ChildProcessHandle {
|
|
118
112
|
readonly pid: number
|
|
119
|
-
readonly exitCode: Effect.Effect<number,
|
|
120
|
-
readonly isRunning: Effect.Effect<boolean,
|
|
121
|
-
readonly kill: (options?: KillOptions) => Effect.Effect<void,
|
|
122
|
-
readonly stdin: Sink.Sink<void, Uint8Array, never,
|
|
123
|
-
readonly stdout: Stream.Stream<Uint8Array,
|
|
124
|
-
readonly stderr: Stream.Stream<Uint8Array,
|
|
113
|
+
readonly exitCode: Effect.Effect<number, System.SystemError>
|
|
114
|
+
readonly isRunning: Effect.Effect<boolean, System.SystemError>
|
|
115
|
+
readonly kill: (options?: KillOptions) => Effect.Effect<void, System.SystemError>
|
|
116
|
+
readonly stdin: Sink.Sink<void, Uint8Array, never, System.SystemError>
|
|
117
|
+
readonly stdout: Stream.Stream<Uint8Array, System.SystemError>
|
|
118
|
+
readonly stderr: Stream.Stream<Uint8Array, System.SystemError>
|
|
125
119
|
}
|
|
126
120
|
|
|
127
121
|
export class ChildProcessSpawner extends Context.Tag("effect-start/ChildProcessSpawner")<
|
|
@@ -129,14 +123,11 @@ export class ChildProcessSpawner extends Context.Tag("effect-start/ChildProcessS
|
|
|
129
123
|
{
|
|
130
124
|
readonly spawn: (
|
|
131
125
|
command: Command,
|
|
132
|
-
) => Effect.Effect<ChildProcessHandle,
|
|
126
|
+
) => Effect.Effect<ChildProcessHandle, System.SystemError, Scope.Scope>
|
|
133
127
|
}
|
|
134
128
|
>() {}
|
|
135
129
|
|
|
136
130
|
export const spawn = (
|
|
137
131
|
command: Command,
|
|
138
|
-
): Effect.Effect<
|
|
139
|
-
|
|
140
|
-
PlatformError.PlatformError,
|
|
141
|
-
ChildProcessSpawner | Scope.Scope
|
|
142
|
-
> => Effect.flatMap(ChildProcessSpawner, (spawner) => spawner.spawn(command))
|
|
132
|
+
): Effect.Effect<ChildProcessHandle, System.SystemError, ChildProcessSpawner | Scope.Scope> =>
|
|
133
|
+
Effect.flatMap(ChildProcessSpawner, (spawner) => spawner.spawn(command))
|
|
@@ -5,7 +5,7 @@ import * as Layer from "effect/Layer"
|
|
|
5
5
|
import * as Ref from "effect/Ref"
|
|
6
6
|
import * as Stream from "effect/Stream"
|
|
7
7
|
|
|
8
|
-
import type * as ChildProcess from "./
|
|
8
|
+
import type * as ChildProcess from "./_ChildProcess.ts"
|
|
9
9
|
import * as System from "./System.ts"
|
|
10
10
|
|
|
11
11
|
export class DockerError extends Data.TaggedError("DockerError")<{
|
package/src/{Http.ts → _Http.ts}
RENAMED
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import * as Values from "./Values.ts"
|
|
2
|
-
|
|
3
1
|
export type Method = "GET" | "POST" | "PUT" | "DELETE" | "PATCH" | "HEAD" | "OPTIONS"
|
|
4
2
|
|
|
5
3
|
type Respondable = Response | Promise<Response>
|
|
@@ -8,32 +6,6 @@ export type WebHandler = (request: Request) => Respondable
|
|
|
8
6
|
|
|
9
7
|
export type WebMiddleware = (request: Request, next: WebHandler) => Respondable
|
|
10
8
|
|
|
11
|
-
export function fetch(
|
|
12
|
-
handler: WebHandler,
|
|
13
|
-
init: Omit<RequestInit, "body"> &
|
|
14
|
-
({ url: string } | { path: `/${string}` }) & {
|
|
15
|
-
body?: RequestInit["body"] | Record<string, unknown>
|
|
16
|
-
},
|
|
17
|
-
): Promise<Response> {
|
|
18
|
-
const url = "path" in init ? `http://localhost${init.path}` : init.url
|
|
19
|
-
|
|
20
|
-
const isPlain = Values.isPlainObject(init.body)
|
|
21
|
-
|
|
22
|
-
const headers = new Headers(init.headers)
|
|
23
|
-
if (isPlain && !headers.has("Content-Type")) {
|
|
24
|
-
headers.set("Content-Type", "application/json")
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const body = isPlain ? JSON.stringify(init.body) : init.body
|
|
28
|
-
|
|
29
|
-
const request = new Request(url, {
|
|
30
|
-
...init,
|
|
31
|
-
headers,
|
|
32
|
-
body: body as BodyInit,
|
|
33
|
-
})
|
|
34
|
-
return Promise.resolve(handler(request))
|
|
35
|
-
}
|
|
36
|
-
|
|
37
9
|
export function createAbortableRequest(
|
|
38
10
|
init: Omit<RequestInit, "signal"> & ({ url: string } | { path: `/${string}` }),
|
|
39
11
|
): { request: Request; abort: () => void } {
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import * as Either from "effect/Either"
|
|
2
|
+
|
|
1
3
|
export type PathPattern = `/${string}`
|
|
2
4
|
|
|
3
5
|
export type Segments<Path extends string> = Path extends `/${infer Rest}`
|
|
@@ -26,6 +28,16 @@ export type Params<T extends string> = string extends T
|
|
|
26
28
|
|
|
27
29
|
export type ValidateResult = { ok: true; segments: Array<string> } | { ok: false; error: string }
|
|
28
30
|
|
|
31
|
+
export type PathPatternError = {
|
|
32
|
+
_tag: "PathPatternError"
|
|
33
|
+
pattern: string
|
|
34
|
+
message: string
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
function isValidFileParamName(name: string): boolean {
|
|
38
|
+
return name.length > 0 && /^[a-zA-Z0-9_]+$/.test(name)
|
|
39
|
+
}
|
|
40
|
+
|
|
29
41
|
function isValidSegment(segment: string): boolean {
|
|
30
42
|
if (segment.startsWith(":")) {
|
|
31
43
|
const rest = segment.slice(1)
|
|
@@ -51,6 +63,99 @@ export function validate(path: string): ValidateResult {
|
|
|
51
63
|
return { ok: true, segments }
|
|
52
64
|
}
|
|
53
65
|
|
|
66
|
+
export function fromFilePath(filePath: string): Either.Either<PathPattern, PathPatternError> {
|
|
67
|
+
const parts = filePath.split("/").filter(Boolean)
|
|
68
|
+
const pathParts: Array<string> = []
|
|
69
|
+
let sawRest = false
|
|
70
|
+
|
|
71
|
+
for (let index = 0; index < parts.length; index++) {
|
|
72
|
+
const part = parts[index]
|
|
73
|
+
|
|
74
|
+
if (/^\(\w+\)$/.test(part)) {
|
|
75
|
+
continue
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
if (part.startsWith("[[") && part.endsWith("]]")) {
|
|
79
|
+
const name = part.slice(2, -2)
|
|
80
|
+
if (!isValidFileParamName(name)) {
|
|
81
|
+
return Either.left({
|
|
82
|
+
_tag: "PathPatternError",
|
|
83
|
+
pattern: filePath,
|
|
84
|
+
message: `Invalid segment: "${part}"`,
|
|
85
|
+
})
|
|
86
|
+
}
|
|
87
|
+
if (index !== parts.length - 1) {
|
|
88
|
+
return Either.left({
|
|
89
|
+
_tag: "PathPatternError",
|
|
90
|
+
pattern: filePath,
|
|
91
|
+
message: "Rest segment must be the last segment",
|
|
92
|
+
})
|
|
93
|
+
}
|
|
94
|
+
pathParts.push(`:${name}*`)
|
|
95
|
+
sawRest = true
|
|
96
|
+
continue
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
if (part.startsWith("[") && part.endsWith("]")) {
|
|
100
|
+
const name = part.slice(1, -1)
|
|
101
|
+
if (!isValidFileParamName(name)) {
|
|
102
|
+
return Either.left({
|
|
103
|
+
_tag: "PathPatternError",
|
|
104
|
+
pattern: filePath,
|
|
105
|
+
message: `Invalid segment: "${part}"`,
|
|
106
|
+
})
|
|
107
|
+
}
|
|
108
|
+
if (sawRest) {
|
|
109
|
+
return Either.left({
|
|
110
|
+
_tag: "PathPatternError",
|
|
111
|
+
pattern: filePath,
|
|
112
|
+
message: "Rest segment must be the last segment",
|
|
113
|
+
})
|
|
114
|
+
}
|
|
115
|
+
pathParts.push(`:${name}`)
|
|
116
|
+
continue
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
if (/^[\p{L}\p{N}._~-]+$/u.test(part)) {
|
|
120
|
+
if (sawRest) {
|
|
121
|
+
return Either.left({
|
|
122
|
+
_tag: "PathPatternError",
|
|
123
|
+
pattern: filePath,
|
|
124
|
+
message: "Rest segment must be the last segment",
|
|
125
|
+
})
|
|
126
|
+
}
|
|
127
|
+
pathParts.push(part)
|
|
128
|
+
continue
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
return Either.left({
|
|
132
|
+
_tag: "PathPatternError",
|
|
133
|
+
pattern: filePath,
|
|
134
|
+
message: `Invalid segment: "${part}"`,
|
|
135
|
+
})
|
|
136
|
+
}
|
|
137
|
+
|
|
138
|
+
const path = (pathParts.length > 0 ? `/${pathParts.join("/")}` : "/") as PathPattern
|
|
139
|
+
return Either.right(path)
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
export function params(path: string): Array<{ name: string; optional: boolean }> {
|
|
143
|
+
const segments = path.split("/").filter(Boolean)
|
|
144
|
+
const result: Array<{ name: string; optional: boolean }> = []
|
|
145
|
+
|
|
146
|
+
for (const segment of segments) {
|
|
147
|
+
if (!segment.startsWith(":")) {
|
|
148
|
+
continue
|
|
149
|
+
}
|
|
150
|
+
|
|
151
|
+
const modifier = getModifier(segment)
|
|
152
|
+
const name = getParamName(segment)
|
|
153
|
+
result.push({ name, optional: modifier === "?" || modifier === "*" })
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
return result
|
|
157
|
+
}
|
|
158
|
+
|
|
54
159
|
export function match(pattern: string, path: string): Record<string, string> | null {
|
|
55
160
|
const patternSegments = pattern.split("/").filter(Boolean)
|
|
56
161
|
const pathSegments = path.split("/").filter(Boolean)
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
import * as Function from "effect/Function"
|
|
2
1
|
import type * as Schema from "effect/Schema"
|
|
3
2
|
import * as SchemaAST from "effect/SchemaAST"
|
|
4
3
|
|
|
5
|
-
|
|
4
|
+
function getBaseSchemaAST(schema: Schema.Schema.Any): SchemaAST.AST {
|
|
6
5
|
let current = schema.ast
|
|
7
6
|
|
|
8
7
|
while (SchemaAST.isRefinement(current) || SchemaAST.isTransformation(current)) {
|
|
@@ -12,7 +11,7 @@ export function getBaseSchemaAST(schema: Schema.Schema.Any): SchemaAST.AST {
|
|
|
12
11
|
return current
|
|
13
12
|
}
|
|
14
13
|
|
|
15
|
-
|
|
14
|
+
function isOptional(schema: Schema.Schema.Any): boolean {
|
|
16
15
|
const ast = schema.ast
|
|
17
16
|
|
|
18
17
|
if (ast._tag === "Union") {
|
|
@@ -71,7 +70,7 @@ export function schemaEqual(
|
|
|
71
70
|
return true
|
|
72
71
|
}
|
|
73
72
|
|
|
74
|
-
|
|
73
|
+
function getSchemaTypeName(schema: Schema.Schema.Any): string {
|
|
75
74
|
const baseAST = getBaseSchemaAST(schema)
|
|
76
75
|
switch (baseAST._tag) {
|
|
77
76
|
case "StringKeyword":
|
|
@@ -3,8 +3,8 @@ import * as Layer from "effect/Layer"
|
|
|
3
3
|
import * as Sink from "effect/Sink"
|
|
4
4
|
import * as Stream from "effect/Stream"
|
|
5
5
|
import type * as BunTypes from "bun"
|
|
6
|
-
import * as ChildProcess from "../
|
|
7
|
-
import * as
|
|
6
|
+
import * as ChildProcess from "../_ChildProcess.ts"
|
|
7
|
+
import * as System from "../System.ts"
|
|
8
8
|
|
|
9
9
|
export const layer: Layer.Layer<ChildProcess.ChildProcessSpawner> = Layer.succeed(
|
|
10
10
|
ChildProcess.ChildProcessSpawner,
|
|
@@ -22,7 +22,7 @@ export const layer: Layer.Layer<ChildProcess.ChildProcessSpawner> = Layer.succee
|
|
|
22
22
|
detached: command.detached,
|
|
23
23
|
}),
|
|
24
24
|
catch: (err) =>
|
|
25
|
-
new
|
|
25
|
+
new System.SystemError({
|
|
26
26
|
reason: "Unknown",
|
|
27
27
|
module: "ChildProcess",
|
|
28
28
|
method: "spawn",
|
|
@@ -45,7 +45,7 @@ export const layer: Layer.Layer<ChildProcess.ChildProcessSpawner> = Layer.succee
|
|
|
45
45
|
exitCode: Effect.tryPromise({
|
|
46
46
|
try: () => proc.exited,
|
|
47
47
|
catch: (err) =>
|
|
48
|
-
new
|
|
48
|
+
new System.SystemError({
|
|
49
49
|
reason: "Unknown",
|
|
50
50
|
module: "ChildProcess",
|
|
51
51
|
method: "exitCode",
|
|
@@ -57,7 +57,7 @@ export const layer: Layer.Layer<ChildProcess.ChildProcessSpawner> = Layer.succee
|
|
|
57
57
|
isRunning: Effect.try({
|
|
58
58
|
try: () => !proc.killed && proc.exitCode === null,
|
|
59
59
|
catch: (err) =>
|
|
60
|
-
new
|
|
60
|
+
new System.SystemError({
|
|
61
61
|
reason: "BadResource",
|
|
62
62
|
module: "ChildProcess",
|
|
63
63
|
method: "isRunning",
|
|
@@ -72,7 +72,7 @@ export const layer: Layer.Layer<ChildProcess.ChildProcessSpawner> = Layer.succee
|
|
|
72
72
|
proc.kill(options?.killSignal)
|
|
73
73
|
},
|
|
74
74
|
catch: (err) =>
|
|
75
|
-
new
|
|
75
|
+
new System.SystemError({
|
|
76
76
|
reason: "BadResource",
|
|
77
77
|
module: "ChildProcess",
|
|
78
78
|
method: "kill",
|
|
@@ -88,7 +88,7 @@ export const layer: Layer.Layer<ChildProcess.ChildProcessSpawner> = Layer.succee
|
|
|
88
88
|
sink.write(chunk)
|
|
89
89
|
},
|
|
90
90
|
catch: (err) =>
|
|
91
|
-
new
|
|
91
|
+
new System.SystemError({
|
|
92
92
|
reason: "Unknown",
|
|
93
93
|
module: "ChildProcess",
|
|
94
94
|
method: "fromWritable(stdin)",
|
|
@@ -108,7 +108,7 @@ export const layer: Layer.Layer<ChildProcess.ChildProcessSpawner> = Layer.succee
|
|
|
108
108
|
stdout: Stream.fromReadableStream(
|
|
109
109
|
() => proc.stdout as ReadableStream<Uint8Array>,
|
|
110
110
|
(err) =>
|
|
111
|
-
new
|
|
111
|
+
new System.SystemError({
|
|
112
112
|
reason: "Unknown",
|
|
113
113
|
module: "ChildProcess",
|
|
114
114
|
method: "fromReadable(stdout)",
|
|
@@ -120,7 +120,7 @@ export const layer: Layer.Layer<ChildProcess.ChildProcessSpawner> = Layer.succee
|
|
|
120
120
|
stderr: Stream.fromReadableStream(
|
|
121
121
|
() => proc.stderr as ReadableStream<Uint8Array>,
|
|
122
122
|
(err) =>
|
|
123
|
-
new
|
|
123
|
+
new System.SystemError({
|
|
124
124
|
reason: "Unknown",
|
|
125
125
|
module: "ChildProcess",
|
|
126
126
|
method: "fromReadable(stderr)",
|