uni-run 1.0.5 → 1.0.7

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 (63) hide show
  1. package/README.md +122 -0
  2. package/dist/app.cjs +60 -0
  3. package/dist/app.d.mts +1 -0
  4. package/dist/{index.js → app.mjs} +8 -10
  5. package/dist/{arg-helper.js → arg-helper.cjs} +49 -33
  6. package/dist/{arg-helper.d.ts → arg-helper.d.cts} +60 -46
  7. package/dist/arg-helper.d.mts +129 -0
  8. package/dist/arg-helper.mjs +98 -0
  9. package/dist/{arg.js → arg.cjs} +5 -2
  10. package/dist/{arg.d.ts → arg.d.cts} +109 -83
  11. package/dist/arg.d.mts +257 -0
  12. package/dist/arg.mjs +9 -0
  13. package/dist/{bin.js → bin.cjs} +2 -2
  14. package/dist/{bin.d.ts → bin.d.cts} +1 -1
  15. package/dist/bin.d.mts +2 -0
  16. package/dist/bin.mjs +4 -0
  17. package/dist/builtin-bin/{Executor.js → Executor.cjs} +5 -2
  18. package/dist/builtin-bin/{Executor.d.ts → Executor.d.cts} +1 -1
  19. package/dist/builtin-bin/Executor.d.mts +21 -0
  20. package/dist/builtin-bin/Executor.mjs +61 -0
  21. package/dist/builtin-bin/{index.js → index.cjs} +4 -1
  22. package/dist/builtin-bin/{index.d.ts → index.d.cts} +1 -1
  23. package/dist/builtin-bin/index.d.mts +3 -0
  24. package/dist/builtin-bin/index.mjs +94 -0
  25. package/dist/execution/gitignore.cjs +40 -0
  26. package/dist/execution/gitignore.d.mts +1 -0
  27. package/dist/execution/gitignore.mjs +11 -0
  28. package/dist/execution/{index.js → index.cjs} +37 -9
  29. package/dist/execution/{index.d.ts → index.d.cts} +1 -1
  30. package/dist/execution/index.d.mts +15 -0
  31. package/dist/execution/index.mjs +105 -0
  32. package/dist/execution/kill-process.cjs +50 -0
  33. package/dist/execution/{kill-process.d.ts → kill-process.d.cts} +1 -1
  34. package/dist/execution/kill-process.d.mts +2 -0
  35. package/dist/execution/{kill-process.js → kill-process.mjs} +4 -7
  36. package/dist/execution/watcher.cjs +60 -0
  37. package/dist/execution/watcher.d.cts +6 -0
  38. package/dist/execution/watcher.d.mts +6 -0
  39. package/dist/execution/watcher.mjs +31 -0
  40. package/dist/index.cjs +19 -0
  41. package/dist/index.d.cts +8 -0
  42. package/dist/index.d.mts +8 -0
  43. package/dist/index.mjs +13 -0
  44. package/dist/lib/colors.cjs +32 -0
  45. package/dist/lib/colors.d.cts +3 -0
  46. package/dist/lib/colors.d.mts +3 -0
  47. package/dist/lib/colors.mjs +4 -0
  48. package/dist/lib/currentModule.cjs +19 -0
  49. package/dist/lib/currentModule.d.cts +5 -0
  50. package/dist/lib/currentModule.d.mts +5 -0
  51. package/dist/lib/currentModule.mjs +17 -0
  52. package/dist/utils/debounce.d.mts +1 -0
  53. package/dist/utils/debounce.mjs +7 -0
  54. package/package.json +11 -8
  55. package/dist/execution/gitignore.js +0 -14
  56. package/dist/execution/watcher.d.ts +0 -6
  57. package/dist/execution/watcher.js +0 -38
  58. package/dist/lib/colors.d.ts +0 -2
  59. package/dist/lib/colors.js +0 -4
  60. /package/dist/{index.d.ts → app.d.cts} +0 -0
  61. /package/dist/execution/{gitignore.d.ts → gitignore.d.cts} +0 -0
  62. /package/dist/utils/{debounce.js → debounce.cjs} +0 -0
  63. /package/dist/utils/{debounce.d.ts → debounce.d.cts} +0 -0
