🌊 rapid-react-pkg-demo

GitHub last commit NPM Downloads GitHub Repo stars

This is a CLI tool for quickly producing a small react package demo from a README file. It provides simple commands to run a development server and build your Next.js application using react-pkg-demo.

Installation

To install the CLI globally, run:

npm install rapid-react-pkg-demo --save-dev

Usage

Development

Run the Next.js development server.

rapid dev [options]

Build

Build the Next.js application.

rapid build [options]

Options

OptionDefaultDescription
-r, --readme <path>./README.mdPath to the README.md file
-c, --config <path>./rapid.config.jsPath to the rapid config file

Example with options

rapid dev --readme ./docs/README.md --config ./config/rapid.config.js

Rapid Config File

The rapid.config.js file is used to configure the behavior and appearance of your react package demo. Below is an example configuration:

const Code = require("./src/components/Code");
const { Button } = require("./src");

module.exports = {
  color: "#d3c1ad",
  packageName: "react-package",
  description: "a package react things",
  icon: "⏩",
  scope: { Button, Code },
};

Configuration Options

PropertyTypeRequiredDescription
colorstringYesThe primary color used in the demo.
packageNamestringYesThe name of the package.
descriptionstringYesA short description of the package.
iconstringYesAn icon representing the package.
scopeobjectNoAn object containing components to be demoed using react-live.

License

This project is licensed under the MIT License.