Skip to content

Commit 8b73e7a

Browse files
authored
Release v1.0.0: Initial release of useAsyncEffekt and useAsyncMemo
1 parent dc1142f commit 8b73e7a

File tree

11 files changed

+7444
-32
lines changed

11 files changed

+7444
-32
lines changed

.coderabbit.yaml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
reviews:
2+
base_branches:
3+
- "main"
4+
- "develop"

.github/workflows/test.yml

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
name: Test
2+
3+
on:
4+
push:
5+
branches: [main, develop]
6+
pull_request:
7+
branches: [main, develop]
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
matrix:
15+
react-version: ["16.8.0", "17.0.0", "18.0.0", "19.0.0"]
16+
node-version: [16, 18, 20]
17+
exclude:
18+
# React 19 requires Node 18+
19+
- react-version: "19.0.0"
20+
node-version: 16
21+
22+
steps:
23+
- uses: actions/checkout@v4
24+
25+
- name: Use Node.js ${{ matrix.node-version }}
26+
uses: actions/setup-node@v4
27+
with:
28+
node-version: ${{ matrix.node-version }}
29+
cache: "npm"
30+
31+
- name: Install dependencies
32+
run: npm ci
33+
34+
- name: Install React and testing libraries for React ${{ matrix.react-version }}
35+
run: |
36+
if [[ "${{ matrix.react-version }}" == "16.8.0" || "${{ matrix.react-version }}" == "17.0.0" ]]; then
37+
npm install react@^${{ matrix.react-version }} react-dom@^${{ matrix.react-version }} @types/react@^${{ matrix.react-version }} @types/react-dom@^${{ matrix.react-version }} @testing-library/react@^12.1.5 @testing-library/react-hooks@^8.0.1
38+
elif [[ "${{ matrix.react-version }}" == "18.0.0" ]]; then
39+
npm install react@^${{ matrix.react-version }} react-dom@^${{ matrix.react-version }} @types/react@^${{ matrix.react-version }} @types/react-dom@^${{ matrix.react-version }} @testing-library/react@^14.1.0
40+
else
41+
npm install react@^${{ matrix.react-version }} react-dom@^${{ matrix.react-version }} @types/react@^${{ matrix.react-version }} @types/react-dom@^${{ matrix.react-version }} @testing-library/react@^16.1.0
42+
fi
43+
44+
- name: Run tests
45+
run: npm test -- --coverage --watchAll=false
46+
47+
- name: Upload coverage to Codecov
48+
uses: codecov/codecov-action@v4
49+
with:
50+
file: ./coverage/lcov.info
51+
flags: react-${{ matrix.react-version }}-node-${{ matrix.node-version }}
52+
name: codecov-umbrella
53+
fail_ci_if_error: false
54+
55+
lint:
56+
runs-on: ubuntu-latest
57+
58+
steps:
59+
- uses: actions/checkout@v4
60+
61+
- name: Use Node.js 18
62+
uses: actions/setup-node@v4
63+
with:
64+
node-version: 18
65+
cache: "npm"
66+
67+
- name: Install dependencies
68+
run: npm ci
69+
70+
- name: Build
71+
run: npm run build
72+
73+
- name: Check types
74+
run: npx tsc --noEmit

Dockerfile.test

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
ARG NODE_VERSION
2+
ARG REACT_VERSION
3+
4+
FROM node:${NODE_VERSION}-slim
5+
6+
WORKDIR /app
7+
8+
COPY package.json package-lock.json ./
9+
10+
RUN npm ci
11+
12+
# Conditionally install testing libraries based on React version
13+
RUN if [ "${REACT_VERSION}" = "16.8.0" ] || [ "${REACT_VERSION}" = "17.0.0" ]; then \
14+
npm install \
15+
"react@${REACT_VERSION}" \
16+
"react-dom@${REACT_VERSION}" \
17+
"@types/react@${REACT_VERSION}" \
18+
"@types/react-dom@${REACT_VERSION}" \
19+
"@testing-library/react@^12.1.5" \
20+
"@testing-library/react-hooks@^8.0.1"; \
21+
elif [ "${REACT_VERSION}" = "18.0.0" ]; then \
22+
npm install \
23+
"react@${REACT_VERSION}" \
24+
"react-dom@${REACT_VERSION}" \
25+
"@types/react@${REACT_VERSION}" \
26+
"@types/react-dom@${REACT_VERSION}" \
27+
"@testing-library/react@^14.1.0"; \
28+
else \
29+
npm install \
30+
"react@${REACT_VERSION}" \
31+
"react-dom@${REACT_VERSION}" \
32+
"@types/react@${REACT_VERSION}" \
33+
"@types/react-dom@${REACT_VERSION}" \
34+
"@testing-library/react@^16.1.0"; \
35+
fi
36+
37+
COPY . .
38+
39+
CMD npm test -- --coverage --watchAll=false

0 commit comments

Comments
 (0)