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

Fix output for TS Build Info File in TypeScript recipe #905

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Copy link
Collaborator

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)

Suggested change
"output": ["lib/**", "*.tsbuildinfo"]
"output": ["lib/**", "lib/tsconfig.tsbuildinfo"]

Copy link
Author

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.

Copy link
Member

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?

Copy link
Collaborator

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.

Copy link
Collaborator

@augustjk augustjk Oct 12, 2023

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 and outDir 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.

}
}
}
Expand Down