1.1.1 • Published 5 years ago
react-create-lib v1.1.1
react-create-lib
A global CLI that creates a project for a react typescript library.
It also sets up Storybook for previewing your component and Rollup for bundling all files into a single distribution file (dist/bundle.js
)
Install
npm i -g react-create-lib
Usage
To create your library project:
- Open a terminal or command prompt
cd
to the location where the library project is to be created.- Run
react-create-lib -l <library-name>
This will create a project tree which looks like
<library-name>
|
|--.storybook/
|--main.js
|--preview-head.html
|--dist/
|--index.d.ts
|--src/
|--index.ts
|--.babelrc.js
|--.eslintrc
|--.gitignore
|--.npmignore
|--.prettierrc
|--package.json
|--README.md
|--rollup.config.js
|--tsconfig.json
After the project tree is created, the following steps are needed to install the dependencies required:
cd
into the project directory- Run
react-create-lib install
and wait for the installation to complete
If no errors occur, you are now ready to open the project in your IDE (IntelliJ, VSCode, Atom, etc) and begin development.
Changelog
- 1.1.0
- Updated
.eslintrc
rules in template - Added
@typescript-eslint/eslint-plugin
to dependencies to install - Added
types.ts
template file
- Updated