Skip to content

Commit

Permalink
Merge branch 'main' into refactor/swaps-feature-flag-and-enable-on-re…
Browse files Browse the repository at this point in the history
…gular-wallets
  • Loading branch information
enesozturk authored Jul 22, 2024
2 parents 6a0c1cc + 1351e11 commit 83829fe
Show file tree
Hide file tree
Showing 52 changed files with 26,394 additions and 41,177 deletions.
49 changes: 34 additions & 15 deletions .github/workflows/pr_checks.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,16 +24,21 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3

- uses: pnpm/action-setup@v4
name: Install pnpm

- name: setup-node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
cache-dependency-path: 'package-lock.json'
cache: 'pnpm'

- name: install
run: npm ci
run: pnpm install

- name: build
run: npm run build
run: pnpm build
env:
NEXT_PUBLIC_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_PROJECT_ID }}

Expand All @@ -52,20 +57,26 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3

- uses: pnpm/action-setup@v4
name: Install pnpm

- name: setup-node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
cache-dependency-path: 'package-lock.json'
cache: 'pnpm'

- name: install
run: npm ci
run: pnpm install

- name: build
run: npm run build
run: pnpm build
env:
NEXT_PUBLIC_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_PROJECT_ID }}

- name: check
run: npm run ${{ matrix.style-command }}
run: pnpm ${{ matrix.style-command }}
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -75,23 +86,31 @@ jobs:
steps:
- name: checkout
uses: actions/checkout@v3

- uses: pnpm/action-setup@v4
name: Install pnpm

- name: setup-node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
cache-dependency-path: 'package-lock.json'
cache: 'pnpm'

- name: install
run: npm ci
run: pnpm install

- name: build
run: npm run build
run: pnpm build
env:
NEXT_PUBLIC_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_PROJECT_ID }}

- name: Test
run: npm run test
run: pnpm test

- name: Merge Coverage Reports
if: always()
run: npm run coverage:merge
run: pnpm coverage:merge

- name: Report
if: always()
uses: davelosert/vitest-coverage-report-action@v2
Expand Down
4 changes: 4 additions & 0 deletions .github/workflows/publish_canary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,9 @@ jobs:
- name: Checkout
uses: actions/checkout@v4

- uses: pnpm/action-setup@v4
name: Install pnpm

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

Expand All @@ -41,6 +44,7 @@ jobs:
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build, tag, and push image to Amazon ECR
uses: docker/build-push-action@v5
env:
Expand Down
9 changes: 6 additions & 3 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,13 +17,16 @@ jobs:
with:
token: ${{ secrets.CHANGESETS_ACTION_TOKEN }}

- name: Setup Node.js 16
- uses: pnpm/action-setup@v4
name: Install pnpm

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: 16
node-version: 18.x

- name: Install Dependencies
run: npm install
run: pnpm install

- name: Create Release Pull Request
uses: changesets/action@v1
Expand Down
27 changes: 20 additions & 7 deletions .github/workflows/ui_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -57,40 +57,50 @@ jobs:
with:
repository: WalletConnect/web3modal
ref: ${{ inputs.branch }}

- uses: pnpm/action-setup@v4
name: Install pnpm

- name: setup-node
uses: actions/setup-node@v3
with:
node-version: 18.x
cache: 'npm'
cache-dependency-path: 'package-lock.json'
cache: 'pnpm'

- 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
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}-${{ hashFiles('apps/laboratory/tests/shared/constants/devices.ts') }}

- name: install
run: npm ci
run: pnpm install

- name: build packages and lab
run: npm run build:laboratory
run: pnpm build:laboratory
env:
NEXT_PUBLIC_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_PROJECT_ID }}
NEXTAUTH_SECRET: ${{ secrets.TESTS_NEXTAUTH_SECRET }}
MAILSAC_API_KEY: ${{ secrets.TESTS_MAILSEC_API_KEY }}
NEXT_PUBLIC_SECURE_SITE_SDK_URL: ${{ inputs.secure-site-url }}
SOCIAL_TEST_EMAIL: ${{ secrets.TESTS_SOCIAL_EMAIL }}
SOCIAL_TEST_PASSWORD: ${{ secrets.TESTS_SOCIAL_PASSWORD }}

- name: Install Playwright Browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: ./apps/laboratory/
run: npm run playwright:install
run: pnpm playwright:install

- name: Run Playwright tests
env:
BASE_URL: ${{ inputs.base-url }}
Expand All @@ -104,19 +114,22 @@ jobs:
SOCIAL_TEST_PASSWORD: ${{ secrets.TESTS_SOCIAL_PASSWORD }}
CI: true
working-directory: ./apps/laboratory/
run: npm run ${{ inputs.command }}
run: pnpm ${{ inputs.command }}

- name: Run canary with minimal environment config
env:
NEXT_PUBLIC_PROJECT_ID: ${{ secrets.NEXT_PUBLIC_PROJECT_ID }}
CI: true
working-directory: ./apps/laboratory/
run: npm run playwright:test:canary
run: pnpm playwright:test:canary

- uses: actions/upload-artifact@v3
if: always()
with:
name: playwright-report
path: ./apps/laboratory/playwright-report/
retention-days: 7

- uses: actions/upload-artifact@v3
if: always()
with:
Expand Down
1 change: 1 addition & 0 deletions .prettierignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.changeset
coverage
pnpm-lock.yaml
10 changes: 7 additions & 3 deletions Dockerfile.canary
Original file line number Diff line number Diff line change
@@ -1,15 +1,19 @@
FROM node:20-bookworm
ENV PNPM_HOME="/pnpm"
ENV PATH="$PNPM_HOME:$PATH"
RUN corepack enable

RUN apt update && apt install -y awscli

WORKDIR /src

COPY ../ ./
RUN npm ci
RUN npm run build
RUN pnpm install
RUN pnpm build

WORKDIR ./apps/laboratory/

RUN npm run playwright:install
RUN pnpm playwright:install

