Skip to content

Commit 0f19f71

Browse files
authored
2025 updates (#470)
* chore: bump dev deps / update biome config * chore: fix vscode biome integration * chore: bump tsconfig to es2022 from es2019 because of `Object.hasOwn` * feat(dotenv, proxy-addr): bump `engines.node` to v16.10 * chore: biome fmt * chore: make biome respect gitignore * chore: dont lint test fixtures * refactor(send): better types * chore: bump changesets cli * feat(accepts, res, send, type-is): bump mime * chore(accepts): bump negotiator types * chore: dedupe * feat(app): bump engines * chore: dedupe
1 parent 2d2003a commit 0f19f71

72 files changed

Lines changed: 812 additions & 585 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/main.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ jobs:
3333
- uses: actions/setup-node@v4
3434
with:
3535
cache: "pnpm"
36-
node-version: 18
36+
node-version: 20
3737
registry-url: "https://registry.npmjs.org"
3838

3939
- name: install dependencies

.github/workflows/release.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ jobs:
2929
- uses: actions/setup-node@v4
3030
with:
3131
cache: "pnpm"
32-
node-version: 18
32+
node-version: 20
3333
registry-url: "https://registry.npmjs.org"
3434

3535
- name: Install dependencies

.vscode/settings.json

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,5 +8,17 @@
88
"source.fixAll": "explicit",
99
"source.organizeImports.biome": "explicit"
1010
},
11-
"typescript.tsdk": "node_modules/typescript/lib"
11+
"typescript.tsdk": "node_modules/typescript/lib",
12+
"[typescript]": {
13+
"editor.defaultFormatter": "biomejs.biome"
14+
},
15+
"[typescriptreact]": {
16+
"editor.defaultFormatter": "biomejs.biome"
17+
},
18+
"[javascript]": {
19+
"editor.defaultFormatter": "biomejs.biome"
20+
},
21+
"[json]": {
22+
"editor.defaultFormatter": "biomejs.biome"
23+
}
1224
}

biome.json

Lines changed: 23 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -1,54 +1,41 @@
11
{
2-
"$schema": "https://biomejs.dev/schemas/1.8.2/schema.json",
2+
"$schema": "https://biomejs.dev/schemas/2.2.4/schema.json",
3+
"vcs": {
4+
"enabled": true,
5+
"clientKind": "git",
6+
"useIgnoreFile": true
7+
},
38
"files": {
4-
"ignore": [
5-
"node_modules",
6-
"packages/*/dist",
7-
"examples/aws/.build",
8-
"examples/firebase-functions/lib",
9-
"coverage",
10-
".pnpm-store"
11-
]
9+
"ignoreUnknown": false,
10+
"includes": ["**", "!coverage", "!packages/*/dist", "tests/fixtures"]
1211
},
1312
"formatter": {
1413
"enabled": true,
15-
"formatWithErrors": false,
16-
"indentStyle": "space",
17-
"indentWidth": 2,
18-
"lineEnding": "lf",
19-
"lineWidth": 120,
20-
"attributePosition": "auto"
21-
},
22-
"organizeImports": {
23-
"enabled": true
14+
"indentStyle": "space"
2415
},
2516
"linter": {
2617
"enabled": true,
2718
"rules": {
28-
"recommended": true,
29-
"correctness": {
30-
"noVoidTypeReturn": "off"
31-
},
32-
"style": {
33-
"noParameterAssign": "off"
34-
},
35-
"suspicious": {
36-
"noAssignInExpressions": "off",
37-
"noExplicitAny": "warn"
38-
}
19+
"recommended": true
3920
}
4021
},
4122
"javascript": {
4223
"formatter": {
43-
"jsxQuoteStyle": "double",
44-
"quoteProperties": "asNeeded",
45-
"trailingCommas": "none",
24+
"quoteStyle": "single",
4625
"semicolons": "asNeeded",
47-
"arrowParentheses": "always",
48-
"bracketSpacing": true,
4926
"bracketSameLine": false,
50-
"quoteStyle": "single",
51-
"attributePosition": "auto"
27+
"bracketSpacing": true,
28+
"indentWidth": 2,
29+
"lineWidth": 120,
30+
"trailingCommas": "none"
31+
}
32+
},
33+
"assist": {
34+
"enabled": true,
35+
"actions": {
36+
"source": {
37+
"organizeImports": "on"
38+
}
5239
}
5340
}
5441
}

examples/couchdb/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const app = new App()
99
dotenv.config()
1010
const USER = process.env.USER
1111
const PASS = process.env.PASS
12-
const PORT = Number.parseInt(process.env.PORT) || 3000
12+
const PORT = Number.parseInt(process.env.PORT, 10) || 3000
1313

1414
// if node_env is not in production then use local databse
1515
const COUCHDB_URI =

examples/custom-view/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ app.engine('html', async (path, locals, _opts, cb) => {
1717
cb(null, renderedTemplate)
1818
})
1919

20-
app.get('/', (req, res) => {
20+
app.get('/', (_req, res) => {
2121
res.render('hello.html', { name: 'v1rtl' })
2222
})
2323

examples/deta/index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const app = new App()
99

1010
app.use(parser.json())
1111

12-
const PORT = Number.parseInt(process.env.PORT) || 3000
12+
const PORT = Number.parseInt(process.env.PORT, 10) || 3000
1313

1414
const deta = Deta(process.env.KEY)
1515

examples/elasticsearch/client.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import { Client } from '@elastic/elasticsearch'
22
import { config } from '@tinyhttp/dotenv'
3+
34
config()
45

56
//define elastic client and read keys from the environment

examples/elasticsearch/server.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { App } from '@tinyhttp/app'
22
import { json as json_parser } from 'milliparsec'
33
import { bulkInsert, insert, search } from './client.js'
4-
import { PORT, hasPostProps, isEmptyObject, isEmptyString } from './utils.js'
4+
import { hasPostProps, isEmptyObject, isEmptyString, PORT } from './utils.js'
55

66
const app = new App().use('/', json_parser())
77

examples/elasticsearch/utils.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ export const hasPostProps = (obj) => Object.keys(obj).every((x) => ['title', 'ab
88

99
export const isEmptyString = (data) => data.length === 0
1010

11-
export const PORT = Number.parseInt(process.env.PORT || '3000')
11+
export const PORT = Number.parseInt(process.env.PORT || '3000', 10)

0 commit comments

Comments
 (0)