@@ -0,0 +1,98 @@
1
+ import NoArg from "noarg";
2
+ export const executionConfig = NoArg.defineConfig({
3
+ flags: {
4
+ reloadKey: NoArg.boolean()
5
+ .aliases('rk')
6
+ .default(true)
7
+ .description("Reload the page when pressing 'Ctrl+R' or 'F5'"),
8
+ watch: NoArg.boolean()
9
+ .aliases('w')
10
+ .default(true)
11
+ .description('Watch for changes'),
12
+ exit: NoArg.boolean()
13
+ .default(false)
14
+ .description('Exit after code execution, disabling `watch` and `reloadKey`'),
15
+ clear: NoArg.boolean()
16
+ .aliases('c')
17
+ .default(true)
18
+ .description('Clear the console before running the script'),
19
+ delay: NoArg.number()
20
+ .aliases('d')
21
+ .default(100)
22
+ .description('The delay to wait for the watcher to trigger'),
23
+ ext: NoArg.array(NoArg.string())
24
+ .aliases('e')
25
+ .default([])
26
+ .description('Looks for changes only of the given extensions'),
27
+ include: NoArg.array(NoArg.string())
28
+ .aliases('in')
29
+ .default([])
30
+ .description('Only watch the given folders/files'),
31
+ exclude: NoArg.array(NoArg.string())
32
+ .aliases('ex')
33
+ .default([])
34
+ .description('Exclude the given folders/files'),
35
+ bench: NoArg.boolean()
36
+ .aliases('b')
37
+ .description('Calculate the execution time'),
38
+ benchPrefix: NoArg.string()
39
+ .aliases('bp')
40
+ .minLength(1)
41
+ .description('The prefix to show before the execution time'),
42
+ cwd: NoArg.string()
43
+ .default(process.cwd())
44
+ .description('Current working directory'),
45
+ shell: NoArg.boolean()
46
+ .default(false)
47
+ .description('Run the script in a shell for more low-level control'),
48
+ info: NoArg.boolean()
49
+ .default(false)
50
+ .description('Show information about the script'),
51
+ time: NoArg.boolean()
52
+ .default(false)
53
+ .description('Show the execution time at the start'),
54
+ env: NoArg.array(NoArg.string())
55
+ .default([])
56
+ .description('Environment variables'),
57
+ // Extra flags
58
+ nodeDev: NoArg.boolean()
59
+ .default(false)
60
+ .description('Set NODE_ENV to "development"'),
61
+ tsn: NoArg.boolean()
62
+ .default(false)
63
+ .description('Run the script with ts-node'),
64
+ },
65
+ listArgument: {
66
+ name: 'args for script',
67
+ description: 'The arguments to pass to the script',
68
+ type: NoArg.string(),
69
+ },
70
+ trailingArguments: '--',
71
+ customRenderHelp: {
72
+ helpUsageTrailingArgsLabel: '...[args/flags for script]',
73
+ },
74
+ });
75
+ export function mapFlagsToOptions(flags, bin) {
76
+ var _a;
77
+ return {
78
+ cwd: flags.cwd,
79
+ shell: flags.shell,
80
+ showInfo: flags.info,
81
+ showTime: flags.time,
82
+ benchmark: (_a = flags.bench) !== null && _a !== void 0 ? _a : Boolean(flags.benchPrefix),
83
+ benchmarkPrefix: flags.benchPrefix,
84
+ clearOnReload: flags.clear,
85
+ keystrokeReload: flags.exit ? false : flags.reloadKey,
86
+ watch: flags.exit ? false : flags.watch,
87
+ watchDelay: flags.delay,
88
+ watchInclude: flags.include,
89
+ watchExclude: flags.exclude,
90
+ watchExtensions: (flags.ext.length ? flags.ext : bin === null || bin === void 0 ? void 0 : bin.getRelatedExts()) || [],
91
+ tsNode: flags['tsn'],
92
+ env: Object.assign(Object.assign({}, flags.env.reduce((acc, env) => {
93
+ const [key, value] = env.split('=');
94
+ acc[key] = value;
95
+ return acc;
96
+ }, {})), (flags.nodeDev ? { NODE_ENV: 'development' } : {})),
97
+ };
98
+ }
@@ -1,8 +1,11 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.list = exports.exec = exports.app = void 0;
4
- const noarg_1 = require("noarg");
5
- const arg_helper_1 = require("./arg-helper");
7
+ const noarg_1 = __importDefault(require("noarg"));
8
+ const arg_helper_1 = require("./arg-helper.cjs");
6
9
  exports.app = noarg_1.default.create('uni-run', Object.assign(Object.assign({}, arg_helper_1.executionConfig), { description: 'A universal runner for scripts', system: { splitListByComma: true }, arguments: [
7
10
  { name: 'script', type: noarg_1.default.string(), description: 'Run a script' },
8
11
  ] }));
