From 9f318205ef8efaefd9d792440646bfecdae4b817 Mon Sep 17 00:00:00 2001 From: abearxiong Date: Tue, 18 Nov 2025 00:59:27 +0800 Subject: [PATCH] update --- .gitignore | 68 ++++++++++++ package.json | 28 +++++ pnpm-lock.yaml | 285 +++++++++++++++++++++++++++++++++++++++++++++++++ src/demo.ts | 21 ++++ tsconfig.json | 22 ++++ 5 files changed, 424 insertions(+) create mode 100644 .gitignore create mode 100644 package.json create mode 100644 pnpm-lock.yaml create mode 100644 src/demo.ts create mode 100644 tsconfig.json diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..ec6578a --- /dev/null +++ b/.gitignore @@ -0,0 +1,68 @@ +node_modules + +# mac +.DS_Store + +.env* +!.env*example + +dist +build +logs + +.turbo + +pack-dist + +# astro +.astro + +# next +.next + +# nuxt +.nuxt + +# vercel +.vercel + +# vuepress +.vuepress/dist + +# coverage +coverage/ + +# typescript +*.tsbuildinfo + +# debug logs +*.log +*.tmp + +# vscode +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +# idea +.idea + +# system +Thumbs.db +ehthumbs.db +Desktop.ini + +# temp files +*.tmp +*.temp + +# local development +*.local + +public/r + +.pnpm-store + +storage/ \ No newline at end of file diff --git a/package.json b/package.json new file mode 100644 index 0000000..2ff6af4 --- /dev/null +++ b/package.json @@ -0,0 +1,28 @@ +{ + "name": "@kevisual/router-template", + "version": "0.0.1", + "description": "", + "main": "index.js", + "scripts": { + "dev": "bun --watch src/dev.ts ", + "build": "rimraf dist && bun run bun.config.mjs", + "clean": "rm -rf dist", + "pub": "envision pack -p -u" + }, + "keywords": [], + "author": "abearxiong (https://www.xiongxiao.me)", + "license": "MIT", + "packageManager": "pnpm@10.22.0", + "type": "module", + "dependencies": { + "@kevisual/ai": "^0.0.11", + "@kevisual/query": "^0.0.29", + "@kevisual/router": "0.0.33", + "@kevisual/use-config": "^1.0.19", + "dayjs": "^1.11.19", + "es-toolkit": "^1.42.0" + }, + "devDependencies": { + "@kevisual/types": "^0.0.10" + } +} \ No newline at end of file diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml new file mode 100644 index 0000000..9964ba5 --- /dev/null +++ b/pnpm-lock.yaml @@ -0,0 +1,285 @@ +lockfileVersion: '9.0' + +settings: + autoInstallPeers: true + excludeLinksFromLockfile: false + +importers: + + .: + dependencies: + '@kevisual/ai': + specifier: ^0.0.11 + version: 0.0.11 + '@kevisual/query': + specifier: ^0.0.29 + version: 0.0.29 + '@kevisual/router': + specifier: 0.0.33 + version: 0.0.33 + '@kevisual/use-config': + specifier: ^1.0.19 + version: 1.0.19(dotenv@16.6.1) + dayjs: + specifier: ^1.11.19 + version: 1.11.19 + es-toolkit: + specifier: ^1.42.0 + version: 1.42.0 + devDependencies: + '@kevisual/types': + specifier: ^0.0.10 + version: 0.0.10 + +packages: + + '@kevisual/ai@0.0.11': + resolution: {integrity: sha512-SceIxodtjttLurZuXImZmJbimSt/NJW7N8vQArr0AaxqUam/WwcOTPYSVCleGhUW196Vew/FKC5k0vjyBMZZ5Q==} + + '@kevisual/load@0.0.6': + resolution: {integrity: sha512-+3YTFehRcZ1haGel5DKYMUwmi5i6f2psyaPZlfkKU/cOXgkpwoG9/BEqPCnPjicKqqnksEpixVRkyHJ+5bjLVA==} + + '@kevisual/logger@0.0.4': + resolution: {integrity: sha512-+fpr92eokSxoGOW1SIRl/27lPuO+zyY+feR5o2Q4YCNlAdt2x64NwC/w8r/3NEC5QenLgd4K0azyKTI2mHbARw==} + + '@kevisual/query@0.0.29': + resolution: {integrity: sha512-rQZk0J073UuC1QGzuyq+pb4Y0hu8/Qx/xYHs9NbsmslM+RuMnd1zpXmvhXNj7Kn1MdYTH90ng2MlFLBkkQFaIg==} + + '@kevisual/router@0.0.33': + resolution: {integrity: sha512-9z7TkSzCIGbXn9SuHPBdZpGwHlAuwA8iN5jNAZBUvbEvBRkBxlrbdCSe9fBYiAHueLm2AceFNrW74uulOiAkqA==} + + '@kevisual/types@0.0.10': + resolution: {integrity: sha512-Q73uzzjk9UidumnmCvOpgzqDDvQxsblz22bIFuoiioUFJWwaparx8bpd8ArRyFojicYL1YJoFDzDZ9j9NN8grA==} + + '@kevisual/use-config@1.0.19': + resolution: {integrity: sha512-Q1IH4eMqUe5w6Bq8etoqOSls9FPIy0xwwD3wHf26EsQLZadhccI9qkDuFzP/rFWDa57mwFPEfwbGE5UlqWOCkw==} + peerDependencies: + dotenv: ^16.4.7 + + dayjs@1.11.19: + resolution: {integrity: sha512-t5EcLVS6QPBNqM2z8fakk/NKel+Xzshgt8FFKAn+qwlD1pzZWxh0nVCrvFK7ZDb6XucZeF9z8C7CBWTRIVApAw==} + + debug@4.4.3: + resolution: {integrity: sha512-RGwwWnwQvkVfavKVt22FGLw+xYSdzARwm0ru6DhTVA3umU5hZc28V3kO4stgYryrTlLpuvgI9GiijltAjNbcqA==} + engines: {node: '>=6.0'} + peerDependencies: + supports-color: '*' + peerDependenciesMeta: + supports-color: + optional: true + + depd@2.0.0: + resolution: {integrity: sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==} + engines: {node: '>= 0.8'} + + dotenv@16.6.1: + resolution: {integrity: sha512-uBq4egWHTcTt33a72vpSG0z3HnPuIl6NqYcTrKEg2azoEyl2hpW0zqlxysq2pK9HlDIHyHyakeYaYnSAwd8bow==} + engines: {node: '>=12'} + + ee-first@1.1.1: + resolution: {integrity: sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==} + + encodeurl@2.0.0: + resolution: {integrity: sha512-Q0n9HRi4m6JuGIV1eFlmvJB7ZEVxu93IrMyiMsGC0lrMJMWzRgx6WGquyfQgZVb31vhGgXnfmPNNXmxnOkRBrg==} + engines: {node: '>= 0.8'} + + es-toolkit@1.42.0: + resolution: {integrity: sha512-SLHIyY7VfDJBM8clz4+T2oquwTQxEzu263AyhVK4jREOAwJ+8eebaa4wM3nlvnAqhDrMm2EsA6hWHaQsMPQ1nA==} + + escape-html@1.0.3: + resolution: {integrity: sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==} + + etag@1.8.1: + resolution: {integrity: sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==} + engines: {node: '>= 0.6'} + + eventemitter3@5.0.1: + resolution: {integrity: sha512-GWkBvjiSZK87ELrYOSESUYeVIc9mvLLf/nXalMOS5dYrgZq9o5OVkbZAVM06CVxYsCwH9BDZFPlQTlPA1j4ahA==} + + fresh@2.0.0: + resolution: {integrity: sha512-Rx/WycZ60HOaqLKAi6cHRKKI7zxWbJ31MhntmtwMoaTeF7XFH9hhBp8vITaMidfljRQ6eYWCKkaTK+ykVJHP2A==} + engines: {node: '>= 0.8'} + + http-errors@2.0.0: + resolution: {integrity: sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==} + engines: {node: '>= 0.8'} + + inherits@2.0.4: + resolution: {integrity: sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==} + + mime-db@1.54.0: + resolution: {integrity: sha512-aU5EJuIN2WDemCcAp2vFBfp/m4EAhWJnUNSSw0ixs7/kXbd6Pg64EmwJkNdFhB8aWt1sH2CTXrLxo/iAGV3oPQ==} + engines: {node: '>= 0.6'} + + mime-types@3.0.1: + resolution: {integrity: sha512-xRc4oEhT6eaBpU1XF7AjpOFD+xQmXNB5OVKwp4tqCuBpHLS/ZbBDrc07mYTDqVMg6PfxUjjNp85O6Cd2Z/5HWA==} + engines: {node: '>= 0.6'} + + ms@2.1.3: + resolution: {integrity: sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==} + + node-forge@1.3.1: + resolution: {integrity: sha512-dPEtOeMvF9VMcYV/1Wb8CPoVAXtp6MKMlcbAt4ddqmGqUJ6fQZFXkNZNkNlfevtNkGtaSoXf/vNNNSvgrdXwtA==} + engines: {node: '>= 6.13.0'} + + on-finished@2.4.1: + resolution: {integrity: sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==} + engines: {node: '>= 0.8'} + + openai@5.23.2: + resolution: {integrity: sha512-MQBzmTulj+MM5O8SKEk/gL8a7s5mktS9zUtAkU257WjvobGc9nKcBuVwjyEEcb9SI8a8Y2G/mzn3vm9n1Jlleg==} + hasBin: true + peerDependencies: + ws: ^8.18.0 + zod: ^3.23.8 + peerDependenciesMeta: + ws: + optional: true + zod: + optional: true + + path-to-regexp@8.3.0: + resolution: {integrity: sha512-7jdwVIRtsP8MYpdXSwOS0YdD0Du+qOoF/AEPIt88PcCFrZCzx41oxku1jD88hZBwbNUIEfpqvuhjFaMAqMTWnA==} + + range-parser@1.2.1: + resolution: {integrity: sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==} + engines: {node: '>= 0.6'} + + selfsigned@4.0.0: + resolution: {integrity: sha512-eP/1BEUCziBF/7p96ergE2JlGOMsGj9kIe77pD99G3ValgxDFwHA2oNCYW4rjlmYp8LXc684ypH0836GjSKw0A==} + engines: {node: '>=10'} + + send@1.2.0: + resolution: {integrity: sha512-uaW0WwXKpL9blXE2o0bRhoL2EGXIrZxQ2ZQ4mgcfoBxdFmQold+qWsD2jLrfZ0trjKL6vOw0j//eAwcALFjKSw==} + engines: {node: '>= 18'} + + setprototypeof@1.2.0: + resolution: {integrity: sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==} + + statuses@2.0.1: + resolution: {integrity: sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==} + engines: {node: '>= 0.8'} + + statuses@2.0.2: + resolution: {integrity: sha512-DvEy55V3DB7uknRo+4iOGT5fP1slR8wQohVdknigZPMpMstaKJQWhwiYBACJE3Ul2pTnATihhBYnRhZQHGBiRw==} + engines: {node: '>= 0.8'} + + toidentifier@1.0.1: + resolution: {integrity: sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==} + engines: {node: '>=0.6'} + +snapshots: + + '@kevisual/ai@0.0.11': + dependencies: + '@kevisual/logger': 0.0.4 + + '@kevisual/load@0.0.6': + dependencies: + eventemitter3: 5.0.1 + + '@kevisual/logger@0.0.4': {} + + '@kevisual/query@0.0.29': + dependencies: + openai: 5.23.2 + transitivePeerDependencies: + - ws + - zod + + '@kevisual/router@0.0.33': + dependencies: + path-to-regexp: 8.3.0 + selfsigned: 4.0.0 + send: 1.2.0 + transitivePeerDependencies: + - supports-color + + '@kevisual/types@0.0.10': {} + + '@kevisual/use-config@1.0.19(dotenv@16.6.1)': + dependencies: + '@kevisual/load': 0.0.6 + dotenv: 16.6.1 + + dayjs@1.11.19: {} + + debug@4.4.3: + dependencies: + ms: 2.1.3 + + depd@2.0.0: {} + + dotenv@16.6.1: {} + + ee-first@1.1.1: {} + + encodeurl@2.0.0: {} + + es-toolkit@1.42.0: {} + + escape-html@1.0.3: {} + + etag@1.8.1: {} + + eventemitter3@5.0.1: {} + + fresh@2.0.0: {} + + http-errors@2.0.0: + dependencies: + depd: 2.0.0 + inherits: 2.0.4 + setprototypeof: 1.2.0 + statuses: 2.0.1 + toidentifier: 1.0.1 + + inherits@2.0.4: {} + + mime-db@1.54.0: {} + + mime-types@3.0.1: + dependencies: + mime-db: 1.54.0 + + ms@2.1.3: {} + + node-forge@1.3.1: {} + + on-finished@2.4.1: + dependencies: + ee-first: 1.1.1 + + openai@5.23.2: {} + + path-to-regexp@8.3.0: {} + + range-parser@1.2.1: {} + + selfsigned@4.0.0: + dependencies: + node-forge: 1.3.1 + + send@1.2.0: + dependencies: + debug: 4.4.3 + encodeurl: 2.0.0 + escape-html: 1.0.3 + etag: 1.8.1 + fresh: 2.0.0 + http-errors: 2.0.0 + mime-types: 3.0.1 + ms: 2.1.3 + on-finished: 2.4.1 + range-parser: 1.2.1 + statuses: 2.0.2 + transitivePeerDependencies: + - supports-color + + setprototypeof@1.2.0: {} + + statuses@2.0.1: {} + + statuses@2.0.2: {} + + toidentifier@1.0.1: {} diff --git a/src/demo.ts b/src/demo.ts new file mode 100644 index 0000000..d97d4b5 --- /dev/null +++ b/src/demo.ts @@ -0,0 +1,21 @@ +import { App } from '@kevisual/router'; + +const app = new App(); + +app.route({ + description: 'Demo route', + id: 'abc' +}).define(async (ctx) => { + ctx.body = 'Hello, Kevisual Router!'; +}).addTo(app); + + +app.router.createRouteList() +app.call({ + path: 'route', + key: 'list' +}).then((res) => { + console.log('Registered res:', res); +}).catch((error) => { + console.error('Error fetching res:', error); +}); \ No newline at end of file diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 0000000..f5da7f2 --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,22 @@ +{ + "extends": "@kevisual/types/json/backend.json", + "compilerOptions": { + "baseUrl": ".", + "typeRoots": [ + "./node_modules/@types", + "./node_modules/@kevisual/types/index.d.ts" + ], + "paths": { + "@/*": [ + "src/*" + ], + "@agent/*": [ + "agent/*" + ] + }, + }, + "include": [ + "src/**/*", + "agent/**/*", + ], +} \ No newline at end of file