refactor router system and update version

- Simplified Route class by removing validator functionality
- Added AppRouteContext type for better type safety
- Added forward method to RouteContext for response handling
- Replaced queryRoute with run method for consistency
- Improved Server class with proper cleanup methods
- Updated Mini class to extend QueryRouterServer properly
- Removed lodash-es dependency and nanoid random import
- Added deprecation warnings for older methods
- Enhanced route handling and middleware execution

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
2025-12-06 12:30:47 +08:00
parent ef0faf84b1
commit c692061b23
6 changed files with 99 additions and 228 deletions

13
src/test/app-type.ts Normal file
View File

@@ -0,0 +1,13 @@
import { App } from '../app.ts'
const app = new App<{ f: string }>();
app.route({
path: 't',
run: async (ctx) => {
// ctx.r
ctx.app;
}
}).define(async (ctx) => {
ctx.f = 'hello';
}).addTo(app);