explaingit

transitive-bullshit/create-react-library

4,761JavaScriptAudience · developerComplexity · 2/5Setup · easy

TLDR

A CLI tool that scaffolds a publishable React component library with bundling, hot-reload development, and npm publishing pre-configured, archived since 2022, with tsup recommended instead.

Mindmap

mindmap
  root((create-react-library))
    What it does
      Scaffold library project
      Configure bundling
      npm publish ready
    Dev workflow
      Watch library source
      Hot reload example app
      Browser live preview
    Output formats
      CommonJS
      ES modules
    Status
      Archived since 2022
      Use tsup instead
      Legacy reference
Click or tap to explore — scroll the page freely

Code map

Detail Auto

An interactive map of this repo's files and how they connect — its source is parsed live in your browser. Click Visualize to build it.

filefunction / class

Things people build with this

USE CASE 1

Scaffold a new React component library project with Rollup bundling and npm publishing already configured.

USE CASE 2

Preview your React component in a live browser using the built-in example app while developing.

USE CASE 3

Publish a React component to npm as both CommonJS and ES module formats with a single build command.

Tech stack

JavaScriptReactRollupnpm

Getting it running

Difficulty · easy Time to first run · 5min

Project is archived and unmaintained since 2022, use tsup, tsdx, or microbundle for new React library projects.

License information not provided in the explanation.

In plain English

create-react-library is a command-line tool that sets up the scaffolding for building a reusable React component library that can be published to npm. If you have written a React component and want to package it so that other developers can install it in their own projects, this tool handles the configuration work involved in doing that: bundling, transpiling, test setup, and a local development environment. Running the tool prompts you for some basic information about your module, then generates a project structure with everything wired together. You get a src folder for your library code, a bundler called Rollup configured to output both CommonJS and ES module formats (the two packaging styles that npm consumers expect), and a separate example folder with a full React app that imports your library so you can preview it in a browser while developing. The development workflow runs two processes side by side. One watches your library source and recompiles it whenever you save a file. The other runs the example app, which hot-reloads in the browser as changes come in. When you are ready to share the library, a single command builds it and publishes it to npm. There is also a command to deploy the example app to GitHub Pages. Note that the README opens with a clear statement that this project is no longer actively maintained as of 2022. The author recommends using alternative tools like tsup, tsdx, or microbundle instead. The project was widely used and many npm packages were bootstrapped with it, but it should be treated as archived software rather than a starting point for new work.

Copy-paste prompts

Prompt 1
Using create-react-library, help me scaffold a new React component library and set up the dual-watch development workflow where changes hot-reload in the example app.
Prompt 2
Show me how to build and publish my create-react-library project to npm and deploy the example app to GitHub Pages.
Prompt 3
What are the modern alternatives to create-react-library such as tsup, tsdx, or microbundle, and how do I migrate an existing library from create-react-library to tsup?
Open on GitHub → Explain another repo

← transitive-bullshit on gitmyhub — every repo by this author, as a profile.

Verify against the repo before relying on details.