jaredpalmer / tsdx

Zero-config CLI for TypeScript package development
https://tsdx.io
MIT License
11.28k stars 507 forks source link

(feat): exclude co-located stories by default from build #666

Closed kylemh closed 4 years ago

kylemh commented 4 years ago

A brute attempt to resolve the issue I'm encountering in #663

Resolves #663

kylemh commented 4 years ago

Sounds like I should just wait for https://github.com/ezolenko/rollup-plugin-typescript2/issues/211

Thanks for diving deep! Love having you on this project. ❤️

agilgur5 commented 4 years ago

Sounds like I should just wait for ezolenko/rollup-plugin-typescript2#211

I don't think that'll be fixed any time soon, especially not if it requires parsing declarations.

Hence why I'd be fine with this going in, as, for the time-being we have to use include instead of file (even if we changed to the latter, we'd still have older users of the former).

kylemh commented 4 years ago

I see. My guess is a relevant test would be considered e2e? I can do a default build with a Storybook file. Make a uniquely named type, and assert that none of the file contents in dist include the type name?

agilgur5 commented 4 years ago

Yea you'd like create e2e/fixtures/build-default/src/story-test.stories.tsx that's empty other than a comment (see the build-default/test/ for what that would look like) and then use the same style tests as in the e2e/tsdx-build-default.test.ts except you'd have a toBeFalsy() for this file instead of toBeTruthy()