Skip to content

Commit cd8c531

Browse files
committed
chore: update dependencies
Update emotion to version 10 Update babel to version 7 Update storybook to version 5
1 parent f17a73b commit cd8c531

File tree

127 files changed

+5764
-4845
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

127 files changed

+5764
-4845
lines changed

.babelrc

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
{
22
"presets": [
33
"react-app",
4-
"flow"
4+
"@babel/preset-flow",
5+
"@emotion/babel-preset-css-prop"
56
],
6-
"plugins": ["inline-react-svg", "jsx-control-statements", "emotion", "babel-plugin-react-css-modules", "lodash"]
7+
"plugins": [
8+
"inline-react-svg",
9+
"jsx-control-statements",
10+
"lodash"
11+
]
712
}

.eslintrc.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,11 @@ globals:
1111
BoostProvider: true
1212

1313
plugins: [
14-
react-hooks
14+
react-hooks,
15+
emotion
1516
]
1617

17-
rules:
18+
rules:
1819
#styles
1920
block-spacing: ['error']
2021
array-bracket-spacing: ['warn', 'never']
@@ -115,3 +116,8 @@ rules:
115116
react-hooks/exhaustive-deps: "warn"
116117

117118
jsx-a11y/aria-role: 'off'
119+
120+
#emotion
121+
emotion/no-vanilla: "error"
122+
emotion/import-from-emotion: "error"
123+
emotion/styled-import: "error"
Binary file not shown.

e2e/__tests__/card.test.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ import { baisy } from '../setup/TestSuiter';
22

33

44
const SUITES = [
5-
baisy.suite('Components/Card', 'common'),
5+
baisy.suite('Components/Card', 'default'),
66
baisy.suite('Components/Card', 'with custom paddings'),
77
baisy.suite('Components/Card', 'with multiple sections'),
88
];
@@ -11,4 +11,3 @@ const SUITES = [
1111
SUITES.map(suite => {
1212
it(suite.getTestName(), suite.testStory, 20000);
1313
});
14-

e2e/setup/TestSuiter.js

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
// @flow
2+
import { toId } from '@storybook/router';
3+
24
const { E2E_URL } = (process.env: any);
35

46

@@ -17,13 +19,12 @@ class TestSuiter {
1719
this.stateName = stateName;
1820
}
1921

20-
2122
_init = async () => {
2223
// $FlowIgnore
2324
this.page = await __BROWSER_CONTEXT__.newPage();
2425

2526
await this.page.goto(
26-
`${E2E_URL}/?selectedKind=${encodeURIComponent(this.kind)}&selectedStory=${encodeURIComponent(this.story)}`, { waitUntil: 'networkidle2' },
27+
`${E2E_URL}/?path=/story/${toId(this.kind, this.story)}`, { waitUntil: 'networkidle2' },
2728
);
2829

2930
// eslint-disable-next-line

jest.setup.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
import * as emotion from 'emotion';
2-
import { createSerializer } from 'jest-emotion';
1+
import serializer from 'jest-emotion';
32
import { configure, shallow, render, mount } from 'enzyme';
43
import Adapter from 'enzyme-adapter-react-16';
54
import enzymeToJson from 'enzyme-to-json';
@@ -14,4 +13,4 @@ global.mount = mount;
1413
global.enzymeToJson = enzymeToJson;
1514
global.BoostProvider = BoostProvider;
1615

17-
expect.addSnapshotSerializer(createSerializer(emotion));
16+
expect.addSnapshotSerializer(serializer);

package.json

Lines changed: 23 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -28,28 +28,31 @@
2828
"commit": "git-cz"
2929
},
3030
"peerDependencies": {
31+
"@emotion/core": "^10",
32+
"@emotion/styled": "^10",
3133
"react": "^16.8",
32-
"react-dom": "^16.8",
33-
"react-emotion": "^9.1"
34+
"react-dom": "^16.8"
3435
},
3536
"devDependencies": {
36-
"@storybook/addon-info": "^3.4.4",
37-
"@storybook/addons": "3.4.1",
38-
"@storybook/react": "^3.4.1",
39-
"@storybook/storybook-deployer": "^2.3.0",
40-
"babel-cli": "^6.26.0",
41-
"babel-core": "^6.26.0",
42-
"babel-eslint": "7.2.3",
43-
"babel-plugin-emotion": "^9.2.11",
44-
"babel-plugin-external-helpers": "^6.22.0",
37+
"@babel/cli": "^7.0.0",
38+
"@babel/core": "^7.0.0",
39+
"@babel/plugin-external-helpers": "^7.0.0",
40+
"@babel/preset-flow": "^7.0.0",
41+
"@babel/runtime-corejs2": "^7.0.0",
42+
"@emotion/babel-preset-css-prop": "^10.0.14",
43+
"@storybook/addon-info": "^5.1.11",
44+
"@storybook/addons": "5.1.11",
45+
"@storybook/react": "^5.1.11",
46+
"@storybook/storybook-deployer": "^2.8.1",
47+
"babel-core": "^7.0.0-bridge.0",
48+
"babel-eslint": "^9.0.0",
49+
"babel-jest": "^23.4.2",
50+
"babel-loader": "^8.0.6",
4551
"babel-plugin-flow-react-proptypes": "^23.0.0",
4652
"babel-plugin-inline-react-svg": "^0.5.2",
4753
"babel-plugin-jsx-control-statements": "^3.2.8",
4854
"babel-plugin-lodash": "^3.3.4",
49-
"babel-plugin-react-css-modules": "3.4.0",
50-
"babel-preset-flow": "^6.23.0",
51-
"babel-preset-react-app": "^3.1.1",
52-
"babel-runtime": "^6.26.0",
55+
"babel-preset-react-app": "^9.0.1",
5356
"commitizen": "^3.0.7",
5457
"conventional-changelog-cli": "^1.3.22",
5558
"cz-conventional-changelog": "^2.1.0",
@@ -59,6 +62,7 @@
5962
"enzyme-to-json": "^3.3.5",
6063
"eslint": "4.1.1",
6164
"eslint-config-react-app": "2.1.0",
65+
"eslint-plugin-emotion": "^10.0.14",
6266
"eslint-plugin-flowtype": "2.34.1",
6367
"eslint-plugin-import": "2.10.0",
6468
"eslint-plugin-jsx-a11y": "5.1.1",
@@ -67,21 +71,21 @@
6771
"flow-bin": "^0.93.0",
6872
"flow-copy-source": "^2.0.2",
6973
"jest": "^23.6.0",
70-
"jest-emotion": "^9.0.0",
74+
"jest-emotion": "^10.0.14",
7175
"jest-environment-node": "^23.4.0",
7276
"jest-image-snapshot": "^2.7.0",
7377
"prettier": "^1.15.3",
7478
"puppeteer": "^1.11.0",
7579
"react": "^16.8.1",
7680
"react-dom": "^16.8.1",
77-
"react-emotion": "^9.1.3",
7881
"react-test-renderer": "^16.8.1"
7982
},
8083
"dependencies": {
84+
"@emotion/core": "^10.0.16",
85+
"@emotion/styled": "^10.0.15",
8186
"color": "^3.0.0",
8287
"deepmerge": "^3.0.0",
83-
"emotion": "^9.1.1",
84-
"emotion-theming": "^9.1.2",
88+
"emotion-theming": "^10.0.14",
8589
"lodash": "^4.17.15",
8690
"luxon": "1.7.1",
8791
"react-datepicker": "^2.3.0",

src/BoostProvider.js

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
// @flow
22

33
import React from 'react';
4-
import { injectGlobal } from 'emotion';
54
import { ThemeProvider } from 'emotion-theming';
65
import { IconsProvider } from './components/Icon/IconsProvider';
76
import { ModalProvider } from './components/Modal/ModalProvider';
8-
import { createTheme, resetGlobal, type Theme } from './theme';
7+
import { createTheme, type Theme, Globals } from './theme';
98

109
type BoostProviderProps = {
1110
theme?: Theme,
@@ -22,25 +21,13 @@ class BoostProvider extends React.Component<BoostProviderProps> {
2221
this.theme = props.theme || createTheme();
2322
}
2423

25-
componentDidMount() {
26-
resetGlobal(this.theme);
27-
28-
Object.keys(this.theme.components).forEach((name) => {
29-
const { globals } = this.theme.components[name];
30-
31-
if (globals) {
32-
typeof globals === 'function'
33-
? injectGlobal(globals(this.theme))
34-
: injectGlobal(globals);
35-
}
36-
});
37-
}
38-
3924
render() {
4025
const { children, icons } = this.props;
4126

4227
return (
4328
<ThemeProvider theme={ this.theme }>
29+
<Globals components={ this.theme.components } />
30+
4431
<ModalProvider>
4532
<IconsProvider icons={ icons }>
4633
{ children }

src/components/Avatars/Avatars.js

Lines changed: 17 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
/* eslint-disable react/jsx-key */
33

44
import React from 'react';
5-
import { css } from 'emotion';
5+
import { css } from '@emotion/core';
66
import { theme, AvatarsTag, AvatarsHandleTag, AvatarsCounterTag } from './Avatars.theme';
77

88
import { Tooltip } from '../Tooltip';
@@ -33,26 +33,23 @@ const avatarClassName = css`
3333
const Avatars = ({ users, size, onClick, ...rest }: AvatarsProps) => {
3434
return (
3535
<AvatarsTag { ...rest } tagName="div" onClick={ onClick }>
36-
{
37-
React.Children.toArray(
38-
users.slice(0, 4).map(({ firstName, lastName, avatarUrl }, index) => (
39-
<Tooltip className={ tooltipClassName } message={ `${firstName} ${lastName}` }>
40-
<Avatar
41-
className={ avatarClassName }
42-
style={{ zIndex: Math.abs(index - 7) }}
43-
firstName={ firstName }
44-
lastName={ lastName }
45-
src={ avatarUrl }
46-
size={ size }
47-
/>
48-
</Tooltip>
49-
),
50-
))
51-
}
36+
{ React.Children.toArray(
37+
users.slice(0, 4).map(({ firstName, lastName, avatarUrl }, index) => (
38+
<Tooltip css={ css(tooltipClassName) } message={ `${firstName} ${lastName}` }>
39+
<Avatar
40+
css={ css(avatarClassName) }
41+
style={{ zIndex: Math.abs(index - 7) }}
42+
firstName={ firstName }
43+
lastName={ lastName }
44+
src={ avatarUrl }
45+
size={ size }
46+
/>
47+
</Tooltip>
48+
)),
49+
) }
50+
5251
<If condition={ users.length > 4 }>
53-
<AvatarsCounterTag size={ size }>
54-
+ { users.length - 4 }
55-
</AvatarsCounterTag>
52+
<AvatarsCounterTag size={ size }>+ { users.length - 4 }</AvatarsCounterTag>
5653
</If>
5754
<AvatarsHandleTag size={ size }>
5855
<Icon name="Plus" size="xs" color="PRIMARY" />
@@ -61,7 +58,6 @@ const Avatars = ({ users, size, onClick, ...rest }: AvatarsProps) => {
6158
);
6259
};
6360

64-
6561
Avatars.defaultProps = {
6662
size: 'lg',
6763
};

src/components/Button/Button.theme.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// @flow
22

3-
import { keyframes } from 'react-emotion';
3+
import { keyframes } from '@emotion/core';
44
import { createThemeTag } from '../../theme/createThemeTag';
55

66

@@ -174,4 +174,3 @@ const [ButtonTag, theme] = createThemeTag(name, ({ COLORS, SIZES }: *) => ({
174174
}));
175175

176176
export { ButtonTag, theme };
177-

src/components/Card/Card.stories.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import React from 'react';
2-
import styled from 'react-emotion';
2+
import styled from '@emotion/styled';
33

44
const ShortDiv = styled('div')({
55
height: '300px',

src/components/Card/__snapshots__/Card.test.js.snap

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -15,12 +15,12 @@ exports[`<Card /> should render Card components 1`] = `
1515
>
1616
<Tag
1717
borderRadius="all"
18-
className="emotion-0 emotion-1"
18+
className="css-rkvmzw-StyledTag emotion-0"
1919
padding="none"
2020
tagName="div"
2121
>
2222
<div
23-
className="emotion-0 emotion-1"
23+
className="css-rkvmzw-StyledTag emotion-0"
2424
>
2525
<CardHeader
2626
padding="md"
@@ -30,12 +30,12 @@ exports[`<Card /> should render Card components 1`] = `
3030
tagName="div"
3131
>
3232
<Tag
33-
className="emotion-0 emotion-1"
33+
className="css-rkvmzw-StyledTag emotion-0"
3434
padding="md"
3535
tagName="div"
3636
>
3737
<div
38-
className="emotion-0 emotion-1"
38+
className="css-rkvmzw-StyledTag emotion-0"
3939
>
4040
Header
4141
</div>
@@ -52,13 +52,13 @@ exports[`<Card /> should render Card components 1`] = `
5252
tagName="div"
5353
>
5454
<Tag
55-
className="emotion-0 emotion-1"
55+
className="css-rkvmzw-StyledTag emotion-0"
5656
padding="lg"
5757
scrollable={true}
5858
tagName="div"
5959
>
6060
<div
61-
className="emotion-0 emotion-1"
61+
className="css-rkvmzw-StyledTag emotion-0"
6262
>
6363
<CardSection
6464
padding="md"
@@ -68,12 +68,12 @@ exports[`<Card /> should render Card components 1`] = `
6868
tagName="div"
6969
>
7070
<Tag
71-
className="emotion-0 emotion-1"
71+
className="css-rkvmzw-StyledTag emotion-0"
7272
padding="md"
7373
tagName="div"
7474
>
7575
<div
76-
className="emotion-0 emotion-1"
76+
className="css-rkvmzw-StyledTag emotion-0"
7777
>
7878
Body
7979
</div>
@@ -92,12 +92,12 @@ exports[`<Card /> should render Card components 1`] = `
9292
tagName="div"
9393
>
9494
<Tag
95-
className="emotion-0 emotion-1"
95+
className="css-rkvmzw-StyledTag emotion-0"
9696
padding="xl"
9797
tagName="div"
9898
>
9999
<div
100-
className="emotion-0 emotion-1"
100+
className="css-rkvmzw-StyledTag emotion-0"
101101
>
102102
Footer
103103
</div>

src/components/Checkbox/Checkbox.stories.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
// @flow
22

33
import React, { Component } from 'react';
4-
import styled from 'react-emotion';
4+
import styled from '@emotion/styled';
55

66
const Container = styled('div')`
77
max-width: 100px;
@@ -66,7 +66,7 @@ class CheckboxInderteminateState extends Component<*, Object> {
6666
export default (asStory: *) => {
6767
asStory('Components/Checkbox', module, (story, { Checkbox, Column }) => {
6868
story
69-
.add('commmon', () => (
69+
.add('common', () => (
7070
<Column>
7171
<Checkbox checked />
7272
<Checkbox label="Without Check" />

0 commit comments

Comments
 (0)