-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
66754ca
commit 48a0bb2
Showing
1,154 changed files
with
52,393 additions
and
16,208 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,3 @@ | ||
We are back with some new new updates! Here’s the latest: | ||
|
||
UniswapX is live: We’ve integrated the UniswapX protocol, which aggregates liquidity across onchain and offchain sources for better quotes. | ||
|
||
Easy import to Uniswap Extension: Onboard onto our new Chrome extension wallet easily by scanning a QR code with your Uniswap Mobile App. | ||
|
||
Transaction Details: Press anything on the Activity Screen and see more robust details about any of your transactions (swaps, sends, NFTs, etc). | ||
|
||
Other changes: | ||
|
||
- Onboarding improvements | ||
- Adds fallback support method for opening the side panel on chrome failure | ||
- Various bug fixes and performance improvements |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
mobile/1.31.1 | ||
extension/1.2.1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
ignores: [ | ||
# Dependencies that depcheck thinks are unused but are actually used | ||
"react-native-web", | ||
"jest-environment-jsdom", | ||
"webpack-cli", | ||
# Dependencies that depcheck thinks are missing but are actually present or never used | ||
## Internal packages / workspaces | ||
"src", | ||
"tsconfig", | ||
# Webpack plugins | ||
"@svgr/webpack", | ||
"tamagui-loader", | ||
"esbuild-loader", | ||
"swc-loader", | ||
## Testing | ||
"@testing-library/dom", | ||
] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
jest-setup.js |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
module.exports = { | ||
root: true, | ||
extends: ['@uniswap/eslint-config/native'], | ||
ignorePatterns: ['node_modules', 'dist', '.turbo', 'build', '.eslintrc.js', 'webpack.config.js', 'webpack.dev.config.js', 'manifest.json'], | ||
parserOptions: { | ||
project: 'tsconfig.json', | ||
tsconfigRootDir: __dirname, | ||
ecmaFeatures: { | ||
jsx: true, | ||
}, | ||
ecmaVersion: 2018, | ||
sourceType: 'module', | ||
}, | ||
overrides: [ | ||
{ | ||
files: ['*.ts', '*.tsx'], | ||
rules: { | ||
'no-relative-import-paths/no-relative-import-paths': [ | ||
'error', | ||
{ | ||
allowSameFolder: false, | ||
}, | ||
], | ||
}, | ||
}, | ||
], | ||
rules: {}, | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Logs | ||
logs | ||
*.log | ||
npm-debug.log* | ||
yarn-debug.log* | ||
yarn-error.log* | ||
pnpm-debug.log* | ||
lerna-debug.log* | ||
|
||
node_modules | ||
dev | ||
dist | ||
dist-ssr | ||
*.local | ||
|
||
# Editor directories and files | ||
.vscode/* | ||
!.vscode/extensions.json | ||
.idea | ||
.DS_Store | ||
*.suo | ||
*.ntvs* | ||
*.njsproj | ||
*.sln | ||
*.sw? | ||
|
||
.tamagui | ||
|
||
# Sentry Config File | ||
.env.sentry-build-plugin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Uniswap Extension | ||
|
||
## Developer Quickstart | ||
|
||
### Running the extension locally | ||
|
||
To run the extension, run the following from the top level of the monorepo: | ||
|
||
```bash | ||
yarn | ||
yarn extension start | ||
``` | ||
|
||
### Environment variables | ||
|
||
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. | ||
|
||
### Loading the extension into Chrome | ||
|
||
1. Go to **chrome://extensions** | ||
2. At the top right, turn on **Developer mode** | ||
3. Click **Load unpacked** | ||
4. Find and select the extension folder (apps/extension/dev) | ||
|
||
## Running the extension locally with an absolute path (for testing scantastic) | ||
|
||
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. | ||
|
||
To run the extension, run the following from the top level of the monorepo: | ||
|
||
Mac: | ||
|
||
```bash | ||
yarn | ||
yarn extension start:absolute | ||
``` | ||
|
||
Windows: | ||
|
||
```bash | ||
yarn | ||
yarn extension start:absolute:windows | ||
``` | ||
|
||
1. Go to **chrome://extensions** | ||
2. At the top right, turn on **Developer mode** | ||
3. Click **Load unpacked** | ||
4. Find and select the extension folder with an absolute path (`/Users/Shared/stretch` on Mac and `C:/ProgramData/stretch` on Windows) | ||
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. | ||
|
||
## Migrations | ||
|
||
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import 'utilities/src/logger/mocks' | ||
|
||
import { chrome } from 'jest-chrome' | ||
import { AppearanceSettingType } from 'wallet/src/features/appearance/slice' | ||
import { TextEncoder, TextDecoder } from 'util'; | ||
|
||
process.env.IS_UNISWAP_EXTENSION = true | ||
|
||
global.TextEncoder = TextEncoder; | ||
global.TextDecoder = TextDecoder; | ||
|
||
const ignoreLogs = { | ||
error: [ | ||
// We need to use _persist property to ensure that the state is properly | ||
// rehydrated (https://github.com/Uniswap/universe/pull/7502/files#r1566259088) | ||
'Unexpected key "_persist" found in previous state received by the reducer.' | ||
] | ||
} | ||
|
||
// Ignore certain logs that are expected during tests. | ||
Object.entries(ignoreLogs).forEach(([method, messages]) => { | ||
const key = method | ||
const originalMethod = console[key] | ||
console[key] = ((...args) => { | ||
if (messages.some((message) => args.some((arg) => typeof arg === 'string' && arg.startsWith(message)))) { | ||
return | ||
} | ||
originalMethod(...args) | ||
}) | ||
}) | ||
|
||
globalThis.matchMedia = | ||
globalThis.matchMedia || | ||
((query) => { | ||
const reducedMotion = query.match(/prefers-reduced-motion: ([a-zA-Z0-9-]+)/) | ||
|
||
return { | ||
// Needed for reanimated to disable reduced motion warning in tests | ||
matches: reducedMotion ? reducedMotion[1] === 'no-preference' : false, | ||
addListener: jest.fn(), | ||
addEventListener: jest.fn(), | ||
removeEventListener: jest.fn(), | ||
} | ||
}) | ||
|
||
require('react-native-reanimated').setUpTests() | ||
|
||
global.chrome = chrome | ||
|
||
jest.mock('src/app/navigation/utils', () => ({ | ||
useExtensionNavigation: () => ({ | ||
navigateTo: jest.fn(), | ||
navigateBack: jest.fn(), | ||
}) | ||
})) | ||
|
||
jest.mock('wallet/src/features/focus/useIsFocused', () => { | ||
return jest.fn().mockReturnValue(true) | ||
}) | ||
|
||
const mockAppearanceSetting = AppearanceSettingType.System | ||
jest.mock('wallet/src/features/appearance/hooks', () => { | ||
return { | ||
useCurrentAppearanceSetting: () => mockAppearanceSetting, | ||
} | ||
}) | ||
jest.mock('wallet/src/features/appearance/hooks', () => { | ||
return { | ||
useSelectedColorScheme: () => 'light', | ||
} | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
const preset = require('../../config/jest-presets/jest/jest-preset') | ||
|
||
const fileExtensions = [ | ||
'eot', | ||
'gif', | ||
'jpeg', | ||
'jpg', | ||
'otf', | ||
'png', | ||
'ttf', | ||
'woff', | ||
'woff2', | ||
'mp4', | ||
] | ||
|
||
module.exports = { | ||
...preset, | ||
preset: 'jest-expo', | ||
transform: { | ||
'^.+\\.(t|j)sx?$': [ | ||
'babel-jest', | ||
{ | ||
configFile: './src/test/babel.config.js', | ||
} | ||
], | ||
}, | ||
moduleNameMapper: { | ||
...preset.moduleNameMapper, | ||
'^react-native$': 'react-native-web', | ||
}, | ||
moduleFileExtensions: [ | ||
'web.js', | ||
'web.jsx', | ||
'web.ts', | ||
'web.tsx', | ||
...fileExtensions, | ||
...preset.moduleFileExtensions, | ||
], | ||
resolver: "<rootDir>/src/test/jest-resolver.js", | ||
displayName: 'Extension Wallet', | ||
collectCoverageFrom: [ | ||
'src/app/**/*.{js,ts,tsx}', | ||
'src/background/**/*.{js,ts,tsx}', | ||
'src/contentScript/**/*.{js,ts,tsx}', | ||
'!src/**/*.stories.**', | ||
'!**/node_modules/**', | ||
], | ||
coverageThreshold: { | ||
global: { | ||
lines: 0, | ||
}, | ||
}, | ||
setupFiles: [ | ||
'../../config/jest-presets/jest/setup.js', | ||
'./jest-setup.js', | ||
'../../node_modules/react-native-gesture-handler/jestSetup.js', | ||
], | ||
} |
Oops, something went wrong.