eas-cli 14.1.0 → 14.3.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 (34) hide show
  1. package/README.md +70 -70
  2. package/build/branch/utils.d.ts +1 -1
  3. package/build/branch/utils.js +1 -1
  4. package/build/commandUtils/context/contextUtils/findProjectDirAndVerifyProjectSetupAsync.js +5 -1
  5. package/build/commandUtils/context/contextUtils/loadServerSideEnvironmentVariablesAsync.js +2 -2
  6. package/build/commandUtils/flags.d.ts +1 -1
  7. package/build/commands/branch/create.js +1 -1
  8. package/build/commands/build/version/sync.js +1 -1
  9. package/build/commands/device/delete.js +2 -2
  10. package/build/commands/device/rename.js +2 -2
  11. package/build/commands/env/create.d.ts +1 -1
  12. package/build/commands/env/exec.js +6 -14
  13. package/build/commands/env/update.d.ts +1 -1
  14. package/build/commands/update/index.js +1 -0
  15. package/build/commands/worker/alias.js +1 -1
  16. package/build/commands/worker/deploy.d.ts +2 -51
  17. package/build/commands/worker/deploy.js +22 -7
  18. package/build/commands/workflow/run.js +12 -3
  19. package/build/devices/actions/create/currentMachineMethod.js +1 -1
  20. package/build/devices/actions/create/inputMethod.js +1 -1
  21. package/build/graphql/generated.d.ts +60 -6
  22. package/build/graphql/generated.js +12 -6
  23. package/build/graphql/mutations/WorkflowRevisionMutation.d.ts +2 -2
  24. package/build/project/fetchOrCreateProjectIDForWriteToConfigWithConfirmationAsync.js +2 -2
  25. package/build/project/publish.js +6 -2
  26. package/build/project/uploadAccountScopedFileAsync.d.ts +14 -0
  27. package/build/project/uploadAccountScopedFileAsync.js +35 -0
  28. package/build/utils/statuspageService.js +2 -2
  29. package/build/worker/upload.d.ts +2 -0
  30. package/build/worker/upload.js +6 -4
  31. package/oclif.manifest.json +8 -2
  32. package/package.json +8 -7
  33. package/build/project/uploadAccountScopedEasJsonAsync.d.ts +0 -12
  34. package/build/project/uploadAccountScopedEasJsonAsync.js +0 -34
