zudoku 0.1.1-dev.11 → 0.1.1-dev.13
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/DevPortal.js +2 -15
- package/dist/app/DevPortal.js.map +1 -1
- package/dist/app/Router.d.ts +4 -0
- package/dist/app/Router.js +20 -0
- package/dist/app/Router.js.map +1 -0
- package/dist/vite/config.d.ts +2 -2
- package/dist/vite/config.js +18 -8
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/plugin-api.js +1 -1
- package/dist/vite/plugin-api.js.map +1 -1
- package/dist/vite/plugin-auth.js +1 -1
- package/dist/vite/plugin-docs.js +1 -1
- package/dist/vite/plugin-docs.js.map +1 -1
- package/package.json +4 -3
- package/src/app/App.tsx +0 -30
- package/src/app/DevPortal.tsx +0 -115
- package/src/app/Heading.tsx +0 -60
- package/src/app/authentication/authentication.ts +0 -18
- package/src/app/authentication/clerk.ts +0 -47
- package/src/app/authentication/openid.ts +0 -192
- package/src/app/components/AnchorLink.tsx +0 -19
- package/src/app/components/CategoryHeading.tsx +0 -16
- package/src/app/components/Dialog.tsx +0 -119
- package/src/app/components/DynamicIcon.tsx +0 -60
- package/src/app/components/Header.tsx +0 -69
- package/src/app/components/Input.tsx +0 -24
- package/src/app/components/Layout.tsx +0 -56
- package/src/app/components/Markdown.tsx +0 -37
- package/src/app/components/SyntaxHighlight.tsx +0 -94
- package/src/app/components/TopNavigation.tsx +0 -32
- package/src/app/components/context/ComponentsContext.tsx +0 -24
- package/src/app/components/context/DevPortalProvider.ts +0 -54
- package/src/app/components/context/PluginSystem.ts +0 -0
- package/src/app/components/context/ThemeContext.tsx +0 -46
- package/src/app/components/context/ViewportAnchorContext.tsx +0 -139
- package/src/app/components/navigation/SideNavigation.tsx +0 -18
- package/src/app/components/navigation/SideNavigationCategory.tsx +0 -74
- package/src/app/components/navigation/SideNavigationItem.tsx +0 -143
- package/src/app/components/navigation/SideNavigationWrapper.tsx +0 -15
- package/src/app/components/navigation/useNavigationCollapsibleState.ts +0 -27
- package/src/app/components/navigation/util.ts +0 -38
- package/src/app/core/DevPortalContext.ts +0 -164
- package/src/app/core/helmet.ts +0 -5
- package/src/app/core/icons.tsx +0 -1
- package/src/app/core/plugins.ts +0 -43
- package/src/app/core/router.tsx +0 -1
- package/src/app/core/types/combine.ts +0 -16
- package/src/app/main.tsx +0 -9
- package/src/app/oas/graphql/index.ts +0 -422
- package/src/app/oas/graphql/server.ts +0 -10
- package/src/app/oas/parser/dereference/index.ts +0 -59
- package/src/app/oas/parser/dereference/resolveRef.ts +0 -32
- package/src/app/oas/parser/index.ts +0 -94
- package/src/app/oas/parser/schemas/v3.0.json +0 -1489
- package/src/app/oas/parser/schemas/v3.1.json +0 -1298
- package/src/app/oas/parser/upgrade/index.ts +0 -108
- package/src/app/plugins/api-key/SettingsApiKeys.tsx +0 -22
- package/src/app/plugins/api-key/index.tsx +0 -123
- package/src/app/plugins/markdown/MdxPage.tsx +0 -128
- package/src/app/plugins/markdown/Toc.tsx +0 -122
- package/src/app/plugins/markdown/generateRoutes.tsx +0 -72
- package/src/app/plugins/markdown/index.tsx +0 -31
- package/src/app/plugins/openapi/ColorizedParam.tsx +0 -82
- package/src/app/plugins/openapi/MakeRequest.tsx +0 -49
- package/src/app/plugins/openapi/MethodBadge.tsx +0 -36
- package/src/app/plugins/openapi/OperationList.tsx +0 -117
- package/src/app/plugins/openapi/OperationListItem.tsx +0 -55
- package/src/app/plugins/openapi/ParameterList.tsx +0 -32
- package/src/app/plugins/openapi/ParameterListItem.tsx +0 -60
- package/src/app/plugins/openapi/RequestBodySidecarBox.tsx +0 -51
- package/src/app/plugins/openapi/ResponsesSidecarBox.tsx +0 -60
- package/src/app/plugins/openapi/Select.tsx +0 -35
- package/src/app/plugins/openapi/Sidecar.tsx +0 -160
- package/src/app/plugins/openapi/SidecarBox.tsx +0 -36
- package/src/app/plugins/openapi/graphql/fragment-masking.ts +0 -111
- package/src/app/plugins/openapi/graphql/gql.ts +0 -70
- package/src/app/plugins/openapi/graphql/graphql.ts +0 -795
- package/src/app/plugins/openapi/graphql/index.ts +0 -2
- package/src/app/plugins/openapi/index.tsx +0 -142
- package/src/app/plugins/openapi/playground/Playground.tsx +0 -309
- package/src/app/plugins/openapi/queries.graphql +0 -6
- package/src/app/plugins/openapi/util/generateSchemaExample.ts +0 -59
- package/src/app/plugins/openapi/util/urql.ts +0 -8
- package/src/app/plugins/openapi/worker/createSharedWorkerClient.ts +0 -60
- package/src/app/plugins/openapi/worker/worker.ts +0 -30
- package/src/app/plugins/redirect/index.tsx +0 -20
- package/src/app/tailwind.ts +0 -72
- package/src/app/ui/Button.tsx +0 -56
- package/src/app/ui/Callout.tsx +0 -87
- package/src/app/ui/Card.tsx +0 -82
- package/src/app/ui/Note.tsx +0 -58
- package/src/app/ui/Tabs.tsx +0 -52
- package/src/app/util/MdxComponents.tsx +0 -70
- package/src/app/util/cn.ts +0 -6
- package/src/app/util/createVariantComponent.tsx +0 -30
- package/src/app/util/createWaitForNotify.ts +0 -18
- package/src/app/util/groupBy.ts +0 -24
- package/src/app/util/joinPath.tsx +0 -10
- package/src/app/util/pastellize.ts +0 -25
- package/src/app/util/slugify.ts +0 -3
- package/src/app/util/traverseNavigation.ts +0 -55
- package/src/app/util/useScrollToAnchor.ts +0 -38
- package/src/app/util/useScrollToTop.ts +0 -13
- /package/{src → dist}/app/main.css +0 -0
package/dist/app/DevPortal.js
CHANGED
|
@@ -2,38 +2,25 @@ import { jsx as _jsx } from "react/jsx-runtime";
|
|
|
2
2
|
import { MDXProvider } from "@mdx-js/react";
|
|
3
3
|
import { QueryClientProvider } from "@tanstack/react-query";
|
|
4
4
|
import { memo, Suspense, useEffect, useMemo } from "react";
|
|
5
|
-
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
|
6
5
|
import { ComponentsProvider, DEFAULT_COMPONENTS, } from "./components/context/ComponentsContext.js";
|
|
7
6
|
import { DevPortalProvider } from "./components/context/DevPortalProvider.js";
|
|
8
7
|
import { ThemeProvider } from "./components/context/ThemeContext.js";
|
|
9
8
|
import { ViewportAnchorProvider } from "./components/context/ViewportAnchorContext.js";
|
|
10
|
-
import { Layout } from "./components/Layout.js";
|
|
11
9
|
import { DevPortalContext, queryClient, } from "./core/DevPortalContext.js";
|
|
12
10
|
import { HelmetProvider } from "./core/helmet.js";
|
|
13
|
-
import {
|
|
11
|
+
import { Router } from "./Router.js";
|
|
14
12
|
import { MdxComponents } from "./util/MdxComponents.js";
|
|
15
13
|
export const DevPortalSystemPaths = {
|
|
16
14
|
Settings: "/settings",
|
|
17
15
|
};
|
|
18
16
|
const DevPortal = (props) => {
|
|
19
|
-
const router = useMemo(() => {
|
|
20
|
-
const routes = (props.plugins ?? []).flatMap((plugin) => isNavigationPlugin(plugin) ? plugin.getRoutes() : []);
|
|
21
|
-
return createBrowserRouter([
|
|
22
|
-
{
|
|
23
|
-
path: "/",
|
|
24
|
-
element: _jsx(Layout, {}),
|
|
25
|
-
errorElement: (_jsx(Layout, { children: _jsx("div", { className: "h-[75vh] flex items-center justify-center", children: "Error, look at the console" }) })),
|
|
26
|
-
children: routes,
|
|
27
|
-
},
|
|
28
|
-
]);
|
|
29
|
-
}, [props.plugins]);
|
|
30
17
|
const components = useMemo(() => ({ ...DEFAULT_COMPONENTS, ...props.overrides }), [props.overrides]);
|
|
31
18
|
const mdxComponents = useMemo(() => ({ ...MdxComponents, ...props.mdxComponents }), [props.mdxComponents]);
|
|
32
19
|
const devPortalContext = useMemo(() => new DevPortalContext(props), [props]);
|
|
33
20
|
useEffect(() => {
|
|
34
21
|
void devPortalContext.initialize();
|
|
35
22
|
}, [devPortalContext]);
|
|
36
|
-
return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(HelmetProvider, { children: _jsx(DevPortalProvider, { value: devPortalContext, children: _jsx(MDXProvider, { components: mdxComponents, children: _jsx(ThemeProvider, { children: _jsx(ComponentsProvider, { value: components, children: _jsx(ViewportAnchorProvider, { children: _jsx(Suspense, { fallback: _jsx("div", { className: "grid place-items-center h-full", children: "Loading..." }), children: _jsx(
|
|
23
|
+
return (_jsx(QueryClientProvider, { client: queryClient, children: _jsx(HelmetProvider, { children: _jsx(DevPortalProvider, { value: devPortalContext, children: _jsx(MDXProvider, { components: mdxComponents, children: _jsx(ThemeProvider, { children: _jsx(ComponentsProvider, { value: components, children: _jsx(ViewportAnchorProvider, { children: _jsx(Suspense, { fallback: _jsx("div", { className: "grid place-items-center h-full", children: "Loading..." }), children: _jsx(Router, { plugins: props.plugins }) }) }) }) }) }) }) }) }));
|
|
37
24
|
};
|
|
38
25
|
const MemoDevPortal = memo(DevPortal);
|
|
39
26
|
MemoDevPortal.displayName = "DevPortal";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DevPortal.js","sourceRoot":"","sources":["../../src/app/DevPortal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"DevPortal.js","sourceRoot":"","sources":["../../src/app/DevPortal.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAC5C,OAAO,EAAE,mBAAmB,EAAE,MAAM,uBAAuB,CAAC;AAC5D,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,SAAS,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAE3D,OAAO,EACL,kBAAkB,EAClB,kBAAkB,GAEnB,MAAM,2CAA2C,CAAC;AACnD,OAAO,EAAE,iBAAiB,EAAE,MAAM,2CAA2C,CAAC;AAC9E,OAAO,EAAE,aAAa,EAAE,MAAM,sCAAsC,CAAC;AACrE,OAAO,EAAE,sBAAsB,EAAE,MAAM,+CAA+C,CAAC;AAC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CAAgC,2BAEzC,YAGR,KAAC,MAAM,IAAC,OAAO,EAAE,KAAK,CAAC,OAAO,GAAI,GACzB,GACY,GACN,GACP,GACJ,GACI,GACL,GACG,CACvB,CAAC;AACJ,CAAC,CAAC;AAEF,MAAM,aAAa,GAAG,IAAI,CAAC,SAAS,CAAC,CAAC;AACtC,aAAa,CAAC,WAAW,GAAG,WAAW,CAAC;AAExC,eAAe,aAAa,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useMemo } from "react";
|
|
3
|
+
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
|
4
|
+
import { Layout } from "./components/Layout.js";
|
|
5
|
+
import { isNavigationPlugin } from "./core/plugins.js";
|
|
6
|
+
export function Router({ plugins }) {
|
|
7
|
+
const router = useMemo(() => {
|
|
8
|
+
const routes = (plugins ?? []).flatMap((plugin) => isNavigationPlugin(plugin) ? plugin.getRoutes() : []);
|
|
9
|
+
return createBrowserRouter([
|
|
10
|
+
{
|
|
11
|
+
path: "/",
|
|
12
|
+
element: _jsx(Layout, {}),
|
|
13
|
+
errorElement: (_jsx(Layout, { children: _jsx("div", { className: "h-[75vh] flex items-center justify-center", children: "Error, look at the console" }) })),
|
|
14
|
+
children: routes,
|
|
15
|
+
},
|
|
16
|
+
]);
|
|
17
|
+
}, [plugins]);
|
|
18
|
+
return _jsx(RouterProvider, { router: router });
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=Router.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Router.js","sourceRoot":"","sources":["../../src/app/Router.tsx"],"names":[],"mappings":";AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,OAAO,CAAC;AAChC,OAAO,EAAE,mBAAmB,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AACvE,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAC;AAChD,OAAO,EAAmB,kBAAkB,EAAE,MAAM,mBAAmB,CAAC;AAExE,MAAM,UAAU,MAAM,CAAC,EAAE,OAAO,EAAmC;IACjE,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,EAAE;QAC1B,MAAM,MAAM,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,MAAM,EAAE,EAAE,CAChD,kBAAkB,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC,EAAE,CACrD,CAAC;QAEF,OAAO,mBAAmB,CAAC;YACzB;gBACE,IAAI,EAAE,GAAG;gBACT,OAAO,EAAE,KAAC,MAAM,KAAG;gBACnB,YAAY,EAAE,CACZ,KAAC,MAAM,cACL,cAAK,SAAS,EAAC,2CAA2C,2CAEpD,GACC,CACV;gBACD,QAAQ,EAAE,MAAM;aACjB;SACF,CAAC,CAAC;IACL,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,CAAC;IACd,OAAO,KAAC,cAAc,IAAC,MAAM,EAAE,MAAM,GAAI,CAAC;AAC5C,CAAC"}
|
package/dist/vite/config.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { InlineConfig } from "vite";
|
|
2
2
|
import { ZudokuConfig } from "../config/config.js";
|
|
3
3
|
export declare function loadZuploConfig(rootDir: string): Promise<ZudokuConfig>;
|
|
4
|
-
export declare function getAppDir(): string;
|
|
5
|
-
export declare function getAppMainTsxPath(): string;
|
|
4
|
+
export declare function getAppDir(internalDevMode?: boolean): string;
|
|
5
|
+
export declare function getAppMainTsxPath(internalDevMode?: boolean): string;
|
|
6
6
|
export declare function getViteConfig(dir: string): Promise<InlineConfig>;
|
|
7
7
|
export declare function loadConfig(rootPath: string, fileName: string): Promise<any>;
|
package/dist/vite/config.js
CHANGED
|
@@ -30,18 +30,23 @@ export async function loadZuploConfig(rootDir) {
|
|
|
30
30
|
logger.warn("No zudoku.config file found");
|
|
31
31
|
return {};
|
|
32
32
|
}
|
|
33
|
-
export function getAppDir() {
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
33
|
+
export function getAppDir(internalDevMode = false) {
|
|
34
|
+
if (internalDevMode) {
|
|
35
|
+
// NOTE: This is relative to the /dist folder because the dev server
|
|
36
|
+
// runs the compiled JS files, but vite uses the raw TS files
|
|
37
|
+
return new URL("../../src/app", import.meta.url).pathname;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return new URL("../app", import.meta.url).pathname;
|
|
41
|
+
}
|
|
37
42
|
}
|
|
38
|
-
export function getAppMainTsxPath() {
|
|
39
|
-
const appDir = getAppDir();
|
|
40
|
-
return path.join(appDir, "main.tsx");
|
|
43
|
+
export function getAppMainTsxPath(internalDevMode = false) {
|
|
44
|
+
const appDir = getAppDir(internalDevMode);
|
|
45
|
+
return path.join(appDir, internalDevMode ? "main.tsx" : "main.js");
|
|
41
46
|
}
|
|
42
47
|
export async function getViteConfig(dir) {
|
|
43
48
|
const rootDir = path.resolve(process.cwd(), dir);
|
|
44
|
-
const appDir = getAppDir();
|
|
49
|
+
const appDir = getAppDir(!!process.env.NX_TASK_TARGET_PROJECT);
|
|
45
50
|
const config = await loadZuploConfig(rootDir);
|
|
46
51
|
let websocketPort = 9800;
|
|
47
52
|
while (!(await isPortAvailable("localhost", websocketPort)) &&
|
|
@@ -76,6 +81,11 @@ export async function getViteConfig(dir) {
|
|
|
76
81
|
},
|
|
77
82
|
build: {
|
|
78
83
|
outDir: path.resolve(rootDir, "out"),
|
|
84
|
+
rollupOptions: {
|
|
85
|
+
output: {
|
|
86
|
+
interop: "auto",
|
|
87
|
+
},
|
|
88
|
+
},
|
|
79
89
|
},
|
|
80
90
|
optimizeDeps: {
|
|
81
91
|
include: [
|
package/dist/vite/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/vite/config.ts"],"names":[],"mappings":"AAAA,OAAO,YAAY,MAAM,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AAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC;QACrD,GAAG,EAAE;YACH,OAAO,EAAE;gBACP,OAAO,EAAE;oBACP,WAAW,CAAC;wBACV,GAAG,cAAc;wBACjB,OAAO,EAAE;4BACP,GAAG,MAAM,8BAA8B;4BACvC,GAAG,OAAO,kCAAkC;yBAC7C;qBACF,CAAC;oBACF,YAAY;iBACb;aACF;SACF;KACF,CAAC;IAEF,OAAO,UAAU,CAAC;AACpB,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,UAAU,CAAC,QAAgB,EAAE,QAAgB;IACjE,MAAM,gBAAgB,GAAG,IAAI,CAAC,IAAI,CAChC,QAAQ,EACR,cAAc,EACd,SAAS,EACT,mBAAmB,CACpB,CAAC;IACF,MAAM,QAAQ,GAAG,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE,QAAQ,CAAC,CAAC;IAC/C,IAAI,CAAC;QACH,MAAM,OAAO,CAAC,KAAK,CAAC;YAClB,WAAW,EAAE,CAAC,QAAQ,CAAC;YACvB,MAAM,EAAE,IAAI;YACZ,SAAS,EAAE,IAAI;YACf,WAAW,EAAE,IAAI;YACjB,iBAAiB,EAAE,KAAK;YACxB,YAAY,EAAE,KAAK;YACnB,gBAAgB,EAAE,KAAK;YACvB,QAAQ,EAAE,MAAM;YAChB,MAAM,EAAE,QAAQ;YAChB,MAAM,EAAE,KAAK;YACb,OAAO,EAAE,gBAAgB;SAC1B,CAAC,CAAC;IACL,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,KAAK,CAAC,OAAO,GAAG,uBAAuB,QAAQ,MAAM,KAAK,CAAC,OAAO,EAAE,CAAC;QACrE,MAAM,KAAK,CAAC;IACd,CAAC;IACD,OAAO,MAAM,MAAM,CAAC,gBAAgB,CAAC,CAAC;AACxC,CAAC"}
|
package/dist/vite/plugin-api.js
CHANGED
|
@@ -15,7 +15,7 @@ const viteApiPlugin = (config) => {
|
|
|
15
15
|
// IMPORTANT! This path here is important, we MUST resolve
|
|
16
16
|
// files here as Typescript from the appDir
|
|
17
17
|
getConfigExportCode(config.rootDir),
|
|
18
|
-
`import { openApiPlugin } from "${config.appDir}/plugins/openapi/index.
|
|
18
|
+
`import { openApiPlugin } from "${config.appDir}/plugins/openapi/index.js";`,
|
|
19
19
|
`const configuredApiPlugins = [];`,
|
|
20
20
|
];
|
|
21
21
|
if (config?.apis) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-api.js","sourceRoot":"","sources":["../../src/vite/plugin-api.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,aAAa,GAAG,CAAC,MAA2B,EAAU,EAAE;IAC5D,MAAM,eAAe,GAAG,4BAA4B,CAAC;IACrD,MAAM,uBAAuB,GAAG,IAAI,GAAG,eAAe,CAAC;IAEvD,OAAO;QACL,IAAI,EAAE,yBAAyB;QAC/B,SAAS,CAAC,EAAE;YACV,IAAI,EAAE,KAAK,eAAe,EAAE,CAAC;gBAC3B,OAAO,uBAAuB,CAAC;YACjC,CAAC;QACH,CAAC;QACD,IAAI,CAAC,EAAE;YACL,IAAI,EAAE,KAAK,uBAAuB,EAAE,CAAC;gBACnC,MAAM,IAAI,GAAa;oBACrB,0DAA0D;oBAC1D,2CAA2C;oBAC3C,mBAAmB,CAAC,MAAM,CAAC,OAAO,CAAC;oBACnC,kCAAkC,MAAM,CAAC,MAAM,
|
|
1
|
+
{"version":3,"file":"plugin-api.js","sourceRoot":"","sources":["../../src/vite/plugin-api.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAC;AAEzD,MAAM,aAAa,GAAG,CAAC,MAA2B,EAAU,EAAE;IAC5D,MAAM,eAAe,GAAG,4BAA4B,CAAC;IACrD,MAAM,uBAAuB,GAAG,IAAI,GAAG,eAAe,CAAC;IAEvD,OAAO;QACL,IAAI,EAAE,yBAAyB;QAC/B,SAAS,CAAC,EAAE;YACV,IAAI,EAAE,KAAK,eAAe,EAAE,CAAC;gBAC3B,OAAO,uBAAuB,CAAC;YACjC,CAAC;QACH,CAAC;QACD,IAAI,CAAC,EAAE;YACL,IAAI,EAAE,KAAK,uBAAuB,EAAE,CAAC;gBACnC,MAAM,IAAI,GAAa;oBACrB,0DAA0D;oBAC1D,2CAA2C;oBAC3C,mBAAmB,CAAC,MAAM,CAAC,OAAO,CAAC;oBACnC,kCAAkC,MAAM,CAAC,MAAM,6BAA6B;oBAC5E,kCAAkC;iBACnC,CAAC;gBAEF,IAAI,MAAM,EAAE,IAAI,EAAE,CAAC;oBACjB,IAAI,KAAK,CAAC,OAAO,CAAC,MAAM,CAAC,IAAI,CAAC,EAAE,CAAC;wBAC/B,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;4BAC3B,IAAI,CAAC,IAAI,CACP,GAAG;gCACD,eAAe,EAAE,qBAAqB;gCACtC,wDAAwD,CAAC,MAAM;6BAChE,CACF,CAAC;wBACJ,CAAC,CAAC,CAAC;oBACL,CAAC;yBAAM,CAAC;wBACN,IAAI,CAAC,IAAI,CACP,GAAG;4BACD,eAAe,EAAE,qBAAqB;4BACtC,wDAAwD;yBACzD,CACF,CAAC;oBACJ,CAAC;gBACH,CAAC;gBAED,IAAI,CAAC,IAAI,CAAC,kCAAkC,CAAC,CAAC;gBAE9C,OAAO;oBACL,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;oBACrB,GAAG,EAAE,IAAI;iBACV,CAAC;YACJ,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC,CAAC;AAEF,eAAe,aAAa,CAAC"}
|
package/dist/vite/plugin-auth.js
CHANGED
|
@@ -18,7 +18,7 @@ const viteAuthPlugin = (config) => {
|
|
|
18
18
|
// TODO: Validate that the authConfig.type is a valid authentication provider
|
|
19
19
|
return [
|
|
20
20
|
getConfigExportCode(config.rootDir),
|
|
21
|
-
`import authProvider from "${path.join(config.appDir, "authentication", `${config.authentication.type}.
|
|
21
|
+
`import authProvider from "${path.join(config.appDir, "authentication", `${config.authentication.type}.js`)}";`,
|
|
22
22
|
`export const configuredAuthProvider = authProvider(config.authentication);`,
|
|
23
23
|
].join("\n");
|
|
24
24
|
}
|
package/dist/vite/plugin-docs.js
CHANGED
|
@@ -13,7 +13,7 @@ const viteDocsPlugin = (config) => {
|
|
|
13
13
|
const code = [
|
|
14
14
|
// IMPORTANT! This path here is important, we MUST resolve
|
|
15
15
|
// files here as Typescript from the appDir
|
|
16
|
-
`import { markdownPlugin } from "${config.appDir}/plugins/markdown/index.
|
|
16
|
+
`import { markdownPlugin } from "${config.appDir}/plugins/markdown/index.js";`,
|
|
17
17
|
`const configuredDocsPlugins = [];`,
|
|
18
18
|
];
|
|
19
19
|
const docsConfigs = config?.docs
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin-docs.js","sourceRoot":"","sources":["../../src/vite/plugin-docs.ts"],"names":[],"mappings":"AAGA,MAAM,cAAc,GAAG,CAAC,MAA2B,EAAU,EAAE;IAC7D,MAAM,eAAe,GAAG,6BAA6B,CAAC;IACtD,MAAM,uBAAuB,GAAG,IAAI,GAAG,eAAe,CAAC;IAEvD,OAAO;QACL,IAAI,EAAE,yBAAyB;QAC/B,SAAS,CAAC,EAAE;YACV,IAAI,EAAE,KAAK,eAAe,EAAE,CAAC;gBAC3B,OAAO,uBAAuB,CAAC;YACjC,CAAC;QACH,CAAC;QACD,IAAI,CAAC,EAAE;YACL,IAAI,EAAE,KAAK,uBAAuB,EAAE,CAAC;gBACnC,MAAM,IAAI,GAAa;oBACrB,0DAA0D;oBAC1D,2CAA2C;oBAC3C,mCAAmC,MAAM,CAAC,MAAM
|
|
1
|
+
{"version":3,"file":"plugin-docs.js","sourceRoot":"","sources":["../../src/vite/plugin-docs.ts"],"names":[],"mappings":"AAGA,MAAM,cAAc,GAAG,CAAC,MAA2B,EAAU,EAAE;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
1
|
{
|
|
2
2
|
"name": "zudoku",
|
|
3
|
-
"version": "0.1.1-dev.
|
|
3
|
+
"version": "0.1.1-dev.13",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"files": [
|
|
6
6
|
"dist",
|
|
7
|
-
"src/app",
|
|
8
7
|
"cli.js"
|
|
9
8
|
],
|
|
10
9
|
"module": "./dist/index.js",
|
|
@@ -120,7 +119,9 @@
|
|
|
120
119
|
"react-dom": ">18.0.0"
|
|
121
120
|
},
|
|
122
121
|
"scripts": {
|
|
123
|
-
"build": "tsc --project tsconfig.node.json",
|
|
122
|
+
"build": "tsc --project tsconfig.node.json && pnpm run build:css",
|
|
123
|
+
"build:css": "cp src/app/main.css dist/app/main.css",
|
|
124
|
+
"clean": "tsc --build --clean",
|
|
124
125
|
"test": "node --test --enable-source-maps",
|
|
125
126
|
"codegen": "graphql-codegen --config ./scripts/codegen.ts"
|
|
126
127
|
}
|
package/src/app/App.tsx
DELETED
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
import "./main.css";
|
|
2
|
-
|
|
3
|
-
// Virtual config
|
|
4
|
-
import config from "virtual:zudoku-config";
|
|
5
|
-
|
|
6
|
-
// Virtual Plugins
|
|
7
|
-
import { configuredApiPlugins } from "virtual:zudoku-api-plugins";
|
|
8
|
-
import { configuredAuthProvider } from "virtual:zudoku-auth";
|
|
9
|
-
import { configuredDocsPlugins } from "virtual:zudoku-docs-plugins";
|
|
10
|
-
|
|
11
|
-
// Base React Component
|
|
12
|
-
import DevPortal from "./DevPortal.js";
|
|
13
|
-
|
|
14
|
-
export default function App() {
|
|
15
|
-
return (
|
|
16
|
-
<DevPortal
|
|
17
|
-
meta={{
|
|
18
|
-
headerTitle: config?.ui?.headerTitle ?? "Developer Portal",
|
|
19
|
-
pageTitle: config?.ui?.pageTitle ?? "%s | Dev Portal",
|
|
20
|
-
logo: config?.ui?.logo ?? "https://cdn.zuplo.com/www/favicon.png",
|
|
21
|
-
favicon:
|
|
22
|
-
config?.ui?.metadata?.favicon ??
|
|
23
|
-
"https://cdn.zuplo.com/www/favicon.png",
|
|
24
|
-
}}
|
|
25
|
-
navigation={config.navigation ?? []}
|
|
26
|
-
authentication={configuredAuthProvider}
|
|
27
|
-
plugins={[...configuredDocsPlugins, ...configuredApiPlugins]}
|
|
28
|
-
/>
|
|
29
|
-
);
|
|
30
|
-
}
|
package/src/app/DevPortal.tsx
DELETED
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { MDXProvider } from "@mdx-js/react";
|
|
2
|
-
import { QueryClientProvider } from "@tanstack/react-query";
|
|
3
|
-
import { memo, Suspense, useEffect, useMemo } from "react";
|
|
4
|
-
import { createBrowserRouter, RouterProvider } from "react-router-dom";
|
|
5
|
-
import { type AuthProvider } from "./authentication/authentication.js";
|
|
6
|
-
import {
|
|
7
|
-
ComponentsProvider,
|
|
8
|
-
DEFAULT_COMPONENTS,
|
|
9
|
-
type ComponentsContextType,
|
|
10
|
-
} from "./components/context/ComponentsContext.js";
|
|
11
|
-
import { DevPortalProvider } from "./components/context/DevPortalProvider.js";
|
|
12
|
-
import { ThemeProvider } from "./components/context/ThemeContext.js";
|
|
13
|
-
import { ViewportAnchorProvider } from "./components/context/ViewportAnchorContext.js";
|
|
14
|
-
import { Layout } from "./components/Layout.js";
|
|
15
|
-
import {
|
|
16
|
-
DevPortalContext,
|
|
17
|
-
queryClient,
|
|
18
|
-
type NavigationItem,
|
|
19
|
-
} from "./core/DevPortalContext.js";
|
|
20
|
-
import { HelmetProvider } from "./core/helmet.js";
|
|
21
|
-
import { isNavigationPlugin, type DevPortalPlugin } from "./core/plugins.js";
|
|
22
|
-
import { MdxComponents, type MdxComponentsType } from "./util/MdxComponents.js";
|
|
23
|
-
|
|
24
|
-
export const DevPortalSystemPaths = {
|
|
25
|
-
Settings: "/settings",
|
|
26
|
-
} as const;
|
|
27
|
-
|
|
28
|
-
export type DevPortalPath =
|
|
29
|
-
| string
|
|
30
|
-
| (typeof DevPortalSystemPaths)[keyof typeof DevPortalSystemPaths];
|
|
31
|
-
|
|
32
|
-
export type DevPortalProps = {
|
|
33
|
-
meta?: Partial<{
|
|
34
|
-
headerTitle: string;
|
|
35
|
-
pageTitle: string;
|
|
36
|
-
description: string;
|
|
37
|
-
logo: string;
|
|
38
|
-
favicon: string;
|
|
39
|
-
}>;
|
|
40
|
-
authentication?: AuthProvider;
|
|
41
|
-
navigation: NavigationItem[];
|
|
42
|
-
plugins?: DevPortalPlugin[];
|
|
43
|
-
mdxComponents?: MdxComponentsType;
|
|
44
|
-
overrides?: ComponentsContextType;
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
const DevPortal = (props: DevPortalProps) => {
|
|
48
|
-
const router = useMemo(() => {
|
|
49
|
-
const routes = (props.plugins ?? []).flatMap((plugin) =>
|
|
50
|
-
isNavigationPlugin(plugin) ? plugin.getRoutes() : [],
|
|
51
|
-
);
|
|
52
|
-
|
|
53
|
-
return createBrowserRouter([
|
|
54
|
-
{
|
|
55
|
-
path: "/",
|
|
56
|
-
element: <Layout />,
|
|
57
|
-
errorElement: (
|
|
58
|
-
<Layout>
|
|
59
|
-
<div className="h-[75vh] flex items-center justify-center">
|
|
60
|
-
Error, look at the console
|
|
61
|
-
</div>
|
|
62
|
-
</Layout>
|
|
63
|
-
),
|
|
64
|
-
children: routes,
|
|
65
|
-
},
|
|
66
|
-
]);
|
|
67
|
-
}, [props.plugins]);
|
|
68
|
-
|
|
69
|
-
const components = useMemo(
|
|
70
|
-
() => ({ ...DEFAULT_COMPONENTS, ...props.overrides }),
|
|
71
|
-
[props.overrides],
|
|
72
|
-
);
|
|
73
|
-
|
|
74
|
-
const mdxComponents = useMemo(
|
|
75
|
-
() => ({ ...MdxComponents, ...props.mdxComponents }),
|
|
76
|
-
[props.mdxComponents],
|
|
77
|
-
);
|
|
78
|
-
|
|
79
|
-
const devPortalContext = useMemo(() => new DevPortalContext(props), [props]);
|
|
80
|
-
|
|
81
|
-
useEffect(() => {
|
|
82
|
-
void devPortalContext.initialize();
|
|
83
|
-
}, [devPortalContext]);
|
|
84
|
-
|
|
85
|
-
return (
|
|
86
|
-
<QueryClientProvider client={queryClient}>
|
|
87
|
-
<HelmetProvider>
|
|
88
|
-
<DevPortalProvider value={devPortalContext}>
|
|
89
|
-
<MDXProvider components={mdxComponents}>
|
|
90
|
-
<ThemeProvider>
|
|
91
|
-
<ComponentsProvider value={components}>
|
|
92
|
-
<ViewportAnchorProvider>
|
|
93
|
-
<Suspense
|
|
94
|
-
fallback={
|
|
95
|
-
<div className="grid place-items-center h-full">
|
|
96
|
-
Loading...
|
|
97
|
-
</div>
|
|
98
|
-
}
|
|
99
|
-
>
|
|
100
|
-
<RouterProvider router={router} />
|
|
101
|
-
</Suspense>
|
|
102
|
-
</ViewportAnchorProvider>
|
|
103
|
-
</ComponentsProvider>
|
|
104
|
-
</ThemeProvider>
|
|
105
|
-
</MDXProvider>
|
|
106
|
-
</DevPortalProvider>
|
|
107
|
-
</HelmetProvider>
|
|
108
|
-
</QueryClientProvider>
|
|
109
|
-
);
|
|
110
|
-
};
|
|
111
|
-
|
|
112
|
-
const MemoDevPortal = memo(DevPortal);
|
|
113
|
-
MemoDevPortal.displayName = "DevPortal";
|
|
114
|
-
|
|
115
|
-
export default MemoDevPortal;
|
package/src/app/Heading.tsx
DELETED
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import { type ReactNode } from "react";
|
|
2
|
-
import { useRegisterAnchorElement } from "./components/context/ViewportAnchorContext.js";
|
|
3
|
-
import { cn } from "./util/cn.js";
|
|
4
|
-
|
|
5
|
-
const getComponent = (level: number) => {
|
|
6
|
-
switch (level) {
|
|
7
|
-
case 1:
|
|
8
|
-
return "h1";
|
|
9
|
-
case 2:
|
|
10
|
-
return "h2";
|
|
11
|
-
case 3:
|
|
12
|
-
return "h3";
|
|
13
|
-
case 4:
|
|
14
|
-
return "h4";
|
|
15
|
-
case 5:
|
|
16
|
-
return "h5";
|
|
17
|
-
case 6:
|
|
18
|
-
return "h6";
|
|
19
|
-
default:
|
|
20
|
-
return "h1";
|
|
21
|
-
}
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
export type HeadingProps = {
|
|
25
|
-
children: ReactNode;
|
|
26
|
-
className?: string;
|
|
27
|
-
id?: string;
|
|
28
|
-
level?: 1 | 2 | 3 | 4 | 5 | 6;
|
|
29
|
-
registerSidebarAnchor?: boolean;
|
|
30
|
-
};
|
|
31
|
-
|
|
32
|
-
export const Heading = ({
|
|
33
|
-
level,
|
|
34
|
-
children,
|
|
35
|
-
id,
|
|
36
|
-
className,
|
|
37
|
-
registerSidebarAnchor,
|
|
38
|
-
}: HeadingProps) => {
|
|
39
|
-
const Component = getComponent(level ?? 1);
|
|
40
|
-
const { ref } = useRegisterAnchorElement();
|
|
41
|
-
|
|
42
|
-
return (
|
|
43
|
-
<Component
|
|
44
|
-
className={cn("group relative", className)}
|
|
45
|
-
ref={registerSidebarAnchor ? ref : undefined}
|
|
46
|
-
id={id}
|
|
47
|
-
>
|
|
48
|
-
{id && (
|
|
49
|
-
<a
|
|
50
|
-
href={`#${id}`}
|
|
51
|
-
className="no-underline absolute text-primary -left-[0.8em] pr-2.5 opacity-0 group-hover:opacity-50 hover:!opacity-100 transition-opacity duration-200"
|
|
52
|
-
aria-label={`Link to ${id}`}
|
|
53
|
-
>
|
|
54
|
-
#
|
|
55
|
-
</a>
|
|
56
|
-
)}
|
|
57
|
-
{children}
|
|
58
|
-
</Component>
|
|
59
|
-
);
|
|
60
|
-
};
|
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
import { DevPortalContext } from "../core/DevPortalContext.js";
|
|
2
|
-
|
|
3
|
-
export interface AuthProvider {
|
|
4
|
-
initialize(context: DevPortalContext): Promise<unknown>;
|
|
5
|
-
login(context: DevPortalContext): Promise<unknown>;
|
|
6
|
-
getToken?: (context: DevPortalContext) => Promise<string | undefined>;
|
|
7
|
-
handleAuthenticationResponse?: (
|
|
8
|
-
path: Path,
|
|
9
|
-
context: DevPortalContext,
|
|
10
|
-
) => Promise<unknown>;
|
|
11
|
-
signOut(context: DevPortalContext): void;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
export type Path = {
|
|
15
|
-
pathname: string;
|
|
16
|
-
search: string;
|
|
17
|
-
hash: string;
|
|
18
|
-
};
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import { Clerk } from "@clerk/clerk-js";
|
|
2
|
-
import { type AuthProvider } from "./authentication.js";
|
|
3
|
-
|
|
4
|
-
const clerkProvider = ({
|
|
5
|
-
clerkPubKey,
|
|
6
|
-
}: {
|
|
7
|
-
clerkPubKey: string;
|
|
8
|
-
}): AuthProvider => {
|
|
9
|
-
const clerkApi = new Clerk(clerkPubKey);
|
|
10
|
-
|
|
11
|
-
const clerkIsLoaded = clerkApi.load({});
|
|
12
|
-
|
|
13
|
-
return {
|
|
14
|
-
initialize: async (context) => {
|
|
15
|
-
await clerkIsLoaded;
|
|
16
|
-
|
|
17
|
-
if (clerkApi.session) {
|
|
18
|
-
await context.setUserProfile({
|
|
19
|
-
isLoggedIn: true,
|
|
20
|
-
name: clerkApi.session.user.fullName ?? undefined,
|
|
21
|
-
email:
|
|
22
|
-
clerkApi.session.user.emailAddresses.at(0)?.emailAddress ??
|
|
23
|
-
undefined,
|
|
24
|
-
});
|
|
25
|
-
} else {
|
|
26
|
-
await context.setUserProfile({
|
|
27
|
-
isLoggedIn: false,
|
|
28
|
-
});
|
|
29
|
-
}
|
|
30
|
-
},
|
|
31
|
-
|
|
32
|
-
getToken: async () => {
|
|
33
|
-
await clerkIsLoaded;
|
|
34
|
-
const token = await clerkApi.session?.getToken();
|
|
35
|
-
return token ?? undefined;
|
|
36
|
-
},
|
|
37
|
-
|
|
38
|
-
signOut() {
|
|
39
|
-
clerkApi.signOut();
|
|
40
|
-
},
|
|
41
|
-
login: async () => {
|
|
42
|
-
await clerkApi.redirectToSignIn();
|
|
43
|
-
},
|
|
44
|
-
};
|
|
45
|
-
};
|
|
46
|
-
|
|
47
|
-
export default clerkProvider;
|