Skip to content
This repository has been archived by the owner on Sep 25, 2018. It is now read-only.

Commit

Permalink
[Naming] Rename ABI to SDK
Browse files Browse the repository at this point in the history
  • Loading branch information
ide committed Mar 16, 2016
1 parent 1584e24 commit 20bba60
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 18 deletions.
8 changes: 4 additions & 4 deletions src/application/Exp.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,8 +132,8 @@ async function getPublishInfoAsync(env, opts) {
exp,
} = pkg;

if (!exp || !exp.abiVersion) {
throw new Error(`exp.abiVersion is missing from package.json file`);
if (!exp || !exp.sdkVersion) {
throw new Error(`exp.sdkVersion is missing from package.json file`);
}

let {
Expand All @@ -146,7 +146,7 @@ async function getPublishInfoAsync(env, opts) {
let remoteFullPackageName = '@' + remoteUsername + '/' + remotePackageName;
let localPackageName = name;
let packageVersion = version;
let abiVersion = exp.abiVersion;
let sdkVersion = exp.sdkVersion;

let ngrokUrl = urlUtils.constructPublishUrl(packagerController);
return {
Expand All @@ -158,7 +158,7 @@ async function getPublishInfoAsync(env, opts) {
remotePackageName,
remoteFullPackageName,
ngrokUrl,
abiVersion,
sdkVersion,
},
body: pkg,
};
Expand Down
26 changes: 13 additions & 13 deletions src/application/PackagerController.js
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ class PackagerController extends events.EventEmitter {
if (options.reset) {
cliOpts.push('--reset-cache');
}

// Run the copy of Node that's embedded in Electron by setting the
// ELECTRON_RUN_AS_NODE environment variable
// Note: the CLI script sets up graceful-fs and sets ulimit to 4096 in the
Expand Down Expand Up @@ -310,33 +310,33 @@ class PackagerController extends events.EventEmitter {
return;
}

if (!pkg.exp || !pkg.exp.abiVersion) {
this.emit('stderr', `Error: Can't find key exp.abiVersion in package.json. See https://exponentjs.com/help`);
if (!pkg.exp || !pkg.exp.sdkVersion) {
this.emit('stderr', `Error: Can't find key exp.sdkVersion in package.json. See https://exponentjs.com/help`);
return;
}

let abiVersion = pkg.exp.abiVersion;
if (abiVersion === 'UNVERSIONED') {
this.emit('stderr', `Warning: Using unversioned ABI. Do not publish until you set abiVersion in package.json`);
let sdkVersion = pkg.exp.sdkVersion;
if (sdkVersion === 'UNVERSIONED') {
this.emit('stderr', `Warning: Using unversioned Exponent SDK. Do not publish until you set sdkVersion in package.json`);
return;
}

let reactNativeTag = reactNative.substring(reactNative.lastIndexOf('#') + 1);

let abiVersions = await Api.callPathAsync('/--/abi-versions');
if (!abiVersions) {
let sdkVersions = await Api.callPathAsync('/--/sdk-versions');
if (!sdkVersions) {
this.emit('stderr', `Error: Couldn't connect to server`);
return;
}

if (!abiVersions[abiVersion]) {
this.emit('stderr', `Error: Invalid abiVersion. Valid options are ${_.keys(abiVersions).join(', ')}`);
if (!sdkVersions[sdkVersion]) {
this.emit('stderr', `Error: Invalid sdkVersion. Valid options are ${_.keys(sdkVersions).join(', ')}`);
return;
}

let abiVersionObject = abiVersions[abiVersion];
if (abiVersionObject['exponent-react-native-tag'] !== reactNativeTag) {
this.emit('stderr', `Error: Invalid version of react-native for abiVersion ${abiVersion}. Use github:exponentjs/react-native#${abiVersionObject['exponent-react-native-tag']}`);
let sdkVersionObject = sdkVersions[sdkVersion];
if (sdkVersionObject['exponent-react-native-tag'] !== reactNativeTag) {
this.emit('stderr', `Error: Invalid version of react-native for sdkVersion ${sdkVersion}. Use github:exponentjs/react-native#${sdkVersionObject['exponent-react-native-tag']}`);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion template/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"private": true,
"main": "main.js",
"exp": {
"abiVersion": "4.0.0"
"sdkVersion": "4.0.0"
},
"dependencies": {
"react-native": "github:exponentjs/react-native#2016-01-02"
Expand Down

0 comments on commit 20bba60

Please sign in to comment.