Open inigomarquinez opened 2 years ago
The NestJS CLI supports the following options for the new
command:
--dry-run
--skip-git
--skip-install
--package-manager
--language
--collection
--strict
From that list, the NestJS application schematic supports the following:
packageManager
language
strict
It means that the following are additional actions taken care of by the NestJS CLI:
--dry-run
--skip-git
--skip-install
--collection
Since our primary goal is to generate as few dependencies as possible to the NestJS CLI in Cuckoo while maintaining compatibility, it might be worth considering using the NestJS CLI programmatically instead of the NestJS application
schematic. In that case, we could change the way we handle the new
command in Cuckoo by:
new
command through the NestJS CLI with the --skip-install
optioncommitlint
, licence-checker
, husky
)--skip-install
passed to Cuckoo CLI, execute the installation of the packages (which will also depend on the package manager chosen)The downsides of this approach are:
nest-cli
package as a dependency in Cuckoo--skip-install
and the --package-manager
optionsThe alternative would be that we still use the application
schematic to generate the NestJS application. However, we would still need to take care of the additional actions not supported by the such schematic. In my opinion, this approach generates more coupling to the Nest CLI and unnecessary replication of the code that is already present on the NestJS CLI.
cc/ @inigomarquinez
When creating a new app (
nest new <app>)
, nest cli offers several options that we should also accept to be fully compatible