Skip to content

chore: support Node.js >= 20 (not just 20.11) and test it in CI#538

Merged
merencia merged 4 commits into
mainfrom
chore/support-node-20
Jun 17, 2026
Merged

chore: support Node.js >= 20 (not just 20.11) and test it in CI#538
merencia merged 4 commits into
mainfrom
chore/support-node-20

Conversation

@merencia

Copy link
Copy Markdown
Member

Prep for the 4.3.0 release: make the supported Node.js floor honest and tested.

Why

The ESM build only ran on Node >= 20.11 because of import.meta.dirname / import.meta.filename (added in 20.11). That excluded early Node 20 LTS (20.0–20.10) for no real reason.

Changes

  • Replace import.meta.dirname / import.meta.filename with fileURLToPath(import.meta.url) (works on any ESM-capable Node). The CJS build's replace step rewrites it to __filename, so both builds keep working. Verified by running a real background task on both the ESM and CJS builds.
  • Lower engines.node to >=20.
  • Run the unit tests on Node 20, 22 and 24 (previously only 22), so the supported range is actually exercised. Coveralls still uploads once (from the 22 job).

The next real floor below this is the timezone code's Intl timeZoneName: 'shortOffset' (~Node 18, now EOL), so >=20 LTS is the sensible, honest floor.

Full suite green (260 tests), build and lint pass.

Note: this PR touches .github/workflows/, so it needs to be merged via the GitHub UI (the CLI token lacks the workflow scope).

merencia added 3 commits June 17, 2026 09:16
The ESM build only required Node >= 20.11 because it used import.meta.dirname /
import.meta.filename. Replace those with fileURLToPath(import.meta.url) (the CJS
build rewrites it to __filename), which works on any ESM-capable Node, and lower
engines to >=20 so any Node 20 LTS is supported, not just 20.11+.

Also run the unit tests on Node 20, 22 and 24 so the supported range is actually
exercised (previously only 22 was tested).
@merencia
merencia force-pushed the chore/support-node-20 branch from e2812a3 to 7271daf Compare June 17, 2026 12:35
@merencia
merencia merged commit 6f6b912 into main Jun 17, 2026
5 checks passed
@merencia
merencia deleted the chore/support-node-20 branch June 17, 2026 12:41
@merencia merencia mentioned this pull request Jun 17, 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