Skip to content

Commit d7994a0

Browse files
committed
feat: move to bun + tsc, raise target to 14.18+ and 16.20+
1 parent 6997973 commit d7994a0

File tree

14 files changed

+104
-134
lines changed

14 files changed

+104
-134
lines changed

.eslintignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

.eslintrc

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
{
2+
"root": true,
3+
"extends": ["prettier", "plugin:prettier/recommended", "plugin:@typescript-eslint/recommended"],
4+
"plugins": ["@typescript-eslint", "prettier"],
25
"parser": "@typescript-eslint/parser",
3-
"extends": ["eslint:recommended", "plugin:@typescript-eslint/recommended", "prettier"],
4-
"plugins": ["@typescript-eslint"],
56
"parserOptions": {
6-
"ecmaVersion": 2020,
7-
"sourceType": "module"
8-
},
9-
"env": {
10-
"node": true,
11-
"es6": true
7+
"project": "./tsconfig.eslint.json"
128
},
9+
"ignorePatterns": ["dist/", "node_modules/"],
10+
"overrides": [
11+
{
12+
"files": ["src/**/*.ts", "tests/**/*.ts"]
13+
}
14+
],
1315
"rules": {
14-
"@typescript-eslint/explicit-function-return-type": "off",
15-
"@typescript-eslint/no-explicit-any": "off",
16-
"@typescript-eslint/no-unused-vars": "off",
17-
"@typescript-eslint/explicit-module-boundary-types": "off",
18-
"@typescript-eslint/ban-ts-comment": "off",
19-
"no-unused-vars": "off",
20-
"no-console": "off",
21-
"no-undef": "off"
16+
"@typescript-eslint/explicit-module-boundary-types": "off"
2217
}
2318
}

.github/FUNDING.yml

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,2 @@
1-
ko_fi: v1rtl
2-
liberapay: v1rtl
31
issuehunt: talentlessguy
4-
github: talentlessguy
2+
github: [tinyhttp, talentlessguy]

.github/workflows/ci.yml

Lines changed: 17 additions & 28 deletions
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
1+
on: [push]
22

3-
name: CI
4-
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]
12-
13-
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
143
jobs:
15-
# This workflow contains a single job called "test"
164
test:
17-
# The type of runner that the job will run on
185
runs-on: ubuntu-latest
19-
20-
# Steps represent a sequence of tasks that will be executed as part of the job
216
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.x
27-
- name: install pnpm
28-
uses: pnpm/action-setup@v2
7+
- uses: actions/checkout@v3
8+
- uses: oven-sh/setup-bun@v1
299
with:
30-
version: 6.x
31-
- run: pnpm install
32-
- run: pnpm test:coverage
33-
- run: pnpm test:report
10+
bun-version: latest
11+
- run: bun install
12+
- run: bun test:coverage
13+
- run: bun test:report
3414
- name: Coveralls
3515
uses: coverallsapp/github-action@master
3616
with:
3717
github-token: ${{ secrets.GITHUB_TOKEN }}
38-
path-to-lcov: ./coverage.lcov
18+
path-to-lcov: ./lcov.info
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v3
23+
- uses: oven-sh/setup-bun@v1
24+
with:
25+
bun-version: latest
26+
- run: bun install
27+
- run: bun run build

.gitignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules
22
dist
33
coverage
44
log
5-
*.tsbuildinfo
5+
*.tsbuildinfo
6+
lcov.info

.prettierignore

Lines changed: 0 additions & 1 deletion
This file was deleted.

bun.lockb

159 KB
Binary file not shown.

package.json

Lines changed: 23 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"url": "https://github.com/tinyhttp/logger.git"
1010
},
1111
"engines": {
12-
"node": ">=12.4 || 14.x || >=16"
12+
"node": ">=14.18 || >=16.20"
1313
},
1414
"types": "./dist/index.d.ts",
1515
"exports": "./dist/index.js",
@@ -26,40 +26,37 @@
2626
"dist"
2727
],
2828
"dependencies": {
29-
"colorette": "^2.0.20",
30-
"dayjs": "^1.11.7",
31-
"http-status-emojis": "^2.2.0"
29+
"colorette": "latest",
30+
"dayjs": "latest",
31+
"http-status-emojis": "latest"
3232
},
3333
"scripts": {
34-
"build": "rollup -c",
35-
"test": "uvu -r tsm tests",
36-
"test:coverage": "c8 --include=src pnpm test",
37-
"test:report": "c8 report --reporter=text-lcov > coverage.lcov",
34+
"build": "tsc",
35+
"test": "tsx tests/index.test.ts",
36+
"test:coverage": "c8 tsx --test tests/index.test.ts",
37+
"test:report": "c8 report --reporter=text-lcov > lcov.info",
3838
"lint": "eslint . --ext=ts",
3939
"format": "prettier --check \"./**/*.{ts,md}\"",
4040
"format:fix": "prettier --write \"./**/*.{ts,md}\"",
4141
"prepare": "husky install"
4242
},
4343
"devDependencies": {
44-
"@commitlint/cli": "17.6.3",
45-
"@commitlint/config-conventional": "17.6.3",
46-
"@rollup/plugin-typescript": "^11.1.1",
47-
"@tinyhttp/app": "2.1.0",
48-
"@types/node": "^20.2.5",
49-
"@typescript-eslint/eslint-plugin": "^5.59.7",
50-
"@typescript-eslint/parser": "^5.59.7",
51-
"c8": "^7.13.0",
52-
"eslint": "^8.41.0",
53-
"eslint-config-prettier": "^8.8.0",
54-
"eslint-plugin-prettier": "^4.2.1",
55-
"expect": "^29.5.0",
44+
"@commitlint/cli": "^18.2.0",
45+
"@commitlint/config-conventional": "^18.1.0",
46+
"@tinyhttp/app": "^2.2.0",
47+
"@types/node": "^20.8.9",
48+
"@typescript-eslint/eslint-plugin": "^6.9.0",
49+
"@typescript-eslint/parser": "^6.9.0",
50+
"bun-types": "^1.0.7",
51+
"c8": "^8.0.1",
52+
"eslint": "^8.52.0",
53+
"eslint-config-prettier": "^9.0.0",
54+
"eslint-plugin-prettier": "^5.0.1",
55+
"expect": "^29.7.0",
5656
"husky": "^8.0.3",
57-
"prettier": "^2.8.8",
58-
"rollup": "^3.23.0",
57+
"prettier": "^3.0.3",
5958
"supertest-fetch": "^1.5.0",
60-
"tslib": "^2.5.2",
61-
"tsm": "^2.3.0",
62-
"typescript": "^5.0.4",
63-
"uvu": "^0.5.6"
59+
"tsx": "^3.14.0",
60+
"typescript": "^5.2.2"
6461
}
6562
}

rollup.config.js

Lines changed: 0 additions & 14 deletions
This file was deleted.

src/filelogger.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import { accessSync, writeFileSync, createWriteStream, WriteStream, mkdirSync } from 'fs'
2-
import { dirname as directoryname } from 'path'
1+
import { accessSync, writeFileSync, createWriteStream, WriteStream, mkdirSync } from 'node:fs'
2+
import { dirname as directoryname } from 'node:path'
33

44
export class FileLogger {
55
readonly #filename: string

0 commit comments

Comments
 (0)