eas-cli 12.5.0 → 12.5.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -62
- package/build/build/evaluateConfigWithEnvVarsAsync.d.ts +1 -4
- package/build/build/evaluateConfigWithEnvVarsAsync.js +3 -6
- package/build/build/runBuildAndSubmit.d.ts +0 -2
- package/build/build/runBuildAndSubmit.js +0 -1
- package/build/commandUtils/flags.d.ts +0 -3
- package/build/commandUtils/flags.js +1 -15
- package/build/commands/build/index.d.ts +0 -2
- package/build/commands/build/index.js +0 -2
- package/build/commands/build/resign.d.ts +0 -1
- package/build/commands/build/resign.js +0 -2
- package/build/commands/build/version/get.d.ts +0 -1
- package/build/commands/build/version/get.js +0 -2
- package/build/commands/build/version/set.d.ts +0 -1
- package/build/commands/build/version/set.js +0 -3
- package/build/commands/build/version/sync.d.ts +0 -1
- package/build/commands/build/version/sync.js +0 -3
- package/build/commands/config.d.ts +0 -1
- package/build/commands/config.js +0 -2
- package/build/commands/env/exec.d.ts +23 -0
- package/build/commands/env/exec.js +124 -0
- package/build/commands/update/republish.d.ts +2 -0
- package/build/commands/update/republish.js +34 -4
- package/build/commands/worker/deploy.js +13 -10
- package/build/credentials/manager/Actions.d.ts +4 -2
- package/build/credentials/manager/Actions.js +2 -0
- package/build/credentials/manager/AndroidActions.js +5 -0
- package/build/credentials/manager/IosActions.js +5 -0
- package/build/credentials/manager/ManageAndroid.js +3 -0
- package/build/credentials/manager/ManageIos.js +3 -0
- package/build/graphql/generated.d.ts +16 -7
- package/build/graphql/types/Submission.js +1 -1
- package/build/project/publish.js +3 -2
- package/build/submit/utils/logs.js +16 -17
- package/build/update/getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync.d.ts +5 -0
- package/build/update/{getBranchNameFromChannelNameAsync.js → getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync.js} +8 -7
- package/build/update/republish.js +2 -2
- package/build/utils/prompts.js +3 -3
- package/build/worker/assets.d.ts +1 -1
- package/build/worker/assets.js +4 -2
- package/build/worker/deployment.d.ts +10 -0
- package/build/worker/deployment.js +33 -22
- package/build/worker/upload.js +4 -6
- package/build/worker/utils/logs.d.ts +14 -13
- package/build/worker/utils/logs.js +18 -18
- package/oclif.manifest.json +60 -79
- package/package.json +2 -2
- package/build/update/getBranchNameFromChannelNameAsync.d.ts +0 -2
|
@@ -3030,6 +3030,11 @@ export type DeleteWebhookResult = {
|
|
|
3030
3030
|
__typename?: 'DeleteWebhookResult';
|
|
3031
3031
|
id: Scalars['ID']['output'];
|
|
3032
3032
|
};
|
|
3033
|
+
export type DeleteWorkerDeploymentResult = {
|
|
3034
|
+
__typename?: 'DeleteWorkerDeploymentResult';
|
|
3035
|
+
deploymentIdentifier: Scalars['WorkerDeploymentIdentifier']['output'];
|
|
3036
|
+
id: Scalars['ID']['output'];
|
|
3037
|
+
};
|
|
3033
3038
|
export type DeployServerlessFunctionResult = {
|
|
3034
3039
|
__typename?: 'DeployServerlessFunctionResult';
|
|
3035
3040
|
url: Scalars['String']['output'];
|
|
@@ -3145,6 +3150,7 @@ export type DeploymentsMutation = {
|
|
|
3145
3150
|
/** Create a signed deployment URL */
|
|
3146
3151
|
createSignedDeploymentUrl: DeploymentSignedUrlResult;
|
|
3147
3152
|
deleteAlias: DeleteAliasResult;
|
|
3153
|
+
deleteWorkerDeployment: DeleteWorkerDeploymentResult;
|
|
3148
3154
|
};
|
|
3149
3155
|
export type DeploymentsMutationAssignAliasArgs = {
|
|
3150
3156
|
aliasName?: InputMaybe<Scalars['WorkerDeploymentIdentifier']['input']>;
|
|
@@ -3159,6 +3165,9 @@ export type DeploymentsMutationDeleteAliasArgs = {
|
|
|
3159
3165
|
aliasName?: InputMaybe<Scalars['WorkerDeploymentIdentifier']['input']>;
|
|
3160
3166
|
appId: Scalars['ID']['input'];
|
|
3161
3167
|
};
|
|
3168
|
+
export type DeploymentsMutationDeleteWorkerDeploymentArgs = {
|
|
3169
|
+
workerDeploymentId: Scalars['ID']['input'];
|
|
3170
|
+
};
|
|
3162
3171
|
export type DiscordUser = {
|
|
3163
3172
|
__typename?: 'DiscordUser';
|
|
3164
3173
|
discordIdentifier: Scalars['String']['output'];
|
|
@@ -11033,7 +11042,7 @@ export type CreateAndroidSubmissionMutation = {
|
|
|
11033
11042
|
id: string;
|
|
11034
11043
|
status: SubmissionStatus;
|
|
11035
11044
|
platform: AppPlatform;
|
|
11036
|
-
|
|
11045
|
+
logFiles: Array<string>;
|
|
11037
11046
|
app: {
|
|
11038
11047
|
__typename?: 'App';
|
|
11039
11048
|
id: string;
|
|
@@ -11083,7 +11092,7 @@ export type CreateIosSubmissionMutation = {
|
|
|
11083
11092
|
id: string;
|
|
11084
11093
|
status: SubmissionStatus;
|
|
11085
11094
|
platform: AppPlatform;
|
|
11086
|
-
|
|
11095
|
+
logFiles: Array<string>;
|
|
11087
11096
|
app: {
|
|
11088
11097
|
__typename?: 'App';
|
|
11089
11098
|
id: string;
|
|
@@ -11657,7 +11666,7 @@ export type BuildsWithSubmissionsByIdQuery = {
|
|
|
11657
11666
|
id: string;
|
|
11658
11667
|
status: SubmissionStatus;
|
|
11659
11668
|
platform: AppPlatform;
|
|
11660
|
-
|
|
11669
|
+
logFiles: Array<string>;
|
|
11661
11670
|
app: {
|
|
11662
11671
|
__typename?: 'App';
|
|
11663
11672
|
id: string;
|
|
@@ -12241,7 +12250,7 @@ export type SubmissionsByIdQuery = {
|
|
|
12241
12250
|
id: string;
|
|
12242
12251
|
status: SubmissionStatus;
|
|
12243
12252
|
platform: AppPlatform;
|
|
12244
|
-
|
|
12253
|
+
logFiles: Array<string>;
|
|
12245
12254
|
app: {
|
|
12246
12255
|
__typename?: 'App';
|
|
12247
12256
|
id: string;
|
|
@@ -12292,7 +12301,7 @@ export type GetAllSubmissionsForAppQuery = {
|
|
|
12292
12301
|
id: string;
|
|
12293
12302
|
status: SubmissionStatus;
|
|
12294
12303
|
platform: AppPlatform;
|
|
12295
|
-
|
|
12304
|
+
logFiles: Array<string>;
|
|
12296
12305
|
app: {
|
|
12297
12306
|
__typename?: 'App';
|
|
12298
12307
|
id: string;
|
|
@@ -12892,7 +12901,7 @@ export type BuildWithSubmissionsFragment = {
|
|
|
12892
12901
|
id: string;
|
|
12893
12902
|
status: SubmissionStatus;
|
|
12894
12903
|
platform: AppPlatform;
|
|
12895
|
-
|
|
12904
|
+
logFiles: Array<string>;
|
|
12896
12905
|
app: {
|
|
12897
12906
|
__typename?: 'App';
|
|
12898
12907
|
id: string;
|
|
@@ -13006,7 +13015,7 @@ export type SubmissionFragment = {
|
|
|
13006
13015
|
id: string;
|
|
13007
13016
|
status: SubmissionStatus;
|
|
13008
13017
|
platform: AppPlatform;
|
|
13009
|
-
|
|
13018
|
+
logFiles: Array<string>;
|
|
13010
13019
|
app: {
|
|
13011
13020
|
__typename?: 'App';
|
|
13012
13021
|
id: string;
|
package/build/project/publish.js
CHANGED
|
@@ -25,7 +25,7 @@ const PublishQuery_1 = require("../graphql/queries/PublishQuery");
|
|
|
25
25
|
const log_1 = tslib_1.__importStar(require("../log"));
|
|
26
26
|
const platform_1 = require("../platform");
|
|
27
27
|
const prompts_1 = require("../prompts");
|
|
28
|
-
const
|
|
28
|
+
const getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync_1 = require("../update/getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync");
|
|
29
29
|
const utils_2 = require("../update/utils");
|
|
30
30
|
const uploads_1 = require("../uploads");
|
|
31
31
|
const expoCli_1 = require("../utils/expoCli");
|
|
@@ -383,7 +383,8 @@ async function getBranchNameForCommandAsync({ graphqlClient, projectId, channelN
|
|
|
383
383
|
throw new Error('Cannot specify both --channel and --branch. Specify either --channel, --branch, or --auto.');
|
|
384
384
|
}
|
|
385
385
|
if (channelNameArg) {
|
|
386
|
-
|
|
386
|
+
const { branchName } = await (0, getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync_1.getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync)(graphqlClient, projectId, channelNameArg);
|
|
387
|
+
return branchName;
|
|
387
388
|
}
|
|
388
389
|
if (branchNameArg) {
|
|
389
390
|
return branchNameArg;
|
|
@@ -22,23 +22,22 @@ async function displayLogsAsync(submission, { verbose = false, moreSubmissions =
|
|
|
22
22
|
}
|
|
23
23
|
exports.displayLogsAsync = displayLogsAsync;
|
|
24
24
|
async function downloadAndPrintSubmissionLogsAsync(submission) {
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
log_1.default.log(msgWithPrefix);
|
|
25
|
+
for (const logFile of submission.logFiles) {
|
|
26
|
+
const response = await (0, fetch_1.default)(logFile);
|
|
27
|
+
const logs = parseLogs(await response.text());
|
|
28
|
+
log_1.default.addNewLineIfNone();
|
|
29
|
+
const prefix = chalk_1.default.blueBright('[logs] ');
|
|
30
|
+
for (const { level, msg } of logs) {
|
|
31
|
+
const msgWithPrefix = `${prefix}${msg}`;
|
|
32
|
+
if (level === 'error') {
|
|
33
|
+
log_1.default.error(msgWithPrefix);
|
|
34
|
+
}
|
|
35
|
+
else if (level === 'warn') {
|
|
36
|
+
log_1.default.warn(msgWithPrefix);
|
|
37
|
+
}
|
|
38
|
+
else {
|
|
39
|
+
log_1.default.log(msgWithPrefix);
|
|
40
|
+
}
|
|
42
41
|
}
|
|
43
42
|
}
|
|
44
43
|
}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
|
+
export declare function getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync(graphqlClient: ExpoGraphqlClient, projectId: string, channelName: string): Promise<{
|
|
3
|
+
branchName: string;
|
|
4
|
+
branchId: string;
|
|
5
|
+
}>;
|
|
@@ -1,19 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync = void 0;
|
|
4
4
|
const queries_1 = require("../branch/queries");
|
|
5
5
|
const errors_1 = require("../channel/errors");
|
|
6
6
|
const queries_2 = require("../channel/queries");
|
|
7
7
|
const ChannelQuery_1 = require("../graphql/queries/ChannelQuery");
|
|
8
|
-
async function
|
|
9
|
-
let
|
|
8
|
+
async function getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync(graphqlClient, projectId, channelName) {
|
|
9
|
+
let branchInfo;
|
|
10
10
|
try {
|
|
11
11
|
const channel = await ChannelQuery_1.ChannelQuery.viewUpdateChannelAsync(graphqlClient, {
|
|
12
12
|
appId: projectId,
|
|
13
13
|
channelName,
|
|
14
14
|
});
|
|
15
15
|
if (channel.updateBranches.length === 1) {
|
|
16
|
-
|
|
16
|
+
const branch = channel.updateBranches[0];
|
|
17
|
+
branchInfo = { branchId: branch.id, branchName: branch.name };
|
|
17
18
|
}
|
|
18
19
|
else if (channel.updateBranches.length === 0) {
|
|
19
20
|
throw new Error("Channel has no branches associated with it. Run 'eas channel:edit' to map a branch");
|
|
@@ -38,8 +39,8 @@ async function getBranchNameFromChannelNameAsync(graphqlClient, projectId, chann
|
|
|
38
39
|
if (!newChannel) {
|
|
39
40
|
throw new Error(`Could not create channel with name ${channelName} on project with id ${projectId}`);
|
|
40
41
|
}
|
|
41
|
-
|
|
42
|
+
branchInfo = { branchId, branchName: channelName };
|
|
42
43
|
}
|
|
43
|
-
return
|
|
44
|
+
return branchInfo;
|
|
44
45
|
}
|
|
45
|
-
exports.
|
|
46
|
+
exports.getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync = getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync;
|
|
@@ -26,7 +26,7 @@ async function republishAsync({ graphqlClient, app, updatesToPublish, targetBran
|
|
|
26
26
|
update.branchId === arbitraryUpdate.branchId &&
|
|
27
27
|
update.branchName === arbitraryUpdate.branchName &&
|
|
28
28
|
update.runtimeVersion === arbitraryUpdate.runtimeVersion;
|
|
29
|
-
(0, assert_1.default)(updatesToPublish.every(isSameGroup), 'All updates must belong to the same update group');
|
|
29
|
+
(0, assert_1.default)(updatesToPublish.every(isSameGroup), 'All updates being republished must belong to the same update group');
|
|
30
30
|
(0, assert_1.default)(updatesToPublish.every(u => u.isRollBackToEmbedded) ||
|
|
31
31
|
updatesToPublish.every(u => !u.isRollBackToEmbedded), 'All updates must either be roll back to embedded updates or not');
|
|
32
32
|
const { runtimeVersion } = arbitraryUpdate;
|
|
@@ -44,7 +44,7 @@ async function republishAsync({ graphqlClient, app, updatesToPublish, targetBran
|
|
|
44
44
|
throw new Error('Republished updates must use the same code signing key and algorithm as original update');
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
log_1.default.withTick(`The republished update group will be signed`);
|
|
47
|
+
log_1.default.withTick(`The republished update group will be signed with the same code signing key and algorithm as the original update`);
|
|
48
48
|
}
|
|
49
49
|
const publishIndicator = (0, ora_1.ora)('Republishing...').start();
|
|
50
50
|
let updatesRepublished;
|
package/build/utils/prompts.js
CHANGED
|
@@ -10,9 +10,9 @@ async function promptVariableEnvironmentAsync(nonInteractive) {
|
|
|
10
10
|
throw new Error('The `--environment` flag must be set when running in `--non-interactive` mode.');
|
|
11
11
|
}
|
|
12
12
|
return await (0, prompts_1.selectAsync)('Select environment:', [
|
|
13
|
-
{ title: '
|
|
14
|
-
{ title: '
|
|
15
|
-
{ title: '
|
|
13
|
+
{ title: 'development', value: generated_1.EnvironmentVariableEnvironment.Development },
|
|
14
|
+
{ title: 'preview', value: generated_1.EnvironmentVariableEnvironment.Preview },
|
|
15
|
+
{ title: 'production', value: generated_1.EnvironmentVariableEnvironment.Production },
|
|
16
16
|
]);
|
|
17
17
|
}
|
|
18
18
|
exports.promptVariableEnvironmentAsync = promptVariableEnvironmentAsync;
|
package/build/worker/assets.d.ts
CHANGED
|
@@ -10,7 +10,7 @@ interface AssetMapOptions {
|
|
|
10
10
|
/** Mapping of normalized file paths to a SHA512 hash */
|
|
11
11
|
export type AssetMap = Record<string, string>;
|
|
12
12
|
/** Creates an asset map of a given target path */
|
|
13
|
-
declare function createAssetMapAsync(assetPath
|
|
13
|
+
declare function createAssetMapAsync(assetPath?: string, options?: AssetMapOptions): Promise<AssetMap>;
|
|
14
14
|
export interface Manifest {
|
|
15
15
|
env: Record<string, string | undefined>;
|
|
16
16
|
}
|
package/build/worker/assets.js
CHANGED
|
@@ -65,8 +65,10 @@ function listFilesRecursively(basePath) {
|
|
|
65
65
|
/** Creates an asset map of a given target path */
|
|
66
66
|
async function createAssetMapAsync(assetPath, options) {
|
|
67
67
|
const map = Object.create(null);
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
if (assetPath) {
|
|
69
|
+
for await (const file of listFilesRecursively(assetPath)) {
|
|
70
|
+
map[file.normalizedPath] = await computeSha512HashAsync(file.path, options?.hashOptions);
|
|
71
|
+
}
|
|
70
72
|
}
|
|
71
73
|
return map;
|
|
72
74
|
}
|
|
@@ -10,6 +10,16 @@ export declare function getSignedDeploymentUrlAsync(graphqlClient: ExpoGraphqlCl
|
|
|
10
10
|
/** If the terminal is running in non interactive mode or not */
|
|
11
11
|
nonInteractive?: boolean;
|
|
12
12
|
}): Promise<string>;
|
|
13
|
+
/**
|
|
14
|
+
* Assign a dev domain name to a project.
|
|
15
|
+
* - When running in interactive mode, it will prompt the user with a suggested domain name.
|
|
16
|
+
* - When running in non interactive mode, it will auto-assign the suggested domain name.
|
|
17
|
+
*/
|
|
18
|
+
export declare function assignDevDomainNameAsync({ graphqlClient, appId, nonInteractive, }: {
|
|
19
|
+
graphqlClient: ExpoGraphqlClient;
|
|
20
|
+
appId: string;
|
|
21
|
+
nonInteractive?: boolean;
|
|
22
|
+
}): ReturnType<typeof DeploymentsMutation.assignDevDomainNameAsync>;
|
|
13
23
|
export declare function assignWorkerDeploymentAliasAsync({ graphqlClient, appId, deploymentId, aliasName, }: {
|
|
14
24
|
graphqlClient: ExpoGraphqlClient;
|
|
15
25
|
appId: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.selectWorkerDeploymentOnAppAsync = exports.assignWorkerDeploymentProductionAsync = exports.assignWorkerDeploymentAliasAsync = exports.getSignedDeploymentUrlAsync = void 0;
|
|
3
|
+
exports.selectWorkerDeploymentOnAppAsync = exports.assignWorkerDeploymentProductionAsync = exports.assignWorkerDeploymentAliasAsync = exports.assignDevDomainNameAsync = exports.getSignedDeploymentUrlAsync = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
6
|
const mutations_1 = require("./mutations");
|
|
@@ -19,23 +19,20 @@ async function getSignedDeploymentUrlAsync(graphqlClient, options) {
|
|
|
19
19
|
}
|
|
20
20
|
catch (error) {
|
|
21
21
|
const isMissingDevDomain = error?.graphQLErrors?.some(e => ['APP_NO_DEV_DOMAIN_NAME'].includes(e?.extensions?.errorCode));
|
|
22
|
+
// Throw unexpected errors eagerly
|
|
22
23
|
if (!isMissingDevDomain) {
|
|
23
24
|
throw error;
|
|
24
25
|
}
|
|
25
|
-
|
|
26
|
-
throw new Error('The project URL needs to be set up, but the terminal is running in non-interactive mode.');
|
|
27
|
-
}
|
|
28
|
-
const suggestedDevDomainName = await queries_1.DeploymentsQuery.getSuggestedDevDomainByAppIdAsync(graphqlClient, { appId: options.appId });
|
|
26
|
+
// Ensure the callback is invoked, containing cleanup logic for possible spinners
|
|
29
27
|
options.onSetupDevDomain?.();
|
|
30
|
-
|
|
28
|
+
// Assign the dev domain name by prompting the user
|
|
29
|
+
await assignDevDomainNameAsync({
|
|
31
30
|
graphqlClient,
|
|
32
31
|
appId: options.appId,
|
|
33
|
-
|
|
34
|
-
});
|
|
35
|
-
return await mutations_1.DeploymentsMutation.createSignedDeploymentUrlAsync(graphqlClient, {
|
|
36
|
-
appId: options.appId,
|
|
37
|
-
deploymentIdentifier: options.deploymentIdentifier,
|
|
32
|
+
nonInteractive: options.nonInteractive,
|
|
38
33
|
});
|
|
34
|
+
// Retry creating the signed URL
|
|
35
|
+
return await getSignedDeploymentUrlAsync(graphqlClient, options);
|
|
39
36
|
}
|
|
40
37
|
}
|
|
41
38
|
exports.getSignedDeploymentUrlAsync = getSignedDeploymentUrlAsync;
|
|
@@ -55,14 +52,14 @@ function formatDevDomainName(name = '') {
|
|
|
55
52
|
.replace(DEV_DOMAIN_INVALID_MULTIPLE_HYPHENS, '-')
|
|
56
53
|
.trim();
|
|
57
54
|
}
|
|
58
|
-
async function
|
|
55
|
+
async function promptDevDomainNameAsync(initialDevDomain) {
|
|
59
56
|
const rootDomain = `.${logs_1.EXPO_BASE_DOMAIN}.app`;
|
|
60
57
|
const memoizedFormatDevDomainName = (0, memoize_1.memoize)(formatDevDomainName);
|
|
61
58
|
const { name } = await (0, prompts_1.promptAsync)({
|
|
62
59
|
type: 'text',
|
|
63
60
|
name: 'name',
|
|
64
61
|
message: 'Choose a preview URL for your project:',
|
|
65
|
-
initial,
|
|
62
|
+
initial: initialDevDomain,
|
|
66
63
|
validate: (value) => {
|
|
67
64
|
if (!value) {
|
|
68
65
|
return 'You have to choose a preview URL for your project';
|
|
@@ -95,29 +92,43 @@ async function chooseDevDomainNameAsync({ graphqlClient, appId, initial, }) {
|
|
|
95
92
|
}
|
|
96
93
|
},
|
|
97
94
|
});
|
|
95
|
+
// This should never happen due to the validation, if it does its an error
|
|
98
96
|
if (!name) {
|
|
99
97
|
throw new Error('No preview URL provided, aborting deployment.');
|
|
100
98
|
}
|
|
99
|
+
return name;
|
|
100
|
+
}
|
|
101
|
+
/**
|
|
102
|
+
* Assign a dev domain name to a project.
|
|
103
|
+
* - When running in interactive mode, it will prompt the user with a suggested domain name.
|
|
104
|
+
* - When running in non interactive mode, it will auto-assign the suggested domain name.
|
|
105
|
+
*/
|
|
106
|
+
async function assignDevDomainNameAsync({ graphqlClient, appId, nonInteractive, }) {
|
|
107
|
+
let devDomainName = await queries_1.DeploymentsQuery.getSuggestedDevDomainByAppIdAsync(graphqlClient, {
|
|
108
|
+
appId,
|
|
109
|
+
});
|
|
110
|
+
if (!nonInteractive) {
|
|
111
|
+
devDomainName = await promptDevDomainNameAsync(devDomainName);
|
|
112
|
+
}
|
|
101
113
|
try {
|
|
102
|
-
|
|
114
|
+
return await mutations_1.DeploymentsMutation.assignDevDomainNameAsync(graphqlClient, {
|
|
103
115
|
appId,
|
|
104
|
-
name,
|
|
116
|
+
name: devDomainName,
|
|
105
117
|
});
|
|
106
|
-
if (!success) {
|
|
107
|
-
throw new Error('Failed to assign preview URL');
|
|
108
|
-
}
|
|
109
118
|
}
|
|
110
119
|
catch (error) {
|
|
111
120
|
const isChosenNameTaken = error?.graphQLErrors?.some(e => ['DEV_DOMAIN_NAME_TAKEN'].includes(e?.extensions?.errorCode));
|
|
112
|
-
|
|
113
|
-
log_1.default.error(`The preview URL "${name}" is already taken, choose a different URL.`);
|
|
114
|
-
await chooseDevDomainNameAsync({ graphqlClient, appId, initial });
|
|
115
|
-
}
|
|
121
|
+
// Throw unexpected errors eagerly
|
|
116
122
|
if (!isChosenNameTaken) {
|
|
117
123
|
throw error;
|
|
118
124
|
}
|
|
125
|
+
if (!nonInteractive) {
|
|
126
|
+
log_1.default.error(`The preview URL "${devDomainName}" is already taken, choose a different URL.`);
|
|
127
|
+
}
|
|
128
|
+
return await assignDevDomainNameAsync({ graphqlClient, appId, nonInteractive });
|
|
119
129
|
}
|
|
120
130
|
}
|
|
131
|
+
exports.assignDevDomainNameAsync = assignDevDomainNameAsync;
|
|
121
132
|
async function assignWorkerDeploymentAliasAsync({ graphqlClient, appId, deploymentId, aliasName, }) {
|
|
122
133
|
return await mutations_1.DeploymentsMutation.assignAliasAsync(graphqlClient, {
|
|
123
134
|
appId,
|
package/build/worker/upload.js
CHANGED
|
@@ -126,16 +126,14 @@ async function* batchUploadAsync(uploads) {
|
|
|
126
126
|
}
|
|
127
127
|
yield await Promise.race(queue);
|
|
128
128
|
}
|
|
129
|
+
if (queue.size > 0) {
|
|
130
|
+
controller.abort();
|
|
131
|
+
}
|
|
129
132
|
}
|
|
130
133
|
catch (error) {
|
|
131
|
-
if (
|
|
134
|
+
if (error.name !== 'AbortError') {
|
|
132
135
|
throw error;
|
|
133
136
|
}
|
|
134
137
|
}
|
|
135
|
-
finally {
|
|
136
|
-
if (queue.size > 0) {
|
|
137
|
-
controller.abort();
|
|
138
|
-
}
|
|
139
|
-
}
|
|
140
138
|
}
|
|
141
139
|
exports.batchUploadAsync = batchUploadAsync;
|
|
@@ -8,7 +8,7 @@ type WorkerDeploymentData = {
|
|
|
8
8
|
/** The actual deployment information */
|
|
9
9
|
deployment: Pick<WorkerDeploymentFragment, 'deploymentIdentifier' | 'url'>;
|
|
10
10
|
/** All modified aliases of the deployment, if any */
|
|
11
|
-
aliases?: WorkerDeploymentAliasFragment[];
|
|
11
|
+
aliases?: (WorkerDeploymentAliasFragment | null)[];
|
|
12
12
|
/** The production promoting alias of the deployment, if any */
|
|
13
13
|
production?: WorkerDeploymentAliasFragment | null;
|
|
14
14
|
};
|
|
@@ -16,19 +16,20 @@ export declare function formatWorkerDeploymentTable(data: WorkerDeploymentData):
|
|
|
16
16
|
type WorkerDeploymentOutput = {
|
|
17
17
|
/** The absolute URL to the dashboard on `expo.dev` */
|
|
18
18
|
dashboardUrl: string;
|
|
19
|
-
/** The deployment
|
|
20
|
-
|
|
21
|
-
|
|
19
|
+
/** The deployment identifier */
|
|
20
|
+
identifier: string;
|
|
21
|
+
/** The deployment URL */
|
|
22
|
+
url: string;
|
|
23
|
+
/** Custom aliases, if assigned */
|
|
24
|
+
aliases?: {
|
|
25
|
+
id: string;
|
|
26
|
+
url: string;
|
|
27
|
+
name: string;
|
|
28
|
+
}[];
|
|
29
|
+
/** The production alias, if assigned */
|
|
30
|
+
production?: {
|
|
31
|
+
id: string;
|
|
22
32
|
url: string;
|
|
23
|
-
aliases?: {
|
|
24
|
-
id: string;
|
|
25
|
-
name: string;
|
|
26
|
-
url: string;
|
|
27
|
-
}[];
|
|
28
|
-
production?: {
|
|
29
|
-
id: string;
|
|
30
|
-
url: string;
|
|
31
|
-
};
|
|
32
33
|
};
|
|
33
34
|
};
|
|
34
35
|
export declare function formatWorkerDeploymentJson(data: WorkerDeploymentData): WorkerDeploymentOutput;
|
|
@@ -19,7 +19,10 @@ function formatWorkerDeploymentTable(data) {
|
|
|
19
19
|
{ label: 'Deployment URL', value: data.deployment.url },
|
|
20
20
|
];
|
|
21
21
|
if (data.aliases?.length) {
|
|
22
|
-
|
|
22
|
+
const alias = data.aliases.filter(Boolean)[0];
|
|
23
|
+
if (alias) {
|
|
24
|
+
fields.push({ label: 'Alias URL', value: alias.url });
|
|
25
|
+
}
|
|
23
26
|
}
|
|
24
27
|
if (data.production) {
|
|
25
28
|
fields.push({ label: 'Production URL', value: data.production.url });
|
|
@@ -30,25 +33,22 @@ function formatWorkerDeploymentTable(data) {
|
|
|
30
33
|
}
|
|
31
34
|
exports.formatWorkerDeploymentTable = formatWorkerDeploymentTable;
|
|
32
35
|
function formatWorkerDeploymentJson(data) {
|
|
36
|
+
const aliases = !data.aliases
|
|
37
|
+
? []
|
|
38
|
+
: data.aliases.filter(Boolean);
|
|
33
39
|
return {
|
|
34
40
|
dashboardUrl: getDashboardUrl(data.projectId),
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
? undefined
|
|
47
|
-
: {
|
|
48
|
-
id: data.production.id,
|
|
49
|
-
url: data.production.url,
|
|
50
|
-
},
|
|
51
|
-
},
|
|
41
|
+
identifier: data.deployment.deploymentIdentifier,
|
|
42
|
+
url: data.deployment.url,
|
|
43
|
+
aliases: !aliases.length
|
|
44
|
+
? undefined
|
|
45
|
+
: aliases.map(alias => ({ id: alias.id, url: alias.url, name: alias.aliasName })),
|
|
46
|
+
production: !data.production
|
|
47
|
+
? undefined
|
|
48
|
+
: {
|
|
49
|
+
id: data.production.id,
|
|
50
|
+
url: data.production.url,
|
|
51
|
+
},
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
exports.formatWorkerDeploymentJson = formatWorkerDeploymentJson;
|