Skip to content

Commit

Permalink
chore: add @reown/appkit-scaffold-ui-new, @apps/laboratory-new an…
Browse files Browse the repository at this point in the history
…d `@reown/appkit-new` (#3326)
  • Loading branch information
magiziz authored Nov 25, 2024
1 parent 77c9969 commit c2e0428
Show file tree
Hide file tree
Showing 474 changed files with 39,113 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .changeset/config.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@
"access": "public",
"baseBranch": "main",
"updateInternalDependencies": "patch",
"ignore": ["@examples/*", "@apps/gallery-new", "@apps/laboratory", "@reown/appkit-ui-new", "@reown/appkit-adapter-bitcoin"]
"ignore": ["@examples/*", "@apps/gallery-new", "@apps/laboratory", "@apps/laboratory-new", "@reown/appkit-new", "@reown/appkit-scaffold-ui-new", "@reown/appkit-ui-new", "@reown/appkit-adapter-bitcoin"]
}
17 changes: 17 additions & 0 deletions apps/laboratory-new/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# Obtain a project ID from https://cloud.walletconnect.com
NEXT_PUBLIC_PROJECT_ID=""
# See 1password for `NEXT_AUTH_SECRET`
NEXTAUTH_SECRET=""
# See 1password for `Mailsac AppKit API Key`
MAILSAC_API_KEY=""
# Only needed when overriding default next-auth URL
# NEXTAUTH_URL=""
NEXT_PUBLIC_SECURE_SITE_SDK_URL=""
SOCIAL_TEST_EMAIL=""
SOCIAL_TEST_PASSWORD=""
NEXT_PUBLIC_DEFAULT_LOG_LEVEL=""
NEXT_PUBLIC_PIMLICO_KEY=""
# local env setup guide https://docs.pimlico.io/permissionless/how-to/local-testing"
NEXT_PUBLIC_LOCAL_BUNDLER_URL=
NEXT_PUBLIC_LOCAL_PAYMASTER_URL=
NEXT_PUBLIC_LOCAL_CLIENT_URL=
3 changes: 3 additions & 0 deletions apps/laboratory-new/.eslintrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"extends": ["../../.eslintrc.json"]
}
743 changes: 743 additions & 0 deletions apps/laboratory-new/CHANGELOG.md

Large diffs are not rendered by default.

7 changes: 7 additions & 0 deletions apps/laboratory-new/docker-canary.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Not adding `set -e` so that S3 upload happens regardless

pnpm playwright:test:canary

destination="s3://$TEST_RESULTS_BUCKET/web3modal-canary/$(date --iso-8601=seconds)/test-results/"
echo "Uploading test results to $destination"
aws s3 cp ./test-results/ $destination --recursive
5 changes: 5 additions & 0 deletions apps/laboratory-new/next-env.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
/// <reference types="next" />
/// <reference types="next/image-types/global" />

// NOTE: This file should not be edited
// see https://nextjs.org/docs/basic-features/typescript for more information.
78 changes: 78 additions & 0 deletions apps/laboratory-new/next.config.mjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
/** @type {import('next').NextConfig} */
const SHAKRA_UI = `'sha256-e7MRMmTzLsLQvIy1iizO1lXf7VWYoQ6ysj5fuUzvRwE='`
/*
* Keep in-sync with https://docs.reown.com/advanced/security/content-security-policy
* DO NOT use `unsafe-inline` or `unsafe-eval` for `script-src` or `default-src` in production as this
* is against CSP best practices
*/
const secureSiteDomain = process.env.NEXT_PUBLIC_SECURE_SITE_SDK_URL
? new URL(process.env.NEXT_PUBLIC_SECURE_SITE_SDK_URL).origin
: ''
const verifyApiNestedIframesTestOuterDomain =
'https://verify-api-nested-iframes-test-outer-domain.com'
const cspHeader = `
default-src 'self';
script-src 'self' ${SHAKRA_UI} ${process.env.NODE_ENV === 'production' ? '' : "'unsafe-eval'"};
style-src 'self' 'unsafe-inline' https://fonts.googleapis.com;
img-src * 'self' data: blob: https://walletconnect.org https://walletconnect.com https://secure.walletconnect.com https://secure.walletconnect.org https://tokens-data.1inch.io https://tokens.1inch.io https://ipfs.io https://appkit-lab.reown.org;
font-src 'self' https://fonts.gstatic.com;
connect-src 'self' https://react-wallet.walletconnect.com https://rpc.walletconnect.com https://rpc.walletconnect.org https://relay.walletconnect.com https://relay.walletconnect.org wss://relay.walletconnect.com wss://relay.walletconnect.org https://pulse.walletconnect.com https://pulse.walletconnect.org https://api.web3modal.com https://api.web3modal.org wss://www.walletlink.org https://o1095249.ingest.sentry.io https://quote-api.jup.ag;
frame-src 'self' https://verify.walletconnect.com https://verify.walletconnect.org https://secure.walletconnect.com https://secure.walletconnect.org https://secure.reown.com https://widget.solflare.com/ ${secureSiteDomain};
object-src 'none';
base-uri 'self';
form-action 'self';
frame-ancestors ${verifyApiNestedIframesTestOuterDomain};
report-uri https://o1095249.ingest.sentry.io/api/4505685639364608/security/?sentry_key=36ff1e79c60877fce6c0273e94a8ed69;
report-to csp-endpoint
`

