-
Notifications
You must be signed in to change notification settings - Fork 0
feat: unified proxy cli generation. #57
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 #57 +/- ##
==========================================
+ Coverage 91.56% 92.17% +0.60%
==========================================
Files 13 13
Lines 3700 3859 +159
Branches 647 681 +34
==========================================
+ Hits 3388 3557 +169
+ Misses 284 275 -9
+ Partials 28 27 -1 ☔ 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 introduces unified proxy CLI generation for .knighted-css imports. When the knighted-css-generate-types CLI processes imports targeting JavaScript/TypeScript modules (rather than stylesheets), it now generates proxy modules that re-export the original module's exports, knightedCss, and stableSelectors in a single import.
Changes:
- Generated proxy modules for JS/TS modules now include
export *,export { default }(when applicable), andexport { knightedCss }alongside the selector map - Extension fallback logic added to resolve module paths with various extensions (.ts, .tsx, .jsx, .mjs, .cjs)
- Trailing whitespace removed from generated files for CSS-only imports
- Comprehensive documentation updates explaining the new unified proxy pattern and migration path from
?knighted-css&combined
Reviewed changes
Copilot reviewed 13 out of 13 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
packages/css/src/generateTypes.ts |
Core implementation: adds proxy info resolution, extension fallback logic, and proxy export generation |
packages/css/test/generateTypes.test.ts |
Test verification that generated proxies include re-exports and knightedCss |
packages/playwright/src/auto-stable/lit-host.ts |
Demonstrates unified proxy usage by importing ShadowTree, knightedCss, and stableSelectors from single module |
packages/playwright/src/auto-stable/shadow-tree.knighted-css.ts |
Generated proxy module for shadow-tree component |
packages/playwright/src/auto-stable/shadow-tree.tsx.knighted-css.ts |
Generated proxy module (appears to be duplicate) |
packages/playwright/test/auto-stable.spec.ts |
End-to-end test verifying proxy provides exports, CSS, and selectors |
packages/playwright/src/auto-stable/constants.ts |
Adds test ID constant for proxy marker element |
packages/playwright/src/lit-react/cards/*/*.knighted-css.ts |
Formatting cleanup (trailing whitespace removal) |
packages/css/README.md |
Documents new unified proxy import pattern |
docs/type-generation.md |
Comprehensive documentation of proxy generation and rspack watch integration |
docs/combined-queries.md |
Migration guidance from combined queries to proxy imports |
Comments suppressed due to low confidence (1)
packages/playwright/src/auto-stable/shadow-tree.tsx.knighted-css.ts:17
- Two nearly identical proxy files are being generated for the same source module:
shadow-tree.knighted-css.tsandshadow-tree.tsx.knighted-css.ts. Both proxy the same module (./shadow-tree.js) and export the same selectors. This appears to be redundant. Consider whether both files are necessary, or if the generation logic should be updated to avoid creating duplicate proxies for the same underlying module.
// Generated by @knighted/css/generate-types
// Do not edit.
export * from './shadow-tree.js'
export { knightedCss } from './shadow-tree.js?knighted-css'
export const stableSelectors = {
badge: 'knighted-badge',
card: 'knighted-card',
copy: 'knighted-copy',
stack: 'knighted-stack',
title: 'knighted-title',
token: 'knighted-token',
} as const
export type KnightedCssStableSelectors = typeof stableSelectors
export type KnightedCssStableSelectorToken = keyof typeof stableSelectors
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
packages/playwright/src/auto-stable/shadow-tree.knighted-css.ts
Outdated
Show resolved
Hide resolved
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 13 out of 14 changed files in this pull request and generated 3 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
No description provided.