Skip to content

feat!: switch from CJS to ESM and bump Yeoman packages #269

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 11 commits into
base: main
Choose a base branch
from

Conversation

JoshuaKGoldberg
Copy link
Contributor

@JoshuaKGoldberg JoshuaKGoldberg commented Mar 20, 2025

Purpose of this pull request?

Fixes #265.

  • Documentation update
  • Bug fix
  • Enhancement
  • Other, please explain: package dependencies and module update

What changes did you make?

  • Adds "type": "module" to the package.json
  • Bumps all Yeoman dependencies to the latest: in particular the production deps yeoman-generator and yosay
  • Bumps the package.json and build.yml Node.js versions to 18+
  • WIP: Bumps Jest and switches it to its experimental ESM support

Is there anything you'd like reviewers to focus on?

I opted not to update other dependencies such as Chalk to keep the change minimal. I'd suggest we hold off releasing a new major version with these changes until those come in too.

BREAKING CHANGE: Updates the Node.js engine minimum to ^18.17.0 || >=20.5.0 to align with the current "yeoman-generator" minimums.

@JoshuaKGoldberg JoshuaKGoldberg changed the title fix!: switch from CJS to ESM and bump Yeoman packages feat!: switch from CJS to ESM and bump Yeoman packages Mar 20, 2025
Copy link

socket-security bot commented Mar 20, 2025

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

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Updated@​jest/​globals@​26.6.2 ⏵ 29.7.010010060 +397100
Addedcross-env@​7.0.310010010077100

View full report

@JoshuaKGoldberg
Copy link
Contributor Author

Partially blocked by #270 -> #271.

Copy link

socket-security bot commented Mar 24, 2025

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

@JoshuaKGoldberg
Copy link
Contributor Author

  ● generator:app › scoped name › fills the README with project data

    TypeError: (intermediate value).resolve is not a function

      65 |     const readmeTpl = _.template(this.fs.read(this.templatePath('README.md')));
      66 |
    > 67 |     this.composeWith(import.meta.resolve('generator-node/generators/app'), {

jestjs/jest#14923, which is now newly available in Jest 30 (still in alpha). Fun timing.

@JoshuaKGoldberg
Copy link
Contributor Author

@mshima I'm having a hard time here. Could I ask for your help, please?

What I'm trying to do is get generator-generator onto the latest yeoman-generator version, to fix #265. I've tried a few strategies and each has test issues I haven't been able to debug:

@mshima
Copy link
Member

mshima commented Jun 24, 2025

Looks like jest doesn’t support 'node:test' module.

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.

Switch from CJS (CommonJS) to ESM (ECMAScript Modules)
2 participants