Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@expo/config

Package Overview
Dependencies
Maintainers
21
Versions
241
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@expo/config - npm Package Compare versions

Comparing version 7.0.3 to 8.0.0

build/getExpoSDKVersion.d.ts

14

build/Config.d.ts

@@ -1,2 +0,2 @@

import { AppJSONConfig, ConfigFilePaths, ExpoConfig, ExpRc, GetConfigOptions, PackageJSONConfig, ProjectConfig, ProjectTarget, WriteConfigOptions } from './Config.types';
import { AppJSONConfig, ConfigFilePaths, ExpoConfig, GetConfigOptions, PackageJSONConfig, ProjectConfig, ProjectTarget, WriteConfigOptions } from './Config.types';
/**

@@ -30,3 +30,2 @@ * Evaluate the config for an Expo project.

export declare function getPackageJson(projectRoot: string): PackageJSONConfig;
export declare function readConfigJson(projectRoot: string, skipValidation?: boolean, skipSDKVersionRequirement?: boolean): ProjectConfig;
/**

@@ -38,11 +37,2 @@ * Get the static and dynamic config paths for a project. Also accounts for custom paths.

export declare function getConfigFilePaths(projectRoot: string): ConfigFilePaths;
export declare function findConfigFile(projectRoot: string): {
configPath: string;
configName: string;
configNamespace: 'expo';
};
export declare function configFilename(projectRoot: string): string;
export declare function readExpRcAsync(projectRoot: string): Promise<ExpRc>;
export declare function resetCustomConfigPaths(): void;
export declare function setCustomConfigPath(projectRoot: string, configPath: string): void;
/**

@@ -64,3 +54,2 @@ * Attempt to modify an Expo project config.

}>;
export declare function writeConfigJsonAsync(projectRoot: string, options: object): Promise<ProjectConfig>;
export declare function getWebOutputPath(config?: {

@@ -91,2 +80,1 @@ [key: string]: any;

export * from './Config.types';
export { isLegacyImportsEnabled } from './isLegacyImportsEnabled';

@@ -9,11 +9,4 @@ "use strict";

getPackageJson: true,
readConfigJson: true,
getConfigFilePaths: true,
findConfigFile: true,
configFilename: true,
readExpRcAsync: true,
resetCustomConfigPaths: true,
setCustomConfigPath: true,
modifyConfigAsync: true,
writeConfigJsonAsync: true,
getWebOutputPath: true,

@@ -23,7 +16,4 @@ getNameFromConfig: true,

getProjectConfigDescription: true,
getProjectConfigDescriptionWithPaths: true,
isLegacyImportsEnabled: true
getProjectConfigDescriptionWithPaths: true
};
exports.configFilename = configFilename;
exports.findConfigFile = findConfigFile;
exports.getConfig = getConfig;

@@ -37,157 +27,95 @@ exports.getConfigFilePaths = getConfigFilePaths;

exports.getWebOutputPath = getWebOutputPath;
Object.defineProperty(exports, "isLegacyImportsEnabled", {
enumerable: true,
get: function () {
return _isLegacyImportsEnabled().isLegacyImportsEnabled;
}
});
exports.modifyConfigAsync = modifyConfigAsync;
exports.readConfigJson = readConfigJson;
exports.readExpRcAsync = readExpRcAsync;
exports.resetCustomConfigPaths = resetCustomConfigPaths;
exports.setCustomConfigPath = setCustomConfigPath;
exports.writeConfigJsonAsync = writeConfigJsonAsync;
function _jsonFile() {
const data = _interopRequireDefault(require("@expo/json-file"));
_jsonFile = function () {
return data;
};
return data;
}
function _fs() {
const data = _interopRequireDefault(require("fs"));
_fs = function () {
return data;
};
return data;
}
function _glob() {
const data = require("glob");
_glob = function () {
return data;
};
return data;
}
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
function _resolveFrom() {
const data = _interopRequireDefault(require("resolve-from"));
_resolveFrom = function () {
return data;
};
return data;
}
function _semver() {
const data = _interopRequireDefault(require("semver"));
_semver = function () {
return data;
};
return data;
}
function _slugify() {
const data = _interopRequireDefault(require("slugify"));
_slugify = function () {
return data;
};
return data;
}
function _Errors() {
const data = require("./Errors");
_Errors = function () {
function _getConfig() {
const data = require("./getConfig");
_getConfig = function () {
return data;
};
return data;
}
function _Project() {
const data = require("./Project");
_Project = function () {
function _getExpoSDKVersion() {
const data = require("./getExpoSDKVersion");
_getExpoSDKVersion = function () {
return data;
};
return data;
}
function _getConfig() {
const data = require("./getConfig");
_getConfig = function () {
return data;
};
return data;
}
function _getFullName() {
const data = require("./getFullName");
_getFullName = function () {
return data;
};
return data;
}
function _withConfigPlugins() {
const data = require("./plugins/withConfigPlugins");
_withConfigPlugins = function () {
return data;
};
return data;
}
function _withInternal() {
const data = require("./plugins/withInternal");
_withInternal = function () {
return data;
};
return data;
}
function _resolvePackageJson() {
const data = require("./resolvePackageJson");
_resolvePackageJson = function () {
return data;
};
return data;
}
var _Config = require("./Config.types");
Object.keys(_Config).forEach(function (key) {

@@ -204,15 +132,3 @@ if (key === "default" || key === "__esModule") return;

});
function _isLegacyImportsEnabled() {
const data = require("./isLegacyImportsEnabled");
_isLegacyImportsEnabled = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**

@@ -226,3 +142,2 @@ * If a config has an `expo` object then that will be used as the config.

var _config$expo;
if (!config) return config === undefined ? null : config;

@@ -238,2 +153,3 @@ const {

}
/**

@@ -245,17 +161,13 @@ * Get all platforms that a project is currently capable of running.

*/
function getSupportedPlatforms(projectRoot) {
const platforms = [];
if (_resolveFrom().default.silent(projectRoot, 'react-native')) {
platforms.push('ios', 'android');
}
if (_resolveFrom().default.silent(projectRoot, 'react-native-web')) {
platforms.push('web');
}
return platforms;
}
/**

@@ -287,15 +199,14 @@ * Evaluate the config for an Expo project.

*/
function getConfig(projectRoot, options = {}) {
const paths = getConfigFilePaths(projectRoot);
const rawStaticConfig = paths.staticConfigPath ? (0, _getConfig().getStaticConfig)(paths.staticConfigPath) : null; // For legacy reasons, always return an object.
const rawStaticConfig = paths.staticConfigPath ? (0, _getConfig().getStaticConfig)(paths.staticConfigPath) : null;
// For legacy reasons, always return an object.
const rootConfig = rawStaticConfig || {};
const staticConfig = reduceExpoObject(rawStaticConfig) || {}; // Can only change the package.json location if an app.json or app.config.json exists
const staticConfig = reduceExpoObject(rawStaticConfig) || {};
// Can only change the package.json location if an app.json or app.config.json exists
const [packageJson, packageJsonPath] = getPackageJsonAndPath(projectRoot);
function fillAndReturnConfig(config, dynamicConfigObjectType) {
const configWithDefaultValues = { ...ensureConfigHasDefaultValues({
const configWithDefaultValues = {
...ensureConfigHasDefaultValues({
projectRoot,

@@ -314,13 +225,10 @@ exp: config.expo,

};
if (options.isModdedConfig) {
var _config$mods;
// @ts-ignore: Add the mods back to the object.
configWithDefaultValues.exp.mods = (_config$mods = config.mods) !== null && _config$mods !== void 0 ? _config$mods : null;
} // Apply static json plugins, should be done after _internal
}
// Apply static json plugins, should be done after _internal
configWithDefaultValues.exp = (0, _withConfigPlugins().withConfigPlugins)(configWithDefaultValues.exp, !!options.skipPlugins);
if (!options.isModdedConfig) {

@@ -330,25 +238,22 @@ // @ts-ignore: Delete mods added by static plugins when they won't have a chance to be evaluated

}
if (options.isPublicConfig) {
var _configWithDefaultVal, _configWithDefaultVal2, _configWithDefaultVal3, _configWithDefaultVal4;
// TODD(EvanBacon): Drop plugins array after it's been resolved.
// Remove internal values with references to user's file paths from the public config.
delete configWithDefaultValues.exp._internal;
if (configWithDefaultValues.exp.hooks) {
delete configWithDefaultValues.exp.hooks;
}
if ((_configWithDefaultVal = configWithDefaultValues.exp.ios) !== null && _configWithDefaultVal !== void 0 && _configWithDefaultVal.config) {
delete configWithDefaultValues.exp.ios.config;
}
if ((_configWithDefaultVal2 = configWithDefaultValues.exp.android) !== null && _configWithDefaultVal2 !== void 0 && _configWithDefaultVal2.config) {
delete configWithDefaultValues.exp.android.config;
} // These value will be overwritten when the manifest is being served from the host (i.e. not completely accurate).
}
// These value will be overwritten when the manifest is being served from the host (i.e. not completely accurate).
// @ts-ignore: currentFullName not on type yet.
configWithDefaultValues.exp.currentFullName = (0, _getFullName().getFullName)(configWithDefaultValues.exp); // @ts-ignore: originalFullName not on type yet.
configWithDefaultValues.exp.currentFullName = (0, _getFullName().getFullName)(configWithDefaultValues.exp);
// @ts-ignore: originalFullName not on type yet.
configWithDefaultValues.exp.originalFullName = (0, _getFullName().getFullName)(configWithDefaultValues.exp);

@@ -358,7 +263,6 @@ (_configWithDefaultVal3 = configWithDefaultValues.exp.updates) === null || _configWithDefaultVal3 === void 0 ? true : delete _configWithDefaultVal3.codeSigningCertificate;

}
return configWithDefaultValues;
} // Fill in the static config
}
// Fill in the static config
function getContextConfig(config) {

@@ -374,3 +278,2 @@ return ensureConfigHasDefaultValues({

}
if (paths.dynamicConfigPath) {

@@ -386,13 +289,12 @@ // No app.config.json or app.json but app.config.js

config: getContextConfig(staticConfig)
}); // Allow for the app.config.js to `export default null;`
});
// Allow for the app.config.js to `export default null;`
// Use `dynamicConfigPath` to detect if a dynamic config exists.
const dynamicConfig = reduceExpoObject(rawDynamicConfig) || {};
return fillAndReturnConfig(dynamicConfig, exportedObjectType);
} // No app.config.js but json or no config
}
// No app.config.js but json or no config
return fillAndReturnConfig(staticConfig || {}, null);
}
function getPackageJson(projectRoot) {

@@ -402,3 +304,2 @@ const [pkg] = getPackageJsonAndPath(projectRoot);

}
function getPackageJsonAndPath(projectRoot) {

@@ -409,47 +310,2 @@ const packageJsonPath = (0, _resolvePackageJson().getRootPackageJsonPath)(projectRoot);

function readConfigJson(projectRoot, skipValidation = false, skipSDKVersionRequirement = false) {
const paths = getConfigFilePaths(projectRoot);
const rawStaticConfig = paths.staticConfigPath ? (0, _getConfig().getStaticConfig)(paths.staticConfigPath) : null;
const getConfigName = () => {
if (paths.staticConfigPath) return ` \`${_path().default.basename(paths.staticConfigPath)}\``;
return '';
};
let outputRootConfig = rawStaticConfig;
if (outputRootConfig === null || typeof outputRootConfig !== 'object') {
if (skipValidation) {
outputRootConfig = {
expo: {}
};
} else {
throw new (_Errors().ConfigError)(`Project at path ${_path().default.resolve(projectRoot)} does not contain a valid Expo config${getConfigName()}`, 'NOT_OBJECT');
}
}
let exp = outputRootConfig.expo;
if (exp === null || typeof exp !== 'object') {
throw new (_Errors().ConfigError)(`Property 'expo' in${getConfigName()} for project at path ${_path().default.resolve(projectRoot)} is not an object. Please make sure${getConfigName()} includes a managed Expo app config like this: ${APP_JSON_EXAMPLE}`, 'NO_EXPO');
}
exp = { ...exp
};
const [pkg, packageJsonPath] = getPackageJsonAndPath(projectRoot);
return { ...ensureConfigHasDefaultValues({
projectRoot,
exp,
pkg,
skipSDKVersionRequirement,
paths,
packageJsonPath
}),
mods: null,
dynamicConfigObjectType: null,
rootConfig: { ...outputRootConfig
},
...paths
};
}
/**

@@ -460,11 +316,3 @@ * Get the static and dynamic config paths for a project. Also accounts for custom paths.

*/
function getConfigFilePaths(projectRoot) {
const customPaths = getCustomConfigFilePaths(projectRoot);
if (customPaths) {
return customPaths;
}
return {

@@ -475,27 +323,5 @@ dynamicConfigPath: getDynamicConfigFilePath(projectRoot),

}
function getCustomConfigFilePaths(projectRoot) {
if (!customConfigPaths[projectRoot]) {
return null;
} // If the user picks a custom config path, we will only use that and skip searching for a secondary config.
if (isDynamicFilePath(customConfigPaths[projectRoot])) {
return {
dynamicConfigPath: customConfigPaths[projectRoot],
staticConfigPath: null
};
} // Anything that's not js or ts will be treated as json.
return {
staticConfigPath: customConfigPaths[projectRoot],
dynamicConfigPath: null
};
}
function getDynamicConfigFilePath(projectRoot) {
for (const fileName of ['app.config.ts', 'app.config.js']) {
const configPath = _path().default.join(projectRoot, fileName);
if (_fs().default.existsSync(configPath)) {

@@ -505,10 +331,7 @@ return configPath;

}
return null;
}
function getStaticConfigFilePath(projectRoot) {
for (const fileName of ['app.config.json', 'app.json']) {
const configPath = _path().default.join(projectRoot, fileName);
if (_fs().default.existsSync(configPath)) {

@@ -518,60 +341,5 @@ return configPath;

}
return null;
} // TODO: This should account for dynamic configs
function findConfigFile(projectRoot) {
let configPath; // Check for a custom config path first.
if (customConfigPaths[projectRoot]) {
configPath = customConfigPaths[projectRoot]; // We shouldn't verify if the file exists because
// the user manually specified that this path should be used.
return {
configPath,
configName: _path().default.basename(configPath),
configNamespace: 'expo'
};
} else {
// app.config.json takes higher priority over app.json
configPath = _path().default.join(projectRoot, 'app.config.json');
if (!_fs().default.existsSync(configPath)) {
configPath = _path().default.join(projectRoot, 'app.json');
}
}
return {
configPath,
configName: _path().default.basename(configPath),
configNamespace: 'expo'
};
} // TODO: deprecate
function configFilename(projectRoot) {
return findConfigFile(projectRoot).configName;
}
async function readExpRcAsync(projectRoot) {
const expRcPath = _path().default.join(projectRoot, '.exprc');
return await _jsonFile().default.readAsync(expRcPath, {
json5: true,
cantReadFileDefault: {}
});
}
const customConfigPaths = {};
function resetCustomConfigPaths() {
for (const key of Object.keys(customConfigPaths)) {
delete customConfigPaths[key];
}
}
function setCustomConfigPath(projectRoot, configPath) {
customConfigPaths[projectRoot] = configPath;
}
/**

@@ -588,10 +356,6 @@ * Attempt to modify an Expo project config.

*/
async function modifyConfigAsync(projectRoot, modifications, readOptions = {}, writeOptions = {}) {
const config = getConfig(projectRoot, readOptions);
if (config.dynamicConfigPath) {
// We cannot automatically write to a dynamic config.
/* Currently we should just use the safest approach possible, informing the user that they'll need to manually modify their dynamic config.

@@ -615,7 +379,9 @@ if (config.staticConfigPath) {

// Static with no dynamic config, this means we can append to the config automatically.
let outputConfig; // If the config has an expo object (app.json) then append the options to that object.
let outputConfig;
// If the config has an expo object (app.json) then append the options to that object.
if (config.rootConfig.expo) {
outputConfig = { ...config.rootConfig,
expo: { ...config.rootConfig.expo,
outputConfig = {
...config.rootConfig,
expo: {
...config.rootConfig.expo,
...modifications

@@ -626,7 +392,7 @@ }

// Otherwise (app.config.json) just add the config modification to the top most level.
outputConfig = { ...config.rootConfig,
outputConfig = {
...config.rootConfig,
...modifications
};
}
if (!writeOptions.dryRun) {

@@ -637,3 +403,2 @@ await _jsonFile().default.writeAsync(config.staticConfigPath, outputConfig, {

}
return {

@@ -644,3 +409,2 @@ type: 'success',

}
return {

@@ -652,11 +416,2 @@ type: 'fail',

}
const APP_JSON_EXAMPLE = JSON.stringify({
expo: {
name: 'My app',
slug: 'my-app',
sdkVersion: '...'
}
});
function ensureConfigHasDefaultValues({

@@ -671,7 +426,5 @@ projectRoot,

var _exp$name, _exp$slug, _exp$version;
if (!exp) {
exp = {};
}
exp = (0, _withInternal().withInternal)(exp, {

@@ -681,11 +434,13 @@ projectRoot,

packageJsonPath
}); // Defaults for package.json fields
});
// Defaults for package.json fields
const pkgName = typeof pkg.name === 'string' ? pkg.name : _path().default.basename(projectRoot);
const pkgVersion = typeof pkg.version === 'string' ? pkg.version : '1.0.0';
const pkgWithDefaults = { ...pkg,
const pkgWithDefaults = {
...pkg,
name: pkgName,
version: pkgVersion
}; // Defaults for app.json/app.config.js fields
};
// Defaults for app.json/app.config.js fields
const name = (_exp$name = exp.name) !== null && _exp$name !== void 0 ? _exp$name : pkgName;

@@ -695,8 +450,7 @@ const slug = (_exp$slug = exp.slug) !== null && _exp$slug !== void 0 ? _exp$slug : (0, _slugify().default)(name.toLowerCase());

let description = exp.description;
if (!description && typeof pkg.description === 'string') {
description = pkg.description;
}
const expWithDefaults = { ...exp,
const expWithDefaults = {
...exp,
name,

@@ -708,17 +462,14 @@ slug,

let sdkVersion;
try {
sdkVersion = (0, _Project().getExpoSDKVersion)(projectRoot, expWithDefaults);
sdkVersion = (0, _getExpoSDKVersion().getExpoSDKVersion)(projectRoot, expWithDefaults);
} catch (error) {
if (!skipSDKVersionRequirement) throw error;
}
let platforms = exp.platforms;
if (!platforms) {
platforms = getSupportedPlatforms(projectRoot);
}
return {
exp: { ...expWithDefaults,
exp: {
...expWithDefaults,
sdkVersion,

@@ -730,48 +481,11 @@ platforms

}
async function writeConfigJsonAsync(projectRoot, options) {
const paths = getConfigFilePaths(projectRoot);
let {
exp,
pkg,
rootConfig,
dynamicConfigObjectType
} = readConfigJson(projectRoot);
exp = { ...rootConfig.expo,
...options
};
rootConfig = { ...rootConfig,
expo: exp
};
if (paths.staticConfigPath) {
await _jsonFile().default.writeAsync(paths.staticConfigPath, rootConfig, {
json5: false
});
} else {
console.log('Failed to write to config: ', options);
}
return {
exp,
pkg,
rootConfig,
dynamicConfigObjectType,
...paths
};
}
const DEFAULT_BUILD_PATH = `web-build`;
function getWebOutputPath(config = {}) {
var _expo$web, _expo$web$build;
if (process.env.WEBPACK_BUILD_OUTPUT_PATH) {
return process.env.WEBPACK_BUILD_OUTPUT_PATH;
}
const expo = config.expo || config || {};
return (expo === null || expo === void 0 ? void 0 : (_expo$web = expo.web) === null || _expo$web === void 0 ? void 0 : (_expo$web$build = _expo$web.build) === null || _expo$web$build === void 0 ? void 0 : _expo$web$build.output) || DEFAULT_BUILD_PATH;
}
function getNameFromConfig(exp = {}) {

@@ -782,4 +496,5 @@ // For RN CLI support

web = {}
} = appManifest; // rn-cli apps use a displayName value as well.
} = appManifest;
// rn-cli apps use a displayName value as well.
const appName = exp.displayName || appManifest.displayName || appManifest.name;

@@ -792,24 +507,21 @@ const webName = web.name || appName;

}
function getDefaultTarget(projectRoot, exp) {
var _exp;
(_exp = exp) !== null && _exp !== void 0 ? _exp : exp = getConfig(projectRoot, {
skipSDKVersionRequirement: true
}).exp; // before SDK 37, always default to managed to preserve previous behavior
}).exp;
// before SDK 37, always default to managed to preserve previous behavior
if (exp.sdkVersion && exp.sdkVersion !== 'UNVERSIONED' && _semver().default.lt(exp.sdkVersion, '37.0.0')) {
return 'managed';
}
return isBareWorkflowProject(projectRoot) ? 'bare' : 'managed';
}
function isBareWorkflowProject(projectRoot) {
const [pkg] = getPackageJsonAndPath(projectRoot);
// TODO: Drop this
if (pkg.dependencies && pkg.dependencies.expokit) {
return false;
}
const xcodeprojFiles = (0, _glob().sync)('ios/**/*.xcodeproj', {

@@ -819,7 +531,5 @@ absolute: true,

});
if (xcodeprojFiles.length) {
return true;
}
const gradleFiles = (0, _glob().sync)('android/**/*.gradle', {

@@ -829,19 +539,8 @@ absolute: true,

});
if (gradleFiles.length) {
return true;
}
return false;
}
/**
* true if the file is .js or .ts
*
* @param filePath
*/
function isDynamicFilePath(filePath) {
return !!filePath.match(/\.[j|t]s$/);
}
/**

@@ -854,4 +553,2 @@ * Return a useful name describing the project config.

*/
function getProjectConfigDescription(projectRoot) {

@@ -861,2 +558,3 @@ const paths = getConfigFilePaths(projectRoot);

}
/**

@@ -869,20 +567,15 @@ * Returns a string describing the configurations used for the given project root.

*/
function getProjectConfigDescriptionWithPaths(projectRoot, projectConfig) {
if (projectConfig.dynamicConfigPath) {
const relativeDynamicConfigPath = _path().default.relative(projectRoot, projectConfig.dynamicConfigPath);
if (projectConfig.staticConfigPath) {
return `${relativeDynamicConfigPath} or ${_path().default.relative(projectRoot, projectConfig.staticConfigPath)}`;
}
return relativeDynamicConfigPath;
} else if (projectConfig.staticConfigPath) {
return _path().default.relative(projectRoot, projectConfig.staticConfigPath);
} // If a config doesn't exist, our tooling will generate a static app.json
}
// If a config doesn't exist, our tooling will generate a static app.json
return 'app.json';
}
//# sourceMappingURL=Config.js.map
import { ModConfig } from '@expo/config-plugins';
import { ExpoConfig } from '@expo/config-types';
export { ExpoConfig };
export declare type PackageJSONConfig = {
export type PackageJSONConfig = {
dependencies?: Record<string, string>;

@@ -45,11 +45,11 @@ [key: string]: any;

}
export declare type AppJSONConfig = {
export type AppJSONConfig = {
expo: ExpoConfig;
[key: string]: any;
};
export declare type BareAppConfig = {
export type BareAppConfig = {
name: string;
[key: string]: any;
};
export declare type HookArguments = {
export type HookArguments = {
config: any;

@@ -69,3 +69,3 @@ url: any;

};
export declare type ExpoGoConfig = {
export type ExpoGoConfig = {
mainModuleName: string;

@@ -83,9 +83,9 @@ __flipperHack: 'React Native packager is running';

};
export declare type EASConfig = {
export type EASConfig = {
projectId?: string;
};
export declare type ClientScopingConfig = {
export type ClientScopingConfig = {
scopeKey?: string;
};
export declare type ExpoClientConfig = ExpoConfig & {
export type ExpoClientConfig = ExpoConfig & {
id?: string;

@@ -98,3 +98,3 @@ releaseId?: string;

};
export declare type ExpoAppManifest = ExpoClientConfig & EASConfig & Partial<ExpoGoConfig> & {
export type ExpoAppManifest = ExpoClientConfig & EASConfig & Partial<ExpoGoConfig> & {
sdkVersion: string;

@@ -132,7 +132,7 @@ bundledAssets?: string[];

}
export declare type Hook = {
export type Hook = {
file: string;
config: any;
};
export declare type HookType = 'postPublish' | 'postExport';
export type HookType = 'postPublish' | 'postExport';
export declare enum ProjectPrivacy {

@@ -142,9 +142,6 @@ PUBLIC = "public",

}
export declare type ExpRc = {
[key: string]: any;
};
export declare type Platform = 'android' | 'ios' | 'web';
export declare type ProjectTarget = 'managed' | 'bare';
export declare type ConfigErrorCode = 'NO_APP_JSON' | 'NOT_OBJECT' | 'NO_EXPO' | 'MODULE_NOT_FOUND' | 'INVALID_MODE' | 'INVALID_FORMAT' | 'INVALID_PLUGIN' | 'INVALID_CONFIG';
export declare type ConfigContext = {
export type Platform = 'android' | 'ios' | 'web';
export type ProjectTarget = 'managed' | 'bare';
export type ConfigErrorCode = 'NO_APP_JSON' | 'NOT_OBJECT' | 'NO_EXPO' | 'MODULE_NOT_FOUND' | 'DEPRECATED' | 'INVALID_MODE' | 'INVALID_FORMAT' | 'INVALID_PLUGIN' | 'INVALID_CONFIG';
export type ConfigContext = {
projectRoot: string;

@@ -158,3 +155,3 @@ /**

};
export declare type GetConfigOptions = {
export type GetConfigOptions = {
isPublicConfig?: boolean;

@@ -174,8 +171,8 @@ /**

};
export declare type WriteConfigOptions = {
export type WriteConfigOptions = {
dryRun?: boolean;
};
export declare type ConfigFilePaths = {
export type ConfigFilePaths = {
staticConfigPath: string | null;
dynamicConfigPath: string | null;
};

@@ -13,16 +13,11 @@ "use strict";

exports.ProjectPrivacy = void 0;
function _configTypes() {
const data = require("@expo/config-types");
_configTypes = function () {
return data;
};
return data;
}
let ProjectPrivacy;
exports.ProjectPrivacy = ProjectPrivacy;
(function (ProjectPrivacy) {

@@ -29,0 +24,0 @@ ProjectPrivacy["PUBLIC"] = "public";

@@ -7,5 +7,5 @@ "use strict";

exports.ConfigError = void 0;
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
/**

@@ -19,11 +19,7 @@ * Based on `JsonFileError` from `@expo/json-file`

this.cause = cause;
_defineProperty(this, "name", 'ConfigError');
_defineProperty(this, "isConfigError", true);
}
}
exports.ConfigError = ConfigError;
//# sourceMappingURL=Errors.js.map
import { AppJSONConfig, ConfigContext, ExpoConfig } from './Config.types';
declare type RawDynamicConfig = AppJSONConfig | Partial<ExpoConfig> | null;
export declare type DynamicConfigResults = {
type RawDynamicConfig = AppJSONConfig | Partial<ExpoConfig> | null;
export type DynamicConfigResults = {
config: RawDynamicConfig;

@@ -5,0 +5,0 @@ exportedObjectType: string;

@@ -8,55 +8,38 @@ "use strict";

exports.resolveConfigExport = resolveConfigExport;
function _fs() {
const data = require("fs");
_fs = function () {
return data;
};
return data;
}
function _requireFromString() {
const data = _interopRequireDefault(require("require-from-string"));
_requireFromString = function () {
return data;
};
return data;
}
function _sucrase() {
const data = require("sucrase");
_sucrase = function () {
return data;
};
return data;
}
function _Errors() {
const data = require("./Errors");
_Errors = function () {
return data;
};
return data;
}
function _Serialize() {
const data = require("./Serialize");
_Serialize = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
/**

@@ -72,3 +55,2 @@ * Transpile and evaluate the dynamic config object.

let result;
try {

@@ -83,4 +65,5 @@ const {

} catch (error) {
const location = extractLocationFromSyntaxError(error); // Apply a code frame preview to the error if possible, sucrase doesn't do this by default.
const location = extractLocationFromSyntaxError(error);
// Apply a code frame preview to the error if possible, sucrase doesn't do this by default.
if (location) {

@@ -90,3 +73,2 @@ const {

} = require('@babel/code-frame');
const codeFrame = codeFrameColumns(contents, {

@@ -101,3 +83,2 @@ start: error.loc

const importantStack = extractImportantStackFromNodeError(error);
if (importantStack) {

@@ -107,9 +88,6 @@ error.message += `\n${importantStack}`;

}
throw error;
}
return resolveConfigExport(result, configFile, request);
}
function extractLocationFromSyntaxError(error) {

@@ -119,5 +97,5 @@ // sucrase provides the `loc` object

return error.loc;
} // `SyntaxError`s provide the `lineNumber` and `columnNumber` properties
}
// `SyntaxError`s provide the `lineNumber` and `columnNumber` properties
if ('lineNumber' in error && 'columnNumber' in error) {

@@ -129,28 +107,25 @@ return {

}
return null;
}
return null;
} // These kinda errors often come from syntax errors in files that were imported by the main file.
// These kinda errors often come from syntax errors in files that were imported by the main file.
// An example is a module that includes an import statement.
function extractImportantStackFromNodeError(error) {
if (isSyntaxError(error)) {
var _error$stack;
const traces = (_error$stack = error.stack) === null || _error$stack === void 0 ? void 0 : _error$stack.split('\n').filter(line => !line.startsWith(' at '));
if (!traces) return null; // Remove redundant line
if (!traces) return null;
// Remove redundant line
if (traces[traces.length - 1].startsWith('SyntaxError:')) {
traces.pop();
}
return traces.join('\n');
}
return null;
}
function isSyntaxError(error) {
return error instanceof SyntaxError || error.constructor.name === 'SyntaxError';
}
/**

@@ -166,22 +141,16 @@ * - Resolve the exported contents of an Expo config (be it default or module.exports)

*/
function resolveConfigExport(result, configFile, request) {
var _result;
if (result.default != null) {
result = result.default;
}
const exportedObjectType = typeof result;
if (typeof result === 'function') {
result = result(request);
}
if (result instanceof Promise) {
throw new (_Errors().ConfigError)(`Config file ${configFile} cannot return a Promise.`, 'INVALID_CONFIG');
} // If the expo object exists, ignore all other values.
}
// If the expo object exists, ignore all other values.
if ((_result = result) !== null && _result !== void 0 && _result.expo) {

@@ -192,3 +161,2 @@ result = (0, _Serialize().serializeSkippingMods)(result.expo);

}
return {

@@ -195,0 +163,0 @@ config: result,

@@ -8,45 +8,31 @@ "use strict";

exports.getStaticConfig = getStaticConfig;
function _jsonFile() {
const data = _interopRequireDefault(require("@expo/json-file"));
_jsonFile = function () {
return data;
};
return data;
}
function _fs() {
const data = require("fs");
_fs = function () {
return data;
};
return data;
}
function _Errors() {
const data = require("./Errors");
_Errors = function () {
return data;
};
return data;
}
function _evalConfig() {
const data = require("./evalConfig");
_evalConfig = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// We cannot use async config resolution right now because Next.js doesn't support async configs.

@@ -59,3 +45,2 @@ // If they don't add support for async Webpack configs then we may need to pull support for Next.js.

}
try {

@@ -70,16 +55,12 @@ return (0, _evalConfig().evalConfig)(configFile, context);

}
function getDynamicConfig(configPath, request) {
const config = readConfigFile(configPath, request);
if (config) {
// The config must be serialized and evaluated ahead of time so the spawned process can send it over.
return config;
} // TODO: It seems this is only thrown if the file cannot be found (which may never happen).
}
// TODO: It seems this is only thrown if the file cannot be found (which may never happen).
// If so we should throw a more helpful error.
throw new (_Errors().ConfigError)(`Failed to read config at: ${configPath}`, 'INVALID_CONFIG');
}
function getStaticConfig(configPath) {

@@ -89,9 +70,7 @@ const config = _jsonFile().default.read(configPath, {

});
if (config) {
return config;
}
throw new (_Errors().ConfigError)(`Failed to read config at: ${configPath}`, 'INVALID_CONFIG');
}
//# sourceMappingURL=getConfig.js.map

@@ -8,14 +8,11 @@ "use strict";

exports.getFullName = getFullName;
function _getUserState() {
const data = require("./getUserState");
_getUserState = function () {
return data;
};
return data;
}
const ANONYMOUS_USERNAME = 'anonymous';
const ANONYMOUS_USERNAME = 'anonymous';
/**

@@ -28,3 +25,2 @@ * Used in expo-constants to generate the `id` property statically for an app in custom managed workflow.

*/
function getFullName(manifest) {

@@ -34,16 +30,12 @@ const username = getAccountUsername(manifest);

}
function getAccountUsername(manifest = {}) {
var _getUserState$read$au;
// TODO: Must match what's generated in Expo Go.
const username = manifest.owner || process.env.EXPO_CLI_USERNAME || process.env.EAS_BUILD_USERNAME;
if (username) {
return username;
} // Statically get the username from the global user state.
}
// Statically get the username from the global user state.
return ((_getUserState$read$au = (0, _getUserState().getUserState)().read().auth) === null || _getUserState$read$au === void 0 ? void 0 : _getUserState$read$au.username) || ANONYMOUS_USERNAME;
}
//# sourceMappingURL=getFullName.js.map
import JsonFile from '@expo/json-file';
export declare type UserSettingsData = {
export type UserSettingsData = {
developmentCodeSigningId?: string;

@@ -13,3 +13,3 @@ appleId?: string;

};
export declare type UserData = {
export type UserData = {
appleId?: string;

@@ -21,5 +21,5 @@ userId?: string;

};
export declare type ConnectionType = 'Access-Token-Authentication' | 'Username-Password-Authentication' | 'facebook' | 'google-oauth2' | 'github';
export type ConnectionType = 'Access-Token-Authentication' | 'Username-Password-Authentication' | 'facebook' | 'google-oauth2' | 'github';
export declare function getExpoHomeDirectory(): string;
export declare function getUserStatePath(): string;
export declare function getUserState(): JsonFile<UserSettingsData>;

@@ -9,49 +9,33 @@ "use strict";

exports.getUserStatePath = getUserStatePath;
function _jsonFile() {
const data = _interopRequireDefault(require("@expo/json-file"));
_jsonFile = function () {
return data;
};
return data;
}
function _getenv() {
const data = require("getenv");
_getenv = function () {
return data;
};
return data;
}
function _os() {
const data = require("os");
_os = function () {
return data;
};
return data;
}
function path() {
const data = _interopRequireWildcard(require("path"));
path = function () {
return data;
};
return data;
}
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// The ~/.expo directory is used to store authentication sessions,

@@ -61,3 +45,2 @@ // which are shared between EAS CLI and Expo CLI.

const home = (0, _os().homedir)();
if (process.env.__UNSAFE_EXPO_HOME_DIRECTORY) {

@@ -70,10 +53,7 @@ return process.env.__UNSAFE_EXPO_HOME_DIRECTORY;

}
return path().join(home, '.expo');
}
function getUserStatePath() {
return path().join(getExpoHomeDirectory(), 'state.json');
}
function getUserState() {

@@ -80,0 +60,0 @@ return new (_jsonFile().default)(getUserStatePath(), {

export * from './Config';
export * from './Config.types';
export * from './Project';
export * from './getExpoSDKVersion';
export * from './Errors';
export { getAccountUsername } from './getFullName';

@@ -15,5 +15,3 @@ "use strict";

});
var _Config = require("./Config");
Object.keys(_Config).forEach(function (key) {

@@ -30,5 +28,3 @@ if (key === "default" || key === "__esModule") return;

});
var _Config2 = require("./Config.types");
Object.keys(_Config2).forEach(function (key) {

@@ -45,19 +41,15 @@ if (key === "default" || key === "__esModule") return;

});
var _Project = require("./Project");
Object.keys(_Project).forEach(function (key) {
var _getExpoSDKVersion = require("./getExpoSDKVersion");
Object.keys(_getExpoSDKVersion).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
if (Object.prototype.hasOwnProperty.call(_exportNames, key)) return;
if (key in exports && exports[key] === _Project[key]) return;
if (key in exports && exports[key] === _getExpoSDKVersion[key]) return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function () {
return _Project[key];
return _getExpoSDKVersion[key];
}
});
});
var _Errors = require("./Errors");
Object.keys(_Errors).forEach(function (key) {

@@ -74,12 +66,9 @@ if (key === "default" || key === "__esModule") return;

});
function _getFullName() {
const data = require("./getFullName");
_getFullName = function () {
return data;
};
return data;
}
//# sourceMappingURL=index.js.map

@@ -1,2 +0,2 @@

export declare type LanguageOptions = {
export type LanguageOptions = {
isTS: boolean;

@@ -8,3 +8,2 @@ isModern: boolean;

export declare function getLanguageExtensionsInOrder({ isTS, isModern, isReact, }: LanguageOptions): string[];
export declare function getManagedExtensions(platforms: string[], languageOptions?: LanguageOptions): string[];
export declare function getBareExtensions(platforms: string[], languageOptions?: LanguageOptions): string[];

@@ -9,16 +9,10 @@ "use strict";

exports.getLanguageExtensionsInOrder = getLanguageExtensionsInOrder;
exports.getManagedExtensions = getManagedExtensions;
function _assert() {
const data = _interopRequireDefault(require("assert"));
_assert = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function getExtensions(platforms, extensions, workflows) {

@@ -29,4 +23,4 @@ // In the past we used spread operators to collect the values so now we enforce type safety on them.

(0, _assert().default)(Array.isArray(workflows), 'Expected: `workflows: string[]`');
const fileExtensions = []; // support .expo files
const fileExtensions = [];
// support .expo files
for (const workflow of [...workflows, '']) {

@@ -41,6 +35,4 @@ // Ensure order is correct: [platformA.js, platformB.js, js]

}
return fileExtensions;
}
function getLanguageExtensionsInOrder({

@@ -52,30 +44,14 @@ isTS,

// @ts-ignore: filter removes false type
const addLanguage = lang => [lang, isReact && `${lang}x`].filter(Boolean); // Support JavaScript
const addLanguage = lang => [lang, isReact && `${lang}x`].filter(Boolean);
// Support JavaScript
let extensions = addLanguage('js');
if (isModern) {
extensions.unshift('mjs');
}
if (isTS) {
extensions = [...addLanguage('ts'), ...extensions];
}
return extensions;
}
function getManagedExtensions(platforms, languageOptions = {
isTS: true,
isModern: true,
isReact: true
}) {
const fileExtensions = getExtensions(platforms, getLanguageExtensionsInOrder(languageOptions), ['expo']); // Always add these last
_addMiscellaneousExtensions(platforms, fileExtensions);
return fileExtensions;
}
function getBareExtensions(platforms, languageOptions = {

@@ -86,20 +62,17 @@ isTS: true,

}) {
const fileExtensions = getExtensions(platforms, getLanguageExtensionsInOrder(languageOptions), []); // Always add these last
const fileExtensions = getExtensions(platforms, getLanguageExtensionsInOrder(languageOptions), []);
// Always add these last
_addMiscellaneousExtensions(platforms, fileExtensions);
return fileExtensions;
}
function _addMiscellaneousExtensions(platforms, fileExtensions) {
// Always add these with no platform extension
// In the future we may want to add platform and workspace extensions to json.
fileExtensions.push('json'); // Native doesn't currently support web assembly.
fileExtensions.push('json');
// Native doesn't currently support web assembly.
if (platforms.includes('web')) {
fileExtensions.push('wasm');
}
return fileExtensions;
}
//# sourceMappingURL=extensions.js.map

@@ -6,5 +6,3 @@ "use strict";

});
var _paths = require("./paths");
Object.keys(_paths).forEach(function (key) {

@@ -20,5 +18,3 @@ if (key === "default" || key === "__esModule") return;

});
var _extensions = require("./extensions");
Object.keys(_extensions).forEach(function (key) {

@@ -25,0 +21,0 @@ if (key === "default" || key === "__esModule") return;

@@ -13,59 +13,48 @@ "use strict";

exports.resolveFromSilentWithExtensions = resolveFromSilentWithExtensions;
function _fs() {
const data = _interopRequireDefault(require("fs"));
_fs = function () {
return data;
};
return data;
}
function _path() {
const data = _interopRequireDefault(require("path"));
_path = function () {
return data;
};
return data;
}
function _resolveFrom() {
const data = _interopRequireDefault(require("resolve-from"));
_resolveFrom = function () {
return data;
};
return data;
}
function _Config() {
const data = require("../Config");
_Config = function () {
return data;
};
return data;
}
function _Errors() {
const data = require("../Errors");
_Errors = function () {
return data;
};
return data;
}
function _extensions() {
const data = require("./extensions");
_extensions = function () {
return data;
};
return data;
}
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
// https://github.com/facebook/create-react-app/blob/9750738cce89a967cc71f28390daf5d4311b193c/packages/react-scripts/config/paths.js#L22
function ensureSlash(inputPath, needsSlash) {
const hasSlash = inputPath.endsWith('/');
if (hasSlash && !needsSlash) {

@@ -79,9 +68,6 @@ return inputPath.substr(0, inputPath.length - 1);

}
function getPossibleProjectRoot() {
return _fs().default.realpathSync(process.cwd());
}
const nativePlatforms = ['ios', 'android'];
function resolveEntryPoint(projectRoot, {

@@ -94,37 +80,30 @@ platform,

}
function getEntryPoint(projectRoot, entryFiles, platforms, projectConfig) {
const extensions = (0, _extensions().getBareExtensions)(platforms);
return getEntryPointWithExtensions(projectRoot, entryFiles, extensions, projectConfig);
} // Used to resolve the main entry file for a project.
}
// Used to resolve the main entry file for a project.
function getEntryPointWithExtensions(projectRoot, entryFiles, extensions, projectConfig) {
if (!projectConfig) {
// drop all logging abilities
const original = process.stdout.write;
process.stdout.write = () => true;
try {
projectConfig = (0, _Config().getConfig)(projectRoot, {
skipSDKVersionRequirement: true
});
} finally {
process.stdout.write = original;
}
}
const {
exp,
pkg
} = projectConfig !== null && projectConfig !== void 0 ? projectConfig : (0, _Config().getConfig)(projectRoot, {
skipSDKVersionRequirement: true
}); // This will first look in the `app.json`s `expo.entryPoint` field for a potential main file.
// We check the Expo config first in case you want your project to start differently with Expo then in a standalone environment.
if (exp && exp.entryPoint && typeof exp.entryPoint === 'string') {
// If the field exists then we want to test it against every one of the supplied extensions
// to ensure the bundler resolves the same way.
let entry = getFileWithExtensions(projectRoot, exp.entryPoint, extensions);
if (!entry) {
// Allow for paths like: `{ "main": "expo/AppEntry" }`
entry = resolveFromSilentWithExtensions(projectRoot, exp.entryPoint, extensions); // If it doesn't resolve then just return the entryPoint as-is. This makes
// it possible for people who have an unconventional setup (eg: multiple
// apps in monorepo with metro at root) to customize entry point without
// us imposing our assumptions.
if (!entry) {
return exp.entryPoint;
}
}
return entry;
} else if (pkg) {
} = projectConfig;
if (typeof (exp === null || exp === void 0 ? void 0 : exp.entryPoint) === 'string') {
// We want to stop reading the app.json for determining the entry file in SDK +49
throw new (_Errors().ConfigError)('expo.entryPoint has been removed in favor of the main field in the package.json.', 'DEPRECATED');
}
if (pkg) {
// If the config doesn't define a custom entry then we want to look at the `package.json`s `main` field, and try again.

@@ -134,7 +113,5 @@ const {

} = pkg;
if (main && typeof main === 'string') {
// Testing the main field against all of the provided extensions - for legacy reasons we can't use node module resolution as the package.json allows you to pass in a file without a relative path and expect it as a relative path.
let entry = getFileWithExtensions(projectRoot, main, extensions);
if (!entry) {

@@ -145,9 +122,8 @@ // Allow for paths like: `{ "main": "expo/AppEntry" }`

}
return entry;
}
} // Now we will start looking for a default entry point using the provided `entryFiles` argument.
}
// Now we will start looking for a default entry point using the provided `entryFiles` argument.
// This will add support for create-react-app (src/index.js) and react-native-cli (index.js) which don't define a main.
for (const fileName of entryFiles) {

@@ -157,3 +133,2 @@ const entry = resolveFromSilentWithExtensions(projectRoot, fileName, extensions);

}
try {

@@ -163,14 +138,14 @@ // If none of the default files exist then we will attempt to use the main Expo entry point.

// Doing this enables us to create a bare minimum Expo project.
// TODO(Bacon): We may want to do a check against `./App` and `expo` in the `package.json` `dependencies` as we can more accurately ensure that the project is expo-min without needing the modules installed.
return (0, _resolveFrom().default)(projectRoot, 'expo/AppEntry');
} catch {
throw new Error(`The project entry file could not be resolved. Please either define it in the \`package.json\` (main), \`app.json\` (expo.entryPoint), create an \`index.js\`, or install the \`expo\` package.`);
throw new Error(`The project entry file could not be resolved. Please define it in the \`main\` field of the \`package.json\`, create an \`index.js\`, or install the \`expo\` package.`);
}
} // Resolve from but with the ability to resolve like a bundler
}
// Resolve from but with the ability to resolve like a bundler
function resolveFromSilentWithExtensions(fromDirectory, moduleId, extensions) {
for (const extension of extensions) {
const modulePath = _resolveFrom().default.silent(fromDirectory, `${moduleId}.${extension}`);
if (modulePath && modulePath.endsWith(extension)) {

@@ -180,18 +155,14 @@ return modulePath;

}
return _resolveFrom().default.silent(fromDirectory, moduleId) || null;
}
return _resolveFrom().default.silent(fromDirectory, moduleId) || null;
} // Statically attempt to resolve a module but with the ability to resolve like a bundler.
// Statically attempt to resolve a module but with the ability to resolve like a bundler.
// This won't use node module resolution.
function getFileWithExtensions(fromDirectory, moduleId, extensions) {
const modulePath = _path().default.join(fromDirectory, moduleId);
if (_fs().default.existsSync(modulePath)) {
return modulePath;
}
for (const extension of extensions) {
const modulePath = _path().default.join(fromDirectory, `${moduleId}.${extension}`);
if (_fs().default.existsSync(modulePath)) {

@@ -201,5 +172,4 @@ return modulePath;

}
return null;
}
//# sourceMappingURL=paths.js.map

@@ -7,23 +7,16 @@ "use strict";

exports.withConfigPlugins = void 0;
function _configPlugins() {
const data = require("@expo/config-plugins");
_configPlugins = function () {
return data;
};
return data;
}
function _Serialize() {
const data = require("../Serialize");
_Serialize = function () {
return data;
};
return data;
}
/**

@@ -37,3 +30,2 @@ * Resolves static plugins array as config plugin functions.

var _config$plugins;
// @ts-ignore: plugins not on config type yet -- TODO

@@ -43,3 +35,2 @@ if (!Array.isArray(config.plugins) || !((_config$plugins = config.plugins) !== null && _config$plugins !== void 0 && _config$plugins.length)) {

}
if (!skipPlugins) {

@@ -52,9 +43,7 @@ // Resolve and evaluate plugins

delete config.plugins;
} // plugins aren't serialized by default, serialize the plugins after resolving them.
}
// plugins aren't serialized by default, serialize the plugins after resolving them.
return (0, _Serialize().serializeAfterStaticPlugins)(config);
};
exports.withConfigPlugins = withConfigPlugins;
//# sourceMappingURL=withConfigPlugins.js.map

@@ -7,14 +7,11 @@ "use strict";

exports.withInternal = exports.EXPO_DEBUG = void 0;
function _getenv() {
const data = require("getenv");
_getenv = function () {
return data;
};
return data;
}
const EXPO_DEBUG = (0, _getenv().boolish)('EXPO_DEBUG', false);
const EXPO_DEBUG = (0, _getenv().boolish)('EXPO_DEBUG', false);
/**

@@ -26,5 +23,3 @@ * Adds the _internal object.

*/
exports.EXPO_DEBUG = EXPO_DEBUG;
const withInternal = (config, internals) => {

@@ -34,3 +29,2 @@ if (!config._internal) {

}
config._internal = {

@@ -43,4 +37,3 @@ isDebug: EXPO_DEBUG,

};
exports.withInternal = withInternal;
//# sourceMappingURL=withInternal.js.map

@@ -7,50 +7,30 @@ "use strict";

exports.getRootPackageJsonPath = getRootPackageJsonPath;
function _fs() {
const data = require("fs");
_fs = function () {
return data;
};
return data;
}
function _path() {
const data = require("path");
_path = function () {
return data;
};
return data;
}
function _Errors() {
const data = require("./Errors");
_Errors = function () {
return data;
};
return data;
}
function fileExists(file) {
try {
return (0, _fs().statSync)(file).isFile();
} catch {
return false;
}
}
function getRootPackageJsonPath(projectRoot) {
const packageJsonPath = (0, _path().join)(projectRoot, 'package.json');
if (!fileExists(packageJsonPath)) {
if (!(0, _fs().existsSync)(packageJsonPath)) {
throw new (_Errors().ConfigError)(`The expected package.json path: ${packageJsonPath} does not exist`, 'MODULE_NOT_FOUND');
}
return packageJsonPath;
}
//# sourceMappingURL=resolvePackageJson.js.map

@@ -9,13 +9,9 @@ "use strict";

exports.serializeSkippingMods = serializeSkippingMods;
function _Errors() {
const data = require("./Errors");
_Errors = function () {
return data;
};
return data;
}
function serializeAndEvaluate(val) {

@@ -31,3 +27,2 @@ if (['undefined', 'string', 'boolean', 'number', 'bigint'].includes(typeof val)) {

const output = {};
for (const property in val) {

@@ -38,14 +33,10 @@ if (val.hasOwnProperty(property)) {

}
return output;
} // symbol
}
// symbol
throw new (_Errors().ConfigError)(`Expo config doesn't support \`Symbols\`: ${val}`, 'INVALID_CONFIG');
}
function serializeSkippingMods(val) {
if (typeof val === 'object' && !Array.isArray(val)) {
const output = {};
for (const property in val) {

@@ -61,9 +52,6 @@ if (val.hasOwnProperty(property)) {

}
return output;
}
return serializeAndEvaluate(val);
}
function serializeAndEvaluatePlugin(val) {

@@ -74,3 +62,2 @@ if (['undefined', 'string', 'boolean', 'number', 'bigint'].includes(typeof val)) {

var _val$name;
return (_val$name = val.name) !== null && _val$name !== void 0 ? _val$name : 'withAnonymous';

@@ -81,3 +68,2 @@ } else if (Array.isArray(val)) {

const output = {};
for (const property in val) {

@@ -88,14 +74,10 @@ if (val.hasOwnProperty(property)) {

}
return output;
} // symbol
}
// symbol
throw new (_Errors().ConfigError)(`Expo config doesn't support \`Symbols\`: ${val}`, 'INVALID_CONFIG');
}
function serializeAfterStaticPlugins(val) {
if (typeof val === 'object' && !Array.isArray(val)) {
const output = {};
for (const property in val) {

@@ -114,8 +96,6 @@ if (val.hasOwnProperty(property)) {

}
return output;
}
return serializeAndEvaluate(val);
}
//# sourceMappingURL=Serialize.js.map
{
"name": "@expo/config",
"version": "7.0.3",
"version": "8.0.0",
"description": "A library for interacting with the app.json",

@@ -36,5 +36,5 @@ "main": "build/index.js",

"@babel/code-frame": "~7.10.4",
"@expo/config-plugins": "~5.0.3",
"@expo/config-types": "^47.0.0",
"@expo/json-file": "8.2.36",
"@expo/config-plugins": "~6.0.0",
"@expo/config-types": "^48.0.0",
"@expo/json-file": "^8.2.37",
"getenv": "^1.0.0",

@@ -54,3 +54,3 @@ "glob": "7.1.6",

},
"gitHead": "b56ceb5bface07762c968c882575a041105b13b6"
"gitHead": "1815e2eaad8c753588c7b1eb74420174a28e01f4"
}

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc