aws-amplify / aws-amplify/amplify-codegen-ui
Supported version declaration for TypeScript seems to be incorrect
- Dominant language
- TypeScript
- Stars
- 31
- Forks
- 30
- PR merge metrics
- No merged PRs in 30d
Description
It seems that this package only supports TypeScript >= 4.0.0 because the TypeScript factory API was introduced in TypeScript 4.
With the current dependecy declaration, TypeScript 3 is also considered a valid dependency version. This has resulted in an error when I have installed this package in combination with another package that depends on TypeScript 3 (pnpm has opted to use TypeScript 3 too for this package).
https://github.com/aws-amplify/amplify-codegen-ui/blob/b155d2a7355fa40e72b84a7c24311926dc931368/packages/codegen-ui-react/package.json#L41
Sources for that the TypeScript factory API was introduced in TypeScript 4:
* https://www.typescriptlang.org/docs/handbook/release-notes/typescript-4-0.html#usage-of-typescripts-node-factory-is-deprecated
* https://github.com/microsoft/TypeScript/pull/35282
## Suggestion for fix
I suggest to change the version constraint for TypeScript to `>=4.0.0 <=4.5.0`.
## How to fix it in a project
For PNPM I have added the following to pnpm-workspace.yaml:
```yaml
overrides:
"@aws-amplify/codegen-ui-react>typescript": ">=4.0.0 <=4.5.0"
```
Contributor guide
Research direction
Open packages/codegen-ui-react/package.json and inspect the TypeScript dependency declaration at the referenced line. Update the supported version range to match the issue's stated compatibility, then verify that the published package metadata no longer permits TypeScript 3.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100