From 98d1b441a54a30115dc2a2db880341233882a960 Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Mon, 15 Jul 2024 12:51:28 -0600 Subject: [PATCH 1/3] Update docs for gnosis/safe package for building within vue env --- .../docs/[...3]modules/[...1]core/+page.md | 5 ++++- .../docs/[...3]modules/[...7]vue/+page.md | 3 +++ .../docs/[...4]wallets/[...12]gnosis/+page.md | 18 ++++++++++++++++++ packages/core/README.md | 4 +++- packages/gnosis/README.md | 19 +++++++++++++++++++ packages/gnosis/package.json | 2 +- 6 files changed, 48 insertions(+), 3 deletions(-) diff --git a/docs/src/routes/docs/[...3]modules/[...1]core/+page.md b/docs/src/routes/docs/[...3]modules/[...1]core/+page.md index e6ee59706..72ea627bf 100644 --- a/docs/src/routes/docs/[...3]modules/[...1]core/+page.md +++ b/docs/src/routes/docs/[...3]modules/[...1]core/+page.md @@ -441,6 +441,7 @@ const sendTransaction = async () => { console.log(result) } ``` + --- #### disableFontDownload @@ -1902,7 +1903,9 @@ export default { '@web3-onboard/gas', '@web3-onboard/sequence', 'js-sha3', - '@ethersproject/bignumber' + '@ethersproject/bignumber', + '@safe-global/safe-apps-sdk', + '@safe-global/safe-apps-provider' ], esbuildOptions: { // Node.js global to browser globalThis diff --git a/docs/src/routes/docs/[...3]modules/[...7]vue/+page.md b/docs/src/routes/docs/[...3]modules/[...7]vue/+page.md index df335698a..50c9b85d8 100644 --- a/docs/src/routes/docs/[...3]modules/[...7]vue/+page.md +++ b/docs/src/routes/docs/[...3]modules/[...7]vue/+page.md @@ -503,6 +503,9 @@ export default { commonjsOptions: { transformMixedEsModules: true } + }, + optimizeDeps: { + include: ['@safe-global/safe-apps-sdk', '@safe-global/safe-apps-provider'] } } ``` diff --git a/docs/src/routes/docs/[...4]wallets/[...12]gnosis/+page.md b/docs/src/routes/docs/[...4]wallets/[...12]gnosis/+page.md index 81d9c083f..5567ed7d0 100644 --- a/docs/src/routes/docs/[...4]wallets/[...12]gnosis/+page.md +++ b/docs/src/routes/docs/[...4]wallets/[...12]gnosis/+page.md @@ -80,3 +80,21 @@ Note: With the `safeTxGas` you will see additional value on the `gasLimit` displ ## Build Environments For build env configurations and setups please see the Build Env section [here](/docs/modules/core#build-environments) + +## Vue Build Configuration + +If using Vue be sure to include the necessary peerDeps in the `vite.config.ts` specifically within the `optimizeDeps.include` list + +```typescript +export default defineConfig({ + plugins: [vue(), vueJsx(), VueDevTools()], + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)) + } + }, + optimizeDeps: { + include: ['@safe-global/safe-apps-sdk', '@safe-global/safe-apps-provider'] + } +}) +``` \ No newline at end of file diff --git a/packages/core/README.md b/packages/core/README.md index ebaaa4b5d..d6a0b299a 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -1670,7 +1670,9 @@ const config: UserConfig = { '@web3-onboard/gas', '@web3-onboard/sequence', 'js-sha3', - '@ethersproject/bignumber' + '@ethersproject/bignumber', + '@safe-global/safe-apps-sdk', + '@safe-global/safe-apps-provider' ], esbuildOptions: { // Node.js global to browser globalThis diff --git a/packages/gnosis/README.md b/packages/gnosis/README.md index 435b7768f..757a7a46e 100644 --- a/packages/gnosis/README.md +++ b/packages/gnosis/README.md @@ -57,3 +57,22 @@ let trans = await wallet.instance.txs.send({txs:[tx], params}) ``` Note: With the `safeTxGas` you will see additional value on the `gasLimit` displayed in the Safe. Check [Safe docs](https://github.com/safe-global/safe-contracts/blob/a6504a9afdeac186a8cdb29ad68b189523c80eda/docs/safe_tx_gas.md) for full details on that computation. + + +## Vue Build Configuration + +If using Vue be sure to include the necessary peerDeps in the `vite.config.ts` specifically within the `optimizeDeps.include` list + +```typescript +export default defineConfig({ + plugins: [vue(), vueJsx(), VueDevTools()], + resolve: { + alias: { + '@': fileURLToPath(new URL('./src', import.meta.url)) + } + }, + optimizeDeps: { + include: ['@safe-global/safe-apps-sdk', '@safe-global/safe-apps-provider'] + } +}) +``` \ No newline at end of file diff --git a/packages/gnosis/package.json b/packages/gnosis/package.json index 9fd40516e..2dd5ff6bb 100644 --- a/packages/gnosis/package.json +++ b/packages/gnosis/package.json @@ -1,6 +1,6 @@ { "name": "@web3-onboard/gnosis", - "version": "2.3.1", + "version": "2.3.2-alpha.1", "description": "Safe module for connecting to Web3-Onboard. Web3-Onboard makes it simple to connect Ethereum hardware and software wallets to your dapp. Features standardised spec compliant web3 providers for all supported wallets, framework agnostic modern javascript UI with code splitting, CSS customization, multi-chain and multi-account support, reactive wallet state subscriptions and real-time transaction state change notifications.", "keywords": [ "Ethereum", From e4c8fd90217934afe6994b41f6401a35396ffb78 Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Mon, 15 Jul 2024 12:53:26 -0600 Subject: [PATCH 2/3] Add clarity and remoinder for peerDeps --- docs/src/routes/docs/[...4]wallets/[...12]gnosis/+page.md | 2 +- packages/gnosis/README.md | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/src/routes/docs/[...4]wallets/[...12]gnosis/+page.md b/docs/src/routes/docs/[...4]wallets/[...12]gnosis/+page.md index 5567ed7d0..e8c124ba4 100644 --- a/docs/src/routes/docs/[...4]wallets/[...12]gnosis/+page.md +++ b/docs/src/routes/docs/[...4]wallets/[...12]gnosis/+page.md @@ -83,7 +83,7 @@ For build env configurations and setups please see the Build Env section [here]( ## Vue Build Configuration -If using Vue be sure to include the necessary peerDeps in the `vite.config.ts` specifically within the `optimizeDeps.include` list +If using Vue be sure to include the necessary peerDeps in the `vite.config.ts` specifically within the `optimizeDeps.include` list and install the necessary peer deps `npm i @safe-global/safe-apps-provider @safe-global/safe-apps-sdk`. ```typescript export default defineConfig({ diff --git a/packages/gnosis/README.md b/packages/gnosis/README.md index 757a7a46e..ebd5e430b 100644 --- a/packages/gnosis/README.md +++ b/packages/gnosis/README.md @@ -61,7 +61,7 @@ Note: With the `safeTxGas` you will see additional value on the `gasLimit` displ ## Vue Build Configuration -If using Vue be sure to include the necessary peerDeps in the `vite.config.ts` specifically within the `optimizeDeps.include` list +If using Vue be sure to include the necessary peerDeps in the `vite.config.ts` specifically within the `optimizeDeps.include` list and install the necessary peer deps `npm i @safe-global/safe-apps-provider @safe-global/safe-apps-sdk`. ```typescript export default defineConfig({ From 0745a56c0ea2ae7bef180bbf1cff999b2af4e5a8 Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Mon, 15 Jul 2024 13:29:02 -0600 Subject: [PATCH 3/3] Add cors blocking extension notes --- docs/src/routes/docs/[...4]wallets/[...12]gnosis/+page.md | 7 ++++++- packages/gnosis/README.md | 4 ++++ 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/docs/src/routes/docs/[...4]wallets/[...12]gnosis/+page.md b/docs/src/routes/docs/[...4]wallets/[...12]gnosis/+page.md index e8c124ba4..e4612b4d8 100644 --- a/docs/src/routes/docs/[...4]wallets/[...12]gnosis/+page.md +++ b/docs/src/routes/docs/[...4]wallets/[...12]gnosis/+page.md @@ -79,7 +79,12 @@ Note: With the `safeTxGas` you will see additional value on the `gasLimit` displ ## Build Environments -For build env configurations and setups please see the Build Env section [here](/docs/modules/core#build-environments) +For build env configurations and setups please see the Build Env section [here](/docs/modules/core#build-environments). + + +## Local testing within the Safe app + +Ensure the application is building and working properly within the browser and then add or enable your cors blocker extension or script of choice. An example is the `Allow CORS` browser extension. ## Vue Build Configuration diff --git a/packages/gnosis/README.md b/packages/gnosis/README.md index ebd5e430b..3e4a79c16 100644 --- a/packages/gnosis/README.md +++ b/packages/gnosis/README.md @@ -59,6 +59,10 @@ let trans = await wallet.instance.txs.send({txs:[tx], params}) Note: With the `safeTxGas` you will see additional value on the `gasLimit` displayed in the Safe. Check [Safe docs](https://github.com/safe-global/safe-contracts/blob/a6504a9afdeac186a8cdb29ad68b189523c80eda/docs/safe_tx_gas.md) for full details on that computation. +## Local testing within the Safe app + +Ensure the application is building and working properly within the browser and then add or enable your cors blocker extension or script of choice. An example is the `Allow CORS` browser extension. + ## Vue Build Configuration If using Vue be sure to include the necessary peerDeps in the `vite.config.ts` specifically within the `optimizeDeps.include` list and install the necessary peer deps `npm i @safe-global/safe-apps-provider @safe-global/safe-apps-sdk`.