Skip to content
This repository was archived by the owner on Dec 26, 2022. It is now read-only.

Commit 36488ee

Browse files
committed
🆕 Dependency Upgrade to latest
1 parent 6a10c52 commit 36488ee

File tree

8 files changed

+4788
-4540
lines changed

8 files changed

+4788
-4540
lines changed

‎.husky/pre-commit‎

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
#!/bin/sh
22
. "$(dirname "$0")/_/husky.sh"
33

4-
yarn lint
5-
yarn format
4+
./node_modules/.bin/lint-staged

‎package.json‎

Lines changed: 33 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,20 @@
2929
"upgrade:package": "npx npm-check-updates -u && yarn",
3030
"prepare": "husky install"
3131
},
32+
"lint-staged": {
33+
"*.{js,jsx,ts,tsx,scss,css}": "yarn lint"
34+
},
3235
"dependencies": {
3336
"@babel/core": "^7.15.5",
3437
"@babel/plugin-transform-runtime": "^7.14.2",
3538
"@babel/preset-env": "^7.15.6",
3639
"@babel/preset-react": "^7.13.13",
3740
"@babel/preset-typescript": "^7.13.0",
3841
"@babel/runtime": "^7.14.0",
39-
"@svgr/webpack": "^5.5.0",
42+
"@svgr/webpack": "^6.2.1",
4043
"babel-loader": "^8.2.2",
41-
"babel-plugin-styled-components": "1.13.2",
42-
"copy-webpack-plugin": "^9.0.1",
44+
"babel-plugin-styled-components": "2.0.6",
45+
"copy-webpack-plugin": "^10.2.4",
4346
"cross-env": "^7.0.3",
4447
"css-loader": "^6.2.0",
4548
"dotenv-webpack": "^7.0.2",
@@ -54,51 +57,62 @@
5457
"webpack-cli": "^4.7.0"
5558
},
5659
"devDependencies": {
57-
"@pmmmwh/react-refresh-webpack-plugin": "^0.4.3",
58-
"@storybook/addon-essentials": "^6.3.8",
60+
"@pmmmwh/react-refresh-webpack-plugin": "^0.5.4",
5961
"@storybook/addon-actions": "^6.3.8",
62+
"@storybook/addon-essentials": "^6.3.8",
6063
"@storybook/addon-links": "^6.3.8",
6164
"@storybook/builder-webpack5": "^6.3.8",
62-
"@storybook/components": "6.3.8",
65+
"@storybook/components": "6.4.19",
6366
"@storybook/manager-webpack5": "^6.3.8",
6467
"@storybook/react": "^6.3.8",
6568
"@storybook/theming": "^6.3.8",
6669
"@testing-library/jest-dom": "^5.12.0",
6770
"@testing-library/react": "^12.0.0",
68-
"@types/copy-webpack-plugin": "^8.0.1",
71+
"@types/copy-webpack-plugin": "^10.1.0",
6972
"@types/dotenv-webpack": "^7.0.3",
7073
"@types/html-webpack-plugin": "^3.2.6",
7174
"@types/jest": "^27.0.1",
7275
"@types/mini-css-extract-plugin": "^2.2.0",
73-
"@types/node": "^16.9.1",
76+
"@types/node": "^17.0.21",
7477
"@types/react": "^17.0.20",
7578
"@types/react-dom": "^17.0.5",
7679
"@types/styled-components": "^5.1.14",
7780
"@types/testing-library__jest-dom": "^5.14.1",
7881
"@types/webpack-dev-server": "^4.1.0",
79-
"@typescript-eslint/eslint-plugin": "^4.31.0",
80-
"@typescript-eslint/parser": "^4.31.0",
81-
"eslint": "^7.26.0",
82-
"eslint-config-airbnb": "^18.2.1",
82+
"@typescript-eslint/eslint-plugin": "^5.13.0",
83+
"@typescript-eslint/parser": "^5.13.0",
84+
"eslint": "^8.10.0",
85+
"eslint-config-airbnb": "^19.0.4",
8386
"eslint-config-prettier": "^8.3.0",
8487
"eslint-plugin-import": "^2.23.1",
85-
"eslint-plugin-jest": "^24.3.6",
88+
"eslint-plugin-jest": "^26.1.1",
8689
"eslint-plugin-jsx-a11y": "^6.4.1",
8790
"eslint-plugin-prettier": "^4.0.0",
8891
"eslint-plugin-react": "^7.23.2",
8992
"eslint-plugin-react-hooks": "^4.2.0",
93+
"eslint-plugin-sonarjs": "0.12.0",
94+
"fork-ts-checker-webpack-plugin": "^7.2.1",
9095
"husky": "^7.0.2",
9196
"jest": "^27.1.1",
92-
"lint-staged": "^11.0.0",
93-
"netlify-cli": "^6.8.12",
97+
"lint-staged": "^12.3.4",
98+
"netlify-cli": "^9.9.0",
9499
"prettier": "^2.4.0",
95-
"react-refresh": "^0.9.0",
100+
"react-refresh": "^0.11.0",
96101
"style-loader": "^3.2.1",
97102
"ts-jest": "^27.0.5",
98-
"eslint-plugin-sonarjs": "0.10.0",
99103
"ts-node": "^10.2.1",
100104
"webpack-bundle-analyzer": "^4.4.2",
101-
"webpack-dev-server": "^4.2.0",
102-
"fork-ts-checker-webpack-plugin": "^6.3.3"
105+
"webpack-dev-server": "^4.2.0"
106+
},
107+
"browserslist": {
108+
"development": [
109+
"last 1 chrome version",
110+
"last 1 firefox version",
111+
"last 1 edge version",
112+
"last 1 safari version"
113+
],
114+
"production": [
115+
"supports es6-module"
116+
]
103117
}
104118
}

‎src/App.tsx‎

Lines changed: 20 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,24 @@
1-
import React, { FC } from 'react';
1+
import React from 'react';
22
import { Container, Header, Image, Link } from 'styles/App.style';
33
import logo from 'assets/png/logo512.png';
44
import GlobalStyle from 'styles/globalStyles';
5-
import Counter from 'components/Counter';
65

7-
const App: FC = () => (
8-
<div>
9-
<GlobalStyle />
10-
<Container>
11-
<Header>
12-
<h2>React TypeScript Starter Template</h2>
13-
<Image src={logo} alt="logo" />
14-
<p>
15-
Edit <code>src/App.tsx</code> and save to reload.
16-
</p>
17-
<Link href="https://reactjs.org" target="_blank" rel="noopener noreferrer">
18-
Learn React
19-
</Link>
20-
</Header>
21-
<Counter />
22-
</Container>
23-
</div>
24-
);
25-
26-
export default App;
6+
export default function App() {
7+
return (
8+
<div>
9+
<GlobalStyle />
10+
<Container>
11+
<Header>
12+
<h2>React TypeScript Starter Template</h2>
13+
<Image src={logo} alt="logo" />
14+
<p>
15+
Edit <code>src/App.tsx</code> and save to reload.
16+
</p>
17+
<Link href="https://reactjs.org" target="_blank" rel="noopener noreferrer">
18+
Learn React
19+
</Link>
20+
</Header>
21+
</Container>
22+
</div>
23+
);
24+
}

‎src/components/Counter/index.tsx‎

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ export interface CounterProps {
77
height?: number;
88
}
99

10-
const Counter: FC<CounterProps> = ({ ...rest }) => {
10+
export default function Counter({ ...rest }: CounterProps) {
1111
const [count, setCount] = useState(0);
1212
return (
1313
<Container {...rest} data-testid="component">
@@ -19,6 +19,8 @@ const Counter: FC<CounterProps> = ({ ...rest }) => {
1919
<img src={logo} alt="Logo" srcSet="" />
2020
</Container>
2121
);
22-
};
22+
}
2323

24-
export default Counter;
24+
Counter.defaultProps = {
25+
height: 0,
26+
};

‎src/stories/Counter.stories.tsx‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,9 @@ export default {
99
component: Counter,
1010
};
1111

12-
const Template: Story = (args) => <Counter {...args} />;
12+
const Template: Story = function Count(args) {
13+
return <Counter {...args} />;
14+
};
1315

1416
export const CounterStory = Template.bind({});
1517

‎src/utils/test-utils.tsx‎

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
1-
import React, { FC, ReactElement } from 'react';
1+
import React, { ReactElement } from 'react';
22
import { render, RenderOptions } from '@testing-library/react';
33
// import '@testing-library/jest-dom/extend-expect';
44

5-
const AllTheProviders: FC = ({ children }) => <div>{children}</div>;
5+
function AllTheProviders({ children }: { children: ReactElement }) {
6+
return <div>{children}</div>;
7+
}
68

79
const customRender = (ui: ReactElement, options?: Omit<RenderOptions, 'queries'>) =>
810
render(ui, { wrapper: AllTheProviders, ...options });

‎webpack.config.ts‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -48,11 +48,9 @@ export default ({ env }: { env: string }) => {
4848
const ForkTS = new ForkTsCheckerWebpackPlugin({
4949
async: isEnvDevelopment,
5050
typescript: {
51-
enabled: true,
5251
configFile: path.join(__dirname, 'tsconfig.json'),
5352
mode: 'write-references',
5453
},
55-
logger: { infrastructure: 'webpack-infrastructure', issues: 'console', devServer: true },
5654
});
5755

5856
return {
@@ -85,11 +83,8 @@ export default ({ env }: { env: string }) => {
8583
},
8684
},
8785
devServer: {
88-
static: {
89-
directory: path.join(__dirname, 'build'),
90-
},
91-
devMiddleware: { publicPath: path.join(__dirname, 'public') },
9286
port: 3000,
87+
historyApiFallback: true,
9388
} as DevServer,
9489
module: {
9590
rules: [

0 commit comments

Comments
 (0)