Skip to content

Commit

Permalink
Merge branch 'V4' into fix/no-retry-canary
Browse files Browse the repository at this point in the history
  • Loading branch information
chris13524 authored Feb 29, 2024
2 parents 2c25083 + d11cc2d commit 8c89370
Show file tree
Hide file tree
Showing 95 changed files with 2,089 additions and 1,585 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/ui_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,9 @@ jobs:
- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').packages['apps/laboratory']['devDependencies']['@playwright/test'])")" >> $GITHUB_ENV
- name: Install Brave Browser
working-directory: ./apps/laboratory/
run: sudo ./scripts/install-brave-browser.sh
- name: Cache playwright binaries
uses: actions/cache@v4
id: playwright-cache
Expand Down
10 changes: 10 additions & 0 deletions apps/gallery/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,15 @@
# @apps/gallery

## 4.0.11

### Patch Changes

- Analytics connection event improvements. Unsupported chain flag. Siwe package refactor. RPC improvements. UI improvements'

- Updated dependencies []:
- @web3modal/common@4.0.11
- @web3modal/ui@4.0.11

## 4.0.10

### Patch Changes
Expand Down
6 changes: 3 additions & 3 deletions apps/gallery/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apps/gallery",
"version": "4.0.10",
"version": "4.0.11",
"private": true,
"main": "index.js",
"scripts": {
Expand All @@ -9,8 +9,8 @@
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"@web3modal/common": "4.0.10",
"@web3modal/ui": "4.0.10",
"@web3modal/common": "4.0.11",
"@web3modal/ui": "4.0.11",
"lit": "3.1.0",
"storybook": "7.6.7"
},
Expand Down
11 changes: 11 additions & 0 deletions apps/laboratory/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,16 @@
# @apps/laboratory

## 4.0.11

### Patch Changes

- Analytics connection event improvements. Unsupported chain flag. Siwe package refactor. RPC improvements. UI improvements'

- Updated dependencies []:
- @web3modal/ethers@4.0.11
- @web3modal/siwe@4.0.11
- @web3modal/wagmi@4.0.11

## 4.0.10

### Patch Changes
Expand Down
16 changes: 8 additions & 8 deletions apps/laboratory/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@apps/laboratory",
"version": "4.0.10",
"version": "4.0.11",
"private": true,
"scripts": {
"dev:laboratory": "next dev",
Expand All @@ -24,23 +24,23 @@
"@sentry/browser": "7.92.0",
"@sentry/react": "7.92.0",
"@tanstack/react-query": "5.17.19",
"@web3modal/ethers": "4.0.10",
"@web3modal/ethers5": "4.0.10",
"@web3modal/wagmi": "4.0.10",
"@web3modal/ethers": "4.0.11",
"@web3modal/siwe": "4.0.11",
"@web3modal/wagmi": "4.0.11",
"framer-motion": "10.17.9",
"next": "14.0.4",
"next-auth": "4.24.5",
"react-icons": "4.12.0",
"siwe": "2.1.4",
"valtio": "1.11.2",
"viem": "2.5.0",
"wagmi": "2.5.6"
"ethers": "6.9.0",
"viem": "2.7.13",
"wagmi": "2.5.7"
},
"devDependencies": {
"@aws-sdk/client-cloudwatch": "3.509.0",
"@mailsac/api": "1.0.5",
"@playwright/test": "1.40.1",
"dotenv": "16.3.1",
"ethers": "6.9.0"
"dotenv": "16.3.1"
}
}
11 changes: 11 additions & 0 deletions apps/laboratory/scripts/install-brave-browser.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
echo "Installing Brave Browser"

echo "set man-db/auto-update false" | sudo debconf-communicate && sudo dpkg-reconfigure man-db

curl -fsSLo /usr/share/keyrings/brave-browser-archive-keyring.gpg https://brave-browser-apt-release.s3.brave.com/brave-browser-archive-keyring.gpg

echo "deb [signed-by=/usr/share/keyrings/brave-browser-archive-keyring.gpg] https://brave-browser-apt-release.s3.brave.com/ stable main" | tee /etc/apt/sources.list.d/brave-browser-release.list

apt update -y

apt install brave-browser -y
2 changes: 1 addition & 1 deletion apps/laboratory/src/components/Siwe/SiweData.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {
} from '@chakra-ui/react'
import { useEffect, useState } from 'react'
import { useSession } from 'next-auth/react'
import type { SIWESession } from '@web3modal/core'
import type { SIWESession } from '@web3modal/siwe'

