Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace superstruct with ESM-compatible fork @metamask/superstruct #611

Closed
MajorLift opened this issue May 30, 2024 · 0 comments · Fixed by #613
Closed

Replace superstruct with ESM-compatible fork @metamask/superstruct #611

MajorLift opened this issue May 30, 2024 · 0 comments · Fixed by #613

Comments

@MajorLift
Copy link
Contributor

MajorLift commented May 30, 2024

Explanation

As part of the Wallet Framework Team's OKR (Q2 2024 O3KR4) for upgrading TypeScript to v5.0+ in the core monorepo, we are updating dependencies of the core repo so that they generate builds and type declarations for both CJS and ESM.

This requirement applies to nested dependencies as well, so we are also replacing superstruct with the ESM-compatible fork @metamask/superstruct in all core dependency packages.

Description

  • Replace superstruct dependency with @metamask/superstruct v3.0.0.
  • Replace all superstruct import statements with @metamask/superstruct.
  • Bump @metamask/utils to v9.0.0 (see Use @metamask/superstruct, set moduleResolution to NodeNext utils#185).
  • If feasible without too much additional work, set module and moduleResolution tsconfig options to NodeNext and TypeScript to v5.
  • Create new release applying these changes.

References

@MajorLift MajorLift self-assigned this May 30, 2024
MajorLift added a commit that referenced this issue Jun 12, 2024
## Explanation

As part of the Wallet Framework Team's OKR (Q2 2024 O3KR4) for upgrading
TypeScript to v5.0+ in the core monorepo, we are updating dependencies
of the core repo so that they generate builds and type declarations for
both CJS and ESM.

This requirement applies to nested dependencies as well, so we are also
replacing `superstruct` with the ESM-compatible fork
`@metamask/superstruct` in all core dependency packages.

## Description

- [x] Replace `superstruct` dependency with `@metamask/superstruct`
`^3.0.0`.
- [x] Replace all `superstruct` import statements with
`@metamask/superstruct`
- [x] Bump `@metamask/utils` to `^8.5.0`.
- [x] If feasible without too much additional work:
  - [ ] ~Bump `typescript` to `~5.0.4`~
- [x] Set tsconfig options `module` and `moduleResolution` to
`NodeNext`.
- [ ] Using the `create-release-pr` github action, publish a new release
containing these changes.

## References

- Closes #611

## Changelog

```md
## [3.1.1]
### Changed
- Bump `@metamask/utils` from `^8.3.0` to `^8.5.0` ([#613](#613))

### Fixed
- Replace `superstruct` with ESM-compatible `@metamask/superstruct` `^3.0.0` ([#613](#613))
  - This fixes the issue of this package being unusable by any TypeScript project that uses `Node16` or `NodeNext` as its `moduleResolution` option.
```
@MajorLift MajorLift reopened this Jun 25, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant