eas-cli 0.42.3 → 0.44.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 (57) hide show
  1. package/README.md +14 -788
  2. package/bin/dev +17 -0
  3. package/bin/dev.cmd +3 -0
  4. package/bin/run +4 -3
  5. package/build/build/android/UpdatesModule.d.ts +0 -1
  6. package/build/build/android/UpdatesModule.js +4 -37
  7. package/build/build/android/build.js +3 -3
  8. package/build/build/android/{configure.d.ts → syncProjectConfiguration.d.ts} +2 -3
  9. package/build/build/android/{configure.js → syncProjectConfiguration.js} +22 -23
  10. package/build/build/build.d.ts +1 -1
  11. package/build/build/build.js +6 -8
  12. package/build/build/configure.d.ts +12 -7
  13. package/build/build/configure.js +25 -99
  14. package/build/build/context.d.ts +0 -12
  15. package/build/build/createContext.d.ts +1 -2
  16. package/build/build/createContext.js +1 -2
  17. package/build/build/ios/UpdatesModule.d.ts +0 -1
  18. package/build/build/ios/UpdatesModule.js +8 -39
  19. package/build/build/ios/build.js +3 -3
  20. package/build/build/ios/{configure.d.ts → syncProjectConfiguration.d.ts} +1 -3
  21. package/build/build/ios/{configure.js → syncProjectConfiguration.js} +3 -18
  22. package/build/build/local.d.ts +1 -0
  23. package/build/build/local.js +2 -1
  24. package/build/build/runBuildAndSubmit.d.ts +0 -1
  25. package/build/build/runBuildAndSubmit.js +4 -2
  26. package/build/commands/branch/create.js +8 -3
  27. package/build/commands/branch/delete.js +8 -2
  28. package/build/commands/branch/list.js +5 -1
  29. package/build/commands/branch/rename.js +8 -3
  30. package/build/commands/branch/view.d.ts +0 -2
  31. package/build/commands/branch/view.js +32 -71
  32. package/build/commands/build/configure.js +43 -25
  33. package/build/commands/build/index.d.ts +1 -0
  34. package/build/commands/build/index.js +12 -2
  35. package/build/commands/build/inspect.d.ts +1 -0
  36. package/build/commands/build/inspect.js +23 -17
  37. package/build/commands/channel/create.js +21 -16
  38. package/build/commands/channel/delete.d.ts +15 -0
  39. package/build/commands/channel/delete.js +124 -0
  40. package/build/commands/channel/edit.js +10 -5
  41. package/build/commands/channel/list.js +14 -9
  42. package/build/commands/channel/rollout.js +8 -3
  43. package/build/commands/channel/view.js +16 -11
  44. package/build/commands/update/configure.js +1 -1
  45. package/build/commands/update/delete.js +9 -4
  46. package/build/commands/update/index.js +7 -3
  47. package/build/commands/update/list.d.ts +10 -0
  48. package/build/commands/update/list.js +114 -0
  49. package/build/commands/update/view.js +22 -17
  50. package/build/credentials/ios/appstore/bundleIdCapabilities.js +0 -2
  51. package/build/credentials/ios/appstore/ensureAppExists.js +3 -1
  52. package/build/graphql/generated.d.ts +92 -30
  53. package/build/graphql/queries/UpdateQuery.d.ts +7 -0
  54. package/build/graphql/queries/UpdateQuery.js +85 -0
  55. package/build/vcs/local.js +5 -1
  56. package/oclif.manifest.json +1 -1
  57. package/package.json +11 -8
@@ -4,6 +4,7 @@ export interface LocalBuildOptions {
4
4
  skipCleanup?: boolean;
5
5
  skipNativeBuild?: boolean;
6
6
  artifactsDir?: string;
7
+ artifactPath?: string;
7
8
  workingdir?: string;
8
9
  verbose?: boolean;
9
10
  }
@@ -6,7 +6,7 @@ const spawn_async_1 = (0, tslib_1.__importDefault)(require("@expo/spawn-async"))
6
6
  const semver_1 = (0, 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.57';
9
+ const PLUGIN_PACKAGE_VERSION = '0.0.58';
10
10
  async function runLocalBuildAsync(job, options) {
11
11
  var _a;
12
12
  const { command, args } = await getCommandAndArgsAsync(job);
@@ -32,6 +32,7 @@ async function runLocalBuildAsync(job, options) {
32
32
  : {}),
33
33
  ...(options.skipNativeBuild ? { EAS_LOCAL_BUILD_SKIP_NATIVE_BUILD: '1' } : {}),
34
34
  ...(options.artifactsDir ? { EAS_LOCAL_BUILD_ARTIFACTS_DIR: options.artifactsDir } : {}),
35
+ ...(options.artifactPath ? { EAS_LOCAL_BUILD_ARTIFACT_PATH: options.artifactPath } : {}),
35
36
  },
36
37
  });
