uni-run 1.1.19 → 1.1.21
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/dist/arg.d.ts
CHANGED
|
@@ -34,8 +34,7 @@ export declare const app: NoArg<"uni-run", {
|
|
|
34
34
|
aliases: ["drs"];
|
|
35
35
|
description: "Disable raw mode for stdin. Do not needed with `--disable-reload-key`";
|
|
36
36
|
}>;
|
|
37
|
-
readonly
|
|
38
|
-
aliases: ["q"];
|
|
37
|
+
readonly exit: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
|
|
39
38
|
description: "Do not watch the script. Just run it once and exit";
|
|
40
39
|
}>;
|
|
41
40
|
readonly silent: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
|
|
@@ -132,8 +131,7 @@ export declare const exec: import("noarg/dist/NoArg/NoArgProgram.cjs").NoArgProg
|
|
|
132
131
|
aliases: ["drs"];
|
|
133
132
|
description: "Disable raw mode for stdin. Do not needed with `--disable-reload-key`";
|
|
134
133
|
}>;
|
|
135
|
-
readonly
|
|
136
|
-
aliases: ["q"];
|
|
134
|
+
readonly exit: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
|
|
137
135
|
description: "Do not watch the script. Just run it once and exit";
|
|
138
136
|
}>;
|
|
139
137
|
readonly silent: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
|
package/dist/argHelper.d.ts
CHANGED
|
@@ -14,8 +14,7 @@ export declare const executionConfig: {
|
|
|
14
14
|
aliases: ["drs"];
|
|
15
15
|
description: "Disable raw mode for stdin. Do not needed with `--disable-reload-key`";
|
|
16
16
|
}>;
|
|
17
|
-
readonly
|
|
18
|
-
aliases: ["q"];
|
|
17
|
+
readonly exit: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
|
|
19
18
|
description: "Do not watch the script. Just run it once and exit";
|
|
20
19
|
}>;
|
|
21
20
|
readonly silent: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
|
package/dist/argHelper.js
CHANGED
|
@@ -17,9 +17,7 @@ exports.executionConfig = noarg_1.default.defineConfig({
|
|
|
17
17
|
'disable-raw-stdin': noarg_1.default.boolean()
|
|
18
18
|
.aliases('drs')
|
|
19
19
|
.description('Disable raw mode for stdin. Do not needed with `--disable-reload-key`'),
|
|
20
|
-
|
|
21
|
-
.aliases('q')
|
|
22
|
-
.description('Do not watch the script. Just run it once and exit'),
|
|
20
|
+
exit: noarg_1.default.boolean().description('Do not watch the script. Just run it once and exit'),
|
|
23
21
|
silent: noarg_1.default.boolean()
|
|
24
22
|
.aliases('s')
|
|
25
23
|
.description('Do not show any output of the script'),
|
|
@@ -67,9 +65,9 @@ exports.executionConfig = noarg_1.default.defineConfig({
|
|
|
67
65
|
});
|
|
68
66
|
function mapFlagsToOptions(flags) {
|
|
69
67
|
var _a, _b, _c, _d, _e;
|
|
70
|
-
if (flags.
|
|
71
|
-
flags['disable-reload-key'] = true;
|
|
68
|
+
if (flags.exit) {
|
|
72
69
|
flags['do-not-watch'] = true;
|
|
70
|
+
flags['disable-reload-key'] = true;
|
|
73
71
|
}
|
|
74
72
|
return {
|
|
75
73
|
cwd: flags.cwd,
|
|
@@ -25,17 +25,17 @@ function isBinaryInstalled(bin) {
|
|
|
25
25
|
}
|
|
26
26
|
function default_1(runtime) {
|
|
27
27
|
return __awaiter(this, void 0, void 0, function* () {
|
|
28
|
-
var _a, _b, _c, _d;
|
|
28
|
+
var _a, _b, _c, _d, _e, _f;
|
|
29
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
30
|
return true;
|
|
31
|
-
const command = runtime.exec[0];
|
|
31
|
+
const command = (_d = (_c = runtime.compile) === null || _c === void 0 ? void 0 : _c[0]) !== null && _d !== void 0 ? _d : runtime.exec[0];
|
|
32
32
|
if (!command)
|
|
33
33
|
return true;
|
|
34
34
|
const isInstalled = isBinaryInstalled(command);
|
|
35
35
|
if (isInstalled)
|
|
36
36
|
return true;
|
|
37
37
|
console.error(colors_1.default.yellow(command) + colors_1.default.red(' is not installed.'));
|
|
38
|
-
if ((
|
|
38
|
+
if ((_e = runtime.install) === null || _e === void 0 ? void 0 : _e.length) {
|
|
39
39
|
const ans = yield (0, confirm_1.default)({ message: 'Do you want to install it?' });
|
|
40
40
|
process.stdin.setRawMode(false);
|
|
41
41
|
if (ans) {
|
|
@@ -47,7 +47,7 @@ function default_1(runtime) {
|
|
|
47
47
|
}
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
|
-
if ((
|
|
50
|
+
if ((_f = runtime.installHints) === null || _f === void 0 ? void 0 : _f.length) {
|
|
51
51
|
console.log(colors_1.default.bold('How to install:'));
|
|
52
52
|
runtime.installHints.forEach((hint) => console.log(hint));
|
|
53
53
|
}
|
|
@@ -3,6 +3,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
const path_1 = __importDefault(require("path"));
|
|
6
7
|
const as_1 = __importDefault(require("../helpers/as"));
|
|
7
8
|
const os_1 = __importDefault(require("../helpers/os"));
|
|
8
9
|
const helpers_1 = require("./helpers");
|
|
@@ -290,11 +291,11 @@ exports.default = (0, as_1.default)([
|
|
|
290
291
|
exts: ['html', 'htm'],
|
|
291
292
|
getRuntime([script, ...args], options, config) {
|
|
292
293
|
return {
|
|
293
|
-
exec: ['
|
|
294
|
+
exec: ['live-server', path_1.default.dirname(script), ...args],
|
|
294
295
|
watchExts: ['css', 'js', 'javascript'],
|
|
295
|
-
install: ['npm', 'install', '-g', '
|
|
296
|
+
install: ['npm', 'install', '-g', 'live-server'],
|
|
296
297
|
installHints: [
|
|
297
|
-
'Please install
|
|
298
|
+
'Please install live-server from https://www.npmjs.com/package/live-server',
|
|
298
299
|
],
|
|
299
300
|
};
|
|
300
301
|
},
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "uni-run",
|
|
3
|
-
"version": "1.1.
|
|
3
|
+
"version": "1.1.21",
|
|
4
4
|
"description": "Universal Runner for many language",
|
|
5
5
|
"type": "commonjs",
|
|
6
6
|
"scripts": {
|
|
@@ -18,6 +18,7 @@
|
|
|
18
18
|
"uni-run": "./dist/bin.js"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
+
"@inquirer/confirm": "^5.1.19",
|
|
21
22
|
"@inquirer/prompts": "^6.0.1",
|
|
22
23
|
"ansi-colors": "^4.1.3",
|
|
23
24
|
"chokidar": "^4.0.1",
|