zudoku 0.0.0-z3809aef2 → 0.0.0-z7b86faab
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/config/loader.js +3 -1
- package/dist/config/loader.js.map +1 -1
- package/dist/config/validators/InputNavigationSchema.d.ts +75 -75
- package/dist/config/validators/validate.d.ts +6 -6
- package/dist/flat-config.d.ts +1 -1
- package/dist/lib/core/plugins.d.ts +11 -1
- package/dist/lib/core/plugins.js +1 -0
- package/dist/lib/core/plugins.js.map +1 -1
- package/dist/lib/core/transform-config.d.ts +2 -0
- package/dist/lib/core/transform-config.js +22 -0
- package/dist/lib/core/transform-config.js.map +1 -0
- package/dist/lib/ui/Command.d.ts +3 -3
- package/lib/{ClaudeLogo-DHxJUhN_.js → ClaudeLogo-DJ9bU-sO.js} +2 -2
- package/lib/{ClaudeLogo-DHxJUhN_.js.map → ClaudeLogo-DJ9bU-sO.js.map} +1 -1
- package/lib/{MdxPage-CD36PJ17.js → MdxPage-stpAoBtx.js} +5 -5
- package/lib/{MdxPage-CD36PJ17.js.map → MdxPage-stpAoBtx.js.map} +1 -1
- package/lib/{OAuthErrorPage-4mN5DA86.js → OAuthErrorPage-DJ811Bn_.js} +3 -3
- package/lib/{OAuthErrorPage-4mN5DA86.js.map → OAuthErrorPage-DJ811Bn_.js.map} +1 -1
- package/lib/{OasProvider-D-4BX8P3.js → OasProvider-CS_ASmBB.js} +2 -2
- package/lib/{OasProvider-D-4BX8P3.js.map → OasProvider-CS_ASmBB.js.map} +1 -1
- package/lib/{OperationList-BOu9Qd_k.js → OperationList-Dq_AB4W9.js} +6 -6
- package/lib/{OperationList-BOu9Qd_k.js.map → OperationList-Dq_AB4W9.js.map} +1 -1
- package/lib/{SchemaList-B167Xmbd.js → SchemaList-BJZJv1gD.js} +6 -6
- package/lib/{SchemaList-B167Xmbd.js.map → SchemaList-BJZJv1gD.js.map} +1 -1
- package/lib/{SchemaView-Dx9gtne2.js → SchemaView-U4JMYB3N.js} +3 -3
- package/lib/{SchemaView-Dx9gtne2.js.map → SchemaView-U4JMYB3N.js.map} +1 -1
- package/lib/{SignUp-DRvN-8cq.js → SignUp-DCBViNUi.js} +2 -2
- package/lib/{SignUp-DRvN-8cq.js.map → SignUp-DCBViNUi.js.map} +1 -1
- package/lib/{SyntaxHighlight-klTH8c6-.js → SyntaxHighlight-Dshjn3Zf.js} +4 -3
- package/lib/SyntaxHighlight-Dshjn3Zf.js.map +1 -0
- package/lib/{Toc-PbuF-u9x.js → Toc-Cgz6CPiE.js} +2 -2
- package/lib/{Toc-PbuF-u9x.js.map → Toc-Cgz6CPiE.js.map} +1 -1
- package/lib/{circular-B5aq06Lb.js → circular-BmMJjG1v.js} +2 -2
- package/lib/{circular-B5aq06Lb.js.map → circular-BmMJjG1v.js.map} +1 -1
- package/lib/{createServer-CasZ-UG7.js → createServer-CLSZ7hWJ.js} +4 -4
- package/lib/{createServer-CasZ-UG7.js.map → createServer-CLSZ7hWJ.js.map} +1 -1
- package/lib/{errors-rWHkzVTd.js → errors-b9I-fAOY.js} +2 -2
- package/lib/{errors-rWHkzVTd.js.map → errors-b9I-fAOY.js.map} +1 -1
- package/lib/{firebase-BmGU1FuD.js → firebase-BCXX7Qv5.js} +10 -10
- package/lib/firebase-BCXX7Qv5.js.map +1 -0
- package/lib/{index-BDsEwofZ.js → index-CL8eDnQW.js} +2 -2
- package/lib/{index-BDsEwofZ.js.map → index-CL8eDnQW.js.map} +1 -1
- package/lib/{index-BcAudYNw.js → index-O9RHI87z.js} +7 -7
- package/lib/{index-BcAudYNw.js.map → index-O9RHI87z.js.map} +1 -1
- package/lib/{index-DRBOFufT.js → index-UOLtazB8.js} +2 -2
- package/lib/{index-DRBOFufT.js.map → index-UOLtazB8.js.map} +1 -1
- package/lib/{index.esm-Cx8B1YJQ.js → index.esm-C5CBsVzN.js} +2 -2
- package/lib/index.esm-C5CBsVzN.js.map +1 -0
- package/lib/ui/SyntaxHighlight.js +1 -1
- package/lib/zudoku.__internal.js +1 -1
- package/lib/zudoku.auth-azureb2c.js +3 -3
- package/lib/zudoku.auth-clerk.js +1 -1
- package/lib/zudoku.auth-firebase.js +3 -3
- package/lib/zudoku.auth-openid.js +3 -3
- package/lib/zudoku.auth-supabase.js +3 -3
- package/lib/zudoku.components.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +2 -2
- package/lib/zudoku.plugin-api-keys.js +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +1 -1
- package/lib/zudoku.plugins.js +9 -8
- package/lib/zudoku.plugins.js.map +1 -1
- package/package.json +8 -7
- package/src/lib/core/plugins.ts +21 -1
- package/src/lib/core/transform-config.ts +29 -0
- package/src/shiki/langs/c3.js +1 -0
- package/src/shiki/langs/gn.js +1 -0
- package/src/shiki/langs/moonbit.js +1 -0
- package/lib/SyntaxHighlight-klTH8c6-.js.map +0 -1
- package/lib/firebase-BmGU1FuD.js.map +0 -1
- package/lib/index.esm-Cx8B1YJQ.js.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { A as a, a as r, E as t, b as i, F as o, G as n, c as d, O as h, d as u, T as l, e as A, f as P, g as c, h as g, i as m, j as E, k as p, l as v, m as w, n as b, o as C, p as I, q as R, r as f, s as k, t as O, u as T, v as W, w as x, x as G } from "./firebase-
|
|
1
|
+
import { A as a, a as r, E as t, b as i, F as o, G as n, c as d, O as h, d as u, T as l, e as A, f as P, g as c, h as g, i as m, j as E, k as p, l as v, m as w, n as b, o as C, p as I, q as R, r as f, s as k, t as O, u as T, v as W, w as x, x as G } from "./firebase-BCXX7Qv5.js";
|
|
2
2
|
export {
|
|
3
3
|
a as ActionCodeURL,
|
|
4
4
|
r as AuthCredential,
|
|
@@ -31,4 +31,4 @@ export {
|
|
|
31
31
|
x as signInWithPopup,
|
|
32
32
|
G as signOut
|
|
33
33
|
};
|
|
34
|
-
//# sourceMappingURL=index.esm-
|
|
34
|
+
//# sourceMappingURL=index.esm-C5CBsVzN.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.esm-C5CBsVzN.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "../jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import "react";
|
|
3
3
|
import "../ZudokuContext-BZB1TWdT.js";
|
|
4
|
-
import { S as h } from "../SyntaxHighlight-
|
|
4
|
+
import { S as h } from "../SyntaxHighlight-Dshjn3Zf.js";
|
|
5
5
|
import "../invariant-BJAl77rw.js";
|
|
6
6
|
import "./CodeBlock.js";
|
|
7
7
|
import "./EmbeddedCodeBlock.js";
|
package/lib/zudoku.__internal.js
CHANGED
|
@@ -6,7 +6,7 @@ import * as F from "react";
|
|
|
6
6
|
import { StrictMode as Ne, useEffect as K, useRef as De, useState as vt, Suspense as wt } from "react";
|
|
7
7
|
import { n as zt, S as bt, a as Re, b3 as yt, O as kt, d as xt, L as Zt, h as $t, w as jt } from "./chunk-EPOLDU6W-C6C8jAwd.js";
|
|
8
8
|
import * as Et from "react-dom";
|
|
9
|
-
import { f as Pt, a as Tt, d as P, A as It, s as At, P as Ot, N as pe, g as St, h as Nt, i as Dt, T as Ce, H as Ue, D as Rt, j as Fe } from "./index-
|
|
9
|
+
import { f as Pt, a as Tt, d as P, A as It, s as At, P as Ot, N as pe, g as St, h as Nt, i as Dt, T as Ce, H as Ue, D as Rt, j as Fe } from "./index-CL8eDnQW.js";
|
|
10
10
|
import { B as Le, R as Ct } from "./RouteGuard--A04ESy8.js";
|
|
11
11
|
import { CircleFadingArrowUpIcon as Ut, LoaderCircleIcon as Ft, ExternalLink as Lt, PanelLeftIcon as Bt, UnlinkIcon as Mt } from "lucide-react";
|
|
12
12
|
import { Button as Wt } from "./ui/Button.js";
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as n } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import { PublicClientApplication as A, EventType as f } from "@azure/msal-browser";
|
|
3
|
-
import { E as I } from "./index-
|
|
3
|
+
import { E as I } from "./index-CL8eDnQW.js";
|
|
4
4
|
import { C as T } from "./ClientOnly-E7hGysn1.js";
|
|
5
5
|
import { j as S, u as h } from "./ZudokuContext-BZB1TWdT.js";
|
|
6
|
-
import { C, A as c } from "./errors-
|
|
7
|
-
import { C as k, O as w } from "./OAuthErrorPage-
|
|
6
|
+
import { C, A as c } from "./errors-b9I-fAOY.js";
|
|
7
|
+
import { C as k, O as w } from "./OAuthErrorPage-DJ811Bn_.js";
|
|
8
8
|
const u = "/oauth/callback";
|
|
9
9
|
class y extends C {
|
|
10
10
|
msalInstance;
|
package/lib/zudoku.auth-clerk.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as a } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import { LogOutIcon as m } from "lucide-react";
|
|
3
|
-
import { S as p, a as f, b as h } from "./SignUp-
|
|
3
|
+
import { S as p, a as f, b as h } from "./SignUp-DCBViNUi.js";
|
|
4
4
|
import { u as r } from "./ZudokuContext-BZB1TWdT.js";
|
|
5
5
|
const R = ({
|
|
6
6
|
clerkPubKey: u,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import "./jsx-runtime-BzflLqGi.js";
|
|
2
|
-
import { y as e } from "./firebase-
|
|
2
|
+
import { y as e } from "./firebase-BCXX7Qv5.js";
|
|
3
3
|
import "./invariant-BJAl77rw.js";
|
|
4
|
-
import "./errors-
|
|
5
|
-
import "./SignUp-
|
|
4
|
+
import "./errors-b9I-fAOY.js";
|
|
5
|
+
import "./SignUp-DCBViNUi.js";
|
|
6
6
|
import "./ZudokuContext-BZB1TWdT.js";
|
|
7
7
|
export {
|
|
8
8
|
e as default
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as D } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import { a as Le } from "./invariant-BJAl77rw.js";
|
|
3
|
-
import { E as Ue } from "./index-
|
|
3
|
+
import { E as Ue } from "./index-CL8eDnQW.js";
|
|
4
4
|
import { C as xe } from "./ClientOnly-E7hGysn1.js";
|
|
5
5
|
import { j as Ce, u as S } from "./ZudokuContext-BZB1TWdT.js";
|
|
6
|
-
import { C as Ie, O as re, A as R } from "./errors-
|
|
7
|
-
import { C as je, O as Oe } from "./OAuthErrorPage-
|
|
6
|
+
import { C as Ie, O as re, A as R } from "./errors-b9I-fAOY.js";
|
|
7
|
+
import { C as je, O as Oe } from "./OAuthErrorPage-DJ811Bn_.js";
|
|
8
8
|
var J = { exports: {} }, De = J.exports, oe;
|
|
9
9
|
function Je() {
|
|
10
10
|
return oe || (oe = 1, (function(t) {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { j as a } from "./jsx-runtime-BzflLqGi.js";
|
|
2
2
|
import { createClient as g } from "@supabase/supabase-js";
|
|
3
|
-
import { C as m, A as h } from "./errors-
|
|
4
|
-
import { S as f } from "./SignUp-
|
|
3
|
+
import { C as m, A as h } from "./errors-b9I-fAOY.js";
|
|
4
|
+
import { S as f } from "./SignUp-DCBViNUi.js";
|
|
5
5
|
import { u } from "./ZudokuContext-BZB1TWdT.js";
|
|
6
6
|
import { Auth as v } from "@supabase/auth-ui-react";
|
|
7
7
|
import { ThemeSupa as S } from "@supabase/auth-ui-shared";
|
|
8
8
|
import { b as T } from "./chunk-EPOLDU6W-C6C8jAwd.js";
|
|
9
|
-
import { H as A } from "./index-
|
|
9
|
+
import { H as A } from "./index-CL8eDnQW.js";
|
|
10
10
|
const c = ({
|
|
11
11
|
client: i,
|
|
12
12
|
config: e,
|
package/lib/zudoku.components.js
CHANGED
|
@@ -7,7 +7,7 @@ import "./ui/Callout.js";
|
|
|
7
7
|
import "./invariant-BJAl77rw.js";
|
|
8
8
|
import "./ClientOnly-E7hGysn1.js";
|
|
9
9
|
import "./ZudokuContext-BZB1TWdT.js";
|
|
10
|
-
import { B as d, F as k, C as l, r as h, p as y, q as S, L as Z, o as E, v as H, S as g, t as w, Z as x, w as A, y as B, z as L, x as M, G as T, a as c } from "./index-
|
|
10
|
+
import { B as d, F as k, C as l, r as h, p as y, q as S, L as Z, o as E, v as H, S as g, t as w, Z as x, w as A, y as B, z as L, x as M, G as T, a as c } from "./index-CL8eDnQW.js";
|
|
11
11
|
import "./Spinner-CI6bRyZw.js";
|
|
12
12
|
export {
|
|
13
13
|
d as Button,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { j as t } from "./jsx-runtime-BzflLqGi.js";
|
|
2
|
-
import { s as f } from "./index-
|
|
2
|
+
import { s as f } from "./index-UOLtazB8.js";
|
|
3
3
|
import { c as b, m as j } from "./chunk-EPOLDU6W-C6C8jAwd.js";
|
|
4
4
|
import { u as x, j as d } from "./ZudokuContext-BZB1TWdT.js";
|
|
5
5
|
import { u as v } from "./useSuspenseQuery-CSB_rVek.js";
|
|
6
6
|
import { H as y } from "./index.esm-B_0dvNjB.js";
|
|
7
|
-
import { H as N, L as k, M as S } from "./index-
|
|
7
|
+
import { H as N, L as k, M as S } from "./index-CL8eDnQW.js";
|
|
8
8
|
const w = ({
|
|
9
9
|
items: o,
|
|
10
10
|
filterCatalogItems: r = (i) => i,
|
|
@@ -3,7 +3,7 @@ import { TrashIcon as me, CircleSlashIcon as z, CheckIcon as xe, XIcon as ye, Pe
|
|
|
3
3
|
import { Z as M, i as E } from "./invariant-BJAl77rw.js";
|
|
4
4
|
import * as F from "react";
|
|
5
5
|
import { createContext as Q, useRef as A, useLayoutEffect as Ce, useEffect as ie, useId as H, useContext as V, useInsertionEffect as we, useMemo as L, useCallback as ke, Children as Ee, isValidElement as Ie, useState as I } from "react";
|
|
6
|
-
import { D as be, c as Ke, d as ee, B as De, E as Pe } from "./index-
|
|
6
|
+
import { D as be, c as Ke, d as ee, B as De, E as Pe } from "./index-CL8eDnQW.js";
|
|
7
7
|
import { b as re } from "./index-DBjOT2H1.js";
|
|
8
8
|
import { F as Ae, g as Se, j as Re, h as Ne, d as Oe, I as Te, a as qe, b as Me, k as Fe, c as $e } from "./Frame-DKlOmSkU.js";
|
|
9
9
|
import { A as D, a as P, b as ae } from "./Mermaid-Koc3z8mU.js";
|
|
@@ -4,7 +4,7 @@ const p = (t) => ({
|
|
|
4
4
|
([e, a]) => ({
|
|
5
5
|
path: e,
|
|
6
6
|
lazy: async () => {
|
|
7
|
-
const { MdxPage: n } = await import("./MdxPage-
|
|
7
|
+
const { MdxPage: n } = await import("./MdxPage-stpAoBtx.js"), { default: o, ...s } = await a();
|
|
8
8
|
return {
|
|
9
9
|
element: /* @__PURE__ */ r.jsx(
|
|
10
10
|
n,
|
|
@@ -3,7 +3,7 @@ import "lucide-react";
|
|
|
3
3
|
import "./chunk-EPOLDU6W-C6C8jAwd.js";
|
|
4
4
|
import "./ui/Button.js";
|
|
5
5
|
import "./ZudokuContext-BZB1TWdT.js";
|
|
6
|
-
import { y as e, U as n, z as s } from "./index-
|
|
6
|
+
import { y as e, U as n, z as s } from "./index-O9RHI87z.js";
|
|
7
7
|
export {
|
|
8
8
|
e as GetNavigationOperationsQuery,
|
|
9
9
|
n as UNTAGGED_PATH,
|
package/lib/zudoku.plugins.js
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
const
|
|
1
|
+
const t = (n) => n, i = (n) => n, e = (n) => "events" in n && typeof n.events == "object", o = (n) => "getProfileMenuItems" in n && typeof n.getProfileMenuItems == "function", s = (n) => "getRoutes" in n && typeof n.getRoutes == "function", f = (n) => "signUp" in n && typeof n.signUp == "function", c = (n) => "renderSearch" in n && typeof n.renderSearch == "function", u = (n) => "initialize" in n && typeof n.initialize == "function", g = (n) => "getHead" in n && typeof n.getHead == "function", r = (n) => "getMdxComponents" in n && typeof n.getMdxComponents == "function", a = (n) => "getIdentities" in n && typeof n.getIdentities == "function", l = (n) => "transformConfig" in n && typeof n.transformConfig == "function";
|
|
2
2
|
export {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
t as createApiIdentityPlugin,
|
|
4
|
+
i as createProfileMenuPlugin,
|
|
5
|
+
g as hasHead,
|
|
6
6
|
a as isApiIdentityPlugin,
|
|
7
|
-
|
|
8
|
-
|
|
7
|
+
f as isAuthenticationPlugin,
|
|
8
|
+
e as isEventConsumerPlugin,
|
|
9
9
|
r as isMdxProviderPlugin,
|
|
10
10
|
s as isNavigationPlugin,
|
|
11
11
|
o as isProfileMenuPlugin,
|
|
12
|
-
|
|
13
|
-
|
|
12
|
+
c as isSearchPlugin,
|
|
13
|
+
l as isTransformConfigPlugin,
|
|
14
|
+
u as needsInitialization
|
|
14
15
|
};
|
|
15
16
|
//# sourceMappingURL=zudoku.plugins.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.plugins.js","sources":["../src/lib/core/plugins.ts"],"sourcesContent":["import type { LucideIcon } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport type { Location, RouteObject } from \"react-router\";\nimport type { Navigation } from \"../../config/validators/NavigationSchema.js\";\nimport type { ProtectedRoutesInput } from \"../../config/validators/ProtectedRoutesSchema.js\";\nimport type { AuthenticationPlugin } from \"../authentication/authentication.js\";\nimport type { MdxComponentsType } from \"../util/MdxComponents.js\";\nimport type {\n ApiIdentity,\n ZudokuContext,\n ZudokuEvents,\n} from \"./ZudokuContext.js\";\n\nexport type ZudokuPlugin =\n | CommonPlugin\n | ProfileMenuPlugin\n | NavigationPlugin\n | ApiIdentityPlugin\n | SearchProviderPlugin\n | EventConsumerPlugin\n | AuthenticationPlugin;\n\nexport type { AuthenticationPlugin, RouteObject };\n\nexport interface NavigationPlugin {\n getRoutes: () => RouteObject[];\n getNavigation?: (path: string, context: ZudokuContext) => Promise<Navigation>;\n getProtectedRoutes?: () => ProtectedRoutesInput;\n}\n\nexport const createApiIdentityPlugin = (\n plugin: ApiIdentityPlugin,\n): ApiIdentityPlugin => plugin;\n\nexport const createProfileMenuPlugin = (\n plugin: ProfileMenuPlugin,\n): ProfileMenuPlugin => plugin;\n\nexport interface ApiIdentityPlugin {\n getIdentities: (context: ZudokuContext) => Promise<ApiIdentity[]>;\n}\n\nexport interface SearchProviderPlugin {\n renderSearch: (o: {\n isOpen: boolean;\n onClose: () => void;\n }) => React.JSX.Element | null;\n}\n\nexport interface ProfileMenuPlugin {\n getProfileMenuItems: (context: ZudokuContext) => ProfileNavigationItem[];\n}\n\nexport type ProfileNavigationItem = {\n label: string;\n path?: string;\n weight?: number;\n category?: \"top\" | \"middle\" | \"bottom\";\n children?: ProfileNavigationItem[];\n icon?: LucideIcon;\n};\n\nexport interface CommonPlugin {\n initialize?: (\n context: ZudokuContext,\n ) => Promise<void | boolean> | void | boolean;\n getHead?: (args: { location: Location }) => ReactNode | undefined;\n getMdxComponents?: () => MdxComponentsType;\n}\n\nexport type EventConsumerPlugin<Event extends ZudokuEvents = ZudokuEvents> = {\n events: { [K in keyof Event]?: Event[K] };\n};\n\nexport const isEventConsumerPlugin = (\n obj: ZudokuPlugin,\n): obj is EventConsumerPlugin =>\n \"events\" in obj && typeof obj.events === \"object\";\n\nexport const isProfileMenuPlugin = (\n obj: ZudokuPlugin,\n): obj is ProfileMenuPlugin =>\n \"getProfileMenuItems\" in obj && typeof obj.getProfileMenuItems === \"function\";\n\nexport const isNavigationPlugin = (\n obj: ZudokuPlugin,\n): obj is NavigationPlugin =>\n \"getRoutes\" in obj && typeof obj.getRoutes === \"function\";\n\nexport const isAuthenticationPlugin = (\n obj: ZudokuPlugin,\n): obj is AuthenticationPlugin =>\n \"signUp\" in obj && typeof obj.signUp === \"function\";\n\nexport const isSearchPlugin = (\n obj: ZudokuPlugin,\n): obj is SearchProviderPlugin =>\n \"renderSearch\" in obj && typeof obj.renderSearch === \"function\";\n\nexport const needsInitialization = (obj: ZudokuPlugin): obj is CommonPlugin =>\n \"initialize\" in obj && typeof obj.initialize === \"function\";\n\nexport const hasHead = (obj: ZudokuPlugin): obj is CommonPlugin =>\n \"getHead\" in obj && typeof obj.getHead === \"function\";\n\nexport const isMdxProviderPlugin = (obj: ZudokuPlugin): obj is CommonPlugin =>\n \"getMdxComponents\" in obj && typeof obj.getMdxComponents === \"function\";\n\nexport const isApiIdentityPlugin = (\n obj: ZudokuPlugin,\n): obj is ApiIdentityPlugin =>\n \"getIdentities\" in obj && typeof obj.getIdentities === \"function\";\n"],"names":["createApiIdentityPlugin","plugin","createProfileMenuPlugin","isEventConsumerPlugin","obj","isProfileMenuPlugin","isNavigationPlugin","isAuthenticationPlugin","isSearchPlugin","needsInitialization","hasHead","isMdxProviderPlugin","isApiIdentityPlugin"],"mappings":"
|
|
1
|
+
{"version":3,"file":"zudoku.plugins.js","sources":["../src/lib/core/plugins.ts"],"sourcesContent":["import type { LucideIcon } from \"lucide-react\";\nimport type { ReactNode } from \"react\";\nimport type { Location, RouteObject } from \"react-router\";\nimport type { Navigation } from \"../../config/validators/NavigationSchema.js\";\nimport type { ProtectedRoutesInput } from \"../../config/validators/ProtectedRoutesSchema.js\";\nimport type { ZudokuConfig } from \"../../config/validators/validate.js\";\nimport type { AuthenticationPlugin } from \"../authentication/authentication.js\";\nimport type { MdxComponentsType } from \"../util/MdxComponents.js\";\nimport type {\n ApiIdentity,\n ZudokuContext,\n ZudokuEvents,\n} from \"./ZudokuContext.js\";\n\nexport type ZudokuPlugin =\n | CommonPlugin\n | ProfileMenuPlugin\n | NavigationPlugin\n | ApiIdentityPlugin\n | SearchProviderPlugin\n | EventConsumerPlugin\n | AuthenticationPlugin\n | TransformConfigPlugin;\n\nexport type { AuthenticationPlugin, RouteObject };\n\nexport interface NavigationPlugin {\n getRoutes: () => RouteObject[];\n getNavigation?: (path: string, context: ZudokuContext) => Promise<Navigation>;\n getProtectedRoutes?: () => ProtectedRoutesInput;\n}\n\nexport const createApiIdentityPlugin = (\n plugin: ApiIdentityPlugin,\n): ApiIdentityPlugin => plugin;\n\nexport const createProfileMenuPlugin = (\n plugin: ProfileMenuPlugin,\n): ProfileMenuPlugin => plugin;\n\nexport interface ApiIdentityPlugin {\n getIdentities: (context: ZudokuContext) => Promise<ApiIdentity[]>;\n}\n\nexport interface SearchProviderPlugin {\n renderSearch: (o: {\n isOpen: boolean;\n onClose: () => void;\n }) => React.JSX.Element | null;\n}\n\nexport interface ProfileMenuPlugin {\n getProfileMenuItems: (context: ZudokuContext) => ProfileNavigationItem[];\n}\n\nexport type ProfileNavigationItem = {\n label: string;\n path?: string;\n weight?: number;\n category?: \"top\" | \"middle\" | \"bottom\";\n children?: ProfileNavigationItem[];\n icon?: LucideIcon;\n};\n\nexport interface ConfigHookContext {\n mode: typeof process.env.ZUDOKU_ENV;\n rootDir: string;\n configPath: string;\n}\n\nexport interface TransformConfigPlugin {\n transformConfig?: (\n config: ZudokuConfig,\n ctx: ConfigHookContext,\n ) => Partial<ZudokuConfig> | void | Promise<Partial<ZudokuConfig> | void>;\n}\n\nexport interface CommonPlugin {\n initialize?: (\n context: ZudokuContext,\n ) => Promise<void | boolean> | void | boolean;\n getHead?: (args: { location: Location }) => ReactNode | undefined;\n getMdxComponents?: () => MdxComponentsType;\n}\n\nexport type EventConsumerPlugin<Event extends ZudokuEvents = ZudokuEvents> = {\n events: { [K in keyof Event]?: Event[K] };\n};\n\nexport const isEventConsumerPlugin = (\n obj: ZudokuPlugin,\n): obj is EventConsumerPlugin =>\n \"events\" in obj && typeof obj.events === \"object\";\n\nexport const isProfileMenuPlugin = (\n obj: ZudokuPlugin,\n): obj is ProfileMenuPlugin =>\n \"getProfileMenuItems\" in obj && typeof obj.getProfileMenuItems === \"function\";\n\nexport const isNavigationPlugin = (\n obj: ZudokuPlugin,\n): obj is NavigationPlugin =>\n \"getRoutes\" in obj && typeof obj.getRoutes === \"function\";\n\nexport const isAuthenticationPlugin = (\n obj: ZudokuPlugin,\n): obj is AuthenticationPlugin =>\n \"signUp\" in obj && typeof obj.signUp === \"function\";\n\nexport const isSearchPlugin = (\n obj: ZudokuPlugin,\n): obj is SearchProviderPlugin =>\n \"renderSearch\" in obj && typeof obj.renderSearch === \"function\";\n\nexport const needsInitialization = (obj: ZudokuPlugin): obj is CommonPlugin =>\n \"initialize\" in obj && typeof obj.initialize === \"function\";\n\nexport const hasHead = (obj: ZudokuPlugin): obj is CommonPlugin =>\n \"getHead\" in obj && typeof obj.getHead === \"function\";\n\nexport const isMdxProviderPlugin = (obj: ZudokuPlugin): obj is CommonPlugin =>\n \"getMdxComponents\" in obj && typeof obj.getMdxComponents === \"function\";\n\nexport const isApiIdentityPlugin = (\n obj: ZudokuPlugin,\n): obj is ApiIdentityPlugin =>\n \"getIdentities\" in obj && typeof obj.getIdentities === \"function\";\n\nexport const isTransformConfigPlugin = (\n obj: ZudokuPlugin,\n): obj is TransformConfigPlugin =>\n \"transformConfig\" in obj && typeof obj.transformConfig === \"function\";\n"],"names":["createApiIdentityPlugin","plugin","createProfileMenuPlugin","isEventConsumerPlugin","obj","isProfileMenuPlugin","isNavigationPlugin","isAuthenticationPlugin","isSearchPlugin","needsInitialization","hasHead","isMdxProviderPlugin","isApiIdentityPlugin","isTransformConfigPlugin"],"mappings":"AAgCO,MAAMA,IAA0B,CACrCC,MACsBA,GAEXC,IAA0B,CACrCD,MACsBA,GAmDXE,IAAwB,CACnCC,MAEA,YAAYA,KAAO,OAAOA,EAAI,UAAW,UAE9BC,IAAsB,CACjCD,MAEA,yBAAyBA,KAAO,OAAOA,EAAI,uBAAwB,YAExDE,IAAqB,CAChCF,MAEA,eAAeA,KAAO,OAAOA,EAAI,aAAc,YAEpCG,IAAyB,CACpCH,MAEA,YAAYA,KAAO,OAAOA,EAAI,UAAW,YAE9BI,IAAiB,CAC5BJ,MAEA,kBAAkBA,KAAO,OAAOA,EAAI,gBAAiB,YAE1CK,IAAsB,CAACL,MAClC,gBAAgBA,KAAO,OAAOA,EAAI,cAAe,YAEtCM,IAAU,CAACN,MACtB,aAAaA,KAAO,OAAOA,EAAI,WAAY,YAEhCO,IAAsB,CAACP,MAClC,sBAAsBA,KAAO,OAAOA,EAAI,oBAAqB,YAElDQ,IAAsB,CACjCR,MAEA,mBAAmBA,KAAO,OAAOA,EAAI,iBAAkB,YAE5CS,IAA0B,CACrCT,MAEA,qBAAqBA,KAAO,OAAOA,EAAI,mBAAoB;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zudoku",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-z7b86faab",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://zudoku.dev",
|
|
6
6
|
"repository": {
|
|
@@ -154,6 +154,7 @@
|
|
|
154
154
|
"dependencies": {
|
|
155
155
|
"@apidevtools/json-schema-ref-parser": "14.1.1",
|
|
156
156
|
"@envelop/core": "5.3.2",
|
|
157
|
+
"@fastify/deepmerge": "3.1.0",
|
|
157
158
|
"@graphql-typed-document-node/core": "3.2.0",
|
|
158
159
|
"@lekoarts/rehype-meta-as-attributes": "3.0.3",
|
|
159
160
|
"@mdx-js/react": "3.1.1",
|
|
@@ -184,11 +185,11 @@
|
|
|
184
185
|
"@radix-ui/react-visually-hidden": "1.2.4",
|
|
185
186
|
"@scalar/openapi-parser": "0.23.2",
|
|
186
187
|
"@sentry/node": "10.27.0",
|
|
187
|
-
"@shikijs/engine-javascript": "3.
|
|
188
|
-
"@shikijs/langs": "3.
|
|
189
|
-
"@shikijs/rehype": "3.
|
|
190
|
-
"@shikijs/themes": "3.
|
|
191
|
-
"@shikijs/transformers": "3.
|
|
188
|
+
"@shikijs/engine-javascript": "3.21.0",
|
|
189
|
+
"@shikijs/langs": "3.21.0",
|
|
190
|
+
"@shikijs/rehype": "3.21.0",
|
|
191
|
+
"@shikijs/themes": "3.21.0",
|
|
192
|
+
"@shikijs/transformers": "3.21.0",
|
|
192
193
|
"@sindresorhus/slugify": "3.0.0",
|
|
193
194
|
"@stefanprobst/rehype-extract-toc": "3.0.0",
|
|
194
195
|
"@tailwindcss/typography": "0.5.19",
|
|
@@ -249,7 +250,7 @@
|
|
|
249
250
|
"remark-mdx-frontmatter": "5.2.0",
|
|
250
251
|
"rollup": "4.52.5",
|
|
251
252
|
"semver": "7.7.2",
|
|
252
|
-
"shiki": "3.
|
|
253
|
+
"shiki": "3.21.0",
|
|
253
254
|
"sitemap": "9.0.0",
|
|
254
255
|
"strip-ansi": "7.1.2",
|
|
255
256
|
"tailwind-merge": "3.4.0",
|
package/src/lib/core/plugins.ts
CHANGED
|
@@ -3,6 +3,7 @@ import type { ReactNode } from "react";
|
|
|
3
3
|
import type { Location, RouteObject } from "react-router";
|
|
4
4
|
import type { Navigation } from "../../config/validators/NavigationSchema.js";
|
|
5
5
|
import type { ProtectedRoutesInput } from "../../config/validators/ProtectedRoutesSchema.js";
|
|
6
|
+
import type { ZudokuConfig } from "../../config/validators/validate.js";
|
|
6
7
|
import type { AuthenticationPlugin } from "../authentication/authentication.js";
|
|
7
8
|
import type { MdxComponentsType } from "../util/MdxComponents.js";
|
|
8
9
|
import type {
|
|
@@ -18,7 +19,8 @@ export type ZudokuPlugin =
|
|
|
18
19
|
| ApiIdentityPlugin
|
|
19
20
|
| SearchProviderPlugin
|
|
20
21
|
| EventConsumerPlugin
|
|
21
|
-
| AuthenticationPlugin
|
|
22
|
+
| AuthenticationPlugin
|
|
23
|
+
| TransformConfigPlugin;
|
|
22
24
|
|
|
23
25
|
export type { AuthenticationPlugin, RouteObject };
|
|
24
26
|
|
|
@@ -60,6 +62,19 @@ export type ProfileNavigationItem = {
|
|
|
60
62
|
icon?: LucideIcon;
|
|
61
63
|
};
|
|
62
64
|
|
|
65
|
+
export interface ConfigHookContext {
|
|
66
|
+
mode: typeof process.env.ZUDOKU_ENV;
|
|
67
|
+
rootDir: string;
|
|
68
|
+
configPath: string;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
export interface TransformConfigPlugin {
|
|
72
|
+
transformConfig?: (
|
|
73
|
+
config: ZudokuConfig,
|
|
74
|
+
ctx: ConfigHookContext,
|
|
75
|
+
) => Partial<ZudokuConfig> | void | Promise<Partial<ZudokuConfig> | void>;
|
|
76
|
+
}
|
|
77
|
+
|
|
63
78
|
export interface CommonPlugin {
|
|
64
79
|
initialize?: (
|
|
65
80
|
context: ZudokuContext,
|
|
@@ -110,3 +125,8 @@ export const isApiIdentityPlugin = (
|
|
|
110
125
|
obj: ZudokuPlugin,
|
|
111
126
|
): obj is ApiIdentityPlugin =>
|
|
112
127
|
"getIdentities" in obj && typeof obj.getIdentities === "function";
|
|
128
|
+
|
|
129
|
+
export const isTransformConfigPlugin = (
|
|
130
|
+
obj: ZudokuPlugin,
|
|
131
|
+
): obj is TransformConfigPlugin =>
|
|
132
|
+
"transformConfig" in obj && typeof obj.transformConfig === "function";
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import createDeepmerge from "@fastify/deepmerge";
|
|
2
|
+
import type { ConfigWithMeta } from "../../config/loader.js";
|
|
3
|
+
import { type ConfigHookContext, isTransformConfigPlugin } from "./plugins.js";
|
|
4
|
+
|
|
5
|
+
const mergeConfig = createDeepmerge({
|
|
6
|
+
mergeArray: (opt) => (_, source) => opt.clone(source),
|
|
7
|
+
});
|
|
8
|
+
|
|
9
|
+
export const runTransformConfigHooks = async (
|
|
10
|
+
config: ConfigWithMeta,
|
|
11
|
+
): Promise<ConfigWithMeta> => {
|
|
12
|
+
const ctx = {
|
|
13
|
+
mode: config.__meta.mode,
|
|
14
|
+
rootDir: config.__meta.rootDir,
|
|
15
|
+
configPath: config.__meta.configPath,
|
|
16
|
+
} satisfies ConfigHookContext;
|
|
17
|
+
const plugins = config.plugins ?? [];
|
|
18
|
+
|
|
19
|
+
let result = config;
|
|
20
|
+
|
|
21
|
+
for (const plugin of plugins.filter(isTransformConfigPlugin)) {
|
|
22
|
+
const partial = await plugin.transformConfig?.(result, ctx);
|
|
23
|
+
if (!partial) continue;
|
|
24
|
+
|
|
25
|
+
result = mergeConfig(result, partial) as ConfigWithMeta;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
return result;
|
|
29
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@shikijs/langs/c3";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@shikijs/langs/gn";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default } from "@shikijs/langs/moonbit";
|