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

Commit

Permalink
delete Api module (#3360)
Browse files Browse the repository at this point in the history
  • Loading branch information
EvanBacon committed Apr 7, 2021
1 parent 7828450 commit 0b76c5d
Show file tree
Hide file tree
Showing 8 changed files with 97 additions and 278 deletions.
2 changes: 0 additions & 2 deletions packages/expo-cli/src/exp.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@ import url from 'url';
import wrapAnsi from 'wrap-ansi';
import {
Analytics,
Api,
ApiV2,
Binaries,
Config,
Expand Down Expand Up @@ -46,7 +45,6 @@ import { ora } from './utils/ora';
// directory
const packageJSON = require('../package.json');

Api.setClientName(packageJSON.version);
ApiV2.setClientName(packageJSON.version);

// The following prototyped functions are not used here, but within in each file found in `./commands`
Expand Down
263 changes: 0 additions & 263 deletions packages/xdl/src/Api.ts

This file was deleted.

4 changes: 2 additions & 2 deletions packages/xdl/src/ApiV2.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import QueryString from 'querystring';

import { Config, ConnectionStatus } from './internal';

export const MAX_CONTENT_LENGTH = 100 /* MB */ * 1024 * 1024;
export const MAX_BODY_LENGTH = 100 /* MB */ * 1024 * 1024;
const MAX_CONTENT_LENGTH = 100 /* MB */ * 1024 * 1024;
const MAX_BODY_LENGTH = 100 /* MB */ * 1024 * 1024;

// These aren't constants because some commands switch between staging and prod
function _rootBaseUrl() {
Expand Down
4 changes: 2 additions & 2 deletions packages/xdl/src/Simulator.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,9 @@ import semver from 'semver';

import {
Analytics,
Api,
BundleIdentifier,
delayAsync,
downloadAppAsync,
learnMore,
Logger,
NotificationCode,
Expand Down Expand Up @@ -434,7 +434,7 @@ export async function _downloadSimulatorAppAsync(

fs.mkdirpSync(dir);
try {
await Api.downloadAsync(url, dir, { extract: true }, downloadProgressCallback);
await downloadAppAsync(url, dir, { extract: true }, downloadProgressCallback);
} catch (e) {
fs.removeSync(dir);
throw e;
Expand Down
1 change: 0 additions & 1 deletion packages/xdl/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ if (process.env.NODE_ENV !== 'production' && process.env.NODE_ENV !== 'test') {
export {
Analytics,
Android,
Api,
ApiV2,
Binaries,
Config,
Expand Down
8 changes: 2 additions & 6 deletions packages/xdl/src/internal.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,7 @@ export { default as NotificationCode } from './NotificationCode';
export { learnMore } from './logs/TerminalLink';
export { default as Analytics } from './Analytics';
export * as Android from './Android';
export { default as Api } from './Api';
export {
default as ApiV2,
MAX_BODY_LENGTH as API_V2_MAX_BODY_LENGTH,
MAX_CONTENT_LENGTH as API_V2_MAX_CONTENT_LENGTH,
} from './ApiV2';
export { default as ApiV2 } from './ApiV2';
export * as Binaries from './Binaries';
export * as EmbeddedAssets from './EmbeddedAssets';
export { ErrorCode } from './ErrorCode';
Expand Down Expand Up @@ -83,6 +78,7 @@ export * as ExpSchema from './project/ExpSchema';
export { delayAsync } from './utils/delayAsync';
export { choosePortAsync } from './utils/choosePortAsync';
export { downloadApkAsync } from './utils/downloadApkAsync';
export { downloadAppAsync } from './utils/downloadAppAsync';
export * as BundleIdentifier from './BundleIdentifier';
export * as FsCache from './tools/FsCache';
export * as WebpackEnvironment from './webpack-utils/WebpackEnvironment';
Expand Down
4 changes: 2 additions & 2 deletions packages/xdl/src/utils/downloadApkAsync.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import fs from 'fs-extra';
import path from 'path';

import { Api, UserSettings, Versions } from '../internal';
import { downloadAppAsync, UserSettings, Versions } from '../internal';

function _apkCacheDirectory() {
const dotExpoHomeDirectory = UserSettings.dotExpoHomeDirectory();
Expand All @@ -26,6 +26,6 @@ export async function downloadApkAsync(
return apkPath;
}

await Api.downloadAsync(url, apkPath, undefined, downloadProgressCallback);
await downloadAppAsync(url, apkPath, undefined, downloadProgressCallback);
return apkPath;
}
Loading

0 comments on commit 0b76c5d

Please sign in to comment.