@expo/build-tools 0.1.102 → 0.1.103
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.
|
@@ -6,6 +6,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
6
6
|
exports.getRuntimeVersionAsync = exports.configureExpoUpdatesIfInstalledAsync = exports.configureEASExpoUpdatesAsync = exports.configureClassicExpoUpdatesAsync = exports.getNativelyDefinedClassicReleaseChannelAsync = exports.setClassicReleaseChannelNativelyAsync = exports.setChannelNativelyAsync = void 0;
|
|
7
7
|
const assert_1 = __importDefault(require("assert"));
|
|
8
8
|
const eas_build_job_1 = require("@expo/eas-build-job");
|
|
9
|
+
const Updates_1 = require("@expo/config-plugins/build/utils/Updates");
|
|
9
10
|
const expoUpdates_1 = require("../android/expoUpdates");
|
|
10
11
|
const expoUpdates_2 = require("../ios/expoUpdates");
|
|
11
12
|
const isExpoUpdatesInstalled_1 = __importDefault(require("./isExpoUpdatesInstalled"));
|
|
@@ -107,9 +108,9 @@ const configureExpoUpdatesIfInstalledAsync = async (ctx) => {
|
|
|
107
108
|
if (!(await isExpoUpdatesInstalled_1.default(ctx.reactNativeProjectDirectory))) {
|
|
108
109
|
return;
|
|
109
110
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
ctx.logger.warn(`Runtime version from the app config evaluated on your local machine (${ctx.metadata.runtimeVersion}) does not match the one resolved here (${
|
|
111
|
+
const appConfigRuntimeVersion = Updates_1.getRuntimeVersionNullable(ctx.appConfig, ctx.job.platform);
|
|
112
|
+
if (((_a = ctx.metadata) === null || _a === void 0 ? void 0 : _a.runtimeVersion) && ((_b = ctx.metadata) === null || _b === void 0 ? void 0 : _b.runtimeVersion) !== appConfigRuntimeVersion) {
|
|
113
|
+
ctx.logger.warn(`Runtime version from the app config evaluated on your local machine (${ctx.metadata.runtimeVersion}) does not match the one resolved here (${appConfigRuntimeVersion}).`);
|
|
113
114
|
ctx.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 Secret.");
|
|
114
115
|
}
|
|
115
116
|
if ((_c = ctx.job.updates) === null || _c === void 0 ? void 0 : _c.channel) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"expoUpdates.js","sourceRoot":"","sources":["../../src/utils/expoUpdates.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,uDAAoD;
|
|
1
|
+
{"version":3,"file":"expoUpdates.js","sourceRoot":"","sources":["../../src/utils/expoUpdates.ts"],"names":[],"mappings":";;;;;;AAAA,oDAA4B;AAE5B,uDAAoD;AACpD,sEAAqF;AAErF,wDAKgC;AAChC,oDAK4B;AAG5B,sFAAmE;AAEnE;;;;GAIG;AACI,MAAM,uBAAuB,GAAG,KAAK,EAAE,GAAsB,EAAiB,EAAE;;IACrF,gBAAM,CAAC,MAAA,GAAG,CAAC,GAAG,CAAC,OAAO,0CAAE,OAAO,EAAE,iCAAiC,CAAC,CAAC;IACpE,MAAM,uBAAuB,GAA2B;QACtD,mBAAmB,EAAE,GAAG,CAAC,GAAG,CAAC,OAAO,CAAC,OAAO;KAC7C,CAAC;IAEF,MAAM,UAAU,GAAG,GAAG,CAAC,GAAG,CAAC,QAAQ,KAAK,wBAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,YAAY,CAAC;IAChG,GAAG,CAAC,MAAM,CAAC,IAAI,CACb,2CAA2C,UAAU,SAAS,IAAI,CAAC,SAAS,CAC1E,uBAAuB,CACxB,GAAG,CACL,CAAC;IAEF,QAAQ,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE;QACxB,KAAK,wBAAQ,CAAC,OAAO,CAAC,CAAC;YACrB,MAAM,4CAA8B,CAAC,GAAG,CAAC,CAAC;YAC1C,OAAO;SACR;QACD,KAAK,wBAAQ,CAAC,GAAG,CAAC,CAAC;YACjB,MAAM,wCAA0B,CAAC,GAAG,CAAC,CAAC;YAC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,cAAc,2CAA2C,uBAAuB,IAAI,CAC1K,CAAC;QACF,GAAG,CAAC,MAAM,CAAC,IAAI,CACb,gKAAgK,CACjK,CAAC;KACH;IAED,IAAI,MAAA,GAAG,CAAC,GAAG,CAAC,OAAO,0CAAE,OAAO,EAAE;QAC5B,MAAM,oCAA4B,CAAC,GAAG,CAAC,CAAC;KACzC;SAAM;QACL,MAAM,wCAAgC,CAAC,GAAG,CAAC,CAAC;KAC7C;AACH,CAAC,CAAC;AAtBW,QAAA,oCAAoC,wCAsB/C;AAEK,MAAM,sBAAsB,GAAG,KAAK,EAAE,GAAsB,EAA0B,EAAE;IAC7F,QAAQ,GAAG,CAAC,GAAG,CAAC,QAAQ,EAAE;QACxB,KAAK,wBAAQ,CAAC,OAAO,CAAC,CAAC;YACrB,OAAO,MAAM,0DAA4C,CAAC,GAAG,CAAC,CAAC;SAChE;QACD,KAAK,wBAAQ,CAAC,GAAG,CAAC,CAAC;YACjB,OAAO,MAAM,sDAAwC,CAAC,GAAG,CAAC,CAAC;SAC5D;QACD;YACE,MAAM,IAAI,KAAK,CAAC,4BAA4B,CAAC,CAAC;KACjD;AACH,CAAC,CAAC;AAXW,QAAA,sBAAsB,0BAWjC","sourcesContent":["import assert from 'assert';\n\nimport { Platform, Job } from '@expo/eas-build-job';\nimport { getRuntimeVersionNullable } from '@expo/config-plugins/build/utils/Updates';\n\nimport {\n androidSetChannelNativelyAsync,\n androidSetClassicReleaseChannelNativelyAsync,\n androidGetNativelyDefinedClassicReleaseChannelAsync,\n androidGetNativelyDefinedRuntimeVersionAsync,\n} from '../android/expoUpdates';\nimport {\n iosSetChannelNativelyAsync,\n iosSetClassicReleaseChannelNativelyAsync,\n iosGetNativelyDefinedClassicReleaseChannelAsync,\n iosGetNativelyDefinedRuntimeVersionAsync,\n} from '../ios/expoUpdates';\nimport { BuildContext } from '../context';\n\nimport isExpoUpdatesInstalledAsync from './isExpoUpdatesInstalled';\n\n/**\n * Used for when Expo Updates is pointed at an EAS server.\n * @param ctx\n * @param platform\n */\nexport const setChannelNativelyAsync = async (ctx: BuildContext<Job>): Promise<void> => {\n assert(ctx.job.updates?.channel, 'updates.channel must be defined');\n const newUpdateRequestHeaders: Record<string, string> = {\n 'expo-channel-name': ctx.job.updates.channel,\n };\n\n const configFile = ctx.job.platform === Platform.ANDROID ? 'AndroidManifest.xml' : 'Expo.plist';\n ctx.logger.info(\n `Setting the update response headers in '${configFile}' to '${JSON.stringify(\n newUpdateRequestHeaders\n )}'`\n );\n\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n await androidSetChannelNativelyAsync(ctx);\n return;\n }\n case Platform.IOS: {\n await iosSetChannelNativelyAsync(ctx);\n return;\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n};\n\n/**\n * Used for classic Expo Updates\n * @param ctx\n * @param platform\n */\nexport const setClassicReleaseChannelNativelyAsync = async (\n ctx: BuildContext<Job>\n): Promise<void> => {\n assert(ctx.job.releaseChannel, 'releaseChannel must be defined');\n\n const configFile = ctx.job.platform === Platform.ANDROID ? 'AndroidManifest.xml' : 'Expo.plist';\n ctx.logger.info(`Setting the release channel in '${configFile}' to '${ctx.job.releaseChannel}'`);\n\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n await androidSetClassicReleaseChannelNativelyAsync(ctx);\n return;\n }\n case Platform.IOS: {\n await iosSetClassicReleaseChannelNativelyAsync(ctx);\n return;\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n};\n\n/**\n * Used for classic Expo Updates\n * @param ctx\n * @param platform\n */\nexport const getNativelyDefinedClassicReleaseChannelAsync = async (\n ctx: BuildContext<Job>\n): Promise<string | null> => {\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n return androidGetNativelyDefinedClassicReleaseChannelAsync(ctx);\n }\n case Platform.IOS: {\n return iosGetNativelyDefinedClassicReleaseChannelAsync(ctx);\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n};\n\nexport const configureClassicExpoUpdatesAsync = async (ctx: BuildContext<Job>): Promise<void> => {\n if (ctx.job.releaseChannel) {\n await setClassicReleaseChannelNativelyAsync(ctx);\n } else {\n /**\n * If releaseChannel is not defined:\n * 1. Try to infer it from the native value.\n * 2. If it is not set, fallback to 'default'.\n */\n const releaseChannel = await getNativelyDefinedClassicReleaseChannelAsync(ctx);\n if (releaseChannel) {\n ctx.logger.info(\n `Using the release channel pre-configured in native project (${releaseChannel})`\n );\n ctx.logger.warn('Please add the \"releaseChannel\" field to your build profile (eas.json)');\n } else {\n ctx.logger.info(`Using default release channel for 'expo-updates' (default)`);\n }\n }\n};\n\nexport const configureEASExpoUpdatesAsync = async (ctx: BuildContext<Job>): Promise<void> => {\n await setChannelNativelyAsync(ctx);\n};\n\nexport const configureExpoUpdatesIfInstalledAsync = async (\n ctx: BuildContext<Job>\n): Promise<void> => {\n if (!(await isExpoUpdatesInstalledAsync(ctx.reactNativeProjectDirectory))) {\n return;\n }\n\n const appConfigRuntimeVersion = getRuntimeVersionNullable(ctx.appConfig, ctx.job.platform);\n if (ctx.metadata?.runtimeVersion && ctx.metadata?.runtimeVersion !== appConfigRuntimeVersion) {\n ctx.logger.warn(\n `Runtime version from the app config evaluated on your local machine (${ctx.metadata.runtimeVersion}) does not match the one resolved here (${appConfigRuntimeVersion}).`\n );\n ctx.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 Secret.\"\n );\n }\n\n if (ctx.job.updates?.channel) {\n await configureEASExpoUpdatesAsync(ctx);\n } else {\n await configureClassicExpoUpdatesAsync(ctx);\n }\n};\n\nexport const getRuntimeVersionAsync = async (ctx: BuildContext<Job>): Promise<string | null> => {\n switch (ctx.job.platform) {\n case Platform.ANDROID: {\n return await androidGetNativelyDefinedRuntimeVersionAsync(ctx);\n }\n case Platform.IOS: {\n return await iosGetNativelyDefinedRuntimeVersionAsync(ctx);\n }\n default:\n throw new Error(`Platform is not supported.`);\n }\n};\n"]}
|