-
Notifications
You must be signed in to change notification settings - Fork 10
feat: add ESM output format to shared libs and server SDKs #1200
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: feat-nx-migration
Are you sure you want to change the base?
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
1 Skipped Deployment
|
9eb7de9 to
1450493
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds dual ESM/CJS output format support to shared libraries and server SDKs, enabling better compatibility with both module systems. The changes standardize the build configuration across multiple packages by using .cjs extensions for CommonJS output and .js for ESM output, with proper conditional exports in package.json files.
- Configures esbuild to generate both ESM and CJS formats for all affected packages
- Updates package.json files with proper
main,module, and conditionalexportsfields - Removes explicit outExtension configuration to use esbuild defaults
Reviewed changes
Copilot reviewed 25 out of 25 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| sdk/openfeature-web-provider/project.json | Adds ESM format output and removes outExtension override |
| sdk/openfeature-web-provider/package.json | Updates exports with dual format entry points using .cjs/.js extensions |
| sdk/openfeature-react-provider/project.json | Adds ESM format output and removes outExtension override |
| sdk/openfeature-react-provider/package.json | Updates exports with dual format entry points using .cjs/.js extensions |
| sdk/openfeature-nestjs-provider/project.json | Adds ESM format output and removes outExtension override |
| sdk/openfeature-nestjs-provider/package.json | Updates exports with dual format entry points using .cjs/.js extensions |
| sdk/openfeature-angular-provider/project.json | Adds ESM format output and removes outExtension override |
| sdk/openfeature-angular-provider/package.json | Updates exports with dual format entry points using .cjs/.js extensions |
| sdk/nodejs/project.json | Adds ESM format output and removes outExtension override |
| sdk/nodejs/package.json | Updates exports with dual format entry points using .cjs/.js extensions |
| sdk/nestjs/project.json | Adds ESM format output and removes outExtension override |
| sdk/nestjs/package.json | Updates exports with dual format entry points using .cjs/.js extensions |
| sdk/js-cloud-server/project.json | Adds ESM format output and removes outExtension override |
| sdk/js-cloud-server/package.json | Updates exports with dual format entry points using .cjs/.js extensions |
| lib/shared/vercel-edge-config/project.json | Adds ESM format output and removes outExtension override |
| lib/shared/vercel-edge-config/package.json | Updates exports with dual format entry points, removes type field |
| lib/shared/sse-connection/project.json | Adds ESM format output and removes outExtension override |
| lib/shared/sse-connection/package.json | Updates exports with dual format entry points using .cjs/.js extensions |
| lib/shared/server-request/project.json | Adds ESM format output and removes outExtension override |
| lib/shared/server-request/package.json | Updates exports with dual format entry points using .cjs/.js extensions |
| lib/shared/config-manager/project.json | Adds ESM format output and removes outExtension override |
| lib/shared/config-manager/package.json | Updates exports with dual format entry points using .cjs/.js extensions |
| lib/shared/bucketing/project.json | Adds ESM format output and removes outExtension override |
| lib/shared/bucketing/package.json | Updates exports with dual format entry points using .cjs/.js extensions |
| dev-apps/js/webpack.config.js | Adds trailing blank lines (no functional changes) |
Comments suppressed due to low confidence (1)
dev-apps/js/webpack.config.js:12
- Remove trailing blank lines at the end of the file.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
This commit enables ES Module support for all packages by updating their project.json configurations and package.json files. It also standardizes the 'exports' field in package.json for better module resolution. Co-authored-by: jonathan <[email protected]>
Co-authored-by: jonathan <[email protected]>
b81f7cc to
59276a7
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 25 out of 25 changed files in this pull request and generated 1 comment.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| "format": ["cjs", "esm"], | ||
| "platform": "node", | ||
| "bundle": true, | ||
| "thirdParty": true, |
Copilot
AI
Jan 9, 2026
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The thirdParty: true option was added, and lodash was removed from the external array. This will cause lodash to be bundled into the output. However, lodash is still listed as a dependency in package.json. Consider either: 1) keeping lodash in the external array if consumers should provide it, or 2) removing it from package.json dependencies if it's being bundled. Bundling lodash while keeping it as a dependency creates ambiguity about whether consumers need to install it separately.
Summary
Adds dual ESM/CJS output format to shared libraries and server SDKs.
Changes
format: ["cjs", "esm"]to esbuild configspackage.jsonexports with proper conditional exports (import/require).cjsextension for CommonJS,.jsfor ESMextensionAliasconfig for dev-appsPackages Updated
@devcycle/bucketing,@devcycle/config-manager,@devcycle/server-request,@devcycle/sse-connection,@devcycle/vercel-edge-config@devcycle/js-cloud-server-sdk,@devcycle/nestjs-server-sdk,@devcycle/nodejs-server-sdk@devcycle/openfeature-web-provider,@devcycle/openfeature-react-provider,@devcycle/openfeature-angular-provider,@devcycle/openfeature-nestjs-provider