@gaonjs/cli 0.4.0 → 0.10.0
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/commands/check.d.ts +50 -0
- package/dist/commands/check.js +286 -0
- package/dist/commands/console.d.ts +46 -0
- package/dist/commands/console.js +129 -0
- package/dist/commands/db.d.ts +3 -1
- package/dist/commands/db.js +8 -2
- package/dist/commands/g.d.ts +1 -1
- package/dist/commands/g.js +27 -3
- package/dist/commands/mcp.d.ts +15 -0
- package/dist/commands/mcp.js +78 -0
- package/dist/commands/new.d.ts +45 -0
- package/dist/commands/new.js +274 -0
- package/dist/commands/test.d.ts +11 -0
- package/dist/commands/test.js +119 -0
- package/dist/db/diff.js +5 -0
- package/dist/db/journal.d.ts +34 -0
- package/dist/db/journal.js +71 -0
- package/dist/db/migrate.d.ts +6 -1
- package/dist/db/migrate.js +120 -102
- package/dist/db/replay.d.ts +49 -0
- package/dist/db/replay.js +148 -0
- package/dist/db/status.d.ts +12 -0
- package/dist/db/status.js +61 -0
- package/dist/dev/index.d.ts +2 -0
- package/dist/dev/index.js +2 -0
- package/dist/dev/vite.d.ts +67 -0
- package/dist/dev/vite.js +126 -0
- package/dist/dev.d.ts +18 -0
- package/dist/dev.js +15 -0
- package/dist/doctor/agents-doc-index.d.ts +4 -0
- package/dist/doctor/agents-doc-index.js +80 -0
- package/dist/doctor/fixers/dependency-direction.d.ts +9 -0
- package/dist/doctor/fixers/dependency-direction.js +98 -0
- package/dist/doctor/fixers/index.d.ts +15 -0
- package/dist/doctor/fixers/index.js +66 -0
- package/dist/doctor/fixers/schema-filename.d.ts +14 -0
- package/dist/doctor/fixers/schema-filename.js +104 -0
- package/dist/doctor/fixers/types.d.ts +59 -0
- package/dist/doctor/fixers/types.js +15 -0
- package/dist/doctor/no-auto-import.d.ts +10 -0
- package/dist/doctor/no-auto-import.js +158 -0
- package/dist/doctor/schema-filename.d.ts +6 -0
- package/dist/doctor/schema-filename.js +81 -0
- package/dist/doctor/shared-composable-purity.d.ts +8 -0
- package/dist/doctor/shared-composable-purity.js +164 -0
- package/dist/doctor/types.d.ts +1 -1
- package/dist/doctor/types.js +6 -5
- package/dist/doctor.d.ts +51 -0
- package/dist/doctor.js +191 -7
- package/dist/generate.js +2 -2
- package/dist/hub.d.ts +1 -1
- package/dist/index.d.ts +6 -2
- package/dist/index.js +154 -16
- package/dist/mcp/index.d.ts +7 -0
- package/dist/mcp/index.js +7 -0
- package/dist/mcp/server.d.ts +50 -0
- package/dist/mcp/server.js +102 -0
- package/dist/mcp/tools.d.ts +109 -0
- package/dist/mcp/tools.js +485 -0
- package/dist/scaffold/app.d.ts +5 -0
- package/dist/scaffold/app.js +172 -0
- package/dist/scaffold/controller.js +2 -2
- package/dist/scaffold/index.d.ts +2 -1
- package/dist/scaffold/index.js +2 -1
- package/dist/scaffold/job.d.ts +5 -0
- package/dist/scaffold/job.js +35 -0
- package/dist/scaffold/model.js +8 -8
- package/dist/templates/auth/auth.wiring.ts.tpl +1 -1
- package/dist/templates/auth/registration.controller.ts.tpl +1 -1
- package/dist/templates/auth/session.controller.ts.tpl +1 -1
- package/dist/templates/auth/user.model.ts.tpl +1 -1
- package/dist/templates/index.d.ts +23 -0
- package/dist/templates/index.js +66 -0
- package/dist/templates/index.ts +85 -0
- package/dist/templates/project/.env.example.tpl +18 -0
- package/dist/templates/project/.gitignore.tpl +24 -0
- package/dist/templates/project/.npmrc.tpl +4 -0
- package/dist/templates/project/AGENTS.md.tpl +210 -0
- package/dist/templates/project/CLAUDE.md.tpl +119 -0
- package/dist/templates/project/agents/async.md.tpl +218 -0
- package/dist/templates/project/agents/data.md.tpl +532 -0
- package/dist/templates/project/agents/frontend.md.tpl +201 -0
- package/dist/templates/project/agents/realtime.md.tpl +157 -0
- package/dist/templates/project/agents/security.md.tpl +92 -0
- package/dist/templates/project/agents/testing.md.tpl +101 -0
- package/dist/templates/project/agents/web.md.tpl +177 -0
- package/dist/templates/project/apps/web/channels/.gitkeep.tpl +1 -0
- package/dist/templates/project/apps/web/components/.gitkeep.tpl +1 -0
- package/dist/templates/project/apps/web/composables/useApiPing.ts.tpl +25 -0
- package/dist/templates/project/apps/web/controllers/home.ts.tpl +19 -0
- package/dist/templates/project/apps/web/index.html.tpl +18 -0
- package/dist/templates/project/apps/web/layouts/Default.vue.tpl +43 -0
- package/dist/templates/project/apps/web/main.ts.tpl +24 -0
- package/dist/templates/project/apps/web/pages/Home/Index.vue.tpl +36 -0
- package/dist/templates/project/apps/web/routes.ts.tpl +8 -0
- package/dist/templates/project/docker-compose.yaml.tpl +73 -0
- package/dist/templates/project/domain/events/.gitkeep.tpl +1 -0
- package/dist/templates/project/domain/jobs/.gitkeep.tpl +1 -0
- package/dist/templates/project/domain/listeners/.gitkeep.tpl +1 -0
- package/dist/templates/project/domain/mails/.gitkeep.tpl +1 -0
- package/dist/templates/project/domain/models/.gitkeep.tpl +1 -0
- package/dist/templates/project/domain/schema/.gitkeep.tpl +1 -0
- package/dist/templates/project/domain/services/.gitkeep.tpl +1 -0
- package/dist/templates/project/gaon.config.ts.tpl +27 -0
- package/dist/templates/project/package.json.tpl +30 -0
- package/dist/templates/project/pnpm-workspace.yaml.tpl +11 -0
- package/dist/templates/project/shared/components/.gitkeep.tpl +1 -0
- package/dist/templates/project/shared/composables/useDebounce.ts.tpl +21 -0
- package/dist/templates/project/tsconfig.json.tpl +25 -0
- package/dist/templates/project/vite.config.ts.tpl +23 -0
- package/dist/tsResolve.js +1 -1
- package/dist/work.d.ts +2 -2
- package/dist/work.js +3 -1
- package/package.json +13 -11
- package/dist/__fixtures__/db-minimal/domain/schema/widgets.d.ts +0 -12
- package/dist/__fixtures__/db-minimal/domain/schema/widgets.js +0 -7
- package/dist/__fixtures__/db-minimal/gaon.config.d.ts +0 -2
- package/dist/__fixtures__/db-minimal/gaon.config.js +0 -11
- package/dist/check.d.ts +0 -29
- package/dist/check.js +0 -92
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@gaonjs/cli",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "Gaon CLI 구현: 제너레이터·스캐폴딩·로드맵 출력 (M1 스텁)",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "MIT",
|
|
@@ -23,16 +23,18 @@
|
|
|
23
23
|
"dist",
|
|
24
24
|
"README.md"
|
|
25
25
|
],
|
|
26
|
-
"dependencies": {
|
|
27
|
-
"typescript": "^5.9.0",
|
|
28
|
-
"@gaonjs/async": "0.2.2",
|
|
29
|
-
"@gaonjs/config": "0.1.0",
|
|
30
|
-
"@gaonjs/core": "0.1.4",
|
|
31
|
-
"@gaonjs/mail": "0.1.0",
|
|
32
|
-
"@gaonjs/data": "0.3.0",
|
|
33
|
-
"@gaonjs/web": "0.3.0"
|
|
34
|
-
},
|
|
35
26
|
"scripts": {
|
|
36
27
|
"build": "node ../../node_modules/typescript/bin/tsc -p tsconfig.json && node -e \"require('fs').cpSync('src/templates','dist/templates',{recursive:true})\""
|
|
28
|
+
},
|
|
29
|
+
"dependencies": {
|
|
30
|
+
"@gaonjs/async": "workspace:*",
|
|
31
|
+
"@gaonjs/config": "workspace:*",
|
|
32
|
+
"@gaonjs/core": "workspace:*",
|
|
33
|
+
"@gaonjs/data": "workspace:*",
|
|
34
|
+
"@gaonjs/web": "workspace:*",
|
|
35
|
+
"@gaonjs/mail": "workspace:*",
|
|
36
|
+
"@modelcontextprotocol/sdk": "^1.29.0",
|
|
37
|
+
"typescript": "^5.9.0",
|
|
38
|
+
"vite": "^7.0.0"
|
|
37
39
|
}
|
|
38
|
-
}
|
|
40
|
+
}
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
import { type RowOf } from '@gaonjs/data';
|
|
2
|
-
export declare const m9dWidgets: import("@gaonjs/data").TableDef<"m9d_widgets", {
|
|
3
|
-
id: import("@gaonjs/data").BigintCol<{
|
|
4
|
-
hasDefault: true;
|
|
5
|
-
}>;
|
|
6
|
-
name: import("@gaonjs/data").StringCol<{}>;
|
|
7
|
-
}>;
|
|
8
|
-
declare module '@gaonjs/data' {
|
|
9
|
-
interface GaonTables {
|
|
10
|
-
m9d_widgets: RowOf<typeof m9dWidgets>;
|
|
11
|
-
}
|
|
12
|
-
}
|
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
// db 통합 테스트 픽스처 — main 커넥션만 있는 최소 gaon.config.ts.
|
|
2
|
-
// url 은 GAON_TEST_PG_URL 우선 · 로컬 default 는 packages/data/compose.yaml 정합.
|
|
3
|
-
import { defineConfig } from '@gaonjs/config';
|
|
4
|
-
export default defineConfig({
|
|
5
|
-
db: {
|
|
6
|
-
main: {
|
|
7
|
-
adapter: 'postgres',
|
|
8
|
-
url: process.env.GAON_TEST_PG_URL ?? 'postgres://gaon:gaon@127.0.0.1:5433/gaon_test',
|
|
9
|
-
},
|
|
10
|
-
},
|
|
11
|
-
});
|
package/dist/check.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
import { type DevLayout } from './dev.js';
|
|
2
|
-
export interface TypecheckResult {
|
|
3
|
-
readonly ok: boolean;
|
|
4
|
-
readonly output: string;
|
|
5
|
-
/** 실행한 체커 이름(vue-tsc | tsc | none). */
|
|
6
|
-
readonly checker: string;
|
|
7
|
-
}
|
|
8
|
-
export interface CheckDeps {
|
|
9
|
-
readonly layout: DevLayout;
|
|
10
|
-
regenerateTables(schemaDir: string, out: string): Promise<unknown>;
|
|
11
|
-
regenerateRoutes(appDir: string, out: string): Promise<unknown>;
|
|
12
|
-
typecheck(): Promise<TypecheckResult>;
|
|
13
|
-
}
|
|
14
|
-
export interface CheckResult {
|
|
15
|
-
readonly ok: boolean;
|
|
16
|
-
readonly regenerated: {
|
|
17
|
-
readonly tables: boolean;
|
|
18
|
-
readonly routes: string[];
|
|
19
|
-
};
|
|
20
|
-
readonly typecheck: TypecheckResult;
|
|
21
|
-
}
|
|
22
|
-
/** .gaon 재생성 → 타입 체크. 재생성이 검사보다 먼저다(§13.4-5). */
|
|
23
|
-
export declare function runCheck(deps: CheckDeps): Promise<CheckResult>;
|
|
24
|
-
export interface CheckCommandOptions {
|
|
25
|
-
readonly cwd?: string;
|
|
26
|
-
readonly json?: boolean;
|
|
27
|
-
}
|
|
28
|
-
/** `gaon check` 진입점. */
|
|
29
|
-
export declare function runCheckCommand(opts?: CheckCommandOptions): Promise<number>;
|
package/dist/check.js
DELETED
|
@@ -1,92 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @gaonjs/cli · `gaon check` — 검사 전 .gaon 재생성 (M3, §13.4-5)
|
|
3
|
-
*
|
|
4
|
-
* 개발 서버(gaon dev)가 떠 있지 않은 CI·AI 에이전트 환경에서도 타입
|
|
5
|
-
* 체인이 항상 최신으로 검증되게, 타입 검사 **전에** .gaon(tables·routes)
|
|
6
|
-
* 을 먼저 재생성한 뒤 tsc/vue-tsc 를 돌린다.
|
|
7
|
-
*
|
|
8
|
-
* 오케스트레이션(runCheck)은 주입으로 순수하게 유지하고, 진입점이 cwd
|
|
9
|
-
* 관례로 실제 재생성기·타입 체커를 엮는다(dev.ts 와 동일 패턴).
|
|
10
|
-
*/
|
|
11
|
-
import { existsSync } from 'node:fs';
|
|
12
|
-
import { join } from 'node:path';
|
|
13
|
-
import { spawn } from 'node:child_process';
|
|
14
|
-
import { generateTablesDts } from '@gaonjs/data';
|
|
15
|
-
import { generateRoutesDts } from '@gaonjs/web';
|
|
16
|
-
import { resolveDevLayout } from './dev.js';
|
|
17
|
-
import { registerTsResolve } from './tsResolve.js';
|
|
18
|
-
/** .gaon 재생성 → 타입 체크. 재생성이 검사보다 먼저다(§13.4-5). */
|
|
19
|
-
export async function runCheck(deps) {
|
|
20
|
-
const { layout } = deps;
|
|
21
|
-
const routes = [];
|
|
22
|
-
if (layout.schemaDir)
|
|
23
|
-
await deps.regenerateTables(layout.schemaDir, layout.tablesOut);
|
|
24
|
-
for (const app of layout.apps) {
|
|
25
|
-
await deps.regenerateRoutes(app.appDir, app.routesOut);
|
|
26
|
-
routes.push(app.name);
|
|
27
|
-
}
|
|
28
|
-
const typecheck = await deps.typecheck();
|
|
29
|
-
return {
|
|
30
|
-
ok: typecheck.ok,
|
|
31
|
-
regenerated: { tables: !!layout.schemaDir, routes },
|
|
32
|
-
typecheck,
|
|
33
|
-
};
|
|
34
|
-
}
|
|
35
|
-
/** 프로젝트에 맞는 타입 체커를 골라 실행한다. .vue 가 있으면 vue-tsc. */
|
|
36
|
-
function makeProjectTypecheck(cwd) {
|
|
37
|
-
return () => new Promise((resolve) => {
|
|
38
|
-
const tsconfig = join(cwd, 'tsconfig.json');
|
|
39
|
-
if (!existsSync(tsconfig)) {
|
|
40
|
-
resolve({
|
|
41
|
-
ok: false,
|
|
42
|
-
checker: 'none',
|
|
43
|
-
output: `[gaon check] tsconfig.json 이 없습니다: ${tsconfig}\n` +
|
|
44
|
-
`→ 프로젝트 루트에 tsconfig.json 을 만들고 다시 실행하세요.`,
|
|
45
|
-
});
|
|
46
|
-
return;
|
|
47
|
-
}
|
|
48
|
-
const vueTsc = join(cwd, 'node_modules', '.bin', 'vue-tsc');
|
|
49
|
-
const useVue = existsSync(vueTsc);
|
|
50
|
-
const checker = useVue ? 'vue-tsc' : 'tsc';
|
|
51
|
-
const cmd = useVue ? vueTsc : process.execPath;
|
|
52
|
-
const args = useVue
|
|
53
|
-
? ['--noEmit', '-p', tsconfig]
|
|
54
|
-
: [join(cwd, 'node_modules', 'typescript', 'bin', 'tsc'), '--noEmit', '-p', tsconfig];
|
|
55
|
-
const child = spawn(cmd, args, { cwd });
|
|
56
|
-
let output = '';
|
|
57
|
-
child.stdout.on('data', (b) => (output += b.toString()));
|
|
58
|
-
child.stderr.on('data', (b) => (output += b.toString()));
|
|
59
|
-
child.on('error', (e) => resolve({ ok: false, checker, output: String(e) }));
|
|
60
|
-
child.on('close', (code) => resolve({ ok: code === 0, checker, output }));
|
|
61
|
-
});
|
|
62
|
-
}
|
|
63
|
-
/** `gaon check` 진입점. */
|
|
64
|
-
export async function runCheckCommand(opts = {}) {
|
|
65
|
-
const cwd = opts.cwd ?? process.cwd();
|
|
66
|
-
registerTsResolve(); // 사용자 .ts 의 `.js` 상대 import 를 런타임에 해석
|
|
67
|
-
const deps = {
|
|
68
|
-
layout: resolveDevLayout(cwd),
|
|
69
|
-
regenerateTables: generateTablesDts,
|
|
70
|
-
regenerateRoutes: generateRoutesDts,
|
|
71
|
-
typecheck: makeProjectTypecheck(cwd),
|
|
72
|
-
};
|
|
73
|
-
const result = await runCheck(deps);
|
|
74
|
-
if (opts.json) {
|
|
75
|
-
process.stdout.write(JSON.stringify(result) + '\n');
|
|
76
|
-
}
|
|
77
|
-
else {
|
|
78
|
-
const r = result.regenerated;
|
|
79
|
-
const gen = [r.tables ? 'tables.d.ts' : null, ...r.routes.map((a) => `${a}/routes.d.ts`)]
|
|
80
|
-
.filter(Boolean)
|
|
81
|
-
.join(', ');
|
|
82
|
-
process.stdout.write(` 재생성: ${gen || '(대상 없음)'}\n`);
|
|
83
|
-
if (result.ok) {
|
|
84
|
-
process.stdout.write(` ✓ 타입 검사 통과 (${result.typecheck.checker})\n`);
|
|
85
|
-
}
|
|
86
|
-
else {
|
|
87
|
-
process.stdout.write(` ✗ 타입 검사 실패 (${result.typecheck.checker})\n`);
|
|
88
|
-
process.stdout.write(result.typecheck.output);
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
return result.ok ? 0 : 1;
|
|
92
|
-
}
|