bump: and export src

This commit is contained in:
熊潇 2025-06-05 00:47:53 +08:00
parent d2a03fc959
commit adaf954ae7
2 changed files with 10 additions and 15 deletions

View File

@ -1,7 +1,7 @@
{
"$schema": "https://json.schemastore.org/package",
"name": "@kevisual/router",
"version": "0.0.21",
"version": "0.0.22",
"description": "",
"type": "module",
"main": "./dist/router.js",
@ -21,19 +21,19 @@
"author": "abearxiong",
"license": "MIT",
"devDependencies": {
"@kevisual/query": "^0.0.18",
"@kevisual/query": "^0.0.25",
"@rollup/plugin-alias": "^5.1.1",
"@rollup/plugin-commonjs": "^28.0.3",
"@rollup/plugin-node-resolve": "^16.0.1",
"@rollup/plugin-typescript": "^12.1.2",
"@types/lodash-es": "^4.17.12",
"@types/node": "^22.15.18",
"@types/node": "^22.15.29",
"@types/ws": "^8.18.1",
"@types/xml2js": "^0.4.14",
"cookie": "^1.0.2",
"lodash-es": "^4.17.21",
"nanoid": "^5.1.5",
"rollup": "^4.40.2",
"rollup": "^4.41.1",
"rollup-plugin-dts": "^6.2.1",
"ts-loader": "^9.5.2",
"ts-node": "^10.9.2",
@ -41,7 +41,7 @@
"typescript": "^5.8.3",
"ws": "npm:@kevisual/ws",
"xml2js": "^0.6.2",
"zod": "^3.24.4"
"zod": "^3.25.51"
},
"repository": {
"type": "git",
@ -89,6 +89,10 @@
"import": "./mod.ts",
"require": "./mod.ts",
"types": "./mod.d.ts"
},
"./src/*": {
"import": "./src/*",
"require": "./src/*"
}
}
}

View File

@ -1,23 +1,15 @@
# router
```
```ts
import { App } from '@kevisual/router';
const app = new App();
app.listen(4002);
new app.Route('demo', '01')
.define(async (ctx) => {
ctx.body = '01';
return ctx;
})
.addTo(app);
app
.route({path:'demo', key: '02})
.define(async (ctx) => {
ctx.body = '02';
return ctx;
})
.addTo(app);
@ -25,7 +17,6 @@ app
.route('demo', '03')
.define(async (ctx) => {
ctx.body = '03';
return ctx;
})
.addTo(app);
```