Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

remove all usages of credentials api from xdl #2422

Merged
merged 1 commit into from
Aug 6, 2020

Conversation

wkozyra95
Copy link
Contributor

Why

  • Stop using apiv1 endpoint for credentials
  • remove dependencies from xdl to easier move code to eas-cli in the future

How

  • switch upload:ios to use packages/expo-cli/src/credentials/api/IosApi.ts
  • switch fetch:ios:certs to use packages/expo-cli/src/credentials/api/IosApi.ts
  • switch push:android:* to use packages/expo-cli/src/credentials/api/AndroidApi.ts (it was already using apiv2, but I think it's cleaner for all the code to use that wrapper)

Test plan

  • run expo fetch:ios:certs with and without credentials
  • run all expo push:android:* cmds
  • I didn't test upload:ios command
Copy link
Contributor

@dsokal dsokal left a comment

Choose a reason for hiding this comment

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

Please test the upload:ios command :)

log(`Retrieving iOS credentials for ${credentialMetadata.experienceName}`);
const bundleIdentifier = ctx.manifest?.ios?.bundleIdentifier;
if (!bundleIdentifier) {
throw new Error(noBundleIdMessage);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
throw new Error(noBundleIdMessage);
throw new Error(`Your project must have a \`bundleIdentifier\` set in the Expo config (app.json or app.config.js).\nSee https://expo.fyi/bundle-identifier`);
const {
args: { remotePackageName },
} = await Exp.getPublishInfoAsync(projectDir);
const noBundleIdMessage = `Your project must have a \`bundleIdentifier\` set in the Expo config (app.json or app.config.js).\nSee https://expo.fyi/bundle-identifier`;
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const noBundleIdMessage = `Your project must have a \`bundleIdentifier\` set in the Expo config (app.json or app.config.js).\nSee https://expo.fyi/bundle-identifier`;
const credentialMetadata = await Credentials.getCredentialMetadataAsync(this.projectDir, 'ios');
const credential = await Credentials.getCredentialsForPlatform(credentialMetadata);
const teamId = credential?.teamId;
async _getAppleTeamId(appleIdCredntials: AppleIdCredentials): Promise<string | undefined> {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
async _getAppleTeamId(appleIdCredntials: AppleIdCredentials): Promise<string | undefined> {
async _getAppleTeamId(appleIdCredentials: AppleIdCredentials): Promise<string | undefined> {
if (teamId) {
return teamId;
} else {
const { team } = await authenticate(appleIdCrentials);
const { team } = await authenticate(appleIdCredntials);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
const { team } = await authenticate(appleIdCredntials);
const { team } = await authenticate(appleIdCredentials);
@wkozyra95 wkozyra95 force-pushed the @wkozyra95/remove-credentials-logic-from-xdl branch from 7f9bc14 to d479f62 Compare August 5, 2020 13:55
@wkozyra95 wkozyra95 force-pushed the @wkozyra95/remove-credentials-logic-from-xdl branch from d479f62 to 5e9bb51 Compare August 5, 2020 13:57
Copy link
Member

@quinlanj quinlanj left a comment

Choose a reason for hiding this comment

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

thanks!

@wkozyra95 wkozyra95 merged commit 560a017 into master Aug 6, 2020
@wkozyra95 wkozyra95 deleted the @wkozyra95/remove-credentials-logic-from-xdl branch August 6, 2020 08:25
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
3 participants