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

[xdl] Delete Api module #3360

Merged
merged 1 commit into from
Apr 7, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion packages/expo-cli/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,6 @@
"cli-table3": "^0.6.0",
"command-exists": "^1.2.8",
"commander": "2.17.1",
"concat-stream": "1.6.2",
"dateformat": "3.0.3",
"env-editor": "^0.4.1",
"envinfo": "7.5.0",
Expand Down
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 @@ -10,9 +10,9 @@ import semver from 'semver';

import {
Analytics,
Api,
BundleIdentifier,
delayAsync,
downloadAppAsync,
learnMore,
Logger,
NotificationCode,
Expand Down Expand Up @@ -424,7 +424,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