chrisvxd / story2sketch

Convert Storybook into Sketch symbols 💎
Other
402 stars 32 forks source link

sort stories by kind #64

Closed hipstersmoothie closed 5 years ago

hipstersmoothie commented 5 years ago

Trying to address my comments in #63. I plan to add the byKind option to write the different kinds to different files.

So far my changes have changed what the output looks like for the default mode (single sketch file). Insteaad of all the stories going down vertically, the stories are now going horizontally by kind. I find this a way easier way to consume the output of story2sketch, as I can parse what I'm looking at easier

Here is what it currently looks like. Each column is a different kind (ex: Button, Choice) and the rows in the column are the individual stories.

@chrisvxd what do you think?

Screen Shot 2019-03-30 at 4 15 37 PM

EDIT: separate files are now implemented.

Screen Shot 2019-03-30 at 4 55 21 PM

hipstersmoothie commented 5 years ago

@chrisvxd I have added both outputByKind and layoutByKind.

layoutByKind is a boolean that works exactly like your code above, I just had to add some code to account for the x position.

outputByKind I changed to be a path instead of a boolean. The way it is now when a user provides outputByKind: out/directory, story2sketch will create the individual files while still outputting a file with them all.

hipstersmoothie commented 5 years ago

I think I’m gonna release a storybook plugin built in this pr. With this code I can add a toolbar icon to download the sketch files for the current displayed story kind 🤯

chrisvxd commented 5 years ago

@hipstersmoothie you mean a fully blown story2sketch plugin? Awesome. That's been something I've thought about in the past.

Re: this PR - Haven't had a chance to look again (busy week) but will try to get around to it today. Would also appreciate your input to my comment in the original issue #63.

hipstersmoothie commented 5 years ago

Yeah I'm thinking the tool could do a few things. For now it will just download the generated sketch file for the kind.

It might be possible to run story2sketch on the current story rendering to produce a sketch file for whats on screen. I don't think that's possible now though

hipstersmoothie commented 5 years ago

@chrisvxd :neckbeard:

chrisvxd commented 5 years ago

@hipstersmoothie waiting on outcome of #63 before reviewing :)

chrisvxd commented 5 years ago

Awaiting on API to be updated to match discussions in #63 before reviewing

hipstersmoothie commented 5 years ago

@chrisvxd changed to match suggested API!

chrisvxd commented 5 years ago

Thanks for the changes again @hipstersmoothie. Will review as soon as I can. Hopefully before I go away on Friday.

mick-feller commented 5 years ago

Really hoping we can get this soon, i have a storybook with 168 stories and my json file is 25mb large. Sketch doesn't really like that.

Keep up the good work!

chrisvxd commented 5 years ago

@mick-feller Yup shouldn't be long now. In the mean time, you could fork this branch and use that.

chrisvxd commented 5 years ago

@hipstersmoothie going to address my most recent comments to get this in

chrisvxd commented 5 years ago

Merged via #65! (PR comments addressed)

chrisvxd commented 5 years ago

Released in v1.5.0