ENV TIMING_LOGS=true
ENV CI=true
Expand Down
9 changes: 5 additions & 4 deletions apps/demo/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
"version": "5.0.7",
"private": true,
"scripts": {
"dev:demo": "next dev",
"build:demo": "next build",
"start:demo": "next start",
"dev": "next dev",
"build": "next build",
"start": "next start",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"@radix-ui/react-switch": "1.0.3",
"@tanstack/react-query": "5.24.8",
"@web3modal/wagmi": "5.0.7",
"@web3modal/wagmi": "workspace:*",
"clsx": "2.1.0",
"framer-motion": "11.0.8",
"next": "14.2.3",
Expand All @@ -26,6 +26,7 @@
},
"devDependencies": {
"@types/react": "18.2.62",
"@types/react-dom": "18.2.7",
"autoprefixer": "10.4.18",
"eslint": "8.57.0",
"eslint-config-next": "14.1.1",
Expand Down
2 changes: 1 addition & 1 deletion apps/demo/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,6 @@
"react": ["./node_modules/@types/react"]
}
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts", "out/types/**/*.ts"],
"exclude": ["node_modules"]
}
9 changes: 5 additions & 4 deletions apps/gallery/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,15 @@
"private": true,
"main": "index.js",
"scripts": {
"dev:gallery": "storybook dev -p 6006",
"build:gallery": "storybook build -o out",
"dev": "storybook dev -p 6006",
"build": "storybook build -o out",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx"
},
"dependencies": {
"@web3modal/common": "5.0.7",
"@web3modal/ui": "5.0.7",
"@web3modal/common": "workspace:*",
"@web3modal/ui": "workspace:*",
"lit": "3.1.0",
"react": "18.2.0",
"storybook": "7.6.7"
},
"devDependencies": {
Expand Down
2 changes: 1 addition & 1 deletion apps/laboratory/docker-canary.sh
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Not adding `set -e` so that S3 upload happens regardless

npm run playwright:test:canary
pnpm playwright:test:canary

destination="s3://$TEST_RESULTS_BUCKET/web3modal-canary/$(date --iso-8601=seconds)/test-results/"
echo "Uploading test results to $destination"
Expand Down
42 changes: 24 additions & 18 deletions apps/laboratory/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
"version": "5.0.7",
"private": true,
"scripts": {
"dev:laboratory": "next dev",
"start:laboratory": "next start",
"build:laboratory": "next build",
"dev": "next dev",
"start": "next start",
"build": "next build",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"playwright:start": "npm run start:laboratory",
"playwright:start": "pnpm start",
"playwright:install": "playwright install --with-deps",
"playwright:test": "playwright test",
"playwright:test:basic": "playwright test --grep 'basic-tests.spec.ts'",
Expand All @@ -19,16 +19,16 @@
"playwright:test:siwe-sa": "playwright test --grep siwe-sa.spec.ts",
"playwright:test:sa": "playwright test --grep smart-account.spec.ts",
"playwright:test:canary": "playwright test --retries=0 --grep canary.spec.ts --project='Desktop Chrome/wagmi'",
"playwright:debug": "npm run playwright:test -- --debug",
"playwright:debug:basic": "npm run playwright:test:basic -- --debug",
"playwright:debug:wallet": "npm run playwright:test:wallet -- --debug",
"playwright:debug:email": "npm run playwright:test:email -- --debug",
"playwright:debug:social": "npm run playwright:test:social -- --debug",
"playwright:debug:siwe": "npm run playwright:test:siwe -- --debug",
"playwright:debug:siwe-email": "npm run playwright:test:siwe-email -- --debug",
"playwright:debug:siwe-sa": "npm run playwright:test:siwe-sa -- --debug",
"playwright:debug:sa": "npm run playwright:test:sa -- --debug",
"playwright:debug:canary": "npm run playwright:test:canary -- --debug"
"playwright:debug": "pnpm playwright:test -- --debug",
"playwright:debug:basic": "pnpm playwright:test:basic -- --debug",
"playwright:debug:wallet": "pnpm playwright:test:wallet -- --debug",
"playwright:debug:email": "pnpm playwright:test:email -- --debug",
"playwright:debug:social": "pnpm playwright:test:social -- --debug",
"playwright:debug:siwe": "pnpm playwright:test:siwe -- --debug",
"playwright:debug:siwe-email": "pnpm playwright:test:siwe-email -- --debug",
"playwright:debug:siwe-sa": "pnpm playwright:test:siwe-sa -- --debug",
"playwright:debug:sa": "pnpm playwright:test:sa -- --debug",
"playwright:debug:canary": "pnpm playwright:test:canary -- --debug"
},
"dependencies": {
"@chakra-ui/icons": "2.1.1",
Expand All @@ -41,18 +41,22 @@
"@solana/wallet-adapter-wallets": "0.19.32",
"@solana/web3.js": "1.91.7",
"@tanstack/react-query": "5.24.8",
"@wagmi/core": "2.11.6",
"@wagmi/connectors": "5.0.21",
"@walletconnect/ethereum-provider": "2.13.0",
"@walletconnect/utils": "2.13.1",
"@web3modal/ethers": "5.0.7",
"@web3modal/siwe": "5.0.7",
"@web3modal/solana": "5.0.7",
"@web3modal/wagmi": "5.0.7",
"@web3modal/ethers": "workspace:*",
"@web3modal/siwe": "workspace:*",
"@web3modal/solana": "workspace:*",
"@web3modal/wagmi": "workspace:*",
"bs58": "6.0.0",
"ethers": "6.13.0",
"framer-motion": "10.17.9",
"next": "14.2.3",
"next-auth": "4.24.5",
"permissionless": "0.1.31",
"react": "18.2.0",
"react-dom": "18.2.0",
"react-icons": "4.12.0",
"rpc-websockets": "7.11.0",
"valtio": "1.11.2",
Expand All @@ -63,6 +67,8 @@
"@aws-sdk/client-cloudwatch": "3.509.0",
"@mailsac/api": "1.0.5",
"@playwright/test": "1.40.1",
"@types/react": "18.2.62",
"@types/react-dom": "18.2.7",
"dotenv": "16.3.1"
}
}
2 changes: 1 addition & 1 deletion apps/laboratory/playwright.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ export default defineConfig<ModalFixture>({

/* Run your local dev server before starting the tests */
webServer: {
command: 'npm run playwright:start',
command: 'pnpm playwright:start',
url: BASE_URL,
reuseExistingServer: !process.env['CI'] || Boolean(process.env['SKIP_PLAYWRIGHT_WEBSERVER'])
}
Expand Down
Loading

0 comments on commit 83829fe

Please sign in to comment.