mirror of
https://github.com/expo/eas-cli.git
synced 2026-11-15 03:38:08 -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 slash from 'slash';
|
||||||
|
|
||||||
import { AndroidCredentials } from '../../credentials/android/AndroidCredentialsProvider';
|
import { AndroidCredentials } from '../../credentials/android/AndroidCredentialsProvider';
|
||||||
import { getUsername } from '../../project/projectUtils';
|
import { getUsernameForActor } from '../../project/projectUtils';
|
||||||
import { ensureLoggedInAsync } from '../../user/actions';
|
import { ensureLoggedInAsync } from '../../user/actions';
|
||||||
import { getVcsClient } from '../../vcs';
|
import { getVcsClient } from '../../vcs';
|
||||||
import { BuildContext } from '../context';
|
import { BuildContext } from '../context';
|
||||||
@@ -24,8 +24,7 @@ export async function prepareJobAsync(
|
|||||||
ctx: BuildContext<Platform.ANDROID>,
|
ctx: BuildContext<Platform.ANDROID>,
|
||||||
jobData: JobData
|
jobData: JobData
|
||||||
): Promise<Job> {
|
): Promise<Job> {
|
||||||
const username = getUsername(
|
const username = getUsernameForActor(
|
||||||
ctx.exp,
|
|
||||||
await ensureLoggedInAsync({ nonInteractive: ctx.nonInteractive })
|
await ensureLoggedInAsync({ nonInteractive: ctx.nonInteractive })
|
||||||
);
|
);
|
||||||
const buildProfile: BuildProfile<Platform.ANDROID> = ctx.buildProfile;
|
const buildProfile: BuildProfile<Platform.ANDROID> = ctx.buildProfile;
|
||||||
|
|||||||
@@ -3,7 +3,7 @@ import path from 'path';
|
|||||||
import slash from 'slash';
|
import slash from 'slash';
|
||||||
|
|
||||||
import { IosCredentials, TargetCredentials } from '../../credentials/ios/types';
|
import { IosCredentials, TargetCredentials } from '../../credentials/ios/types';
|
||||||
import { getUsername } from '../../project/projectUtils';
|
import { getUsernameForActor } from '../../project/projectUtils';
|
||||||
import { ensureLoggedInAsync } from '../../user/actions';
|
import { ensureLoggedInAsync } from '../../user/actions';
|
||||||
import { getVcsClient } from '../../vcs';
|
import { getVcsClient } from '../../vcs';
|
||||||
import { BuildContext } from '../context';
|
import { BuildContext } from '../context';
|
||||||
@@ -26,8 +26,7 @@ export async function prepareJobAsync(
|
|||||||
): Promise<Job> {
|
): Promise<Job> {
|
||||||
const projectRootDirectory =
|
const projectRootDirectory =
|
||||||
slash(path.relative(await getVcsClient().getRootPathAsync(), ctx.projectDir)) || '.';
|
slash(path.relative(await getVcsClient().getRootPathAsync(), ctx.projectDir)) || '.';
|
||||||
const username = getUsername(
|
const username = getUsernameForActor(
|
||||||
ctx.exp,
|
|
||||||
await ensureLoggedInAsync({ nonInteractive: ctx.nonInteractive })
|
await ensureLoggedInAsync({ nonInteractive: ctx.nonInteractive })
|
||||||
);
|
);
|
||||||
const buildCredentials: Ios.Job['secrets']['buildCredentials'] = {};
|
const buildCredentials: Ios.Job['secrets']['buildCredentials'] = {};
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import fs from 'fs-extra';
|
|||||||
import resolveFrom from 'resolve-from';
|
import resolveFrom from 'resolve-from';
|
||||||
|
|
||||||
import Log from '../log';
|
import Log from '../log';
|
||||||
import { getUsername, isExpoUpdatesInstalled } from '../project/projectUtils';
|
import { getUsernameForActor, isExpoUpdatesInstalled } from '../project/projectUtils';
|
||||||
import {
|
import {
|
||||||
readChannelSafelyAsync as readAndroidChannelSafelyAsync,
|
readChannelSafelyAsync as readAndroidChannelSafelyAsync,
|
||||||
readReleaseChannelSafelyAsync as readAndroidReleaseChannelSafelyAsync,
|
readReleaseChannelSafelyAsync as readAndroidReleaseChannelSafelyAsync,
|
||||||
@@ -49,8 +49,7 @@ export async function collectMetadataAsync<T extends Platform>(
|
|||||||
(await vcsClient.getLastCommitMessageAsync()) ?? undefined
|
(await vcsClient.getLastCommitMessageAsync()) ?? undefined
|
||||||
),
|
),
|
||||||
isGitWorkingTreeDirty: await vcsClient.hasUncommittedChangesAsync(),
|
isGitWorkingTreeDirty: await vcsClient.hasUncommittedChangesAsync(),
|
||||||
username: getUsername(
|
username: getUsernameForActor(
|
||||||
ctx.exp,
|
|
||||||
await ensureLoggedInAsync({ nonInteractive: ctx.nonInteractive })
|
await ensureLoggedInAsync({ nonInteractive: ctx.nonInteractive })
|
||||||
),
|
),
|
||||||
message: ctx.message,
|
message: ctx.message,
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import nullthrows from 'nullthrows';
|
|||||||
import { readAppJson } from '../../build/utils/appJson';
|
import { readAppJson } from '../../build/utils/appJson';
|
||||||
import env from '../../env';
|
import env from '../../env';
|
||||||
import Log, { learnMore } from '../../log';
|
import Log, { learnMore } from '../../log';
|
||||||
import { getProjectConfigDescription, getUsername } from '../../project/projectUtils';
|
import { getProjectConfigDescription, getUsernameForActor } from '../../project/projectUtils';
|
||||||
import { promptAsync } from '../../prompts';
|
import { promptAsync } from '../../prompts';
|
||||||
import { ensureLoggedInAsync } from '../../user/actions';
|
import { ensureLoggedInAsync } from '../../user/actions';
|
||||||
import { resolveWorkflowAsync } from '../workflow';
|
import { resolveWorkflowAsync } from '../workflow';
|
||||||
@@ -175,7 +175,7 @@ async function getSuggestedApplicationIdAsync(exp: ExpoConfig): Promise<string |
|
|||||||
return maybeBundleId;
|
return maybeBundleId;
|
||||||
} else {
|
} else {
|
||||||
// the only callsite is heavily interactive
|
// 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.
|
// 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('');
|
const possibleId = `com.${username}.${exp.slug}`.split('-').join('');
|
||||||
if (isApplicationIdValid(possibleId)) {
|
if (isApplicationIdValid(possibleId)) {
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ import { readAppJson } from '../../build/utils/appJson';
|
|||||||
import Log, { learnMore } from '../../log';
|
import Log, { learnMore } from '../../log';
|
||||||
import { promptAsync } from '../../prompts';
|
import { promptAsync } from '../../prompts';
|
||||||
import { ensureLoggedInAsync } from '../../user/actions';
|
import { ensureLoggedInAsync } from '../../user/actions';
|
||||||
import { getProjectConfigDescription, getUsername } from '../projectUtils';
|
import { getProjectConfigDescription, getUsernameForActor } from '../projectUtils';
|
||||||
import { resolveWorkflowAsync } from '../workflow';
|
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.`;
|
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;
|
return maybeAndroidPackage;
|
||||||
} else {
|
} else {
|
||||||
// the only callsite is heavily interactive
|
// 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.
|
// 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('');
|
const possibleId = `com.${username}.${exp.slug}`.split('-').join('');
|
||||||
if (isBundleIdentifierValid(possibleId)) {
|
if (isBundleIdentifierValid(possibleId)) {
|
||||||
|
|||||||
@@ -18,17 +18,11 @@ import { getVcsClient } from '../vcs';
|
|||||||
import { getExpoConfig } from './expoConfig';
|
import { getExpoConfig } from './expoConfig';
|
||||||
import { fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync } from './fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync';
|
import { fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync } from './fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync';
|
||||||
|
|
||||||
export function getUsername(exp: ExpoConfig, user: Actor): string | undefined {
|
export function getUsernameForActor(user: Actor): string | undefined {
|
||||||
switch (user.__typename) {
|
switch (user.__typename) {
|
||||||
case 'User':
|
case 'User':
|
||||||
return user.username;
|
return user.username;
|
||||||
case 'Robot':
|
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
|
// robot users don't have usernames
|
||||||
return undefined;
|
return undefined;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in new issue
Block a user