-
Notifications
You must be signed in to change notification settings - Fork 101
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: es-hangul의 신뢰성을 나타낼 수 있는 문서를 만듭니다 (#302)
* docs: 신뢰성 문서를 작성합니다. * coverage 파일을 사용하여 동적으로 커버리지 퍼센트를 나타냅니다 * apiList 상수 이름 변경 * scripts 복구 * gitignore에 coverage 재추가 * constants 경로를 단순화합니다 * 코드를 매끄럽게 풀어나갑니다 --------- Co-authored-by: 박찬혁 <[email protected]>
- Loading branch information
Showing
17 changed files
with
204 additions
and
19 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: reliability | ||
--- | ||
|
||
import Reliability from './reliability.tsx'; | ||
|
||
# 💯 Providing High Reliability | ||
|
||
`es-hangul` has achieved <b>100% test coverage</b> by adopting a testing framework. This means that all features of the library have been thoroughly verified, minimizing unexpected errors. Built on high reliability, it offers stable and predictable performance, so you can confidently incorporate it into your projects. Experience a new standard in Hangul processing by utilizing `es-hangul` now! | ||
|
||
<br /> | ||
<br /> | ||
|
||
<Reliability locale="en" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
title: reliability | ||
--- | ||
|
||
import Reliability from './reliability.tsx'; | ||
|
||
# 💯 높은 신뢰성 제공 | ||
|
||
`es-hangul`은 테스팅 프레임워크를 도입하여 <b>테스트 커버리지 100%</b>를 달성하였습니다. 이는 라이브러리의 모든 기능이 철저하게 검증되었음을 의미하며, 예기치 않은 오류를 최소화합니다. 높은 신뢰성을 바탕으로 안정적이고 예측 가능한 성능을 제공하므로, 안심하고 프로젝트에 도입하실 수 있습니다. 지금 `es-hangul`을 활용하여 한글 처리의 새로운 기준을 경험해 보세요! | ||
|
||
<br /> | ||
<br /> | ||
|
||
<Reliability locale="ko" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,162 @@ | ||
import coverageJSON from '../../../../../coverage/coverage-summary.json'; | ||
|
||
type Locale = 'ko' | 'en'; | ||
|
||
interface TypeSupportTableProps { | ||
locale: Locale; | ||
} | ||
|
||
export default function Reliability({ locale }: TypeSupportTableProps) { | ||
const isKorean = locale === 'ko'; | ||
const statements = isKorean ? '문장' : 'Statements'; | ||
const branches = isKorean ? '브랜치' : 'Branches'; | ||
const functions = isKorean ? '함수' : 'Functions'; | ||
const lines = isKorean ? '라인' : 'Lines'; | ||
|
||
const { total: totalCoverage, ...fileEntries } = coverageJSON; | ||
|
||
const isValidFilePath = (filePath: string): boolean => { | ||
// src 뒤 2-depth까지의 경로를 필터링하며, anything.something.ts 등의 명칭을 가진 파일들은 반환되지 않도록 `.ts`로 끝나되 추가 점(`.`)이 없는 경우만 허용 | ||
const regex = /\/src\/[^/]+\/[^/]+(?<!\..+)\.ts$/; | ||
|
||
return regex.test(filePath) && !filePath.endsWith('constants.ts') && !filePath.includes('_internal'); | ||
}; | ||
|
||
const extractFileName = (filePath: string): string | undefined => { | ||
return filePath.split('/').pop()?.split('.')[0]; | ||
}; | ||
|
||
const filterValidFileEntries = (coverageFileEntries: typeof fileEntries) => { | ||
return Object.entries(coverageFileEntries) | ||
.filter(([filePath]) => isValidFilePath(filePath)) | ||
.flatMap(([filePath, info]) => { | ||
const filename = extractFileName(filePath); | ||
|
||
return filename != null ? [[filename, info] as const] : []; | ||
}); | ||
}; | ||
|
||
return ( | ||
<div> | ||
<div className="overflow-x-auto mb-10"> | ||
<table className="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400"> | ||
<caption className="caption-top text-sm"> | ||
{isKorean ? 'es-hangul의 테스트 커버리지 항목' : "es-hangul's test coverage item"} | ||
</caption> | ||
|
||
<thead className="text-xs text-gray-700 bg-gray-50 dark:bg-gray-700 dark:text-gray-400"> | ||
<tr> | ||
<th scope="col" className="px-6 py-3"> | ||
{isKorean ? '테스트 커버리지 항목' : 'Test coverage item'} | ||
</th> | ||
<th scope="col" className="px-6 py-3"> | ||
{isKorean ? '커버리지 비율' : 'Coverage percentage'} | ||
</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
<tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700"> | ||
<th scope="row" className="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white"> | ||
{statements} | ||
<br /> | ||
<span className="text-gray-500 text-xs"> | ||
ℹ️ | ||
{isKorean | ||
? '코드에서 실행 가능한 모든 문장이 테스트에서 실행되었는지' | ||
: 'Whether all executable statements in the code have been executed during testing'} | ||
</span> | ||
</th> | ||
<td className="px-6 py-4">✅ ({totalCoverage.statements.pct}%)</td> | ||
</tr> | ||
|
||
<tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700"> | ||
<th scope="row" className="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white"> | ||
{branches} | ||
<br /> | ||
<span className="text-gray-500 text-xs"> | ||
ℹ️ | ||
{isKorean | ||
? '조건문(if, else, switch 등)에서 발생하는 모든 분기 경로가 테스트되었는지' | ||
: 'Whether all branching paths in conditional statements (if, else, switch, etc.) have been tested'} | ||
</span> | ||
</th> | ||
<td className="px-6 py-4">✅ ({totalCoverage.branches.pct}%)</td> | ||
</tr> | ||
|
||
<tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700"> | ||
<th scope="row" className="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white"> | ||
{functions} | ||
<br /> | ||
<span className="text-gray-500 text-xs"> | ||
ℹ️ | ||
{isKorean | ||
? '코드 내의 모든 함수가 테스트에서 호출되었는지' | ||
: 'Whether all functions within the code have been called during testing'} | ||
</span> | ||
</th> | ||
<td className="px-6 py-4">✅ ({totalCoverage.functions.pct}%)</td> | ||
</tr> | ||
|
||
<tr className="bg-white border-b dark:bg-gray-800 dark:border-gray-700"> | ||
<th scope="row" className="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white"> | ||
{lines} | ||
<br /> | ||
<span className="text-gray-500 text-xs"> | ||
ℹ️ | ||
{isKorean | ||
? '소스 코드의 각 라인이 테스트에서 실행되었는지' | ||
: 'Whether each line of the source code has been executed during testing'} | ||
</span> | ||
</th> | ||
<td className="px-6 py-4">✅ ({totalCoverage.lines.pct}%)</td> | ||
</tr> | ||
</tbody> | ||
</table> | ||
</div> | ||
|
||
<div className="overflow-x-auto"> | ||
<table className="w-full text-sm text-left rtl:text-right text-gray-500 dark:text-gray-400"> | ||
<caption className="caption-top text-sm"> | ||
{isKorean ? 'es-hangul의 테스트 커버리지 현황' : "es-hangul's test coverage status"} | ||
</caption> | ||
|
||
<thead className="text-xs text-gray-700 bg-gray-50 dark:bg-gray-700 dark:text-gray-400"> | ||
<tr> | ||
<th scope="col" className="px-6 py-3"> | ||
API | ||
</th> | ||
<th scope="col" className="px-6 py-3"> | ||
{statements} | ||
</th> | ||
<th scope="col" className="px-6 py-3"> | ||
{branches} | ||
</th> | ||
<th scope="col" className="px-6 py-3"> | ||
{functions} | ||
</th> | ||
<th scope="col" className="px-6 py-3"> | ||
{lines} | ||
</th> | ||
</tr> | ||
</thead> | ||
|
||
<tbody> | ||
{filterValidFileEntries(fileEntries).map(([filename, info]) => ( | ||
<tr key={filename} className="bg-white border-b dark:bg-gray-800 dark:border-gray-700"> | ||
<th scope="row" className="px-6 py-4 font-medium text-gray-900 whitespace-nowrap dark:text-white"> | ||
<a href={`../api/${filename}`}>{filename} 🔗</a> | ||
</th> | ||
|
||
<td className="px-6 py-4">✅ ({info.statements.pct}%)</td> | ||
<td className="px-6 py-4">✅ ({info.branches.pct}%)</td> | ||
<td className="px-6 py-4">✅ ({info.functions.pct}%)</td> | ||
<td className="px-6 py-4">✅ ({info.lines.pct}%)</td> | ||
</tr> | ||
))} | ||
</tbody> | ||
</table> | ||
</div> | ||
</div> | ||
); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
5 changes: 2 additions & 3 deletions
5
src/standardizePronunciation/rules/transformHardConversion.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters