@learnpack/learnpack 2.1.53 → 2.1.56
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +10 -10
- package/lib/commands/start.js +29 -0
- package/lib/managers/socket.js +11 -1
- package/lib/managers/telemetry.d.ts +1 -1
- package/lib/managers/telemetry.js +10 -2
- package/lib/models/action.d.ts +1 -1
- package/lib/models/config.d.ts +1 -0
- package/lib/models/socket.d.ts +1 -0
- package/oclif.manifest.json +1 -1
- package/package.json +1 -1
- package/src/commands/start.ts +358 -320
- package/src/managers/socket.ts +13 -1
- package/src/managers/telemetry.ts +353 -346
- package/src/models/action.ts +11 -10
- package/src/models/config.ts +93 -91
- package/src/models/socket.ts +60 -59
- package/src/models/status.ts +16 -16
package/src/managers/socket.ts
CHANGED
@@ -213,6 +213,7 @@ actions = [actions]
|
|
213
213
|
},
|
214
214
|
success: function (type: TSuccessType, stdout: string) {
|
215
215
|
const types = ["compiler", "testing"]
|
216
|
+
|
216
217
|
if (!types.includes(type))
|
217
218
|
this.fatal(`Invalid socket success type "${type}" on socket`)
|
218
219
|
else if (stdout === "")
|
@@ -223,7 +224,10 @@ actions = [actions]
|
|
223
224
|
this.log((type + "-success") as TSuccessType, [stdout])
|
224
225
|
},
|
225
226
|
error: function (type: TStatus, stdout: string) {
|
226
|
-
|
227
|
+
if (!this.config?.editor.hideTerminal) {
|
228
|
+
queue.dispatcher().enqueue(queue.events.OPEN_TERMINAL, "")
|
229
|
+
}
|
230
|
+
|
227
231
|
this.log(type, [stdout])
|
228
232
|
|
229
233
|
if (this.isTestingEnvironment) {
|
@@ -235,6 +239,14 @@ this.log((type + "-success") as TSuccessType, [stdout])
|
|
235
239
|
complete: function () {
|
236
240
|
console.log("complete")
|
237
241
|
},
|
242
|
+
dialog: function (message: string, format = "md") {
|
243
|
+
if (!this.socket) {
|
244
|
+
this.fatal("Socket is not initialized")
|
245
|
+
return
|
246
|
+
}
|
247
|
+
|
248
|
+
this.emit("dialog", "talk", [], undefined, undefined, { message, format })
|
249
|
+
},
|
238
250
|
|
239
251
|
fatal: function (msg: string) {
|
240
252
|
this.log("internal-error", [msg])
|