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

flu-cli-core

v1.1.3

Published

Core logic for flu-cli

Downloads

287

Readme

flu-cli-core

核心逻辑库,支持 Flutter 项目全生命周期管理:代码生成、项目初始化、资源管理、构建、以及多平台应用商店上传。

🎯 核心功能

1. 项目生成与初始化 (Task Pipeline)

采用 原子化任务流水线 架构,支持 4 种模板:Lite、Modular、Clean、Native。

ProjectGenerator 作为 Orchestrator (指挥官),通过 ProjectPipeline 编排一系列 IProjectTask

ProjectGenerator
  ├─ FlutterInitTask (确保环境就绪)
  ├─ TemplateCopyTask (智能模板复制)
  ├─ VariablesReplaceTask (变量替换)
  ├─ NetworkEnrichTask (网络层注入)
  ├─ RouteMappingTask (路由自动扫描)
  ├─ HomePatchTask (首页示例注入)
  └─ CleanupTask (清理冗余)

2. 多平台应用商店上传 ✨

本模块提供了高效的应用包信息解析与处理能力。

主要功能

  • 包体解析:解析 Android (APK/AAB)、iOS (IPA) 和鸿蒙 (HAP) 的包名、版本、图标等信息。
  • 权限分析:自动扫描安装包中的敏感权限声明。
  • 构建适配:支持针对不同平台的构建参数优化。

更多详情请查阅 官方文档

3. 代码生成

支持 7 种代码生成器:

  • Page — 页面生成
  • ViewModel — 状态管理类
  • Widget — 组件
  • Component — 复用组件
  • Service — 服务层
  • Model — 数据模型
  • Module — 功能模块

4. 应用资源管理

  • App Icon — 一张图自动适配全平台(iOS、Android、Harmony)
  • 启动图 — Logo + 背景色,自动配置 flutter_native_splash

5. 构建管理

  • Android: APK / AAB 自动构建
  • iOS: IPA 自动构建

6. AI + SKILL(规则投影)

通过 .flu-cli.json(单一事实来源)投影生成多份 AI 可读规则文件,保证 AI/CLI/VSCode 产出一致:

  • .cursor/rules/flu-project.mdc
  • CLAUDE.md
  • AI_RULES.md
  • .agent/skills/<slug>/SKILL.md

💡 架构优势

  • 极简核心ProjectGenerator.ts 从 1500 行精简至 100 行
  • 高可扩展 — 新增功能只需实现 IProjectTask 并加入流水线
  • 高度解耦 — 各 Task 职责单一,互不干扰
  • 声明式 — 清晰可见每一个项目生成步骤

📦 三种使用方式

| 方式 | 工具 | 用途 | | ---------- | ------------ | ----------------- | | 命令行 | flu-cli (v2) | CI/CD、自动化发版 | | 可视化 | VSCode 插件 | IDE 内点击操作 |

🔗 相关资源

🚀 核心组件

生成器

  • ProjectGenerator — Pipeline 模式的项目实例化引擎
  • Page/ViewModel/Model Generator — 针对不同架构的代码生成
  • Service Generator — 智能服务层生成,支持网络层检测

任务体系

  • FlutterInitTask — 确保原生 Flutter 环境就绪
  • TemplateCopyTask — 智能处理模板复制与冗余清理
  • NetworkEnrichTask — 声明式注入网络层基础设施
  • RouteMappingTask — 自动扫描业务路径并注册路由表
  • HomePatchTask — 自动化首页示例入口

🛠 开发与扩展

添加新任务

  1. src/generators/tasks/ 创建实现 IProjectTask 的类
  2. ProjectGenerator.generate 中通过 .addTask() 链式调用
pipeline.addTask(new YourAwesomeTask())

📜 许可证

MIT - Copyright © 2025 火叶工作室