mantrajs / mantra-cli

Command line interface for building Meteor apps with Mantra
MIT License
135 stars 34 forks source link

Feature/generate stories #80

Closed macrozone closed 8 years ago

macrozone commented 8 years ago

fixes https://github.com/mantrajs/mantra-cli/issues/72

Todo:

macrozone commented 8 years ago

@sungwoncho maybe you can help with add import/require in /.storybook/config.js when a new module is created

We need to generate something like this for every module:

function loadStories() {
  require('../client/modules/core/components/.stories');
  require('../client/modules/comments/components/.stories');
}

But i think that's not so important and I would suggest to release without this. I will work on the other things

sungwoncho commented 8 years ago

@macrozone This seems like a good start. Let's release as a part of 0.4.0. I personally haven't used storybook and won't be able to test this feature extensively. But the code so far looks good to me. Let me know when it's ready to be merged.

macrozone commented 8 years ago

Cool,

We should also discus how to make this optional, if storybook is added by default, etc.

I also think of adding https://github.com/kadirahq/react-storybook-addon-info, but this can be done by modifing the templates.

macrozone commented 8 years ago

ok, works now, however, it is not yet optional.

If we make it optional, it should be an option when creating an app.

Then, on every mantra generate/destroy component we should already know, if this app was created with storybook support. Maybe check if .storybook-folder exists.

sungwoncho commented 8 years ago

Checking .storybook folder sounds doable. Maybe from 0.4.0, we could even store the info in mantra_cli.yaml. i.e. storybook: true.

Personally I wouldn't really mind if CLI generated storybook even though I don't use it. Started https://talk.mantrajs.com/t/should-mantra-cli-generate-storybook-by-default/383. Let's see how people feel.

nadeemja commented 8 years ago

Hi,

Great work guys.

Could you perhaps release an intermediate version with this as-is, and then release one later with optionality?

sungwoncho commented 8 years ago

@macrozone would you like to do your first release? The release process is automated in release.sh. Maybe we can do 0.3.14.rc1 and later release 0.3.14.

Let me know your npm, and I will add you to the project.

macrozone commented 8 years ago

@sungwoncho https://www.npmjs.com/~macrozone

I saw that you have a 0.4 branch. I forked from master. Should i rebase / merge from 0.4?

sungwoncho commented 8 years ago

@macrozone added you to npm.

yeah. you can bump the release candidate version on 0.4.x and do a release.

macrozone commented 8 years ago

ok i did a release and bumped the version.

Everything should included in this PR, including your 0.4 branch. But i do not know whether the release-tag will be transfered.

Can you merge?

sungwoncho commented 8 years ago

@macrozone it seems that git tags do not get merged. Feel free to create a tag again and push to master.

macrozone commented 8 years ago

I'll try!

btw. templates in yaml-configs work well so far. 👍

It's also possible to customize storybook-templates which i used to add the "addWithInfo"-plugin

sungwoncho commented 8 years ago

Regarding yaml-configs: I think there is a known issue with customizing publication template, because we are supporting collection2 and astronomy.

All in all, this is a good start and we can implement the last item (make generating of storybook optional) if the users want it. Thanks for the hard work.