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 🙏

© 2025 – Pkg Stats / Ryan Hefner

@yunyuanlab/buildnotify

v1.1.0

Published

企业级构建通知系统,支持多平台推送、Web UI配置、高级模板、条件发送、监控指标等功能

Readme

@yunyuanlab/buildnotify

用于 npm 包构建通知的工具库,支持多种推送平台和灵活的配置管理。

✨ 特性

  • 🌍 多平台支持:Node.js 和浏览器环境
  • 🔄 多种推送平台:钉钉、企业微信、Telegram、邮件等
  • 📁 多种配置格式:JSON、YAML、JS
  • 🔧 灵活配置管理:基于 cosmiconfig(Node.js)或手动配置(浏览器)
  • 🚀 重试机制:自动重试和错误处理
  • 📝 消息模板:支持自定义消息模板
  • 🎯 TypeScript 支持:完整的类型定义
  • 📦 条件导出:根据环境自动选择合适版本
  • 🐛 调试模式:详细的日志输出和错误诊断
  • 智能错误处理:用户友好的错误信息和建议
  • 🔀 并发控制:智能控制消息发送速率
  • 📊 消息队列:支持优先级和延迟发送
  • 🧩 插件系统:支持中间件和扩展功能
  • 🎛️ 条件发送:基于时间、环境等条件的智能发送
  • 📈 监控指标:Prometheus 兼容的指标收集
  • 🛠️ CLI 工具:完整的命令行管理界面
  • 🎨 高级模板:20+ 内置函数的强大模板引擎

📦 安装

npm install @yunyuanlab/buildnotify

🌐 Web UI 配置界面

启动配置界面

# 启动 Web UI 服务器
npx buildnotify-ui
# 或者
npm run ui

# 然后在浏览器中打开 http://localhost:3000

功能特性

  • 🎨 可视化配置 - 直观的图形界面配置所有选项
  • 🔧 实时预览 - 配置修改后实时预览效果
  • 📱 响应式设计 - 支持桌面和移动设备
  • 💾 一键导出 - 直接生成配置文件
  • 🧪 测试功能 - 内置消息发送测试
  • 📋 配置验证 - 自动检查配置完整性

界面功能

  1. 🔌 推送平台 - 配置钉钉、企业微信、Telegram 等平台
  2. 🎨 消息模板 - 自定义消息格式和模板函数
  3. ⚙️ 条件发送 - 设置时间、环境等发送条件
  4. 📊 队列配置 - 配置并发控制和重试策略
  5. 📈 监控设置 - 配置性能监控和指标收集
  6. 👀 配置预览 - 查看和导出最终配置
  7. 🧪 测试发送 - 发送测试消息验证配置

![Web UI 截图示例]

配置流程

  1. 选择平台 - 启用需要的推送平台并填写配置
  2. 自定义模板 - 设计消息的标题和内容格式
  3. 设置条件 - 配置发送时间和环境限制
  4. 调整参数 - 设置并发数、重试次数等
  5. 测试验证 - 发送测试消息确保配置正确
  6. 导出配置 - 下载配置文件到项目目录

🛠️ CLI 工具使用

配置管理

# 初始化配置文件
npx buildnotify config init

# 使用高级模板
npx buildnotify config init --template advanced

# 验证配置文件
npx buildnotify config validate

# 测试配置连接
npx buildnotify config test

# 交互式配置向导
npx buildnotify wizard

发送消息

# 基础发送
npx buildnotify send "构建成功" "项目已成功构建并部署"

# 指定平台和优先级
npx buildnotify send "构建失败" --platforms dingtalk,telegram --priority high

# 自定义数据
npx buildnotify send "部署完成" --data '{"version":"1.0.0","env":"production"}'

队列管理

# 添加消息到队列
npx buildnotify queue add "定时消息" "这是一条定时消息" --priority high --delay 30000

# 查看队列状态
npx buildnotify queue status

监控和指标

# 查看指标摘要
npx buildnotify monitor metrics

# 导出 Prometheus 格式
npx buildnotify monitor metrics --format prometheus

