
Security News
/Research
Fake Corepack Site Distributes Infostealer and Proxyware to Developers
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.
@sunmi/m-receipt
Advanced tools
维护负责人:胡云波 Allen Hu
商米餐饮模版的小票/票据模板资产包(@sunmi/m-receipt),以纯 JSON schema 的形式沉淀各类票据的版式、字段、多语言文案与示例数据。本包不含运行时逻辑,仅作为模板数据源被渲染与打印链路消费。
职责
边界(不负责)
@sunmi/max-receipt-viewer 将 schema 渲染为画布/预览。@sunmi/max-print / @sunmi/max-print-bus 处理。| 模块 | 关系 |
|---|---|
@sunmi/max-receipt-viewer | 消费本包 schema,渲染票据预览/编辑画布 |
@sunmi/max-print | 将渲染结果转换为打印指令并输出到打印机 |
@sunmi/max-print-bus | 打印任务调度/总线,衔接业务侧打印请求与 max-print |
| 各业务模块(m-checkout 等) | 运行时按 bizKey 选取对应模板,并填充占位符数据后触发打印 |
默认以 templates/ 内的 schema 集合作为初始模板:
templates
├─ kiosk
│ └─ kioskPickUp.json # 自助取餐小票
├─ labels
│ └─ labelProductionOrder.json # 标签制作单
└─ tickets
├─ bill.json # 结账单
├─ cancellation.json # 订单取消单
├─ customerView.json # 客看单
├─ dailySettlement.json # 日结单
├─ preliminary.json # 预结单
├─ productionOrder.json # 制作单
├─ takeoutOrder.json # 外卖单
├─ topup.json # 储值小票
├─ transferTable.json # 转台单
├─ turnover.json # 交接班小票
└─ voidOrder.json # 退餐单
若某地区模板定制项较多,可在默认集合基础上复制新模板目录,以 templates_【语言标】 命名,作为该地区专属的票据模板。例如:templates_th(泰国)。运行时优先匹配地区目录,未命中则回退到默认 templates/。
每个票据 JSON 是一份自描述模板,核心字段如下:
| 字段 | 说明 |
|---|---|
id | 模板唯一标识 |
name | 模板名称的多语言映射(zh / en / id / es 等) |
version | 模板版本号 |
schemaVersion | schema 结构版本,用于渲染端兼容判断 |
bizKey | 业务标识(如 bill),业务侧据此选取模板 |
list | 模板实际渲染的组件有序列表(页面真实版式) |
types | 可配置组件目录——编辑器中可增删的组件项,按 groups 分组 |
template | 各组件的模板原型,types / list 通过 typeId 引用 |
groups | 编辑器分组(基础信息 / 菜品 / 费用 / 支付 / 会员 / 页脚等) |
data | 预览用的示例数据,用于占位符回填演示 |
lang | 各语言(zh-CN / en-US / th / my / id / it / es)的文案字典 |
defaultLang | 默认语言 |
supported | 支持的纸张宽度(80 / 58,单位 mm) |
模板文本通过 {{...}} 占位符表达动态内容:
{{key|l}} —— 从 lang 字典按当前语言取多语言文案(如 {{ticketName|l}})。{{field}} —— 运行时由业务数据回填的动态字段(如 {{tableName}}、{{orderId}})。list / template 中常见的组件 type:
config —— 全局渲染配置(如整行铺满、行号显示)。text —— 文本行(含字号 size、对齐 align、加粗 bold)。image —— 图片(如门店 logo、自定义图片)。divider —— 分割线。column —— 多列表格(菜品明细、费用明细、支付明细等),通过 dataKey 绑定 data 中的数组。hideFields 用于声明:当某数据字段为空时隐藏该组件。
本目录配有 .prettierrc,对 JSON 采用 2 空格缩进并强制数组/对象每元素独占一行(JSON.stringify(obj, null, 2) 风格)。修改模板后建议执行:
pnpm prettier --write "templates/**/*.json"
FAQs
商米餐饮收据 / 票据模版资产(templates)
We found that @sunmi/m-receipt demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
/Research
A fake corepack.org site is impersonating the Node.js tool and delivers an infostealer and proxyware to developers who download it.

Research
/Security News
A large-scale campaign abused GitHub Actions in compromised repositories to exploit CVE-2026-41940 in cPanel and WHM and steal server credentials.

Security News
Five frontier LLMs generated the same nonexistent package names, leaving 53 available for potential slopsquatting across PyPI and npm.