-
Notifications
You must be signed in to change notification settings - Fork 0
feat: type generation mode declaration. #72
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
Conversation
Codecov Report❌ Patch coverage is Additional details and impacted files@@ Coverage Diff @@
## main #72 +/- ##
==========================================
- Coverage 91.16% 90.56% -0.60%
==========================================
Files 16 17 +1
Lines 5140 6330 +1190
Branches 923 1147 +224
==========================================
+ Hits 4686 5733 +1047
- Misses 421 560 +139
- Partials 33 37 +4 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this 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 adds declaration mode for type generation in the @knighted/css package, enabling cleaner imports without double extensions while maintaining type safety.
Changes:
- Introduces
--mode declarationtoknighted-css-generate-typesCLI for generating.d.tsmodule augmentations alongside source files - Adds a resolver plugin (
@knighted/css/plugin) that automatically appends?knighted-cssquery parameters to imports with generated sidecars - Implements comprehensive test coverage for both the plugin and declaration mode features
Reviewed changes
Copilot reviewed 35 out of 37 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
| packages/css/src/plugin.ts | New resolver plugin implementation for Rspack/webpack that rewrites imports based on sidecar presence |
| packages/css/src/generateTypes.ts | Adds declaration mode support with sidecar manifest generation and enhanced CLI argument parsing |
| packages/css/src/lexer.ts | Extends module analysis to extract named exports for declaration type accuracy |
| packages/css/test/plugin.test.ts | Comprehensive test suite covering plugin resolver logic, manifest handling, and edge cases |
| packages/css/test/generateTypes.test.ts | Tests for declaration mode, manifest writing, and CLI argument validation |
| packages/css/test/loaderBridge.test.ts | Additional test coverage for loader bridge internals |
| packages/css/test/moduleGraph.test.ts | Tests for specifier normalization and tsconfig path mapping |
| packages/css/test/lexer.test.ts | Tests for export extraction and module analysis fallbacks |
| packages/playwright/src/mode/* | Complete mode demo fixture showcasing declaration, module, hashed, and stable selector variants |
| packages/playwright/test/mode.spec.ts | E2E tests verifying styles match in light and shadow DOM across all mode variants |
| packages/playwright/scripts/generate-mode-types.ts | Type generation orchestration script for mode fixtures |
| packages/playwright/rspack.mode.config.js | Rspack configuration demonstrating resolver plugin with strict sidecar mode |
| packages/css/package.json | Version bump to 1.2.0-rc.0 and new plugin export |
| docs/type-generation.md | Comprehensive documentation for declaration mode with mode comparison table |
| docs/loader.md | Resolver plugin setup guide with strict sidecar configuration examples |
| packages/css/README.md | Updated overview highlighting declaration mode capabilities |
| .github/workflows/playwright.yml | Adds Windows CI test job for cross-platform validation |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
Copilot reviewed 35 out of 37 changed files in this pull request and generated no new comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.