@metamask-previews/utils 12.0.1-preview-677dff22f → 12.0.1-preview-13e241f7f
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +6 -0
- package/dist/json.d.ts +12 -12
- package/package.json +6 -4
package/CHANGELOG.md
CHANGED
|
@@ -7,6 +7,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
|
|
|
7
7
|
|
|
8
8
|
## [Unreleased]
|
|
9
9
|
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- Build declaration files with `exactOptionalPropertyTypes` ([#11337](https://github.com/MetaMask/core/pull/11337))
|
|
13
|
+
- This TypeScript compiler option was accidentally dropped from the build in 12.0.1, so this change restores types to what they were prior to this version.
|
|
14
|
+
- `| undefined` is dropped from `params`, `data` and `stack` fields across `JsonRpcErrorStruct`, `JsonRpcRequestStruct`, `JsonRpcNotificationStruct`, `PendingJsonRpcResponseStruct`, `JsonRpcFailureStruct`, and `JsonRpcResponseStruct`, and in the types inferred from them (e.g., `JsonRpcRequestStruct` and `JsonRpcRequest` now match)
|
|
15
|
+
|
|
10
16
|
## [12.0.1]
|
|
11
17
|
|
|
12
18
|
### Added
|
package/dist/json.d.ts
CHANGED
|
@@ -133,8 +133,8 @@ export type JsonRpcId = Infer<typeof JsonRpcIdStruct>;
|
|
|
133
133
|
export declare const JsonRpcErrorStruct: Struct<{
|
|
134
134
|
code: number;
|
|
135
135
|
message: string;
|
|
136
|
-
data?:
|
|
137
|
-
stack?: string
|
|
136
|
+
data?: Json & ExactOptionalGuard;
|
|
137
|
+
stack?: string;
|
|
138
138
|
}, unknown>;
|
|
139
139
|
/**
|
|
140
140
|
* Mark a certain key of a type as optional.
|
|
@@ -154,7 +154,7 @@ export declare const JsonRpcRequestStruct: Struct<{
|
|
|
154
154
|
id: string | number | null;
|
|
155
155
|
jsonrpc: "2.0";
|
|
156
156
|
method: string;
|
|
157
|
-
params?: (
|
|
157
|
+
params?: (Json[] | Record<string, Json>) & ExactOptionalGuard;
|
|
158
158
|
}, unknown>;
|
|
159
159
|
export type InferWithParams<Type extends Struct<any>, Params extends JsonRpcParams> = Infer<Type> & {
|
|
160
160
|
params?: Params;
|
|
@@ -166,7 +166,7 @@ export type JsonRpcRequest<Params extends JsonRpcParams = JsonRpcParams> = Infer
|
|
|
166
166
|
export declare const JsonRpcNotificationStruct: Struct<{
|
|
167
167
|
jsonrpc: "2.0";
|
|
168
168
|
method: string;
|
|
169
|
-
params?: (
|
|
169
|
+
params?: (Json[] | Record<string, Json>) & ExactOptionalGuard;
|
|
170
170
|
}, unknown>;
|
|
171
171
|
/**
|
|
172
172
|
* A JSON-RPC notification object.
|
|
@@ -212,8 +212,8 @@ export declare const PendingJsonRpcResponseStruct: Struct<{
|
|
|
212
212
|
error?: {
|
|
213
213
|
code: number;
|
|
214
214
|
message: string;
|
|
215
|
-
data?:
|
|
216
|
-
stack?: string
|
|
215
|
+
data?: Json & ExactOptionalGuard;
|
|
216
|
+
stack?: string;
|
|
217
217
|
} | undefined;
|
|
218
218
|
}, {
|
|
219
219
|
id: Struct<string | number | null, null>;
|
|
@@ -222,8 +222,8 @@ export declare const PendingJsonRpcResponseStruct: Struct<{
|
|
|
222
222
|
error: Struct<{
|
|
223
223
|
code: number;
|
|
224
224
|
message: string;
|
|
225
|
-
data?:
|
|
226
|
-
stack?: string
|
|
225
|
+
data?: Json & ExactOptionalGuard;
|
|
226
|
+
stack?: string;
|
|
227
227
|
} | undefined, unknown>;
|
|
228
228
|
}>;
|
|
229
229
|
/**
|
|
@@ -249,8 +249,8 @@ export declare const JsonRpcFailureStruct: Struct<{
|
|
|
249
249
|
error: {
|
|
250
250
|
code: number;
|
|
251
251
|
message: string;
|
|
252
|
-
data?:
|
|
253
|
-
stack?: string
|
|
252
|
+
data?: Json & ExactOptionalGuard;
|
|
253
|
+
stack?: string;
|
|
254
254
|
};
|
|
255
255
|
}, unknown>;
|
|
256
256
|
/**
|
|
@@ -267,8 +267,8 @@ export declare const JsonRpcResponseStruct: Struct<{
|
|
|
267
267
|
error: {
|
|
268
268
|
code: number;
|
|
269
269
|
message: string;
|
|
270
|
-
data?:
|
|
271
|
-
stack?: string
|
|
270
|
+
data?: Json & ExactOptionalGuard;
|
|
271
|
+
stack?: string;
|
|
272
272
|
};
|
|
273
273
|
}, null>;
|
|
274
274
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@metamask-previews/utils",
|
|
3
|
-
"version": "12.0.1-preview-
|
|
3
|
+
"version": "12.0.1-preview-13e241f7f",
|
|
4
4
|
"description": "Various JavaScript/TypeScript utilities of wide relevance to the MetaMask codebase",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"Ethereum",
|
|
@@ -37,18 +37,20 @@
|
|
|
37
37
|
"registry": "https://registry.npmjs.org/"
|
|
38
38
|
},
|
|
39
39
|
"scripts": {
|
|
40
|
+
"allow-scripts": "yarn workspace @metamask/core-monorepo run allow-scripts",
|
|
40
41
|
"build": "tsc --project tsconfig.build.json",
|
|
41
42
|
"build:all": "tsc --build tsconfig.build.json --verbose",
|
|
42
43
|
"build:clean": "yarn build:only-clean && yarn build",
|
|
43
44
|
"build:docs": "typedoc",
|
|
44
45
|
"build:only-clean": "rimraf './dist' './tsconfig.build.tsbuildinfo'",
|
|
45
46
|
"changelog:update": "../../scripts/update-changelog.sh @metamask/utils",
|
|
46
|
-
"changelog:validate": "../../scripts/validate-changelog.sh
|
|
47
|
+
"changelog:validate": "../../scripts/validate-changelog.sh",
|
|
47
48
|
"lint:tsconfigs": "node --import ../../scripts/resolver/register.ts ../../scripts/lint-tsconfigs/lint-tsconfigs.ts",
|
|
48
49
|
"lint:tsconfigs:fix": "node --import ../../scripts/resolver/register.ts ../../scripts/lint-tsconfigs/lint-tsconfigs.ts --fix",
|
|
49
50
|
"since-latest-release": "../../scripts/since-latest-release.sh",
|
|
50
51
|
"test": "vitest",
|
|
51
52
|
"test:clean": "vitest --clearCache",
|
|
53
|
+
"test:coverage": "vitest --coverage",
|
|
52
54
|
"test:verbose": "vitest --reporter=verbose",
|
|
53
55
|
"test:watch": "vitest --watch"
|
|
54
56
|
},
|
|
@@ -68,14 +70,14 @@
|
|
|
68
70
|
"semver": "^7.8.5"
|
|
69
71
|
},
|
|
70
72
|
"devDependencies": {
|
|
71
|
-
"@metamask/auto-changelog": "^
|
|
73
|
+
"@metamask/auto-changelog": "^7.1.0",
|
|
72
74
|
"@typescript/native": "npm:typescript@^7.0.2",
|
|
73
75
|
"rimraf": "^6.1.3",
|
|
74
76
|
"stdio-mock": "^1.2.0",
|
|
75
77
|
"typedoc": "^0.28.20",
|
|
76
78
|
"typedoc-plugin-missing-exports": "^4.1.4",
|
|
77
79
|
"typescript": "npm:@typescript/typescript6@^6.0.2",
|
|
78
|
-
"vitest": "
|
|
80
|
+
"vitest": "5.0.3",
|
|
79
81
|
"web3": "^4.16.0"
|
|
80
82
|
},
|
|
81
83
|
"engines": {
|