uni-run 1.0.13 → 1.1.0

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 (77) hide show
  1. package/README.md +53 -25
  2. package/dist/app.js +79 -0
  3. package/dist/{arg.d.cts → arg.d.ts} +1 -1
  4. package/dist/{arg.cjs → arg.js} +3 -3
  5. package/dist/{arg-helper.d.cts → argHelper.d.ts} +3 -4
  6. package/dist/{arg-helper.cjs → argHelper.js} +2 -2
  7. package/dist/{bin.d.cts → bin.d.ts} +1 -1
  8. package/dist/{bin.cjs → bin.js} +2 -2
  9. package/dist/execution/{index.d.mts → index.d.ts} +1 -1
  10. package/dist/execution/{index.cjs → index.js} +3 -3
  11. package/dist/execution/{kill-process.d.cts → kill-process.d.ts} +1 -1
  12. package/dist/execution/{watcher.cjs → watcher.js} +2 -2
  13. package/dist/helpers/as.d.ts +1 -0
  14. package/dist/helpers/as.js +6 -0
  15. package/dist/helpers/get-config.d.ts +1 -0
  16. package/dist/helpers/get-config.js +30 -0
  17. package/dist/helpers/getConfig.d.ts +1 -0
  18. package/dist/helpers/getConfig.js +24 -0
  19. package/dist/helpers/getUserExecutors.d.ts +2 -0
  20. package/dist/helpers/getUserExecutors.js +18 -0
  21. package/dist/helpers/utils.d.ts +2 -0
  22. package/dist/helpers/utils.js +18 -0
  23. package/dist/index.d.ts +7 -0
  24. package/dist/index.js +16 -0
  25. package/dist/lib/{colors.d.cts → colors.d.ts} +1 -1
  26. package/dist/lib/{colors.cjs → colors.js} +1 -1
  27. package/dist/scriptExecutors/checkRuntime.d.ts +2 -0
  28. package/dist/scriptExecutors/checkRuntime.js +42 -0
  29. package/dist/scriptExecutors/index.d.ts +3 -0
  30. package/dist/scriptExecutors/index.js +170 -0
  31. package/dist/scriptExecutors/types.t.d.ts +17 -0
  32. package/dist/scriptExecutors/types.t.js +2 -0
  33. package/package.json +9 -12
  34. package/dist/app.cjs +0 -60
  35. package/dist/app.d.mts +0 -1
  36. package/dist/app.mjs +0 -32
  37. package/dist/arg-helper.d.mts +0 -141
  38. package/dist/arg-helper.mjs +0 -108
  39. package/dist/arg.d.mts +0 -277
  40. package/dist/arg.mjs +0 -9
  41. package/dist/bin.d.mts +0 -2
  42. package/dist/bin.mjs +0 -4
  43. package/dist/builtin-bin/Executor.cjs +0 -67
  44. package/dist/builtin-bin/Executor.d.cts +0 -21
  45. package/dist/builtin-bin/Executor.d.mts +0 -21
  46. package/dist/builtin-bin/Executor.mjs +0 -61
  47. package/dist/builtin-bin/index.cjs +0 -107
  48. package/dist/builtin-bin/index.d.cts +0 -3
  49. package/dist/builtin-bin/index.d.mts +0 -3
  50. package/dist/builtin-bin/index.mjs +0 -102
  51. package/dist/execution/gitignore.d.mts +0 -1
  52. package/dist/execution/gitignore.mjs +0 -11
  53. package/dist/execution/index.d.cts +0 -17
  54. package/dist/execution/index.mjs +0 -127
  55. package/dist/execution/kill-process.d.mts +0 -2
  56. package/dist/execution/kill-process.mjs +0 -24
  57. package/dist/execution/watcher.d.mts +0 -6
  58. package/dist/execution/watcher.mjs +0 -31
  59. package/dist/index.cjs +0 -19
  60. package/dist/index.d.cts +0 -8
  61. package/dist/index.d.mts +0 -8
  62. package/dist/index.mjs +0 -13
  63. package/dist/lib/colors.d.mts +0 -3
  64. package/dist/lib/colors.mjs +0 -4
  65. package/dist/lib/currentModule.d.mts +0 -5
  66. package/dist/lib/currentModule.mjs +0 -17
  67. package/dist/utils/debounce.d.mts +0 -1
  68. package/dist/utils/debounce.mjs +0 -7
  69. /package/dist/{app.d.cts → app.d.ts} +0 -0
  70. /package/dist/execution/{gitignore.d.cts → gitignore.d.ts} +0 -0
  71. /package/dist/execution/{gitignore.cjs → gitignore.js} +0 -0
  72. /package/dist/execution/{kill-process.cjs → kill-process.js} +0 -0
  73. /package/dist/execution/{watcher.d.cts → watcher.d.ts} +0 -0
  74. /package/dist/{utils/debounce.d.cts → helpers/debounce.d.ts} +0 -0
  75. /package/dist/{utils/debounce.cjs → helpers/debounce.js} +0 -0
  76. /package/dist/lib/{currentModule.d.cts → currentModule.d.ts} +0 -0
  77. /package/dist/lib/{currentModule.cjs → currentModule.js} +0 -0