# 查看健康状态
npx buildnotify monitor health

🚀 快速开始

Node.js 环境

1. 创建配置文件

在项目根目录创建 notify.config.json

{
  "platforms": [
    {
      "type": "dingtalk",
      "enabled": true,
      "config": {
        "DINGTALK_ACCESS_TOKEN": "your_access_token",
        "DINGTALK_SECRET": "your_secret"
      }
    }
  ]
}

2. 发送通知

import { notify } from '@yunyuanlab/buildnotify'

// 基础使用 - 自动加载配置文件
await notify('构建成功', '项目已成功构建并部署')

// 使用运行时配置(v0.0.3+)
await notify('构建成功', '项目已成功构建', {
  config: {
    platforms: [
      {
        type: 'dingtalk',
        enabled: true,
        config: {
          DINGTALK_ACCESS_TOKEN: 'your_token',
          DINGTALK_SECRET: 'your_secret'
        }
      }
    ]
  }
})

// 高级使用 - 运行时配置优先级高于文件配置
await notify('构建失败', '错误详情...', {
  config: {
    platforms: [
      {
        type: 'dingtalk',
        enabled: true,
        config: {
          DINGTALK_ACCESS_TOKEN: 'override_token'
        }
      }
    ]
  },
  platforms: ['dingtalk'],
  priority: 'high'
})

浏览器环境

import { createNotifyManager, notify } from '@yunyuanlab/buildnotify/browser'

// 创建配置
const config = {
  platforms: [
    {
      type: 'dingtalk',
      enabled: true,
      config: {
        DINGTALK_ACCESS_TOKEN: 'your_token',
        DINGTALK_SECRET: 'your_secret'
      }
    }
  ]
}

// 创建管理器
const manager = createNotifyManager(config)

// 发送通知
await notify('构建成功', '项目已成功构建', { manager })

📖 配置管理

配置优先级 (v0.0.3+)

配置按以下优先级合并(从高到低):

  1. 运行时配置 - 通过 notify() 函数参数传入
  2. 文件配置 - 通过配置文件加载
  3. 默认配置 - 内置默认值
// 运行时配置会覆盖文件配置
await notify('标题', '内容', {
  config: {
    platforms: [
      {
        type: 'dingtalk',
        config: {
          DINGTALK_ACCESS_TOKEN: 'runtime_token' // 覆盖文件中的配置
        }
      }
    ]
  }
})

支持的配置文件

cosmiconfig 会按顺序查找以下配置文件:

  • package.json 中的 notify 字段
  • .notifyrc
  • .notifyrc.json
  • .notifyrc.yaml / .notifyrc.yml
  • .notifyrc.js / .notifyrc.cjs / .notifyrc.mjs
  • notify.config.json
  • notify.config.yaml / notify.config.yml
  • notify.config.js / notify.config.cjs / notify.config.mjs

配置选项

interface NotifyConfig {
  platforms?: PlatformConfig[] // 推送平台配置
  defaultMessageType?: MessageType // 默认消息类型
  defaultPriority?: MessagePriority // 默认优先级
  retry?: {
    // 重试配置
    times?: number // 重试次数
    interval?: number // 重试间隔(毫秒)
  }
  templates?: {
    // 模板配置
    title?: string // 标题模板
    content?: string // 内容模板
  }
}

🔌 支持的推送平台

钉钉机器人

{
  "type": "dingtalk",
  "config": {
    "DINGTALK_ACCESS_TOKEN": "your_access_token",
    "DINGTALK_SECRET": "your_secret"
  },
  "options": {
    "msgtype": "text"
  }
}

Server酱

{
  "type": "serverChanTurbo",
  "config": {
    "SERVER_CHAN_TURBO_SENDKEY": "your_sendkey"
  }
}

企业微信应用

{
  "type": "wechatApp",
  "config": {
    "WECHAT_APP_CORPID": "your_corp_id",
    "WECHAT_APP_AGENTID": 1000001,
    "WECHAT_APP_SECRET": "your_app_secret"
  },
  "options": {
    "msgtype": "text",
    "touser": "@all"
  }
}

自定义邮件

{
  "type": "customEmail",
  "config": {
    "EMAIL_TYPE": "text",
    "EMAIL_TO_ADDRESS": "[email protected]",
    "EMAIL_AUTH_USER": "[email protected]",
    "EMAIL_AUTH_PASS": "your_password",
    "EMAIL_HOST": "smtp.example.com",
    "EMAIL_PORT": 587
  }
}

Telegram

{
  "type": "telegram",
  "config": {
    "TELEGRAM_BOT_TOKEN": "your_bot_token",
    "TELEGRAM_CHAT_ID": "your_chat_id"
  }
}

更多平台支持请参考 完整平台列表

🐛 调试和错误处理 (v0.0.4+)

启用调试模式

# 方式1:使用 DEBUG 环境变量
DEBUG=buildnotify npm run your-script

# 方式2:使用 BUILDNOTIFY_LOG_LEVEL 环境变量
BUILDNOTIFY_LOG_LEVEL=debug npm run your-script

# 日志级别:error, warn, info, debug
BUILDNOTIFY_LOG_LEVEL=info npm run your-script

错误处理

import { notify, BuildNotifyError, ConfigError } from '@yunyuanlab/buildnotify'

try {
  await notify('测试', '内容')
} catch (error) {
  if (error instanceof BuildNotifyError) {
    console.log('错误代码:', error.code)
    console.log('用户友好信息:', error.getUserMessage())
    console.log('调试信息:', error.getDebugInfo())
  }
}

配置验证

import { validateNotifyConfig } from '@yunyuanlab/buildnotify'

const result = validateNotifyConfig(config)
if (!result.valid) {
  console.log('配置错误:', result.errors)
  console.log('警告信息:', result.warnings)
}

🌍 多平台支持

环境差异

| 特性 | Node.js | 浏览器 | | ---------------- | ------- | ------ | | 配置文件自动加载 | ✅ | ❌ | | 完整推送平台支持 | ✅ | ⚠️ | | 文件系统访问 | ✅ | ❌ | | 环境变量支持 | ✅ | ❌ | | 手动配置管理 | ✅ | ✅ |

导入方式

// 自动适配(推荐)
import { notify } from '@yunyuanlab/buildnotify'

// 显式 Node.js 版本
import { notify } from '@yunyuanlab/buildnotify/node'

// 显式浏览器版本
import { notify, createNotifyManager } from '@yunyuanlab/buildnotify/browser'

构建输出

  • dist/index.node.mjs - Node.js ESM 版本
  • dist/index.node.d.mts - Node.js 类型声明
  • dist/browser/index.browser.mjs - 浏览器 ESM 版本
  • dist/browser/index.browser.d.mts - 浏览器类型声明

🎯 API 文档

notify(title, content?, options?)

快速发送通知。

// 基础使用
await notify('构建完成', '构建详情...')

// 使用选项
await notify('构建完成', '构建详情...', {
  platforms: ['dingtalk'],
  priority: 'normal'
})

// 使用运行时配置 (v0.0.3+)
await notify('构建完成', '构建详情...', {
  config: {
    platforms: [
      {
        type: 'dingtalk',
        enabled: true,
        config: {
          DINGTALK_ACCESS_TOKEN: 'your_token',
          DINGTALK_SECRET: 'your_secret'
        }
      }
    ]
  },
  platforms: ['dingtalk'],
  priority: 'high'
})

参数说明

  • title: string - 通知标题
  • content?: string - 通知内容(可选)
  • options?: SendOptions - 发送选项(可选)
    • platforms?: string[] - 指定使用的推送平台
    • messageType?: 'text' | 'markdown' - 消息类型
    • priority?: 'low' | 'normal' | 'high' - 消息优先级
    • options?: Record<string, any> - 额外的推送选项
    • skipRetry?: boolean - 是否跳过重试
    • config?: Partial<NotifyConfig> - 运行时配置 (v0.0.3+)

NotifyManager

更高级的通知管理。

import { NotifyManager } from '@yunyuanlab/buildnotify'

