eas-cli 0.41.1 → 0.44.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.
Files changed (113) hide show
  1. package/README.md +313 -157
  2. package/bin/dev +17 -0
  3. package/bin/dev.cmd +3 -0
  4. package/bin/run +3 -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/build/utils/devClient.js +3 -3
  27. package/build/commandUtils/EasCommand.d.ts +2 -1
  28. package/build/commandUtils/EasCommand.js +7 -4
  29. package/build/commands/account/login.d.ts +1 -0
  30. package/build/commands/account/login.js +1 -0
  31. package/build/commands/account/logout.d.ts +1 -0
  32. package/build/commands/account/logout.js +1 -0
  33. package/build/commands/account/view.d.ts +1 -0
  34. package/build/commands/account/view.js +1 -0
  35. package/build/commands/analytics.js +1 -1
  36. package/build/commands/branch/create.d.ts +1 -1
  37. package/build/commands/branch/create.js +11 -6
  38. package/build/commands/branch/delete.d.ts +1 -1
  39. package/build/commands/branch/delete.js +11 -5
  40. package/build/commands/branch/list.d.ts +1 -1
  41. package/build/commands/branch/list.js +8 -4
  42. package/build/commands/branch/rename.d.ts +3 -4
  43. package/build/commands/branch/rename.js +13 -8
  44. package/build/commands/branch/view.d.ts +1 -3
  45. package/build/commands/branch/view.js +35 -74
  46. package/build/commands/build/cancel.js +1 -1
  47. package/build/commands/build/configure.d.ts +1 -2
  48. package/build/commands/build/configure.js +38 -28
  49. package/build/commands/build/index.d.ts +12 -12
  50. package/build/commands/build/index.js +32 -21
  51. package/build/commands/build/inspect.d.ts +7 -7
  52. package/build/commands/build/inspect.js +31 -25
  53. package/build/commands/build/list.d.ts +13 -14
  54. package/build/commands/build/list.js +15 -15
  55. package/build/commands/build/view.d.ts +1 -1
  56. package/build/commands/build/view.js +3 -3
  57. package/build/commands/channel/create.d.ts +1 -1
  58. package/build/commands/channel/create.js +24 -19
  59. package/build/commands/channel/delete.d.ts +15 -0
  60. package/build/commands/channel/delete.js +124 -0
  61. package/build/commands/channel/edit.d.ts +2 -3
  62. package/build/commands/channel/edit.js +14 -9
  63. package/build/commands/channel/list.d.ts +1 -1
  64. package/build/commands/channel/list.js +17 -12
  65. package/build/commands/channel/rollout.d.ts +4 -5
  66. package/build/commands/channel/rollout.js +14 -10
  67. package/build/commands/channel/view.d.ts +1 -1
  68. package/build/commands/channel/view.js +19 -14
  69. package/build/commands/config.d.ts +2 -3
  70. package/build/commands/config.js +4 -4
  71. package/build/commands/device/list.d.ts +1 -2
  72. package/build/commands/device/list.js +3 -3
  73. package/build/commands/device/view.js +1 -1
  74. package/build/commands/secret/create.d.ts +4 -5
  75. package/build/commands/secret/create.js +6 -6
  76. package/build/commands/secret/delete.d.ts +1 -2
  77. package/build/commands/secret/delete.js +3 -3
  78. package/build/commands/submit.d.ts +9 -10
  79. package/build/commands/submit.js +13 -14
  80. package/build/commands/update/configure.js +1 -1
  81. package/build/commands/update/delete.d.ts +1 -1
  82. package/build/commands/update/delete.js +12 -7
  83. package/build/commands/update/index.d.ts +9 -10
  84. package/build/commands/update/index.js +29 -17
  85. package/build/commands/update/list.d.ts +10 -0
  86. package/build/commands/update/list.js +114 -0
  87. package/build/commands/update/view.d.ts +1 -1
  88. package/build/commands/update/view.js +25 -20
  89. package/build/commands/webhook/create.d.ts +3 -4
  90. package/build/commands/webhook/create.js +5 -5
  91. package/build/commands/webhook/delete.js +1 -1
  92. package/build/commands/webhook/list.d.ts +1 -2
  93. package/build/commands/webhook/list.js +3 -3
  94. package/build/commands/webhook/update.d.ts +4 -5
  95. package/build/commands/webhook/update.js +6 -6
  96. package/build/commands/webhook/view.js +1 -1
  97. package/build/credentials/ios/appstore/bundleIdCapabilities.js +0 -2
  98. package/build/credentials/ios/appstore/ensureAppExists.js +3 -1
  99. package/build/graphql/generated.d.ts +92 -30
  100. package/build/graphql/queries/UpdateQuery.d.ts +7 -0
  101. package/build/graphql/queries/UpdateQuery.js +85 -0
  102. package/build/index.d.ts +1 -1
  103. package/build/index.js +2 -2
  104. package/build/project/expoSdk.js +2 -2
  105. package/build/project/metroConfig.js +2 -2
  106. package/build/project/publish.js +1 -3
  107. package/build/user/actions.js +2 -2
  108. package/build/utils/expoCli.d.ts +3 -1
  109. package/build/utils/expoCli.js +13 -11
  110. package/build/vcs/clients/git.js +2 -2
  111. package/build/vcs/local.js +5 -1
  112. package/oclif.manifest.json +1 -1
  113. package/package.json +21 -14
