@learnpack/learnpack 5.0.6 → 5.0.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (71) hide show
  1. package/README.md +17 -17
  2. package/bin/run +17 -17
  3. package/bin/run.cmd +3 -3
  4. package/lib/commands/audit.js +30 -21
  5. package/lib/commands/clean.js +3 -3
  6. package/lib/commands/download.js +3 -3
  7. package/lib/commands/init.js +29 -4
  8. package/lib/commands/login.js +3 -3
  9. package/lib/commands/logout.js +3 -3
  10. package/lib/utils/rigoActions.d.ts +5 -0
  11. package/lib/utils/rigoActions.js +15 -1
  12. package/oclif.manifest.json +1 -1
  13. package/package.json +152 -152
  14. package/src/commands/audit.ts +449 -443
  15. package/src/commands/clean.ts +29 -29
  16. package/src/commands/download.ts +61 -61
  17. package/src/commands/init.ts +40 -12
  18. package/src/commands/login.ts +42 -42
  19. package/src/commands/logout.ts +43 -43
  20. package/src/commands/test.ts +85 -85
  21. package/src/index.ts +1 -1
  22. package/src/managers/config/allowed_files.ts +29 -29
  23. package/src/managers/gitpod.ts +84 -84
  24. package/src/managers/server/index.ts +78 -78
  25. package/src/managers/telemetry.ts +353 -353
  26. package/src/managers/test.ts +83 -83
  27. package/src/models/audit.ts +16 -16
  28. package/src/models/config-manager.ts +23 -23
  29. package/src/models/counter.ts +11 -11
  30. package/src/models/errors.ts +22 -22
  31. package/src/models/exercise-obj.ts +29 -29
  32. package/src/models/file.ts +5 -5
  33. package/src/models/findings.ts +18 -18
  34. package/src/models/flags.ts +10 -10
  35. package/src/models/front-matter.ts +11 -11
  36. package/src/models/gitpod-data.ts +19 -19
  37. package/src/models/language.ts +4 -4
  38. package/src/models/package.ts +7 -7
  39. package/src/models/plugin-config.ts +17 -17
  40. package/src/models/success-types.ts +1 -1
  41. package/src/plugin/command/compile.ts +17 -17
  42. package/src/plugin/command/test.ts +30 -30
  43. package/src/plugin/index.ts +6 -6
  44. package/src/plugin/plugin.ts +94 -94
  45. package/src/plugin/utils.ts +87 -87
  46. package/src/types/node-fetch.d.ts +1 -1
  47. package/src/ui/download.ts +71 -71
  48. package/src/utils/BaseCommand.ts +48 -48
  49. package/src/utils/SessionCommand.ts +43 -43
  50. package/src/utils/audit.ts +393 -393
  51. package/src/utils/errors.ts +117 -117
  52. package/src/utils/exercisesQueue.ts +51 -51
  53. package/src/utils/fileQueue.ts +199 -199
  54. package/src/utils/misc.ts +23 -23
  55. package/src/utils/osOperations.ts +79 -79
  56. package/src/utils/rigoActions.ts +27 -0
  57. package/src/utils/templates/gitignore.txt +19 -19
  58. package/src/utils/templates/incremental/.learn/exercises/01-hello-world/README.es.md +24 -24
  59. package/src/utils/templates/incremental/.learn/exercises/01-hello-world/README.md +24 -24
  60. package/src/utils/templates/incremental/.vscode/schema.json +121 -121
  61. package/src/utils/templates/incremental/.vscode/settings.json +13 -13
  62. package/src/utils/templates/incremental/README.ejs +4 -4
  63. package/src/utils/templates/incremental/README.es.ejs +4 -4
  64. package/src/utils/templates/isolated/.vscode/schema.json +121 -121
  65. package/src/utils/templates/isolated/.vscode/settings.json +13 -13
  66. package/src/utils/templates/isolated/README.ejs +4 -4
  67. package/src/utils/templates/isolated/README.es.ejs +4 -4
  68. package/src/utils/templates/no-grading/README.ejs +4 -4
  69. package/src/utils/templates/no-grading/README.es.ejs +4 -4
  70. package/src/utils/validators.ts +18 -18
  71. package/src/utils/watcher.ts +27 -27
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.6 win32-x64 node-v20.16.0
24
+ @learnpack/learnpack/5.0.8 darwin-arm64 node-v16.20.0
25
25
  $ learnpack --help [COMMAND]
