@lukoweb/apitogo 0.1.23 → 0.1.37
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/README.md +92 -0
- package/cli.js +13 -13
- package/client.d.ts +8 -8
- package/dist/cli/cli.js +1117 -624
- package/dist/declarations/config/config.d.ts +4 -0
- package/dist/declarations/config/loader.d.ts +2 -0
- package/dist/declarations/config/resolve-modules.d.ts +34 -0
- package/dist/declarations/config/validators/InputNavigationSchema.d.ts +7 -7
- package/dist/declarations/config/validators/ModulesSchema.d.ts +417 -0
- package/dist/declarations/config/validators/ZudokuConfig.d.ts +123 -4
- package/dist/declarations/index.d.ts +3 -1
- package/dist/declarations/lib/authentication/components/ProductionUnlockPage.d.ts +1 -0
- package/dist/declarations/lib/authentication/hook.d.ts +3 -19
- package/dist/declarations/lib/authentication/providers/dev-portal-constants.d.ts +16 -0
- package/dist/declarations/lib/authentication/providers/dev-portal-utils.d.ts +9 -0
- package/dist/declarations/lib/authentication/providers/dev-portal.d.ts +39 -0
- package/dist/declarations/lib/authentication/state.d.ts +12 -26
- package/dist/declarations/lib/components/LandingLayout.d.ts +4 -0
- package/dist/declarations/lib/components/index.d.ts +2 -0
- package/dist/declarations/lib/plugins/api-keys/index.d.ts +2 -1
- package/dist/flat-config.d.ts +209 -24
- package/docs/components/alert.mdx +130 -0
- package/docs/components/badge.mdx +70 -0
- package/docs/components/button.mdx +132 -0
- package/docs/components/callout.mdx +112 -0
- package/docs/components/card.mdx +104 -0
- package/docs/components/checkbox.mdx +72 -0
- package/docs/components/client-only.mdx +79 -0
- package/docs/components/code-tabs.mdx +179 -0
- package/docs/components/dialog.mdx +167 -0
- package/docs/components/head.mdx +200 -0
- package/docs/components/icons.mdx +27 -0
- package/docs/components/input.mdx +96 -0
- package/docs/components/label.mdx +86 -0
- package/docs/components/link.mdx +242 -0
- package/docs/components/markdown.mdx +151 -0
- package/docs/components/mermaid.mdx +81 -0
- package/docs/components/playground.mdx +87 -0
- package/docs/components/secret.mdx +79 -0
- package/docs/components/select.mdx +176 -0
- package/docs/components/shadcn.mdx +73 -0
- package/docs/components/slider.mdx +108 -0
- package/docs/components/slot.mdx +119 -0
- package/docs/components/stepper.mdx +138 -0
- package/docs/components/switch.mdx +96 -0
- package/docs/components/syntax-highlight.mdx +602 -0
- package/docs/components/textarea.mdx +78 -0
- package/docs/components/tooltip.mdx +195 -0
- package/docs/components/typography.mdx +61 -0
- package/docs/concepts/auth-provider-api-identities.md +109 -0
- package/docs/configuration/ai-assistants.md +65 -0
- package/docs/configuration/api-catalog.md +109 -0
- package/docs/configuration/api-reference.md +397 -0
- package/docs/configuration/authentication-auth0.md +174 -0
- package/docs/configuration/authentication-azure-ad.md +238 -0
- package/docs/configuration/authentication-clerk.md +110 -0
- package/docs/configuration/authentication-firebase.md +62 -0
- package/docs/configuration/authentication-pingfederate.md +136 -0
- package/docs/configuration/authentication-supabase.md +226 -0
- package/docs/configuration/authentication.md +231 -0
- package/docs/configuration/build-configuration.mdx +147 -0
- package/docs/configuration/docs.md +282 -0
- package/docs/configuration/footer.mdx +214 -0
- package/docs/configuration/llms.md +90 -0
- package/docs/configuration/make-config.mdx +90 -0
- package/docs/configuration/navigation.mdx +422 -0
- package/docs/configuration/overview.md +380 -0
- package/docs/configuration/protected-routes.md +150 -0
- package/docs/configuration/search.md +163 -0
- package/docs/configuration/sentry.mdx +44 -0
- package/docs/configuration/site.md +124 -0
- package/docs/configuration/slots.mdx +125 -0
- package/docs/configuration/vite-config.md +18 -0
- package/docs/custom-plugins.md +285 -0
- package/docs/customization/colors-theme.mdx +276 -0
- package/docs/customization/fonts.md +110 -0
- package/docs/deploy/apache-nginx.md +41 -0
- package/docs/deploy/apitogo.md +139 -0
- package/docs/deploy/cloudflare-pages.md +75 -0
- package/docs/deploy/direct-upload.md +18 -0
- package/docs/deploy/github-pages.md +50 -0
- package/docs/deploy/vercel.md +103 -0
- package/docs/deployment.md +21 -0
- package/docs/extending/events.md +124 -0
- package/docs/guides/custom-pages.md +106 -0
- package/docs/guides/environment-variables.md +99 -0
- package/docs/guides/managing-api-keys-and-identities.md +172 -0
- package/docs/guides/mermaid.mdx +70 -0
- package/docs/guides/navigation-migration.md +87 -0
- package/docs/guides/navigation-rules.mdx +203 -0
- package/docs/guides/processors.mdx +234 -0
- package/docs/guides/static-files.md +55 -0
- package/docs/guides/transforming-examples.md +156 -0
- package/docs/guides/using-multiple-apis.md +87 -0
- package/docs/markdown/admonitions.md +128 -0
- package/docs/markdown/code-blocks.md +196 -0
- package/docs/markdown/frontmatter.md +173 -0
- package/docs/markdown/mdx.md +68 -0
- package/docs/markdown/overview.md +275 -0
- package/docs/plugins.md +5 -0
- package/docs/quickstart.md +87 -0
- package/docs/writing.mdx +72 -0
- package/package.json +170 -116
- package/src/app/ZuploBuildConfig.ts +36 -36
- package/src/app/defaultTheme.css +77 -77
- package/src/app/demo-cdn.html +37 -37
- package/src/app/demo.html +21 -21
- package/src/app/demo.tsx +77 -77
- package/src/app/entry.client.tsx +118 -118
- package/src/app/entry.server.tsx +160 -160
- package/src/app/env.ts +40 -40
- package/src/app/font.geist.css +73 -73
- package/src/app/main.css +390 -390
- package/src/app/main.tsx +8 -1
- package/src/app/polyfills.ts +47 -47
- package/src/app/processRoutes.tsx +51 -25
- package/src/app/sentry.ts +24 -24
- package/src/app/standalone.html +23 -23
- package/src/app/standalone.tsx +60 -60
- package/src/app/utils/createRedirectRoutes.ts +11 -11
- package/src/config/config.ts +32 -0
- package/src/config/create-plugin.ts +71 -71
- package/src/config/file-exists.ts +6 -6
- package/src/config/loader.ts +11 -1
- package/src/config/resolve-modules.ts +260 -0
- package/src/config/validators/BuildSchema.ts +95 -95
- package/src/config/validators/HeaderNavigationSchema.ts +41 -41
- package/src/config/validators/InputNavigationSchema.test-d.ts +178 -178
- package/src/config/validators/InputNavigationSchema.ts +206 -206
- package/src/config/validators/ModulesSchema.ts +312 -0
- package/src/config/validators/ProtectedRoutesSchema.ts +35 -35
- package/src/config/validators/ZudokuConfig.ts +766 -729
- package/src/config/validators/auth.ts +3 -3
- package/src/config/validators/reason-codes.ts +7 -7
- package/src/env.d.ts +11 -11
- package/src/index.ts +31 -0
- package/src/lib/MissingIcon.tsx +22 -22
- package/src/lib/assets/language-icons/bun.tsx +50 -50
- package/src/lib/assets/language-icons/c.tsx +31 -31
- package/src/lib/assets/language-icons/commonlisp.tsx +22 -22
- package/src/lib/assets/language-icons/cpp.tsx +35 -35
- package/src/lib/assets/language-icons/csharp.tsx +35 -35
- package/src/lib/assets/language-icons/css.tsx +36 -36
- package/src/lib/assets/language-icons/dart.tsx +39 -39
- package/src/lib/assets/language-icons/elixir.tsx +19 -19
- package/src/lib/assets/language-icons/go.tsx +19 -19
- package/src/lib/assets/language-icons/graphql.tsx +19 -19
- package/src/lib/assets/language-icons/html.tsx +24 -24
- package/src/lib/assets/language-icons/java.tsx +35 -35
- package/src/lib/assets/language-icons/javascript.tsx +11 -11
- package/src/lib/assets/language-icons/json.tsx +19 -19
- package/src/lib/assets/language-icons/kotlin.tsx +30 -30
- package/src/lib/assets/language-icons/markdown.tsx +19 -19
- package/src/lib/assets/language-icons/mdx.tsx +23 -23
- package/src/lib/assets/language-icons/npm.tsx +15 -15
- package/src/lib/assets/language-icons/objectivec.tsx +23 -23
- package/src/lib/assets/language-icons/ocaml.tsx +34 -34
- package/src/lib/assets/language-icons/php.tsx +19 -19
- package/src/lib/assets/language-icons/pnpm.tsx +32 -32
- package/src/lib/assets/language-icons/powershell.tsx +27 -27
- package/src/lib/assets/language-icons/python.tsx +23 -23
- package/src/lib/assets/language-icons/react.tsx +21 -21
- package/src/lib/assets/language-icons/ruby.tsx +19 -19
- package/src/lib/assets/language-icons/rust.tsx +19 -19
- package/src/lib/assets/language-icons/scala.tsx +19 -19
- package/src/lib/assets/language-icons/shell.tsx +19 -19
- package/src/lib/assets/language-icons/swift.tsx +19 -19
- package/src/lib/assets/language-icons/toml.tsx +23 -23
- package/src/lib/assets/language-icons/typescript.tsx +23 -23
- package/src/lib/assets/language-icons/xml.tsx +19 -19
- package/src/lib/assets/language-icons/yaml.tsx +23 -23
- package/src/lib/assets/language-icons/yarn.tsx +17 -17
- package/src/lib/assets/language-icons/zig.tsx +32 -32
- package/src/lib/auth/issuer.ts +34 -31
- package/src/lib/authentication/AuthenticationPlugin.tsx +33 -33
- package/src/lib/authentication/authentication.ts +48 -48
- package/src/lib/authentication/components/OAuthErrorPage.tsx +197 -197
- package/src/lib/authentication/components/ProductionUnlockPage.tsx +27 -0
- package/src/lib/authentication/components/SignOut.tsx +15 -15
- package/src/lib/authentication/constants.ts +1 -1
- package/src/lib/authentication/errors.ts +34 -34
- package/src/lib/authentication/hook.ts +141 -139
- package/src/lib/authentication/providers/auth0.tsx +91 -91
- package/src/lib/authentication/providers/azureb2c.tsx +223 -223
- package/src/lib/authentication/providers/dev-portal-constants.ts +21 -0
- package/src/lib/authentication/providers/dev-portal-utils.ts +107 -0
- package/src/lib/authentication/providers/dev-portal.tsx +270 -0
- package/src/lib/authentication/providers/firebase.tsx +486 -486
- package/src/lib/authentication/providers/openid.tsx +516 -516
- package/src/lib/authentication/providers/supabase.tsx +412 -412
- package/src/lib/authentication/providers/util.ts +26 -26
- package/src/lib/authentication/state.ts +179 -91
- package/src/lib/authentication/ui/icons/Apple.tsx +10 -10
- package/src/lib/authentication/ui/icons/Facebook.tsx +15 -15
- package/src/lib/authentication/ui/icons/Github.tsx +16 -16
- package/src/lib/authentication/ui/icons/Google.tsx +16 -16
- package/src/lib/authentication/ui/icons/Microsoft.tsx +12 -12
- package/src/lib/authentication/ui/icons/X.tsx +10 -10
- package/src/lib/authentication/utils/relativeRedirectUrl.ts +16 -16
- package/src/lib/components/AnchorLink.tsx +24 -24
- package/src/lib/components/Banner.tsx +52 -52
- package/src/lib/components/Bootstrap.tsx +77 -77
- package/src/lib/components/BuildCheck.tsx +87 -87
- package/src/lib/components/CategoryHeading.tsx +19 -19
- package/src/lib/components/ClientOnly.tsx +19 -19
- package/src/lib/components/ErrorPage.tsx +26 -26
- package/src/lib/components/Footer.tsx +140 -140
- package/src/lib/components/Framed.tsx +51 -51
- package/src/lib/components/Header.tsx +11 -3
- package/src/lib/components/HeaderNavigation.tsx +148 -148
- package/src/lib/components/Heading.tsx +84 -84
- package/src/lib/components/InlineCode.tsx +15 -15
- package/src/lib/components/LandingLayout.tsx +21 -0
- package/src/lib/components/LanguageIcon.tsx +199 -199
- package/src/lib/components/Markdown.tsx +55 -55
- package/src/lib/components/Meta.tsx +46 -46
- package/src/lib/components/MobileTopNavigation.tsx +11 -3
- package/src/lib/components/NotFoundPage.tsx +37 -37
- package/src/lib/components/PageProgress.tsx +28 -28
- package/src/lib/components/PagefindSearchMeta.tsx +14 -14
- package/src/lib/components/Pagination.tsx +44 -44
- package/src/lib/components/PathRenderer.tsx +61 -61
- package/src/lib/components/PluginHeads.tsx +17 -17
- package/src/lib/components/Search.tsx +70 -70
- package/src/lib/components/Slot.tsx +64 -64
- package/src/lib/components/Spinner.tsx +5 -5
- package/src/lib/components/StatusPage.tsx +96 -96
- package/src/lib/components/ThemeSwitch.tsx +49 -49
- package/src/lib/components/Typography.tsx +12 -12
- package/src/lib/components/Zudoku.tsx +106 -106
- package/src/lib/components/cache.ts +27 -27
- package/src/lib/components/context/RenderContext.ts +11 -11
- package/src/lib/components/context/RouterEventsEmitter.tsx +19 -19
- package/src/lib/components/context/SlotProvider.tsx +149 -149
- package/src/lib/components/context/ViewportAnchorContext.tsx +137 -137
- package/src/lib/components/context/ZudokuContext.ts +140 -140
- package/src/lib/components/context/ZudokuProvider.tsx +22 -22
- package/src/lib/components/context/ZudokuReactContext.tsx +17 -17
- package/src/lib/components/index.ts +2 -0
- package/src/lib/components/navigation/Navigation.tsx +51 -51
- package/src/lib/components/navigation/NavigationBadge.tsx +48 -48
- package/src/lib/components/navigation/NavigationFilterContext.tsx +28 -28
- package/src/lib/components/navigation/NavigationWrapper.tsx +49 -49
- package/src/lib/components/navigation/Toc.tsx +137 -137
- package/src/lib/components/navigation/ZudokuLogo.tsx +25 -25
- package/src/lib/components/navigation/ZuploLogo.tsx +14 -14
- package/src/lib/components/navigation/utils.ts +234 -234
- package/src/lib/core/RouteGuard.tsx +11 -1
- package/src/lib/core/ZudokuContext.ts +271 -271
- package/src/lib/core/plugins.ts +138 -138
- package/src/lib/core/react-query.ts +1 -1
- package/src/lib/core/router.ts +1 -1
- package/src/lib/core/transform-config.ts +67 -67
- package/src/lib/demo/DemoAnnouncement.tsx +17 -17
- package/src/lib/errors/ErrorAlert.tsx +28 -28
- package/src/lib/errors/RouterError.tsx +18 -18
- package/src/lib/errors/ServerError.tsx +5 -5
- package/src/lib/errors/TopLevelError.tsx +6 -6
- package/src/lib/hooks/index.ts +13 -13
- package/src/lib/hooks/useEvent.ts +41 -41
- package/src/lib/hooks/useHighlighter.ts +15 -15
- package/src/lib/hooks/useHotkey.ts +70 -70
- package/src/lib/icons.ts +2 -2
- package/src/lib/navigation/applyRules.ts +127 -127
- package/src/lib/navigation/pathMatcher.ts +81 -81
- package/src/lib/oas/graphql/circular.ts +69 -69
- package/src/lib/oas/graphql/constants.ts +2 -2
- package/src/lib/oas/graphql/index.ts +791 -791
- package/src/lib/oas/parser/dereference/index.ts +84 -84
- package/src/lib/oas/parser/dereference/resolveRef.ts +32 -32
- package/src/lib/oas/parser/index.ts +129 -129
- package/src/lib/oas/parser/schemas/v3.0.json +1489 -1489
- package/src/lib/oas/parser/schemas/v3.1.json +1298 -1298
- package/src/lib/oas/parser/upgrade/index.ts +174 -174
- package/src/lib/plugins/api-catalog/index.tsx +119 -119
- package/src/lib/plugins/api-keys/ProtectedRoute.tsx +33 -33
- package/src/lib/plugins/api-keys/index.tsx +274 -272
- package/src/lib/plugins/api-keys/settings/ApiKeyList.tsx +67 -67
- package/src/lib/plugins/custom-pages/index.tsx +32 -32
- package/src/lib/plugins/markdown/assets/ChatGPTLogo.tsx +11 -11
- package/src/lib/plugins/markdown/assets/ClaudeLogo.tsx +19 -19
- package/src/lib/plugins/markdown/index.tsx +62 -62
- package/src/lib/plugins/openapi/ColorizedParam.tsx +115 -115
- package/src/lib/plugins/openapi/Endpoint.tsx +85 -85
- package/src/lib/plugins/openapi/MCPEndpoint.tsx +273 -273
- package/src/lib/plugins/openapi/OasProvider.tsx +74 -74
- package/src/lib/plugins/openapi/OperationList.tsx +275 -275
- package/src/lib/plugins/openapi/ParamInfos.tsx +96 -96
- package/src/lib/plugins/openapi/ParameterList.tsx +53 -53
- package/src/lib/plugins/openapi/ParameterListItem.tsx +161 -161
- package/src/lib/plugins/openapi/PlaygroundDialogWrapper.tsx +67 -67
- package/src/lib/plugins/openapi/SidecarBox.tsx +57 -57
- package/src/lib/plugins/openapi/SimpleSelect.tsx +46 -46
- package/src/lib/plugins/openapi/client/GraphQLClient.tsx +73 -73
- package/src/lib/plugins/openapi/client/GraphQLContext.tsx +16 -16
- package/src/lib/plugins/openapi/client/createServer.ts +35 -35
- package/src/lib/plugins/openapi/client/useCreateQuery.ts +44 -44
- package/src/lib/plugins/openapi/components/ConstValue.tsx +24 -24
- package/src/lib/plugins/openapi/components/NonHighlightedCode.tsx +22 -22
- package/src/lib/plugins/openapi/components/SelectOnClick.tsx +29 -29
- package/src/lib/plugins/openapi/context.tsx +16 -16
- package/src/lib/plugins/openapi/graphql/fragment-masking.ts +104 -104
- package/src/lib/plugins/openapi/graphql/gql.ts +95 -95
- package/src/lib/plugins/openapi/graphql/graphql.ts +835 -835
- package/src/lib/plugins/openapi/graphql/index.ts +2 -2
- package/src/lib/plugins/openapi/index.tsx +221 -221
- package/src/lib/plugins/openapi/interfaces.ts +100 -100
- package/src/lib/plugins/openapi/playground/Headers.tsx +6 -6
- package/src/lib/plugins/openapi/playground/PathParams.tsx +53 -53
- package/src/lib/plugins/openapi/playground/Spinner.tsx +87 -87
- package/src/lib/plugins/openapi/playground/createUrl.ts +25 -25
- package/src/lib/plugins/openapi/playground/fileUtils.ts +36 -36
- package/src/lib/plugins/openapi/playground/rememberedIdentity.ts +26 -26
- package/src/lib/plugins/openapi/playground/request-panel/UrlPath.tsx +31 -31
- package/src/lib/plugins/openapi/playground/request-panel/UrlQueryParams.tsx +29 -29
- package/src/lib/plugins/openapi/playground/request-panel/useKeyValueFieldManager.ts +340 -340
- package/src/lib/plugins/openapi/playground/result-panel/ResponseStatusBar.tsx +117 -117
- package/src/lib/plugins/openapi/playground/result-panel/convertToTypes.ts +36 -36
- package/src/lib/plugins/openapi/playground/serializeQueryParams.ts +125 -125
- package/src/lib/plugins/openapi/playground/useRememberSkipLoginDialog.tsx +23 -23
- package/src/lib/plugins/openapi/processors/removeExtensions.ts +29 -29
- package/src/lib/plugins/openapi/processors/removeParameters.ts +103 -103
- package/src/lib/plugins/openapi/processors/removePaths.ts +57 -57
- package/src/lib/plugins/openapi/processors/traverse.ts +1 -1
- package/src/lib/plugins/openapi/schema/SchemaExampleAndDefault.tsx +39 -39
- package/src/lib/plugins/openapi/schema/UnionView.tsx +132 -132
- package/src/lib/plugins/openapi/schema/union-helpers.ts +123 -123
- package/src/lib/plugins/openapi/schema/utils.ts +49 -49
- package/src/lib/plugins/openapi/state.ts +36 -36
- package/src/lib/plugins/openapi/util/buildTagCategories.ts +54 -54
- package/src/lib/plugins/openapi/util/createHttpSnippet.ts +135 -135
- package/src/lib/plugins/openapi/util/createNavigationCategory.tsx +39 -39
- package/src/lib/plugins/openapi/util/generateSchemaExample.ts +191 -191
- package/src/lib/plugins/openapi/util/getRoutes.tsx +265 -265
- package/src/lib/plugins/openapi/util/methodColorMap.tsx +11 -11
- package/src/lib/plugins/openapi/util/methodToColor.ts +27 -27
- package/src/lib/plugins/openapi/util/sanitizeMarkdownForMetatag.tsx +32 -32
- package/src/lib/plugins/openapi/util/useWarmupSchema.ts +23 -23
- package/src/lib/plugins/search-inkeep/index.tsx +108 -108
- package/src/lib/plugins/search-inkeep/inkeep.ts +24 -24
- package/src/lib/plugins/search-pagefind/get-results.tsx +74 -74
- package/src/lib/plugins/search-pagefind/index.tsx +21 -21
- package/src/lib/plugins/search-pagefind/types.ts +118 -118
- package/src/lib/shiki-constants.ts +24 -24
- package/src/lib/testing/index.tsx +146 -146
- package/src/lib/ui/Accordion.tsx +55 -55
- package/src/lib/ui/Alert.tsx +84 -84
- package/src/lib/ui/AlertDialog.tsx +195 -195
- package/src/lib/ui/AspectRatio.tsx +5 -5
- package/src/lib/ui/Badge.tsx +48 -48
- package/src/lib/ui/Breadcrumb.tsx +115 -115
- package/src/lib/ui/Button.tsx +65 -65
- package/src/lib/ui/ButtonGroup.tsx +80 -80
- package/src/lib/ui/Callout.tsx +113 -113
- package/src/lib/ui/Card.tsx +95 -95
- package/src/lib/ui/Carousel.tsx +259 -259
- package/src/lib/ui/Checkbox.tsx +28 -28
- package/src/lib/ui/CodeBlock.tsx +92 -92
- package/src/lib/ui/CodeTabPanel.tsx +13 -13
- package/src/lib/ui/CodeTabs.tsx +161 -161
- package/src/lib/ui/Collapsible.tsx +31 -31
- package/src/lib/ui/Dialog.tsx +138 -138
- package/src/lib/ui/DismissibleAlert.tsx +74 -74
- package/src/lib/ui/Drawer.tsx +121 -121
- package/src/lib/ui/DropdownMenu.tsx +254 -254
- package/src/lib/ui/EmbeddedCodeBlock.tsx +99 -99
- package/src/lib/ui/Form.tsx +176 -176
- package/src/lib/ui/Frame.tsx +81 -81
- package/src/lib/ui/HoverCard.tsx +26 -26
- package/src/lib/ui/Input.tsx +23 -23
- package/src/lib/ui/InputGroup.tsx +168 -168
- package/src/lib/ui/Item.tsx +213 -213
- package/src/lib/ui/Kbd.tsx +28 -28
- package/src/lib/ui/Label.tsx +23 -23
- package/src/lib/ui/NativeSelect.tsx +48 -48
- package/src/lib/ui/NavigationMenu.tsx +169 -169
- package/src/lib/ui/Pagination.tsx +115 -115
- package/src/lib/ui/Popover.tsx +28 -28
- package/src/lib/ui/Progress.tsx +25 -25
- package/src/lib/ui/RadioGroup.tsx +41 -41
- package/src/lib/ui/ReactComponentDoc.tsx +68 -68
- package/src/lib/ui/ScrollArea.tsx +45 -45
- package/src/lib/ui/Secret.tsx +133 -133
- package/src/lib/ui/Select.tsx +184 -184
- package/src/lib/ui/Separator.tsx +25 -25
- package/src/lib/ui/Skeleton.tsx +15 -15
- package/src/lib/ui/Slider.tsx +25 -25
- package/src/lib/ui/Stepper.tsx +8 -8
- package/src/lib/ui/Switch.tsx +26 -26
- package/src/lib/ui/SyntaxHighlight.tsx +54 -54
- package/src/lib/ui/Tabs.tsx +52 -52
- package/src/lib/ui/Textarea.tsx +22 -22
- package/src/lib/ui/Toggle.tsx +42 -42
- package/src/lib/ui/ToggleGroup.tsx +58 -58
- package/src/lib/ui/Tooltip.tsx +65 -65
- package/src/lib/ui/Value.tsx +42 -42
- package/src/lib/ui/util.tsx +8 -8
- package/src/lib/util/cn.ts +6 -6
- package/src/lib/util/createVariantComponent.tsx +61 -61
- package/src/lib/util/ensureArray.ts +3 -3
- package/src/lib/util/flattenAllOf.ts +72 -72
- package/src/lib/util/flattenAllOfProcessor.ts +74 -74
- package/src/lib/util/hastToJsx.tsx +67 -67
- package/src/lib/util/humanFileSize.ts +15 -15
- package/src/lib/util/invariant.ts +52 -52
- package/src/lib/util/joinUrl.ts +60 -60
- package/src/lib/util/logInit.ts +9 -9
- package/src/lib/util/objectEntries.ts +5 -5
- package/src/lib/util/os.ts +18 -18
- package/src/lib/util/pastellize.ts +25 -25
- package/src/lib/util/problemJson.ts +63 -63
- package/src/lib/util/readFrontmatter.ts +14 -14
- package/src/lib/util/renderIf.ts +4 -4
- package/src/lib/util/scrollIntoViewIfNeeded.ts +18 -18
- package/src/lib/util/slugify.ts +21 -21
- package/src/lib/util/syncZustandState.ts +22 -22
- package/src/lib/util/traverse.ts +70 -70
- package/src/lib/util/types.ts +7 -7
- package/src/lib/util/url.ts +18 -18
- package/src/lib/util/useCopyToClipboard.ts +17 -17
- package/src/lib/util/useExposedProps.tsx +27 -27
- package/src/lib/util/useIsomorphicLayoutEffect.ts +6 -6
- package/src/lib/util/useLatest.ts +18 -18
- package/src/lib/util/useOnScreen.ts +34 -34
- package/src/lib/util/useScrollToAnchor.ts +70 -70
- package/src/lib/util/useScrollToTop.ts +18 -18
- package/src/types.d.ts +57 -53
- package/src/vite/api/SchemaManager.ts +371 -371
- package/src/vite/api/schema-codegen.ts +163 -163
- package/src/vite/config.ts +5 -1
- package/src/vite/css/collect.ts +42 -42
- package/src/vite/css/plugin.ts +105 -105
- package/src/vite/debug.ts +18 -18
- package/src/vite/dev-portal-env.ts +93 -0
- package/src/vite/html.ts +54 -54
- package/src/vite/index.ts +2 -2
- package/src/vite/mdx/rehype-extract-toc-with-jsx-export.ts +19 -19
- package/src/vite/mdx/rehype-extract-toc-with-jsx.ts +70 -70
- package/src/vite/mdx/remark-code-tabs.ts +47 -47
- package/src/vite/mdx/remark-inject-filepath.ts +13 -13
- package/src/vite/mdx/remark-last-modified.ts +103 -103
- package/src/vite/mdx/remark-link-rewrite.ts +23 -23
- package/src/vite/mdx/remark-normalize-image-url.ts +15 -15
- package/src/vite/mdx/remark-static-generation.ts +149 -149
- package/src/vite/mdx/utils.ts +32 -32
- package/src/vite/output.ts +261 -261
- package/src/vite/package-root.ts +12 -12
- package/src/vite/pagefind-dev-index.ts +100 -100
- package/src/vite/plugin-api-keys.ts +6 -1
- package/src/vite/plugin-api.ts +4 -1
- package/src/vite/plugin-auth.ts +5 -1
- package/src/vite/plugin-component.ts +1 -1
- package/src/vite/plugin-config-reload.ts +49 -49
- package/src/vite/plugin-doc-metadata.ts +45 -45
- package/src/vite/plugin-docs.ts +4 -1
- package/src/vite/plugin-metadata.ts +30 -30
- package/src/vite/plugin-modules.ts +144 -0
- package/src/vite/plugin-shiki-register.ts +97 -97
- package/src/vite/plugin-theme.ts +399 -399
- package/src/vite/plugin.ts +2 -0
- package/src/vite/prerender/utils.ts +76 -76
- package/src/vite/prerender/worker.ts +118 -118
- package/src/vite/reporter.ts +34 -34
- package/src/vite/shadcn-registry.ts +48 -48
- package/src/vite/sitemap.ts +78 -78
- package/src/vite/ssr-templates/cloudflare.ts +19 -19
- package/src/vite/ssr-templates/node.ts +25 -25
- package/src/vite/ssr-templates/vercel.ts +22 -22
- package/src/vite/zuplo.ts +30 -30
- package/src/vite-env.d.ts +6 -6
- package/src/zuplo/enrich-with-zuplo-mcp.ts +168 -168
- package/src/zuplo/enrich-with-zuplo.ts +256 -256
- package/src/zuplo/policy-types.ts +46 -46
- package/src/zuplo/with-zuplo-processors.ts +36 -36
- package/src/zuplo/with-zuplo.ts +14 -14
- package/LICENSE.md +0 -18
- package/dist/declarations/lib/components/navigation/ZudokuLogo.d.ts +0 -6
package/dist/cli/cli.js
CHANGED
|
@@ -131,7 +131,289 @@ import { stat } from "node:fs/promises";
|
|
|
131
131
|
var fileExists;
|
|
132
132
|
var init_file_exists = __esm({
|
|
133
133
|
"src/config/file-exists.ts"() {
|
|
134
|
-
fileExists = (
|
|
134
|
+
fileExists = (path37) => stat(path37).then(() => true).catch(() => false);
|
|
135
|
+
}
|
|
136
|
+
});
|
|
137
|
+
|
|
138
|
+
// src/config/validators/ModulesSchema.ts
|
|
139
|
+
import { z as z3 } from "zod";
|
|
140
|
+
var ModuleToggleSchema, DocsModuleSchema, LandingLinkSchema, LandingFeatureSchema, LandingHeroSchema, LandingContentSchema, DashboardContentSchema, ProfileContentSchema, PlanTierSchema, PlansContentSchema, SubmodulePageFields, LandingModuleSchema, UserManagementModuleSchema, ApiKeysModuleSchema, PlansModuleSchema, DashboardModuleSchema, UserPanelModuleSchema, ModulesSchema;
|
|
141
|
+
var init_ModulesSchema = __esm({
|
|
142
|
+
"src/config/validators/ModulesSchema.ts"() {
|
|
143
|
+
ModuleToggleSchema = z3.object({
|
|
144
|
+
enabled: z3.boolean().describe("Whether this module is active in the application.")
|
|
145
|
+
}).partial();
|
|
146
|
+
DocsModuleSchema = ModuleToggleSchema.extend({
|
|
147
|
+
files: z3.union([z3.string(), z3.array(z3.string())]).optional(),
|
|
148
|
+
publishMarkdown: z3.boolean().optional(),
|
|
149
|
+
defaultOptions: z3.object({
|
|
150
|
+
toc: z3.boolean(),
|
|
151
|
+
copyPage: z3.boolean().optional(),
|
|
152
|
+
disablePager: z3.boolean(),
|
|
153
|
+
showLastModified: z3.boolean(),
|
|
154
|
+
suggestEdit: z3.object({
|
|
155
|
+
url: z3.string(),
|
|
156
|
+
text: z3.string().optional()
|
|
157
|
+
}).optional()
|
|
158
|
+
}).partial().optional(),
|
|
159
|
+
llms: z3.object({
|
|
160
|
+
llmsTxt: z3.boolean().optional(),
|
|
161
|
+
llmsTxtFull: z3.boolean().optional(),
|
|
162
|
+
includeProtected: z3.boolean().optional()
|
|
163
|
+
}).optional()
|
|
164
|
+
});
|
|
165
|
+
LandingLinkSchema = z3.object({
|
|
166
|
+
label: z3.string(),
|
|
167
|
+
href: z3.string()
|
|
168
|
+
});
|
|
169
|
+
LandingFeatureSchema = z3.object({
|
|
170
|
+
title: z3.string(),
|
|
171
|
+
description: z3.string()
|
|
172
|
+
});
|
|
173
|
+
LandingHeroSchema = z3.object({
|
|
174
|
+
title: z3.string().optional(),
|
|
175
|
+
subtitle: z3.string().optional(),
|
|
176
|
+
description: z3.string().optional()
|
|
177
|
+
}).optional();
|
|
178
|
+
LandingContentSchema = z3.object({
|
|
179
|
+
hero: LandingHeroSchema,
|
|
180
|
+
features: z3.array(LandingFeatureSchema).optional(),
|
|
181
|
+
primaryAction: LandingLinkSchema.optional(),
|
|
182
|
+
secondaryAction: LandingLinkSchema.optional(),
|
|
183
|
+
showPoweredBy: z3.boolean().optional()
|
|
184
|
+
}).optional();
|
|
185
|
+
DashboardContentSchema = z3.object({
|
|
186
|
+
title: z3.string().optional(),
|
|
187
|
+
subtitle: z3.string().optional(),
|
|
188
|
+
description: z3.string().optional(),
|
|
189
|
+
quickLinks: z3.array(LandingLinkSchema).optional()
|
|
190
|
+
}).optional();
|
|
191
|
+
ProfileContentSchema = z3.object({
|
|
192
|
+
title: z3.string().optional(),
|
|
193
|
+
description: z3.string().optional()
|
|
194
|
+
}).optional();
|
|
195
|
+
PlanTierSchema = z3.object({
|
|
196
|
+
name: z3.string(),
|
|
197
|
+
price: z3.string().optional(),
|
|
198
|
+
description: z3.string().optional()
|
|
199
|
+
});
|
|
200
|
+
PlansContentSchema = z3.object({
|
|
201
|
+
title: z3.string().optional(),
|
|
202
|
+
description: z3.string().optional(),
|
|
203
|
+
tiers: z3.array(PlanTierSchema).optional()
|
|
204
|
+
}).optional();
|
|
205
|
+
SubmodulePageFields = {
|
|
206
|
+
page: z3.string().optional().describe(
|
|
207
|
+
"Path to a custom page component file, relative to the project root."
|
|
208
|
+
),
|
|
209
|
+
component: z3.custom().optional().describe("Custom React component for this sub-module page.")
|
|
210
|
+
};
|
|
211
|
+
LandingModuleSchema = ModuleToggleSchema.extend({
|
|
212
|
+
path: z3.string().default("/").describe("Route path for the landing page."),
|
|
213
|
+
component: z3.custom().optional().describe("Custom React component for the landing page."),
|
|
214
|
+
page: z3.string().optional().describe(
|
|
215
|
+
"Path to a custom landing page component file, relative to the project root."
|
|
216
|
+
),
|
|
217
|
+
layout: z3.enum(["default", "landing", "none"]).default("landing").describe(
|
|
218
|
+
"Layout wrapper: landing (header + footer), default (docs layout), or none."
|
|
219
|
+
),
|
|
220
|
+
content: LandingContentSchema.describe(
|
|
221
|
+
"Default landing page content when no custom component is provided."
|
|
222
|
+
)
|
|
223
|
+
});
|
|
224
|
+
UserManagementModuleSchema = ModuleToggleSchema.extend({
|
|
225
|
+
routes: z3.object({
|
|
226
|
+
login: z3.string().default("/signin"),
|
|
227
|
+
register: z3.string().default("/signup"),
|
|
228
|
+
profile: z3.string().default("profile"),
|
|
229
|
+
logout: z3.string().default("/signout")
|
|
230
|
+
}).partial().optional(),
|
|
231
|
+
page: SubmodulePageFields.page,
|
|
232
|
+
component: SubmodulePageFields.component,
|
|
233
|
+
content: ProfileContentSchema.describe(
|
|
234
|
+
"Default profile page content when no custom component is provided."
|
|
235
|
+
)
|
|
236
|
+
});
|
|
237
|
+
ApiKeysModuleSchema = ModuleToggleSchema.extend({
|
|
238
|
+
path: z3.string().default("settings/api-keys").describe("Route path for API key management.")
|
|
239
|
+
});
|
|
240
|
+
PlansModuleSchema = ModuleToggleSchema.extend({
|
|
241
|
+
path: z3.string().default("plans").describe("Route path for plans and subscription management."),
|
|
242
|
+
page: SubmodulePageFields.page,
|
|
243
|
+
component: SubmodulePageFields.component,
|
|
244
|
+
content: PlansContentSchema.describe(
|
|
245
|
+
"Default plans page content when no custom component is provided."
|
|
246
|
+
)
|
|
247
|
+
});
|
|
248
|
+
DashboardModuleSchema = ModuleToggleSchema.extend({
|
|
249
|
+
path: z3.string().default("dashboard").describe("Route path for the user dashboard."),
|
|
250
|
+
page: SubmodulePageFields.page,
|
|
251
|
+
component: SubmodulePageFields.component,
|
|
252
|
+
content: DashboardContentSchema.describe(
|
|
253
|
+
"Default dashboard page content when no custom component is provided."
|
|
254
|
+
)
|
|
255
|
+
});
|
|
256
|
+
UserPanelModuleSchema = ModuleToggleSchema.extend({
|
|
257
|
+
basePath: z3.string().default("/account").describe("Base path prefix for user panel routes."),
|
|
258
|
+
dashboard: DashboardModuleSchema.optional(),
|
|
259
|
+
userManagement: UserManagementModuleSchema.optional(),
|
|
260
|
+
apiKeys: ApiKeysModuleSchema.optional(),
|
|
261
|
+
plans: PlansModuleSchema.optional()
|
|
262
|
+
});
|
|
263
|
+
ModulesSchema = z3.object({
|
|
264
|
+
docs: DocsModuleSchema.optional().describe(
|
|
265
|
+
"Documentation module \u2014 MD/MDX pages and OpenAPI reference."
|
|
266
|
+
),
|
|
267
|
+
landing: LandingModuleSchema.optional().describe(
|
|
268
|
+
"Landing page module \u2014 marketing or home page."
|
|
269
|
+
),
|
|
270
|
+
userPanel: UserPanelModuleSchema.optional().describe(
|
|
271
|
+
"User panel module \u2014 authenticated user area with sub-modules."
|
|
272
|
+
)
|
|
273
|
+
}).optional();
|
|
274
|
+
}
|
|
275
|
+
});
|
|
276
|
+
|
|
277
|
+
// src/config/resolve-modules.ts
|
|
278
|
+
var hasExplicitModules, joinPanelPath, DEFAULT_LANDING_FEATURES, resolveLandingContent, DEFAULT_DASHBOARD_QUICK_LINKS, resolveDashboardContent, resolveProfileContent, resolvePlansContent, resolveModulesConfig;
|
|
279
|
+
var init_resolve_modules = __esm({
|
|
280
|
+
"src/config/resolve-modules.ts"() {
|
|
281
|
+
init_ModulesSchema();
|
|
282
|
+
hasExplicitModules = (config2) => config2.modules !== void 0;
|
|
283
|
+
joinPanelPath = (basePath, routePath) => {
|
|
284
|
+
if (routePath.startsWith("/")) {
|
|
285
|
+
return routePath.replace(/\/+$/, "") || "/";
|
|
286
|
+
}
|
|
287
|
+
const base = basePath.replace(/\/+$/, "");
|
|
288
|
+
const route = routePath.replace(/^\/+/, "");
|
|
289
|
+
if (!base) {
|
|
290
|
+
return `/${route}`;
|
|
291
|
+
}
|
|
292
|
+
return `/${`${base}/${route}`.replace(/^\/+/, "")}`;
|
|
293
|
+
};
|
|
294
|
+
DEFAULT_LANDING_FEATURES = [
|
|
295
|
+
{
|
|
296
|
+
title: "Documentation",
|
|
297
|
+
description: "Write guides and references in Markdown or MDX with full navigation and search."
|
|
298
|
+
},
|
|
299
|
+
{
|
|
300
|
+
title: "API Reference",
|
|
301
|
+
description: "Publish interactive OpenAPI docs with a built-in playground and code samples."
|
|
302
|
+
},
|
|
303
|
+
{
|
|
304
|
+
title: "Developer Portal",
|
|
305
|
+
description: "Extend with landing pages, authentication, API keys, and subscription modules."
|
|
306
|
+
}
|
|
307
|
+
];
|
|
308
|
+
resolveLandingContent = (config2, content) => {
|
|
309
|
+
const siteTitle = config2.metadata?.applicationName ?? config2.site?.title ?? "APIToGo";
|
|
310
|
+
return {
|
|
311
|
+
hero: {
|
|
312
|
+
title: content?.hero?.title ?? siteTitle,
|
|
313
|
+
subtitle: content?.hero?.subtitle ?? "Developer portal",
|
|
314
|
+
description: content?.hero?.description ?? config2.metadata?.description ?? "Ship beautiful API documentation and developer experiences with APIToGo."
|
|
315
|
+
},
|
|
316
|
+
features: content?.features ?? DEFAULT_LANDING_FEATURES,
|
|
317
|
+
primaryAction: content?.primaryAction ?? {
|
|
318
|
+
label: "Get started",
|
|
319
|
+
href: "/introduction"
|
|
320
|
+
},
|
|
321
|
+
secondaryAction: content?.secondaryAction ?? {
|
|
322
|
+
label: "API Reference",
|
|
323
|
+
href: "/api"
|
|
324
|
+
},
|
|
325
|
+
showPoweredBy: content?.showPoweredBy
|
|
326
|
+
};
|
|
327
|
+
};
|
|
328
|
+
DEFAULT_DASHBOARD_QUICK_LINKS = [
|
|
329
|
+
{ label: "Documentation", href: "/introduction" },
|
|
330
|
+
{ label: "API Reference", href: "/api" }
|
|
331
|
+
];
|
|
332
|
+
resolveDashboardContent = (content) => ({
|
|
333
|
+
title: content?.title ?? "Dashboard",
|
|
334
|
+
subtitle: content?.subtitle ?? "Account",
|
|
335
|
+
description: content?.description ?? "Overview of your account activity, documentation shortcuts, and next steps.",
|
|
336
|
+
quickLinks: content?.quickLinks ?? DEFAULT_DASHBOARD_QUICK_LINKS
|
|
337
|
+
});
|
|
338
|
+
resolveProfileContent = (content) => ({
|
|
339
|
+
title: content?.title ?? "Profile",
|
|
340
|
+
description: content?.description ?? "View your account details and manage profile settings."
|
|
341
|
+
});
|
|
342
|
+
resolvePlansContent = (content) => ({
|
|
343
|
+
title: content?.title ?? "Plans & billing",
|
|
344
|
+
description: content?.description ?? "Manage subscription tiers, billing details, and usage limits.",
|
|
345
|
+
tiers: content?.tiers
|
|
346
|
+
});
|
|
347
|
+
resolveModulesConfig = (config2) => {
|
|
348
|
+
const parsedModules = ModulesSchema.parse(config2.modules);
|
|
349
|
+
const modules = parsedModules ?? {};
|
|
350
|
+
const explicit = hasExplicitModules(config2);
|
|
351
|
+
const docsModule = modules.docs;
|
|
352
|
+
const docsEnabled = explicit ? docsModule?.enabled ?? true : true;
|
|
353
|
+
const landingModule = modules.landing;
|
|
354
|
+
const landingEnabled = landingModule?.enabled ?? false;
|
|
355
|
+
const userPanelModule = modules.userPanel;
|
|
356
|
+
const dashboardConfig = userPanelModule?.dashboard;
|
|
357
|
+
const userManagementConfig = userPanelModule?.userManagement;
|
|
358
|
+
const apiKeysModuleConfig = userPanelModule?.apiKeys;
|
|
359
|
+
const plansConfig = userPanelModule?.plans;
|
|
360
|
+
const dashboardEnabled = dashboardConfig?.enabled ?? (explicit ? false : false);
|
|
361
|
+
const userManagementEnabled = explicit ? userManagementConfig?.enabled ?? !!config2.authentication : !!config2.authentication;
|
|
362
|
+
const apiKeysEnabled = explicit ? apiKeysModuleConfig?.enabled ?? config2.apiKeys?.enabled ?? false : config2.apiKeys?.enabled ?? false;
|
|
363
|
+
const plansEnabled = plansConfig?.enabled ?? false;
|
|
364
|
+
const userPanelEnabled = userPanelModule?.enabled ?? (dashboardEnabled || userManagementEnabled || apiKeysEnabled || plansEnabled);
|
|
365
|
+
const basePath = userPanelModule?.basePath ?? "/account";
|
|
366
|
+
return {
|
|
367
|
+
docs: {
|
|
368
|
+
enabled: docsEnabled,
|
|
369
|
+
files: docsModule?.files ?? config2.docs?.files,
|
|
370
|
+
publishMarkdown: docsModule?.publishMarkdown ?? config2.docs?.publishMarkdown,
|
|
371
|
+
defaultOptions: docsModule?.defaultOptions ?? config2.docs?.defaultOptions,
|
|
372
|
+
llms: docsModule?.llms ?? config2.docs?.llms
|
|
373
|
+
},
|
|
374
|
+
landing: {
|
|
375
|
+
enabled: landingEnabled,
|
|
376
|
+
path: landingModule?.path ?? "/",
|
|
377
|
+
component: landingModule?.component,
|
|
378
|
+
layout: landingModule?.layout ?? "landing",
|
|
379
|
+
content: resolveLandingContent(config2, landingModule?.content)
|
|
380
|
+
},
|
|
381
|
+
userPanel: {
|
|
382
|
+
enabled: userPanelEnabled,
|
|
383
|
+
basePath,
|
|
384
|
+
dashboard: {
|
|
385
|
+
enabled: dashboardEnabled,
|
|
386
|
+
path: joinPanelPath(basePath, dashboardConfig?.path ?? "dashboard"),
|
|
387
|
+
content: resolveDashboardContent(dashboardConfig?.content)
|
|
388
|
+
},
|
|
389
|
+
userManagement: {
|
|
390
|
+
enabled: userManagementEnabled,
|
|
391
|
+
routes: {
|
|
392
|
+
login: userManagementConfig?.routes?.login ?? "/signin",
|
|
393
|
+
register: userManagementConfig?.routes?.register ?? "/signup",
|
|
394
|
+
profile: joinPanelPath(
|
|
395
|
+
basePath,
|
|
396
|
+
userManagementConfig?.routes?.profile ?? "profile"
|
|
397
|
+
),
|
|
398
|
+
logout: userManagementConfig?.routes?.logout ?? "/signout"
|
|
399
|
+
},
|
|
400
|
+
content: resolveProfileContent(userManagementConfig?.content)
|
|
401
|
+
},
|
|
402
|
+
apiKeys: {
|
|
403
|
+
enabled: apiKeysEnabled,
|
|
404
|
+
path: joinPanelPath(
|
|
405
|
+
basePath,
|
|
406
|
+
apiKeysModuleConfig?.path ?? "settings/api-keys"
|
|
407
|
+
)
|
|
408
|
+
},
|
|
409
|
+
plans: {
|
|
410
|
+
enabled: plansEnabled,
|
|
411
|
+
path: joinPanelPath(basePath, plansConfig?.path ?? "plans"),
|
|
412
|
+
content: resolvePlansContent(plansConfig?.content)
|
|
413
|
+
}
|
|
414
|
+
}
|
|
415
|
+
};
|
|
416
|
+
};
|
|
135
417
|
}
|
|
136
418
|
});
|
|
137
419
|
|
|
@@ -281,30 +563,30 @@ var init_objectEntries = __esm({
|
|
|
281
563
|
});
|
|
282
564
|
|
|
283
565
|
// src/vite/shadcn-registry.ts
|
|
284
|
-
import { z as
|
|
566
|
+
import { z as z4 } from "zod";
|
|
285
567
|
var registryItemCssSchema, registryItemSchema, fetchShadcnRegistryItem;
|
|
286
568
|
var init_shadcn_registry = __esm({
|
|
287
569
|
"src/vite/shadcn-registry.ts"() {
|
|
288
|
-
registryItemCssSchema =
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
() =>
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
570
|
+
registryItemCssSchema = z4.record(
|
|
571
|
+
z4.string(),
|
|
572
|
+
z4.lazy(
|
|
573
|
+
() => z4.union([
|
|
574
|
+
z4.string(),
|
|
575
|
+
z4.record(
|
|
576
|
+
z4.string(),
|
|
577
|
+
z4.union([z4.string(), z4.record(z4.string(), z4.string())])
|
|
296
578
|
)
|
|
297
579
|
])
|
|
298
580
|
)
|
|
299
581
|
);
|
|
300
|
-
registryItemSchema =
|
|
301
|
-
$schema:
|
|
302
|
-
name:
|
|
303
|
-
type:
|
|
304
|
-
cssVars:
|
|
305
|
-
theme:
|
|
306
|
-
light:
|
|
307
|
-
dark:
|
|
582
|
+
registryItemSchema = z4.object({
|
|
583
|
+
$schema: z4.literal("https://ui.shadcn.com/schema/registry-item.json"),
|
|
584
|
+
name: z4.string(),
|
|
585
|
+
type: z4.enum(["registry:theme", "registry:style"]),
|
|
586
|
+
cssVars: z4.object({
|
|
587
|
+
theme: z4.record(z4.string(), z4.string()).optional(),
|
|
588
|
+
light: z4.record(z4.string(), z4.string()).optional(),
|
|
589
|
+
dark: z4.record(z4.string(), z4.string()).optional()
|
|
308
590
|
}).optional(),
|
|
309
591
|
css: registryItemCssSchema.optional()
|
|
310
592
|
});
|
|
@@ -2633,99 +2915,99 @@ var init_icon_types = __esm({
|
|
|
2633
2915
|
});
|
|
2634
2916
|
|
|
2635
2917
|
// src/config/validators/HeaderNavigationSchema.ts
|
|
2636
|
-
import { z as
|
|
2918
|
+
import { z as z5 } from "zod";
|
|
2637
2919
|
var IconSchema, HeaderNavLinkItemSchema, HeaderNavGroupSchema, HeaderNavItemSchema, HeaderNavigationSchema;
|
|
2638
2920
|
var init_HeaderNavigationSchema = __esm({
|
|
2639
2921
|
"src/config/validators/HeaderNavigationSchema.ts"() {
|
|
2640
2922
|
init_icon_types();
|
|
2641
|
-
IconSchema =
|
|
2642
|
-
HeaderNavLinkItemSchema =
|
|
2643
|
-
label:
|
|
2923
|
+
IconSchema = z5.enum(IconNames);
|
|
2924
|
+
HeaderNavLinkItemSchema = z5.object({
|
|
2925
|
+
label: z5.string(),
|
|
2644
2926
|
icon: IconSchema.optional(),
|
|
2645
|
-
description:
|
|
2646
|
-
to:
|
|
2647
|
-
target:
|
|
2927
|
+
description: z5.string().optional(),
|
|
2928
|
+
to: z5.string(),
|
|
2929
|
+
target: z5.enum(["_self", "_blank"]).optional()
|
|
2648
2930
|
});
|
|
2649
|
-
HeaderNavGroupSchema =
|
|
2650
|
-
label:
|
|
2651
|
-
items:
|
|
2931
|
+
HeaderNavGroupSchema = z5.object({
|
|
2932
|
+
label: z5.string(),
|
|
2933
|
+
items: z5.array(HeaderNavLinkItemSchema)
|
|
2652
2934
|
});
|
|
2653
|
-
HeaderNavItemSchema =
|
|
2654
|
-
|
|
2655
|
-
label:
|
|
2935
|
+
HeaderNavItemSchema = z5.union([
|
|
2936
|
+
z5.object({
|
|
2937
|
+
label: z5.string(),
|
|
2656
2938
|
icon: IconSchema.optional(),
|
|
2657
|
-
to:
|
|
2658
|
-
target:
|
|
2939
|
+
to: z5.string(),
|
|
2940
|
+
target: z5.enum(["_self", "_blank"]).optional()
|
|
2659
2941
|
}),
|
|
2660
|
-
|
|
2661
|
-
label:
|
|
2662
|
-
items:
|
|
2942
|
+
z5.object({
|
|
2943
|
+
label: z5.string(),
|
|
2944
|
+
items: z5.array(z5.union([HeaderNavLinkItemSchema, HeaderNavGroupSchema]))
|
|
2663
2945
|
})
|
|
2664
2946
|
]);
|
|
2665
|
-
HeaderNavigationSchema =
|
|
2947
|
+
HeaderNavigationSchema = z5.array(HeaderNavItemSchema);
|
|
2666
2948
|
}
|
|
2667
2949
|
});
|
|
2668
2950
|
|
|
2669
2951
|
// src/config/validators/InputNavigationSchema.ts
|
|
2670
|
-
import { z as
|
|
2952
|
+
import { z as z6 } from "zod";
|
|
2671
2953
|
var IconSchema2, BadgeSchema, InputNavigationCategoryLinkDocSchema, DisplaySchema, NavigationModifyRuleSchema, NavigationInsertRuleSchema, NavigationRemoveRuleSchema, NavigationSortRuleSchema, NavigationMoveRuleSchema, NavigationRuleSchema, NavigationRulesSchema, InputNavigationDocSchema, InputNavigationLinkSchema, InputNavigationCustomPageSchema, InputNavigationSeparatorSchema, InputNavigationSectionSchema, InputNavigationFilterSchema, BaseInputNavigationCategorySchema, InputNavigationCategorySchema, InputNavigationItemSchema, InputNavigationSchema;
|
|
2672
2954
|
var init_InputNavigationSchema = __esm({
|
|
2673
2955
|
"src/config/validators/InputNavigationSchema.ts"() {
|
|
2674
|
-
IconSchema2 =
|
|
2675
|
-
BadgeSchema =
|
|
2676
|
-
label:
|
|
2956
|
+
IconSchema2 = z6.custom((f) => typeof f === "string");
|
|
2957
|
+
BadgeSchema = z6.object({
|
|
2958
|
+
label: z6.string(),
|
|
2677
2959
|
// prettier-ignore
|
|
2678
|
-
color:
|
|
2679
|
-
invert:
|
|
2680
|
-
className:
|
|
2960
|
+
color: z6.enum(["green", "blue", "yellow", "red", "purple", "indigo", "gray", "outline"]),
|
|
2961
|
+
invert: z6.boolean().optional(),
|
|
2962
|
+
className: z6.string().optional()
|
|
2681
2963
|
});
|
|
2682
|
-
InputNavigationCategoryLinkDocSchema =
|
|
2683
|
-
|
|
2684
|
-
|
|
2685
|
-
type:
|
|
2686
|
-
file:
|
|
2687
|
-
label:
|
|
2688
|
-
path:
|
|
2964
|
+
InputNavigationCategoryLinkDocSchema = z6.union([
|
|
2965
|
+
z6.string(),
|
|
2966
|
+
z6.object({
|
|
2967
|
+
type: z6.literal("doc"),
|
|
2968
|
+
file: z6.string(),
|
|
2969
|
+
label: z6.string().optional(),
|
|
2970
|
+
path: z6.string().optional()
|
|
2689
2971
|
})
|
|
2690
2972
|
]);
|
|
2691
|
-
DisplaySchema =
|
|
2692
|
-
|
|
2693
|
-
|
|
2973
|
+
DisplaySchema = z6.union([
|
|
2974
|
+
z6.enum(["auth", "anon", "always", "hide"]),
|
|
2975
|
+
z6.custom((val) => typeof val === "function")
|
|
2694
2976
|
]).optional();
|
|
2695
|
-
NavigationModifyRuleSchema =
|
|
2696
|
-
type:
|
|
2697
|
-
match:
|
|
2698
|
-
set:
|
|
2699
|
-
label:
|
|
2977
|
+
NavigationModifyRuleSchema = z6.object({
|
|
2978
|
+
type: z6.literal("modify"),
|
|
2979
|
+
match: z6.string(),
|
|
2980
|
+
set: z6.object({
|
|
2981
|
+
label: z6.string().optional(),
|
|
2700
2982
|
icon: IconSchema2.optional(),
|
|
2701
2983
|
badge: BadgeSchema.optional(),
|
|
2702
|
-
collapsed:
|
|
2703
|
-
collapsible:
|
|
2984
|
+
collapsed: z6.boolean().optional(),
|
|
2985
|
+
collapsible: z6.boolean().optional(),
|
|
2704
2986
|
display: DisplaySchema
|
|
2705
2987
|
})
|
|
2706
2988
|
});
|
|
2707
|
-
NavigationInsertRuleSchema =
|
|
2708
|
-
type:
|
|
2709
|
-
match:
|
|
2710
|
-
position:
|
|
2711
|
-
items:
|
|
2989
|
+
NavigationInsertRuleSchema = z6.object({
|
|
2990
|
+
type: z6.literal("insert"),
|
|
2991
|
+
match: z6.string(),
|
|
2992
|
+
position: z6.enum(["before", "after"]),
|
|
2993
|
+
items: z6.lazy(() => InputNavigationItemSchema.array())
|
|
2712
2994
|
});
|
|
2713
|
-
NavigationRemoveRuleSchema =
|
|
2714
|
-
type:
|
|
2715
|
-
match:
|
|
2995
|
+
NavigationRemoveRuleSchema = z6.object({
|
|
2996
|
+
type: z6.literal("remove"),
|
|
2997
|
+
match: z6.string()
|
|
2716
2998
|
});
|
|
2717
|
-
NavigationSortRuleSchema =
|
|
2718
|
-
type:
|
|
2719
|
-
match:
|
|
2720
|
-
by:
|
|
2999
|
+
NavigationSortRuleSchema = z6.object({
|
|
3000
|
+
type: z6.literal("sort"),
|
|
3001
|
+
match: z6.string(),
|
|
3002
|
+
by: z6.custom((val) => typeof val === "function")
|
|
2721
3003
|
});
|
|
2722
|
-
NavigationMoveRuleSchema =
|
|
2723
|
-
type:
|
|
2724
|
-
match:
|
|
2725
|
-
to:
|
|
2726
|
-
position:
|
|
3004
|
+
NavigationMoveRuleSchema = z6.object({
|
|
3005
|
+
type: z6.literal("move"),
|
|
3006
|
+
match: z6.string(),
|
|
3007
|
+
to: z6.string(),
|
|
3008
|
+
position: z6.enum(["before", "after"])
|
|
2727
3009
|
});
|
|
2728
|
-
NavigationRuleSchema =
|
|
3010
|
+
NavigationRuleSchema = z6.discriminatedUnion("type", [
|
|
2729
3011
|
NavigationModifyRuleSchema,
|
|
2730
3012
|
NavigationInsertRuleSchema,
|
|
2731
3013
|
NavigationRemoveRuleSchema,
|
|
@@ -2733,65 +3015,65 @@ var init_InputNavigationSchema = __esm({
|
|
|
2733
3015
|
NavigationMoveRuleSchema
|
|
2734
3016
|
]);
|
|
2735
3017
|
NavigationRulesSchema = NavigationRuleSchema.array();
|
|
2736
|
-
InputNavigationDocSchema =
|
|
2737
|
-
|
|
2738
|
-
|
|
2739
|
-
type:
|
|
2740
|
-
file:
|
|
3018
|
+
InputNavigationDocSchema = z6.union([
|
|
3019
|
+
z6.string(),
|
|
3020
|
+
z6.object({
|
|
3021
|
+
type: z6.literal("doc"),
|
|
3022
|
+
file: z6.string(),
|
|
2741
3023
|
// Custom URL path for this document (overrides file-based path)
|
|
2742
|
-
path:
|
|
3024
|
+
path: z6.string().optional(),
|
|
2743
3025
|
icon: IconSchema2.optional(),
|
|
2744
|
-
label:
|
|
3026
|
+
label: z6.string().optional(),
|
|
2745
3027
|
badge: BadgeSchema.optional(),
|
|
2746
3028
|
display: DisplaySchema
|
|
2747
3029
|
})
|
|
2748
3030
|
]);
|
|
2749
|
-
InputNavigationLinkSchema =
|
|
2750
|
-
type:
|
|
2751
|
-
to:
|
|
2752
|
-
label:
|
|
2753
|
-
target:
|
|
3031
|
+
InputNavigationLinkSchema = z6.object({
|
|
3032
|
+
type: z6.literal("link"),
|
|
3033
|
+
to: z6.string(),
|
|
3034
|
+
label: z6.string(),
|
|
3035
|
+
target: z6.enum(["_self", "_blank"]).optional(),
|
|
2754
3036
|
icon: IconSchema2.optional(),
|
|
2755
3037
|
badge: BadgeSchema.optional(),
|
|
2756
3038
|
display: DisplaySchema
|
|
2757
3039
|
});
|
|
2758
|
-
InputNavigationCustomPageSchema =
|
|
2759
|
-
type:
|
|
2760
|
-
path:
|
|
2761
|
-
label:
|
|
2762
|
-
element:
|
|
3040
|
+
InputNavigationCustomPageSchema = z6.object({
|
|
3041
|
+
type: z6.literal("custom-page"),
|
|
3042
|
+
path: z6.string(),
|
|
3043
|
+
label: z6.string().optional(),
|
|
3044
|
+
element: z6.any(),
|
|
2763
3045
|
icon: IconSchema2.optional(),
|
|
2764
3046
|
badge: BadgeSchema.optional(),
|
|
2765
3047
|
display: DisplaySchema,
|
|
2766
|
-
layout:
|
|
3048
|
+
layout: z6.enum(["default", "none"]).optional()
|
|
2767
3049
|
});
|
|
2768
|
-
InputNavigationSeparatorSchema =
|
|
2769
|
-
type:
|
|
3050
|
+
InputNavigationSeparatorSchema = z6.object({
|
|
3051
|
+
type: z6.literal("separator"),
|
|
2770
3052
|
display: DisplaySchema
|
|
2771
3053
|
});
|
|
2772
|
-
InputNavigationSectionSchema =
|
|
2773
|
-
type:
|
|
2774
|
-
label:
|
|
3054
|
+
InputNavigationSectionSchema = z6.object({
|
|
3055
|
+
type: z6.literal("section"),
|
|
3056
|
+
label: z6.string(),
|
|
2775
3057
|
display: DisplaySchema
|
|
2776
3058
|
});
|
|
2777
|
-
InputNavigationFilterSchema =
|
|
2778
|
-
type:
|
|
2779
|
-
placeholder:
|
|
3059
|
+
InputNavigationFilterSchema = z6.object({
|
|
3060
|
+
type: z6.literal("filter"),
|
|
3061
|
+
placeholder: z6.string().optional(),
|
|
2780
3062
|
display: DisplaySchema
|
|
2781
3063
|
});
|
|
2782
|
-
BaseInputNavigationCategorySchema =
|
|
2783
|
-
type:
|
|
3064
|
+
BaseInputNavigationCategorySchema = z6.object({
|
|
3065
|
+
type: z6.literal("category"),
|
|
2784
3066
|
icon: IconSchema2.optional(),
|
|
2785
|
-
label:
|
|
2786
|
-
collapsible:
|
|
2787
|
-
collapsed:
|
|
3067
|
+
label: z6.string(),
|
|
3068
|
+
collapsible: z6.boolean().optional(),
|
|
3069
|
+
collapsed: z6.boolean().optional(),
|
|
2788
3070
|
link: InputNavigationCategoryLinkDocSchema.optional(),
|
|
2789
3071
|
display: DisplaySchema
|
|
2790
3072
|
});
|
|
2791
3073
|
InputNavigationCategorySchema = BaseInputNavigationCategorySchema.extend({
|
|
2792
|
-
items:
|
|
3074
|
+
items: z6.lazy(() => InputNavigationItemSchema.array())
|
|
2793
3075
|
});
|
|
2794
|
-
InputNavigationItemSchema =
|
|
3076
|
+
InputNavigationItemSchema = z6.union([
|
|
2795
3077
|
InputNavigationDocSchema,
|
|
2796
3078
|
InputNavigationLinkSchema,
|
|
2797
3079
|
InputNavigationCustomPageSchema,
|
|
@@ -2865,23 +3147,23 @@ var init_ZudokuContext = __esm({
|
|
|
2865
3147
|
});
|
|
2866
3148
|
|
|
2867
3149
|
// src/config/validators/ProtectedRoutesSchema.ts
|
|
2868
|
-
import { z as
|
|
3150
|
+
import { z as z7 } from "zod/mini";
|
|
2869
3151
|
var ProtectedRoutesInputSchema, ProtectedRoutesSchema;
|
|
2870
3152
|
var init_ProtectedRoutesSchema = __esm({
|
|
2871
3153
|
"src/config/validators/ProtectedRoutesSchema.ts"() {
|
|
2872
3154
|
init_ZudokuContext();
|
|
2873
|
-
ProtectedRoutesInputSchema =
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
3155
|
+
ProtectedRoutesInputSchema = z7.optional(
|
|
3156
|
+
z7.union([
|
|
3157
|
+
z7.array(z7.string()),
|
|
3158
|
+
z7.record(
|
|
3159
|
+
z7.string(),
|
|
3160
|
+
z7.custom((val) => typeof val === "function")
|
|
2879
3161
|
)
|
|
2880
3162
|
])
|
|
2881
3163
|
);
|
|
2882
|
-
ProtectedRoutesSchema =
|
|
3164
|
+
ProtectedRoutesSchema = z7.pipe(
|
|
2883
3165
|
ProtectedRoutesInputSchema,
|
|
2884
|
-
|
|
3166
|
+
z7.transform(normalizeProtectedRoutes)
|
|
2885
3167
|
);
|
|
2886
3168
|
}
|
|
2887
3169
|
});
|
|
@@ -2899,18 +3181,18 @@ __export(ZudokuConfig_exports, {
|
|
|
2899
3181
|
});
|
|
2900
3182
|
import colors from "picocolors";
|
|
2901
3183
|
import { isValidElement as isValidElement2 } from "react";
|
|
2902
|
-
import { z as
|
|
3184
|
+
import { z as z8 } from "zod";
|
|
2903
3185
|
function validateConfig(config2, configPath) {
|
|
2904
3186
|
const validationResult = ZudokuConfig.safeParse(config2);
|
|
2905
3187
|
if (!validationResult.success) {
|
|
2906
3188
|
if (process.env.NODE_ENV === "production") {
|
|
2907
3189
|
throw new Error(
|
|
2908
3190
|
`Whoops, looks like there's an issue with your ${configPath ?? "config"}:
|
|
2909
|
-
${
|
|
3191
|
+
${z8.prettifyError(validationResult.error)}`
|
|
2910
3192
|
);
|
|
2911
3193
|
}
|
|
2912
3194
|
console.log(colors.yellow("Validation errors:"));
|
|
2913
|
-
console.log(colors.yellow(
|
|
3195
|
+
console.log(colors.yellow(z8.prettifyError(validationResult.error)));
|
|
2914
3196
|
}
|
|
2915
3197
|
}
|
|
2916
3198
|
var ThemeSchema, ApiCatalogCategorySchema, LanguageOption, AiAssistantCustomSchema, AiAssistantPresets, AiAssistantsSchema, ApiOptionsSchema, ApiConfigSchema, VersionConfigSchema, ApiSchema, ApiKeysSchema, LogoSchema, FooterSocialIcons, FooterSocialSchema, FooterSchema, SiteMapSchema, DEFAULT_DOCS_FILES, LlmsConfigSchema, DocsConfigSchema, Redirect, SearchSchema, AuthenticationSchema, MetadataSchema, FontConfigSchema, FontsConfigSchema, CssObject, ThemeConfigSchema, SiteSchema, PlacementPosition, HeaderConfigSchema, ApiCatalogSchema, CdnUrlSchema, BaseConfigSchema, ZudokuConfig;
|
|
@@ -2919,115 +3201,116 @@ var init_ZudokuConfig = __esm({
|
|
|
2919
3201
|
init_plugin_theme();
|
|
2920
3202
|
init_HeaderNavigationSchema();
|
|
2921
3203
|
init_InputNavigationSchema();
|
|
3204
|
+
init_ModulesSchema();
|
|
2922
3205
|
init_ProtectedRoutesSchema();
|
|
2923
|
-
ThemeSchema =
|
|
2924
|
-
background:
|
|
2925
|
-
foreground:
|
|
2926
|
-
card:
|
|
2927
|
-
cardForeground:
|
|
2928
|
-
popover:
|
|
2929
|
-
popoverForeground:
|
|
2930
|
-
primary:
|
|
2931
|
-
primaryForeground:
|
|
2932
|
-
secondary:
|
|
2933
|
-
secondaryForeground:
|
|
2934
|
-
muted:
|
|
2935
|
-
mutedForeground:
|
|
2936
|
-
accent:
|
|
2937
|
-
accentForeground:
|
|
2938
|
-
destructive:
|
|
2939
|
-
destructiveForeground:
|
|
2940
|
-
border:
|
|
2941
|
-
input:
|
|
2942
|
-
ring:
|
|
2943
|
-
radius:
|
|
3206
|
+
ThemeSchema = z8.object({
|
|
3207
|
+
background: z8.string(),
|
|
3208
|
+
foreground: z8.string(),
|
|
3209
|
+
card: z8.string(),
|
|
3210
|
+
cardForeground: z8.string(),
|
|
3211
|
+
popover: z8.string(),
|
|
3212
|
+
popoverForeground: z8.string(),
|
|
3213
|
+
primary: z8.string(),
|
|
3214
|
+
primaryForeground: z8.string(),
|
|
3215
|
+
secondary: z8.string(),
|
|
3216
|
+
secondaryForeground: z8.string(),
|
|
3217
|
+
muted: z8.string(),
|
|
3218
|
+
mutedForeground: z8.string(),
|
|
3219
|
+
accent: z8.string(),
|
|
3220
|
+
accentForeground: z8.string(),
|
|
3221
|
+
destructive: z8.string(),
|
|
3222
|
+
destructiveForeground: z8.string(),
|
|
3223
|
+
border: z8.string(),
|
|
3224
|
+
input: z8.string(),
|
|
3225
|
+
ring: z8.string(),
|
|
3226
|
+
radius: z8.string()
|
|
2944
3227
|
}).partial();
|
|
2945
|
-
ApiCatalogCategorySchema =
|
|
2946
|
-
label:
|
|
2947
|
-
tags:
|
|
3228
|
+
ApiCatalogCategorySchema = z8.object({
|
|
3229
|
+
label: z8.string(),
|
|
3230
|
+
tags: z8.array(z8.string())
|
|
2948
3231
|
});
|
|
2949
|
-
LanguageOption =
|
|
2950
|
-
value:
|
|
2951
|
-
label:
|
|
3232
|
+
LanguageOption = z8.object({
|
|
3233
|
+
value: z8.string().min(1),
|
|
3234
|
+
label: z8.string().min(1)
|
|
2952
3235
|
});
|
|
2953
|
-
AiAssistantCustomSchema =
|
|
2954
|
-
label:
|
|
2955
|
-
icon:
|
|
2956
|
-
url:
|
|
2957
|
-
|
|
2958
|
-
|
|
3236
|
+
AiAssistantCustomSchema = z8.object({
|
|
3237
|
+
label: z8.string(),
|
|
3238
|
+
icon: z8.custom().optional(),
|
|
3239
|
+
url: z8.union([
|
|
3240
|
+
z8.string(),
|
|
3241
|
+
z8.custom((val) => typeof val === "function")
|
|
2959
3242
|
])
|
|
2960
3243
|
});
|
|
2961
3244
|
AiAssistantPresets = ["claude", "chatgpt"];
|
|
2962
|
-
AiAssistantsSchema =
|
|
2963
|
-
|
|
2964
|
-
|
|
3245
|
+
AiAssistantsSchema = z8.union([
|
|
3246
|
+
z8.literal(false),
|
|
3247
|
+
z8.array(z8.union([z8.enum(AiAssistantPresets), AiAssistantCustomSchema]))
|
|
2965
3248
|
]).optional();
|
|
2966
|
-
ApiOptionsSchema =
|
|
2967
|
-
examplesLanguage:
|
|
2968
|
-
supportedLanguages:
|
|
2969
|
-
disablePlayground:
|
|
2970
|
-
disableSidecar:
|
|
2971
|
-
showVersionSelect:
|
|
2972
|
-
expandAllTags:
|
|
2973
|
-
showInfoPage:
|
|
2974
|
-
schemaDownload:
|
|
2975
|
-
transformExamples:
|
|
3249
|
+
ApiOptionsSchema = z8.object({
|
|
3250
|
+
examplesLanguage: z8.string(),
|
|
3251
|
+
supportedLanguages: z8.array(LanguageOption),
|
|
3252
|
+
disablePlayground: z8.boolean(),
|
|
3253
|
+
disableSidecar: z8.boolean(),
|
|
3254
|
+
showVersionSelect: z8.enum(["always", "if-available", "hide"]),
|
|
3255
|
+
expandAllTags: z8.boolean(),
|
|
3256
|
+
showInfoPage: z8.boolean(),
|
|
3257
|
+
schemaDownload: z8.object({ enabled: z8.boolean() }).partial(),
|
|
3258
|
+
transformExamples: z8.custom(
|
|
2976
3259
|
(val) => typeof val === "function"
|
|
2977
3260
|
),
|
|
2978
|
-
generateCodeSnippet:
|
|
3261
|
+
generateCodeSnippet: z8.custom(
|
|
2979
3262
|
(val) => typeof val === "function"
|
|
2980
3263
|
)
|
|
2981
3264
|
}).partial();
|
|
2982
|
-
ApiConfigSchema =
|
|
2983
|
-
server:
|
|
2984
|
-
path:
|
|
2985
|
-
categories:
|
|
3265
|
+
ApiConfigSchema = z8.object({
|
|
3266
|
+
server: z8.string(),
|
|
3267
|
+
path: z8.string(),
|
|
3268
|
+
categories: z8.array(ApiCatalogCategorySchema),
|
|
2986
3269
|
options: ApiOptionsSchema
|
|
2987
3270
|
}).partial();
|
|
2988
|
-
VersionConfigSchema =
|
|
2989
|
-
path:
|
|
2990
|
-
input:
|
|
2991
|
-
label:
|
|
3271
|
+
VersionConfigSchema = z8.object({
|
|
3272
|
+
path: z8.string(),
|
|
3273
|
+
input: z8.string(),
|
|
3274
|
+
label: z8.string().optional()
|
|
2992
3275
|
});
|
|
2993
|
-
ApiSchema =
|
|
2994
|
-
|
|
2995
|
-
type:
|
|
2996
|
-
input:
|
|
3276
|
+
ApiSchema = z8.discriminatedUnion("type", [
|
|
3277
|
+
z8.object({
|
|
3278
|
+
type: z8.literal("url"),
|
|
3279
|
+
input: z8.union([z8.string(), z8.array(VersionConfigSchema)]),
|
|
2997
3280
|
...ApiConfigSchema.shape
|
|
2998
3281
|
}),
|
|
2999
|
-
|
|
3000
|
-
type:
|
|
3001
|
-
input:
|
|
3002
|
-
|
|
3003
|
-
|
|
3282
|
+
z8.object({
|
|
3283
|
+
type: z8.literal("file"),
|
|
3284
|
+
input: z8.union([
|
|
3285
|
+
z8.string(),
|
|
3286
|
+
z8.array(z8.union([z8.string(), VersionConfigSchema]))
|
|
3004
3287
|
]),
|
|
3005
3288
|
...ApiConfigSchema.shape
|
|
3006
3289
|
}),
|
|
3007
|
-
|
|
3008
|
-
type:
|
|
3009
|
-
input:
|
|
3290
|
+
z8.object({
|
|
3291
|
+
type: z8.literal("raw"),
|
|
3292
|
+
input: z8.string(),
|
|
3010
3293
|
...ApiConfigSchema.shape
|
|
3011
3294
|
})
|
|
3012
3295
|
]);
|
|
3013
|
-
ApiKeysSchema =
|
|
3014
|
-
enabled:
|
|
3015
|
-
getConsumers:
|
|
3296
|
+
ApiKeysSchema = z8.object({
|
|
3297
|
+
enabled: z8.boolean(),
|
|
3298
|
+
getConsumers: z8.custom(
|
|
3016
3299
|
(val) => typeof val === "function"
|
|
3017
3300
|
).optional(),
|
|
3018
|
-
rollKey:
|
|
3301
|
+
rollKey: z8.custom(
|
|
3019
3302
|
(val) => typeof val === "function"
|
|
3020
3303
|
).optional(),
|
|
3021
|
-
deleteKey:
|
|
3022
|
-
updateKeyDescription:
|
|
3023
|
-
createKey:
|
|
3304
|
+
deleteKey: z8.custom((val) => typeof val === "function").optional(),
|
|
3305
|
+
updateKeyDescription: z8.custom((val) => typeof val === "function").optional(),
|
|
3306
|
+
createKey: z8.custom((val) => typeof val === "function").optional()
|
|
3024
3307
|
});
|
|
3025
|
-
LogoSchema =
|
|
3026
|
-
src:
|
|
3027
|
-
alt:
|
|
3028
|
-
width:
|
|
3029
|
-
href:
|
|
3030
|
-
reloadDocument:
|
|
3308
|
+
LogoSchema = z8.object({
|
|
3309
|
+
src: z8.object({ light: z8.string(), dark: z8.string() }),
|
|
3310
|
+
alt: z8.string().optional(),
|
|
3311
|
+
width: z8.string().or(z8.number()).optional(),
|
|
3312
|
+
href: z8.string().optional(),
|
|
3313
|
+
reloadDocument: z8.boolean().optional()
|
|
3031
3314
|
});
|
|
3032
3315
|
FooterSocialIcons = [
|
|
3033
3316
|
"reddit",
|
|
@@ -3045,38 +3328,38 @@ var init_ZudokuConfig = __esm({
|
|
|
3045
3328
|
"whatsapp",
|
|
3046
3329
|
"telegram"
|
|
3047
3330
|
];
|
|
3048
|
-
FooterSocialSchema =
|
|
3049
|
-
label:
|
|
3050
|
-
href:
|
|
3051
|
-
icon:
|
|
3052
|
-
|
|
3053
|
-
|
|
3331
|
+
FooterSocialSchema = z8.object({
|
|
3332
|
+
label: z8.string().optional(),
|
|
3333
|
+
href: z8.string(),
|
|
3334
|
+
icon: z8.union([
|
|
3335
|
+
z8.enum(FooterSocialIcons),
|
|
3336
|
+
z8.custom((val) => isValidElement2(val))
|
|
3054
3337
|
]).optional()
|
|
3055
3338
|
});
|
|
3056
|
-
FooterSchema =
|
|
3057
|
-
columns:
|
|
3058
|
-
|
|
3059
|
-
position:
|
|
3060
|
-
title:
|
|
3061
|
-
links:
|
|
3339
|
+
FooterSchema = z8.object({
|
|
3340
|
+
columns: z8.array(
|
|
3341
|
+
z8.object({
|
|
3342
|
+
position: z8.enum(["start", "center", "end"]).optional(),
|
|
3343
|
+
title: z8.string(),
|
|
3344
|
+
links: z8.array(z8.object({ label: z8.string(), href: z8.string() }))
|
|
3062
3345
|
})
|
|
3063
3346
|
).optional(),
|
|
3064
|
-
social:
|
|
3065
|
-
copyright:
|
|
3347
|
+
social: z8.array(FooterSocialSchema).optional(),
|
|
3348
|
+
copyright: z8.string().optional(),
|
|
3066
3349
|
logo: LogoSchema.optional(),
|
|
3067
|
-
position:
|
|
3350
|
+
position: z8.enum(["start", "center", "end"]).optional()
|
|
3068
3351
|
}).optional();
|
|
3069
|
-
SiteMapSchema =
|
|
3352
|
+
SiteMapSchema = z8.object({
|
|
3070
3353
|
/**
|
|
3071
3354
|
* Base url of your website
|
|
3072
3355
|
*/
|
|
3073
|
-
siteUrl:
|
|
3356
|
+
siteUrl: z8.string(),
|
|
3074
3357
|
/**
|
|
3075
3358
|
* Change frequency.
|
|
3076
3359
|
* @default 'daily'
|
|
3077
3360
|
*/
|
|
3078
|
-
changefreq:
|
|
3079
|
-
|
|
3361
|
+
changefreq: z8.optional(
|
|
3362
|
+
z8.enum([
|
|
3080
3363
|
"always",
|
|
3081
3364
|
"hourly",
|
|
3082
3365
|
"daily",
|
|
@@ -3090,101 +3373,101 @@ var init_ZudokuConfig = __esm({
|
|
|
3090
3373
|
* Priority
|
|
3091
3374
|
* @default 0.7
|
|
3092
3375
|
*/
|
|
3093
|
-
priority:
|
|
3094
|
-
outDir:
|
|
3376
|
+
priority: z8.optional(z8.number()),
|
|
3377
|
+
outDir: z8.string().optional(),
|
|
3095
3378
|
/**
|
|
3096
3379
|
* Add <lastmod/> property.
|
|
3097
3380
|
* @default true
|
|
3098
3381
|
*/
|
|
3099
|
-
autoLastmod:
|
|
3382
|
+
autoLastmod: z8.boolean().optional(),
|
|
3100
3383
|
/**
|
|
3101
3384
|
* Array of relative paths to exclude from listing on sitemap.xml or sitemap-*.xml.
|
|
3102
3385
|
* @example ['/page-0', '/page/example']
|
|
3103
3386
|
*/
|
|
3104
|
-
exclude:
|
|
3105
|
-
|
|
3106
|
-
|
|
3387
|
+
exclude: z8.union([
|
|
3388
|
+
z8.custom((val) => typeof val === "function"),
|
|
3389
|
+
z8.array(z8.string())
|
|
3107
3390
|
]).optional()
|
|
3108
3391
|
}).optional();
|
|
3109
3392
|
DEFAULT_DOCS_FILES = "/pages/**/*.{md,mdx}";
|
|
3110
|
-
LlmsConfigSchema =
|
|
3111
|
-
llmsTxt:
|
|
3393
|
+
LlmsConfigSchema = z8.object({
|
|
3394
|
+
llmsTxt: z8.boolean().default(false).describe(
|
|
3112
3395
|
"When enabled, generates an llms.txt file following the spec at https://llmstxt.org/. This file provides a summary with links to all documentation."
|
|
3113
3396
|
),
|
|
3114
|
-
llmsTxtFull:
|
|
3397
|
+
llmsTxtFull: z8.boolean().default(false).describe(
|
|
3115
3398
|
"When enabled, generates an llms-full.txt file with the complete content of all markdown documents for LLM consumption."
|
|
3116
3399
|
),
|
|
3117
|
-
includeProtected:
|
|
3400
|
+
includeProtected: z8.boolean().default(false).describe(
|
|
3118
3401
|
"When enabled, includes content from protected routes in the generated .md files and llms.txt files. By default, protected routes are excluded."
|
|
3119
3402
|
)
|
|
3120
3403
|
}).partial();
|
|
3121
|
-
DocsConfigSchema =
|
|
3122
|
-
files:
|
|
3123
|
-
publishMarkdown:
|
|
3404
|
+
DocsConfigSchema = z8.object({
|
|
3405
|
+
files: z8.union([z8.string(), z8.array(z8.string())]).transform((val) => typeof val === "string" ? [val] : val).default([DEFAULT_DOCS_FILES]),
|
|
3406
|
+
publishMarkdown: z8.boolean().default(false).describe(
|
|
3124
3407
|
"When enabled, generates .md files for each document during build. Access documents at their URL path with .md extension (e.g., /foo/hello.md). Markdown files are generated without frontmatter."
|
|
3125
3408
|
),
|
|
3126
|
-
defaultOptions:
|
|
3127
|
-
toc:
|
|
3128
|
-
copyPage:
|
|
3129
|
-
disablePager:
|
|
3130
|
-
showLastModified:
|
|
3131
|
-
suggestEdit:
|
|
3132
|
-
url:
|
|
3133
|
-
text:
|
|
3409
|
+
defaultOptions: z8.object({
|
|
3410
|
+
toc: z8.boolean(),
|
|
3411
|
+
copyPage: z8.boolean().optional(),
|
|
3412
|
+
disablePager: z8.boolean(),
|
|
3413
|
+
showLastModified: z8.boolean(),
|
|
3414
|
+
suggestEdit: z8.object({
|
|
3415
|
+
url: z8.string(),
|
|
3416
|
+
text: z8.string().optional()
|
|
3134
3417
|
}).optional()
|
|
3135
3418
|
}).partial().optional(),
|
|
3136
3419
|
llms: LlmsConfigSchema.optional()
|
|
3137
3420
|
});
|
|
3138
|
-
Redirect =
|
|
3139
|
-
from:
|
|
3140
|
-
to:
|
|
3421
|
+
Redirect = z8.object({
|
|
3422
|
+
from: z8.string(),
|
|
3423
|
+
to: z8.string()
|
|
3141
3424
|
});
|
|
3142
|
-
SearchSchema =
|
|
3425
|
+
SearchSchema = z8.discriminatedUnion("type", [
|
|
3143
3426
|
// looseObject to allow additional properties so the
|
|
3144
3427
|
// user can set other inkeep settings
|
|
3145
|
-
|
|
3146
|
-
type:
|
|
3147
|
-
apiKey:
|
|
3148
|
-
integrationId:
|
|
3149
|
-
organizationId:
|
|
3150
|
-
primaryBrandColor:
|
|
3151
|
-
organizationDisplayName:
|
|
3428
|
+
z8.looseObject({
|
|
3429
|
+
type: z8.literal("inkeep"),
|
|
3430
|
+
apiKey: z8.string(),
|
|
3431
|
+
integrationId: z8.string(),
|
|
3432
|
+
organizationId: z8.string(),
|
|
3433
|
+
primaryBrandColor: z8.string(),
|
|
3434
|
+
organizationDisplayName: z8.string()
|
|
3152
3435
|
}),
|
|
3153
|
-
|
|
3154
|
-
type:
|
|
3155
|
-
ranking:
|
|
3156
|
-
termFrequency:
|
|
3157
|
-
pageLength:
|
|
3158
|
-
termSimilarity:
|
|
3159
|
-
termSaturation:
|
|
3436
|
+
z8.object({
|
|
3437
|
+
type: z8.literal("pagefind"),
|
|
3438
|
+
ranking: z8.object({
|
|
3439
|
+
termFrequency: z8.number(),
|
|
3440
|
+
pageLength: z8.number(),
|
|
3441
|
+
termSimilarity: z8.number(),
|
|
3442
|
+
termSaturation: z8.number()
|
|
3160
3443
|
}).optional(),
|
|
3161
|
-
maxResults:
|
|
3162
|
-
maxSubResults:
|
|
3163
|
-
transformResults:
|
|
3444
|
+
maxResults: z8.number().optional(),
|
|
3445
|
+
maxSubResults: z8.number().optional(),
|
|
3446
|
+
transformResults: z8.custom((val) => typeof val === "function").optional()
|
|
3164
3447
|
})
|
|
3165
3448
|
]).optional();
|
|
3166
|
-
AuthenticationSchema =
|
|
3167
|
-
|
|
3168
|
-
type:
|
|
3169
|
-
clerkPubKey:
|
|
3449
|
+
AuthenticationSchema = z8.discriminatedUnion("type", [
|
|
3450
|
+
z8.object({
|
|
3451
|
+
type: z8.literal("clerk"),
|
|
3452
|
+
clerkPubKey: z8.custom().refine((val) => /^pk_(test|live)_\w+$/.test(val), {
|
|
3170
3453
|
message: "Clerk public key invalid, must start with pk_test or pk_live"
|
|
3171
3454
|
}),
|
|
3172
|
-
jwtTemplateName:
|
|
3173
|
-
redirectToAfterSignUp:
|
|
3174
|
-
redirectToAfterSignIn:
|
|
3175
|
-
redirectToAfterSignOut:
|
|
3455
|
+
jwtTemplateName: z8.string().optional().default("dev-portal"),
|
|
3456
|
+
redirectToAfterSignUp: z8.string().optional(),
|
|
3457
|
+
redirectToAfterSignIn: z8.string().optional(),
|
|
3458
|
+
redirectToAfterSignOut: z8.string().optional()
|
|
3176
3459
|
}),
|
|
3177
|
-
|
|
3178
|
-
type:
|
|
3179
|
-
apiKey:
|
|
3180
|
-
authDomain:
|
|
3181
|
-
projectId:
|
|
3182
|
-
storageBucket:
|
|
3183
|
-
messagingSenderId:
|
|
3184
|
-
appId:
|
|
3185
|
-
measurementId:
|
|
3186
|
-
providers:
|
|
3187
|
-
|
|
3460
|
+
z8.object({
|
|
3461
|
+
type: z8.literal("firebase"),
|
|
3462
|
+
apiKey: z8.string(),
|
|
3463
|
+
authDomain: z8.string(),
|
|
3464
|
+
projectId: z8.string(),
|
|
3465
|
+
storageBucket: z8.string().optional(),
|
|
3466
|
+
messagingSenderId: z8.string().optional(),
|
|
3467
|
+
appId: z8.string(),
|
|
3468
|
+
measurementId: z8.string().optional(),
|
|
3469
|
+
providers: z8.array(
|
|
3470
|
+
z8.enum([
|
|
3188
3471
|
"google",
|
|
3189
3472
|
"facebook",
|
|
3190
3473
|
"twitter",
|
|
@@ -3197,37 +3480,37 @@ var init_ZudokuConfig = __esm({
|
|
|
3197
3480
|
"emailLink"
|
|
3198
3481
|
])
|
|
3199
3482
|
).optional(),
|
|
3200
|
-
redirectToAfterSignUp:
|
|
3201
|
-
redirectToAfterSignIn:
|
|
3202
|
-
redirectToAfterSignOut:
|
|
3483
|
+
redirectToAfterSignUp: z8.string().optional(),
|
|
3484
|
+
redirectToAfterSignIn: z8.string().optional(),
|
|
3485
|
+
redirectToAfterSignOut: z8.string().optional()
|
|
3203
3486
|
}),
|
|
3204
|
-
|
|
3205
|
-
type:
|
|
3206
|
-
basePath:
|
|
3207
|
-
clientId:
|
|
3208
|
-
issuer:
|
|
3209
|
-
audience:
|
|
3210
|
-
scopes:
|
|
3211
|
-
redirectToAfterSignUp:
|
|
3212
|
-
redirectToAfterSignIn:
|
|
3213
|
-
redirectToAfterSignOut:
|
|
3487
|
+
z8.object({
|
|
3488
|
+
type: z8.literal("openid"),
|
|
3489
|
+
basePath: z8.string().optional(),
|
|
3490
|
+
clientId: z8.string(),
|
|
3491
|
+
issuer: z8.string(),
|
|
3492
|
+
audience: z8.string().optional(),
|
|
3493
|
+
scopes: z8.array(z8.string()).optional(),
|
|
3494
|
+
redirectToAfterSignUp: z8.string().optional(),
|
|
3495
|
+
redirectToAfterSignIn: z8.string().optional(),
|
|
3496
|
+
redirectToAfterSignOut: z8.string().optional()
|
|
3214
3497
|
}),
|
|
3215
|
-
|
|
3216
|
-
type:
|
|
3217
|
-
basePath:
|
|
3218
|
-
clientId:
|
|
3219
|
-
tenantName:
|
|
3220
|
-
policyName:
|
|
3221
|
-
scopes:
|
|
3222
|
-
issuer:
|
|
3223
|
-
redirectToAfterSignUp:
|
|
3224
|
-
redirectToAfterSignIn:
|
|
3225
|
-
redirectToAfterSignOut:
|
|
3498
|
+
z8.object({
|
|
3499
|
+
type: z8.literal("azureb2c"),
|
|
3500
|
+
basePath: z8.string().optional(),
|
|
3501
|
+
clientId: z8.string(),
|
|
3502
|
+
tenantName: z8.string(),
|
|
3503
|
+
policyName: z8.string(),
|
|
3504
|
+
scopes: z8.array(z8.string()).optional(),
|
|
3505
|
+
issuer: z8.string(),
|
|
3506
|
+
redirectToAfterSignUp: z8.string().optional(),
|
|
3507
|
+
redirectToAfterSignIn: z8.string().optional(),
|
|
3508
|
+
redirectToAfterSignOut: z8.string().optional()
|
|
3226
3509
|
}),
|
|
3227
|
-
|
|
3228
|
-
type:
|
|
3229
|
-
clientId:
|
|
3230
|
-
domain:
|
|
3510
|
+
z8.object({
|
|
3511
|
+
type: z8.literal("auth0"),
|
|
3512
|
+
clientId: z8.string(),
|
|
3513
|
+
domain: z8.string().refine(
|
|
3231
3514
|
(val) => {
|
|
3232
3515
|
if (val.startsWith("http://") || val.startsWith("https://")) {
|
|
3233
3516
|
return false;
|
|
@@ -3241,109 +3524,116 @@ var init_ZudokuConfig = __esm({
|
|
|
3241
3524
|
message: "Domain must be a host only (e.g., 'example.com') without protocol or slashes"
|
|
3242
3525
|
}
|
|
3243
3526
|
),
|
|
3244
|
-
audience:
|
|
3245
|
-
scopes:
|
|
3246
|
-
redirectToAfterSignUp:
|
|
3247
|
-
redirectToAfterSignIn:
|
|
3248
|
-
redirectToAfterSignOut:
|
|
3249
|
-
options:
|
|
3250
|
-
alwaysPromptLogin:
|
|
3251
|
-
prompt:
|
|
3527
|
+
audience: z8.string().optional(),
|
|
3528
|
+
scopes: z8.array(z8.string()).optional(),
|
|
3529
|
+
redirectToAfterSignUp: z8.string().optional(),
|
|
3530
|
+
redirectToAfterSignIn: z8.string().optional(),
|
|
3531
|
+
redirectToAfterSignOut: z8.string().optional(),
|
|
3532
|
+
options: z8.object({
|
|
3533
|
+
alwaysPromptLogin: z8.boolean().optional(),
|
|
3534
|
+
prompt: z8.string().optional()
|
|
3252
3535
|
}).optional()
|
|
3253
3536
|
}),
|
|
3254
|
-
|
|
3255
|
-
type:
|
|
3256
|
-
basePath:
|
|
3257
|
-
supabaseUrl:
|
|
3258
|
-
supabaseKey:
|
|
3259
|
-
provider:
|
|
3260
|
-
providers:
|
|
3261
|
-
onlyThirdPartyProviders:
|
|
3262
|
-
redirectToAfterSignUp:
|
|
3263
|
-
redirectToAfterSignIn:
|
|
3264
|
-
redirectToAfterSignOut:
|
|
3537
|
+
z8.object({
|
|
3538
|
+
type: z8.literal("supabase"),
|
|
3539
|
+
basePath: z8.string().optional(),
|
|
3540
|
+
supabaseUrl: z8.string(),
|
|
3541
|
+
supabaseKey: z8.string(),
|
|
3542
|
+
provider: z8.string().optional(),
|
|
3543
|
+
providers: z8.array(z8.string()).optional(),
|
|
3544
|
+
onlyThirdPartyProviders: z8.boolean().optional(),
|
|
3545
|
+
redirectToAfterSignUp: z8.string().optional(),
|
|
3546
|
+
redirectToAfterSignIn: z8.string().optional(),
|
|
3547
|
+
redirectToAfterSignOut: z8.string().optional()
|
|
3548
|
+
}),
|
|
3549
|
+
z8.object({
|
|
3550
|
+
type: z8.literal("dev-portal"),
|
|
3551
|
+
apiBaseUrl: z8.string().optional(),
|
|
3552
|
+
redirectToAfterSignUp: z8.string().optional(),
|
|
3553
|
+
redirectToAfterSignIn: z8.string().optional(),
|
|
3554
|
+
redirectToAfterSignOut: z8.string().optional()
|
|
3265
3555
|
})
|
|
3266
3556
|
]);
|
|
3267
|
-
MetadataSchema =
|
|
3268
|
-
title:
|
|
3269
|
-
defaultTitle:
|
|
3270
|
-
description:
|
|
3271
|
-
logo:
|
|
3272
|
-
favicon:
|
|
3273
|
-
generator:
|
|
3274
|
-
applicationName:
|
|
3275
|
-
referrer:
|
|
3276
|
-
keywords:
|
|
3277
|
-
authors:
|
|
3278
|
-
creator:
|
|
3279
|
-
publisher:
|
|
3557
|
+
MetadataSchema = z8.object({
|
|
3558
|
+
title: z8.string(),
|
|
3559
|
+
defaultTitle: z8.string().optional(),
|
|
3560
|
+
description: z8.string(),
|
|
3561
|
+
logo: z8.string(),
|
|
3562
|
+
favicon: z8.string(),
|
|
3563
|
+
generator: z8.string(),
|
|
3564
|
+
applicationName: z8.string(),
|
|
3565
|
+
referrer: z8.string(),
|
|
3566
|
+
keywords: z8.array(z8.string()),
|
|
3567
|
+
authors: z8.array(z8.string()),
|
|
3568
|
+
creator: z8.string(),
|
|
3569
|
+
publisher: z8.string()
|
|
3280
3570
|
}).partial();
|
|
3281
|
-
FontConfigSchema =
|
|
3282
|
-
|
|
3283
|
-
|
|
3284
|
-
url:
|
|
3285
|
-
fontFamily:
|
|
3571
|
+
FontConfigSchema = z8.union([
|
|
3572
|
+
z8.enum(GOOGLE_FONTS),
|
|
3573
|
+
z8.object({
|
|
3574
|
+
url: z8.string(),
|
|
3575
|
+
fontFamily: z8.string().optional()
|
|
3286
3576
|
})
|
|
3287
3577
|
]);
|
|
3288
|
-
FontsConfigSchema =
|
|
3578
|
+
FontsConfigSchema = z8.object({
|
|
3289
3579
|
sans: FontConfigSchema.optional(),
|
|
3290
3580
|
serif: FontConfigSchema.optional(),
|
|
3291
3581
|
mono: FontConfigSchema.optional()
|
|
3292
3582
|
});
|
|
3293
|
-
CssObject =
|
|
3294
|
-
|
|
3295
|
-
|
|
3296
|
-
() =>
|
|
3297
|
-
|
|
3298
|
-
|
|
3299
|
-
|
|
3300
|
-
|
|
3583
|
+
CssObject = z8.record(
|
|
3584
|
+
z8.string(),
|
|
3585
|
+
z8.lazy(
|
|
3586
|
+
() => z8.union([
|
|
3587
|
+
z8.string(),
|
|
3588
|
+
z8.record(
|
|
3589
|
+
z8.string(),
|
|
3590
|
+
z8.union([z8.string(), z8.record(z8.string(), z8.string())])
|
|
3301
3591
|
)
|
|
3302
3592
|
])
|
|
3303
3593
|
)
|
|
3304
3594
|
);
|
|
3305
|
-
ThemeConfigSchema =
|
|
3306
|
-
registryUrl:
|
|
3307
|
-
customCss:
|
|
3595
|
+
ThemeConfigSchema = z8.object({
|
|
3596
|
+
registryUrl: z8.string().url().optional(),
|
|
3597
|
+
customCss: z8.union([z8.string(), CssObject]).optional(),
|
|
3308
3598
|
light: ThemeSchema.optional(),
|
|
3309
3599
|
dark: ThemeSchema.optional(),
|
|
3310
3600
|
fonts: FontsConfigSchema.optional(),
|
|
3311
|
-
noDefaultTheme:
|
|
3601
|
+
noDefaultTheme: z8.boolean().optional()
|
|
3312
3602
|
});
|
|
3313
|
-
SiteSchema =
|
|
3314
|
-
title:
|
|
3315
|
-
logoUrl:
|
|
3316
|
-
dir:
|
|
3603
|
+
SiteSchema = z8.object({
|
|
3604
|
+
title: z8.string(),
|
|
3605
|
+
logoUrl: z8.string(),
|
|
3606
|
+
dir: z8.enum(["ltr", "rtl"]).optional(),
|
|
3317
3607
|
logo: LogoSchema,
|
|
3318
|
-
banner:
|
|
3319
|
-
message:
|
|
3320
|
-
color:
|
|
3608
|
+
banner: z8.object({
|
|
3609
|
+
message: z8.custom(),
|
|
3610
|
+
color: z8.custom(
|
|
3321
3611
|
(val) => typeof val === "string"
|
|
3322
3612
|
).optional(),
|
|
3323
|
-
dismissible:
|
|
3613
|
+
dismissible: z8.boolean().optional()
|
|
3324
3614
|
}),
|
|
3325
3615
|
footer: FooterSchema
|
|
3326
3616
|
}).partial();
|
|
3327
|
-
PlacementPosition =
|
|
3328
|
-
HeaderConfigSchema =
|
|
3617
|
+
PlacementPosition = z8.enum(["start", "center", "end"]);
|
|
3618
|
+
HeaderConfigSchema = z8.object({
|
|
3329
3619
|
navigation: HeaderNavigationSchema,
|
|
3330
|
-
placements:
|
|
3620
|
+
placements: z8.object({
|
|
3331
3621
|
navigation: PlacementPosition,
|
|
3332
3622
|
search: PlacementPosition,
|
|
3333
|
-
auth:
|
|
3623
|
+
auth: z8.enum(["start", "center", "end", "navigation"])
|
|
3334
3624
|
}).partial().optional()
|
|
3335
3625
|
}).partial();
|
|
3336
|
-
ApiCatalogSchema =
|
|
3337
|
-
path:
|
|
3338
|
-
label:
|
|
3339
|
-
items:
|
|
3340
|
-
filterItems:
|
|
3626
|
+
ApiCatalogSchema = z8.object({
|
|
3627
|
+
path: z8.string(),
|
|
3628
|
+
label: z8.string(),
|
|
3629
|
+
items: z8.array(z8.string()).optional(),
|
|
3630
|
+
filterItems: z8.custom((val) => typeof val === "function").optional()
|
|
3341
3631
|
});
|
|
3342
|
-
CdnUrlSchema =
|
|
3343
|
-
|
|
3344
|
-
|
|
3345
|
-
base:
|
|
3346
|
-
media:
|
|
3632
|
+
CdnUrlSchema = z8.union([
|
|
3633
|
+
z8.string(),
|
|
3634
|
+
z8.object({
|
|
3635
|
+
base: z8.string().optional(),
|
|
3636
|
+
media: z8.string().optional()
|
|
3347
3637
|
})
|
|
3348
3638
|
]).transform((val) => {
|
|
3349
3639
|
if (typeof val === "string") {
|
|
@@ -3351,67 +3641,68 @@ var init_ZudokuConfig = __esm({
|
|
|
3351
3641
|
}
|
|
3352
3642
|
return { base: val.base, media: val.media };
|
|
3353
3643
|
}).optional();
|
|
3354
|
-
BaseConfigSchema =
|
|
3355
|
-
slots:
|
|
3644
|
+
BaseConfigSchema = z8.object({
|
|
3645
|
+
slots: z8.record(z8.string(), z8.custom()),
|
|
3356
3646
|
/**
|
|
3357
3647
|
* @deprecated Use `slots` instead
|
|
3358
3648
|
*/
|
|
3359
|
-
UNSAFE_slotlets:
|
|
3360
|
-
mdx:
|
|
3361
|
-
components:
|
|
3649
|
+
UNSAFE_slotlets: z8.record(z8.string(), z8.custom()),
|
|
3650
|
+
mdx: z8.object({
|
|
3651
|
+
components: z8.custom()
|
|
3362
3652
|
}).partial(),
|
|
3363
|
-
customPages:
|
|
3364
|
-
|
|
3365
|
-
path:
|
|
3366
|
-
element:
|
|
3367
|
-
render:
|
|
3368
|
-
prose:
|
|
3653
|
+
customPages: z8.array(
|
|
3654
|
+
z8.object({
|
|
3655
|
+
path: z8.string(),
|
|
3656
|
+
element: z8.custom().optional(),
|
|
3657
|
+
render: z8.custom().optional(),
|
|
3658
|
+
prose: z8.boolean().optional()
|
|
3369
3659
|
})
|
|
3370
3660
|
),
|
|
3371
|
-
plugins:
|
|
3372
|
-
build:
|
|
3661
|
+
plugins: z8.array(z8.custom()),
|
|
3662
|
+
build: z8.custom(),
|
|
3373
3663
|
protectedRoutes: ProtectedRoutesSchema,
|
|
3374
|
-
basePath:
|
|
3375
|
-
canonicalUrlOrigin:
|
|
3664
|
+
basePath: z8.string().optional(),
|
|
3665
|
+
canonicalUrlOrigin: z8.string().optional(),
|
|
3376
3666
|
cdnUrl: CdnUrlSchema.optional(),
|
|
3377
|
-
port:
|
|
3378
|
-
https:
|
|
3379
|
-
key:
|
|
3380
|
-
cert:
|
|
3381
|
-
ca:
|
|
3667
|
+
port: z8.number().optional(),
|
|
3668
|
+
https: z8.object({
|
|
3669
|
+
key: z8.string(),
|
|
3670
|
+
cert: z8.string(),
|
|
3671
|
+
ca: z8.string().optional()
|
|
3382
3672
|
}).optional(),
|
|
3383
3673
|
site: SiteSchema,
|
|
3384
3674
|
header: HeaderConfigSchema.optional(),
|
|
3385
3675
|
navigation: InputNavigationSchema,
|
|
3386
3676
|
navigationRules: NavigationRulesSchema.optional(),
|
|
3387
3677
|
theme: ThemeConfigSchema,
|
|
3388
|
-
syntaxHighlighting:
|
|
3389
|
-
languages:
|
|
3390
|
-
themes:
|
|
3391
|
-
light:
|
|
3392
|
-
dark:
|
|
3678
|
+
syntaxHighlighting: z8.object({
|
|
3679
|
+
languages: z8.array(z8.custom()),
|
|
3680
|
+
themes: z8.object({
|
|
3681
|
+
light: z8.custom(),
|
|
3682
|
+
dark: z8.custom()
|
|
3393
3683
|
})
|
|
3394
3684
|
}).partial().optional(),
|
|
3395
3685
|
metadata: MetadataSchema,
|
|
3396
3686
|
authentication: AuthenticationSchema,
|
|
3397
3687
|
search: SearchSchema,
|
|
3398
3688
|
docs: DocsConfigSchema.optional(),
|
|
3399
|
-
|
|
3400
|
-
|
|
3689
|
+
modules: ModulesSchema,
|
|
3690
|
+
apis: z8.union([ApiSchema, z8.array(ApiSchema)]),
|
|
3691
|
+
catalogs: z8.union([ApiCatalogSchema, z8.array(ApiCatalogSchema)]),
|
|
3401
3692
|
apiKeys: ApiKeysSchema,
|
|
3402
3693
|
aiAssistants: AiAssistantsSchema,
|
|
3403
|
-
redirects:
|
|
3694
|
+
redirects: z8.array(Redirect),
|
|
3404
3695
|
sitemap: SiteMapSchema,
|
|
3405
|
-
enableStatusPages:
|
|
3406
|
-
defaults:
|
|
3696
|
+
enableStatusPages: z8.boolean().optional(),
|
|
3697
|
+
defaults: z8.object({
|
|
3407
3698
|
apis: ApiOptionsSchema,
|
|
3408
3699
|
/**
|
|
3409
3700
|
* @deprecated Use `apis.examplesLanguage` or `defaults.apis.examplesLanguage` instead
|
|
3410
3701
|
*/
|
|
3411
|
-
examplesLanguage:
|
|
3702
|
+
examplesLanguage: z8.string().optional()
|
|
3412
3703
|
}),
|
|
3413
3704
|
// Internal: populated by plugins via `transformConfig` to track plugin directories
|
|
3414
|
-
__pluginDirs:
|
|
3705
|
+
__pluginDirs: z8.array(z8.string())
|
|
3415
3706
|
});
|
|
3416
3707
|
ZudokuConfig = BaseConfigSchema.partial();
|
|
3417
3708
|
}
|
|
@@ -3465,7 +3756,8 @@ async function loadZudokuConfigWithMeta(rootDir) {
|
|
|
3465
3756
|
mode: process.env.ZUDOKU_ENV,
|
|
3466
3757
|
dependencies,
|
|
3467
3758
|
configPath
|
|
3468
|
-
}
|
|
3759
|
+
},
|
|
3760
|
+
__resolvedModules: resolveModulesConfig(config2)
|
|
3469
3761
|
};
|
|
3470
3762
|
return configWithMetadata;
|
|
3471
3763
|
}
|
|
@@ -3527,7 +3819,11 @@ async function loadZudokuConfig(configEnv, rootDir) {
|
|
|
3527
3819
|
({ publicEnv, envPrefix } = loadEnv(configEnv, rootDir));
|
|
3528
3820
|
try {
|
|
3529
3821
|
const loadedConfig = await loadZudokuConfigWithMeta(rootDir);
|
|
3530
|
-
|
|
3822
|
+
const transformedConfig = await runPluginTransformConfig(loadedConfig);
|
|
3823
|
+
config = {
|
|
3824
|
+
...transformedConfig,
|
|
3825
|
+
__resolvedModules: resolveModulesConfig(transformedConfig)
|
|
3826
|
+
};
|
|
3531
3827
|
if (!process.env.APITOGO_JSON_ONLY) {
|
|
3532
3828
|
logger.info(
|
|
3533
3829
|
colors2.cyan(`loaded config file `) + colors2.dim(config.__meta.configPath),
|
|
@@ -3553,6 +3849,7 @@ var init_loader = __esm({
|
|
|
3553
3849
|
init_transform_config();
|
|
3554
3850
|
init_invariant();
|
|
3555
3851
|
init_file_exists();
|
|
3852
|
+
init_resolve_modules();
|
|
3556
3853
|
init_ZudokuConfig();
|
|
3557
3854
|
zudokuConfigFiles = [
|
|
3558
3855
|
"apitogo.config.js",
|
|
@@ -3589,7 +3886,7 @@ __export(llms_exports, {
|
|
|
3589
3886
|
generateLlmsTxtFiles: () => generateLlmsTxtFiles
|
|
3590
3887
|
});
|
|
3591
3888
|
import { writeFile as writeFile4 } from "node:fs/promises";
|
|
3592
|
-
import
|
|
3889
|
+
import path24 from "node:path";
|
|
3593
3890
|
import colors6 from "picocolors";
|
|
3594
3891
|
async function generateLlmsTxtFiles({
|
|
3595
3892
|
markdownFileInfos,
|
|
@@ -3624,7 +3921,7 @@ async function generateLlmsTxtFiles({
|
|
|
3624
3921
|
}
|
|
3625
3922
|
}
|
|
3626
3923
|
const llmsTxt2 = llmsTxtParts.join("\n");
|
|
3627
|
-
await writeFile4(
|
|
3924
|
+
await writeFile4(path24.join(baseOutputDir, "llms.txt"), llmsTxt2, "utf-8");
|
|
3628
3925
|
if (process.env.APITOGO_JSON_ONLY !== "1") {
|
|
3629
3926
|
console.log(colors6.blue("\u2713 generated llms.txt"));
|
|
3630
3927
|
}
|
|
@@ -3652,7 +3949,7 @@ ${info.content}
|
|
|
3652
3949
|
}
|
|
3653
3950
|
const llmsFull = llmsFullParts.join("\n");
|
|
3654
3951
|
await writeFile4(
|
|
3655
|
-
|
|
3952
|
+
path24.join(baseOutputDir, "llms-full.txt"),
|
|
3656
3953
|
llmsFull,
|
|
3657
3954
|
"utf-8"
|
|
3658
3955
|
);
|
|
@@ -3673,11 +3970,11 @@ import { hideBin } from "yargs/helpers";
|
|
|
3673
3970
|
import yargs from "yargs/yargs";
|
|
3674
3971
|
|
|
3675
3972
|
// src/cli/build/handler.ts
|
|
3676
|
-
import
|
|
3973
|
+
import path28 from "node:path";
|
|
3677
3974
|
|
|
3678
3975
|
// src/vite/build.ts
|
|
3679
|
-
import { mkdir as mkdir5, readFile as
|
|
3680
|
-
import
|
|
3976
|
+
import { mkdir as mkdir5, readFile as readFile4, rename, rm as rm2, writeFile as writeFile5 } from "node:fs/promises";
|
|
3977
|
+
import path26 from "node:path";
|
|
3681
3978
|
import { build as esbuild } from "esbuild";
|
|
3682
3979
|
import { build as viteBuild, mergeConfig as mergeConfig3 } from "vite";
|
|
3683
3980
|
|
|
@@ -3796,6 +4093,9 @@ var getIssuer = async (config2) => {
|
|
|
3796
4093
|
case "firebase": {
|
|
3797
4094
|
return `https://securetoken.google.com/${config2.authentication.projectId}`;
|
|
3798
4095
|
}
|
|
4096
|
+
case "dev-portal": {
|
|
4097
|
+
return void 0;
|
|
4098
|
+
}
|
|
3799
4099
|
case void 0: {
|
|
3800
4100
|
return void 0;
|
|
3801
4101
|
}
|
|
@@ -3810,7 +4110,7 @@ init_invariant();
|
|
|
3810
4110
|
init_joinUrl();
|
|
3811
4111
|
|
|
3812
4112
|
// src/vite/config.ts
|
|
3813
|
-
import
|
|
4113
|
+
import path21 from "node:path";
|
|
3814
4114
|
import dotenv from "dotenv";
|
|
3815
4115
|
import colors4 from "picocolors";
|
|
3816
4116
|
import {
|
|
@@ -3821,7 +4121,7 @@ import {
|
|
|
3821
4121
|
// package.json
|
|
3822
4122
|
var package_default = {
|
|
3823
4123
|
name: "@lukoweb/apitogo",
|
|
3824
|
-
version: "0.1.
|
|
4124
|
+
version: "0.1.37",
|
|
3825
4125
|
type: "module",
|
|
3826
4126
|
sideEffects: [
|
|
3827
4127
|
"**/*.css",
|
|
@@ -3867,6 +4167,7 @@ var package_default = {
|
|
|
3867
4167
|
"./auth/supabase": "./src/lib/authentication/providers/supabase.tsx",
|
|
3868
4168
|
"./auth/azureb2c": "./src/lib/authentication/providers/azureb2c.tsx",
|
|
3869
4169
|
"./auth/firebase": "./src/lib/authentication/providers/firebase.tsx",
|
|
4170
|
+
"./auth/dev-portal": "./src/lib/authentication/providers/dev-portal.tsx",
|
|
3870
4171
|
"./plugins": "./src/lib/core/plugins.ts",
|
|
3871
4172
|
"./plugins/api-keys": "./src/lib/plugins/api-keys/index.tsx",
|
|
3872
4173
|
"./plugins/markdown": "./src/lib/plugins/markdown/index.tsx",
|
|
@@ -3875,6 +4176,8 @@ var package_default = {
|
|
|
3875
4176
|
"./plugins/search-inkeep": "./src/lib/plugins/search-inkeep/index.tsx",
|
|
3876
4177
|
"./plugins/search-pagefind": "./src/lib/plugins/search-pagefind/index.tsx",
|
|
3877
4178
|
"./plugins/api-catalog": "./src/lib/plugins/api-catalog/index.tsx",
|
|
4179
|
+
"./modules/landing": "@lukoweb/apitogo-module-landing",
|
|
4180
|
+
"./modules/user-panel": "@lukoweb/apitogo-module-user-panel",
|
|
3878
4181
|
"./components": "./src/lib/components/index.ts",
|
|
3879
4182
|
"./mermaid": "./src/lib/components/Mermaid.tsx",
|
|
3880
4183
|
"./router": "./src/lib/core/router.ts",
|
|
@@ -4114,6 +4417,10 @@ var package_default = {
|
|
|
4114
4417
|
types: "./dist/declarations/lib/authentication/providers/firebase.d.ts",
|
|
4115
4418
|
default: "./src/lib/authentication/providers/firebase.tsx"
|
|
4116
4419
|
},
|
|
4420
|
+
"./auth/dev-portal": {
|
|
4421
|
+
types: "./dist/declarations/lib/authentication/providers/dev-portal.d.ts",
|
|
4422
|
+
default: "./src/lib/authentication/providers/dev-portal.tsx"
|
|
4423
|
+
},
|
|
4117
4424
|
"./plugins": {
|
|
4118
4425
|
types: "./dist/declarations/lib/core/plugins.d.ts",
|
|
4119
4426
|
default: "./src/lib/core/plugins.ts"
|
|
@@ -4146,6 +4453,8 @@ var package_default = {
|
|
|
4146
4453
|
types: "./dist/declarations/lib/plugins/api-catalog/index.d.ts",
|
|
4147
4454
|
default: "./src/lib/plugins/api-catalog/index.tsx"
|
|
4148
4455
|
},
|
|
4456
|
+
"./modules/landing": "@lukoweb/apitogo-module-landing",
|
|
4457
|
+
"./modules/user-panel": "@lukoweb/apitogo-module-user-panel",
|
|
4149
4458
|
"./components": {
|
|
4150
4459
|
types: "./dist/declarations/lib/components/index.d.ts",
|
|
4151
4460
|
default: "./src/lib/components/index.ts"
|
|
@@ -4202,18 +4511,62 @@ init_loader();
|
|
|
4202
4511
|
init_ZudokuConfig();
|
|
4203
4512
|
init_joinUrl();
|
|
4204
4513
|
|
|
4205
|
-
// src/vite/
|
|
4206
|
-
import
|
|
4514
|
+
// src/vite/dev-portal-env.ts
|
|
4515
|
+
import { readFile } from "node:fs/promises";
|
|
4207
4516
|
import path4 from "node:path";
|
|
4208
|
-
|
|
4209
|
-
|
|
4210
|
-
|
|
4211
|
-
|
|
4212
|
-
|
|
4213
|
-
|
|
4214
|
-
|
|
4517
|
+
import { loadEnv as loadEnv2 } from "vite";
|
|
4518
|
+
var DEV_PORTAL_MANIFEST_FILENAME = "apitogo.local.json";
|
|
4519
|
+
function normalizeBillingPeriod(period) {
|
|
4520
|
+
if (!period) {
|
|
4521
|
+
return "monthly";
|
|
4522
|
+
}
|
|
4523
|
+
const normalized = period.toLowerCase();
|
|
4524
|
+
if (normalized === "month") {
|
|
4525
|
+
return "monthly";
|
|
4526
|
+
}
|
|
4527
|
+
if (normalized === "year") {
|
|
4528
|
+
return "annual";
|
|
4529
|
+
}
|
|
4530
|
+
return normalized;
|
|
4531
|
+
}
|
|
4532
|
+
function plansToMockEnvValue(plans) {
|
|
4533
|
+
if (!plans?.length) {
|
|
4534
|
+
return null;
|
|
4535
|
+
}
|
|
4536
|
+
const mockPlans = plans.map((plan) => ({
|
|
4537
|
+
sku: plan.sku,
|
|
4538
|
+
displayName: plan.displayName,
|
|
4539
|
+
isFree: plan.isFree,
|
|
4540
|
+
priceAmount: plan.priceAmount ?? 0,
|
|
4541
|
+
priceCurrency: plan.priceCurrency ?? "usd",
|
|
4542
|
+
billingPeriod: normalizeBillingPeriod(plan.billingPeriod),
|
|
4543
|
+
limitsJson: plan.limitsJson ?? null
|
|
4544
|
+
}));
|
|
4545
|
+
return JSON.stringify(mockPlans);
|
|
4546
|
+
}
|
|
4547
|
+
async function readDevPortalManifest(rootDir) {
|
|
4548
|
+
const manifestPath = path4.join(rootDir, DEV_PORTAL_MANIFEST_FILENAME);
|
|
4549
|
+
try {
|
|
4550
|
+
const raw = await readFile(manifestPath, "utf8");
|
|
4551
|
+
return JSON.parse(raw);
|
|
4552
|
+
} catch {
|
|
4553
|
+
return null;
|
|
4215
4554
|
}
|
|
4216
4555
|
}
|
|
4556
|
+
async function loadDevPortalViteDefines(rootDir, mode) {
|
|
4557
|
+
const env = loadEnv2(mode, rootDir, "VITE_");
|
|
4558
|
+
const defines = {};
|
|
4559
|
+
const apiUrl = env.VITE_APITOGO_DEV_PORTAL_API_URL?.trim();
|
|
4560
|
+
if (apiUrl) {
|
|
4561
|
+
defines.VITE_APITOGO_DEV_PORTAL_API_URL = JSON.stringify(apiUrl);
|
|
4562
|
+
}
|
|
4563
|
+
const manifest = await readDevPortalManifest(rootDir);
|
|
4564
|
+
const mockPlansValue = plansToMockEnvValue(manifest?.plans);
|
|
4565
|
+
if (mockPlansValue) {
|
|
4566
|
+
defines.VITE_APITOGO_DEV_PORTAL_MOCK_PLANS = JSON.stringify(mockPlansValue);
|
|
4567
|
+
}
|
|
4568
|
+
return defines;
|
|
4569
|
+
}
|
|
4217
4570
|
|
|
4218
4571
|
// src/vite/package-root.ts
|
|
4219
4572
|
init_file_exists();
|
|
@@ -4226,6 +4579,19 @@ var findPackageRoot = async (startDir) => {
|
|
|
4226
4579
|
}
|
|
4227
4580
|
};
|
|
4228
4581
|
|
|
4582
|
+
// src/vite/pagefind-dev-stub.ts
|
|
4583
|
+
import fs from "node:fs/promises";
|
|
4584
|
+
import path6 from "node:path";
|
|
4585
|
+
var NOT_BUILT_YET = 'throw new Error("NOT_BUILT_YET");';
|
|
4586
|
+
async function ensurePagefindDevStub(publicDir) {
|
|
4587
|
+
const pagefindPath = path6.join(publicDir, "pagefind/pagefind.js");
|
|
4588
|
+
const exists = await fs.stat(pagefindPath).catch(() => false);
|
|
4589
|
+
if (!exists) {
|
|
4590
|
+
await fs.mkdir(path6.dirname(pagefindPath), { recursive: true });
|
|
4591
|
+
await fs.writeFile(pagefindPath, NOT_BUILT_YET);
|
|
4592
|
+
}
|
|
4593
|
+
}
|
|
4594
|
+
|
|
4229
4595
|
// src/vite/plugin.ts
|
|
4230
4596
|
import tailwindcss from "@tailwindcss/vite";
|
|
4231
4597
|
import react from "@vitejs/plugin-react";
|
|
@@ -4233,7 +4599,7 @@ import react from "@vitejs/plugin-react";
|
|
|
4233
4599
|
// src/vite/css/plugin.ts
|
|
4234
4600
|
init_loader();
|
|
4235
4601
|
init_plugin_theme();
|
|
4236
|
-
import
|
|
4602
|
+
import path7 from "node:path";
|
|
4237
4603
|
import { isCSSRequest as isCSSRequest2 } from "vite";
|
|
4238
4604
|
|
|
4239
4605
|
// src/vite/css/collect.ts
|
|
@@ -4268,7 +4634,7 @@ var VIRTUAL_ENTRY = "virtual:ssr-css.css";
|
|
|
4268
4634
|
function vitePluginSsrCss(pluginOpts) {
|
|
4269
4635
|
let server;
|
|
4270
4636
|
const config2 = getCurrentConfig();
|
|
4271
|
-
const virtualHref =
|
|
4637
|
+
const virtualHref = path7.join(
|
|
4272
4638
|
config2.basePath ?? "",
|
|
4273
4639
|
`/@id/__x00__${VIRTUAL_ENTRY}?direct`
|
|
4274
4640
|
);
|
|
@@ -4378,7 +4744,8 @@ var viteApiKeysPlugin = () => {
|
|
|
4378
4744
|
async load(id) {
|
|
4379
4745
|
if (id === resolvedVirtualModuleId4) {
|
|
4380
4746
|
const config2 = getCurrentConfig();
|
|
4381
|
-
|
|
4747
|
+
const apiKeysPath = config2.__resolvedModules.userPanel.apiKeys.path;
|
|
4748
|
+
if (!config2.__resolvedModules.userPanel.apiKeys.enabled || config2.__meta.mode === "standalone") {
|
|
4382
4749
|
return `export const configuredApiKeysPlugin = undefined;`;
|
|
4383
4750
|
}
|
|
4384
4751
|
const deploymentName = ZuploEnv.buildConfig?.deploymentName || getZuploSystemConfigurations(process.env.ZUPLO_SYSTEM_CONFIGURATIONS)?.__ZUPLO_DEPLOYMENT_NAME;
|
|
@@ -4387,6 +4754,7 @@ var viteApiKeysPlugin = () => {
|
|
|
4387
4754
|
config2.__meta.mode === "internal" ? `import { apiKeyPlugin } from "${config2.__meta.moduleDir}/src/lib/plugins/api-keys/index.tsx";` : `import { apiKeyPlugin } from "@lukoweb/apitogo/plugins/api-keys";`,
|
|
4388
4755
|
`export const configuredApiKeysPlugin = apiKeyPlugin({
|
|
4389
4756
|
...config.apiKeys,
|
|
4757
|
+
path: "${apiKeysPath}",
|
|
4390
4758
|
isZuplo: ${ZuploEnv.isZuplo},
|
|
4391
4759
|
${deploymentName ? `deploymentName: "${deploymentName}"` : ""}
|
|
4392
4760
|
});`
|
|
@@ -4403,7 +4771,7 @@ var plugin_api_keys_default = viteApiKeysPlugin;
|
|
|
4403
4771
|
|
|
4404
4772
|
// src/vite/plugin-api.ts
|
|
4405
4773
|
import fs3 from "node:fs/promises";
|
|
4406
|
-
import
|
|
4774
|
+
import path13 from "node:path";
|
|
4407
4775
|
import { deepEqual as deepEqual2 } from "fast-equals";
|
|
4408
4776
|
import { runnerImport as runnerImport3 } from "vite";
|
|
4409
4777
|
init_package_json();
|
|
@@ -4412,20 +4780,20 @@ init_loader();
|
|
|
4412
4780
|
// src/config/validators/BuildSchema.ts
|
|
4413
4781
|
init_file_exists();
|
|
4414
4782
|
init_loader();
|
|
4415
|
-
import
|
|
4783
|
+
import path8 from "node:path";
|
|
4416
4784
|
import { runnerImport as runnerImport2 } from "vite";
|
|
4417
|
-
import { z as
|
|
4418
|
-
var BuildProcessorSchema =
|
|
4419
|
-
var PluginConfigSchema =
|
|
4420
|
-
|
|
4785
|
+
import { z as z9 } from "zod";
|
|
4786
|
+
var BuildProcessorSchema = z9.custom((val) => typeof val === "function");
|
|
4787
|
+
var PluginConfigSchema = z9.custom().or(
|
|
4788
|
+
z9.custom(
|
|
4421
4789
|
(val) => typeof val === "function"
|
|
4422
4790
|
)
|
|
4423
4791
|
);
|
|
4424
|
-
var BuildConfigSchema2 =
|
|
4425
|
-
processors:
|
|
4792
|
+
var BuildConfigSchema2 = z9.object({
|
|
4793
|
+
processors: z9.array(BuildProcessorSchema).optional(),
|
|
4426
4794
|
remarkPlugins: PluginConfigSchema.optional(),
|
|
4427
4795
|
rehypePlugins: PluginConfigSchema.optional(),
|
|
4428
|
-
prerender:
|
|
4796
|
+
prerender: z9.object({ workers: z9.number().optional() }).optional()
|
|
4429
4797
|
});
|
|
4430
4798
|
var buildConfigFiles = [
|
|
4431
4799
|
"apitogo.build.js",
|
|
@@ -4441,7 +4809,7 @@ var buildConfigFiles = [
|
|
|
4441
4809
|
];
|
|
4442
4810
|
async function getBuildConfigFilePath(rootDir) {
|
|
4443
4811
|
for (const fileName of buildConfigFiles) {
|
|
4444
|
-
const filepath =
|
|
4812
|
+
const filepath = path8.join(rootDir, fileName);
|
|
4445
4813
|
if (await fileExists(filepath)) {
|
|
4446
4814
|
return filepath;
|
|
4447
4815
|
}
|
|
@@ -4463,10 +4831,10 @@ function validateBuildConfig(config2) {
|
|
|
4463
4831
|
const validationResult = BuildConfigSchema2.safeParse(config2);
|
|
4464
4832
|
if (!validationResult.success) {
|
|
4465
4833
|
if (process.env.NODE_ENV === "production") {
|
|
4466
|
-
throw new Error(
|
|
4834
|
+
throw new Error(z9.prettifyError(validationResult.error));
|
|
4467
4835
|
}
|
|
4468
4836
|
console.warn("Build config validation errors:");
|
|
4469
|
-
console.warn(
|
|
4837
|
+
console.warn(z9.prettifyError(validationResult.error));
|
|
4470
4838
|
return;
|
|
4471
4839
|
}
|
|
4472
4840
|
return validationResult.data;
|
|
@@ -4550,14 +4918,14 @@ var flattenAllOf = (schema2) => {
|
|
|
4550
4918
|
};
|
|
4551
4919
|
|
|
4552
4920
|
// src/lib/util/traverse.ts
|
|
4553
|
-
var traverse = (specification, transform,
|
|
4554
|
-
const transformed = transform(specification,
|
|
4921
|
+
var traverse = (specification, transform, path37 = []) => {
|
|
4922
|
+
const transformed = transform(specification, path37);
|
|
4555
4923
|
if (typeof transformed !== "object" || transformed === null) {
|
|
4556
4924
|
return transformed;
|
|
4557
4925
|
}
|
|
4558
4926
|
const result = Array.isArray(transformed) ? [] : {};
|
|
4559
4927
|
for (const [key, value] of Object.entries(transformed)) {
|
|
4560
|
-
const currentPath = [...
|
|
4928
|
+
const currentPath = [...path37, key];
|
|
4561
4929
|
if (Array.isArray(value)) {
|
|
4562
4930
|
result[key] = value.map(
|
|
4563
4931
|
(item, index) => typeof item === "object" && item != null ? traverse(item, transform, [...currentPath, index.toString()]) : item
|
|
@@ -4585,9 +4953,9 @@ var resolveLocalRef = (schema2, ref) => {
|
|
|
4585
4953
|
if (schemaCache?.has(ref)) {
|
|
4586
4954
|
return schemaCache.get(ref);
|
|
4587
4955
|
}
|
|
4588
|
-
const
|
|
4956
|
+
const path37 = ref.split("/").slice(1);
|
|
4589
4957
|
let current = schema2;
|
|
4590
|
-
for (const segment of
|
|
4958
|
+
for (const segment of path37) {
|
|
4591
4959
|
if (!current || typeof current !== "object") {
|
|
4592
4960
|
current = null;
|
|
4593
4961
|
}
|
|
@@ -4606,7 +4974,7 @@ var dereference = async (schema2, resolvers = []) => {
|
|
|
4606
4974
|
}
|
|
4607
4975
|
const cloned = structuredClone(schema2);
|
|
4608
4976
|
const visited = /* @__PURE__ */ new Set();
|
|
4609
|
-
const resolve = async (current,
|
|
4977
|
+
const resolve = async (current, path37) => {
|
|
4610
4978
|
if (isIndexableObject(current)) {
|
|
4611
4979
|
if (visited.has(current)) {
|
|
4612
4980
|
return CIRCULAR_REF;
|
|
@@ -4614,7 +4982,7 @@ var dereference = async (schema2, resolvers = []) => {
|
|
|
4614
4982
|
visited.add(current);
|
|
4615
4983
|
if (Array.isArray(current)) {
|
|
4616
4984
|
for (let index = 0; index < current.length; index++) {
|
|
4617
|
-
current[index] = await resolve(current[index], `${
|
|
4985
|
+
current[index] = await resolve(current[index], `${path37}/${index}`);
|
|
4618
4986
|
}
|
|
4619
4987
|
} else {
|
|
4620
4988
|
if ("$ref" in current && typeof current.$ref === "string") {
|
|
@@ -4625,13 +4993,13 @@ var dereference = async (schema2, resolvers = []) => {
|
|
|
4625
4993
|
for (const resolver of resolvers) {
|
|
4626
4994
|
const resolved = await resolver($ref);
|
|
4627
4995
|
if (resolved) {
|
|
4628
|
-
result2 = await resolve(resolved,
|
|
4996
|
+
result2 = await resolve(resolved, path37);
|
|
4629
4997
|
break;
|
|
4630
4998
|
}
|
|
4631
4999
|
}
|
|
4632
5000
|
if (result2 === void 0) {
|
|
4633
5001
|
const resolved = await resolveLocalRef(cloned, $ref);
|
|
4634
|
-
result2 = await resolve(resolved,
|
|
5002
|
+
result2 = await resolve(resolved, path37);
|
|
4635
5003
|
}
|
|
4636
5004
|
if (hasSiblings) {
|
|
4637
5005
|
if (result2 === CIRCULAR_REF) {
|
|
@@ -4644,7 +5012,7 @@ var dereference = async (schema2, resolvers = []) => {
|
|
|
4644
5012
|
return result2;
|
|
4645
5013
|
}
|
|
4646
5014
|
for (const key in current) {
|
|
4647
|
-
current[key] = await resolve(current[key], `${
|
|
5015
|
+
current[key] = await resolve(current[key], `${path37}/${key}`);
|
|
4648
5016
|
}
|
|
4649
5017
|
}
|
|
4650
5018
|
visited.delete(current);
|
|
@@ -4683,9 +5051,9 @@ var upgradeSchema = (schema2) => {
|
|
|
4683
5051
|
}
|
|
4684
5052
|
return sub;
|
|
4685
5053
|
});
|
|
4686
|
-
schema2 = traverse(schema2, (sub,
|
|
5054
|
+
schema2 = traverse(schema2, (sub, path37) => {
|
|
4687
5055
|
if (sub.example !== void 0) {
|
|
4688
|
-
if (isSchemaPath(
|
|
5056
|
+
if (isSchemaPath(path37 ?? [])) {
|
|
4689
5057
|
sub.examples = [sub.example];
|
|
4690
5058
|
} else {
|
|
4691
5059
|
sub.examples = {
|
|
@@ -4698,11 +5066,11 @@ var upgradeSchema = (schema2) => {
|
|
|
4698
5066
|
}
|
|
4699
5067
|
return sub;
|
|
4700
5068
|
});
|
|
4701
|
-
schema2 = traverse(schema2, (schema3,
|
|
5069
|
+
schema2 = traverse(schema2, (schema3, path37) => {
|
|
4702
5070
|
if (schema3.type === "object" && schema3.properties !== void 0) {
|
|
4703
|
-
const parentPath =
|
|
5071
|
+
const parentPath = path37?.slice(0, -1);
|
|
4704
5072
|
const isMultipart = parentPath?.some((segment, index) => {
|
|
4705
|
-
return segment === "content" &&
|
|
5073
|
+
return segment === "content" && path37?.[index + 1] === "multipart/form-data";
|
|
4706
5074
|
});
|
|
4707
5075
|
if (isMultipart) {
|
|
4708
5076
|
const entries = Object.entries(schema3.properties);
|
|
@@ -4716,8 +5084,8 @@ var upgradeSchema = (schema2) => {
|
|
|
4716
5084
|
}
|
|
4717
5085
|
return schema3;
|
|
4718
5086
|
});
|
|
4719
|
-
schema2 = traverse(schema2, (schema3,
|
|
4720
|
-
if (
|
|
5087
|
+
schema2 = traverse(schema2, (schema3, path37) => {
|
|
5088
|
+
if (path37?.includes("content") && path37.includes("application/octet-stream")) {
|
|
4721
5089
|
return {};
|
|
4722
5090
|
}
|
|
4723
5091
|
if (schema3.type === "string" && schema3.format === "binary") {
|
|
@@ -4743,11 +5111,11 @@ var upgradeSchema = (schema2) => {
|
|
|
4743
5111
|
}
|
|
4744
5112
|
return sub;
|
|
4745
5113
|
});
|
|
4746
|
-
schema2 = traverse(schema2, (schema3,
|
|
5114
|
+
schema2 = traverse(schema2, (schema3, path37) => {
|
|
4747
5115
|
if (schema3.type === "string" && schema3.format === "byte") {
|
|
4748
|
-
const parentPath =
|
|
5116
|
+
const parentPath = path37?.slice(0, -1);
|
|
4749
5117
|
const contentMediaType = parentPath?.find(
|
|
4750
|
-
(_, index) =>
|
|
5118
|
+
(_, index) => path37?.[index - 1] === "content"
|
|
4751
5119
|
);
|
|
4752
5120
|
return {
|
|
4753
5121
|
type: "string",
|
|
@@ -4759,7 +5127,7 @@ var upgradeSchema = (schema2) => {
|
|
|
4759
5127
|
});
|
|
4760
5128
|
return schema2;
|
|
4761
5129
|
};
|
|
4762
|
-
function isSchemaPath(
|
|
5130
|
+
function isSchemaPath(path37) {
|
|
4763
5131
|
const schemaLocations = [
|
|
4764
5132
|
["components", "schemas"],
|
|
4765
5133
|
"properties",
|
|
@@ -4772,10 +5140,10 @@ function isSchemaPath(path35) {
|
|
|
4772
5140
|
];
|
|
4773
5141
|
return schemaLocations.some((location) => {
|
|
4774
5142
|
if (Array.isArray(location)) {
|
|
4775
|
-
return location.every((segment, index) =>
|
|
5143
|
+
return location.every((segment, index) => path37[index] === segment);
|
|
4776
5144
|
}
|
|
4777
|
-
return
|
|
4778
|
-
}) ||
|
|
5145
|
+
return path37.includes(location);
|
|
5146
|
+
}) || path37.includes("schema") || path37.some((segment) => segment.endsWith("Schema"));
|
|
4779
5147
|
}
|
|
4780
5148
|
|
|
4781
5149
|
// src/lib/oas/parser/index.ts
|
|
@@ -4857,13 +5225,13 @@ var OPENAPI_PROPS = /* @__PURE__ */ new Set([
|
|
|
4857
5225
|
"anyOf",
|
|
4858
5226
|
"oneOf"
|
|
4859
5227
|
]);
|
|
4860
|
-
var handleCircularRefs = (obj, currentPath = /* @__PURE__ */ new WeakSet(), refs = /* @__PURE__ */ new WeakMap(),
|
|
5228
|
+
var handleCircularRefs = (obj, currentPath = /* @__PURE__ */ new WeakSet(), refs = /* @__PURE__ */ new WeakMap(), path37 = [], currentRefPaths = /* @__PURE__ */ new Set()) => {
|
|
4861
5229
|
if (obj === null || typeof obj !== "object") return obj;
|
|
4862
5230
|
const refPath = obj.__$ref;
|
|
4863
5231
|
const isCircular = currentPath.has(obj) || typeof refPath === "string" && currentRefPaths.has(refPath);
|
|
4864
5232
|
if (isCircular) {
|
|
4865
5233
|
if (typeof refPath === "string") return SCHEMA_REF_PREFIX + refPath;
|
|
4866
|
-
const circularProp =
|
|
5234
|
+
const circularProp = path37.find((p) => !OPENAPI_PROPS.has(p)) || path37[0];
|
|
4867
5235
|
return [CIRCULAR_REF, circularProp].filter(Boolean).join(":");
|
|
4868
5236
|
}
|
|
4869
5237
|
if (refs.has(obj)) return refs.get(obj);
|
|
@@ -4873,7 +5241,7 @@ var handleCircularRefs = (obj, currentPath = /* @__PURE__ */ new WeakSet(), refs
|
|
|
4873
5241
|
value,
|
|
4874
5242
|
currentPath,
|
|
4875
5243
|
refs,
|
|
4876
|
-
[...
|
|
5244
|
+
[...path37, key],
|
|
4877
5245
|
currentRefPaths
|
|
4878
5246
|
);
|
|
4879
5247
|
const result = Array.isArray(obj) ? obj.map((item, i) => recurse(item, i.toString())) : Object.fromEntries(
|
|
@@ -4908,7 +5276,7 @@ var resolveExtensions = (obj) => Object.fromEntries(
|
|
|
4908
5276
|
var getAllTags = (schema2) => {
|
|
4909
5277
|
const rootTags = schema2.tags ?? [];
|
|
4910
5278
|
const operations = Object.values(schema2.paths ?? {}).flatMap(
|
|
4911
|
-
(
|
|
5279
|
+
(path37) => HttpMethods.map((k) => path37?.[k]).filter((op) => op != null)
|
|
4912
5280
|
);
|
|
4913
5281
|
const operationTags = new Set(operations.flatMap((op) => op.tags ?? []));
|
|
4914
5282
|
const hasUntaggedOperations = operations.some(
|
|
@@ -4963,7 +5331,7 @@ var getAllSlugs = (ops, schemaTags = []) => {
|
|
|
4963
5331
|
var getOperationSlugKey = (op) => [op.path, op.method, op.operationId, op.summary].filter(Boolean).join("-");
|
|
4964
5332
|
var getAllOperations = (paths) => {
|
|
4965
5333
|
const operations = Object.entries(paths ?? {}).flatMap(
|
|
4966
|
-
([
|
|
5334
|
+
([path37, value]) => HttpMethods.flatMap((method) => {
|
|
4967
5335
|
if (!value?.[method]) return [];
|
|
4968
5336
|
const operation = value[method];
|
|
4969
5337
|
const pathParameters = value.parameters ?? [];
|
|
@@ -4983,7 +5351,7 @@ var getAllOperations = (paths) => {
|
|
|
4983
5351
|
return {
|
|
4984
5352
|
...operation,
|
|
4985
5353
|
method,
|
|
4986
|
-
path:
|
|
5354
|
+
path: path37,
|
|
4987
5355
|
parameters,
|
|
4988
5356
|
servers,
|
|
4989
5357
|
tags: operation.tags ?? []
|
|
@@ -5341,8 +5709,8 @@ var Schema = builder.objectRef("Schema").implement({
|
|
|
5341
5709
|
}),
|
|
5342
5710
|
paths: t.field({
|
|
5343
5711
|
type: [PathItem],
|
|
5344
|
-
resolve: (root) => Object.entries(root.paths ?? {}).map(([
|
|
5345
|
-
path:
|
|
5712
|
+
resolve: (root) => Object.entries(root.paths ?? {}).map(([path37, value]) => ({
|
|
5713
|
+
path: path37,
|
|
5346
5714
|
// biome-ignore lint/style/noNonNullAssertion: value is guaranteed to be defined
|
|
5347
5715
|
methods: Object.keys(value)
|
|
5348
5716
|
}))
|
|
@@ -5437,7 +5805,7 @@ var ensureArray = (value) => Array.isArray(value) ? value : [value];
|
|
|
5437
5805
|
|
|
5438
5806
|
// src/vite/api/SchemaManager.ts
|
|
5439
5807
|
import fs2 from "node:fs/promises";
|
|
5440
|
-
import
|
|
5808
|
+
import path9 from "node:path";
|
|
5441
5809
|
import {
|
|
5442
5810
|
$RefParser as $RefParser2
|
|
5443
5811
|
} from "@apidevtools/json-schema-ref-parser";
|
|
@@ -5489,7 +5857,7 @@ init_joinUrl();
|
|
|
5489
5857
|
|
|
5490
5858
|
// src/vite/api/schema-codegen.ts
|
|
5491
5859
|
var unescapeJsonPointer = (uri) => decodeURIComponent(uri.replace(/~1/g, "/").replace(/~0/g, "~"));
|
|
5492
|
-
var getSegmentsFromPath = (
|
|
5860
|
+
var getSegmentsFromPath = (path37) => path37.split("/").slice(1).map(unescapeJsonPointer);
|
|
5493
5861
|
var createLocalRefMap = (obj) => {
|
|
5494
5862
|
const refMap = /* @__PURE__ */ new Map();
|
|
5495
5863
|
const siblingsMap = /* @__PURE__ */ new Map();
|
|
@@ -5520,16 +5888,16 @@ var replaceMarkers = (code, mergedRefs) => code.replace(/"__refMap:(.*?)"/g, '__
|
|
|
5520
5888
|
/"__refMap\+Siblings:(.*?)"/g,
|
|
5521
5889
|
(_, key) => mergedRefs.get(key) ?? `__refMap["${key}"]`
|
|
5522
5890
|
);
|
|
5523
|
-
var lookup = (schema2,
|
|
5524
|
-
const parts = getSegmentsFromPath(
|
|
5891
|
+
var lookup = (schema2, path37, filePath) => {
|
|
5892
|
+
const parts = getSegmentsFromPath(path37);
|
|
5525
5893
|
let val = schema2;
|
|
5526
5894
|
for (const part of parts) {
|
|
5527
5895
|
while (val.$ref?.startsWith("#/")) {
|
|
5528
|
-
val = val.$ref ===
|
|
5896
|
+
val = val.$ref === path37 ? val : lookup(schema2, val.$ref, filePath);
|
|
5529
5897
|
}
|
|
5530
5898
|
if (val[part] === void 0) {
|
|
5531
5899
|
throw new Error(
|
|
5532
|
-
`Error in ${filePath ?? "code generation"}: Could not find path segment ${part} in path: ${
|
|
5900
|
+
`Error in ${filePath ?? "code generation"}: Could not find path segment ${part} in path: ${path37}`
|
|
5533
5901
|
);
|
|
5534
5902
|
}
|
|
5535
5903
|
val = val[part];
|
|
@@ -5627,18 +5995,18 @@ var SchemaManager = class {
|
|
|
5627
5995
|
];
|
|
5628
5996
|
}
|
|
5629
5997
|
getPathForFile = (input, params) => {
|
|
5630
|
-
const filePath =
|
|
5998
|
+
const filePath = path9.resolve(this.config.__meta.rootDir, input);
|
|
5631
5999
|
const apis = ensureArray(this.config.apis ?? []);
|
|
5632
6000
|
for (const apiConfig of apis) {
|
|
5633
6001
|
if (!apiConfig || apiConfig.type !== "file" || !apiConfig.path) continue;
|
|
5634
6002
|
const match = normalizeInputs(apiConfig.input).some(
|
|
5635
|
-
(i) =>
|
|
6003
|
+
(i) => path9.resolve(this.config.__meta.rootDir, i.input) === filePath && deepEqual(i.params, params)
|
|
5636
6004
|
);
|
|
5637
6005
|
if (match) return apiConfig.path;
|
|
5638
6006
|
}
|
|
5639
6007
|
};
|
|
5640
6008
|
processSchema = async (input) => {
|
|
5641
|
-
const filePath =
|
|
6009
|
+
const filePath = path9.resolve(this.config.__meta.rootDir, input.input);
|
|
5642
6010
|
const params = input.params;
|
|
5643
6011
|
const configuredPath = this.getPathForFile(input.input, params);
|
|
5644
6012
|
if (!configuredPath) {
|
|
@@ -5674,9 +6042,9 @@ var SchemaManager = class {
|
|
|
5674
6042
|
const processedTime = Date.now();
|
|
5675
6043
|
const code = generateCode(processedSchema, filePath);
|
|
5676
6044
|
const prefixPath = slugify(configuredPath);
|
|
5677
|
-
const processedFilePath =
|
|
6045
|
+
const processedFilePath = path9.posix.join(
|
|
5678
6046
|
this.storeDir,
|
|
5679
|
-
`${prefixPath}-${
|
|
6047
|
+
`${prefixPath}-${path9.basename(filePath)}${paramsSuffix(params)}.js`
|
|
5680
6048
|
);
|
|
5681
6049
|
const importKey = processedFilePath;
|
|
5682
6050
|
await fs2.writeFile(processedFilePath, code);
|
|
@@ -5725,7 +6093,7 @@ var SchemaManager = class {
|
|
|
5725
6093
|
};
|
|
5726
6094
|
getAllTrackedFiles = () => Array.from(this.referencedBy.keys());
|
|
5727
6095
|
getFilesToReprocess = (changedFile) => {
|
|
5728
|
-
const resolvedPath =
|
|
6096
|
+
const resolvedPath = path9.resolve(this.config.__meta.rootDir, changedFile);
|
|
5729
6097
|
const referencedBy = this.referencedBy.get(resolvedPath);
|
|
5730
6098
|
if (!referencedBy) return [];
|
|
5731
6099
|
const filesToProcess = referencedBy.size === 0 ? [resolvedPath] : Array.from(referencedBy);
|
|
@@ -5754,7 +6122,7 @@ var SchemaManager = class {
|
|
|
5754
6122
|
version: "",
|
|
5755
6123
|
path: input.path ?? "",
|
|
5756
6124
|
label: input.label,
|
|
5757
|
-
inputPath:
|
|
6125
|
+
inputPath: path9.resolve(this.config.__meta.rootDir, input.input),
|
|
5758
6126
|
params: input.params,
|
|
5759
6127
|
importKey: "",
|
|
5760
6128
|
downloadUrl: "",
|
|
@@ -5774,8 +6142,8 @@ var SchemaManager = class {
|
|
|
5774
6142
|
}
|
|
5775
6143
|
}
|
|
5776
6144
|
};
|
|
5777
|
-
getLatestSchema = (
|
|
5778
|
-
getSchemasForPath = (
|
|
6145
|
+
getLatestSchema = (path37) => this.processedSchemas[path37]?.at(0);
|
|
6146
|
+
getSchemasForPath = (path37) => this.processedSchemas[path37];
|
|
5779
6147
|
getSchemaImports = () => Object.values(this.processedSchemas).flat().filter((s) => s.importKey);
|
|
5780
6148
|
getUrlToFilePathMap = () => {
|
|
5781
6149
|
const map = /* @__PURE__ */ new Map();
|
|
@@ -5797,7 +6165,7 @@ var SchemaManager = class {
|
|
|
5797
6165
|
};
|
|
5798
6166
|
createSchemaPath = (inputPath, versionPath, apiPath, params) => {
|
|
5799
6167
|
const suffix = paramsSuffix(params);
|
|
5800
|
-
const extension = suffix ? ".json" :
|
|
6168
|
+
const extension = suffix ? ".json" : path9.extname(inputPath);
|
|
5801
6169
|
return joinUrl(
|
|
5802
6170
|
this.config.basePath,
|
|
5803
6171
|
apiPath,
|
|
@@ -5820,7 +6188,7 @@ var SchemaManager = class {
|
|
|
5820
6188
|
// src/vite/plugin-config-reload.ts
|
|
5821
6189
|
init_logger();
|
|
5822
6190
|
init_loader();
|
|
5823
|
-
import
|
|
6191
|
+
import path12 from "node:path";
|
|
5824
6192
|
import colors3 from "picocolors";
|
|
5825
6193
|
|
|
5826
6194
|
// src/vite/plugin-navigation.ts
|
|
@@ -5830,14 +6198,14 @@ import { stringify as stringify3 } from "javascript-stringify";
|
|
|
5830
6198
|
import { isElement } from "react-is";
|
|
5831
6199
|
|
|
5832
6200
|
// src/config/validators/NavigationSchema.ts
|
|
5833
|
-
import
|
|
6201
|
+
import path10 from "node:path";
|
|
5834
6202
|
import { glob } from "glob";
|
|
5835
6203
|
import { fromMarkdown } from "mdast-util-from-markdown";
|
|
5836
6204
|
import { mdxFromMarkdown } from "mdast-util-mdx";
|
|
5837
6205
|
import { mdxjs } from "micromark-extension-mdxjs";
|
|
5838
6206
|
|
|
5839
6207
|
// src/lib/util/readFrontmatter.ts
|
|
5840
|
-
import { readFile } from "node:fs/promises";
|
|
6208
|
+
import { readFile as readFile2 } from "node:fs/promises";
|
|
5841
6209
|
import matter from "gray-matter";
|
|
5842
6210
|
import { parse, stringify as stringify2 } from "yaml";
|
|
5843
6211
|
var yaml = {
|
|
@@ -5845,7 +6213,7 @@ var yaml = {
|
|
|
5845
6213
|
stringify: (obj) => stringify2(obj)
|
|
5846
6214
|
};
|
|
5847
6215
|
var readFrontmatter = async (filePath) => {
|
|
5848
|
-
const content = await
|
|
6216
|
+
const content = await readFile2(filePath, "utf-8");
|
|
5849
6217
|
const normalizedContent = content.replace(/\r\n/g, "\n");
|
|
5850
6218
|
return matter(normalizedContent, { engines: { yaml } });
|
|
5851
6219
|
};
|
|
@@ -5881,7 +6249,7 @@ var extractRichH1 = (content) => {
|
|
|
5881
6249
|
}
|
|
5882
6250
|
};
|
|
5883
6251
|
var isNavigationItem = (item) => item !== void 0;
|
|
5884
|
-
var toPosixPath = (filePath) => filePath.split(
|
|
6252
|
+
var toPosixPath = (filePath) => filePath.split(path10.win32.sep).join(path10.posix.sep);
|
|
5885
6253
|
var NavigationResolver = class {
|
|
5886
6254
|
rootDir;
|
|
5887
6255
|
globPatterns;
|
|
@@ -6014,13 +6382,13 @@ init_invariant();
|
|
|
6014
6382
|
|
|
6015
6383
|
// src/vite/debug.ts
|
|
6016
6384
|
import { mkdir, writeFile } from "node:fs/promises";
|
|
6017
|
-
import
|
|
6385
|
+
import path11 from "node:path";
|
|
6018
6386
|
async function writePluginDebugCode(rootDir, pluginName, code, extension = "js") {
|
|
6019
6387
|
if (process.env.ZUDOKU_BUILD_DEBUG) {
|
|
6020
|
-
const debugDir =
|
|
6388
|
+
const debugDir = path11.join(rootDir, "dist", "debug");
|
|
6021
6389
|
await mkdir(debugDir, { recursive: true });
|
|
6022
6390
|
await writeFile(
|
|
6023
|
-
|
|
6391
|
+
path11.join(debugDir, `${pluginName}.${extension}`),
|
|
6024
6392
|
typeof code === "string" ? code : code.join("\n")
|
|
6025
6393
|
);
|
|
6026
6394
|
}
|
|
@@ -6131,7 +6499,7 @@ var viteConfigReloadPlugin = () => ({
|
|
|
6131
6499
|
});
|
|
6132
6500
|
logger.info(
|
|
6133
6501
|
colors3.blue(
|
|
6134
|
-
`Config ${
|
|
6502
|
+
`Config ${path12.basename(currentConfig.__meta.configPath)} changed. Reloading...`
|
|
6135
6503
|
),
|
|
6136
6504
|
{ timestamp: true }
|
|
6137
6505
|
);
|
|
@@ -6145,11 +6513,11 @@ var viteApiPlugin = async () => {
|
|
|
6145
6513
|
const resolvedVirtualModuleId4 = `\0${virtualModuleId4}`;
|
|
6146
6514
|
const initialConfig = getCurrentConfig();
|
|
6147
6515
|
const zuploProcessors = ZuploEnv.isZuplo ? await runnerImport3(
|
|
6148
|
-
|
|
6516
|
+
path13.resolve(getZudokuRootDir(), "src/zuplo/with-zuplo-processors.ts")
|
|
6149
6517
|
).then((m) => m.module.default(initialConfig.__meta.rootDir)) : [];
|
|
6150
6518
|
const buildConfig = await getBuildConfig();
|
|
6151
6519
|
const buildProcessors = buildConfig?.processors ?? [];
|
|
6152
|
-
const tmpStoreDir =
|
|
6520
|
+
const tmpStoreDir = path13.posix.join(
|
|
6153
6521
|
initialConfig.__meta.rootDir,
|
|
6154
6522
|
"node_modules/.apitogo/processed"
|
|
6155
6523
|
);
|
|
@@ -6177,7 +6545,7 @@ var viteApiPlugin = async () => {
|
|
|
6177
6545
|
const inputPath = pathMap.get(req.url);
|
|
6178
6546
|
if (!inputPath) return next();
|
|
6179
6547
|
const content = await fs3.readFile(inputPath, "utf-8");
|
|
6180
|
-
const mimeType =
|
|
6548
|
+
const mimeType = path13.extname(inputPath).toLowerCase() === ".json" ? "application/json" : "application/x-yaml";
|
|
6181
6549
|
res.setHeader("Content-Type", `${mimeType}; charset=utf-8`);
|
|
6182
6550
|
return res.end(content);
|
|
6183
6551
|
});
|
|
@@ -6206,7 +6574,7 @@ var viteApiPlugin = async () => {
|
|
|
6206
6574
|
await schemaManager.processAllSchemas();
|
|
6207
6575
|
schemaManager.getAllTrackedFiles().forEach((file) => this.addWatchFile(file));
|
|
6208
6576
|
}
|
|
6209
|
-
if (config2.__meta.mode === "standalone") {
|
|
6577
|
+
if (config2.__meta.mode === "standalone" || !config2.__resolvedModules.docs.enabled) {
|
|
6210
6578
|
return [
|
|
6211
6579
|
"export const configuredApiPlugins = [];",
|
|
6212
6580
|
"export const configuredApiCatalogPlugins = [];"
|
|
@@ -6365,8 +6733,8 @@ var viteApiPlugin = async () => {
|
|
|
6365
6733
|
if (process.env.NODE_ENV !== "production") return;
|
|
6366
6734
|
for (const [urlPath, inputPath] of pathMap) {
|
|
6367
6735
|
const content = await fs3.readFile(inputPath, "utf-8");
|
|
6368
|
-
const outputPath =
|
|
6369
|
-
await fs3.mkdir(
|
|
6736
|
+
const outputPath = path13.join(config2.__meta.rootDir, "dist", urlPath);
|
|
6737
|
+
await fs3.mkdir(path13.dirname(outputPath), { recursive: true });
|
|
6370
6738
|
await fs3.writeFile(outputPath, content, "utf-8");
|
|
6371
6739
|
}
|
|
6372
6740
|
}
|
|
@@ -6390,7 +6758,7 @@ var viteAuthPlugin = () => {
|
|
|
6390
6758
|
async load(id) {
|
|
6391
6759
|
if (id === resolvedVirtualModuleId4) {
|
|
6392
6760
|
const config2 = getCurrentConfig();
|
|
6393
|
-
if (!config2.authentication || config2.__meta.mode === "standalone") {
|
|
6761
|
+
if (!config2.authentication || !config2.__resolvedModules.userPanel.userManagement.enabled || config2.__meta.mode === "standalone") {
|
|
6394
6762
|
return `export const configuredAuthProvider = undefined;`;
|
|
6395
6763
|
}
|
|
6396
6764
|
return [
|
|
@@ -6409,7 +6777,7 @@ var plugin_auth_default = viteAuthPlugin;
|
|
|
6409
6777
|
|
|
6410
6778
|
// src/vite/plugin-component.ts
|
|
6411
6779
|
init_loader();
|
|
6412
|
-
import
|
|
6780
|
+
import path14 from "node:path";
|
|
6413
6781
|
var viteAliasPlugin = () => {
|
|
6414
6782
|
return {
|
|
6415
6783
|
name: "zudoku-component-plugin",
|
|
@@ -6433,11 +6801,11 @@ var viteAliasPlugin = () => {
|
|
|
6433
6801
|
"@lukoweb/apitogo/plugins/search-pagefind",
|
|
6434
6802
|
"src/lib/plugins/search-pagefind/index.tsx"
|
|
6435
6803
|
],
|
|
6436
|
-
[/^@
|
|
6804
|
+
[/^@apitogo\/apitogo\/ui\/(.*)\.js/, "src/lib/ui/$1.tsx"]
|
|
6437
6805
|
];
|
|
6438
6806
|
const aliases = replacements.map(([find, replacement]) => ({
|
|
6439
6807
|
find,
|
|
6440
|
-
replacement:
|
|
6808
|
+
replacement: path14.posix.join(config2.__meta.moduleDir, replacement)
|
|
6441
6809
|
}));
|
|
6442
6810
|
return config2.__meta.mode === "internal" || config2.__meta.mode === "standalone" ? { resolve: { alias: aliases } } : void 0;
|
|
6443
6811
|
}
|
|
@@ -6574,7 +6942,7 @@ var viteDocMetadataPlugin = () => ({
|
|
|
6574
6942
|
|
|
6575
6943
|
// src/vite/plugin-docs.ts
|
|
6576
6944
|
init_loader();
|
|
6577
|
-
import
|
|
6945
|
+
import path15 from "node:path";
|
|
6578
6946
|
import { glob as glob3 } from "glob";
|
|
6579
6947
|
import globParent from "glob-parent";
|
|
6580
6948
|
init_ZudokuConfig();
|
|
@@ -6643,7 +7011,7 @@ var globMarkdownFiles = async (config2, options = { absolute: false }) => {
|
|
|
6643
7011
|
if (process.env.NODE_ENV !== "development") {
|
|
6644
7012
|
const draftStatuses = await Promise.all(
|
|
6645
7013
|
globbedFiles.map(async (file) => {
|
|
6646
|
-
const absolutePath =
|
|
7014
|
+
const absolutePath = path15.resolve(config2.__meta.rootDir, file);
|
|
6647
7015
|
const { data } = await readFrontmatter(absolutePath);
|
|
6648
7016
|
return { file, isDraft: data.draft === true };
|
|
6649
7017
|
})
|
|
@@ -6656,9 +7024,9 @@ var globMarkdownFiles = async (config2, options = { absolute: false }) => {
|
|
|
6656
7024
|
if (draftFiles.has(file)) {
|
|
6657
7025
|
continue;
|
|
6658
7026
|
}
|
|
6659
|
-
const relativePath =
|
|
7027
|
+
const relativePath = path15.posix.relative(parent, file);
|
|
6660
7028
|
const routePath = ensureLeadingSlash(relativePath.replace(/\.mdx?$/, ""));
|
|
6661
|
-
const filePath = options.absolute ?
|
|
7029
|
+
const filePath = options.absolute ? path15.resolve(config2.__meta.rootDir, file) : file;
|
|
6662
7030
|
fileMapping[routePath] = filePath;
|
|
6663
7031
|
}
|
|
6664
7032
|
}
|
|
@@ -6705,7 +7073,7 @@ var viteDocsPlugin = () => {
|
|
|
6705
7073
|
async load(id) {
|
|
6706
7074
|
if (id !== resolvedVirtualModuleId4) return;
|
|
6707
7075
|
const config2 = getCurrentConfig();
|
|
6708
|
-
if (config2.__meta.mode === "standalone") {
|
|
7076
|
+
if (config2.__meta.mode === "standalone" || !config2.__resolvedModules.docs.enabled) {
|
|
6709
7077
|
return `export const configuredDocsPlugin = undefined;`;
|
|
6710
7078
|
}
|
|
6711
7079
|
const code = [
|
|
@@ -6722,7 +7090,7 @@ var viteDocsPlugin = () => {
|
|
|
6722
7090
|
const globbedDocuments = {};
|
|
6723
7091
|
for (const [routePath, file] of Object.entries(fileMapping)) {
|
|
6724
7092
|
const importPath = ensureLeadingSlash(
|
|
6725
|
-
|
|
7093
|
+
path15.posix.join(globImportBasePath, file)
|
|
6726
7094
|
);
|
|
6727
7095
|
globbedDocuments[routePath] = importPath;
|
|
6728
7096
|
}
|
|
@@ -6750,7 +7118,7 @@ init_loader();
|
|
|
6750
7118
|
init_ProtectedRoutesSchema();
|
|
6751
7119
|
init_joinUrl();
|
|
6752
7120
|
import { mkdir as mkdir2, writeFile as writeFile2 } from "node:fs/promises";
|
|
6753
|
-
import
|
|
7121
|
+
import path16 from "node:path";
|
|
6754
7122
|
import { matchPath } from "react-router";
|
|
6755
7123
|
var processMarkdownFile = async (filePath) => {
|
|
6756
7124
|
const { content: markdownContent, data: frontmatter } = await readFrontmatter(filePath);
|
|
@@ -6838,7 +7206,7 @@ var viteMarkdownExportPlugin = () => {
|
|
|
6838
7206
|
if (process.env.NODE_ENV !== "production" || Object.keys(markdownFiles).length === 0 || !needsMdFiles) {
|
|
6839
7207
|
return;
|
|
6840
7208
|
}
|
|
6841
|
-
const distDir =
|
|
7209
|
+
const distDir = path16.join(
|
|
6842
7210
|
config2.__meta.rootDir,
|
|
6843
7211
|
"dist",
|
|
6844
7212
|
config2.basePath ?? ""
|
|
@@ -6859,15 +7227,15 @@ var viteMarkdownExportPlugin = () => {
|
|
|
6859
7227
|
content: finalMarkdown
|
|
6860
7228
|
});
|
|
6861
7229
|
const segments = routePath === "/" ? ["index"] : routePath.split("/").filter(Boolean);
|
|
6862
|
-
const outputPath = `${
|
|
6863
|
-
await mkdir2(
|
|
7230
|
+
const outputPath = `${path16.join(distDir, ...segments)}.md`;
|
|
7231
|
+
await mkdir2(path16.dirname(outputPath), { recursive: true });
|
|
6864
7232
|
await writeFile2(outputPath, finalMarkdown, "utf-8");
|
|
6865
7233
|
} catch (error) {
|
|
6866
7234
|
console.warn(`Failed to export markdown for ${routePath}:`, error);
|
|
6867
7235
|
}
|
|
6868
7236
|
}
|
|
6869
7237
|
if (config2.docs?.llms?.llmsTxt || config2.docs?.llms?.llmsTxtFull) {
|
|
6870
|
-
const markdownInfoPath =
|
|
7238
|
+
const markdownInfoPath = path16.join(
|
|
6871
7239
|
config2.__meta.rootDir,
|
|
6872
7240
|
"node_modules/.apitogo/markdown-info.json"
|
|
6873
7241
|
);
|
|
@@ -7019,9 +7387,9 @@ var remarkCodeTabs = () => (tree) => {
|
|
|
7019
7387
|
};
|
|
7020
7388
|
|
|
7021
7389
|
// src/vite/mdx/remark-inject-filepath.ts
|
|
7022
|
-
import
|
|
7390
|
+
import path17 from "node:path";
|
|
7023
7391
|
var remarkInjectFilepath = (rootDir) => (tree, vfile) => {
|
|
7024
|
-
const relativePath =
|
|
7392
|
+
const relativePath = path17.relative(rootDir, vfile.path).split(path17.sep).join(path17.posix.sep);
|
|
7025
7393
|
tree.children.unshift(exportMdxjsConst("__filepath", relativePath));
|
|
7026
7394
|
};
|
|
7027
7395
|
|
|
@@ -7108,18 +7476,18 @@ var remarkLastModified = () => {
|
|
|
7108
7476
|
};
|
|
7109
7477
|
|
|
7110
7478
|
// src/vite/mdx/remark-link-rewrite.ts
|
|
7111
|
-
import
|
|
7479
|
+
import path18 from "node:path";
|
|
7112
7480
|
import { visit as visit5 } from "unist-util-visit";
|
|
7113
7481
|
var remarkLinkRewrite = (basePath = "") => (tree) => {
|
|
7114
7482
|
visit5(tree, "link", (node) => {
|
|
7115
7483
|
if (!node.url) return;
|
|
7116
7484
|
if (node.url.startsWith("http") || node.url.startsWith("mailto:")) return;
|
|
7117
7485
|
node.url = node.url.replace(/\\/g, "/");
|
|
7118
|
-
const base =
|
|
7486
|
+
const base = path18.posix.join(basePath);
|
|
7119
7487
|
if (basePath && node.url.startsWith(base)) {
|
|
7120
7488
|
node.url = node.url.slice(base.length);
|
|
7121
7489
|
} else if (!node.url.startsWith("/") && !node.url.startsWith("#")) {
|
|
7122
|
-
node.url =
|
|
7490
|
+
node.url = path18.posix.join("..", node.url);
|
|
7123
7491
|
}
|
|
7124
7492
|
node.url = node.url.replace(/\.mdx?(#.*)?$/, "$1");
|
|
7125
7493
|
});
|
|
@@ -7337,9 +7705,126 @@ var viteMdxPlugin = async () => {
|
|
|
7337
7705
|
};
|
|
7338
7706
|
var plugin_mdx_default = viteMdxPlugin;
|
|
7339
7707
|
|
|
7708
|
+
// src/vite/plugin-modules.ts
|
|
7709
|
+
init_loader();
|
|
7710
|
+
import path19 from "node:path";
|
|
7711
|
+
import { normalizePath as normalizePath2 } from "vite";
|
|
7712
|
+
var getLandingModuleImport = (moduleDir, mode) => mode === "internal" ? normalizePath2(path19.join(moduleDir, "../module-landing/src/index.tsx")) : "@lukoweb/apitogo-module-landing";
|
|
7713
|
+
var getUserPanelModuleImport = (moduleDir, mode) => mode === "internal" ? normalizePath2(path19.join(moduleDir, "../module-user-panel/src/index.tsx")) : "@lukoweb/apitogo-module-user-panel";
|
|
7714
|
+
var resolveProjectPageImport = (rootDir, pagePath) => normalizePath2(path19.resolve(rootDir, pagePath));
|
|
7715
|
+
var viteModulesPlugin = () => {
|
|
7716
|
+
const virtualModuleId4 = "virtual:zudoku-modules-plugin";
|
|
7717
|
+
const resolvedVirtualModuleId4 = `\0${virtualModuleId4}`;
|
|
7718
|
+
return {
|
|
7719
|
+
name: "zudoku-modules-plugin",
|
|
7720
|
+
resolveId(id) {
|
|
7721
|
+
if (id === virtualModuleId4) {
|
|
7722
|
+
return resolvedVirtualModuleId4;
|
|
7723
|
+
}
|
|
7724
|
+
},
|
|
7725
|
+
async load(id) {
|
|
7726
|
+
if (id !== resolvedVirtualModuleId4) return;
|
|
7727
|
+
const config2 = getCurrentConfig();
|
|
7728
|
+
const { landing, userPanel } = config2.__resolvedModules;
|
|
7729
|
+
if (config2.__meta.mode === "standalone") {
|
|
7730
|
+
return `export const configuredModulesPlugins = [];`;
|
|
7731
|
+
}
|
|
7732
|
+
const landingImport = getLandingModuleImport(
|
|
7733
|
+
config2.__meta.moduleDir,
|
|
7734
|
+
config2.__meta.mode
|
|
7735
|
+
);
|
|
7736
|
+
const userPanelImport = getUserPanelModuleImport(
|
|
7737
|
+
config2.__meta.moduleDir,
|
|
7738
|
+
config2.__meta.mode
|
|
7739
|
+
);
|
|
7740
|
+
const landingConfig = {
|
|
7741
|
+
enabled: landing.enabled,
|
|
7742
|
+
path: landing.path,
|
|
7743
|
+
layout: landing.layout,
|
|
7744
|
+
content: landing.content
|
|
7745
|
+
};
|
|
7746
|
+
const userPanelConfig = {
|
|
7747
|
+
enabled: userPanel.enabled,
|
|
7748
|
+
basePath: userPanel.basePath,
|
|
7749
|
+
dashboard: {
|
|
7750
|
+
enabled: userPanel.dashboard.enabled,
|
|
7751
|
+
path: userPanel.dashboard.path,
|
|
7752
|
+
content: userPanel.dashboard.content
|
|
7753
|
+
},
|
|
7754
|
+
userManagement: {
|
|
7755
|
+
enabled: userPanel.userManagement.enabled,
|
|
7756
|
+
routes: userPanel.userManagement.routes,
|
|
7757
|
+
content: userPanel.userManagement.content
|
|
7758
|
+
},
|
|
7759
|
+
apiKeys: userPanel.apiKeys,
|
|
7760
|
+
plans: {
|
|
7761
|
+
enabled: userPanel.plans.enabled,
|
|
7762
|
+
path: userPanel.plans.path,
|
|
7763
|
+
content: userPanel.plans.content
|
|
7764
|
+
}
|
|
7765
|
+
};
|
|
7766
|
+
const landingPagePath = config2.modules?.landing?.page;
|
|
7767
|
+
const dashboardPagePath = config2.modules?.userPanel?.dashboard?.page;
|
|
7768
|
+
const profilePagePath = config2.modules?.userPanel?.userManagement?.page;
|
|
7769
|
+
const plansPagePath = config2.modules?.userPanel?.plans?.page;
|
|
7770
|
+
const code = [`import config from "virtual:zudoku-config";`];
|
|
7771
|
+
if (landingPagePath) {
|
|
7772
|
+
code.push(
|
|
7773
|
+
`import LandingPage from "${resolveProjectPageImport(config2.__meta.rootDir, landingPagePath)}";`
|
|
7774
|
+
);
|
|
7775
|
+
}
|
|
7776
|
+
if (dashboardPagePath) {
|
|
7777
|
+
code.push(
|
|
7778
|
+
`import UserPanelDashboardPage from "${resolveProjectPageImport(config2.__meta.rootDir, dashboardPagePath)}";`
|
|
7779
|
+
);
|
|
7780
|
+
}
|
|
7781
|
+
if (profilePagePath) {
|
|
7782
|
+
code.push(
|
|
7783
|
+
`import UserPanelProfilePage from "${resolveProjectPageImport(config2.__meta.rootDir, profilePagePath)}";`
|
|
7784
|
+
);
|
|
7785
|
+
}
|
|
7786
|
+
if (plansPagePath) {
|
|
7787
|
+
code.push(
|
|
7788
|
+
`import UserPanelPlansPage from "${resolveProjectPageImport(config2.__meta.rootDir, plansPagePath)}";`
|
|
7789
|
+
);
|
|
7790
|
+
}
|
|
7791
|
+
code.push(
|
|
7792
|
+
`import { landingModule } from "${landingImport}";`,
|
|
7793
|
+
`import { userPanelModule } from "${userPanelImport}";`,
|
|
7794
|
+
`const landing = landingModule({`,
|
|
7795
|
+
` ...${JSON.stringify(landingConfig)},`,
|
|
7796
|
+
` component: config.modules?.landing?.component${landingPagePath ? " ?? LandingPage" : ""},`,
|
|
7797
|
+
`});`,
|
|
7798
|
+
`const userPanel = userPanelModule({`,
|
|
7799
|
+
` ...${JSON.stringify(userPanelConfig)},`,
|
|
7800
|
+
` dashboard: {`,
|
|
7801
|
+
` ...${JSON.stringify(userPanelConfig.dashboard)},`,
|
|
7802
|
+
` component: config.modules?.userPanel?.dashboard?.component${dashboardPagePath ? " ?? UserPanelDashboardPage" : ""},`,
|
|
7803
|
+
` },`,
|
|
7804
|
+
` userManagement: {`,
|
|
7805
|
+
` ...${JSON.stringify(userPanelConfig.userManagement)},`,
|
|
7806
|
+
` component: config.modules?.userPanel?.userManagement?.component${profilePagePath ? " ?? UserPanelProfilePage" : ""},`,
|
|
7807
|
+
` },`,
|
|
7808
|
+
` plans: {`,
|
|
7809
|
+
` ...${JSON.stringify(userPanelConfig.plans)},`,
|
|
7810
|
+
` component: config.modules?.userPanel?.plans?.component${plansPagePath ? " ?? UserPanelPlansPage" : ""},`,
|
|
7811
|
+
` },`,
|
|
7812
|
+
`});`,
|
|
7813
|
+
`export const configuredModulesPlugins = [`,
|
|
7814
|
+
` ...(landing ? [landing] : []),`,
|
|
7815
|
+
` ...(userPanel ? [userPanel] : []),`,
|
|
7816
|
+
`];`
|
|
7817
|
+
);
|
|
7818
|
+
await writePluginDebugCode(config2.__meta.rootDir, "modules-plugin", code);
|
|
7819
|
+
return code.join("\n");
|
|
7820
|
+
}
|
|
7821
|
+
};
|
|
7822
|
+
};
|
|
7823
|
+
var plugin_modules_default = viteModulesPlugin;
|
|
7824
|
+
|
|
7340
7825
|
// src/vite/plugin-search.ts
|
|
7341
7826
|
init_loader();
|
|
7342
|
-
import
|
|
7827
|
+
import path20 from "node:path";
|
|
7343
7828
|
var viteSearchPlugin = () => {
|
|
7344
7829
|
const virtualModuleId4 = "virtual:zudoku-search-plugin";
|
|
7345
7830
|
const resolvedVirtualModuleId4 = `\0${virtualModuleId4}`;
|
|
@@ -7357,7 +7842,7 @@ var viteSearchPlugin = () => {
|
|
|
7357
7842
|
return resolvedVirtualModuleId4;
|
|
7358
7843
|
}
|
|
7359
7844
|
if (id === "/pagefind/pagefind.js" && resolvedViteConfig?.publicDir) {
|
|
7360
|
-
return
|
|
7845
|
+
return path20.join(resolvedViteConfig.publicDir, "pagefind/pagefind.js");
|
|
7361
7846
|
}
|
|
7362
7847
|
},
|
|
7363
7848
|
async load(id) {
|
|
@@ -7477,6 +7962,7 @@ function vitePlugin() {
|
|
|
7477
7962
|
plugin_mdx_default(),
|
|
7478
7963
|
react({ include: /\.(mdx?|jsx?|tsx?)$/ }),
|
|
7479
7964
|
plugin_config_default(),
|
|
7965
|
+
plugin_modules_default(),
|
|
7480
7966
|
plugin_api_keys_default(),
|
|
7481
7967
|
plugin_custom_pages_default(),
|
|
7482
7968
|
plugin_auth_default(),
|
|
@@ -7497,10 +7983,10 @@ function vitePlugin() {
|
|
|
7497
7983
|
var resolveMergedPublicDir = (rootDir, merged) => {
|
|
7498
7984
|
if (merged.publicDir === false) return void 0;
|
|
7499
7985
|
const rel = typeof merged.publicDir === "string" ? merged.publicDir : "public";
|
|
7500
|
-
return
|
|
7986
|
+
return path21.resolve(rootDir, rel);
|
|
7501
7987
|
};
|
|
7502
|
-
var getAppClientEntryPath = () =>
|
|
7503
|
-
var getAppServerEntryPath = () =>
|
|
7988
|
+
var getAppClientEntryPath = () => path21.posix.join(getZudokuRootDir(), "src/app/entry.client.tsx");
|
|
7989
|
+
var getAppServerEntryPath = () => path21.posix.join(getZudokuRootDir(), "src/app/entry.server.tsx");
|
|
7504
7990
|
var hasLoggedCdnInfo = false;
|
|
7505
7991
|
var MEDIA_REGEX = /\.(a?png|jpe?g|gif|bmp|svg|webp|tiff|ico|webm|ogg|mp3|wav|m4a|avif|mp4)/i;
|
|
7506
7992
|
var defineEnvVars = (vars) => Object.fromEntries(
|
|
@@ -7530,11 +8016,12 @@ async function getViteConfig(dir, configEnv) {
|
|
|
7530
8016
|
);
|
|
7531
8017
|
if (ZuploEnv.isZuplo) {
|
|
7532
8018
|
dotenv.config({
|
|
7533
|
-
path:
|
|
8019
|
+
path: path21.resolve(config2.__meta.rootDir, "../.env.zuplo"),
|
|
7534
8020
|
quiet: true
|
|
7535
8021
|
});
|
|
7536
8022
|
}
|
|
7537
8023
|
const deploymentName = ZuploEnv.buildConfig?.deploymentName || getZuploSystemConfigurations(process.env.ZUPLO_SYSTEM_CONFIGURATIONS)?.__ZUPLO_DEPLOYMENT_NAME;
|
|
8024
|
+
const devPortalDefines = await loadDevPortalViteDefines(dir, configEnv.mode);
|
|
7538
8025
|
const viteConfig = {
|
|
7539
8026
|
root: dir,
|
|
7540
8027
|
base,
|
|
@@ -7563,7 +8050,8 @@ async function getViteConfig(dir, configEnv) {
|
|
|
7563
8050
|
"ZUPLO_SERVER_URL",
|
|
7564
8051
|
"ZUPLO_GATEWAY_SERVICE_URL"
|
|
7565
8052
|
]),
|
|
7566
|
-
...publicVarsProcessEnvDefine
|
|
8053
|
+
...publicVarsProcessEnvDefine,
|
|
8054
|
+
...devPortalDefines
|
|
7567
8055
|
},
|
|
7568
8056
|
ssr: {
|
|
7569
8057
|
target: "node",
|
|
@@ -7587,8 +8075,8 @@ async function getViteConfig(dir, configEnv) {
|
|
|
7587
8075
|
ssr: configEnv.isSsrBuild,
|
|
7588
8076
|
sourcemap: true,
|
|
7589
8077
|
target: "es2022",
|
|
7590
|
-
outDir:
|
|
7591
|
-
|
|
8078
|
+
outDir: path21.resolve(
|
|
8079
|
+
path21.join(
|
|
7592
8080
|
dir,
|
|
7593
8081
|
"dist",
|
|
7594
8082
|
config2.basePath ?? "",
|
|
@@ -7607,7 +8095,7 @@ async function getViteConfig(dir, configEnv) {
|
|
|
7607
8095
|
},
|
|
7608
8096
|
experimental: {
|
|
7609
8097
|
renderBuiltUrl(filename) {
|
|
7610
|
-
if (cdnUrl?.base && [".js", ".css"].includes(
|
|
8098
|
+
if (cdnUrl?.base && [".js", ".css"].includes(path21.extname(filename))) {
|
|
7611
8099
|
return joinUrl(cdnUrl.base, filename);
|
|
7612
8100
|
}
|
|
7613
8101
|
if (cdnUrl?.media && MEDIA_REGEX.test(filename)) {
|
|
@@ -7620,7 +8108,7 @@ async function getViteConfig(dir, configEnv) {
|
|
|
7620
8108
|
esbuildOptions: {
|
|
7621
8109
|
target: "es2022"
|
|
7622
8110
|
},
|
|
7623
|
-
entries: [
|
|
8111
|
+
entries: [path21.posix.join(getZudokuRootDir(), "src/{app,lib}/**")],
|
|
7624
8112
|
exclude: ["@lukoweb/apitogo"],
|
|
7625
8113
|
include: [
|
|
7626
8114
|
"react-dom/client",
|
|
@@ -7723,7 +8211,7 @@ init_package_json();
|
|
|
7723
8211
|
init_joinUrl();
|
|
7724
8212
|
import assert from "node:assert";
|
|
7725
8213
|
import { cp, mkdir as mkdir3, writeFile as writeFile3 } from "node:fs/promises";
|
|
7726
|
-
import
|
|
8214
|
+
import path22 from "node:path";
|
|
7727
8215
|
var pkgJson = getZudokuPackageJson();
|
|
7728
8216
|
function generateOutput({
|
|
7729
8217
|
config: config2,
|
|
@@ -7780,9 +8268,9 @@ async function writeOutput(dir, {
|
|
|
7780
8268
|
rewrites
|
|
7781
8269
|
}) {
|
|
7782
8270
|
const output = generateOutput({ config: config2, redirects, rewrites });
|
|
7783
|
-
const outputDir = process.env.VERCEL ?
|
|
8271
|
+
const outputDir = process.env.VERCEL ? path22.join(dir, ".vercel/output") : path22.join(dir, "dist/.output");
|
|
7784
8272
|
await mkdir3(outputDir, { recursive: true });
|
|
7785
|
-
const outputFile =
|
|
8273
|
+
const outputFile = path22.join(outputDir, "config.json");
|
|
7786
8274
|
await writeFile3(outputFile, JSON.stringify(output, null, 2), "utf-8");
|
|
7787
8275
|
if (process.env.VERCEL) {
|
|
7788
8276
|
console.log("Wrote Vercel output to", outputDir);
|
|
@@ -7792,9 +8280,9 @@ async function writeOutput(dir, {
|
|
|
7792
8280
|
// src/vite/prerender/prerender.ts
|
|
7793
8281
|
init_logger();
|
|
7794
8282
|
init_file_exists();
|
|
7795
|
-
import { readFile as
|
|
8283
|
+
import { readFile as readFile3, rm } from "node:fs/promises";
|
|
7796
8284
|
import os from "node:os";
|
|
7797
|
-
import
|
|
8285
|
+
import path25 from "node:path";
|
|
7798
8286
|
import { pathToFileURL } from "node:url";
|
|
7799
8287
|
import { createIndex } from "pagefind";
|
|
7800
8288
|
import colors7 from "picocolors";
|
|
@@ -7836,7 +8324,7 @@ function throttle(fn) {
|
|
|
7836
8324
|
init_joinUrl();
|
|
7837
8325
|
import { createWriteStream, existsSync } from "node:fs";
|
|
7838
8326
|
import { mkdir as mkdir4 } from "node:fs/promises";
|
|
7839
|
-
import
|
|
8327
|
+
import path23 from "node:path";
|
|
7840
8328
|
import colors5 from "picocolors";
|
|
7841
8329
|
import { SitemapStream } from "sitemap";
|
|
7842
8330
|
async function generateSitemap({
|
|
@@ -7850,11 +8338,11 @@ async function generateSitemap({
|
|
|
7850
8338
|
return;
|
|
7851
8339
|
}
|
|
7852
8340
|
const sitemap = new SitemapStream({ hostname: config2.siteUrl });
|
|
7853
|
-
const outputDir =
|
|
8341
|
+
const outputDir = path23.resolve(baseOutputDir, config2.outDir ?? "");
|
|
7854
8342
|
if (!existsSync(outputDir)) {
|
|
7855
8343
|
await mkdir4(outputDir, { recursive: true });
|
|
7856
8344
|
}
|
|
7857
|
-
const sitemapOutputPath =
|
|
8345
|
+
const sitemapOutputPath = path23.join(outputDir, "sitemap.xml");
|
|
7858
8346
|
const writeStream = createWriteStream(sitemapOutputPath);
|
|
7859
8347
|
sitemap.pipe(writeStream);
|
|
7860
8348
|
let lastmod;
|
|
@@ -7884,14 +8372,14 @@ async function generateSitemap({
|
|
|
7884
8372
|
|
|
7885
8373
|
// src/vite/prerender/utils.ts
|
|
7886
8374
|
init_joinUrl();
|
|
7887
|
-
var resolveRoutePath = (
|
|
7888
|
-
const segments =
|
|
8375
|
+
var resolveRoutePath = (path37) => {
|
|
8376
|
+
const segments = path37.split("/");
|
|
7889
8377
|
if (segments.some((s) => s.startsWith(":") && !s.endsWith("?"))) {
|
|
7890
8378
|
return void 0;
|
|
7891
8379
|
}
|
|
7892
8380
|
return segments.filter((s) => !s.startsWith(":")).join("/") || void 0;
|
|
7893
8381
|
};
|
|
7894
|
-
var isSkipped = (
|
|
8382
|
+
var isSkipped = (path37) => path37.includes("*") || /^\d+$/.test(path37);
|
|
7895
8383
|
var resolveRoutes = (routes, parentPath = "") => routes.flatMap((route) => {
|
|
7896
8384
|
if (route.path && isSkipped(route.path)) return [];
|
|
7897
8385
|
const routePath = route.path ? resolveRoutePath(route.path) : void 0;
|
|
@@ -7940,12 +8428,12 @@ var prerender = async ({
|
|
|
7940
8428
|
serverConfigFilename,
|
|
7941
8429
|
writeRedirects = true
|
|
7942
8430
|
}) => {
|
|
7943
|
-
const distDir =
|
|
8431
|
+
const distDir = path25.join(dir, "dist", basePath);
|
|
7944
8432
|
const serverConfigPath = pathToFileURL(
|
|
7945
|
-
|
|
8433
|
+
path25.join(distDir, "server", serverConfigFilename)
|
|
7946
8434
|
).href;
|
|
7947
8435
|
const entryServerPath = pathToFileURL(
|
|
7948
|
-
|
|
8436
|
+
path25.join(distDir, "server/entry.server.js")
|
|
7949
8437
|
).href;
|
|
7950
8438
|
const rawConfig = await import(serverConfigPath).then(
|
|
7951
8439
|
(m) => m.default
|
|
@@ -8030,7 +8518,7 @@ var prerender = async ({
|
|
|
8030
8518
|
})
|
|
8031
8519
|
);
|
|
8032
8520
|
const pagefindWriteResult = await pagefindIndex?.writeFiles({
|
|
8033
|
-
outputPath:
|
|
8521
|
+
outputPath: path25.join(distDir, "pagefind")
|
|
8034
8522
|
});
|
|
8035
8523
|
const seconds = ((performance.now() - start) / 1e3).toFixed(1);
|
|
8036
8524
|
const message = `\u2713 finished prerendering ${paths.length} routes in ${seconds} seconds using ${maxThreads} workers`;
|
|
@@ -8062,13 +8550,13 @@ var prerender = async ({
|
|
|
8062
8550
|
const { generateLlmsTxtFiles: generateLlmsTxtFiles2 } = await Promise.resolve().then(() => (init_llms(), llms_exports));
|
|
8063
8551
|
const docsConfig = DocsConfigSchema2.parse(config2.docs);
|
|
8064
8552
|
const llmsConfig = docsConfig.llms ?? {};
|
|
8065
|
-
const markdownInfoPath =
|
|
8553
|
+
const markdownInfoPath = path25.join(
|
|
8066
8554
|
dir,
|
|
8067
8555
|
"node_modules/.apitogo/markdown-info.json"
|
|
8068
8556
|
);
|
|
8069
8557
|
let markdownFileInfos = [];
|
|
8070
8558
|
if (await fileExists(markdownInfoPath)) {
|
|
8071
|
-
const markdownInfoContent = await
|
|
8559
|
+
const markdownInfoContent = await readFile3(markdownInfoPath, "utf-8");
|
|
8072
8560
|
markdownFileInfos = JSON.parse(markdownInfoContent);
|
|
8073
8561
|
}
|
|
8074
8562
|
if (llmsConfig.llmsTxt || llmsConfig.llmsTxtFull) {
|
|
@@ -8153,7 +8641,7 @@ async function runBuild(options) {
|
|
|
8153
8641
|
html,
|
|
8154
8642
|
basePath: config2.basePath
|
|
8155
8643
|
});
|
|
8156
|
-
await rm2(
|
|
8644
|
+
await rm2(path26.join(clientOutDir, "index.html"), { force: true });
|
|
8157
8645
|
} else {
|
|
8158
8646
|
await runPrerender({
|
|
8159
8647
|
dir,
|
|
@@ -8177,7 +8665,7 @@ var runPrerender = async (options) => {
|
|
|
8177
8665
|
serverConfigFilename,
|
|
8178
8666
|
writeRedirects: process.env.VERCEL === void 0
|
|
8179
8667
|
});
|
|
8180
|
-
const indexHtml =
|
|
8668
|
+
const indexHtml = path26.join(clientOutDir, "index.html");
|
|
8181
8669
|
if (!workerResults.find((r) => r.outputPath === indexHtml)) {
|
|
8182
8670
|
await writeFile5(indexHtml, html, "utf-8");
|
|
8183
8671
|
}
|
|
@@ -8187,15 +8675,15 @@ var runPrerender = async (options) => {
|
|
|
8187
8675
|
for (const statusPage of statusPages) {
|
|
8188
8676
|
await rename(
|
|
8189
8677
|
statusPage,
|
|
8190
|
-
|
|
8678
|
+
path26.join(dir, DIST_DIR, path26.basename(statusPage))
|
|
8191
8679
|
);
|
|
8192
8680
|
}
|
|
8193
8681
|
await rm2(serverOutDir, { recursive: true, force: true });
|
|
8194
8682
|
if (process.env.VERCEL) {
|
|
8195
|
-
await mkdir5(
|
|
8683
|
+
await mkdir5(path26.join(dir, ".vercel/output/static"), { recursive: true });
|
|
8196
8684
|
await rename(
|
|
8197
|
-
|
|
8198
|
-
|
|
8685
|
+
path26.join(dir, DIST_DIR),
|
|
8686
|
+
path26.join(dir, ".vercel/output/static")
|
|
8199
8687
|
);
|
|
8200
8688
|
}
|
|
8201
8689
|
await writeOutput(dir, {
|
|
@@ -8205,7 +8693,7 @@ var runPrerender = async (options) => {
|
|
|
8205
8693
|
});
|
|
8206
8694
|
if (ZuploEnv.isZuplo && issuer) {
|
|
8207
8695
|
await writeFile5(
|
|
8208
|
-
|
|
8696
|
+
path26.join(dir, DIST_DIR, ".output/zuplo.json"),
|
|
8209
8697
|
JSON.stringify({ issuer }, null, 2),
|
|
8210
8698
|
"utf-8"
|
|
8211
8699
|
);
|
|
@@ -8217,10 +8705,10 @@ var runPrerender = async (options) => {
|
|
|
8217
8705
|
};
|
|
8218
8706
|
var bundleSSREntry = async (options) => {
|
|
8219
8707
|
const { dir, adapter, serverOutDir, serverConfigFilename, html, basePath } = options;
|
|
8220
|
-
const tempEntryPath =
|
|
8708
|
+
const tempEntryPath = path26.join(dir, "__ssr-entry.ts");
|
|
8221
8709
|
const packageRoot = getZudokuRootDir();
|
|
8222
|
-
const templateContent = await
|
|
8223
|
-
|
|
8710
|
+
const templateContent = await readFile4(
|
|
8711
|
+
path26.join(packageRoot, "src/vite/ssr-templates", `${adapter}.ts`),
|
|
8224
8712
|
"utf-8"
|
|
8225
8713
|
);
|
|
8226
8714
|
const entryContent = templateContent.replace('"__TEMPLATE__"', JSON.stringify(html)).replace('"__CONFIG_FILE__"', JSON.stringify(`./${serverConfigFilename}`)).replace(
|
|
@@ -8235,9 +8723,9 @@ var bundleSSREntry = async (options) => {
|
|
|
8235
8723
|
platform: adapter === "node" ? "node" : "neutral",
|
|
8236
8724
|
target: "es2022",
|
|
8237
8725
|
format: "esm",
|
|
8238
|
-
outfile:
|
|
8726
|
+
outfile: path26.join(serverOutDir, "entry.js"),
|
|
8239
8727
|
external: ["./entry.server.js", `./${serverConfigFilename}`],
|
|
8240
|
-
nodePaths: [
|
|
8728
|
+
nodePaths: [path26.join(packageRoot, "node_modules")],
|
|
8241
8729
|
banner: { js: "// Bundled SSR entry" }
|
|
8242
8730
|
});
|
|
8243
8731
|
} finally {
|
|
@@ -8292,11 +8780,11 @@ function textOrJson(text) {
|
|
|
8292
8780
|
init_package_json();
|
|
8293
8781
|
|
|
8294
8782
|
// src/cli/preview/handler.ts
|
|
8295
|
-
import
|
|
8783
|
+
import path27 from "node:path";
|
|
8296
8784
|
import { preview as vitePreview } from "vite";
|
|
8297
8785
|
var DEFAULT_PREVIEW_PORT = 4e3;
|
|
8298
8786
|
async function preview(argv) {
|
|
8299
|
-
const dir =
|
|
8787
|
+
const dir = path27.resolve(process.cwd(), argv.dir);
|
|
8300
8788
|
const viteConfig = await getViteConfig(dir, {
|
|
8301
8789
|
command: "serve",
|
|
8302
8790
|
mode: "production",
|
|
@@ -8337,7 +8825,7 @@ async function build(argv) {
|
|
|
8337
8825
|
printDiagnosticsToConsole("");
|
|
8338
8826
|
printDiagnosticsToConsole("");
|
|
8339
8827
|
}
|
|
8340
|
-
const dir =
|
|
8828
|
+
const dir = path28.resolve(process.cwd(), argv.dir);
|
|
8341
8829
|
try {
|
|
8342
8830
|
await runBuild({
|
|
8343
8831
|
dir,
|
|
@@ -8497,7 +8985,7 @@ var build_default = {
|
|
|
8497
8985
|
// src/cli/configure-github-workflow/handler.ts
|
|
8498
8986
|
import { constants } from "node:fs";
|
|
8499
8987
|
import { access, mkdir as mkdir6, writeFile as writeFile6 } from "node:fs/promises";
|
|
8500
|
-
import
|
|
8988
|
+
import path29 from "node:path";
|
|
8501
8989
|
var APITOGO_DEPLOY_WORKFLOW_YAML = `name: Build and Deploy
|
|
8502
8990
|
|
|
8503
8991
|
on:
|
|
@@ -8608,9 +9096,9 @@ jobs:
|
|
|
8608
9096
|
run: apitogo deploy --deployment-token="$APITOGO_TOKEN" --json-only
|
|
8609
9097
|
`;
|
|
8610
9098
|
async function configureGithubWorkflow(argv) {
|
|
8611
|
-
const dir =
|
|
8612
|
-
const workflowDir =
|
|
8613
|
-
const workflowPath =
|
|
9099
|
+
const dir = path29.resolve(process.cwd(), argv.dir);
|
|
9100
|
+
const workflowDir = path29.join(dir, ".github", "workflows");
|
|
9101
|
+
const workflowPath = path29.join(workflowDir, "apitogo-deploy.yml");
|
|
8614
9102
|
try {
|
|
8615
9103
|
try {
|
|
8616
9104
|
await access(workflowPath, constants.F_OK);
|
|
@@ -8682,15 +9170,15 @@ function applyJsonOnlyDeployQuietMode() {
|
|
|
8682
9170
|
}
|
|
8683
9171
|
|
|
8684
9172
|
// src/cli/deploy/handler.ts
|
|
8685
|
-
import { access as access2, readFile as
|
|
8686
|
-
import
|
|
9173
|
+
import { access as access2, readFile as readFile5 } from "node:fs/promises";
|
|
9174
|
+
import path30 from "node:path";
|
|
8687
9175
|
import { create as createTar } from "tar";
|
|
8688
9176
|
var DEPLOY_ENDPOINT = "https://deploy-server-dotnet2-b3fkcaaraydbckfe.canadacentral-01.azurewebsites.net/deploy";
|
|
8689
9177
|
var ARCHIVE_NAME = "dist.tgz";
|
|
8690
9178
|
var createDeploymentArchive = async (dir) => {
|
|
8691
|
-
const distDir =
|
|
9179
|
+
const distDir = path30.join(dir, "dist");
|
|
8692
9180
|
await access2(distDir);
|
|
8693
|
-
const archivePath =
|
|
9181
|
+
const archivePath = path30.join(dir, ARCHIVE_NAME);
|
|
8694
9182
|
await createTar(
|
|
8695
9183
|
{
|
|
8696
9184
|
cwd: dir,
|
|
@@ -8704,7 +9192,7 @@ var createDeploymentArchive = async (dir) => {
|
|
|
8704
9192
|
};
|
|
8705
9193
|
async function deploy(argv) {
|
|
8706
9194
|
await build({ ...argv, preview: void 0 });
|
|
8707
|
-
const dir =
|
|
9195
|
+
const dir = path30.resolve(process.cwd(), argv.dir);
|
|
8708
9196
|
const deploymentToken = argv.deploymentToken?.trim() || process.env.npm_config_deployment_token?.trim();
|
|
8709
9197
|
const env = argv.env?.trim() || process.env.npm_config_env?.trim() || "production";
|
|
8710
9198
|
try {
|
|
@@ -8717,15 +9205,15 @@ async function deploy(argv) {
|
|
|
8717
9205
|
const archivePath = await createDeploymentArchive(dir);
|
|
8718
9206
|
if (!isJsonOnlyDeployEnv()) {
|
|
8719
9207
|
printDiagnosticsToConsole(
|
|
8720
|
-
`Uploading ${
|
|
9208
|
+
`Uploading ${path30.basename(archivePath)} to ${env}...`
|
|
8721
9209
|
);
|
|
8722
9210
|
}
|
|
8723
|
-
const archiveBuffer = await
|
|
9211
|
+
const archiveBuffer = await readFile5(archivePath);
|
|
8724
9212
|
const formData = new FormData();
|
|
8725
9213
|
formData.append(
|
|
8726
9214
|
"file",
|
|
8727
9215
|
new Blob([archiveBuffer], { type: "application/gzip" }),
|
|
8728
|
-
|
|
9216
|
+
path30.basename(archivePath)
|
|
8729
9217
|
);
|
|
8730
9218
|
formData.append("deploymentToken", deploymentToken);
|
|
8731
9219
|
formData.append("env", env);
|
|
@@ -8810,14 +9298,14 @@ var deploy_default = {
|
|
|
8810
9298
|
|
|
8811
9299
|
// src/cli/dev/handler.ts
|
|
8812
9300
|
init_joinUrl();
|
|
8813
|
-
import
|
|
9301
|
+
import path33 from "node:path";
|
|
8814
9302
|
|
|
8815
9303
|
// src/vite/dev-server.ts
|
|
8816
9304
|
init_logger();
|
|
8817
9305
|
import fs4 from "node:fs/promises";
|
|
8818
9306
|
import http from "node:http";
|
|
8819
9307
|
import https from "node:https";
|
|
8820
|
-
import
|
|
9308
|
+
import path32 from "node:path";
|
|
8821
9309
|
import { createHttpTerminator } from "http-terminator";
|
|
8822
9310
|
import {
|
|
8823
9311
|
createServer as createViteServer,
|
|
@@ -8850,7 +9338,7 @@ init_loader();
|
|
|
8850
9338
|
// src/vite/pagefind-dev-index.ts
|
|
8851
9339
|
init_invariant();
|
|
8852
9340
|
init_joinUrl();
|
|
8853
|
-
import
|
|
9341
|
+
import path31 from "node:path";
|
|
8854
9342
|
import { createIndex as createIndex2 } from "pagefind";
|
|
8855
9343
|
import { isRunnableDevEnvironment } from "vite";
|
|
8856
9344
|
async function* buildPagefindDevIndex(vite, config2) {
|
|
@@ -8903,7 +9391,7 @@ async function* buildPagefindDevIndex(vite, config2) {
|
|
|
8903
9391
|
path: urlPath
|
|
8904
9392
|
};
|
|
8905
9393
|
}
|
|
8906
|
-
const outputPath =
|
|
9394
|
+
const outputPath = path31.join(vite.config.publicDir, "pagefind");
|
|
8907
9395
|
await pagefindIndex.writeFiles({ outputPath });
|
|
8908
9396
|
yield { type: "complete", success: true, indexed };
|
|
8909
9397
|
}
|
|
@@ -8922,9 +9410,9 @@ var DevServer = class {
|
|
|
8922
9410
|
this.protocol = "https";
|
|
8923
9411
|
const { dir } = this.options;
|
|
8924
9412
|
const [key, cert, ca] = await Promise.all([
|
|
8925
|
-
fs4.readFile(
|
|
8926
|
-
fs4.readFile(
|
|
8927
|
-
config2.https.ca ? fs4.readFile(
|
|
9413
|
+
fs4.readFile(path32.resolve(dir, config2.https.key)),
|
|
9414
|
+
fs4.readFile(path32.resolve(dir, config2.https.cert)),
|
|
9415
|
+
config2.https.ca ? fs4.readFile(path32.resolve(dir, config2.https.ca)) : void 0
|
|
8928
9416
|
]);
|
|
8929
9417
|
return https.createServer({ key, cert, ca });
|
|
8930
9418
|
}
|
|
@@ -8941,7 +9429,7 @@ var DevServer = class {
|
|
|
8941
9429
|
);
|
|
8942
9430
|
const server = await this.createNodeServer(config2);
|
|
8943
9431
|
if (config2.search?.type === "pagefind" && viteConfig.publicDir !== false) {
|
|
8944
|
-
const publicRoot =
|
|
9432
|
+
const publicRoot = path32.resolve(
|
|
8945
9433
|
this.options.dir,
|
|
8946
9434
|
typeof viteConfig.publicDir === "string" ? viteConfig.publicDir : "public"
|
|
8947
9435
|
);
|
|
@@ -8958,7 +9446,7 @@ var DevServer = class {
|
|
|
8958
9446
|
// built-in transform middleware which would treat the path as a static asset.
|
|
8959
9447
|
name: "apitogo:entry-client",
|
|
8960
9448
|
configureServer(server2) {
|
|
8961
|
-
const entryPath =
|
|
9449
|
+
const entryPath = path32.posix.join(
|
|
8962
9450
|
server2.config.base,
|
|
8963
9451
|
"/__z/entry.client.tsx"
|
|
8964
9452
|
);
|
|
@@ -9123,7 +9611,7 @@ init_package_json();
|
|
|
9123
9611
|
async function dev(argv) {
|
|
9124
9612
|
const packageJson2 = getZudokuPackageJson();
|
|
9125
9613
|
process.env.NODE_ENV = "development";
|
|
9126
|
-
const dir =
|
|
9614
|
+
const dir = path33.resolve(process.cwd(), argv.dir);
|
|
9127
9615
|
const server = new DevServer({
|
|
9128
9616
|
dir,
|
|
9129
9617
|
argPort: argv.port,
|
|
@@ -9207,15 +9695,15 @@ var dev_default = {
|
|
|
9207
9695
|
|
|
9208
9696
|
// src/cli/make-config/handler.ts
|
|
9209
9697
|
import { constants as constants3 } from "node:fs";
|
|
9210
|
-
import { access as access4, mkdir as mkdir7, readFile as
|
|
9211
|
-
import
|
|
9698
|
+
import { access as access4, mkdir as mkdir7, readFile as readFile7, writeFile as writeFile8 } from "node:fs/promises";
|
|
9699
|
+
import path35 from "node:path";
|
|
9212
9700
|
import { glob as glob5 } from "glob";
|
|
9213
9701
|
|
|
9214
9702
|
// src/cli/make-config/scaffold-project.ts
|
|
9215
9703
|
init_package_json();
|
|
9216
9704
|
import { constants as constants2 } from "node:fs";
|
|
9217
|
-
import { access as access3, readFile as
|
|
9218
|
-
import
|
|
9705
|
+
import { access as access3, readFile as readFile6, writeFile as writeFile7 } from "node:fs/promises";
|
|
9706
|
+
import path34 from "node:path";
|
|
9219
9707
|
import { glob as glob4 } from "glob";
|
|
9220
9708
|
var OPENAPI_GLOBS = [
|
|
9221
9709
|
"apis/openapi.json",
|
|
@@ -9275,9 +9763,9 @@ var findMatchingCurly = (source, startIndex) => {
|
|
|
9275
9763
|
}
|
|
9276
9764
|
throw new Error("Could not find matching closing brace for object.");
|
|
9277
9765
|
};
|
|
9278
|
-
var toPosix = (p) => p.split(
|
|
9766
|
+
var toPosix = (p) => p.split(path34.sep).join("/");
|
|
9279
9767
|
var sanitizePackageName = (dir) => {
|
|
9280
|
-
const base =
|
|
9768
|
+
const base = path34.basename(path34.resolve(dir));
|
|
9281
9769
|
const s = base.toLowerCase().replace(/[^a-z0-9-_.]/g, "-").replace(/^-+|-+$/g, "");
|
|
9282
9770
|
return s || "apitogo-site";
|
|
9283
9771
|
};
|
|
@@ -9287,7 +9775,7 @@ var apitogoVersionRange = () => {
|
|
|
9287
9775
|
};
|
|
9288
9776
|
async function findOpenApiSpecPath(dir) {
|
|
9289
9777
|
for (const rel of OPENAPI_GLOBS) {
|
|
9290
|
-
const full =
|
|
9778
|
+
const full = path34.join(dir, rel);
|
|
9291
9779
|
try {
|
|
9292
9780
|
await access3(full, constants2.R_OK);
|
|
9293
9781
|
return toPosix(rel);
|
|
@@ -9302,7 +9790,7 @@ async function findOpenApiSpecPath(dir) {
|
|
|
9302
9790
|
return extra[0] ? toPosix(extra[0]) : null;
|
|
9303
9791
|
}
|
|
9304
9792
|
async function ensurePackageJson(dir) {
|
|
9305
|
-
const pkgPath =
|
|
9793
|
+
const pkgPath = path34.join(dir, "package.json");
|
|
9306
9794
|
const apitogoVer = apitogoVersionRange();
|
|
9307
9795
|
const baseDeps = {
|
|
9308
9796
|
react: ">=19.0.0",
|
|
@@ -9337,7 +9825,7 @@ async function ensurePackageJson(dir) {
|
|
|
9337
9825
|
`, "utf8");
|
|
9338
9826
|
return true;
|
|
9339
9827
|
}
|
|
9340
|
-
const raw = await
|
|
9828
|
+
const raw = await readFile6(pkgPath, "utf8");
|
|
9341
9829
|
let pkg;
|
|
9342
9830
|
try {
|
|
9343
9831
|
pkg = JSON.parse(raw);
|
|
@@ -9365,7 +9853,7 @@ async function ensurePackageJson(dir) {
|
|
|
9365
9853
|
return false;
|
|
9366
9854
|
}
|
|
9367
9855
|
async function ensureTsconfigJson(dir) {
|
|
9368
|
-
const tsPath =
|
|
9856
|
+
const tsPath = path34.join(dir, "tsconfig.json");
|
|
9369
9857
|
try {
|
|
9370
9858
|
await access3(tsPath, constants2.R_OK);
|
|
9371
9859
|
return false;
|
|
@@ -9447,7 +9935,7 @@ var CONFIG_FILENAMES = [
|
|
|
9447
9935
|
];
|
|
9448
9936
|
var DEFAULT_NEW_CONFIG_FILENAME = "apitogo.config.tsx";
|
|
9449
9937
|
var createTreeNode = () => ({ docs: [], children: /* @__PURE__ */ new Map() });
|
|
9450
|
-
var toPosixPath2 = (value) => value.split(
|
|
9938
|
+
var toPosixPath2 = (value) => value.split(path35.sep).join(path35.posix.sep);
|
|
9451
9939
|
var toRoutePath = (relativeFile, pagesDir) => {
|
|
9452
9940
|
const relativeNoExt = relativeFile.replace(/\.mdx?$/, "");
|
|
9453
9941
|
const withoutPagesPrefix = relativeNoExt.replace(
|
|
@@ -9692,21 +10180,26 @@ export default config;
|
|
|
9692
10180
|
`;
|
|
9693
10181
|
};
|
|
9694
10182
|
var ensureApitogoDeployWorkflow = async (dir) => {
|
|
9695
|
-
const workflowPath =
|
|
10183
|
+
const workflowPath = path35.join(
|
|
10184
|
+
dir,
|
|
10185
|
+
".github",
|
|
10186
|
+
"workflows",
|
|
10187
|
+
"apitogo-deploy.yml"
|
|
10188
|
+
);
|
|
9696
10189
|
try {
|
|
9697
10190
|
await access4(workflowPath, constants3.F_OK);
|
|
9698
10191
|
return false;
|
|
9699
10192
|
} catch {
|
|
9700
10193
|
}
|
|
9701
|
-
await mkdir7(
|
|
10194
|
+
await mkdir7(path35.join(dir, ".github", "workflows"), { recursive: true });
|
|
9702
10195
|
await writeFile8(workflowPath, APITOGO_DEPLOY_WORKFLOW_YAML, "utf8");
|
|
9703
10196
|
return true;
|
|
9704
10197
|
};
|
|
9705
10198
|
var findExistingConfigPath = async (dir) => {
|
|
9706
10199
|
for (const filename of CONFIG_FILENAMES) {
|
|
9707
|
-
const fullPath =
|
|
10200
|
+
const fullPath = path35.join(dir, filename);
|
|
9708
10201
|
try {
|
|
9709
|
-
await
|
|
10202
|
+
await readFile7(fullPath, "utf8");
|
|
9710
10203
|
return fullPath;
|
|
9711
10204
|
} catch {
|
|
9712
10205
|
}
|
|
@@ -9714,7 +10207,7 @@ var findExistingConfigPath = async (dir) => {
|
|
|
9714
10207
|
return null;
|
|
9715
10208
|
};
|
|
9716
10209
|
async function makeConfig(argv) {
|
|
9717
|
-
const dir =
|
|
10210
|
+
const dir = path35.resolve(process.cwd(), argv.dir);
|
|
9718
10211
|
const pagesDir = toPosixPath2(
|
|
9719
10212
|
argv.pagesDir.replace(/^[./]+/, "").replace(/\/+$/, "")
|
|
9720
10213
|
);
|
|
@@ -9733,7 +10226,7 @@ async function makeConfig(argv) {
|
|
|
9733
10226
|
let configPath = await findExistingConfigPath(dir);
|
|
9734
10227
|
let createdNew = false;
|
|
9735
10228
|
if (!configPath) {
|
|
9736
|
-
configPath =
|
|
10229
|
+
configPath = path35.join(dir, DEFAULT_NEW_CONFIG_FILENAME);
|
|
9737
10230
|
await writeFile8(
|
|
9738
10231
|
configPath,
|
|
9739
10232
|
buildNewConfigContents(pagesDir, openApiSpecPath),
|
|
@@ -9753,7 +10246,7 @@ async function makeConfig(argv) {
|
|
|
9753
10246
|
if (routePaths.length === 0) {
|
|
9754
10247
|
throw new Error(`No .md or .mdx files found under '${pagesDir}'.`);
|
|
9755
10248
|
}
|
|
9756
|
-
let originalConfig = await
|
|
10249
|
+
let originalConfig = await readFile7(configPath, "utf8");
|
|
9757
10250
|
if (!createdNew && openApiSpecPath) {
|
|
9758
10251
|
originalConfig = insertApisIfMissing(
|
|
9759
10252
|
originalConfig,
|
|
@@ -9774,7 +10267,7 @@ async function makeConfig(argv) {
|
|
|
9774
10267
|
await writeFile8(configPath, withRedirects, "utf8");
|
|
9775
10268
|
const action = createdNew ? "Initialized" : "Updated";
|
|
9776
10269
|
printResultToConsole(
|
|
9777
|
-
`${action} ${
|
|
10270
|
+
`${action} ${path35.basename(configPath)} from ${pagesDir}/ (navigation and redirects; other top-level settings preserved unless newly scaffolded).`
|
|
9778
10271
|
);
|
|
9779
10272
|
const createdWorkflow = await ensureApitogoDeployWorkflow(dir);
|
|
9780
10273
|
if (createdWorkflow) {
|
|
@@ -9917,7 +10410,7 @@ var remove_default = {
|
|
|
9917
10410
|
|
|
9918
10411
|
// src/cli/common/outdated.ts
|
|
9919
10412
|
import { existsSync as existsSync2, mkdirSync } from "node:fs";
|
|
9920
|
-
import { readFile as
|
|
10413
|
+
import { readFile as readFile8, writeFile as writeFile9 } from "node:fs/promises";
|
|
9921
10414
|
import { join } from "node:path";
|
|
9922
10415
|
import colors10 from "picocolors";
|
|
9923
10416
|
import { gt } from "semver";
|
|
@@ -9967,12 +10460,12 @@ function box(message, {
|
|
|
9967
10460
|
|
|
9968
10461
|
// src/cli/common/xdg/lib.ts
|
|
9969
10462
|
import { homedir } from "node:os";
|
|
9970
|
-
import
|
|
10463
|
+
import path36 from "node:path";
|
|
9971
10464
|
function defineDirectoryWithFallback(xdgName, fallback) {
|
|
9972
10465
|
if (process.env[xdgName]) {
|
|
9973
10466
|
return process.env[xdgName];
|
|
9974
10467
|
} else {
|
|
9975
|
-
return
|
|
10468
|
+
return path36.join(homedir(), fallback);
|
|
9976
10469
|
}
|
|
9977
10470
|
}
|
|
9978
10471
|
var XDG_CONFIG_HOME = defineDirectoryWithFallback(
|
|
@@ -9987,15 +10480,15 @@ var XDG_STATE_HOME = defineDirectoryWithFallback(
|
|
|
9987
10480
|
"XDG_DATA_HOME",
|
|
9988
10481
|
".local/state"
|
|
9989
10482
|
);
|
|
9990
|
-
var ZUDOKU_XDG_CONFIG_HOME =
|
|
10483
|
+
var ZUDOKU_XDG_CONFIG_HOME = path36.join(
|
|
9991
10484
|
XDG_CONFIG_HOME,
|
|
9992
10485
|
CLI_XDG_FOLDER_NAME
|
|
9993
10486
|
);
|
|
9994
|
-
var ZUDOKU_XDG_DATA_HOME =
|
|
10487
|
+
var ZUDOKU_XDG_DATA_HOME = path36.join(
|
|
9995
10488
|
XDG_DATA_HOME,
|
|
9996
10489
|
CLI_XDG_FOLDER_NAME
|
|
9997
10490
|
);
|
|
9998
|
-
var ZUDOKU_XDG_STATE_HOME =
|
|
10491
|
+
var ZUDOKU_XDG_STATE_HOME = path36.join(
|
|
9999
10492
|
XDG_STATE_HOME,
|
|
10000
10493
|
CLI_XDG_FOLDER_NAME
|
|
10001
10494
|
);
|
|
@@ -10047,7 +10540,7 @@ async function getVersionCheckInfo() {
|
|
|
10047
10540
|
let versionCheckInfo;
|
|
10048
10541
|
if (existsSync2(versionCheckPath)) {
|
|
10049
10542
|
try {
|
|
10050
|
-
versionCheckInfo = await
|
|
10543
|
+
versionCheckInfo = await readFile8(versionCheckPath, "utf-8").then(
|
|
10051
10544
|
JSON.parse
|
|
10052
10545
|
);
|
|
10053
10546
|
} catch {
|