From 47feace3bd77a98f356212148247972537f0abc0 Mon Sep 17 00:00:00 2001 From: Ville Immonen Date: Tue, 17 Sep 2019 15:37:48 +0300 Subject: [PATCH] fix(expo-cli): work around TypeScript compilation error See https://github.com/tj/commander.js/issues/1037 --- packages/expo-cli/src/commands/android.ts | 4 ++-- packages/expo-cli/src/commands/bundle-assets.ts | 4 ++-- packages/expo-cli/src/commands/customize.ts | 4 ++-- packages/expo-cli/src/commands/doctor.ts | 4 ++-- packages/expo-cli/src/commands/init.ts | 4 ++-- packages/expo-cli/src/commands/ios.ts | 4 ++-- packages/expo-cli/src/commands/login.ts | 4 ++-- packages/expo-cli/src/commands/logout.ts | 4 ++-- packages/expo-cli/src/commands/optimize.ts | 4 ++-- packages/expo-cli/src/commands/push-creds.ts | 4 ++-- packages/expo-cli/src/commands/register.ts | 4 ++-- packages/expo-cli/src/commands/send.ts | 4 ++-- packages/expo-cli/src/commands/url.ts | 4 ++-- packages/expo-cli/src/commands/webhooks.ts | 4 ++-- packages/expo-cli/src/commands/whoami.ts | 4 ++-- 15 files changed, 30 insertions(+), 30 deletions(-) diff --git a/packages/expo-cli/src/commands/android.ts b/packages/expo-cli/src/commands/android.ts index b3fc3f5422..c546bd6db6 100644 --- a/packages/expo-cli/src/commands/android.ts +++ b/packages/expo-cli/src/commands/android.ts @@ -5,10 +5,10 @@ async function action(projectDir: string) { await Android.openProjectAsync(projectDir); } -export default (program: Command) => { +export default function(program: Command) { program .command('android [project-dir]') .description('Opens your app in Expo on a connected Android device') .allowOffline() .asyncActionProjectDir(action); -}; +} diff --git a/packages/expo-cli/src/commands/bundle-assets.ts b/packages/expo-cli/src/commands/bundle-assets.ts index 4f5c600d5a..5f04ec7a87 100644 --- a/packages/expo-cli/src/commands/bundle-assets.ts +++ b/packages/expo-cli/src/commands/bundle-assets.ts @@ -10,7 +10,7 @@ async function action(projectDir: string, options: Options) { await Detach.bundleAssetsAsync(projectDir, options); } -export default (program: Command) => { +export default function(program: Command) { program .command('bundle-assets [project-dir]') .option('--dest [dest]', 'Destination directory for assets') @@ -19,4 +19,4 @@ export default (program: Command) => { 'Bundles assets for a detached app. This command should be executed from xcode or gradle.' ) .asyncActionProjectDir(action, true); -}; +} diff --git a/packages/expo-cli/src/commands/customize.ts b/packages/expo-cli/src/commands/customize.ts index f522020c47..bd52febdbb 100644 --- a/packages/expo-cli/src/commands/customize.ts +++ b/packages/expo-cli/src/commands/customize.ts @@ -126,11 +126,11 @@ export async function action(projectDir: string = './', options: Options = { for await generateFilesAsync({ projectDir, staticPath, options, answer, templateFolder }); } -export default (program: Command) => { +export default function(program: Command) { program .command('customize:web [project-dir]') .description('Generate static web files into your project.') .option('-f, --force', 'Allows replacing existing files') .allowOffline() .asyncAction(action); -}; +} diff --git a/packages/expo-cli/src/commands/doctor.ts b/packages/expo-cli/src/commands/doctor.ts index 35ebe18bf6..9e1b05691a 100644 --- a/packages/expo-cli/src/commands/doctor.ts +++ b/packages/expo-cli/src/commands/doctor.ts @@ -10,9 +10,9 @@ async function action(projectDir: string) { process.exit(); } -export default (program: Command) => { +export default function(program: Command) { program .command('doctor [project-dir]') .description('Diagnoses issues with your Expo project.') .asyncActionProjectDir(action, /* skipProjectValidation: */ true); -}; +} diff --git a/packages/expo-cli/src/commands/init.ts b/packages/expo-cli/src/commands/init.ts index 9a5f35485b..86972046a7 100644 --- a/packages/expo-cli/src/commands/init.ts +++ b/packages/expo-cli/src/commands/init.ts @@ -395,7 +395,7 @@ async function promptForManagedConfig( return { expo: values }; } -export default (program: Command) => { +export default function(program: Command) { program .command('init [project-dir]') .alias('i') @@ -413,4 +413,4 @@ export default (program: Command) => { .option('--android-package [name]', 'The package name for your Android app.') .option('--ios-bundle-identifier [name]', 'The bundle identifier for your iOS app.') .asyncAction(action); -}; +} diff --git a/packages/expo-cli/src/commands/ios.ts b/packages/expo-cli/src/commands/ios.ts index ac35e14f6e..8768017fc5 100644 --- a/packages/expo-cli/src/commands/ios.ts +++ b/packages/expo-cli/src/commands/ios.ts @@ -5,10 +5,10 @@ async function action(projectDir: string) { await Simulator.openProjectAsync(projectDir); } -export default (program: Command) => { +export default function(program: Command) { program .command('ios [project-dir]') .description('Opens your app in Expo in an iOS simulator on your computer') .allowOffline() .asyncActionProjectDir(action); -}; +} diff --git a/packages/expo-cli/src/commands/login.ts b/packages/expo-cli/src/commands/login.ts index eac64dbf49..eec5c22177 100644 --- a/packages/expo-cli/src/commands/login.ts +++ b/packages/expo-cli/src/commands/login.ts @@ -2,7 +2,7 @@ import { Command } from 'commander'; import { login } from '../accounts'; -export default (program: Command) => { +export default function(program: Command) { program .command('login') .alias('signin') @@ -10,4 +10,4 @@ export default (program: Command) => { .option('-u, --username [string]', 'Username') .option('-p, --password [string]', 'Password') .asyncAction(login); -}; +} diff --git a/packages/expo-cli/src/commands/logout.ts b/packages/expo-cli/src/commands/logout.ts index f81f3aa87b..4ea6d2b31c 100644 --- a/packages/expo-cli/src/commands/logout.ts +++ b/packages/expo-cli/src/commands/logout.ts @@ -12,9 +12,9 @@ async function action() { } } -export default (program: Command) => { +export default function(program: Command) { program .command('logout') .description('Logout from your Expo account') .asyncAction(action); -}; +} diff --git a/packages/expo-cli/src/commands/optimize.ts b/packages/expo-cli/src/commands/optimize.ts index 2a881067bb..69c87877dd 100644 --- a/packages/expo-cli/src/commands/optimize.ts +++ b/packages/expo-cli/src/commands/optimize.ts @@ -44,7 +44,7 @@ function parseQuality(options: Options): number { return quality; } -export default (program: Command) => { +export default function(program: Command) { program .command('optimize [project-dir]') .alias('o') @@ -64,4 +64,4 @@ export default (program: Command) => { ) .allowOffline() .asyncAction(action); -}; +} diff --git a/packages/expo-cli/src/commands/push-creds.ts b/packages/expo-cli/src/commands/push-creds.ts index a0194102f3..98d60c572a 100644 --- a/packages/expo-cli/src/commands/push-creds.ts +++ b/packages/expo-cli/src/commands/push-creds.ts @@ -12,7 +12,7 @@ type VapidData = { vapidPvtkey?: string; }; -export default (program: Command) => { +export default function(program: Command) { program .command('push:android:upload [project-dir]') .description('Uploads a Firebase Cloud Messaging key for Android push notifications.') @@ -161,7 +161,7 @@ export default (program: Command) => { await apiClient.deleteAsync(`credentials/push/web/${remotePackageName}`); }, true); -}; +} async function _uploadWebPushCredientials(projectDir: string, options: VapidData) { const isGeneration = !(options.vapidPubkey && options.vapidPvtkey); diff --git a/packages/expo-cli/src/commands/register.ts b/packages/expo-cli/src/commands/register.ts index ced2036f9c..62e5a5acf0 100644 --- a/packages/expo-cli/src/commands/register.ts +++ b/packages/expo-cli/src/commands/register.ts @@ -2,9 +2,9 @@ import { Command } from 'commander'; import { register } from '../accounts'; -export default (program: Command) => { +export default function(program: Command) { program .command('register') .description('Sign up for a new Expo account') .asyncAction(() => register()); -}; +} diff --git a/packages/expo-cli/src/commands/send.ts b/packages/expo-cli/src/commands/send.ts index 995259601d..8ebe51c186 100644 --- a/packages/expo-cli/src/commands/send.ts +++ b/packages/expo-cli/src/commands/send.ts @@ -44,7 +44,7 @@ async function action(projectDir: string, options: { sendTo?: string }) { process.exit(); } -export default (program: Command) => { +export default function(program: Command) { program .command('send [project-dir]') .description('Sends a link to your project to an email address') @@ -52,4 +52,4 @@ export default (program: Command) => { .option('-s, --send-to [dest]', 'Specifies the email address to send this URL to') .urlOpts() .asyncActionProjectDir(action); -}; +} diff --git a/packages/expo-cli/src/commands/url.ts b/packages/expo-cli/src/commands/url.ts index 15e5ec6c49..ccd09f5fbb 100644 --- a/packages/expo-cli/src/commands/url.ts +++ b/packages/expo-cli/src/commands/url.ts @@ -79,7 +79,7 @@ async function action(projectDir: string, options: ProjectUrlOptions) { } } -export default (program: Command) => { +export default function(program: Command) { program .command('url [project-dir]') .alias('u') @@ -102,4 +102,4 @@ export default (program: Command) => { 'Displays the standalone Android binary URL you can use to download your app binary' ) .asyncActionProjectDir(logArtifactUrl('android'), true); -}; +} diff --git a/packages/expo-cli/src/commands/webhooks.ts b/packages/expo-cli/src/commands/webhooks.ts index 82bddfe325..14cdbac231 100644 --- a/packages/expo-cli/src/commands/webhooks.ts +++ b/packages/expo-cli/src/commands/webhooks.ts @@ -10,7 +10,7 @@ type Options = { url?: string; secret?: string; event?: string }; const WEBHOOK_TYPES = ['build']; -export default (program: Command) => { +export default function(program: Command) { program .command('webhooks:set [project-dir]') .option('--url ', 'Webhook to be called after building the app.') @@ -87,7 +87,7 @@ export default (program: Command) => { } log('All done!'); }, true); -}; +} async function _sanitizeOptions(options: Options): Promise { let { url, secret, event: _event = 'build' } = options; diff --git a/packages/expo-cli/src/commands/whoami.ts b/packages/expo-cli/src/commands/whoami.ts index 3ce7abade0..36861c3b77 100644 --- a/packages/expo-cli/src/commands/whoami.ts +++ b/packages/expo-cli/src/commands/whoami.ts @@ -15,10 +15,10 @@ async function action() { } } -export default (program: Command) => { +export default function(program: Command) { program .command('whoami') .alias('w') .description('Checks with the server and then says who you are logged in as') .asyncAction(action); -}; +}