Skip to content

Commit 52b18a6

Browse files
authored
Merge pull request #328 from NillionNetwork/feat/replace-biomejs-with-oxc
2 parents 0074d06 + 201146e commit 52b18a6

File tree

11 files changed

+1084
-1453
lines changed

11 files changed

+1084
-1453
lines changed

.oxlintrc.json

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,16 +2,14 @@
22
"$schema": "./node_modules/oxlint/configuration_schema.json",
33
"plugins": ["typescript", "import", "unicorn", "vitest"],
44
"categories": {
5-
"correctness": "warn"
5+
"correctness": "error"
66
},
77
"rules": {
88
"no-nested-ternary": "error",
99
"no-unneeded-ternary": "error",
1010
"no-unused-vars": "error",
1111
"typescript/no-explicit-any": "error",
1212
"typescript/explicit-function-return-type": "warn",
13-
"typescript/no-floating-promises": "off",
14-
"typescript/unbound-method": "off",
1513
"unicorn/prefer-node-protocol": "error",
1614
"unicorn/filename-case": ["error", { "case": "kebabCase" }],
1715
"import/no-cycle": "error"

justfile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,11 @@ build-deps:
2727

2828
# Check for formatting, lint, and type errors
2929
check: build-deps
30-
pnpm exec tsc -b && pnpm exec oxfmt --check && pnpm exec oxlint --type-aware && pnpm exec tsc -b --noEmit
30+
pnpm exec oxfmt --check && pnpm exec oxlint --type-aware && pnpm exec tsgo -b
3131

3232
# Format, fix, and type check all files
3333
fix:
34-
pnpm exec oxfmt && pnpm exec oxlint --fix --type-aware && pnpm exec tsc -b
34+
pnpm exec oxfmt && pnpm exec oxlint --fix --type-aware && pnpm exec tsgo -b
3535

3636
# Format all files
3737
fmt:

package.json

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,27 +3,28 @@
33
"repository": "https://github.com/NillionNetwork/nildb",
44
"type": "module",
55
"devDependencies": {
6-
"@commitlint/cli": "^20.2.0",
7-
"@commitlint/config-conventional": "^20.2.0",
8-
"@commitlint/types": "^20.2.0",
9-
"@faker-js/faker": "^10.1.0",
6+
"@commitlint/cli": "^20.3.1",
7+
"@commitlint/config-conventional": "^20.3.1",
8+
"@commitlint/types": "^20.3.1",
9+
"@faker-js/faker": "^10.2.0",
1010
"@types/elliptic": "^6.4.18",
1111
"@types/js-yaml": "^4.0.9",
12-
"@vitest/coverage-v8": "4.0.6",
13-
"lefthook": "^2.0.8",
14-
"oxfmt": "^0.23.0",
15-
"oxlint": "^1.38.0",
16-
"oxlint-tsgolint": "^0.10.1",
17-
"pino": "^10.1.0",
12+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
13+
"@vitest/coverage-v8": "4.0.17",
14+
"lefthook": "^2.0.15",
15+
"oxfmt": "^0.24.0",
16+
"oxlint": "^1.39.0",
17+
"oxlint-tsgolint": "^0.11.0",
18+
"pino": "^10.1.1",
1819
"pino-pretty": "^13.1.3",
19-
"testcontainers": "^10.16.0",
20-
"tsdown": "^0.15.12",
20+
"testcontainers": "^11.11.0",
21+
"tsdown": "0.20.0-beta.1",
2122
"tsx": "^4.21.0",
22-
"type-fest": "^5.3.0",
23+
"type-fest": "^5.4.0",
2324
"typescript": "^5.9.3",
24-
"vite": "^7.2.6",
25-
"vite-tsconfig-paths": "^5.1.4",
26-
"vitest": "4.0.6"
25+
"vite": "^7.3.1",
26+
"vite-tsconfig-paths": "^6.0.4",
27+
"vitest": "4.0.17"
2728
},
2829
"engines": {
2930
"node": ">=24"

packages/api/package.json

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@nillion/nildb",
3-
"version": "1.2.0",
3+
"version": "2.0.0",
44
"private": true,
55
"files": [
66
"dist",
@@ -39,21 +39,22 @@
3939
"@opentelemetry/sdk-node": "^0.54.2",
4040
"@opentelemetry/sdk-trace-node": "^1.30.1",
4141
"@opentelemetry/semantic-conventions": "^1.38.0",
42-
"mongodb": "^6.21.0"
42+
"mongodb": "^7.0.0"
4343
},
4444
"devDependencies": {
45-
"@hono/node-server": "^1.19.6",
45+
"@hono/node-server": "^1.19.8",
4646
"@hono/prometheus": "^1.0.2",
47-
"@hono/standard-validator": "^0.1.5",
48-
"@hono/zod-validator": "^0.7.5",
49-
"@nillion/nilauth-client": "1.0.0-rc.0",
47+
"@hono/standard-validator": "^0.2.1",
48+
"@hono/zod-validator": "^0.7.6",
49+
"@nillion/nilauth-client": "2.0.0",
5050
"@nillion/nildb-client": "workspace:*",
51-
"@nillion/nuc": "2.0.0-rc.0",
51+
"@nillion/nuc": "2.0.0",
5252
"@noble/curves": "^2.0.1",
5353
"@noble/hashes": "^2.0.1",
5454
"@standard-community/standard-json": "^0.3.5",
5555
"@standard-community/standard-openapi": "^0.2.9",
5656
"@types/migrate-mongo": "^10.0.6",
57+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
5758
"ajv": "^8.17.1",
5859
"ajv-formats": "^3.0.1",
5960
"bech32": "^2.0.0",
@@ -62,21 +63,21 @@
6263
"cors": "^2.8.5",
6364
"dotenv": "^17.2.3",
6465
"eciesjs": "^0.4.16",
65-
"effect": "^3.19.8",
66-
"es-toolkit": "^1.42.0",
67-
"hono": "^4.10.7",
68-
"hono-openapi": "^1.1.1",
69-
"hono-rate-limiter": "^0.4.2",
66+
"effect": "^3.19.14",
67+
"es-toolkit": "^1.43.0",
68+
"hono": "^4.11.4",
69+
"hono-openapi": "^1.1.2",
70+
"hono-rate-limiter": "^0.5.3",
7071
"http-status-codes": "^2.3.0",
7172
"js-yaml": "^4.1.1",
72-
"migrate-mongo": "^12.1.3",
73-
"pino": "^10.1.0",
73+
"migrate-mongo": "^14.0.7",
74+
"pino": "^10.1.1",
7475
"prom-client": "^15.1.3",
7576
"temporal-polyfill": "^0.3.0",
76-
"viem": "^2.21.0",
77-
"zod": "^4.1.13",
78-
"zod-openapi": "^5.4.5",
79-
"zod-validation-error": "^4.0.2"
77+
"viem": "^2.44.1",
78+
"zod": "^4.3.5",
79+
"zod-openapi": "^5.4.6",
80+
"zod-validation-error": "^5.0.0"
8081
},
8182
"tsdown": {
8283
"clean": true,

packages/api/src/env.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -117,10 +117,10 @@ declare global {
117117
APP_LOG_LEVEL: string;
118118
APP_NILAUTH_INSTANCES: string;
119119
APP_NILAUTH_CHAIN_ID: string;
120-
APP_METRICS_PORT?: number;
120+
APP_METRICS_PORT?: string;
121121
APP_NODE_SECRET_KEY: string;
122122
APP_NODE_PUBLIC_ENDPOINT: string;
123-
APP_PORT: number;
123+
APP_PORT: string;
124124
APP_RATE_LIMIT_ENABLED?: string;
125125
APP_RATE_LIMIT_WINDOW_SECONDS?: string;
126126
APP_RATE_LIMIT_MAX_REQUESTS?: string;

packages/api/src/middleware/capability.middleware.ts

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,10 @@ function buildNilauthInstancesWithDids(instances: NilauthInstance[]): NilauthIns
1818
}));
1919
}
2020

21-
function extractRootIssuerDid(envelope: Envelope): string {
21+
function extractRootIssuerDid(envelope: Envelope): Did {
2222
const proofs = envelope.proofs;
2323
const rootToken = proofs.length > 0 ? proofs[proofs.length - 1] : envelope.nuc;
24-
return rootToken.payload.iss.didString;
24+
return rootToken.payload.iss;
2525
}
2626

2727
export function loadNucToken<P extends string = string, I extends Input = BlankInput, E extends AppEnv = AppEnv>(
@@ -139,14 +139,13 @@ export function loadSubjectAndVerifyAsBuilder<
139139
context,
140140
});
141141

142-
// check revocations last because it's costly (in terms of network RTT)
142+
// Check revocations last because it's costly (in terms of network RTT)
143143
// Find the nilauth instance that issued the root token in the proof chain
144144
const rootIssuerDid = extractRootIssuerDid(envelope);
145-
const matchingNilauth = nilauthInstances.find((n) => n.did.didString === rootIssuerDid);
145+
const matchingNilauth = nilauthInstances.find((n) => Did.areEqual(n.did, rootIssuerDid));
146146

147147
if (!matchingNilauth) {
148-
// This shouldn't happen if validation passed, but handle defensively
149-
log.error("No matching nilauth instance found for root issuer: %s", rootIssuerDid);
148+
log.error("No matching nilauth instance found for root issuer: %s", rootIssuerDid.didString);
150149
return c.text(getReasonPhrase(StatusCodes.UNAUTHORIZED), StatusCodes.UNAUTHORIZED);
151150
}
152151

