Skip to content

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

Merged
AnujVishwakarma-src merged 2 commits into
adobe:mainfrom
AnujVishwakarma-src:APPBLD-4615-generator-app-common-lib-esm
Sep 15, 2026
Merged

AnujVishwakarma-src merged 2 commits into
adobe:mainfrom
AnujVishwakarma-src:APPBLD-4615-generator-app-common-lib-esm

Conversation

@AnujVishwakarma-src

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

Copy link
Copy Markdown
Contributor

Track B — generator ESM migration (APPBLD-4615), hub / pilot

generator-app-common-lib is the base every app-builder generator extends, so it migrates first. This bumps yeoman-generator ^5.5.2 -> ^8 (ESM-only), which is what actually clears the deprecated glob/npmlog/inflight/rimraf/gauge/are-we-there-yet cluster from the aio-cli production tree.

What changed

  • Source CJS -> native ESM (index.js + all of lib/): require->import (extensions added), module.exports->export, __dirname via import.meta.url. Template payloads under lib/common-templates/* are intentionally left as-is (emitted verbatim into scaffolded user apps).
  • yeoman-generator ^5.5.2 -> ^8 (ESM-only). Verified the base Generator API used here (option/prompt/destinationPath/templatePath/optionsHelp) is unchanged on v8.
  • Jest -> Vitest, coverage-preserving.
  • ESM-interop fixes: @adobe/aio-lib-ims is default-imported (named getToken isn't exposed under ESM); the deep @adobe/aio-lib-ims/src/context import now carries the .js extension.

Validation

  • 76/76 tests, 7 suites green; coverage 100% statements/branches/functions/lines — identical to the pre-migration Jest baseline.
  • npm run lint clean (swapped eslint-plugin-jest -> standard + explicit test globals).
  • Production tree free of the deprecated cluster (npm ls --omit=dev shows none of glob/npmlog/inflight/rimraf/gauge); yeoman-generator@8.4.0 resolved.
  • One behaviour note: a utils test relied on CJS sloppy-mode silently no-op'ing a property write onto a string; under ESM strict mode that throws, so the test mock now feeds realistic YAML (assertion + coverage unchanged).

BREAKING CHANGE: package is now ESM ("type": "module") — consumers must import it via ESM.

- Converts all source (index + lib) from CommonJS to native ESM.
- Bumps yeoman-generator ^5.5.2 -> ^8 (ESM-only), which drops the deprecated
  glob/npmlog/inflight/rimraf/gauge/are-we-there-yet cluster from the production
  tree (verified: `npm ls --omit=dev` clean).
- Migrates the test suite from Jest to Vitest, coverage preserved at 100%
  (76 tests / 7 suites; statements/branches/functions/lines all 100%).
- Template payloads under lib/common-templates/* are intentionally left as-is
  (emitted verbatim into scaffolded apps).

Part of the Track B generator ESM migration; this is the hub every other
app-builder generator extends, so it lands first.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@AnujVishwakarma-src
AnujVishwakarma-src force-pushed the APPBLD-4615-generator-app-common-lib-esm branch from 3033cf3 to e92519c Compare September 15, 2026 07:40
@AnujVishwakarma-src
AnujVishwakarma-src marked this pull request as ready for review September 15, 2026 07:41

@aroragarvit666-hue aroragarvit666-hue left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

LGTM. Please publish as major version.

@AnujVishwakarma-src
AnujVishwakarma-src removed the request for review from adobe-bot September 15, 2026 09:48
@AnujVishwakarma-src
AnujVishwakarma-src merged commit 329d570 into adobe:main Sep 15, 2026
10 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.

2 participants