@learnpack/learnpack 5.0.40 → 5.0.41

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 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.40 win32-x64 node-v22.14.0
24
+ @learnpack/learnpack/5.0.41 win32-x64 node-v22.14.0
25
25
  $ learnpack --help [COMMAND]
26
26
  USAGE
27
27
  $ learnpack COMMAND
@@ -79,7 +79,7 @@ DESCRIPTION
79
79
  12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)
80
80
  ```
81
81
 
82
- _See code: [src\commands\audit.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.40/src\commands\audit.ts)_
82
+ _See code: [src\commands\audit.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.41/src\commands\audit.ts)_
83
83
 
84
84
  ## `learnpack breakToken`
85
85
 
@@ -94,7 +94,7 @@ OPTIONS
94
94
  -y, --yes Skip all prompts and initialize an empty project
95
95
  ```
96
96
 
97
- _See code: [src\commands\breakToken.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.40/src\commands\breakToken.ts)_
97
+ _See code: [src\commands\breakToken.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.41/src\commands\breakToken.ts)_
98
98
 
99
99
  ## `learnpack clean`
100
100
 
@@ -109,7 +109,7 @@ DESCRIPTION
109
109
  Extra documentation goes here
110
110
  ```
111
111
 
112
- _See code: [src\commands\clean.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.40/src\commands\clean.ts)_
112
+ _See code: [src\commands\clean.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.41/src\commands\clean.ts)_
113
113
 
114
114
  ## `learnpack download [PACKAGE]`
115
115
 
@@ -127,7 +127,7 @@ DESCRIPTION
127
127
  Extra documentation goes here
128
128
  ```
129
129
 
130
- _See code: [src\commands\download.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.40/src\commands\download.ts)_
130
+ _See code: [src\commands\download.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.41/src\commands\download.ts)_
131
131
 
132
132
  ## `learnpack help [COMMAND]`
133
133
 
@@ -159,7 +159,7 @@ OPTIONS
159
159
  -y, --yes Skip all prompts and initialize an empty project
160
160
  ```
161
161
 
162
- _See code: [src\commands\init.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.40/src\commands\init.ts)_
162
+ _See code: [src\commands\init.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.41/src\commands\init.ts)_
163
163
 
164
164
  ## `learnpack login [PACKAGE]`
165
165
 
@@ -177,7 +177,7 @@ DESCRIPTION
177
177
  Extra documentation goes here
178
178
  ```
179
179
 
180
- _See code: [src\commands\login.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.40/src\commands\login.ts)_
180
+ _See code: [src\commands\login.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.41/src\commands\login.ts)_
181
181
 
182
182
  ## `learnpack logout [PACKAGE]`
183
183
 
@@ -195,7 +195,7 @@ DESCRIPTION
195
195
  Extra documentation goes here
196
196
  ```
197
197
 
198
- _See code: [src\commands\logout.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.40/src\commands\logout.ts)_
198
+ _See code: [src\commands\logout.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.41/src\commands\logout.ts)_
199
199
 
200
200
  ## `learnpack plugins`
201
201
 
@@ -327,7 +327,7 @@ OPTIONS
327
327
  -s, --strict strict mode
328
328
  ```
329
329
 
330
- _See code: [src\commands\publish.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.40/src\commands\publish.ts)_
330
+ _See code: [src\commands\publish.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.41/src\commands\publish.ts)_
331
331
 
332
332
  ## `learnpack start`
333
333
 
@@ -349,7 +349,7 @@ OPTIONS
349
349
  -y, --yes Skip all prompts and initialize an empty project
350
350
  ```
351
351
 
352
- _See code: [src\commands\start.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.40/src\commands\start.ts)_
352
+ _See code: [src\commands\start.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.41/src\commands\start.ts)_
353
353
 
354
354
  ## `learnpack test [EXERCISESLUG]`
355
355
 
@@ -366,7 +366,7 @@ OPTIONS
366
366
  -y, --yes Skip all prompts and initialize an empty project
367
367
  ```
368
368
 
369
- _See code: [src\commands\test.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.40/src\commands\test.ts)_
369
+ _See code: [src\commands\test.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.41/src\commands\test.ts)_
370
370
 
371
371
  ## `learnpack translate`
372
372
 
@@ -380,7 +380,7 @@ OPTIONS
380
380
  -y, --yes Skip all prompts and initialize an empty project
381
381
  ```
382
382
 
383
- _See code: [src\commands\translate.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.40/src\commands\translate.ts)_
383
+ _See code: [src\commands\translate.ts](https://github.com/learnpack/learnpack-cli/blob/v5.0.41/src\commands\translate.ts)_
384
384
  <!-- commandsstop -->
385
385
 
386
386
  > > > > > > > 0cb3e56d84c197f9d008836bb573eade212b7e57
@@ -27,15 +27,23 @@ const PARAMS = {
27
27
  max_rewrite_attempts: 3,
28
28
  max_title_length: 50,
29
29
  };
30
- const whichTargetAudience = async () => {
30
+ const whichTargetAudienceAndEstimatedDuration = async () => {
31
31
  const res = await prompts([
32
32
  {
33
33
  type: "text",
34
34
  name: "targetAudience",
35
35
  message: "What is the target audience for this tutorial?",
36
36
  },
37
+ {
38
+ type: "number",
39
+ name: "estimatedDuration",
40
+ message: "What is the estimated duration for this tutorial in minutes?",
41
+ },
37
42
  ]);
38
- return res.targetAudience;
43
+ return {
44
+ targetAudience: res.targetAudience,
45
+ estimatedDuration: res.estimatedDuration,
46
+ };
39
47
  };
40
48
  async function processExercise(rigoToken, steps, packageContext, exercise, exercisesDir) {
41
49
  const { exNumber, exTitle, kind, description } = (0, creatorUtilities_1.getExInfo)(exercise);
@@ -196,13 +204,14 @@ const handleAILogic = async (tutorialDir, packageInfo) => {
196
204
  process.exit(1);
197
205
  }
198
206
  console_1.default.success("🎉 Let's begin this learning journey!");
199
- const targetAudience = await whichTargetAudience();
207
+ const { targetAudience, estimatedDuration } = await whichTargetAudienceAndEstimatedDuration();
200
208
  const contentIndex = await appendContentIndex();
201
209
  let packageContext = `
202
210
  \n
203
211
  Title: "${packageInfo.title.us}"
204
212
  Description: "${packageInfo.description.us}"
205
213
  Target Audience: "${targetAudience}"
214
+ Estimated Duration: "${estimatedDuration} minutes"
206
215
 
207
216
  ${contentIndex ?
208
217
  `Content Index submitted by the user, use this to guide your creation. Keep in mind that your tutorial should contain these topics:
@@ -212,6 +221,12 @@ const handleAILogic = async (tutorialDir, packageInfo) => {
212
221
  ` :
213
222
  ""}
214
223
 
224
+ Keep in mind that depending on the type of exercise, the duration will vary.
225
+ This is the duration for each type of exercise:
226
+ ${Object.entries(durationByKind)
227
+ .map(([key, value]) => `${key}: ${value} minutes`)
228
+ .join("\n")}
229
+
215
230
  `;
216
231
  const { steps, title, description, duration, difficulty } = await initializeInteractiveCreation(rigoToken, packageContext);
217
232
  packageInfo.title.us = title;
@@ -1 +1 @@
1
- {"version":"5.0.40","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":{"strict":{"name":"strict","type":"boolean","char":"s","description":"strict mode","allowNo":false}},"args":[]},"breakToken":{"id":"breakToken","description":"Break the token","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false},"grading":{"name":"grading","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"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":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false},"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":{"strict":{"name":"strict","type":"boolean","char":"s","description":"strict mode","allowNo":false},"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":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false},"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":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false}},"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":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false}},"args":[]}}}
1
+ {"version":"5.0.41","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":{"strict":{"name":"strict","type":"boolean","char":"s","description":"strict mode","allowNo":false}},"args":[]},"breakToken":{"id":"breakToken","description":"Break the token","pluginName":"@learnpack/learnpack","pluginType":"core","aliases":[],"flags":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false},"grading":{"name":"grading","type":"boolean","char":"h","description":"show CLI help","allowNo":false}},"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":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false},"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":{"strict":{"name":"strict","type":"boolean","char":"s","description":"strict mode","allowNo":false},"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":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false},"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":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false}},"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":{"yes":{"name":"yes","type":"boolean","char":"y","description":"Skip all prompts and initialize an empty project","allowNo":false}},"args":[]}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@learnpack/learnpack",
3
3
  "description": "Seamlessly build, sell and/or take interactive & auto-graded tutorials, start learning now or build a new tutorial to your audience.",
4
- "version": "5.0.40",
4
+ "version": "5.0.41",
5
5
  "author": "Alejandro Sanchez @alesanchezr",
6
6
  "contributors": [
7
7
  {
@@ -50,15 +50,23 @@ const PARAMS = {
50
50
  max_title_length: 50,
51
51
  }
52
52
 
53
- const whichTargetAudience = async () => {
53
+ const whichTargetAudienceAndEstimatedDuration = async () => {
54
54
  const res = await prompts([
55
55
  {
56
56
  type: "text",
57
57
  name: "targetAudience",
58
58
  message: "What is the target audience for this tutorial?",
59
59
  },
60
+ {
61
+ type: "number",
62
+ name: "estimatedDuration",
63
+ message: "What is the estimated duration for this tutorial in minutes?",
64
+ },
60
65
  ])
61
- return res.targetAudience
66
+ return {
67
+ targetAudience: res.targetAudience,
68
+ estimatedDuration: res.estimatedDuration,
69
+ }
62
70
  }
63
71
 
64
72
  async function processExercise(
@@ -308,7 +316,8 @@ const handleAILogic = async (tutorialDir: string, packageInfo: PackageInfo) => {
308
316
 
309
317
  Console.success("🎉 Let's begin this learning journey!")
310
318
 
311
- const targetAudience = await whichTargetAudience()
319
+ const { targetAudience, estimatedDuration } =
320
+ await whichTargetAudienceAndEstimatedDuration()
312
321
  const contentIndex = await appendContentIndex()
313
322
 
314
323
  let packageContext = `
@@ -316,6 +325,7 @@ const handleAILogic = async (tutorialDir: string, packageInfo: PackageInfo) => {
316
325
  Title: "${packageInfo.title.us}"
317
326
  Description: "${packageInfo.description.us}"
318
327
  Target Audience: "${targetAudience}"
328
+ Estimated Duration: "${estimatedDuration} minutes"
319
329
 
320
330
  ${
321
331
  contentIndex ?
@@ -327,6 +337,12 @@ const handleAILogic = async (tutorialDir: string, packageInfo: PackageInfo) => {
327
337
  ""
328
338
  }
329
339
 
340
+ Keep in mind that depending on the type of exercise, the duration will vary.
341
+ This is the duration for each type of exercise:
342
+ ${Object.entries(durationByKind)
343
+ .map(([key, value]) => `${key}: ${value} minutes`)
344
+ .join("\n")}
345
+
330
346
  `
331
347
 
332
348
  const { steps, title, description, duration, difficulty } =