feat(cli): ensure port is running after build. (#24315)# Why If a user runs either build command (`npx expo run:ios` or `npx expo run:android`) simultaneously, then there is chance for a port c
feat(cli): ensure port is running after build. (#24315)# Why If a user runs either build command (`npx expo run:ios` or `npx expo run:android`) simultaneously, then there is chance for a port conflict. This change proposes we run a secondary port check after the build to provide a slightly better user experience. If the port is taken by the same app, the dev server will be skipped and the process will proceed in headless-mode, if the port is taken by a different process, then an error will be thrown. --------- Co-authored-by: Expo Bot <[email protected]>
show more ...
[cli] Extend android package name validation (#24155)
feat(cli): validate android package name (#24194)# Why - resolve https://github.com/expo/expo/issues/22428 <!-- Please describe the motivation for this PR, and link to relevant GitHub issue
feat(cli): validate android package name (#24194)# Why - resolve https://github.com/expo/expo/issues/22428 <!-- Please describe the motivation for this PR, and link to relevant GitHub issues, forums posts, or feature requests. --> # How - Added a list of reserved java keywords from wikipedia. - Tested each category against a gradle build. - Added additional info to the validation prompt so users have a hint as to what is incorrect. <!-- How did you build this feature or fix this bug and why? --> # Test Plan - Added unit tests, ran locally <img width="491" alt="Screenshot 2023-08-30 at 3 23 02 PM" src="https://github.com/expo/expo/assets/9664363/e5d42702-3818-48f4-ad23-f9f6e821223f">
[lint] Upgrade to Prettier v3, typescript-eslint to v6 (#23544)Why --- Prettier 3 is out. Add support for it with this linter config. **Note for reviewer:** the first commit is the one with th
[lint] Upgrade to Prettier v3, typescript-eslint to v6 (#23544)Why --- Prettier 3 is out. Add support for it with this linter config. **Note for reviewer:** the first commit is the one with the actual changes. The rest of this PR are changes to get the linter passing (mostly autofix). How --- Update eslint-config-prettier and eslint-plugin-prettier. To address deprecation warnings, also update typescript-eslint/parser and typescript-eslint/eslint-plugin. Because of an update to typescript-eslint/parser, we need to suppress deprecation warnings (documented in a comment). Regenerated test snapshots. Due to the upgraded dependencies, typecasts and optional chaining are now auto-fixable by lint. This converts warnings into autofixes. Test Plan --- `yarn test` in the linter config. Run `expotools check --all --fix-lint --no-build --no-test --no-uniformity-check` to try this config on the whole repo. --------- Co-authored-by: Expo Bot <[email protected]>
feat(cli): improve offline support (#22961)# Why Offline support is sometimes needed in parts of other commands besides `start`, this PR introduces an `EXPO_OFFLINE` env var which can be gener
feat(cli): improve offline support (#22961)# Why Offline support is sometimes needed in parts of other commands besides `start`, this PR introduces an `EXPO_OFFLINE` env var which can be generally used to force offline support. <!-- Please describe the motivation for this PR, and link to relevant GitHub issues, forums posts, or feature requests. --> # How - `EXPO_OFFLINE` - Show a better error message when your computer is connected to wifi but there's no signal. - Assert in `npx expo login` and `npx expo register` when `EXPO_OFFLINE` is set. - Fail better when validating versions offline. In the case of running `npx expo` without wifi: ## Before ``` june-16 nexpo Starting project at /Users/evanbacon/Documents/GitHub/lab/june-16 Starting Metro Bundler Unable to reach Expo servers. Falling back to using the cached dependency map (bundledNativeModules.json) from the package "expo" installed in your project. FetchError: request to https://api.expo.dev/v2/versions/latest failed, reason: getaddrinfo ENOTFOUND api.expo.dev FetchError: request to https://api.expo.dev/v2/versions/latest failed, reason: getaddrinfo ENOTFOUND api.expo.dev at ClientRequest.<anonymous> (/Users/evanbacon/Documents/GitHub/expo/node_modules/node-fetch/lib/index.js:1491:11) at ClientRequest.emit (node:events:513:28) at TLSSocket.socketErrorListener (node:_http_client:502:9) at TLSSocket.emit (node:events:513:28) at emitErrorNT (node:internal/streams/destroy:151:8) at emitErrorCloseNT (node:internal/streams/destroy:116:3) at process.processTicksAndRejections (node:internal/process/task_queues:82:21) ``` ## After ``` june-16 nexpo Starting project at /Users/evanbacon/Documents/GitHub/lab/june-16 Starting Metro Bundler Unable to reach Expo servers. Falling back to using the cached dependency map (bundledNativeModules.json) from the package "expo" installed in your project. CommandError: Network connection is unreliable. Try again with the environment variable `EXPO_OFFLINE=1` to skip network requests. ``` <!-- How did you build this feature or fix this bug and why? --> # Test Plan - Updated tests and added new tests for things like the register command. --------- Co-authored-by: Expo Bot <[email protected]>
[cli] Add dependency exclusion to `npx expo install` (#22736)# Why Fulfills https://linear.app/expo/issue/ENG-8564/add-dependency-exclusion-to-npx-expo-install. Developers will be able to suppre
[cli] Add dependency exclusion to `npx expo install` (#22736)# Why Fulfills https://linear.app/expo/issue/ENG-8564/add-dependency-exclusion-to-npx-expo-install. Developers will be able to suppress warnings from `npx expo install --check` via a package.json config, and thus suppress doctor warnings when they intentionally choose to install a different version, especially when using dev builds and not needing to stick to the Expo Go- bundled version. # How `npx expo install --check|fix` reads from `expo.install.exclude` if it's available, and, if one of the packages it thinks it should fix is in that list, it will skip asking/ fixing it. If you run `EXPO_DEBUG=1 npx expo install --check`, the packages whose checks were actually skipped will be listed in debug output; otherwise there are no warnings or messages about the excluded packages. The package.json configuration verbiage is intended to be similar to the [autolinking config](https://docs.expo.dev/modules/autolinking/#exclude). ~~It also seemed appropriate that `npx expo install` should behave differently if you try to install an excluded package, so someone doesn't come along and write over a version that another developer determined was good and thus applied the override for. Currently, it aborts if any of the packages are in the exclusion list. I could see doing a warning and skipping the affected packages instead, but the command outright failing is pretty hard to miss.~~ `npx expo install` now installs excluded packages with the latest version, just like a package without a specified native version. It will add a note describing what it's doing and why. # Test Plan - [x] test without `expo.install.exclude` (works the same) - [x] test with empty exclusion list (works the same) - [x] test with exclusions that aren't actual dependencies (works the same) - [x] test `expo install --fix|check` when excluding an actual dependency (skips it) - [x] test with `EXPO_DEBUG=1` (lists excluded packages) - [x] test `expo install [package]` with exclusions (installs latest with notes) - [x] test `expo install [package]` without exclusions (proceeds as it normally does) ## Output `npx expo install --check`, showing note that it is skipping checking packages in the exclude list: <img width="884" alt="image" src="https://github.com/expo/expo/assets/8053974/30cef729-af18-44cb-98ef-11fc9729ae3d"> Additional debug output for `EXPO_DEBUG=1 npx expo install --check`: <img width="904" alt="image" src="https://github.com/expo/expo/assets/8053974/9096a939-066c-431b-a467-6d3d70ef448d"> `expo install <package>` with exclusions: <img width="932" alt="image" src="https://github.com/expo/expo/assets/8053974/d51e9e5a-cc59-4aa4-9cb6-4a2294b01ccc"> # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [x] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [x] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [x] This diff will work correctly for `npx expo prebuild` & EAS Build (eg: updated a module plugin). --------- Co-authored-by: Brent Vatne <[email protected]>
fix: upsertGitIgnoreContents from creating duplicate entries (#22127)# Why The regex pattern to detect existing contents in `upsertGitIgnoreContents`checking for trailing white space. This case
fix: upsertGitIgnoreContents from creating duplicate entries (#22127)# Why The regex pattern to detect existing contents in `upsertGitIgnoreContents`checking for trailing white space. This cases a false negative and the content is duplicated.
feat(@expo/cli): manage expo-env.d.ts when EXPO_USE_TYPED_ROUTES is enabled (#22096)# Why Sister PR to https://github.com/expo/router/pull/481 and https://github.com/expo/router/pull/477 Thi
feat(@expo/cli): manage expo-env.d.ts when EXPO_USE_TYPED_ROUTES is enabled (#22096)# Why Sister PR to https://github.com/expo/router/pull/481 and https://github.com/expo/router/pull/477 This automatically creates a `expo-env.d.ts` file that is managed by Expo. It will populate the `tsconfig.json` and add it to `gitignore`. The file is ignored as it is managed by Expo CLI and may change between patches. Additionally, types are now generated when bundling. # Test Plan Create a new Expo Router application using the branch `marklawlor/expo-env` `EXPO_USE_TYPED_ROUTES=true nexpo start` Observe that - [ ] `expo-env.d.ts` was created - [ ] New types are available (such as `hover` on PressableState) - [ ] `expo-env.d.ts` is added to the `gitignore file Running the `nexpo start` without `EXPO_USE_TYPED_ROUTES` will remove the generated content. # Checklist Documentation will be added to the Expo Router docs - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `expo prebuild` & EAS Build (eg: updated a module plugin).
[cli] Remove legacy manifest signing in modern manifest format and fix cached development code signing info (#21989)
feat: typed route generation for expo router (#21651)> Draft PR - just seeking feedback on the implementation. # Why WIP implementation of route generation for Expo Router. # How ## Typ
feat: typed route generation for expo router (#21651)> Draft PR - just seeking feedback on the implementation. # Why WIP implementation of route generation for Expo Router. # How ## Typescript bootstrapping This is expands the Typescript bootstrapping to also accommodate for long-lived typescript watchers. - Changes `waitForMetroToObserveTypeScriptFile` to `metroWatchTypeScriptFiles` - Processes are now responsible to disabling their watcher - tsconfig can optionally be watched ## Type generation `typedRouteGenerator` is invokes after the CLI has bootstrapped TypeScript. - Generates types only for absolute paths - Supports static and dynamic routes - Supports URL normalisation (TODO: Need unit tests for these!) - Supports dynamic route parameter typing # Test Plan `EXPO_ROUTER_TYPED_ROUTES=true nexpo start` // Todo # Checklist - [x] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [x] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [x] This diff will work correctly for `expo prebuild` & EAS Build (eg: updated a module plugin). --------- Co-authored-by: Evan Bacon <[email protected]>
refactor(package-manager)!: extend the API and provide access to spawn child (#18576)# Why Fixes ENG-7545 This proposal PR changes the API of the (node) package managers, with the goal of:
refactor(package-manager)!: extend the API and provide access to spawn child (#18576)# Why Fixes ENG-7545 This proposal PR changes the API of the (node) package managers, with the goal of: - Having the right API options to install/remove packages to `dependencies`/`devDependencies`/global deps - Having access to the actual `spawnAsync` child, to pipe logs into different systems (for example in EAS build) - Allowing us to fix a couple of annoying DX issues (see follow up PRs) > This is further outlined in the Package Manager API proposal. Before merging this one, we need to merge these other PRs to not-break `main`. Any feedback on the proposal is welcome, especially while in draft. - https://github.com/expo/expo/pull/19343 - https://github.com/expo/expo/pull/19344 # How See Package Manager API proposal. # Test Plan > These changes are backward incompatible and require a new version update. This change also allowed us to implement the following fixes (all stacked PRs): - https://github.com/expo/expo/pull/19343 - https://github.com/expo/expo/pull/19344 - https://github.com/expo/expo/pull/19342 - https://github.com/expo/expo/pull/19340 - https://github.com/expo/expo/pull/19341 - https://github.com/expo/expo/pull/19764 - https://github.com/expo/expo/pull/19835 - https://github.com/expo/expo/pull/21189 # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [x] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `expo prebuild` & EAS Build (eg: updated a module plugin).
fix(cli): use known Expo schemes to use as dev client urls (#20888)# Why Fixes #20887 # How Instead of always picking the longest scheme, this adds "search for known expo schemes, startin
fix(cli): use known Expo schemes to use as dev client urls (#20888)# Why Fixes #20887 # How Instead of always picking the longest scheme, this adds "search for known expo schemes, starting with `exp+`". If that's found, it's still sorting on longest. And if it's not found, it's doing what it's doing now. # Test Plan (see added tests) - Add a custom scheme to the native files that includes a very long scheme - Start the project (should be a bad scheme) - Add a shorter `exp+...` scheme - Start the project (should be that `expo+...` scheme) # Checklist <!-- Please check the appropriate items below if they apply to your diff. This is required for changes to Expo modules. --> - [ ] Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md). - [ ] Conforms with the [Documentation Writing Style Guide](https://github.com/expo/expo/blob/main/guides/Expo%20Documentation%20Writing%20Style%20Guide.md) - [ ] This diff will work correctly for `expo prebuild` & EAS Build (eg: updated a module plugin).
[2/3] upgrade react native 0.71 (#20832)# Why follow up #20799 for react-native 0.71 upgrade. this pr aims for jest upgrade and fix all broken tests. close ENG-7192 # How - upgrade packag
[2/3] upgrade react native 0.71 (#20832)# Why follow up #20799 for react-native 0.71 upgrade. this pr aims for jest upgrade and fix all broken tests. close ENG-7192 # How - upgrade packages - `jest: ^26.0.24 -> ^29.2.1` - `jest-watch-typeahead: 0.6.4 -> 2.2.1` - `@types/jest: ^26.0.24 -> ^29.2.1` - `babel-jest: ^26.6.3 -> ^29.2.1` - `@jest/create-cache-key-function: ^27.0.1 -> ^29.2.1` - `@babel/preset-env: ^7.12.9 -> ^7.14.0` - `eslint: ^8.20.0 -> ^8.29.0` - add `jest-environment-jsdom` because new jest does not include it by default - [core] fix `SyntheticPlatformEmitter` type error. originally it refers to `react-native/Libraries/EventEmitter/RCTDeviceEventEmitter` internal file which has incorrect type setup in 0.71. we could use the `react-native.DeviceEventEmitter` instead. - [expo-linking]: remove the deprecated `Linking.removeEventListener` (which is also removed from upstream) - [firebase-recaptcha] remove broken web test because firebase ESM which is not supported by jest. this pr simply remove the test case because the package is deprecated. - [jest-expo-enzyme] remove this package and move to [the archived repo](https://github.com/expo/jest-expo-enzyme). enzyme cannot upgrade to jest 29. - remove `@types/react-native` and the versioned cli package check. because 0.71 ships the types directly. - [ncl] workaround `@react-native-community/slider`, `@react-native-segmented-control/segmented-control`, and `@react-native-masked-view/masked-view` type errors in the `react-native-71-fix.d.ts`. - for other details, please check the commit histories one by one. # Test Plan - ci passed - for test-suite ios ci error, i've mentioned in #20799
feat(cli): improve UNVERSIONED (internal-only) support (#20754)# Why Fail a little bit more expectedly when using Expo CLI for UNVERSIONED projects. # Test Plan - unit tests - tested aga
feat(cli): improve UNVERSIONED (internal-only) support (#20754)# Why Fail a little bit more expectedly when using Expo CLI for UNVERSIONED projects. # Test Plan - unit tests - tested against apps/test-suite Co-authored-by: Expo Bot <[email protected]>
fix CLI tests (#20510)# Why tests are failing. Co-authored-by: Expo Bot <[email protected]>
[cli] Fix development code signing for dev client (#19557)
[cli] Add assert with possibly intended variadic argument (#19396)* [cli] Add recover to show intended command for npx expo install * [cli] Fix extraneous space and tests * [cli] Add changelo
[cli] Add assert with possibly intended variadic argument (#19396)* [cli] Add recover to show intended command for npx expo install * [cli] Fix extraneous space and tests * [cli] Add changelog entry * docs(cli): use proper changelog entry Co-authored-by: Evan Bacon <[email protected]> Co-authored-by: Evan Bacon <[email protected]>
feat: add support for $EXPO_EDITOR (#18285)* feat: add support for $EXPO_EDITOR * Update packages/@expo/cli/CHANGELOG.md Co-authored-by: Expo Bot <[email protected]>
feat: add support for $EXPO_EDITOR (#18285)* feat: add support for $EXPO_EDITOR * Update packages/@expo/cli/CHANGELOG.md Co-authored-by: Expo Bot <[email protected]> Co-authored-by: Expo Bot <[email protected]>
feat(cli): add `customize` command (#17186)* feat(cli): add `customize` command * Update packages/@expo/cli/CHANGELOG.md Co-authored-by: Expo Bot <[email protected]>
feat(cli): add `customize` command (#17186)* feat(cli): add `customize` command * Update packages/@expo/cli/CHANGELOG.md Co-authored-by: Expo Bot <[email protected]> * Update customizeAsync.ts * Update customizeAsync.ts * Update index-test.ts * Refactor * refactor and test * Improve help * Added e2e tests * Update packages/@expo/cli/src/customize/generate.ts Co-authored-by: Cedric van Putten <[email protected]> * Update export-web-test.ts Co-authored-by: Expo Bot <[email protected]> Co-authored-by: Cedric van Putten <[email protected]>
feat(cli): add info about using the `--clear` flag (#17560)* feat(cli): add info about using the `--clear` flag when the `babel.config.js` file changes during `expo start` * Update packages/@exp
feat(cli): add info about using the `--clear` flag (#17560)* feat(cli): add info about using the `--clear` flag when the `babel.config.js` file changes during `expo start` * Update packages/@expo/cli/CHANGELOG.md Co-authored-by: Expo Bot <[email protected]> Co-authored-by: Expo Bot <[email protected]>
feat(cli): add `run:ios` command (#16662)* [wip] Added expo run:ios command * Clean up run:ios * feat(cli): add headless server mode * fix(cli): fix run:ios logic issues * Update CHANGE
feat(cli): add `run:ios` command (#16662)* [wip] Added expo run:ios command * Clean up run:ios * feat(cli): add headless server mode * fix(cli): fix run:ios logic issues * Update CHANGELOG.md * Update packages/expo/CHANGELOG.md Co-authored-by: Expo Bot <[email protected]> * clean up * refine fixture * refactor and test code signing * Update resolveOptionsAsync.ts * fix merge * added new impl * Update AppleDevice.ts * Added more tests * fixed e2e tests * lint fix * Update index-test.ts Co-authored-by: Expo Bot <[email protected]>
chore(cli): deduplicate asMock helper function (#17294)
fix(cli): prevent autocomplete from crashing (#17271)* fix(cli): prevent autocomplete from crashing * Update packages/@expo/cli/CHANGELOG.md Co-authored-by: Expo Bot <34669131+expo-bot@users.
fix(cli): prevent autocomplete from crashing (#17271)* fix(cli): prevent autocomplete from crashing * Update packages/@expo/cli/CHANGELOG.md Co-authored-by: Expo Bot <[email protected]> * Update promptAppleDevice.ts Co-authored-by: Expo Bot <[email protected]>
feat(cli): add `run:android` command (#17187)* feat(cli): add `run:android` command * added partial e2e test * fix platforms showing up in terminal ui * fix launching by link * Update p
feat(cli): add `run:android` command (#17187)* feat(cli): add `run:android` command * added partial e2e test * fix platforms showing up in terminal ui * fix launching by link * Update packages/@expo/cli/CHANGELOG.md Co-authored-by: Expo Bot <[email protected]> * fix platforms showing up in terminal ui fix launching by link fixup tests Delete resolveArgs-test.ts.snap * revert changes * Update index-test.ts Update WebpackBundlerDevServer.ts Update WebpackBundlerDevServer.ts Update WebpackBundlerDevServer.ts Update PlatformManager.ts * Update index-test.ts * update structure Co-authored-by: Expo Bot <[email protected]>
feat(cli): use new dev server API (#17189)* chore(cli): use new dev server API * Update CHANGELOG.md * Update packages/@expo/cli/CHANGELOG.md Co-authored-by: Expo Bot <34669131+expo-bot@us
feat(cli): use new dev server API (#17189)* chore(cli): use new dev server API * Update CHANGELOG.md * Update packages/@expo/cli/CHANGELOG.md Co-authored-by: Expo Bot <[email protected]> * Fix downloading the beta client * Update downloadExpoGoAsync.ts * Update downloadExpoGoAsync-test.ts * bump packages * forward correct exit code * Update CHANGELOG.md Co-authored-by: Expo Bot <[email protected]>
12