Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
AlCalzone opened this issue Jun 21, 2020 · 1 comment
Open

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

AlCalzone opened this issue Jun 21, 2020 · 1 comment
Labels
Bug A bug in TypeScript
Milestone

Comments

@AlCalzone
Copy link
Contributor

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: #30282

@RyanCavanaugh RyanCavanaugh added the Bug A bug in TypeScript label Jun 22, 2020
@RyanCavanaugh RyanCavanaugh added this to the Backlog milestone Jun 22, 2020
@RyanCavanaugh
Copy link
Member

I'm not sure this is going to be fixable without some weird backflips, but we'd take a PR if it's straightforward

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug A bug in TypeScript
Projects
None yet
Development

No branches or pull requests

2 participants