@expo/build-tools 1.0.169 → 1.0.171
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/buildErrors/userErrorHandlers.js +3 -3
- package/dist/buildErrors/userErrorHandlers.js.map +1 -1
- package/dist/common/setup.js +2 -5
- package/dist/common/setup.js.map +1 -1
- package/dist/gcs/LoggerStream.d.ts +54 -0
- package/dist/gcs/LoggerStream.js +186 -0
- package/dist/gcs/LoggerStream.js.map +1 -0
- package/dist/gcs/__unit__/gcs.test.d.ts +1 -0
- package/dist/gcs/__unit__/gcs.test.js +338 -0
- package/dist/gcs/__unit__/gcs.test.js.map +1 -0
- package/dist/gcs/client.d.ts +59 -0
- package/dist/gcs/client.js +164 -0
- package/dist/gcs/client.js.map +1 -0
- package/dist/gcs/retry.d.ts +11 -0
- package/dist/gcs/retry.js +51 -0
- package/dist/gcs/retry.js.map +1 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/steps/utils/expoUpdates.js +1 -1
- package/dist/steps/utils/expoUpdates.js.map +1 -1
- package/package.json +5 -4
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.retryOnGCSUploadFailure = void 0;
|
|
4
|
+
// based on https://github.com/googleapis/nodejs-storage/blob/8ab50804fc7bae3bbd159bbb4adf65c02215b11b/src/storage.ts#L284-L320
|
|
5
|
+
async function retryOnGCSUploadFailure(fn, { retries, retryIntervalMs, }) {
|
|
6
|
+
return await retry(fn, {
|
|
7
|
+
retries,
|
|
8
|
+
retryIntervalMs,
|
|
9
|
+
shouldRetryOnError: (e) => {
|
|
10
|
+
return (e.code === 'ENOTFOUND' ||
|
|
11
|
+
e.code === 'EAI_AGAIN' ||
|
|
12
|
+
e.code === 'ECONNRESET' ||
|
|
13
|
+
e.code === 'ETIMEDOUT' ||
|
|
14
|
+
e.code === 'EPIPE');
|
|
15
|
+
},
|
|
16
|
+
shouldRetryOnResponse: (resp) => {
|
|
17
|
+
return [408, 429, 500, 502, 503, 504].includes(resp.status);
|
|
18
|
+
},
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
exports.retryOnGCSUploadFailure = retryOnGCSUploadFailure;
|
|
22
|
+
/**
|
|
23
|
+
* Wrapper used to execute an inner function and possibly retry it if it throws and error
|
|
24
|
+
* @param fn Function to be executed and retried in case of error
|
|
25
|
+
* @param retries How many times at most should the function be retried
|
|
26
|
+
* @param retryIntervalMs Time interval between the retries
|
|
27
|
+
* @param shouldRetryOnError Function that determines if the function should be retried based on the error thrown
|
|
28
|
+
* @param shouldRetryOnResponse Function that determines if the function should be retried based on the response
|
|
29
|
+
*/
|
|
30
|
+
async function retry(fn, { retries, retryIntervalMs, shouldRetryOnError, shouldRetryOnResponse }) {
|
|
31
|
+
let attemptCount = -1;
|
|
32
|
+
for (;;) {
|
|
33
|
+
try {
|
|
34
|
+
attemptCount += 1;
|
|
35
|
+
const resp = await fn(attemptCount);
|
|
36
|
+
if (attemptCount < retries && shouldRetryOnResponse(resp)) {
|
|
37
|
+
await new Promise((res) => setTimeout(res, retryIntervalMs));
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
return resp;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
catch (err) {
|
|
44
|
+
if (attemptCount === retries || !shouldRetryOnError(err)) {
|
|
45
|
+
throw err;
|
|
46
|
+
}
|
|
47
|
+
await new Promise((res) => setTimeout(res, retryIntervalMs));
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=retry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"retry.js","sourceRoot":"","sources":["../../src/gcs/retry.ts"],"names":[],"mappings":";;;AASA,+HAA+H;AACxH,KAAK,UAAU,uBAAuB,CAC3C,EAA+C,EAC/C,EACE,OA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AC,EAAE,CAAC;gBACzD,MAAM,GAAG,CAAC;YACZ,CAAC;YACD,MAAM,IAAI,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,eAAe,CAAC,CAAC,CAAC;QAC/D,CAAC;IACH,CAAC;AACH,CAAC","sourcesContent":["import { Response } from 'node-fetch';\n\nexport interface RetryOptions {\n retries: number;\n retryIntervalMs: number;\n shouldRetryOnError: (error: any) => boolean;\n shouldRetryOnResponse: (response: Response) => boolean;\n}\n\n// based on https://github.com/googleapis/nodejs-storage/blob/8ab50804fc7bae3bbd159bbb4adf65c02215b11b/src/storage.ts#L284-L320\nexport async function retryOnGCSUploadFailure(\n fn: (attemptCount: number) => Promise<Response>,\n {\n retries,\n retryIntervalMs,\n }: { retries: RetryOptions['retries']; retryIntervalMs: RetryOptions['retryIntervalMs'] }\n): Promise<Response> {\n return await retry(fn, {\n retries,\n retryIntervalMs,\n shouldRetryOnError: (e) => {\n return (\n e.code === 'ENOTFOUND' ||\n e.code === 'EAI_AGAIN' ||\n e.code === 'ECONNRESET' ||\n e.code === 'ETIMEDOUT' ||\n e.code === 'EPIPE'\n );\n },\n shouldRetryOnResponse: (resp) => {\n return [408, 429, 500, 502, 503, 504].includes(resp.status);\n },\n });\n}\n\n/**\n * Wrapper used to execute an inner function and possibly retry it if it throws and error\n * @param fn Function to be executed and retried in case of error\n * @param retries How many times at most should the function be retried\n * @param retryIntervalMs Time interval between the retries\n * @param shouldRetryOnError Function that determines if the function should be retried based on the error thrown\n * @param shouldRetryOnResponse Function that determines if the function should be retried based on the response\n */\nasync function retry(\n fn: (attemptCount: number) => Promise<Response>,\n { retries, retryIntervalMs, shouldRetryOnError, shouldRetryOnResponse }: RetryOptions\n): Promise<Response> {\n let attemptCount = -1;\n for (;;) {\n try {\n attemptCount += 1;\n const resp = await fn(attemptCount);\n if (attemptCount < retries && shouldRetryOnResponse(resp)) {\n await new Promise((res) => setTimeout(res, retryIntervalMs));\n } else {\n return resp;\n }\n } catch (err: any) {\n if (attemptCount === retries || !shouldRetryOnError(err)) {\n throw err;\n }\n await new Promise((res) => setTimeout(res, retryIntervalMs));\n }\n }\n}\n"]}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,7 @@
|
|
|
1
1
|
import * as Builders from './builders';
|
|
2
|
-
|
|
2
|
+
import GCS from './gcs/client';
|
|
3
|
+
import GCSLoggerStream from './gcs/LoggerStream';
|
|
4
|
+
export { Builders, GCS, GCSLoggerStream };
|
|
3
5
|
export { ArtifactToUpload, Artifacts, BuildContext, BuildContextOptions, CacheManager, LogBuffer, SkipNativeBuildError, } from './context';
|
|
4
6
|
export { PackageManager } from './utils/packageManager';
|
|
5
7
|
export { findAndUploadXcodeBuildLogsAsync } from './ios/xcodeBuildLogs';
|
package/dist/index.js
CHANGED
|
@@ -25,10 +25,17 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
25
25
|
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
26
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
27
|
};
|
|
28
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
29
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
30
|
+
};
|
|
28
31
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.runHookIfPresent = exports.Hook = exports.findAndUploadXcodeBuildLogsAsync = exports.PackageManager = exports.SkipNativeBuildError = exports.BuildContext = exports.Builders = void 0;
|
|
32
|
+
exports.runHookIfPresent = exports.Hook = exports.findAndUploadXcodeBuildLogsAsync = exports.PackageManager = exports.SkipNativeBuildError = exports.BuildContext = exports.GCSLoggerStream = exports.GCS = exports.Builders = void 0;
|
|
30
33
|
const Builders = __importStar(require("./builders"));
|
|
31
34
|
exports.Builders = Builders;
|
|
35
|
+
const client_1 = __importDefault(require("./gcs/client"));
|
|
36
|
+
exports.GCS = client_1.default;
|
|
37
|
+
const LoggerStream_1 = __importDefault(require("./gcs/LoggerStream"));
|
|
38
|
+
exports.GCSLoggerStream = LoggerStream_1.default;
|
|
32
39
|
var context_1 = require("./context");
|
|
33
40
|
Object.defineProperty(exports, "BuildContext", { enumerable: true, get: function () { return context_1.BuildContext; } });
|
|
34
41
|
Object.defineProperty(exports, "SkipNativeBuildError", { enumerable: true, get: function () { return context_1.SkipNativeBuildError; } });
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,qDAAuC;AAI9B,4BAAQ;AAHjB,0DAA+B;AAGZ,cAHZ,gBAAG,CAGY;AAFtB,sEAAiD;AAEzB,0BAFjB,sBAAe,CAEiB;AAEvC,qCAQmB;AALjB,uGAAA,YAAY,OAAA;AAIZ,+GAAA,oBAAoB,OAAA;AAGtB,yDAAwD;AAA/C,gHAAA,cAAc,OAAA;AAEvB,uDAAwE;AAA/D,kIAAA,gCAAgC,OAAA;AAEzC,uCAAuD;AAA9C,6FAAA,IAAI,OAAA;AAAE,yGAAA,gBAAgB,OAAA;AAE/B,4CAA0B","sourcesContent":["import * as Builders from './builders';\nimport GCS from './gcs/client';\nimport GCSLoggerStream from './gcs/LoggerStream';\n\nexport { Builders, GCS, GCSLoggerStream };\n\nexport {\n ArtifactToUpload,\n Artifacts,\n BuildContext,\n BuildContextOptions,\n CacheManager,\n LogBuffer,\n SkipNativeBuildError,\n} from './context';\n\nexport { PackageManager } from './utils/packageManager';\n\nexport { findAndUploadXcodeBuildLogsAsync } from './ios/xcodeBuildLogs';\n\nexport { Hook, runHookIfPresent } from './utils/hooks';\n\nexport * from './generic';\n"]}
|
|
@@ -9,7 +9,7 @@ async function configureEASUpdateAsync({ job, workingDirectory, logger, inputs,
|
|
|
9
9
|
const runtimeVersion = (_c = (_a = inputs.runtimeVersion) !== null && _a !== void 0 ? _a : (_b = job.version) === null || _b === void 0 ? void 0 : _b.runtimeVersion) !== null && _c !== void 0 ? _c : inputs.resolvedRuntimeVersion;
|
|
10
10
|
if ((metadata === null || metadata === void 0 ? void 0 : metadata.runtimeVersion) && metadata.runtimeVersion !== runtimeVersion) {
|
|
11
11
|
logger.warn(`Runtime version from the app config evaluated on your local machine (${metadata.runtimeVersion}) does not match the one resolved here (${runtimeVersion}).`);
|
|
12
|
-
logger.warn("If you're using conditional app configs, e.g. depending on an environment variable, make sure to set the variable in eas.json or configure it with EAS
|
|
12
|
+
logger.warn("If you're using conditional app configs, e.g. depending on an environment variable, make sure to set the variable in eas.json or configure it with EAS environment variables.");
|
|
13
13
|
}
|
|
14
14
|
const jobOrInputChannel = (_d = inputs.channel) !== null && _d !== void 0 ? _d : (_e = job.updates) === null || _e === void 0 ? void 0 : _e.channel;
|
|
15
15
|
if (isEASUpdateConfigured(appConfig, logger)) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expoUpdates.js","sourceRoot":"","sources":["../../../src/steps/utils/expoUpdates.ts"],"names":[],"mappings":";;;AAAA,uDAAwE;AAIxE,mDAI2B;AAC3B,uDAI+B;AAExB,KAAK,UAAU,uBAAuB,CAAC,EAC5C,GAAG,EACH,gBAAgB,EAChB,MAAM,EACN,MAAM,EACN,SAAS,EACT,QAAQ,GAYT;;IACC,MAAM,cAAc,GAClB,MAAA,MAAA,MAAM,CAAC,cAAc,mCAAI,MAAA,GAAG,CAAC,OAAO,0CAAE,cAAc,mCAAI,MAAM,CAAC,sBAAsB,CAAC;IAExF,IAAI,CAAA,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,cAAc,KAAI,QAAQ,CAAC,cAAc,KAAK,cAAc,EAAE,CAAC;QAC3E,MAAM,CAAC,IAAI,CACT,wEAAwE,QAAQ,CAAC,cAAc,2CA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,OAAO,MAAM,IAAA,mDAAqC,EAAC,gBAAgB,CAAC,CAAC;QACvE,CAAC;QACD,KAAK,wBAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;YAClB,OAAO,MAAM,IAAA,+CAAiC,EAAC,gBAAgB,CAAC,CAAC;QACnE,CAAC;QACD;YACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAClD,CAAC;AACH,CAAC;AAED,KAAK,UAAU,8BAA8B,CAC3C,GAAQ,EACR,cAAsB,EACtB,gBAAwB;IAExB,QAAQ,GAAG,CAAC,QAAQ,EAAE,CAAC;QACrB,KAAK,wBAAQ,CAAC,OAAO,CAAC,CAAC,CAAC;YACtB,MAAM,IAAA,mDAAqC,EAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;YAC9E,OAAO;QACT,CAAC;QACD,KAAK,wBAAQ,CAAC,GAAG,CAAC,CAAC,CAAC;YAClB,MAAM,IAAA,+CAAiC,EAAC,cAAc,EAAE,gBAAgB,CAAC,CAAC;YAC1E,OAAO;QACT,CAAC;QACD;YACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;IAClD,CAAC;AACH,CAAC","sourcesContent":["import { BuildJob, Job, Metadata, Platform } from '@expo/eas-build-job';\nimport { bunyan } from '@expo/logger';\nimport { ExpoConfig } from '@expo/config';\n\nimport {\n iosGetNativelyDefinedChannelAsync,\n iosSetChannelNativelyAsync,\n iosSetRuntimeVersionNativelyAsync,\n} from './ios/expoUpdates';\nimport {\n androidGetNativelyDefinedChannelAsync,\n androidSetChannelNativelyAsync,\n androidSetRuntimeVersionNativelyAsync,\n} from './android/expoUpdates';\n\nexport async function configureEASUpdateAsync({\n job,\n workingDirectory,\n logger,\n inputs,\n appConfig,\n metadata,\n}: {\n job: BuildJob;\n workingDirectory: string;\n logger: bunyan;\n inputs: {\n runtimeVersion?: string;\n channel?: string;\n resolvedRuntimeVersion?: string;\n };\n appConfig: ExpoConfig;\n metadata: Metadata | null;\n}): Promise<void> {\n const runtimeVersion =\n inputs.runtimeVersion ?? job.version?.runtimeVersion ?? inputs.resolvedRuntimeVersion;\n\n if (metadata?.runtimeVersion && metadata.runtimeVersion !== runtimeVersion) {\n logger.warn(\n `Runtime version from the app config evaluated on your local machine (${metadata.runtimeVersion}) does not match the one resolved here (${runtimeVersion}).`\n );\n logger.warn(\n \"If you're using conditional app configs, e.g. depending on an environment variable, make sure to set the variable in eas.json or configure it with EAS environment variables.\"\n );\n }\n\n const jobOrInputChannel = inputs.channel ?? job.updates?.channel;\n\n if (isEASUpdateConfigured(appConfig, logger)) {\n if (jobOrInputChannel) {\n await configureEASUpdate(job, logger, jobOrInputChannel, workingDirectory);\n } else {\n const channel = await getChannelAsync(job, workingDirectory);\n const isDevelopmentClient = job.developmentClient ?? false;\n\n if (channel) {\n const configFile = job.platform === Platform.ANDROID ? 'AndroidManifest.xml' : 'Expo.plist';\n logger.info(`The channel name for EAS Update in ${configFile} is set to \"${channel}\"`);\n } else if (isDevelopmentClient) {\n // NO-OP: Development clients don't need to have a channel set\n } else {\n const easUpdateUrl = appConfig.updates?.url ?? null;\n const jobProfile = job.buildProfile ?? null;\n logger.warn(\n `This build has an invalid EAS Update configuration: update.url is set to \"${easUpdateUrl}\" in app config, but a channel is not specified${\n jobProfile ? '' : ` for the current build profile \"${jobProfile}\" in eas.json`\n }.`\n );\n logger.warn(`- No channel will be set and EAS Update will be disabled for the build.`);\n logger.warn(\n `- Run \\`eas update:configure\\` to set your channel in eas.json. For more details, see https://docs.expo.dev/eas-update/getting-started/#configure-your-project`\n );\n }\n }\n } else {\n logger.info(`Expo Updates is not configured, skipping configuring Expo Updates.`);\n }\n\n if (runtimeVersion) {\n logger.info('Updating runtimeVersion in Expo.plist');\n await setRuntimeVersionNativelyAsync(job, runtimeVersion, workingDirectory);\n }\n}\n\nexport function isEASUpdateConfigured(appConfig: ExpoConfig, logger: bunyan): boolean {\n const rawUrl = appConfig.updates?.url;\n if (!rawUrl) {\n return false;\n }\n try {\n const url = new URL(rawUrl);\n return ['u.expo.dev', 'staging-u.expo.dev'].includes(url.hostname);\n } catch (err) {\n logger.error({ err }, `Cannot parse expo.updates.url = ${rawUrl} as URL`);\n logger.error(`Assuming EAS Update is not configured`);\n return false;\n }\n}\n\nasync function configureEASUpdate(\n job: Job,\n logger: bunyan,\n channel: string,\n workingDirectory: string\n): Promise<void> {\n const newUpdateRequestHeaders: Record<string, string> = {\n 'expo-channel-name': channel,\n };\n\n const configFile = job.platform === Platform.ANDROID ? 'AndroidManifest.xml' : 'Expo.plist';\n logger.info(\n `Setting the update request headers in '${configFile}' to '${JSON.stringify(\n newUpdateRequestHeaders\n )}'`\n );\n\n switch (job.platform) {\n case Platform.ANDROID: {\n await androidSetChannelNativelyAsync(channel, workingDirectory);\n return;\n }\n case Platform.IOS: {\n await iosSetChannelNativelyAsync(channel, workingDirectory);\n return;\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\nasync function getChannelAsync(job: Job, workingDirectory: string): Promise<string | null> {\n switch (job.platform) {\n case Platform.ANDROID: {\n return await androidGetNativelyDefinedChannelAsync(workingDirectory);\n }\n case Platform.IOS: {\n return await iosGetNativelyDefinedChannelAsync(workingDirectory);\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n\nasync function setRuntimeVersionNativelyAsync(\n job: Job,\n runtimeVersion: string,\n workingDirectory: string\n): Promise<void> {\n switch (job.platform) {\n case Platform.ANDROID: {\n await androidSetRuntimeVersionNativelyAsync(runtimeVersion, workingDirectory);\n return;\n }\n case Platform.IOS: {\n await iosSetRuntimeVersionNativelyAsync(runtimeVersion, workingDirectory);\n return;\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@expo/build-tools",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.171",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"files": [
|
|
@@ -25,17 +25,18 @@
|
|
|
25
25
|
"@expo/config": "10.0.6",
|
|
26
26
|
"@expo/config-plugins": "9.0.12",
|
|
27
27
|
"@expo/downloader": "1.0.118",
|
|
28
|
-
"@expo/eas-build-job": "1.0.
|
|
28
|
+
"@expo/eas-build-job": "1.0.170",
|
|
29
29
|
"@expo/env": "^0.4.0",
|
|
30
30
|
"@expo/logger": "1.0.117",
|
|
31
31
|
"@expo/package-manager": "1.7.0",
|
|
32
32
|
"@expo/plist": "^0.2.0",
|
|
33
33
|
"@expo/repack-app": "0.0.6",
|
|
34
34
|
"@expo/results": "^1.0.0",
|
|
35
|
-
"@expo/steps": "1.0.
|
|
35
|
+
"@expo/steps": "1.0.170",
|
|
36
36
|
"@expo/template-file": "1.0.117",
|
|
37
37
|
"@expo/turtle-spawn": "1.0.117",
|
|
38
38
|
"@expo/xcpretty": "^4.3.1",
|
|
39
|
+
"@google-cloud/storage": "^7.11.2",
|
|
39
40
|
"fast-glob": "^3.3.2",
|
|
40
41
|
"fs-extra": "^11.2.0",
|
|
41
42
|
"joi": "^17.13.1",
|
|
@@ -74,5 +75,5 @@
|
|
|
74
75
|
"node": "20.14.0",
|
|
75
76
|
"yarn": "1.22.21"
|
|
76
77
|
},
|
|
77
|
-
"gitHead": "
|
|
78
|
+
"gitHead": "a199928a10e8c6f9e19da0f47bbcda92234a64c8"
|
|
78
79
|
}
|