// Reference: https://docs.sentry.io/security-legal-pii/security/security-policy-reporting/#content-security-policy
const cspReportToHeader = {
group: 'csp-endpoint',
max_age: 10886400,
endpoints: [
{
url: 'https://o1095249.ingest.sentry.io/api/4505685639364608/security/?sentry_key=36ff1e79c60877fce6c0273e94a8ed69'
}
],
include_subdomains: true
}

const nextConfig = {
reactStrictMode: true,
trailingSlash: true,
distDir: 'out',
cleanDistDir: true,
webpack: config => {
config.externals.push('pino-pretty', 'lokijs', 'encoding')

return config
},
async headers() {
return [
{
source: '/:path*',
headers: [
{
key: 'Content-Security-Policy',
value: cspHeader.replace(/\n/g, ' ').trim()
},
{
key: 'Report-To',
value: JSON.stringify(cspReportToHeader)
}
]
},
{
source: '/.well-known/apple-app-site-association',
headers: [{ key: 'content-type', value: 'application/json' }]
},
{
source: '/.well-known/assetlinks.json',
headers: [{ key: 'content-type', value: 'application/json' }]
}
]
}
}

export default nextConfig
124 changes: 124 additions & 0 deletions apps/laboratory-new/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,124 @@
{
"name": "@apps/laboratory-new",
"type": "module",
"version": "1.5.1",
"private": true,
"scripts": {
"dev": "next dev",
"start": "next start",
"build": "next build",
"lint": "eslint . --ext .js,.jsx,.ts,.tsx",
"playwright:start": "pnpm start",
"playwright:install": "playwright install --with-deps",
"synpress": "synpress ./tests/wallet-setup",
"playwright:test": "playwright test",
"playwright:test:metamask": "playwright test --grep 'metamask.spec.ts'",
"playwright:test:mobile-wallet-features": "playwright test --grep 'mobile-wallet-features.spec.ts'",
"playwright:test:basic": "playwright test --grep 'basic-tests.spec.ts'",
"playwright:test:wallet": "playwright test --grep 'wallet.spec.ts'",
"playwright:test:no-email": "playwright test --grep 'no-email.spec.ts'",
"playwright:test:no-socials": "playwright test --grep 'no-socials.spec.ts'",
"playwright:test:debug-mode": "playwright test --grep 'debug-mode.spec.ts'",
"playwright:test:email": "playwright test --grep 'email.spec.ts'",
"playwright:test:siwe": "playwright test --grep siwe.spec.ts",
"playwright:test:siwe-email": "playwright test --grep siwe-email.spec.ts",
"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:test:wallet-features": "playwright test --grep wallet-features.spec.ts",
"playwright:test:verify": "playwright test --grep verify.spec.ts",
"playwright:test:multichain-basic": "playwright test --grep multichain-basic.spec.ts",
"playwright:test:multichain-wagmi": "playwright test --grep multichain-wagmi-solana.spec.ts",
"playwright:test:multichain-wagmi-auth": "playwright test --grep multichain-wagmi-solana-email.spec.ts",
"playwright:test:multichain-wagmi-auth-siwe": "playwright test --grep multichain-wagmi-solana-email-siwe.spec.ts",
"playwright:test:multichain-wagmi-siwe": "playwright test --grep multichain-wagmi-solana-siwe.spec.ts",
"playwright:test:multichain-ethers": "playwright test --grep multichain-ethers-solana.spec.ts",
"playwright:test:multichain-ethers-auth": "playwright test --grep multichain-ethers-solana-email.spec.ts",
"playwright:test:multichain-ethers-auth-siwe": "playwright test --grep multichain-ethers-solana-email-siwe.spec.ts",
"playwright:test:multichain-ethers-siwe": "playwright test --grep multichain-ethers-solana-siwe.spec.ts",
"playwright:test:multichain-ethers5": "playwright test --grep multichain-ethers5-solana.spec.ts",
"playwright:test:multichain-ethers5-auth": "playwright test --grep multichain-ethers5-solana-email.spec.ts",
"playwright:test:multichain-ethers5-auth-siwe": "playwright test --grep multichain-ethers5-solana-email-siwe.spec.ts",
"playwright:test:multichain-ethers5-siwe": "playwright test --grep multichain-ethers5-solana-siwe.spec.ts",
"playwright:debug": "pnpm playwright:test --debug",
"playwright:debug:metamask": "pnpm playwright:test:metamask --debug",
"playwright:debug:mobile-wallet-features": "pnpm playwright:test:mobile-wallet-features --debug",
"playwright:debug:basic": "pnpm playwright:test:basic --debug",
"playwright:debug:wallet": "pnpm playwright:test:wallet --debug",
"playwright:debug:no-email": "pnpm playwright:test:no-email --debug",
"playwright:debug:no-socials": "pnpm playwright:test:no-socials --debug",
"playwright:debug:debug-mode": "pnpm playwright:test:debug-mode --debug",
"playwright:debug:email": "pnpm playwright:test:email --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",
"playwright:debug:wallet-features": "pnpm playwright:test:wallet-features --debug",
"playwright:debug:verify": "pnpm playwright:test:verify --debug",
"playwright:debug:multichain-basic": "pnpm playwright:test:multichain-basic --debug",
"playwright:debug:multichain-wagmi": "pnpm playwright:test:multichain-wagmi --debug",
"playwright:debug:multichain-wagmi-auth": "pnpm playwright:test:multichain-wagmi-auth --debug",
"playwright:debug:multichain-wagmi-auth-siwe": "pnpm playwright:test:multichain-wagmi-auth-siwe --debug",
"playwright:debug:multichain-wagmi-siwe": "pnpm playwright:test:multichain-wagmi-siwe --debug",
"playwright:debug:multichain-ethers": "pnpm playwright:test:multichain-ethers --debug",
"playwright:debug:multichain-ethers-auth": "pnpm playwright:test:multichain-ethers-auth --debug",
"playwright:debug:multichain-ethers-auth-siwe": "pnpm playwright:test:multichain-ethers-auth-siwe --debug",
"playwright:debug:multichain-ethers-siwe": "pnpm playwright:test:multichain-ethers-siwe --debug",
"playwright:debug:multichain-ethers5": "pnpm playwright:test:multichain-ethers5 --debug",
"playwright:debug:multichain-ethers5-auth": "pnpm playwright:test:multichain-ethers5-auth --debug",
"playwright:debug:multichain-ethers5-auth-siwe": "pnpm playwright:test:multichain-ethers5-auth-siwe --debug",
"playwright:debug:multichain-ethers5-siwe": "pnpm playwright:test:multichain-ethers5-siwe --debug"
},
"dependencies": {
"@chakra-ui/icons": "2.1.1",
"@chakra-ui/react": "2.8.2",
"@emotion/react": "11.11.3",
"@emotion/styled": "11.11.0",
"@reown/appkit-new": "workspace:*",
"@reown/appkit-adapter-ethers": "workspace:*",
"@reown/appkit-adapter-ethers5": "workspace:*",
"@reown/appkit-adapter-solana": "workspace:*",
"@reown/appkit-adapter-wagmi": "workspace:*",
"@reown/appkit-adapter-bitcoin": "workspace:*",
"@reown/appkit-experimental": "workspace:*",
"@reown/appkit-siwe": "workspace:*",
"@reown/appkit-siwx": "workspace:*",
"@reown/appkit-wallet": "workspace:*",
"@sentry/browser": "7.119.1",
"@sentry/react": "7.92.0",
"@solana/wallet-adapter-wallets": "0.19.32",
"@solana/web3.js": "1.95.3",
"@tanstack/react-query": "5.24.8",
"@wagmi/connectors": "5.1.15",
"@wagmi/core": "2.13.8",
"@walletconnect/universal-provider": "2.17.0",
"@walletconnect/utils": "2.17.0",
"axios": "1.7.2",
"bs58": "6.0.0",
"date-fns": "4.1.0",
"ethers": "6.13.2",
"ethers5": "npm:ethers@5.7.2",
"framer-motion": "10.17.9",
"next": "14.2.3",
"next-auth": "4.24.5",
"react": "18.3.1",
"react-dom": "18.3.1",
"react-icons": "4.12.0",
"rpc-websockets": "7.11.0",
"valtio": "1.11.2",
"viem": "2.21.26",
"wagmi": "2.12.17",
"webauthn-p256": "0.0.2"
},
"devDependencies": {
"@aws-sdk/client-cloudwatch": "3.509.0",
"@mailsac/api": "1.0.5",
"@playwright/test": "1.44.0",
"@synthetixio/synpress": "4.0.0-alpha.7",
"@types/node": "20.11.5",
"@types/react": "18.2.62",
"@types/react-dom": "18.2.7",
"dotenv": "16.3.1"
}
}
48 changes: 48 additions & 0 deletions apps/laboratory-new/playwright.config.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import { defineConfig } from '@playwright/test'
import { BASE_URL } from './tests/shared/constants'

