Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upDiagnostics CLI: Add "Success" output message when no errors found #970
Comments
|
Good idea :).
When thinking about where and when the checks should happen, consider the following:
Visually, we could group errors by categories. For example:
Maybe rw diagnostics could take options. So, for example, '$rw diagnostics --full` would try to cycle through all the tools, including eslint. |
aldonline
mentioned this issue
^^ I really like this. And it feels on target with the RW v1 goal of consolidating error messaging. If we do rename the CLI command to
For the Output, I like the idea of a Summary. Assuming we start with output for each check/step that's run, I could see the Summary grouping a bit tighter, e.g.: $ rw check
...
[task output]
[task output]
etc
...
SUMMARY
- **Redwood Core Diagnostics** [2 Warnings, 1 Error]
- _warning_: Your env vars are missing
- _warning_: Name your queries
- _error_: missing redwood.toml
- **Typescript** [1 Warning]
- _warning_: gratuitous use of 'any'
- **Prisma** [All Good] |
|
@aldonline @thedavidprice I am interested in working on this ticket. Can you clarify if this ticket is just adding the success message when |
|
@M0nica nice! This is very needed.
^^ This is definitely still up for discussion. It would be very helpful if you could help outline a plan for this:
^^ I'd vote we organize here in this Issue, including the work on the next-step PR. The conversation will naturally move over to the PR, at which time we can create a new tracking Issue for next steps (if applicable). When the next-step PR is merged, this Issue can be closed and we'll have the new Issue open. Making sense? Ideas/suggestions about improving this or other options? |
|
I think implementing these enhancements could be implemented between four tickets (1) improve the success state by making it more clear, 2) reformatting the CLI output, and 3 + 4)enhancing the diagnostics to include Prisma and TypeScript checks which could be worked on concurrently).
|
|
Hi @M0nica Huge thanks for moving this forward! I'll comment on plan items 2 - 4 in a next reply. For now, I'd say go ahead with Step 1 (from above):
This would be soooo helpful |
|
Looping in @aldonline for thoughts on proposed plan items 2 - 4 (above).
^^ yes, I believe your understanding is correct — just focus on the diagnostics coming directly from the structure package. The current Catch 22 is that there is not a lot of diagnostic coverage yet because people don't actually know about this tool and are not yet using the VS Code extension. Once usage goes up, the kinds and quantities of diagnostics will go up. It's likely that over time there will be a natural grouping/categorization within the Core Diagnostics that emerges over time. But not yet. In summary, I think you've outlined an appropriate approach to step 2.
I'll defer to @aldonline on specifics here as I'm not familiar enough with TSC checks. Now looking more closely, I’m wondering if it even makes sense to include TSC check along with RW Diagnostics? This feels a bit redundant to me in case of using an editor like VS Code, which will do similar checking. Also, there a future plans to include this Diagnostics check in a GH Action workflow for Redwood Project CI. The CI will also separately run Build and Lint — maybe that's the right place to run TSC, which could also be easily removed from the runner if not needed?
^^ Similar thoughts on my part here as for number 3. Also, not all Redwood projects will use Prisma (or have an API). So just not sure if it's necessary. |
M0nica
mentioned this issue
|
Two quick ideas after seeing #1405
|
|
I think the |
^^ I was thinking to just output it all and see what indeed comes out, firehose style. Given your example, it would probably need a prefix to indicate it's just the step and not the result. Like I didn't look at the code before adding this idea. If this requires refactoring, I'm not sure it's of high enough value. (Although there are not too many checks yet, correct?) |
|
Right now the structure for the diagnostic checks (at least for /routes) is such that if the condition is met that causes a check to fail then an error is thrown with a string like |
|
Ah, very helpful. And in that case, I'd vote to put this idea in the proverbial hopper for now. Thanks! |

Formed in 2009, the Archive Team (not to be confused with the archive.org Archive-It Team) is a rogue archivist collective dedicated to saving copies of rapidly dying or deleted websites for the sake of history and digital heritage. The group is 100% composed of volunteers and interested parties, and has expanded into a large amount of related projects for saving online and digital history.


Currently, the CLI diagnostics command does not return output when no warnings or errors are found. Example:
$ yarn rw diagnostics yarn run v1.22.4 $ /Users/price/Repos/create-redwood-app/node_modules/.bin/rw diagnostics ✨ Done in 3.07s.This can cause confusion as to whether anything was run at all and if the project is ok. Improved output may include: