effect-start 0.27.0 → 0.29.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/dist/Cookies.d.ts +46 -0
- package/dist/Cookies.d.ts.map +1 -0
- package/dist/Cookies.js +303 -0
- package/dist/Cookies.js.map +1 -0
- package/dist/Entity.d.ts +47 -0
- package/dist/Entity.d.ts.map +1 -0
- package/dist/Entity.js +238 -0
- package/dist/Entity.js.map +1 -0
- package/dist/Fetch.d.ts +69 -0
- package/dist/Fetch.d.ts.map +1 -0
- package/dist/Fetch.js +225 -0
- package/dist/Fetch.js.map +1 -0
- package/dist/FileRouter.d.ts +54 -0
- package/dist/FileRouter.d.ts.map +1 -0
- package/dist/FileRouter.js +158 -0
- package/dist/FileRouter.js.map +1 -0
- package/dist/FileRouterCodegen.d.ts +19 -0
- package/dist/FileRouterCodegen.d.ts.map +1 -0
- package/dist/FileRouterCodegen.js +216 -0
- package/dist/FileRouterCodegen.js.map +1 -0
- package/dist/FileSystem.d.ts +159 -0
- package/dist/FileSystem.d.ts.map +1 -0
- package/dist/FileSystem.js +73 -0
- package/dist/FileSystem.js.map +1 -0
- package/dist/GlobalLayer.d.ts +4 -0
- package/dist/GlobalLayer.d.ts.map +1 -0
- package/dist/GlobalLayer.js +51 -0
- package/dist/GlobalLayer.js.map +1 -0
- package/dist/PlatformRuntime.d.ts +30 -0
- package/dist/PlatformRuntime.d.ts.map +1 -0
- package/dist/PlatformRuntime.js +50 -0
- package/dist/PlatformRuntime.js.map +1 -0
- package/dist/Route.d.ts +98 -0
- package/dist/Route.d.ts.map +1 -0
- package/dist/Route.js +101 -0
- package/dist/Route.js.map +1 -0
- package/dist/RouteBody.d.ts +48 -0
- package/dist/RouteBody.d.ts.map +1 -0
- package/dist/RouteBody.js +68 -0
- package/dist/RouteBody.js.map +1 -0
- package/dist/RouteError.d.ts +99 -0
- package/dist/RouteError.d.ts.map +1 -0
- package/dist/RouteError.js +56 -0
- package/dist/RouteError.js.map +1 -0
- package/dist/RouteHook.d.ts +13 -0
- package/dist/RouteHook.d.ts.map +1 -0
- package/dist/RouteHook.js +40 -0
- package/dist/RouteHook.js.map +1 -0
- package/dist/RouteHttp.d.ts +22 -0
- package/dist/RouteHttp.d.ts.map +1 -0
- package/dist/RouteHttp.js +266 -0
- package/dist/RouteHttp.js.map +1 -0
- package/dist/RouteHttpTracer.d.ts +11 -0
- package/dist/RouteHttpTracer.d.ts.map +1 -0
- package/dist/RouteHttpTracer.js +63 -0
- package/dist/RouteHttpTracer.js.map +1 -0
- package/dist/RouteMount.d.ts +87 -0
- package/dist/RouteMount.d.ts.map +1 -0
- package/dist/RouteMount.js +64 -0
- package/dist/RouteMount.js.map +1 -0
- package/dist/RouteSchema.d.ts +87 -0
- package/dist/RouteSchema.d.ts.map +1 -0
- package/dist/RouteSchema.js +189 -0
- package/dist/RouteSchema.js.map +1 -0
- package/dist/RouteSse.d.ts +21 -0
- package/dist/RouteSse.d.ts.map +1 -0
- package/dist/RouteSse.js +76 -0
- package/dist/RouteSse.js.map +1 -0
- package/dist/RouteTree.d.ts +58 -0
- package/dist/RouteTree.d.ts.map +1 -0
- package/dist/RouteTree.js +94 -0
- package/dist/RouteTree.js.map +1 -0
- package/dist/RouteTrie.d.ts +21 -0
- package/dist/RouteTrie.d.ts.map +1 -0
- package/dist/RouteTrie.js +153 -0
- package/dist/RouteTrie.js.map +1 -0
- package/dist/Socket.d.ts +23 -0
- package/dist/Socket.d.ts.map +1 -0
- package/dist/Socket.js +29 -0
- package/dist/Socket.js.map +1 -0
- package/dist/Start.d.ts +82 -0
- package/dist/Start.d.ts.map +1 -0
- package/dist/Start.js +102 -0
- package/dist/Start.js.map +1 -0
- package/dist/System.d.ts +24 -0
- package/dist/System.d.ts.map +1 -0
- package/dist/System.js +31 -0
- package/dist/System.js.map +1 -0
- package/dist/Unique.d.ts +68 -0
- package/dist/Unique.d.ts.map +1 -0
- package/dist/Unique.js +225 -0
- package/dist/Unique.js.map +1 -0
- package/dist/_ChildProcess.d.ts +59 -0
- package/dist/_ChildProcess.d.ts.map +1 -0
- package/dist/_ChildProcess.js +30 -0
- package/dist/_ChildProcess.js.map +1 -0
- package/dist/_ContentNegotiation.d.ts +13 -0
- package/dist/_ContentNegotiation.d.ts.map +1 -0
- package/dist/_ContentNegotiation.js +360 -0
- package/dist/_ContentNegotiation.js.map +1 -0
- package/dist/_Development.d.ts +27 -0
- package/dist/_Development.d.ts.map +1 -0
- package/dist/_Development.js +57 -0
- package/dist/_Development.js.map +1 -0
- package/dist/_Docker.d.ts +51 -0
- package/dist/_Docker.d.ts.map +1 -0
- package/dist/_Docker.js +88 -0
- package/dist/_Docker.js.map +1 -0
- package/dist/_Effectify.d.ts +210 -0
- package/dist/_Effectify.d.ts.map +1 -0
- package/dist/_Effectify.js +20 -0
- package/dist/_Effectify.js.map +1 -0
- package/dist/_Http.d.ts +31 -0
- package/dist/_Http.d.ts.map +1 -0
- package/dist/_Http.js +73 -0
- package/dist/_Http.js.map +1 -0
- package/dist/_PathPattern.d.ts +146 -0
- package/dist/_PathPattern.d.ts.map +1 -0
- package/dist/_PathPattern.js +499 -0
- 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 +75 -0
- package/dist/_SchemaExtra.js.map +1 -0
- package/dist/_StartApp.d.ts +13 -0
- package/dist/_StartApp.d.ts.map +1 -0
- package/dist/_StartApp.js +4 -0
- package/dist/_StartApp.js.map +1 -0
- package/dist/_StreamExtra.d.ts +29 -0
- package/dist/_StreamExtra.d.ts.map +1 -0
- package/dist/_StreamExtra.js +101 -0
- package/dist/_StreamExtra.js.map +1 -0
- package/dist/_Values.d.ts +30 -0
- package/dist/_Values.d.ts.map +1 -0
- package/dist/_Values.js +46 -0
- package/dist/_Values.js.map +1 -0
- package/dist/bun/BunBundle.d.ts +12 -0
- package/dist/bun/BunBundle.d.ts.map +1 -0
- package/dist/bun/BunBundle.js +138 -0
- package/dist/bun/BunBundle.js.map +1 -0
- package/dist/bun/BunChildProcessSpawner.d.ts +4 -0
- package/dist/bun/BunChildProcessSpawner.d.ts.map +1 -0
- package/dist/bun/BunChildProcessSpawner.js +99 -0
- package/dist/bun/BunChildProcessSpawner.js.map +1 -0
- package/dist/bun/BunImportTrackerPlugin.d.ts +14 -0
- package/dist/bun/BunImportTrackerPlugin.d.ts.map +1 -0
- package/dist/bun/BunImportTrackerPlugin.js +70 -0
- package/dist/bun/BunImportTrackerPlugin.js.map +1 -0
- package/dist/bun/BunRoute.d.ts +49 -0
- package/dist/bun/BunRoute.d.ts.map +1 -0
- package/dist/bun/BunRoute.js +121 -0
- package/dist/bun/BunRoute.js.map +1 -0
- package/dist/bun/BunRuntime.d.ts +3 -0
- package/dist/bun/BunRuntime.d.ts.map +1 -0
- package/dist/bun/BunRuntime.js +30 -0
- package/dist/bun/BunRuntime.js.map +1 -0
- package/dist/bun/BunServer.d.ts +52 -0
- package/dist/bun/BunServer.d.ts.map +1 -0
- package/dist/bun/BunServer.js +262 -0
- package/dist/bun/BunServer.js.map +1 -0
- package/dist/bun/BunVirtualFilesPlugin.d.ts +5 -0
- package/dist/bun/BunVirtualFilesPlugin.d.ts.map +1 -0
- package/dist/bun/BunVirtualFilesPlugin.js +41 -0
- package/dist/bun/BunVirtualFilesPlugin.js.map +1 -0
- package/dist/bun/_BunEnhancedResolve.d.ts +46 -0
- package/dist/bun/_BunEnhancedResolve.d.ts.map +1 -0
- package/dist/bun/_BunEnhancedResolve.js +103 -0
- package/dist/bun/_BunEnhancedResolve.js.map +1 -0
- package/dist/bun/_empty.html +0 -0
- package/dist/bun/index.d.ts +6 -0
- package/dist/bun/index.d.ts.map +1 -0
- package/dist/bun/index.js +6 -0
- package/dist/bun/index.js.map +1 -0
- package/dist/bundler/Bundle.d.ts +62 -0
- package/dist/bundler/Bundle.d.ts.map +1 -0
- package/dist/bundler/Bundle.js +49 -0
- package/dist/bundler/Bundle.js.map +1 -0
- package/dist/bundler/BundleFiles.d.ts +14 -0
- package/dist/bundler/BundleFiles.d.ts.map +1 -0
- package/dist/bundler/BundleFiles.js +97 -0
- package/dist/bundler/BundleFiles.js.map +1 -0
- package/dist/bundler/BundleRoute.d.ts +28 -0
- package/dist/bundler/BundleRoute.d.ts.map +1 -0
- package/dist/bundler/BundleRoute.js +52 -0
- package/dist/bundler/BundleRoute.js.map +1 -0
- 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.d.ts +3 -0
- package/dist/client/Overlay.d.ts.map +1 -0
- package/dist/client/Overlay.js +33 -0
- package/dist/client/Overlay.js.map +1 -0
- package/dist/client/ScrollState.d.ts +7 -0
- package/dist/client/ScrollState.d.ts.map +1 -0
- package/dist/client/ScrollState.js +95 -0
- package/dist/client/ScrollState.js.map +1 -0
- package/dist/client/index.d.ts +7 -0
- package/dist/client/index.d.ts.map +1 -0
- package/dist/client/index.js +80 -0
- package/dist/client/index.js.map +1 -0
- package/dist/datastar/actions/fetch.d.ts +31 -0
- package/dist/datastar/actions/fetch.d.ts.map +1 -0
- package/dist/datastar/actions/fetch.js +404 -0
- package/dist/datastar/actions/fetch.js.map +1 -0
- package/dist/datastar/actions/peek.d.ts +2 -0
- package/dist/datastar/actions/peek.d.ts.map +1 -0
- package/dist/datastar/actions/peek.js +14 -0
- package/dist/datastar/actions/peek.js.map +1 -0
- package/dist/datastar/actions/setAll.d.ts +2 -0
- package/dist/datastar/actions/setAll.d.ts.map +1 -0
- package/dist/datastar/actions/setAll.js +13 -0
- package/dist/datastar/actions/setAll.js.map +1 -0
- package/dist/datastar/actions/toggleAll.d.ts +2 -0
- package/dist/datastar/actions/toggleAll.d.ts.map +1 -0
- package/dist/datastar/actions/toggleAll.js +13 -0
- package/dist/datastar/actions/toggleAll.js.map +1 -0
- package/dist/datastar/attributes/attr.d.ts +2 -0
- package/dist/datastar/attributes/attr.d.ts.map +1 -0
- package/dist/datastar/attributes/attr.js +49 -0
- package/dist/datastar/attributes/attr.js.map +1 -0
- package/dist/datastar/attributes/bind.d.ts +2 -0
- package/dist/datastar/attributes/bind.d.ts.map +1 -0
- package/dist/datastar/attributes/bind.js +176 -0
- package/dist/datastar/attributes/bind.js.map +1 -0
- package/dist/datastar/attributes/class.d.ts +2 -0
- package/dist/datastar/attributes/class.d.ts.map +1 -0
- package/dist/datastar/attributes/class.js +48 -0
- package/dist/datastar/attributes/class.js.map +1 -0
- package/dist/datastar/attributes/computed.d.ts +2 -0
- package/dist/datastar/attributes/computed.d.ts.map +1 -0
- package/dist/datastar/attributes/computed.js +27 -0
- package/dist/datastar/attributes/computed.js.map +1 -0
- package/dist/datastar/attributes/effect.d.ts +2 -0
- package/dist/datastar/attributes/effect.d.ts.map +1 -0
- package/dist/datastar/attributes/effect.js +10 -0
- package/dist/datastar/attributes/effect.js.map +1 -0
- package/dist/datastar/attributes/indicator.d.ts +2 -0
- package/dist/datastar/attributes/indicator.d.ts.map +1 -0
- package/dist/datastar/attributes/indicator.js +31 -0
- package/dist/datastar/attributes/indicator.js.map +1 -0
- package/dist/datastar/attributes/init.d.ts +2 -0
- package/dist/datastar/attributes/init.d.ts.map +1 -0
- package/dist/datastar/attributes/init.js +27 -0
- package/dist/datastar/attributes/init.js.map +1 -0
- package/dist/datastar/attributes/jsonSignals.d.ts +2 -0
- package/dist/datastar/attributes/jsonSignals.d.ts.map +1 -0
- package/dist/datastar/attributes/jsonSignals.js +31 -0
- package/dist/datastar/attributes/jsonSignals.js.map +1 -0
- package/dist/datastar/attributes/on.d.ts +2 -0
- package/dist/datastar/attributes/on.d.ts.map +1 -0
- package/dist/datastar/attributes/on.js +79 -0
- package/dist/datastar/attributes/on.js.map +1 -0
- package/dist/datastar/attributes/onIntersect.d.ts +2 -0
- package/dist/datastar/attributes/onIntersect.d.ts.map +1 -0
- package/dist/datastar/attributes/onIntersect.js +54 -0
- package/dist/datastar/attributes/onIntersect.js.map +1 -0
- package/dist/datastar/attributes/onInterval.d.ts +2 -0
- package/dist/datastar/attributes/onInterval.d.ts.map +1 -0
- package/dist/datastar/attributes/onInterval.js +31 -0
- package/dist/datastar/attributes/onInterval.js.map +1 -0
- package/dist/datastar/attributes/onSignalPatch.d.ts +2 -0
- package/dist/datastar/attributes/onSignalPatch.d.ts.map +1 -0
- package/dist/datastar/attributes/onSignalPatch.js +43 -0
- package/dist/datastar/attributes/onSignalPatch.js.map +1 -0
- package/dist/datastar/attributes/ref.d.ts +2 -0
- package/dist/datastar/attributes/ref.d.ts.map +1 -0
- package/dist/datastar/attributes/ref.js +11 -0
- package/dist/datastar/attributes/ref.js.map +1 -0
- package/dist/datastar/attributes/show.d.ts +2 -0
- package/dist/datastar/attributes/show.d.ts.map +1 -0
- package/dist/datastar/attributes/show.js +32 -0
- package/dist/datastar/attributes/show.js.map +1 -0
- package/dist/datastar/attributes/signals.d.ts +2 -0
- package/dist/datastar/attributes/signals.d.ts.map +1 -0
- package/dist/datastar/attributes/signals.js +18 -0
- package/dist/datastar/attributes/signals.js.map +1 -0
- package/dist/datastar/attributes/style.d.ts +2 -0
- package/dist/datastar/attributes/style.d.ts.map +1 -0
- package/dist/datastar/attributes/style.js +51 -0
- package/dist/datastar/attributes/style.js.map +1 -0
- package/dist/datastar/attributes/text.d.ts +2 -0
- package/dist/datastar/attributes/text.d.ts.map +1 -0
- package/dist/datastar/attributes/text.js +27 -0
- package/dist/datastar/attributes/text.js.map +1 -0
- package/dist/datastar/engine.d.ts +163 -0
- package/dist/datastar/engine.d.ts.map +1 -0
- package/dist/datastar/engine.js +1000 -0
- package/dist/datastar/engine.js.map +1 -0
- package/dist/datastar/index.d.ts +25 -0
- package/dist/datastar/index.d.ts.map +1 -0
- package/dist/datastar/index.js +25 -0
- package/dist/datastar/index.js.map +1 -0
- package/dist/datastar/utils.d.ts +52 -0
- package/dist/datastar/utils.d.ts.map +1 -0
- package/dist/datastar/utils.js +203 -0
- package/dist/datastar/utils.js.map +1 -0
- package/dist/datastar/watchers/patchElements.d.ts +2 -0
- package/dist/datastar/watchers/patchElements.d.ts.map +1 -0
- package/dist/datastar/watchers/patchElements.js +400 -0
- package/dist/datastar/watchers/patchElements.js.map +1 -0
- package/dist/datastar/watchers/patchSignals.d.ts +2 -0
- package/dist/datastar/watchers/patchSignals.d.ts.map +1 -0
- package/dist/datastar/watchers/patchSignals.js +15 -0
- package/dist/datastar/watchers/patchSignals.js.map +1 -0
- package/dist/experimental/EncryptedCookies.d.ts +49 -0
- package/dist/experimental/EncryptedCookies.d.ts.map +1 -0
- package/dist/experimental/EncryptedCookies.js +213 -0
- package/dist/experimental/EncryptedCookies.js.map +1 -0
- package/dist/experimental/index.d.ts +2 -0
- package/dist/experimental/index.d.ts.map +1 -0
- package/dist/experimental/index.js +2 -0
- package/dist/experimental/index.js.map +1 -0
- package/dist/hyper/Hyper.d.ts +26 -0
- package/dist/hyper/Hyper.d.ts.map +1 -0
- package/dist/hyper/Hyper.js +24 -0
- package/dist/hyper/Hyper.js.map +1 -0
- package/dist/hyper/HyperHtml.d.ts +24 -0
- package/dist/hyper/HyperHtml.d.ts.map +1 -0
- package/dist/hyper/HyperHtml.js +153 -0
- package/dist/hyper/HyperHtml.js.map +1 -0
- package/dist/hyper/HyperHtml.test.d.ts +2 -0
- package/dist/hyper/HyperHtml.test.d.ts.map +1 -0
- package/dist/hyper/HyperHtml.test.js +283 -0
- package/dist/hyper/HyperHtml.test.js.map +1 -0
- package/dist/hyper/HyperNode.d.ts +14 -0
- package/dist/hyper/HyperNode.d.ts.map +1 -0
- package/dist/hyper/HyperNode.js +12 -0
- package/dist/hyper/HyperNode.js.map +1 -0
- package/dist/hyper/HyperRoute.d.ts +9 -0
- package/dist/hyper/HyperRoute.d.ts.map +1 -0
- package/dist/hyper/HyperRoute.js +33 -0
- package/dist/hyper/HyperRoute.js.map +1 -0
- package/dist/hyper/HyperRoute.test.d.ts +2 -0
- package/dist/hyper/HyperRoute.test.d.ts.map +1 -0
- package/dist/hyper/HyperRoute.test.js +84 -0
- package/dist/hyper/HyperRoute.test.js.map +1 -0
- package/dist/hyper/html.d.ts +12 -0
- package/dist/hyper/html.d.ts.map +1 -0
- package/dist/hyper/html.js +31 -0
- package/dist/hyper/html.js.map +1 -0
- package/dist/hyper/index.d.ts +7 -0
- package/dist/hyper/index.d.ts.map +1 -0
- package/dist/hyper/index.js +6 -0
- package/dist/hyper/index.js.map +1 -0
- package/dist/hyper/jsx-runtime.d.ts +8 -0
- package/dist/hyper/jsx-runtime.d.ts.map +1 -0
- package/dist/hyper/jsx-runtime.js +9 -0
- package/dist/hyper/jsx-runtime.js.map +1 -0
- package/dist/index.d.ts +9 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +9 -0
- package/dist/index.js.map +1 -0
- package/dist/lint/plugin.d.ts +124 -0
- package/dist/lint/plugin.d.ts.map +1 -0
- package/dist/lint/plugin.js +533 -0
- package/dist/lint/plugin.js.map +1 -0
- package/dist/node/NodeFileSystem.d.ts +8 -0
- package/dist/node/NodeFileSystem.d.ts.map +1 -0
- package/dist/node/NodeFileSystem.js +412 -0
- package/dist/node/NodeFileSystem.js.map +1 -0
- package/dist/node/NodeUtils.d.ts +3 -0
- package/dist/node/NodeUtils.d.ts.map +1 -0
- package/dist/node/NodeUtils.js +21 -0
- package/dist/node/NodeUtils.js.map +1 -0
- package/dist/sql/SqlCache.d.ts +19 -0
- package/dist/sql/SqlCache.d.ts.map +1 -0
- package/dist/sql/SqlCache.js +35 -0
- package/dist/sql/SqlCache.js.map +1 -0
- package/dist/sql/SqlClient.d.ts +88 -0
- package/dist/sql/SqlClient.d.ts.map +1 -0
- package/dist/sql/SqlClient.js +171 -0
- package/dist/sql/SqlClient.js.map +1 -0
- package/dist/sql/SqlIntrospect.d.ts +92 -0
- package/dist/sql/SqlIntrospect.d.ts.map +1 -0
- package/dist/sql/SqlIntrospect.js +478 -0
- package/dist/sql/SqlIntrospect.js.map +1 -0
- package/dist/sql/bun/index.d.ts +6 -0
- package/dist/sql/bun/index.d.ts.map +1 -0
- package/dist/sql/bun/index.js +132 -0
- package/dist/sql/bun/index.js.map +1 -0
- package/dist/sql/index.d.ts +4 -0
- package/dist/sql/index.d.ts.map +1 -0
- package/dist/sql/index.js +4 -0
- package/dist/sql/index.js.map +1 -0
- package/dist/sql/libsql/index.d.ts +15 -0
- package/dist/sql/libsql/index.d.ts.map +1 -0
- package/dist/sql/libsql/index.js +132 -0
- package/dist/sql/libsql/index.js.map +1 -0
- package/dist/sql/mssql/index.d.ts +8 -0
- package/dist/sql/mssql/index.d.ts.map +1 -0
- package/dist/sql/mssql/index.js +145 -0
- package/dist/sql/mssql/index.js.map +1 -0
- package/dist/sql/postgres/index.d.ts +7 -0
- package/dist/sql/postgres/index.d.ts.map +1 -0
- package/dist/sql/postgres/index.js +136 -0
- package/dist/sql/postgres/index.js.map +1 -0
- package/dist/studio/Simulation.d.ts +3 -0
- package/dist/studio/Simulation.d.ts.map +1 -0
- package/dist/studio/Simulation.js +606 -0
- package/dist/studio/Simulation.js.map +1 -0
- package/dist/studio/Studio.d.ts +11 -0
- 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/studio/StudioErrors.js +200 -0
- package/dist/studio/StudioErrors.js.map +1 -0
- package/dist/studio/StudioLogger.d.ts +2 -0
- package/dist/studio/StudioLogger.d.ts.map +1 -0
- package/dist/studio/StudioLogger.js +46 -0
- 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/studio/StudioMetrics.js +62 -0
- 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/studio/StudioProcess.js +50 -0
- package/dist/studio/StudioProcess.js.map +1 -0
- package/dist/studio/StudioStore.d.ts +199 -0
- package/dist/studio/StudioStore.d.ts.map +1 -0
- package/dist/studio/StudioStore.js +307 -0
- 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/studio/StudioTracer.js +111 -0
- 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/studio/routes/errors/route.d.ts +11 -0
- package/dist/studio/routes/errors/route.d.ts.map +1 -0
- package/dist/studio/routes/errors/route.js +43 -0
- package/dist/studio/routes/errors/route.js.map +1 -0
- package/dist/studio/routes/fiberDetail.d.ts +17 -0
- package/dist/studio/routes/fiberDetail.d.ts.map +1 -0
- package/dist/studio/routes/fiberDetail.js +35 -0
- package/dist/studio/routes/fiberDetail.js.map +1 -0
- package/dist/studio/routes/fibers/route.d.ts +11 -0
- package/dist/studio/routes/fibers/route.d.ts.map +1 -0
- package/dist/studio/routes/fibers/route.js +25 -0
- package/dist/studio/routes/fibers/route.js.map +1 -0
- package/dist/studio/routes/layout.d.ts +10 -0
- package/dist/studio/routes/layout.d.ts.map +1 -0
- package/dist/studio/routes/layout.html +340 -0
- package/dist/studio/routes/layout.js +4 -0
- package/dist/studio/routes/layout.js.map +1 -0
- package/dist/studio/routes/logs/route.d.ts +11 -0
- package/dist/studio/routes/logs/route.d.ts.map +1 -0
- package/dist/studio/routes/logs/route.js +30 -0
- package/dist/studio/routes/logs/route.js.map +1 -0
- package/dist/studio/routes/metrics/route.d.ts +11 -0
- package/dist/studio/routes/metrics/route.d.ts.map +1 -0
- package/dist/studio/routes/metrics/route.js +18 -0
- package/dist/studio/routes/metrics/route.js.map +1 -0
- package/dist/studio/routes/route.d.ts +7 -0
- 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/studio/routes/routes/route.d.ts +7 -0
- package/dist/studio/routes/routes/route.d.ts.map +1 -0
- package/dist/studio/routes/routes/route.js +21 -0
- package/dist/studio/routes/routes/route.js.map +1 -0
- package/dist/studio/routes/services/route.d.ts +7 -0
- package/dist/studio/routes/services/route.d.ts.map +1 -0
- package/dist/studio/routes/services/route.js +13 -0
- package/dist/studio/routes/services/route.js.map +1 -0
- package/dist/studio/routes/system/route.d.ts +11 -0
- package/dist/studio/routes/system/route.d.ts.map +1 -0
- package/dist/studio/routes/system/route.js +19 -0
- package/dist/studio/routes/system/route.js.map +1 -0
- package/dist/studio/routes/traceDetail.d.ts +17 -0
- package/dist/studio/routes/traceDetail.d.ts.map +1 -0
- package/dist/studio/routes/traceDetail.js +20 -0
- package/dist/studio/routes/traceDetail.js.map +1 -0
- package/dist/studio/routes/traces/route.d.ts +11 -0
- package/dist/studio/routes/traces/route.d.ts.map +1 -0
- package/dist/studio/routes/traces/route.js +30 -0
- package/dist/studio/routes/traces/route.js.map +1 -0
- package/dist/studio/routes/tree.d.ts +142 -0
- package/dist/studio/routes/tree.d.ts.map +1 -0
- package/dist/studio/routes/tree.js +28 -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/studio/ui/Fibers.d.ts +25 -0
- 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/studio/ui/Logs.js +27 -0
- 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/studio/ui/Metrics.js +27 -0
- package/dist/studio/ui/Metrics.js.map +1 -0
- package/dist/studio/ui/Routes.d.ts +9 -0
- package/dist/studio/ui/Routes.d.ts.map +1 -0
- package/dist/studio/ui/Routes.js +71 -0
- package/dist/studio/ui/Routes.js.map +1 -0
- package/dist/studio/ui/Services.d.ts +11 -0
- package/dist/studio/ui/Services.d.ts.map +1 -0
- package/dist/studio/ui/Services.js +247 -0
- package/dist/studio/ui/Services.js.map +1 -0
- package/dist/studio/ui/Shell.d.ts +11 -0
- 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/testing/TestLogger.d.ts +14 -0
- package/dist/testing/TestLogger.d.ts.map +1 -0
- package/dist/testing/TestLogger.js +33 -0
- package/dist/testing/TestLogger.js.map +1 -0
- package/dist/testing/index.d.ts +3 -0
- package/dist/testing/index.d.ts.map +1 -0
- package/dist/testing/index.js +3 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/testing/utils.d.ts +12 -0
- package/dist/testing/utils.d.ts.map +1 -0
- package/dist/testing/utils.js +79 -0
- package/dist/testing/utils.js.map +1 -0
- package/dist/x/cloudflare/CloudflareTunnel.d.ts +12 -0
- package/dist/x/cloudflare/CloudflareTunnel.d.ts.map +1 -0
- package/dist/x/cloudflare/CloudflareTunnel.js +31 -0
- package/dist/x/cloudflare/CloudflareTunnel.js.map +1 -0
- package/dist/x/cloudflare/index.d.ts +2 -0
- package/dist/x/cloudflare/index.d.ts.map +1 -0
- package/dist/x/cloudflare/index.js +2 -0
- package/dist/x/cloudflare/index.js.map +1 -0
- package/dist/x/tailscale/TailscaleTunnel.d.ts +16 -0
- package/dist/x/tailscale/TailscaleTunnel.d.ts.map +1 -0
- package/dist/x/tailscale/TailscaleTunnel.js +65 -0
- package/dist/x/tailscale/TailscaleTunnel.js.map +1 -0
- package/dist/x/tailscale/index.d.ts +2 -0
- package/dist/x/tailscale/index.d.ts.map +1 -0
- package/dist/x/tailscale/index.js +2 -0
- package/dist/x/tailscale/index.js.map +1 -0
- package/dist/x/tailwind/TailwindPlugin.d.ts +24 -0
- package/dist/x/tailwind/TailwindPlugin.d.ts.map +1 -0
- package/dist/x/tailwind/TailwindPlugin.js +220 -0
- package/dist/x/tailwind/TailwindPlugin.js.map +1 -0
- package/dist/x/tailwind/compile.d.ts +20 -0
- package/dist/x/tailwind/compile.d.ts.map +1 -0
- package/dist/x/tailwind/compile.js +155 -0
- package/dist/x/tailwind/compile.js.map +1 -0
- package/dist/x/tailwind/plugin.d.ts +3 -0
- package/dist/x/tailwind/plugin.d.ts.map +1 -0
- package/dist/x/tailwind/plugin.js +16 -0
- package/dist/x/tailwind/plugin.js.map +1 -0
- package/package.json +89 -26
- package/src/Cookies.ts +4 -8
- package/src/Entity.ts +24 -19
- package/src/Fetch.ts +128 -5
- package/src/FileRouter.ts +46 -49
- package/src/FileRouterCodegen.ts +9 -23
- package/src/FileSystem.ts +44 -67
- package/src/GlobalLayer.ts +85 -0
- package/src/PlatformRuntime.ts +8 -1
- package/src/Route.ts +2 -2
- package/src/RouteBody.ts +1 -1
- package/src/RouteHook.ts +1 -1
- package/src/RouteHttp.ts +133 -113
- package/src/RouteMount.ts +3 -3
- 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 +67 -64
- package/src/System.ts +42 -9
- package/src/Unique.ts +59 -0
- package/src/{ChildProcess.ts → _ChildProcess.ts} +16 -28
- package/src/{Development.ts → _Development.ts} +16 -21
- package/src/_Docker.ts +190 -0
- package/src/{Effectify.ts → _Effectify.ts} +7 -10
- 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 +10 -17
- package/src/bun/BunRoute.ts +6 -8
- package/src/bun/BunRuntime.ts +2 -8
- package/src/bun/BunServer.ts +57 -5
- 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/datastar/watchers/patchElements.ts +3 -2
- package/src/hyper/HyperHtml.test.tsx +395 -0
- package/src/hyper/HyperNode.ts +1 -2
- package/src/hyper/HyperRoute.test.tsx +166 -0
- package/src/hyper/HyperRoute.ts +1 -1
- package/src/index.ts +1 -1
- package/src/lint/plugin.js +179 -125
- package/src/node/NodeFileSystem.ts +15 -14
- package/src/sql/SqlCache.ts +63 -0
- package/src/sql/SqlClient.ts +60 -15
- package/src/{SqlIntrospect.ts → sql/SqlIntrospect.ts} +13 -11
- package/src/sql/bun/index.ts +29 -27
- package/src/sql/index.ts +2 -0
- package/src/sql/libsql/index.ts +63 -29
- package/src/sql/mssql/index.ts +54 -58
- package/src/sql/postgres/index.ts +254 -0
- package/src/studio/Simulation.ts +776 -0
- package/src/studio/Studio.ts +47 -0
- package/src/studio/StudioErrors.ts +224 -0
- package/src/studio/StudioLogger.ts +52 -0
- package/src/studio/StudioMetrics.ts +72 -0
- package/src/studio/StudioProcess.ts +59 -0
- package/src/studio/StudioStore.ts +505 -0
- package/src/studio/StudioTracer.ts +128 -0
- package/src/studio/index.ts +3 -0
- package/src/studio/routes/errors/route.tsx +90 -0
- package/src/studio/routes/fiberDetail.tsx +51 -0
- package/src/studio/routes/fibers/route.tsx +46 -0
- package/src/studio/routes/layout.html +340 -0
- package/src/studio/routes/layout.tsx +4 -0
- package/src/studio/routes/logs/route.tsx +73 -0
- package/src/studio/routes/metrics/route.tsx +36 -0
- package/src/studio/routes/route.tsx +8 -0
- package/src/studio/routes/routes/route.tsx +30 -0
- package/src/studio/routes/services/route.tsx +21 -0
- package/src/studio/routes/system/route.tsx +43 -0
- package/src/studio/routes/traceDetail.tsx +30 -0
- package/src/studio/routes/traces/route.tsx +72 -0
- package/src/studio/routes/tree.ts +28 -0
- package/src/studio/ui/Errors.tsx +80 -0
- package/src/studio/ui/Fibers.tsx +336 -0
- package/src/studio/ui/Logs.tsx +50 -0
- package/src/studio/ui/Metrics.tsx +78 -0
- package/src/studio/ui/Routes.tsx +125 -0
- package/src/studio/ui/Services.tsx +273 -0
- package/src/studio/ui/Shell.tsx +74 -0
- package/src/studio/ui/System.tsx +141 -0
- package/src/studio/ui/Traces.tsx +419 -0
- package/src/testing/utils.ts +59 -0
- package/src/x/cloudflare/CloudflareTunnel.ts +1 -1
- package/src/x/tailscale/TailscaleTunnel.ts +6 -7
- package/src/x/tailwind/compile.ts +6 -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/sql/mssql/docker.ts +0 -117
- /package/src/{ContentNegotiation.ts → _ContentNegotiation.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/package.json
CHANGED
|
@@ -1,59 +1,122 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "effect-start",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.29.0",
|
|
4
4
|
"license": "MIT",
|
|
5
5
|
"files": [
|
|
6
6
|
"src/",
|
|
7
|
-
"!src/**/*.test.ts",
|
|
8
|
-
"!src/**/*.test.tsx",
|
|
9
|
-
"!src/tower",
|
|
10
7
|
"dist/",
|
|
11
8
|
"README.md",
|
|
12
9
|
"package.json"
|
|
13
10
|
],
|
|
14
11
|
"type": "module",
|
|
15
12
|
"exports": {
|
|
16
|
-
".":
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
"./tower": "./src/tower/index.ts",
|
|
21
|
-
"./sql": "./src/sql/index.ts",
|
|
22
|
-
"./sql/*": "./src/sql/*/index.ts",
|
|
23
|
-
"./x/*": "./src/x/*/index.ts",
|
|
24
|
-
"./x/tailwind/plugin": "./src/x/tailwind/plugin.ts",
|
|
25
|
-
"./System": "./src/System.ts",
|
|
26
|
-
"./Unique": "./src/Unique.ts",
|
|
27
|
-
"./FileRouter": "./src/FileRouter.ts",
|
|
28
|
-
"./FileSystem": "./src/FileSystem.ts",
|
|
29
|
-
"./experimental": "./src/experimental/index.ts",
|
|
13
|
+
".": {
|
|
14
|
+
"source": "./src/index.ts",
|
|
15
|
+
"default": "./dist/index.js"
|
|
16
|
+
},
|
|
30
17
|
"./client/assets.d.ts": "./src/assets.d.ts",
|
|
31
|
-
"./
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
"./
|
|
18
|
+
"./jsx-runtime": {
|
|
19
|
+
"source": "./src/hyper/jsx-runtime.ts",
|
|
20
|
+
"default": "./dist/hyper/jsx-runtime.js"
|
|
21
|
+
},
|
|
22
|
+
"./jsx-dev-runtime": {
|
|
23
|
+
"source": "./src/hyper/jsx-runtime.ts",
|
|
24
|
+
"default": "./dist/hyper/jsx-runtime.js"
|
|
25
|
+
},
|
|
26
|
+
"./lint/plugin": {
|
|
27
|
+
"source": "./src/lint/plugin.js",
|
|
28
|
+
"default": "./dist/lint/plugin.js"
|
|
29
|
+
},
|
|
30
|
+
"./x/*": {
|
|
31
|
+
"source": "./src/x/*/index.ts",
|
|
32
|
+
"default": "./dist/x/*/index.js"
|
|
33
|
+
},
|
|
34
|
+
"./x/tailwind/plugin": {
|
|
35
|
+
"source": "./src/x/tailwind/plugin.ts",
|
|
36
|
+
"default": "./dist/x/tailwind/plugin.js"
|
|
37
|
+
},
|
|
38
|
+
"./bun": {
|
|
39
|
+
"source": "./src/bun/index.ts",
|
|
40
|
+
"default": "./dist/bun/index.js"
|
|
41
|
+
},
|
|
42
|
+
"./cli": {
|
|
43
|
+
"source": "./src/cli/index.ts",
|
|
44
|
+
"default": "./dist/cli/index.js"
|
|
45
|
+
},
|
|
46
|
+
"./client": {
|
|
47
|
+
"source": "./src/client/index.ts",
|
|
48
|
+
"default": "./dist/client/index.js"
|
|
49
|
+
},
|
|
50
|
+
"./datastar": {
|
|
51
|
+
"source": "./src/datastar/index.ts",
|
|
52
|
+
"default": "./dist/datastar/index.js"
|
|
53
|
+
},
|
|
54
|
+
"./experimental": {
|
|
55
|
+
"source": "./src/experimental/index.ts",
|
|
56
|
+
"default": "./dist/experimental/index.js"
|
|
57
|
+
},
|
|
58
|
+
"./hyper": {
|
|
59
|
+
"source": "./src/hyper/index.ts",
|
|
60
|
+
"default": "./dist/hyper/index.js"
|
|
61
|
+
},
|
|
62
|
+
"./sql/*": {
|
|
63
|
+
"source": "./src/sql/*/index.ts",
|
|
64
|
+
"default": "./dist/sql/*/index.js"
|
|
65
|
+
},
|
|
66
|
+
"./sql": {
|
|
67
|
+
"source": "./src/sql/index.ts",
|
|
68
|
+
"default": "./dist/sql/index.js"
|
|
69
|
+
},
|
|
70
|
+
"./testing": {
|
|
71
|
+
"source": "./src/testing/index.ts",
|
|
72
|
+
"default": "./dist/testing/index.js"
|
|
73
|
+
},
|
|
74
|
+
"./studio": {
|
|
75
|
+
"source": "./src/studio/index.ts",
|
|
76
|
+
"default": "./dist/studio/index.js"
|
|
77
|
+
},
|
|
78
|
+
"./*": {
|
|
79
|
+
"source": "./src/*.ts",
|
|
80
|
+
"default": "./dist/*.js"
|
|
81
|
+
},
|
|
82
|
+
"./_*": null,
|
|
36
83
|
"./package.json": "./package.json"
|
|
37
84
|
},
|
|
38
85
|
"scripts": {
|
|
39
|
-
"build": "
|
|
86
|
+
"build": "tsc -p tsconfig.build.json && cd src && find . -name '*.html' -exec rsync -R {} ../dist/ \\;",
|
|
40
87
|
"format": "bunx oxfmt",
|
|
41
88
|
"lint": "oxlint --import-plugin --tsconfig tsconfig.json src/",
|
|
42
|
-
"test": "bun test ./
|
|
89
|
+
"test": "bun test ./test/",
|
|
43
90
|
"test-sql": "bun add --no-save mssql @types/mssql postgres && TEST_SQL=1 bun test ./src/sql/",
|
|
91
|
+
"bump": "bun scripts/bump",
|
|
92
|
+
"prepublishOnly": "bun run build",
|
|
44
93
|
"deploy": "bunx --bun npm publish --access public"
|
|
45
94
|
},
|
|
46
95
|
"devDependencies": {
|
|
96
|
+
"@libsql/client": "^0.17.0",
|
|
47
97
|
"@types/bun": "^1.3.4",
|
|
48
98
|
"@types/jsdom": "^27.0.0",
|
|
49
99
|
"effect-memfs": "^0.8.0",
|
|
50
100
|
"jsdom": "^28.0.0",
|
|
101
|
+
"mssql": "^12.2.0",
|
|
51
102
|
"oxfmt": "latest",
|
|
52
103
|
"oxlint": "^1.43.0",
|
|
104
|
+
"postgres": "^3.4.8",
|
|
53
105
|
"tailwindcss": "^4.1.18",
|
|
106
|
+
"ts-morph": "^27.0.2",
|
|
54
107
|
"typescript": "^5.9.3"
|
|
55
108
|
},
|
|
56
109
|
"peerDependencies": {
|
|
57
|
-
"
|
|
110
|
+
"@libsql/client": ">=0.17.0",
|
|
111
|
+
"effect": "^3.19.11",
|
|
112
|
+
"mssql": ">=12.2.0"
|
|
113
|
+
},
|
|
114
|
+
"peerDependenciesMeta": {
|
|
115
|
+
"@libsql/client": {
|
|
116
|
+
"optional": true
|
|
117
|
+
},
|
|
118
|
+
"mssql": {
|
|
119
|
+
"optional": true
|
|
120
|
+
}
|
|
58
121
|
}
|
|
59
122
|
}
|
package/src/Cookies.ts
CHANGED
|
@@ -9,23 +9,19 @@ import * as Pipeable from "effect/Pipeable"
|
|
|
9
9
|
import * as Predicate from "effect/Predicate"
|
|
10
10
|
import type * as Types from "effect/Types"
|
|
11
11
|
|
|
12
|
-
export const TypeId
|
|
13
|
-
|
|
14
|
-
export type TypeId = typeof TypeId
|
|
12
|
+
export const TypeId = "~effect-start/Cookies" as const
|
|
15
13
|
|
|
16
14
|
export const isCookies = (u: unknown): u is Cookies => Predicate.hasProperty(u, TypeId)
|
|
17
15
|
|
|
18
16
|
export interface Cookies extends Pipeable.Pipeable, Inspectable.Inspectable {
|
|
19
|
-
readonly [TypeId]: TypeId
|
|
17
|
+
readonly [TypeId]: typeof TypeId
|
|
20
18
|
readonly cookies: Record<string, Cookie>
|
|
21
19
|
}
|
|
22
20
|
|
|
23
|
-
export const CookieTypeId
|
|
24
|
-
|
|
25
|
-
export type CookieTypeId = typeof CookieTypeId
|
|
21
|
+
export const CookieTypeId = "~effect-start/Cookies/Cookie" as const
|
|
26
22
|
|
|
27
23
|
export interface Cookie extends Inspectable.Inspectable {
|
|
28
|
-
readonly [CookieTypeId]: CookieTypeId
|
|
24
|
+
readonly [CookieTypeId]: typeof CookieTypeId
|
|
29
25
|
readonly name: string
|
|
30
26
|
readonly value: string
|
|
31
27
|
readonly valueEncoded: string
|
package/src/Entity.ts
CHANGED
|
@@ -4,11 +4,10 @@ import * as ParseResult from "effect/ParseResult"
|
|
|
4
4
|
import * as Predicate from "effect/Predicate"
|
|
5
5
|
import * as Schema from "effect/Schema"
|
|
6
6
|
import * as Stream from "effect/Stream"
|
|
7
|
-
import * as StreamExtra from "./
|
|
8
|
-
import * as Values from "./
|
|
7
|
+
import * as StreamExtra from "./_StreamExtra.ts"
|
|
8
|
+
import * as Values from "./_Values.ts"
|
|
9
9
|
|
|
10
|
-
export const TypeId
|
|
11
|
-
export type TypeId = typeof TypeId
|
|
10
|
+
export const TypeId = "~effect-start/Entity" as const
|
|
12
11
|
|
|
13
12
|
const textDecoder = new TextDecoder()
|
|
14
13
|
const textEncoder = new TextEncoder()
|
|
@@ -25,7 +24,7 @@ export type Headers = {
|
|
|
25
24
|
}
|
|
26
25
|
|
|
27
26
|
export interface Entity<T = unknown, E = never> extends Effect.Effect<Entity<T, E>, E> {
|
|
28
|
-
readonly [TypeId]: TypeId
|
|
27
|
+
readonly [TypeId]: typeof TypeId
|
|
29
28
|
readonly body: T
|
|
30
29
|
readonly headers: Headers
|
|
31
30
|
/**
|
|
@@ -58,7 +57,7 @@ export interface Entity<T = unknown, E = never> extends Effect.Effect<Entity<T,
|
|
|
58
57
|
}
|
|
59
58
|
|
|
60
59
|
export interface Proto extends Effect.Effect<Entity, never> {
|
|
61
|
-
readonly [TypeId]: TypeId
|
|
60
|
+
readonly [TypeId]: typeof TypeId
|
|
62
61
|
}
|
|
63
62
|
|
|
64
63
|
function parseJson(s: string): Effect.Effect<unknown, ParseResult.ParseError> {
|
|
@@ -325,21 +324,27 @@ export function length(self: Entity): number | undefined {
|
|
|
325
324
|
return undefined
|
|
326
325
|
}
|
|
327
326
|
|
|
328
|
-
export function fromResponse(
|
|
327
|
+
export function fromResponse<E extends Error = Error>(
|
|
329
328
|
response: Response,
|
|
330
329
|
request?: Request,
|
|
331
|
-
): Entity<
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
330
|
+
): Entity<Stream.Stream<Uint8Array, E, never>, E> {
|
|
331
|
+
const body = response.body
|
|
332
|
+
? Stream.fromReadableStream(
|
|
333
|
+
() => response.body!,
|
|
334
|
+
(e) => (e instanceof Error ? e : new Error(String(e))) as E,
|
|
335
|
+
)
|
|
336
|
+
: Stream.fromEffect(
|
|
337
|
+
Effect.tryPromise({
|
|
338
|
+
try: () => response.arrayBuffer().then((buf) => new Uint8Array(buf)),
|
|
339
|
+
catch: (e) => (e instanceof Error ? e : new Error(String(e))) as E,
|
|
340
|
+
}),
|
|
341
|
+
)
|
|
342
|
+
|
|
343
|
+
return make(body, {
|
|
344
|
+
headers: Object.fromEntries(response.headers.entries()),
|
|
345
|
+
status: response.status,
|
|
346
|
+
url: response.url || request?.url,
|
|
347
|
+
})
|
|
343
348
|
}
|
|
344
349
|
|
|
345
350
|
function mismatch(expected: Schema.Schema.Any, actual: unknown): ParseResult.ParseError {
|
package/src/Fetch.ts
CHANGED
|
@@ -1,12 +1,13 @@
|
|
|
1
1
|
import * as Data from "effect/Data"
|
|
2
2
|
import * as Effect from "effect/Effect"
|
|
3
3
|
import * as Schedule from "effect/Schedule"
|
|
4
|
+
import * as Stream from "effect/Stream"
|
|
4
5
|
import * as Entity from "./Entity.ts"
|
|
6
|
+
import * as Values from "./_Values.ts"
|
|
5
7
|
|
|
6
|
-
const TypeId
|
|
7
|
-
type TypeId = typeof TypeId
|
|
8
|
+
const TypeId = "~effect-start/FetchClient" as const
|
|
8
9
|
|
|
9
|
-
export type FetchEntity = Entity.Entity<
|
|
10
|
+
export type FetchEntity = Entity.Entity<Stream.Stream<Uint8Array, FetchError, never>, FetchError>
|
|
10
11
|
|
|
11
12
|
export class FetchError extends Data.TaggedError("FetchError")<{
|
|
12
13
|
readonly reason: "Network" | "Status"
|
|
@@ -28,7 +29,7 @@ const tryFetch: Middleware = (request) =>
|
|
|
28
29
|
try: () => globalThis.fetch(request),
|
|
29
30
|
catch: (e) => new FetchError({ reason: "Network", cause: e, request }),
|
|
30
31
|
}),
|
|
31
|
-
(response) => Entity.fromResponse(response, request)
|
|
32
|
+
(response) => Entity.fromResponse<FetchError>(response, request),
|
|
32
33
|
)
|
|
33
34
|
|
|
34
35
|
const defaultMiddleware: ReadonlyArray<Middleware> = [tryFetch]
|
|
@@ -64,7 +65,7 @@ function withTrace<E, R>(
|
|
|
64
65
|
}
|
|
65
66
|
|
|
66
67
|
export interface FetchClient<E = never, R = never> {
|
|
67
|
-
readonly [TypeId]: TypeId
|
|
68
|
+
readonly [TypeId]: typeof TypeId
|
|
68
69
|
readonly middleware: ReadonlyArray<Middleware<any, any>>
|
|
69
70
|
readonly fetch: (
|
|
70
71
|
input: string | URL | Request,
|
|
@@ -172,6 +173,46 @@ const ClientProto: any = {
|
|
|
172
173
|
use,
|
|
173
174
|
}
|
|
174
175
|
|
|
176
|
+
type WebHandler = (request: Request) => Response | Promise<Response>
|
|
177
|
+
|
|
178
|
+
type FromHandlerInit = Omit<RequestInit, "body"> &
|
|
179
|
+
({ url: string } | { path: `/${string}` }) & {
|
|
180
|
+
body?: RequestInit["body"] | Record<string, unknown>
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
export function fromHandler(handler: WebHandler): FetchClient
|
|
184
|
+
export function fromHandler(handler: WebHandler, init: FromHandlerInit): Promise<Response>
|
|
185
|
+
export function fromHandler(
|
|
186
|
+
handler: WebHandler,
|
|
187
|
+
init?: FromHandlerInit,
|
|
188
|
+
): FetchClient | Promise<Response> {
|
|
189
|
+
if (init === undefined) {
|
|
190
|
+
const transport: Middleware = (request) =>
|
|
191
|
+
Effect.map(
|
|
192
|
+
Effect.tryPromise({
|
|
193
|
+
try: () => Promise.resolve(handler(request)),
|
|
194
|
+
catch: (e) => new FetchError({ reason: "Network", cause: e, request }),
|
|
195
|
+
}),
|
|
196
|
+
(response) => Entity.fromResponse<FetchError>(response, request),
|
|
197
|
+
)
|
|
198
|
+
return use(transport)
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
const url = "path" in init ? `http://localhost${init.path}` : init.url
|
|
202
|
+
const isPlain = Values.isPlainObject(init.body)
|
|
203
|
+
const headers = new Headers(init.headers)
|
|
204
|
+
if (isPlain && !headers.has("Content-Type")) {
|
|
205
|
+
headers.set("Content-Type", "application/json")
|
|
206
|
+
}
|
|
207
|
+
const body = isPlain ? JSON.stringify(init.body) : init.body
|
|
208
|
+
const request = new Request(url, {
|
|
209
|
+
...init,
|
|
210
|
+
headers,
|
|
211
|
+
body: body as BodyInit,
|
|
212
|
+
})
|
|
213
|
+
return Promise.resolve(handler(request))
|
|
214
|
+
}
|
|
215
|
+
|
|
175
216
|
export function filterStatus(
|
|
176
217
|
predicate: (status: number) => boolean,
|
|
177
218
|
options?: {
|
|
@@ -269,3 +310,85 @@ export function retry(options: {
|
|
|
269
310
|
)
|
|
270
311
|
}) as Middleware
|
|
271
312
|
}
|
|
313
|
+
|
|
314
|
+
interface SseEvent {
|
|
315
|
+
data?: string | undefined
|
|
316
|
+
type?: string
|
|
317
|
+
retry?: number
|
|
318
|
+
id?: string
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export function sse(_options?: {
|
|
322
|
+
readonly retry?: Schedule.Schedule<any, any, any>
|
|
323
|
+
}): (entity: FetchEntity) => Stream.Stream<SseEvent, FetchError> {
|
|
324
|
+
return (entity) => {
|
|
325
|
+
const contentType = entity.headers["content-type"] ?? ""
|
|
326
|
+
if (!contentType.includes("text/event-stream")) {
|
|
327
|
+
return Stream.fail(
|
|
328
|
+
new FetchError({
|
|
329
|
+
reason: "Status",
|
|
330
|
+
cause: new Error(`Expected content-type text/event-stream, got: ${contentType}`),
|
|
331
|
+
response: entity,
|
|
332
|
+
}),
|
|
333
|
+
)
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
const byteStream = entity.body as Stream.Stream<Uint8Array, FetchError, never>
|
|
337
|
+
const decoder = new TextDecoder()
|
|
338
|
+
const empty = {
|
|
339
|
+
partial: "",
|
|
340
|
+
eventType: undefined as string | undefined,
|
|
341
|
+
dataLines: [] as Array<string>,
|
|
342
|
+
retryMs: undefined as number | undefined,
|
|
343
|
+
lastEventId: undefined as string | undefined,
|
|
344
|
+
}
|
|
345
|
+
type Acc = typeof empty
|
|
346
|
+
|
|
347
|
+
return byteStream.pipe(
|
|
348
|
+
Stream.mapAccum(empty, (acc, chunk: Uint8Array): [Acc, Array<string>] => {
|
|
349
|
+
const text = acc.partial + decoder.decode(chunk, { stream: true })
|
|
350
|
+
const parts = text.split("\n")
|
|
351
|
+
const partial = parts.pop()!
|
|
352
|
+
const lines = parts.map((l) => (l.endsWith("\r") ? l.slice(0, -1) : l))
|
|
353
|
+
return [{ ...acc, partial }, lines]
|
|
354
|
+
}),
|
|
355
|
+
Stream.flatMap(Stream.fromIterable),
|
|
356
|
+
Stream.mapAccum(empty, (acc, line: string): [Acc, SseEvent | undefined] => {
|
|
357
|
+
if (line === "") {
|
|
358
|
+
if (acc.dataLines.length > 0) {
|
|
359
|
+
const event: SseEvent = { data: acc.dataLines.join("\n") }
|
|
360
|
+
if (acc.eventType !== undefined) event.type = acc.eventType
|
|
361
|
+
if (acc.retryMs !== undefined) event.retry = acc.retryMs
|
|
362
|
+
if (acc.lastEventId !== undefined) event.id = acc.lastEventId
|
|
363
|
+
return [{ ...empty, lastEventId: acc.lastEventId }, event]
|
|
364
|
+
}
|
|
365
|
+
return [{ ...empty, lastEventId: acc.lastEventId }, undefined]
|
|
366
|
+
}
|
|
367
|
+
|
|
368
|
+
if (line.startsWith(":")) return [acc, undefined]
|
|
369
|
+
|
|
370
|
+
const colonIdx = line.indexOf(":")
|
|
371
|
+
const field = colonIdx === -1 ? line : line.slice(0, colonIdx)
|
|
372
|
+
let value = colonIdx === -1 ? "" : line.slice(colonIdx + 1)
|
|
373
|
+
if (value.startsWith(" ")) value = value.slice(1)
|
|
374
|
+
|
|
375
|
+
switch (field) {
|
|
376
|
+
case "event":
|
|
377
|
+
return [{ ...acc, eventType: value }, undefined]
|
|
378
|
+
case "data":
|
|
379
|
+
return [{ ...acc, dataLines: [...acc.dataLines, value] }, undefined]
|
|
380
|
+
case "retry": {
|
|
381
|
+
const n = parseInt(value, 10)
|
|
382
|
+
if (!isNaN(n)) return [{ ...acc, retryMs: n }, undefined]
|
|
383
|
+
return [acc, undefined]
|
|
384
|
+
}
|
|
385
|
+
case "id":
|
|
386
|
+
return [{ ...acc, lastEventId: value }, undefined]
|
|
387
|
+
default:
|
|
388
|
+
return [acc, undefined]
|
|
389
|
+
}
|
|
390
|
+
}),
|
|
391
|
+
Stream.filter((event): event is SseEvent => event !== undefined),
|
|
392
|
+
)
|
|
393
|
+
}
|
|
394
|
+
}
|
package/src/FileRouter.ts
CHANGED
|
@@ -7,12 +7,11 @@ import * as Layer from "effect/Layer"
|
|
|
7
7
|
import * as Stream from "effect/Stream"
|
|
8
8
|
import * as NPath from "node:path"
|
|
9
9
|
import * as NUrl from "node:url"
|
|
10
|
-
import * as Development from "./
|
|
11
|
-
import * as FilePathPattern from "./FilePathPattern.ts"
|
|
10
|
+
import * as Development from "./_Development.ts"
|
|
12
11
|
import * as FileRouterCodegen from "./FileRouterCodegen.ts"
|
|
13
12
|
import * as NodeUtils from "./node/NodeUtils.ts"
|
|
14
|
-
import
|
|
15
|
-
import type * as
|
|
13
|
+
import * as PathPattern from "./_PathPattern.ts"
|
|
14
|
+
import type * as System from "./System.ts"
|
|
16
15
|
import * as Route from "./Route.ts"
|
|
17
16
|
import * as RouteTree from "./RouteTree.ts"
|
|
18
17
|
|
|
@@ -32,15 +31,12 @@ export type FileRoutes = {
|
|
|
32
31
|
[path: PathPattern.PathPattern]: [LazyRouteModule, ...LazyRouteModule[]]
|
|
33
32
|
}
|
|
34
33
|
|
|
35
|
-
export type Segment = FilePathPattern.Segment
|
|
36
|
-
|
|
37
34
|
export type FileRoute = {
|
|
38
35
|
handle: "route" | "layer"
|
|
39
36
|
// eg. `/about/route.tsx`, `/users/[userId]/route.tsx`, `/(admin)/users/route.tsx`
|
|
40
37
|
modulePath: `/${string}`
|
|
41
|
-
// eg. `/about`, `/users
|
|
42
|
-
routePath:
|
|
43
|
-
segments: Array<Segment>
|
|
38
|
+
// eg. `/about`, `/users/:userId`, `/users` (groups stripped)
|
|
39
|
+
routePath: PathPattern.PathPattern
|
|
44
40
|
}
|
|
45
41
|
|
|
46
42
|
/**
|
|
@@ -52,40 +48,26 @@ export type FileRoute = {
|
|
|
52
48
|
*/
|
|
53
49
|
export type OrderedFileRoutes = Array<FileRoute>
|
|
54
50
|
|
|
55
|
-
const ROUTE_PATH_REGEX =
|
|
51
|
+
const ROUTE_PATH_REGEX = /^(.*\/)?(route|layer)\.(jsx?|tsx?)$/
|
|
56
52
|
|
|
57
53
|
export function parseRoute(path: string): FileRoute | null {
|
|
58
|
-
const
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
const handleMatch =
|
|
62
|
-
lastSeg?._tag === "LiteralSegment" && lastSeg.value.match(/^(route|layer)\.(tsx?|jsx?)$/)
|
|
63
|
-
const handle = handleMatch ? (handleMatch[1] as "route" | "layer") : null
|
|
64
|
-
|
|
65
|
-
if (!handle) {
|
|
66
|
-
return null
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
const pathSegments = segs.slice(0, -1)
|
|
70
|
-
|
|
71
|
-
const validated = FilePathPattern.validate(FilePathPattern.format(pathSegments))
|
|
72
|
-
if (Either.isLeft(validated)) {
|
|
54
|
+
const normalizedPath = path.replace(/^\/+/, "")
|
|
55
|
+
const matched = normalizedPath.match(ROUTE_PATH_REGEX)
|
|
56
|
+
if (!matched) {
|
|
73
57
|
return null
|
|
74
58
|
}
|
|
75
59
|
|
|
76
|
-
const
|
|
77
|
-
|
|
60
|
+
const routeDir = matched[1]?.replace(/\/$/, "") ?? ""
|
|
61
|
+
const handle = matched[2] as "route" | "layer"
|
|
62
|
+
const routePathResult = PathPattern.fromFilePath(routeDir)
|
|
63
|
+
if (Either.isLeft(routePathResult)) {
|
|
78
64
|
return null
|
|
79
65
|
}
|
|
80
66
|
|
|
81
|
-
const routePathSegments = pathSegments.filter((seg) => seg._tag !== "GroupSegment")
|
|
82
|
-
const routePath = FilePathPattern.format(routePathSegments)
|
|
83
|
-
|
|
84
67
|
return {
|
|
85
68
|
handle,
|
|
86
|
-
modulePath: `/${
|
|
87
|
-
routePath,
|
|
88
|
-
segments: pathSegments,
|
|
69
|
+
modulePath: `/${normalizedPath}`,
|
|
70
|
+
routePath: routePathResult.right,
|
|
89
71
|
}
|
|
90
72
|
}
|
|
91
73
|
|
|
@@ -123,7 +105,7 @@ export function layer(
|
|
|
123
105
|
treePath = NUrl.fileURLToPath(treePath)
|
|
124
106
|
}
|
|
125
107
|
if (NPath.extname(treePath) === "") {
|
|
126
|
-
treePath = NPath.join(treePath, "server.
|
|
108
|
+
treePath = NPath.join(treePath, ".server.ts")
|
|
127
109
|
}
|
|
128
110
|
|
|
129
111
|
const routesPath = NPath.dirname(treePath)
|
|
@@ -142,7 +124,7 @@ export function layer(
|
|
|
142
124
|
|
|
143
125
|
// Watch for changes (only when Development service is available)
|
|
144
126
|
yield* Function.pipe(
|
|
145
|
-
Development.
|
|
127
|
+
Development.events,
|
|
146
128
|
Stream.filter((e) => e._tag !== "Reload" && e.path.startsWith(relativeRoutesPath)),
|
|
147
129
|
Stream.runForEach(() => FileRouterCodegen.update(routesPath, treeFilename)),
|
|
148
130
|
Effect.fork,
|
|
@@ -158,15 +140,30 @@ export function fromFileRoutes(fileRoutes: FileRoutes): Effect.Effect<RouteTree.
|
|
|
158
140
|
const mounts: RouteTree.InputRouteMap = {}
|
|
159
141
|
|
|
160
142
|
for (const [path, loaders] of Object.entries(fileRoutes)) {
|
|
161
|
-
const modules = yield* Effect.forEach(loaders, (loader) => Effect.promise(() => loader()))
|
|
162
|
-
|
|
163
143
|
const allRoutes: RouteTree.RouteTuple = [] as unknown as RouteTree.RouteTuple
|
|
164
144
|
|
|
165
|
-
for (const
|
|
166
|
-
|
|
167
|
-
|
|
145
|
+
for (const loader of loaders) {
|
|
146
|
+
const result = yield* Effect.either(
|
|
147
|
+
Effect.tryPromise({
|
|
148
|
+
try: () => loader(),
|
|
149
|
+
catch: (cause) => new FileRouterError({ reason: "Import", cause, path }),
|
|
150
|
+
}),
|
|
151
|
+
)
|
|
152
|
+
|
|
153
|
+
if (Either.isLeft(result)) {
|
|
154
|
+
const error = result.left
|
|
155
|
+
for (const route of Route.use(
|
|
156
|
+
Route.render((): Effect.Effect<string, FileRouterError> => Effect.fail(error)),
|
|
157
|
+
)) {
|
|
168
158
|
;(allRoutes as Array<any>).push(route)
|
|
169
159
|
}
|
|
160
|
+
} else {
|
|
161
|
+
const m = result.right
|
|
162
|
+
if (Route.isRouteSet(m.default)) {
|
|
163
|
+
for (const route of m.default) {
|
|
164
|
+
;(allRoutes as Array<any>).push(route)
|
|
165
|
+
}
|
|
166
|
+
}
|
|
170
167
|
}
|
|
171
168
|
}
|
|
172
169
|
|
|
@@ -179,11 +176,7 @@ export function fromFileRoutes(fileRoutes: FileRoutes): Effect.Effect<RouteTree.
|
|
|
179
176
|
|
|
180
177
|
export function walkRoutesDirectory(
|
|
181
178
|
dir: string,
|
|
182
|
-
): Effect.Effect<
|
|
183
|
-
OrderedFileRoutes,
|
|
184
|
-
PlatformError.PlatformError | FileRouterError,
|
|
185
|
-
FileSystem.FileSystem
|
|
186
|
-
> {
|
|
179
|
+
): Effect.Effect<OrderedFileRoutes, System.SystemError | FileRouterError, FileSystem.FileSystem> {
|
|
187
180
|
return Effect.gen(function* () {
|
|
188
181
|
const fs = yield* FileSystem.FileSystem
|
|
189
182
|
const files = yield* fs.readDirectory(dir, { recursive: true })
|
|
@@ -209,10 +202,14 @@ export function getFileRoutes(
|
|
|
209
202
|
})
|
|
210
203
|
.filter((route): route is FileRoute => route !== null)
|
|
211
204
|
.toSorted((a, b) => {
|
|
212
|
-
const aDepth = a.
|
|
213
|
-
const bDepth = b.
|
|
214
|
-
const aHasRest = a.
|
|
215
|
-
|
|
205
|
+
const aDepth = a.modulePath.split("/").filter(Boolean).length - 1
|
|
206
|
+
const bDepth = b.modulePath.split("/").filter(Boolean).length - 1
|
|
207
|
+
const aHasRest = a.routePath
|
|
208
|
+
.split("/")
|
|
209
|
+
.some((seg) => seg.startsWith(":") && seg.endsWith("*"))
|
|
210
|
+
const bHasRest = b.routePath
|
|
211
|
+
.split("/")
|
|
212
|
+
.some((seg) => seg.startsWith(":") && seg.endsWith("*"))
|
|
216
213
|
|
|
217
214
|
return (
|
|
218
215
|
// rest is a dominant factor (routes with rest come last)
|
package/src/FileRouterCodegen.ts
CHANGED
|
@@ -1,11 +1,10 @@
|
|
|
1
1
|
import * as FileSystem from "./FileSystem.ts"
|
|
2
2
|
import * as Effect from "effect/Effect"
|
|
3
|
-
import * as Either from "effect/Either"
|
|
4
3
|
import * as Schema from "effect/Schema"
|
|
5
4
|
import * as NPath from "node:path"
|
|
6
|
-
import * as FilePathPattern from "./FilePathPattern.ts"
|
|
7
5
|
import * as FileRouter from "./FileRouter.ts"
|
|
8
|
-
import * as
|
|
6
|
+
import * as PathPattern from "./_PathPattern.ts"
|
|
7
|
+
import * as SchemaExtra from "./_SchemaExtra.ts"
|
|
9
8
|
|
|
10
9
|
export function validateRouteModule(module: unknown): module is FileRouter.RouteModule {
|
|
11
10
|
if (typeof module !== "object" || module === null) {
|
|
@@ -20,17 +19,11 @@ export function validateRouteModule(module: unknown): module is FileRouter.Route
|
|
|
20
19
|
return true
|
|
21
20
|
}
|
|
22
21
|
|
|
23
|
-
export function generatePathParamsSchema(
|
|
24
|
-
segments: ReadonlyArray<FilePathPattern.Segment>,
|
|
25
|
-
): Schema.Struct<any> | null {
|
|
22
|
+
export function generatePathParamsSchema(path: PathPattern.PathPattern): Schema.Struct<any> | null {
|
|
26
23
|
const fields: Record<PropertyKey, Schema.Schema.Any | Schema.PropertySignature.All> = {}
|
|
27
24
|
|
|
28
|
-
for (const
|
|
29
|
-
|
|
30
|
-
fields[segment.name] = Schema.String
|
|
31
|
-
} else if (segment._tag === "RestSegment") {
|
|
32
|
-
fields[segment.name] = Schema.optional(Schema.String)
|
|
33
|
-
}
|
|
25
|
+
for (const param of PathPattern.params(path)) {
|
|
26
|
+
fields[param.name] = param.optional ? Schema.optional(Schema.String) : Schema.String
|
|
34
27
|
}
|
|
35
28
|
|
|
36
29
|
if (Object.keys(fields).length === 0) {
|
|
@@ -54,7 +47,7 @@ export function validateRouteModules(
|
|
|
54
47
|
|
|
55
48
|
for (const handle of routeHandles) {
|
|
56
49
|
const routeModulePath = NPath.resolve(path, handle.modulePath)
|
|
57
|
-
const expectedSchema = generatePathParamsSchema(handle.
|
|
50
|
+
const expectedSchema = generatePathParamsSchema(handle.routePath)
|
|
58
51
|
|
|
59
52
|
const fileExists = yield* fs
|
|
60
53
|
.exists(routeModulePath)
|
|
@@ -144,20 +137,13 @@ export function generateCode(fileRoutes: FileRouter.OrderedFileRoutes): string |
|
|
|
144
137
|
currentPath = parentPath || "/"
|
|
145
138
|
}
|
|
146
139
|
|
|
147
|
-
// Convert file-style path to colon-style PathPattern
|
|
148
|
-
const pathPatternResult = FilePathPattern.toPathPattern(path)
|
|
149
|
-
if (Either.isLeft(pathPatternResult)) {
|
|
150
|
-
continue
|
|
151
|
-
}
|
|
152
|
-
const pathPattern = pathPatternResult.right
|
|
153
|
-
|
|
154
140
|
// Order: route first, then layers from innermost to outermost
|
|
155
141
|
const loaders: Array<string> = [
|
|
156
142
|
`() => import(".${route.modulePath}")`,
|
|
157
143
|
...allLayers.reverse().map((layer) => `() => import(".${layer.modulePath}")`),
|
|
158
144
|
]
|
|
159
145
|
|
|
160
|
-
entries.push({ path
|
|
146
|
+
entries.push({ path, loaders })
|
|
161
147
|
}
|
|
162
148
|
|
|
163
149
|
// No routes found - don't create file
|
|
@@ -188,7 +174,7 @@ ${routeEntries},
|
|
|
188
174
|
*/
|
|
189
175
|
export function update(
|
|
190
176
|
routesPath: string,
|
|
191
|
-
treePath = "server.
|
|
177
|
+
treePath = ".server.ts",
|
|
192
178
|
): Effect.Effect<void, FileRouter.FileRouterError, FileSystem.FileSystem> {
|
|
193
179
|
return Effect.gen(function* () {
|
|
194
180
|
treePath = NPath.resolve(routesPath, treePath)
|
|
@@ -259,7 +245,7 @@ export function update(
|
|
|
259
245
|
|
|
260
246
|
export function dump(
|
|
261
247
|
routesPath: string,
|
|
262
|
-
treePath = "server.
|
|
248
|
+
treePath = ".server.ts",
|
|
263
249
|
): Effect.Effect<void, FileRouter.FileRouterError, FileSystem.FileSystem> {
|
|
264
250
|
return Effect.gen(function* () {
|
|
265
251
|
treePath = NPath.resolve(routesPath, treePath)
|