Skip to content

feat: esm and cjs exports#427

Merged
kanadgupta merged 36 commits intomainfrom
esm-and-cjs
Sep 27, 2023
Merged

feat: esm and cjs exports#427
kanadgupta merged 36 commits intomainfrom
esm-and-cjs

Conversation

@kanadgupta
Copy link
Copy Markdown
Contributor

@kanadgupta kanadgupta commented Sep 21, 2023

🧰 Changes

This PR refactors this codebase to support both ESM and CJS exports. I was originally blocked in #426 (comment) — turns out the issue was the treeshaking flag. Removing that (and separating out the type exports into types.ts) fixes the issue!

This PR also does a little bit of housekeeping:

  • Runs Prettier on everything
  • Bumps a few dependencies to the latest

🧬 QA & Testing

Before/after for Are The Types Wrong

CleanShot 2023-09-26 at 16 30 05@2x CleanShot 2023-09-26 at 16 30 31@2x

If you check out this repo and run the following commands, they should work as expected:

# install + build
npm ci && npm run build

# run example scripts
node example.mjs
node example.cjs
deno run -A example.mjs

Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants