Skip to content

Commit 48a0bb2

Browse files
ci(release): publish latest release
1 parent 66754ca commit 48a0bb2

File tree

1,154 files changed

+52393
-16208
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,154 files changed

+52393
-16208
lines changed

Diff for: .depcheckrc

+1
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ ignores: [
33
'@graphql-codegen/*',
44
'@commitlint/*',
55
'i18next',
6+
'moti',
67
# Dependencies that depcheck thinks are missing but are actually present or never used
78
'@yarnpkg/core',
89
'@yarnpkg/cli',

Diff for: README.md

+3-2
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ An open source repository for all Uniswap front end interfaces maintained by Uni
55
## Interfaces
66

77
- Web: [app.uniswap.org](https://app.uniswap.org)
8-
- Wallet: [wallet.uniswap.org](https://wallet.uniswap.org)
8+
- Wallet (mobile + extension): [wallet.uniswap.org](https://wallet.uniswap.org)
99

1010
## Socials / Contact
1111

@@ -31,6 +31,7 @@ For instructions per application or package, see the README published for each a
3131

3232
- [Web](apps/web/README.md)
3333
- [Mobile](apps/mobile/README.md)
34+
- [Extension](apps/extension/README.md)
3435

3536
## Releases
3637

@@ -43,7 +44,7 @@ Translations for our applications are done through [crowdin](https://crowdin.com
4344
| App | Coverage |
4445
| ------- | -------- |
4546
| web | [![Crowdin](https://badges.crowdin.net/uniswap-interface/localized.svg)](https://crowdin.com/project/uniswap-interface) |
46-
| mobile | [![Crowdin](https://badges.crowdin.net/uniswap-wallet/localized.svg)](https://crowdin.com/project/uniswap-wallet) |
47+
| wallet | [![Crowdin](https://badges.crowdin.net/uniswap-wallet/localized.svg)](https://crowdin.com/project/uniswap-wallet) |
4748

4849
## 🗂 Directory Structure
4950

Diff for: RELEASE

+1-10
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,3 @@
1-
We are back with some new new updates! Here’s the latest:
2-
3-
UniswapX is live: We’ve integrated the UniswapX protocol, which aggregates liquidity across onchain and offchain sources for better quotes.
4-
5-
Easy import to Uniswap Extension: Onboard onto our new Chrome extension wallet easily by scanning a QR code with your Uniswap Mobile App.
6-
7-
Transaction Details: Press anything on the Activity Screen and see more robust details about any of your transactions (swaps, sends, NFTs, etc).
8-
9-
Other changes:
10-
111
- Onboarding improvements
2+
- Adds fallback support method for opening the side panel on chrome failure
123
- Various bug fixes and performance improvements

Diff for: VERSION

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
mobile/1.31.1
1+
extension/1.2.1

Diff for: apps/extension/.depcheckrc

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
ignores: [
2+
# Dependencies that depcheck thinks are unused but are actually used
3+
"react-native-web",
4+
"jest-environment-jsdom",
5+
"webpack-cli",
6+
# Dependencies that depcheck thinks are missing but are actually present or never used
7+
## Internal packages / workspaces
8+
"src",
9+
"tsconfig",
10+
# Webpack plugins
11+
"@svgr/webpack",
12+
"tamagui-loader",
13+
"esbuild-loader",
14+
"swc-loader",
15+
## Testing
16+
"@testing-library/dom",
17+
]

Diff for: apps/extension/.eslintignore

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
jest-setup.js

Diff for: apps/extension/.eslintrc.js

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
module.exports = {
2+
root: true,
3+
extends: ['@uniswap/eslint-config/native'],
4+
ignorePatterns: ['node_modules', 'dist', '.turbo', 'build', '.eslintrc.js', 'webpack.config.js', 'webpack.dev.config.js', 'manifest.json'],
5+
parserOptions: {
6+
project: 'tsconfig.json',
7+
tsconfigRootDir: __dirname,
8+
ecmaFeatures: {
9+
jsx: true,
10+
},
11+
ecmaVersion: 2018,
12+
sourceType: 'module',
13+
},
14+
overrides: [
15+
{
16+
files: ['*.ts', '*.tsx'],
17+
rules: {
18+
'no-relative-import-paths/no-relative-import-paths': [
19+
'error',
20+
{
21+
allowSameFolder: false,
22+
},
23+
],
24+
},
25+
},
26+
],
27+
rules: {},
28+
}

Diff for: apps/extension/.gitignore

+30
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
# Logs
2+
logs
3+
*.log
4+
npm-debug.log*
5+
yarn-debug.log*
6+
yarn-error.log*
7+
pnpm-debug.log*
8+
lerna-debug.log*
9+
10+
node_modules
11+
dev
12+
dist
13+
dist-ssr
14+
*.local
15+
16+
# Editor directories and files
17+
.vscode/*
18+
!.vscode/extensions.json
19+
.idea
20+
.DS_Store
21+
*.suo
22+
*.ntvs*
23+
*.njsproj
24+
*.sln
25+
*.sw?
26+
27+
.tamagui
28+
29+
# Sentry Config File
30+
.env.sentry-build-plugin

Diff for: apps/extension/README.md

+53
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# Uniswap Extension
2+
3+
## Developer Quickstart
4+
5+
### Running the extension locally
6+
7+
To run the extension, run the following from the top level of the monorepo:
8+
9+
```bash
10+
yarn
11+
yarn extension start
12+
```
13+
14+
### Environment variables
15+
16+
You need to get the environment variables from 1password in order to get full functionality. Run the command `yarn extension env:local:download` to copy them to your root folder.
17+
18+
### Loading the extension into Chrome
19+
20+
1. Go to **chrome://extensions**
21+
2. At the top right, turn on **Developer mode**
22+
3. Click **Load unpacked**
23+
4. Find and select the extension folder (apps/extension/dev)
24+
25+
## Running the extension locally with an absolute path (for testing scantastic)
26+
27+
Our scantastic API requires a consistent origin header so the build must be loaded from an absolute path. This works because Chrome generates a consistent ID for the extension based on the path it was loaded from.
28+
29+
To run the extension, run the following from the top level of the monorepo:
30+
31+
Mac:
32+
33+
```bash
34+
yarn
35+
yarn extension start:absolute
36+
```
37+
38+
Windows:
39+
40+
```bash
41+
yarn
42+
yarn extension start:absolute:windows
43+
```
44+
45+
1. Go to **chrome://extensions**
46+
2. At the top right, turn on **Developer mode**
47+
3. Click **Load unpacked**
48+
4. Find and select the extension folder with an absolute path (`/Users/Shared/stretch` on Mac and `C:/ProgramData/stretch` on Windows)
49+
5. Your chrome extension url should be `chrome-extension://ceofpnbcmdjbibjjdniemjemmgaibeih` on Mac and `chrome-extension://ffogefanhjekjafbpofianlhkonejcoe` on Windows. The backend allows this origin and the ID will be consistently generated based off an absolute path that is consistent on all machines.
50+
51+
## Migrations
52+
53+
We use `redux-persist` to persist the Redux state between user sessions. Most of this state is shared between the mobile app and the extension. Please review the [Wallet Migrations README](../../packages/wallet/src/state//README.md) for details on how to write migrations when you add or remove anything from the Redux state structure.

Diff for: apps/extension/jest-setup.js

+71
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
import 'utilities/src/logger/mocks'
2+
3+
import { chrome } from 'jest-chrome'
4+
import { AppearanceSettingType } from 'wallet/src/features/appearance/slice'
5+
import { TextEncoder, TextDecoder } from 'util';
6+
7+
process.env.IS_UNISWAP_EXTENSION = true
8+
9+
global.TextEncoder = TextEncoder;
10+
global.TextDecoder = TextDecoder;
11+
12+
const ignoreLogs = {
13+
error: [
14+
// We need to use _persist property to ensure that the state is properly
15+
// rehydrated (https://github.com/Uniswap/universe/pull/7502/files#r1566259088)
16+
'Unexpected key "_persist" found in previous state received by the reducer.'
17+
]
18+
}
19+
20+
// Ignore certain logs that are expected during tests.
21+
Object.entries(ignoreLogs).forEach(([method, messages]) => {
22+
const key = method
23+
const originalMethod = console[key]
24+
console[key] = ((...args) => {
25+
if (messages.some((message) => args.some((arg) => typeof arg === 'string' && arg.startsWith(message)))) {
26+
return
27+
}
28+
originalMethod(...args)
29+
})
30+
})
31+
32+
globalThis.matchMedia =
33+
globalThis.matchMedia ||
34+
((query) => {
35+
const reducedMotion = query.match(/prefers-reduced-motion: ([a-zA-Z0-9-]+)/)
36+
37+
return {
38+
// Needed for reanimated to disable reduced motion warning in tests
39+
matches: reducedMotion ? reducedMotion[1] === 'no-preference' : false,
40+
addListener: jest.fn(),
41+
addEventListener: jest.fn(),
42+
removeEventListener: jest.fn(),
43+
}
44+
})
45+
46+
require('react-native-reanimated').setUpTests()
47+
48+
global.chrome = chrome
49+
50+
jest.mock('src/app/navigation/utils', () => ({
51+
useExtensionNavigation: () => ({
52+
navigateTo: jest.fn(),
53+
navigateBack: jest.fn(),
54+
})
55+
}))
56+
57+
jest.mock('wallet/src/features/focus/useIsFocused', () => {
58+
return jest.fn().mockReturnValue(true)
59+
})
60+
61+
const mockAppearanceSetting = AppearanceSettingType.System
62+
jest.mock('wallet/src/features/appearance/hooks', () => {
63+
return {
64+
useCurrentAppearanceSetting: () => mockAppearanceSetting,
65+
}
66+
})
67+
jest.mock('wallet/src/features/appearance/hooks', () => {
68+
return {
69+
useSelectedColorScheme: () => 'light',
70+
}
71+
})

Diff for: apps/extension/jest.config.js

+58
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
const preset = require('../../config/jest-presets/jest/jest-preset')
2+
3+
const fileExtensions = [
4+
'eot',
5+
'gif',
6+
'jpeg',
7+
'jpg',
8+
'otf',
9+
'png',
10+
'ttf',
11+
'woff',
12+
'woff2',
13+
'mp4',
14+
]
15+
16+
module.exports = {
17+
...preset,
18+
preset: 'jest-expo',
19+
transform: {
20+
'^.+\\.(t|j)sx?$': [
21+
'babel-jest',
22+
{
23+
configFile: './src/test/babel.config.js',
24+
}
25+
],
26+
},
27+
moduleNameMapper: {
28+
...preset.moduleNameMapper,
29+
'^react-native$': 'react-native-web',
30+
},
31+
moduleFileExtensions: [
32+
'web.js',
33+
'web.jsx',
34+
'web.ts',
35+
'web.tsx',
36+
...fileExtensions,
37+
...preset.moduleFileExtensions,
38+
],
39+
resolver: "<rootDir>/src/test/jest-resolver.js",
40+
displayName: 'Extension Wallet',
41+
collectCoverageFrom: [
42+
'src/app/**/*.{js,ts,tsx}',
43+
'src/background/**/*.{js,ts,tsx}',
44+
'src/contentScript/**/*.{js,ts,tsx}',
45+
'!src/**/*.stories.**',
46+
'!**/node_modules/**',
47+
],
48+
coverageThreshold: {
49+
global: {
50+
lines: 0,
51+
},
52+
},
53+
setupFiles: [
54+
'../../config/jest-presets/jest/setup.js',
55+
'./jest-setup.js',
56+
'../../node_modules/react-native-gesture-handler/jestSetup.js',
57+
],
58+
}

0 commit comments

Comments
 (0)