0.0.5 • Published 5 months ago

@clasp/code-analysis v0.0.5

Weekly downloads
-
License
MIT
Repository
-
Last release
5 months ago

ts 分析工具

1. 安装插件

默认安装的插件 1. apiMap: 收集代码中所有使用过的 API 2. browserMap根据传入的 browserApis 收集浏览器 API- 3. methodMap从 API 中过滤出 哪些是函数 4. typeMap从 API 中过滤出 哪些是 ts 类型

2. 根据传入的配置(scanSource)获取指定 ts/tsx 文件

this.scanCode

this.scanFiles

3. 解析每一个ts文件,将其转化为AST

   const { ast, checker } = parseTs(filePath);

4. 遍历 AST 分析 import 节点

 this.findImportItems(ast, filePath);

5. 遍历 AST 分析 API 调用

 this.dealAST
0.0.5

5 months ago

0.0.4

5 months ago

0.0.4-alpha.0

5 months ago

0.0.3-alpha.0

5 months ago

0.0.2

5 months ago

0.0.1

5 months ago