chore: bump version to 0.0.51 and enhance createQueryByRoutes to support dynamic queryApi export
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "@kevisual/query",
|
||||
"version": "0.0.50",
|
||||
"version": "0.0.51",
|
||||
"type": "module",
|
||||
"scripts": {
|
||||
"build": "npm run clean && bun run bun.config.ts",
|
||||
|
||||
@@ -67,7 +67,8 @@ export const createQueryByRoutes = (list: RouteInfo[], options?: CreateQueryOpti
|
||||
obj[route.path][route.key] = route;
|
||||
}
|
||||
const before = options?.before || `import { createQueryApi } from '@kevisual/query/api';`;
|
||||
const after = options?.after || `export { queryApi };`;
|
||||
const after = options?.after || `const queryApi = createQueryApi({ api });
|
||||
export { queryApi };`;
|
||||
const code = `${before}
|
||||
const api = ${generateApiCode(obj)} as const;
|
||||
const queryApi = createQueryApi({ api });
|
||||
|
||||
Reference in New Issue
Block a user