Skip to content

Commit ce88d82

Browse files
committed
chore: update deps and lint
1 parent b26b3db commit ce88d82

33 files changed

+2130
-1752
lines changed

.oxfmtrc.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"$schema": "https://unpkg.com/oxfmt/configuration_schema.json",
3+
"ignorePatterns": ["test/wpt", "test/.snapshot"]
4+
}

.oxlintrc.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
{
2+
"$schema": "https://unpkg.com/oxlint/configuration_schema.json",
3+
"plugins": [
4+
"unicorn",
5+
"typescript",
6+
"oxc"
7+
],
8+
"ignorePatterns": ["test/.snapshot"],
9+
"rules": {}
10+
}

.prettierignore

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

.prettierrc

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

AGENTS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,7 @@ interface Node<T> {
7878
### Compiler
7979

8080
`compileRouter()` generates an optimized function via `new Function()`:
81+
8182
- Inlines static routes for O(1) lookup
8283
- Unrolls segment checks into `split("/")`-based array access
8384
- Inlines regex patterns for param validation

README.md

Lines changed: 26 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -98,21 +98,21 @@ findRoute(router, "GET", "/");
9898

9999
rou3 supports [URLPattern](https://developer.mozilla.org/en-US/docs/Web/API/URL_Pattern_API)-compatible syntax.
100100

101-
| Pattern | Example Match | Params |
102-
| --- | --- | --- |
103-
| `/path/to/resource` | `/path/to/resource` | `{}` |
104-
| `/users/:name` | `/users/foo` | `{ name: "foo" }` |
105-
| `/path/**` | `/path/foo/bar` | `{}` |
106-
| `/path/**:rest` | `/path/foo/bar` | `{ rest: "foo/bar" }` |
107-
| `/files/*.png` | `/files/icon.png` | `{ "0": "icon" }` |
108-
| `/files/file-*-*.png` | `/files/file-a-b.png` | `{ "0": "a", "1": "b" }` |
109-
| `/users/:id(\\d+)` | `/users/123` | `{ id: "123" }` |
110-
| `/files/:ext(png\|jpg)` | `/files/png` | `{ ext: "png" }` |
111-
| `/path/(\\d+)` | `/path/123` | `{ "0": "123" }` |
112-
| `/users/:id?` | `/users` or `/users/123` | `{}` or `{ id: "123" }` |
113-
| `/files/:path+` | `/files/a/b/c` | `{ path: "a/b/c" }` |
114-
| `/files/:path*` | `/files` or `/files/a/b` | `{}` or `{ path: "a/b" }` |
115-
| `/book{s}?` | `/book` or `/books` | `{}` |
101+
| Pattern | Example Match | Params |
102+
| --------------------------- | ---------------------------------- | ---------------------------------------------------- |
103+
| `/path/to/resource` | `/path/to/resource` | `{}` |
104+
| `/users/:name` | `/users/foo` | `{ name: "foo" }` |
105+
| `/path/**` | `/path/foo/bar` | `{}` |
106+
| `/path/**:rest` | `/path/foo/bar` | `{ rest: "foo/bar" }` |
107+
| `/files/*.png` | `/files/icon.png` | `{ "0": "icon" }` |
108+
| `/files/file-*-*.png` | `/files/file-a-b.png` | `{ "0": "a", "1": "b" }` |
109+
| `/users/:id(\\d+)` | `/users/123` | `{ id: "123" }` |
110+
| `/files/:ext(png\|jpg)` | `/files/png` | `{ ext: "png" }` |
111+
| `/path/(\\d+)` | `/path/123` | `{ "0": "123" }` |
112+
| `/users/:id?` | `/users` or `/users/123` | `{}` or `{ id: "123" }` |
113+
| `/files/:path+` | `/files/a/b/c` | `{ path: "a/b/c" }` |
114+
| `/files/:path*` | `/files` or `/files/a/b` | `{}` or `{ path: "a/b" }` |
115+
| `/book{s}?` | `/book` or `/books` | `{}` |
116116
| `/blog/:id(\\d+){-:title}?` | `/blog/123` or `/blog/123-my-post` | `{ id: "123" }` or `{ id: "123", title: "my-post" }` |
117117

118118
- **Named params** (`:name`) match a single segment.
@@ -129,17 +129,17 @@ rou3 supports [URLPattern](https://developer.mozilla.org/en-US/docs/Web/API/URL_
129129

130130
rou3 aims for URLPattern-compatible syntax but has intentional differences due to its radix-tree design:
131131

132-
| Feature | URLPattern | rou3 |
133-
| --- | --- | --- |
134-
| `*` (single star) | Greedy catch-all `(.*)` across `/` | Single-segment unnamed param `([^/]*)` |
135-
| `**` (double star) | Literal `**` | Catch-all wildcard (zero or more segments) |
136-
| `(.*)` in segment | Greedy match across `/` | Segment-scoped (does not cross `/`) |
137-
| `{...}+` / `{...}*` groups | Cross-segment group repetition | Only supported within a single segment (no `/` in group body) |
138-
| Path normalization (`.`/`..`) | Resolves `.`/`..` in input paths | Not done by default (opt-in with `{ normalize: true }`) |
139-
| Case sensitivity | Can be case-insensitive | Always case-sensitive |
140-
| Non-`/`-prefixed paths | Supported | Paths must start with `/` |
141-
| Unicode param names | Supports Unicode identifiers | Params use `\w` (ASCII word chars only) |
142-
| Percent-encoding | Normalizes `%xx` sequences | Does not decode percent-encoded input |
132+
| Feature | URLPattern | rou3 |
133+
| ----------------------------- | ---------------------------------- | ------------------------------------------------------------- |
134+
| `*` (single star) | Greedy catch-all `(.*)` across `/` | Single-segment unnamed param `([^/]*)` |
135+
| `**` (double star) | Literal `**` | Catch-all wildcard (zero or more segments) |
136+
| `(.*)` in segment | Greedy match across `/` | Segment-scoped (does not cross `/`) |
137+
| `{...}+` / `{...}*` groups | Cross-segment group repetition | Only supported within a single segment (no `/` in group body) |
138+
| Path normalization (`.`/`..`) | Resolves `.`/`..` in input paths | Not done by default (opt-in with `{ normalize: true }`) |
139+
| Case sensitivity | Can be case-insensitive | Always case-sensitive |
140+
| Non-`/`-prefixed paths | Supported | Paths must start with `/` |
141+
| Unicode param names | Supports Unicode identifiers | Params use `\w` (ASCII word chars only) |
142+
| Percent-encoding | Normalizes `%xx` sequences | Does not decode percent-encoded input |
143143

144144
### Path normalization
145145

eslint.config.mjs

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

package.json

Lines changed: 21 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2,46 +2,47 @@
22
"name": "rou3",
33
"version": "0.7.12",
44
"description": "Lightweight and fast router for JavaScript.",
5-
"repository": "h3js/rou3",
65
"license": "MIT",
7-
"sideEffects": false,
6+
"repository": "h3js/rou3",
7+
"files": [
8+
"dist"
9+
],
810
"type": "module",
11+
"sideEffects": false,
12+
"types": "./dist/index.d.mts",
913
"exports": {
1014
".": "./dist/index.mjs",
1115
"./compiler": "./dist/compiler.mjs"
1216
},
13-
"types": "./dist/index.d.mts",
14-
"files": [
15-
"dist"
16-
],
1717
"scripts": {
1818
"bench:bun": "bun ./test/bench",
1919
"bench:deno": "deno run -A ./test/bench/index.ts",
2020
"bench:node": "node --expose-gc --allow-natives-syntax --disable-warning=ExperimentalWarning --experimental-strip-types ./test/bench/index.ts",
2121
"build": "obuild",
2222
"dev": "vitest",
23-
"lint": "eslint . && prettier -c src test",
24-
"lint:fix": "automd && eslint --fix . && prettier -w src test",
23+
"lint": "oxlint . && oxfmt --check src test",
24+
"lint:fix": "automd && oxlint --fix . && oxfmt src test",
2525
"release": "pnpm test && pnpm build && changelogen --release && git push --follow-tags && npm publish",
2626
"test": "pnpm lint && pnpm test:types && vitest run --coverage",
27-
"test:types": "tsc --noEmit"
27+
"test:types": "tsgo --noEmit"
2828
},
2929
"devDependencies": {
3030
"0x": "^6.0.0",
3131
"@mitata/counters": "^0.0.8",
32-
"@types/node": "^25.0.2",
33-
"@vitest/coverage-v8": "^4.0.15",
34-
"automd": "^0.4.2",
32+
"@types/node": "^25.3.5",
33+
"@typescript/native-preview": "7.0.0-dev.20260308.1",
34+
"@vitest/coverage-v8": "^4.0.18",
35+
"automd": "^0.4.3",
3536
"changelogen": "^0.6.2",
36-
"esbuild": "^0.27.1",
37-
"eslint": "^9.39.2",
38-
"eslint-config-unjs": "^0.5.0",
37+
"esbuild": "^0.27.3",
38+
"eslint-config-unjs": "^0.6.2",
3939
"mitata": "^1.0.34",
40-
"obuild": "^0.4.8",
41-
"prettier": "^3.7.4",
42-
"rou3-latest": "npm:rou3@^0.7.11",
40+
"obuild": "^0.4.32",
41+
"oxfmt": "^0.36.0",
42+
"oxlint": "^1.51.0",
43+
"rou3-latest": "npm:rou3@^0.7.12",
4344
"typescript": "^5.9.3",
44-
"vitest": "^4.0.15"
45+
"vitest": "^4.0.18"
4546
},
46-
"packageManager": "pnpm@10.26.0"
47+
"packageManager": "pnpm@10.31.0"
4748
}

0 commit comments

Comments
 (0)