Introducing The Sweep: OX’s New Live Security Research Series
Register Now
Breaking: The 2026 Vulnpocalypse Hits PHP: Four Critical RCEs, but How Dangerous Are They?
Read the Report
Are you exposed? Connect your apps in minutes.
Scan your apps free

@xrubik/fabric-to-leafer-cli

Latest version: v1.1.0

Overview

Last scanned
27 Nov 2026
Published
17 Nov 2026
npm package Publisher: haoyue
2 Versions
244 Downloads

Scan summary

@xrubik/fabric-to-leafer-cli was last scanned on 27 Nov 2026 at version 1.1.0. Risk score 0 of 100. No malicious behavior was detected.

  • Releases: 2 versions, all published on 17 Nov 2026.
  • Findings: No rules fired in version 1.1.0.
  • Downloads: 244 downloads.

Versions

2 versions published
Versions and the rules that fired in each
VersionPublishedStatus
1.1.0 LATEST 17 Nov 2026 No rules fired
0.0.0-stage 17 Nov 2026 Not shown

No rules fired in 1.1.0

Findings

Findings for v1.1.0. The score is a capped sum of the weights of the rules that fired — not CVSS, not exploitability, and not a probability. It is not comparable across packages with different scan coverage.

The score describes 1.1.0; other versions have their own rules, not their own score.

README

The publisher’s own README, as collected from the registry.

@xrubik/fabric-to-leafer-cli

批量把 Fabric JSON 转成 Leafer JSON,并支持把静态层烘焙成 PNG 背景,供其他程序直接调用。

安装/构建

pnpm --filter @xrubik/fabric-to-leafer-cli build

依赖 Node 18+。静态图渲染使用 @leafer-ui/node + @napi-rs/canvas,不需要浏览器。

CLI

# 普通转换:文件或文件夹都行
fabric2leafer convert ./fabric ./leafer

# 烘焙模式:输出 Leafer JSON + static/*.png
fabric2leafer bake ./fabric ./leafer --pixel-ratio 2

参数:

参数 说明 默认
<input> Fabric JSON 文件,或包含 JSON 的文件夹(递归) 必填
<output> 输出文件或文件夹 文件夹:<input>-leafer / <input>-bake;单文件:同级 leafer/ / leafer-bake/
--static-dir bake 模式静态背景目录 static
--pixel-ratio 背景图缩放 1
--asset-root 本地图片根目录 输入所在目录
--concurrency 批量并发数 4
--no-overwrite 输出已存在时跳过 覆盖
--strict 严格按层切:首个动态图元上方的静态图元全部保留 默认重叠检测:不覆盖保留层的静态图元尽量烘焙

输出示例:

leafer/
├── page.json
└── static/
    └── page.png

page.json 的 header.backgroundImage 指向 static/page.png。这个路径和平台现有的 image/static/xxx.png 约定一致。

烘焙规则

  1. 动态元素一定保留在 Leafer 文件里:bar / button / image / gif / chart / component / lib 等业务图元,文本里的 {参数} 占位符,dyn 有有效配置,action / ctxmenu 非空,script 非空,或组内有动态后代。
  2. 默认从下往上做重叠检测:动态图元保留;静态图元只有和已保留的下层图元有包围盒覆盖时才保留,其余烘焙。这样能分离出夹在动态图元上方但完全错开的静态元素。
  3. 组作为一个整体判断。组内有动态元素时整组保留,避免拆组破坏变换、裁剪和组内层级;静态组按整体包围盒参与重叠检测,不会把组内静态子元素单独拆出去烘焙。
  4. 如果希望绝对保守,可以加 --strict:第一个动态图元及其上方的所有图元都保留。动态元素运行态移动/变大后,重叠检测模式可能让原本不重叠的背景元素被动态元素盖住,需要按页面实际情况选择。
  5. 原始页面背景颜色、原始背景图会先画进静态 PNG,再画需要烘焙的静态图元;动态元素和保留的上层静态元素不进入 PNG。

程序调用

const { convertPath } = require('@xrubik/fabric-to-leafer-cli')

const result = await convertPath('./fabric', './leafer', {
  mode: 'bake',       // 'convert' | 'bake'
  staticDir: 'static',
  pixelRatio: 2,
  concurrency: 4,
  // 可选:退回严格的“首个动态图元以上全部保留”
  // strict: true
})

console.log(result.outputs, result.errors)

单文件:

await convertPath('./page.json', './out/page.json', { mode: 'bake' })

返回值 outputs 中每一项包含:

  • inputFile / outputFile
  • kept / baked(bake 模式)
  • staticImage(bake 模式)
  • warnings(Fabric 转换器的告警)

注意

  • 动态判断以转换后的 Leafer JSON 为准,dyn 中的空配置(如 { exprs: null })不会误判为动态。
  • 图片地址会保留原值写入 Leafer JSON;烘焙时会按 <input 所在目录>/<url>、<asset-root>/<url> 找本地文件。远程图片地址会直接交给 Node 渲染器加载。
  • 字体由运行机器提供,缺少字体会回退。
  • --no-overwrite 只检查最终 JSON 是否存在;需要重新生成背景图时请先删除旧输出。

OX Radar and Response Center

Find threats in your stack.

OX Radar can check high-priority threats, like critical package CVEs, against your context.

Each incident is marked Detected or Not Detected with a remediation plan and proof all tracked in the Response Center.

Where it’s listed

The probe returned only these fields for this server — auth requirement, protocol and tool list weren’t observed, so they’re not shown (never guessed).

  • npm @xrubik/fabric-to-leafer-cli

References

The publisher’s own links, as the registry reports them. These are not sources for the assessment on this page.

Powered by Read the latest findings

Scan your whole stack

Group 1261154050 1
Group 1261154050
 

From OX Research Newsroom

Cry2Wolf: How to Tell a Real Bug from a Nothingburger
AI & VibeSec

Cry2Wolf: Not Every Branded Bug Deserves a Fire Drill

Vulnerability Insights

OpenSSH Password Authentication Bypass on Alpine Linux (*sshole) – CVE-2026-123158

Copy of Template Design OX Blog (2)
Research

NGINX2Root: Five Critical NGINX Flaws Expose Web Servers to Remote Code Execution

Frame 2085668439 (1)
Group 1261154229