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' imports with '@metamask/superstruct' #613

Merged
merged 6 commits into from
Jun 12, 2024

Conversation

MajorLift
Copy link
Contributor

@MajorLift 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 ^3.0.0.
  • Replace all superstruct import statements with @metamask/superstruct
  • Bump @metamask/utils to ^8.5.0.
  • If feasible without too much additional work:
    • Bump typescript to ~5.0.4
    • Set tsconfig options module and moduleResolution to NodeNext.
  • Using the create-release-pr github action, publish a new release containing these changes.

References

Changelog

## [3.1.1]
### Changed
- Bump `@metamask/utils` from `^8.3.0` to `^8.5.0` ([#613](https://github.com/MetaMask/snaps-registry/pull/613))

### Fixed
- Replace `superstruct` with ESM-compatible `@metamask/superstruct` `^3.0.0` ([#613](https://github.com/MetaMask/snaps-registry/pull/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 self-assigned this May 30, 2024
@MajorLift MajorLift force-pushed the replace-superstruct-with-fork branch 2 times, most recently from ac1581f to fe4cb81 Compare May 30, 2024 21:18
@MajorLift MajorLift force-pushed the replace-superstruct-with-fork branch 2 times, most recently from c5ab481 to 56fd696 Compare June 7, 2024 00:11
Copy link

socket-security bot commented Jun 7, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@babel/code-frame@7.24.7 environment +10 194 kB nicolo-ribaudo
npm/@babel/core@7.24.7 environment, filesystem, unsafe Transitive: shell +24 4.62 MB nicolo-ribaudo
npm/@babel/generator@7.24.7 None +3 625 kB nicolo-ribaudo
npm/@babel/helper-plugin-utils@7.24.7 None 0 127 kB nicolo-ribaudo
npm/@babel/parser@7.24.7 None 0 1.89 MB nicolo-ribaudo
npm/@babel/template@7.24.7 None 0 69 kB nicolo-ribaudo
npm/@babel/traverse@7.24.7 None +5 720 kB nicolo-ribaudo
npm/@babel/types@7.24.7 environment +3 2.5 MB nicolo-ribaudo
npm/@eslint-community/regexpp@4.10.1 None 0 432 kB eslint-community-bot
npm/@jridgewell/resolve-uri@3.1.2 None 0 53.2 kB jridgewell
npm/@jridgewell/trace-mapping@0.3.25 None 0 169 kB jridgewell
npm/@lavamoat/allow-scripts@2.5.1 environment, filesystem, shell Transitive: network +81 4.35 MB boneskull
npm/@metamask/json-rpc-engine@8.0.2 None +2 362 kB metamaskbot
npm/@metamask/snaps-controllers@8.4.0 Transitive: environment, filesystem, network +57 12.7 MB metamaskbot
npm/@metamask/snaps-sdk@4.4.2 network +14 3.49 MB metamaskbot
npm/@metamask/snaps-utils@7.5.0 network Transitive: environment, filesystem, unsafe +43 17.9 MB metamaskbot
npm/@metamask/superstruct@3.0.0 None 0 436 kB metamaskbot
npm/@metamask/utils@8.5.0 Transitive: network +13 2.27 MB metamaskbot
npm/@noble/curves@1.4.0 None 0 1.39 MB paulmillr
npm/@scure/base@1.1.6 None 0 80.4 kB paulmillr
npm/@types/babel__traverse@7.20.6 None 0 84.1 kB types
npm/@types/istanbul-lib-coverage@2.0.6 None 0 5.45 kB types
npm/@types/jest@28.1.8 None 0 73.6 kB types
npm/@typescript-eslint/eslint-plugin@5.62.0 Transitive: environment, filesystem +14 5.18 MB jameshenry
npm/@typescript-eslint/parser@5.62.0 Transitive: environment, filesystem +11 1.86 MB jameshenry
npm/@typescript-eslint/utils@5.62.0 Transitive: environment, filesystem +17 2.9 MB jameshenry
npm/acorn@8.11.3 None 0 531 kB marijn
npm/agent-base@7.1.1 network 0 31.2 kB tootallnate
npm/dotenv@16.4.5 environment, filesystem 0 79.1 kB motdotla
npm/es-shim-unscopables@1.0.2 None 0 11 kB ljharb
npm/escalade@3.1.2 filesystem 0 11.6 kB lukeed
npm/eslint-config-prettier@8.10.0 None 0 19.9 kB lydell
npm/eslint-plugin-import@2.29.1 filesystem, unsafe +7 1.46 MB ljharb
npm/eslint-plugin-jest@27.9.0 filesystem 0 325 kB simenb
npm/eslint-plugin-jsdoc@39.9.1 None +6 2.32 MB gajus
npm/eslint-plugin-promise@6.2.0 None 0 69.6 kB eslint-community-bot
npm/eslint-visitor-keys@3.4.3 None 0 32.3 kB eslintbot
npm/eslint@8.57.0 environment, filesystem Transitive: eval, unsafe +46 7.47 MB eslintbot
npm/espree@9.6.1 None +1 98 kB eslintbot
npm/esquery@1.5.0 None 0 1 MB michaelficarra
npm/estraverse@5.3.0 None 0 37.1 kB michaelficarra
npm/fast-glob@3.3.2 filesystem +6 259 kB mrmlnc
npm/fsevents@2.3.3 None 0 173 kB pipobscure
npm/glob@7.2.3 filesystem Transitive: environment +4 78.8 kB isaacs
npm/ignore@5.3.1 None 0 51.5 kB kael
npm/is-symbol@1.0.4 None 0 22 kB ljharb
npm/istanbul-lib-coverage@3.2.2 None 0 34.4 kB oss-bot
npm/istanbul-lib-instrument@5.2.1 None +1 87.4 kB oss-bot
npm/jest-it-up@2.2.0 filesystem Transitive: environment, shell +12 1.85 MB rbardini
npm/minimist@1.2.8 None 0 54.5 kB ljharb
npm/minipass@7.1.2 None 0 286 kB isaacs
npm/picocolors@1.0.1 environment 0 5.15 kB alexeyraspopov
npm/picomatch@2.3.1 None 0 90 kB mrmlnc
npm/prettier-plugin-packagejson@2.5.0 Transitive: environment, filesystem +14 255 kB matzkoh
npm/resolve@1.22.8 environment, filesystem +2 159 kB ljharb
npm/semver@7.6.2 None 0 95.4 kB npm-cli-ops
npm/socks@2.8.3 network +4 558 kB joshglazebrook
npm/tar@6.2.1 environment, filesystem +4 304 kB isaacs
npm/ts-node@10.9.2 environment, filesystem, unsafe +12 1.39 MB blakeembrey
npm/undici-types@5.26.5 None 0 73.1 kB ethan_arrowood
npm/webextension-polyfill@0.12.0 None 0 205 kB addons-robot

🚮 Removed packages: npm/@babel/code-frame@7.22.13, npm/@babel/core@7.23.2, npm/@babel/generator@7.23.0, npm/@babel/helper-plugin-utils@7.16.7, npm/@babel/helper-validator-identifier@7.22.20, npm/@babel/parser@7.23.0, npm/@babel/template@7.22.15, npm/@babel/traverse@7.23.2, npm/@babel/types@7.23.0, npm/@jridgewell/gen-mapping@0.3.3, npm/@jridgewell/trace-mapping@0.3.19, npm/@lavamoat/allow-scripts@2.3.1, npm/@metamask/controller-utils@9.1.0, npm/@metamask/snaps-controllers@8.2.0, npm/@metamask/snaps-sdk@4.3.0, npm/@metamask/snaps-utils@7.4.0, npm/@metamask/utils@8.4.0, npm/@noble/curves@1.2.0, npm/@scure/base@1.1.3, npm/@types/babel__traverse@7.0.14, npm/@types/istanbul-lib-coverage@2.0.3, npm/@types/jest@28.1.7, npm/@typescript-eslint/eslint-plugin@5.43.0, npm/@typescript-eslint/parser@5.43.0, npm/@typescript-eslint/utils@5.43.0, npm/acorn@8.8.0, npm/builtins@5.0.1, npm/dotenv@16.0.3, npm/eslint-config-prettier@8.5.0, npm/eslint-plugin-import@2.28.1, npm/eslint-plugin-jest@27.1.5, npm/eslint-plugin-jsdoc@39.6.2, npm/eslint-plugin-promise@6.1.1, npm/eslint@8.28.0, npm/estraverse@5.2.0, npm/fast-glob@3.2.11, npm/fsevents@2.3.2, npm/glob@7.1.6, npm/ignore@5.2.0, npm/is-symbol@1.0.3, npm/istanbul-lib-coverage@3.2.0, npm/istanbul-lib-instrument@5.1.0, npm/jest-it-up@2.0.2, npm/minimist@1.2.6, npm/minipass@3.3.4, npm/picomatch@2.3.0, npm/prettier-plugin-packagejson@2.3.0, npm/resolve@1.22.4, npm/safe-buffer@5.1.2, npm/semver@7.5.4, npm/string_decoder@1.0.3, npm/superstruct@1.0.3, npm/tar@6.1.11, npm/ts-node@10.7.0, npm/webextension-polyfill@0.10.0

View full report↗︎

Copy link

socket-security bot commented Jun 7, 2024

🚨 Potential security issues detected. Learn more about Socket for GitHub ↗︎

To accept the risk, merge this PR and you will not be notified again.

Alert Package NoteSource
Deprecated npm/glob@7.2.3
  • Reason: Glob versions prior to v9 are no longer supported
New author npm/istanbul-lib-report@3.0.1
New author npm/istanbul-lib-source-maps@4.0.1
New author npm/anymatch@3.1.3
New author npm/fb-watchman@2.0.2
Network access npm/fb-watchman@2.0.2
Shell access npm/fb-watchman@2.0.2
Network access npm/https-proxy-agent@5.0.1
Network access npm/https-proxy-agent@5.0.1
Deprecated npm/glob@8.1.0
  • Reason: Glob versions prior to v9 are no longer supported
New author npm/supports-hyperlinks@2.3.0
Shell access npm/commander@9.5.0
New author npm/fast-diff@1.3.0
New author npm/abbrev@2.0.0
  • orphan: npm/abbrev@2.0.0
Network access npm/agentkeepalive@4.5.0
Network access npm/agentkeepalive@4.5.0
New author npm/@npmcli/fs@2.1.2
Deprecated npm/@npmcli/move-file@2.0.1
  • Reason: This functionality has been moved to @npmcli/fs
Deprecated npm/are-we-there-yet@3.0.1
  • Reason: This package is no longer supported.
New author npm/are-we-there-yet@3.0.1
Network access npm/make-fetch-happen@10.2.1
Network access npm/make-fetch-happen@10.2.1
Network access npm/make-fetch-happen@10.2.1
Network access npm/make-fetch-happen@10.2.1
Network access npm/make-fetch-happen@10.2.1
Network access npm/make-fetch-happen@10.2.1
Network access npm/make-fetch-happen@10.2.1
Network access npm/minipass-fetch@2.1.2
Network access npm/minipass-fetch@2.1.2
Network access npm/minipass-fetch@2.1.2
New author npm/unique-slug@3.0.0
New author npm/@lavamoat/aa@3.1.5
New author npm/node-gyp@9.4.1
Shell access npm/node-gyp@9.4.1
New author npm/@lavamoat/allow-scripts@2.5.1
Shell access npm/@lavamoat/allow-scripts@2.5.1
Deprecated npm/@humanwhocodes/config-array@0.11.14
  • Reason: Use @eslint/config-array instead
New author npm/rfdc@1.3.1
New author npm/diff@5.2.0
Network access npm/https-proxy-agent@7.0.4
  • orphan: npm/https-proxy-agent@7.0.4
Network access npm/https-proxy-agent@7.0.4
  • orphan: npm/https-proxy-agent@7.0.4
New author npm/superstruct@1.0.4
Shell access npm/node-gyp@10.1.0
  • orphan: npm/node-gyp@10.1.0
Network access npm/socks-proxy-agent@8.0.3
  • orphan: npm/socks-proxy-agent@8.0.3
Network access npm/agent-base@7.1.1
Network access npm/agent-base@7.1.1
Network access npm/agent-base@7.1.1
Deprecated npm/@humanwhocodes/object-schema@2.0.3
  • Reason: Use @eslint/object-schema instead
Network access npm/@npmcli/agent@2.2.2
  • orphan: npm/@npmcli/agent@2.2.2
Network access npm/@npmcli/agent@2.2.2
  • orphan: npm/@npmcli/agent@2.2.2
Network access npm/@npmcli/agent@2.2.2
  • orphan: npm/@npmcli/agent@2.2.2
Network access npm/@npmcli/agent@2.2.2
  • orphan: npm/@npmcli/agent@2.2.2
Network access npm/@npmcli/agent@2.2.2
  • orphan: npm/@npmcli/agent@2.2.2
Network access npm/socks@2.8.3
Network access npm/make-fetch-happen@13.0.1
  • orphan: npm/make-fetch-happen@13.0.1
Network access npm/make-fetch-happen@13.0.1
  • orphan: npm/make-fetch-happen@13.0.1
Network access npm/make-fetch-happen@13.0.1
  • orphan: npm/make-fetch-happen@13.0.1
Network access npm/minipass-fetch@3.0.5
  • orphan: npm/minipass-fetch@3.0.5
Network access npm/minipass-fetch@3.0.5
  • orphan: npm/minipass-fetch@3.0.5
Network access npm/minipass-fetch@3.0.5
  • orphan: npm/minipass-fetch@3.0.5
New author npm/validate-npm-package-name@5.0.1
  • New Author:

@MajorLift MajorLift marked this pull request as ready for review June 7, 2024 00:22
@MajorLift MajorLift requested a review from a team as a code owner June 7, 2024 00:22
mcmire
mcmire previously approved these changes Jun 7, 2024
Copy link

@mcmire mcmire left a comment

Choose a reason for hiding this comment

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

Makes sense to me.

package.json Outdated
@@ -69,7 +69,7 @@
"semver": "^7.5.4",
"ts-jest": "^28.0.7",
"ts-node": "^10.7.0",
"typescript": "~4.8.4"
"typescript": "~5.0.4"
Copy link

Choose a reason for hiding this comment

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

Similar question as for MetaMask/abi-utils#73: Are we upgrading to TypeScript just to verify that we are able to switch to moduleResolution = nodenext and therefore ensure that the upgrade to @metamask/superstruct doesn't produce the same errors that we were seeing in core? In other words, is this upgrade required to use @metamask/superstruct? If it's not, should we do it in a different PR?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

The typescript version bump isn't required for enabling nodenext. We can definitely merge the compiler options changes first.

But since we're not seeing any regressions in CI, it seemed safe to include the typescript upgrade here, especially given it's a devDep.

Copy link

Choose a reason for hiding this comment

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

Hmm, I guess upgrading this dependency and upgrading TypeScript seem like separate concerns to me, so maybe we ought to have them in separate PRs so they're easier to trace later if need be?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Reverted the typescript bumps here and in the other open PRs:
MetaMask/eth-snap-keyring#311
MetaMask/keyring-api#328
MetaMask/abi-utils#73

@MajorLift MajorLift requested a review from mcmire June 12, 2024 17:48
@MajorLift MajorLift merged commit d43fa26 into main Jun 12, 2024
15 of 16 checks passed
@MajorLift MajorLift deleted the replace-superstruct-with-fork branch June 12, 2024 17:54
MajorLift added a commit to MetaMask/core that referenced this pull request Jul 22, 2024
…ode16` (#3645)

## Explanation

### TypeScript v5.0

As part of the Wallet Framework Team's OKRs (Q2 2024 O3KR4, Q3 2024 O2KR4),
we are upgrading TypeScript to v5.0+ for all packages in the core
monorepo.

These upgrades will give us access to new features, aid us in writing
more type-safe and modern code, and also allow us to reach parity with
Extension and other MetaMask projects.

### `Node16`

In order to maximize the benefits of this upgrade, we are also enabling
the `Node16` setting for the `module` and `moduleResolution` tsconfig
options.

## Motivation

### Interop: CJS modules referencing ESM modules

The core monorepo is a collection of CJS packages, which use CJS module
resolution rules internally, and are treated as CJS modules by Node.js.
This is true despite that fact that these packages are authored in
TypeScript using ESM syntax (`import`/`export` statements) and are set
up to output dual builds for both CJS and ESM.

With `Node16` or `NodeNext` enabled, CJS modules are unable to reference
ESM modules via static/synchronous `import` statements, as TypeScript
assumes them to be compiled down to CJS-only `require` statements.

There are three solutions for this issue, of which we are utilizing the
first two:
1. Update the ESM-only dependency so that it outputs a CJS build and
type declaration as well.
2. Replace the static `import` statements with dynamic import syntax
(which, based on CJS emit rules, are not transformed to `require`
statements).
3. Migrate our module to ESM (by setting `"type": "module"` in
package.json and renaming all of our scripts to *.cjs)

> See
https://www.typescriptlang.org/docs/handbook/modules/reference.html#interoperability-rules

With dependencies that we control or use extensively, we pursue the
first option, as we're doing with `superstruct` and `@metamask/utils`
(and all of the many core dependencies that are downstream of either or
both).

With dependencies that see more limited usage, we are opting for either
the second option (e.g. `multiformats`) or, if available, using a
CJS-compatible alternative (e.g. replacing `lodash-es` with `lodash`).

The third solution of migrating to ESM is the most fundamental,
long-term measure, but we are refraining from it at this stage until we
can make a concerted effort to migrate our codebase as a whole. This is
because any individual ESM migration can cause a cascading effect
through the dependency tree where other packages are now required to
migrate as well.

### Reasons for moving away from `node`/`node10`

The following outlines the motivation for switching to `Node16`, backed
by relevant entries from the official TypeScript documentation.
- Starting with TypeScript v5.0, the previously used `moduleResolution`
setting `node` is renamed to `node10`, and strongly discouraged from
usage.
- "It [reflects the CommonJS module resolution algorithm as it existed
in Node.js versions earlier than
v12](https://www.typescriptlang.org/docs/handbook/modules/reference.html#node10-formerly-known-as-node).
**It should no longer be used.**"
- "Because `node16` and `nodenext` are the only module options that
reflect the complexities of Node.js’s dual module system, they are the
[**only correct module options** for all apps and libraries that are
intended to run in Node.js v12 or
later](https://www.typescriptlang.org/docs/handbook/modules/reference.html#node16-nodenext),
whether they use ES modules or not."
- The `node10` setting is unable to guarantee correct module resolution
for ESM-only dependencies.
- "[Because Node.js v12 introduced different module resolution rules for
ES
modules,](https://www.typescriptlang.org/docs/handbook/modules/theory.html#module-resolution)
though, it’s a very bad model of modern versions of Node.js. It should
not be used for new projects."
- "`node16` and `nodenext` describe the full range of behavior for
Node.js’s dual-format module system, and **emit files in either CommonJS
or ESM format**. This is different from every other `module` option,
which are runtime-agnostic and force all output files into a single
format, [leaving it to the user to ensure the output is valid for their
runtime.](https://www.typescriptlang.org/docs/handbook/modules/reference.html#node16-nodenext)"
- The `node10` setting does not support the package.json `"exports"`
field, which is used in our libraries to expose dual builds and type
declarations.
-
https://www.typescriptlang.org/docs/handbook/modules/reference.html#packagejson-exports
- The `Node16` and `NodeNext` settings maximize downstream
compatibility.
- "When compiling a library, you don’t know where the output code will
run, but you’d like it to run in as many places as possible. Using
"module": "nodenext" (along with the implied "moduleResolution":
"nodenext") is the best bet for maximizing the compatibility of the
output JavaScript’s module specifiers, since [it will force you to
comply with Node.js’s stricter rules for import module
resolution.](https://www.typescriptlang.org/docs/handbook/modules/theory.html#module-resolution-for-libraries)"
- "`"moduleResolution": "nodenext"` is only checking that the output
works in Node.js, but in most cases, [module code that works in Node.js
will work in other runtimes and in
bundlers](https://www.typescriptlang.org/docs/handbook/modules/theory.html#module-resolution-for-libraries)"
  
#### `Node16` vs. `NodeNext`

The two settings are currently identical, and `Node16` is intended to
work with all current node versions v16 or higher. If additional
capabilities are added to `NodeNext` or `Node18`/`Node20` that we want
to apply to our codebases, we will be able to introduce them after
checking for disruptive regressions or breaking changes.

#### Relationship with other tsconfig options

- `--module` `nodenext` or `node16` implies and enforces the
`moduleResolution` with the same name (and vice versa).
- `--module` `node16` implies (up to) `--target` `es2022`.
  - `--module` `nodenext` implies (up to) `--target` `esnext`.
>
https://www.typescriptlang.org/docs/handbook/modules/reference.html#implied-and-enforced-options

## Description

- [x] Replace `superstruct` dependency with `@metamask/superstruct`
`^3.0.0`.
  - [x] `^3.1.0`
- [x] Replace all `superstruct` import statements with
`@metamask/superstruct`
- [x] Bump `@metamask/utils` to `^8.5.0`.
  - [x] `^9.0.0`
    - [x] remove yarn resolution to `@metamask/superstruct@npm:3.1.0`
- [x] Bump `typescript` to `~5.0.4`
  - [x] Set `module` and `moduleResolution` tsconfig options to `Node16`
  - [ ] ~#4507
  
Further context on why the `superstruct` and `utils` changes are
necessary:
- MetaMask/utils#144
- MetaMask/superstruct#1
- MetaMask/superstruct#18
- MetaMask/utils#182
- MetaMask/metamask-module-template#247
-
https://www.typescriptlang.org/docs/handbook/modules/guides/choosing-compiler-options.html#considerations-for-bundling-libraries

## Release order roadmap

Due to interdependencies between the packages involved in this PR, we
will need to update and release them in a specific order:

- [x] #4516
- [x] Release `{base,permission}-controller`
- [x] (wait for releases: `snaps-sdk`, `snaps-utils`,
`snaps-controllers`, `keyring-api`)
  - [x] MetaMask/keyring-api#356
  - [x] MetaMask/snaps#2445
  - [x] MetaMask/snaps#2584
  - [x] MetaMask/snaps#2589
- [x] Remove yarn resolutions for `snaps-sdk`, `snaps-utils`,
~`keyring-api`~
- [ ] Merge this PR: #3645
- [x] Set yarn resolution for `@metamask/providers` via
`@metamask/snaps-sdk` to `17.1.1`
- [x] Leave messages in Changelog for affected packages
(`{accounts,chain,profile-sync}-controller`) to hold off on new releases
    ```md
    ### Uncategorized

- Please hold off on new releases of this package until the yarn
resolution for `@metamask/providers` is removed.
- This is blocked by a `@metamask/snaps-sdk` release with
`@metamask/providers` bumped to `>=17.1.1`.
- See: [Fix regressions introduced by
@metamask/providers@17.1.1](MetaMask/snaps#2579)
- Build error fixed by yarn resolution:
[MetaMask/core/actions/runs/10011688901/job/27675682526?pr=3645](https://github.com/MetaMask/core/actions/runs/10011688901/job/27675682526?pr=3645)
    ```
- [ ] Release all core pkgs (especially deps of `snaps-controllers` and
consumers of `utils`)
- Exclude core pkgs that have `snaps-controllers` as dependency, and are
affected by `@metamask/providers` yarn resolution
    - `{accounts,chain,profile-sync}-controller`
- [ ] Release `snaps-controllers`
- [ ] Release `{accounts,chain,profile-sync}-controller`,
`eth-snap-keyring`
(MetaMask/eth-snap-keyring#311)
- [ ] (release remaining `snaps` packages while releasing
`@metamask/utils@9.0.0` version bumps for all dependencies and nested
dependencies)

## References

- Contributes to #3651
- Blocked by:
  - `superstruct`
    - [x] MetaMask/superstruct#18
    - [x] MetaMask/superstruct#24
    - [x] MetaMask/superstruct#25
    - [x] MetaMask/superstruct#28
  - `utils`
    - [x] MetaMask/utils#185
    - [x] MetaMask/utils#191
    - [x] MetaMask/utils#194
    - [x] MetaMask/utils#196
- Blocked by downstream consumers of `superstruct`, `utils`:
  - `abi-utils`: 
    - [x] MetaMask/abi-utils#73
    - [x] MetaMask/abi-utils#78
    - [x] MetaMask/abi-utils#80
    - [x] MetaMask/abi-utils#81
  - `chain-api`: 
    - [x] MetaMask/accounts-chain-api#5
- [x] https://github.com/MetaMask/accounts-chain-api/releases/tag/v0.1.0
  - `eth-simple-keyring`: 
    - [x] MetaMask/eth-simple-keyring#177
    - [x] MetaMask/eth-simple-keyring#178
  - `providers`:
    - [x] MetaMask/providers#336
    - [x] MetaMask/providers#337
- Blocked by MetaMask/providers#340,
ts-bridge/ts-bridge#22
- Causes CI failure:
https://github.com/MetaMask/snaps/actions/runs/9783767567/job/27013136688?pr=2445
    - [x] MetaMask/providers#345
    - [x] MetaMask/providers#347
  - `rpc-errors`: 
    - [x] MetaMask/rpc-errors#147
    - [x] MetaMask/rpc-errors#148    
  - `snaps-registry`:
    - [x] MetaMask/snaps-registry#613
    - [x] MetaMask/snaps-registry#670
    - [x] MetaMask/snaps-registry#693
    - [x] MetaMask/snaps-registry#694
- Blocked by `snaps` monorepo releases
  - `snaps-sdk`, `snaps-utils`
    - `keyring-api`
      - [x] MetaMask/keyring-api#328
  - `snaps-controllers` 
    - `eth-snap-keyring`
      - [x] MetaMask/eth-snap-keyring#311

## Changelog

### `@metamask/accounts-controller`

```md
### Changed

- Bump `@metamask/keyring-api` from `^8.0.0` to `^8.0.1` ([#3645](#3645))
- Bump `@metamask/snaps-sdk` from `^4.2.0` to `^6.1.0` ([#3645](#3645))
- Bump `@metamask/snaps-utils` from `^7.4.0` to `^7.8.0` ([#3645](#3645))
- Bump peer dependency `@metamask/snaps-controllers` from `^8.1.1` to `^9.3.0` ([#3645](#3645))
```

### `@metamask/assets-controllers` (major)

```md
### Changed

- **BREAKING:** `getIpfsCIDv1AndPath`, `getFormattedIpfsUrl` are now async functions ([#3645](#3645))
- Add `immer` `^9.0.6` as a new dependenc. ([#3645](#3645))
- Bump `@metamask/abi-utils` from `^2.0.2` to `^2.0.3` ([#3645](#3645))
- Bump `multiformats` from `^9.5.2` to `^13.1.0` ([#3645](#3645))
```

### `@metamask/chain-controller`

```md
### Changed

- Bump `@metamask/chain-api` from `^0.0.1` to `^0.1.0` ([#3645](#3645))
- Bump `@metamask/keyring-api` from `^8.0.0` to `^8.0.1` ([#3645](#3645))
- Bump `@metamask/snaps-controllers` from `^8.1.1` to `^9.3.0` ([#3645](#3645))
- Bump `@metamask/snaps-sdk` from `^4.2.0` to `^6.1.0` ([#3645](#3645))
- Bump `@metamask/snaps-utils` from `^7.4.0` to `^7.8.0` ([#3645](#3645))
```

### `@metamask/keyring-controller`

```md
### Changed

- Bump `@metamask/eth-simple-keyring` from `^6.0.1` to `^6.0.2` ([#3645](#3645))
- Bump `@metamask/keyring-api` from `^8.0.0` to `^8.0.1` ([#3645](#3645))
- Set yarn resolution for `@metamask/snaps-sdk/@metamask/providers` to `17.1.1` ([#3645](#3645))
  - Remove once `@metamask/snaps-sdk` bumps its `@metamask/providers` version to `>=17.1.1`.
```
  
### `@metamask/network-controller` (minor)

```md
### Added

- Newly exports the following types: `AutoManagedNetworkClient`, `InfuraNetworkClientConfiguration`, `CustomNetworkClientConfiguration` ([#3645](#3645))
```

### `@metamask/profile-sync-controller`

```md
### Changed

- Bump dependency and peer dependency `@metamask/snaps-controllers` from `^8.1.1` to `^9.3.0` ([#3645](#3645))
- Bump `@metamask/snaps-sdk` from `^4.2.0` to `^6.1.0` ([#3645](#3645))
- Bump `@metamask/snaps-utils` from `^7.4.0` to `^7.8.0` ([#3645](#3645))
```

### `@metamask/transaction-controller`

```md
### Changed

- Bump `@metamask/keyring-api` from `^8.0.0` to `^8.0.1` ([#3645](#3645))
```

### `@metamask/user-operation-controller`

```md
### Fixed

- Replace `superstruct` with ESM-compatible `@metamask/superstruct` `^3.1.0` ([#3645](#3645))
  - This fixes the issue of this package being unusable by any TypeScript project that uses `Node16` or `NodeNext` as its `moduleResolution` option.
```

## Checklist

- [x] I've updated the test suite for new or updated code as appropriate
- [x] I've updated documentation (JSDoc, Markdown, etc.) for new or
updated code as appropriate
- [x] I've highlighted breaking changes using the "BREAKING" category
above as appropriate

---------

Co-authored-by: Elliot Winkler <elliot.winkler@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Replace superstruct with ESM-compatible fork @metamask/superstruct
4 participants