const manager = new NotifyManager()
await manager.init()

const result = await manager.send('标题', '内容')
console.log(result.success) // 是否成功
console.log(result.successful) // 成功的发送结果
console.log(result.failed) // 失败的发送结果

配置管理

import { loadConfig, clearConfigCache } from '@yunyuanlab/buildnotify'

// 加载配置
const config = await loadConfig()

// 清除配置缓存
clearConfigCache()

错误处理 API (v0.0.4+)

import {
  BuildNotifyError,
  ConfigError,
  PlatformError,
  validateNotifyConfig,
  logger,
  LogLevel
} from '@yunyuanlab/buildnotify'

// 错误处理
try {
  await notify('标题', '内容')
} catch (error) {
  if (error instanceof BuildNotifyError) {
    console.log('错误代码:', error.code)
    console.log('平台:', error.platform)
    console.log('字段:', error.field)
    console.log('建议:', error.suggestion)
    console.log('用户友好信息:', error.getUserMessage())
  }
}

// 配置验证
const validationResult = validateNotifyConfig(config)
if (!validationResult.valid) {
  console.log('错误:', validationResult.errors)
  console.log('警告:', validationResult.warnings)
}

// 日志控制
logger.setLevel(LogLevel.DEBUG)
logger.info('自定义日志信息')

🎨 高级消息模板

基础模板使用

支持使用模板变量:

{
  "templates": {
    "title": "🔔 {{title}}",
    "content": "📝 {{content}}\n\n⏰ 时间: {{formatDate(timestamp)}}"
  }
}

内置模板函数(20+ 函数)

import { defaultTemplateEngine } from '@yunyuanlab/buildnotify'

// 时间格式化
"构建时间: {{formatDate(timestamp, 'yyyy-MM-dd HH:mm:ss')}}"

// 持续时间格式化
"构建耗时: {{formatDuration(build.duration)}}"

// 文件大小格式化  
"包大小: {{formatSize(bundle.size)}}"

// 文本处理
"提交信息: {{truncate(git.commit.message, 50)}}"
"项目名称: {{capitalize(project.name)}}"

// 状态图标
"状态: {{statusIcon(build.status)}} {{capitalize(build.status)}}"

// 数字和百分比
"覆盖率: {{percent(stats.coverage)}}"
"测试通过: {{number(stats.testsPassed)}} / {{number(stats.testsTotal)}}"

// 条件显示
"版本: {{default(project.version, 'unknown')}}"

// Emoji 支持
"{{emoji('rocket')}} 部署成功!"

预定义模板

import { predefinedTemplates, renderTemplate } from '@yunyuanlab/buildnotify'

// 构建成功模板
const message = renderTemplate(predefinedTemplates.buildSuccess, {
  project: { name: 'MyApp' },
  git: { 
    branch: 'main', 
    commit: { message: 'Add new feature', author: 'developer' }
  },
  build: { duration: 120000, url: 'https://ci.example.com/build/123' }
})

// 测试报告模板
const report = renderTemplate(predefinedTemplates.testReport, {
  stats: {
    testsTotal: 100,
    testsPassed: 95,
    testsFailed: 5,
    coverage: 0.85
  },
  build: { status: 'success' }
})

自定义模板函数

import { AdvancedTemplateEngine } from '@yunyuanlab/buildnotify'

const engine = new AdvancedTemplateEngine()

// 注册自定义函数
engine.registerFunction('customFormat', (value, format) => {
  return `Custom: ${value} (${format})`
})

const result = engine.render('{{customFormat(data, "special")}}', {
  data: 'test value'
})

可用上下文变量

基础变量

  • {{title}} - 消息标题
  • {{content}} - 消息内容
  • {{timestamp}} - 当前时间戳

项目信息

  • {{project.name}} - 项目名称
  • {{project.version}} - 项目版本
  • {{project.description}} - 项目描述

Git 信息

  • {{git.branch}} - Git 分支
  • {{git.commit.hash}} - 提交哈希
  • {{git.commit.message}} - 提交信息
  • {{git.commit.author}} - 提交作者
  • {{git.repository}} - 仓库地址

构建信息

  • {{build.status}} - 构建状态
  • {{build.duration}} - 构建时长
  • {{build.url}} - 构建链接
  • {{build.number}} - 构建编号

环境信息

  • {{environment.name}} - 环境名称
  • {{environment.url}} - 环境链接
  • {{environment.version}} - 环境版本

统计信息

  • {{stats.testsTotal}} - 总测试数
  • {{stats.testsPassed}} - 通过测试数
  • {{stats.testsFailed}} - 失败测试数
  • {{stats.coverage}} - 代码覆盖率

🔄 重试机制

{
  "retry": {
    "times": 3, // 重试次数
    "interval": 1000 // 重试间隔(毫秒)
  }
}

🔀 并发控制和消息队列

并发控制

import { createNotifyManager, createSemaphore } from '@yunyuanlab/buildnotify'

// 创建信号量,限制并发数为 3
const semaphore = createSemaphore(3)

const manager = createNotifyManager(config)
manager.use(semaphore.createMiddleware())

// 发送消息时会自动限制并发数
await Promise.all([
  manager.send('消息1', '内容1'),
  manager.send('消息2', '内容2'),
  manager.send('消息3', '内容3'),
  // 这些消息会按并发限制排队
])

消息队列系统

import { createMessageQueue, QueuePriority } from '@yunyuanlab/buildnotify'

const manager = createNotifyManager(config)
const queue = createMessageQueue(manager)

// 添加不同优先级的消息
await queue.enqueue('紧急消息', '系统故障', null, {
  priority: QueuePriority.URGENT
})

await queue.enqueue('普通消息', '构建完成', null, {
  priority: QueuePriority.NORMAL,
  delay: 5000 // 延迟 5 秒发送
})

// 启动队列处理
queue.start()

// 查看队列状态
const status = queue.getStatus()
console.log(`待处理消息: ${status.pendingMessages}`)
console.log(`处理中消息: ${status.processingMessages}`)

🎛️ 条件发送

基于时间的条件发送

import { createConditionalSendMiddleware } from '@yunyuanlab/buildnotify'

const manager = createNotifyManager(config)

// 只在工作时间发送消息
manager.use(createConditionalSendMiddleware({
  timeRange: {
    start: '09:00',
    end: '18:00'
  },
  weekdays: [1, 2, 3, 4, 5], // 周一到周五
  onConditionFailed: 'queue' // 不满足条件时加入队列
}))

// 发送消息时会自动检查条件
await manager.send('工作时间消息', '只在工作时间发送')

基于环境的条件发送

manager.use(createConditionalSendMiddleware({
  environment: {
    environments: ['production', 'staging'],
    exclude: false // 只在生产和预发布环境发送
  },
  minPriority: 'high', // 只发送高优先级消息
  customFilter: async (context) => {
    // 自定义过滤逻辑
    return context.metadata.severity === 'critical'
  }
}))

📈 监控和指标收集

基础监控

import { globalMetricsCollector } from '@yunyuanlab/buildnotify'

// 查看指标摘要
const summary = globalMetricsCollector.getSummary()
console.log(`总消息数: ${summary.totalMessages}`)
console.log(`成功率: ${((1 - summary.errorRate) * 100).toFixed(1)}%`)
console.log(`平均响应时间: ${(summary.averageResponseTime * 1000).toFixed(1)}ms`)

// 导出 Prometheus 格式指标
const prometheusMetrics = globalMetricsCollector.exportPrometheusMetrics()
console.log(prometheusMetrics)

// 健康检查
const health = globalMetricsCollector.getHealthStatus()
if (health.status !== 'healthy') {
  console.log('系统健康状态异常:', health.checks)
}

自定义指标收集

import { MetricsCollector } from '@yunyuanlab/buildnotify'

const collector = new MetricsCollector({
  retentionMs: 24 * 60 * 60 * 1000, // 24小时
  maxEvents: 1000,
  sampleRate: 1.0
})

