Skip to content

Commit 66597ca

Browse files
committed
Upgrade TS version to 3.4.5
1 parent 304253e commit 66597ca

File tree

9 files changed

+121
-28
lines changed

9 files changed

+121
-28
lines changed

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,8 +36,8 @@
3636
"@types/snakecase-keys": "^2.1.0",
3737
"@types/styled-components": "^4.1.14",
3838
"@types/turndown": "^5.0.0",
39-
"@typescript-eslint/eslint-plugin": "^1.7.0",
40-
"@typescript-eslint/parser": "^1.7.0",
39+
"@typescript-eslint/eslint-plugin": "^1.9.0",
40+
"@typescript-eslint/parser": "^1.9.0",
4141
"apollo-boost": "^0.1.28",
4242
"axios": "^0.18.0",
4343
"babel-core": "7.0.0-bridge.0",
@@ -123,7 +123,7 @@
123123
"tslint-config-prettier": "^1.18.0",
124124
"turndown": "^5.0.3",
125125
"typesafe-actions": "^3.2.1",
126-
"typescript": "3.3.3",
126+
"typescript": "3.4.5",
127127
"unist-util-visit": "^1.4.0",
128128
"url-loader": "1.1.2",
129129
"webpack": "4.28.3",

src/components/common/PasteUpload.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,10 @@ export interface PasteUploadProps {
77
const PasteUpload: React.FC<PasteUploadProps> = ({ onUpload }) => {
88
useEffect(() => {
99
const onPaste: EventListener = e => {
10-
const { items } = (e as ClipboardEvent).clipboardData;
10+
const { clipboardData } = e as ClipboardEvent;
11+
if (!clipboardData) return;
12+
13+
const { items } = clipboardData;
1114
if (items.length === 0) return;
1215

1316
const itemsArray = (() => {

src/components/velog/VelogPageTemplate.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ const VelogPageTemplateBlock = styled(PageTemplate)``;
66

77
export interface VelogPageTemplateProps {}
88

9-
const VelogPageTemplate: React.FC<VelogPageTemplateProps> = props => {
10-
return <VelogPageTemplateBlock />;
9+
const VelogPageTemplate: React.FC<VelogPageTemplateProps> = ({ children }) => {
10+
return <VelogPageTemplateBlock>{children}</VelogPageTemplateBlock>;
1111
};
1212

1313
export default VelogPageTemplate;

src/containers/velog/ConfigLoader.tsx

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
import * as React from 'react';
2+
import { Query, QueryResult } from 'react-apollo';
3+
import { GET_VELOG_CONFIG, VelogConfig } from '../../lib/graphql/user';
4+
5+
export interface ConfigLoaderProps {
6+
username: string;
7+
}
8+
9+
const ConfigLoader: React.FC<ConfigLoaderProps> = ({ username }) => {
10+
return (
11+
<Query query={GET_VELOG_CONFIG} variables={{ username }}>
12+
{(result: QueryResult<{ velog_config: VelogConfig }>) => {
13+
// console.log(result);
14+
return null;
15+
}}
16+
</Query>
17+
);
18+
};
19+
20+
export default ConfigLoader;
Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
import * as React from 'react';
2+
import { render } from 'react-testing-library';
3+
import ConfigLoader, { ConfigLoaderProps } from '../ConfigLoader';
4+
import { MockedProvider } from 'react-apollo/test-utils';
5+
import { GET_VELOG_CONFIG } from '../../../lib/graphql/user';
6+
7+
describe('ConfigLoader', () => {
8+
const setup = (props: Partial<ConfigLoaderProps> = {}) => {
9+
const initialProps: ConfigLoaderProps = { username: 'velopert' };
10+
const mocks = [
11+
{
12+
request: GET_VELOG_CONFIG,
13+
variables: {
14+
name: 'velopert',
15+
},
16+
result: {
17+
data: {
18+
title: 'VELOPERT.LOG',
19+
logo_image: null,
20+
},
21+
},
22+
},
23+
];
24+
const utils = render(
25+
<MockedProvider mocks={mocks}>
26+
<ConfigLoader {...initialProps} {...props} />
27+
</MockedProvider>,
28+
);
29+
return {
30+
...utils,
31+
};
32+
};
33+
it('renders properly', () => {
34+
setup();
35+
});
36+
it('matches snapshot', () => {
37+
const { container } = setup();
38+
expect(container).toMatchSnapshot();
39+
});
40+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
// Jest Snapshot v1, https://goo.gl/fbAQLP
2+
3+
exports[`ConfigLoader matches snapshot 1`] = `<div />`;

src/lib/graphql/user.ts

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,15 @@ export const GET_CURRENT_USER = gql`
3434
}
3535
`;
3636

37+
export const GET_VELOG_CONFIG = gql`
38+
query VelogConfig($username: String) {
39+
velog_config(username: $username) {
40+
title
41+
logo_image
42+
}
43+
}
44+
`;
45+
3746
export type CurrentUser = {
3847
id: string;
3948
username: string;

src/pages/velog/VelogPage.tsx

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,19 @@
11
import * as React from 'react';
22
import VelogPageTemplate from '../../components/velog/VelogPageTemplate';
3+
import { RouteComponentProps } from 'react-router';
4+
import ConfigLoader from '../../containers/velog/ConfigLoader';
35

4-
export interface VelogPageProps {}
6+
export interface VelogPageProps
7+
extends RouteComponentProps<{
8+
username: string;
9+
}> {}
510

6-
const VelogPage: React.FC<VelogPageProps> = props => {
7-
return <VelogPageTemplate>HeyThere</VelogPageTemplate>;
11+
const VelogPage: React.FC<VelogPageProps> = ({ match }) => {
12+
return (
13+
<VelogPageTemplate>
14+
<ConfigLoader username={match.params.username} />
15+
</VelogPageTemplate>
16+
);
817
};
918

1019
export default VelogPage;

yarn.lock

Lines changed: 28 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1376,31 +1376,40 @@
13761376
resolved "https://registry.yarnpkg.com/@types/zen-observable/-/zen-observable-0.8.0.tgz#8b63ab7f1aa5321248aad5ac890a485656dcea4d"
13771377
integrity sha512-te5lMAWii1uEJ4FwLjzdlbw3+n0FZNOvFXHxQDKeT0dilh7HOzdMzV2TrJVUzq8ep7J4Na8OUYPRLSQkJHAlrg==
13781378

1379-
"@typescript-eslint/eslint-plugin@^1.7.0":
1380-
version "1.7.0"
1381-
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.7.0.tgz#570e45dc84fb97852e363f1e00f47e604a0b8bcc"
1382-
integrity sha512-NUSz1aTlIzzTjFFVFyzrbo8oFjHg3K/M9MzYByqbMCxeFdErhLAcGITVfXzSz+Yvp5OOpMu3HkIttB0NyKl54Q==
1379+
"@typescript-eslint/eslint-plugin@^1.9.0":
1380+
version "1.9.0"
1381+
resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-1.9.0.tgz#29d73006811bf2563b88891ceeff1c5ea9c8d9c6"
1382+
integrity sha512-FOgfBorxjlBGpDIw+0LaZIXRX6GEEUfzj8LXwaQIUCp+gDOvkI+1WgugJ7SmWiISqK9Vj5r8S7NDKO/LB+6X9A==
13831383
dependencies:
1384-
"@typescript-eslint/parser" "1.7.0"
1385-
"@typescript-eslint/typescript-estree" "1.7.0"
1384+
"@typescript-eslint/experimental-utils" "1.9.0"
1385+
"@typescript-eslint/parser" "1.9.0"
13861386
eslint-utils "^1.3.1"
1387+
functional-red-black-tree "^1.0.1"
13871388
regexpp "^2.0.1"
13881389
requireindex "^1.2.0"
13891390
tsutils "^3.7.0"
13901391

1391-
"@typescript-eslint/[email protected]", "@typescript-eslint/parser@^1.7.0":
1392-
version "1.7.0"
1393-
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.7.0.tgz#c3ea0d158349ceefbb6da95b5b09924b75357851"
1394-
integrity sha512-1QFKxs2V940372srm12ovSE683afqc1jB6zF/f8iKhgLz1yoSjYeGHipasao33VXKI+0a/ob9okeogGdKGvvlg==
1392+
"@typescript-eslint/[email protected].0":
1393+
version "1.9.0"
1394+
resolved "https://registry.yarnpkg.com/@typescript-eslint/experimental-utils/-/experimental-utils-1.9.0.tgz#a92777d0c92d7bc8627abd7cdb06cdbcaf2b39e8"
1395+
integrity sha512-1s2dY9XxBwtS9IlSnRIlzqILPyeMly5tz1bfAmQ84Ul687xBBve5YsH5A5EKeIcGurYYqY2w6RkHETXIwnwV0A==
13951396
dependencies:
1396-
"@typescript-eslint/typescript-estree" "1.7.0"
1397+
"@typescript-eslint/typescript-estree" "1.9.0"
1398+
1399+
"@typescript-eslint/[email protected]", "@typescript-eslint/parser@^1.9.0":
1400+
version "1.9.0"
1401+
resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-1.9.0.tgz#5796cbfcb9a3a5757aeb671c1ac88d7a94a95962"
1402+
integrity sha512-CWgC1XrQ34H/+LwAU7vY5xteZDkNqeAkeidEpJnJgkKu0yqQ3ZhQ7S+dI6MX4vmmM1TKRbOrKuXc6W0fIHhdbA==
1403+
dependencies:
1404+
"@typescript-eslint/experimental-utils" "1.9.0"
1405+
"@typescript-eslint/typescript-estree" "1.9.0"
13971406
eslint-scope "^4.0.0"
13981407
eslint-visitor-keys "^1.0.0"
13991408

1400-
"@typescript-eslint/typescript-estree@1.7.0":
1401-
version "1.7.0"
1402-
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.7.0.tgz#59ec02f5371964da1cc679dba7b878a417bc8c60"
1403-
integrity sha512-K5uedUxVmlYrVkFbyV3htDipvLqTE3QMOUQEHYJaKtgzxj6r7c5Ca/DG1tGgFxX+fsbi9nDIrf4arq7Ib7H/Yw==
1409+
"@typescript-eslint/typescript-estree@1.9.0":
1410+
version "1.9.0"
1411+
resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-1.9.0.tgz#5d6d49be936e96fb0f859673480f89b070a5dd9b"
1412+
integrity sha512-7Eg0TEQpCkTsEwsl1lIzd6i7L3pJLQFWesV08dS87bNz0NeSjbL78gNAP1xCKaCejkds4PhpLnZkaAjx9SU8OA==
14041413
dependencies:
14051414
lodash.unescape "4.0.1"
14061415
semver "5.5.0"
@@ -11432,10 +11441,10 @@ typesafe-actions@^3.2.1:
1143211441
resolved "https://registry.yarnpkg.com/typesafe-actions/-/typesafe-actions-3.2.1.tgz#833623a4079eda5dbcb775113f6dcf02b71c03f8"
1143311442
integrity sha512-hvhuNqsai6LzXQ+Hl6vajC9bGd/kHHL1hJvI4GQ0Rs6Fax1cjbNEsuFGy/RbfLPhBAL10n6DECEHUa+Q9E+MxQ==
1143411443

11435-
typescript@3.3.3:
11436-
version "3.3.3"
11437-
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.3.3.tgz#f1657fc7daa27e1a8930758ace9ae8da31403221"
11438-
integrity sha512-Y21Xqe54TBVp+VDSNbuDYdGw0BpoR/Q6wo/+35M8PAU0vipahnyduJWirxxdxjsAkS7hue53x2zp8gz7F05u0A==
11444+
typescript@3.4.5:
11445+
version "3.4.5"
11446+
resolved "https://registry.yarnpkg.com/typescript/-/typescript-3.4.5.tgz#2d2618d10bb566572b8d7aad5180d84257d70a99"
11447+
integrity sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==
1143911448

1144011449
ua-parser-js@^0.7.18:
1144111450
version "0.7.19"

0 commit comments

Comments
 (0)