microsoft / microsoft/TypeScript
Build mode ignores inherited --pretty flag when run through lerna
Chưa có ai nhận issue này.
- Ngôn ngữ chính
- Go
- Star
- 111k
- Fork
- 14.3k
- Merge trung bình
- 1 ngày 19 giờ
- Pull request đã merge (30 ngày)
- 117
Mô tả
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
Hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Hướng nghiên cứu
Bắt đầu bằng cách tái hiện ba dạng lệnh: npm run build trong thư mục package, lerna run build --scope=package-name và lerna exec --scope=package-name -- npm run build. Kiểm tra cách tsc -b đọc các tệp tsconfig.json được liên kết với nhau và xử lý --pretty khi được gọi thông qua lerna. Được xem là hoàn tất khi thiết lập pretty được kế thừa tạo ra đầu ra CLI nhất quán, hoặc khi chứng minh được rằng vấn đề thuộc về lerna.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Đánh giá
- Công nghệ
- typescript
- Lĩnh vực
- build-system, cli
- Loại issue
- Lỗi
- Độ khó
- 3/5
- Thời gian dự kiến
- 1-2 ngày
- Mức độ hoạt động
- Đình trệ
- Độ rõ ràng
- Khá rõ ràng
- Mức phù hợp với người mới
- 45/100