Skip to content

Commit

Permalink
feat: modernize
Browse files Browse the repository at this point in the history
  • Loading branch information
talentlessguy committed Oct 17, 2024
1 parent 5fa51bc commit 77dc42e
Show file tree
Hide file tree
Showing 16 changed files with 1,806 additions and 2,281 deletions.
1 change: 0 additions & 1 deletion .eslintignore

This file was deleted.

23 changes: 0 additions & 23 deletions .eslintrc

This file was deleted.

5 changes: 1 addition & 4 deletions .github/FUNDING.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# These are supported funding model platforms

ko_fi: v1rtl
liberapay: v1rtl
custom: ["https://stakes.social/0x14308514785B216904a41aB817282d25425Cce39", "https://paypal.me/v1rtl", "https://qiwi.com/n/V1RTL", "https://yoomoney.ru/to/410014774355272"]
issuehunt: talentlessguy
github: [tinyhttp]
49 changes: 19 additions & 30 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,38 +1,27 @@
# This is a basic workflow to help you get started with Actions

name: CI

# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [master]
pull_request:
branches: [master]
on: [push]

# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "test"
test:
# The type of runner that the job will run on
ci:
runs-on: ubuntu-latest

# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/setup-node@v2-beta
with:
node-version: '14.16.1'
- name: install pnpm
uses: pnpm/[email protected]
- uses: actions/checkout@v4

- name: Enable corepack
run: corepack enable pnpm

- uses: actions/setup-node@v4
with:
version: 6.2.5
- run: pnpm install
- run: pnpm test:coverage
- run: pnpm test:report
- name: Coveralls
uses: coverallsapp/github-action@master
cache: "pnpm"
node-version: 22

- run: pnpm install --frozen-lockfile
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
path-to-lcov: ./coverage.lcov
version: latest
- name: Run Biome
run: biome ci .
- name: Run tests
run: pnpm test
32 changes: 32 additions & 0 deletions .github/workflows/publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
name: Publish Package to npm
on:
release:
types: [published]
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable pnpm

- uses: actions/setup-node@v4
with:
cache: "pnpm"
node-version: 22
registry-url: "https://registry.npmjs.org"
- run: pnpm install
- run: pnpm build
- name: Setup Biome
uses: biomejs/setup-biome@v2
with:
version: latest

- name: Run Biome
run: biome ci .
- run: pnpm publish --no-git-checks
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
1 change: 0 additions & 1 deletion .prettierignore

This file was deleted.

7 changes: 0 additions & 7 deletions .prettierrc

This file was deleted.

15 changes: 15 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"npm.packageManager": "pnpm",
"editor.formatOnSave": true,
"biome.enabled": true,
"eslint.enable": false,
"prettier.enable": false,
"typescript.tsdk": "node_modules/typescript/lib",
"[typescript]": {
"editor.defaultFormatter": "biomejs.biome"
},
"editor.codeActionsOnSave": {
"source.organizeImports.biome": "explicit",
"quickfix.biome": "explicit"
}
}
49 changes: 49 additions & 0 deletions biome.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"$schema": "https://biomejs.dev/schemas/1.8.3/schema.json",
"files": {
"ignore": [
"node_modules",
"test-results",
"playwright-report",
"package.json",
"dist"
]
},
"organizeImports": {
"enabled": true
},
"linter": {
"enabled": true,
"rules": {
"recommended": true,
"complexity": {
"noForEach": "off"
},
"suspicious": {
"noExplicitAny": "off"
},
"style": {
"noNonNullAssertion": "off"
},
"correctness": {
"noUnusedImports": "error",
"noUnusedVariables": "error",
"noUnusedPrivateClassMembers": "error"
}
}
},
"formatter": {
"enabled": true
},
"javascript": {
"formatter": {
"enabled": true,
"semicolons": "asNeeded",
"quoteStyle": "single",
"indentWidth": 2
},
"linter": {
"enabled": true
}
}
}
9 changes: 4 additions & 5 deletions commitlint.config.cjs → commitlint.config.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// eslint-disable-next-line @typescript-eslint/no-var-requires
const defaultConfig = require('@commitlint/config-conventional')
import _default from '@commitlint/config-conventional'

module.exports = {
export default {
extends: ['@commitlint/config-conventional'],
rules: {
...defaultConfig.rules,
..._default.rules,
'type-enum': [
2,
'always',
['fix', 'test', 'tooling', 'refactor', 'revert', 'example', 'docs', 'format', 'feat', 'chore']
]
}
}
}
48 changes: 20 additions & 28 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,34 +26,26 @@
"dist"
],
"scripts": {
"build": "rollup -c",
"test": "node --experimental-loader esbuild-node-loader node_modules/uvu/bin.js tests",
"test:coverage": "c8 --include=src pnpm test",
"test:report": "c8 report --reporter=text-lcov > coverage.lcov",
"lint": "eslint . --ext=ts",
"format": "prettier --check \"./**/*.{ts,md}\"",
"format:fix": "prettier --write \"./**/*.{ts,md}\"",
"prepare": "husky install"
"lint": "biome lint .",
"format": "biome format .",
"check": "biome check .",
"build": "tsc -p tsconfig.build.json",
"prepare": "husky",
"test": "tsx --test tests/index.test.ts"
},
"devDependencies": {
"@commitlint/cli": "13.1.0",
"@commitlint/config-conventional": "13.1.0",
"@rollup/plugin-typescript": "^8.2.5",
"@tinyhttp/app": "2.0.4",
"@types/node": "^16.9.2",
"@typescript-eslint/eslint-plugin": "^4.31.1",
"@typescript-eslint/parser": "^4.31.1",
"c8": "^7.9.0",
"esbuild-node-loader": "^0.3.1",
"eslint": "^7.32.0",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"expect": "^27.2.0",
"husky": "^7.0.2",
"prettier": "^2.4.1",
"rollup": "^2.56.3",
"supertest-fetch": "^1.4.3",
"typescript": "~4.4.3",
"uvu": "^0.5.1"
}
"@biomejs/biome": "^1.9.4",
"@commitlint/cli": "19.5.0",
"@commitlint/config-conventional": "19.5.0",
"@tinyhttp/app": "2.4.0",
"@types/node": "^22.7.6",
"c8": "^10.1.2",
"expect": "^29.7.0",
"husky": "^9.1.6",
"prettier": "^3.3.3",
"supertest-fetch": "^2.0.0",
"tsx": "^4.19.1",
"typescript": "~5.6.3"
},
"packageManager": "[email protected]+sha512.73a29afa36a0d092ece5271de5177ecbf8318d454ecd701343131b8ebc0c1a91c487da46ab77c8e596d6acf1461e3594ced4becedf8921b074fbd8653ed7051c"
}
Loading

0 comments on commit 77dc42e

Please sign in to comment.