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

zane-ui

v0.1.4

Published

React component library

Readme

学习进度 12-02 06:28

1.创建项目 npx i create-react-app xx --template typescript

2.目录结构

3.styles 公共样式抽离

3.1 _variable.scss 中性色,系列色,字体,字体大小 等等 样式变量

3.2 normalize.css 重置浏览器默认样式

jest 通用测试工具

运行指令 npx jest jest.test.js

ceact-react-app 内置jest

一直运行指令 npx jest jest.test.js --watch

react测试工具

@testing-library/react 详情参考App.test.tsx 文件 运行:npm run test

模块打包成NPM包步骤

1.在根文件 index.tsx中,导出所有的组件实例
2.驯服tsx 将tsx转化成 --- tsconfig.build.json ---> es6 module .jsx
    > 编写tsconfig.build.json文件
    > 添加打包tsx转化命令 
    ```
    //package.json
    build-ts":"tsc -p tsconfig.build.json", 
    ```
    > 执行  npm run build-ts 
    
    ·报错1:Cannot find module '@babel/parser'
    Cannot find module '@babel/types'
    ...等,是因为ts import 文件时,相对路径和【绝对路径】 的查找方式的问题
    【解决】:在tsconfig.build.ts 中添加属性


    ·报错2:allowSyntheticDefaultImports 报错  需要在tsconfig.build.ts 的compilerOptions中引入这个属性


    > 增加对sass文件编译为css --在packmage.json中添加build-css命令

    > 安装依赖 rimraf  可以兼容windows使用rimraf dir 删除命令在打包时删除build文件夹
3.npm link本地测试打包好的组件库npm包
    · 1.在被连接的npm包文件目录下执行  npm link   
    ```
            C:\Users\创\AppData\Roaming\npm\node_modules\zane-ui -> D:\demo\zane-ui
     ```
    · 2.在使用组件库的项目目录下执行 npm link  
           ```
            D:\demo\react-demo\node_modules\zane-ui -> C:\Users\创真\AppData\Roaming\npm\node_modules\zane-ui -> D:\demo\zane-ui PS D:\demo\react-demo>
            ```

    · 3.在组件库文件的package.json 添加 配置   
         ```
            "main": "build/index.js",
            "module": "build/index.js",
            "types": "build.index.d.ts",
         ```
    ·