phonegap / node-phonegap-build

PhoneGap Build node module to login, create, and build apps.
Apache License 2.0
26 stars 25 forks source link

Keep State to Avoid Passing API Object #36

Closed mwbrooks closed 11 years ago

mwbrooks commented 11 years ago

Overview

Currently, the public API requires the user to call login in order to capture the api object. Then the object can be passed into each command.

Problem

The fact is you only need api for phonegap-build-cli.

Also, sometimes you cannot easily expose api globally.

Solution

phonegap-build-cli should keep it's own state. Each command should be able to retrieve the api object.

The user can subscribe to the login event in order to handle the case where a login is required.