Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tower CLI #416

Open
thehydroimpulse opened this issue Apr 24, 2014 · 4 comments
Open

Tower CLI #416

thehydroimpulse opened this issue Apr 24, 2014 · 4 comments

Comments

@thehydroimpulse
Copy link
Member

Having a Tower CLI in the main repo would be pretty slick. The CLI would simply be a wrapper around component(1) and provide some utilities, such as scaffolding new components/projects, running a server during development, live-reloading, file watching, component builder.

Many people will want to use preprocessors such as Sass, Less, CoffeeScript, etc... so potentially having the ability to easily provide plugins for an entire project would be best.

@thehydroimpulse thehydroimpulse added this to the 0.6.0 milestone Apr 24, 2014
@thehydroimpulse
Copy link
Member Author

This would also alleviate a lot of the burden in setting up a new component. We could just a simple command: tower g component foo and all the required stuff will be generated. Moreover, we can easily wrap testing and everything behind a single, integrated cli. For example, testing against phantom: tower test phantom.

Again, many of these commands can be deferred to more specialized tools like component-test.

@lancejpollard
Copy link
Member

Yeah that's good, pretty much how it is now. I like the idea of the cookbooks (but probably a better name). It can be accomplished with peerDependencies in the package.json. The main thing is, we would be delegating for the most part to other smaller orgs/projects under the hood. This would make it really nice as an easy way to get started and to keep the API simple, but if you wanted to get more hardcore/low-level you could just use the raw tools.

@thehydroimpulse
Copy link
Member Author

@lancejpollard Working on the cli stuff under @clijs. It'll be extremely easy to start creating the tower cli to generate components and such.

var cli = require('tower-cli');
var tower = cli('tower');
var generator = require('tower-generator');

tower.command('create {name}', function(name) {
   return generator('./generators/component', process.cwd(), { name: name });
}).then(function(ok) {
    cli.success(ok);
}).catch(function(err) {
    cli.error(err);
});

var gen = tower.command('generate');

gen.command('model {name}', function(name) {
    // Same as the previous generator.
});

gen.command('migration {name}', function(name) {
    // Same as the previous generator.
});

These commands can then be run with:

tower create foo
tower generate model user
tower generate migration create-user

@lancejpollard
Copy link
Member

Boom! That'll be awesome :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants