Skip to content

Conversation

@alexgrozav
Copy link
Contributor

@alexgrozav alexgrozav commented Dec 4, 2025

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:

  • Updated defaultUtilitySelectorFn in engine/transpiler/src/defaults.ts to exclude the default keyword from utility selectors, ensuring cleaner and more accurate class names.

Testing improvements:

  • Added a new test suite in engine/transpiler/src/defaults.test.ts to cover defaultThemeSelectorFn, defaultUtilitySelectorFn, and defaultVariableNameFn, verifying correct selector and variable name generation under various scenarios.

Documentation and release notes:

  • Added a changeset file .changeset/common-coats-swim.md to document the patch release and describe the bug fix for utility selector generation.

@changeset-bot
Copy link

changeset-bot bot commented Dec 4, 2025

🦋 Changeset detected

Latest commit: 0a5379b

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
@styleframe/transpiler Patch

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

@vercel
Copy link

vercel bot commented Dec 4, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
app-styleframe-dev-production Ready Ready Preview Comment Dec 4, 2025 2:02pm
styleframe-dev-production Ready Ready Preview Comment Dec 4, 2025 2:02pm

Copy link
Contributor

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

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.

alexgrozav and others added 2 commits December 4, 2025 15:58
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
Copy link

codecov bot commented Dec 4, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.

📢 Thoughts on this report? Let us know!

@alexgrozav alexgrozav merged commit 7d32059 into main Dec 4, 2025
11 checks passed
@alexgrozav alexgrozav deleted the 64-ensure-the-default-key-when-creating-utilities-creates-the-utility-class-without-the-key branch December 4, 2025 14:06
@github-actions github-actions bot mentioned this pull request Dec 4, 2025
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.

Ensure the default key when creating utilities creates the utility class without the key

2 participants