Skip to content

Commit

Permalink
chore: upgrade all deps and migrate to vitest (#265)
Browse files Browse the repository at this point in the history
  • Loading branch information
xobotyi authored Dec 10, 2024
1 parent 3e02968 commit c40fadb
Show file tree
Hide file tree
Showing 48 changed files with 12,704 additions and 13,701 deletions.
8 changes: 8 additions & 0 deletions .commitlintrc.js
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;
11 changes: 0 additions & 11 deletions .eslintignore

This file was deleted.

37 changes: 0 additions & 37 deletions .eslintrc.cjs

This file was deleted.

64 changes: 30 additions & 34 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,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
Expand All @@ -39,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
Expand All @@ -63,24 +60,24 @@ 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 test:coverage --testLocationInResults --reporters=default --reporters=@jamesacarr/jest-reporter-github-actions
run: yarn test:coverage --run --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

dependabot-merge:
Expand All @@ -107,26 +104,25 @@ 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: "Build"
run: yarn build

- name: "Release"
id: "release"
uses: codfish/semantic-release-action@v3
env:
GITHUB_TOKEN: ${{ secrets.GH_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
run: yarn semantic-release

gen-contributors:
name: "Generate Contributors List"
Expand Down
17 changes: 13 additions & 4 deletions .gitignore
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
3 changes: 0 additions & 3 deletions .husky/commit-msg
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

if [ "$CI" = "true" ]
then
# disable commitlint for CI environments
Expand Down
3 changes: 0 additions & 3 deletions .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

yarn lint-staged
4 changes: 4 additions & 0 deletions .lintstagedrc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"*.{js,ts}": "yarn lint:fix",
"*.mdx?": "yarn lint:fix"
}
3 changes: 1 addition & 2 deletions .npmignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@
*
!/src/**/*.js
!/src/**/*.d.ts
!/dist
3 changes: 0 additions & 3 deletions .prettierrc.cjs

This file was deleted.

17 changes: 17 additions & 0 deletions .releaserc.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
{
"branches": [
"master"
],
"plugins": [
[
"@semantic-release/exec",
{
"prepareCmd": "yarn pinst --disable"
}
],
"@semantic-release/commit-analyzer",
"@semantic-release/release-notes-generator",
"@semantic-release/npm",
"@semantic-release/github"
]
}
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
Loading

0 comments on commit c40fadb

Please sign in to comment.