37
38
  childProcess = spawnPromise.child;
@@ -2,7 +2,6 @@ import { RequestedPlatform } from '../platform';
2
2
  import { LocalBuildOptions } from './local';
3
3
  export interface BuildFlags {
4
4
  requestedPlatform: RequestedPlatform;
5
- skipProjectConfiguration: boolean;
6
5
  profile?: string;
7
6
  nonInteractive: boolean;
8
7
  wait: boolean;
@@ -30,7 +30,10 @@ async function runBuildAndSubmitAsync(projectDir, flags) {
30
30
  var _a;
31
31
  await (0, vcs_1.getVcsClient)().ensureRepoExistsAsync();
32
32
  await (0, repository_1.ensureRepoIsCleanAsync)(flags.nonInteractive);
33
- await (0, configure_1.ensureProjectConfiguredAsync)(projectDir, flags.requestedPlatform);
33
+ await (0, configure_1.ensureProjectConfiguredAsync)({
34
+ projectDir,
35
+ nonInteractive: flags.nonInteractive,
36
+ });
34
37
  const platforms = (0, platform_1.toPlatforms)(flags.requestedPlatform);
35
38
  const buildProfiles = await (0, profiles_1.getProfilesAsync)({
36
39
  type: 'build',
@@ -111,7 +114,6 @@ async function prepareAndStartBuildAsync({ projectDir, flags, moreBuilds, buildP
111
114
  nonInteractive: flags.nonInteractive,
112
115
  platform: buildProfile.platform,
113
116
  projectDir,
114
- skipProjectConfiguration: flags.skipProjectConfiguration,
115
117
  localBuildOptions: flags.localBuildOptions,
116
118
  });
117
119
  if (moreBuilds) {
@@ -11,6 +11,7 @@ const client_1 = require("../../graphql/client");
11
11
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
12
12
  const projectUtils_1 = require("../../project/projectUtils");
13
13
  const prompts_1 = require("../../prompts");
14
+ const json_1 = require("../../utils/json");
14
15
  const vcs_1 = require("../../vcs");
15
16
  async function createUpdateBranchOnAppAsync({ appId, name, }) {
16
17
  const result = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
@@ -38,6 +39,9 @@ exports.createUpdateBranchOnAppAsync = createUpdateBranchOnAppAsync;
38
39
  class BranchCreate extends EasCommand_1.default {
39
40
  async runAsync() {
40
41
  let { args: { name }, flags, } = await this.parse(BranchCreate);
42
+ if (flags.json) {
43
+ (0, json_1.enableJsonOutput)();
44
+ }
41
45
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
42
46
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
43
47
  const fullName = await (0, projectUtils_1.getProjectFullNameAsync)(exp);
@@ -58,10 +62,11 @@ class BranchCreate extends EasCommand_1.default {
58
62
  }
59
63
  const newBranch = await createUpdateBranchOnAppAsync({ appId: projectId, name });
60
64
  if (flags.json) {
61
- log_1.default.log(newBranch);
62
- return;
65
+ (0, json_1.printJsonOnlyOutput)(newBranch);
66
+ }
67
+ else {
68
+ log_1.default.withTick(`️Created a new branch: ${chalk_1.default.bold(newBranch.name)} on project ${chalk_1.default.bold(fullName)}.`);
63
69
  }
64
- log_1.default.withTick(`️Created a new branch: ${chalk_1.default.bold(newBranch.name)} on project ${chalk_1.default.bold(fullName)}.`);
65
70
  }
66
71
  }
67
72
  exports.default = BranchCreate;
@@ -10,6 +10,7 @@ const client_1 = require("../../graphql/client");
10
10
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
11
11
  const projectUtils_1 = require("../../project/projectUtils");
12
12
  const prompts_1 = require("../../prompts");
13
+ const json_1 = require("../../utils/json");
13
14
  async function getBranchInfoAsync({ appId, name, }) {
14
15
  const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
15
16
  .query((0, graphql_tag_1.default) `
@@ -51,6 +52,9 @@ class BranchDelete extends EasCommand_1.default {
51
52
  async runAsync() {
52
53
  var _a, _b;
53
54
  let { args: { name }, flags: { json: jsonFlag }, } = await this.parse(BranchDelete);
55
+ if (jsonFlag) {
56
+ (0, json_1.enableJsonOutput)();
57
+ }
54
58
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
55
59
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
56
60
  const fullName = await (0, projectUtils_1.getProjectFullNameAsync)(exp);
@@ -87,9 +91,11 @@ class BranchDelete extends EasCommand_1.default {
87
91
  branchId,
88
92
  });
89
93
  if (jsonFlag) {
90
- log_1.default.log(JSON.stringify(deletionResult));
94
+ (0, json_1.printJsonOnlyOutput)(deletionResult);
95
+ }
96
+ else {
97
+ log_1.default.withTick(`️Deleted branch "${name}" and all of its updates on project ${chalk_1.default.bold(fullName)}.`);
91
98
  }
92
- log_1.default.withTick(`️Deleted branch "${name}" and all of its updates on project ${chalk_1.default.bold(fullName)}.`);
93
99
  }
94
100
  }
95
101
  exports.default = BranchDelete;
@@ -14,6 +14,7 @@ const UpdateBranch_1 = require("../../graphql/types/UpdateBranch");
14
14
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
15
15
  const projectUtils_1 = require("../../project/projectUtils");
16
16
  const utils_1 = require("../../update/utils");
17
+ const json_1 = require("../../utils/json");
17
18
  const BRANCHES_LIMIT = 10000;
18
19
  async function listBranchesAsync({ projectId, }) {
19
20
  var _a, _b;
@@ -42,12 +43,15 @@ exports.listBranchesAsync = listBranchesAsync;
42
43
  class BranchList extends EasCommand_1.default {
43
44
  async runAsync() {
44
45
  const { flags } = await this.parse(BranchList);
46
+ if (flags.json) {
47
+ (0, json_1.enableJsonOutput)();
48
+ }
45
49
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
46
50
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
47
51
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
48
52
  const branches = await listBranchesAsync({ projectId });
49
53
  if (flags.json) {
50
- log_1.default.log(JSON.stringify(branches, null, 2));
54
+ (0, json_1.printJsonOnlyOutput)(branches);
51
55
  }
52
56
  else {
53
57
  const table = new cli_table3_1.default({
@@ -10,6 +10,7 @@ const client_1 = require("../../graphql/client");
10
10
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
11
11
  const projectUtils_1 = require("../../project/projectUtils");
12
12
  const prompts_1 = require("../../prompts");
13
+ const json_1 = require("../../utils/json");
13
14
  async function renameUpdateBranchOnAppAsync({ appId, name, newName, }) {
14
15
  const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
15
16
  .mutation((0, graphql_tag_1.default) `
@@ -34,6 +35,9 @@ async function renameUpdateBranchOnAppAsync({ appId, name, newName, }) {
34
35
  class BranchRename extends EasCommand_1.default {
35
36
  async runAsync() {
36
37
  let { flags: { json: jsonFlag, from: currentName, to: newName }, } = await this.parse(BranchRename);
38
+ if (jsonFlag) {
39
+ (0, json_1.enableJsonOutput)();
40
+ }
37
41
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
38
42
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
39
43
  const fullName = await (0, projectUtils_1.getProjectFullNameAsync)(exp);
@@ -68,10 +72,11 @@ class BranchRename extends EasCommand_1.default {
68
72
  newName: newName,
69
73
  });
70
74
  if (jsonFlag) {
71
- log_1.default.log(JSON.stringify(editedBranch));
72
- return;
75
+ (0, json_1.printJsonOnlyOutput)(editedBranch);
76
+ }
77
+ else {
78
+ log_1.default.withTick(`️Renamed branch from ${currentName} to ${chalk_1.default.bold(editedBranch.name)} on project ${chalk_1.default.bold(fullName)}.`);
73
79
  }
74
- log_1.default.withTick(`️Renamed branch from ${currentName} to ${chalk_1.default.bold(editedBranch.name)} on project ${chalk_1.default.bold(fullName)}.`);
75
80
  }
76
81
  }
77
82
  exports.default = BranchRename;
@@ -1,6 +1,4 @@
1
1
  import EasCommand from '../../commandUtils/EasCommand';
2
- import { ViewBranchQuery, ViewBranchQueryVariables } from '../../graphql/generated';
3
- export declare function viewUpdateBranchAsync({ appId, name, }: Pick<ViewBranchQueryVariables, 'appId' | 'name'>): Promise<ViewBranchQuery>;
4
2
  export default class BranchView extends EasCommand {
5
3
  static description: string;
6
4
  static args: {
@@ -1,65 +1,25 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.viewUpdateBranchAsync = void 0;
4
3
  const tslib_1 = require("tslib");
5
4
  const config_1 = require("@expo/config");
6
5
  const core_1 = require("@oclif/core");
7
6
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
8
7
  const cli_table3_1 = (0, tslib_1.__importDefault)(require("cli-table3"));
9
- const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
10
8
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
11
- const client_1 = require("../../graphql/client");
9
+ const UpdateQuery_1 = require("../../graphql/queries/UpdateQuery");
12
10
  const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
13
11
  const projectUtils_1 = require("../../project/projectUtils");
14
12
  const prompts_1 = require("../../prompts");
15
13
  const utils_1 = require("../../update/utils");
16
14
  const groupBy_1 = (0, tslib_1.__importDefault)(require("../../utils/expodash/groupBy"));
17
15
  const formatFields_1 = (0, tslib_1.__importDefault)(require("../../utils/formatFields"));
18
- const PAGE_LIMIT = 10000;
19
- async function viewUpdateBranchAsync({ appId, name, }) {
20
- const data = await (0, client_1.withErrorHandlingAsync)(client_1.graphqlClient
21
- .query((0, graphql_tag_1.default) `
22
- query ViewBranch($appId: String!, $name: String!, $limit: Int!) {
23
- app {
24
- byId(appId: $appId) {
25
- id
26
- updateBranchByName(name: $name) {
27
- id
28
- name
29
- updates(offset: 0, limit: $limit) {
30
- id
31
- group
32
- message
33
- createdAt
34
- runtimeVersion
35
- platform
36
- manifestFragment
37
- actor {
38
- id
39
- ... on User {
40
- username
41
- }
42
- ... on Robot {
43
- firstName
44
- }
45
- }
46
- }
47
- }
48
- }
49
- }
50
- }
51
- `, {
52
- appId,
53
- name,
54
- limit: PAGE_LIMIT,
55
- }, { additionalTypenames: ['UpdateBranch', 'Update'] })
56
- .toPromise());
57
- return data;
58
- }
59
- exports.viewUpdateBranchAsync = viewUpdateBranchAsync;
16
+ const json_1 = require("../../utils/json");
60
17
  class BranchView extends EasCommand_1.default {
61
18
  async runAsync() {
62
19
  let { args: { name }, flags: { json: jsonFlag }, } = await this.parse(BranchView);
20
+ if (jsonFlag) {
21
+ (0, json_1.enableJsonOutput)();
22
+ }
63
23
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
64
24
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
65
25
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
@@ -75,7 +35,7 @@ class BranchView extends EasCommand_1.default {
75
35
  validate: value => (value ? true : validationMessage),
76
36
  }));
77
37
  }
78
- const { app } = await viewUpdateBranchAsync({
38
+ const { app } = await UpdateQuery_1.UpdateQuery.viewBranchAsync({
79
39
  appId: projectId,
80
40
  name,
81
41
  });
@@ -85,33 +45,34 @@ class BranchView extends EasCommand_1.default {
85
45
  }
86
46
  const updates = Object.values((0, groupBy_1.default)(UpdateBranch.updates, u => u.group)).map(group => group[0]);
87
47
  if (jsonFlag) {
88
- log_1.default.log(JSON.stringify({ ...UpdateBranch, updates }));
89
- return;
48
+ (0, json_1.printJsonOnlyOutput)({ ...UpdateBranch, updates });
90
49
  }
91
- const groupTable = new cli_table3_1.default({
92
- head: utils_1.UPDATE_COLUMNS,
93
- wordWrap: true,
94
- });
95
- for (const update of updates) {
96
- groupTable.push([
97
- (0, utils_1.formatUpdate)(update),
98
- update.runtimeVersion,
99
- update.group,
100
- (0, utils_1.getPlatformsForGroup)({
101
- updates: UpdateBranch.updates,
102
- group: update.group,
103
- }),
104
- ]);
50
+ else {
51
+ const groupTable = new cli_table3_1.default({
52
+ head: utils_1.UPDATE_COLUMNS,
53
+ wordWrap: true,
54
+ });
55
+ for (const update of updates) {
56
+ groupTable.push([
57
+ (0, utils_1.formatUpdate)(update),
58
+ update.runtimeVersion,
59
+ update.group,
60
+ (0, utils_1.getPlatformsForGroup)({
61
+ updates: UpdateBranch.updates,
62
+ group: update.group,
63
+ }),
64
+ ]);
65
+ }
66
+ log_1.default.addNewLineIfNone();
67
+ log_1.default.log(chalk_1.default.bold('Branch:'));
68
+ log_1.default.log((0, formatFields_1.default)([
69
+ { label: 'Name', value: UpdateBranch.name },
70
+ { label: 'ID', value: UpdateBranch.id },
71
+ ]));
72
+ log_1.default.addNewLineIfNone();
73
+ log_1.default.log(chalk_1.default.bold('Recently published update groups:'));
74
+ log_1.default.log(groupTable.toString());
105
75
  }
106
- log_1.default.addNewLineIfNone();
107
- log_1.default.log(chalk_1.default.bold('Branch:'));
108
- log_1.default.log((0, formatFields_1.default)([
109
- { label: 'Name', value: UpdateBranch.name },
110
- { label: 'ID', value: UpdateBranch.id },
111
- ]));
112
- log_1.default.addNewLineIfNone();
113
- log_1.default.log(chalk_1.default.bold('Recently published update groups:'));
114
- log_1.default.log(groupTable.toString());
115
76
  }
116
77
  }
117
78
  exports.default = BranchView;
@@ -1,13 +1,20 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
+ const config_1 = require("@expo/config");
5
+ const eas_build_job_1 = require("@expo/eas-build-job");
4
6
  const core_1 = require("@oclif/core");
5
7
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
8
+ const UpdatesModule_1 = require("../../build/android/UpdatesModule");
9
+ const syncProjectConfiguration_1 = require("../../build/android/syncProjectConfiguration");
6
10
  const configure_1 = require("../../build/configure");
11
+ const UpdatesModule_2 = require("../../build/ios/UpdatesModule");
12
+ const updates_1 = require("../../build/utils/updates");
7
13
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
8
14
  const log_1 = (0, tslib_1.__importStar)(require("../../log"));
9
15
  const platform_1 = require("../../platform");
10
16
  const projectUtils_1 = require("../../project/projectUtils");
17
+ const workflow_1 = require("../../project/workflow");
11
18
  const prompts_1 = require("../../prompts");
12
19
  const vcs_1 = require("../../vcs");
13
20
  class BuildConfigure extends EasCommand_1.default {
@@ -15,15 +22,44 @@ class BuildConfigure extends EasCommand_1.default {
15
22
  var _a;
16
23
  const { flags } = await this.parse(BuildConfigure);
17
24
  log_1.default.log('💡 The following process will configure your iOS and/or Android project to be compatible with EAS Build. These changes only apply to your local project files and you can safely revert them at any time.');
18
- log_1.default.newLine();
19
25
  await (0, vcs_1.getVcsClient)().ensureRepoExistsAsync();
26
+ const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
27
+ const expoUpdatesIsInstalled = (0, updates_1.isExpoUpdatesInstalled)(projectDir);
20
28
  const platform = (_a = flags.platform) !== null && _a !== void 0 ? _a : (await promptForPlatformAsync());
21
- await (0, configure_1.configureAsync)({
22
- platform,
23
- projectDir: await (0, projectUtils_1.findProjectRootAsync)(),
24
- });
29
+ // clean up old Android configuration
30
+ if ([platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.All].includes(platform)) {
31
+ await (0, syncProjectConfiguration_1.cleanUpOldEasBuildGradleScriptAsync)(projectDir);
32
+ }
33
+ // ensure eas.json exists
25
34
  log_1.default.newLine();
26
- logSuccess(platform);
35
+ await (0, configure_1.ensureProjectConfiguredAsync)({
36
+ projectDir,
37
+ nonInteractive: false,
38
+ });
39
+ // configure expo-updates
40
+ if (expoUpdatesIsInstalled) {
41
+ const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
42
+ if ([platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.All].includes(platform)) {
43
+ const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.ANDROID);
44
+ if (workflow === eas_build_job_1.Workflow.GENERIC) {
45
+ await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)(projectDir, exp);
46
+ }
47
+ }
48
+ if ([platform_1.RequestedPlatform.Ios, platform_1.RequestedPlatform.All].includes(platform)) {
49
+ const workflow = await (0, workflow_1.resolveWorkflowAsync)(projectDir, eas_build_job_1.Platform.IOS);
50
+ if (workflow === eas_build_job_1.Workflow.GENERIC) {
51
+ await (0, UpdatesModule_2.syncUpdatesConfigurationAsync)(projectDir, exp);
52
+ }
53
+ }
54
+ }
55
+ log_1.default.addNewLineIfNone();
56
+ log_1.default.log(`🎉 Your project is ready to build.
57
+
58
+ - Run ${chalk_1.default.bold('eas build')} when you are ready to create your first build.
59
+ - Once the build is completed, run ${chalk_1.default.bold('eas submit')} to upload the app to app stores.
60
+ - ${(0, log_1.learnMore)('https://docs.expo.dev/build/introduction', {
61
+ learnMoreMessage: 'Learn more about other capabilities of EAS Build',
62
+ })}`);
27
63
  }
28
64
  }
29
65
  exports.default = BuildConfigure;
@@ -35,26 +71,8 @@ BuildConfigure.flags = {
35
71
  options: ['android', 'ios', 'all'],
36
72
  }),
37
73
  };
38
- function logSuccess(platform) {
39
- let platformsText = 'iOS and Android projects are';
40
- let storesText = 'the Apple App Store or Google Play Store';
41
- if (platform === 'android') {
42
- platformsText = 'Android project is';
43
- storesText = 'the Google Play Store';
44
- }
45
- else if (platform === 'ios') {
46
- platformsText = 'iOS project is';
47
- storesText = 'the Apple App Store Connect';
48
- }
49
- log_1.default.log(`🎉 Your ${platformsText} ready to build.
50
-
51
- - Run ${chalk_1.default.bold('eas build')} when you are ready to create your first build.
52
- - Once the build is completed, run ${chalk_1.default.bold('eas submit')} to upload the app to ${storesText}
53
- - ${(0, log_1.learnMore)('https://docs.expo.dev/build/introduction', {
54
- learnMoreMessage: 'Learn more about other capabilities of EAS Build',
55
- })}`);
56
- }
57
74
  async function promptForPlatformAsync() {
75
+ log_1.default.addNewLineIfNone();
58
76
  const { platform } = await (0, prompts_1.promptAsync)({
59
77
  type: 'select',
60
78
  message: 'Which platforms would you like to configure for EAS Build?',
@@ -9,6 +9,7 @@ export default class Build extends EasCommand {
9
9
  profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
10
10
  'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
11
  local: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
12
13
  wait: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
14
  'clear-cache': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
15
  'auto-submit': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
@@ -7,6 +7,7 @@ const core_1 = require("@oclif/core");
7
7
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
8
8
  const figures_1 = (0, tslib_1.__importDefault)(require("figures"));
9
9
  const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
10
+ const path_1 = (0, tslib_1.__importDefault)(require("path"));
10
11
  const runBuildAndSubmit_1 = require("../../build/runBuildAndSubmit");
11
12
  const repository_1 = require("../../build/utils/repository");
12
13
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
@@ -32,6 +33,9 @@ class Build extends EasCommand_1.default {
32
33
  async sanitizeFlagsAsync(flags) {
33
34
  var _a;
34
35
  const nonInteractive = flags['non-interactive'];
36
+ if (!flags.local && flags.output) {
37
+ core_1.Errors.error('--output is allowed only for local builds', { exit: 1 });
38
+ }
35
39
  if (!flags.platform && nonInteractive) {
36
40
  core_1.Errors.error('--platform is required when building in non-interactive mode', { exit: 1 });
37
41
  }
@@ -60,11 +64,14 @@ class Build extends EasCommand_1.default {
60
64
  const profile = flags['profile'];
61
65
  return {
62
66
  requestedPlatform,
63
- skipProjectConfiguration: flags['skip-project-configuration'],
64
67
  profile,
65
68
  nonInteractive,
66
69
  localBuildOptions: flags['local']
67
- ? { enable: true, verbose: true }
70
+ ? {
71
+ enable: true,
72
+ verbose: true,
73
+ artifactPath: flags.output && path_1.default.resolve(process.cwd(), flags.output),
74
+ }
68
75
  : {
69
76
  enable: false,
70
77
  },
@@ -107,6 +114,9 @@ Build.flags = {
107
114
  default: false,
108
115
  description: 'Run build locally [experimental]',
109
116
  }),
117
+ output: core_1.Flags.string({
118
+ description: 'Output path for local build',
119
+ }),
110
120
  wait: core_1.Flags.boolean({
111
121
  default: true,
112
122
  allowNo: true,
@@ -17,5 +17,6 @@ export default class BuildInspect extends EasCommand {
17
17
  };
18
18
  runAsync(): Promise<void>;
19
19
  private prepareOutputDirAsync;
20
+ private copyToOutputDirAsync;
20
21
  }
21
22
  export {};
@@ -28,19 +28,21 @@ class BuildInspect extends EasCommand_1.default {
28
28
  async runAsync() {
29
29
  const { flags } = await this.parse(BuildInspect);
30
30
  const outputDirectory = path_1.default.resolve(process.cwd(), flags.output);
31
+ const tmpWorkingdir = path_1.default.join((0, paths_1.getTmpDirectory)(), (0, uuid_1.v4)());
32
+ if (flags.force && process.cwd().startsWith(outputDirectory)) {
33
+ throw new Error(`This operation is not allowed, it would delete all files in ${outputDirectory} including the current project.`);
34
+ }
31
35
  await this.prepareOutputDirAsync(outputDirectory, flags.force);
32
36
  if (flags.stage === InspectStage.ARCHIVE) {
33
37
  const vcs = (0, vcs_1.getVcsClient)();
34
38
  await vcs.ensureRepoExistsAsync();
35
- await vcs.makeShallowCopyAsync(outputDirectory);
36
- log_1.default.withTick(`Project saved to ${outputDirectory}`);
39
+ await vcs.makeShallowCopyAsync(tmpWorkingdir);
40
+ await this.copyToOutputDirAsync(tmpWorkingdir, outputDirectory);
37
41
  }
38
42
  else {
39
43
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
40
- const tmpWorkingdir = path_1.default.join((0, paths_1.getTmpDirectory)(), (0, uuid_1.v4)());
41
44
  try {
42
45
  await (0, runBuildAndSubmit_1.runBuildAndSubmitAsync)(projectDir, {
43
- skipProjectConfiguration: false,
44
46
  nonInteractive: false,
45
47
  wait: true,
46
48
  clearCache: false,
@@ -68,19 +70,7 @@ class BuildInspect extends EasCommand_1.default {
68
70
  }
69
71
  }
70
72
  finally {
71
- const spinner = (0, ora_1.ora)().start(`Copying project build directory to ${outputDirectory}`);
72
- try {
73
- const tmpBuildDirectory = path_1.default.join(tmpWorkingdir, 'build');
74
- if (await fs_extra_1.default.pathExists(tmpBuildDirectory)) {
75
- await fs_extra_1.default.copy(tmpBuildDirectory, outputDirectory);
76
- }
77
- await fs_extra_1.default.remove(tmpWorkingdir);
78
- spinner.succeed(`Project build directory saved to ${outputDirectory}`);
79
- }
80
- catch (err) {
81
- spinner.fail();
82
- throw err;
83
- }
73
+ await this.copyToOutputDirAsync(path_1.default.join(tmpWorkingdir, 'build'), outputDirectory);
84
74
  }
85
75
  }
86
76
  }
@@ -95,6 +85,20 @@ class BuildInspect extends EasCommand_1.default {
95
85
  }
96
86
  await fs_extra_1.default.mkdirp(outputDir);
97
87
  }
88
+ async copyToOutputDirAsync(src, dst) {
89
+ const spinner = (0, ora_1.ora)().start(`Copying project directory to ${dst}`);
90
+ try {
91
+ if (await fs_extra_1.default.pathExists(src)) {
92
+ await fs_extra_1.default.copy(src, dst);
93
+ }
94
+ await fs_extra_1.default.remove(src);
95
+ spinner.succeed(`Project directory saved to ${dst}`);
96
+ }
97
+ catch (err) {
98
+ spinner.fail();
99
+ throw err;
100
+ }
101
+ }
98
102
  }
99
103
  exports.default = BuildInspect;
100
104
  BuildInspect.description = 'Inspect the state of the project at specific build stages. Useful for troubleshooting.';
@@ -115,6 +119,7 @@ BuildInspect.flags = {
115
119
  required: true,
116
120
  }),
117
121
  output: core_1.Flags.string({
122
+ char: 'o',
118
123
  description: 'Output directory.',
119
124
  required: true,
120
125
  helpValue: 'OUTPUT_DIRECTORY',
@@ -124,6 +129,7 @@ BuildInspect.flags = {
124
129
  default: false,
125
130
  }),
126
131
  verbose: core_1.Flags.boolean({
132
+ char: 'v',
127
133
  default: false,
128
134
  }),
129
135
  };
@@ -12,6 +12,7 @@ const log_1 = (0, tslib_1.__importDefault)(require("../../log"));
12
12
  const projectUtils_1 = require("../../project/projectUtils");
13
13
  const prompts_1 = require("../../prompts");
14
14
  const formatFields_1 = (0, tslib_1.__importDefault)(require("../../utils/formatFields"));
15
+ const json_1 = require("../../utils/json");
15
16
  const create_1 = require("../branch/create");
16
17
  async function createUpdateChannelOnAppAsync({ appId, channelName, branchId, }) {
17
18
  // Point the new channel at a branch with its same name.
@@ -41,6 +42,9 @@ exports.createUpdateChannelOnAppAsync = createUpdateChannelOnAppAsync;
41
42
  class ChannelCreate extends EasCommand_1.default {
42
43
  async runAsync() {
43
44
  let { args: { name: channelName }, flags: { json: jsonFlag }, } = await this.parse(ChannelCreate);
45
+ if (jsonFlag) {
46
+ (0, json_1.enableJsonOutput)();
47
+ }
44
48
  const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
45
49
  const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
46
50
  const projectId = await (0, projectUtils_1.getProjectIdAsync)(exp);
@@ -83,23 +87,24 @@ class ChannelCreate extends EasCommand_1.default {
83
87
  throw new Error(`Could not create channel with name ${channelName} on app with id ${projectId}`);
84
88
  }
85
89
  if (jsonFlag) {
86
- log_1.default.log(JSON.stringify(newChannel));
87
- return;
90
+ (0, json_1.printJsonOnlyOutput)(newChannel);
91
+ }
92
+ else {
93
+ log_1.default.addNewLineIfNone();
94
+ log_1.default.withTick(`Created a new channel on project ${chalk_1.default.bold(await (0, projectUtils_1.getProjectFullNameAsync)(exp))}`);
95
+ log_1.default.log((0, formatFields_1.default)([
96
+ { label: 'Name', value: newChannel.name },
97
+ { label: 'ID', value: newChannel.id },
98
+ ]));
99
+ log_1.default.addNewLineIfNone();
100
+ log_1.default.withTick(`${branchMessage} and have pointed the channel at it.`);
101
+ log_1.default.log((0, formatFields_1.default)([
102
+ { label: 'Name', value: newChannel.name },
103
+ { label: 'ID', value: branchId },
104
+ ]));
105
+ log_1.default.addNewLineIfNone();
106
+ log_1.default.log(chalk_1.default.bold('You can now update your app by publishing!'));
88
107
  }
89
- log_1.default.addNewLineIfNone();
90
- log_1.default.withTick(`Created a new channel on project ${chalk_1.default.bold(await (0, projectUtils_1.getProjectFullNameAsync)(exp))}`);
91
- log_1.default.log((0, formatFields_1.default)([
92
- { label: 'Name', value: newChannel.name },
93
- { label: 'ID', value: newChannel.id },
94
- ]));
95
- log_1.default.addNewLineIfNone();
96
- log_1.default.withTick(`${branchMessage} and have pointed the channel at it.`);
97
- log_1.default.log((0, formatFields_1.default)([
98
- { label: 'Name', value: newChannel.name },
99
- { label: 'ID', value: branchId },
100
- ]));
101
- log_1.default.addNewLineIfNone();
102
- log_1.default.log(chalk_1.default.bold('You can now update your app by publishing!'));
103
108
  }
104
109
  }
105
110
  exports.default = ChannelCreate;
@@ -0,0 +1,15 @@
1
+ import EasCommand from '../../commandUtils/EasCommand';
2
+ export default class ChannelDelete extends EasCommand {
3
+ static hidden: boolean;
4
+ static description: string;
5
+ static args: {
6
+ name: string;
7
+ required: boolean;
8
+ description: string;
9
+ }[];
10
+ static flags: {
11
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ 'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
13
+ };
14
+ runAsync(): Promise<void>;
15
+ }