microsoft / microsoft/TypeScript
Build mode ignores inherited --pretty flag when run through lerna
Nessuno ha ancora preso questa issue.
- Lingua principale
- Go
- Stelle
- 111k
- Fork
- 14.3k
- Merge medio
- 2g 4h
- PR unite (30g)
- 132
Descrizione
TypeScript Version: 39.4
Search Terms: build pretty
"Code"
I am currently in the process of converting a project to a monorepo. Here I noticed that tsc -b seems to ignore the --pretty flag defined in a parent tsconfig when its run through lerna (with the stream flag set to true).
The project is set up as follows
tsconfig.json: pretty => true
tsconfig.build.json: extends from tsconfig.json
package/package-name/tsconfig.build.json: extends from ../../tsconfig.build.json
package/package-name/package.json defines the npm scripts
"scripts": {
"prebuild": "gulp prebuild",
"build": "tsc -b tsconfig.build.json",
}
The pretty flag only works sometimes:
If I manually execute npm run build in the package dir, the tsc output is pretty.
If I execute lerna run build --scope=package-name, the tsc output is NOT pretty.
If I execute lerna exec --scope=package-name -- npm run build, the tsc output is pretty.
If I manually add the --pretty flag to the npm script ("tsc -b tsconfig.build.json --watch --pretty"), the tsc output is pretty in all the cases.
Although this might be caused by lerna, I suspect this is actually a bug in TypeScript, because the prebuild output from gulp is colored (pretty) in all the cases I mentioned and manually adding the flag also works.
Expected behavior:
CLI output is "pretty"
Actual behavior:
It is not
Playground Link: not applicable
Related Issues: https://github.com/microsoft/TypeScript/issues/30282
Guida per i contributori
Apri la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Direzione di ricerca
Inizia riproducendo le tre forme del comando: npm run build nella directory del package, lerna run build --scope=package-name e lerna exec --scope=package-name -- npm run build. Esamina come tsc -b legge i file tsconfig.json concatenati e gestisce --pretty quando viene invocato tramite lerna. Il lavoro è completato quando l'impostazione pretty ereditata produce un output CLI coerente, oppure viene dimostrato che il problema appartiene a lerna.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Valutazione
- Stack tecnologico
- typescript
- Ambito
- build-system, cli
- Tipo di issue
- Bug
- Difficoltà
- 3/5
- Tempo stimato
- 1-2 giorni
- Stato di attività
- Ferma
- Chiarezza
- Abbastanza chiara
- Idoneità per principianti
- 45/100