@moku-labs/web 0.1.0-alpha.4 → 0.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +64 -51
  3. package/dist/chunk-D7D4PA-g.mjs +13 -0
  4. package/dist/index.cjs +5972 -113
  5. package/dist/index.d.cts +2078 -106
  6. package/dist/index.d.mts +2078 -106
  7. package/dist/index.mjs +5859 -33
  8. package/package.json +65 -65
  9. package/dist/bin/moku.cjs +0 -1383
  10. package/dist/bin/moku.d.cts +0 -1
  11. package/dist/bin/moku.d.mts +0 -1
  12. package/dist/bin/moku.mjs +0 -1383
  13. package/dist/chunk-DQk6qfdC.mjs +0 -18
  14. package/dist/factory-CMOo4n6a.cjs +0 -1722
  15. package/dist/factory-DRFGSslp.d.mts +0 -114
  16. package/dist/factory-DiKypQqs.mjs +0 -1602
  17. package/dist/factory-k-YoScgB.d.cts +0 -114
  18. package/dist/index-DH3jlpNi.d.mts +0 -503
  19. package/dist/index-DaY7vTuo.d.cts +0 -503
  20. package/dist/plugins/head/build.cjs +0 -35
  21. package/dist/plugins/head/build.d.cts +0 -17
  22. package/dist/plugins/head/build.d.mts +0 -17
  23. package/dist/plugins/head/build.mjs +0 -27
  24. package/dist/plugins/spa/index.cjs +0 -26
  25. package/dist/plugins/spa/index.d.cts +0 -30
  26. package/dist/plugins/spa/index.d.mts +0 -30
  27. package/dist/plugins/spa/index.mjs +0 -24
  28. package/dist/primitives-BYUp6kae.cjs +0 -100
  29. package/dist/primitives-DKgZfRAO.d.mts +0 -71
  30. package/dist/primitives-Dhko-oLM.mjs +0 -58
  31. package/dist/primitives-yZqQkOVR.d.cts +0 -71
  32. package/dist/project-B8z4jeMC.cjs +0 -1383
  33. package/dist/project-guCYpUeD.mjs +0 -1244
  34. package/dist/test.cjs +0 -82
  35. package/dist/test.d.cts +0 -61
  36. package/dist/test.d.mts +0 -61
  37. package/dist/test.mjs +0 -79
  38. package/dist/wrangler-BlZWVmX9.mjs +0 -369
  39. package/dist/wrangler-Bomk9mU-.cjs +0 -423