@@ -1,4 +1,4 @@
1
- import NoArg from 'noarg';
1
+ import NoArg from "noarg";
2
2
  export declare const app: NoArg<"uni-run", {
3
3
  readonly allowEqualAssign: true;
4
4
  readonly booleanNotSyntaxEnding: "\\";
@@ -22,71 +22,84 @@ export declare const app: NoArg<"uni-run", {
22
22
  };
23
23
  readonly trailingArguments: "--";
24
24
  readonly flags: {
25
- readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
26
- required: true;
27
- default: string;
28
- description: "Current working directory";
29
- }>;
30
- readonly shell: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
31
- required: true;
32
- default: false;
33
- description: "Run the script in a shell for more low-level control";
34
- }>;
35
- readonly info: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
25
+ readonly reloadKey: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
26
+ aliases: ["rk"];
36
27
  required: true;
37
- default: false;
38
- description: "Show information about the script";
28
+ default: true;
29
+ description: "Reload the page when pressing 'Ctrl+R' or 'F5'";
39
30
  }>;
40
- readonly time: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
31
+ readonly watch: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
32
+ aliases: ["w"];
41
33
  required: true;
42
- default: false;
43
- description: "Show the execution time at the start";
34
+ default: true;
35
+ description: "Watch for changes";
44
36
  }>;
45
- readonly bench: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
37
+ readonly exit: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
46
38
  required: true;
47
39
  default: false;
48
- description: "Show the execution time";
49
- }>;
50
- readonly benchPrefix: import("noarg/dist/schema/TypeString.cjs").TypeString<{
51
- description: "The prefix for the benchmark to show at the start of the line";
40
+ description: "Exit after code execution, disabling `watch` and `reloadKey`";
52
41
  }>;
53
42
  readonly clear: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
54
- description: "Clear the console before running the script";
43
+ aliases: ["c"];
55
44
  required: true;
56
45
  default: true;
57
- aliases: [string];
58
- }>;
59
- readonly reloadKey: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
60
- description: "Reload the page when pressing 'Ctrl+R' or 'F5'";
61
- required: true;
62
- default: true;
63
- aliases: [string];
64
- }>;
65
- readonly watch: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
66
- description: "Watch for changes";
67
- required: true;
68
- default: true;
69
- aliases: [string];
46
+ description: "Clear the console before running the script";
70
47
  }>;
71
48
  readonly delay: import("noarg/dist/schema/TypeNumber.cjs").TypeNumber<{
72
- description: "The delay to wait for the watcher to trigger";
49
+ aliases: ["d"];
73
50
  required: true;
74
51
  default: 100;
75
- aliases: [string];
52
+ description: "The delay to wait for the watcher to trigger";
76
53
  }>;
77
54
  readonly ext: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
55
+ aliases: ["e"];
56
+ required: true;
57
+ default: never[];
58
+ schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
78
59
  description: "Looks for changes only of the given extensions";
60
+ }>;
61
+ readonly include: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
62
+ aliases: ["in"];
79
63
  required: true;
80
64
  default: never[];
81
65
  schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
82
- aliases: [string];
66
+ description: "Only watch the given folders/files";
83
67
  }>;
84
- readonly ignore: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
85
- description: "Ignore the given folders/files";
68
+ readonly exclude: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
69
+ aliases: ["ex"];
86
70
  required: true;
87
71
  default: never[];
88
72
  schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
89
- aliases: [string];
73
+ description: "Exclude the given folders/files";
74
+ }>;
75
+ readonly bench: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
76
+ aliases: ["b"];
77
+ description: "Calculate the execution time";
78
+ }>;
79
+ readonly benchPrefix: import("noarg/dist/schema/TypeString.cjs").TypeString<{
80
+ aliases: ["bp"];
81
+ minLength: 1;
82
+ description: "The prefix to show before the execution time";
83
+ }>;
84
+ readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
85
+ required: true;
86
+ default: string;
87
+ description: "Current working directory";
88
+ }>;
89
+ readonly shell: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
90
+ required: true;
91
+ default: false;
92
+ description: "Run the script in a shell for more low-level control";
93
+ }>;
94
+ readonly info: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
95
+ required: true;
96
+ default: false;
97
+ description: "Show information about the script";
98
+ }>;
99
+ readonly time: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
100
+ required: true;
101
+ default: false;
102
+ description: "Show the execution time at the start";
90
103
  }>;
