Skip to content

Commit 0877883

Browse files
authored
chore: swap out all npx calls to use yarn (MetaMask#19344)
<!-- Please submit this PR as a draft initially. Do not mark it as "Ready for review" until the template has been completely filled out, and PR status checks have passed at least once. --> ## **Description** <!-- Write a short description of the changes included in this pull request, also include relevant motivation and context. Have in mind the following questions: 1. What is the reason for the change? 2. What is the improvement/solution? --> Using `npx` as a package manager is not desired in this repository. This PR removes the use and replaces it will `yarn`. ## **Changelog** <!-- If this PR is not End-User-Facing and should not show up in the CHANGELOG, you can choose to either: 1. Write `CHANGELOG entry: null` 2. Label with `no-changelog` If this PR is End-User-Facing, please write a short User-Facing description in the past tense like: `CHANGELOG entry: Added a new tab for users to see their NFTs` `CHANGELOG entry: Fixed a bug that was causing some NFTs to flicker` (This helps the Release Engineer do their job more quickly and accurately) --> CHANGELOG entry: ## **Related issues** Fixes: ## **Manual testing steps** ```gherkin Feature: my feature name Scenario: user [verb for user action] Given [describe expected initial app state] When user [verb for user action] Then [describe expected outcome] ``` ## **Screenshots/Recordings** <!-- If applicable, add screenshots and/or recordings to visualize the before and after of your change. --> ### **Before** <!-- [screenshots/recordings] --> ### **After** <!-- [screenshots/recordings] --> Test Bitrise Build: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/2edf3a5f-50d0-4804-81b4-420a61ed3517 ## **Pre-merge author checklist** - [ ] I’ve followed [MetaMask Contributor Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile Coding Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md). - [ ] I've completed the PR template to the best of my ability - [ ] I’ve included tests if applicable - [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format if applicable - [ ] I’ve applied the right labels on the PR (see [labeling guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)). Not required for external contributors. ## **Pre-merge reviewer checklist** - [ ] I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed). - [ ] I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.
1 parent 74d2726 commit 0877883

3 files changed

Lines changed: 19 additions & 19 deletions

File tree

docs/readme/release-build-profiler.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ Notes:
3434
Chrome's tracing UI expects a JSON trace. Convert the `.cpuprofile` first:
3535

3636
```bash
37-
npx react-native-release-profiler --local /path/to/profile.cpuprofile
37+
yarn react-native-release-profiler --local /path/to/profile.cpuprofile
3838
```
3939

4040
Then open Chrome and load the generated JSON:

package.json

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -109,10 +109,10 @@
109109
"test:wdio:android": "yarn wdio ./wdio/config/android.config.debug.js",
110110
"test:wdio:android:browserstack": "yarn wdio ./wdio/config/android.config.browserstack.js",
111111
"test:wdio:android:browserstack:local": "yarn wdio ./wdio/config/android.config.browserstack.local.js",
112-
"run-appwright:android-bs": "npx appwright test --project browserstack-android --config appwright/appwright.config.ts",
113-
"run-appwright:ios-bs": "npx appwright test --project browserstack-ios --config appwright/appwright.config.ts",
114-
"run-appwright:android": "npx appwright test --project android --config appwright/appwright.config.ts",
115-
"run-appwright:ios": "npx appwright test --project ios --config appwright/appwright.config.ts",
112+
"run-appwright:android-bs": "yarn appwright test --project browserstack-android --config appwright/appwright.config.ts",
113+
"run-appwright:ios-bs": "yarn appwright test --project browserstack-ios --config appwright/appwright.config.ts",
114+
"run-appwright:android": "yarn appwright test --project android --config appwright/appwright.config.ts",
115+
"run-appwright:ios": "yarn appwright test --project ios --config appwright/appwright.config.ts",
116116
"test:depcheck": "yarn depcheck",
117117
"test:tgz-check": "./scripts/tgz-check.sh",
118118
"test:attribution-check": "./scripts/attributions-check.sh",
@@ -126,10 +126,10 @@
126126
"patch:approval": "./scripts/patch-approval-controller.sh",
127127
"storybook-generate": "sb-rn-get-stories",
128128
"storybook-watch": "sb-rn-watcher",
129-
"gen-bundle:ios": "npx react-native bundle --platform ios --dev false --entry-file index.js --bundle-output ios/main.jsbundle",
130-
"gen-bundle:android": "npx react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/main.jsbundle",
129+
"gen-bundle:ios": "yarn react-native bundle --platform ios --dev false --entry-file index.js --bundle-output ios/main.jsbundle",
130+
"gen-bundle:android": "yarn react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/main.jsbundle",
131131
"circular:deps": "dpdm ./app/* --circular --exit-code circular:1 --warning=false",
132-
"generate-icons": "npx ts-node app/component-library/components/Icons/Icon/scripts/generate-assets.ts"
132+
"generate-icons": "yarn ts-node app/component-library/components/Icons/Icon/scripts/generate-assets.ts"
133133
},
134134
"lint-staged": {
135135
"*.{js,jsx,ts,tsx}": [

scripts/build.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -325,7 +325,7 @@ buildAndroidRun(){
325325
remapEnvVariableLocal
326326
prebuild_android
327327
#react-native run-android --port=$WATCHER_PORT --variant=prodDebug --active-arch-only
328-
npx expo run:android --no-install --port $WATCHER_PORT --variant 'prodDebug' --device
328+
yarn expo run:android --no-install --port $WATCHER_PORT --variant 'prodDebug' --device
329329
}
330330

331331
# Builds the Main APK for local development
@@ -356,13 +356,13 @@ buildAndroidRunQA(){
356356
remapEnvVariableLocal
357357
prebuild_android
358358
#react-native run-android --port=$WATCHER_PORT --variant=qaDebug --active-arch-only
359-
npx expo run:android --no-install --port $WATCHER_PORT --variant 'qaDebug'
359+
yarn expo run:android --no-install --port $WATCHER_PORT --variant 'qaDebug'
360360
}
361361

362362
buildAndroidRunFlask(){
363363
prebuild_android
364364
#react-native run-android --port=$WATCHER_PORT --variant=flaskDebug --active-arch-only
365-
npx expo run:android --no-install --port $WATCHER_PORT --variant 'flaskDebug'
365+
yarn expo run:android --no-install --port $WATCHER_PORT --variant 'flaskDebug'
366366
}
367367

368368
buildIosSimulator(){
@@ -372,21 +372,21 @@ buildIosSimulator(){
372372
if [ -n "$IOS_SIMULATOR" ]; then
373373
device_args=(--device "$IOS_SIMULATOR")
374374
fi
375-
npx expo run:ios --no-install --configuration Debug --port $WATCHER_PORT "${device_args[@]}"
375+
yarn expo run:ios --no-install --configuration Debug --port $WATCHER_PORT "${device_args[@]}"
376376
}
377377

378378
buildIosSimulatorQA(){
379379
prebuild_ios
380380
SIM="${IOS_SIMULATOR:-"iPhone 13 Pro"}"
381381
#react-native run-ios --port=$WATCHER_PORT --simulator "$SIM" --scheme "MetaMask-QA"
382382

383-
npx expo run:ios --no-install --configuration Debug --port $WATCHER_PORT --device "$SIM" --scheme "MetaMask-QA"
383+
yarn expo run:ios --no-install --configuration Debug --port $WATCHER_PORT --device "$SIM" --scheme "MetaMask-QA"
384384
}
385385

386386
buildIosSimulatorFlask(){
387387
prebuild_ios
388388
SIM="${IOS_SIMULATOR:-"iPhone 13 Pro"}"
389-
npx expo run:ios --no-install --configuration Debug --port $WATCHER_PORT --device "$SIM" --scheme "MetaMask-Flask"
389+
yarn expo run:ios --no-install --configuration Debug --port $WATCHER_PORT --device "$SIM" --scheme "MetaMask-Flask"
390390
}
391391

392392
buildIosSimulatorE2E(){
@@ -411,17 +411,17 @@ runIosE2E(){
411411
buildIosDevice(){
412412
remapEnvVariableLocal
413413
prebuild_ios
414-
npx expo run:ios --no-install --configuration Debug --port $WATCHER_PORT --device
414+
yarn expo run:ios --no-install --configuration Debug --port $WATCHER_PORT --device
415415
}
416416

417417
buildIosDeviceQA(){
418418
prebuild_ios
419-
npx expo run:ios --no-install --port $WATCHER_PORT --configuration Debug --scheme "MetaMask-QA" --device
419+
yarn expo run:ios --no-install --port $WATCHER_PORT --configuration Debug --scheme "MetaMask-QA" --device
420420
}
421421

422422
buildIosDeviceFlask(){
423423
prebuild_ios
424-
npx expo run:ios --no-install --configuration Debug --scheme "MetaMask-Flask" --device
424+
yarn expo run:ios --no-install --configuration Debug --scheme "MetaMask-Flask" --device
425425
}
426426

427427
# Generates the iOS binary for the given scheme and configuration
@@ -676,10 +676,10 @@ startWatcher() {
676676
watchman watch-del-all
677677
rm -rf $TMPDIR/metro-cache
678678
#react-native start --port=$WATCHER_PORT -- --reset-cache
679-
npx expo start --port $WATCHER_PORT --clear
679+
yarn expo start --port $WATCHER_PORT --clear
680680
else
681681
#react-native start --port=$WATCHER_PORT
682-
npx expo start --port $WATCHER_PORT
682+
yarn expo start --port $WATCHER_PORT
683683
fi
684684
}
685685

0 commit comments

Comments
 (0)