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

neo-bi-cmps

v1.0.7

Published

neo BI 自定义组件(react&ts技术栈)

Readme

目录说明

  • src: 自定义组件源码;
  • src/assets: 存放组件静态资源,比如 css、img等;
  • src/components: 存放自定义组件代码,每个自定义组件以自身名称(cmpType 数值)作为目录进行存放;
  • src/components/xxCmp/index: 自定义组件的内容文件;
  • src/components/xxCmp/model: 自定义组件的模型文件,用于对接页面设计器;
  • neo.config.js: neo-cmp-cli 配置文件。

组件开发规范

  • 存放在 src/components 目录下的自定义组件,默认 index 为自定义组件源码入口文件,model.[tj]s 为自定义组件的模型文件(对接页面设计器需要);
  • 当 neo.config.js 中的 entry 为空或者不存在时,cli 将根据 src/components 目录下的自定义组件结构生成对应的 entry 配置(可在命令控制台查看生成的 entry 配置);
  • 自定义组件中可用的配置项类型 请见 当前可用表单项
  • 自定义组件最外层请设置一个唯一的 ClassName(比如 xx-cmpType-container),所有内容样式请放在该 ClassName 中,避免自定义组件样式相互干扰;
  • 默认开启代码规范检测(含样式内容),如需关闭,请调整 neo.config.js 相关配置;
  • 请使用 react 16 版本;
  • 支持在自定义组件中使用 Open API,详细见使用说明

自定义组件注册器使用说明

  • neo-register 使用说明 备注:预览、调试(linkDebug)和构建发布时 cli 会自动创建对应的注册文件(含 neo-register 的使用),用户无需关注 neo-register。

开发说明

  1. 安装依赖
$ npm i 或者 yarn
  1. linkDebug: 外链调试(在线上页面设计器端预览自定义组件)

linkDebug模式:用于在线上页面设计器中预览和调试自定义组件。

$ npm run linkDebug
  1. 发布到 NeoCRM 平台

需要确保 package.json 中的 name 值唯一,version 值不重复。

$ npm run pushCmp

OAuth2 登录授权

使用 neo push cmpneo pull cmpneo delete cmp 等命令与 NeoCRM 平台交互时,需要进行授权登录。

使用步骤

  1. 登录 NeoCRM 平台

    neo login

    执行流程:

    • 自动打开浏览器访问授权页面
    • 在浏览器中输入 NeoCRM 账号密码进行登录(需选择对应的租户)
    • 授权成功后自动跳转回本地(附带 code)
    • cli 端 通过 code 获取 Token,并自动保存到项目的 .neo-cli/token.json 文件中
  2. 登出 NeoCRM 平台

    neo logout

    功能:清除本地保存的 token 文件,下次使用需要重新登录。

neo login 选择「自定义环境」时的授权配置示例

// neo.config.js
module.exports = {
  neoConfig: {
    neoBaseURL: 'https://crm-cd.xiaoshouyi.com', // 平台根地址(默认:https://crm.xiaoshouyi.com)
    // 登录授权 URL(用于获取 code)
    loginURL: 'https://login-cd.xiaoshouyi.com/auc/oauth2/auth',
    tokenAPI: 'https://login-cd.xiaoshouyi.com/auc/oauth2/token', // Token 获取接口地址
  },
}

Token 有效期

  • access_token:默认有效期 2 小时
  • refresh_token:默认有效期 30 天
  • 系统会在 access_token 过期前 5 分钟自动刷新
  • 如果 refresh_token 也过期,需要重新执行 neo login

常见问题

Q1: 浏览器无法自动打开怎么办?
A: 命令行会输出授权 URL,手动复制到浏览器中打开即可。

Q2: Token 刷新失败怎么办?
A: 如果 refresh_token 也过期(默认 30 天),需要重新执行 neo login。同时检查网络连接是否正常。

Q3: 授权登录后没有正常跳回 redirect_uri
A: 可能被浏览器安装的插件影响,目前已知会影响授权登录的浏览器插件有:Neo UI Extension,请关闭插件后重试。


配置项说明(neo-cmp-cli)

请查看neo-cmp-cli