Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion e2e/sign-in-button.spec.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import { expect, test } from '@playwright/test';

const HEADER_SNAPSHOT_MAX_DIFF_PIXELS = 250;

test.describe('Sign in button', () => {
test('renders without issue', async ({ page }) => {
await page.goto('/');
Expand All @@ -13,6 +15,8 @@ test.describe('Sign in button', () => {

const header = page.locator('header').first();
await expect(header).toBeVisible();
await expect(header).toHaveScreenshot('header-sign-in.png');
await expect(header).toHaveScreenshot('header-sign-in.png', {
maxDiffPixels: HEADER_SNAPSHOT_MAX_DIFF_PIXELS,
});
});
});
21 changes: 21 additions & 0 deletions public/assets/library-icons/stylex.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
3 changes: 2 additions & 1 deletion src/lib/ingest/loaders/libraries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,9 +97,10 @@ export class LibrariesLoader implements ContentLoader {
// Data Tables (1 repository)
{ repo: 'TanStack/table', name: 'TanStack Table', category: 'Data Tables', tier: 'Tier 1' },

// Styling (2 repositories)
// Styling (3 repositories)
{ repo: 'styled-components/styled-components', name: 'styled-components', category: 'Styling', tier: 'Tier 1' },
{ repo: 'emotion-js/emotion', name: 'Emotion', category: 'Styling', tier: 'Tier 1' },
{ repo: 'facebook/stylex', name: 'StyleX', category: 'Styling', tier: 'Tier 2' },
];

async load(): Promise<RawRecord[]> {
Expand Down
17 changes: 16 additions & 1 deletion src/lib/library-icons.tsx
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
/**
* Icon mapping for all 55 React ecosystem libraries
* Icon mapping for all 56 React ecosystem libraries
* Uses Simple Icons via @icons-pack/react-simple-icons
*/

import Image from "next/image";
import {
SiReact,
SiRedux,
Expand Down Expand Up @@ -38,6 +39,18 @@ import {
// Simple Icons doesn't have all libraries, so we'll use fallback for missing ones
type IconComponent = React.ComponentType<{ size?: number; color?: string; className?: string }>;

function StylexIcon({ size = 20, className }: { size?: number; color?: string; className?: string }) {
return (
<Image
src="/assets/library-icons/stylex.svg"
alt="StyleX logo"
width={size}
height={size}
className={className}
/>
);
}

// Icon mapping by library repo name
export const libraryIcons: Record<string, IconComponent | null> = {
// Core React
Expand Down Expand Up @@ -121,6 +134,7 @@ export const libraryIcons: Record<string, IconComponent | null> = {
"styled-components": SiStyledcomponents,
emotion: null,
tailwindcss: SiTailwindcss,
stylex: StylexIcon,
nativewind: SiTailwindcss, // Use Tailwind logo for NativeWind
};

Expand Down Expand Up @@ -184,6 +198,7 @@ export const libraryDisplayNames: Record<string, string> = {
"styled-components": "Styled Components",
emotion: "Emotion",
tailwindcss: "Tailwind CSS",
stylex: "StyleX",
nativewind: "NativeWind",
};

Expand Down
35 changes: 34 additions & 1 deletion src/lib/maintainer-tiers.test.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
import { createElement } from 'react';
import { renderToStaticMarkup } from 'react-dom/server';
import { describe, expect, it } from 'vitest';

import { libraryDisplayNames } from './library-icons';
import { LibraryIcon, libraryDisplayNames } from './library-icons';
import { ecosystemLibraries } from './maintainer-tiers';
import { LibrariesLoader } from './ingest/loaders/libraries';
import { NPMCollector } from './ris/collectors/npm-collector';
Expand Down Expand Up @@ -60,4 +62,35 @@ describe('ecosystemLibraries', () => {
})
);
});

it('includes StyleX in related library datasets', async () => {
expect(findLibrary('facebook', 'stylex')).toMatchObject({
category: 'styling',
tier: 2,
});
expect(NPMCollector.getPackageName('facebook', 'stylex')).toBe('@stylexjs/stylex');
expect(libraryDisplayNames.stylex).toBe('StyleX');

const stylexIconMarkup = renderToStaticMarkup(
createElement(LibraryIcon, { libraryName: 'stylex', size: 24 })
);
expect(stylexIconMarkup).toContain('/assets/library-icons/stylex.svg');

expect(PROBE_REPOS).toContainEqual(
expect.objectContaining({
owner: 'facebook',
repo: 'stylex',
category: 'ui-library',
})
);

const loader = new LibrariesLoader();
const records = await loader.load();
expect(records).toContainEqual(
expect.objectContaining({
id: 'library-facebook-stylex',
title: 'StyleX',
})
);
});
});
3 changes: 2 additions & 1 deletion src/lib/maintainer-tiers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,11 @@ export const ecosystemLibraries: RepoTarget[] = [
// Data Tables (1 repo)
{ owner: "TanStack", name: "table", category: "tables", tier: 1 },

// Styling (4 repos)
// Styling (5 repos)
{ owner: "styled-components", name: "styled-components", category: "styling", tier: 1 },
{ owner: "emotion-js", name: "emotion", category: "styling", tier: 1 },
{ owner: "tailwindlabs", name: "tailwindcss", category: "styling", tier: 1 },
{ owner: "facebook", name: "stylex", category: "styling", tier: 2 },
{ owner: "marklawlor", name: "nativewind", category: "styling", tier: 2 },
];

Expand Down
1 change: 1 addition & 0 deletions src/lib/ris/collectors/npm-collector.ts
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ export class NPMCollector {
'facebook/hermes': null, // JavaScript engine (C++ binary, not on NPM)
'facebook/metro': 'metro',
'facebook/react-devtools': 'react-devtools',
'facebook/stylex': '@stylexjs/stylex',
'reactjs/react.dev': null, // Documentation website (not a library)
'reactjs/rfcs': null, // RFC repository (not a library)
'reduxjs/redux': 'redux',
Expand Down
1 change: 1 addition & 0 deletions src/lib/ris/data/probe-repos.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ export const PROBE_REPOS: ProbeRepo[] = [
{ owner: 'radix-ui', repo: 'primitives', stars: 16000, category: 'ui-library', description: 'Radix Primitives' },
{ owner: 'adobe', repo: 'react-spectrum', stars: 13000, category: 'ui-library', description: 'React Spectrum' },
{ owner: 'tailwindlabs', repo: 'headlessui', stars: 26000, category: 'ui-library', description: 'Headless UI' },
{ owner: 'facebook', repo: 'stylex', stars: 8000, category: 'ui-library', description: 'StyleX styling system' },
{ owner: 'ariakit', repo: 'ariakit', stars: 8000, category: 'ui-library', description: 'Ariakit' },
{ owner: 'mantine-dev', repo: 'mantine', stars: 27000, category: 'ui-library', description: 'Mantine' },
{ owner: 'palantir', repo: 'blueprint', stars: 21000, category: 'ui-library', description: 'Blueprint' },
Expand Down
Loading