@lukoweb/apitogo 0.1.0 → 0.1.2

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.
Files changed (91) hide show
  1. package/dist/cli/cli.js +37 -147
  2. package/dist/declarations/lib/ui/Command.d.ts +1 -1
  3. package/dist/declarations/lib/util/MdxComponents.d.ts +1 -1
  4. package/package.json +1 -1
  5. package/src/app/main.tsx +150 -150
  6. package/src/config/loader.ts +245 -245
  7. package/src/index.ts +33 -33
  8. package/src/lib/authentication/components/CallbackHandler.tsx +45 -45
  9. package/src/lib/authentication/components/SignIn.tsx +46 -46
  10. package/src/lib/authentication/components/SignUp.tsx +48 -48
  11. package/src/lib/authentication/providers/clerk.tsx +224 -224
  12. package/src/lib/authentication/ui/AuthCard.tsx +7 -7
  13. package/src/lib/authentication/ui/EmailLinkCallbackUi.tsx +129 -125
  14. package/src/lib/authentication/ui/EmailLinkSentUi.tsx +105 -101
  15. package/src/lib/authentication/ui/EmailLinkSignInUi.tsx +100 -96
  16. package/src/lib/authentication/ui/EmailVerificationUi.tsx +128 -124
  17. package/src/lib/authentication/ui/ZudokuAuthUi.tsx +620 -616
  18. package/src/lib/components/AiAssistantMenuItems.tsx +102 -102
  19. package/src/lib/components/Autocomplete.tsx +123 -123
  20. package/src/lib/components/DeveloperHint.tsx +39 -35
  21. package/src/lib/components/Header.tsx +260 -260
  22. package/src/lib/components/Layout.tsx +53 -53
  23. package/src/lib/components/Main.tsx +51 -51
  24. package/src/lib/components/Mermaid.tsx +74 -70
  25. package/src/lib/components/MobileTopNavigation.tsx +276 -276
  26. package/src/lib/components/MultiSelect.tsx +86 -82
  27. package/src/lib/components/TopNavigation.tsx +103 -103
  28. package/src/lib/components/index.ts +26 -26
  29. package/src/lib/components/navigation/NavigationCategory.tsx +157 -157
  30. package/src/lib/components/navigation/NavigationFilterInput.tsx +35 -35
  31. package/src/lib/components/navigation/NavigationItem.tsx +181 -177
  32. package/src/lib/core/RouteGuard.tsx +193 -193
  33. package/src/lib/errors/ErrorMessage.tsx +50 -46
  34. package/src/lib/plugins/api-catalog/Catalog.tsx +80 -80
  35. package/src/lib/plugins/api-keys/CreateApiKey.tsx +128 -124
  36. package/src/lib/plugins/api-keys/CreateApiKeyDialog.tsx +49 -49
  37. package/src/lib/plugins/api-keys/SettingsApiKeys.tsx +72 -72
  38. package/src/lib/plugins/api-keys/settings/ApiKeyItem.tsx +342 -342
  39. package/src/lib/plugins/api-keys/settings/RevealApiKey.tsx +127 -127
  40. package/src/lib/plugins/markdown/MdxPage.tsx +285 -285
  41. package/src/lib/plugins/openapi/ApiHeader.tsx +96 -96
  42. package/src/lib/plugins/openapi/CollapsibleCode.tsx +88 -88
  43. package/src/lib/plugins/openapi/DownloadSchemaButton.tsx +94 -94
  44. package/src/lib/plugins/openapi/GeneratedExampleSidecarBox.tsx +52 -52
  45. package/src/lib/plugins/openapi/OperationListItem.tsx +183 -183
  46. package/src/lib/plugins/openapi/RequestBodySidecarBox.tsx +63 -63
  47. package/src/lib/plugins/openapi/ResponsesSidecarBox.tsx +120 -117
  48. package/src/lib/plugins/openapi/SchemaInfo.tsx +344 -344
  49. package/src/lib/plugins/openapi/SchemaList.tsx +113 -113
  50. package/src/lib/plugins/openapi/Sidecar.tsx +312 -309
  51. package/src/lib/plugins/openapi/SidecarExamples.tsx +177 -174
  52. package/src/lib/plugins/openapi/components/EnumValues.tsx +58 -58
  53. package/src/lib/plugins/openapi/components/ResponseContent.tsx +117 -114
  54. package/src/lib/plugins/openapi/playground/BodyPanel.tsx +274 -271
  55. package/src/lib/plugins/openapi/playground/CollapsibleHeader.tsx +51 -51
  56. package/src/lib/plugins/openapi/playground/ExamplesDropdown.tsx +60 -60
  57. package/src/lib/plugins/openapi/playground/Headers.tsx +188 -181
  58. package/src/lib/plugins/openapi/playground/IdentityDialog.tsx +75 -75
  59. package/src/lib/plugins/openapi/playground/IdentitySelector.tsx +38 -38
  60. package/src/lib/plugins/openapi/playground/ParamsGrid.tsx +45 -45
  61. package/src/lib/plugins/openapi/playground/Playground.tsx +602 -599
  62. package/src/lib/plugins/openapi/playground/PlaygroundDialog.tsx +56 -56
  63. package/src/lib/plugins/openapi/playground/QueryParams.tsx +151 -148
  64. package/src/lib/plugins/openapi/playground/RequestLoginDialog.tsx +70 -70
  65. package/src/lib/plugins/openapi/playground/request-panel/MultipartField.tsx +91 -91
  66. package/src/lib/plugins/openapi/playground/result-panel/AudioPlayer.tsx +50 -50
  67. package/src/lib/plugins/openapi/playground/result-panel/ResponseTab.tsx +355 -355
  68. package/src/lib/plugins/openapi/playground/result-panel/ResultPanel.tsx +106 -102
  69. package/src/lib/plugins/openapi/schema/SchemaPropertyItem.tsx +189 -184
  70. package/src/lib/plugins/openapi/schema/SchemaView.tsx +299 -299
  71. package/src/lib/plugins/search-pagefind/IndexingDialog.tsx +162 -162
  72. package/src/lib/plugins/search-pagefind/PagefindSearch.tsx +202 -202
  73. package/src/lib/plugins/search-pagefind/ResultList.tsx +122 -118
  74. package/src/lib/ui/ActionButton.tsx +21 -21
  75. package/src/lib/ui/Command.tsx +191 -191
  76. package/src/lib/util/MdxComponents.tsx +150 -150
  77. package/src/vite/config.ts +234 -231
  78. package/src/vite/dev-server.ts +291 -291
  79. package/src/vite/plugin-api-keys.ts +50 -50
  80. package/src/vite/plugin-api.ts +320 -318
  81. package/src/vite/plugin-auth.ts +38 -38
  82. package/src/vite/plugin-component.ts +45 -39
  83. package/src/vite/plugin-config.ts +75 -75
  84. package/src/vite/plugin-custom-pages.ts +36 -36
  85. package/src/vite/plugin-docs.ts +202 -202
  86. package/src/vite/plugin-markdown-export.ts +214 -214
  87. package/src/vite/plugin-mdx.ts +149 -149
  88. package/src/vite/plugin-navigation.ts +106 -106
  89. package/src/vite/plugin-search.ts +47 -47
  90. package/src/vite/plugin.ts +42 -42
  91. package/src/vite/prerender/prerender.ts +233 -233
