eas-cli 2.6.0 → 2.7.0
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 +6 -1133
- package/build/branch/queries.d.ts +8 -1
- package/build/branch/queries.js +50 -1
- package/build/build/android/build.js +1 -0
- package/build/build/ios/build.js +1 -0
- package/build/build/local.js +1 -1
- package/build/build/validate.d.ts +1 -0
- package/build/build/validate.js +121 -1
- package/build/channel/queries.d.ts +11 -0
- package/build/channel/queries.js +46 -1
- package/build/commandUtils/context/contextUtils/getProjectIdAsync.js +1 -1
- package/build/commands/branch/create.d.ts +0 -3
- package/build/commands/branch/create.js +2 -27
- package/build/commands/channel/create.d.ts +0 -7
- package/build/commands/channel/create.js +4 -31
- package/build/commands/update/configure.d.ts +1 -0
- package/build/commands/update/configure.js +10 -218
- package/build/commands/update/index.d.ts +3 -9
- package/build/commands/update/index.js +136 -143
- package/build/graphql/generated.d.ts +26 -17
- package/build/graphql/types/Build.js +1 -0
- package/build/log.d.ts +1 -0
- package/build/log.js +3 -0
- package/build/project/projectUtils.d.ts +3 -1
- package/build/project/projectUtils.js +10 -3
- package/build/project/publish.d.ts +13 -10
- package/build/project/publish.js +68 -38
- package/build/project/workflow.d.ts +1 -0
- package/build/project/workflow.js +9 -1
- package/build/submit/ArchiveSource.js +12 -16
- package/build/update/configure.d.ts +22 -0
- package/build/update/configure.js +200 -0
- package/build/utils/expoCli.d.ts +6 -0
- package/build/utils/expoCli.js +46 -1
- package/build/utils/expodash/memoize.d.ts +2 -0
- package/build/utils/expodash/memoize.js +17 -0
- package/build/utils/image.d.ts +6 -0
- package/build/utils/image.js +107 -0
- package/build/utils/statuspageService.js +1 -0
- package/oclif.manifest.json +1 -1
- package/package.json +7 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
2
|
import { PaginatedQueryOptions } from '../commandUtils/pagination';
|
|
3
|
-
import { UpdateBranchFragment } from '../graphql/generated';
|
|
3
|
+
import { CreateUpdateBranchForAppMutationVariables, UpdateBranch, UpdateBranchFragment } from '../graphql/generated';
|
|
4
4
|
export declare const BRANCHES_LIMIT = 50;
|
|
5
5
|
export declare function selectBranchOnAppAsync(graphqlClient: ExpoGraphqlClient, { projectId, promptTitle, displayTextForListItem, paginatedQueryOptions, }: {
|
|
6
6
|
projectId: string;
|
|
@@ -12,3 +12,10 @@ export declare function listAndRenderBranchesOnAppAsync(graphqlClient: ExpoGraph
|
|
|
12
12
|
projectId: string;
|
|
13
13
|
paginatedQueryOptions: PaginatedQueryOptions;
|
|
14
14
|
}): Promise<void>;
|
|
15
|
+
export declare function createUpdateBranchOnAppAsync(graphqlClient: ExpoGraphqlClient, { appId, name }: CreateUpdateBranchForAppMutationVariables): Promise<Pick<UpdateBranch, 'id' | 'name'>>;
|
|
16
|
+
export declare function ensureBranchExistsAsync(graphqlClient: ExpoGraphqlClient, { appId, branchName, }: {
|
|
17
|
+
appId: string;
|
|
18
|
+
branchName: string;
|
|
19
|
+
}): Promise<{
|
|
20
|
+
branchId: string;
|
|
21
|
+
}>;
|
package/build/branch/queries.js
CHANGED
|
@@ -1,13 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listAndRenderBranchesOnAppAsync = exports.selectBranchOnAppAsync = exports.BRANCHES_LIMIT = void 0;
|
|
3
|
+
exports.ensureBranchExistsAsync = exports.createUpdateBranchOnAppAsync = exports.listAndRenderBranchesOnAppAsync = exports.selectBranchOnAppAsync = exports.BRANCHES_LIMIT = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
7
|
+
const client_1 = require("../graphql/client");
|
|
6
8
|
const BranchQuery_1 = require("../graphql/queries/BranchQuery");
|
|
7
9
|
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
8
10
|
const utils_1 = require("../update/utils");
|
|
9
11
|
const json_1 = require("../utils/json");
|
|
10
12
|
const queries_1 = require("../utils/queries");
|
|
13
|
+
const utils_2 = require("./utils");
|
|
11
14
|
exports.BRANCHES_LIMIT = 50;
|
|
12
15
|
async function selectBranchOnAppAsync(graphqlClient, { projectId, promptTitle, displayTextForListItem, paginatedQueryOptions, }) {
|
|
13
16
|
var _a;
|
|
@@ -69,3 +72,49 @@ function renderPageOfBranches(currentPage, { json }) {
|
|
|
69
72
|
.join(`\n\n${chalk_1.default.dim('———')}\n\n`));
|
|
70
73
|
}
|
|
71
74
|
}
|
|
75
|
+
async function createUpdateBranchOnAppAsync(graphqlClient, { appId, name }) {
|
|
76
|
+
const result = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
77
|
+
.mutation((0, graphql_tag_1.default) `
|
|
78
|
+
mutation CreateUpdateBranchForApp($appId: ID!, $name: String!) {
|
|
79
|
+
updateBranch {
|
|
80
|
+
createUpdateBranchForApp(appId: $appId, name: $name) {
|
|
81
|
+
id
|
|
82
|
+
name
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
`, {
|
|
87
|
+
appId,
|
|
88
|
+
name,
|
|
89
|
+
})
|
|
90
|
+
.toPromise());
|
|
91
|
+
const newBranch = result.updateBranch.createUpdateBranchForApp;
|
|
92
|
+
if (!newBranch) {
|
|
93
|
+
throw new Error(`Could not create branch ${name}.`);
|
|
94
|
+
}
|
|
95
|
+
return newBranch;
|
|
96
|
+
}
|
|
97
|
+
exports.createUpdateBranchOnAppAsync = createUpdateBranchOnAppAsync;
|
|
98
|
+
async function ensureBranchExistsAsync(graphqlClient, { appId, branchName, }) {
|
|
99
|
+
try {
|
|
100
|
+
const updateBranch = await BranchQuery_1.BranchQuery.getBranchByNameAsync(graphqlClient, {
|
|
101
|
+
appId,
|
|
102
|
+
name: branchName,
|
|
103
|
+
});
|
|
104
|
+
const { id } = updateBranch;
|
|
105
|
+
return { branchId: id };
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
if (error instanceof utils_2.BranchNotFoundError) {
|
|
109
|
+
const newUpdateBranch = await createUpdateBranchOnAppAsync(graphqlClient, {
|
|
110
|
+
appId,
|
|
111
|
+
name: branchName,
|
|
112
|
+
});
|
|
113
|
+
return { branchId: newUpdateBranch.id };
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
throw error;
|
|
117
|
+
}
|
|
118
|
+
}
|
|
119
|
+
}
|
|
120
|
+
exports.ensureBranchExistsAsync = ensureBranchExistsAsync;
|
|
@@ -36,6 +36,7 @@ This means that it will most likely produce an AAB and you will not be able to i
|
|
|
36
36
|
}
|
|
37
37
|
(0, validate_1.checkNodeEnvVariable)(ctx);
|
|
38
38
|
await (0, validate_1.checkGoogleServicesFileAsync)(ctx);
|
|
39
|
+
await (0, validate_1.validatePNGsForManagedProjectAsync)(ctx);
|
|
39
40
|
const gradleContext = await (0, gradle_1.resolveGradleBuildContextAsync)(ctx.projectDir, buildProfile);
|
|
40
41
|
if (ctx.workflow === eas_build_job_1.Workflow.MANAGED) {
|
|
41
42
|
await (0, applicationId_1.ensureApplicationIdIsDefinedForManagedProjectAsync)(ctx.projectDir, ctx.exp, ctx.user);
|
package/build/build/ios/build.js
CHANGED
|
@@ -23,6 +23,7 @@ async function createIosContextAsync(ctx) {
|
|
|
23
23
|
}
|
|
24
24
|
(0, validate_1.checkNodeEnvVariable)(ctx);
|
|
25
25
|
await (0, validate_1.checkGoogleServicesFileAsync)(ctx);
|
|
26
|
+
await (0, validate_1.validatePNGsForManagedProjectAsync)(ctx);
|
|
26
27
|
const xcodeBuildContext = await (0, scheme_1.resolveXcodeBuildContextAsync)({
|
|
27
28
|
projectDir: ctx.projectDir,
|
|
28
29
|
nonInteractive: ctx.nonInteractive,
|
package/build/build/local.js
CHANGED
|
@@ -6,7 +6,7 @@ const spawn_async_1 = tslib_1.__importDefault(require("@expo/spawn-async"));
|
|
|
6
6
|
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
7
7
|
const ora_1 = require("../ora");
|
|
8
8
|
const PLUGIN_PACKAGE_NAME = 'eas-cli-local-build-plugin';
|
|
9
|
-
const PLUGIN_PACKAGE_VERSION = '0.0.
|
|
9
|
+
const PLUGIN_PACKAGE_VERSION = '0.0.118';
|
|
10
10
|
async function runLocalBuildAsync(job, metadata, options) {
|
|
11
11
|
var _a;
|
|
12
12
|
const { command, args } = await getCommandAndArgsAsync(job, metadata);
|
|
@@ -2,3 +2,4 @@ import { Platform } from '@expo/eas-build-job';
|
|
|
2
2
|
import { CommonContext } from './context';
|
|
3
3
|
export declare function checkNodeEnvVariable(ctx: CommonContext<Platform>): void;
|
|
4
4
|
export declare function checkGoogleServicesFileAsync<T extends Platform>(ctx: CommonContext<T>): Promise<void>;
|
|
5
|
+
export declare function validatePNGsForManagedProjectAsync<T extends Platform>(ctx: CommonContext<T>): Promise<void>;
|
package/build/build/validate.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.checkGoogleServicesFileAsync = exports.checkNodeEnvVariable = void 0;
|
|
3
|
+
exports.validatePNGsForManagedProjectAsync = exports.checkGoogleServicesFileAsync = exports.checkNodeEnvVariable = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
6
|
+
const core_1 = require("@oclif/core");
|
|
6
7
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
7
8
|
const path_1 = tslib_1.__importDefault(require("path"));
|
|
9
|
+
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
8
10
|
const log_1 = tslib_1.__importStar(require("../log"));
|
|
11
|
+
const image_1 = require("../utils/image");
|
|
9
12
|
const vcs_1 = require("../vcs");
|
|
10
13
|
function checkNodeEnvVariable(ctx) {
|
|
11
14
|
var _a;
|
|
@@ -39,3 +42,120 @@ exports.checkGoogleServicesFileAsync = checkGoogleServicesFileAsync;
|
|
|
39
42
|
function isInsideDirectory(file, directory) {
|
|
40
43
|
return file.startsWith(directory);
|
|
41
44
|
}
|
|
45
|
+
async function validatePNGsForManagedProjectAsync(ctx) {
|
|
46
|
+
if (ctx.workflow !== eas_build_job_1.Workflow.MANAGED) {
|
|
47
|
+
return;
|
|
48
|
+
}
|
|
49
|
+
// don't run PNG checks on SDK 47 and newer
|
|
50
|
+
// see https://github.com/expo/eas-cli/pull/1477#issuecomment-1293914917
|
|
51
|
+
if (!ctx.exp.sdkVersion || semver_1.default.satisfies(ctx.exp.sdkVersion, '>= 47.0.0')) {
|
|
52
|
+
return;
|
|
53
|
+
}
|
|
54
|
+
if (ctx.platform === eas_build_job_1.Platform.ANDROID) {
|
|
55
|
+
await validateAndroidPNGsAsync(ctx);
|
|
56
|
+
}
|
|
57
|
+
// Validating iOS PNGs is currently disabled
|
|
58
|
+
// See https://github.com/expo/eas-cli/pull/1477 for context
|
|
59
|
+
//
|
|
60
|
+
// else {
|
|
61
|
+
// await validateIosPNGsAsync(ctx as CommonContext<Platform.IOS>);
|
|
62
|
+
// }
|
|
63
|
+
}
|
|
64
|
+
exports.validatePNGsForManagedProjectAsync = validatePNGsForManagedProjectAsync;
|
|
65
|
+
async function validateAndroidPNGsAsync(ctx) {
|
|
66
|
+
var _a, _b, _c, _d, _e, _f, _g;
|
|
67
|
+
const pngs = [
|
|
68
|
+
{
|
|
69
|
+
configPath: 'exp.icon',
|
|
70
|
+
pngPath: ctx.exp.icon,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
configPath: 'exp.android.icon',
|
|
74
|
+
pngPath: (_a = ctx.exp.android) === null || _a === void 0 ? void 0 : _a.icon,
|
|
75
|
+
},
|
|
76
|
+
{
|
|
77
|
+
configPath: 'exp.android.adaptiveIcon.foregroundImage',
|
|
78
|
+
pngPath: (_c = (_b = ctx.exp.android) === null || _b === void 0 ? void 0 : _b.adaptiveIcon) === null || _c === void 0 ? void 0 : _c.foregroundImage,
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
configPath: 'exp.android.adaptiveIcon.backgroundImage',
|
|
82
|
+
pngPath: (_e = (_d = ctx.exp.android) === null || _d === void 0 ? void 0 : _d.adaptiveIcon) === null || _e === void 0 ? void 0 : _e.backgroundImage,
|
|
83
|
+
},
|
|
84
|
+
{
|
|
85
|
+
configPath: 'exp.splash.image',
|
|
86
|
+
pngPath: (_f = ctx.exp.splash) === null || _f === void 0 ? void 0 : _f.image,
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
configPath: 'exp.notification.icon',
|
|
90
|
+
pngPath: (_g = ctx.exp.notification) === null || _g === void 0 ? void 0 : _g.icon,
|
|
91
|
+
},
|
|
92
|
+
];
|
|
93
|
+
await validatePNGsAsync(pngs);
|
|
94
|
+
}
|
|
95
|
+
// Validating iOS PNGs is currently disabled
|
|
96
|
+
// See https://github.com/expo/eas-cli/pull/1477 for context
|
|
97
|
+
//
|
|
98
|
+
// async function validateIosPNGsAsync(ctx: CommonContext<Platform.IOS>): Promise<void> {
|
|
99
|
+
// const pngs: ConfigPng[] = [
|
|
100
|
+
// {
|
|
101
|
+
// configPath: 'exp.icon',
|
|
102
|
+
// pngPath: ctx.exp.icon,
|
|
103
|
+
// },
|
|
104
|
+
// {
|
|
105
|
+
// configPath: 'exp.ios.icon',
|
|
106
|
+
// pngPath: ctx.exp.ios?.icon,
|
|
107
|
+
// },
|
|
108
|
+
// {
|
|
109
|
+
// configPath: 'exp.splash.image',
|
|
110
|
+
// pngPath: ctx.exp.splash?.image,
|
|
111
|
+
// },
|
|
112
|
+
// {
|
|
113
|
+
// configPath: 'exp.notification.icon',
|
|
114
|
+
// pngPath: ctx.exp.notification?.icon,
|
|
115
|
+
// },
|
|
116
|
+
// ];
|
|
117
|
+
// await validatePNGsAsync(pngs);
|
|
118
|
+
// const icon = ctx.exp.ios?.icon ?? ctx.exp.icon;
|
|
119
|
+
// if (!icon) {
|
|
120
|
+
// return;
|
|
121
|
+
// }
|
|
122
|
+
// const iconConfigPath = `expo${ctx.exp.ios?.icon ? '.ios' : ''}.icon`;
|
|
123
|
+
// try {
|
|
124
|
+
// await ensurePNGIsNotTransparentAsync(icon);
|
|
125
|
+
// } catch (err: any) {
|
|
126
|
+
// if (err instanceof ImageTransparencyError) {
|
|
127
|
+
// Log.error(
|
|
128
|
+
// `Your iOS app icon (${iconConfigPath}) can't have transparency if you wish to upload your app to the Apple App Store.`
|
|
129
|
+
// );
|
|
130
|
+
// Log.error(learnMore('https://expo.fyi/remove-alpha-channel', { dim: false }));
|
|
131
|
+
// Errors.exit(1);
|
|
132
|
+
// } else {
|
|
133
|
+
// throw err;
|
|
134
|
+
// }
|
|
135
|
+
// }
|
|
136
|
+
// }
|
|
137
|
+
async function validatePNGsAsync(configPngs) {
|
|
138
|
+
const validationPromises = configPngs.map(configPng => validatePNGAsync(configPng));
|
|
139
|
+
const validationResults = await Promise.allSettled(validationPromises);
|
|
140
|
+
const failedValidations = validationResults.filter((result) => result.status === 'rejected');
|
|
141
|
+
if (failedValidations.length === 0) {
|
|
142
|
+
return;
|
|
143
|
+
}
|
|
144
|
+
log_1.default.error('PNG images validation failed:');
|
|
145
|
+
for (const { reason } of failedValidations) {
|
|
146
|
+
const error = reason;
|
|
147
|
+
log_1.default.error(`- ${error.message}`);
|
|
148
|
+
}
|
|
149
|
+
core_1.Errors.exit(1);
|
|
150
|
+
}
|
|
151
|
+
async function validatePNGAsync({ configPath, pngPath }) {
|
|
152
|
+
if (!pngPath) {
|
|
153
|
+
return;
|
|
154
|
+
}
|
|
155
|
+
if (!pngPath.endsWith('.png')) {
|
|
156
|
+
throw new Error(`"${configPath}" is not a PNG file`);
|
|
157
|
+
}
|
|
158
|
+
if (!(await (0, image_1.isPNGAsync)(pngPath))) {
|
|
159
|
+
throw new Error(`"${configPath}" is not valid PNG`);
|
|
160
|
+
}
|
|
161
|
+
}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
|
|
2
2
|
import { PaginatedQueryOptions } from '../commandUtils/pagination';
|
|
3
|
+
import { CreateUpdateChannelOnAppMutation } from '../graphql/generated';
|
|
3
4
|
import { UpdateChannelObject } from '../graphql/queries/ChannelQuery';
|
|
4
5
|
export declare const CHANNELS_LIMIT = 25;
|
|
5
6
|
export declare function selectChannelOnAppAsync(graphqlClient: ExpoGraphqlClient, { projectId, selectionPromptTitle, paginatedQueryOptions, }: {
|
|
@@ -16,3 +17,13 @@ export declare function listAndRenderBranchesAndUpdatesOnChannelAsync(graphqlCli
|
|
|
16
17
|
channelName: string;
|
|
17
18
|
paginatedQueryOptions: PaginatedQueryOptions;
|
|
18
19
|
}): Promise<void>;
|
|
20
|
+
export declare function createChannelOnAppAsync(graphqlClient: ExpoGraphqlClient, { appId, branchId, channelName, }: {
|
|
21
|
+
appId: string;
|
|
22
|
+
branchId: string;
|
|
23
|
+
channelName: string;
|
|
24
|
+
}): Promise<CreateUpdateChannelOnAppMutation>;
|
|
25
|
+
export declare function ensureChannelExistsAsync(graphqlClient: ExpoGraphqlClient, { appId, branchId, channelName }: {
|
|
26
|
+
appId: string;
|
|
27
|
+
branchId: string;
|
|
28
|
+
channelName: string;
|
|
29
|
+
}): Promise<void>;
|
package/build/channel/queries.js
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listAndRenderBranchesAndUpdatesOnChannelAsync = exports.listAndRenderChannelsOnAppAsync = exports.selectChannelOnAppAsync = exports.CHANNELS_LIMIT = void 0;
|
|
3
|
+
exports.ensureChannelExistsAsync = exports.createChannelOnAppAsync = exports.listAndRenderBranchesAndUpdatesOnChannelAsync = exports.listAndRenderChannelsOnAppAsync = exports.selectChannelOnAppAsync = exports.CHANNELS_LIMIT = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
6
|
+
const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
|
|
7
|
+
const client_1 = require("../graphql/client");
|
|
6
8
|
const BranchQuery_1 = require("../graphql/queries/BranchQuery");
|
|
7
9
|
const ChannelQuery_1 = require("../graphql/queries/ChannelQuery");
|
|
8
10
|
const log_1 = tslib_1.__importDefault(require("../log"));
|
|
@@ -132,3 +134,46 @@ function renderChannelHeaderContent({ channelName, channelId, }) {
|
|
|
132
134
|
log_1.default.addNewLineIfNone();
|
|
133
135
|
log_1.default.log((0, chalk_1.default) `{bold Branches pointed at this channel and their most recent update group:}`);
|
|
134
136
|
}
|
|
137
|
+
async function createChannelOnAppAsync(graphqlClient, { appId, branchId, channelName, }) {
|
|
138
|
+
// Point the new channel at a branch with its same name.
|
|
139
|
+
const branchMapping = JSON.stringify({
|
|
140
|
+
data: [{ branchId, branchMappingLogic: 'true' }],
|
|
141
|
+
version: 0,
|
|
142
|
+
});
|
|
143
|
+
return await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
144
|
+
.mutation((0, graphql_tag_1.default) `
|
|
145
|
+
mutation CreateUpdateChannelOnApp($appId: ID!, $name: String!, $branchMapping: String!) {
|
|
146
|
+
updateChannel {
|
|
147
|
+
createUpdateChannelForApp(appId: $appId, name: $name, branchMapping: $branchMapping) {
|
|
148
|
+
id
|
|
149
|
+
name
|
|
150
|
+
branchMapping
|
|
151
|
+
}
|
|
152
|
+
}
|
|
153
|
+
}
|
|
154
|
+
`, {
|
|
155
|
+
appId,
|
|
156
|
+
name: channelName,
|
|
157
|
+
branchMapping,
|
|
158
|
+
})
|
|
159
|
+
.toPromise());
|
|
160
|
+
}
|
|
161
|
+
exports.createChannelOnAppAsync = createChannelOnAppAsync;
|
|
162
|
+
async function ensureChannelExistsAsync(graphqlClient, { appId, branchId, channelName }) {
|
|
163
|
+
var _a;
|
|
164
|
+
try {
|
|
165
|
+
await createChannelOnAppAsync(graphqlClient, {
|
|
166
|
+
appId,
|
|
167
|
+
channelName,
|
|
168
|
+
branchId,
|
|
169
|
+
});
|
|
170
|
+
}
|
|
171
|
+
catch (e) {
|
|
172
|
+
const isIgnorableError = ((_a = e.graphQLErrors) === null || _a === void 0 ? void 0 : _a.length) === 1 &&
|
|
173
|
+
e.graphQLErrors[0].extensions.errorCode === 'CHANNEL_ALREADY_EXISTS';
|
|
174
|
+
if (!isIgnorableError) {
|
|
175
|
+
throw e;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
exports.ensureChannelExistsAsync = ensureChannelExistsAsync;
|
|
@@ -22,7 +22,7 @@ async function saveProjectIdToAppConfigAsync(projectDir, projectId, options = {}
|
|
|
22
22
|
const exp = (0, expoConfig_1.getExpoConfig)(projectDir, options);
|
|
23
23
|
const result = await (0, config_1.modifyConfigAsync)(projectDir, {
|
|
24
24
|
extra: { ...exp.extra, eas: { ...(_a = exp.extra) === null || _a === void 0 ? void 0 : _a.eas, projectId } },
|
|
25
|
-
});
|
|
25
|
+
}, { skipSDKVersionRequirement: true });
|
|
26
26
|
switch (result.type) {
|
|
27
27
|
case 'success':
|
|
28
28
|
break;
|
|
@@ -1,7 +1,4 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
-
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
3
|
-
import { CreateUpdateBranchForAppMutationVariables, UpdateBranch } from '../../graphql/generated';
|
|
4
|
-
export declare function createUpdateBranchOnAppAsync(graphqlClient: ExpoGraphqlClient, { appId, name }: CreateUpdateBranchForAppMutationVariables): Promise<Pick<UpdateBranch, 'id' | 'name'>>;
|
|
5
2
|
export default class BranchCreate extends EasCommand {
|
|
6
3
|
static description: string;
|
|
7
4
|
static args: {
|
|
@@ -1,41 +1,16 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.createUpdateBranchOnAppAsync = void 0;
|
|
5
4
|
const tslib_1 = require("tslib");
|
|
6
5
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
-
const
|
|
6
|
+
const queries_1 = require("../../branch/queries");
|
|
8
7
|
const utils_1 = require("../../branch/utils");
|
|
9
8
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
10
9
|
const flags_1 = require("../../commandUtils/flags");
|
|
11
|
-
const client_1 = require("../../graphql/client");
|
|
12
10
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
13
11
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
14
12
|
const prompts_1 = require("../../prompts");
|
|
15
13
|
const json_1 = require("../../utils/json");
|
|
16
|
-
async function createUpdateBranchOnAppAsync(graphqlClient, { appId, name }) {
|
|
17
|
-
const result = await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
18
|
-
.mutation((0, graphql_tag_1.default) `
|
|
19
|
-
mutation createUpdateBranchForApp($appId: ID!, $name: String!) {
|
|
20
|
-
updateBranch {
|
|
21
|
-
createUpdateBranchForApp(appId: $appId, name: $name) {
|
|
22
|
-
id
|
|
23
|
-
name
|
|
24
|
-
}
|
|
25
|
-
}
|
|
26
|
-
}
|
|
27
|
-
`, {
|
|
28
|
-
appId,
|
|
29
|
-
name,
|
|
30
|
-
})
|
|
31
|
-
.toPromise());
|
|
32
|
-
const newBranch = result.updateBranch.createUpdateBranchForApp;
|
|
33
|
-
if (!newBranch) {
|
|
34
|
-
throw new Error(`Could not create branch ${name}.`);
|
|
35
|
-
}
|
|
36
|
-
return newBranch;
|
|
37
|
-
}
|
|
38
|
-
exports.createUpdateBranchOnAppAsync = createUpdateBranchOnAppAsync;
|
|
39
14
|
class BranchCreate extends EasCommand_1.default {
|
|
40
15
|
async runAsync() {
|
|
41
16
|
let { args: { name }, flags: { json: jsonFlag, 'non-interactive': nonInteractive }, } = await this.parse(BranchCreate);
|
|
@@ -59,7 +34,7 @@ class BranchCreate extends EasCommand_1.default {
|
|
|
59
34
|
validate: value => (value ? true : validationMessage),
|
|
60
35
|
}));
|
|
61
36
|
}
|
|
62
|
-
const newBranch = await createUpdateBranchOnAppAsync(graphqlClient, { appId: projectId, name });
|
|
37
|
+
const newBranch = await (0, queries_1.createUpdateBranchOnAppAsync)(graphqlClient, { appId: projectId, name });
|
|
63
38
|
if (jsonFlag) {
|
|
64
39
|
(0, json_1.printJsonOnlyOutput)(newBranch);
|
|
65
40
|
}
|
|
@@ -1,11 +1,4 @@
|
|
|
1
1
|
import EasCommand from '../../commandUtils/EasCommand';
|
|
2
|
-
import { ExpoGraphqlClient } from '../../commandUtils/context/contextUtils/createGraphqlClient';
|
|
3
|
-
import { CreateUpdateChannelOnAppMutation } from '../../graphql/generated';
|
|
4
|
-
export declare function createUpdateChannelOnAppAsync(graphqlClient: ExpoGraphqlClient, { appId, channelName, branchId, }: {
|
|
5
|
-
appId: string;
|
|
6
|
-
channelName: string;
|
|
7
|
-
branchId: string;
|
|
8
|
-
}): Promise<CreateUpdateChannelOnAppMutation>;
|
|
9
2
|
export default class ChannelCreate extends EasCommand {
|
|
10
3
|
static description: string;
|
|
11
4
|
static args: {
|
|
@@ -1,46 +1,19 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.createUpdateChannelOnAppAsync = void 0;
|
|
5
4
|
const tslib_1 = require("tslib");
|
|
6
5
|
const chalk_1 = tslib_1.__importDefault(require("chalk"));
|
|
7
|
-
const
|
|
6
|
+
const queries_1 = require("../../branch/queries");
|
|
8
7
|
const utils_1 = require("../../branch/utils");
|
|
8
|
+
const queries_2 = require("../../channel/queries");
|
|
9
9
|
const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
|
|
10
10
|
const flags_1 = require("../../commandUtils/flags");
|
|
11
|
-
const client_1 = require("../../graphql/client");
|
|
12
11
|
const BranchQuery_1 = require("../../graphql/queries/BranchQuery");
|
|
13
12
|
const log_1 = tslib_1.__importDefault(require("../../log"));
|
|
14
13
|
const projectUtils_1 = require("../../project/projectUtils");
|
|
15
14
|
const prompts_1 = require("../../prompts");
|
|
16
15
|
const formatFields_1 = tslib_1.__importDefault(require("../../utils/formatFields"));
|
|
17
16
|
const json_1 = require("../../utils/json");
|
|
18
|
-
const create_1 = require("../branch/create");
|
|
19
|
-
async function createUpdateChannelOnAppAsync(graphqlClient, { appId, channelName, branchId, }) {
|
|
20
|
-
// Point the new channel at a branch with its same name.
|
|
21
|
-
const branchMapping = JSON.stringify({
|
|
22
|
-
data: [{ branchId, branchMappingLogic: 'true' }],
|
|
23
|
-
version: 0,
|
|
24
|
-
});
|
|
25
|
-
return await (0, client_1.withErrorHandlingAsync)(graphqlClient
|
|
26
|
-
.mutation((0, graphql_tag_1.default) `
|
|
27
|
-
mutation CreateUpdateChannelOnApp($appId: ID!, $name: String!, $branchMapping: String!) {
|
|
28
|
-
updateChannel {
|
|
29
|
-
createUpdateChannelForApp(appId: $appId, name: $name, branchMapping: $branchMapping) {
|
|
30
|
-
id
|
|
31
|
-
name
|
|
32
|
-
branchMapping
|
|
33
|
-
}
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
`, {
|
|
37
|
-
appId,
|
|
38
|
-
name: channelName,
|
|
39
|
-
branchMapping,
|
|
40
|
-
})
|
|
41
|
-
.toPromise());
|
|
42
|
-
}
|
|
43
|
-
exports.createUpdateChannelOnAppAsync = createUpdateChannelOnAppAsync;
|
|
44
17
|
class ChannelCreate extends EasCommand_1.default {
|
|
45
18
|
async runAsync() {
|
|
46
19
|
let { args: { name: channelName }, flags: { json: jsonFlag, 'non-interactive': nonInteractive }, } = await this.parse(ChannelCreate);
|
|
@@ -74,7 +47,7 @@ class ChannelCreate extends EasCommand_1.default {
|
|
|
74
47
|
}
|
|
75
48
|
catch (error) {
|
|
76
49
|
if (error instanceof utils_1.BranchNotFoundError) {
|
|
77
|
-
const newBranch = await (0,
|
|
50
|
+
const newBranch = await (0, queries_1.createUpdateBranchOnAppAsync)(graphqlClient, {
|
|
78
51
|
appId: projectId,
|
|
79
52
|
name: channelName,
|
|
80
53
|
});
|
|
@@ -85,7 +58,7 @@ class ChannelCreate extends EasCommand_1.default {
|
|
|
85
58
|
throw error;
|
|
86
59
|
}
|
|
87
60
|
}
|
|
88
|
-
const { updateChannel: { createUpdateChannelForApp: newChannel }, } = await
|
|
61
|
+
const { updateChannel: { createUpdateChannelForApp: newChannel }, } = await (0, queries_2.createChannelOnAppAsync)(graphqlClient, {
|
|
89
62
|
appId: projectId,
|
|
90
63
|
channelName,
|
|
91
64
|
branchId,
|
|
@@ -2,6 +2,7 @@ import EasCommand from '../../commandUtils/EasCommand';
|
|
|
2
2
|
export default class UpdateConfigure extends EasCommand {
|
|
3
3
|
static description: string;
|
|
4
4
|
static flags: {
|
|
5
|
+
'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
|
|
5
6
|
platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
|
|
6
7
|
};
|
|
7
8
|
static contextDefinition: {
|