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

Fix react native example and bootstrapping #1514

Merged
merged 5 commits into from
Jul 25, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions docs/components/Homepage/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,13 @@ import Footer from '../Footer';
const Homepage = ({ users }) =>
<div className="container">
<Helmet title="Storybook - UI dev environment you'll love to use" />
{/* <Header currentSection="home" />*/}
{/* <Header currentSection="home" /> */}
<Heading />
<Demo />
{/* <Platforms />*/}
{/* <Platforms /> */}
<MainLinks />
<UsedBy users={users} />
{/* <Featured featuredStorybooks={featuredStorybooks} />*/}
{/* <Featured featuredStorybooks={featuredStorybooks} /> */}
<Footer />
</div>;

Expand Down
8 changes: 7 additions & 1 deletion examples/test-cra/src/stories/ComponentWithRef.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,13 @@ class ComponentWithRef extends Component {
}
scrollWidth = 0;
render() {
return <div ref={r => (this.ref = r)} />;
return (
<div
ref={r => {
this.ref = r;
}}
/>
);
}
}

Expand Down
11 changes: 3 additions & 8 deletions lib/addons/src/index.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,11 @@
function channelError() {
throw new Error(
'Accessing nonexistent addons channel, see https://storybook.js.org/basics/faq/#why-is-there-no-addons-channel'
);
}

export class AddonStore {
constructor() {
this.loaders = {};
this.panels = {};
// this.channel should get overwritten by setChannel if package versions are
// correct and AddonStore is a proper singleton. If not, throw an error.
this.channel = { on: channelError, emit: channelError };
// correct and AddonStore is a proper singleton. If not, this will be null
// (currently required by @storybook/react-native getStorybookUI)
this.channel = null;
this.preview = null;
this.database = null;
}
Expand Down
24 changes: 12 additions & 12 deletions scripts/hoist-internals.js
100644 → 100755
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,7 @@ const passingLog = fn => i => {
fn(i);
return i;
};
const getPackageNameOfFolder = sourcePath =>
fse
.readJson(path.join(sourcePath, 'package.json'))
.then(json => json.name.replace('@storybook/', ''));
const getPackageOfFolder = sourcePath => fse.readJsonSync(path.join(sourcePath, 'package.json'));

const task = getLernaPackages()
.then(
Expand Down Expand Up @@ -60,14 +57,17 @@ const task = getLernaPackages()
log.silly(prefix, 'found package path', item);
})
)
.map(sourcePath =>
getPackageNameOfFolder(sourcePath)
.then(
passingLog(packageName => {
log.silly(prefix, 'found package name', packageName);
})
)
.then(packageName => path.join(targetPath, packageName))
.map(sourcePath => ({
sourcePath,
packageJson: getPackageOfFolder(sourcePath),
}))
.filter(({ packageJson }) => !packageJson.private)
.map(({ sourcePath, packageJson }) =>
Promise.resolve(packageJson.name.replace('@storybook/', ''))
.then(packageName => {
log.silly(prefix, 'found package name', packageName);
return path.join(targetPath, packageName);
})
.then(localTargetPath =>
symlink(sourcePath, localTargetPath)
.then(
Expand Down