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 ( ) ;上記の方法の1つが初めて呼び出されると、 ngastワークスペースの分析を実行します。
分析は現在非常に長いです。小さなプロジェクトの10秒> 10秒は、非常に大きなプロジェクトで2分を超えています。
バージョン0.4.0は、ViewEngineの上に構築されています。ここでドキュメントをご覧ください。
NGASTを使用したプロジェクト:
mit