91
104
  readonly env: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
92
105
  required: true;
@@ -127,71 +140,84 @@ export declare const exec: import("noarg/dist/NoArg/NoArgProgram.cjs").NoArgProg
127
140
  };
128
141
  readonly trailingArguments: "--";
129
142
  readonly flags: {
130
- readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
131
- required: true;
132
- default: string;
133
- description: "Current working directory";
134
- }>;
135
- readonly shell: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
136
- required: true;
137
- default: false;
138
- description: "Run the script in a shell for more low-level control";
139
- }>;
140
- readonly info: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
143
+ readonly reloadKey: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
144
+ aliases: ["rk"];
141
145
  required: true;
142
- default: false;
143
- description: "Show information about the script";
146
+ default: true;
147
+ description: "Reload the page when pressing 'Ctrl+R' or 'F5'";
144
148
  }>;
145
- readonly time: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
149
+ readonly watch: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
150
+ aliases: ["w"];
146
151
  required: true;
147
- default: false;
148
- description: "Show the execution time at the start";
152
+ default: true;
153
+ description: "Watch for changes";
149
154
  }>;
150
- readonly bench: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
155
+ readonly exit: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
151
156
  required: true;
152
157
  default: false;
153
- description: "Show the execution time";
154
- }>;
155
- readonly benchPrefix: import("noarg/dist/schema/TypeString.cjs").TypeString<{
156
- description: "The prefix for the benchmark to show at the start of the line";
158
+ description: "Exit after code execution, disabling `watch` and `reloadKey`";
157
159
  }>;
158
160
  readonly clear: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
159
- description: "Clear the console before running the script";
161
+ aliases: ["c"];
160
162
  required: true;
161
163
  default: true;
162
- aliases: [string];
163
- }>;
164
- readonly reloadKey: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
165
- description: "Reload the page when pressing 'Ctrl+R' or 'F5'";
166
- required: true;
167
- default: true;
168
- aliases: [string];
169
- }>;
170
- readonly watch: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
171
- description: "Watch for changes";
172
- required: true;
173
- default: true;
174
- aliases: [string];
164
+ description: "Clear the console before running the script";
175
165
  }>;
176
166
  readonly delay: import("noarg/dist/schema/TypeNumber.cjs").TypeNumber<{
177
- description: "The delay to wait for the watcher to trigger";
167
+ aliases: ["d"];
178
168
  required: true;
179
169
  default: 100;
180
- aliases: [string];
170
+ description: "The delay to wait for the watcher to trigger";
181
171
  }>;
182
172
  readonly ext: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
173
+ aliases: ["e"];
174
+ required: true;
175
+ default: never[];
176
+ schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
183
177
  description: "Looks for changes only of the given extensions";
178
+ }>;
179
+ readonly include: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
180
+ aliases: ["in"];
184
181
  required: true;
185
182
  default: never[];
186
183
  schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
187
- aliases: [string];
184
+ description: "Only watch the given folders/files";
188
185
  }>;
189
- readonly ignore: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
190
- description: "Ignore the given folders/files";
186
+ readonly exclude: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
187
+ aliases: ["ex"];
191
188
  required: true;
192
189
  default: never[];
193
190
  schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
194
- aliases: [string];
191
+ description: "Exclude the given folders/files";
192
+ }>;
193
+ readonly bench: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
194
+ aliases: ["b"];
195
+ description: "Calculate the execution time";
196
+ }>;
197
+ readonly benchPrefix: import("noarg/dist/schema/TypeString.cjs").TypeString<{
198
+ aliases: ["bp"];
199
+ minLength: 1;
200
+ description: "The prefix to show before the execution time";
201
+ }>;
202
+ readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
203
+ required: true;
204
+ default: string;
205
+ description: "Current working directory";
206
+ }>;
207
+ readonly shell: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
208
+ required: true;
209
+ default: false;
210
+ description: "Run the script in a shell for more low-level control";
211
+ }>;
212
+ readonly info: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
213
+ required: true;
214
+ default: false;
215
+ description: "Show information about the script";
216
+ }>;
217
+ readonly time: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
218
+ required: true;
219
+ default: false;
220
+ description: "Show the execution time at the start";
195
221
  }>;
