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

Support Storybook v5 #91

Closed
gabriel-kohen-by opened this issue Jan 17, 2020 · 15 comments
Closed

Support Storybook v5 #91

gabriel-kohen-by opened this issue Jan 17, 2020 · 15 comments

Comments

@gabriel-kohen-by
Copy link

It seems like the latest supported is v4.
Most new updates to storybook are done to v5

@njradford
Copy link

njradford commented Feb 27, 2020

@chrisvxd - Storybook v4 to v5 seemed to be a less severe jump than 3 to 4. Do you have an idea of what aspects of story2sketch would break in an upgrade to 5?

(Awesome project by the way.)

@FarisSum
Copy link

FarisSum commented Mar 3, 2020

Hi @gabriel-kohen-jdas
I was able to export a JSON, even with Storybook 6.0 alpha.

However, when importing into sketch, all I get is a "Stories" layer with nothing inside.

What do you think could be the issue?

@jakub-bujakowski
Copy link

Any progress with this issue? I'm using Storybook 5 and can generate the json file, but Sketch throws and error that layers couldn't be imported :/

@jrwpatterson
Copy link

jrwpatterson commented Apr 28, 2020

Are there any updates to this, I would hate to have to download storybook for this software?

@jrwpatterson
Copy link

Partly because I can't even find the documentation for v4.x.x

@jrwpatterson
Copy link

@jakub-bujakowski did you find an issue as I have the same problem

@FarisSum
Copy link

@jrwpatterson @jakub-bujakowski @njradford @gabriel-kohen-jdas

The below works for me in 6.0 alpha actually:

  1. npm run build-storybook
  2. npm run story2sketch (looks to the index.html INPUT that's generated in step 1) **
  3. The OUTPUT is a JSON file **

** story2sketch.config.js is required, where the INPUT and OUTPUT directories are specified.

Make sure the above commands work in your package.json scripts:
Script 1: https://storybook.js.org/docs/basics/exporting-storybook/
Script 2: "story2sketch": "story2sketch "

@merryt
Copy link

merryt commented Apr 30, 2020

@FarisSum Would you mind sharing your story2sketch.config.js?

I was able to duplicate @FarisSum solution with the following config in 6.0.0-beta.0 but you do need to build storybook first, then run against the built version

module.exports = { output: "dist/great-ui.asketch.json", stories: "all", input: "storybook-static/iframe.html" };

Although this does "work" I then get the errors from #59 ... could be related, could be just me

@FarisSum
Copy link

FarisSum commented May 1, 2020

@merryt

Instead of using stories: "all", try utilizing the layoutBy + specify the individual stories in story2sketch.config.js:

...
layoutBy: 'group',
stories: [
    {
      group: 'Buttons',
      stories: [
        {
          name: 'Large Button',
        }
        {
          name: 'Small Button',
        }
      ]
    }
]
...

You can also try groupBy, which will create multiple JSON files.

Perhaps you will find if any particular story it the root cause of the layer errors.

Curious what you get...

@jrwpatterson
Copy link

@merryt yup thats my issue the #59

@merryt
Copy link

merryt commented May 1, 2020

I was able to get it to work by rolling sketch back to v63.1 , YMMV, but my issue was caused by html-sketchapp/html-sketchapp#191 not #59

@Ellzer
Copy link

Ellzer commented Jun 17, 2020

Any update on this ?

@itsderek23
Copy link
Contributor

I was able to get this running with Sketch v69.2 and Storybook v6 by using the updated asketch2sketch plugin that is available in html-sketchapp v4.4.1. Without this update, no layers could be imported. For background on this fix, see html-sketchapp/html-sketchapp#196.

My commands:

yarn run build-storybook
yarn run story2sketch --input storybook-static/iframe.html --output stories.asketch.json

I did get a remainingTimeoutError: Navigation Timeout Exceeded: 30000ms exceeded error with the following, but I didn't debug futher (maybe it goes away if I increase the timeout) and decided to just use the built version:

yarn run story2sketch --url http://localhost:6006/iframe.html --output stories.asketch.json

Screenshot:

image

@chrisvxd
Copy link
Owner

Closed by #103, thanks again @itsderek23!

@chrisvxd
Copy link
Owner

Landed officially in v1.7.1

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

No branches or pull requests

9 participants