Skip to content
This repository was archived by the owner on Apr 10, 2026. It is now read-only.

Switch to ESM publishing, major version bump to 2.0.0#48

Merged
bencmbrook merged 4 commits into
mainfrom
copilot/switch-to-esm-publishing
Apr 8, 2026
Merged

Switch to ESM publishing, major version bump to 2.0.0#48
bencmbrook merged 4 commits into
mainfrom
copilot/switch-to-esm-publishing

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 8, 2026

Converts the package from CommonJS to native ESM output, with a major version bump to signal the breaking change.

Core changes

  • package.json: Add "type": "module", "exports" field with import/types conditions, "types" field; version → 2.0.0
  • tsconfig.json: module + moduleResolutionNodeNext (generates proper ESM with explicit .js specifiers in output)

Import updates

  • All relative imports in src/ and src/tests/ updated to use explicit .js extensions (required by NodeNext)
  • fp-ts deep imports updated from fp-ts/lib/Eitherfp-ts/Either etc. (NodeNext resolution requires subpath exports or directory packages; fp-ts provides fp-ts/Either/package.json shims)

Config file renames

With "type": "module", .js config files are interpreted as ESM. Renamed to .cjs:

  • .mocharc.js.mocharc.cjs
  • .eslintrc.js.eslintrc.cjs

Test runner

Replaced ts-node with tsxts-node's ESM loader is incompatible with the PnP + Node.js v20+ --import requirement. tsx works natively via node-option: ['import=tsx'] in mocharc.

Build output

// build/index.js — now proper ESM
export * from './apply.js';
export * from './codecTools/index.js';
// ...

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • ofcncog2cu-dsn.algolia.net
    • Triggering command: /opt/hostedtoolcache/node/24.14.1/x64/bin/node /opt/hostedtoolcache/node/24.14.1/x64/bin/node /home/REDACTED/work/type-utils/type-utils/.yarn/releases/yarn-4.12.0.cjs add --dev tsx (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

Copilot AI and others added 2 commits April 8, 2026 03:58
Agent-Logs-Url: https://github.com/transcend-io/type-utils/sessions/47558dfa-19d4-4dfb-ac28-2bd598d90442

Co-authored-by: bencmbrook <7354176+bencmbrook@users.noreply.github.com>
Copilot AI changed the title [WIP] Switch to publishing ESM and do a major version bump Switch to ESM publishing, major version bump to 2.0.0 Apr 8, 2026
Copilot AI requested a review from bencmbrook April 8, 2026 04:11
@bencmbrook bencmbrook merged commit 42335a7 into main Apr 8, 2026
11 checks passed
@bencmbrook bencmbrook deleted the copilot/switch-to-esm-publishing branch April 8, 2026 20:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants