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

Load stories from parent folder #64

Open
iamchathu opened this issue Jan 17, 2019 · 4 comments
Open

Load stories from parent folder #64

iamchathu opened this issue Jan 17, 2019 · 4 comments

Comments

@iamchathu
Copy link

I'm developing a React Native UI Libary and I wanted to add storybook to the project.

So I created a react-native project inside the libary as .storybook-native folder structure looks like folowing

+--.storybook
|--++--package.json
|--++--...
+--src
|--++--Components
|--++--|--++--Grid
|--++--|--++--|--++--Grid.story.js

I have my config as

"config": {
    "react-native-storybook-loader": {
      "searchDir": [
        "../src"
      ],
      "pattern": "**/*.story.js",
      "outputFile": "./storybook/storyLoader.js"
    }
  },

But I get

bundling failed: Error: Unable to resolve module `../../src/Components/Grid/KTGrid.story` from `/Users/Chathu/Workspace/ui-rn/.storybook-native/storybook/storyLoader.js`: The module `../../src/Components/Grid/KTGrid.story` could not be found from `/Users/Chathu/Workspace/ui-rn/.storybook-native/storybook/storyLoader.js`. Indeed, none of these files exist:
  * `/Users/Chathu/Workspace/ui-rn/src/Components/Grid/KTGrid.story(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`
  * `/Users/Chathu/Workspace/ui-rn/src/Components/Grid/KTGrid.story/index(.native||.android.js|.native.js|.js|.android.json|.native.json|.json|.android.ts|.native.ts|.ts|.android.tsx|.native.tsx|.tsx)`


@jeremybviseo
Copy link

Hi,
I've not experienced the same error, but i agree the fact react-native-storybook-loader is not able to search in a parent folder of package.json.

In my case, this is problematic for a project using yarn workspaces.

@virgil9306
Copy link

virgil9306 commented Feb 25, 2021

For anyone coming from search engines, one possible solution is to just keep *.stories.{js/ts/x} inside the ./storybook folder.

But no responses for over 1 year, I think this project is dead. Making your own list of UI components will not be so difficult -- it won't take much more time than getting this library to work if your use case is quite unique.

@elderfo
Copy link
Owner

elderfo commented Feb 25, 2021

@virgil9306 feel free to submit a PR to address this issue.

@virgil9306
Copy link

@virgil9306 feel free to submit a PR to address this issue.

If I can make time I certainly will try. Thanks for the plug-in by the way!

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

4 participants