uni-run 1.0.9 → 1.0.10

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.
@@ -48,6 +48,9 @@ exports.executionConfig = noarg_1.default.defineConfig({
48
48
  .aliases('c')
49
49
  .default(true)
50
50
  .description('Clear the console before running the script'),
51
+ silent: noarg_1.default.boolean()
52
+ .default(false)
53
+ .description('Do not show any output of the script'),
51
54
  cwd: noarg_1.default.string()
52
55
  .default(process.cwd())
53
56
  .description('Current working directory'),
@@ -89,6 +92,7 @@ function mapFlagsToOptions(flags, bin) {
89
92
  return {
90
93
  cwd: flags.cwd,
91
94
  shell: flags.shell,
95
+ silent: flags.silent,
92
96
  stdinSafeMode: flags['safe-stdin'],
93
97
  showInfo: flags.info,
94
98
  showTime: flags.time,
@@ -62,6 +62,11 @@ export declare const executionConfig: {
62
62
  default: true;
63
63
  description: "Clear the console before running the script";
64
64
  }>;
65
+ readonly silent: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
66
+ required: true;
67
+ default: false;
68
+ description: "Do not show any output of the script";
69
+ }>;
65
70
  readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
66
71
  required: true;
67
72
  default: string;
@@ -118,6 +123,7 @@ export type ExecuteOptions = ReturnType<typeof mapFlagsToOptions>;
118
123
  export declare function mapFlagsToOptions(flags: NoArg.InferFlags<typeof app>, bin?: Executor): {
119
124
  cwd: string;
120
125
  shell: boolean;
126
+ silent: boolean;
121
127
  stdinSafeMode: boolean;
122
128
  showInfo: boolean;
123
129
  showTime: boolean;
@@ -62,6 +62,11 @@ export declare const executionConfig: {
62
62
  default: true;
63
63
  description: "Clear the console before running the script";
64
64
  }>;
65
+ readonly silent: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
66
+ required: true;
67
+ default: false;
68
+ description: "Do not show any output of the script";
69
+ }>;
65
70
  readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
66
71
  required: true;
67
72
  default: string;
@@ -118,6 +123,7 @@ export type ExecuteOptions = ReturnType<typeof mapFlagsToOptions>;
118
123
  export declare function mapFlagsToOptions(flags: NoArg.InferFlags<typeof app>, bin?: Executor): {
119
124
  cwd: string;
120
125
  shell: boolean;
126
+ silent: boolean;
121
127
  stdinSafeMode: boolean;
122
128
  showInfo: boolean;
123
129
  showTime: boolean;
@@ -41,6 +41,9 @@ export const executionConfig = NoArg.defineConfig({
41
41
  .aliases('c')
42
42
  .default(true)
43
43
  .description('Clear the console before running the script'),
44
+ silent: NoArg.boolean()
45
+ .default(false)
46
+ .description('Do not show any output of the script'),
44
47
  cwd: NoArg.string()
45
48
  .default(process.cwd())
46
49
  .description('Current working directory'),
@@ -82,6 +85,7 @@ export function mapFlagsToOptions(flags, bin) {
82
85
  return {
83
86
  cwd: flags.cwd,
84
87
  shell: flags.shell,
88
+ silent: flags.silent,
85
89
  stdinSafeMode: flags['safe-stdin'],
86
90
  showInfo: flags.info,
87
91
  showTime: flags.time,
package/dist/arg.d.cts CHANGED
@@ -81,6 +81,11 @@ export declare const app: NoArg<"uni-run", {
81
81
  default: true;
82
82
  description: "Clear the console before running the script";
83
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
+ }>;
84
89
  readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
85
90
  required: true;
86
91
  default: string;
@@ -204,6 +209,11 @@ export declare const exec: import("noarg/dist/NoArg/NoArgProgram.cjs").NoArgProg
204
209
  default: true;
205
210
  description: "Clear the console before running the script";
206
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
+ }>;
207
217
  readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
208
218
  required: true;
209
219
  default: string;
package/dist/arg.d.mts CHANGED
@@ -81,6 +81,11 @@ export declare const app: NoArg<"uni-run", {
81
81
  default: true;
82
82
  description: "Clear the console before running the script";
83
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
+ }>;
84
89
  readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
85
90
  required: true;
86
91
  default: string;
@@ -204,6 +209,11 @@ export declare const exec: import("noarg/dist/NoArg/NoArgProgram.cjs").NoArgProg
204
209
  default: true;
205
210
  description: "Clear the console before running the script";
206
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
+ }>;
207
217
  readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
208
218
  required: true;
209
219
  default: string;
@@ -40,7 +40,7 @@ class Execution {
40
40
  this.args = args;
41
41
  this.options = options;
42
42
  this.child = null;
43
- this.benchMarkText = colors_1.default.dim.blue('> Execution time');
43
+ this.benchMarkText = colors_1.default.dim.green('# Execution time');
44
44
  this.isBenchmarkRunning = false;
45
45
  this.isExecutionExecutedAnyTime = false;
46
46
  this.setup();
@@ -79,15 +79,13 @@ class Execution {
79
79
  this.killProcess();
80
80
  this.clearBeforeStart();
81
81
  this.renderInfoLogs();
82
- const controller = new AbortController();
83
82
  this.isExecutionExecutedAnyTime = true;
84
83
  this.child = (0, cross_spawn_1.spawn)(this.command, this.args, {
85
- stdio: 'inherit',
86
84
  argv0: this.command,
87
85
  cwd: this.options.cwd,
88
86
  shell: this.options.shell,
89
87
  env: Object.assign({}, this.options.env),
90
- signal: controller.signal,
88
+ stdio: this.options.silent ? 'ignore' : 'inherit',
91
89
  });
92
90
  this.child.on('exit', (code) => {
93
91
  if (code && code > 0) {
@@ -12,7 +12,7 @@ export default class Execution {
12
12
  this.args = args;
13
13
  this.options = options;
14
14
  this.child = null;
15
- this.benchMarkText = colors.dim.blue('> Execution time');
15
+ this.benchMarkText = colors.dim.green('# Execution time');
16
16
  this.isBenchmarkRunning = false;
17
17
  this.isExecutionExecutedAnyTime = false;
18
18
  this.setup();
@@ -51,15 +51,13 @@ export default class Execution {
51
51
  this.killProcess();
52
52
  this.clearBeforeStart();
53
53
  this.renderInfoLogs();
54
- const controller = new AbortController();
55
54
  this.isExecutionExecutedAnyTime = true;
56
55
  this.child = spawn(this.command, this.args, {
57
- stdio: 'inherit',
58
56
  argv0: this.command,
59
57
  cwd: this.options.cwd,
60
58
  shell: this.options.shell,
61
59
  env: Object.assign({}, this.options.env),
62
- signal: controller.signal,
60
+ stdio: this.options.silent ? 'ignore' : 'inherit',
63
61
  });
64
62
  this.child.on('exit', (code) => {
65
63
  if (code && code > 0) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "uni-run",
3
- "version": "1.0.9",
3
+ "version": "1.0.10",
4
4
  "description": "Universal Runner for many language",
5
5
  "scripts": {
6
6
  "dev": "npmize dev",