@learnpack/learnpack 1.0.0 → 2.0.3

Sign up to get free protection for your applications and to get access to all the features.
Files changed (103) hide show
  1. package/README.md +106 -118
  2. package/bin/run +14 -2
  3. package/oclif.manifest.json +1 -1
  4. package/package.json +135 -111
  5. package/src/commands/audit.ts +462 -0
  6. package/src/commands/clean.ts +29 -0
  7. package/src/commands/download.ts +62 -0
  8. package/src/commands/init.ts +172 -0
  9. package/src/commands/login.ts +42 -0
  10. package/src/commands/logout.ts +43 -0
  11. package/src/commands/publish.ts +107 -0
  12. package/src/commands/start.ts +234 -0
  13. package/src/commands/{test.js → test.ts} +21 -21
  14. package/src/index.ts +1 -0
  15. package/src/managers/config/allowed_files.ts +29 -0
  16. package/src/managers/config/defaults.ts +33 -0
  17. package/src/managers/config/exercise.ts +302 -0
  18. package/src/managers/config/index.ts +412 -0
  19. package/src/managers/file.ts +169 -0
  20. package/src/managers/gitpod.ts +84 -0
  21. package/src/managers/server/{index.js → index.ts} +26 -19
  22. package/src/managers/server/routes.ts +255 -0
  23. package/src/managers/session.ts +118 -0
  24. package/src/managers/socket.ts +239 -0
  25. package/src/managers/test.ts +83 -0
  26. package/src/models/action.ts +3 -0
  27. package/src/models/audit-errors.ts +4 -0
  28. package/src/models/config-manager.ts +23 -0
  29. package/src/models/config.ts +74 -0
  30. package/src/models/counter.ts +11 -0
  31. package/src/models/errors.ts +22 -0
  32. package/src/models/exercise-obj.ts +26 -0
  33. package/src/models/file.ts +5 -0
  34. package/src/models/findings.ts +18 -0
  35. package/src/models/flags.ts +10 -0
  36. package/src/models/front-matter.ts +11 -0
  37. package/src/models/gitpod-data.ts +19 -0
  38. package/src/models/language.ts +4 -0
  39. package/src/models/package.ts +7 -0
  40. package/src/models/plugin-config.ts +17 -0
  41. package/src/models/session.ts +26 -0
  42. package/src/models/socket.ts +48 -0
  43. package/src/models/status.ts +15 -0
  44. package/src/models/success-types.ts +1 -0
  45. package/src/plugin/command/compile.ts +17 -0
  46. package/src/plugin/command/test.ts +30 -0
  47. package/src/plugin/index.ts +6 -0
  48. package/src/plugin/plugin.ts +94 -0
  49. package/src/plugin/utils.ts +87 -0
  50. package/src/types/node-fetch.d.ts +1 -0
  51. package/src/ui/download.ts +71 -0
  52. package/src/utils/BaseCommand.ts +48 -0
  53. package/src/utils/SessionCommand.ts +48 -0
  54. package/src/utils/api.ts +194 -0
  55. package/src/utils/audit.ts +162 -0
  56. package/src/utils/console.ts +24 -0
  57. package/src/utils/errors.ts +117 -0
  58. package/src/utils/{exercisesQueue.js → exercisesQueue.ts} +12 -6
  59. package/src/utils/fileQueue.ts +198 -0
  60. package/src/utils/misc.ts +23 -0
  61. package/src/utils/templates/incremental/.learn/exercises/01-hello-world/README.es.md +2 -4
  62. package/src/utils/templates/incremental/.learn/exercises/01-hello-world/README.md +1 -2
  63. package/src/utils/templates/isolated/01-hello-world/README.es.md +1 -2
  64. package/src/utils/templates/isolated/01-hello-world/README.md +1 -2
  65. package/src/utils/templates/isolated/README.ejs +1 -1
  66. package/src/utils/templates/isolated/README.es.ejs +1 -1
  67. package/src/utils/validators.ts +18 -0
  68. package/src/utils/watcher.ts +27 -0
  69. package/plugin/command/compile.js +0 -17
  70. package/plugin/command/test.js +0 -29
  71. package/plugin/index.js +0 -6
  72. package/plugin/plugin.js +0 -71
  73. package/plugin/utils.js +0 -78
  74. package/src/commands/audit.js +0 -243
  75. package/src/commands/clean.js +0 -27
  76. package/src/commands/download.js +0 -52
  77. package/src/commands/hello.js +0 -20
  78. package/src/commands/init.js +0 -133
  79. package/src/commands/login.js +0 -45
  80. package/src/commands/logout.js +0 -39
  81. package/src/commands/publish.js +0 -78
  82. package/src/commands/start.js +0 -169
  83. package/src/index.js +0 -1
  84. package/src/managers/config/allowed_files.js +0 -12
  85. package/src/managers/config/defaults.js +0 -32
  86. package/src/managers/config/exercise.js +0 -212
  87. package/src/managers/config/index.js +0 -342
  88. package/src/managers/file.js +0 -137
  89. package/src/managers/server/routes.js +0 -151
  90. package/src/managers/session.js +0 -83
  91. package/src/managers/socket.js +0 -185
  92. package/src/managers/test.js +0 -77
  93. package/src/ui/download.js +0 -48
  94. package/src/utils/BaseCommand.js +0 -34
  95. package/src/utils/SessionCommand.js +0 -46
  96. package/src/utils/api.js +0 -164
  97. package/src/utils/audit.js +0 -114
  98. package/src/utils/console.js +0 -16
  99. package/src/utils/errors.js +0 -90
  100. package/src/utils/fileQueue.js +0 -194
  101. package/src/utils/misc.js +0 -26
  102. package/src/utils/validators.js +0 -15
  103. package/src/utils/watcher.js +0 -24
package/README.md CHANGED
@@ -1,5 +1,4 @@
1
- learnpack
2
- =========
1
+ # learnpack
3
2
 
4
3
  Create, sell or download and take learning amazing learning packages
5
4
 
@@ -9,44 +8,52 @@ Create, sell or download and take learning amazing learning packages
9
8
  [![License](https://img.shields.io/npm/l/learnpack.svg)](https://github.com/learnpack/learnpack-cli/blob/master/package.json)
10
9
 
11
10
  <!-- toc -->
11
+ * [learnpack](#learnpack)
12
12
  * [Usage](#usage)
13
13
  * [Commands](#commands)
14
14
  <!-- tocstop -->
15
- * [Usage](#usage)
16
- * [Commands](#commands)
15
+
16
+ - [learnpack](#learnpack)
17
+ - [Usage](#usage)
18
+ - [Commands](#commands)
17
19
  <!-- tocstop -->
20
+
18
21
  # Usage
22
+
19
23
  <!-- usage -->
20
24
  ```sh-session
21
25
  $ npm install -g @learnpack/learnpack
22
26
  $ learnpack COMMAND
23
27
  running command...
24
28
  $ learnpack (-v|--version|version)
25
- @learnpack/learnpack/1.0.0 win32-x64 node-v16.14.0
29
+ @learnpack/learnpack/2.0.3 win32-x64 node-v16.14.0
26
30
  $ learnpack --help [COMMAND]
27
31
  USAGE
28
32
  $ learnpack COMMAND
29
33
  ...
30
34
  ```
31
35
  <!-- usagestop -->
36
+
32
37
  ```sh-session
33
- $ npm install -g learnpack
38
+ $ npm install -g @learnpack/learnpack
34
39
  $ learnpack COMMAND
35
40
  running command...
36
41
  $ learnpack (-v|--version|version)
37
- learnpack/0.1.24 darwin-x64 node-v10.17.0
42
+ @learnpack/learnpack/2.0.2 win32-x64 node-v16.14.0
38
43
  $ learnpack --help [COMMAND]
39
44
  USAGE
40
45
  $ learnpack COMMAND
41
46
  ...
42
47
  ```
48
+
43
49
  <!-- usagestop -->
50
+
44
51
  # Commands
52
+
45
53
  <!-- commands -->
46
54
  * [`learnpack audit`](#learnpack-audit)
47
55
  * [`learnpack clean`](#learnpack-clean)
48
56
  * [`learnpack download [PACKAGE]`](#learnpack-download-package)
49
- * [`learnpack hello`](#learnpack-hello)
50
57
  * [`learnpack help [COMMAND]`](#learnpack-help-command)
51
58
  * [`learnpack init`](#learnpack-init)
52
59
  * [`learnpack login [PACKAGE]`](#learnpack-login-package)
@@ -62,7 +69,7 @@ USAGE
62
69
 
63
70
  ## `learnpack audit`
64
71
 
65
- Check if the configuration object has slug, description and repository property
72
+ learnpack audit is the command in charge of creating an auditory of the repository
66
73
 
67
74
  ```
68
75
  USAGE
@@ -70,10 +77,23 @@ USAGE
70
77
 
71
78
  DESCRIPTION
72
79
  ...
73
- Extra documentation goes here
74
- ```
75
-
76
- _See code: [src\commands\audit.js](https://github.com/learnpack/learnpack-cli/blob/v1.0.0/src\commands\audit.js)_
80
+ learnpack audit checks for the following information in a repository:
81
+ 1. The configuration object has slug, repository and description. (Error)
82
+ 2. The command learnpack clean has been run. (Error)
83
+ 3. If a markdown or test file doesn't have any content. (Error)
84
+ 4. The links are accessing to valid servers. (Error)
85
+ 5. The relative images are working (If they have the shortest path to the image or if the images exists in the
86
+ assets). (Error)
87
+ 6. The external images are working (If they are pointing to a valid server). (Error)
88
+ 7. The exercises directory names are valid. (Error)
89
+ 8. If an exercise doesn't have a README file. (Error)
90
+ 9. The exercises array (Of the config file) has content. (Error)
91
+ 10. The exercses have the same translations. (Warning)
92
+ 11. The .gitignore file exists. (Warning)
93
+ 12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)
94
+ ```
95
+
96
+ _See code: [src\commands\audit.ts](https://github.com/learnpack/learnpack-cli/blob/v2.0.3/src\commands\audit.ts)_
77
97
 
78
98
  ## `learnpack clean`
79
99
 
@@ -85,10 +105,10 @@ USAGE
85
105
 
86
106
  DESCRIPTION
87
107
  ...
88
- Extra documentation goes here
108
+ Extra documentation goes here
89
109
  ```
90
110
 
91
- _See code: [src\commands\clean.js](https://github.com/learnpack/learnpack-cli/blob/v1.0.0/src\commands\clean.js)_
111
+ _See code: [src\commands\clean.ts](https://github.com/learnpack/learnpack-cli/blob/v2.0.3/src\commands\clean.ts)_
92
112
 
93
113
  ## `learnpack download [PACKAGE]`
94
114
 
@@ -106,25 +126,7 @@ DESCRIPTION
106
126
  Extra documentation goes here
107
127
  ```
108
128
 
109
- _See code: [src\commands\download.js](https://github.com/learnpack/learnpack-cli/blob/v1.0.0/src\commands\download.js)_
110
-
111
- ## `learnpack hello`
112
-
113
- Describe the command here
114
-
115
- ```
116
- USAGE
117
- $ learnpack hello
118
-
119
- OPTIONS
120
- -n, --name=name name to print
121
-
122
- DESCRIPTION
123
- ...
124
- Extra documentation goes here
125
- ```
126
-
127
- _See code: [src\commands\hello.js](https://github.com/learnpack/learnpack-cli/blob/v1.0.0/src\commands\hello.js)_
129
+ _See code: [src\commands\download.ts](https://github.com/learnpack/learnpack-cli/blob/v2.0.3/src\commands\download.ts)_
128
130
 
129
131
  ## `learnpack help [COMMAND]`
130
132
 
@@ -155,7 +157,7 @@ OPTIONS
155
157
  -h, --grading show CLI help
156
158
  ```
157
159
 
158
- _See code: [src\commands\init.js](https://github.com/learnpack/learnpack-cli/blob/v1.0.0/src\commands\init.js)_
160
+ _See code: [src\commands\init.ts](https://github.com/learnpack/learnpack-cli/blob/v2.0.3/src\commands\init.ts)_
159
161
 
160
162
  ## `learnpack login [PACKAGE]`
161
163
 
@@ -170,10 +172,10 @@ ARGUMENTS
170
172
 
171
173
  DESCRIPTION
172
174
  ...
173
- Extra documentation goes here
175
+ Extra documentation goes here
174
176
  ```
175
177
 
176
- _See code: [src\commands\login.js](https://github.com/learnpack/learnpack-cli/blob/v1.0.0/src\commands\login.js)_
178
+ _See code: [src\commands\login.ts](https://github.com/learnpack/learnpack-cli/blob/v2.0.3/src\commands\login.ts)_
177
179
 
178
180
  ## `learnpack logout [PACKAGE]`
179
181
 
@@ -188,10 +190,10 @@ ARGUMENTS
188
190
 
189
191
  DESCRIPTION
190
192
  ...
191
- Extra documentation goes here
193
+ Extra documentation goes here
192
194
  ```
193
195
 
194
- _See code: [src\commands\logout.js](https://github.com/learnpack/learnpack-cli/blob/v1.0.0/src\commands\logout.js)_
196
+ _See code: [src\commands\logout.ts](https://github.com/learnpack/learnpack-cli/blob/v2.0.3/src\commands\logout.ts)_
195
197
 
196
198
  ## `learnpack plugins`
197
199
 
@@ -323,10 +325,10 @@ ARGUMENTS
323
325
 
324
326
  DESCRIPTION
325
327
  ...
326
- Extra documentation goes here
328
+ Extra documentation goes here
327
329
  ```
328
330
 
329
- _See code: [src\commands\publish.js](https://github.com/learnpack/learnpack-cli/blob/v1.0.0/src\commands\publish.js)_
331
+ _See code: [src\commands\publish.ts](https://github.com/learnpack/learnpack-cli/blob/v2.0.3/src\commands\publish.ts)_
330
332
 
331
333
  ## `learnpack start`
332
334
 
@@ -337,22 +339,17 @@ USAGE
337
339
  $ learnpack start
338
340
 
339
341
  OPTIONS
342
+ -D, --disableGrading disble grading functionality
340
343
  -d, --debug debugger mode for more verbage
341
- -d, --disableGrading disble grading functionality
344
+ -e, --editor=standalone|gitpod [standalone, gitpod]
342
345
  -g, --grading=isolated|incremental [isolated, incremental]
343
346
  -h, --host=host server host
344
-
345
- -m, --mode=standalone|preview Load a standalone editor or just the preview to be embeded in another editor:
346
- Choices: [standalone, preview]
347
-
348
347
  -p, --port=port server port
349
-
350
348
  -v, --version=version E.g: 1.0.1
351
-
352
349
  -w, --watch Watch for file changes
353
350
  ```
354
351
 
355
- _See code: [src\commands\start.js](https://github.com/learnpack/learnpack-cli/blob/v1.0.0/src\commands\start.js)_
352
+ _See code: [src\commands\start.ts](https://github.com/learnpack/learnpack-cli/blob/v2.0.3/src\commands\start.ts)_
356
353
 
357
354
  ## `learnpack test [EXERCISESLUG]`
358
355
 
@@ -366,28 +363,28 @@ ARGUMENTS
366
363
  EXERCISESLUG The name of the exercise to test
367
364
  ```
368
365
 
369
- _See code: [src\commands\test.js](https://github.com/learnpack/learnpack-cli/blob/v1.0.0/src\commands\test.js)_
366
+ _See code: [src\commands\test.ts](https://github.com/learnpack/learnpack-cli/blob/v2.0.3/src\commands\test.ts)_
370
367
  <!-- commandsstop -->
371
- * [`learnpack audit`](#learnpack-audit)
372
- * [`learnpack clean`](#learnpack-clean)
373
- * [`learnpack download [PACKAGE]`](#learnpack-download-package)
374
- * [`learnpack hello`](#learnpack-hello)
375
- * [`learnpack help [COMMAND]`](#learnpack-help-command)
376
- * [`learnpack init`](#learnpack-init)
377
- * [`learnpack login [PACKAGE]`](#learnpack-login-package)
378
- * [`learnpack logout [PACKAGE]`](#learnpack-logout-package)
379
- * [`learnpack plugins`](#learnpack-plugins)
380
- * [`learnpack plugins:install PLUGIN...`](#learnpack-pluginsinstall-plugin)
381
- * [`learnpack plugins:link PLUGIN`](#learnpack-pluginslink-plugin)
382
- * [`learnpack plugins:uninstall PLUGIN...`](#learnpack-pluginsuninstall-plugin)
383
- * [`learnpack plugins:update`](#learnpack-pluginsupdate)
384
- * [`learnpack publish [PACKAGE]`](#learnpack-publish-package)
385
- * [`learnpack start`](#learnpack-start)
386
- * [`learnpack test [EXERCISESLUG]`](#learnpack-test-exerciseslug)
368
+
369
+ - [`learnpack audit`](#learnpack-audit)
370
+ - [`learnpack clean`](#learnpack-clean)
371
+ - [`learnpack download [PACKAGE]`](#learnpack-download-package)
372
+ - [`learnpack help [COMMAND]`](#learnpack-help-command)
373
+ - [`learnpack init`](#learnpack-init)
374
+ - [`learnpack login [PACKAGE]`](#learnpack-login-package)
375
+ - [`learnpack logout [PACKAGE]`](#learnpack-logout-package)
376
+ - [`learnpack plugins`](#learnpack-plugins)
377
+ - [`learnpack plugins:install PLUGIN...`](#learnpack-pluginsinstall-plugin)
378
+ - [`learnpack plugins:link PLUGIN`](#learnpack-pluginslink-plugin)
379
+ - [`learnpack plugins:uninstall PLUGIN...`](#learnpack-pluginsuninstall-plugin)
380
+ - [`learnpack plugins:update`](#learnpack-pluginsupdate)
381
+ - [`learnpack publish [PACKAGE]`](#learnpack-publish-package)
382
+ - [`learnpack start`](#learnpack-start)
383
+ - [`learnpack test [EXERCISESLUG]`](#learnpack-test-exerciseslug)
387
384
 
388
385
  ## `learnpack audit`
389
386
 
390
- Check if the configuration object has slug, description and repository property
387
+ learnpack audit is the command in charge of creating an auditory of the repository
391
388
 
392
389
  ```
393
390
  USAGE
@@ -395,10 +392,23 @@ USAGE
395
392
 
396
393
  DESCRIPTION
397
394
  ...
398
- Extra documentation goes here
399
- ```
400
-
401
- _See code: [src/commands/audit.js](https://github.com/learnpack/learnpack-cli/blob/v0.1.24/src/commands/audit.js)_
395
+ learnpack audit checks for the following information in a repository:
396
+ 1. The configuration object has slug, repository and description. (Error)
397
+ 2. The command learnpack clean has been run. (Error)
398
+ 3. If a markdown or test file doesn't have any content. (Error)
399
+ 4. The links are accessing to valid servers. (Error)
400
+ 5. The relative images are working (If they have the shortest path to the image or if the images exists in the
401
+ assets). (Error)
402
+ 6. The external images are working (If they are pointing to a valid server). (Error)
403
+ 7. The exercises directory names are valid. (Error)
404
+ 8. If an exercise doesn't have a README file. (Error)
405
+ 9. The exercises array (Of the config file) has content. (Error)
406
+ 10. The exercses have the same translations. (Warning)
407
+ 11. The .gitignore file exists. (Warning)
408
+ 12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)
409
+ ```
410
+
411
+ _See code: [src\commands\audit.ts](https://github.com/learnpack/learnpack-cli/blob/v2.0.2/src\commands\audit.ts)_
402
412
 
403
413
  ## `learnpack clean`
404
414
 
@@ -410,10 +420,10 @@ USAGE
410
420
 
411
421
  DESCRIPTION
412
422
  ...
413
- Extra documentation goes here
423
+ Extra documentation goes here
414
424
  ```
415
425
 
416
- _See code: [src/commands/clean.js](https://github.com/learnpack/learnpack-cli/blob/v0.1.24/src/commands/clean.js)_
426
+ _See code: [src\commands\clean.ts](https://github.com/learnpack/learnpack-cli/blob/v2.0.2/src\commands\clean.ts)_
417
427
 
418
428
  ## `learnpack download [PACKAGE]`
419
429
 
@@ -431,25 +441,7 @@ DESCRIPTION
431
441
  Extra documentation goes here
432
442
  ```
433
443
 
434
- _See code: [src/commands/download.js](https://github.com/learnpack/learnpack-cli/blob/v0.1.24/src/commands/download.js)_
435
-
436
- ## `learnpack hello`
437
-
438
- Describe the command here
439
-
440
- ```
441
- USAGE
442
- $ learnpack hello
443
-
444
- OPTIONS
445
- -n, --name=name name to print
446
-
447
- DESCRIPTION
448
- ...
449
- Extra documentation goes here
450
- ```
451
-
452
- _See code: [src/commands/hello.js](https://github.com/learnpack/learnpack-cli/blob/v0.1.24/src/commands/hello.js)_
444
+ _See code: [src\commands\download.ts](https://github.com/learnpack/learnpack-cli/blob/v2.0.2/src\commands\download.ts)_
453
445
 
454
446
  ## `learnpack help [COMMAND]`
455
447
 
@@ -466,7 +458,7 @@ OPTIONS
466
458
  --all see all commands in CLI
467
459
  ```
468
460
 
469
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.1.0/src/commands/help.ts)_
461
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.1.0/src\commands\help.ts)_
470
462
 
471
463
  ## `learnpack init`
472
464
 
@@ -480,7 +472,7 @@ OPTIONS
480
472
  -h, --grading show CLI help
481
473
  ```
482
474
 
483
- _See code: [src/commands/init.js](https://github.com/learnpack/learnpack-cli/blob/v0.1.24/src/commands/init.js)_
475
+ _See code: [src\commands\init.ts](https://github.com/learnpack/learnpack-cli/blob/v2.0.2/src\commands\init.ts)_
484
476
 
485
477
  ## `learnpack login [PACKAGE]`
486
478
 
@@ -495,10 +487,10 @@ ARGUMENTS
495
487
 
496
488
  DESCRIPTION
497
489
  ...
498
- Extra documentation goes here
490
+ Extra documentation goes here
499
491
  ```
500
492
 
501
- _See code: [src/commands/login.js](https://github.com/learnpack/learnpack-cli/blob/v0.1.24/src/commands/login.js)_
493
+ _See code: [src\commands\login.ts](https://github.com/learnpack/learnpack-cli/blob/v2.0.2/src\commands\login.ts)_
502
494
 
503
495
  ## `learnpack logout [PACKAGE]`
504
496
 
@@ -513,10 +505,10 @@ ARGUMENTS
513
505
 
514
506
  DESCRIPTION
515
507
  ...
516
- Extra documentation goes here
508
+ Extra documentation goes here
517
509
  ```
518
510
 
519
- _See code: [src/commands/logout.js](https://github.com/learnpack/learnpack-cli/blob/v0.1.24/src/commands/logout.js)_
511
+ _See code: [src\commands\logout.ts](https://github.com/learnpack/learnpack-cli/blob/v2.0.2/src\commands\logout.ts)_
520
512
 
521
513
  ## `learnpack plugins`
522
514
 
@@ -533,7 +525,7 @@ EXAMPLE
533
525
  $ learnpack plugins
534
526
  ```
535
527
 
536
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src/commands/plugins/index.ts)_
528
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src\commands\plugins\index.ts)_
537
529
 
538
530
  ## `learnpack plugins:install PLUGIN...`
539
531
 
@@ -556,20 +548,20 @@ DESCRIPTION
556
548
 
557
549
  Installation of a user-installed plugin will override a core plugin.
558
550
 
559
- e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
560
- will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
551
+ e.g. If you have a core plugin that has a 'hello' command, installing a user-installed plugin with a 'hello' command
552
+ will override the core plugin implementation. This is useful if a user needs to update core plugin functionality in
561
553
  the CLI without the need to patch and update the whole CLI.
562
554
 
563
555
  ALIASES
564
556
  $ learnpack plugins:add
565
557
 
566
558
  EXAMPLES
567
- $ learnpack plugins:install myplugin
559
+ $ learnpack plugins:install myplugin
568
560
  $ learnpack plugins:install https://github.com/someuser/someplugin
569
561
  $ learnpack plugins:install someuser/someplugin
570
562
  ```
571
563
 
572
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src/commands/plugins/install.ts)_
564
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src\commands\plugins\install.ts)_
573
565
 
574
566
  ## `learnpack plugins:link PLUGIN`
575
567
 
@@ -589,14 +581,14 @@ OPTIONS
589
581
  DESCRIPTION
590
582
  Installation of a linked plugin will override a user-installed or core plugin.
591
583
 
592
- e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
584
+ e.g. If you have a user-installed or core plugin that has a 'hello' command, installing a linked plugin with a 'hello'
593
585
  command will override the user-installed or core plugin implementation. This is useful for development work.
594
586
 
595
587
  EXAMPLE
596
588
  $ learnpack plugins:link myplugin
597
589
  ```
598
590
 
599
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src/commands/plugins/link.ts)_
591
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src\commands\plugins\link.ts)_
600
592
 
601
593
  ## `learnpack plugins:uninstall PLUGIN...`
602
594
 
@@ -618,7 +610,7 @@ ALIASES
618
610
  $ learnpack plugins:remove
619
611
  ```
620
612
 
621
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src/commands/plugins/uninstall.ts)_
613
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src\commands\plugins\uninstall.ts)_
622
614
 
623
615
  ## `learnpack plugins:update`
624
616
 
@@ -633,7 +625,7 @@ OPTIONS
633
625
  -v, --verbose
634
626
  ```
635
627
 
636
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src/commands/plugins/update.ts)_
628
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src\commands\plugins\update.ts)_
637
629
 
638
630
  ## `learnpack publish [PACKAGE]`
639
631
 
@@ -648,10 +640,10 @@ ARGUMENTS
648
640
 
649
641
  DESCRIPTION
650
642
  ...
651
- Extra documentation goes here
643
+ Extra documentation goes here
652
644
  ```
653
645
 
654
- _See code: [src/commands/publish.js](https://github.com/learnpack/learnpack-cli/blob/v0.1.24/src/commands/publish.js)_
646
+ _See code: [src\commands\publish.ts](https://github.com/learnpack/learnpack-cli/blob/v2.0.2/src\commands\publish.ts)_
655
647
 
656
648
  ## `learnpack start`
657
649
 
@@ -662,22 +654,17 @@ USAGE
662
654
  $ learnpack start
663
655
 
664
656
  OPTIONS
657
+ -D, --disableGrading disble grading functionality
665
658
  -d, --debug debugger mode for more verbage
666
- -d, --disableGrading disble grading functionality
659
+ -e, --editor=standalone|gitpod [standalone, gitpod]
667
660
  -g, --grading=isolated|incremental [isolated, incremental]
668
661
  -h, --host=host server host
669
-
670
- -m, --mode=standalone|preview Load a standalone editor or just the preview to be embeded in another editor:
671
- Choices: [standalone, preview]
672
-
673
662
  -p, --port=port server port
674
-
675
663
  -v, --version=version E.g: 1.0.1
676
-
677
664
  -w, --watch Watch for file changes
678
665
  ```
679
666
 
680
- _See code: [src/commands/start.js](https://github.com/learnpack/learnpack-cli/blob/v0.1.24/src/commands/start.js)_
667
+ _See code: [src\commands\start.ts](https://github.com/learnpack/learnpack-cli/blob/v2.0.2/src\commands\start.ts)_
681
668
 
682
669
  ## `learnpack test [EXERCISESLUG]`
683
670
 
@@ -691,5 +678,6 @@ ARGUMENTS
691
678
  EXERCISESLUG The name of the exercise to test
692
679
  ```
693
680
 
694
- _See code: [src/commands/test.js](https://github.com/learnpack/learnpack-cli/blob/v0.1.24/src/commands/test.js)_
681
+ _See code: [src\commands\test.ts](https://github.com/learnpack/learnpack-cli/blob/v2.0.2/src\commands\test.ts)_
682
+
695
683
  <!-- commandsstop -->
package/bin/run CHANGED
@@ -1,5 +1,17 @@
1
1
  #!/usr/bin/env node
2
2
 
3
- require('@oclif/command').run()
4
- .then(require('@oclif/command/flush'))
3
+ const fs = require('fs')
4
+ const path = require('path')
5
+ const project = path.join(__dirname, '../tsconfig.json')
6
+ const dev = fs.existsSync(project)
7
+
8
+ if (dev) {
9
+ require('ts-node').register({project})
10
+ }
11
+
12
+ require(`../${dev ? 'src' : 'lib'}`).run()
5
13
  .catch(require('@oclif/errors/handle'))
14
+
15
+ /*require('@oclif/command').run()
16
+ .then(require('@oclif/command/flush'))
17
+ .catch(require('@oclif/errors/handle'))*/
@@ -1 +1 @@
1
- {"version":"1.0.0","commands":{"audit":{"id":"audit","description":"Check if the configuration object has slug, description and repository property\n...\nExtra documentation goes here\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[]},"clean":{"id":"clean","description":"Clean the configuration object\n...\nExtra documentation goes here\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[]},"download":{"id":"download","description":"Describe the command here\n...\nExtra documentation goes here\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"hello":{"id":"hello","description":"Describe the command here\n...\nExtra documentation goes here\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"name":{"name":"name","type":"option","char":"n","description":"name to print"}},"args":[]},"init":{"id":"init","description":"Create a new learning package: Book, Tutorial or Exercise","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"grading":{"name":"grading","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"login":{"id":"login","description":"Describe the command here\n...\nExtra documentation goes here\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"logout":{"id":"logout","description":"Describe the command here\n...\nExtra documentation goes here\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"publish":{"id":"publish","description":"Describe the command here\n...\nExtra documentation goes here\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"start":{"id":"start","description":"Runs a small server with all the exercise instructions","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"port":{"name":"port","type":"option","char":"p","description":"server port"},"host":{"name":"host","type":"option","char":"h","description":"server host"},"disableGrading":{"name":"disableGrading","type":"boolean","char":"dg","description":"disble grading functionality","allowNo":false},"watch":{"name":"watch","type":"boolean","char":"w","description":"Watch for file changes","allowNo":false},"mode":{"name":"mode","type":"option","char":"m","description":"Load a standalone editor or just the preview to be embeded in another editor: Choices: [standalone, preview]","options":["standalone","preview"]},"version":{"name":"version","type":"option","char":"v","description":"E.g: 1.0.1","default":null},"grading":{"name":"grading","type":"option","char":"g","description":"[isolated, incremental]","options":["isolated","incremental"]},"debug":{"name":"debug","type":"boolean","char":"d","description":"debugger mode for more verbage","allowNo":false}},"args":[]},"test":{"id":"test","description":"Test exercises","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"exerciseSlug","description":"The name of the exercise to test","required":false,"hidden":false}]}}}
1
+ {"version":"2.0.3","commands":{"audit":{"id":"audit","description":"learnpack audit is the command in charge of creating an auditory of the repository\n...\nlearnpack audit checks for the following information in a repository:\n 1. The configuration object has slug, repository and description. (Error)\n 2. The command learnpack clean has been run. (Error)\n 3. If a markdown or test file doesn't have any content. (Error)\n 4. The links are accessing to valid servers. (Error)\n 5. The relative images are working (If they have the shortest path to the image or if the images exists in the assets). (Error)\n 6. The external images are working (If they are pointing to a valid server). (Error)\n 7. The exercises directory names are valid. (Error)\n 8. If an exercise doesn't have a README file. (Error)\n 9. The exercises array (Of the config file) has content. (Error)\n 10. The exercses have the same translations. (Warning)\n 11. The .gitignore file exists. (Warning)\n 12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[]},"clean":{"id":"clean","description":"Clean the configuration object\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[]},"download":{"id":"download","description":"Describe the command here\n...\nExtra documentation goes here\n","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"init":{"id":"init","description":"Create a new learning package: Book, Tutorial or Exercise","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"grading":{"name":"grading","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"login":{"id":"login","description":"Describe the command here\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"logout":{"id":"logout","description":"Describe the command here\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"publish":{"id":"publish","description":"Describe the command here\n ...\n Extra documentation goes here\n ","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"package","description":"The unique string that identifies this package on learnpack","required":false,"hidden":false}]},"start":{"id":"start","description":"Runs a small server with all the exercise instructions","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"port":{"name":"port","type":"option","char":"p","description":"server port"},"host":{"name":"host","type":"option","char":"h","description":"server host"},"disableGrading":{"name":"disableGrading","type":"boolean","char":"D","description":"disble grading functionality","allowNo":false},"watch":{"name":"watch","type":"boolean","char":"w","description":"Watch for file changes","allowNo":false},"editor":{"name":"editor","type":"option","char":"e","description":"[standalone, gitpod]","options":["standalone","gitpod"]},"version":{"name":"version","type":"option","char":"v","description":"E.g: 1.0.1"},"grading":{"name":"grading","type":"option","char":"g","description":"[isolated, incremental]","options":["isolated","incremental"]},"debug":{"name":"debug","type":"boolean","char":"d","description":"debugger mode for more verbage","allowNo":false}},"args":[]},"test":{"id":"test","description":"Test exercises","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[{"name":"exerciseSlug","description":"The name of the exercise to test","required":false,"hidden":false}]}}}