Skip to content

Conversation

@knightedcodemonkey
Copy link
Owner

@knightedcodemonkey knightedcodemonkey commented Jan 4, 2026

Copilot AI review requested due to automatic review settings January 4, 2026 23:44
@codecov
Copy link

codecov bot commented Jan 4, 2026

Codecov Report

❌ Patch coverage is 85.13514% with 44 lines in your changes missing coverage. Please review.
✅ Project coverage is 92.54%. Comparing base (b3411e8) to head (eb7780b).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/css/src/lexer.ts 84.89% 40 Missing and 2 partials ⚠️
packages/css/src/generateTypes.ts 80.00% 1 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #51      +/-   ##
==========================================
+ Coverage   92.20%   92.54%   +0.34%     
==========================================
  Files          11       12       +1     
  Lines        2859     3126     +267     
  Branches      496      550      +54     
==========================================
+ Hits         2636     2893     +257     
- Misses        204      210       +6     
- Partials       19       23       +4     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request fixes loader query default exports and adds a JSX/TSX fallback using oxc-parser. The changes enable the CSS loader to properly handle JSX/TSX files when es-module-lexer fails, and standardizes the generated type names across all selector modules.

Key changes:

  • Introduced a new lexer module that falls back to oxc-parser for JSX/TSX files or when es-module-lexer fails to parse
  • Added default export declarations to loader query type definitions
  • Standardized generated type names to use KnightedCssStableSelectors consistently
  • Bumped package version from 1.0.8 to 1.0.9

Reviewed changes

Copilot reviewed 21 out of 24 changed files in this pull request and generated 1 comment.

Show a summary per file
File Description
packages/css/src/lexer.ts New module providing JSX/TSX-aware import/export analysis with oxc-parser fallback
packages/css/src/moduleInfo.ts Refactored to use the new analyzeModule function from lexer
packages/css/src/generateTypes.ts Updated to use analyzeModule for finding selector imports in TSX files
packages/css/loader-queries.d.ts Added default export declarations for knightedCss in loader query modules
packages/css/test/lexer.test.ts Comprehensive tests for the new lexer functionality
packages/css/test/moduleInfo.test.ts Added tests for JSX/TSX default export detection
packages/css/test/generateTypes.test.ts Added test for TSX selector import discovery
packages/css/test/moduleGraph.test.ts Added tests for edge cases in module resolution
packages/css/test/fixtures/combined/*.tsx,.js Test fixtures for JSX/TSX fallback scenarios
packages/playwright/src/lit-react/cards/fallback-card/* New card component demonstrating oxc-parser fallback
packages/playwright/src/lit-react/cards/combined-types-card/* Updated to use standardized type names with aliasing
packages/playwright/test/lit-react.spec.ts Added test for fallback card functionality
packages/playwright/playwright.config.ts Reduced global test timeout from 20s to 5s
packages/playwright/package.json Added types script and updated pretest to run it
packages/css/package.json Bumped version to 1.0.9
.gitignore Added .knighted-css/ directory
docs/how-it-works.md Documented JSX/TSX fallback support

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@knightedcodemonkey knightedcodemonkey merged commit d0bda67 into main Jan 5, 2026
6 checks passed
@knightedcodemonkey knightedcodemonkey deleted the bananas branch January 5, 2026 00:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

generate-types + TSX (JSX) issue

2 participants