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

nest-cli.json validation #692

Closed
maximelkin opened this issue Apr 25, 2020 · 7 comments
Closed

nest-cli.json validation #692

maximelkin opened this issue Apr 25, 2020 · 7 comments

Comments

@maximelkin
Copy link

I'm submitting a...


[ ] Regression 
[ ] Bug report
[x] Feature request
[ ] Documentation issue or request
[ ] Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

You can write any extra properties and they will be just ignored

Expected behavior

nest-cli.json could be validated

Minimal reproduction of the problem with instructions

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

You can mistype parameters, i.e. put in wrong place or make a typo, and cli dont warn about it

i.e. I spent some time to figure out what "plugins" must be in compilerOptions

Environment


I would also be happy to see jsonschema for autocomplete in IDE for this file

@YashKumarVerma
Copy link

I'm interested in working on this using either ajv or cfworker if the former doesn't fit our needs.

Are there any particulars to keep in mind while implementing the same @kamilmysliwiec?

@kamilmysliwiec
Copy link
Member

PRs are more than welcome @YashKumarVerma! Feel free to proceed with whatever you think is best. Also, I think we should define a configuration JSON schema too https://json-schema.org/learn/getting-started-step-by-step.html (similarly to what Angular does with their CLI configuration file)

@YashKumarVerma
Copy link

YashKumarVerma commented Dec 11, 2020

Sounds good! Also, is there any reference in the current documentation or codebase where I could find the possible configuration variations. (i believe this doesn't exist as of now, just confirming before doing it).

@kamilmysliwiec
Copy link
Member

https://docs.nestjs.com/cli/monorepo#cli-properties

and plugins:

https://docs.nestjs.com/graphql/cli-plugin#using-the-cli-plugin

:)

@DevDengChao
Copy link

I just made a PR (SchemaStore/schemastore#1947) to add more descriptions to nest-cli.json's properties and I wonder if any member of NestJS can review those changes and figure out any mistakes.

@DevDengChao
Copy link

DevDengChao commented Dec 1, 2021

SchemaStore/schemastore#1947 is merged, your IDE (eg: WebStorm) will be able to give you suggestions when writing nest-cli.json if it uses SchemaStore's definition.

@kamilmysliwiec
Copy link
Member

Awesome, thank you! Let's also track validation feature here #1427

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants