mongodb-js / mj

#wip mongodb-js tooling
https://github.com/mongodb-js/mj
Apache License 2.0
0 stars 2 forks source link

`mj create <template> <destination>` #4

Open imlucas opened 9 years ago

imlucas commented 9 years ago
mj create should do all of the following:
imlucas commented 9 years ago

Should you have to pick a buddy to be your co-maintainer when creating a new module or is that just getting in the way?

imlucas commented 9 years ago

Existing khaos templates:

rueckstiess commented 9 years ago

List of potential templates we would want:

empty: an empty directory structure with the bare minimum to qualify as mongodb-js cli: command-line interface app with docopt, like "mj". view: an ampersand view module, e.g. a subview for a larger app (object-tree, minicharts, ...) spa: single-page application, running entirely in a browser (wtstats, kaleido, ...) full: full client/server app (e.g. scout, dashboards, ...) shell: a mongo shell plugin with automatic registration util: a utility function, template or code snippet (mixins, etc), how is that different to empty though? doc: a non-code document, spec or documentation

Dependency graph looks like this:

The templates should build on top of each other, not duplicate features. I.e. if you want a "spa" app, mj will clone the "empty" template first, then on top the "view" template and finally the "spa" template. Templates can obviously overwrite existing files if necessary.

rueckstiess commented 9 years ago

As per discussion on #2, consolidating the two tickets here and closing #2.

rueckstiess commented 9 years ago

@imlucas, should mj create ... set up all the remote stuff already? Wonder if it's better to have a separate command mj ingest / mj submit or something. I often want to just play around with something and not trigger all these remote processes. I may not actually want to commit it in the end. Contributors might feel intimidated if simply cloning a template executes all these steps.

First time workflow could be:

mj create spa ./myOwnSpa
// work work work
git commit -a
mj submit     // this step sets up github repo, remote branch, travis etc. and does a git push

From then on, simply (as usual):

// work work work
git commit -a
git push

Thoughts?

rueckstiess commented 9 years ago

With a switch on create for powerusers to do it all in one step...

mj create --submit spa ./myOwnSpa
rueckstiess commented 9 years ago

Progress on branch 4-templates.

templates are under ./templates/{{name}}. First template empty added from https://github.com/mongodb-js/khaos-node. Slight modifications and fixes added.

Run mj create empty ./somedir to create the project.

TODO General
TODO Templates
imlucas commented 9 years ago

@rueckstiess it should just set everything up automatically or else it will never happen. it's all just important plumbing.

rueckstiess commented 9 years ago

Further discussion on #16 and in Flowdock: We're splitting into create and submit and see how that goes. Can add switch mj create --submit that does both in one step, similar to git commit -a stages and commits in one step for convenience, a.k.a "I know what I'm doing".

imlucas commented 9 years ago

@rueckstiess :heart: