Skip to content

๐ŸŒˆ Quickly develop, test, package, release, and document development, packaging, and deployment of react components. ๅฟซ้€Ÿ่ฟ›่กŒ react ็ป„ไปถๅผ€ๅ‘ใ€ๆต‹่ฏ•ใ€ๆ‰“ๅŒ…ใ€ๅ‘ๅธƒ๏ผŒๆ–‡ๆกฃๅผ€ๅ‘ใ€ๆ‰“ๅŒ…ใ€้ƒจ็ฝฒใ€‚

License

Notifications You must be signed in to change notification settings

one-template/react-component-template

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

17 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŒˆ react-component-template

A template for rapid development of React components, which satisfies component development, testing, packaging, release, document development, document packaging, and document deployment.

English | ็ฎ€ไฝ“ไธญๆ–‡

๐Ÿ’– How to use?

๐Ÿ’Ž Catalog Introduction

โ”œโ”€โ”€ assets                 Store fixed resources
โ”œโ”€โ”€ docs                   Component documentation
โ”‚   โ”œโ”€โ”€ example            Demo tsx
โ”‚   โ”œโ”€โ”€ changelog.md       Used to display component history
โ”‚   โ””โ”€โ”€ demo.md            Used to display component Demo
โ”œโ”€โ”€ src                    Component home directory
โ”‚   โ”œโ”€โ”€ index.ts           Component registration
โ”‚   โ””โ”€โ”€ template.tsx       Component implementation code
โ”œโ”€โ”€ tests                  Component test code
โ”‚   โ”œโ”€โ”€ __snapshots__      Snapshot test file output without manual modification
โ”‚   โ”œโ”€โ”€ setup.ts           Init jest script
โ”‚   โ””โ”€โ”€ index.spec.tsx     Test file
โ”œโ”€โ”€ .eslintrc.js           eslint config
โ”œโ”€โ”€ .fatherrc.ts           father config
โ”œโ”€โ”€ .umirc.ts              dumi config
โ”œโ”€โ”€ jest.config.js         jest config
โ””โ”€โ”€ tsconfig.json          typescript config

The rest of the documents can be consulted by yourself.

๐Ÿค– Command introduction

Name Description Remarks
npm run start Component development Document usage dumi, component development and documentation development together
npm run test Component test -
npm run lint eslint verify -
npm run build Component packaging Use father
npm run coverage Code coverage review -
npm publish Component release It is recommended to remove prepublishOnly for the first time
npm run docs:build Document packaging -
npm run docs-dev:build Document packaging Use dumi dev environment
npm run docs:deploy Document release The default is to use GitHub Pages
npm run deploy Document package release -

๐Ÿญ Component

Development

npm i
npm run start
# http://localhost:8080/

Test

npm run test

Unpack

npm run build
  • Use father
  • More view official website configuration
  • The package file is generated in the dist file by default

Release

package.json introduction

  1. If you want to publish npm, private needs to be set to false.
  2. The build command can be modified according to actual conditions.
  3. After main decides to install the component, import points to it.
  4. files Contains the files at the time of publishing, and includes README.md by default.
  5. Others can be understood according to the meaning of the word.

๐Ÿ“š Documentation

Start

npm run start

Online preview

https://one-template.github.io/react-component-template/

Description

  • Use dumi
  • Use basic layout, please add more by yourself
  • Because the document is deployed on GitHub Pages, the base and publicPath of .umirc.ts are set to the project name
  • One ๐ŸŒฐ : ant-design-colorful

๐ŸŽˆ Aide

๐ŸŽ‰ Who are using๏ผŸ

License

MIT

About

๐ŸŒˆ Quickly develop, test, package, release, and document development, packaging, and deployment of react components. ๅฟซ้€Ÿ่ฟ›่กŒ react ็ป„ไปถๅผ€ๅ‘ใ€ๆต‹่ฏ•ใ€ๆ‰“ๅŒ…ใ€ๅ‘ๅธƒ๏ผŒๆ–‡ๆกฃๅผ€ๅ‘ใ€ๆ‰“ๅŒ…ใ€้ƒจ็ฝฒใ€‚

Topics

Resources

License

Stars

Watchers

Forks