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",
|
"name": "@kevisual/query",
|
||||||
"version": "0.0.50",
|
"version": "0.0.51",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"build": "npm run clean && bun run bun.config.ts",
|
"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;
|
obj[route.path][route.key] = route;
|
||||||
}
|
}
|
||||||
const before = options?.before || `import { createQueryApi } from '@kevisual/query/api';`;
|
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 code = `${before}
|
||||||
const api = ${generateApiCode(obj)} as const;
|
const api = ${generateApiCode(obj)} as const;
|
||||||
const queryApi = createQueryApi({ api });
|
const queryApi = createQueryApi({ api });
|
||||||
|
|||||||
Reference in New Issue
Block a user