Skip to content

chore: add exports fields to tooling packages#6080

Merged
longlho merged 2 commits intomainfrom
chore/add-exports-fields
Mar 15, 2026
Merged

chore: add exports fields to tooling packages#6080
longlho merged 2 commits intomainfrom
chore/add-exports-fields

Conversation

@longlho
Copy link
Copy Markdown
Member

@longlho longlho commented Mar 15, 2026

Summary

  • Add "exports": { ".": "./index.js" } to 5 tooling packages that were missing it: babel-plugin-formatjs, @formatjs/cli-lib, eslint-plugin-formatjs, @formatjs/ts-transformer, @formatjs/vite-plugin
  • Add missing "types": "index.d.ts" to @formatjs/cli-lib
  • Improves compatibility with modern bundlers and ESM resolution

Test plan

  • pnpm install — lockfile unchanged
  • bazel test on all 5 affected packages — all pass
  • pnpm t — full suite (484 tests) passes

🤖 Generated with Claude Code

Add "exports" field to 5 packages that were missing it:
- babel-plugin-formatjs
- @formatjs/cli-lib (also adds missing "types" field)
- eslint-plugin-formatjs
- @formatjs/ts-transformer
- @formatjs/vite-plugin

This improves compatibility with modern bundlers and ESM resolution.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@longlho longlho enabled auto-merge (squash) March 15, 2026 19:26
Mark items 9 and 11 as done/won't-fix, and update vite-plugin
entry to reflect the exports field addition in #6080.

Co-Authored-By: Claude Opus 4.6 (1M context) <[email protected]>
@longlho longlho merged commit 7857ddf into main Mar 15, 2026
6 checks passed
@longlho longlho deleted the chore/add-exports-fields branch March 15, 2026 19:29
longlho pushed a commit that referenced this pull request Mar 17, 2026
…6144)

Prior to 6.3.0, we were able to `import { extractMessages, getSettings }
from 'eslint-plugin-formatjs/util.js'`, and we did this to define some
custom rules that are specific to our workflows.

After #6080, that import is
failing.

Can we restore the ability to import the util module?
dzbarsky pushed a commit to dzbarsky/formatjs that referenced this pull request Apr 26, 2026
…port (formatjs#6437)

## Summary
- Add `./ts-jest-integration.js` to the `exports` field in
`package.json`
- Add `ts-jest-integration.ts` as a rolldown entry point in
`BUILD.bazel` so it gets bundled with `.js`, `.d.ts`, and `.js.map` into
the published package
- Update jest integration test config to use `.js` extension in the
import path

This was a regression from formatjs#6080 which added an `exports` field to
`package.json` but only included `.` — blocking the
`ts-jest-integration` deep import that ts-jest users rely on.

Closes formatjs#6433

## Test plan
- [x] `bazel test //packages/ts-transformer:package_exports_test` —
validates all exports resolve to real files
- [x] `bazel test //packages/ts-transformer:unit_test` — 27 tests pass
- [x] All pre-commit hooks pass

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant