@spfn/cms 0.1.0-alpha.65 β†’ 0.1.0-alpha.68

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.
Files changed (36) hide show
  1. package/README.md +27 -452
  2. package/dist/{actions-CwvmPG0e.d.ts β†’ actions-BpTAYuBA.d.ts} +2 -103
  3. package/dist/actions.d.ts +2 -1
  4. package/dist/api.d.ts +4 -4
  5. package/dist/api.js +16 -16
  6. package/dist/api.js.map +1 -1
  7. package/dist/client.d.ts +2 -1
  8. package/dist/client.js +16 -16
  9. package/dist/client.js.map +1 -1
  10. package/dist/index.d.ts +1 -1
  11. package/dist/lib/contracts/labels.d.ts +12 -13
  12. package/dist/lib/contracts/labels.js +6 -6
  13. package/dist/lib/contracts/labels.js.map +1 -1
  14. package/dist/lib/contracts/published-cache.d.ts +2 -3
  15. package/dist/lib/contracts/published-cache.js +1 -1
  16. package/dist/lib/contracts/published-cache.js.map +1 -1
  17. package/dist/lib/contracts/values.d.ts +4 -6
  18. package/dist/lib/contracts/values.js +2 -2
  19. package/dist/lib/contracts/values.js.map +1 -1
  20. package/dist/locale.constants-BMBK70YM.d.ts +104 -0
  21. package/dist/server/routes/labels/[id]/index.js +6 -6
  22. package/dist/server/routes/labels/[id]/index.js.map +1 -1
  23. package/dist/server/routes/labels/by-key/[key]/index.js +6 -6
  24. package/dist/server/routes/labels/by-key/[key]/index.js.map +1 -1
  25. package/dist/server/routes/labels/index.js +6 -6
  26. package/dist/server/routes/labels/index.js.map +1 -1
  27. package/dist/server/routes/published-cache/index.js +1 -1
  28. package/dist/server/routes/published-cache/index.js.map +1 -1
  29. package/dist/server/routes/values/[labelId]/[version]/index.js +2 -2
  30. package/dist/server/routes/values/[labelId]/[version]/index.js.map +1 -1
  31. package/dist/server/routes/values/[labelId]/index.js +2 -2
  32. package/dist/server/routes/values/[labelId]/index.js.map +1 -1
  33. package/dist/server.d.ts +2 -10
  34. package/dist/server.js +569 -655
  35. package/dist/server.js.map +1 -1
  36. package/package.json +3 -3
package/README.md CHANGED
@@ -4,94 +4,26 @@ Content Management System for Next.js with JSON-based labels and automatic datab
4
4
 
5
5
  ## Features
6
6
 
7
- - πŸ“ **JSON file-based labels** - Simple file structure for label management
8
- - πŸ”„ **Auto-sync to database** on server startup and during development
9
- - 🌐 **Multi-language support** (i18n)
10
- - πŸͺ **Cookie-based locale management** - Automatic locale detection and persistence
11
- - πŸ“¦ **Folder-based structure** for better organization
12
- - πŸ”₯ **Hot reload** during development
13
- - πŸ’Ύ **Published cache** for optimal performance
14
- - ⚑ **Server Actions** for client-side locale management
15
- - πŸ› οΈ **Built on Drizzle ORM**
7
+ - πŸ“ JSON file-based labels
8
+ - πŸ”„ Auto-sync to database
9
+ - 🌐 50+ languages support
10
+ - πŸͺ Cookie-based locale management
11
+ - πŸ”₯ Hot reload during development
12
+ - πŸ’Ύ Published cache (17x faster)
13
+ - πŸ“ Draft system & version control
16
14
 
17
15
  ## Installation
18
16
 
19
- ### Recommended: Using Superfunction CLI (Automatic Database Setup)
20
-
21
17
  ```bash
22
18
  pnpm spfn add @spfn/cms
23
19
  ```
24
20
 
25
- This command will:
26
- 1. βœ… Install the package
27
- 2. βœ… Discover CMS database schemas automatically
28
- 3. βœ… Generate migrations for 6 CMS tables
29
- 4. βœ… Apply migrations to your database
30
- 5. βœ… Show setup guide
31
-
32
- **Tables created:**
33
- - `cms_labels` - Label definitions (10 columns, 2 indexes)
34
- - `cms_label_values` - Label values per locale (7 columns, 2 indexes, 1 FK)
35
- - `cms_label_versions` - Version history (9 columns, 2 indexes, 1 FK)
36
- - `cms_draft_cache` - Draft content cache (6 columns, 2 indexes)
37
- - `cms_published_cache` - Published content cache (7 columns, 1 index)
38
- - `cms_audit_logs` - Change audit trail (8 columns, 4 indexes, 1 FK)
39
-
40
- ### Manual Installation
41
-
42
- ```bash
43
- pnpm add @spfn/cms
44
- ```
45
-
46
- Then run database migrations:
47
-
48
- ```bash
49
- pnpm spfn db generate # Generate migrations
50
- pnpm spfn db migrate # Apply migrations
51
- ```
52
-
53
- **Note:** Manual installation requires that you have `DATABASE_URL` configured in your `.env.local` file.
54
-
55
21
  ## Quick Start
56
22
 
57
23
  ### 1. Create Label Files
58
24
 
59
- Create JSON files organized by sections and categories:
60
-
61
- ```
62
- src/lib/labels/
63
- layout/ ← Section name
64
- nav.json ← Category
65
- footer.json
66
- home/
67
- hero.json
68
- features.json
69
- ```
70
-
71
- **Example:** `src/lib/labels/layout/nav.json`
72
-
73
- ```json
74
- {
75
- "about": {
76
- "key": "layout.nav.about",
77
- "defaultValue": "About",
78
- "description": "Navigation link for About page"
79
- },
80
- "services": {
81
- "key": "layout.nav.services",
82
- "defaultValue": "Services",
83
- "description": "Navigation link for Services page"
84
- },
85
- "team": {
86
- "key": "layout.nav.team",
87
- "defaultValue": "Team"
88
- }
89
- }
90
- ```
91
-
92
- **Multi-language example:** `src/lib/labels/home/hero.json`
93
-
94
25
  ```json
26
+ // src/lib/labels/home/hero.json
95
27
  {
96
28
  "title": {
97
29
  "key": "home.hero.title",
@@ -99,67 +31,24 @@ src/lib/labels/
99
31
  "ko": "ν˜μ‹ μ μΈ μ†”λ£¨μ…˜",
100
32
  "en": "Innovative Solutions"
101
33
  }
102
- },
103
- "subtitle": {
104
- "key": "home.hero.subtitle",
105
- "defaultValue": {
106
- "ko": "λΉ„μ¦ˆλ‹ˆμŠ€ μ„±μž₯을 μœ„ν•œ 졜고의 νŒŒνŠΈλ„ˆ",
107
- "en": "Your Best Partner for Business Growth"
108
- }
109
- }
110
- }
111
- ```
112
-
113
- **Variable substitution:** `src/lib/labels/layout/footer.json`
114
-
115
- ```json
116
- {
117
- "copyright": {
118
- "key": "layout.footer.copyright",
119
- "defaultValue": "Β© {year} Company. All rights reserved."
120
34
  }
121
35
  }
122
36
  ```
123
37
 
124
- ### 2. Enable Auto-Sync on Server Startup
125
-
126
- Configure `src/server/server.config.ts`:
38
+ ### 2. Enable Auto-Sync
127
39
 
128
40
  ```typescript
129
- import type { ServerConfig } from '@spfn/core/server';
41
+ // src/server/server.config.ts
130
42
  import { initLabelSync } from '@spfn/cms/server';
131
- import { DEFAULT_LABELS_DIR } from '@spfn/cms';
132
43
 
133
44
  export default {
134
45
  beforeRoutes: async (app) => {
135
- await initLabelSync({
136
- verbose: true,
137
- // labelsDir: DEFAULT_LABELS_DIR // Optional, this is the default
138
- });
46
+ await initLabelSync({ verbose: true });
139
47
  },
140
48
  } satisfies ServerConfig;
141
49
  ```
142
50
 
