entropic-dev / entropic

🦝 :package: a package registry for anything, but mostly javascript 🦝 🦝 🦝
https://discourse.entropic.dev/
Apache License 2.0
5.29k stars 151 forks source link

Catch up cli pt2 #269

Closed olingern closed 5 years ago

olingern commented 5 years ago

Description

Follow up to #234

This PR aims to:

The idea I think the CLI can follow a sort of mvc style of structure, core being the model and the commands directory being the controller. We don't have a view at the moment, and it's not necessary to; however, it would be nice to have the option to explore #226 -- this would make that transition very easy.

Currently I'm testing and pushing packages against registry.entropic.dev because that version appears to be pre-#134, which is great. After the refactoring is done, I'll just switch over to my local docker instance and find the breakage and update api.js accordingly.

How to test

coming soon

olingern commented 5 years ago

So, this PR is coming along pretty well. Isolating publish was / is tricky because of its intermediary messages, but I solved passing this between the command and core with a "message broker" / EventEmitter.

What do you think of the current direction @chrisdickinson? My idea is that entropic's core could be wrapped up into a programmatic lib for people to use if they like ( in the distant future ), so I thought pulling things apart was worthwhile. This will also make #226 very straightforward.