ngast
1.0.0
이 라이브러리는 각도 프로젝트를 구문 분석하기위한 사용자 친화적 인 API를 제공합니다.
$ npm i @angular/core @angular/compiler @angular/compiler-cli ngast --save
ngast는 Ivy (ngtsc) 위에 구축되어ngcc(Runng serve,ng build또는npx ngcc)로 프로젝트를 컴파일해야합니다.
먼저 WorkspaceSymbols 를 tsconfig.json 루트에 연결해야합니다.
import { join } from 'path' ;
import { WorkspaceSymbols } from 'ngast' ;
const config = join ( process . cwd ( ) , 'tsconfig.json' ) ;
const workspace = new WorkspaceSymbols ( config ) ;거기에서 프로젝트에서 장식 된 모든 수업을 찾을 수 있습니다.
const modules = workspace . getAllModules ( ) ;
const components = workspace . getAllComponents ( ) ;
const directives = workspace . getAllDirectives ( ) ;
const injectables = workspace . getAllInjectable ( ) ;
const pipes = workspace . getAllPipes ( ) ; 위의 메소드 중 하나가 처음 이라고 불리는 ngast 작업 공간 분석을 실행합니다.
분석은 현재 매우 길다. 작은 프로젝트의 경우> 10SEC는 매우 큰 프로젝트를 위해 2 분을 넘어갈 수 있습니다.
버전 0.4.0은 ViewEngine 위에 구축되었으며 여기에서 문서를 살펴볼 수 있습니다.
NGAST를 사용하는 프로젝트 :
MIT