From 0d49041ef5dfedfe4761d7179098f25b318e1a87 Mon Sep 17 00:00:00 2001 From: Evan Bacon Date: Tue, 28 Apr 2020 10:07:30 -0700 Subject: [PATCH] Remove exp.json support (#2017) * Remove exp.json support * Update Detach.js --- packages/xdl/src/Project.ts | 4 ++-- packages/xdl/src/detach/Detach.js | 2 -- packages/xdl/src/project/Doctor.ts | 24 ------------------------ 3 files changed, 2 insertions(+), 28 deletions(-) diff --git a/packages/xdl/src/Project.ts b/packages/xdl/src/Project.ts index 6a02b81852..281d758387 100644 --- a/packages/xdl/src/Project.ts +++ b/packages/xdl/src/Project.ts @@ -331,7 +331,7 @@ async function _resolveManifestAssets( logMethod( projectRoot, 'expo', - `Unable to resolve asset "${e.localAssetPath}" from "${e.manifestField}" in your app/exp.json.` + `Unable to resolve asset "${e.localAssetPath}" from "${e.manifestField}" in your app.json or app.config.js` ); } else { logMethod( @@ -828,7 +828,7 @@ export async function publishAsync( } catch (e) { if (e.serverError === 'SCHEMA_VALIDATION_ERROR') { throw new Error( - `There was an error validating your project schema. Check for any warnings about the contents of your app/exp.json.` + `There was an error validating your project schema. Check for any warnings about the contents of your app.json or app.config.js.` ); } Sentry.captureException(e); diff --git a/packages/xdl/src/detach/Detach.js b/packages/xdl/src/detach/Detach.js index a1b93420cc..6a5a006089 100644 --- a/packages/xdl/src/detach/Detach.js +++ b/packages/xdl/src/detach/Detach.js @@ -129,7 +129,6 @@ async function _detachAsync(projectRoot, options) { } } - // Modify exp.json exp.isDetached = true; if (!exp.detach) { @@ -222,7 +221,6 @@ async function _detachAsync(projectRoot, options) { } logger.info('Writing ExpoKit configuration...'); - // Update exp.json/app.json // if we're writing to app.json, we need to place the configuration under the expo key const config = configNamespace ? { [configNamespace]: exp } : exp; await fs.writeFile(configPath, JSON.stringify(config, null, 2)); diff --git a/packages/xdl/src/project/Doctor.ts b/packages/xdl/src/project/Doctor.ts index 7969ce2539..07c81272ae 100644 --- a/packages/xdl/src/project/Doctor.ts +++ b/packages/xdl/src/project/Doctor.ts @@ -2,7 +2,6 @@ import { ExpoConfig, PackageJSONConfig, configFilename, - fileExistsAsync, getConfig, getPackageJson, resolveModule, @@ -111,15 +110,6 @@ async function _checkWatchmanVersionAsync(projectRoot: string) { } } -export async function validateWithSchemaFileAsync( - projectRoot: string, - schemaPath: string -): Promise<{ schemaErrorMessage: string | undefined; assetsErrorMessage: string | undefined }> { - let { exp } = getConfig(projectRoot); - let schema = JSON.parse(await fs.readFile(schemaPath, 'utf8')); - return validateWithSchema(projectRoot, exp, schema.schema, 'exp.json', 'UNVERSIONED', true); -} - export async function validateWithSchema( projectRoot: string, exp: any, @@ -188,20 +178,6 @@ async function _validateExpJsonAsync( } ProjectUtils.clearNotification(projectRoot, 'doctor-problem-checking-watchman-version'); - const expJsonExists = await fileExistsAsync(path.join(projectRoot, 'exp.json')); - const appJsonExists = await fileExistsAsync(path.join(projectRoot, 'app.json')); - - if (expJsonExists && appJsonExists) { - ProjectUtils.logWarning( - projectRoot, - 'expo', - `Warning: Both app.json and exp.json exist in this directory. Only one should exist for a single project.`, - 'doctor-both-app-and-exp-json' - ); - return WARNING; - } - ProjectUtils.clearNotification(projectRoot, 'doctor-both-app-and-exp-json'); - let sdkVersion = exp.sdkVersion; const configName = configFilename(projectRoot);