196
222
  readonly env: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
197
223
  required: true;
package/dist/arg.d.mts ADDED
@@ -0,0 +1,257 @@
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 reloadKey: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
26
+ aliases: ["rk"];
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 changes";
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 clear: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
43
+ aliases: ["c"];
44
+ required: true;
45
+ default: true;
46
+ description: "Clear the console before running the script";
47
+ }>;
48
+ readonly delay: import("noarg/dist/schema/TypeNumber.cjs").TypeNumber<{
49
+ aliases: ["d"];
50
+ required: true;
51
+ default: 100;
52
+ description: "The delay to wait for the watcher to trigger";
53
+ }>;
54
+ readonly ext: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
55
+ aliases: ["e"];
56
+ required: true;
57
+ default: never[];
58
+ schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
59
+ description: "Looks for changes only of the given extensions";
60
+ }>;
61
+ readonly include: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
62
+ aliases: ["in"];
63
+ required: true;
64
+ default: never[];
65
+ schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
66
+ description: "Only watch the given folders/files";
67
+ }>;
68
+ readonly exclude: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
69
+ aliases: ["ex"];
70
+ required: true;
71
+ default: never[];
72
+ schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
73
+ description: "Exclude the given folders/files";
74
+ }>;
75
+ readonly bench: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
76
+ aliases: ["b"];
77
+ description: "Calculate the execution time";
78
+ }>;
79
+ readonly benchPrefix: import("noarg/dist/schema/TypeString.cjs").TypeString<{
80
+ aliases: ["bp"];
81
+ minLength: 1;
82
+ description: "The prefix to show before the execution time";
83
+ }>;
84
+ readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
85
+ required: true;
86
+ default: string;
87
+ description: "Current working directory";
88
+ }>;
89
+ readonly shell: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
90
+ required: true;
91
+ default: false;
92
+ description: "Run the script in a shell for more low-level control";
93
+ }>;
94
+ readonly info: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
95
+ required: true;
96
+ default: false;
97
+ description: "Show information about the script";
98
+ }>;
99
+ readonly time: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
100
+ required: true;
101
+ default: false;
102
+ description: "Show the execution time at the start";
103
+ }>;
104
+ readonly env: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
105
+ required: true;
106
+ default: never[];
107
+ schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
108
+ description: "Environment variables";
109
+ }>;
110
+ readonly nodeDev: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
111
+ required: true;
112
+ default: false;
113
+ description: "Set NODE_ENV to \"development\"";
114
+ }>;
115
+ readonly tsn: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
116
+ required: true;
117
+ default: false;
118
+ description: "Run the script with ts-node";
119
+ }>;
120
+ };
121
+ readonly customRenderHelp: {
122
+ readonly helpUsageTrailingArgsLabel: "...[args/flags for script]";
123
+ };
124
+ }>;
125
+ export declare const exec: import("noarg/dist/NoArg/NoArgProgram.cjs").NoArgProgram<"exec", {
126
+ readonly allowEqualAssign: true;
127
+ readonly booleanNotSyntaxEnding: "\\";
128
+ readonly allowDuplicateFlagForList: true;
129
+ readonly splitListByComma: true;
130
+ }, {
131
+ readonly help: true;
132
+ }, {
133
+ readonly description: "Execute a script with the given binary";
134
+ readonly arguments: [];
135
+ readonly optionalArguments: [];
136
+ readonly listArgument: {
137
+ readonly name: "args for script";
138
+ readonly description: "The arguments to pass to the script";
139
+ readonly type: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
140
+ };
141
+ readonly trailingArguments: "--";
142
+ readonly flags: {
143
+ readonly reloadKey: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
144
+ aliases: ["rk"];
145
+ required: true;
146
+ default: true;
147
+ description: "Reload the page when pressing 'Ctrl+R' or 'F5'";
148
+ }>;
149
+ readonly watch: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
150
+ aliases: ["w"];
151
+ required: true;
152
+ default: true;
153
+ description: "Watch for changes";
154
+ }>;
155
+ readonly exit: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
156
+ required: true;
157
+ default: false;
158
+ description: "Exit after code execution, disabling `watch` and `reloadKey`";
159
+ }>;
160
+ readonly clear: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
161
+ aliases: ["c"];
162
+ required: true;
163
+ default: true;
164
+ description: "Clear the console before running the script";
165
+ }>;
166
+ readonly delay: import("noarg/dist/schema/TypeNumber.cjs").TypeNumber<{
167
+ aliases: ["d"];
168
+ required: true;
169
+ default: 100;
170
+ description: "The delay to wait for the watcher to trigger";
171
+ }>;
172
+ readonly ext: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
173
+ aliases: ["e"];
174
+ required: true;
175
+ default: never[];
176
+ schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
177
+ description: "Looks for changes only of the given extensions";
178
+ }>;
179
+ readonly include: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
180
+ aliases: ["in"];
181
+ required: true;
182
+ default: never[];
183
+ schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
184
+ description: "Only watch the given folders/files";
185
+ }>;
186
+ readonly exclude: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
187
+ aliases: ["ex"];
188
+ required: true;
189
+ default: never[];
190
+ schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
191
+ description: "Exclude the given folders/files";
192
+ }>;
193
+ readonly bench: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
194
+ aliases: ["b"];
195
+ description: "Calculate the execution time";
196
+ }>;
197
+ readonly benchPrefix: import("noarg/dist/schema/TypeString.cjs").TypeString<{
198
+ aliases: ["bp"];
199
+ minLength: 1;
200
+ description: "The prefix to show before the execution time";
201
+ }>;
202
+ readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
203
+ required: true;
204
+ default: string;
205
+ description: "Current working directory";
206
+ }>;
207
+ readonly shell: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
208
+ required: true;
209
+ default: false;
210
+ description: "Run the script in a shell for more low-level control";
211
+ }>;
212
+ readonly info: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
213
+ required: true;
214
+ default: false;
215
+ description: "Show information about the script";
216
+ }>;
217
+ readonly time: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
218
+ required: true;
219
+ default: false;
220
+ description: "Show the execution time at the start";
221
+ }>;
222
+ readonly env: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
223
+ required: true;
224
+ default: never[];
225
+ schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
226
+ description: "Environment variables";
227
+ }>;
228
+ readonly nodeDev: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
229
+ required: true;
230
+ default: false;
231
+ description: "Set NODE_ENV to \"development\"";
232
+ }>;
233
+ readonly tsn: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
234
+ required: true;
235
+ default: false;
236
+ description: "Run the script with ts-node";
237
+ }>;
238
+ };
239
+ readonly customRenderHelp: {
240
+ readonly helpUsageTrailingArgsLabel: "...[args/flags for script]";
241
+ };
242
+ globalFlags: {};
243
+ }>;
244
+ export declare const list: import("noarg/dist/NoArg/NoArgProgram.cjs").NoArgProgram<"list", {
245
+ readonly allowEqualAssign: true;
246
+ readonly booleanNotSyntaxEnding: "\\";
247
+ readonly allowDuplicateFlagForList: true;
248
+ readonly splitListByComma: true;
249
+ }, {
250
+ readonly help: true;
251
+ }, {
252
+ readonly description: "List supported scripts";
253
+ readonly arguments: [];
254
+ readonly optionalArguments: [];
255
+ readonly flags: {};
256
+ globalFlags: {};
257
+ }>;
package/dist/arg.mjs ADDED
@@ -0,0 +1,9 @@
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
+ });
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  "use strict";
3
3
  Object.defineProperty(exports, "__esModule", { value: true });
4
- require("./index");
5
- const arg_1 = require("./arg");
4
+ require("./app.cjs");
5
+ const arg_1 = require("./arg.cjs");
6
6
  arg_1.app.start();
@@ -1,2 +1,2 @@
1
1
  #!/usr/bin/env node
2
- import './index';
2
+ import "./app.cjs";
package/dist/bin.d.mts ADDED
@@ -0,0 +1,2 @@
1
+ #!/usr/bin/env node
2
+ import "./app.mjs";
package/dist/bin.mjs ADDED
@@ -0,0 +1,4 @@
1
+ #!/usr/bin/env node
2
+ import "./app.mjs";
3
+ import { app } from "./arg.mjs";
4
+ app.start();