svelte-effect-runtime 1.2.4 → 1.3.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/chunks/client-DkW4e4dD.js +199 -0
- package/dist/chunks/client-DkW4e4dD.js.map +1 -0
- package/dist/chunks/effect-CL8GJs8A.js +51 -0
- package/dist/chunks/effect-CL8GJs8A.js.map +1 -0
- package/dist/chunks/effect-compat-BhW0YPIs.js +103 -0
- package/dist/chunks/effect-compat-BhW0YPIs.js.map +1 -0
- package/dist/chunks/{magic-string.es-5gRBdMgP.js → magic-string.es-BnGH-5YR.js} +1 -1
- package/dist/chunks/{magic-string.es-5gRBdMgP.js.map → magic-string.es-BnGH-5YR.js.map} +1 -1
- package/dist/chunks/{markup-Ccw42uCl.js → markup-BpSHnnYD.js} +4 -4
- package/dist/chunks/{markup-Ccw42uCl.js.map → markup-BpSHnnYD.js.map} +1 -1
- package/dist/chunks/preprocess-CtLrnJcK.js +44 -0
- package/dist/chunks/preprocess-CtLrnJcK.js.map +1 -0
- package/dist/chunks/server-DR-6LMdP.js +629 -0
- package/dist/chunks/server-DR-6LMdP.js.map +1 -0
- package/dist/chunks/v3-p8V3Drpp.js +1 -0
- package/dist/chunks/v4-DIhYCbb_.js +1 -0
- package/dist/chunks/vite-DqjXRZd4.js +143 -0
- package/dist/chunks/vite-DqjXRZd4.js.map +1 -0
- package/dist/client.d.ts +1 -64
- package/dist/client.js +2 -170
- package/dist/effect.d.ts +1 -7
- package/dist/effect.js +1 -27
- package/dist/internal/effect-compat.d.ts +21 -0
- package/dist/internal/markup.d.ts +1 -1
- package/dist/internal/markup.js +1 -1
- package/dist/internal/remote-client.js +30 -6
- package/dist/internal/remote-client.js.map +1 -1
- package/dist/internal/transform.d.ts +1 -1
- package/dist/internal/transform.js +3 -4
- package/dist/internal/transform.js.map +1 -1
- package/dist/language-server.d.ts +9 -3
- package/dist/language-server.js +3 -3
- package/dist/mod.d.ts +1 -6
- package/dist/mod.js +3 -5
- package/dist/preprocess.d.ts +23 -6
- package/dist/preprocess.js +10 -31
- package/dist/preprocess.js.map +1 -1
- package/dist/root-node.d.ts +1 -14
- package/dist/root-node.js +63 -8
- package/dist/root-node.js.map +1 -0
- package/dist/server.d.ts +56 -129
- package/dist/server.js +44 -508
- package/dist/server.js.map +1 -1
- package/dist/v3/client.d.ts +93 -0
- package/dist/v3/effect.d.ts +17 -0
- package/dist/v3/mod.d.ts +3 -0
- package/dist/v3/preprocess.d.ts +28 -0
- package/dist/v3/root-node.d.ts +59 -0
- package/dist/v3/server.d.ts +167 -0
- package/dist/v3/vite.d.ts +46 -0
- package/dist/v4/client.d.ts +2 -0
- package/dist/v4/effect.d.ts +24 -0
- package/dist/v4/effect.js +19 -0
- package/dist/v4/effect.js.map +1 -0
- package/dist/v4/mod.d.ts +3 -0
- package/dist/v4/mod.js +3 -0
- package/dist/v4/preprocess.d.ts +30 -0
- package/dist/v4/preprocess.js +28 -0
- package/dist/v4/preprocess.js.map +1 -0
- package/dist/v4/root-node.d.ts +59 -0
- package/dist/v4/root-node.js +63 -0
- package/dist/v4/root-node.js.map +1 -0
- package/dist/v4/server.d.ts +118 -0
- package/dist/v4/server.js +22 -0
- package/dist/v4/server.js.map +1 -0
- package/dist/v4/vite.d.ts +34 -0
- package/dist/v4/vite.js +31 -0
- package/dist/v4/vite.js.map +1 -0
- package/dist/vite.d.ts +30 -15
- package/dist/vite.js +18 -101
- package/dist/vite.js.map +1 -1
- package/package.json +46 -3
- package/dist/client.js.map +0 -1
- package/dist/effect.js.map +0 -1
package/dist/root-node.js
CHANGED
|
@@ -1,8 +1,63 @@
|
|
|
1
|
-
import { t as
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { a as run_component_effect, c as to_native, o as run_inline_effect, r as get_effect_runtime_or_throw, s as to_effect, t as ClientRuntime } from "./chunks/client-DkW4e4dD.js";
|
|
2
|
+
import "./chunks/v3-p8V3Drpp.js";
|
|
3
|
+
import { a as RequestEvent$1, c as get_server_runtime_or_throw$1, i as Query$1, n as Form$1, o as ServerRuntime$1, r as Prerender$1, s as create_effect_transport$1, t as Command$1 } from "./chunks/server-DR-6LMdP.js";
|
|
4
|
+
import { t as effect } from "./chunks/effect-CL8GJs8A.js";
|
|
5
|
+
//#region v3/root-node.ts
|
|
6
|
+
/**
|
|
7
|
+
* Define a read-only remote function that returns an `Effect` on the client.
|
|
8
|
+
*
|
|
9
|
+
* @see https://ser.barekey.dev/content/remote-functions/query
|
|
10
|
+
*/
|
|
11
|
+
const Query = Query$1;
|
|
12
|
+
/**
|
|
13
|
+
* Define a write-oriented remote function that returns an `Effect` on the
|
|
14
|
+
* client.
|
|
15
|
+
*
|
|
16
|
+
* @see https://ser.barekey.dev/content/remote-functions/command
|
|
17
|
+
*/
|
|
18
|
+
const Command = Command$1;
|
|
19
|
+
/**
|
|
20
|
+
* Define a remote form handler that maps submitted data into an Effect
|
|
21
|
+
* program.
|
|
22
|
+
*
|
|
23
|
+
* @see https://ser.barekey.dev/content/remote-functions/form
|
|
24
|
+
*/
|
|
25
|
+
const Form = Form$1;
|
|
26
|
+
/**
|
|
27
|
+
* Define a prerenderable remote function backed by an Effect program.
|
|
28
|
+
*
|
|
29
|
+
* @see https://ser.barekey.dev/content/remote-functions/prerender
|
|
30
|
+
*/
|
|
31
|
+
const Prerender = Prerender$1;
|
|
32
|
+
/**
|
|
33
|
+
* Effect `Context.Tag` for the current SvelteKit `RequestEvent`.
|
|
34
|
+
*
|
|
35
|
+
* @see https://ser.barekey.dev/content/runtimes/server
|
|
36
|
+
*/
|
|
37
|
+
const RequestEvent = RequestEvent$1;
|
|
38
|
+
/**
|
|
39
|
+
* Server-side runtime builder used to provide long-lived Effect services to
|
|
40
|
+
* remote functions.
|
|
41
|
+
*
|
|
42
|
+
* @see https://ser.barekey.dev/content/reference/server-runtime
|
|
43
|
+
*/
|
|
44
|
+
const ServerRuntime = ServerRuntime$1;
|
|
45
|
+
/**
|
|
46
|
+
* Build a devalue transport table from Effect schemas so remote payloads can
|
|
47
|
+
* round-trip custom data across the client/server boundary.
|
|
48
|
+
*
|
|
49
|
+
* @see https://ser.barekey.dev/content/reference/transport
|
|
50
|
+
*/
|
|
51
|
+
const create_effect_transport = create_effect_transport$1;
|
|
52
|
+
/**
|
|
53
|
+
* Resolve the active server runtime, lazily creating a default empty runtime
|
|
54
|
+
* when no explicit one has been registered.
|
|
55
|
+
*
|
|
56
|
+
* @internal Internal - do not use.
|
|
57
|
+
* @see https://ser.barekey.dev/content/reference/server-runtime
|
|
58
|
+
*/
|
|
59
|
+
const get_server_runtime_or_throw = get_server_runtime_or_throw$1;
|
|
60
|
+
//#endregion
|
|
61
|
+
export { ClientRuntime, Command, Form, Prerender, Query, RequestEvent, ServerRuntime, create_effect_transport, effect, get_effect_runtime_or_throw, get_server_runtime_or_throw, run_component_effect, run_inline_effect, to_effect, to_native };
|
|
62
|
+
|
|
63
|
+
//# sourceMappingURL=root-node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"root-node.js","names":["Server_module.Query","Server_module.Command","Server_module.Form","Server_module.Prerender","Server_module.RequestEvent","Server_module.ServerRuntime","Server_module.create_effect_transport","Server_module.get_server_runtime_or_throw"],"sources":["../../modules/svelte-effect-runtime/v3/root-node.ts"],"sourcesContent":["import * as Server_module from \"$/v3/server.ts\";\n\nexport * from \"$/v3/mod.ts\";\nexport type * from \"$/v3/server.ts\";\nexport type { EffectPluginOptions } from \"$/v3/effect.ts\";\nexport { effect } from \"$/v3/effect.ts\";\n\n/**\n * Define a read-only remote function that returns an `Effect` on the client.\n *\n * @see https://ser.barekey.dev/content/remote-functions/query\n */\nexport const Query: typeof Server_module.Query = Server_module.Query;\n/**\n * Define a write-oriented remote function that returns an `Effect` on the\n * client.\n *\n * @see https://ser.barekey.dev/content/remote-functions/command\n */\nexport const Command: typeof Server_module.Command = Server_module.Command;\n/**\n * Define a remote form handler that maps submitted data into an Effect\n * program.\n *\n * @see https://ser.barekey.dev/content/remote-functions/form\n */\nexport const Form: typeof Server_module.Form = Server_module.Form;\n/**\n * Define a prerenderable remote function backed by an Effect program.\n *\n * @see https://ser.barekey.dev/content/remote-functions/prerender\n */\nexport const Prerender: typeof Server_module.Prerender = Server_module.Prerender;\n/**\n * Effect `Context.Tag` for the current SvelteKit `RequestEvent`.\n *\n * @see https://ser.barekey.dev/content/runtimes/server\n */\nexport const RequestEvent: typeof Server_module.RequestEvent =\n Server_module.RequestEvent;\n/**\n * Server-side runtime builder used to provide long-lived Effect services to\n * remote functions.\n *\n * @see https://ser.barekey.dev/content/reference/server-runtime\n */\nexport const ServerRuntime: typeof Server_module.ServerRuntime =\n Server_module.ServerRuntime;\n/**\n * Build a devalue transport table from Effect schemas so remote payloads can\n * round-trip custom data across the client/server boundary.\n *\n * @see https://ser.barekey.dev/content/reference/transport\n */\nexport const create_effect_transport: typeof Server_module.create_effect_transport =\n Server_module.create_effect_transport;\n/**\n * Resolve the active server runtime, lazily creating a default empty runtime\n * when no explicit one has been registered.\n *\n * @internal Internal - do not use.\n * @see https://ser.barekey.dev/content/reference/server-runtime\n */\nexport const get_server_runtime_or_throw:\n typeof Server_module.get_server_runtime_or_throw =\n Server_module.get_server_runtime_or_throw;\n"],"mappings":";;;;;;;;;;AAYA,MAAa,QAAoCA;;;;;;;AAOjD,MAAa,UAAwCC;;;;;;;AAOrD,MAAa,OAAkCC;;;;;;AAM/C,MAAa,YAA4CC;;;;;;AAMzD,MAAa,eACXC;;;;;;;AAOF,MAAa,gBACXC;;;;;;;AAOF,MAAa,0BACXC;;;;;;;;AAQF,MAAa,8BAETC"}
|
package/dist/server.d.ts
CHANGED
|
@@ -1,129 +1,56 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
export
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
export type Invalid<SchemaType = unknown> = {
|
|
58
|
-
form: (message: string) => Effect.Effect<never, FormError<SchemaType>, never>;
|
|
59
|
-
} & FieldHelpers<SchemaType extends EffectSchema ? SchemaOutput<SchemaType> : unknown, SchemaType>;
|
|
60
|
-
export type EffectQueryFunction<Input, Output, Error = never> = ((arg: OptionalArgument<Input>) => Effect.Effect<Output, import("./internal/remote-shared.ts").RemoteFailure<Error>, never>) & {
|
|
61
|
-
native: RemoteQueryFunction<Input, Output>;
|
|
62
|
-
};
|
|
63
|
-
export type EffectCommand<Input, Output, Error = never> = ((arg: OptionalArgument<Input>) => Effect.Effect<Output, import("./internal/remote-shared.ts").RemoteFailure<Error>, never>) & {
|
|
64
|
-
native: RemoteCommand<Input, Output>;
|
|
65
|
-
readonly pending: number;
|
|
66
|
-
};
|
|
67
|
-
export type EffectPrerenderFunction<Input, Output, Error = never> = ((arg: OptionalArgument<Input>) => Effect.Effect<Output, import("./internal/remote-shared.ts").RemoteFailure<Error>, never>) & {
|
|
68
|
-
native: RemotePrerenderFunction<Input, Output>;
|
|
69
|
-
};
|
|
70
|
-
export type EffectForm<Input extends RemoteFormInput | void, Output, Error = never> = RemoteForm<Input, Output> & {
|
|
71
|
-
native: RemoteForm<Input, Output>;
|
|
72
|
-
submit(data: OptionalArgument<Input>): Effect.Effect<Output, import("./internal/remote-shared.ts").RemoteFailure<Error>, never>;
|
|
73
|
-
for: RemoteForm<Input, Output>["for"] extends (...args: infer Args) => infer Result ? (...args: Args) => EffectForm<Input, Output, Error> : never;
|
|
74
|
-
};
|
|
75
|
-
export type RequestEventService = ReturnType<typeof get_native_request_event>;
|
|
76
|
-
export declare const RequestEvent: Context.Tag<RequestEventService, RequestEventService>;
|
|
77
|
-
interface ServerRuntimeSeed {
|
|
78
|
-
pipe(): Layer.Layer<never>;
|
|
79
|
-
pipe<const Ops extends readonly [RuntimeOperator, ...Array<RuntimeOperator>]>(...ops: Ops): FinalRuntimeLayer<Ops>;
|
|
80
|
-
make(): void;
|
|
81
|
-
make<const Ops extends readonly [RuntimeOperator, ...Array<RuntimeOperator>]>(...ops: Ops): void;
|
|
82
|
-
}
|
|
83
|
-
type ServerManagedRuntime = ManagedRuntime.ManagedRuntime<unknown, unknown>;
|
|
84
|
-
export declare const ServerRuntime: ServerRuntimeSeed;
|
|
85
|
-
export declare function get_server_runtime_or_throw(): ServerManagedRuntime;
|
|
86
|
-
export declare function create_effect_transport<const Schemas extends Record<string, EffectSchema>>(schemas: Schemas): Transport;
|
|
87
|
-
export interface EffectQueryFactory {
|
|
88
|
-
<Output, ErrorType, Requirements>(fn: () => Effect.Effect<Output, ErrorType, Requirements>): EffectQueryFunction<void, Output, ErrorType>;
|
|
89
|
-
<Input, Output, ErrorType, Requirements>(validate: "unchecked", fn: (arg: Input) => Effect.Effect<Output, ErrorType, Requirements>): EffectQueryFunction<Input, Output, ErrorType>;
|
|
90
|
-
<SchemaType extends EffectSchema, Output, ErrorType, Requirements>(validate: SchemaType, fn: (arg: SchemaOutput<SchemaType>) => Effect.Effect<Output, ErrorType, Requirements>): EffectQueryFunction<SchemaInput<SchemaType>, Output, ErrorType>;
|
|
91
|
-
batch: typeof query_batch_factory;
|
|
92
|
-
}
|
|
93
|
-
type RemotePrerenderInputsGenerator<Input> = (event: RequestEventService) => AsyncIterable<Input> | Iterable<Input>;
|
|
94
|
-
declare function query_batch_factory(validate_or_fn: unknown, maybe_fn?: unknown): unknown;
|
|
95
|
-
export declare const Query: EffectQueryFactory;
|
|
96
|
-
export interface EffectCommandFactory {
|
|
97
|
-
<Output, ErrorType, Requirements>(fn: () => Effect.Effect<Output, ErrorType, Requirements>): EffectCommand<void, Output, ErrorType>;
|
|
98
|
-
<Input, Output, ErrorType, Requirements>(validate: "unchecked", fn: (arg: Input) => Effect.Effect<Output, ErrorType, Requirements>): EffectCommand<Input, Output, ErrorType>;
|
|
99
|
-
<SchemaType extends EffectSchema, Output, ErrorType, Requirements>(validate: SchemaType, fn: (arg: SchemaOutput<SchemaType>) => Effect.Effect<Output, ErrorType, Requirements>): EffectCommand<SchemaInput<SchemaType>, Output, ErrorType>;
|
|
100
|
-
}
|
|
101
|
-
export declare const Command: EffectCommandFactory;
|
|
102
|
-
export interface EffectFormFactory {
|
|
103
|
-
<Output, ErrorType, Requirements>(fn: () => Effect.Effect<Output, ErrorType, Requirements>): EffectForm<void, Output, ErrorType>;
|
|
104
|
-
<Input extends RemoteFormInput, Output, ErrorType, Requirements>(validate: "unchecked", fn: (args: {
|
|
105
|
-
data: Input;
|
|
106
|
-
invalid: Invalid;
|
|
107
|
-
}) => Effect.Effect<Output, ErrorType | FormError, Requirements>): EffectForm<Input, Output, ErrorType>;
|
|
108
|
-
<SchemaType extends EffectSchema, Output, ErrorType, Requirements>(validate: SchemaType, fn: (args: {
|
|
109
|
-
data: SchemaOutput<SchemaType>;
|
|
110
|
-
invalid: Invalid<SchemaType>;
|
|
111
|
-
}) => Effect.Effect<Output, ErrorType | FormError<SchemaType>, Requirements>): EffectForm<SchemaInput<SchemaType> & RemoteFormInput, Output, ErrorType>;
|
|
112
|
-
}
|
|
113
|
-
export declare const Form: EffectFormFactory;
|
|
114
|
-
export interface EffectPrerenderFactory {
|
|
115
|
-
<Output, ErrorType, Requirements>(fn: () => Effect.Effect<Output, ErrorType, Requirements>, options?: {
|
|
116
|
-
inputs?: RemotePrerenderInputsGenerator<void>;
|
|
117
|
-
dynamic?: boolean;
|
|
118
|
-
}): EffectPrerenderFunction<void, Output, ErrorType>;
|
|
119
|
-
<Input, Output, ErrorType, Requirements>(validate: "unchecked", fn: (arg: Input) => Effect.Effect<Output, ErrorType, Requirements>, options?: {
|
|
120
|
-
inputs?: RemotePrerenderInputsGenerator<Input>;
|
|
121
|
-
dynamic?: boolean;
|
|
122
|
-
}): EffectPrerenderFunction<Input, Output, ErrorType>;
|
|
123
|
-
<SchemaType extends EffectSchema, Output, ErrorType, Requirements>(validate: SchemaType, fn: (arg: SchemaOutput<SchemaType>) => Effect.Effect<Output, ErrorType, Requirements>, options?: {
|
|
124
|
-
inputs?: RemotePrerenderInputsGenerator<SchemaInput<SchemaType>>;
|
|
125
|
-
dynamic?: boolean;
|
|
126
|
-
}): EffectPrerenderFunction<SchemaInput<SchemaType>, Output, ErrorType>;
|
|
127
|
-
}
|
|
128
|
-
export declare const Prerender: EffectPrerenderFactory;
|
|
129
|
-
export {};
|
|
1
|
+
import * as Server_module from "./v3/server.js";
|
|
2
|
+
export type * from "./v3/server.js";
|
|
3
|
+
/**
|
|
4
|
+
* Define a read-only remote function that returns an `Effect` on the client.
|
|
5
|
+
*
|
|
6
|
+
* @see https://ser.barekey.dev/content/remote-functions/query
|
|
7
|
+
*/
|
|
8
|
+
export declare const Query: typeof Server_module.Query;
|
|
9
|
+
/**
|
|
10
|
+
* Define a write-oriented remote function that returns an `Effect` on the
|
|
11
|
+
* client.
|
|
12
|
+
*
|
|
13
|
+
* @see https://ser.barekey.dev/content/remote-functions/command
|
|
14
|
+
*/
|
|
15
|
+
export declare const Command: typeof Server_module.Command;
|
|
16
|
+
/**
|
|
17
|
+
* Define a remote form handler that maps submitted data into an Effect
|
|
18
|
+
* program.
|
|
19
|
+
*
|
|
20
|
+
* @see https://ser.barekey.dev/content/remote-functions/form
|
|
21
|
+
*/
|
|
22
|
+
export declare const Form: typeof Server_module.Form;
|
|
23
|
+
/**
|
|
24
|
+
* Define a prerenderable remote function backed by an Effect program.
|
|
25
|
+
*
|
|
26
|
+
* @see https://ser.barekey.dev/content/remote-functions/prerender
|
|
27
|
+
*/
|
|
28
|
+
export declare const Prerender: typeof Server_module.Prerender;
|
|
29
|
+
/**
|
|
30
|
+
* Effect `Context.Tag` for the current SvelteKit `RequestEvent`.
|
|
31
|
+
*
|
|
32
|
+
* @see https://ser.barekey.dev/content/runtimes/server
|
|
33
|
+
*/
|
|
34
|
+
export declare const RequestEvent: typeof Server_module.RequestEvent;
|
|
35
|
+
/**
|
|
36
|
+
* Server-side runtime builder used to provide long-lived Effect services to
|
|
37
|
+
* remote functions.
|
|
38
|
+
*
|
|
39
|
+
* @see https://ser.barekey.dev/content/reference/server-runtime
|
|
40
|
+
*/
|
|
41
|
+
export declare const ServerRuntime: typeof Server_module.ServerRuntime;
|
|
42
|
+
/**
|
|
43
|
+
* Build a devalue transport table from Effect schemas so remote payloads can
|
|
44
|
+
* round-trip custom data across the client/server boundary.
|
|
45
|
+
*
|
|
46
|
+
* @see https://ser.barekey.dev/content/reference/transport
|
|
47
|
+
*/
|
|
48
|
+
export declare const create_effect_transport: typeof Server_module.create_effect_transport;
|
|
49
|
+
/**
|
|
50
|
+
* Resolve the active server runtime, lazily creating a default empty runtime
|
|
51
|
+
* when no explicit one has been registered.
|
|
52
|
+
*
|
|
53
|
+
* @internal Internal - do not use.
|
|
54
|
+
* @see https://ser.barekey.dev/content/reference/server-runtime
|
|
55
|
+
*/
|
|
56
|
+
export declare const get_server_runtime_or_throw: typeof Server_module.get_server_runtime_or_throw;
|