-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: migration towards vitest (#1574)
Improve `resolveHookState` function - it has better typings overall and passes previous state to state updater only in case it is being passed to `resolveHookState` function. BREAKING CHANGE: resolve hook state does not pass `undefined` to `nextState` function when while being called without `previousState` anymore
- Loading branch information
Showing
353 changed files
with
13,887 additions
and
20,321 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
const config = { | ||
extends: ['@commitlint/config-conventional'], | ||
rules: { | ||
'footer-max-line-length': [1, 'always', 72], | ||
}, | ||
}; | ||
|
||
export default config; |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,9 +9,6 @@ on: | |
- master | ||
workflow_dispatch: | ||
|
||
env: | ||
HUSKY: 0 | ||
|
||
jobs: | ||
lint: | ||
name: "Lint" | ||
|
@@ -21,15 +18,15 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: 'Enable corepack' | ||
run: corepack enable | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
node-version: 22 | ||
cache: 'yarn' | ||
|
||
- uses: bahmutov/npm-install@v1 | ||
with: | ||
useRollingCache: true | ||
install-command: yarn --frozen-lockfile | ||
- name: "Install dependencies" | ||
run: yarn install --immutable | ||
|
||
- name: "Lint" | ||
run: yarn lint -f @react-hookz/gha | ||
|
@@ -42,22 +39,19 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: 'Enable corepack' | ||
run: corepack enable | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
node-version: 22 | ||
cache: 'yarn' | ||
|
||
- uses: bahmutov/npm-install@v1 | ||
with: | ||
useRollingCache: true | ||
install-command: yarn --frozen-lockfile | ||
- name: "Install dependencies" | ||
run: yarn install --immutable | ||
|
||
- name: "Build" | ||
run: yarn build | ||
|
||
- name: "Tests against built package" | ||
run: yarn test | ||
|
||
test: | ||
name: "Test" | ||
runs-on: ubuntu-latest | ||
|
@@ -66,24 +60,32 @@ jobs: | |
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- name: 'Enable corepack' | ||
run: corepack enable | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
node-version: 22 | ||
cache: 'yarn' | ||
|
||
- uses: bahmutov/npm-install@v1 | ||
with: | ||
useRollingCache: true | ||
install-command: yarn --frozen-lockfile | ||
- name: "Install dependencies" | ||
run: yarn install --immutable | ||
|
||
- name: "Test" | ||
run: yarn build:clean && yarn test:coverage --testLocationInResults --reporters=default --reporters=@jamesacarr/jest-reporter-github-actions | ||
run: yarn test:coverage --reporter='github-actions' --reporter='junit' --outputFile='./coverage/test-report.junit.xml' --reporter=default | ||
|
||
- name: "Upload coverage to Codecov" | ||
uses: codecov/codecov-action@v4 | ||
uses: codecov/codecov-action@v5 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: coverage/lcov.info | ||
files: coverage/test-report.junit.xml | ||
fail_ci_if_error: true | ||
|
||
- name: "Upload test results to Codecov" | ||
if: ${{ !cancelled() }} | ||
uses: codecov/test-results-action@v1 | ||
with: | ||
token: ${{ secrets.CODECOV_TOKEN }} | ||
files: coverage/test-report.junit.xml | ||
fail_ci_if_error: true | ||
|
||
dependabot-merge: | ||
|
@@ -98,7 +100,6 @@ jobs: | |
- uses: fastify/github-action-merge-dependabot@v3 | ||
with: | ||
github-token: ${{ secrets.GITHUB_TOKEN }} | ||
target: 'minor' | ||
|
||
semantic-release: | ||
name: "Release" | ||
|
@@ -111,26 +112,28 @@ jobs: | |
- name: "Checkout" | ||
uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
ref: "master" | ||
- name: 'Enable corepack' | ||
run: corepack enable | ||
- uses: actions/setup-node@v4 | ||
with: | ||
node-version: 20 | ||
node-version: 22 | ||
cache: 'yarn' | ||
|
||
- uses: bahmutov/npm-install@v1 | ||
with: | ||
useRollingCache: true | ||
install-command: yarn --frozen-lockfile | ||
- name: Install dependencies | ||
run: yarn install --immutable | ||
|
||
- name: "Build package" | ||
- name: "disable postinstall" | ||
run: yarn pinst --disable | ||
|
||
- name: "Build" | ||
run: yarn build | ||
|
||
- name: "Release" | ||
id: "release" | ||
uses: codfish/[email protected] | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} | ||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }} | ||
run: yarn semantic-release | ||
|
||
gen-contributors: | ||
name: "Generate Contributors List" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,14 @@ | ||
/.idea | ||
node_modules | ||
.idea | ||
|
||
yarn-error.log | ||
.yarn/* | ||
!.yarn/cache | ||
!.yarn/patches | ||
!.yarn/plugins | ||
!.yarn/releases | ||
!.yarn/sdks | ||
!.yarn/versions | ||
|
||
/coverage | ||
/src/**/*.js | ||
/src/**/*.d.ts | ||
/node_modules | ||
/dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,7 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
if [ "$CI" = "true" ] | ||
then | ||
# disable commitlint for CI environments | ||
exit 0 | ||
else | ||
echo "Exists" | ||
yarn commitlint --edit | ||
fi |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
{ | ||
"*.{js,ts}": "yarn lint:fix", | ||
"*.mdx?": "yarn lint:fix" | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,2 @@ | ||
* | ||
!/src/**/*.js | ||
!/src/**/*.d.ts | ||
!/dist |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
{ | ||
"branches": [ | ||
"master" | ||
], | ||
"plugins": [ | ||
"@semantic-release/commit-analyzer", | ||
"@semantic-release/release-notes-generator", | ||
"@semantic-release/npm", | ||
"@semantic-release/github" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
nodeLinker: node-modules |
Oops, something went wrong.