@metamask/snaps-utils 8.5.0 → 8.5.1

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
+ ## [8.5.1]
11
+
12
+ ### Fixed
13
+
14
+ - Use regular import to reference package.json ([#2871](https://github.com/MetaMask/snaps/pull/2871))
15
+
10
16
  ## [8.5.0]
11
17
 
12
18
  ### Added
@@ -473,7 +479,8 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
473
479
  - The version of the package no longer needs to match the version of all other
474
480
  MetaMask Snaps packages.
475
481
 
476
- [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-utils@8.5.0...HEAD
482
+ [Unreleased]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-utils@8.5.1...HEAD
483
+ [8.5.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-utils@8.5.0...@metamask/snaps-utils@8.5.1
477
484
  [8.5.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-utils@8.4.1...@metamask/snaps-utils@8.5.0
478
485
  [8.4.1]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-utils@8.4.0...@metamask/snaps-utils@8.4.1
479
486
  [8.4.0]: https://github.com/MetaMask/snaps/compare/@metamask/snaps-utils@8.3.0...@metamask/snaps-utils@8.4.0
@@ -1,6 +1,10 @@
1
1
  "use strict";
2
+ var __importDefault = (this && this.__importDefault) || function (mod) {
3
+ return (mod && mod.__esModule) ? mod : { "default": mod };
4
+ };
2
5
  Object.defineProperty(exports, "__esModule", { value: true });
3
6
  exports.getPlatformVersion = void 0;
7
+ const package_json_1 = __importDefault(require("@metamask/snaps-sdk/package.json"));
4
8
  /**
5
9
  * Get the current supported platform version.
6
10
  *
@@ -11,8 +15,7 @@ exports.getPlatformVersion = void 0;
11
15
  * @returns The platform version.
12
16
  */
13
17
  function getPlatformVersion() {
14
- // eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
15
- return require("@metamask/snaps-sdk/package.json").version;
18
+ return package_json_1.default.version;
16
19
  }
17
20
  exports.getPlatformVersion = getPlatformVersion;
18
21
  //# sourceMappingURL=platform-version.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform-version.cjs","sourceRoot":"","sources":["../src/platform-version.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;GAQG;AACH,SAAgB,kBAAkB;IAChC,gIAAgI;IAChI,OAAO,OAAO,oCAAoC,CAAC,OAAO,CAAC;AAC7D,CAAC;AAHD,gDAGC","sourcesContent":["/**\n * Get the current supported platform version.\n *\n * Note: This function assumes that the same SDK version is used across all\n * dependencies. If this is not the case, the version of the SDK that is\n * closest to the `snaps-utils` package will be returned.\n *\n * @returns The platform version.\n */\nexport function getPlatformVersion() {\n // eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n return require('@metamask/snaps-sdk/package.json').version;\n}\n"]}
1
+ {"version":3,"file":"platform-version.cjs","sourceRoot":"","sources":["../src/platform-version.ts"],"names":[],"mappings":";;;;;;AAAA,oFAA2D;AAE3D;;;;;;;;GAQG;AACH,SAAgB,kBAAkB;IAChC,OAAO,sBAAW,CAAC,OAAO,CAAC;AAC7B,CAAC;AAFD,gDAEC","sourcesContent":["import packageJson from '@metamask/snaps-sdk/package.json';\n\n/**\n * Get the current supported platform version.\n *\n * Note: This function assumes that the same SDK version is used across all\n * dependencies. If this is not the case, the version of the SDK that is\n * closest to the `snaps-utils` package will be returned.\n *\n * @returns The platform version.\n */\nexport function getPlatformVersion() {\n return packageJson.version;\n}\n"]}
@@ -7,5 +7,5 @@
7
7
  *
8
8
  * @returns The platform version.
9
9
  */
10
- export declare function getPlatformVersion(): any;
10
+ export declare function getPlatformVersion(): string;
11
11
  //# sourceMappingURL=platform-version.d.cts.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform-version.d.cts","sourceRoot":"","sources":["../src/platform-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,QAGjC"}
1
+ {"version":3,"file":"platform-version.d.cts","sourceRoot":"","sources":["../src/platform-version.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,WAEjC"}
@@ -7,5 +7,5 @@
7
7
  *
8
8
  * @returns The platform version.
9
9
  */
10
- export declare function getPlatformVersion(): any;
10
+ export declare function getPlatformVersion(): string;
11
11
  //# sourceMappingURL=platform-version.d.mts.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform-version.d.mts","sourceRoot":"","sources":["../src/platform-version.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,QAGjC"}
1
+ {"version":3,"file":"platform-version.d.mts","sourceRoot":"","sources":["../src/platform-version.ts"],"names":[],"mappings":"AAEA;;;;;;;;GAQG;AACH,wBAAgB,kBAAkB,WAEjC"}
@@ -1,5 +1,4 @@
1
- import { createRequire as $createRequire } from "module";
2
- const $require = $createRequire(import.meta.url);
1
+ import packageJson from "@metamask/snaps-sdk/package.json" with { type: "json" };
3
2
  /**
4
3
  * Get the current supported platform version.
5
4
  *
@@ -10,7 +9,6 @@ const $require = $createRequire(import.meta.url);
10
9
  * @returns The platform version.
11
10
  */
12
11
  export function getPlatformVersion() {
13
- // eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires
14
- return $require("@metamask/snaps-sdk/package.json").version;
12
+ return packageJson.version;
15
13
  }
16
14
  //# sourceMappingURL=platform-version.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"platform-version.mjs","sourceRoot":"","sources":["../src/platform-version.ts"],"names":[],"mappings":";;AAAA;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB;IAChC,gIAAgI;IAChI,OAAO,6CAA4C,OAAO,CAAC;AAC7D,CAAC","sourcesContent":["/**\n * Get the current supported platform version.\n *\n * Note: This function assumes that the same SDK version is used across all\n * dependencies. If this is not the case, the version of the SDK that is\n * closest to the `snaps-utils` package will be returned.\n *\n * @returns The platform version.\n */\nexport function getPlatformVersion() {\n // eslint-disable-next-line import/no-dynamic-require, @typescript-eslint/no-require-imports, @typescript-eslint/no-var-requires\n return require('@metamask/snaps-sdk/package.json').version;\n}\n"]}
1
+ {"version":3,"file":"platform-version.mjs","sourceRoot":"","sources":["../src/platform-version.ts"],"names":[],"mappings":"AAAA,OAAO,WAAW,+DAAyC;AAE3D;;;;;;;;GAQG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO,WAAW,CAAC,OAAO,CAAC;AAC7B,CAAC","sourcesContent":["import packageJson from '@metamask/snaps-sdk/package.json';\n\n/**\n * Get the current supported platform version.\n *\n * Note: This function assumes that the same SDK version is used across all\n * dependencies. If this is not the case, the version of the SDK that is\n * closest to the `snaps-utils` package will be returned.\n *\n * @returns The platform version.\n */\nexport function getPlatformVersion() {\n return packageJson.version;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@metamask/snaps-utils",
3
- "version": "8.5.0",
3
+ "version": "8.5.1",
4
4
  "description": "A collection of utilities for MetaMask Snaps",
5
5
  "keywords": [
6
6
  "MetaMask",