uni-run 1.0.0 → 1.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.
- package/dist/arg-helper.d.ts +14 -4
- package/dist/arg-helper.js +13 -6
- package/dist/arg.d.ts +28 -8
- package/dist/execution/index.d.ts +1 -0
- package/dist/execution/index.js +2 -0
- package/package.json +1 -1
package/dist/arg-helper.d.ts
CHANGED
|
@@ -6,7 +6,12 @@ export declare const executionConfig: {
|
|
|
6
6
|
readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
|
|
7
7
|
required: true;
|
|
8
8
|
default: string;
|
|
9
|
-
description: "
|
|
9
|
+
description: "Current working directory";
|
|
10
|
+
}>;
|
|
11
|
+
readonly shell: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
|
|
12
|
+
required: true;
|
|
13
|
+
default: false;
|
|
14
|
+
description: "Run the script in a shell for more low-level control";
|
|
10
15
|
}>;
|
|
11
16
|
readonly clear: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
|
|
12
17
|
description: "Clear the console before running the script";
|
|
@@ -15,7 +20,7 @@ export declare const executionConfig: {
|
|
|
15
20
|
aliases: [string];
|
|
16
21
|
}>;
|
|
17
22
|
readonly reloadKey: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
|
|
18
|
-
description: "Reload the page when pressing
|
|
23
|
+
description: "Reload the page when pressing 'Ctrl+R' or 'F5'";
|
|
19
24
|
required: true;
|
|
20
25
|
default: true;
|
|
21
26
|
aliases: [string];
|
|
@@ -40,7 +45,7 @@ export declare const executionConfig: {
|
|
|
40
45
|
aliases: [string];
|
|
41
46
|
}>;
|
|
42
47
|
readonly ignore: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
|
|
43
|
-
description: "Ignore the given
|
|
48
|
+
description: "Ignore the given folders/files";
|
|
44
49
|
required: true;
|
|
45
50
|
default: never[];
|
|
46
51
|
schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
|
|
@@ -52,6 +57,11 @@ export declare const executionConfig: {
|
|
|
52
57
|
schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
|
|
53
58
|
description: "Environment variables";
|
|
54
59
|
}>;
|
|
60
|
+
readonly nodeDev: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
|
|
61
|
+
required: true;
|
|
62
|
+
default: false;
|
|
63
|
+
description: "Set NODE_ENV to \"development\"";
|
|
64
|
+
}>;
|
|
55
65
|
};
|
|
56
66
|
readonly listArgument: {
|
|
57
67
|
readonly name: "args for script";
|
|
@@ -60,7 +70,7 @@ export declare const executionConfig: {
|
|
|
60
70
|
};
|
|
61
71
|
readonly trailingArguments: "--";
|
|
62
72
|
readonly customRenderHelp: {
|
|
63
|
-
readonly helpUsageTrailingArgsLabel: "
|
|
73
|
+
readonly helpUsageTrailingArgsLabel: "...[args/flags for script]";
|
|
64
74
|
};
|
|
65
75
|
};
|
|
66
76
|
export declare function mapFlagsToOptions(flags: NoArg.InferFlags<typeof app>, watchExtensions?: string[]): ExecuteOptions;
|
package/dist/arg-helper.js
CHANGED
|
@@ -7,14 +7,17 @@ exports.executionConfig = noarg_1.default.defineConfig({
|
|
|
7
7
|
flags: {
|
|
8
8
|
cwd: noarg_1.default.string()
|
|
9
9
|
.default(process.cwd())
|
|
10
|
-
.description('
|
|
10
|
+
.description('Current working directory'),
|
|
11
|
+
shell: noarg_1.default.boolean()
|
|
12
|
+
.default(false)
|
|
13
|
+
.description('Run the script in a shell for more low-level control'),
|
|
11
14
|
clear: noarg_1.default.boolean()
|
|
12
15
|
.default(true)
|
|
13
16
|
.description('Clear the console before running the script')
|
|
14
17
|
.aliases('c'),
|
|
15
18
|
reloadKey: noarg_1.default.boolean()
|
|
16
19
|
.default(true)
|
|
17
|
-
.description(
|
|
20
|
+
.description("Reload the page when pressing 'Ctrl+R' or 'F5'")
|
|
18
21
|
.aliases('rk'),
|
|
19
22
|
watch: noarg_1.default.boolean()
|
|
20
23
|
.default(true)
|
|
@@ -30,11 +33,14 @@ exports.executionConfig = noarg_1.default.defineConfig({
|
|
|
30
33
|
.aliases('e'),
|
|
31
34
|
ignore: noarg_1.default.array(noarg_1.default.string())
|
|
32
35
|
.default([])
|
|
33
|
-
.description('Ignore the given
|
|
36
|
+
.description('Ignore the given folders/files')
|
|
34
37
|
.aliases('ig'),
|
|
35
38
|
env: noarg_1.default.array(noarg_1.default.string())
|
|
36
39
|
.default([])
|
|
37
40
|
.description('Environment variables'),
|
|
41
|
+
nodeDev: noarg_1.default.boolean()
|
|
42
|
+
.default(false)
|
|
43
|
+
.description('Set NODE_ENV to "development"'),
|
|
38
44
|
},
|
|
39
45
|
listArgument: {
|
|
40
46
|
name: 'args for script',
|
|
@@ -43,19 +49,20 @@ exports.executionConfig = noarg_1.default.defineConfig({
|
|
|
43
49
|
},
|
|
44
50
|
trailingArguments: '--',
|
|
45
51
|
customRenderHelp: {
|
|
46
|
-
helpUsageTrailingArgsLabel: '
|
|
52
|
+
helpUsageTrailingArgsLabel: '...[args/flags for script]',
|
|
47
53
|
},
|
|
48
54
|
});
|
|
49
55
|
function mapFlagsToOptions(flags, watchExtensions) {
|
|
50
56
|
return {
|
|
51
57
|
cwd: flags.cwd,
|
|
58
|
+
shell: flags.shell,
|
|
52
59
|
clearOnReload: flags.clear,
|
|
53
60
|
readlineReload: flags.reloadKey,
|
|
54
|
-
env: flags.env.reduce((acc, env) => {
|
|
61
|
+
env: Object.assign(Object.assign({}, flags.env.reduce((acc, env) => {
|
|
55
62
|
const [key, value] = env.split('=');
|
|
56
63
|
acc[key] = value;
|
|
57
64
|
return acc;
|
|
58
|
-
}, {}),
|
|
65
|
+
}, {})), (flags.nodeDev ? { NODE_ENV: 'development' } : {})),
|
|
59
66
|
watch: flags.watch,
|
|
60
67
|
watchDelay: flags.delay,
|
|
61
68
|
watchExtensions: flags.ext.length ? flags.ext : watchExtensions !== null && watchExtensions !== void 0 ? watchExtensions : [],
|
package/dist/arg.d.ts
CHANGED
|
@@ -25,7 +25,12 @@ export declare const app: NoArg<"uni-run", {
|
|
|
25
25
|
readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
|
|
26
26
|
required: true;
|
|
27
27
|
default: string;
|
|
28
|
-
description: "
|
|
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";
|
|
29
34
|
}>;
|
|
30
35
|
readonly clear: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
|
|
31
36
|
description: "Clear the console before running the script";
|
|
@@ -34,7 +39,7 @@ export declare const app: NoArg<"uni-run", {
|
|
|
34
39
|
aliases: [string];
|
|
35
40
|
}>;
|
|
36
41
|
readonly reloadKey: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
|
|
37
|
-
description: "Reload the page when pressing
|
|
42
|
+
description: "Reload the page when pressing 'Ctrl+R' or 'F5'";
|
|
38
43
|
required: true;
|
|
39
44
|
default: true;
|
|
40
45
|
aliases: [string];
|
|
@@ -59,7 +64,7 @@ export declare const app: NoArg<"uni-run", {
|
|
|
59
64
|
aliases: [string];
|
|
60
65
|
}>;
|
|
61
66
|
readonly ignore: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
|
|
62
|
-
description: "Ignore the given
|
|
67
|
+
description: "Ignore the given folders/files";
|
|
63
68
|
required: true;
|
|
64
69
|
default: never[];
|
|
65
70
|
schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
|
|
@@ -71,9 +76,14 @@ export declare const app: NoArg<"uni-run", {
|
|
|
71
76
|
schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
|
|
72
77
|
description: "Environment variables";
|
|
73
78
|
}>;
|
|
79
|
+
readonly nodeDev: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
|
|
80
|
+
required: true;
|
|
81
|
+
default: false;
|
|
82
|
+
description: "Set NODE_ENV to \"development\"";
|
|
83
|
+
}>;
|
|
74
84
|
};
|
|
75
85
|
readonly customRenderHelp: {
|
|
76
|
-
readonly helpUsageTrailingArgsLabel: "
|
|
86
|
+
readonly helpUsageTrailingArgsLabel: "...[args/flags for script]";
|
|
77
87
|
};
|
|
78
88
|
}>;
|
|
79
89
|
export declare const exec: import("noarg/dist/NoArg/NoArgProgram.cjs").NoArgProgram<"exec", {
|
|
@@ -97,7 +107,12 @@ export declare const exec: import("noarg/dist/NoArg/NoArgProgram.cjs").NoArgProg
|
|
|
97
107
|
readonly cwd: import("noarg/dist/schema/TypeString.cjs").TypeString<{
|
|
98
108
|
required: true;
|
|
99
109
|
default: string;
|
|
100
|
-
description: "
|
|
110
|
+
description: "Current working directory";
|
|
111
|
+
}>;
|
|
112
|
+
readonly shell: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
|
|
113
|
+
required: true;
|
|
114
|
+
default: false;
|
|
115
|
+
description: "Run the script in a shell for more low-level control";
|
|
101
116
|
}>;
|
|
102
117
|
readonly clear: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
|
|
103
118
|
description: "Clear the console before running the script";
|
|
@@ -106,7 +121,7 @@ export declare const exec: import("noarg/dist/NoArg/NoArgProgram.cjs").NoArgProg
|
|
|
106
121
|
aliases: [string];
|
|
107
122
|
}>;
|
|
108
123
|
readonly reloadKey: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
|
|
109
|
-
description: "Reload the page when pressing
|
|
124
|
+
description: "Reload the page when pressing 'Ctrl+R' or 'F5'";
|
|
110
125
|
required: true;
|
|
111
126
|
default: true;
|
|
112
127
|
aliases: [string];
|
|
@@ -131,7 +146,7 @@ export declare const exec: import("noarg/dist/NoArg/NoArgProgram.cjs").NoArgProg
|
|
|
131
146
|
aliases: [string];
|
|
132
147
|
}>;
|
|
133
148
|
readonly ignore: import("noarg/dist/schema/TypeArray.cjs").TypeArray<{
|
|
134
|
-
description: "Ignore the given
|
|
149
|
+
description: "Ignore the given folders/files";
|
|
135
150
|
required: true;
|
|
136
151
|
default: never[];
|
|
137
152
|
schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
|
|
@@ -143,9 +158,14 @@ export declare const exec: import("noarg/dist/NoArg/NoArgProgram.cjs").NoArgProg
|
|
|
143
158
|
schema: import("noarg/dist/schema/TypeString.cjs").TypeString<{}>;
|
|
144
159
|
description: "Environment variables";
|
|
145
160
|
}>;
|
|
161
|
+
readonly nodeDev: import("noarg/dist/schema/TypeBoolean.cjs").TypeBoolean<{
|
|
162
|
+
required: true;
|
|
163
|
+
default: false;
|
|
164
|
+
description: "Set NODE_ENV to \"development\"";
|
|
165
|
+
}>;
|
|
146
166
|
};
|
|
147
167
|
readonly customRenderHelp: {
|
|
148
|
-
readonly helpUsageTrailingArgsLabel: "
|
|
168
|
+
readonly helpUsageTrailingArgsLabel: "...[args/flags for script]";
|
|
149
169
|
};
|
|
150
170
|
globalFlags: {};
|
|
151
171
|
}>;
|
package/dist/execution/index.js
CHANGED
|
@@ -45,7 +45,9 @@ class Execution {
|
|
|
45
45
|
this.clearBeforeStart();
|
|
46
46
|
this.child = (0, cross_spawn_1.spawn)(this.command, this.args, {
|
|
47
47
|
stdio: 'inherit',
|
|
48
|
+
argv0: this.command,
|
|
48
49
|
cwd: this.options.cwd,
|
|
50
|
+
shell: this.options.shell,
|
|
49
51
|
env: Object.assign({}, this.options.env),
|
|
50
52
|
});
|
|
51
53
|
this.child.on('error', console.error);
|