@learnpack/learnpack 5.0.148 → 5.0.152
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 +13 -13
- package/lib/commands/serve.js +11 -6
- package/lib/creatorDist/assets/{index-DUPYM87B.css → index-CztA582_.css} +0 -12
- package/lib/creatorDist/assets/{index-ETBXfIew.js → index-l0lFNoeD.js} +32788 -36295
- package/lib/creatorDist/index.html +2 -2
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/src/commands/serve.ts +15 -6
- package/src/creator/src/App.tsx +28 -12
- package/src/creator/src/components/TurnstileChallenge.tsx +2 -9
- package/src/creator/src/utils/creatorUtils.ts +1 -141
- package/src/creator/src/utils/rigo.ts +21 -377
- package/src/creatorDist/assets/{index-DUPYM87B.css → index-CztA582_.css} +0 -12
- package/src/creatorDist/assets/{index-ETBXfIew.js → index-l0lFNoeD.js} +32788 -36295
- package/src/creatorDist/index.html +2 -2
- package/src/ui/_app/app.js +241 -241
- package/src/ui/app.tar.gz +0 -0
package/README.md
CHANGED
@@ -21,7 +21,7 @@ $ npm install -g @learnpack/learnpack
|
|
21
21
|
$ learnpack COMMAND
|
22
22
|
running command...
|
23
23
|
$ learnpack (-v|--version|version)
|
24
|
-
@learnpack/learnpack/5.0.
|
24
|
+
@learnpack/learnpack/5.0.152 win32-x64 node-v22.15.0
|
25
25
|
$ learnpack --help [COMMAND]
|
26
26
|
USAGE
|
27
27
|
$ learnpack COMMAND
|
@@ -80,7 +80,7 @@ DESCRIPTION
|
|
80
80
|
12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)
|
81
81
|
```
|
82
82
|
|
83
|
-
_See code: [src\commands\audit.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
83
|
+
_See code: [src\commands\audit.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.152/src\commands\audit.ts)_
|
84
84
|
|
85
85
|
## `learnpack breakToken`
|
86
86
|
|
@@ -95,7 +95,7 @@ OPTIONS
|
|
95
95
|
-y, --yes Skip all prompts and initialize an empty project
|
96
96
|
```
|
97
97
|
|
98
|
-
_See code: [src\commands\breakToken.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
98
|
+
_See code: [src\commands\breakToken.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.152/src\commands\breakToken.ts)_
|
99
99
|
|
100
100
|
## `learnpack clean`
|
101
101
|
|
@@ -110,7 +110,7 @@ DESCRIPTION
|
|
110
110
|
Extra documentation goes here
|
111
111
|
```
|
112
112
|
|
113
|
-
_See code: [src\commands\clean.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
113
|
+
_See code: [src\commands\clean.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.152/src\commands\clean.ts)_
|
114
114
|
|
115
115
|
## `learnpack download [PACKAGE]`
|
116
116
|
|
@@ -128,7 +128,7 @@ DESCRIPTION
|
|
128
128
|
Extra documentation goes here
|
129
129
|
```
|
130
130
|
|
131
|
-
_See code: [src\commands\download.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
131
|
+
_See code: [src\commands\download.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.152/src\commands\download.ts)_
|
132
132
|
|
133
133
|
## `learnpack help [COMMAND]`
|
134
134
|
|
@@ -160,7 +160,7 @@ OPTIONS
|
|
160
160
|
-y, --yes Skip all prompts and initialize an empty project
|
161
161
|
```
|
162
162
|
|
163
|
-
_See code: [src\commands\init.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
163
|
+
_See code: [src\commands\init.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.152/src\commands\init.ts)_
|
164
164
|
|
165
165
|
## `learnpack login [PACKAGE]`
|
166
166
|
|
@@ -178,7 +178,7 @@ DESCRIPTION
|
|
178
178
|
Extra documentation goes here
|
179
179
|
```
|
180
180
|
|
181
|
-
_See code: [src\commands\login.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
181
|
+
_See code: [src\commands\login.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.152/src\commands\login.ts)_
|
182
182
|
|
183
183
|
## `learnpack logout [PACKAGE]`
|
184
184
|
|
@@ -196,7 +196,7 @@ DESCRIPTION
|
|
196
196
|
Extra documentation goes here
|
197
197
|
```
|
198
198
|
|
199
|
-
_See code: [src\commands\logout.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
199
|
+
_See code: [src\commands\logout.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.152/src\commands\logout.ts)_
|
200
200
|
|
201
201
|
## `learnpack plugins`
|
202
202
|
|
@@ -328,7 +328,7 @@ OPTIONS
|
|
328
328
|
-s, --strict strict mode
|
329
329
|
```
|
330
330
|
|
331
|
-
_See code: [src\commands\publish.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
331
|
+
_See code: [src\commands\publish.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.152/src\commands\publish.ts)_
|
332
332
|
|
333
333
|
## `learnpack serve`
|
334
334
|
|
@@ -345,7 +345,7 @@ OPTIONS
|
|
345
345
|
-y, --yes Skip all prompts and initialize an empty project
|
346
346
|
```
|
347
347
|
|
348
|
-
_See code: [src\commands\serve.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
348
|
+
_See code: [src\commands\serve.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.152/src\commands\serve.ts)_
|
349
349
|
|
350
350
|
## `learnpack start`
|
351
351
|
|
@@ -367,7 +367,7 @@ OPTIONS
|
|
367
367
|
-y, --yes Skip all prompts and initialize an empty project
|
368
368
|
```
|
369
369
|
|
370
|
-
_See code: [src\commands\start.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
370
|
+
_See code: [src\commands\start.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.152/src\commands\start.ts)_
|
371
371
|
|
372
372
|
## `learnpack test [EXERCISESLUG]`
|
373
373
|
|
@@ -384,7 +384,7 @@ OPTIONS
|
|
384
384
|
-y, --yes Skip all prompts and initialize an empty project
|
385
385
|
```
|
386
386
|
|
387
|
-
_See code: [src\commands\test.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
387
|
+
_See code: [src\commands\test.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.152/src\commands\test.ts)_
|
388
388
|
|
389
389
|
## `learnpack translate`
|
390
390
|
|
@@ -398,7 +398,7 @@ OPTIONS
|
|
398
398
|
-y, --yes Skip all prompts and initialize an empty project
|
399
399
|
```
|
400
400
|
|
401
|
-
_See code: [src\commands\translate.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.
|
401
|
+
_See code: [src\commands\translate.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.152/src\commands\translate.ts)_
|
402
402
|
<!-- commandsstop -->
|
403
403
|
|
404
404
|
> > > > > > > 0cb3e56d84c197f9d008836bb573eade212b7e57
|
package/lib/commands/serve.js
CHANGED
@@ -34,6 +34,8 @@ const frontMatter = require("front-matter");
|
|
34
34
|
dotenv.config();
|
35
35
|
const createLearnJson = (courseInfo) => {
|
36
36
|
console.log("courseInfo to create learn json", courseInfo);
|
37
|
+
const expectedPreviewUrl = `https://${(0, creatorUtilities_2.slugify)(courseInfo.title)}.learn-pack.com/preview.png`;
|
38
|
+
console.log("Preview url in generated learn.json", expectedPreviewUrl);
|
37
39
|
const learnJson = {
|
38
40
|
slug: (0, creatorUtilities_2.slugify)(courseInfo.title),
|
39
41
|
title: {
|
@@ -48,7 +50,7 @@ const createLearnJson = (courseInfo) => {
|
|
48
50
|
telemetry: {
|
49
51
|
batch: "https://breathecode.herokuapp.com/v1/assignment/me/telemetry",
|
50
52
|
},
|
51
|
-
preview:
|
53
|
+
preview: expectedPreviewUrl,
|
52
54
|
};
|
53
55
|
return learnJson;
|
54
56
|
};
|
@@ -174,7 +176,7 @@ const fixPreviewUrl = (slug, previewUrl) => {
|
|
174
176
|
return previewUrl;
|
175
177
|
}
|
176
178
|
const expectedUrl = `https://${slug}.learn-pack.com/preview.png`;
|
177
|
-
console.log("
|
179
|
+
console.log("Preview url fixed!", expectedUrl);
|
178
180
|
return expectedUrl;
|
179
181
|
};
|
180
182
|
const getTitleFromHTML = (html) => {
|
@@ -299,8 +301,12 @@ class ServeCommand extends SessionCommand_1.default {
|
|
299
301
|
});
|
300
302
|
app.get("/config", async (req, res) => {
|
301
303
|
const courseSlug = req.query.slug;
|
304
|
+
// GEt the x-rigo-token
|
305
|
+
// const rigoToken = req.header("x-rigo-token")
|
302
306
|
if (!courseSlug) {
|
303
|
-
return res
|
307
|
+
return res
|
308
|
+
.status(400)
|
309
|
+
.json({ error: "Course slug and rigo token required" });
|
304
310
|
}
|
305
311
|
try {
|
306
312
|
console.log("GET CONFIG, COURSE SLUG", courseSlug);
|
@@ -577,13 +583,12 @@ class ServeCommand extends SessionCommand_1.default {
|
|
577
583
|
const { slug } = req.params;
|
578
584
|
const rigoToken = req.header("x-rigo-token");
|
579
585
|
const bcToken = req.header("x-breathecode-token");
|
580
|
-
const { academyId, categoryId } = req.body
|
581
|
-
if (!rigoToken || !bcToken
|
586
|
+
// const { academyId, categoryId } = req.body
|
587
|
+
if (!rigoToken || !bcToken) {
|
582
588
|
return res
|
583
589
|
.status(400)
|
584
590
|
.json({ error: "Faltan tokens o academy/category" });
|
585
591
|
}
|
586
|
-
// 2) Leer y construir config.json vía buildConfig
|
587
592
|
const { config, exercises } = await (0, configBuilder_1.buildConfig)(bucket, slug);
|
588
593
|
// 3) Preparar dirs temporales
|
589
594
|
const prefix = `courses/${slug}/`;
|
@@ -395,9 +395,6 @@
|
|
395
395
|
.top-2 {
|
396
396
|
top: calc(var(--spacing) * 2);
|
397
397
|
}
|
398
|
-
.right-0 {
|
399
|
-
right: calc(var(--spacing) * 0);
|
400
|
-
}
|
401
398
|
.right-2 {
|
402
399
|
right: calc(var(--spacing) * 2);
|
403
400
|
}
|
@@ -525,18 +522,12 @@
|
|
525
522
|
.ml-auto {
|
526
523
|
margin-left: auto;
|
527
524
|
}
|
528
|
-
.block {
|
529
|
-
display: block;
|
530
|
-
}
|
531
525
|
.flex {
|
532
526
|
display: flex;
|
533
527
|
}
|
534
528
|
.hidden {
|
535
529
|
display: none;
|
536
530
|
}
|
537
|
-
.inline {
|
538
|
-
display: inline;
|
539
|
-
}
|
540
531
|
.inline-block {
|
541
532
|
display: inline-block;
|
542
533
|
}
|
@@ -718,9 +709,6 @@
|
|
718
709
|
.gap-3 {
|
719
710
|
gap: calc(var(--spacing) * 3);
|
720
711
|
}
|
721
|
-
.gap-4 {
|
722
|
-
gap: calc(var(--spacing) * 4);
|
723
|
-
}
|
724
712
|
:where(.space-y-2 > :not(:last-child)) {
|
725
713
|
--tw-space-y-reverse: 0;
|
726
714
|
margin-block-start: calc(
|