|
1 | 1 | # nest-commander
|
2 | 2 |
|
| 3 | +## 3.14.0 |
| 4 | + |
| 5 | +### Minor Changes |
| 6 | + |
| 7 | +- 1cdac14: feat: Add option for Help Configuration using the .configureHelp() |
| 8 | + function in commander js |
| 9 | + |
3 | 10 | ## 3.13.0
|
4 | 11 |
|
5 | 12 | ### Minor Changes
|
6 | 13 |
|
7 |
| -- c29737c: Enhance filesystem autocomplete support for Bash and Zsh by introducing an |
8 |
| - opt-in option based on an environment variable. |
| 14 | +- c29737c: Enhance filesystem autocomplete support for Bash and Zsh by |
| 15 | + introducing an opt-in option based on an environment variable. |
9 | 16 |
|
10 | 17 | ## 3.12.5
|
11 | 18 |
|
12 | 19 | ### Patch Changes
|
13 | 20 |
|
14 |
| -- 72b2a00: Move the fig completion package to an optional import to get around jest |
15 |
| - throwing an error about esm packages |
| 21 | +- 72b2a00: Move the fig completion package to an optional import to get around |
| 22 | + jest throwing an error about esm packages |
16 | 23 |
|
17 | 24 | ## 3.12.4
|
18 | 25 |
|
|
24 | 31 |
|
25 | 32 | ### Patch Changes
|
26 | 33 |
|
27 |
| -- e66901a: update package @fig/complete-commander to v3.0.0 to support commander v11 |
| 34 | +- e66901a: update package @fig/complete-commander to v3.0.0 to support commander |
| 35 | + v11 |
28 | 36 |
|
29 | 37 | ## 3.12.2
|
30 | 38 |
|
|
36 | 44 |
|
37 | 45 | ### Patch Changes
|
38 | 46 |
|
39 |
| -- a3b683d: Remap the options to the name passed in the `@Options()` decorator, if provided |
| 47 | +- a3b683d: Remap the options to the name passed in the `@Options()` decorator, |
| 48 | + if provided |
40 | 49 |
|
41 | 50 | ## 3.12.0
|
42 | 51 |
|
|
48 | 57 |
|
49 | 58 | ### Patch Changes
|
50 | 59 |
|
51 |
| -- 8cc3109: The CommandRunnerService now re-throws the error regardless of the contents, it |
52 |
| - just adds a new log above the error as well |
| 60 | +- 8cc3109: The CommandRunnerService now re-throws the error regardless of the |
| 61 | + contents, it just adds a new log above the error as well |
53 | 62 |
|
54 | 63 | ## 3.11.0
|
55 | 64 |
|
|
76 | 85 |
|
77 | 86 | ### Minor Changes
|
78 | 87 |
|
79 |
| -- 6cc1112: Add ability to pass NestApplicationContextOptions to CommandFactoryRunOptions. |
| 88 | +- 6cc1112: Add ability to pass NestApplicationContextOptions to |
| 89 | + CommandFactoryRunOptions. |
80 | 90 |
|
81 |
| - Now CommandFactory.createWithoutRunning() can accept more options, for example, |
82 |
| - bufferLogs to pre-save Nest startup logs. |
| 91 | + Now CommandFactory.createWithoutRunning() can accept more options, for |
| 92 | + example, bufferLogs to pre-save Nest startup logs. |
83 | 93 |
|
84 | 94 | ## 3.7.1
|
85 | 95 |
|
86 | 96 | ### Patch Changes
|
87 | 97 |
|
88 |
| -- 1ceab9d: Log error and stack wtih custom error message instead of just custom error |
89 |
| - message |
| 98 | +- 1ceab9d: Log error and stack wtih custom error message instead of just custom |
| 99 | + error message |
90 | 100 |
|
91 | 101 | ## 3.7.0
|
92 | 102 |
|
93 | 103 | ### Minor Changes
|
94 | 104 |
|
95 |
| -- 9a5f555: Add a new method to create an application but nott run it in case of needing to |
96 |
| - modify the logger or similar situations. |
| 105 | +- 9a5f555: Add a new method to create an application but nott run it in case of |
| 106 | + needing to modify the logger or similar situations. |
97 | 107 |
|
98 | 108 | Now the `CommandFactory.createWithoutRunning()` method can be used to create a
|
99 |
| - Nest commander application without running the `commandRunner.run()`. To run the |
100 |
| - newly created application, `CommandFactory.runApplicaiton(app)` can be called. I |
101 |
| - may change this to be a simple `app.run()` in the future. |
| 109 | + Nest commander application without running the `commandRunner.run()`. To run |
| 110 | + the newly created application, `CommandFactory.runApplicaiton(app)` can be |
| 111 | + called. I may change this to be a simple `app.run()` in the future. |
102 | 112 |
|
103 | 113 | ## 3.6.3
|
104 | 114 |
|
|
116 | 126 |
|
117 | 127 | ### Patch Changes
|
118 | 128 |
|
119 |
| -- c35e8cc: Fixed issue with parsing serviceErrorHandler option to properly override default behaviour |
| 129 | +- c35e8cc: Fixed issue with parsing serviceErrorHandler option to properly |
| 130 | + override default behaviour |
120 | 131 |
|
121 | 132 | ## 3.6.0
|
122 | 133 |
|
123 | 134 | ### Minor Changes
|
124 | 135 |
|
125 | 136 | - 7f54ff8: Add serviceErrorHandler option
|
126 | 137 |
|
127 |
| - This option allows for catching and handling errors at the Nest service execution level so that |
128 |
| - lifecycle hooks still properly work. By default it is set to |
129 |
| - `(err: Error) => process.stderr.write(err.toString())`. |
| 138 | + This option allows for catching and handling errors at the Nest service |
| 139 | + execution level so that lifecycle hooks still properly work. By default it is |
| 140 | + set to `(err: Error) => process.stderr.write(err.toString())`. |
130 | 141 |
|
131 | 142 | - 09b6134: Add the ability to have a Root command
|
132 | 143 |
|
133 |
| - With the `@RootCommand()` the `-h` flag can now output the options of the default command _along |
134 |
| - with_ the names of the other commands. |
| 144 | + With the `@RootCommand()` the `-h` flag can now output the options of the |
| 145 | + default command _along with_ the names of the other commands. |
135 | 146 |
|
136 | 147 | ## 3.5.0
|
137 | 148 |
|
138 | 149 | ### Minor Changes
|
139 | 150 |
|
140 |
| -- d2e5fc8: Allow for use of request scoped providers through a new module decorator |
| 151 | +- d2e5fc8: Allow for use of request scoped providers through a new module |
| 152 | + decorator |
141 | 153 |
|
142 |
| - By making use of the `@RequestModule()` decorator for modules, as mock request object can be set |
143 |
| - as a singleton to help the use of `REQUEST` scoped providers in a singleton context. There's now |
144 |
| - also an error that is logged in the case of a property of `undefined` being called, as this is |
145 |
| - usually indicative of a `REQUEST` scoped provider being called from a `SINGLETON` context. |
| 154 | + By making use of the `@RequestModule()` decorator for modules, as mock request |
| 155 | + object can be set as a singleton to help the use of `REQUEST` scoped providers |
| 156 | + in a singleton context. There's now also an error that is logged in the case |
| 157 | + of a property of `undefined` being called, as this is usually indicative of a |
| 158 | + `REQUEST` scoped provider being called from a `SINGLETON` context. |
146 | 159 |
|
147 | 160 | ## 3.4.0
|
148 | 161 |
|
149 | 162 | ### Minor Changes
|
150 | 163 |
|
151 | 164 | - fadb70d: Allow for a sub command to be set as the default sub command.
|
152 | 165 | - 74c88f5: Add new api registerWithSubCommand to CommandRunner Class
|
153 |
| -- abff78d: Allow for options to be parsed positionally via an option passed to CommandFactory |
| 166 | +- abff78d: Allow for options to be parsed positionally via an option passed to |
| 167 | + CommandFactory |
154 | 168 |
|
155 | 169 | ## 3.3.0
|
156 | 170 |
|
157 | 171 | ### Minor Changes
|
158 | 172 |
|
159 |
| -- 8c639d3: fix: update module resolution to node16 so dynamic imports are not transpiled out during |
160 |
| - TS build |
| 173 | +- 8c639d3: fix: update module resolution to node16 so dynamic imports are not |
| 174 | + transpiled out during TS build |
161 | 175 |
|
162 | 176 | ## 3.2.1
|
163 | 177 |
|
164 | 178 | ### Patch Changes
|
165 | 179 |
|
166 |
| -- 5c089a6: Fixed an issue preventing use of ESM packages as plugins in the command factory |
| 180 | +- 5c089a6: Fixed an issue preventing use of ESM packages as plugins in the |
| 181 | + command factory |
167 | 182 |
|
168 | 183 | ## 3.2.0
|
169 | 184 |
|
|
181 | 196 |
|
182 | 197 | ### Major Changes
|
183 | 198 |
|
184 |
| -- d6ebe0e: Migrate `CommandRunner` from interface to abstract class and add `.command` |
| 199 | +- d6ebe0e: Migrate `CommandRunner` from interface to abstract class and add |
| 200 | + `.command` |
185 | 201 |
|
186 |
| - This change was made so that devs could access `this.command` inside the `CommandRunner` instance |
187 |
| - and have access to the base command object from commander. This allows for access to the `help` |
188 |
| - commands in a programatic fashion. |
| 202 | + This change was made so that devs could access `this.command` inside the |
| 203 | + `CommandRunner` instance and have access to the base command object from |
| 204 | + commander. This allows for access to the `help` commands in a programatic |
| 205 | + fashion. |
189 | 206 |
|
190 | 207 | To update to this version, any `implements CommandRunner` should be changed to
|
191 |
| - `extends CommandRunner`. If there is a `constructor` to the `CommandRunner` then it should also |
192 |
| - use `super()`. |
| 208 | + `extends CommandRunner`. If there is a `constructor` to the `CommandRunner` |
| 209 | + then it should also use `super()`. |
193 | 210 |
|
194 | 211 | ### Minor Changes
|
195 | 212 |
|
|
207 | 224 | - 2d8a143: Added support for aliased subcommands
|
208 | 225 | - 6e39331: Allow for command options to have defined choices
|
209 | 226 |
|
210 |
| - Option choices are now supported either as a static string array or via the `@OptionChoicesFor()` |
211 |
| - decorator on a class method. This decorator method approach allows for using a class's injected |
212 |
| - providers to give the chocies, which means they could come from a database or a config file |
213 |
| - somewhere if the CLI is set up to handle such a case |
| 227 | + Option choices are now supported either as a static string array or via the |
| 228 | + `@OptionChoicesFor()` decorator on a class method. This decorator method |
| 229 | + approach allows for using a class's injected providers to give the chocies, |
| 230 | + which means they could come from a database or a config file somewhere if the |
| 231 | + CLI is set up to handle such a case |
214 | 232 |
|
215 | 233 | ## 2.4.0
|
216 | 234 |
|
217 | 235 | ### Minor Changes
|
218 | 236 |
|
219 | 237 | - eaa63fb: Adds a new CliUtilityService and @InjectCommander() decorator
|
220 | 238 |
|
221 |
| - There is a new `CliUtilityService` and `@InjectCommander()` decorator that allows for direct |
222 |
| - access to the commander instance. The utility service has methods like `parseBoolean`, `parseInt`, |
223 |
| - and `parseFloat`. The number parsing methods are just simple wrappers around `Number.parse*()`, |
224 |
| - but the boolean parsing method handles true being `yes`, `y`, `1`, `true`, and `t` and false being |
225 |
| - `no`, `n`, `false`, `f`, and `0`. |
| 239 | + There is a new `CliUtilityService` and `@InjectCommander()` decorator that |
| 240 | + allows for direct access to the commander instance. The utility service has |
| 241 | + methods like `parseBoolean`, `parseInt`, and `parseFloat`. The number parsing |
| 242 | + methods are just simple wrappers around `Number.parse*()`, but the boolean |
| 243 | + parsing method handles true being `yes`, `y`, `1`, `true`, and `t` and false |
| 244 | + being `no`, `n`, `false`, `f`, and `0`. |
226 | 245 |
|
227 | 246 | ## 2.3.5
|
228 | 247 |
|
|
252 | 271 |
|
253 | 272 | ### Patch Changes
|
254 | 273 |
|
255 |
| -- 478c0d9: Make commands built with `usePlugins: true` not exit on non-found config file, just log |
256 |
| - extra data when an error happens |
| 274 | +- 478c0d9: Make commands built with `usePlugins: true` not exit on non-found |
| 275 | + config file, just log extra data when an error happens |
257 | 276 |
|
258 | 277 | ## 2.3.0
|
259 | 278 |
|
260 | 279 | ### Minor Changes
|
261 | 280 |
|
262 |
| -- 6c9eaa3: Commands can now be built with the expectation of reading in plugins to dynamically |
263 |
| - modify the CLI |
| 281 | +- 6c9eaa3: Commands can now be built with the expectation of reading in plugins |
| 282 | + to dynamically modify the CLI |
264 | 283 |
|
265 |
| - By using the `usePlugins` option for the `CommandFactory`, the built CLI can expect to find a |
266 |
| - configuration file at `nest-commander.json` (or several others, check the docs) to allow for users |
267 |
| - to plug commands in after the CLI is built. |
| 284 | + By using the `usePlugins` option for the `CommandFactory`, the built CLI can |
| 285 | + expect to find a configuration file at `nest-commander.json` (or several |
| 286 | + others, check the docs) to allow for users to plug commands in after the CLI |
| 287 | + is built. |
268 | 288 |
|
269 | 289 | - 13723bd: Subcommands can now be created
|
270 | 290 |
|
271 |
| - There's a new decorator, `@SubCommand()` for creating nested commands like `docker compose up`. |
272 |
| - There's also a new option on `@Command()` (`subCommands`) for setting up this sub command |
273 |
| - relationship. |
| 291 | + There's a new decorator, `@SubCommand()` for creating nested commands like |
| 292 | + `docker compose up`. There's also a new option on `@Command()` (`subCommands`) |
| 293 | + for setting up this sub command relationship. |
274 | 294 |
|
275 | 295 | ## 2.2.0
|
276 | 296 |
|
277 | 297 | ### Minor Changes
|
278 | 298 |
|
279 | 299 | - 3831e52: Adds a new `@Help()` decorator for custom commander help output
|
280 | 300 |
|
281 |
| - `nest-commander-testing` now also uses a `hex` instead of `utf-8` encoding when creating a random |
282 |
| - js file name during the `CommandTestFactory` command. This is to help create more predictable |
283 |
| - output names. |
| 301 | + `nest-commander-testing` now also uses a `hex` instead of `utf-8` encoding |
| 302 | + when creating a random js file name during the `CommandTestFactory` command. |
| 303 | + This is to help create more predictable output names. |
284 | 304 |
|
285 | 305 | ## 2.1.0
|
286 | 306 |
|
287 | 307 | ### Minor Changes
|
288 | 308 |
|
289 |
| -- 6df8964: Adds in a new metadata option for the @Option() decorator to make the option required, |
290 |
| - just like a required argument |
| 309 | +- 6df8964: Adds in a new metadata option for the @Option() decorator to make the |
| 310 | + option required, just like a required argument |
291 | 311 |
|
292 | 312 | ## 2.0.0
|
293 | 313 |
|
294 | 314 | ### Major Changes
|
295 | 315 |
|
296 | 316 | - ee001cc: Upgrade all Nest dependencies to version 8
|
297 | 317 |
|
298 |
| - WHAT: Upgrade `@nestjs/` dependencies to v8 and RxJS to v7 WHY: To support the latest version of |
299 |
| - Nest HOW: upgrading to Nest v8 should be all that's necessary (along with rxjs to v7) |
| 318 | + WHAT: Upgrade `@nestjs/` dependencies to v8 and RxJS to v7 WHY: To support the |
| 319 | + latest version of Nest HOW: upgrading to Nest v8 should be all that's |
| 320 | + necessary (along with rxjs to v7) |
300 | 321 |
|
301 | 322 | ## 1.3.0
|
302 | 323 |
|
303 | 324 | ### Minor Changes
|
304 | 325 |
|
305 | 326 | - f3f687b: Allow for commands to be run indefinitely
|
306 | 327 |
|
307 |
| - There is a new `runWithoutClosing` method in the `CommandFactory` class. This command allows for |
308 |
| - not having the created Nest Application get closed immediately, which should allow for the use of |
309 |
| - indefinitely runnable commands. |
| 328 | + There is a new `runWithoutClosing` method in the `CommandFactory` class. This |
| 329 | + command allows for not having the created Nest Application get closed |
| 330 | + immediately, which should allow for the use of indefinitely runnable commands. |
310 | 331 |
|
311 | 332 | ## 1.2.0
|
312 | 333 |
|
313 | 334 | ### Minor Changes
|
314 | 335 |
|
315 | 336 | - 7cce284: Add ability to use error handler for commander errors
|
316 | 337 |
|
317 |
| - Within the `CommandFactory.run()` now as a second parameter you can either keep passing just the |
318 |
| - logger, or you can pass in an object with the logger and an `errorHandler`. Ths `errorHandler` is |
319 |
| - a method that takes in an `Error` and returns `void`. The errorHandler will be passed to |
320 |
| - commander's `exitOverride` method, if it exists. This is useful for better handling errors and |
321 |
| - giving the dev more control over what is seen. There is also no longer an |
| 338 | + Within the `CommandFactory.run()` now as a second parameter you can either |
| 339 | + keep passing just the logger, or you can pass in an object with the logger and |
| 340 | + an `errorHandler`. Ths `errorHandler` is a method that takes in an `Error` and |
| 341 | + returns `void`. The errorHandler will be passed to commander's `exitOverride` |
| 342 | + method, if it exists. This is useful for better handling errors and giving the |
| 343 | + dev more control over what is seen. There is also no longer an |
322 | 344 | `unhandledPromiseRejection` on empty commands.
|
0 commit comments