An open API service indexing awesome lists of open source software.

https://github.com/manjunani/propcreep


https://github.com/manjunani/propcreep

Last synced: 11 months ago
JSON representation

Awesome Lists containing this project

README

          

# ๐Ÿš€ PropCreep Insight

> ๐Ÿ”Ž A fast, offline-first React component explorer with built-in AI docgen superpowers โ€” like Storybook met VS Code's tree view and got real.

---

## ๐Ÿ“ฆ TL;DR

```bash
# Basic static docgen
npx propcreep-insight --input ./src --output ./docs

# Default (static) with viewer
npx propcreep-insight --view

# OpenAI mode
npx propcreep-insight --ai openai --openai-key sk-abc123 --view

# Gemini mode
npx propcreep-insight --ai gemini --gemini-key gem-abc123 --view
```

- ๐Ÿงฉ Visualizes component structure
- ๐Ÿ“œ Generates static docs with prop metadata
- ๐Ÿ“Š Shows per-component size insights
- ๐Ÿงฌ Mermaid-powered component trees
- ๐Ÿค– Optional GPT/Gemini doc generation
- ๐Ÿ›  Works 100% offline (unless AI is enabled)

---

## ๐ŸŽฏ Why PropCreep?

| Feature | โœ… PropCreep Insight | ๐Ÿงธ Storybook | ๐Ÿ“ฆ Bundle Analyzer |
|---------------------------|----------------------|--------------|--------------------|
| ๐Ÿ—‚ Component Tree Viewer | โœ… Yes | โŒ No | โŒ No |
| ๐Ÿ“œ Static Docgen | โœ… Built-in | โŒ Separate | โŒ N/A |
| โšก File Size + Weight | โœ… Yes | โŒ No | โœ… Yes |
| ๐Ÿ” AI-Generated Comments | โœ… GPT/Gemini (opt-in)| โŒ | โŒ |
| ๐Ÿ“ˆ Mermaid Graph Output | โœ… Yes | โŒ No | โŒ No |
| ๐Ÿ›  Works Offline | โœ… Yes | โŒ | โœ… Mostly |

---

## ๐Ÿ“ฅ Install & Use

```bash
npm install -g propcreep-insight
# or just run directly
npx propcreep-insight --input ./src --output ./docs --view
```

Outputs:

- `components.json`
- `component-tree.json`
- `component-tree.mmd`
- ๐Ÿ“ Self-contained viewer at `./propcreep-report/`

---

## ๐Ÿง  AI Doc Generation (Optional)

```bash
# OpenAI
OPENAI_API_KEY=sk-xxx npx propcreep-insight --ai openai

# Gemini
GEMINI_API_KEY=xxx npx propcreep-insight --ai gemini
```

Or use a `.env` file:

```env
PROP_AI_MODE=gemini
OPENAI_API_KEY=sk-xxx
GEMINI_API_KEY=gem-xxx
```

---

## ๐Ÿ–ผ Viewer UI (Static Site)

After generation, youโ€™ll get:

```
propcreep-report/
โ”œโ”€โ”€ index.html
โ”œโ”€โ”€ assets/
โ””โ”€โ”€ data/
โ”œโ”€โ”€ components.json
โ””โ”€โ”€ component-tree.json
```

### Launch locally

```bash
npx propcreep-insight --view
# or manually:
npx serve ./propcreep-report -l 5173 -s
```

---

## ๐Ÿ“ˆ Mermaid Graph

From `component-tree.mmd`:

```mermaid
graph TD
root-->components
components-->Button
components-->Header
```

---

## ๐Ÿ”ง CLI Flags

| Flag | Description | Default |
|------------------|---------------------------------------------|------------------|
| `--input` / `-i` | Input component directory | `./src` |
| `--output` / `-o`| Output folder for JSON/docs | `./docs` |
| `--ai` | `openai`, `gemini`, or omit for static mode | `static` |
| `--openai-key` | OpenAI API key | from `.env` |
| `--gemini-key` | Gemini API key | from `.env` |
| `--view` / `-v` | Launch the UI viewer after generation | `false` |

---

## ๐Ÿงช Local Dev (Viewer)

```bash
cd ui
npm install
npm run dev
```

To test viewer with actual data:

```bash
cp -r ../docs ui/public/data
```

Then open [http://localhost:5173](http://localhost:5173)

---

## ๐Ÿ’ฌ Feedback & Contributions

Have ideas or bugs?

- Submit feedback: [GitHub Issues](hhttps://github.com/manjunani/PropCreep/issues)
- Or open a PR โ€” we welcome contributions ๐Ÿ™Œ

---

## โœ… Roadmap

- [x] Component tree generation
- [x] Static docgen
- [x] Mermaid graph export
- [x] File size analysis
- [x] AI-enhanced docgen (GPT/Gemini)
- [ ] Component churn tracking
- [ ] PR comment bot integration
- [ ] Markdown export for GitHub READMEs

---

## ๐Ÿง  Powered By

- React
- Babel parser
- Mermaid.js
- OpenAI + Gemini
- Commander.js
- fs-extra + globby

---

## ๐Ÿง™ About the Creator

**PropCreep Insight** is built by [Manjunatha Sai Uppu](https://github.com/manjunani) with โค๏ธ to help frontend engineers stay fast, informed, and in control of their codebase.

> If you love it, โญ star it, share it, and send your feedback.

---

## ๐Ÿ“œ License

MIT โ€” [LICENSE](./LICENSE)