uni-run 1.1.25 → 2.0.1

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 (51) hide show
  1. package/README.md +100 -149
  2. package/dist/app-BZaoTGMC.mjs +31079 -0
  3. package/dist/run.mjs +28 -0
  4. package/dist/rux.mjs +5 -0
  5. package/package.json +71 -28
  6. package/dist/app.d.ts +0 -1
  7. package/dist/app.js +0 -97
  8. package/dist/arg.d.ts +0 -229
  9. package/dist/arg.js +0 -18
  10. package/dist/argHelper.d.ts +0 -108
  11. package/dist/argHelper.js +0 -94
  12. package/dist/bin.d.ts +0 -2
  13. package/dist/bin.js +0 -6
  14. package/dist/bix.d.ts +0 -2
  15. package/dist/bix.js +0 -8
  16. package/dist/execution/gitignore.d.ts +0 -1
  17. package/dist/execution/gitignore.js +0 -40
  18. package/dist/execution/index.d.ts +0 -21
  19. package/dist/execution/index.js +0 -177
  20. package/dist/execution/kill-process.d.ts +0 -2
  21. package/dist/execution/kill-process.js +0 -50
  22. package/dist/execution/watcher.d.ts +0 -6
  23. package/dist/execution/watcher.js +0 -60
  24. package/dist/helpers/as.d.ts +0 -1
  25. package/dist/helpers/as.js +0 -6
  26. package/dist/helpers/debounce.d.ts +0 -1
  27. package/dist/helpers/debounce.js +0 -10
  28. package/dist/helpers/getConfig.d.ts +0 -1
  29. package/dist/helpers/getConfig.js +0 -26
  30. package/dist/helpers/getUserExecutors.d.ts +0 -2
  31. package/dist/helpers/getUserExecutors.js +0 -18
  32. package/dist/helpers/os.d.ts +0 -7
  33. package/dist/helpers/os.js +0 -8
  34. package/dist/helpers/utils.d.ts +0 -3
  35. package/dist/helpers/utils.js +0 -28
  36. package/dist/index.d.ts +0 -13
  37. package/dist/index.js +0 -41
  38. package/dist/lib/colors.d.ts +0 -3
  39. package/dist/lib/colors.js +0 -32
  40. package/dist/lib/currentModule.d.ts +0 -5
  41. package/dist/lib/currentModule.js +0 -19
  42. package/dist/local-env.d.ts +0 -4
  43. package/dist/local-env.js +0 -11
  44. package/dist/scriptExecutors/checkRuntime.d.ts +0 -2
  45. package/dist/scriptExecutors/checkRuntime.js +0 -56
  46. package/dist/scriptExecutors/helpers.d.ts +0 -3
  47. package/dist/scriptExecutors/helpers.js +0 -22
  48. package/dist/scriptExecutors/index.d.ts +0 -3
  49. package/dist/scriptExecutors/index.js +0 -313
  50. package/dist/scriptExecutors/types.t.d.ts +0 -17
  51. package/dist/scriptExecutors/types.t.js +0 -2