@@ -1,9 +1,14 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const command_1 = require("@oclif/command");
4
+ const config_1 = require("@expo/config");
5
+ const core_1 = require("@oclif/core");
5
6
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
7
+ const UpdatesModule_1 = require("../../build/android/UpdatesModule");
8
+ const syncProjectConfiguration_1 = require("../../build/android/syncProjectConfiguration");
6
9
  const configure_1 = require("../../build/configure");
10
+ const UpdatesModule_2 = require("../../build/ios/UpdatesModule");
11
+ const updates_1 = require("../../build/utils/updates");
7
12
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
8
13
  const log_1 = (0, tslib_1.__importStar)(require("../../log"));
9
14
  const platform_1 = require("../../platform");
@@ -13,48 +18,53 @@ const vcs_1 = require("../../vcs");
13
18
  class BuildConfigure extends EasCommand_1.default {
14
19
  async runAsync() {
15
20
  var _a;
16
- const { flags } = this.parse(BuildConfigure);
21
+ const { flags } = await this.parse(BuildConfigure);
17
22
  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
23
  await (0, vcs_1.getVcsClient)().ensureRepoExistsAsync();
24
+ const projectDir = await (0, projectUtils_1.findProjectRootAsync)();
25
+ const expoUpdatesIsInstalled = (0, updates_1.isExpoUpdatesInstalled)(projectDir);
20
26
  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
- });
27
+ // clean up old Android configuration
28
+ if ([platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.All].includes(platform)) {
29
+ await (0, syncProjectConfiguration_1.cleanUpOldEasBuildGradleScriptAsync)(projectDir);
30
+ }
31
+ // ensure eas.json exists
25
32
  log_1.default.newLine();
26
- logSuccess(platform);
33
+ await (0, configure_1.ensureProjectConfiguredAsync)({
34
+ projectDir,
35
+ nonInteractive: false,
36
+ });
37
+ // configure expo-updates
38
+ if (expoUpdatesIsInstalled) {
39
+ const { exp } = (0, config_1.getConfig)(projectDir, { skipSDKVersionRequirement: true });
40
+ if ([platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.All].includes(platform)) {
41
+ await (0, UpdatesModule_1.syncUpdatesConfigurationAsync)(projectDir, exp);
42
+ }
43
+ if ([platform_1.RequestedPlatform.Ios, platform_1.RequestedPlatform.All].includes(platform)) {
44
+ await (0, UpdatesModule_2.syncUpdatesConfigurationAsync)(projectDir, exp);
45
+ }
46
+ }
47
+ log_1.default.addNewLineIfNone();
48
+ log_1.default.log(`🎉 Your project is ready to build.
49
+
50
+ - Run ${chalk_1.default.bold('eas build')} when you are ready to create your first build.
51
+ - Once the build is completed, run ${chalk_1.default.bold('eas submit')} to upload the app to app stores.
52
+ - ${(0, log_1.learnMore)('https://docs.expo.dev/build/introduction', {
53
+ learnMoreMessage: 'Learn more about other capabilities of EAS Build',
54
+ })}`);
27
55
  }
