Skip to content

Conversation

@nlemoine
Copy link
Contributor

Changes

The parser was failing to apply transforms when $type was declared at the token level. The code only checked for inheritedTypeNode (from group-level inheritance), but didn't check for token-level $type declarations.

How to Review

Should be non breaking, transform are still applied at group level.

However, people using the API might have now to deal with token level transforms.

@changeset-bot
Copy link

changeset-bot bot commented Sep 29, 2025

🦋 Changeset detected

Latest commit: 2ae9d20

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

This PR includes changesets to release 8 packages
Name Type
@terrazzo/parser Patch
@terrazzo/cli Patch
@terrazzo/plugin-css Patch
@terrazzo/plugin-js Patch
@terrazzo/plugin-sass Patch
@terrazzo/plugin-swift Patch
@terrazzo/plugin-tailwind Patch
@terrazzo/plugin-vanilla-extract 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

@nlemoine
Copy link
Contributor Author

nlemoine commented Sep 29, 2025

@drwpow Sorry for the PR flood, I started using many @terrazzo packages and found some tiny bugs 😄

Copy link
Collaborator

@Sidnioulz Sidnioulz left a comment

Choose a reason for hiding this comment

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

I can confirm the test fails without this code, and it also fails on my branch which has slightly reworked inherited type computation.

Token $type fields are ignored in parse, and the inherited and local types are only consolidated in validateTokenNode to produce a well-defined token.

@nlemoine if anything I'd just change the JSDoc comment a little bit to clarify that the change made affects transform specifically.

@nlemoine nlemoine force-pushed the fix-parser-transform branch from b3a0f7c to 2ae9d20 Compare September 30, 2025 20:05
Copy link
Collaborator

@drwpow drwpow left a comment

Choose a reason for hiding this comment

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

Keep the PRs coming, thank yoU!

@drwpow drwpow merged commit d96e0e5 into terrazzoapp:main Oct 1, 2025
4 checks passed
@github-actions github-actions bot mentioned this pull request Oct 1, 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.

3 participants