package/dist/cli/cli.js CHANGED
@@ -20,8 +20,8 @@ var init_package_json = __esm({
20
20
  path.posix.sep
21
21
  );
22
22
  getPackageJson = (pkgPath) => JSON.parse(readFileSync(pkgPath, "utf-8"));
23
- getZudokuPackageJson = () => getPackageJson(getPackageJsonPath("apitogo"));
24
- getZudokuRootDir = () => path.dirname(getPackageJsonPath("apitogo"));
23
+ getZudokuPackageJson = () => getPackageJson(getPackageJsonPath("@lukoweb/apitogo"));
24
+ getZudokuRootDir = () => path.dirname(getPackageJsonPath("@lukoweb/apitogo"));
25
25
  }
26
26
  });
27
27
 
@@ -3815,8 +3815,8 @@ import {
3815
3815
 
3816
3816
  // package.json
3817
3817
  var package_default = {
3818
- name: "apitogo",
3819
- version: "0.1.0",
3818
+ name: "@lukoweb/apitogo",
3819
+ version: "0.1.2",
3820
3820
  type: "module",
3821
3821
  sideEffects: [
3822
3822
  "**/*.css",
@@ -4066,127 +4066,6 @@ var package_default = {
4066
4066
  mermaid: {
4067
4067
  optional: true
4068
4068
  }
4069
- },
4070
- publishConfig: {
4071
- exports: {
4072
- ".": {
4073
- types: "./dist/declarations/index.d.ts",
4074
- default: "./src/index.ts"
4075
- },
4076
- "./package.json": "./package.json",
4077
- "./ui/*": {
4078
- types: "./dist/declarations/lib/ui/*.d.ts",
4079
- default: "./src/lib/ui/*.tsx"
4080
- },
4081
- "./ui/*.js": {
4082
- types: "./dist/declarations/lib/ui/*.d.ts",
4083
- default: "./src/lib/ui/*.tsx"
4084
- },
4085
- "./client": {
4086
- types: "./client.d.ts"
4087
- },
4088
- "./auth/clerk": {
4089
- types: "./dist/declarations/lib/authentication/providers/clerk.d.ts",
4090
- default: "./src/lib/authentication/providers/clerk.tsx"
4091
- },
4092
- "./auth/auth0": {
4093
- types: "./dist/declarations/lib/authentication/providers/auth0.d.ts",
4094
- default: "./src/lib/authentication/providers/auth0.tsx"
4095
- },
4096
- "./auth/openid": {
4097
- types: "./dist/declarations/lib/authentication/providers/openid.d.ts",
4098
- default: "./src/lib/authentication/providers/openid.tsx"
4099
- },
4100
- "./auth/supabase": {
4101
- types: "./dist/declarations/lib/authentication/providers/supabase.d.ts",
4102
- default: "./src/lib/authentication/providers/supabase.tsx"
4103
- },
4104
- "./auth/azureb2c": {
4105
- types: "./dist/declarations/lib/authentication/providers/azureb2c.d.ts",
4106
- default: "./src/lib/authentication/providers/azureb2c.tsx"
4107
- },
4108
- "./auth/firebase": {
4109
- types: "./dist/declarations/lib/authentication/providers/firebase.d.ts",
4110
- default: "./src/lib/authentication/providers/firebase.tsx"
4111
- },
4112
- "./plugins": {
4113
- types: "./dist/declarations/lib/core/plugins.d.ts",
4114
- default: "./src/lib/core/plugins.ts"
4115
- },
4116
- "./plugins/api-keys": {
4117
- types: "./dist/declarations/lib/plugins/api-keys/index.d.ts",
4118
- default: "./src/lib/plugins/api-keys/index.tsx"
4119
- },
4120
- "./plugins/markdown": {
4121
- types: "./dist/declarations/lib/plugins/markdown/index.d.ts",
4122
- default: "./src/lib/plugins/markdown/index.tsx"
4123
- },
4124
- "./plugins/openapi": {
4125
- types: "./dist/declarations/lib/plugins/openapi/index.d.ts",
4126
- default: "./src/lib/plugins/openapi/index.tsx"
4127
- },
4128
- "./plugins/custom-pages": {
4129
- types: "./dist/declarations/lib/plugins/custom-pages/index.d.ts",
4130
- default: "./src/lib/plugins/custom-pages/index.tsx"
4131
- },
4132
- "./plugins/search-inkeep": {
4133
- types: "./dist/declarations/lib/plugins/search-inkeep/index.d.ts",
4134
- default: "./src/lib/plugins/search-inkeep/index.tsx"
4135
- },
4136
- "./plugins/search-pagefind": {
4137
- types: "./dist/declarations/lib/plugins/search-pagefind/index.d.ts",
4138
- default: "./src/lib/plugins/search-pagefind/index.tsx"
4139
- },
4140
- "./plugins/api-catalog": {
4141
- types: "./dist/declarations/lib/plugins/api-catalog/index.d.ts",
4142
- default: "./src/lib/plugins/api-catalog/index.tsx"
4143
- },
4144
- "./components": {
4145
- types: "./dist/declarations/lib/components/index.d.ts",
4146
- default: "./src/lib/components/index.ts"
4147
- },
4148
- "./mermaid": {
4149
- types: "./dist/declarations/lib/components/Mermaid.d.ts",
4150
- default: "./src/lib/components/Mermaid.tsx"
4151
- },
4152
- "./router": {
4153
- types: "./dist/declarations/lib/core/router.d.ts",
4154
- default: "./src/lib/core/router.ts"
4155
- },
4156
- "./react-query": {
4157
- types: "./dist/declarations/lib/core/react-query.d.ts",
4158
- default: "./src/lib/core/react-query.ts"
4159
- },
4160
- "./icons": {
4161
- types: "./dist/declarations/lib/icons.d.ts",
4162
- default: "./src/lib/icons.ts"
4163
- },
4164
- "./vite": {
4165
- types: "./dist/declarations/vite/index.d.ts",
4166
- default: "./src/vite/index.ts"
4167
- },
4168
- "./app/*": {
4169
- types: "./dist/declarations/app/*.d.ts",
4170
- default: "./src/app/*"
4171
- },
4172
- "./hooks": {
4173
- types: "./dist/declarations/lib/hooks/index.d.ts",
4174
- default: "./src/lib/hooks/index.ts"
4175
- },
4176
- "./main.css": "./src/app/main.css",
4177
- "./processors/*": {
4178
- types: "./dist/declarations/lib/plugins/openapi/processors/*.d.ts",
4179
- default: "./src/lib/plugins/openapi/processors/*.ts"
4180
- },
4181
- "./with-zuplo": {
4182
- types: "./dist/declarations/zuplo/with-zuplo.d.ts",
4183
- default: "./src/zuplo/with-zuplo.ts"
4184
- },
4185
- "./testing": {
4186
- types: "./dist/declarations/lib/testing/index.d.ts",
4187
- default: "./src/lib/testing/index.tsx"
4188
- }
4189
- }
4190
4069
  }
4191
4070
  };
4192
4071
 
@@ -4366,7 +4245,7 @@ var viteApiKeysPlugin = () => {
4366
4245
  const deploymentName = ZuploEnv.buildConfig?.deploymentName || getZuploSystemConfigurations(process.env.ZUPLO_SYSTEM_CONFIGURATIONS)?.__ZUPLO_DEPLOYMENT_NAME;
4367
4246
  const code = [
4368
4247
  `import config from "virtual:zudoku-config";`,
4369
- config2.__meta.mode === "internal" ? `import { apiKeyPlugin } from "${config2.__meta.moduleDir}/src/lib/plugins/api-keys/index.tsx";` : `import { apiKeyPlugin } from "apitogo/plugins/api-keys";`,
4248
+ 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";`,
4370
4249
  `export const configuredApiKeysPlugin = apiKeyPlugin({
4371
4250
  ...config.apiKeys,
4372
4251
  isZuplo: ${ZuploEnv.isZuplo},
@@ -6070,7 +5949,7 @@ export const rules = ${rulesCode};`,
6070
5949
  if (hasMissingIcon) {
6071
5950
  collectedIcons.add("MissingIcon");
6072
5951
  }
6073
- const importStatement = collectedIcons.size > 0 ? `import { ${[...collectedIcons].join(", ")} } from "apitogo/icons";
5952
+ const importStatement = collectedIcons.size > 0 ? `import { ${[...collectedIcons].join(", ")} } from "@lukoweb/apitogo/icons";
6074
5953
  ` : "";
6075
5954
  return [
6076
5955
  importStatement,
@@ -6195,7 +6074,9 @@ var viteApiPlugin = async () => {
6195
6074
  `const configuredApiCatalogPlugins = [];`
6196
6075
  ];
6197
6076
  if (config2.apis) {
6198
- code.push('import { openApiPlugin } from "apitogo/plugins/openapi";');
6077
+ code.push(
6078
+ 'import { openApiPlugin } from "@lukoweb/apitogo/plugins/openapi";'
6079
+ );
6199
6080
  code.push(
6200
6081
  `const apis = Array.isArray(config.apis) ? config.apis : [config.apis]`
6201
6082
  );
@@ -6287,7 +6168,7 @@ var viteApiPlugin = async () => {
6287
6168
  }
6288
6169
  if (config2.catalogs) {
6289
6170
  code.push(
6290
- 'import { apiCatalogPlugin } from "apitogo/plugins/api-catalog";'
6171
+ 'import { apiCatalogPlugin } from "@lukoweb/apitogo/plugins/api-catalog";'
6291
6172
  );
6292
6173
  const catalogs = ensureArray(config2.catalogs);
6293
6174
  const categories = apis.flatMap((api) => api.categories ?? []).reduce((acc, catalog) => {
@@ -6373,7 +6254,7 @@ var viteAuthPlugin = () => {
6373
6254
  ...${JSON.stringify(config2.authentication, null, 2)},
6374
6255
  basePath: ${config2.basePath ? JSON.stringify(config2.basePath) : "undefined"},
6375
6256
  };`,
6376
- config2.__meta.mode === "internal" ? `import authProvider from "${config2.__meta.moduleDir}/src/lib/authentication/providers/${config2.authentication.type}.tsx";` : `import authProvider from "apitogo/auth/${config2.authentication.type}";`,
6257
+ config2.__meta.mode === "internal" ? `import authProvider from "${config2.__meta.moduleDir}/src/lib/authentication/providers/${config2.authentication.type}.tsx";` : `import authProvider from "@lukoweb/apitogo/auth/${config2.authentication.type}";`,
6377
6258
  `export const configuredAuthProvider = authProvider(config);`
6378
6259
  ].join("\n");
6379
6260
  }
@@ -6391,18 +6272,24 @@ var viteAliasPlugin = () => {
6391
6272
  config: () => {
6392
6273
  const config2 = getCurrentConfig();
6393
6274
  const replacements = [
6394
- ["apitogo/components", "src/lib/components/index.ts"],
6395
- ["apitogo/plugins/openapi", "src/lib/plugins/openapi/index.tsx"],
6396
- ["apitogo/plugins/api-catalog", "src/lib/plugins/api-catalog/index.tsx"],
6275
+ ["@lukoweb/apitogo/components", "src/lib/components/index.ts"],
6276
+ [
6277
+ "@lukoweb/apitogo/plugins/openapi",
6278
+ "src/lib/plugins/openapi/index.tsx"
6279
+ ],
6280
+ [
6281
+ "@lukoweb/apitogo/plugins/api-catalog",
6282
+ "src/lib/plugins/api-catalog/index.tsx"
6283
+ ],
6397
6284
  [
6398
- "apitogo/plugins/search-inkeep",
6285
+ "@lukoweb/apitogo/plugins/search-inkeep",
6399
6286
  "src/lib/plugins/search-inkeep/index.tsx"
6400
6287
  ],
6401
6288
  [
6402
- "apitogo/plugins/search-pagefind",
6289
+ "@lukoweb/apitogo/plugins/search-pagefind",
6403
6290
  "src/lib/plugins/search-pagefind/index.tsx"
6404
6291
  ],
6405
- [/^apitogo\/ui\/(.*)\.js/, "src/lib/ui/$1.tsx"]
6292
+ [/^@lukoweb\/apitogo\/ui\/(.*)\.js/, "src/lib/ui/$1.tsx"]
6406
6293
  ];
6407
6294
  const aliases = replacements.map(([find, replacement]) => ({
6408
6295
  find,
@@ -6438,7 +6325,7 @@ var viteConfigPlugin = () => {
6438
6325
  }
6439
6326
  return `
6440
6327
  import rawConfig from "${normalizePath(configPath)}";
6441
- import { runPluginTransformConfig } from "apitogo/plugins";
6328
+ import { runPluginTransformConfig } from "@lukoweb/apitogo/plugins";
6442
6329
 
6443
6330
  const config = await runPluginTransformConfig(rawConfig);
6444
6331
  export default config;
@@ -6494,7 +6381,7 @@ var viteCustomPagesPlugin = () => {
6494
6381
  }
6495
6382
  const code = [
6496
6383
  `import config from "virtual:zudoku-config";`,
6497
- config2.__meta.mode === "internal" ? `import { customPagesPlugin } from "${config2.__meta.moduleDir}/src/lib/plugins/custom-pages/index.tsx";` : `import { customPagesPlugin } from "apitogo/plugins/custom-pages";`,
6384
+ config2.__meta.mode === "internal" ? `import { customPagesPlugin } from "${config2.__meta.moduleDir}/src/lib/plugins/custom-pages/index.tsx";` : `import { customPagesPlugin } from "@lukoweb/apitogo/plugins/custom-pages";`,
6498
6385
  `export const configuredCustomPagesPlugin = customPagesPlugin(config.navigation);`
6499
6386
  ];
6500
6387
  return code.join("\n");
@@ -6680,7 +6567,7 @@ var viteDocsPlugin = () => {
6680
6567
  const code = [
6681
6568
  // IMPORTANT! This path here is important, we MUST resolve
6682
6569
  // files here as Typescript from the appDir
6683
- config2.__meta.mode === "internal" ? `import { markdownPlugin } from "${config2.__meta.moduleDir}/src/lib/plugins/markdown/index.tsx";` : `import { markdownPlugin } from "apitogo/plugins/markdown";`
6570
+ config2.__meta.mode === "internal" ? `import { markdownPlugin } from "${config2.__meta.moduleDir}/src/lib/plugins/markdown/index.tsx";` : `import { markdownPlugin } from "@lukoweb/apitogo/plugins/markdown";`
6684
6571
  ];
6685
6572
  const docsConfig = DocsConfigSchema.parse(config2.docs ?? {});
6686
6573
  const globImportBasePath = process.env.NODE_ENV === "development" ? config2.basePath ?? "" : "";
@@ -7295,7 +7182,7 @@ var viteMdxPlugin = async () => {
7295
7182
  return {
7296
7183
  enforce: "pre",
7297
7184
  ...mdx({
7298
- providerImportSource: config2.__meta.mode === "internal" || config2.__meta.mode === "standalone" ? "@mdx-js/react" : "apitogo/components",
7185
+ providerImportSource: config2.__meta.mode === "internal" || config2.__meta.mode === "standalone" ? "@mdx-js/react" : "@lukoweb/apitogo/components",
7299
7186
  mdxExtensions: [".mdx"],
7300
7187
  format: "detect",
7301
7188
  remarkPlugins,
@@ -7328,7 +7215,7 @@ var viteSearchPlugin = () => {
7328
7215
  if (config2.search.type === "inkeep") {
7329
7216
  code.push(
7330
7217
  `import config from 'virtual:zudoku-config';`,
7331
- `import { inkeepSearchPlugin } from "apitogo/plugins/search-inkeep";`,
7218
+ `import { inkeepSearchPlugin } from "@lukoweb/apitogo/plugins/search-inkeep";`,
7332
7219
  `export const configuredSearchPlugin = inkeepSearchPlugin(config.search);`
7333
7220
  );
7334
7221
  return code.join("\n");
@@ -7336,7 +7223,7 @@ var viteSearchPlugin = () => {
7336
7223
  if (config2.search.type === "pagefind") {
7337
7224
  code.push(
7338
7225
  `import config from 'virtual:zudoku-config';`,
7339
- `import { pagefindSearchPlugin } from "apitogo/plugins/search-pagefind";`,
7226
+ `import { pagefindSearchPlugin } from "@lukoweb/apitogo/plugins/search-pagefind";`,
7340
7227
  `export const configuredSearchPlugin = pagefindSearchPlugin(config.search);`
7341
7228
  );
7342
7229
  return code.join("\n");
@@ -7445,7 +7332,7 @@ function vitePlugin() {
7445
7332
  viteSearchPlugin(),
7446
7333
  plugin_component_default(),
7447
7334
  plugin_markdown_export_default(),
7448
- vitePluginSsrCss({ entries: ["apitogo/app/entry.server.tsx"] }),
7335
+ vitePluginSsrCss({ entries: ["@lukoweb/apitogo/app/entry.server.tsx"] }),
7449
7336
  viteThemePlugin(),
7450
7337
  tailwindcss()
7451
7338
  ];
@@ -7550,7 +7437,10 @@ async function getViteConfig(dir, configEnv) {
7550
7437
  ),
7551
7438
  emptyOutDir: true,
7552
7439
  rollupOptions: {
7553
- input: configEnv.command === "build" ? configEnv.isSsrBuild ? ["apitogo/app/entry.server.tsx", config2.__meta.configPath] : "apitogo/app/entry.client.tsx" : void 0,
7440
+ input: configEnv.command === "build" ? configEnv.isSsrBuild ? [
7441
+ "@lukoweb/apitogo/app/entry.server.tsx",
7442
+ config2.__meta.configPath
7443
+ ] : "@lukoweb/apitogo/app/entry.client.tsx" : void 0,
7554
7444
  external: [joinUrl(config2.basePath, "/pagefind/pagefind.js")]
7555
7445
  },
7556
7446
  chunkSizeWarningLimit: 1500
@@ -7571,10 +7461,10 @@ async function getViteConfig(dir, configEnv) {
7571
7461
  target: "es2022"
7572
7462
  },
7573
7463
  entries: [path17.posix.join(getZudokuRootDir(), "src/{app,lib}/**")],
7574
- exclude: ["apitogo"],
7464
+ exclude: ["@lukoweb/apitogo"],
7575
7465
  include: [
7576
7466
  "react-dom/client",
7577
- "apitogo/icons",
7467
+ "@lukoweb/apitogo/icons",
7578
7468
  ...process.env.SENTRY_DSN ? ["@sentry/react"] : []
7579
7469
  ]
7580
7470
  },
@@ -8733,7 +8623,7 @@ async function dev(argv) {
8733
8623
  printDiagnosticsToConsole("Ctrl+C to exit");
8734
8624
  printDiagnosticsToConsole("");
8735
8625
  printDiagnosticsToConsole(
8736
- `\u{1F680} Running Zudoku v${packageJson2.version}: ${url}`
8626
+ `\u{1F680} Running APIToGo v${packageJson2.version}: ${url}`
8737
8627
  );
8738
8628
  printDiagnosticsToConsole("");
8739
8629
  let hasExited = false;
@@ -1,8 +1,8 @@
1
+ import { DialogContent } from "@lukoweb/apitogo/ui/Dialog.js";
1
2
  import type { DialogProps } from "@radix-ui/react-dialog";
2
3
  import { Command as CommandPrimitive } from "cmdk";
3
4
  import type { ComponentPropsWithoutRef } from "react";
4
5
  import * as React from "react";
5
- import { DialogContent } from "@lukoweb/apitogo/ui/Dialog.js";
6
6
  declare const Command: React.ForwardRefExoticComponent<Omit<{
7
7
  children?: React.ReactNode;
8
8
  } & Pick<Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "key" | keyof React.HTMLAttributes<HTMLDivElement>> & {
@@ -1,5 +1,5 @@
1
- import type { MDXComponents } from "mdx/types.js";
2
1
  import { Alert } from "@lukoweb/apitogo/ui/Alert.js";
2
+ import type { MDXComponents } from "mdx/types.js";
3
3
  import { Badge } from "../ui/Badge.js";
4
4
  export type MdxComponentsType = Readonly<MDXComponents> | null | undefined;
5
5
  export declare const MdxComponents: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lukoweb/apitogo",
3
- "version": "0.1.0",
3
+ "version": "0.1.2",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "**/*.css",
package/src/app/main.tsx CHANGED
@@ -1,150 +1,150 @@
1
- import type { RouteObject } from "react-router";
2
- import type { HighlighterCore } from "shiki";
3
- import { configuredApiKeysPlugin } from "virtual:zudoku-api-keys-plugin";
4
- import {
5
- configuredApiCatalogPlugins,
6
- configuredApiPlugins,
7
- } from "virtual:zudoku-api-plugins";
8
- import { configuredAuthProvider } from "virtual:zudoku-auth";
9
- import { configuredCustomPagesPlugin } from "virtual:zudoku-custom-pages-plugin";
10
- import { configuredDocsPlugin } from "virtual:zudoku-docs-plugin";
11
- import {
12
- configuredHeaderNavigation,
13
- configuredNavigation,
14
- configuredNavigationRules,
15
- } from "virtual:zudoku-navigation";
16
- import { configuredSearchPlugin } from "virtual:zudoku-search-plugin";
17
- import "virtual:zudoku-theme.css";
18
- import { Zudoku } from "@lukoweb/apitogo/components";
19
- import { Outlet } from "@lukoweb/apitogo/router";
20
- import type { ZudokuConfig } from "../config/config.js";
21
- import { BuildCheck } from "../lib/components/BuildCheck.js";
22
- import "./main.css";
23
- import { Meta } from "../lib/components/Meta.js";
24
- import "./polyfills.js";
25
- import { StatusPage } from "../lib/components/StatusPage.js";
26
- import { isNavigationPlugin } from "../lib/core/plugins.js";
27
- import { RouteGuard } from "../lib/core/RouteGuard.js";
28
- import type { ZudokuContextOptions } from "../lib/core/ZudokuContext.js";
29
- import { RouterError } from "../lib/errors/RouterError.js";
30
- import { ZuploEnv } from "./env.js";
31
- import { processRoutes } from "./processRoutes.js";
32
- import { createRedirectRoutes } from "./utils/createRedirectRoutes.js";
33
-
34
- export const shikiReady: Promise<HighlighterCore> =
35
- import("../lib/shiki.js").then(async ({ highlighterPromise }) => {
36
- const highlighter = await highlighterPromise;
37
- const { registerShiki } = await import("virtual:zudoku-shiki-register");
38
- await registerShiki(highlighter);
39
- return highlighter;
40
- });
41
-
42
- export const convertZudokuConfigToOptions = (
43
- config: ZudokuConfig,
44
- ): ZudokuContextOptions => {
45
- return {
46
- basePath: config.basePath,
47
- canonicalUrlOrigin: config.canonicalUrlOrigin,
48
- aiAssistants: config.aiAssistants,
49
- protectedRoutes: config.protectedRoutes,
50
- site: {
51
- ...config.site,
52
- showPoweredBy:
53
- ZuploEnv.buildConfig?.entitlements.devPortalZuploBranding ??
54
- config.site?.showPoweredBy,
55
- logo: config.site?.logo,
56
- },
57
- slots: config.slots,
58
- metadata: {
59
- favicon: "https://cdn.zudoku.dev/logos/favicon.svg",
60
- title: "%s - Zudoku",
61
- ...config.metadata,
62
- },
63
- header: {
64
- navigation: configuredHeaderNavigation,
65
- placements: config.header?.placements,
66
- },
67
- navigation: configuredNavigation,
68
- navigationRules: configuredNavigationRules,
69
- mdx: config.mdx,
70
- plugins: [
71
- ...(configuredAuthProvider ? [configuredAuthProvider] : []),
72
- ...(configuredDocsPlugin ? [configuredDocsPlugin] : []),
73
- ...configuredApiPlugins,
74
- ...(configuredSearchPlugin ? [configuredSearchPlugin] : []),
75
- ...(configuredApiKeysPlugin ? [configuredApiKeysPlugin] : []),
76
- ...(configuredCustomPagesPlugin ? [configuredCustomPagesPlugin] : []),
77
- ...configuredApiCatalogPlugins,
78
- ...(config.plugins ?? []),
79
- ],
80
- syntaxHighlighting: {
81
- highlighterPromise: shikiReady,
82
- themes: config.syntaxHighlighting?.themes,
83
- },
84
- };
85
- };
86
-
87
- export const getRoutesByOptions = (
88
- options: ZudokuContextOptions,
89
- enableStatusPages = true,
90
- ) => {
91
- const allPlugins = [
92
- ...(options.plugins ?? []),
93
- ...(options.authentication ? [options.authentication] : []),
94
- ];
95
-
96
- const routes = allPlugins
97
- .flatMap((plugin) => (isNavigationPlugin(plugin) ? plugin.getRoutes() : []))
98
- .concat(
99
- enableStatusPages
100
- ? [400, 404, 500].map((statusCode) => ({
101
- path: `/${statusCode}`,
102
- element: <StatusPage statusCode={statusCode} />,
103
- }))
104
- : [],
105
- )
106
- .concat([{ path: "*", element: <StatusPage statusCode={404} /> }])
107
- .map((route) => ({
108
- ...route,
109
- errorElement: <RouterError className="w-full m-0" />,
110
- }));
111
-
112
- // @TODO Detect conflicts in routes and log warning
113
-
114
- return routes;
115
- };
116
-
117
- export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
118
- const options = convertZudokuConfigToOptions(config);
119
- const routes = getRoutesByOptions(
120
- options,
121
- import.meta.env.IS_ZUPLO || config.enableStatusPages,
122
- );
123
-
124
- return [
125
- ...createRedirectRoutes(config.redirects),
126
- {
127
- element: (
128
- <Zudoku {...options} env={import.meta.env}>
129
- <BuildCheck
130
- buildId={import.meta.env.ZUPLO_BUILD_ID}
131
- environmentType={import.meta.env.ZUPLO_ENVIRONMENT_TYPE}
132
- />
133
- <Outlet />
134
- </Zudoku>
135
- ),
136
- hydrateFallbackElement: <div>Loading...</div>,
137
- children: [
138
- {
139
- element: (
140
- <Meta>
141
- <RouteGuard />
142
- </Meta>
143
- ),
144
- errorElement: <RouterError />,
145
- children: processRoutes(routes),
146
- },
147
- ],
148
- },
149
- ];
150
- };
1
+ import { Zudoku } from "@lukoweb/apitogo/components";
2
+ import { Outlet } from "@lukoweb/apitogo/router";
3
+ import type { RouteObject } from "react-router";
4
+ import type { HighlighterCore } from "shiki";
5
+ import { configuredApiKeysPlugin } from "virtual:zudoku-api-keys-plugin";
6
+ import {
7
+ configuredApiCatalogPlugins,
8
+ configuredApiPlugins,
9
+ } from "virtual:zudoku-api-plugins";
10
+ import { configuredAuthProvider } from "virtual:zudoku-auth";
11
+ import { configuredCustomPagesPlugin } from "virtual:zudoku-custom-pages-plugin";
12
+ import { configuredDocsPlugin } from "virtual:zudoku-docs-plugin";
13
+ import "virtual:zudoku-theme.css";
14
+ import {
15
+ configuredHeaderNavigation,
16
+ configuredNavigation,
17
+ configuredNavigationRules,
18
+ } from "virtual:zudoku-navigation";
19
+ import { configuredSearchPlugin } from "virtual:zudoku-search-plugin";
20
+ import type { ZudokuConfig } from "../config/config.js";
21
+ import { BuildCheck } from "../lib/components/BuildCheck.js";
22
+ import "./main.css";
23
+ import { Meta } from "../lib/components/Meta.js";
24
+ import "./polyfills.js";
25
+ import { StatusPage } from "../lib/components/StatusPage.js";
26
+ import { isNavigationPlugin } from "../lib/core/plugins.js";
27
+ import { RouteGuard } from "../lib/core/RouteGuard.js";
28
+ import type { ZudokuContextOptions } from "../lib/core/ZudokuContext.js";
29
+ import { RouterError } from "../lib/errors/RouterError.js";
30
+ import { ZuploEnv } from "./env.js";
31
+ import { processRoutes } from "./processRoutes.js";
32
+ import { createRedirectRoutes } from "./utils/createRedirectRoutes.js";
33
+
34
+ export const shikiReady: Promise<HighlighterCore> =
35
+ import("../lib/shiki.js").then(async ({ highlighterPromise }) => {
36
+ const highlighter = await highlighterPromise;
37
+ const { registerShiki } = await import("virtual:zudoku-shiki-register");
38
+ await registerShiki(highlighter);
39
+ return highlighter;
40
+ });
41
+
42
+ export const convertZudokuConfigToOptions = (
43
+ config: ZudokuConfig,
44
+ ): ZudokuContextOptions => {
45
+ return {
46
+ basePath: config.basePath,
47
+ canonicalUrlOrigin: config.canonicalUrlOrigin,
48
+ aiAssistants: config.aiAssistants,
49
+ protectedRoutes: config.protectedRoutes,
50
+ site: {
51
+ ...config.site,
52
+ showPoweredBy:
53
+ ZuploEnv.buildConfig?.entitlements.devPortalZuploBranding ??
54
+ config.site?.showPoweredBy,
55
+ logo: config.site?.logo,
56
+ },
57
+ slots: config.slots,
58
+ metadata: {
59
+ favicon: "https://cdn.zudoku.dev/logos/favicon.svg",
60
+ title: "%s - Zudoku",
61
+ ...config.metadata,
62
+ },
63
+ header: {
64
+ navigation: configuredHeaderNavigation,
65
+ placements: config.header?.placements,
66
+ },
67
+ navigation: configuredNavigation,
68
+ navigationRules: configuredNavigationRules,
69
+ mdx: config.mdx,
70
+ plugins: [
71
+ ...(configuredAuthProvider ? [configuredAuthProvider] : []),
72
+ ...(configuredDocsPlugin ? [configuredDocsPlugin] : []),
73
+ ...configuredApiPlugins,
74
+ ...(configuredSearchPlugin ? [configuredSearchPlugin] : []),
75
+ ...(configuredApiKeysPlugin ? [configuredApiKeysPlugin] : []),
76
+ ...(configuredCustomPagesPlugin ? [configuredCustomPagesPlugin] : []),
77
+ ...configuredApiCatalogPlugins,
78
+ ...(config.plugins ?? []),
79
+ ],
80
+ syntaxHighlighting: {
81
+ highlighterPromise: shikiReady,
82
+ themes: config.syntaxHighlighting?.themes,
83
+ },
84
+ };
85
+ };
86
+
87
+ export const getRoutesByOptions = (
88
+ options: ZudokuContextOptions,
89
+ enableStatusPages = true,
90
+ ) => {
91
+ const allPlugins = [
92
+ ...(options.plugins ?? []),
93
+ ...(options.authentication ? [options.authentication] : []),
94
+ ];
95
+
96
+ const routes = allPlugins
97
+ .flatMap((plugin) => (isNavigationPlugin(plugin) ? plugin.getRoutes() : []))
98
+ .concat(
99
+ enableStatusPages
100
+ ? [400, 404, 500].map((statusCode) => ({
101
+ path: `/${statusCode}`,
102
+ element: <StatusPage statusCode={statusCode} />,
103
+ }))
104
+ : [],
105
+ )
106
+ .concat([{ path: "*", element: <StatusPage statusCode={404} /> }])
107
+ .map((route) => ({
108
+ ...route,
109
+ errorElement: <RouterError className="w-full m-0" />,
110
+ }));
111
+
112
+ // @TODO Detect conflicts in routes and log warning
113
+
114
+ return routes;
115
+ };
116
+
117
+ export const getRoutesByConfig = (config: ZudokuConfig): RouteObject[] => {
118
+ const options = convertZudokuConfigToOptions(config);
119
+ const routes = getRoutesByOptions(
120
+ options,
121
+ import.meta.env.IS_ZUPLO || config.enableStatusPages,
122
+ );
123
+
124
+ return [
125
+ ...createRedirectRoutes(config.redirects),
126
+ {
127
+ element: (
128
+ <Zudoku {...options} env={import.meta.env}>
129
+ <BuildCheck
130
+ buildId={import.meta.env.ZUPLO_BUILD_ID}
131
+ environmentType={import.meta.env.ZUPLO_ENVIRONMENT_TYPE}
132
+ />
133
+ <Outlet />
134
+ </Zudoku>
135
+ ),
136
+ hydrateFallbackElement: <div>Loading...</div>,
137
+ children: [
138
+ {
139
+ element: (
140
+ <Meta>
141
+ <RouteGuard />
142
+ </Meta>
143
+ ),
144
+ errorElement: <RouterError />,
145
+ children: processRoutes(routes),
146
+ },
147
+ ],
148
+ },
149
+ ];
150
+ };