From 98d1b441a54a30115dc2a2db880341233882a960 Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Mon, 15 Jul 2024 12:51:28 -0600 Subject: [PATCH 1/2] 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/2] 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({