From c8e83c163a9a6afaab20528cd17a050713217bbb Mon Sep 17 00:00:00 2001 From: Andrei O Date: Thu, 29 Aug 2024 04:37:40 +0300 Subject: [PATCH] chore: update CI & other misc changes --- CI/bun.lockb | Bin 23475 -> 23475 bytes CI/package.json | 2 +- package.json | 3 +- release-scripts/create-release.ts | 55 ++++++++++++++++-------------- src/extension/manifest.json | 4 +-- src/views/SignTx.vue | 10 +++--- 6 files changed, 40 insertions(+), 34 deletions(-) diff --git a/CI/bun.lockb b/CI/bun.lockb index a257cc835f8acc2536fe1c6dc8cca1ef642a6607..05ebc056b84fc4a9b09d1f7400371cb1a5123fa3 100644 GIT binary patch delta 140 zcmV;70CWGdw*j-a0gx^ri`vO8#tA-l6W*n7(BBA-+wecDXq~h6WOdtkU^N{ z0SJ>(1Shi)2h|fmr1{o=Arn$wBdK&avP*>ge1&+5px1Ou_sb{knK13~c68rq;#FzQ u>zFE)J`#Ln_#|O&m(hU=spIj@B2(_0Id_Zmt0XVbkOvnyj%R+zv delta 138 zcmV;50CoSfw*j-a0gx^r%F+(pF7j}`G^<#k%oki4dus#%XD~O}O=b(l6aiZuu}+!> zlc*6evls`>6F|Urk&WPVjV|UIaP+!4l;wV^-%6uCW`;@0Z3}sv%rQSlp6&ng#wdE< s7B$Bq>$I9@Nvp|0KgHaCz<=SLh4`~28&)L&H?w>|ZVUl8v+GRA4$y@^jsO4v diff --git a/CI/package.json b/CI/package.json index 077da12..f65e055 100644 --- a/CI/package.json +++ b/CI/package.json @@ -9,7 +9,7 @@ "typescript": "^5.0.0" }, "dependencies": { - "farcaster-hub-utils": "^0.1.7", + "farcaster-hub-utils": "^0.1.8", "yup-api-interact": "^0.1.6" }, "license": "MIT" diff --git a/package.json b/package.json index 8af239e..3702764 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "clear-wallet", - "version": "1.4.3", + "version": "1.4.4", "private": true, "description": "Clear Wallet (CLW) is a wallet that helps you manage your Ethereum assets and interact with Ethereum dApps and contracts with the main focus on absolute privacy.", "type": "module", @@ -10,6 +10,7 @@ "content": "tsc --outFile src/extension/content.js src/extension/content.ts", "post-build": "yarn tsx ./release-scripts/post-build.ts", "build": "yarn inject && yarn content && vue-tsc --noEmit && vite build && yarn post-build", + "rebuild": "yarn build && yarn tsx ./release-scripts/create-release.ts rebuild", "preview": "vite preview", "release": "yarn config set version-tag-prefix clear-wallet@v && yarn config set version-git-message 'clear-wallet@v%s' && yarn version --patch && yarn postversion", "postversion": "git push", diff --git a/release-scripts/create-release.ts b/release-scripts/create-release.ts index beaf3ee..78cbf0f 100644 --- a/release-scripts/create-release.ts +++ b/release-scripts/create-release.ts @@ -1,10 +1,10 @@ const pFs = import('fs') -const pCps = import ('child_process') +const pCps = import('child_process') -async function ghRelease(changes: string[]) { +async function ghRelease (changes: string[], isRebuild: boolean) { const fs = (await pFs).default - if (!fs.existsSync('releases')){ + if (!fs.existsSync('releases')) { fs.mkdirSync('releases'); } @@ -32,29 +32,31 @@ async function ghRelease(changes: string[]) { arch.finalize(); }); - const changeLogPath = `releases/${pkg.version}.changelog.md`; + if (!isRebuild) { + const changeLogPath = `releases/${pkg.version}.changelog.md`; - fs.writeFileSync( - changeLogPath, - `# ${pkg.version} \n + fs.writeFileSync( + changeLogPath, + `# ${pkg.version} \n ${changes.reduce((acc: string, change: string) => { - return acc + `- ${change}\n`; - }, '')}`, - ); - const cps = (await pCps) - console.log( - await new Promise((resolve) => { - const p = cps.spawn('gh', ['release', 'create', `v${pkg.version}`, `./${outputPath}`, '-F', `./${changeLogPath}`], { - shell: true, - }); - let result = ''; - p.stdout.on('data', (data) => (result += data.toString())); - p.stderr.on('data', (data) => (result += data.toString())); - p.on('close', () => { - resolve(result); - }); - }), - ); + return acc + `- ${change}\n`; + }, '')}`, + ); + const cps = (await pCps) + console.log( + await new Promise((resolve) => { + const p = cps.spawn('gh', ['release', 'create', `v${pkg.version}`, `./${outputPath}`, '-F', `./${changeLogPath}`], { + shell: true, + }); + let result = ''; + p.stdout.on('data', (data) => (result += data.toString())); + p.stderr.on('data', (data) => (result += data.toString())); + p.on('close', () => { + resolve(result); + }); + }), + ); + } } (async () => { @@ -63,6 +65,9 @@ async function ghRelease(changes: string[]) { return; } const changes = process.argv[2].split(','); - await ghRelease(changes); + + const isRebuild = changes.includes('rebuild'); + + await ghRelease(changes, isRebuild); console.log('Release created', changes); })(); diff --git a/src/extension/manifest.json b/src/extension/manifest.json index 1532057..61df0bc 100644 --- a/src/extension/manifest.json +++ b/src/extension/manifest.json @@ -3,8 +3,8 @@ "name": "__MSG_appName__", "description": "__MSG_appDesc__", "default_locale": "en", - "version": "1.4.3", - "version_name": "1.4.3", + "version": "1.4.4", + "version_name": "1.4.4", "icons": { "16": "assets/extension-icon/wallet_16.png", "32": "assets/extension-icon/wallet_32.png", diff --git a/src/views/SignTx.vue b/src/views/SignTx.vue index 65c728b..b20edb5 100644 --- a/src/views/SignTx.vue +++ b/src/views/SignTx.vue @@ -127,7 +127,7 @@ > - Set Price + Set Limit @@ -399,16 +399,16 @@ export default defineComponent({ interval = setInterval(setItervalFn, 1000) as any; }); - const setGasLimit = () => { + const setGasLimit = async () => { gasLimit.value = inGasLimit.value; - newGasData(); + await newGasData(); gasLimitModal.value = false; }; - const setGasPrice = () => { + const setGasPrice = async () => { gasPrice.value = inGasPrice.value; gasPriceReFetch.value = false; - newGasData(); + await newGasData(); gasPriceModal.value = false; };