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

Document nest new --strict and propose its usage in docs #2368

Closed
1 of 5 tasks
j1elo opened this issue Jun 23, 2022 · 4 comments · Fixed by #2403
Closed
1 of 5 tasks

Document nest new --strict and propose its usage in docs #2368

j1elo opened this issue Jun 23, 2022 · 4 comments · Fixed by #2403

Comments

@j1elo
Copy link

j1elo commented Jun 23, 2022

I'm submitting a...

  • Regression
  • Bug report
  • Feature request
  • Documentation issue or request (new chapter/page)
  • Support request => Please do not submit support request here, instead post your question on Stack Overflow.

Current behavior

Several issues:

  1. The --strict flag on nest new --strict was added in nestjs/nest-cli#1344 but this wasn't accompanied with a corresponding update of the docs.
  2. Introductory pages keep suggesting to create new NestJS projects with nest new project-name, without mentioning the possibility of using --strict, which is actually a very desirable thing to do for most new projects for devs that care about proper type safety. As a consequence, the possibility of --strict is lost even for seasoned TypeScript programmers who are new to NestJS.

Expected behavior

  1. Document the --strict flag on the command reference page: CLI / Usage / nest new.
  2. Propose using the command nest new --strict project-name in introductory pages: Introduction / Installation and Overview / First steps / Setup. Possibly adding a note, stating that for devs who are new to TypeScript, they might want to ease their learning curve by skipping the --strict flag, but that doing so is not recommended for stronger type safety.

Minimal reproduction of the problem with instructions

N/A

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

  • Better discoverability of the --strict flag.
  • Promotion of better defaults for new projects, by encouraging to enable strict null checks on new projects.

Environment

For Tooling issues:

N/A

Others:

N/A

@kamilmysliwiec
Copy link
Member

We could add info blockquotes informing about the --strict flag right below the code samples (that showcase nest new)

Would you like to create a PR for this?

@j1elo
Copy link
Author

j1elo commented Jun 23, 2022

I've grepped a bit and found these usages of info blockquotes:

> error **Warning**
> info **hint**
> info **Hint**
> info **info**
> info **Info**
> info **Note**
> info **Notice**
> info **Warning**
> warn **Warning**
> warning **Note**
> warning **Notice**
> warning **warning**
> warning **Warning**
> Warning **Warning**

(notice how there's a bit of inconsistency because some of those usages mix casing, those could maybe be cleaned up)

Which kind do you think would be more appropriate for this?

On the other hand, I've searched actual usages of nest new that would be relevant for users learning about NestJS, and there seems to be quite a bit of repetition all around, however it seems relevant to include this flag and warning in a bit too many places, I think:

And optionally, maybe not so much needed at this point, but still definitively an usage of nest new:

My feeling is that docs could probably benefit from a small restructuring, where there is a single point explaining how to make a new project, and all the other places just refer back to it.

To that extent, "Introduction" and "First steps" are kinda overlapping, and feels like if the introduction should just stop after the "Philosophy" section and then send users to the "First steps", where the appropriate creation flags could be pointed out.

@kamilmysliwiec
Copy link
Member

If we add this hint there:

we should be fine.

Which kind do you think would be more appropriate for this?

"> info Hint" sounds reasonable.

My feeling is that docs could probably benefit from a small restructuring, where there is a single point explaining how to make a new project, and all the other places just refer back to it.

We currently have no plans to make any changes to the structure of the Overview & First steps & Introduction pages.

@j1elo
Copy link
Author

j1elo commented Jun 24, 2022

Ok thanks for the guidance. Note that I'll be out for the following days, so I will be able to make a PR on Wednesday next week. Cheers.

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

Successfully merging a pull request may close this issue.

2 participants