Skip to content

Commit

Permalink
test and support versions of react 15+
Browse files Browse the repository at this point in the history
  • Loading branch information
grrowl committed Feb 6, 2025
1 parent 85f0f2d commit 4654a82
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 13 deletions.
17 changes: 16 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ jobs:
strategy:
matrix:
node-version: [16.x, 18.x, 20.x]
react-version: [16, 17, 18, 19]

steps:
- uses: actions/checkout@v4
Expand All @@ -23,6 +24,20 @@ jobs:
with:
node-version: ${{ matrix.node-version }}

- run: npm ci
# Add caching
- uses: actions/cache@v3
id: npm-cache
with:
path: node_modules
key: ${{ runner.os }}-node-${{ matrix.node-version }}-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-${{ matrix.node-version }}-
# Only run npm ci if cache missed
- if: steps.npm-cache.outputs.cache-hit != 'true'
run: npm ci

# Override React versions
- run: npm install --no-save react@^${{ matrix.react-version }} react-is@^${{ matrix.react-version }}

- run: npm test
16 changes: 4 additions & 12 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,10 @@
"test": "tsx index.spec.tsx",
"prepublishOnly": "npm run build"
},
"keywords": [
"react",
"fragment",
"flatten",
"children",
"utility"
],
"keywords": ["react", "fragment", "flatten", "children", "utility"],
"author": "Tom McKenzie <tom@chillidonut.com>",
"license": "MIT",
"files": [
"dist/"
],
"files": ["dist/"],
"devDependencies": {
"@testing-library/dom": "^10.4.0",
"@testing-library/react": "^16.2.0",
Expand All @@ -51,7 +43,7 @@
"typescript": "^5.0.4"
},
"peerDependencies": {
"react": "^18.0.0 || ^19.0.0",
"react-is": "^18.0.0 || ^19.0.0"
"react": ">=15.0.0",
"react-is": ">=16.0.0"
}
}

0 comments on commit 4654a82

Please sign in to comment.