@xfilecom/xframe 0.1.21 → 0.1.23
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/defaults.json +2 -2
- package/package.json +3 -2
- package/template/apps/api/package.json +5 -3
- package/template/apps/api/src/app.module.ts +1 -1
- package/template/apps/api/src/sql-query/sql-query.controller.ts +1 -1
- package/template/apps/api/src/sql-query/sql-query.service.ts +3 -3
- package/template/apps/api/tsconfig.json +3 -0
- package/template/shared/README.md +2 -0
- package/template/web/admin/src/main.tsx +2 -2
- package/template/web/client/src/main.tsx +2 -2
- package/template/web/shared/README.md +25 -0
package/defaults.json
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@xfilecom/xframe",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.23",
|
|
4
4
|
"description": "Scaffold full-stack app: Nest + @xfilecom/backend-core, Vite/React + @xfilecom/front-core",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"bin": {
|
|
@@ -13,7 +13,8 @@
|
|
|
13
13
|
],
|
|
14
14
|
"scripts": {
|
|
15
15
|
"sync-defaults": "node scripts/sync-defaults.js",
|
|
16
|
-
"
|
|
16
|
+
"sync-template-front-core": "node scripts/sync-template-front-core.js",
|
|
17
|
+
"prepublishOnly": "npm run sync-defaults && npm run sync-template-front-core"
|
|
17
18
|
},
|
|
18
19
|
"engines": {
|
|
19
20
|
"node": ">=18"
|
|
@@ -3,9 +3,10 @@
|
|
|
3
3
|
"version": "0.0.1",
|
|
4
4
|
"private": true,
|
|
5
5
|
"scripts": {
|
|
6
|
-
"build": "nest build",
|
|
7
|
-
"start": "
|
|
8
|
-
"start:dev": "tsc-
|
|
6
|
+
"build": "nest build && tsc-alias -p tsconfig.build.json",
|
|
7
|
+
"start": "npm run build && node --enable-source-maps dist/apps/api/src/main.js",
|
|
8
|
+
"start:dev:run": "tsc-alias -p tsconfig.build.json && node --enable-source-maps dist/apps/api/src/main.js",
|
|
9
|
+
"start:dev": "tsc-watch -p tsconfig.build.json --onSuccess \"npm run start:dev:run\" --noClear",
|
|
9
10
|
"start:prod": "node --enable-source-maps dist/apps/api/src/main.js"
|
|
10
11
|
},
|
|
11
12
|
"dependencies": {
|
|
@@ -20,6 +21,7 @@
|
|
|
20
21
|
"@nestjs/cli": "^10.0.0",
|
|
21
22
|
"@types/express": "^4.17.21",
|
|
22
23
|
"@types/node": "^20.0.0",
|
|
24
|
+
"tsc-alias": "^1.8.10",
|
|
23
25
|
"tsc-watch": "^6.2.1",
|
|
24
26
|
"typescript": "^5.0.0"
|
|
25
27
|
}
|
|
@@ -5,7 +5,7 @@ import { AppController } from './app.controller';
|
|
|
5
5
|
import { AppService } from './app.service';
|
|
6
6
|
import { SqlQueryController } from './sql-query/sql-query.controller';
|
|
7
7
|
import { SqlQueryService } from './sql-query/sql-query.service';
|
|
8
|
-
import { schema } from '
|
|
8
|
+
import { schema } from '@shared/schema';
|
|
9
9
|
|
|
10
10
|
function coreOptionsFromYaml(): CoreModuleOptions {
|
|
11
11
|
const c = appConfig.core;
|
|
@@ -8,7 +8,7 @@ import {
|
|
|
8
8
|
} from '@nestjs/common';
|
|
9
9
|
import { ControllerHelpers, Public } from '@xfilecom/backend-core';
|
|
10
10
|
import { appConfig } from '../config.loader';
|
|
11
|
-
import type { SqlDatabaseListPostBody, SqlListPostBody } from '
|
|
11
|
+
import type { SqlDatabaseListPostBody, SqlListPostBody } from '@shared/sql/sql';
|
|
12
12
|
import { SqlQueryService } from './sql-query.service';
|
|
13
13
|
|
|
14
14
|
/**
|
|
@@ -11,13 +11,13 @@ import {
|
|
|
11
11
|
listPageableColumnNames,
|
|
12
12
|
pageableFromClause,
|
|
13
13
|
pickDefaultSortColumn,
|
|
14
|
-
} from '
|
|
14
|
+
} from '@shared/sql/pageable-drizzle';
|
|
15
15
|
import {
|
|
16
16
|
getPageableResourceKeyByMysqlTableName,
|
|
17
17
|
getPageableTable,
|
|
18
18
|
getPageableTableByMysqlTableName,
|
|
19
19
|
PAGEABLE_RESOURCE_OPTIONS,
|
|
20
|
-
} from '
|
|
20
|
+
} from '@shared/sql/pageable-tables';
|
|
21
21
|
import {
|
|
22
22
|
escapeLikePattern,
|
|
23
23
|
isSafeSqlIdentifier,
|
|
@@ -25,7 +25,7 @@ import {
|
|
|
25
25
|
resolveEndpointSqlQuery,
|
|
26
26
|
type SqlDatabaseListPostBody,
|
|
27
27
|
type SqlListPostBody,
|
|
28
|
-
} from '
|
|
28
|
+
} from '@shared/sql/sql';
|
|
29
29
|
|
|
30
30
|
@Injectable()
|
|
31
31
|
export class SqlQueryService {
|
|
@@ -10,6 +10,8 @@
|
|
|
10
10
|
| **`sql/`** | 마이그레이션·시드·원시 SQL; **`sql/sql.ts`** (`databaseSqlManifest`) 로 경로·절차 메타 정리 |
|
|
11
11
|
| **`endpoint/`** | HTTP 계약(OpenAPI yaml, 공유 DTO 타입, 라우트 메타) — 제품에 맞게 확장 |
|
|
12
12
|
|
|
13
|
+
프론트 전용 공유 패키지(**`web/shared`**)는 이 루트 `shared/`와 **별도**입니다. 설명은 **[`web/shared/README.md`](../web/shared/README.md)** 를 참고하세요.
|
|
14
|
+
|
|
13
15
|
`apps/api/src/config.loader.ts`는 **`shared/config/api`** 를 읽습니다.
|
|
14
16
|
`web/client/vite.config.ts` / `web/admin/vite.config.ts`는 각각 **`shared/config/web/client`**, **`shared/config/web/admin`** 을 읽습니다.
|
|
15
17
|
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom/client';
|
|
3
3
|
import '@xfilecom/front-core/tokens.css';
|
|
4
|
-
import '
|
|
4
|
+
import '__WEB_SHARED_WORKSPACE__/styles/xfc-theme.css';
|
|
5
5
|
import '@xfilecom/front-core/base.css';
|
|
6
|
-
import '
|
|
6
|
+
import '__WEB_SHARED_WORKSPACE__/styles/app.css';
|
|
7
7
|
import { App } from './App';
|
|
8
8
|
|
|
9
9
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import ReactDOM from 'react-dom/client';
|
|
3
3
|
import '@xfilecom/front-core/tokens.css';
|
|
4
|
-
import '
|
|
4
|
+
import '__WEB_SHARED_WORKSPACE__/styles/xfc-theme.css';
|
|
5
5
|
import '@xfilecom/front-core/base.css';
|
|
6
|
-
import '
|
|
6
|
+
import '__WEB_SHARED_WORKSPACE__/styles/app.css';
|
|
7
7
|
import { App } from './App';
|
|
8
8
|
|
|
9
9
|
ReactDOM.createRoot(document.getElementById('root')!).render(
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# `web/shared` — 클라이언트·어드민 공유 패키지
|
|
2
|
+
|
|
3
|
+
Vite 앱(`web/client`, `web/admin`)이 함께 쓰는 **React 컴포넌트, 스타일, 훅, 타입**을 두는 워크스페이스 패키지입니다.
|
|
4
|
+
프로젝트 루트의 **`shared/`**(Drizzle 스키마, `sql/`, API `config/` 등)와 **별도**입니다.
|
|
5
|
+
|
|
6
|
+
## 백엔드 `@shared/*`와 겹치나요?
|
|
7
|
+
|
|
8
|
+
**겹치지 않습니다.** Nest(`apps/api`)는 `@shared/*`를 루트 `shared/`로만 쓰고, 프론트는 이 패키지의 **npm 이름**(`__WEB_SHARED_WORKSPACE__` → 스캐폴드 시 실제 이름)과 **`exports`** 서브패스로만 연결합니다.
|
|
9
|
+
|
|
10
|
+
## 스타일 (`main.tsx`)
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import '@xfilecom/front-core/tokens.css';
|
|
14
|
+
import '__WEB_SHARED_WORKSPACE__/styles/xfc-theme.css';
|
|
15
|
+
import '@xfilecom/front-core/base.css';
|
|
16
|
+
import '__WEB_SHARED_WORKSPACE__/styles/app.css';
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## TS/컴포넌트
|
|
20
|
+
|
|
21
|
+
```ts
|
|
22
|
+
import { Shell } from '__WEB_SHARED_WORKSPACE__';
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
새 파일을 앱에서 가져오려면 `package.json`의 **`exports`**에 서브패스를 추가하세요.
|