From aae78f1504a1ace50c60d4894f1044596091d8c0 Mon Sep 17 00:00:00 2001 From: Josh Long Date: Sat, 16 Dec 2023 14:22:24 -0500 Subject: [PATCH] remove postbuild step from ecdsa-sdk --- packages/ecdsa-sdk/package.json | 4 ++++ packages/ecdsa-sdk/postBuild.mjs | 27 ------------------------- packages/ecdsa-sdk/src/lib/ecdsa-sdk.ts | 2 +- 3 files changed, 5 insertions(+), 28 deletions(-) delete mode 100644 packages/ecdsa-sdk/postBuild.mjs diff --git a/packages/ecdsa-sdk/package.json b/packages/ecdsa-sdk/package.json index 2530d9c718..49d420b83d 100644 --- a/packages/ecdsa-sdk/package.json +++ b/packages/ecdsa-sdk/package.json @@ -18,9 +18,13 @@ "directory": "../../dist/packages/ecdsa-sdk" }, "gitHead": "0d7334c2c55f448e91fe32f29edc5db8f5e09e4b", + "peerDependencies": { + "pako": "^2.1.0" + }, "tags": [ "universal" ], + "version": "3.0.24", "main": "./dist/src/index.js", "typings": "./dist/src/index.d.ts" diff --git a/packages/ecdsa-sdk/postBuild.mjs b/packages/ecdsa-sdk/postBuild.mjs deleted file mode 100644 index 3c660b618b..0000000000 --- a/packages/ecdsa-sdk/postBuild.mjs +++ /dev/null @@ -1,27 +0,0 @@ -import fs from 'fs'; -import { - greenLog, - readFile, - redLog, - writeFile, -} from '../../tools/scripts/utils.mjs'; - -const TARGET_FILE = 'dist/packages/ecdsa-sdk/src/lib/ecdsa-sdk.js'; - -const fileContent = await readFile(TARGET_FILE); - -const newContent = fileContent.replace( - `var input = pako_1.default.inflate(base64ToUint8Array(b));`, - `// The following line is automatically modified by encryption/postbuild.mjs - var input = pako_1.inflate(base64ToUint8Array(b)); - // The above line is automatically modified by encryption/postbuild.mjs` -); - -try { - await writeFile(TARGET_FILE, newContent); - greenLog(`✅ Successfully wrote to ${TARGET_FILE}`, true); -} catch (e) { - redLog(`Failed to write to ${TARGET_FILE}!`, true); -} - -process.exit(); diff --git a/packages/ecdsa-sdk/src/lib/ecdsa-sdk.ts b/packages/ecdsa-sdk/src/lib/ecdsa-sdk.ts index 9c4078bf73..c0e4165d3e 100644 --- a/packages/ecdsa-sdk/src/lib/ecdsa-sdk.ts +++ b/packages/ecdsa-sdk/src/lib/ecdsa-sdk.ts @@ -1,5 +1,5 @@ // @ts-nocheck -import pako from 'pako'; +import * as pako from 'pako'; // Contants