microsoft / microsoft/TypeScript

Build mode ignores inherited --pretty flag when run through lerna

オープン
#39,178 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

Bug Domain: tsc -b
主要言語
Go
スター
111k
フォーク
14.3k
平均マージ
2日 4時間
マージ済み PR(30日)
132

説明

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

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

調査の方向性

まず、次の3つのコマンド形式を再現します。パッケージディレクトリでの npm run build、lerna run build --scope=package-name、そして lerna exec --scope=package-name -- npm run build です。lerna 経由で呼び出した場合に、tsc -b が連結された tsconfig.json ファイルをどのように読み取り、--pretty をどのように処理するかを調べます。継承された pretty 設定によって一貫した CLI 出力が生成されるか、または問題が lerna に属することが示されれば完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
typescript
領域
build-system, cli
issue の種類
バグ
難易度
3/5
見積もり時間
1〜2日
活発さ
停滞
明瞭さ
おおむね明確
初心者へのやさしさ
45/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。