Skip to content

Commit f242a9a

Browse files
authored
dev: update dependencies and pipeline node versions (#1667)
* dev: update dependencies * update validate workflow * update validate workflow again * downgrade cypress plugin * improve misc test
1 parent f3ef96a commit f242a9a

File tree

16 files changed

+123
-88
lines changed

16 files changed

+123
-88
lines changed

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,30 +14,32 @@ Please fill out the information below to expedite the review and (hopefully)
1414
merge of your pull request!
1515
-->
1616

17+
# Pull Request
18+
19+
## What
20+
1721
<!-- What changes are being made? (What feature/bug is being fixed here?) -->
1822

19-
**What**:
23+
## Why
2024

2125
<!-- Why are these changes necessary? -->
2226

23-
**Why**:
27+
## How
2428

2529
<!-- How were these changes implemented? -->
2630

27-
**How**:
31+
## Changes
2832

29-
<!-- Have you done all of these things? -->
33+
<!-- List the specific changes made (files modified, configurations updated, etc.) -->
3034

31-
**Checklist**:
35+
## Checklist
3236

3337
<!-- add "N/A" to the end of each line that's irrelevant to your changes -->
34-
3538
<!-- to check an item, place an "x" in the box like so: "- [x] Documentation" -->
3639

3740
- [ ] Documentation
3841
- [ ] Tests
3942
- [ ] TypeScript Types
40-
- [ ] Flow Types
4143
- [ ] Ready to be merged
4244
<!-- In your opinion, is this ready to be merged as soon as it's reviewed? -->
4345

.github/workflows/validate.yml

Lines changed: 14 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -16,23 +16,23 @@ jobs:
1616
if: ${{ !contains(github.head_ref, 'all-contributors') }}
1717
strategy:
1818
matrix:
19-
node: [18, 20]
19+
node: [20, 22, 24]
2020
runs-on: ubuntu-latest
2121
steps:
2222
- name: 🛑 Cancel Previous Runs
23-
uses: styfle/cancel-workflow-action@0.6.0
23+
uses: styfle/cancel-workflow-action@0.12.1
2424
with:
2525
access_token: ${{ secrets.GITHUB_TOKEN }}
2626
- name: ⬇️ Checkout repo
27-
uses: actions/checkout@v2
27+
uses: actions/checkout@v5
2828

2929
- name: Increase watchers
3030
run:
3131
echo fs.inotify.max_user_watches=524288 | sudo tee -a /etc/sysctl.conf
3232
&& sudo sysctl -p
3333

3434
- name: ⎔ Setup node
35-
uses: actions/setup-node@v1
35+
uses: actions/setup-node@v5
3636
with:
3737
node-version: ${{ matrix.node }}
3838

@@ -47,7 +47,9 @@ jobs:
4747
FORCE_COLOR: true
4848

4949
- name: ⬆️ Upload coverage report
50-
uses: codecov/codecov-action@v1
50+
uses: codecov/codecov-action@v5
51+
env:
52+
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
5153

5254
release:
5355
needs: main
@@ -58,17 +60,17 @@ jobs:
5860
github.ref) && github.event_name == 'push' }}
5961
steps:
6062
- name: 🛑 Cancel Previous Runs
61-
uses: styfle/cancel-workflow-action@0.6.0
63+
uses: styfle/cancel-workflow-action@0.12.1
6264
with:
6365
access_token: ${{ secrets.GITHUB_TOKEN }}
6466

6567
- name: ⬇️ Checkout repo
66-
uses: actions/checkout@v2
68+
uses: actions/checkout@v5
6769

6870
- name: ⎔ Setup node
69-
uses: actions/setup-node@v1
71+
uses: actions/setup-node@v5
7072
with:
71-
node-version: 16
73+
node-version: 24
7274

7375
- name: 📥 Download deps
7476
uses: bahmutov/npm-install@v1
@@ -79,9 +81,9 @@ jobs:
7981
run: npm run build
8082

8183
- name: 🚀 Release
82-
uses: cycjimmy/semantic-release-action@v2
84+
uses: cycjimmy/semantic-release-action@v6
8385
with:
84-
semantic_version: 17
86+
semantic_version: 24
8587
branches: |
8688
[
8789
'+([0-9])?(.{+([0-9]),x}).x',
@@ -93,4 +95,4 @@ jobs:
9395
]
9496
env:
9597
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
96-
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
98+
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}

