Skip to content
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

feat: support cjs too #6

Merged
merged 1 commit into from
Mar 18, 2025
Merged

feat: support cjs too #6

merged 1 commit into from
Mar 18, 2025

Conversation

darshkpatel
Copy link
Collaborator

@darshkpatel darshkpatel commented Mar 18, 2025

TL;DR

Added CommonJS support to the package alongside existing ESM format.

( insert old man yelling at js ecosystem ) when testing locally I was simply doing pnpm add <path> and it used to work with the repl-it-web codegen but after publishing and using the published version, had interop issues

This time, built, packaged as tar and installed locally with the tar to test it

Screenshot 2025-03-18 at 2.43.01 PM.png

Screenshot 2025-03-18 at 2.43.12 PM.png

Screenshot 2025-03-18 at 2.47.16 PM.png

What changed?

  • Changed main entry point from dist/index.mjs to dist/index.js
  • Updated types path from dist/index.d.mts to dist/index.d.ts
  • Added proper exports field in package.json to support both ESM and CommonJS imports
  • Modified tsup configuration to build both ESM and CommonJS formats
  • Added output extension configuration to ensure proper file extensions (.mjs for ESM, .js for CJS)

Copy link
Collaborator Author

This stack of pull requests is managed by Graphite. Learn more about stacking.

@darshkpatel darshkpatel requested a review from masad-frost March 18, 2025 21:57
@darshkpatel darshkpatel marked this pull request as ready for review March 18, 2025 21:57
Copy link
Member

@masad-frost masad-frost left a comment

Choose a reason for hiding this comment

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

💀

@darshkpatel darshkpatel merged commit 8db7d84 into main Mar 18, 2025
1 check passed
@darshkpatel darshkpatel deleted the 03-18-feat_support_cjs_too branch March 19, 2025 01:07
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.

2 participants