@cartanova/qgrid-cli 1.0.1 → 1.0.2

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.
@@ -0,0 +1,44 @@
1
+ import type { PathLike } from "fs";
2
+
3
+ // import { Naite } from "sonamu";
4
+ import { vi } from "vitest";
5
+
6
+ // GlobalMock: fs/promises (사용 예시 - 필요시 활성화)
7
+ vi.mock("fs/promises", async (importOriginal) => {
8
+ const actual = (await importOriginal()) as typeof import("fs/promises");
9
+ return {
10
+ ...actual,
11
+ access: vi.fn((path: PathLike, mode?: number) => {
12
+ // const vfs = Naite.get("mock:fs/promises:virtualFileSystem").result();
13
+ // if (vfs.some((v) => v === path)) {
14
+ // return Promise.resolve();
15
+ // }
16
+
17
+ return actual.access(path, mode);
18
+ }),
19
+ // mkdir: vi.fn(
20
+ // async (
21
+ // path: PathLike,
22
+ // options?: MakeDirectoryOptions | Mode | null,
23
+ // ): Promise<string | undefined> => {
24
+ // // Naite.t("fs:mkdir", { path, options });
25
+ // if (typeof options === "object" && options?.recursive) {
26
+ // return typeof path === "string" ? path : path.toString();
27
+ // }
28
+ // return undefined;
29
+ // },
30
+ // ),
31
+ // writeFile: vi.fn((path: PathLike | FileHandle, data: string | Buffer | Uint8Array) => {
32
+ // const filePath = typeof path === "string" ? path : path.toString();
33
+
34
+ // // Naite.t(`fs/promises:writeFile`, { path: filePath, data });
35
+ // }),
36
+ // rm: vi.fn(async (path: PathLike, options?: RmOptions) => {
37
+ // const filePath = typeof path === "string" ? path : path.toString();
38
+
39
+ // // Naite.t(`fs/promises:rm`, { path: filePath, options });
40
+ // // 실제 삭제하지 않고 기록만 함
41
+ // return Promise.resolve();
42
+ // }),
43
+ };
44
+ });
@@ -0,0 +1,8 @@
1
+ /** biome-ignore-all lint/correctness/noUnusedImports: d.ts */
2
+ import type fastify from "fastify";
3
+
4
+ import type { UserSubsetSS } from "../application/sonamu.generated";
5
+
6
+ declare module "fastify" {
7
+ export interface PassportUser extends UserSubsetSS {}
8
+ }
@@ -0,0 +1,17 @@
1
+ /** biome-ignore-all lint/correctness/noUnusedImports: d.ts */
2
+
3
+ import {} from "sonamu";
4
+
5
+ declare module "sonamu" {
6
+ export interface ContextExtend {
7
+ ip: string;
8
+ }
9
+
10
+ export interface GuardKeys {
11
+ query: true;
12
+ user: true;
13
+ admin: true;
14
+ // 새로운 커스텀 가드키를 추가하는 경우
15
+ // CustomGuardKey: true
16
+ }
17
+ }
@@ -0,0 +1,11 @@
1
+ import type { SubsetQuery } from "sonamu";
2
+
3
+ export function getSubsetLoaders(subsets: string[], subsetQueries: Record<string, SubsetQuery>) {
4
+ return subsets.reduce(
5
+ (acc, subset) => {
6
+ acc[subset] = subsetQueries[subset]?.loaders ?? [];
7
+ return acc;
8
+ },
9
+ {} as Record<string, SubsetQuery["loaders"]>,
10
+ );
11
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cartanova/qgrid-cli",
3
- "version": "1.0.1",
3
+ "version": "1.0.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/cartanova-ai/qgrid"
@@ -48,7 +48,7 @@
48
48
  "node": ">=20"
49
49
  },
50
50
  "scripts": {
51
- "bundle": "cd ../api && pnpm build && cd ../cli && mkdir -p bundle/public && cp -r ../api/dist ./bundle/dist && cp -r ../api/web-dist ./bundle/web-dist && mkdir -p ./bundle/src/migrations && cp ../api/src/migrations/*.ts ./bundle/src/migrations/ && cd ../api && find src -name '*.entity.json' -exec sh -c 'dest=../cli/bundle/$(echo {}) && mkdir -p $(dirname $dest) && cp {} $dest' \\;",
51
+ "bundle": "cd ../api && pnpm build && cd ../cli && mkdir -p bundle/public && cp -r ../api/dist ./bundle/dist && cp -r ../api/web-dist ./bundle/web-dist && cp -r ../api/src ./bundle/src",
52
52
  "build": "tsdown"
53
53
  }
54
54
  }