@grove-dev/cli 0.10.0 → 0.12.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/dist/collection-cli.d.ts.map +1 -1
- package/dist/collection-cli.js +11 -0
- package/dist/collection-cli.js.map +1 -1
- package/dist/index.js +24 -12
- package/dist/index.js.map +1 -1
- package/dist/package.json +1 -1
- package/dist/r/about.json +3 -3
- package/dist/r/browse.json +4 -4
- package/dist/r/collections.json +5 -5
- package/dist/r/contributors.json +2 -2
- package/dist/r/default.json +30 -18
- package/dist/r/home.json +4 -4
- package/dist/r/not-found.json +3 -3
- package/dist/r/project-card.json +2 -2
- package/dist/r/record.json +17 -5
- package/dist/r/registry.json +46 -26
- package/dist/r/shell.json +2 -2
- package/dist/r/submit.json +2 -2
- package/dist/r/taxonomy.json +5 -5
- package/dist/r/ui.json +2 -2
- package/dist/readme-cli.d.ts.map +1 -1
- package/dist/readme-cli.js +26 -16
- package/dist/readme-cli.js.map +1 -1
- package/dist/sync-summary.d.ts +42 -0
- package/dist/sync-summary.d.ts.map +1 -0
- package/dist/sync-summary.js +90 -0
- package/dist/sync-summary.js.map +1 -0
- package/package.json +3 -3
package/dist/r/home.json
CHANGED
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
"files": [
|
|
14
14
|
{
|
|
15
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}
|
|
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
17
|
"type": "registry:page",
|
|
18
18
|
"target": "~/src/pages/index.astro"
|
|
19
19
|
},
|
|
@@ -37,7 +37,7 @@
|
|
|
37
37
|
},
|
|
38
38
|
{
|
|
39
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}
|
|
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
41
|
"type": "registry:component",
|
|
42
42
|
"target": "~/src/components/grove/record-section.astro"
|
|
43
43
|
},
|
|
@@ -61,8 +61,8 @@
|
|
|
61
61
|
}
|
|
62
62
|
],
|
|
63
63
|
"meta": {
|
|
64
|
-
"version": "1.
|
|
65
|
-
"requiresGrove": "0.
|
|
64
|
+
"version": "1.3.0",
|
|
65
|
+
"requiresGrove": "0.12.0"
|
|
66
66
|
},
|
|
67
67
|
"type": "registry:block"
|
|
68
68
|
}
|
package/dist/r/not-found.json
CHANGED
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
{
|
|
12
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}
|
|
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
14
|
"type": "registry:page",
|
|
15
15
|
"target": "~/src/pages/404.astro"
|
|
16
16
|
}
|
|
17
17
|
],
|
|
18
18
|
"meta": {
|
|
19
|
-
"version": "1.
|
|
20
|
-
"requiresGrove": "0.
|
|
19
|
+
"version": "1.3.0",
|
|
20
|
+
"requiresGrove": "0.12.0"
|
|
21
21
|
},
|
|
22
22
|
"type": "registry:block"
|
|
23
23
|
}
|
package/dist/r/project-card.json
CHANGED
package/dist/r/record.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"files": [
|
|
12
12
|
{
|
|
13
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 {
|
|
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 records from '@grove/generated/records.json';\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getRecordContextModel,\n getRecordDetailModel,\n loadCollections,\n recordDetailPaths,\n recordsToCollectionEntries,\n} 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 RecordRelations from '../../components/grove/record-relations.astro';\nimport RecordSidebar from '../../components/grove/record-sidebar.astro';\nimport RelatedRecords from '../../components/grove/related-records.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// Where this page links out to: subject hubs, sibling records, and the\n// collections the record appears in.\nconst context = getRecordContextModel(record, {\n collections: await loadCollections(process.cwd()),\n entries: recordsToCollectionEntries(\n (records as { records: unknown[] }).records as never,\n siteConfig,\n ),\n subjects: siteConfig.taxonomy?.subjects ?? [],\n});\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 <RecordRelations relations={context.relations} />\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\n bestFor={detail.bestFor}\n caveats={detail.caveats}\n whyListed={detail.whyListed}\n />\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 <RelatedRecords context={context} />\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
15
|
"type": "registry:page",
|
|
16
16
|
"target": "~/src/pages/[slug]/[recordSlug].astro"
|
|
17
17
|
},
|
|
@@ -23,16 +23,28 @@
|
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
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 addedAtLabel,\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={`/stacks/${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={`/categories/${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)}`} rel=\"nofollow\" 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 {addedAtLabel && (\n <p class=\"m-0 leading-relaxed\">\n Added on <time datetime={String(record.addedAt)}>{addedAtLabel}</time>.\n </p>\n )}\n {/* Only when a curator actually reviewed the record. This line\n used to render unconditionally with an em dash where the date\n belongs, and gated the whole card besides. */}\n {reviewedAtLabel && (\n <p class:list={[\"m-0 leading-relaxed\", addedAtLabel && \"mt-1.5\"]}>\n Reviewed by {record.curation?.reviewedBy ?? \"grove\"}\n on <time datetime={String(record.curation?.reviewedAt)}>\n {reviewedAtLabel}\n </time>.\n </p>\n )}\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>",
|
|
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 addedAtLabel,\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={`/stacks/${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={`/categories/${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)}`} rel=\"nofollow\" 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 {addedAtLabel && (\n <p class=\"m-0 leading-relaxed\">\n Added on <time datetime={String(record.addedAt)}>{addedAtLabel}</time>.\n </p>\n )}\n {/* Only when a curator actually reviewed the record. This line\n used to render unconditionally with an em dash where the date\n belongs, and gated the whole card besides. */}\n {reviewedAtLabel && (\n <p class:list={[\"m-0 leading-relaxed\", addedAtLabel && \"mt-1.5\"]}>\n Reviewed by {record.curation?.reviewedBy ?? \"grove\"}\n on <time datetime={String(record.curation?.reviewedAt)}>\n {reviewedAtLabel}\n </time>.\n </p>\n )}\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
27
|
"type": "registry:component",
|
|
28
28
|
"target": "~/src/components/grove/record-sidebar.astro"
|
|
29
29
|
},
|
|
30
30
|
{
|
|
31
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
|
|
32
|
+
"content": "---\n/**\n * EditorialSummary.astro\n *\n * Compact card at the top of the record body that surfaces the\n * curator's \"Why it's listed\", \"Best for\" and \"Consider before using\"\n * notes. Renders nothing when all three 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 /** Why the curator included this record. Optional for older pages. */\n whyListed?: string[];\n}\n\nconst { bestFor, caveats, whyListed = [] } = Astro.props;\nconst hasAny = bestFor.length > 0 || caveats.length > 0 || whyListed.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 {whyListed.length > 0 && (\n <div class:list={[(bestFor.length > 0 || caveats.length > 0) && 'mb-5 border-b border-ink-200 pb-5 dark:border-ink-800']}>\n <h3 class=\"m-0 text-2xs font-semibold uppercase tracking-wider text-muted-foreground\">\n Why it's listed\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 {whyListed.map((w) => (\n <li class=\"leading-relaxed\">{w}</li>\n ))}\n </ul>\n </div>\n )}\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
33
|
"type": "registry:component",
|
|
34
34
|
"target": "~/src/components/grove/editorial-summary.astro"
|
|
35
35
|
},
|
|
36
|
+
{
|
|
37
|
+
"path": "default/components/grove/record-relations.astro",
|
|
38
|
+
"content": "---\n/**\n * RecordRelations.astro\n *\n * The record's relations to subjects — \"Alternative to Notion\" — as a\n * row of links under the header. Each links to the subject's hub\n * collection when one exists, so a reader who came for one alternative\n * can reach the page that compares all of them. Without a hub the\n * subject renders as plain text: a link to the vendor would send the\n * reader away from the directory at the top of the page.\n *\n * A relation the curator inferred (`evidence.type: editorial`) is\n * marked as such; one the project states itself is not second-guessed.\n *\n * Renders nothing when the record has no relations.\n */\nimport type { RecordContextModel } from '@grove-dev/astro/server';\n\ninterface Props {\n relations: RecordContextModel['relations'];\n}\n\nconst { relations } = Astro.props;\n---\n\n{relations.length > 0 && (\n <ul class=\"m-0 mb-8 flex list-none flex-wrap gap-2 p-0\" aria-label=\"Related products\">\n {relations.map((relation) => (\n <li class=\"m-0 inline-flex items-center gap-1.5 rounded-full border border-border bg-card px-3 py-1 text-xs text-muted-foreground\">\n <span>{relation.label}</span>\n {relation.hub ? (\n <a href={relation.hub.url} class=\"font-medium text-foreground underline-offset-2 hover:underline\">\n {relation.subject.name}\n </a>\n ) : (\n <span class=\"font-medium text-foreground\">{relation.subject.name}</span>\n )}\n {relation.evidence?.type === 'editorial' && (\n <span title=\"The curator's comparison, not the project's own claim\">· editor's match</span>\n )}\n </li>\n ))}\n </ul>\n)}\n",
|
|
39
|
+
"type": "registry:component",
|
|
40
|
+
"target": "~/src/components/grove/record-relations.astro"
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
"path": "default/components/grove/related-records.astro",
|
|
44
|
+
"content": "---\n/**\n * RelatedRecords.astro\n *\n * Where a record page leads next: sibling records that share a subject\n * (\"Other alternatives to Notion\") and the collections the record\n * appears in. Both come from `getRecordContextModel`. Before this, a\n * detail page linked to its stack and its category and nothing else.\n *\n * Renders nothing when there is neither.\n */\nimport type { RecordContextModel } from '@grove-dev/astro/server';\n\ninterface Props {\n context: RecordContextModel;\n}\n\nconst { context } = Astro.props;\nconst hasAny = context.relatedRecords.length > 0 || context.collectionMembership.length > 0;\n---\n\n{hasAny && (\n <section class=\"mt-12 border-t border-border pt-8\" aria-label=\"Related\">\n {context.relatedRecords.map((group) => (\n <div class=\"mb-8\">\n <h2 class=\"m-0 text-[1.125rem] font-semibold tracking-tight text-foreground\">\n Other {group.label.toLowerCase().replace(/ to$/, 's to')} {group.subject.name}\n </h2>\n <ul class=\"m-0 mt-3 grid list-none grid-cols-1 gap-2 p-0 sm:grid-cols-2\">\n {group.records.map((r) => (\n <li class=\"m-0 rounded-md border border-border bg-card px-3 py-2.5\">\n <a href={r.url} class=\"text-sm font-medium text-foreground no-underline hover:underline\">{r.title}</a>\n {r.description && (\n <p class=\"m-0 mt-1 line-clamp-2 text-[0.8125rem] leading-relaxed text-muted-foreground\">{r.description}</p>\n )}\n </li>\n ))}\n </ul>\n {group.hub && (\n <p class=\"m-0 mt-3 text-sm\">\n <a href={group.hub.url} class=\"font-medium text-foreground underline underline-offset-2\">\n Compare them all: {group.hub.title} →\n </a>\n </p>\n )}\n </div>\n ))}\n\n {context.collectionMembership.length > 0 && (\n <div>\n <h2 class=\"m-0 text-[1.125rem] font-semibold tracking-tight text-foreground\">Featured in</h2>\n <ul class=\"m-0 mt-3 flex list-none flex-wrap gap-2 p-0\">\n {context.collectionMembership.map((c) => (\n <li class=\"m-0\">\n <a href={c.url} class=\"inline-flex rounded-full border border-border bg-card px-3 py-1 text-sm text-foreground no-underline hover:border-ink-400\">\n {c.title}\n </a>\n </li>\n ))}\n </ul>\n </div>\n )}\n </section>\n)}\n",
|
|
45
|
+
"type": "registry:component",
|
|
46
|
+
"target": "~/src/components/grove/related-records.astro"
|
|
47
|
+
},
|
|
36
48
|
{
|
|
37
49
|
"path": "default/components/grove/table-of-contents.astro",
|
|
38
50
|
"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)}",
|
|
@@ -53,8 +65,8 @@
|
|
|
53
65
|
}
|
|
54
66
|
],
|
|
55
67
|
"meta": {
|
|
56
|
-
"version": "1.
|
|
57
|
-
"requiresGrove": "0.
|
|
68
|
+
"version": "1.3.0",
|
|
69
|
+
"requiresGrove": "0.12.0"
|
|
58
70
|
},
|
|
59
71
|
"type": "registry:block"
|
|
60
72
|
}
|
package/dist/r/registry.json
CHANGED
|
@@ -46,8 +46,8 @@
|
|
|
46
46
|
}
|
|
47
47
|
],
|
|
48
48
|
"meta": {
|
|
49
|
-
"version": "1.
|
|
50
|
-
"requiresGrove": "0.
|
|
49
|
+
"version": "1.3.0",
|
|
50
|
+
"requiresGrove": "0.12.0"
|
|
51
51
|
}
|
|
52
52
|
},
|
|
53
53
|
{
|
|
@@ -112,8 +112,8 @@
|
|
|
112
112
|
}
|
|
113
113
|
],
|
|
114
114
|
"meta": {
|
|
115
|
-
"version": "1.
|
|
116
|
-
"requiresGrove": "0.
|
|
115
|
+
"version": "1.3.0",
|
|
116
|
+
"requiresGrove": "0.12.0"
|
|
117
117
|
}
|
|
118
118
|
},
|
|
119
119
|
{
|
|
@@ -154,8 +154,8 @@
|
|
|
154
154
|
}
|
|
155
155
|
],
|
|
156
156
|
"meta": {
|
|
157
|
-
"version": "1.
|
|
158
|
-
"requiresGrove": "0.
|
|
157
|
+
"version": "1.3.0",
|
|
158
|
+
"requiresGrove": "0.12.0"
|
|
159
159
|
}
|
|
160
160
|
},
|
|
161
161
|
{
|
|
@@ -211,8 +211,8 @@
|
|
|
211
211
|
}
|
|
212
212
|
],
|
|
213
213
|
"meta": {
|
|
214
|
-
"version": "1.
|
|
215
|
-
"requiresGrove": "0.
|
|
214
|
+
"version": "1.3.0",
|
|
215
|
+
"requiresGrove": "0.12.0"
|
|
216
216
|
}
|
|
217
217
|
},
|
|
218
218
|
{
|
|
@@ -263,8 +263,8 @@
|
|
|
263
263
|
}
|
|
264
264
|
],
|
|
265
265
|
"meta": {
|
|
266
|
-
"version": "1.
|
|
267
|
-
"requiresGrove": "0.
|
|
266
|
+
"version": "1.3.0",
|
|
267
|
+
"requiresGrove": "0.12.0"
|
|
268
268
|
}
|
|
269
269
|
},
|
|
270
270
|
{
|
|
@@ -322,8 +322,8 @@
|
|
|
322
322
|
}
|
|
323
323
|
],
|
|
324
324
|
"meta": {
|
|
325
|
-
"version": "1.
|
|
326
|
-
"requiresGrove": "0.
|
|
325
|
+
"version": "1.3.0",
|
|
326
|
+
"requiresGrove": "0.12.0"
|
|
327
327
|
}
|
|
328
328
|
},
|
|
329
329
|
{
|
|
@@ -399,8 +399,8 @@
|
|
|
399
399
|
}
|
|
400
400
|
],
|
|
401
401
|
"meta": {
|
|
402
|
-
"version": "1.
|
|
403
|
-
"requiresGrove": "0.
|
|
402
|
+
"version": "1.3.0",
|
|
403
|
+
"requiresGrove": "0.12.0"
|
|
404
404
|
}
|
|
405
405
|
},
|
|
406
406
|
{
|
|
@@ -434,6 +434,16 @@
|
|
|
434
434
|
"type": "registry:component",
|
|
435
435
|
"target": "~/src/components/grove/editorial-summary.astro"
|
|
436
436
|
},
|
|
437
|
+
{
|
|
438
|
+
"path": "default/components/grove/record-relations.astro",
|
|
439
|
+
"type": "registry:component",
|
|
440
|
+
"target": "~/src/components/grove/record-relations.astro"
|
|
441
|
+
},
|
|
442
|
+
{
|
|
443
|
+
"path": "default/components/grove/related-records.astro",
|
|
444
|
+
"type": "registry:component",
|
|
445
|
+
"target": "~/src/components/grove/related-records.astro"
|
|
446
|
+
},
|
|
437
447
|
{
|
|
438
448
|
"path": "default/components/grove/table-of-contents.astro",
|
|
439
449
|
"type": "registry:component",
|
|
@@ -451,8 +461,8 @@
|
|
|
451
461
|
}
|
|
452
462
|
],
|
|
453
463
|
"meta": {
|
|
454
|
-
"version": "1.
|
|
455
|
-
"requiresGrove": "0.
|
|
464
|
+
"version": "1.3.0",
|
|
465
|
+
"requiresGrove": "0.12.0"
|
|
456
466
|
}
|
|
457
467
|
},
|
|
458
468
|
{
|
|
@@ -477,8 +487,8 @@
|
|
|
477
487
|
}
|
|
478
488
|
],
|
|
479
489
|
"meta": {
|
|
480
|
-
"version": "1.
|
|
481
|
-
"requiresGrove": "0.
|
|
490
|
+
"version": "1.3.0",
|
|
491
|
+
"requiresGrove": "0.12.0"
|
|
482
492
|
}
|
|
483
493
|
},
|
|
484
494
|
{
|
|
@@ -498,8 +508,8 @@
|
|
|
498
508
|
}
|
|
499
509
|
],
|
|
500
510
|
"meta": {
|
|
501
|
-
"version": "1.
|
|
502
|
-
"requiresGrove": "0.
|
|
511
|
+
"version": "1.3.0",
|
|
512
|
+
"requiresGrove": "0.12.0"
|
|
503
513
|
}
|
|
504
514
|
},
|
|
505
515
|
{
|
|
@@ -519,8 +529,8 @@
|
|
|
519
529
|
}
|
|
520
530
|
],
|
|
521
531
|
"meta": {
|
|
522
|
-
"version": "1.
|
|
523
|
-
"requiresGrove": "0.
|
|
532
|
+
"version": "1.3.0",
|
|
533
|
+
"requiresGrove": "0.12.0"
|
|
524
534
|
}
|
|
525
535
|
},
|
|
526
536
|
{
|
|
@@ -540,8 +550,8 @@
|
|
|
540
550
|
}
|
|
541
551
|
],
|
|
542
552
|
"meta": {
|
|
543
|
-
"version": "1.
|
|
544
|
-
"requiresGrove": "0.
|
|
553
|
+
"version": "1.3.0",
|
|
554
|
+
"requiresGrove": "0.12.0"
|
|
545
555
|
}
|
|
546
556
|
},
|
|
547
557
|
{
|
|
@@ -861,6 +871,16 @@
|
|
|
861
871
|
"type": "registry:component",
|
|
862
872
|
"target": "~/src/components/grove/editorial-summary.astro"
|
|
863
873
|
},
|
|
874
|
+
{
|
|
875
|
+
"path": "default/components/grove/record-relations.astro",
|
|
876
|
+
"type": "registry:component",
|
|
877
|
+
"target": "~/src/components/grove/record-relations.astro"
|
|
878
|
+
},
|
|
879
|
+
{
|
|
880
|
+
"path": "default/components/grove/related-records.astro",
|
|
881
|
+
"type": "registry:component",
|
|
882
|
+
"target": "~/src/components/grove/related-records.astro"
|
|
883
|
+
},
|
|
864
884
|
{
|
|
865
885
|
"path": "default/components/grove/table-of-contents.astro",
|
|
866
886
|
"type": "registry:component",
|
|
@@ -908,8 +928,8 @@
|
|
|
908
928
|
}
|
|
909
929
|
],
|
|
910
930
|
"meta": {
|
|
911
|
-
"version": "1.
|
|
912
|
-
"requiresGrove": "0.
|
|
931
|
+
"version": "1.3.0",
|
|
932
|
+
"requiresGrove": "0.12.0"
|
|
913
933
|
}
|
|
914
934
|
}
|
|
915
935
|
]
|
package/dist/r/shell.json
CHANGED
package/dist/r/submit.json
CHANGED
package/dist/r/taxonomy.json
CHANGED
|
@@ -11,7 +11,7 @@
|
|
|
11
11
|
"files": [
|
|
12
12
|
{
|
|
13
13
|
"path": "default/pages/categories/index.astro",
|
|
14
|
-
"content": "---\n/**\n * Categories index — every category with live counts. Linked from the\n * default header nav; each tile opens the browse page pre-filtered to\n * the category (detail pages live at `/categories/<id>/`).\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getTaxonomyIndexModel,\n getTaxonomyIndexSeo,\n itemLabel,\n itemLabelPlural,\n} from '@grove-dev/astro/server';\n\nimport CategoryGrid from '../../components/grove/category-grid.astro';\nimport BaseLayout from '../../layouts/base-layout.astro';\n\nconst slug = siteConfig.blueprintConfig?.routeSlug ?? 'projects';\nconst { categories } = getTaxonomyIndexModel();\nconst itemNoun = { singular: itemLabel(), plural: itemLabelPlural() };\nconst seo = getTaxonomyIndexSeo('categories', siteConfig);\n---\n\n<BaseLayout\n title={seo.title}\n description={seo.description}\n image={seo.image}\n jsonLd={seo.jsonLd}\n site={siteConfig}\n>\n <CategoryGrid\n categories={categories}\n pathPrefix={`/${slug}`}\n itemLabelPlural={itemLabelPlural()}\n itemNoun={itemNoun}\n level={1}\n hrefFor={(categorySlug: string) => `/categories/${categorySlug}
|
|
14
|
+
"content": "---\n/**\n * Categories index — every category with live counts. Linked from the\n * default header nav; each tile opens the browse page pre-filtered to\n * the category (detail pages live at `/categories/<id>/`).\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getTaxonomyIndexModel,\n getTaxonomyIndexSeo,\n itemLabel,\n itemLabelPlural,\n} from '@grove-dev/astro/server';\n\nimport CategoryGrid from '../../components/grove/category-grid.astro';\nimport BaseLayout from '../../layouts/base-layout.astro';\n\nconst slug = siteConfig.blueprintConfig?.routeSlug ?? 'projects';\nconst { categories } = getTaxonomyIndexModel();\nconst itemNoun = { singular: itemLabel(), plural: itemLabelPlural() };\nconst seo = getTaxonomyIndexSeo('categories', siteConfig);\n---\n\n<BaseLayout\n title={seo.title}\n description={seo.description}\n image={seo.image}\n jsonLd={seo.jsonLd}\n site={siteConfig}\n>\n <CategoryGrid\n categories={categories}\n pathPrefix={`/${slug}`}\n itemLabelPlural={itemLabelPlural()}\n itemNoun={itemNoun}\n level={1}\n hrefFor={(categorySlug: string) => `/categories/${categorySlug}/`}\n />\n</BaseLayout>\n",
|
|
15
15
|
"type": "registry:page",
|
|
16
16
|
"target": "~/src/pages/categories/index.astro"
|
|
17
17
|
},
|
|
@@ -23,7 +23,7 @@
|
|
|
23
23
|
},
|
|
24
24
|
{
|
|
25
25
|
"path": "default/pages/stacks/index.astro",
|
|
26
|
-
"content": "---\n/**\n * Stacks index — every stack with live counts. Linked from the\n * default header nav; each tile opens the browse page pre-filtered to\n * the stack (detail pages live at `/stacks/<id>/`).\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getTaxonomyIndexModel,\n getTaxonomyIndexSeo,\n itemLabel,\n itemLabelPlural,\n} from '@grove-dev/astro/server';\nimport StackGrid from '../../components/grove/stack-grid.astro';\nimport BaseLayout from '../../layouts/base-layout.astro';\n\nconst slug = siteConfig.blueprintConfig?.routeSlug ?? 'projects';\n// Uncapped: the index page lists EVERY stack (the homepage grid's\n// 12-item cap is a homepage layout choice, not a data truth).\nconst { stacks } = getTaxonomyIndexModel();\nconst itemNoun = { singular: itemLabel(), plural: itemLabelPlural() };\nconst seo = getTaxonomyIndexSeo('stacks', siteConfig);\n---\n\n<BaseLayout\n title={seo.title}\n description={seo.description}\n image={seo.image}\n jsonLd={seo.jsonLd}\n site={siteConfig}\n>\n <StackGrid\n stacks={stacks}\n pathPrefix={`/${slug}`}\n itemLabelPlural={itemLabelPlural()}\n itemNoun={itemNoun}\n level={1}\n hrefFor={(stackSlug: string) => `/stacks/${stackSlug}
|
|
26
|
+
"content": "---\n/**\n * Stacks index — every stack with live counts. Linked from the\n * default header nav; each tile opens the browse page pre-filtered to\n * the stack (detail pages live at `/stacks/<id>/`).\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getTaxonomyIndexModel,\n getTaxonomyIndexSeo,\n itemLabel,\n itemLabelPlural,\n} from '@grove-dev/astro/server';\nimport StackGrid from '../../components/grove/stack-grid.astro';\nimport BaseLayout from '../../layouts/base-layout.astro';\n\nconst slug = siteConfig.blueprintConfig?.routeSlug ?? 'projects';\n// Uncapped: the index page lists EVERY stack (the homepage grid's\n// 12-item cap is a homepage layout choice, not a data truth).\nconst { stacks } = getTaxonomyIndexModel();\nconst itemNoun = { singular: itemLabel(), plural: itemLabelPlural() };\nconst seo = getTaxonomyIndexSeo('stacks', siteConfig);\n---\n\n<BaseLayout\n title={seo.title}\n description={seo.description}\n image={seo.image}\n jsonLd={seo.jsonLd}\n site={siteConfig}\n>\n <StackGrid\n stacks={stacks}\n pathPrefix={`/${slug}`}\n itemLabelPlural={itemLabelPlural()}\n itemNoun={itemNoun}\n level={1}\n hrefFor={(stackSlug: string) => `/stacks/${stackSlug}/`}\n />\n</BaseLayout>\n",
|
|
27
27
|
"type": "registry:page",
|
|
28
28
|
"target": "~/src/pages/stacks/index.astro"
|
|
29
29
|
},
|
|
@@ -41,7 +41,7 @@
|
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"path": "default/components/grove/taxonomy-list.astro",
|
|
44
|
-
"content": "---\nimport {\n buildProjectCardModel,\n indexSlug,\n itemLabel,\n itemLabelPlural,\n} from '@grove-dev/astro/server';\nimport type { IndexRecord } from '@grove-dev/core';\nimport { formatCount } from '@grove-dev/core';\nimport EmptyState from '../ui/empty-state.astro';\n/**\n * TaxonomyList.astro\n *\n * Shared body for the three taxonomy pages — `stacks/[name].astro`,\n * `categories/[name].astro`, `licenses/[name].astro`. The pages\n * differ only in the heading copy and the filterRecords field;\n * everything below the heading — the count, the card grid, the\n * empty state, the back link — is identical, so it lives here.\n *\n * Records render through the package's canonical `ProjectCard` inside\n * `CardGrid`, so taxonomy pages read as the same site as the browse\n * and collection pages.\n */\nimport CardGrid from './card-grid.astro';\nimport ProjectCard from './project-card.astro';\n\ntype TaxonomyRecord = IndexRecord;\n\ninterface Props {\n /** Eyebrow label above the heading (\"Stack\", \"Category\", \"License\"). */\n eyebrow: string;\n /** Display name shown in the heading and intro copy. */\n displayName: string;\n /** Lede copy under the heading. */\n lede: string;\n /**\n * Noun pair for the heading and count label. Defaults to the\n * blueprint's singular/plural labels so irregular plurals render\n * correctly on every blueprint.\n */\n itemNoun?: { singular: string; plural: string };\n /** Records filtered by `filterRecords` upstream. */\n records: TaxonomyRecord[];\n /**\n * Index route for the back link and card hrefs. Defaults to the\n * configured directory route (`routes.directory` in `grove.config.ts`),\n * so a site that browses at `/apps` links to `/apps`, not `/projects`.\n */\n backHref?: string;\n /** Back-link label. */\n backLabel?: string;\n}\n\nconst {\n eyebrow,\n displayName,\n lede,\n itemNoun = { singular: itemLabel(), plural: itemLabelPlural() },\n records,\n backHref = `/${indexSlug()}
|
|
44
|
+
"content": "---\nimport {\n buildProjectCardModel,\n indexSlug,\n itemLabel,\n itemLabelPlural,\n} from '@grove-dev/astro/server';\nimport type { IndexRecord } from '@grove-dev/core';\nimport { formatCount } from '@grove-dev/core';\nimport EmptyState from '../ui/empty-state.astro';\n/**\n * TaxonomyList.astro\n *\n * Shared body for the three taxonomy pages — `stacks/[name].astro`,\n * `categories/[name].astro`, `licenses/[name].astro`. The pages\n * differ only in the heading copy and the filterRecords field;\n * everything below the heading — the count, the card grid, the\n * empty state, the back link — is identical, so it lives here.\n *\n * Records render through the package's canonical `ProjectCard` inside\n * `CardGrid`, so taxonomy pages read as the same site as the browse\n * and collection pages.\n */\nimport CardGrid from './card-grid.astro';\nimport ProjectCard from './project-card.astro';\n\ntype TaxonomyRecord = IndexRecord;\n\ninterface Props {\n /** Eyebrow label above the heading (\"Stack\", \"Category\", \"License\"). */\n eyebrow: string;\n /** Display name shown in the heading and intro copy. */\n displayName: string;\n /** Lede copy under the heading. */\n lede: string;\n /**\n * Noun pair for the heading and count label. Defaults to the\n * blueprint's singular/plural labels so irregular plurals render\n * correctly on every blueprint.\n */\n itemNoun?: { singular: string; plural: string };\n /** Records filtered by `filterRecords` upstream. */\n records: TaxonomyRecord[];\n /**\n * Index route for the back link and card hrefs. Defaults to the\n * configured directory route (`routes.directory` in `grove.config.ts`),\n * so a site that browses at `/apps` links to `/apps`, not `/projects`.\n */\n backHref?: string;\n /** Back-link label. */\n backLabel?: string;\n}\n\nconst {\n eyebrow,\n displayName,\n lede,\n itemNoun = { singular: itemLabel(), plural: itemLabelPlural() },\n records,\n backHref = `/${indexSlug()}/`,\n backLabel = `← Back to all ${itemLabelPlural()}`,\n} = Astro.props;\n\nconst count = records.length;\nconst hrefPrefix = backHref.replace(/\\/$/, '');\n---\n\n<section class=\"mx-auto w-full max-w-container px-5 py-12 sm:px-7 sm:py-16\">\n <p class=\"m-0 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">{eyebrow}</p>\n <h1 class=\"m-0 mt-2 text-[1.875rem] font-semibold tracking-tight text-ink-900 sm:text-[2.125rem] dark:text-ink-100\">\n {displayName} {itemNoun.plural}\n </h1>\n <p class=\"m-0 mt-3 max-w-2xl text-[0.9375rem] leading-relaxed text-ink-500 dark:text-ink-400\">{lede}</p>\n\n <div class=\"mt-10\">\n <p class=\"m-0 text-2xs font-medium uppercase tracking-wider text-ink-500 dark:text-ink-400\">\n {formatCount(count, itemNoun)}\n </p>\n\n {count === 0 ? (\n <EmptyState class=\"mt-4\" title={`No ${itemNoun.plural} yet in ${displayName}.`} />\n ) : (\n <CardGrid class=\"mt-6\">\n {records.map((record, i) => (\n <li class=\"m-0 p-0\">\n <ProjectCard\n model={buildProjectCardModel(record)}\n href={`${hrefPrefix}/${record.slug}/`}\n eager={i < 3}\n />\n </li>\n ))}\n </CardGrid>\n )}\n </div>\n\n <p class=\"mt-12 text-2xs text-ink-500 dark:text-ink-400\">\n <a href={backHref} class=\"text-inherit no-underline hover:underline\">\n {backLabel}\n </a>\n </p>\n</section>\n",
|
|
45
45
|
"type": "registry:component",
|
|
46
46
|
"target": "~/src/components/grove/taxonomy-list.astro"
|
|
47
47
|
},
|
|
@@ -59,8 +59,8 @@
|
|
|
59
59
|
}
|
|
60
60
|
],
|
|
61
61
|
"meta": {
|
|
62
|
-
"version": "1.
|
|
63
|
-
"requiresGrove": "0.
|
|
62
|
+
"version": "1.3.0",
|
|
63
|
+
"requiresGrove": "0.12.0"
|
|
64
64
|
},
|
|
65
65
|
"type": "registry:block"
|
|
66
66
|
}
|
package/dist/r/ui.json
CHANGED
package/dist/readme-cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readme-cli.d.ts","sourceRoot":"","sources":["../src/readme-cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"readme-cli.d.ts","sourceRoot":"","sources":["../src/readme-cli.ts"],"names":[],"mappings":"AAaA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,kBAAkB,IAAI,OAAO,CAkE5C"}
|