x)- [ ] bug report -> please search issues before submitting
- [x] feature request
@angular/cli: 1.4.5
node: 8.7.0
os: darwin x64
@angular/common: 4.4.4
@angular/compiler: 4.4.4
@angular/core: 4.4.4
@angular/forms: 4.4.4
@angular/http: 4.4.4
@angular/platform-browser: 4.4.4
@angular/platform-browser-dynamic: 4.4.4
@angular/router: 4.4.4
@angular/cli: 1.4.5
@angular/compiler-cli: 4.4.4
typescript: 2.3.4
Run ng build --prod --aot in a CI environment like Travis CI or GitLab CI. You'll see something like:
0% compiling 10% building modules 0/1 modules 1 active project/src/main.ts 10% building modules 1/1 modules 0 active 10% building modules 1/2 modules 1 active project/src/polyfills.ts 10% building modules 2/2 modules 0 active 10% building modules 2/3 modules 1 active project/src/styles.scss 10% building modules 3/3 modules 0 active 10% building modules 3/4 modules 1 active project/src/styles.scss 10% building modules 4/4 modules 0 active 10% building modules 4/5 modules 1 active ...de_modules/css-loader/lib/css-base.js 10% building modules 5/5 modules 0 active 10% building modules 5/6 modules 1 active project/src/main.ts 10% building modules 5/7 modules 2 active project/src/polyfills.ts 10% building modules 6/7 modules 1 active project/src/polyfills.ts 10% building modules 7/7 modules 0 active 10% building modules 7/8 modules 1 active project/src/environments/environment.ts 10% building modules 8/8 modules 0 active 10% building modules 8/9 modules 1 active ...$$_gendir/app/app.module.ngfactory.ts 11% building modules 9/9 modules 0 active 11% building modules 9/10 modules 1 active project/src/app/app.module.ts 11% building modules 10/10 modules 0 active 11% building modules 10/11 modules 1 active project/src/app/app.component.ts 11% building modules 11/11 modules 0 active 11% building modules 11/12 modules 1 active ...gendir/app/app.component.ngfactory.ts
This can be alleviated by passing the --no-progress flag to ng build but it introduces a mental burden to add that to every command invoked on CI. If you have many such commands or if they're deeply nested in npm scripts this may require duplicating a lot of code.
N/A
Angular CLI should not print progress when run in a non-TTY environment. Optionally it could switch its reporter to something like dots that only appends a dot when something happens and doesn't try to rewrite the output, printing a lot of noise.
Node.js has an API for this exact purpose: process.stdout.isTTY, see https://nodejs.org/api/tty.html
I agree that we should use the API to determine the system default. Would be really helpful.
Something still doesn't work here. In Karma tests run via WebStorm process.stdout.isTTY === undefined (I checked) and yet the progress is printed, flooding the console. The same happens to me in GitLab CI. Angular CLI 1.6.0.
@mgol I don't use GitLab CI, so don't know why it does not work there.
Regarding WebStorm: my PR only changes the default for the --progress flag of the ng test command. So if you use Karma run configuration in WebStorm it will still print progress, because WebStorm runs Karma directly and not using ng test command. I think we should also update here - change from true to process.stdout.isTTY === true, so this feature will also work when running Karma directly. Can you submit a PR?
@devoto13 OK, thanks, I know what's happening now.
In GitLab CI process.stdout.isTTY === undefined as well, the progress I'm seeing comes from building the universal app according to the Universal CLI story i.e. via:
webpack --config webpack.server.config.js --progress --colors
That's a Webpack thing, not CLI one, though so here what's needed is mostly the Karma modification. I'll see what I can do.
This has regressed in CLI 6, see a new bug report: #11195.
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
_This action has been performed automatically by a bot._
Most helpful comment
@devoto13 OK, thanks, I know what's happening now.
In GitLab CI
process.stdout.isTTY === undefinedas well, the progress I'm seeing comes from building the universal app according to the Universal CLI story i.e. via:That's a Webpack thing, not CLI one, though so here what's needed is mostly the Karma modification. I'll see what I can do.