143
- ### 3. Enable Auto-Sync During Development
144
-
145
- Your `.spfnrc.json` should include:
146
-
147
- ```json
148
- {
149
- "codegen": {
150
- "generators": [
151
- {
152
- "name": "@spfn/cms:label-sync",
153
- "enabled": true
154
- }
155
- ]
156
- }
157
- }
158
- ```
159
-
160
- This is automatically configured when you run `pnpm spfn add @spfn/cms`.
161
-
162
- ### 4. Use Labels in Your App
51
+ ### 3. Use in Your App
163
52
 
164
53
  **Server Component:**
165
54
 
@@ -167,22 +56,11 @@ This is automatically configured when you run `pnpm spfn add @spfn/cms`.
167
56
  import { getSection } from '@spfn/cms/server';
168
57
 
169
58
  export default async function HomePage() {
170
- const { t } = await getSection('layout', 'ko');
171
-
172
- return <h1>{t('nav.team')}</h1>;
59
+ const { t } = await getSection('home');
60
+ return <h1>{t('hero.title')}</h1>;
173
61
  }
174
62
  ```
175
63
 
176
- **With variable substitution:**
177
-
178
- ```typescript
179
- const { t } = await getSection('layout');
180
- const copyright = t('footer.copyright', undefined, {
181
- year: new Date().getFullYear()
182
- });
183
- // β†’ "Β© 2025 Company. All rights reserved."
184
- ```
185
-
186
64
  **Client Component:**
187
65
 
188
66
  ```typescript
