feat(cli, metro-config): environment variable support (#21983)# Why - It's nice to be able to use uncommitted values in your app, based on the environment. This feels very familiar to web devel
feat(cli, metro-config): environment variable support (#21983)# Why - It's nice to be able to use uncommitted values in your app, based on the environment. This feels very familiar to web developers. - Values that are prefixed with `EXPO_PUBLIC_` will be inlined in the bundle when bundling normally (e.g. not for Node.js). - `.env` files are loaded into memory and applied to the process during a run. This also means that they're available in `app.config.js`. - During development-only, environment variables are exposed on the `process.env` object (non-enumerable) to ensure they're available between fast refresh updates. <!-- Please describe the motivation for this PR, and link to relevant GitHub issues, forums posts, or feature requests. --> # How - Create new package `@expo/env` which is used to hydrate env variables in a unified way. I plan to open another PR in `eas-cli` which uses this package to fill in environment variables before uploading. NOTE: environment variables that are defined in eas.json are not available in Expo CLI when building locally, but are available in the cloud since they'll be on the process, this means they effectively emulate `.env.production`. - Update templates to gitignore local env files. - Add basic documentation to the versioned metro guide (more to come). <!-- How did you build this feature or fix this bug and why? --> # Test Plan - [ ] E2E rendering test - [ ] E2E Node.js rendering test - [x] Unit tests for serializer - [x] Tests for env package <!-- Please describe how you tested this change and how a reviewer could reproduce your test, especially if this PR does not include automated tests! If possible, please also provide terminal output and/or screenshots demonstrating your test/reproduction. --> # 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).
show more ...
feat(cli): auto setup typescript during start (#21475)# Why - Some users are confused about how to use the fully automated TypeScript setup. It currently runs when you run `npx expo start` in a
feat(cli): auto setup typescript during start (#21475)# Why - Some users are confused about how to use the fully automated TypeScript setup. It currently runs when you run `npx expo start` in a project with `tsconfig.json` or any TypeScript file in the project. - This change will run the TypeScript check continuously until TypeScript is setup. This only applies to projects using Metro, and currently is only run in `npx expo start`, and the run commands (when the server is started in the current window, e.g. not headless mode). <!-- Please describe the motivation for this PR, and link to relevant GitHub issues, forums posts, or feature requests. --> # How - Fork the `runServer` function from Metro into the CLI so we can access the Metro bundler instance directly. - Use Metro's native file watching to observe new TypeScript files being added to the project (within the observable files). This is fast and ensures we don't accidentally block a thread that otherwise could've been used for bundling. - The TypeScript continuous check only runs once, if you remove TypeScript and add it back in the same process, then nothing happens. This is a performance optimization. - If TypeScript is enabled while the process is running, the user will not be prompted to install, the packages will just install in the project. Failures will be displayed in the running process, and no more attempts will be made. - If TypeScript is detected on start then the existing system will be used and the continuous check will be skipped, this means projects already using TypeScript won't have any technical performance hit. <!-- How did you build this feature or fix this bug and why? --> # Test Plan - In a project without TypeScript: - `npx expo` - `touch tsconfig.json` or `mv index.js index.tsx` or `touch foo.tsx` - TypeScript is automatically installed for the project. - `EXPO_NO_TYPESCRIPT_SETUP` voids this behavior - Added unit tests. <!-- Please describe how you tested this change and how a reviewer could reproduce your test, especially if this PR does not include automated tests! If possible, please also provide terminal output and/or screenshots demonstrating your test/reproduction. --> # 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). --------- Co-authored-by: Expo Bot <[email protected]> Co-authored-by: Cedric van Putten <[email protected]>
feat(cli): disable prompts in non interactive processes (#18300)* feat(cli): disable prompts in non interactive processes * Update packages/@expo/cli/CHANGELOG.md Co-authored-by: Expo Bot <34
feat(cli): disable prompts in non interactive processes (#18300)* feat(cli): disable prompts in non interactive processes * Update packages/@expo/cli/CHANGELOG.md Co-authored-by: Expo Bot <[email protected]> * Update startAsync.ts * fix tests 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]>
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]>