Skip to content

Commit 3fde902

Browse files
authored
Merge pull request #345 from react-native-community/kelset/bump-tools
chore(dependencies): upgrading the repo to more modern standards
2 parents 6d90cc3 + 6863a24 commit 3fde902

Some content is hidden

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

49 files changed

+6867
-9371
lines changed

config-overrides.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
11
const { override, addBabelPreset } = require('customize-cra')
2-
const { addReactRefresh } = require('customize-cra-react-refresh')
32

4-
module.exports = override(
5-
addBabelPreset('@emotion/babel-preset-css-prop'),
6-
addReactRefresh({ disableRefreshCheck: true })
7-
)
3+
module.exports = override(addBabelPreset('@emotion/babel-preset-css-prop'))

package.json

Lines changed: 53 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,53 @@
11
{
22
"name": "upgrade-helper",
33
"version": "0.1.0",
4-
"homepage": "https://react-native-community.github.io/upgrade-helper",
54
"license": "MIT",
5+
"homepage": "https://react-native-community.github.io/upgrade-helper",
6+
"scripts": {
7+
"build": "EXTEND_ESLINT=true react-app-rewired build",
8+
"docker-test-e2e": "yarn start-and-wait && react-app-rewired test --watchAll=false --onlyChanged=false --testPathPattern='/__tests__/.*(\\.|).e2e.spec.js?$'",
9+
"lint": "eslint . --cache --report-unused-disable-directives",
10+
"prepare": "husky install",
11+
"start": "EXTEND_ESLINT=true react-app-rewired start",
12+
"start-and-wait": "yarn start & wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 30 http://localhost:3000/",
13+
"test": "react-app-rewired test --watchAll=false --onlyChanged=false --testPathPattern='/__tests__/((?!e2e).)*.spec.js?$'",
14+
"test-e2e": "docker-compose run tests"
15+
},
616
"dependencies": {
717
"@ant-design/icons": "4.0.3",
8-
"@emotion/core": "10.0.28",
9-
"@emotion/styled": "10.0.27",
10-
"antd": "4.0.3",
11-
"date-fns": "^2.23.0",
12-
"framer-motion": "^2.0.0-beta.52",
13-
"markdown-to-jsx": "6.11.0",
14-
"query-string": "6.11.1",
18+
"@emotion/react": "^11.10.6",
19+
"@emotion/styled": "^11.10.6",
20+
"antd": "5.2.3",
21+
"date-fns": "^2.29.3",
22+
"framer-motion": "^2.9.5",
23+
"markdown-to-jsx": "7.1.9",
24+
"query-string": "8.1.0",
1525
"react": "18.2.0",
16-
"react-content-loader": "5.0.2",
17-
"react-copy-to-clipboard": "5.0.2",
26+
"react-content-loader": "6.2.0",
27+
"react-copy-to-clipboard": "5.1.0",
1828
"react-diff-view": "2.4.2",
1929
"react-dom": "18.2.0",
20-
"react-dom-confetti": "0.1.3",
21-
"react-ga": "2.7.0",
22-
"react-github-btn": "1.1.1",
23-
"react-scripts": "3.4.0",
24-
"semver": "7.1.3",
30+
"react-dom-confetti": "0.2.0",
31+
"react-ga": "3.3.1",
32+
"react-github-btn": "1.4.0",
33+
"react-scripts": "5.0.1",
34+
"semver": "7.3.8",
2535
"use-persisted-state": "^0.3.3"
2636
},
2737
"devDependencies": {
28-
"@emotion/babel-preset-css-prop": "10.0.27",
38+
"@emotion/babel-preset-css-prop": "^11.10.0",
39+
"@emotion/eslint-plugin": "^11.10.0",
2940
"@testing-library/react": "^14.0.0",
30-
"customize-cra": "^0.9.1",
31-
"customize-cra-react-refresh": "^1.0.1",
32-
"eslint": "6.8.0",
33-
"eslint-plugin-prettier": "3.1.2",
34-
"gh-pages": "2.2.0",
35-
"husky": "4.2.3",
36-
"jest-image-snapshot": "4.5.0",
37-
"prettier": "1.19.1",
38-
"pretty-quick": "2.0.1",
41+
"customize-cra": "^1.0.0",
42+
"eslint": "^8.35.0",
43+
"eslint-plugin-prettier": "^4.2.1",
44+
"gh-pages": "5.0.0",
45+
"husky": "8.0.3",
46+
"jest-image-snapshot": "6.1.0",
47+
"prettier": "2.8.4",
48+
"pretty-quick": "3.1.3",
3949
"puppeteer": "10.0.0",
40-
"react-app-rewired": "^2.1.5"
41-
},
42-
"scripts": {
43-
"start": "EXTEND_ESLINT=true react-app-rewired start",
44-
"start-and-wait": "yarn start & wget --retry-connrefused --waitretry=1 --read-timeout=20 --timeout=15 -t 30 http://localhost:3000/",
45-
"build": "EXTEND_ESLINT=true react-app-rewired build",
46-
"test": "react-app-rewired test --watchAll=false --onlyChanged=false --testPathPattern='/__tests__/((?!e2e).)*.spec.js?$'",
47-
"test-e2e": "docker-compose run tests",
48-
"docker-test-e2e": "yarn start-and-wait && react-app-rewired test --watchAll=false --onlyChanged=false --testPathPattern='/__tests__/.*(\\.|).e2e.spec.js?$'",
49-
"lint": "eslint . --cache --report-unused-disable-directives"
50-
},
51-
"husky": {
52-
"hooks": {
53-
"pre-commit": "pretty-quick --staged --pattern \"src/**/*.*(js|jsx)\"",
54-
"pre-push": "yarn run lint"
55-
}
50+
"react-app-rewired": "^2.2.1"
5651
},
5752
"browserslist": {
5853
"production": [
@@ -66,25 +61,33 @@
6661
"last 1 safari version"
6762
]
6863
},
69-
"jest": {
70-
"testMatch": [
71-
"**/__tests__/**/*.spec.js"
72-
],
73-
"setupFilesAfterEnv": [
74-
"<rootDir>/jest.setup.js"
75-
]
76-
},
7764
"eslintConfig": {
7865
"extends": [
7966
"react-app"
8067
],
8168
"plugins": [
82-
"prettier"
69+
"prettier",
70+
"@emotion"
8371
],
8472
"rules": {
8573
"prettier/prettier": "error",
8674
"jsx-a11y/accessible-emoji": "off",
75+
"import/no-anonymous-default-export": "off",
8776
"react-hooks/exhaustive-deps": "off"
8877
}
78+
},
79+
"husky": {
80+
"hooks": {
81+
"pre-commit": "pretty-quick --staged --pattern \"src/**/*.*(js|jsx)\"",
82+
"pre-push": "yarn run lint"
83+
}
84+
},
85+
"jest": {
86+
"testMatch": [
87+
"**/__tests__/**/*.spec.js"
88+
],
89+
"setupFilesAfterEnv": [
90+
"<rootDir>/jest.setup.js"
91+
]
8992
}
9093
}

