Skip to content

Commit 0f34d53

Browse files
authored
Version Packages (#1151)
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and the packages will be published to npm automatically. If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## nest-commander@3.14.0 ### Minor Changes - 1cdac14: feat: Add option for Help Configuration using the .configureHelp() function in commander js
2 parents 07723b6 + bf4667f commit 0f34d53

File tree

3 files changed

+96
-80
lines changed

3 files changed

+96
-80
lines changed

.changeset/twelve-rabbits-nail.md

Lines changed: 0 additions & 6 deletions
This file was deleted.

packages/nest-commander/CHANGELOG.md

Lines changed: 95 additions & 73 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,25 @@
11
# nest-commander
22

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+
310
## 3.13.0
411

512
### Minor Changes
613

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.
916

1017
## 3.12.5
1118

1219
### Patch Changes
1320

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
1623

1724
## 3.12.4
1825

@@ -24,7 +31,8 @@
2431

2532
### Patch Changes
2633

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
2836

2937
## 3.12.2
3038

@@ -36,7 +44,8 @@
3644

3745
### Patch Changes
3846

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
4049

4150
## 3.12.0
4251

@@ -48,8 +57,8 @@
4857

4958
### Patch Changes
5059

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
5362

5463
## 3.11.0
5564

@@ -76,29 +85,30 @@
7685

7786
### Minor Changes
7887

79-
- 6cc1112: Add ability to pass NestApplicationContextOptions to CommandFactoryRunOptions.
88+
- 6cc1112: Add ability to pass NestApplicationContextOptions to
89+
CommandFactoryRunOptions.
8090

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.
8393

8494
## 3.7.1
8595

8696
### Patch Changes
8797

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
90100

91101
## 3.7.0
92102

93103
### Minor Changes
94104

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.
97107

98108
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.
102112

103113
## 3.6.3
104114

@@ -116,54 +126,59 @@
116126

117127
### Patch Changes
118128

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
120131

121132
## 3.6.0
122133

123134
### Minor Changes
124135

125136
- 7f54ff8: Add serviceErrorHandler option
126137

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())`.
130141

131142
- 09b6134: Add the ability to have a Root command
132143

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.
135146

136147
## 3.5.0
137148

138149
### Minor Changes
139150

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
141153

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.
146159

147160
## 3.4.0
148161

149162
### Minor Changes
150163

151164
- fadb70d: Allow for a sub command to be set as the default sub command.
152165
- 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
154168

155169
## 3.3.0
156170

157171
### Minor Changes
158172

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
161175

162176
## 3.2.1
163177

164178
### Patch Changes
165179

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
167182

168183
## 3.2.0
169184

@@ -181,15 +196,17 @@
181196

182197
### Major Changes
183198

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`
185201

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.
189206

190207
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()`.
193210

194211
### Minor Changes
195212

@@ -207,22 +224,24 @@
207224
- 2d8a143: Added support for aliased subcommands
208225
- 6e39331: Allow for command options to have defined choices
209226

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
214232

215233
## 2.4.0
216234

217235
### Minor Changes
218236

219237
- eaa63fb: Adds a new CliUtilityService and @InjectCommander() decorator
220238

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`.
226245

227246
## 2.3.5
228247

@@ -252,71 +271,74 @@
252271

253272
### Patch Changes
254273

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
257276

258277
## 2.3.0
259278

260279
### Minor Changes
261280

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
264283

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.
268288

269289
- 13723bd: Subcommands can now be created
270290

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.
274294

275295
## 2.2.0
276296

277297
### Minor Changes
278298

279299
- 3831e52: Adds a new `@Help()` decorator for custom commander help output
280300

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.
284304

285305
## 2.1.0
286306

287307
### Minor Changes
288308

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
291311

292312
## 2.0.0
293313

294314
### Major Changes
295315

296316
- ee001cc: Upgrade all Nest dependencies to version 8
297317

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)
300321

301322
## 1.3.0
302323

303324
### Minor Changes
304325

305326
- f3f687b: Allow for commands to be run indefinitely
306327

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.
310331

311332
## 1.2.0
312333

313334
### Minor Changes
314335

315336
- 7cce284: Add ability to use error handler for commander errors
316337

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
322344
`unhandledPromiseRejection` on empty commands.

packages/nest-commander/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "nest-commander",
3-
"version": "3.13.0",
3+
"version": "3.14.0",
44
"description": "A module for making CLI applications with NestJS. Decorators for running commands and separating out config parsers included. This package works on top of commander.",
55
"repository": {
66
"type": "github",

0 commit comments

Comments
 (0)