nestjs/nest-cli

Sort apps and libs by name to avoid git conflict

Closed this issue · 1 comments

xpol commented

Is there an existing issue that is already proposing this?

  • I have searched the existing issues

Is your feature request related to a problem? Please describe it

In a nest mono repo project, nest cli currently append new app/libs at the end of:

  • projects in thenest-cli.json
  • compilerOptions.path in the tsconfig.json
  • jest.moduleNameMapper in the package.json

This will:

  • always need change last line of json to append a ,
  • always cause git conflict when merging 2 branches both added an new app or lib.

Describe the solution you'd like

If we can sort those objects by keys will greatly help avoid git conflict and avoid unnecessary changing of previous line.

Teachability, documentation, adoption, migration strategy

No response

What is the motivation / use case for changing the behavior?

Each time nest cli tries to write above json files, it should sort above objects before write.

xpol commented

Moved this issue to nestjs/schematics#1956.