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

auto-vue-i18n-tools

v0.1.1

Published

Coding i18n build tools: snapshot pull/diff/audit + Vite plugin, shared by all hosts.

Readme

auto-vue-i18n-tools

Coding i18n 构建期工具:把 snapshot 拉取 / 对比 / 审计从宿主仓库抽出来,任何前端项目与 CI 都可直接用。

  • Manual 负责运行时拉包(/config → pack → localStorage)。
  • 本包 负责构建期:pull / diff / audit / sync + Vite 插件。
  • MCP + Api 负责控制面:写 DB、gen、分发。

安装

npm i -D auto-vue-i18n-tools

零运行时依赖;Node >= 18。

配置

在宿主根目录创建 i18n.config.json:

{
  "root": "src",
  "snapshot": "src/languages/snapshot",
  "api": "http://localhost:10000",
  "languages": ["zh-CN", "en-US"],
  "limit": 10
}
  • root:扫描 T() 的源码根目录。
  • snapshot:快照目录(zh-CN.json / en-US.json)。
  • api:Api 地址;也可用 I18N_API 环境变量或 --api 覆盖。
  • 路径相对配置文件目录;CLI 传入的 --root / --snapshot 相对当前目录。

命令

# 拉取 pack → snapshot + .version(写盘)
i18n pull --config i18n.config.json

# 只读:pack ↔ snapshot 逐键对比,不一致 exit 1
i18n diff --config i18n.config.json

# 离线:缺失 T() / 重复值 / 疑似整句 / 孤儿 key / 模板自引用率
i18n audit --config i18n.config.json

# pull + audit(先确认 MCP i18n_gen 已在同一 Api 执行)
i18n sync --config i18n.config.json

常用参数:

| 参数 | 说明 | |---|---| | --root <dir> | 覆盖源码根 | | --snapshot <dir> | 覆盖快照目录 | | --api <url> | 覆盖 Api 地址 | | --languages zh-CN,en-US | 覆盖语言列表 | | --templates <json> | 模板导出(i18n_template_list 结果),统计自引用率 | | --limit <n> | 报告条数(默认 10) | | --orphans | 展开孤儿 key | | --strict | 缺失 key 时 exit 1 | | --json | 输出 JSON 报告 |

audit 默认只报告;--strict 才失败。diff 不一致固定 exit 1。

Vite 插件

// vite.config.ts
import { i18nAudit } from 'auto-vue-i18n-tools/vite';

export default defineConfig({
  plugins: [
    i18nAudit({
      config: 'i18n.config.json',
      strict: true,   // 缺失 key 阻断构建(默认 true)
      diff: false,    // true = 额外对比 live pack(需要网络)
      log: true
    })
  ]
});

插件只在 buildStart 执行,不影响 dev server。

迁移(Workbench)

// package.json
"i18n:pull": "i18n pull --config i18n.config.json",
"i18n:diff": "i18n diff --config i18n.config.json",
"i18n:sync": "i18n sync --config i18n.config.json",
"i18n:audit": "i18n audit --config i18n.config.json"

旧 scripts/i18n-*.mjs 保留一版 wrapper;验证后删除。

发布

首次(当前 0.1.0):

npm login          # 手动登录
npm run publish:first

后续 patch:

npm run build:pub  # check → npm version patch → npm publish

预检:

npm run release:dry
  • prepublishOnly 自动跑 npm test && npm run check。
  • 包名与 auto-vue-manual / auto-vue-basic 同族,未使用 scope。

边界

  • 不在浏览器运行;不替代 Manual 的运行时拉包。
  • 不写 DB;写入 / gen 仍走 MCP + Api。
  • audit 离线;diff / pull / sync 需要 Api 可达。