GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — chore: migrate from CJS to ESM by JoshuaKGoldberg · Pull Request #456 · all-contributors/cli

Conversation

@JoshuaKGoldberg

@JoshuaKGoldberg JoshuaKGoldberg commented Feb 24, 2026 •
edited by lwasser
Loading

Uh oh!

There was an error while loading. Please reload this page.

Copy link
Copy Markdown
Contributor

What:

Switches CommonJS (CJS) module.exports = and require() syntax to ECMAScript Modules (ESM) export ... and import ....

Fixes #435

Why:

ESM is the new standard for Node.js and other JavaScript application modules. It's a more precisely defined syntax that works better with tooling.

How:

  • package.json now has "type": "module", to change files to ESM by default
  • All CJS syntax in .js files is migrated to the equivalent ESM
    • I tried to avoid default exports and imports in favor of explicitly named ones
    • A few functions had to be renamed to resolve ambiguities

I verified these changes by running commands like node dist/cli.js add joshuakgoldberg code locally.

Checklist:

  • Documentation: N/A
  • Tests
  • Ready to be merged: no, someone who's been working more deeply in the code should take a deep dive
  • Added myself to contributors table: N/A / already there

The update below allows release please to recognize this pr as a breaking change.

******************* Updated 22 October 2026 ***********************

BEGIN_COMMIT_OVERRIDE
chore!: migrate from CJS to ESM (#456)
END_COMMIT_OVERRIDE

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

jdalrymple, lwasser, and stephansama reacted with heart emoji
All reactions
  • ❤️ 3 reactions
lwasser and others added 12 commits February 10, 2026 20:01
@lwasser
chore: migrate build/ babel to native configuration
586c53e
@lwasser
Apply suggestion from @lwasser
726ee57
@lwasser
Apply suggestion from @lwasser
4a7d016
@lwasser
fix
247a7bf
@lwasser
less stupid shell script
f5626f6
@JoshuaKGoldberg
chore: migrate from CJS to ESM
b7199cb
@JoshuaKGoldberg
Merge branch 'main'
4cf45ca
@JoshuaKGoldberg
Merge branch 'main' into cjs-to-esm-2
473de8f
@JoshuaKGoldberg
Merge branch 'main'
2f77838
@JoshuaKGoldberg
fix inquirer import
4dbfc14
@JoshuaKGoldberg
Revert fixtures default-ing
4b29bdd
@JoshuaKGoldberg
recreate package-lock.json
0fb0079
@JoshuaKGoldberg
JoshuaKGoldberg marked this pull request as ready for review February 25, 2026 04:40
@JoshuaKGoldberg JoshuaKGoldberg mentioned this pull request Feb 25, 2026
🛠️ Tooling: Switch from CJS to ESM #435
Closed
jdalrymple
jdalrymple approved these changes Feb 26, 2026
View reviewed changes

@jdalrymple jdalrymple left a comment

Copy link
Copy Markdown
Contributor

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've read through it a few times, nothing seems off to me. I had to brush up on some of the babel config docs, but looks good!

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lwasser reacted with rocket emoji
All reactions
  • 🚀 1 reaction
@jdalrymple

jdalrymple commented Feb 26, 2026

Copy link
Copy Markdown
Contributor

Ran it locally as well, looks good!

lwasser reacted with heart emoji
All reactions
  • ❤️ 1 reaction

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

lwasser
lwasser approved these changes Feb 27, 2026
View reviewed changes

@lwasser lwasser left a comment

Copy link
Copy Markdown
Member

There was a problem hiding this comment.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@JoshuaKGoldberg this looks great to me! I had to look up the add variable to ensure it wasn't a protected word / builtin function i'm so used to that in python. But this all looks great and i like the inline exports too!! Let's merge this given @jdalrymple already gave it a solid review and test and I just combed through the code as well. THANK YOU so much for this. It should unblock a lot of work around testing!! 🚀

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

JoshuaKGoldberg reacted with rocket emoji
All reactions
  • 🚀 1 reaction
@lwasser
lwasser merged commit 8b11060 into all-contributors:main Feb 27, 2026
5 checks passed

Uh oh!

There was an error while loading. Please reload this page.

@JoshuaKGoldberg
JoshuaKGoldberg deleted the cjs-to-esm-2 branch February 28, 2026 20:02
This was referenced Mar 6, 2026
chore(main): release all-contributors-cli 7.0.0 #476
Closed
chore(main): release 6.27.0 #483
Closed
This was referenced Oct 23, 2026
chore(main): release 6.27.0 #581
Closed
chore: force release version #582
Merged
chore(release): release 7.0.0 #583
Merged
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@jdalrymple jdalrymple jdalrymple approved these changes
@lwasser lwasser lwasser approved these changes

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

🛠️ Tooling: Switch from CJS to ESM

Uh oh!

There was an error while loading. Please reload this page.

3 participants

@JoshuaKGoldberg @jdalrymple @lwasser
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.