Skip to content

Conversation

@jonathannorris
Copy link
Member

@jonathannorris jonathannorris commented Jan 2, 2026

Summary

Adds dual ESM/CJS output format to shared libraries and server SDKs.

Changes

  • Add format: ["cjs", "esm"] to esbuild configs
  • Update package.json exports with proper conditional exports (import/require)
  • Use .cjs extension for CommonJS, .js for ESM
  • Add webpack extensionAlias config for dev-apps

Packages 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

Copilot AI review requested due to automatic review settings January 2, 2026 02:41
@jonathannorris jonathannorris requested a review from a team as a code owner January 2, 2026 02:41
@vercel
Copy link

vercel bot commented Jan 2, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Review Updated (UTC)
js-sdks-web-elements Ready Ready Preview, Comment Jan 9, 2026 4:28pm
js-sdks-with-provider Ready Ready Preview, Comment Jan 9, 2026 4:28pm
1 Skipped Deployment
Project Deployment Review Updated (UTC)
js-sdks-next-js-page-router Ignored Ignored Jan 9, 2026 4:28pm

Copy link
Contributor

Copilot AI left a 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 conditional exports fields
  • 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.

jonathannorris and others added 4 commits January 9, 2026 11:27
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]>
Copy link
Contributor

Copilot AI left a 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,
Copy link

Copilot AI Jan 9, 2026

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.

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants