Skip to content

Commit 8fefc4e

Browse files
authored
Fix broken windows (#121)
Includes: - Switch to Biome for formatting and linting - Ignore `pnpm-workspace.yaml` in `.gitignore` - Update copyright year in `license` - Refactor imports for type-only usage
1 parent 897fc66 commit 8fefc4e

File tree

9 files changed

+59
-61
lines changed

9 files changed

+59
-61
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,14 +12,13 @@ jobs:
1212
options: --user 1001
1313
strategy:
1414
matrix:
15-
node: ["18", "20", "22"]
15+
node: ["18", "20", "22", "24"]
1616
name: Node v${{ matrix.node }}
1717
steps:
1818
- uses: actions/checkout@v3
1919
- uses: actions/setup-node@v3
2020
with:
2121
node-version: ${{ matrix.node }}
2222
- run: npm install
23-
- run: npm run fmt-check
2423
- run: npm run lint
2524
- run: npm run test

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,5 @@ ogr_*
44
coverage
55
dist
66
pnpm-lock.yaml
7+
pnpm-workspace.yaml
78
package-lock.json

.prettierrc

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

biome.json

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
{
2+
"files": {
3+
"ignore": ["dist", "pnpm-*.yaml", "coverage", "testdata"]
4+
},
5+
"formatter": {
6+
"enabled": true,
7+
"indentStyle": "space",
8+
"bracketSpacing": false
9+
},
10+
"linter": {
11+
"enabled": true,
12+
"rules": {
13+
"a11y": {
14+
"all": false
15+
},
16+
"style": {
17+
"useConst": "off",
18+
"useTemplate": "off",
19+
"noParameterAssign": "off",
20+
"useSingleVarDeclarator": "off"
21+
},
22+
"correctness": {
23+
"noUnusedImports": "error"
24+
},
25+
"suspicious": {
26+
"noExplicitAny": "off",
27+
"noArrayIndexKey": "off",
28+
"noImplicitAnyLet": "off"
29+
}
30+
}
31+
},
32+
"javascript": {
33+
"formatter": {
34+
"semicolons": "asNeeded"
35+
}
36+
},
37+
"organizeImports": {
38+
"enabled": true
39+
}
40+
}

eslint.config.js

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

index.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
1-
import {serve} from "@hono/node-server"
2-
import {ErrorHandler, Handler, Hono, NotFoundHandler} from "hono"
3-
import {bodyLimit} from "hono/body-limit"
4-
import {cors} from "hono/cors"
5-
import {BlankEnv, BlankSchema} from "hono/types"
61
import {randomBytes} from "node:crypto"
72
import {unlink, writeFile} from "node:fs/promises"
83
import {tmpdir} from "node:os"
94
import {Readable} from "node:stream"
5+
import {serve} from "@hono/node-server"
6+
import {type ErrorHandler, type Handler, Hono, type NotFoundHandler} from "hono"
7+
import {bodyLimit} from "hono/body-limit"
8+
import {cors} from "hono/cors"
9+
import type {BlankEnv, BlankSchema} from "hono/types"
1010
import {ogr2ogr} from "ogr2ogr"
1111
import index from "./index.html?raw"
1212

@@ -44,7 +44,9 @@ export class Ogre {
4444
this.timeout = timeout
4545
this.limit = limit
4646

47-
let app = (this.app = new Hono())
47+
let app = new Hono()
48+
this.app = app
49+
4850
app.notFound(this.notFound())
4951
app.onError(this.serverError())
5052

@@ -161,10 +163,10 @@ export class Ogre {
161163

162164
if (out.stream) {
163165
return c.body(Readable.toWeb(out.stream) as ReadableStream)
164-
} else if (out.text) {
166+
}
167+
if (out.text) {
165168
return c.text(out.text)
166-
} else {
167-
return c.json(out.data)
168169
}
170+
return c.json(out.data)
169171
}
170172
}

index_test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import {serve} from "@hono/node-server"
22
import request from "supertest"
33
import {assert, test} from "vitest"
4-
import {Ogre, OgreOpts} from "./"
4+
import {Ogre, type OgreOpts} from "./"
55

66
test(async () => {
77
let table: {

license

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2021 Marc Harter <wavded@gmail.com>
1+
Copyright (c) 2025 Marc Harter <wavded@gmail.com>
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44

package.json

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,7 @@
22
"name": "ogre",
33
"version": "5.0.3",
44
"description": "ogr2ogr web client",
5-
"keywords": [
6-
"ogr2ogr",
7-
"GIS",
8-
"GeoJSON"
9-
],
5+
"keywords": ["ogr2ogr", "GIS", "GeoJSON"],
106
"author": "Marc Harter <wavded@gmail.com>",
117
"repository": {
128
"type": "git",
@@ -22,9 +18,8 @@
2218
"build": "tsup-node cli.ts",
2319
"start": "pnpm build && dist/cli.cjs",
2420
"test": "vitest run --silent",
25-
"lint": "tsc --noEmit && eslint .",
26-
"fmt": "prettier --write .",
27-
"fmt-check": "prettier --check ."
21+
"lint": "tsc --noEmit && biome check .",
22+
"fix": "biome check --write ."
2823
},
2924
"tsup": {
3025
"loader": {
@@ -38,28 +33,17 @@
3833
"ogr2ogr": "6.0.0"
3934
},
4035
"devDependencies": {
41-
"@eslint/js": "^9.24.0",
36+
"@biomejs/biome": "^1.9.4",
4237
"@types/archiver": "^6.0.3",
4338
"@types/node": "^22.14.1",
4439
"@types/supertest": "^6.0.3",
45-
"eslint": "^9.24.0",
46-
"eslint-config-prettier": "^10.1.2",
47-
"eslint-plugin-prettier": "^5.2.6",
48-
"prettier": "^3.5.3",
49-
"prettier-plugin-organize-imports": "^4.1.0",
5040
"supertest": "^7.1.0",
5141
"tsup": "^8.4.0",
5242
"tsx": "^4.19.3",
5343
"typescript": "^5.8.3",
54-
"typescript-eslint": "^8.30.1",
5544
"vitest": "^3.1.1"
5645
},
5746
"engines": {
5847
"node": ">=18"
59-
},
60-
"pnpm": {
61-
"onlyBuiltDependencies": [
62-
"esbuild"
63-
]
6448
}
6549
}

0 commit comments

Comments
 (0)