skellock / typescript-with-electron-react-kit

Don't just start your Electron app... TWERKit.
https://skellock.github.io/typescript-with-electron-react-kit
MIT License
145 stars 23 forks source link

Add storybook support #56

Closed skellock closed 7 years ago

skellock commented 7 years ago

Give it a quick shot, and run it by @rmevans9. He's knows his shit.

rmevans9 commented 7 years ago

I can actually take this one on likely today. The only thing I need to work out is exactly what visual components are in this starter project. It doesn't look like much. Or are you just hoping to have it setup so that way anything built upon this starter just has storybook for free?

skellock commented 7 years ago

Ya, just a pattern. We can story book up <Text /> and <FunDog /> for now.

Also you don't have to do it! haha. Just wanted to run it by you to see if I was wearing my pants on my head again.

rmevans9 commented 7 years ago

I have this mostly done already actually... just running into some TypeScript woes. It is mostly complaining about the fact that there are not definitions for the following:

and then a few other things like not being able to load jpg and svg files which I can resolve them easily. Did you do anything special with your TypeScript setup to avoid it yelling about the missing types?

skellock commented 7 years ago

It depends on the tsconfig.json you're using. I had to make a special one for testing because of ava wanting plain-old js. Perhaps we could do something similar for storyboard as well?

Does storyboard require babel do you know?

skellock commented 7 years ago

(btw: those typings are in ./typings).. it's like storyboard isn't picking those up.

rmevans9 commented 7 years ago

storybook uses webpack so I am using a ts-loader to compile everything. It is picking up the regular tsconfig.json. We can redirect it to another tsconfig if needed but would like to try and avoid if at all possible.

I don't see a ./typings folder in the repo?

skellock commented 7 years ago

OMFG...!

One sec. hahahaha... 😊

skellock commented 7 years ago

OK, pull master. And speak nothing of what you saw today.

skellock commented 7 years ago

They were in my global .gitignore file in my $HOME. Hahaha... yeesh... what a trap that was!

rmevans9 commented 7 years ago

With the newly found typings folder almost all issues are resolved to get this thing compiling. The only remaining one is this:

{...}electron-starter/node_modules/bluebird-lst/index"' has no default export which is thrown from here: electron-starter/node_modules/electron-updater/out/electron-updater.d.ts

rmevans9 commented 7 years ago

This can easily be resolved by setting allowSyntheticDefaultImports to true in tsconfig.json. How much would you hate if I did so?

skellock commented 7 years ago

I'd prefer stay in TypeScript hardmode.

I wonder why that error is appearing. Are we providing the bluebird promise to Storybook?

If so we should leave that out. If they expect a Promise injection though, we could give them Promise instead.

Another option would be to make a new ./typings/bluebird-list.d.ts typing to stub out just enough to shut the compiler up. haha.

Or does npm i -D @types/bluebird get it?

rmevans9 commented 7 years ago

I will see if I can get this working with leaving that false but it is worth it to note even the tests when trying to push failed for me.

skellock commented 7 years ago

Really? Ok, hmm... that sucks... Ok, that's fine. I'll get CI up & running so we don't have anymore of these "Works on Steve's Machine" issues.

rmevans9 commented 7 years ago

Even installing @types/bluebird has the error occurring. Probably need to investigate it a little bit more to figure out what is going on there.