eas-cli 12.4.1 → 12.5.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.
@@ -3,14 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.getPublicExpoConfig = exports.isUsingStaticExpoConfig = exports.ensureExpoConfigExists = exports.getPrivateExpoConfig = exports.createOrModifyExpoConfigAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_1 = require("@expo/config");
6
- const json_file_1 = tslib_1.__importDefault(require("@expo/json-file"));
7
6
  const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
8
7
  const joi_1 = tslib_1.__importDefault(require("joi"));
9
- const nullthrows_1 = tslib_1.__importDefault(require("nullthrows"));
10
8
  const path_1 = tslib_1.__importDefault(require("path"));
11
9
  async function createOrModifyExpoConfigAsync(projectDir, exp, readOptions) {
12
10
  ensureExpoConfigExists(projectDir);
13
- await ensureStaticExpoConfigIsValidAsync(projectDir);
14
11
  if (readOptions) {
15
12
  return await (0, config_1.modifyConfigAsync)(projectDir, exp, readOptions);
16
13
  }
@@ -68,18 +65,6 @@ function ensureExpoConfigExists(projectDir) {
68
65
  }
69
66
  }
70
67
  exports.ensureExpoConfigExists = ensureExpoConfigExists;
71
- async function ensureStaticExpoConfigIsValidAsync(projectDir) {
72
- if (isUsingStaticExpoConfig(projectDir)) {
73
- const staticConfigPath = (0, nullthrows_1.default)((0, config_1.getConfigFilePaths)(projectDir).staticConfigPath);
74
- const staticConfig = await json_file_1.default.readAsync(staticConfigPath);
75
- // Add the "expo" key if it doesn't exist on app.json yet, such as in
76
- // projects initialized with RNC CLI
77
- if (!staticConfig?.expo) {
78
- staticConfig.expo = {};
79
- await json_file_1.default.writeAsync(staticConfigPath, staticConfig);
80
- }
81
- }
82
- }
83
68
  function isUsingStaticExpoConfig(projectDir) {
84
69
  const paths = (0, config_1.getConfigFilePaths)(projectDir);
85
70
  return !!(paths.staticConfigPath?.endsWith('app.json') && !paths.dynamicConfigPath);
@@ -39,12 +39,12 @@ class AmbiguousBundleIdentifierError extends Error {
39
39
  }
40
40
  exports.AmbiguousBundleIdentifierError = AmbiguousBundleIdentifierError;
41
41
  async function getBundleIdentifierAsync(projectDir, exp, vcsClient, xcodeContext) {
42
+ if (env_1.default.overrideIosBundleIdentifier) {
43
+ return env_1.default.overrideIosBundleIdentifier;
44
+ }
42
45
  const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS, vcsClient);
43
46
  if (workflow === eas_build_job_1.Workflow.GENERIC) {
44
47
  warnIfBundleIdentifierDefinedInAppConfigForBareWorkflowProject(projectDir, exp);
45
- if (env_1.default.overrideIosBundleIdentifier) {
46
- return env_1.default.overrideIosBundleIdentifier;
47
- }
48
48
  const xcodeProject = config_plugins_1.IOSConfig.XcodeUtils.getPbxproj(projectDir);
49
49
  const isMultiScheme = config_plugins_1.IOSConfig.BuildScheme.getSchemesFromXcodeproj(projectDir).length > 1;
50
50
  const isMultiTarget = config_plugins_1.IOSConfig.Target.getNativeTargets(xcodeProject).filter(([, target]) => config_plugins_1.IOSConfig.Target.isTargetOfType(target, config_plugins_1.IOSConfig.Target.TargetType.APPLICATION)).length > 1;
@@ -8,6 +8,7 @@ const url_1 = require("url");
8
8
  const uuid = tslib_1.__importStar(require("uuid"));
9
9
  const builds_1 = require("./utils/builds");
10
10
  const files_1 = require("./utils/files");
11
+ const generated_1 = require("../graphql/generated");
11
12
  const BuildQuery_1 = require("../graphql/queries/BuildQuery");
12
13
  const AppPlatform_1 = require("../graphql/types/AppPlatform");
13
14
  const log_1 = tslib_1.__importStar(require("../log"));
@@ -26,6 +27,15 @@ var ArchiveSourceType;
26
27
  ArchiveSourceType[ArchiveSourceType["prompt"] = 6] = "prompt";
27
28
  ArchiveSourceType[ArchiveSourceType["gcs"] = 7] = "gcs";
28
29
  })(ArchiveSourceType || (exports.ArchiveSourceType = ArchiveSourceType = {}));
