From 1c998b28f4cdc31e249081e546250971478512f1 Mon Sep 17 00:00:00 2001 From: Jongsun Suh Date: Thu, 30 May 2024 14:14:16 -0400 Subject: [PATCH 1/7] Replace 'superstruct' imports with '@metamask/superstruct' --- src/parsers/bool.ts | 2 +- src/parsers/function.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parsers/bool.ts b/src/parsers/bool.ts index 5153e4c..b668130 100644 --- a/src/parsers/bool.ts +++ b/src/parsers/bool.ts @@ -1,5 +1,5 @@ import { bigIntToBytes, concatBytes } from '@metamask/utils'; -import { coerce, create, literal, union, boolean } from 'superstruct'; +import { coerce, create, literal, union, boolean } from '@metamask/superstruct'; import { ParserError } from '../errors'; import { number } from './number'; diff --git a/src/parsers/function.ts b/src/parsers/function.ts index 9eb76c3..0ddc88b 100644 --- a/src/parsers/function.ts +++ b/src/parsers/function.ts @@ -6,7 +6,7 @@ import { hexToBytes, StrictHexStruct, } from '@metamask/utils'; -import { coerce, create, instance, object, union } from 'superstruct'; +import { coerce, create, instance, object, union } from '@metamask/superstruct'; import { ParserError } from '../errors'; import { fixedBytes } from './fixed-bytes'; From 24a0c87609c7a8c9b47be3fa621d8d0f7e5a07a4 Mon Sep 17 00:00:00 2001 From: Jongsun Suh Date: Thu, 30 May 2024 16:48:21 -0400 Subject: [PATCH 2/7] Remove 'superstruct' and add '@metamask/superstruct' v3.0.0 as dependency --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 85c0ccd..8b46604 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ }, "dependencies": { "@metamask/utils": "^8.0.0", - "superstruct": "^1.0.3" + "@metamask/superstruct": "^3.0.0" }, "devDependencies": { "@lavamoat/allow-scripts": "^2.3.1", From 4f5d0eb51f4aa477c88c0e50a41c050e2f534e8c Mon Sep 17 00:00:00 2001 From: Jongsun Suh Date: Thu, 6 Jun 2024 16:33:40 -0400 Subject: [PATCH 3/7] Bump dependency `@metamask/utils` to `^8.5.0` --- package.json | 4 ++-- yarn.lock | 38 ++++++++++++++++++++++++-------------- 2 files changed, 26 insertions(+), 16 deletions(-) diff --git a/package.json b/package.json index 8b46604..3086c6f 100644 --- a/package.json +++ b/package.json @@ -44,8 +44,8 @@ "test:watch": "jest --watch" }, "dependencies": { - "@metamask/utils": "^8.0.0", - "@metamask/superstruct": "^3.0.0" + "@metamask/superstruct": "^3.0.0", + "@metamask/utils": "^8.5.0" }, "devDependencies": { "@lavamoat/allow-scripts": "^2.3.1", diff --git a/yarn.lock b/yarn.lock index 1408726..9e8eef2 100644 --- a/yarn.lock +++ b/yarn.lock @@ -983,7 +983,8 @@ __metadata: "@metamask/eslint-config-jest": ^12.1.0 "@metamask/eslint-config-nodejs": ^12.1.0 "@metamask/eslint-config-typescript": ^12.1.0 - "@metamask/utils": ^8.0.0 + "@metamask/superstruct": ^3.0.0 + "@metamask/utils": ^8.5.0 "@noble/hashes": ^1.3.1 "@types/jest": ^28.1.6 "@types/node": ^16.8.38 @@ -1003,7 +1004,6 @@ __metadata: prettier: ^2.7.1 prettier-plugin-packagejson: ^2.3.0 rimraf: ^3.0.2 - superstruct: ^1.0.3 ts-jest: ^29.1.1 ts-node: ^10.9.1 typedoc: ^0.23.15 @@ -1076,19 +1076,27 @@ __metadata: languageName: node linkType: hard -"@metamask/utils@npm:^8.0.0": - version: 8.3.0 - resolution: "@metamask/utils@npm:8.3.0" +"@metamask/superstruct@npm:^3.0.0": + version: 3.0.0 + resolution: "@metamask/superstruct@npm:3.0.0" + checksum: 667f8f2947186972516bb72b4ba215eaeede257c8beb0450583dd4c8b00c28729ff938267ca8804a3a351277fd627b8607cafeb71eb7045a2b6930639bb6a341 + languageName: node + linkType: hard + +"@metamask/utils@npm:^8.5.0": + version: 8.5.0 + resolution: "@metamask/utils@npm:8.5.0" dependencies: "@ethereumjs/tx": ^4.2.0 + "@metamask/superstruct": ^3.0.0 "@noble/hashes": ^1.3.1 "@scure/base": ^1.1.3 "@types/debug": ^4.1.7 debug: ^4.3.4 pony-cause: ^2.1.10 semver: ^7.5.4 - superstruct: ^1.0.3 - checksum: cd60c49b4c0397fb31e6b38937a0d9346cbb8337cb8add59db8db0e0e2156fb063ff4df93a26410157f0cc02aa9a9b785fc1b53cfc4ab73204462893ed11cacb + uuid: ^9.0.1 + checksum: e8eac1c796c3f6b623be3c2736e8682248620f666b180f5c12ce56ee09587d4e28b6811862139a05c7a1bec91415f10ccf0516f3cdf342f88b0189d2a057c24b languageName: node linkType: hard @@ -6215,13 +6223,6 @@ __metadata: languageName: node linkType: hard -"superstruct@npm:^1.0.3": - version: 1.0.3 - resolution: "superstruct@npm:1.0.3" - checksum: 761790bb111e6e21ddd608299c252f3be35df543263a7ebbc004e840d01fcf8046794c274bcb351bdf3eae4600f79d317d085cdbb19ca05803a4361840cc9bb1 - languageName: node - linkType: hard - "supports-color@npm:^5.3.0": version: 5.5.0 resolution: "supports-color@npm:5.5.0" @@ -6589,6 +6590,15 @@ __metadata: languageName: node linkType: hard +"uuid@npm:^9.0.1": + version: 9.0.1 + resolution: "uuid@npm:9.0.1" + bin: + uuid: dist/bin/uuid + checksum: 39931f6da74e307f51c0fb463dc2462807531dc80760a9bff1e35af4316131b4fc3203d16da60ae33f07fdca5b56f3f1dd662da0c99fea9aaeab2004780cc5f4 + languageName: node + linkType: hard + "v8-compile-cache-lib@npm:^3.0.1": version: 3.0.1 resolution: "v8-compile-cache-lib@npm:3.0.1" From cb42436c8276138090e0c9f64a82f9c57469db7b Mon Sep 17 00:00:00 2001 From: Jongsun Suh Date: Thu, 6 Jun 2024 16:38:41 -0400 Subject: [PATCH 4/7] Set tsconfig option `moduleResolution` to `NodeNext` --- tsconfig.json | 4 +- yarn.lock | 100 +++++++++++++++++++++++++++----------------------- 2 files changed, 56 insertions(+), 48 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 23c8ceb..bb04335 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -4,8 +4,8 @@ "exactOptionalPropertyTypes": true, "forceConsistentCasingInFileNames": true, "lib": ["ES2020"], - "module": "CommonJS", - "moduleResolution": "node", + "module": "NodeNext", + "moduleResolution": "NodeNext", "noEmit": true, "noErrorTruncation": true, "noUncheckedIndexedAccess": true, diff --git a/yarn.lock b/yarn.lock index 9e8eef2..d699429 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1007,7 +1007,7 @@ __metadata: ts-jest: ^29.1.1 ts-node: ^10.9.1 typedoc: ^0.23.15 - typescript: ~4.8.4 + typescript: ~5.0.4 languageName: unknown linkType: soft @@ -1835,6 +1835,13 @@ __metadata: languageName: node linkType: hard +"ansi-sequence-parser@npm:^1.1.0": + version: 1.1.1 + resolution: "ansi-sequence-parser@npm:1.1.1" + checksum: ead5b15c596e8e85ca02951a844366c6776769dcc9fd1bd3a0db11bb21364554822c6a439877fb599e7e1ffa0b5f039f1e5501423950457f3dcb2f480c30b188 + languageName: node + linkType: hard + "ansi-styles@npm:^3.2.1": version: 3.2.1 resolution: "ansi-styles@npm:3.2.1" @@ -4774,10 +4781,10 @@ __metadata: languageName: node linkType: hard -"jsonc-parser@npm:^3.0.0": - version: 3.2.0 - resolution: "jsonc-parser@npm:3.2.0" - checksum: 946dd9a5f326b745aa326d48a7257e3f4a4b62c5e98ec8e49fa2bdd8d96cef7e6febf1399f5c7016114fd1f68a1c62c6138826d5d90bc650448e3cf0951c53c7 +"jsonc-parser@npm:^3.2.0": + version: 3.2.1 + resolution: "jsonc-parser@npm:3.2.1" + checksum: 656d9027b91de98d8ab91b3aa0d0a4cab7dc798a6830845ca664f3e76c82d46b973675bbe9b500fae1de37fd3e81aceacbaa2a57884bf2f8f29192150d2d1ef7 languageName: node linkType: hard @@ -4958,12 +4965,12 @@ __metadata: languageName: node linkType: hard -"marked@npm:^4.0.19": - version: 4.1.1 - resolution: "marked@npm:4.1.1" +"marked@npm:^4.2.12": + version: 4.3.0 + resolution: "marked@npm:4.3.0" bin: marked: bin/marked.js - checksum: 717e3357952ee53de831bf0eb110ed075bebca2376c58bcdf7ee523ef540d45308ad6d51b2c933da0968832ea4386f31c142ca65443e77c098e84f6cce73e418 + checksum: 0db6817893952c3ec710eb9ceafb8468bf5ae38cb0f92b7b083baa13d70b19774674be04db5b817681fa7c5c6a088f61300815e4dd75a59696f4716ad69f6260 languageName: node linkType: hard @@ -5014,21 +5021,21 @@ __metadata: languageName: node linkType: hard -"minimatch@npm:^5.1.0": - version: 5.1.0 - resolution: "minimatch@npm:5.1.0" +"minimatch@npm:^7.1.3": + version: 7.4.6 + resolution: "minimatch@npm:7.4.6" dependencies: brace-expansion: ^2.0.1 - checksum: 15ce53d31a06361e8b7a629501b5c75491bc2b59712d53e802b1987121d91b433d73fcc5be92974fde66b2b51d8fb28d75a9ae900d249feb792bb1ba2a4f0a90 + checksum: 1a6c8d22618df9d2a88aabeef1de5622eb7b558e9f8010be791cb6b0fa6e102d39b11c28d75b855a1e377b12edc7db8ff12a99c20353441caa6a05e78deb5da9 languageName: node linkType: hard "minimatch@npm:^9.0.1": - version: 9.0.3 - resolution: "minimatch@npm:9.0.3" + version: 9.0.4 + resolution: "minimatch@npm:9.0.4" dependencies: brace-expansion: ^2.0.1 - checksum: 253487976bf485b612f16bf57463520a14f512662e592e95c571afdab1442a6a6864b6c88f248ce6fc4ff0b6de04ac7aa6c8bb51e868e99d1d65eb0658a708b5 + checksum: cf717f597ec3eed7dabc33153482a2e8d49f4fd3c26e58fd9c71a94c5029a0838728841b93f46bf1263b65a8010e2ee800d0dc9b004ab8ba8b6d1ec07cc115b5 languageName: node linkType: hard @@ -5922,14 +5929,15 @@ __metadata: languageName: node linkType: hard -"shiki@npm:^0.11.1": - version: 0.11.1 - resolution: "shiki@npm:0.11.1" +"shiki@npm:^0.14.1": + version: 0.14.7 + resolution: "shiki@npm:0.14.7" dependencies: - jsonc-parser: ^3.0.0 - vscode-oniguruma: ^1.6.1 - vscode-textmate: ^6.0.0 - checksum: 2a4ebc3b466816263fc244ae4f67a4ff96aa74d863b9c5e7e4affc50f37fd6d1a781405de0dbf763b777bc33e49a0d441de7ff3fededb8b01e3b8dbb37e2927d + ansi-sequence-parser: ^1.1.0 + jsonc-parser: ^3.2.0 + vscode-oniguruma: ^1.7.0 + vscode-textmate: ^8.0.0 + checksum: 2aec3b3519df977c4391df9e1825cb496e9a4d7e11395f05a0da77e4fa2f7c3d9d6e6ee94029ac699533017f2b25637ee68f6d39f05f311535c2704d0329b520 languageName: node linkType: hard @@ -6495,38 +6503,38 @@ __metadata: linkType: hard "typedoc@npm:^0.23.15": - version: 0.23.15 - resolution: "typedoc@npm:0.23.15" + version: 0.23.28 + resolution: "typedoc@npm:0.23.28" dependencies: lunr: ^2.3.9 - marked: ^4.0.19 - minimatch: ^5.1.0 - shiki: ^0.11.1 + marked: ^4.2.12 + minimatch: ^7.1.3 + shiki: ^0.14.1 peerDependencies: - typescript: 4.6.x || 4.7.x || 4.8.x + typescript: 4.6.x || 4.7.x || 4.8.x || 4.9.x || 5.0.x bin: typedoc: bin/typedoc - checksum: 2313bcda09755332e15e40fb2e72ac8d72447abfcd60f7c555d3a232ad1fe3596afd87ddcfbdf17eb081fc65f1cbf43b02e05adf38e6ade55f64d475da4271d7 + checksum: 40eb4e207aac1b734e09400cf03f543642cc7b11000895198dd5a0d3166315759ccf4ac30a2915153597c5c186101c72bac2f1fc12b428184a9274d3a0e44c5e languageName: node linkType: hard -"typescript@npm:~4.8.4": - version: 4.8.4 - resolution: "typescript@npm:4.8.4" +"typescript@npm:~5.0.4": + version: 5.0.4 + resolution: "typescript@npm:5.0.4" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 3e4f061658e0c8f36c820802fa809e0fd812b85687a9a2f5430bc3d0368e37d1c9605c3ce9b39df9a05af2ece67b1d844f9f6ea8ff42819f13bcb80f85629af0 + checksum: 82b94da3f4604a8946da585f7d6c3025fff8410779e5bde2855ab130d05e4fd08938b9e593b6ebed165bda6ad9292b230984f10952cf82f0a0ca07bbeaa08172 languageName: node linkType: hard -"typescript@patch:typescript@~4.8.4#~builtin": - version: 4.8.4 - resolution: "typescript@patch:typescript@npm%3A4.8.4#~builtin::version=4.8.4&hash=a1c5e5" +"typescript@patch:typescript@~5.0.4#~builtin": + version: 5.0.4 + resolution: "typescript@patch:typescript@npm%3A5.0.4#~builtin::version=5.0.4&hash=a1c5e5" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 563a0ef47abae6df27a9a3ab38f75fc681f633ccf1a3502b1108e252e187787893de689220f4544aaf95a371a4eb3141e4a337deb9895de5ac3c1ca76430e5f0 + checksum: 6a1fe9a77bb9c5176ead919cc4a1499ee63e46b4e05bf667079f11bf3a8f7887f135aa72460a4c3b016e6e6bb65a822cb8689a6d86cbfe92d22cc9f501f09213 languageName: node linkType: hard @@ -6617,17 +6625,17 @@ __metadata: languageName: node linkType: hard -"vscode-oniguruma@npm:^1.6.1": - version: 1.6.2 - resolution: "vscode-oniguruma@npm:1.6.2" - checksum: 6b754acdafd5b68242ea5938bb00a32effc16c77f471d4f0f337d879d0e8e592622998e2441f42d9a7ff799c1593f31c11f26ca8d9bf9917e3ca881d3c1f3e19 +"vscode-oniguruma@npm:^1.7.0": + version: 1.7.0 + resolution: "vscode-oniguruma@npm:1.7.0" + checksum: 53519d91d90593e6fb080260892e87d447e9b200c4964d766772b5053f5699066539d92100f77f1302c91e8fc5d9c772fbe40fe4c90f3d411a96d5a9b1e63f42 languageName: node linkType: hard -"vscode-textmate@npm:^6.0.0": - version: 6.0.0 - resolution: "vscode-textmate@npm:6.0.0" - checksum: ff6f17a406c2906586afc14ef01cb122e33acd35312e815abb5c924347a777c6783ce3fe7db8b83f1760ebf843c669843b9390f905b69c433b3395af28e4b483 +"vscode-textmate@npm:^8.0.0": + version: 8.0.0 + resolution: "vscode-textmate@npm:8.0.0" + checksum: 127780dfea89559d70b8326df6ec344cfd701312dd7f3f591a718693812b7852c30b6715e3cfc8b3200a4e2515b4c96f0843c0eacc0a3020969b5de262c2a4bb languageName: node linkType: hard From 13a55ac25be25f005f515a2b8ecb871465545461 Mon Sep 17 00:00:00 2001 From: Jongsun Suh Date: Thu, 6 Jun 2024 16:39:18 -0400 Subject: [PATCH 5/7] Linter fixes --- src/parsers/bool.ts | 2 +- src/parsers/function.ts | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/parsers/bool.ts b/src/parsers/bool.ts index b668130..e67678f 100644 --- a/src/parsers/bool.ts +++ b/src/parsers/bool.ts @@ -1,5 +1,5 @@ -import { bigIntToBytes, concatBytes } from '@metamask/utils'; import { coerce, create, literal, union, boolean } from '@metamask/superstruct'; +import { bigIntToBytes, concatBytes } from '@metamask/utils'; import { ParserError } from '../errors'; import { number } from './number'; diff --git a/src/parsers/function.ts b/src/parsers/function.ts index 0ddc88b..dfe6960 100644 --- a/src/parsers/function.ts +++ b/src/parsers/function.ts @@ -1,3 +1,4 @@ +import { coerce, create, instance, object, union } from '@metamask/superstruct'; import { assert, bytesToHex, @@ -6,7 +7,6 @@ import { hexToBytes, StrictHexStruct, } from '@metamask/utils'; -import { coerce, create, instance, object, union } from '@metamask/superstruct'; import { ParserError } from '../errors'; import { fixedBytes } from './fixed-bytes'; From 653603a2c5a3f98a55af1a70fba5be234d9c5bc5 Mon Sep 17 00:00:00 2001 From: Jongsun Suh Date: Thu, 6 Jun 2024 16:46:57 -0400 Subject: [PATCH 6/7] Update changelog --- CHANGELOG.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index afc0b40..f912ab3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,12 @@ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). ## [Unreleased] +### Changed +- Bump `@metamask/utils` from `^8.4.0` to `^8.5.0` ([#73](https://github.com/MetaMask/abi-utils/pull/73)) + +### Fixed +- Replace dependency `superstruct` with `@metamask/superstruct` `^3.0.0` ([#73](https://github.com/MetaMask/abi-utils/pull/73)) + - This fixes the issue of this package being unusable by any TypeScript project that uses `Node16` or `NodeNext` as its `moduleResolution` option. ## [2.0.2] ### Changed From c4376ac0393aff54118f18eafc3714ed943230cb Mon Sep 17 00:00:00 2001 From: Jongsun Suh Date: Mon, 10 Jun 2024 18:19:32 -0400 Subject: [PATCH 7/7] Fix lockfile --- yarn.lock | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/yarn.lock b/yarn.lock index d699429..f3824d3 100644 --- a/yarn.lock +++ b/yarn.lock @@ -1007,7 +1007,7 @@ __metadata: ts-jest: ^29.1.1 ts-node: ^10.9.1 typedoc: ^0.23.15 - typescript: ~5.0.4 + typescript: ~4.8.4 languageName: unknown linkType: soft @@ -6518,23 +6518,23 @@ __metadata: languageName: node linkType: hard -"typescript@npm:~5.0.4": - version: 5.0.4 - resolution: "typescript@npm:5.0.4" +"typescript@npm:~4.8.4": + version: 4.8.4 + resolution: "typescript@npm:4.8.4" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 82b94da3f4604a8946da585f7d6c3025fff8410779e5bde2855ab130d05e4fd08938b9e593b6ebed165bda6ad9292b230984f10952cf82f0a0ca07bbeaa08172 + checksum: 3e4f061658e0c8f36c820802fa809e0fd812b85687a9a2f5430bc3d0368e37d1c9605c3ce9b39df9a05af2ece67b1d844f9f6ea8ff42819f13bcb80f85629af0 languageName: node linkType: hard -"typescript@patch:typescript@~5.0.4#~builtin": - version: 5.0.4 - resolution: "typescript@patch:typescript@npm%3A5.0.4#~builtin::version=5.0.4&hash=a1c5e5" +"typescript@patch:typescript@~4.8.4#~builtin": + version: 4.8.4 + resolution: "typescript@patch:typescript@npm%3A4.8.4#~builtin::version=4.8.4&hash=a1c5e5" bin: tsc: bin/tsc tsserver: bin/tsserver - checksum: 6a1fe9a77bb9c5176ead919cc4a1499ee63e46b4e05bf667079f11bf3a8f7887f135aa72460a4c3b016e6e6bb65a822cb8689a6d86cbfe92d22cc9f501f09213 + checksum: 563a0ef47abae6df27a9a3ab38f75fc681f633ccf1a3502b1108e252e187787893de689220f4544aaf95a371a4eb3141e4a337deb9895de5ac3c1ca76430e5f0 languageName: node linkType: hard