@toktokhan-dev/cli-plugin-gen-api-react-query 0.1.5 → 0.1.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.js +34 -0
- package/package.json +1 -1
- package/templates/my/react-query-type.eta +2 -2
package/dist/index.js
CHANGED
|
@@ -246,6 +246,40 @@ const genApi = defineCommand({
|
|
|
246
246
|
config,
|
|
247
247
|
});
|
|
248
248
|
});
|
|
249
|
+
// 최종 단계 포매팅: 디렉터리 전체를 한 번에 포맷
|
|
250
|
+
await withLoading('Prettier format', covered.output, async () => {
|
|
251
|
+
const fs = await import('fs');
|
|
252
|
+
const pathMod = await import('path');
|
|
253
|
+
const { prettierString } = await import('@toktokhan-dev/node');
|
|
254
|
+
const listTsFiles = (dir) => {
|
|
255
|
+
const entries = fs.readdirSync(dir, { withFileTypes: true });
|
|
256
|
+
const files = [];
|
|
257
|
+
for (const entry of entries) {
|
|
258
|
+
const full = pathMod.resolve(dir, entry.name);
|
|
259
|
+
if (entry.isDirectory()) {
|
|
260
|
+
files.push(...listTsFiles(full));
|
|
261
|
+
}
|
|
262
|
+
else if (entry.isFile() && full.endsWith('.ts')) {
|
|
263
|
+
files.push(full);
|
|
264
|
+
}
|
|
265
|
+
}
|
|
266
|
+
return files;
|
|
267
|
+
};
|
|
268
|
+
const files = listTsFiles(covered.output);
|
|
269
|
+
for (const file of files) {
|
|
270
|
+
try {
|
|
271
|
+
const raw = fs.readFileSync(file, 'utf8');
|
|
272
|
+
const formatted = await prettierString(raw, {
|
|
273
|
+
parser: 'typescript',
|
|
274
|
+
configPath: 'auto',
|
|
275
|
+
});
|
|
276
|
+
fs.writeFileSync(file, formatted);
|
|
277
|
+
}
|
|
278
|
+
catch {
|
|
279
|
+
console.warn('Prettier final pass failed for', file);
|
|
280
|
+
}
|
|
281
|
+
}
|
|
282
|
+
});
|
|
249
283
|
}
|
|
250
284
|
},
|
|
251
285
|
});
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@toktokhan-dev/cli-plugin-gen-api-react-query",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.6",
|
|
4
4
|
"description": "A CLI plugin for generating API hooks with React Query built by TOKTOKHAN.DEV",
|
|
5
5
|
"author": "TOKTOKHAN.DEV <fe-system@toktokhan.dev>",
|
|
6
6
|
"license": "ISC",
|
|
@@ -43,7 +43,7 @@ export type InfiniteQueryHookParams<
|
|
|
43
43
|
> = {
|
|
44
44
|
options?: Partial<
|
|
45
45
|
Omit<
|
|
46
|
-
UseInfiniteQueryOptions<OriginData, Error, TData,
|
|
46
|
+
UseInfiniteQueryOptions<OriginData, Error, TData, any, any>,
|
|
47
47
|
'queryKey' | 'queryFn'
|
|
48
48
|
>
|
|
49
49
|
>;
|
|
@@ -83,7 +83,7 @@ export type SuspenseInfiniteQueryHookParams<
|
|
|
83
83
|
> = {
|
|
84
84
|
options?: Partial<
|
|
85
85
|
Omit<
|
|
86
|
-
UseSuspenseInfiniteQueryOptions<OriginData, Error, TData,
|
|
86
|
+
UseSuspenseInfiniteQueryOptions<OriginData, Error, TData, any, any>,
|
|
87
87
|
'queryKey' | 'queryFn'
|
|
88
88
|
>
|
|
89
89
|
>;
|