@learnpack/learnpack 5.0.291 → 5.0.292
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/lib/commands/init.js +42 -42
- package/lib/commands/serve.js +492 -33
- package/lib/creatorDist/assets/{index-C39zeF3W.css → index-CacFtcN8.css} +31 -0
- package/lib/creatorDist/assets/{index-wLKEQIG6.js → index-DOEfLGDQ.js} +1424 -1372
- package/lib/creatorDist/index.html +2 -2
- package/lib/models/creator.d.ts +4 -0
- package/lib/utils/api.d.ts +1 -1
- package/lib/utils/api.js +2 -1
- package/lib/utils/rigoActions.d.ts +14 -0
- package/lib/utils/rigoActions.js +43 -1
- package/package.json +1 -1
- package/src/commands/init.ts +655 -650
- package/src/commands/serve.ts +794 -48
- package/src/creator/src/App.tsx +12 -12
- package/src/creator/src/components/FileUploader.tsx +2 -68
- package/src/creator/src/components/LessonItem.tsx +47 -8
- package/src/creator/src/components/Login.tsx +0 -6
- package/src/creator/src/components/syllabus/ContentIndex.tsx +11 -0
- package/src/creator/src/components/syllabus/SyllabusEditor.tsx +6 -1
- package/src/creator/src/index.css +227 -217
- package/src/creator/src/locales/en.json +2 -2
- package/src/creator/src/locales/es.json +2 -2
- package/src/creator/src/utils/lib.ts +470 -468
- package/src/creator/src/utils/rigo.ts +85 -85
- package/src/creatorDist/assets/{index-C39zeF3W.css → index-CacFtcN8.css} +31 -0
- package/src/creatorDist/assets/{index-wLKEQIG6.js → index-DOEfLGDQ.js} +1424 -1372
- package/src/creatorDist/index.html +2 -2
- package/src/models/creator.ts +2 -0
- package/src/ui/_app/app.css +1 -1
- package/src/ui/_app/app.js +363 -361
- package/src/ui/app.tar.gz +0 -0
- package/src/utils/api.ts +2 -1
- package/src/utils/rigoActions.ts +73 -0
package/lib/commands/init.js
CHANGED
@@ -107,9 +107,9 @@ const initializeInteractiveCreation = async (rigoToken, courseInfo) => {
|
|
107
107
|
while (!isReady) {
|
108
108
|
const spinner = (0, ora_1.default)("Thinking...").start();
|
109
109
|
let wholeInfo = courseInfo;
|
110
|
-
wholeInfo += `
|
111
|
-
Current title: ${currentTitle}
|
112
|
-
Current description: ${currentDescription}
|
110
|
+
wholeInfo += `
|
111
|
+
Current title: ${currentTitle}
|
112
|
+
Current description: ${currentDescription}
|
113
113
|
`;
|
114
114
|
// eslint-disable-next-line
|
115
115
|
const res = await (0, rigoActions_1.interactiveCreation)(rigoToken, {
|
@@ -200,56 +200,56 @@ const handleAILogic = async (tutorialDir, packageInfo) => {
|
|
200
200
|
fs.mkdirSync(rulesDir, { recursive: true });
|
201
201
|
fs.writeFileSync(path.join(rulesDir, "airules.txt"), airules);
|
202
202
|
}
|
203
|
-
let packageContext = `
|
204
|
-
\n
|
205
|
-
Title: "${packageInfo.title.us}"
|
206
|
-
Description: "${packageInfo.description.us}"
|
207
|
-
Target Audience: "${targetAudience}"
|
208
|
-
Estimated Duration: "${estimatedDuration} minutes"
|
209
|
-
|
203
|
+
let packageContext = `
|
204
|
+
\n
|
205
|
+
Title: "${packageInfo.title.us}"
|
206
|
+
Description: "${packageInfo.description.us}"
|
207
|
+
Target Audience: "${targetAudience}"
|
208
|
+
Estimated Duration: "${estimatedDuration} minutes"
|
209
|
+
|
210
210
|
${contentIndex ?
|
211
|
-
`Content Index submitted by the user, use this to guide your creation. Keep in mind that your tutorial should contain these topics:
|
212
|
-
---
|
213
|
-
${contentIndex}
|
214
|
-
---
|
211
|
+
`Content Index submitted by the user, use this to guide your creation. Keep in mind that your tutorial should contain these topics:
|
212
|
+
---
|
213
|
+
${contentIndex}
|
214
|
+
---
|
215
215
|
` :
|
216
|
-
""}
|
217
|
-
|
218
|
-
This is the duration for each type of step, use it to estimate the number of steps to create:
|
216
|
+
""}
|
217
|
+
|
218
|
+
This is the duration for each type of step, use it to estimate the number of steps to create:
|
219
219
|
${Object.entries(durationByKind)
|
220
220
|
.map(([key, value]) => `${key}: ${value} minutes`)
|
221
|
-
.join("\n")}
|
222
|
-
|
223
|
-
|
224
|
-
Within the estimated duration, is possible to have the following activities:
|
225
|
-
Format=
|
226
|
-
Activity: Maximum number of steps for duration
|
227
|
-
|
228
|
-
Estimated activities:
|
229
|
-
${JSON.stringify(estimateActivities(estimatedDuration))}
|
230
|
-
|
231
|
-
You should create a tutorial that is engaging and fun to follow.
|
232
|
-
|
233
|
-
|
221
|
+
.join("\n")}
|
222
|
+
|
223
|
+
|
224
|
+
Within the estimated duration, is possible to have the following activities:
|
225
|
+
Format=
|
226
|
+
Activity: Maximum number of steps for duration
|
227
|
+
|
228
|
+
Estimated activities:
|
229
|
+
${JSON.stringify(estimateActivities(estimatedDuration))}
|
230
|
+
|
231
|
+
You should create a tutorial that is engaging and fun to follow.
|
232
|
+
|
233
|
+
|
234
234
|
${airules ?
|
235
|
-
`
|
236
|
-
This is a list of rules you need to follow when creating the tutorial:
|
237
|
-
${airules}
|
235
|
+
`
|
236
|
+
This is a list of rules you need to follow when creating the tutorial:
|
237
|
+
${airules}
|
238
238
|
` :
|
239
|
-
""}
|
239
|
+
""}
|
240
240
|
`;
|
241
241
|
const { steps, title, description, duration, difficulty } = await initializeInteractiveCreation(rigoToken, packageContext);
|
242
242
|
packageInfo.title.us = title;
|
243
243
|
packageInfo.description.us = description;
|
244
244
|
packageInfo.duration = duration;
|
245
245
|
packageInfo.difficulty = difficulty;
|
246
|
-
packageContext = `
|
247
|
-
Title: "${title}"
|
248
|
-
Description: "${description}"
|
249
|
-
Target Audience: "${targetAudience}"
|
250
|
-
List of exercises: ${steps.join(", ")}
|
251
|
-
|
252
|
-
AI Rules: ${airules}
|
246
|
+
packageContext = `
|
247
|
+
Title: "${title}"
|
248
|
+
Description: "${description}"
|
249
|
+
Target Audience: "${targetAudience}"
|
250
|
+
List of exercises: ${steps.join(", ")}
|
251
|
+
|
252
|
+
AI Rules: ${airules}
|
253
253
|
`;
|
254
254
|
const exercisesDir = path.join(tutorialDir, "exercises");
|
255
255
|
fs.ensureDirSync(exercisesDir);
|
@@ -361,7 +361,7 @@ const getChoices = async (empty) => {
|
|
361
361
|
],
|
362
362
|
},
|
363
363
|
]);
|
364
|
-
const completeChoices = Object.assign(Object.assign({}, choices), { difficulty: "beginner", duration:
|
364
|
+
const completeChoices = Object.assign(Object.assign({}, choices), { difficulty: "beginner", duration: 15 });
|
365
365
|
return completeChoices;
|
366
366
|
};
|
367
367
|
class InitComand extends BaseCommand_1.default {
|