Skip to content

Commit 372c306

Browse files
committed
Merge branch 'main' into test/temp-nightly
2 parents 3204c91 + 0d6ecb7 commit 372c306

462 files changed

Lines changed: 7023 additions & 2636 deletions

File tree

Some content is hidden

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

.cursor/rules/deeplink-handler-guidelines.mdc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ This guide walks you through adding new deeplink handlers to MetaMask Mobile. Fo
1212

1313
## Quick Reference
1414

15+
The **`deposit` deeplink** (`metamask://deposit`, `/deposit`) is **deprecated** and not handled; do not add handlers under Ramp Deposit `deeplink/` for it.
16+
1517
| File | Purpose |
1618
|------|---------|
1719
| `app/constants/deeplinks.ts` | Define action constants |

.depcheckrc.yml

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,13 @@ ignores:
4747
- '@metamask/perps-controller'
4848
# Used in scripts/repack for CI optimization
4949
- '@expo/repack-app'
50+
51+
# ESLint plugins, resolvers, parsers, configuration, etc.
52+
- 'eslint-config-prettier'
53+
- 'eslint-import-resolver-typescript'
54+
- 'eslint-plugin-prettier'
55+
- 'eslint-plugin-react-native'
56+
5057
# Note: Everything below this line should be removed after investigation
5158
# TODO: Investigate each dependency to see whether it's used
5259

@@ -63,9 +70,6 @@ ignores:
6370
- 'babel-core'
6471
- 'babel-loader'
6572
- 'chromedriver'
66-
- 'eslint-config-prettier'
67-
- 'eslint-plugin-prettier'
68-
- 'eslint-plugin-react-native'
6973
- 'execa'
7074
- 'jetifier'
7175
- 'metro-react-native-babel-preset'

.eslintrc.js

