@moku-labs/web 1.12.3 → 1.13.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/browser.d.mts +13 -351
- package/dist/browser.mjs +9 -838
- package/dist/index.cjs +73 -1338
- package/dist/index.d.cts +12 -391
- package/dist/index.d.mts +12 -393
- package/dist/index.mjs +17 -1300
- package/package.json +2 -1
package/dist/index.d.cts
CHANGED
|
@@ -1,343 +1,16 @@
|
|
|
1
1
|
import { ComponentChildren, FunctionComponent, VNode } from "preact";
|
|
2
|
+
import { Env, Log, Log as Log$1, browserEnv, cloudflareBindings, dotenv, envPlugin, logPlugin, processEnv } from "@moku-labs/common";
|
|
2
3
|
import { EmitFn } from "@moku-labs/core";
|
|
3
4
|
import { BundledTheme, ThemeRegistrationAny } from "shiki";
|
|
4
5
|
import { Pluggable, Processor } from "unified";
|
|
5
6
|
|
|
6
7
|
//#region \0rolldown/runtime.js
|
|
7
|
-
declare namespace types_d_exports$7 {
|
|
8
|
-
export { ExpectChain, LogApi, LogConfig, LogEntry, LogLevel, LogSink, LogState };
|
|
9
|
-
}
|
|
10
|
-
/**
|
|
11
|
-
* @file log plugin — type definitions skeleton.
|
|
12
|
-
*
|
|
13
|
-
* Core-plugin type surface: config, state, public API, and the supporting
|
|
14
|
-
* value/sink/assertion-chain types. These types are inferred onto the plugin
|
|
15
|
-
* via state.ts / api.ts; index.ts passes NO explicit generics.
|
|
16
|
-
*/
|
|
17
|
-
/**
|
|
18
|
-
* Runtime mode for the log plugin. Selects which default sinks are installed at
|
|
19
|
-
* onInit. The in-memory trace sink is ALWAYS installed regardless of mode.
|
|
20
|
-
*
|
|
21
|
-
* - "test" — no console sink (keeps test output clean); trace only.
|
|
22
|
-
* - "silent" — no console sink (explicit quiet); trace only.
|
|
23
|
-
* - "dev" — console sink + trace.
|
|
24
|
-
* - "production" — console sink + trace.
|
|
25
|
-
*/
|
|
26
|
-
type LogConfig = {
|
|
27
|
-
/** Sink-selection mode. Defaults to `production`. */mode: "test" | "dev" | "production" | "silent";
|
|
28
|
-
};
|
|
29
|
-
/** Severity level for a log entry. */
|
|
30
|
-
type LogLevel = "debug" | "info" | "warn" | "error";
|
|
31
|
-
/**
|
|
32
|
-
* A single recorded log entry.
|
|
33
|
-
*/
|
|
34
|
-
type LogEntry = {
|
|
35
|
-
/** Severity level. */level: LogLevel; /** Event identifier (free-form string; convention: `domain:action`). */
|
|
36
|
-
event: string; /** Optional structured payload associated with the event. */
|
|
37
|
-
data?: unknown; /** Capture timestamp in epoch milliseconds (`Date.now()` at append time). */
|
|
38
|
-
ts: number; /** Optional originating plugin name. Reserved for future enrichment. */
|
|
39
|
-
plugin?: string;
|
|
40
|
-
};
|
|
41
|
-
/**
|
|
42
|
-
* Pluggable output target. Implement this to add console/file/JSON/etc. sinks
|
|
43
|
-
* WITHOUT changing the log API. Each logged entry is passed to `write` once,
|
|
44
|
-
* in registration order.
|
|
45
|
-
*/
|
|
46
|
-
type LogSink = {
|
|
47
|
-
/**
|
|
48
|
-
* Write a single entry to this sink.
|
|
49
|
-
*
|
|
50
|
-
* @param entry - The entry to emit.
|
|
51
|
-
*/
|
|
52
|
-
write(entry: LogEntry): void;
|
|
53
|
-
};
|
|
54
|
-
/**
|
|
55
|
-
* Fluent event-trace assertion chain. Reads the live entries array on each call,
|
|
56
|
-
* so assertions reflect the trace state at call time (not chain-creation time).
|
|
57
|
-
* Every method returns the same chain for fluent chaining; assertion failures throw.
|
|
58
|
-
*/
|
|
59
|
-
type ExpectChain = {
|
|
60
|
-
/**
|
|
61
|
-
* Assert at least one entry has `event`, optionally matching `partial` (subset match).
|
|
62
|
-
*
|
|
63
|
-
* @param event - Event name to find.
|
|
64
|
-
* @param partial - Optional partial data shape (subset-matched against `entry.data`).
|
|
65
|
-
* @returns The same chain for chaining.
|
|
66
|
-
* @throws {Error} `LogExpectAssertionError` when no matching entry exists.
|
|
67
|
-
*/
|
|
68
|
-
toHaveEvent(event: string, partial?: Record<string, unknown>): ExpectChain;
|
|
69
|
-
/**
|
|
70
|
-
* Assert all of `events` appear in the trace in the given relative order
|
|
71
|
-
* (gaps allowed; later events must occur after earlier ones).
|
|
72
|
-
*
|
|
73
|
-
* @param events - Ordered list of event names.
|
|
74
|
-
* @returns The same chain for chaining.
|
|
75
|
-
* @throws {Error} `LogExpectAssertionError` when the ordering cannot be satisfied.
|
|
76
|
-
*/
|
|
77
|
-
toHaveEventInOrder(events: string[]): ExpectChain;
|
|
78
|
-
/**
|
|
79
|
-
* Assert NO entry has `event` (optionally narrowed by `partial`).
|
|
80
|
-
*
|
|
81
|
-
* @param event - Event name that must be absent.
|
|
82
|
-
* @param partial - Optional partial data shape; only matching entries violate the assertion.
|
|
83
|
-
* @returns The same chain for chaining.
|
|
84
|
-
* @throws {Error} `LogExpectAssertionError` when a matching entry exists.
|
|
85
|
-
*/
|
|
86
|
-
toNotHaveEvent(event: string, partial?: Record<string, unknown>): ExpectChain;
|
|
87
|
-
};
|
|
88
|
-
/**
|
|
89
|
-
* Internal mutable state for the log plugin. Created fresh per createApp construction.
|
|
90
|
-
*/
|
|
91
|
-
type LogState = {
|
|
92
|
-
/** Append-only ordered trace of every logged entry (the in-memory trace sink's backing store). */entries: LogEntry[]; /** Registered output sinks. Each entry is written to every sink in order. */
|
|
93
|
-
sinks: LogSink[];
|
|
94
|
-
};
|
|
95
|
-
/** Public log API injected as `ctx.log` on every regular plugin and exposed as `app.log`. */
|
|
96
|
-
type LogApi = {
|
|
97
|
-
/**
|
|
98
|
-
* Append an `info` entry and fan it out to every sink.
|
|
99
|
-
*
|
|
100
|
-
* @param event - Event identifier (convention: `domain:action`).
|
|
101
|
-
* @param data - Optional structured payload.
|
|
102
|
-
*/
|
|
103
|
-
info(event: string, data?: unknown): void;
|
|
104
|
-
/**
|
|
105
|
-
* Append a `debug` entry and fan it out to every sink.
|
|
106
|
-
*
|
|
107
|
-
* @param event - Event identifier (convention: `domain:action`).
|
|
108
|
-
* @param data - Optional structured payload.
|
|
109
|
-
*/
|
|
110
|
-
debug(event: string, data?: unknown): void;
|
|
111
|
-
/**
|
|
112
|
-
* Append a `warn` entry and fan it out to every sink.
|
|
113
|
-
*
|
|
114
|
-
* @param event - Event identifier (convention: `domain:action`).
|
|
115
|
-
* @param data - Optional structured payload.
|
|
116
|
-
*/
|
|
117
|
-
warn(event: string, data?: unknown): void;
|
|
118
|
-
/**
|
|
119
|
-
* Append an `error` entry. When `error` is provided, its `message`/`stack` are
|
|
120
|
-
* merged into `data` under an `error` key; otherwise `data` is recorded as-is.
|
|
121
|
-
*
|
|
122
|
-
* @param event - Event identifier (convention: `domain:action`).
|
|
123
|
-
* @param data - Optional structured payload.
|
|
124
|
-
* @param error - Optional originating Error to merge into `data`.
|
|
125
|
-
*/
|
|
126
|
-
error(event: string, data?: unknown, error?: Error): void;
|
|
127
|
-
/**
|
|
128
|
-
* Return a frozen snapshot of the entries recorded so far (a fresh copy).
|
|
129
|
-
*
|
|
130
|
-
* @returns A readonly, frozen copy of the recorded entries.
|
|
131
|
-
*/
|
|
132
|
-
trace(): readonly LogEntry[];
|
|
133
|
-
/**
|
|
134
|
-
* Return a fluent assertion chain bound to the live entries array.
|
|
135
|
-
*
|
|
136
|
-
* @returns A fresh {@link ExpectChain}.
|
|
137
|
-
*/
|
|
138
|
-
expect(): ExpectChain;
|
|
139
|
-
/**
|
|
140
|
-
* Register an additional output sink at runtime.
|
|
141
|
-
*
|
|
142
|
-
* @param sink - The sink to add to the fan-out list.
|
|
143
|
-
*/
|
|
144
|
-
addSink(sink: LogSink): void; /** Clear all recorded entries while keeping registered sinks. */
|
|
145
|
-
reset(): void;
|
|
146
|
-
};
|
|
147
|
-
declare namespace types_d_exports$5 {
|
|
148
|
-
export { EnvApi, EnvConfig, EnvProvider, EnvState, EnvVarSpec };
|
|
149
|
-
}
|
|
150
|
-
/**
|
|
151
|
-
* @file env plugin — public + boundary type definitions.
|
|
152
|
-
*/
|
|
153
|
-
/**
|
|
154
|
-
* A source of raw environment values.
|
|
155
|
-
*
|
|
156
|
-
* Providers are walked in array order during resolution; the first provider to
|
|
157
|
-
* return a non-`undefined` (and non-empty-string) value for a key wins. `load()`
|
|
158
|
-
* is called exactly once per resolution at `onInit` time, after which both env
|
|
159
|
-
* maps are frozen. A provider like {@link cloudflareBindings} reads `globalThis`
|
|
160
|
-
* at that single `onInit` call (not per request).
|
|
161
|
-
*
|
|
162
|
-
* @example
|
|
163
|
-
* ```ts
|
|
164
|
-
* const custom: EnvProvider = {
|
|
165
|
-
* name: "vault",
|
|
166
|
-
* load: () => ({ DB_URL: readVaultSecret("db") })
|
|
167
|
-
* };
|
|
168
|
-
* ```
|
|
169
|
-
*/
|
|
170
|
-
interface EnvProvider {
|
|
171
|
-
/** Human-readable provider name, used in diagnostics and error messages. */
|
|
172
|
-
name: string;
|
|
173
|
-
/**
|
|
174
|
-
* Reads this provider's current view of the environment.
|
|
175
|
-
*
|
|
176
|
-
* @returns A flat record of variable names to string values. Keys the
|
|
177
|
-
* provider cannot supply must be omitted or set to `undefined`.
|
|
178
|
-
*/
|
|
179
|
-
load(): Record<string, string | undefined>;
|
|
180
|
-
}
|
|
181
|
-
/**
|
|
182
|
-
* Declares how a single environment variable is validated and exposed.
|
|
183
|
-
*
|
|
184
|
-
* @example
|
|
185
|
-
* ```ts
|
|
186
|
-
* const port: EnvVarSpec = { public: false, required: false, default: "3000" };
|
|
187
|
-
* const apiBase: EnvVarSpec = { public: true }; // key must start with PUBLIC_
|
|
188
|
-
* const token: EnvVarSpec = { public: false, required: true, secret: true };
|
|
189
|
-
* ```
|
|
190
|
-
*/
|
|
191
|
-
interface EnvVarSpec {
|
|
192
|
-
/**
|
|
193
|
-
* Whether the variable is safe to ship to the browser. When `true`, the key
|
|
194
|
-
* **must** start with {@link EnvConfig.publicPrefix} (cross-checked at
|
|
195
|
-
* `onInit`), and the variable is included in {@link EnvApi.getPublicMap}.
|
|
196
|
-
*/
|
|
197
|
-
public: boolean;
|
|
198
|
-
/** Whether resolution fails if the variable is still undefined after defaults. */
|
|
199
|
-
required?: boolean;
|
|
200
|
-
/** Value applied when no provider supplies the variable. */
|
|
201
|
-
default?: string;
|
|
202
|
-
/**
|
|
203
|
-
* Marks the variable as a secret for documentation / tooling. Has no runtime
|
|
204
|
-
* effect on resolution, but secrets are never permitted to be `public`.
|
|
205
|
-
*/
|
|
206
|
-
secret?: boolean;
|
|
207
|
-
}
|
|
208
|
-
/**
|
|
209
|
-
* Configuration for the {@link envPlugin} core plugin.
|
|
210
|
-
*
|
|
211
|
-
* @example
|
|
212
|
-
* ```ts
|
|
213
|
-
* createCoreConfig("web", {
|
|
214
|
-
* plugins: [envPlugin],
|
|
215
|
-
* pluginConfigs: {
|
|
216
|
-
* env: {
|
|
217
|
-
* schema: {
|
|
218
|
-
* PUBLIC_API_URL: { public: true, default: "/api" },
|
|
219
|
-
* SESSION_SECRET: { public: false, required: true, secret: true }
|
|
220
|
-
* }
|
|
221
|
-
* }
|
|
222
|
-
* }
|
|
223
|
-
* });
|
|
224
|
-
* ```
|
|
225
|
-
*/
|
|
226
|
-
type EnvConfig = {
|
|
227
|
-
/** Per-variable validation + exposure rules, keyed by variable name. */schema: Record<string, EnvVarSpec>;
|
|
228
|
-
/**
|
|
229
|
-
* Ordered list of value sources. The first provider yielding a non-`undefined`
|
|
230
|
-
* (and non-empty-string) value for a key wins. The plugin's own spec default is
|
|
231
|
-
* `[]`; the consumer supplies the providers per target (`[dotenv(), processEnv()]`
|
|
232
|
-
* on Node) — only the `/browser` entry pre-wires `browserEnv()` out of the box.
|
|
233
|
-
*/
|
|
234
|
-
providers: EnvProvider[];
|
|
235
|
-
/**
|
|
236
|
-
* Prefix that public variable names must carry. Bidirectionally enforced at
|
|
237
|
-
* `onInit`. Framework default is `"PUBLIC_"`.
|
|
238
|
-
*/
|
|
239
|
-
publicPrefix: string;
|
|
240
|
-
};
|
|
241
|
-
/**
|
|
242
|
-
* Internal env plugin state: the resolved variable table and its public subset.
|
|
243
|
-
* Both maps are populated and frozen (via `freezeMap`) during `onInit`.
|
|
244
|
-
*
|
|
245
|
-
* Exported only to type the `createState` / `api` / `validate` boundary —
|
|
246
|
-
* consumers use {@link EnvApi}, never `EnvState`.
|
|
247
|
-
*/
|
|
248
|
-
interface EnvState {
|
|
249
|
-
/** All validated variables that resolved to a defined value (incl. defaults). */
|
|
250
|
-
resolved: Map<string, string>;
|
|
251
|
-
/** Subset of `resolved` where `schema[key].public === true`. */
|
|
252
|
-
publicMap: Map<string, string>;
|
|
253
|
-
}
|
|
254
|
-
/**
|
|
255
|
-
* The resolved-environment accessor mounted at `ctx.env`. Built by the plugin's
|
|
256
|
-
* `api` factory over `ctx.state` ({@link EnvState}).
|
|
257
|
-
*
|
|
258
|
-
* Available after `onInit` (i.e. inside any plugin's lifecycle and in consumer
|
|
259
|
-
* code). All accessors read from the frozen `resolved` / `publicMap` maps;
|
|
260
|
-
* mutation is impossible.
|
|
261
|
-
*
|
|
262
|
-
* @example
|
|
263
|
-
* ```ts
|
|
264
|
-
* const url = ctx.env.get("PUBLIC_API_URL"); // string | undefined
|
|
265
|
-
* const token = ctx.env.require("DEPLOY_TOKEN"); // string, or throws
|
|
266
|
-
* ```
|
|
267
|
-
*/
|
|
268
|
-
type EnvApi = {
|
|
269
|
-
/**
|
|
270
|
-
* Reads a resolved variable.
|
|
271
|
-
*
|
|
272
|
-
* @param key - Variable name.
|
|
273
|
-
* @returns The value, or `undefined` if not present / not in schema.
|
|
274
|
-
*/
|
|
275
|
-
get(key: string): string | undefined;
|
|
276
|
-
/**
|
|
277
|
-
* Reads a variable that must exist.
|
|
278
|
-
*
|
|
279
|
-
* @param key - Variable name.
|
|
280
|
-
* @returns The value.
|
|
281
|
-
* @throws {Error} If the variable is undefined.
|
|
282
|
-
*/
|
|
283
|
-
require(key: string): string;
|
|
284
|
-
/**
|
|
285
|
-
* Tests presence of a resolved variable.
|
|
286
|
-
*
|
|
287
|
-
* @param key - Variable name.
|
|
288
|
-
* @returns `true` if a value is present.
|
|
289
|
-
*/
|
|
290
|
-
has(key: string): boolean;
|
|
291
|
-
/**
|
|
292
|
-
* Returns all public variables as a frozen plain object — convenient for
|
|
293
|
-
* spreading into a serializable payload.
|
|
294
|
-
*
|
|
295
|
-
* @returns A frozen `Record` of public variable names to values.
|
|
296
|
-
*/
|
|
297
|
-
getPublic(): Readonly<Record<string, string>>;
|
|
298
|
-
/**
|
|
299
|
-
* Returns the frozen map of public variables. This is the **sole** intended
|
|
300
|
-
* input to a build-time `define` injection: every entry is safe to inline
|
|
301
|
-
* into the browser bundle.
|
|
302
|
-
*
|
|
303
|
-
* @returns The frozen public map.
|
|
304
|
-
*/
|
|
305
|
-
getPublicMap(): ReadonlyMap<string, string>;
|
|
306
|
-
};
|
|
307
|
-
//#endregion
|
|
308
|
-
//#region src/plugins/env/providers.browser.d.ts
|
|
309
|
-
/**
|
|
310
|
-
* A browser-safe {@link EnvProvider} that reads `import.meta.env` and an optional
|
|
311
|
-
* `globalThis[globalKey]` snapshot, merging them with the runtime global winning.
|
|
312
|
-
* Contains zero `node:*` imports, so it is safe to include in the client bundle.
|
|
313
|
-
* Never throws on missing sources — each absent source resolves to `{}`.
|
|
314
|
-
*
|
|
315
|
-
* @param options - Optional settings.
|
|
316
|
-
* @param options.globalKey - `globalThis` key to read a public-env snapshot from. Defaults to `"__ENV__"`.
|
|
317
|
-
* @returns An {@link EnvProvider} named `browser-env`.
|
|
318
|
-
* @example
|
|
319
|
-
* ```ts
|
|
320
|
-
* const provider = browserEnv();
|
|
321
|
-
* provider.load(); // { PUBLIC_API_URL: "/api", ... }
|
|
322
|
-
* ```
|
|
323
|
-
*/
|
|
324
|
-
declare function browserEnv(options?: {
|
|
325
|
-
globalKey?: string;
|
|
326
|
-
}): EnvProvider;
|
|
327
8
|
//#endregion
|
|
328
|
-
//#region src/
|
|
9
|
+
//#region src/config.d.ts
|
|
329
10
|
/**
|
|
330
|
-
*
|
|
331
|
-
*
|
|
332
|
-
*
|
|
333
|
-
* @example
|
|
334
|
-
* ```ts
|
|
335
|
-
* createApp({ pluginConfigs: { env: { schema: { PUBLIC_API_URL: { public: true } } } } });
|
|
336
|
-
* ```
|
|
11
|
+
* @file Framework configuration — Config + Events types, core plugin registration.
|
|
12
|
+
* @see README.md
|
|
337
13
|
*/
|
|
338
|
-
declare const envPlugin: import("@moku-labs/core").CorePluginInstance<"env", EnvConfig, EnvState, EnvApi>;
|
|
339
|
-
//#endregion
|
|
340
|
-
//#region src/config.d.ts
|
|
341
14
|
/**
|
|
342
15
|
* Deployment stage. Drives content draft visibility — drafts are suppressed
|
|
343
16
|
* only in `"production"`; `"development"` and `"test"` both surface them.
|
|
@@ -583,7 +256,7 @@ interface PathMatcher {
|
|
|
583
256
|
};
|
|
584
257
|
} | null;
|
|
585
258
|
}
|
|
586
|
-
declare namespace types_d_exports$
|
|
259
|
+
declare namespace types_d_exports$6 {
|
|
587
260
|
export { Api$5 as Api, ClientRoute, CompileInput, CompiledRoute, Config$5 as Config, ExtractApi$2 as ExtractApi, ExtractRouteParams, ExtractSegmentParameter, GenerateContext, HeadConfig$1 as HeadConfig, LayoutContext, LoadContext, MatcherTable, Prettify, RouteBuilder, RouteContext, RouteDefinition, RouteHandlers, RouteMap, RouteRequire, RouteState, RouterApi, RouterConfig, RouterState, State$5 as State, TypedRoute, Urls };
|
|
588
261
|
}
|
|
589
262
|
/**
|
|
@@ -996,7 +669,7 @@ type Config$5 = RouterConfig;
|
|
|
996
669
|
type State$5 = RouterState;
|
|
997
670
|
/** Re-export under the canonical `Api` name for the plugin-types barrel. */
|
|
998
671
|
type Api$5 = RouterApi;
|
|
999
|
-
declare namespace types_d_exports$
|
|
672
|
+
declare namespace types_d_exports$5 {
|
|
1000
673
|
export { Api$4 as Api, ArticleMeta, Config$4 as Config, HeadConfig, HeadDefaults, HeadElement, ResolvedRoute, State$4 as State };
|
|
1001
674
|
}
|
|
1002
675
|
/**
|
|
@@ -1171,7 +844,7 @@ type Api$4 = {
|
|
|
1171
844
|
*/
|
|
1172
845
|
composeTitle(head: HeadConfig | undefined): string;
|
|
1173
846
|
};
|
|
1174
|
-
declare namespace types_d_exports$
|
|
847
|
+
declare namespace types_d_exports$7 {
|
|
1175
848
|
export { COMPONENT_HOOK_NAMES, ComponentContext, ComponentDef, ComponentHooks, ComponentInstance, ExtractApi$1 as ExtractApi, PageData, ResolvedSpaConfig, SpaApi, SpaConfig, SpaContext, SpaDataReader, SpaEmitFunction, SpaEvents, SpaKernel, SpaKernelDeps, SpaRequire, SpaState };
|
|
1176
849
|
}
|
|
1177
850
|
/** Payload map for the events `spa` emits, used to type the kernel's `emit` closure. */
|
|
@@ -1237,7 +910,7 @@ interface SpaContext {
|
|
|
1237
910
|
/** Emit a spa lifecycle event (notification-only). */
|
|
1238
911
|
emit: SpaEmitFunction;
|
|
1239
912
|
/** Structured logger (core `log` API). */
|
|
1240
|
-
readonly log: LogApi;
|
|
913
|
+
readonly log: Log$1.LogApi;
|
|
1241
914
|
}
|
|
1242
915
|
/** Configuration for the SPA runtime plugin. All fields optional; defaults applied in onInit. */
|
|
1243
916
|
type SpaConfig = {
|
|
@@ -3484,16 +3157,6 @@ declare const headPlugin: import("@moku-labs/core").PluginInstance<"head", Confi
|
|
|
3484
3157
|
*/
|
|
3485
3158
|
declare const i18nPlugin: import("@moku-labs/core").PluginInstance<"i18n", Config$6, Record<string, never>, Api$6, {}> & Record<never, never>;
|
|
3486
3159
|
//#endregion
|
|
3487
|
-
//#region src/plugins/log/index.d.ts
|
|
3488
|
-
/**
|
|
3489
|
-
* Core logging plugin — always-on in-memory trace + `expect()` event-trace DSL.
|
|
3490
|
-
* API injected as `ctx.log` on every regular plugin and surfaced as `app.log`.
|
|
3491
|
-
* No depends / events / hooks (core plugin per spec/03 §5).
|
|
3492
|
-
*
|
|
3493
|
-
* @see README.md
|
|
3494
|
-
*/
|
|
3495
|
-
declare const logPlugin: import("@moku-labs/core").CorePluginInstance<"log", LogConfig, LogState, LogApi>;
|
|
3496
|
-
//#endregion
|
|
3497
3160
|
//#region src/plugins/router/builders/route-builder.d.ts
|
|
3498
3161
|
/**
|
|
3499
3162
|
* Create a fluent route builder from a URL pattern string. Captures the pattern
|
|
@@ -3662,48 +3325,6 @@ declare const spaPlugin: import("@moku-labs/core").PluginInstance<"spa", SpaConf
|
|
|
3662
3325
|
};
|
|
3663
3326
|
}> & Record<never, never>;
|
|
3664
3327
|
//#endregion
|
|
3665
|
-
//#region src/plugins/env/providers.d.ts
|
|
3666
|
-
/**
|
|
3667
|
-
* A zero-dependency `.env`-style provider that re-reads and re-parses the file
|
|
3668
|
-
* from disk on every `load()`. Missing file resolves to `{}` (optional
|
|
3669
|
-
* overrides). Strips a single outer quote pair; does not strip trailing inline
|
|
3670
|
-
* comments on unquoted values.
|
|
3671
|
-
*
|
|
3672
|
-
* @param path - Path to the dotenv file. Defaults to `.env.local`.
|
|
3673
|
-
* @returns An {@link EnvProvider} named `dotenv:<path>` that reads fresh per call.
|
|
3674
|
-
* @example
|
|
3675
|
-
* ```ts
|
|
3676
|
-
* const provider = dotenv(".env.local");
|
|
3677
|
-
* provider.load(); // { PUBLIC_API_URL: "/api", ... }
|
|
3678
|
-
* ```
|
|
3679
|
-
*/
|
|
3680
|
-
declare function dotenv(path?: string): EnvProvider;
|
|
3681
|
-
/**
|
|
3682
|
-
* A provider that returns a shallow copy of `process.env` at `load()` time.
|
|
3683
|
-
*
|
|
3684
|
-
* @returns An {@link EnvProvider} named `process-env`.
|
|
3685
|
-
* @example
|
|
3686
|
-
* ```ts
|
|
3687
|
-
* const provider = processEnv();
|
|
3688
|
-
* provider.load().HOME; // current process value
|
|
3689
|
-
* ```
|
|
3690
|
-
*/
|
|
3691
|
-
declare function processEnv(): EnvProvider;
|
|
3692
|
-
/**
|
|
3693
|
-
* A provider that reads live, per-request Cloudflare bindings from
|
|
3694
|
-
* `globalThis.__CLOUDFLARE_ENV__` at `load()` time (`?? {}` when absent). Never
|
|
3695
|
-
* caches the binding object; the consumer owns the global's request lifecycle.
|
|
3696
|
-
*
|
|
3697
|
-
* @returns An {@link EnvProvider} named `cloudflare`.
|
|
3698
|
-
* @example
|
|
3699
|
-
* ```ts
|
|
3700
|
-
* globalThis.__CLOUDFLARE_ENV__ = env; // set by the request handler
|
|
3701
|
-
* const provider = cloudflareBindings();
|
|
3702
|
-
* provider.load(); // reads the current request's bindings
|
|
3703
|
-
* ```
|
|
3704
|
-
*/
|
|
3705
|
-
declare function cloudflareBindings(): EnvProvider;
|
|
3706
|
-
//#endregion
|
|
3707
3328
|
//#region src/plugins/content/providers.d.ts
|
|
3708
3329
|
/**
|
|
3709
3330
|
* The node filesystem content provider: reads + renders Markdown from `contentDir`
|
|
@@ -3817,7 +3438,7 @@ declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs
|
|
|
3817
3438
|
name: string;
|
|
3818
3439
|
el: Element;
|
|
3819
3440
|
};
|
|
3820
|
-
}> & Record<never, never>) | ExtraPlugins[number], [...ExtraPlugins], import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", LogConfig, LogState, LogApi>, import("@moku-labs/core").CorePluginInstance<"env", EnvConfig, EnvState, EnvApi>]>> | undefined) => import("@moku-labs/core").App<Config$8, Events, (import("@moku-labs/core").PluginInstance<"site", Config$7, Record<string, never>, Api$7, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"i18n", Config$6, Record<string, never>, Api$6, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"router", RouterConfig, RouterState, RouterApi, {}> & {
|
|
3441
|
+
}> & Record<never, never>) | ExtraPlugins[number], [...ExtraPlugins], import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", import("@moku-labs/common").LogConfig, import("@moku-labs/common").LogState, import("@moku-labs/common").LogApi>, import("@moku-labs/core").CorePluginInstance<"env", import("@moku-labs/common").EnvConfig, import("@moku-labs/common").EnvState, import("@moku-labs/common").EnvApi>]>> | undefined) => import("@moku-labs/core").App<Config$8, Events, (import("@moku-labs/core").PluginInstance<"site", Config$7, Record<string, never>, Api$7, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"i18n", Config$6, Record<string, never>, Api$6, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"router", RouterConfig, RouterState, RouterApi, {}> & {
|
|
3821
3442
|
route: typeof route;
|
|
3822
3443
|
defineRoutes: typeof defineRoutes;
|
|
3823
3444
|
createUrls: typeof createUrls;
|
|
@@ -3846,7 +3467,7 @@ declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs
|
|
|
3846
3467
|
name: string;
|
|
3847
3468
|
el: Element;
|
|
3848
3469
|
};
|
|
3849
|
-
}> & Record<never, never>) | ExtraPlugins[number], import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", LogConfig, LogState, LogApi>, import("@moku-labs/core").CorePluginInstance<"env", EnvConfig, EnvState, EnvApi>]>>;
|
|
3470
|
+
}> & Record<never, never>) | ExtraPlugins[number], import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", import("@moku-labs/common").LogConfig, import("@moku-labs/common").LogState, import("@moku-labs/common").LogApi>, import("@moku-labs/core").CorePluginInstance<"env", import("@moku-labs/common").EnvConfig, import("@moku-labs/common").EnvState, import("@moku-labs/common").EnvApi>]>>;
|
|
3850
3471
|
/**
|
|
3851
3472
|
* Create a custom plugin bound to this framework's `Config`/`Events` and core
|
|
3852
3473
|
* APIs. Plugin types are inferred from the spec object — never written explicitly.
|
|
@@ -3862,6 +3483,6 @@ declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs
|
|
|
3862
3483
|
* const app = createApp({ plugins: [analytics] });
|
|
3863
3484
|
* ```
|
|
3864
3485
|
*/
|
|
3865
|
-
declare const createPlugin: import("@moku-labs/core").BoundCreatePluginFunction<Config$8, Events, import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", LogConfig, LogState, LogApi>, import("@moku-labs/core").CorePluginInstance<"env", EnvConfig, EnvState, EnvApi>]>>;
|
|
3486
|
+
declare const createPlugin: import("@moku-labs/core").BoundCreatePluginFunction<Config$8, Events, import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", import("@moku-labs/common").LogConfig, import("@moku-labs/common").LogState, import("@moku-labs/common").LogApi>, import("@moku-labs/core").CorePluginInstance<"env", import("@moku-labs/common").EnvConfig, import("@moku-labs/common").EnvState, import("@moku-labs/common").EnvApi>]>>;
|
|
3866
3487
|
//#endregion
|
|
3867
|
-
export { types_d_exports as Build, types_d_exports$1 as Cli, types_d_exports$2 as Content, types_d_exports$3 as Data, types_d_exports$4 as Deploy, type EmbedFacade, EmbedFacadeButton, type EmbedFacadeProps, type EmbedOptions,
|
|
3488
|
+
export { types_d_exports as Build, types_d_exports$1 as Cli, types_d_exports$2 as Content, types_d_exports$3 as Data, types_d_exports$4 as Deploy, type EmbedFacade, EmbedFacadeButton, type EmbedFacadeProps, type EmbedOptions, type Env, type GalleryComponent, type GalleryOptions, type GalleryProps, type GallerySlide, GalleryTrack, types_d_exports$5 as Head, type Log, types_d_exports$6 as Router, types_d_exports$7 as Spa, browserEnv, buildArticleHead, buildPlugin, canonical, cliPlugin, cloudflareBindings, contentPlugin, createApp, createComponent, createPlugin, createUrls, dataPlugin, defineRoutes, deployPlugin, dotenv, envPlugin, feedLink, fileSystemContent, headPlugin, hreflang, i18nPlugin, jsonLd, lazyEmbed, logPlugin, meta, og, processEnv, route, routerPlugin, sitePlugin, spaPlugin, twitter };
|