Skip to content

Conversation

@alexgrozav
Copy link
Contributor

This pull request adds support for generic record types in the createUseVariable utility, making it more flexible and allowing usage with arbitrary value types instead of being restricted to TokenValue. The changes also update type definitions and the CLI package version accordingly.

Generic record support and type improvements

  • Updated the ExportKeys type in theme/src/types.ts to allow Record<string, unknown> instead of requiring TokenValue, enabling broader use cases for exported variable keys.
  • Refactored the createUseVariable function in theme/src/utils/createUseVariable.ts to accept a generic PropertyType, allowing defaults and transformations to work with any value type, not just TokenValue. [1] [2]

Package version and metadata

  • Bumped the CLI package version from 1.0.2 to 1.0.4 in tooling/cli/src/package.ts to reflect the new feature.
  • Added a changeset file documenting the new feature and affected packages. (.changeset/early-tires-change.md)

@alexgrozav alexgrozav self-assigned this Nov 9, 2025
@changeset-bot
Copy link

changeset-bot bot commented Nov 9, 2025

🦋 Changeset detected

Latest commit: e4830d3

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

This PR includes changesets to release 3 packages
Name Type
@styleframe/cli Patch
@styleframe/theme Patch
styleframe 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

@alexgrozav alexgrozav requested a review from Copilot November 9, 2025 20:28
@vercel
Copy link

vercel bot commented Nov 9, 2025

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

Project Deployment Preview Comments Updated (UTC)
styleframe-dev-production Ready Ready Preview Comment Nov 9, 2025 8:29pm

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 enhances the type system for createUseVariable by introducing a generic PropertyType parameter, allowing for more flexible and type-safe handling of token values while maintaining backward compatibility.

  • Adds PropertyType generic parameter to createUseVariable for improved type constraints
  • Relaxes ExportKeys utility type constraint from TokenValue to unknown for better flexibility
  • Updates CLI version from 1.0.2 to 1.0.4

Reviewed Changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
tooling/cli/src/package.ts Bumps CLI version to 1.0.4 to match package.json
theme/src/utils/createUseVariable.ts Introduces PropertyType generic parameter for enhanced type safety and applies it consistently to function signatures
theme/src/types.ts Relaxes ExportKeys constraint to unknown for greater flexibility as a utility type, removes unused TokenValue import
.changeset/early-tires-change.md Documents the feature addition with appropriate patch version bumps

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

@codecov
Copy link

codecov bot commented Nov 9, 2025

Codecov Report

❌ Patch coverage is 66.66667% with 1 line in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
tooling/cli/src/package.ts 0.00% 0 Missing and 1 partial ⚠️

📢 Thoughts on this report? Let us know!

@alexgrozav alexgrozav merged commit 7e3d008 into main Nov 9, 2025
15 of 16 checks passed
@alexgrozav alexgrozav deleted the generic-create-use-variable-types branch November 9, 2025 20:35
@github-actions github-actions bot mentioned this pull request Nov 9, 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.

2 participants