Skip to content

An open source design system that's fully customizable and agent ready

TypeScript

build(core): make @stylexjs/stylex a required peerDependency (#3313)

Xinzi Zhou41cdf337412d
diff --git a/.changeset/stylex-runtime-peer-dependency.md b/.changeset/stylex-runtime-peer-dependency.md
new file mode 100644
index 0000000000..41e28e5627
--- /dev/null
+++ b/.changeset/stylex-runtime-peer-dependency.md
@@ -0,0 +1,7 @@
+---
+'@astryxdesign/core': patch
+---
+
+[chore] Move `@stylexjs/stylex` from `dependencies` to a required `peerDependency` (`^0.18.3`). A consumer who authors their own StyleX now shares a single runtime with astryx — resolution dedupes to their own install in both browser and Node — instead of silently getting a second copy on version drift. An incompatible StyleX version is now flagged at install (npm errors, pnpm/yarn warn) instead of resolving silently. Consumers who don't author StyleX are unaffected: the runtime is still required to render astryx components and is auto-installed by npm 7+ and pnpm.
+
+@imdreamrunner
diff --git a/packages/core/package.json b/packages/core/package.json
index 601eff6e15..afea99109e 100644
--- a/packages/core/package.json
+++ b/packages/core/package.json
@@ -639,12 +639,10 @@
"typecheck": "tsc --project tsconfig.json --noEmit"
},
"peerDependencies": {
+ "@stylexjs/stylex": "^0.18.3",
"react": ">=19.0.0",
"react-dom": ">=19.0.0"
},
- "dependencies": {
- "@stylexjs/stylex": "^0.18.3"
- },
"devDependencies": {
"@babel/cli": "^7.29.7",
"@babel/core": "^7.29.7",