package/dist/run.mjs ADDED
@@ -0,0 +1,28 @@
1
+ #!/usr/bin/env node
2
+ import { a as resolveSharedConfigOptions, c as TEMP_DIR, d as init_objectSpread2, i as appExecutionConfig, l as source_default, n as defaultRuntimes, o as _asyncToGenerator, r as Execution, s as init_asyncToGenerator, t as app, u as _objectSpread2 } from "./app-BZaoTGMC.mjs";
3
+ import fs from "fs";
4
+ init_objectSpread2();
5
+ init_asyncToGenerator();
6
+ const exec = app.create("exec", _objectSpread2(_objectSpread2({}, appExecutionConfig), {}, { description: "Execute a script with the given binary" }));
7
+ const clean = app.create("clean", { description: "Clean cache directory" });
8
+ const list = app.create("list", { description: "List supported scripts" });
9
+ exec.on(function() {
10
+ var _ref = _asyncToGenerator(function* ([listArs, trailingArgs], flags) {
11
+ yield new Execution(_objectSpread2(_objectSpread2({}, resolveSharedConfigOptions(flags)), {}, { startArgs: [...listArs, ...trailingArgs] })).start();
12
+ });
13
+ return function(_x, _x2) {
14
+ return _ref.apply(this, arguments);
15
+ };
16
+ }());
17
+ clean.on(_asyncToGenerator(function* () {
18
+ if (fs.existsSync(TEMP_DIR)) fs.rmSync(TEMP_DIR, { recursive: true });
19
+ console.log(source_default.green("Cache directory cleaned:"), TEMP_DIR);
20
+ }));
21
+ list.on(_asyncToGenerator(function* () {
22
+ console.log(source_default.bold("Built-in scripts:"));
23
+ defaultRuntimes.forEach((runtime) => {
24
+ console.log(`- ${source_default.cyan(runtime.name)}`, `[${runtime.extensions.map((e) => "." + source_default.green(e)).join(", ")}]`);
25
+ });
26
+ }));
27
+ app.start(process.argv.slice(2));
28
+ export {};
package/dist/rux.mjs ADDED
@@ -0,0 +1,5 @@
1
+ #!/usr/bin/env node
2
+ import { f as setSystemRuntime, t as app } from "./app-BZaoTGMC.mjs";
3
+ setSystemRuntime("rux");
4
+ app.start(process.argv.slice(2));
5
+ export {};
package/package.json CHANGED
@@ -1,40 +1,83 @@
1
1
  {
2
2
  "name": "uni-run",
3
- "version": "1.1.25",
4
- "description": "Universal Runner for many language",
5
- "type": "commonjs",
3
+ "version": "2.0.1",
6
4
  "scripts": {
7
- "build": "tsc",
8
- "dev": "tsc --watch",
9
- "tsc": "tsc --watch --noEmit",
10
- "live": "node ./dist/__lab__/index.js",
11
- "tsx": "tsx ./src/__lab__/index.ts",
12
- "tsxw": "tsx --watch ./src/__lab__/index.ts",
13
- "lab": "run ./src/__lab__/index.ts --focus ./src -- UNI_RUN_LAB_MODE"
5
+ "test": "vitest run",
6
+ "test:watch": "vitest",
7
+ "lint:fix": "eslint . --fix",
8
+ "lint:tc": "tsc --noEmit --watch",
9
+ "lint": "tsc --noEmit && eslint .",
10
+ "build": "tsdown --config ./tsdown.config.ts",
11
+ "dev": "concurrently --names \"R,T\" --prefix-colors \"blue.dim,magenta.dim\" \"tsdown --config ./tsdown.config.ts --watch\" \"tsc --noEmit --watch\"",
12
+ "bin": "tsx ./src/bin.ts",
13
+ "start": "tsx --watch ./src/index.ts",
14
+ "json": "tsx ./src/json-schema.ts"
14
15
  },
15
- "main": "./dist/index.js",
16
16
  "bin": {
17
- "run": "./dist/bin.js",
18
- "rux": "./dist/bix.js",
19
- "uni-run": "./dist/bin.js",
20
- "uni-rux": "./dist/bix.js"
17
+ "run": "./dist/run.mjs",
18
+ "rux": "./dist/rux.mjs",
19
+ "uni-run": "./dist/run.mjs",
20
+ "uni-rux": "./dist/rux.mjs"
21
21
  },
22
- "dependencies": {
23
- "@inquirer/confirm": "^5.1.19",
24
- "@inquirer/prompts": "^6.0.1",
25
- "ansi-colors": "^4.1.3",
26
- "chokidar": "^4.0.1",
27
- "cross-spawn": "^7.0.3",
28
- "ignore": "^6.0.2",
29
- "noarg": "^3.1.8"
22
+ "typesVersions": {
23
+ "*": {
24
+ "bin": [
25
+ "./dist/bin.d.mts",
26
+ "./dist/bin.d.cts"
27
+ ],
28
+ ".": [
29
+ "./dist/index.d.mts",
30
+ "./dist/index.d.cts"
31
+ ]
32
+ }
30
33
  },
31
34
  "devDependencies": {
32
- "@types/cross-spawn": "^6.0.6",
33
- "@types/node": "^22.7.4",
34
- "typescript": "^5.6.2"
35
+ "@eslint/compat": "^1.4.1",
36
+ "@eslint/eslintrc": "^3.3.3",
37
+ "@eslint/js": "^9.39.3",
38
+ "@types/node": "^24.10.13",
39
+ "@typescript-eslint/eslint-plugin": "^8.56.1",
40
+ "@typescript-eslint/parser": "^8.56.1",
41
+ "chalk": "^5.6.2",
42
+ "chokidar": "^5.0.0",
43
+ "concurrently": "^9.2.1",
44
+ "eslint": "^9.39.3",
45
+ "eslint-config-prettier": "^10.1.8",
46
+ "eslint-plugin-check-file": "^3.3.1",
47
+ "eslint-plugin-import": "^2.32.0",
48
+ "eslint-plugin-prettier": "^5.5.5",
49
+ "husky": "^9.1.7",
50
+ "ignore": "^7.0.5",
51
+ "noarg": "^3.1.9",
52
+ "prettier": "^3.8.1",
53
+ "prettier-plugin-organize-imports": "^4.3.0",
54
+ "rolldown": "1.0.0-rc.5",
55
+ "tsdown": "^0.15.12",
56
+ "tslib": "^2.8.1",
57
+ "tsx": "^4.21.0",
58
+ "typescript": "^5.9.3",
59
+ "typescript-eslint": "^8.56.1",
60
+ "vitest": "^4.0.18",
61
+ "zod": "^4.3.6"
62
+ },
63
+ "author": {
64
+ "name": "Nazmus Sayad",
65
+ "url": "https://github.com/NazmusSayad"
66
+ },
67
+ "homepage": "https://github.com/NazmusSayad/uni-run",
68
+ "bugs": {
69
+ "url": "https://github.com/NazmusSayad/uni-run/issues"
35
70
  },
36
71
  "repository": {
37
72
  "type": "git",
38
- "url": "https://github.com/NazmusSayad/uni-run"
39
- }
73
+ "url": "https://github.com/NazmusSayad/uni-run.git"
74
+ },
75
+ "keywords": [
76
+ "run",
77
+ "runner",
78
+ "script",
79
+ "runner",
80
+ "cli"
81
+ ],
82
+ "license": "MIT"
40
83
  }