@@ -1,503 +0,0 @@
1
- import { d as HeadPluginConfig, f as HeadState, l as HeadApi, p as OGImageConfig } from "./primitives-yZqQkOVR.cjs";
2
- import { n as ComponentDef } from "./factory-k-YoScgB.cjs";
3
- import * as _moku_labs_core0 from "@moku-labs/core";
4
- import { Processor } from "unified";
5
-
6
- //#region src/plugins/log/types.d.ts
7
- declare namespace types_d_exports$7 {
8
- export { ExpectChain, LogApi, LogConfig, LogEntry, LogLevel, LogSink, LogState };
9
- }
10
- /** @file log plugin types — LogEntry, LogSink, ExpectChain, LogState, LogApi. */
11
- type LogLevel = 'debug' | 'info' | 'warn' | 'error';
12
- type LogEntry = {
13
- level: LogLevel;
14
- event: string;
15
- data?: unknown;
16
- ts: number;
17
- plugin?: string;
18
- };
19
- type LogSink = {
20
- write(entry: LogEntry): void;
21
- };
22
- type ExpectChain = {
23
- toHaveEvent(event: string, partial?: Record<string, unknown>): ExpectChain;
24
- toHaveEventInOrder(events: string[]): ExpectChain;
25
- toNotHaveEvent(event: string, partial?: Record<string, unknown>): ExpectChain;
26
- };
27
- type LogState = {
28
- entries: LogEntry[];
29
- sinks: LogSink[];
30
- };
31
- type LogConfig = {
32
- level: LogLevel;
33
- mode: 'auto' | 'production' | 'test' | 'dev';
34
- };
35
- type LogApi = {
36
- info(event: string, data?: unknown): void;
37
- debug(event: string, data?: unknown): void;
38
- warn(event: string, data?: unknown): void;
39
- error(event: string, data?: unknown, error?: Error): void;
40
- trace(): readonly LogEntry[];
41
- expect(): ExpectChain;
42
- addSink(sink: LogSink): void;
43
- reset(): void;
44
- };
45
- declare namespace types_d_exports$6 {
46
- export { EnvApi, EnvConfig, EnvProvider, EnvState, EnvVarSpec };
47
- }
48
- /** @file env plugin types — schema, provider, EnvApi. */
49
- type EnvVarSpec = {
50
- public: boolean;
51
- required?: boolean;
52
- default?: string;
53
- secret?: boolean;
54
- };
55
- type EnvProvider = {
56
- name: string;
57
- load(): Record<string, string | undefined>;
58
- };
59
- type EnvConfig = {
60
- schema: Record<string, EnvVarSpec>;
61
- providers: EnvProvider[];
62
- publicPrefix: string;
63
- };
64
- type EnvState = {
65
- resolved: Map<string, string>;
66
- publicMap: Map<string, string>;
67
- };
68
- type EnvApi = {
69
- get<K extends string>(key: K): string | undefined;
70
- require(key: string): string;
71
- getPublic(): Readonly<Record<string, string>>;
72
- getPublicMap(): ReadonlyMap<string, string>;
73
- has(key: string): boolean;
74
- };
75
- //#endregion
76
- //#region src/config.d.ts
77
- /** Top-level framework config — flows to all plugins via context. */
78
- type Config = {
79
- mode: 'production' | 'development';
80
- };
81
- /** Framework-level event map — plugin-specific events added by each plugin's events field. */
82
- type Events = {
83
- 'content:ready': {
84
- articles: Map<string, unknown[]>;
85
- };
86
- 'content:invalidated': {
87
- paths: string[];
88
- };
89
- 'router:registered': {
90
- routeCount: number;
91
- };
92
- 'build:phase': {
93
- phase: 'bundle' | 'content' | 'pages' | 'feeds' | 'sitemap' | 'og' | 'images';
94
- };
95
- 'build:complete': {
96
- pages: number;
97
- durationMs: number;
98
- };
99
- 'component:create': {
100
- name: string;
101
- element: Element;
102
- };
103
- 'component:mount': {
104
- name: string;
105
- element: Element;
106
- };
107
- 'component:unmount': {
108
- name: string;
109
- reason: 'navigation' | 'destroy';
110
- };
111
- 'component:destroy': {
112
- name: string;
113
- };
114
- 'nav:start': {
115
- url: string;
116
- fromUrl: string;
117
- };
118
- 'nav:end': {
119
- url: string;
120
- };
121
- };
122
- declare const createPlugin: _moku_labs_core0.BoundCreatePluginFunction<Config, Events, _moku_labs_core0.CoreApisFromTuple<[_moku_labs_core0.CorePluginInstance<"log", {
123
- level: "info";
124
- mode: "auto";
125
- }, LogState, LogApi>, _moku_labs_core0.CorePluginInstance<"env", {
126
- schema: {};
127
- providers: never[];
128
- publicPrefix: string;
129
- }, EnvState, EnvApi>]>>, createCore: _moku_labs_core0.BoundCreateCoreFunction<Config, Events, [_moku_labs_core0.CorePluginInstance<"log", {
130
- level: "info";
131
- mode: "auto";
132
- }, LogState, LogApi>, _moku_labs_core0.CorePluginInstance<"env", {
133
- schema: {};
134
- providers: never[];
135
- publicPrefix: string;
136
- }, EnvState, EnvApi>]>;
137
- declare namespace types_d_exports$5 {
138
- export { SiteApi, SiteConfig, SiteState };
139
- }
140
- /** @file site plugin types — SiteConfig + SiteState + SiteApi. */
141
- type SiteConfig = {
142
- /** Display name of the site. */name: string; /** Base URL of the site (no trailing slash). */
143
- url: string; /** Default author name for content. */
144
- author: string; /** Site description for feeds, meta tags, and preview pages. */
145
- description: string;
146
- };
147
- type SiteState = {
148
- config: Readonly<SiteConfig>;
149
- };
150
- type SiteApi = {
151
- get(): Readonly<SiteConfig>;
152
- name(): string;
153
- url(): string;
154
- author(): string;
155
- description(): string;
156
- };
157
- declare namespace types_d_exports$4 {
158
- export { I18nApi, I18nConfig, I18nState };
159
- }
160
- /** @file i18n plugin types — I18nConfig (generic over locale tuple), I18nState, I18nApi. */
161
- type I18nConfig<TLocales extends readonly string[] = readonly string[]> = {
162
- /** Active locale codes (literal tuple preserved). */locales: TLocales; /** Default locale (must be member of locales). */
163
- defaultLocale: TLocales[number]; /** Display names per locale. */
164
- localeNames: Record<TLocales[number], string>; /** OG locale format mapping (e.g., { en: 'en_US' }). */
165
- ogLocaleMap?: Partial<Record<TLocales[number], string>>; /** UI translation strings per locale. */
166
- translations?: Record<TLocales[number], Record<string, string>>;
167
- };
168
- type I18nState<TLocales extends readonly string[] = readonly string[]> = {
169
- config: Readonly<I18nConfig<TLocales>>;
170
- };
171
- type I18nApi<TLocales extends readonly string[] = readonly string[]> = {
172
- locales(): TLocales;
173
- defaultLocale(): TLocales[number];
174
- localeName(locale: TLocales[number]): string;
175
- ogLocale(locale: TLocales[number]): string;
176
- t(locale: TLocales[number], key: string): string;
177
- };
178
- declare namespace types_d_exports$3 {
179
- export { Article, ComputedFields, ContentApi, ContentConfig, ContentState, Frontmatter, RehypePluginEntry, RemarkPluginEntry };
180
- }
181
- type Frontmatter = {
182
- title: string;
183
- date: string;
184
- description: string;
185
- tags: string[];
186
- language: string;
187
- author?: string;
188
- draft?: boolean;
189
- [key: string]: unknown;
190
- };
191
- type ComputedFields = {
192
- contentId: string;
193
- readingTimeMinutes: number;
194
- wordCount: number;
195
- };
196
- type Article = {
197
- slug: string;
198
- locale: string;
199
- frontmatter: Frontmatter;
200
- html: string;
201
- computed: ComputedFields;
202
- };
203
- type RehypePluginEntry = readonly [unknown, Record<string, unknown>?];
204
- type RemarkPluginEntry = readonly [unknown, Record<string, unknown>?];
205
- type ContentConfig = {
206
- dir: string;
207
- defaultAuthor?: string;
208
- trustedContent: boolean;
209
- rehypePlugins?: RehypePluginEntry[];
210
- remarkPlugins?: RemarkPluginEntry[];
211
- };
212
- type ContentState = {
213
- processor: Processor | null;
214
- articles: Map<string, Map<string, Article>>;
215
- slugs: string[] | null;
216
- lastPaths: Set<string>; /** Paths marked stale by `invalidate()` — re-read on next `loadAll()` then cleared. */
217
- dirtyPaths: Set<string>;
218
- };
219
- type ContentApi = {
220
- loadAll(): Promise<Map<string, Article[]>>;
221
- load(slug: string, locale: string): Promise<Article | null>;
222
- discoverSlugs(): Promise<string[]>;
223
- render(markdown: string): Promise<string>;
224
- invalidate(paths: string[]): void;
225
- reset(): void;
226
- };
227
- declare namespace types_d_exports$2 {
228
- export { HeadConfig, LayoutComponent, RenderContext, RouteBuilder, RouteEntry, RouteSpec, RouterApi, RouterConfig, RouterState, VNode };
229
- }
230
- /** @file router plugin types — RouteSpec (non-accumulating), RouteBuilder, RouterApi. */
231
- /** Render context passed to route handlers. */
232
- type RenderContext = {
233
- url: string;
234
- locale: string;
235
- params: Record<string, string>;
236
- data?: unknown;
237
- };
238
- type LayoutComponent = unknown;
239
- type VNode = unknown;
240
- type HeadConfig = unknown;
241
- type RouteSpec = {
242
- pattern: string;
243
- load?: (params: Record<string, string>) => unknown;
244
- layout?: LayoutComponent;
245
- render?: (ctx: RenderContext) => VNode;
246
- generate?: (locale: string) => Array<{
247
- params: Record<string, string>;
248
- }>;
249
- head?: (ctx: RenderContext) => HeadConfig;
250
- meta?: Record<string, unknown>;
251
- toJson?: (ctx: RenderContext) => object;
252
- toFile?: (ctx: RenderContext) => {
253
- name: string;
254
- content: string | Uint8Array;
255
- };
256
- };
257
- /**
258
- * Non-accumulating fluent builder. Methods mutate an internal spec and return `this`
259
- * typed as the same `RouteBuilder` — type information captured in `RouteSpec` shape,
260
- * not builder generics. Prevents TS inference performance collapse at 50+ routes.
261
- */
262
- type RouteBuilder = {
263
- load<T>(fn: (params: Record<string, string>) => T | Promise<T>): RouteBuilder;
264
- layout(component: LayoutComponent): RouteBuilder;
265
- render(fn: (ctx: RenderContext) => VNode): RouteBuilder;
266
- generate(fn: (locale: string) => Array<{
267
- params: Record<string, string>;
268
- }>): RouteBuilder;
269
- head(fn: (ctx: RenderContext) => HeadConfig): RouteBuilder;
270
- meta(data: Record<string, unknown>): RouteBuilder;
271
- toJson(fn: (ctx: RenderContext) => object): RouteBuilder;
272
- toFile(fn: (ctx: RenderContext) => {
273
- name: string;
274
- content: string | Uint8Array;
275
- }): RouteBuilder; /** Internal: produce the RouteSpec object. */
276
- _spec(): RouteSpec;
277
- };
278
- type RouteEntry = {
279
- name: string;
280
- spec: RouteSpec;
281
- specificity: number;
282
- };
283
- type RouterConfig<Routes extends Record<string, RouteSpec> = Record<string, RouteSpec>> = {
284
- routes: Routes;
285
- defaultPage?: keyof Routes & string;
286
- };
287
- type RouterState<Routes extends Record<string, RouteSpec> = Record<string, RouteSpec>> = {
288
- routes: Routes;
289
- entries: ReadonlyArray<RouteEntry>;
290
- };
291
- type RouterApi<Routes extends Record<string, RouteSpec> = Record<string, RouteSpec>> = {
292
- routes: Routes;
293
- toUrl<K extends keyof Routes>(name: K, params: Record<string, string>): string;
294
- match(url: string): {
295
- entry: RouteEntry;
296
- params: Record<string, string>;
297
- } | null;
298
- entries(): ReadonlyArray<RouteEntry>;
299
- };
300
- declare namespace types_d_exports$1 {
301
- export { BuildApi, BuildConfig, BuildPhase, BuildResult, BuildState, BundleManifest };
302
- }
303
- /** @file build plugin types — BuildConfig, BuildState, BuildApi, BundleManifest, BuildResult. */
304
- type BuildPhase = 'bundle' | 'content' | 'pages' | 'feeds' | 'sitemap' | 'og' | 'images';
305
- type BuildConfig = {
306
- outdir: string;
307
- mode: 'production' | 'development';
308
- renderMode: 'ssg' | 'spa' | 'hybrid';
309
- cssEntry?: string;
310
- jsEntry?: string;
311
- articleRouteKey?: string;
312
- sourcemap?: 'none' | 'external' | 'inline';
313
- };
314
- type BundleManifest = {
315
- cssPaths: string[];
316
- jsPaths: string[];
317
- assets: Map<string, string>;
318
- };
319
- type BuildState = {
320
- manifest: BundleManifest | null;
321
- lastResult: BuildResult | null;
322
- };
323
- type BuildResult = {
324
- pages: number;
325
- durationMs: number;
326
- manifest: BundleManifest;
327
- };
328
- type BuildApi = {
329
- run(): Promise<BuildResult>;
330
- getManifest(): Readonly<BundleManifest> | null;
331
- };
332
- declare namespace types_d_exports {
333
- export { DeployApi, DeployConfig, DeployResult, DeployState, DeployTarget, RunOptions };
334
- }
335
- /** @file deploy plugin types — DeployConfig, DeployState, DeployResult, RunOptions, DeployApi. */
336
- /**
337
- * Deployment target. Phase 1 ships `'pages'` only; `'workers'` is reserved
338
- * for the Workers Static Assets expansion path and `buildWranglerArgs`
339
- * throws "not implemented in Phase 1" if invoked with it.
340
- */
341
- type DeployTarget = 'pages' | 'workers';
342
- /**
343
- * deploy plugin config.
344
- *
345
- * `outdir` precedence at deploy time: `wrangler.jsonc#pages_build_output_dir`
346
- * (written by `moku deploy init`) — this is the deploy-time single source of
347
- * truth, NOT `DeployConfig.outdir`. The config field is the *init-time* default;
348
- * once `wrangler.jsonc` exists, it owns the value.
349
- *
350
- * Forbidden: reading the `build` plugin's config via `ctx.has(build)` /
351
- * `ctx.require(build).config.outdir`. The core `HasFunction` takes a name
352
- * string and returns a non-narrowing boolean; `RequireFunction` returns the
353
- * API surface only (`BuildApi = { run, getManifest }`). The optional coupling
354
- * is a `ctx.log.warn` at init time when divergence is detectable through the
355
- * directly-imported `build` plugin instance, never via the core API.
356
- */
357
- type DeployConfig = {
358
- /** Deployment target. Default: `'pages'`. */target: DeployTarget; /** Build output directory used at init only. Default: `'dist'` (matches build plugin default). */
359
- outdir: string; /** Production branch name. Default: `'main'`. Overwritten by `init` via `git symbolic-ref`. */
360
- productionBranch: string; /** Optional explicit override for the Cloudflare Pages project name. Default: derived from `site.name`. */
361
- projectName?: string;
362
- };
363
- /**
364
- * In-memory deploy plugin state.
365
- *
366
- * `lastDeployment` is reset per `createApp()` call and captures the most
367
- * recent deploy's metadata (URL, deployment ID, branch, duration). Used by
368
- * the future REST-API-based rollback command (deferred from Phase 1).
369
- */
370
- type DeployState = {
371
- lastDeployment: DeployResult | null;
372
- };
373
- /** Result of a successful `app.deploy.run()` invocation. */
374
- type DeployResult = {
375
- /** Production URL (e.g., `https://<project>.pages.dev`) or branch-alias preview URL. */url: string; /** Cloudflare deployment ID — captured for future rollback support. */
376
- deploymentId: string; /** Branch the deploy was published to. */
377
- branch: string; /** Total subprocess duration in milliseconds (init + upload + finalize). */
378
- durationMs: number;
379
- };
380
- /**
381
- * Options accepted by `app.deploy.run()`.
382
- *
383
- * `branch` overrides the production branch from wrangler.jsonc (defaults to
384
- * `DeployConfig.productionBranch`). `build` runs `app.build.run()` first
385
- * when true — used only for local convenience; the generated CI workflow
386
- * always issues the two-step `moku build` then `moku deploy` pattern.
387
- */
388
- type RunOptions = {
389
- /** Override the production branch for this deploy. */branch?: string; /** Run `app.build.run()` first (local convenience). Default: `false`. */
390
- build?: boolean;
391
- };
392
- /** Public deploy plugin API surface, attached as `app.deploy`. */
393
- type DeployApi = {
394
- /** Run a deploy. Reads outdir from wrangler.jsonc; errors if missing. */run(options?: RunOptions): Promise<DeployResult>; /** Read the last deployment result without re-running. */
395
- getLastDeployment(): Readonly<DeployResult> | null;
396
- };
397
- //#endregion
398
- //#region src/project.d.ts
399
- /**
400
- * Map each consumer `RouteBuilder` to the `RouteSpec` shape the router stores.
401
- *
402
- * Keys are preserved so `toUrl(name, ...)` and `defaultPage` stay typed.
403
- */
404
- type RouteSpecMap<Routes extends Record<string, RouteBuilder>> = { [K in keyof Routes]: RouteSpec };
405
- /**
406
- * Consumer-facing flat config shape.
407
- *
408
- * Generic over Routes (a record of `RouteBuilder`) so the literal route-name
409
- * keys flow through to `app.router.routes` after the wrapper assembles the app.
410
- */
411
- type WebAppConfig<Routes extends Record<string, RouteBuilder>> = {
412
- mode?: 'production' | 'development';
413
- site: SiteConfig;
414
- i18n: I18nConfig;
415
- routes: Routes;
416
- components?: ComponentDef[];
417
- spa?: {
418
- viewTransitions?: boolean;
419
- progressBar?: boolean;
420
- };
421
- ogImage?: OGImageConfig;
422
- contentDir: string;
423
- defaultPage?: keyof Routes & string;
424
- trustedContent?: boolean;
425
- };
426
- //#endregion
427
- //#region src/plugins/build/index.d.ts
428
- declare const build: _moku_labs_core0.PluginInstance<"build", BuildConfig, BuildState, BuildApi, {
429
- 'build:phase': {
430
- phase: "bundle" | "content" | "pages" | "feeds" | "sitemap" | "og" | "images";
431
- };
432
- 'build:complete': {
433
- pages: number;
434
- durationMs: number;
435
- };
436
- }> & Record<never, never>;
437
- //#endregion
438
- //#region src/plugins/content/index.d.ts
439
- declare const content: _moku_labs_core0.PluginInstance<"content", ContentConfig, ContentState, ContentApi, {
440
- 'content:ready': {
441
- articles: Map<string, Article[]>;
442
- };
443
- 'content:invalidated': {
444
- paths: string[];
445
- };
446
- }> & Record<never, never>;
447
- //#endregion
448
- //#region src/plugins/deploy/index.d.ts
449
- declare const deploy: _moku_labs_core0.PluginInstance<"deploy", DeployConfig, DeployState, DeployApi, {}> & Record<never, never>;
450
- //#endregion
451
- //#region src/plugins/env/index.d.ts
452
- declare const env: _moku_labs_core0.CorePluginInstance<"env", {
453
- schema: {};
454
- providers: never[];
455
- publicPrefix: string;
456
- }, EnvState, EnvApi>;
457
- //#endregion
458
- //#region src/plugins/head/index.d.ts
459
- declare const head: _moku_labs_core0.PluginInstance<"head", HeadPluginConfig, HeadState, HeadApi, {}> & Record<never, never>;
460
- //#endregion
461
- //#region src/plugins/i18n/index.d.ts
462
- declare const i18n: _moku_labs_core0.PluginInstance<"i18n", I18nConfig, I18nState<readonly string[]>, I18nApi<readonly string[]>, {}> & Record<never, never>;
463
- //#endregion
464
- //#region src/plugins/log/index.d.ts
465
- declare const log: _moku_labs_core0.CorePluginInstance<"log", {
466
- level: "info";
467
- mode: "auto";
468
- }, LogState, LogApi>;
469
- //#endregion
470
- //#region src/plugins/router/route-builder.d.ts
471
- /**
472
- * Build a `RouteSpec` via a fluent, non-accumulating builder.
473
- *
474
- * Methods mutate a single internal `RouteSpec` and return the same builder typed
475
- * as `RouteBuilder` (NOT `RouteBuilder<T>`). Type information lives on the
476
- * `RouteSpec` shape, not in builder generics — this keeps TS inference O(1) per
477
- * route and prevents the 50+ route inference collapse described in D5.
478
- *
479
- * @param pattern - URL pattern (e.g. `/about`, `/{slug}`, `/{lang:?}/{slug}/`).
480
- * @returns A `RouteBuilder` that mutates an internal spec.
481
- * @example
482
- * ```ts
483
- * const home = route('/{lang:?}/').render(({ locale }) => <Home locale={locale} />)
484
- * ```
485
- */
486
- declare function route(pattern: string): RouteBuilder;
487
- //#endregion
488
- //#region src/plugins/router/index.d.ts
489
- declare const router: _moku_labs_core0.PluginInstance<"router", RouterConfig, RouterState, RouterApi, {
490
- 'router:registered': {
491
- routeCount: number;
492
- };
493
- }> & Record<never, never>;
494
- //#endregion
495
- //#region src/plugins/site/index.d.ts
496
- declare const site: _moku_labs_core0.PluginInstance<"site", {
497
- name: string;
498
- url: string;
499
- author: string;
500
- description: string;
501
- }, SiteState, SiteApi, {}> & Record<never, never>;
502
- //#endregion
503
- export { ContentState as A, Events as B, RouterApi as C, Article as D, types_d_exports$2 as E, types_d_exports$4 as F, EnvState as G, EnvApi as H, SiteApi as I, LogApi as J, EnvVarSpec as K, SiteState as L, I18nApi as M, I18nConfig as N, ContentApi as O, I18nState as P, types_d_exports$5 as R, RouteSpec as S, RouterState as T, EnvConfig as U, createPlugin as V, EnvProvider as W, types_d_exports$7 as X, LogState as Y, BuildApi as _, i18n as a, types_d_exports$1 as b, deploy as c, RouteSpecMap as d, WebAppConfig as f, types_d_exports as g, DeployState as h, log as i, types_d_exports$3 as j, ContentConfig as k, content as l, DeployConfig as m, router as n, head as o, DeployApi as p, types_d_exports$6 as q, route as r, env as s, site as t, build as u, BuildConfig as v, RouterConfig as w, RouteBuilder as x, BuildState as y, Config as z };
@@ -1,35 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_primitives = require('../../primitives-BYUp6kae.cjs');
3
-
4
- //#region src/plugins/head/build.ts
5
- /** @file Sub-path /build entry — pure build-time helpers (no plugin state access). */
6
- /**
7
- * Build a list of head elements for an article page from its frontmatter.
8
- * Pure function — safe to call at build time without a plugin context.
9
- *
10
- * Always emits `<link rel=canonical>` and `<meta property=og:type content=article>`.
11
- * Adds `og:article:*` meta tags for any provided frontmatter fields.
12
- *
13
- * @param meta - Article frontmatter (publishedTime, modifiedTime, author, section, tags).
14
- * @param canonicalUrl - The fully-qualified canonical URL for the article.
15
- * @returns Ordered array of HeadElements ready to feed into `head.render()`.
16
- */
17
- const buildArticleHead = (meta, canonicalUrl) => {
18
- const elements = [require_primitives.canonical(canonicalUrl), require_primitives.og("type", "article")];
19
- if (meta.publishedTime) elements.push(require_primitives.og("article:published_time", meta.publishedTime));
20
- if (meta.modifiedTime) elements.push(require_primitives.og("article:modified_time", meta.modifiedTime));
21
- if (meta.author) elements.push(require_primitives.og("article:author", meta.author));
22
- if (meta.section) elements.push(require_primitives.og("article:section", meta.section));
23
- if (meta.tags) for (const tag of meta.tags) elements.push(require_primitives.og("article:tag", tag));
24
- return elements;
25
- };
26
-
27
- //#endregion
28
- exports.buildArticleHead = buildArticleHead;
29
- exports.canonical = require_primitives.canonical;
30
- exports.feedLink = require_primitives.feedLink;
31
- exports.hreflang = require_primitives.hreflang;
32
- exports.jsonLd = require_primitives.jsonLd;
33
- exports.meta = require_primitives.meta;
34
- exports.og = require_primitives.og;
35
- exports.twitter = require_primitives.twitter;
@@ -1,17 +0,0 @@
1
- import { a as meta, c as ArticleMeta, i as jsonLd, n as feedLink, o as og, r as hreflang, s as twitter, t as canonical, u as HeadElement } from "../../primitives-yZqQkOVR.cjs";
2
-
3
- //#region src/plugins/head/build.d.ts
4
- /**
5
- * Build a list of head elements for an article page from its frontmatter.
6
- * Pure function — safe to call at build time without a plugin context.
7
- *
8
- * Always emits `<link rel=canonical>` and `<meta property=og:type content=article>`.
9
- * Adds `og:article:*` meta tags for any provided frontmatter fields.
10
- *
11
- * @param meta - Article frontmatter (publishedTime, modifiedTime, author, section, tags).
12
- * @param canonicalUrl - The fully-qualified canonical URL for the article.
13
- * @returns Ordered array of HeadElements ready to feed into `head.render()`.
14
- */
15
- declare const buildArticleHead: (meta: ArticleMeta, canonicalUrl: string) => HeadElement[];
16
- //#endregion
17
- export { type ArticleMeta, type HeadElement, buildArticleHead, canonical, feedLink, hreflang, jsonLd, meta, og, twitter };
@@ -1,17 +0,0 @@
1
- import { a as meta, c as ArticleMeta, i as jsonLd, n as feedLink, o as og, r as hreflang, s as twitter, t as canonical, u as HeadElement } from "../../primitives-DKgZfRAO.mjs";
2
-
3
- //#region src/plugins/head/build.d.ts
4
- /**
5
- * Build a list of head elements for an article page from its frontmatter.
6
- * Pure function — safe to call at build time without a plugin context.
7
- *
8
- * Always emits `<link rel=canonical>` and `<meta property=og:type content=article>`.
9
- * Adds `og:article:*` meta tags for any provided frontmatter fields.
10
- *
11
- * @param meta - Article frontmatter (publishedTime, modifiedTime, author, section, tags).
12
- * @param canonicalUrl - The fully-qualified canonical URL for the article.
13
- * @returns Ordered array of HeadElements ready to feed into `head.render()`.
14
- */
15
- declare const buildArticleHead: (meta: ArticleMeta, canonicalUrl: string) => HeadElement[];
16
- //#endregion
17
- export { type ArticleMeta, type HeadElement, buildArticleHead, canonical, feedLink, hreflang, jsonLd, meta, og, twitter };
@@ -1,27 +0,0 @@
1
- import { a as meta, i as jsonLd, n as feedLink, o as og, r as hreflang, s as twitter, t as canonical } from "../../primitives-Dhko-oLM.mjs";
2
-
3
- //#region src/plugins/head/build.ts
4
- /** @file Sub-path /build entry — pure build-time helpers (no plugin state access). */
5
- /**
6
- * Build a list of head elements for an article page from its frontmatter.
7
- * Pure function — safe to call at build time without a plugin context.
8
- *
9
- * Always emits `<link rel=canonical>` and `<meta property=og:type content=article>`.
10
- * Adds `og:article:*` meta tags for any provided frontmatter fields.
11
- *
12
- * @param meta - Article frontmatter (publishedTime, modifiedTime, author, section, tags).
13
- * @param canonicalUrl - The fully-qualified canonical URL for the article.
14
- * @returns Ordered array of HeadElements ready to feed into `head.render()`.
15
- */
16
- const buildArticleHead = (meta, canonicalUrl) => {
17
- const elements = [canonical(canonicalUrl), og("type", "article")];
18
- if (meta.publishedTime) elements.push(og("article:published_time", meta.publishedTime));
19
- if (meta.modifiedTime) elements.push(og("article:modified_time", meta.modifiedTime));
20
- if (meta.author) elements.push(og("article:author", meta.author));
21
- if (meta.section) elements.push(og("article:section", meta.section));
22
- if (meta.tags) for (const tag of meta.tags) elements.push(og("article:tag", tag));
23
- return elements;
24
- };
25
-
26
- //#endregion
27
- export { buildArticleHead, canonical, feedLink, hreflang, jsonLd, meta, og, twitter };
@@ -1,26 +0,0 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
- const require_factory = require('../../factory-CMOo4n6a.cjs');
3
-
4
- //#region src/plugins/spa/index.ts
5
- /** @file spa plugin: Very Complex tier — router + head + progress + components sub-modules. */
6
- const defaultConfig = {
7
- config: {
8
- viewTransitions: false,
9
- progressBar: true
10
- },
11
- components: []
12
- };
13
- const spa = require_factory.createPlugin("spa", {
14
- depends: [require_factory.router, require_factory.head],
15
- config: defaultConfig,
16
- events: require_factory.registerSpaEvents,
17
- createState: require_factory.createSpaState,
18
- api: require_factory.createSpaApi,
19
- onStart: async (ctx) => {
20
- if (typeof window !== "undefined") await require_factory.createClientRuntime(ctx).start();
21
- }
22
- });
23
-
24
- //#endregion
25
- exports.createComponent = require_factory.createComponent;
26
- exports.spa = spa;
@@ -1,30 +0,0 @@
1
- import { a as SpaConfig, i as SpaApi, o as SpaState, t as createComponent } from "../../factory-k-YoScgB.cjs";
2
- import * as _moku_labs_core0 from "@moku-labs/core";
3
-
4
- //#region src/plugins/spa/index.d.ts
5
- declare const spa: _moku_labs_core0.PluginInstance<"spa", SpaConfig, SpaState, SpaApi, {
6
- 'component:create': {
7
- name: string;
8
- element: Element;
9
- };
10
- 'component:mount': {
11
- name: string;
12
- element: Element;
13
- };
14
- 'component:unmount': {
15
- name: string;
16
- reason: "navigation" | "destroy";
17
- };
18
- 'component:destroy': {
19
- name: string;
20
- };
21
- 'nav:start': {
22
- url: string;
23
- fromUrl: string;
24
- };
25
- 'nav:end': {
26
- url: string;
27
- };
28
- }> & Record<never, never>;
29
- //#endregion
30
- export { createComponent, spa };