eas-cli 21.0.3 → 21.1.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.
@@ -143,5 +143,9 @@ function truncateGitCommitMessage(msg, maxLength = 4096) {
143
143
  if (msg === undefined) {
144
144
  return undefined;
145
145
  }
146
- return msg.length > maxLength ? `${msg.substring(0, maxLength - 3)}...` : msg;
146
+ if (msg.length <= maxLength) {
147
+ return msg;
148
+ }
149
+ const truncated = msg.substring(0, maxLength - 3).replace(/[\uD800-\uDBFF]$/, '');
150
+ return `${truncated}...`;
147
151
  }
@@ -1,11 +1,12 @@
1
1
  import EasCommand from '../../commandUtils/EasCommand';
2
2
  export default class SimulatorStart extends EasCommand {
3
3
  static hidden: boolean;
4
+ static aliases: string[];
4
5
  static description: string;
5
6
  static flags: {
6
7
  json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
8
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
- platform: import("@oclif/core/lib/interfaces").OptionFlag<"android" | "ios", import("@oclif/core/lib/interfaces").CustomOptions>;
9
+ platform: import("@oclif/core/lib/interfaces").OptionFlag<"android" | "ios" | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
9
10
  type: import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces").CustomOptions>;
10
11
  'package-version': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
11
12
  'max-duration-minutes': import("@oclif/core/lib/interfaces").OptionFlag<number | undefined, import("@oclif/core/lib/interfaces").CustomOptions>;
@@ -11,6 +11,7 @@ const DeviceRunSessionMutation_1 = require("../../graphql/mutations/DeviceRunSes
11
11
  const DeviceRunSessionQuery_1 = require("../../graphql/queries/DeviceRunSessionQuery");
12
12
  const log_1 = tslib_1.__importStar(require("../../log"));
13
13
  const ora_1 = require("../../ora");
14
+ const prompts_1 = require("../../prompts");
14
15
  const env_1 = require("../../simulator/env");
15
16
  const utils_1 = require("../../simulator/utils");
16
17
  const json_1 = require("../../utils/json");
@@ -21,15 +22,20 @@ const OUT_CONFIG_TYPE_VALUES = {
21
22
  Env: 'env',
22
23
  Dotenv: 'dotenv',
23
24
  };
25
+ const PLATFORM_FLAG_VALUES = ['android', 'ios'];
26
+ const APP_PLATFORM_BY_FLAG_VALUE = {
27
+ android: generated_1.AppPlatform.Android,
28
+ ios: generated_1.AppPlatform.Ios,
29
+ };
24
30
  class SimulatorStart extends EasCommand_1.default {
25
31
  static hidden = true;
32
+ static aliases = ['simulator'];
26
33
  static description = '[EXPERIMENTAL] start a remote simulator session on EAS and get instructions to connect to it';
27
34
  static flags = {
28
35
  platform: core_1.Flags.option({
29
36
  char: 'p',
30
37
  description: 'Device platform',
31
- options: ['android', 'ios'],
32
- required: true,
38
+ options: PLATFORM_FLAG_VALUES,
33
39
  })(),
34
40
  type: core_1.Flags.option({
35
41
  description: 'Type of simulator session to create',
@@ -74,13 +80,13 @@ class SimulatorStart extends EasCommand_1.default {
74
80
  if (existingDeviceRunSessionId && !flags.force) {
75
81
  throw new Error(`Existing simulator session in environment. Use --force to create a new simulator session.`);
76
82
  }
83
+ const platform = await resolvePlatformAsync(flags.platform, nonInteractive);
77
84
  if (existingDeviceRunSessionId) {
78
85
  log_1.default.warn(` Overwriting previous simulator session (id: ${existingDeviceRunSessionId}). ` +
79
86
  `The previous remote session will continue running until stopped. ` +
80
87
  `To stop it, run: eas simulator:stop --id ${existingDeviceRunSessionId}`);
81
88
  log_1.default.newLine();
82
89
  }
83
- const platform = flags.platform === 'android' ? generated_1.AppPlatform.Android : generated_1.AppPlatform.Ios;
84
90
  const createSpinner = (0, ora_1.ora)('🚀 Creating simulator session').start();
85
91
  let deviceRunSessionId;
86
92
  let deviceRunSessionUrl;
@@ -171,6 +177,24 @@ class SimulatorStart extends EasCommand_1.default {
171
177
  }
172
178
  }
173
179
  exports.default = SimulatorStart;
180
+ async function resolvePlatformAsync(platform, nonInteractive) {
181
+ if (platform) {
182
+ return APP_PLATFORM_BY_FLAG_VALUE[platform];
183
+ }
184
+ if (nonInteractive) {
185
+ throw new Error('The --platform flag must be set when running in non-interactive mode.');
186
+ }
187
+ const { selectedPlatform } = await (0, prompts_1.promptAsync)({
188
+ type: 'select',
189
+ message: 'Select platform',
190
+ name: 'selectedPlatform',
191
+ choices: [
192
+ { title: 'Android', value: generated_1.AppPlatform.Android },
193
+ { title: 'iOS', value: generated_1.AppPlatform.Ios },
194
+ ],
195
+ });
196
+ return selectedPlatform;
197
+ }
174
198
  async function writeSimulatorEnvSafelyAsync(projectDir, environmentVariables) {
175
199
  try {
176
200
  await (0, env_1.writeSimulatorEnvAsync)(projectDir, environmentVariables);
@@ -6,7 +6,9 @@ const graphql_1 = require("graphql");
6
6
  const graphql_tag_1 = tslib_1.__importDefault(require("graphql-tag"));
7
7
  const client_1 = require("../client");
8
8
  const Update_1 = require("../types/Update");
9
- const turtleJobRunId = process.env.EAS_BUILD_ID;
9
+ function getTurtleJobRunId() {
10
+ return process.env.EAS_BUILD_PLATFORM ? undefined : process.env.EAS_BUILD_ID;
11
+ }
10
12
  exports.PublishMutation = {
11
13
  async getUploadURLsAsync(graphqlClient, contentTypes) {
12
14
  const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
@@ -25,6 +27,7 @@ exports.PublishMutation = {
25
27
  return data.asset.getSignedAssetUploadSpecifications;
26
28
  },
27
29
  async publishUpdateGroupAsync(graphqlClient, publishUpdateGroupsInput) {
30
+ const turtleJobRunId = getTurtleJobRunId();
28
31
  const data = await (0, client_1.withErrorHandlingAsync)(graphqlClient
29
32
  .mutation((0, graphql_tag_1.default) `
30
33
  mutation UpdatePublishMutation($publishUpdateGroupsInput: [PublishUpdateGroupInput!]!) {