turf icon indicating copy to clipboard operation
turf copied to clipboard

Backport typescript fixes from #2555 to v6.5.0

Open RobinVdBroeck opened this issue 9 months ago • 12 comments

Please fill in this template.

  • [X] Use a meaningful title for the pull request. Include the name of the package modified.
  • [X] Have read How To Contribute.
  • [X] Run npm test at the sub modules where changes have occurred.
  • [X] Run npm run lint to ensure code style at the turf module level.

Doing an upgrade to 7.0.0 might be a big endeavor for some users of this library, so this would allow them to use modern Typescript features (like node16 module resolution) or use a bundler like vite.

I've backported the changes done in #2555 to v6.5.0. I haven't backported the pnpm changes, since that seems to be out of scope for this backport.

I've bumped the version of typescript here to 4.7.2, since that is the first one to introduce the node16 module resolution algorithm.

I've manually verified the changes by setting up a minimal vite project, which was previously incompatible with v6.5.0, and using my local build (by yarn link). I've also setup a small script (const foo = require("@turf/union").default; console.log(foo != undefined) to make sure that commonjs is not broken.

tsup requires that there is a tsconfig.json file in every package, so I've added a script sync-tsconfigs that writes the tsconfig.json to every package.

RobinVdBroeck avatar May 02 '24 22:05 RobinVdBroeck