Skip to content

Commit 1f99d5d

Browse files
authored
chore: update deps (#17)
1 parent 4fd7f44 commit 1f99d5d

25 files changed

+5797
-6079
lines changed

.eslintrc.production.js

+54-12
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,73 @@
11
module.exports = {
2+
root: true,
3+
parser: '@typescript-eslint/parser',
4+
reportUnusedDisableDirectives: true,
5+
plugins: [
6+
'react',
7+
'prettier',
8+
'jest',
9+
'react-hooks',
10+
'import',
11+
'testing-library',
12+
'testcafe',
13+
'@typescript-eslint',
14+
],
215
extends: [
316
'eslint:recommended',
4-
'plugin:react/recommended',
5-
'plugin:@typescript-eslint/recommended',
6-
'prettier/@typescript-eslint',
7-
'plugin:prettier/recommended',
17+
'airbnb',
18+
'prettier',
19+
'prettier/react',
20+
'plugin:jest/recommended',
21+
'plugin:testing-library/react',
822
'plugin:testcafe/recommended',
23+
'plugin:@typescript-eslint/recommended',
924
],
10-
plugins: ['react', '@typescript-eslint', 'prettier', 'testcafe'],
1125
env: {
1226
browser: true,
1327
jest: true,
1428
node: true,
1529
es6: true,
1630
},
1731
rules: {
18-
'@typescript-eslint/explicit-function-return-type': ['off'],
32+
'arrow-body-style': ['off'],
33+
'react/jsx-filename-extension': [1, { extensions: ['.tsx'] }],
34+
'no-use-before-define': ['off'],
35+
36+
'jsx-a11y/anchor-is-valid': ['off'],
37+
38+
'jest/expect-expect': ['off'],
39+
40+
'import/no-unresolved': ['off'],
41+
'import/no-extraneous-dependencies': ['off'],
42+
'import/extensions': ['off'],
43+
'import/prefer-default-export': ['off'],
44+
'import/order': [
45+
1,
46+
{
47+
'newlines-between': 'always',
48+
groups: [
49+
'builtin',
50+
['external', 'internal'],
51+
'parent',
52+
['sibling', 'index'],
53+
],
54+
},
55+
],
56+
57+
'@typescript-eslint/explicit-module-boundary-types': 'off',
1958
'@typescript-eslint/no-unused-vars': [
2059
'error',
2160
{ argsIgnorePattern: '^_', varsIgnorePattern: '^_' },
2261
],
2362
},
24-
settings: {
25-
react: {
26-
pragma: 'React',
27-
version: 'detect',
63+
overrides: [
64+
{
65+
files: ['*.e2e.ts'],
66+
rules: {
67+
'jest/expect-expect': ['off'],
68+
'jest/no-test-callback': ['off'],
69+
'jest/no-done-callback': ['off'],
70+
},
2871
},
29-
},
30-
parser: '@typescript-eslint/parser',
72+
],
3173
};

.github/workflows/website.yml

+3-3
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ jobs:
1414
fetch-depth: 1
1515
- uses: actions/setup-node@v1
1616
with:
17-
node-version: '13.x'
17+
node-version: '14.x'
1818
- name: Get yarn cache directory path
1919
id: yarn-cache-dir-path
2020
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -46,7 +46,7 @@ jobs:
4646
fetch-depth: 1
4747
- uses: actions/setup-node@v1
4848
with:
49-
node-version: '13.x'
49+
node-version: '14.x'
5050
- name: Get yarn cache directory path
5151
id: yarn-cache-dir-path
5252
run: echo "::set-output name=dir::$(yarn cache dir)"
@@ -89,7 +89,7 @@ jobs:
8989
fetch-depth: 1
9090
- uses: actions/setup-node@v1
9191
with:
92-
node-version: '12.x'
92+
node-version: '14.x'
9393
- name: Install packages
9494
run: |
9595
yarn install --frozen-lockfile

.prettierrc

+2-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
{
2-
"printWidth": 100,
3-
"semi": true,
4-
"singleQuote": true,
5-
"trailingComma": "es5"
2+
"trailingComma": "es5",
3+
"singleQuote": true
64
}

.storybook/main.js

+5-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
11
module.exports = {
22
stories: ['../src/**/*.stories.tsx'],
3-
addons: ['@storybook/preset-typescript', '@storybook/addon-actions/register'],
3+
addons: [
4+
'@storybook/addon-essentials',
5+
'@storybook/addon-links',
6+
'@storybook/addon-storysource',
7+
],
48
};

.storybook/webpack.config.js

+1-2
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@ const path = require('path');
22

33
module.exports = ({ config }) => {
44
// Required for absolute imports in Storybook
5-
const resolvedModules = config.resolve.modules || [];
6-
config.resolve.modules = [...resolvedModules, path.resolve(process.cwd(), 'src')];
5+
config.resolve.modules.push(path.resolve(process.cwd(), 'src'));
76

87
config.resolve.extensions.push('.ts', '.tsx');
98
return config;

.vscode/settings.json

+10-1
Original file line numberDiff line numberDiff line change
@@ -3,5 +3,14 @@
33
"files.insertFinalNewline": true,
44
"editor.codeActionsOnSave": {
55
"source.fixAll.eslint": true
6-
}
6+
},
7+
"[javascript]": {
8+
"editor.defaultFormatter": "esbenp.prettier-vscode"
9+
},
10+
"[typescript]": {
11+
"editor.defaultFormatter": "esbenp.prettier-vscode"
12+
},
13+
"[typescriptreact]": {
14+
"editor.defaultFormatter": "esbenp.prettier-vscode"
15+
},
716
}

Dockerfile

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM node:13-alpine as build
1+
FROM node:14-alpine as build
22

33
COPY . /src
44
WORKDIR /src
@@ -7,7 +7,7 @@ RUN yarn install --frozen-lockfile
77
RUN yarn build
88
RUN yarn install --frozen-lockfile --production --ignore-scripts --prefer-offline
99

10-
FROM node:13-alpine
10+
FROM node:14-alpine
1111

1212
WORKDIR /usr/app
1313

e2e/specs/HomePage.e2e.ts

+4-1
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,14 @@
1+
import 'testcafe';
12
import { getByText } from '@testing-library/testcafe';
23

34
import config from '../config';
45

56
fixture('<HomePage />').page(config.baseURL);
67

78
test('Can navigate to about page', async (t) => {
8-
await t.expect(getByText('This is our homepage.').exists).ok('Renders HomePage text');
9+
await t
10+
.expect(getByText('This is our homepage.').exists)
11+
.ok('Renders HomePage text');
912

1013
await t
1114
.click(getByText('About Us'))
+6-2
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,17 @@
1-
module.exports = {
1+
import type { Config } from '@jest/types';
2+
3+
const config: Config.InitialOptions = {
24
transform: {
35
'^.+\\.tsx?$': 'ts-jest',
46
},
57
setupFilesAfterEnv: ['<rootDir>/src/setupTests.ts'],
68
globals: {
79
'ts-jest': {
8-
tsConfig: 'tsconfig.jest.json',
10+
tsconfig: 'tsconfig.jest.json',
911
},
1012
},
1113
// Required for absolute imports in Jest
1214
moduleDirectories: ['node_modules', 'src'],
1315
};
16+
17+
export default config;

package.json

+41-33
Original file line numberDiff line numberDiff line change
@@ -28,41 +28,49 @@
2828
"storybook": "start-storybook"
2929
},
3030
"dependencies": {
31-
"ky": "^0.19.0",
32-
"ky-universal": "^0.5.0",
33-
"next": "^9.3.3",
34-
"react": "^16.12.0",
35-
"react-dom": "^16.12.0"
31+
"ky": "0.25.1",
32+
"ky-universal": "0.8.2",
33+
"next": "10.0.3",
34+
"react": "17.0.1",
35+
"react-dom": "17.0.1"
3636
},
3737
"devDependencies": {
38-
"@ffmpeg-installer/ffmpeg": "^1.0.20",
39-
"@storybook/addon-actions": "^5.3.17",
40-
"@storybook/preset-typescript": "^3.0.0",
41-
"@storybook/react": "^5.3.17",
42-
"@testing-library/jest-dom": "^5.0.2",
43-
"@testing-library/react": "^10.0.1",
44-
"@testing-library/testcafe": "^4.0.0",
45-
"@types/jest": "^25.1.4",
46-
"@types/node": "^13.9.8",
47-
"@types/react": "^16.9.19",
48-
"@typescript-eslint/eslint-plugin": "^2.26.0",
49-
"@typescript-eslint/parser": "^2.26.0",
50-
"awesome-typescript-loader": "^5.2.1",
51-
"babel-loader": "^8.1.0",
52-
"concurrently": "^5.0.2",
53-
"eslint": "^6.8.0",
54-
"eslint-config-prettier": "^6.9.0",
55-
"eslint-plugin-prettier": "^3.1.2",
56-
"eslint-plugin-react": "^7.18.0",
57-
"eslint-plugin-testcafe": "^0.2.1",
58-
"jest": "^25.2.4",
59-
"prettier": "^2.0.2",
60-
"serverless": "^1.61.3",
61-
"serverless-next.js": "^1.9.7",
62-
"testcafe": "^1.8.1",
63-
"ts-jest": "^25.3.0",
64-
"typescript": "^3.7.5",
65-
"wait-on": "^4.0.0"
38+
"@ffmpeg-installer/ffmpeg": "1.0.20",
39+
"@storybook/addon-actions": "6.1.10",
40+
"@storybook/addon-links": "6.1.10",
41+
"@storybook/addon-storysource": "6.1.10",
42+
"@storybook/react": "6.1.10",
43+
"@testing-library/jest-dom": "5.11.6",
44+
"@testing-library/react": "11.2.2",
45+
"@testing-library/testcafe": "4.3.1",
46+
"@testing-library/user-event": "12.5.0",
47+
"@types/jest": "26.0.17",
48+
"@types/node": "14.14.11",
49+
"@types/react": "17.0.0",
50+
"@typescript-eslint/eslint-plugin": "4.9.1",
51+
"@typescript-eslint/parser": "4.9.1",
52+
"babel-loader": "8.2.2",
53+
"concurrently": "5.3.0",
54+
"eslint": "7.15.0",
55+
"eslint-config-airbnb": "18.2.1",
56+
"eslint-config-prettier": "7.0.0",
57+
"eslint-plugin-import": "2.22.1",
58+
"eslint-plugin-jest": "24.1.3",
59+
"eslint-plugin-jsx-a11y": "6.4.1",
60+
"eslint-plugin-prettier": "3.2.0",
61+
"eslint-plugin-react": "7.21.5",
62+
"eslint-plugin-react-hooks": "4.2.0",
63+
"eslint-plugin-testcafe": "0.2.1",
64+
"eslint-plugin-testing-library": "3.10.1",
65+
"jest": "26.6.3",
66+
"next-page-tester": "0.10.0",
67+
"prettier": "2.2.1",
68+
"serverless-next.js": "1.14.0",
69+
"testcafe": "1.9.4",
70+
"ts-jest": "26.4.4",
71+
"ts-node": "9.1.1",
72+
"typescript": "4.1.2",
73+
"wait-on": "5.2.0"
6674
},
6775
"husky": {
6876
"hooks": {

src/__tests__/pages/about.spec.ts

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import { getPage } from 'next-page-tester';
2+
import { render, screen } from '@testing-library/react';
3+
import userEvent from '@testing-library/user-event';
4+
5+
describe('/about', () => {
6+
it('Should work', async () => {
7+
const { page } = await getPage({ route: '/about' });
8+
render(page);
9+
10+
expect(screen.getByText('We are a cool company.')).toBeInTheDocument();
11+
expect(
12+
screen.getByText(
13+
'{"userId":1,"id":1,"title":"delectus aut autem","completed":false}'
14+
)
15+
).toBeInTheDocument();
16+
17+
userEvent.click(screen.getByText('Home'));
18+
19+
await screen.findByText('This is our homepage.');
20+
});
21+
});
+4-2
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import React from 'react';
2+
import type { Meta } from '@storybook/react';
23

3-
import AboutUs from './AboutUs';
4+
import { AboutUs } from './AboutUs';
45

56
export default {
67
title: 'AboutUs',
7-
};
8+
component: AboutUs,
9+
} as Meta;
810

911
export const Default = () => <AboutUs />;

src/components/AboutUs/AboutUs.tsx

+1-3
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,10 @@
11
import React from 'react';
22

3-
const About: React.FC = () => {
3+
export const AboutUs = () => {
44
return (
55
<div className="about-us">
66
<h1>About</h1>
77
<p>We are a cool company.</p>
88
</div>
99
);
1010
};
11-
12-
export default About;

src/components/AboutUs/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default } from './AboutUs';
1+
export { AboutUs } from './AboutUs';

src/containers/AboutPage/AboutPage.spec.tsx

-11
This file was deleted.
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
import React from 'react';
2+
import type { Meta } from '@storybook/react';
23

3-
import AboutPage from './AboutPage';
4+
import { AboutPage } from './AboutPage';
45

56
export default {
67
title: 'AboutPage',
7-
};
8+
component: AboutPage,
9+
} as Meta;
810

9-
export const Default = () => <AboutPage todos={{}} />;
11+
export const Default = () => <AboutPage todos={[]} />;

src/containers/AboutPage/AboutPage.tsx

+4-6
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
import React from 'react';
22
import Link from 'next/link';
3-
4-
import AboutUs from 'components/AboutUs';
3+
import { AboutUs } from 'components/AboutUs';
4+
import { Todo } from 'pages/about';
55

66
type Props = {
7-
todos: object;
7+
todos: Todo[];
88
};
99

10-
const About = ({ todos }: Props) => {
10+
export const AboutPage = ({ todos }: Props) => {
1111
return (
1212
<>
1313
<ul>
@@ -26,5 +26,3 @@ const About = ({ todos }: Props) => {
2626
</>
2727
);
2828
};
29-
30-
export default About;

src/containers/AboutPage/index.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
export { default } from './AboutPage';
1+
export { AboutPage } from './AboutPage';

0 commit comments

Comments
 (0)