Skip to content

Commit

Permalink
chore(deps): replace superstruct imports with `@metamask/superstruc…
Browse files Browse the repository at this point in the history
…t` (#311)

* Replace 'superstruct' imports with '@metamask/superstruct'

* Remove 'superstruct' and add '@metamask/superstruct' v3.0.0 as dependency

* Bump dependency `@metamask/utils` from `^8.4.0` to `^8.5.0`

* Linter fixes

* Set tsconfig options `module`, `moduleResolution` to `NodeNext`

* Bump dependencies

* Bump `@metamask/utils` from `^8.5.0` to `^9.0.0`

* Bump `@metamask` namespaced dependencies
  • Loading branch information
MajorLift authored Jul 18, 2024
1 parent f2ae9e4 commit 7d978ab
Show file tree
Hide file tree
Showing 6 changed files with 110 additions and 134 deletions.
14 changes: 7 additions & 7 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@
},
"dependencies": {
"@ethereumjs/tx": "^4.2.0",
"@metamask/eth-sig-util": "^7.0.1",
"@metamask/keyring-api": "^8.0.0",
"@metamask/snaps-controllers": "^8.1.1",
"@metamask/snaps-sdk": "^4.2.0",
"@metamask/snaps-utils": "^7.4.0",
"@metamask/utils": "^8.4.0",
"@metamask/eth-sig-util": "^7.0.3",
"@metamask/keyring-api": "^8.0.1",
"@metamask/snaps-controllers": "^9.2.0",
"@metamask/snaps-sdk": "^6.0.0",
"@metamask/snaps-utils": "^7.7.0",
"@metamask/superstruct": "^3.1.0",
"@metamask/utils": "^9.1.0",
"@types/uuid": "^9.0.1",
"superstruct": "^1.0.3",
"uuid": "^9.0.0"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion src/SnapKeyring.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,14 +28,14 @@ import {
import type { SnapController } from '@metamask/snaps-controllers';
import type { SnapId } from '@metamask/snaps-sdk';
import type { Snap } from '@metamask/snaps-utils';
import { assert, mask, object, string } from '@metamask/superstruct';
import type { Json } from '@metamask/utils';
import {
bigIntToHex,
KnownCaipNamespace,
toCaipChainId,
} from '@metamask/utils';
import { EventEmitter } from 'events';
import { assert, mask, object, string } from 'superstruct';
import { v4 as uuid } from 'uuid';

import { DeferredPromise } from './DeferredPromise';
Expand Down
11 changes: 9 additions & 2 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
import type { Infer } from '@metamask/superstruct';
import {
array,
object,
optional,
record,
string,
union,
} from '@metamask/superstruct';
import { JsonStruct } from '@metamask/utils';
import type { Infer } from 'superstruct';
import { array, object, optional, record, string, union } from 'superstruct';

export const SnapMessageStruct = object({
method: string(),
Expand Down
4 changes: 2 additions & 2 deletions src/util.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import type { Struct } from '@metamask/superstruct';
import { assert } from '@metamask/superstruct';
import type { Json } from '@metamask/utils';
import type { Struct } from 'superstruct';
import { assert } from 'superstruct';

/**
* Assert that a value is valid according to a struct.
Expand Down
4 changes: 2 additions & 2 deletions tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@
"exactOptionalPropertyTypes": true,
"forceConsistentCasingInFileNames": true,
"lib": ["ES2020"],
"module": "CommonJS",
"moduleResolution": "node",
"module": "Node16",
"moduleResolution": "Node16",
"noEmit": true,
"noErrorTruncation": true,
"noUncheckedIndexedAccess": true,
Expand Down
Loading

0 comments on commit 7d978ab

Please sign in to comment.