30
+ const buildStatusMapping = {
31
+ [generated_1.BuildStatus.New]: 'new',
32
+ [generated_1.BuildStatus.InQueue]: 'in queue',
33
+ [generated_1.BuildStatus.InProgress]: 'in progress',
34
+ [generated_1.BuildStatus.Finished]: 'finished',
35
+ [generated_1.BuildStatus.Errored]: 'errored',
36
+ [generated_1.BuildStatus.PendingCancel]: 'canceled',
37
+ [generated_1.BuildStatus.Canceled]: 'canceled',
38
+ };
29
39
  async function getArchiveAsync(ctx, source) {
30
40
  switch (source.sourceType) {
31
41
  case ArchiveSourceType.prompt: {
@@ -200,7 +210,7 @@ async function handleBuildListSourceAsync(ctx) {
200
210
  }
201
211
  }
202
212
  function formatBuildChoice(build) {
203
- const { id, updatedAt, runtimeVersion, buildProfile, gitCommitHash, gitCommitMessage, channel, message, } = build;
213
+ const { id, updatedAt, runtimeVersion, buildProfile, gitCommitHash, gitCommitMessage, channel, message, status, } = build;
204
214
  const buildDate = new Date(updatedAt);
205
215
  const splitCommitMessage = gitCommitMessage?.split('\n');
206
216
  const formattedCommitData = gitCommitHash && splitCommitMessage && splitCommitMessage.length > 0
@@ -218,6 +228,7 @@ function formatBuildChoice(build) {
218
228
  ? chalk_1.default.bold(message.length > 200 ? `${message.slice(0, 200)}...` : message)
219
229
  : null,
220
230
  },
231
+ { name: 'Status', value: buildStatusMapping[status] },
221
232
  ];
222
233
  const filteredDescriptionArray = descriptionItems
223
234
  .filter(item => item.value)
@@ -230,6 +241,9 @@ function formatBuildChoice(build) {
230
241
  };
231
242
  }
232
243
  async function handlePromptSourceAsync(ctx) {
244
+ if (ctx.nonInteractive) {
245
+ throw new Error('Please run this command with appropriate input.');
246
+ }
233
247
  const { sourceType: sourceTypeRaw } = await (0, prompts_1.promptAsync)({
234
248
  name: 'sourceType',
235
249
  type: 'select',
@@ -25,6 +25,7 @@ export default abstract class BaseSubmitter<P extends Platform, ResolvedSourceOp
25
25
  [K in keyof ResolvedSourceOptions]: () => Promise<ResolvedSourceOptions[K]>;
26
26
  }, sourceOptionAnalytics: Record<keyof ResolvedSourceOptions, AnalyticEvents>);
27
27
  private getSourceOptionsAsync;
28
+ getSubmissionInputAsync(): Promise<SubmissionInput<P>>;
28
29
  submitAsync(): Promise<SubmissionFragment>;
29
30
  abstract createSubmissionInputAsync(resolvedOptions: ResolvedSourceOptions): Promise<SubmissionInput<P>>;
30
31
  formatArchive(archive: ResolvedArchiveSource): Pick<SubmissionInput<P>, 'archiveSource' | 'buildId'>;
@@ -32,9 +32,12 @@ class BaseSubmitter {
32
32
  }
33
33
  return resolvedSourceOptions;
34
34
  }
35
- async submitAsync() {
35
+ async getSubmissionInputAsync() {
36
36
  const resolvedSourceOptions = await this.getSourceOptionsAsync();
37
- const input = await this.createSubmissionInputAsync(resolvedSourceOptions);
37
+ return await this.createSubmissionInputAsync(resolvedSourceOptions);
38
+ }
39
+ async submitAsync() {
40
+ const input = await this.getSubmissionInputAsync();
38
41
  return await this.createSubmissionWithAnalyticsAsync(input);
39
42
  }
40
43
  formatArchive(archive) {
@@ -1,10 +1,10 @@
1
1
  import { Platform } from '@expo/eas-build-job';
2
- import { SubmissionFragment } from '../../graphql/generated';
2
+ import AndroidSubmitter from './AndroidSubmitter';
3
3
  import { SubmissionContext } from '../context';
4
4
  export default class AndroidSubmitCommand {
5
5
  private ctx;
6
6
  constructor(ctx: SubmissionContext<Platform.ANDROID>);
7
- runAsync(): Promise<SubmissionFragment>;
7
+ runAsync(): Promise<AndroidSubmitter>;
8
8
  private getAndroidSubmissionOptionsAsync;
9
9
  private maybeGetAndroidPackageFromCurrentProjectAsync;
10
10
  private resolveTrack;
@@ -36,7 +36,7 @@ class AndroidSubmitCommand {
36
36
  }
37
37
  const submissionOptions = await this.getAndroidSubmissionOptionsAsync(archiveSourceValue);
38
38
  const submitter = new AndroidSubmitter_1.default(this.ctx, submissionOptions, archive);
39
- return await submitter.submitAsync();
39
+ return submitter;
40
40
  }
41
41
  async getAndroidSubmissionOptionsAsync(archiveSource) {
42
42
  const track = this.resolveTrack();
@@ -1,10 +1,10 @@
1
1
  import { Platform } from '@expo/eas-build-job';
2
- import { SubmissionFragment } from '../../graphql/generated';
2
+ import IosSubmitter from './IosSubmitter';
3
3
  import { SubmissionContext } from '../context';
4
4
  export default class IosSubmitCommand {
5
5
  private ctx;
6
6
  constructor(ctx: SubmissionContext<Platform.IOS>);
7
- runAsync(): Promise<SubmissionFragment>;
7
+ runAsync(): Promise<IosSubmitter>;
8
8
  private resolveSubmissionOptionsAsync;
9
9
  private resolveCredentialSubmissionOptionsAsync;
10
10
  private resolveAppSpecificPasswordSource;
@@ -38,7 +38,7 @@ class IosSubmitCommand {
38
38
  }
39
39
  const options = await this.resolveSubmissionOptionsAsync(archiveSourceValue);
40
40
  const submitter = new IosSubmitter_1.default(this.ctx, options, archive);
41
- return await submitter.submitAsync();
41
+ return submitter;
42
42
  }
43
43
  async resolveSubmissionOptionsAsync(archiveSource) {
44
44
  const credentialsSource = await this.resolveCredentialSubmissionOptionsAsync();
@@ -18,7 +18,8 @@ async function submitAsync(ctx) {
18
18
  const command = ctx.platform === eas_build_job_1.Platform.ANDROID
19
19
  ? new AndroidSubmitCommand_1.default(ctx)
20
20
  : new IosSubmitCommand_1.default(ctx);
21
- return await command.runAsync();
21
+ const submitter = await command.runAsync();
22
+ return await submitter.submitAsync();
22
23
  }, {
23
24
  attemptEvent: AnalyticsManager_1.SubmissionEvent.SUBMIT_COMMAND_ATTEMPT,
24
25
  successEvent: AnalyticsManager_1.SubmissionEvent.SUBMIT_COMMAND_SUCCESS,
@@ -4,15 +4,27 @@ exports.getRecentBuildsForSubmissionAsync = void 0;
4
4
  const generated_1 = require("../../graphql/generated");
5
5
  const BuildQuery_1 = require("../../graphql/queries/BuildQuery");
6
6
  async function getRecentBuildsForSubmissionAsync(graphqlClient, platform, appId, { limit = 1 } = {}) {
7
- return await BuildQuery_1.BuildQuery.viewBuildsOnAppAsync(graphqlClient, {
8
- appId,
9
- limit,
10
- offset: 0,
11
- filter: {
12
- platform,
13
- distribution: generated_1.DistributionType.Store,
14
- status: generated_1.BuildStatus.Finished,
15
- },
16
- });
7
+ const allowedStatuses = [
8
+ generated_1.BuildStatus.New,
9
+ generated_1.BuildStatus.InQueue,
10
+ generated_1.BuildStatus.InProgress,
11
+ generated_1.BuildStatus.Finished,
12
+ ];
13
+ const buildsPromises = [];
14
+ for (const buildStatus of allowedStatuses) {
15
+ buildsPromises.push(BuildQuery_1.BuildQuery.viewBuildsOnAppAsync(graphqlClient, {
16
+ appId,
17
+ limit,
18
+ offset: 0,
19
+ filter: {
20
+ platform,
21
+ distribution: generated_1.DistributionType.Store,
22
+ status: buildStatus,
23
+ },
24
+ }));
25
+ }
26
+ const builds = (await Promise.all(buildsPromises)).reduce((acc, value) => acc.concat(value), []);
27
+ builds.sort((buildA, buildB) => (buildA.createdAt > buildB.createdAt ? -1 : 1));
28
+ return builds.slice(0, limit);
17
29
  }
18
30
  exports.getRecentBuildsForSubmissionAsync = getRecentBuildsForSubmissionAsync;
@@ -61,17 +61,17 @@ async function chooseDevDomainNameAsync({ graphqlClient, appId, initial, }) {
61
61
  const { name } = await (0, prompts_1.promptAsync)({
62
62
  type: 'text',
63
63
  name: 'name',
64
- message: 'Choose a URL for your project:',
64
+ message: 'Choose a preview URL for your project:',
65
65
  initial,
66
66
  validate: (value) => {
67
67
  if (!value) {
68
- return 'You have to choose a URL for your project';
68
+ return 'You have to choose a preview URL for your project';
69
69
  }
70
70
  if (value.length < 3) {
71
- return 'Project URLs must be at least 3 characters long';
71
+ return 'Preview URLs must be at least 3 characters long';
72
72
  }
73
73
  if (value.endsWith('-')) {
74
- return 'Project URLs cannot end with a hyphen (-)';
74
+ return 'Preview URLs cannot end with a hyphen (-)';
75
75
  }
76
76
  return true;
77
77
  },
@@ -96,7 +96,7 @@ async function chooseDevDomainNameAsync({ graphqlClient, appId, initial, }) {
96
96
  },
97
97
  });
98
98
  if (!name) {
99
- throw new Error('No project URL provided, aborting deployment.');
99
+ throw new Error('No preview URL provided, aborting deployment.');
100
100
  }
101
101
  try {
102
102
  const success = await mutations_1.DeploymentsMutation.assignDevDomainNameAsync(graphqlClient, {
@@ -104,13 +104,13 @@ async function chooseDevDomainNameAsync({ graphqlClient, appId, initial, }) {
104
104
  name,
105
105
  });
106
106
  if (!success) {
107
- throw new Error('Failed to assign project URL');
107
+ throw new Error('Failed to assign preview URL');
108
108
  }
109
109
  }
110
110
  catch (error) {
111
111
  const isChosenNameTaken = error?.graphQLErrors?.some(e => ['DEV_DOMAIN_NAME_TAKEN'].includes(e?.extensions?.errorCode));
112
112
  if (isChosenNameTaken) {
113
- log_1.default.error(`The project URL "${name}" is already taken, choose a different name.`);
113
+ log_1.default.error(`The preview URL "${name}" is already taken, choose a different URL.`);
114
114
  await chooseDevDomainNameAsync({ graphqlClient, appId, initial });
115
115
  }
116
116
  if (!isChosenNameTaken) {
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "12.4.1",
2
+ "version": "12.5.0",
3
3
  "commands": {
4
4
  "analytics": {
5
5
  "id": "analytics",
@@ -2684,6 +2684,49 @@
2684
2684
  "privateProjectConfig": {}
2685
2685
  }
2686
2686
  },
2687
+ "submit:internal": {
2688
+ "id": "submit:internal",
2689
+ "strict": true,
2690
+ "pluginName": "eas-cli",
2691
+ "pluginAlias": "eas-cli",
2692
+ "pluginType": "core",
2693
+ "hidden": true,
2694
+ "aliases": [],
2695
+ "flags": {
2696
+ "platform": {
2697
+ "name": "platform",
2698
+ "type": "option",
2699
+ "required": true,
2700
+ "helpValue": "(android|ios)",
2701
+ "multiple": false,
2702
+ "options": [
2703
+ "android",
2704
+ "ios"
2705
+ ]
2706
+ },
2707
+ "profile": {
2708
+ "name": "profile",
2709
+ "type": "option",
2710
+ "description": "Name of the submit profile from eas.json. Defaults to \"production\" if defined in eas.json.",
2711
+ "multiple": false
2712
+ },
2713
+ "id": {
2714
+ "name": "id",
2715
+ "type": "option",
2716
+ "description": "ID of the build to submit",
2717
+ "required": true,
2718
+ "multiple": false
2719
+ }
2720
+ },
2721
+ "args": {},
2722
+ "contextDefinition": {
2723
+ "loggedIn": {},
2724
+ "privateProjectConfig": {},
2725
+ "projectDir": {},
2726
+ "analytics": {},
2727
+ "vcsClient": {}
2728
+ }
2729
+ },
2687
2730
  "update:configure": {
2688
2731
  "id": "update:configure",
2689
2732
  "description": "configure the project to support EAS Update",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "eas-cli",
3
3
  "description": "EAS command line tool",
4
- "version": "12.4.1",
4
+ "version": "12.5.0",
5
5
  "author": "Expo <support@expo.dev>",
6
6
  "bin": {
7
7
  "eas": "./bin/run"
@@ -13,8 +13,8 @@
13
13
  "@expo/config": "8.5.4",
14
14
  "@expo/config-plugins": "7.8.4",
15
15
  "@expo/config-types": "50.0.0",
16
- "@expo/eas-build-job": "1.0.133",
17
- "@expo/eas-json": "12.0.0",
16
+ "@expo/eas-build-job": "1.0.136",
17
+ "@expo/eas-json": "12.5.0",
18
18
  "@expo/env": "^0.3.0",
19
19
  "@expo/json-file": "8.2.37",
20
20
  "@expo/logger": "1.0.117",
@@ -29,7 +29,7 @@
29
29
  "@expo/results": "1.0.0",
30
30
  "@expo/rudder-sdk-node": "1.1.1",
31
31
  "@expo/spawn-async": "1.7.0",
32
- "@expo/steps": "1.0.134",
32
+ "@expo/steps": "1.0.136",
33
33
  "@expo/timeago.js": "1.0.0",
34
34
  "@oclif/core": "^1.26.2",
35
35
  "@oclif/plugin-autocomplete": "^2.3.10",
@@ -86,7 +86,8 @@
86
86
  "turndown": "7.1.2",
87
87
  "untildify": "4.0.0",
88
88
  "uuid": "9.0.1",
89
- "wrap-ansi": "7.0.0"
89
+ "wrap-ansi": "7.0.0",
90
+ "zod": "^3.23.8"
90
91
  },
91
92
  "devDependencies": {
92
93
  "@graphql-codegen/cli": "5.0.0",
@@ -227,5 +228,5 @@
227
228
  "node": "20.11.0",
228
229
  "yarn": "1.22.21"
229
230
  },
230
- "gitHead": "d2a89c1d77bf33dc28bd7bbd8896531cba29e60a"
231
+ "gitHead": "981f7c97279e9848f0b3dd6a82140db8f8d735fa"
231
232
  }