gcal-cli
gcal-cli copied to clipboard
Refactore index.js to be able to be required programmatically
What?
This MR contains largely a smooth refactoring to use gcal-cli also in a programmatically way.
How?
- add the bin entry point
bin.js
- move google apis method to
api.js
- expose client, api and core method from
index.js
- add
Do directives
doc for the first authorization installation - settle bulk promises instead of call them with
Promise.all
Thanks for the PR! It's a huge refactor so let me take a close look at it :) I think it's big enough to be released as an upgraded major version.
Btw what do you mean by dynamic way
? Exposing the methods to be able to be required programmatically?
I edited also the description and the MR title to be explicit about the programmatically way.
The next step will be to upgrade dependencies and move googleapis
from v21
to v33
Regarding all refactoring and new features, we could also open the PR to a dedicated branch.
Regarding all refactoring and new features, we could also open the PR to a dedicated branch.
Since this is quite big I think that's a good idea! We could separate it in several PRs to a dedicated branch, and at the end merge that branch with master in a final PR.
I created a branch called 2.0.0.
This order could be nice, so we can isolate possible bugs:
- Architecture refactor (splitting files and so on, not changing code)
- Code refactor (e.g. changing Promise.all() with pSettle)
- Upgrading dependencies
- New functionality (e.g. enable?)