@xfilecom/xframe 0.1.22 → 0.1.24

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 CHANGED
@@ -1,4 +1,4 @@
1
1
  {
2
- "backendCore": "^1.0.3",
3
- "frontCore": "^0.2.8"
2
+ "backendCore": "^1.0.5",
3
+ "frontCore": "^0.2.10"
4
4
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xfilecom/xframe",
3
- "version": "0.1.22",
3
+ "version": "0.1.24",
4
4
  "description": "Scaffold full-stack app: Nest + @xfilecom/backend-core, Vite/React + @xfilecom/front-core",
5
5
  "license": "UNLICENSED",
6
6
  "bin": {
@@ -5,7 +5,8 @@
5
5
  "scripts": {
6
6
  "build": "nest build && tsc-alias -p tsconfig.build.json",
7
7
  "start": "npm run build && node --enable-source-maps dist/apps/api/src/main.js",
8
- "start:dev": "tsc-watch -p tsconfig.build.json --onSuccess \"tsc-alias -p tsconfig.build.json && node --enable-source-maps dist/apps/api/src/main.js\" --noClear",
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": {
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import ReactDOM from 'react-dom/client';
3
3
  import '@xfilecom/front-core/tokens.css';
4
- import '__WEB_SHARED_WORKSPACE__/styles/xfc-theme.css';
5
4
  import '@xfilecom/front-core/base.css';
5
+ import '__WEB_SHARED_WORKSPACE__/styles/xfc-theme.css';
6
6
  import '__WEB_SHARED_WORKSPACE__/styles/app.css';
7
7
  import { App } from './App';
8
8
 
@@ -9,6 +9,7 @@
9
9
  "baseUrl": ".",
10
10
  "paths": {
11
11
  "__WEB_SHARED_WORKSPACE__": ["../shared/src/index.ts"],
12
+ "__WEB_SHARED_WORKSPACE__/*": ["../shared/src/*"],
12
13
  "@xfilecom/front-core": ["../../../../front-core/src/index.ts"]
13
14
  },
14
15
  "allowImportingTsExtensions": true,
@@ -7,6 +7,11 @@ import react from '@vitejs/plugin-react';
7
7
 
8
8
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
9
 
10
+ /** xframe 모노레포 안: 로컬 front-core 소스 → Vite가 바로 번들 (npm dist 생략). */
11
+ const frontCoreSrc = path.resolve(__dirname, '../../../../front-core/src');
12
+
13
+ const webSharedSrc = path.resolve(__dirname, '../shared/src');
14
+
10
15
  function readYaml(file: string): Record<string, unknown> {
11
16
  if (!existsSync(file)) return {};
12
17
  const parsed = yaml.load(readFileSync(file, 'utf8'));
@@ -59,6 +64,12 @@ export default defineConfig(({ mode }) => {
59
64
  typeof cfg.app?.title === 'string' ? cfg.app.title : '__PACKAGE_NAME__ (admin)';
60
65
  return {
61
66
  plugins: [react()],
67
+ resolve: {
68
+ alias: {
69
+ '@xfilecom/front-core': frontCoreSrc,
70
+ '__WEB_SHARED_WORKSPACE__': webSharedSrc,
71
+ },
72
+ },
62
73
  define: {
63
74
  'import.meta.env.VITE_API_BASE_URL': JSON.stringify(apiBase),
64
75
  'import.meta.env.VITE_APP_TITLE': JSON.stringify(title),
@@ -1,8 +1,8 @@
1
1
  import React from 'react';
2
2
  import ReactDOM from 'react-dom/client';
3
3
  import '@xfilecom/front-core/tokens.css';
4
- import '__WEB_SHARED_WORKSPACE__/styles/xfc-theme.css';
5
4
  import '@xfilecom/front-core/base.css';
5
+ import '__WEB_SHARED_WORKSPACE__/styles/xfc-theme.css';
6
6
  import '__WEB_SHARED_WORKSPACE__/styles/app.css';
7
7
  import { App } from './App';
8
8
 
@@ -9,6 +9,7 @@
9
9
  "baseUrl": ".",
10
10
  "paths": {
11
11
  "__WEB_SHARED_WORKSPACE__": ["../shared/src/index.ts"],
12
+ "__WEB_SHARED_WORKSPACE__/*": ["../shared/src/*"],
12
13
  "@xfilecom/front-core": ["../../../../front-core/src/index.ts"]
13
14
  },
14
15
  "allowImportingTsExtensions": true,
@@ -7,6 +7,12 @@ import react from '@vitejs/plugin-react';
7
7
 
8
8
  const __dirname = path.dirname(fileURLToPath(import.meta.url));
9
9
 
10
+ /** xframe 모노레포 안: 로컬 front-core 소스 → Vite가 바로 번들 (npm dist 생략). */
11
+ const frontCoreSrc = path.resolve(__dirname, '../../../../front-core/src');
12
+
13
+ /** file:../shared 복사본이 아닌 워크스페이스 web/shared/src (플레이스홀더 패키지 이름과 동일 키) */
14
+ const webSharedSrc = path.resolve(__dirname, '../shared/src');
15
+
10
16
  function readYaml(file: string): Record<string, unknown> {
11
17
  if (!existsSync(file)) return {};
12
18
  const parsed = yaml.load(readFileSync(file, 'utf8'));
@@ -59,6 +65,12 @@ export default defineConfig(({ mode }) => {
59
65
  typeof cfg.app?.title === 'string' ? cfg.app.title : '__PACKAGE_NAME__ (client)';
60
66
  return {
61
67
  plugins: [react()],
68
+ resolve: {
69
+ alias: {
70
+ '@xfilecom/front-core': frontCoreSrc,
71
+ '__WEB_SHARED_WORKSPACE__': webSharedSrc,
72
+ },
73
+ },
62
74
  define: {
63
75
  'import.meta.env.VITE_API_BASE_URL': JSON.stringify(apiBase),
64
76
  'import.meta.env.VITE_APP_TITLE': JSON.stringify(title),
@@ -11,8 +11,8 @@ Vite 앱(`web/client`, `web/admin`)이 함께 쓰는 **React 컴포넌트, 스
11
11
 
12
12
  ```ts
13
13
  import '@xfilecom/front-core/tokens.css';
14
- import '__WEB_SHARED_WORKSPACE__/styles/xfc-theme.css';
15
14
  import '@xfilecom/front-core/base.css';
15
+ import '__WEB_SHARED_WORKSPACE__/styles/xfc-theme.css';
16
16
  import '__WEB_SHARED_WORKSPACE__/styles/app.css';
17
17
  ```
18
18
 
@@ -23,3 +23,18 @@ import { Shell } from '__WEB_SHARED_WORKSPACE__';
23
23
  ```
24
24
 
25
25
  새 파일을 앱에서 가져오려면 `package.json`의 **`exports`**에 서브패스를 추가하세요.
26
+
27
+ ## `@xfilecom/front-core`를 모노레포에서 고치는 경우
28
+
29
+ `web/client`·`web/admin`의 **Vite `resolve.alias`**가 형제 디렉터리의 `front-core/src`(xframe 모노레포 기준 `packages/front-core/src`)를 가리키도록 되어 있으면, npm `dist/`가 아니라 **로컬 소스**가 번들됩니다. dev 중 HMR로 반영되는 것이 정상입니다.
30
+
31
+ 스캐폴드만 복사한 프로젝트처럼 그 경로가 없으면 alias가 깨지므로, `package.json`의 `@xfilecom/front-core` 버전과 `npm run build`(해당 패키지)로 갱신하세요.
32
+
33
+ ### `web/shared/tsconfig.json`에는 `paths`로 front-core를 붙이지 마세요
34
+
35
+ `rootDir`가 `src`인데 `@xfilecom/front-core`를 `../../../.../front-core/src`로 매핑하면, TypeScript가 **rootDir 밖 소스**를 끌어와 `File is not under 'rootDir'` 오류가 납니다.
36
+ `web/shared` 패키지 타입체크는 **`node_modules`의 `@xfilecom/front-core`**에 맡기고, 로컬 소스 번들은 위 **Vite alias**(client/admin)만 사용하면 됩니다.
37
+
38
+ ### `web/shared` CSS·TS가 수정해도 반영되지 않을 때
39
+
40
+ `file:../shared` 가 `node_modules`에 **복사본**으로 설치되면 Vite는 낡은 파일을 씁니다. `web/client`·`web/admin`의 Vite 설정에 **`__WEB_SHARED_WORKSPACE__` → `../shared/src`** alias가 있어 워크스페이스 소스를 직접 가리킵니다.
@@ -1,8 +1,8 @@
1
1
  /**
2
2
  * 앱 레이아웃 — `html/html` 모바일 프레임(폭 480)에 맞춤.
3
3
  *
4
- * 엔트리에서 @xfilecom/front-core/base.css 다음에 로드하세요.
5
- * 이 파일은 tokens / xfc-theme / atoms 이후이므로
4
+ * 엔트리에서 xfc-theme.css 다음(마지막 레이아웃·오버라이드)에 로드하세요.
5
+ * 이 파일은 tokens base → xfc-theme 이후이므로
6
6
  * - 레이아웃(.xfc-page 등)과
7
7
  * - 필요 시 atoms(.xfc-btn, .xfc-toast 등) 덮어쓰기
8
8
  * 를 같은 파일에 둘 수 있습니다.
@@ -67,9 +67,4 @@
67
67
  border-bottom: 1px solid var(--xfc-border-header);
68
68
  }
69
69
 
70
- /* —— optional: front-core atoms 오버라이드 (base.css 이후 로드됨) —— */
71
- /*
72
- .xfc-btn--primary {
73
- border-radius: var(--xfc-radius-md);
74
- }
75
- */
70
+ /* —— front-core atoms 추가 오버라이드는 xfc-theme.css 또는 여기 (app이 마지막 로드) —— */
@@ -1,18 +1,46 @@
1
1
  /**
2
- * 앱·브랜드별 디자인 토큰 덮어쓰기.
2
+ * 앱·브랜드별 토큰 + (선택) atoms 보강.
3
3
  *
4
- * 엔트리(main.tsx)에서 반드시 다음 순서로 넣으세요:
4
+ * 엔트리(main.tsx) 권장 순서:
5
5
  * 1. @xfilecom/front-core/tokens.css
6
- * 2. 이 파일 (xfc-theme.css)
7
- * 3. @xfilecom/front-core/base.css atoms var(--xfc-*) 참조
8
- * 4. app.css 레이아웃 + atoms(.xfc-*) 클래스 오버라이드
6
+ * 2. @xfilecom/front-core/base.css
7
+ * 3. 이 파일 (xfc-theme.css) :root 덮어쓰기 + .xfc-* base 보다 나중에 적용
8
+ * 4. app.css 레이아웃·추가 오버라이드
9
9
  *
10
- * 여기서 :root 의 --xfc-* 바꾸면 Button·Input·Toast front-core atoms 스타일에 그대로 반영됩니다.
10
+ * :root 의 --xfc-* 어느 시점에 두어도 var() 해석 최종 값이 쓰이고,
11
+ * 아래 .xfc-btn 규칙은 base.css 다음에 로드되어야 덮어쓰기가 됩니다.
11
12
  */
12
13
 
13
- /* 예시 (필요할 때 주석 해제)
14
14
  :root {
15
- --xfc-accent: #2a5bff;
16
- --xfc-accent-hover: #2248e6;
15
+ --xfc-accent: #0d9488;
16
+ --xfc-accent-hover: #0f766e;
17
+ --xfc-accent-fg: #ffffff;
18
+ --xfc-bg-muted: #f0fdfa;
19
+ --xfc-radius-xs: 10px;
20
+ --xfc-focus-ring: 0 0 0 3px color-mix(in srgb, var(--xfc-accent) 30%, transparent);
21
+ /* 버튼·인풋 등 padding 에 쓰이는 토큰 */
22
+ --xfc-space-lg: 18px;
23
+ --xfc-space-xl: 26px;
24
+ }
25
+
26
+ /* 스캐폴드 기본 예시 — primary 버튼 톤 (base.css 이후 로드 전제) */
27
+ .xfc-btn {
28
+ min-height: 44px;
29
+ font-weight: 800;
30
+ letter-spacing: 0.08em;
31
+ text-transform: uppercase;
32
+ font-size: 0.8125rem;
33
+ }
34
+
35
+ .xfc-btn--primary {
36
+ border: 2px solid color-mix(in srgb, var(--xfc-accent-fg) 35%, transparent);
37
+ box-shadow:
38
+ 0 1px 0 color-mix(in srgb, #000 18%, transparent),
39
+ 0 8px 24px color-mix(in srgb, var(--xfc-accent) 40%, transparent);
40
+ }
41
+
42
+ .xfc-btn--primary:hover:not(:disabled) {
43
+ box-shadow:
44
+ 0 2px 0 color-mix(in srgb, #000 22%, transparent),
45
+ 0 10px 28px color-mix(in srgb, var(--xfc-accent) 48%, transparent);
17
46
  }
18
- */