@moku-labs/web 0.2.0 → 0.3.1
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/chunk-D7D4PA-g.mjs +13 -0
- package/dist/index.cjs +940 -266
- package/dist/index.d.cts +315 -121
- package/dist/index.d.mts +314 -120
- package/dist/index.mjs +857 -175
- package/package.json +8 -8
- package/dist/chunk-DQk6qfdC.mjs +0 -18
package/dist/index.d.cts
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
import * as _moku_labs_core0 from "@moku-labs/core";
|
|
2
|
-
import { EmitFn } from "@moku-labs/core";
|
|
3
1
|
import { ComponentChildren, VNode } from "preact";
|
|
4
2
|
import { Pluggable, Processor } from "unified";
|
|
3
|
+
import { EmitFn } from "@moku-labs/core";
|
|
5
4
|
|
|
6
5
|
//#region \0rolldown/runtime.js
|
|
7
6
|
declare namespace types_d_exports$5 {
|
|
@@ -313,7 +312,7 @@ type EnvApi = {
|
|
|
313
312
|
* createApp({ pluginConfigs: { env: { schema: { PUBLIC_API_URL: { public: true } } } } });
|
|
314
313
|
* ```
|
|
315
314
|
*/
|
|
316
|
-
declare const envPlugin:
|
|
315
|
+
declare const envPlugin: import("@moku-labs/core").CorePluginInstance<"env", EnvConfig, EnvState, EnvApi>;
|
|
317
316
|
//#endregion
|
|
318
317
|
//#region src/config.d.ts
|
|
319
318
|
/**
|
|
@@ -1798,7 +1797,25 @@ type Api = {
|
|
|
1798
1797
|
* Depends: site. Emits: deploy:complete.
|
|
1799
1798
|
* @see README.md
|
|
1800
1799
|
*/
|
|
1801
|
-
|
|
1800
|
+
/**
|
|
1801
|
+
* Deploy plugin — ships the built `outDir` to Cloudflare Pages via the injectable
|
|
1802
|
+
* wrangler subprocess, with entropy-gated secret scrubbing of logged output.
|
|
1803
|
+
* Depends on site; emits `deploy:complete`.
|
|
1804
|
+
*
|
|
1805
|
+
* @example Configure the deploy target
|
|
1806
|
+
* ```ts
|
|
1807
|
+
* const app = createApp({
|
|
1808
|
+
* pluginConfigs: {
|
|
1809
|
+
* deploy: {
|
|
1810
|
+
* target: "cloudflare-pages",
|
|
1811
|
+
* outDir: "dist",
|
|
1812
|
+
* productionBranch: "main"
|
|
1813
|
+
* }
|
|
1814
|
+
* }
|
|
1815
|
+
* });
|
|
1816
|
+
* ```
|
|
1817
|
+
*/
|
|
1818
|
+
declare const deployPlugin: import("@moku-labs/core").PluginInstance<"deploy", Config, State, Api, {
|
|
1802
1819
|
"deploy:complete": {
|
|
1803
1820
|
url: string;
|
|
1804
1821
|
deploymentId: string;
|
|
@@ -1808,7 +1825,28 @@ declare const deployPlugin: _moku_labs_core0.PluginInstance<"deploy", Config, St
|
|
|
1808
1825
|
}> & Record<never, never>;
|
|
1809
1826
|
//#endregion
|
|
1810
1827
|
//#region src/plugins/build/index.d.ts
|
|
1811
|
-
|
|
1828
|
+
/**
|
|
1829
|
+
* Build plugin — the static-site-generation orchestrator. Renders every route to
|
|
1830
|
+
* `outDir`, and optionally emits feeds, a sitemap, optimized images, and OG
|
|
1831
|
+
* images. Depends on site, i18n, content, router, and head; emits `build:phase`.
|
|
1832
|
+
*
|
|
1833
|
+
* @example Configure the production build
|
|
1834
|
+
* ```ts
|
|
1835
|
+
* const app = createApp({
|
|
1836
|
+
* pluginConfigs: {
|
|
1837
|
+
* build: {
|
|
1838
|
+
* outDir: "dist",
|
|
1839
|
+
* minify: true,
|
|
1840
|
+
* feeds: true,
|
|
1841
|
+
* sitemap: true,
|
|
1842
|
+
* images: true,
|
|
1843
|
+
* ogImage: false // or an object to enable + configure OG-image generation
|
|
1844
|
+
* }
|
|
1845
|
+
* }
|
|
1846
|
+
* });
|
|
1847
|
+
* ```
|
|
1848
|
+
*/
|
|
1849
|
+
declare const buildPlugin: import("@moku-labs/core").PluginInstance<"build", Config$1, State$1, Api$1, {
|
|
1812
1850
|
"build:phase": {
|
|
1813
1851
|
phase: PhaseName;
|
|
1814
1852
|
status: "start" | "done";
|
|
@@ -1822,7 +1860,27 @@ declare const buildPlugin: _moku_labs_core0.PluginInstance<"build", Config$1, St
|
|
|
1822
1860
|
}> & Record<never, never>;
|
|
1823
1861
|
//#endregion
|
|
1824
1862
|
//#region src/plugins/content/index.d.ts
|
|
1825
|
-
|
|
1863
|
+
/**
|
|
1864
|
+
* Content plugin — Markdown pipeline: discovers files, parses frontmatter, renders
|
|
1865
|
+
* to sanitized HTML (rehype-sanitize unless `trustedContent`), and exposes a
|
|
1866
|
+
* locale-keyed Article model. Depends on i18n; emits `content:ready` and
|
|
1867
|
+
* `content:invalidated`.
|
|
1868
|
+
*
|
|
1869
|
+
* @example Point at a content directory and pick a Shiki theme
|
|
1870
|
+
* ```ts
|
|
1871
|
+
* const app = createApp({
|
|
1872
|
+
* pluginConfigs: {
|
|
1873
|
+
* content: {
|
|
1874
|
+
* contentDir: "./content",
|
|
1875
|
+
* shikiTheme: "github-dark",
|
|
1876
|
+
* defaultAuthor: "Ada Lovelace"
|
|
1877
|
+
* // trustedContent: true // ONLY for fully author-controlled Markdown — disables sanitize
|
|
1878
|
+
* }
|
|
1879
|
+
* }
|
|
1880
|
+
* });
|
|
1881
|
+
* ```
|
|
1882
|
+
*/
|
|
1883
|
+
declare const contentPlugin: import("@moku-labs/core").PluginInstance<"content", Config$3, State$3, Api$3, {
|
|
1826
1884
|
"content:ready": {
|
|
1827
1885
|
locales: readonly string[];
|
|
1828
1886
|
articleCount: number;
|
|
@@ -1911,7 +1969,26 @@ declare function feedLink(title: string, url: string, type?: string): HeadElemen
|
|
|
1911
1969
|
declare function buildArticleHead(articleMeta: ArticleMeta, canonicalUrl: string): HeadElement[];
|
|
1912
1970
|
//#endregion
|
|
1913
1971
|
//#region src/plugins/head/index.d.ts
|
|
1914
|
-
|
|
1972
|
+
/**
|
|
1973
|
+
* Head plugin — composes per-route `<head>` metadata (title template, Open Graph,
|
|
1974
|
+
* Twitter cards, canonical, hreflang). Use the re-exported SEO primitives
|
|
1975
|
+
* ({@link meta}, {@link og}, {@link twitter}, …) inside a route's `.head()`.
|
|
1976
|
+
* Depends on site, i18n, and router.
|
|
1977
|
+
*
|
|
1978
|
+
* @example Set global head defaults
|
|
1979
|
+
* ```ts
|
|
1980
|
+
* const app = createApp({
|
|
1981
|
+
* pluginConfigs: {
|
|
1982
|
+
* head: {
|
|
1983
|
+
* titleTemplate: "%s — My Blog",
|
|
1984
|
+
* twitterCard: "summary_large_image",
|
|
1985
|
+
* twitterHandle: "@moku_labs"
|
|
1986
|
+
* }
|
|
1987
|
+
* }
|
|
1988
|
+
* });
|
|
1989
|
+
* ```
|
|
1990
|
+
*/
|
|
1991
|
+
declare const headPlugin: import("@moku-labs/core").PluginInstance<"head", Config$2, State$2, Api$2, {}> & {
|
|
1915
1992
|
meta: typeof meta;
|
|
1916
1993
|
og: typeof og;
|
|
1917
1994
|
twitter: typeof twitter;
|
|
@@ -1923,7 +2000,26 @@ declare const headPlugin: _moku_labs_core0.PluginInstance<"head", Config$2, Stat
|
|
|
1923
2000
|
};
|
|
1924
2001
|
//#endregion
|
|
1925
2002
|
//#region src/plugins/i18n/index.d.ts
|
|
1926
|
-
|
|
2003
|
+
/**
|
|
2004
|
+
* Internationalization plugin — locale registry plus a flat translation helper
|
|
2005
|
+
* with default-locale fallback. Pure config-as-data (no state or events);
|
|
2006
|
+
* consumed read-only by content, router, head, and build.
|
|
2007
|
+
*
|
|
2008
|
+
* @example Register locales and translations
|
|
2009
|
+
* ```ts
|
|
2010
|
+
* const app = createApp({
|
|
2011
|
+
* pluginConfigs: {
|
|
2012
|
+
* i18n: {
|
|
2013
|
+
* locales: ["en", "uk"],
|
|
2014
|
+
* defaultLocale: "en",
|
|
2015
|
+
* localeNames: { en: "English", uk: "Українська" },
|
|
2016
|
+
* translations: { uk: { "nav.home": "Головна" } }
|
|
2017
|
+
* }
|
|
2018
|
+
* }
|
|
2019
|
+
* });
|
|
2020
|
+
* ```
|
|
2021
|
+
*/
|
|
2022
|
+
declare const i18nPlugin: import("@moku-labs/core").PluginInstance<"i18n", Config$5, Record<string, never>, Api$5, {}> & Record<never, never>;
|
|
1927
2023
|
//#endregion
|
|
1928
2024
|
//#region src/plugins/log/index.d.ts
|
|
1929
2025
|
/**
|
|
@@ -1933,7 +2029,7 @@ declare const i18nPlugin: _moku_labs_core0.PluginInstance<"i18n", Config$5, Reco
|
|
|
1933
2029
|
*
|
|
1934
2030
|
* @see README.md
|
|
1935
2031
|
*/
|
|
1936
|
-
declare const logPlugin:
|
|
2032
|
+
declare const logPlugin: import("@moku-labs/core").CorePluginInstance<"log", LogConfig, LogState, LogApi>;
|
|
1937
2033
|
//#endregion
|
|
1938
2034
|
//#region src/plugins/router/builders/route-builder.d.ts
|
|
1939
2035
|
/**
|
|
@@ -1968,16 +2064,75 @@ declare function route<P extends string>(pattern: P): RouteBuilder<RouteState<P>
|
|
|
1968
2064
|
declare function defineRoutes<T extends RouteMap>(routes: T): T;
|
|
1969
2065
|
//#endregion
|
|
1970
2066
|
//#region src/plugins/router/index.d.ts
|
|
1971
|
-
|
|
2067
|
+
/**
|
|
2068
|
+
* Router plugin — typed, named route definitions with locale-aware URL generation
|
|
2069
|
+
* and matching. Author routes with {@link route} + {@link defineRoutes}. Depends
|
|
2070
|
+
* on site (base URL) and i18n (locales).
|
|
2071
|
+
*
|
|
2072
|
+
* @example Define routes and choose a render mode
|
|
2073
|
+
* ```ts
|
|
2074
|
+
* const app = createApp({
|
|
2075
|
+
* pluginConfigs: {
|
|
2076
|
+
* router: {
|
|
2077
|
+
* routes: defineRoutes({
|
|
2078
|
+
* home: route("/"),
|
|
2079
|
+
* article: route("/blog/{slug}/")
|
|
2080
|
+
* }),
|
|
2081
|
+
* mode: "hybrid" // "ssg" | "spa" | "hybrid" (default)
|
|
2082
|
+
* }
|
|
2083
|
+
* }
|
|
2084
|
+
* });
|
|
2085
|
+
* ```
|
|
2086
|
+
*/
|
|
2087
|
+
declare const routerPlugin: import("@moku-labs/core").PluginInstance<"router", RouterConfig, RouterState, RouterApi, {}> & {
|
|
1972
2088
|
route: typeof route;
|
|
1973
2089
|
defineRoutes: typeof defineRoutes;
|
|
1974
2090
|
};
|
|
1975
2091
|
//#endregion
|
|
1976
2092
|
//#region src/plugins/site/index.d.ts
|
|
1977
|
-
|
|
2093
|
+
/**
|
|
2094
|
+
* Site plugin — holds global, frozen site metadata (name, url, author,
|
|
2095
|
+
* description) and builds canonical URLs. Consumed by router, head, and build.
|
|
2096
|
+
* `name` and `url` must be non-empty (validated at `onInit`).
|
|
2097
|
+
*
|
|
2098
|
+
* @example Set your site identity
|
|
2099
|
+
* ```ts
|
|
2100
|
+
* const app = createApp({
|
|
2101
|
+
* pluginConfigs: {
|
|
2102
|
+
* site: {
|
|
2103
|
+
* name: "My Blog",
|
|
2104
|
+
* url: "https://blog.dev",
|
|
2105
|
+
* author: "Ada Lovelace",
|
|
2106
|
+
* description: "Notes on computing"
|
|
2107
|
+
* }
|
|
2108
|
+
* }
|
|
2109
|
+
* });
|
|
2110
|
+
* ```
|
|
2111
|
+
*/
|
|
2112
|
+
declare const sitePlugin: import("@moku-labs/core").PluginInstance<"site", Config$6, Record<string, never>, Api$6, {}> & Record<never, never>;
|
|
1978
2113
|
//#endregion
|
|
1979
2114
|
//#region src/plugins/spa/index.d.ts
|
|
1980
|
-
|
|
2115
|
+
/**
|
|
2116
|
+
* SPA plugin — progressive client-side navigation layered over the static site:
|
|
2117
|
+
* swaps a page region on navigation, with an optional progress bar and View
|
|
2118
|
+
* Transitions. Register interactive islands with {@link createComponent}. Depends
|
|
2119
|
+
* on router and head; emits `spa:navigate`, `spa:navigated`, `spa:component-mount`,
|
|
2120
|
+
* and `spa:component-unmount`.
|
|
2121
|
+
*
|
|
2122
|
+
* @example Enable view transitions and a custom swap region
|
|
2123
|
+
* ```ts
|
|
2124
|
+
* const app = createApp({
|
|
2125
|
+
* pluginConfigs: {
|
|
2126
|
+
* spa: {
|
|
2127
|
+
* swapSelector: "main > section",
|
|
2128
|
+
* viewTransitions: true,
|
|
2129
|
+
* progressBar: true
|
|
2130
|
+
* }
|
|
2131
|
+
* }
|
|
2132
|
+
* });
|
|
2133
|
+
* ```
|
|
2134
|
+
*/
|
|
2135
|
+
declare const spaPlugin: import("@moku-labs/core").PluginInstance<"spa", SpaConfig, SpaState, SpaApi, {
|
|
1981
2136
|
"spa:navigate": {
|
|
1982
2137
|
from: string;
|
|
1983
2138
|
to: string;
|
|
@@ -1996,114 +2151,153 @@ declare const spaPlugin: _moku_labs_core0.PluginInstance<"spa", SpaConfig, SpaSt
|
|
|
1996
2151
|
}> & Record<never, never>;
|
|
1997
2152
|
//#endregion
|
|
1998
2153
|
//#region src/index.d.ts
|
|
1999
|
-
|
|
2000
|
-
|
|
2001
|
-
|
|
2002
|
-
|
|
2003
|
-
|
|
2004
|
-
|
|
2005
|
-
|
|
2006
|
-
|
|
2007
|
-
|
|
2008
|
-
|
|
2009
|
-
|
|
2010
|
-
|
|
2011
|
-
|
|
2012
|
-
|
|
2013
|
-
|
|
2014
|
-
|
|
2015
|
-
|
|
2016
|
-
|
|
2017
|
-
|
|
2018
|
-
|
|
2019
|
-
|
|
2020
|
-
|
|
2021
|
-
|
|
2022
|
-
|
|
2023
|
-
|
|
2024
|
-
|
|
2025
|
-
|
|
2026
|
-
|
|
2027
|
-
|
|
2028
|
-
|
|
2029
|
-
|
|
2030
|
-
|
|
2031
|
-
|
|
2032
|
-
|
|
2033
|
-
|
|
2034
|
-
|
|
2035
|
-
|
|
2036
|
-
|
|
2037
|
-
|
|
2038
|
-
|
|
2039
|
-
|
|
2040
|
-
|
|
2041
|
-
|
|
2042
|
-
|
|
2043
|
-
|
|
2044
|
-
|
|
2045
|
-
|
|
2046
|
-
|
|
2047
|
-
|
|
2048
|
-
|
|
2049
|
-
|
|
2050
|
-
|
|
2051
|
-
|
|
2052
|
-
|
|
2053
|
-
|
|
2054
|
-
|
|
2055
|
-
|
|
2056
|
-
|
|
2057
|
-
|
|
2058
|
-
|
|
2059
|
-
|
|
2060
|
-
|
|
2061
|
-
|
|
2062
|
-
|
|
2063
|
-
|
|
2064
|
-
}
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2068
|
-
|
|
2069
|
-
|
|
2070
|
-
|
|
2071
|
-
|
|
2072
|
-
|
|
2073
|
-
|
|
2074
|
-
|
|
2075
|
-
|
|
2076
|
-
|
|
2077
|
-
|
|
2078
|
-
|
|
2079
|
-
|
|
2080
|
-
|
|
2081
|
-
|
|
2082
|
-
|
|
2083
|
-
|
|
2084
|
-
|
|
2085
|
-
|
|
2086
|
-
|
|
2087
|
-
|
|
2088
|
-
|
|
2089
|
-
|
|
2090
|
-
|
|
2091
|
-
|
|
2092
|
-
|
|
2093
|
-
|
|
2094
|
-
|
|
2095
|
-
|
|
2096
|
-
|
|
2097
|
-
|
|
2098
|
-
|
|
2099
|
-
|
|
2100
|
-
|
|
2101
|
-
|
|
2102
|
-
|
|
2103
|
-
|
|
2104
|
-
|
|
2105
|
-
|
|
2106
|
-
|
|
2107
|
-
|
|
2154
|
+
/**
|
|
2155
|
+
* Create and initialize a `@moku-labs/web` application — the Layer-3 entry point.
|
|
2156
|
+
* Your overrides are merged over the framework defaults through the 4-level config
|
|
2157
|
+
* cascade, every plugin's lifecycle runs, and a fully-typed, frozen app is returned.
|
|
2158
|
+
*
|
|
2159
|
+
* @param options - Optional configuration:
|
|
2160
|
+
* - `pluginConfigs` — per-plugin overrides, keyed by plugin name
|
|
2161
|
+
* (`site`, `i18n`, `router`, `content`, `head`, `build`, `spa`, `deploy`, `env`).
|
|
2162
|
+
* - `config` — global framework config (e.g. `{ mode: "development" }`).
|
|
2163
|
+
* - `plugins` — extra consumer plugins, merged into the app and its return type.
|
|
2164
|
+
* - `onReady` / `onError` / `onStart` / `onStop` — lifecycle callbacks.
|
|
2165
|
+
* @returns The initialized app: `start()`, `stop()`, every plugin's API, and `log`.
|
|
2166
|
+
* @example
|
|
2167
|
+
* ```ts
|
|
2168
|
+
* const app = createApp({
|
|
2169
|
+
* pluginConfigs: {
|
|
2170
|
+
* site: { name: "My Blog", url: "https://blog.dev", author: "Ada", description: "Notes" },
|
|
2171
|
+
* router: { routes: defineRoutes({ home: route("/"), post: route("/blog/{slug}/") }) }
|
|
2172
|
+
* }
|
|
2173
|
+
* });
|
|
2174
|
+
* await app.start();
|
|
2175
|
+
* ```
|
|
2176
|
+
*/
|
|
2177
|
+
declare const createApp: <const ExtraPlugins extends readonly import("@moku-labs/core").AnyPluginInstance[] = readonly []>(options?: import("@moku-labs/core").CreateAppOptions<Config$7, Events, (import("@moku-labs/core").PluginInstance<"site", Config$6, Record<string, never>, Api$6, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"i18n", Config$5, Record<string, never>, Api$5, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"router", RouterConfig, RouterState, RouterApi, {}> & {
|
|
2178
|
+
route: typeof route;
|
|
2179
|
+
defineRoutes: typeof defineRoutes;
|
|
2180
|
+
}) | (import("@moku-labs/core").PluginInstance<"content", Config$3, State$3, Api$3, {
|
|
2181
|
+
"content:ready": {
|
|
2182
|
+
locales: readonly string[];
|
|
2183
|
+
articleCount: number;
|
|
2184
|
+
};
|
|
2185
|
+
"content:invalidated": {
|
|
2186
|
+
paths: readonly string[];
|
|
2187
|
+
};
|
|
2188
|
+
}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"head", Config$2, State$2, Api$2, {}> & {
|
|
2189
|
+
meta: typeof meta;
|
|
2190
|
+
og: typeof og;
|
|
2191
|
+
twitter: typeof twitter;
|
|
2192
|
+
jsonLd: typeof jsonLd;
|
|
2193
|
+
canonical: typeof canonical;
|
|
2194
|
+
hreflang: typeof hreflang;
|
|
2195
|
+
feedLink: typeof feedLink;
|
|
2196
|
+
buildArticleHead: typeof buildArticleHead;
|
|
2197
|
+
}) | (import("@moku-labs/core").PluginInstance<"build", Config$1, State$1, Api$1, {
|
|
2198
|
+
"build:phase": {
|
|
2199
|
+
phase: PhaseName;
|
|
2200
|
+
status: "start" | "done";
|
|
2201
|
+
durationMs?: number;
|
|
2202
|
+
};
|
|
2203
|
+
"build:complete": {
|
|
2204
|
+
outDir: string;
|
|
2205
|
+
pageCount: number;
|
|
2206
|
+
durationMs: number;
|
|
2207
|
+
};
|
|
2208
|
+
}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"spa", SpaConfig, SpaState, SpaApi, {
|
|
2209
|
+
"spa:navigate": {
|
|
2210
|
+
from: string;
|
|
2211
|
+
to: string;
|
|
2212
|
+
};
|
|
2213
|
+
"spa:navigated": {
|
|
2214
|
+
url: string;
|
|
2215
|
+
};
|
|
2216
|
+
"spa:component-mount": {
|
|
2217
|
+
name: string;
|
|
2218
|
+
el: Element;
|
|
2219
|
+
};
|
|
2220
|
+
"spa:component-unmount": {
|
|
2221
|
+
name: string;
|
|
2222
|
+
el: Element;
|
|
2223
|
+
};
|
|
2224
|
+
}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"deploy", Config, State, Api, {
|
|
2225
|
+
"deploy:complete": {
|
|
2226
|
+
url: string;
|
|
2227
|
+
deploymentId: string;
|
|
2228
|
+
branch: string;
|
|
2229
|
+
durationMs: number;
|
|
2230
|
+
};
|
|
2231
|
+
}> & 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$7, Events, (import("@moku-labs/core").PluginInstance<"site", Config$6, Record<string, never>, Api$6, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"i18n", Config$5, Record<string, never>, Api$5, {}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"router", RouterConfig, RouterState, RouterApi, {}> & {
|
|
2232
|
+
route: typeof route;
|
|
2233
|
+
defineRoutes: typeof defineRoutes;
|
|
2234
|
+
}) | (import("@moku-labs/core").PluginInstance<"content", Config$3, State$3, Api$3, {
|
|
2235
|
+
"content:ready": {
|
|
2236
|
+
locales: readonly string[];
|
|
2237
|
+
articleCount: number;
|
|
2238
|
+
};
|
|
2239
|
+
"content:invalidated": {
|
|
2240
|
+
paths: readonly string[];
|
|
2241
|
+
};
|
|
2242
|
+
}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"head", Config$2, State$2, Api$2, {}> & {
|
|
2243
|
+
meta: typeof meta;
|
|
2244
|
+
og: typeof og;
|
|
2245
|
+
twitter: typeof twitter;
|
|
2246
|
+
jsonLd: typeof jsonLd;
|
|
2247
|
+
canonical: typeof canonical;
|
|
2248
|
+
hreflang: typeof hreflang;
|
|
2249
|
+
feedLink: typeof feedLink;
|
|
2250
|
+
buildArticleHead: typeof buildArticleHead;
|
|
2251
|
+
}) | (import("@moku-labs/core").PluginInstance<"build", Config$1, State$1, Api$1, {
|
|
2252
|
+
"build:phase": {
|
|
2253
|
+
phase: PhaseName;
|
|
2254
|
+
status: "start" | "done";
|
|
2255
|
+
durationMs?: number;
|
|
2256
|
+
};
|
|
2257
|
+
"build:complete": {
|
|
2258
|
+
outDir: string;
|
|
2259
|
+
pageCount: number;
|
|
2260
|
+
durationMs: number;
|
|
2261
|
+
};
|
|
2262
|
+
}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"spa", SpaConfig, SpaState, SpaApi, {
|
|
2263
|
+
"spa:navigate": {
|
|
2264
|
+
from: string;
|
|
2265
|
+
to: string;
|
|
2266
|
+
};
|
|
2267
|
+
"spa:navigated": {
|
|
2268
|
+
url: string;
|
|
2269
|
+
};
|
|
2270
|
+
"spa:component-mount": {
|
|
2271
|
+
name: string;
|
|
2272
|
+
el: Element;
|
|
2273
|
+
};
|
|
2274
|
+
"spa:component-unmount": {
|
|
2275
|
+
name: string;
|
|
2276
|
+
el: Element;
|
|
2277
|
+
};
|
|
2278
|
+
}> & Record<never, never>) | (import("@moku-labs/core").PluginInstance<"deploy", Config, State, Api, {
|
|
2279
|
+
"deploy:complete": {
|
|
2280
|
+
url: string;
|
|
2281
|
+
deploymentId: string;
|
|
2282
|
+
branch: string;
|
|
2283
|
+
durationMs: number;
|
|
2284
|
+
};
|
|
2285
|
+
}> & 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>]>>;
|
|
2286
|
+
/**
|
|
2287
|
+
* Create a custom plugin bound to this framework's `Config`/`Events` and core
|
|
2288
|
+
* APIs. Plugin types are inferred from the spec object — never written explicitly.
|
|
2289
|
+
* Pass the result to {@link createApp} via `plugins`.
|
|
2290
|
+
*
|
|
2291
|
+
* @example
|
|
2292
|
+
* ```ts
|
|
2293
|
+
* const analytics = createPlugin("analytics", {
|
|
2294
|
+
* config: { writeKey: "" },
|
|
2295
|
+
* api: (ctx) => ({ track: (event: string) => ctx.log.info("analytics:track", { event }) })
|
|
2296
|
+
* });
|
|
2297
|
+
*
|
|
2298
|
+
* const app = createApp({ plugins: [analytics] });
|
|
2299
|
+
* ```
|
|
2300
|
+
*/
|
|
2301
|
+
declare const createPlugin: import("@moku-labs/core").BoundCreatePluginFunction<Config$7, Events, import("@moku-labs/core").CoreApisFromTuple<[import("@moku-labs/core").CorePluginInstance<"log", LogConfig, LogState, LogApi>, import("@moku-labs/core").CorePluginInstance<"env", EnvConfig, EnvState, EnvApi>]>>;
|
|
2108
2302
|
//#endregion
|
|
2109
2303
|
export { types_d_exports as Build, types_d_exports$1 as Content, types_d_exports$2 as Deploy, types_d_exports$3 as Env, types_d_exports$4 as Head, types_d_exports$5 as Log, types_d_exports$6 as Router, types_d_exports$7 as Spa, buildArticleHead, buildPlugin, canonical, contentPlugin, createApp, createPlugin, defineRoutes, deployPlugin, envPlugin, feedLink, headPlugin, hreflang, i18nPlugin, jsonLd, logPlugin, meta, og, route, routerPlugin, sitePlugin, spaPlugin, twitter };
|