Skip to content

Commit 5879dfc

Browse files
author
junbao
committed
fix(misc): upgrade deps
1 parent de3b10d commit 5879dfc

File tree

7 files changed

+2872
-2925
lines changed

7 files changed

+2872
-2925
lines changed

compare/output_babel.js

Lines changed: 20 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -5,30 +5,31 @@
55
import React from 'react';
66
import styled, { createGlobalStyle, css, keyframes } from 'styled-components';
77

8-
const Base = (props) => React.createElement('div', null, props.name);
8+
const Base = (props) =>
9+
/*#__PURE__*/ React.createElement('div', null, props.name);
910

1011
export const Styled = [
1112
styled.div.withConfig({
1213
displayName: 'source__Styled',
13-
componentId: 'sc-1tkkdbu-0',
14+
componentId: 'tscp__sc-1tkkdbu-0',
1415
})(['display:block;background:', ';color:white;'], () => 'black'),
1516
styled(Base).withConfig({
1617
displayName: 'source__Styled',
17-
componentId: 'sc-1tkkdbu-1',
18+
componentId: 'tscp__sc-1tkkdbu-1',
1819
})(['display:block;background:', ';color:white;'], () => 'black'),
1920
];
20-
export const cssFragment = css(
21+
export const cssFragment = /*#__PURE__*/ css(
2122
['display:block;background:', ';color:white;'],
2223
() => 'black',
2324
);
24-
export const GlobalStyle = createGlobalStyle`
25+
export const GlobalStyle = /*#__PURE__*/ createGlobalStyle`
2526
div{
2627
display: block;
2728
background: ${() => 'black'};
2829
color: white;
2930
}
3031
`;
31-
export const Keyframe = keyframes(
32+
export const Keyframe = /*#__PURE__*/ keyframes(
3233
['0%{display:block;background:', ';color:white;}'],
3334
'black',
3435
);
@@ -39,39 +40,39 @@ export const WithAttrs = [
3940
})
4041
.withConfig({
4142
displayName: 'source__WithAttrs',
42-
componentId: 'sc-1tkkdbu-2',
43+
componentId: 'tscp__sc-1tkkdbu-2',
4344
})(['display:block;background:', ';color:white;'], () => 'black'),
4445
styled(Base)
4546
.attrs({
4647
id: 'id',
4748
})
4849
.withConfig({
4950
displayName: 'source__WithAttrs',
50-
componentId: 'sc-1tkkdbu-3',
51+
componentId: 'tscp__sc-1tkkdbu-3',
5152
})(['display:block;background:', ';color:white;'], () => 'black'),
5253
];
5354
export const StyleObject = [
5455
styled.div.withConfig({
5556
displayName: 'source__StyleObject',
56-
componentId: 'sc-1tkkdbu-4',
57+
componentId: 'tscp__sc-1tkkdbu-4',
5758
})({
5859
background: '#FFFFFF',
5960
}),
6061
styled(Base).withConfig({
6162
displayName: 'source__StyleObject',
62-
componentId: 'sc-1tkkdbu-5',
63+
componentId: 'tscp__sc-1tkkdbu-5',
6364
})({
6465
background: '#FFFFFF',
6566
}),
6667
];
6768
export const CastProps = [
6869
styled.div.withConfig({
6970
displayName: 'source__CastProps',
70-
componentId: 'sc-1tkkdbu-6',
71+
componentId: 'tscp__sc-1tkkdbu-6',
7172
})(['display:block;background:', ';color:white;'], () => 'black'),
7273
styled(Base).withConfig({
7374
displayName: 'source__CastProps',
74-
componentId: 'sc-1tkkdbu-7',
75+
componentId: 'tscp__sc-1tkkdbu-7',
7576
})(['display:block;background:', ';color:white;'], () => 'black'),
7677
];
7778
export const CastFactory = [
@@ -80,7 +81,7 @@ export const CastFactory = [
8081
background: ${() => 'black'};
8182
color: white;
8283
`,
83-
styled(Base)`
84+
/*#__PURE__*/ styled(Base)`
8485
display: block;
8586
background: ${() => 'black'};
8687
color: white;
@@ -89,16 +90,16 @@ export const CastFactory = [
8990
export const CastAll = [
9091
styled.div.withConfig({
9192
displayName: 'source__CastAll',
92-
componentId: 'sc-1tkkdbu-8',
93+
componentId: 'tscp__sc-1tkkdbu-8',
9394
})(['display:block;background:', ';color:white;'], () => 'black'),
9495
styled(Base).withConfig({
9596
displayName: 'source__CastAll',
96-
componentId: 'sc-1tkkdbu-9',
97+
componentId: 'tscp__sc-1tkkdbu-9',
9798
})(['display:block;background:', ';color:white;'], () => 'black'),
9899
];
99-
export const TestBabelMinify = styled.div.withConfig({
100+
export const TestBabelMinify = /*#__PURE__*/ styled.div.withConfig({
100101
displayName: 'source__TestBabelMinify',
101-
componentId: 'sc-1tkkdbu-10',
102+
componentId: 'tscp__sc-1tkkdbu-10',
102103
})(
103104
[
104105
".p0{content:'first raw';}.p1{content:",
@@ -108,7 +109,7 @@ export const TestBabelMinify = styled.div.withConfig({
108109
() => 'first span',
109110
() => 'second span',
110111
);
111-
export const TestBabelMinifyOnce = styled.div.withConfig({
112+
export const TestBabelMinifyOnce = /*#__PURE__*/ styled.div.withConfig({
112113
displayName: 'source__TestBabelMinifyOnce',
113-
componentId: 'sc-1tkkdbu-11',
114+
componentId: 'tscp__sc-1tkkdbu-11',
114115
})(["content:'raw ';"]);

compare/output_legacy_typescript.js

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
*/
55
import React from 'react';
66
import styled, { createGlobalStyle, css, keyframes } from 'styled-components';
7-
87
const Base = (props) => React.createElement('div', null, props.name);
98
export const Styled = [
109
styled.div`
@@ -80,7 +79,7 @@ export const CastAll = [
8079
];
8180
export const TestBabelMinify = styled.div.withConfig({
8281
displayName: 'TestBabelMinify',
83-
componentId: 'sc-7lw2b9',
82+
componentId: 'sc-12zezc7',
8483
})`
8584
.p0 {
8685
content: 'first raw';
@@ -99,7 +98,7 @@ export const TestBabelMinify = styled.div.withConfig({
9998
`;
10099
export const TestBabelMinifyOnce = styled.div.withConfig({
101100
displayName: 'TestBabelMinifyOnce',
102-
componentId: 'sc-1d3sax',
101+
componentId: 'sc-1oepzb3',
103102
})`
104103
content: 'raw
105104
';

compare/output_typescript.js

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,9 @@
44
*/
55
import React from 'react';
66
import styled, { createGlobalStyle, css, keyframes } from 'styled-components';
7-
87
const Base = (props) => React.createElement('div', null, props.name);
98
export const Styled = [
10-
styled.div.withConfig({
11-
componentId: 'sc-2mrASk',
12-
displayName: 'Styled',
13-
})`
9+
styled.div.withConfig({ componentId: 'sc-2mrASk', displayName: 'Styled' })`
1410
display: block;
1511
background: ${() => 'black'};
1612
color: white;
@@ -33,10 +29,12 @@ export const GlobalStyle = createGlobalStyle`div{display:block;background:${() =
3329
'black'};color:white;}`;
3430
export const Keyframe = keyframes`0%{display:block;background:${'black'};color:white;}`;
3531
export const WithAttrs = [
36-
styled.div.attrs({ id: 'id' }).withConfig({
37-
componentId: 'sc-2mrASk-2',
38-
displayName: 'WithAttrs',
39-
})`display:block;background:${() => 'black'};color:white;`,
32+
styled.div
33+
.attrs({ id: 'id' })
34+
.withConfig({
35+
componentId: 'sc-2mrASk-2',
36+
displayName: 'WithAttrs',
37+
})`display:block;background:${() => 'black'};color:white;`,
4038
styled(Base)
4139
.attrs({ id: 'id' })
4240
.withConfig({

compare/source.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import styled, {
1010
keyframes,
1111
StyledComponent,
1212
StyledFunction,
13+
ThemedStyledFunction,
1314
} from 'styled-components';
1415

1516
interface Props {
@@ -85,7 +86,7 @@ export const CastProps = [
8586
];
8687

8788
export const CastFactory = [
88-
(styled.div as StyledFunction<ComponentClass<Props>>)`
89+
(styled.div as ThemedStyledFunction<'div', Props>)`
8990
display: block;
9091
background: ${() => 'black'};
9192
color: white;

package.json

Lines changed: 37 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "typescript-styled-components-plugin",
3-
"version": "1.1.2",
3+
"version": "1.1.3",
44
"description": "A styled-components plugin to minify & set componentId & displayName for typescript",
55
"author": "acrazing <joking.young@gmail.com>",
66
"main": "lib/index.js",
@@ -49,33 +49,33 @@
4949
},
5050
"license": "UNLICENSED",
5151
"devDependencies": {
52-
"@babel/cli": "^7.6.4",
53-
"@babel/core": "^7.6.4",
54-
"@babel/preset-env": "^7.6.3",
55-
"@babel/preset-react": "^7.6.3",
56-
"@babel/preset-typescript": "^7.6.0",
57-
"@types/jest": "^24.0.20",
58-
"@types/node": "^12.11.7",
59-
"@types/react": "^16.9.11",
60-
"@types/styled-components": "4.1.8",
61-
"babel-plugin-styled-components": "^1.10.6",
62-
"husky": "^3.0.9",
63-
"jest": "^24.9.0",
64-
"lint-staged": "^9.4.2",
52+
"@babel/cli": "^7.11.6",
53+
"@babel/core": "^7.11.6",
54+
"@babel/preset-env": "^7.11.5",
55+
"@babel/preset-react": "^7.10.4",
56+
"@babel/preset-typescript": "^7.10.4",
57+
"@types/jest": "^26.0.13",
58+
"@types/node": "^14.10.1",
59+
"@types/react": "^16.9.49",
60+
"@types/styled-components": "5.1.3",
61+
"babel-plugin-styled-components": "^1.11.1",
62+
"husky": "^4.3.0",
63+
"jest": "^26.4.2",
64+
"lint-staged": "^10.3.0",
6565
"npm-run-all": "^4.1.5",
66-
"prettier": "^1.18.2",
67-
"styled-components": "^4.4.0",
68-
"ts-jest": "^24.1.0",
69-
"ttypescript": "^1.5.7",
70-
"typescript-plugin-styled-components": "^1.4.3"
66+
"prettier": "^2.1.1",
67+
"styled-components": "^5.2.0",
68+
"ts-jest": "^26.3.0",
69+
"ttypescript": "^1.5.12",
70+
"typescript-plugin-styled-components": "^1.4.4"
7171
},
7272
"dependencies": {
73-
"@types/lodash": "^4.14.144",
73+
"@types/lodash": "^4.14.161",
7474
"@types/murmurhash": "^0.0.1",
75-
"lodash": "^4.17.15",
76-
"murmurhash": "^0.0.2",
77-
"tslib": "^1.10.0",
78-
"typescript": "^3.6.4"
75+
"lodash": "^4.17.20",
76+
"murmurhash": "^1.0.0",
77+
"tslib": "^2.0.1",
78+
"typescript": "^4.0.2"
7979
},
8080
"cliVersion": "8.11.1",
8181
"husky": {
@@ -85,8 +85,7 @@
8585
},
8686
"lint-staged": {
8787
"*.{js,jsx,ts,tsx,json,css,less,scss,md}": [
88-
"prettier --write",
89-
"git add"
88+
"prettier --write"
9089
]
9190
},
9291
"prettier": {
@@ -153,7 +152,18 @@
153152
]
154153
],
155154
"plugins": [
156-
"babel-plugin-styled-components"
155+
[
156+
"babel-plugin-styled-components",
157+
{
158+
"ssr": true,
159+
"displayName": true,
160+
"fileName": true,
161+
"minify": true,
162+
"transpileTemplateLiterals": true,
163+
"pure": true,
164+
"namespace": "tscp"
165+
}
166+
]
157167
]
158168
}
159169
}

tsconfig.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,8 @@
3838
"allowUnreachableCode": false,
3939
"stripInternal": true,
4040
"allowUnusedLabels": false,
41-
"plugins": []
41+
"plugins": [],
42+
"skipLibCheck": true
4243
},
4344
"include": ["./src/**/*.d.ts", "./src/**/*.ts", "./src/**/*.tsx"]
4445
}

0 commit comments

Comments
 (0)