@simplysm/service-server 13.0.14 → 13.0.16

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 CHANGED
@@ -51,7 +51,7 @@ pnpm add @simplysm/service-server
51
51
 
52
52
  ### Utilities
53
53
 
54
- - [`ConfigManager`](docs/server.md#configmanager) - JSON config file loading/caching/real-time monitoring (auto expiration based on LazyGcMap)
54
+ - [`getConfig`](docs/server.md#getconfig) - JSON config file loading with caching and real-time file watching (auto expiration based on LazyGcMap)
55
55
 
56
56
  ### Legacy
57
57
 
package/docs/server.md CHANGED
@@ -179,27 +179,27 @@ export const MyService = defineService("MyService", (ctx) => ({
179
179
  }
180
180
  ```
181
181
 
182
- `ConfigManager` caches config files and automatically refreshes the cache on file changes (LazyGcMap-based, auto expires after 1 hour).
182
+ Config files are cached and automatically refreshed on file changes (LazyGcMap-based, auto expires after 1 hour).
183
183
 
184
- ## ConfigManager
184
+ ## getConfig
185
185
 
186
- A static utility class that manages loading, caching, and real-time monitoring of JSON config files. Used internally by `ctx.getConfig()`.
186
+ A standalone function that loads, caches, and watches JSON config files. Used internally by `ctx.getConfig()`.
187
187
 
188
188
  ```typescript
189
- import { ConfigManager } from "@simplysm/service-server";
189
+ import { getConfig } from "@simplysm/service-server";
190
190
 
191
191
  // Returns undefined if the file does not exist
192
- const config = await ConfigManager.getConfig<MyConfig>("/path/to/.config.json");
192
+ const config = await getConfig<MyConfig>("/path/to/.config.json");
193
193
  ```
194
194
 
195
- | Method | Returns | Description |
196
- |--------|---------|------|
197
- | `ConfigManager.getConfig<T>(filePath)` | `Promise<T \| undefined>` | Load and cache a JSON config file. Returns `undefined` if file not found |
195
+ | Signature | Returns | Description |
196
+ |-----------|---------|------|
197
+ | `getConfig<T>(filePath: string)` | `Promise<T \| undefined>` | Load and cache a JSON config file. Returns `undefined` if file not found |
198
198
 
199
199
  Behavior:
200
200
  - Caches file in `LazyGcMap` on first load.
201
201
  - Registers file change watch (`FsWatcher`) to auto-refresh cache on changes.
202
- - Cache auto-expires after 1 hour of no access, and associated watch is released.
202
+ - Cache auto-expires after 1 hour of no access, and associated watcher is released.
203
203
  - GC runs every 10 minutes to check for expired entries.
204
204
 
205
205
  ## Server Route Structure
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@simplysm/service-server",
3
3
  "sideEffects": false,
4
- "version": "13.0.14",
4
+ "version": "13.0.16",
5
5
  "description": "심플리즘 패키지 - 서비스 모듈 (server)",
6
6
  "author": "김석래",
7
7
  "repository": {
@@ -34,11 +34,11 @@
34
34
  "semver": "^7.7.4",
35
35
  "utf-8-validate": "^6.0.6",
36
36
  "ws": "^8.19.0",
37
- "@simplysm/core-common": "13.0.14",
38
- "@simplysm/core-node": "13.0.14",
39
- "@simplysm/orm-common": "13.0.14",
40
- "@simplysm/orm-node": "13.0.14",
41
- "@simplysm/service-common": "13.0.14"
37
+ "@simplysm/core-common": "13.0.16",
38
+ "@simplysm/core-node": "13.0.16",
39
+ "@simplysm/orm-common": "13.0.16",
40
+ "@simplysm/orm-node": "13.0.16",
41
+ "@simplysm/service-common": "13.0.16"
42
42
  },
43
43
  "devDependencies": {
44
44
  "@types/semver": "^7.7.1",