@@ -190,337 +68,34 @@ const copyright = t('footer.copyright', undefined, {
190
68
  import { useSection } from '@spfn/cms/client';
191
69
 
192
70
  export default function Nav() {
193
- const { t, loading } = useSection('layout', { autoLoad: true });
194
-
195
- if (loading) return <div>Loading...</div>;
196
-
197
- return (
198
- <nav>
199
- <a>{t('nav.about')}</a>
200
- <a>{t('nav.services')}</a>
201
- </nav>
202
- );
203
- }
204
- ```
205
-
206
- ## File Structure
207
-
208
- ```
209
- src/lib/labels/
210
- layout/ # Section: layout
211
- nav.json # Category: nav
212
- footer.json # Category: footer
213
- home/ # Section: home
214
- hero.json # Category: hero
215
- features.json # Category: features
216
- ```
217
-
218
- **How it maps:**
219
- - Folder name = Section name
220
- - JSON file name = Category name (for organization only)
221
- - Inside JSON: `key` field defines the actual label key
222
-
223
- Example:
224
- ```
225
- src/lib/labels/layout/nav.json:
226
- key: "layout.nav.team" β†’ t('nav.team') in code
227
- ```
228
-
229
- ## JSON Label Format
230
-
231
- ```typescript
232
- {
233
- "labelName": {
234
- "key": "section.category.name", // Required: Unique identifier
235
- "defaultValue": "Text" | {...}, // Required: String or i18n object
236
- "description": "Optional description" // Optional: For documentation
237
- }
71
+ const { t } = useSection('layout', { autoLoad: true });
72
+ return <nav><a>{t('nav.about')}</a></nav>;
238
73
  }
239
74
  ```
240
75
 
241
- **Single language:**
242
- ```json
243
- {
244
- "welcome": {
245
- "key": "home.welcome",
246
- "defaultValue": "Welcome"
247
- }
248
- }
249
- ```
250
-
251
- **Multi-language:**
252
- ```json
253
- {
254
- "welcome": {
255
- "key": "home.welcome",
256
- "defaultValue": {
257
- "ko": "ν™˜μ˜ν•©λ‹ˆλ‹€",
258
- "en": "Welcome",
259
- "ja": "γ‚ˆγ†γ“γ"
260
- }
261
- }
262
- }
263
- ```
76
+ ## Documentation
264
77
 
265
- **Variable placeholders:**
266
- ```json
267
- {
268
- "greeting": {
269
- "key": "home.greeting",
270
- "defaultValue": "Hello, {name}!"
271
- }
272
- }
273
- ```
78
+ πŸ“– **[Full Documentation](../../docs/ecosystem/cms/index.md)**
274
79
 
275
- Usage:
276
- ```typescript
277
- t('greeting', undefined, { name: 'John' })
278
- // β†’ "Hello, John!"
279
- ```
80
+ - [Getting Started](../../docs/ecosystem/cms/getting-started.md) - Setup and configuration
81
+ - [Label Sync Guide](../../docs/ecosystem/cms/label-sync.md) - Auto-sync options
82
+ - [Advanced Features](../../docs/ecosystem/cms/advanced-features.md) - Breakpoints, value types, Draft Mode
83
+ - [Locale Management](../../docs/ecosystem/cms/locale-management.md) - 50+ languages guide
84
+ - [API Reference](../../docs/ecosystem/cms/api-reference.md) - Complete API docs
85
+ - [Draft & Versioning](../../docs/ecosystem/cms/draft-versioning.md) - Version control & audit logs
280
86
 
281
87
  ## Configuration
282
88
 
283
- ### Default Paths
284
-
285
- The default label directory path is defined as a constant:
286
-
287
- ```typescript
288
- import { DEFAULT_LABELS_DIR } from '@spfn/cms';
289
-
290
- console.log(DEFAULT_LABELS_DIR); // 'src/lib/labels'
291
- ```
292
-
293
- This constant is used throughout the CMS package and can be referenced in your code to avoid hardcoding paths.
294
-
295
- ### Environment Variables
296
-
297
- Configure CMS behavior via environment variables in `.env.local`:
298
-
299
89
  ```bash
300
- # Default locale (default: 'en')
90
+ # .env.local
301
91
  SPFN_CMS_DEFAULT_LOCALE=ko
302
-
303
- # Supported locales, comma-separated (default: 'en,ko')
304
92
  SPFN_CMS_SUPPORTED_LOCALES=en,ko,ja
305
-
306
- # Auto-detect browser language (default: true)
307
93
  SPFN_CMS_DETECT_BROWSER_LANGUAGE=true
308
94
  ```
309
95
 
310
- ### Runtime Configuration
311
-
312
- Override configuration at runtime (mainly for testing):
313
-
314
- ```typescript
315
- import { configureCms, getCmsConfig } from '@spfn/cms';
316
-
317
- // Get current configuration
318
- const config = getCmsConfig();
319
- console.log(config.defaultLocale); // 'ko'
320
- console.log(config.supportedLocales); // ['ko', 'en']
321
-
322
- // Update configuration
323
- configureCms({
324
- defaultLocale: 'en',
325
- supportedLocales: ['en', 'ko', 'ja'],
326
- detectBrowserLanguage: false
327
- });
328
- ```
329
-
330
- ## Locale Management
331
-
332
- ### Automatic Locale Detection
333
-
334
- The CMS automatically manages user locale with the following priority:
335
-
336
- 1. **Cookie** - User's explicitly selected locale (persisted)
337
- 2. **Browser Language** - Auto-detected from `Accept-Language` header (if enabled)
338
- 3. **Default Locale** - System default from environment variables
339
-
340
- ### Server Actions (`@spfn/cms/actions`)
341
-
342
- Use Server Actions for locale management in both server and client components:
343
-
344
- **Get current locale:**
345
-
346
- ```typescript
347
- // Server Component
348
- import { getLocale } from '@spfn/cms/actions';
349
-
350
- export default async function RootLayout({ children }) {
351
- const locale = await getLocale();
352
-
353
- return <html lang={locale}>{children}</html>;
354
- }
355
- ```
356
-
357
- ```typescript
358
- // Client Component
359
- 'use client';
360
- import { getLocale } from '@spfn/cms/client';
361
- import { useEffect, useState } from 'react';
362
-
363
- export default function LanguageSwitcher() {
364
- const [locale, setLocale] = useState('');
365
-
366
- useEffect(() => {
367
- getLocale().then(setLocale);
368
- }, []);
369
-
370
- return <div>Current: {locale}</div>;
371
- }
372
- ```
373
-
374
- **Change locale:**
375
-
376
- ```typescript
377
- import { setLocale } from '@spfn/cms/actions';
378
-
379
- async function changeLanguage(newLocale: string) {
380
- await setLocale(newLocale);
381
- window.location.reload(); // Reload to apply changes
382
- }
383
- ```
384
-
385
- **Get supported locales:**
96
+ ## Development Status
386
97
 
387
- ```typescript
388
- import { getLocales } from '@spfn/cms/actions';
389
-
390
- const locales = await getLocales(); // ['ko', 'en', 'ja']
391
- ```
392
-
393
- ### Auto-detect Locale in Server Components
394
-
395
- When `locale` is not specified, `getSection()` automatically uses the detected locale:
396
-
397
- ```typescript
398
- import { getSection } from '@spfn/cms/server';
399
-
400
- // Auto-detects locale from cookie β†’ browser β†’ default
401
- const { t } = await getSection('home');
402
-
403
- // Or explicitly specify locale
404
- const { t: tEn } = await getSection('home', 'en');
405
- ```
406
-
407
- ## Documentation
408
-
409
- - **[Label Auto-Sync Guide](./LABEL_SYNC_GUIDE.md)** - Detailed configuration guide
410
- - **[Examples](./examples/)** - Usage examples
411
-
412
- ## Architecture
413
-
414
- ```
415
- JSON Files (src/lib/labels/**/*.json)
416
- ↓
417
- loadLabelsFromJson()
418
- ↓
419
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
420
- β”‚ LabelSyncGenerator β”‚ ← File watcher (development)
421
- β”‚ initLabelSync() β”‚ ← Server startup
422
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
423
- ↓
424
- syncAll()
425
- ↓
426
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
427
- β”‚ PostgreSQL DB β”‚
428
- β”‚ - cms_labels β”‚
429
- β”‚ - published_cache β”‚ ⭐ Used by API
430
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
431
- ↓ HTTP API
432
- β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
433
- β”‚ Application β”‚
434
- β”‚ - getSection() β”‚
435
- β”‚ - useSection() β”‚
436
- β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜
437
- ```
438
-
439
- ## API Reference
440
-
441
- ### Common API (`@spfn/cms`)
442
-
443
- **Configuration:**
444
- - `getCmsConfig()` - Get current CMS configuration
445
- - `configureCms(config)` - Update configuration (runtime)
446
- - `resetCmsConfig()` - Reset configuration to defaults
447
-
448
- **Constants:**
449
- - `DEFAULT_LABELS_DIR` - Default label directory path (`'src/lib/labels'`)
450
- - `LOCALE_COOKIE_KEY` - Locale cookie key constant
451
- - Locale helpers: `getLocaleInfo()`, `getSupportedLocales()`, `getFlag()`, `getDialCode()`, `isRTL()`
452
-
453
- **Types:**
454
- - `SectionData`, `SectionAPI`, `CmsConfig`, `LocaleInfo`, `SupportedLocale`
455
-
456
- ### Server-side API (`@spfn/cms/server`)
457
-
458
- **Server Components:**
459
- - `getSection(section, locale?)` - Get section labels (auto-detects locale if not specified)
460
- - `getSections(sections, locale?)` - Get multiple sections (auto-detects locale if not specified)
461
-
462
- **Backend/Sync:**
463
- - `initLabelSync(options?)` - Sync labels on server startup
464
- - `syncAll(sections, options?)` - Sync all sections
465
- - `syncSection(definition, options?)` - Sync specific section
466
- - `loadLabelsFromJson(labelsDir)` - Load labels from JSON files
467
-
468
- **Repositories & Entities:**
469
- - All repository and entity exports
470
-
471
- **Codegen:**
472
- - `createLabelSyncGenerator(config?)` - Generator factory
473
- - `LabelSyncGenerator` - Generator class
474
-
475
- **Locale (Server Actions):**
476
- - `getLocale()` - Get current locale (cookie β†’ browser β†’ default)
477
- - `setLocale(locale)` - Set locale (saves to cookie)
478
- - `getLocales()` - Get supported locale list
479
- - `getLocaleWithInfo()`, `getLocalesWithInfo()`, `isValidLocale()`
480
-
481
- ### Server Actions API (`@spfn/cms/actions`)
482
-
483
- *Alias for `@spfn/cms/server` locale functions - available for both server and client components*
484
-
485
- ### Client-side API (`@spfn/cms/client`)
486
-
487
- - `useSection(section, options?)` - Section labels hook
488
- - `useSections(sections)` - Multiple sections hook
489
- - `useCmsStore()` - CMS store hook
490
- - `InitCms` - Client initialization component
491
-
492
- ### Management API (`@spfn/cms/api`)
493
-
494
- ⚠️ **Admin only** - Use with proper authentication
495
-
496
- - `cmsApi.cmsLabels.get(options?)` - List labels with filters
497
- - `cmsApi.cmsLabels.getById(options)` - Get label by ID
498
- - `cmsApi.cmsLabels.post(options)` - Create new label
499
- - `cmsApi.cmsLabels.update(options)` - Update label
500
- - `cmsApi.cmsLabels.delete(options)` - Delete label
501
- - `cmsApi.cmsLabelsByKey` - Get labels by key
502
- - `cmsApi.cmsValues` - Manage label values
503
- - `cmsApi.cmsPublishedCache.get(options)` - Get published cache
504
-
505
- ## Development Workflow
506
-
507
- 1. **Create/Edit JSON files** in `src/lib/labels/`
508
- 2. **Auto-sync happens** (if dev server is running)
509
- 3. **Labels immediately available** via `getSection()` or `useSection()`
510
-
511
- **Example:**
512
-
513
- ```bash
514
- # Terminal 1: Start dev server
515
- pnpm dev
516
-
517
- # Terminal 2: Edit label file
518
- echo '{"test": {"key": "layout.test", "defaultValue": "Test"}}' > src/lib/labels/layout/test.json
519
-
520
- # Auto-sync triggers
521
- # βœ… Label sync completed
522
- # Created: 1
523
- ```
98
+ This package is currently in alpha. APIs may change.
524
99
 
525
100
  ## License
526
101
 
@@ -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 { 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, getLocale as f, getLocaleInfo as g, getLocales as h, isRTL as i, getLocaleWithInfo as j, getLocalesWithInfo as k, setLocale as s };
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 { L as LOCALE_COOKIE_KEY, f as getLocale, h as getLocales, s as setLocale } from './actions-CwvmPG0e.js';
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/api.d.ts CHANGED
@@ -11,7 +11,7 @@ import '@sinclair/typebox';
11
11
  * Generated by @spfn/core codegen
12
12
  * DO NOT EDIT MANUALLY
13
13
  *
14
- * @generated 2025-11-01T16:47:27.111Z
14
+ * @generated 2025-11-02T11:18:13.331Z
15
15
  */
16
16
 
17
17
  type SaveValuesResponse = InferContract<typeof saveValuesContract>['response'];
@@ -64,7 +64,7 @@ declare const CmsValues: {
64
64
  * Generated by @spfn/core codegen
65
65
  * DO NOT EDIT MANUALLY
66
66
  *
67
- * @generated 2025-11-01T16:47:27.111Z
67
+ * @generated 2025-11-02T11:18:13.331Z
68
68
  */
69
69
 
70
70
  type GetPublishedCacheResponse = InferContract<typeof getPublishedCacheContract>['response'];
@@ -97,7 +97,7 @@ declare const CmsPublishedCache: {
97
97
  * Generated by @spfn/core codegen
98
98
  * DO NOT EDIT MANUALLY
99
99
  *
100
- * @generated 2025-11-01T16:47:27.110Z
100
+ * @generated 2025-11-02T11:18:13.331Z
101
101
  */
102
102
 
103
103
  type GetLabelByKeyResponse = InferContract<typeof getLabelByKeyContract>['response'];
@@ -132,7 +132,7 @@ declare const CmsLabelsByKey: {
132
132
  * Generated by @spfn/core codegen
133
133
  * DO NOT EDIT MANUALLY
134
134
  *
135
- * @generated 2025-11-01T16:47:27.109Z
135
+ * @generated 2025-11-02T11:18:13.330Z
136
136
  */
137
137
 
138
138
  type GetLabelsResponse = InferContract<typeof getLabelsContract>['response'];