Skip to content

Conversation

@alexgrozav
Copy link
Contributor

This pull request introduces the new @styleframe/runtime package, which provides a runtime utility for recipes, and updates the Recipe type to improve the handling of compound variants. It also includes supporting infrastructure for the new package and makes minor improvements and fixes across related documentation, tests, and type guards.

Major new feature: Runtime for recipes

  • Added the new @styleframe/runtime package, including its implementation (runtime.ts), tests, type exports, configuration, and supporting files. This package exposes a createRecipe function that generates utility class strings based on recipe definitions and variant props, supporting default values, variants, and compound variants. [1] [2] [3] [4] [5] [6] [7] [8] [9]

Type system improvements

  • Updated the Recipe type in @styleframe/core so that each compoundVariant now has a match property for matching variant conditions, making the structure clearer and more robust.
  • Added an isRecipe type guard function to help with runtime type checking of recipes. [1] [2]

Documentation and test updates

  • Updated documentation and tests to use the new match property in compoundVariants for recipes, ensuring clarity and correctness in examples and test cases. [1] [2] [3]

Transpiler and internal refactoring

  • Refactored and renamed certain files in the transpiler to use more consistent naming and imports, such as renaming consume/css/at-rule.ts and updating relevant imports. [1] [2] [3]

Release and changelog

  • Added a changeset to document the major release of @styleframe/runtime and minor updates to other related packages.

@alexgrozav alexgrozav requested a review from Copilot November 23, 2025 13:00
@alexgrozav alexgrozav self-assigned this Nov 23, 2025
@changeset-bot
Copy link

changeset-bot bot commented Nov 23, 2025

🦋 Changeset detected

Latest commit: 9a7a922

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

This PR includes changesets to release 6 packages
Name Type
@styleframe/runtime Major
@styleframe/transpiler Minor
@styleframe/plugin Minor
@styleframe/core Minor
@styleframe/cli Minor
styleframe Minor

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 Nov 23, 2025

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

Project Deployment Review Updated (UTC)
app-styleframe-dev-production Ready Ready Preview, Comment Dec 20, 2025 11:40am
styleframe-dev-production Ready Ready Preview, Comment Dec 20, 2025 11:40am

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 introduces the new @styleframe/runtime package to provide runtime recipe functionality for generating utility class strings based on variant props. It includes significant refactoring of the transpiler to support TypeScript generation for recipes and updates to the core type system to improve the structure of compound variants.

Key Changes:

  • Added @styleframe/runtime package with createRecipe function for runtime class name generation
  • Updated Recipe type to use a match property structure for compound variants
  • Refactored transpiler to generate TypeScript exports for recipes with proper imports and type annotations
  • Enhanced plugin logging to include file type in build messages

Reviewed changes

Copilot reviewed 50 out of 52 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
engine/runtime/* New package providing runtime recipe functionality with comprehensive test coverage
engine/transpiler/src/consume/ts/* New TypeScript consumer modules for generating recipe exports
engine/transpiler/src/consume/css/* Refactored import paths from relative to parent directory references
engine/transpiler/src/transpile.ts Updated to use new consume functions and pass full root to consumers
engine/core/src/types/tokens.ts Updated Recipe type to use explicit match property in compound variants
engine/core/src/typeGuards.ts Added isRecipe type guard
tooling/plugin/src/index.ts Enhanced logging to include file type
tooling/cli/src/commands/init.ts Added runtime package to default dependencies
Files not reviewed (1)
  • pnpm-lock.yaml: Language not supported

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

Comment on lines 6 to 8
/**
* Consumes a ref instance, equivalent to referencing a CSS variable with optional fallback
*/
Copy link

Copilot AI Nov 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The JSDoc comment is incorrect. This function consumes a Recipe instance, not a ref instance. The comment should be updated to: 'Consumes a recipe instance and generates TypeScript code for recipe export'.

Copilot uses AI. Check for mistakes.
Comment on lines 41 to 47
"homepage": "https://github.com/runtime-dev/runtime#readme",
"bugs": {
"url": "https://github.com/runtime-dev/runtime/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/runtime-dev/runtime.git"
Copy link

Copilot AI Nov 23, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The repository URLs point to 'runtime-dev/runtime' which appears to be incorrect. These should likely point to the styleframe repository (e.g., 'styleframe-dev/styleframe' or similar) to match the project structure.

Suggested change
"homepage": "https://github.com/runtime-dev/runtime#readme",
"bugs": {
"url": "https://github.com/runtime-dev/runtime/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/runtime-dev/runtime.git"
"homepage": "https://github.com/styleframe-dev/styleframe#readme",
"bugs": {
"url": "https://github.com/styleframe-dev/styleframe/issues"
},
"repository": {
"type": "git",
"url": "git+https://github.com/styleframe-dev/styleframe.git"

Copilot uses AI. Check for mistakes.
@codecov
Copy link

codecov bot commented Nov 23, 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