Skip to content

Make all neaps packages ESM-only - #301

Merged
bkeepers merged 2 commits into
mainfrom
neaps-esm-only
Jul 28, 2026
Merged

Make all neaps packages ESM-only#301
bkeepers merged 2 commits into
mainfrom
neaps-esm-only

Conversation

@bkeepers

@bkeepers bkeepers commented Jul 28, 2026

Copy link
Copy Markdown
Member

Makes the whole repo ESM-only. The CJS builds of neaps, @neaps/tide-predictor, and @neaps/react loaded sibling packages with external require() calls, which stops working once @neaps/tide-database ships only ESM (openwatersio/tide-database#103). Rather than bundling dependencies into CJS outputs, this drops them.

The repo-wide tsdown.config.js and @neaps/react's own config now build format: ["esm"] only, and the require conditions come out of each package's exports. @neaps/api and @neaps/cli were already ESM-only. CommonJS consumers on Node 20.19+ / 22.12+ can still require() these packages through Node's require(esm) support; older Node versions need the ESM entries.

This intentionally does not bump the tide-database dependency. That lands separately once tide-database#103 is published.

bkeepers added 2 commits July 28, 2026 12:32
The repo-wide tsdown config and @neaps/react's own config emitted dual
CJS/ESM builds. The CJS entries of neaps, @neaps/tide-predictor, and
@neaps/react loaded sibling packages with external require() calls,
which breaks once @neaps/tide-database ships only ESM. Node 20.19+ /
22.12+ can still require() these packages via require(esm).
@bkeepers bkeepers changed the title Drop the CommonJS build of neaps Make all neaps packages ESM-only Jul 28, 2026
@pkg-pr-new

pkg-pr-new Bot commented Jul 28, 2026

Copy link
Copy Markdown

Open in StackBlitz

@neaps/api

npm i https://pkg.pr.new/@neaps/api@301

@neaps/cli

npm i https://pkg.pr.new/@neaps/cli@301

neaps

npm i https://pkg.pr.new/neaps@301

@neaps/react

npm i https://pkg.pr.new/@neaps/react@301

@neaps/tide-predictor

npm i https://pkg.pr.new/@neaps/tide-predictor@301

commit: 4d55204

@bkeepers
bkeepers merged commit 36a0b23 into main Jul 28, 2026
15 checks passed
@bkeepers
bkeepers deleted the neaps-esm-only branch July 28, 2026 17:32
@github-actions github-actions Bot mentioned this pull request Jul 28, 2026
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