GithubHelp home page GithubHelp logo

worldzhao / react-ui-library-tutorial Goto Github PK

View Code? Open in Web Editor NEW
476.0 6.0 116.0 3.33 MB

📚React组件库搭建指南

Home Page: https://worldzhao.github.io/react-ui-library-tutorial/

JavaScript 40.43% TypeScript 45.01% Less 1.17% Handlebars 12.14% Shell 1.25%
react react-components react-tutorial tutorial-demos frontend web tutorial

react-ui-library-tutorial's Introduction

React 组件库搭建指南

🚀 在线预览

🚆 本地预览

git clone [email protected]:worldzhao/react-ui-library-tutorial.git
cd react-ui-library-tutorial
pnpm install
pnpm start

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

preview

概览

本系列文章主要包含以下内容:

  • 项目初始化: 组件库前期开发准备工作。eslint/commit lint/typescript等等;
  • 开发阶段: 使用 dumi 进行开发调试以及文档编写;
  • 打包阶段: 输出~~umd~~/cjs/esm产物并支持按需加载;
  • 组件测试: 使用@testing-library/react及其相关生态进行组件测试;
  • 发布 npm: 编写脚本完成发布或直接使用 np 发布;
  • 部署文档站点: 使用 Github Pages 以及 Github Actions 完成文档站点自动部署。

react-ui-library-tutorial's People

Contributors

dependabot[bot] avatar worldzhao avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

react-ui-library-tutorial's Issues

你好

好巧,我也想弄一个这样的组件库

ERROR #98123 WEBPACK

ERROR #98123 WEBPACK

Generating development JavaScript bundle failed

Unexpected token (17:40)

File: ../node_modules/_gatsby-theme-docz@2.3.1@gatsby-theme-docz/src/base/Layout.js:17:40

failed Building development bundle - 7.341s

git clone 后npm i 启动项目报错

有两个问题想请教

1.在doc的mdx中这样引入css

import './style'

在开发环境中,样式可以用,但在build之后,部署到github,样式会没得到引用。

2.关于icon组件,使用svg-sprite-loader方式,在gatsby-config文件写入gatsby-plugin-svg-sprite,同样,在本地开发环境起作用,但是在build之后,并不会好用。

请问,这两个问题能帮忙分析下是为什么吗?

jest配置错误

➜  react-ui-library-tutorial git:(master) yarn jest                  
yarn run v1.22.15
$ /Users/chenyulun390/github/react-ui-library-tutorial/node_modules/.bin/jest
No tests found, exiting with code 1
Run with `--passWithNoTests` to exit with code 0
No files found in /Users/myusername/github/react-ui-library-tutorial.
Make sure Jest's configuration does not exclude this directory.
To set up Jest, make sure a package.json file exists.
Jest Documentation: facebook.github.io/jest/docs/configuration.html

jest.config.js根目录下面没有components目录

module.exports = {
  verbose: true,
-   roots: ['<rootDir>/components'],
+  roots: ['<rootDir>/components', '<rootDir>/src'],
  moduleNameMapper: {
    '\\.(css|less|scss)$': 'identity-obj-proxy',
    '^components$': '<rootDir>/components/index.tsx',
    '^components(.*)$': '<rootDir>/components/$1',
  },
  testRegex: '(/test/.*|\\.(test|spec))\\.(ts|tsx|js)$',
  moduleFileExtensions: ['ts', 'tsx', 'js', 'jsx'],
  testPathIgnorePatterns: ['/node_modules/', '/lib/', '/esm/', '/dist/'],
  preset: 'ts-jest',
  testEnvironment: 'jsdom',
};

doz构建静态网站时,组件样式没有打包进去

您好,

我按照流程搭建组件库,本地开发、组件库引用时,组件都正常展示。但是用build:doc打包静态网站后,组件的样式并没有打包到最后统一的css文件中,使得组件样式丢失。查了很久的文档,没发现是哪里的问题。想问一下,这个是需要什么配置项吗?

引用antd二次封装之后

node_modules/rc-field-form/es/Form.d.ts:20:27 - error TS2694: Namespace 'React' has no exported member 'ForwardRefRenderFunction'

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.