Skip to content

Conversation

@mondoreale
Copy link
Contributor

This pull request updates the exports fields in several package.json files to explicitly add a "node" export condition for Node.js-specific builds. This improves compatibility and clarity when these packages are imported in different environments, ensuring that the correct entry points are used for Node.js.

Package export improvements:

  • Added a "node" export condition pointing to the Node.js CommonJS build in packages/autocertifier-client/package.json, packages/dht/package.json, and packages/utils/package.json to clarify and standardize Node.js entry points. [1] [2] [3]
  • Updated packages/test-utils/package.json to add "node" export conditions for the main entry and sub-exports (./setupCustomMatchers, ./customMatchers), ensuring correct resolution in Node.js environments.

Jest prefers `node` in node test environment. Otherwise it tends to fallback to whatever caused interaction (import or require), and if `import` is es then Jest loses it.
@github-actions github-actions bot added test-utils Related to Test Utils Package dht Related to DHT package utils labels Jan 12, 2026
@mondoreale mondoreale merged commit ba0a077 into bundles Jan 12, 2026
21 checks passed
@mondoreale mondoreale deleted the explicit-node-exports-for-jest branch January 12, 2026 14:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dht Related to DHT package test-utils Related to Test Utils Package utils

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants