Skip to content

Commit 8e22bb1

Browse files
committed
update dependencies.
1 parent a5dedf7 commit 8e22bb1

File tree

7 files changed

+224
-175
lines changed

7 files changed

+224
-175
lines changed

.storybook/config.js

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,5 @@
11
import '@babel/polyfill';
22
import { configure } from '@storybook/react';
3-
import { setDefaults } from '@storybook/addon-info';
4-
import TableComponent from './TableComponent';
5-
import Code from './Code';
63
import stories from '../stories';
74

8-
setDefaults({
9-
inline: true,
10-
maxPropsIntoLine: 1,
11-
'TableComponent': TableComponent,
12-
components: {
13-
code: Code,
14-
},
15-
});
16-
175
configure(() => stories, module);

.storybook/webpack.config.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
module.exports = (baseConfig, env, defaultConfig) => {
2+
if (env === 'DEVELOPMENT') {
3+
defaultConfig.devtool = 'inline-cheap-source-map';
4+
}
5+
return defaultConfig;
6+
};

package.json

Lines changed: 35 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -36,53 +36,53 @@
3636
},
3737
"dependencies": {
3838
"is-promise": "^2.1.0",
39-
"hoist-non-react-statics": "^2.5.0"
39+
"hoist-non-react-statics": "^3.1.0"
4040
},
4141
"devDependencies": {
42-
"@babel/cli": "^7.0.0-beta.46",
43-
"@babel/core": "^7.0.0-beta.46",
44-
"@babel/helper-plugin-utils": "^7.0.0-beta.46",
45-
"@babel/plugin-external-helpers": "^7.0.0-beta.46",
46-
"@babel/plugin-proposal-class-properties": "^7.0.0-beta.46",
47-
"@babel/plugin-proposal-object-rest-spread": "^7.0.0-beta.46",
48-
"@babel/plugin-syntax-dynamic-import": "^7.0.0-beta.46",
49-
"@babel/polyfill": "^7.0.0-beta.46",
50-
"@babel/preset-env": "^7.0.0-beta.46",
51-
"@babel/preset-react": "^7.0.0-beta.46",
52-
"@storybook/addon-info": "^3.4.2",
53-
"@storybook/react": "^3.4.2",
42+
"@babel/cli": "^7.1.5",
43+
"@babel/core": "^7.1.6",
44+
"@babel/helper-plugin-utils": "^7.0.0",
45+
"@babel/plugin-external-helpers": "^7.0.0",
46+
"@babel/plugin-proposal-class-properties": "^7.1.0",
47+
"@babel/plugin-proposal-object-rest-spread": "^7.0.0",
48+
"@babel/plugin-syntax-dynamic-import": "^7.0.0",
49+
"@babel/polyfill": "^7.0.0",
50+
"@babel/preset-env": "^7.1.6",
51+
"@babel/preset-react": "^7.0.0",
52+
"@storybook/addon-info": "^4.0.7",
53+
"@storybook/react": "^4.0.7",
5454
"@storybook/storybook-deployer": "^2.3.0",
55-
"@types/lodash": "^4.14.108",
56-
"@types/prop-types": "^15.5.2",
57-
"@types/react": "^16.3.12",
55+
"@types/lodash": "^4.14.118",
56+
"@types/prop-types": "^15.5.6",
57+
"@types/react": "^16.6.3",
5858
"babel-core": "^7.0.0-bridge.0",
5959
"babel-eslint": "^8.2.3",
60-
"babel-plugin-add-module-exports": "^0.2.1",
60+
"babel-plugin-add-module-exports": "^0.3.3",
6161
"babel-plugin-dev-expression": "^0.2.1",
62-
"babel-plugin-transform-react-remove-prop-types": "^0.4.13",
62+
"babel-plugin-transform-react-remove-prop-types": "^0.4.20",
6363
"eslint": "^4.19.1",
6464
"eslint-config-airbnb": "^16.1.0",
6565
"eslint-plugin-import": "^2.9.0",
6666
"eslint-plugin-jsx-a11y": "^6.0.3",
6767
"eslint-plugin-react": "^7.7.0",
68-
"gzip-size": "^4.1.0",
69-
"highlight.js": "^9.12.0",
70-
"lodash": "^4.17.10",
71-
"pretty-bytes": "^4.0.2",
72-
"prop-types": "^15.6.1",
73-
"react": "^16.3.2",
74-
"react-dom": "^16.3.2",
75-
"react-markdown": "^3.3.0",
76-
"rollup": "^0.58.2",
77-
"rollup-analyzer-plugin": "^1.1.1",
78-
"rollup-plugin-babel": "^4.0.0-beta.4",
68+
"gzip-size": "^5.0.0",
69+
"highlight.js": "^9.13.1",
70+
"lodash": "^4.17.11",
71+
"pretty-bytes": "^5.1.0",
72+
"prop-types": "^15.6.2",
73+
"react": "^16.6.3",
74+
"react-dom": "^16.6.3",
75+
"react-markdown": "^4.0.3",
76+
"rollup": "^0.67.3",
77+
"rollup-analyzer-plugin": "^1.2.0",
78+
"rollup-plugin-babel": "^4.0.3",
7979
"rollup-plugin-closure-compiler-js": "^1.0.6",
80-
"rollup-plugin-commonjs": "^9.1.0",
81-
"rollup-plugin-node-resolve": "^3.2.0",
82-
"rollup-plugin-peer-deps-external": "^2.1.0",
83-
"rollup-plugin-replace": "^2.0.0",
84-
"rollup-plugin-uglify": "^3.0.0",
85-
"classnames": "^2.2.5"
80+
"rollup-plugin-commonjs": "^9.2.0",
81+
"rollup-plugin-node-resolve": "^3.4.0",
82+
"rollup-plugin-peer-deps-external": "^2.2.0",
83+
"rollup-plugin-replace": "^2.1.0",
84+
"rollup-plugin-uglify": "^6.0.0",
85+
"classnames": "^2.2.6"
8686
},
8787
"keywords": [
8888
"react",

rollup.config.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import commonjs from 'rollup-plugin-commonjs';
44
import external from 'rollup-plugin-peer-deps-external';
55
import replace from 'rollup-plugin-replace';
66
import resolve from 'rollup-plugin-node-resolve';
7-
import uglify from 'rollup-plugin-uglify';
7+
import { uglify } from 'rollup-plugin-uglify';
88
// import closure from 'rollup-plugin-closure-compiler-js';
99
import camelCase from 'lodash/camelCase';
1010

.storybook/Code.js renamed to stories/Code.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable import/no-extraneous-dependencies */
12
import React from 'react';
23
import PropTypes from 'prop-types';
34
import cs from 'classnames';
@@ -15,6 +16,7 @@ class Code extends React.Component {
1516
this.codeEl = el;
1617
};
1718
highlightCode = () => {
19+
// noinspection JSUnresolvedFunction
1820
hljs.highlightBlock(this.codeEl);
1921
};
2022

@@ -34,6 +36,7 @@ class Code extends React.Component {
3436
}
3537
}
3638

39+
// noinspection JSUnresolvedVariable
3740
Code.propTypes = {
3841
value: PropTypes.string,
3942
code: PropTypes.node,
@@ -42,6 +45,8 @@ Code.propTypes = {
4245

4346
Code.defaultProps = {
4447
language: '',
48+
value: null,
49+
code: null,
4550
};
4651

4752
export default Code;
Lines changed: 19 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
import React from "react";
1+
/* eslint-disable import/no-extraneous-dependencies */
2+
import React from 'react';
3+
import PropTypes from 'prop-types';
24
import ReactMarkdown from 'react-markdown';
35
import PrettyPropType from '@storybook/addon-info/dist/components/types/PrettyPropType';
46
import Code from './Code';
57

68
const TableComponent = ({ propDefinitions }) => {
79
const source = propDefinitions
810
.filter(({ property }) => property !== 'children')
9-
.map(
10-
({ property, propType, required, description, defaultValue }) => {
11-
return `- *${property} ${required ? '' : '?'}*`
12-
+ ` - @@${JSON.stringify(propType)}@@`
13-
+ (defaultValue && defaultValue !== 'undefined' ? ` - \`${defaultValue}\`` : '')
14-
+ (description ? `\n\n ${description}\n` : '');
15-
}
16-
).join('\n');
11+
.map(({
12+
property, propType, required, description, defaultValue,
13+
}) => `${`- *${property} ${required ? '' : '?'}*`
14+
+ ` - @@${JSON.stringify(propType)}@@`}${
15+
defaultValue && defaultValue !== 'undefined' ? ` - \`${defaultValue}\`` : ''
16+
}${description ? `\n\n ${description}\n` : ''}`).join('\n');
1717
return (
1818
<ReactMarkdown
1919
source={source}
@@ -24,13 +24,12 @@ const TableComponent = ({ propDefinitions }) => {
2424
const out = [];
2525
let pos = 0;
2626
let i = 0;
27+
// eslint-disable-next-line
2728
while (res = reg.exec(value)) {
2829
if (res.index > pos) {
2930
out.push(value.slice(pos, res.index));
3031
}
31-
out.push(
32-
<PrettyPropType key={`${i++}`} propType={JSON.parse(res[0].slice(2, res[0].length - 2))} />
33-
);
32+
out.push(<PrettyPropType key={`${i++}`} propType={JSON.parse(res[0].slice(2, res[0].length - 2))} />);
3433
pos = res.index + res[0].length;
3534
}
3635
if (pos < value.length) {
@@ -40,18 +39,22 @@ const TableComponent = ({ propDefinitions }) => {
4039
return null;
4140
} else if (out.length === 1) {
4241
return out[0];
43-
} else {
42+
}
4443
return (
4544
<span key={key}>
4645
{ out }
4746
</span>
48-
)
49-
}
47+
);
5048
},
5149
code: Code,
5250
}}
5351
/>
5452
);
5553
};
5654

57-
export default TableComponent;
55+
// noinspection JSUnresolvedFunction, JSUnresolvedVariable
56+
TableComponent.propTypes = {
57+
propDefinitions: PropTypes.arrayOf(PropTypes.object).isRequired,
58+
};
59+
60+
export default TableComponent;

0 commit comments

Comments
 (0)