Skip to content

fix(graphql-types-generator): remove babel 6 runtime chain#1012

Open
michaelgiraldo wants to merge 1 commit into
aws-amplify:mainfrom
michaelgiraldo:codex/graphql-types-generator-dep-refresh
Open

fix(graphql-types-generator): remove babel 6 runtime chain#1012
michaelgiraldo wants to merge 1 commit into
aws-amplify:mainfrom
michaelgiraldo:codex/graphql-types-generator-dep-refresh

Conversation

@michaelgiraldo
Copy link
Copy Markdown

@michaelgiraldo michaelgiraldo commented Apr 7, 2026

Summary

Removes the Babel 6 runtime chain and rimraf@3 from @aws-amplify/graphql-types-generator.

This addresses the graphql-types-generator subset of aws-amplify/amplify-backend#3062 and overlaps the broader fresh-install issue in aws-amplify/amplify-backend#3135.

Changes

  • Replaced direct babel-generator@6 / babel-types@6 usage with @babel/generator / @babel/types
  • Aligned the package on a single Babel 7 type identity so the generator and AST types compile cleanly without alias shims
  • Removed the old @babel/* alias declaration files under src/flow-modern/types
  • Replaced rimraf usage with fs-extra in runtime and package scripts
  • Updated Flow-modern code generation to track annotation names directly instead of relying on type assertions around GenericTypeAnnotation.id

Strategy

The deprecated chain here was not just a version bump problem. The package still carried direct Babel 6 dependencies (babel-generator, babel-types) and rimraf@3, while also pulling in Babel 7 APIs. During the migration, the real type issue turned out to be duplicate @babel/types identities in the workspace, not missing types. This patch aligns the Babel packages, removes the old alias shims, and keeps the fix on the package that actually owns this dependency chain.

Verification

  • npx -y yarn@1.22.22 workspace @aws-amplify/graphql-types-generator build
  • npx -y yarn@1.22.22 workspace @aws-amplify/graphql-types-generator test --runInBand
  • Fresh temp install with published @aws-amplify/model-generator@1.2.2 showed:
    • babel-generator@6.26.1 -> babel-runtime@6.26.0 -> core-js@2.6.12
    • rimraf@3.0.2
  • Fresh temp install with the local packed tarball showed:
    • no babel-generator
    • no babel-runtime
    • no rimraf
    • core-js@3.49.0 only under @aws-amplify/graphql-types-generator

Maintainer Context

This PR is the first narrow package-owned slice of the deprecated dependency chain tracked in aws-amplify/amplify-backend#3062.

The companion PR #1013 addresses the separate @aws-amplify/appsync-modelgen-plugin -> relay-compiler@12 -> glob@7 -> inflight path. Together, those two PRs cover the main amplify-codegen-owned subtrees from the current repro.

Maintainer Ask

If this approach looks acceptable, please review this as an independent graphql-types-generator fix. Once merged and released, downstream repos can consume the published package and re-measure the broader fresh-install impact.

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