diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md new file mode 100644 index 00000000..9f68e7d5 --- /dev/null +++ b/CONTRIBUTING.md @@ -0,0 +1,74 @@ +# Contributing to solid-ui + +Thank you for helping improve Solid UI, the docs site, and `solidui-cli`. + +## Repository layout + +| Path | Purpose | +| ---- | ------- | +| `apps/docs` | solid-ui.com — registry source, MDX docs, examples | +| `packages/cli` | `solidui-cli` published to npm | + +## Local setup + +```bash +pnpm install +``` + +If `pnpm install` fails on older Corepack pnpm, use Node 22+ and `corepack prepare pnpm@9 --activate`, or install dependencies per-package. + +### Docs app + +```bash +pnpm --filter docs dev +``` + +### CLI + +```bash +cd packages/cli +pnpm install +pnpm build +node dist/index.js --help +``` + +## Registry changes + +1. Edit files under `apps/docs/src/registry/` (`ui/`, `example/`, `block/`). +2. Register entries in `registry-ui.ts`, `registry-examples.ts`, or `registry-blocks.ts`. +3. Rebuild published JSON: + +```bash +pnpm --filter docs build:registry +``` + +4. Commit both source **and** `apps/docs/public/registry/**` if your PR includes registry output (maintainers may run this on release). + +### Promoting examples to CLI-installable components + +- `solidui-cli add` only lists `type: "ui"` in `registry/index.json`. +- If the docs site uses a pattern in production (e.g. `mode-toggle`), add `registry/ui/.tsx` and an entry in `registry-ui.ts` with `registryDependencies` as needed. + +### Blocks + +- Define in `registry-blocks.ts` with SolidStart-friendly `target` paths (`src/routes/...`, `src/components/...`). +- Install via `solidui-cli add-block ` (after registry build). + +## Pull requests + +- Target `main` unless maintainers direct you to `dev` (Tailwind v4 migration). +- One feature per PR when possible (CLI change vs component fix vs docs). +- Link related issues (e.g. #229 sidebar / Tailwind). + +## Claiming work (V4 checklist) + +See [issue #199](https://github.com/stefan-karger/solid-ui/issues/199). Comment on the issue or open a draft PR with the component name you are implementing to avoid duplicate effort. + +## Fork testing the CLI against your registry + +```bash +cd packages/cli && pnpm build +SOLIDUI_REGISTRY_URL=https://your-preview.example.com node dist/index.js add mode-toggle +``` + +Deploy `apps/docs/public/registry` to that host or run docs locally and point the env var at `http://localhost:3000`. diff --git a/CONTRIBUTION-PLAN.md b/CONTRIBUTION-PLAN.md new file mode 100644 index 00000000..f8d5b022 --- /dev/null +++ b/CONTRIBUTION-PLAN.md @@ -0,0 +1,39 @@ +# solid-ui contribution execution plan + +Branch: `feat/cli-dx-and-registry` (fork: AMDphreak/solid-ui) + +## Quick wins + +- [x] `SOLIDUI_REGISTRY_URL` env var in CLI `registry.ts` +- [x] Docs/cli copy fixes (`componentDir`, `components.json` → `ui.config.json`) +- [x] `init --with-color-mode` (+ `COLOR_MODE.md` snippets for SolidStart / Vite) +- [x] `init -y`, `init --with-tailwind` (+ postcss.config.cjs) +- [x] `docs/dark-mode/tauri.mdx` + link from overview +- [x] `mode-toggle` UI component (merged from prior PR branch) + +## Medium + +- [x] `solidui-cli add-block ` + SolidStart-friendly block targets +- [x] `solidui-cli update [components...]` with overwrite +- [x] Sidebar: v3-compatible `w-[var(--*)]` classes + docs callout + +## Strategic + +- [x] `CONTRIBUTING.md` +- [x] `apps/docs/public/llms.txt` +- [x] Tailwind v3/v4 callout in CLI `COLOR_MODE.md`, sidebar docs, CONTRIBUTING + +## Skipped (per user) + +- UnoCSS support +- cva → tailwind-variants migration +- Full shadcn block parity in one PR +- Separate `command-palette` ui (`command` already exports `CommandDialog`) + +## Resume in a new chat + +```text +Continue solid-ui fork AMDphreak/solid-ui branch feat/cli-dx-and-registry. +Read CONTRIBUTION-PLAN.md. Run pnpm --filter docs build:registry, commit public/registry, +pnpm --filter solidui-cli build, push branch, open/update PR to stefan-karger/solid-ui. +``` diff --git a/apps/docs/public/llms.txt b/apps/docs/public/llms.txt new file mode 100644 index 00000000..412fdd59 --- /dev/null +++ b/apps/docs/public/llms.txt @@ -0,0 +1,33 @@ +# solid-ui + +> Unofficial SolidJS port of shadcn/ui — copy-paste components (Kobalte, corvu, Tailwind). + +## Docs + +- Site: https://www.solid-ui.com +- Introduction: https://www.solid-ui.com/docs/introduction +- CLI: https://www.solid-ui.com/docs/cli +- Installation (SolidStart): https://www.solid-ui.com/docs/installation/solid-start +- Dark mode (SolidStart): https://www.solid-ui.com/docs/dark-mode/solid-start +- Registry index: https://www.solid-ui.com/registry/index.json + +## CLI + +```bash +npx solidui-cli@latest init +npx solidui-cli@latest init -y --with-color-mode --with-tailwind +npx solidui-cli@latest add button mode-toggle +npx solidui-cli@latest add-block sidebar-01 +npx solidui-cli@latest update button +``` + +Environment: `SOLIDUI_REGISTRY_URL` overrides the registry host. + +## Stack + +- SolidJS, Kobalte, corvu, Tailwind CSS +- CLI scaffolds Tailwind v3 (`tailwind.config.cjs`); docs app may use Tailwind v4 + +## Repository + +https://github.com/stefan-karger/solid-ui diff --git a/apps/docs/src/components/mode-toggle.tsx b/apps/docs/src/components/mode-toggle.tsx index 6b4cbe33..072f3fb1 100644 --- a/apps/docs/src/components/mode-toggle.tsx +++ b/apps/docs/src/components/mode-toggle.tsx @@ -1,38 +1 @@ -import { useColorMode } from "@kobalte/core" - -import { IconLaptop, IconMoon, IconSun } from "~/components/icons" -import { Button } from "~/registry/ui/button" -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuTrigger -} from "~/registry/ui/dropdown-menu" - -export function ModeToggle() { - const { setColorMode } = useColorMode() - - return ( - - } variant="ghost" size="sm" class="w-9 px-0"> - - - Toggle theme - - - setColorMode("light")}> - - Light - - setColorMode("dark")}> - - Dark - - setColorMode("system")}> - - System - - - - ) -} +export { ModeToggle } from "~/registry/ui/mode-toggle" diff --git a/apps/docs/src/registry/example/mode-toggle.tsx b/apps/docs/src/registry/example/mode-toggle.tsx index 6bb6ebe4..7911f924 100644 --- a/apps/docs/src/registry/example/mode-toggle.tsx +++ b/apps/docs/src/registry/example/mode-toggle.tsx @@ -1,38 +1 @@ -import { useColorMode } from "@kobalte/core" - -import { IconLaptop, IconMoon, IconSun } from "~/components/icons" -import { Button } from "~/registry/ui/button" -import { - DropdownMenu, - DropdownMenuContent, - DropdownMenuItem, - DropdownMenuTrigger -} from "~/registry/ui/dropdown-menu" - -export default function ModeToggle() { - const { setColorMode } = useColorMode() - - return ( - - } variant="ghost" size="sm" class="w-9 px-0"> - - - Toggle theme - - - setColorMode("light")}> - - Light - - setColorMode("dark")}> - - Dark - - setColorMode("system")}> - - System - - - - ) -} +export { ModeToggle as default } from "~/registry/ui/mode-toggle" diff --git a/apps/docs/src/registry/registry-blocks.ts b/apps/docs/src/registry/registry-blocks.ts index c9281e2c..b6235404 100644 --- a/apps/docs/src/registry/registry-blocks.ts +++ b/apps/docs/src/registry/registry-blocks.ts @@ -10,19 +10,22 @@ export const blocks: Registry = [ { path: "block/sidebar-01/index.tsx", type: "page", - target: "app/dashboard/page.tsx" + target: "src/routes/dashboard/index.tsx" }, { path: "block/sidebar-01/components/app-sidebar.tsx", - type: "component" + type: "component", + target: "src/components/dashboard/app-sidebar.tsx" }, { path: "block/sidebar-01/components/search-form.tsx", - type: "component" + type: "component", + target: "src/components/dashboard/search-form.tsx" }, { path: "block/sidebar-01/components/version-switcher.tsx", - type: "component" + type: "component", + target: "src/components/dashboard/version-switcher.tsx" } ] }, @@ -32,7 +35,8 @@ export const blocks: Registry = [ files: [ { path: "block/demo-sidebar.tsx", - type: "component" + type: "component", + target: "src/components/demo-sidebar.tsx" } ] } diff --git a/apps/docs/src/registry/registry-ui.ts b/apps/docs/src/registry/registry-ui.ts index 0bcc7563..2f99e812 100644 --- a/apps/docs/src/registry/registry-ui.ts +++ b/apps/docs/src/registry/registry-ui.ts @@ -313,6 +313,18 @@ export const ui: Registry = [ } ] }, + { + name: "mode-toggle", + type: "ui", + dependencies: ["@kobalte/core", "lucide-solid"], + registryDependencies: ["button", "dropdown-menu"], + files: [ + { + path: "ui/mode-toggle.tsx", + type: "ui" + } + ] + }, { name: "navigation-menu", type: "ui", diff --git a/apps/docs/src/registry/ui/mode-toggle.tsx b/apps/docs/src/registry/ui/mode-toggle.tsx new file mode 100644 index 00000000..d5538ce7 --- /dev/null +++ b/apps/docs/src/registry/ui/mode-toggle.tsx @@ -0,0 +1,38 @@ +import { useColorMode } from "@kobalte/core" +import { Laptop, Moon, Sun } from "lucide-solid" + +import { Button } from "~/registry/ui/button" +import { + DropdownMenu, + DropdownMenuContent, + DropdownMenuItem, + DropdownMenuTrigger +} from "~/registry/ui/dropdown-menu" + +export function ModeToggle() { + const { setColorMode } = useColorMode() + + return ( + + } variant="ghost" size="sm" class="w-9 px-0"> + + + Toggle theme + + + setColorMode("light")}> + + Light + + setColorMode("dark")}> + + Dark + + setColorMode("system")}> + + System + + + + ) +} diff --git a/apps/docs/src/registry/ui/sidebar.tsx b/apps/docs/src/registry/ui/sidebar.tsx index c2e05d4e..ce309c2d 100644 --- a/apps/docs/src/registry/ui/sidebar.tsx +++ b/apps/docs/src/registry/ui/sidebar.tsx @@ -183,7 +183,7 @@ const Sidebar: Component = (rawProps) => {
= (rawProps) => { = (rawProps) => { {/* This is what handles the sidebar gap on desktop */}