c8r / kit

Tools for developing, documenting, and testing React component libraries
https://compositor.io/kit
MIT License
1.21k stars 30 forks source link

RFC CLI architecture #125

Open jxnblk opened 6 years ago

jxnblk commented 6 years ago

With the Kit CLI, I think there are two predominant modes for usage: commands that are configured once (via flags or a package.json field) and commands that require different options on each run (via prompts).

The first mode should do what the user wants quickly and without any input required. The following commands would fall under this category:

The second mode requires some user input that varies on each run. The init command would fall under this category.


Package Architecture

I'd propose splitting up packages and dependencies in the following way:

A rough outline of dependencies:

cli/
  node_modules/
    meow/
    kit-dev/
    kit-build/
    kit-publish/
    kit-init/
  cli.js
dev/
  node_modules/
    webpack/
  index.js
init/
  node_modules/
    ink/
  App.js

I would also be okay with all the CLI subpackages being included in the main CLI package if that's easier to manage.

johno commented 6 years ago

Was doing some pondering on this as well, definitely agree. We only need to pull in Ink for the prompt portions, so this sounds 💯 to me.