26
26
  USAGE
27
27
  $ learnpack COMMAND
@@ -75,7 +75,7 @@ DESCRIPTION
75
75
  12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)
76
76
  ```
77
77
 
78
- _See code: [src\commands\audit.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.6/src\commands\audit.ts)_
78
+ _See code: [src/commands/audit.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.8/src/commands/audit.ts)_
79
79
 
80
80
  ## `learnpack clean`
81
81
 
@@ -90,7 +90,7 @@ DESCRIPTION
90
90
  Extra documentation goes here
91
91
  ```
92
92
 
93
- _See code: [src\commands\clean.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.6/src\commands\clean.ts)_
93
+ _See code: [src/commands/clean.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.8/src/commands/clean.ts)_
94
94
 
95
95
  ## `learnpack download [PACKAGE]`
96
96
 
@@ -108,7 +108,7 @@ DESCRIPTION
108
108
  Extra documentation goes here
109
109
  ```
110
110
 
111
- _See code: [src\commands\download.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.6/src\commands\download.ts)_
111
+ _See code: [src/commands/download.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.8/src/commands/download.ts)_
112
112
 
113
113
  ## `learnpack help [COMMAND]`
114
114
 
@@ -125,7 +125,7 @@ OPTIONS
125
125
  --all see all commands in CLI
126
126
  ```
127
127
 
128
- _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.1.0/src\commands\help.ts)_
128
+ _See code: [@oclif/plugin-help](https://github.com/oclif/plugin-help/blob/v3.1.0/src/commands/help.ts)_
129
129
 
130
130
  ## `learnpack init`
131
131
 
@@ -139,7 +139,7 @@ OPTIONS
139
139
  -h, --grading show CLI help
140
140
  ```
141
141
 
142
- _See code: [src\commands\init.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.6/src\commands\init.ts)_
142
+ _See code: [src/commands/init.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.8/src/commands/init.ts)_
143
143
 
144
144
  ## `learnpack login [PACKAGE]`
145
145
 
@@ -157,7 +157,7 @@ DESCRIPTION
157
157
  Extra documentation goes here
158
158
  ```
159
159
 
160
- _See code: [src\commands\login.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.6/src\commands\login.ts)_
160
+ _See code: [src/commands/login.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.8/src/commands/login.ts)_
161
161
 
162
162
  ## `learnpack logout [PACKAGE]`
163
163
 
@@ -175,7 +175,7 @@ DESCRIPTION
175
175
  Extra documentation goes here
176
176
  ```
177
177
 
178
- _See code: [src\commands\logout.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.6/src\commands\logout.ts)_
178
+ _See code: [src/commands/logout.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.8/src/commands/logout.ts)_
179
179
 
180
180
  ## `learnpack plugins`
181
181
 
@@ -192,7 +192,7 @@ EXAMPLE
192
192
  $ learnpack plugins
193
193
  ```
194
194
 
195
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src\commands\plugins\index.ts)_
195
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src/commands/plugins/index.ts)_
196
196
 
197
197
  ## `learnpack plugins:install PLUGIN...`
198
198
 
@@ -228,7 +228,7 @@ EXAMPLES
228
228
  $ learnpack plugins:install someuser/someplugin
229
229
  ```
230
230
 
231
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src\commands\plugins\install.ts)_
231
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src/commands/plugins/install.ts)_
232
232
 
233
233
  ## `learnpack plugins:link PLUGIN`
234
234
 
@@ -255,7 +255,7 @@ EXAMPLE
255
255
  $ learnpack plugins:link myplugin
256
256
  ```
