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

Move @storybook/addons to peerDependencies in all addons #2335

Merged
merged 8 commits into from
Nov 28, 2017
Merged
Show file tree
Hide file tree
Changes from 6 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
2 changes: 1 addition & 1 deletion addons/a11y/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@
"prepare": "node ../../scripts/prepare.js"
},
"dependencies": {
"@storybook/addons": "^3.3.0-alpha.4",
"@storybook/components": "^3.3.0-alpha.4",
"axe-core": "^2.0.7",
"prop-types": "^15.6.0"
},
"peerDependencies": {
"@storybook/addons": "^3.3.0-alpha.4",
"react": "*",
"react-dom": "*"
}
Expand Down
2 changes: 1 addition & 1 deletion addons/actions/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@
"storybook": "start-storybook -p 9001"
},
"dependencies": {
"@storybook/addons": "^3.3.0-alpha.4",
"deep-equal": "^1.0.1",
"prop-types": "^15.6.0",
"react-inspector": "^2.2.1",
"uuid": "^3.1.0"
},
"peerDependencies": {
"@storybook/addons": "^3.3.0-alpha.4",
"react": "*",
"react-dom": "*"
}
Expand Down
2 changes: 1 addition & 1 deletion addons/background/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"prop-types": "^15.6.0"
},
"peerDependencies": {
"@storybook/addons": "^3.2.14",
"@storybook/addons": "^3.3.0-alpha.4",
"react": "*"
}
}
2 changes: 1 addition & 1 deletion addons/events/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,14 @@
"storybook": "start-storybook -p 6006"
},
"dependencies": {
"@storybook/addons": "^3.3.0-alpha.4",
"babel-runtime": "^6.26.0",
"format-json": "^1.0.3",
"prop-types": "^15.6.0",
"react-textarea-autosize": "^5.2.1",
"uuid": "^3.1.0"
},
"peerDependencies": {
"@storybook/addons": "^3.3.0-alpha.4",
"react": "*"
}
}
1 change: 0 additions & 1 deletion addons/info/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"storybook": "start-storybook -p 9010"
},
"dependencies": {
"@storybook/addons": "^3.3.0-alpha.4",
"@storybook/components": "^3.3.0-alpha.4",
"babel-runtime": "^6.26.0",
"global": "^4.3.2",
Expand Down
2 changes: 1 addition & 1 deletion addons/knobs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
},
"dependencies": {
"@angular/core": "^5.0.0-beta.7",
"@storybook/addons": "^3.3.0-alpha.4",
"babel-runtime": "^6.26.0",
"deep-equal": "^1.0.1",
"global": "^4.3.2",
Expand All @@ -34,6 +33,7 @@
"vue": "^2.5.8"
},
"peerDependencies": {
"@storybook/addons": "^3.3.0-alpha.4",
"react": "*",
"react-dom": "*"
}
Expand Down
2 changes: 1 addition & 1 deletion addons/links/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@
"storybook": "start-storybook -p 9001"
},
"dependencies": {
"@storybook/addons": "^3.3.0-alpha.4",
"@storybook/components": "^3.3.0-alpha.4",
"global": "^4.3.2",
"prop-types": "^15.5.10"
Expand All @@ -33,6 +32,7 @@
"shelljs": "^0.7.8"
},
"peerDependencies": {
"@storybook/addons": "^3.3.0-alpha.4",
"react": "*",
"react-dom": "*"
}
Expand Down
2 changes: 1 addition & 1 deletion addons/notes/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@
"storybook": "start-storybook -p 9010"
},
"dependencies": {
"@storybook/addons": "^3.3.0-alpha.4",
"babel-runtime": "^6.26.0",
"prop-types": "^15.6.0",
"util-deprecate": "^1.0.2"
},
"peerDependencies": {
"@storybook/addons": "^3.3.0-alpha.4",
"react": "*"
},
"optionalDependencies": {
Expand Down
4 changes: 1 addition & 3 deletions addons/options/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,8 @@
"prepare": "node ../../scripts/prepare.js",
"storybook": "start-storybook -p 9001"
},
"dependencies": {
"@storybook/addons": "^3.3.0-alpha.4"
},
"peerDependencies": {
"@storybook/addons": "^3.3.0-alpha.4",
"react": "*",
"react-dom": "*"
}
Expand Down
2 changes: 1 addition & 1 deletion addons/viewport/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"prop-types": "^15.5.10"
},
"peerDependencies": {
"@storybook/addons": "^3.2.0",
"@storybook/addons": "^3.3.0-alpha.4",
"react": "*"
}
}
2 changes: 1 addition & 1 deletion docs/src/pages/addons/writing-addons/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ You can learn more about the complete API [here](/addons/api).

## Packaging

You can package this addon into a NPM module very easily. Have a look at this [repo](https://github.com/storybooks/storybook/tree/master/addon/notes/tree/version1).
You can package this addon into a NPM module very easily. Have a look at this [package](https://github.com/storybooks/storybook/tree/master/addons/notes).

In addition to moving the above code to an NPM module, we've set `react` and `@storybook/addons` as peer dependencies.

Expand Down
5 changes: 1 addition & 4 deletions docs/src/pages/basics/faq/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ You can generally reuse webpack rules fairly easily by placing them in a file th

A common error is that an addon tries to access the "channel", but the channel is not set. This can happen in a few different cases:

1. In storybook/addon development, it can be an NPM version problem. If there are two versions of the addons NPM package, it will cause problems. In this case, make sure there is only a single version of `@storybook/addons` being used by your project.
1. In storybook/addon development, it can be an NPM version problem. If there are two versions of the `@storybook/addons` NPM package, it will cause problems. In this case, make sure there is only a single version of `@storybook/addons` being used by your project.
2. In React Native, it's a special case that's documented in [#1192](https://github.com/storybooks/storybook/issues/1192)
3. You have inadvertently installed multiple addons with differing versions. Upgrade or downgrade all `@storybook/addon-*` modules so they have the same version.

> Most of the time, the fix is deleting the `node_modules` folder with any `package-lock.json` or `yarn.lock` and reinstalling.

### Can I modify React component state in stories?

Expand Down