Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support all the options from nest cli #15

Open
inigomarquinez opened this issue Nov 3, 2022 · 1 comment
Open

Support all the options from nest cli #15

inigomarquinez opened this issue Nov 3, 2022 · 1 comment
Assignees
Labels
cuckoojs-cli Feature related with CLI enhancement New feature or request good first issue Good for newcomers nestjs scaffolding Related with NestJS scaffolding
Milestone

Comments

@inigomarquinez
Copy link
Member

inigomarquinez commented Nov 3, 2022

When creating a new app (nest new <app>), nest cli offers several options that we should also accept to be fully compatible

@inigomarquinez inigomarquinez self-assigned this Nov 3, 2022
@neodmy
Copy link
Contributor

neodmy commented Nov 11, 2022

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:

  • Executing the new command through the NestJS CLI with the --skip-install option
  • Execute the actions (either with schematics or directly with the code on the Cuckoo CLI) to add the additional dependencies (commitlint, licence-checker, husky)
  • Depending on the presence or absence of the --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:

  • We would probably need to include the nest-cli package as a dependency in Cuckoo
  • Execute the install depending on the value of the --skip-install and the --package-manager options

The 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

@inigomarquinez inigomarquinez changed the title Support all the options fromnest cli Support all the options from nest cli Nov 17, 2022
@w3dani w3dani added cuckoojs-cli Feature related with CLI nestjs scaffolding Related with NestJS scaffolding labels Dec 12, 2022
@inigomarquinez inigomarquinez added this to the 2023 Q3 milestone Mar 27, 2023
@neodmy neodmy self-assigned this Nov 23, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cuckoojs-cli Feature related with CLI enhancement New feature or request good first issue Good for newcomers nestjs scaffolding Related with NestJS scaffolding
Projects
None yet
Development

No branches or pull requests

3 participants