eas-cli 12.4.1 → 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.
Files changed (68) hide show
  1. package/README.md +66 -62
  2. package/build/build/evaluateConfigWithEnvVarsAsync.d.ts +1 -4
  3. package/build/build/evaluateConfigWithEnvVarsAsync.js +3 -6
  4. package/build/build/local.js +19 -11
  5. package/build/build/runBuildAndSubmit.d.ts +0 -2
  6. package/build/build/runBuildAndSubmit.js +0 -1
  7. package/build/commandUtils/flags.d.ts +0 -3
  8. package/build/commandUtils/flags.js +1 -15
  9. package/build/commands/build/index.d.ts +0 -2
  10. package/build/commands/build/index.js +0 -2
  11. package/build/commands/build/resign.d.ts +0 -1
  12. package/build/commands/build/resign.js +0 -2
  13. package/build/commands/build/version/get.d.ts +0 -1
  14. package/build/commands/build/version/get.js +0 -2
  15. package/build/commands/build/version/set.d.ts +0 -1
  16. package/build/commands/build/version/set.js +0 -3
  17. package/build/commands/build/version/sync.d.ts +0 -1
  18. package/build/commands/build/version/sync.js +0 -3
  19. package/build/commands/config.d.ts +0 -1
  20. package/build/commands/config.js +0 -2
  21. package/build/commands/env/exec.d.ts +23 -0
  22. package/build/commands/env/exec.js +124 -0
  23. package/build/commands/submit/internal.d.ts +24 -0
  24. package/build/commands/submit/internal.js +168 -0
  25. package/build/commands/update/republish.d.ts +2 -0
  26. package/build/commands/update/republish.js +34 -4
  27. package/build/commands/worker/deploy.js +15 -14
  28. package/build/credentials/manager/Actions.d.ts +4 -2
  29. package/build/credentials/manager/Actions.js +2 -0
  30. package/build/credentials/manager/AndroidActions.js +5 -0
  31. package/build/credentials/manager/IosActions.js +5 -0
  32. package/build/credentials/manager/ManageAndroid.js +3 -0
  33. package/build/credentials/manager/ManageIos.js +3 -0
  34. package/build/graphql/generated.d.ts +165 -32
  35. package/build/graphql/generated.js +1 -0
  36. package/build/graphql/queries/AppStoreConnectApiKeyQuery.d.ts +8 -0
  37. package/build/graphql/queries/AppStoreConnectApiKeyQuery.js +32 -0
  38. package/build/graphql/queries/GoogleServiceAccountKeyQuery.d.ts +6 -0
  39. package/build/graphql/queries/GoogleServiceAccountKeyQuery.js +25 -0
  40. package/build/graphql/types/Submission.js +1 -1
  41. package/build/project/android/applicationId.js +3 -3
  42. package/build/project/expoConfig.js +0 -15
  43. package/build/project/ios/bundleIdentifier.js +3 -3
  44. package/build/project/publish.js +3 -2
  45. package/build/submit/ArchiveSource.js +15 -1
  46. package/build/submit/BaseSubmitter.d.ts +1 -0
  47. package/build/submit/BaseSubmitter.js +5 -2
  48. package/build/submit/android/AndroidSubmitCommand.d.ts +2 -2
  49. package/build/submit/android/AndroidSubmitCommand.js +1 -1
  50. package/build/submit/ios/IosSubmitCommand.d.ts +2 -2
  51. package/build/submit/ios/IosSubmitCommand.js +1 -1
  52. package/build/submit/submit.js +2 -1
  53. package/build/submit/utils/builds.js +22 -10
  54. package/build/submit/utils/logs.js +16 -17
  55. package/build/update/getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync.d.ts +5 -0
  56. package/build/update/{getBranchNameFromChannelNameAsync.js → getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync.js} +8 -7
  57. package/build/update/republish.js +2 -2
  58. package/build/utils/prompts.js +3 -3
  59. package/build/worker/assets.d.ts +1 -1
  60. package/build/worker/assets.js +4 -2
  61. package/build/worker/deployment.d.ts +10 -0
  62. package/build/worker/deployment.js +38 -27
  63. package/build/worker/upload.js +4 -6
  64. package/build/worker/utils/logs.d.ts +14 -13
  65. package/build/worker/utils/logs.js +18 -18
  66. package/oclif.manifest.json +103 -79
  67. package/package.json +7 -6
  68. package/build/update/getBranchNameFromChannelNameAsync.d.ts +0 -2
@@ -8,10 +8,11 @@ const queries_2 = require("../../channel/queries");
8
8
  const EasCommand_1 = tslib_1.__importDefault(require("../../commandUtils/EasCommand"));
9
9
  const flags_1 = require("../../commandUtils/flags");
