@learnpack/learnpack 4.0.9 → 4.0.12

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.
Files changed (128) hide show
  1. package/README.md +25 -10
  2. package/lib/commands/audit.d.ts +6 -6
  3. package/lib/commands/audit.js +327 -327
  4. package/lib/commands/build.d.ts +11 -0
  5. package/lib/commands/build.js +160 -0
  6. package/lib/commands/clean.d.ts +8 -8
  7. package/lib/commands/clean.js +22 -22
  8. package/lib/commands/download.d.ts +13 -13
  9. package/lib/commands/download.js +52 -52
  10. package/lib/commands/init.d.ts +9 -9
  11. package/lib/commands/init.js +127 -127
  12. package/lib/commands/login.d.ts +14 -14
  13. package/lib/commands/login.js +34 -34
  14. package/lib/commands/logout.d.ts +14 -14
  15. package/lib/commands/logout.js +34 -34
  16. package/lib/commands/publish.d.ts +14 -14
  17. package/lib/commands/publish.js +79 -79
  18. package/lib/commands/start.d.ts +7 -7
  19. package/lib/commands/start.js +252 -250
  20. package/lib/commands/test.d.ts +6 -6
  21. package/lib/commands/test.js +62 -62
  22. package/lib/index.d.ts +1 -1
  23. package/lib/index.js +4 -4
  24. package/lib/managers/config/allowed_files.d.ts +5 -5
  25. package/lib/managers/config/allowed_files.js +30 -30
  26. package/lib/managers/config/defaults.d.ts +47 -48
  27. package/lib/managers/config/defaults.js +51 -51
  28. package/lib/managers/config/exercise.d.ts +36 -36
  29. package/lib/managers/config/exercise.js +243 -236
  30. package/lib/managers/config/index.d.ts +3 -3
  31. package/lib/managers/config/index.js +464 -459
  32. package/lib/managers/file.d.ts +14 -14
  33. package/lib/managers/file.js +190 -184
  34. package/lib/managers/gitpod.d.ts +3 -3
  35. package/lib/managers/gitpod.js +67 -67
  36. package/lib/managers/server/index.d.ts +5 -6
  37. package/lib/managers/server/index.js +58 -58
  38. package/lib/managers/server/routes.d.ts +4 -4
  39. package/lib/managers/server/routes.js +228 -220
  40. package/lib/managers/session.d.ts +3 -3
  41. package/lib/managers/session.js +125 -125
  42. package/lib/managers/socket.d.ts +3 -3
  43. package/lib/managers/socket.js +188 -186
  44. package/lib/managers/telemetry.d.ts +74 -74
  45. package/lib/managers/telemetry.js +215 -214
  46. package/lib/managers/test.js +84 -84
  47. package/lib/models/action.d.ts +2 -2
  48. package/lib/models/action.js +2 -2
  49. package/lib/models/audit.d.ts +15 -15
  50. package/lib/models/audit.js +2 -2
  51. package/lib/models/config-manager.d.ts +21 -21
  52. package/lib/models/config-manager.js +2 -2
  53. package/lib/models/config.d.ts +86 -86
  54. package/lib/models/config.js +2 -2
  55. package/lib/models/counter.d.ts +11 -11
  56. package/lib/models/counter.js +2 -2
  57. package/lib/models/errors.d.ts +15 -15
  58. package/lib/models/errors.js +2 -2
  59. package/lib/models/exercise-obj.d.ts +29 -30
  60. package/lib/models/exercise-obj.js +2 -2
  61. package/lib/models/file.d.ts +5 -5
  62. package/lib/models/file.js +2 -2
  63. package/lib/models/findings.d.ts +17 -17
  64. package/lib/models/findings.js +2 -2
  65. package/lib/models/flags.d.ts +10 -10
  66. package/lib/models/flags.js +2 -2
  67. package/lib/models/front-matter.d.ts +11 -11
  68. package/lib/models/front-matter.js +2 -2
  69. package/lib/models/gitpod-data.d.ts +16 -16
  70. package/lib/models/gitpod-data.js +2 -2
  71. package/lib/models/language.d.ts +4 -4
  72. package/lib/models/language.js +2 -2
  73. package/lib/models/package.d.ts +7 -7
  74. package/lib/models/package.js +2 -2
  75. package/lib/models/plugin-config.d.ts +16 -16
  76. package/lib/models/plugin-config.js +2 -2
  77. package/lib/models/session.d.ts +31 -31
  78. package/lib/models/session.js +2 -2
  79. package/lib/models/socket.d.ts +37 -37
  80. package/lib/models/socket.js +2 -2
  81. package/lib/models/status.d.ts +1 -1
  82. package/lib/models/status.js +2 -2
  83. package/lib/models/success-types.d.ts +1 -1
  84. package/lib/models/success-types.js +2 -2
  85. package/lib/plugin/command/compile.d.ts +6 -6
  86. package/lib/plugin/command/compile.js +18 -18
  87. package/lib/plugin/command/test.d.ts +6 -6
  88. package/lib/plugin/command/test.js +25 -25
  89. package/lib/plugin/index.d.ts +27 -27
  90. package/lib/plugin/index.js +7 -7
  91. package/lib/plugin/plugin.d.ts +8 -8
  92. package/lib/plugin/plugin.js +68 -68
  93. package/lib/plugin/utils.d.ts +16 -16
  94. package/lib/plugin/utils.js +58 -58
  95. package/lib/ui/download.d.ts +5 -5
  96. package/lib/ui/download.js +62 -61
  97. package/lib/utils/BaseCommand.d.ts +8 -8
  98. package/lib/utils/BaseCommand.js +41 -41
  99. package/lib/utils/SessionCommand.d.ts +10 -10
  100. package/lib/utils/SessionCommand.js +43 -43
  101. package/lib/utils/api.d.ts +14 -14
  102. package/lib/utils/api.js +255 -255
  103. package/lib/utils/audit.d.ts +16 -16
  104. package/lib/utils/audit.js +303 -303
  105. package/lib/utils/checkNotInstalled.d.ts +8 -8
  106. package/lib/utils/checkNotInstalled.js +185 -181
  107. package/lib/utils/console.d.ts +12 -12
  108. package/lib/utils/console.js +19 -19
  109. package/lib/utils/errors.d.ts +17 -17
  110. package/lib/utils/errors.js +107 -100
  111. package/lib/utils/exercisesQueue.d.ts +9 -9
  112. package/lib/utils/exercisesQueue.js +38 -38
  113. package/lib/utils/fileQueue.d.ts +43 -43
  114. package/lib/utils/fileQueue.js +169 -169
  115. package/lib/utils/misc.d.ts +1 -1
  116. package/lib/utils/misc.js +24 -23
  117. package/lib/utils/osOperations.d.ts +5 -5
  118. package/lib/utils/osOperations.js +72 -72
  119. package/lib/utils/validators.d.ts +5 -5
  120. package/lib/utils/validators.js +16 -17
  121. package/lib/utils/watcher.d.ts +2 -2
  122. package/lib/utils/watcher.js +25 -25
  123. package/oclif.manifest.json +1 -1
  124. package/package.json +6 -4
  125. package/src/commands/build.ts +181 -0
  126. package/src/managers/config/index.ts +5 -0
  127. package/src/managers/server/routes.ts +11 -1
  128. package/src/managers/session.ts +1 -1
@@ -1,181 +1,185 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.checkNotInstalledDependencies = exports.checkNotInstalledPlugins = void 0;
4
- const tslib_1 = require("tslib");
5
- const util_1 = require("util");
6
- const child_process_1 = require("child_process");
7
- const exec = util_1.promisify(child_process_1.exec);
8
- const cli_ux_1 = require("cli-ux");
9
- const console_1 = require("./console");
10
- exports.checkNotInstalledPlugins = async (exercises, installedPlugins, command) => {
11
- var e_1, _a;
12
- console_1.default.info("Checking needed plugins...");
13
- const usefulExtensions = new Set(["py", "js", "jsx", "html"]);
14
- const foundExtensions = [];
15
- const testingExtensions = [];
16
- const neededPlugins = [];
17
- let someExerciseWithOnlyTestFile = false; // I will suppose that there are not exercises with only readme and test files
18
- // See the extensions of the files that are not tests files
19
- for (const e of exercises) {
20
- const notReadmeFiles = e.files.filter(f => !f.name.toLowerCase().includes("readme"));
21
- if (!someExerciseWithOnlyTestFile && notReadmeFiles.length > 0) {
22
- someExerciseWithOnlyTestFile = notReadmeFiles.every(f => {
23
- return f.name.includes("test");
24
- });
25
- if (someExerciseWithOnlyTestFile) {
26
- console_1.default.debug("Some exercises have only test files, I will install the @learnpack/node plugin to run the tests.");
27
- }
28
- }
29
- for (const f of notReadmeFiles) {
30
- const ext = f.name.split(".").pop();
31
- if (!ext)
32
- continue;
33
- if (f.name.includes("test")) {
34
- !testingExtensions.includes(ext) && testingExtensions.push(ext);
35
- continue;
36
- }
37
- if (usefulExtensions.has(ext) && !foundExtensions.includes(ext)) {
38
- foundExtensions.push(ext);
39
- }
40
- }
41
- }
42
- console_1.default.debug("foundExtensions", foundExtensions);
43
- console_1.default.debug("testingExtensions", testingExtensions);
44
- if (foundExtensions.length === 0 && testingExtensions.length === 0)
45
- return {
46
- needed: [],
47
- notInstalled: [],
48
- };
49
- if (foundExtensions.includes("html") && foundExtensions.includes("js")) {
50
- neededPlugins.push("@learnpack/dom");
51
- }
52
- if (foundExtensions.includes("html") && !foundExtensions.includes("js")) {
53
- neededPlugins.push("@learnpack/html");
54
- }
55
- if (foundExtensions.includes("jsx")) {
56
- neededPlugins.push("@learnpack/react");
57
- }
58
- if (foundExtensions.includes("py") || testingExtensions.includes("py")) {
59
- neededPlugins.push("@learnpack/python");
60
- }
61
- if ((foundExtensions.includes("js") && !foundExtensions.includes("html")) ||
62
- (testingExtensions.includes("js") && someExerciseWithOnlyTestFile)) {
63
- neededPlugins.push("@learnpack/node");
64
- }
65
- const notInstalled = neededPlugins.filter(item => !installedPlugins.includes(item));
66
- if (notInstalled.length > 0) {
67
- console_1.default.error("These plugins are not installed but required: ", notInstalled);
68
- const confirmInstall = await cli_ux_1.cli.confirm("Do you want to install the needed plugins? (y/n)");
69
- if (confirmInstall) {
70
- console_1.default.info("Installing the needed plugins...");
71
- try {
72
- for (var notInstalled_1 = tslib_1.__asyncValues(notInstalled), notInstalled_1_1; notInstalled_1_1 = await notInstalled_1.next(), !notInstalled_1_1.done;) {
73
- const p = notInstalled_1_1.value;
74
- await command.config.runCommand(`plugins:install`, [p]);
75
- console_1.default.log(`Plugin ${p} installed`);
76
- }
77
- }
78
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
79
- finally {
80
- try {
81
- if (notInstalled_1_1 && !notInstalled_1_1.done && (_a = notInstalled_1.return)) await _a.call(notInstalled_1);
82
- }
83
- finally { if (e_1) throw e_1.error; }
84
- }
85
- console_1.default.log("All needed plugins installed, please restart LearnPack to load them.");
86
- console_1.default.info("Run: $ learnpack start");
87
- command.exit(0);
88
- }
89
- else {
90
- console_1.default.error("You need to install the plugins to complete this exercise");
91
- console_1.default.info("To install the plugins run each of the following commands: ");
92
- for (const p of notInstalled) {
93
- console_1.default.log(`learnpack plugins:install ${p}`);
94
- }
95
- command.exit(1);
96
- }
97
- }
98
- return {
99
- needed: neededPlugins,
100
- notInstalled,
101
- };
102
- };
103
- function includesAll(baseString, elementsArray) {
104
- return elementsArray.every(element => baseString.includes(element));
105
- }
106
- const installDependencies = async (deps, packageManager) => {
107
- let command = "";
108
- if (packageManager === "npm") {
109
- command = `npm install -g ${deps.join(" ")}`;
110
- }
111
- else if (packageManager === "pip") {
112
- command = `pip install ${deps.join(" ")}`;
113
- }
114
- const { stdout, stderr } = await exec(command);
115
- if (stderr && (stderr.includes("npm ERR!") || stderr.includes("Traceback"))) {
116
- console_1.default.error(`Error executing ${command}.`);
117
- console_1.default.error(stderr);
118
- return;
119
- }
120
- console_1.default.info(`Dependencies ${deps.join(" ")} installed...`);
121
- return true;
122
- };
123
- exports.checkNotInstalledDependencies = async (neededPlugins) => {
124
- console_1.default.info("Checking needed dependencies...");
125
- const jsPluginsDependencies = [
126
- "jest@29.7.0",
127
- "jest-environment-jsdom@29.7.0",
128
- ];
129
- const pyPluginsDependencies = ["pytest==6.2.5", "pytest-testdox", "mock"];
130
- const npmLsCommand = "npm ls jest jest-environment-jsdom -g";
131
- let pytestNeeded = false;
132
- let jestNeeded = false;
133
- if (neededPlugins.includes("@learnpack/dom") ||
134
- neededPlugins.includes("@learnpack/html") ||
135
- neededPlugins.includes("@learnpack/react") ||
136
- neededPlugins.includes("@learnpack/node")) {
137
- jestNeeded = true;
138
- }
139
- if ("@learnpack/python" in neededPlugins) {
140
- pytestNeeded = true;
141
- }
142
- if (jestNeeded) {
143
- const { stdout, stderr } = await exec("npm ls -g");
144
- if (stderr) {
145
- console_1.default.error(`Error executing ${npmLsCommand}. Use debug for more info`);
146
- console_1.default.debug(stderr);
147
- return false;
148
- }
149
- if (includesAll(stdout, jsPluginsDependencies))
150
- return true;
151
- console_1.default.error("The jest dependencies are not installed");
152
- const confirmInstall = await cli_ux_1.cli.confirm("Do you want to install the needed dependencies? (y/n)");
153
- if (!confirmInstall) {
154
- console_1.default.error(`The exercises can't be tested without the following dependencies: ${jsPluginsDependencies.join(", ")}`);
155
- console_1.default.info(`Please install them and try again. Run the following command to install them: \nnpm install -g ${jsPluginsDependencies.join(" ")}`);
156
- return false;
157
- }
158
- console_1.default.log("Installing jest dependencies...");
159
- await installDependencies(jsPluginsDependencies, "npm");
160
- }
161
- if (pytestNeeded) {
162
- const { stdout, stderr } = await exec("pip list");
163
- if (stderr) {
164
- console_1.default.error(`Error executing pip list. Use debug for more info`);
165
- console_1.default.debug(stderr);
166
- return;
167
- }
168
- if (includesAll(stdout, pyPluginsDependencies))
169
- return true;
170
- console_1.default.error("The pytest dependencies are not installed");
171
- const confirmInstall = await cli_ux_1.cli.confirm("Do you want to install the needed dependencies? (y/n)");
172
- if (!confirmInstall) {
173
- console_1.default.error(`The exercises can't be tested without the following dependencies: ${pyPluginsDependencies.join(", ")}`);
174
- console_1.default.info(`Please install them and try again. Run the following command to install them: \npip install ${pyPluginsDependencies.join(" ")}`);
175
- return false;
176
- }
177
- console_1.default.log("Installing pytest dependencies...");
178
- await installDependencies(pyPluginsDependencies, "pip");
179
- }
180
- return true;
181
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.checkNotInstalledDependencies = exports.checkNotInstalledPlugins = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const util_1 = require("util");
6
+ const child_process_1 = require("child_process");
7
+ const exec = (0, util_1.promisify)(child_process_1.exec);
8
+ const cli_ux_1 = require("cli-ux");
9
+ const console_1 = require("./console");
10
+ const checkNotInstalledPlugins = async (exercises, installedPlugins, command) => {
11
+ var _a, e_1, _b, _c;
12
+ console_1.default.info("Checking needed plugins...");
13
+ const usefulExtensions = new Set(["py", "js", "jsx", "html"]);
14
+ const foundExtensions = [];
15
+ const testingExtensions = [];
16
+ const neededPlugins = [];
17
+ let someExerciseWithOnlyTestFile = false; // I will suppose that there are not exercises with only readme and test files
18
+ // See the extensions of the files that are not tests files
19
+ for (const e of exercises) {
20
+ const notReadmeFiles = e.files.filter(f => !f.name.toLowerCase().includes("readme"));
21
+ if (!someExerciseWithOnlyTestFile && notReadmeFiles.length > 0) {
22
+ someExerciseWithOnlyTestFile = notReadmeFiles.every(f => {
23
+ return f.name.includes("test");
24
+ });
25
+ if (someExerciseWithOnlyTestFile) {
26
+ console_1.default.debug("Some exercises have only test files, I will install the @learnpack/node plugin to run the tests.");
27
+ }
28
+ }
29
+ for (const f of notReadmeFiles) {
30
+ const ext = f.name.split(".").pop();
31
+ if (!ext)
32
+ continue;
33
+ if (f.name.includes("test")) {
34
+ !testingExtensions.includes(ext) && testingExtensions.push(ext);
35
+ continue;
36
+ }
37
+ if (usefulExtensions.has(ext) && !foundExtensions.includes(ext)) {
38
+ foundExtensions.push(ext);
39
+ }
40
+ }
41
+ }
42
+ console_1.default.debug("foundExtensions", foundExtensions);
43
+ console_1.default.debug("testingExtensions", testingExtensions);
44
+ if (foundExtensions.length === 0 && testingExtensions.length === 0)
45
+ return {
46
+ needed: [],
47
+ notInstalled: [],
48
+ };
49
+ if (foundExtensions.includes("html") && foundExtensions.includes("js")) {
50
+ neededPlugins.push("@learnpack/dom");
51
+ }
52
+ if (foundExtensions.includes("html") && !foundExtensions.includes("js")) {
53
+ neededPlugins.push("@learnpack/html");
54
+ }
55
+ if (foundExtensions.includes("jsx")) {
56
+ neededPlugins.push("@learnpack/react");
57
+ }
58
+ if (foundExtensions.includes("py") || testingExtensions.includes("py")) {
59
+ neededPlugins.push("@learnpack/python");
60
+ }
61
+ if ((foundExtensions.includes("js") && !foundExtensions.includes("html")) ||
62
+ (testingExtensions.includes("js") && someExerciseWithOnlyTestFile)) {
63
+ neededPlugins.push("@learnpack/node");
64
+ }
65
+ const notInstalled = neededPlugins.filter(item => !installedPlugins.includes(item));
66
+ if (notInstalled.length > 0) {
67
+ console_1.default.error("These plugins are not installed but required: ", notInstalled);
68
+ const confirmInstall = await cli_ux_1.cli.confirm("Do you want to install the needed plugins? (y/n)");
69
+ if (confirmInstall) {
70
+ console_1.default.info("Installing the needed plugins...");
71
+ try {
72
+ for (var _d = true, notInstalled_1 = tslib_1.__asyncValues(notInstalled), notInstalled_1_1; notInstalled_1_1 = await notInstalled_1.next(), _a = notInstalled_1_1.done, !_a; _d = true) {
73
+ _c = notInstalled_1_1.value;
74
+ _d = false;
75
+ const p = _c;
76
+ await command.config.runCommand(`plugins:install`, [p]);
77
+ console_1.default.log(`Plugin ${p} installed`);
78
+ }
79
+ }
80
+ catch (e_1_1) { e_1 = { error: e_1_1 }; }
81
+ finally {
82
+ try {
83
+ if (!_d && !_a && (_b = notInstalled_1.return)) await _b.call(notInstalled_1);
84
+ }
85
+ finally { if (e_1) throw e_1.error; }
86
+ }
87
+ console_1.default.log("All needed plugins installed, please restart LearnPack to load them.");
88
+ console_1.default.info("Run: $ learnpack start");
89
+ command.exit(0);
90
+ }
91
+ else {
92
+ console_1.default.error("You need to install the plugins to complete this exercise");
93
+ console_1.default.info("To install the plugins run each of the following commands: ");
94
+ for (const p of notInstalled) {
95
+ console_1.default.log(`learnpack plugins:install ${p}`);
96
+ }
97
+ command.exit(1);
98
+ }
99
+ }
100
+ return {
101
+ needed: neededPlugins,
102
+ notInstalled,
103
+ };
104
+ };
105
+ exports.checkNotInstalledPlugins = checkNotInstalledPlugins;
106
+ function includesAll(baseString, elementsArray) {
107
+ return elementsArray.every(element => baseString.includes(element));
108
+ }
109
+ const installDependencies = async (deps, packageManager) => {
110
+ let command = "";
111
+ if (packageManager === "npm") {
112
+ command = `npm install -g ${deps.join(" ")}`;
113
+ }
114
+ else if (packageManager === "pip") {
115
+ command = `pip install ${deps.join(" ")}`;
116
+ }
117
+ const { stdout, stderr } = await exec(command);
118
+ if (stderr && (stderr.includes("npm ERR!") || stderr.includes("Traceback"))) {
119
+ console_1.default.error(`Error executing ${command}.`);
120
+ console_1.default.error(stderr);
121
+ return;
122
+ }
123
+ console_1.default.info(`Dependencies ${deps.join(" ")} installed...`);
124
+ return true;
125
+ };
126
+ const checkNotInstalledDependencies = async (neededPlugins) => {
127
+ console_1.default.info("Checking needed dependencies...");
128
+ const jsPluginsDependencies = [
129
+ "jest@29.7.0",
130
+ "jest-environment-jsdom@29.7.0",
131
+ ];
132
+ const pyPluginsDependencies = ["pytest==6.2.5", "pytest-testdox", "mock"];
133
+ const npmLsCommand = "npm ls jest jest-environment-jsdom -g";
134
+ let pytestNeeded = false;
135
+ let jestNeeded = false;
136
+ if (neededPlugins.includes("@learnpack/dom") ||
137
+ neededPlugins.includes("@learnpack/html") ||
138
+ neededPlugins.includes("@learnpack/react") ||
139
+ neededPlugins.includes("@learnpack/node")) {
140
+ jestNeeded = true;
141
+ }
142
+ if ("@learnpack/python" in neededPlugins) {
143
+ pytestNeeded = true;
144
+ }
145
+ if (jestNeeded) {
146
+ const { stdout, stderr } = await exec("npm ls -g");
147
+ if (stderr) {
148
+ console_1.default.error(`Error executing ${npmLsCommand}. Use debug for more info`);
149
+ console_1.default.debug(stderr);
150
+ return false;
151
+ }
152
+ if (includesAll(stdout, jsPluginsDependencies))
153
+ return true;
154
+ console_1.default.error("The jest dependencies are not installed");
155
+ const confirmInstall = await cli_ux_1.cli.confirm("Do you want to install the needed dependencies? (y/n)");
156
+ if (!confirmInstall) {
157
+ console_1.default.error(`The exercises can't be tested without the following dependencies: ${jsPluginsDependencies.join(", ")}`);
158
+ console_1.default.info(`Please install them and try again. Run the following command to install them: \nnpm install -g ${jsPluginsDependencies.join(" ")}`);
159
+ return false;
160
+ }
161
+ console_1.default.log("Installing jest dependencies...");
162
+ await installDependencies(jsPluginsDependencies, "npm");
163
+ }
164
+ if (pytestNeeded) {
165
+ const { stdout, stderr } = await exec("pip list");
166
+ if (stderr) {
167
+ console_1.default.error(`Error executing pip list. Use debug for more info`);
168
+ console_1.default.debug(stderr);
169
+ return;
170
+ }
171
+ if (includesAll(stdout, pyPluginsDependencies))
172
+ return true;
173
+ console_1.default.error("The pytest dependencies are not installed");
174
+ const confirmInstall = await cli_ux_1.cli.confirm("Do you want to install the needed dependencies? (y/n)");
175
+ if (!confirmInstall) {
176
+ console_1.default.error(`The exercises can't be tested without the following dependencies: ${pyPluginsDependencies.join(", ")}`);
177
+ console_1.default.info(`Please install them and try again. Run the following command to install them: \npip install ${pyPluginsDependencies.join(" ")}`);
178
+ return false;
179
+ }
180
+ console_1.default.log("Installing pytest dependencies...");
181
+ await installDependencies(pyPluginsDependencies, "pip");
182
+ }
183
+ return true;
184
+ };
185
+ exports.checkNotInstalledDependencies = checkNotInstalledDependencies;
@@ -1,12 +1,12 @@
1
- declare const _default: {
2
- _debug: boolean;
3
- startDebug: () => void;
4
- log: (msg: string | Array<string>, ...args: Array<any>) => void;
5
- error: (msg: string, ...args: Array<any>) => void;
6
- success: (msg: string, ...args: Array<any>) => void;
7
- info: (msg: any, ...args: Array<any>) => void;
8
- help: (msg: string) => void;
9
- debug(...args: Array<any>): void;
10
- warning: (msg: string) => void;
11
- };
12
- export default _default;
1
+ declare const _default: {
2
+ _debug: boolean;
3
+ startDebug: () => void;
4
+ log: (msg: string | Array<string>, ...args: Array<any>) => void;
5
+ error: (msg: string, ...args: Array<any>) => void;
6
+ success: (msg: string, ...args: Array<any>) => void;
7
+ info: (msg: any, ...args: Array<any>) => void;
8
+ help: (msg: string) => void;
9
+ debug(...args: Array<any>): void;
10
+ warning: (msg: string) => void;
11
+ };
12
+ export default _default;
@@ -1,19 +1,19 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const chalk = require("chalk");
4
- exports.default = {
5
- // _debug: true,
6
- _debug: process.env.DEBUG === "true",
7
- startDebug: function () {
8
- this._debug = true;
9
- },
10
- log: (msg, ...args) => console.log(chalk.gray(msg), ...args),
11
- error: (msg, ...args) => console.log(chalk.red("⨉ " + msg), ...args),
12
- success: (msg, ...args) => console.log(chalk.green("✓ " + msg), ...args),
13
- info: (msg, ...args) => console.log(chalk.blue("ⓘ " + msg), ...args),
14
- help: (msg) => console.log(`${chalk.white.bold("⚠ help:")} ${chalk.white(msg)}`),
15
- debug(...args) {
16
- this._debug && console.log(chalk.magentaBright("⚠ debug: "), args);
17
- },
18
- warning: (msg) => console.log(`${chalk.yellow("⚠ warning:")} ${chalk.yellow(msg)}`),
19
- };
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const chalk = require("chalk");
4
+ exports.default = {
5
+ // _debug: true,
6
+ _debug: process.env.DEBUG === "true",
7
+ startDebug: function () {
8
+ this._debug = true;
9
+ },
10
+ log: (msg, ...args) => console.log(chalk.gray(msg), ...args),
11
+ error: (msg, ...args) => console.log(chalk.red("⨉ " + msg), ...args),
12
+ success: (msg, ...args) => console.log(chalk.green("✓ " + msg), ...args),
13
+ info: (msg, ...args) => console.log(chalk.blue("ⓘ " + msg), ...args),
14
+ help: (msg) => console.log(`${chalk.white.bold("⚠ help:")} ${chalk.white(msg)}`),
15
+ debug(...args) {
16
+ this._debug && console.log(chalk.magentaBright("⚠ debug: "), args);
17
+ },
18
+ warning: (msg) => console.log(`${chalk.yellow("⚠ warning:")} ${chalk.yellow(msg)}`),
19
+ };
@@ -1,17 +1,17 @@
1
- import { ISolution, IError } from '../models/errors';
2
- export declare const getSolution: (slug?: string | undefined) => ISolution;
3
- export declare const ValidationError: (error: IError | string) => IError;
4
- export declare const NotFoundError: (error: IError | string) => IError;
5
- export declare const CompilerError: (error: IError | string) => IError;
6
- export declare const TestingError: (error: IError | string) => IError;
7
- export declare const AuthError: (error: IError | string) => IError;
8
- export declare const InternalError: (error: IError | string) => IError;
9
- declare const _default: {
10
- ValidationError: (error: string | IError) => IError;
11
- CompilerError: (error: string | IError) => IError;
12
- TestingError: (error: string | IError) => IError;
13
- NotFoundError: (error: string | IError) => IError;
14
- InternalError: (error: string | IError) => IError;
15
- AuthError: (error: string | IError) => IError;
16
- };
17
- export default _default;
1
+ import { ISolution, IError } from '../models/errors';
2
+ export declare const getSolution: (slug?: string) => ISolution;
3
+ export declare const ValidationError: (error: IError | string) => IError;
4
+ export declare const NotFoundError: (error: IError | string) => IError;
5
+ export declare const CompilerError: (error: IError | string) => IError;
6
+ export declare const TestingError: (error: IError | string) => IError;
7
+ export declare const AuthError: (error: IError | string) => IError;
8
+ export declare const InternalError: (error: IError | string) => IError;
9
+ declare const _default: {
10
+ ValidationError: (error: IError | string) => IError;
11
+ CompilerError: (error: IError | string) => IError;
12
+ TestingError: (error: IError | string) => IError;
13
+ NotFoundError: (error: IError | string) => IError;
14
+ InternalError: (error: IError | string) => IError;
15
+ AuthError: (error: IError | string) => IError;
16
+ };
17
+ export default _default;