@spfn/cms 0.1.0-alpha.65 → 0.1.0-alpha.66
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 +8 -1
- package/dist/{actions-CwvmPG0e.d.ts → actions-BpTAYuBA.d.ts} +2 -103
- package/dist/actions.d.ts +2 -1
- package/dist/client.d.ts +2 -1
- package/dist/index.d.ts +1 -1
- package/dist/locale.constants-BMBK70YM.d.ts +104 -0
- package/dist/server.d.ts +2 -10
- package/dist/server.js +569 -655
- package/dist/server.js.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -406,9 +406,16 @@ const { t: tEn } = await getSection('home', 'en');
|
|
|
406
406
|
|
|
407
407
|
## Documentation
|
|
408
408
|
|
|
409
|
-
|
|
409
|
+
### Getting Started
|
|
410
|
+
- **[Label Auto-Sync Guide](./LABEL_SYNC_GUIDE.md)** - Detailed sync configuration and options
|
|
410
411
|
- **[Examples](./examples/)** - Usage examples
|
|
411
412
|
|
|
413
|
+
### Advanced Guides
|
|
414
|
+
- **[Advanced Features](./ADVANCED_FEATURES.md)** - Breakpoints, value types, InitCms, Draft Mode
|
|
415
|
+
- **[Locale Management](./LOCALE_GUIDE.md)** - Complete locale guide with 50+ languages
|
|
416
|
+
- **[API Reference](./API_REFERENCE.md)** - Complete API documentation and repository functions
|
|
417
|
+
- **[Draft & Versioning](./DRAFT_AND_VERSIONING.md)** - Draft system, version control, audit logs
|
|
418
|
+
|
|
412
419
|
## Architecture
|
|
413
420
|
|
|
414
421
|
```
|
|
@@ -1,105 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
* Locale Constants
|
|
3
|
-
*
|
|
4
|
-
* Server/Client 양쪽에서 사용 가능한 locale 관련 상수
|
|
5
|
-
*/
|
|
6
|
-
/**
|
|
7
|
-
* Locale 쿠키 키
|
|
8
|
-
*/
|
|
9
|
-
declare const LOCALE_COOKIE_KEY = "spfn-locale";
|
|
10
|
-
/**
|
|
11
|
-
* 지원하는 Locale 타입 (Type-safe)
|
|
12
|
-
*/
|
|
13
|
-
type SupportedLocale = 'ko' | 'ja' | 'zh' | 'zh-TW' | 'zh-HK' | 'hi' | 'th' | 'vi' | 'id' | 'ms' | 'en' | 'en-GB' | 'en-CA' | 'en-AU' | 'en-NZ' | 'es' | 'es-MX' | 'es-AR' | 'es-CO' | 'fr' | 'de' | 'it' | 'pt' | 'nl' | 'sv' | 'no' | 'da' | 'fi' | 'ru' | 'pl' | 'uk' | 'cs' | 'hu' | 'ro' | 'bg' | 'hr' | 'sr' | 'sk' | 'sl' | 'lt' | 'lv' | 'et' | 'el' | 'tr' | 'ar' | 'fa' | 'he' | 'sw';
|
|
14
|
-
/**
|
|
15
|
-
* 국가/지역 정보 타입
|
|
16
|
-
*/
|
|
17
|
-
interface LocaleInfo {
|
|
18
|
-
/** Locale 코드 (ISO 639-1) */
|
|
19
|
-
locale: SupportedLocale;
|
|
20
|
-
/** 국가 코드 (ISO 3166-1 alpha-2) */
|
|
21
|
-
countryCode: string;
|
|
22
|
-
/** 국기 이모지 (HTML/React용) */
|
|
23
|
-
flag: string;
|
|
24
|
-
/** 전화번호 국가 코드 */
|
|
25
|
-
dialCode: string;
|
|
26
|
-
/** 네이티브 이름 (현지어) */
|
|
27
|
-
nativeName: string;
|
|
28
|
-
/** 영어 이름 */
|
|
29
|
-
englishName: string;
|
|
30
|
-
/** RTL (Right-to-Left) 여부 */
|
|
31
|
-
rtl?: boolean;
|
|
32
|
-
/** 통화 코드 (ISO 4217) */
|
|
33
|
-
currencyCode?: string;
|
|
34
|
-
/** 날짜 형식 예시 */
|
|
35
|
-
dateFormat?: string;
|
|
36
|
-
}
|
|
37
|
-
/**
|
|
38
|
-
* 사전 정의된 Locale 정보 맵
|
|
39
|
-
*
|
|
40
|
-
* 주요 언어/국가 정보를 포함합니다.
|
|
41
|
-
* 프로젝트에 맞게 추가/수정 가능합니다.
|
|
42
|
-
*/
|
|
43
|
-
declare const LOCALE_INFO_MAP: Record<SupportedLocale, LocaleInfo>;
|
|
44
|
-
/**
|
|
45
|
-
* Locale 정보 가져오기
|
|
46
|
-
*
|
|
47
|
-
* @param locale - Locale 코드 (예: 'ko', 'en', 'ja')
|
|
48
|
-
* @returns LocaleInfo 또는 undefined
|
|
49
|
-
*
|
|
50
|
-
* @example
|
|
51
|
-
* ```typescript
|
|
52
|
-
* const koInfo = getLocaleInfo('ko');
|
|
53
|
-
* console.log(koInfo.flag); // 🇰🇷
|
|
54
|
-
* console.log(koInfo.dialCode); // +82
|
|
55
|
-
* ```
|
|
56
|
-
*/
|
|
57
|
-
declare function getLocaleInfo(locale: string): LocaleInfo | undefined;
|
|
58
|
-
/**
|
|
59
|
-
* 지원하는 모든 Locale 목록 가져오기
|
|
60
|
-
*
|
|
61
|
-
* @returns Locale 코드 배열
|
|
62
|
-
*/
|
|
63
|
-
declare function getSupportedLocales(): SupportedLocale[];
|
|
64
|
-
/**
|
|
65
|
-
* 국기 이모지만 가져오기
|
|
66
|
-
*
|
|
67
|
-
* @param locale - Locale 코드
|
|
68
|
-
* @returns 국기 이모지 또는 빈 문자열
|
|
69
|
-
*
|
|
70
|
-
* @example
|
|
71
|
-
* ```typescript
|
|
72
|
-
* getFlag('ko'); // 🇰🇷
|
|
73
|
-
* getFlag('en'); // 🇺🇸
|
|
74
|
-
* ```
|
|
75
|
-
*/
|
|
76
|
-
declare function getFlag(locale: string): string;
|
|
77
|
-
/**
|
|
78
|
-
* 전화번호 국가 코드 가져오기
|
|
79
|
-
*
|
|
80
|
-
* @param locale - Locale 코드
|
|
81
|
-
* @returns 전화번호 코드 또는 빈 문자열
|
|
82
|
-
*
|
|
83
|
-
* @example
|
|
84
|
-
* ```typescript
|
|
85
|
-
* getDialCode('ko'); // +82
|
|
86
|
-
* getDialCode('en'); // +1
|
|
87
|
-
* ```
|
|
88
|
-
*/
|
|
89
|
-
declare function getDialCode(locale: string): string;
|
|
90
|
-
/**
|
|
91
|
-
* RTL (Right-to-Left) 여부 확인
|
|
92
|
-
*
|
|
93
|
-
* @param locale - Locale 코드
|
|
94
|
-
* @returns RTL 여부
|
|
95
|
-
*
|
|
96
|
-
* @example
|
|
97
|
-
* ```typescript
|
|
98
|
-
* isRTL('ar'); // true (Arabic)
|
|
99
|
-
* isRTL('ko'); // false (Korean)
|
|
100
|
-
* ```
|
|
101
|
-
*/
|
|
102
|
-
declare function isRTL(locale: string): boolean;
|
|
1
|
+
import { e as LocaleInfo } from './locale.constants-BMBK70YM.js';
|
|
103
2
|
|
|
104
3
|
/**
|
|
105
4
|
* 현재 locale 가져오기 (Server Action)
|
|
@@ -293,4 +192,4 @@ declare function getLocaleWithInfo(): Promise<{
|
|
|
293
192
|
*/
|
|
294
193
|
declare function getLocalesWithInfo(): Promise<LocaleInfo[]>;
|
|
295
194
|
|
|
296
|
-
export {
|
|
195
|
+
export { getLocales as a, getLocaleWithInfo as b, getLocalesWithInfo as c, getLocale as g, setLocale as s };
|
package/dist/actions.d.ts
CHANGED
|
@@ -1 +1,2 @@
|
|
|
1
|
-
export {
|
|
1
|
+
export { g as getLocale, a as getLocales, s as setLocale } from './actions-BpTAYuBA.js';
|
|
2
|
+
export { L as LOCALE_COOKIE_KEY } from './locale.constants-BMBK70YM.js';
|
package/dist/client.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { SectionData, SectionAPI } from './server.js';
|
|
2
2
|
import * as zustand from 'zustand';
|
|
3
|
-
export {
|
|
3
|
+
export { g as getLocale, b as getLocaleWithInfo, a as getLocales, c as getLocalesWithInfo, s as setLocale } from './actions-BpTAYuBA.js';
|
|
4
|
+
export { L as LOCALE_COOKIE_KEY, d as LOCALE_INFO_MAP, e as LocaleInfo, S as SupportedLocale, c as getDialCode, b as getFlag, g as getLocaleInfo, a as getSupportedLocales, i as isRTL } from './locale.constants-BMBK70YM.js';
|
|
4
5
|
import './index-Dh5FjWzR.js';
|
|
5
6
|
import './server/repositories/index.js';
|
|
6
7
|
import './server/entities/cms-labels.js';
|
package/dist/index.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { L as LOCALE_COOKIE_KEY, d as LOCALE_INFO_MAP, e as LocaleInfo, S as SupportedLocale, c as getDialCode, b as getFlag, g as getLocaleInfo, a as getSupportedLocales, i as isRTL } from './
|
|
1
|
+
export { L as LOCALE_COOKIE_KEY, d as LOCALE_INFO_MAP, e as LocaleInfo, S as SupportedLocale, c as getDialCode, b as getFlag, g as getLocaleInfo, a as getSupportedLocales, i as isRTL } from './locale.constants-BMBK70YM.js';
|
|
2
2
|
export { SectionAPI, SectionData } from './server.js';
|
|
3
3
|
export { F as FlatLabel, a as LabelDefinition, L as LabelType, N as NestedLabels, S as SectionDefinition, b as SyncOptions, c as SyncResult } from './index-Dh5FjWzR.js';
|
|
4
4
|
import './server/repositories/index.js';
|
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Locale Constants
|
|
3
|
+
*
|
|
4
|
+
* Server/Client 양쪽에서 사용 가능한 locale 관련 상수
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Locale 쿠키 키
|
|
8
|
+
*/
|
|
9
|
+
declare const LOCALE_COOKIE_KEY = "spfn-locale";
|
|
10
|
+
/**
|
|
11
|
+
* 지원하는 Locale 타입 (Type-safe)
|
|
12
|
+
*/
|
|
13
|
+
type SupportedLocale = 'ko' | 'ja' | 'zh' | 'zh-TW' | 'zh-HK' | 'hi' | 'th' | 'vi' | 'id' | 'ms' | 'en' | 'en-GB' | 'en-CA' | 'en-AU' | 'en-NZ' | 'es' | 'es-MX' | 'es-AR' | 'es-CO' | 'fr' | 'de' | 'it' | 'pt' | 'nl' | 'sv' | 'no' | 'da' | 'fi' | 'ru' | 'pl' | 'uk' | 'cs' | 'hu' | 'ro' | 'bg' | 'hr' | 'sr' | 'sk' | 'sl' | 'lt' | 'lv' | 'et' | 'el' | 'tr' | 'ar' | 'fa' | 'he' | 'sw';
|
|
14
|
+
/**
|
|
15
|
+
* 국가/지역 정보 타입
|
|
16
|
+
*/
|
|
17
|
+
interface LocaleInfo {
|
|
18
|
+
/** Locale 코드 (ISO 639-1) */
|
|
19
|
+
locale: SupportedLocale;
|
|
20
|
+
/** 국가 코드 (ISO 3166-1 alpha-2) */
|
|
21
|
+
countryCode: string;
|
|
22
|
+
/** 국기 이모지 (HTML/React용) */
|
|
23
|
+
flag: string;
|
|
24
|
+
/** 전화번호 국가 코드 */
|
|
25
|
+
dialCode: string;
|
|
26
|
+
/** 네이티브 이름 (현지어) */
|
|
27
|
+
nativeName: string;
|
|
28
|
+
/** 영어 이름 */
|
|
29
|
+
englishName: string;
|
|
30
|
+
/** RTL (Right-to-Left) 여부 */
|
|
31
|
+
rtl?: boolean;
|
|
32
|
+
/** 통화 코드 (ISO 4217) */
|
|
33
|
+
currencyCode?: string;
|
|
34
|
+
/** 날짜 형식 예시 */
|
|
35
|
+
dateFormat?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 사전 정의된 Locale 정보 맵
|
|
39
|
+
*
|
|
40
|
+
* 주요 언어/국가 정보를 포함합니다.
|
|
41
|
+
* 프로젝트에 맞게 추가/수정 가능합니다.
|
|
42
|
+
*/
|
|
43
|
+
declare const LOCALE_INFO_MAP: Record<SupportedLocale, LocaleInfo>;
|
|
44
|
+
/**
|
|
45
|
+
* Locale 정보 가져오기
|
|
46
|
+
*
|
|
47
|
+
* @param locale - Locale 코드 (예: 'ko', 'en', 'ja')
|
|
48
|
+
* @returns LocaleInfo 또는 undefined
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```typescript
|
|
52
|
+
* const koInfo = getLocaleInfo('ko');
|
|
53
|
+
* console.log(koInfo.flag); // 🇰🇷
|
|
54
|
+
* console.log(koInfo.dialCode); // +82
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
declare function getLocaleInfo(locale: string): LocaleInfo | undefined;
|
|
58
|
+
/**
|
|
59
|
+
* 지원하는 모든 Locale 목록 가져오기
|
|
60
|
+
*
|
|
61
|
+
* @returns Locale 코드 배열
|
|
62
|
+
*/
|
|
63
|
+
declare function getSupportedLocales(): SupportedLocale[];
|
|
64
|
+
/**
|
|
65
|
+
* 국기 이모지만 가져오기
|
|
66
|
+
*
|
|
67
|
+
* @param locale - Locale 코드
|
|
68
|
+
* @returns 국기 이모지 또는 빈 문자열
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```typescript
|
|
72
|
+
* getFlag('ko'); // 🇰🇷
|
|
73
|
+
* getFlag('en'); // 🇺🇸
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
declare function getFlag(locale: string): string;
|
|
77
|
+
/**
|
|
78
|
+
* 전화번호 국가 코드 가져오기
|
|
79
|
+
*
|
|
80
|
+
* @param locale - Locale 코드
|
|
81
|
+
* @returns 전화번호 코드 또는 빈 문자열
|
|
82
|
+
*
|
|
83
|
+
* @example
|
|
84
|
+
* ```typescript
|
|
85
|
+
* getDialCode('ko'); // +82
|
|
86
|
+
* getDialCode('en'); // +1
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
declare function getDialCode(locale: string): string;
|
|
90
|
+
/**
|
|
91
|
+
* RTL (Right-to-Left) 여부 확인
|
|
92
|
+
*
|
|
93
|
+
* @param locale - Locale 코드
|
|
94
|
+
* @returns RTL 여부
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```typescript
|
|
98
|
+
* isRTL('ar'); // true (Arabic)
|
|
99
|
+
* isRTL('ko'); // false (Korean)
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
declare function isRTL(locale: string): boolean;
|
|
103
|
+
|
|
104
|
+
export { LOCALE_COOKIE_KEY as L, type SupportedLocale as S, getSupportedLocales as a, getFlag as b, getDialCode as c, LOCALE_INFO_MAP as d, type LocaleInfo as e, getLocaleInfo as g, isRTL as i };
|
package/dist/server.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { L as LOCALE_COOKIE_KEY, d as LOCALE_INFO_MAP, e as LocaleInfo, S as SupportedLocale, c as getDialCode, b as getFlag,
|
|
1
|
+
export { L as LOCALE_COOKIE_KEY, d as LOCALE_INFO_MAP, e as LocaleInfo, S as SupportedLocale, c as getDialCode, b as getFlag, g as getLocaleInfo, a as getSupportedLocales, i as isRTL } from './locale.constants-BMBK70YM.js';
|
|
2
2
|
import { S as SectionDefinition, b as SyncOptions, c as SyncResult } from './index-Dh5FjWzR.js';
|
|
3
3
|
export { e as extractLabels, f as flattenLabels } from './index-Dh5FjWzR.js';
|
|
4
4
|
export { cmsDraftCacheRepository, cmsLabelValuesRepository, cmsLabelsRepository, cmsPublishedCacheRepository } from './server/repositories/index.js';
|
|
@@ -12,14 +12,6 @@ export { c as createLabelSyncGenerator } from './label-sync-generator-B0EmvtWM.j
|
|
|
12
12
|
import 'drizzle-orm/pg-core';
|
|
13
13
|
import '@spfn/core/codegen';
|
|
14
14
|
|
|
15
|
-
/**
|
|
16
|
-
* Locale 유효성 검사
|
|
17
|
-
*
|
|
18
|
-
* @param locale - 검사할 locale
|
|
19
|
-
* @returns 지원 여부
|
|
20
|
-
*/
|
|
21
|
-
declare function isValidLocale(locale: string): Promise<boolean>;
|
|
22
|
-
|
|
23
15
|
/**
|
|
24
16
|
* CMS Sync Utilities
|
|
25
17
|
*
|
|
@@ -175,4 +167,4 @@ declare const getSection: (section: string, locale?: string) => Promise<SectionA
|
|
|
175
167
|
*/
|
|
176
168
|
declare const getSections: (sections: string[], locale?: string) => Promise<Record<string, SectionAPI>>;
|
|
177
169
|
|
|
178
|
-
export { type SectionAPI, type SectionData, getSection, getSections, initLabelSync,
|
|
170
|
+
export { type SectionAPI, type SectionData, getSection, getSections, initLabelSync, loadLabelsFromJson, syncAll, syncSection };
|