Closed micalevisk closed 1 year ago
when the app isn't in a monorepo mode, nest g config will create a file called undefined/nest-cli.json
nest g config
undefined/nest-cli.json
That's because the following IF is returning false. And the project option is not being equals to "." (as I expect) for this scenario
false
project
"."
https://github.com/nestjs/nest-cli/blob/ddcaaa1f194a6f869b39c2f539ef43c2b82bbee2/actions/generate.action.ts#L77
https://github.com/nestjs/typescript-starter
git clone https://github.com/nestjs/typescript-starter cd typescript-starter npm i npx nest g config
Note that that project isn't in a monorepo mode
it generates the file undefined/nest-cli.json
if we already has a nest-cli.json in our project, I'd see an error (from angular schematics). If not, a file nest-cli.json will be created. Basically, the options.project should be "." here: https://github.com/nestjs/schematics/blob/07be8d05ae1b78c46267a31bfca8e711e682214a/src/lib/configuration/configuration.factory.ts#L33
nest-cli.json
options.project
To easily fix that, we could just change that line to options.project || "." but I'm not sure if this seems correct from the schematics PoV
options.project || "."
10.1.10
No response
Would you like to create a PR for this issue?
Sounds reasonable
Is there an existing issue for this?
Current behavior
when the app isn't in a monorepo mode,
nest g config
will create a file calledundefined/nest-cli.json
That's because the following IF is returning
false
. And theproject
option is not being equals to"."
(as I expect) for this scenariohttps://github.com/nestjs/nest-cli/blob/ddcaaa1f194a6f869b39c2f539ef43c2b82bbee2/actions/generate.action.ts#L77
Minimum reproduction code
https://github.com/nestjs/typescript-starter
Steps to reproduce
Note that that project isn't in a monorepo mode
it generates the file
undefined/nest-cli.json
Expected behavior
if we already has a
nest-cli.json
in our project, I'd see an error (from angular schematics). If not, a filenest-cli.json
will be created. Basically, theoptions.project
should be"."
here: https://github.com/nestjs/schematics/blob/07be8d05ae1b78c46267a31bfca8e711e682214a/src/lib/configuration/configuration.factory.ts#L33To easily fix that, we could just change that line to
options.project || "."
but I'm not sure if this seems correct from the schematics PoVPackage version
10.1.10
NestJS version
No response
Node.js version
No response
In which operating systems have you tested?
Other
No response