cypress/.eslintrc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
{
2-
"plugins": [
3-
"cypress"
4-
],
5-
"env": {
6-
"cypress/globals": true
2+
"plugins": ["cypress"],
3+
"globals": {
4+
"cy": true,
5+
"Cypress": true,
6+
"before": true
77
}
88
}

other/misc-tests/jest.config.js

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,17 @@ const babelHelpersList = require('@babel/helpers').list
44
module.exports = Object.assign(jestConfig, {
55
roots: ['.'],
66
testEnvironment: 'jsdom',
7+
testEnvironmentOptions: {
8+
customExportConditions: ['require', 'node'],
9+
},
710
moduleNameMapper: babelHelpersList.reduce(
811
(aliasMap, helper) => {
9-
aliasMap[
10-
`@babel/runtime/helpers/esm/${helper}`
11-
] = `@babel/runtime/helpers/${helper}`
12+
aliasMap[`@babel/runtime/helpers/esm/${helper}`] =
13+
`@babel/runtime/helpers/${helper}`
1214
return aliasMap
1315
},
14-
{'^preact(/(.*)|$)': 'preact$1'},
16+
{
17+
'^preact(/(.*)|$)': 'preact$1',
18+
},
1519
),
1620
})

package.json

Lines changed: 37 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -81,58 +81,60 @@
8181
"react": ">=16.12.0"
8282
},
8383
"dependencies": {
84-
"@babel/runtime": "^7.24.5",
85-
"compute-scroll-into-view": "^3.1.0",
84+
"@babel/runtime": "^7.28.6",
85+
"compute-scroll-into-view": "^3.1.1",
8686
"prop-types": "^15.8.1",
87-
"react-is": "18.2.0",
88-
"tslib": "^2.6.2"
87+
"react-is": "^18.2.0",
88+
"tslib": "^2.8.1"
8989
},
9090
"devDependencies": {
91-
"@babel/helpers": "^7.24.5",
91+
"@babel/helpers": "^7.28.6",
9292
"@babel/plugin-proposal-private-methods": "^7.18.6",
9393
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
94-
"@cypress/webpack-preprocessor": "^6.0.1",
94+
"@cypress/webpack-preprocessor": "^7.0.2",
9595
"@docusaurus/core": "3.3.2",
9696
"@docusaurus/module-type-aliases": "3.3.2",
9797
"@docusaurus/preset-classic": "3.3.2",
9898
"@mdx-js/react": "^3.0.1",
99-
"@rollup/plugin-babel": "^6.0.4",
100-
"@rollup/plugin-commonjs": "^25.0.7",
101-
"@testing-library/cypress": "^10.0.1",
102-
"@testing-library/dom": "^10.1.0",
103-
"@testing-library/jest-dom": "^6.4.5",
104-
"@testing-library/preact": "^2.0.1",
105-
"@testing-library/react": "^15.0.7",
106-
"@testing-library/user-event": "^14.5.2",
107-
"@types/jest": "^29.5.12",
108-
"@types/react": "^18.3.2",
109-
"@typescript-eslint/eslint-plugin": "^7.9.0",
110-
"@typescript-eslint/parser": "^7.9.0",
99+
"@rollup/plugin-babel": "^6.1.0",
100+
"@rollup/plugin-commonjs": "^29.0.0",
101+
"@testing-library/cypress": "^10.1.0",
102+
"@testing-library/dom": "^10.4.1",
103+
"@testing-library/jest-dom": "^6.9.1",
104+
"@testing-library/preact": "^3.2.4",
105+
"@testing-library/react": "^16.3.2",
106+
"@testing-library/user-event": "^14.6.1",
107+
"@types/jest": "^30.0.0",
108+
"@types/prop-types": "^15.7.15",
109+
"@types/react": "^18.2.0",
110+
"@typescript-eslint/eslint-plugin": "^8.54.0",
111+
"@typescript-eslint/parser": "^8.54.0",
111112
"babel-plugin-macros": "^3.1.0",
112113
"babel-plugin-no-side-effect-class-properties": "0.0.7",
113114
"babel-preset-react-native": "^4.0.1",
114115
"buble": "^0.20.0",
115-
"cpy-cli": "^5.0.0",
116-
"cross-env": "^7.0.3",
117-
"cypress": "13.9.0",
118-
"eslint": "^8.56.0",
119-
"eslint-plugin-cypress": "^3.2.0",
120-
"eslint-plugin-react": "7.34.1",
121-
"flow-bin": "^0.236.0",
116+
"cpy-cli": "^6.0.0",
117+
"cross-env": "^10.1.0",
118+
"cypress": "15.9.0",
119+
"eslint": "^8.57.0",
120+
"eslint-plugin-cypress": "^3.6.0",
121+
"eslint-plugin-react": "7.37.5",
122+
"flow-bin": "^0.299.0",
122123
"flow-coverage-report": "^0.8.0",
123124
"get-pkg-repo": "5.0.0",
124125
"kcd-scripts": "^15.0.1",
125-
"node-polyfill-webpack-plugin": "^3.0.0",
126+
"node-polyfill-webpack-plugin": "^4.1.0",
126127
"npm-run-all": "^4.1.5",
127-
"preact": "^10.22.0",
128-
"prism-react-renderer": "^2.3.1",
129-
"react": "18.2.0",
130-
"react-dom": "18.2.0",
131-
"react-native": "^0.74.1",
132-
"react-test-renderer": "18.2.0",
133-
"serve": "^14.2.3",
134-
"start-server-and-test": "^2.0.3",
135-
"typescript": "^5.4.5"
128+
"preact": "^10.28.2",
129+
"prism-react-renderer": "^2.4.1",
130+
"react": "^18.3.1",
131+
"react-dom": "^18.3.1",
132+
"react-is": "^18.3.1",
133+
"react-native": "^0.76.0",
134+
"react-test-renderer": "^18.3.1",
135+
"serve": "^14.2.5",
136+
"start-server-and-test": "^2.1.3",
137+
"typescript": "^5.9.3"
136138
},
137139
"eslintConfig": {
138140
"parserOptions": {

src/__tests__/downshift.get-button-props.js

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -74,11 +74,7 @@ test('getToggleButtonProps returns all given props', () => {
7474
const Button = jest.fn(props => <button {...props} />)
7575
setup({buttonProps, Button})
7676
expect(Button).toHaveBeenCalledTimes(1)
77-
const context = expect.any(Object)
78-
expect(Button).toHaveBeenCalledWith(
79-
expect.objectContaining(buttonProps),
80-
context,
81-
)
77+
expect(Button).toHaveBeenCalledWith(expect.objectContaining(buttonProps), expect.anything())
8278
})
8379

8480
// normally this test would be like the others where we render and then simulate a click on the

src/__tests__/downshift.misc.js

Lines changed: 32 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
// but we still want to have tested.
33

44
import * as React from 'react'
5-
import * as ReactDOM from 'react-dom'
5+
import * as ReactDOM from 'react-dom/client'
66
import {act, render} from '@testing-library/react'
77
import Downshift from '../'
88

@@ -68,24 +68,47 @@ test('toggleMenu can take no arguments at all', () => {
6868
)
6969
})
7070

71-
test('clearItems clears the all items', () => {
71+
test('clearItems clears all items', () => {
7272
const item = 'Chess'
73+
7374
const children = ({getItemProps}) => (
7475
<div>
7576
<div key={item} {...getItemProps({item})}>
7677
{item}
7778
</div>
7879
</div>
7980
)
80-
// IMPLEMENTATION DETAIL TEST :-(
81-
// eslint-disable-next-line react/no-render-return-value
82-
const downshiftInstance = ReactDOM.render(
83-
<Downshift>{children}</Downshift>,
84-
document.createElement('div'),
85-
)
81+
82+
// Wrap Downshift to expose its instance methods through a ref
83+
const DownshiftWrapper = React.forwardRef((_props, ref) => {
84+
const innerRef = React.useRef(null)
85+
86+
React.useImperativeHandle(ref, () => innerRef.current)
87+
88+
return <Downshift ref={innerRef}>{children}</Downshift>
89+
})
90+
91+
const container = document.createElement('div')
92+
const root = ReactDOM.createRoot(container)
93+
94+
const dsRef = React.createRef()
95+
96+
// eslint-disable-next-line testing-library/no-unnecessary-act
97+
act(() => {
98+
root.render(<DownshiftWrapper ref={dsRef} />)
99+
})
100+
101+
const downshiftInstance = dsRef.current
102+
86103
expect(downshiftInstance.items).toEqual([item])
87-
downshiftInstance.clearItems()
104+
105+
act(() => {
106+
downshiftInstance.clearItems()
107+
})
108+
88109
expect(downshiftInstance.items).toEqual([])
110+
111+
root.unmount()
89112
})
90113

91114
test('reset can take no arguments at all', () => {

src/hooks/__tests__/utils.test.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ describe('utils', () => {
7676

7777
expect(() =>
7878
getItemAndIndex(undefined, undefined, [1, 2, 3], errorMessage),
79-
).toThrowError(errorMessage)
79+
).toThrow(errorMessage)
8080
})
8181

8282
test('returns index if item is passed', () => {
@@ -135,7 +135,7 @@ describe('utils', () => {
135135
test('renders without error', () => {
136136
expect(() => {
137137
renderHook(() => useMouseAndTouchTracker(undefined, jest.fn(), []))
138-
}).not.toThrowError()
138+
}).not.toThrow()
139139
})
140140

141141
test('adds and removes listeners to environment', () => {

src/hooks/useCombobox/__tests__/getItemProps.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ describe('getItemProps', () => {
1717
test('throws error if no index or item has been passed', () => {
1818
const {result} = renderUseCombobox()
1919

20-
expect(result.current.getItemProps).toThrowError(
20+
expect(result.current.getItemProps).toThrow(
2121
'Pass either item or index to getItemProps!',
2222
)
2323
})

src/hooks/useCombobox/__tests__/utils.test.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ describe('utils', () => {
44
test('reducer throws error if called without proper action type', () => {
55
expect(() => {
66
reducer({}, {}, {type: 'super-bogus'})
7-
}).toThrowError('Reducer called without proper action type.')
7+
}).toThrow('Reducer called without proper action type.')
88
})
99
})

0 commit comments

Comments
 (0)