unibeautify
unibeautify copied to clipboard
Error handling utility / Generate debugging information
Perhaps there should be a utility to provide error handling. This utility can accept a title, message, and stack trace and format that information properly to the executing environment whether HTML, CLI, or one of the various IDEs.
Atom-Beautify generated a Markdown file for debug information: https://github.com/Glavin001/atom-beautify/blob/master/src/beautify.coffee#L288-L509
With Unibeautify, I would like to build debugging into the core, and export as JSON. Then the JSON can be read by https://github.com/Unibeautify/assistant and the user has an interact assistant to help them resolve their issue.
For the moment I am using a micro-utility to provide support for this: https://github.com/Unibeautify/parse-framework/blob/master/services.ts#L187-L205
But I could probably spin this out to be an external utility that accepts a callback.
No need. Unibeautify is going to need fairly unique debugging information being returned, such as the intermediate results from multiple beautifiers in series (see #4 ) and more.
I may start working on this task soon since debugging is very important.
- Editors will need to provide some info: Version information such as atom, apm, electron, npm, etc.
- Stack traces, would they come from editors or Unibeautify core? Or both?
- JSON output would be inserted into https://assistant.unibeautify.com/#/debug. Maybe see if we can launch the user's browser to that page upon a debug request with the JSON already there?
- For Atom specifically, I'm watching https://github.com/atom/town-crier to see if any services are ever implemented. Would be nice to auto-generate an issue based off of a nice form
Town Crier looks beautiful.
The checklist you have above is great! I have been thinking we should also report the version of package dependencies, too, such as prettier
and js-beautify
, etc. And also intermediate steps, such as when beautifiers: ["Prettier", "JS-Beautify"]
is configured, it beautifies twice and could be problems with either. I would also like the Assistant to guide the user to determine which beautifier, if any, was the culprit and then report to those instead of the Unibeautify core.
Right, Unibeautify core would just be responsible for gathering the information and generating the JSON. Assistant would read it and guide users through the issue.