mirror of
https://github.com/expo/eas-cli.git
synced 2026-11-14 10:08:06 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
7e154ec9dc |
No files matched your search
@@ -4,7 +4,7 @@ import path from 'path';
|
||||
import slash from 'slash';
|
||||
|
||||
import { AndroidCredentials } from '../../credentials/android/AndroidCredentialsProvider';
|
||||
import { getUsername } from '../../project/projectUtils';
|
||||
import { getUsernameForActor } from '../../project/projectUtils';
|
||||
import { ensureLoggedInAsync } from '../../user/actions';
|
||||
import { getVcsClient } from '../../vcs';
|
||||
import { BuildContext } from '../context';
|
||||
@@ -24,8 +24,7 @@ export async function prepareJobAsync(
|
||||
ctx: BuildContext<Platform.ANDROID>,
|
||||
jobData: JobData
|
||||
): Promise<Job> {
|
||||
const username = getUsername(
|
||||
ctx.exp,
|
||||
const username = getUsernameForActor(
|
||||
await ensureLoggedInAsync({ nonInteractive: ctx.nonInteractive })
|
||||
);
|
||||
const buildProfile: BuildProfile<Platform.ANDROID> = ctx.buildProfile;
|
||||
|
||||
@@ -3,7 +3,7 @@ import path from 'path';
|
||||
import slash from 'slash';
|
||||
|
||||
import { IosCredentials, TargetCredentials } from '../../credentials/ios/types';
|
||||
import { getUsername } from '../../project/projectUtils';
|
||||
import { getUsernameForActor } from '../../project/projectUtils';
|
||||
import { ensureLoggedInAsync } from '../../user/actions';
|
||||
import { getVcsClient } from '../../vcs';
|
||||
import { BuildContext } from '../context';
|
||||
@@ -26,8 +26,7 @@ export async function prepareJobAsync(
|
||||
): Promise<Job> {
|
||||
const projectRootDirectory =
|
||||
slash(path.relative(await getVcsClient().getRootPathAsync(), ctx.projectDir)) || '.';
|
||||
const username = getUsername(
|
||||
ctx.exp,
|
||||
const username = getUsernameForActor(
|
||||
await ensureLoggedInAsync({ nonInteractive: ctx.nonInteractive })
|
||||
);
|
||||
const buildCredentials: Ios.Job['secrets']['buildCredentials'] = {};
|
||||
|
||||
@@ -5,7 +5,7 @@ import fs from 'fs-extra';
|
||||
import resolveFrom from 'resolve-from';
|
||||
|
||||
import Log from '../log';
|
||||
import { getUsername, isExpoUpdatesInstalled } from '../project/projectUtils';
|
||||
import { getUsernameForActor, isExpoUpdatesInstalled } from '../project/projectUtils';
|
||||
import {
|
||||
readChannelSafelyAsync as readAndroidChannelSafelyAsync,
|
||||
readReleaseChannelSafelyAsync as readAndroidReleaseChannelSafelyAsync,
|
||||
@@ -49,8 +49,7 @@ export async function collectMetadataAsync<T extends Platform>(
|
||||
(await vcsClient.getLastCommitMessageAsync()) ?? undefined
|
||||
),
|
||||
isGitWorkingTreeDirty: await vcsClient.hasUncommittedChangesAsync(),
|
||||
username: getUsername(
|
||||
ctx.exp,
|
||||
username: getUsernameForActor(
|
||||
await ensureLoggedInAsync({ nonInteractive: ctx.nonInteractive })
|
||||
),
|
||||
message: ctx.message,
|
||||
|
||||
@@ -9,7 +9,7 @@ import nullthrows from 'nullthrows';
|
||||
import { readAppJson } from '../../build/utils/appJson';
|
||||
import env from '../../env';
|
||||
import Log, { learnMore } from '../../log';
|
||||
import { getProjectConfigDescription, getUsername } from '../../project/projectUtils';
|
||||
import { getProjectConfigDescription, getUsernameForActor } from '../../project/projectUtils';
|
||||
import { promptAsync } from '../../prompts';
|
||||
import { ensureLoggedInAsync } from '../../user/actions';
|
||||
import { resolveWorkflowAsync } from '../workflow';
|
||||
@@ -175,7 +175,7 @@ async function getSuggestedApplicationIdAsync(exp: ExpoConfig): Promise<string |
|
||||
return maybeBundleId;
|
||||
} else {
|
||||
// the only callsite is heavily interactive
|
||||
const username = getUsername(exp, await ensureLoggedInAsync({ nonInteractive: false }));
|
||||
const username = getUsernameForActor(await ensureLoggedInAsync({ nonInteractive: false }));
|
||||
// It's common to use dashes in your node project name, strip them from the suggested package name.
|
||||
const possibleId = `com.${username}.${exp.slug}`.split('-').join('');
|
||||
if (isApplicationIdValid(possibleId)) {
|
||||
|
||||
@@ -9,7 +9,7 @@ import { readAppJson } from '../../build/utils/appJson';
|
||||
import Log, { learnMore } from '../../log';
|
||||
import { promptAsync } from '../../prompts';
|
||||
import { ensureLoggedInAsync } from '../../user/actions';
|
||||
import { getProjectConfigDescription, getUsername } from '../projectUtils';
|
||||
import { getProjectConfigDescription, getUsernameForActor } from '../projectUtils';
|
||||
import { resolveWorkflowAsync } from '../workflow';
|
||||
|
||||
export const INVALID_BUNDLE_IDENTIFIER_MESSAGE = `Invalid format of iOS bundle identifier. Only alphanumeric characters, '.' and '-' are allowed, and each '.' must be followed by a letter.`;
|
||||
@@ -173,7 +173,7 @@ async function getSuggestedBundleIdentifierAsync(exp: ExpoConfig): Promise<strin
|
||||
return maybeAndroidPackage;
|
||||
} else {
|
||||
// the only callsite is heavily interactive
|
||||
const username = getUsername(exp, await ensureLoggedInAsync({ nonInteractive: false }));
|
||||
const username = getUsernameForActor(await ensureLoggedInAsync({ nonInteractive: false }));
|
||||
// It's common to use dashes in your node project name, strip them from the suggested package name.
|
||||
const possibleId = `com.${username}.${exp.slug}`.split('-').join('');
|
||||
if (isBundleIdentifierValid(possibleId)) {
|
||||
|
||||
@@ -18,17 +18,11 @@ import { getVcsClient } from '../vcs';
|
||||
import { getExpoConfig } from './expoConfig';
|
||||
import { fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync } from './fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync';
|
||||
|
||||
export function getUsername(exp: ExpoConfig, user: Actor): string | undefined {
|
||||
export function getUsernameForActor(user: Actor): string | undefined {
|
||||
switch (user.__typename) {
|
||||
case 'User':
|
||||
return user.username;
|
||||
case 'Robot':
|
||||
// owner field is necessary to run `expo prebuild`
|
||||
if (!exp.owner) {
|
||||
throw new Error(
|
||||
'The "owner" manifest property is required when using robot users. See: https://docs.expo.dev/versions/latest/config/app/#owner'
|
||||
);
|
||||
}
|
||||
// robot users don't have usernames
|
||||
return undefined;
|
||||
}
|
||||
|
||||
Reference in new issue
Block a user