@moku-labs/web 1.14.0 → 1.15.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 +27 -26
- package/dist/browser.mjs +220 -181
- package/dist/index.cjs +2446 -2372
- package/dist/index.d.cts +30 -28
- package/dist/index.d.mts +30 -28
- package/dist/index.mjs +2446 -2372
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -231,6 +231,28 @@ type Api$6 = {
|
|
|
231
231
|
t(locale: string, key: string): string;
|
|
232
232
|
};
|
|
233
233
|
//#endregion
|
|
234
|
+
//#region src/plugins/i18n/index.d.ts
|
|
235
|
+
/**
|
|
236
|
+
* Internationalization plugin — locale registry plus a flat translation helper
|
|
237
|
+
* with default-locale fallback. Pure config-as-data (no state or events);
|
|
238
|
+
* consumed read-only by content, router, head, and build.
|
|
239
|
+
*
|
|
240
|
+
* @example Register locales and translations
|
|
241
|
+
* ```ts
|
|
242
|
+
* const app = createApp({
|
|
243
|
+
* pluginConfigs: {
|
|
244
|
+
* i18n: {
|
|
245
|
+
* locales: ["en", "uk"],
|
|
246
|
+
* defaultLocale: "en",
|
|
247
|
+
* localeNames: { en: "English", uk: "Українська" },
|
|
248
|
+
* translations: { uk: { "nav.home": "Головна" } }
|
|
249
|
+
* }
|
|
250
|
+
* }
|
|
251
|
+
* });
|
|
252
|
+
* ```
|
|
253
|
+
*/
|
|
254
|
+
declare const i18nPlugin: import("@moku-labs/core").PluginInstance<"i18n", Config$6, Record<string, never>, Api$6, {}> & Record<never, never>;
|
|
255
|
+
//#endregion
|
|
234
256
|
//#region src/plugins/router/iso-match.d.ts
|
|
235
257
|
/**
|
|
236
258
|
* A compiled, engine-agnostic path matcher: the same `.exec({ pathname })` shape the
|
|
@@ -1252,7 +1274,7 @@ type PhaseContext = {
|
|
|
1252
1274
|
readonly global: Readonly<{
|
|
1253
1275
|
stage: Stage;
|
|
1254
1276
|
}>; /** Resolve a depended-upon plugin instance to its public API. */
|
|
1255
|
-
require: PhaseRequire; /** Whether a plugin is registered (by name) — used to detect
|
|
1277
|
+
require: PhaseRequire; /** Whether a plugin is registered (by name) — used to detect OPTIONAL plugins (`data`, `content`, `i18n`, `head`). */
|
|
1256
1278
|
has: (name: string) => boolean; /** Emit a build event (notification-only). */
|
|
1257
1279
|
emit: PhaseEmit; /** Structured logger (core `log` API). */
|
|
1258
1280
|
readonly log: PhaseLog;
|
|
@@ -1585,7 +1607,8 @@ type Api$3 = {
|
|
|
1585
1607
|
/**
|
|
1586
1608
|
* Build plugin — the static-site-generation orchestrator. Renders every route to
|
|
1587
1609
|
* `outDir`, and optionally emits feeds, a sitemap, optimized images, and OG
|
|
1588
|
-
* images.
|
|
1610
|
+
* images. Hard-depends only on site, router, and head; `content` and `i18n` are
|
|
1611
|
+
* OPTIONAL (a content-less or single-locale site builds without them). Emits `build:phase`.
|
|
1589
1612
|
*
|
|
1590
1613
|
* @example Configure the production build
|
|
1591
1614
|
* ```ts
|
|
@@ -2835,7 +2858,8 @@ type Api = {
|
|
|
2835
2858
|
* (locale fallback, draft filtering, sort, caching, events) lives here; source I/O +
|
|
2836
2859
|
* the Markdown pipeline live in a {@link ContentProvider} you compose (like `env`
|
|
2837
2860
|
* providers). The shell imports zero node code, so `contentPlugin` is browser-safe.
|
|
2838
|
-
*
|
|
2861
|
+
* i18n is OPTIONAL (single default-locale fallback when absent); emits `content:ready`
|
|
2862
|
+
* and `content:invalidated`.
|
|
2839
2863
|
*
|
|
2840
2864
|
* @example Compose the node filesystem provider with a content dir + Shiki theme
|
|
2841
2865
|
* ```ts
|
|
@@ -3127,7 +3151,7 @@ declare function buildArticleHead(articleMeta: ArticleMeta, canonicalUrl: string
|
|
|
3127
3151
|
* Head plugin — composes per-route `<head>` metadata (title template, Open Graph,
|
|
3128
3152
|
* Twitter cards, canonical, hreflang). Use the re-exported SEO primitives
|
|
3129
3153
|
* ({@link meta}, {@link og}, {@link twitter}, …) inside a route's `.head()`.
|
|
3130
|
-
* Depends on site
|
|
3154
|
+
* Depends on site and router; i18n is OPTIONAL (single default-locale fallback when absent).
|
|
3131
3155
|
*
|
|
3132
3156
|
* @example Set global head defaults
|
|
3133
3157
|
* ```ts
|
|
@@ -3153,28 +3177,6 @@ declare const headPlugin: import("@moku-labs/core").PluginInstance<"head", Confi
|
|
|
3153
3177
|
buildArticleHead: typeof buildArticleHead;
|
|
3154
3178
|
};
|
|
3155
3179
|
//#endregion
|
|
3156
|
-
//#region src/plugins/i18n/index.d.ts
|
|
3157
|
-
/**
|
|
3158
|
-
* Internationalization plugin — locale registry plus a flat translation helper
|
|
3159
|
-
* with default-locale fallback. Pure config-as-data (no state or events);
|
|
3160
|
-
* consumed read-only by content, router, head, and build.
|
|
3161
|
-
*
|
|
3162
|
-
* @example Register locales and translations
|
|
3163
|
-
* ```ts
|
|
3164
|
-
* const app = createApp({
|
|
3165
|
-
* pluginConfigs: {
|
|
3166
|
-
* i18n: {
|
|
3167
|
-
* locales: ["en", "uk"],
|
|
3168
|
-
* defaultLocale: "en",
|
|
3169
|
-
* localeNames: { en: "English", uk: "Українська" },
|
|
3170
|
-
* translations: { uk: { "nav.home": "Головна" } }
|
|
3171
|
-
* }
|
|
3172
|
-
* }
|
|
3173
|
-
* });
|
|
3174
|
-
* ```
|
|
3175
|
-
*/
|
|
3176
|
-
declare const i18nPlugin: import("@moku-labs/core").PluginInstance<"i18n", Config$6, Record<string, never>, Api$6, {}> & Record<never, never>;
|
|
3177
|
-
//#endregion
|
|
3178
3180
|
//#region src/plugins/router/builders/route-builder.d.ts
|
|
3179
3181
|
/**
|
|
3180
3182
|
* Create a fluent route builder from a URL pattern string. Captures the pattern
|
|
@@ -3238,8 +3240,8 @@ declare function createUrls<T extends RouteMap>(routes: T, defaultLocale?: strin
|
|
|
3238
3240
|
/**
|
|
3239
3241
|
* Router plugin — typed, named route definitions with locale-aware URL generation
|
|
3240
3242
|
* and matching. Author routes with {@link route}, then register them the normal config
|
|
3241
|
-
* way via `pluginConfigs.router.routes` (compiled at init). Depends on site (base URL)
|
|
3242
|
-
*
|
|
3243
|
+
* way via `pluginConfigs.router.routes` (compiled at init). Depends on site (base URL);
|
|
3244
|
+
* i18n (locales) is OPTIONAL — falls back to a single default locale ("en") when absent.
|
|
3243
3245
|
*
|
|
3244
3246
|
* @example Register routes via config, then start/build
|
|
3245
3247
|
* ```ts
|
package/dist/index.d.mts
CHANGED
|
@@ -229,6 +229,28 @@ type Api$6 = {
|
|
|
229
229
|
t(locale: string, key: string): string;
|
|
230
230
|
};
|
|
231
231
|
//#endregion
|
|
232
|
+
//#region src/plugins/i18n/index.d.ts
|
|
233
|
+
/**
|
|
234
|
+
* Internationalization plugin — locale registry plus a flat translation helper
|
|
235
|
+
* with default-locale fallback. Pure config-as-data (no state or events);
|
|
236
|
+
* consumed read-only by content, router, head, and build.
|
|
237
|
+
*
|
|
238
|
+
* @example Register locales and translations
|
|
239
|
+
* ```ts
|
|
240
|
+
* const app = createApp({
|
|
241
|
+
* pluginConfigs: {
|
|
242
|
+
* i18n: {
|
|
243
|
+
* locales: ["en", "uk"],
|
|
244
|
+
* defaultLocale: "en",
|
|
245
|
+
* localeNames: { en: "English", uk: "Українська" },
|
|
246
|
+
* translations: { uk: { "nav.home": "Головна" } }
|
|
247
|
+
* }
|
|
248
|
+
* }
|
|
249
|
+
* });
|
|
250
|
+
* ```
|
|
251
|
+
*/
|
|
252
|
+
declare const i18nPlugin: import("@moku-labs/core").PluginInstance<"i18n", Config$6, Record<string, never>, Api$6, {}> & Record<never, never>;
|
|
253
|
+
//#endregion
|
|
232
254
|
//#region src/plugins/router/iso-match.d.ts
|
|
233
255
|
/**
|
|
234
256
|
* A compiled, engine-agnostic path matcher: the same `.exec({ pathname })` shape the
|
|
@@ -1250,7 +1272,7 @@ type PhaseContext = {
|
|
|
1250
1272
|
readonly global: Readonly<{
|
|
1251
1273
|
stage: Stage;
|
|
1252
1274
|
}>; /** Resolve a depended-upon plugin instance to its public API. */
|
|
1253
|
-
require: PhaseRequire; /** Whether a plugin is registered (by name) — used to detect
|
|
1275
|
+
require: PhaseRequire; /** Whether a plugin is registered (by name) — used to detect OPTIONAL plugins (`data`, `content`, `i18n`, `head`). */
|
|
1254
1276
|
has: (name: string) => boolean; /** Emit a build event (notification-only). */
|
|
1255
1277
|
emit: PhaseEmit; /** Structured logger (core `log` API). */
|
|
1256
1278
|
readonly log: PhaseLog;
|
|
@@ -1583,7 +1605,8 @@ type Api$3 = {
|
|
|
1583
1605
|
/**
|
|
1584
1606
|
* Build plugin — the static-site-generation orchestrator. Renders every route to
|
|
1585
1607
|
* `outDir`, and optionally emits feeds, a sitemap, optimized images, and OG
|
|
1586
|
-
* images.
|
|
1608
|
+
* images. Hard-depends only on site, router, and head; `content` and `i18n` are
|
|
1609
|
+
* OPTIONAL (a content-less or single-locale site builds without them). Emits `build:phase`.
|
|
1587
1610
|
*
|
|
1588
1611
|
* @example Configure the production build
|
|
1589
1612
|
* ```ts
|
|
@@ -2833,7 +2856,8 @@ type Api = {
|
|
|
2833
2856
|
* (locale fallback, draft filtering, sort, caching, events) lives here; source I/O +
|
|
2834
2857
|
* the Markdown pipeline live in a {@link ContentProvider} you compose (like `env`
|
|
2835
2858
|
* providers). The shell imports zero node code, so `contentPlugin` is browser-safe.
|
|
2836
|
-
*
|
|
2859
|
+
* i18n is OPTIONAL (single default-locale fallback when absent); emits `content:ready`
|
|
2860
|
+
* and `content:invalidated`.
|
|
2837
2861
|
*
|
|
2838
2862
|
* @example Compose the node filesystem provider with a content dir + Shiki theme
|
|
2839
2863
|
* ```ts
|
|
@@ -3125,7 +3149,7 @@ declare function buildArticleHead(articleMeta: ArticleMeta, canonicalUrl: string
|
|
|
3125
3149
|
* Head plugin — composes per-route `<head>` metadata (title template, Open Graph,
|
|
3126
3150
|
* Twitter cards, canonical, hreflang). Use the re-exported SEO primitives
|
|
3127
3151
|
* ({@link meta}, {@link og}, {@link twitter}, …) inside a route's `.head()`.
|
|
3128
|
-
* Depends on site
|
|
3152
|
+
* Depends on site and router; i18n is OPTIONAL (single default-locale fallback when absent).
|
|
3129
3153
|
*
|
|
3130
3154
|
* @example Set global head defaults
|
|
3131
3155
|
* ```ts
|
|
@@ -3151,28 +3175,6 @@ declare const headPlugin: import("@moku-labs/core").PluginInstance<"head", Confi
|
|
|
3151
3175
|
buildArticleHead: typeof buildArticleHead;
|
|
3152
3176
|
};
|
|
3153
3177
|
//#endregion
|
|
3154
|
-
//#region src/plugins/i18n/index.d.ts
|
|
3155
|
-
/**
|
|
3156
|
-
* Internationalization plugin — locale registry plus a flat translation helper
|
|
3157
|
-
* with default-locale fallback. Pure config-as-data (no state or events);
|
|
3158
|
-
* consumed read-only by content, router, head, and build.
|
|
3159
|
-
*
|
|
3160
|
-
* @example Register locales and translations
|
|
3161
|
-
* ```ts
|
|
3162
|
-
* const app = createApp({
|
|
3163
|
-
* pluginConfigs: {
|
|
3164
|
-
* i18n: {
|
|
3165
|
-
* locales: ["en", "uk"],
|
|
3166
|
-
* defaultLocale: "en",
|
|
3167
|
-
* localeNames: { en: "English", uk: "Українська" },
|
|
3168
|
-
* translations: { uk: { "nav.home": "Головна" } }
|
|
3169
|
-
* }
|
|
3170
|
-
* }
|
|
3171
|
-
* });
|
|
3172
|
-
* ```
|
|
3173
|
-
*/
|
|
3174
|
-
declare const i18nPlugin: import("@moku-labs/core").PluginInstance<"i18n", Config$6, Record<string, never>, Api$6, {}> & Record<never, never>;
|
|
3175
|
-
//#endregion
|
|
3176
3178
|
//#region src/plugins/router/builders/route-builder.d.ts
|
|
3177
3179
|
/**
|
|
3178
3180
|
* Create a fluent route builder from a URL pattern string. Captures the pattern
|
|
@@ -3236,8 +3238,8 @@ declare function createUrls<T extends RouteMap>(routes: T, defaultLocale?: strin
|
|
|
3236
3238
|
/**
|
|
3237
3239
|
* Router plugin — typed, named route definitions with locale-aware URL generation
|
|
3238
3240
|
* and matching. Author routes with {@link route}, then register them the normal config
|
|
3239
|
-
* way via `pluginConfigs.router.routes` (compiled at init). Depends on site (base URL)
|
|
3240
|
-
*
|
|
3241
|
+
* way via `pluginConfigs.router.routes` (compiled at init). Depends on site (base URL);
|
|
3242
|
+
* i18n (locales) is OPTIONAL — falls back to a single default locale ("en") when absent.
|
|
3241
3243
|
*
|
|
3242
3244
|
* @example Register routes via config, then start/build
|
|
3243
3245
|
* ```ts
|