Skip to content

chore!: ship ESM-only package output - #475

Merged
chrispader merged 1 commit into
mainfrom
build/esm-only
Nov 10, 2026
Merged

chrispader merged 1 commit into
mainfrom
build/esm-only

Conversation

@chrispader

Copy link
Copy Markdown
Member

The core package builds a CommonJS copy of every file and a second set of type definitions next to its ES module build. React Native apps don't use it, because Metro reads the source through the react-native condition, and Node 22.12 and later can require() the ES module build. This PR drops the CommonJS target, so the package ships one build in lib/module and one set of types in lib/typescript, and every exports entry points at them.

This breaks Jest setups that load react-native-nitro-sqlite/mock. Jest doesn't transform files in node_modules by default, so it fails on the ES module syntax until the package is added to transformIgnorePatterns. The mock guide now includes that step:

// jest.config.js
transformIgnorePatterns: [
  'node_modules/(?!((jest-)?react-native|@react-native(-community)?|react-native-nitro-sqlite)/)',
],

🤖 Generated with Claude Code

Drop the CommonJS build target. The package now publishes one ES module
build in lib/module and one set of type definitions in lib/typescript, and
the export conditions point both import and require resolution at them.

BREAKING CHANGE: The package no longer ships a CommonJS build. Jest setups
that load react-native-nitro-sqlite/mock must add the package to
transformIgnorePatterns so Jest transforms its ES modules.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@vercel

vercel Bot commented Nov 10, 2026 •

Copy link
Copy Markdown

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

Project Deployment Actions Updated
react-native-nitro-sqlite Ready Ready Preview Nov 10, 2026 10:46am UTC

Request Review

@chrispader
chrispader merged commit 1e74395 into main Nov 10, 2026
7 of 8 checks passed
@chrispader
chrispader deleted the build/esm-only branch November 10, 2026 10:54

This branch was successfully deployed

1 active deployment
Preview — 0c083b9f Deployed Nov 10, 2026 by vercel[bot]
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