@metamask-previews/utils 12.0.1-preview-6ebaf4e52 → 12.0.1-preview-b6e8e7385

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 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?: (Json & ExactOptionalGuard) | undefined;
137
- stack?: string | undefined;
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?: ((Json[] | Record<string, Json>) & ExactOptionalGuard) | undefined;
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?: ((Json[] | Record<string, Json>) & ExactOptionalGuard) | undefined;
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?: (Json & ExactOptionalGuard) | undefined;
216
- stack?: string | undefined;
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?: (Json & ExactOptionalGuard) | undefined;
226
- stack?: string | undefined;
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?: (Json & ExactOptionalGuard) | undefined;
253
- stack?: string | undefined;
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?: (Json & ExactOptionalGuard) | undefined;
271
- stack?: string | undefined;
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-6ebaf4e52",
3
+ "version": "12.0.1-preview-b6e8e7385",
4
4
  "description": "Various JavaScript/TypeScript utilities of wide relevance to the MetaMask codebase",
5
5
  "keywords": [
6
6
  "Ethereum",
@@ -37,6 +37,7 @@
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",