@expo/eas-build-job 18.0.2 → 18.4.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.
package/dist/errors.d.ts CHANGED
@@ -14,43 +14,64 @@ export interface ExternalBuildError {
14
14
  docsUrl?: string;
15
15
  buildPhase?: BuildPhase;
16
16
  }
17
- interface BuildErrorDetails {
17
+ export type ErrorMetadata = Record<string, unknown>;
18
+ interface ExpoErrorDetails<TMetadata extends ErrorMetadata = ErrorMetadata> {
18
19
  errorCode: string;
19
- userFacingMessage: string;
20
- userFacingErrorCode: string;
20
+ trackingCode?: string;
21
21
  docsUrl?: string;
22
- innerError?: Error;
23
22
  buildPhase?: BuildPhase;
23
+ /**
24
+ * Metadata object for the error. Used internally for Sentry/logging/debugging.
25
+ * It is not included in the external build error payload.
26
+ */
27
+ metadata?: TMetadata;
28
+ /**
29
+ * Underlying error that caused this error to be created. Used internally to
30
+ * propagate blame stack traces to the response.
31
+ */
32
+ cause?: unknown;
24
33
  }
25
- export declare class BuildError extends Error {
34
+ export declare abstract class ExpoError<TMetadata extends ErrorMetadata = ErrorMetadata> extends Error {
26
35
  errorCode: string;
27
- userFacingMessage: string;
28
- userFacingErrorCode: string;
36
+ trackingCode?: string;
29
37
  docsUrl?: string;
30
- innerError?: Error;
38
+ readonly metadata?: TMetadata;
31
39
  buildPhase?: BuildPhase;
32
- constructor(message: string, details: BuildErrorDetails);
33
- format(): ExternalBuildError;
40
+ constructor(message: string, details: ExpoErrorDetails<TMetadata>);
41
+ /**
42
+ * Serialized error payload used by the orchestrator-worker API.
43
+ */
44
+ toExternalExpoError(): ExternalBuildError;
34
45
  }
35
- export declare class UserFacingError extends Error {
46
+ export declare class UserError<TMetadata extends ErrorMetadata = ErrorMetadata> extends ExpoError<TMetadata> {
36
47
  errorCode: string;
37
- message: string;
38
- docsUrl?: string;
39
48
  constructor(errorCode: string, message: string, options?: {
49
+ trackingCode?: string;
50
+ docsUrl?: string;
51
+ buildPhase?: BuildPhase;
52
+ metadata?: TMetadata;
53
+ cause?: unknown;
54
+ });
55
+ }
56
+ export declare class SystemError<TMetadata extends ErrorMetadata = ErrorMetadata> extends ExpoError<TMetadata> {
57
+ constructor(message: string, options?: {
58
+ trackingCode?: string;
40
59
  docsUrl?: string;
60
+ buildPhase?: BuildPhase;
61
+ metadata?: TMetadata;
41
62
  cause?: unknown;
42
63
  });
43
64
  }
44
- export declare class UnknownError extends UserFacingError {
65
+ export declare class UnknownError extends UserError {
45
66
  constructor(buildPhase?: BuildPhase);
46
67
  }
47
- export declare class UnknownBuildError extends BuildError {
68
+ export declare class UnknownBuildError extends UserError {
48
69
  constructor();
49
70
  }
50
- export declare class UnknownCustomBuildError extends BuildError {
71
+ export declare class UnknownCustomBuildError extends UserError {
51
72
  constructor();
52
73
  }
53
- export declare class CredentialsDistCertMismatchError extends UserFacingError {
74
+ export declare class CredentialsDistCertMismatchError extends UserError {
54
75
  constructor(message: string);
55
76
  }
56
77
  export {};
package/dist/errors.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CredentialsDistCertMismatchError = exports.UnknownCustomBuildError = exports.UnknownBuildError = exports.UnknownError = exports.UserFacingError = exports.BuildError = exports.ErrorCode = void 0;
3
+ exports.CredentialsDistCertMismatchError = exports.UnknownCustomBuildError = exports.UnknownBuildError = exports.UnknownError = exports.SystemError = exports.UserError = exports.ExpoError = exports.ErrorCode = void 0;
4
4
  const logs_1 = require("./logs");
5
5
  var ErrorCode;
6
6
  (function (ErrorCode) {
@@ -12,77 +12,88 @@ var ErrorCode;
12
12
  ErrorCode["UNKNOWN_GRADLE_ERROR"] = "EAS_BUILD_UNKNOWN_GRADLE_ERROR";
13
13
  ErrorCode["BUILD_TIMEOUT_ERROR"] = "EAS_BUILD_TIMEOUT_ERROR";
14
14
  })(ErrorCode || (exports.ErrorCode = ErrorCode = {}));
15
- class BuildError extends Error {
15
+ class ExpoError extends Error {
16
16
  errorCode;
17
- userFacingMessage;
18
- userFacingErrorCode;
17
+ // Internal-only classification used for Sentry, analytics, and worker internalErrorCode.
18
+ // The public error saved on builds and job runs is always `errorCode`.
19
+ trackingCode;
19
20
  docsUrl;
20
- innerError;
21
+ metadata;
21
22
  buildPhase;
22
23
  constructor(message, details) {
23
- super(message);
24
+ super(message, { cause: details.cause });
24
25
  this.errorCode = details.errorCode;
25
- this.userFacingErrorCode = details.userFacingErrorCode;
26
- this.userFacingMessage = details.userFacingMessage;
26
+ this.trackingCode = details.trackingCode;
27
27
  this.docsUrl = details.docsUrl;
28
- this.innerError = details.innerError;
28
+ this.metadata = details.metadata;
29
29
  this.buildPhase = details.buildPhase;
30
30
  }
31
- format() {
31
+ /**
32
+ * Serialized error payload used by the orchestrator-worker API.
33
+ */
34
+ toExternalExpoError() {
32
35
  return {
33
- errorCode: this.userFacingErrorCode,
34
- message: this.userFacingMessage,
36
+ errorCode: this.errorCode,
37
+ message: this.message,
35
38
  docsUrl: this.docsUrl,
36
39
  buildPhase: this.buildPhase,
37
40
  };
38
41
  }
39
42
  }
40
- exports.BuildError = BuildError;
41
- class UserFacingError extends Error {
43
+ exports.ExpoError = ExpoError;
44
+ class UserError extends ExpoError {
42
45
  errorCode;
43
- message;
44
- docsUrl;
45
46
  constructor(errorCode, message, options) {
46
- super(message, { cause: options?.cause });
47
+ super(message, {
48
+ errorCode,
49
+ trackingCode: options?.trackingCode,
50
+ docsUrl: options?.docsUrl,
51
+ buildPhase: options?.buildPhase,
52
+ metadata: options?.metadata,
53
+ cause: options?.cause,
54
+ });
47
55
  this.errorCode = errorCode;
48
- this.message = message;
49
- this.docsUrl = options?.docsUrl;
50
56
  }
51
57
  }
52
- exports.UserFacingError = UserFacingError;
53
- class UnknownError extends UserFacingError {
58
+ exports.UserError = UserError;
59
+ class SystemError extends ExpoError {
60
+ constructor(message, options) {
61
+ super(message, {
62
+ errorCode: ErrorCode.SERVER_ERROR,
63
+ trackingCode: options?.trackingCode,
64
+ docsUrl: options?.docsUrl,
65
+ buildPhase: options?.buildPhase,
66
+ metadata: options?.metadata,
67
+ cause: options?.cause,
68
+ });
69
+ }
70
+ }
71
+ exports.SystemError = SystemError;
72
+ class UnknownError extends UserError {
54
73
  constructor(buildPhase) {
55
74
  super(ErrorCode.UNKNOWN_ERROR, buildPhase
56
75
  ? `Unknown error. See logs of the ${logs_1.buildPhaseDisplayName[buildPhase]} build phase for more information.`
57
- : 'Unknown error. See logs for more information.');
76
+ : 'Unknown error. See logs for more information.', { buildPhase });
58
77
  }
59
78
  }
60
79
  exports.UnknownError = UnknownError;
61
- class UnknownBuildError extends BuildError {
80
+ class UnknownBuildError extends UserError {
62
81
  constructor() {
63
82
  const errorCode = ErrorCode.UNKNOWN_ERROR;
64
83
  const message = 'Unknown error. See logs for more information.';
65
- super(message, {
66
- errorCode,
67
- userFacingMessage: message,
68
- userFacingErrorCode: errorCode,
69
- });
84
+ super(errorCode, message);
70
85
  }
71
86
  }
72
87
  exports.UnknownBuildError = UnknownBuildError;
73
- class UnknownCustomBuildError extends BuildError {
88
+ class UnknownCustomBuildError extends UserError {
74
89
  constructor() {
75
90
  const errorCode = ErrorCode.UNKNOWN_CUSTOM_BUILD_ERROR;
76
91
  const message = 'Unknown custom build error. See logs for more information.';
77
- super(message, {
78
- errorCode,
79
- userFacingMessage: message,
80
- userFacingErrorCode: errorCode,
81
- });
92
+ super(errorCode, message);
82
93
  }
83
94
  }
84
95
  exports.UnknownCustomBuildError = UnknownCustomBuildError;
85
- class CredentialsDistCertMismatchError extends UserFacingError {
96
+ class CredentialsDistCertMismatchError extends UserError {
86
97
  constructor(message) {
87
98
  super('EAS_BUILD_CREDENTIALS_DIST_CERT_MISMATCH', message);
88
99
  }
package/dist/index.d.ts CHANGED
@@ -4,6 +4,7 @@ export { ArchiveSourceType, ArchiveSource, ArchiveSourceSchemaZ, BuildMode, Buil
4
4
  export { Metadata, sanitizeMetadata } from './metadata';
5
5
  export * from './job';
6
6
  export * from './logs';
7
+ export * from './errors';
7
8
  export * as errors from './errors';
8
9
  export * from './artifacts';
9
10
  export * from './context';
package/dist/index.js CHANGED
@@ -52,6 +52,7 @@ var metadata_1 = require("./metadata");
52
52
  Object.defineProperty(exports, "sanitizeMetadata", { enumerable: true, get: function () { return metadata_1.sanitizeMetadata; } });
53
53
  __exportStar(require("./job"), exports);
54
54
  __exportStar(require("./logs"), exports);
55
+ __exportStar(require("./errors"), exports);
55
56
  exports.errors = __importStar(require("./errors"));
56
57
  __exportStar(require("./artifacts"), exports);
57
58
  __exportStar(require("./context"), exports);
package/dist/logs.d.ts CHANGED
@@ -16,6 +16,7 @@ export declare enum BuildPhase {
16
16
  EAS_BUILD_INTERNAL = "EAS_BUILD_INTERNAL",
17
17
  PREBUILD = "PREBUILD",
18
18
  PREPARE_CREDENTIALS = "PREPARE_CREDENTIALS",
19
+ CONFIGURE_ANDROID_VERSION = "CONFIGURE_ANDROID_VERSION",
19
20
  CALCULATE_EXPO_UPDATES_RUNTIME_VERSION = "CALCULATE_EXPO_UPDATES_RUNTIME_VERSION",
20
21
  CONFIGURE_EXPO_UPDATES = "CONFIGURE_EXPO_UPDATES",
21
22
  EAGER_BUNDLE = "EAGER_BUNDLE",
package/dist/logs.js CHANGED
@@ -20,6 +20,7 @@ var BuildPhase;
20
20
  BuildPhase["EAS_BUILD_INTERNAL"] = "EAS_BUILD_INTERNAL";
21
21
  BuildPhase["PREBUILD"] = "PREBUILD";
22
22
  BuildPhase["PREPARE_CREDENTIALS"] = "PREPARE_CREDENTIALS";
23
+ BuildPhase["CONFIGURE_ANDROID_VERSION"] = "CONFIGURE_ANDROID_VERSION";
23
24
  BuildPhase["CALCULATE_EXPO_UPDATES_RUNTIME_VERSION"] = "CALCULATE_EXPO_UPDATES_RUNTIME_VERSION";
24
25
  BuildPhase["CONFIGURE_EXPO_UPDATES"] = "CONFIGURE_EXPO_UPDATES";
25
26
  BuildPhase["EAGER_BUNDLE"] = "EAGER_BUNDLE";
@@ -78,6 +79,7 @@ exports.buildPhaseDisplayName = {
78
79
  [BuildPhase.EAS_BUILD_INTERNAL]: 'Resolve build configuration',
79
80
  [BuildPhase.PREBUILD]: 'Prebuild',
80
81
  [BuildPhase.PREPARE_CREDENTIALS]: 'Prepare credentials',
82
+ [BuildPhase.CONFIGURE_ANDROID_VERSION]: 'Configure Android version',
81
83
  [BuildPhase.CALCULATE_EXPO_UPDATES_RUNTIME_VERSION]: 'Calculate expo-updates runtime version',
82
84
  [BuildPhase.CONFIGURE_EXPO_UPDATES]: 'Configure expo-updates',
83
85
  [BuildPhase.EAGER_BUNDLE]: 'Bundle JavaScript',
@@ -135,6 +137,7 @@ exports.buildPhaseWebsiteId = {
135
137
  [BuildPhase.EAS_BUILD_INTERNAL]: 'resolve-build-configuration',
136
138
  [BuildPhase.PREBUILD]: 'prebuild',
137
139
  [BuildPhase.PREPARE_CREDENTIALS]: 'prepare-credentials',
140
+ [BuildPhase.CONFIGURE_ANDROID_VERSION]: 'configure-android-version',
138
141
  [BuildPhase.CALCULATE_EXPO_UPDATES_RUNTIME_VERSION]: 'calculate-expo-updates-runtime-version',
139
142
  [BuildPhase.CONFIGURE_EXPO_UPDATES]: 'configure-expo-updates',
140
143
  [BuildPhase.EAGER_BUNDLE]: 'eager-bundle',
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@expo/eas-build-job",
3
- "version": "18.0.2",
3
+ "version": "18.4.0",
4
4
  "bugs": "https://github.com/expo/eas-cli/issues",
5
5
  "license": "MIT",
6
6
  "author": "Expo <support@expo.io>",
@@ -37,5 +37,5 @@
37
37
  "ts-jest": "^29.1.4",
38
38
  "typescript": "^5.5.4"
39
39
  },
40
- "gitHead": "d5da4f416791938a7c1ffdaf83a7c644e7aa6261"
40
+ "gitHead": "4e202db843be2dca6450af4b45ee76b226a662ea"
41
41
  }