Export CSS parser function, add CLI with --stats flag, and add stats utility#76
Export CSS parser function, add CLI with --stats flag, and add stats utility#76
Conversation
Co-authored-by: typicode <5502029+typicode@users.noreply.github.com>
Co-authored-by: typicode <5502029+typicode@users.noreply.github.com>
…ction synchronous Co-authored-by: typicode <5502029+typicode@users.noreply.github.com>
Co-authored-by: typicode <5502029+typicode@users.noreply.github.com>
Done in 3c6da86. Renamed |
Co-authored-by: typicode <5502029+typicode@users.noreply.github.com>
Co-authored-by: typicode <5502029+typicode@users.noreply.github.com>
Done in 3ce456e. The |
Done in a44df83. Added |
Co-authored-by: typicode <5502029+typicode@users.noreply.github.com>
Co-authored-by: typicode <5502029+typicode@users.noreply.github.com>
Done in 3f40f7b. Fixed the multi-selector CSS rules bug where |
Co-authored-by: typicode <5502029+typicode@users.noreply.github.com>
|
@copilot sort the stat's results descending order |
Co-authored-by: typicode <5502029+typicode@users.noreply.github.com>
Implementation Plan
Parsedtypeindex.tsnode:util.parseArgs)package.jsonto add abinentry for the CLISummary
This PR exposes the CSS parsing logic as a standalone API, adds a CLI for parsing CSS files and analyzing tag usage, and introduces a stats utility for counting JSX/TSX element usage.
Key Changes
Exported Parser Function:
parse()function that takes a CSS string and returns aParsedobjectParsedtype for proper typingCLI (
src/bin.ts):--statsflag: outputs tag usage statistics from JSX/TSX files--prettyflag: displays stats in a formatted table--tsconfigoption: specify custom tsconfig pathStats Utility (
src/stats.ts):buttonvsbutton[data-variant="primary"])Bug Fixes & Improvements:
button, a { --x: 1 })postcssto dependencies for runtime availabilityos.tmpdir()All 33 tests passing.
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.