Skip to content

Commit

Permalink
feat: export list of located story paths in generated file
Browse files Browse the repository at this point in the history
  • Loading branch information
chambo-e authored and elderfo committed Oct 10, 2017
1 parent 5e99677 commit 00a8511
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 2 deletions.
11 changes: 10 additions & 1 deletion src/writer/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ exports[`writeFile should perform expected work 1`] = `
// https://github.com/elderfo/react-native-storybook-loader.git
function loadStories() {
require('./parent/file3.js');
require('./src/file1.js');
require('./src/sub/file2.js');
Expand All @@ -17,8 +16,18 @@ function loadStories() {
}
const stories = [
'./parent/file3.js',
'./src/file1.js',
'./src/sub/file2.js',
'./src/writer/sub/file4.js',
'./src/writer/sub/sub/file5.js',
];
module.exports = {
loadStories,
stories,
};
"
`;
7 changes: 6 additions & 1 deletion src/writer/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,18 @@ const templateContents = `
// https://github.com/elderfo/react-native-storybook-loader.git
function loadStories() {
{{~it.files :value:index}}require('{{=value}}');
{{~}}
}
const stories = [
{{~it.files :value:index}}'{{=value}}',
{{~}}
];
module.exports = {
loadStories,
stories,
};
`;

Expand Down

0 comments on commit 00a8511

Please sign in to comment.