@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.
@@ -1,10 +1,11 @@
1
- export type TAction =
2
- | "test"
3
- | "log"
4
- | "reload"
5
- | "ready"
6
- | "clean"
7
- | "ask"
8
- | "file_change";
9
-
10
- export type ICallback = (...agrs: any[]) => any;
1
+ export type TAction =
2
+ | "test"
3
+ | "log"
4
+ | "reload"
5
+ | "ready"
6
+ | "clean"
7
+ | "ask"
8
+ | "file_change"
9
+ | "dialog";
10
+
11
+ export type ICallback = (...agrs: any[]) => any;
@@ -1,91 +1,93 @@
1
- import { IExercise } from "./exercise-obj"
2
- import { TTelemetryUrls } from "../managers/telemetry"
3
-
4
- export type TGrading = "isolated" | "incremental" | "no-grading";
5
-
6
- export type TMode = "preview" | "extension";
7
-
8
- export type TConfigAction =
9
- | "test"
10
- | "build"
11
- | "tutorial"
12
- | "reset"
13
- | "generate";
14
-
15
- export type TConfigObjAttributes = "config" | "exercises" | "grading";
16
-
17
- export type TCompiler =
18
- | "webpack"
19
- | "vanillajs"
20
- | "react"
21
- | "html"
22
- | "node"
23
- | "python"
24
- | "css";
25
-
26
- export interface IConfigPath {
27
- base: string;
28
- }
29
-
30
- type TAgent = "vscode" | "os";
31
-
32
- export interface IEditor {
33
- mode?: TMode;
34
- version: string;
35
- agent?: TAgent;
36
- }
37
-
38
- export interface TEntries {
39
- python3?: string;
40
- html?: string;
41
- node?: string;
42
- react?: string;
43
- java?: string;
44
- }
45
-
46
- export interface IConfig {
47
- os: string;
48
- port?: string;
49
- repository?: string;
50
- description?: string;
51
- slug?: string;
52
- dirPath: string;
53
- preview?: string; // Picture thumbnail
54
- entries: TEntries;
55
- grading: TGrading;
56
- configPath: string;
57
- translations: Array<string>;
58
- outputPath?: string;
59
- editor: IEditor;
60
- language: string;
61
- title: string;
62
- duration: number;
63
- difficulty?: string;
64
- exercisesPath: string;
65
- disableGrading: boolean; // TODO: Deprecate
66
- actions: Array<string>; // TODO: Deprecate
67
- autoPlay: boolean;
68
- projectType?: string;
69
- // TODO: nameExerciseValidation
70
- contact?: string;
71
- disabledActions?: Array<TConfigAction>;
72
- compiler: TCompiler;
73
- compilers: Array<TCompiler>;
74
- publicPath: string;
75
- publicUrl?: string;
76
- bugsLink?: string;
77
- videoSolutions?: boolean;
78
- skills: Array<string>;
79
- telemetry?: TTelemetryUrls;
80
- runHook: (...agrs: Array<any>) => void;
81
- testingFinishedCallback: (arg: any | undefined) => void;
82
- }
83
-
84
- export interface IConfigObj {
85
- session?: number;
86
- currentExercise?: any;
87
- config?: IConfig;
88
- exercises?: Array<IExercise>;
89
- confPath?: IConfigPath;
90
- address?: string; // Maybe
91
- }
1
+ import { IExercise } from "./exercise-obj"
2
+ import { TTelemetryUrls } from "../managers/telemetry"
3
+
4
+ export type TGrading = "isolated" | "incremental" | "no-grading";
5
+
6
+ export type TMode = "preview" | "extension";
7
+
8
+ export type TConfigAction =
9
+ | "test"
10
+ | "build"
11
+ | "tutorial"
12
+ | "reset"
13
+ | "generate";
14
+
15
+ export type TConfigObjAttributes = "config" | "exercises" | "grading";
16
+
17
+ export type TCompiler =
18
+ | "webpack"
19
+ | "vanillajs"
20
+ | "react"
21
+ | "html"
22
+ | "node"
23
+ | "python"
24
+ | "css";
25
+
26
+ export interface IConfigPath {
27
+ base: string;
28
+ }
29
+
30
+ type TAgent = "vscode" | "os";
31
+
32
+ export interface IEditor {
33
+ mode?: TMode;
34
+ version: string;
35
+ agent?: TAgent;
36
+ hideTerminal?: boolean;
37
+ }
38
+
39
+ export interface TEntries {
40
+ python3?: string;
41
+ html?: string;
42
+ node?: string;
43
+ react?: string;
44
+ java?: string;
45
+ }
46
+
47
+ export interface IConfig {
48
+ os: string;
49
+ port?: string;
50
+ repository?: string;
51
+ description?: string;
52
+ slug?: string;
53
+ dirPath: string;
54
+ preview?: string; // Picture thumbnail
55
+ entries: TEntries;
56
+ grading: TGrading;
57
+ configPath: string;
58
+ translations: Array<string>;
59
+ outputPath?: string;
60
+ editor: IEditor;
61
+ language: string;
62
+ title: string;
63
+ duration: number;
64
+ difficulty?: string;
65
+ exercisesPath: string;
66
+ disableGrading: boolean; // TODO: Deprecate
67
+ actions: Array<string>; // TODO: Deprecate
68
+ autoPlay: boolean;
69
+ projectType?: string;
70
+ // TODO: nameExerciseValidation
71
+ contact?: string;
72
+ disabledActions?: Array<TConfigAction>;
73
+ compiler: TCompiler;
74
+ compilers: Array<TCompiler>;
75
+ publicPath: string;
76
+ publicUrl?: string;
77
+ bugsLink?: string;
78
+ videoSolutions?: boolean;
79
+ skills: Array<string>;
80
+ telemetry?: TTelemetryUrls;
81
+
82
+ runHook: (...agrs: Array<any>) => void;
83
+ testingFinishedCallback: (arg: any | undefined) => void;
84
+ }
85
+
86
+ export interface IConfigObj {
87
+ session?: number;
88
+ currentExercise?: any;
89
+ config?: IConfig;
90
+ exercises?: Array<IExercise>;
91
+ confPath?: IConfigPath;
92
+ address?: string; // Maybe
93
+ }
@@ -1,59 +1,60 @@
1
- import { IConfig } from "./config"
2
- import { Server } from "socket.io"
3
- import { DefaultEventsMap } from "socket.io/dist/typed-events"
4
- import { TAction, ICallback } from "./action"
5
- import { TStatus } from "./status"
6
-
7
- export type TPossibleActions =
8
- | "build"
9
- | "test"
10
- | "reset"
11
- | "tutorial"
12
- | "generate";
13
-
14
- export interface ISocket {
15
- socket: Server<
16
- DefaultEventsMap,
17
- DefaultEventsMap,
18
- DefaultEventsMap,
19
- any
20
- > | null;
21
- config: IConfig | null;
22
- allowedActions: Array<TPossibleActions>;
23
- actionCallBacks: { [key: string]: ICallback };
24
- possibleActions: Array<TPossibleActions>;
25
- isTestingEnvironment: boolean;
26
- addAllowed: (actions: any) => void;
27
- removeAllowed: (actions: any) => void;
28
- start: (config: IConfig, server: any, isTestingEnvironment: boolean) => void;
29
- on: (action: any, callBack: any) => void;
30
- clean: (_: string, logs: Array<any>) => void;
31
- complete: () => void;
32
- ask: (questions: Array<string>) => void;
33
- reload: (files: Array<string> | null, exercises: Array<string>) => void;
34
- openWindow: (id: string) => void;
35
- log: (
36
- status: TStatus,
37
- messages?: string | Array<string>,
38
- report?: Array<string>,
39
- data?: any
40
- ) => void;
41
- emit: (
42
- action: TAction,
43
- status: TStatus | string,
44
- logs: string | Array<string>,
45
- inputs?: Array<string>,
46
- report?: Array<string>,
47
- data?: any
48
- ) => void;
49
- ready: (message: string) => void;
50
- error: (type: any, stdout: string) => void;
51
- fatal: (msg: string) => void;
52
- success: (type: any, stdout: string) => void;
53
- onTestingFinished: (obj: any) => void;
54
- }
55
-
56
- export type TOpenWindowData = {
57
- url: string;
58
- exerciseSlug: string;
59
- };
1
+ import { IConfig } from "./config"
2
+ import { Server } from "socket.io"
3
+ import { DefaultEventsMap } from "socket.io/dist/typed-events"
4
+ import { TAction, ICallback } from "./action"
5
+ import { TStatus } from "./status"
6
+
7
+ export type TPossibleActions =
8
+ | "build"
9
+ | "test"
10
+ | "reset"
11
+ | "tutorial"
12
+ | "generate";
13
+
14
+ export interface ISocket {
15
+ socket: Server<
16
+ DefaultEventsMap,
17
+ DefaultEventsMap,
18
+ DefaultEventsMap,
19
+ any
20
+ > | null;
21
+ config: IConfig | null;
22
+ allowedActions: Array<TPossibleActions>;
23
+ actionCallBacks: { [key: string]: ICallback };
24
+ possibleActions: Array<TPossibleActions>;
25
+ isTestingEnvironment: boolean;
26
+ addAllowed: (actions: any) => void;
27
+ removeAllowed: (actions: any) => void;
28
+ start: (config: IConfig, server: any, isTestingEnvironment: boolean) => void;
29
+ on: (action: any, callBack: any) => void;
30
+ clean: (_: string, logs: Array<any>) => void;
31
+ complete: () => void;
32
+ ask: (questions: Array<string>) => void;
33
+ reload: (files: Array<string> | null, exercises: Array<string>) => void;
34
+ openWindow: (id: string) => void;
35
+ log: (
36
+ status: TStatus,
37
+ messages?: string | Array<string>,
38
+ report?: Array<string>,
39
+ data?: any
40
+ ) => void;
41
+ emit: (
42
+ action: TAction,
43
+ status: TStatus | string,
44
+ logs: string | Array<string>,
45
+ inputs?: Array<string>,
46
+ report?: Array<string>,
47
+ data?: any
48
+ ) => void;
49
+ ready: (message: string) => void;
50
+ error: (type: any, stdout: string) => void;
51
+ fatal: (msg: string) => void;
52
+ dialog: (message: string) => void;
53
+ success: (type: any, stdout: string) => void;
54
+ onTestingFinished: (obj: any) => void;
55
+ }
56
+
57
+ export type TOpenWindowData = {
58
+ url: string;
59
+ exerciseSlug: string;
60
+ };
@@ -1,16 +1,16 @@
1
- export type TStatus =
2
- | "ready"
3
- | "internal-error"
4
- | "compiler-success"
5
- | "testing-success"
6
- | "compiling"
7
- | "testing"
8
- | "start_exercise"
9
- | "initializing"
10
- | "configuration_loaded"
11
- | "connection_ended"
12
- | "reset_exercise"
13
- | "open_files"
14
- | "open_window"
15
- | "instructions_closed"
16
- | "completed";
1
+ export type TStatus =
2
+ | "ready"
3
+ | "internal-error"
4
+ | "compiler-success"
5
+ | "testing-success"
6
+ | "compiling"
7
+ | "testing"
8
+ | "start_exercise"
9
+ | "initializing"
10
+ | "configuration_loaded"
11
+ | "connection_ended"
12
+ | "reset_exercise"
13
+ | "open_files"
14
+ | "open_window"
15
+ | "instructions_closed"
16
+ | "completed";