@tutorialkit-rb/types 1.5.2-rb.0.1.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.
@@ -0,0 +1,378 @@
1
+ import { z } from 'zod';
2
+ export declare const tutorialSchema: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<{
3
+ mainCommand: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>, z.ZodObject<{
4
+ command: z.ZodString;
5
+ title: z.ZodString;
6
+ }, "strict", z.ZodTypeAny, {
7
+ title: string;
8
+ command: string;
9
+ }, {
10
+ title: string;
11
+ command: string;
12
+ }>]>>;
13
+ prepareCommands: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodTuple<[z.ZodString, z.ZodString], null>, z.ZodObject<{
14
+ command: z.ZodString;
15
+ title: z.ZodString;
16
+ }, "strict", z.ZodTypeAny, {
17
+ title: string;
18
+ command: string;
19
+ }, {
20
+ title: string;
21
+ command: string;
22
+ }>]>, "many">>;
23
+ }, {
24
+ meta: z.ZodOptional<z.ZodObject<{
25
+ image: z.ZodOptional<z.ZodString>;
26
+ description: z.ZodOptional<z.ZodString>;
27
+ title: z.ZodOptional<z.ZodString>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ image?: string | undefined;
30
+ description?: string | undefined;
31
+ title?: string | undefined;
32
+ }, {
33
+ image?: string | undefined;
34
+ description?: string | undefined;
35
+ title?: string | undefined;
36
+ }>>;
37
+ custom: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodAny>>;
38
+ previews: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodTuple<[z.ZodNumber, z.ZodString], null>, z.ZodTuple<[z.ZodNumber, z.ZodString, z.ZodString], null>, z.ZodObject<{
39
+ port: z.ZodNumber;
40
+ title: z.ZodString;
41
+ pathname: z.ZodOptional<z.ZodString>;
42
+ }, "strict", z.ZodTypeAny, {
43
+ title: string;
44
+ port: number;
45
+ pathname?: string | undefined;
46
+ }, {
47
+ title: string;
48
+ port: number;
49
+ pathname?: string | undefined;
50
+ }>]>, "many">]>>;
51
+ autoReload: z.ZodOptional<z.ZodBoolean>;
52
+ filesystem: z.ZodOptional<z.ZodObject<{
53
+ watch: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodArray<z.ZodString, "many">]>>;
54
+ }, "strip", z.ZodTypeAny, {
55
+ watch?: boolean | string[] | undefined;
56
+ }, {
57
+ watch?: boolean | string[] | undefined;
58
+ }>>;
59
+ template: z.ZodOptional<z.ZodString>;
60
+ terminal: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
61
+ open: z.ZodOptional<z.ZodBoolean>;
62
+ panels: z.ZodUnion<[z.ZodLiteral<"output">, z.ZodLiteral<"terminal">, z.ZodEffects<z.ZodArray<z.ZodUnion<[z.ZodUnion<[z.ZodLiteral<"output">, z.ZodLiteral<"terminal">]>, z.ZodTuple<[z.ZodUnion<[z.ZodLiteral<"output">, z.ZodLiteral<"terminal">]>, z.ZodString], null>, z.ZodObject<{
63
+ type: z.ZodUnion<[z.ZodLiteral<"output">, z.ZodLiteral<"terminal">]>;
64
+ id: z.ZodOptional<z.ZodString>;
65
+ title: z.ZodOptional<z.ZodString>;
66
+ allowRedirects: z.ZodOptional<z.ZodBoolean>;
67
+ allowCommands: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
68
+ }, "strict", z.ZodTypeAny, {
69
+ type: "output" | "terminal";
70
+ title?: string | undefined;
71
+ id?: string | undefined;
72
+ allowRedirects?: boolean | undefined;
73
+ allowCommands?: string[] | undefined;
74
+ }, {
75
+ type: "output" | "terminal";
76
+ title?: string | undefined;
77
+ id?: string | undefined;
78
+ allowRedirects?: boolean | undefined;
79
+ allowCommands?: string[] | undefined;
80
+ }>]>, "many">, ("output" | "terminal" | ["output" | "terminal", string] | {
81
+ type: "output" | "terminal";
82
+ title?: string | undefined;
83
+ id?: string | undefined;
84
+ allowRedirects?: boolean | undefined;
85
+ allowCommands?: string[] | undefined;
86
+ })[], ("output" | "terminal" | ["output" | "terminal", string] | {
87
+ type: "output" | "terminal";
88
+ title?: string | undefined;
89
+ id?: string | undefined;
90
+ allowRedirects?: boolean | undefined;
91
+ allowCommands?: string[] | undefined;
92
+ })[]>]>;
93
+ activePanel: z.ZodOptional<z.ZodNumber>;
94
+ allowRedirects: z.ZodOptional<z.ZodBoolean>;
95
+ allowCommands: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
96
+ }, "strict", z.ZodTypeAny, {
97
+ panels: "output" | "terminal" | ("output" | "terminal" | ["output" | "terminal", string] | {
98
+ type: "output" | "terminal";
99
+ title?: string | undefined;
100
+ id?: string | undefined;
101
+ allowRedirects?: boolean | undefined;
102
+ allowCommands?: string[] | undefined;
103
+ })[];
104
+ open?: boolean | undefined;
105
+ allowRedirects?: boolean | undefined;
106
+ allowCommands?: string[] | undefined;
107
+ activePanel?: number | undefined;
108
+ }, {
109
+ panels: "output" | "terminal" | ("output" | "terminal" | ["output" | "terminal", string] | {
110
+ type: "output" | "terminal";
111
+ title?: string | undefined;
112
+ id?: string | undefined;
113
+ allowRedirects?: boolean | undefined;
114
+ allowCommands?: string[] | undefined;
115
+ })[];
116
+ open?: boolean | undefined;
117
+ allowRedirects?: boolean | undefined;
118
+ allowCommands?: string[] | undefined;
119
+ activePanel?: number | undefined;
120
+ }>]>>;
121
+ focus: z.ZodOptional<z.ZodString>;
122
+ editor: z.ZodOptional<z.ZodUnion<[z.ZodOptional<z.ZodBoolean>, z.ZodObject<{
123
+ fileTree: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
124
+ allowEdits: z.ZodUnion<[z.ZodBoolean, z.ZodString, z.ZodArray<z.ZodString, "many">]>;
125
+ }, "strict", z.ZodTypeAny, {
126
+ allowEdits: string | boolean | string[];
127
+ }, {
128
+ allowEdits: string | boolean | string[];
129
+ }>]>>;
130
+ }, "strict", z.ZodTypeAny, {
131
+ fileTree?: boolean | {
132
+ allowEdits: string | boolean | string[];
133
+ } | undefined;
134
+ }, {
135
+ fileTree?: boolean | {
136
+ allowEdits: string | boolean | string[];
137
+ } | undefined;
138
+ }>]>>;
139
+ i18n: z.ZodOptional<z.ZodObject<{
140
+ partTemplate: z.ZodOptional<z.ZodString>;
141
+ editPageText: z.ZodOptional<z.ZodString>;
142
+ webcontainerLinkText: z.ZodOptional<z.ZodString>;
143
+ startWebContainerText: z.ZodOptional<z.ZodString>;
144
+ noPreviewNorStepsText: z.ZodOptional<z.ZodString>;
145
+ filesTitleText: z.ZodOptional<z.ZodString>;
146
+ fileTreeCreateFileText: z.ZodOptional<z.ZodString>;
147
+ fileTreeCreateFolderText: z.ZodOptional<z.ZodString>;
148
+ fileTreeActionNotAllowedText: z.ZodOptional<z.ZodString>;
149
+ fileTreeFileExistsAlreadyText: z.ZodOptional<z.ZodString>;
150
+ fileTreeAllowedPatternsText: z.ZodOptional<z.ZodString>;
151
+ confirmationText: z.ZodOptional<z.ZodString>;
152
+ prepareEnvironmentTitleText: z.ZodOptional<z.ZodString>;
153
+ defaultPreviewTitleText: z.ZodOptional<z.ZodString>;
154
+ reloadPreviewTitle: z.ZodOptional<z.ZodString>;
155
+ toggleTerminalButtonText: z.ZodOptional<z.ZodString>;
156
+ solveButtonText: z.ZodOptional<z.ZodString>;
157
+ resetButtonText: z.ZodOptional<z.ZodString>;
158
+ }, "strip", z.ZodTypeAny, {
159
+ partTemplate?: string | undefined;
160
+ editPageText?: string | undefined;
161
+ webcontainerLinkText?: string | undefined;
162
+ startWebContainerText?: string | undefined;
163
+ noPreviewNorStepsText?: string | undefined;
164
+ filesTitleText?: string | undefined;
165
+ fileTreeCreateFileText?: string | undefined;
166
+ fileTreeCreateFolderText?: string | undefined;
167
+ fileTreeActionNotAllowedText?: string | undefined;
168
+ fileTreeFileExistsAlreadyText?: string | undefined;
169
+ fileTreeAllowedPatternsText?: string | undefined;
170
+ confirmationText?: string | undefined;
171
+ prepareEnvironmentTitleText?: string | undefined;
172
+ defaultPreviewTitleText?: string | undefined;
173
+ reloadPreviewTitle?: string | undefined;
174
+ toggleTerminalButtonText?: string | undefined;
175
+ solveButtonText?: string | undefined;
176
+ resetButtonText?: string | undefined;
177
+ }, {
178
+ partTemplate?: string | undefined;
179
+ editPageText?: string | undefined;
180
+ webcontainerLinkText?: string | undefined;
181
+ startWebContainerText?: string | undefined;
182
+ noPreviewNorStepsText?: string | undefined;
183
+ filesTitleText?: string | undefined;
184
+ fileTreeCreateFileText?: string | undefined;
185
+ fileTreeCreateFolderText?: string | undefined;
186
+ fileTreeActionNotAllowedText?: string | undefined;
187
+ fileTreeFileExistsAlreadyText?: string | undefined;
188
+ fileTreeAllowedPatternsText?: string | undefined;
189
+ confirmationText?: string | undefined;
190
+ prepareEnvironmentTitleText?: string | undefined;
191
+ defaultPreviewTitleText?: string | undefined;
192
+ reloadPreviewTitle?: string | undefined;
193
+ toggleTerminalButtonText?: string | undefined;
194
+ solveButtonText?: string | undefined;
195
+ resetButtonText?: string | undefined;
196
+ }>>;
197
+ editPageLink: z.ZodOptional<z.ZodUnion<[z.ZodString, z.ZodBoolean]>>;
198
+ openInStackBlitz: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
199
+ projectTitle: z.ZodOptional<z.ZodString>;
200
+ projectDescription: z.ZodOptional<z.ZodString>;
201
+ projectTemplate: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<"html">, z.ZodLiteral<"node">, z.ZodLiteral<"angular-cli">, z.ZodLiteral<"create-react-app">, z.ZodLiteral<"javascript">, z.ZodLiteral<"polymer">, z.ZodLiteral<"typescript">, z.ZodLiteral<"vue">]>>;
202
+ }, "strict", z.ZodTypeAny, {
203
+ projectTitle?: string | undefined;
204
+ projectDescription?: string | undefined;
205
+ projectTemplate?: "html" | "node" | "angular-cli" | "create-react-app" | "javascript" | "polymer" | "typescript" | "vue" | undefined;
206
+ }, {
207
+ projectTitle?: string | undefined;
208
+ projectDescription?: string | undefined;
209
+ projectTemplate?: "html" | "node" | "angular-cli" | "create-react-app" | "javascript" | "polymer" | "typescript" | "vue" | undefined;
210
+ }>]>>;
211
+ downloadAsZip: z.ZodOptional<z.ZodUnion<[z.ZodBoolean, z.ZodObject<{
212
+ filename: z.ZodString;
213
+ }, "strict", z.ZodTypeAny, {
214
+ filename: string;
215
+ }, {
216
+ filename: string;
217
+ }>]>>;
218
+ }>, {
219
+ type: z.ZodLiteral<"tutorial">;
220
+ logoLink: z.ZodOptional<z.ZodString>;
221
+ parts: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
222
+ lessons: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
223
+ }>, "strip", z.ZodTypeAny, {
224
+ type: "tutorial";
225
+ custom?: Record<string, any> | undefined;
226
+ mainCommand?: string | [string, string] | {
227
+ title: string;
228
+ command: string;
229
+ } | undefined;
230
+ prepareCommands?: (string | [string, string] | {
231
+ title: string;
232
+ command: string;
233
+ })[] | undefined;
234
+ terminal?: boolean | {
235
+ panels: "output" | "terminal" | ("output" | "terminal" | ["output" | "terminal", string] | {
236
+ type: "output" | "terminal";
237
+ title?: string | undefined;
238
+ id?: string | undefined;
239
+ allowRedirects?: boolean | undefined;
240
+ allowCommands?: string[] | undefined;
241
+ })[];
242
+ open?: boolean | undefined;
243
+ allowRedirects?: boolean | undefined;
244
+ allowCommands?: string[] | undefined;
245
+ activePanel?: number | undefined;
246
+ } | undefined;
247
+ meta?: {
248
+ image?: string | undefined;
249
+ description?: string | undefined;
250
+ title?: string | undefined;
251
+ } | undefined;
252
+ previews?: boolean | (string | number | [number, string] | [number, string, string] | {
253
+ title: string;
254
+ port: number;
255
+ pathname?: string | undefined;
256
+ })[] | undefined;
257
+ autoReload?: boolean | undefined;
258
+ filesystem?: {
259
+ watch?: boolean | string[] | undefined;
260
+ } | undefined;
261
+ template?: string | undefined;
262
+ focus?: string | undefined;
263
+ editor?: boolean | {
264
+ fileTree?: boolean | {
265
+ allowEdits: string | boolean | string[];
266
+ } | undefined;
267
+ } | undefined;
268
+ i18n?: {
269
+ partTemplate?: string | undefined;
270
+ editPageText?: string | undefined;
271
+ webcontainerLinkText?: string | undefined;
272
+ startWebContainerText?: string | undefined;
273
+ noPreviewNorStepsText?: string | undefined;
274
+ filesTitleText?: string | undefined;
275
+ fileTreeCreateFileText?: string | undefined;
276
+ fileTreeCreateFolderText?: string | undefined;
277
+ fileTreeActionNotAllowedText?: string | undefined;
278
+ fileTreeFileExistsAlreadyText?: string | undefined;
279
+ fileTreeAllowedPatternsText?: string | undefined;
280
+ confirmationText?: string | undefined;
281
+ prepareEnvironmentTitleText?: string | undefined;
282
+ defaultPreviewTitleText?: string | undefined;
283
+ reloadPreviewTitle?: string | undefined;
284
+ toggleTerminalButtonText?: string | undefined;
285
+ solveButtonText?: string | undefined;
286
+ resetButtonText?: string | undefined;
287
+ } | undefined;
288
+ editPageLink?: string | boolean | undefined;
289
+ openInStackBlitz?: boolean | {
290
+ projectTitle?: string | undefined;
291
+ projectDescription?: string | undefined;
292
+ projectTemplate?: "html" | "node" | "angular-cli" | "create-react-app" | "javascript" | "polymer" | "typescript" | "vue" | undefined;
293
+ } | undefined;
294
+ downloadAsZip?: boolean | {
295
+ filename: string;
296
+ } | undefined;
297
+ lessons?: string[] | undefined;
298
+ logoLink?: string | undefined;
299
+ parts?: string[] | undefined;
300
+ }, {
301
+ type: "tutorial";
302
+ custom?: Record<string, any> | undefined;
303
+ mainCommand?: string | [string, string] | {
304
+ title: string;
305
+ command: string;
306
+ } | undefined;
307
+ prepareCommands?: (string | [string, string] | {
308
+ title: string;
309
+ command: string;
310
+ })[] | undefined;
311
+ terminal?: boolean | {
312
+ panels: "output" | "terminal" | ("output" | "terminal" | ["output" | "terminal", string] | {
313
+ type: "output" | "terminal";
314
+ title?: string | undefined;
315
+ id?: string | undefined;
316
+ allowRedirects?: boolean | undefined;
317
+ allowCommands?: string[] | undefined;
318
+ })[];
319
+ open?: boolean | undefined;
320
+ allowRedirects?: boolean | undefined;
321
+ allowCommands?: string[] | undefined;
322
+ activePanel?: number | undefined;
323
+ } | undefined;
324
+ meta?: {
325
+ image?: string | undefined;
326
+ description?: string | undefined;
327
+ title?: string | undefined;
328
+ } | undefined;
329
+ previews?: boolean | (string | number | [number, string] | [number, string, string] | {
330
+ title: string;
331
+ port: number;
332
+ pathname?: string | undefined;
333
+ })[] | undefined;
334
+ autoReload?: boolean | undefined;
335
+ filesystem?: {
336
+ watch?: boolean | string[] | undefined;
337
+ } | undefined;
338
+ template?: string | undefined;
339
+ focus?: string | undefined;
340
+ editor?: boolean | {
341
+ fileTree?: boolean | {
342
+ allowEdits: string | boolean | string[];
343
+ } | undefined;
344
+ } | undefined;
345
+ i18n?: {
346
+ partTemplate?: string | undefined;
347
+ editPageText?: string | undefined;
348
+ webcontainerLinkText?: string | undefined;
349
+ startWebContainerText?: string | undefined;
350
+ noPreviewNorStepsText?: string | undefined;
351
+ filesTitleText?: string | undefined;
352
+ fileTreeCreateFileText?: string | undefined;
353
+ fileTreeCreateFolderText?: string | undefined;
354
+ fileTreeActionNotAllowedText?: string | undefined;
355
+ fileTreeFileExistsAlreadyText?: string | undefined;
356
+ fileTreeAllowedPatternsText?: string | undefined;
357
+ confirmationText?: string | undefined;
358
+ prepareEnvironmentTitleText?: string | undefined;
359
+ defaultPreviewTitleText?: string | undefined;
360
+ reloadPreviewTitle?: string | undefined;
361
+ toggleTerminalButtonText?: string | undefined;
362
+ solveButtonText?: string | undefined;
363
+ resetButtonText?: string | undefined;
364
+ } | undefined;
365
+ editPageLink?: string | boolean | undefined;
366
+ openInStackBlitz?: boolean | {
367
+ projectTitle?: string | undefined;
368
+ projectDescription?: string | undefined;
369
+ projectTemplate?: "html" | "node" | "angular-cli" | "create-react-app" | "javascript" | "polymer" | "typescript" | "vue" | undefined;
370
+ } | undefined;
371
+ downloadAsZip?: boolean | {
372
+ filename: string;
373
+ } | undefined;
374
+ lessons?: string[] | undefined;
375
+ logoLink?: string | undefined;
376
+ parts?: string[] | undefined;
377
+ }>;
378
+ export type TutorialSchema = z.infer<typeof tutorialSchema>;
@@ -0,0 +1,14 @@
1
+ import { z } from 'zod';
2
+ import { webcontainerSchema } from './common.js';
3
+ export const tutorialSchema = webcontainerSchema.extend({
4
+ type: z.literal('tutorial'),
5
+ logoLink: z.string().optional(),
6
+ parts: z
7
+ .array(z.string())
8
+ .optional()
9
+ .describe('The list of parts in this tutorial. The order of this array defines the order of the parts. If not specified a folder-based numbering system is used instead.'),
10
+ lessons: z
11
+ .array(z.string())
12
+ .optional()
13
+ .describe('The list of lessons in this tutorial. The order of this array defines the order of the lessons. If not specified a folder-based numbering system is used instead.'),
14
+ });
@@ -0,0 +1 @@
1
+ export declare function interpolateString(template: string, variables: Record<string, string | number>): string;
@@ -0,0 +1,6 @@
1
+ export function interpolateString(template, variables) {
2
+ for (const [variable, value] of Object.entries(variables)) {
3
+ template = template.replace(`\${${variable}}`, value.toString());
4
+ }
5
+ return template;
6
+ }
package/package.json ADDED
@@ -0,0 +1,39 @@
1
+ {
2
+ "name": "@tutorialkit-rb/types",
3
+ "version": "1.5.2-rb.0.1.0",
4
+ "description": "Types for TutorialKit",
5
+ "author": "StackBlitz Inc.",
6
+ "type": "module",
7
+ "bugs": "https://github.com/stackblitz/tutorialkit/issues",
8
+ "homepage": "https://github.com/stackblitz/tutorialkit",
9
+ "license": "MIT",
10
+ "repository": {
11
+ "type": "git",
12
+ "url": "https://github.com/Bakaface/tutorialkit.rb",
13
+ "directory": "packages/types"
14
+ },
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": "./dist/index.js"
18
+ },
19
+ "files": [
20
+ "dist"
21
+ ],
22
+ "scripts": {
23
+ "build": "tsc -b tsconfig.build.json",
24
+ "dev": "pnpm run build --watch --preserveWatchOutput",
25
+ "test": "vitest"
26
+ },
27
+ "dependencies": {
28
+ "zod": "3.23.8"
29
+ },
30
+ "devDependencies": {
31
+ "typescript": "^5.4.5",
32
+ "vitest": "^3.0.5"
33
+ },
34
+ "keywords": [
35
+ "ruby",
36
+ "rails",
37
+ "wasm"
38
+ ]
39
+ }