Skip to content

Conversation

0oAstro
Copy link
Contributor

@0oAstro 0oAstro commented Sep 24, 2025

This PR includes:

  • Add FileStatsBlock content block type for displaying file size and line count
  • Update DocumentCompiler to include file statistics in generated content
  • Update GenerateCommandRenderer to show file statistics in console output
  • Display human-readable file sizes (B, KB, MB, GB) and line counts
  • Add statistics section at the end of each generated markdown file

Related Issue: #249

 ✓ Import local [src/Source/context.yaml]............................................................
 ✓ Import local [src/Modifier/context.yaml]..........................................................
 ✓ Import local [src/Lib/context.yaml]...............................................................
 ✓ Import local [src/Config/context.yaml]............................................................
 ✓ Import local [src/McpServer/context.yaml].........................................................
 ✓ Import local [src/Console/context.yaml]...........................................................
 ✓ Import local [prompts.yaml].......................................................................
 ✓ Import local [./docs].............................................................................

 ✓ Project structure overview [project-structure.md]................................................. (30.9 KB, 481 lines)
 ✓ Core Interfaces [core/interfaces.md].............................................................. (43.9 KB, 1757 lines)
 ✓ Changes in the Project [changes.md]............................................................... (178 B, 9 lines)
 ✓ Source core [sources/loader.md]................................................................... (27.7 KB, 973 lines)
 ✓ [source] File [sources/file-source.md]............................................................ (23.1 KB, 732 lines)
 ✓ [source] GitHub [sources/github-source.md]........................................................ (35.7 KB, 1260 lines)
 ✓ [source] Gitlab [sources/gitlab-source.md]........................................................ (44.2 KB, 1528 lines)
 ✓ [source] URL [sources/url-source.md].............................................................. (14.6 KB, 448 lines)
 ✓ [source] Docs [sources/docs-source.md]............................................................ (11.7 KB, 386 lines)
 ✓ [source] Text [sources/text-source.md]............................................................ (6.2 KB, 226 lines)
 ! [source] MCP [sources/mcp-source.md]..............................................................
    ✗ Error in FileSource: Some directories or files contain invalid paths: 

- Add FileStatsBlock content block type for displaying file size and line count
- Update DocumentCompiler to include file statistics in generated content
- Update GenerateCommandRenderer to show file statistics in console output
- Display human-readable file sizes (B, KB, MB, GB) and line counts
- Add statistics section at the end of each generated markdown file
- Fix DocumentCompilerTest expectations for files->exists() calls
- Fix Psalm InvalidOperand errors by explicit float casting
- Add proper error logging in GenerateCommandRenderer catch block
@butschster
Copy link
Collaborator

butschster commented Sep 24, 2025

Hey @0oAstro ! Thx a lot. Could you also provide how it will look like?

Copy link

codecov bot commented Sep 24, 2025

@butschster
Copy link
Collaborator

@0oAstro If you like to discuss something, join a new discord channel) https://discord.gg/YmFckwVkQM

@butschster butschster linked an issue Sep 24, 2025 that may be closed by this pull request
@0oAstro
Copy link
Contributor Author

0oAstro commented Sep 24, 2025

Screenshot 2025-09-24 at 3 52 56 PM sure @butschster this is how the output will look like. As for the failing errors, I am not really sure about what @codecov is.

@butschster
Copy link
Collaborator

@0oAstro don't pay attention on codecov. Only linters

- Add explicit float casting in file size calculations
- Add explicit string casting for float concatenation
- Fix GenerateCommandRenderer.php and FileStatsBlock.php
@butschster butschster merged commit a3b0cbe into context-hub:main Sep 24, 2025
5 of 6 checks passed
@butschster butschster added console:cli Console commands and CLI interface console:renderer Renderer components for CLI output labels Sep 24, 2025
@butschster butschster added this to the 1.32 milestone Sep 24, 2025
@butschster butschster moved this to Done in Context Generator Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
console:cli Console commands and CLI interface console:renderer Renderer components for CLI output
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Show file size and lines num when generate
2 participants