uni-run 1.1.24 → 2.0.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.
- package/README.md +103 -113
- package/dist/app-31LC_vYS.js +28304 -0
- package/dist/app-31LC_vYS.js.map +1 -0
- package/dist/app-IwNLL71t.mjs +28239 -0
- package/dist/app-IwNLL71t.mjs.map +1 -0
- package/dist/run.cjs +5 -0
- package/dist/run.cjs.map +1 -0
- package/dist/run.d.cts +1 -0
- package/dist/run.d.mts +1 -0
- package/dist/run.mjs +6 -0
- package/dist/run.mjs.map +1 -0
- package/dist/rux.cjs +6 -0
- package/dist/rux.cjs.map +1 -0
- package/dist/rux.d.cts +1 -0
- package/dist/rux.d.mts +1 -0
- package/dist/rux.mjs +7 -0
- package/dist/rux.mjs.map +1 -0
- package/package.json +54 -30
- package/dist/app.d.ts +0 -1
- package/dist/app.js +0 -94
- package/dist/arg.d.ts +0 -229
- package/dist/arg.js +0 -18
- package/dist/argHelper.d.ts +0 -108
- package/dist/argHelper.js +0 -94
- package/dist/bin.d.ts +0 -2
- package/dist/bin.js +0 -6
- package/dist/bix.d.ts +0 -2
- package/dist/bix.js +0 -8
- package/dist/execution/gitignore.d.ts +0 -1
- package/dist/execution/gitignore.js +0 -40
- package/dist/execution/index.d.ts +0 -21
- package/dist/execution/index.js +0 -177
- package/dist/execution/kill-process.d.ts +0 -2
- package/dist/execution/kill-process.js +0 -50
- package/dist/execution/watcher.d.ts +0 -6
- package/dist/execution/watcher.js +0 -60
- package/dist/helpers/as.d.ts +0 -1
- package/dist/helpers/as.js +0 -6
- package/dist/helpers/debounce.d.ts +0 -1
- package/dist/helpers/debounce.js +0 -10
- package/dist/helpers/getConfig.d.ts +0 -1
- package/dist/helpers/getConfig.js +0 -26
- package/dist/helpers/getUserExecutors.d.ts +0 -2
- package/dist/helpers/getUserExecutors.js +0 -18
- package/dist/helpers/os.d.ts +0 -7
- package/dist/helpers/os.js +0 -8
- package/dist/helpers/utils.d.ts +0 -3
- package/dist/helpers/utils.js +0 -28
- package/dist/index.d.ts +0 -13
- package/dist/index.js +0 -41
- package/dist/lib/colors.d.ts +0 -3
- package/dist/lib/colors.js +0 -32
- package/dist/lib/currentModule.d.ts +0 -5
- package/dist/lib/currentModule.js +0 -19
- package/dist/local-env.d.ts +0 -4
- package/dist/local-env.js +0 -11
- package/dist/scriptExecutors/checkRuntime.d.ts +0 -2
- package/dist/scriptExecutors/checkRuntime.js +0 -56
- package/dist/scriptExecutors/helpers.d.ts +0 -3
- package/dist/scriptExecutors/helpers.js +0 -22
- package/dist/scriptExecutors/index.d.ts +0 -3
- package/dist/scriptExecutors/index.js +0 -313
- package/dist/scriptExecutors/types.t.d.ts +0 -17
- package/dist/scriptExecutors/types.t.js +0 -2
package/dist/index.js
DELETED
|
@@ -1,41 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
-
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
-
};
|
|
16
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
17
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
18
|
-
};
|
|
19
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.getUserExecutors = exports.getConfig = exports.currentModule = void 0;
|
|
21
|
-
require("./app");
|
|
22
|
-
const arg_1 = require("./arg");
|
|
23
|
-
const getConfig_1 = __importDefault(require("./helpers/getConfig"));
|
|
24
|
-
exports.getConfig = getConfig_1.default;
|
|
25
|
-
const currentModule_1 = __importDefault(require("./lib/currentModule"));
|
|
26
|
-
exports.currentModule = currentModule_1.default;
|
|
27
|
-
const scriptExecutors_1 = __importDefault(require("./scriptExecutors"));
|
|
28
|
-
const getUserExecutors_1 = __importDefault(require("./helpers/getUserExecutors"));
|
|
29
|
-
exports.getUserExecutors = getUserExecutors_1.default;
|
|
30
|
-
__exportStar(require("./scriptExecutors/types.t"), exports);
|
|
31
|
-
exports.default = {
|
|
32
|
-
addExecutorBefore(executor) {
|
|
33
|
-
scriptExecutors_1.default.unshift(executor);
|
|
34
|
-
},
|
|
35
|
-
addExecutorAfter(executor) {
|
|
36
|
-
scriptExecutors_1.default.push(executor);
|
|
37
|
-
},
|
|
38
|
-
start(args) {
|
|
39
|
-
arg_1.app.start(args);
|
|
40
|
-
},
|
|
41
|
-
};
|
package/dist/lib/colors.d.ts
DELETED
package/dist/lib/colors.js
DELETED
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
-
if (k2 === undefined) k2 = k;
|
|
4
|
-
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
-
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
-
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
-
}
|
|
8
|
-
Object.defineProperty(o, k2, desc);
|
|
9
|
-
}) : (function(o, m, k, k2) {
|
|
10
|
-
if (k2 === undefined) k2 = k;
|
|
11
|
-
o[k2] = m[k];
|
|
12
|
-
}));
|
|
13
|
-
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
-
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
-
}) : function(o, v) {
|
|
16
|
-
o["default"] = v;
|
|
17
|
-
});
|
|
18
|
-
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
-
if (mod && mod.__esModule) return mod;
|
|
20
|
-
var result = {};
|
|
21
|
-
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
-
__setModuleDefault(result, mod);
|
|
23
|
-
return result;
|
|
24
|
-
};
|
|
25
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
26
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
27
|
-
};
|
|
28
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
const ansi_colors_1 = __importDefault(require("ansi-colors"));
|
|
30
|
-
const cjs = __importStar(require("ansi-colors"));
|
|
31
|
-
const currentModule_1 = __importDefault(require("./currentModule"));
|
|
32
|
-
exports.default = currentModule_1.default.isCJS ? cjs : ansi_colors_1.default;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
// @ts-nocheck
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
let currentModule;
|
|
5
|
-
try {
|
|
6
|
-
currentModule = module;
|
|
7
|
-
currentModule = exports;
|
|
8
|
-
currentModule = 'cjs';
|
|
9
|
-
}
|
|
10
|
-
catch (_a) {
|
|
11
|
-
currentModule = 'mjs';
|
|
12
|
-
}
|
|
13
|
-
if (!currentModule) {
|
|
14
|
-
throw new Error('Unkown module System');
|
|
15
|
-
}
|
|
16
|
-
exports.default = {
|
|
17
|
-
isCJS: currentModule === 'cjs',
|
|
18
|
-
isESM: currentModule === 'mjs',
|
|
19
|
-
};
|
package/dist/local-env.d.ts
DELETED
package/dist/local-env.js
DELETED
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.setRuntime = setRuntime;
|
|
4
|
-
exports.getRuntime = getRuntime;
|
|
5
|
-
let RUNTIME = 'run';
|
|
6
|
-
function setRuntime(runtime) {
|
|
7
|
-
RUNTIME = runtime;
|
|
8
|
-
}
|
|
9
|
-
function getRuntime() {
|
|
10
|
-
return RUNTIME;
|
|
11
|
-
}
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
-
});
|
|
10
|
-
};
|
|
11
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
12
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
13
|
-
};
|
|
14
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
15
|
-
exports.default = default_1;
|
|
16
|
-
const os_1 = __importDefault(require("../helpers/os"));
|
|
17
|
-
const colors_1 = __importDefault(require("../lib/colors"));
|
|
18
|
-
const confirm_1 = __importDefault(require("@inquirer/confirm"));
|
|
19
|
-
const cross_spawn_1 = require("cross-spawn");
|
|
20
|
-
function isBinaryInstalled(bin) {
|
|
21
|
-
const result = (0, cross_spawn_1.sync)(os_1.default.isWindows ? 'where' : 'which', [bin], {
|
|
22
|
-
stdio: 'ignore',
|
|
23
|
-
});
|
|
24
|
-
return result.status === 0;
|
|
25
|
-
}
|
|
26
|
-
function default_1(runtime) {
|
|
27
|
-
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
var _a, _b, _c, _d, _e, _f;
|
|
29
|
-
if (!((_a = runtime.install) === null || _a === void 0 ? void 0 : _a.length) && !((_b = runtime.installHints) === null || _b === void 0 ? void 0 : _b.length))
|
|
30
|
-
return true;
|
|
31
|
-
const command = (_d = (_c = runtime.compile) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : runtime.exec[0];
|
|
32
|
-
if (!command)
|
|
33
|
-
return true;
|
|
34
|
-
const isInstalled = isBinaryInstalled(command);
|
|
35
|
-
if (isInstalled)
|
|
36
|
-
return true;
|
|
37
|
-
console.error(colors_1.default.yellow(command) + colors_1.default.red(' is not installed.'));
|
|
38
|
-
if ((_e = runtime.install) === null || _e === void 0 ? void 0 : _e.length) {
|
|
39
|
-
const ans = yield (0, confirm_1.default)({ message: 'Do you want to install it?' });
|
|
40
|
-
process.stdin.setRawMode(false);
|
|
41
|
-
if (ans) {
|
|
42
|
-
const [installCmd, ...installArgs] = runtime.install;
|
|
43
|
-
const result = (0, cross_spawn_1.sync)(installCmd, installArgs, { stdio: 'inherit' });
|
|
44
|
-
if (result.status === 0) {
|
|
45
|
-
process.stdin.resume();
|
|
46
|
-
return true;
|
|
47
|
-
}
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
if ((_f = runtime.installHints) === null || _f === void 0 ? void 0 : _f.length) {
|
|
51
|
-
console.log(colors_1.default.bold('How to install:'));
|
|
52
|
-
runtime.installHints.forEach((hint) => console.log(hint));
|
|
53
|
-
}
|
|
54
|
-
return false;
|
|
55
|
-
});
|
|
56
|
-
}
|
|
@@ -1,22 +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
|
-
exports.getOutputFileName = getOutputFileName;
|
|
7
|
-
exports.getCacheDir = getCacheDir;
|
|
8
|
-
exports.cleanCacheDir = cleanCacheDir;
|
|
9
|
-
const path_1 = __importDefault(require("path"));
|
|
10
|
-
const utils_1 = require("../helpers/utils");
|
|
11
|
-
const cacheDir = path_1.default.join(__dirname, '../../.cache');
|
|
12
|
-
function getOutputFileName(slug) {
|
|
13
|
-
const ext = process.platform === 'win32' ? '.exe' : '';
|
|
14
|
-
const dir = (0, utils_1.emptyDir)(cacheDir, slug + '-' + `${process.pid}-${process.ppid}`);
|
|
15
|
-
return path_1.default.join(dir, 'output' + ext);
|
|
16
|
-
}
|
|
17
|
-
function getCacheDir() {
|
|
18
|
-
return cacheDir;
|
|
19
|
-
}
|
|
20
|
-
function cleanCacheDir() {
|
|
21
|
-
(0, utils_1.emptyDir)(cacheDir);
|
|
22
|
-
}
|
|
@@ -1,313 +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 path_1 = __importDefault(require("path"));
|
|
7
|
-
const as_1 = __importDefault(require("../helpers/as"));
|
|
8
|
-
const os_1 = __importDefault(require("../helpers/os"));
|
|
9
|
-
const helpers_1 = require("./helpers");
|
|
10
|
-
exports.default = (0, as_1.default)([
|
|
11
|
-
{
|
|
12
|
-
name: 'JavaScript',
|
|
13
|
-
exts: ['js', 'javascript', 'jsx', 'cjs', 'cjsx', 'mjs', 'mjsx'],
|
|
14
|
-
getRuntime(args, options, config) {
|
|
15
|
-
const runtimeOptions = {};
|
|
16
|
-
const runtime = config['javascript-runtime'] || 'node';
|
|
17
|
-
switch (runtime) {
|
|
18
|
-
case 'node':
|
|
19
|
-
runtimeOptions.installHints = [
|
|
20
|
-
'Please install Node.js from https://nodejs.org',
|
|
21
|
-
];
|
|
22
|
-
break;
|
|
23
|
-
case 'deno':
|
|
24
|
-
if (os_1.default.isWindows) {
|
|
25
|
-
runtimeOptions.install = [
|
|
26
|
-
'powershell',
|
|
27
|
-
'-c',
|
|
28
|
-
'irm https://deno.land/install.ps1 | iex',
|
|
29
|
-
];
|
|
30
|
-
}
|
|
31
|
-
else if (os_1.default.isUnix) {
|
|
32
|
-
runtimeOptions.install = [
|
|
33
|
-
'bash',
|
|
34
|
-
'-c',
|
|
35
|
-
'curl -fsSL https://deno.land/install.sh | bash',
|
|
36
|
-
];
|
|
37
|
-
}
|
|
38
|
-
runtimeOptions.installHints = [
|
|
39
|
-
'Please install Deno from https://deno.land',
|
|
40
|
-
];
|
|
41
|
-
break;
|
|
42
|
-
case 'bun':
|
|
43
|
-
if (os_1.default.isWindows) {
|
|
44
|
-
runtimeOptions.install = [
|
|
45
|
-
'powershell',
|
|
46
|
-
'-c',
|
|
47
|
-
'irm bun.sh/install.ps1 | iex',
|
|
48
|
-
];
|
|
49
|
-
}
|
|
50
|
-
else if (os_1.default.isUnix) {
|
|
51
|
-
runtimeOptions.install = [
|
|
52
|
-
'bash',
|
|
53
|
-
'-c',
|
|
54
|
-
'curl -fsSL https://bun.sh/install | bash',
|
|
55
|
-
];
|
|
56
|
-
}
|
|
57
|
-
runtimeOptions.installHints = [
|
|
58
|
-
'Please install Bun from https://bun.sh',
|
|
59
|
-
];
|
|
60
|
-
break;
|
|
61
|
-
}
|
|
62
|
-
return Object.assign(Object.assign({}, runtimeOptions), { exec: [runtime, ...args] });
|
|
63
|
-
},
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
name: 'TypeScript',
|
|
67
|
-
exts: ['ts', 'tsx', 'cts', 'ctsx', 'mts', 'mtsx'],
|
|
68
|
-
getRuntime(args, options, config) {
|
|
69
|
-
const runtimeOptions = {};
|
|
70
|
-
const runtime = config['typescript-runtime'] || 'tsx';
|
|
71
|
-
switch (runtime) {
|
|
72
|
-
case 'tsx':
|
|
73
|
-
runtimeOptions.install = ['npm', 'install', '-g', 'tsx'];
|
|
74
|
-
runtimeOptions.installHints = [
|
|
75
|
-
'Please install tsx from https://tsx.is',
|
|
76
|
-
];
|
|
77
|
-
break;
|
|
78
|
-
case 'ts-node':
|
|
79
|
-
runtimeOptions.install = ['npm', 'install', '-g', 'ts-node'];
|
|
80
|
-
runtimeOptions.installHints = [
|
|
81
|
-
'Please install ts-node from https://www.npmjs.com/package/ts-node',
|
|
82
|
-
];
|
|
83
|
-
break;
|
|
84
|
-
case 'deno':
|
|
85
|
-
if (os_1.default.isWindows) {
|
|
86
|
-
runtimeOptions.install = [
|
|
87
|
-
'powershell',
|
|
88
|
-
'-c',
|
|
89
|
-
'irm https://deno.land/install.ps1 | iex',
|
|
90
|
-
];
|
|
91
|
-
}
|
|
92
|
-
else if (os_1.default.isUnix) {
|
|
93
|
-
runtimeOptions.install = [
|
|
94
|
-
'bash',
|
|
95
|
-
'-c',
|
|
96
|
-
'curl -fsSL https://deno.land/install.sh | bash',
|
|
97
|
-
];
|
|
98
|
-
}
|
|
99
|
-
runtimeOptions.installHints = [
|
|
100
|
-
'Please install Deno from https://deno.land',
|
|
101
|
-
];
|
|
102
|
-
break;
|
|
103
|
-
case 'bun':
|
|
104
|
-
if (os_1.default.isWindows) {
|
|
105
|
-
runtimeOptions.install = [
|
|
106
|
-
'powershell',
|
|
107
|
-
'-c',
|
|
108
|
-
'irm bun.sh/install.ps1 | iex',
|
|
109
|
-
];
|
|
110
|
-
}
|
|
111
|
-
else if (os_1.default.isUnix) {
|
|
112
|
-
runtimeOptions.install = [
|
|
113
|
-
'bash',
|
|
114
|
-
'-c',
|
|
115
|
-
'curl -fsSL https://bun.sh/install | bash',
|
|
116
|
-
];
|
|
117
|
-
}
|
|
118
|
-
runtimeOptions.installHints = [
|
|
119
|
-
'Please install Bun from https://bun.sh',
|
|
120
|
-
];
|
|
121
|
-
break;
|
|
122
|
-
}
|
|
123
|
-
return Object.assign(Object.assign({}, runtimeOptions), { exec: [runtime, ...args], watchExts: ['js', 'javascript', 'jsx', 'cjs', 'cjsx', 'mjs', 'mjsx'] });
|
|
124
|
-
},
|
|
125
|
-
},
|
|
126
|
-
{
|
|
127
|
-
name: 'Python',
|
|
128
|
-
exts: ['py'],
|
|
129
|
-
getRuntime(args, options, config) {
|
|
130
|
-
return {
|
|
131
|
-
exec: ['python', ...args],
|
|
132
|
-
installHints: ['Please install Python from https://www.python.org'],
|
|
133
|
-
};
|
|
134
|
-
},
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
name: 'Java',
|
|
138
|
-
exts: ['java'],
|
|
139
|
-
getRuntime(args, options, config) {
|
|
140
|
-
return {
|
|
141
|
-
exec: ['java', ...args],
|
|
142
|
-
installHints: ['Please install Java from https://www.oracle.com/java'],
|
|
143
|
-
};
|
|
144
|
-
},
|
|
145
|
-
},
|
|
146
|
-
{
|
|
147
|
-
name: 'Dart',
|
|
148
|
-
exts: ['dart'],
|
|
149
|
-
getRuntime(args, options, config) {
|
|
150
|
-
return {
|
|
151
|
-
exec: ['dartvm', ...args],
|
|
152
|
-
installHints: ['Please install Dart from https://dart.dev'],
|
|
153
|
-
};
|
|
154
|
-
},
|
|
155
|
-
},
|
|
156
|
-
{
|
|
157
|
-
name: 'Powershell',
|
|
158
|
-
exts: ['ps1'],
|
|
159
|
-
getRuntime(args, options, config) {
|
|
160
|
-
return {
|
|
161
|
-
exec: ['powershell', '-File', ...args],
|
|
162
|
-
installHints: [
|
|
163
|
-
'Please install Powershell from https://docs.microsoft.com/en-us/powershell/scripting/install/installing-powershell',
|
|
164
|
-
],
|
|
165
|
-
};
|
|
166
|
-
},
|
|
167
|
-
},
|
|
168
|
-
{
|
|
169
|
-
name: 'Command Prompt',
|
|
170
|
-
exts: ['cmd', 'bat'],
|
|
171
|
-
getRuntime(args, options, config) {
|
|
172
|
-
return {
|
|
173
|
-
exec: ['cmd', '/c', ...args],
|
|
174
|
-
installHints: ['Please install Command Prompt from Windows'],
|
|
175
|
-
};
|
|
176
|
-
},
|
|
177
|
-
},
|
|
178
|
-
{
|
|
179
|
-
name: 'Shell Script',
|
|
180
|
-
exts: ['sh'],
|
|
181
|
-
getRuntime(args, options, config) {
|
|
182
|
-
return {
|
|
183
|
-
exec: ['bash', ...args],
|
|
184
|
-
installHints: [
|
|
185
|
-
'Please install Bash from https://www.gnu.org/software/bash',
|
|
186
|
-
],
|
|
187
|
-
};
|
|
188
|
-
},
|
|
189
|
-
},
|
|
190
|
-
{
|
|
191
|
-
name: 'Fish Shell Script',
|
|
192
|
-
exts: ['fish'],
|
|
193
|
-
getRuntime(args, options, config) {
|
|
194
|
-
return {
|
|
195
|
-
exec: ['fish', ...args],
|
|
196
|
-
installHints: ['Please install Fish from https://fishshell.com'],
|
|
197
|
-
};
|
|
198
|
-
},
|
|
199
|
-
},
|
|
200
|
-
{
|
|
201
|
-
name: 'Lua',
|
|
202
|
-
exts: ['lua'],
|
|
203
|
-
getRuntime(args, options, config) {
|
|
204
|
-
return {
|
|
205
|
-
exec: ['lua', ...args],
|
|
206
|
-
installHints: ['Please install Lua from https://www.lua.org'],
|
|
207
|
-
};
|
|
208
|
-
},
|
|
209
|
-
},
|
|
210
|
-
{
|
|
211
|
-
name: 'Ruby',
|
|
212
|
-
exts: ['rb'],
|
|
213
|
-
getRuntime(args, options, config) {
|
|
214
|
-
return {
|
|
215
|
-
exec: ['ruby', ...args],
|
|
216
|
-
installHints: ['Please install Ruby from https://www.ruby-lang.org'],
|
|
217
|
-
};
|
|
218
|
-
},
|
|
219
|
-
},
|
|
220
|
-
{
|
|
221
|
-
name: 'Go',
|
|
222
|
-
exts: ['go'],
|
|
223
|
-
getRuntime(args, options, config) {
|
|
224
|
-
return {
|
|
225
|
-
exec: ['go', 'run', ...args],
|
|
226
|
-
installHints: ['Please install Ruby from https://www.ruby-lang.org'],
|
|
227
|
-
};
|
|
228
|
-
},
|
|
229
|
-
},
|
|
230
|
-
{
|
|
231
|
-
name: 'C - GCC',
|
|
232
|
-
exts: ['c'],
|
|
233
|
-
getRuntime([script, ...args], options, config) {
|
|
234
|
-
const output = (0, helpers_1.getOutputFileName)('/c-gcc');
|
|
235
|
-
return {
|
|
236
|
-
compile: ['gcc', script, '-o', output],
|
|
237
|
-
exec: [output, ...args],
|
|
238
|
-
installHints: ['Please install GCC from https://gcc.gnu.org'],
|
|
239
|
-
};
|
|
240
|
-
},
|
|
241
|
-
},
|
|
242
|
-
{
|
|
243
|
-
name: 'C++ - GCC',
|
|
244
|
-
exts: ['cpp'],
|
|
245
|
-
getRuntime([script, ...args], options, config) {
|
|
246
|
-
const output = (0, helpers_1.getOutputFileName)('/cpp-gcc');
|
|
247
|
-
return {
|
|
248
|
-
compile: ['g++', script, '-o', output],
|
|
249
|
-
exec: [output, ...args],
|
|
250
|
-
installHints: ['Please install GCC from https://gcc.gnu.org'],
|
|
251
|
-
};
|
|
252
|
-
},
|
|
253
|
-
},
|
|
254
|
-
{
|
|
255
|
-
name: 'C# - Mono (Windows)',
|
|
256
|
-
exts: ['cs'],
|
|
257
|
-
getRuntime([script, ...args], options, config) {
|
|
258
|
-
const output = (0, helpers_1.getOutputFileName)('/cs-mono');
|
|
259
|
-
return {
|
|
260
|
-
compile: ['mcs', '-out:' + output, script],
|
|
261
|
-
exec: [output, ...args],
|
|
262
|
-
installHints: ['Please install Mono from https://www.mono-project.com'],
|
|
263
|
-
};
|
|
264
|
-
},
|
|
265
|
-
},
|
|
266
|
-
{
|
|
267
|
-
name: 'Rust - rustc',
|
|
268
|
-
exts: ['rs'],
|
|
269
|
-
getRuntime([script, ...args], options, config) {
|
|
270
|
-
const output = (0, helpers_1.getOutputFileName)('/rust-rustc');
|
|
271
|
-
return {
|
|
272
|
-
compile: ['rustc', script, '-o', output],
|
|
273
|
-
exec: [output, ...args],
|
|
274
|
-
installHints: ['Please install Rust from https://www.rust-lang.org'],
|
|
275
|
-
};
|
|
276
|
-
},
|
|
277
|
-
},
|
|
278
|
-
{
|
|
279
|
-
name: 'SASS (CSS)',
|
|
280
|
-
exts: ['sass', 'scss'],
|
|
281
|
-
getRuntime(args, options, config) {
|
|
282
|
-
return {
|
|
283
|
-
exec: ['sass', ...args],
|
|
284
|
-
install: ['npm', 'install', '-g', 'sass'],
|
|
285
|
-
installHints: ['Please install SASS from https://sass-lang.com'],
|
|
286
|
-
};
|
|
287
|
-
},
|
|
288
|
-
},
|
|
289
|
-
{
|
|
290
|
-
name: 'PHP',
|
|
291
|
-
exts: ['php'],
|
|
292
|
-
getRuntime(args, options, config) {
|
|
293
|
-
return {
|
|
294
|
-
exec: ['php', ...args],
|
|
295
|
-
installHints: ['Please install PHP from https://www.php.net'],
|
|
296
|
-
};
|
|
297
|
-
},
|
|
298
|
-
},
|
|
299
|
-
{
|
|
300
|
-
name: 'HTML Server',
|
|
301
|
-
exts: ['html', 'htm'],
|
|
302
|
-
getRuntime([script, ...args], options, config) {
|
|
303
|
-
return {
|
|
304
|
-
exec: ['live-server', path_1.default.dirname(script), ...args],
|
|
305
|
-
watchExts: ['css', 'js', 'javascript'],
|
|
306
|
-
install: ['npm', 'install', '-g', 'live-server'],
|
|
307
|
-
installHints: [
|
|
308
|
-
'Please install live-server from https://www.npmjs.com/package/live-server',
|
|
309
|
-
],
|
|
310
|
-
};
|
|
311
|
-
},
|
|
312
|
-
},
|
|
313
|
-
]);
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { ExecuteOptions } from '../argHelper';
|
|
2
|
-
export type ExecutorConfig = Partial<{
|
|
3
|
-
'javascript-runtime': string;
|
|
4
|
-
'typescript-runtime': string;
|
|
5
|
-
}>;
|
|
6
|
-
export type RuntimeOptions = {
|
|
7
|
-
exec: string[];
|
|
8
|
-
compile?: string[];
|
|
9
|
-
watchExts?: string[];
|
|
10
|
-
install?: string[];
|
|
11
|
-
installHints?: string[];
|
|
12
|
-
};
|
|
13
|
-
export type ScriptExecutorOptions = {
|
|
14
|
-
name: string;
|
|
15
|
-
exts: string[];
|
|
16
|
-
getRuntime(args: string[], options: Omit<ExecuteOptions, 'watchExtensions'>, config: ExecutorConfig): RuntimeOptions;
|
|
17
|
-
};
|