Skip to content

Commit 77dc42e

Browse files
committed
feat: modernize
1 parent 5fa51bc commit 77dc42e

16 files changed

+1806
-2281
lines changed

.eslintignore

-1
This file was deleted.

.eslintrc

-23
This file was deleted.

.github/FUNDING.yml

+1-4
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,3 @@
11
# These are supported funding model platforms
22

3-
ko_fi: v1rtl
4-
liberapay: v1rtl
5-
custom: ["https://stakes.social/0x14308514785B216904a41aB817282d25425Cce39", "https://paypal.me/v1rtl", "https://qiwi.com/n/V1RTL", "https://yoomoney.ru/to/410014774355272"]
6-
issuehunt: talentlessguy
3+
github: [tinyhttp]

.github/workflows/ci.yml

+19-30
Original file line numberDiff line numberDiff line change
@@ -1,38 +1,27 @@
1-
# This is a basic workflow to help you get started with Actions
2-
31
name: CI
42

5-
# Controls when the action will run. Triggers the workflow on push or pull request
6-
# events but only for the master branch
7-
on:
8-
push:
9-
branches: [master]
10-
pull_request:
11-
branches: [master]
3+
on: [push]
124

13-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
145
jobs:
15-
# This workflow contains a single job called "test"
16-
test:
17-
# The type of runner that the job will run on
6+
ci:
187
runs-on: ubuntu-latest
19-
20-
# Steps represent a sequence of tasks that will be executed as part of the job
218
steps:
22-
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
23-
- uses: actions/checkout@v2
24-
- uses: actions/setup-node@v2-beta
25-
with:
26-
node-version: '14.16.1'
27-
- name: install pnpm
28-
uses: pnpm/[email protected]
9+
- uses: actions/checkout@v4
10+
11+
- name: Enable corepack
12+
run: corepack enable pnpm
13+
14+
- uses: actions/setup-node@v4
2915
with:
30-
version: 6.2.5
31-
- run: pnpm install
32-
- run: pnpm test:coverage
33-
- run: pnpm test:report
34-
- name: Coveralls
35-
uses: coverallsapp/github-action@master
16+
cache: "pnpm"
17+
node-version: 22
18+
19+
- run: pnpm install --frozen-lockfile
20+
- name: Setup Biome
21+
uses: biomejs/setup-biome@v2
3622
with:
37-
github-token: ${{ secrets.GITHUB_TOKEN }}
38-
path-to-lcov: ./coverage.lcov
23+
version: latest
24+
- name: Run Biome
25+
run: biome ci .
26+
- name: Run tests
27+
run: pnpm test

.github/workflows/publish.yml

+32
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
name: Publish Package to npm
2+
on:
3+
release:
4+
types: [published]
5+
jobs:
6+
build:
7+
runs-on: ubuntu-latest
8+
permissions:
9+
contents: read
10+
id-token: write
11+
steps:
12+
- uses: actions/checkout@v4
13+
- name: Enable corepack
14+
run: corepack enable pnpm
15+
16+
- uses: actions/setup-node@v4
17+
with:
18+
cache: "pnpm"
19+
node-version: 22
20+
registry-url: "https://registry.npmjs.org"
21+
- run: pnpm install
22+
- run: pnpm build
23+
- name: Setup Biome
24+
uses: biomejs/setup-biome@v2
25+
with:
26+
version: latest
27+
28+
- name: Run Biome
29+
run: biome ci .
30+
- run: pnpm publish --no-git-checks
31+
env:
32+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}

.prettierignore

-1
This file was deleted.

.prettierrc

-7
This file was deleted.

.vscode/settings.json

+15
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"npm.packageManager": "pnpm",
3+
"editor.formatOnSave": true,
4+
"biome.enabled": true,
5+
"eslint.enable": false,
6+
"prettier.enable": false,
7+
"typescript.tsdk": "node_modules/typescript/lib",
8+
"[typescript]": {
9+
"editor.defaultFormatter": "biomejs.biome"
10+
},
11+
"editor.codeActionsOnSave": {
12+
"source.organizeImports.biome": "explicit",
13+
"quickfix.biome": "explicit"
14+
}
15+
}

biome.json

