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

@garming21/jm-plus

v1.0.2

Published

JM Plus 组件库 - 基于 Vue 3 + Element Plus 的组件库

Readme

JM Plus 组件库

项目结构

jm-plus/
├── packages/
│   ├── components/          # 组件源码
│   │   └── button/          # Button 组件
│   ├── theme-chalk/         # 样式主题包
│   │   ├── src/             # SCSS 源文件
│   │   └── mixins/          # SCSS 混入
│   └── jm-plus/             # 主入口包
├── src/                     # 示例应用
├── package.json
├── pnpm-workspace.yaml      # Monorepo 配置
└── vite.config.ts

快速开始

1. 安装依赖

cd jm-plus
pnpm install

2. 运行示例

pnpm dev

3. 构建组件库

pnpm build

组件使用

全局注册

import { createApp } from 'vue'
import ElementPlus from 'element-plus'
import 'element-plus/dist/index.css'
// 注意:发布后包名会是 @你的用户名/jm-plus
import JmPlus from '@你的用户名/jm-plus'

const app = createApp(App)
app.use(ElementPlus)
app.use(JmPlus)
app.mount('#app')

按需引入

<script setup lang="ts">
// 注意:发布后包名会是 @你的用户名/jm-plus
import { JmButton } from '@你的用户名/jm-plus'
</script>

<template>
  <JmButton type="primary">按钮</JmButton>
</template>

组件特性

JmButton 组件

  • 基于 Element Plus Button 封装
  • 支持防抖功能(debounce)
  • 可自定义防抖时间(debounceTime)
  • 继承所有 Element Plus Button 的属性

扩展组件

要添加新组件,只需:

  1. packages/components/ 下创建新组件目录
  2. 实现组件代码
  3. packages/components/index.ts 中导出
  4. packages/jm-plus/component.ts 中注册

已完成

样式系统:已创建 packages/theme-chalk 包,支持 SCSS 样式管理
构建系统:已配置完整的 Rollup + ESBuild 构建流程,支持:

  • 全量构建(UMD + ESM 格式)
  • 按需加载模块构建(ESM + CJS 格式)
  • TypeScript 类型定义生成
  • 样式文件构建和压缩
  • 自动版本号更新
    单元测试:已集成 Vitest 测试框架,支持:
  • 组件单元测试
  • 代码覆盖率报告
  • 测试 UI 界面
  • 自动化测试流程
    文档站点:已使用 VitePress 搭建文档站点,支持:
  • 组件文档展示
  • 在线示例演示
  • 代码高亮
  • 响应式设计

构建说明

构建命令

# 完整构建(清理 + 样式 + 主包)
pnpm build

# 仅构建样式
pnpm build:theme

# 仅构建主包
pnpm build:main

# 清理构建产物
pnpm clean

构建产物

构建完成后,产物位于 dist/jm-plus/ 目录:

dist/jm-plus/
├── es/              # ESM 格式(按需加载)
├── lib/             # CJS 格式(按需加载)
├── index.js         # UMD 格式(全量)
├── index.mjs        # ESM 格式(全量)
├── index.min.js     # UMD 格式(压缩)
├── index.min.mjs    # ESM 格式(压缩)
├── package.json     # 包配置
└── README.md        # 说明文档

测试

运行测试

# 运行测试(监听模式)
pnpm test

# 运行测试(单次)
pnpm test:run

# 运行测试并生成覆盖率报告
pnpm test:coverage

# 打开测试 UI 界面
pnpm test:ui

测试覆盖率

测试覆盖率阈值设置为 60%,包括:

  • 行覆盖率(lines)
  • 函数覆盖率(functions)
  • 分支覆盖率(branches)
  • 语句覆盖率(statements)

覆盖率报告会生成在 coverage/ 目录下。

文档站点

本地开发

# 进入文档目录
cd docs

# 安装依赖(如果还没安装)
pnpm install

# 启动开发服务器
pnpm dev

文档站点将在 http://localhost:5173 启动。

构建文档

# 构建文档站点
cd docs
pnpm build

# 预览构建结果
pnpm preview

构建产物会生成在 docs/.vitepress/dist 目录。

下一步

  • 添加更多组件
  • 配置自动导入解析器