src/lib: 라이브러리 진입점 + 1.0.0 호환 shim

normalizeToNFC/normalizeToNFD — v1 require('@pieroot/nfd2nfc') 호환 유지.
신규 API: normalizeEntry, scan, shouldNormalize + 타입 export.
tsconfig.lib.json: declaration: true, out/lib/에 .d.ts 생성.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
2026-05-09 15:42:10 +09:00
parent 6601c40bb4
commit a24367c815
2 changed files with 23 additions and 0 deletions

9
src/lib/index.ts Normal file
View File

@@ -0,0 +1,9 @@
// 1.0.0 호환 shim — 단순 문자열 정규화
export const normalizeToNFC = (s: string): string => s.normalize('NFC');
export const normalizeToNFD = (s: string): string => s.normalize('NFD');
// 파일 시스템 API
export { normalizeEntry } from '../core/normalizer';
export { scan } from '../core/scanner';
export { shouldNormalize } from '../core/filter';
export type { RenameResult, FilterOptions, ScanEntry } from '../core/types';

14
tsconfig.lib.json Normal file
View File

@@ -0,0 +1,14 @@
{
"extends": "./tsconfig.json",
"compilerOptions": {
"module": "CommonJS",
"moduleResolution": "node",
"outDir": "out/lib",
"rootDir": "src",
"declaration": true,
"declarationMap": true,
"types": ["node"]
},
"include": ["src/lib/**/*", "src/core/**/*"],
"exclude": ["node_modules", "out", "dist", "src/core/__tests__"]
}