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

@nova-infra/f2c

v0.1.1

Published

Nova F2C binary CLI for Figma-to-code conversion

Downloads

201

Readme

@nova-infra/f2c

nova-f2c 是新的 F2C 迁移目标仓库,使用 Bun 作为包管理与构建工具。

当前状态:

  • 已完成仓库初始化
  • 已切换为 二进制发布导向(不再构建/发布 JS 产物)
  • 仅保留 CLI 路径:通过 Figma REST API 拉取节点 JSON,经 restapi-adapter 适配后走既有 emit;不包含 Figma 插件宿主、@figma/plugin-typings 或插件侧 exportAsync 等运行时
  • 已将 CLI / restapi-adapter / emit(codegen + platforms/html|react|react-native)/ shared 的运行时闭包内聚到 src/无二进制未使用的产物分岔层
  • 已移除仓库内 packages/* 历史库目录
  • 黄金样本回归(bun run verify:golden)已通过

默认验收准则:日常迭代不强制跑 tscbuild;主门禁为 bun run verify:golden

定位与 Agent 工作流

  • 一阶(本仓库):CLI / convertToCode 优先保证高还原度稳定、可复现的输出,作为 Agent 可读的中间产物(结构、样式、资源组织等)。
  • 二阶(业务侧):状态、数据、路由、设计体系/组件库替换等由 Agent 按任务在产物上继续改;不把业务编排塞进 F2C 生成器。
  • 节点提示Option.emitNodeAgentHints 为真时,生成片段前会写入 @f2c 注释(图层 idname、语义 kind、Figma figmaType)。convertToCode 的默认选项中一般为开启;CLI 默认关闭以锁定黄金样本,本地需要可加 --node-hints

命令

bun src/index.ts --help
bun run build:local
bun run design:bundle -- --url "https://www.figma.com/design/..."

构建策略

  • 本地二进制:bun run build:local
  • Linux x64:bun run build:linux-x64
  • Linux arm64:bun run build:linux-arm64
  • macOS arm64:bun run build:darwin-arm64

验收命令

默认顺序如下:

  1. 轻量功能检查:bun dev(或 bun src/index.ts --help
  2. 主门禁bun run verify:golden
  3. 按需:bun run verify:batch
  4. 观察门:bun run inventory:render-noisebun run inventory:relative-importsbun run metrics:render-net

发布或验证本地二进制时再使用:bun run build:local(等同 package.json 中的 build 脚本;非常规重构必跑项)。

文档

  • graphify-out/graph.html / graphify-out/graph.svggraphify 知识图谱(交互 HTML + 可嵌入的 SVG;原始数据 graph.json,审计说明 GRAPH_REPORT.md)。导出 SVG 需使用本机 graphifyy 虚拟环境(已含 matplotlib/scipy 时可用 to_svg)。语料不含 graphify-out/(见 .graphifyignore)。
  • scripts/graphify-normalize-semantic.py — 将子代理输出的「非标准」语义 JSON 归一化为 graphify build_from_json 可接受的结构(merge / check)。
  • AGENTS.md新增类型 / 平台 / CSS 策略应落在哪一层

当前已镜像到本仓库的核心源码:

  • src/cli
  • src/types
  • src/utils/logrestapi-treepluginDatatag-runtime / tag-utilscls-utilcolor-utilcss-util 等,类型以 @figma/rest-api-spec 与运行时 JSON 为准)
  • src/restapi-adapterindex.ts 对外入口;其余为 REST 适配与布局等实现)
  • src/render/emit/codegen/wiring + codegen/registry(装配)、platforms/htmlHtmlGenerator)、platforms/react/generator(Web TSX / CSS 管线)
  • src/render/shared(emit 与运行时共用的 codegen 基元)
  • src/restapi-adapter/index.tsconvertToCode / buildRenderArtifact 装配出口,直连 rest-preview