History log of /expo/packages/@expo/cli/src/start/server/DevServerManager.ts (Results 1 – 14 of 14)
Revision Date Author Comments
# 87669a95 15-Aug-2023 Mark Lawlor <[email protected]>

feat(cli): add `expo typescript` command (#23642)

# Why

The command serves two purposes
- Allow users to manually start the Expo Typescript bootstrap process
- Generate Expo Router types wi

feat(cli): add `expo typescript` command (#23642)

# Why

The command serves two purposes
- Allow users to manually start the Expo Typescript bootstrap process
- Generate Expo Router types within CI environments.

Unlike the automatic Typescript detection, this command will bypass
prompts and simply enable Typescript support.

# How

Reuses `TypeScriptProjectPrerequisite` and the Typescript services from
`MetroBundlerDevServer`.

This PR also modifies the
`MetroBundlerDevServer.startTypeScriptServices()` to run without a
started server (so file watching will be disabled)

# Test Plan

# 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 `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

show more ...


# 8a424beb 11-Aug-2023 James Ide <[email protected]>

[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]>

show more ...


# a7e47f4d 16-Jun-2023 Evan Bacon <[email protected]>

feat(cli): Add ability to switch runtimes during start. (#22924)

# Why

- We're going to start making the `--dev-client` flag be on more
aggressively, i.e. favoring custom builds over Expo Go mor

feat(cli): Add ability to switch runtimes during start. (#22924)

# Why

- We're going to start making the `--dev-client` flag be on more
aggressively, i.e. favoring custom builds over Expo Go more.
- This doesn't lean one way or the other, but it does make it easier to
course correct if we guess wrong. We'll also be adding an explicit flag
to force the initial mode.
- Some caveats:
- The custom `--scheme` is not currently respected.
- Non-dev-client runs will validate versions, here we don't validate
versions during the swap.

<!--
Please describe the motivation for this PR, and link to relevant GitHub
issues, forums posts, or feature requests.
-->

# How

- Press `s` to swap runtime modes. This can happen with `npx expo
start`, `run:ios`, and `run:android`

<!--
How did you build this feature or fix this bug and why?
-->

# Test Plan

- TBD

# 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 `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

---------

Co-authored-by: Expo Bot <[email protected]>
Co-authored-by: Brent Vatne <[email protected]>

show more ...


# 9580591f 30-Apr-2023 Evan Bacon <[email protected]>

feat(metro-config, cli): CSS serializer (#22325)

# Why

In order to support static CSS in development mode, we need to update
the metro serializer to support returning the JS and CSS assets. We n

feat(metro-config, cli): CSS serializer (#22325)

# Why

In order to support static CSS in development mode, we need to update
the metro serializer to support returning the JS and CSS assets. We now
inline the CSS in the HTML before sending to the client, this allows for
testing how the website works with JS disabled. We use the same style
tag id to continue to support HMR for styles during subsequent updates.

This change also refactors how exports work to serialize JS and CSS at
the same time (i.e. after the native transformations).

<!--
Please describe the motivation for this PR, and link to relevant GitHub
issues, forums posts, or feature requests.
-->

# How

<!--
How did you build this feature or fix this bug and why?
-->

# Test Plan

<!--
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 `npx expo prebuild` & EAS Build
(eg: updated a module plugin).

---------

Co-authored-by: Expo Bot <[email protected]>

show more ...


# 6a750d06 08-Apr-2023 Evan Bacon <[email protected]>

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 ...


# 1117330a 07-Apr-2023 Mark Lawlor <[email protected]>

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]>

show more ...


# 33643b60 04-Mar-2023 Evan Bacon <[email protected]>

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]>

show more ...


# 5404abc1 14-Feb-2023 Evan Bacon <[email protected]>

Close config file watchers to ensure process can exit. (#21199)

# Why

This was a bug and now it's fixed.

# How

<!--
How did you build this feature or fix this bug and why?
-->

# Test P

Close config file watchers to ensure process can exit. (#21199)

# Why

This was a bug and now it's fixed.

# How

<!--
How did you build this feature or fix this bug and why?
-->

# Test Plan

Start and stop the dev server in `expo start`, this should now
completely close and not hang open.

---------

Co-authored-by: Expo Bot <[email protected]>

show more ...


# ea99eec9 25-Jul-2022 Evan Bacon <[email protected]>

feat(cli): add telemetry event tracking a command run (#17948)

* add telemetry event tracking a command run

* Ensure user authenticated

* Update rudderstackClient.ts

* Update rudderstackCli

feat(cli): add telemetry event tracking a command run (#17948)

* add telemetry event tracking a command run

* Ensure user authenticated

* Update rudderstackClient.ts

* Update rudderstackClient.ts

* Update CHANGELOG.md

show more ...


# 6d6b81f9 23-Jun-2022 Evan Bacon <[email protected]>

feat(cli): add web support to metro (#17927)

* feat: add web support for metro

* undo patch

* Update index.js

* Update MetroBundlerDevServer.ts

* Add second bundler dev server

* Add d

feat(cli): add web support to metro (#17927)

* feat: add web support for metro

* undo patch

* Update index.js

* Update MetroBundlerDevServer.ts

* Add second bundler dev server

* Add dev loading view to web

* Put feature behind EXPO_USE_METRO_WEB flag

* Move custom config into CLI

* Add support for assets across platforms

* reduce

* Added upstream web support

* Update webTemplate.ts

* Update CHANGELOG.md

* Update instantiateMetro.ts

* Update instantiateMetro.ts

* Update index.js

* Added bundle splitting support

* Update startAsync.ts

* Fixed default settings

* Add ability to copy from public folder

* wip: redirect unmatched routes to `/` on web

* fix fallback api

* Update exportApp.ts

* Update instantiateMetro.ts

* Update exportApp.ts

* clean up handler

* fixup

* clean up

* add web to export test

* Update start-test.ts

* added static serving for web

* Update packages/@expo/cli/CHANGELOG.md

Co-authored-by: Expo Bot <[email protected]>

* Update yarn.lock

lint fix

fix tests

* Update export-test.ts

* added template tests

* Create HistoryFallbackMiddleware-test.ts

* test ManifestMiddleware

* Create ServeStaticMiddleware-test.ts

* refactor multiplatform

* Update ManifestMiddleware-test.ts

* Update withMetroMultiPlatform.ts

* Update for latest metro

* Update packages/@expo/cli/src/export/resolveOptions.ts

Co-authored-by: Expo Bot <[email protected]>

show more ...


# 474a7a4b 21-Jun-2022 Evan Bacon <[email protected]>

chore(cli): migrate to debug package (#17084)

* chore(cli): migrate to debug package

* Update packages/@expo/cli/CHANGELOG.md

Co-authored-by: Expo Bot <[email protected]

chore(cli): migrate to debug package (#17084)

* chore(cli): migrate to debug package

* Update packages/@expo/cli/CHANGELOG.md

Co-authored-by: Expo Bot <[email protected]>

* Update checkPackages.ts

* Update packages/@expo/cli/src/start/platforms/android/ADBServer.ts

* Update ADBServer.ts

* Update activateWindow.ts

* Update adb.ts

* migrate new methods to debug

* Update variadic.ts

* Update yarn.lock

Co-authored-by: Expo Bot <[email protected]>

show more ...


# fdf34e39 19-May-2022 Evan Bacon <[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]>

show more ...


# 11a5a4d2 04-Apr-2022 Evan Bacon <[email protected]>

fix(cli): allow bail out from TerminalUI (#16818)

* Allow quitting from terminal UI

* Update CHANGELOG.md

* Update packages/@expo/cli/CHANGELOG.md

Co-authored-by: Expo Bot <34669131+expo-bo

fix(cli): allow bail out from TerminalUI (#16818)

* Allow quitting from terminal UI

* Update CHANGELOG.md

* Update packages/@expo/cli/CHANGELOG.md

Co-authored-by: Expo Bot <[email protected]>

Co-authored-by: Expo Bot <[email protected]>

show more ...


# 8d307f52 23-Mar-2022 Evan Bacon <[email protected]>

chore: refactor `expo/cli` to `@expo/cli` package (#16717)

* chore: refactor `expo/cli` to `@expo/cli` package

* Update CODEOWNERS

* fix linking

* fix lint script

* fix build file

* f

chore: refactor `expo/cli` to `@expo/cli` package (#16717)

* chore: refactor `expo/cli` to `@expo/cli` package

* Update CODEOWNERS

* fix linking

* fix lint script

* fix build file

* fix e2e tests

* lint before build

* use mock version

show more ...