Skip to content

Move packages to Node ESM#9929

Merged
emmatown merged 6 commits into
mainfrom
node-esm
Jul 24, 2026
Merged

Move packages to Node ESM#9929
emmatown merged 6 commits into
mainfrom
node-esm

Conversation

@emmatown

@emmatown emmatown commented Jul 23, 2026

Copy link
Copy Markdown
Member

This moves Keystone's packages to exclusively ESM which can be run in Node. They can still be used in CommonJS because of Node adding support for requiring ESM in CommonJS. This also doesn't change anything about what Keystone builds, we still build CommonJS in .keystone and currently using "type": "module" in a Keystone project will not work. I may fix this in a future PR though if we do support that, we will still compile to CommonJS because using ESM for dev live reloading is difficult to do without memory leaks.

The main benefit here is a faster CI and less complexity.

This also includes a bump to meow.

@socket-security

socket-security Bot commented Jul 23, 2026

Copy link
Copy Markdown

All alerts resolved. Learn more about Socket for GitHub.

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

View full report

@emmatown

emmatown commented Jul 23, 2026

Copy link
Copy Markdown
Member Author

This is blocked on bumping to graphql@17 (which is itself blocked on a number of other things) because of cursed Vitest behaviour where because graphql@16 has "main": "index" in it's package.json, when graphql is imported from ESM (like proper "type": "module"/.mjs) Vitest resolves to the index.mjs instead of the index.js that it should resolve to (and Node does) but other CJS deps require graphql and get the index.js.

Note while we could work around this in our Vitest setup, that workaround would also be necessary for consumers of Keystone which I'd rather avoid

See #9936

@emmatown
emmatown force-pushed the node-esm branch 2 times, most recently from 5f9ec97 to c0fe4c0 Compare July 23, 2026 06:44
Base automatically changed from prisma-7 to main July 23, 2026 07:34
@emmatown
emmatown force-pushed the node-esm branch 3 times, most recently from f671cc7 to bf1152c Compare July 23, 2026 23:44
@socket-security

socket-security Bot commented Jul 23, 2026

Copy link
Copy Markdown

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updatedmeow@​9.0.0 ⏵ 14.1.0100 +1100100 +181100

View full report

@emmatown
emmatown force-pushed the node-esm branch 2 times, most recently from 19a7120 to b1fe8e3 Compare July 24, 2026 02:30
@emmatown
emmatown force-pushed the node-esm branch 3 times, most recently from 42de6da to 5fcc024 Compare July 24, 2026 03:39
@emmatown
emmatown marked this pull request as ready for review July 24, 2026 03:39
@emmatown emmatown mentioned this pull request Jul 24, 2026
@emmatown emmatown changed the title Node esm Move packages to Node ESM Jul 24, 2026
@emmatown
emmatown merged commit 056f6b5 into main Jul 24, 2026
55 checks passed
@emmatown
emmatown deleted the node-esm branch July 24, 2026 06:09
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