Skip to content

Instantly share code, notes, and snippets.

View XuanVien08's full-sized avatar
🎯
Focusing

Xuân Viển XuanVien08

🎯
Focusing
  • Ho Chi Minh City
  • 00:24 (UTC +07:00)
View GitHub Profile
@XuanVien08
XuanVien08 / react-layout-tree.ts
Created May 7, 2026 02:58
React Component Tree Visualizer: Static analysis tool to generate ASCII tree maps of component hierarchies with Tailwind CSS layout signals. Usage: bun draw-tree.ts --entry src/App.tsx --layoutOnly
#!/usr/bin/env bun
import path from "node:path";
import { parseArgs } from "node:util";
import { parse } from "@babel/parser";
import traverseModule from "@babel/traverse";
const traverse = traverseModule;
// --- CLI CONFIGURATION ---
const HELP_TEXT = `Usage: bun generate-component-hierarchy.ts [options]