zudoku 0.73.1 → 0.74.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/cli/cli.js +3 -2
- package/docs/configuration/api-catalog.md +2 -2
- package/docs/configuration/api-reference.md +4 -4
- package/docs/configuration/authentication.md +28 -2
- package/docs/configuration/docs.md +1 -2
- package/docs/configuration/footer.mdx +3 -3
- package/docs/configuration/navigation.mdx +1 -1
- package/docs/configuration/overview.md +37 -0
- package/docs/configuration/site.md +12 -0
- package/docs/custom-plugins.md +9 -5
- package/docs/deploy/vercel.md +1 -1
- package/docs/guides/using-multiple-apis.md +1 -1
- package/docs/markdown/frontmatter.md +20 -9
- package/docs/markdown/overview.md +1 -1
- package/package.json +1 -1
- package/src/vite/build.ts +3 -1
package/dist/cli/cli.js
CHANGED
|
@@ -3813,7 +3813,7 @@ import {
|
|
|
3813
3813
|
// package.json
|
|
3814
3814
|
var package_default = {
|
|
3815
3815
|
name: "zudoku",
|
|
3816
|
-
version: "0.73.
|
|
3816
|
+
version: "0.73.1",
|
|
3817
3817
|
type: "module",
|
|
3818
3818
|
sideEffects: [
|
|
3819
3819
|
"**/*.css",
|
|
@@ -8022,9 +8022,10 @@ var runPrerender = async (options) => {
|
|
|
8022
8022
|
rewrites
|
|
8023
8023
|
});
|
|
8024
8024
|
if (ZuploEnv.isZuplo && issuer) {
|
|
8025
|
+
const provider = config2.authentication?.type;
|
|
8025
8026
|
await writeFile5(
|
|
8026
8027
|
path22.join(dir, DIST_DIR, ".output/zuplo.json"),
|
|
8027
|
-
JSON.stringify({ issuer }, null, 2),
|
|
8028
|
+
JSON.stringify({ issuer, provider }, null, 2),
|
|
8028
8029
|
"utf-8"
|
|
8029
8030
|
);
|
|
8030
8031
|
}
|
|
@@ -100,8 +100,8 @@ const config = {
|
|
|
100
100
|
catalogs: {
|
|
101
101
|
path: "/catalog",
|
|
102
102
|
label: "API Catalog",
|
|
103
|
-
filterItems: (items, { auth
|
|
104
|
-
return items.filter((
|
|
103
|
+
filterItems: (items, { auth }) => {
|
|
104
|
+
return items.filter((item) => item.tags.includes("public"));
|
|
105
105
|
},
|
|
106
106
|
},
|
|
107
107
|
// ...
|
|
@@ -201,8 +201,8 @@ const config = {
|
|
|
201
201
|
options: {
|
|
202
202
|
examplesLanguage: "shell", // Default language for code examples
|
|
203
203
|
supportedLanguages: [
|
|
204
|
-
{
|
|
205
|
-
{
|
|
204
|
+
{ value: "shell", label: "cURL" },
|
|
205
|
+
{ value: "javascript", label: "JavaScript" },
|
|
206
206
|
],
|
|
207
207
|
disablePlayground: false, // Disable the interactive API playground
|
|
208
208
|
disableSidecar: false, // Disable the sidecar completely
|
|
@@ -220,8 +220,8 @@ const config = {
|
|
|
220
220
|
Available options:
|
|
221
221
|
|
|
222
222
|
- `examplesLanguage`: Set default language for code examples
|
|
223
|
-
- `supportedLanguages`: Array of language options for code examples. Each option has `
|
|
224
|
-
|
|
223
|
+
- `supportedLanguages`: Array of language options for code examples. Each option has `value` (code
|
|
224
|
+
identifier) and `label` (display name)
|
|
225
225
|
- `disablePlayground`: Disable the interactive API playground globally
|
|
226
226
|
- `disableSidecar`: Disable the sidecar panel completely
|
|
227
227
|
- `showVersionSelect`: Control version selector visibility
|
|
@@ -15,8 +15,8 @@ authentication provider you use.
|
|
|
15
15
|
|
|
16
16
|
## Authentication Providers
|
|
17
17
|
|
|
18
|
-
Zudoku supports Clerk, Auth0, Supabase, Azure B2C, and any OpenID provider that supports
|
|
19
|
-
Connect protocol.
|
|
18
|
+
Zudoku supports Clerk, Auth0, Supabase, Firebase, Azure B2C, and any OpenID provider that supports
|
|
19
|
+
the OpenID Connect protocol (including PingFederate).
|
|
20
20
|
|
|
21
21
|
Not seeing your authentication provider? [Let us know](https://github.com/zuplo/zudoku/issues)
|
|
22
22
|
|
|
@@ -96,6 +96,32 @@ When configuring your OpenID provider, you will need to set the following:
|
|
|
96
96
|
By default, the scopes "openid", "profile", and "email" are requested. You can customize these by
|
|
97
97
|
providing your own array of scopes.
|
|
98
98
|
|
|
99
|
+
### Firebase
|
|
100
|
+
|
|
101
|
+
For Firebase authentication, you will need your Firebase project configuration. You can find this in
|
|
102
|
+
the Firebase console under Project Settings.
|
|
103
|
+
|
|
104
|
+
```typescript title="zudoku.config.ts"
|
|
105
|
+
{
|
|
106
|
+
// ...
|
|
107
|
+
authentication: {
|
|
108
|
+
type: "firebase",
|
|
109
|
+
apiKey: "<your-firebase-api-key>",
|
|
110
|
+
authDomain: "<your-project>.firebaseapp.com",
|
|
111
|
+
projectId: "<your-project-id>",
|
|
112
|
+
appId: "<your-app-id>",
|
|
113
|
+
providers: ["google", "github", "password"], // Optional
|
|
114
|
+
},
|
|
115
|
+
// ...
|
|
116
|
+
}
|
|
117
|
+
```
|
|
118
|
+
|
|
119
|
+
The `providers` option configures which sign-in methods are available. Supported providers include:
|
|
120
|
+
`google`, `facebook`, `twitter`, `github`, `microsoft`, `apple`, `yahoo`, `password`, `phone`, and
|
|
121
|
+
`emailLink`.
|
|
122
|
+
|
|
123
|
+
For detailed setup instructions, see the [Firebase setup guide](./authentication-firebase.md).
|
|
124
|
+
|
|
99
125
|
### Supabase
|
|
100
126
|
|
|
101
127
|
To use Supabase as your authentication provider, supply your project's URL, API key, and the OAuth
|
|
@@ -14,7 +14,7 @@ copyright notice, and logo.
|
|
|
14
14
|
|
|
15
15
|
## Basic Configuration
|
|
16
16
|
|
|
17
|
-
The footer is configured in your `zudoku.config.tsx` file under the `
|
|
17
|
+
The footer is configured in your `zudoku.config.tsx` file under the `site.footer` property:
|
|
18
18
|
|
|
19
19
|
```tsx
|
|
20
20
|
const config: ZudokuConfig = {
|
|
@@ -90,8 +90,8 @@ footer: {
|
|
|
90
90
|
href: "https://github.com/yourusername",
|
|
91
91
|
},
|
|
92
92
|
{
|
|
93
|
-
icon: "
|
|
94
|
-
href: "https://
|
|
93
|
+
icon: "x",
|
|
94
|
+
href: "https://x.com/yourhandle",
|
|
95
95
|
label: "Follow us", // optional label text
|
|
96
96
|
},
|
|
97
97
|
];
|
|
@@ -92,6 +92,7 @@ type NavigationLink = {
|
|
|
92
92
|
to: string;
|
|
93
93
|
label: string;
|
|
94
94
|
icon?: string; // Lucide icon name
|
|
95
|
+
target?: "_self" | "_blank";
|
|
95
96
|
badge?: {
|
|
96
97
|
label: string;
|
|
97
98
|
color: "green" | "blue" | "yellow" | "red" | "purple" | "indigo" | "gray" | "outline";
|
|
@@ -103,7 +104,6 @@ type NavigationLink = {
|
|
|
103
104
|
| "always"
|
|
104
105
|
| "hide"
|
|
105
106
|
| ((params: { context: ZudokuContext; auth: UseAuthReturn }) => boolean);
|
|
106
|
-
target?: "_self" | "_blank";
|
|
107
107
|
};
|
|
108
108
|
```
|
|
109
109
|
</details>
|
|
@@ -179,6 +179,43 @@ below.
|
|
|
179
179
|
}
|
|
180
180
|
```
|
|
181
181
|
|
|
182
|
+
### `header`
|
|
183
|
+
|
|
184
|
+
Configures the header navigation and placement of header elements (navigation, search, auth).
|
|
185
|
+
|
|
186
|
+
```ts
|
|
187
|
+
{
|
|
188
|
+
header: {
|
|
189
|
+
navigation: [
|
|
190
|
+
{ label: "Docs", id: "docs" },
|
|
191
|
+
{ label: "API", id: "api" },
|
|
192
|
+
],
|
|
193
|
+
placements: {
|
|
194
|
+
navigation: "start", // "start" | "center" | "end"
|
|
195
|
+
search: "end", // "start" | "center" | "end"
|
|
196
|
+
auth: "end", // "start" | "center" | "end" | "navigation"
|
|
197
|
+
},
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
```
|
|
201
|
+
|
|
202
|
+
### `defaults`
|
|
203
|
+
|
|
204
|
+
Sets global default options for APIs that apply to all API configurations. Individual API options
|
|
205
|
+
will override these defaults when specified.
|
|
206
|
+
|
|
207
|
+
```ts
|
|
208
|
+
{
|
|
209
|
+
defaults: {
|
|
210
|
+
apis: {
|
|
211
|
+
examplesLanguage: "shell",
|
|
212
|
+
disablePlayground: false,
|
|
213
|
+
showVersionSelect: "if-available",
|
|
214
|
+
},
|
|
215
|
+
}
|
|
216
|
+
}
|
|
217
|
+
```
|
|
218
|
+
|
|
182
219
|
### `docs`
|
|
183
220
|
|
|
184
221
|
Configures where your non API reference documentation can be found in your folder structure. The
|
|
@@ -70,6 +70,18 @@ The `reloadDocument` option controls whether clicking the logo triggers a full p
|
|
|
70
70
|
the default) or uses client-side SPA navigation (`false`). A full reload is useful when your landing
|
|
71
71
|
page is served by a different system (e.g. a CMS) outside of Zudoku.
|
|
72
72
|
|
|
73
|
+
#### Direction (RTL/LTR)
|
|
74
|
+
|
|
75
|
+
Set the text direction for your site. This is useful for right-to-left languages:
|
|
76
|
+
|
|
77
|
+
```tsx title=zudoku.config.tsx
|
|
78
|
+
{
|
|
79
|
+
site: {
|
|
80
|
+
dir: "rtl", // "ltr" (default) or "rtl"
|
|
81
|
+
}
|
|
82
|
+
}
|
|
83
|
+
```
|
|
84
|
+
|
|
73
85
|
#### Colors & Theme
|
|
74
86
|
|
|
75
87
|
We allow you to fully customize all colors, borders, etc - read more about it in
|
package/docs/custom-plugins.md
CHANGED
|
@@ -157,11 +157,15 @@ const navigationPlugin: ZudokuPlugin = {
|
|
|
157
157
|
},
|
|
158
158
|
];
|
|
159
159
|
},
|
|
160
|
-
|
|
161
|
-
// Return custom
|
|
162
|
-
return
|
|
163
|
-
|
|
164
|
-
|
|
160
|
+
getNavigation: async (path: string, context) => {
|
|
161
|
+
// Return custom navigation items
|
|
162
|
+
return [
|
|
163
|
+
{
|
|
164
|
+
type: "link",
|
|
165
|
+
to: "/custom",
|
|
166
|
+
label: "Custom Page",
|
|
167
|
+
},
|
|
168
|
+
];
|
|
165
169
|
},
|
|
166
170
|
};
|
|
167
171
|
```
|
package/docs/deploy/vercel.md
CHANGED
|
@@ -74,7 +74,7 @@ information.
|
|
|
74
74
|
|
|
75
75
|
:::caution{title="Redirects"}
|
|
76
76
|
|
|
77
|
-
If you have redirects configured in your
|
|
77
|
+
If you have redirects configured in your Zudoku configuration, you will need to also add those to
|
|
78
78
|
your `vercel.json` file. See the
|
|
79
79
|
[Vercel Configuration](https://vercel.com/docs/projects/project-configuration#redirects) for more
|
|
80
80
|
information.
|
|
@@ -79,7 +79,7 @@ export default config;
|
|
|
79
79
|
|
|
80
80
|
Make sure that:
|
|
81
81
|
|
|
82
|
-
1. The `path` in each API config matches the `
|
|
82
|
+
1. The `path` in each API config matches the `to` in the navigation
|
|
83
83
|
2. Your OpenAPI files are placed in the correct location as specified in the `input` field
|
|
84
84
|
3. The `label` in navigation matches what you want to display in the sidebar
|
|
85
85
|
|
|
@@ -46,9 +46,7 @@ category: Getting Started
|
|
|
46
46
|
---
|
|
47
47
|
```
|
|
48
48
|
|
|
49
|
-
### `
|
|
50
|
-
|
|
51
|
-
_Deprecated (`sidebar_label`)_
|
|
49
|
+
### `sidebar_label`
|
|
52
50
|
|
|
53
51
|
Sets a custom label for the page in the sidebar navigation, allowing you to use a shorter or
|
|
54
52
|
different title than the main page title.
|
|
@@ -56,23 +54,25 @@ different title than the main page title.
|
|
|
56
54
|
```md
|
|
57
55
|
---
|
|
58
56
|
title: My Very Long Documentation Page Title
|
|
59
|
-
|
|
57
|
+
sidebar_label: Short Title
|
|
60
58
|
---
|
|
61
59
|
```
|
|
62
60
|
|
|
63
|
-
|
|
61
|
+
The legacy name `navigation_label` is also supported but `sidebar_label` is preferred.
|
|
64
62
|
|
|
65
|
-
|
|
63
|
+
### `sidebar_icon`
|
|
66
64
|
|
|
67
65
|
Specifies a [Lucide icon](https://lucide.dev/icons) to display next to the page in the sidebar
|
|
68
66
|
navigation.
|
|
69
67
|
|
|
70
68
|
```md
|
|
71
69
|
---
|
|
72
|
-
|
|
70
|
+
sidebar_icon: compass
|
|
73
71
|
---
|
|
74
72
|
```
|
|
75
73
|
|
|
74
|
+
The legacy name `navigation_icon` is also supported but `sidebar_icon` is preferred.
|
|
75
|
+
|
|
76
76
|
### `navigation_display`
|
|
77
77
|
|
|
78
78
|
Specifies the display property of the navigation item. See the
|
|
@@ -106,6 +106,17 @@ disable_pager: true
|
|
|
106
106
|
---
|
|
107
107
|
```
|
|
108
108
|
|
|
109
|
+
### `showLastModified`
|
|
110
|
+
|
|
111
|
+
Controls whether the last modified date is displayed for this page. Can be used to override the
|
|
112
|
+
[default option](/docs/configuration/docs#showlastmodified).
|
|
113
|
+
|
|
114
|
+
```md
|
|
115
|
+
---
|
|
116
|
+
showLastModified: false
|
|
117
|
+
---
|
|
118
|
+
```
|
|
119
|
+
|
|
109
120
|
### `draft`
|
|
110
121
|
|
|
111
122
|
Marks a document as a draft. Draft documents are only visible when running in development mode and
|
|
@@ -162,8 +173,8 @@ Here's an example showing multiple frontmatter properties used together:
|
|
|
162
173
|
title: Advanced Configuration Guide
|
|
163
174
|
description: Learn how to configure advanced features in Zudoku
|
|
164
175
|
category: Configuration
|
|
165
|
-
|
|
166
|
-
|
|
176
|
+
sidebar_label: Advanced Config
|
|
177
|
+
sidebar_icon: settings
|
|
167
178
|
toc: true
|
|
168
179
|
disable_pager: false
|
|
169
180
|
draft: false
|
package/package.json
CHANGED
package/src/vite/build.ts
CHANGED
|
@@ -167,9 +167,11 @@ const runPrerender = async (options: PrerenderOptions) => {
|
|
|
167
167
|
});
|
|
168
168
|
|
|
169
169
|
if (ZuploEnv.isZuplo && issuer) {
|
|
170
|
+
const provider = config.authentication?.type;
|
|
171
|
+
|
|
170
172
|
await writeFile(
|
|
171
173
|
path.join(dir, DIST_DIR, ".output/zuplo.json"),
|
|
172
|
-
JSON.stringify({ issuer }, null, 2),
|
|
174
|
+
JSON.stringify({ issuer, provider }, null, 2),
|
|
173
175
|
"utf-8",
|
|
174
176
|
);
|
|
175
177
|
}
|