257
257
 
258
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src\commands\plugins\link.ts)_
258
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src/commands/plugins/link.ts)_
259
259
 
260
260
  ## `learnpack plugins:uninstall PLUGIN...`
261
261
 
@@ -277,7 +277,7 @@ ALIASES
277
277
  $ learnpack plugins:remove
278
278
  ```
279
279
 
280
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src\commands\plugins\uninstall.ts)_
280
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src/commands/plugins/uninstall.ts)_
281
281
 
282
282
  ## `learnpack plugins:update`
283
283
 
@@ -292,7 +292,7 @@ OPTIONS
292
292
  -v, --verbose
293
293
  ```
294
294
 
295
- _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src\commands\plugins\update.ts)_
295
+ _See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src/commands/plugins/update.ts)_
296
296
 
297
297
  ## `learnpack publish`
298
298
 
@@ -306,7 +306,7 @@ OPTIONS
306
306
  -h, --help show CLI help
307
307
  ```
308
308
 
309
- _See code: [src\commands\publish.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.6/src\commands\publish.ts)_
309
+ _See code: [src/commands/publish.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.8/src/commands/publish.ts)_
310
310
 
311
311
  ## `learnpack start`
312
312
 
@@ -327,7 +327,7 @@ OPTIONS
327
327
  -w, --watch Watch for file changes
328
328
  ```
329
329
 
330
- _See code: [src\commands\start.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.6/src\commands\start.ts)_
330
+ _See code: [src/commands/start.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.8/src/commands/start.ts)_
331
331
 
332
332
  ## `learnpack test [EXERCISESLUG]`
333
333
 
@@ -341,7 +341,7 @@ ARGUMENTS
341
341
  EXERCISESLUG The name of the exercise to test
342
342
  ```
343
343
 
344
- _See code: [src\commands\test.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.6/src\commands\test.ts)_
344
+ _See code: [src/commands/test.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.8/src/commands/test.ts)_
345
345
 
346
346
  ## `learnpack translate`
347
347
 
@@ -352,7 +352,7 @@ USAGE
352
352
  $ learnpack translate
353
353
  ```
354
354
 
355
- _See code: [src\commands\translate.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.6/src\commands\translate.ts)_
355
+ _See code: [src/commands/translate.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.8/src/commands/translate.ts)_
356
356
  <!-- commandsstop -->
357
357
 
358
358
  > > > > > > > 0cb3e56d84c197f9d008836bb573eade212b7e57
package/bin/run CHANGED
@@ -1,17 +1,17 @@
1
- #!/usr/bin/env node
2
-
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()
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
+ #!/usr/bin/env node
2
+
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()
13
+ .catch(require('@oclif/errors/handle'))
14
+
15
+ /*require('@oclif/command').run()
16
+ .then(require('@oclif/command/flush'))
17
+ .catch(require('@oclif/errors/handle'))*/
package/bin/run.cmd CHANGED
@@ -1,3 +1,3 @@
1
- @echo off
2
-
3
- node "%~dp0\run" %*
1
+ @echo off
2
+
3
+ node "%~dp0\run" %*
@@ -14,7 +14,7 @@ class AuditCommand extends SessionCommand_1.default {
14
14
  await this.initSession(flags);
15
15
  }
16
16
  async run() {
17
- var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m;
17
+ var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o;
18
18
  console_1.default.log("Running command audit...");
19
19
  // Get configuration object.
20
20
  let config = (_a = this.configManager) === null || _a === void 0 ? void 0 : _a.get();
@@ -114,6 +114,11 @@ class AuditCommand extends SessionCommand_1.default {
114
114
  exercise: undefined,
115
115
  msg: "The description property is not in the configuration object",
116
116
  });
