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 🙏

© 2025 – Pkg Stats / Ryan Hefner

bin-design

v1.1.0

Published

- react hooks 新特性学习 demo 为组件 - 组件单元测试学习编写(jest + enzyme + storybook test addon) - typescript 语法学习

Readme

.tsx .ts 推荐使用eslint 校验

后续版本 tslint可能会被废弃 推荐使用eslint校验

参考antd一些基础组件的写法 结合ts react hooks 编写ui组件

  • react hooks 新特性学习 demo 为组件
  • 组件单元测试学习编写(jest + enzyme + storybook test addon)
  • typescript 语法学习

运行项目查看所有ui组件(开发环境)

  • yarn storybook
  • 😜bin-design

build storybook 部署到server进行线上查看

  • yarn build-storybook

1.how to build and publish npm

  • 我使用webpack 打包ts react组件(注意事项, out.libraryTarget设置为 commonjs2, externals: react)
  • 可直接跑tsc命令 或者 用babel构建(暂无设计, 后续优化)
  • 运行yarn build yarn publish (test 命令仅供单元测试学习, 不在build前跑测试)

2.build 过程踩坑记录

  • 没有正确设置libraryTarget 导致模块不具备export 导出的模块, 报错: webpack does not provide an export name
  • 主项目引用 bin-design 时报错: Hooks can only be called inside the body of a function component.

3.fix

  • 针对webpack does not provide an export name, 设置libratyTarget, 参考文章: create react component and publish npm
  • 针对Hooks can only be called inside the body of a function component 报错, 官网解释, 解决办法:issue
  • 总结:
    1.如果主项目使用自定义的webpack构建 增加
    alias: { react: path.resolve('./node_modules/react') }
    2. 使用create-react-app, 暂未找到通过的解决办法请参考issue

4. use component

  • 主项目中yarn add bin-design, use like import { Tabs, TabPane } from 'bin-design'
  • 因为使用styled-components, 不用额外引入样式文件👏