package/dist/app.d.ts DELETED
@@ -1 +0,0 @@
1
- export {};
package/dist/app.js DELETED
@@ -1,97 +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 __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
26
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
27
- return new (P || (P = Promise))(function (resolve, reject) {
28
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
29
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
30
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
31
- step((generator = generator.apply(thisArg, _arguments || [])).next());
32
- });
33
- };
34
- var __importDefault = (this && this.__importDefault) || function (mod) {
35
- return (mod && mod.__esModule) ? mod : { "default": mod };
36
- };
37
- Object.defineProperty(exports, "__esModule", { value: true });
38
- const arg = __importStar(require("./arg"));
39
- const colors_1 = __importDefault(require("./lib/colors"));
40
- const execution_1 = __importDefault(require("./execution"));
41
- const getConfig_1 = __importDefault(require("./helpers/getConfig"));
42
- const argHelper_1 = require("./argHelper");
43
- const scriptExecutors_1 = __importDefault(require("./scriptExecutors"));
44
- const checkRuntime_1 = __importDefault(require("./scriptExecutors/checkRuntime"));
45
- const getUserExecutors_1 = __importDefault(require("./helpers/getUserExecutors"));
46
- const helpers_1 = require("./scriptExecutors/helpers");
47
- const local_env_1 = require("./local-env");
48
- arg.app.on((_a, flags_1) => __awaiter(void 0, [_a, flags_1], void 0, function* ([script, listArs, trailingArgs], flags) {
49
- var _b, _c;
50
- if ((0, local_env_1.getRuntime)() === 'rux') {
51
- flags.exit = true;
52
- flags.keep = (_b = flags.keep) !== null && _b !== void 0 ? _b : true;
53
- }
54
- const executionConfig = (0, getConfig_1.default)(flags.cwd);
55
- const userExecutors = (0, getUserExecutors_1.default)(flags.cwd);
56
- const totalExecutors = [
57
- ...(Array.isArray(userExecutors) ? userExecutors : []),
58
- ...scriptExecutors_1.default,
59
- ];
60
- const scriptExecutor = totalExecutors.find((executor) => executor.exts.includes(script.split('.').pop()));
61
- if (!scriptExecutor) {
62
- console.error(colors_1.default.red('Unsupported script:'), colors_1.default.yellow(script));
63
- return console.log(colors_1.default.bgGreen('TIPS:'), 'You may try', colors_1.default.cyan(`run exec <YOUR_BIN> ${colors_1.default.yellow(script)}`));
64
- }
65
- const executionOptions = (0, argHelper_1.mapFlagsToOptions)(flags);
66
- const runtime = scriptExecutor.getRuntime([script, ...listArs, ...trailingArgs], executionOptions, executionConfig);
67
- if (!(yield (0, checkRuntime_1.default)(runtime)))
68
- return;
69
- const exec = new execution_1.default(Object.assign(Object.assign({}, executionOptions), { watchExtensions: executionOptions.watchExtensions.length
70
- ? executionOptions.watchExtensions
71
- : [...scriptExecutor.exts, ...((_c = runtime.watchExts) !== null && _c !== void 0 ? _c : [])] }), runtime.exec, runtime.compile);
72
- exec.start();
73
- }));
74
- arg.exec.on(([listArs, trailingArgs], flags) => {
75
- var _a;
76
- if ((0, local_env_1.getRuntime)() === 'rux') {
77
- flags.exit = true;
78
- flags.keep = (_a = flags.keep) !== null && _a !== void 0 ? _a : true;
79
- }
80
- new execution_1.default((0, argHelper_1.mapFlagsToOptions)(flags), [...listArs, ...trailingArgs]).start();
81
- });
82
- arg.list.on(() => {
83
- var _a;
84
- function printExecutorsFactory(clrFn, executors) {
85
- executors.forEach(({ name, exts }) => {
86
- console.log(`- ${clrFn(name)}`, `[${exts.map((e) => '.' + colors_1.default.green(e)).join(', ')}]`);
87
- });
88
- }
89
- console.log(colors_1.default.bold('Supported scripts:'));
90
- printExecutorsFactory(colors_1.default.cyan, (_a = (0, getUserExecutors_1.default)()) !== null && _a !== void 0 ? _a : []);
91
- printExecutorsFactory(colors_1.default.blue, scriptExecutors_1.default);
92
- });
93
- arg.clean.on(() => {
94
- console.log(colors_1.default.bgGreen('CACHE:'), (0, helpers_1.getCacheDir)());
95
- (0, helpers_1.cleanCacheDir)();
96
- console.log(colors_1.default.green('Cache directory cleaned.'));
97
- });
package/dist/arg.d.ts DELETED
@@ -1,229 +0,0 @@
1
- import NoArg from 'noarg';
2
- export declare const app: NoArg<"uni-run", {
3
- readonly allowEqualAssign: true;
4
- readonly allowDuplicateFlagForList: true;
5
- readonly booleanNotSyntaxEnding: "!";
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 'do-not-watch': import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
26
- aliases: ["dw"];
27
- description: "Watch for file changes and reload the script";
28
- }>;
29
- readonly 'disable-reload-key': import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
30
- aliases: ["dk"];
31
- description: "Disable 'Ctrl+R' or 'F5' to reload the script";
32
- }>;
33
- readonly 'disable-raw-stdin': import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
34
- aliases: ["drs"];
35
- description: "Disable raw mode for stdin. Do not needed with `--disable-reload-key`";
36
- }>;
37
- readonly exit: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
38
- description: "Do not watch the script. Just run it once and exit. Forced with `rux` or `uni-rux`";
39
- }>;
40
- readonly silent: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
41
- aliases: ["s"];
42
- description: "Do not show any output of the script";
43
- }>;
44
- readonly keep: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
45
- aliases: ["k"];
46
- description: "Do not clear the console while starting the script. Default with `rux` or `uni-rux`";
47
- }>;
48
- readonly ext: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
49
- aliases: ["e"];
50
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
51
- description: "Looks for changes only of the given extensions";
52
- }>;
53
- readonly focus: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
54
- aliases: ["f"];
55
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
56
- description: "Only watch the given items. `chokidar` syntax";
57
- }>;
58
- readonly ignore: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
59
- aliases: ["ig"];
60
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
61
- description: "Exclude the given items. `gitignore` syntax";
62
- }>;
63
- readonly delay: import("noarg/dist/schema/TypeNumber.cjs").TypeNumber<{
64
- aliases: ["d"];
65
- required: true;
66
- default: 100;
67
- description: "The delay to wait for the watcher to trigger";
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 cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
79
- required: true;
80
- default: string;
81
- description: "Set the current working directory";
82
- }>;
83
- readonly env: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
84
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
85
- description: "Set environment variables";
86
- }>;
87
- readonly 'node-dev': import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
88
- description: "Set env.NODE_ENV to \"development\"";
89
- }>;
90
- readonly shell: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
91
- description: "Run script in shell for low-level commands";
92
- }>;
93
- readonly info: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
94
- description: "Show information about the script";
95
- }>;
96
- readonly time: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
97
- description: "Show the execution time at the start";
98
- }>;
99
- };
100
- readonly customRenderHelp: {
101
- readonly helpUsageTrailingArgsLabel: "...[args/flags for script]";
102
- };
103
- }>;
104
- export declare const exec: import("noarg/dist/NoArg/NoArgProgram.cjs").NoArgProgram<"exec", {
105
- readonly allowEqualAssign: true;
106
- readonly allowDuplicateFlagForList: true;
107
- readonly booleanNotSyntaxEnding: "!";
108
- readonly splitListByComma: true;
109
- }, {
110
- readonly help: true;
111
- }, {
112
- readonly description: "Execute a script with the given binary";
113
- readonly arguments: [];
114
- readonly optionalArguments: [];
115
- readonly listArgument: {
116
- readonly name: "args for script";
117
- readonly description: "The arguments to pass to the script";
118
- readonly type: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
119
- };
120
- readonly trailingArguments: "--";
121
- readonly flags: {
122
- readonly 'do-not-watch': import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
123
- aliases: ["dw"];
124
- description: "Watch for file changes and reload the script";
125
- }>;
126
- readonly 'disable-reload-key': import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
127
- aliases: ["dk"];
128
- description: "Disable 'Ctrl+R' or 'F5' to reload the script";
129
- }>;
130
- readonly 'disable-raw-stdin': import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
131
- aliases: ["drs"];
132
- description: "Disable raw mode for stdin. Do not needed with `--disable-reload-key`";
133
- }>;
134
- readonly exit: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
135
- description: "Do not watch the script. Just run it once and exit. Forced with `rux` or `uni-rux`";
136
- }>;
137
- readonly silent: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
138
- aliases: ["s"];
139
- description: "Do not show any output of the script";
140
- }>;
141
- readonly keep: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
142
- aliases: ["k"];
143
- description: "Do not clear the console while starting the script. Default with `rux` or `uni-rux`";
144
- }>;
145
- readonly ext: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
146
- aliases: ["e"];
147
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
148
- description: "Looks for changes only of the given extensions";
149
- }>;
150
- readonly focus: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
151
- aliases: ["f"];
152
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
153
- description: "Only watch the given items. `chokidar` syntax";
154
- }>;
155
- readonly ignore: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
156
- aliases: ["ig"];
157
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
158
- description: "Exclude the given items. `gitignore` syntax";
159
- }>;
160
- readonly delay: import("noarg/dist/schema/TypeNumber.cjs").TypeNumber<{
161
- aliases: ["d"];
162
- required: true;
163
- default: 100;
164
- description: "The delay to wait for the watcher to trigger";
165
- }>;
166
- readonly bench: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
167
- aliases: ["b"];
168
- description: "Calculate the execution time";
169
- }>;
170
- readonly 'bench-prefix': import("noarg/dist/schema/TypeString.cjs").TypeString<{
171
- aliases: ["bp"];
172
- minLength: 1;
173
- description: "The prefix to show before the execution time";
174
- }>;
175
- readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
176
- required: true;
177
- default: string;
178
- description: "Set the current working directory";
179
- }>;
180
- readonly env: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
181
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
182
- description: "Set environment variables";
183
- }>;
184
- readonly 'node-dev': import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
185
- description: "Set env.NODE_ENV to \"development\"";
186
- }>;
187
- readonly shell: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
188
- description: "Run script in shell for low-level commands";
189
- }>;
190
- readonly info: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
191
- description: "Show information about the script";
192
- }>;
193
- readonly time: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
194
- description: "Show the execution time at the start";
195
- }>;
196
- };
197
- readonly customRenderHelp: {
198
- readonly helpUsageTrailingArgsLabel: "...[args/flags for script]";
199
- };
200
- globalFlags: {};
201
- }>;
202
- export declare const list: import("noarg/dist/NoArg/NoArgProgram.cjs").NoArgProgram<"list", {
203
- readonly allowEqualAssign: true;
204
- readonly allowDuplicateFlagForList: true;
205
- readonly booleanNotSyntaxEnding: "!";
206
- readonly splitListByComma: true;
207
- }, {
208
- readonly help: true;
209
- }, {
210
- readonly description: "List supported scripts";
211
- readonly arguments: [];
212
- readonly optionalArguments: [];
213
- readonly flags: {};
214
- globalFlags: {};
215
- }>;
216
- export declare const clean: import("noarg/dist/NoArg/NoArgProgram.cjs").NoArgProgram<"clean", {
217
- readonly allowEqualAssign: true;
218
- readonly allowDuplicateFlagForList: true;
219
- readonly booleanNotSyntaxEnding: "!";
220
- readonly splitListByComma: true;
221
- }, {
222
- readonly help: true;
223
- }, {
224
- readonly description: "Clean cache directory";
225
- readonly arguments: [];
226
- readonly optionalArguments: [];
227
- readonly flags: {};
228
- globalFlags: {};
229
- }>;
package/dist/arg.js DELETED
@@ -1,18 +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.clean = exports.list = exports.exec = exports.app = void 0;
7
- const noarg_1 = __importDefault(require("noarg"));
8
- const argHelper_1 = require("./argHelper");
9
- exports.app = noarg_1.default.create('uni-run', Object.assign(Object.assign({}, argHelper_1.executionConfig), { description: 'A universal runner for scripts', system: { splitListByComma: true }, arguments: [
10
- { name: 'script', type: noarg_1.default.string(), description: 'Run a script' },
11
- ] }));
12
- exports.exec = exports.app.create('exec', Object.assign(Object.assign({}, argHelper_1.executionConfig), { description: 'Execute a script with the given binary' }));
13
- exports.list = exports.app.create('list', {
14
- description: 'List supported scripts',
15
- });
16
- exports.clean = exports.app.create('clean', {
17
- description: 'Clean cache directory',
18
- });
@@ -1,108 +0,0 @@
1
- import NoArg from 'noarg';
2
- import type { app } from './arg';
3
- export declare const executionConfig: {
4
- readonly flags: {
5
- readonly 'do-not-watch': import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
6
- aliases: ["dw"];
7
- description: "Watch for file changes and reload the script";
8
- }>;
9
- readonly 'disable-reload-key': import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
10
- aliases: ["dk"];
11
- description: "Disable 'Ctrl+R' or 'F5' to reload the script";
12
- }>;
13
- readonly 'disable-raw-stdin': import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
14
- aliases: ["drs"];
15
- description: "Disable raw mode for stdin. Do not needed with `--disable-reload-key`";
16
- }>;
17
- readonly exit: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
18
- description: "Do not watch the script. Just run it once and exit. Forced with `rux` or `uni-rux`";
19
- }>;
20
- readonly silent: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
21
- aliases: ["s"];
22
- description: "Do not show any output of the script";
23
- }>;
24
- readonly keep: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
25
- aliases: ["k"];
26
- description: "Do not clear the console while starting the script. Default with `rux` or `uni-rux`";
27
- }>;
28
- readonly ext: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
29
- aliases: ["e"];
30
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
31
- description: "Looks for changes only of the given extensions";
32
- }>;
33
- readonly focus: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
34
- aliases: ["f"];
35
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
36
- description: "Only watch the given items. `chokidar` syntax";
37
- }>;
38
- readonly ignore: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
39
- aliases: ["ig"];
40
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
41
- description: "Exclude the given items. `gitignore` syntax";
42
- }>;
43
- readonly delay: import("noarg/dist/schema/TypeNumber.cjs").TypeNumber<{
44
- aliases: ["d"];
45
- required: true;
46
- default: 100;
47
- description: "The delay to wait for the watcher to trigger";
48
- }>;
49
- readonly bench: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
50
- aliases: ["b"];
51
- description: "Calculate the execution time";
52
- }>;
53
- readonly 'bench-prefix': import("noarg/dist/schema/TypeString.cjs").TypeString<{
54
- aliases: ["bp"];
55
- minLength: 1;
56
- description: "The prefix to show before the execution time";
57
- }>;
58
- readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
59
- required: true;
60
- default: string;
61
- description: "Set the current working directory";
62
- }>;
63
- readonly env: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
64
- schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
65
- description: "Set environment variables";
66
- }>;
67
- readonly 'node-dev': import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
68
- description: "Set env.NODE_ENV to \"development\"";
69
- }>;
70
- readonly shell: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
71
- description: "Run script in shell for low-level commands";
72
- }>;
73
- readonly info: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
74
- description: "Show information about the script";
75
- }>;
76
- readonly time: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
77
- description: "Show the execution time at the start";
78
- }>;
79
- };
80
- readonly listArgument: {
81
- readonly name: "args for script";
82
- readonly description: "The arguments to pass to the script";
83
- readonly type: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
84
- };
85
- readonly trailingArguments: "--";
86
- readonly customRenderHelp: {
87
- readonly helpUsageTrailingArgsLabel: "...[args/flags for script]";
88
- };
89
- };
90
- export type ExecuteOptions = ReturnType<typeof mapFlagsToOptions>;
91
- export declare function mapFlagsToOptions(flags: NoArg.InferFlags<typeof app>): {
92
- cwd: string;
93
- shell: boolean;
94
- silent: boolean;
95
- showInfo: boolean;
96
- showTime: boolean;
97
- benchmark: boolean;
98
- benchmarkPrefix: string | undefined;
99
- clearOnReload: boolean;
100
- keystrokeReload: boolean;
101
- stdinSafeMode: boolean;
102
- watch: boolean;
103
- watchDelay: number;
104
- watchFocus: string[];
105
- watchIgnore: string[];
106
- watchExtensions: string[];
107
- env: NodeJS.ProcessEnv;
108
- };