expo-cli icon indicating copy to clipboard operation
expo-cli copied to clipboard

Yarn 2 compatibility

Open arcanis opened this issue 4 years ago • 5 comments

Hello 👋 I'm working to add Expo to the Yarn E2E tests (so that we can track regressions on both sides) - I saw the work by @fson at #1501 which is a really good start, and I now have a few more questions / comments:

  • A few packages (not only yours) have unlisted dependencies that prevent running yarn dlx expo-cli. I will make PRs to the relevant repositories (https://github.com/expo/expo-cli/pull/1601, https://github.com/expo/expo-cli/pull/1602https://github.com/expo/expo-cli/pull/1602, https://github.com/npm/pacote/pull/32).

  • In the context of testing Expo through GitHub actions, what would you suggest as workflow? I've noticed that Expo seems to expect user accounts, which isn't practical in our case. Is there an "anonymous mode" where I could just try on a CI to build a bundle and check that it runs ok?

arcanis avatar Feb 27 '20 13:02 arcanis

Hey! 👋 This sounds awesome! Thanks for taking the initiative, @arcanis. (And thank you for your great work on Yarn 2!)

For testing, you could use the "offline mode" (expo start --offline), which doesn't require a user account. We have a couple of E2E tests in this repo that do something similar. We look for a string in the output, which might be a bit too brittle: https://github.com/expo/expo-cli/blob/fe583499104b1ab8c9a8e5e8c609744c666b32ea/packages/expo-cli/e2e/tests/start-test.ts#L23-L27 To avoid that, you might want to use the expo build:web command instead, which just builds a JS bundle and exists. (It doesn't require a user account either.)

fson avatar Mar 02 '20 15:03 fson

Thanks @fson ! I've tried it locally and expo start --offline works with the iOS simulator 🎉

If possible I'd like to run the E2E on the iOS or Android bundles, as the Web version is using Webpack rather than Metro (I think?), and we already have E2E tests on Webpack. Do you know if there's a way to build them without setuping the emulators? I tried the following:

❯ [COMP11310.local?] tmp/my-rn-app git:(master) ✗ ❯ yarn expo build:ios

Your project must have a bundleIdentifier set in app.json.
See https://docs.expo.io/versions/latest/distribution/building-standalone-apps/#2-configure-appjson

❯ [COMP11310.local?] tmp/my-rn-app git:(master) ✗ ❯ yarn expo build:android

Your project must have an Android package set in app.json
See https://docs.expo.io/versions/latest/distribution/building-standalone-apps/#2-configure-appjson

arcanis avatar Mar 09 '20 15:03 arcanis

Oh, also there's one caveat: since we don't recommend global packages anymore (since they aren't part of the lockfile they make projects non-deterministic), in order for yarn expo to work users have to run yarn add expo-cli first (it's not added during the init).

arcanis avatar Mar 09 '20 15:03 arcanis

If possible I'd like to run the E2E on the iOS or Android bundles, as the Web version is using Webpack rather than Metro (I think?), and we already have E2E tests on Webpack.

Sure. I think you could use expo export --public-url https://example.com/. It's a command that builds the iOS and Android JS bundles for distribution. (expo build:{android|ios} builds the native app (.apk/.ipa) using our build service.)

fson avatar Mar 16 '20 16:03 fson

This issue is stale because it has been open for 60 days with no activity. If there is no activity in the next 7 days, the issue will be closed.

github-actions[bot] avatar Apr 12 '22 20:04 github-actions[bot]

Closing in favor of https://github.com/expo/expo-cli/issues/1073

EvanBacon avatar Oct 27 '22 22:10 EvanBacon