# @alifd/fusion-collector

> Collect info for fusion based project

Latest version **1.3.7** (published 2021-11-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install @alifd/fusion-collector
pnpm add @alifd/fusion-collector
yarn add @alifd/fusion-collector
bun add @alifd/fusion-collector
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.7 |
| Published | 2021-11-11 |
| First published | 2018-08-29 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 38.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | mark-ck, lakerswgq, no-repeat, wwsun, aboutblank, bindoon, tao1991123, vicerwang, myronliu347, jdkahn, fusion-bot, sobear, lianmin, clarkxia, quanyin, jerryyxu, yellow2dong, alvinhui, andevery, luhengchang228, yuysmile, fd.xy, rax-publisher |
| Keywords | Fusion, collector |

## Links

- npm: https://www.npmjs.com/package/@alifd/fusion-collector
- npm.io page: https://npm.io/package/@alifd/fusion-collector

## Dependencies (5)

- [ini](https://npm.io/package/ini.md) ^1.3.5
- [glob](https://npm.io/package/glob.md) ^7.1.2
- [graceful-fs](https://npm.io/package/graceful-fs.md) ^4.1.11
- [ice-npm-utils](https://npm.io/package/ice-npm-utils.md) ^3.0.0-2
- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.8.4

## Recent versions

- 1.3.7 (latest) — 2021-11-11
- 1.3.0-beta (beta) — 2020-02-26
- 1.3.6 — 2021-11-11
- 1.3.5 — 2020-06-02
- 1.3.4 — 2020-06-02
- 1.3.3 — 2020-04-07
- 1.3.2 — 2020-03-04
- 1.3.1 — 2020-03-04
- 1.3.0 — 2020-02-26
- 1.2.5 — 2019-07-29
- 1.2.4 — 2019-06-12
- 1.2.3 — 2019-06-12
- 1.2.2 — 2019-06-12
- 1.2.1 — 2019-06-03
- 1.2.0 — 2019-06-03
- … 9 more at https://npm.io/package/@alifd/fusion-collector/versions

## README

# fusion-collector

fusion project 的静态分析器, 用来提取 next 组件的使用情况

## 使用方法: 

```js
import { collectDetail } from '@alifd/fusion-collector';
collectDetail({
    rootDir: process.cwd(), // 项目根地址
    kit: 'ice-scripts', // 统计的来源
    kitVersion: '', //
    cmd_type: 'dev' // 触发环节 默认为build
});

```

## 测试

```bash
tnpm  i -g @alifd/fusion-collector

DEBUG=next:collect tnpm run compile-test
```

## 收集信息:

- package.json
- 已安装的模块版本信息
- src 下每个 js/jsx 文件的 import / require 的模块
- 对引入的 next 基本组件/业务组件/第三方模块 使用情况的分析

## 对象结构: 

```js
// 返回结构
{
    collectDetail
};

// collectDetail
{
    "project_id": "", // ssh格式的gitUrl
    "author": "游鹿", // 项目作者
    "repoName": "@alifd/fusion-collector", // 仓库名
    "gitUrl": "",
    "kit": "fie-toolkit-next",
    "kitVersion": "",
    "projectName": "", // 项目名称 来自packge.json
    "description": "", // 项目描述 来自packge.json
    "basicPackageVersion": "1.15.2",// 主体包版本
    "orignTemplate": "@alifd/fusion-design-pro", // 项目来源于哪个模版
    // 只有内网才收集
    "dependencies": {}, // {...pkg.dependencies, ...pkg.peerDependencies }, 其中@alife/next, @alifd/next, @icedesign/base的版本数据需要来源于node_modules
    "nextComponents": {}, // 基础组件的使用分类
}
```

---
_Source: https://npm.io/package/@alifd/fusion-collector · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
