From 071bef5cf84d042f8c2bae4e4a2fe8ca80e4d20c Mon Sep 17 00:00:00 2001 From: Arnaud Brousseau Date: Tue, 28 Nov 2023 11:13:52 -0600 Subject: [PATCH 1/4] Stop using require in universal files --- packages/http/src/universal.ts | 3 ++- packages/webauthn-stamper/src/universal.ts | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/packages/http/src/universal.ts b/packages/http/src/universal.ts index 80cec62a2..2c3c1df7b 100644 --- a/packages/http/src/universal.ts +++ b/packages/http/src/universal.ts @@ -1,10 +1,11 @@ /// +import { fetch as xFetch } from 'cross-fetch'; let fetch: typeof globalThis.fetch; if (typeof globalThis?.fetch !== "undefined") { fetch = globalThis.fetch; } else { - fetch = require("cross-fetch"); + fetch = xFetch; } export { fetch }; diff --git a/packages/webauthn-stamper/src/universal.ts b/packages/webauthn-stamper/src/universal.ts index e52043c93..25c66b189 100644 --- a/packages/webauthn-stamper/src/universal.ts +++ b/packages/webauthn-stamper/src/universal.ts @@ -1,10 +1,11 @@ /// +import { Buffer as nodeBuffer } from "buffer"; let buffer: typeof globalThis.Buffer; if (typeof globalThis?.Buffer !== "undefined") { buffer = globalThis.Buffer; } else { - buffer = require("buffer").Buffer; + buffer = nodeBuffer; } export { buffer }; From 0f06c5945ac4622d3ac3d3623151d42b365773b3 Mon Sep 17 00:00:00 2001 From: Arnaud Brousseau Date: Tue, 28 Nov 2023 11:22:01 -0600 Subject: [PATCH 2/4] Prettier --- packages/http/src/universal.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/http/src/universal.ts b/packages/http/src/universal.ts index 2c3c1df7b..67d68e186 100644 --- a/packages/http/src/universal.ts +++ b/packages/http/src/universal.ts @@ -1,5 +1,5 @@ /// -import { fetch as xFetch } from 'cross-fetch'; +import { fetch as xFetch } from "cross-fetch"; let fetch: typeof globalThis.fetch; if (typeof globalThis?.fetch !== "undefined") { From f87ced80a117993618cb2a48d198bdad80ebcde0 Mon Sep 17 00:00:00 2001 From: Arnaud Brousseau Date: Tue, 28 Nov 2023 11:24:43 -0600 Subject: [PATCH 3/4] Add changeset --- .changeset/quiet-eyes-work.md | 6 ++++++ 1 file changed, 6 insertions(+) create mode 100644 .changeset/quiet-eyes-work.md diff --git a/.changeset/quiet-eyes-work.md b/.changeset/quiet-eyes-work.md new file mode 100644 index 000000000..0061c0ded --- /dev/null +++ b/.changeset/quiet-eyes-work.md @@ -0,0 +1,6 @@ +--- +"@turnkey/webauthn-stamper": patch +"@turnkey/http": patch +--- + +Fix universal files to stop using `require`. Use ES6 imports instead. From fff419e6b077c733c1de95dc82b8b3d55844a559 Mon Sep 17 00:00:00 2001 From: Arnaud Brousseau Date: Tue, 28 Nov 2023 11:33:37 -0600 Subject: [PATCH 4/4] Changeset version --- .changeset/quiet-eyes-work.md | 6 ------ packages/cosmjs/CHANGELOG.md | 7 +++++++ packages/cosmjs/package.json | 2 +- packages/ethers/CHANGELOG.md | 7 +++++++ packages/ethers/package.json | 2 +- packages/http/CHANGELOG.md | 8 ++++++++ packages/http/package.json | 2 +- packages/viem/CHANGELOG.md | 7 +++++++ packages/viem/package.json | 2 +- packages/webauthn-stamper/CHANGELOG.md | 6 ++++++ packages/webauthn-stamper/package.json | 2 +- 11 files changed, 40 insertions(+), 11 deletions(-) delete mode 100644 .changeset/quiet-eyes-work.md diff --git a/.changeset/quiet-eyes-work.md b/.changeset/quiet-eyes-work.md deleted file mode 100644 index 0061c0ded..000000000 --- a/.changeset/quiet-eyes-work.md +++ /dev/null @@ -1,6 +0,0 @@ ---- -"@turnkey/webauthn-stamper": patch -"@turnkey/http": patch ---- - -Fix universal files to stop using `require`. Use ES6 imports instead. diff --git a/packages/cosmjs/CHANGELOG.md b/packages/cosmjs/CHANGELOG.md index 713002505..fdfb2c2ce 100644 --- a/packages/cosmjs/CHANGELOG.md +++ b/packages/cosmjs/CHANGELOG.md @@ -1,5 +1,12 @@ # @turnkey/cosmjs +## 0.5.1 + +### Patch Changes + +- Updated dependencies [f87ced8] + - @turnkey/http@2.4.1 + ## 0.5.0 ### Minor Changes diff --git a/packages/cosmjs/package.json b/packages/cosmjs/package.json index aa073aad3..296e9b2d3 100644 --- a/packages/cosmjs/package.json +++ b/packages/cosmjs/package.json @@ -1,6 +1,6 @@ { "name": "@turnkey/cosmjs", - "version": "0.5.0", + "version": "0.5.1", "main": "./dist/index.js", "module": "./dist/index.mjs", "exports": { diff --git a/packages/ethers/CHANGELOG.md b/packages/ethers/CHANGELOG.md index e657f9ccb..316164959 100644 --- a/packages/ethers/CHANGELOG.md +++ b/packages/ethers/CHANGELOG.md @@ -1,5 +1,12 @@ # @turnkey/ethers +## 0.19.1 + +### Patch Changes + +- Updated dependencies [f87ced8] + - @turnkey/http@2.4.1 + ## 0.19.0 ### Minor Changes diff --git a/packages/ethers/package.json b/packages/ethers/package.json index 866de3471..62084ead1 100644 --- a/packages/ethers/package.json +++ b/packages/ethers/package.json @@ -1,6 +1,6 @@ { "name": "@turnkey/ethers", - "version": "0.19.0", + "version": "0.19.1", "main": "./dist/index.js", "module": "./dist/index.mjs", "exports": { diff --git a/packages/http/CHANGELOG.md b/packages/http/CHANGELOG.md index e26526e27..85831b1f5 100644 --- a/packages/http/CHANGELOG.md +++ b/packages/http/CHANGELOG.md @@ -1,5 +1,13 @@ # @turnkey/http +## 2.4.1 + +### Patch Changes + +- Fix universal files to stop using `require`. Use ES6 imports instead (#178) +- Updated dependencies [f87ced8] + - @turnkey/webauthn-stamper@0.4.1 + ## 2.4.0 ### Minor Changes diff --git a/packages/http/package.json b/packages/http/package.json index 0fca1ec80..b7dca8815 100644 --- a/packages/http/package.json +++ b/packages/http/package.json @@ -1,6 +1,6 @@ { "name": "@turnkey/http", - "version": "2.4.0", + "version": "2.4.1", "main": "./dist/index.js", "module": "./dist/index.mjs", "exports": { diff --git a/packages/viem/CHANGELOG.md b/packages/viem/CHANGELOG.md index 468124e8b..860a140d8 100644 --- a/packages/viem/CHANGELOG.md +++ b/packages/viem/CHANGELOG.md @@ -1,5 +1,12 @@ # @turnkey/viem +## 0.4.1 + +### Patch Changes + +- Updated dependencies [f87ced8] + - @turnkey/http@2.4.1 + ## 0.4.0 ### Minor Changes diff --git a/packages/viem/package.json b/packages/viem/package.json index 7485e3db8..6f9d38926 100644 --- a/packages/viem/package.json +++ b/packages/viem/package.json @@ -1,6 +1,6 @@ { "name": "@turnkey/viem", - "version": "0.4.0", + "version": "0.4.1", "main": "./dist/index.js", "module": "./dist/index.mjs", "exports": { diff --git a/packages/webauthn-stamper/CHANGELOG.md b/packages/webauthn-stamper/CHANGELOG.md index 027b4e1c9..9b6d3ae1c 100644 --- a/packages/webauthn-stamper/CHANGELOG.md +++ b/packages/webauthn-stamper/CHANGELOG.md @@ -1,5 +1,11 @@ # @turnkey/webauthn-stamper +## 0.4.1 + +### Patch Changes + +- Fix universal files to stop using `require`. Use ES6 imports instead (#178) + ## 0.4.0 ### Minor Changes diff --git a/packages/webauthn-stamper/package.json b/packages/webauthn-stamper/package.json index 79fb73041..004da5cbc 100644 --- a/packages/webauthn-stamper/package.json +++ b/packages/webauthn-stamper/package.json @@ -1,6 +1,6 @@ { "name": "@turnkey/webauthn-stamper", - "version": "0.4.0", + "version": "0.4.1", "main": "./dist/index.js", "module": "./dist/index.mjs", "exports": {