clawfire 0.1.0 → 0.2.1
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/README.md +386 -88
- package/dist/admin.d.cts +1 -1
- package/dist/admin.d.ts +1 -1
- package/dist/cli.js +23 -5
- package/dist/{config-QMBJRn9G.d.cts → config-D-Chojiu.d.cts} +7 -0
- package/dist/{config-QMBJRn9G.d.ts → config-D-Chojiu.d.ts} +7 -0
- package/dist/{dev-server-QAVWINAT.js → dev-server-ZGXJARNY.js} +712 -99
- package/dist/dev.cjs +712 -99
- package/dist/dev.cjs.map +1 -1
- package/dist/dev.d.cts +35 -36
- package/dist/dev.d.ts +35 -36
- package/dist/dev.js +712 -99
- package/dist/dev.js.map +1 -1
- package/dist/functions.d.cts +1 -1
- package/dist/functions.d.ts +1 -1
- package/dist/index.cjs +6 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +6 -1
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
- package/templates/CLAUDE.md +18 -1
- package/templates/clawfire.config.ts +4 -0
- package/templates/starter/CLAUDE.md +85 -5
- package/templates/starter/app/components/footer.html +5 -0
- package/templates/starter/app/components/nav.html +14 -0
- package/templates/starter/app/pages/_404.html +9 -0
- package/templates/starter/app/pages/_layout.html +46 -0
- package/templates/starter/app/pages/about.html +84 -0
- package/templates/starter/app/pages/index.html +192 -0
- package/templates/starter/app/pages/todos/index.html +173 -0
- package/templates/starter/clawfire.config.ts +4 -0
- package/templates/starter/dev.ts +2 -1
- package/templates/starter/public/index.html +9 -345
package/dist/dev.d.cts
CHANGED
|
@@ -4,74 +4,65 @@ import './schema-BJsictSV.cjs';
|
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
6
|
interface DevServerOptions {
|
|
7
|
-
/**
|
|
7
|
+
/** Project root path */
|
|
8
8
|
projectDir?: string;
|
|
9
|
-
/**
|
|
9
|
+
/** Frontend server port (default: 3000) */
|
|
10
10
|
port?: number;
|
|
11
|
-
/**
|
|
11
|
+
/** API server port (default: 3456) */
|
|
12
|
+
apiPort?: number;
|
|
13
|
+
/** Router options */
|
|
12
14
|
routerOptions?: Partial<RouterOptions>;
|
|
13
|
-
/**
|
|
15
|
+
/** Hot reload enabled (default: true) */
|
|
14
16
|
hotReload?: boolean;
|
|
15
|
-
/**
|
|
17
|
+
/** Change detection debounce ms (default: 150) */
|
|
16
18
|
debounceMs?: number;
|
|
17
|
-
/**
|
|
19
|
+
/** Callback to manually register routes (instead of file-based) */
|
|
18
20
|
onSetupRoutes?: (router: ClawfireRouter) => void | Promise<void>;
|
|
19
21
|
}
|
|
20
22
|
declare class DevServer {
|
|
21
|
-
private
|
|
23
|
+
private frontendServer;
|
|
24
|
+
private apiServer;
|
|
22
25
|
private router;
|
|
23
26
|
private watcher;
|
|
24
|
-
private
|
|
27
|
+
private frontendSseClients;
|
|
28
|
+
private apiSseClients;
|
|
25
29
|
private sseIdCounter;
|
|
26
30
|
private options;
|
|
27
31
|
private routesDir;
|
|
28
32
|
private schemasDir;
|
|
33
|
+
private publicDir;
|
|
34
|
+
private pagesDir;
|
|
35
|
+
private componentsDir;
|
|
29
36
|
private playgroundHtml;
|
|
30
37
|
private importCounter;
|
|
31
38
|
private isReloading;
|
|
39
|
+
private pageCompiler;
|
|
32
40
|
constructor(options?: DevServerOptions);
|
|
33
|
-
/**
|
|
34
|
-
* 개발 서버 시작
|
|
35
|
-
*/
|
|
36
41
|
start(): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* 서버 종료
|
|
39
|
-
*/
|
|
40
42
|
stop(): Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* 라우트 파일 로딩 (또는 수동 콜백)
|
|
43
|
-
*/
|
|
44
43
|
private loadRoutes;
|
|
45
|
-
/**
|
|
46
|
-
* 라우트 핫 리로드
|
|
47
|
-
*/
|
|
48
44
|
private reloadRoutes;
|
|
45
|
+
private handleFrontendChange;
|
|
49
46
|
private startWatcher;
|
|
50
47
|
private handleSSE;
|
|
51
48
|
private broadcastSSE;
|
|
52
49
|
private regeneratePlayground;
|
|
53
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Inject HMR and (optionally) client-side router scripts before </body>.
|
|
52
|
+
*/
|
|
53
|
+
private injectScripts;
|
|
54
|
+
private serveStaticFile;
|
|
55
|
+
private proxyToApiServer;
|
|
56
|
+
private handleFrontendRequest;
|
|
57
|
+
private handleApiRequest;
|
|
54
58
|
private printStartupBanner;
|
|
55
59
|
}
|
|
56
60
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* ```ts
|
|
61
|
-
* import { startDevServer } from "clawfire/dev";
|
|
62
|
-
*
|
|
63
|
-
* startDevServer({
|
|
64
|
-
* port: 3456,
|
|
65
|
-
* onSetupRoutes: (router) => {
|
|
66
|
-
* router.register("/health", healthRoute);
|
|
67
|
-
* router.register("/products/list", listRoute);
|
|
68
|
-
* }
|
|
69
|
-
* });
|
|
70
|
-
* ```
|
|
61
|
+
* Create and start dev server (one-line helper)
|
|
71
62
|
*/
|
|
72
63
|
declare function startDevServer(options?: DevServerOptions): Promise<DevServer>;
|
|
73
64
|
|
|
74
|
-
type WatchEventType = "route-change" | "schema-change" | "config-change" | "any-change";
|
|
65
|
+
type WatchEventType = "route-change" | "schema-change" | "config-change" | "frontend-change" | "css-change" | "page-change" | "component-change" | "any-change";
|
|
75
66
|
interface WatchEvent {
|
|
76
67
|
type: WatchEventType;
|
|
77
68
|
filePath: string;
|
|
@@ -90,6 +81,14 @@ declare class FileWatcher extends EventEmitter {
|
|
|
90
81
|
* 단일 파일 감시
|
|
91
82
|
*/
|
|
92
83
|
watchFile(filePath: string, eventType: WatchEventType): this;
|
|
84
|
+
/**
|
|
85
|
+
* 프론트엔드 디렉터리 감시 (확장자별 이벤트 타입 자동 결정)
|
|
86
|
+
*/
|
|
87
|
+
watchDirFrontend(dir: string): this;
|
|
88
|
+
/**
|
|
89
|
+
* Linux fallback: 프론트엔드 디렉터리 수동 재귀 감시
|
|
90
|
+
*/
|
|
91
|
+
private watchDirFrontendRecursiveManual;
|
|
93
92
|
/**
|
|
94
93
|
* Linux fallback: 디렉터리 수동 재귀 감시
|
|
95
94
|
*/
|
package/dist/dev.d.ts
CHANGED
|
@@ -4,74 +4,65 @@ import './schema-BJsictSV.js';
|
|
|
4
4
|
import 'zod';
|
|
5
5
|
|
|
6
6
|
interface DevServerOptions {
|
|
7
|
-
/**
|
|
7
|
+
/** Project root path */
|
|
8
8
|
projectDir?: string;
|
|
9
|
-
/**
|
|
9
|
+
/** Frontend server port (default: 3000) */
|
|
10
10
|
port?: number;
|
|
11
|
-
/**
|
|
11
|
+
/** API server port (default: 3456) */
|
|
12
|
+
apiPort?: number;
|
|
13
|
+
/** Router options */
|
|
12
14
|
routerOptions?: Partial<RouterOptions>;
|
|
13
|
-
/**
|
|
15
|
+
/** Hot reload enabled (default: true) */
|
|
14
16
|
hotReload?: boolean;
|
|
15
|
-
/**
|
|
17
|
+
/** Change detection debounce ms (default: 150) */
|
|
16
18
|
debounceMs?: number;
|
|
17
|
-
/**
|
|
19
|
+
/** Callback to manually register routes (instead of file-based) */
|
|
18
20
|
onSetupRoutes?: (router: ClawfireRouter) => void | Promise<void>;
|
|
19
21
|
}
|
|
20
22
|
declare class DevServer {
|
|
21
|
-
private
|
|
23
|
+
private frontendServer;
|
|
24
|
+
private apiServer;
|
|
22
25
|
private router;
|
|
23
26
|
private watcher;
|
|
24
|
-
private
|
|
27
|
+
private frontendSseClients;
|
|
28
|
+
private apiSseClients;
|
|
25
29
|
private sseIdCounter;
|
|
26
30
|
private options;
|
|
27
31
|
private routesDir;
|
|
28
32
|
private schemasDir;
|
|
33
|
+
private publicDir;
|
|
34
|
+
private pagesDir;
|
|
35
|
+
private componentsDir;
|
|
29
36
|
private playgroundHtml;
|
|
30
37
|
private importCounter;
|
|
31
38
|
private isReloading;
|
|
39
|
+
private pageCompiler;
|
|
32
40
|
constructor(options?: DevServerOptions);
|
|
33
|
-
/**
|
|
34
|
-
* 개발 서버 시작
|
|
35
|
-
*/
|
|
36
41
|
start(): Promise<void>;
|
|
37
|
-
/**
|
|
38
|
-
* 서버 종료
|
|
39
|
-
*/
|
|
40
42
|
stop(): Promise<void>;
|
|
41
|
-
/**
|
|
42
|
-
* 라우트 파일 로딩 (또는 수동 콜백)
|
|
43
|
-
*/
|
|
44
43
|
private loadRoutes;
|
|
45
|
-
/**
|
|
46
|
-
* 라우트 핫 리로드
|
|
47
|
-
*/
|
|
48
44
|
private reloadRoutes;
|
|
45
|
+
private handleFrontendChange;
|
|
49
46
|
private startWatcher;
|
|
50
47
|
private handleSSE;
|
|
51
48
|
private broadcastSSE;
|
|
52
49
|
private regeneratePlayground;
|
|
53
|
-
|
|
50
|
+
/**
|
|
51
|
+
* Inject HMR and (optionally) client-side router scripts before </body>.
|
|
52
|
+
*/
|
|
53
|
+
private injectScripts;
|
|
54
|
+
private serveStaticFile;
|
|
55
|
+
private proxyToApiServer;
|
|
56
|
+
private handleFrontendRequest;
|
|
57
|
+
private handleApiRequest;
|
|
54
58
|
private printStartupBanner;
|
|
55
59
|
}
|
|
56
60
|
/**
|
|
57
|
-
*
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* ```ts
|
|
61
|
-
* import { startDevServer } from "clawfire/dev";
|
|
62
|
-
*
|
|
63
|
-
* startDevServer({
|
|
64
|
-
* port: 3456,
|
|
65
|
-
* onSetupRoutes: (router) => {
|
|
66
|
-
* router.register("/health", healthRoute);
|
|
67
|
-
* router.register("/products/list", listRoute);
|
|
68
|
-
* }
|
|
69
|
-
* });
|
|
70
|
-
* ```
|
|
61
|
+
* Create and start dev server (one-line helper)
|
|
71
62
|
*/
|
|
72
63
|
declare function startDevServer(options?: DevServerOptions): Promise<DevServer>;
|
|
73
64
|
|
|
74
|
-
type WatchEventType = "route-change" | "schema-change" | "config-change" | "any-change";
|
|
65
|
+
type WatchEventType = "route-change" | "schema-change" | "config-change" | "frontend-change" | "css-change" | "page-change" | "component-change" | "any-change";
|
|
75
66
|
interface WatchEvent {
|
|
76
67
|
type: WatchEventType;
|
|
77
68
|
filePath: string;
|
|
@@ -90,6 +81,14 @@ declare class FileWatcher extends EventEmitter {
|
|
|
90
81
|
* 단일 파일 감시
|
|
91
82
|
*/
|
|
92
83
|
watchFile(filePath: string, eventType: WatchEventType): this;
|
|
84
|
+
/**
|
|
85
|
+
* 프론트엔드 디렉터리 감시 (확장자별 이벤트 타입 자동 결정)
|
|
86
|
+
*/
|
|
87
|
+
watchDirFrontend(dir: string): this;
|
|
88
|
+
/**
|
|
89
|
+
* Linux fallback: 프론트엔드 디렉터리 수동 재귀 감시
|
|
90
|
+
*/
|
|
91
|
+
private watchDirFrontendRecursiveManual;
|
|
93
92
|
/**
|
|
94
93
|
* Linux fallback: 디렉터리 수동 재귀 감시
|
|
95
94
|
*/
|