This project uses npm workspaces to manage multiple packages:
packages/
├── analyzer/ # Core parsing and analysis logic (platform-independent)
├── extension/ # VS Code extension
└── web/ # Web application (GitHub Pages)
- Node.js 22.x (with npm 10+)
npm install# Build all packages
npm run build --workspaces
# Watch mode for all packages
npm run dev --workspaces --if-present
# Run linter
npm run lint --workspaces --if-present
# Run tests
npm run test --workspaces --if-present# Build analyzer only
npm run --workspace @web-component-analyzer/analyzer build
# Build extension only
npm run --workspace web-component-analyzer build
# Build web app only
npm run --workspace @web-component-analyzer/web build
# Start web dev server
npm run --workspace @web-component-analyzer/web devCore parsing and analysis logic for React and Vue 3 components. Platform-independent TypeScript library.
- AST parsing using SWC
- Component analysis (props, state, hooks, composables, etc.)
- DFD data generation
- Support for React hooks and Vue 3 Composition API
- Third-party library adapters (Vue Router, Pinia, React Router, SWR, TanStack Query, etc.)
VS Code extension that provides:
- Command palette integration
- Webview-based DFD visualization
- Real-time component analysis
- Mermaid diagram rendering
Browser-based web application for analyzing React and Vue 3 components:
- Interactive Code Editor: Monaco Editor with syntax highlighting
- Real-Time Visualization: See DFD updates as you type
- Sample Components: 10+ examples demonstrating different patterns (React hooks, Vue composables, etc.)
- Framework Support: React (JSX/TSX) and Vue 3 (SFC with
<script setup>) - URL Sharing: Share component code via compressed URLs
- Themed Interface: Light (Easter) and dark (Halloween) modes with decorations
- No Installation: Runs entirely in the browser
Deployed to GitHub Pages with automatic deployment via GitHub Actions.
- Make changes to
packages/analyzerfor core logic - Test in
packages/extensionfor VS Code integration - Test in
packages/webfor web UI
Changes to the analyzer package are automatically reflected in both extension and web packages through workspace references.
vsce package expects a single-package workspace. To keep npm workspaces for development while producing a clean package, use the helper script that vendors the analyzer into a temporary folder:
# From repo root
./scripts/package-extension.sh
# Result: web-component-analyzer-<version>.vsix placed in repo rootThe script performs these steps for you:
- Builds
@web-component-analyzer/analyzerso thedist/artifacts are current. - Copies both
packages/extensionandpackages/analyzerinto a temporary workspace-free directory. - Rewrites the extension's dependency graph to point at the vendored analyzer copy (no pnpm/npm workspace symlinks).
- Runs
npm installandvsce packageinside the temporary directory, then copies the generated.vsixback to the repository root.
You can keep the temporary directory for debugging by setting WCA_KEEP_PACKAGE_TEMP=1 before running the script. Additional vsce package flags may be passed through as arguments, e.g. ./scripts/package-extension.sh --target darwin-arm64.