Open vpontis opened 2 years ago
The issue would probably be over at https://github.com/Swatinem/rollup-plugin-dts, which tsup uses to produce those .d.ts
files. Is there a reason why you're committing the generated files though?
The issue would probably be over at https://github.com/Swatinem/rollup-plugin-dts, which tsup uses to produce those
.d.ts
files. Is there a reason why you're committing the generated files though?
Yea, committing generated files is good when you're publishing packages.
I don't think it makes much sense to do that. Most people don't commit the dist files. If you're publishing a package, then you can just gitignore dist
and run the build before you publish.
@vpontis you shouldn't be committing the generated files. If you're publishing the files then a build
script should be used. If you're expecting people to use the repo to install from then make sure to have a prepare
script which calls your build
script.
We have reasons to commit generated files... When we check out different branches, it's nice to not have to recompile everything.
I feel like the solution to TS being non-deterministic isn't to just ignore it...
I can take a deeper look if you provide a minimal repro 🙏🏼
When we check out different branches, it's nice to not have to recompile everything.
That's gonna lead to all sorts of issues. Recompiling one of the largest repos I have takes less than 2s on my old windows machine.. so unless we're missing something I'd highly suggest just fixing this.
Sometimes when
tsup
recompiles it generates a valid, but different version of the.d.ts
file.You can see an example diff here: https://gist.github.com/vpontis/bc4ae5c8f8ef6ba87026952dd21e5c6c
These two
.d.ts
files are semantically equivalent butgit
thinks they are different because the content in the file is getting reorganized.Is this a known issue somewhere in the
tsup
pipeline? Is there any way I can avoid this?Upvote & Fund