Skip to content
This repository has been archived by the owner on Jan 18, 2024. It is now read-only.

Commit

Permalink
Remove exp.json support (#2017)
Browse files Browse the repository at this point in the history
* Remove exp.json support

* Update Detach.js
  • Loading branch information
EvanBacon authored Apr 28, 2020
1 parent 18d9af6 commit 0d49041
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 28 deletions.
4 changes: 2 additions & 2 deletions packages/xdl/src/Project.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down Expand Up @@ -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);
Expand Down
2 changes: 0 additions & 2 deletions packages/xdl/src/detach/Detach.js
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,6 @@ async function _detachAsync(projectRoot, options) {
}
}

// Modify exp.json
exp.isDetached = true;

if (!exp.detach) {
Expand Down Expand Up @@ -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));
Expand Down
24 changes: 0 additions & 24 deletions packages/xdl/src/project/Doctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import {
ExpoConfig,
PackageJSONConfig,
configFilename,
fileExistsAsync,
getConfig,
getPackageJson,
resolveModule,
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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);

Expand Down

0 comments on commit 0d49041

Please sign in to comment.