Skip to content

feat: migrate to ESM + yeoman-generator ^8 + Jest->Vitest (APPBLD-4615) - #85

Merged
AnujVishwakarma-src merged 2 commits into
adobe:mainfrom
AnujVishwakarma-src:APPBLD-4615-generator-add-action-generic-esm
Sep 15, 2026
Merged

AnujVishwakarma-src merged 2 commits into
adobe:mainfrom
AnujVishwakarma-src:APPBLD-4615-generator-add-action-generic-esm

Conversation

@AnujVishwakarma-src

@AnujVishwakarma-src AnujVishwakarma-src commented Sep 11, 2026 •

Copy link
Copy Markdown
Contributor

Track B — generator ESM migration (APPBLD-4615), L1 leaf

First of the 8 leaf generators. Migrates to native ESM + yeoman-generator ^5.4.2 -> ^8 (ESM-only, clears the deprecated glob/npmlog/inflight/rimraf/gauge cluster from the production tree), and consumes the ESM hub @adobe/generator-app-common-lib ^3 -> ^4.

What changed

  • index.js CJS -> ESM (__dirname via import.meta.url).
  • yeoman-generator ^8 + hub ^4.
  • Jest -> Vitest, coverage-preserving. Test-harness bumps: yeoman-test ^6 -> ^11, yeoman-environment ^3 -> ^4 so the ESM generator runs under helpers.run(). resolve.dedupe: ['yeoman-generator'] in the Vitest config keeps a single Generator instance (so x instanceof Generator holds).
  • eslint flat config: drops eslint-plugin-jest; adds Vitest test globals for test/**; keeps templates/** (the Jest test payloads emitted into generated apps) as CommonJS + Jest globals.

Validation (against a locally-linked ESM hub)

  • 4/4 tests, 100% coverage on index.js (identical to the Jest baseline) — including the 3 real helpers.run() generator executions.
  • npm run lint clean; npm run validate (tv run-checks) passes.

BREAKING CHANGE: package is now ESM ("type": "module").

- Converts index.js from CommonJS to native ESM (__dirname via import.meta.url).
- Bumps yeoman-generator ^5.4.2 -> ^8 (ESM-only) and the hub dep
  @adobe/generator-app-common-lib ^3 -> ^4 (its ESM major).
- Migrates tests from Jest to Vitest (yeoman-test ^6 -> ^11, yeoman-environment
  ^3 -> ^4 so the ESM generator runs under helpers.run); coverage preserved at
  100% (4 tests). `resolve.dedupe: ['yeoman-generator']` keeps a single Generator
  instance so `x instanceof Generator` holds.
- eslint flat config: drops eslint-plugin-jest; declares Vitest test globals and
  keeps the Jest template payloads (templates/**) as CommonJS + Jest globals
  (they are emitted verbatim into generated apps).

Depends on @adobe/generator-app-common-lib@4 (hub) being published.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@AnujVishwakarma-src
AnujVishwakarma-src marked this pull request as ready for review September 15, 2026 07:41
@codecov

codecov Bot commented Sep 15, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@AnujVishwakarma-src

Copy link
Copy Markdown
Contributor Author

/upload-coverage

@github-actions

Copy link
Copy Markdown

Coverage artifact not found. Re-run CI first, then comment /upload-coverage again.

@AnujVishwakarma-src
AnujVishwakarma-src merged commit 83f5a78 into adobe:main Sep 15, 2026
11 checks passed
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