dojo / dojo/cli-build-app

Improve terminal output

Open
#42 2 comments 1 reaction 0 assignees View on GitHub
discussion enhancement
Dominant language
TypeScript
Stars
9
Forks
28
PR merge metrics
No merged PRs in 30d

Description

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](https://github.com/avajs/ava) does well.

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

![image](https://user-images.githubusercontent.com/381495/35158802-2df3046e-fd30-11e7-847d-b7a350ca7768.png)

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?
4.

```
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.
```

5. The stack trace is quite distracting (long line length, and red):

```sh
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?

6. 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!

7. 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?

8. 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?

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.