At first we wanted to only support ESM. But as we want to share types and export design tokens from the react package to the outside world in order to allow local cunningham.ts files to import them, we are forced to also build the library for CJS too. Why? Because local cunningham.ts files are loaded as CJS, so they can only import CJS module. Why loading cunningham.ts as CJS? Because the tokens package's binary is built for CJS, then it's seamless to make it load CJS, where making it load ESM was buggy. And why not migrate the tokens package to ESM so? Because it implies to rewrite every imports with .js extensions, makes us loose the possibility to use __dirname kind of variables. And also Jest use for testing is not compliant at all when it comes to execute ESM code. Well, the ecosystem is not ready for that at the moment, sadly.
Changesets
Hello and welcome! This folder has been automatically generated by @changesets/cli, a build tool that works
with multi-package repos, or single-package repos to help you version and publish your code. You can
find the full documentation for it in our repository
We have a quick list of common questions to get you started engaging with this project in our documentation