zudoku 0.1.1-dev.2 → 0.1.1-dev.20
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/cli.js +2 -0
- package/dist/app/App.js +22 -0
- package/dist/app/App.js.map +1 -0
- package/dist/app/main.js +4 -16
- package/dist/app/main.js.map +1 -1
- package/dist/cli/cmds/dev.js +0 -1
- package/dist/cli/cmds/dev.js.map +1 -1
- package/dist/cli/common/logger.d.ts +1 -2
- package/dist/cli/common/logger.js +2 -4
- package/dist/cli/common/logger.js.map +1 -1
- package/dist/cli/dev/handler.d.ts +1 -1
- package/dist/cli/dev/handler.js +11 -2
- package/dist/cli/dev/handler.js.map +1 -1
- package/dist/config/config.d.ts +12 -7
- package/dist/index.d.ts +2 -6
- package/dist/index.js +1 -5
- package/dist/index.js.map +1 -1
- package/dist/{app → lib}/DevPortal.d.ts +2 -3
- package/dist/{app → lib}/DevPortal.js +6 -19
- package/dist/lib/DevPortal.js.map +1 -0
- package/dist/{app → lib}/Heading.js.map +1 -1
- package/dist/lib/Router.d.ts +4 -0
- package/dist/lib/Router.js +20 -0
- package/dist/lib/Router.js.map +1 -0
- package/dist/lib/auth.d.ts +1 -0
- package/dist/lib/auth.js +2 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/authentication/authentication.js.map +1 -0
- package/dist/{app → lib}/authentication/clerk.d.ts +1 -2
- package/dist/{app → lib}/authentication/clerk.js +1 -2
- package/dist/lib/authentication/clerk.js.map +1 -0
- package/dist/{app → lib}/authentication/openid.js +2 -2
- package/dist/lib/authentication/openid.js.map +1 -0
- package/dist/{app → lib}/components/AnchorLink.js.map +1 -1
- package/dist/{app → lib}/components/CategoryHeading.js.map +1 -1
- package/dist/lib/components/Dialog.d.ts +19 -0
- package/dist/lib/components/Dialog.js +23 -0
- package/dist/lib/components/Dialog.js.map +1 -0
- package/dist/{app → lib}/components/DynamicIcon.js.map +1 -1
- package/dist/{app → lib}/components/Header.d.ts +0 -1
- package/dist/{app → lib}/components/Header.js.map +1 -1
- package/dist/lib/components/Input.d.ts +5 -0
- package/dist/lib/components/Input.js +9 -0
- package/dist/lib/components/Input.js.map +1 -0
- package/dist/{app → lib}/components/Layout.js.map +1 -1
- package/dist/{app → lib}/components/Markdown.js.map +1 -1
- package/dist/{app → lib}/components/SyntaxHighlight.js +2 -0
- package/dist/lib/components/SyntaxHighlight.js.map +1 -0
- package/dist/{app → lib}/components/TopNavigation.js.map +1 -1
- package/dist/{app → lib}/components/context/ComponentsContext.js.map +1 -1
- package/dist/{app → lib}/components/context/DevPortalProvider.d.ts +0 -1
- package/dist/{app → lib}/components/context/DevPortalProvider.js.map +1 -1
- package/dist/lib/components/context/PluginSystem.js.map +1 -0
- package/dist/{app → lib}/components/context/ThemeContext.js.map +1 -1
- package/dist/{app → lib}/components/context/ViewportAnchorContext.js.map +1 -1
- package/dist/{app → lib}/components/navigation/SideNavigation.js.map +1 -1
- package/dist/{app → lib}/components/navigation/SideNavigationCategory.js.map +1 -1
- package/dist/{app → lib}/components/navigation/SideNavigationItem.js.map +1 -1
- package/dist/{app → lib}/components/navigation/SideNavigationWrapper.d.ts +1 -2
- package/dist/{app → lib}/components/navigation/SideNavigationWrapper.js.map +1 -1
- package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.d.ts +0 -1
- package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js.map +1 -1
- package/dist/{app → lib}/components/navigation/util.js.map +1 -1
- package/dist/lib/components.d.ts +3 -0
- package/dist/lib/components.js +4 -0
- package/dist/lib/components.js.map +1 -0
- package/dist/{app → lib}/core/DevPortalContext.js.map +1 -1
- package/dist/{app → lib}/core/helmet.js.map +1 -1
- package/dist/lib/core/icons.js.map +1 -0
- package/dist/{app → lib}/core/plugins.js.map +1 -1
- package/dist/lib/core/router.js.map +1 -0
- package/dist/lib/core/types/combine.js.map +1 -0
- package/dist/{app → lib}/oas/graphql/index.js.map +1 -1
- package/dist/{app → lib}/oas/graphql/server.js.map +1 -1
- package/dist/{app → lib}/oas/parser/dereference/index.js.map +1 -1
- package/dist/{app → lib}/oas/parser/dereference/resolveRef.js.map +1 -1
- package/dist/{app → lib}/oas/parser/index.js.map +1 -1
- package/dist/{app → lib}/oas/parser/upgrade/index.js.map +1 -1
- package/dist/{app → lib}/plugins/api-key/SettingsApiKeys.js.map +1 -1
- package/dist/{app → lib}/plugins/api-key/index.js.map +1 -1
- package/dist/{app → lib}/plugins/markdown/MdxPage.js.map +1 -1
- package/dist/{app → lib}/plugins/markdown/Toc.js.map +1 -1
- package/dist/{app → lib}/plugins/markdown/generateRoutes.js.map +1 -1
- package/dist/{app → lib}/plugins/markdown/index.d.ts +0 -1
- package/dist/{app → lib}/plugins/markdown/index.js.map +1 -1
- package/dist/lib/plugins/openapi/ColorizedParam.d.ts +12 -0
- package/dist/{app → lib}/plugins/openapi/ColorizedParam.js +10 -5
- package/dist/lib/plugins/openapi/ColorizedParam.js.map +1 -0
- package/dist/lib/plugins/openapi/MakeRequest.js +23 -0
- package/dist/lib/plugins/openapi/MakeRequest.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/MethodBadge.js.map +1 -1
- package/dist/lib/plugins/openapi/OperationList.d.ts +4 -0
- package/dist/{app → lib}/plugins/openapi/OperationList.js +16 -16
- package/dist/lib/plugins/openapi/OperationList.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/OperationListItem.d.ts +2 -2
- package/dist/{app → lib}/plugins/openapi/OperationListItem.js +2 -2
- package/dist/lib/plugins/openapi/OperationListItem.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/ParameterList.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/ParameterListItem.js.map +1 -1
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js +19 -0
- package/dist/lib/plugins/openapi/RequestBodySidecarBox.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.js +1 -1
- package/dist/lib/plugins/openapi/ResponsesSidecarBox.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/Select.js.map +1 -1
- package/dist/lib/plugins/openapi/Sidecar.js +94 -0
- package/dist/lib/plugins/openapi/Sidecar.js.map +1 -0
- package/dist/lib/plugins/openapi/SidecarBox.d.ts +8 -0
- package/dist/lib/plugins/openapi/SidecarBox.js +6 -0
- package/dist/lib/plugins/openapi/SidecarBox.js.map +1 -0
- package/dist/lib/plugins/openapi/graphql/fragment-masking.d.ts +19 -0
- package/dist/lib/plugins/openapi/graphql/fragment-masking.js +16 -0
- package/dist/lib/plugins/openapi/graphql/fragment-masking.js.map +1 -0
- package/dist/lib/plugins/openapi/graphql/gql.d.ts +58 -0
- package/dist/lib/plugins/openapi/graphql/gql.js +22 -0
- package/dist/lib/plugins/openapi/graphql/gql.js.map +1 -0
- package/dist/lib/plugins/openapi/graphql/graphql.d.ts +282 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js +526 -0
- package/dist/lib/plugins/openapi/graphql/graphql.js.map +1 -0
- package/dist/lib/plugins/openapi/graphql/index.d.ts +2 -0
- package/dist/lib/plugins/openapi/graphql/index.js +3 -0
- package/dist/lib/plugins/openapi/graphql/index.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/index.d.ts +0 -1
- package/dist/{app → lib}/plugins/openapi/index.js +1 -1
- package/dist/{app → lib}/plugins/openapi/index.js.map +1 -1
- package/dist/lib/plugins/openapi/playground/Playground.d.ts +8 -0
- package/dist/lib/plugins/openapi/playground/Playground.js +98 -0
- package/dist/lib/plugins/openapi/playground/Playground.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/util/urql.d.ts +0 -1
- package/dist/{app → lib}/plugins/openapi/util/urql.js.map +1 -1
- package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.js.map +1 -1
- package/dist/lib/plugins/openapi/worker/shared-worker.d.ts +1 -0
- package/dist/lib/plugins/openapi/worker/shared-worker.js +6 -0
- package/dist/lib/plugins/openapi/worker/shared-worker.js.map +1 -0
- package/dist/{app → lib}/plugins/openapi/worker/worker.js.map +1 -1
- package/dist/{app → lib}/plugins/redirect/index.js.map +1 -1
- package/dist/lib/plugins.d.ts +4 -0
- package/dist/lib/plugins.js +6 -0
- package/dist/lib/plugins.js.map +1 -0
- package/dist/lib/ui/Button.d.ts +11 -0
- package/dist/lib/ui/Button.js +34 -0
- package/dist/lib/ui/Button.js.map +1 -0
- package/dist/{app → lib}/ui/Callout.js.map +1 -1
- package/dist/{app → lib}/ui/Card.js +1 -1
- package/dist/{app → lib}/ui/Card.js.map +1 -1
- package/dist/{app → lib}/ui/Note.js.map +1 -1
- package/dist/lib/ui/Tabs.d.ts +7 -0
- package/dist/lib/ui/Tabs.js +13 -0
- package/dist/lib/ui/Tabs.js.map +1 -0
- package/dist/{app → lib}/util/MdxComponents.d.ts +2 -2
- package/dist/{app → lib}/util/MdxComponents.js.map +1 -1
- package/dist/{app → lib}/util/cn.js.map +1 -1
- package/dist/lib/util/createVariantComponent.d.ts +15 -0
- package/dist/lib/util/createVariantComponent.js +12 -0
- package/dist/lib/util/createVariantComponent.js.map +1 -0
- package/dist/lib/util/createWaitForNotify.d.ts +1 -0
- package/dist/{app → lib}/util/createWaitForNotify.js.map +1 -1
- package/dist/{app → lib}/util/groupBy.js.map +1 -1
- package/dist/{app → lib}/util/joinPath.js.map +1 -1
- package/dist/{app → lib}/util/pastellize.js.map +1 -1
- package/dist/{app → lib}/util/slugify.d.ts +0 -1
- package/dist/lib/util/slugify.js.map +1 -0
- package/dist/{app → lib}/util/traverseNavigation.js.map +1 -1
- package/dist/{app → lib}/util/useScrollToAnchor.js.map +1 -1
- package/dist/{app → lib}/util/useScrollToTop.js.map +1 -1
- package/dist/ts.d.ts +6 -0
- package/dist/ts.js +62 -0
- package/dist/ts.js.map +1 -0
- package/dist/vite/build.js +2 -8
- package/dist/vite/build.js.map +1 -1
- package/dist/vite/config.d.ts +8 -2
- package/dist/vite/config.js +103 -23
- package/dist/vite/config.js.map +1 -1
- package/dist/vite/config.test.d.ts +1 -0
- package/dist/vite/config.test.js +10 -0
- package/dist/vite/config.test.js.map +1 -0
- package/dist/vite/dev-server.js +8 -4
- package/dist/vite/dev-server.js.map +1 -1
- package/dist/vite/html.d.ts +1 -1
- package/dist/vite/html.js +2 -3
- package/dist/vite/html.js.map +1 -1
- package/dist/vite/plugin-api.d.ts +4 -0
- package/dist/vite/plugin-api.js +47 -0
- package/dist/vite/plugin-api.js.map +1 -0
- package/dist/vite/plugin-auth.d.ts +4 -0
- package/dist/vite/plugin-auth.js +28 -0
- package/dist/vite/plugin-auth.js.map +1 -0
- package/dist/vite/plugin-component.d.ts +3 -0
- package/dist/vite/plugin-component.js +22 -0
- package/dist/vite/plugin-component.js.map +1 -0
- package/dist/vite/plugin-config.d.ts +6 -0
- package/dist/vite/plugin-config.js +24 -0
- package/dist/vite/plugin-config.js.map +1 -0
- package/dist/vite/plugin-docs.d.ts +4 -0
- package/dist/vite/plugin-docs.js +43 -0
- package/dist/vite/plugin-docs.js.map +1 -0
- package/dist/vite/plugin-docs.test.d.ts +1 -0
- package/dist/vite/plugin-docs.test.js +30 -0
- package/dist/vite/plugin-docs.test.js.map +1 -0
- package/dist/vite/plugin-html.d.ts +3 -0
- package/dist/vite/plugin-html.js +47 -0
- package/dist/vite/plugin-html.js.map +1 -0
- package/dist/vite/plugin-mdx.d.ts +8 -0
- package/dist/vite/plugin-mdx.js +61 -0
- package/dist/vite/plugin-mdx.js.map +1 -0
- package/dist/vite/plugin-metadata.d.ts +6 -0
- package/dist/vite/plugin-metadata.js +24 -0
- package/dist/vite/plugin-metadata.js.map +1 -0
- package/dist/vite/plugin.d.ts +2 -6
- package/dist/vite/plugin.js +14 -104
- package/dist/vite/plugin.js.map +1 -1
- package/lib/DevPortal-DqcnbwLT.js +12967 -0
- package/lib/assets/index-BPdJm2ty.js +4764 -0
- package/lib/assets/worker-CnXQsqxH.js +14511 -0
- package/lib/prism-bash.min-DadFsM4Z.js +6 -0
- package/lib/prism-java.min-d5iT_mOd.js +6 -0
- package/lib/prism-json.min-B1GJqK1k.js +1 -0
- package/lib/prism-markup-templating-DZrrEs0A.js +61 -0
- package/lib/prism-php.min-o7FpoMP_.js +10 -0
- package/lib/prism-ruby.min-C7LwcKyz.js +9 -0
- package/lib/urql-B7mLfVog.js +1611 -0
- package/lib/zudoku.auth.js +31 -0
- package/lib/zudoku.components.js +6 -0
- package/lib/zudoku.openapi-worker.js +143 -0
- package/lib/zudoku.plugins.js +15650 -0
- package/package.json +53 -35
- package/src/app/App.tsx +33 -0
- package/src/app/main.tsx +6 -19
- package/src/cli/build/handler.ts +14 -0
- package/src/cli/cli.ts +77 -0
- package/src/cli/cmds/build.ts +24 -0
- package/src/cli/cmds/dev.ts +29 -0
- package/src/cli/common/analytics/lib.ts +89 -0
- package/src/cli/common/constants.ts +10 -0
- package/src/cli/common/logger.ts +5 -0
- package/src/cli/common/machine-id/lib.ts +85 -0
- package/src/cli/common/outdated.ts +102 -0
- package/src/cli/common/output.ts +86 -0
- package/src/cli/common/utils/box.license.txt +202 -0
- package/src/cli/common/utils/box.ts +116 -0
- package/src/cli/common/utils/ports.ts +21 -0
- package/src/cli/common/validators/lib.ts +43 -0
- package/src/cli/common/xdg/lib.ts +36 -0
- package/src/cli/dev/handler.ts +42 -0
- package/src/config/config.ts +56 -0
- package/src/index.ts +8 -0
- package/src/{app → lib}/DevPortal.tsx +7 -29
- package/src/lib/Router.tsx +28 -0
- package/src/lib/auth.ts +1 -0
- package/src/{app → lib}/authentication/clerk.ts +1 -3
- package/src/lib/components/Dialog.tsx +119 -0
- package/src/lib/components/Input.tsx +24 -0
- package/src/{app → lib}/components/SyntaxHighlight.tsx +2 -0
- package/src/lib/components.ts +3 -0
- package/src/{app → lib}/plugins/openapi/ColorizedParam.tsx +18 -9
- package/src/{app → lib}/plugins/openapi/MakeRequest.tsx +19 -0
- package/src/{app → lib}/plugins/openapi/OperationList.tsx +20 -22
- package/src/{app → lib}/plugins/openapi/OperationListItem.tsx +3 -3
- package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +51 -0
- package/src/{app → lib}/plugins/openapi/ResponsesSidecarBox.tsx +1 -1
- package/src/{app → lib}/plugins/openapi/Sidecar.tsx +81 -20
- package/src/lib/plugins/openapi/SidecarBox.tsx +36 -0
- package/src/lib/plugins/openapi/graphql/fragment-masking.ts +111 -0
- package/src/lib/plugins/openapi/graphql/gql.ts +70 -0
- package/src/lib/plugins/openapi/graphql/graphql.ts +795 -0
- package/src/lib/plugins/openapi/graphql/index.ts +2 -0
- package/src/{app → lib}/plugins/openapi/index.tsx +6 -2
- package/src/lib/plugins/openapi/playground/Playground.tsx +309 -0
- package/src/lib/plugins/openapi/queries.graphql +6 -0
- package/src/lib/plugins/openapi/worker/shared-worker.ts +5 -0
- package/src/lib/plugins.ts +5 -0
- package/src/lib/ui/Button.tsx +56 -0
- package/src/{app → lib}/ui/Card.tsx +1 -1
- package/src/lib/ui/Tabs.tsx +52 -0
- package/src/lib/util/createVariantComponent.tsx +30 -0
- package/src/ts.ts +94 -0
- package/src/types.d.ts +24 -0
- package/src/vite/build.ts +33 -0
- package/src/vite/config.test.ts +10 -0
- package/src/vite/config.ts +183 -0
- package/src/vite/dev-server.ts +64 -0
- package/src/vite/html.ts +37 -0
- package/src/vite/plugin-api.ts +57 -0
- package/src/vite/plugin-auth.ts +32 -0
- package/src/vite/plugin-component.ts +26 -0
- package/src/vite/plugin-config.ts +31 -0
- package/src/vite/plugin-docs.test.ts +32 -0
- package/src/vite/plugin-docs.ts +52 -0
- package/src/vite/plugin-html.ts +50 -0
- package/src/vite/plugin-mdx.ts +74 -0
- package/src/vite/plugin-metadata.ts +30 -0
- package/src/vite/plugin.ts +23 -0
- package/dist/app/DevPortal.js.map +0 -1
- package/dist/app/app.js +0 -69
- package/dist/app/app.js.map +0 -1
- package/dist/app/authentication/authentication.js.map +0 -1
- package/dist/app/authentication/clerk.js.map +0 -1
- package/dist/app/authentication/openid.js.map +0 -1
- package/dist/app/components/SyntaxHighlight.js.map +0 -1
- package/dist/app/components/context/PluginSystem.js.map +0 -1
- package/dist/app/config.d.ts +0 -3
- package/dist/app/config.js +0 -9
- package/dist/app/config.js.map +0 -1
- package/dist/app/core/icons.js.map +0 -1
- package/dist/app/core/router.js.map +0 -1
- package/dist/app/core/types/combine.js.map +0 -1
- package/dist/app/markdowns.d.ts +0 -3
- package/dist/app/markdowns.js +0 -5
- package/dist/app/markdowns.js.map +0 -1
- package/dist/app/plugins/openapi/ColorizedParam.d.ts +0 -8
- package/dist/app/plugins/openapi/ColorizedParam.js.map +0 -1
- package/dist/app/plugins/openapi/MakeRequest.js +0 -11
- package/dist/app/plugins/openapi/MakeRequest.js.map +0 -1
- package/dist/app/plugins/openapi/OperationList.d.ts +0 -47
- package/dist/app/plugins/openapi/OperationList.js.map +0 -1
- package/dist/app/plugins/openapi/OperationListItem.js.map +0 -1
- package/dist/app/plugins/openapi/RequestBodySidecarBox.js +0 -19
- package/dist/app/plugins/openapi/RequestBodySidecarBox.js.map +0 -1
- package/dist/app/plugins/openapi/ResponsesSidecarBox.js.map +0 -1
- package/dist/app/plugins/openapi/Sidecar.js +0 -39
- package/dist/app/plugins/openapi/Sidecar.js.map +0 -1
- package/dist/app/plugins/openapi/SidecarBox.d.ts +0 -10
- package/dist/app/plugins/openapi/SidecarBox.js +0 -8
- package/dist/app/plugins/openapi/SidecarBox.js.map +0 -1
- package/dist/app/plugins/openapi/graphql/index.d.ts +0 -836
- package/dist/app/plugins/openapi/graphql/index.js +0 -4
- package/dist/app/plugins/openapi/graphql/index.js.map +0 -1
- package/dist/app/plugins/openapi/util/getCode.d.ts +0 -2
- package/dist/app/plugins/openapi/util/getCode.js +0 -54
- package/dist/app/plugins/openapi/util/getCode.js.map +0 -1
- package/dist/app/util/createWaitForNotify.d.ts +0 -1
- package/dist/app/util/slugify.js.map +0 -1
- package/dist/auth.d.ts +0 -2
- package/dist/auth.js +0 -3
- package/dist/auth.js.map +0 -1
- package/dist/plugins.d.ts +0 -4
- package/dist/plugins.js +0 -6
- package/dist/plugins.js.map +0 -1
- package/src/app/app.tsx +0 -85
- package/src/app/config.ts +0 -20
- package/src/app/markdowns.ts +0 -7
- package/src/app/plugins/openapi/RequestBodySidecarBox.tsx +0 -48
- package/src/app/plugins/openapi/SidecarBox.tsx +0 -35
- package/src/app/plugins/openapi/graphql/env.d.ts +0 -48
- package/src/app/plugins/openapi/graphql/index.ts +0 -13
- package/src/app/plugins/openapi/util/getCode.tsx +0 -69
- /package/dist/app/{app.d.ts → App.d.ts} +0 -0
- /package/dist/{app → lib}/Heading.d.ts +0 -0
- /package/dist/{app → lib}/Heading.js +0 -0
- /package/dist/{app → lib}/authentication/authentication.d.ts +0 -0
- /package/dist/{app → lib}/authentication/authentication.js +0 -0
- /package/dist/{app → lib}/authentication/openid.d.ts +0 -0
- /package/dist/{app → lib}/components/AnchorLink.d.ts +0 -0
- /package/dist/{app → lib}/components/AnchorLink.js +0 -0
- /package/dist/{app → lib}/components/CategoryHeading.d.ts +0 -0
- /package/dist/{app → lib}/components/CategoryHeading.js +0 -0
- /package/dist/{app → lib}/components/DynamicIcon.d.ts +0 -0
- /package/dist/{app → lib}/components/DynamicIcon.js +0 -0
- /package/dist/{app → lib}/components/Header.js +0 -0
- /package/dist/{app → lib}/components/Layout.d.ts +0 -0
- /package/dist/{app → lib}/components/Layout.js +0 -0
- /package/dist/{app → lib}/components/Markdown.d.ts +0 -0
- /package/dist/{app → lib}/components/Markdown.js +0 -0
- /package/dist/{app → lib}/components/SyntaxHighlight.d.ts +0 -0
- /package/dist/{app → lib}/components/TopNavigation.d.ts +0 -0
- /package/dist/{app → lib}/components/TopNavigation.js +0 -0
- /package/dist/{app → lib}/components/context/ComponentsContext.d.ts +0 -0
- /package/dist/{app → lib}/components/context/ComponentsContext.js +0 -0
- /package/dist/{app → lib}/components/context/DevPortalProvider.js +0 -0
- /package/dist/{app → lib}/components/context/PluginSystem.d.ts +0 -0
- /package/dist/{app → lib}/components/context/PluginSystem.js +0 -0
- /package/dist/{app → lib}/components/context/ThemeContext.d.ts +0 -0
- /package/dist/{app → lib}/components/context/ThemeContext.js +0 -0
- /package/dist/{app → lib}/components/context/ViewportAnchorContext.d.ts +0 -0
- /package/dist/{app → lib}/components/context/ViewportAnchorContext.js +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigation.d.ts +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigation.js +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigationCategory.d.ts +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigationCategory.js +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigationItem.d.ts +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigationItem.js +0 -0
- /package/dist/{app → lib}/components/navigation/SideNavigationWrapper.js +0 -0
- /package/dist/{app → lib}/components/navigation/useNavigationCollapsibleState.js +0 -0
- /package/dist/{app → lib}/components/navigation/util.d.ts +0 -0
- /package/dist/{app → lib}/components/navigation/util.js +0 -0
- /package/dist/{app → lib}/core/DevPortalContext.d.ts +0 -0
- /package/dist/{app → lib}/core/DevPortalContext.js +0 -0
- /package/dist/{app → lib}/core/helmet.d.ts +0 -0
- /package/dist/{app → lib}/core/helmet.js +0 -0
- /package/dist/{app → lib}/core/icons.d.ts +0 -0
- /package/dist/{app → lib}/core/icons.js +0 -0
- /package/dist/{app → lib}/core/plugins.d.ts +0 -0
- /package/dist/{app → lib}/core/plugins.js +0 -0
- /package/dist/{app → lib}/core/router.d.ts +0 -0
- /package/dist/{app → lib}/core/router.js +0 -0
- /package/dist/{app → lib}/core/types/combine.d.ts +0 -0
- /package/dist/{app → lib}/core/types/combine.js +0 -0
- /package/dist/{app → lib}/oas/graphql/index.d.ts +0 -0
- /package/dist/{app → lib}/oas/graphql/index.js +0 -0
- /package/dist/{app → lib}/oas/graphql/server.d.ts +0 -0
- /package/dist/{app → lib}/oas/graphql/server.js +0 -0
- /package/dist/{app → lib}/oas/parser/dereference/index.d.ts +0 -0
- /package/dist/{app → lib}/oas/parser/dereference/index.js +0 -0
- /package/dist/{app → lib}/oas/parser/dereference/resolveRef.d.ts +0 -0
- /package/dist/{app → lib}/oas/parser/dereference/resolveRef.js +0 -0
- /package/dist/{app → lib}/oas/parser/index.d.ts +0 -0
- /package/dist/{app → lib}/oas/parser/index.js +0 -0
- /package/dist/{app → lib}/oas/parser/upgrade/index.d.ts +0 -0
- /package/dist/{app → lib}/oas/parser/upgrade/index.js +0 -0
- /package/dist/{app → lib}/plugins/api-key/SettingsApiKeys.d.ts +0 -0
- /package/dist/{app → lib}/plugins/api-key/SettingsApiKeys.js +0 -0
- /package/dist/{app → lib}/plugins/api-key/index.d.ts +0 -0
- /package/dist/{app → lib}/plugins/api-key/index.js +0 -0
- /package/dist/{app → lib}/plugins/markdown/MdxPage.d.ts +0 -0
- /package/dist/{app → lib}/plugins/markdown/MdxPage.js +0 -0
- /package/dist/{app → lib}/plugins/markdown/Toc.d.ts +0 -0
- /package/dist/{app → lib}/plugins/markdown/Toc.js +0 -0
- /package/dist/{app → lib}/plugins/markdown/generateRoutes.d.ts +0 -0
- /package/dist/{app → lib}/plugins/markdown/generateRoutes.js +0 -0
- /package/dist/{app → lib}/plugins/markdown/index.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/MakeRequest.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/MethodBadge.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/MethodBadge.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/ParameterList.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/ParameterList.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/ParameterListItem.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/ParameterListItem.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/RequestBodySidecarBox.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/ResponsesSidecarBox.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/Select.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/Select.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/Sidecar.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/util/generateSchemaExample.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/util/urql.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.js +0 -0
- /package/dist/{app → lib}/plugins/openapi/worker/worker.d.ts +0 -0
- /package/dist/{app → lib}/plugins/openapi/worker/worker.js +0 -0
- /package/dist/{app → lib}/plugins/redirect/index.d.ts +0 -0
- /package/dist/{app → lib}/plugins/redirect/index.js +0 -0
- /package/dist/{app → lib}/ui/Callout.d.ts +0 -0
- /package/dist/{app → lib}/ui/Callout.js +0 -0
- /package/dist/{app → lib}/ui/Card.d.ts +0 -0
- /package/dist/{app → lib}/ui/Note.d.ts +0 -0
- /package/dist/{app → lib}/ui/Note.js +0 -0
- /package/dist/{app → lib}/util/MdxComponents.js +0 -0
- /package/dist/{app → lib}/util/cn.d.ts +0 -0
- /package/dist/{app → lib}/util/cn.js +0 -0
- /package/dist/{app → lib}/util/createWaitForNotify.js +0 -0
- /package/dist/{app → lib}/util/groupBy.d.ts +0 -0
- /package/dist/{app → lib}/util/groupBy.js +0 -0
- /package/dist/{app → lib}/util/joinPath.d.ts +0 -0
- /package/dist/{app → lib}/util/joinPath.js +0 -0
- /package/dist/{app → lib}/util/pastellize.d.ts +0 -0
- /package/dist/{app → lib}/util/pastellize.js +0 -0
- /package/dist/{app → lib}/util/slugify.js +0 -0
- /package/dist/{app → lib}/util/traverseNavigation.d.ts +0 -0
- /package/dist/{app → lib}/util/traverseNavigation.js +0 -0
- /package/dist/{app → lib}/util/useScrollToAnchor.d.ts +0 -0
- /package/dist/{app → lib}/util/useScrollToAnchor.js +0 -0
- /package/dist/{app → lib}/util/useScrollToTop.d.ts +0 -0
- /package/dist/{app → lib}/util/useScrollToTop.js +0 -0
- /package/src/{app → lib}/Heading.tsx +0 -0
- /package/src/{app → lib}/authentication/authentication.ts +0 -0
- /package/src/{app → lib}/authentication/openid.ts +0 -0
- /package/src/{app → lib}/components/AnchorLink.tsx +0 -0
- /package/src/{app → lib}/components/CategoryHeading.tsx +0 -0
- /package/src/{app → lib}/components/DynamicIcon.tsx +0 -0
- /package/src/{app → lib}/components/Header.tsx +0 -0
- /package/src/{app → lib}/components/Layout.tsx +0 -0
- /package/src/{app → lib}/components/Markdown.tsx +0 -0
- /package/src/{app → lib}/components/TopNavigation.tsx +0 -0
- /package/src/{app → lib}/components/context/ComponentsContext.tsx +0 -0
- /package/src/{app → lib}/components/context/DevPortalProvider.ts +0 -0
- /package/src/{app → lib}/components/context/PluginSystem.ts +0 -0
- /package/src/{app → lib}/components/context/ThemeContext.tsx +0 -0
- /package/src/{app → lib}/components/context/ViewportAnchorContext.tsx +0 -0
- /package/src/{app → lib}/components/navigation/SideNavigation.tsx +0 -0
- /package/src/{app → lib}/components/navigation/SideNavigationCategory.tsx +0 -0
- /package/src/{app → lib}/components/navigation/SideNavigationItem.tsx +0 -0
- /package/src/{app → lib}/components/navigation/SideNavigationWrapper.tsx +0 -0
- /package/src/{app → lib}/components/navigation/useNavigationCollapsibleState.ts +0 -0
- /package/src/{app → lib}/components/navigation/util.ts +0 -0
- /package/src/{app → lib}/core/DevPortalContext.ts +0 -0
- /package/src/{app → lib}/core/helmet.ts +0 -0
- /package/src/{app → lib}/core/icons.tsx +0 -0
- /package/src/{app → lib}/core/plugins.ts +0 -0
- /package/src/{app → lib}/core/router.tsx +0 -0
- /package/src/{app → lib}/core/types/combine.ts +0 -0
- /package/src/{app → lib}/oas/graphql/index.ts +0 -0
- /package/src/{app → lib}/oas/graphql/server.ts +0 -0
- /package/src/{app → lib}/oas/parser/dereference/index.ts +0 -0
- /package/src/{app → lib}/oas/parser/dereference/resolveRef.ts +0 -0
- /package/src/{app → lib}/oas/parser/index.ts +0 -0
- /package/src/{app → lib}/oas/parser/schemas/v3.0.json +0 -0
- /package/src/{app → lib}/oas/parser/schemas/v3.1.json +0 -0
- /package/src/{app → lib}/oas/parser/upgrade/index.ts +0 -0
- /package/src/{app → lib}/plugins/api-key/SettingsApiKeys.tsx +0 -0
- /package/src/{app → lib}/plugins/api-key/index.tsx +0 -0
- /package/src/{app → lib}/plugins/markdown/MdxPage.tsx +0 -0
- /package/src/{app → lib}/plugins/markdown/Toc.tsx +0 -0
- /package/src/{app → lib}/plugins/markdown/generateRoutes.tsx +0 -0
- /package/src/{app → lib}/plugins/markdown/index.tsx +0 -0
- /package/src/{app → lib}/plugins/openapi/MethodBadge.tsx +0 -0
- /package/src/{app → lib}/plugins/openapi/ParameterList.tsx +0 -0
- /package/src/{app → lib}/plugins/openapi/ParameterListItem.tsx +0 -0
- /package/src/{app → lib}/plugins/openapi/Select.tsx +0 -0
- /package/src/{app → lib}/plugins/openapi/util/generateSchemaExample.ts +0 -0
- /package/src/{app → lib}/plugins/openapi/util/urql.ts +0 -0
- /package/src/{app → lib}/plugins/openapi/worker/createSharedWorkerClient.ts +0 -0
- /package/src/{app → lib}/plugins/openapi/worker/worker.ts +0 -0
- /package/src/{app → lib}/plugins/redirect/index.tsx +0 -0
- /package/src/{app → lib}/ui/Callout.tsx +0 -0
- /package/src/{app → lib}/ui/Note.tsx +0 -0
- /package/src/{app → lib}/util/MdxComponents.tsx +0 -0
- /package/src/{app → lib}/util/cn.ts +0 -0
- /package/src/{app → lib}/util/createWaitForNotify.ts +0 -0
- /package/src/{app → lib}/util/groupBy.ts +0 -0
- /package/src/{app → lib}/util/joinPath.tsx +0 -0
- /package/src/{app → lib}/util/pastellize.ts +0 -0
- /package/src/{app → lib}/util/slugify.ts +0 -0
- /package/src/{app → lib}/util/traverseNavigation.ts +0 -0
- /package/src/{app → lib}/util/useScrollToAnchor.ts +0 -0
- /package/src/{app → lib}/util/useScrollToTop.ts +0 -0
|
@@ -13,7 +13,9 @@ import {
|
|
|
13
13
|
cacheExchange,
|
|
14
14
|
fetchExchange,
|
|
15
15
|
} from "./util/urql.js";
|
|
16
|
-
|
|
16
|
+
|
|
17
|
+
import { createSharedWorkerClient } from "zudoku/open-api-worker";
|
|
18
|
+
import type { createSharedWorkerClient as createSharedWorkerClientType } from "./worker/createSharedWorkerClient.js";
|
|
17
19
|
|
|
18
20
|
const OasContext = createContext<{ config: OasPluginConfig } | undefined>(
|
|
19
21
|
undefined,
|
|
@@ -82,7 +84,9 @@ export const openApiPlugin = (config: OasPluginConfig): DevPortalPlugin => {
|
|
|
82
84
|
url: config.server,
|
|
83
85
|
exchanges: [cacheExchange, fetchExchange],
|
|
84
86
|
})
|
|
85
|
-
: createSharedWorkerClient()
|
|
87
|
+
: (createSharedWorkerClient() as ReturnType<
|
|
88
|
+
typeof createSharedWorkerClientType
|
|
89
|
+
>);
|
|
86
90
|
|
|
87
91
|
return {
|
|
88
92
|
getNavigation: async (path: string) => {
|
|
@@ -0,0 +1,309 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Dialog,
|
|
3
|
+
DialogContent,
|
|
4
|
+
DialogDescription,
|
|
5
|
+
DialogHeader,
|
|
6
|
+
DialogTitle,
|
|
7
|
+
DialogTrigger,
|
|
8
|
+
} from "../../../components/Dialog.js";
|
|
9
|
+
import { Card, CardContent } from "../../../ui/Card.js";
|
|
10
|
+
import { Button } from "../../../ui/Button.js";
|
|
11
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from "../../../ui/Tabs.js";
|
|
12
|
+
import { Header } from "har-format";
|
|
13
|
+
import {
|
|
14
|
+
Fragment,
|
|
15
|
+
InputHTMLAttributes,
|
|
16
|
+
useEffect,
|
|
17
|
+
useRef,
|
|
18
|
+
useState,
|
|
19
|
+
} from "react";
|
|
20
|
+
import { TrashIcon } from "lucide-react";
|
|
21
|
+
import createVariantComponent from "../../../util/createVariantComponent.js";
|
|
22
|
+
import { SyntaxHighlight } from "../../../components/SyntaxHighlight.js";
|
|
23
|
+
import {
|
|
24
|
+
ColorizedParam,
|
|
25
|
+
DATA_ATTR,
|
|
26
|
+
usePastellizedColor,
|
|
27
|
+
} from "../ColorizedParam.js";
|
|
28
|
+
import { cn } from "../../../util/cn.js";
|
|
29
|
+
import { useMutation } from "@tanstack/react-query";
|
|
30
|
+
|
|
31
|
+
const InlineInput = createVariantComponent(
|
|
32
|
+
"input",
|
|
33
|
+
"px-2 bg-transparent h-8 font-mono text-xs m-2",
|
|
34
|
+
);
|
|
35
|
+
|
|
36
|
+
const ParameterValue = ({
|
|
37
|
+
part,
|
|
38
|
+
className,
|
|
39
|
+
...props
|
|
40
|
+
}: {
|
|
41
|
+
part: string;
|
|
42
|
+
} & InputHTMLAttributes<HTMLInputElement>) => {
|
|
43
|
+
const color = usePastellizedColor(part);
|
|
44
|
+
return (
|
|
45
|
+
<InlineInput
|
|
46
|
+
{...props}
|
|
47
|
+
className={cn(className, "opacity-80 data-[active=true]:opacity-100")}
|
|
48
|
+
style={{ color: `hsl(${color})` }}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
const Playground = ({
|
|
54
|
+
url,
|
|
55
|
+
host,
|
|
56
|
+
method,
|
|
57
|
+
defaultHeaders,
|
|
58
|
+
}: {
|
|
59
|
+
host: string;
|
|
60
|
+
url: string;
|
|
61
|
+
method: string;
|
|
62
|
+
defaultHeaders?: Header[];
|
|
63
|
+
}) => {
|
|
64
|
+
const [headers, setHeaders] = useState<Header[]>(
|
|
65
|
+
defaultHeaders ?? [{ name: "", value: "" }],
|
|
66
|
+
);
|
|
67
|
+
const [urlParts, setUrlParts] = useState<Header[]>(
|
|
68
|
+
url
|
|
69
|
+
.split("/")
|
|
70
|
+
.filter((part) => part.startsWith("{") && part.endsWith("}"))
|
|
71
|
+
.map((part) => ({ name: part, value: "" })),
|
|
72
|
+
);
|
|
73
|
+
|
|
74
|
+
useEffect(() => {
|
|
75
|
+
const lastHeader = headers.at(-1);
|
|
76
|
+
if (lastHeader?.value !== "" || lastHeader?.name !== "") {
|
|
77
|
+
setHeaders([...headers, { name: "", value: "" }]);
|
|
78
|
+
}
|
|
79
|
+
}, [headers]);
|
|
80
|
+
|
|
81
|
+
const x = useMutation({
|
|
82
|
+
mutationFn: async () => {
|
|
83
|
+
const fullUrl =
|
|
84
|
+
host +
|
|
85
|
+
url
|
|
86
|
+
.split("/")
|
|
87
|
+
.map((v) => urlParts.find((part) => part.name === v)?.value ?? v)
|
|
88
|
+
.join("/");
|
|
89
|
+
console.log(
|
|
90
|
+
fullUrl,
|
|
91
|
+
Object.fromEntries(
|
|
92
|
+
headers.map((header) => [header.name, header.value]),
|
|
93
|
+
),
|
|
94
|
+
);
|
|
95
|
+
const response = await fetch(fullUrl, {
|
|
96
|
+
// method,
|
|
97
|
+
headers: Object.fromEntries(
|
|
98
|
+
headers
|
|
99
|
+
.filter((h) => h.name)
|
|
100
|
+
.map((header) => [header.name, header.value]),
|
|
101
|
+
),
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
return {
|
|
105
|
+
status: response.status,
|
|
106
|
+
body: await response.text(),
|
|
107
|
+
};
|
|
108
|
+
},
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
const path = url.split("/").map((part) => (
|
|
112
|
+
<Fragment key={part}>
|
|
113
|
+
{part.startsWith("{") && part.endsWith("}") ? (
|
|
114
|
+
<ColorizedParam
|
|
115
|
+
name={part.slice(1, -1)}
|
|
116
|
+
backgroundOpacity="0"
|
|
117
|
+
onClick={() => {
|
|
118
|
+
console.log("asd");
|
|
119
|
+
}}
|
|
120
|
+
slug={part.slice(1, -1)}
|
|
121
|
+
>
|
|
122
|
+
{urlParts.find((p) => p.name === part)?.value}
|
|
123
|
+
</ColorizedParam>
|
|
124
|
+
) : (
|
|
125
|
+
part
|
|
126
|
+
)}
|
|
127
|
+
/
|
|
128
|
+
<wbr />
|
|
129
|
+
</Fragment>
|
|
130
|
+
));
|
|
131
|
+
|
|
132
|
+
return (
|
|
133
|
+
<Dialog>
|
|
134
|
+
<DialogTrigger>Open</DialogTrigger>
|
|
135
|
+
<DialogContent className="max-w-screen-xl">
|
|
136
|
+
<DialogHeader>
|
|
137
|
+
<DialogTitle>API Playground</DialogTitle>
|
|
138
|
+
<DialogDescription>
|
|
139
|
+
<div className="grid grid-cols-2 gap-2">
|
|
140
|
+
<Card>
|
|
141
|
+
<CardContent className="border-b border-border pt-4">
|
|
142
|
+
<div>URL</div>
|
|
143
|
+
<div className="flex gap-2">
|
|
144
|
+
<div className="border rounded border-border p-1.5 w-full">
|
|
145
|
+
{path}
|
|
146
|
+
</div>
|
|
147
|
+
<Button onClick={() => x.mutateAsync()}>Send</Button>
|
|
148
|
+
</div>
|
|
149
|
+
</CardContent>
|
|
150
|
+
<Tabs defaultValue="headers">
|
|
151
|
+
<CardContent className="border-b border-border py-4">
|
|
152
|
+
<TabsList>
|
|
153
|
+
<TabsTrigger value="headers">
|
|
154
|
+
Headers ({headers.length})
|
|
155
|
+
</TabsTrigger>
|
|
156
|
+
<TabsTrigger value="parameters">Parameters</TabsTrigger>
|
|
157
|
+
<TabsTrigger value="auth">Auth</TabsTrigger>
|
|
158
|
+
</TabsList>
|
|
159
|
+
</CardContent>
|
|
160
|
+
<CardContent>
|
|
161
|
+
<TabsContent value="headers">
|
|
162
|
+
<div className="grid grid-cols-[1fr_1fr_auto]">
|
|
163
|
+
{headers.map((header, i) => (
|
|
164
|
+
<div
|
|
165
|
+
key={i}
|
|
166
|
+
className="grid-cols-subgrid col-span-full grid items-center gap-x-2 has-[:focus]:bg-muted hover:bg-muted rounded overflow-hidden group"
|
|
167
|
+
>
|
|
168
|
+
{/*<input type="checkbox" />*/}
|
|
169
|
+
<InlineInput
|
|
170
|
+
onChange={(e) =>
|
|
171
|
+
setHeaders((headers) => {
|
|
172
|
+
const newHeaders = [...headers];
|
|
173
|
+
newHeaders[i] = {
|
|
174
|
+
...headers[i],
|
|
175
|
+
name: e.target.value,
|
|
176
|
+
};
|
|
177
|
+
return newHeaders;
|
|
178
|
+
})
|
|
179
|
+
}
|
|
180
|
+
value={header.name}
|
|
181
|
+
placeholder={"Name"}
|
|
182
|
+
className="peer"
|
|
183
|
+
/>
|
|
184
|
+
<InlineInput
|
|
185
|
+
onChange={(e) =>
|
|
186
|
+
setHeaders((headers) => {
|
|
187
|
+
const newHeaders = [...headers];
|
|
188
|
+
newHeaders[i] = {
|
|
189
|
+
name: "",
|
|
190
|
+
...headers.at(i),
|
|
191
|
+
value: e.target.value,
|
|
192
|
+
};
|
|
193
|
+
return newHeaders;
|
|
194
|
+
})
|
|
195
|
+
}
|
|
196
|
+
value={header.value}
|
|
197
|
+
placeholder={"Value"}
|
|
198
|
+
className="peer"
|
|
199
|
+
/>
|
|
200
|
+
<button
|
|
201
|
+
className="hover:bg-black/5 p-1 rounded mr-2 text-muted-foreground invisible group-hover:visible peer-focus:visible"
|
|
202
|
+
onClick={() => {
|
|
203
|
+
setHeaders((headers) =>
|
|
204
|
+
[...headers].toSpliced(i, 1),
|
|
205
|
+
);
|
|
206
|
+
}}
|
|
207
|
+
>
|
|
208
|
+
<TrashIcon size={16} />
|
|
209
|
+
</button>
|
|
210
|
+
<div className="col-span-full border-b border-border"></div>
|
|
211
|
+
</div>
|
|
212
|
+
))}
|
|
213
|
+
</div>
|
|
214
|
+
</TabsContent>
|
|
215
|
+
<TabsContent value="parameters">
|
|
216
|
+
Parameters
|
|
217
|
+
<div className="grid grid-cols-[1fr_1fr_auto]">
|
|
218
|
+
{urlParts.map(({ name, value }, i) => (
|
|
219
|
+
<div
|
|
220
|
+
key={i}
|
|
221
|
+
className="grid-cols-subgrid col-span-full grid items-center gap-x-2 has-[:focus]:bg-muted hover:bg-muted rounded overflow-hidden group"
|
|
222
|
+
>
|
|
223
|
+
{/*<input type="checkbox" />*/}
|
|
224
|
+
<InlineInput
|
|
225
|
+
onChange={(e) =>
|
|
226
|
+
setHeaders((headers) => {
|
|
227
|
+
const newHeaders = [...headers];
|
|
228
|
+
newHeaders[i] = {
|
|
229
|
+
...headers[i],
|
|
230
|
+
name: e.target.value,
|
|
231
|
+
};
|
|
232
|
+
return newHeaders;
|
|
233
|
+
})
|
|
234
|
+
}
|
|
235
|
+
value={name.slice(1, -1)}
|
|
236
|
+
disabled
|
|
237
|
+
placeholder={"Name"}
|
|
238
|
+
className="peer"
|
|
239
|
+
/>
|
|
240
|
+
<ParameterValue
|
|
241
|
+
part={name.slice(1, -1)}
|
|
242
|
+
onChange={(e) =>
|
|
243
|
+
setUrlParts((parts) => {
|
|
244
|
+
const newParts = [...parts];
|
|
245
|
+
newParts[i] = {
|
|
246
|
+
name: "",
|
|
247
|
+
...parts.at(i),
|
|
248
|
+
value: e.target.value,
|
|
249
|
+
};
|
|
250
|
+
return newParts;
|
|
251
|
+
})
|
|
252
|
+
}
|
|
253
|
+
{...{ [DATA_ATTR]: name.slice(1, -1) }}
|
|
254
|
+
value={value}
|
|
255
|
+
placeholder={"Value"}
|
|
256
|
+
className="peer"
|
|
257
|
+
/>
|
|
258
|
+
|
|
259
|
+
<div className="col-span-full border-b border-border"></div>
|
|
260
|
+
</div>
|
|
261
|
+
))}
|
|
262
|
+
</div>
|
|
263
|
+
</TabsContent>
|
|
264
|
+
<TabsContent value="auth">
|
|
265
|
+
<CardContent>
|
|
266
|
+
{url
|
|
267
|
+
.split("/")
|
|
268
|
+
.map((part, i) =>
|
|
269
|
+
part.startsWith("{") && part.endsWith("}")
|
|
270
|
+
? urlParts[i]
|
|
271
|
+
: part,
|
|
272
|
+
)
|
|
273
|
+
.join("/")}
|
|
274
|
+
</CardContent>
|
|
275
|
+
Change your password here.
|
|
276
|
+
</TabsContent>
|
|
277
|
+
</CardContent>
|
|
278
|
+
</Tabs>
|
|
279
|
+
</Card>
|
|
280
|
+
<Card>
|
|
281
|
+
<CardContent>
|
|
282
|
+
{method.toUpperCase()}
|
|
283
|
+
{url
|
|
284
|
+
.split("/")
|
|
285
|
+
.map((v) =>
|
|
286
|
+
v.startsWith("{") && v.endsWith("}")
|
|
287
|
+
? urlParts.find((part) => part.name === v)?.value ?? v
|
|
288
|
+
: v,
|
|
289
|
+
)
|
|
290
|
+
.join("/")}
|
|
291
|
+
<SyntaxHighlight
|
|
292
|
+
language="json"
|
|
293
|
+
noBackground
|
|
294
|
+
copyable={false}
|
|
295
|
+
className="text-xs"
|
|
296
|
+
code={x.data?.body ?? JSON.stringify("")}
|
|
297
|
+
/>
|
|
298
|
+
</CardContent>
|
|
299
|
+
{x.data?.status}
|
|
300
|
+
</Card>
|
|
301
|
+
</div>
|
|
302
|
+
</DialogDescription>
|
|
303
|
+
</DialogHeader>
|
|
304
|
+
</DialogContent>
|
|
305
|
+
</Dialog>
|
|
306
|
+
);
|
|
307
|
+
};
|
|
308
|
+
|
|
309
|
+
export { Playground };
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import * as React from "react"
|
|
2
|
+
import { Slot } from "@radix-ui/react-slot"
|
|
3
|
+
import { cva, type VariantProps } from "class-variance-authority"
|
|
4
|
+
import { cn } from "../util/cn.js";
|
|
5
|
+
|
|
6
|
+
const buttonVariants = cva(
|
|
7
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium transition-colors focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-ring disabled:pointer-events-none disabled:opacity-50",
|
|
8
|
+
{
|
|
9
|
+
variants: {
|
|
10
|
+
variant: {
|
|
11
|
+
default:
|
|
12
|
+
"bg-primary text-primary-foreground shadow hover:bg-primary/90",
|
|
13
|
+
destructive:
|
|
14
|
+
"bg-destructive text-destructive-foreground shadow-sm hover:bg-destructive/90",
|
|
15
|
+
outline:
|
|
16
|
+
"border border-input bg-background shadow-sm hover:bg-accent hover:text-accent-foreground",
|
|
17
|
+
secondary:
|
|
18
|
+
"bg-secondary text-secondary-foreground shadow-sm hover:bg-secondary/80",
|
|
19
|
+
ghost: "hover:bg-accent hover:text-accent-foreground",
|
|
20
|
+
link: "text-primary underline-offset-4 hover:underline",
|
|
21
|
+
},
|
|
22
|
+
size: {
|
|
23
|
+
default: "h-9 px-4 py-2",
|
|
24
|
+
sm: "h-8 rounded-md px-3 text-xs",
|
|
25
|
+
lg: "h-10 rounded-md px-8",
|
|
26
|
+
icon: "h-9 w-9",
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
variant: "default",
|
|
31
|
+
size: "default",
|
|
32
|
+
},
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
|
|
36
|
+
export interface ButtonProps
|
|
37
|
+
extends React.ButtonHTMLAttributes<HTMLButtonElement>,
|
|
38
|
+
VariantProps<typeof buttonVariants> {
|
|
39
|
+
asChild?: boolean
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
const Button = React.forwardRef<HTMLButtonElement, ButtonProps>(
|
|
43
|
+
({ className, variant, size, asChild = false, ...props }, ref) => {
|
|
44
|
+
const Comp = asChild ? Slot : "button"
|
|
45
|
+
return (
|
|
46
|
+
<Comp
|
|
47
|
+
className={cn(buttonVariants({ variant, size, className }))}
|
|
48
|
+
ref={ref}
|
|
49
|
+
{...props}
|
|
50
|
+
/>
|
|
51
|
+
)
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
Button.displayName = "Button"
|
|
55
|
+
|
|
56
|
+
export { Button, buttonVariants }
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import * as React from "react";
|
|
2
|
+
import * as TabsPrimitive from "@radix-ui/react-tabs";
|
|
3
|
+
import { cn } from "../util/cn.js";
|
|
4
|
+
|
|
5
|
+
const Tabs = TabsPrimitive.Root;
|
|
6
|
+
|
|
7
|
+
const TabsList = React.forwardRef<
|
|
8
|
+
React.ElementRef<typeof TabsPrimitive.List>,
|
|
9
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.List>
|
|
10
|
+
>(({ className, ...props }, ref) => (
|
|
11
|
+
<TabsPrimitive.List
|
|
12
|
+
ref={ref}
|
|
13
|
+
className={cn(
|
|
14
|
+
"inline-flex h-9 items-center justify-center rounded-lg bg-muted p-1 text-muted-foreground",
|
|
15
|
+
className,
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
));
|
|
20
|
+
TabsList.displayName = TabsPrimitive.List.displayName;
|
|
21
|
+
|
|
22
|
+
const TabsTrigger = React.forwardRef<
|
|
23
|
+
React.ElementRef<typeof TabsPrimitive.Trigger>,
|
|
24
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Trigger>
|
|
25
|
+
>(({ className, ...props }, ref) => (
|
|
26
|
+
<TabsPrimitive.Trigger
|
|
27
|
+
ref={ref}
|
|
28
|
+
className={cn(
|
|
29
|
+
"inline-flex items-center justify-center whitespace-nowrap rounded-md px-3 py-1 text-sm font-medium ring-offset-background transition-all focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50 data-[state=active]:bg-background data-[state=active]:text-foreground data-[state=active]:shadow",
|
|
30
|
+
className,
|
|
31
|
+
)}
|
|
32
|
+
{...props}
|
|
33
|
+
/>
|
|
34
|
+
));
|
|
35
|
+
TabsTrigger.displayName = TabsPrimitive.Trigger.displayName;
|
|
36
|
+
|
|
37
|
+
const TabsContent = React.forwardRef<
|
|
38
|
+
React.ElementRef<typeof TabsPrimitive.Content>,
|
|
39
|
+
React.ComponentPropsWithoutRef<typeof TabsPrimitive.Content>
|
|
40
|
+
>(({ className, ...props }, ref) => (
|
|
41
|
+
<TabsPrimitive.Content
|
|
42
|
+
ref={ref}
|
|
43
|
+
className={cn(
|
|
44
|
+
"mt-2 ring-offset-background focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2",
|
|
45
|
+
className,
|
|
46
|
+
)}
|
|
47
|
+
{...props}
|
|
48
|
+
/>
|
|
49
|
+
));
|
|
50
|
+
TabsContent.displayName = TabsPrimitive.Content.displayName;
|
|
51
|
+
|
|
52
|
+
export { Tabs, TabsList, TabsTrigger, TabsContent };
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { cva } from "class-variance-authority";
|
|
2
|
+
import { ClassValue } from "clsx";
|
|
3
|
+
import * as React from "react";
|
|
4
|
+
import { JSX } from "react/jsx-runtime";
|
|
5
|
+
import { cn } from "./cn.js";
|
|
6
|
+
|
|
7
|
+
const createVariantComponent = <
|
|
8
|
+
E extends keyof React.ReactHTML,
|
|
9
|
+
C extends ReturnType<typeof cva>,
|
|
10
|
+
>(
|
|
11
|
+
tag: E,
|
|
12
|
+
cvx: ClassValue | C,
|
|
13
|
+
// variantProps: Array<keyof VariantProps<C>> = [],
|
|
14
|
+
) => {
|
|
15
|
+
const MyVariant = ({
|
|
16
|
+
className,
|
|
17
|
+
...props
|
|
18
|
+
}: JSX.IntrinsicElements[E] & { className?: ClassValue }) =>
|
|
19
|
+
React.createElement(tag, {
|
|
20
|
+
...props,
|
|
21
|
+
className:
|
|
22
|
+
typeof cvx === "function" ? cvx({ className }) : cn(cvx, className),
|
|
23
|
+
});
|
|
24
|
+
|
|
25
|
+
MyVariant.displayName = `VariantComponent(${tag})`;
|
|
26
|
+
|
|
27
|
+
return MyVariant;
|
|
28
|
+
};
|
|
29
|
+
|
|
30
|
+
export default createVariantComponent;
|
package/src/ts.ts
ADDED
|
@@ -0,0 +1,94 @@
|
|
|
1
|
+
import path from "path";
|
|
2
|
+
import ts from "typescript";
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* Function to check if a TypeScript string is valid
|
|
6
|
+
* Used for tests
|
|
7
|
+
*/
|
|
8
|
+
export async function checkTypescriptString(code: string) {
|
|
9
|
+
const rootDir = process.cwd();
|
|
10
|
+
const inMemoryFileName = path.join(rootDir, "/src/temp.ts");
|
|
11
|
+
const configPath = ts.findConfigFile(
|
|
12
|
+
rootDir,
|
|
13
|
+
ts.sys.fileExists,
|
|
14
|
+
"tsconfig.json",
|
|
15
|
+
);
|
|
16
|
+
if (!configPath) {
|
|
17
|
+
throw new Error("Could not find a valid tsconfig.json");
|
|
18
|
+
}
|
|
19
|
+
const configFile = ts.readConfigFile(configPath, ts.sys.readFile);
|
|
20
|
+
const parsedCommandLine = ts.parseJsonConfigFileContent(
|
|
21
|
+
configFile.config,
|
|
22
|
+
ts.sys,
|
|
23
|
+
path.dirname(configPath),
|
|
24
|
+
);
|
|
25
|
+
|
|
26
|
+
// Custom compiler host to handle in-memory file and delegate to default host for others
|
|
27
|
+
const compilerHost: ts.CompilerHost = {
|
|
28
|
+
...ts.createCompilerHost(parsedCommandLine.options),
|
|
29
|
+
getSourceFile: (
|
|
30
|
+
fileName,
|
|
31
|
+
languageVersion,
|
|
32
|
+
onError,
|
|
33
|
+
shouldCreateNewSourceFile,
|
|
34
|
+
) => {
|
|
35
|
+
if (fileName === inMemoryFileName) {
|
|
36
|
+
return ts.createSourceFile(fileName, code, languageVersion, true);
|
|
37
|
+
}
|
|
38
|
+
return ts
|
|
39
|
+
.createCompilerHost(parsedCommandLine.options)
|
|
40
|
+
.getSourceFile(
|
|
41
|
+
fileName,
|
|
42
|
+
languageVersion,
|
|
43
|
+
onError,
|
|
44
|
+
shouldCreateNewSourceFile,
|
|
45
|
+
);
|
|
46
|
+
},
|
|
47
|
+
fileExists: (fileName) => {
|
|
48
|
+
if (fileName === inMemoryFileName) {
|
|
49
|
+
return true;
|
|
50
|
+
}
|
|
51
|
+
return ts.sys.fileExists(fileName);
|
|
52
|
+
},
|
|
53
|
+
readFile: (fileName) => {
|
|
54
|
+
if (fileName === inMemoryFileName) {
|
|
55
|
+
return code;
|
|
56
|
+
}
|
|
57
|
+
return ts.sys.readFile(fileName);
|
|
58
|
+
},
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
// Create a source file in memory
|
|
62
|
+
const sourceFile = ts.createSourceFile("tempFile.ts", code, 99, true);
|
|
63
|
+
|
|
64
|
+
// Create a program using the in-memory source file
|
|
65
|
+
const program = ts.createProgram({
|
|
66
|
+
rootNames: parsedCommandLine.fileNames.concat(inMemoryFileName),
|
|
67
|
+
options: parsedCommandLine.options,
|
|
68
|
+
host: compilerHost,
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
// Get all diagnostics for the program, which includes syntax and semantic errors
|
|
72
|
+
const diagnostics = ts.getPreEmitDiagnostics(program);
|
|
73
|
+
|
|
74
|
+
diagnostics.forEach((diagnostic) => {
|
|
75
|
+
if (diagnostic.file) {
|
|
76
|
+
const { line, character } = diagnostic.file.getLineAndCharacterOfPosition(
|
|
77
|
+
diagnostic.start!,
|
|
78
|
+
);
|
|
79
|
+
const message = ts.flattenDiagnosticMessageText(
|
|
80
|
+
diagnostic.messageText,
|
|
81
|
+
"\n",
|
|
82
|
+
);
|
|
83
|
+
console.log(
|
|
84
|
+
`${diagnostic.file.fileName} (${line + 1},${character + 1}): ${message}`,
|
|
85
|
+
);
|
|
86
|
+
} else {
|
|
87
|
+
console.log(
|
|
88
|
+
ts.flattenDiagnosticMessageText(diagnostic.messageText, "\n"),
|
|
89
|
+
);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
|
|
93
|
+
return diagnostics;
|
|
94
|
+
}
|
package/src/types.d.ts
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
declare module "slugify" {
|
|
2
|
+
declare function slugify(
|
|
3
|
+
string: string,
|
|
4
|
+
options?:
|
|
5
|
+
| {
|
|
6
|
+
replacement?: string;
|
|
7
|
+
remove?: RegExp;
|
|
8
|
+
lower?: boolean;
|
|
9
|
+
strict?: boolean;
|
|
10
|
+
locale?: string;
|
|
11
|
+
trim?: boolean;
|
|
12
|
+
}
|
|
13
|
+
| string,
|
|
14
|
+
): string;
|
|
15
|
+
|
|
16
|
+
export default slugify;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
declare module "virtual:zudoku-docs-plugins";
|
|
20
|
+
declare module "virtual:zudoku-api-plugins";
|
|
21
|
+
declare module "virtual:zudoku-config";
|
|
22
|
+
declare module "virtual:zudoku-auth";
|
|
23
|
+
declare module "virtual:zudoku-component";
|
|
24
|
+
declare module "zudoku/open-api-worker";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { writeFile } from "fs/promises";
|
|
2
|
+
import { build as viteBuild } from "vite";
|
|
3
|
+
import { getViteConfig } from "./config.js";
|
|
4
|
+
import { getBuildHtml } from "./html.js";
|
|
5
|
+
|
|
6
|
+
export async function runBuild(options: { dir: string }) {
|
|
7
|
+
const viteConfig = await getViteConfig({ dir: options.dir, mode: "build" });
|
|
8
|
+
|
|
9
|
+
const result = await viteBuild(viteConfig);
|
|
10
|
+
|
|
11
|
+
if (Array.isArray(result)) {
|
|
12
|
+
throw new Error("Build failed");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
if ("output" in result) {
|
|
16
|
+
const jsEntry = result.output.find(
|
|
17
|
+
(o) => "isEntry" in o && o.isEntry,
|
|
18
|
+
)?.fileName;
|
|
19
|
+
const cssEntry = result.output.find((o) =>
|
|
20
|
+
o.fileName.endsWith(".css"),
|
|
21
|
+
)?.fileName;
|
|
22
|
+
|
|
23
|
+
const html = getBuildHtml({
|
|
24
|
+
jsEntry: `/${jsEntry}`,
|
|
25
|
+
cssEntry: `/${cssEntry}`,
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
await writeFile(`${options.dir}/dist/index.html`, html, "utf-8");
|
|
29
|
+
return;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
throw new Error("Build failed");
|
|
33
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import assert from "node:assert";
|
|
2
|
+
import path from "node:path";
|
|
3
|
+
import test from "node:test";
|
|
4
|
+
import { loadConfig } from "./config.js";
|
|
5
|
+
|
|
6
|
+
test("Should correctly load zudoku.config.ts file", async (t) => {
|
|
7
|
+
const rootPath = path.resolve("../../samples/with-config/");
|
|
8
|
+
const config = await loadConfig(rootPath, "zudoku.config.ts");
|
|
9
|
+
assert.equal(config.default.ui.headerTitle, "My Portal");
|
|
10
|
+
});
|