src/__fixtures__/releases/0.59.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,8 @@ export default {
44
links: [
55
{
66
title: 'This is a very cool link to a blog post about 0.59',
7-
url:
8-
'https://facebook.github.io/react-native/blog/2019/03/12/releasing-react-native-059'
9-
}
10-
]
11-
}
7+
url: 'https://facebook.github.io/react-native/blog/2019/03/12/releasing-react-native-059',
8+
},
9+
],
10+
},
1211
}

src/__tests__/Home.e2e.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,12 @@ describe('Home', () => {
1616

1717
afterAll(closeBrowser)
1818

19-
const selectVersion = async targetVersion => {
20-
await page.evaluate(pageTargetVersion => {
19+
const selectVersion = async (targetVersion) => {
20+
await page.evaluate((pageTargetVersion) => {
2121
const element = [
2222
...document.querySelectorAll(
2323
'.ant-select-dropdown.ant-select-dropdown-placement-bottomLeft:not(.ant-select-dropdown-hidden) .ant-select-item-option-content'
24-
)
24+
),
2525
].find(({ innerText: version }) => version === pageTargetVersion)
2626

2727
element.click()
@@ -113,7 +113,7 @@ describe('Home', () => {
113113
})
114114

115115
it('9. should scroll to the first file in diff', async () => {
116-
await page.evaluate(testID => {
116+
await page.evaluate((testID) => {
117117
document
118118
.querySelector(`[data-testid="${testID}"]`)
119119
.querySelector('div')

src/__tests__/utils.spec.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ describe('getVersionsContentInDiff', () => {
77
const versions = getVersionsContentInDiff({
88
packageName: PACKAGE_NAMES.RN,
99
fromVersion: '0.57.0',
10-
toVersion: '0.59.0'
10+
toVersion: '0.59.0',
1111
})
1212

1313
expect(versions).toEqual([{ version: '0.59' }, { version: '0.58' }])
@@ -17,21 +17,21 @@ describe('getVersionsContentInDiff', () => {
1717
const versions = getVersionsContentInDiff({
1818
packageName: PACKAGE_NAMES.RN,
1919
fromVersion: '0.56.0',
20-
toVersion: '0.59.0-rc.1'
20+
toVersion: '0.59.0-rc.1',
2121
})
2222

2323
expect(versions).toEqual([
2424
{ version: '0.59' },
2525
{ version: '0.58' },
26-
{ version: '0.57' }
26+
{ version: '0.57' },
2727
])
2828
})
2929

3030
it('returns the versions in the provided range with patches specified', () => {
3131
const versions = getVersionsContentInDiff({
3232
packageName: PACKAGE_NAMES.RN,
3333
fromVersion: '0.57.2',
34-
toVersion: '0.59.9'
34+
toVersion: '0.59.9',
3535
})
3636

3737
expect(versions).toEqual([{ version: '0.59' }, { version: '0.58' }])

src/components/common/BinaryDownload.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ const BinaryList = ({ binaryFiles, toVersion, appName, packageName }) =>
3939
{removeAppPathPrefix(newPath, appName)}
4040

4141
<DownloadFileButton
42-
visible={true}
42+
open={true}
4343
version={toVersion}
4444
path={newPath}
4545
packageName={packageName}
@@ -53,7 +53,7 @@ const BinaryDownload = ({
5353
fromVersion,
5454
toVersion,
5555
appName,
56-
packageName
56+
packageName,
5757
}) => {
5858
const binaryFiles = diff.filter(
5959
({ hunks, type }) => hunks.length === 0 && type !== 'delete'

src/components/common/CompletedFilesCounter.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react'
22
import styled from '@emotion/styled'
3-
import { keyframes, css } from '@emotion/core'
3+
import { keyframes, css } from '@emotion/react'
44
import Confetti from 'react-dom-confetti'
55
import { Popover } from 'antd'
66

@@ -34,7 +34,7 @@ const CompletedFilesCounter = styled(
3434
trigger="hover"
3535
placement="right"
3636
overlayStyle={{
37-
position: 'fixed'
37+
position: 'fixed',
3838
}}
3939
>
4040
<span className="completedAmount">
@@ -47,7 +47,7 @@ const CompletedFilesCounter = styled(
4747
config={{
4848
elementCount: 200,
4949
angle: 130,
50-
startVelocity: 30
50+
startVelocity: 30,
5151
}}
5252
/>
5353
</div>

src/components/common/Diff/Diff.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ import {
55
Hunk,
66
markEdits,
77
tokenize,
8-
Decoration as DiffDecoration
8+
Decoration as DiffDecoration,
99
} from 'react-diff-view'
1010
import DiffHeader from './DiffHeader'
1111
import { getComments } from './DiffComment'
1212
import { replaceWithProvidedAppName } from '../../../utils'
1313

1414
const copyPathPopoverContentOpts = {
1515
default: 'Click to copy file path',
16-
copied: 'File path copied!'
16+
copied: 'File path copied!',
1717
}
1818

1919
const Container = styled.div`
@@ -101,7 +101,7 @@ const Diff = ({
101101
areAllCollapsed,
102102
setAllCollapsed,
103103
diffViewStyle,
104-
appName
104+
appName,
105105
}) => {
106106
const [isDiffCollapsed, setIsDiffCollapsed] = useState(
107107
isDiffCollapsedByDefault({ type, hunks })
@@ -122,17 +122,17 @@ const Diff = ({
122122
}
123123

124124
const getHunksWithAppName = useCallback(
125-
originalHunks => {
125+
(originalHunks) => {
126126
if (!appName) {
127127
return originalHunks
128128
}
129129

130-
return originalHunks.map(hunk => ({
130+
return originalHunks.map((hunk) => ({
131131
...hunk,
132-
changes: hunk.changes.map(change => ({
132+
changes: hunk.changes.map((change) => ({
133133
...change,
134-
content: replaceWithProvidedAppName(change.content, appName)
135-
}))
134+
content: replaceWithProvidedAppName(change.content, appName),
135+
})),
136136
}))
137137
},
138138
[appName]
@@ -149,7 +149,7 @@ const Diff = ({
149149
newPath,
150150
fromVersion,
151151
toVersion,
152-
appName
152+
appName,
153153
})
154154

155155
return (
@@ -189,16 +189,16 @@ const Diff = ({
189189
optimizeSelection={true}
190190
selectedChanges={selectedChanges}
191191
>
192-
{originalHunks => {
192+
{(originalHunks) => {
193193
const updatedHunks = getHunksWithAppName(originalHunks)
194194

195195
const options = {
196-
enhancers: [markEdits(updatedHunks)]
196+
enhancers: [markEdits(updatedHunks)],
197197
}
198198

199199
const tokens = tokenize(updatedHunks, options)
200200

201-
return updatedHunks.map(hunk => [
201+
return updatedHunks.map((hunk) => [
202202
<Decoration key={'decoration-' + hunk.content}>
203203
<More>{hunk.content}</More>
204204
</Decoration>,
@@ -207,7 +207,7 @@ const Diff = ({
207207
hunk={hunk}
208208
tokens={tokens}
209209
gutterEvents={{ onClick: onToggleChangeSelection }}
210-
/>
210+
/>,
211211
])
212212
}}
213213
</DiffView>

0 commit comments

Comments
 (0)