UNPKG

4.65 kBJSONView Raw
1{
2 "version": 2,
3 "title": "Run Commands",
4 "description": "Run any custom commands with Nx.",
5 "type": "object",
6 "cli": "nx",
7 "outputCapture": "pipe",
8 "presets": [
9 {
10 "name": "Arguments forwarding",
11 "keys": ["commands"]
12 },
13 {
14 "name": "Custom done conditions",
15 "keys": ["commands", "readyWhen"]
16 },
17 {
18 "name": "Setting the cwd",
19 "keys": ["commands", "cwd"]
20 }
21 ],
22 "properties": {
23 "commands": {
24 "type": "array",
25 "description": "Commands to run in child process.",
26 "items": {
27 "oneOf": [
28 {
29 "type": "object",
30 "properties": {
31 "command": {
32 "type": "string",
33 "description": "Command to run in child process."
34 },
35 "forwardAllArgs": {
36 "type": "boolean",
37 "description": "Whether arguments should be forwarded when interpolation is not present."
38 },
39 "prefix": {
40 "type": "string",
41 "description": "Prefix in front of every line out of the output"
42 },
43 "color": {
44 "type": "string",
45 "description": "Color of the output",
46 "enum": [
47 "black",
48 "red",
49 "green",
50 "yellow",
51 "blue",
52 "magenta",
53 "cyan",
54 "white"
55 ]
56 },
57 "bgColor": {
58 "type": "string",
59 "description": "Background color of the output",
60 "enum": [
61 "bgBlack",
62 "bgRed",
63 "bgGreen",
64 "bgYellow",
65 "bgBlue",
66 "bgMagenta",
67 "bgCyan",
68 "bgWhite"
69 ]
70 },
71 "description": {
72 "type": "string",
73 "description": "An optional description useful for inline documentation purposes. It is not used as part of the execution of the command."
74 }
75 },
76 "additionalProperties": false,
77 "required": ["command"]
78 },
79 {
80 "type": "string"
81 }
82 ]
83 }
84 },
85 "command": {
86 "type": "string",
87 "description": "Command to run in child process."
88 },
89 "parallel": {
90 "type": "boolean",
91 "description": "Run commands in parallel.",
92 "default": true
93 },
94 "readyWhen": {
95 "type": "string",
96 "description": "String to appear in `stdout` or `stderr` that indicates that the task is done. When running multiple commands, this option can only be used when `parallel` is set to `true`. If not specified, the task is done when all the child processes complete."
97 },
98 "args": {
99 "type": "string",
100 "description": "Extra arguments. You can pass them as follows: nx run project:target --args='--wait=100'. You can then use {args.wait} syntax to interpolate them in the workspace config file. See example [above](#chaining-commands-interpolating-args-and-setting-the-cwd)"
101 },
102 "envFile": {
103 "type": "string",
104 "description": "You may specify a custom .env file path."
105 },
106 "color": {
107 "type": "boolean",
108 "description": "Use colors when showing output of command.",
109 "default": false
110 },
111 "outputPath": {
112 "description": "Allows you to specify where the build artifacts are stored. This allows Nx Cloud to pick them up correctly, in the case that the build artifacts are placed somewhere other than the top level dist folder.",
113 "oneOf": [
114 {
115 "type": "string"
116 },
117 {
118 "type": "array",
119 "items": {
120 "type": "string"
121 }
122 }
123 ]
124 },
125 "cwd": {
126 "type": "string",
127 "description": "Current working directory of the commands. If it's not specified the commands will run in the workspace root, if a relative path is specified the commands will run in that path relative to the workspace root and if it's an absolute path the commands will run in that path."
128 },
129 "__unparsed__": {
130 "hidden": true,
131 "type": "array",
132 "items": {
133 "type": "string"
134 },
135 "$default": {
136 "$source": "unparsed"
137 }
138 }
139 },
140 "additionalProperties": true,
141 "oneOf": [
142 {
143 "required": ["commands"]
144 },
145 {
146 "required": ["command"]
147 }
148 ],
149 "examplesFile": "../../../docs/run-commands-examples.md"
150}