Skip to content

Commit

Permalink
ci(release): publish latest release
Browse files Browse the repository at this point in the history
  • Loading branch information
hello-happy-puppy committed Aug 5, 2024
1 parent 66754ca commit 48a0bb2
Show file tree
Hide file tree
Showing 1,154 changed files with 52,393 additions and 16,208 deletions.
1 change: 1 addition & 0 deletions .depcheckrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ ignores: [
'@graphql-codegen/*',
'@commitlint/*',
'i18next',
'moti',
# Dependencies that depcheck thinks are missing but are actually present or never used
'@yarnpkg/core',
'@yarnpkg/cli',
Expand Down
5 changes: 3 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ An open source repository for all Uniswap front end interfaces maintained by Uni
## Interfaces

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

## Socials / Contact

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

- [Web](apps/web/README.md)
- [Mobile](apps/mobile/README.md)
- [Extension](apps/extension/README.md)

## Releases

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

## 🗂 Directory Structure

Expand Down
11 changes: 1 addition & 10 deletions RELEASE
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
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
mobile/1.31.1
extension/1.2.1
17 changes: 17 additions & 0 deletions apps/extension/.depcheckrc
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",
]
1 change: 1 addition & 0 deletions apps/extension/.eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
jest-setup.js
28 changes: 28 additions & 0 deletions apps/extension/.eslintrc.js
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: {},
}
30 changes: 30 additions & 0 deletions apps/extension/.gitignore
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
53 changes: 53 additions & 0 deletions apps/extension/README.md
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.
71 changes: 71 additions & 0 deletions apps/extension/jest-setup.js
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',
}
})
58 changes: 58 additions & 0 deletions apps/extension/jest.config.js
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',
],
}
Loading

0 comments on commit 48a0bb2

Please sign in to comment.