Lines changed: 92 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
/* eslint-disable import/no-commonjs */
1+
/* eslint-disable import-x/no-commonjs */
22
module.exports = {
33
root: true,
44
parser: '@typescript-eslint/parser',
@@ -9,7 +9,7 @@ module.exports = {
99
'@react-native',
1010
'eslint:recommended',
1111
// '@metamask/eslint-config', // TODO: Enable when ready
12-
'plugin:import/warnings',
12+
'plugin:import-x/warnings',
1313
'plugin:react/recommended',
1414
],
1515
// ESLint can find the plugin without the `eslint-plugin-` prefix. Ex. `eslint-plugin-react-compiler` -> `react-compiler`
@@ -51,6 +51,65 @@ module.exports = {
5151
allow: ['Text'],
5252
},
5353
],
54+
55+
// These rule modifications are removing changes to our shared ESLint config made after
56+
// version v9. This is a temporary measure to get us to ESLint v9 compatible versions,
57+
// at which point we can restore the intended rules and use error suppression instead.
58+
//
59+
// TODO: Remove these modifications after the ESLint v9 update
60+
'@typescript-eslint/await-thenable': 'off',
61+
'@typescript-eslint/consistent-type-imports': 'off',
62+
'@typescript-eslint/consistent-type-exports': 'off',
63+
'@typescript-eslint/explicit-function-return-type': 'off',
64+
'@typescript-eslint/naming-convention': 'off',
65+
'@typescript-eslint/no-base-to-string': 'off',
66+
'@typescript-eslint/no-duplicate-type-constituents': 'off',
67+
'@typescript-eslint/no-empty-object-type': 'off',
68+
'@typescript-eslint/no-floating-promises': 'off',
69+
'@typescript-eslint/no-implied-eval': 'off',
70+
'@typescript-eslint/no-misused-promises': 'off',
71+
'@typescript-eslint/no-redundant-type-constituents': 'off',
72+
'@typescript-eslint/no-throw-literal': 'off',
73+
'@typescript-eslint/no-unnecessary-type-assertion': 'off',
74+
'@typescript-eslint/no-unnecessary-type-arguments': 'off',
75+
'@typescript-eslint/no-unsafe-enum-comparison': 'off',
76+
'@typescript-eslint/no-unnecessary-boolean-literal-compare': 'off',
77+
'@typescript-eslint/no-unused-vars': 'off',
78+
'@typescript-eslint/no-wrapper-object-types': 'off',
79+
'@typescript-eslint/only-throw-error': 'off',
80+
'@typescript-eslint/prefer-enum-initializers': 'off',
81+
'@typescript-eslint/prefer-includes': 'off',
82+
'@typescript-eslint/prefer-nullish-coalescing': 'off',
83+
'@typescript-eslint/prefer-optional-chain': 'off',
84+
'@typescript-eslint/prefer-promise-reject-errors': 'off',
85+
'@typescript-eslint/prefer-readonly': 'off',
86+
'@typescript-eslint/prefer-reduce-type-parameter': 'off',
87+
'@typescript-eslint/prefer-string-starts-ends-with': 'off',
88+
'@typescript-eslint/promise-function-async': 'off',
89+
'@typescript-eslint/restrict-plus-operands': 'off',
90+
'@typescript-eslint/restrict-template-expressions': 'off',
91+
'@typescript-eslint/switch-exhaustiveness-check': 'off',
92+
'@typescript-eslint/unbound-method': 'off',
93+
'no-restricted-syntax': [
94+
'error',
95+
{
96+
selector: 'WithStatement',
97+
message: 'With statements are not allowed',
98+
},
99+
{
100+
selector: 'SequenceExpression',
101+
message: 'Sequence expressions are not allowed',
102+
},
103+
// {
104+
// selector: "BinaryExpression[operator='in']",
105+
// message: 'The "in" operator is not allowed',
106+
// },
107+
// {
108+
// selector:
109+
// "PropertyDefinition[accessibility='private'], MethodDefinition[accessibility='private'], TSParameterProperty[accessibility='private']",
110+
// message: 'Use a hash name instead.',
111+
// },
112+
],
54113
},
55114
},
56115
{
@@ -86,8 +145,8 @@ module.exports = {
86145
},
87146
rules: {
88147
'no-console': 'off',
89-
'import/no-commonjs': 'off',
90-
'import/no-nodejs-modules': 'off',
148+
'import-x/no-commonjs': 'off',
149+
'import-x/no-nodejs-modules': 'off',
91150
},
92151
},
93152
{
@@ -98,8 +157,8 @@ module.exports = {
98157
],
99158
rules: {
100159
'no-console': 'off',
101-
'import/no-commonjs': 'off',
102-
'import/no-nodejs-modules': 'off',
160+
'import-x/no-commonjs': 'off',
161+
'import-x/no-nodejs-modules': 'off',
103162
},
104163
},
105164
{
@@ -361,10 +420,13 @@ module.exports = {
361420
'@typescript-eslint/no-floating-promises': 'error',
362421
'@typescript-eslint/restrict-template-expressions': 'error',
363422

364-
// === Import rules (using 'import' plugin, not 'import-x') ===
365-
'import/consistent-type-specifier-style': ['error', 'prefer-top-level'],
366-
'import/no-named-as-default': 'error',
367-
'import/order': [
423+
// === Import rules ===
424+
'import-x/consistent-type-specifier-style': [
425+
'error',
426+
'prefer-top-level',
427+
],
428+
'import-x/no-named-as-default': 'error',
429+
'import-x/order': [
368430
'error',
369431
{
370432
groups: [
@@ -441,10 +503,10 @@ module.exports = {
441503
},
442504

443505
settings: {
444-
'import/resolver': {
506+
'import-x/resolver': {
445507
typescript: {}, // this loads <rootdir>/tsconfig.json to eslint
446508
},
447-
'import/internal-regex': '^@metamask/perps-controller',
509+
'import-x/internal-regex': '^@metamask/perps-controller',
448510
},
449511

450512
rules: {
@@ -466,7 +528,7 @@ module.exports = {
466528
'no-bitwise': 'off',
467529
'class-methods-use-this': 'off',
468530
'eol-last': 'warn',
469-
'import/no-named-as-default': 'off',
531+
'import-x/no-named-as-default': 'off',
470532
'no-invalid-this': 'off',
471533
'no-new': 'off',
472534
'react/jsx-handler-names': 'off',
@@ -477,14 +539,14 @@ module.exports = {
477539
'arrow-body-style': 'error',
478540
'dot-notation': 'error',
479541
eqeqeq: 'error',
480-
'import/no-amd': 'error',
481-
'import/no-commonjs': 'error',
482-
'import/no-duplicates': 'error',
483-
'import/no-extraneous-dependencies': ['error', { packageDir: ['./'] }],
484-
'import/no-mutable-exports': 'error',
485-
'import/no-namespace': 'error',
486-
'import/no-nodejs-modules': 'error',
487-
'import/prefer-default-export': 'off',
542+
'import-x/no-amd': 'error',
543+
'import-x/no-commonjs': 'error',
544+
'import-x/no-duplicates': 'error',
545+
'import-x/no-extraneous-dependencies': ['error', { packageDir: ['./'] }],
546+
'import-x/no-mutable-exports': 'error',
547+
'import-x/no-namespace': 'error',
548+
'import-x/no-nodejs-modules': 'error',
549+
'import-x/prefer-default-export': 'off',
488550
'no-alert': 'error',
489551
'no-constant-condition': [
490552
'error',
@@ -532,7 +594,7 @@ module.exports = {
532594
'prefer-const': 'error',
533595
'prefer-rest-params': 'error',
534596
'prefer-spread': 'error',
535-
'import/no-unresolved': 'error',
597+
'import-x/no-unresolved': 'error',
536598
'eslint-comments/no-unlimited-disable': 'off',
537599
'eslint-comments/no-unused-disable': 'off',
538600
'react-native/no-color-literals': 'error',
@@ -559,6 +621,14 @@ module.exports = {
559621
'react/prefer-es6-class': 'error',
560622
'@metamask/design-tokens/color-no-hex': 'warn',
561623
radix: 'off',
624+
625+
// These rule modifications are removing changes to our shared ESLint config made after
626+
// version v9. This is a temporary measure to get us to ESLint v9 compatible versions,
627+
// at which point we can restore the intended rules and use error suppression instead.
628+
//
629+
// TODO: Remove these modifications after the ESLint v9 update
630+
'react-hooks/rules-of-hooks': 'off',
631+
'no-loss-of-precision': 'off',
562632
},
563633

564634
ignorePatterns: ['wdio.conf.js', 'app/util/termsOfUse/termsOfUseContent.ts'],

.github/CODEOWNERS

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ scripts/build.sh @MetaMask/mobile-pla
4747
fingerprint.config.js @MetaMask/mobile-platform
4848
builds.yml @MetaMask/mobile-platform
4949
.github/workflows/push-eas-update.yml @MetaMask/mobile-admins
50+
.github/workflows/upload-to-testflight.yml @MetaMask/mobile-admins
5051
scripts/update-expo-channel.js @MetaMask/mobile-admins
5152
certs/certificate.pem @MetaMask/mobile-admins
5253
ios/fastlane/ @MetaMask/mobile-admins

.github/workflows/build.yml

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ on:
1313
required: false
1414
type: boolean
1515
default: false
16+
source_branch:
17+
description: 'Branch, tag, or SHA to build'
18+
required: false
19+
type: string
20+
default: ''
1621
ref:
1722
description: 'Git ref to checkout when skip_version_bump is true. Defaults to the triggering event ref.'
1823
required: false
@@ -60,7 +65,7 @@ jobs:
6065
contents: write
6166
id-token: write
6267
with:
63-
base-branch: ${{ github.ref_name }}
68+
base-branch: ${{ inputs.source_branch != '' && inputs.source_branch || github.ref_name }}
6469
secrets:
6570
PR_TOKEN: ${{ secrets.PR_TOKEN }}
6671

@@ -75,8 +80,12 @@ jobs:
7580
signing_aws_role: ${{ steps.config.outputs.signing_aws_role }}
7681
signing_aws_secret: ${{ steps.config.outputs.signing_aws_secret }}
7782
signing_android_keystore_path: ${{ steps.config.outputs.signing_android_keystore_path }}
83+
checkout_ref_for_setup: ${{ !inputs.skip_version_bump && needs.update-build-version.outputs.commit-hash || (inputs.source_branch != '' && inputs.source_branch || github.ref_name) }}
7884
steps:
7985
- uses: actions/checkout@v4
86+
with:
87+
fetch-depth: 0
88+
ref: ${{ !inputs.skip_version_bump && needs.update-build-version.outputs.commit-hash || (inputs.source_branch != '' && inputs.source_branch || github.ref_name) }}
8089
- name: Setup Node.js
8190
uses: actions/setup-node@v4
8291
with:
@@ -110,6 +119,8 @@ jobs:
110119
platform: ${{ inputs.platform == 'both' && fromJSON('["android", "ios"]') || fromJSON(format('["{0}"]', inputs.platform)) }}
111120
uses: ./.github/workflows/setup-node-modules.yml
112121
with:
122+
ref: ${{ needs.prepare.outputs.checkout_ref_for_setup }}
123+
fetch-depth: 0
113124
checkout-submodules: true
114125
platform: ${{ matrix.platform }}
115126
build_name: ${{ inputs.build_name }}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
##############################################################################################
2+
#
3+
# Expo Dev Build — replaces the Bitrise expo_dev_pipeline.
4+
#
5+
# Triggered on every push to main. Builds the main-dev configuration (Debug, simulator)
6+
# for both iOS and Android using the reusable build.yml workflow.
7+
#
8+
# No version bump or TestFlight upload — this is a dev/simulator build only.
9+
# Artifacts (iOS .app zip + Android APK) are uploaded as GitHub Actions artifacts.
10+
#
11+
# [skip ci] commits (e.g. version bumps) are automatically skipped by GitHub Actions.
12+
#
13+
##############################################################################################
14+
name: Expo Dev Build
15+
16+
on:
17+
push:
18+
branches:
19+
- main
20+
workflow_dispatch:
21+
22+
permissions:
23+
contents: read
24+
id-token: write
25+
26+
jobs:
27+
build-dev:
28+
name: Expo dev build (main-dev)
29+
uses: ./.github/workflows/build.yml
30+
with:
31+
build_name: main-dev
32+
platform: both
33+
skip_version_bump: true
34+
secrets: inherit

0 commit comments

Comments
 (0)