@@ -399,7 +399,11 @@ async function getBranchNameForCommandAsync({ graphqlClient, projectId, channelN
399
399
  return branchNameArg;
400
400
  }
401
401
  if (autoFlag) {
402
- return await (0, utils_1.getDefaultBranchNameAsync)(vcsClient);
402
+ const defaultBranchNameFromVcs = await (0, utils_1.getDefaultBranchNameAsync)(vcsClient);
403
+ if (!defaultBranchNameFromVcs) {
404
+ throw new Error('Must supply --branch or --channel for branch name as auto-detection of branch name via --auto is not supported when no VCS is present.');
405
+ }
406
+ return defaultBranchNameFromVcs;
403
407
  }
404
408
  else if (nonInteractive) {
405
409
  throw new Error('Must supply --channel, --branch or --auto when in non-interactive mode.');
@@ -423,7 +427,7 @@ async function getBranchNameForCommandAsync({ graphqlClient, projectId, channelN
423
427
  type: 'text',
424
428
  name: 'name',
425
429
  message: 'No branches found. Provide a branch name:',
426
- initial: await (0, utils_1.getDefaultBranchNameAsync)(vcsClient),
430
+ initial: (await (0, utils_1.getDefaultBranchNameAsync)(vcsClient)) ?? undefined,
427
431
  validate: value => (value ? true : 'Branch name may not be empty.'),
428
432
  });
429
433
  branchName = name;
@@ -0,0 +1,14 @@
1
+ import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
2
+ /**
3
+ * Uploads a file to GCS as account-scoped object.
4
+ * Used in workflows. Takes care of logging progress.
5
+ * (Uses file name when mentioning file in logs.)
6
+ */
7
+ export declare function uploadAccountScopedFileAsync({ graphqlClient, accountId, filePath, maxSizeBytes, }: {
8
+ graphqlClient: ExpoGraphqlClient;
9
+ accountId: string;
10
+ filePath: string;
11
+ maxSizeBytes: number;
12
+ }): Promise<{
13
+ fileBucketKey: string;
14
+ }>;
@@ -0,0 +1,35 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.uploadAccountScopedFileAsync = void 0;
4
+ const tslib_1 = require("tslib");
5
+ const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
+ const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
7
+ const node_path_1 = tslib_1.__importDefault(require("node:path"));
8
+ const generated_1 = require("../graphql/generated");
9
+ const uploads_1 = require("../uploads");
10
+ const files_1 = require("../utils/files");
11
+ const progress_1 = require("../utils/progress");
12
+ /**
13
+ * Uploads a file to GCS as account-scoped object.
14
+ * Used in workflows. Takes care of logging progress.
15
+ * (Uses file name when mentioning file in logs.)
16
+ */
17
+ async function uploadAccountScopedFileAsync({ graphqlClient, accountId, filePath, maxSizeBytes, }) {
18
+ const fileName = node_path_1.default.basename(filePath);
19
+ const fileStat = await node_fs_1.default.promises.stat(filePath);
20
+ if (fileStat.size > maxSizeBytes) {
21
+ throw new Error(`File is too big. Maximum allowed size is ${(0, files_1.formatBytes)(maxSizeBytes)}.`);
22
+ }
23
+ const fileBucketKey = await (0, uploads_1.uploadAccountScopedFileAtPathToGCSAsync)(graphqlClient, {
24
+ accountId,
25
+ type: generated_1.AccountUploadSessionType.WorkflowsProjectSources,
26
+ path: filePath,
27
+ handleProgressEvent: (0, progress_1.createProgressTracker)({
28
+ total: fileStat.size,
29
+ message: ratio => `Uploading ${fileName} to EAS (${(0, files_1.formatBytes)(fileStat.size * ratio)} / ${(0, files_1.formatBytes)(fileStat.size)})`,
30
+ completedMessage: (duration) => `Uploaded ${fileName} to EAS ${chalk_1.default.dim(duration)}`,
31
+ }),
32
+ });
33
+ return { fileBucketKey };
34
+ }
35
+ exports.uploadAccountScopedFileAsync = uploadAccountScopedFileAsync;
@@ -29,9 +29,9 @@ function warnAboutServiceOutage(service) {
29
29
  log_1.default.warn(chalk_1.default.bold(`${humanReadableServiceName[service.name]} is experiencing a ${outageType} outage.`));
30
30
  if (service.incidents.length > 0) {
31
31
  const [currentIncident] = service.incidents;
32
- log_1.default.warn(`Reason: ${currentIncident.name}`);
32
+ log_1.default.warn(`Reason: ${currentIncident.name}.`);
33
33
  }
34
- log_1.default.warn(`All information on service status and incidents available at ${(0, log_1.link)('https://status.expo.dev/')}.`);
34
+ log_1.default.warn(`All information on service status and incidents available at ${(0, log_1.link)('https://status.expo.dev/')}`);
35
35
  log_1.default.newLine();
36
36
  }
37
37
  async function getStatuspageServiceAsync(graphqlClient, serviceNames) {
@@ -1,3 +1,5 @@
1
+ /// <reference types="node" />
2
+ /// <reference types="node" />
1
3
  import { HeadersInit, RequestInit, Response } from 'node-fetch';
2
4
  export interface UploadParams extends Omit<RequestInit, 'signal' | 'body'> {
3
5
  filePath: string;
@@ -85,20 +85,22 @@ async function uploadAsync(params) {
85
85
  catch (error) {
86
86
  return retry(error);
87
87
  }
88
+ const getErrorMessageAsync = async () => {
89
+ const body = await response.json().catch(() => null);
90
+ return body?.error ?? `Upload of "${filePath}" failed: ${response.statusText}`;
91
+ };
88
92
  if (response.status === 408 ||
89
93
  response.status === 409 ||
90
94
  response.status === 429 ||
91
95
  (response.status >= 500 && response.status <= 599)) {
92
- const message = `Upload of "${filePath}" failed: ${response.statusText}`;
93
- const text = await response.text().catch(() => null);
94
- return retry(new Error(text ? `${message}\n${text}` : message));
96
+ return retry(new Error(await getErrorMessageAsync()));
95
97
  }
96
98
  else if (response.status === 413) {
97
99
  const message = `Upload of "${filePath}" failed: File size exceeded the upload limit`;
98
100
  throw new Error(message);
99
101
  }
100
102
  else if (!response.ok) {
101
- throw new Error(`Upload of "${filePath}" failed: ${response.statusText}`);
103
+ throw new Error(await getErrorMessageAsync());
102
104
  }
103
105
  return {
104
106
  params,
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "14.1.0",
2
+ "version": "14.3.0",
3
3
  "commands": {
4
4
  "analytics": {
5
5
  "id": "analytics",
@@ -3810,10 +3810,16 @@
3810
3810
  "multiple": false,
3811
3811
  "default": "dist"
3812
3812
  },
3813
+ "dry-run": {
3814
+ "name": "dry-run",
3815
+ "type": "boolean",
3816
+ "description": "Outputs a tarball of the new deployment instead of uploading it.",
3817
+ "allowNo": false
3818
+ },
3813
3819
  "environment": {
3814
3820
  "name": "environment",
3815
3821
  "type": "option",
3816
- "description": "Deploy with EAS Environment Variables matching the specified environment.",
3822
+ "description": "Environment variable's environment",
3817
3823
  "helpValue": "(development|preview|production)",
3818
3824
  "multiple": false,
3819
3825
  "options": [
package/package.json CHANGED
@@ -1,23 +1,23 @@
1
1
  {
2
2
  "name": "eas-cli",
3
3
  "description": "EAS command line tool",
4
- "version": "14.1.0",
4
+ "version": "14.3.0",
5
5
  "author": "Expo <support@expo.dev>",
6
6
  "bin": {
7
7
  "eas": "./bin/run"
8
8
  },
9
9
  "bugs": "https://github.com/expo/eas-cli/issues",
10
10
  "dependencies": {
11
- "@expo/apple-utils": "2.1.4",
11
+ "@expo/apple-utils": "2.1.5",
12
12
  "@expo/code-signing-certificates": "0.0.5",
13
13
  "@expo/config": "10.0.6",
14
14
  "@expo/config-plugins": "9.0.12",
15
- "@expo/eas-build-job": "1.0.151",
16
- "@expo/eas-json": "14.0.3",
15
+ "@expo/eas-build-job": "1.0.156",
16
+ "@expo/eas-json": "14.3.0",
17
17
  "@expo/env": "^0.4.0",
18
18
  "@expo/json-file": "8.3.3",
19
19
  "@expo/logger": "1.0.117",
20
- "@expo/multipart-body-parser": "1.1.0",
20
+ "@expo/multipart-body-parser": "2.0.0",
21
21
  "@expo/osascript": "2.1.4",
22
22
  "@expo/package-manager": "1.6.1",
23
23
  "@expo/pkcs12": "0.1.3",
@@ -28,7 +28,7 @@
28
28
  "@expo/results": "1.0.0",
29
29
  "@expo/rudder-sdk-node": "1.1.1",
30
30
  "@expo/spawn-async": "1.7.2",
31
- "@expo/steps": "1.0.151",
31
+ "@expo/steps": "1.0.156",
32
32
  "@expo/timeago.js": "1.0.0",
33
33
  "@oclif/core": "^1.26.2",
34
34
  "@oclif/plugin-autocomplete": "^2.3.10",
@@ -95,6 +95,7 @@
95
95
  "@graphql-codegen/introspection": "4.0.0",
96
96
  "@graphql-codegen/typescript": "4.0.1",
97
97
  "@graphql-codegen/typescript-operations": "4.0.1",
98
+ "@tsconfig/node18": "18.2.4",
98
99
  "@types/cli-progress": "3.11.5",
99
100
  "@types/dateformat": "3.0.1",
100
101
  "@types/diff": "6.0.0",
@@ -236,5 +237,5 @@
236
237
  "node": "20.11.0",
237
238
  "yarn": "1.22.21"
238
239
  },
239
- "gitHead": "1fd14c07e1deb8178a5c62a2367a48443dace2be"
240
+ "gitHead": "9d4fdc3c75750e3eda7c31f9e1ed7f860f3d4aa6"
240
241
  }
@@ -1,12 +0,0 @@
1
- import { ExpoGraphqlClient } from '../commandUtils/context/contextUtils/createGraphqlClient';
2
- /**
3
- * Uploads the `eas.json` file to GCS as account-scoped object.
4
- * Used in workflows. Takes care of logging progress.
5
- */
6
- export declare function uploadAccountScopedEasJsonAsync({ graphqlClient, accountId, projectDir, }: {
7
- graphqlClient: ExpoGraphqlClient;
8
- accountId: string;
9
- projectDir: string;
10
- }): Promise<{
11
- easJsonBucketKey: string;
12
- }>;
@@ -1,34 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.uploadAccountScopedEasJsonAsync = void 0;
4
- const tslib_1 = require("tslib");
5
- const chalk_1 = tslib_1.__importDefault(require("chalk"));
6
- const node_fs_1 = tslib_1.__importDefault(require("node:fs"));
7
- const node_path_1 = tslib_1.__importDefault(require("node:path"));
8
- const generated_1 = require("../graphql/generated");
9
- const uploads_1 = require("../uploads");
10
- const files_1 = require("../utils/files");
11
- const progress_1 = require("../utils/progress");
12
- /**
13
- * Uploads the `eas.json` file to GCS as account-scoped object.
14
- * Used in workflows. Takes care of logging progress.
15
- */
16
- async function uploadAccountScopedEasJsonAsync({ graphqlClient, accountId, projectDir, }) {
17
- const easJsonFilePath = node_path_1.default.join(projectDir, 'eas.json');
18
- const easJsonFileStat = await node_fs_1.default.promises.stat(easJsonFilePath);
19
- if (easJsonFileStat.size > 1024 * 1024) {
20
- throw new Error('eas.json is too big. Maximum allowed size is 1MB.');
21
- }
22
- const easJsonBucketKey = await (0, uploads_1.uploadAccountScopedFileAtPathToGCSAsync)(graphqlClient, {
23
- accountId,
24
- type: generated_1.AccountUploadSessionType.WorkflowsProjectSources,
25
- path: easJsonFilePath,
26
- handleProgressEvent: (0, progress_1.createProgressTracker)({
27
- total: easJsonFileStat.size,
28
- message: ratio => `Uploading eas.json to EAS (${(0, files_1.formatBytes)(easJsonFileStat.size * ratio)} / ${(0, files_1.formatBytes)(easJsonFileStat.size)})`,
29
- completedMessage: (duration) => `Uploaded eas.json to EAS ${chalk_1.default.dim(duration)}`,
30
- }),
31
- });
32
- return { easJsonBucketKey };
33
- }
34
- exports.uploadAccountScopedEasJsonAsync = uploadAccountScopedEasJsonAsync;