Skip to content

fix(openfeature-node-provider): allow ESM imports - #820

Open
roncohen wants to merge 1 commit into
mainfrom
fix/openfeature-node-esm
Open

roncohen wants to merge 1 commit into
mainfrom
fix/openfeature-node-esm

Conversation

@roncohen

Copy link
Copy Markdown
Contributor

Fixes #819.

Summary

  • Add a default export condition so ES modules can load the provider's existing CommonJS build instead of failing with ERR_PACKAGE_PATH_NOT_EXPORTED.
  • Keep the CommonJS entry point, TypeScript declarations, dependencies, and provider API unchanged.
  • Add native Node.js smoke tests to CI for CommonJS, static and dynamic ESM imports, named/default interop, and shared export identity.
  • Include a patch changeset.

Validation

  • 32 existing provider/example tests and 2 new native Node.js smoke tests passed. The ESM regression failed before the fix.
  • CommonJS and ESM imports also passed against a packed tarball.
  • Provider build, type-check, scoped lint, formatting, and 17 release safeguards passed.
  • Audited packed artifacts for all 11 publishable packages: no missing declared entry points or additional ESM export failures found. Checked nine libraries with both CommonJS and ESM, the CLI with --help, and TypeScript NodeNext consumers in both module modes.

The broader audit compiled the Management SDK from checked-in generated sources; it did not regenerate them. React Native's entry points and types were checked, but its runtime was not exercised. The full monorepo test suite was not run.

@reflag-review reflag-review Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Risk: medium

no actionable findings

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.

@reflag/openfeature-node-provider cannot be imported from ESM

1 participant