@learnpack/learnpack 2.1.19 → 2.1.24

Sign up to get free protection for your applications and to get access to all the features.
@@ -1,139 +1,302 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const console_1 = require("./console");
4
+ const fs = require("fs");
5
+ const path = require("path");
4
6
  // eslint-disable-next-line
5
7
  const fetch = require("node-fetch");
6
- const fs = require("fs");
7
- exports.default = {
8
- // This function checks if a url is valid.
9
- isUrl: async (url, errors, counter) => {
10
- const regexUrl = /(https?:\/\/[\w./-]+)/gm;
11
- counter.links.total++;
12
- if (!regexUrl.test(url)) {
13
- counter.links.error++;
14
- errors.push({
15
- exercise: undefined,
16
- msg: `The repository value of the configuration file is not a link: ${url}`,
17
- });
8
+ // eslint-disable-next-line
9
+ const fm = require("front-matter");
10
+ // This function checks if a url is valid.
11
+ const isUrl = async (url, errors, counter) => {
12
+ const regexUrl = /(https?:\/\/[\w./-]+)/gm;
13
+ counter.links.total++;
14
+ if (!regexUrl.test(url)) {
15
+ counter.links.error++;
16
+ errors.push({
17
+ exercise: undefined,
18
+ msg: `The repository value of the configuration file is not a link: ${url}`,
19
+ });
20
+ return false;
21
+ }
22
+ const res = await fetch(url, { method: "HEAD" });
23
+ if (!res.ok) {
24
+ counter.links.error++;
25
+ errors.push({
26
+ exercise: undefined,
27
+ msg: `The link of the repository is broken: ${url}`,
28
+ });
29
+ }
30
+ return true;
31
+ };
32
+ const checkForEmptySpaces = (str) => {
33
+ const isEmpty = true;
34
+ for (const letter of str) {
35
+ if (letter !== " ") {
18
36
  return false;
19
37
  }
20
- const res = await fetch(url, { method: "HEAD" });
21
- if (!res.ok) {
22
- counter.links.error++;
23
- errors.push({
24
- exercise: undefined,
25
- msg: `The link of the repository is broken: ${url}`,
26
- });
27
- }
28
- return true;
29
- },
30
- checkForEmptySpaces: (str) => {
31
- const isEmpty = true;
32
- for (const letter of str) {
33
- if (letter !== " ") {
34
- return false;
38
+ }
39
+ return isEmpty;
40
+ };
41
+ const checkLearnpackClean = (configObj, errors) => {
42
+ var _a, _b, _c, _d, _e, _f, _g, _h;
43
+ if ((((_a = configObj.config) === null || _a === void 0 ? void 0 : _a.outputPath) &&
44
+ fs.existsSync((_b = configObj.config) === null || _b === void 0 ? void 0 : _b.outputPath)) ||
45
+ fs.existsSync(`${(_c = configObj.config) === null || _c === void 0 ? void 0 : _c.dirPath}/_app`) ||
46
+ fs.existsSync(`${(_d = configObj.config) === null || _d === void 0 ? void 0 : _d.dirPath}/reports`) ||
47
+ fs.existsSync(`${(_e = configObj.config) === null || _e === void 0 ? void 0 : _e.dirPath}/resets`) ||
48
+ fs.existsSync(`${(_f = configObj.config) === null || _f === void 0 ? void 0 : _f.dirPath}/app.tar.gz`) ||
49
+ fs.existsSync(`${(_g = configObj.config) === null || _g === void 0 ? void 0 : _g.dirPath}/config.json`) ||
50
+ fs.existsSync(`${(_h = configObj.config) === null || _h === void 0 ? void 0 : _h.dirPath}/vscode_queue.json`)) {
51
+ errors.push({
52
+ exercise: undefined,
53
+ msg: "You have to run learnpack clean command",
54
+ });
55
+ }
56
+ };
57
+ const findInFile = (types, content) => {
58
+ const regex = {
59
+ relativeImages: /!\[.*]\s*\((((\.\/)?(\.{2}\/){1,5})(.*\/)*(.[^\s/]*\.[A-Za-z]{2,4})\S*)\)/gm,
60
+ externalImages: /!\[.*]\((https?:\/(\/[^)/]+)+\/?)\)/gm,
61
+ markdownLinks: /(\s)+\[.*]\((https?:\/(\/[^)/]+)+\/?)\)/gm,
62
+ url: /(https?:\/\/[\w./-]+)/gm,
63
+ uploadcare: /https:\/\/ucarecdn.com\/(?:.*\/)*([\w./-]+)/gm,
64
+ };
65
+ const validTypes = Object.keys(regex);
66
+ if (!Array.isArray(types))
67
+ types = [types];
68
+ const findings = {};
69
+ for (const type of types) {
70
+ if (!validTypes.includes(type))
71
+ throw new Error("Invalid type: " + type);
72
+ else
73
+ findings[type] = {};
74
+ }
75
+ for (const type of types) {
76
+ let m;
77
+ while ((m = regex[type].exec(content)) !== null) {
78
+ // This is necessary to avoid infinite loops with zero-width matches
79
+ if (m.index === regex.lastIndex) {
80
+ regex.lastIndex++;
35
81
  }
82
+ // The result can be accessed through the `m`-variable.
83
+ // m.forEach((match, groupIndex) => values.push(match));
84
+ findings[type][m[0]] = {
85
+ content: m[0],
86
+ absUrl: m[1],
87
+ mdUrl: m[2],
88
+ relUrl: m[6],
89
+ };
36
90
  }
37
- return isEmpty;
38
- },
39
- checkLearnpackClean: (configObj, errors) => {
40
- var _a, _b, _c, _d, _e, _f, _g, _h;
41
- if ((((_a = configObj.config) === null || _a === void 0 ? void 0 : _a.outputPath) &&
42
- fs.existsSync((_b = configObj.config) === null || _b === void 0 ? void 0 : _b.outputPath)) ||
43
- fs.existsSync(`${(_c = configObj.config) === null || _c === void 0 ? void 0 : _c.dirPath}/_app`) ||
44
- fs.existsSync(`${(_d = configObj.config) === null || _d === void 0 ? void 0 : _d.dirPath}/reports`) ||
45
- fs.existsSync(`${(_e = configObj.config) === null || _e === void 0 ? void 0 : _e.dirPath}/resets`) ||
46
- fs.existsSync(`${(_f = configObj.config) === null || _f === void 0 ? void 0 : _f.dirPath}/app.tar.gz`) ||
47
- fs.existsSync(`${(_g = configObj.config) === null || _g === void 0 ? void 0 : _g.dirPath}/config.json`) ||
48
- fs.existsSync(`${(_h = configObj.config) === null || _h === void 0 ? void 0 : _h.dirPath}/vscode_queue.json`)) {
49
- errors.push({
50
- exercise: undefined,
51
- msg: "You have to run learnpack clean command",
52
- });
53
- }
54
- },
55
- findInFile: (types, content) => {
56
- const regex = {
57
- relativeImages: /!\[.*]\s*\((((\.\/)?(\.{2}\/){1,5})(.*\/)*(.[^\s/]*\.[A-Za-z]{2,4})\S*)\)/gm,
58
- externalImages: /!\[.*]\((https?:\/(\/[^)/]+)+\/?)\)/gm,
59
- markdownLinks: /(\s)+\[.*]\((https?:\/(\/[^)/]+)+\/?)\)/gm,
60
- url: /(https?:\/\/[\w./-]+)/gm,
61
- uploadcare: /https:\/\/ucarecdn.com\/(?:.*\/)*([\w./-]+)/gm,
62
- };
63
- const validTypes = Object.keys(regex);
64
- if (!Array.isArray(types))
65
- types = [types];
66
- const findings = {};
67
- for (const type of types) {
68
- if (!validTypes.includes(type))
69
- throw new Error("Invalid type: " + type);
70
- else
71
- findings[type] = {};
72
- }
73
- for (const type of types) {
74
- let m;
75
- while ((m = regex[type].exec(content)) !== null) {
76
- // This is necessary to avoid infinite loops with zero-width matches
77
- if (m.index === regex.lastIndex) {
78
- regex.lastIndex++;
91
+ }
92
+ return findings;
93
+ };
94
+ // This function checks that each of the url's are working.
95
+ const checkUrl = async (config, filePath, fileName, exercise, errors, warnings, counter) => {
96
+ var _a, _b, _c, _d;
97
+ if (!fs.existsSync(filePath))
98
+ return false;
99
+ const content = fs.readFileSync(filePath).toString();
100
+ const isEmpty = checkForEmptySpaces(content);
101
+ if (isEmpty || !content)
102
+ errors.push({
103
+ exercise: exercise === null || exercise === void 0 ? void 0 : exercise.title,
104
+ msg: `This file (${fileName}) doesn't have any content inside.`,
105
+ });
106
+ const frontmatter = fm(content);
107
+ for (const attribute in frontmatter.attributes) {
108
+ if (Object.prototype.hasOwnProperty.call(frontmatter.attributes, attribute) &&
109
+ (attribute === "intro" || attribute === "tutorial")) {
110
+ counter && counter.links.total++;
111
+ try {
112
+ // eslint-disable-next-line
113
+ let res = await fetch(frontmatter.attributes[attribute], {
114
+ method: "HEAD",
115
+ });
116
+ if (!res.ok) {
117
+ counter && counter.links.error++;
118
+ errors.push({
119
+ exercise: exercise === null || exercise === void 0 ? void 0 : exercise.title,
120
+ msg: `This link is broken (${res.ok}): ${frontmatter.attributes[attribute]}`,
121
+ });
79
122
  }
80
- // The result can be accessed through the `m`-variable.
81
- // m.forEach((match, groupIndex) => values.push(match));
82
- findings[type][m[0]] = {
83
- content: m[0],
84
- absUrl: m[1],
85
- mdUrl: m[2],
86
- relUrl: m[6],
87
- };
123
+ }
124
+ catch (_e) {
125
+ counter && counter.links.error++;
126
+ errors.push({
127
+ exercise: exercise === null || exercise === void 0 ? void 0 : exercise.title,
128
+ msg: `This link is broken: ${frontmatter.attributes[attribute]}`,
129
+ });
88
130
  }
89
131
  }
90
- return findings;
91
- },
92
- // This function checks if there are errors, and show them in the console at the end.
93
- showErrors: (errors, counter) => {
94
- return new Promise((resolve, reject) => {
95
- if (errors) {
96
- if (errors.length > 0) {
97
- console_1.default.log("Checking for errors...");
98
- for (const [i, error] of errors.entries())
99
- console_1.default.error(`${i + 1}) ${error.msg} ${error.exercise ? `(Exercise: ${error.exercise})` : ""}`);
100
- if (counter) {
101
- console_1.default.error(` We found ${errors.length} error${errors.length > 1 ? "s" : ""} among ${counter.images.total} images, ${counter.links.total} link, ${counter.readmeFiles} README files and ${counter.exercises} exercises.`);
132
+ }
133
+ // Check url's of each README file.
134
+ const findings = findInFile(["relativeImages", "externalImages", "markdownLinks"], content);
135
+ for (const finding in findings) {
136
+ if (Object.prototype.hasOwnProperty.call(findings, finding)) {
137
+ const obj = findings[finding];
138
+ // Valdites all the relative path images.
139
+ if (finding === "relativeImages" && Object.keys(obj).length > 0) {
140
+ for (const img in obj) {
141
+ if (Object.prototype.hasOwnProperty.call(obj, img)) {
142
+ // Validates if the image is in the assets folder.
143
+ counter && counter.images.total++;
144
+ const relativePath = path
145
+ .relative(exercise ? exercise.path.replace(/\\/gm, "/") : "./", `${(_a = config.config) === null || _a === void 0 ? void 0 : _a.dirPath}/assets/${obj[img].relUrl}`)
146
+ .replace(/\\/gm, "/");
147
+ if (relativePath !== obj[img].absUrl.split("?").shift()) {
148
+ counter && counter.images.error++;
149
+ errors.push({
150
+ exercise: exercise === null || exercise === void 0 ? void 0 : exercise.title,
151
+ msg: `This relative path (${obj[img].relUrl}) is not pointing to the assets folder.`,
152
+ });
153
+ }
154
+ if (!fs.existsSync(`${(_b = config.config) === null || _b === void 0 ? void 0 : _b.dirPath}/assets/${obj[img].relUrl}`)) {
155
+ counter && counter.images.error++;
156
+ errors.push({
157
+ exercise: exercise === null || exercise === void 0 ? void 0 : exercise.title,
158
+ msg: `The file ${obj[img].relUrl} doesn't exist in the assets folder.`,
159
+ });
160
+ }
102
161
  }
103
- else {
104
- console_1.default.error(` We found ${errors.length} error${errors.length > 1 ? "s" : ""} related with the project integrity.`);
105
- }
106
- process.exit(1);
107
162
  }
108
- else {
109
- if (counter) {
110
- console_1.default.success(`We didn't find any errors in this repository among ${counter.images.total} images, ${counter.links.total} link, ${counter.readmeFiles} README files and ${counter.exercises} exercises.`);
111
- }
112
- else {
113
- console_1.default.success(`We didn't find any errors in this repository.`);
163
+ }
164
+ else if (finding === "externalImages" && Object.keys(obj).length > 0) {
165
+ // Valdites all the aboslute path images.
166
+ for (const img in obj) {
167
+ if (Object.prototype.hasOwnProperty.call(obj, img)) {
168
+ counter && counter.images.total++;
169
+ if (fs.existsSync(`${(_c = config.config) === null || _c === void 0 ? void 0 : _c.dirPath}/assets${obj[img].mdUrl
170
+ .split("?")
171
+ .shift()}`)) {
172
+ const relativePath = path
173
+ .relative(exercise ? exercise.path.replace(/\\/gm, "/") : "./", `${(_d = config.config) === null || _d === void 0 ? void 0 : _d.dirPath}/assets/${obj[img].mdUrl}`)
174
+ .replace(/\\/gm, "/");
175
+ warnings.push({
176
+ exercise: exercise === null || exercise === void 0 ? void 0 : exercise.title,
177
+ msg: `On this exercise you have an image with an absolute path "${obj[img].absUrl}". We recommend you to replace it by the relative path: "${relativePath}".`,
178
+ });
179
+ }
180
+ try {
181
+ // eslint-disable-next-line
182
+ let res = await fetch(obj[img].absUrl, {
183
+ method: "HEAD",
184
+ });
185
+ if (!res.ok) {
186
+ counter && counter.images.error++;
187
+ errors.push({
188
+ exercise: exercise === null || exercise === void 0 ? void 0 : exercise.title,
189
+ msg: `This link is broken: ${obj[img].absUrl}`,
190
+ });
191
+ }
192
+ }
193
+ catch (_f) {
194
+ counter && counter.images.error++;
195
+ errors.push({
196
+ exercise: exercise === null || exercise === void 0 ? void 0 : exercise.title,
197
+ msg: `This link is broken: ${obj[img].absUrl}`,
198
+ });
199
+ }
114
200
  }
115
- process.exit(0);
116
201
  }
117
202
  }
118
- else {
119
- reject("Failed");
203
+ else if (finding === "markdownLinks" && Object.keys(obj).length > 0) {
204
+ for (const link in obj) {
205
+ if (Object.prototype.hasOwnProperty.call(obj, link)) {
206
+ counter && counter.links.total++;
207
+ if (!obj[link].mdUrl.includes("twitter")) {
208
+ try {
209
+ // eslint-disable-next-line
210
+ let res = await fetch(obj[link].mdUrl, {
211
+ method: "HEAD",
212
+ });
213
+ if (res.status > 399 && res.status < 500) {
214
+ counter && counter.links.error++;
215
+ errors.push({
216
+ exercise: exercise === null || exercise === void 0 ? void 0 : exercise.title,
217
+ msg: `This link is broken: ${obj[link].mdUrl}`,
218
+ });
219
+ }
220
+ }
221
+ catch (_g) {
222
+ counter && counter.links.error++;
223
+ errors.push({
224
+ exercise: exercise === null || exercise === void 0 ? void 0 : exercise.title,
225
+ msg: `This link is broken: ${obj[link].mdUrl}`,
226
+ });
227
+ }
228
+ }
229
+ }
230
+ }
120
231
  }
121
- });
122
- },
123
- // This function checks if there are warnings, and show them in the console at the end.
124
- showWarnings: (warnings) => {
125
- return new Promise((resolve, reject) => {
126
- if (warnings) {
127
- if (warnings.length > 0) {
128
- console_1.default.log("Checking for warnings...");
129
- for (const [i, warning] of warnings.entries())
130
- console_1.default.warning(`${i + 1}) ${warning.msg} ${warning.exercise ? `File: ${warning.exercise}` : ""}`);
232
+ }
233
+ }
234
+ return true;
235
+ };
236
+ // This function writes a given file with the given content.
237
+ const writeFile = async (content, filePath) => {
238
+ try {
239
+ await fs.promises.writeFile(filePath, content);
240
+ }
241
+ catch (error) {
242
+ if (error)
243
+ console_1.default.error(`We weren't able to write the file in this path "${filePath}".`, error);
244
+ }
245
+ };
246
+ // This function checks if there are errors, and show them in the console at the end.
247
+ const showErrors = (errors, counter) => {
248
+ return new Promise((resolve, reject) => {
249
+ if (errors) {
250
+ if (errors.length > 0) {
251
+ console_1.default.log("Checking for errors...");
252
+ for (const [i, error] of errors.entries())
253
+ console_1.default.error(`${i + 1}) ${error.msg} ${error.exercise ? `(Exercise: ${error.exercise})` : ""}`);
254
+ if (counter) {
255
+ console_1.default.error(` We found ${errors.length} error${errors.length > 1 ? "s" : ""} among ${counter.images.total} images, ${counter.links.total} link, ${counter.readmeFiles} README files and ${counter.exercises} exercises.`);
256
+ }
257
+ else {
258
+ console_1.default.error(` We found ${errors.length} error${errors.length > 1 ? "s" : ""} related with the project integrity.`);
131
259
  }
132
- resolve("SUCCESS");
260
+ process.exit(1);
133
261
  }
134
262
  else {
135
- reject("Failed");
263
+ if (counter) {
264
+ console_1.default.success(`We didn't find any errors in this repository among ${counter.images.total} images, ${counter.links.total} link, ${counter.readmeFiles} README files and ${counter.exercises} exercises.`);
265
+ }
266
+ else {
267
+ console_1.default.success(`We didn't find any errors in this repository.`);
268
+ }
269
+ process.exit(0);
136
270
  }
137
- });
138
- },
271
+ }
272
+ else {
273
+ reject("Failed");
274
+ }
275
+ });
276
+ };
277
+ // This function checks if there are warnings, and show them in the console at the end.
278
+ const showWarnings = (warnings) => {
279
+ return new Promise((resolve, reject) => {
280
+ if (warnings) {
281
+ if (warnings.length > 0) {
282
+ console_1.default.log("Checking for warnings...");
283
+ for (const [i, warning] of warnings.entries())
284
+ console_1.default.warning(`${i + 1}) ${warning.msg} ${warning.exercise ? `File: ${warning.exercise}` : ""}`);
285
+ }
286
+ resolve("SUCCESS");
287
+ }
288
+ else {
289
+ reject("Failed");
290
+ }
291
+ });
292
+ };
293
+ exports.default = {
294
+ isUrl,
295
+ checkForEmptySpaces,
296
+ checkLearnpackClean,
297
+ findInFile,
298
+ checkUrl,
299
+ writeFile,
300
+ showErrors,
301
+ showWarnings,
139
302
  };
@@ -1 +1 @@
1
- {"version":"2.1.19","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}]}}}
1
+ {"version":"2.1.24","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}]}}}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@learnpack/learnpack",
3
3
  "description": "Create, sell or download and take learning amazing learning packages",
4
- "version": "2.1.19",
4
+ "version": "2.1.24",
5
5
  "author": "Alejandro Sanchez @alesanchezr",
6
6
  "bin": {
7
7
  "learnpack": "bin/run"
@@ -78,7 +78,7 @@
78
78
  "typescript": "4.0"
79
79
  },
80
80
  "engines": {
81
- "node": ">=8.0.0"
81
+ "node": ">=14.0.0"
82
82
  },
83
83
  "files": [
84
84
  "/bin",
@@ -100,8 +100,7 @@
100
100
  "plugins": [
101
101
  "@oclif/plugin-help",
102
102
  "@oclif/plugin-plugins",
103
- "@oclif/plugin-warn-if-update-available",
104
- "@learnpack/react"
103
+ "@oclif/plugin-warn-if-update-available"
105
104
  ],
106
105
  "permanent_plugins": [
107
106
  "@oclif/plugin-help",