-
-
Notifications
You must be signed in to change notification settings - Fork 2
fix: Do not generate default keyword for utilities #65
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
fix: Do not generate default keyword for utilities #65
Conversation
🦋 Changeset detectedLatest commit: 0a5379b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
Not sure what this means? Click here to learn what changesets are. Click here if you're a maintainer who wants to add another changeset to this PR |
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
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 PR fixes the defaultUtilitySelectorFn to prevent the "default" keyword from appearing in generated utility class selectors. When a utility has a value of "default", it will now be excluded from the selector, resulting in cleaner class names (e.g., ._hidden instead of ._hidden:default).
Key Changes:
- Modified the selector generation logic to conditionally exclude "default" values using a spread operator
- Added comprehensive test suite for all three default functions (
defaultThemeSelectorFn,defaultUtilitySelectorFn,defaultVariableNameFn)
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
engine/transpiler/src/defaults.ts |
Updated defaultUtilitySelectorFn to exclude "default" value from generated selectors using conditional spread operator |
engine/transpiler/src/defaults.test.ts |
Added comprehensive test coverage for all default functions, including tests for the new "default" value exclusion behavior |
.changeset/common-coats-swim.md |
Added changeset documenting the fix as a patch-level change |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
:wq the-default-key-when-creating-utilities-creates-the-utility-class-without-the-key' of github.com:styleframe-dev/styleframe into 64-ensure-the-default-key-when-creating-utilities-creates-the-utility-class-without-the-key
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
This pull request addresses a bug in the transpiler package related to the generation of utility selectors. The main change ensures that the default keyword is no longer included in the generated selectors for utility classes. Additionally, comprehensive unit tests have been added to validate the behavior of selector and variable name generation functions.
Bug fix for utility selector generation:
defaultUtilitySelectorFninengine/transpiler/src/defaults.tsto exclude thedefaultkeyword from utility selectors, ensuring cleaner and more accurate class names.Testing improvements:
engine/transpiler/src/defaults.test.tsto coverdefaultThemeSelectorFn,defaultUtilitySelectorFn, anddefaultVariableNameFn, verifying correct selector and variable name generation under various scenarios.Documentation and release notes:
.changeset/common-coats-swim.mdto document the patch release and describe the bug fix for utility selector generation.