You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: packages/types/src/schemas/chapter.ts
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,12 @@ import { baseSchema } from './common.js';
3
3
4
4
exportconstchapterSchema=baseSchema.extend({
5
5
type: z.literal('chapter'),
6
-
lessons: z.array(z.string()).optional(),
6
+
lessons: z
7
+
.array(z.string())
8
+
.optional()
9
+
.describe(
10
+
'The list of lessons in this chapter. The order in this array defines the order of the lessons. If not specified a folder-based numbering system is used instead.',
mainCommand: commandSchema.optional().describe('The last command to be executed. Typically a dev server.'),
21
+
prepareCommands: commandSchema
22
+
.array()
23
+
.optional()
24
+
.describe(
25
+
'List of commands to be executed to prepare the environment in WebContainer. Each command executed and its status will be shown in the Prepare Environment section.',
// can either be completely removed by setting it to `false`
146
-
z.boolean().optional(),
147
-
148
-
// or you can only remove the file tree
149
-
z.strictObject({
150
-
fileTree: z.boolean().optional(),
151
-
}),
152
-
]),
153
-
i18n: i18nSchema.optional(),
161
+
previews: previewSchema
162
+
.optional()
163
+
.describe(
164
+
'Configure which ports should be used for the previews allowing you to align the behavior with your demo application’s dev server setup. If not specified, the lowest port will be used.',
165
+
),
166
+
autoReload: z
167
+
.boolean()
168
+
.optional()
169
+
.describe(
170
+
'Navigating to a lesson that specifies autoReload will always reload the preview. This is typically only needed if your server does not support HMR.',
171
+
),
172
+
template: z
173
+
.string()
174
+
.optional()
175
+
.describe(
176
+
'Specified which folder from the src/templates/ directory should be used as the basis for the code. See the “Code templates” guide for a detailed explainer.',
177
+
),
178
+
terminal: terminalSchema
179
+
.optional()
180
+
.describe(
181
+
'Configures one or more terminals. TutorialKit provides two types of terminals: read-only, called output, and interactive, called terminal.',
182
+
),
183
+
focus: z
184
+
.string()
185
+
.optional()
186
+
.describe('Defines which file should be opened in the code editor by default when lesson loads.'),
187
+
editor: z
188
+
.union([
189
+
// can either be completely removed by setting it to `false`
190
+
z.boolean().optional(),
191
+
192
+
// or you can only remove the file tree
193
+
z.strictObject({
194
+
fileTree: z.boolean().optional(),
195
+
}),
196
+
])
197
+
.describe(
198
+
'Configure whether or not the editor should be rendered. If an object is provided with fileTree: false, only the file tree is hidden.',
199
+
),
200
+
i18n: i18nSchema
201
+
.optional()
202
+
.describe('Lets you define alternative texts used in the UI. This is useful for localization.'),
'Display a link in lesson for editing the page content. The value is a URL pattern where ${path} is replaced with the lesson’s location relative to src/content/tutorial.',
214
+
),
163
215
});
164
216
165
217
exportconstbaseSchema=webcontainerSchema.extend({
166
-
title: z.string(),
167
-
slug: z.string().optional(),
218
+
title: z.string().describe('The title of the part, chapter, or lesson.'),
219
+
slug: z
220
+
.string()
221
+
.optional()
222
+
.describe(
223
+
'Customize the URL segment of this part / chapter or lesson. The full URL path is /:partSlug/:chapterSlug/:lessonSlug.',
Copy file name to clipboardExpand all lines: packages/types/src/schemas/part.ts
+6-1Lines changed: 6 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -3,7 +3,12 @@ import { baseSchema } from './common.js';
3
3
4
4
exportconstpartSchema=baseSchema.extend({
5
5
type: z.literal('part'),
6
-
chapters: z.array(z.string()).optional(),
6
+
chapters: z
7
+
.array(z.string())
8
+
.optional()
9
+
.describe(
10
+
'The list of chapters in this part. The order in this array defines the order of the chapters. If not specified a folder-based numbering system is used instead.',
'The list of parts in this tutorial. The order in this array defines the order of the parts. If not specified a folder-based numbering system is used instead.',
0 commit comments