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

feat: config location is now flexible and paths relative from main.js #278

Merged
merged 16 commits into from
Oct 11, 2021

Conversation

dannyhw
Copy link
Member

@dannyhw dannyhw commented Oct 7, 2021

Issue: closes #275

What I did

I've changed the get stories and watcher commands so that you can now pass a config path which will be used to determine your .storybook folder location (you can call .storybook something else now).

I've also added prettier and commander to make the code a bit easier to work with.

How to test

Please explain how to test your changes and consider the following questions

  • run get stories and watcher in the example project
  • move the .storybook folder and set --config-location in the package.json script prestart and storybook-watcher
  • run get stories and watcher again

Copy link
Member

@shilman shilman left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice set of changes! 👏

app/react-native-server/package.json Outdated Show resolved Hide resolved
app/react-native/package.json Outdated Show resolved Hide resolved
examples/native/package.json Outdated Show resolved Hide resolved
@dannyhw
Copy link
Member Author

dannyhw commented Oct 8, 2021

Added a small change to prevent the on add from being ran for every file on the intial setup of the watcher.

@dannyhw
Copy link
Member Author

dannyhw commented Oct 8, 2021

Added some unit tests for the loader file to validate a few things. The beginning of more testing to come in the future 🙂.

@dannyhw
Copy link
Member Author

dannyhw commented Oct 11, 2021

Will merge this tomorrow and create a new alpha build

@dannyhw dannyhw merged commit fc7f666 into next-6.0 Oct 11, 2021
@dannyhw dannyhw deleted the feat/configurable-config-location branch October 11, 2021 10:00
dannyhw added a commit to raychanks/react-native that referenced this pull request Feb 7, 2022
…storybookjs#278)

- you can now specify a config location and you can change the folder name storybookjs#278
    - note that this folder should still contain all the same files
    - `—absolute` option will use absolute imports in the requires.js file
    - paths in general should work better with the watcher and get stories script
- In main.js stories are relative from the config directory and no longer add "../", this should fix absolute paths and other bugs storybookjs#278
- `sbn-get-stories` and `sbn-watcher` are now `sb-rn-get-stories`  and `sb-rn-watcher`
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
3 participants