Closed xareelee closed 7 years ago
Or use a new prop matches
to set up the loader for different use cases if necessary.
{
"config": {
"react-native-storybook-loader": {
"matches": [
{
"searchDir": "./src",
"pattern": "**/*.stories.js",
"outputFile": "./storybook/storyLoaderForSrc.js"
},
{
"searchDir": "./packages",
"pattern": "**/ui/*.stories.js",
"outputFile": "./storybook/storyLoaderForPackages.js"
}
]
}
}
}
Or make the cli tool scriptable:
node ./node_modules/.bin/rnstl --searchDir "./src" --pattern "**/*.stories.js" --outputFile "./storybook/storyLoader.js"
and then use npm
/yarn
scripts
to setup multiple loaders.
Thanks @xareelee, I really like all three ideas. I think it makes sense to start with adding support for arrays as a setting for searchDir
. I can probably get that done over my lunch out and push it out for you.
After that, I think I may move on to the cli options (#15) and lastly matches
(#16).
@elderfo Great! Very appreciated!
BTW, I think storybook and storyshots should include your library to load .stories
automatically for development and testing.
I'm starting to migrate my code to monorepo with multiple packages using lerna. Now I have two directories for snapshots:
./src
and./packages
. I needreact-native-storybook-loader
to search multiple directories to support this monorepo.From this (in
package.json
):to this:
Would you help improve this?