@moku-labs/web 0.3.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/index.cjs +224 -2
- package/dist/index.d.cts +303 -108
- package/dist/index.d.mts +303 -108
- package/dist/index.mjs +224 -2
- package/package.json +1 -1
package/dist/index.d.cts
CHANGED
|
@@ -1797,6 +1797,24 @@ type Api = {
|
|
|
1797
1797
|
* Depends: site. Emits: deploy:complete.
|
|
1798
1798
|
* @see README.md
|
|
1799
1799
|
*/
|
|
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
|
+
*/
|
|
1800
1818
|
declare const deployPlugin: import("@moku-labs/core").PluginInstance<"deploy", Config, State, Api, {
|
|
1801
1819
|
"deploy:complete": {
|
|
1802
1820
|
url: string;
|
|
@@ -1807,6 +1825,27 @@ declare const deployPlugin: import("@moku-labs/core").PluginInstance<"deploy", C
|
|
|
1807
1825
|
}> & Record<never, never>;
|
|
1808
1826
|
//#endregion
|
|
1809
1827
|
//#region src/plugins/build/index.d.ts
|
|
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
|
+
*/
|
|
1810
1849
|
declare const buildPlugin: import("@moku-labs/core").PluginInstance<"build", Config$1, State$1, Api$1, {
|
|
1811
1850
|
"build:phase": {
|
|
1812
1851
|
phase: PhaseName;
|
|
@@ -1821,6 +1860,26 @@ declare const buildPlugin: import("@moku-labs/core").PluginInstance<"build", Con
|
|
|
1821
1860
|
}> & Record<never, never>;
|
|
1822
1861
|
//#endregion
|
|
1823
1862
|
//#region src/plugins/content/index.d.ts
|
|
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
|
+
*/
|
|
1824
1883
|
declare const contentPlugin: import("@moku-labs/core").PluginInstance<"content", Config$3, State$3, Api$3, {
|
|
1825
1884
|
"content:ready": {
|
|
1826
1885
|
locales: readonly string[];
|
|
@@ -1910,6 +1969,25 @@ declare function feedLink(title: string, url: string, type?: string): HeadElemen
|
|
|
1910
1969
|
declare function buildArticleHead(articleMeta: ArticleMeta, canonicalUrl: string): HeadElement[];
|
|
1911
1970
|
//#endregion
|
|
1912
1971
|
//#region src/plugins/head/index.d.ts
|
|
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
|
+
*/
|
|
1913
1991
|
declare const headPlugin: import("@moku-labs/core").PluginInstance<"head", Config$2, State$2, Api$2, {}> & {
|
|
1914
1992
|
meta: typeof meta;
|
|
1915
1993
|
og: typeof og;
|
|
@@ -1922,6 +2000,25 @@ declare const headPlugin: import("@moku-labs/core").PluginInstance<"head", Confi
|
|
|
1922
2000
|
};
|
|
1923
2001
|
//#endregion
|
|
1924
2002
|
//#region src/plugins/i18n/index.d.ts
|
|
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
|
+
*/
|
|
1925
2022
|
declare const i18nPlugin: import("@moku-labs/core").PluginInstance<"i18n", Config$5, Record<string, never>, Api$5, {}> & Record<never, never>;
|
|
1926
2023
|
//#endregion
|
|
1927
2024
|
//#region src/plugins/log/index.d.ts
|
|
@@ -1967,15 +2064,74 @@ declare function route<P extends string>(pattern: P): RouteBuilder<RouteState<P>
|
|
|
1967
2064
|
declare function defineRoutes<T extends RouteMap>(routes: T): T;
|
|
1968
2065
|
//#endregion
|
|
1969
2066
|
//#region src/plugins/router/index.d.ts
|
|
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
|
+
*/
|
|
1970
2087
|
declare const routerPlugin: import("@moku-labs/core").PluginInstance<"router", RouterConfig, RouterState, RouterApi, {}> & {
|
|
1971
2088
|
route: typeof route;
|
|
1972
2089
|
defineRoutes: typeof defineRoutes;
|
|
1973
2090
|
};
|
|
1974
2091
|
//#endregion
|
|
1975
2092
|
//#region src/plugins/site/index.d.ts
|
|
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
|
+
*/
|
|
1976
2112
|
declare const sitePlugin: import("@moku-labs/core").PluginInstance<"site", Config$6, Record<string, never>, Api$6, {}> & Record<never, never>;
|
|
1977
2113
|
//#endregion
|
|
1978
2114
|
//#region src/plugins/spa/index.d.ts
|
|
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
|
+
*/
|
|
1979
2135
|
declare const spaPlugin: import("@moku-labs/core").PluginInstance<"spa", SpaConfig, SpaState, SpaApi, {
|
|
1980
2136
|
"spa:navigate": {
|
|
1981
2137
|
from: string;
|
|
@@ -1995,114 +2151,153 @@ declare const spaPlugin: import("@moku-labs/core").PluginInstance<"spa", SpaConf
|
|
|
1995
2151
|
}> & Record<never, never>;
|
|
1996
2152
|
//#endregion
|
|
1997
2153
|
//#region src/index.d.ts
|
|
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
|
+
*/
|
|
1998
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, {}> & {
|
|
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
|
-
|
|
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>]>>;
|
|
2107
2302
|
//#endregion
|
|
2108
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 };
|