In preparation for Vite 5's [[ https://vitejs.dev/guide/migration.html#deprecate-cjs-node-api | 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 [[ https://jestjs.io/docs/ecmascript-modules | still considers ESM support to be experimental ]].
In the slightly-more-distant-future, we may want to [[ https://vitest.dev/guide/migration.html#migrating-from-jest | 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
- [x] Migrate `codex-docs` to ESM