From bf4667f337ce47f838097958225ad1f8aaffa150 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 1 Jul 2024 12:56:53 +0000 Subject: [PATCH] Version Packages --- .changeset/twelve-rabbits-nail.md | 6 - packages/nest-commander/CHANGELOG.md | 168 +++++++++++++++------------ packages/nest-commander/package.json | 2 +- 3 files changed, 96 insertions(+), 80 deletions(-) delete mode 100644 .changeset/twelve-rabbits-nail.md diff --git a/.changeset/twelve-rabbits-nail.md b/.changeset/twelve-rabbits-nail.md deleted file mode 100644 index 665607fb..00000000 --- a/.changeset/twelve-rabbits-nail.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -'nest-commander': minor ---- - -feat: Add option for Help Configuration using the .configureHelp() function in -commander js diff --git a/packages/nest-commander/CHANGELOG.md b/packages/nest-commander/CHANGELOG.md index 3ae42af9..d8f6927e 100644 --- a/packages/nest-commander/CHANGELOG.md +++ b/packages/nest-commander/CHANGELOG.md @@ -1,18 +1,25 @@ # nest-commander +## 3.14.0 + +### Minor Changes + +- 1cdac14: feat: Add option for Help Configuration using the .configureHelp() + function in commander js + ## 3.13.0 ### Minor Changes -- c29737c: Enhance filesystem autocomplete support for Bash and Zsh by introducing an - opt-in option based on an environment variable. +- c29737c: Enhance filesystem autocomplete support for Bash and Zsh by + introducing an opt-in option based on an environment variable. ## 3.12.5 ### Patch Changes -- 72b2a00: Move the fig completion package to an optional import to get around jest - throwing an error about esm packages +- 72b2a00: Move the fig completion package to an optional import to get around + jest throwing an error about esm packages ## 3.12.4 @@ -24,7 +31,8 @@ ### Patch Changes -- e66901a: update package @fig/complete-commander to v3.0.0 to support commander v11 +- e66901a: update package @fig/complete-commander to v3.0.0 to support commander + v11 ## 3.12.2 @@ -36,7 +44,8 @@ ### Patch Changes -- a3b683d: Remap the options to the name passed in the `@Options()` decorator, if provided +- a3b683d: Remap the options to the name passed in the `@Options()` decorator, + if provided ## 3.12.0 @@ -48,8 +57,8 @@ ### Patch Changes -- 8cc3109: The CommandRunnerService now re-throws the error regardless of the contents, it - just adds a new log above the error as well +- 8cc3109: The CommandRunnerService now re-throws the error regardless of the + contents, it just adds a new log above the error as well ## 3.11.0 @@ -76,29 +85,30 @@ ### Minor Changes -- 6cc1112: Add ability to pass NestApplicationContextOptions to CommandFactoryRunOptions. +- 6cc1112: Add ability to pass NestApplicationContextOptions to + CommandFactoryRunOptions. - Now CommandFactory.createWithoutRunning() can accept more options, for example, - bufferLogs to pre-save Nest startup logs. + Now CommandFactory.createWithoutRunning() can accept more options, for + example, bufferLogs to pre-save Nest startup logs. ## 3.7.1 ### Patch Changes -- 1ceab9d: Log error and stack wtih custom error message instead of just custom error - message +- 1ceab9d: Log error and stack wtih custom error message instead of just custom + error message ## 3.7.0 ### Minor Changes -- 9a5f555: Add a new method to create an application but nott run it in case of needing to - modify the logger or similar situations. +- 9a5f555: Add a new method to create an application but nott run it in case of + needing to modify the logger or similar situations. Now the `CommandFactory.createWithoutRunning()` method can be used to create a - Nest commander application without running the `commandRunner.run()`. To run the - newly created application, `CommandFactory.runApplicaiton(app)` can be called. I - may change this to be a simple `app.run()` in the future. + Nest commander application without running the `commandRunner.run()`. To run + the newly created application, `CommandFactory.runApplicaiton(app)` can be + called. I may change this to be a simple `app.run()` in the future. ## 3.6.3 @@ -116,7 +126,8 @@ ### Patch Changes -- c35e8cc: Fixed issue with parsing serviceErrorHandler option to properly override default behaviour +- c35e8cc: Fixed issue with parsing serviceErrorHandler option to properly + override default behaviour ## 3.6.0 @@ -124,25 +135,27 @@ - 7f54ff8: Add serviceErrorHandler option - This option allows for catching and handling errors at the Nest service execution level so that - lifecycle hooks still properly work. By default it is set to - `(err: Error) => process.stderr.write(err.toString())`. + This option allows for catching and handling errors at the Nest service + execution level so that lifecycle hooks still properly work. By default it is + set to `(err: Error) => process.stderr.write(err.toString())`. - 09b6134: Add the ability to have a Root command - With the `@RootCommand()` the `-h` flag can now output the options of the default command _along - with_ the names of the other commands. + With the `@RootCommand()` the `-h` flag can now output the options of the + default command _along with_ the names of the other commands. ## 3.5.0 ### Minor Changes -- d2e5fc8: Allow for use of request scoped providers through a new module decorator +- d2e5fc8: Allow for use of request scoped providers through a new module + decorator - By making use of the `@RequestModule()` decorator for modules, as mock request object can be set - as a singleton to help the use of `REQUEST` scoped providers in a singleton context. There's now - also an error that is logged in the case of a property of `undefined` being called, as this is - usually indicative of a `REQUEST` scoped provider being called from a `SINGLETON` context. + By making use of the `@RequestModule()` decorator for modules, as mock request + object can be set as a singleton to help the use of `REQUEST` scoped providers + in a singleton context. There's now also an error that is logged in the case + of a property of `undefined` being called, as this is usually indicative of a + `REQUEST` scoped provider being called from a `SINGLETON` context. ## 3.4.0 @@ -150,20 +163,22 @@ - fadb70d: Allow for a sub command to be set as the default sub command. - 74c88f5: Add new api registerWithSubCommand to CommandRunner Class -- abff78d: Allow for options to be parsed positionally via an option passed to CommandFactory +- abff78d: Allow for options to be parsed positionally via an option passed to + CommandFactory ## 3.3.0 ### Minor Changes -- 8c639d3: fix: update module resolution to node16 so dynamic imports are not transpiled out during - TS build +- 8c639d3: fix: update module resolution to node16 so dynamic imports are not + transpiled out during TS build ## 3.2.1 ### Patch Changes -- 5c089a6: Fixed an issue preventing use of ESM packages as plugins in the command factory +- 5c089a6: Fixed an issue preventing use of ESM packages as plugins in the + command factory ## 3.2.0 @@ -181,15 +196,17 @@ ### Major Changes -- d6ebe0e: Migrate `CommandRunner` from interface to abstract class and add `.command` +- d6ebe0e: Migrate `CommandRunner` from interface to abstract class and add + `.command` - This change was made so that devs could access `this.command` inside the `CommandRunner` instance - and have access to the base command object from commander. This allows for access to the `help` - commands in a programatic fashion. + This change was made so that devs could access `this.command` inside the + `CommandRunner` instance and have access to the base command object from + commander. This allows for access to the `help` commands in a programatic + fashion. To update to this version, any `implements CommandRunner` should be changed to - `extends CommandRunner`. If there is a `constructor` to the `CommandRunner` then it should also - use `super()`. + `extends CommandRunner`. If there is a `constructor` to the `CommandRunner` + then it should also use `super()`. ### Minor Changes @@ -207,10 +224,11 @@ - 2d8a143: Added support for aliased subcommands - 6e39331: Allow for command options to have defined choices - Option choices are now supported either as a static string array or via the `@OptionChoicesFor()` - decorator on a class method. This decorator method approach allows for using a class's injected - providers to give the chocies, which means they could come from a database or a config file - somewhere if the CLI is set up to handle such a case + Option choices are now supported either as a static string array or via the + `@OptionChoicesFor()` decorator on a class method. This decorator method + approach allows for using a class's injected providers to give the chocies, + which means they could come from a database or a config file somewhere if the + CLI is set up to handle such a case ## 2.4.0 @@ -218,11 +236,12 @@ - eaa63fb: Adds a new CliUtilityService and @InjectCommander() decorator - There is a new `CliUtilityService` and `@InjectCommander()` decorator that allows for direct - access to the commander instance. The utility service has methods like `parseBoolean`, `parseInt`, - and `parseFloat`. The number parsing methods are just simple wrappers around `Number.parse*()`, - but the boolean parsing method handles true being `yes`, `y`, `1`, `true`, and `t` and false being - `no`, `n`, `false`, `f`, and `0`. + There is a new `CliUtilityService` and `@InjectCommander()` decorator that + allows for direct access to the commander instance. The utility service has + methods like `parseBoolean`, `parseInt`, and `parseFloat`. The number parsing + methods are just simple wrappers around `Number.parse*()`, but the boolean + parsing method handles true being `yes`, `y`, `1`, `true`, and `t` and false + being `no`, `n`, `false`, `f`, and `0`. ## 2.3.5 @@ -252,25 +271,26 @@ ### Patch Changes -- 478c0d9: Make commands built with `usePlugins: true` not exit on non-found config file, just log - extra data when an error happens +- 478c0d9: Make commands built with `usePlugins: true` not exit on non-found + config file, just log extra data when an error happens ## 2.3.0 ### Minor Changes -- 6c9eaa3: Commands can now be built with the expectation of reading in plugins to dynamically - modify the CLI +- 6c9eaa3: Commands can now be built with the expectation of reading in plugins + to dynamically modify the CLI - By using the `usePlugins` option for the `CommandFactory`, the built CLI can expect to find a - configuration file at `nest-commander.json` (or several others, check the docs) to allow for users - to plug commands in after the CLI is built. + By using the `usePlugins` option for the `CommandFactory`, the built CLI can + expect to find a configuration file at `nest-commander.json` (or several + others, check the docs) to allow for users to plug commands in after the CLI + is built. - 13723bd: Subcommands can now be created - There's a new decorator, `@SubCommand()` for creating nested commands like `docker compose up`. - There's also a new option on `@Command()` (`subCommands`) for setting up this sub command - relationship. + There's a new decorator, `@SubCommand()` for creating nested commands like + `docker compose up`. There's also a new option on `@Command()` (`subCommands`) + for setting up this sub command relationship. ## 2.2.0 @@ -278,16 +298,16 @@ - 3831e52: Adds a new `@Help()` decorator for custom commander help output - `nest-commander-testing` now also uses a `hex` instead of `utf-8` encoding when creating a random - js file name during the `CommandTestFactory` command. This is to help create more predictable - output names. + `nest-commander-testing` now also uses a `hex` instead of `utf-8` encoding + when creating a random js file name during the `CommandTestFactory` command. + This is to help create more predictable output names. ## 2.1.0 ### Minor Changes -- 6df8964: Adds in a new metadata option for the @Option() decorator to make the option required, - just like a required argument +- 6df8964: Adds in a new metadata option for the @Option() decorator to make the + option required, just like a required argument ## 2.0.0 @@ -295,8 +315,9 @@ - ee001cc: Upgrade all Nest dependencies to version 8 - WHAT: Upgrade `@nestjs/` dependencies to v8 and RxJS to v7 WHY: To support the latest version of - Nest HOW: upgrading to Nest v8 should be all that's necessary (along with rxjs to v7) + WHAT: Upgrade `@nestjs/` dependencies to v8 and RxJS to v7 WHY: To support the + latest version of Nest HOW: upgrading to Nest v8 should be all that's + necessary (along with rxjs to v7) ## 1.3.0 @@ -304,9 +325,9 @@ - f3f687b: Allow for commands to be run indefinitely - There is a new `runWithoutClosing` method in the `CommandFactory` class. This command allows for - not having the created Nest Application get closed immediately, which should allow for the use of - indefinitely runnable commands. + There is a new `runWithoutClosing` method in the `CommandFactory` class. This + command allows for not having the created Nest Application get closed + immediately, which should allow for the use of indefinitely runnable commands. ## 1.2.0 @@ -314,9 +335,10 @@ - 7cce284: Add ability to use error handler for commander errors - Within the `CommandFactory.run()` now as a second parameter you can either keep passing just the - logger, or you can pass in an object with the logger and an `errorHandler`. Ths `errorHandler` is - a method that takes in an `Error` and returns `void`. The errorHandler will be passed to - commander's `exitOverride` method, if it exists. This is useful for better handling errors and - giving the dev more control over what is seen. There is also no longer an + Within the `CommandFactory.run()` now as a second parameter you can either + keep passing just the logger, or you can pass in an object with the logger and + an `errorHandler`. Ths `errorHandler` is a method that takes in an `Error` and + returns `void`. The errorHandler will be passed to commander's `exitOverride` + method, if it exists. This is useful for better handling errors and giving the + dev more control over what is seen. There is also no longer an `unhandledPromiseRejection` on empty commands. diff --git a/packages/nest-commander/package.json b/packages/nest-commander/package.json index 801fa8be..aa3d33ac 100644 --- a/packages/nest-commander/package.json +++ b/packages/nest-commander/package.json @@ -1,6 +1,6 @@ { "name": "nest-commander", - "version": "3.13.0", + "version": "3.14.0", "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.", "repository": { "type": "github",