mantra-cli icon indicating copy to clipboard operation
mantra-cli copied to clipboard

Team up with mantra-atom-package

Open macrozone opened this issue 8 years ago • 6 comments

The mantra-atom-package is very convenient and also generates stubs for components, tests, stories, etc.

But it does not generate the same code as mantra-cli. Also teams that have atom- and non-atom-users would love to have the exact same code-generators and may even share configs.

So it would make sense that the atom-package and mantra-cli use the same templates or even use the same shared code.

See also https://github.com/mantrajs/mantrajs-atom-package/issues/28

what do you think?

Edit: sorry, missed that one: https://github.com/mantrajs/mantra-cli/issues/20 that was closed. I hope you do not mind if I bring the topic back 👍

macrozone avatar Jun 08 '16 13:06 macrozone

I've been working on config branch here. Once released, this branch will allow users to customize templates. See this comment.

We can make the default templates the same for both CLI and Atom package. We can even share configuration. What do you think @tomitrescak?

sungwoncho avatar Jun 08 '16 23:06 sungwoncho

@sungwoncho I got all the configurations working for multiple languages. It's based on yaml files. You can basically omit the part with "pane" configuration and the rest will work straight out of the box.

tomitrescak avatar Jun 08 '16 23:06 tomitrescak

I think using mantra-cli in atom-package would be the best solution.

We may need to generate more entities with different options in the future, and it makes little sense to maintain two code-bases that do almost the same.

Code-generators and scaffolding will be key-element for the success of mantra and i think it needs much more attention

macrozone avatar Jun 27 '16 13:06 macrozone

@macrozone I think that is one way to solve a problem. But @tomitrescak has been working on atom-package and I am not sure how he feels about such a drastic change. Alternatively there could be an overarching 'mantra-generator' that both CLI, and atom-package can make use of. But that might overly complicate things.

We also have to unify the customization option. In 0.4.0, we will have mantra_cli.yaml, but in the long run, there should be mantra.yaml shared by both CLI and atom-package (see this post).

I agree that the problem of code generating deserves more attention. Short term plan between 0.4.0 and 0.5.0 will be to unify the configuration as much as we can.

sungwoncho avatar Jun 28 '16 11:06 sungwoncho

Guys, I'm absolutely fine with using CLI as the base generator, my problem currently is that for about a month I'm out on conference trips and won't have much time to take care of it. If there is anyone that can produce a PR would be great, otherwise the ETA from my part would be sometime in August.

Yet, since CLI is a node package, it should be pretty straightforward to implement this, using CLI as an NPM reference.

Atom package is currently quite well documented concerning the way configuration renders Atom Panes, and the main functionality for content generation from templates resider in DirectoryHandler.coffee

As @sungwoncho says, the best way would be to have unified config that Atom uses to render panes and both CLI and Atom use to generate files from templates.

@sungwoncho, I think we can reuse your stuff + the initial pane configuration from my part.

What need to be assured is the config versatility. Most my projects are now Apollo + Redux + Mantra that use significantly different templates and also a bit different testing approach.

tomitrescak avatar Jun 28 '16 17:06 tomitrescak

@sungwoncho sounds like a good roadmap to start with unifying customization.

@tomitrescak no hurry 👍 I think unifying the configuration and templates is a good next step. I'll try to help with it. And thanks for your work so far, the atom package is damn cool

Edit: the configs of the the atom-plugin look pretty powerful already, we might consider use that also in mantra-cli

macrozone avatar Jun 28 '16 22:06 macrozone