effect-start 0.23.0 → 0.25.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/ChildProcess.js +32 -20
- package/dist/Commander.js +377 -293
- package/dist/ContentNegotiation.js +424 -318
- package/dist/Cookies.js +340 -271
- package/dist/Development.js +85 -49
- package/dist/Effectify.js +22 -14
- package/dist/Entity.js +260 -195
- package/dist/Fetch.js +192 -0
- package/dist/FilePathPattern.js +88 -77
- package/dist/FileRouter.js +192 -136
- package/dist/FileRouterCodegen.js +262 -191
- package/dist/FileSystem.js +126 -64
- package/dist/Http.js +96 -77
- package/dist/PathPattern.js +311 -273
- package/dist/PlatformError.js +36 -21
- package/dist/PlatformRuntime.js +65 -40
- package/dist/Route.js +122 -79
- package/dist/RouteBody.js +83 -58
- package/dist/RouteError.js +46 -25
- package/dist/RouteHook.js +58 -34
- package/dist/RouteHttp.js +346 -237
- package/dist/RouteHttpTracer.js +86 -58
- package/dist/RouteMount.js +81 -58
- package/dist/RouteSchema.js +253 -170
- package/dist/RouteSse.js +87 -72
- package/dist/RouteTree.js +99 -73
- package/dist/RouteTrie.js +160 -133
- package/dist/SchemaExtra.js +87 -62
- package/dist/Socket.js +32 -21
- package/dist/SqlIntrospect.js +317 -268
- package/dist/Start.js +55 -25
- package/dist/StartApp.js +3 -21
- package/dist/StreamExtra.js +109 -74
- package/dist/System.js +37 -21
- package/dist/TuplePathPattern.js +64 -58
- package/dist/Unique.js +159 -120
- package/dist/Values.js +48 -32
- package/dist/bun/BunBundle.js +158 -109
- package/dist/bun/BunChildProcessSpawner.js +121 -82
- package/dist/bun/BunImportTrackerPlugin.js +85 -63
- package/dist/bun/BunRoute.js +135 -99
- package/dist/bun/BunRuntime.js +39 -29
- package/dist/bun/BunServer.js +268 -140
- package/dist/bun/BunVirtualFilesPlugin.js +47 -33
- package/dist/bun/_BunEnhancedResolve.js +107 -82
- package/dist/bun/index.js +5 -5
- package/dist/bundler/Bundle.js +82 -38
- package/dist/bundler/BundleFiles.js +140 -82
- package/dist/bundler/BundleRoute.js +49 -38
- package/dist/client/Overlay.js +29 -28
- package/dist/client/ScrollState.js +94 -82
- package/dist/client/index.js +79 -61
- package/dist/console/Console.js +40 -24
- package/dist/console/ConsoleErrors.js +189 -178
- package/dist/console/ConsoleLogger.js +52 -43
- package/dist/console/ConsoleMetrics.js +69 -58
- package/dist/console/ConsoleProcess.js +57 -47
- package/dist/console/ConsoleStore.js +56 -45
- package/dist/console/ConsoleTracer.js +101 -88
- package/dist/console/Simulation.js +714 -563
- package/dist/console/index.js +3 -3
- package/dist/console/routes/tree.js +29 -28
- package/dist/datastar/actions/fetch.js +514 -381
- package/dist/datastar/actions/peek.js +12 -12
- package/dist/datastar/actions/setAll.js +18 -11
- package/dist/datastar/actions/toggleAll.js +18 -11
- package/dist/datastar/attributes/attr.js +48 -47
- package/dist/datastar/attributes/bind.js +186 -167
- package/dist/datastar/attributes/class.js +51 -44
- package/dist/datastar/attributes/computed.js +23 -24
- package/dist/datastar/attributes/effect.js +9 -8
- package/dist/datastar/attributes/indicator.js +32 -29
- package/dist/datastar/attributes/init.js +26 -25
- package/dist/datastar/attributes/jsonSignals.js +32 -29
- package/dist/datastar/attributes/on.js +76 -73
- package/dist/datastar/attributes/onIntersect.js +51 -51
- package/dist/datastar/attributes/onInterval.js +30 -29
- package/dist/datastar/attributes/onSignalPatch.js +49 -40
- package/dist/datastar/attributes/ref.js +10 -9
- package/dist/datastar/attributes/show.js +31 -30
- package/dist/datastar/attributes/signals.js +17 -16
- package/dist/datastar/attributes/style.js +56 -49
- package/dist/datastar/attributes/text.js +28 -25
- package/dist/datastar/engine.js +1079 -933
- package/dist/datastar/index.js +25 -24
- package/dist/datastar/utils.js +203 -155
- package/dist/datastar/watchers/patchElements.js +459 -372
- package/dist/datastar/watchers/patchSignals.js +13 -13
- package/dist/experimental/EncryptedCookies.js +305 -189
- package/dist/experimental/index.js +1 -1
- package/dist/hyper/Hyper.js +22 -17
- package/dist/hyper/HyperHtml.js +138 -123
- package/dist/hyper/HyperNode.js +11 -9
- package/dist/hyper/HyperRoute.js +41 -28
- package/dist/hyper/html.js +27 -27
- package/dist/hyper/index.js +5 -5
- package/dist/hyper/jsx-runtime.js +11 -5
- package/dist/index.js +8 -8
- package/dist/node/NodeFileSystem.js +606 -341
- package/dist/node/NodeUtils.js +21 -18
- package/dist/sql/Sql.js +8 -0
- package/dist/sql/bun/index.js +134 -67
- package/dist/sql/index.js +1 -0
- package/dist/sql/libsql/index.js +156 -0
- package/dist/sql/mssql/docker.js +103 -60
- package/dist/sql/mssql/index.js +182 -101
- package/dist/testing/TestLogger.js +39 -29
- package/dist/testing/index.js +2 -2
- package/dist/testing/utils.js +45 -23
- package/dist/x/cloudflare/CloudflareTunnel.js +61 -28
- package/dist/x/cloudflare/index.js +1 -1
- package/dist/x/tailscale/TailscaleTunnel.js +86 -60
- package/dist/x/tailscale/index.js +1 -1
- package/dist/x/tailwind/TailwindPlugin.js +280 -205
- package/dist/x/tailwind/compile.js +185 -129
- package/dist/x/tailwind/plugin.js +13 -11
- package/package.json +1 -1
- package/src/Development.ts +3 -1
- package/src/Entity.ts +17 -0
- package/src/Fetch.ts +271 -0
- package/src/SqlIntrospect.ts +64 -70
- package/src/Start.ts +24 -22
- package/src/StartApp.ts +11 -0
- package/src/bun/BunServer.ts +89 -16
- package/src/hyper/HyperHtml.ts +0 -1
- package/src/sql/bun/index.ts +1 -1
- package/src/sql/index.ts +1 -0
- package/src/sql/libsql/index.ts +173 -0
- package/src/sql/libsql/libsql.d.ts +39 -0
- package/src/sql/mssql/index.ts +1 -1
- package/src/x/tailscale/TailscaleTunnel.ts +7 -5
- package/dist/BlobStore.d.ts +0 -80
- package/dist/BlobStore.js +0 -19
- package/dist/ChildProcess.d.ts +0 -60
- package/dist/Commander.d.ts +0 -100
- package/dist/ContentNegotiation.d.ts +0 -12
- package/dist/Cookies.d.ts +0 -47
- package/dist/Development.d.ts +0 -39
- package/dist/Effectify.d.ts +0 -209
- package/dist/Entity.d.ts +0 -47
- package/dist/FilePathPattern.d.ts +0 -29
- package/dist/FileRouter.d.ts +0 -56
- package/dist/FileRouterCodegen.d.ts +0 -18
- package/dist/FileRouterPattern.d.ts +0 -9
- package/dist/FileRouterPattern.js +0 -35
- package/dist/FileSystem.d.ts +0 -158
- package/dist/Http.d.ts +0 -37
- package/dist/HttpAppExtra.d.ts +0 -7
- package/dist/HttpAppExtra.js +0 -320
- package/dist/HttpUtils.d.ts +0 -3
- package/dist/HttpUtils.js +0 -11
- package/dist/PathPattern.d.ts +0 -134
- package/dist/PlatformError.d.ts +0 -38
- package/dist/PlatformRuntime.d.ts +0 -27
- package/dist/Route.d.ts +0 -97
- package/dist/RouteBody.d.ts +0 -47
- package/dist/RouteError.d.ts +0 -98
- package/dist/RouteHook.d.ts +0 -12
- package/dist/RouteHttp.d.ts +0 -21
- package/dist/RouteHttpTracer.d.ts +0 -10
- package/dist/RouteMount.d.ts +0 -86
- package/dist/RouteSchema.d.ts +0 -86
- package/dist/RouteSse.d.ts +0 -21
- package/dist/RouteTree.d.ts +0 -57
- package/dist/RouteTrie.d.ts +0 -20
- package/dist/RouterPattern.d.ts +0 -118
- package/dist/RouterPattern.js +0 -269
- package/dist/SchemaExtra.d.ts +0 -7
- package/dist/Socket.d.ts +0 -27
- package/dist/Sql.d.ts +0 -34
- package/dist/Sql.js +0 -5
- package/dist/SqlIntrospect.d.ts +0 -91
- package/dist/Start.d.ts +0 -44
- package/dist/StartApp.d.ts +0 -19
- package/dist/StreamExtra.d.ts +0 -28
- package/dist/System.d.ts +0 -7
- package/dist/TuplePathPattern.d.ts +0 -9
- package/dist/Unique.d.ts +0 -50
- package/dist/Values.d.ts +0 -27
- package/dist/bun/BunBlobStoreDisk.d.ts +0 -6
- package/dist/bun/BunBlobStoreDisk.js +0 -116
- package/dist/bun/BunBlobStoreS3.d.ts +0 -11
- package/dist/bun/BunBlobStoreS3.js +0 -89
- package/dist/bun/BunBlobWatcherDisk.d.ts +0 -6
- package/dist/bun/BunBlobWatcherDisk.js +0 -60
- package/dist/bun/BunBlobWatcherQueue.d.ts +0 -6
- package/dist/bun/BunBlobWatcherQueue.js +0 -17
- package/dist/bun/BunBundle.d.ts +0 -11
- package/dist/bun/BunChildProcessSpawner.d.ts +0 -3
- package/dist/bun/BunHttpServer.d.ts +0 -44
- package/dist/bun/BunHttpServer.js +0 -186
- package/dist/bun/BunHttpServer_web.d.ts +0 -60
- package/dist/bun/BunHttpServer_web.js +0 -252
- package/dist/bun/BunImportTrackerPlugin.d.ts +0 -13
- package/dist/bun/BunPlatformHttpServer.d.ts +0 -10
- package/dist/bun/BunPlatformHttpServer.js +0 -53
- package/dist/bun/BunRoute.d.ts +0 -48
- package/dist/bun/BunRuntime.d.ts +0 -2
- package/dist/bun/BunServer.d.ts +0 -40
- package/dist/bun/BunServerRequest.d.ts +0 -60
- package/dist/bun/BunServerRequest.js +0 -252
- package/dist/bun/BunSql.d.ts +0 -4
- package/dist/bun/BunSql.js +0 -81
- package/dist/bun/BunVirtualFilesPlugin.d.ts +0 -4
- package/dist/bun/_BunEnhancedResolve.d.ts +0 -45
- package/dist/bun/index.d.ts +0 -5
- package/dist/bundler/Bundle.d.ts +0 -61
- package/dist/bundler/BundleFiles.d.ts +0 -13
- package/dist/bundler/BundleHttp.d.ts +0 -45
- package/dist/bundler/BundleHttp.js +0 -176
- package/dist/bundler/BundleRoute.d.ts +0 -27
- package/dist/client/Overlay.d.ts +0 -2
- package/dist/client/ScrollState.d.ts +0 -6
- package/dist/client/index.d.ts +0 -6
- package/dist/console/Console.d.ts +0 -6
- package/dist/console/ConsoleErrors.d.ts +0 -3
- package/dist/console/ConsoleLogger.d.ts +0 -3
- package/dist/console/ConsoleMetrics.d.ts +0 -3
- package/dist/console/ConsoleProcess.d.ts +0 -3
- package/dist/console/ConsoleStore.d.ts +0 -144
- package/dist/console/ConsoleTracer.d.ts +0 -3
- package/dist/console/Simulation.d.ts +0 -2
- package/dist/console/index.d.ts +0 -3
- package/dist/console/routes/errors/route.d.ts +0 -10
- package/dist/console/routes/errors/route.js +0 -47
- package/dist/console/routes/fiberDetail.d.ts +0 -16
- package/dist/console/routes/fiberDetail.js +0 -38
- package/dist/console/routes/fibers/route.d.ts +0 -10
- package/dist/console/routes/fibers/route.js +0 -19
- package/dist/console/routes/git/route.d.ts +0 -11
- package/dist/console/routes/git/route.js +0 -33
- package/dist/console/routes/layout.d.ts +0 -9
- package/dist/console/routes/layout.js +0 -3
- package/dist/console/routes/logs/route.d.ts +0 -10
- package/dist/console/routes/logs/route.js +0 -32
- package/dist/console/routes/metrics/route.d.ts +0 -10
- package/dist/console/routes/metrics/route.js +0 -17
- package/dist/console/routes/route.d.ts +0 -6
- package/dist/console/routes/route.js +0 -5
- package/dist/console/routes/routes/route.d.ts +0 -6
- package/dist/console/routes/routes/route.js +0 -20
- package/dist/console/routes/services/route.d.ts +0 -6
- package/dist/console/routes/services/route.js +0 -12
- package/dist/console/routes/system/route.d.ts +0 -10
- package/dist/console/routes/system/route.js +0 -18
- package/dist/console/routes/traceDetail.d.ts +0 -16
- package/dist/console/routes/traceDetail.js +0 -14
- package/dist/console/routes/traces/route.d.ts +0 -10
- package/dist/console/routes/traces/route.js +0 -39
- package/dist/console/routes/tree.d.ts +0 -153
- package/dist/console/ui/Errors.d.ts +0 -4
- package/dist/console/ui/Errors.js +0 -15
- package/dist/console/ui/Fibers.d.ts +0 -24
- package/dist/console/ui/Fibers.js +0 -121
- package/dist/console/ui/Git.d.ts +0 -20
- package/dist/console/ui/Git.js +0 -95
- package/dist/console/ui/Logs.d.ts +0 -4
- package/dist/console/ui/Logs.js +0 -25
- package/dist/console/ui/Metrics.d.ts +0 -4
- package/dist/console/ui/Metrics.js +0 -26
- package/dist/console/ui/Routes.d.ts +0 -8
- package/dist/console/ui/Routes.js +0 -70
- package/dist/console/ui/Services.d.ts +0 -10
- package/dist/console/ui/Services.js +0 -246
- package/dist/console/ui/Shell.d.ts +0 -10
- package/dist/console/ui/Shell.js +0 -7
- package/dist/console/ui/System.d.ts +0 -4
- package/dist/console/ui/System.js +0 -35
- package/dist/console/ui/Traces.d.ts +0 -12
- package/dist/console/ui/Traces.js +0 -179
- package/dist/datastar/actions/fetch.d.ts +0 -30
- package/dist/datastar/actions/peek.d.ts +0 -1
- package/dist/datastar/actions/setAll.d.ts +0 -1
- package/dist/datastar/actions/toggleAll.d.ts +0 -1
- package/dist/datastar/attributes/attr.d.ts +0 -1
- package/dist/datastar/attributes/bind.d.ts +0 -1
- package/dist/datastar/attributes/class.d.ts +0 -1
- package/dist/datastar/attributes/computed.d.ts +0 -1
- package/dist/datastar/attributes/effect.d.ts +0 -1
- package/dist/datastar/attributes/indicator.d.ts +0 -1
- package/dist/datastar/attributes/init.d.ts +0 -1
- package/dist/datastar/attributes/jsonSignals.d.ts +0 -1
- package/dist/datastar/attributes/on.d.ts +0 -1
- package/dist/datastar/attributes/onIntersect.d.ts +0 -1
- package/dist/datastar/attributes/onInterval.d.ts +0 -1
- package/dist/datastar/attributes/onSignalPatch.d.ts +0 -1
- package/dist/datastar/attributes/ref.d.ts +0 -1
- package/dist/datastar/attributes/show.d.ts +0 -1
- package/dist/datastar/attributes/signals.d.ts +0 -1
- package/dist/datastar/attributes/style.d.ts +0 -1
- package/dist/datastar/attributes/text.d.ts +0 -1
- package/dist/datastar/engine.d.ts +0 -162
- package/dist/datastar/happydom.d.ts +0 -1
- package/dist/datastar/happydom.js +0 -8
- package/dist/datastar/index.d.ts +0 -24
- package/dist/datastar/load.d.ts +0 -24
- package/dist/datastar/load.js +0 -24
- package/dist/datastar/utils.d.ts +0 -51
- package/dist/datastar/watchers/patchElements.d.ts +0 -1
- package/dist/datastar/watchers/patchSignals.d.ts +0 -1
- package/dist/experimental/EncryptedCookies.d.ts +0 -48
- package/dist/experimental/SseHttpResponse.d.ts +0 -7
- package/dist/experimental/SseHttpResponse.js +0 -28
- package/dist/experimental/index.d.ts +0 -1
- package/dist/hyper/Hyper.d.ts +0 -25
- package/dist/hyper/HyperHtml.d.ts +0 -23
- package/dist/hyper/HyperHtml.test.d.ts +0 -1
- package/dist/hyper/HyperHtml.test.js +0 -197
- package/dist/hyper/HyperNode.d.ts +0 -14
- package/dist/hyper/HyperRoute.d.ts +0 -8
- package/dist/hyper/HyperRoute.test.d.ts +0 -1
- package/dist/hyper/HyperRoute.test.js +0 -83
- package/dist/hyper/html.d.ts +0 -11
- package/dist/hyper/index.d.ts +0 -6
- package/dist/hyper/jsx-runtime.d.ts +0 -7
- package/dist/index.d.ts +0 -8
- package/dist/inference_check.d.ts +0 -1
- package/dist/inference_check.js +0 -15
- package/dist/lint/plugin.d.ts +0 -86
- package/dist/lint/plugin.js +0 -341
- package/dist/middlewares/BasicAuthMiddleware.d.ts +0 -8
- package/dist/middlewares/BasicAuthMiddleware.js +0 -22
- package/dist/middlewares/index.d.ts +0 -1
- package/dist/middlewares/index.js +0 -1
- package/dist/node/Effectify.d.ts +0 -209
- package/dist/node/Effectify.js +0 -19
- package/dist/node/FileSystem.d.ts +0 -7
- package/dist/node/FileSystem.js +0 -420
- package/dist/node/NodeFileSystem.d.ts +0 -7
- package/dist/node/NodeUtils.d.ts +0 -2
- package/dist/node/PlatformError.d.ts +0 -46
- package/dist/node/PlatformError.js +0 -43
- package/dist/node/Utils.d.ts +0 -1
- package/dist/node/Utils.js +0 -19
- package/dist/repro_fail.d.ts +0 -1
- package/dist/repro_fail.js +0 -14
- package/dist/sql/bun/index.d.ts +0 -3
- package/dist/sql/mssql/docker.d.ts +0 -2
- package/dist/sql/mssql/index.d.ts +0 -21
- package/dist/testing/TestHttpClient.d.ts +0 -13
- package/dist/testing/TestHttpClient.js +0 -68
- package/dist/testing/TestLogger.d.ts +0 -13
- package/dist/testing/index.d.ts +0 -2
- package/dist/testing/utils.d.ts +0 -9
- package/dist/x/cloudflare/CloudflareTunnel.d.ts +0 -10
- package/dist/x/cloudflare/index.d.ts +0 -1
- package/dist/x/datastar/Datastar.d.ts +0 -6
- package/dist/x/datastar/Datastar.js +0 -47
- package/dist/x/datastar/index.d.ts +0 -1
- package/dist/x/datastar/index.js +0 -1
- package/dist/x/tailscale/TailscaleTunnel.d.ts +0 -15
- package/dist/x/tailscale/index.d.ts +0 -1
- package/dist/x/tailwind/TailwindPlugin.d.ts +0 -23
- package/dist/x/tailwind/compile.d.ts +0 -19
- package/dist/x/tailwind/plugin.d.ts +0 -2
- /package/src/{Sql.ts → sql/Sql.ts} +0 -0
package/dist/Commander.d.ts
DELETED
|
@@ -1,100 +0,0 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
import * as Pipeable from "effect/Pipeable";
|
|
3
|
-
import * as Schema from "effect/Schema";
|
|
4
|
-
declare const CommanderError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
5
|
-
readonly _tag: "CommanderError";
|
|
6
|
-
} & Readonly<A>;
|
|
7
|
-
export declare class CommanderError extends CommanderError_base<{
|
|
8
|
-
message: string;
|
|
9
|
-
cause?: unknown;
|
|
10
|
-
}> {
|
|
11
|
-
}
|
|
12
|
-
declare const TypeId: unique symbol;
|
|
13
|
-
type KebabToCamel<S extends string> = S extends `${infer First}-${infer Rest}` ? `${First}${KebabToCamel<Capitalize<Rest>>}` : S;
|
|
14
|
-
type StripPrefix<S extends string> = S extends `--${infer Name}` ? Name : S extends `-${infer Name}` ? Name : S;
|
|
15
|
-
type OptionNameToCamelCase<S extends string> = KebabToCamel<StripPrefix<S>>;
|
|
16
|
-
export interface OptionBuilder<A = any, Name extends string = string> {
|
|
17
|
-
readonly _tag: "OptionBuilder";
|
|
18
|
-
readonly name: Name;
|
|
19
|
-
readonly long: Name;
|
|
20
|
-
readonly short?: string;
|
|
21
|
-
readonly description: string;
|
|
22
|
-
readonly schema?: Schema.Schema<A, any>;
|
|
23
|
-
readonly defaultValue?: A;
|
|
24
|
-
}
|
|
25
|
-
type OptionBuilderWithSchema<A, Name extends string> = Omit<OptionBuilder<A, Name>, "schema" | "defaultValue"> & {
|
|
26
|
-
readonly schema: Schema.Schema<A, any>;
|
|
27
|
-
readonly defaultValue?: A;
|
|
28
|
-
};
|
|
29
|
-
export declare const option: <const Long extends `--${string}`, const Short extends `-${string}` | undefined = undefined>(long: Long, short?: Short) => {
|
|
30
|
-
schema<A, I extends string = string>(schema: Schema.Schema<A, I>): OptionBuilderWithSchema<A, Long>;
|
|
31
|
-
description(desc: string): {
|
|
32
|
-
schema<A, I_1 extends string = string>(schema: Schema.Schema<A, I_1>): OptionBuilderWithSchema<A, Long>;
|
|
33
|
-
default<A>(value: A): {
|
|
34
|
-
schema<A2 extends A, I_2 extends string = string>(schema: Schema.Schema<A2, I_2>): OptionBuilderWithSchema<A2, Long>;
|
|
35
|
-
};
|
|
36
|
-
};
|
|
37
|
-
default<A>(value: A): {
|
|
38
|
-
schema<A2 extends A, I_3 extends string = string>(schema: Schema.Schema<A2, I_3>): OptionBuilderWithSchema<A2, Long>;
|
|
39
|
-
description(desc: string): {
|
|
40
|
-
schema<A2 extends A, I_4 extends string = string>(schema: Schema.Schema<A2, I_4>): OptionBuilderWithSchema<A2, Long>;
|
|
41
|
-
};
|
|
42
|
-
};
|
|
43
|
-
};
|
|
44
|
-
export type OptionsMap = Record<string, OptionBuilder<any, any>>;
|
|
45
|
-
type ExtractOptionsFromBuilders<Opts extends OptionsMap> = {
|
|
46
|
-
[K in keyof Opts as Opts[K] extends OptionBuilder<any, infer Name> ? OptionNameToCamelCase<Name> : never]: Opts[K] extends OptionBuilder<infer A, any> ? A : never;
|
|
47
|
-
};
|
|
48
|
-
export type ExtractOptionValues<Opts extends OptionsMap> = ExtractOptionsFromBuilders<Opts>;
|
|
49
|
-
export interface SubcommandDef<Handled extends boolean = boolean> {
|
|
50
|
-
readonly _tag: "SubcommandDef";
|
|
51
|
-
readonly command: CommanderSet<any, any, Handled>;
|
|
52
|
-
}
|
|
53
|
-
type Extend<S, NewOpts extends OptionsMap, NewSubs extends ReadonlyArray<SubcommandDef> = [], Handled extends boolean = false> = S extends CommanderSet<infer Opts, infer Subs, infer _H> ? CommanderSet<Opts & NewOpts, [...Subs, ...NewSubs], Handled> : CommanderSet<NewOpts, NewSubs, Handled>;
|
|
54
|
-
type CommanderBuilder = {
|
|
55
|
-
option: typeof optionMethod;
|
|
56
|
-
optionHelp: typeof optionHelp;
|
|
57
|
-
optionVersion: typeof optionVersion;
|
|
58
|
-
subcommand: typeof subcommand;
|
|
59
|
-
handle: typeof handle;
|
|
60
|
-
};
|
|
61
|
-
export type CommanderSet<Opts extends OptionsMap = {}, Subcommands extends ReadonlyArray<SubcommandDef> = [], Handled extends boolean = false> = Pipeable.Pipeable & CommanderSet.Instance<Opts, Subcommands, Handled> & {
|
|
62
|
-
[TypeId]: typeof TypeId;
|
|
63
|
-
} & CommanderBuilder;
|
|
64
|
-
export declare namespace CommanderSet {
|
|
65
|
-
type Instance<Opts extends OptionsMap = {}, Subcommands extends ReadonlyArray<SubcommandDef> = [], Handled extends boolean = false> = {
|
|
66
|
-
readonly name: string;
|
|
67
|
-
readonly description?: string;
|
|
68
|
-
readonly version?: string;
|
|
69
|
-
readonly options: Opts;
|
|
70
|
-
readonly subcommands: Subcommands;
|
|
71
|
-
readonly handler?: Handled extends true ? (args: ExtractOptionValues<Opts>) => Effect.Effect<void> : never;
|
|
72
|
-
};
|
|
73
|
-
type Default = CommanderSet<{}, [], false>;
|
|
74
|
-
type Proto = {
|
|
75
|
-
[TypeId]: typeof TypeId;
|
|
76
|
-
pipe(): any;
|
|
77
|
-
} & CommanderBuilder;
|
|
78
|
-
}
|
|
79
|
-
declare const optionMethod: <S, Opt extends OptionBuilder<any, any>>(this: S, opt: Opt) => Extend<S, { [K in Opt["name"] as OptionNameToCamelCase<K>]: Opt; }>;
|
|
80
|
-
export declare const optionHelp: <S>(this: S) => Extend<S, {
|
|
81
|
-
help: OptionBuilder<boolean, "--help">;
|
|
82
|
-
}>;
|
|
83
|
-
export declare const optionVersion: <S>(this: S) => Extend<S, {
|
|
84
|
-
version: OptionBuilder<boolean, "--version">;
|
|
85
|
-
}>;
|
|
86
|
-
export declare const subcommand: <S, SubOpts extends OptionsMap, SubSubs extends ReadonlyArray<SubcommandDef>, SubHandled extends boolean>(this: S, cmd: CommanderSet<SubOpts, SubSubs, SubHandled>) => Extend<S, {}, [SubcommandDef<SubHandled>]>;
|
|
87
|
-
export declare const handle: <Opts extends OptionsMap, Subs extends ReadonlyArray<SubcommandDef>>(this: CommanderSet<Opts, Subs, false>, handler: (args: ExtractOptionValues<Opts>) => Effect.Effect<void>) => CommanderSet<Opts, Subs, true>;
|
|
88
|
-
export declare const make: <const Name extends string>(config: {
|
|
89
|
-
readonly name: Name;
|
|
90
|
-
readonly description?: string;
|
|
91
|
-
readonly version?: string;
|
|
92
|
-
}) => CommanderSet<{}, [], false>;
|
|
93
|
-
export declare function isCommanderSet(input: unknown): input is CommanderSet<any, any, any>;
|
|
94
|
-
export declare const parse: <Opts extends OptionsMap, Subs extends ReadonlyArray<SubcommandDef>, Handled extends boolean>(cmd: CommanderSet<Opts, Subs, Handled>, args: ReadonlyArray<string>) => Effect.Effect<ExtractOptionValues<Opts>, CommanderError>;
|
|
95
|
-
export declare const runMain: <Opts extends OptionsMap, Subs extends ReadonlyArray<SubcommandDef>>(cmd: CommanderSet<Opts, Subs, true>) => Effect.Effect<void, CommanderError>;
|
|
96
|
-
export declare const help: <Opts extends OptionsMap, Subs extends ReadonlyArray<SubcommandDef>, Handled extends boolean>(cmd: CommanderSet<Opts, Subs, Handled>) => string;
|
|
97
|
-
export declare const NumberFromString: typeof Schema.NumberFromString;
|
|
98
|
-
export declare const choice: <const Choices extends ReadonlyArray<string>>(choices: Choices) => Schema.Schema<Choices[number], string>;
|
|
99
|
-
export declare const repeatable: <A>(schema: Schema.Schema<A, string>) => Schema.Schema<ReadonlyArray<A>, string>;
|
|
100
|
-
export {};
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* RFC 7231 Content Negotiation compatible with Express/Node.js ecosystem.
|
|
3
|
-
* Based on {@link https://github.com/jshttp/negotiator}
|
|
4
|
-
*/
|
|
5
|
-
export declare function media(accept: string, available?: Array<string>): Array<string>;
|
|
6
|
-
export declare function language(accept: string, available?: Array<string>): Array<string>;
|
|
7
|
-
export declare function encoding(accept: string, available?: Array<string>): Array<string>;
|
|
8
|
-
export declare function charset(accept: string, available?: Array<string>): Array<string>;
|
|
9
|
-
export declare function headerMedia(headers: Headers, available?: Array<string>): Array<string>;
|
|
10
|
-
export declare function headerLanguage(headers: Headers, available?: Array<string>): Array<string>;
|
|
11
|
-
export declare function headerEncoding(headers: Headers, available?: Array<string>): Array<string>;
|
|
12
|
-
export declare function headerCharset(headers: Headers, available?: Array<string>): Array<string>;
|
package/dist/Cookies.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import * as Duration from "effect/Duration";
|
|
2
|
-
import * as Inspectable from "effect/Inspectable";
|
|
3
|
-
import * as Option from "effect/Option";
|
|
4
|
-
import * as Pipeable from "effect/Pipeable";
|
|
5
|
-
export declare const TypeId: unique symbol;
|
|
6
|
-
export type TypeId = typeof TypeId;
|
|
7
|
-
export declare const isCookies: (u: unknown) => u is Cookies;
|
|
8
|
-
export interface Cookies extends Pipeable.Pipeable, Inspectable.Inspectable {
|
|
9
|
-
readonly [TypeId]: TypeId;
|
|
10
|
-
readonly cookies: Record<string, Cookie>;
|
|
11
|
-
}
|
|
12
|
-
export declare const CookieTypeId: unique symbol;
|
|
13
|
-
export type CookieTypeId = typeof CookieTypeId;
|
|
14
|
-
export interface Cookie extends Inspectable.Inspectable {
|
|
15
|
-
readonly [CookieTypeId]: CookieTypeId;
|
|
16
|
-
readonly name: string;
|
|
17
|
-
readonly value: string;
|
|
18
|
-
readonly valueEncoded: string;
|
|
19
|
-
readonly options?: {
|
|
20
|
-
readonly domain?: string | undefined;
|
|
21
|
-
readonly expires?: Date | undefined;
|
|
22
|
-
readonly maxAge?: Duration.DurationInput | undefined;
|
|
23
|
-
readonly path?: string | undefined;
|
|
24
|
-
readonly priority?: "low" | "medium" | "high" | undefined;
|
|
25
|
-
readonly httpOnly?: boolean | undefined;
|
|
26
|
-
readonly secure?: boolean | undefined;
|
|
27
|
-
readonly partitioned?: boolean | undefined;
|
|
28
|
-
readonly sameSite?: "lax" | "strict" | "none" | undefined;
|
|
29
|
-
} | undefined;
|
|
30
|
-
}
|
|
31
|
-
export declare const empty: Cookies;
|
|
32
|
-
export declare const fromIterable: (cookies: Iterable<Cookie>) => Cookies;
|
|
33
|
-
export declare const fromSetCookie: (headers: Iterable<string> | string) => Cookies;
|
|
34
|
-
export declare const unsafeMakeCookie: (name: string, value: string, options?: Cookie["options"] | undefined) => Cookie;
|
|
35
|
-
export declare const isEmpty: (self: Cookies) => boolean;
|
|
36
|
-
export declare const get: (self: Cookies, name: string) => Option.Option<Cookie>;
|
|
37
|
-
export declare const getValue: (self: Cookies, name: string) => Option.Option<string>;
|
|
38
|
-
export declare const setCookie: (self: Cookies, cookie: Cookie) => Cookies;
|
|
39
|
-
export declare const unsafeSet: (self: Cookies, name: string, value: string, options?: Cookie["options"]) => Cookies;
|
|
40
|
-
export declare const unsafeSetAll: (self: Cookies, cookies: Iterable<readonly [name: string, value: string, options?: Cookie["options"]]>) => Cookies;
|
|
41
|
-
export declare const remove: (self: Cookies, name: string) => Cookies;
|
|
42
|
-
export declare const merge: (self: Cookies, that: Cookies) => Cookies;
|
|
43
|
-
export declare function serializeCookie(self: Cookie): string;
|
|
44
|
-
export declare const toCookieHeader: (self: Cookies) => string;
|
|
45
|
-
export declare const toRecord: (self: Cookies) => Record<string, string>;
|
|
46
|
-
export declare const toSetCookieHeaders: (self: Cookies) => Array<string>;
|
|
47
|
-
export declare function parseHeader(header: string): Record<string, string>;
|
package/dist/Development.d.ts
DELETED
|
@@ -1,39 +0,0 @@
|
|
|
1
|
-
import * as FileSystem from "./FileSystem.ts";
|
|
2
|
-
import * as Context from "effect/Context";
|
|
3
|
-
import * as Effect from "effect/Effect";
|
|
4
|
-
import * as Layer from "effect/Layer";
|
|
5
|
-
import * as PubSub from "effect/PubSub";
|
|
6
|
-
import * as Stream from "effect/Stream";
|
|
7
|
-
import type * as PlatformError from "./PlatformError.ts";
|
|
8
|
-
export type DevelopmentEvent = FileSystem.WatchEvent | {
|
|
9
|
-
readonly _tag: "Reload";
|
|
10
|
-
};
|
|
11
|
-
/** @internal */
|
|
12
|
-
export declare const _resetForTesting: () => void;
|
|
13
|
-
export type DevelopmentService = {
|
|
14
|
-
events: PubSub.PubSub<DevelopmentEvent>;
|
|
15
|
-
};
|
|
16
|
-
declare const Development_base: Context.TagClass<Development, "effect-start/Development", DevelopmentService>;
|
|
17
|
-
export declare class Development extends Development_base {
|
|
18
|
-
}
|
|
19
|
-
export declare const filterSourceFiles: (event: FileSystem.WatchEvent) => boolean;
|
|
20
|
-
export declare const filterDirectory: (event: FileSystem.WatchEvent) => boolean;
|
|
21
|
-
export declare const watchSource: (opts?: {
|
|
22
|
-
path?: string;
|
|
23
|
-
recursive?: boolean;
|
|
24
|
-
filter?: (event: FileSystem.WatchEvent) => boolean;
|
|
25
|
-
}) => Stream.Stream<FileSystem.WatchEvent, PlatformError.PlatformError, FileSystem.FileSystem>;
|
|
26
|
-
export declare const watch: (opts?: {
|
|
27
|
-
path?: string;
|
|
28
|
-
recursive?: boolean;
|
|
29
|
-
filter?: (event: FileSystem.WatchEvent) => boolean;
|
|
30
|
-
}) => Effect.Effect<{
|
|
31
|
-
events: PubSub.PubSub<DevelopmentEvent>;
|
|
32
|
-
}, never, FileSystem.FileSystem>;
|
|
33
|
-
export declare const layerWatch: (opts?: {
|
|
34
|
-
path?: string;
|
|
35
|
-
recursive?: boolean;
|
|
36
|
-
filter?: (event: FileSystem.WatchEvent) => boolean;
|
|
37
|
-
}) => Layer.Layer<Development, never, FileSystem.FileSystem>;
|
|
38
|
-
export declare const stream: () => Stream.Stream<DevelopmentEvent>;
|
|
39
|
-
export {};
|
package/dist/Effectify.d.ts
DELETED
|
@@ -1,209 +0,0 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
interface Callback<E, A> {
|
|
3
|
-
(err: E, a?: A): void;
|
|
4
|
-
}
|
|
5
|
-
type ArgsWithCallback<Args extends Array<any>, E, A> = [...args: Args, cb: Callback<E, A>];
|
|
6
|
-
type WithoutNull<A> = unknown extends A ? void : Exclude<A, null | undefined>;
|
|
7
|
-
type Effectify<T, E> = T extends {
|
|
8
|
-
(...args: ArgsWithCallback<infer Args1, infer _E1, infer A1>): infer _R1;
|
|
9
|
-
(...args: ArgsWithCallback<infer Args2, infer _E2, infer A2>): infer _R2;
|
|
10
|
-
(...args: ArgsWithCallback<infer Args3, infer _E3, infer A3>): infer _R3;
|
|
11
|
-
(...args: ArgsWithCallback<infer Args4, infer _E4, infer A4>): infer _R4;
|
|
12
|
-
(...args: ArgsWithCallback<infer Args5, infer _E5, infer A5>): infer _R5;
|
|
13
|
-
(...args: ArgsWithCallback<infer Args6, infer _E6, infer A6>): infer _R6;
|
|
14
|
-
(...args: ArgsWithCallback<infer Args7, infer _E7, infer A7>): infer _R7;
|
|
15
|
-
(...args: ArgsWithCallback<infer Args8, infer _E8, infer A8>): infer _R8;
|
|
16
|
-
(...args: ArgsWithCallback<infer Args9, infer _E9, infer A9>): infer _R9;
|
|
17
|
-
(...args: ArgsWithCallback<infer Args10, infer _E10, infer A10>): infer _R10;
|
|
18
|
-
} ? {
|
|
19
|
-
(...args: Args1): Effect.Effect<WithoutNull<A1>, E>;
|
|
20
|
-
(...args: Args2): Effect.Effect<WithoutNull<A2>, E>;
|
|
21
|
-
(...args: Args3): Effect.Effect<WithoutNull<A3>, E>;
|
|
22
|
-
(...args: Args4): Effect.Effect<WithoutNull<A4>, E>;
|
|
23
|
-
(...args: Args5): Effect.Effect<WithoutNull<A5>, E>;
|
|
24
|
-
(...args: Args6): Effect.Effect<WithoutNull<A6>, E>;
|
|
25
|
-
(...args: Args7): Effect.Effect<WithoutNull<A7>, E>;
|
|
26
|
-
(...args: Args8): Effect.Effect<WithoutNull<A8>, E>;
|
|
27
|
-
(...args: Args9): Effect.Effect<WithoutNull<A9>, E>;
|
|
28
|
-
(...args: Args10): Effect.Effect<WithoutNull<A10>, E>;
|
|
29
|
-
} : T extends {
|
|
30
|
-
(...args: ArgsWithCallback<infer Args1, infer _E1, infer A1>): infer _R1;
|
|
31
|
-
(...args: ArgsWithCallback<infer Args2, infer _E2, infer A2>): infer _R2;
|
|
32
|
-
(...args: ArgsWithCallback<infer Args3, infer _E3, infer A3>): infer _R3;
|
|
33
|
-
(...args: ArgsWithCallback<infer Args4, infer _E4, infer A4>): infer _R4;
|
|
34
|
-
(...args: ArgsWithCallback<infer Args5, infer _E5, infer A5>): infer _R5;
|
|
35
|
-
(...args: ArgsWithCallback<infer Args6, infer _E6, infer A6>): infer _R6;
|
|
36
|
-
(...args: ArgsWithCallback<infer Args7, infer _E7, infer A7>): infer _R7;
|
|
37
|
-
(...args: ArgsWithCallback<infer Args8, infer _E8, infer A8>): infer _R8;
|
|
38
|
-
(...args: ArgsWithCallback<infer Args9, infer _E9, infer A9>): infer _R9;
|
|
39
|
-
} ? {
|
|
40
|
-
(...args: Args1): Effect.Effect<WithoutNull<A1>, E>;
|
|
41
|
-
(...args: Args2): Effect.Effect<WithoutNull<A2>, E>;
|
|
42
|
-
(...args: Args3): Effect.Effect<WithoutNull<A3>, E>;
|
|
43
|
-
(...args: Args4): Effect.Effect<WithoutNull<A4>, E>;
|
|
44
|
-
(...args: Args5): Effect.Effect<WithoutNull<A5>, E>;
|
|
45
|
-
(...args: Args6): Effect.Effect<WithoutNull<A6>, E>;
|
|
46
|
-
(...args: Args7): Effect.Effect<WithoutNull<A7>, E>;
|
|
47
|
-
(...args: Args8): Effect.Effect<WithoutNull<A8>, E>;
|
|
48
|
-
(...args: Args9): Effect.Effect<WithoutNull<A9>, E>;
|
|
49
|
-
} : T extends {
|
|
50
|
-
(...args: ArgsWithCallback<infer Args1, infer _E1, infer A1>): infer _R1;
|
|
51
|
-
(...args: ArgsWithCallback<infer Args2, infer _E2, infer A2>): infer _R2;
|
|
52
|
-
(...args: ArgsWithCallback<infer Args3, infer _E3, infer A3>): infer _R3;
|
|
53
|
-
(...args: ArgsWithCallback<infer Args4, infer _E4, infer A4>): infer _R4;
|
|
54
|
-
(...args: ArgsWithCallback<infer Args5, infer _E5, infer A5>): infer _R5;
|
|
55
|
-
(...args: ArgsWithCallback<infer Args6, infer _E6, infer A6>): infer _R6;
|
|
56
|
-
(...args: ArgsWithCallback<infer Args7, infer _E7, infer A7>): infer _R7;
|
|
57
|
-
(...args: ArgsWithCallback<infer Args8, infer _E8, infer A8>): infer _R8;
|
|
58
|
-
} ? {
|
|
59
|
-
(...args: Args1): Effect.Effect<WithoutNull<A1>, E>;
|
|
60
|
-
(...args: Args2): Effect.Effect<WithoutNull<A2>, E>;
|
|
61
|
-
(...args: Args3): Effect.Effect<WithoutNull<A3>, E>;
|
|
62
|
-
(...args: Args4): Effect.Effect<WithoutNull<A4>, E>;
|
|
63
|
-
(...args: Args5): Effect.Effect<WithoutNull<A5>, E>;
|
|
64
|
-
(...args: Args6): Effect.Effect<WithoutNull<A6>, E>;
|
|
65
|
-
(...args: Args7): Effect.Effect<WithoutNull<A7>, E>;
|
|
66
|
-
(...args: Args8): Effect.Effect<WithoutNull<A8>, E>;
|
|
67
|
-
} : T extends {
|
|
68
|
-
(...args: ArgsWithCallback<infer Args1, infer _E1, infer A1>): infer _R1;
|
|
69
|
-
(...args: ArgsWithCallback<infer Args2, infer _E2, infer A2>): infer _R2;
|
|
70
|
-
(...args: ArgsWithCallback<infer Args3, infer _E3, infer A3>): infer _R3;
|
|
71
|
-
(...args: ArgsWithCallback<infer Args4, infer _E4, infer A4>): infer _R4;
|
|
72
|
-
(...args: ArgsWithCallback<infer Args5, infer _E5, infer A5>): infer _R5;
|
|
73
|
-
(...args: ArgsWithCallback<infer Args6, infer _E6, infer A6>): infer _R6;
|
|
74
|
-
(...args: ArgsWithCallback<infer Args7, infer _E7, infer A7>): infer _R7;
|
|
75
|
-
} ? {
|
|
76
|
-
(...args: Args1): Effect.Effect<WithoutNull<A1>, E>;
|
|
77
|
-
(...args: Args2): Effect.Effect<WithoutNull<A2>, E>;
|
|
78
|
-
(...args: Args3): Effect.Effect<WithoutNull<A3>, E>;
|
|
79
|
-
(...args: Args4): Effect.Effect<WithoutNull<A4>, E>;
|
|
80
|
-
(...args: Args5): Effect.Effect<WithoutNull<A5>, E>;
|
|
81
|
-
(...args: Args6): Effect.Effect<WithoutNull<A6>, E>;
|
|
82
|
-
(...args: Args7): Effect.Effect<WithoutNull<A7>, E>;
|
|
83
|
-
} : T extends {
|
|
84
|
-
(...args: ArgsWithCallback<infer Args1, infer _E1, infer A1>): infer _R1;
|
|
85
|
-
(...args: ArgsWithCallback<infer Args2, infer _E2, infer A2>): infer _R2;
|
|
86
|
-
(...args: ArgsWithCallback<infer Args3, infer _E3, infer A3>): infer _R3;
|
|
87
|
-
(...args: ArgsWithCallback<infer Args4, infer _E4, infer A4>): infer _R4;
|
|
88
|
-
(...args: ArgsWithCallback<infer Args5, infer _E5, infer A5>): infer _R5;
|
|
89
|
-
(...args: ArgsWithCallback<infer Args6, infer _E6, infer A6>): infer _R6;
|
|
90
|
-
} ? {
|
|
91
|
-
(...args: Args1): Effect.Effect<WithoutNull<A1>, E>;
|
|
92
|
-
(...args: Args2): Effect.Effect<WithoutNull<A2>, E>;
|
|
93
|
-
(...args: Args3): Effect.Effect<WithoutNull<A3>, E>;
|
|
94
|
-
(...args: Args4): Effect.Effect<WithoutNull<A4>, E>;
|
|
95
|
-
(...args: Args5): Effect.Effect<WithoutNull<A5>, E>;
|
|
96
|
-
(...args: Args6): Effect.Effect<WithoutNull<A6>, E>;
|
|
97
|
-
} : T extends {
|
|
98
|
-
(...args: ArgsWithCallback<infer Args1, infer _E1, infer A1>): infer _R1;
|
|
99
|
-
(...args: ArgsWithCallback<infer Args2, infer _E2, infer A2>): infer _R2;
|
|
100
|
-
(...args: ArgsWithCallback<infer Args3, infer _E3, infer A3>): infer _R3;
|
|
101
|
-
(...args: ArgsWithCallback<infer Args4, infer _E4, infer A4>): infer _R4;
|
|
102
|
-
(...args: ArgsWithCallback<infer Args5, infer _E5, infer A5>): infer _R5;
|
|
103
|
-
} ? {
|
|
104
|
-
(...args: Args1): Effect.Effect<WithoutNull<A1>, E>;
|
|
105
|
-
(...args: Args2): Effect.Effect<WithoutNull<A2>, E>;
|
|
106
|
-
(...args: Args3): Effect.Effect<WithoutNull<A3>, E>;
|
|
107
|
-
(...args: Args4): Effect.Effect<WithoutNull<A4>, E>;
|
|
108
|
-
(...args: Args5): Effect.Effect<WithoutNull<A5>, E>;
|
|
109
|
-
} : T extends {
|
|
110
|
-
(...args: ArgsWithCallback<infer Args1, infer _E1, infer A1>): infer _R1;
|
|
111
|
-
(...args: ArgsWithCallback<infer Args2, infer _E2, infer A2>): infer _R2;
|
|
112
|
-
(...args: ArgsWithCallback<infer Args3, infer _E3, infer A3>): infer _R3;
|
|
113
|
-
(...args: ArgsWithCallback<infer Args4, infer _E4, infer A4>): infer _R4;
|
|
114
|
-
} ? {
|
|
115
|
-
(...args: Args1): Effect.Effect<WithoutNull<A1>, E>;
|
|
116
|
-
(...args: Args2): Effect.Effect<WithoutNull<A2>, E>;
|
|
117
|
-
(...args: Args3): Effect.Effect<WithoutNull<A3>, E>;
|
|
118
|
-
(...args: Args4): Effect.Effect<WithoutNull<A4>, E>;
|
|
119
|
-
} : T extends {
|
|
120
|
-
(...args: ArgsWithCallback<infer Args1, infer _E1, infer A1>): infer _R1;
|
|
121
|
-
(...args: ArgsWithCallback<infer Args2, infer _E2, infer A2>): infer _R2;
|
|
122
|
-
(...args: ArgsWithCallback<infer Args3, infer _E3, infer A3>): infer _R3;
|
|
123
|
-
} ? {
|
|
124
|
-
(...args: Args1): Effect.Effect<WithoutNull<A1>, E>;
|
|
125
|
-
(...args: Args2): Effect.Effect<WithoutNull<A2>, E>;
|
|
126
|
-
(...args: Args3): Effect.Effect<WithoutNull<A3>, E>;
|
|
127
|
-
} : T extends {
|
|
128
|
-
(...args: ArgsWithCallback<infer Args1, infer _E1, infer A1>): infer _R1;
|
|
129
|
-
(...args: ArgsWithCallback<infer Args2, infer _E2, infer A2>): infer _R2;
|
|
130
|
-
} ? {
|
|
131
|
-
(...args: Args1): Effect.Effect<WithoutNull<A1>, E>;
|
|
132
|
-
(...args: Args2): Effect.Effect<WithoutNull<A2>, E>;
|
|
133
|
-
} : T extends {
|
|
134
|
-
(...args: ArgsWithCallback<infer Args1, infer _E1, infer A1>): infer _R1;
|
|
135
|
-
} ? {
|
|
136
|
-
(...args: Args1): Effect.Effect<WithoutNull<A1>, E>;
|
|
137
|
-
} : never;
|
|
138
|
-
type EffectifyError<T> = T extends {
|
|
139
|
-
(...args: ArgsWithCallback<infer _Args1, infer E1, infer _A1>): infer _R1;
|
|
140
|
-
(...args: ArgsWithCallback<infer _Args2, infer E2, infer _A2>): infer _R2;
|
|
141
|
-
(...args: ArgsWithCallback<infer _Args3, infer E3, infer _A3>): infer _R3;
|
|
142
|
-
(...args: ArgsWithCallback<infer _Args4, infer E4, infer _A4>): infer _R4;
|
|
143
|
-
(...args: ArgsWithCallback<infer _Args5, infer E5, infer _A5>): infer _R5;
|
|
144
|
-
(...args: ArgsWithCallback<infer _Args6, infer E6, infer _A6>): infer _R6;
|
|
145
|
-
(...args: ArgsWithCallback<infer _Args7, infer E7, infer _A7>): infer _R7;
|
|
146
|
-
(...args: ArgsWithCallback<infer _Args8, infer E8, infer _A8>): infer _R8;
|
|
147
|
-
(...args: ArgsWithCallback<infer _Args9, infer E9, infer _A9>): infer _R9;
|
|
148
|
-
(...args: ArgsWithCallback<infer _Args10, infer E10, infer _A10>): infer _R10;
|
|
149
|
-
} ? NonNullable<E1 | E2 | E3 | E4 | E5 | E6 | E7 | E8 | E9 | E10> : T extends {
|
|
150
|
-
(...args: ArgsWithCallback<infer _Args1, infer E1, infer _A1>): infer _R1;
|
|
151
|
-
(...args: ArgsWithCallback<infer _Args2, infer E2, infer _A2>): infer _R2;
|
|
152
|
-
(...args: ArgsWithCallback<infer _Args3, infer E3, infer _A3>): infer _R3;
|
|
153
|
-
(...args: ArgsWithCallback<infer _Args4, infer E4, infer _A4>): infer _R4;
|
|
154
|
-
(...args: ArgsWithCallback<infer _Args5, infer E5, infer _A5>): infer _R5;
|
|
155
|
-
(...args: ArgsWithCallback<infer _Args6, infer E6, infer _A6>): infer _R6;
|
|
156
|
-
(...args: ArgsWithCallback<infer _Args7, infer E7, infer _A7>): infer _R7;
|
|
157
|
-
(...args: ArgsWithCallback<infer _Args8, infer E8, infer _A8>): infer _R8;
|
|
158
|
-
(...args: ArgsWithCallback<infer _Args9, infer E9, infer _A9>): infer _R9;
|
|
159
|
-
} ? NonNullable<E1 | E2 | E3 | E4 | E5 | E6 | E7 | E8 | E9> : T extends {
|
|
160
|
-
(...args: ArgsWithCallback<infer _Args1, infer E1, infer _A1>): infer _R1;
|
|
161
|
-
(...args: ArgsWithCallback<infer _Args2, infer E2, infer _A2>): infer _R2;
|
|
162
|
-
(...args: ArgsWithCallback<infer _Args3, infer E3, infer _A3>): infer _R3;
|
|
163
|
-
(...args: ArgsWithCallback<infer _Args4, infer E4, infer _A4>): infer _R4;
|
|
164
|
-
(...args: ArgsWithCallback<infer _Args5, infer E5, infer _A5>): infer _R5;
|
|
165
|
-
(...args: ArgsWithCallback<infer _Args6, infer E6, infer _A6>): infer _R6;
|
|
166
|
-
(...args: ArgsWithCallback<infer _Args7, infer E7, infer _A7>): infer _R7;
|
|
167
|
-
(...args: ArgsWithCallback<infer _Args8, infer E8, infer _A8>): infer _R8;
|
|
168
|
-
} ? NonNullable<E1 | E2 | E3 | E4 | E5 | E6 | E7 | E8> : T extends {
|
|
169
|
-
(...args: ArgsWithCallback<infer _Args1, infer E1, infer _A1>): infer _R1;
|
|
170
|
-
(...args: ArgsWithCallback<infer _Args2, infer E2, infer _A2>): infer _R2;
|
|
171
|
-
(...args: ArgsWithCallback<infer _Args3, infer E3, infer _A3>): infer _R3;
|
|
172
|
-
(...args: ArgsWithCallback<infer _Args4, infer E4, infer _A4>): infer _R4;
|
|
173
|
-
(...args: ArgsWithCallback<infer _Args5, infer E5, infer _A5>): infer _R5;
|
|
174
|
-
(...args: ArgsWithCallback<infer _Args6, infer E6, infer _A6>): infer _R6;
|
|
175
|
-
(...args: ArgsWithCallback<infer _Args7, infer E7, infer _A7>): infer _R7;
|
|
176
|
-
} ? NonNullable<E1 | E2 | E3 | E4 | E5 | E6 | E7> : T extends {
|
|
177
|
-
(...args: ArgsWithCallback<infer _Args1, infer E1, infer _A1>): infer _R1;
|
|
178
|
-
(...args: ArgsWithCallback<infer _Args2, infer E2, infer _A2>): infer _R2;
|
|
179
|
-
(...args: ArgsWithCallback<infer _Args3, infer E3, infer _A3>): infer _R3;
|
|
180
|
-
(...args: ArgsWithCallback<infer _Args4, infer E4, infer _A4>): infer _R4;
|
|
181
|
-
(...args: ArgsWithCallback<infer _Args5, infer E5, infer _A5>): infer _R5;
|
|
182
|
-
(...args: ArgsWithCallback<infer _Args6, infer E6, infer _A6>): infer _R6;
|
|
183
|
-
} ? NonNullable<E1 | E2 | E3 | E4 | E5 | E6> : T extends {
|
|
184
|
-
(...args: ArgsWithCallback<infer _Args1, infer E1, infer _A1>): infer _R1;
|
|
185
|
-
(...args: ArgsWithCallback<infer _Args2, infer E2, infer _A2>): infer _R2;
|
|
186
|
-
(...args: ArgsWithCallback<infer _Args3, infer E3, infer _A3>): infer _R3;
|
|
187
|
-
(...args: ArgsWithCallback<infer _Args4, infer E4, infer _A4>): infer _R4;
|
|
188
|
-
(...args: ArgsWithCallback<infer _Args5, infer E5, infer _A5>): infer _R5;
|
|
189
|
-
} ? NonNullable<E1 | E2 | E3 | E4 | E5> : T extends {
|
|
190
|
-
(...args: ArgsWithCallback<infer _Args1, infer E1, infer _A1>): infer _R1;
|
|
191
|
-
(...args: ArgsWithCallback<infer _Args2, infer E2, infer _A2>): infer _R2;
|
|
192
|
-
(...args: ArgsWithCallback<infer _Args3, infer E3, infer _A3>): infer _R3;
|
|
193
|
-
(...args: ArgsWithCallback<infer _Args4, infer E4, infer _A4>): infer _R4;
|
|
194
|
-
} ? NonNullable<E1 | E2 | E3 | E4> : T extends {
|
|
195
|
-
(...args: ArgsWithCallback<infer _Args1, infer E1, infer _A1>): infer _R1;
|
|
196
|
-
(...args: ArgsWithCallback<infer _Args2, infer E2, infer _A2>): infer _R2;
|
|
197
|
-
(...args: ArgsWithCallback<infer _Args3, infer E3, infer _A3>): infer _R3;
|
|
198
|
-
} ? NonNullable<E1 | E2 | E3> : T extends {
|
|
199
|
-
(...args: ArgsWithCallback<infer _Args1, infer E1, infer _A1>): infer _R1;
|
|
200
|
-
(...args: ArgsWithCallback<infer _Args2, infer E2, infer _A2>): infer _R2;
|
|
201
|
-
} ? NonNullable<E1 | E2> : T extends {
|
|
202
|
-
(...args: ArgsWithCallback<infer _Args1, infer E1, infer _A1>): infer _R1;
|
|
203
|
-
} ? NonNullable<E1> : never;
|
|
204
|
-
export declare const effectify: {
|
|
205
|
-
<F extends (...args: Array<any>) => any>(fn: F): Effectify<F, EffectifyError<F>>;
|
|
206
|
-
<F extends (...args: Array<any>) => any, E>(fn: F, onError: (error: EffectifyError<F>, args: Parameters<F>) => E): Effectify<F, E>;
|
|
207
|
-
<F extends (...args: Array<any>) => any, E, E2>(fn: F, onError: (error: EffectifyError<F>, args: Parameters<F>) => E, onSyncError: (error: unknown, args: Parameters<F>) => E2): Effectify<F, E | E2>;
|
|
208
|
-
};
|
|
209
|
-
export {};
|
package/dist/Entity.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import * as Effect from "effect/Effect";
|
|
2
|
-
import * as ParseResult from "effect/ParseResult";
|
|
3
|
-
import * as Pipeable from "effect/Pipeable";
|
|
4
|
-
import * as Stream from "effect/Stream";
|
|
5
|
-
import * as Values from "./Values.ts";
|
|
6
|
-
export declare const TypeId: unique symbol;
|
|
7
|
-
export type TypeId = typeof TypeId;
|
|
8
|
-
/**
|
|
9
|
-
* Header keys are guaranteed to be lowercase.
|
|
10
|
-
*/
|
|
11
|
-
export type Headers = {
|
|
12
|
-
[header: string]: string | null | undefined;
|
|
13
|
-
};
|
|
14
|
-
export interface Entity<T = unknown, E = never> extends Pipeable.Pipeable {
|
|
15
|
-
readonly [TypeId]: TypeId;
|
|
16
|
-
readonly body: T;
|
|
17
|
-
readonly headers: Headers;
|
|
18
|
-
/**
|
|
19
|
-
* Accepts any valid URI (Uniform Resource Identifier), including URLs
|
|
20
|
-
* (http://, https://, file://), URNs (urn:isbn:...), S3 URIs (s3://bucket/key),
|
|
21
|
-
* data URIs, and other schemes. While commonly called "URL" in many APIs,
|
|
22
|
-
* this property handles URIs as the correct superset term per RFC 3986.
|
|
23
|
-
*/
|
|
24
|
-
readonly url: string | undefined;
|
|
25
|
-
readonly status: number | undefined;
|
|
26
|
-
readonly text: T extends string ? Effect.Effect<T, ParseResult.ParseError | E> : Effect.Effect<string, ParseResult.ParseError | E>;
|
|
27
|
-
readonly json: [T] extends [Effect.Effect<infer A, any, any>] ? Effect.Effect<A extends string | Uint8Array | ArrayBuffer ? unknown : A, ParseResult.ParseError | E> : [T] extends [Stream.Stream<any, any, any>] ? Effect.Effect<unknown, ParseResult.ParseError | E> : [T] extends [string | Uint8Array | ArrayBuffer] ? Effect.Effect<unknown, ParseResult.ParseError | E> : [T] extends [Values.Json] ? Effect.Effect<T, ParseResult.ParseError | E> : Effect.Effect<unknown, ParseResult.ParseError | E>;
|
|
28
|
-
readonly bytes: Effect.Effect<Uint8Array, ParseResult.ParseError | E>;
|
|
29
|
-
readonly stream: T extends Stream.Stream<infer A, infer E1, any> ? Stream.Stream<A, ParseResult.ParseError | E | E1> : Stream.Stream<Uint8Array, ParseResult.ParseError | E>;
|
|
30
|
-
}
|
|
31
|
-
export interface Proto extends Pipeable.Pipeable {
|
|
32
|
-
readonly [TypeId]: TypeId;
|
|
33
|
-
}
|
|
34
|
-
export declare function isEntity(input: unknown): input is Entity;
|
|
35
|
-
interface Options {
|
|
36
|
-
readonly headers?: Headers;
|
|
37
|
-
readonly url?: string;
|
|
38
|
-
readonly status?: number;
|
|
39
|
-
}
|
|
40
|
-
export declare function make<A, E>(body: Effect.Effect<A, E, never>, options?: Options): Entity<Effect.Effect<A, E, never>, E>;
|
|
41
|
-
export declare function make<A extends Uint8Array | string, E>(body: Stream.Stream<A, E, never>, options?: Options): Entity<Stream.Stream<A, E, never>, E>;
|
|
42
|
-
export declare function make<T>(body: T, options?: Options): Entity<T, never>;
|
|
43
|
-
export declare function effect<A, E, R>(body: Effect.Effect<Entity<A> | A, E, R>): Entity<A, E>;
|
|
44
|
-
export declare function resolve<A, E>(entity: Entity<A, E>): Effect.Effect<Entity<A, E>, E, never>;
|
|
45
|
-
export declare function type(self: Entity): string;
|
|
46
|
-
export declare function length(self: Entity): number | undefined;
|
|
47
|
-
export {};
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import * as Either from "effect/Either";
|
|
2
|
-
import type * as PathPattern from "./PathPattern.ts";
|
|
3
|
-
export type FilePathPattern = string;
|
|
4
|
-
export type Segment = {
|
|
5
|
-
_tag: "GroupSegment";
|
|
6
|
-
name: string;
|
|
7
|
-
} | {
|
|
8
|
-
_tag: "RestSegment";
|
|
9
|
-
name: string;
|
|
10
|
-
} | {
|
|
11
|
-
_tag: "ParamSegment";
|
|
12
|
-
name: string;
|
|
13
|
-
} | {
|
|
14
|
-
_tag: "LiteralSegment";
|
|
15
|
-
value: string;
|
|
16
|
-
} | {
|
|
17
|
-
_tag: "InvalidSegment";
|
|
18
|
-
value: string;
|
|
19
|
-
};
|
|
20
|
-
export declare function segments(pattern: string): Array<Segment>;
|
|
21
|
-
export type ValidationError = {
|
|
22
|
-
_tag: "FilePathPatternError";
|
|
23
|
-
pattern: string;
|
|
24
|
-
message: string;
|
|
25
|
-
};
|
|
26
|
-
export type ValidationResult = Either.Either<Array<Segment>, ValidationError>;
|
|
27
|
-
export declare function validate(pattern: string): ValidationResult;
|
|
28
|
-
export declare function format(segs: Array<Segment>): `/${string}`;
|
|
29
|
-
export declare function toPathPattern(pattern: string): Either.Either<PathPattern.PathPattern, ValidationError>;
|
package/dist/FileRouter.d.ts
DELETED
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import * as FileSystem from "./FileSystem.ts";
|
|
2
|
-
import * as Effect from "effect/Effect";
|
|
3
|
-
import * as Layer from "effect/Layer";
|
|
4
|
-
import * as FilePathPattern from "./FilePathPattern.ts";
|
|
5
|
-
import type * as PathPattern from "./PathPattern.ts";
|
|
6
|
-
import type * as PlatformError from "./PlatformError.ts";
|
|
7
|
-
import * as Route from "./Route.ts";
|
|
8
|
-
import * as RouteTree from "./RouteTree.ts";
|
|
9
|
-
declare const FileRouterError_base: new <A extends Record<string, any> = {}>(args: import("effect/Types").Equals<A, {}> extends true ? void : { readonly [P in keyof A as P extends "_tag" ? never : P]: A[P]; }) => import("effect/Cause").YieldableError & {
|
|
10
|
-
readonly _tag: "FileRouterError";
|
|
11
|
-
} & Readonly<A>;
|
|
12
|
-
export declare class FileRouterError extends FileRouterError_base<{
|
|
13
|
-
reason: "Import" | "Conflict" | "FileSystem";
|
|
14
|
-
cause?: unknown;
|
|
15
|
-
path?: string;
|
|
16
|
-
}> {
|
|
17
|
-
}
|
|
18
|
-
export type RouteModule = {
|
|
19
|
-
default: Route.RouteSet.Any;
|
|
20
|
-
};
|
|
21
|
-
export type LazyRouteModule = () => Promise<RouteModule>;
|
|
22
|
-
export type FileRoutes = {
|
|
23
|
-
[path: PathPattern.PathPattern]: [LazyRouteModule, ...LazyRouteModule[]];
|
|
24
|
-
};
|
|
25
|
-
export type Segment = FilePathPattern.Segment;
|
|
26
|
-
export type FileRoute = {
|
|
27
|
-
handle: "route" | "layer";
|
|
28
|
-
modulePath: `/${string}`;
|
|
29
|
-
routePath: `/${string}`;
|
|
30
|
-
segments: Array<Segment>;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* Routes sorted by depth, with rest parameters at the end.
|
|
34
|
-
* - layer.tsx
|
|
35
|
-
* - users/route.tsx
|
|
36
|
-
* - users/[userId]/route.tsx
|
|
37
|
-
* - [[rest]]/route.tsx
|
|
38
|
-
*/
|
|
39
|
-
export type OrderedFileRoutes = Array<FileRoute>;
|
|
40
|
-
export declare function parseRoute(path: string): FileRoute | null;
|
|
41
|
-
/**
|
|
42
|
-
* Generates a tree file that references all routes.
|
|
43
|
-
*/
|
|
44
|
-
export declare function layer(load: () => Promise<{
|
|
45
|
-
default: FileRoutes;
|
|
46
|
-
}>): Layer.Layer<Route.Routes, FileRouterError, FileSystem.FileSystem>;
|
|
47
|
-
export declare function layer(options: {
|
|
48
|
-
load: () => Promise<{
|
|
49
|
-
default: FileRoutes;
|
|
50
|
-
}>;
|
|
51
|
-
path: string;
|
|
52
|
-
}): Layer.Layer<Route.Routes, FileRouterError, FileSystem.FileSystem>;
|
|
53
|
-
export declare function fromFileRoutes(fileRoutes: FileRoutes): Effect.Effect<RouteTree.RouteTree>;
|
|
54
|
-
export declare function walkRoutesDirectory(dir: string): Effect.Effect<OrderedFileRoutes, PlatformError.PlatformError | FileRouterError, FileSystem.FileSystem>;
|
|
55
|
-
export declare function getFileRoutes(paths: Array<string>): Effect.Effect<OrderedFileRoutes, FileRouterError>;
|
|
56
|
-
export {};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import * as FileSystem from "./FileSystem.ts";
|
|
2
|
-
import * as Effect from "effect/Effect";
|
|
3
|
-
import * as Schema from "effect/Schema";
|
|
4
|
-
import * as FilePathPattern from "./FilePathPattern.ts";
|
|
5
|
-
import * as FileRouter from "./FileRouter.ts";
|
|
6
|
-
export declare function validateRouteModule(module: unknown): module is FileRouter.RouteModule;
|
|
7
|
-
export declare function generatePathParamsSchema(segments: ReadonlyArray<FilePathPattern.Segment>): Schema.Struct<any> | null;
|
|
8
|
-
/**
|
|
9
|
-
* Validates all route modules in the given route handles.
|
|
10
|
-
*/
|
|
11
|
-
export declare function validateRouteModules(path: string, routes: FileRouter.OrderedFileRoutes): Effect.Effect<void, FileRouter.FileRouterError, FileSystem.FileSystem>;
|
|
12
|
-
export declare function generateCode(fileRoutes: FileRouter.OrderedFileRoutes): string | null;
|
|
13
|
-
/**
|
|
14
|
-
* Updates the tree file only if the generated content differs from the existing file.
|
|
15
|
-
* This prevents infinite loops when watching for file changes.
|
|
16
|
-
*/
|
|
17
|
-
export declare function update(routesPath: string, treePath?: string): Effect.Effect<void, FileRouter.FileRouterError, FileSystem.FileSystem>;
|
|
18
|
-
export declare function dump(routesPath: string, treePath?: string): Effect.Effect<void, FileRouter.FileRouterError, FileSystem.FileSystem>;
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import * as RouterPattern from "./RouterPattern.ts";
|
|
2
|
-
export type GroupSegment<Name extends string = string> = {
|
|
3
|
-
_tag: "GroupSegment";
|
|
4
|
-
name: Name;
|
|
5
|
-
};
|
|
6
|
-
export type Segment = RouterPattern.Segment | GroupSegment;
|
|
7
|
-
export declare function parse(pattern: string): Segment[];
|
|
8
|
-
export declare function formatSegment(seg: Segment): string;
|
|
9
|
-
export declare function format(segments: Segment[]): `/${string}`;
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import * as RouterPattern from "./RouterPattern.js";
|
|
2
|
-
export function parse(pattern) {
|
|
3
|
-
const trimmedPath = pattern.replace(/(^\/)|(\/$)/g, "");
|
|
4
|
-
if (trimmedPath === "") {
|
|
5
|
-
return [];
|
|
6
|
-
}
|
|
7
|
-
const segmentStrings = trimmedPath
|
|
8
|
-
.split("/")
|
|
9
|
-
.filter(s => s !== "");
|
|
10
|
-
if (segmentStrings.length === 0) {
|
|
11
|
-
return [];
|
|
12
|
-
}
|
|
13
|
-
const segments = segmentStrings.map((s) => {
|
|
14
|
-
// (group) - Groups (FileRouter-specific)
|
|
15
|
-
const groupMatch = s.match(/^\((\w+)\)$/);
|
|
16
|
-
if (groupMatch) {
|
|
17
|
-
return { _tag: "GroupSegment", name: groupMatch[1] };
|
|
18
|
-
}
|
|
19
|
-
// Delegate to RouterPattern for all other segment types
|
|
20
|
-
return RouterPattern.parseSegment(s);
|
|
21
|
-
});
|
|
22
|
-
if (segments.some((seg) => seg === null)) {
|
|
23
|
-
throw new Error(`Invalid path segment in "${pattern}": contains invalid characters or format`);
|
|
24
|
-
}
|
|
25
|
-
return segments;
|
|
26
|
-
}
|
|
27
|
-
export function formatSegment(seg) {
|
|
28
|
-
if (seg._tag === "GroupSegment")
|
|
29
|
-
return `(${seg.name})`;
|
|
30
|
-
return RouterPattern.formatSegment(seg);
|
|
31
|
-
}
|
|
32
|
-
export function format(segments) {
|
|
33
|
-
const joined = segments.map(formatSegment).join("/");
|
|
34
|
-
return (joined ? `/${joined}` : "/");
|
|
35
|
-
}
|