Skip to content

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

TypeScript

fix(cli): detect @stylexjs/unplugin as a StyleX compiler (#8564)

Nenad Božidarevića61449851340
diff --git a/.changeset/cli-detect-stylex-unplugin.md b/.changeset/cli-detect-stylex-unplugin.md
new file mode 100644
index 0000000000..233be65e40
--- /dev/null
+++ b/.changeset/cli-detect-stylex-unplugin.md
@@ -0,0 +1,7 @@
+---
+'@astryxdesign/cli': patch
+---
+
+[fix] `detectStylingSystem` recognizes `@stylexjs/unplugin` as a StyleX compiler, so projects compiling StyleX through the standard Vite path are detected as `stylex` instead of falling through to the `css` guidance.
+
+@nbozidarevic
diff --git a/packages/cli/foundation/agent-docs/agent-docs.mjs b/packages/cli/foundation/agent-docs/agent-docs.mjs
index 3c6b0f10d4..9633caca3b 100644
--- a/packages/cli/foundation/agent-docs/agent-docs.mjs
+++ b/packages/cli/foundation/agent-docs/agent-docs.mjs
@@ -673,6 +673,7 @@ export function detectStylingSystem(targetDir) {
'@stylexjs/rollup-plugin',
'@stylexjs/webpack-plugin',
'@stylexjs/nextjs-plugin',
+ '@stylexjs/unplugin',
'vite-plugin-stylex',
'unplugin-stylex',
'@stylexswc/unplugin',
diff --git a/packages/cli/foundation/agent-docs/agent-docs.test.mjs b/packages/cli/foundation/agent-docs/agent-docs.test.mjs
index 54dc8ab8da..5ad374a889 100644
--- a/packages/cli/foundation/agent-docs/agent-docs.test.mjs
+++ b/packages/cli/foundation/agent-docs/agent-docs.test.mjs
@@ -552,6 +552,11 @@ describe('detectStylingSystem', () => {
expect(detectStylingSystem(tmpDir)).toBe('stylex');
});
+ it('detects the official unplugin (the standard Vite path)', () => {
+ writePkg({'@stylexjs/unplugin': '0.10.0'});
+ expect(detectStylingSystem(tmpDir)).toBe('stylex');
+ });
+
it('detects tailwind when tailwindcss is present', () => {
writePkg({tailwindcss: '4.0.0'});
expect(detectStylingSystem(tmpDir)).toBe('tailwind');