Skip to content

[codemods] Scaffold @stylexjs/codemods package + verification checks (Emotion→StyleX, 1/6)#1768

Open
ahmedsadid wants to merge 4 commits into
facebook:mainfrom
ahmedsadid:codemod/emotion-m0-scaffold
Open

[codemods] Scaffold @stylexjs/codemods package + verification checks (Emotion→StyleX, 1/6)#1768
ahmedsadid wants to merge 4 commits into
facebook:mainfrom
ahmedsadid:codemod/emotion-m0-scaffold

Conversation

@ahmedsadid

Copy link
Copy Markdown
Contributor

What changed / motivation ?

Adds the @stylexjs/codemods package — the foundation for an Emotion → StyleX
migration codemod (#1766). First of ~6 stacked PRs; this one is scaffolding and
test infrastructure only, with no transform logic yet, so it can be reviewed on
its own.

It sets up the package and the three checks every future conversion has to pass:

  • the output compiles through @stylexjs/babel-plugin,
  • it passes @stylexjs/eslint-plugin at error with no autofixes, and
  • its CSS matches the original Emotion output (via @emotion/serialize).

Each check is proven to fail on a deliberately-broken input, not only to pass on
a valid one.

The package is split into a shared engine (src/core/) and per-library adapters
(src/adapters/, Emotion first). core/ never imports from adapters/,
enforced by a test — so a new source library means a new adapter, not an engine
change. The transform itself lands in the next PR.

Linked PR/Issues

Part of #1766

Additional Context

6 test suites, all green. Two end-to-end fixture assertions are skipped until the
transform lands (PR 2). Changes outside the package: a .flowconfig mapping and
an .eslintrc.js ignore for the test fixtures, small flow_modules/ type
stubs, and yarn.lock.

Pre-flight checklist

  • I have read the contributing guidelines
  • Performed a self-review of my code

ahmedsadid and others added 4 commits July 23, 2026 17:03
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…te proven to fail on a broken pair

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@meta-cla meta-cla Bot added the CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed. label Jul 23, 2026
@vercel

vercel Bot commented Jul 23, 2026

Copy link
Copy Markdown

@ahmedsadid is attempting to deploy a commit to the Meta Open Source Team on Vercel.

A member of the Team first needs to authorize it.

@ahmedsadid

Copy link
Copy Markdown
Contributor Author
image

Prettier CI: failure is a pre-existing upstream line in eslint-plugin/.../cssProperties.js (#1760), untouched by this stack — unrelated to every PR in the series.

@ahmedsadid
ahmedsadid marked this pull request as ready for review July 24, 2026 00:35
@ahmedsadid
ahmedsadid requested review from mellyeliu and nmn as code owners July 24, 2026 00:35
@ahmedsadid
ahmedsadid force-pushed the codemod/emotion-m0-scaffold branch from d186625 to d485a6c Compare July 25, 2026 02:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

CLA Signed This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant