npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

smartbi-ext-vue-toolkit

v1.0.1

Published

Smartbi 扩展项目脚手架与构建工具 - 支持项目初始化、构建打包、反编译等功能

Downloads

19

Readme

smartbi-ext-vue-toolkit

CI npm version [License: MIT][license-url]

Smartbi 扩展项目脚手架与构建工具 — 支持 Vue 2.x 插件开发,提供项目初始化、构建打包、反编译等一站式 CLI 工具。

安装

# 作为项目开发依赖安装
npm install -D smartbi-ext-vue-toolkit
# 或
yarn add -D smartbi-ext-vue-toolkit
# 或
bun add -D smartbi-ext-vue-toolkit

快速开始

# 1. 创建项目并安装依赖
mkdir my-project && cd my-project
npm init -y
npm install -D smartbi-ext-vue-toolkit

# 2. 在 package.json 中添加 scripts
# "scripts": {
#   "init": "smartbi-vue init",
#   "dev": "smartbi-vue dev",
#   "build": "smartbi-vue build"
# }

# 3. 初始化扩展项目结构
npm run init

# 4. 运行命令
npm run dev    # 开发模式(监听文件变化,自动构建)
npm run build  # 构建打包

命令

| 命令 | 说明 | 用法 | |------|------|------| | init | 初始化 Smartbi 扩展项目 | smartbi-vue init [output-dir] | | build | 构建扩展包 | smartbi-vue build | | dev | 开发模式(监听文件变化) | smartbi-vue dev | | extract | 解压 .ext 文件 | smartbi-vue extract | | decompile | 反编译扩展包前端 Vue + Java 代码 | smartbi-vue decompile [dir] | | decompile vue | 仅反编译前端 Vue 代码 | smartbi-vue decompile vue [dir] | | decompile java | 仅反编译 Java 代码 | smartbi-vue decompile java [dir] |

init

初始化一个新的 Smartbi 扩展项目,自动创建标准目录结构:

my-project/
└── src/
    ├── assets/
    └── plugins/
        ├── addExtenders/
        │   └── HelloView/
        │       ├── HelloView.vue
        │       └── index.js
        └── modifyExtenders/

build

构建扩展包,将 src/ 下的源码打包为 Smartbi 可识别的扩展格式,输出到 dist/ 目录。

dev

开发模式,监听 src/ 目录下的文件变化,自动重新构建。

extract

解压 .ext 文件到指定目录,方便查看扩展包内容。

decompile

交互式反编译 Smartbi 扩展包。默认同时反编译前端 Vue 代码和 Java 代码,也可通过子命令单独反编译。

通过上下箭头选择要反编译的扩展包,支持"全部"批量反编译。

用法:

# Vue + Java 同时反编译(默认)
smartbi-vue decompile ../../exts

# 清理后同时反编译
smartbi-vue decompile ../../exts -cf

# 仅反编译前端 Vue 代码
smartbi-vue decompile vue ../../exts

# 仅反编译 Java 代码
smartbi-vue decompile java ../../exts -cf

选项:

| 选项 | 说明 | |------|------| | -o, --output <dir> | 输出目录,默认为同级 exts-decompile | | -c, --clean | 反编译前先清理目标目录 | | -f, --force | 清理时跳过交互确认 |

前端反编译 使用 @jridgewell/source-map 解析 source map,支持:

  • System.register 模块解包
  • Vue SFC 组件重建(.vue 文件)
  • CSS 资源路径重写
  • 静态资源(图片、字体等)复制

Java 反编译 使用 Vineflower 引擎(与 IntelliJ IDEA 相同),支持:

  • .class → .java 反编译
  • 自动下载 Vineflower JAR(缓存到项目 vendor/ 目录)
  • 自动检测 Java 运行时环境(需 JRE 8+)
  • JAR 库文件复制
  • 资源文件(XML、properties 等)复制

输出目录结构:

exts-decompile/
├── eagle-portal-common/
│   ├── vue/                     # 前端反编译输出
│   │   ├── plugins/
│   │   │   └── addExtenders/
│   │   │       └── CommonEntry.js
│   │   └── assets/
│   └── java/                    # Java 反编译输出
│       ├── src/
│       │   └── smartbi/portal/common/
│       │       ├── PortalCommonModule.java
│       │       └── ...
│       ├── resources/
│       └── lib/                 # 原始 JAR 文件

npm scripts 示例:

{
  "scripts": {
    "decompile": "smartbi-vue decompile ../../exts",
    "decompile:clean": "smartbi-vue decompile ../../exts -cf",
    "decompile:vue": "smartbi-vue decompile vue ../../exts",
    "decompile:vue:clean": "smartbi-vue decompile vue ../../exts -cf",
    "decompile:java": "smartbi-vue decompile java ../../exts",
    "decompile:java:clean": "smartbi-vue decompile java ../../exts -cf"
  }
}

项目结构

smartbi-ext-vue-toolkit/
├── src/
│   ├── builder/          # 构建、反编译、解压等核心逻辑
│   │   ├── decompile-lib.ts    # 前端反编译(source map → Vue/JS)
│   │   ├── decompile-java.ts   # Java 反编译(Vineflower 引擎)
│   │   └── ...
│   ├── commands/         # CLI 命令实现
│   │   └── decompile.ts # 反编译命令(前端/Java 子命令)
│   └── cli.ts            # CLI 入口
├── dist/                 # 构建产物(发布到 npm)
├── tsdown.config.ts      # tsdown 构建配置
├── tsconfig.json         # TypeScript 配置
└── package.json

开发

# 克隆仓库
git clone https://github.com/StillAlexLiu/smartbi-ext-vue-toolkit.git
cd smartbi-ext-vue-toolkit

# 安装依赖
npm install

# 开发模式(监听文件变化)
npm run dev

# 构建
npm run build

# 类型检查
npm run typecheck

发布

# 更新版本号
npm version patch  # 或 minor / major

# 构建
npm run build

# 发布到 npm
npm publish

License

MIT