@gaonjs/vue 0.1.2 → 0.1.3

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.d.ts CHANGED
@@ -1,2 +1,3 @@
1
1
  export declare const version: string;
2
2
  export declare const status: "planned";
3
+ export { pageProps } from "./pageProps.js";
package/dist/index.js CHANGED
@@ -1,8 +1,12 @@
1
1
  /**
2
2
  * @gaonjs/vue — Gaon 프론트엔드 어댑터 첫 구현 (Vue 3 · Inertia 브리지 · SSR).
3
3
  *
4
- * 구현은 웹/데이터 조각 이후 마일스톤. 현재는 개발 상태만 노출하는 스텁이다.
4
+ * 전체 어댑터(Inertia 브리지·SSR)는 후속 마일스톤이다. M3 에서는 타입
5
+ * 브리지의 Vue 쪽 끝인 pageProps 를 제공한다(§6.2) — 스키마→.vue 타입
6
+ * 체인의 마지막 고리.
5
7
  */
6
8
  import { VERSION } from "@gaonjs/core";
7
9
  export const version = VERSION;
8
10
  export const status = "planned";
11
+ // 타입 브리지 (M3) — GaonRouteMap[K] → 페이지 props 타입
12
+ export { pageProps } from "./pageProps.js";
@@ -0,0 +1,13 @@
1
+ import type { Rendered } from '@gaonjs/web';
2
+ declare global {
3
+ interface GaonRouteMap {
4
+ }
5
+ }
6
+ type PropsOf<F> = F extends (...args: never[]) => infer R ? Awaited<R> extends Rendered<infer P> ? P : never : never;
7
+ /**
8
+ * 페이지의 props 타입을 라우트 이름으로 가져온다.
9
+ * `const { posts } = pageProps<'posts#index'>()`
10
+ * 런타임 값은 Inertia 가 주입한 실제 페이지 props 로 대체된다(M4 브리지).
11
+ */
12
+ export declare function pageProps<K extends keyof GaonRouteMap>(): PropsOf<GaonRouteMap[K]>;
13
+ export {};
@@ -0,0 +1,20 @@
1
+ // @gaonjs/vue · pageProps — 라우트 이름 문자열 → 컨트롤러 반환 props 타입.
2
+ //
3
+ // 타입 브리지의 Vue 쪽 끝(§6.2). `.gaon/routes.d.ts` 가 declaration
4
+ // merging 으로 GaonRouteMap 을 채우면(라우트 이름 → 컨트롤러 액션 타입),
5
+ // pageProps<'posts#index'>() 가 그 액션의 render props 타입을 돌려준다.
6
+ //
7
+ // 스키마→모델→컨트롤러→(생성된 라우트 지도)→페이지로 이어지는 타입
8
+ // 체인의 마지막 고리다. 스키마에서 컬럼을 지우면 .vue 템플릿의 사용
9
+ // 지점에서 vue-tsc 가 에러를 낸다(완료 기준).
10
+ //
11
+ // M3 는 raw props(P)를 그대로 돌려준다. 깊은 직렬화(Rec→SerializedOf,
12
+ // hidden 제외)는 M4 다 — 그때 반환 타입을 SerializedOf<P> 로 승격한다.
13
+ /**
14
+ * 페이지의 props 타입을 라우트 이름으로 가져온다.
15
+ * `const { posts } = pageProps<'posts#index'>()`
16
+ * 런타임 값은 Inertia 가 주입한 실제 페이지 props 로 대체된다(M4 브리지).
17
+ */
18
+ export function pageProps() {
19
+ return undefined;
20
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gaonjs/vue",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "description": "Gaon 프론트엔드 어댑터: Vue 3 · Inertia 브리지 · 타입 전파 · SSR (구현 예정)",
5
5
  "type": "module",
6
6
  "license": "MIT",
@@ -24,7 +24,8 @@
24
24
  "README.md"
25
25
  ],
26
26
  "dependencies": {
27
- "@gaonjs/core": "0.1.2"
27
+ "@gaonjs/core": "0.1.2",
28
+ "@gaonjs/web": "0.1.3"
28
29
  },
29
30
  "scripts": {
30
31
  "build": "node ../../node_modules/typescript/bin/tsc -p tsconfig.json"