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

Commit

Permalink
fix(expo-cli): work around TypeScript compilation error
Browse files Browse the repository at this point in the history
  • Loading branch information
fson committed Sep 17, 2019
1 parent 5afe35e commit 47feace
Show file tree
Hide file tree
Showing 15 changed files with 30 additions and 30 deletions.
4 changes: 2 additions & 2 deletions packages/expo-cli/src/commands/android.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
}
4 changes: 2 additions & 2 deletions packages/expo-cli/src/commands/bundle-assets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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);
};
}
4 changes: 2 additions & 2 deletions packages/expo-cli/src/commands/customize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
}
4 changes: 2 additions & 2 deletions packages/expo-cli/src/commands/doctor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
}
4 changes: 2 additions & 2 deletions packages/expo-cli/src/commands/init.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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);
};
}
4 changes: 2 additions & 2 deletions packages/expo-cli/src/commands/ios.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
}
4 changes: 2 additions & 2 deletions packages/expo-cli/src/commands/login.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@ import { Command } from 'commander';

import { login } from '../accounts';

export default (program: Command) => {
export default function(program: Command) {
program
.command('login')
.alias('signin')
.description('Login with your Expo account')
.option('-u, --username [string]', 'Username')
.option('-p, --password [string]', 'Password')
.asyncAction(login);
};
}
4 changes: 2 additions & 2 deletions packages/expo-cli/src/commands/logout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
}
4 changes: 2 additions & 2 deletions packages/expo-cli/src/commands/optimize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -64,4 +64,4 @@ export default (program: Command) => {
)
.allowOffline()
.asyncAction(action);
};
}
4 changes: 2 additions & 2 deletions packages/expo-cli/src/commands/push-creds.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.')
Expand Down Expand Up @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions packages/expo-cli/src/commands/register.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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());
};
}
4 changes: 2 additions & 2 deletions packages/expo-cli/src/commands/send.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,12 +44,12 @@ 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')
//.help('You must have the server running for this command to work')
.option('-s, --send-to [dest]', 'Specifies the email address to send this URL to')
.urlOpts()
.asyncActionProjectDir(action);
};
}
4 changes: 2 additions & 2 deletions packages/expo-cli/src/commands/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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')
Expand All @@ -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);
};
}
4 changes: 2 additions & 2 deletions packages/expo-cli/src/commands/webhooks.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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-url>', 'Webhook to be called after building the app.')
Expand Down Expand Up @@ -87,7 +87,7 @@ export default (program: Command) => {
}
log('All done!');
}, true);
};
}

async function _sanitizeOptions(options: Options): Promise<Webhooks.WebhookData> {
let { url, secret, event: _event = 'build' } = options;
Expand Down
4 changes: 2 additions & 2 deletions packages/expo-cli/src/commands/whoami.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);
};
}

0 comments on commit 47feace

Please sign in to comment.