You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
61 lines
1.7 KiB
61 lines
1.7 KiB
"use strict";
|
|
|
|
Object.defineProperty(exports, "__esModule", {
|
|
value: true
|
|
});
|
|
exports.getPublishExpConfigAsync = getPublishExpConfigAsync;
|
|
function _config() {
|
|
const data = require("@expo/config");
|
|
_config = function () {
|
|
return data;
|
|
};
|
|
return data;
|
|
}
|
|
function _internal() {
|
|
const data = require("../internal");
|
|
_internal = function () {
|
|
return data;
|
|
};
|
|
return data;
|
|
}
|
|
async function getPublishExpConfigAsync(projectRoot, options = {}) {
|
|
if (options.releaseChannel != null && typeof options.releaseChannel !== 'string') {
|
|
throw new (_internal().XDLError)('INVALID_OPTIONS', 'releaseChannel must be a string');
|
|
}
|
|
options.releaseChannel = options.releaseChannel || 'default';
|
|
|
|
// Verify that exp/app.json and package.json exist
|
|
const {
|
|
exp: {
|
|
hooks,
|
|
runtimeVersion
|
|
}
|
|
} = (0, _config().getConfig)(projectRoot, {
|
|
skipSDKVersionRequirement: true
|
|
});
|
|
const {
|
|
exp,
|
|
pkg
|
|
} = (0, _config().getConfig)(projectRoot, {
|
|
isPublicConfig: true,
|
|
// enforce sdk validation if user is not using runtimeVersion
|
|
skipSDKVersionRequirement: !!runtimeVersion
|
|
});
|
|
const {
|
|
sdkVersion
|
|
} = exp;
|
|
// Only allow projects to be published with UNVERSIONED if a correct token is set in env
|
|
if (sdkVersion === 'UNVERSIONED' && !_internal().Env.maySkipManifestValidation()) {
|
|
throw new (_internal().XDLError)('INVALID_OPTIONS', 'Cannot publish with sdkVersion UNVERSIONED.');
|
|
}
|
|
exp.locales = await _internal().ExponentTools.getResolvedLocalesAsync(projectRoot, exp);
|
|
return {
|
|
exp: {
|
|
...exp,
|
|
sdkVersion: sdkVersion
|
|
},
|
|
pkg,
|
|
hooks
|
|
};
|
|
}
|
|
//# sourceMappingURL=getPublishExpConfigAsync.js.map
|