Skip to content

Commit a88707a

Browse files
committed
oxLint addition,
improved server list creator
1 parent 46972bc commit a88707a

13 files changed

Lines changed: 405 additions & 66 deletions

File tree

.vscode/extensions.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"recommendations": [
3+
"oxc.oxc-vscode"
4+
]
5+
}

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ NitroCraft is a Minecraft avatar/render API built on Nitro and `minecraft-toolki
3131
- Short-TTL + in-flight deduplicated status probe caching for `/status/*` endpoints
3232
- Configurable outbound Mojang session rate limiting (`SESSIONS_RATE_LIMIT`)
3333
- Optional inbound per-IP request rate limiting (`REQUESTS_RATE_LIMIT`)
34-
- OpenAPI schema (`/openapi.json`), hosted API docs (`/docs`), and Prometheus metrics (`/metrics`)
34+
- Hosted API docs (`/docs`) and Prometheus metrics (`/metrics`)
3535
- Interactive server-list simulator (`/tools/server-list`) with import/share flow
3636
- Nitro runtime with `pnpm` workflows
3737

@@ -69,7 +69,6 @@ NitroCraft is a Minecraft avatar/render API built on Nitro and `minecraft-toolki
6969
### Tooling and Meta
7070

7171
- `GET /tools/server-list`
72-
- `GET /openapi.json`
7372
- `GET /docs`
7473
- `GET /metrics`
7574

@@ -97,6 +96,12 @@ pnpm start
9796
pnpm test
9897
```
9998

99+
### Run Lint
100+
101+
```bash
102+
pnpm lint
103+
```
104+
100105
## Docker
101106

102107
```bash

nitro.config.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ export default defineNitroConfig({
1010
openAPI: {
1111
// Keep docs available in prod builds.
1212
production: "runtime",
13-
// Leave generated spec on internal route and keep custom /openapi.json intact.
13+
// Use Nitro-generated spec route.
1414
route: "/_openapi.json",
1515
meta: {
1616
title: "NitroCraft API",
@@ -19,10 +19,10 @@ export default defineNitroConfig({
1919
ui: {
2020
scalar: {
2121
route: "/docs",
22-
// Point Scalar UI at the richer hand-authored schema route.
23-
url: "/openapi.json",
22+
// Use Nitro-generated OpenAPI document for docs.
23+
url: "/_openapi.json",
2424
spec: {
25-
url: "/openapi.json",
25+
url: "/_openapi.json",
2626
},
2727
},
2828
swagger: false,

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,8 @@
88
"build": "nitro build",
99
"preview": "nitro preview",
1010
"start": "node .output/server/index.mjs",
11+
"lint": "oxlint . --ignore-path .gitignore --deny-warnings",
12+
"lint:fix": "oxlint . --ignore-path .gitignore --fix",
1113
"test": "tsx --test --test-concurrency=1 test/unit/config-utils.test.ts test/unit/routes-and-rate-limit.test.ts",
1214
"loadtest": "tsx test/loadtest.ts",
1315
"audit:security": "pnpm audit --audit-level=high --prod"
@@ -27,6 +29,7 @@
2729
"devDependencies": {
2830
"@types/node": "^25.3.5",
2931
"autocannon": "^8.0.0",
32+
"oxlint": "^1.51.0",
3033
"tsx": "^4.21.0",
3134
"typescript": "^5.9.3"
3235
},

pnpm-lock.yaml

Lines changed: 206 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

public/favicon.ico

232 KB
Binary file not shown.

public/javascript/nitrocraft.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ fetch("/status/mc", { cache: "no-store" }).then(function(r) {
2929
}
3030
}).catch(function() {});
3131

32-
document.addEventListener("DOMContentLoaded", function(event) {
32+
document.addEventListener("DOMContentLoaded", function() {
3333
var avatars = document.querySelector("#avatar-wrapper");
3434
var avatarPickers = [];
3535
var pinnedAvatarPickers = [];

0 commit comments

Comments
 (0)