From 581ebd4ff8984dfd73d1542db1f5a6ad3c7d2421 Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Mon, 30 Jan 2023 12:36:30 -0700 Subject: [PATCH 1/2] Update branch paths and targets for develop, main and docs --- .circleci/config.yml | 4 ++-- .github/workflows/docs.yml | 2 +- .github/workflows/pr-status-checks.yml | 2 +- README.md | 2 +- docs/README.md | 2 +- .../docs/[...1]overview/[...1]introduction.md | 2 +- .../[...1]overview/[...2]contribution-guide.md | 4 ++-- .../[...3]onboard.js-migration-guide.md | 2 +- docs/src/routes/docs/[...3]modules/core.md | 18 +++++++++--------- packages/core/README.md | 16 ++++++++-------- packages/react/README.md | 2 +- packages/transaction-preview/README.md | 2 +- packages/vue/README.md | 2 +- 13 files changed, 30 insertions(+), 30 deletions(-) diff --git a/.circleci/config.yml b/.circleci/config.yml index 592235c1b..82aceb3db 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -18,12 +18,12 @@ aliases: - &deploy_production_filters filters: branches: - only: v2-web3-onboard + only: main - &deploy_staging_filters filters: branches: - only: v2-web3-onboard-develop + only: develop - &test_package_version_for_alpha_tag_break_false run: diff --git a/.github/workflows/docs.yml b/.github/workflows/docs.yml index e0ae79992..29da7eba3 100644 --- a/.github/workflows/docs.yml +++ b/.github/workflows/docs.yml @@ -4,7 +4,7 @@ name: Deploy documentation to Pages on: # Runs on pushes targeting the default branch push: - branches: ["docs-main"] + branches: ["docs"] # Allows you to run this workflow manually from the Actions tab workflow_dispatch: diff --git a/.github/workflows/pr-status-checks.yml b/.github/workflows/pr-status-checks.yml index fb5133001..22046747b 100644 --- a/.github/workflows/pr-status-checks.yml +++ b/.github/workflows/pr-status-checks.yml @@ -5,7 +5,7 @@ on: workflow_dispatch: pull_request: branches: - - v2-web3-onboard-develop + - develop jobs: checks: diff --git a/README.md b/README.md index 5c2b45bff..b0f453146 100644 --- a/README.md +++ b/README.md @@ -121,7 +121,7 @@ If you would like to test out the current functionality of V2 in a small browser - Clone the repo: `git clone git@github.com:blocknative/onboard.git` - Change in to the onboard directory: `cd onboard` -- Checkout the V2 feature branch: `git checkout v2-web3-onboard` +- Checkout the V2 feature branch: `git checkout main` - Install the dependencies: `yarn` (if running a M1 mac - `yarn install-m1-mac`) - Run all packages in dev mode: `yarn dev` - To view the demo app in the browser after running the above steps navigate to [http://localhost:8080](http://localhost:8080) diff --git a/docs/README.md b/docs/README.md index 83f33f53d..c3385e03e 100644 --- a/docs/README.md +++ b/docs/README.md @@ -22,4 +22,4 @@ Run `yarn build` and confirm no errors present from the proposed changes. Confirm vercel build within PR builds without error and check instance deployment for accuracy. -PR should target branch the main develop branch - [v2-web3-onboard-develop](/~https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard-develop). \ No newline at end of file +PR should target branch the main develop branch - [develop](/~https://github.com/blocknative/web3-onboard/tree/develop). \ No newline at end of file diff --git a/docs/src/routes/docs/[...1]overview/[...1]introduction.md b/docs/src/routes/docs/[...1]overview/[...1]introduction.md index 47ef55454..139379c5b 100644 --- a/docs/src/routes/docs/[...1]overview/[...1]introduction.md +++ b/docs/src/routes/docs/[...1]overview/[...1]introduction.md @@ -169,7 +169,7 @@ Test out the current functionality of web3-onboard in a small browser demo: - Clone the repo: `git clone git@github.com:blocknative/web3-onboard.git` - Change it to the onboard directory: `cd web3-onboard` -- Checkout the main web3-onboard branch: `git checkout v2-web3-onboard` +- Checkout the main web3-onboard branch: `git checkout main` - Install the dependencies: `yarn` (if running a M1 mac - `yarn install-m1-mac`) - Run all packages in dev mode: `yarn dev` - [View demo app in the browser](http://localhost:8080/) diff --git a/docs/src/routes/docs/[...1]overview/[...2]contribution-guide.md b/docs/src/routes/docs/[...1]overview/[...2]contribution-guide.md index b4c2ae66c..9f73532f5 100644 --- a/docs/src/routes/docs/[...1]overview/[...2]contribution-guide.md +++ b/docs/src/routes/docs/[...1]overview/[...2]contribution-guide.md @@ -26,7 +26,7 @@ After making changes within a web3-onboard package you will want to bump the ver We use both semantic and `alpha` versioning for publishing and testing packages prior to official release. This means if you do not see an `-alpha.x` tag on the version of the package you made changes in you will need to not only bump the version but also add an alpha flag followed by an alpha version number starting at 1 (ex. `-alpha.1`). Example : Adding a new injected wallet to the `injected` package - -[Injected Package.json](/~https://github.com/blocknative/web3-onboard/blob/v2-web3-onboard-develop/packages/injected/package.json#L3) changes : `"version": "2.2.4",` --> `"version": "2.3.0-alpha.1",` +[Injected Package.json](/~https://github.com/blocknative/web3-onboard/blob/develop/packages/injected/package.json#L3) changes : `"version": "2.2.4",` --> `"version": "2.3.0-alpha.1",` Example 2 : Bug fix within the `core` package - [Core package.json](/~https://github.com/blocknative/web3-onboard/blob/8531a73d69365f7d584320f1c4b97a5d90f1c34e/packages/core/package.json#L3) changes: `"version": "2.9.1-alpha.1",` --> `"version": "2.9.1-alpha.2",` @@ -44,7 +44,7 @@ If you cannot write the code yourself to add a new wallet, then go ahead and cre ### Documentation contributions -In order to contribute to the docs, you'll have to create a PR on the [v2-web3-onboard-develop branch](/~https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard-develop). If you contribute code, you should definitely document it appropriately. We highly encourage the community to improve web3-onboard docs, if you have any questions don't hesitate to reach out. +In order to contribute to the docs, you'll have to create a PR on the [develop branch](/~https://github.com/blocknative/web3-onboard/tree/develop). If you contribute code, you should definitely document it appropriately. We highly encourage the community to improve web3-onboard docs, if you have any questions don't hesitate to reach out. ## Feedback diff --git a/docs/src/routes/docs/[...1]overview/[...3]onboard.js-migration-guide.md b/docs/src/routes/docs/[...1]overview/[...3]onboard.js-migration-guide.md index 1e621c866..92475d0b0 100644 --- a/docs/src/routes/docs/[...1]overview/[...3]onboard.js-migration-guide.md +++ b/docs/src/routes/docs/[...1]overview/[...3]onboard.js-migration-guide.md @@ -18,7 +18,7 @@ If you have bnc-onboard installed, you will need to install web3-onboard instead 3. Make use of our API actions like `await onboard.connectWallet()` to allow a user to connect their wallets. For a full code overview of the upgrade process using the React Hooks package please see [this PR](/~https://github.com/blocknative/react-demo/pull/160/files) with special attention to the `App.js` and `services.js` files. -To help you get started quickly we’ve put together [a set of examples across multiple frameworks that includes the above-mentioned steps](/~https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard-develop/examples). +To help you get started quickly we’ve put together [a set of examples across multiple frameworks that includes the above-mentioned steps](/~https://github.com/blocknative/web3-onboard/tree/develop/examples). ### Package Upgrade - Modularization diff --git a/docs/src/routes/docs/[...3]modules/core.md b/docs/src/routes/docs/[...3]modules/core.md index d85e0bf79..e3a98b772 100644 --- a/docs/src/routes/docs/[...3]modules/core.md +++ b/docs/src/routes/docs/[...3]modules/core.md @@ -53,13 +53,13 @@ npm install @web3-onboard/coinbase @web3-onboard/fortmatic @web3-onboard/gnosis Checkout our full library of quick start examples for connecting and interacting with EVM based wallets - **[React](/~https://github.com/blocknative/react-demo)** -- **[Nextjs 13](/~https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-nextjs-13)** -- **[Nextjs](/~https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-nextjs)** -- **[Svelte](/~https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/packages/demo)** -- **[SvelteKit](/~https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-sveltekit)** -- **[Vite/React](/~https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-vite-react)** -- **[Vue](/~https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-vuejs)** -- **[Vue2](/~https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-vuejs-v2)** +- **[Nextjs 13](/~https://github.com/blocknative/web3-onboard/tree/main/examples/with-nextjs-13)** +- **[Nextjs](/~https://github.com/blocknative/web3-onboard/tree/main/examples/with-nextjs)** +- **[Svelte](/~https://github.com/blocknative/web3-onboard/tree/main/packages/demo)** +- **[SvelteKit](/~https://github.com/blocknative/web3-onboard/tree/main/examples/with-sveltekit)** +- **[Vite/React](/~https://github.com/blocknative/web3-onboard/tree/main/examples/with-vite-react)** +- **[Vue](/~https://github.com/blocknative/web3-onboard/tree/main/examples/with-vuejs)** +- **[Vue2](/~https://github.com/blocknative/web3-onboard/tree/main/examples/with-vuejs-v2)** ## Initialization @@ -178,7 +178,7 @@ type Locale = string // eg 'en', 'es' type i18nOptions = Record ``` -To see a list of all of the text values that can be internationalized or replaced, check out the [default en file](/~https://github.com/blocknative/web3-onboard/blob/v2-web3-onboard-develop/packages/core/src/i18n/en.json). +To see a list of all of the text values that can be internationalized or replaced, check out the [default en file](/~https://github.com/blocknative/web3-onboard/blob/develop/packages/core/src/i18n/en.json). Onboard is using the [ICU syntax](https://formatjs.io/docs/core-concepts/icu-syntax/) for formatting under the hood. **`theme`** @@ -258,7 +258,7 @@ Currently notifications are positioned in the same location as the account cente The `transactionHandler` can react off any property of the Ethereum TransactionData returned to the callback from the event (see console.log in example init). In turn, it can return a Custom `Notification` object to define the verbiage, styling, or add functionality: - `Notification.message` - to completely customize the message shown -- `Notification.eventCode` - handle codes in your own way - see codes here under the notify prop [default en file here](/~https://github.com/blocknative/web3-onboard/blob/v2-web3-onboard-develop/packages/core/src/i18n/en.json) +- `Notification.eventCode` - handle codes in your own way - see codes here under the notify prop [default en file here](/~https://github.com/blocknative/web3-onboard/blob/develop/packages/core/src/i18n/en.json) - `Notification.type` - icon type displayed (see `NotificationType` below for options) - `Notification.autoDismiss` - time (in ms) after which the notification will be dismissed. If set to `0` the notification will remain on screen until the user dismisses the notification, refreshes the page or navigates away from the site with the notifications - `Notification.link` - add link to the transaction hash. For instance, a link to the transaction on etherscan diff --git a/packages/core/README.md b/packages/core/README.md index 73b41229b..fc07d1a62 100644 --- a/packages/core/README.md +++ b/packages/core/README.md @@ -1,5 +1,5 @@ - Web3-Onboard UI Components + Web3-Onboard UI Components # @web3-onboard/core @@ -11,13 +11,13 @@ This is the core package that contains all of the UI and logic to be able to sea Checkout our full library of quick start examples for connecting and interacting with EVM based wallets - **[React](/~https://github.com/blocknative/react-demo)** -- **[Nextjs 13](/~https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-nextjs-13)** -- **[Nextjs](/~https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-nextjs)** -- **[Svelte](/~https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/packages/demo)** -- **[SvelteKit](/~https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-sveltekit)** -- **[Vite/React](/~https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-vite-react)** -- **[Vue](/~https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-vuejs)** -- **[Vue2](/~https://github.com/blocknative/web3-onboard/tree/v2-web3-onboard/examples/with-vuejs-v2)** +- **[Nextjs 13](/~https://github.com/blocknative/web3-onboard/tree/main/examples/with-nextjs-13)** +- **[Nextjs](/~https://github.com/blocknative/web3-onboard/tree/main/examples/with-nextjs)** +- **[Svelte](/~https://github.com/blocknative/web3-onboard/tree/main/packages/demo)** +- **[SvelteKit](/~https://github.com/blocknative/web3-onboard/tree/main/examples/with-sveltekit)** +- **[Vite/React](/~https://github.com/blocknative/web3-onboard/tree/main/examples/with-vite-react)** +- **[Vue](/~https://github.com/blocknative/web3-onboard/tree/main/examples/with-vuejs)** +- **[Vue2](/~https://github.com/blocknative/web3-onboard/tree/main/examples/with-vuejs-v2)** ## Installation diff --git a/packages/react/README.md b/packages/react/README.md index d139c2763..4fb096cab 100644 --- a/packages/react/README.md +++ b/packages/react/README.md @@ -1,5 +1,5 @@ - Web3-Onboard UI Components + Web3-Onboard UI Components # @web3-onboard/react diff --git a/packages/transaction-preview/README.md b/packages/transaction-preview/README.md index 93e55ab39..ed4525ae5 100644 --- a/packages/transaction-preview/README.md +++ b/packages/transaction-preview/README.md @@ -1,7 +1,7 @@ # @web3-onboard/transaction-preview ## A modular UI for previewing a single or set of unsigned Ethereum transactions. -![Transaction Preview Flow](/~https://github.com/blocknative/web3-onboard/blob/v2-web3-onboard-develop/assets/transaction-preview.gif?raw=true "Transaction Preview Flow") +![Transaction Preview Flow](/~https://github.com/blocknative/web3-onboard/blob/develop/assets/transaction-preview.gif?raw=true "Transaction Preview Flow") #### Full Transaction Preview package documentation available [here](https://onboard.blocknative.com/docs/packages/transaction-preview) diff --git a/packages/vue/README.md b/packages/vue/README.md index 3e5924e31..9d1b16f7c 100644 --- a/packages/vue/README.md +++ b/packages/vue/README.md @@ -1,5 +1,5 @@ - Web3-Onboard UI Components + Web3-Onboard UI Components # @web3-onboard/vue From 195b30655f7bf19ca56ba98813582f2e1985ff56 Mon Sep 17 00:00:00 2001 From: Adam Carpenter Date: Tue, 31 Jan 2023 11:34:11 -0700 Subject: [PATCH 2/2] update copyright on docs footer --- .../lib/components/ConnectWalletButton.svelte | 8 +- docs/src/lib/components/Footer.svelte | 2 +- .../src/lib/components/ThemeCustomizer.svelte | 84 ++++--------------- docs/src/lib/services/onboard.js | 8 +- 4 files changed, 25 insertions(+), 77 deletions(-) diff --git a/docs/src/lib/components/ConnectWalletButton.svelte b/docs/src/lib/components/ConnectWalletButton.svelte index 7bb322997..06f1ccec1 100644 --- a/docs/src/lib/components/ConnectWalletButton.svelte +++ b/docs/src/lib/components/ConnectWalletButton.svelte @@ -19,9 +19,13 @@ onMount(async () => { if (!onboard) { - onboard = await getOnboard() + if (document.location.href.includes('theming-tool')) { + onboard = await getOnboard('default') + } else { + onboard = await getOnboard('system') + } } - const sub = onboard.state.select('wallets').subscribe((wallets) => { + onboard.state.select('wallets').subscribe((wallets) => { connectedWallets = wallets buttonText = wallets.length ? 'Disconnect' : (buttonText = 'Connect') }) diff --git a/docs/src/lib/components/Footer.svelte b/docs/src/lib/components/Footer.svelte index cc01f34bc..0842f6f81 100644 --- a/docs/src/lib/components/Footer.svelte +++ b/docs/src/lib/components/Footer.svelte @@ -11,7 +11,7 @@ let text = { license: 'Released under the MIT License.', - copyright: '© 2022 Blocknative. All Rights Reserved.' + copyright: '© 2023 Blocknative. All Rights Reserved.' } diff --git a/docs/src/lib/components/ThemeCustomizer.svelte b/docs/src/lib/components/ThemeCustomizer.svelte index 7bbfa90ee..96915f103 100644 --- a/docs/src/lib/components/ThemeCustomizer.svelte +++ b/docs/src/lib/components/ThemeCustomizer.svelte @@ -1,84 +1,25 @@ diff --git a/docs/src/lib/services/onboard.js b/docs/src/lib/services/onboard.js index 5ab8a4615..7d6616b77 100644 --- a/docs/src/lib/services/onboard.js +++ b/docs/src/lib/services/onboard.js @@ -1,12 +1,13 @@ -import bnIcon from '$lib/components/icons/bnWhiteBackground.js' let onboard -const getOnboard = async () => { +const getOnboard = async (passedTheme) => { if (!onboard) { const key = 'svelteness::color-scheme' const scheme = localStorage[key] - let theme = scheme || 'system' + let theme = passedTheme || scheme || 'system' onboard = await intiOnboard(theme) classMutationListener() + } else { + await onboard.state.actions.updateTheme(passedTheme) } return onboard } @@ -173,7 +174,6 @@ const intiOnboard = async (theme) => { ], appMetadata: { name: 'Documentation', - icon: bnIcon, description: 'Example showcasing how to connect a wallet.', recommendedInjectedWallets: [ { name: 'MetaMask', url: 'https://metamask.io' },