export function SiweData() {
const [ready, setReady] = useState(false)
Expand Down
2 changes: 1 addition & 1 deletion apps/laboratory/src/pages/api/auth/[...nextauth].ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import type { SIWESession } from '@web3modal/core'
import type { SIWESession } from '@web3modal/siwe'
import type { NextApiRequest, NextApiResponse } from 'next'
import nextAuth from 'next-auth'
import credentialsProvider from 'next-auth/providers/credentials'
Expand Down
2 changes: 1 addition & 1 deletion apps/laboratory/src/utils/SiweUtils.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { SiweMessage } from 'siwe'
import { getCsrfToken, signIn, signOut, getSession } from 'next-auth/react'
import type { SIWEVerifyMessageArgs, SIWECreateMessageArgs, SIWESession } from '@web3modal/core'
import type { SIWEVerifyMessageArgs, SIWECreateMessageArgs, SIWESession } from '@web3modal/siwe'
import { createSIWEConfig } from '@web3modal/siwe'

export const siweConfig = createSIWEConfig({
Expand Down
15 changes: 15 additions & 0 deletions apps/laboratory/tests/shared/constants/browsers.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
export const BRAVE_MACOS_PATH = '/Applications/Brave Browser.app/Contents/MacOS/Brave Browser'
export const BRAVE_LINUX_PATH = '/usr/bin/brave-browser'
export const BRAVE_WINDOWS_PATH =
'C:\\Program Files\\BraveSoftware\\Brave-Browser\\Application\\brave.exe'

export function getLocalBravePath(): string {
switch (process.platform) {
case 'linux':
return BRAVE_LINUX_PATH
case 'win32':
return BRAVE_WINDOWS_PATH
default:
return BRAVE_MACOS_PATH
}
}
2 changes: 1 addition & 1 deletion apps/laboratory/tests/shared/constants/devices.ts
Original file line number Diff line number Diff line change
@@ -1 +1 @@
export const DEVICES = ['Desktop Chrome', 'Desktop Firefox', 'Desktop Safari']
export const DEVICES = ['Desktop Chrome', 'Desktop Brave', 'Desktop Firefox']
10 changes: 5 additions & 5 deletions apps/laboratory/tests/shared/pages/ModalPage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ export class ModalPage {

async disconnect() {
const accountBtn = this.page.getByTestId('account-button')
await expect(accountBtn).toBeVisible()
await expect(accountBtn).toBeEnabled()
await expect(accountBtn, 'Account button should be visible').toBeVisible()
await expect(accountBtn, 'Account button should be enabled').toBeEnabled()
await accountBtn.click({ force: true })
const disconnectBtn = this.page.getByTestId('disconnect-button')
await expect(disconnectBtn).toBeVisible()
await expect(disconnectBtn).toBeEnabled()
await expect(disconnectBtn, 'Disconnect button should be visible').toBeVisible()
await expect(disconnectBtn, 'Disconnect button should be visible').toBeEnabled()
await disconnectBtn.click({ force: true })
}

Expand All @@ -108,7 +108,7 @@ export class ModalPage {

async promptSiwe() {
const siweSign = this.page.getByTestId('w3m-connecting-siwe-sign')
await expect(siweSign, 'Siwe promp sign button should be enabled').toBeEnabled()
await expect(siweSign, 'Siwe prompt sign button should be enabled').toBeEnabled()
await siweSign.click()
}

Expand Down
6 changes: 1 addition & 5 deletions apps/laboratory/tests/shared/utils/device.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
import { DEVICES } from '../constants/devices'

export function getAvailableDevices(): string[] {
if (!process.env['CI']) {
return DEVICES
}

return DEVICES.filter(d => d !== 'Desktop Safari')
return DEVICES
}
27 changes: 26 additions & 1 deletion apps/laboratory/tests/shared/utils/project.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { devices } from '@playwright/test'
import { getAvailableDevices } from './device'
import { getValue } from './config'
import { getLocalBravePath, BRAVE_LINUX_PATH } from '../constants/browsers'

const availableDevices = getAvailableDevices()

Expand All @@ -9,16 +11,35 @@ const PERMUTATIONS = availableDevices.flatMap(device =>
LIBRARIES.map(library => ({ device, library }))
)

interface UseOptions {
launchOptions: {
executablePath: string
}
}

interface CustomProperties {
testIgnore?: string
testMatch?: string
useOptions?: UseOptions
}

export type CustomProjectProperties = {
[T in string]: CustomProperties
}

const braveOptions: UseOptions = {
launchOptions: {
executablePath: getValue(BRAVE_LINUX_PATH, getLocalBravePath())
}
}

const customProjectProperties: CustomProjectProperties = {
'Desktop Brave/wagmi': {
useOptions: braveOptions
},
'Desktop Brave/ethers': {
useOptions: braveOptions
},
'Desktop Chrome/wagmi': {
testIgnore: 'email.spec.ts'
},
Expand All @@ -37,13 +58,17 @@ export interface Permutation {

export function getProjects() {
return PERMUTATIONS.map(({ device, library }) => {
const deviceName = device === 'Desktop Brave' ? 'Desktop Chrome' : device
let project = {
name: `${device}/${library}`,
use: { ...devices[device], library }
use: { ...devices[deviceName], library }
}
const props = customProjectProperties[project.name]
if (props) {
project = { ...project, ...props }
if (props.useOptions) {
project.use = { ...project.use, ...props.useOptions }
}
}

return project
Expand Down
5 changes: 4 additions & 1 deletion apps/laboratory/tests/shared/validators/WalletValidator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@ export class WalletValidator {
}

async expectConnected() {
await expect(this.gotoSessions).toBeVisible()
await expect(
this.gotoSessions,
'Approve screen should be closed and sessions tab visible'
).toBeVisible()
await this.gotoSessions.click()
await this.expectSessionCard()
}
Expand Down
9 changes: 9 additions & 0 deletions examples/html-ethers5/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @examples/html-ethers5

## 4.0.11

### Patch Changes

- Analytics connection event improvements. Unsupported chain flag. Siwe package refactor. RPC improvements. UI improvements'

- Updated dependencies []:
- @web3modal/ethers5@4.0.11

## 4.0.10

### Patch Changes
Expand Down
4 changes: 2 additions & 2 deletions examples/html-ethers5/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
{
"name": "@examples/html-ethers5",
"private": true,
"version": "4.0.10",
"version": "4.0.11",
"scripts": {
"dev:example": "vite --port 3011",
"build:examples": "vite build"
},
"dependencies": {
"@web3modal/ethers5": "4.0.10",
"@web3modal/ethers5": "4.0.11",
"ethers": "5.7.2"
},
"devDependencies": {
Expand Down
9 changes: 9 additions & 0 deletions examples/html-wagmi/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @examples/html-wagmi

## 4.0.11

### Patch Changes

- Analytics connection event improvements. Unsupported chain flag. Siwe package refactor. RPC improvements. UI improvements'

- Updated dependencies []:
- @web3modal/wagmi@4.0.11

## 4.0.10

### Patch Changes
Expand Down
6 changes: 4 additions & 2 deletions examples/html-wagmi/package.json
Original file line number Diff line number Diff line change
@@ -1,13 +1,15 @@
{
"name": "@examples/html-wagmi",
"private": true,
"version": "4.0.10",
"version": "4.0.11",
"scripts": {
"dev:example": "vite --port 3001",
"build:examples": "vite build"
},
"dependencies": {
"@web3modal/wagmi": "4.0.10",
"@web3modal/wagmi": "4.0.11",
"@wagmi/connectors": "4.1.14",
"@wagmi/core": "2.6.5",
"react": "18.2.0",
"react-dom": "18.2.0"
},
Expand Down
9 changes: 9 additions & 0 deletions examples/next-wagmi/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @examples/next-wagmi

## 4.0.11

### Patch Changes

- Analytics connection event improvements. Unsupported chain flag. Siwe package refactor. RPC improvements. UI improvements'

- Updated dependencies []:
- @web3modal/wagmi@4.0.11

## 4.0.10

### Patch Changes
Expand Down
8 changes: 4 additions & 4 deletions examples/next-wagmi/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@examples/next-wagmi",
"version": "4.0.10",
"version": "4.0.11",
"private": true,
"scripts": {
"dev": "next dev",
Expand All @@ -10,12 +10,12 @@
},
"dependencies": {
"@tanstack/react-query": "5.17.19",
"@web3modal/wagmi": "4.0.10",
"@web3modal/wagmi": "4.0.11",
"next": "14.1.0",
"react": "18.2.0",
"react-dom": "18.2.0",
"viem": "2.5.0",
"wagmi": "2.5.6"
"viem": "2.7.13",
"wagmi": "2.5.7"
},
"devDependencies": {
"@types/node": "20.11.5",
Expand Down
9 changes: 9 additions & 0 deletions examples/react-ethers5/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,14 @@
# @examples/react-ethers5

## 4.0.11

### Patch Changes

- Analytics connection event improvements. Unsupported chain flag. Siwe package refactor. RPC improvements. UI improvements'

- Updated dependencies []:
- @web3modal/ethers5@4.0.11

## 4.0.10

### Patch Changes
Expand Down
Loading

0 comments on commit 8c89370

Please sign in to comment.