// 记录自定义指标
collector.incrementCounter('my_custom_messages_total', { platform: 'dingtalk' })
collector.setGauge('my_queue_length', 10)
collector.observeHistogram('my_response_time', 0.5)

// 记录事件
collector.recordEvent({
  type: 'message_sent',
  message: 'Custom event',
  platform: 'dingtalk'
})

🧩 插件系统

创建中间件

import { createNotifyManager } from '@yunyuanlab/buildnotify'

// 日志中间件
function createLoggingMiddleware() {
  return async (context, next) => {
    console.log(`发送消息: ${context.title}`)
    const startTime = Date.now()
    
    try {
      const result = await next()
      console.log(`消息发送成功,耗时: ${Date.now() - startTime}ms`)
      return result
    } catch (error) {
      console.log(`消息发送失败: ${error.message}`)
      throw error
    }
  }
}

// 重试中间件
function createRetryMiddleware(maxRetries = 3) {
  return async (context, next) => {
    let lastError
    
    for (let i = 0; i <= maxRetries; i++) {
      try {
        return await next()
      } catch (error) {
        lastError = error
        if (i < maxRetries) {
          console.log(`重试第 ${i + 1} 次...`)
          await new Promise(resolve => setTimeout(resolve, 1000 * Math.pow(2, i)))
        }
      }
    }
    
    throw lastError
  }
}

// 使用中间件
const manager = createNotifyManager(config)
manager.use(createLoggingMiddleware())
manager.use(createRetryMiddleware(3))

await manager.send('测试消息', '带中间件的消息发送')

预定义插件

import { 
  createMonitoringMiddleware,
  createConditionalSendMiddleware,
  createNotifyManager
} from '@yunyuanlab/buildnotify'

const manager = createNotifyManager(config)

// 监控中间件
manager.use(createMonitoringMiddleware())

// 条件发送中间件
manager.use(createConditionalSendMiddleware({
  timeRange: { start: '09:00', end: '18:00' }
}))

// 信号量中间件(并发控制)
const semaphore = createSemaphore(5)
manager.use(semaphore.createMiddleware())

⚡ 命令行使用

你也可以在构建脚本中直接使用:

# package.json
{
  "scripts": {
    "build": "your-build-command && npx buildnotify send 'Build Complete'",
    "deploy": "your-deploy-command && npx buildnotify send 'Deploy Success' --priority high",
    "test": "your-test-command && npx buildnotify send 'Tests Passed' --platforms dingtalk"
  }
}

📋 完整平台列表

支持的推送平台:

  • serverChanTurbo - Server酱·Turbo
  • serverChanV3 - Server酱³
  • customEmail - 自定义邮件
  • dingtalk - 钉钉机器人
  • wechatRobot - 企业微信群机器人
  • wechatApp - 企业微信应用
  • pushPlus - PushPlus
  • wxPusher - WxPusher
  • iGot - iGot
  • qmsg - Qmsg酱
  • xiZhi - 息知
  • pushDeer - PushDeer
  • discord - Discord Webhook
  • oneBot - OneBot
  • telegram - Telegram Bot
  • feishu - 飞书
  • ntfy - Ntfy

详细配置请参考 配置示例

📝 更新日志

v1.1.0 (2025-09-11)

🌐 Web UI 配置界面

  • ✨ 新增单页面 Web UI 配置管理器
  • 🎨 现代化响应式设计,支持桌面和移动设备
  • 🔧 可视化平台配置(钉钉、微信、Telegram等)
  • 📝 实时模板预览和语法提示
  • ⚙️ 图形化条件配置(时间、环境、优先级)
  • 📊 监控参数可视化调整
  • 💾 一键配置导出和导入
  • 🧪 内置消息发送测试功能

🛠️ CLI 工具增强

  • 🆕 新增 buildnotify-ui 命令启动 Web 界面
  • 📦 完整的配置向导和验证功能
  • 🎯 交互式配置生成器
  • 📈 增强的监控和健康检查命令

📚 文档和示例完善

  • 📖 新增详细使用指南 GUIDE.md
  • 🚀 高级功能演示脚本
  • 📋 完整配置示例文件
  • 💡 最佳实践和故障排查指南

