Commit Graph
49 Commits
Author SHA1 Message Date
Evan BaconandEvan Bacon 3052b9d0c7 [webpack] Upgrade to Webpack 5 (#3763)
* Upgraded deps

* Update withDevServer.ts

* Running with Webpack 5

* New logging

* Fixed asset creation

* Fixed sockets

* Update TerminalUI.ts

* Added bundling support

* Update TerminalUI.ts

* fixed startup logic

* Updated dev tools web start

* Update startAsync.ts

* Update yarn.lock

* [wip] working again

* remove unused

* wip -- native fast refresh

* remove unused

* wip

* fixed fast refresh dev server across web/ios

* support arbitrary ports

* fixed image loading on web

* fixup refresh

* wip multi-config -- not working with fast refresh

* wip kinda working

* wip -- native fast refresh working

* wip -- working all platforms

* Added asset Metro middleware interop

* Disable react-error-overlay

* add web stuff back

* improve symbolication

* added proper patches

* patch package

* Update webpackHotDevClient.ts

* Update __webpack_require__.l.ts

* wip -- no merge

* wip -- no merge

* wip

* wip -- no commit

* wip -- updated interface

* wip -- update runtime

* fix versions

* Fix types

fixed all runtime/ TS errors

fix ts errors

change redirects

drop deprecations

Drop native output

Update embed.ts

Delete embed.ts

revert extras

remove asset middleware

updated ops

split out HMR plugin

Update webpack.config.ts

* Remove patches

* Delete webpack-dev-middleware_dist_utils_setupOutputFileSystem.js

* Drop extra native features

* revert code

* Update defaults.ts

* added types

* fix yarn

Update PackagerLogsStream.ts

Update yarn.lock

* Update getFileAsync.ts

* Update webpack.config.ts

* Update Webpack.ts

* Fix splitChunks

* Remove react-dev-utils to add Node LTS (v12) support back

Update ModuleNotFoundPlugin.ts

Update formatWebpackMessages.ts

* fix types

* Update createAllLoaders-test.js

* Update paths-test.js.snap

* fix tests

* Update webpack.config-test.js.snap

* Fix merge

* Fix find-up

* Update package.json

Update ManifestHandler.ts

Update .eslintrc.js

Update parseStartOptions.ts

fix types

Update yarn.lock

Delete more unused code and fix types

fix types

drop unimodules helper (no longer used in Next.js adapter)

update tests

drop more native support

wip -- drop native

update deps

Update basic-test.js

updated tests

Update startAsync.ts

drop / revert

Update package.json

* update tests

* fix tests

* fix tests

---------

Co-authored-by: Evan Bacon <[email protected]>
2023-01-27 10:38:59 -06:00
Kim Brandwijk 208354c051 [expo-env-info] prepare repo to convert expo-env-info to esm (#4312) 2022-04-23 02:01:30 +02:00
Łukasz Kosmaty b5c59a7910 [Interstitial page] Fix QR on web UI & fallback to SDK version if the runtime version wasn't defined (#4214)
# Why

Fixes that QR code on web UI pointed to the `Expo Go` directly instead of to the interstitial page.
Fallback to the SDK version if the runtime version wasn't defined. 

# How

- Extended the dev graphQL server to serve Interstitial page URL if available. 

# Test Plan

- runs the local version of the CLI and confirms that the web QR code points to the correct place.
- checks if the SDK version was detected when the runtime version isn't available.
2022-02-16 13:17:37 +01:00
Evan Bacon bf8edaea7b Revert "Created @expo/api package (#3361)" (#4165)
This reverts commit 282ac13a1b.
2022-01-26 15:42:58 -07:00
Evan Bacon 282ac13a1b Created @expo/api package (#3361)
* Created expo/api package

* Update Env.ts

* Update package.json

* fix ApiV2Error

* fix imports

* Move downloadAppAsync to api

* Update downloadAppAsync.ts

* move ip

* fix downloadAppAsync

* yarn update

* Update internal.ts

* Update package.json

* reduce cross-package communication

* fix bugs

* Move Versions module to api

* Move Exp into User

* Move ExpSchema to api

* Convert all API usage to typed functions

* Update yarn.lock

* Update startAsync.ts

* fix imports

* Switch up Env shape

Consolidate settings

Drop lodash

dotExpoHomeDirectory -> getDirectory

rename lte and gte methods

ExpSchema -> ExpoConfigSchema

Refactor Cache

fix bugs

* fix type errors

fix up function names

* Update User.ts

Update README.md

Update startAsync.ts

lint fix

fixup tests

Split up Publish API

Refactor API

Refactor

Update getPublishExpConfigAsync.ts

* Update User.ts

* Update package.json

Cleaned up API

Moved ProjectSettings to api

Delete unused Session module

Update ArtifactUtils.ts

Config -> ProcessSettings

move downloadAppAsync back to xdl

Updated Versions API

Clean up API

fixed whoami

fix tests

fix bugs

Update exportAppAsync-test.ts

Update exportAppAsync-test.ts

Update npm-test.ts

Updated docs

Updated docs

Update ProjectSettings.ts

fix mocks for path

fix mocks

fix dev tools mock

Update autoAddConfigPluginsAsync-test.ts

split up e2e

split up e2e

added node matrix

* Update UserManager.ts
2022-01-24 14:07:30 -07:00
Evan Bacon 004b1c48a8 [expo cli] use 'better-opn' instead of 'react-dev-utils/openBrowser' (#4018)
* Replace "react-dev-utils/openBrowser" with "better-opn"

* Added types
2021-11-18 23:42:05 -07:00
d189a84b8c use platforms array for disabling platforms (#3844)
* Added platforms for disabling terminal ui

* Added platforms styling to web ui

* Update packages/expo-cli/src/commands/start/TerminalUI.ts

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

Co-authored-by: Evan Bacon <[email protected]>
Co-authored-by: Brent Vatne <[email protected]>
2021-09-14 08:48:45 -06:00
Brent VatneandJames Ide 20e0d2015f expo.io -> expo.dev (#3771)
Co-authored-by: James Ide <[email protected]>
2021-08-16 12:41:10 -07:00
Evan BaconandEvan Bacon d081399b29 [expo cli] Added platform prefixes to logs (#3769)
* Added logger platform tags (in-line style)

* Added platform to middleware logs

* Update clientLogsMiddleware.ts

* Update clientLogsMiddleware.ts

* Use expo-platform

* Update clientLogsMiddleware-test.ts

Co-authored-by: Evan Bacon <[email protected]>
2021-08-16 11:43:45 -06:00
Evan Bacon 095c95f5b6 Remove Config.offline (#3374)
* Remove Config.offline

* lint fix
2021-04-08 14:18:33 -07:00
Evan Bacon 320f1b2982 Refactor projectDir -> projectRoot (#3292) 2021-03-16 15:18:15 -07:00
Ville Immonen cac8bdfbd7 Remove unused detach code from XDL and rename the package (#3268)
* Rename @expo/xdl to xdl
* Remove unused modules from the xdl interface
* Remove unused TurtleApi
* Remove unused Detach.detachAsync
* Remove unused code in src/detach folder
  - Remove StandaloneContextService (this code now always runs in user context)
  - Remove unused functions in ExponentTools and IosWorkspace
  - Remove unused modules
  - All of the remaining files in src/detach folder are now TypeScript for easier refactoring
* Remove `xdl.Modules`
2021-03-15 15:26:36 +02:00
Evan BaconandVille Immonen a7ab0a6fbb [xdl] split up Project module (#3164)
* Split server methods out of Project module

* Update startLegacyReactNativeServerAsync.ts

* Split up Project module

* Update Project.ts

* Update Project.ts

* Update exp.ts

* Update xdl.js

* Update startLegacyReactNativeServerAsync.ts

* Update packages/xdl/src/Project.ts

Co-authored-by: Ville Immonen <[email protected]>

Co-authored-by: Ville Immonen <[email protected]>
2021-02-03 18:53:20 -08:00
Evan Bacon c6e5c25858 Use global ngrok for xdl (#3123)
* use global ngrok

* added debug logging

* Update resolveNgrok.ts

* silence logs unless using debug mode

* auto install from dev tools

* Update resolveNgrok.ts

* Update ngrok.ts

* Update resolveNgrok.ts
2021-01-26 13:52:34 -08:00
Brent Vatne 9e3cb1eb15 [xdl][dev-tools][cli] Update --dev-client for new requirements (#2938) 2020-12-21 18:17:41 -08:00
Evan Bacon 96ee222020 [expo start] remove extra config reads (#2636)
* remove 2 extra config reads from expo start

* Added optional config to start RN server

* make getSlugAsync accept an optional ExpoConfig

* Better API
2020-09-14 21:14:01 +02:00
Evan BaconandBrent Vatne 8b3a7e9afb [xdl] Improved Android module (#2550)
- Give android parity with #2541
- Support multiple connected android devices
- Support opening Android emulators/devices from a list
- Support prompt to update client automatically
- Improve emulator boot-up
- Improve error messages

Co-authored-by: Brent Vatne <[email protected]>
2020-09-01 14:43:56 -07:00
Evan BaconandBrent Vatne 22972212ed [cli] simulator upgrades (#2541)
- fix interactions after prompting user to upgrade
- bring simulator to the front when the link is opened in it
- prompt to upgrade automatically
- maximize reuse across functions, cutting down on possible edge cases in our abstraction
- add ability to select simulators
- prompt user to select a simulator from a list when no simulators are open
- add shift+i for selecting more simulators
- shim out methods for other simulator utilities
- provide better methods for ensuring that a simulator fully boots up
- created simcontrol module for extending simctl

Co-authored-by: Brent Vatne <[email protected]>
2020-09-01 13:44:33 -07:00
Evan Bacon 099e07e133 [cli] Redesign help prompt (#2538)
* Redesign help prompt

* Update CHANGELOG.md

* updated tenses

* Update whoami.ts

* Remove uses of 'your'

* fix args

* Update whoami.ts

* Update logout.ts

* flip brackets
2020-08-30 17:09:50 -07:00
Will Schurman e958ff848c Update eslint-config-universe to 4.0.0 (#2396) 2020-07-24 15:25:32 -07:00
Juwan WheatleyandVille Immonen 8b09997cf2 [xdl] Start Ngrok only when running expo start --tunnel (#2088)
* [xdl]  Start Ngrok only when running expo start --tunnel

Fixes #335

* this doesn't actually return packagerOpts, so destructure instead of using incorrect name

* [dev-tools] toggling 'tunnel' in DevTools should start tunnels

* Update packages/dev-tools/server/graphql/GraphQLSchema.ts

Co-authored-by: Ville Immonen <[email protected]>

Co-authored-by: Ville Immonen <[email protected]>
2020-05-12 08:34:06 -07:00
Brent Vatne 138d65e5b5 Revert "[dev-tools] refactor: Convert DevTools to Expo Web from NextJS (#1824)"
This reverts commit dd469ae8a2.
2020-04-15 22:06:26 -07:00
Juwan WheatleyandEvan Bacon dd469ae8a2 [dev-tools] refactor: Convert DevTools to Expo Web from NextJS (#1824)
* [dev-tools] Initialize new Expo app

* [dev-tools] remove decorators

* [dev-tools] get UI rendering via Expo Web instead of NextJS

* [dev-tools] use path.resolve to remove leading slash

* [dev-tools] get Expo Web dev-tools running on `expod start`

* [dev-tools] get local dev server working with `expo start`-ed UI

* [dev-tools] add nodemon watcher for developing DevToolsServer and create script for developing DevTools UI.

This also removes the `yarn start` script, as you should run `yarn dev-server <path>` and `yarn dev-ui` in separate terminals.

* [dev-tools] update README.md

* [dev-tools] build/develop DevTools client using xdl directly

* [dev-tools] add emotion babel plugin dep

* [website] remember to install client dependencies

* [dev-tools] check before cleaning dist path

* [dev-tools] remove nextjs config files

* [dev-tools] test if adding next back to the devtools package unbreaks CI

* Revert "[dev-tools] test if adding next back to the devtools package unbreaks CI"

This reverts commit 3647e51eff44eaddb65c322a66c9728e97b5a0b6.

* [dev-tools] try to add *correct* NextJS back to fix CI

* [dev-tools] use correct start script to not start metro

* [dev-tools] remove redundant main field
we should stop generating this in the template if it's default now

* [dev-tools] remove redundant platforms field

* [dev-tools] moved indexpage to appjs

* Update packages/dev-tools/client/.gitignore

Co-Authored-By: Evan Bacon <[email protected]>

* [dev-tools] be more specific about what version of dev-tools you should be testing

* [dev-toold] reduce size from 4.3mb to 1.2mb (on-par with nextjs predecessor)

* [dev-tools] import name properly

* [dev-tools] tell developers to not run `expo start` when trying to `yarn dev`

* [dev-tools] retake: remove manifest, run on port 19002, and support relative paths

Co-authored-by: Evan Bacon <[email protected]>
2020-04-14 18:55:28 -07:00
Evan Bacon 0f431e66d8 Migrate all running/publishing config reading methods to new app.config.js (#1581)
* Migrate all running/publishing config reading methods

* Merge branch 'master' into @evanbacon/config/migrate-all-to-new-config

* Updated start command

* Add support for creds and upgrade

* Update Exp-test.js

* revert packagemanager format

* fix mode bugs

* Update publish-info.ts

* Update GraphQLSchema.ts

* Update install.ts

* Update publish.ts

* Update start.ts

* Update upgrade.ts

* Update BaseUploader.ts

* Update context.ts

* Update unit-test-config.js

* Update jest.config.js

* Update Exp.ts

* Update paths.ts

* Update ExpSchema.ts

* Update UrlUtils.ts

* Update Project.ts

* Update BaseBuilder.ts

* Update README.md
2020-03-12 17:14:45 -07:00
Evan Bacon 5c3339592c [dev-tools] Upgrade dev-tools (#1633)
* Migrate dev-tools to typescript

* fix scripts

* fix tests

* upgrade to next.js v8
2020-03-04 17:15:58 -08:00
Ville Immonen d23bf45ab8 fix(dev-tools): fix an EventEmitter memory leak (#1530)
Fix a memory leak resulting in warnings like this to be generated by
Node:
```
(node:14054) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 ADDED listeners added to [Issues]. Use emitter.setMaxListeners() to increase limit
(node:14054) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 UPDATED listeners added to [Issues]. Use emitter.setMaxListeners() to increase limit
(node:14054) MaxListenersExceededWarning: Possible EventEmitter memory leak detected. 11 DELETED listeners added to [Issues]. Use emitter.setMaxListeners() to increase limit
```

To reproduce the bug I refreshed the browser tab with Dev Tools in it
10+ times. After this, the warning shown above was printed in the
terminal.

The underlying cause was that each time the browser subscribed to the
logs, `addListener` was called in `eventEmitterToAsyncIterator`, but
the corresponding `removeListener` was never called.

There was code wrapping async iterators in the Dev Tools server, which
did not implement the `return()` and `throw()` methods of the async
iterator. For this reason, whenever a client disconnected, the async
iterator was not cleaned up.
2020-02-10 18:01:06 +02:00
Evan BaconandBrent Vatne d14cfeaa50 Always show web in dev tools (#1492)
Co-authored-by: Brent Vatne <[email protected]>
2020-02-03 12:56:49 -08:00
Brent Vatne b9931529dd [dev-tools] Fix graphql host undefined bug 2020-01-06 12:25:57 -08:00
kerbe a87602b8ef [dev-tools] Option to choose devtools bind address (#1253)
* fix(dev-tools): ability to specify listen host for devtool (#1081)

Added support for environment variable EXPO_DEVTOOLS_LISTEN_ADDRESS,
which is used to bind Expo DevTools instance in given address. If this
variable is not given, 'localhost' is used instead.

* fix: get actual hostname

Assign arrow function return value to variable, instead of having it as function.

* Refactoring for code style

Moved devtoolsGraphQLHost and devtoolsHost function definitions
2019-12-19 11:34:22 -08:00
jkh dd2c0197f2 [expo-cli] add apiV2 option for send (#1362) 2019-12-18 14:18:45 -08:00
Brent Vatne b810269440 Update TypeScript, ESLint, Prettier, and run them everywhere (#1304) 2019-12-05 16:39:48 -08:00
Evan Bacon 2d06d7a9e0 Moved expo-cli optimize to npx expo-optimize (#1192)
* Moved `expo-cli optimize` to `npx expo-optimize`

* Added deprecation notice for expo-cli optimize

* Update yarn.lock

* Update README.md

* Update package.json

* Update README.md

* Update optimize.ts

* Update GraphQLSchema.js

* Update README.md

* pull expo-optimize from dev-tools
2019-11-18 13:47:12 -08:00
Will Schurman 3190c4e061 fix(dev-tools): Fix graphql errors when config is invalid (#1236) 2019-11-18 12:29:35 +02:00
Evan Bacon b11a790dcd [xdl] Revert deprecation (#1229)
* Revert deprecation

* revert use of Webpack.isRunning
2019-11-14 15:04:12 -08:00
Evan Bacon 19c7b501b8 [xdl] Deprecated ProjectUtils methods (#1194)
* Deprecated ProjectUtils methods

- readConfigJsonAsync
- readExpRcAsync

* Fixed schema tests

* Remove unused checks

* fix flow errors
2019-11-11 14:35:54 -08:00
Ville Immonen 2bb0a8c80d fix: EADDRINUSE when running Expo CLI in two projects at the same time (#1098)
Fixes #1097.
2019-10-14 17:00:52 +03:00
Ville Immonen 31cb3c6a88 fix(dev-tools): add authentication to the WebSocket API (#1008)
This patch adds four measures to limit access to the local WebSocket
API of Dev Tools.

- The WebSocket API endpoint URL now includes a secret token.
  Requests to the API without the ticket are unauthorized, for example:
  ws://localhost:19002/M2vbMDtkD-hVJGCegdw3BytRFV5JbQXPM2pLbYwgQDo/graphql
- WebSocket connections without a correct `Origin` header are rejected.
- After a connection is established, the client needs to inclue
  `clientAuthenticationToken`, another secret token.
- The HTTP server of Dev Tools is only listening connections to `localhost`.

The secret tokens are obtained from a new HTTP endpoint `/dev-tools-info`.

Thanks to Spencer von der Ohe for reporting this issue.
2019-09-20 23:00:11 +03:00
Evan Bacon b5dfb8355e Fixed TerminalUI and GraphQLSchema (#831)
* Fixed TerminalUI and GraphQLSchema

* Sorted imports
2019-07-09 15:57:21 -07:00
Ville Immonen 7d33f17629 Rename xdl to @expo/xdl (scoped package) (#636)
npm currently has issues with 3 character package names (https://status.npmjs.org/incidents/qg46dsfk1vt2) and scoped packages also have more permission options available (e.g. npm access command only works with scoped packages).
2019-05-20 18:37:32 +03:00
Sergei Chestakov 47f70e5824 Add image optimization functionality (#555)
* Add optimize command and read in bundled assets

* Add sharp to dependencies and compress images

* Use assets.json in .expo folder to store which assets have been modified

* Store assets by their checksum in .expo-shared and add --save option

This commit switches to storing assets.json in a new .expo-shared folder
rather than .expo so that it can be checked into git and state can be shared
amongst multiple people . It also now keeps track of files using the SHA256
checksum of their contents rather than their inodes or names which allows it
to work crossplatform and accross different machines. Finally, I added a --save
option to save the original assets and switched to overwriting them and
not saving the unoptimized versions by default.

* Delete unused hash values in assets.json and log when no assets are optimized

Deleting unused hash values allows us to remove entries in assets.json for assets that were deleted or modified

* Only search for assets files in project directory

* Output KB saved and remove 'optimized' assets if larger than original

* Update function to convert number of bytes to a human readable value

* Add warning and prompt the user if --save flag is not passed in

* Prompt user to optimize assets before publishing

* Add toggle for asset optimization in dev-tools

* Add optimize functionality to dev-tools GUI

Moves core logic of optimization to xdl and imports from within expo-cli and
dev-tools. Adds a new Graph QL mutation which the dev-tools front end
calls to trigger the xdl optimizeAsync function.

* Add message about assets.json when it's created.

* Use path.join instead of string concatenation

* Move helper functions into a new AssetUtils module

* Add --include and --exclude options to filter files

* Clarify that --include and --exclude patterns are relative to proj root

* Make logs less colorful

* Update prompt messages to be more clear

* .expo -> .orig for backups

* Remove backup prompt/warning when there are no assets to optimize

* Update prompt message to backup original files
2019-05-03 03:29:16 -07:00
Evan Bacon d6ee540471 Reuse browser tabs (#565)
Use `react-dev-utils/openBrowser` wrapper for the `opn` module to attempt to reuse tabs when possible.
2019-05-02 19:13:55 -07:00
Ville Immonen 9d2d17cbc2 Remove legacy config functions from xdl (#466)
* Remove legacy config functions from xdl

These functions have moved to @expo/config

* Fix ESLint warning
2019-04-08 18:17:48 +02:00
Evan Bacon f910fae6cb @expo/config (#452)
* Created `@expo/config`

* Integrated `@expo/config`

* Updated error handling
2019-03-25 18:28:28 +02:00
Ville Immonen a4c2dd5635 Fix all ESLint warnings in dev-tools 2019-03-21 13:08:25 +02:00
James Ide a9ce6ead81 Remove "SMS" from link-sending descriptions (#425)
This removes SMS from the UI for sending project development links. The server endpoint still behaves the same, but the UI now promotes email over SMS. Email is more reliable, much cheaper, and more customizable. We'll make a similar change on web as well.

Test plan: Ran the CLI on a test project and verified that both the CLI and web UI showed just "email" without "SMS" for sending links.
2019-03-18 22:50:59 -07:00
Ville Immonen cf721e1f6c Initial support for expo-web (#406)
Add expo-web support to `expo start`
2019-03-06 20:09:10 +02:00
Ville Immonen 36a863ccee [dev-tools] Fix an issue with caching files installed from npm
npm sets the mtime of all files in published tarballs to
"Sat, 26 Oct 1985 08:15:00 GMT", which messed up with the
browser cache of the static files in dev-tools, because the
server responded with 304 Not Modified after upgrading the
package, as the mtime had not changed.
2018-11-07 18:56:11 +02:00
Ville Immonen 6eefda9a28 [xdl][dev-tools] Upgrade express dependency and remove body-parser
json and urlencoded middlewares are now included in express.
2018-11-07 16:45:12 +02:00
Ville Immonen 5c1ca0be51 Move all packages to packages/ folder 2018-08-24 00:02:43 +03:00