zudoku 0.0.0-fb7d300 → 0.0.0-fc5c03b
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/client.d.ts +7 -0
- package/dist/app/entry.client.d.ts +1 -0
- package/dist/app/entry.client.js +13 -0
- package/dist/app/entry.client.js.map +1 -1
- package/dist/app/entry.server.d.ts +1 -0
- package/dist/app/entry.server.js +1 -0
- package/dist/app/entry.server.js.map +1 -1
- package/dist/app/main.js +2 -1
- package/dist/app/main.js.map +1 -1
- package/dist/app/sentry.d.ts +3 -0
- package/dist/app/sentry.js +19 -0
- package/dist/app/sentry.js.map +1 -0
- package/dist/app/tailwind.d.ts +2 -1
- package/dist/app/tailwind.js +64 -52
- package/dist/app/tailwind.js.map +1 -1
- package/dist/cli/cli.js +0 -2
- package/dist/cli/cli.js.map +1 -1
- package/dist/cli/common/logger.js +9 -0
- package/dist/cli/common/logger.js.map +1 -1
- package/dist/cli/common/outdated.js +2 -1
- package/dist/cli/common/outdated.js.map +1 -1
- package/dist/config/common.d.ts +8 -0
- package/dist/config/common.js +2 -0
- package/dist/config/common.js.map +1 -0
- package/dist/config/config.d.ts +3 -2
- package/dist/config/loader.d.ts +20 -0
- package/dist/config/loader.js +154 -0
- package/dist/config/loader.js.map +1 -0
- package/dist/config/validators/InputSidebarSchema.d.ts +14 -13
- package/dist/config/validators/InputSidebarSchema.js.map +1 -1
- package/dist/config/validators/common.d.ts +4911 -0
- package/dist/config/validators/common.js +276 -0
- package/dist/config/validators/common.js.map +1 -0
- package/dist/config/validators/icon-types.d.ts +1 -0
- package/dist/config/validators/icon-types.js +2 -0
- package/dist/config/validators/icon-types.js.map +1 -0
- package/dist/config/validators/validate.d.ts +777 -521
- package/dist/config/validators/validate.js +9 -228
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/lib/authentication/providers/openid.js +7 -2
- package/dist/lib/authentication/providers/openid.js.map +1 -1
- package/dist/lib/components/Heading.d.ts +4 -4
- package/dist/lib/components/Heading.js +1 -1
- package/dist/lib/components/Heading.js.map +1 -1
- package/dist/lib/components/Layout.js +3 -2
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/Markdown.js +1 -1
- package/dist/lib/components/Markdown.js.map +1 -1
- package/dist/lib/components/MobileTopNavigation.js +1 -1
- package/dist/lib/components/MobileTopNavigation.js.map +1 -1
- package/dist/lib/components/ReactMarkdown.d.ts +29 -0
- package/dist/lib/components/ReactMarkdown.js +182 -0
- package/dist/lib/components/ReactMarkdown.js.map +1 -0
- package/dist/lib/components/Search.d.ts +3 -1
- package/dist/lib/components/Search.js +3 -3
- package/dist/lib/components/Search.js.map +1 -1
- package/dist/lib/components/SyntaxHighlight.js +0 -4
- package/dist/lib/components/SyntaxHighlight.js.map +1 -1
- package/dist/lib/components/TopNavigation.d.ts +1 -1
- package/dist/lib/components/navigation/Sidebar.d.ts +3 -1
- package/dist/lib/components/navigation/Sidebar.js +2 -2
- package/dist/lib/components/navigation/Sidebar.js.map +1 -1
- package/dist/lib/components/navigation/SidebarCategory.d.ts +2 -2
- package/dist/lib/components/navigation/SidebarCategory.js +3 -4
- package/dist/lib/components/navigation/SidebarCategory.js.map +1 -1
- package/dist/lib/components/navigation/SidebarItem.d.ts +2 -4
- package/dist/lib/components/navigation/SidebarItem.js +5 -10
- package/dist/lib/components/navigation/SidebarItem.js.map +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js +1 -1
- package/dist/lib/components/navigation/SidebarWrapper.js.map +1 -1
- package/dist/lib/core/ZudokuContext.d.ts +1 -1
- package/dist/lib/oas/graphql/index.js +4 -1
- package/dist/lib/oas/graphql/index.js.map +1 -1
- package/dist/lib/oas/parser/upgrade/index.d.ts +2 -2
- package/dist/lib/oas/parser/upgrade/index.js +3 -20
- package/dist/lib/oas/parser/upgrade/index.js.map +1 -1
- package/dist/lib/plugins/api-catalog/Catalog.d.ts +6 -0
- package/dist/lib/plugins/api-catalog/Catalog.js +29 -0
- package/dist/lib/plugins/api-catalog/Catalog.js.map +1 -0
- package/dist/lib/plugins/api-catalog/index.d.ts +23 -0
- package/dist/lib/plugins/api-catalog/index.js +15 -0
- package/dist/lib/plugins/api-catalog/index.js.map +1 -0
- package/dist/lib/plugins/markdown/MdxPage.d.ts +9 -1
- package/dist/lib/plugins/markdown/MdxPage.js +15 -2
- package/dist/lib/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/lib/plugins/markdown/index.d.ts +2 -1
- package/dist/lib/plugins/markdown/index.js +1 -1
- package/dist/lib/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/markdown/resolver.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.js +47 -2
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -1
- package/dist/lib/plugins/openapi/client/GraphQLClient.js +12 -0
- package/dist/lib/plugins/openapi/client/GraphQLClient.js.map +1 -1
- package/dist/lib/plugins/openapi/client/useCreateQuery.d.ts +1 -1
- package/dist/lib/plugins/openapi/client/useCreateQuery.js +4 -2
- package/dist/lib/plugins/openapi/client/useCreateQuery.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js +1 -1
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -1
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +2 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js +1 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -1
- package/dist/lib/plugins/openapi/interfaces.d.ts +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js +1 -1
- package/dist/lib/plugins/openapi/playground/PathParams.js.map +1 -1
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.d.ts +6 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.js +14 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.d.ts +1 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js +125 -0
- package/dist/lib/plugins/openapi/post-processors/removeExtensions.test.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.d.ts +11 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.js +33 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.test.d.ts +1 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.test.js +104 -0
- package/dist/lib/plugins/openapi/post-processors/removePaths.test.js.map +1 -0
- package/dist/lib/plugins/openapi/post-processors/traverse.d.ts +1 -0
- package/dist/lib/plugins/openapi/post-processors/traverse.js +2 -0
- package/dist/lib/plugins/openapi/post-processors/traverse.js.map +1 -0
- package/dist/lib/plugins/redirect/index.d.ts +1 -1
- package/dist/lib/ui/Button.d.ts +1 -1
- package/dist/lib/ui/Command.d.ts +1 -1
- package/dist/lib/util/MdxComponents.d.ts +2 -3
- package/dist/lib/util/MdxComponents.js.map +1 -1
- package/dist/lib/util/traverse.d.ts +2 -0
- package/dist/lib/util/traverse.js +18 -0
- package/dist/lib/util/traverse.js.map +1 -0
- package/dist/vite/build.js +15 -3
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +6 -4
- package/dist/vite/config.js +54 -15
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.js +7 -5
- package/dist/vite/config.test.js.map +1 -1
- package/dist/vite/dev-server.js +12 -3
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/output.d.ts +1 -1
- package/dist/vite/output.js +39 -10
- package/dist/vite/output.js.map +1 -1
- package/dist/vite/plugin-api.js +67 -20
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-component.js +15 -19
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin-config-reload.d.ts +1 -2
- package/dist/vite/plugin-config-reload.js.map +1 -1
- package/dist/vite/plugin-config.js +20 -0
- package/dist/vite/plugin-config.js.map +1 -1
- package/dist/vite/plugin-docs.test.js +15 -23
- package/dist/vite/plugin-docs.test.js.map +1 -1
- package/dist/vite/plugin-mdx.js +58 -4
- package/dist/vite/plugin-mdx.js.map +1 -1
- package/dist/vite/{plugin-custom-css.d.ts → plugin-theme-css.d.ts} +2 -2
- package/dist/vite/{plugin-custom-css.js → plugin-theme-css.js} +10 -3
- package/dist/vite/plugin-theme-css.js.map +1 -0
- package/dist/vite/plugin.d.ts +1 -2
- package/dist/vite/plugin.js +2 -2
- package/dist/vite/plugin.js.map +1 -1
- package/dist/vite/prerender.d.ts +2 -1
- package/dist/vite/prerender.js +2 -2
- package/dist/vite/prerender.js.map +1 -1
- package/dist/vite/sitemap.d.ts +1 -1
- package/dist/zuplo/env.d.ts +6 -0
- package/dist/zuplo/env.js +9 -0
- package/dist/zuplo/env.js.map +1 -0
- package/dist/zuplo/with-zuplo.d.ts +3 -0
- package/dist/zuplo/with-zuplo.js +28 -0
- package/dist/zuplo/with-zuplo.js.map +1 -0
- package/lib/AnchorLink-BR0MvI7n.js +35 -0
- package/lib/AnchorLink-BR0MvI7n.js.map +1 -0
- package/lib/{Markdown-ievDDhFT.js → Markdown-CRsmPPfY.js} +13084 -13096
- package/lib/Markdown-CRsmPPfY.js.map +1 -0
- package/lib/MdxPage-Wp8QU0-q.js +188 -0
- package/lib/MdxPage-Wp8QU0-q.js.map +1 -0
- package/lib/{OperationList-BwBl1xrD.js → OperationList-u8xHU9-b.js} +1031 -1016
- package/lib/OperationList-u8xHU9-b.js.map +1 -0
- package/lib/{SlotletProvider-DyomlzGx.js → SlotletProvider-BgvYIPQe.js} +2 -2
- package/lib/{SlotletProvider-DyomlzGx.js.map → SlotletProvider-BgvYIPQe.js.map} +1 -1
- package/lib/{SyntaxHighlight-DkLOsjHS.js → SyntaxHighlight-C31iouiO.js} +1 -3
- package/lib/{SyntaxHighlight-DkLOsjHS.js.map → SyntaxHighlight-C31iouiO.js.map} +1 -1
- package/lib/assets/{worker-CPsGZsve.js → worker-C_2va8B8.js} +8 -9
- package/lib/assets/worker-C_2va8B8.js.map +1 -0
- package/lib/{createServer-DK-g7kbB.js → createServer-BCAHdrpE.js} +4461 -5248
- package/lib/createServer-BCAHdrpE.js.map +1 -0
- package/lib/{index-DNxQ_rCt.js → index-CmdLGbbk.js} +53 -47
- package/lib/index-CmdLGbbk.js.map +1 -0
- package/lib/{AnchorLink-CDlhr8gL.js → index.esm-Bm8pj-bc.js} +223 -254
- package/lib/index.esm-Bm8pj-bc.js.map +1 -0
- package/lib/object_hash-CvlLgU-M.js +785 -0
- package/lib/object_hash-CvlLgU-M.js.map +1 -0
- package/lib/post-processors/removeExtensions.js +11 -0
- package/lib/post-processors/removeExtensions.js.map +1 -0
- package/lib/post-processors/removePaths.js +28 -0
- package/lib/post-processors/removePaths.js.map +1 -0
- package/lib/post-processors/traverse.js +12 -0
- package/lib/post-processors/traverse.js.map +1 -0
- package/lib/ui/Drawer.js +79 -79
- package/lib/ui/Drawer.js.map +1 -1
- package/lib/zudoku.auth-openid.js +42 -37
- package/lib/zudoku.auth-openid.js.map +1 -1
- package/lib/zudoku.components.js +386 -367
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.openapi-worker.js +1 -1
- package/lib/zudoku.plugin-api-catalog.js +121 -0
- package/lib/zudoku.plugin-api-catalog.js.map +1 -0
- package/lib/zudoku.plugin-api-keys.js +1 -1
- package/lib/zudoku.plugin-custom-pages.js +1 -1
- package/lib/zudoku.plugin-markdown.js +15 -14
- package/lib/zudoku.plugin-markdown.js.map +1 -1
- package/lib/zudoku.plugin-openapi.js +1 -1
- package/lib/zudoku.plugin-redirect.js.map +1 -1
- package/package.json +32 -9
- package/src/app/entry.client.tsx +15 -0
- package/src/app/entry.server.tsx +1 -0
- package/src/app/main.tsx +5 -1
- package/src/app/sentry.ts +24 -0
- package/src/app/tailwind.ts +67 -52
- package/src/lib/authentication/providers/openid.tsx +7 -2
- package/src/lib/components/Heading.tsx +13 -13
- package/src/lib/components/Layout.tsx +8 -3
- package/src/lib/components/Markdown.tsx +1 -1
- package/src/lib/components/MobileTopNavigation.tsx +18 -18
- package/src/lib/components/ReactMarkdown.license.txt +21 -0
- package/src/lib/components/ReactMarkdown.tsx +264 -0
- package/src/lib/components/Search.tsx +3 -3
- package/src/lib/components/SyntaxHighlight.tsx +0 -4
- package/src/lib/components/TopNavigation.tsx +1 -1
- package/src/lib/components/navigation/Sidebar.tsx +18 -8
- package/src/lib/components/navigation/SidebarCategory.tsx +10 -9
- package/src/lib/components/navigation/SidebarItem.tsx +10 -13
- package/src/lib/components/navigation/SidebarWrapper.tsx +1 -1
- package/src/lib/core/ZudokuContext.ts +1 -1
- package/src/lib/oas/graphql/index.ts +4 -1
- package/src/lib/oas/parser/upgrade/index.ts +4 -27
- package/src/lib/plugins/api-catalog/Catalog.tsx +124 -0
- package/src/lib/plugins/api-catalog/index.tsx +50 -0
- package/src/lib/plugins/markdown/MdxPage.tsx +27 -1
- package/src/lib/plugins/markdown/index.tsx +3 -1
- package/src/lib/plugins/markdown/resolver.ts +2 -4
- package/src/lib/plugins/openapi/OperationList.tsx +64 -3
- package/src/lib/plugins/openapi/client/GraphQLClient.tsx +17 -0
- package/src/lib/plugins/openapi/client/useCreateQuery.ts +5 -2
- package/src/lib/plugins/openapi/graphql/gql.ts +2 -2
- package/src/lib/plugins/openapi/graphql/graphql.ts +3 -0
- package/src/lib/plugins/openapi/interfaces.ts +1 -1
- package/src/lib/plugins/openapi/playground/PathParams.tsx +1 -0
- package/src/lib/plugins/openapi/post-processors/removeExtensions.test.ts +144 -0
- package/src/lib/plugins/openapi/post-processors/removeExtensions.ts +24 -0
- package/src/lib/plugins/openapi/post-processors/removePaths.test.ts +126 -0
- package/src/lib/plugins/openapi/post-processors/removePaths.ts +55 -0
- package/src/lib/plugins/openapi/post-processors/traverse.ts +1 -0
- package/src/lib/plugins/redirect/index.tsx +1 -1
- package/src/lib/util/MdxComponents.tsx +2 -5
- package/src/lib/util/traverse.ts +25 -0
- package/dist/vite/plugin-custom-css.js.map +0 -1
- package/lib/AnchorLink-CDlhr8gL.js.map +0 -1
- package/lib/Markdown-ievDDhFT.js.map +0 -1
- package/lib/MdxPage-Bwn-VSsH.js +0 -174
- package/lib/MdxPage-Bwn-VSsH.js.map +0 -1
- package/lib/OperationList-BwBl1xrD.js.map +0 -1
- package/lib/assets/worker-CPsGZsve.js.map +0 -1
- package/lib/createServer-DK-g7kbB.js.map +0 -1
- package/lib/index-DNxQ_rCt.js.map +0 -1
- package/lib/prism-markup-templating-DZrrEs0A.js +0 -62
- package/lib/prism-markup-templating-DZrrEs0A.js.map +0 -1
- package/lib/prism-php.min-o7FpoMP_.js +0 -11
- package/lib/prism-php.min-o7FpoMP_.js.map +0 -1
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import { j as e } from "./jsx-runtime-B6kdoens.js";
|
|
2
|
+
import { s as n } from "./index-LNp6rxyU.js";
|
|
3
|
+
import { Fragment as x } from "react";
|
|
4
|
+
import { Head as f, Link as h } from "./zudoku.components.js";
|
|
5
|
+
import { M as u } from "./Markdown-CRsmPPfY.js";
|
|
6
|
+
import { u as j } from "./useExposedProps-CTPtylCV.js";
|
|
7
|
+
const b = ({
|
|
8
|
+
items: l,
|
|
9
|
+
categories: i,
|
|
10
|
+
label: o = "API Library"
|
|
11
|
+
}) => {
|
|
12
|
+
const { searchParams: c, setSearchParams: m } = j(), t = c.get("category");
|
|
13
|
+
return /* @__PURE__ */ e.jsxs("section", { className: "pt-[--padding-content-top] pb-[--padding-content-bottom]", children: [
|
|
14
|
+
/* @__PURE__ */ e.jsx(f, { children: /* @__PURE__ */ e.jsx("title", { children: o }) }),
|
|
15
|
+
/* @__PURE__ */ e.jsxs("div", { className: "grid grid-cols-12 gap-12", children: [
|
|
16
|
+
/* @__PURE__ */ e.jsx("div", { className: "flex flex-col gap-4 col-span-3 px-4 not-prose sticky top-48", children: /* @__PURE__ */ e.jsx("div", { className: "justify-between", children: i.map((s, a) => /* @__PURE__ */ e.jsxs(x, { children: [
|
|
17
|
+
/* @__PURE__ */ e.jsxs("div", { className: "flex justify-between mb-2.5", children: [
|
|
18
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-medium text-sm", children: s.label }),
|
|
19
|
+
a === 0 && t && /* @__PURE__ */ e.jsx(
|
|
20
|
+
"button",
|
|
21
|
+
{
|
|
22
|
+
type: "button",
|
|
23
|
+
className: "text-end text-sm mr-8 text-foreground/60 hover:text-foreground",
|
|
24
|
+
onClick: () => m({}),
|
|
25
|
+
children: "Clear"
|
|
26
|
+
}
|
|
27
|
+
)
|
|
28
|
+
] }),
|
|
29
|
+
/* @__PURE__ */ e.jsx("ul", { className: "space-y-1 [&>li]:py-2", children: Array.from(
|
|
30
|
+
new Set(
|
|
31
|
+
s.tags.map((r) => ({
|
|
32
|
+
tag: r,
|
|
33
|
+
count: l.filter(
|
|
34
|
+
(d) => d.categories.find((p) => p.tags.includes(r))
|
|
35
|
+
).length
|
|
36
|
+
})).map(({ tag: r, count: d }) => /* @__PURE__ */ e.jsxs(
|
|
37
|
+
"li",
|
|
38
|
+
{
|
|
39
|
+
className: `flex px-4 rounded-lg -translate-x-4 justify-between text-sm cursor-pointer hover:text-primary transition ${n(r) === t ? "font-medium bg-border/30 rounded" : ""}`,
|
|
40
|
+
onClick: () => m({
|
|
41
|
+
category: n(s.label + " " + r)
|
|
42
|
+
}),
|
|
43
|
+
children: [
|
|
44
|
+
/* @__PURE__ */ e.jsx("span", { children: r }),
|
|
45
|
+
/* @__PURE__ */ e.jsx(
|
|
46
|
+
"span",
|
|
47
|
+
{
|
|
48
|
+
className: `flex items-center justify-center border rounded-md w-8 text-xs font-semibold ${n(r) === t ? "bg-primary border-primary text-primary-foreground" : ""}`,
|
|
49
|
+
children: d
|
|
50
|
+
}
|
|
51
|
+
)
|
|
52
|
+
]
|
|
53
|
+
},
|
|
54
|
+
n(s.label + " " + r)
|
|
55
|
+
))
|
|
56
|
+
)
|
|
57
|
+
) })
|
|
58
|
+
] }, s.label)) }) }),
|
|
59
|
+
/* @__PURE__ */ e.jsxs("div", { className: "col-span-9", children: [
|
|
60
|
+
/* @__PURE__ */ e.jsx("h3", { className: "mt-0 text-2xl font-bold mb-4", children: o }),
|
|
61
|
+
/* @__PURE__ */ e.jsx("div", { className: "grid grid-cols-2 gap-4", children: l.filter(
|
|
62
|
+
(s) => !t || s.categories.find(
|
|
63
|
+
(a) => a.tags.find(
|
|
64
|
+
(r) => n(a.label + " " + r) === t
|
|
65
|
+
)
|
|
66
|
+
)
|
|
67
|
+
).map((s, a) => /* @__PURE__ */ e.jsx(
|
|
68
|
+
h,
|
|
69
|
+
{
|
|
70
|
+
to: {
|
|
71
|
+
pathname: `/${s.path}`,
|
|
72
|
+
search: t ? `category=${t}` : ""
|
|
73
|
+
},
|
|
74
|
+
className: "no-underline hover:!text-foreground",
|
|
75
|
+
children: /* @__PURE__ */ e.jsxs(
|
|
76
|
+
"div",
|
|
77
|
+
{
|
|
78
|
+
className: "border h-full rounded p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal",
|
|
79
|
+
children: [
|
|
80
|
+
/* @__PURE__ */ e.jsx("span", { className: "font-semibold", children: s.label }),
|
|
81
|
+
/* @__PURE__ */ e.jsx(
|
|
82
|
+
u,
|
|
83
|
+
{
|
|
84
|
+
className: "text-sm whitespace-pre-wrap mb-6 line-clamp-2",
|
|
85
|
+
content: s.description
|
|
86
|
+
}
|
|
87
|
+
)
|
|
88
|
+
]
|
|
89
|
+
},
|
|
90
|
+
a
|
|
91
|
+
)
|
|
92
|
+
},
|
|
93
|
+
s.path
|
|
94
|
+
)) })
|
|
95
|
+
] })
|
|
96
|
+
] })
|
|
97
|
+
] });
|
|
98
|
+
}, k = ({
|
|
99
|
+
navigationId: l,
|
|
100
|
+
items: i,
|
|
101
|
+
label: o,
|
|
102
|
+
categories: c
|
|
103
|
+
}) => ({
|
|
104
|
+
getRoutes: () => [
|
|
105
|
+
{
|
|
106
|
+
path: l,
|
|
107
|
+
element: /* @__PURE__ */ e.jsx(
|
|
108
|
+
b,
|
|
109
|
+
{
|
|
110
|
+
label: o,
|
|
111
|
+
items: i,
|
|
112
|
+
categories: c ?? []
|
|
113
|
+
}
|
|
114
|
+
)
|
|
115
|
+
}
|
|
116
|
+
]
|
|
117
|
+
});
|
|
118
|
+
export {
|
|
119
|
+
k as apiCatalogPlugin
|
|
120
|
+
};
|
|
121
|
+
//# sourceMappingURL=zudoku.plugin-api-catalog.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"zudoku.plugin-api-catalog.js","sources":["../src/lib/plugins/api-catalog/Catalog.tsx","../src/lib/plugins/api-catalog/index.tsx"],"sourcesContent":["import slugify from \"@sindresorhus/slugify\";\nimport { Fragment } from \"react\";\nimport { Head, Link } from \"zudoku/components\";\nimport { Markdown } from \"../../components/Markdown.js\";\nimport { useExposedProps } from \"../../util/useExposedProps.js\";\nimport type { ApiCatalogItem, CatalogCategory } from \"./index.js\";\n\nexport const Catalog = ({\n items,\n categories,\n label = \"API Library\",\n}: {\n label: string;\n items: ApiCatalogItem[];\n categories: CatalogCategory[];\n}) => {\n const { searchParams, setSearchParams } = useExposedProps();\n const activeCategory = searchParams.get(\"category\");\n return (\n <section className=\"pt-[--padding-content-top] pb-[--padding-content-bottom]\">\n <Head>\n <title>{label}</title>\n </Head>\n <div className=\"grid grid-cols-12 gap-12\">\n <div className=\"flex flex-col gap-4 col-span-3 px-4 not-prose sticky top-48\">\n <div className=\"justify-between\">\n {categories.map((category, idx) => (\n <Fragment key={category.label}>\n <div className=\"flex justify-between mb-2.5\">\n <span className=\"font-medium text-sm\">{category.label}</span>\n {idx === 0 && activeCategory && (\n <button\n type=\"button\"\n className=\"text-end text-sm mr-8 text-foreground/60 hover:text-foreground\"\n onClick={() => setSearchParams({})}\n >\n Clear\n </button>\n )}\n </div>\n <ul className=\"space-y-1 [&>li]:py-2\">\n {Array.from(\n new Set(\n category.tags\n .map((tag) => ({\n tag,\n count: items.filter((api) =>\n api.categories.find((c) => c.tags.includes(tag)),\n ).length,\n }))\n .map(({ tag, count }) => (\n <li\n key={slugify(category.label + \" \" + tag)}\n className={`flex px-4 rounded-lg -translate-x-4 justify-between text-sm cursor-pointer hover:text-primary transition ${\n slugify(tag) === activeCategory\n ? \"font-medium bg-border/30 rounded\"\n : \"\"\n }`}\n onClick={() =>\n setSearchParams({\n category: slugify(category.label + \" \" + tag),\n })\n }\n >\n <span>{tag}</span>\n <span\n className={`flex items-center justify-center border rounded-md w-8 text-xs font-semibold ${\n slugify(tag) === activeCategory\n ? \"bg-primary border-primary text-primary-foreground\"\n : \"\"\n }`}\n >\n {count}\n </span>\n </li>\n )),\n ),\n )}\n </ul>\n </Fragment>\n ))}\n </div>\n </div>\n <div className=\"col-span-9\">\n <h3 className=\"mt-0 text-2xl font-bold mb-4\">{label}</h3>\n\n <div className=\"grid grid-cols-2 gap-4\">\n {items\n .filter(\n (api) =>\n !activeCategory ||\n api.categories.find((c) =>\n c.tags.find(\n (t) => slugify(c.label + \" \" + t) === activeCategory,\n ),\n ),\n )\n .map((api, i) => (\n <Link\n to={{\n pathname: `/${api.path}`,\n search: activeCategory ? `category=${activeCategory}` : \"\",\n }}\n className=\"no-underline hover:!text-foreground\"\n key={api.path}\n >\n <div\n className=\"border h-full rounded p-4 flex flex-col gap-2 cursor-pointer hover:bg-border/20 font-normal\"\n key={i}\n >\n <span className=\"font-semibold\">{api.label}</span>\n <Markdown\n className=\"text-sm whitespace-pre-wrap mb-6 line-clamp-2\"\n content={api.description}\n />\n </div>\n </Link>\n ))}\n </div>\n </div>\n </div>\n </section>\n );\n};\n","import type { ZudokuPlugin } from \"../../core/plugins.js\";\nimport { Catalog } from \"./Catalog.js\";\n\nexport type ApiCatalogItem = {\n path: string;\n label: string;\n description: string;\n categories: CatalogCategory[];\n};\n\nexport type CatalogCategory = {\n label: string;\n tags: string[];\n};\n\nexport type ApiCatalogPluginOptions = {\n navigationId: string;\n label: string;\n categories?: CatalogCategory[];\n items: ApiCatalogItem[];\n};\n\nexport const apiCatalogPlugin = ({\n navigationId,\n items,\n label,\n categories,\n}: {\n navigationId: string;\n label: string;\n categories?: CatalogCategory[];\n items: ApiCatalogItem[];\n}): ZudokuPlugin => {\n return {\n getRoutes: () => {\n return [\n {\n path: navigationId,\n element: (\n <Catalog\n label={label}\n items={items}\n categories={categories ?? []}\n />\n ),\n },\n ];\n },\n };\n};\n"],"names":["Catalog","items","categories","label","searchParams","setSearchParams","useExposedProps","activeCategory","jsxs","jsx","Head","category","idx","Fragment","tag","api","c","count","slugify","t","i","Link","Markdown","apiCatalogPlugin","navigationId"],"mappings":";;;;;;AAOO,MAAMA,IAAU,CAAC;AAAA,EACtB,OAAAC;AAAA,EACA,YAAAC;AAAA,EACA,OAAAC,IAAQ;AACV,MAIM;AACJ,QAAM,EAAE,cAAAC,GAAc,iBAAAC,EAAgB,IAAIC,EAAgB,GACpDC,IAAiBH,EAAa,IAAI,UAAU;AAEhD,SAAAI,gBAAAA,EAAA,KAAC,WAAQ,EAAA,WAAU,4DACjB,UAAA;AAAA,IAAAC,gBAAAA,MAACC,GACC,EAAA,UAAAD,gBAAAA,EAAA,IAAC,SAAO,EAAA,UAAAN,EAAM,CAAA,GAChB;AAAA,IACAK,gBAAAA,EAAAA,KAAC,OAAI,EAAA,WAAU,4BACb,UAAA;AAAA,MAAAC,gBAAAA,MAAC,OAAI,EAAA,WAAU,+DACb,UAAAA,gBAAAA,EAAA,IAAC,OAAI,EAAA,WAAU,mBACZ,UAAAP,EAAW,IAAI,CAACS,GAAUC,6BACxBC,GACC,EAAA,UAAA;AAAA,QAACL,gBAAAA,EAAAA,KAAA,OAAA,EAAI,WAAU,+BACb,UAAA;AAAA,UAAAC,gBAAAA,EAAA,IAAC,QAAK,EAAA,WAAU,uBAAuB,UAAAE,EAAS,OAAM;AAAA,UACrDC,MAAQ,KAAKL,KACZE,gBAAAA,EAAA;AAAA,YAAC;AAAA,YAAA;AAAA,cACC,MAAK;AAAA,cACL,WAAU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J;AAAA,EAAA;AAEJ;"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as e } from "./jsx-runtime-B6kdoens.js";
|
|
2
2
|
import { RotateCwIcon as g, TrashIcon as f, EyeOffIcon as j, EyeIcon as v, CheckIcon as w, CopyIcon as b, FileKey2Icon as K } from "lucide-react";
|
|
3
|
-
import { D as k, S as m, R as N } from "./SlotletProvider-
|
|
3
|
+
import { D as k, S as m, R as N } from "./SlotletProvider-BgvYIPQe.js";
|
|
4
4
|
import { i as c } from "./invariant-Caa8-XvF.js";
|
|
5
5
|
import { u as d, S as I, a as S, b as A, c as C, d as E, e as x } from "./Select-O9ZM3ZgX.js";
|
|
6
6
|
import { a as P } from "./index.esm-C5mr_sKO.js";
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { j as o } from "./jsx-runtime-B6kdoens.js";
|
|
2
2
|
import a from "react";
|
|
3
|
-
import { P as n } from "./Markdown-
|
|
3
|
+
import { P as n } from "./Markdown-CRsmPPfY.js";
|
|
4
4
|
import { c } from "./cn-BmFQLtkS.js";
|
|
5
5
|
import { u as p } from "./useExposedProps-CTPtylCV.js";
|
|
6
6
|
const u = ({
|
|
@@ -22,18 +22,18 @@ class c {
|
|
|
22
22
|
*/
|
|
23
23
|
resolveFilePath(t) {
|
|
24
24
|
const o = this.getDocsConfigs();
|
|
25
|
-
let
|
|
25
|
+
let e;
|
|
26
26
|
return o.forEach(({ files: i }) => {
|
|
27
|
-
if (
|
|
27
|
+
if (e)
|
|
28
28
|
return;
|
|
29
|
-
const
|
|
29
|
+
const s = c.getRootDir(i);
|
|
30
30
|
for (const a of D) {
|
|
31
|
-
if (
|
|
31
|
+
if (e)
|
|
32
32
|
return;
|
|
33
|
-
const r = u.join(
|
|
34
|
-
u.existsSync(r) && (
|
|
33
|
+
const r = u.join(s, `${t}${a}`);
|
|
34
|
+
u.existsSync(r) && (e = r);
|
|
35
35
|
}
|
|
36
|
-
}),
|
|
36
|
+
}), e;
|
|
37
37
|
}
|
|
38
38
|
/**
|
|
39
39
|
* Gets the root directory from a files glob
|
|
@@ -53,32 +53,33 @@ class c {
|
|
|
53
53
|
filesGlob: t,
|
|
54
54
|
fsPath: o
|
|
55
55
|
}) {
|
|
56
|
-
const
|
|
57
|
-
return
|
|
56
|
+
const e = this.getRootDir(t), i = new RegExp(`^${e}(.*).mdx?`), s = o.match(i);
|
|
57
|
+
return s == null ? void 0 : s.at(1);
|
|
58
58
|
}
|
|
59
59
|
}
|
|
60
60
|
const C = (n) => ({
|
|
61
61
|
getRoutes: () => {
|
|
62
62
|
const t = /* @__PURE__ */ new Map();
|
|
63
63
|
return n.forEach(
|
|
64
|
-
({ fileImports: o, files:
|
|
64
|
+
({ fileImports: o, files: e, defaultOptions: i }) => Object.entries(o).flatMap(([s, a]) => {
|
|
65
65
|
const r = c.resolveRoutePath({
|
|
66
|
-
filesGlob:
|
|
67
|
-
fsPath:
|
|
66
|
+
filesGlob: e,
|
|
67
|
+
fsPath: s
|
|
68
68
|
});
|
|
69
69
|
if (!r) return [];
|
|
70
70
|
if (t.has(r))
|
|
71
71
|
return console.warn(
|
|
72
|
-
`Duplicate route path found for ${r}. Skipping file at '${
|
|
72
|
+
`Duplicate route path found for ${r}. Skipping file at '${s}'.`
|
|
73
73
|
), [];
|
|
74
74
|
const h = {
|
|
75
75
|
path: r,
|
|
76
76
|
lazy: async () => {
|
|
77
|
-
const { MdxPage: l } = await import("./MdxPage-
|
|
77
|
+
const { MdxPage: l } = await import("./MdxPage-Wp8QU0-q.js"), { default: p, ...g } = await a();
|
|
78
78
|
return {
|
|
79
79
|
element: /* @__PURE__ */ P.jsx(
|
|
80
80
|
l,
|
|
81
81
|
{
|
|
82
|
+
file: s,
|
|
82
83
|
mdxComponent: p,
|
|
83
84
|
...g,
|
|
84
85
|
defaultOptions: i
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.plugin-markdown.js","sources":["../src/lib/plugins/markdown/resolver.ts","../src/lib/plugins/markdown/index.tsx"],"sourcesContent":["import fs from \"fs\";\nimport path from \"path\";\nimport {\
|
|
1
|
+
{"version":3,"file":"zudoku.plugin-markdown.js","sources":["../src/lib/plugins/markdown/resolver.ts","../src/lib/plugins/markdown/index.tsx"],"sourcesContent":["import fs from \"fs\";\nimport path from \"path\";\nimport { ZudokuDocsConfig } from \"../../../config/validators/common.js\";\nimport { ZudokuConfig } from \"../../../config/validators/validate.js\";\n\nconst DEFAULT_DOCS_FILES = \"/pages/**/*.{md,mdx}\";\n\n// TODO: This should be dynamic based on the glob selector\nconst SUPPORTED_EXTENSIONS = [\".md\", \".mdx\"];\n\n/**\n * Utilities for resolving markdown file paths and routes\n */\nexport class DocResolver {\n constructor(private config: ZudokuConfig) {}\n\n fileMap = new Map<string, string>();\n\n /**\n * Gets the default docs config from the zudoku config\n */\n getDocsConfigs() {\n const docsConfigs: ZudokuDocsConfig[] = this.config.docs\n ? Array.isArray(this.config.docs)\n ? this.config.docs\n : [this.config.docs]\n : [{ files: DEFAULT_DOCS_FILES }];\n\n return docsConfigs;\n }\n\n /**\n * Resolves the first matching file system path for a given docId\n * @param docId - The docId to resolve\n * @returns\n */\n resolveFilePath(docId: string) {\n const docsConfigs = this.getDocsConfigs();\n let fsPath: string | undefined;\n\n docsConfigs.forEach(({ files: fileGlob }) => {\n if (fsPath) {\n return;\n }\n const rootDir = DocResolver.getRootDir(fileGlob);\n for (const ext of SUPPORTED_EXTENSIONS) {\n if (fsPath) {\n return;\n }\n const checkPath = path.join(rootDir, `${docId}${ext}`);\n if (fs.existsSync(checkPath)) {\n fsPath = checkPath;\n }\n }\n });\n\n return fsPath;\n }\n\n /**\n * Gets the root directory from a files glob\n */\n private static getRootDir(filesGlob: string) {\n let rootDir = filesGlob.split(\"**\")[0];\n if (!rootDir) {\n throw new Error(\"Invalid files glob. Must have '**' in the path.\");\n }\n rootDir = rootDir.replace(\"/**\", \"/\");\n return rootDir;\n }\n\n /**\n * Resolves the route path for a given file system path\n * @param options - The options to resolve the route path\n * @returns The string route path\n */\n static resolveRoutePath({\n filesGlob,\n fsPath,\n }: {\n filesGlob: string;\n fsPath: string;\n }) {\n const rootDir = this.getRootDir(filesGlob);\n const re = new RegExp(`^${rootDir}(.*).mdx?`);\n const match = fsPath.match(re);\n const routePath = match?.at(1);\n return routePath;\n }\n}\n","import type { Toc } from \"@stefanprobst/rehype-extract-toc\";\nimport type { MDXProps } from \"mdx/types.js\";\nimport { RouteObject } from \"react-router-dom\";\nimport { ZudokuDocsConfig } from \"../../../config/validators/common.js\";\nimport type { ZudokuPlugin } from \"../../core/plugins.js\";\nimport { DocResolver } from \"./resolver.js\";\n\nexport interface MarkdownPluginOptions extends ZudokuDocsConfig {\n fileImports: Record<string, () => Promise<MDXImport>>;\n}\nexport type MarkdownPluginDefaultOptions = Pick<\n Frontmatter,\n \"toc\" | \"disablePager\"\n>;\n\nexport type Frontmatter = {\n title?: string;\n description?: string;\n category?: string;\n toc?: boolean;\n disablePager?: boolean;\n};\n\nexport type MDXImport = {\n tableOfContents: Toc;\n frontmatter: Frontmatter;\n excerpt?: string;\n default: (props: MDXProps) => JSX.Element;\n};\n\nexport const markdownPlugin = (\n options: MarkdownPluginOptions[],\n): ZudokuPlugin => ({\n getRoutes: () => {\n const routeMap = new Map<string, RouteObject>();\n options.forEach(({ fileImports, files, defaultOptions }) =>\n Object.entries(fileImports).flatMap(([file, importPromise]) => {\n const routePath = DocResolver.resolveRoutePath({\n filesGlob: files,\n fsPath: file,\n });\n\n if (!routePath) return [];\n\n if (routeMap.has(routePath)) {\n // eslint-disable-next-line no-console\n console.warn(\n `Duplicate route path found for ${routePath}. Skipping file at '${file}'.`,\n );\n return [];\n }\n\n const route: RouteObject = {\n path: routePath,\n lazy: async () => {\n const { MdxPage } = await import(\"./MdxPage.js\");\n const { default: Component, ...props } = await importPromise();\n return {\n element: (\n <MdxPage\n file={file}\n mdxComponent={Component}\n {...props}\n defaultOptions={defaultOptions}\n />\n ),\n };\n },\n };\n routeMap.set(routePath, route);\n }),\n );\n return [...routeMap.values()];\n },\n});\n"],"names":["DEFAULT_DOCS_FILES","SUPPORTED_EXTENSIONS","DocResolver","config","__publicField","docId","docsConfigs","fsPath","fileGlob","rootDir","ext","checkPath","path","fs","filesGlob","re","match","markdownPlugin","options","routeMap","fileImports","files","defaultOptions","file","importPromise","routePath","route","MdxPage","Component","props","jsx"],"mappings":";;;;;AAKA,MAAMA,IAAqB,wBAGrBC,IAAuB,CAAC,OAAO,MAAM;AAKpC,MAAMC,EAAY;AAAA,EACvB,YAAoBC,GAAsB;AAE1C,IAAAC,EAAA,qCAAc;AAFM,SAAA,SAAAD;AAAA,EAAuB;AAAA;AAAA;AAAA;AAAA,EAO3C,iBAAiB;AAOR,WANiC,KAAK,OAAO,OAChD,MAAM,QAAQ,KAAK,OAAO,IAAI,IAC5B,KAAK,OAAO,OACZ,CAAC,KAAK,OAAO,IAAI,IACnB,CAAC,EAAE,OAAOH,EAAA,CAAoB;AAAA,EAGpC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,gBAAgBK,GAAe;AACvB,UAAAC,IAAc,KAAK;AACrB,QAAAC;AAEJ,WAAAD,EAAY,QAAQ,CAAC,EAAE,OAAOE,QAAe;AAC3C,UAAID;AACF;AAEI,YAAAE,IAAUP,EAAY,WAAWM,CAAQ;AAC/C,iBAAWE,KAAOT,GAAsB;AACtC,YAAIM;AACF;AAEI,cAAAI,IAAYC,EAAK,KAAKH,GAAS,GAAGJ,CAAK,GAAGK,CAAG,EAAE;AACjD,QAAAG,EAAG,WAAWF,CAAS,MAChBJ,IAAAI;AAAA,MAEb;AAAA,IAAA,CACD,GAEMJ;AAAA,EACT;AAAA;AAAA;AAAA;AAAA,EAKA,OAAe,WAAWO,GAAmB;AAC3C,QAAIL,IAAUK,EAAU,MAAM,IAAI,EAAE,CAAC;AACrC,QAAI,CAACL;AACG,YAAA,IAAI,MAAM,iDAAiD;AAEzD,WAAAA,IAAAA,EAAQ,QAAQ,OAAO,G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C,GAAGP,EAAS,OAAA,CAAQ;AAAA,EAC9B;AACF;"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"zudoku.plugin-redirect.js","sources":["../src/lib/plugins/redirect/index.tsx"],"sourcesContent":["import { redirect } from \"react-router-dom\";\nimport { ZudokuRedirect } from \"../../../config/validators/
|
|
1
|
+
{"version":3,"file":"zudoku.plugin-redirect.js","sources":["../src/lib/plugins/redirect/index.tsx"],"sourcesContent":["import { redirect } from \"react-router-dom\";\nimport { ZudokuRedirect } from \"../../../config/validators/common.js\";\nimport type { ZudokuPlugin } from \"../../core/plugins.js\";\n\nexport const redirectPlugin = (options: {\n redirects: ZudokuRedirect[];\n}): ZudokuPlugin => {\n return {\n getRoutes: () =>\n options.redirects.map(({ from, to }) => ({\n path: from,\n loader: () => redirect(to, 301),\n })),\n };\n};\n"],"names":["redirectPlugin","options","from","to","redirect"],"mappings":";AAIa,MAAAA,IAAiB,CAACC,OAGtB;AAAA,EACL,WAAW,MACTA,EAAQ,UAAU,IAAI,CAAC,EAAE,MAAAC,GAAM,IAAAC,SAAU;AAAA,IACvC,MAAMD;AAAA,IACN,QAAQ,MAAME,EAASD,GAAI,GAAG;AAAA,EAAA,EAC9B;AAAA;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zudoku",
|
|
3
|
-
"version": "0.0.0-
|
|
3
|
+
"version": "0.0.0-fc5c03b",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"homepage": "https://zudoku.dev",
|
|
6
6
|
"repository": {
|
|
@@ -54,6 +54,10 @@
|
|
|
54
54
|
"import": "./lib/zudoku.plugin-api-keys.js",
|
|
55
55
|
"types": "./dist/lib/plugins/api-keys/index.d.ts"
|
|
56
56
|
},
|
|
57
|
+
"./plugins/api-catalog": {
|
|
58
|
+
"import": "./lib/zudoku.plugin-api-catalog.js",
|
|
59
|
+
"types": "./dist/lib/plugins/api-catalog/index.d.ts"
|
|
60
|
+
},
|
|
57
61
|
"./plugins/markdown": {
|
|
58
62
|
"import": "./lib/zudoku.plugin-markdown.js",
|
|
59
63
|
"types": "./dist/lib/plugins/markdown/index.d.ts"
|
|
@@ -82,6 +86,10 @@
|
|
|
82
86
|
"import": "./lib/zudoku.components.js",
|
|
83
87
|
"types": "./dist/lib/components/index.d.ts"
|
|
84
88
|
},
|
|
89
|
+
"./post-processors/*": {
|
|
90
|
+
"import": "./lib/post-processors/*.js",
|
|
91
|
+
"types": "./dist/lib/plugins/openapi/post-processors/*.d.ts"
|
|
92
|
+
},
|
|
85
93
|
"./icons": {
|
|
86
94
|
"import": "./lib/zudoku.icons.js",
|
|
87
95
|
"types": "./dist/lib/icons.d.ts"
|
|
@@ -100,6 +108,10 @@
|
|
|
100
108
|
},
|
|
101
109
|
"./app/*": {
|
|
102
110
|
"import": "./src/app/*"
|
|
111
|
+
},
|
|
112
|
+
"./with-zuplo": {
|
|
113
|
+
"require": "./dist/zuplo/with-zuplo.js",
|
|
114
|
+
"import": "./dist/zuplo/with-zuplo.js"
|
|
103
115
|
}
|
|
104
116
|
},
|
|
105
117
|
"dependencies": {
|
|
@@ -140,8 +152,7 @@
|
|
|
140
152
|
"@tanstack/react-query": "5.61.0",
|
|
141
153
|
"@types/react": "18.3.11",
|
|
142
154
|
"@types/react-dom": "18.3.1",
|
|
143
|
-
"@vitejs/plugin-react": "4.3.
|
|
144
|
-
"@zudoku/config": "0.0.0-fb7d300",
|
|
155
|
+
"@vitejs/plugin-react": "4.3.4",
|
|
145
156
|
"@zudoku/httpsnippet": "10.0.9",
|
|
146
157
|
"@zudoku/react-helmet-async": "2.0.4",
|
|
147
158
|
"autoprefixer": "10.4.20",
|
|
@@ -149,7 +160,7 @@
|
|
|
149
160
|
"class-variance-authority": "0.7.0",
|
|
150
161
|
"clsx": "2.1.1",
|
|
151
162
|
"cmdk": "1.0.4",
|
|
152
|
-
"
|
|
163
|
+
"devlop": "^1.1.0",
|
|
153
164
|
"embla-carousel-react": "8.3.1",
|
|
154
165
|
"estree-util-value-to-estree": "3.2.1",
|
|
155
166
|
"express": "4.21.1",
|
|
@@ -158,6 +169,9 @@
|
|
|
158
169
|
"graphql-type-json": "0.3.2",
|
|
159
170
|
"graphql-yoga": "5.7.0",
|
|
160
171
|
"gray-matter": "4.0.3",
|
|
172
|
+
"hast-util-to-jsx-runtime": "^2.3.2",
|
|
173
|
+
"hast-util-to-string": "3.0.1",
|
|
174
|
+
"html-url-attributes": "^3.0.1",
|
|
161
175
|
"http-terminator": "3.2.0",
|
|
162
176
|
"loglevel": "1.9.2",
|
|
163
177
|
"lru-cache": "11.0.1",
|
|
@@ -174,7 +188,6 @@
|
|
|
174
188
|
"react-error-boundary": "4.1.2",
|
|
175
189
|
"react-hook-form": "7.53.0",
|
|
176
190
|
"react-is": "18.3.1",
|
|
177
|
-
"react-markdown": "9.0.1",
|
|
178
191
|
"react-router-dom": "6.27.0",
|
|
179
192
|
"rehype-raw": "7.0.0",
|
|
180
193
|
"rehype-slug": "6.0.0",
|
|
@@ -184,6 +197,8 @@
|
|
|
184
197
|
"remark-frontmatter": "5.0.0",
|
|
185
198
|
"remark-gfm": "4.0.0",
|
|
186
199
|
"remark-mdx-frontmatter": "5.0.0",
|
|
200
|
+
"remark-parse": "^11.0.0",
|
|
201
|
+
"remark-rehype": "^11.1.1",
|
|
187
202
|
"rollup": "4.24.0",
|
|
188
203
|
"semver": "7.6.3",
|
|
189
204
|
"sitemap": "8.0.0",
|
|
@@ -191,10 +206,12 @@
|
|
|
191
206
|
"strip-ansi": "7.1.0",
|
|
192
207
|
"tailwind-merge": "2.5.4",
|
|
193
208
|
"tailwindcss": "3.4.13",
|
|
209
|
+
"tsx": "^4.19.2",
|
|
194
210
|
"ulidx": "2.4.1",
|
|
211
|
+
"unified": "^11.0.5",
|
|
195
212
|
"unist-util-visit": "5.0.0",
|
|
196
213
|
"urql": "4.1.0",
|
|
197
|
-
"vaul": "1.1.
|
|
214
|
+
"vaul": "1.1.1",
|
|
198
215
|
"vfile": "6.0.3",
|
|
199
216
|
"vite": "5.4.9",
|
|
200
217
|
"yaml": "2.6.0",
|
|
@@ -209,6 +226,7 @@
|
|
|
209
226
|
"@types/estree": "1.0.6",
|
|
210
227
|
"@types/express": "5.0.0",
|
|
211
228
|
"@types/har-format": "1.2.15",
|
|
229
|
+
"@types/hast": "^3.0.4",
|
|
212
230
|
"@types/json-schema": "7.0.15",
|
|
213
231
|
"@types/mdast": "4.0.4",
|
|
214
232
|
"@types/mdx": "2.0.13",
|
|
@@ -216,12 +234,15 @@
|
|
|
216
234
|
"@types/object-hash": "3.0.6",
|
|
217
235
|
"@types/react-is": "18.3.0",
|
|
218
236
|
"@types/semver": "7.5.8",
|
|
237
|
+
"@types/unist": "^3.0.3",
|
|
219
238
|
"@types/yargs": "17.0.33",
|
|
239
|
+
"@vitest/coverage-v8": "2.1.8",
|
|
220
240
|
"mdast-util-mdx": "3.0.0",
|
|
221
241
|
"react": "18.3.1",
|
|
222
242
|
"react-dom": "18.3.1",
|
|
223
243
|
"rollup-plugin-visualizer": "5.12.0",
|
|
224
|
-
"typescript": "5.7.2"
|
|
244
|
+
"typescript": "5.7.2",
|
|
245
|
+
"vitest": "2.1.8"
|
|
225
246
|
},
|
|
226
247
|
"peerDependencies": {
|
|
227
248
|
"react": ">=18",
|
|
@@ -229,17 +250,19 @@
|
|
|
229
250
|
},
|
|
230
251
|
"optionalDependencies": {
|
|
231
252
|
"@clerk/clerk-js": "5.11.0",
|
|
232
|
-
"@inkeep/widgets": "^0.2.289"
|
|
253
|
+
"@inkeep/widgets": "^0.2.289",
|
|
254
|
+
"@sentry/react": "^8.45.1"
|
|
233
255
|
},
|
|
234
256
|
"scripts": {
|
|
235
257
|
"build": "tsc --project tsconfig.json",
|
|
236
258
|
"build:vite": "vite build",
|
|
259
|
+
"generate:icon-types": "tsx ./scripts/generate-icon-types.ts",
|
|
237
260
|
"build:standalone:vite": "vite build --mode standalone --config vite.standalone.config.ts",
|
|
238
261
|
"build:standalone:html": "cp ./src/app/standalone.html ./standalone/standalone.html && cp ./src/app/demo.html ./standalone/demo.html && cp ./src/app/demo-cdn.html ./standalone/index.html",
|
|
239
262
|
"hack:fix-worker-paths": "node ./scripts/hack-worker.mjs",
|
|
240
263
|
"clean": "tsc --build --clean",
|
|
241
264
|
"codegen": "graphql-codegen --config ./src/codegen.ts",
|
|
242
|
-
"test": "
|
|
265
|
+
"test": "vitest run"
|
|
243
266
|
},
|
|
244
267
|
"module": "./dist/index.js",
|
|
245
268
|
"types": "./dist/index.d.ts"
|
package/src/app/entry.client.tsx
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
} from "react-router-dom";
|
|
7
7
|
import config from "virtual:zudoku-config";
|
|
8
8
|
import "virtual:zudoku-theme.css";
|
|
9
|
+
import "vite/modulepreload-polyfill";
|
|
9
10
|
import { Bootstrap } from "zudoku/components";
|
|
10
11
|
import "./main.css";
|
|
11
12
|
import { getRoutesByConfig } from "./main.js";
|
|
@@ -13,6 +14,12 @@ import { getRoutesByConfig } from "./main.js";
|
|
|
13
14
|
const routes = getRoutesByConfig(config);
|
|
14
15
|
const root = document.getElementById("root")!;
|
|
15
16
|
|
|
17
|
+
if (process.env.SENTRY_DSN) {
|
|
18
|
+
void import("./sentry.js").then((mod) => {
|
|
19
|
+
mod.initSentry({ dsn: process.env.SENTRY_DSN as string });
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
|
|
16
23
|
if (root.childElementCount > 0) {
|
|
17
24
|
void hydrate(routes);
|
|
18
25
|
} else {
|
|
@@ -64,3 +71,11 @@ async function hydrate(routes: RouteObject[]) {
|
|
|
64
71
|
|
|
65
72
|
hydrateRoot(root, <Bootstrap hydrate router={router} />);
|
|
66
73
|
}
|
|
74
|
+
|
|
75
|
+
// This is a workaround to avoid version skewing
|
|
76
|
+
// See https://vite.dev/guide/build.html#load-error-handling
|
|
77
|
+
// TODO: Implement a more advanced solution if there are CDN urls or e.g. Vercel Skew Protection
|
|
78
|
+
window.addEventListener("vite:preloadError", (e) => {
|
|
79
|
+
e.preventDefault();
|
|
80
|
+
window.location.reload();
|
|
81
|
+
});
|
package/src/app/entry.server.tsx
CHANGED
|
@@ -10,6 +10,7 @@ import {
|
|
|
10
10
|
createStaticRouter,
|
|
11
11
|
} from "react-router-dom/server.js";
|
|
12
12
|
import "virtual:zudoku-theme.css";
|
|
13
|
+
import "vite/modulepreload-polyfill";
|
|
13
14
|
import { BootstrapStatic, ServerError } from "zudoku/components";
|
|
14
15
|
import type { ZudokuConfig } from "../config/config.js";
|
|
15
16
|
import type { FileWritingResponse } from "../vite/prerender.js";
|
package/src/app/main.tsx
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
import { type RouteObject } from "react-router-dom";
|
|
2
2
|
import { configuredApiKeysPlugin } from "virtual:zudoku-api-keys-plugin";
|
|
3
|
-
import {
|
|
3
|
+
import {
|
|
4
|
+
configuredApiCatalogPlugins,
|
|
5
|
+
configuredApiPlugins,
|
|
6
|
+
} from "virtual:zudoku-api-plugins";
|
|
4
7
|
import { configuredAuthProvider } from "virtual:zudoku-auth";
|
|
5
8
|
import { configuredCustomPagesPlugin } from "virtual:zudoku-custom-pages-plugin";
|
|
6
9
|
import { configuredDocsPlugins } from "virtual:zudoku-docs-plugins";
|
|
@@ -57,6 +60,7 @@ export const convertZudokuConfigToOptions = (
|
|
|
57
60
|
...(configuredRedirectPlugin ? [configuredRedirectPlugin] : []),
|
|
58
61
|
...(configuredApiKeysPlugin ? [configuredApiKeysPlugin] : []),
|
|
59
62
|
...(configuredCustomPagesPlugin ? [configuredCustomPagesPlugin] : []),
|
|
63
|
+
...configuredApiCatalogPlugins,
|
|
60
64
|
...(configuredAuthProvider?.getAuthenticationPlugin
|
|
61
65
|
? [configuredAuthProvider.getAuthenticationPlugin()]
|
|
62
66
|
: []),
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import * as Sentry from "@sentry/react";
|
|
2
|
+
import { useEffect } from "react";
|
|
3
|
+
import {
|
|
4
|
+
createRoutesFromChildren,
|
|
5
|
+
matchRoutes,
|
|
6
|
+
useLocation,
|
|
7
|
+
useNavigationType,
|
|
8
|
+
} from "react-router-dom";
|
|
9
|
+
|
|
10
|
+
export const initSentry = ({ dsn }: { dsn: string }) => {
|
|
11
|
+
Sentry.init({
|
|
12
|
+
dsn,
|
|
13
|
+
integrations: [
|
|
14
|
+
Sentry.reactRouterV6BrowserTracingIntegration({
|
|
15
|
+
useEffect,
|
|
16
|
+
useLocation,
|
|
17
|
+
useNavigationType,
|
|
18
|
+
createRoutesFromChildren,
|
|
19
|
+
matchRoutes,
|
|
20
|
+
}),
|
|
21
|
+
Sentry.replayIntegration(),
|
|
22
|
+
],
|
|
23
|
+
});
|
|
24
|
+
};
|