@learnpack/learnpack 4.0.12 → 4.0.14
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +16 -35
- package/lib/commands/publish.d.ts +6 -9
- package/lib/commands/publish.js +137 -59
- package/lib/managers/server/routes.js +23 -0
- package/lib/managers/session.js +7 -5
- package/lib/models/session.d.ts +1 -0
- package/lib/utils/api.js +1 -0
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/src/commands/publish.ts +181 -107
- package/src/managers/server/routes.ts +27 -0
- package/src/managers/session.ts +150 -145
- package/src/models/session.ts +35 -34
- package/src/utils/api.ts +304 -303
- package/lib/commands/build.d.ts +0 -11
- package/lib/commands/build.js +0 -160
- package/src/commands/build.ts +0 -181
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/4.0.
|
24
|
+
@learnpack/learnpack/4.0.14 win32-x64 node-v20.16.0
|
25
25
|
$ learnpack --help [COMMAND]
|
26
26
|
USAGE
|
27
27
|
$ learnpack COMMAND
|
@@ -33,7 +33,6 @@ USAGE
|
|
33
33
|
|
34
34
|
<!-- commands -->
|
35
35
|
* [`learnpack audit`](#learnpack-audit)
|
36
|
-
* [`learnpack build`](#learnpack-build)
|
37
36
|
* [`learnpack clean`](#learnpack-clean)
|
38
37
|
* [`learnpack download [PACKAGE]`](#learnpack-download-package)
|
39
38
|
* [`learnpack help [COMMAND]`](#learnpack-help-command)
|
@@ -45,7 +44,7 @@ USAGE
|
|
45
44
|
* [`learnpack plugins:link PLUGIN`](#learnpack-pluginslink-plugin)
|
46
45
|
* [`learnpack plugins:uninstall PLUGIN...`](#learnpack-pluginsuninstall-plugin)
|
47
46
|
* [`learnpack plugins:update`](#learnpack-pluginsupdate)
|
48
|
-
* [`learnpack publish
|
47
|
+
* [`learnpack publish`](#learnpack-publish)
|
49
48
|
* [`learnpack start`](#learnpack-start)
|
50
49
|
* [`learnpack test [EXERCISESLUG]`](#learnpack-test-exerciseslug)
|
51
50
|
|
@@ -75,21 +74,7 @@ DESCRIPTION
|
|
75
74
|
12. If there is a file within the exercises folder but not inside of any particular exercise's folder. (Warning)
|
76
75
|
```
|
77
76
|
|
78
|
-
_See code: [src\commands\audit.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.
|
79
|
-
|
80
|
-
## `learnpack build`
|
81
|
-
|
82
|
-
Builds the project by copying necessary files and directories into a zip file
|
83
|
-
|
84
|
-
```
|
85
|
-
USAGE
|
86
|
-
$ learnpack build
|
87
|
-
|
88
|
-
OPTIONS
|
89
|
-
-h, --help show CLI help
|
90
|
-
```
|
91
|
-
|
92
|
-
_See code: [src\commands\build.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.12/src\commands\build.ts)_
|
77
|
+
_See code: [src\commands\audit.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.14/src\commands\audit.ts)_
|
93
78
|
|
94
79
|
## `learnpack clean`
|
95
80
|
|
@@ -104,7 +89,7 @@ DESCRIPTION
|
|
104
89
|
Extra documentation goes here
|
105
90
|
```
|
106
91
|
|
107
|
-
_See code: [src\commands\clean.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.
|
92
|
+
_See code: [src\commands\clean.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.14/src\commands\clean.ts)_
|
108
93
|
|
109
94
|
## `learnpack download [PACKAGE]`
|
110
95
|
|
@@ -122,7 +107,7 @@ DESCRIPTION
|
|
122
107
|
Extra documentation goes here
|
123
108
|
```
|
124
109
|
|
125
|
-
_See code: [src\commands\download.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.
|
110
|
+
_See code: [src\commands\download.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.14/src\commands\download.ts)_
|
126
111
|
|
127
112
|
## `learnpack help [COMMAND]`
|
128
113
|
|
@@ -153,7 +138,7 @@ OPTIONS
|
|
153
138
|
-h, --grading show CLI help
|
154
139
|
```
|
155
140
|
|
156
|
-
_See code: [src\commands\init.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.
|
141
|
+
_See code: [src\commands\init.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.14/src\commands\init.ts)_
|
157
142
|
|
158
143
|
## `learnpack login [PACKAGE]`
|
159
144
|
|
@@ -171,7 +156,7 @@ DESCRIPTION
|
|
171
156
|
Extra documentation goes here
|
172
157
|
```
|
173
158
|
|
174
|
-
_See code: [src\commands\login.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.
|
159
|
+
_See code: [src\commands\login.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.14/src\commands\login.ts)_
|
175
160
|
|
176
161
|
## `learnpack logout [PACKAGE]`
|
177
162
|
|
@@ -189,7 +174,7 @@ DESCRIPTION
|
|
189
174
|
Extra documentation goes here
|
190
175
|
```
|
191
176
|
|
192
|
-
_See code: [src\commands\logout.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.
|
177
|
+
_See code: [src\commands\logout.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.14/src\commands\logout.ts)_
|
193
178
|
|
194
179
|
## `learnpack plugins`
|
195
180
|
|
@@ -308,23 +293,19 @@ OPTIONS
|
|
308
293
|
|
309
294
|
_See code: [@oclif/plugin-plugins](https://github.com/oclif/plugin-plugins/blob/v1.8.0/src\commands\plugins\update.ts)_
|
310
295
|
|
311
|
-
## `learnpack publish
|
296
|
+
## `learnpack publish`
|
312
297
|
|
313
|
-
|
298
|
+
Builds the project by copying necessary files and directories into a zip file
|
314
299
|
|
315
300
|
```
|
316
301
|
USAGE
|
317
|
-
$ learnpack publish
|
318
|
-
|
319
|
-
ARGUMENTS
|
320
|
-
PACKAGE The unique string that identifies this package on learnpack
|
302
|
+
$ learnpack publish
|
321
303
|
|
322
|
-
|
323
|
-
|
324
|
-
Extra documentation goes here
|
304
|
+
OPTIONS
|
305
|
+
-h, --help show CLI help
|
325
306
|
```
|
326
307
|
|
327
|
-
_See code: [src\commands\publish.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.
|
308
|
+
_See code: [src\commands\publish.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.14/src\commands\publish.ts)_
|
328
309
|
|
329
310
|
## `learnpack start`
|
330
311
|
|
@@ -345,7 +326,7 @@ OPTIONS
|
|
345
326
|
-w, --watch Watch for file changes
|
346
327
|
```
|
347
328
|
|
348
|
-
_See code: [src\commands\start.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.
|
329
|
+
_See code: [src\commands\start.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.14/src\commands\start.ts)_
|
349
330
|
|
350
331
|
## `learnpack test [EXERCISESLUG]`
|
351
332
|
|
@@ -359,7 +340,7 @@ ARGUMENTS
|
|
359
340
|
EXERCISESLUG The name of the exercise to test
|
360
341
|
```
|
361
342
|
|
362
|
-
_See code: [src\commands\test.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.
|
343
|
+
_See code: [src\commands\test.ts](https://github.com/learnpack/learnpack-cli/blob/v4.0.14/src\commands\test.ts)_
|
363
344
|
<!-- commandsstop -->
|
364
345
|
|
365
346
|
> > > > > > > 0cb3e56d84c197f9d008836bb573eade212b7e57
|
@@ -1,14 +1,11 @@
|
|
1
1
|
import SessionCommand from "../utils/SessionCommand";
|
2
|
-
|
2
|
+
export default class BuildCommand extends SessionCommand {
|
3
3
|
static description: string;
|
4
|
-
static flags:
|
5
|
-
|
6
|
-
|
7
|
-
required: boolean;
|
8
|
-
description: string;
|
9
|
-
hidden: boolean;
|
10
|
-
}[];
|
4
|
+
static flags: {
|
5
|
+
help: import("@oclif/parser/lib/flags").IBooleanFlag<void>;
|
6
|
+
};
|
11
7
|
init(): Promise<void>;
|
12
8
|
run(): Promise<void>;
|
9
|
+
copyDirectory(src: string, dest: string): void;
|
10
|
+
removeDirectory(dir: string): void;
|
13
11
|
}
|
14
|
-
export default PublishCommand;
|
package/lib/commands/publish.js
CHANGED
@@ -1,82 +1,160 @@
|
|
1
1
|
"use strict";
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
-
|
3
|
+
/* eslint-disable arrow-parens */
|
4
|
+
/* eslint-disable unicorn/no-array-for-each */
|
5
|
+
const command_1 = require("@oclif/command");
|
4
6
|
const SessionCommand_1 = require("../utils/SessionCommand");
|
7
|
+
const session_1 = require("../managers/session");
|
8
|
+
const fs = require("fs");
|
9
|
+
const path = require("path");
|
10
|
+
const archiver = require("archiver");
|
11
|
+
const axios_1 = require("axios");
|
12
|
+
const FormData = require("form-data");
|
5
13
|
const console_1 = require("../utils/console");
|
6
|
-
const
|
7
|
-
|
8
|
-
//
|
9
|
-
|
10
|
-
|
14
|
+
const RIGOBOT_HOST =
|
15
|
+
// "https://rigobot-test-cca7d841c9d8.herokuapp.com"
|
16
|
+
// "https://8000-charlytoc-rigobot-bmwdeam7cev.ws-us116.gitpod.io"
|
17
|
+
"https://rigobot.herokuapp.com";
|
18
|
+
const uploadZipEndpont = RIGOBOT_HOST + "/v1/learnpack/upload";
|
19
|
+
class BuildCommand extends SessionCommand_1.default {
|
11
20
|
async init() {
|
12
|
-
const { flags } = this.parse(
|
13
|
-
await this.initSession(flags
|
21
|
+
const { flags } = this.parse(BuildCommand);
|
22
|
+
await this.initSession(flags);
|
14
23
|
}
|
15
24
|
async run() {
|
16
|
-
|
17
|
-
const
|
18
|
-
|
19
|
-
|
20
|
-
if (!this.session)
|
25
|
+
const buildDir = path.join(process.cwd(), "build");
|
26
|
+
const sessionPayload = await session_1.default.getPayload();
|
27
|
+
if (!sessionPayload || !sessionPayload.rigobot) {
|
28
|
+
console_1.default.error("You must be logged in to upload a LearnPack packge, please run: \n$ learnpack login");
|
21
29
|
return;
|
22
|
-
console_1.default.info(`Session found for ${this.session.payload.email}, publishing the package...`);
|
23
|
-
const configObject = (_a = this.configManager) === null || _a === void 0 ? void 0 : _a.get();
|
24
|
-
if (((_b = configObject === null || configObject === void 0 ? void 0 : configObject.config) === null || _b === void 0 ? void 0 : _b.slug) === undefined ||
|
25
|
-
!((_c = configObject.config) === null || _c === void 0 ? void 0 : _c.slug)) {
|
26
|
-
throw new Error("The package is missing a slug (unique name identifier), please check your learn.json file and make sure it has a 'slug'");
|
27
30
|
}
|
28
|
-
|
29
|
-
|
31
|
+
const rigoToken = sessionPayload.rigobot.key;
|
32
|
+
// const rigoToken = "417d612d226a1606ad3a4e94b1881a9f0124b667"
|
33
|
+
// Read learn.json to get the slug
|
34
|
+
const learnJsonPath = path.join(process.cwd(), "learn.json");
|
35
|
+
if (!fs.existsSync(learnJsonPath)) {
|
36
|
+
this.error("learn.json not found");
|
37
|
+
}
|
38
|
+
const learnJson = JSON.parse(fs.readFileSync(learnJsonPath, "utf-8"));
|
39
|
+
const zipFilePath = path.join(process.cwd(), `${learnJson.slug}.zip`);
|
40
|
+
// Ensure build directory exists
|
41
|
+
if (!fs.existsSync(buildDir)) {
|
42
|
+
fs.mkdirSync(buildDir);
|
43
|
+
}
|
44
|
+
// Copy config.json
|
45
|
+
const configPath = path.join(process.cwd(), ".learn", "config.json");
|
46
|
+
if (fs.existsSync(configPath)) {
|
47
|
+
fs.copyFileSync(configPath, path.join(buildDir, "config.json"));
|
30
48
|
}
|
31
49
|
else {
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
50
|
+
this.error("config.json not found");
|
51
|
+
}
|
52
|
+
// Copy .learn/assets directory
|
53
|
+
const assetsDir = path.join(process.cwd(), ".learn", "assets");
|
54
|
+
if (fs.existsSync(assetsDir)) {
|
55
|
+
this.copyDirectory(assetsDir, path.join(buildDir, ".learn", "assets"));
|
56
|
+
}
|
57
|
+
else {
|
58
|
+
this.error(".learn/assets directory not found");
|
59
|
+
}
|
60
|
+
// Copy .learn/_app directory files to the same level as config.json
|
61
|
+
const appDir = path.join(process.cwd(), ".learn", "_app");
|
62
|
+
if (fs.existsSync(appDir)) {
|
63
|
+
this.copyDirectory(appDir, buildDir);
|
64
|
+
}
|
65
|
+
else {
|
66
|
+
this.error(".learn/_app directory not found");
|
67
|
+
}
|
68
|
+
// Copy exercises directory
|
69
|
+
const exercisesDir = path.join(process.cwd(), "exercises");
|
70
|
+
const learnExercisesDir = path.join(process.cwd(), ".learn", "exercises");
|
71
|
+
if (fs.existsSync(exercisesDir)) {
|
72
|
+
this.copyDirectory(exercisesDir, path.join(buildDir, "exercises"));
|
38
73
|
}
|
39
|
-
|
40
|
-
|
41
|
-
await api_1.default.publish(Object.assign(Object.assign({}, configObject), { author: this.session.payload.user_id }));
|
42
|
-
console_1.default.success(`Package updated and published successfully: ${(_h = configObject.config) === null || _h === void 0 ? void 0 : _h.slug}`);
|
74
|
+
else if (fs.existsSync(learnExercisesDir)) {
|
75
|
+
this.copyDirectory(learnExercisesDir, path.join(buildDir, "exercises"));
|
43
76
|
}
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
77
|
+
else {
|
78
|
+
this.error("exercises directory not found in either location");
|
79
|
+
}
|
80
|
+
// Copy learn.json
|
81
|
+
fs.copyFileSync(learnJsonPath, path.join(buildDir, "learn.json"));
|
82
|
+
// Create zip file
|
83
|
+
const output = fs.createWriteStream(zipFilePath);
|
84
|
+
const archive = archiver("zip", {
|
85
|
+
zlib: { level: 9 },
|
86
|
+
});
|
87
|
+
output.on("close", async () => {
|
88
|
+
this.log(`Build completed: ${zipFilePath} (${archive.pointer()} total bytes)`);
|
89
|
+
// Remove build directory after zip is created
|
90
|
+
this.removeDirectory(buildDir);
|
91
|
+
console.log("Zip file saved in project root");
|
92
|
+
const formData = new FormData();
|
93
|
+
formData.append("file", fs.createReadStream(zipFilePath));
|
94
|
+
formData.append("config", JSON.stringify(learnJson));
|
95
|
+
try {
|
96
|
+
const res = await axios_1.default.post(uploadZipEndpont, formData, {
|
97
|
+
headers: Object.assign(Object.assign({}, formData.getHeaders()), { Authorization: `Token ${rigoToken}` }),
|
98
|
+
});
|
99
|
+
console.log(res.data);
|
100
|
+
}
|
101
|
+
catch (error) {
|
102
|
+
if (axios_1.default.isAxiosError(error)) {
|
103
|
+
if (error.response && error.response.status === 403) {
|
104
|
+
console.error("Error 403:", error.response.data.error);
|
105
|
+
}
|
106
|
+
else if (error.response && error.response.status === 400) {
|
107
|
+
console.error(error.response.data.error);
|
108
|
+
}
|
109
|
+
else {
|
110
|
+
console.error("Error uploading file:", error.message);
|
111
|
+
}
|
56
112
|
}
|
57
113
|
else {
|
58
|
-
|
114
|
+
console.error("Error uploading file:", error);
|
59
115
|
}
|
60
116
|
}
|
117
|
+
});
|
118
|
+
archive.on("error", (err) => {
|
119
|
+
throw err;
|
120
|
+
});
|
121
|
+
archive.pipe(output);
|
122
|
+
archive.directory(buildDir, false);
|
123
|
+
await archive.finalize();
|
124
|
+
}
|
125
|
+
copyDirectory(src, dest) {
|
126
|
+
if (!fs.existsSync(dest)) {
|
127
|
+
fs.mkdirSync(dest, { recursive: true });
|
128
|
+
}
|
129
|
+
const entries = fs.readdirSync(src, { withFileTypes: true });
|
130
|
+
for (const entry of entries) {
|
131
|
+
const srcPath = path.join(src, entry.name);
|
132
|
+
const destPath = path.join(dest, entry.name);
|
133
|
+
if (entry.isDirectory()) {
|
134
|
+
this.copyDirectory(srcPath, destPath);
|
135
|
+
}
|
61
136
|
else {
|
62
|
-
|
137
|
+
fs.copyFileSync(srcPath, destPath);
|
63
138
|
}
|
64
139
|
}
|
65
140
|
}
|
141
|
+
removeDirectory(dir) {
|
142
|
+
if (fs.existsSync(dir)) {
|
143
|
+
fs.readdirSync(dir).forEach((file) => {
|
144
|
+
const currentPath = path.join(dir, file);
|
145
|
+
if (fs.lstatSync(currentPath).isDirectory()) {
|
146
|
+
this.removeDirectory(currentPath);
|
147
|
+
}
|
148
|
+
else {
|
149
|
+
fs.unlinkSync(currentPath);
|
150
|
+
}
|
151
|
+
});
|
152
|
+
fs.rmdirSync(dir);
|
153
|
+
}
|
154
|
+
}
|
66
155
|
}
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
`;
|
71
|
-
PublishCommand.flags = {
|
72
|
-
// name: flags.string({char: 'n', description: 'name to print'}),
|
156
|
+
BuildCommand.description = "Builds the project by copying necessary files and directories into a zip file";
|
157
|
+
BuildCommand.flags = {
|
158
|
+
help: command_1.flags.help({ char: "h" }),
|
73
159
|
};
|
74
|
-
|
75
|
-
{
|
76
|
-
name: "package", // name of arg to show in help and reference with args[name]
|
77
|
-
required: false, // make the arg required with `required: true`
|
78
|
-
description: "The unique string that identifies this package on learnpack", // help description
|
79
|
-
hidden: false, // hide this arg from help
|
80
|
-
},
|
81
|
-
];
|
82
|
-
exports.default = PublishCommand;
|
160
|
+
exports.default = BuildCommand;
|
@@ -75,6 +75,29 @@ async function default_1(app, configObject, configManager) {
|
|
75
75
|
res.status(500).json({ error: "Internal server error" });
|
76
76
|
}
|
77
77
|
}));
|
78
|
+
app.post("/set-tab-hash", jsonBodyParser, withHandler(async (req, res) => {
|
79
|
+
const hash = req.body.hash;
|
80
|
+
// Ensure token is provided in the request body
|
81
|
+
console_1.default.error("TRYINH YO SET TAB HASH IN CLI");
|
82
|
+
console_1.default.success(hash);
|
83
|
+
if (!hash) {
|
84
|
+
return res.status(400).json({ error: "Token is required" });
|
85
|
+
}
|
86
|
+
try {
|
87
|
+
const hashSaved = await session_1.default.setTabHash(hash);
|
88
|
+
// Check if the token was saved successfully
|
89
|
+
if (hashSaved) {
|
90
|
+
res.json({ status: "ok" });
|
91
|
+
}
|
92
|
+
else {
|
93
|
+
res.status(500).json({ error: "Failed to save the token" });
|
94
|
+
}
|
95
|
+
}
|
96
|
+
catch (_a) {
|
97
|
+
// Handle any unexpected errors during the process
|
98
|
+
res.status(500).json({ error: "Internal server error" });
|
99
|
+
}
|
100
|
+
}));
|
78
101
|
app.get("/check/rigo/status", withHandler(async (_, res) => {
|
79
102
|
const payload = await session_1.default.getPayload();
|
80
103
|
if (payload && payload.rigobot && payload.rigobot.key) {
|
package/lib/managers/session.js
CHANGED
@@ -33,6 +33,13 @@ const Session = {
|
|
33
33
|
console_1.default.debug("Rigobot token successfuly set");
|
34
34
|
return true;
|
35
35
|
},
|
36
|
+
setTabHash: async function (hash) {
|
37
|
+
await this.initialize();
|
38
|
+
const payload = await storage.getItem("bc-payload");
|
39
|
+
await storage.setItem("bc-payload", Object.assign(Object.assign({}, payload), { tabHash: hash }));
|
40
|
+
console_1.default.debug("Rigobot token successfuly set");
|
41
|
+
return true;
|
42
|
+
},
|
36
43
|
setPayload: async function (value) {
|
37
44
|
await this.initialize();
|
38
45
|
await storage.setItem("bc-payload", Object.assign({ token: this.token }, value));
|
@@ -51,11 +58,6 @@ const Session = {
|
|
51
58
|
return payload;
|
52
59
|
},
|
53
60
|
isActive: function () {
|
54
|
-
/* if (this.token) {
|
55
|
-
return true
|
56
|
-
} else {
|
57
|
-
return false
|
58
|
-
} */
|
59
61
|
return !!this.token;
|
60
62
|
},
|
61
63
|
get: async function (configObj) {
|
package/lib/models/session.d.ts
CHANGED
@@ -18,6 +18,7 @@ export interface ISession {
|
|
18
18
|
currentCohort: null;
|
19
19
|
initialize: () => Promise<boolean>;
|
20
20
|
setRigoToken: (token: string) => Promise<boolean>;
|
21
|
+
setTabHash: (hash: string) => Promise<boolean>;
|
21
22
|
setPayload: (value: IPayload) => Promise<boolean>;
|
22
23
|
getPayload: () => Promise<any>;
|
23
24
|
isActive: () => boolean;
|
package/lib/utils/api.js
CHANGED
@@ -5,6 +5,7 @@ const storage = require("node-persist");
|
|
5
5
|
const cli_ux_1 = require("cli-ux");
|
6
6
|
const HOST = "https://breathecode.herokuapp.com";
|
7
7
|
const RIGOBOT_HOST = "https://rigobot.herokuapp.com";
|
8
|
+
// const RIGOBOT_HOST = "https://8000-charlytoc-rigobot-bmwdeam7cev.ws-us116.gitpod.io"
|
8
9
|
// eslint-disable-next-line
|
9
10
|
const _fetch = require("node-fetch");
|
10
11
|
const fetch = async (url, options = {}, returnAsJson = true) => {
|
package/oclif.manifest.json
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":"4.0.
|
1
|
+
{"version":"4.0.14","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}]}}}
|
package/package.json
CHANGED