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 🙏

© 2024 – Pkg Stats / Ryan Hefner

@cindydove/react_dx_ui

v1.0.11-beta.master.0

Published

A react UI

Downloads

48

Readme

React 组件库搭建指南

参考资料推荐: https://github.com/worldzhao/blog/issues

🚀 在线预览

本地预览

git clone [email protected]:cindydove/React_DX_UI.git
cd React_DX_UI
npm run start

按顺序执行完命令后,即可在 localhost:3000 端口看到以下内容:

preview

开发教程

##package.json文件标注


{
  "name": "@cindydove/react_dx_ui",
  "version": "1.0.9",
  "description": "A react UI",
  "module": "esm/index.js",   //指定 es6模块的入口文件
  "main": "lib/index.js",  //指定 CommonJs模块的入口文件
  "homepage": "https://github.com/cindydove/React_DX_UI.git#readme",
  "authors": {
    "name": "cindydove",
    "email": "[email protected]"
  },
  "repository": {
    "type": "git",
    "url": "git+https://github.com/cindydove/React_DX_UI.git"
  },
  "typings": "lib/index.d.ts", // 定义类型入口文件
  "publishConfig": {
    "access": "public",
    "registry": "https://registry.npmjs.org/"
  },
  "files": [
    "lib",
    "esm"
  ],
  "scripts": {
    "commit": "git-cz",
    "dev": "dumi dev",
    "start": "npm run dev",
    "build:site": "rimraf doc-site && dumi build",
    "preview:site": "cross-env SITE_BUILD_ENV=PREVIEW npm run build:site && serve doc-site",
    "deploy:site": "npm run build:site && gh-pages -d doc-site",
    "build:types": "tsc -p tsconfig.build.json && cpr lib esm", // 执行tsc命令生成类型声明文件    此处使用cpr将lib的声明文件拷贝了一份,并将文件夹重命名为esm,用于后面存放 ES module 形式的组件。这样做的原因是保证用户手动按需引入组件时依旧可以获取自动提示。
    "clean": "rimraf lib esm dist",
    "build": "npm run clean && npm run build:types && gulp",
    "test": "jest",
    "test:watch": "jest --watch",
    "test:coverage": "jest --coverage",
    "test:update": "jest --updateSnapshot",
    "release": "npm run build && np --no-cleanup --no-tests --any-branch",  //打包并发布最新包
    "new": "plop --plopfile ./scripts/plopfile.mjs"  // 新建文件
  },
  "keywords": [],
  "author": "",
  "license": "ISC",
  "lint-staged": {
    "src/**/*.ts?(x)": [
      "prettier --write",
      "eslint --fix",
      "jest --bail --findRelatedTests",
      "git add"
    ],
    "src/**/*.less": [
      "stylelint --syntax less --fix",
      "git add"
    ]
  },
  "husky": {
    "hooks": {
      "commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
      "pre-commit": "lint-staged"
    }
  },
  "config": {
    "commitizen": {
      "path": "cz-conventional-changelog"
    }
  },
  "peerDependencies": {
    "react": ">=16.8.0",
    "react-dom": ">=16.8.0"
  },
  "devDependencies": {
    "@babel/core": "^7.16.7",
    "@babel/plugin-proposal-class-properties": "^7.16.7",
    "@babel/plugin-transform-runtime": "^7.16.7",
    "@babel/preset-env": "^7.16.7",
    "@babel/preset-react": "^7.16.7",
    "@babel/preset-typescript": "^7.16.7",
    "@commitlint/cli": "^16.0.1",
    "@commitlint/config-conventional": "^16.0.0",
    "@testing-library/jest-dom": "^5.16.1",
    "@testing-library/react": "^12.1.2",
    "@types/jest": "^27.4.0",
    "@types/react": "^17.0.38",
    "@types/react-dom": "^17.0.11",
    "@types/testing-library__react": "^10.2.0",
    "@umijs/fabric": "^2.10.0",
    "commitizen": "^4.2.4",
    "cpr": "^3.0.1",
    "cross-env": "^7.0.3",
    "cz-conventional-changelog": "^3.3.0",
    "dumi": "^1.1.38",
    "gh-pages": "^3.2.3",
    "gulp": "^4.0.2",
    "gulp-autoprefixer": "^8.0.0",
    "gulp-babel": "^8.0.0",
    "gulp-cssnano": "^2.1.3",
    "gulp-less": "^5.0.0",
    "husky": "^7.0.4",
    "identity-obj-proxy": "^3.0.0",
    "jest": "^27.4.7",
    "lint-staged": "^12.1.5",
    "np": "^7.6.0",
    "plop": "^3.0.5",
    "prettier": "^2.5.1",
    "react": "^17.0.2",
    "react-dom": "^17.0.2",
    "serve": "^13.0.2",
    "through2": "^4.0.2",
    "ts-jest": "^27.1.2",
    "ts-node": "^8.10.1",
    "typescript": "^4.5.4"
  },
  "dependencies": {
    "@babel/runtime": "^7.16.7",
    "antd": "^4.18.3",
    "prop-types": "^15.8.1"
  }
}

tsconfig.build.json

{
  "extends": "./tsconfig.json",
  "compilerOptions": { "emitDeclarationOnly": true }, // 只生成声明文件
  "exclude": ["**/__tests__/**", "**/demo/**", "node_modules", "lib", "esm"] // 排除示例、测试以及打包好的文件夹
}