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

start haul/react-native using named binaries instead of cli.js #2715

Merged
merged 2 commits into from
Jan 11, 2018
Merged

start haul/react-native using named binaries instead of cli.js #2715

merged 2 commits into from
Jan 11, 2018

Conversation

meros
Copy link
Contributor

@meros meros commented Jan 11, 2018

yarn workspaces breaks storybook due to absolute path of cli.js changes to workspace root.

Issue:

yarn workspaces causes node modules to end up in the workspace root. And in general node resolves node_modules by searching in parent folders. Because of this we cannot assume the location of cli.js to be known.

It's important to note that this issue is not isolated to workspaces, but rather related to the naive view of how node_modules are resolved that causes the bug.

What I did

Change to use react-native or haul using installed binary name. These binaries are callable even when not installed globally when storybook is called through npm scripts.

How to test

Put a react native app w storybook as a package in a yarn workspace repo. Try to run yarn storybook.

Is this testable with jest or storyshots?

no

Does this need a new example in the kitchen sink apps?

no

Does this need an update to the documentation?

no

If your answer is yes to any of these, please make sure to include it in your PR.

yarn workspaces breaks storybook due to absolute path of cli.js changes to workspace root.
@codecov
Copy link

codecov bot commented Jan 11, 2018

Codecov Report

Merging #2715 into master will not change coverage.
The diff coverage is 0%.

Impacted file tree graph

@@           Coverage Diff           @@
##           master    #2715   +/-   ##
=======================================
  Coverage   34.31%   34.31%           
=======================================
  Files         391      391           
  Lines        8806     8806           
  Branches      922      909   -13     
=======================================
  Hits         3022     3022           
- Misses       5174     5188   +14     
+ Partials      610      596   -14
Impacted Files Coverage Δ
app/react-native/src/bin/storybook-start.js 0% <0%> (ø) ⬆️
.../ui/components/stories_panel/stories_tree/index.js 38.73% <0%> (ø) ⬆️
lib/ui/src/modules/ui/configs/init_panels.js 25% <0%> (ø) ⬆️
addons/viewport/src/components/RotateViewport.js 22.72% <0%> (ø) ⬆️
...modules/ui/components/stories_panel/text_filter.js 30.98% <0%> (ø) ⬆️
lib/ui/src/modules/api/configs/init_api.js 40.42% <0%> (ø) ⬆️
addons/a11y/src/components/Tabs.js 0% <0%> (ø) ⬆️
addons/knobs/src/components/types/Button.js 11.9% <0%> (ø) ⬆️
lib/core/src/client/preview/syncUrlWithStore.js 40.9% <0%> (ø) ⬆️
.../ui/src/modules/ui/components/addon_panel/index.js 34.78% <0%> (ø) ⬆️
... and 44 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 036002b...840fd62. Read the comment docs.

@Hypnosphi
Copy link
Member

Hypnosphi commented Jan 11, 2018

These binaries are callable even when not installed globally when storybook is called through npm scripts.

I wonder why didn't we call them like that from day one then
CC @mnmtanish

@Hypnosphi
Copy link
Member

Hypnosphi commented Jan 11, 2018

We also need to check that it doesn't break closs-platform support #2577
@FredyC would you like to test it?

@Hypnosphi Hypnosphi added bug react-native patch:yes Bugfix & documentation PR that need to be picked to main branch labels Jan 11, 2018
@Hypnosphi Hypnosphi requested a review from danielduan January 11, 2018 11:20
@danielkcz
Copy link
Contributor

I've tested this on Windows and works correctly. Haven't realized before it's possible to call binaries like that, so thanks @meros for the enlightenment :)

@Hypnosphi Hypnosphi merged commit 73185db into storybookjs:master Jan 11, 2018
shilman pushed a commit that referenced this pull request Jan 13, 2018
start haul/react-native using named binaries instead of cli.js
@Hypnosphi Hypnosphi added patch:done Patch/release PRs already cherry-picked to main/release branch and removed patch:done Patch/release PRs already cherry-picked to main/release branch labels Mar 6, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug patch:done Patch/release PRs already cherry-picked to main/release branch patch:yes Bugfix & documentation PR that need to be picked to main branch react-native
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants