refactor: remove core-ui from main (scaffoldable via gen core-package ui)
Removal across all three consumers: - apps/storybook: strips @repo/core-ui dep, clears stories glob (now []), removes globals.css import from preview.ts - apps/web-next: strips @repo/core-ui dep + transpilePackages entry - apps/web-tanstack: strips @repo/core-ui dep - packages/core-ui: deleted entirely (28 files) No app pages needed surgery — neither web-next nor web-tanstack source files imported @repo/core-ui directly. The storybook app referenced it only via the stories glob and the globals.css preview import. Gates: 40/40 tasks successful, all 4 e2e byte-identical reconstructions pass (realtime, events, trpc, ui). Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -1,67 +0,0 @@
|
||||
# AGENTS.md — core-ui
|
||||
|
||||
Design-system primitives organized by Atomic Design. Only **generic components** (atoms, molecules, generic organisms) live here. Feature-specific components live in their respective feature packages.
|
||||
|
||||
## Responsibilities
|
||||
|
||||
- **Atoms** — Single HTML elements: Button, Input, Label, Card
|
||||
- **Molecules** — Combinations: FormField (Label + Input), Badge, Avatar
|
||||
- **Generic Organisms** — Reusable complex layouts: Modal, Tabs, NavigationMenu, CommandPalette
|
||||
- **Templates** — Page layouts: AuthLayout, DashboardLayout, LandingLayout
|
||||
- **Utilities** — `cn()` for className merging, design tokens, Tailwind config
|
||||
|
||||
## Feature-specific boundary
|
||||
|
||||
Feature-specific organisms (e.g., `ArticleCard`, `ArticleList`, `HeaderNavMenu`) live in their feature's `ui/` folder, NOT here. This boundary keeps `core-ui` framework-agnostic and reusable.
|
||||
|
||||
## Must NOT import
|
||||
|
||||
- Any feature package (`@repo/auth`, `@repo/blog`, etc.)
|
||||
- Any app package
|
||||
- `@repo/core-api`, `@repo/core-cms`, `@repo/core-trpc`
|
||||
|
||||
> Note: `@repo/core-trpc` is an optional package scaffolded via `pnpm turbo gen core-package trpc`. If not present, this constraint still applies to any future installation.
|
||||
|
||||
## Public exports
|
||||
|
||||
From `package.json`:
|
||||
- `.` — all atoms, molecules, organisms, templates
|
||||
|
||||
Example usage:
|
||||
```typescript
|
||||
import { Button, Input, Label } from "@repo/core-ui";
|
||||
import { FormField } from "@repo/core-ui";
|
||||
import { Modal, Tabs } from "@repo/core-ui";
|
||||
```
|
||||
|
||||
## Test conventions
|
||||
|
||||
- Tests colocated: `src/atoms/button/button.tsx` → `src/atoms/button/button.test.tsx`
|
||||
- Vitest environment: `jsdom` (React component testing)
|
||||
- Alias: `@/` resolves to `src/`
|
||||
- Run: `pnpm test --filter @repo/core-ui`
|
||||
- Storybook stories colocated: `src/atoms/button/button.stories.tsx`
|
||||
|
||||
## Structure
|
||||
|
||||
```
|
||||
src/
|
||||
atoms/
|
||||
{name}/
|
||||
{name}.tsx # Component
|
||||
{name}.test.tsx # Tests
|
||||
{name}.stories.tsx # Storybook story
|
||||
index.ts # Barrel export
|
||||
molecules/
|
||||
{name}/
|
||||
...
|
||||
organisms/
|
||||
{name}/
|
||||
...
|
||||
templates/
|
||||
{name}/
|
||||
...
|
||||
lib/
|
||||
utils.ts # cn() and helpers
|
||||
index.ts # Re-exports everything
|
||||
```
|
||||
Reference in New Issue
Block a user