28
56
  }
29
57
  exports.default = BuildConfigure;
30
58
  BuildConfigure.description = 'Configure the project to support EAS Build.';
31
59
  BuildConfigure.flags = {
32
- platform: command_1.flags.enum({
60
+ platform: core_1.Flags.enum({
33
61
  description: 'Platform to configure',
34
62
  char: 'p',
35
63
  options: ['android', 'ios', 'all'],
36
64
  }),
37
65
  };
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
66
  async function promptForPlatformAsync() {
67
+ log_1.default.addNewLineIfNone();
58
68
  const { platform } = await (0, prompts_1.promptAsync)({
59
69
  type: 'select',
60
70
  message: 'Which platforms would you like to configure for EAS Build?',
@@ -1,19 +1,19 @@
1
- import { flags } from '@oclif/command';
2
1
  import EasCommand from '../../commandUtils/EasCommand';
3
2
  export default class Build extends EasCommand {
4
3
  static description: string;
5
4
  static flags: {
6
- platform: flags.IOptionFlag<string>;
7
- 'skip-credentials-check': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
8
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
9
- 'skip-project-configuration': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
10
- profile: flags.IOptionFlag<string | undefined>;
11
- 'non-interactive': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
12
- local: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
13
- wait: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
14
- 'clear-cache': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
15
- 'auto-submit': import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
16
- 'auto-submit-with-profile': flags.IOptionFlag<string | undefined>;
5
+ platform: import("@oclif/core/lib/interfaces").OptionFlag<string>;
6
+ 'skip-credentials-check': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
7
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
8
+ 'skip-project-configuration': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
10
+ 'non-interactive': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
11
+ local: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
12
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
13
+ wait: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
14
+ 'clear-cache': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
15
+ 'auto-submit': import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
+ 'auto-submit-with-profile': import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
17
17
  };
18
18
  runAsync(): Promise<void>;
19
19
  private sanitizeFlagsAsync;
@@ -3,11 +3,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.handleDeprecatedEasJsonAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const eas_json_1 = require("@expo/eas-json");
6
- const command_1 = require("@oclif/command");
7
- const errors_1 = require("@oclif/errors");
6
+ const core_1 = require("@oclif/core");
8
7
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
9
8
  const figures_1 = (0, tslib_1.__importDefault)(require("figures"));
10
9
  const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
10
+ const path_1 = (0, tslib_1.__importDefault)(require("path"));
11
11
  const runBuildAndSubmit_1 = require("../../build/runBuildAndSubmit");
12
12
  const repository_1 = require("../../build/utils/repository");
13
13
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
@@ -21,7 +21,7 @@ const vcs_1 = require("../../vcs");
21
21
  const git_1 = (0, tslib_1.__importDefault)(require("../../vcs/clients/git"));
22
22
  class Build extends EasCommand_1.default {
23
23
  async runAsync() {
24
- const { flags: rawFlags } = this.parse(Build);
24
+ const { flags: rawFlags } = await this.parse(Build);
25
25
  if (rawFlags.json) {
26
26
  (0, json_1.enableJsonOutput)();
27
27
  }
@@ -33,23 +33,28 @@ class Build extends EasCommand_1.default {
33
33
  async sanitizeFlagsAsync(flags) {
34
34
  var _a;
35
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
+ }
36
39
  if (!flags.platform && nonInteractive) {
37
- (0, errors_1.error)('--platform is required when building in non-interactive mode', { exit: 1 });
40
+ core_1.Errors.error('--platform is required when building in non-interactive mode', { exit: 1 });
38
41
  }
39
42
  if (flags.json && !nonInteractive) {
40
- (0, errors_1.error)('--json is allowed only when building in non-interactive mode', { exit: 1 });
43
+ core_1.Errors.error('--json is allowed only when building in non-interactive mode', { exit: 1 });
41
44
  }
42
45
  const requestedPlatform = await (0, platform_1.selectRequestedPlatformAsync)(flags.platform);
43
46
  if (flags.local) {
44
47
  if (flags['auto-submit'] || flags['auto-submit-with-profile'] !== undefined) {
45
48
  // TODO: implement this
46
- (0, errors_1.error)('Auto-submits are not yet supported when building locally', { exit: 1 });
49
+ core_1.Errors.error('Auto-submits are not yet supported when building locally', { exit: 1 });
47
50
  }
48
51
  if (requestedPlatform === platform_1.RequestedPlatform.All) {
49
- (0, errors_1.error)('Builds for multiple platforms are not supported with flag --local', { exit: 1 });
52
+ core_1.Errors.error('Builds for multiple platforms are not supported with flag --local', {
53
+ exit: 1,
54
+ });
50
55
  }
51
56
  else if (process.platform !== 'darwin' && requestedPlatform === platform_1.RequestedPlatform.Ios) {
52
- (0, errors_1.error)('Unsupported platform, macOS is required to build apps for iOS', { exit: 1 });
57
+ core_1.Errors.error('Unsupported platform, macOS is required to build apps for iOS', { exit: 1 });
53
58
  }
54
59
  }
55
60
  if (flags['skip-credentials-check']) {
@@ -59,11 +64,14 @@ class Build extends EasCommand_1.default {
59
64
  const profile = flags['profile'];
60
65
  return {
61
66
  requestedPlatform,
62
- skipProjectConfiguration: flags['skip-project-configuration'],
63
67
  profile,
64
68
  nonInteractive,
65
69
  localBuildOptions: flags['local']
66
- ? { enable: true, verbose: true }
70
+ ? {
71
+ enable: true,
72
+ verbose: true,
73
+ artifactPath: flags.output && path_1.default.resolve(process.cwd(), flags.output),
74
+ }
67
75
  : {
68
76
  enable: false,
69
77
  },
@@ -78,49 +86,52 @@ class Build extends EasCommand_1.default {
78
86
  exports.default = Build;
79
87
  Build.description = 'Start a build';
80
88
  Build.flags = {
81
- platform: command_1.flags.enum({
89
+ platform: core_1.Flags.enum({
82
90
  char: 'p',
83
91
  options: ['android', 'ios', 'all'],
84
92
  }),
85
- 'skip-credentials-check': command_1.flags.boolean({
93
+ 'skip-credentials-check': core_1.Flags.boolean({
86
94
  default: false,
87
95
  hidden: true,
88
96
  }),
89
- json: command_1.flags.boolean({
97
+ json: core_1.Flags.boolean({
90
98
  description: 'Enable JSON output, non-JSON messages will be printed to stderr',
91
99
  default: false,
92
100
  }),
93
- 'skip-project-configuration': command_1.flags.boolean({
101
+ 'skip-project-configuration': core_1.Flags.boolean({
94
102
  default: false,
95
103
  description: 'Skip project configuration',
96
104
  }),
97
- profile: command_1.flags.string({
105
+ profile: core_1.Flags.string({
98
106
  description: 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
99
107
  helpValue: 'PROFILE_NAME',
100
108
  }),
101
- 'non-interactive': command_1.flags.boolean({
109
+ 'non-interactive': core_1.Flags.boolean({
102
110
  default: false,
103
111
  description: 'Run command in non-interactive mode',
104
112
  }),
105
- local: command_1.flags.boolean({
113
+ local: core_1.Flags.boolean({
106
114
  default: false,
107
115
  description: 'Run build locally [experimental]',
108
116
  }),
109
- wait: command_1.flags.boolean({
117
+ output: core_1.Flags.string({
118
+ description: 'Output path for local build',
119
+ }),
120
+ wait: core_1.Flags.boolean({
110
121
  default: true,
111
122
  allowNo: true,
112
123
  description: 'Wait for build(s) to complete',
113
124
  }),
114
- 'clear-cache': command_1.flags.boolean({
125
+ 'clear-cache': core_1.Flags.boolean({
115
126
  default: false,
116
127
  description: 'Clear cache before the build',
117
128
  }),
118
- 'auto-submit': command_1.flags.boolean({
129
+ 'auto-submit': core_1.Flags.boolean({
119
130
  default: false,
120
131
  description: 'Submit on build complete using the submit profile with the same name as the build profile',
121
132
  exclusive: ['auto-submit-with-profile'],
122
133
  }),
123
- 'auto-submit-with-profile': command_1.flags.string({
134
+ 'auto-submit-with-profile': core_1.Flags.string({
124
135
  description: 'Submit on build complete using the submit profile with provided name',
125
136
  helpValue: 'PROFILE_NAME',
126
137
  exclusive: ['auto-submit'],
@@ -1,4 +1,3 @@
1
- import { flags } from '@oclif/command';
2
1
  import EasCommand from '../../commandUtils/EasCommand';
3
2
  import { RequestedPlatform } from '../../platform';
4
3
  declare enum InspectStage {
@@ -9,14 +8,15 @@ declare enum InspectStage {
9
8
  export default class BuildInspect extends EasCommand {
10
9
  static description: string;
11
10
  static flags: {
12
- platform: flags.IOptionFlag<RequestedPlatform>;
13
- profile: flags.IOptionFlag<string | undefined>;
14
- stage: flags.IOptionFlag<InspectStage>;
15
- output: flags.IOptionFlag<string>;
16
- force: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
17
- verbose: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
11
+ platform: import("@oclif/core/lib/interfaces").OptionFlag<RequestedPlatform>;
12
+ profile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
13
+ stage: import("@oclif/core/lib/interfaces").OptionFlag<InspectStage>;
14
+ output: import("@oclif/core/lib/interfaces").OptionFlag<string>;
15
+ force: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
16
+ verbose: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
18
17
  };
19
18
  runAsync(): Promise<void>;
20
19
  private prepareOutputDirAsync;
20
+ private copyToOutputDirAsync;
21
21
  }
22
22
  export {};
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
- const command_1 = require("@oclif/command");
4
+ const core_1 = require("@oclif/core");
5
5
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
6
6
  const fs_extra_1 = (0, tslib_1.__importDefault)(require("fs-extra"));
7
7
  const path_1 = (0, tslib_1.__importDefault)(require("path"));
@@ -26,21 +26,23 @@ const STAGE_DESCRIPTION = `Stage of the build you want to inspect.
26
26
  post-build - builds the native project and leaves the output directory for inspection`;
27
27
  class BuildInspect extends EasCommand_1.default {
28
28
  async runAsync() {
29
- const { flags } = this.parse(BuildInspect);
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,35 +85,51 @@ 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.';
101
105
  BuildInspect.flags = {
102
- platform: command_1.flags.enum({
106
+ platform: core_1.Flags.enum({
103
107
  char: 'p',
104
108
  options: [platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.Ios],
105
109
  required: true,
106
110
  }),
107
- profile: command_1.flags.string({
111
+ profile: core_1.Flags.string({
108
112
  description: 'Name of the build profile from eas.json. Defaults to "production" if defined in eas.json.',
109
113
  helpValue: 'PROFILE_NAME',
110
114
  }),
111
- stage: command_1.flags.enum({
115
+ stage: core_1.Flags.enum({
112
116
  char: 's',
113
117
  description: STAGE_DESCRIPTION,
114
118
  options: [InspectStage.ARCHIVE, InspectStage.PRE_BUILD, InspectStage.POST_BUILD],
115
119
  required: true,
116
120
  }),
117
- output: command_1.flags.string({
121
+ output: core_1.Flags.string({
122
+ char: 'o',
118
123
  description: 'Output directory.',
119
124
  required: true,
120
125
  helpValue: 'OUTPUT_DIRECTORY',
121
126
  }),
122
- force: command_1.flags.boolean({
127
+ force: core_1.Flags.boolean({
123
128
  description: 'Delete OUTPUT_DIRECTORY if it already exists.',
124
129
  default: false,
125
130
  }),
126
- verbose: command_1.flags.boolean({
131
+ verbose: core_1.Flags.boolean({
132
+ char: 'v',
127
133
  default: false,
128
134
  }),
129
135
  };
@@ -1,23 +1,22 @@
1
- import { flags } from '@oclif/command';
2
1
  import { BuildDistributionType, BuildStatus } from '../../build/types';
3
2
  import EasCommand from '../../commandUtils/EasCommand';
4
3
  import { RequestedPlatform } from '../../platform';
5
4
  export default class BuildList extends EasCommand {
6
5
  static description: string;
7
6
  static flags: {
8
- platform: flags.IOptionFlag<RequestedPlatform>;
9
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
10
- status: flags.IOptionFlag<BuildStatus>;
11
- distribution: flags.IOptionFlag<BuildDistributionType>;
12
- channel: flags.IOptionFlag<string | undefined>;
13
- appVersion: flags.IOptionFlag<string | undefined>;
14
- appBuildVersion: flags.IOptionFlag<string | undefined>;
15
- sdkVersion: flags.IOptionFlag<string | undefined>;
16
- runtimeVersion: flags.IOptionFlag<string | undefined>;
17
- appIdentifier: flags.IOptionFlag<string | undefined>;
18
- buildProfile: flags.IOptionFlag<string | undefined>;
19
- gitCommitHash: flags.IOptionFlag<string | undefined>;
20
- limit: import("@oclif/parser/lib/flags").IOptionFlag<number | undefined>;
7
+ platform: import("@oclif/core/lib/interfaces").OptionFlag<RequestedPlatform>;
8
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
+ status: import("@oclif/core/lib/interfaces").OptionFlag<BuildStatus>;
10
+ distribution: import("@oclif/core/lib/interfaces").OptionFlag<BuildDistributionType>;
11
+ channel: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
12
+ appVersion: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
13
+ appBuildVersion: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
14
+ sdkVersion: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
15
+ runtimeVersion: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
16
+ appIdentifier: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
17
+ buildProfile: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
18
+ gitCommitHash: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined>;
19
+ limit: import("@oclif/core/lib/interfaces").OptionFlag<number | undefined>;
21
20
  };
22
21
  runAsync(): Promise<void>;
23
22
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const config_1 = require("@expo/config");
5
- const command_1 = require("@oclif/command");
5
+ const core_1 = require("@oclif/core");
6
6
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
7
7
  const types_1 = require("../../build/types");
8
8
  const formatBuild_1 = require("../../build/utils/formatBuild");
@@ -16,7 +16,7 @@ const projectUtils_1 = require("../../project/projectUtils");
16
16
  const json_1 = require("../../utils/json");
17
17
  class BuildList extends EasCommand_1.default {
18
18
  async runAsync() {
19
- const { flags } = this.parse(BuildList);
19
+ const { flags } = await this.parse(BuildList);
20
20
  const { json, platform: requestedPlatform, status: buildStatus, distribution: buildDistribution, limit = 10, } = flags;
21
21
  if (json) {
22
22
  (0, json_1.enableJsonOutput)();
@@ -76,13 +76,13 @@ class BuildList extends EasCommand_1.default {
76
76
  exports.default = BuildList;
77
77
  BuildList.description = 'list all builds for your project';
78
78
  BuildList.flags = {
79
- platform: command_1.flags.enum({
79
+ platform: core_1.Flags.enum({
80
80
  options: [platform_1.RequestedPlatform.All, platform_1.RequestedPlatform.Android, platform_1.RequestedPlatform.Ios],
81
81
  }),
82
- json: command_1.flags.boolean({
82
+ json: core_1.Flags.boolean({
83
83
  description: 'Enable JSON output, non-JSON messages will be printed to stderr',
84
84
  }),
85
- status: command_1.flags.enum({
85
+ status: core_1.Flags.enum({
86
86
  options: [
87
87
  types_1.BuildStatus.NEW,
88
88
  types_1.BuildStatus.IN_QUEUE,
@@ -92,22 +92,22 @@ BuildList.flags = {
92
92
  types_1.BuildStatus.CANCELED,
93
93
  ],
94
94
  }),
95
- distribution: command_1.flags.enum({
95
+ distribution: core_1.Flags.enum({
96
96
  options: [
97
97
  types_1.BuildDistributionType.STORE,
98
98
  types_1.BuildDistributionType.INTERNAL,
99
99
  types_1.BuildDistributionType.SIMULATOR,
100
100
  ],
101
101
  }),
102
- channel: command_1.flags.string(),
103
- appVersion: command_1.flags.string(),
104
- appBuildVersion: command_1.flags.string(),
105
- sdkVersion: command_1.flags.string(),
106
- runtimeVersion: command_1.flags.string(),
107
- appIdentifier: command_1.flags.string(),
108
- buildProfile: command_1.flags.string(),
109
- gitCommitHash: command_1.flags.string(),
110
- limit: command_1.flags.integer(),
102
+ channel: core_1.Flags.string(),
103
+ appVersion: core_1.Flags.string(),
104
+ appBuildVersion: core_1.Flags.string(),
105
+ sdkVersion: core_1.Flags.string(),
106
+ runtimeVersion: core_1.Flags.string(),
107
+ appIdentifier: core_1.Flags.string(),
108
+ buildProfile: core_1.Flags.string(),
109
+ gitCommitHash: core_1.Flags.string(),
110
+ limit: core_1.Flags.integer(),
111
111
  };
112
112
  const toAppPlatform = (requestedPlatform) => {
113
113
  if (!requestedPlatform || requestedPlatform === platform_1.RequestedPlatform.All) {
@@ -5,7 +5,7 @@ export default class BuildView extends EasCommand {
5
5
  name: string;
6
6
  }[];
7
7
  static flags: {
8
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
8
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
9
9
  };
10
10
  runAsync(): Promise<void>;
11
11
  }
@@ -2,7 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const config_1 = require("@expo/config");
5
- const command_1 = require("@oclif/command");
5
+ const core_1 = require("@oclif/core");
6
6
  const formatBuild_1 = require("../../build/utils/formatBuild");
7
7
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
8
8
  const BuildQuery_1 = require("../../graphql/queries/BuildQuery");
@@ -12,7 +12,7 @@ const projectUtils_1 = require("../../project/projectUtils");
12
12
  const json_1 = require("../../utils/json");
13
13
  class BuildView extends EasCommand_1.default {
14
14
  async runAsync() {
15
- const { args: { BUILD_ID: buildId }, flags, } = this.parse(BuildView);
15
+ const { args: { BUILD_ID: buildId }, flags, } = await this.parse(BuildView);
16
16
  if (flags.json) {
17
17
  (0, json_1.enableJsonOutput)();
18
18
  }
@@ -62,7 +62,7 @@ exports.default = BuildView;
62
62
  BuildView.description = 'view a build for your project';
63
63
  BuildView.args = [{ name: 'BUILD_ID' }];
64
64
  BuildView.flags = {
65
- json: command_1.flags.boolean({
65
+ json: core_1.Flags.boolean({
66
66
  description: 'Enable JSON output, non-JSON messages will be printed to stderr',
67
67
  }),
68
68
  };
@@ -13,7 +13,7 @@ export default class ChannelCreate extends EasCommand {
13
13
  description: string;
14
14
  }[];
15
15
  static flags: {
16
- json: import("@oclif/parser/lib/flags").IBooleanFlag<boolean>;
16
+ json: import("@oclif/core/lib/interfaces").BooleanFlag<boolean>;
17
17
  };
18
18
  runAsync(): Promise<void>;
19
19
  }
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.createUpdateChannelOnAppAsync = void 0;
4
4
  const tslib_1 = require("tslib");
5
5
  const config_1 = require("@expo/config");
6
- const command_1 = require("@oclif/command");
6
+ const core_1 = require("@oclif/core");
7
7
  const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
8
8
  const graphql_tag_1 = (0, tslib_1.__importDefault)(require("graphql-tag"));
9
9
  const EasCommand_1 = (0, tslib_1.__importDefault)(require("../../commandUtils/EasCommand"));
@@ -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.
@@ -40,7 +41,10 @@ async function createUpdateChannelOnAppAsync({ appId, channelName, branchId, })
40
41
  exports.createUpdateChannelOnAppAsync = createUpdateChannelOnAppAsync;
41
42
  class ChannelCreate extends EasCommand_1.default {
42
43
  async runAsync() {
43
- let { args: { name: channelName }, flags: { json: jsonFlag }, } = this.parse(ChannelCreate);
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;
@@ -112,7 +117,7 @@ ChannelCreate.args = [
112
117
  },
113
118
  ];
114
119
  ChannelCreate.flags = {
115
- json: command_1.flags.boolean({
120
+ json: core_1.Flags.boolean({
116
121
  description: 'print output as a JSON object with the new channel ID, name and branch mapping.',
117
122
  default: false,
118
123
  }),