+49
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
{
2+
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
3+
"files": {
4+
"ignore": [
5+
"node_modules",
6+
"test-results",
7+
"playwright-report",
8+
"package.json",
9+
"dist"
10+
]
11+
},
12+
"organizeImports": {
13+
"enabled": true
14+
},
15+
"linter": {
16+
"enabled": true,
17+
"rules": {
18+
"recommended": true,
19+
"complexity": {
20+
"noForEach": "off"
21+
},
22+
"suspicious": {
23+
"noExplicitAny": "off"
24+
},
25+
"style": {
26+
"noNonNullAssertion": "off"
27+
},
28+
"correctness": {
29+
"noUnusedImports": "error",
30+
"noUnusedVariables": "error",
31+
"noUnusedPrivateClassMembers": "error"
32+
}
33+
}
34+
},
35+
"formatter": {
36+
"enabled": true
37+
},
38+
"javascript": {
39+
"formatter": {
40+
"enabled": true,
41+
"semicolons": "asNeeded",
42+
"quoteStyle": "single",
43+
"indentWidth": 2
44+
},
45+
"linter": {
46+
"enabled": true
47+
}
48+
}
49+
}
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,13 @@
1-
// eslint-disable-next-line @typescript-eslint/no-var-requires
2-
const defaultConfig = require('@commitlint/config-conventional')
1+
import _default from '@commitlint/config-conventional'
32

4-
module.exports = {
3+
export default {
54
extends: ['@commitlint/config-conventional'],
65
rules: {
7-
...defaultConfig.rules,
6+
..._default.rules,
87
'type-enum': [
98
2,
109
'always',
1110
['fix', 'test', 'tooling', 'refactor', 'revert', 'example', 'docs', 'format', 'feat', 'chore']
1211
]
1312
}
14-
}
13+
}

package.json

+20-28
Original file line numberDiff line numberDiff line change
@@ -26,34 +26,26 @@
2626
"dist"
2727
],
2828
"scripts": {
29-
"build": "rollup -c",
30-
"test": "node --experimental-loader esbuild-node-loader node_modules/uvu/bin.js tests",
31-
"test:coverage": "c8 --include=src pnpm test",
32-
"test:report": "c8 report --reporter=text-lcov > coverage.lcov",
33-
"lint": "eslint . --ext=ts",
34-
"format": "prettier --check \"./**/*.{ts,md}\"",
35-
"format:fix": "prettier --write \"./**/*.{ts,md}\"",
36-
"prepare": "husky install"
29+
"lint": "biome lint .",
30+
"format": "biome format .",
31+
"check": "biome check .",
32+
"build": "tsc -p tsconfig.build.json",
33+
"prepare": "husky",
34+
"test": "tsx --test tests/index.test.ts"
3735
},
3836
"devDependencies": {
39-
"@commitlint/cli": "13.1.0",
40-
"@commitlint/config-conventional": "13.1.0",
41-
"@rollup/plugin-typescript": "^8.2.5",
42-
"@tinyhttp/app": "2.0.4",
43-
"@types/node": "^16.9.2",
44-
"@typescript-eslint/eslint-plugin": "^4.31.1",
45-
"@typescript-eslint/parser": "^4.31.1",
46-
"c8": "^7.9.0",
47-
"esbuild-node-loader": "^0.3.1",
48-
"eslint": "^7.32.0",
49-
"eslint-config-prettier": "^8.3.0",
50-
"eslint-plugin-prettier": "^4.0.0",
51-
"expect": "^27.2.0",
52-
"husky": "^7.0.2",
53-
"prettier": "^2.4.1",
54-
"rollup": "^2.56.3",
55-
"supertest-fetch": "^1.4.3",
56-
"typescript": "~4.4.3",
57-
"uvu": "^0.5.1"
58-
}
37+
"@biomejs/biome": "^1.9.4",
38+
"@commitlint/cli": "19.5.0",
39+
"@commitlint/config-conventional": "19.5.0",
40+
"@tinyhttp/app": "2.4.0",
41+
"@types/node": "^22.7.6",
42+
"c8": "^10.1.2",
43+
"expect": "^29.7.0",
44+
"husky": "^9.1.6",
45+
"prettier": "^3.3.3",
46+
"supertest-fetch": "^2.0.0",
47+
"tsx": "^4.19.1",
48+
"typescript": "~5.6.3"
49+
},
50+
"packageManager": "[email protected]+sha512.73a29afa36a0d092ece5271de5177ecbf8318d454ecd701343131b8ebc0c1a91c487da46ab77c8e596d6acf1461e3594ced4becedf8921b074fbd8653ed7051c"
5951
}

0 commit comments

Comments
 (0)