@learnpack/learnpack 5.0.270 → 5.0.274
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 +409 -409
- package/lib/commands/audit.js +15 -15
- package/lib/commands/breakToken.js +19 -19
- package/lib/commands/clean.js +3 -3
- package/lib/commands/init.js +41 -41
- package/lib/commands/logout.js +3 -3
- package/lib/commands/serve.js +48 -20
- package/lib/creatorDist/assets/{index-CQXTTbaZ.js → index-BfLyIQVh.js} +11535 -11409
- package/lib/creatorDist/assets/{index-B4khtb0r.css → index-C39zeF3W.css} +3 -3
- package/lib/creatorDist/index.html +2 -2
- package/lib/managers/config/index.js +77 -77
- package/lib/models/creator.d.ts +1 -0
- package/lib/utils/api.js +1 -0
- package/lib/utils/creatorUtilities.js +14 -14
- package/package.json +1 -1
- package/src/commands/audit.ts +487 -487
- package/src/commands/breakToken.ts +67 -67
- package/src/commands/clean.ts +30 -30
- package/src/commands/init.ts +650 -650
- package/src/commands/logout.ts +38 -38
- package/src/commands/publish.ts +522 -522
- package/src/commands/serve.ts +64 -33
- package/src/commands/start.ts +333 -333
- package/src/commands/translate.ts +123 -123
- package/src/creator/README.md +54 -54
- package/src/creator/eslint.config.js +28 -28
- package/src/creator/src/components/syllabus/ContentIndex.tsx +1 -1
- package/src/creator/src/components/syllabus/SyllabusEditor.tsx +3 -1
- package/src/creator/src/i18n.ts +28 -28
- package/src/creator/src/index.css +217 -217
- package/src/creator/src/locales/en.json +1 -0
- package/src/creator/src/locales/es.json +1 -0
- package/src/creator/src/utils/configTypes.ts +122 -122
- package/src/creator/src/utils/constants.ts +13 -13
- package/src/creator/src/utils/creatorUtils.ts +46 -46
- package/src/creator/src/utils/eventBus.ts +2 -2
- package/src/creator/src/utils/lib.ts +468 -468
- package/src/creator/src/utils/rigo.ts +26 -26
- package/src/creator/src/utils/socket.ts +61 -61
- package/src/creator/src/utils/store.ts +222 -222
- package/src/creator/src/vite-env.d.ts +1 -1
- package/src/creator/vite.config.ts +13 -13
- package/src/creatorDist/assets/{index-CQXTTbaZ.js → index-BfLyIQVh.js} +11535 -11409
- package/src/creatorDist/assets/{index-B4khtb0r.css → index-C39zeF3W.css} +3 -3
- package/src/creatorDist/index.html +2 -2
- package/src/managers/config/defaults.ts +49 -49
- package/src/managers/config/exercise.ts +364 -364
- package/src/managers/config/index.ts +775 -775
- package/src/managers/file.ts +236 -236
- package/src/managers/server/routes.ts +554 -554
- package/src/managers/session.ts +182 -182
- package/src/managers/telemetry.ts +188 -188
- package/src/models/action.ts +13 -13
- package/src/models/config-manager.ts +28 -28
- package/src/models/config.ts +106 -106
- package/src/models/creator.ts +40 -39
- package/src/models/exercise-obj.ts +30 -30
- package/src/models/session.ts +39 -39
- package/src/models/socket.ts +61 -61
- package/src/models/status.ts +16 -16
- package/src/ui/_app/app.css +1 -1
- package/src/ui/_app/app.js +435 -414
- package/src/ui/_app/learnpack.svg +7 -7
- package/src/ui/app.tar.gz +0 -0
- package/src/utils/BaseCommand.ts +56 -56
- package/src/utils/api.ts +31 -30
- package/src/utils/audit.ts +392 -392
- package/src/utils/checkNotInstalled.ts +267 -267
- package/src/utils/configBuilder.ts +82 -82
- package/src/utils/convertCreds.js +34 -34
- package/src/utils/creatorUtilities.ts +504 -504
- package/src/utils/incrementVersion.js +74 -74
- package/src/utils/misc.ts +58 -58
- package/src/utils/rigoActions.ts +500 -500
- package/src/utils/sidebarGenerator.ts +195 -195
- package/src/utils/templates/isolated/exercises/01-hello-world/README.es.md +26 -26
- package/src/utils/templates/isolated/exercises/01-hello-world/README.md +26 -26
@@ -1,7 +1,7 @@
|
|
1
|
-
<svg width="32" height="33" viewBox="0 0 32 33" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
-
<path d="M4 10.8271V22.3184C4 23.0446 4.38793 23.7155 5.01755 24.0786L14.9824 29.8242C15.6121 30.1873 16.3879 30.1873 17.0176 29.8242L26.9824 24.0786C27.6121 23.7155 28 23.0446 28 22.3184V10.8271C28 10.1009 27.6121 9.42998 26.9824 9.0669L17.0176 3.32114C16.3879 2.95806 15.6121 2.95806 14.9824 3.32114L5.01755 9.0669C4.38793 9.42983 4 10.1009 4 10.8271Z" fill="#00041A"/>
|
3
|
-
<path d="M15.9799 24.627C15.8632 24.6896 15.7224 24.688 15.607 24.6229L8.0148 20.3429C7.75702 20.1975 7.43799 20.3836 7.43799 20.6793C7.43799 20.8152 7.50954 20.9411 7.62625 21.0109L15.6296 25.7894C15.7496 25.861 15.8988 25.8624 16.0201 25.7932L24.367 21.0254C24.5 20.9494 24.5753 20.8024 24.5596 20.6503C24.5356 20.4167 24.5137 20.0937 24.5676 20.0293L15.9799 24.627Z" fill="white"/>
|
4
|
-
<path d="M24.5708 20.0291L24.5925 20.0176C24.5842 20.0176 24.5771 20.0218 24.5708 20.0291Z" fill="white"/>
|
5
|
-
<path d="M24.2608 22.2883L15.8274 27.0176L7.31846 22.1585C7.07286 22.0182 6.92116 21.7573 6.92116 21.4746V19.5681C6.92116 19.2047 7.31237 18.9754 7.63015 19.1523L15.836 23.7249L25.5691 18.2171C25.6739 18.1578 25.6648 18.0039 25.5538 17.9573L24.4218 17.4822C23.6861 17.1734 22.852 17.2021 22.1393 17.5606L15.836 20.7318L9.54557 17.6348C8.72425 17.2303 7.76107 17.2317 6.94085 17.6382C6.28341 17.964 5.86768 18.6336 5.86768 19.3665V20.9276C5.86768 21.8003 6.32903 22.6082 7.08114 23.0524L15.8274 28.2184L26.057 22.356L25.5817 22.1821C25.1471 22.0229 24.6643 22.0618 24.2608 22.2882V22.2883Z" fill="#0097CF"/>
|
6
|
-
<path d="M26.5421 11.2556L15.9895 5.16C15.8945 5.10524 15.7774 5.10555 15.6828 5.16078L5.25698 11.2581C5.05262 11.3776 5.05684 11.6741 5.26448 11.7876L8.96534 13.8126V15.5122C8.96534 15.8275 9.13689 16.1178 9.41326 16.2702L15.4095 19.5777C15.6696 19.7211 15.9851 19.7217 16.2455 19.5789L22.2902 16.2696C22.5678 16.1176 22.7405 15.8265 22.7405 15.5102V13.8124L25.4213 12.381V16.1824C25.4213 16.3995 25.5977 16.5757 25.8151 16.5757H25.9842C26.2017 16.5757 26.3781 16.3995 26.3781 16.1824V11.8702L26.533 11.7875C26.7438 11.675 26.7488 11.3751 26.5419 11.2556H26.5421ZM24.8006 11.6904L15.9487 16.3479C15.887 16.3804 15.8132 16.38 15.7518 16.3471L7.0707 11.6979C6.9254 11.6202 6.92274 11.4132 7.06585 11.3316L15.7246 6.39138C15.7884 6.35503 15.8665 6.35456 15.9306 6.39029L24.8046 11.3224C24.9501 11.4032 24.9477 11.613 24.8004 11.6906L24.8006 11.6904Z" fill="white"/>
|
7
|
-
</svg>
|
1
|
+
<svg width="32" height="33" viewBox="0 0 32 33" fill="none" xmlns="http://www.w3.org/2000/svg">
|
2
|
+
<path d="M4 10.8271V22.3184C4 23.0446 4.38793 23.7155 5.01755 24.0786L14.9824 29.8242C15.6121 30.1873 16.3879 30.1873 17.0176 29.8242L26.9824 24.0786C27.6121 23.7155 28 23.0446 28 22.3184V10.8271C28 10.1009 27.6121 9.42998 26.9824 9.0669L17.0176 3.32114C16.3879 2.95806 15.6121 2.95806 14.9824 3.32114L5.01755 9.0669C4.38793 9.42983 4 10.1009 4 10.8271Z" fill="#00041A"/>
|
3
|
+
<path d="M15.9799 24.627C15.8632 24.6896 15.7224 24.688 15.607 24.6229L8.0148 20.3429C7.75702 20.1975 7.43799 20.3836 7.43799 20.6793C7.43799 20.8152 7.50954 20.9411 7.62625 21.0109L15.6296 25.7894C15.7496 25.861 15.8988 25.8624 16.0201 25.7932L24.367 21.0254C24.5 20.9494 24.5753 20.8024 24.5596 20.6503C24.5356 20.4167 24.5137 20.0937 24.5676 20.0293L15.9799 24.627Z" fill="white"/>
|
4
|
+
<path d="M24.5708 20.0291L24.5925 20.0176C24.5842 20.0176 24.5771 20.0218 24.5708 20.0291Z" fill="white"/>
|
5
|
+
<path d="M24.2608 22.2883L15.8274 27.0176L7.31846 22.1585C7.07286 22.0182 6.92116 21.7573 6.92116 21.4746V19.5681C6.92116 19.2047 7.31237 18.9754 7.63015 19.1523L15.836 23.7249L25.5691 18.2171C25.6739 18.1578 25.6648 18.0039 25.5538 17.9573L24.4218 17.4822C23.6861 17.1734 22.852 17.2021 22.1393 17.5606L15.836 20.7318L9.54557 17.6348C8.72425 17.2303 7.76107 17.2317 6.94085 17.6382C6.28341 17.964 5.86768 18.6336 5.86768 19.3665V20.9276C5.86768 21.8003 6.32903 22.6082 7.08114 23.0524L15.8274 28.2184L26.057 22.356L25.5817 22.1821C25.1471 22.0229 24.6643 22.0618 24.2608 22.2882V22.2883Z" fill="#0097CF"/>
|
6
|
+
<path d="M26.5421 11.2556L15.9895 5.16C15.8945 5.10524 15.7774 5.10555 15.6828 5.16078L5.25698 11.2581C5.05262 11.3776 5.05684 11.6741 5.26448 11.7876L8.96534 13.8126V15.5122C8.96534 15.8275 9.13689 16.1178 9.41326 16.2702L15.4095 19.5777C15.6696 19.7211 15.9851 19.7217 16.2455 19.5789L22.2902 16.2696C22.5678 16.1176 22.7405 15.8265 22.7405 15.5102V13.8124L25.4213 12.381V16.1824C25.4213 16.3995 25.5977 16.5757 25.8151 16.5757H25.9842C26.2017 16.5757 26.3781 16.3995 26.3781 16.1824V11.8702L26.533 11.7875C26.7438 11.675 26.7488 11.3751 26.5419 11.2556H26.5421ZM24.8006 11.6904L15.9487 16.3479C15.887 16.3804 15.8132 16.38 15.7518 16.3471L7.0707 11.6979C6.9254 11.6202 6.92274 11.4132 7.06585 11.3316L15.7246 6.39138C15.7884 6.35503 15.8665 6.35456 15.9306 6.39029L24.8046 11.3224C24.9501 11.4032 24.9477 11.613 24.8004 11.6906L24.8006 11.6904Z" fill="white"/>
|
7
|
+
</svg>
|
package/src/ui/app.tar.gz
CHANGED
Binary file
|
package/src/utils/BaseCommand.ts
CHANGED
@@ -1,56 +1,56 @@
|
|
1
|
-
import { Command, flags } from "@oclif/command"
|
2
|
-
import Console from "./console"
|
3
|
-
import { createInterface } from "readline"
|
4
|
-
// import SessionManager from '../managers/session'
|
5
|
-
|
6
|
-
class BaseCommand extends Command {
|
7
|
-
async catch(err: any) {
|
8
|
-
Console.debug("COMMAND CATCH", err)
|
9
|
-
|
10
|
-
throw err
|
11
|
-
}
|
12
|
-
|
13
|
-
async init() {
|
14
|
-
const { flags, args } = this.parse(BaseCommand)
|
15
|
-
Console.debug("COMMAND INIT")
|
16
|
-
Console.debug("These are your flags: ", flags)
|
17
|
-
Console.debug("These are your args: ", args)
|
18
|
-
|
19
|
-
// quick fix for listening to the process termination on windows
|
20
|
-
if (process.platform === "win32") {
|
21
|
-
const rl = createInterface({
|
22
|
-
input: process.stdin,
|
23
|
-
output: process.stdout,
|
24
|
-
})
|
25
|
-
|
26
|
-
rl.on("SIGINT", function () {
|
27
|
-
// process.emit('SIGINT')
|
28
|
-
// process.emit('SIGINT')
|
29
|
-
})
|
30
|
-
}
|
31
|
-
|
32
|
-
process.on("SIGINT", function () {
|
33
|
-
Console.debug("Terminated (SIGINT)")
|
34
|
-
process.exit()
|
35
|
-
})
|
36
|
-
}
|
37
|
-
|
38
|
-
async finally() {
|
39
|
-
Console.debug("COMMAND FINALLY")
|
40
|
-
// called after run and catch regardless of whether or not the command errored
|
41
|
-
}
|
42
|
-
|
43
|
-
static flags = {
|
44
|
-
yes: flags.boolean({
|
45
|
-
char: "y",
|
46
|
-
description: "Skip all prompts and initialize an empty project",
|
47
|
-
default: false,
|
48
|
-
}),
|
49
|
-
}
|
50
|
-
|
51
|
-
async run() {
|
52
|
-
// console.log('running my command')
|
53
|
-
}
|
54
|
-
}
|
55
|
-
|
56
|
-
export default BaseCommand
|
1
|
+
import { Command, flags } from "@oclif/command"
|
2
|
+
import Console from "./console"
|
3
|
+
import { createInterface } from "readline"
|
4
|
+
// import SessionManager from '../managers/session'
|
5
|
+
|
6
|
+
class BaseCommand extends Command {
|
7
|
+
async catch(err: any) {
|
8
|
+
Console.debug("COMMAND CATCH", err)
|
9
|
+
|
10
|
+
throw err
|
11
|
+
}
|
12
|
+
|
13
|
+
async init() {
|
14
|
+
const { flags, args } = this.parse(BaseCommand)
|
15
|
+
Console.debug("COMMAND INIT")
|
16
|
+
Console.debug("These are your flags: ", flags)
|
17
|
+
Console.debug("These are your args: ", args)
|
18
|
+
|
19
|
+
// quick fix for listening to the process termination on windows
|
20
|
+
if (process.platform === "win32") {
|
21
|
+
const rl = createInterface({
|
22
|
+
input: process.stdin,
|
23
|
+
output: process.stdout,
|
24
|
+
})
|
25
|
+
|
26
|
+
rl.on("SIGINT", function () {
|
27
|
+
// process.emit('SIGINT')
|
28
|
+
// process.emit('SIGINT')
|
29
|
+
})
|
30
|
+
}
|
31
|
+
|
32
|
+
process.on("SIGINT", function () {
|
33
|
+
Console.debug("Terminated (SIGINT)")
|
34
|
+
process.exit()
|
35
|
+
})
|
36
|
+
}
|
37
|
+
|
38
|
+
async finally() {
|
39
|
+
Console.debug("COMMAND FINALLY")
|
40
|
+
// called after run and catch regardless of whether or not the command errored
|
41
|
+
}
|
42
|
+
|
43
|
+
static flags = {
|
44
|
+
yes: flags.boolean({
|
45
|
+
char: "y",
|
46
|
+
description: "Skip all prompts and initialize an empty project",
|
47
|
+
default: false,
|
48
|
+
}),
|
49
|
+
}
|
50
|
+
|
51
|
+
async run() {
|
52
|
+
// console.log('running my command')
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
export default BaseCommand
|
package/src/utils/api.ts
CHANGED
@@ -13,17 +13,17 @@ export const RIGOBOT_HOST = "https://rigobot.herokuapp.com"
|
|
13
13
|
// "https://8000-charlytoc-rigobot-bmwdeam7cev.ws-us118.gitpod.io"
|
14
14
|
|
15
15
|
// eslint-disable-next-line
|
16
|
-
const _fetch = require("node-fetch")
|
16
|
+
const _fetch = require("node-fetch");
|
17
17
|
|
18
18
|
interface IHeaders {
|
19
|
-
"Content-Type"?: string
|
20
|
-
Authorization?: string
|
19
|
+
"Content-Type"?: string;
|
20
|
+
Authorization?: string;
|
21
21
|
}
|
22
22
|
|
23
23
|
interface IOptions {
|
24
|
-
headers?: IHeaders
|
25
|
-
method?: string
|
26
|
-
body?: string
|
24
|
+
headers?: IHeaders;
|
25
|
+
method?: string;
|
26
|
+
body?: string;
|
27
27
|
}
|
28
28
|
|
29
29
|
const fetch = async (
|
@@ -205,8 +205,8 @@ const getAllPackages = async ({
|
|
205
205
|
lang = "",
|
206
206
|
slug = "",
|
207
207
|
}: {
|
208
|
-
lang?: string
|
209
|
-
slug?: string
|
208
|
+
lang?: string;
|
209
|
+
slug?: string;
|
210
210
|
}) => {
|
211
211
|
try {
|
212
212
|
cli.action.start("Downloading packages...")
|
@@ -305,7 +305,7 @@ type TConsumableSlug =
|
|
305
305
|
| "ai-compilation"
|
306
306
|
| "ai-tutorial-generation"
|
307
307
|
| "ai-generation"
|
308
|
-
| "learnpack-publish"
|
308
|
+
| "learnpack-publish";
|
309
309
|
|
310
310
|
export const countConsumables = (
|
311
311
|
consumables: any,
|
@@ -344,10 +344,10 @@ export const getConsumable = async (
|
|
344
344
|
}
|
345
345
|
|
346
346
|
export interface TAcademy {
|
347
|
-
id: number
|
348
|
-
name: string
|
349
|
-
slug: string
|
350
|
-
timezone: string
|
347
|
+
id: number;
|
348
|
+
name: string;
|
349
|
+
slug: string;
|
350
|
+
timezone: string;
|
351
351
|
}
|
352
352
|
|
353
353
|
const neededPermissions = [
|
@@ -415,20 +415,20 @@ export const validateToken = async (token: string) => {
|
|
415
415
|
}
|
416
416
|
|
417
417
|
type TAssetMissing = {
|
418
|
-
slug: string
|
419
|
-
title: string
|
420
|
-
lang: string
|
421
|
-
url: string
|
422
|
-
description: string
|
423
|
-
learnpack_deploy_url: string
|
424
|
-
technologies: string[]
|
425
|
-
category: number
|
426
|
-
owner: number
|
427
|
-
author: number
|
428
|
-
preview: string
|
429
|
-
readme_raw: string
|
430
|
-
all_translations: string[]
|
431
|
-
}
|
418
|
+
slug: string;
|
419
|
+
title: string;
|
420
|
+
lang: string;
|
421
|
+
url: string;
|
422
|
+
description: string;
|
423
|
+
learnpack_deploy_url: string;
|
424
|
+
technologies: string[];
|
425
|
+
category: number;
|
426
|
+
owner: number;
|
427
|
+
author: number;
|
428
|
+
preview: string;
|
429
|
+
readme_raw: string;
|
430
|
+
all_translations: string[];
|
431
|
+
};
|
432
432
|
|
433
433
|
export const createAsset = async (token: string, asset: TAssetMissing) => {
|
434
434
|
const body = {
|
@@ -457,6 +457,7 @@ export const createAsset = async (token: string, asset: TAssetMissing) => {
|
|
457
457
|
learnpack_deploy_url: asset.learnpack_deploy_url,
|
458
458
|
technologies: asset.technologies,
|
459
459
|
readme_raw: asset.readme_raw,
|
460
|
+
all_translations: asset.all_translations,
|
460
461
|
}
|
461
462
|
const url = `https://breathecode.herokuapp.com/v1/registry/asset/me`
|
462
463
|
const headers = {
|
@@ -563,9 +564,9 @@ const createRigoPackage = async (token: string, slug: string, config: any) => {
|
|
563
564
|
}
|
564
565
|
|
565
566
|
type TTechnology = {
|
566
|
-
slug: string
|
567
|
-
lang: string
|
568
|
-
}
|
567
|
+
slug: string;
|
568
|
+
lang: string;
|
569
|
+
};
|
569
570
|
|
570
571
|
let technologiesCache: TTechnology[] = []
|
571
572
|
|