1.0.6 • Published 6 years ago

reactifire v1.0.6

Weekly downloads
-
License
MIT
Repository
-
Last release
6 years ago

npm-cli

CLI for easily publishing modern React libraries with Rollup and example usage via create-react-app.

Intro

The purpose of this CLI is to make publishing our own React components as simple as possible.

Features

  • Easy-to-use CLI
  • Handles all modern JS features
  • Bundles cjs and es module formats
  • create-react-app for example usage and local dev
  • Rollup for build process
  • Babel for transpilation
  • Jest for testing
  • uses storybook
  • handles scss files

Prerequisite :

  • use yarn

Install

yarn global add @cheetahdigital/npm-cli

ou

npm install -g @cheetahdigital/npm-cli

Creating a New Module

npm-cli

Answer some basic prompts about your module, and then the CLI will perform the following steps:

  • copy over the template to a new folder in the current directory
  • install dependencies via yarn
  • link packages together for local development
  • initialize local git repo

At this point, the new module is all setup for local development.

Development

Local development is broken into two parts.

First, you'll run rollup to watch your src/ module and automatically recompile it into dist/ whenever you make changes.

yarn start # runs rollup with watch flag

The second part will be running the example/ create-react-app that's linked to the local version of your module.

cd example
yarn start # runs create-react-app dev server

The third one is for storybook :

yarn storybook

Now, anytime you make a change to your component in src/ or to the example app's example/src, create-react-app will live-reload your local dev server so you can iterate on your component in real-time.

npm.io

License

MIT © Maximilien Garenne

Special Thx to Travis Fischer, this project is a fork of his repo