Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[cli] Added auth commands to expo #16087

Merged
merged 16 commits into from Feb 1, 2022
Merged

Conversation

EvanBacon
Copy link
Contributor

@EvanBacon EvanBacon commented Jan 27, 2022

Why

Authentication is required for signing manifests in expo start, otherwise you cannot use secure features in Expo Go. Since user info is used for expo start manifest middleware, authentication might as well be here as well.

The API contents were copied over from expo/eas-cli which were also copied from expo/expo-cli, I've opted to use the newer API since the older one is unmaintained.

The newer API appears to implement a multitude of heavy packages which differ from what we used originally in expo-cli. Will need to take a pass at rewriting features using got to use node-fetch (eas-cli uses both).

  • Removed amplitude code, renamed analytics to telemetry, removed persistent process settings.

Test Plan

  • Added a series of e2e tests for the auth commands.
  • Migrated eas-cli tests
  • Added extra tests and reduced unneeded things from eas-cli.
  • Ran nexpo login, nexpo logout, nexpo register, nexpo whoami locally to ensure everything works.

Checklist

  • Documentation is up to date to reflect these changes (eg: https://docs.expo.dev and README.md).
  • This diff will work correctly for expo build (eg: updated @expo/xdl).
  • This diff will work correctly for expo prebuild & EAS Build (eg: updated a module plugin).

@expo-bot expo-bot added the bot: passed checks ExpoBot has nothing to complain about label Jan 27, 2022
Update otp.ts

Update actions.ts
@EvanBacon EvanBacon force-pushed the @evanbacon/expo/cli/auth-commands branch from c7bc1c0 to d6e17c4 Compare January 27, 2022 02:07
@EvanBacon EvanBacon force-pushed the @evanbacon/expo/cli/auth-commands branch from bd71031 to 5ef009a Compare January 27, 2022 03:02
@EvanBacon EvanBacon marked this pull request as ready for review January 27, 2022 07:21
packages/expo/cli/login/index.ts Outdated Show resolved Hide resolved
packages/expo/cli/logout/index.ts Outdated Show resolved Hide resolved
packages/expo/cli/register/registerAsync.ts Outdated Show resolved Hide resolved
packages/expo/cli/utils/graphql/client.ts Outdated Show resolved Hide resolved
packages/expo/cli/utils/api.ts Outdated Show resolved Hide resolved
'expo-session': string;
};

export const graphqlClient = createUrqlClient({
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know this is orthogonal to this PR but I would like to fix/get rid of that CombinedError message later unless there truly are multiple errors, in which case there is still probably a nicer way to print them than with [CombinedError]

packages/expo/cli/utils/user/otp.ts Show resolved Hide resolved
Copy link
Member

@byCedric byCedric left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Left a few things, mainly the if (EXPO_NO_TELEMETRY) // enable rudderstack

packages/expo/cli/utils/analytics/rudderstackClient.ts Outdated Show resolved Hide resolved
packages/expo/cli/utils/analytics/rudderstackClient.ts Outdated Show resolved Hide resolved
packages/expo/e2e/__tests__/whoami-test.ts Show resolved Hide resolved
packages/expo/cli/utils/user/actions.ts Show resolved Hide resolved
packages/expo/cli/register/registerAsync.ts Outdated Show resolved Hide resolved
packages/expo/cli/utils/user/actions.ts Show resolved Hide resolved
packages/expo/cli/utils/user/actions.ts Outdated Show resolved Hide resolved
Co-authored-by: James Ide <ide@users.noreply.github.com>
Co-authored-by: Cedric van Putten <me@bycedric.com>
@kgc00 kgc00 self-requested a review January 27, 2022 17:35
lazy load analytics

Update prompts.ts

Update actions.ts
Update registerAsync.ts
Remove unused settings
Drop unused
Update otp.ts
Update whoamiAsync.ts
@EvanBacon EvanBacon force-pushed the @evanbacon/expo/cli/auth-commands branch from cbeaabe to 979519b Compare January 28, 2022 23:47
@EvanBacon EvanBacon merged commit 08f1ae9 into main Feb 1, 2022
@EvanBacon EvanBacon deleted the @evanbacon/expo/cli/auth-commands branch February 1, 2022 18:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bot: passed checks ExpoBot has nothing to complain about
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

7 participants