import { config } from 'dotenv'
import type { ModalFixture } from './tests/shared/fixtures/w3m-fixture'
import { getProjects } from './tests/shared/utils/project'
import { getValue } from './tests/shared/utils/config'
config({ path: './.env.local' })

export default defineConfig<ModalFixture>({
testDir: './tests',
fullyParallel: true,
retries: 1,
workers: getValue(8, 4),
reporter: getValue(
[['list'], ['html', { host: '0.0.0.0' }]],
[['list'], ['html', { host: '0.0.0.0' }]]
),
// Limits the number of failed tests in the whole test suite. Playwright Test will stop after reaching this number of failed tests and skip any tests that were not executed yet
maxFailures: getValue(10, undefined),
expect: {
timeout: getValue(60, 15) * 1000
},
timeout: 90 * 1000,

use: {
/* Base URL to use in actions like `await page.goto('/')`. */
baseURL: BASE_URL,

/* Take a screenshot when the test fails */
screenshot: 'only-on-failure',

/* Collect trace regardless so we can debug latency regressions. See https://playwright.dev/docs/trace-viewer */
trace: 'on',

video: 'retain-on-failure'
},

/* Configure projects for major browsers */
projects: getProjects(),

/* Run your local dev server before starting the tests */
webServer: {
command: 'pnpm playwright:start',
url: BASE_URL,
reuseExistingServer: !process.env['CI'] || Boolean(process.env['SKIP_PLAYWRIGHT_WEBSERVER'])
}
})
85 changes: 85 additions & 0 deletions apps/laboratory-new/public/.well-known/apple-app-site-association
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"applinks": {
"apps": [],
"details": [
{
"appID": "W5R8AG9K22.com.walletconnect.dapp",
"paths": [
"/dapp*"
]
},
{
"appID": "W5R8AG9K22.com.walletconnect.walletapp",
"paths": [
"/wallet*"
]
},
{
"appID": "W5R8AG9K22.com.walletconnect.web3modal.sample",
"paths": [
"/web3modal_example*"
]
},
{
"appID": "W5R8AG9K22.com.walletconnect.web3modal.rnsample.internal",
"paths": [
"/rn_appkit_internal/*"
]
},
{
"appID": "W5R8AG9K22.com.walletconnect.web3modal.rnsample",
"paths": [
"/rn_appkit/*"
]
},
{
"appID": "W5R8AG9K22.com.walletconnect.web3wallet.rnsample.internal",
"paths": [
"/rn_walletkit_internal/*"
]
},
{
"appID": "W5R8AG9K22.com.walletconnect.web3wallet.rnsample",
"paths": [
"/rn_walletkit/*"
]
},
{
"appID": "W5R8AG9K22.com.walletconnect.flutterwallet",
"paths": [
"/flutter_walletkit"
]
},
{
"appID": "W5R8AG9K22.com.walletconnect.flutterwallet.internal",
"paths": [
"/flutter_walletkit_internal"
]
},
{
"appID": "W5R8AG9K22.com.walletconnect.flutterdapp",
"paths": [
"/flutter_appkit"
]
},
{
"appID": "W5R8AG9K22.com.walletconnect.flutterdapp.internal",
"paths": [
"/flutter_appkit_internal"
]
},
{
"appID": "W5R8AG9K22.com.web3modal.flutterExample",
"paths": [
"/flutter_appkit_modal"
]
},
{
"appID": "W5R8AG9K22.com.web3modal.flutterExample.internal",
"paths": [
"/flutter_appkit_modal_internal"
]
}
]
}
}
Loading

0 comments on commit c2e0428

Please sign in to comment.