Conversation
📝 WalkthroughWalkthroughThe PR adds warning logging to the CSS extraction plugin, emitting warnings when template literal interpolations are complex or unresolved. Test infrastructure is updated to intercept and record these warnings via Rolldown's Changes
Sequence DiagramsequenceDiagram
participant Plugin as CSS Plugin<br/>(src/index.ts)
participant Context as Build Context
participant Rolldown as Rolldown<br/>(onLog handler)
participant TestHarness as Test Harness
Plugin->>Plugin: Encounter CSS template<br/>interpolation
alt Complex interpolation (not simple identifier)
Plugin->>Context: context.warn('COMPLEX_INTERPOLATION')
else Unresolved identifier
Plugin->>Context: context.warn('UNRESOLVED_INTERPOLATION')
end
Context->>Rolldown: Emit log event
Rolldown->>Rolldown: Normalize log.id &<br/>log.loc.file paths
Rolldown->>TestHarness: Invoke onLog callback
TestHarness->>TestHarness: Collect warning<br/>in logs[] array
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~22 minutes Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
🧪 Generate unit tests (beta)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
test/plugin.test.ts (1)
6-35:⚠️ Potential issue | 🟡 MinorNormalize Windows paths before matching
/test/.The
normalize()function is incomplete for Windows compatibility. On Windows, Rolldown paths contain backslashes (e.g.,C:\...\test\file.ts), so the regex/^.*\/test\//will not match. This causes snapshot drift on Windows runners. The codebase already normalizes backslashes insrc/index.tsfor the same reason—apply the same pattern here.♻️ Suggested fix
-const normalize = (path: string) => path.replace(/^.*\/test\//, 'test/'); +const normalize = (value: string) => + value.replace(/\\/g, '/').replace(/^.*\/test\//, 'test/');🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/plugin.test.ts` around lines 6 - 35, The normalize function in test/plugin.test.ts doesn't handle Windows backslashes so its regex /^.*\/test\// won't match paths like C:\...\test\file.ts; update normalize (used by buildWithPlugin) to first replace backslashes with forward slashes (or use a regex that accepts both separators) before applying the existing /^.*\/test\// replacement so ids and loc.file values are normalized consistently across platforms.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Outside diff comments:
In `@test/plugin.test.ts`:
- Around line 6-35: The normalize function in test/plugin.test.ts doesn't handle
Windows backslashes so its regex /^.*\/test\// won't match paths like
C:\...\test\file.ts; update normalize (used by buildWithPlugin) to first replace
backslashes with forward slashes (or use a regex that accepts both separators)
before applying the existing /^.*\/test\// replacement so ids and loc.file
values are normalized consistently across platforms.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 9b5995b8-6220-4fb3-a416-8d0886d78a03
📒 Files selected for processing (6)
.oxfmtrc.jsonREADME.mdsrc/index.tstest/fixtures/comprehensive.input.tstest/fixtures/scoping.input.tstest/plugin.test.ts
💤 Files with no reviewable changes (1)
- README.md
Summary by CodeRabbit
New Features
Documentation