https://github.com/deepraining/react-lib-starter
一个用于快速创建 React 组件库的模板脚手架,使用 Storybook 构建. A boilerplate for creating a React library, using Storybook.
https://github.com/deepraining/react-lib-starter
boilerplate enzyme gulp jest lib library react starter storybook webpack
Last synced: 3 months ago
JSON representation
一个用于快速创建 React 组件库的模板脚手架,使用 Storybook 构建. A boilerplate for creating a React library, using Storybook.
- Host: GitHub
- URL: https://github.com/deepraining/react-lib-starter
- Owner: deepraining
- License: mit
- Created: 2019-03-07T03:31:23.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-07-30T02:15:18.000Z (almost 6 years ago)
- Last Synced: 2025-01-15T14:35:57.100Z (4 months ago)
- Topics: boilerplate, enzyme, gulp, jest, lib, library, react, starter, storybook, webpack
- Language: JavaScript
- Homepage:
- Size: 19.5 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.en.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# react-lib-starter
[中文文档](./README.md)
A boilerplate for creating a React library, using Storybook.
## Getting started
```
git clone https://github.com/senntyou/react-lib-starter.git --depth=1cd react-lib-starter
npm install # install dependencies
npm run storybook # develop using storybook
npm run build # build distribution files
```## Features
- [less](http://lesscss.org/), [scss](https://sass-lang.com/) style languages support.
- [Flow](https://flow.org/) syntax, [jest](https://jestjs.io/en/) + [enzyme](https://github.com/airbnb/enzyme) test support.
- Using [storybook](https://storybook.js.org/) to develop, preview, deploy static site.## Project
```
- src
- index.{js,jsx} # js entry file
- styles
- index.{less,scss} # style entry file- .storybook # for storybook
- stories # for storybook
```By default, styles use `less` language, if you want to use `scss` language, you should modify `package.json` by:
```
"scripts": {
- "build:styles": "npm run build:less",
+ "build:styles": "npm run build:scss",
}
```## Notes
- `.js` files only for pure JavaScript, and `.jsx` for React components.