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

@datawhale/prosemirror-render

v0.0.17

Published

将 ProseMirror / Tiptap 的 JSON 文档(`PMNode`)渲染为 Vue 3 组件的只读渲染库。

Readme

@datawhale/prosemirror-render

将 ProseMirror / Tiptap 的 JSON 文档(PMNode)渲染为 Vue 3 组件的只读渲染库。

安装

npm install @datawhale/prosemirror-render

使用

import { TreeRender, Media } from "@datawhale/prosemirror-render";
<TreeRender :node="docJson" :axios="httpClient" />
  • node:ProseMirror 文档节点({ type: "doc", content: [...] })。
  • axios:满足 HTTPClientType 接口的 HTTP 客户端,仅在附件 / 视频分析等场景使用,普通文档渲染可传空实现。

本地预览 / 调试

不需要发布即可在浏览器里渲染任意本地 JSON:

npm run dev

打开终端里打印的地址后,可以:

  • 选择 JSON 文件 从磁盘选一个 .json
  • 直接把 .json 拖拽到画布上;
  • 把 JSON 文件放进 dev/samples/,会自动出现在 内置样例 下拉里(支持热更新,改文件即刷新)。

JSON 可以是裸的 doc 节点 { "type": "doc", ... },也可以是 { "doc": {...} } 包装形式,会自动识别。

相关文件:index.htmldev/main.tsdev/DevApp.vue

发布流程

发布只包含 dist(见 package.json 的 "files": ["dist"]),需要先构建。

一次性发布(推荐)

npm run release

它等价于依次执行 npm run bump + npm publish --access public(见下面拆解)。

分步执行

  1. 确保工作区干净npm version 会拒绝有未提交的已跟踪改动):

    git status        # 应为 clean,否则先 commit / stash
  2. 构建 + 升版本 + 打 tag

    npm run bump

    bump 做了三件事:

    • npm run buildvite build 打包 + vue-tsc 生成类型到 dist/
    • npm version patch:把 package.json 的版本号 +1(如 0.0.15 → 0.0.16), 并自动生成一个 commit 和 tag
      • commit message:release: v0.0.16
      • git tag:v0.0.16
    • postversion 钩子:git push --follow-tags,把这个 commit 和 tag 一起推到 GitHuborigin)。
  3. 发布到 npm

    npm publish --access public

    @datawhale 是 scoped 包,默认私有,必须带 --access public 才能公开发布。

发布前的一次性准备

  • 登录 npm,且账号有 @datawhale 组织的发布权限:

    npm whoami        # 确认已登录
    npm login         # 未登录时执行
  • GitHub 推送权限bump 会自动 git push,需保证本地在 main 分支且对 origingithub.com/GYHHAHA/prosemirror-render)有推送权限。

版本号规则

npm version patch 只递增补丁号。如需改次版本 / 主版本,手动指定:

npm run build && npm version minor -m "release: v%s"   # 0.0.x → 0.1.0
npm run build && npm version major -m "release: v%s"   # 0.x.x → 1.0.0

(可选)创建 GitHub Release

bump 只打 git tag。若想在 GitHub 上生成正式的 Release 页面,安装 gh 后:

gh release create v0.0.16 --generate-notes