Skip to content

refactor(postcss-syntax): switch from @griffel/babel-preset to @griffel/transform#810

Draft
layershifter wants to merge 1 commit into
microsoft:mainfrom
layershifter:refactor/next
Draft

refactor(postcss-syntax): switch from @griffel/babel-preset to @griffel/transform#810
layershifter wants to merge 1 commit into
microsoft:mainfrom
layershifter:refactor/next

Conversation

@layershifter

Copy link
Copy Markdown
Member

Summary

  • Extends @griffel/transform with metadata output (locations, comment directives) that postcss-syntax needs, eliminating the need for @griffel/babel-preset and its Babel dependency chain
  • Refactors @griffel/postcss-syntax to consume @griffel/transform directly — removes @babel/core, @babel/helper-plugin-utils, @griffel/babel-preset dependencies
  • Switches postcss-syntax from Jest to Vitest and from .ts to .mts source files

Test plan

  • npx nx run-many -t build -p transform postcss-syntax passes
  • npx nx run-many -t test -p transform postcss-syntax passes (95 tests: 73 transform + 22 postcss-syntax)
  • npx nx run-many -t type-check -p transform postcss-syntax passes

🤖 Generated with Claude Code

@github-actions

Copy link
Copy Markdown
Contributor

📊 Bundle size report

✅ No changes found

…el/transform

Eliminate the Babel dependency chain by having postcss-syntax consume
@griffel/transform directly. This required extending transform's output
with metadata (locations, comment directives) that the Babel
location-preset previously provided.

Transform changes:
- Add SourceLocation, CommentDirective, TransformMetadata types
- Collect call expression locations, slot locations, reset locations,
  and comment directives when generateMetadata is enabled
- Return metadata in TransformResult

postcss-syntax changes:
- Remove @babel/core, @babel/helper-plugin-utils, @griffel/babel-preset deps
- Add @griffel/transform dependency
- Delete location-preset.ts (functionality now in transform)
- Switch source to ESM to consume @griffel/transform synchronously
- Expose importsToTransform/functionsToTransform to configure module matching
- Switch from Jest to Vitest
- Fix type-check cwd (was pointing to babel-preset)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.

1 participant