package/dist/arg.d.mts DELETED
@@ -1,277 +0,0 @@
1
- import NoArg from "noarg";
2
- export declare const app: NoArg<"uni-run", {
3
- readonly allowEqualAssign: true;
4
- readonly booleanNotSyntaxEnding: "\\";
5
- readonly allowDuplicateFlagForList: true;
6
- readonly splitListByComma: true;
7
- }, {
8
- readonly help: true;
9
- }, {
10
- readonly optionalArguments: [];
11
- readonly globalFlags: {};
12
- readonly description: "A universal runner for scripts";
13
- readonly arguments: [{
14
- readonly name: "script";
15
- readonly type: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
16
- readonly description: "Run a script";
17
- }];
18
- readonly listArgument: {
19
- readonly name: "args for script";
20
- readonly description: "The arguments to pass to the script";
21
- readonly type: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
22
- };
23
- readonly trailingArguments: "--";
24
- readonly flags: {
25
- readonly 'key-reload': import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
26
- aliases: ["k"];
27
- required: true;
28
- default: true;
29
- description: "Reload the page when pressing 'Ctrl+R' or 'F5'";
30
- }>;
31
- readonly watch: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
32
- aliases: ["w"];
33
- required: true;
34
- default: true;
35
- description: "Watch for file changes and reload the script";
36
- }>;
37
- readonly exit: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
38
- required: true;
39
- default: false;
40
- description: "Exit after code execution, disabling `watch` and `reloadKey`";
41
- }>;
42
- readonly delay: import("noarg/dist/schema/TypeNumber.cjs").TypeNumber<{
43
- aliases: ["d"];
44
- required: true;
45
- default: 100;
46
- description: "The delay to wait for the watcher to trigger";
47
- }>;
48
- readonly ext: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
49
- aliases: ["e"];
50
- required: true;
51
- default: never[];
52
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
53
- description: "Looks for changes only of the given extensions";
54
- }>;
55
- readonly focus: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
56
- aliases: ["f"];
57
- required: true;
58
- default: never[];
59
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
60
- description: "Only watch the given items. `chokidar` syntax";
61
- }>;
62
- readonly ignore: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
63
- aliases: ["ig"];
64
- required: true;
65
- default: never[];
66
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
67
- description: "Exclude the given items. `gitignore` syntax";
68
- }>;
69
- readonly bench: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
70
- aliases: ["b"];
71
- description: "Calculate the execution time";
72
- }>;
73
- readonly 'bench-prefix': import("noarg/dist/schema/TypeString.cjs").TypeString<{
74
- aliases: ["bp"];
75
- minLength: 1;
76
- description: "The prefix to show before the execution time";
77
- }>;
78
- readonly clear: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
79
- aliases: ["c"];
80
- required: true;
81
- default: true;
82
- description: "Clear the console before running the script";
83
- }>;
84
- readonly silent: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
85
- required: true;
86
- default: false;
87
- description: "Do not show any output of the script";
88
- }>;
89
- readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
90
- required: true;
91
- default: string;
92
- description: "Current working directory";
93
- }>;
94
- readonly shell: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
95
- required: true;
96
- default: false;
97
- description: "Run the script in a shell for more low-level control";
98
- }>;
99
- readonly 'safe-stdin': import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
100
- required: true;
101
- default: false;
102
- description: "Disable raw mode for stdin (useful for some scripts)";
103
- }>;
104
- readonly info: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
105
- required: true;
106
- default: false;
107
- description: "Show information about the script";
108
- }>;
109
- readonly time: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
110
- required: true;
111
- default: false;
112
- description: "Show the execution time at the start";
113
- }>;
114
- readonly env: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
115
- required: true;
116
- default: never[];
117
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
118
- description: "Environment variables";
119
- }>;
120
- readonly 'node-dev': import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
121
- required: true;
122
- default: false;
123
- description: "Set NODE_ENV to \"development\"";
124
- }>;
125
- readonly tsn: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
126
- required: true;
127
- default: false;
128
- description: "Run the script with ts-node (TypeScript)";
129
- }>;
130
- };
131
- readonly customRenderHelp: {
132
- readonly helpUsageTrailingArgsLabel: "...[args/flags for script]";
133
- };
134
- }>;
135
- export declare const exec: import("noarg/dist/NoArg/NoArgProgram.cjs").NoArgProgram<"exec", {
136
- readonly allowEqualAssign: true;
137
- readonly booleanNotSyntaxEnding: "\\";
138
- readonly allowDuplicateFlagForList: true;
139
- readonly splitListByComma: true;
140
- }, {
141
- readonly help: true;
142
- }, {
143
- readonly description: "Execute a script with the given binary";
144
- readonly arguments: [];
145
- readonly optionalArguments: [];
146
- readonly listArgument: {
147
- readonly name: "args for script";
148
- readonly description: "The arguments to pass to the script";
149
- readonly type: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
150
- };
151
- readonly trailingArguments: "--";
152
- readonly flags: {
153
- readonly 'key-reload': import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
154
- aliases: ["k"];
155
- required: true;
156
- default: true;
157
- description: "Reload the page when pressing 'Ctrl+R' or 'F5'";
158
- }>;
159
- readonly watch: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
160
- aliases: ["w"];
161
- required: true;
162
- default: true;
163
- description: "Watch for file changes and reload the script";
164
- }>;
165
- readonly exit: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
166
- required: true;
167
- default: false;
168
- description: "Exit after code execution, disabling `watch` and `reloadKey`";
169
- }>;
170
- readonly delay: import("noarg/dist/schema/TypeNumber.cjs").TypeNumber<{
171
- aliases: ["d"];
172
- required: true;
173
- default: 100;
174
- description: "The delay to wait for the watcher to trigger";
175
- }>;
176
- readonly ext: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
177
- aliases: ["e"];
178
- required: true;
179
- default: never[];
180
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
181
- description: "Looks for changes only of the given extensions";
182
- }>;
183
- readonly focus: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
184
- aliases: ["f"];
185
- required: true;
186
- default: never[];
187
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
188
- description: "Only watch the given items. `chokidar` syntax";
189
- }>;
190
- readonly ignore: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
191
- aliases: ["ig"];
192
- required: true;
193
- default: never[];
194
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
195
- description: "Exclude the given items. `gitignore` syntax";
196
- }>;
197
- readonly bench: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
198
- aliases: ["b"];
199
- description: "Calculate the execution time";
200
- }>;
201
- readonly 'bench-prefix': import("noarg/dist/schema/TypeString.cjs").TypeString<{
202
- aliases: ["bp"];
203
- minLength: 1;
204
- description: "The prefix to show before the execution time";
205
- }>;
206
- readonly clear: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
207
- aliases: ["c"];
208
- required: true;
209
- default: true;
210
- description: "Clear the console before running the script";
211
- }>;
212
- readonly silent: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
213
- required: true;
214
- default: false;
215
- description: "Do not show any output of the script";
216
- }>;
217
- readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
218
- required: true;
219
- default: string;
220
- description: "Current working directory";
221
- }>;
222
- readonly shell: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
223
- required: true;
224
- default: false;
225
- description: "Run the script in a shell for more low-level control";
226
- }>;
227
- readonly 'safe-stdin': import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
228
- required: true;
229
- default: false;
230
- description: "Disable raw mode for stdin (useful for some scripts)";
231
- }>;
232
- readonly info: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
233
- required: true;
234
- default: false;
235
- description: "Show information about the script";
236
- }>;
237
- readonly time: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
238
- required: true;
239
- default: false;
240
- description: "Show the execution time at the start";
241
- }>;
242
- readonly env: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
243
- required: true;
244
- default: never[];
245
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
246
- description: "Environment variables";
247
- }>;
248
- readonly 'node-dev': import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
249
- required: true;
250
- default: false;
251
- description: "Set NODE_ENV to \"development\"";
252
- }>;
253
- readonly tsn: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
254
- required: true;
255
- default: false;
256
- description: "Run the script with ts-node (TypeScript)";
257
- }>;
258
- };
259
- readonly customRenderHelp: {
260
- readonly helpUsageTrailingArgsLabel: "...[args/flags for script]";
261
- };
262
- globalFlags: {};
263
- }>;
264
- export declare const list: import("noarg/dist/NoArg/NoArgProgram.cjs").NoArgProgram<"list", {
265
- readonly allowEqualAssign: true;
266
- readonly booleanNotSyntaxEnding: "\\";
267
- readonly allowDuplicateFlagForList: true;
268
- readonly splitListByComma: true;
269
- }, {
270
- readonly help: true;
271
- }, {
272
- readonly description: "List supported scripts";
273
- readonly arguments: [];
274
- readonly optionalArguments: [];
275
- readonly flags: {};
276
- globalFlags: {};
277
- }>;
package/dist/arg.mjs DELETED
@@ -1,9 +0,0 @@
1
- import NoArg from "noarg";
2
- import { executionConfig } from "./arg-helper.mjs";
3
- export const app = NoArg.create('uni-run', Object.assign(Object.assign({}, executionConfig), { description: 'A universal runner for scripts', system: { splitListByComma: true }, arguments: [
4
- { name: 'script', type: NoArg.string(), description: 'Run a script' },
5
- ] }));
6
- export const exec = app.create('exec', Object.assign(Object.assign({}, executionConfig), { description: 'Execute a script with the given binary' }));
7
- export const list = app.create('list', {
8
- description: 'List supported scripts',
9
- });
package/dist/bin.d.mts DELETED
@@ -1,2 +0,0 @@
1
- #!/usr/bin/env node
2
- import "./app.mjs";
package/dist/bin.mjs DELETED
@@ -1,4 +0,0 @@
1
- #!/usr/bin/env node
2
- import "./app.mjs";
3
- import { app } from "./arg.mjs";
4
- app.start();
@@ -1,67 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const execution_1 = __importDefault(require("../execution/index.cjs"));
7
- const confirm_1 = __importDefault(require("@inquirer/confirm"));
8
- const cross_spawn_1 = require("cross-spawn");
9
- class Executor {
10
- constructor(name, config) {
11
- var _a;
12
- this.name = name;
13
- this.config = config;
14
- (_a = this.config.watchExtensions) === null || _a === void 0 ? void 0 : _a.push(...this.config.extensions);
15
- }
16
- getName() {
17
- return this.name;
18
- }
19
- getRelatedExts() {
20
- var _a;
21
- return [...this.config.extensions, ...((_a = this.config.watchExtensions) !== null && _a !== void 0 ? _a : [])];
22
- }
23
- start(options, args) {
24
- if (!this.isInstalled(options)) {
25
- return this.renderHowToInstall(options);
26
- }
27
- execution_1.default.start(this.config.run(args, options), options);
28
- }
29
- isSupported(script) {
30
- return this.config.extensions.includes(script.split('.').pop() || '');
31
- }
32
- isInstalled(options) {
33
- if (!this.config.checkInstallation)
34
- return true;
35
- const [command, ...args] = typeof this.config.checkInstallation === 'function'
36
- ? this.config.checkInstallation(options)
37
- : this.config.checkInstallation || [];
38
- const result = (0, cross_spawn_1.sync)(command, args, {
39
- stdio: 'ignore',
40
- });
41
- if (result.status === 1)
42
- return false;
43
- return true;
44
- }
45
- renderHowToInstall(options) {
46
- console.error(`${this.name} is not installed.`);
47
- if (this.config.installMessage) {
48
- console.log('How to install:');
49
- console.log(this.config.installMessage);
50
- }
51
- const commands = typeof this.config.installCommands === 'function'
52
- ? this.config.installCommands(options)
53
- : this.config.installCommands;
54
- if (!commands || !commands.length)
55
- return;
56
- (0, confirm_1.default)({ message: 'Do you want to install it?' }).then((ans) => {
57
- if (!ans)
58
- return;
59
- commands.forEach(([command, ...args]) => {
60
- if (!command)
61
- return;
62
- (0, cross_spawn_1.sync)(command, args, { stdio: 'inherit' });
63
- });
64
- });
65
- }
66
- }
67
- exports.default = Executor;
@@ -1,21 +0,0 @@
1
- import { ExecuteOptions } from "../arg-helper.cjs";
2
- type BinConfig = {
3
- extensions: string[];
4
- watchExtensions?: string[];
5
- run: (args: string[], options: ExecuteOptions) => string[];
6
- installMessage?: string;
7
- installCommands?: string[] | ((options: ExecuteOptions) => string[]);
8
- checkInstallation?: string[] | ((options: ExecuteOptions) => string[]);
9
- };
10
- export default class Executor {
11
- private name;
12
- private config;
13
- constructor(name: string, config: BinConfig);
14
- getName(): string;
15
- getRelatedExts(): string[];
16
- start(options: ExecuteOptions, args: string[]): void;
17
- isSupported(script: string): boolean;
18
- private isInstalled;
19
- private renderHowToInstall;
20
- }
21
- export {};
@@ -1,21 +0,0 @@
1
- import { ExecuteOptions } from "../arg-helper.mjs";
2
- type BinConfig = {
3
- extensions: string[];
4
- watchExtensions?: string[];
5
- run: (args: string[], options: ExecuteOptions) => string[];
6
- installMessage?: string;
7
- installCommands?: string[] | ((options: ExecuteOptions) => string[]);
8
- checkInstallation?: string[] | ((options: ExecuteOptions) => string[]);
9
- };
10
- export default class Executor {
11
- private name;
12
- private config;
13
- constructor(name: string, config: BinConfig);
14
- getName(): string;
15
- getRelatedExts(): string[];
16
- start(options: ExecuteOptions, args: string[]): void;
17
- isSupported(script: string): boolean;
18
- private isInstalled;
19
- private renderHowToInstall;
20
- }
21
- export {};
@@ -1,61 +0,0 @@
1
- import Execution from "../execution/index.mjs";
2
- import confirm from "@inquirer/confirm";
3
- import { sync as spawnSync } from "cross-spawn";
4
- export default class Executor {
5
- constructor(name, config) {
6
- var _a;
7
- this.name = name;
8
- this.config = config;
9
- (_a = this.config.watchExtensions) === null || _a === void 0 ? void 0 : _a.push(...this.config.extensions);
10
- }
11
- getName() {
12
- return this.name;
13
- }
14
- getRelatedExts() {
15
- var _a;
16
- return [...this.config.extensions, ...((_a = this.config.watchExtensions) !== null && _a !== void 0 ? _a : [])];
17
- }
18
- start(options, args) {
19
- if (!this.isInstalled(options)) {
20
- return this.renderHowToInstall(options);
21
- }
22
- Execution.start(this.config.run(args, options), options);
23
- }
24
- isSupported(script) {
25
- return this.config.extensions.includes(script.split('.').pop() || '');
26
- }
27
- isInstalled(options) {
28
- if (!this.config.checkInstallation)
29
- return true;
30
- const [command, ...args] = typeof this.config.checkInstallation === 'function'
31
- ? this.config.checkInstallation(options)
32
- : this.config.checkInstallation || [];
33
- const result = spawnSync(command, args, {
34
- stdio: 'ignore',
35
- });
36
- if (result.status === 1)
37
- return false;
38
- return true;
39
- }
40
- renderHowToInstall(options) {
41
- console.error(`${this.name} is not installed.`);
42
- if (this.config.installMessage) {
43
- console.log('How to install:');
44
- console.log(this.config.installMessage);
45
- }
46
- const commands = typeof this.config.installCommands === 'function'
47
- ? this.config.installCommands(options)
48
- : this.config.installCommands;
49
- if (!commands || !commands.length)
50
- return;
51
- confirm({ message: 'Do you want to install it?' }).then((ans) => {
52
- if (!ans)
53
- return;
54
- commands.forEach(([command, ...args]) => {
55
- if (!command)
56
- return;
57
- spawnSync(command, args, { stdio: 'inherit' });
58
- });
59
- });
60
- }
61
- }
@@ -1,107 +0,0 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const Executor_1 = __importDefault(require("./Executor.cjs"));
7
- exports.default = [
8
- new Executor_1.default('Node.js', {
9
- extensions: ['js', 'javascript', 'jsx', 'cjs', 'cjsx', 'mjs', 'mjsx'],
10
- checkInstallation: ['node', '--version'],
11
- installMessage: 'Please install Node.js from https://nodejs.org',
12
- run(args) {
13
- return ['node', ...args];
14
- },
15
- }),
16
- new Executor_1.default('TypeScript', {
17
- extensions: ['ts', 'tsx', 'cts', 'ctsx', 'mts', 'mtsx'],
18
- watchExtensions: ['js', 'javascript', 'jsx', 'cjs', 'cjsx', 'mjs', 'mjsx'],
19
- checkInstallation(options) {
20
- return options.tsNode ? ['ts-node', '--version'] : ['tsx', '--version'];
21
- },
22
- installCommands(options) {
23
- return options.tsNode
24
- ? ['npm install -g ts-node']
25
- : ['npm install -g tsx'];
26
- },
27
- installMessage: 'Please install tsx. More: https://tsx.is',
28
- run(args, options) {
29
- return options.tsNode ? ['ts-node', ...args] : ['tsx', ...args];
30
- },
31
- }),
32
- new Executor_1.default('Python', {
33
- extensions: ['py'],
34
- checkInstallation: ['python', '--version'],
35
- installMessage: 'Please install Python from https://www.python.org',
36
- run(args) {
37
- return ['python', ...args];
38
- },
39
- }),
40
- new Executor_1.default('Java - Oracle', {
41
- extensions: ['java'],
42
- checkInstallation: ['java', '--version'],
43
- installMessage: 'Please install Java from https://www.oracle.com/java',
44
- run(args) {
45
- return ['java', ...args];
46
- },
47
- }),
48
- new Executor_1.default('Powershell', {
49
- extensions: ['ps1'],
50
- checkInstallation: ['powershell', '-command', 'echo ok'],
51
- installMessage: 'Please install Powershell from https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell',
52
- run(args) {
53
- return ['powershell', '-File', ...args];
54
- },
55
- }),
56
- new Executor_1.default('Command Prompt', {
57
- extensions: ['cmd', 'bat'],
58
- checkInstallation: ['cmd', '/c', 'echo ok'],
59
- installMessage: 'Please install Command Prompt from Windows',
60
- run(args) {
61
- return ['cmd', '/c', ...args];
62
- },
63
- }),
64
- new Executor_1.default('Shell', {
65
- extensions: ['sh'],
66
- checkInstallation: ['bash', '--version'],
67
- installMessage: 'Please install Bash from https://www.gnu.org/software/bash',
68
- run(args) {
69
- return ['bash', ...args];
70
- },
71
- }),
72
- new Executor_1.default('Fish Shell', {
73
- extensions: ['fish'],
74
- checkInstallation: ['fish', '--version'],
75
- installMessage: 'Please install Fish from https://fishshell.com',
76
- run(args) {
77
- return ['fish', ...args];
78
- },
79
- }),
80
- new Executor_1.default('Lua', {
81
- extensions: ['lua'],
82
- checkInstallation: ['lua', '-v'],
83
- installMessage: 'Please install Lua from https://www.lua.org',
84
- run(args) {
85
- return ['lua', ...args];
86
- },
87
- }),
88
- new Executor_1.default('SASS (CSS)', {
89
- extensions: ['sass', 'scss'],
90
- checkInstallation: ['sass', '--version'],
91
- installCommands: ['npm install -g sass'],
92
- installMessage: 'Please install SASS from https://sass-lang.com',
93
- run(args) {
94
- return ['sass', ...args];
95
- },
96
- }),
97
- new Executor_1.default('HTML Server', {
98
- extensions: ['html', 'htm'],
99
- watchExtensions: ['css', 'js', 'javascript', 'json'],
100
- checkInstallation: ['http-server', '--version'],
101
- installCommands: ['npm install -g http-server'],
102
- installMessage: 'Please install http-server from https://www.npmjs.com/package/http-server',
103
- run(args) {
104
- return ['http-server', ...args];
105
- },
106
- }),
107
- ];
@@ -1,3 +0,0 @@
1
- import Executor from "./Executor.cjs";
2
- declare const _default: Executor[];
3
- export default _default;
@@ -1,3 +0,0 @@
1
- import Executor from "./Executor.mjs";
2
- declare const _default: Executor[];
3
- export default _default;