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

@ricenote/theme-sdk

v0.8.0

Published

RiceNote 主题 SDK:模板上下文类型、helper/filter 契约与 theme.json 校验器

Readme

@ricenote/theme-sdk —— 主题 SDK

主题作者与 Core 渲染器共享的稳定契约:模板上下文类型、helper / 过滤器契约、theme.json 校验器, 以及短代码引擎(浏览器端)。

  • 面向主题作者的完整说明:docs/theme-api/v1.md(短代码见第 15 节)
  • 模板变量与 helper 全表:docs/theme-api/v1.md 第 3、4、13 节
  • 能力边界(主题不执行服务端代码):docs/theme-api/v1.md 第 13 节末尾

两种使用形态

| 形态 | 入口 | 使用方 | | --- | --- | --- | | 浏览器脚本(零构建,IIFE) | /theme-sdk/v1/ricenote-shortcodes.js(由 Core 托管) | 主题的 assets/js/*.js,经模板 helper {{ shortcode_runtime() }} 引入 | | 源码导出(TS) | @ricenote/theme-sdk | 类型检查、过滤器实现、设置校验器(Core 使用) | | 分词器(纯函数,可在 Node 下测) | @ricenote/theme-sdk/shortcodes/tokenizer | 单测与需要复用解析规则的服务端场景 |

短代码的机制在内核、语义在主题:内核不内置任何短代码,主题用 RiceNoteShortcodes.define({ name, render }) 声明自己支持的标记与展示结构。

构建产物

pnpm --filter @ricenote/theme-sdk build

产出:

| 产物 | 说明 | | --- | --- | | dist/** | tsc 输出的契约与纯函数(Node 侧与测试消费) | | dist/browser/ricenote-shortcodes.js | 短代码引擎,IIFE 全局名 RiceNoteShortcodes;由 Core 托管、主题引入 |

浏览器产物由 vite.config.ts 构建(镜像 @ricenote/admin-sdk 的做法)。 改完记得重新构建并重启服务,否则页面仍会加载旧引擎。