Skip to content

feat: bundle-stats plugin poc implementation #1024

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 21 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .cursor/rules/general.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
---
description:
globs:
alwaysApply: true
---

## JSDoc Documentation Pattern

**Structure**: Add very short descriptive JSDoc blocks for functions with this format:

```javascript
/**
* [What it does]. [Why it exists].
*/
```

**Structure Breakdown**:
1. **What it does** - Very short description of the function's behavior
2. **Why it exists** - Very short description of the purpose/benefit

**Examples**:
```javascript
/**
* Compiles pattern into cached matcher function. Avoids recompilation overhead.
*/
export function compilePattern(pattern: string): PatternMatcher

/**
* Collects and caches input paths from output. Prevents repeated path extraction.
*/
export function getInputPaths(output: UnifiedStatsOutput): string[]

/**
* Evaluates paths against include/exclude patterns. Core filtering logic for all path types.
* Enables selective filtering by allowing users to focus on specific files while excluding unwanted ones.
*/
export function evaluateMatchers(...)
```

**Key Principles**:
- **Brevity**: Keep descriptions very short
- **Clarity**: First sentence = what it does, second sentence = why it's needed
- **No fluff**: Avoid verbose explanations
- **Action-oriented**: Start with verbs (Compiles, Collects, Evaluates)
- **Value-focused**: The "why" explains the benefit (performance, reusability, etc.)
40 changes: 40 additions & 0 deletions .cursor/rules/toc.mdc
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
---
description:
globs:
alwaysApply: false
---
## Update ToC -> `grep`-Sync Markdown TOC

**1. Get Headings:**

```bash
grep -n "^##\\+ " your-file.md
```

(`-n`=line numbers; `^##\\+ `=headings H2-H6).

**2. Analyze & Rebuild TOC:**
Compare `grep` output to your TOC in `your-file.md`. Edit TOC to match `grep` data:

- **Hierarchy Mapping (from `grep` `^##\\+ ` to TOC indent):**
- `##`: `**[Text](#link)**` (0 spaces indent)
- `###`: `- [Text](#link)` (2 spaces indent)
- `####`: `- [Text](#link)` (4 spaces indent)
- (etc., +2 spaces/level, no `**`)
- **Anchor Links (`#link`):** Lowercase heading, spaces to hyphens.

**Example Fix (`cpu-profiling.md` "Data Structure" section):**
`grep` showed `### Dimensions and Time` under `## Data Structure`.
TOC changed from:

```markdown
- **[Data Structure](#data-structure)**
- **[Dimensions and Time](#dimensions-and-time)**
```

To (correctly nested):

```markdown
- **[Data Structure](#data-structure)**
- [Dimensions and Time](#dimensions-and-time)
```
Loading
Loading