Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aakashns/create-component-lib
Create a library of React components that can be published to npm
https://github.com/aakashns/create-component-lib
command-line react zero-configuration
Last synced: about 2 months ago
JSON representation
Create a library of React components that can be published to npm
- Host: GitHub
- URL: https://github.com/aakashns/create-component-lib
- Owner: aakashns
- License: mit
- Created: 2018-06-13T14:22:27.000Z (over 6 years ago)
- Default Branch: master
- Last Pushed: 2019-09-16T19:41:28.000Z (over 5 years ago)
- Last Synced: 2024-09-15T02:30:01.505Z (4 months ago)
- Topics: command-line, react, zero-configuration
- Language: Shell
- Homepage: https://npmjs.com/create-component-lib
- Size: 5.86 KB
- Stars: 89
- Watchers: 2
- Forks: 13
- Open Issues: 12
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# create-component-lib
Create a library of React components that can be published to npm.
**Notes:**
- Uses `create-react-app` under the hood.
- Inspired from [this blog post](https://hackernoon.com/creating-a-library-of-react-components-using-create-react-app-without-ejecting-d182df690c6b).
- Currenlty tested only on Linux and Mac.
- It's really just a [shell script](./create-component-lib). Contributions welcome!## Usage
To create a new project, run the command:
```
npx create-component-lib my-project
```This sets up the project inside `my-project`.
Place everything you want to publish to npm inside `src/lib`. Outside `src/lib` (but inside `src/`), you can create example web pages to test or demonstrate the usage of your components.
To start the development server (with entry point `src/index.js`), run
```
npm start
```To transpile `src/lib` and create a build in the `dist` folder, run:
```
npm run build
```You can then publish it to npm using:
```
npm publish
```Note that only `README.md` and the `dist` folders are published to npm.
To learn more, see [this blog post](https://hackernoon.com/creating-a-library-of-react-components-using-create-react-app-without-ejecting-d182df690c6b) or this [sample libary](https://github.com/aakashns/simple-component-library).