Closed turbocrime closed 3 months ago
Latest commit: dfce52908360747c0bbd13b2a8666b8b7d5eafce
The changes in this PR will be included in the next version bump.
Not sure what this means? Click here to learn what changesets are.
Click here if you're a maintainer who wants to add another changeset to this PR
uses
tsc-alias
to generate correct import paths for esm supportthis may have been related to issues @VanishMax was experiencing
this should permit esm resolution to work properly for the packages' internal modules
edit: okay, tsc-alias doesn't completely solve the issue -
bundlers are fine now, but anything that needs to use node module resolution (vitest, many consumers) will encounter problems because our packages currently use nonstandard module resolution to identify imports from external dependencies.
the tsc-alias tool is only indended for internal paths.
probably we should just comply with esm path spec internally, but that would require changing nearly every import in the codebase, so this PR now combines tsc-alias and changes imports to name external 'js' files that are not resolved via package.json exports.
this mainly just means pb types imports now require a 'js' extension, because those generated packages don't actually define any exports or main configuration.
there's hundreds of pb type imports, so it's a large diff. but this means we don't have to configure a bundler for every package, and the packages should have much better support for many consumers.
edit again:
instead of literally modifying imports, now mutating in a more custom way
this solution is bad. eventually a larger linter/bundler reconfig should happen