DEV Community

Maryam Jk
Maryam Jk

Posted on

I Built a CLI Tool That Cleans React & Next.js Boilerplate in One Command

The Problem

Every time I start a new React or Next.js project, I do the same thing.

Delete next.svg. Delete vercel.svg. Empty globals.css.
Remove the default logo. Clean up App.jsx.

Every. Single. Time.

It takes 5 minutes but it's annoying. So I built a tool to do it automatically.


Introducing stackclean

stackclean is a simple CLI tool that removes all default boilerplate
files from your React or Next.js project in one command.


bash
npx stackclean

That's it One Command done.


## What it removes
**Next.js (App Router)**

- Deletes: next.svg, vercel.svg, file.svg, globe.svg,
  window.svg, favicon.ico, icon.svg
- Cleans: page.tsx, layout.tsx, globals.css

**Next.js (Pages Router)**
- Deletes: next.svg, vercel.svg, favicon.ico,
  Home.module.css, api/hello.js
- Cleans: index.tsx, globals.css

  **Vite + React**
- Deletes: react.svg, vite.svg, favicon.ico, all SVGs in src/assets
- Cleans: App.jsx, App.css, index.css, main.jsx

 **Create React App**
- Deletes: logo.svg, favicon.ico, logo192.png, logo512.png,
  manifest.json, robots.txt, reportWebVitals.js, App.test.js
- Cleans: App.js, App.css, index.css, index.js

## Auto Detection
You don't need to tell it which framework you're using.
stackclean reads your package.json and figures it out automatically.

Works with JavaScript and TypeScript both.

## How to use
Run inside your project folder:
`Run inside your project folder:`
Or pass a path:
`npx stackclean ./my-project`

## Links
npm: npmjs.com/package/stackclean
GitHub: github.com/MaryamJkdev/StackClean

> If this saves you even 5 minutes .... it did its job.
Give it a try and let me know what you think in the comments!
Enter fullscreen mode Exit fullscreen mode

Top comments (0)