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

generator-mico-cli

v0.2.21

Published

Yeoman generator for Mico CLI projects

Readme

Mico CLI Generator

用于搭建基于 TypeScript 的 Node.js CLI 项目的 Yeoman 生成器。

文档索引

| 文档 | 说明 | |---|---| | docs/mico-cli.md | Mico CLI 功能概述与技术方案 | | docs/micro-react-generator.md | Monorepo 项目生成器说明 | | docs/subapp-react-generator.md | React 子应用生成器说明 |

要求

  • Node >= 18
  • Yeoman CLI: npm install -g yo

安装和使用

npm install -g yo generator-mico-cli

包装器 CLI

全局安装后,mico 命令可用于委托给 Yeoman 生成器。 如果 generators/<name> 下存在本地生成器,它将作为 yo mico-cli:<name> 运行。

mico create subapp-react

等同于:

yo subapp-react

列出所有可用的生成器:

mico list

使用详细输出模式(显示文件处理过程):

mico create micro-react --verbose

预览模式(只显示将创建的文件,不实际创建):

mico create micro-react --dry-run

检查环境依赖:

mico doctor

将额外参数传递给生成器:

mico create micro-react -- --help

配置文件

可以在项目目录或用户主目录创建 .micorc.micorc.json 文件来预设默认值:

{
  "packageScope": "@my-company",
  "cdnPrefix": "portal",
  "author": "Team <[email protected]>",
  "defaultSubappName": "subapp"
}

配置查找顺序:

  1. 当前目录的 .micorc.micorc.json
  2. 用户主目录的 .micorc.micorc.json

Monorepo 项目生成器 (micro-react)

创建基于 qiankun 微前端架构的完整 Monorepo 项目:

mkdir my-project && cd my-project
mico create micro-react

生成的项目包含:

  • 主应用 (layout) - qiankun master
  • @mico-platform/ui、@mico-platform/theme
  • Turborepo + pnpm Workspace
  • Husky + Commitlint

React 子应用生成器

该生成器会复制 apps/homepage 模板为新的子应用,并替换标识字符串。 config/ 目录下的多环境配置会完整保留。

cd <monorepo-root>
mico create subapp-react

本地调试

克隆项目后,执行以下步骤进行本地开发和调试:

# 1. 安装依赖
pnpm install

# 2. 将本地包链接到全局(需要先安装 yo)
npm install -g yo
npm link

# 3. 验证链接成功
mico --version

链接成功后,mico 命令会使用本地代码,可以直接修改代码并测试:

# 测试 micro-react 生成器
mkdir test-project && cd test-project
mico create micro-react

# 测试 subapp-react 生成器(需在已有 monorepo 中执行)
mico create subapp-react

调试完成后,可以取消全局链接:

npm unlink -g generator-mico-cli

同步子应用模板

将源项目的 apps/homepage 同步到生成器模板目录:

SOURCE_PROJECT_ROOT=<source-project-root> npm run sync:subapp-react-template

也可以直接传入路径:

npm run sync:subapp-react-template -- <source-project-root>

忽略清单位于 generators/subapp-react/ignore-list.json