0.2.4 • Published 2 years ago
@bbros/ts.md v0.2.4
ts.md
이 라이브러리는 Typescript에서 interface와 enum 등의 타입을 자동으로 문서화 시켜주는 라이브러리입니다.
이후 Public Package로 배포할 계획을 가지고 있습니다.
Install
$npm i -g @boostbrothers/ts.md # global
or
$npm i -D @boostbrothers/ts.md # local
Usage
Global installed
$tsmd [configfile path]
or
$tsmd ./.tsmdrc.json
Local installed
$npx tsmd [configfile path]
or
$npx tsmd ./.tsmdrc.json
Config
실행 경로에 .tsmdrc.json
을 만들어주세요.
./.tsmdrc.json # 기본 경로
설정 파일에 필요 정보를 입력해주세요.
Example .tsmdrc.json
{
"path": "./src",
"include": ["**/*.interface.ts"],
"out": "./docs/schemata.md"
}
name | type | is required | default | description |
---|---|---|---|---|
path | string | ./ | 문서화를 진행할 typescript source 상대 경로 | |
extensions | string[] | undefined | undefined | 확장자 목록 | |
exclude | string[] | undefined | undefined | 문서화 제외 목록 | |
include | string[] | undefined | undefined | 문서화 포함 목록(ex. ["**/*.interface.ts"] ) | |
depth | number | undefined | undefined | 디렉토리 구조 탐색 깊이 제한 | |
out | string | undefined | ./docs/schemata.md | 문서를 내보낼 파일 위치 |
TODO
- Index(TOC)
- File 별로 출력
Features
Type Nodes
- Type Reference(kind: 174)
- Array Type Node(kind: 179)
- Tuple Type Node(kind: 180)
- Union Type Node(kind: 183)
- Intersection Type Node(kind: 184)
- Literal Type Node(kind: 192)
Tokens
- First Literal
- Numeric Literal
- String Literal
- String Keyword
- Number Keyword
- Boolean Keyword
- Null Keyword
- Unknown Keyword
- Any Keyword
Declaration
- Identifier(kind: 78)
escapedText: string
- Type Element
name?: PropertyName
questionToken?: QuestionToken
- Property Signature(kind: 163)
name: PropertyName
questionToken?: QuestionToken
type?: TypeNode
- Enum Member Declaration(kind: 292)
- Enum Declaration(kind: 256)
- Type Literal(kind: 178)
members: TypeElement[]
- Type Parameter Declaration(kind: 160)
0.2.4
2 years ago