Skip to content

Feature/migrate to esm#919

Open
vbangelov wants to merge 2 commits intomasterfrom
feature/migrate-to-esm
Open

Feature/migrate to esm#919
vbangelov wants to merge 2 commits intomasterfrom
feature/migrate-to-esm

Conversation

@vbangelov
Copy link
Copy Markdown
Contributor

No description provided.

@vbangelov vbangelov requested a review from bd82 November 13, 2025 14:41
@bd82
Copy link
Copy Markdown
Member

bd82 commented Nov 13, 2025

Summary of our live discussion on this PR

General Comments

Firstly, this does not actually make yeoman-ui be ESM.
Because while TypeScript will now compile to ESM the bundling steps would still produce commonjs code.

Secondly the upgrade to vitest is very welcome, but perhaps should be done in a separate PR?

Suggested approach.

We must first clearly map the situation, there are a few variables:

  • Yeoman version when building the generators.
  • Yeoman Env used (by yo CLI / by `yeoman-ui vsix)
  • ESM vs CJS artifact of the generators.

It is possible the support for ESM generators is not a major concern because
bundling allows re-packaging ESM into CJS.

We should first focus on making sure we can run with modern yeoman-env version.

Docs to Checks

  • Backward/forward compatibility of Yeoman Generators and env in offical yeoman github.

Scenarios to create

  1. Yeoman 5.x Hello World Generator.
  2. Yeoman 6.x Hello World Generator.
  3. Yeoman 7.x Hello World Generator.

Initial Scenarios to test

  1. The "Hello world" generators with Different yeoman-env via yo CLI
    • Note: yo 6.x with env 5.0 was just released.
    • Note: this probably means we want to test env versions 3,4,5.

Bonus Scenario

Minimal VSIX that lunches a yeoman generator and bundles yeoman-env inside of it.
This could assist in:

  1. Identifying the APIs needed to lunch the generator (you mentioned this broke for you when upgrading to env 4.0
  2. Testing in a more isolated manner before attempting to upgrade the complex yeoman-ui vsix

Note1: this does not need any UI.
You can hard-code the generator being run and the params, for example create N specific commands
for N different generators / env combos.

Note2: You may need a different VSIX for env version due to bundling constraints.

Tools & Tips

  • We used npm link . to make a locally developed generator accessiable by yo without npm install -g (not published to npm...)
  • /extbin/globals to find package.json files of built-in generators
  • /extbin/generators to find the logs of installed generators on startup.

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.

2 participants