packages/api/src/users/users.mapper.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -214,23 +214,23 @@ export const UserDataMapper = {
214214
*/
215215
export const UserLoggerMapper = {
216216
toCreateDataLogs(collections: UUID[]): UserDataLogs[] {
217-
return collections.map(this.toCreateDataLog);
217+
return collections.map((c) => this.toCreateDataLog(c));
218218
},
219219

220220
toCreateDataLog(collection: UUID): UserDataLogs {
221221
return { op: "create-data", collection: collection.toString() };
222222
},
223223

224224
toDeleteDataLogs(documents: UUID[]): UserDataLogs[] {
225-
return documents.map(this.toDeleteDataLog);
225+
return documents.map((d) => this.toDeleteDataLog(d));
226226
},
227227

228228
toDeleteDataLog(collection: UUID): UserDataLogs {
229229
return { op: "delete-data", collection: collection.toString() };
230230
},
231231

232232
toUpdateDataLogs(documents: UUID[]): UserDataLogs[] {
233-
return documents.map(this.toUpdateDataLog);
233+
return documents.map((d) => this.toUpdateDataLog(d));
234234
},
235235

236236
toUpdateDataLog(collection: UUID): UserDataLogs {

packages/client/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@
2020
"stub": "tsdown --stub"
2121
},
2222
"dependencies": {
23-
"@nillion/nilauth-client": "1.0.0-rc.0",
23+
"@nillion/nilauth-client": "2.0.0",
2424
"@nillion/nildb-types": "workspace:*",
25-
"@nillion/nuc": "2.0.0-rc.0"
25+
"@nillion/nuc": "2.0.0"
2626
},
2727
"devDependencies": {
28-
"tsdown": "^0.15.12",
29-
"typescript": "^5.9.3"
28+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
29+
"tsdown": "0.20.0-beta.1"
3030
},
3131
"tsdown": {
3232
"clean": true,

packages/shared/package.json

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,14 @@
2020
"stub": "tsdown --stub"
2121
},
2222
"dependencies": {
23-
"@nillion/nuc": "2.0.0-rc.0",
23+
"@nillion/nuc": "2.0.0",
2424
"temporal-polyfill": "^0.3.0"
2525
},
2626
"devDependencies": {
2727
"@types/pino": "^7.0.5",
28-
"pino": "^10.1.0",
29-
"tsdown": "^0.15.12",
28+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
29+
"pino": "^10.1.1",
30+
"tsdown": "0.20.0-beta.1",
3031
"typescript": "^5.9.3"
3132
},
3233
"tsdown": {

packages/types/package.json

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,12 +20,12 @@
2020
},
2121
"dependencies": {
2222
"http-status-codes": "^2.3.0",
23-
"mongodb": "^6.21.0",
24-
"zod": "^4.1.13"
23+
"mongodb": "^7.0.0",
24+
"zod": "^4.3.5"
2525
},
2626
"devDependencies": {
27-
"tsdown": "^0.15.12",
28-
"typescript": "^5.9.3"
27+
"@typescript/native-preview": "7.0.0-dev.20260113.1",
28+
"tsdown": "0.20.0-beta.1"
2929
},
3030
"tsdown": {
3131
"clean": true,

0 commit comments

Comments
 (0)