@epic-web/workshop-utils 6.45.7 → 6.47.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/README.md +61 -2
- package/dist/esm/cache.server.d.ts +30 -0
- package/dist/esm/cache.server.d.ts.map +1 -1
- package/dist/esm/cache.server.js +67 -1
- package/dist/esm/cache.server.js.map +1 -1
- package/dist/esm/config.server.d.ts +118 -23
- package/dist/esm/config.server.d.ts.map +1 -1
- package/dist/esm/config.server.js +46 -11
- package/dist/esm/config.server.js.map +1 -1
- package/dist/esm/config.test.d.ts +2 -0
- package/dist/esm/config.test.d.ts.map +1 -0
- package/dist/esm/config.test.js +77 -0
- package/dist/esm/config.test.js.map +1 -0
- package/dist/esm/db.server.d.ts +8 -35
- package/dist/esm/db.server.d.ts.map +1 -1
- package/dist/esm/db.server.js +22 -61
- package/dist/esm/db.server.js.map +1 -1
- package/dist/esm/epic-api.server.d.ts +3 -1
- package/dist/esm/epic-api.server.d.ts.map +1 -1
- package/dist/esm/epic-api.server.js +14 -4
- package/dist/esm/epic-api.server.js.map +1 -1
- package/package.json +1 -1
|
@@ -24,8 +24,8 @@ export declare const StackBlitzConfigSchema: z.ZodObject<{
|
|
|
24
24
|
terminalHeight?: string | undefined;
|
|
25
25
|
hideNavigation?: string | undefined;
|
|
26
26
|
}>;
|
|
27
|
-
declare const
|
|
28
|
-
title: z.ZodString
|
|
27
|
+
declare const PartialWorkshopConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
28
|
+
title: z.ZodOptional<z.ZodString>;
|
|
29
29
|
subtitle: z.ZodOptional<z.ZodString>;
|
|
30
30
|
instructor: z.ZodOptional<z.ZodObject<{
|
|
31
31
|
name: z.ZodOptional<z.ZodString>;
|
|
@@ -43,8 +43,93 @@ declare const WorkshopConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
43
43
|
𝕏?: string | undefined;
|
|
44
44
|
xHandle?: string | undefined;
|
|
45
45
|
}>>;
|
|
46
|
-
|
|
47
|
-
|
|
46
|
+
product: z.ZodOptional<z.ZodObject<{
|
|
47
|
+
host: z.ZodOptional<z.ZodString>;
|
|
48
|
+
displayName: z.ZodOptional<z.ZodString>;
|
|
49
|
+
displayNameShort: z.ZodOptional<z.ZodString>;
|
|
50
|
+
slug: z.ZodOptional<z.ZodString>;
|
|
51
|
+
}, "strip", z.ZodTypeAny, {
|
|
52
|
+
host?: string | undefined;
|
|
53
|
+
displayName?: string | undefined;
|
|
54
|
+
displayNameShort?: string | undefined;
|
|
55
|
+
slug?: string | undefined;
|
|
56
|
+
}, {
|
|
57
|
+
host?: string | undefined;
|
|
58
|
+
displayName?: string | undefined;
|
|
59
|
+
displayNameShort?: string | undefined;
|
|
60
|
+
slug?: string | undefined;
|
|
61
|
+
}>>;
|
|
62
|
+
}, "strip", z.ZodTypeAny, {
|
|
63
|
+
title?: string | undefined;
|
|
64
|
+
subtitle?: string | undefined;
|
|
65
|
+
instructor?: {
|
|
66
|
+
name?: string | undefined;
|
|
67
|
+
avatar?: string | undefined;
|
|
68
|
+
𝕏?: string | undefined;
|
|
69
|
+
xHandle?: string | undefined;
|
|
70
|
+
} | undefined;
|
|
71
|
+
product?: {
|
|
72
|
+
host?: string | undefined;
|
|
73
|
+
displayName?: string | undefined;
|
|
74
|
+
displayNameShort?: string | undefined;
|
|
75
|
+
slug?: string | undefined;
|
|
76
|
+
} | undefined;
|
|
77
|
+
}, {
|
|
78
|
+
title?: string | undefined;
|
|
79
|
+
subtitle?: string | undefined;
|
|
80
|
+
instructor?: {
|
|
81
|
+
name?: string | undefined;
|
|
82
|
+
avatar?: string | undefined;
|
|
83
|
+
𝕏?: string | undefined;
|
|
84
|
+
xHandle?: string | undefined;
|
|
85
|
+
} | undefined;
|
|
86
|
+
product?: {
|
|
87
|
+
host?: string | undefined;
|
|
88
|
+
displayName?: string | undefined;
|
|
89
|
+
displayNameShort?: string | undefined;
|
|
90
|
+
slug?: string | undefined;
|
|
91
|
+
} | undefined;
|
|
92
|
+
}>, {
|
|
93
|
+
title?: string | undefined;
|
|
94
|
+
subtitle?: string | undefined;
|
|
95
|
+
instructor?: {
|
|
96
|
+
name?: string | undefined;
|
|
97
|
+
avatar?: string | undefined;
|
|
98
|
+
𝕏?: string | undefined;
|
|
99
|
+
xHandle?: string | undefined;
|
|
100
|
+
} | undefined;
|
|
101
|
+
product?: {
|
|
102
|
+
host?: string | undefined;
|
|
103
|
+
displayName?: string | undefined;
|
|
104
|
+
displayNameShort?: string | undefined;
|
|
105
|
+
slug?: string | undefined;
|
|
106
|
+
} | undefined;
|
|
107
|
+
} & {
|
|
108
|
+
product: {
|
|
109
|
+
host: string | undefined;
|
|
110
|
+
displayName: string | undefined;
|
|
111
|
+
displayNameShort: string | undefined;
|
|
112
|
+
slug: string | undefined;
|
|
113
|
+
};
|
|
114
|
+
}, {
|
|
115
|
+
title?: string | undefined;
|
|
116
|
+
subtitle?: string | undefined;
|
|
117
|
+
instructor?: {
|
|
118
|
+
name?: string | undefined;
|
|
119
|
+
avatar?: string | undefined;
|
|
120
|
+
𝕏?: string | undefined;
|
|
121
|
+
xHandle?: string | undefined;
|
|
122
|
+
} | undefined;
|
|
123
|
+
product?: {
|
|
124
|
+
host?: string | undefined;
|
|
125
|
+
displayName?: string | undefined;
|
|
126
|
+
displayNameShort?: string | undefined;
|
|
127
|
+
slug?: string | undefined;
|
|
128
|
+
} | undefined;
|
|
129
|
+
}>;
|
|
130
|
+
export type PartialWorkshopConfig = z.infer<typeof PartialWorkshopConfigSchema>;
|
|
131
|
+
declare const WorkshopConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
132
|
+
title: z.ZodString;
|
|
48
133
|
subdomain: z.ZodOptional<z.ZodString>;
|
|
49
134
|
product: z.ZodDefault<z.ZodObject<{
|
|
50
135
|
host: z.ZodDefault<z.ZodString>;
|
|
@@ -66,12 +151,11 @@ declare const WorkshopConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
66
151
|
host?: string | undefined;
|
|
67
152
|
displayName?: string | undefined;
|
|
68
153
|
displayNameShort?: string | undefined;
|
|
69
|
-
logo?: string | undefined;
|
|
70
154
|
slug?: string | undefined;
|
|
155
|
+
logo?: string | undefined;
|
|
71
156
|
discordChannelId?: string | undefined;
|
|
72
157
|
discordTags?: string[] | undefined;
|
|
73
158
|
}>>;
|
|
74
|
-
onboardingVideo: z.ZodEffects<z.ZodDefault<z.ZodUnion<[z.ZodString, z.ZodArray<z.ZodString, "many">]>>, string[], string | string[] | undefined>;
|
|
75
159
|
githubRepo: z.ZodEffects<z.ZodString, string, string>;
|
|
76
160
|
githubRoot: z.ZodEffects<z.ZodString, string, string>;
|
|
77
161
|
stackBlitzConfig: z.ZodOptional<z.ZodObject<{
|
|
@@ -147,6 +231,23 @@ declare const WorkshopConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
147
231
|
link?: string | undefined;
|
|
148
232
|
}>, "many">>>;
|
|
149
233
|
sidecarProcesses: z.ZodDefault<z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>>;
|
|
234
|
+
subtitle: z.ZodOptional<z.ZodString>;
|
|
235
|
+
instructor: z.ZodOptional<z.ZodObject<{
|
|
236
|
+
name: z.ZodOptional<z.ZodString>;
|
|
237
|
+
avatar: z.ZodOptional<z.ZodString>;
|
|
238
|
+
𝕏: z.ZodOptional<z.ZodString>;
|
|
239
|
+
xHandle: z.ZodOptional<z.ZodString>;
|
|
240
|
+
}, "strip", z.ZodTypeAny, {
|
|
241
|
+
name?: string | undefined;
|
|
242
|
+
avatar?: string | undefined;
|
|
243
|
+
𝕏?: string | undefined;
|
|
244
|
+
xHandle?: string | undefined;
|
|
245
|
+
}, {
|
|
246
|
+
name?: string | undefined;
|
|
247
|
+
avatar?: string | undefined;
|
|
248
|
+
𝕏?: string | undefined;
|
|
249
|
+
xHandle?: string | undefined;
|
|
250
|
+
}>>;
|
|
150
251
|
}, "strip", z.ZodTypeAny, {
|
|
151
252
|
githubRepo: string;
|
|
152
253
|
githubRoot: string;
|
|
@@ -160,7 +261,6 @@ declare const WorkshopConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
160
261
|
discordChannelId?: string | undefined;
|
|
161
262
|
discordTags?: string[] | undefined;
|
|
162
263
|
};
|
|
163
|
-
onboardingVideo: string[];
|
|
164
264
|
forms: {
|
|
165
265
|
workshop: string;
|
|
166
266
|
exercise: string;
|
|
@@ -185,8 +285,6 @@ declare const WorkshopConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
185
285
|
𝕏?: string | undefined;
|
|
186
286
|
xHandle?: string | undefined;
|
|
187
287
|
} | undefined;
|
|
188
|
-
epicWorkshopHost?: string | undefined;
|
|
189
|
-
epicWorkshopSlug?: string | undefined;
|
|
190
288
|
subdomain?: string | undefined;
|
|
191
289
|
stackBlitzConfig?: {
|
|
192
290
|
title?: string | undefined;
|
|
@@ -211,19 +309,16 @@ declare const WorkshopConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
211
309
|
𝕏?: string | undefined;
|
|
212
310
|
xHandle?: string | undefined;
|
|
213
311
|
} | undefined;
|
|
214
|
-
epicWorkshopHost?: string | undefined;
|
|
215
|
-
epicWorkshopSlug?: string | undefined;
|
|
216
|
-
subdomain?: string | undefined;
|
|
217
312
|
product?: {
|
|
218
313
|
host?: string | undefined;
|
|
219
314
|
displayName?: string | undefined;
|
|
220
315
|
displayNameShort?: string | undefined;
|
|
221
|
-
logo?: string | undefined;
|
|
222
316
|
slug?: string | undefined;
|
|
317
|
+
logo?: string | undefined;
|
|
223
318
|
discordChannelId?: string | undefined;
|
|
224
319
|
discordTags?: string[] | undefined;
|
|
225
320
|
} | undefined;
|
|
226
|
-
|
|
321
|
+
subdomain?: string | undefined;
|
|
227
322
|
stackBlitzConfig?: {
|
|
228
323
|
title?: string | undefined;
|
|
229
324
|
startScript?: string | undefined;
|
|
@@ -257,16 +352,15 @@ declare const WorkshopConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
257
352
|
product: {
|
|
258
353
|
displayNameShort: string;
|
|
259
354
|
host: string;
|
|
260
|
-
slug: string | undefined;
|
|
261
355
|
displayName: string;
|
|
262
356
|
logo: string;
|
|
357
|
+
slug?: string | undefined;
|
|
263
358
|
discordChannelId?: string | undefined;
|
|
264
359
|
discordTags?: string[] | undefined;
|
|
265
360
|
};
|
|
266
361
|
githubRepo: string;
|
|
267
362
|
githubRoot: string;
|
|
268
363
|
title: string;
|
|
269
|
-
onboardingVideo: string[];
|
|
270
364
|
forms: {
|
|
271
365
|
workshop: string;
|
|
272
366
|
exercise: string;
|
|
@@ -291,8 +385,6 @@ declare const WorkshopConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
291
385
|
𝕏?: string | undefined;
|
|
292
386
|
xHandle?: string | undefined;
|
|
293
387
|
} | undefined;
|
|
294
|
-
epicWorkshopHost?: string | undefined;
|
|
295
|
-
epicWorkshopSlug?: string | undefined;
|
|
296
388
|
subdomain?: string | undefined;
|
|
297
389
|
stackBlitzConfig?: {
|
|
298
390
|
title?: string | undefined;
|
|
@@ -317,19 +409,16 @@ declare const WorkshopConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
317
409
|
𝕏?: string | undefined;
|
|
318
410
|
xHandle?: string | undefined;
|
|
319
411
|
} | undefined;
|
|
320
|
-
epicWorkshopHost?: string | undefined;
|
|
321
|
-
epicWorkshopSlug?: string | undefined;
|
|
322
|
-
subdomain?: string | undefined;
|
|
323
412
|
product?: {
|
|
324
413
|
host?: string | undefined;
|
|
325
414
|
displayName?: string | undefined;
|
|
326
415
|
displayNameShort?: string | undefined;
|
|
327
|
-
logo?: string | undefined;
|
|
328
416
|
slug?: string | undefined;
|
|
417
|
+
logo?: string | undefined;
|
|
329
418
|
discordChannelId?: string | undefined;
|
|
330
419
|
discordTags?: string[] | undefined;
|
|
331
420
|
} | undefined;
|
|
332
|
-
|
|
421
|
+
subdomain?: string | undefined;
|
|
333
422
|
stackBlitzConfig?: {
|
|
334
423
|
title?: string | undefined;
|
|
335
424
|
startScript?: string | undefined;
|
|
@@ -361,6 +450,12 @@ declare const WorkshopConfigSchema: z.ZodEffects<z.ZodObject<{
|
|
|
361
450
|
sidecarProcesses?: Record<string, string> | undefined;
|
|
362
451
|
}>;
|
|
363
452
|
export type WorkshopConfig = z.infer<typeof WorkshopConfigSchema>;
|
|
453
|
+
/**
|
|
454
|
+
* Parse epicshop config from an arbitrary package.json object.
|
|
455
|
+
* Unlike getWorkshopConfig(), this doesn't require EPICSHOP_CONTEXT_CWD
|
|
456
|
+
* and returns partial/optional config suitable for external repos.
|
|
457
|
+
*/
|
|
458
|
+
export declare function parseEpicshopConfig(packageJson: unknown): PartialWorkshopConfig | null;
|
|
364
459
|
/**
|
|
365
460
|
* This used to support subdomains on localhost, but that caused too many issues.
|
|
366
461
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.server.d.ts","sourceRoot":"","sources":["../../src/config.server.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;EAcjC,CAAA;
|
|
1
|
+
{"version":3,"file":"config.server.d.ts","sourceRoot":"","sources":["../../src/config.server.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAMvB,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;;;;;;;;;;EAcjC,CAAA;AAsDF,QAAA,MAAM,2BAA2B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;aAnBvB;QACR,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;QACxB,WAAW,EAAE,MAAM,GAAG,SAAS,CAAA;QAC/B,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAA;QACpC,IAAI,EAAE,MAAM,GAAG,SAAS,CAAA;KACxB;;;;;;;;;;;;;;;;EAgBiC,CAAA;AAEnC,MAAM,MAAM,qBAAqB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,2BAA2B,CAAC,CAAA;AAG/E,QAAA,MAAM,oBAAoB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAwEvB,CAAA;AAEH,MAAM,MAAM,cAAc,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,oBAAoB,CAAC,CAAA;AAEjE;;;;GAIG;AACH,wBAAgB,mBAAmB,CAClC,WAAW,EAAE,OAAO,GAClB,qBAAqB,GAAG,IAAI,CAgB9B;AA2BD;;GAEG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,UAE1C;AAED,wBAAgB,iBAAiB,IAAI,cAAc,CAiClD;AAED,wBAAsB,gBAAgB,CAAC,EACtC,QAAQ,EACR,KAAK,EACL,IAAI,GACJ,EAAE;IACF,QAAQ,EAAE,MAAM,CAAA;IAChB,KAAK,EAAE,MAAM,CAAA;IACb,IAAI,EAAE,MAAM,CAAA;CACZ,0BA0EA;AAED,wBAAsB,YAAY,CAAC,QAAQ,EAAE,MAAM;;;;;;;;;;;;;;;;;;GA0ElD"}
|
|
@@ -26,14 +26,38 @@ const InstructorSchema = z.object({
|
|
|
26
26
|
𝕏: z.string().optional(),
|
|
27
27
|
xHandle: z.string().optional(),
|
|
28
28
|
});
|
|
29
|
+
const BaseProductSchema = z.object({
|
|
30
|
+
host: z.string().optional(),
|
|
31
|
+
displayName: z.string().optional(),
|
|
32
|
+
displayNameShort: z.string().optional(),
|
|
33
|
+
slug: z.string().optional(),
|
|
34
|
+
});
|
|
35
|
+
const BaseWorkshopConfigFields = {
|
|
36
|
+
title: z.string().optional(),
|
|
37
|
+
subtitle: z.string().optional(),
|
|
38
|
+
instructor: InstructorSchema.optional(),
|
|
39
|
+
product: BaseProductSchema.optional(),
|
|
40
|
+
};
|
|
41
|
+
function transformProductFields(data) {
|
|
42
|
+
const product = data.product ?? {};
|
|
43
|
+
return {
|
|
44
|
+
...data,
|
|
45
|
+
product: {
|
|
46
|
+
host: product.host,
|
|
47
|
+
displayName: product.displayName,
|
|
48
|
+
displayNameShort: product.displayNameShort ?? product.displayName,
|
|
49
|
+
slug: product.slug,
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
const PartialWorkshopConfigSchema = z
|
|
54
|
+
.object(BaseWorkshopConfigFields)
|
|
55
|
+
.transform(transformProductFields);
|
|
29
56
|
// most defaults are for backwards compatibility
|
|
30
57
|
const WorkshopConfigSchema = z
|
|
31
58
|
.object({
|
|
59
|
+
...BaseWorkshopConfigFields,
|
|
32
60
|
title: z.string(),
|
|
33
|
-
subtitle: z.string().optional(),
|
|
34
|
-
instructor: InstructorSchema.optional(),
|
|
35
|
-
epicWorkshopHost: z.string().optional(),
|
|
36
|
-
epicWorkshopSlug: z.string().optional(),
|
|
37
61
|
subdomain: z.string().optional(),
|
|
38
62
|
product: z
|
|
39
63
|
.object({
|
|
@@ -46,10 +70,6 @@ const WorkshopConfigSchema = z
|
|
|
46
70
|
discordTags: z.array(z.string()).optional(),
|
|
47
71
|
})
|
|
48
72
|
.default({}),
|
|
49
|
-
onboardingVideo: z
|
|
50
|
-
.union([z.string(), z.array(z.string())])
|
|
51
|
-
.default('https://www.epicweb.dev/tips/get-started-with-the-epic-workshop-app')
|
|
52
|
-
.transform((value) => (Array.isArray(value) ? value : [value])),
|
|
53
73
|
githubRepo: z
|
|
54
74
|
.string()
|
|
55
75
|
.transform((githubRepo) => githubRepo ?? getEnv().EPICSHOP_GITHUB_REPO),
|
|
@@ -97,12 +117,27 @@ const WorkshopConfigSchema = z
|
|
|
97
117
|
product: {
|
|
98
118
|
...data.product,
|
|
99
119
|
displayNameShort: data.product.displayNameShort ?? data.product.displayName,
|
|
100
|
-
// for backwards compatibility
|
|
101
|
-
host: data.product.host ?? data.epicWorkshopHost,
|
|
102
|
-
slug: data.product.slug ?? data.epicWorkshopSlug,
|
|
103
120
|
},
|
|
104
121
|
};
|
|
105
122
|
});
|
|
123
|
+
/**
|
|
124
|
+
* Parse epicshop config from an arbitrary package.json object.
|
|
125
|
+
* Unlike getWorkshopConfig(), this doesn't require EPICSHOP_CONTEXT_CWD
|
|
126
|
+
* and returns partial/optional config suitable for external repos.
|
|
127
|
+
*/
|
|
128
|
+
export function parseEpicshopConfig(packageJson) {
|
|
129
|
+
if (typeof packageJson !== 'object' ||
|
|
130
|
+
packageJson === null ||
|
|
131
|
+
!('epicshop' in packageJson)) {
|
|
132
|
+
return null;
|
|
133
|
+
}
|
|
134
|
+
const epicshopConfig = packageJson.epicshop;
|
|
135
|
+
const result = PartialWorkshopConfigSchema.safeParse(epicshopConfig);
|
|
136
|
+
if (!result.success) {
|
|
137
|
+
return null;
|
|
138
|
+
}
|
|
139
|
+
return result.data;
|
|
140
|
+
}
|
|
106
141
|
let configCache = null;
|
|
107
142
|
// Utility to read and parse the root package.json
|
|
108
143
|
function readRootPkgJson() {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.server.js","sourceRoot":"","sources":["../../src/config.server.ts"],"names":[],"mappings":"AAAA,8DAA8D;AAC9D,OAAO,EAAE,MAAM,EAAE,MAAM,eAAe,CAAA;AAEtC,OAAO,EAAE,MAAM,SAAS,CAAA;AACxB,OAAO,IAAI,MAAM,WAAW,CAAA;AAC5B,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AACvB,OAAO,EAAE,uB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;YACpC,MAAM,IAAI,KAAK,CACd,iCAAiC,QAAQ,MAAM,aAAa,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,CACzE,CAAA;QACF,CAAC;QACD,MAAM,KAAK,CAAA;IACZ,CAAC;AACF,CAAC","sourcesContent":["// eslint-disable-next-line import/order -- this must be first\nimport { getEnv } from './init-env.js'\n\nimport fs from 'node:fs'\nimport path from 'node:path'\nimport { z } from 'zod'\nimport { handleGitHubRepoAndRoot } from './utils.js'\n\nconst getRootPkgJsonPath = () =>\n\tpath.join(getEnv().EPICSHOP_CONTEXT_CWD, 'package.json')\n\nexport const StackBlitzConfigSchema = z.object({\n\t// we default this to `${exerciseTitle} (${type})`\n\ttitle: z.string().optional(),\n\t// stackblitz defaults this to dev automatically\n\tstartScript: z.string().optional(),\n\t// if no value is provided, then stackblitz defaults this to whatever\n\t// looks best based on the width of the screen\n\tview: z\n\t\t.union([z.literal('editor'), z.literal('preview'), z.literal('both')])\n\t\t.optional(),\n\tfile: z.string().optional(),\n\thidedevtools: z.string().optional(),\n\tterminalHeight: z.string().optional(),\n\thideNavigation: z.string().optional(),\n})\n\nconst InstructorSchema = z.object({\n\tname: z.string().optional(),\n\tavatar: z.string().optional(),\n\t𝕏: z.string().optional(),\n\txHandle: z.string().optional(),\n})\n\n// most defaults are for backwards compatibility\nconst WorkshopConfigSchema = z\n\t.object({\n\t\ttitle: z.string(),\n\t\tsubtitle: z.string().optional(),\n\t\tinstructor: InstructorSchema.optional(),\n\t\tepicWorkshopHost: z.string().optional(),\n\t\tepicWorkshopSlug: z.string().optional(),\n\t\tsubdomain: z.string().optional(),\n\t\tproduct: z\n\t\t\t.object({\n\t\t\t\thost: z.string().default('www.epicweb.dev'),\n\t\t\t\tdisplayName: z.string().default('EpicWeb.dev'),\n\t\t\t\tdisplayNameShort: z.string().default('Epic Web'),\n\t\t\t\tlogo: z.string().default('/logo.svg'),\n\t\t\t\tslug: z.string().optional(),\n\t\t\t\tdiscordChannelId: z.string().optional(),\n\t\t\t\tdiscordTags: z.array(z.string()).optional(),\n\t\t\t})\n\t\t\t.default({}),\n\t\tonboardingVideo: z\n\t\t\t.union([z.string(), z.array(z.string())])\n\t\t\t.default(\n\t\t\t\t'https://www.epicweb.dev/tips/get-started-with-the-epic-workshop-app',\n\t\t\t)\n\t\t\t.transform((value) => (Array.isArray(value) ? value : [value])),\n\t\tgithubRepo: z\n\t\t\t.string()\n\t\t\t.transform((githubRepo) => githubRepo ?? getEnv().EPICSHOP_GITHUB_REPO),\n\t\tgithubRoot: z\n\t\t\t.string()\n\t\t\t.transform((githubRoot) => githubRoot ?? getEnv().EPICSHOP_GITHUB_ROOT),\n\t\tstackBlitzConfig: StackBlitzConfigSchema.optional(),\n\t\tforms: z\n\t\t\t.object({\n\t\t\t\tworkshop: z\n\t\t\t\t\t.string()\n\t\t\t\t\t.default(\n\t\t\t\t\t\t'https://docs.google.com/forms/d/e/1FAIpQLSdRmj9p8-5zyoqRzxp3UpqSbC3aFkweXvvJIKes0a5s894gzg/viewform?hl=en&embedded=true&entry.2123647600={workshopTitle}',\n\t\t\t\t\t),\n\t\t\t\texercise: z\n\t\t\t\t\t.string()\n\t\t\t\t\t.default(\n\t\t\t\t\t\t'https://docs.google.com/forms/d/e/1FAIpQLSf3o9xyjQepTlOTH5Z7ZwkeSTdXh6YWI_RGc9KiyD3oUN0p6w/viewform?hl=en&embedded=true&entry.1836176234={workshopTitle}&entry.428900931={exerciseTitle}',\n\t\t\t\t\t),\n\t\t\t})\n\t\t\t.default({}),\n\t\ttestTab: z\n\t\t\t.object({\n\t\t\t\tenabled: z.boolean().default(true),\n\t\t\t})\n\t\t\t.default({}),\n\t\tscripts: z\n\t\t\t.object({\n\t\t\t\tpostupdate: z.string().optional(),\n\t\t\t})\n\t\t\t.optional(),\n\t\tinitialRoute: z.string().optional().default('/'),\n\t\tnotifications: z\n\t\t\t.array(\n\t\t\t\tz.object({\n\t\t\t\t\tid: z.string(),\n\t\t\t\t\ttitle: z.string(),\n\t\t\t\t\tmessage: z.string(),\n\t\t\t\t\tlink: z.string().optional(),\n\t\t\t\t\ttype: z.enum(['info', 'warning', 'danger']),\n\t\t\t\t\texpiresAt: z.date().nullable(),\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.optional()\n\t\t\t.default([]),\n\t\tsidecarProcesses: z.record(z.string(), z.string()).optional().default({}),\n\t})\n\t.transform((data) => {\n\t\treturn {\n\t\t\t...data,\n\t\t\tproduct: {\n\t\t\t\t...data.product,\n\t\t\t\tdisplayNameShort:\n\t\t\t\t\tdata.product.displayNameShort ?? data.product.displayName,\n\t\t\t\t// for backwards compatibility\n\t\t\t\thost: data.product.host ?? data.epicWorkshopHost,\n\t\t\t\tslug: data.product.slug ?? data.epicWorkshopSlug,\n\t\t\t},\n\t\t}\n\t})\n\nexport type WorkshopConfig = z.infer<typeof WorkshopConfigSchema>\n\nlet configCache: WorkshopConfig | null = null\n\n// Utility to read and parse the root package.json\nfunction readRootPkgJson(): any {\n\tconst packageJsonPath = getRootPkgJsonPath()\n\ttry {\n\t\tconst packageJsonContent = fs.readFileSync(packageJsonPath, 'utf8')\n\t\treturn JSON.parse(packageJsonContent)\n\t} catch (error) {\n\t\tconsole.error(`Error reading or parsing package.json:`, error)\n\t\tif (error instanceof Error && error.message.includes('ENOENT')) {\n\t\t\tthrow new Error(\n\t\t\t\t`package.json not found at ${packageJsonPath}. Please ensure you're running the command from the correct directory.`,\n\t\t\t)\n\t\t} else if (error instanceof SyntaxError) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid JSON in package.json at ${packageJsonPath}. Please check the file for syntax errors.`,\n\t\t\t)\n\t\t}\n\t\tthrow new Error(\n\t\t\t`Could not find and parse package.json at ${packageJsonPath}`,\n\t\t)\n\t}\n}\n\n/**\n * This used to support subdomains on localhost, but that caused too many issues.\n */\nexport function getWorkshopUrl(port: number) {\n\treturn `http://localhost:${port}`\n}\n\nexport function getWorkshopConfig(): WorkshopConfig {\n\t// If config is cached, use it\n\tif (configCache) return configCache\n\n\tconst packageJson = readRootPkgJson()\n\n\tconst epicshopConfig = packageJson.epicshop || {}\n\n\t// Set githubRepo and githubRoot before parsing\n\tconst { githubRepo, githubRoot } = handleGitHubRepoAndRoot({\n\t\tgithubRepo: epicshopConfig.githubRepo,\n\t\tgithubRoot: epicshopConfig.githubRoot,\n\t})\n\tepicshopConfig.githubRepo = githubRepo\n\tepicshopConfig.githubRoot = githubRoot\n\n\ttry {\n\t\tconst parsedConfig = WorkshopConfigSchema.parse(epicshopConfig)\n\t\tconfigCache = parsedConfig\n\n\t\treturn parsedConfig\n\t} catch (error) {\n\t\tif (error instanceof z.ZodError) {\n\t\t\tconst flattenedErrors = error.flatten()\n\t\t\tconst errorMessages = Object.entries(flattenedErrors.fieldErrors)\n\t\t\t\t.map(([field, errors]) => `${field}: ${errors?.join(', ')}`)\n\t\t\t\t.concat(flattenedErrors.formErrors)\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid epicshop configuration in ${getRootPkgJsonPath()}:\\n${errorMessages.join('\\n')}`,\n\t\t\t)\n\t\t}\n\t\tthrow error\n\t}\n}\n\nexport async function getStackBlitzUrl({\n\tfullPath,\n\ttitle,\n\ttype,\n}: {\n\tfullPath: string\n\ttitle: string\n\ttype: string\n}) {\n\tconst workshopConfig = getWorkshopConfig()\n\tconst appConfig = await getAppConfig(fullPath)\n\n\tif (appConfig.stackBlitzConfig === null) return null\n\n\tlet githubRootUrlString = workshopConfig.githubRoot\n\n\tconst githubRootUrl = new URL(\n\t\tgithubRootUrlString.replace(/\\/blob\\//, '/tree/'),\n\t)\n\n\tconst githubPart = githubRootUrl.pathname\n\n\t// Check if package.json exists to determine if this is a simple exercise\n\tconst packageJsonPath = path.join(fullPath, 'package.json')\n\tconst packageJsonExists = await fs.promises\n\t\t.access(packageJsonPath, fs.constants.F_OK)\n\t\t.then(() => true)\n\t\t.catch(() => false)\n\n\tlet stackBlitzConfig = {\n\t\t...appConfig.stackBlitzConfig,\n\t\ttitle: appConfig.stackBlitzConfig?.title ?? `${title} (${type})`,\n\t}\n\n\t// For simple exercises without package.json, configure StackBlitz to show only editor\n\tif (!packageJsonExists) {\n\t\t// Find the first existing file from the priority list\n\t\tconst priorityFiles = [\n\t\t\t'index.html',\n\t\t\t'index.tsx',\n\t\t\t'index.ts',\n\t\t\t'index.jsx',\n\t\t\t'index.js',\n\t\t\t'README.mdx',\n\t\t\t'README.md',\n\t\t]\n\n\t\tlet defaultFile: string | null = null\n\t\tfor (const fileName of priorityFiles) {\n\t\t\tconst filePath = path.join(fullPath, fileName)\n\t\t\ttry {\n\t\t\t\tawait fs.promises.access(filePath, fs.constants.F_OK)\n\t\t\t\tdefaultFile = fileName\n\t\t\t\tbreak\n\t\t\t} catch {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tstackBlitzConfig = {\n\t\t\t...stackBlitzConfig,\n\t\t\tview: 'editor', // Show only editor, no preview or terminal\n\t\t\thidedevtools: '1', // Hide the console/devtools\n\t\t\tterminalHeight: '0', // Hide the terminal completely\n\t\t\thideNavigation: '1', // Hide the preview's URL bar\n\t\t\t...(defaultFile && { file: defaultFile }), // Set default file if found\n\t\t}\n\t}\n\n\tconst params = new URLSearchParams(stackBlitzConfig as Record<string, string>)\n\n\tconst relativePath = fullPath.replace(\n\t\t`${getEnv().EPICSHOP_CONTEXT_CWD}${path.sep}`,\n\t\t'',\n\t)\n\n\tconst stackBlitzUrl = new URL(\n\t\t`/github${githubPart}/${relativePath}?${params}`,\n\t\t'https://stackblitz.com',\n\t)\n\n\treturn stackBlitzUrl.toString()\n}\n\nexport async function getAppConfig(fullPath: string) {\n\tconst workshopConfig = getWorkshopConfig()\n\n\tlet epicshopConfig: Record<string, any> = {}\n\tlet scripts: Record<string, string> = {}\n\n\tconst packageJsonPath = path.join(fullPath, 'package.json')\n\tconst packageJsonExists = await fs.promises\n\t\t.access(packageJsonPath, fs.constants.F_OK)\n\t\t.then(() => true)\n\t\t.catch(() => false)\n\n\tif (packageJsonExists) {\n\t\tconst pkg = JSON.parse(\n\t\t\tawait fs.promises.readFile(path.join(fullPath, 'package.json'), 'utf8'),\n\t\t) as any\n\t\tepicshopConfig = pkg.epicshop ?? {}\n\t\tscripts = pkg.scripts ?? {}\n\t}\n\n\tconst AppConfigSchema = z.object({\n\t\tstackBlitzConfig: StackBlitzConfigSchema.nullable()\n\t\t\t.optional()\n\t\t\t.transform((appStackBlitzConfig) => {\n\t\t\t\tif (appStackBlitzConfig === null) return null\n\n\t\t\t\treturn {\n\t\t\t\t\t...workshopConfig.stackBlitzConfig,\n\t\t\t\t\t...appStackBlitzConfig,\n\t\t\t\t}\n\t\t\t}),\n\t\ttestTab: z\n\t\t\t.object({\n\t\t\t\tenabled: z\n\t\t\t\t\t.boolean()\n\t\t\t\t\t.optional()\n\t\t\t\t\t.default(workshopConfig.testTab?.enabled ?? true),\n\t\t\t})\n\t\t\t.default({}),\n\t\tscripts: z\n\t\t\t.object({\n\t\t\t\ttest: z.string().optional(),\n\t\t\t\tdev: z.string().optional(),\n\t\t\t})\n\t\t\t.default({}),\n\t\tinitialRoute: z.string().optional().default(workshopConfig.initialRoute),\n\t})\n\n\tconst appConfig = {\n\t\tstackBlitzConfig: epicshopConfig.stackBlitzConfig,\n\t\ttestTab: {\n\t\t\tenabled: epicshopConfig.testTab?.enabled,\n\t\t},\n\t\tscripts: {\n\t\t\ttest: scripts.test,\n\t\t\tdev: scripts.dev,\n\t\t},\n\t\tinitialRoute: epicshopConfig.initialRoute,\n\t}\n\n\ttry {\n\t\treturn AppConfigSchema.parse(appConfig)\n\t} catch (error) {\n\t\tif (error instanceof z.ZodError) {\n\t\t\tconst flattenedErrors = error.flatten()\n\t\t\tconst errorMessages = Object.entries(flattenedErrors.fieldErrors)\n\t\t\t\t.map(([field, errors]) => `${field}: ${errors?.join(', ')}`)\n\t\t\t\t.concat(flattenedErrors.formErrors)\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid app configuration for ${fullPath}:\\n${errorMessages.join('\\n')}`,\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AACF,CAAC","sourcesContent":["// eslint-disable-next-line import/order -- this must be first\nimport { getEnv } from './init-env.js'\n\nimport fs from 'node:fs'\nimport path from 'node:path'\nimport { z } from 'zod'\nimport { handleGitHubRepoAndRoot } from './utils.js'\n\nconst getRootPkgJsonPath = () =>\n\tpath.join(getEnv().EPICSHOP_CONTEXT_CWD, 'package.json')\n\nexport const StackBlitzConfigSchema = z.object({\n\t// we default this to `${exerciseTitle} (${type})`\n\ttitle: z.string().optional(),\n\t// stackblitz defaults this to dev automatically\n\tstartScript: z.string().optional(),\n\t// if no value is provided, then stackblitz defaults this to whatever\n\t// looks best based on the width of the screen\n\tview: z\n\t\t.union([z.literal('editor'), z.literal('preview'), z.literal('both')])\n\t\t.optional(),\n\tfile: z.string().optional(),\n\thidedevtools: z.string().optional(),\n\tterminalHeight: z.string().optional(),\n\thideNavigation: z.string().optional(),\n})\n\nconst InstructorSchema = z.object({\n\tname: z.string().optional(),\n\tavatar: z.string().optional(),\n\t𝕏: z.string().optional(),\n\txHandle: z.string().optional(),\n})\n\nconst BaseProductSchema = z.object({\n\thost: z.string().optional(),\n\tdisplayName: z.string().optional(),\n\tdisplayNameShort: z.string().optional(),\n\tslug: z.string().optional(),\n})\n\nconst BaseWorkshopConfigFields = {\n\ttitle: z.string().optional(),\n\tsubtitle: z.string().optional(),\n\tinstructor: InstructorSchema.optional(),\n\tproduct: BaseProductSchema.optional(),\n}\n\nfunction transformProductFields<\n\tT extends {\n\t\tproduct?: {\n\t\t\thost?: string\n\t\t\tdisplayName?: string\n\t\t\tdisplayNameShort?: string\n\t\t\tslug?: string\n\t\t}\n\t},\n>(\n\tdata: T,\n): T & {\n\tproduct: {\n\t\thost: string | undefined\n\t\tdisplayName: string | undefined\n\t\tdisplayNameShort: string | undefined\n\t\tslug: string | undefined\n\t}\n} {\n\tconst product = data.product ?? {}\n\treturn {\n\t\t...data,\n\t\tproduct: {\n\t\t\thost: product.host,\n\t\t\tdisplayName: product.displayName,\n\t\t\tdisplayNameShort: product.displayNameShort ?? product.displayName,\n\t\t\tslug: product.slug,\n\t\t},\n\t}\n}\n\nconst PartialWorkshopConfigSchema = z\n\t.object(BaseWorkshopConfigFields)\n\t.transform(transformProductFields)\n\nexport type PartialWorkshopConfig = z.infer<typeof PartialWorkshopConfigSchema>\n\n// most defaults are for backwards compatibility\nconst WorkshopConfigSchema = z\n\t.object({\n\t\t...BaseWorkshopConfigFields,\n\t\ttitle: z.string(),\n\t\tsubdomain: z.string().optional(),\n\t\tproduct: z\n\t\t\t.object({\n\t\t\t\thost: z.string().default('www.epicweb.dev'),\n\t\t\t\tdisplayName: z.string().default('EpicWeb.dev'),\n\t\t\t\tdisplayNameShort: z.string().default('Epic Web'),\n\t\t\t\tlogo: z.string().default('/logo.svg'),\n\t\t\t\tslug: z.string().optional(),\n\t\t\t\tdiscordChannelId: z.string().optional(),\n\t\t\t\tdiscordTags: z.array(z.string()).optional(),\n\t\t\t})\n\t\t\t.default({}),\n\t\tgithubRepo: z\n\t\t\t.string()\n\t\t\t.transform((githubRepo) => githubRepo ?? getEnv().EPICSHOP_GITHUB_REPO),\n\t\tgithubRoot: z\n\t\t\t.string()\n\t\t\t.transform((githubRoot) => githubRoot ?? getEnv().EPICSHOP_GITHUB_ROOT),\n\t\tstackBlitzConfig: StackBlitzConfigSchema.optional(),\n\t\tforms: z\n\t\t\t.object({\n\t\t\t\tworkshop: z\n\t\t\t\t\t.string()\n\t\t\t\t\t.default(\n\t\t\t\t\t\t'https://docs.google.com/forms/d/e/1FAIpQLSdRmj9p8-5zyoqRzxp3UpqSbC3aFkweXvvJIKes0a5s894gzg/viewform?hl=en&embedded=true&entry.2123647600={workshopTitle}',\n\t\t\t\t\t),\n\t\t\t\texercise: z\n\t\t\t\t\t.string()\n\t\t\t\t\t.default(\n\t\t\t\t\t\t'https://docs.google.com/forms/d/e/1FAIpQLSf3o9xyjQepTlOTH5Z7ZwkeSTdXh6YWI_RGc9KiyD3oUN0p6w/viewform?hl=en&embedded=true&entry.1836176234={workshopTitle}&entry.428900931={exerciseTitle}',\n\t\t\t\t\t),\n\t\t\t})\n\t\t\t.default({}),\n\t\ttestTab: z\n\t\t\t.object({\n\t\t\t\tenabled: z.boolean().default(true),\n\t\t\t})\n\t\t\t.default({}),\n\t\tscripts: z\n\t\t\t.object({\n\t\t\t\tpostupdate: z.string().optional(),\n\t\t\t})\n\t\t\t.optional(),\n\t\tinitialRoute: z.string().optional().default('/'),\n\t\tnotifications: z\n\t\t\t.array(\n\t\t\t\tz.object({\n\t\t\t\t\tid: z.string(),\n\t\t\t\t\ttitle: z.string(),\n\t\t\t\t\tmessage: z.string(),\n\t\t\t\t\tlink: z.string().optional(),\n\t\t\t\t\ttype: z.enum(['info', 'warning', 'danger']),\n\t\t\t\t\texpiresAt: z.date().nullable(),\n\t\t\t\t}),\n\t\t\t)\n\t\t\t.optional()\n\t\t\t.default([]),\n\t\tsidecarProcesses: z.record(z.string(), z.string()).optional().default({}),\n\t})\n\t.transform((data) => {\n\t\treturn {\n\t\t\t...data,\n\t\t\tproduct: {\n\t\t\t\t...data.product,\n\t\t\t\tdisplayNameShort:\n\t\t\t\t\tdata.product.displayNameShort ?? data.product.displayName,\n\t\t\t},\n\t\t}\n\t})\n\nexport type WorkshopConfig = z.infer<typeof WorkshopConfigSchema>\n\n/**\n * Parse epicshop config from an arbitrary package.json object.\n * Unlike getWorkshopConfig(), this doesn't require EPICSHOP_CONTEXT_CWD\n * and returns partial/optional config suitable for external repos.\n */\nexport function parseEpicshopConfig(\n\tpackageJson: unknown,\n): PartialWorkshopConfig | null {\n\tif (\n\t\ttypeof packageJson !== 'object' ||\n\t\tpackageJson === null ||\n\t\t!('epicshop' in packageJson)\n\t) {\n\t\treturn null\n\t}\n\n\tconst epicshopConfig = (packageJson as { epicshop: unknown }).epicshop\n\tconst result = PartialWorkshopConfigSchema.safeParse(epicshopConfig)\n\tif (!result.success) {\n\t\treturn null\n\t}\n\n\treturn result.data\n}\n\nlet configCache: WorkshopConfig | null = null\n\n// Utility to read and parse the root package.json\nfunction readRootPkgJson(): any {\n\tconst packageJsonPath = getRootPkgJsonPath()\n\ttry {\n\t\tconst packageJsonContent = fs.readFileSync(packageJsonPath, 'utf8')\n\t\treturn JSON.parse(packageJsonContent)\n\t} catch (error) {\n\t\tconsole.error(`Error reading or parsing package.json:`, error)\n\t\tif (error instanceof Error && error.message.includes('ENOENT')) {\n\t\t\tthrow new Error(\n\t\t\t\t`package.json not found at ${packageJsonPath}. Please ensure you're running the command from the correct directory.`,\n\t\t\t)\n\t\t} else if (error instanceof SyntaxError) {\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid JSON in package.json at ${packageJsonPath}. Please check the file for syntax errors.`,\n\t\t\t)\n\t\t}\n\t\tthrow new Error(\n\t\t\t`Could not find and parse package.json at ${packageJsonPath}`,\n\t\t)\n\t}\n}\n\n/**\n * This used to support subdomains on localhost, but that caused too many issues.\n */\nexport function getWorkshopUrl(port: number) {\n\treturn `http://localhost:${port}`\n}\n\nexport function getWorkshopConfig(): WorkshopConfig {\n\t// If config is cached, use it\n\tif (configCache) return configCache\n\n\tconst packageJson = readRootPkgJson()\n\n\tconst epicshopConfig = packageJson.epicshop || {}\n\n\t// Set githubRepo and githubRoot before parsing\n\tconst { githubRepo, githubRoot } = handleGitHubRepoAndRoot({\n\t\tgithubRepo: epicshopConfig.githubRepo,\n\t\tgithubRoot: epicshopConfig.githubRoot,\n\t})\n\tepicshopConfig.githubRepo = githubRepo\n\tepicshopConfig.githubRoot = githubRoot\n\n\ttry {\n\t\tconst parsedConfig = WorkshopConfigSchema.parse(epicshopConfig)\n\t\tconfigCache = parsedConfig\n\n\t\treturn parsedConfig\n\t} catch (error) {\n\t\tif (error instanceof z.ZodError) {\n\t\t\tconst flattenedErrors = error.flatten()\n\t\t\tconst errorMessages = Object.entries(flattenedErrors.fieldErrors)\n\t\t\t\t.map(([field, errors]) => `${field}: ${errors?.join(', ')}`)\n\t\t\t\t.concat(flattenedErrors.formErrors)\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid epicshop configuration in ${getRootPkgJsonPath()}:\\n${errorMessages.join('\\n')}`,\n\t\t\t)\n\t\t}\n\t\tthrow error\n\t}\n}\n\nexport async function getStackBlitzUrl({\n\tfullPath,\n\ttitle,\n\ttype,\n}: {\n\tfullPath: string\n\ttitle: string\n\ttype: string\n}) {\n\tconst workshopConfig = getWorkshopConfig()\n\tconst appConfig = await getAppConfig(fullPath)\n\n\tif (appConfig.stackBlitzConfig === null) return null\n\n\tlet githubRootUrlString = workshopConfig.githubRoot\n\n\tconst githubRootUrl = new URL(\n\t\tgithubRootUrlString.replace(/\\/blob\\//, '/tree/'),\n\t)\n\n\tconst githubPart = githubRootUrl.pathname\n\n\t// Check if package.json exists to determine if this is a simple exercise\n\tconst packageJsonPath = path.join(fullPath, 'package.json')\n\tconst packageJsonExists = await fs.promises\n\t\t.access(packageJsonPath, fs.constants.F_OK)\n\t\t.then(() => true)\n\t\t.catch(() => false)\n\n\tlet stackBlitzConfig = {\n\t\t...appConfig.stackBlitzConfig,\n\t\ttitle: appConfig.stackBlitzConfig?.title ?? `${title} (${type})`,\n\t}\n\n\t// For simple exercises without package.json, configure StackBlitz to show only editor\n\tif (!packageJsonExists) {\n\t\t// Find the first existing file from the priority list\n\t\tconst priorityFiles = [\n\t\t\t'index.html',\n\t\t\t'index.tsx',\n\t\t\t'index.ts',\n\t\t\t'index.jsx',\n\t\t\t'index.js',\n\t\t\t'README.mdx',\n\t\t\t'README.md',\n\t\t]\n\n\t\tlet defaultFile: string | null = null\n\t\tfor (const fileName of priorityFiles) {\n\t\t\tconst filePath = path.join(fullPath, fileName)\n\t\t\ttry {\n\t\t\t\tawait fs.promises.access(filePath, fs.constants.F_OK)\n\t\t\t\tdefaultFile = fileName\n\t\t\t\tbreak\n\t\t\t} catch {\n\t\t\t\tcontinue\n\t\t\t}\n\t\t}\n\n\t\tstackBlitzConfig = {\n\t\t\t...stackBlitzConfig,\n\t\t\tview: 'editor', // Show only editor, no preview or terminal\n\t\t\thidedevtools: '1', // Hide the console/devtools\n\t\t\tterminalHeight: '0', // Hide the terminal completely\n\t\t\thideNavigation: '1', // Hide the preview's URL bar\n\t\t\t...(defaultFile && { file: defaultFile }), // Set default file if found\n\t\t}\n\t}\n\n\tconst params = new URLSearchParams(stackBlitzConfig as Record<string, string>)\n\n\tconst relativePath = fullPath.replace(\n\t\t`${getEnv().EPICSHOP_CONTEXT_CWD}${path.sep}`,\n\t\t'',\n\t)\n\n\tconst stackBlitzUrl = new URL(\n\t\t`/github${githubPart}/${relativePath}?${params}`,\n\t\t'https://stackblitz.com',\n\t)\n\n\treturn stackBlitzUrl.toString()\n}\n\nexport async function getAppConfig(fullPath: string) {\n\tconst workshopConfig = getWorkshopConfig()\n\n\tlet epicshopConfig: Record<string, any> = {}\n\tlet scripts: Record<string, string> = {}\n\n\tconst packageJsonPath = path.join(fullPath, 'package.json')\n\tconst packageJsonExists = await fs.promises\n\t\t.access(packageJsonPath, fs.constants.F_OK)\n\t\t.then(() => true)\n\t\t.catch(() => false)\n\n\tif (packageJsonExists) {\n\t\tconst pkg = JSON.parse(\n\t\t\tawait fs.promises.readFile(path.join(fullPath, 'package.json'), 'utf8'),\n\t\t) as any\n\t\tepicshopConfig = pkg.epicshop ?? {}\n\t\tscripts = pkg.scripts ?? {}\n\t}\n\n\tconst AppConfigSchema = z.object({\n\t\tstackBlitzConfig: StackBlitzConfigSchema.nullable()\n\t\t\t.optional()\n\t\t\t.transform((appStackBlitzConfig) => {\n\t\t\t\tif (appStackBlitzConfig === null) return null\n\n\t\t\t\treturn {\n\t\t\t\t\t...workshopConfig.stackBlitzConfig,\n\t\t\t\t\t...appStackBlitzConfig,\n\t\t\t\t}\n\t\t\t}),\n\t\ttestTab: z\n\t\t\t.object({\n\t\t\t\tenabled: z\n\t\t\t\t\t.boolean()\n\t\t\t\t\t.optional()\n\t\t\t\t\t.default(workshopConfig.testTab?.enabled ?? true),\n\t\t\t})\n\t\t\t.default({}),\n\t\tscripts: z\n\t\t\t.object({\n\t\t\t\ttest: z.string().optional(),\n\t\t\t\tdev: z.string().optional(),\n\t\t\t})\n\t\t\t.default({}),\n\t\tinitialRoute: z.string().optional().default(workshopConfig.initialRoute),\n\t})\n\n\tconst appConfig = {\n\t\tstackBlitzConfig: epicshopConfig.stackBlitzConfig,\n\t\ttestTab: {\n\t\t\tenabled: epicshopConfig.testTab?.enabled,\n\t\t},\n\t\tscripts: {\n\t\t\ttest: scripts.test,\n\t\t\tdev: scripts.dev,\n\t\t},\n\t\tinitialRoute: epicshopConfig.initialRoute,\n\t}\n\n\ttry {\n\t\treturn AppConfigSchema.parse(appConfig)\n\t} catch (error) {\n\t\tif (error instanceof z.ZodError) {\n\t\t\tconst flattenedErrors = error.flatten()\n\t\t\tconst errorMessages = Object.entries(flattenedErrors.fieldErrors)\n\t\t\t\t.map(([field, errors]) => `${field}: ${errors?.join(', ')}`)\n\t\t\t\t.concat(flattenedErrors.formErrors)\n\t\t\tthrow new Error(\n\t\t\t\t`Invalid app configuration for ${fullPath}:\\n${errorMessages.join('\\n')}`,\n\t\t\t)\n\t\t}\n\t\tthrow error\n\t}\n}\n"]}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.test.d.ts","sourceRoot":"","sources":["../../src/config.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,77 @@
|
|
|
1
|
+
import { test, expect } from 'vitest';
|
|
2
|
+
import { parseEpicshopConfig } from './config.server.js';
|
|
3
|
+
test('parses epicshop config with modern product structure', () => {
|
|
4
|
+
const packageJson = {
|
|
5
|
+
name: 'test-workshop',
|
|
6
|
+
epicshop: {
|
|
7
|
+
title: 'Test Workshop',
|
|
8
|
+
subtitle: 'A test subtitle',
|
|
9
|
+
instructor: {
|
|
10
|
+
name: 'Kent C. Dodds',
|
|
11
|
+
},
|
|
12
|
+
product: {
|
|
13
|
+
host: 'www.epicweb.dev',
|
|
14
|
+
displayName: 'EpicWeb.dev',
|
|
15
|
+
slug: 'test-workshop',
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
const result = parseEpicshopConfig(packageJson);
|
|
20
|
+
expect(result).toEqual({
|
|
21
|
+
title: 'Test Workshop',
|
|
22
|
+
subtitle: 'A test subtitle',
|
|
23
|
+
instructor: { name: 'Kent C. Dodds' },
|
|
24
|
+
product: {
|
|
25
|
+
host: 'www.epicweb.dev',
|
|
26
|
+
displayName: 'EpicWeb.dev',
|
|
27
|
+
displayNameShort: 'EpicWeb.dev',
|
|
28
|
+
slug: 'test-workshop',
|
|
29
|
+
},
|
|
30
|
+
});
|
|
31
|
+
});
|
|
32
|
+
test('returns null for package.json without epicshop field', () => {
|
|
33
|
+
const packageJson = {
|
|
34
|
+
name: 'regular-package',
|
|
35
|
+
version: '1.0.0',
|
|
36
|
+
};
|
|
37
|
+
const result = parseEpicshopConfig(packageJson);
|
|
38
|
+
expect(result).toBeNull();
|
|
39
|
+
});
|
|
40
|
+
test('returns null for null input', () => {
|
|
41
|
+
const result = parseEpicshopConfig(null);
|
|
42
|
+
expect(result).toBeNull();
|
|
43
|
+
});
|
|
44
|
+
test('returns null for non-object input', () => {
|
|
45
|
+
const result = parseEpicshopConfig('not an object');
|
|
46
|
+
expect(result).toBeNull();
|
|
47
|
+
});
|
|
48
|
+
test('handles minimal epicshop config', () => {
|
|
49
|
+
const packageJson = {
|
|
50
|
+
epicshop: {},
|
|
51
|
+
};
|
|
52
|
+
const result = parseEpicshopConfig(packageJson);
|
|
53
|
+
expect(result).toEqual({
|
|
54
|
+
title: undefined,
|
|
55
|
+
subtitle: undefined,
|
|
56
|
+
instructor: undefined,
|
|
57
|
+
product: {
|
|
58
|
+
host: undefined,
|
|
59
|
+
displayName: undefined,
|
|
60
|
+
displayNameShort: undefined,
|
|
61
|
+
slug: undefined,
|
|
62
|
+
},
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
test('handles displayNameShort fallback to displayName', () => {
|
|
66
|
+
const packageJson = {
|
|
67
|
+
epicshop: {
|
|
68
|
+
title: 'Test',
|
|
69
|
+
product: {
|
|
70
|
+
displayName: 'Epic Web',
|
|
71
|
+
},
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
const result = parseEpicshopConfig(packageJson);
|
|
75
|
+
expect(result?.product.displayNameShort).toBe('Epic Web');
|
|
76
|
+
});
|
|
77
|
+
//# sourceMappingURL=config.test.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.test.js","sourceRoot":"","sources":["../../src/config.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,QAAQ,CAAA;AACrC,OAAO,EAAE,mBAAmB,EAAE,MAAM,oBAAoB,CAAA;AAExD,IAAI,CAAC,sDAAsD,EAAE,GAAG,EAAE;IACjE,MAAM,WAAW,GAAG;QACnB,IAAI,EAAE,eAAe;QACrB,QAAQ,EAAE;YACT,KAAK,EAAE,eAAe;YACtB,QAAQ,EAAE,iBAAiB;YAC3B,UAAU,EAAE;gBACX,IAAI,EAAE,eAAe;aACrB;YACD,OAAO,EAAE;gBACR,IAAI,EAAE,iBAAiB;gBACvB,WAAW,EAAE,aAAa;gBAC1B,IAAI,EAAE,eAAe;aACrB;SACD;KACD,CAAA;IAED,MAAM,MAAM,GAAG,mBAAmB,CAAC,WAAW,CAAC,CAAA;IAE/C,MAAM,CAAC,MAAM,CAAC,CAAC,OAAO,CAAC;QACtB,KAAK,EAAE,eAAe;QACtB,QAAQ,EAAE,iBAAiB;QAC3B,UAAU,EAAE,EAAE,IAAI,EAAE,eAAe,EAAE;QACrC,OAAO,EAAE;YACR,IAAI,EAAE,iBAAiB;YACvB,WAAW,EAAE,aAAa;YAC1B,gBAAgB,EAAE,aAAa;YAC/B,IAAI,EAAE,eAAe;SACrB;KACD,CAAC,CAAA;AACH,CAAC,CAAC,CAAA;AAEF,IAAI,CAAC,sDAAsD,EAAE,GAAG,EAAE;IACjE,MAAM,WAA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AAW,CAAC,CAAA;IAE/C,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,gBAAgB,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;AAC1D,CAAC,CAAC,CAAA","sourcesContent":["import { test, expect } from 'vitest'\nimport { parseEpicshopConfig } from './config.server.js'\n\ntest('parses epicshop config with modern product structure', () => {\n\tconst packageJson = {\n\t\tname: 'test-workshop',\n\t\tepicshop: {\n\t\t\ttitle: 'Test Workshop',\n\t\t\tsubtitle: 'A test subtitle',\n\t\t\tinstructor: {\n\t\t\t\tname: 'Kent C. Dodds',\n\t\t\t},\n\t\t\tproduct: {\n\t\t\t\thost: 'www.epicweb.dev',\n\t\t\t\tdisplayName: 'EpicWeb.dev',\n\t\t\t\tslug: 'test-workshop',\n\t\t\t},\n\t\t},\n\t}\n\n\tconst result = parseEpicshopConfig(packageJson)\n\n\texpect(result).toEqual({\n\t\ttitle: 'Test Workshop',\n\t\tsubtitle: 'A test subtitle',\n\t\tinstructor: { name: 'Kent C. Dodds' },\n\t\tproduct: {\n\t\t\thost: 'www.epicweb.dev',\n\t\t\tdisplayName: 'EpicWeb.dev',\n\t\t\tdisplayNameShort: 'EpicWeb.dev',\n\t\t\tslug: 'test-workshop',\n\t\t},\n\t})\n})\n\ntest('returns null for package.json without epicshop field', () => {\n\tconst packageJson = {\n\t\tname: 'regular-package',\n\t\tversion: '1.0.0',\n\t}\n\n\tconst result = parseEpicshopConfig(packageJson)\n\n\texpect(result).toBeNull()\n})\n\ntest('returns null for null input', () => {\n\tconst result = parseEpicshopConfig(null)\n\n\texpect(result).toBeNull()\n})\n\ntest('returns null for non-object input', () => {\n\tconst result = parseEpicshopConfig('not an object')\n\n\texpect(result).toBeNull()\n})\n\ntest('handles minimal epicshop config', () => {\n\tconst packageJson = {\n\t\tepicshop: {},\n\t}\n\n\tconst result = parseEpicshopConfig(packageJson)\n\n\texpect(result).toEqual({\n\t\ttitle: undefined,\n\t\tsubtitle: undefined,\n\t\tinstructor: undefined,\n\t\tproduct: {\n\t\t\thost: undefined,\n\t\t\tdisplayName: undefined,\n\t\t\tdisplayNameShort: undefined,\n\t\t\tslug: undefined,\n\t\t},\n\t})\n})\n\ntest('handles displayNameShort fallback to displayName', () => {\n\tconst packageJson = {\n\t\tepicshop: {\n\t\t\ttitle: 'Test',\n\t\t\tproduct: {\n\t\t\t\tdisplayName: 'Epic Web',\n\t\t\t},\n\t\t},\n\t}\n\n\tconst result = parseEpicshopConfig(packageJson)\n\n\texpect(result?.product.displayNameShort).toBe('Epic Web')\n})\n"]}
|
package/dist/esm/db.server.d.ts
CHANGED
|
@@ -63,13 +63,6 @@ export declare const PlayerPreferencesSchema: z.ZodDefault<z.ZodOptional<z.ZodOb
|
|
|
63
63
|
activeSidebarTab?: number | undefined;
|
|
64
64
|
}>>>;
|
|
65
65
|
declare const DataSchema: z.ZodObject<{
|
|
66
|
-
onboarding: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
67
|
-
tourVideosWatched: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
68
|
-
}, "passthrough", z.ZodTypeAny, z.objectOutputType<{
|
|
69
|
-
tourVideosWatched: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
70
|
-
}, z.ZodTypeAny, "passthrough">, z.objectInputType<{
|
|
71
|
-
tourVideosWatched: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
72
|
-
}, z.ZodTypeAny, "passthrough">>>>;
|
|
73
66
|
preferences: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
74
67
|
player: z.ZodDefault<z.ZodOptional<z.ZodObject<{
|
|
75
68
|
minResolution: z.ZodOptional<z.ZodNumber>;
|
|
@@ -270,11 +263,6 @@ declare const DataSchema: z.ZodObject<{
|
|
|
270
263
|
clientId: z.ZodOptional<z.ZodString>;
|
|
271
264
|
mutedNotifications: z.ZodOptional<z.ZodDefault<z.ZodArray<z.ZodString, "many">>>;
|
|
272
265
|
}, "strip", z.ZodTypeAny, {
|
|
273
|
-
onboarding: {
|
|
274
|
-
tourVideosWatched: string[];
|
|
275
|
-
} & {
|
|
276
|
-
[k: string]: unknown;
|
|
277
|
-
};
|
|
278
266
|
preferences: {
|
|
279
267
|
player: {
|
|
280
268
|
subtitle: {
|
|
@@ -325,9 +313,6 @@ declare const DataSchema: z.ZodObject<{
|
|
|
325
313
|
clientId?: string | undefined;
|
|
326
314
|
mutedNotifications?: string[] | undefined;
|
|
327
315
|
}, {
|
|
328
|
-
onboarding?: z.objectInputType<{
|
|
329
|
-
tourVideosWatched: z.ZodDefault<z.ZodArray<z.ZodString, "many">>;
|
|
330
|
-
}, z.ZodTypeAny, "passthrough"> | undefined;
|
|
331
316
|
preferences?: {
|
|
332
317
|
player?: {
|
|
333
318
|
subtitle?: {
|
|
@@ -379,14 +364,11 @@ declare const DataSchema: z.ZodObject<{
|
|
|
379
364
|
mutedNotifications?: string[] | undefined;
|
|
380
365
|
}>;
|
|
381
366
|
export declare function getClientId(): Promise<string>;
|
|
382
|
-
export declare function logout(
|
|
367
|
+
export declare function logout({ productHost }?: {
|
|
368
|
+
productHost?: string;
|
|
369
|
+
}): Promise<void>;
|
|
383
370
|
export declare function deleteDb(): Promise<null | undefined>;
|
|
384
371
|
export declare function readDb(): Promise<{
|
|
385
|
-
onboarding: {
|
|
386
|
-
tourVideosWatched: string[];
|
|
387
|
-
} & {
|
|
388
|
-
[k: string]: unknown;
|
|
389
|
-
};
|
|
390
372
|
preferences: {
|
|
391
373
|
player: {
|
|
392
374
|
subtitle: {
|
|
@@ -437,7 +419,9 @@ export declare function readDb(): Promise<{
|
|
|
437
419
|
clientId?: string | undefined;
|
|
438
420
|
mutedNotifications?: string[] | undefined;
|
|
439
421
|
} | null>;
|
|
440
|
-
export declare function getAuthInfo(
|
|
422
|
+
export declare function getAuthInfo({ productHost, }?: {
|
|
423
|
+
productHost?: string;
|
|
424
|
+
}): Promise<{
|
|
441
425
|
id: string;
|
|
442
426
|
email: string;
|
|
443
427
|
tokenSet: {
|
|
@@ -460,11 +444,12 @@ export declare function requireAuthInfo({ request, redirectTo, }: {
|
|
|
460
444
|
};
|
|
461
445
|
name?: string | null | undefined;
|
|
462
446
|
}>;
|
|
463
|
-
export declare function setAuthInfo({ id, tokenSet, email, name, }: {
|
|
447
|
+
export declare function setAuthInfo({ id, tokenSet, email, name, productHost, }: {
|
|
464
448
|
id: string;
|
|
465
449
|
tokenSet: Partial<z.infer<typeof TokenSetSchema>>;
|
|
466
450
|
email?: string | null;
|
|
467
451
|
name?: string | null;
|
|
452
|
+
productHost?: string;
|
|
468
453
|
}): Promise<{
|
|
469
454
|
id: string;
|
|
470
455
|
email: string;
|
|
@@ -533,17 +518,5 @@ export declare function getMutedNotifications(): Promise<string[]>;
|
|
|
533
518
|
export declare function muteNotification(id: string): Promise<string[]>;
|
|
534
519
|
export declare function setFontSizePreference(fontSize: number | undefined): Promise<number | undefined>;
|
|
535
520
|
export declare function getFontSizePreference(): Promise<number | null>;
|
|
536
|
-
export declare function readOnboardingData(): Promise<({
|
|
537
|
-
tourVideosWatched: string[];
|
|
538
|
-
} & {
|
|
539
|
-
[k: string]: unknown;
|
|
540
|
-
}) | null>;
|
|
541
|
-
export declare function markOnboardingVideoWatched(videoUrl: string): Promise<{
|
|
542
|
-
tourVideosWatched: string[];
|
|
543
|
-
}>;
|
|
544
|
-
export declare function unmarkOnboardingVideoWatched(videoUrl: string): Promise<{
|
|
545
|
-
tourVideosWatched: string[];
|
|
546
|
-
}>;
|
|
547
|
-
export declare function areAllOnboardingVideosWatched(onboardingVideos: string[]): Promise<boolean>;
|
|
548
521
|
export {};
|
|
549
522
|
//# sourceMappingURL=db.server.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"db.server.d.ts","sourceRoot":"","sources":["../../src/db.server.ts"],"names":[],"mappings":"AAAA,OAAO,eAAe,CAAA;AAKtB,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAA;AAOvB,QAAA,MAAM,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