@learnpack/learnpack 5.0.274 → 5.0.275

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.
Files changed (70) hide show
  1. package/README.md +409 -409
  2. package/lib/commands/audit.js +15 -15
  3. package/lib/commands/breakToken.js +19 -19
  4. package/lib/commands/clean.js +3 -3
  5. package/lib/commands/init.js +41 -41
  6. package/lib/commands/logout.js +3 -3
  7. package/lib/commands/serve.js +127 -70
  8. package/lib/creatorDist/assets/index-BfLyIQVh.js +10223 -10342
  9. package/lib/managers/config/index.js +77 -77
  10. package/lib/models/creator.d.ts +7 -0
  11. package/lib/utils/api.d.ts +1 -0
  12. package/lib/utils/api.js +2 -1
  13. package/lib/utils/creatorUtilities.js +14 -14
  14. package/package.json +1 -1
  15. package/src/commands/audit.ts +487 -487
  16. package/src/commands/breakToken.ts +67 -67
  17. package/src/commands/clean.ts +30 -30
  18. package/src/commands/init.ts +650 -650
  19. package/src/commands/logout.ts +38 -38
  20. package/src/commands/publish.ts +522 -522
  21. package/src/commands/serve.ts +162 -107
  22. package/src/commands/start.ts +333 -333
  23. package/src/commands/translate.ts +123 -123
  24. package/src/creator/README.md +54 -54
  25. package/src/creator/eslint.config.js +28 -28
  26. package/src/creator/src/components/syllabus/ContentIndex.tsx +312 -312
  27. package/src/creator/src/i18n.ts +28 -28
  28. package/src/creator/src/index.css +217 -217
  29. package/src/creator/src/locales/en.json +126 -126
  30. package/src/creator/src/locales/es.json +126 -126
  31. package/src/creator/src/utils/configTypes.ts +122 -122
  32. package/src/creator/src/utils/constants.ts +13 -13
  33. package/src/creator/src/utils/creatorUtils.ts +46 -46
  34. package/src/creator/src/utils/eventBus.ts +2 -2
  35. package/src/creator/src/utils/lib.ts +468 -468
  36. package/src/creator/src/utils/socket.ts +61 -61
  37. package/src/creator/src/utils/store.ts +222 -222
  38. package/src/creator/src/vite-env.d.ts +1 -1
  39. package/src/creator/vite.config.ts +13 -13
  40. package/src/creatorDist/assets/index-BfLyIQVh.js +10223 -10342
  41. package/src/managers/config/defaults.ts +49 -49
  42. package/src/managers/config/exercise.ts +364 -364
  43. package/src/managers/config/index.ts +775 -775
  44. package/src/managers/file.ts +236 -236
  45. package/src/managers/server/routes.ts +554 -554
  46. package/src/managers/session.ts +182 -182
  47. package/src/managers/telemetry.ts +188 -188
  48. package/src/models/action.ts +13 -13
  49. package/src/models/config-manager.ts +28 -28
  50. package/src/models/config.ts +106 -106
  51. package/src/models/creator.ts +47 -40
  52. package/src/models/exercise-obj.ts +30 -30
  53. package/src/models/session.ts +39 -39
  54. package/src/models/socket.ts +61 -61
  55. package/src/models/status.ts +16 -16
  56. package/src/ui/_app/app.js +141 -141
  57. package/src/ui/app.tar.gz +0 -0
  58. package/src/utils/BaseCommand.ts +56 -56
  59. package/src/utils/api.ts +31 -30
  60. package/src/utils/audit.ts +392 -392
  61. package/src/utils/checkNotInstalled.ts +267 -267
  62. package/src/utils/configBuilder.ts +82 -82
  63. package/src/utils/convertCreds.js +34 -34
  64. package/src/utils/creatorUtilities.ts +504 -504
  65. package/src/utils/incrementVersion.js +74 -74
  66. package/src/utils/misc.ts +58 -58
  67. package/src/utils/rigoActions.ts +500 -500
  68. package/src/utils/sidebarGenerator.ts +195 -195
  69. package/src/utils/templates/isolated/exercises/01-hello-world/README.es.md +26 -26
  70. package/src/utils/templates/isolated/exercises/01-hello-world/README.md +26 -26
package/src/ui/app.tar.gz CHANGED
Binary file
@@ -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
@@ -8,22 +8,23 @@ dotenv.config()
8
8
 
9
9
  const HOST = "https://breathecode.herokuapp.com"
10
10
  export const RIGOBOT_HOST = "https://rigobot.herokuapp.com"
11
+ export const RIGOBOT_REALTIME_HOST = "https://chat.4geeks.com"
11
12
  // export const RIGOBOT_HOST = "https://rigobot-test-cca7d841c9d8.herokuapp.com"
12
13
  // export const RIGOBOT_HOST =
13
14
  // "https://8000-charlytoc-rigobot-bmwdeam7cev.ws-us118.gitpod.io"
14
15
 
15
16
  // eslint-disable-next-line
16
- const _fetch = require("node-fetch");
17
+ const _fetch = require("node-fetch")
17
18
 
18
19
  interface IHeaders {
19
- "Content-Type"?: string;
20
- Authorization?: string;
20
+ "Content-Type"?: string
21
+ Authorization?: string
21
22
  }
22
23
 
23
24
  interface IOptions {
24
- headers?: IHeaders;
25
- method?: string;
26
- body?: string;
25
+ headers?: IHeaders
26
+ method?: string
27
+ body?: string
27
28
  }
28
29
 
29
30
  const fetch = async (
@@ -205,8 +206,8 @@ const getAllPackages = async ({
205
206
  lang = "",
206
207
  slug = "",
207
208
  }: {
208
- lang?: string;
209
- slug?: string;
209
+ lang?: string
210
+ slug?: string
210
211
  }) => {
211
212
  try {
212
213
  cli.action.start("Downloading packages...")
@@ -305,7 +306,7 @@ type TConsumableSlug =
305
306
  | "ai-compilation"
306
307
  | "ai-tutorial-generation"
307
308
  | "ai-generation"
308
- | "learnpack-publish";
309
+ | "learnpack-publish"
309
310
 
310
311
  export const countConsumables = (
311
312
  consumables: any,
@@ -344,10 +345,10 @@ export const getConsumable = async (
344
345
  }
345
346
 
346
347
  export interface TAcademy {
347
- id: number;
348
- name: string;
349
- slug: string;
350
- timezone: string;
348
+ id: number
349
+ name: string
350
+ slug: string
351
+ timezone: string
351
352
  }
352
353
 
353
354
  const neededPermissions = [
@@ -415,20 +416,20 @@ export const validateToken = async (token: string) => {
415
416
  }
416
417
 
417
418
  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
- };
419
+ slug: string
420
+ title: string
421
+ lang: string
422
+ url: string
423
+ description: string
424
+ learnpack_deploy_url: string
425
+ technologies: string[]
426
+ category: number
427
+ owner: number
428
+ author: number
429
+ preview: string
430
+ readme_raw: string
431
+ all_translations: string[]
432
+ }
432
433
 
433
434
  export const createAsset = async (token: string, asset: TAssetMissing) => {
434
435
  const body = {
@@ -564,9 +565,9 @@ const createRigoPackage = async (token: string, slug: string, config: any) => {
564
565
  }
565
566
 
566
567
  type TTechnology = {
567
- slug: string;
568
- lang: string;
569
- };
568
+ slug: string
569
+ lang: string
570
+ }
570
571
 
571
572
  let technologiesCache: TTechnology[] = []
572
573