10
10
  const pagination_1 = require("../../commandUtils/pagination");
11
+ const BranchQuery_1 = require("../../graphql/queries/BranchQuery");
11
12
  const UpdateQuery_1 = require("../../graphql/queries/UpdateQuery");
12
13
  const log_1 = tslib_1.__importDefault(require("../../log"));
13
14
  const prompts_1 = require("../../prompts");
14
- const getBranchNameFromChannelNameAsync_1 = require("../../update/getBranchNameFromChannelNameAsync");
15
+ const getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync_1 = require("../../update/getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync");
15
16
  const queries_3 = require("../../update/queries");
16
17
  const republish_1 = require("../../update/republish");
17
18
  const utils_1 = require("../../update/utils");
@@ -47,13 +48,14 @@ class UpdateRepublish extends EasCommand_1.default {
47
48
  }
48
49
  log_1.default.withTick(`The republished update group will appear on the same platforms it was originally published on: ${platformsFromUpdates.join(', ')}`);
49
50
  }
50
- const updateMessage = await getOrAskUpdateMessageAsync(updatesToPublish, flags);
51
51
  const arbitraryUpdate = updatesToPublish[0];
52
+ const targetBranch = await getOrAskTargetBranchAsync(graphqlClient, projectId, flags, arbitraryUpdate);
53
+ const updateMessage = await getOrAskUpdateMessageAsync(updatesToPublish, flags);
52
54
  await (0, republish_1.republishAsync)({
53
55
  graphqlClient,
54
56
  app: { exp, projectId },
55
57
  updatesToPublish,
56
- targetBranch: { branchId: arbitraryUpdate.branchId, branchName: arbitraryUpdate.branchName },
58
+ targetBranch,
57
59
  updateMessage,
58
60
  codeSigningInfo,
59
61
  json: flags.json,
@@ -63,6 +65,8 @@ class UpdateRepublish extends EasCommand_1.default {
63
65
  const branchName = rawFlags.branch;
64
66
  const channelName = rawFlags.channel;
65
67
  const groupId = rawFlags.group;
68
+ const destinationChannelName = rawFlags['destination-channel'];
69
+ const destinationBranchName = rawFlags['destination-branch'];
66
70
  const nonInteractive = rawFlags['non-interactive'];
67
71
  const privateKeyPath = rawFlags['private-key-path'];
68
72
  if (nonInteractive && !groupId) {
@@ -72,6 +76,8 @@ class UpdateRepublish extends EasCommand_1.default {
72
76
  return {
73
77
  branchName,
74
78
  channelName,
79
+ destinationChannelName,
80
+ destinationBranchName,
75
81
  groupId,
76
82
  platform,
77
83
  updateMessage: rawFlags.message,
@@ -96,6 +102,14 @@ UpdateRepublish.flags = {
96
102
  description: 'Update group ID to republish',
97
103
  exclusive: ['branch', 'channel'],
98
104
  }),
105
+ 'destination-channel': core_1.Flags.string({
106
+ description: 'Channel name to select a branch to republish to if republishing to a different branch',
107
+ exclusive: ['destination-branch'],
108
+ }),
109
+ 'destination-branch': core_1.Flags.string({
110
+ description: 'Branch name to republish to if republishing to a different branch',
111
+ exclusive: ['destination-channel'],
112
+ }),
99
113
  message: core_1.Flags.string({
100
114
  char: 'm',
101
115
  description: 'Short message describing the republished update group',
@@ -118,6 +132,22 @@ UpdateRepublish.contextDefinition = {
118
132
  ..._a.ContextOptions.LoggedIn,
119
133
  };
120
134
  exports.default = UpdateRepublish;
135
+ async function getOrAskTargetBranchAsync(graphqlClient, projectId, flags, arbitraryUpdate) {
136
+ // if branch name supplied, use that
137
+ if (flags.destinationBranchName) {
138
+ const branch = await BranchQuery_1.BranchQuery.getBranchByNameAsync(graphqlClient, {
139
+ appId: projectId,
140
+ name: flags.destinationBranchName,
141
+ });
142
+ return { branchId: branch.id, branchName: branch.name };
143
+ }
144
+ // if provided channel name but was non-interactive
145
+ if (flags.destinationChannelName) {
146
+ return await (0, getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync_1.getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync)(graphqlClient, projectId, flags.destinationChannelName);
147
+ }
148
+ // if neither provided, assume republish on same branch
149
+ return { branchId: arbitraryUpdate.branchId, branchName: arbitraryUpdate.branchName };
150
+ }
121
151
  /** Retrieve the update group from either the update group id, or select from branch name. */
122
152
  async function getOrAskUpdatesAsync(graphqlClient, projectId, flags) {
123
153
  if (flags.groupId) {
@@ -213,7 +243,7 @@ async function askUpdatesFromBranchNameAsync(graphqlClient, { projectId, branchN
213
243
  }
214
244
  /** Ask the user which update needs to be republished by channel name, this requires interactive mode */
215
245
  async function askUpdatesFromChannelNameAsync(graphqlClient, { projectId, channelName, json, nonInteractive, }) {
216
- const branchName = await (0, getBranchNameFromChannelNameAsync_1.getBranchNameFromChannelNameAsync)(graphqlClient, projectId, channelName);
246
+ const { branchName } = await (0, getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync_1.getBranchFromChannelNameAndCreateAndLinkIfNotExistsAsync)(graphqlClient, projectId, channelName);
217
247
  return await askUpdatesFromBranchNameAsync(graphqlClient, {
218
248
  projectId,
219
249
  branchName,
@@ -30,10 +30,8 @@ class WorkerDeploy extends EasCommand_1.default {
30
30
  }
31
31
  log_1.default.warn('EAS Worker Deployments are in beta and subject to breaking changes.');
32
32
  const { getDynamicPrivateProjectConfigAsync, loggedIn: { graphqlClient }, projectDir, } = await this.getContextAsync(_a, flags);
33
- const [{ projectId }, projectDist] = await Promise.all([
34
- getDynamicPrivateProjectConfigAsync(),
35
- resolveExportedProjectAsync(flags, projectDir),
36
- ]);
33
+ const projectDist = await resolveExportedProjectAsync(flags, projectDir);
34
+ const { projectId } = await getDynamicPrivateProjectConfigAsync();
37
35
  logExportedProjectInfo(projectDist);
38
36
  async function* emitWorkerTarballAsync(params) {
39
37
  yield ['assets.json', JSON.stringify(params.assetMap)];
@@ -76,6 +74,9 @@ class WorkerDeploy extends EasCommand_1.default {
76
74
  // TODO(@kitten): Batch and upload multiple files in parallel
77
75
  const uploadParams = [];
78
76
  const assetPath = projectDist.type === 'server' ? projectDist.clientPath : projectDist.path;
77
+ if (!assetPath) {
78
+ return;
79
+ }
79
80
  for await (const asset of WorkerAssets.listAssetMapFilesAsync(assetPath, assetMap)) {
80
81
  const uploadURL = uploads[asset.normalizedPath];
81
82
  if (uploadURL) {
@@ -197,7 +198,7 @@ class WorkerDeploy extends EasCommand_1.default {
197
198
  deploymentIdentifier: deployResult.id,
198
199
  url: (0, logs_1.getDeploymentUrlFromFullName)(deployResult.fullName),
199
200
  },
200
- aliases: [deploymentAlias].filter(Boolean),
201
+ aliases: [deploymentAlias],
201
202
  production: deploymentProdAlias,
202
203
  }));
203
204
  return;
@@ -211,7 +212,7 @@ class WorkerDeploy extends EasCommand_1.default {
211
212
  deploymentIdentifier: deployResult.id,
212
213
  url: (0, logs_1.getDeploymentUrlFromFullName)(deployResult.fullName),
213
214
  },
214
- aliases: [deploymentAlias].filter(Boolean),
215
+ aliases: [deploymentAlias],
215
216
  production: deploymentProdAlias,
216
217
  }));
217
218
  if (!deploymentProdAlias) {
@@ -273,24 +274,24 @@ async function resolveExportedProjectAsync(flags, projectDir) {
273
274
  const exportPath = path.join(projectDir, flags.exportDir);
274
275
  const serverPath = path.join(exportPath, 'server');
275
276
  const clientPath = path.join(exportPath, 'client');
276
- const [hasServerPath, hasClientPath, exportStat] = await Promise.all([
277
- isDirectory(serverPath),
278
- isDirectory(clientPath),
277
+ const [exportDirStat, expoRoutesStat, hasClientDir] = await Promise.all([
279
278
  node_fs_1.default.promises.stat(exportPath).catch(() => null),
279
+ node_fs_1.default.promises.stat(path.join(serverPath, '_expo/routes.json')).catch(() => null),
280
+ isDirectory(clientPath),
280
281
  ]);
281
- if (!exportStat?.isDirectory()) {
282
+ if (!exportDirStat?.isDirectory()) {
282
283
  throw new Error(`No "${flags.exportDir}/" folder found. Prepare your project for deployment with "npx expo export --platform web"`);
283
284
  }
284
- if (hasServerPath && hasClientPath) {
285
+ if (expoRoutesStat?.isFile()) {
285
286
  return {
286
287
  type: 'server',
287
288
  path: exportPath,
288
- modifiedAt: exportStat.mtime,
289
+ modifiedAt: exportDirStat.mtime,
289
290
  serverPath,
290
- clientPath,
291
+ clientPath: hasClientDir ? clientPath : undefined,
291
292
  };
292
293
  }
293
- return { type: 'static', path: exportPath, modifiedAt: exportStat.mtime };
294
+ return { type: 'static', path: exportPath, modifiedAt: exportDirStat.mtime };
294
295
  }
295
296
  function logExportedProjectInfo(project) {
296
297
  let modifiedAgo = '';
@@ -33,7 +33,8 @@ export declare enum AndroidActionType {
33
33
  SetUpGsaKeyForFcmV1 = 21,
34
34
  UpdateCredentialsJson = 22,
35
35
  SetUpBuildCredentialsFromCredentialsJson = 23,
36
- SetUpBuildCredentials = 24
36
+ SetUpBuildCredentials = 24,
37
+ Exit = 25
37
38
  }
38
39
  export declare enum IosActionType {
39
40
  ManageCredentialsJson = 0,
@@ -56,5 +57,6 @@ export declare enum IosActionType {
56
57
  SetUpAscApiKeyForSubmissions = 17,
57
58
  UseExistingAscApiKeyForSubmissions = 18,
58
59
  CreateAscApiKeyForSubmissions = 19,
59
- RemoveAscApiKey = 20
60
+ RemoveAscApiKey = 20,
61
+ Exit = 21
60
62
  }
@@ -34,6 +34,7 @@ var AndroidActionType;
34
34
  AndroidActionType[AndroidActionType["UpdateCredentialsJson"] = 22] = "UpdateCredentialsJson";
35
35
  AndroidActionType[AndroidActionType["SetUpBuildCredentialsFromCredentialsJson"] = 23] = "SetUpBuildCredentialsFromCredentialsJson";
36
36
  AndroidActionType[AndroidActionType["SetUpBuildCredentials"] = 24] = "SetUpBuildCredentials";
37
+ AndroidActionType[AndroidActionType["Exit"] = 25] = "Exit";
37
38
  })(AndroidActionType || (exports.AndroidActionType = AndroidActionType = {}));
38
39
  var IosActionType;
39
40
  (function (IosActionType) {
@@ -58,4 +59,5 @@ var IosActionType;
58
59
  IosActionType[IosActionType["UseExistingAscApiKeyForSubmissions"] = 18] = "UseExistingAscApiKeyForSubmissions";
59
60
  IosActionType[IosActionType["CreateAscApiKeyForSubmissions"] = 19] = "CreateAscApiKeyForSubmissions";
60
61
  IosActionType[IosActionType["RemoveAscApiKey"] = 20] = "RemoveAscApiKey";
62
+ IosActionType[IosActionType["Exit"] = 21] = "Exit";
61
63
  })(IosActionType || (exports.IosActionType = IosActionType = {}));
@@ -28,6 +28,11 @@ exports.highLevelActions = [
28
28
  title: 'Go back',
29
29
  scope: Actions_1.Scope.Manager,
30
30
  },
31
+ {
32
+ value: Actions_1.AndroidActionType.Exit,
33
+ title: 'Exit',
34
+ scope: Actions_1.Scope.Manager,
35
+ },
31
36
  ];
32
37
  exports.credentialsJsonActions = [
33
38
  {
@@ -28,6 +28,11 @@ exports.highLevelActions = [
28
28
  title: 'Go back',
29
29
  scope: Actions_1.Scope.Manager,
30
30
  },
31
+ {
32
+ value: Actions_1.IosActionType.Exit,
33
+ title: 'Exit',
34
+ scope: Actions_1.Scope.Manager,
35
+ },
31
36
  ];
32
37
  exports.credentialsJsonActions = [
33
38
  {
@@ -128,6 +128,9 @@ class ManageAndroid {
128
128
  await this.callingAction.runAsync(ctx);
129
129
  return;
130
130
  }
131
+ else if (chosenAction === Actions_1.AndroidActionType.Exit) {
132
+ return;
133
+ }
131
134
  }
132
135
  await this.runProjectSpecificActionAsync(ctx, chosenAction, gradleContext);
133
136
  }
@@ -133,6 +133,9 @@ class ManageIos {
133
133
  await this.callingAction.runAsync(ctx);
134
134
  return;
135
135
  }
136
+ else if (chosenAction === Actions_1.IosActionType.Exit) {
137
+ return;
138
+ }
136
139
  }
137
140
  else if (actionInfo.scope === Actions_1.Scope.Project) {
138
141
  (0, assert_1.default)(ctx.hasProjectContext, 'You must be in your project directory in order to perform this action');