brumate 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +2 -2
- package/check.d.ts +49 -0
- package/dist/{boot-D-IdPy7B.d.ts → boot-DLlRmD9z.d.ts} +11 -10
- package/dist/cli.js +275 -15
- package/dist/cli.js.map +1 -1
- package/dist/client-BvDsC6Qr.js +3463 -0
- package/dist/client-BvDsC6Qr.js.map +1 -0
- package/dist/client-DBwL2wKQ.d.ts +669 -0
- package/dist/{client-routes-JTbGtukf.js → client-routes-BtGpYCef.js} +60 -30
- package/dist/client-routes-BtGpYCef.js.map +1 -0
- package/dist/{cookies-Av5WFmcf.js → cookies-Cnbf4w-S.js} +15 -7
- package/dist/cookies-Cnbf4w-S.js.map +1 -0
- package/dist/{defer-D0bo1Gqx.js → defer-CKWZLv2K.js} +8 -4
- package/dist/defer-CKWZLv2K.js.map +1 -0
- package/dist/devtools-4uTPwR_v.js +597 -0
- package/dist/devtools-4uTPwR_v.js.map +1 -0
- package/dist/devtools-panel-Be9pxYgv.js +1994 -0
- package/dist/devtools-panel-Be9pxYgv.js.map +1 -0
- package/dist/events-LgLdp1R7.js +114 -0
- package/dist/events-LgLdp1R7.js.map +1 -0
- package/dist/features-CHY5Ekku.js +30 -0
- package/dist/features-CHY5Ekku.js.map +1 -0
- package/dist/files-WW4RlajL.js +506 -0
- package/dist/files-WW4RlajL.js.map +1 -0
- package/dist/forms-j1xPAR14.d.ts +281 -0
- package/dist/forms-nXK7-Lv_.js +440 -0
- package/dist/forms-nXK7-Lv_.js.map +1 -0
- package/dist/highlight.d.ts +17 -0
- package/dist/highlight.js +278 -0
- package/dist/highlight.js.map +1 -0
- package/dist/html-BtKRyi7g.js +305 -0
- package/dist/html-BtKRyi7g.js.map +1 -0
- package/dist/html-Bw9Qwu6F.d.ts +107 -0
- package/dist/index.d.ts +142 -11
- package/dist/index.js +641 -106
- package/dist/index.js.map +1 -1
- package/dist/{inspect-BJtACnQp.js → inspect-Y6y4uNZp.js} +4333 -681
- package/dist/inspect-Y6y4uNZp.js.map +1 -0
- package/dist/{loader-B18i3_-T.js → loader-BjKGJzLN.js} +21 -14
- package/dist/loader-BjKGJzLN.js.map +1 -0
- package/dist/logo-DQ_OYhBi.js +10 -0
- package/dist/logo-DQ_OYhBi.js.map +1 -0
- package/dist/{navigate-BwuZveDF.js → navigate-CfOr-TRF.js} +130 -24
- package/dist/navigate-CfOr-TRF.js.map +1 -0
- package/dist/nesting-DA5vJw9X.js +265 -0
- package/dist/nesting-DA5vJw9X.js.map +1 -0
- package/dist/produce-B7X9ori9.js +402 -0
- package/dist/produce-B7X9ori9.js.map +1 -0
- package/dist/produce-DIgHBVwL.d.ts +148 -0
- package/dist/{rpc-B-Zkn6Ch.js → rpc-Q-XkLwFh.js} +28 -13
- package/dist/rpc-Q-XkLwFh.js.map +1 -0
- package/dist/runtime/batch.js +9 -7
- package/dist/runtime/batch.js.map +1 -1
- package/dist/runtime/client.d.ts +4 -4
- package/dist/runtime/client.js +4 -4
- package/dist/runtime/devtools.d.ts +172 -5
- package/dist/runtime/devtools.js +3 -1
- package/dist/runtime/env.js +14 -2
- package/dist/runtime/env.js.map +1 -1
- package/dist/runtime/events.d.ts +38 -1
- package/dist/runtime/events.js +1 -1
- package/dist/runtime/forms.d.ts +2 -0
- package/dist/runtime/forms.js +1 -0
- package/dist/runtime/gather.d.ts +25 -0
- package/dist/runtime/gather.js +33 -0
- package/dist/runtime/gather.js.map +1 -0
- package/dist/runtime/hot.d.ts +1 -1
- package/dist/runtime/hot.js +5 -2
- package/dist/runtime/hot.js.map +1 -1
- package/dist/runtime/html.d.ts +2 -2
- package/dist/runtime/html.js +1 -1
- package/dist/runtime/loader.d.ts +2 -2
- package/dist/runtime/loader.js +2 -2
- package/dist/runtime/routes.js +4 -1
- package/dist/runtime/routes.js.map +1 -1
- package/dist/runtime/server.d.ts +5 -4
- package/dist/runtime/server.js +5 -5
- package/dist/runtime/signals.d.ts +75 -2
- package/dist/runtime/signals.js +44 -2
- package/dist/runtime/signals.js.map +1 -1
- package/dist/runtime/static-loader.d.ts +2 -2
- package/dist/runtime/static-loader.js +1 -1
- package/dist/runtime/testing.d.ts +18 -3
- package/dist/runtime/testing.js +150 -33
- package/dist/runtime/testing.js.map +1 -1
- package/dist/runtime/values.d.ts +2 -0
- package/dist/runtime/values.js +24 -0
- package/dist/runtime/values.js.map +1 -0
- package/dist/{server-BA9SJ2Vm.d.ts → server-BvPIg9pT.d.ts} +363 -32
- package/dist/{server-BqfM95r1.js → server-DjyOVJtJ.js} +1309 -220
- package/dist/server-DjyOVJtJ.js.map +1 -0
- package/dist/{static-loader-BzE9SRaj.d.ts → static-loader-BGgdp_Y5.d.ts} +2 -2
- package/dist/static-loader-BZR17hSw.js +312 -0
- package/dist/static-loader-BZR17hSw.js.map +1 -0
- package/dist/{stream-JaMHMdBD.js → stream-BP5AVmg5.js} +182 -17
- package/dist/stream-BP5AVmg5.js.map +1 -0
- package/dist/values-B8C7CLvG.d.ts +63 -0
- package/dist/vite.d.ts +20 -20
- package/dist/vite.js +2031 -539
- package/dist/vite.js.map +1 -1
- package/elements.d.ts +951 -0
- package/forms/forms.brm.ts +141 -0
- package/package.json +41 -3
- package/skills/brumate/SKILL.md +58 -0
- package/skills/brumate/references/errors.md +2078 -0
- package/skills/brumate/references/events.md +117 -0
- package/skills/brumate/references/signals.md +61 -0
- package/skills/brumate/references/state.md +235 -0
- package/skills/brumate/references/syntax.md +250 -0
- package/types.d.ts +4 -4
- package/dist/client-C0UCNL3J.js +0 -1643
- package/dist/client-C0UCNL3J.js.map +0 -1
- package/dist/client-MD0ZmcFR.d.ts +0 -354
- package/dist/client-routes-JTbGtukf.js.map +0 -1
- package/dist/cookies-Av5WFmcf.js.map +0 -1
- package/dist/defer-D0bo1Gqx.js.map +0 -1
- package/dist/devtools-C50VH8gZ.js +0 -113
- package/dist/devtools-C50VH8gZ.js.map +0 -1
- package/dist/devtools-panel-AYjfwPhj.js +0 -435
- package/dist/devtools-panel-AYjfwPhj.js.map +0 -1
- package/dist/events-BKWRqtMg.js +0 -52
- package/dist/events-BKWRqtMg.js.map +0 -1
- package/dist/files-Bnn1JqHx.js +0 -192
- package/dist/files-Bnn1JqHx.js.map +0 -1
- package/dist/html-bHZbkK-h.js +0 -170
- package/dist/html-bHZbkK-h.js.map +0 -1
- package/dist/html-y1q7-t7D.d.ts +0 -60
- package/dist/inspect-BJtACnQp.js.map +0 -1
- package/dist/loader-B18i3_-T.js.map +0 -1
- package/dist/navigate-BwuZveDF.js.map +0 -1
- package/dist/produce-CWfJ4byV.js +0 -167
- package/dist/produce-CWfJ4byV.js.map +0 -1
- package/dist/produce-D4K7qpaL.d.ts +0 -72
- package/dist/rpc-B-Zkn6Ch.js.map +0 -1
- package/dist/server-BqfM95r1.js.map +0 -1
- package/dist/static-loader-DOygOFj5.js +0 -216
- package/dist/static-loader-DOygOFj5.js.map +0 -1
- package/dist/stream-JaMHMdBD.js.map +0 -1
|
@@ -1,10 +1,17 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { l as ScopeId } from "../produce-DIgHBVwL.js";
|
|
2
|
+
import { Ft as Scope, on as NavigationReport } from "../client-DBwL2wKQ.js";
|
|
3
|
+
//#region src/runtime/logo.d.ts
|
|
4
|
+
/**
|
|
5
|
+
* The logo of brumate: the pole and the bowl of a b, in outline, where the
|
|
6
|
+
* pole runs through the left of the bowl. The part they share is orange.
|
|
7
|
+
*/
|
|
8
|
+
export declare const LOGO = "<svg viewBox=\"0 0 32 32\" width=\"100%\" height=\"100%\" aria-hidden=\"true\"><defs><linearGradient id=\"brumate-logo-fill\" x1=\"0\" y1=\"0\" x2=\"1\" y2=\"1\"><stop offset=\"0\" stop-color=\"#ffc38a\"/><stop offset=\".5\" stop-color=\"#ee7a3e\"/><stop offset=\"1\" stop-color=\"#e0445a\"/></linearGradient><clipPath id=\"brumate-logo-pole\"><rect x=\"7.5\" y=\"2.5\" width=\"8\" height=\"27\" rx=\"4\"/></clipPath></defs><circle cx=\"18\" cy=\"19.5\" r=\"10\" fill=\"url(#brumate-logo-fill)\" clip-path=\"url(#brumate-logo-pole)\"/><g fill=\"none\" stroke=\"#ece8e4\" stroke-width=\"2.2\"><rect x=\"7.5\" y=\"2.5\" width=\"8\" height=\"27\" rx=\"4\"/><circle cx=\"18\" cy=\"19.5\" r=\"10\"/></g></svg>";
|
|
9
|
+
//#endregion
|
|
3
10
|
//#region src/runtime/devtools.d.ts
|
|
4
11
|
/** Something that happened on the page, for the log of the panel. */
|
|
5
12
|
export interface DevtoolsEntry {
|
|
6
13
|
time: number;
|
|
7
|
-
kind: "handler" | "
|
|
14
|
+
kind: "handler" | "write" | "call";
|
|
8
15
|
text: string;
|
|
9
16
|
/** The scope of a write, so the panel can mark it. */
|
|
10
17
|
scope?: ScopeId;
|
|
@@ -15,23 +22,183 @@ export interface DevtoolsEntry {
|
|
|
15
22
|
slot: number;
|
|
16
23
|
};
|
|
17
24
|
}
|
|
25
|
+
/** What the plugin tells the devtools about the dev server. */
|
|
26
|
+
export interface DevtoolsMeta {
|
|
27
|
+
version?: string;
|
|
28
|
+
vite?: string;
|
|
29
|
+
}
|
|
30
|
+
/** An error for the Errors tab: of a render on the server, of Vite, or of code in the browser. */
|
|
31
|
+
export interface ErrorEntry {
|
|
32
|
+
time: number;
|
|
33
|
+
source: "server" | "compile" | "browser";
|
|
34
|
+
message: string;
|
|
35
|
+
stack?: string;
|
|
36
|
+
/** The lines around the error, as Vite's overlay shows them. */
|
|
37
|
+
frame?: string;
|
|
38
|
+
/** The place of the error, such as a compile error in a `.brm` file. */
|
|
39
|
+
loc?: {
|
|
40
|
+
file: string;
|
|
41
|
+
line: number;
|
|
42
|
+
column: number;
|
|
43
|
+
};
|
|
44
|
+
/** The plugin that threw it, such as `brumate`. */
|
|
45
|
+
plugin?: string;
|
|
46
|
+
}
|
|
47
|
+
/** What Vite's overlay gets, and what `errorPage` sends. */
|
|
48
|
+
export interface ErrorPayload {
|
|
49
|
+
message: string;
|
|
50
|
+
stack?: string;
|
|
51
|
+
frame?: string;
|
|
52
|
+
plugin?: string;
|
|
53
|
+
id?: string;
|
|
54
|
+
loc?: {
|
|
55
|
+
file?: string;
|
|
56
|
+
line: number;
|
|
57
|
+
column: number;
|
|
58
|
+
};
|
|
59
|
+
}
|
|
60
|
+
/** The part of `import.meta.hot` that the devtools listen to. */
|
|
61
|
+
interface HotContext {
|
|
62
|
+
on(event: string, listener: (payload: never) => void): void;
|
|
63
|
+
}
|
|
64
|
+
/** A server function call, for the Timeline tab. */
|
|
65
|
+
export interface CallTiming {
|
|
66
|
+
name: string;
|
|
67
|
+
start: number;
|
|
68
|
+
end?: number;
|
|
69
|
+
/** The status of the answer, `redirect` for a redirect, or `failed`. */
|
|
70
|
+
status?: number | "redirect" | "failed";
|
|
71
|
+
/** How long the function took on the server, from the `Server-Timing` of the dev server. */
|
|
72
|
+
server?: number;
|
|
73
|
+
}
|
|
74
|
+
/** A batch of updates that a write ran, with its effects. */
|
|
75
|
+
export interface UpdateTiming {
|
|
76
|
+
count: number;
|
|
77
|
+
start: number;
|
|
78
|
+
end: number;
|
|
79
|
+
}
|
|
80
|
+
/**
|
|
81
|
+
* A handler that ran, for the Timeline tab: when its event came, when its
|
|
82
|
+
* code was ready and the handlers before it had started, when its call
|
|
83
|
+
* returned, and when the promise of an async handler settled. The server
|
|
84
|
+
* calls and the updates that ran meanwhile are its own.
|
|
85
|
+
*/
|
|
86
|
+
export interface Interaction {
|
|
87
|
+
ref: string;
|
|
88
|
+
/** What happened, such as `click on <button>`. */
|
|
89
|
+
label: string;
|
|
90
|
+
begun: number;
|
|
91
|
+
ready: number;
|
|
92
|
+
end: number;
|
|
93
|
+
settled?: number;
|
|
94
|
+
failed?: boolean;
|
|
95
|
+
calls: CallTiming[];
|
|
96
|
+
updates: UpdateTiming[];
|
|
97
|
+
}
|
|
98
|
+
/** A block of the page that renders later, for the Blocks tab. */
|
|
99
|
+
export interface BlockEntry {
|
|
100
|
+
kind: "loading" | "defer" | "client" | "$client";
|
|
101
|
+
/** The boundary of `#loading` and `#defer`, or the `b-b` of the template of the others. */
|
|
102
|
+
id: string;
|
|
103
|
+
/** The trigger of `#defer`, `#client` and `$client`. */
|
|
104
|
+
trigger?: string;
|
|
105
|
+
/** The reference that `#client` and `$client` run. */
|
|
106
|
+
ref?: string;
|
|
107
|
+
/** The template that the loader reads for `#defer`, `#client` and `$client`. */
|
|
108
|
+
template?: Element;
|
|
109
|
+
state: "waiting" | "loading" | "streaming" | "rendered" | "failed";
|
|
110
|
+
/** When the panel first saw the block, when its trigger fired, and when it rendered. */
|
|
111
|
+
seen: number;
|
|
112
|
+
fired?: number;
|
|
113
|
+
rendered?: number;
|
|
114
|
+
/** True while the devtools show its fallback in place of its body. */
|
|
115
|
+
fallback?: boolean;
|
|
116
|
+
}
|
|
117
|
+
/** An effect or a `$client` callback of a scope, with how it ran. */
|
|
118
|
+
export interface EffectEntry {
|
|
119
|
+
scope: ScopeId;
|
|
120
|
+
/** The ID of the component of the scope, and the scope's number in it. */
|
|
121
|
+
component: string;
|
|
122
|
+
k: number;
|
|
123
|
+
/** Its name in the update code: `e<n>` for an effect, `c<n>` for a `$client` callback. */
|
|
124
|
+
name: string;
|
|
125
|
+
runs: number;
|
|
126
|
+
/** When its last runs were, the newest last, at most 50. */
|
|
127
|
+
recent: number[];
|
|
128
|
+
/** The time of all its runs, in milliseconds. */
|
|
129
|
+
time: number;
|
|
130
|
+
cleanups: number;
|
|
131
|
+
lastCleanup?: number;
|
|
132
|
+
/** False once its cleanup ran and it has not run again, such as in a removed scope. */
|
|
133
|
+
active: boolean;
|
|
134
|
+
}
|
|
18
135
|
export interface DevtoolsState {
|
|
19
136
|
scopes?: Map<ScopeId, Scope>;
|
|
20
137
|
/** Writes a slot, as a handler does, so the page updates. */
|
|
21
138
|
set?: (scope: Scope, slot: number, value: unknown) => void;
|
|
139
|
+
/** Runs a reference for an element, as the loader does for a trigger. */
|
|
140
|
+
handle?: (element: Element, ref: string, event?: Event) => Promise<unknown>;
|
|
22
141
|
log: DevtoolsEntry[];
|
|
142
|
+
/** The blocks of the page, by kind and ID. */
|
|
143
|
+
blocks: Map<string, BlockEntry>;
|
|
144
|
+
/** Asks the server for the body of a `#defer` block now. */
|
|
145
|
+
fire?: (block: BlockEntry) => void;
|
|
146
|
+
/**
|
|
147
|
+
* Shows the fallback of a `#loading` or `#defer` block in place of its
|
|
148
|
+
* body, or its body again. False when the page did not keep its fallback.
|
|
149
|
+
*/
|
|
150
|
+
showFallback?: (block: BlockEntry, on: boolean) => boolean;
|
|
23
151
|
/** The scopes written since the panel last drew, by scope ID. */
|
|
24
152
|
written: Set<ScopeId>;
|
|
25
153
|
/** The URL prefix of the inspect endpoint of the dev server. */
|
|
26
154
|
endpoint: string;
|
|
155
|
+
/** The versions of brumate and Vite, from the plugin. */
|
|
156
|
+
meta: DevtoolsMeta;
|
|
157
|
+
/** The errors of the page, oldest first. */
|
|
158
|
+
errors: ErrorEntry[];
|
|
159
|
+
/** The handlers that ran, oldest first, with their calls and updates. */
|
|
160
|
+
timeline: Interaction[];
|
|
161
|
+
/** The effects and `$client` callbacks that ran, by scope and name. */
|
|
162
|
+
effects: Map<string, EffectEntry>;
|
|
163
|
+
/** The client navigations of the page, newest last, at most 20. */
|
|
164
|
+
navigations: NavigationReport[];
|
|
165
|
+
/** Opens the panel on a tab, such as `errors`. */
|
|
166
|
+
open?: (tab: string) => void;
|
|
167
|
+
/** Shows the number of errors on the tab. */
|
|
168
|
+
errorCount?: () => void;
|
|
169
|
+
/** True while the elements that change are outlined on the page. */
|
|
170
|
+
flash: boolean;
|
|
171
|
+
/** Turns the outlines of changed elements on or off, and keeps the choice. */
|
|
172
|
+
setFlash?: (on: boolean) => void;
|
|
173
|
+
/** While the panel is open: sets its top edge to a place of the pointer, and keeps it. */
|
|
174
|
+
resize?: (clientY: number) => void;
|
|
175
|
+
resized?: () => void;
|
|
27
176
|
/** Called after each change, while the panel is open. */
|
|
28
177
|
changed?: () => void;
|
|
29
178
|
}
|
|
30
179
|
/** The root scope of a scope, whose `m` names its component. */
|
|
31
|
-
export declare function
|
|
180
|
+
export declare function findRootScope(scope: Scope): Scope;
|
|
32
181
|
/** A short text for a value in the log. */
|
|
33
182
|
export declare function preview(value: unknown): string;
|
|
183
|
+
/**
|
|
184
|
+
* Reads the blocks of the page from their markers, and updates their state.
|
|
185
|
+
* Returns true when something changed.
|
|
186
|
+
*
|
|
187
|
+
* - `#defer`: a `<template b-defer>`, and `<!--l…-->` around its fallback until its body arrives.
|
|
188
|
+
* - `#loading`: `<!--l…-->` around its fallback until the server streams its body.
|
|
189
|
+
* - `#client`: a `<template b-client>` with a `#k` reference, and a marker that gets `:1` once
|
|
190
|
+
* its body rendered.
|
|
191
|
+
* - `$client`: a `<template b-client>` with a `#c` reference.
|
|
192
|
+
*/
|
|
193
|
+
export declare function scanBlocks(state: DevtoolsState): boolean;
|
|
194
|
+
/**
|
|
195
|
+
* Adds an error to the Errors tab. An error of the server or of Vite opens
|
|
196
|
+
* the panel on it, as Vite's overlay would. An error of the browser only
|
|
197
|
+
* counts on the button.
|
|
198
|
+
*/
|
|
199
|
+
export declare function reportError(state: DevtoolsState, payload: ErrorPayload, source: ErrorEntry["source"]): void;
|
|
34
200
|
/** Listens to the core, and adds the button that opens the panel. */
|
|
35
|
-
export declare function installDevtools(endpoint?: string, rpc?: string): DevtoolsState;
|
|
201
|
+
export declare function installDevtools(endpoint?: string, rpc?: string, meta?: DevtoolsMeta, hot?: HotContext): DevtoolsState;
|
|
36
202
|
//#endregion
|
|
203
|
+
export {};
|
|
37
204
|
//# sourceMappingURL=devtools.d.ts.map
|
package/dist/runtime/devtools.js
CHANGED
|
@@ -1 +1,3 @@
|
|
|
1
|
-
|
|
1
|
+
import { t as LOGO } from "../logo-DQ_OYhBi.js";
|
|
2
|
+
import { a as scanBlocks, i as reportError, n as installDevtools, r as preview, t as findRootScope } from "../devtools-4uTPwR_v.js";
|
|
3
|
+
export { LOGO, findRootScope, installDevtools, preview, reportError, scanBlocks };
|
package/dist/runtime/env.js
CHANGED
|
@@ -30,7 +30,7 @@ function defineEnv(schema, options = {}) {
|
|
|
30
30
|
const result = props.validate(input);
|
|
31
31
|
if (result instanceof Promise) throw new TypeError(`The schema of ${name} validates asynchronously. Use one that does not wait`);
|
|
32
32
|
if (result.issues) {
|
|
33
|
-
problems.push(input === void 0 ? `${name} is missing` : `${name} is invalid${isServer ? issuePaths(result.issues) : `: ${result.issues
|
|
33
|
+
problems.push(input === void 0 ? `${name} is missing` : `${name} is invalid${isServer ? issuePaths(result.issues) : `: ${issueMessages(result.issues)}`}`);
|
|
34
34
|
continue;
|
|
35
35
|
}
|
|
36
36
|
values[name] = result.value;
|
|
@@ -42,13 +42,25 @@ function defineEnv(schema, options = {}) {
|
|
|
42
42
|
if (problems.length > 0) throw new Error(`Environment variables: ${problems.join(". ")}`);
|
|
43
43
|
return Object.freeze(values);
|
|
44
44
|
}
|
|
45
|
+
/** The messages of the issues of a variable, joined. */
|
|
46
|
+
function issueMessages(issues) {
|
|
47
|
+
const messages = [];
|
|
48
|
+
for (const issue of issues) messages.push(issue.message);
|
|
49
|
+
return messages.join("; ");
|
|
50
|
+
}
|
|
45
51
|
/**
|
|
46
52
|
* Where the issues of a server variable are, such as ` at port`. The
|
|
47
53
|
* messages of some schema libraries hold the value, which is a secret, so
|
|
48
54
|
* the error leaves them out.
|
|
49
55
|
*/
|
|
50
56
|
function issuePaths(issues) {
|
|
51
|
-
const paths =
|
|
57
|
+
const paths = [];
|
|
58
|
+
for (const issue of issues) {
|
|
59
|
+
const keys = [];
|
|
60
|
+
for (const segment of issue.path ?? []) keys.push(String(typeof segment === "object" ? segment.key : segment));
|
|
61
|
+
const path = keys.join(".");
|
|
62
|
+
if (path !== "") paths.push(path);
|
|
63
|
+
}
|
|
52
64
|
return paths.length > 0 ? ` at ${paths.join(", ")}` : "";
|
|
53
65
|
}
|
|
54
66
|
/** The variables of the process, where there is one. */
|
package/dist/runtime/env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"env.js","names":[],"sources":["../../src/runtime/env.ts"],"sourcesContent":["// Environment variables, checked with a schema when the server starts. The\n// app declares them in one file, `src/env.ts`, split into server and public\n// values. Server values never reach the browser: the Vite plugin gives the\n// browser a copy of the file without them.\n\nimport { addSecret } from './secrets.ts';\nimport type { StandardSchemaV1 } from './standard-schema.ts';\n\n/** A schema for each variable, by name. */\nexport type EnvSchemas = Record<string, StandardSchemaV1>;\n\nexport interface EnvSchema {\n /** Variables that only the server reads, such as secrets. */\n server?: EnvSchemas;\n /** Variables that the browser reads too. The client build has their values. */\n public?: EnvSchemas;\n}\n\n/** The output of each schema of a group, by name. */\ntype Outputs<S extends EnvSchemas | undefined> = S extends EnvSchemas\n ? { readonly [K in keyof S]: StandardSchemaV1.InferOutput<S[K]> }\n : // oxlint-disable-next-line typescript/no-empty-object-type -- No variables add no fields.\n {};\n\n/** The values of the variables that a schema declares. */\nexport type Env<S extends EnvSchema> = Outputs<S['server']> & Outputs<S['public']>;\n\nexport interface EnvOptions {\n /**\n * Where the values come from. Defaults to `process.env`. The client\n * build passes the values of the public variables, read when it ran.\n */\n source?: Record<string, string | undefined>;\n}\n\n/**\n * Checks the environment variables of the app, and returns their values\n * with their types:\n *\n * ```ts\n * // src/env.ts\n * import { defineEnv } from 'brumate/env';\n * import * as v from 'valibot';\n *\n * export default defineEnv({\n * server: { DATABASE_URL: v.pipe(v.string(), v.url()) },\n * public: { SITE_NAME: v.optional(v.string(), 'Tracker') },\n * });\n * ```\n *\n * Every variable is checked when the file loads, so a server that starts\n * without a secret fails at once, with every missing or wrong variable in\n * the message. A schema must validate without waiting.\n */\nexport function defineEnv<const S extends EnvSchema>(schema: S, options: EnvOptions = {}): Env<S> {\n const source = options.source ?? processEnv();\n const values: Record<string, unknown> = {};\n const problems: string[] = [];\n for (const [group, isServer] of [\n [schema.server, true],\n [schema.public, false],\n ] as const) {\n for (const [name, variable] of Object.entries(group ?? {})) {\n const props = variable['~standard'];\n if (props?.version !== 1 || typeof props.validate !== 'function') {\n throw new TypeError(`The schema of ${name} is not a Standard Schema of version 1`);\n }\n const input = source[name];\n const result = props.validate(input);\n if (result instanceof Promise) {\n throw new TypeError(\n `The schema of ${name} validates asynchronously. Use one that does not wait`,\n );\n }\n if (result.issues) {\n problems.push(\n input === undefined\n ? `${name} is missing`\n : `${name} is invalid${isServer ? issuePaths(result.issues) : `: ${result.issues
|
|
1
|
+
{"version":3,"file":"env.js","names":[],"sources":["../../src/runtime/env.ts"],"sourcesContent":["// Environment variables, checked with a schema when the server starts. The\n// app declares them in one file, `src/env.ts`, split into server and public\n// values. Server values never reach the browser: the Vite plugin gives the\n// browser a copy of the file without them.\n\nimport { addSecret } from './secrets.ts';\nimport type { StandardSchemaV1 } from './standard-schema.ts';\n\n/** A schema for each variable, by name. */\nexport type EnvSchemas = Record<string, StandardSchemaV1>;\n\nexport interface EnvSchema {\n /** Variables that only the server reads, such as secrets. */\n server?: EnvSchemas;\n /** Variables that the browser reads too. The client build has their values. */\n public?: EnvSchemas;\n}\n\n/** The output of each schema of a group, by name. */\ntype Outputs<S extends EnvSchemas | undefined> = S extends EnvSchemas\n ? { readonly [K in keyof S]: StandardSchemaV1.InferOutput<S[K]> }\n : // oxlint-disable-next-line typescript/no-empty-object-type -- No variables add no fields.\n {};\n\n/** The values of the variables that a schema declares. */\nexport type Env<S extends EnvSchema> = Outputs<S['server']> & Outputs<S['public']>;\n\nexport interface EnvOptions {\n /**\n * Where the values come from. Defaults to `process.env`. The client\n * build passes the values of the public variables, read when it ran.\n */\n source?: Record<string, string | undefined>;\n}\n\n/**\n * Checks the environment variables of the app, and returns their values\n * with their types:\n *\n * ```ts\n * // src/env.ts\n * import { defineEnv } from 'brumate/env';\n * import * as v from 'valibot';\n *\n * export default defineEnv({\n * server: { DATABASE_URL: v.pipe(v.string(), v.url()) },\n * public: { SITE_NAME: v.optional(v.string(), 'Tracker') },\n * });\n * ```\n *\n * Every variable is checked when the file loads, so a server that starts\n * without a secret fails at once, with every missing or wrong variable in\n * the message. A schema must validate without waiting.\n */\nexport function defineEnv<const S extends EnvSchema>(schema: S, options: EnvOptions = {}): Env<S> {\n const source = options.source ?? processEnv();\n const values: Record<string, unknown> = {};\n const problems: string[] = [];\n for (const [group, isServer] of [\n [schema.server, true],\n [schema.public, false],\n ] as const) {\n for (const [name, variable] of Object.entries(group ?? {})) {\n const props = variable['~standard'];\n if (props?.version !== 1 || typeof props.validate !== 'function') {\n throw new TypeError(`The schema of ${name} is not a Standard Schema of version 1`);\n }\n const input = source[name];\n const result = props.validate(input);\n if (result instanceof Promise) {\n throw new TypeError(\n `The schema of ${name} validates asynchronously. Use one that does not wait`,\n );\n }\n if (result.issues) {\n problems.push(\n input === undefined\n ? `${name} is missing`\n : `${name} is invalid${isServer ? issuePaths(result.issues) : `: ${issueMessages(result.issues)}`}`,\n );\n continue;\n }\n values[name] = result.value;\n if (isServer) {\n addSecret(input);\n addSecret(result.value);\n }\n }\n }\n if (problems.length > 0) {\n throw new Error(`Environment variables: ${problems.join('. ')}`);\n }\n return Object.freeze(values) as Env<S>;\n}\n\n/** The messages of the issues of a variable, joined. */\nfunction issueMessages(issues: readonly StandardSchemaV1.Issue[]): string {\n const messages: string[] = [];\n for (const issue of issues) {\n messages.push(issue.message);\n }\n return messages.join('; ');\n}\n\n/**\n * Where the issues of a server variable are, such as ` at port`. The\n * messages of some schema libraries hold the value, which is a secret, so\n * the error leaves them out.\n */\nfunction issuePaths(issues: readonly StandardSchemaV1.Issue[]): string {\n const paths: string[] = [];\n for (const issue of issues) {\n const keys: string[] = [];\n for (const segment of issue.path ?? []) {\n keys.push(String(typeof segment === 'object' ? segment.key : segment));\n }\n const path = keys.join('.');\n if (path !== '') {\n paths.push(path);\n }\n }\n return paths.length > 0 ? ` at ${paths.join(', ')}` : '';\n}\n\n/** The variables of the process, where there is one. */\nfunction processEnv(): Record<string, string | undefined> {\n const process = (globalThis as { process?: { env?: Record<string, string | undefined> } })\n .process;\n return process?.env ?? {};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAsDA,SAAgB,UAAqC,QAAW,UAAsB,CAAC,GAAW;CAChG,MAAM,SAAS,QAAQ,UAAU,WAAW;CAC5C,MAAM,SAAkC,CAAC;CACzC,MAAM,WAAqB,CAAC;CAC5B,KAAK,MAAM,CAAC,OAAO,aAAa,CAC9B,CAAC,OAAO,QAAQ,IAAI,GACpB,CAAC,OAAO,QAAQ,KAAK,CACvB,GACE,KAAK,MAAM,CAAC,MAAM,aAAa,OAAO,QAAQ,SAAS,CAAC,CAAC,GAAG;EAC1D,MAAM,QAAQ,SAAS;EACvB,IAAI,OAAO,YAAY,KAAK,OAAO,MAAM,aAAa,YACpD,MAAM,IAAI,UAAU,iBAAiB,KAAK,uCAAuC;EAEnF,MAAM,QAAQ,OAAO;EACrB,MAAM,SAAS,MAAM,SAAS,KAAK;EACnC,IAAI,kBAAkB,SACpB,MAAM,IAAI,UACR,iBAAiB,KAAK,sDACxB;EAEF,IAAI,OAAO,QAAQ;GACjB,SAAS,KACP,UAAU,KAAA,IACN,GAAG,KAAK,eACR,GAAG,KAAK,aAAa,WAAW,WAAW,OAAO,MAAM,IAAI,KAAK,cAAc,OAAO,MAAM,KAClG;GACA;EACF;EACA,OAAO,QAAQ,OAAO;EACtB,IAAI,UAAU;GACZ,UAAU,KAAK;GACf,UAAU,OAAO,KAAK;EACxB;CACF;CAEF,IAAI,SAAS,SAAS,GACpB,MAAM,IAAI,MAAM,0BAA0B,SAAS,KAAK,IAAI,GAAG;CAEjE,OAAO,OAAO,OAAO,MAAM;AAC7B;;AAGA,SAAS,cAAc,QAAmD;CACxE,MAAM,WAAqB,CAAC;CAC5B,KAAK,MAAM,SAAS,QAClB,SAAS,KAAK,MAAM,OAAO;CAE7B,OAAO,SAAS,KAAK,IAAI;AAC3B;;;;;;AAOA,SAAS,WAAW,QAAmD;CACrE,MAAM,QAAkB,CAAC;CACzB,KAAK,MAAM,SAAS,QAAQ;EAC1B,MAAM,OAAiB,CAAC;EACxB,KAAK,MAAM,WAAW,MAAM,QAAQ,CAAC,GACnC,KAAK,KAAK,OAAO,OAAO,YAAY,WAAW,QAAQ,MAAM,OAAO,CAAC;EAEvE,MAAM,OAAO,KAAK,KAAK,GAAG;EAC1B,IAAI,SAAS,IACX,MAAM,KAAK,IAAI;CAEnB;CACA,OAAO,MAAM,SAAS,IAAI,OAAO,MAAM,KAAK,IAAI,MAAM;AACxD;;AAGA,SAAS,aAAiD;CAGxD,OAFiB,WACd,SACa,OAAO,CAAC;AAC1B"}
|
package/dist/runtime/events.d.ts
CHANGED
|
@@ -4,8 +4,15 @@ export declare const KEY_NAMES: readonly string[];
|
|
|
4
4
|
type Letter = "a" | "b" | "c" | "d" | "e" | "f" | "g" | "h" | "i" | "j" | "k" | "l" | "m" | "n" | "o" | "p" | "q" | "r" | "s" | "t" | "u" | "v" | "w" | "x" | "y" | "z";
|
|
5
5
|
type Digit = "0" | "1" | "2" | "3" | "4" | "5" | "6" | "7" | "8" | "9";
|
|
6
6
|
type FunctionKey = `F${1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12}`;
|
|
7
|
+
/**
|
|
8
|
+
* A key of `prevent`: a key by its `event.key`, or that key with a modifier that must be held,
|
|
9
|
+
* such as `Mod+ArrowDown`. A key alone matches only while Ctrl, Meta and Alt are up, so the
|
|
10
|
+
* shortcuts of the browser, such as Cmd+Left or Alt+Left, keep their default. `Mod` is Ctrl or
|
|
11
|
+
* Meta.
|
|
12
|
+
*/
|
|
13
|
+
export type KeyName = Key | `${"Mod" | "Ctrl" | "Meta" | "Alt"}+${Key}`;
|
|
7
14
|
/** A key by its `event.key`: a named key, a letter or a digit. */
|
|
8
|
-
|
|
15
|
+
type Key = "Enter" | "Escape" | "Tab" | "Space" | "Backspace" | "Delete" | "Insert" | "ArrowUp" | "ArrowDown" | "ArrowLeft" | "ArrowRight" | "Home" | "End" | "PageUp" | "PageDown" | "ContextMenu" | FunctionKey | Letter | Uppercase<Letter> | Digit;
|
|
9
16
|
/** The modifiers of a handler, which `spread` writes into `b-on`. A symbol of the registry. */
|
|
10
17
|
export declare const MODIFIERS: unique symbol;
|
|
11
18
|
/** A handler with the modifiers of its wrappers. */
|
|
@@ -20,8 +27,38 @@ export declare function prevent<H extends Handler>(handler: H, ...keys: KeyName[
|
|
|
20
27
|
export declare function stop<H extends Handler>(handler: H): H;
|
|
21
28
|
/** Runs the handler for the first event only. */
|
|
22
29
|
export declare function once<H extends Handler>(handler: H): H;
|
|
30
|
+
/**
|
|
31
|
+
* Runs the handler inside a view transition, so the browser animates the
|
|
32
|
+
* change of the page, such as an element that `#if` removes or a list that
|
|
33
|
+
* changes order. CSS styles the animation, with `view-transition-name` and
|
|
34
|
+
* `::view-transition-*`.
|
|
35
|
+
*
|
|
36
|
+
* - The transition holds the writes that the handler makes before its first
|
|
37
|
+
* `await`. Writes after it, such as after a server call, change the page
|
|
38
|
+
* without an animation.
|
|
39
|
+
* - `types` are the types of the transition, which `:active-view-transition-type()`
|
|
40
|
+
* matches in CSS.
|
|
41
|
+
* - Without view transitions, or with `prefers-reduced-motion`, the handler
|
|
42
|
+
* runs as it is.
|
|
43
|
+
*/
|
|
44
|
+
export declare function transition<H extends Handler>(handler: H, ...types: string[]): H;
|
|
23
45
|
/** Runs the handler before the handlers of the elements inside, as a listener in the capture phase. */
|
|
24
46
|
export declare function capture<H extends Handler>(handler: H): H;
|
|
47
|
+
/** The events that `cancelWhen` can cancel. Scroll-type events cannot be, for their listeners are passive. */
|
|
48
|
+
export type CancelableEvent = "click" | "submit";
|
|
49
|
+
/**
|
|
50
|
+
* Cancels an event of the element, or of an element inside it, before any handler of brumate
|
|
51
|
+
* runs, while `check` returns true. The document listener of brumate calls `preventDefault()` and
|
|
52
|
+
* runs no brumate handler for the event. It does not stop the event, so listeners that were added
|
|
53
|
+
* with `addEventListener` still run, and they can read `event.defaultPrevented`.
|
|
54
|
+
*
|
|
55
|
+
* Returns a function that removes the check.
|
|
56
|
+
*
|
|
57
|
+
* ```ts
|
|
58
|
+
* const stop = cancelWhen(form, 'submit', () => form.hasAttribute('data-pending'));
|
|
59
|
+
* ```
|
|
60
|
+
*/
|
|
61
|
+
export declare function cancelWhen<T extends CancelableEvent>(element: Element, type: T, check: (event: HTMLElementEventMap[T]) => boolean): () => void;
|
|
25
62
|
//#endregion
|
|
26
63
|
export {};
|
|
27
64
|
//# sourceMappingURL=events.d.ts.map
|
package/dist/runtime/events.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as KEY_NAMES, n as MODIFIERS, r as
|
|
1
|
+
export { t as KEY_NAMES, n as MODIFIERS, r as cancelWhen, i as capture, a as once, o as prevent, s as stop, c as transition } from "../events-LgLdp1R7.js";
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import { A as intentValue, C as formFields, D as getFormErrors, E as getAt, F as validateForm, I as validateValues, M as parseIntent, N as parsePath, O as groupIssues, P as setAt, S as checkedSince, T as formatPath, _ as PathSegment, a as FieldAttributes, b as applyLocalIntent, c as FormErrors, d as INTENT, f as Intent, g as MAX_INDEX, h as LocalChanges, i as Field, j as localSince, k as intentButton, l as FormIssue, m as ListItem, n as DEFAULT_SUBMIT, o as FieldState, p as IntentAttributes, r as FORBIDDEN, s as Fields, t as CheckedErrors, u as FormState, v as SubmissionResult, w as formValues, x as checkField, y as applyIntent } from "../forms-j1xPAR14.js";
|
|
2
|
+
export { CheckedErrors, DEFAULT_SUBMIT, FORBIDDEN, Field, FieldAttributes, FieldState, Fields, FormErrors, FormIssue, FormState, INTENT, Intent, IntentAttributes, ListItem, LocalChanges, MAX_INDEX, PathSegment, SubmissionResult, applyIntent, applyLocalIntent, checkField, checkedSince, formFields, formValues, formatPath, getAt, getFormErrors, groupIssues, intentButton, intentValue, localSince, parseIntent, parsePath, setAt, validateForm, validateValues };
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { t as DEFAULT_SUBMIT, n as FORBIDDEN, r as INTENT, i as MAX_INDEX, a as applyIntent, o as applyLocalIntent, s as checkField, c as checkedSince, l as formFields, u as formValues, d as formatPath, f as getAt, p as getFormErrors, m as groupIssues, h as intentButton, g as intentValue, _ as localSince, v as parseIntent, y as parsePath, b as setAt, x as validateForm, S as validateValues } from "../forms-nXK7-Lv_.js";
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
//#region src/runtime/gather.d.ts
|
|
2
|
+
export interface GatherOptions<T> {
|
|
3
|
+
/**
|
|
4
|
+
* The key of an item. A value with a key that the stream sent before
|
|
5
|
+
* takes the place of that item, so a stream can update an item in place.
|
|
6
|
+
*/
|
|
7
|
+
key?: (item: T) => unknown;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Gathers the values of a stream into a list, and gives the list so far
|
|
11
|
+
* after each one, starting with an empty list:
|
|
12
|
+
*
|
|
13
|
+
* ```ts
|
|
14
|
+
* const tokens = $memo(gather(reply(prompt)));
|
|
15
|
+
* ```
|
|
16
|
+
*
|
|
17
|
+
* - The memo starts again with an empty list when the stream changes, such
|
|
18
|
+
* as for a new prompt, and stops reading the older stream.
|
|
19
|
+
* - The empty list comes before the stream is read, so the server, which
|
|
20
|
+
* renders the first value of a memo, renders it without starting the
|
|
21
|
+
* stream. The list fills in the browser, when the memo runs there.
|
|
22
|
+
*/
|
|
23
|
+
export declare function gather<T>(stream: AsyncIterable<T> | PromiseLike<AsyncIterable<T>>, options?: GatherOptions<T>): AsyncGenerator<T[], void, undefined>;
|
|
24
|
+
//#endregion
|
|
25
|
+
//# sourceMappingURL=gather.d.ts.map
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
//#region src/runtime/gather.ts
|
|
2
|
+
/**
|
|
3
|
+
* Gathers the values of a stream into a list, and gives the list so far
|
|
4
|
+
* after each one, starting with an empty list:
|
|
5
|
+
*
|
|
6
|
+
* ```ts
|
|
7
|
+
* const tokens = $memo(gather(reply(prompt)));
|
|
8
|
+
* ```
|
|
9
|
+
*
|
|
10
|
+
* - The memo starts again with an empty list when the stream changes, such
|
|
11
|
+
* as for a new prompt, and stops reading the older stream.
|
|
12
|
+
* - The empty list comes before the stream is read, so the server, which
|
|
13
|
+
* renders the first value of a memo, renders it without starting the
|
|
14
|
+
* stream. The list fills in the browser, when the memo runs there.
|
|
15
|
+
*/
|
|
16
|
+
async function* gather(stream, options = {}) {
|
|
17
|
+
yield [];
|
|
18
|
+
const items = [];
|
|
19
|
+
const places = /* @__PURE__ */ new Map();
|
|
20
|
+
for await (const item of await stream) {
|
|
21
|
+
const key = options.key?.(item);
|
|
22
|
+
const place = options.key ? places.get(key) : void 0;
|
|
23
|
+
if (place === void 0) {
|
|
24
|
+
if (options.key) places.set(key, items.length);
|
|
25
|
+
items.push(item);
|
|
26
|
+
} else items[place] = item;
|
|
27
|
+
yield [...items];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
//#endregion
|
|
31
|
+
export { gather };
|
|
32
|
+
|
|
33
|
+
//# sourceMappingURL=gather.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"gather.js","names":[],"sources":["../../src/runtime/gather.ts"],"sourcesContent":["// `brumate/stream`: a list that grows as a stream sends its values, such as\n// the reply of a language model, search results or log lines. A memo of it\n// gives the list so far, so `#for` renders each item as it arrives.\n\nexport interface GatherOptions<T> {\n /**\n * The key of an item. A value with a key that the stream sent before\n * takes the place of that item, so a stream can update an item in place.\n */\n key?: (item: T) => unknown;\n}\n\n/**\n * Gathers the values of a stream into a list, and gives the list so far\n * after each one, starting with an empty list:\n *\n * ```ts\n * const tokens = $memo(gather(reply(prompt)));\n * ```\n *\n * - The memo starts again with an empty list when the stream changes, such\n * as for a new prompt, and stops reading the older stream.\n * - The empty list comes before the stream is read, so the server, which\n * renders the first value of a memo, renders it without starting the\n * stream. The list fills in the browser, when the memo runs there.\n */\nexport async function* gather<T>(\n stream: AsyncIterable<T> | PromiseLike<AsyncIterable<T>>,\n options: GatherOptions<T> = {},\n): AsyncGenerator<T[], void, undefined> {\n yield [];\n const items: T[] = [];\n const places = new Map<unknown, number>();\n for await (const item of await stream) {\n const key = options.key?.(item);\n const place = options.key ? places.get(key) : undefined;\n if (place === undefined) {\n if (options.key) {\n places.set(key, items.length);\n }\n items.push(item);\n } else {\n items[place] = item;\n }\n // A new array, so the memo sees a new value.\n yield [...items];\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;AA0BA,gBAAuB,OACrB,QACA,UAA4B,CAAC,GACS;CACtC,MAAM,CAAC;CACP,MAAM,QAAa,CAAC;CACpB,MAAM,yBAAS,IAAI,IAAqB;CACxC,WAAW,MAAM,QAAQ,MAAM,QAAQ;EACrC,MAAM,MAAM,QAAQ,MAAM,IAAI;EAC9B,MAAM,QAAQ,QAAQ,MAAM,OAAO,IAAI,GAAG,IAAI,KAAA;EAC9C,IAAI,UAAU,KAAA,GAAW;GACvB,IAAI,QAAQ,KACV,OAAO,IAAI,KAAK,MAAM,MAAM;GAE9B,MAAM,KAAK,IAAI;EACjB,OACE,MAAM,SAAS;EAGjB,MAAM,CAAC,GAAG,KAAK;CACjB;AACF"}
|
package/dist/runtime/hot.d.ts
CHANGED
package/dist/runtime/hot.js
CHANGED
|
@@ -9,7 +9,9 @@ function hotLoad(hot, load) {
|
|
|
9
9
|
const fresh = /* @__PURE__ */ new Map();
|
|
10
10
|
hot.on("brumate:update", ({ updates, timestamp }) => {
|
|
11
11
|
const changed = [];
|
|
12
|
+
const remounts = [];
|
|
12
13
|
for (const update of updates) {
|
|
14
|
+
if (update.remount) remounts.push(update);
|
|
13
15
|
if (update.css !== void 0) {
|
|
14
16
|
const style = document.querySelector(`style[b-style="${CSS.escape(update.id)}"]`);
|
|
15
17
|
if (style) style.textContent = update.css;
|
|
@@ -20,12 +22,13 @@ function hotLoad(hot, load) {
|
|
|
20
22
|
}
|
|
21
23
|
}
|
|
22
24
|
if (changed.length > 0) document.dispatchEvent(new CustomEvent("brumate:hot", { detail: changed }));
|
|
23
|
-
const remounts = updates.filter((update) => update.remount);
|
|
24
25
|
if (changed.length === 0 && remounts.length === 0) return;
|
|
25
26
|
import("./client.js").then(({ forget, remount }) => {
|
|
26
27
|
forget(changed);
|
|
27
28
|
if (remounts.length > 0) {
|
|
28
|
-
|
|
29
|
+
const moved = [];
|
|
30
|
+
for (const update of remounts) moved.push(Object.assign({ id: update.id }, update.remount));
|
|
31
|
+
remount(moved);
|
|
29
32
|
document.dispatchEvent(new CustomEvent("brumate:reload"));
|
|
30
33
|
}
|
|
31
34
|
});
|
package/dist/runtime/hot.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"hot.js","names":[],"sources":["../../src/runtime/hot.ts"],"sourcesContent":["// Hot updates on the dev server. When an edit of a component keeps its\n// markup, its slots and its update table, the plugin sends `brumate:update`\n// instead of reloading the page. New styles replace the old ones, and the\n// next event or update of the component loads its new code. State stays.\n//\n// When the markup changes, the page loads again through the client router,\n// and the signals of the component keep their values, by their names.\n\nimport type { ClientModule } from './client.ts';\n\n/** What `brumate:update` holds for each component that changed. */\nexport interface HotUpdate {\n id: string;\n /** The new styles, when they changed. */\n css?: string;\n /** The URL of the new client entry, when its code changed. */\n url?: string;\n /** Set when the markup changed, so the page renders again with the values of its signals. */\n remount?: Remount;\n}\n\n/** The slots of a component before and after an edit, by the ID of each scope in the component. */\nexport interface Remount {\n /** The names of the slots before the edit. */\n before: Record<number, string[]>;\n /** The names of the slots after the edit. */\n after: Record<number, string[]>;\n /** The names of the signals, whose values stay. */\n signals: string[];\n}\n\n/** The part of `import.meta.hot` that this module uses. */\nexport interface HotContext {\n on(\n event: 'brumate:update',\n listener: (data: { updates: HotUpdate[]; timestamp: number }) => void,\n ): void;\n}\n\n/**\n * Listens for updates of components, and returns a `load` for the loader\n * that loads the new code of a component that changed. Pass\n * `import.meta.hot`, which only the module that reads it gets.\n */\nexport function hotLoad(\n hot: HotContext | undefined,\n load: (id: string) => Promise<ClientModule>,\n): (id: string) => Promise<ClientModule> {\n if (!hot) {\n return load;\n }\n const fresh = new Map<string, string>();\n hot.on('brumate:update', ({ updates, timestamp }) => {\n const changed: string[] = [];\n for (const update of updates) {\n if (update.css !== undefined) {\n const style = document.querySelector(`style[b-style=\"${CSS.escape(update.id)}\"]`);\n if (style) {\n style.textContent = update.css;\n }\n }\n if (update.url) {\n fresh.set(update.id, `${update.url}${update.url.includes('?') ? '&' : '?'}t=${timestamp}`);\n changed.push(update.id);\n }\n }\n if (changed.length > 0) {\n document.dispatchEvent(new CustomEvent('brumate:hot', { detail: changed }));\n }\n
|
|
1
|
+
{"version":3,"file":"hot.js","names":[],"sources":["../../src/runtime/hot.ts"],"sourcesContent":["// Hot updates on the dev server. When an edit of a component keeps its\n// markup, its slots and its update table, the plugin sends `brumate:update`\n// instead of reloading the page. New styles replace the old ones, and the\n// next event or update of the component loads its new code. State stays.\n//\n// When the markup changes, the page loads again through the client router,\n// and the signals of the component keep their values, by their names.\n\nimport type { ClientModule } from './client.ts';\n\n/** What `brumate:update` holds for each component that changed. */\nexport interface HotUpdate {\n id: string;\n /** The new styles, when they changed. */\n css?: string;\n /** The URL of the new client entry, when its code changed. */\n url?: string;\n /** Set when the markup changed, so the page renders again with the values of its signals. */\n remount?: Remount;\n}\n\n/** The slots of a component before and after an edit, by the ID of each scope in the component. */\nexport interface Remount {\n /** The names of the slots before the edit. */\n before: Record<number, string[]>;\n /** The names of the slots after the edit. */\n after: Record<number, string[]>;\n /** The names of the signals, whose values stay. */\n signals: string[];\n}\n\n/** The part of `import.meta.hot` that this module uses. */\nexport interface HotContext {\n on(\n event: 'brumate:update',\n listener: (data: { updates: HotUpdate[]; timestamp: number }) => void,\n ): void;\n}\n\n/**\n * Listens for updates of components, and returns a `load` for the loader\n * that loads the new code of a component that changed. Pass\n * `import.meta.hot`, which only the module that reads it gets.\n */\nexport function hotLoad(\n hot: HotContext | undefined,\n load: (id: string) => Promise<ClientModule>,\n): (id: string) => Promise<ClientModule> {\n if (!hot) {\n return load;\n }\n const fresh = new Map<string, string>();\n hot.on('brumate:update', ({ updates, timestamp }) => {\n const changed: string[] = [];\n const remounts: HotUpdate[] = [];\n for (const update of updates) {\n if (update.remount) {\n remounts.push(update);\n }\n if (update.css !== undefined) {\n const style = document.querySelector(`style[b-style=\"${CSS.escape(update.id)}\"]`);\n if (style) {\n style.textContent = update.css;\n }\n }\n if (update.url) {\n fresh.set(update.id, `${update.url}${update.url.includes('?') ? '&' : '?'}t=${timestamp}`);\n changed.push(update.id);\n }\n }\n if (changed.length > 0) {\n document.dispatchEvent(new CustomEvent('brumate:hot', { detail: changed }));\n }\n if (changed.length === 0 && remounts.length === 0) {\n return;\n }\n // The core has the hot update code, which only this module calls, so builds leave it out.\n void import('./client.ts').then(({ forget, remount }) => {\n // The core forgets the old code of these components.\n forget(changed);\n if (remounts.length > 0) {\n // The core keeps the values of the signals, and the loader loads the page again.\n const moved: Parameters<typeof remount>[0] = [];\n for (const update of remounts) {\n moved.push(Object.assign({ id: update.id }, update.remount!));\n }\n remount(moved);\n document.dispatchEvent(new CustomEvent('brumate:reload'));\n }\n });\n });\n return (id) => {\n const url = fresh.get(id);\n return url ? (import(/* @vite-ignore */ url) as Promise<ClientModule>) : load(id);\n };\n}\n"],"mappings":";;;;;;AA4CA,SAAgB,QACd,KACA,MACuC;CACvC,IAAI,CAAC,KACH,OAAO;CAET,MAAM,wBAAQ,IAAI,IAAoB;CACtC,IAAI,GAAG,mBAAmB,EAAE,SAAS,gBAAgB;EACnD,MAAM,UAAoB,CAAC;EAC3B,MAAM,WAAwB,CAAC;EAC/B,KAAK,MAAM,UAAU,SAAS;GAC5B,IAAI,OAAO,SACT,SAAS,KAAK,MAAM;GAEtB,IAAI,OAAO,QAAQ,KAAA,GAAW;IAC5B,MAAM,QAAQ,SAAS,cAAc,kBAAkB,IAAI,OAAO,OAAO,EAAE,EAAE,GAAG;IAChF,IAAI,OACF,MAAM,cAAc,OAAO;GAE/B;GACA,IAAI,OAAO,KAAK;IACd,MAAM,IAAI,OAAO,IAAI,GAAG,OAAO,MAAM,OAAO,IAAI,SAAS,GAAG,IAAI,MAAM,IAAI,IAAI,WAAW;IACzF,QAAQ,KAAK,OAAO,EAAE;GACxB;EACF;EACA,IAAI,QAAQ,SAAS,GACnB,SAAS,cAAc,IAAI,YAAY,eAAe,EAAE,QAAQ,QAAQ,CAAC,CAAC;EAE5E,IAAI,QAAQ,WAAW,KAAK,SAAS,WAAW,GAC9C;EAGF,OAAY,cAAc,CAAC,MAAM,EAAE,QAAQ,cAAc;GAEvD,OAAO,OAAO;GACd,IAAI,SAAS,SAAS,GAAG;IAEvB,MAAM,QAAuC,CAAC;IAC9C,KAAK,MAAM,UAAU,UACnB,MAAM,KAAK,OAAO,OAAO,EAAE,IAAI,OAAO,GAAG,GAAG,OAAO,OAAQ,CAAC;IAE9D,QAAQ,KAAK;IACb,SAAS,cAAc,IAAI,YAAY,gBAAgB,CAAC;GAC1D;EACF,CAAC;CACH,CAAC;CACD,QAAQ,OAAO;EACb,MAAM,MAAM,MAAM,IAAI,EAAE;EACxB,OAAO,MAAO;;GAA0B;IAAiC,KAAK,EAAE;CAClF;AACF"}
|
package/dist/runtime/html.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { _ as
|
|
2
|
-
export { Raw, VOID_ELEMENTS, actionAttributes, affix, attribute, attributeText, classAttribute, classValue, escape, escapeAttribute, insertValue, isRaw, mergeAttributes, raw, rawHTML, spread, styleElement, textValue, vars };
|
|
1
|
+
import { C as spread, E as vars, S as rawHTML, T as textValue, _ as mergeAttributes, a as affix, b as ownValue, c as bindEntry, d as escape, f as escapeAttribute, g as isRaw, h as internal, i as actionAttributes, l as classAttribute, m as insertValue, n as Raw, o as attribute, p as handlerEntry, r as VOID_ELEMENTS, s as attributeText, t as Internal, u as classValue, v as onAttribute, w as styleElement, x as raw, y as onValue } from "../html-Bw9Qwu6F.js";
|
|
2
|
+
export { Internal, Raw, VOID_ELEMENTS, actionAttributes, affix, attribute, attributeText, bindEntry, classAttribute, classValue, escape, escapeAttribute, handlerEntry, insertValue, internal, isRaw, mergeAttributes, onAttribute, onValue, ownValue, raw, rawHTML, spread, styleElement, textValue, vars };
|
package/dist/runtime/html.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { t as
|
|
1
|
+
export { t as Internal, n as VOID_ELEMENTS, r as actionAttributes, i as affix, a as attribute, o as attributeText, s as bindEntry, c as classAttribute, l as classValue, u as escape, d as escapeAttribute, f as handlerEntry, p as insertValue, m as internal, h as isRaw, g as mergeAttributes, _ as onAttribute, v as onValue, y as ownValue, b as raw, x as rawHTML, S as spread, C as styleElement, w as textValue, T as vars } from "../html-BtKRyi7g.js";
|
package/dist/runtime/loader.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { n as NavigateOptions, t as LoaderOptions } from "../boot-
|
|
2
|
-
import { t as startWithoutNavigation } from "../static-loader-
|
|
1
|
+
import { n as NavigateOptions, t as LoaderOptions } from "../boot-DLlRmD9z.js";
|
|
2
|
+
import { t as startWithoutNavigation } from "../static-loader-BGgdp_Y5.js";
|
|
3
3
|
//#region src/runtime/loader.d.ts
|
|
4
4
|
/**
|
|
5
5
|
* Starts resuming the page. Listens to the events in `b-on` attributes
|
package/dist/runtime/loader.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
import { t as startWithoutNavigation } from "../static-loader-
|
|
2
|
-
import { t as start } from "../loader-
|
|
1
|
+
import { t as startWithoutNavigation } from "../static-loader-BZR17hSw.js";
|
|
2
|
+
import { t as start } from "../loader-BjKGJzLN.js";
|
|
3
3
|
export { start, startWithoutNavigation };
|
package/dist/runtime/routes.js
CHANGED
|
@@ -9,7 +9,10 @@ function href(path, ...[params]) {
|
|
|
9
9
|
return path.replace(/\[(\.\.\.)?([^\]]+)\]/g, (_, rest, name) => {
|
|
10
10
|
const value = values[name];
|
|
11
11
|
if (value === void 0 || value === "") throw new Error(`The param ${name} of ${path} is missing`);
|
|
12
|
-
|
|
12
|
+
if (!rest) return encodeURIComponent(String(value));
|
|
13
|
+
const parts = [];
|
|
14
|
+
for (const part of String(value).split("/")) parts.push(encodeURIComponent(part));
|
|
15
|
+
return parts.join("/");
|
|
13
16
|
});
|
|
14
17
|
}
|
|
15
18
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"routes.js","names":[],"sources":["../../src/runtime/routes.ts"],"sourcesContent":["// Links to routes, checked against the route files. The Vite plugin writes\n// the paths into `Routes` in a declaration file, such as\n// `src/brumate-routes.d.ts`.\n\n/**\n * The paths of the routes, with their params, such as\n * `'/todos/[id]': { id: string }`. The Vite plugin adds them.\n */\n// oxlint-disable-next-line typescript/no-empty-interface, typescript/no-empty-object-type -- Declaration files add the routes.\nexport interface Routes {}\n\n/** A route path, such as `/todos/[id]`. Any string while no routes are declared. */\nexport type RoutePath = [keyof Routes] extends [never] ? string : keyof Routes & string;\n\n/** The params of a route path, such as `{ id: string }` for `/todos/[id]`. */\nexport type RouteParams<P extends RoutePath> = P extends keyof Routes\n ? Routes[P]\n : Record<string, string>;\n\n/** The arguments after the path: none for a path without params. */\ntype ParamsArgument<P extends RoutePath> = [keyof RouteParams<P>] extends [never]\n ? [params?: RouteParams<P>]\n : [params: RouteParams<P>];\n\n/**\n * The URL of a route, with its params in place:\n * `href('/todos/[id]', { id: '3' })` is `/todos/3`. A rest param, such as\n * `[...path]`, keeps its slashes.\n */\nexport function href<P extends RoutePath>(path: P, ...[params]: ParamsArgument<P>): string {\n const values = (params ?? {}) as Record<string, string>;\n return path.replace(/\\[(\\.\\.\\.)?([^\\]]+)\\]/g, (_, rest: string | undefined, name: string) => {\n const value = values[name];\n if (value === undefined || value === '') {\n throw new Error(`The param ${name} of ${path} is missing`);\n }\n
|
|
1
|
+
{"version":3,"file":"routes.js","names":[],"sources":["../../src/runtime/routes.ts"],"sourcesContent":["// Links to routes, checked against the route files. The Vite plugin writes\n// the paths into `Routes` in a declaration file, such as\n// `src/brumate-routes.d.ts`.\n\n/**\n * The paths of the routes, with their params, such as\n * `'/todos/[id]': { id: string }`. The Vite plugin adds them.\n */\n// oxlint-disable-next-line typescript/no-empty-interface, typescript/no-empty-object-type -- Declaration files add the routes.\nexport interface Routes {}\n\n/** A route path, such as `/todos/[id]`. Any string while no routes are declared. */\nexport type RoutePath = [keyof Routes] extends [never] ? string : keyof Routes & string;\n\n/** The params of a route path, such as `{ id: string }` for `/todos/[id]`. */\nexport type RouteParams<P extends RoutePath> = P extends keyof Routes\n ? Routes[P]\n : Record<string, string>;\n\n/** The arguments after the path: none for a path without params. */\ntype ParamsArgument<P extends RoutePath> = [keyof RouteParams<P>] extends [never]\n ? [params?: RouteParams<P>]\n : [params: RouteParams<P>];\n\n/**\n * The URL of a route, with its params in place:\n * `href('/todos/[id]', { id: '3' })` is `/todos/3`. A rest param, such as\n * `[...path]`, keeps its slashes.\n */\nexport function href<P extends RoutePath>(path: P, ...[params]: ParamsArgument<P>): string {\n const values = (params ?? {}) as Record<string, string>;\n return path.replace(/\\[(\\.\\.\\.)?([^\\]]+)\\]/g, (_, rest: string | undefined, name: string) => {\n const value = values[name];\n if (value === undefined || value === '') {\n throw new Error(`The param ${name} of ${path} is missing`);\n }\n if (!rest) {\n return encodeURIComponent(String(value));\n }\n const parts: string[] = [];\n for (const part of String(value).split('/')) {\n parts.push(encodeURIComponent(part));\n }\n return parts.join('/');\n });\n}\n\nexport interface NavigateOptions {\n /** Replaces the current entry of the history instead of adding one. */\n replace?: boolean;\n /** Scrolls to the top of the new page, or to its hash. Defaults to true. False keeps the place. */\n scroll?: boolean;\n}\n\n/**\n * Loads a page as a link does: the layouts that stay keep their state. It\n * returns when the page shows. A URL of another origin, or a page without\n * the loader, loads in full.\n *\n * ```ts\n * await navigate(href('/issues/[id]', { id: issue.id }));\n * navigate(`?q=${query}`, { replace: true });\n * ```\n */\nexport function navigate(to: string, options: NavigateOptions = {}): Promise<void> {\n const url = new URL(to, location.href);\n // A `javascript:` URL would run its script, so only web pages load.\n if (url.protocol !== 'http:' && url.protocol !== 'https:') {\n return Promise.reject(new TypeError(`navigate loads http and https URLs, not ${url.protocol}`));\n }\n if (url.origin !== location.origin) {\n location.assign(url.href);\n return new Promise(() => {});\n }\n return new Promise((resolve) => {\n const event = new CustomEvent('brumate:navigate', {\n cancelable: true,\n detail: {\n url: url.href,\n replace: options.replace === true,\n scroll: options.scroll !== false,\n done: resolve,\n },\n });\n // The loader answers the event. Without it, the page loads in full.\n if (document.dispatchEvent(event)) {\n location.assign(url.href);\n }\n });\n}\n"],"mappings":";;;;;;AA6BA,SAAgB,KAA0B,MAAS,GAAG,CAAC,SAAoC;CACzF,MAAM,SAAU,UAAU,CAAC;CAC3B,OAAO,KAAK,QAAQ,2BAA2B,GAAG,MAA0B,SAAiB;EAC3F,MAAM,QAAQ,OAAO;EACrB,IAAI,UAAU,KAAA,KAAa,UAAU,IACnC,MAAM,IAAI,MAAM,aAAa,KAAK,MAAM,KAAK,YAAY;EAE3D,IAAI,CAAC,MACH,OAAO,mBAAmB,OAAO,KAAK,CAAC;EAEzC,MAAM,QAAkB,CAAC;EACzB,KAAK,MAAM,QAAQ,OAAO,KAAK,CAAC,CAAC,MAAM,GAAG,GACxC,MAAM,KAAK,mBAAmB,IAAI,CAAC;EAErC,OAAO,MAAM,KAAK,GAAG;CACvB,CAAC;AACH;;;;;;;;;;;AAmBA,SAAgB,SAAS,IAAY,UAA2B,CAAC,GAAkB;CACjF,MAAM,MAAM,IAAI,IAAI,IAAI,SAAS,IAAI;CAErC,IAAI,IAAI,aAAa,WAAW,IAAI,aAAa,UAC/C,OAAO,QAAQ,uBAAO,IAAI,UAAU,2CAA2C,IAAI,UAAU,CAAC;CAEhG,IAAI,IAAI,WAAW,SAAS,QAAQ;EAClC,SAAS,OAAO,IAAI,IAAI;EACxB,OAAO,IAAI,cAAc,CAAC,CAAC;CAC7B;CACA,OAAO,IAAI,SAAS,YAAY;EAC9B,MAAM,QAAQ,IAAI,YAAY,oBAAoB;GAChD,YAAY;GACZ,QAAQ;IACN,KAAK,IAAI;IACT,SAAS,QAAQ,YAAY;IAC7B,QAAQ,QAAQ,WAAW;IAC3B,MAAM;GACR;EACF,CAAC;EAED,IAAI,SAAS,cAAc,KAAK,GAC9B,SAAS,OAAO,IAAI,IAAI;CAE5B,CAAC;AACH"}
|
package/dist/runtime/server.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
-
import { a as attribute, i as affix, l as escape, m as raw, p as mergeAttributes, s as classAttribute, t as Raw, u as escapeAttribute, y as vars } from "../html-y1q7-t7D.js";
|
|
2
|
-
import { a as PageState, n as ElementReference, o as ScopeId, r as FunctionReference, s as ScopeState, t as produce } from "../produce-D4K7qpaL.js";
|
|
3
1
|
import { a as Route, c as routeContext, o as createContext, r as NavigationState, s as navigationContext } from "../context-btHuB01Z.js";
|
|
2
|
+
import { E as vars, _ as mergeAttributes, a as affix, d as escape, f as escapeAttribute, h as internal, l as classAttribute, n as Raw, o as attribute, v as onAttribute, x as raw } from "../html-Bw9Qwu6F.js";
|
|
3
|
+
import { d as unbind, f as useSerialEntry, i as FunctionReference, l as ScopeId, o as PageState, r as ElementReference, t as produce, u as ScopeState } from "../produce-DIgHBVwL.js";
|
|
4
4
|
import { t as StandardSchemaV1 } from "../standard-schema-BNY82yX3.js";
|
|
5
|
-
import {
|
|
6
|
-
|
|
5
|
+
import { f as Intent, v as SubmissionResult } from "../forms-j1xPAR14.js";
|
|
6
|
+
import { $ as memoryStore, $t as createSession, A as insert, At as Middleware, B as spacerTag, Bt as RequestEvent, C as caught, Ct as fieldErrors, D as handleRequest, Dt as EndpointLoader, E as dynamic, Et as safeParse, F as read, Ft as matchRoute, G as streamState, Gt as defineMiddleware, H as stateScript, Ht as RequestKind, I as ready, It as EntryMiddleware, J as IdempotentOptions, Jt as redirect, K as wait, Kt as getEvent, L as render, Lt as Locals, M as lazy, Mt as RouteMatch, N as memo, Nt as RouteNode, O as handleRoute, Ot as Handler, P as packState, Pt as RouteView, Q as cached, Qt as SessionOptions, R as renderToStream, Rt as Redirect, S as binding, St as ValidationIssue, T as component, Tt as parseForm, U as stateValue, Ut as ServerError, V as spread, Vt as RequestEventOptions, W as streamParts, Wt as dedupe, X as CacheStore, Xt as CookieOptions, Y as idempotent, Yt as withEvent, Z as CachedOptions, Zt as Session, _ as StateAttributes, _t as SubmissionOptions, a as ItemSource, at as RateLimitError, b as action, bt as ParseResult, c as Memo, ct as RateLimitStore, d as RenderOptions, dt as configureRateLimit, en as parseCookies, et as revalidate, f as RenderResult, ft as rateLimit, g as ScopeEntry, gt as Submission, h as RouteOptions, ht as ReplyOptions, i as DocumentOptions, it as RateLimitConfig, j as isCrossSite, jt as MiddlewareLoader, k as inlineBodies, kt as Loader, l as NotReady, lt as Window, m as RevealOrder, mt as IntentSubmission, n as Context, nn as toNodeHeaders, nt as storageStore, o as Lazy, ot as RateLimitMiddleware, p as RequestOptions, pt as FailedSubmission, q as waitAll, qt as isRedirect, r as DeferTarget, rt as RateLimit, s as Mark, st as RateLimitOptions, t as Component, tn as serializeCookie, tt as setCacheStore, u as PageCache, ut as clientAddress, v as StateMap, vt as SuccessfulSubmission, w as children, wt as parse, x as actionResult, xt as ValidationError, y as StreamOptions, yt as parseSubmission, z as settled, zt as RequestCall } from "../server-BvPIg9pT.js";
|
|
7
|
+
export { type CacheStore, type CachedOptions, Component, Context, type CookieOptions, DeferTarget, DocumentOptions, ElementReference, type EndpointLoader, type EntryMiddleware, type FailedSubmission, FunctionReference, type Handler, type IdempotentOptions, type Intent, type IntentSubmission, ItemSource, Lazy, type Loader, type Locals, Mark, Memo, type Middleware, type MiddlewareLoader, type NavigationState, NotReady, PageCache, type PageState, type ParseResult, type RateLimit, type RateLimitConfig, RateLimitError, type RateLimitMiddleware, type RateLimitOptions, type RateLimitStore, type Raw, type Redirect, RenderOptions, RenderResult, type ReplyOptions, type RequestCall, RequestEvent, type RequestEventOptions, type RequestKind, RequestOptions, RevealOrder, type Route, type RouteMatch, type RouteNode, RouteOptions, type RouteView, ScopeEntry, type ScopeId, type ScopeState, ServerError, type Session, type SessionOptions, type StandardSchemaV1, StateAttributes, StateMap, StreamOptions, type Submission, type SubmissionOptions, type SubmissionResult, type SuccessfulSubmission, ValidationError, type ValidationIssue, type Window, action, actionResult, affix, attribute, binding, cached, caught, children, classAttribute, clientAddress, component, configureRateLimit, createContext, createSession, dedupe, defineMiddleware, dynamic, escape, escapeAttribute, fieldErrors, getEvent, handleRequest, handleRoute, idempotent, inlineBodies, insert, internal, isCrossSite, isRedirect, lazy, matchRoute, memo, memoryStore, mergeAttributes, navigationContext, onAttribute, packState, parse, parseCookies, parseForm, parseSubmission, produce, rateLimit, raw, read, ready, redirect, render, renderToStream, revalidate, routeContext, safeParse, serializeCookie, setCacheStore, settled, spacerTag, spread, stateScript, stateValue, storageStore, streamParts, streamState, toNodeHeaders, unbind, useSerialEntry, vars, wait, waitAll, withEvent };
|
package/dist/runtime/server.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import { A as
|
|
1
|
+
import { T as vars, _ as onAttribute, a as attribute, b as raw, c as classAttribute, d as escapeAttribute, g as mergeAttributes, i as affix, m as internal, u as escape } from "../html-BtKRyi7g.js";
|
|
2
|
+
import { a as serializeCookie, i as parseCookies, s as toNodeHeaders, t as createSession } from "../cookies-Cnbf4w-S.js";
|
|
3
|
+
import { C as useSerialEntry, S as unbind, a as ElementReference, o as FunctionReference, t as produce } from "../produce-B7X9ori9.js";
|
|
4
|
+
import { $ as isRedirect, A as waitAll, B as parseForm, C as spacerTag, D as streamParts, E as stateValue, F as rateLimit, G as revalidate, H as matchRoute, I as parseSubmission, J as RequestEvent, K as setCacheStore, L as ValidationError, M as RateLimitError, N as clientAddress, O as streamState, P as configureRateLimit, Q as getEvent, R as fieldErrors, S as settled, T as stateScript, U as cached, V as safeParse, W as memoryStore, X as dedupe, Y as ServerError, Z as defineMiddleware, _ as packState, a as binding, b as render, c as component, d as handleRoute, et as redirect, f as inlineBodies, g as memo, h as lazy, i as actionResult, j as idempotent, k as wait, l as dynamic, m as isCrossSite, n as NotReady, o as caught, p as insert, q as storageStore, r as action, s as children, t as Context, tt as withEvent, u as handleRequest, v as read, w as spread, x as renderToStream, y as ready, z as parse } from "../server-DjyOVJtJ.js";
|
|
5
5
|
import { a as routeContext, i as navigationContext, r as createContext } from "../context-CTiSzQRc.js";
|
|
6
|
-
export { Context, ElementReference, FunctionReference, NotReady, RateLimitError, RequestEvent, ServerError, ValidationError, action, actionResult, affix, attribute, children, classAttribute, clientAddress, component, configureRateLimit, createContext, createSession, dedupe, defineMiddleware, dynamic, escape, escapeAttribute, fieldErrors, getEvent, handleRequest, handleRoute, inlineBodies, insert, isCrossSite, isRedirect, lazy, matchRoute, memo, mergeAttributes, navigationContext, onAttribute, packState, parse, parseCookies, parseForm, produce, rateLimit, raw, read, ready, redirect, render, renderToStream, routeContext, safeParse, serializeCookie, settled, spread, stateScript, stateValue, streamParts, streamState, toNodeHeaders, vars, wait, waitAll, withEvent };
|
|
6
|
+
export { Context, ElementReference, FunctionReference, NotReady, RateLimitError, RequestEvent, ServerError, ValidationError, action, actionResult, affix, attribute, binding, cached, caught, children, classAttribute, clientAddress, component, configureRateLimit, createContext, createSession, dedupe, defineMiddleware, dynamic, escape, escapeAttribute, fieldErrors, getEvent, handleRequest, handleRoute, idempotent, inlineBodies, insert, internal, isCrossSite, isRedirect, lazy, matchRoute, memo, memoryStore, mergeAttributes, navigationContext, onAttribute, packState, parse, parseCookies, parseForm, parseSubmission, produce, rateLimit, raw, read, ready, redirect, render, renderToStream, revalidate, routeContext, safeParse, serializeCookie, setCacheStore, settled, spacerTag, spread, stateScript, stateValue, storageStore, streamParts, streamState, toNodeHeaders, unbind, useSerialEntry, vars, wait, waitAll, withEvent };
|