zudoku 0.73.0 → 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 CHANGED
@@ -3276,7 +3276,10 @@ var init_ZudokuConfig = __esm({
3276
3276
  keywords: z7.array(z7.string()),
3277
3277
  authors: z7.array(z7.string()),
3278
3278
  creator: z7.string(),
3279
- publisher: z7.string()
3279
+ publisher: z7.string(),
3280
+ robots: z7.string().describe(
3281
+ 'Sets the contents of the `meta[name="robots"]` tag. For example: `noindex, nofollow`.'
3282
+ )
3280
3283
  }).partial();
3281
3284
  FontConfigSchema = z7.union([
3282
3285
  z7.enum(GOOGLE_FONTS),
@@ -3810,7 +3813,7 @@ import {
3810
3813
  // package.json
3811
3814
  var package_default = {
3812
3815
  name: "zudoku",
3813
- version: "0.72.0",
3816
+ version: "0.73.1",
3814
3817
  type: "module",
3815
3818
  sideEffects: [
3816
3819
  "**/*.css",
@@ -8019,9 +8022,10 @@ var runPrerender = async (options) => {
8019
8022
  rewrites
8020
8023
  });
8021
8024
  if (ZuploEnv.isZuplo && issuer) {
8025
+ const provider = config2.authentication?.type;
8022
8026
  await writeFile5(
8023
8027
  path22.join(dir, DIST_DIR, ".output/zuplo.json"),
8024
- JSON.stringify({ issuer }, null, 2),
8028
+ JSON.stringify({ issuer, provider }, null, 2),
8025
8029
  "utf-8"
8026
8030
  );
8027
8031
  }
@@ -6652,6 +6652,7 @@ export declare const ZudokuConfig: z.ZodObject<{
6652
6652
  authors: z.ZodOptional<z.ZodArray<z.ZodString>>;
6653
6653
  creator: z.ZodOptional<z.ZodString>;
6654
6654
  publisher: z.ZodOptional<z.ZodString>;
6655
+ robots: z.ZodOptional<z.ZodString>;
6655
6656
  }, z.core.$strip>>;
6656
6657
  authentication: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
6657
6658
  type: z.ZodLiteral<"clerk">;
@@ -45,6 +45,7 @@ type Metadata = Partial<{
45
45
  authors: string[];
46
46
  creator: string;
47
47
  publisher: string;
48
+ robots: string;
48
49
  }>;
49
50
  type Site = Partial<{
50
51
  dir?: "ltr" | "rtl";
@@ -236,6 +236,10 @@ export interface FlatZudokuConfig {
236
236
  authors?: string[]
237
237
  creator?: string
238
238
  publisher?: string
239
+ /**
240
+ * Sets the contents of the `meta[name="robots"]` tag. For example: `noindex, nofollow`.
241
+ */
242
+ robots?: string
239
243
  }
240
244
  authentication?: ({
241
245
  type: "clerk"
@@ -100,8 +100,8 @@ const config = {
100
100
  catalogs: {
101
101
  path: "/catalog",
102
102
  label: "API Catalog",
103
- filterItems: (items, { auth: AuthState }) => {
104
- return items.filter((items) => items.tags.includes(auth));
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
- { label: "cURL", language: "shell" },
205
- { label: "JavaScript", language: "javascript" },
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 `label`
224
- (display name) and `language` (code identifier)
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 the OpenID
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
@@ -149,8 +149,7 @@ docs: {
149
149
 
150
150
  #### `showLastModified`
151
151
 
152
- **Type:** `boolean`
153
- **Default:** `false`
152
+ **Type:** `boolean` **Default:** `true`
154
153
 
155
154
  Whether to show the last modified date by default.
156
155
 
@@ -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 `page.footer` property:
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: "twitter",
94
- href: "https://twitter.com/yourhandle",
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
@@ -157,11 +157,15 @@ const navigationPlugin: ZudokuPlugin = {
157
157
  },
158
158
  ];
159
159
  },
160
- getSidebar: async (path: string) => {
161
- // Return custom sidebar items
162
- return {
163
- items: [{ id: "custom", label: "Custom Page" }],
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
  ```
@@ -74,7 +74,7 @@ information.
74
74
 
75
75
  :::caution{title="Redirects"}
76
76
 
77
- If you have redirects configured in your Zuplo configuration, you will need to also add those to
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 `href` in the navigation
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
- ### `navigation_label`
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
- navigation_label: Short Title
57
+ sidebar_label: Short Title
60
58
  ---
61
59
  ```
62
60
 
63
- ### `navigation_icon`
61
+ The legacy name `navigation_label` is also supported but `sidebar_label` is preferred.
64
62
 
65
- _Deprecated (`sidebar_icon`)_
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
- navigation_icon: compass
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
- navigation_label: Advanced Config
166
- navigation_icon: settings
176
+ sidebar_label: Advanced Config
177
+ sidebar_icon: settings
167
178
  toc: true
168
179
  disable_pager: false
169
180
  draft: false
@@ -147,7 +147,7 @@ files:
147
147
  ---
148
148
  title: My Page Title
149
149
  description: Page description for SEO
150
- navigation_icon: book
150
+ sidebar_icon: book
151
151
  category: Getting Started
152
152
  ---
153
153
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "zudoku",
3
- "version": "0.73.0",
3
+ "version": "0.74.0",
4
4
  "type": "module",
5
5
  "sideEffects": [
6
6
  "**/*.css",
@@ -283,7 +283,7 @@
283
283
  "@types/unist": "3.0.3",
284
284
  "@types/yargs": "17.0.35",
285
285
  "@vitest/coverage-v8": "4.0.18",
286
- "happy-dom": "20.8.3",
286
+ "happy-dom": "20.8.9",
287
287
  "oxc-parser": "^0.119.0",
288
288
  "react": "19.2.4",
289
289
  "react-dom": "19.2.4",
@@ -506,6 +506,11 @@ const MetadataSchema = z
506
506
  authors: z.array(z.string()),
507
507
  creator: z.string(),
508
508
  publisher: z.string(),
509
+ robots: z
510
+ .string()
511
+ .describe(
512
+ 'Sets the contents of the `meta[name="robots"]` tag. For example: `noindex, nofollow`.',
513
+ ),
509
514
  })
510
515
  .partial();
511
516
 
@@ -39,6 +39,7 @@ export const Meta = ({ children }: PropsWithChildren) => {
39
39
  ))}
40
40
  {meta?.creator && <meta name="creator" content={meta.creator} />}
41
41
  {meta?.publisher && <meta name="publisher" content={meta.publisher} />}
42
+ {meta?.robots && <meta name="robots" content={meta.robots} />}
42
43
  </Helmet>
43
44
  {children}
44
45
  </>
@@ -65,6 +65,7 @@ type Metadata = Partial<{
65
65
  authors: string[];
66
66
  creator: string;
67
67
  publisher: string;
68
+ robots: string;
68
69
  }>;
69
70
 
70
71
  type Site = Partial<{
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
  }