chore: bump version to 0.0.51 and enhance createQueryByRoutes to support dynamic queryApi export

This commit is contained in:
2026-02-24 21:44:57 +08:00
parent 7109fddae4
commit 026d6733da
2 changed files with 3 additions and 2 deletions

View File

@@ -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 });