microsoft / microsoft/TypeScript

Terse mode output from `tsc --build`

Abierto
#25,562 4 comentarios 24 reacciones 0 asignados Ver en GitHub

Nadie ha tomado este issue todavía.

In Discussion Suggestion
Lenguaje dominante
Go
Estrellas
111k
Forks
14.3k
Merge medio
2 d 4 h
PR fusionados (30 d)
132

Descripción

Search Terms

tsc --build mode console logging output verbose

Suggestion

Have a middle-ground between verbose and "nothing" when running tsc -b

Use Cases

Initial feedback was that "tsc -b should print nothing by default (if there are no errors)", which is a reasonable first principle to work from. However, it's nice to have some rough idea of what's going on, especially because a tsc -b invocation might take quite a while, depending on what's up to date.

Users today can get more output by running with --verbose, which prints some fairly detailed spew:

message TS6350: Project 'tsconfig.json' is out of date because oldest output 'lib/fetch.js' is older than newest input 'src/fetch.ts'

The verbose output was written primarily as an "Explain why something is happening"; there is no in-between setting that says simply "Explain what is happening".

This is compounded under --watch where tsc -b prints errors, but doesn't print "No errors", so you can't really know if your compilation succeeded or if tsc simply missed a file change.

Proposal

--terse strikes a middle ground between the default (silent) and verbose. Its short name would be -t which doesn't conflict with anything I can think of adding in the near term.

Examples

> tsc -b -t src
message TS6350: 'src/compiler' is up-to-date
message TS6350: 'src/services' is up-to-date
message TS6351: Building 'src/server'...
message TS6351: Building 'src/tests'...
message TS6352: Build completed
> tsc -b -t -w src
message TS6350: All projects are up to date
message TS6351: 'src/compiler' was modified, building...

src/compiler/parser.ts:21:1 - error TS1128: Declaration or statement expected.

21 ?
   ~

message TS6351: 'src/compiler' was modified, building...
message TS6351: Building 'src/server'...
message TS6351: Building 'src/tests'...
message TS6352: All projects are up to date

Checklist

My suggestion meets these guidelines:

  • This wouldn't be a breaking change in existing TypeScript / JavaScript code
  • This wouldn't change the runtime behavior of existing JavaScript code
  • This could be implemented without emitting different JS based on the types of the expressions
  • This isn't a runtime feature (e.g. new expression-level syntax)

Guía de contribución

Abrir la guía de contribución

Primeros pasos

  1. Lee el issue completo y luego la guía de contribución del proyecto.
  2. Comenta en el issue que vas a ocuparte — evita que dos personas hagan lo mismo.
  3. Haz un fork del repositorio y trabaja en una rama.
  4. Abre un pull request que haga referencia al número del issue.

Línea de trabajo

Comienza por el procesamiento de la línea de comandos de tsc --build y compara las rutas de salida existentes para default, --verbose y --watch. Define cómo debe informar un nuevo modo --terse/-t sobre el estado del proyecto, las compilaciones, la finalización y el éxito en el modo watch, y valida su salida con los ejemplos del issue.

Escrito por el modelo de indexación a partir del texto del issue.

Evaluación

Stack tecnológico
typescript
Área
build-system, cli, compilers
Tipo de issue
Nueva funcionalidad
Dificultad
5/5
Tiempo estimado
Más de una semana
Estado de actividad
Estancado
Claridad
Bastante claro
Aptitud para principiantes
35/100

Recibe los nuevos issues en tu correo

Un resumen breve de issues de GitHub para principiantes.