zudoku 0.3.0-dev.95 → 0.3.0-dev.96
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/app/demo.d.ts +1 -1
- package/dist/app/demo.js +43 -24
- package/dist/app/demo.js.map +1 -1
- package/dist/app/main.js +1 -0
- package/dist/app/main.js.map +1 -1
- package/dist/app/standalone.d.ts +1 -1
- package/dist/app/standalone.js +37 -26
- package/dist/app/standalone.js.map +1 -1
- package/dist/config/validators/validate.d.ts +6 -0
- package/dist/config/validators/validate.js +1 -0
- package/dist/config/validators/validate.js.map +1 -1
- package/dist/lib/components/Bootstrap.d.ts +3 -3
- package/dist/lib/components/Bootstrap.js.map +1 -1
- package/dist/lib/components/Layout.js +1 -1
- package/dist/lib/components/Layout.js.map +1 -1
- package/dist/lib/components/index.d.ts +1 -1
- package/dist/lib/util/joinPath.js +1 -1
- package/dist/lib/util/joinPath.js.map +1 -1
- package/dist/vite/plugin-api.js +2 -7
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-component.d.ts +2 -2
- package/dist/vite/plugin-component.js +4 -3
- package/dist/vite/plugin-component.js.map +1 -1
- package/dist/vite/plugin.js +2 -2
- package/dist/vite/plugin.js.map +1 -1
- package/lib/{MdxPage-3-PenZs2.js → MdxPage-oN3huD58.js} +2 -2
- package/lib/{MdxPage-3-PenZs2.js.map → MdxPage-oN3huD58.js.map} +1 -1
- package/lib/{OperationList-BAZX1Gla.js → OperationList-Ctj0ihBN.js} +2 -2
- package/lib/{OperationList-BAZX1Gla.js.map → OperationList-Ctj0ihBN.js.map} +1 -1
- package/lib/{Route-Cq7WBHPC.js → Route-DAF15JAU.js} +2 -2
- package/lib/{Route-Cq7WBHPC.js.map → Route-DAF15JAU.js.map} +1 -1
- package/lib/{index-DGb_offs.js → index-CtKkHGcd.js} +4 -4
- package/lib/{index-DGb_offs.js.map → index-CtKkHGcd.js.map} +1 -1
- package/lib/{joinPath-VeNuJa7y.js → joinPath-B7kNnUX4.js} +2 -2
- package/lib/{joinPath-VeNuJa7y.js.map → joinPath-B7kNnUX4.js.map} +1 -1
- package/lib/{utils-D3g3xyZM.js → utils-Bh4upQ0e.js} +2 -2
- package/lib/{utils-D3g3xyZM.js.map → utils-Bh4upQ0e.js.map} +1 -1
- package/lib/zudoku.components.js +3 -2
- package/lib/zudoku.components.js.map +1 -1
- package/lib/zudoku.plugin-markdown.js +1 -1
- package/lib/zudoku.plugin-openapi.js +2 -2
- package/package.json +2 -2
- package/src/app/demo.tsx +51 -36
- package/src/app/main.tsx +1 -0
- package/src/app/standalone.tsx +40 -39
- package/src/lib/components/Bootstrap.tsx +3 -2
- package/src/lib/components/Layout.tsx +3 -0
- package/src/lib/util/joinPath.tsx +1 -1
|
@@ -6,7 +6,7 @@ const u = (t, e) => Object.entries(t).flatMap(([a, r]) => {
|
|
|
6
6
|
return {
|
|
7
7
|
path: s.at(-1) === "index" ? s.slice(0, -1).join("/") : o,
|
|
8
8
|
lazy: async () => {
|
|
9
|
-
const { MdxPage: i } = await import("./MdxPage-
|
|
9
|
+
const { MdxPage: i } = await import("./MdxPage-oN3huD58.js"), { default: p, ...c } = await r();
|
|
10
10
|
return {
|
|
11
11
|
element: /* @__PURE__ */ m.jsx(
|
|
12
12
|
i,
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import "./jsx-runtime-B6kdoens.js";
|
|
2
|
-
import { o as l } from "./index-
|
|
2
|
+
import { o as l } from "./index-CtKkHGcd.js";
|
|
3
3
|
import "./urql-DrBfkb92.js";
|
|
4
4
|
import "./ZudokuContext-BIZ8zHbZ.js";
|
|
5
5
|
import "zudoku/openapi-worker";
|
|
6
6
|
import "./Combination-D-9IH0zy.js";
|
|
7
7
|
import "./Markdown-B_Gax7at.js";
|
|
8
|
-
import "./joinPath-
|
|
8
|
+
import "./joinPath-B7kNnUX4.js";
|
|
9
9
|
import "./router-BiRCp01d.js";
|
|
10
10
|
import "./index-7kcHaXD6.js";
|
|
11
11
|
export {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "zudoku",
|
|
3
|
-
"version": "0.3.0-dev.
|
|
3
|
+
"version": "0.3.0-dev.96",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
@@ -185,7 +185,7 @@
|
|
|
185
185
|
"scripts": {
|
|
186
186
|
"build": "tsc --project tsconfig.json",
|
|
187
187
|
"build:vite": "vite build && pnpm run hack:fix-worker-paths lib",
|
|
188
|
-
"build:standalone:vite": "vite build --config vite.standalone.config.ts",
|
|
188
|
+
"build:standalone:vite": "vite build --mode standalone --config vite.standalone.config.ts",
|
|
189
189
|
"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",
|
|
190
190
|
"hack:fix-worker-paths": "node ./scripts/hack-worker.mjs",
|
|
191
191
|
"clean": "tsc --build --clean",
|
package/src/app/demo.tsx
CHANGED
|
@@ -1,46 +1,61 @@
|
|
|
1
|
-
import { StrictMode } from "react";
|
|
2
|
-
import { createRoot } from "react-dom/client";
|
|
3
|
-
|
|
4
|
-
// Styles
|
|
5
|
-
import "./main.css";
|
|
6
|
-
|
|
7
|
-
// Logger
|
|
8
1
|
import logger from "loglevel";
|
|
2
|
+
import { createRoot } from "react-dom/client";
|
|
3
|
+
import { createBrowserRouter } from "react-router-dom";
|
|
4
|
+
import { Bootstrap } from "zudoku/components";
|
|
5
|
+
import type { ZudokuConfig } from "../config/validators/validate.js";
|
|
6
|
+
import { openApiPlugin } from "../lib/plugins/openapi/index.js";
|
|
9
7
|
import "../lib/util/logInit.js";
|
|
8
|
+
import "./main.css";
|
|
9
|
+
import { getRoutesByConfig } from "./main.js";
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
import { DevPortal } from "../lib/components/DevPortal.js";
|
|
11
|
+
const apiUrl = new URL(window.location.href).searchParams.get("api-url");
|
|
13
12
|
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
if (!apiUrl) {
|
|
14
|
+
throw new Error(
|
|
15
|
+
"No API URL in query parameters. Please provide an API URL using the `api-url` query parameter.",
|
|
16
|
+
);
|
|
17
|
+
}
|
|
16
18
|
|
|
17
|
-
const apiUrl = new URL(window.location.href).searchParams.get("api-url");
|
|
18
19
|
logger.info(`API URL: ${apiUrl}`);
|
|
19
20
|
|
|
21
|
+
const root = document.getElementById("root");
|
|
22
|
+
|
|
23
|
+
if (!root) {
|
|
24
|
+
throw new Error("No div found with id root");
|
|
25
|
+
}
|
|
26
|
+
|
|
20
27
|
// IMPORTANT: This component must not contain tailwind classes
|
|
21
28
|
// This directory is not processed by the tailwind plugin
|
|
22
29
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
)
|
|
30
|
+
const config = {
|
|
31
|
+
page: {
|
|
32
|
+
logo: {
|
|
33
|
+
src: {
|
|
34
|
+
light: "https://cdn.zudoku.dev/logos/icon.svg",
|
|
35
|
+
dark: "https://cdn.zudoku.dev/logos/icon.svg",
|
|
36
|
+
},
|
|
37
|
+
},
|
|
38
|
+
pageTitle: "Developer Portal",
|
|
39
|
+
},
|
|
40
|
+
topNavigation: [
|
|
41
|
+
{
|
|
42
|
+
id: "/",
|
|
43
|
+
label: "API Reference",
|
|
44
|
+
},
|
|
45
|
+
],
|
|
46
|
+
plugins: [
|
|
47
|
+
// Using the plugin directly because there's no config file to load in the virtual plugins
|
|
48
|
+
openApiPlugin({
|
|
49
|
+
type: "url",
|
|
50
|
+
input: apiUrl,
|
|
51
|
+
navigationId: "/",
|
|
52
|
+
inMemory: true,
|
|
53
|
+
}),
|
|
54
|
+
],
|
|
55
|
+
} satisfies ZudokuConfig;
|
|
56
|
+
|
|
57
|
+
const routes = getRoutesByConfig(config);
|
|
58
|
+
const router = createBrowserRouter(routes, {
|
|
59
|
+
basename: "/demo",
|
|
60
|
+
});
|
|
61
|
+
createRoot(root).render(<Bootstrap router={router} />);
|
package/src/app/main.tsx
CHANGED
package/src/app/standalone.tsx
CHANGED
|
@@ -1,20 +1,14 @@
|
|
|
1
|
-
import { StrictMode } from "react";
|
|
2
1
|
import { createRoot } from "react-dom/client";
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
import "
|
|
6
|
-
|
|
7
|
-
// Logger
|
|
8
|
-
import "../lib/util/logInit.js";
|
|
9
|
-
|
|
10
|
-
// Base React Component
|
|
11
|
-
import { DevPortal } from "../lib/components/DevPortal.js";
|
|
12
|
-
|
|
13
|
-
// Plugins
|
|
2
|
+
import { createBrowserRouter } from "react-router-dom";
|
|
3
|
+
import { Bootstrap } from "zudoku/components";
|
|
4
|
+
import type { ZudokuConfig } from "../config/validators/validate.js";
|
|
14
5
|
import { openApiPlugin } from "../lib/plugins/openapi/index.js";
|
|
6
|
+
import "../lib/util/logInit.js";
|
|
7
|
+
import "./main.css";
|
|
8
|
+
import { getRoutesByConfig } from "./main.js";
|
|
15
9
|
|
|
16
|
-
const root = document.querySelector("[data-api-url]");
|
|
17
|
-
if (!root
|
|
10
|
+
const root = document.querySelector("div[data-api-url]");
|
|
11
|
+
if (!root) {
|
|
18
12
|
throw new Error("No div found with attribute data-api-url");
|
|
19
13
|
}
|
|
20
14
|
|
|
@@ -25,28 +19,35 @@ const logoUrl = root.getAttribute("data-logo-url");
|
|
|
25
19
|
// IMPORTANT: This component must not contain tailwind classes
|
|
26
20
|
// This directory is not processed by the tailwind plugin
|
|
27
21
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
22
|
+
const config = {
|
|
23
|
+
page: {
|
|
24
|
+
logo: {
|
|
25
|
+
src: {
|
|
26
|
+
light: logoUrl ?? "https://cdn.zudoku.dev/logos/icon.svg",
|
|
27
|
+
dark: logoUrl ?? "https://cdn.zudoku.dev/logos/icon.svg",
|
|
28
|
+
},
|
|
29
|
+
},
|
|
30
|
+
pageTitle: pageTitle ?? "Developer Portal",
|
|
31
|
+
},
|
|
32
|
+
topNavigation: [
|
|
33
|
+
{
|
|
34
|
+
id: "/",
|
|
35
|
+
label: "API Reference",
|
|
36
|
+
},
|
|
37
|
+
],
|
|
38
|
+
plugins: [
|
|
39
|
+
// Using the plugin directly because there's no config file to load in the virtual plugins
|
|
40
|
+
openApiPlugin({
|
|
41
|
+
type: "url",
|
|
42
|
+
input: apiUrl!,
|
|
43
|
+
navigationId: "/",
|
|
44
|
+
inMemory: true,
|
|
45
|
+
}),
|
|
46
|
+
],
|
|
47
|
+
} satisfies ZudokuConfig;
|
|
48
|
+
|
|
49
|
+
const routes = getRoutesByConfig(config);
|
|
50
|
+
const router = createBrowserRouter(routes, {
|
|
51
|
+
basename: "/standalone",
|
|
52
|
+
});
|
|
53
|
+
createRoot(root).render(<Bootstrap router={router} />);
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { type HelmetData, HelmetProvider } from "@zudoku/react-helmet-async";
|
|
2
2
|
import { StrictMode } from "react";
|
|
3
|
-
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
|
3
|
+
import { type createBrowserRouter, RouterProvider } from "react-router-dom";
|
|
4
4
|
import {
|
|
5
|
+
type createStaticRouter,
|
|
5
6
|
type StaticHandlerContext,
|
|
6
7
|
StaticRouterProvider,
|
|
7
8
|
} from "react-router-dom/server.js";
|
|
@@ -32,7 +33,7 @@ const BootstrapStatic = ({
|
|
|
32
33
|
}: {
|
|
33
34
|
helmetContext: HelmetData["context"];
|
|
34
35
|
context: StaticHandlerContext;
|
|
35
|
-
router: ReturnType<typeof
|
|
36
|
+
router: ReturnType<typeof createStaticRouter>;
|
|
36
37
|
}) => (
|
|
37
38
|
<StrictMode>
|
|
38
39
|
<HelmetProvider context={helmetContext}>
|
|
@@ -31,6 +31,9 @@ export const Layout = ({ children }: { children?: ReactNode }) => {
|
|
|
31
31
|
|
|
32
32
|
return (
|
|
33
33
|
<>
|
|
34
|
+
{import.meta.env.MODE === "standalone" && (
|
|
35
|
+
<style>{`:root { --top-nav-height: 0px; }`}</style>
|
|
36
|
+
)}
|
|
34
37
|
<Helmet titleTemplate={meta?.title}>
|
|
35
38
|
{meta?.description && (
|
|
36
39
|
<meta name="description" content={meta.description} />
|