-
Notifications
You must be signed in to change notification settings - Fork 108
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
Fix output for TS Build Info File in TypeScript recipe #905
base: main
Are you sure you want to change the base?
Conversation
TS Build Info File is usually named `<config name>.tsbuildInfo` (e.g., `tsconfig.tsbuildinfo`). The previous configuration wouldn't clean up the TS Build Info File, causing some TS files not to be output after fixing a compilation error.
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Thanks for the PR @TimonVS! Would you be able to sign the Google CLA? We are required to only accept pull requests from contributors who have signed this CLA. Thank you! |
Fixes #505 |
@@ -764,7 +764,7 @@ This section contains advice about integrating specific build tools with Wireit. | |||
"command": "tsc --build --pretty", | |||
"clean": "if-file-deleted", | |||
"files": ["src/**/*.ts", "tsconfig.json"], | |||
"output": ["lib/**", ".tsbuildinfo"] | |||
"output": ["lib/**", "*.tsbuildinfo"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If we're going by default behavior, this might be better. See #505 (comment)
"output": ["lib/**", "*.tsbuildinfo"] | |
"output": ["lib/**", "lib/tsconfig.tsbuildinfo"] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
My tsconfig.tsbuildinfo
file doesn't get output to the output folder. And otherwise it would have been included by the lib/**
glob, right? I chose to use *.tsbuildinfo
specifically because the name of the file can be different depending on your tsconfig.json
. See: https://www.typescriptlang.org/tsconfig#tsBuildInfoFile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@augustjk Did you happen to double check the default behavior here already?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just tested now. Seems like I was mistaken, but so is the doc linked above.
If
outDir
is set, then the default is<outDir>/<config name>.tsbuildInfo
But I observed tsconfig.tsbuildinfo
being generated next to the config file, not inside the <outDir>
.
I retract the suggestion.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ooohhh nevermind, I also had rootDir
set.
If
rootDir
andoutDir
are set, then the file is<outDir>/<relative path to config from rootDir>/<config name>.tsbuildinfo
This rule pulled it back out. It's hard to say what's correct here as it's highly dependent on the user's tsconfig that we're not showing in the example. I am happy with *.tsbuildinfo
. Especially considering my suggestion is redundant with the lib/**
glob.
I have accepted the CLA! |
TS Build Info File is usually named
<config name>.tsbuildInfo
(e.g.,tsconfig.tsbuildinfo
). I had a weird issue where some files would go missing from theoutDir
, this occurred when I had a compilation error, and then I would fix the compilation error. The video below demonstrates the issue, you'll notice at the end that onlyfoo.ts
gets output tofoo.js
,index.js
andmath.js
are missing completely. Changing.tsbuildinfo
to*.tsbuildinfo
(ortsconfig.tsbuildinfo
) fixed the issue for me.CleanShot.2023-10-03.at.11.38.53.mp4