Skip to content

fix(cli-internal): pin typescript in generated Gen2 package.json#14925

Draft
sarayev wants to merge 2 commits into
devfrom
fix/gen2-pin-typescript
Draft

fix(cli-internal): pin typescript in generated Gen2 package.json#14925
sarayev wants to merge 2 commits into
devfrom
fix/gen2-pin-typescript

Conversation

@sarayev

@sarayev sarayev commented Jun 22, 2026

Copy link
Copy Markdown
Contributor

Problem

The gen2-migration generate command produces a root package.json with no typescript dependency, so migrated projects inherit whatever TypeScript happens to be present. Older TypeScript (<5.0) cannot parse the const type parameters in @aws-amplify/data-schema's .d.ts files, producing TS1139/TS1005 syntax errors during the type-check step. These are parser-level errors that skipLibCheck does not suppress.

Fix

Add typescript: ^5.4.0 to GEN2_DEV_DEPENDENCIES. maxVersion() keeps the higher of existing vs incoming, so an already-newer pin is preserved.

Test

Added a case to package.json.generator.test.ts asserting the generated devDependencies pin typescript at ^5.x. Existing snapshots updated accordingly.

Risk

Low. Only affects generated output; respects a customer's newer pin.

sarayev added 2 commits June 22, 2026 10:18
The gen2-migration generate command produced a root package.json with no
typescript dependency, so migrated projects inherited whatever TypeScript
version was already present. Older TypeScript (<5.0) cannot parse the
const type parameters used by @aws-amplify/data-schema's .d.ts files,
producing TS1139/TS1005 syntax errors during the type-check step (these
are parser-level errors that skipLibCheck does not suppress).

Pin typescript to ^5.4.0 in GEN2_DEV_DEPENDENCIES. maxVersion() keeps the
higher of existing vs incoming, so an already-newer pin is preserved.
…ures

Align the generated Gen2 typescript pin with the version already used by the
migration-app fixtures (~5.9.3) for consistency, and regenerate the
generate.test.ts golden snapshots. Only the typescript devDependency changes
in the affected fixtures (backend-only, discussions, mood-board).
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