@grove-dev/cli 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -10
- package/dist/audit-cli.d.ts +1 -1
- package/dist/audit-cli.d.ts.map +1 -1
- package/dist/audit-cli.js +11 -11
- package/dist/audit-cli.js.map +1 -1
- package/dist/audit.d.ts +4 -4
- package/dist/audit.d.ts.map +1 -1
- package/dist/audit.js +91 -51
- package/dist/audit.js.map +1 -1
- package/dist/collection-cli.d.ts.map +1 -1
- package/dist/collection-cli.js +1 -1
- package/dist/collection-cli.js.map +1 -1
- package/dist/diff.d.ts +43 -0
- package/dist/diff.d.ts.map +1 -0
- package/dist/diff.js +70 -0
- package/dist/diff.js.map +1 -0
- package/dist/hash.d.ts +36 -0
- package/dist/hash.d.ts.map +1 -0
- package/dist/hash.js +82 -0
- package/dist/hash.js.map +1 -0
- package/dist/icons-cli.d.ts +1 -1
- package/dist/icons-cli.d.ts.map +1 -1
- package/dist/icons-cli.js +32 -14
- package/dist/icons-cli.js.map +1 -1
- package/dist/import-cli.d.ts +1 -1
- package/dist/import-cli.d.ts.map +1 -1
- package/dist/import-cli.js +6 -6
- package/dist/import-cli.js.map +1 -1
- package/dist/index.js +84 -60
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +37 -4
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +251 -57
- package/dist/init.js.map +1 -1
- package/dist/package.json +3 -2
- package/dist/r/about.json +22 -0
- package/dist/r/browse.json +89 -0
- package/dist/r/collections.json +59 -0
- package/dist/r/contributors.json +22 -0
- package/dist/r/default.json +438 -0
- package/dist/r/home.json +67 -0
- package/dist/r/not-found.json +22 -0
- package/dist/r/project-card.json +48 -0
- package/dist/r/record.json +59 -0
- package/dist/r/registry.json +903 -0
- package/dist/r/shell.json +75 -0
- package/dist/r/submit.json +28 -0
- package/dist/r/taxonomy.json +65 -0
- package/dist/r/ui.json +54 -0
- package/dist/readme-cli.d.ts +1 -1
- package/dist/readme-cli.d.ts.map +1 -1
- package/dist/readme-cli.js +37 -47
- package/dist/readme-cli.js.map +1 -1
- package/dist/registry.d.ts +74 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +180 -0
- package/dist/registry.js.map +1 -0
- package/dist/run.d.ts +7 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +20 -0
- package/dist/run.js.map +1 -0
- package/dist/unified-diff.d.ts +14 -0
- package/dist/unified-diff.d.ts.map +1 -0
- package/dist/unified-diff.js +103 -0
- package/dist/unified-diff.js.map +1 -0
- package/dist/update.d.ts +47 -0
- package/dist/update.d.ts.map +1 -0
- package/dist/update.js +231 -0
- package/dist/update.js.map +1 -0
- package/package.json +5 -4
- package/dist/site/.github/ISSUE_TEMPLATE/bug_report.md +0 -33
- package/dist/site/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/dist/site/.github/ISSUE_TEMPLATE/record_submission.md +0 -48
- package/dist/site/.github/pull_request_template.md +0 -27
- package/dist/site/.github/workflows/ci.yml +0 -21
- package/dist/site/.github/workflows/cleanup.yml +0 -27
- package/dist/site/.github/workflows/deploy.yml +0 -36
- package/dist/site/.github/workflows/readme.yml +0 -41
- package/dist/site/.github/workflows/sync-contributors.yml +0 -28
- package/dist/site/.github/workflows/sync-github.yml +0 -31
- package/dist/site/README.md +0 -89
- package/dist/site/astro.config.mjs +0 -26
- package/dist/site/content/records/crewai.md +0 -898
- package/dist/site/content/records/dify.md +0 -35
- package/dist/site/content/records/flowise.md +0 -38
- package/dist/site/content/records/llamaindex.md +0 -45
- package/dist/site/content/records/ollama.md +0 -39
- package/dist/site/content/records/open-webui.md +0 -35
- package/dist/site/data/collections/top-ai-agents.yml +0 -14
- package/dist/site/data/collections/top-flutter.yml +0 -12
- package/dist/site/data/health.yml +0 -13
- package/dist/site/data/records/.gitkeep +0 -0
- package/dist/site/data/records/crewai.yml +0 -23
- package/dist/site/data/records/dify.yml +0 -23
- package/dist/site/data/records/flowise.yml +0 -23
- package/dist/site/data/records/llamaindex.yml +0 -23
- package/dist/site/data/records/ollama.yml +0 -30
- package/dist/site/data/records/open-webui.yml +0 -23
- package/dist/site/data/taxonomy/categories.yml +0 -10
- package/dist/site/data/taxonomy/distribution-channels.yml +0 -43
- package/dist/site/data/taxonomy/licenses.yml +0 -16
- package/dist/site/data/taxonomy/platforms.yml +0 -20
- package/dist/site/data/taxonomy/stacks.yml +0 -15
- package/dist/site/data/taxonomy/topics.yml +0 -29
- package/dist/site/grove.config.ts +0 -110
- package/dist/site/package.json +0 -34
- package/dist/site/public/icons/.grove-icons.json +0 -47
- package/dist/site/public/icons/platforms/android.svg +0 -1
- package/dist/site/public/icons/platforms/app.svg +0 -4
- package/dist/site/public/icons/platforms/chrome.svg +0 -1
- package/dist/site/public/icons/platforms/desktop.svg +0 -4
- package/dist/site/public/icons/platforms/embedded.svg +0 -5
- package/dist/site/public/icons/platforms/ios.svg +0 -1
- package/dist/site/public/icons/platforms/linux.svg +0 -1
- package/dist/site/public/icons/platforms/macos.svg +0 -1
- package/dist/site/public/icons/platforms/ubuntu.svg +0 -1
- package/dist/site/public/icons/platforms/web.svg +0 -5
- package/dist/site/public/icons/platforms/windows.svg +0 -1
- package/dist/site/public/icons/stacks/android.svg +0 -1
- package/dist/site/public/icons/stacks/apple.svg +0 -1
- package/dist/site/public/icons/stacks/bun.svg +0 -1
- package/dist/site/public/icons/stacks/capacitor.svg +0 -1
- package/dist/site/public/icons/stacks/clojure.svg +0 -1
- package/dist/site/public/icons/stacks/dart.svg +0 -1
- package/dist/site/public/icons/stacks/deno.svg +0 -1
- package/dist/site/public/icons/stacks/django.svg +0 -1
- package/dist/site/public/icons/stacks/docker.svg +0 -1
- package/dist/site/public/icons/stacks/firebase.svg +0 -1
- package/dist/site/public/icons/stacks/flutter.svg +0 -1
- package/dist/site/public/icons/stacks/go.svg +0 -1
- package/dist/site/public/icons/stacks/graphql.svg +0 -1
- package/dist/site/public/icons/stacks/ionic.svg +0 -1
- package/dist/site/public/icons/stacks/java.svg +0 -1
- package/dist/site/public/icons/stacks/javascript.svg +0 -1
- package/dist/site/public/icons/stacks/kotlin.svg +0 -1
- package/dist/site/public/icons/stacks/llm.svg +0 -4
- package/dist/site/public/icons/stacks/mongodb.svg +0 -1
- package/dist/site/public/icons/stacks/nodejs.svg +0 -1
- package/dist/site/public/icons/stacks/python.svg +0 -1
- package/dist/site/public/icons/stacks/rag.svg +0 -6
- package/dist/site/public/icons/stacks/react-native.svg +0 -1
- package/dist/site/public/icons/stacks/react.svg +0 -1
- package/dist/site/public/icons/stacks/rust.svg +0 -1
- package/dist/site/public/icons/stacks/solidity.svg +0 -1
- package/dist/site/public/icons/stacks/sveltekit.svg +0 -1
- package/dist/site/public/icons/stacks/swift.svg +0 -1
- package/dist/site/public/icons/stacks/tauri.svg +0 -1
- package/dist/site/public/icons/stacks/tensorflow.svg +0 -1
- package/dist/site/public/icons/stacks/typescript.svg +0 -1
- package/dist/site/public/icons/stacks/vue.svg +0 -1
- package/dist/site/public/logo.svg +0 -16
- package/dist/site/src/components/DirectoryBrowse.astro +0 -246
- package/dist/site/src/components/PipelineStrip.astro +0 -121
- package/dist/site/src/components/TaxonomyList.astro +0 -108
- package/dist/site/src/pages/404.astro +0 -63
- package/dist/site/src/pages/[slug]/[recordSlug].astro +0 -71
- package/dist/site/src/pages/[slug]/index.astro +0 -19
- package/dist/site/src/pages/[slug]/page/[page].astro +0 -32
- package/dist/site/src/pages/[slug]/page/cards.astro +0 -50
- package/dist/site/src/pages/[slug]/page/records.json.ts +0 -24
- package/dist/site/src/pages/about.astro +0 -130
- package/dist/site/src/pages/categories/[name].astro +0 -35
- package/dist/site/src/pages/categories/index.astro +0 -33
- package/dist/site/src/pages/collections/[slug].astro +0 -45
- package/dist/site/src/pages/collections/index.astro +0 -32
- package/dist/site/src/pages/contributors.astro +0 -115
- package/dist/site/src/pages/empty.astro +0 -24
- package/dist/site/src/pages/index.astro +0 -161
- package/dist/site/src/pages/licenses/[name].astro +0 -35
- package/dist/site/src/pages/stacks/[name].astro +0 -35
- package/dist/site/src/pages/stacks/index.astro +0 -35
- package/dist/site/src/pages/submit.astro +0 -183
- package/dist/site/src/styles/global.css +0 -21
- package/dist/site/tsconfig.json +0 -13
- /package/{dist/site/LICENSE → LICENSE} +0 -0
package/dist/r/home.json
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "home",
|
|
4
|
+
"title": "Home page",
|
|
5
|
+
"description": "The landing route: hero with search and trust stats, the why-this-exists and pipeline story sections, three lens sections (trending / new / established), contributors, lineage, and the closing CTA.",
|
|
6
|
+
"registryDependencies": [
|
|
7
|
+
"@grove/shell",
|
|
8
|
+
"@grove/project-card",
|
|
9
|
+
"@grove/ui",
|
|
10
|
+
"@grove/taxonomy",
|
|
11
|
+
"@grove/collections"
|
|
12
|
+
],
|
|
13
|
+
"files": [
|
|
14
|
+
{
|
|
15
|
+
"path": "default/pages/index.astro",
|
|
16
|
+
"content": "---\nimport records from '@grove/generated/records.json';\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getCollectionTeaserModel,\n getHomePageModel,\n loadCollections,\n recordsToCollectionEntries,\n} from '@grove-dev/astro/server';\nimport CategoryGrid from '../components/grove/category-grid.astro';\nimport CollectionTeaser from '../components/grove/collection-teaser.astro';\nimport ContributorsGrid from '../components/grove/contributors-grid.astro';\nimport FinalCta from '../components/grove/final-cta.astro';\nimport Hero from '../components/grove/hero.astro';\nimport OriginalCollection from '../components/grove/original-collection.astro';\nimport PipelineStrip from '../components/grove/pipeline-strip.astro';\nimport RecordSection from '../components/grove/record-section.astro';\nimport StackGrid from '../components/grove/stack-grid.astro';\nimport WhyThisExists from '../components/grove/why-this-exists.astro';\n/**\n * Home page — generic.\n *\n * Mirrors the openapps structure: Hero → WhyThisExists → three\n * lens sections (hot / new / mature) → StackGrid → CategoryGrid →\n * ContributorsGrid → OriginalCollection.\n *\n * All data derives from `data/generated/records.{index,full}.json`\n * and `data/generated/site-config.json`. Nothing here is hardcoded\n * to a specific blueprint — section copy uses singular/plural\n * labels from `itemLabel()`/`itemLabelPlural()`.\n */\nimport BaseLayout from '../layouts/base-layout.astro';\n\nconst home = getHomePageModel(siteConfig);\nconst { slug, itemSingular, itemPlural } = home;\n\n// ── Lens sectioning (Hot / New / Mature) ────────────────────────\nconst hotList = home.hot;\nconst newList = home.recentlyAdded;\nconst matureList = home.established;\n\nconst { stacks, categories } = home;\n\nconst { contributors, stats, title, description } = home;\n\n// ── Featured collections teaser ─────────────────────────────────\nconst allCollections = await loadCollections(process.cwd());\nconst teaserEntries = recordsToCollectionEntries(\n (records as { records: unknown[] }).records as never,\n siteConfig,\n);\nconst collectionTeaser = getCollectionTeaserModel(allCollections, teaserEntries, 3);\n---\n\n<BaseLayout title={title} description={description} image={home.seo.image} site={siteConfig}>\n <Hero\n name={`Find ${itemPlural} you can actually`}\n tagline=\"run, study, and contribute to.\"\n description={`Every listing is a YAML file in a public repository — Grove publishes those files as this site, a README, and machine-readable outputs, and keeps them in sync.`}\n eyebrow=\"Curated in plain files, published by Grove\"\n stats={{\n totalApps: stats.apps,\n totalCategories: stats.categories,\n totalStacks: stats.stacks,\n totalOwners: stats.owners,\n totalStars: stats.stars,\n }}\n itemsLabel={itemPlural}\n searchHref={`/${slug}`}\n searchPlaceholder={`Search ${itemPlural}, stacks, or categories...`}\n quickFilters={[\n { label: `Trending ${itemPlural}`, href: `/${slug}?label=hot` },\n { label: \"Recently added\", href: `/${slug}?sort=recently-added` },\n { label: \"How this site works\", href: \"#pipeline\" },\n ]}\n ctas={[\n { label: `Browse ${itemPlural}`, href: `/${slug}`, variant: \"primary\" },\n ]}\n />\n\n <WhyThisExists />\n\n <PipelineStrip repoUrl={siteConfig.repoUrl} />\n\n <RecordSection\n id=\"hot\"\n title=\"Trending now\"\n description={`${itemPlural.charAt(0).toUpperCase() + itemPlural.slice(1)} gaining stars, activity, or attention recently.`}\n eyebrow=\"Hot\"\n items={hotList}\n hrefFor={(r) => `/${slug}/${r.slug}`}\n viewAllHref={`/${slug}?label=hot`}\n viewAllLabel={`View all trending ${itemPlural}`}\n />\n\n <RecordSection\n id=\"new\"\n title=\"Recently added\"\n description={`${itemPlural.charAt(0).toUpperCase() + itemPlural.slice(1)} added to the directory in the last few weeks.`}\n eyebrow=\"New\"\n items={newList}\n hrefFor={(r) => `/${slug}/${r.slug}`}\n viewAllHref={`/${slug}?sort=recently-added`}\n viewAllLabel={`View all recently added`}\n />\n\n <RecordSection\n id=\"mature\"\n title=\"Established\"\n description={`Long-running curated ${itemPlural} with strong history, active maintainers, and real-world usage.`}\n eyebrow=\"Mature\"\n items={matureList}\n hrefFor={(r) => `/${slug}/${r.slug}`}\n viewAllHref={`/${slug}?label=mature`}\n viewAllLabel={`View all established`}\n />\n\n <StackGrid\n stacks={stacks}\n pathPrefix={`/${slug}`}\n itemLabelPlural={itemPlural}\n itemNoun={{ singular: itemSingular, plural: itemPlural }}\n hrefFor={(stackSlug: string) => `/stacks/${stackSlug}`}\n />\n <CollectionTeaser\n model={collectionTeaser}\n countNoun={{ singular: itemSingular, plural: itemPlural }}\n />\n <CategoryGrid\n categories={categories}\n pathPrefix={`/${slug}`}\n itemLabelPlural={itemPlural}\n itemNoun={{ singular: itemSingular, plural: itemPlural }}\n hrefFor={(categorySlug: string) => `/categories/${categorySlug}`}\n />\n\n <ContributorsGrid\n contributors={contributors}\n total={contributors.length || undefined}\n viewAllHref={`/contributors`}\n viewAllLabel=\"Meet the community\"\n showContributionCount={siteConfig.contributors?.showContributionCount ?? true}\n />\n\n {siteConfig.stats?.originalRepo && (\n <OriginalCollection\n repoUrl={siteConfig.stats.originalRepo}\n stats={{\n stars: siteConfig.stats.originalStars,\n forks: siteConfig.stats.originalForks,\n contributors: siteConfig.stats.originalContributors,\n }}\n />\n )}\n\n <FinalCta\n itemLabel={itemSingular}\n itemsLabel={itemPlural}\n browseHref={`/${slug}`}\n />\n</BaseLayout>\n",
|
|
17
|
+
"type": "registry:page",
|
|
18
|
+
"target": "~/src/pages/index.astro"
|
|
19
|
+
},
|
|
20
|
+
{
|
|
21
|
+
"path": "default/components/grove/hero.astro",
|
|
22
|
+
"content": "---\nimport { compact } from '@grove-dev/core';\n/**\n * Hero — the home page banner.\n *\n * Mirrors the openapps layout: trust-stats row across the top,\n * big two-line headline with a gradient accent on the second\n * line, descriptive paragraph, search form with a Filters\n * shortcut, quick-filter chips, and up to 3 CTAs.\n *\n * Generic: every value comes through props (or `siteConfig` for\n * the trust stats). The label next to the count is blueprint-\n * driven via `itemsLabel` — so a project-directory renders\n * \"apps indexed\", a resource-hub renders \"resources indexed\",\n * an ecosystem-map renders \"entities indexed\".\n */\nimport Container from '../../layouts/container.astro';\n\ninterface CTA {\n label: string;\n href: string;\n variant?: 'primary' | 'outline' | 'ghost';\n external?: boolean;\n}\n\ninterface Props {\n /** Site/brand name. */\n name: string;\n /** Short tagline — usually pulled from siteConfig.tagline. */\n tagline: string;\n /** Longer descriptive paragraph. */\n description?: string;\n /** Trust stats: items count, categories, stacks, owners, stars. */\n stats?: {\n totalApps?: number;\n totalCategories?: number;\n totalStacks?: number;\n totalOwners?: number;\n totalStars?: number;\n };\n /** Search form target — the list page. */\n searchHref?: string;\n /** Search input placeholder. */\n searchPlaceholder?: string;\n /**\n * Plural noun for the primary count (e.g. \"apps\", \"resources\",\n * \"entities\"). Used in the trust-stats label and CTA copy.\n */\n itemsLabel?: string;\n /** Quick filter chips under the search bar. */\n quickFilters?: Array<{ label: string; href: string }>;\n /** CTAs rendered below the form. */\n ctas?: CTA[];\n /** Extra class. */\n class?: string;\n /** Eyebrow text rendered above the title. */\n eyebrow?: string;\n /** Optional badge content rendered next to the eyebrow. */\n eyebrowBadge?: string;\n}\n\nconst {\n name,\n tagline,\n description,\n stats = {},\n searchHref = '/',\n searchPlaceholder = 'Search the directory...',\n itemsLabel = 'items',\n quickFilters = [],\n ctas = [],\n class: className = '',\n eyebrow = 'A directory of curated knowledge',\n eyebrowBadge,\n} = Astro.props;\n\n// One compact stats line: \"6 projects indexed · 5 categories · 3 stacks\".\n// Every entry is guarded so a fresh directory never renders a zero-value.\nconst statParts: string[] = [\n ...(stats.totalApps !== undefined && stats.totalApps > 0\n ? [`${compact(stats.totalApps)} ${itemsLabel} indexed`]\n : []),\n ...(stats.totalCategories !== undefined && stats.totalCategories > 0\n ? [`${stats.totalCategories} categories`]\n : []),\n ...(stats.totalStacks !== undefined && stats.totalStacks > 0\n ? [`${stats.totalStacks} stacks`]\n : []),\n ...(stats.totalOwners !== undefined && stats.totalOwners > 0\n ? [`${compact(stats.totalOwners)} owners`]\n : []),\n ...(stats.totalStars !== undefined && stats.totalStars > 0\n ? [`${compact(stats.totalStars)} stars`]\n : []),\n];\n\n// One primary CTA only — Submit already lives in the navbar\n// (BaseLayout → Header submitHref), so the hero never duplicates it.\nconst primaryCta: CTA | undefined = ctas.find((c) => c.variant === 'primary') ??\n ctas[0] ?? { label: `Browse ${itemsLabel}`, href: searchHref, variant: 'primary' };\n---\n\n<section\n class:list={[\n \"relative overflow-hidden border-b border-ink-200 dark:border-ink-800\",\n className,\n ]}\n>\n {/* Dark mode only: a barely-there radial lift behind the headline. */}\n <div\n aria-hidden=\"true\"\n class=\"pointer-events-none absolute inset-0 hidden dark:block\"\n style=\"background: radial-gradient(60% 55% at 50% 0%, color-mix(in oklab, var(--grove-foreground) 5%, transparent) 0%, transparent 70%);\"\n ></div>\n\n <Container>\n <div class=\"relative mx-auto flex max-w-[900px] flex-col items-center py-[88px] text-center lg:py-[104px]\">\n {/* Eyebrow. The `eyebrow` slot replaces the whole line — dot\n included — so a consumer can put richer content here (a\n `PoweredBy` link, a release badge) without forking the Hero. */}\n <span class=\"inline-flex animate-fade-in items-center gap-2 text-[13px] font-medium text-ink-500 dark:text-ink-400\">\n <slot name=\"eyebrow\">\n <span aria-hidden=\"true\" class=\"inline-block h-1.5 w-1.5 animate-pulse rounded-full bg-success\"></span>\n {eyebrow}\n {eyebrowBadge && (\n <span\n class=\"inline-flex items-center rounded-full border border-warning/30 bg-warning/10 px-1.5 py-0.5 text-[10px] font-semibold uppercase tracking-wider text-warning\"\n aria-label={eyebrowBadge}\n >\n {eyebrowBadge}\n </span>\n )}\n </slot>\n </span>\n\n {/* Headline */}\n <h1\n class=\"m-0 mt-5 max-w-[820px] animate-fade-in-up text-balance text-[clamp(44px,5vw,64px)] font-[650] leading-[1.08] tracking-[-0.035em] text-ink-900 dark:text-ink-100\"\n style=\"animation-delay: 0.05s;\"\n >\n <span class=\"block\">{name}</span>\n <span class=\"block\">{tagline}</span>\n </h1>\n\n {description && (\n <p\n class=\"m-0 mt-5 max-w-[640px] animate-fade-in-up text-[16px] leading-[1.6] text-ink-500 dark:text-ink-400\"\n style=\"animation-delay: 0.1s;\"\n >\n {description}\n </p>\n )}\n\n {/* Search — primary interaction. The FORM is the visual control:\n it owns the border, radius, and the single focus treatment\n (focus-within border + soft ring). The inner input opts out\n of the global input styling (`grove-input-unstyled`) so it\n stays a transparent, chrome-free text slot — no second box\n or ring appearing inside the pill on focus. */}\n <form\n class=\"mt-8 flex h-[58px] w-full max-w-[840px] animate-fade-in-up items-center gap-3 rounded-xl border border-ink-200 bg-background p-1.5 pl-4 transition-[border-color,box-shadow] focus-within:border-ink-400 focus-within:ring-3 focus-within:ring-ring/15 dark:border-ink-800 dark:focus-within:border-ink-600\"\n style=\"animation-delay: 0.15s;\"\n role=\"search\"\n action={searchHref}\n method=\"get\"\n >\n <label class=\"flex min-w-0 flex-1 items-center gap-3\">\n <span class=\"sr-only\">Search {itemsLabel}, stacks, and categories</span>\n <svg viewBox=\"0 0 16 16\" width=\"20\" height=\"20\" aria-hidden=\"true\" class=\"shrink-0 text-ink-400 dark:text-ink-500\" fill=\"currentColor\">\n <path d=\"M10.68 11.74a6 6 0 0 1-7.922-8.982 6 6 0 0 1 8.982 7.922l3.04 3.04a.749.749 0 0 1-.326 1.275.749.749 0 0 1-.734-.215ZM11.5 7a4.499 4.499 0 1 0-8.997 0A4.499 4.499 0 0 0 11.5 7Z\"></path>\n </svg>\n <input\n type=\"search\"\n name=\"q\"\n placeholder={searchPlaceholder}\n class=\"grove-input-unstyled h-full w-full min-w-0 rounded-none border-0 bg-transparent px-0 text-[16px] text-ink-900 outline-none placeholder:text-ink-400 dark:text-ink-100 dark:placeholder:text-ink-500\"\n />\n </label>\n <button\n type=\"submit\"\n class=\"inline-flex h-[46px] shrink-0 cursor-pointer items-center justify-center rounded-lg border border-transparent bg-primary px-5 text-[15px] font-medium leading-none text-primary-foreground outline-none transition-colors hover:bg-primary/90 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/35\"\n >\n Search\n </button>\n </form>\n\n {quickFilters.length > 0 && (\n <p class=\"m-0 mt-4 text-[13px] text-ink-500 dark:text-ink-400\">\n Try{\" \"}\n {quickFilters.map((f, i) => (\n <>\n <a href={f.href} class=\"font-mono text-ink-700 underline-offset-2 hover:underline dark:text-ink-300\">{f.label}</a>\n {i < quickFilters.length - 1 && <span aria-hidden=\"true\" class=\"mx-1\">·</span>}\n </>\n ))}\n </p>\n )}\n\n {/* Inline stats — single compact line, middle-dot separators */}\n {statParts.length > 0 && (\n <p class=\"m-0 mt-5 text-[13px] text-ink-500 dark:text-ink-400\">\n {statParts.map((part, i) => (\n <>\n {i > 0 && <span aria-hidden=\"true\" class=\"mx-2 opacity-60\">·</span>}\n <span>{part}</span>\n </>\n ))}\n </p>\n )}\n\n {/* Primary CTA only */}\n {primaryCta && (\n <div class=\"mt-8\">\n <a\n href={primaryCta.href}\n class=\"inline-flex h-11 cursor-pointer items-center justify-center gap-2 rounded-[var(--radius)] border border-transparent bg-primary px-5 text-[15px] font-medium leading-none text-primary-foreground outline-none transition-colors hover:bg-primary/90 focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/35\"\n {...(primaryCta.external ? { target: \"_blank\", rel: \"noopener noreferrer\" } : {})}\n data-event=\"hero_cta_click\"\n data-event-source=\"hero\"\n >\n {primaryCta.label}\n <svg viewBox=\"0 0 24 24\" width=\"16\" height=\"16\" fill=\"none\" stroke=\"currentColor\" stroke-width=\"2\" stroke-linecap=\"round\" stroke-linejoin=\"round\" aria-hidden=\"true\">\n <path d=\"M5 12h14\"></path>\n <path d=\"m12 5 7 7-7 7\"></path>\n </svg>\n </a>\n </div>\n )}\n </div>\n </Container>\n</section>\n",
|
|
23
|
+
"type": "registry:component",
|
|
24
|
+
"target": "~/src/components/grove/hero.astro"
|
|
25
|
+
},
|
|
26
|
+
{
|
|
27
|
+
"path": "default/components/grove/why-this-exists.astro",
|
|
28
|
+
"content": "---\n/**\n * WhyThisExists — the \"what is this site for?\" section.\n *\n * Renders 3 short, opinionated points (icon + title + body). The\n * icon set is small and generic: \"item\" (window/grid glyph),\n * \"code\" (angle brackets), \"search\" (magnifier). Defaults to\n * the canonical \"directory, source, search\" trio.\n *\n * Generic: every point comes through props. No blueprint-specific\n * copy. Consumers can pass `points` to swap the order or copy.\n */\n\ninterface WhyPoint {\n title: string;\n body: string;\n icon: 'item' | 'code' | 'search';\n}\n\ninterface Props {\n points?: WhyPoint[];\n eyebrow?: string;\n title?: string;\n description?: string;\n class?: string;\n}\n\nconst {\n points,\n eyebrow = 'Why this exists',\n title = 'Most directory discovery is fragmented.',\n description = 'Lists are useful, but they often become long, static pages without enough context to compare what is real, maintained, and worth exploring.',\n class: className = '',\n} = Astro.props;\n\nconst defaultPoints: WhyPoint[] = [\n {\n icon: 'item',\n title: 'Real projects',\n body: 'Not SDKs, templates, or tiny demos. Focused on complete projects you can actually run.',\n },\n {\n icon: 'code',\n title: 'Codebase context',\n body: 'Stack, platform, license, activity, maturity, and contribution signals in one place.',\n },\n {\n icon: 'search',\n title: 'Searchable discovery',\n body: 'Browse by category, stack, platform, stars, recency, and status instead of scanning a flat list.',\n },\n];\n\nconst items = points && points.length > 0 ? points : defaultPoints;\n---\n\n<section\n id=\"about\"\n class:list={[\"py-12 sm:py-16 scroll-mt-20 border-b border-ink-200 dark:border-ink-800\", className]}\n aria-labelledby=\"grove-why-heading\"\n>\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n <header class=\"flex flex-col gap-2\">\n <span class=\"text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">\n {eyebrow}\n </span>\n <h2\n id=\"grove-why-heading\"\n class=\"m-0 max-w-[40ch] text-[1.5rem] sm:text-[1.75rem] font-semibold tracking-tight text-ink-900 dark:text-ink-100\"\n >\n {title}\n </h2>\n {description && (\n <p class=\"m-0 max-w-[64ch] text-[0.9375rem] leading-relaxed text-ink-500 dark:text-ink-400\">\n {description}\n </p>\n )}\n </header>\n\n <ul\n class=\"m-0 mt-7 grid list-none grid-cols-1 gap-3 p-0 sm:grid-cols-3\"\n aria-label=\"Why this directory\"\n >\n {items.map((p) => (\n <li class=\"rounded-[calc(var(--radius)+0.25rem)] border border-border bg-card shadow-none transition-colors p-4\">\n <div\n aria-hidden=\"true\"\n class=\"mb-3 flex h-8 w-8 items-center justify-center rounded-md border border-ink-200 bg-white text-ink-700 dark:border-ink-800 dark:bg-ink-950 dark:text-ink-300\"\n >\n {p.icon === \"item\" && (\n <svg viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" fill=\"currentColor\">\n <path d=\"M1.75 3.5a.25.25 0 0 1 .25-.25h12a.25.25 0 0 1 .25.25v8a.25.25 0 0 1-.25.25h-12a.25.25 0 0 1-.25-.25v-8ZM2 4.75v6h12v-6H2ZM2.5 6.5h4v2.5h-4V6.5Z\"></path>\n </svg>\n )}\n {p.icon === \"code\" && (\n <svg viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" fill=\"currentColor\">\n <path d=\"M4.72 3.22a.75.75 0 0 1 1.06 1.06L2.06 8l3.72 3.72a.75.75 0 1 1-1.06 1.06L.47 8.53a.75.75 0 0 1 0-1.06l4.25-4.25Zm6.56 0a.75.75 0 0 1 1.06 0l4.25 4.25a.75.75 0 0 1 0 1.06l-4.25 4.25a.75.75 0 0 1-1.06-1.06L13.94 8l-3.72-3.72a.75.75 0 0 1 0-1.06Z\"></path>\n </svg>\n )}\n {p.icon === \"search\" && (\n <svg viewBox=\"0 0 16 16\" width=\"16\" height=\"16\" fill=\"currentColor\">\n <path d=\"M10.68 11.74a6 6 0 1 1 1.06-1.06l3.04 3.04a.75.75 0 1 1-1.06 1.06l-3.04-3.04ZM11.5 7a4.5 4.5 0 1 0-9 0 4.5 4.5 0 0 0 9 0Z\"></path>\n </svg>\n )}\n </div>\n <h3 class=\"m-0 text-[0.9375rem] font-semibold text-ink-900 dark:text-ink-100\">\n {p.title}\n </h3>\n <p class=\"m-0 mt-1.5 text-[0.8125rem] leading-relaxed text-ink-500 dark:text-ink-400\">\n {p.body}\n </p>\n </li>\n ))}\n </ul>\n </div>\n</section>\n",
|
|
29
|
+
"type": "registry:component",
|
|
30
|
+
"target": "~/src/components/grove/why-this-exists.astro"
|
|
31
|
+
},
|
|
32
|
+
{
|
|
33
|
+
"path": "default/components/grove/pipeline-strip.astro",
|
|
34
|
+
"content": "---\n/**\n * PipelineStrip — the file-first publishing story.\n *\n * Three beats: a record YAML (source of truth) → the Grove build →\n * the published outputs (this site, README, llms.txt, sitemap),\n * plus the sync loop (edits arrive as pull requests, automation\n * keeps every output current). The sample record shown is\n * illustrative markup, not live data — pass `samplePath` (a real\n * repo-relative path to one of your own records) to turn the \"Read\n * this file on GitHub\" link on; without it, the link is omitted.\n */\n\ninterface Props {\n /** Repository URL for the \"read the source\" link. */\n repoUrl?: string;\n /** Repo-relative path to a real sample record. No default — a\n * fresh scaffold has no records yet, so the link is omitted\n * unless you supply one. */\n samplePath?: string;\n class?: string;\n}\n\nconst { repoUrl, samplePath, class: className = '' } = Astro.props;\n\nconst sampleHref = repoUrl ? `${repoUrl.replace(/\\/$/, '')}/blob/main/${samplePath}` : undefined;\n\nconst outputs = [\n { label: 'This website', detail: 'browse, search, filters' },\n { label: 'README', detail: 'awesome-list generated' },\n { label: 'llms.txt', detail: 'machine-readable index' },\n { label: 'Sitemap + SEO', detail: 'structured data' },\n];\n---\n\n<section\n id=\"pipeline\"\n class:list={[\"scroll-mt-20 border-b border-border py-12 sm:py-16\", className]}\n aria-labelledby=\"pipeline-heading\"\n>\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n <header class=\"flex flex-col gap-2\">\n <span class=\"text-2xs font-medium uppercase tracking-wider text-muted-foreground\">\n How this site works\n </span>\n <h2\n id=\"pipeline-heading\"\n class=\"m-0 max-w-[40ch] text-[1.5rem] font-semibold tracking-tight text-foreground sm:text-[1.75rem]\"\n >\n Every listing is a plain YAML file.\n </h2>\n <p class=\"m-0 max-w-[64ch] text-[0.9375rem] leading-relaxed text-muted-foreground\">\n The content you're browsing lives as files in a repository. Grove builds them\n into this site and its machine-readable outputs — and keeps everything in sync\n when a file changes.\n </p>\n </header>\n\n <div class=\"mt-7 grid grid-cols-1 gap-3 md:grid-cols-3\">\n {/* Beat 1 — the source file */}\n <div class=\"flex flex-col rounded-[calc(var(--radius)+0.25rem)] border border-border bg-surface-raised p-4\">\n <p class=\"m-0 text-2xs font-medium uppercase tracking-wider text-muted-foreground\">\n 1 · Source file\n </p>\n <pre\n class=\"mt-3 flex-1 overflow-x-auto rounded-md bg-surface-sunken p-3 font-mono text-[0.75rem] leading-relaxed text-foreground\"\n ><code>name: Open WebUI\nslug: open-webui\ncategory: interfaces\nstacks: [typescript, python]\ntags: [chat, self-host, llm]\nlicenses: [mit]</code></pre>\n {sampleHref && (\n <a\n href={sampleHref}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"mt-3 text-2xs font-medium text-muted-foreground underline decoration-border underline-offset-2 hover:text-foreground\"\n >\n Read this file on GitHub →\n </a>\n )}\n </div>\n\n {/* Beat 2 — the build */}\n <div class=\"flex flex-col rounded-[calc(var(--radius)+0.25rem)] border border-border bg-surface-raised p-4\">\n <p class=\"m-0 text-2xs font-medium uppercase tracking-wider text-muted-foreground\">\n 2 · Grove build\n </p>\n <ul class=\"m-0 mt-3 flex flex-1 list-none flex-col gap-2 p-0 text-[0.8125rem] leading-relaxed text-muted-foreground\">\n <li>Validates every record against the schema</li>\n <li>Joins taxonomy labels, health, and GitHub metadata</li>\n <li>Generates one index consumed by every output</li>\n </ul>\n <p class=\"m-0 mt-3 font-mono text-2xs text-muted-foreground\">grove check && astro build</p>\n </div>\n\n {/* Beat 3 — the outputs */}\n <div class=\"flex flex-col rounded-[calc(var(--radius)+0.25rem)] border border-border bg-surface-raised p-4\">\n <p class=\"m-0 text-2xs font-medium uppercase tracking-wider text-muted-foreground\">\n 3 · Published outputs\n </p>\n <ul class=\"m-0 mt-3 flex flex-1 list-none flex-col gap-2 p-0\">\n {outputs.map((output) => (\n <li class=\"flex items-baseline justify-between gap-3 text-[0.8125rem]\">\n <span class=\"font-medium text-foreground\">{output.label}</span>\n <span class=\"text-right text-2xs text-muted-foreground\">{output.detail}</span>\n </li>\n ))}\n </ul>\n </div>\n </div>\n\n <p class=\"m-0 mt-4 text-[0.8125rem] leading-relaxed text-muted-foreground\">\n The loop: edits arrive as pull requests to the files, weekly automation refreshes\n GitHub metadata, and every output above is regenerated from the same source —\n nothing is entered twice, nothing goes stale.\n </p>\n </div>\n</section>\n",
|
|
35
|
+
"type": "registry:component",
|
|
36
|
+
"target": "~/src/components/grove/pipeline-strip.astro"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
"path": "default/components/grove/record-section.astro",
|
|
40
|
+
"content": "---\nimport { buildProjectCardModel } from '@grove-dev/astro/server';\n/**\n * RecordSection — generic lens-style section wrapper for the\n * home page.\n *\n * Renders a SectionHeader + a 3-column grid of `ProjectCard`s\n * (the v0.5.0 refined card), plus an optional \"View all\" link\n * in the header. Generic: takes any\n * `IndexRecord[]` (the slim list-page shape, discriminated union\n * over `kind`).\n *\n * Two equivalent APIs are supported so the same template works\n * against both the workspace source and the published\n * `@grove-dev/astro@0.2.10` package:\n *\n * - **`hrefFor(record)`** callback — V1 published API. Caller\n * passes a function that returns the detail-page URL for\n * each item.\n * - **`pathPrefix` string** — convenience API for the common\n * case `${pathPrefix}/${item.slug}`. Mutually exclusive with\n * `hrefFor`; if both are provided, `hrefFor` wins.\n *\n * Empty-state copy is rendered when the list has no items, so the\n * homepage never collapses to a blank section.\n */\nimport type { IndexRecord } from '@grove-dev/core';\nimport Container from '../../layouts/container.astro';\nimport SectionHeader from '../../layouts/section-header.astro';\nimport EmptyState from '../ui/empty-state.astro';\nimport CardGrid from './card-grid.astro';\nimport ProjectCard from './project-card.astro';\n\ninterface Props {\n /** Used as the section id (so deep links work) and a stable key. */\n id: string;\n title: string;\n description?: string;\n items: IndexRecord[];\n /** Detail-page href builder (V1 published API). */\n hrefFor?: (record: IndexRecord) => string;\n /** Detail-page URL prefix (convenience API). */\n pathPrefix?: string;\n /** Optional \"View all\" link rendered in the header. */\n viewAllHref?: string;\n viewAllLabel?: string;\n /** Optional eyebrow. */\n eyebrow?: string;\n /** Empty-state copy. */\n emptyLabel?: string;\n /** Extra class on the outer <section>. */\n class?: string;\n /** How many records to render. Default 3 — the refined grid shows one row. */\n limit?: number;\n}\n\nconst {\n id,\n title,\n description,\n items,\n hrefFor,\n pathPrefix = '/items',\n viewAllHref,\n viewAllLabel = 'View all',\n eyebrow,\n emptyLabel = 'No records yet.',\n class: className = '',\n limit = 3,\n} = Astro.props;\n\nconst visible = items.slice(0, limit);\n---\n\n<section\n id={id}\n class={`py-12 sm:py-16 scroll-mt-20 ${className}`}\n>\n <Container>\n <div class=\"mb-6 flex flex-wrap items-end justify-between gap-3\">\n <SectionHeader\n eyebrow={eyebrow}\n title={title}\n description={description}\n />\n {viewAllHref && (\n <a\n href={viewAllHref}\n class=\"hidden shrink-0 pb-2 text-2xs font-medium text-ink-500 transition-colors hover:text-ink-900 sm:inline dark:text-ink-400 dark:hover:text-ink-100\"\n >\n {viewAllLabel} →\n </a>\n )}\n </div>\n\n {visible.length === 0 ? (\n <EmptyState title={emptyLabel} />\n ) : (\n <CardGrid>\n {visible.map((item) => {\n // Resolve href: caller-supplied `hrefFor` callback wins;\n // otherwise fall back to `${pathPrefix}/${slug}`. The href\n // is what each card actually navigates to — getting it\n // right is the difference between a working home page\n // and a 404-storm of `/items/<slug>` links.\n const base = pathPrefix.replace(/\\/$/, \"\");\n const fallbackHref = `${base}/${item.slug}`;\n const finalHref =\n typeof hrefFor === \"function\" ? hrefFor(item) : fallbackHref;\n const model = buildProjectCardModel(item);\n return (\n <li class=\"m-0 p-0\">\n <ProjectCard model={model} href={finalHref} />\n </li>\n );\n })}\n </CardGrid>\n )}\n\n {viewAllHref && (\n <div class=\"mt-4 sm:hidden\">\n <a\n href={viewAllHref}\n class=\"text-2xs font-medium text-ink-500 transition-colors hover:text-ink-900 dark:text-ink-400 dark:hover:text-ink-100\"\n >{viewAllLabel} →</a>\n </div>\n )}\n </Container>\n</section>\n",
|
|
41
|
+
"type": "registry:component",
|
|
42
|
+
"target": "~/src/components/grove/record-section.astro"
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
"path": "default/components/grove/contributors-grid.astro",
|
|
46
|
+
"content": "---\n/**\n * ContributorsGrid — avatar grid for the home page.\n *\n * Renders a dense grid of contributor avatars with optional name and\n * contribution count. Each tile links to the contributor's profile.\n * No blueprint-specific terms — works for any \"people\" feed.\n *\n * Empty tiles are skipped. When the list is empty the entire section\n * hides its body but keeps the header (so a \"no contributors yet\"\n * state can be wired by a consumer via a slot).\n */\n\nimport { compact } from '@grove-dev/core';\nimport EmptyState from '../ui/empty-state.astro';\n\ninterface Contributor {\n username: string;\n name?: string;\n avatarUrl?: string;\n profileUrl?: string;\n contributions?: number;\n}\n\ninterface Props {\n contributors: Contributor[];\n /** Total count to display in the header (e.g. \"1,234 contributors\"). */\n total?: number;\n /** Optional view-all href rendered top-right. */\n viewAllHref?: string;\n viewAllLabel?: string;\n title?: string;\n description?: string;\n /** Render per-user contribution counts (config: contributors.showContributionCount). */\n showContributionCount?: boolean;\n class?: string;\n}\n\nconst {\n contributors,\n total,\n viewAllHref,\n viewAllLabel = 'View all',\n title = 'Built by the community',\n description = 'The people improving this directory through code, curation, and review.',\n showContributionCount = true,\n class: className = '',\n} = Astro.props;\n\nconst visible = contributors.filter((c) => c.username).slice(0, 100);\n---\n\n<section\n class:list={[\"py-12 sm:py-16\", className]}\n aria-labelledby=\"grove-contributors-heading\"\n>\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n <header class=\"mb-6 flex flex-wrap items-end justify-between gap-3\">\n <div>\n <h2\n id=\"grove-contributors-heading\"\n class=\"m-0 text-[1.5rem] sm:text-[1.625rem] font-semibold tracking-tight text-ink-900 dark:text-ink-100\"\n >\n {title}\n {typeof total === \"number\" && (\n <span class=\"ml-2 font-mono text-[0.9375rem] font-normal text-ink-500 dark:text-ink-400\">\n ({compact(total)})\n </span>\n )}\n </h2>\n {description && (\n <p class=\"m-0 mt-1 max-w-[60ch] text-[0.9375rem] text-ink-500 dark:text-ink-400\">\n {description}\n </p>\n )}\n </div>\n {viewAllHref && (\n <a\n href={viewAllHref}\n class=\"text-sm font-medium text-ink-500 hover:text-ink-900 dark:text-ink-400 dark:hover:text-ink-100\"\n >\n {viewAllLabel} →\n </a>\n )}\n </header>\n\n {visible.length === 0 ? (\n <EmptyState title=\"Community profiles appear after the first repository metadata sync.\" />\n ) : (\n <ul\n class=\"m-0 grid list-none grid-cols-[repeat(auto-fill,minmax(72px,1fr))] gap-x-3 gap-y-5 p-0\"\n aria-label=\"Contributors\"\n >\n {visible.map((c) => {\n const href = c.profileUrl ?? `https://github.com/${c.username}`;\n const avatar =\n c.avatarUrl ??\n `https://avatars.githubusercontent.com/${c.username}?v=4&s=80`;\n return (\n <li class=\"m-0 p-0\">\n <a\n href={href}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"group flex flex-col items-center gap-1.5 p-2 text-center no-underline\"\n data-event=\"contributor_click\"\n data-event-source=\"contributors_grid\"\n >\n <img\n src={avatar}\n alt={c.name ?? c.username}\n width=\"48\"\n height=\"48\"\n loading=\"lazy\"\n decoding=\"async\"\n class=\"h-12 w-12 rounded-full border border-ink-200 object-cover dark:border-ink-800\"\n />\n <span class=\"line-clamp-1 text-2xs font-medium text-ink-700 group-hover:text-ink-900 dark:text-ink-300 dark:group-hover:text-ink-100\">\n {c.name ?? c.username}\n </span>\n {showContributionCount && typeof c.contributions === \"number\" && (\n <span class=\"font-mono text-2xs text-ink-400\">\n {compact(c.contributions)}\n </span>\n )}\n </a>\n </li>\n );\n })}\n </ul>\n )}\n </div>\n</section>\n",
|
|
47
|
+
"type": "registry:component",
|
|
48
|
+
"target": "~/src/components/grove/contributors-grid.astro"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
"path": "default/components/grove/original-collection.astro",
|
|
52
|
+
"content": "---\nimport { compact } from '@grove-dev/core';\n/**\n * OriginalCollection — legacy lineage card.\n *\n * Renders a single wide card that links out to the project's origin\n * repository, with stars/forks/contributors stats. Used on home and\n * about pages to give visitors a way to find the original curated\n * collection this directory descends from.\n *\n * Generic: takes plain `stats` and a `repoUrl`. No blueprint or\n * site-specific copy.\n */\nimport { buttonClass } from '../../lib/classnames.ts';\n\ninterface OriginStats {\n stars?: number;\n forks?: number;\n contributors?: number;\n description?: string;\n}\n\ninterface Props {\n repoUrl: string;\n repoLabel?: string;\n stats?: OriginStats;\n title?: string;\n description?: string;\n class?: string;\n}\n\nconst {\n repoUrl,\n repoLabel = 'View on GitHub',\n stats = {},\n title = 'A growing list, forked from the original',\n description = 'This directory descends from an earlier curated collection. The original still lives on — same shape, same spirit, fresh data.',\n class: className = '',\n} = Astro.props;\n\nconst hasStats =\n stats.stars !== undefined || stats.forks !== undefined || stats.contributors !== undefined;\n---\n\n<section class:list={[\"py-12 sm:py-16\", className]}>\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n <div\n class=\"rounded-[calc(var(--radius)+0.25rem)] border border-border bg-card shadow-none transition-colors flex flex-col gap-4 p-6 sm:flex-row sm:items-center sm:justify-between\"\n >\n <div class=\"flex flex-col gap-2\">\n <span class=\"text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">\n Origin\n </span>\n <h2 class=\"m-0 text-[1.25rem] font-semibold tracking-tight text-ink-900 dark:text-ink-100\">\n {title}\n </h2>\n <p class=\"m-0 max-w-2xl text-[0.875rem] text-ink-500 dark:text-ink-400\">\n {description}\n </p>\n {stats.description && (\n <p class=\"m-0 max-w-2xl text-[0.8125rem] text-ink-500 dark:text-ink-400\">\n {stats.description}\n </p>\n )}\n {hasStats && (\n <dl\n class=\"mt-2 flex flex-wrap items-center gap-x-4 gap-y-1 text-2xs text-ink-500 dark:text-ink-400\"\n aria-label=\"Original repository signals\"\n >\n {stats.stars !== undefined && (\n <div class=\"flex items-center gap-1\">\n <dd class=\"m-0 font-mono\">{compact(stats.stars)}</dd>\n <dt>stars</dt>\n </div>\n )}\n {stats.forks !== undefined && (\n <div class=\"flex items-center gap-1\">\n <dd class=\"m-0 font-mono\">{compact(stats.forks)}</dd>\n <dt>forks</dt>\n </div>\n )}\n {stats.contributors !== undefined && (\n <div class=\"flex items-center gap-1\">\n <dd class=\"m-0 font-mono\">\n {compact(stats.contributors)}\n </dd>\n <dt>contributors</dt>\n </div>\n )}\n </dl>\n )}\n </div>\n <div class=\"flex flex-shrink-0 items-center gap-2\">\n <a\n href={repoUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class={buttonClass(\"primary\", \"sm\")}\n data-event=\"original_collection_click\"\n data-event-source=\"original_collection\"\n >\n {repoLabel} →\n </a>\n </div>\n </div>\n </div>\n</section>\n",
|
|
53
|
+
"type": "registry:component",
|
|
54
|
+
"target": "~/src/components/grove/original-collection.astro"
|
|
55
|
+
},
|
|
56
|
+
{
|
|
57
|
+
"path": "default/components/grove/final-cta.astro",
|
|
58
|
+
"content": "---\nimport { buttonClass } from '../../lib/classnames.ts';\n\ninterface Props {\n itemLabel?: string;\n itemsLabel?: string;\n browseHref?: string;\n submitHref?: string;\n class?: string;\n}\n\nconst {\n itemLabel = 'item',\n itemsLabel = 'items',\n browseHref = '/items',\n submitHref = '/submit',\n class: className = '',\n} = Astro.props;\n---\n\n<section class:list={[\"border-t border-ink-200 py-10 sm:py-12 dark:border-ink-800\", className]} aria-labelledby=\"grove-final-cta-heading\">\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n <div class=\"rounded-[calc(var(--radius)+0.25rem)] border border-border bg-card px-6 py-7 sm:flex sm:items-center sm:justify-between sm:gap-10 sm:px-8 sm:py-8 dark:border-ink-800\">\n <div class=\"max-w-2xl\">\n <p class=\"m-0 text-2xs font-semibold uppercase tracking-wider text-ink-500 dark:text-ink-400\">Keep the directory useful</p>\n <h2 id=\"grove-final-cta-heading\" class=\"m-0 mt-1.5 text-[1.5rem] font-semibold tracking-tight text-ink-900 sm:text-[1.75rem] dark:text-ink-100\">\n Know {itemLabel === \"app\" ? \"an\" : \"a\"} {itemLabel} that belongs here?\n </h2>\n <p class=\"m-0 mt-2 max-w-xl text-sm leading-relaxed text-ink-500 dark:text-ink-400\">\n Add a real, inspectable project or improve the metadata behind an existing listing.\n </p>\n </div>\n <div class=\"mt-5 flex shrink-0 flex-wrap items-center gap-2 sm:mt-0 sm:justify-end\">\n <a href={submitHref} class={buttonClass(\"primary\", \"md\", \"px-4\")}>\n Submit {itemLabel}\n </a>\n <a href={browseHref} class={buttonClass(\"outline\", \"md\", \"px-4\")}>\n Explore {itemsLabel}\n </a>\n </div>\n </div>\n </div>\n</section>\n",
|
|
59
|
+
"type": "registry:component",
|
|
60
|
+
"target": "~/src/components/grove/final-cta.astro"
|
|
61
|
+
}
|
|
62
|
+
],
|
|
63
|
+
"meta": {
|
|
64
|
+
"version": "1.0.0"
|
|
65
|
+
},
|
|
66
|
+
"type": "registry:block"
|
|
67
|
+
}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "not-found",
|
|
4
|
+
"title": "404 page",
|
|
5
|
+
"description": "The on-brand fallback route: the normal shell, a short message, and a search form pointing at the browse page.",
|
|
6
|
+
"registryDependencies": [
|
|
7
|
+
"@grove/shell",
|
|
8
|
+
"@grove/ui"
|
|
9
|
+
],
|
|
10
|
+
"files": [
|
|
11
|
+
{
|
|
12
|
+
"path": "default/pages/404.astro",
|
|
13
|
+
"content": "---\n/**\n * 404 — generic fallback page.\n *\n * Renders the normal shell (header / footer / theme toggle) with a\n * short message and a search form pointing at the list page. Stays\n * on-brand regardless of blueprint.\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport { indexSlug } from '@grove-dev/astro/server';\nimport SearchField from '../components/ui/search-field.astro';\nimport BaseLayout from '../layouts/base-layout.astro';\nimport { buttonClass } from '../lib/classnames.ts';\n\nconst slug = indexSlug();\nconst title = `Page not found | ${siteConfig.name}`;\nconst description = `That page doesn't exist on ${siteConfig.name}. Search the directory or browse from the home page.`;\n---\n\n<BaseLayout\n title={title}\n description={description}\n site={siteConfig}\n noindex\n>\n {/* One recovery hierarchy: search is the primary tool, Browse the\n single button action, home a quiet text link — no three\n competing primary CTAs. Centered so the wide viewport doesn't\n pin everything into the top-left corner. */}\n <section class=\"py-12 sm:py-16\">\n <div class=\"mx-auto w-full max-w-narrow px-5 py-16 text-center sm:px-7 sm:py-24\">\n <span class=\"text-2xs font-medium uppercase tracking-wider text-muted-foreground\">\n 404\n </span>\n <h1 class=\"m-0 mt-2 text-[2.25rem] font-semibold leading-[1.05] tracking-tight text-foreground sm:text-[3rem]\">\n Page not found\n </h1>\n <p class=\"mx-auto m-0 mt-4 max-w-xl text-lg leading-relaxed text-muted-foreground\">\n The page you're looking for doesn't exist on {siteConfig.name}.\n It may have been moved, renamed, or never existed.\n </p>\n\n <form\n class=\"mx-auto mt-8 flex max-w-xl flex-col gap-2 sm:flex-row sm:items-center\"\n role=\"search\"\n action={`/${slug}`}\n method=\"get\"\n >\n <SearchField class=\"flex-1\" label=\"Search\" placeholder={`Search ${slug}...`} id=\"not-found-search\" />\n <button type=\"submit\" class={buttonClass(\"primary\", \"bare\", \"h-10 px-4 text-sm max-sm:min-h-11\")}>\n Search\n </button>\n </form>\n\n <div class=\"mt-6 flex flex-wrap items-center justify-center gap-4\">\n <a href={`/${slug}`} class={buttonClass(\"secondary\", \"sm\")}>Browse {slug}</a>\n <a href=\"/\" class=\"text-sm font-medium text-muted-foreground underline decoration-border underline-offset-2 hover:text-foreground\">\n Back to home\n </a>\n </div>\n </div>\n </section>\n</BaseLayout>\n",
|
|
14
|
+
"type": "registry:page",
|
|
15
|
+
"target": "~/src/pages/404.astro"
|
|
16
|
+
}
|
|
17
|
+
],
|
|
18
|
+
"meta": {
|
|
19
|
+
"version": "1.0.0"
|
|
20
|
+
},
|
|
21
|
+
"type": "registry:block"
|
|
22
|
+
}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "project-card",
|
|
4
|
+
"title": "Project card",
|
|
5
|
+
"description": "The canonical record card every listing surface renders through, with its grid host, metadata glyphs, and the brand-mark Icon component plus its generated icon registry.",
|
|
6
|
+
"files": [
|
|
7
|
+
{
|
|
8
|
+
"path": "default/components/grove/project-card.astro",
|
|
9
|
+
"content": "---\n/**\n * ProjectCard — the canonical card for one directory record.\n *\n * V1 (v0.5.0) refined design for the three-column grid, now shared by\n * every listing surface (home sections, browse results, collection\n * entries, taxonomy pages) through thin adapters (`IndexRow`,\n * `CollectionRow`):\n *\n * - Default mode: the whole card is one clickable `<a>` (cursor:\n * pointer, subtle border + surface lift on hover, no more than\n * 1–2px vertical motion).\n * - When the record has a repository the root becomes an\n * `<article>` with a stretched title link, because nesting `<a>`\n * inside `<a>` is invalid HTML. The `owner/repo` line is a real\n * link to the repository and sits above the stretched overlay\n * (`relative z-10`).\n * - App icon top-left (48px), app name + clickable owner/repo,\n * two-line description with reserved vertical space.\n * - Footer row: stack logos on the left, stars and last-updated on\n * the right, navigation arrow anchored bottom-right.\n *\n * **The layout is fixed.** Earlier versions let list pages opt into a\n * curated badge, a license tag, a `category · status` line and\n * labelled chip rows, so the same record rendered differently\n * depending on where a visitor found it. Platform support is\n * likewise off the card: it is reference detail and belongs on the\n * record page (`RecordSidebar`).\n *\n * Presentation only: this component takes a pre-built\n * `ProjectCardModel` (see `@grove-dev/astro/server`'s\n * `buildProjectCardModel`) and renders it — no record shapes, casts,\n * or formatting live here. Callers that render a raw record (or a\n * lightweight adapter shape like `CollectionEntry`) build the model\n * themselves before reaching this component.\n *\n * Uses the package's design-system tokens plus the standard `dark:`\n * variant. Equal-height cards in the row are achieved at the grid\n * level (`CardGrid`: `grid` + `items-stretch`).\n */\nimport type { ProjectCardModel } from '@grove-dev/astro/server';\nimport CardIcon from './card-icon.astro';\nimport Icon from './icon.astro';\n\ninterface Props {\n /** Pre-built view-model — see `buildProjectCardModel`. */\n model: ProjectCardModel;\n /** Full detail-page URL. */\n href: string;\n /** Eager-load the avatar (above-the-fold rows). */\n eager?: boolean;\n /** Analytics data-event attributes on the card root. */\n event?: string;\n eventSource?: string;\n class?: string;\n}\n\nconst { model, href, eager = false, event, eventSource, class: className = '' } = Astro.props;\n\nconst {\n name,\n slug,\n description,\n initials,\n avatarUrl,\n repoHref,\n owner,\n repo,\n isArticle,\n stars,\n starsLabel,\n hasStars,\n pushedAt,\n updatedLabel,\n hasUpdated,\n visibleStacks,\n stackOverflow,\n hasStacks,\n} = model;\n\nconst Root = isArticle ? 'article' : 'a';\nconst rootAttrs = isArticle ? {} : { href, 'aria-label': `Open ${name}` };\n---\n\n<Root\n {...rootAttrs}\n class={`group relative flex h-full min-w-0 flex-col gap-3 rounded-xl border border-ink-200 bg-card p-5 outline-none transition-[border-color,background-color,transform] duration-150 hover:-translate-y-0.5 hover:border-ink-400 hover:bg-ink-50 focus-visible:border-ink-500 focus-visible:ring-2 focus-visible:ring-ink-900/15 dark:border-ink-800 dark:hover:border-ink-600 dark:hover:bg-ink-900 dark:focus-visible:border-ink-500 dark:focus-visible:ring-ink-100/15 ${className}`}\n data-record-slug={slug}\n data-event={event}\n data-event-source={eventSource}\n data-event-item={event ? slug : undefined}\n>\n {/* Header: icon + name + owner.\n\n The initials chip is always in the DOM, `hidden` behind the image,\n and unhidden by the image's own `onerror` — the same pattern\n `Icon.astro` uses. Rendering it only when `avatarUrl` is falsy made\n it unreachable for every record with a GitHub owner, so a dead\n logo URL or a renamed org showed the browser's broken-image glyph\n instead of a fallback. */}\n <header class=\"flex items-start gap-3\">\n {avatarUrl && (\n <img\n src={avatarUrl}\n alt=\"\"\n width=\"48\"\n height=\"48\"\n loading={eager ? \"eager\" : \"lazy\"}\n fetchpriority={eager ? \"high\" : undefined}\n decoding=\"async\"\n onerror=\"this.hidden=true;this.nextElementSibling.hidden=false\"\n class=\"h-12 w-12 shrink-0 rounded-lg bg-white object-contain p-1\"\n />\n )}\n <span\n aria-hidden=\"true\"\n hidden={Boolean(avatarUrl)}\n data-grove-card-fallback-initials\n class=\"flex h-12 w-12 shrink-0 items-center justify-center rounded-lg bg-ink-100 text-base font-semibold uppercase text-ink-700 dark:bg-ink-800 dark:text-ink-200\"\n >\n {initials}\n </span>\n\n <div class=\"flex min-w-0 flex-1 flex-col gap-0.5\">\n <h3 class=\"m-0 truncate text-[17px] font-semibold leading-snug tracking-tight text-ink-900 sm:text-[18px] dark:text-ink-100\">\n {isArticle ? (\n <a\n href={href}\n class=\"text-inherit no-underline before:absolute before:inset-0 before:z-0 before:content-['']\"\n >\n {name}\n </a>\n ) : (\n name\n )}\n </h3>\n {owner && repo && (\n <p class=\"m-0 truncate font-mono text-[13px] text-ink-500 dark:text-ink-400\">\n {repoHref ? (\n <a\n href={repoHref}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n title={`${owner}/${repo} on GitHub`}\n data-event=\"external_repo_click\"\n data-event-source=\"project_card_repo\"\n data-event-item={slug}\n class=\"relative z-10 text-inherit no-underline transition-colors hover:text-ink-900 hover:underline dark:hover:text-ink-100\"\n >\n {owner}<span class=\"opacity-60\">/</span>{repo}\n </a>\n ) : (\n <Fragment>{owner}<span class=\"opacity-60\">/</span>{repo}</Fragment>\n )}\n </p>\n )}\n </div>\n </header>\n\n {/* Description — two-line clamp with reserved vertical space */}\n <p\n class=\"m-0 line-clamp-2 min-h-[42px] text-[14px] leading-[1.5] text-ink-500 dark:text-ink-400\"\n >\n {description}\n </p>\n\n {/* Footer: stack logos · stars/updated · arrow */}\n <footer class=\"mt-auto flex items-center justify-between gap-3 text-[12px] sm:text-[13px]\">\n {hasStacks ? (\n <div class=\"flex min-w-0 items-center gap-2 text-ink-500 dark:text-ink-400\">\n {visibleStacks.map((stack) => (\n <Icon name={stack} category=\"stack\" size={16} title={stack} />\n ))}\n {stackOverflow > 0 && (\n <span class=\"text-[12px] text-ink-500 dark:text-ink-400\">+{stackOverflow}</span>\n )}\n </div>\n ) : (\n /* Keeps the footer's stars/updated block right-aligned without\n shipping an empty flex container on every stackless card. */\n <span></span>\n )}\n\n <div class=\"flex min-w-0 shrink-0 items-center gap-3 text-ink-500 dark:text-ink-400\">\n {hasStars && (\n <span class=\"inline-flex items-center gap-1\" title={`${stars ?? 0} stars on GitHub`}>\n <span class=\"inline-flex text-warning\"><CardIcon name=\"star\" /></span>\n <span class=\"font-mono\">{starsLabel}</span>\n </span>\n )}\n {hasUpdated && (\n <span class=\"whitespace-nowrap\" title={`Last updated ${pushedAt}`}>\n Updated {updatedLabel}\n </span>\n )}\n <CardIcon\n name=\"arrow\"\n class=\"shrink-0 text-ink-400 transition-colors group-hover:text-ink-700 dark:text-ink-500 dark:group-hover:text-ink-100\"\n />\n </div>\n </footer>\n</Root>\n",
|
|
10
|
+
"type": "registry:component",
|
|
11
|
+
"target": "~/src/components/grove/project-card.astro"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"path": "default/components/grove/card-grid.astro",
|
|
15
|
+
"content": "---\n/**\n * CardGrid — the one responsive grid host for card-shaped children.\n *\n * Owns the three-column layout every listing surface shares (home\n * record sections, browse results, collection entries, taxonomy\n * terms) so pages never re-declare grid classes. Cards are passed\n * through the default slot, which keeps the grid card-agnostic: any\n * component that follows the sizing contract (`h-full flex flex-col`\n * root, package radius/padding tokens) drops in — including new card\n * types added by consumers.\n *\n * Children may be bare cards or `<li>` wrappers; bare children are\n * valid because the grid renders `role=\"list\"` semantics regardless\n * (Safari drops list semantics on `list-none` either way).\n *\n * `empty` swaps the grid for the `empty` slot so pages keep their\n * empty-state markup next to the list they describe.\n */\ninterface Props {\n /** id forwarded to the `<ul>` (client scripts key off it). */\n id?: string;\n /** Render the `empty` slot instead of the grid. */\n empty?: boolean;\n class?: string;\n}\n\nconst { id, empty = false, class: className = '' } = Astro.props;\n---\n\n{empty ? (\n <slot name=\"empty\" />\n) : (\n <ul\n id={id}\n role=\"list\"\n class={`m-0 grid list-none grid-cols-1 items-stretch gap-5 p-0 sm:grid-cols-2 lg:grid-cols-3 ${className}`}\n >\n <slot />\n </ul>\n)}\n",
|
|
16
|
+
"type": "registry:component",
|
|
17
|
+
"target": "~/src/components/grove/card-grid.astro"
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
"path": "default/components/grove/card-icon.astro",
|
|
21
|
+
"content": "---\n/**\n * CardIcon — the small metadata glyphs shared by every card component\n * (star, clock, curated check, navigation arrow, external link).\n *\n * Extracted so a visual tweak (size, stroke, path) is one edit instead\n * of a copy-paste hunt across ProjectCard/IndexRow/CollectionRow.\n * Color comes from `currentColor`; wrap in a colored span (e.g.\n * `text-warning` for the star) to tint.\n */\ninterface Props {\n name: 'star' | 'clock' | 'curated' | 'arrow' | 'external';\n /** Square size in px. Defaults per-glyph to match card typography. */\n size?: number;\n class?: string;\n}\n\nconst { name, size, class: className = '' } = Astro.props;\n\nconst defaults: Record<Props['name'], number> = {\n star: 13,\n clock: 11,\n curated: 10,\n arrow: 16,\n external: 10,\n};\nconst px = size ?? defaults[name];\n---\n\n{name === \"star\" && (\n <svg viewBox=\"0 0 16 16\" width={px} height={px} aria-hidden=\"true\" fill=\"currentColor\" class={className}>\n <path d=\"M8 .25a.75.75 0 0 1 .673.418l1.882 3.815 4.21.612a.75.75 0 0 1 .416 1.279l-3.046 2.97.719 4.192a.751.751 0 0 1-1.088.791L8 12.347l-3.766 1.98a.75.75 0 0 1-1.088-.79l.72-4.194L.818 6.374a.75.75 0 0 1 .416-1.28l4.21-.611L7.327.668A.75.75 0 0 1 8 .25Z\" />\n </svg>\n)}\n{name === \"clock\" && (\n <svg viewBox=\"0 0 16 16\" width={px} height={px} aria-hidden=\"true\" fill=\"currentColor\" class={className}>\n <path d=\"M8 2a6 6 0 1 0 0 12A6 6 0 0 0 8 2Zm0 1.5a4.5 4.5 0 1 1 0 9 4.5 4.5 0 0 1 0-9Zm-.5 1.5a.5.5 0 0 0-1 0v3.25c0 .15.07.29.18.39l1.95 1.65a.5.5 0 0 0 .66-.76L7.5 7.55V5Z\" />\n </svg>\n)}\n{name === \"curated\" && (\n <svg viewBox=\"0 0 16 16\" width={px} height={px} aria-hidden=\"true\" fill=\"currentColor\" class={className}>\n <path d=\"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0Zm3.41 5.09a.75.75 0 0 0-1.06 0L6.75 8.69 5.65 7.59a.75.75 0 1 0-1.06 1.06l1.65 1.65a.75.75 0 0 0 1.06 0l4.11-4.11a.75.75 0 0 0 0-1.06Z\" />\n </svg>\n)}\n{name === \"arrow\" && (\n <svg\n viewBox=\"0 0 24 24\"\n width={px}\n height={px}\n fill=\"none\"\n stroke=\"currentColor\"\n stroke-width=\"2\"\n stroke-linecap=\"round\"\n stroke-linejoin=\"round\"\n aria-hidden=\"true\"\n class={className}\n >\n <path d=\"M5 12h14\"></path>\n <path d=\"m12 5 7 7-7 7\"></path>\n </svg>\n)}\n{name === \"external\" && (\n <svg viewBox=\"0 0 16 16\" width={px} height={px} aria-hidden=\"true\" fill=\"currentColor\" class={className}>\n <path d=\"M3.75 2A1.75 1.75 0 0 0 2 3.75v8.5C2 13.216 2.784 14 3.75 14h8.5A1.75 1.75 0 0 0 14 12.25v-3.5a.75.75 0 0 0-1.5 0v3.5a.25.25 0 0 1-.25.25h-8.5a.25.25 0 0 1-.25-.25v-8.5a.25.25 0 0 1 .25-.25h3.5a.75.75 0 0 0 0-1.5h-3.5Z\" />\n <path d=\"M10 0a.75.75 0 0 0-.75.75v.75h-3a.75.75 0 0 0 0 1.5h3v.75A.75.75 0 0 0 10.75 4.5h2.5A.75.75 0 0 0 14 3.75v-2.5A.75.75 0 0 0 13.25.5H10Z\" />\n </svg>\n)}\n",
|
|
22
|
+
"type": "registry:component",
|
|
23
|
+
"target": "~/src/components/grove/card-icon.astro"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"path": "default/components/grove/icon.astro",
|
|
27
|
+
"content": "---\nimport type { IconKind } from '../../lib/icon-kinds';\n/**\n * Icon — brand icon registry.\n *\n * Resolves a registry name to `/icons/{stacks|platforms|brands}/{name}.svg`\n * and renders it. The Astro integration syncs the packaged set into the\n * consumer's `public/icons/` on every build; consumers can ship their own\n * SVGs under the same paths (or override the `base` prop) without forking\n * this component.\n *\n * The component is **generic** — it does not import any consumer-side\n * `siteConfig`, `item`, or blueprint-specific module.\n *\n * `category` selects the subfolder:\n *\n * - \"stack\" → `/icons/stacks/{name}.svg`\n * - \"platform\" → `/icons/platforms/{name}.svg`\n * - \"brand\" → `/icons/brands/{name}.svg` (consumer-supplied)\n *\n * ## Theming\n *\n * `ICON_KINDS` (generated by `scripts/sync-icons.mjs`) classifies each\n * packaged icon:\n *\n * - **color** — the default. Any brand with a color mark keeps it,\n * rendered as `<img>` with an `onerror` fallback to an initials\n * chip.\n * - **mono** — marks with no color to lose (Apple, Rust, Tauri,\n * Solidity, Deno) plus the concept glyphs. Rendered as a CSS-masked\n * `<span>` painted from `--grove-foreground`, which reproduces how\n * those brands are actually used: solid black on light, solid white\n * on dark, with no script and no second file. See\n * `.grove-icon-mask` in `styles.css`.\n *\n * The map CLASSIFIES; it does not gate availability. A name it has never\n * heard of — a consumer's own SVG — takes the `<img>` path, exactly as\n * before. Pass `kind=\"mono\"` to opt a custom mark into `currentColor`\n * tinting.\n *\n * Aliases: a tiny `aliases` map (e.g. `rn → react-native`) lets the\n * registry accept multiple ids for the same asset. Lookup falls through\n * `aliases` → the built-in stack aliases → the raw slug, then fails over\n * to the initials placeholder.\n */\nimport { ICON_KINDS } from '../../lib/icon-kinds';\nimport type { IconCategory } from '../../lib/icon-registry';\nimport { resolveIconAsset, slugifyIconName } from '../../lib/icon-registry';\n\nexport type { IconCategory, IconKind };\n\n/**\n * @deprecated Theme variants are no longer file-based — `mono` icons\n * inherit `currentColor`. Accepted and ignored so consumers passing\n * `mode=\"auto\"` do not hit a type error.\n */\nexport type IconMode = 'static' | 'auto';\n\ninterface Props {\n /**\n * Registry id. Resolved through `aliases` first, then matched\n * against the SVG file name (case-insensitive, slug-normalized).\n */\n name: string;\n /** Subfolder under `/icons/`. */\n category: IconCategory;\n /** Pixel size (square). Defaults to 16. */\n size?: number;\n /** Extra class for the outer wrapper. */\n class?: string;\n /** Tooltip / aria-label. */\n title?: string;\n /** @deprecated No-op. Kept for one minor release. */\n mode?: IconMode;\n /**\n * Override the packaged kind classification. Pass `\"mono\"` for a\n * consumer-supplied single-color mark so it is painted black on\n * light and white on dark instead of shipping two files.\n */\n kind?: IconKind;\n /**\n * Optional id → id remap. Lookup goes `name → aliases[name] →\n * {name}.svg` (case-insensitive).\n */\n aliases?: Record<string, string>;\n /**\n * Optional complete asset registry supplied by a consumer. When omitted,\n * Grove attempts the configured asset path and falls back on image error.\n */\n available?: string[];\n /**\n * Initials to render when the icon file is missing. Defaults to\n * the first 1–2 characters of `name`.\n */\n fallbackInitials?: string;\n /**\n * Base path for icon files. Defaults to `/icons` (matches the\n * synced `public/icons/`).\n */\n base?: string;\n}\n\nconst {\n name,\n category,\n size = 16,\n class: className = '',\n title,\n kind,\n aliases,\n available,\n fallbackInitials,\n base = '/icons',\n} = Astro.props;\n\nconst asset = resolveIconAsset(name, category, aliases);\nconst resolved = asset.name;\nconst availableIcons = available?.map(slugifyIconName);\nconst hasAsset =\n category === 'brand' || availableIcons === undefined || availableIcons.includes(resolved);\nconst src = `${base.replace(/\\/$/, '')}/${asset.folder}/${resolved}.svg`;\n\n// Initials fallback: first 1–2 alphanumerics, uppercased.\nconst init = (fallbackInitials ?? name ?? '')\n .replace(/[^a-z0-9]/gi, '')\n .slice(0, 2)\n .toUpperCase();\nconst showFallback = !resolved || !hasAsset || asset.textOnly;\n\n// Unknown names fall through to `<img>`, never to `mono` — a mask has\n// no `onerror`, so a missing file would render an invisible blank.\nconst effectiveKind: IconKind = kind ?? ICON_KINDS[asset.key] ?? 'color';\n\n// `name` reaches the mask branch as part of a CSS `url()` token, and\n// slugifying does not remove the characters that would close it. Astro\n// escapes the attribute; this escapes the CSS inside it.\nconst cssUrl = src.replace(/['\"()\\\\\\s]/g, encodeURIComponent);\n\n// Build aria-label.\nconst ariaLabel = title ?? name;\nconst a11y: Record<string, string> = title\n ? { 'aria-label': ariaLabel, role: 'img' }\n : { 'aria-hidden': 'true', focusable: 'false' };\n\nconst fallbackClass = [\n 'inline-flex shrink-0 select-none items-center justify-center rounded-sm bg-ink-100 align-middle font-semibold uppercase leading-none text-ink-700 dark:bg-ink-800 dark:text-ink-200',\n className,\n];\nconst fallbackStyle = `width:${size}px;height:${size}px;font-size:${Math.max(10, size - 6)}px;`;\n---\n\n{\n showFallback ? (\n <span class:list={fallbackClass} style={fallbackStyle} {...a11y}>\n {init || \"·\"}\n </span>\n ) : effectiveKind === \"mono\" ? (\n <span\n class:list={[\"grove-icon-mask\", className]}\n style={`width:${size}px;height:${size}px;--grove-icon-url:url('${cssUrl}');`}\n {...a11y}\n />\n ) : (\n <>\n {/* The `width`/`height` attributes below are only presentational\n hints. These SVGs carry a `viewBox` and no intrinsic size, so\n once one loads the browser re-derives the box and the row\n reflows — Lighthouse reports it as \"media element lacking an\n explicit size\" and it cost the browse page 0.115 CLS. The\n `style` attribute's explicit CSS size pins the box before\n the first byte arrives. */}\n <img\n src={src}\n width={size}\n height={size}\n style={`width:${size}px;height:${size}px`}\n alt=\"\"\n class:list={[\"inline-block shrink-0 align-middle\", className]}\n loading=\"lazy\"\n decoding=\"async\"\n onerror=\"this.hidden=true;this.nextElementSibling.hidden=false\"\n {...a11y}\n />\n <span hidden data-grove-icon-fallback-initials class:list={fallbackClass} style={fallbackStyle} {...a11y}>\n {init || \"·\"}\n </span>\n </>\n )\n}\n",
|
|
28
|
+
"type": "registry:component",
|
|
29
|
+
"target": "~/src/components/grove/icon.astro"
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
"path": "default/lib/icon-kinds.ts",
|
|
33
|
+
"content": "// GENERATED by scripts/sync-icons.mjs — do not edit by hand.\n// Run `pnpm icons:sync` to regenerate.\n/**\n * How each packaged icon is painted.\n *\n * This map CLASSIFIES; it does not gate availability. A name that is\n * absent falls through to the `<img>` + initials path, which is what\n * keeps consumer-supplied SVGs under `public/icons/` working.\n *\n * Keyed by `${folder}/${resolvedName}` — the folder matters because\n * `apple` exists under both `stacks/` and `platforms/`.\n */\nexport type IconKind = 'color' | 'mono';\n\nexport const ICON_KINDS: Readonly<Record<string, IconKind>> = {\n 'platforms/android': 'color',\n 'platforms/app': 'mono',\n 'platforms/chrome': 'color',\n 'platforms/desktop': 'mono',\n 'platforms/embedded': 'mono',\n 'platforms/ios': 'mono',\n 'platforms/linux': 'color',\n 'platforms/macos': 'mono',\n 'platforms/ubuntu': 'color',\n 'platforms/web': 'mono',\n 'platforms/windows': 'color',\n 'stacks/android': 'color',\n 'stacks/apple': 'mono',\n 'stacks/bun': 'color',\n 'stacks/capacitor': 'color',\n 'stacks/clojure': 'color',\n 'stacks/dart': 'color',\n 'stacks/deno': 'mono',\n 'stacks/django': 'color',\n 'stacks/docker': 'color',\n 'stacks/firebase': 'color',\n 'stacks/flutter': 'color',\n 'stacks/go': 'color',\n 'stacks/graphql': 'color',\n 'stacks/ionic': 'color',\n 'stacks/java': 'color',\n 'stacks/javascript': 'color',\n 'stacks/kotlin': 'color',\n 'stacks/llm': 'mono',\n 'stacks/mongodb': 'color',\n 'stacks/nodejs': 'color',\n 'stacks/python': 'color',\n 'stacks/rag': 'mono',\n 'stacks/react': 'color',\n 'stacks/react-native': 'color',\n 'stacks/rust': 'mono',\n 'stacks/solidity': 'mono',\n 'stacks/sveltekit': 'color',\n 'stacks/swift': 'color',\n 'stacks/tauri': 'mono',\n 'stacks/tensorflow': 'color',\n 'stacks/typescript': 'color',\n 'stacks/vue': 'color',\n};\n",
|
|
34
|
+
"type": "registry:file",
|
|
35
|
+
"target": "~/src/lib/icon-kinds.ts"
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
"path": "default/lib/icon-registry.ts",
|
|
39
|
+
"content": "/**\n * Icon registry resolution — the name → asset lookup shared by\n * `components/Icon.astro` and the icon test suite.\n *\n * Kept out of the component's frontmatter so tests can assert on the\n * exact resolution the component performs instead of reimplementing\n * (and drifting from) the alias and folder rules.\n */\n\nexport type IconCategory = 'stack' | 'platform' | 'brand';\nexport type IconFolder = 'stacks' | 'platforms' | 'brands';\n\n/**\n * Normalize: lowercase + replace spaces/underscores with dashes.\n *\n * Deliberately NOT `@grove-dev/core`'s `slugify`, which also strips\n * dots and other punctuation. Icon names are file names, so they must\n * survive verbatim apart from case and separator normalization.\n */\nexport function slugifyIconName(s: string): string {\n return s\n .toLowerCase()\n .trim()\n .replace(/[\\s_]+/g, '-');\n}\n\n/**\n * Built-in id remaps. Stack-only by design: `category=\"platform\"`\n * resolves straight to the file name so a consumer shipping their own\n * `public/icons/platforms/ios.svg` is never silently bypassed.\n */\nconst defaultAliases: Partial<Record<IconCategory, Record<string, string>>> = {\n stack: {\n ios: 'apple',\n 'native-ios': 'apple',\n ipados: 'apple',\n macos: 'apple',\n 'objective-c': 'apple',\n spritekit: 'apple',\n swiftui: 'apple',\n kmp: 'kotlin',\n 'kotlin-multiplatform': 'kotlin',\n // Names the shipped set covers under a different file.\n 'node.js': 'nodejs',\n node: 'nodejs',\n clojurescript: 'clojure',\n svelte: 'sveltekit',\n },\n};\n\n/** Stack marks that `category=\"platform\"` should reuse rather than duplicate. */\nconst platformStackIcons = new Set(['docker']);\n\n/** Platforms with no mark at all — always render the initials chip. */\nexport const textOnlyPlatforms = new Set(['self-host', 'self-hosted']);\n\nexport interface ResolvedIconAsset {\n /** Subfolder under the icon base path. */\n folder: IconFolder;\n /** Alias-resolved, slugified file name (no extension). */\n name: string;\n /** `${folder}/${name}` — the key used by the generated kind map. */\n key: string;\n /** True when this name is text-only and must fall back to initials. */\n textOnly: boolean;\n}\n\n/**\n * Resolve a registry id to the asset it points at.\n *\n * Lookup order: `aliases` → the built-in stack aliases → the raw\n * slugified name. Any name not covered by the shipped set simply\n * resolves to `{category-folder}/{slug}`, which is what lets consumers\n * drop their own SVGs in without touching this file.\n */\nexport function resolveIconAsset(\n name: string,\n category: IconCategory,\n aliases?: Record<string, string>,\n): ResolvedIconAsset {\n const resolved = resolveName(name, category, aliases);\n const folder: IconFolder =\n category === 'stack' || (category === 'platform' && platformStackIcons.has(resolved))\n ? 'stacks'\n : category === 'platform'\n ? 'platforms'\n : 'brands';\n\n return {\n folder,\n name: resolved,\n key: `${folder}/${resolved}`,\n textOnly: category === 'platform' && textOnlyPlatforms.has(resolved),\n };\n}\n\nfunction resolveName(\n raw: string,\n category: IconCategory,\n aliases?: Record<string, string>,\n): string {\n if (!raw) return '';\n for (const registry of [aliases, defaultAliases[category]]) {\n if (!registry) continue;\n const lower = raw.toLowerCase();\n for (const [k, v] of Object.entries(registry)) {\n if (k.toLowerCase() === lower) return slugifyIconName(v);\n }\n }\n return slugifyIconName(raw);\n}\n",
|
|
40
|
+
"type": "registry:file",
|
|
41
|
+
"target": "~/src/lib/icon-registry.ts"
|
|
42
|
+
}
|
|
43
|
+
],
|
|
44
|
+
"meta": {
|
|
45
|
+
"version": "1.0.0"
|
|
46
|
+
},
|
|
47
|
+
"type": "registry:block"
|
|
48
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://ui.shadcn.com/schema/registry-item.json",
|
|
3
|
+
"name": "record",
|
|
4
|
+
"title": "Record detail page",
|
|
5
|
+
"description": "The per-record route: identity header, editorial summary, table of contents, rendered Markdown body, and the sticky sidebar of repository, freshness, ecosystem, and source facts.",
|
|
6
|
+
"registryDependencies": [
|
|
7
|
+
"@grove/shell",
|
|
8
|
+
"@grove/project-card",
|
|
9
|
+
"@grove/ui"
|
|
10
|
+
],
|
|
11
|
+
"files": [
|
|
12
|
+
{
|
|
13
|
+
"path": "default/pages/[slug]/[recordSlug].astro",
|
|
14
|
+
"content": "---\n/**\n * Detail page — thin consumer wiring up the package's\n * RecordHeader, EditorialSummary, TableOfContents, MarkdownBody,\n * and RecordSidebar components. All rendering logic, prose\n * styling, sidebar visibility, and activity-badge rules live in\n * `@grove-dev/astro`; this file only composes them.\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport { getRecordDetailModel, recordDetailPaths } from '@grove-dev/astro/server';\nimport EditorialSummary from '../../components/grove/editorial-summary.astro';\nimport MarkdownBody from '../../components/grove/markdown-body.astro';\nimport RecordHeader from '../../components/grove/record-header.astro';\nimport RecordSidebar from '../../components/grove/record-sidebar.astro';\nimport TableOfContents from '../../components/grove/table-of-contents.astro';\nimport BaseLayout from '../../layouts/base-layout.astro';\n\nexport function getStaticPaths() {\n return recordDetailPaths(siteConfig);\n}\n\nconst dirSlug = siteConfig.blueprintConfig?.routeSlug ?? 'projects';\nconst detail = getRecordDetailModel(\n Astro.params.recordSlug ?? '',\n siteConfig,\n Astro.params.slug ?? dirSlug,\n);\nif (!detail) return Astro.redirect(`/${dirSlug}`);\nconst { record, itemSingular, seo } = detail;\n---\n\n<BaseLayout\n title={seo.title}\n description={seo.description}\n image={seo.image}\n imageAlt={seo.imageAlt}\n site={siteConfig}\n type=\"article\"\n jsonLd={seo.jsonLd}\n submitHref=\"/submit\"\n submitLabel={`Submit ${itemSingular}`}\n>\n <article class=\"py-8 sm:py-10\">\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n <RecordHeader detail={detail} />\n\n <div\n class=\"grid grid-cols-1 gap-10 lg:grid-cols-[minmax(0,1fr)_300px] lg:gap-12\"\n >\n {/* Reading column: editorial context, then the article —\n no TOC panel pushing the body down. */}\n <div class=\"min-w-0\">\n <EditorialSummary bestFor={detail.bestFor} caveats={detail.caveats} />\n <MarkdownBody\n recordSlug={record.slug}\n fallback={record.content ? \"This record doesn't have notes yet.\" : undefined}\n />\n </div>\n {/* Right rail: the TOC and nothing else. */}\n <div class=\"min-w-0 lg:sticky lg:top-20 lg:max-h-[calc(100vh-5rem)] lg:self-start lg:overflow-y-auto\">\n <TableOfContents items={detail.toc} />\n </div>\n </div>\n\n {/* Metadata panels — full width below the article. */}\n <section class=\"mt-12 border-t border-border pt-8\" aria-label=\"Project details\">\n <RecordSidebar detail={detail} sticky={false} layout=\"grid\" />\n </section>\n </div>\n </article>\n</BaseLayout>\n",
|
|
15
|
+
"type": "registry:page",
|
|
16
|
+
"target": "~/src/pages/[slug]/[recordSlug].astro"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
"path": "default/components/grove/record-header.astro",
|
|
20
|
+
"content": "---\n/**\n * RecordHeader.astro\n *\n * Compact project-identity header used at the top of every record\n * detail page. The header carries:\n * - avatar / initials\n * - pills row (category + curation labels + \"Curated\" check +\n * optional activity badge)\n * - record name + owner/repo line\n * - short description\n * - GitHub + Homepage CTAs\n *\n * Tags + activity metadata are surfaced separately (sidebar), so\n * the header stays narrow on mobile and doesn't compete with the\n * two-column layout below.\n *\n * Tone classes for the activity badge are static `[data-activity-tone]`\n * selectors in `styles.css` — Tailwind purges any classes built from\n * dynamic strings, so the package ships the rules statically and\n * the badge's `data-activity-tone` attribute picks one at runtime.\n */\nimport type { RecordDetailModel } from '@grove-dev/astro/server';\nimport { buttonClass } from '../../lib/classnames.ts';\n\ninterface Props {\n detail: RecordDetailModel;\n}\n\nconst { detail } = Astro.props;\nconst {\n record,\n repoUrl,\n homepageUrl,\n ownerRepo,\n avatarSrc,\n initials,\n curationLabels,\n activityBadge,\n summary,\n sourceDescription,\n screenshots,\n category,\n name,\n} = detail;\n---\n\n<header class=\"mb-8\">\n {/* Identity row: logo sized to the name+repo block beside it — no\n tall avatar column leaving dead space under the logo. Pills sit\n at the row's right edge on wide viewports and wrap below on\n mobile. */}\n <div class=\"flex items-center gap-4\">\n {/* Initials stay in the DOM behind the logo and are revealed by the\n image's own `onerror` — a dead logo URL or a renamed GitHub org\n would otherwise render the broken-image glyph. */}\n {avatarSrc && (\n <img\n src={avatarSrc}\n alt=\"\"\n width=\"56\"\n height=\"56\"\n loading=\"lazy\"\n decoding=\"async\"\n onerror=\"this.hidden=true;this.nextElementSibling.hidden=false\"\n class=\"h-12 w-12 shrink-0 rounded-lg border border-ink-200 object-contain bg-white p-1 dark:border-ink-800 sm:h-14 sm:w-14\"\n />\n )}\n <span\n aria-hidden=\"true\"\n hidden={Boolean(avatarSrc)}\n data-grove-card-fallback-initials\n class=\"inline-flex h-12 w-12 shrink-0 items-center justify-center rounded-lg border border-ink-200 bg-ink-50 text-xl font-semibold text-ink-700 dark:border-ink-800 dark:bg-ink-900 dark:text-ink-200 sm:h-14 sm:w-14\"\n >\n {initials || \"·\"}\n </span>\n\n <div class=\"min-w-0 flex-1\">\n <h1 class=\"m-0 text-[1.75rem] font-semibold leading-tight tracking-tight text-ink-900 dark:text-ink-100 sm:text-[2rem]\">\n {name}\n </h1>\n {ownerRepo && (\n <p class=\"m-0 mt-0.5 text-sm text-ink-500 dark:text-ink-400\">\n <a\n href={`https://github.com/${ownerRepo.owner}`}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"text-inherit no-underline hover:text-ink-900 dark:hover:text-ink-100\"\n >\n @{ownerRepo.owner}\n </a>\n <span class=\"mx-1 text-ink-300 dark:text-ink-700\">/</span>\n <a\n href={repoUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"text-inherit no-underline hover:text-ink-900 dark:hover:text-ink-100\"\n >\n {ownerRepo.repo}\n </a>\n </p>\n )}\n </div>\n\n {/* Pills — right-aligned beside the name on wide viewports. */}\n <div class=\"hidden shrink-0 flex-wrap items-center justify-end gap-1.5 md:flex\">\n {category && (\n <span class=\"rounded-full border border-ink-200 px-2 py-0.5 text-2xs font-medium text-ink-700 dark:border-ink-800 dark:text-ink-300\">\n {category}\n </span>\n )}\n {curationLabels.map((l) => (\n <span class=\"rounded-full bg-secondary px-2 py-0.5 text-2xs font-medium text-secondary-foreground\">\n {l}\n </span>\n ))}\n {/* Curated = reviewed provenance, not a success status. */}\n {record.curation?.reviewed && (\n <span class=\"inline-flex items-center gap-1 rounded-full border border-border bg-secondary px-2 py-0.5 text-2xs font-medium text-secondary-foreground\">\n <svg viewBox=\"0 0 16 16\" width=\"10\" height=\"10\" aria-hidden=\"true\" fill=\"currentColor\">\n <path d=\"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0Zm3.41 5.09a.75.75 0 0 0-1.06 0L6.75 8.69 5.65 7.59a.75.75 0 1 0-1.06 1.06l1.65 1.65a.75.75 0 0 0 1.06 0l4.11-4.11a.75.75 0 0 0 0-1.06Z\" />\n </svg>\n Curated\n </span>\n )}\n {activityBadge && (\n <span\n data-activity-tone={activityBadge.tone}\n class=\"grove-pill grove-pill--activity inline-flex items-center gap-1 rounded-full border px-2 py-0.5 text-2xs font-medium\"\n >\n <span class=\"relative flex h-1.5 w-1.5\">\n <span class=\"absolute inline-flex h-full w-full animate-ping rounded-full bg-current opacity-60\"></span>\n <span class=\"relative inline-flex h-1.5 w-1.5 rounded-full bg-current\"></span>\n </span>\n {activityBadge.label}\n </span>\n )}\n </div>\n </div>\n\n {/* Same pills below the identity row on narrow viewports. */}\n <div class=\"mt-3 flex flex-wrap items-center gap-1.5 md:hidden\">\n {category && (\n <span class=\"rounded-full border border-ink-200 px-2 py-0.5 text-2xs font-medium text-ink-700 dark:border-ink-800 dark:text-ink-300\">\n {category}\n </span>\n )}\n {curationLabels.map((l) => (\n <span class=\"rounded-full bg-secondary px-2 py-0.5 text-2xs font-medium text-secondary-foreground\">\n {l}\n </span>\n ))}\n {record.curation?.reviewed && (\n <span class=\"inline-flex items-center gap-1 rounded-full border border-border bg-secondary px-2 py-0.5 text-2xs font-medium text-secondary-foreground\">\n <svg viewBox=\"0 0 16 16\" width=\"10\" height=\"10\" aria-hidden=\"true\" fill=\"currentColor\">\n <path d=\"M8 0a8 8 0 1 1 0 16A8 8 0 0 1 8 0Zm3.41 5.09a.75.75 0 0 0-1.06 0L6.75 8.69 5.65 7.59a.75.75 0 1 0-1.06 1.06l1.65 1.65a.75.75 0 0 0 1.06 0l4.11-4.11a.75.75 0 0 0 0-1.06Z\" />\n </svg>\n Curated\n </span>\n )}\n </div>\n\n {/* Description — full width below the identity row. */}\n {summary && (\n <p class=\"m-0 mt-4 max-w-[72ch] text-base leading-relaxed text-ink-700 dark:text-ink-200\">\n {summary}\n </p>\n )}\n {sourceDescription && sourceDescription !== summary && (\n <p class=\"m-0 mt-2 max-w-[72ch] text-sm leading-relaxed text-ink-500 dark:text-ink-400\">\n <span class=\"text-2xs font-semibold uppercase tracking-wider\">From the project's README: </span>\n {sourceDescription}\n </p>\n )}\n\n {/* CTA row — primary actions only. */}\n <div class=\"mt-4 flex flex-wrap items-center gap-2\">\n {repoUrl && (\n <a\n href={repoUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class={buttonClass(\"primary\", \"sm\")}\n >\n View on GitHub →\n </a>\n )}\n {homepageUrl && (\n <a\n href={homepageUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class={buttonClass(\"secondary\", \"sm\")}\n >\n Homepage\n </a>\n )}\n </div>\n {screenshots && screenshots.length > 0 && (\n <div class=\"mt-6 grid grid-cols-1 gap-3 sm:grid-cols-2 lg:grid-cols-3\" aria-label=\"Screenshots\">\n {screenshots.map((shot) => (\n <figure class=\"m-0 overflow-hidden rounded-[var(--radius-lg)] border border-ink-200 bg-muted dark:border-ink-800\">\n <img\n src={shot.src}\n alt={shot.alt}\n loading=\"lazy\"\n decoding=\"async\"\n width={shot.width}\n height={shot.height}\n class=\"block h-auto w-full object-cover\"\n />\n {shot.source && (\n <figcaption class=\"px-3 py-1.5 text-2xs text-ink-500 dark:text-ink-400\">\n Source: <a href={shot.source} target=\"_blank\" rel=\"noopener noreferrer\" class=\"text-inherit no-underline hover:underline\">{shot.source.replace(/^https?:\\/\\//, \"\")}</a>\n </figcaption>\n )}\n </figure>\n ))}\n </div>\n )}\n</header>",
|
|
21
|
+
"type": "registry:component",
|
|
22
|
+
"target": "~/src/components/grove/record-header.astro"
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
"path": "default/components/grove/record-sidebar.astro",
|
|
26
|
+
"content": "---\nimport type { RecordDetailModel } from '@grove-dev/astro/server';\nimport { taxonomyLabel } from '@grove-dev/astro/server';\n/**\n * RecordSidebar.astro\n *\n * Sticky right-hand column on the record detail page. Renders\n * up to four cards, each conditional on the model's `sidebar`\n * visibility flags:\n *\n * - Activity — repo facts (stars, forks, language, license, …)\n * - Freshness — last commit / last fetch / maintenance status\n * - Ecosystem — stack, platforms, category, tags, hygiene files\n * - Source — curation metadata + reading-time summary\n *\n * Empty rows are suppressed entirely — the sidebar never shows \"—\"\n * or \"0\" placeholders that confuse \"no data\" with \"zero\".\n *\n * Sticky on lg+ (`lg:sticky lg:top-20 lg:max-h-calc(100vh-5rem)\n * lg:overflow-y-auto`) so the cards stay in view while the user\n * scrolls the body. Cards are individually rendered so the\n * sticky container's height is bounded by the actual content.\n */\nimport { licenseDisplay } from '@grove-dev/core';\nimport Badge from '../ui/badge.astro';\nimport Icon from './icon.astro';\nimport LanguageBreakdown from './language-breakdown.astro';\n\ninterface Props {\n detail: RecordDetailModel;\n /**\n * Pass false when a parent wrapper owns the sticky behavior (e.g.\n * the detail page stacks the TOC above this sidebar inside one\n * sticky column).\n */\n sticky?: boolean;\n /**\n * \"column\" (default) stacks the cards vertically for a rail;\n * \"grid\" lays them out in responsive columns for full-width\n * placement below the article.\n */\n layout?: 'column' | 'grid';\n}\n\nconst { detail, sticky = true, layout = 'column' } = Astro.props;\nconst {\n sidebar,\n github,\n stars,\n forks,\n language,\n licenseSpdx,\n pushedLabel,\n repoUrl,\n ownerRepo,\n healthLabel,\n activityBadge,\n stacks,\n platforms,\n tags,\n category,\n contributionSignals,\n languages,\n totalLanguageBytes,\n readingMetrics,\n record,\n firstCommitYear,\n lastFetchedLabel,\n reviewedAtLabel,\n} = detail;\nconst alsoIn: Array<{ url: string; title: string }> = detail.collectionMembership ?? [];\n\n// Visibility helpers for individual rows inside the Activity card.\n// `hasRepo` is the discriminator between \"GitHub data synced\" and\n// \"no data fetched yet\" — without it the card would show \"Stars 0\"\n// even when the field was never populated.\nconst repo = github;\nconst hasRepo = !!repo;\nconst starsNumber = typeof stars === 'number' && stars > 0 ? stars : null;\nconst forksNumber = typeof forks === 'number' && forks > 0 ? forks : null;\n// `repo` is a loosely-typed passthrough of the raw GitHub API response\n// (see `@grove-dev/astro/server`'s `getRecordDetailModel`) — `releases`\n// isn't in the normalized `githubMetadataSchema`, so it arrives as\n// `unknown` and needs a local shape for the three fields read below.\nconst recentReleases = (\n (repo?.releases as Array<{ html_url?: string; tag_name?: string; name?: string }> | undefined) ??\n []\n).slice(0, 1);\nconst isArchived = !!repo?.archived;\n\n// Render a kv row only when both the label and value have content.\nfunction row(label: string, value: unknown) {\n if (value === null || value === undefined || value === '') return null;\n return { label, value };\n}\n---\n\n<aside\n class:list={[\n layout === \"grid\"\n ? \"grove-sidebar grid grid-cols-1 items-start gap-4 sm:grid-cols-2 xl:grid-cols-4\"\n : \"grove-sidebar flex flex-col gap-4\",\n layout === \"column\" &&\n sticky &&\n \"lg:sticky lg:top-20 lg:max-h-[calc(100vh-5rem)] lg:self-start lg:overflow-y-auto\",\n ]}\n aria-label=\"Record metadata\"\n>\n\n {/* ── Activity card ──────────────────────────────────────── */}\n {sidebar.showActivity && (\n <section\n class=\"grove-card rounded-[var(--radius-lg)] border border-ink-200 bg-card p-4 dark:border-ink-800\"\n aria-labelledby=\"sidebar-activity-title\"\n >\n <h2\n id=\"sidebar-activity-title\"\n class=\"grove-card-title m-0 mb-3 text-2xs font-semibold uppercase tracking-wider text-ink-500 dark:text-ink-400\"\n >\n Activity\n </h2>\n <dl class=\"grove-kv m-0 flex flex-col gap-2.5 text-sm\">\n {row(\"Stars\", starsNumber !== null ? starsNumber : null) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Stars</dt>\n <dd class=\"font-mono tabular-nums text-ink-900 dark:text-ink-100\">{starsNumber!.toLocaleString()}</dd>\n </div>\n )}\n {row(\"Forks\", forksNumber !== null ? forksNumber.toLocaleString() : null) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Forks</dt>\n <dd class=\"font-mono tabular-nums text-ink-900 dark:text-ink-100\">{forksNumber!.toLocaleString()}</dd>\n </div>\n )}\n {row(\"Contributors\", repo?.contributors_count) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Contributors</dt>\n <dd class=\"font-mono tabular-nums text-ink-900 dark:text-ink-100\">{Number(repo!.contributors_count).toLocaleString()}</dd>\n </div>\n )}\n {row(\"Open issues\", repo?.open_issues_count) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Open issues</dt>\n <dd class=\"font-mono tabular-nums text-ink-900 dark:text-ink-100\">{Number(repo!.open_issues_count).toLocaleString()}</dd>\n </div>\n )}\n {row(\"Watchers\", repo?.subscribers_count) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Watchers</dt>\n <dd class=\"font-mono tabular-nums text-ink-900 dark:text-ink-100\">{Number(repo!.subscribers_count).toLocaleString()}</dd>\n </div>\n )}\n {row(\"Language\", language) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Language</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">{language}</dd>\n </div>\n )}\n {row(\"License\", licenseSpdx) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">License</dt>\n <dd class=\"font-mono text-ink-900 dark:text-ink-100\">{licenseDisplay(licenseSpdx)}</dd>\n </div>\n )}\n {row(\"Default branch\", repo?.default_branch) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Default branch</dt>\n <dd class=\"font-mono text-ink-900 dark:text-ink-100\">{repo!.default_branch}</dd>\n </div>\n )}\n {row(\"First commit\", firstCommitYear) && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">First commit</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">\n <time datetime={String(repo!.created_at)}>{firstCommitYear}</time>\n </dd>\n </div>\n )}\n {recentReleases[0] && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Latest release</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">\n <a\n href={recentReleases[0].html_url ?? repoUrl}\n target=\"_blank\"\n rel=\"noopener noreferrer\"\n class=\"no-underline hover:underline\"\n >\n {recentReleases[0].tag_name ?? recentReleases[0].name ?? \"—\"}\n </a>\n </dd>\n </div>\n )}\n </dl>\n\n <LanguageBreakdown languages={languages} totalBytes={totalLanguageBytes} />\n </section>\n )}\n\n {/* ── Freshness card ─────────────────────────────────────── */}\n {sidebar.showFreshness && (\n <section\n class=\"grove-card rounded-[var(--radius-lg)] border border-ink-200 bg-card p-4 dark:border-ink-800\"\n aria-labelledby=\"sidebar-freshness-title\"\n >\n <h2\n id=\"sidebar-freshness-title\"\n class=\"grove-card-title m-0 mb-3 text-2xs font-semibold uppercase tracking-wider text-ink-500 dark:text-ink-400\"\n >\n Freshness\n </h2>\n <dl class=\"grove-kv m-0 flex flex-col gap-2.5 text-sm\">\n {pushedLabel && pushedLabel !== \"—\" && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Last commit</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">{pushedLabel}</dd>\n </div>\n )}\n {repo?.updated_at && lastFetchedLabel && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Last fetched</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">\n <time datetime={String(repo.updated_at)}>{lastFetchedLabel}</time>\n </dd>\n </div>\n )}\n {activityBadge && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Maintenance</dt>\n <dd>\n <span data-activity-tone={activityBadge.tone} class=\"grove-pill grove-pill--activity inline-flex items-center gap-1 rounded border px-1.5 py-0.5 text-[10px] font-medium\">\n {activityBadge.label}\n </span>\n </dd>\n </div>\n )}\n {healthLabel && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Health</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">{healthLabel}</dd>\n </div>\n )}\n {isArchived && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Status</dt>\n <dd><Badge variant=\"warning\">Archived</Badge></dd>\n </div>\n )}\n {repo?.homepage && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Docs</dt>\n <dd class=\"truncate text-ink-900 dark:text-ink-100\">\n <a href={String(repo.homepage)} target=\"_blank\" rel=\"noopener noreferrer\" class=\"no-underline hover:underline\">\n {new URL(String(repo.homepage)).hostname}\n </a>\n </dd>\n </div>\n )}\n {repoUrl && (\n <div class=\"flex items-baseline justify-between gap-3\">\n <dt class=\"text-ink-500 dark:text-ink-400\">Source</dt>\n <dd class=\"text-ink-900 dark:text-ink-100\">\n <a href={repoUrl} target=\"_blank\" rel=\"noopener noreferrer\" class=\"no-underline hover:underline\">\n {ownerRepo ? `${ownerRepo.owner}/${ownerRepo.repo}` : repoUrl}\n </a>\n </dd>\n </div>\n )}\n </dl>\n </section>\n )}\n\n {/* ── Ecosystem card ─────────────────────────────────────── */}\n {sidebar.showEcosystem && (\n <section\n class=\"grove-card rounded-[var(--radius-lg)] border border-ink-200 bg-card p-4 dark:border-ink-800\"\n aria-labelledby=\"sidebar-ecosystem-title\"\n >\n <h2\n id=\"sidebar-ecosystem-title\"\n class=\"grove-card-title m-0 mb-3 text-2xs font-semibold uppercase tracking-wider text-ink-500 dark:text-ink-400\"\n >\n Ecosystem\n </h2>\n\n {stacks.length > 0 && (\n <div class=\"mb-3\">\n <h3 class=\"m-0 mb-1.5 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">Stack</h3>\n <ul class=\"m-0 flex list-none flex-wrap gap-1.5 p-0\">\n {stacks.map((s) => (\n <li>\n <a href={`/${detail.slug}?stack=${encodeURIComponent(s)}`} class=\"inline-flex items-center gap-1.5 rounded-full bg-secondary py-0.5 pl-1.5 pr-2 text-2xs font-medium text-secondary-foreground no-underline\">\n <Icon name={s} category=\"stack\" size={12} />\n {taxonomyLabel(\"stacks\", s)}\n </a>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {platforms.length > 0 && (\n <div class=\"mb-3\">\n <h3 class=\"m-0 mb-1.5 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">Platforms</h3>\n <ul class=\"m-0 flex list-none flex-wrap gap-1.5 p-0\">\n {platforms.map((p) => (\n <li class=\"inline-flex items-center gap-1.5 rounded-full border border-ink-200 py-0.5 pl-1.5 pr-2 text-2xs font-medium text-ink-700 dark:border-ink-800 dark:text-ink-300\">\n <Icon name={p} category=\"platform\" size={12} />\n {taxonomyLabel(\"platforms\", p)}\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {category && (\n <div class=\"mb-3\">\n <h3 class=\"m-0 mb-1.5 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">Category</h3>\n <a href={`/${detail.slug}?category=${encodeURIComponent(category)}`} class=\"rounded-full bg-secondary px-2 py-0.5 text-2xs font-medium text-secondary-foreground no-underline\">\n {taxonomyLabel(\"categories\", category)}\n </a>\n </div>\n )}\n\n {tags.length > 0 && (\n <div class=\"mb-3\">\n <h3 class=\"m-0 mb-1.5 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">Tags</h3>\n <ul class=\"m-0 flex list-none flex-wrap gap-1.5 p-0\">\n {tags.map((t) => (\n <li>\n <a href={`/${detail.slug}?tag=${encodeURIComponent(t)}`} class=\"rounded-full border border-ink-200 px-2 py-0.5 text-2xs font-medium text-ink-700 no-underline dark:border-ink-800 dark:text-ink-300\">\n {taxonomyLabel(\"topics\", t)}\n </a>\n </li>\n ))}\n </ul>\n </div>\n )}\n\n {contributionSignals.length > 0 && (\n <div>\n <h3 class=\"m-0 mb-1.5 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">Repository hygiene</h3>\n <ul class=\"m-0 flex list-none flex-col gap-1 p-0 text-sm\">\n {contributionSignals.map((s) => (\n <li class=\"inline-flex items-center gap-1.5 text-ink-700 dark:text-ink-200\">\n {s.ok ? (\n <svg viewBox=\"0 0 16 16\" width=\"11\" height=\"11\" aria-hidden=\"true\" fill=\"currentColor\" class=\"text-emerald-600 dark:text-emerald-400\">\n <path d=\"M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 0 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z\" />\n </svg>\n ) : (\n <svg viewBox=\"0 0 16 16\" width=\"11\" height=\"11\" aria-hidden=\"true\" fill=\"currentColor\" class=\"text-ink-400\">\n <path d=\"M3.72 3.72a.75.75 0 0 1 1.06 0L8 6.94l3.22-3.22a.75.75 0 1 1 1.06 1.06L9.06 8l3.22 3.22a.75.75 0 1 1-1.06 1.06L8 9.06l-3.22 3.22a.75.75 0 0 1-1.06-1.06L6.94 8 3.72 4.78a.75.75 0 0 1 0-1.06Z\" />\n </svg>\n )}\n {s.label}\n </li>\n ))}\n </ul>\n </div>\n )}\n </section>\n )}\n\n {/* ── Source card (small) ────────────────────────────────── */}\n {sidebar.showSource && (\n <section\n class=\"grove-card grove-card--muted rounded-[var(--radius-lg)] border border-dashed border-ink-200 bg-card/50 p-4 text-2xs text-ink-500 dark:border-ink-800 dark:text-ink-400\"\n aria-labelledby=\"sidebar-source-title\"\n >\n <h2\n id=\"sidebar-source-title\"\n class=\"grove-card-title m-0 mb-1.5 text-2xs font-semibold uppercase tracking-wider text-ink-500 dark:text-ink-400\"\n >\n Source\n </h2>\n <p class=\"m-0 leading-relaxed\">\n Reviewed by {record.curation?.reviewedBy ?? \"grove\"}\n on <time datetime={String(record.curation?.reviewedAt)}>\n {reviewedAtLabel ?? \"—\"}\n </time>.\n </p>\n {alsoIn.length > 0 && (\n <p class=\"m-0 mt-1.5 leading-relaxed\">\n <span class=\"font-semibold\">Also in: </span>\n {alsoIn.map((c, i) => (\n <>\n <a href={c.url} class=\"text-inherit no-underline hover:underline\">{c.title}</a>{i < alsoIn.length - 1 ? \", \" : \"\"}\n </>\n ))}\n </p>\n )}\n {readingMetrics.wordCount > 0 && (\n <p class=\"m-0 mt-1 leading-relaxed\">\n Notes: {readingMetrics.wordCount.toLocaleString()} words · {readingMetrics.minutes} min read.\n </p>\n )}\n </section>\n )}\n</aside>",
|
|
27
|
+
"type": "registry:component",
|
|
28
|
+
"target": "~/src/components/grove/record-sidebar.astro"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"path": "default/components/grove/editorial-summary.astro",
|
|
32
|
+
"content": "---\n/**\n * EditorialSummary.astro\n *\n * Compact card at the top of the record body that surfaces the\n * curator's \"Best for\" and \"Consider before using\" notes. Renders\n * nothing when both arrays are empty.\n *\n * This is the editorial half of the page: the sidebar (right) is\n * auto-generated facts; the summary (left) is human-authored\n * curation.\n */\ninterface Props {\n bestFor: string[];\n caveats: string[];\n}\n\nconst { bestFor, caveats } = Astro.props;\nconst hasAny = bestFor.length > 0 || caveats.length > 0;\n---\n\n{hasAny && (\n <section class=\"grove-editorial mb-10 rounded-[var(--radius-lg)] border border-ink-200 bg-card p-5 dark:border-ink-800\" aria-label=\"Editorial summary\">\n <h2 class=\"sr-only\">Editorial summary</h2>\n <div class=\"grid grid-cols-1 gap-5 sm:grid-cols-2\">\n {bestFor.length > 0 && (\n <div>\n <h3 class=\"m-0 flex items-center gap-1.5 text-2xs font-semibold uppercase tracking-wider text-success\">\n <svg viewBox=\"0 0 16 16\" width=\"11\" height=\"11\" aria-hidden=\"true\" fill=\"currentColor\">\n <path d=\"M13.78 4.22a.75.75 0 0 1 0 1.06l-7.25 7.25a.75.75 0 0 1-1.06 0L2.22 9.28a.75.75 0 0 1 1.06-1.06L6 10.94l6.72-6.72a.75.75 0 0 1 1.06 0Z\" />\n </svg>\n Best for\n </h3>\n <ul class=\"mt-2 m-0 flex list-none flex-col gap-1.5 p-0 text-sm text-ink-700 dark:text-ink-200\">\n {bestFor.map((b) => (\n <li class=\"leading-relaxed\">{b}</li>\n ))}\n </ul>\n </div>\n )}\n {caveats.length > 0 && (\n <div>\n <h3 class=\"m-0 flex items-center gap-1.5 text-2xs font-semibold uppercase tracking-wider text-warning\">\n <svg viewBox=\"0 0 16 16\" width=\"11\" height=\"11\" aria-hidden=\"true\" fill=\"currentColor\">\n <path d=\"M8 1.5a6.5 6.5 0 1 0 0 13 6.5 6.5 0 0 0 0-13zM0 8a8 8 0 1 1 16 0A8 8 0 0 1 0 8zm9 3a1 1 0 1 1-2 0 1 1 0 0 1 2 0zm-.25-6.25a.75.75 0 0 0-1.5 0v3.5a.75.75 0 0 0 .4 1.04l1.6.8a.75.75 0 1 0 .67-1.34l-1.17-.59V4.75z\" />\n </svg>\n Consider before using\n </h3>\n <ul class=\"mt-2 m-0 flex list-none flex-col gap-1.5 p-0 text-sm text-ink-700 dark:text-ink-200\">\n {caveats.map((c) => (\n <li class=\"leading-relaxed\">{c}</li>\n ))}\n </ul>\n </div>\n )}\n </div>\n </section>\n)}",
|
|
33
|
+
"type": "registry:component",
|
|
34
|
+
"target": "~/src/components/grove/editorial-summary.astro"
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
"path": "default/components/grove/table-of-contents.astro",
|
|
38
|
+
"content": "---\n/**\n * TableOfContents.astro\n *\n * Collapsible on-page nav for a record's Markdown body.\n *\n * Behavior:\n * - Mobile (below lg): rendered as a closed `<details>` dropdown.\n * - Desktop (lg+): forced open by the `.grove-toc` media rule in\n * `styles.css` (CSS reveals the list without the `open`\n * attribute) so the nav stays visible while the user scrolls.\n * - Heading IDs come from the markdown renderer; the TOC entries\n * are pre-computed by `extractToc` and passed in.\n *\n * The scroll-spy + smooth-scroll logic lives in an inline script\n * that finds every `data-toc-link` on the page and highlights the\n * link whose target is closest to the top of the viewport (rAF-\n * throttled). Active styling comes from the `data-toc-active`\n * attribute toggled in the script + CSS rules in `styles.css`.\n */\nimport type { TocEntry } from '@grove-dev/core';\n\ninterface Props {\n /** Heading entries from `extractToc`. */\n items: TocEntry[];\n /** Optional accessible label override. */\n label?: string;\n}\n\nconst { items, label = 'On this page' } = Astro.props;\nconst hasItems = items.length > 1;\n---\n\n{hasItems && (\n <details class=\"grove-toc lg:border-0\">\n <summary class=\"cursor-pointer list-none pb-3 text-2xs font-semibold uppercase tracking-wider text-ink-500 hover:text-ink-900 dark:text-ink-400 dark:hover:text-ink-100 lg:cursor-default lg:pointer-events-none lg:pb-2\">\n <span class=\"inline-flex items-center gap-1.5\">\n <svg viewBox=\"0 0 16 16\" width=\"11\" height=\"11\" aria-hidden=\"true\" fill=\"currentColor\" class=\"grove-toc-chevron transition-transform lg:hidden\">\n <path d=\"M6 4l4 4-4 4V4z\" />\n </svg>\n {label}\n </span>\n </summary>\n {/* Full list, no inner scroll — the TOC lives in the right rail\n and every entry stays visible. h3 entries indent further under\n their h2 parents; the active state is a left-rail indicator +\n text-color emphasis set by the script + styles.css. */}\n <ol class=\"grove-toc-list list-none py-1 text-sm lg:py-0\">\n {items.map((entry) => (\n <li\n class:list={[\n \"grove-toc-item relative\",\n entry.depth >= 3 && \"grove-toc-item--h3\",\n ]}\n >\n <a\n href={`#${entry.id}`}\n class:list={[\n \"grove-toc-link block py-1.5 text-ink-500 no-underline transition-colors hover:text-ink-900 dark:text-ink-400 dark:hover:text-ink-100\",\n entry.depth >= 2 && \"pl-3 lg:pl-4\",\n entry.depth >= 3 && \"pl-6 text-[0.8125rem] lg:pl-7\",\n ]}\n data-toc-link={entry.id}\n >\n {entry.text}\n </a>\n </li>\n ))}\n </ol>\n </details>\n)}\n\n{hasItems && (\n <script is:inline define:vars={{ tocIds: items.map((i) => i.id) }}>\n (function () {\n // Desktop (lg+): force the details open so the nav stays visible\n // while scrolling; the summary is pointer-events-none there. On\n // narrow viewports restore the closed dropdown default. CSS in\n // styles.css covers the no-JS case.\n var toc = document.querySelector(\".grove-toc\");\n if (toc) {\n var mq = window.matchMedia(\"(min-width: 64rem)\");\n var syncOpen = function () { toc.open = mq.matches; };\n if (typeof mq.addEventListener === \"function\") {\n mq.addEventListener(\"change\", syncOpen);\n }\n syncOpen();\n }\n\n // Smooth scroll + history-replace on TOC link clicks.\n function onClick(e) {\n var link = e.target.closest(\"a[data-toc-link]\");\n if (!link) return;\n e.preventDefault();\n var id = link.getAttribute(\"data-toc-link\");\n var target = document.getElementById(id);\n if (!target) return;\n target.scrollIntoView({ behavior: \"smooth\", block: \"start\" });\n history.replaceState(null, \"\", \"#\" + id);\n }\n document.addEventListener(\"click\", onClick);\n\n // Scroll-spy: rAF-throttled, toggles `data-toc-active` on the\n // link whose heading is closest to the top of the viewport.\n // CSS handles the active styling — no dynamic Tailwind classes.\n var headings = tocIds\n .map(function (id) { return document.getElementById(id); })\n .filter(function (el) { return !!el; });\n if (!headings.length) return;\n var links = new Map();\n document.querySelectorAll(\"a[data-toc-link]\").forEach(function (a) {\n links.set(a.getAttribute(\"data-toc-link\"), a);\n });\n var active = null;\n var ticking = false;\n function update() {\n ticking = false;\n var top = window.scrollY + 140;\n var current = headings[0].id;\n for (var i = 0; i < headings.length; i++) {\n if (headings[i].offsetTop <= top) current = headings[i].id;\n else break;\n }\n if (current === active) return;\n active = current;\n links.forEach(function (a, id) {\n if (id === current) a.setAttribute(\"data-toc-active\", \"\");\n else a.removeAttribute(\"data-toc-active\");\n });\n }\n function onScroll() {\n if (ticking) return;\n ticking = true;\n requestAnimationFrame(update);\n }\n window.addEventListener(\"scroll\", onScroll, { passive: true });\n update();\n })();\n </script>\n)}",
|
|
39
|
+
"type": "registry:component",
|
|
40
|
+
"target": "~/src/components/grove/table-of-contents.astro"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"path": "default/components/grove/markdown-body.astro",
|
|
44
|
+
"content": "---\n/**\n * MarkdownBody.astro\n *\n * Renders a record's pre-sanitized Markdown body (`getContentHtml`)\n * inside the package's `.grove-prose` stylesheet.\n *\n * The renderer itself lives in `@grove-dev/astro/server/directory.ts`\n * (`renderMarkdownToSafeHtml`) and runs once per record at module\n * load; this component is the presentation half of that pipeline.\n *\n * Props:\n * - `recordSlug`: the **record's** slug (not the route prefix).\n * `getContentHtml` is keyed by record slug — `detail.slug` is the\n * route prefix (e.g. \"projects\"), `detail.record.slug` is the\n * record (e.g. \"crewai\").\n * - `fallback`: optional content to render when the record has no\n * body (e.g. an empty-state message).\n */\nimport { getContentHtml } from '@grove-dev/astro/server';\n\ninterface Props {\n /** Record slug — looks up the pre-rendered HTML in the module map. */\n recordSlug: string;\n /** Optional fallback content for records without a body. */\n fallback?: string;\n}\n\nconst { recordSlug, fallback } = Astro.props;\nconst html = getContentHtml(recordSlug);\n---\n\n{html ? (\n <div class=\"grove-prose\" set:html={html} />\n) : fallback ? (\n <p class=\"grove-prose text-ink-500 dark:text-ink-400\">{fallback}</p>\n) : null}",
|
|
45
|
+
"type": "registry:component",
|
|
46
|
+
"target": "~/src/components/grove/markdown-body.astro"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
"path": "default/components/grove/language-breakdown.astro",
|
|
50
|
+
"content": "---\n/**\n * LanguageBreakdown.astro\n *\n * Visual GitHub-Linguist-style code-composition bar plus a legend\n * showing each language's percentage. Reads from the record's\n * pre-computed `languages` array (top-5 by bytes) and `langColor`\n * (in @grove-dev/core).\n *\n * Used inside the Activity sidebar card.\n */\nimport { langColor } from '@grove-dev/core';\n\ninterface LangEntry {\n name: string;\n bytes: number;\n}\n\ninterface Props {\n /** Top-N languages as `[name, bytes]` tuples (already sorted). */\n languages: ReadonlyArray<readonly [string, number]>;\n /** Total bytes across all languages (denominator). */\n totalBytes: number;\n /** Optional max segments to show. */\n maxSegments?: number;\n}\n\nconst { languages, totalBytes, maxSegments = 5 } = Astro.props;\n\nconst segments = languages.slice(0, maxSegments).map(([name, bytes]) => {\n const pct = Math.round((bytes / Math.max(1, totalBytes)) * 100);\n return { name, pct, color: langColor(name) };\n});\n---\n\n{segments.length > 0 && (\n <div class=\"grove-langbreak mt-4 border-t border-ink-100 pt-4 dark:border-ink-800\">\n <h3 class=\"m-0 text-2xs font-semibold uppercase tracking-wider text-ink-500 dark:text-ink-400\">\n Code composition\n </h3>\n <div\n class=\"grove-langbreak-bar mt-2 flex h-2 w-full overflow-hidden rounded-full bg-ink-100 dark:bg-ink-800\"\n role=\"img\"\n aria-label={`Code composition: ${segments.map((s) => `${s.name} ${s.pct}%`).join(', ')}`}\n >\n {segments.map((s) => (\n <span\n class=\"grove-langbreak-seg h-full\"\n style={`width:${s.pct}%;background-color:${s.color}`}\n title={`${s.name}: ${s.pct}%`}\n />\n ))}\n </div>\n <ul class=\"grove-langbreak-list mt-2 flex flex-wrap gap-x-3 gap-y-1 text-2xs text-ink-500 dark:text-ink-400\">\n {segments.map((s) => (\n <li class=\"inline-flex items-center gap-1\">\n <span\n class=\"inline-block h-2 w-2 rounded-sm\"\n style={`background-color:${s.color}`}\n />\n <span class=\"font-mono\">{s.name}</span>\n <span>{s.pct}%</span>\n </li>\n ))}\n </ul>\n </div>\n)}",
|
|
51
|
+
"type": "registry:component",
|
|
52
|
+
"target": "~/src/components/grove/language-breakdown.astro"
|
|
53
|
+
}
|
|
54
|
+
],
|
|
55
|
+
"meta": {
|
|
56
|
+
"version": "1.0.0"
|
|
57
|
+
},
|
|
58
|
+
"type": "registry:block"
|
|
59
|
+
}
|