Skip to content

Commit

Permalink
chore: migrate to tsup, bun, vitest; bump deps versions, update example
Browse files Browse the repository at this point in the history
  • Loading branch information
rbehei committed Jan 23, 2024
1 parent 36ce561 commit 3826d7d
Show file tree
Hide file tree
Showing 48 changed files with 533 additions and 20,136 deletions.
11 changes: 1 addition & 10 deletions .eslintrc.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,21 +10,12 @@
],
"root": true,
"env": {
"node": false,
"jest": true
"node": false
},
"rules": {
"import/imports-first": 1,
"react/prop-types": "off"
},
"overrides": [
{
"files": ["example/src/*.js", "example/src/*.jsx"],
"rules": {
"import/no-unresolved": "off"
}
}
],
"settings": {
"react": {
"version": "detect"
Expand Down
26 changes: 0 additions & 26 deletions .github/actions/setup/action.yml

This file was deleted.

47 changes: 27 additions & 20 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,51 +11,58 @@ on:

jobs:
test:
name: Test on node ${{ matrix.node_version }}
name: Test
runs-on: ubuntu-latest
strategy:
matrix:
node-version: [14, 16]

steps:
- name: Get code to get access to custom our actions
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Dependencies
uses: ./.github/actions/setup
with:
node-version: ${{ matrix.node_version }}
- uses: oven-sh/setup-bun@v1

- run: bun install

- name: Lint
run: yarn run lint
run: bun run lint

- name: Build TypeScript
run: yarn run build
- name: Build
run: bun run build

- name: Run tests
run: yarn run test
run: bun run test

- name: Codecov
uses: codecov/codecov-action@v2
with:
token: ${{ secrets.CODECOV_TOKEN }}

- name: Check example folder
run: |
cd example
bun install
bun run lint
bun run build
publish:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
NPM_TOKEN: ${{secrets.NPM_TOKEN}}
steps:
- name: Get code to get access to custom our actions
uses: actions/checkout@v3
- uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Install Dependencies
uses: ./.github/actions/setup
- uses: oven-sh/setup-bun@v1

- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: "lts/*"

- run: bun install

- name: Release
run: |
yarn build
yarn semantic-release
bun run build
bun run semantic-release
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -26,3 +26,5 @@ yarn-error.log*
# Coverage directory used by tools like istanbul
coverage
*.lcov

/.idea/*
2 changes: 1 addition & 1 deletion .husky/pre-commit
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
#!/bin/sh
. "$(dirname "$0")/_/husky.sh"

npx lint-staged
bunx lint-staged
5 changes: 0 additions & 5 deletions .idea/.gitignore

This file was deleted.

9 changes: 0 additions & 9 deletions .idea/markdown.xml

This file was deleted.

11 changes: 0 additions & 11 deletions .idea/misc.xml

This file was deleted.

2 changes: 1 addition & 1 deletion .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/prettier.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/react-checkbox-hook.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Binary file added bun.lockb
Binary file not shown.
18 changes: 18 additions & 0 deletions example/.eslintrc.cjs
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
module.exports = {
root: true,
env: { browser: true, es2020: true },
extends: [
'eslint:recommended',
'plugin:@typescript-eslint/recommended',
'plugin:react-hooks/recommended',
],
ignorePatterns: ['dist', '.eslintrc.cjs'],
parser: '@typescript-eslint/parser',
plugins: ['react-refresh'],
rules: {
'react-refresh/only-export-components': [
'warn',
{ allowConstantExport: true },
],
},
}
24 changes: 24 additions & 0 deletions example/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
# Logs
logs
*.log
npm-debug.log*
yarn-debug.log*
yarn-error.log*
pnpm-debug.log*
lerna-debug.log*

node_modules
dist
dist-ssr
*.local

# Editor directories and files
.vscode/*
!.vscode/extensions.json
.idea
.DS_Store
*.suo
*.ntvs*
*.njsproj
*.sln
*.sw?
Loading

0 comments on commit 3826d7d

Please sign in to comment.