Skip to content

Commit

Permalink
feat: 增加 storybook addon
Browse files Browse the repository at this point in the history
  • Loading branch information
lijinke666 committed Aug 27, 2018
1 parent 5328e4a commit f261555
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 3 deletions.
2 changes: 2 additions & 0 deletions .storybook/addons.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import '@storybook/addon-actions/register';
import '@storybook/addon-links/register';
10 changes: 9 additions & 1 deletion .storybook/config.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
import { configure } from '@storybook/react';
import { configure,setAddon } from '@storybook/react';
import {name,repository} from "../package.json"
import infoAddon from '@storybook/addon-info';
import { setOptions } from '@storybook/addon-options';

const req = require.context('../components', true, /\.stories\.js$/)

Expand All @@ -9,4 +12,9 @@ function loadStories() {
require('../stories/dataEntry'); //数据录入
}

setOptions({
name: name,
url: repository,
});
setAddon(infoAddon);
configure(loadStories, module);
2 changes: 2 additions & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,8 @@
"ui"
],
"devDependencies": {
"@storybook/addon-info": "^3.4.10",
"@storybook/addon-options": "^3.4.10",
"@storybook/react": "^3.4.10",
"@storybook/storybook-deployer": "^2.3.0",
"autoprefixer": "^6.7.2",
Expand Down
50 changes: 48 additions & 2 deletions yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -257,6 +257,22 @@
react-inspector "^2.2.2"
uuid "^3.2.1"

"@storybook/addon-info@^3.4.10":
version "3.4.10"
resolved "https://registry.yarnpkg.com/@storybook/addon-info/-/addon-info-3.4.10.tgz#fb846457150b6aff690b7886d2b82cf576829bad"
dependencies:
"@storybook/client-logger" "3.4.10"
"@storybook/components" "3.4.10"
babel-runtime "^6.26.0"
glamor "^2.20.40"
glamorous "^4.12.1"
global "^4.3.2"
marksy "^6.0.3"
nested-object-assign "^1.0.1"
prop-types "^15.6.1"
react-addons-create-fragment "^15.5.3"
util-deprecate "^1.0.2"

"@storybook/addon-links@3.4.10":
version "3.4.10"
resolved "http://registry.npm.taobao.org/@storybook/addon-links/download/@storybook/addon-links-3.4.10.tgz#db53d0a0b354e7f5e55195315f48f7045307a429"
Expand All @@ -266,6 +282,12 @@
global "^4.3.2"
prop-types "^15.6.1"

"@storybook/addon-options@^3.4.10":
version "3.4.10"
resolved "https://registry.yarnpkg.com/@storybook/addon-options/-/addon-options-3.4.10.tgz#0b6ed3e22b7541a86a7c507ff80356d33784eda9"
dependencies:
babel-runtime "^6.26.0"

"@storybook/addons@3.4.10":
version "3.4.10"
resolved "http://registry.npm.taobao.org/@storybook/addons/download/@storybook/addons-3.4.10.tgz#13298cdcb7ccc396321b1336b9785b69273a022d"
Expand Down Expand Up @@ -1855,6 +1877,10 @@ babel-runtime@6.x, babel-runtime@6.x.x, babel-runtime@^6.11.6, babel-runtime@^6.
core-js "^2.4.0"
regenerator-runtime "^0.11.0"

babel-standalone@^6.26.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-standalone/-/babel-standalone-6.26.0.tgz#15fb3d35f2c456695815ebf1ed96fe7f015b6886"

babel-template@^6.16.0, babel-template@^6.24.1, babel-template@^6.26.0, babel-template@^6.3.0:
version "6.26.0"
resolved "https://registry.yarnpkg.com/babel-template/-/babel-template-6.26.0.tgz#de03e2d16396b069f46dd9fff8521fb1a0e35e02"
Expand Down Expand Up @@ -4378,7 +4404,7 @@ fb-watchman@^2.0.0:
dependencies:
bser "^2.0.0"

fbjs@^0.8.12, fbjs@^0.8.16, fbjs@^0.8.9:
fbjs@^0.8.12, fbjs@^0.8.16, fbjs@^0.8.4, fbjs@^0.8.9:
version "0.8.17"
resolved "https://registry.yarnpkg.com/fbjs/-/fbjs-0.8.17.tgz#c4d598ead6949112653d6588b01a5cdcd9f90fdd"
dependencies:
Expand Down Expand Up @@ -5225,7 +5251,7 @@ hawk@~3.1.3:
hoek "2.x.x"
sntp "1.x.x"

he@1.1.1, he@1.1.x:
he@1.1.1, he@1.1.x, he@^1.1.1:
version "1.1.1"
resolved "https://registry.yarnpkg.com/he/-/he-1.1.1.tgz#93410fd21b009735151f8868c2f271f3427e23fd"

Expand Down Expand Up @@ -7127,6 +7153,14 @@ marked@^0.3.9:
version "0.3.19"
resolved "http://registry.npm.taobao.org/marked/download/marked-0.3.19.tgz#5d47f709c4c9fc3c216b6d46127280f40b39d790"

marksy@^6.0.3:
version "6.0.3"
resolved "https://registry.yarnpkg.com/marksy/-/marksy-6.0.3.tgz#6079076e8689b563b61be058942090c7ba1f5d20"
dependencies:
babel-standalone "^6.26.0"
he "^1.1.1"
marked "^0.3.9"

math-expression-evaluator@^1.2.14:
version "1.2.17"
resolved "https://registry.yarnpkg.com/math-expression-evaluator/-/math-expression-evaluator-1.2.17.tgz#de819fdbcd84dccd8fae59c6aeb79615b9d266ac"
Expand Down Expand Up @@ -7495,6 +7529,10 @@ neo-async@^2.5.0:
version "2.5.2"
resolved "http://registry.npm.taobao.org/neo-async/download/neo-async-2.5.2.tgz#489105ce7bc54e709d736b195f82135048c50fcc"

nested-object-assign@^1.0.1:
version "1.0.2"
resolved "https://registry.yarnpkg.com/nested-object-assign/-/nested-object-assign-1.0.2.tgz#9a84ef51b5c11298b5476d6c65b26458c9eae82b"

next-tick@1:
version "1.0.0"
resolved "http://registry.npm.taobao.org/next-tick/download/next-tick-1.0.0.tgz#ca86d1fe8828169b0120208e3dc8424b9db8342c"
Expand Down Expand Up @@ -9133,6 +9171,14 @@ rc@^1.1.2, rc@^1.2.7:
minimist "^1.2.0"
strip-json-comments "~2.0.1"

react-addons-create-fragment@^15.5.3:
version "15.6.2"
resolved "https://registry.yarnpkg.com/react-addons-create-fragment/-/react-addons-create-fragment-15.6.2.tgz#a394de7c2c7becd6b5475ba1b97ac472ce7c74f8"
dependencies:
fbjs "^0.8.4"
loose-envify "^1.3.1"
object-assign "^4.1.0"

react-dev-utils@^5.0.0:
version "5.0.2"
resolved "http://registry.npm.taobao.org/react-dev-utils/download/react-dev-utils-5.0.2.tgz#7bb68d2c4f6ffe7ed1184c5b0124fcad692774d2"
Expand Down

0 comments on commit f261555

Please sign in to comment.