In preparation for Vite 5's deprecation of its CommonJS API, we should update the various Codex packages to use ESM by default. This can be done by adding "type": "module to the package.json file for each workspace.
It's still possible for individual files to opt-in to CJS by using .cjs as their file extension. This workaround will probably be necessary for Jest config files, because Jest still considers ESM support to be experimental.
In the slightly-more-distant-future, we may want to migrate our test suites from Jest to Vitest.
Here's an example of what this change entails (in the codex-docs workspace): https://gerrit.wikimedia.org/r/c/design/codex/+/980943/3
Acceptance Criteria
- Migrate codex-design-tokens to ESM
- Migrate codex-icons to ESM
- Migrate @wikimedia/codex to ESM
- Migrate codex-docs to ESM