Skip to content

Fix CJS for stack-shared#676

Merged
N2D4 merged 2 commits into
devfrom
fix-stack-shared-cjs
May 13, 2025
Merged

Fix CJS for stack-shared#676
N2D4 merged 2 commits into
devfrom
fix-stack-shared-cjs

Conversation

@N2D4
Copy link
Copy Markdown
Contributor

@N2D4 N2D4 commented May 13, 2025


Important

Fix CJS exports in package.json of stack-shared by adding require fields for compatibility.

  • Exports:
    • Add require fields in exports for CJS compatibility in package.json.
    • Specify "require": { "default": "./dist/index.js" } for main entry.
    • Specify "require": { "default": "./dist/*.js" } for sub-paths.

This description was created by Ellipsis for 17607b3. You can customize this summary. It will automatically update as commits are pushed.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2025

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stack-backend ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2025 10:06pm
stack-dashboard ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2025 10:06pm
stack-demo ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 13, 2025 10:06pm

Copy link
Copy Markdown
Contributor

@greptile-apps greptile-apps Bot left a comment

Choose a reason for hiding this comment

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

PR Summary

Modified package.json configuration in @stackframe/stack-shared to improve dual module system compatibility, focusing on CommonJS support while maintaining ESM functionality.

  • Removed main, types, and type: module fields from package.json for better CJS compatibility
  • Added require conditions in exports field to support proper CommonJS module resolution
  • Maintained ESM support through default export conditions in package.json
  • Ensured proper type definitions access through types field in exports mapping

1 file(s) reviewed, 1 comment(s)
Edit PR Review Bot Settings | Greptile

Comment on lines +22 to +23
"default": "./dist/index.js"
},
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

style: Consider using './dist/cjs/index.js' instead of './dist/index.js' to explicitly separate CJS and ESM outputs

@N2D4 N2D4 merged commit 5803b2e into dev May 13, 2025
17 checks passed
@N2D4 N2D4 deleted the fix-stack-shared-cjs branch May 13, 2025 22:13
N2D4 added a commit to willothy/stack that referenced this pull request Jun 23, 2025
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