117
+ if (!((_o = config.config) === null || _o === void 0 ? void 0 : _o.projectType))
118
+ errors.push({
119
+ exercise: undefined,
120
+ msg: "The projectType property mandatory in the configuration object",
121
+ });
117
122
  if (errors.length === 0)
118
123
  console_1.default.log("The config file is ok");
119
124
  // Validates if images and links are working at every README file.
@@ -231,11 +236,15 @@ class AuditCommand extends SessionCommand_1.default {
231
236
  }
232
237
  else {
233
238
  // This is the audit code for Projects
234
- // Getting the learn.json schema
235
- const schemaResponse = await fetch("https://raw.githubusercontent.com/tommygonzaleza/project-template/main/.github/learn-schema.json");
236
- const schema = await schemaResponse.json();
237
239
  // Checking the "learn.json" file:
238
- const learnjson = JSON.parse(fs.readFileSync("./learn.json").toString());
240
+ let learnjson;
241
+ try {
242
+ learnjson = JSON.parse(fs.readFileSync("./learn.json").toString());
243
+ }
244
+ catch (_error) {
245
+ console_1.default.error("Invalid JSON syntax in learn.json file:", _error.message);
246
+ process.exit(1);
247
+ }
239
248
  if (!learnjson) {
240
249
  console_1.default.error("There is no learn.json file located in the root of the project.");
241
250
  process.exit(1);
@@ -297,7 +306,7 @@ class AuditCommand extends SessionCommand_1.default {
297
306
  });
298
307
  }
299
308
  }