🔧 技术改进

  • 新增 config-ui.html - 单页面配置界面
  • 新增 web-server.mjs - Web 服务器
  • 更新 CLI 工具支持新功能
  • 完善包管理和发布配置
  • 优化依赖项和关键词

v0.0.5 (2025-09-11)

🚀 企业级功能增强

  • ✨ 新增并发控制系统(Semaphore 模式)
  • 📊 实现优先级消息队列系统
  • 🧩 构建完整的插件系统和中间件架构
  • 🎛️ 条件发送功能(时间、环境、平台、自定义过滤器)
  • 🎨 高级模板引擎(20+ 内置函数)
  • 📈 Prometheus 兼容的监控指标收集
  • 🛠️ 完整的 CLI 工具(配置管理、队列操作、监控)
  • 🏥 健康检查和系统状态监控

🔧 技术架构

  • 新增 src/semaphore.ts - 并发控制
  • 新增 src/queue.ts - 消息队列系统
  • 新增 src/plugin.ts - 插件系统架构
  • 新增 src/conditional.ts - 条件发送管理
  • 新增 src/template.ts - 高级模板引擎
  • 新增 src/monitoring.ts - 监控指标收集
  • 新增 cli.mjs - 完整的命令行工具
  • 实现中间件链式调用机制
  • 支持插件生命周期管理

🎯 新增 API

  • createSemaphore() - 创建并发控制器
  • createMessageQueue() - 创建消息队列
  • createConditionalSendMiddleware() - 条件发送中间件
  • AdvancedTemplateEngine - 高级模板引擎类
  • MetricsCollector - 指标收集器
  • globalMetricsCollector - 全局指标实例

v0.0.4 (2025-01-09)

🐛 调试和错误处理系统

  • ✨ 新增完整的错误类型系统(ConfigErrorPlatformErrorNetworkErrorAuthError
  • 📊 实现分级日志系统(ERROR、WARN、INFO、DEBUG)
  • 🔍 支持环境变量控制调试模式(DEBUG=buildnotify
  • 💡 提供用户友好的错误信息和修复建议
  • 🛠️ 新增配置验证器,详细的平台配置检查

🔧 技术改进

  • 新增 src/errors.ts - 错误类型定义
  • 新增 src/logger.ts - 日志系统
  • 新增 src/validator.ts - 配置验证器
  • 优化 NotifyManager 集成错误处理和日志
  • 完善调试信息和错误追踪

v0.0.3 (2025-01-09)

⚡ 运行时配置支持

  • ✨ 新增运行时配置传入功能
  • 🔄 实现配置优先级:运行时配置 > 文件配置 > 默认配置
  • 🛠️ 新增配置合并机制,支持部分配置覆盖
  • 📚 扩展 SendOptions 接口,添加 config 字段
  • 🎯 保持向后兼容性,现有代码无需修改

🔧 技术改进

  • 新增 config-merger.ts 模块
  • 优化 NotifyManager.send() 方法
  • 完善平台配置合并逻辑

v0.0.2 (2025-07-09)

🌍 多平台支持

  • ✨ 新增浏览器环境支持
  • 📦 实现条件导出,根据环境自动选择合适版本
  • 🔧 创建环境特定入口文件(Node.js/浏览器/通用)
  • 📚 新增浏览器配置管理器 BrowserConfigManager
  • 🛠️ 优化构建配置,支持多目标构建

📦 构建输出

  • dist/index.node.mjs - Node.js ESM 版本
  • dist/browser/index.browser.mjs - 浏览器 ESM 版本
  • dist/common/index.mjs - 通用版本

🔧 改进

  • 更新 package.json 条件导出配置
  • 完善 TypeScript 类型声明
  • 优化文档和使用示例

v0.0.1 (2025-07-08)

🎉 初始版本

  • 基础通知功能
  • 支持多种推送平台
  • 配置文件管理
  • TypeScript 支持

🤝 贡献

欢迎提交 Issue 和 Pull Request!

📄 许可证

MIT © Yunyuan Lab