Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update npm run native start to include cleanup #28025

Merged
merged 3 commits into from
Feb 5, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions docs/contributors/getting-started-native-mobile.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ npm ci
## Run

```
npm run native start
npm run native start:reset
```

Runs the packager (Metro) in development mode. The packager stays running to serve the app bundle to the clients that request it.
Expand Down Expand Up @@ -72,7 +72,7 @@ To see a list of all of your available iOS devices, use `xcrun simctl list devic

### Troubleshooting

Some times, and especially when tweaking anything in the `package.json`, Babel configuration (`.babelrc`) or the Jest configuration (`jest.config.js`), your changes might seem to not take effect as expected. On those times, you might need to clean various caches before starting the packager. To do that, run the script: `npm run native start:reset`. Other times, you might want to reinstall the NPM packages from scratch and the `npm run native clean:install` script can be handy.
Some times, and especially when tweaking anything in the `package.json`, Babel configuration (`.babelrc`) or the Jest configuration (`jest.config.js`), your changes might seem to not take effect as expected. On those times, you might need to stop the metro bunder process and restart it with `npm run native start:reset`. Other times, you might want to reinstall the NPM packages from scratch and the `npm run native clean:install` script can be handy.

## Developing with Visual Studio Code

Expand Down
5 changes: 3 additions & 2 deletions packages/react-native-editor/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -79,9 +79,10 @@
"access": "public"
},
"scripts": {
"start": "react-native start",
"start:reset": "npm run clean:runtime && npm run start -- --reset-cache",
"start": "echo \"\\x1b[33mThe start command is not available in this project. It is strongly recommended to use \\x1b[1:33mstart:reset\\x1b[0m\\x1b[33m to perform some cleanup when starting the metro bundler.\nOr you may use \\x1b[1:33mstart:quick\\x1b[0m\\x1b[33m for a quicker startup, but this may lead to unexpected javascript errors when running the app.\\x1b[0m\"",
"start:debug": "node --inspect-brk node_modules/.bin/react-native start",
"start:reset": "npm run clean:runtime && npm run start:quick -- --reset-cache",
"start:quick": "react-native start",
"prern-bundle": "cd ../.. && patch-package --patch-dir packages/react-native-editor/metro-patch",
"rn-bundle": "react-native bundle",
"postrn-bundle": "cd ../.. && patch-package --reverse --patch-dir packages/react-native-editor/metro-patch",
Expand Down