liferay / liferay-frontend-projects

A monorepo containing assorted Frontend Infrastructure Team projects
Other
66 stars 67 forks source link

fix(npm-scripts): wipe the tsbuildinfo file to ensure consistent types #1143

Closed bryceosterhaus closed 1 year ago

bryceosterhaus commented 1 year ago

I think this should help resolve our issues of getting inconsistent .d.ts files with /// <reference .... We originally added this logic to just the yarn types command and it helped out quite a bit, but now we also need it on individual module builds, so I am removing the file everytime we run runTsc.

I can't totally figure out why we are getting odd behavior with those references in d.ts files, but I suspect it may be a bug in our TS version. I ran some tests with TS on the latest version and I wasn't able to reproduce this issue, although it brought other issues.

Now I'm not totally stoked with this because this may increase our build time a little bit, although not significantly because we have our own npm-scripts cacheing mechanism. So I think we stick with this for now and then investigate upgrading to TS 5 later.

bryceosterhaus commented 1 year ago

improvements after this issue will be done in https://liferay.atlassian.net/browse/LPS-188133