@expo/config
Advanced tools
Comparing version 2.1.6 to 2.2.0
@@ -0,1 +1,2 @@ | ||
import { JSONObject } from '@expo/json-file'; | ||
export declare type ProjectConfig = { | ||
@@ -62,3 +63,3 @@ exp: ExpoConfig; | ||
android: undefined; | ||
web: any; | ||
web: JSONObject; | ||
slug?: string | undefined; | ||
@@ -65,0 +66,0 @@ sdkVersion?: string | undefined; |
@@ -14,8 +14,8 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
const json_file_1 = __importDefault(require("@expo/json-file")); | ||
const find_yarn_workspace_root_1 = __importDefault(require("find-yarn-workspace-root")); | ||
const fs_extra_1 = __importDefault(require("fs-extra")); | ||
const path_1 = __importDefault(require("path")); | ||
const fs_extra_1 = __importDefault(require("fs-extra")); | ||
const json_file_1 = __importDefault(require("@expo/json-file")); | ||
const resolve_from_1 = __importDefault(require("resolve-from")); | ||
const slugify_1 = __importDefault(require("slugify")); | ||
const find_yarn_workspace_root_1 = __importDefault(require("find-yarn-workspace-root")); | ||
const APP_JSON_FILE_NAME = 'app.json'; | ||
@@ -120,3 +120,3 @@ // To work with the iPhone X "notch" add `viewport-fit=cover` to the `viewport` meta tag. | ||
try { | ||
web = require(pwaManifestLocation); | ||
web = json_file_1.default.read(pwaManifestLocation); | ||
} | ||
@@ -369,22 +369,23 @@ catch (e) { | ||
const { configPath } = findConfigFile(projectRoot); | ||
let rootConfig; | ||
let rootConfig = null; | ||
try { | ||
rootConfig = require(configPath); | ||
rootConfig = json_file_1.default.read(configPath, { json5: true }); | ||
} | ||
catch (error) { | ||
rootConfig = {}; | ||
} | ||
let { expo: exp } = rootConfig; | ||
if (!exp) { | ||
catch (error) { } | ||
if (rootConfig === null || typeof rootConfig !== 'object') { | ||
if (skipValidation) { | ||
exp = {}; | ||
rootConfig = { expo: {} }; | ||
} | ||
else { | ||
throw new ConfigError(`Property 'expo' in app.json is not an object. Please make sure app.json includes a managed Expo app config like this: ${APP_JSON_EXAMPLE}`, 'NO_EXPO'); | ||
throw new ConfigError('app.json must include a JSON object.', 'NOT_OBJECT'); | ||
} | ||
} | ||
const exp = rootConfig.expo; | ||
if (exp === null || typeof exp !== 'object') { | ||
throw new ConfigError(`Property 'expo' in app.json is not an object. Please make sure app.json includes a managed Expo app config like this: ${APP_JSON_EXAMPLE}`, 'NO_EXPO'); | ||
} | ||
const packageJsonPath = 'nodeModulesPath' in exp && typeof exp.nodeModulesPath === 'string' | ||
? path_1.default.join(path_1.default.resolve(projectRoot, exp.nodeModulesPath), 'package.json') | ||
: path_1.default.join(projectRoot, 'package.json'); | ||
const pkg = require(packageJsonPath); | ||
const pkg = json_file_1.default.read(packageJsonPath); | ||
if (exp && !exp.name && typeof pkg.name === 'string') { | ||
@@ -391,0 +392,0 @@ exp.name = pkg.name; |
{ | ||
"name": "@expo/config", | ||
"version": "2.1.6", | ||
"version": "2.2.0", | ||
"description": "A library for interacting with the app.json", | ||
@@ -33,3 +33,3 @@ "main": "build/Config.js", | ||
"dependencies": { | ||
"@expo/json-file": "^8.1.12", | ||
"@expo/json-file": "^8.2.0", | ||
"find-yarn-workspace-root": "^1.2.1", | ||
@@ -36,0 +36,0 @@ "fs-extra": "^7.0.1", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Dynamic require
Supply chain riskDynamic require can indicate the package is performing dangerous or unsafe dynamic code execution.
Found 1 instance in 1 package
58167
545
1
Updated@expo/json-file@^8.2.0