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

@qynpm/hooks

v0.0.2

Published

起印公共 hooks 包。

Readme

@qynpm/hooks

@qiyin 公共 hooks 的 npm 拆包目录。

当前状态

目前这个包还在迁移初期,不是把老的 @qiyin/hooks 一次性整体搬过来,而是按“先公共、再解耦、最后替换”的方式逐步迁移。

当前已经迁入的能力:

  • useCreateInstance
  • useInstanceView

当前职责

这个包主要承接适合做成 npm 公共能力的 hooks。

当前这批能力的边界是:

  • useCreateInstance
    • 负责动态创建实例
    • 支持普通挂载
    • 支持 asComponent 模式
  • useInstanceView
    • 负责渲染 useCreateInstance 创建出来的实例视图

当前联调方式

根目录 vite.config.ts 里有统一联调开关:

  • ENABLE_LOCAL_QIYIN_DEBUG = true
  • ENABLE_LOCAL_QIYIN_DEBUG = false
    • @qynpm/hooks 走包正常入口

注意:

  • 当前联调只接管 @qynpm/hooks
  • 老的 @qiyin/hooks 仍然保留原有实现
  • 不要把 @qiyin/hooks 直接整体 alias 到这个新包,否则会影响现有业务

当前使用建议

如果是新拆出来、准备发布 npm 的能力:

  • 优先从 @qynpm/hooks 增加和引用

如果是老业务还在跑的历史能力:

  • 继续走原来的 @qiyin/hooks

后续迁移原则

后面其他 hooks 迁移时,按下面的顺序处理:

  1. 先判断是不是公共能力
  2. 如果依赖业务 store / router / 页面上下文,先解耦
  3. 解耦完成后再迁到 @qynpm/hooks
  4. 验证稳定后,再逐步把业务引用切到 npm 包

当前不建议原样直接迁移的,通常是这类:

  • 强依赖 @/store
  • 强依赖具体业务模块
  • 只在单一业务场景内使用的 hooks

已迁移说明

这次迁移里:

  • @qynpm/form 内部的 useSave 已改为依赖 @qynpm/hooksuseCreateInstance
  • erp 根应用已经接入 useInstanceView,可用于验证新实例池链路

构建

npm run build