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

Improve terminal output #42

Open
umaar opened this issue Jan 19, 2018 · 2 comments
Open

Improve terminal output #42

umaar opened this issue Jan 19, 2018 · 2 comments

Comments

@umaar
Copy link
Member

umaar commented Jan 19, 2018

Had some ideas for potential improvements for the development build output. Also I should say, I'm of the mindset of keeping terminal output from developer tooling very minimal. It's something ava does well.

Here's a screenshot from my terminal output, with one linting error:

image

If for example I omit a semi colon from a line of JavaScript, I see:

✖ errors: 2
⚠ warnings: 0

errors:
./src/main.ts
Module build failed: Error: Compilation failed due to tslint errors.
    at report (/Users/umarhansa/development/dojo-devtool-todomvc/app/node_modules/tslint-loader/index.js:93:11)
    at lint (/Users/umarhansa/development/dojo-devtool-todomvc/app/node_modules/tslint-loader/index.js:74:3)
    at Object.module.exports (/Users/umarhansa/development/dojo-devtool-todomvc/app/node_modules/tslint-loader/index.js:140:3)
@ multi ./src/main.css ./src/main.ts,./src/main.ts
[15, 32]: Missing semicolon

@ multi ./src/main.css ./src/main.ts
  1. Errors shows '2' but there is only one.
  2. If warnings is '0' I don't see any need in showing that label
  3. Module build failed: Error: Compilation failed due to tslint errors. I don't think a linter should prevent the build, since I feel it's normal during development to not adhere to linting rules, but still want to see the webpage in your browser. Maybe the build could fail, but can still build the assets so it can be viewed?
errors:
./src/main.ts
Module build failed: Error: Compilation failed due to tslint errors.

I feel this output can be kept minimal, for example, could that whole section be replaced with:

Compilation failed due to tslint errors.
  1. The stack trace is quite distracting (long line length, and red):
    at report (/Users/umarhansa/development/dojo-devtool-todomvc/app/node_modules/tslint-loader/index.js:93:11)
    at lint (/Users/umarhansa/development/dojo-devtool-todomvc/app/node_modules/tslint-loader/index.js:74:3)
    at Object.module.exports (/Users/umarhansa/development/dojo-devtool-todomvc/app/node_modules/tslint-loader/index.js:140:3)

Maybe we could hide it?

  1. The main tslint issue:
@ multi ./src/main.css ./src/main.ts,./src/main.ts
[15, 32]: Missing semicolon

@ multi ./src/main.css ./src/main.ts

I feel the '@' symbols are redundant, don't think the word 'multi' needs to be there? And it's confusing to figure out what file contains the error!

  1. The asset output:
chunks:
main     runtime
assets:
index.html (0.36kb) / (0.25kb gz)                                             main.8d59fede549628a868e4.bundle.js (141.46kb) / (36.74kb gz)                 runtime.d41d8cd98f00b204e980.bundle.js (1.73kb) / (0.97kb gz)
main.0d78d4c854229f19f2fe03e6ab78d9f8.bundle.css (6.50kb) / (1.93kb gz)       main.8d59fede549628a868e4.bundle.js.map (551.18kb) / (140.68kb gz)            runtime.d41d8cd98f00b204e980.bundle.js.map (7.85kb) / (2.69kb gz)
main.0d78d4c854229f19f2fe03e6ab78d9f8.bundle.css.map (10.50kb) / (2.59kb gz)  manifest.json (0.38kb) / (0.16kb gz)
output at: file:////Users/umarhansa/development/dojo-devtool-todomvc/app/output/dist

Not sure it's necessary to see all of this info? For example seeing manifest.json (0.38kb) / (0.16kb gz) is not useful? Same with source map files. Maybe a verbose flag for all that info is better?

  1. Hash
ℹ cli-build-app: 0.0.1
ℹ typescript: 2.6.2
✔ hash: cdcde3fc9ce6dcf2d5f4
✖ errors: 2
⚠ warnings: 0

Not sure the hash is useful to see?

@steveoh
Copy link

steveoh commented Apr 4, 2018

I very much agree with everything stated here. I also wanted to mention that the output at: file:///Users... location is incorrect. I do not see it on my file system and cd'ing to the folder says it does not exist. Is it because the 4 //// is invalid and it should only be 2? Either way it's wrong.

Where is it going?

@samends
Copy link

samends commented Sep 25, 2020

Looking at this issue believe the following can be updated

  • Log all errors not just last one
  • Hide warnings message if no warnings exist
  • Hide some output details behind verbose flag

I feel the build should fail if there are errors in the typing, this prevents more errors from slipping in the code. The stack trace, while long, can give helpful hints sometimes in detecting the error.

@agubler would you know the significance of multi in the @ multi log?

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