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/admin-framework

v1.0.1

Published

起印后台运行时基础能力包。

Readme

@qynpm/admin-framework

起印后台运行时基础能力包。

第一阶段仅提供纯逻辑能力:

  • 权限判断:hasRolehasPermissionhasAnyPermissionhasAllPermissions
  • 动作权限过滤:ActionPermissionfilterPermittedActions
  • 动作协议与解析:QyActionResolvedQyActionresolveVisibleActionsisQyActionDisabledisQyActionLoadingisQyActionDangergetQyActionButtonClass
  • 权限指令工厂:createPermissionDirectives
  • 路由守卫工厂:createPermissionGuard
  • 旧菜单协议适配:adaptLegacyRoutes
  • 导航模型:buildNavigationStateresolveAdminActivePathcollectAdminDefaultOpenKeysisAdminNavItemNavigable
  • 路由快照与标签模型:resolveAdminTabKeycreateAdminTabFromRouteisAdminTabEnabled
  • 标签控制器:createAdminTabsController,包含关闭守卫查询、刷新版本、KeepAlive 派生、恢复协议和可选持久化 adapter;clear 用于显式清空标签、运行时注册表和持久化状态
  • Shell 宿主协议:AdminShellModelAdminShellHostAdapterAdminShellModel.brand 由项目注入品牌,可选的 consoleEntry 覆盖控制台入口,显式传入 null 可隐藏入口,AdminSystemEntry.active 可选表示当前系统

包内不包含业务页面、后台布局、TagsView、请求实例或项目私有 store。消费方需要通过配置注入 token、用户信息、权限角色、路由实例和组件解析器。

导航项中的 permissions / roles 是第一阶段预留元数据,buildNavigationState 只负责 hidden 过滤和 active/open 状态计算,不自动做权限过滤。

导航、路由快照、Tabs 控制器和 Shell 宿主协议均为纯 TypeScript;Tabs 控制器不读取 Vue Router、Pinia 或浏览器存储。消费方负责把 Router 转换为 AdminRouteSnapshot,并通过 AdminTabsStorageAdapter 注入持久化实现。

v-hasPermi / v-hasRole 指令值约定为非空字符串数组,例如 v-hasPermi="['system:user:add']"

权限判断 API 的参数顺序统一为“要求在前、当前用户权限在后”。权限字符串会先 trim;空权限、空数组和纯空格不会通过判断。*:*:* 可以满足任意非空权限要求。动作未声明 permission 时允许显示,数组权限默认采用 any,permissionMode: 'all' 时要求全部满足。

@qynpm/admin-framework/actions 是动作协议的公共子入口,QyAction<TContext> 是动作协议的唯一权威定义,包含 keylabeltypepermissionpermissionModehiddendisabledloadingdangerorderonClickresolveVisibleActions 按权限、hidden、order、状态的顺序解析,并保持相同 order 的输入顺序;解析过程不修改输入数组或动作对象。动作协议与解析器是纯 TypeScript,不依赖 Vue、DOM、Element Plus、Pinia、Vue Router、API client 或业务项目私有路径。

QyTableQyListActionBarQyRowActions 应共用这套动作协议。confirmmorepopovericon 尚未进入当前协议,完整 QyTable 仍由下一阶段迁移。

本地 file: 依赖消费包入口时,需要先执行 pnpm --filter @qynpm/admin-framework build 生成 dist;消费方刷新 file 快照时使用 pnpm install --frozen-lockfile