Skip to content

Commit 92edeb5

Browse files
committed
test and support versions of react 18+
1 parent 7dd55b3 commit 92edeb5

File tree

3 files changed

+22
-15
lines changed

3 files changed

+22
-15
lines changed

.github/workflows/test.yml

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ jobs:
1515
strategy:
1616
matrix:
1717
node-version: [16.x, 18.x, 20.x]
18+
react-version: [18, 19]
1819

1920
steps:
2021
- uses: actions/checkout@v4
@@ -23,6 +24,20 @@ jobs:
2324
with:
2425
node-version: ${{ matrix.node-version }}
2526

26-
- run: npm ci
27+
# Add caching
28+
- uses: actions/cache@v3
29+
id: npm-cache
30+
with:
31+
path: node_modules
32+
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
33+
restore-keys: |
34+
${{ runner.os }}-node-${{ matrix.node-version }}-
35+
36+
# Only run npm ci if cache missed
37+
- if: steps.npm-cache.outputs.cache-hit != 'true'
38+
run: npm ci
39+
40+
# Override React versions
41+
- run: npm install --no-save react@^${{ matrix.react-version }} react-dom@^${{ matrix.react-version }} react-is@^${{ matrix.react-version }}
2742

2843
- run: npm test

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -21,18 +21,10 @@
2121
"test": "tsx index.spec.tsx",
2222
"prepublishOnly": "npm run build"
2323
},
24-
"keywords": [
25-
"react",
26-
"fragment",
27-
"flatten",
28-
"children",
29-
"utility"
30-
],
24+
"keywords": ["react", "fragment", "flatten", "children", "utility"],
3125
"author": "Tom McKenzie <[email protected]>",
3226
"license": "MIT",
33-
"files": [
34-
"dist/"
35-
],
27+
"files": ["dist/"],
3628
"devDependencies": {
3729
"@testing-library/dom": "^10.4.0",
3830
"@testing-library/react": "^16.2.0",
@@ -51,7 +43,7 @@
5143
"typescript": "^5.0.4"
5244
},
5345
"peerDependencies": {
54-
"react": "^18.0.0 || ^19.0.0",
55-
"react-is": "^18.0.0 || ^19.0.0"
46+
"react": ">=18.0.0",
47+
"react-is": ">=18.0.0"
5648
}
5749
}

0 commit comments

Comments
 (0)