A template for rapid development of React components, which satisfies component development, testing, packaging, release, document development, document packaging, and document deployment.
English | ็ฎไฝไธญๆ
โโโ 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.
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 | - |
npm i
npm run start
# http://localhost:8080/
npm run test
npm run build
- Use father
- More view official website configuration
- The package file is generated in the dist file by default
package.json
introduction
- If you want to publish npm,
private
needs to be set tofalse
. - The build command can be modified according to actual conditions.
- After main decides to install the component, import points to it.
- files Contains the files at the time of publishing, and includes README.md by default.
- Others can be understood according to the meaning of the word.
npm run start
https://one-template.github.io/react-component-template/
- Use dumi
- Use basic layout, please add more by yourself
- Because the document is deployed on GitHub Pages, the
base
andpublicPath
of.umirc.ts
are set to the project name - One ๐ฐ : ant-design-colorful