300
- catch (_o) {
309
+ catch (_p) {
301
310
  errors.push({
302
311
  exercise: undefined,
303
312
  msg: `The link of the "preview" is broken: ${learnjson.preview}`,
@@ -320,21 +329,21 @@ class AuditCommand extends SessionCommand_1.default {
320
329
  }
321
330
  }
322
331
  }
323
- AuditCommand.description = `learnpack audit is the command in charge of creating an auditory of the repository
324
- ...
325
- learnpack audit checks for the following information in a repository:
326
- 1. The configuration object has slug, repository and description. (Error)
327
- 2. The command learnpack clean has been run. (Error)
328
- 3. If a markdown or test file doesn't have any content. (Error)
329
- 4. The links are accessing to valid servers. (Error)
330
- 5. The relative images are working (If they have the shortest path to the image or if the images exists in the assets). (Error)
331
- 6. The external images are working (If they are pointing to a valid server). (Error)
332
- 7. The exercises directory names are valid. (Error)
333
- 8. If an exercise doesn't have a README file. (Error)
334
- 9. The exercises array (Of the config file) has content. (Error)
335
- 10. The exercses have the same translations. (Warning)
336
- 11. The .gitignore file exists. (Warning)
337
- 12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)
332
+ AuditCommand.description = `learnpack audit is the command in charge of creating an auditory of the repository
333
+ ...
334
+ learnpack audit checks for the following information in a repository:
335
+ 1. The configuration object has slug, repository and description. (Error)
336
+ 2. The command learnpack clean has been run. (Error)
337
+ 3. If a markdown or test file doesn't have any content. (Error)
338
+ 4. The links are accessing to valid servers. (Error)
339
+ 5. The relative images are working (If they have the shortest path to the image or if the images exists in the assets). (Error)
340
+ 6. The external images are working (If they are pointing to a valid server). (Error)
341
+ 7. The exercises directory names are valid. (Error)
342
+ 8. If an exercise doesn't have a README file. (Error)
343
+ 9. The exercises array (Of the config file) has content. (Error)
344
+ 10. The exercses have the same translations. (Warning)
345
+ 11. The .gitignore file exists. (Warning)
346
+ 12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)
338
347
  `;
339
348
  AuditCommand.flags = {
340
349
  // name: flags.string({char: 'n', description: 'name to print'}),
@@ -15,9 +15,9 @@ class CleanCommand extends SessionCommand_1.default {
15
15
  console_1.default.success("Package cleaned successfully, ready to publish");
16
16
  }
17
17
  }
18
- CleanCommand.description = `Clean the configuration object
19
- ...
20
- Extra documentation goes here
18
+ CleanCommand.description = `Clean the configuration object
19
+ ...
20
+ Extra documentation goes here
21
21
  `;
22
22
  CleanCommand.flags = {
23
23
  // name: flags.string({char: 'n', description: 'name to print'}),
@@ -37,9 +37,9 @@ class DownloadCommand extends command_1.Command {
37
37
  catch (_a) { }
38
38
  }
39
39
  }
40
- DownloadCommand.description = `Describe the command here
41
- ...
42
- Extra documentation goes here
40
+ DownloadCommand.description = `Describe the command here
41
+ ...
42
+ Extra documentation goes here
43
43
  `;
44
44
  DownloadCommand.flags = {
45
45
  // name: flags.string({char: 'n', description: 'name to print'}),
@@ -6,7 +6,6 @@ const BaseCommand_1 = require("../utils/BaseCommand");
6
6
  const fs = require("fs-extra");
7
7
  const prompts = require("prompts");
8
8
  const cli_ux_1 = require("cli-ux");
9
- const eta = require("eta");
10
9
  const api_1 = require("../utils/api");
11
10
  const console_1 = require("../utils/console");
12
11
  const errors_1 = require("../utils/errors");
@@ -39,6 +38,14 @@ function extractImagesFromMarkdown(markdown) {
39
38
  function getFilenameFromUrl(url) {
40
39
  return path.basename(url);
41
40
  }
41
+ async function createPreviewReadme(tutorialDir, packageInfo, rigoToken, readmeContents) {
42
+ const readmeFilename = `README.md`;
43
+ const readmeContent = await (0, rigoActions_1.generateCourseIntroduction)(rigoToken, {
44
+ course_title: packageInfo.title.us,
45
+ lessons_context: readmeContents.join("\n"),
46
+ });
47
+ fs.writeFileSync(path.join(tutorialDir, readmeFilename), readmeContent.answer);
48
+ }
42
49
  const handleAILogic = async (tutorialDir, packageInfo) => {
43
50
  console_1.default.info("Almost there! First you need to login to use the AI creator");
44
51
  fs.removeSync(path.join(tutorialDir, "exercises", "01-hello-world"));
@@ -150,6 +157,8 @@ const handleAILogic = async (tutorialDir, packageInfo) => {
150
157
  });
151
158
  await Promise.all(imagePromises);
152
159
  console_1.default.info("Images generated successfully! 🎉 Your tutorial will be ready soon!");
160
+ console_1.default.info("Creating preview readme...");
161
+ await createPreviewReadme(tutorialDir, packageInfo, rigoToken, readmeContents);
153
162
  return true;
154
163
  };
155
164
  class InitComand extends BaseCommand_1.default {
@@ -250,9 +259,25 @@ class InitComand extends BaseCommand_1.default {
250
259
  // Creating README files
251
260
  for (const language of languages) {
252
261
  const readmeFilename = `README${language !== "en" ? `.${language}` : ""}`;
253
- const readmeTemplatePath = path.resolve(templatesDir, `${readmeFilename}.ejs`);
254
- const readmeContent = eta.render(fs.readFileSync(readmeTemplatePath, "utf-8"), packageInfo);
255
- fs.writeFileSync(path.join(tutorialDir, `${readmeFilename}.md`), readmeContent);
262
+ // const readmeTemplatePath = path.resolve(
263
+ // templatesDir,
264
+ // `${readmeFilename}.ejs`
265
+ // )
266
+ // const readmeObject = {
267
+ // title: packageInfo.title.us,
268
+ // description: packageInfo.description.us,
269
+ // grading: packageInfo.grading,
270
+ // difficulty: packageInfo.difficulty,
271
+ // duration: packageInfo.duration,
272
+ // }
273
+ // const readmeContent = eta.render(
274
+ // fs.readFileSync(readmeTemplatePath, "utf-8"),
275
+ // readmeObject
276
+ // )
277
+ // fs.writeFileSync(
278
+ // path.join(tutorialDir, `${readmeFilename}.md`),
279
+ // readmeContent
280
+ // )
256
281
  if (fs.existsSync(path.join(tutorialDir, `${readmeFilename}.ejs`)))
257
282
  fs.removeSync(path.join(tutorialDir, `${readmeFilename}.ejs`));
258
283
  }
@@ -19,9 +19,9 @@ class LoginCommand extends SessionCommand_1.default {
19
19
  }
20
20
  }
21
21
  }
22
- LoginCommand.description = `Describe the command here
23
- ...
24
- Extra documentation goes here
22
+ LoginCommand.description = `Describe the command here
23
+ ...
24
+ Extra documentation goes here
25
25
  `;
26
26
  LoginCommand.flags = {
27
27
  // name: flags.string({char: 'n', description: 'name to print'}),
@@ -19,9 +19,9 @@ class LogoutCommand extends SessionCommand_1.default {
19
19
  session_1.default.destroy();
20
20
  }
21
21
  }
22
- LogoutCommand.description = `Describe the command here
23
- ...
24
- Extra documentation goes here
22
+ LogoutCommand.description = `Describe the command here
23
+ ...
24
+ Extra documentation goes here
25
25
  `;
26
26
  LogoutCommand.flags = {
27
27
  // name: flags.string({char: 'n', description: 'name to print'}),
@@ -17,4 +17,9 @@ type TTranslateInputs = {
17
17
  output_language: string;
18
18
  };
19
19
  export declare const translateExercise: (token: string, inputs: TTranslateInputs) => Promise<any>;
20
+ type TGenerateCourseIntroductionInputs = {
21
+ course_title: string;
22
+ lessons_context: string;
23
+ };
24
+ export declare const generateCourseIntroduction: (token: string, inputs: TGenerateCourseIntroductionInputs) => Promise<any>;
20
25
  export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.translateExercise = exports.generateImage = exports.hasCreatorPermission = exports.createReadme = exports.getExercisesNames = void 0;
3
+ exports.generateCourseIntroduction = exports.translateExercise = exports.generateImage = exports.hasCreatorPermission = exports.createReadme = exports.getExercisesNames = void 0;
4
4
  exports.downloadImage = downloadImage;
5
5
  const axios_1 = require("axios");
6
6
  const fs_1 = require("fs");
@@ -96,3 +96,17 @@ const translateExercise = async (token, inputs) => {
96
96
  return response.data;
97
97
  };
98
98
  exports.translateExercise = translateExercise;
99
+ const generateCourseIntroduction = async (token, inputs) => {
100
+ const response = await axios_1.default.post(`${RIGOBOT_HOST}/v1/prompting/completion/192/`, {
101
+ inputs: inputs,
102
+ include_purpose_objective: false,
103
+ execute_async: false,
104
+ }, {
105
+ headers: {
106
+ "Content-Type": "application/json",
107
+ Authorization: "Token " + token,
108
+ },
109
+ });
110
+ return response.data;
111
+ };
112
+ exports.generateCourseIntroduction = generateCourseIntroduction;
@@ -1 +1 @@
1
- {"version":"5.0.6","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":"Builds the project by copying necessary files and directories into a zip file","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"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":"[preview, extension]","options":["extension","preview"]},"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}]},"translate":{"id":"translate","description":"List all the lessons, the user is able of select many of them to translate to the given languages","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[]}}}
1
+ {"version":"5.0.8","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":"Builds the project by copying necessary files and directories into a zip file","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"help":{"name":"help","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"args":[]},"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":"[preview, extension]","options":["extension","preview"]},"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}]},"translate":{"id":"translate","description":"List all the lessons, the user is able of select many of them to translate to the given languages","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{},"args":[]}}}