Skip to content

Conversation

@knightedcodemonkey
Copy link
Owner

No description provided.

Copilot AI review requested due to automatic review settings January 24, 2026 03:49
@codecov
Copy link

codecov bot commented Jan 24, 2026

Codecov Report

❌ Patch coverage is 81.74475% with 226 lines in your changes missing coverage. Please review.
✅ Project coverage is 90.67%. Comparing base (5612b2e) to head (eb08061).
⚠️ Report is 1 commits behind head on main.

Files with missing lines Patch % Lines
packages/css/src/plugin.ts 83.93% 114 Missing and 1 partial ⚠️
packages/css/src/generateTypes.ts 80.89% 84 Missing and 1 partial ⚠️
packages/css/src/lexer.ts 66.23% 26 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #70      +/-   ##
==========================================
- Coverage   91.23%   90.67%   -0.57%     
==========================================
  Files          16       17       +1     
  Lines        5136     6316    +1180     
  Branches      920     1143     +223     
==========================================
+ Hits         4686     5727    +1041     
- Misses        418      553     +135     
- Partials       32       36       +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

Adds a new “declaration” type generation mode (plus a resolver plugin + a Playwright demo fixture) so consumers can keep idiomatic imports (e.g. import { knightedCss } from './card.js') while still getting correct runtime exports and TypeScript types.

Changes:

  • Implement declaration-mode .d.ts sidecar generation (optionally with a sidecar manifest) and extend the CLI/help/docs accordingly.
  • Add a resolver plugin (@knighted/css/plugin) to auto-append ?knighted-css (and &combined) based on strict sidecar detection + manifest lookup.
  • Add a new Playwright “mode” demo (module/declaration/hashed/stable/strict) with a dedicated rspack config, type generation script, HTML page, and E2E tests.

Reviewed changes

Copilot reviewed 31 out of 33 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
packages/playwright/test/mode.spec.ts New E2E coverage for module vs declaration behavior, hashed/stable selectors, and strict manifest rewriting.
packages/playwright/src/mode/module/module-card.tsx Module-mode demo component with shared styling.
packages/playwright/src/mode/module/host.ts Lit host rendering the module-mode component in Shadow DOM using generated knightedCss.
packages/playwright/src/mode/mode.css Shared demo styling for the new mode fixture UI.
packages/playwright/src/mode/index.ts Renders the mode demo sections and strict probes; registers custom elements.
packages/playwright/src/mode/declaration/host.ts Lit host rendering the declaration-mode component in Shadow DOM, relying on resolver rewrites.
packages/playwright/src/mode/declaration/declaration-card.tsx Declaration-mode demo component.
packages/playwright/src/mode/declaration-strict/strict-skip-card.tsx Strict-sidecar “skip” demo card.
packages/playwright/src/mode/declaration-strict/strict-ok-card.tsx Strict-sidecar “ok/manifest” demo card.
packages/playwright/src/mode/declaration-stable/styles.module.css CSS Modules styling for auto-stable selector demo.
packages/playwright/src/mode/declaration-stable/host.ts Host for the declaration+autoStable demo.
packages/playwright/src/mode/declaration-stable/declaration-stable-card.tsx Auto-stable selector demo wiring (stableClass/mergeStableClass).
packages/playwright/src/mode/declaration-hashed/styles.module.css CSS Modules styling for hashed selector demo.
packages/playwright/src/mode/declaration-hashed/host.ts Host for the declaration+hashed demo.
packages/playwright/src/mode/declaration-hashed/declaration-hashed-card.tsx Hashed selector export demo (selectors = styles).
packages/playwright/src/mode/constants.ts Centralizes mode fixture tags/test IDs.
packages/playwright/scripts/generate-mode-types.ts Generates mode fixture types in multiple configs and merges sidecar manifests for strict resolver use.
packages/playwright/rspack.mode.config.js Mode-demo bundling config including resolver plugin + strict manifest wiring.
packages/playwright/package.json Adds types:mode, build:mode, preview:mode, and bumps @knighted/css to 1.2.0-rc.0.
packages/playwright/mode.html New standalone page to host the mode demo bundle.
packages/playwright/README.md Documents the new mode fixture and its generation/build workflow.
packages/css/test/plugin.test.ts Adds unit tests validating resolver plugin behavior (strict markers, manifest, caching, hooks).
packages/css/test/generateTypes.test.ts Adds tests for declaration-mode generation and sidecar manifest output; updates CLI parsing expectations.
packages/css/test/snapshots/generateTypes.snap.json Updates CLI help snapshot for new flags (--mode, --manifest).
packages/css/src/plugin.ts Implements the resolver plugin supporting strict sidecars, manifests, and combined query handling.
packages/css/src/lexer.ts Extends module analysis to also return named exports for declaration-mode type emission decisions.
packages/css/src/generateTypes.ts Adds `mode: module
packages/css/package.json Publishes new subpath export @knighted/css/plugin and bumps version to 1.2.0-rc.0.
packages/css/README.md Documents declaration-mode workflow and resolver plugin usage.
package-lock.json Updates locked versions for @knighted/css and fixture dependency.
docs/type-generation.md Adds mode/manifest flags + a quick-reference table and declaration-mode guidance.
docs/loader.md Documents tradeoffs between modes and how to wire the resolver plugin.
.gitignore Broadens dist/knighted ignore patterns and ignores generated mode .d.ts sidecars.

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

Copilot AI review requested due to automatic review settings January 24, 2026 15:32
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

Copilot reviewed 31 out of 33 changed files in this pull request and generated 3 comments.


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

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

Copilot reviewed 34 out of 36 changed files in this pull request and generated 1 comment.


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

@knightedcodemonkey
Copy link
Owner Author

Closing in favor of #72

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.

2 participants