@grove-dev/cli 1.3.0 → 1.4.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/init.d.ts.map +1 -1
- package/dist/init.js +18 -2
- package/dist/init.js.map +1 -1
- package/dist/package.json +2 -2
- package/dist/r/about.json +2 -2
- package/dist/r/browse.json +4 -4
- package/dist/r/collections.json +1 -1
- package/dist/r/contributors.json +1 -1
- package/dist/r/default.json +15 -15
- package/dist/r/home.json +3 -3
- package/dist/r/not-found.json +2 -2
- package/dist/r/project-card.json +1 -1
- package/dist/r/record.json +3 -3
- package/dist/r/registry.json +13 -13
- package/dist/r/shell.json +3 -3
- package/dist/r/submit.json +2 -2
- package/dist/r/taxonomy.json +3 -3
- package/dist/r/ui.json +1 -1
- package/package.json +3 -3
package/dist/init.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAsDA,OAAO,EAGL,KAAK,cAAc,EAEpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAKL,KAAK,YAAY,EAIlB,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"init.d.ts","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAsDA,OAAO,EAGL,KAAK,cAAc,EAEpB,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAKL,KAAK,YAAY,EAIlB,MAAM,eAAe,CAAC;AAuDvB,MAAM,WAAW,sBAAsB;IACrC,wCAAwC;IACxC,MAAM,EAAE,MAAM,CAAC;IACf,sEAAsE;IACtE,QAAQ,EAAE,MAAM,CAAC;IACjB,gDAAgD;IAChD,cAAc,EAAE,cAAc,CAAC;CAChC;AAED,MAAM,WAAW,WAAW;IAC1B,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;OAGG;IACH,eAAe,CAAC,EAAE,CAAC,OAAO,EAAE,sBAAsB,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACrE;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB;;;OAGG;IACH,cAAc,CAAC,EAAE,cAAc,CAAC;CACjC;AAQD,MAAM,WAAW,UAAU;IACzB,SAAS,EAAE,MAAM,CAAC;IAClB,WAAW,EAAE,MAAM,CAAC;IACpB,iBAAiB,EAAE,YAAY,CAAC;IAChC,oEAAoE;IACpE,cAAc,EAAE,cAAc,CAAC;CAChC;AAED,wBAAgB,cAAc,IAAI,MAAM,CAWvC;AAkID;;;;;;;;;;;;;GAaG;AACH,wBAAsB,yBAAyB,CAAC,EAC9C,MAAM,EACN,QAAQ,EACR,cAAc,GACf,EAAE,sBAAsB,GAAG,OAAO,CAAC,IAAI,CAAC,CASxC;AAMD;;;;GAIG;AACH,wBAAsB,aAAa,CACjC,SAAS,EAAE,MAAM,EACjB,OAAO,GAAE,WAAgB,GACxB,OAAO,CAAC,UAAU,CAAC,CAwBrB"}
|
package/dist/init.js
CHANGED
|
@@ -98,6 +98,12 @@ const PROJECT_SCRIPTS = {
|
|
|
98
98
|
* warned, which is why CI, pinned to 10.12.1, never saw it.
|
|
99
99
|
*/
|
|
100
100
|
const APPROVED_BUILD_SCRIPTS = ['esbuild'];
|
|
101
|
+
/**
|
|
102
|
+
* The @emnapi/runtime that matches the @emnapi/core @astrojs/astro2tsx
|
|
103
|
+
* pins (1.11.3 in astro2tsx 0.1.3). Bump both together if astro2tsx
|
|
104
|
+
* moves; drop the extension once rolldown stops pinning a 2.0 beta.
|
|
105
|
+
*/
|
|
106
|
+
const ASTRO2TSX_EMNAPI_RUNTIME = '1.11.3';
|
|
101
107
|
export function readCliVersion() {
|
|
102
108
|
const here = dirname(fileURLToPath(import.meta.url));
|
|
103
109
|
for (const candidate of [resolve(here, 'package.json'), resolve(here, '../package.json')]) {
|
|
@@ -153,6 +159,16 @@ function pnpmWorkspaceYaml() {
|
|
|
153
159
|
'onlyBuiltDependencies:',
|
|
154
160
|
...APPROVED_BUILD_SCRIPTS.map((name) => ` - ${name}`),
|
|
155
161
|
'',
|
|
162
|
+
'# rolldown 1.3 (via astro) pins @emnapi/runtime 2.0.0-beta.2, and pnpm',
|
|
163
|
+
"# then hands that beta to the wasm runtime @astrojs/check's astro2tsx",
|
|
164
|
+
'# loads next to @emnapi/core 1.x. The pair is incompatible and',
|
|
165
|
+
'# `astro check` dies with "this.bridge.setLastError is not a function".',
|
|
166
|
+
'# Giving astro2tsx its own matching runtime keeps the two in step.',
|
|
167
|
+
'packageExtensions:',
|
|
168
|
+
" '@astrojs/astro2tsx':",
|
|
169
|
+
' dependencies:',
|
|
170
|
+
` '@emnapi/runtime': ${ASTRO2TSX_EMNAPI_RUNTIME}`,
|
|
171
|
+
'',
|
|
156
172
|
].join('\n');
|
|
157
173
|
}
|
|
158
174
|
/** Write a file only if it is not already there — never clobber a consumer's. */
|
|
@@ -360,8 +376,8 @@ export default defineConfig({
|
|
|
360
376
|
|
|
361
377
|
nav: [
|
|
362
378
|
{ label: "Home", href: "/" },
|
|
363
|
-
{ label: "Browse", href: "/projects" },
|
|
364
|
-
{ label: "About", href: "/about" },
|
|
379
|
+
{ label: "Browse", href: "/projects/" },
|
|
380
|
+
{ label: "About", href: "/about/" },
|
|
365
381
|
],
|
|
366
382
|
|
|
367
383
|
browse: {
|
package/dist/init.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"init.js","sourceRoot":"","sources":["../src/init.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgDG;AACH,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC3E,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAAE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I,CACV,iDAAiD,MAAM,IAAI;YACzD,uBAAuB,kBAAkB,IAAI,IAAI,CAAC,IAAI,2BAA2B,CACpF,CAAC;QACF,MAAM,uBAAuB,CAAC,IAAI,EAAE,MAAM,EAAE,WAAW,CAAC,CAAC;IAC3D,CAAC;IAED,sEAAsE;IACtE,sEAAsE;IACtE,MAAM,iBAAiB,CAAC,WAAW,EAAE,CAAC,GAAG,EAAE,EAAE;QAC3C,KAAK,MAAM,GAAG,IAAI,cAAc;YAAE,GAAG,CAAC,YAAY,CAAC,GAAG,CAAC,GAAG,IAAI,OAAO,EAAE,CAAC;IAC1E,CAAC,CAAC,CAAC;IAEH,mDAAmD;IACnD,MAAM,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,IAAI,CAAC,CAAC,CAAC;IAEjD,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,WAAW,EAAE,iBAAiB,EAAE,IAAI,EAAE,cAAc,EAAE,CAAC;AACrF,CAAC"}
|
package/dist/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grove-dev/cli",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.4.0",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Grove CLI — scaffolds Grove-powered spaces and orchestrates @grove-dev/core commands.",
|
|
6
6
|
"license": "MIT",
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
},
|
|
51
51
|
"dependencies": {
|
|
52
52
|
"@grove-dev/core": "workspace:*",
|
|
53
|
-
"chrome-launcher": "^1.2.
|
|
53
|
+
"chrome-launcher": "^1.2.3",
|
|
54
54
|
"commander": "^15.0.0",
|
|
55
55
|
"lighthouse": "^13.5.0",
|
|
56
56
|
"typescript": "^5.9.3",
|
package/dist/r/about.json
CHANGED
|
@@ -10,14 +10,14 @@
|
|
|
10
10
|
"files": [
|
|
11
11
|
{
|
|
12
12
|
"path": "default/pages/about.astro",
|
|
13
|
-
"content": "---\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getAboutPageSeo,\n getPageContentHtml,\n indexSlug,\n itemLabel,\n itemLabelPlural,\n} from '@grove-dev/astro/server';\n/**\n * About page — generic.\n *\n * A continuous narrative in three movements: what this site is →\n * how it's built (the file-first pipeline: source files → Grove →\n * multiple outputs → ongoing sync) → how to contribute. Prose\n * sections, not a stack of cards — the reading experience is the\n * point here.\n *\n * The copy is generic — references \"directory\", \"record\",\n * \"repository\" — so it works for any blueprint, and every dynamic\n * value (`siteConfig.tagline`, `siteConfig.repoUrl`, item labels)\n * flows from the site config.\n */\nimport BaseLayout from '../layouts/base-layout.astro';\nimport Container from '../layouts/container.astro';\nimport { buttonClass } from '../lib/classnames.ts';\n\ntype Press = { outlet: string; title: string; url: string; date: string; logo?: string };\nconst press = (siteConfig as { press?: Press[] }).press ?? [];\n\nconst githubUrl = siteConfig.repoUrl;\nconst seo = getAboutPageSeo(siteConfig);\nconst slug = indexSlug();\nconst item = itemLabel();\nconst items = itemLabelPlural();\nconst pageContentHtml = getPageContentHtml('about');\n---\n\n<BaseLayout title={seo.title} description={seo.description} image={seo.image} jsonLd={seo.jsonLd} site={siteConfig}>\n <Container size=\"narrow\">\n <article class=\"py-12 sm:py-16\">\n <nav class=\"text-2xs text-muted-foreground\" aria-label=\"Breadcrumb\">\n <a href=\"/\" class=\"hover:text-foreground\">Home</a>\n <span class=\"mx-1.5 text-ink-300 dark:text-ink-700\">/</span>\n <span class=\"text-foreground\">About</span>\n </nav>\n\n {pageContentHtml ? (\n <section class=\"grove-prose mt-8\" set:html={pageContentHtml} />\n ) : (\n <>\n <header class=\"mt-5\">\n <span class=\"text-2xs font-medium uppercase tracking-wider text-muted-foreground\">\n About\n </span>\n <h1 class=\"mt-1 m-0 text-[1.75rem] sm:text-[2.25rem] font-semibold tracking-[-0.02em] leading-[1.1] text-foreground\">\n A directory that lives in files.\n </h1>\n <p class=\"mt-4 m-0 text-[1rem] sm:text-[1.0625rem] leading-relaxed text-foreground max-w-[62ch]\">\n {siteConfig.name} is a curated, health-aware directory of open-source\n {items} — and every listing you see here is a plain YAML file in a\n public repository. This website is one of the outputs generated from\n those files.\n </p>\n </header>\n\n <section class=\"mt-10\">\n <h2 class=\"m-0 text-[1.25rem] sm:text-[1.375rem] font-semibold tracking-tight text-foreground\">\n Why it exists\n </h2>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n GitHub search and README lists optimize for the repository name and\n description. They rarely tell you whether a project is a real {item}\n or a demo, which stack it uses beyond the headline, how active it\n really is, or whether it has a clear license.\n </p>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n Each entry here carries the metadata a developer actually needs\n before opening the repo: stack, platforms, license, activity and\n health signals, plus curated notes — best for, why listed, caveats.\n Everything links back to real, runnable source. No SEO spam, no\n affiliate farms, no broken links.\n </p>\n </section>\n\n <section class=\"mt-10\">\n <h2 class=\"m-0 text-[1.25rem] sm:text-[1.375rem] font-semibold tracking-tight text-foreground\">\n How it's built\n </h2>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n The source of truth is a folder of files: one YAML record per\n {item}, taxonomy files for categories, stacks, platforms, and\n licenses, and Markdown for long-form notes. <a href=\"https://github.com/tortuvshin/grove\" class=\"font-medium underline decoration-border underline-offset-2 hover:decoration-ring\">Grove</a> validates\n those files, joins in synced GitHub metadata, and publishes them as\n multiple outputs — this website with its search and filters, a\n generated README, an <code class=\"font-mono text-[0.875em]\">llms.txt</code> index\n for machines, and sitemap/SEO data.\n </p>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n Automation keeps the outputs current: weekly syncs refresh stars,\n activity, and contributor data, and every change to a source file\n rebuilds everything derived from it. There is no database and no\n server — the output is static HTML, and the content stays portable\n in files you can fork.\n </p>\n </section>\n\n <section class=\"mt-10\">\n <h2 class=\"m-0 text-[1.25rem] sm:text-[1.375rem] font-semibold tracking-tight text-foreground\">\n How to contribute\n </h2>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n Because the content is files, contributing is a pull request: add a\n YAML record for a new {item}, fix a typo, or improve the metadata\n behind an existing listing. The <a href=\"/submit
|
|
13
|
+
"content": "---\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getAboutPageSeo,\n getPageContentHtml,\n indexSlug,\n itemLabel,\n itemLabelPlural,\n} from '@grove-dev/astro/server';\n/**\n * About page — generic.\n *\n * A continuous narrative in three movements: what this site is →\n * how it's built (the file-first pipeline: source files → Grove →\n * multiple outputs → ongoing sync) → how to contribute. Prose\n * sections, not a stack of cards — the reading experience is the\n * point here.\n *\n * The copy is generic — references \"directory\", \"record\",\n * \"repository\" — so it works for any blueprint, and every dynamic\n * value (`siteConfig.tagline`, `siteConfig.repoUrl`, item labels)\n * flows from the site config.\n */\nimport BaseLayout from '../layouts/base-layout.astro';\nimport Container from '../layouts/container.astro';\nimport { buttonClass } from '../lib/classnames.ts';\n\ntype Press = { outlet: string; title: string; url: string; date: string; logo?: string };\nconst press = (siteConfig as { press?: Press[] }).press ?? [];\n\nconst githubUrl = siteConfig.repoUrl;\nconst seo = getAboutPageSeo(siteConfig);\nconst slug = indexSlug();\nconst item = itemLabel();\nconst items = itemLabelPlural();\nconst pageContentHtml = getPageContentHtml('about');\n---\n\n<BaseLayout title={seo.title} description={seo.description} image={seo.image} jsonLd={seo.jsonLd} site={siteConfig}>\n <Container size=\"narrow\">\n <article class=\"py-12 sm:py-16\">\n <nav class=\"text-2xs text-muted-foreground\" aria-label=\"Breadcrumb\">\n <a href=\"/\" class=\"hover:text-foreground\">Home</a>\n <span class=\"mx-1.5 text-ink-300 dark:text-ink-700\">/</span>\n <span class=\"text-foreground\">About</span>\n </nav>\n\n {pageContentHtml ? (\n <section class=\"grove-prose mt-8\" set:html={pageContentHtml} />\n ) : (\n <>\n <header class=\"mt-5\">\n <span class=\"text-2xs font-medium uppercase tracking-wider text-muted-foreground\">\n About\n </span>\n <h1 class=\"mt-1 m-0 text-[1.75rem] sm:text-[2.25rem] font-semibold tracking-[-0.02em] leading-[1.1] text-foreground\">\n A directory that lives in files.\n </h1>\n <p class=\"mt-4 m-0 text-[1rem] sm:text-[1.0625rem] leading-relaxed text-foreground max-w-[62ch]\">\n {siteConfig.name} is a curated, health-aware directory of open-source\n {items} — and every listing you see here is a plain YAML file in a\n public repository. This website is one of the outputs generated from\n those files.\n </p>\n </header>\n\n <section class=\"mt-10\">\n <h2 class=\"m-0 text-[1.25rem] sm:text-[1.375rem] font-semibold tracking-tight text-foreground\">\n Why it exists\n </h2>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n GitHub search and README lists optimize for the repository name and\n description. They rarely tell you whether a project is a real {item}\n or a demo, which stack it uses beyond the headline, how active it\n really is, or whether it has a clear license.\n </p>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n Each entry here carries the metadata a developer actually needs\n before opening the repo: stack, platforms, license, activity and\n health signals, plus curated notes — best for, why listed, caveats.\n Everything links back to real, runnable source. No SEO spam, no\n affiliate farms, no broken links.\n </p>\n </section>\n\n <section class=\"mt-10\">\n <h2 class=\"m-0 text-[1.25rem] sm:text-[1.375rem] font-semibold tracking-tight text-foreground\">\n How it's built\n </h2>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n The source of truth is a folder of files: one YAML record per\n {item}, taxonomy files for categories, stacks, platforms, and\n licenses, and Markdown for long-form notes. <a href=\"https://github.com/tortuvshin/grove\" class=\"font-medium underline decoration-border underline-offset-2 hover:decoration-ring\">Grove</a> validates\n those files, joins in synced GitHub metadata, and publishes them as\n multiple outputs — this website with its search and filters, a\n generated README, an <code class=\"font-mono text-[0.875em]\">llms.txt</code> index\n for machines, and sitemap/SEO data.\n </p>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n Automation keeps the outputs current: weekly syncs refresh stars,\n activity, and contributor data, and every change to a source file\n rebuilds everything derived from it. There is no database and no\n server — the output is static HTML, and the content stays portable\n in files you can fork.\n </p>\n </section>\n\n <section class=\"mt-10\">\n <h2 class=\"m-0 text-[1.25rem] sm:text-[1.375rem] font-semibold tracking-tight text-foreground\">\n How to contribute\n </h2>\n <p class=\"mt-3 m-0 text-[0.9375rem] leading-relaxed text-foreground\">\n Because the content is files, contributing is a pull request: add a\n YAML record for a new {item}, fix a typo, or improve the metadata\n behind an existing listing. The <a href=\"/submit/\" class=\"font-medium underline decoration-border underline-offset-2 hover:decoration-ring\">submit page</a> drafts\n the YAML for you from a repository URL, and every submission is\n reviewed against the curation bar before it lands.\n </p>\n </section>\n\n <section class=\"mt-10 flex flex-wrap items-center gap-3\">\n <a href={`/${slug}/`} class={buttonClass(\"primary\", \"sm\")}>Browse the directory</a>\n {githubUrl && (\n <a\n href={githubUrl}\n target=\"_blank\"\n rel=\"noopener\"\n class={buttonClass(\"secondary\", \"sm\")}\n >\n View on GitHub\n </a>\n )}\n <a href=\"/submit/\" class={buttonClass(\"ghost\", \"sm\")}>Submit a {item} →</a>\n </section>\n </>\n )}\n {press.length > 0 && (\n <section class=\"mt-12 border-t border-border pt-8\" aria-labelledby=\"press-heading\">\n <h2 id=\"press-heading\" class=\"m-0 text-[1.25rem] font-semibold tracking-tight text-foreground\">Featured in</h2>\n <ul class=\"m-0 mt-4 flex list-none flex-col gap-2 p-0\">\n {press.map((item) => (\n <li class=\"m-0\">\n <a href={item.url} target=\"_blank\" rel=\"noopener\" class=\"flex items-center gap-3 rounded-[var(--radius-lg)] border border-border bg-card p-3 no-underline hover:border-ink-400 dark:hover:border-ink-600\">\n {item.logo && (\n <span class=\"inline-flex h-8 w-8 shrink-0 items-center justify-center rounded-full bg-white p-1.5\"><img src={item.logo} alt=\"\" width=\"20\" height=\"20\" class=\"h-5 w-5\" /></span>\n )}\n <span class=\"min-w-0\">\n <span class=\"block text-sm font-semibold text-foreground\">{item.title}</span>\n <span class=\"block text-2xs text-muted-foreground\">{item.outlet} · {new Date(`${item.date}-01T00:00:00Z`).toLocaleDateString('en-US', { month: 'long', year: 'numeric', timeZone: 'UTC' })}</span>\n </span>\n </a>\n </li>\n ))}\n </ul>\n </section>\n )}\n </article>\n </Container>\n</BaseLayout>\n",
|
|
14
14
|
"type": "registry:page",
|
|
15
15
|
"target": "~/src/pages/about.astro"
|
|
16
16
|
}
|
|
17
17
|
],
|
|
18
18
|
"meta": {
|
|
19
19
|
"version": "1.6.0",
|
|
20
|
-
"requiresGrove": "1.
|
|
20
|
+
"requiresGrove": "1.4.0"
|
|
21
21
|
},
|
|
22
22
|
"type": "registry:block"
|
|
23
23
|
}
|
package/dist/r/browse.json
CHANGED
|
@@ -35,13 +35,13 @@
|
|
|
35
35
|
},
|
|
36
36
|
{
|
|
37
37
|
"path": "default/components/grove/directory-browse.astro",
|
|
38
|
-
"content": "---\n/**\n * DirectoryBrowse — the browse page body, shared by the two routes\n * that render it: `/{slug}/` (page 1) and `/{slug}/page/{n}/`.\n *\n * Layout, top to bottom:\n * - PageHeader (the only place the page names itself) and lens tabs\n * - `DirectoryBrowseView`: search + sort, facet filters, applied\n * chips, the result count line, the card grid and pagination\n * - The submit call to action\n *\n * Navigation model: **pages are real paths.** Each route prerenders\n * only its own 20 records, so an unfiltered directory of any size is\n * crawlable, works without JavaScript, and never ships the whole\n * catalogue as DOM.\n *\n * Filtering stays client-side: these routes are PRERENDERED, so at\n * build time `Astro.url.searchParams` is empty. `DirectoryIndexClient`\n * (rendered by `DirectoryBrowseView`) re-reads `location.search` and\n * re-derives the result list, chips, pagination, and facet\n * intersection counts with the same `@grove-dev/core/directory`\n * functions the server used. Filtered views paginate with `?page=N` on\n * the base route. Taxonomy pages render the same view with a `scope`.\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getDirectoryIndexModel,\n itemLabel,\n itemLabelPlural,\n seoTitle,\n titleCaseFirst,\n} from '@grove-dev/astro/server';\nimport { formatCount } from '@grove-dev/core';\nimport BaseLayout from '../../layouts/base-layout.astro';\nimport Button from '../ui/button.astro';\nimport PageHeader from '../ui/page-header.astro';\nimport DirectoryBrowseView from './directory-browse-view.astro';\nimport SmartLensTabs from './smart-lens-tabs.astro';\n\ninterface Props {\n /** 1-based page this route renders. */\n routePage?: number;\n}\n\nconst { routePage = 1 } = Astro.props;\nconst slug = siteConfig.blueprintConfig?.routeSlug ?? 'projects';\nconst { total, page, seo } = getDirectoryIndexModel(Astro.url.searchParams, siteConfig, {\n page: routePage,\n});\n\n// Page 2+ gets a distinct title and skips the ItemList JSON-LD so the\n// list markup isn't duplicated across every paginated route. The\n// per-page description is built inside `getDirectoryIndexModel` so it\n// fits inside the 160-char cap; this view just forwards `seo.title`.\nconst title =\n page > 1\n ? seoTitle(`Browse ${titleCaseFirst(itemLabelPlural())} — Page ${page}`, siteConfig.name)\n : seo.title;\nconst description = seo.description;\n---\n\n<BaseLayout\n title={title}\n description={description}\n image={seo.image}\n jsonLd={page > 1 ? undefined : seo.jsonLd}\n site={siteConfig}\n submitHref=\"/submit
|
|
38
|
+
"content": "---\n/**\n * DirectoryBrowse — the browse page body, shared by the two routes\n * that render it: `/{slug}/` (page 1) and `/{slug}/page/{n}/`.\n *\n * Layout, top to bottom:\n * - PageHeader (the only place the page names itself) and lens tabs\n * - `DirectoryBrowseView`: search + sort, facet filters, applied\n * chips, the result count line, the card grid and pagination\n * - The submit call to action\n *\n * Navigation model: **pages are real paths.** Each route prerenders\n * only its own 20 records, so an unfiltered directory of any size is\n * crawlable, works without JavaScript, and never ships the whole\n * catalogue as DOM.\n *\n * Filtering stays client-side: these routes are PRERENDERED, so at\n * build time `Astro.url.searchParams` is empty. `DirectoryIndexClient`\n * (rendered by `DirectoryBrowseView`) re-reads `location.search` and\n * re-derives the result list, chips, pagination, and facet\n * intersection counts with the same `@grove-dev/core/directory`\n * functions the server used. Filtered views paginate with `?page=N` on\n * the base route. Taxonomy pages render the same view with a `scope`.\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport {\n getDirectoryIndexModel,\n itemLabel,\n itemLabelPlural,\n seoTitle,\n titleCaseFirst,\n} from '@grove-dev/astro/server';\nimport { formatCount } from '@grove-dev/core';\nimport BaseLayout from '../../layouts/base-layout.astro';\nimport Button from '../ui/button.astro';\nimport PageHeader from '../ui/page-header.astro';\nimport DirectoryBrowseView from './directory-browse-view.astro';\nimport SmartLensTabs from './smart-lens-tabs.astro';\n\ninterface Props {\n /** 1-based page this route renders. */\n routePage?: number;\n}\n\nconst { routePage = 1 } = Astro.props;\nconst slug = siteConfig.blueprintConfig?.routeSlug ?? 'projects';\nconst { total, page, seo } = getDirectoryIndexModel(Astro.url.searchParams, siteConfig, {\n page: routePage,\n});\n\n// Page 2+ gets a distinct title and skips the ItemList JSON-LD so the\n// list markup isn't duplicated across every paginated route. The\n// per-page description is built inside `getDirectoryIndexModel` so it\n// fits inside the 160-char cap; this view just forwards `seo.title`.\nconst title =\n page > 1\n ? seoTitle(`Browse ${titleCaseFirst(itemLabelPlural())} — Page ${page}`, siteConfig.name)\n : seo.title;\nconst description = seo.description;\n---\n\n<BaseLayout\n title={title}\n description={description}\n image={seo.image}\n jsonLd={page > 1 ? undefined : seo.jsonLd}\n site={siteConfig}\n submitHref=\"/submit/\"\n submitLabel={`Submit ${itemLabel()}`}\n>\n <DirectoryBrowseView routePage={routePage}>\n <Fragment slot=\"header\">\n <PageHeader\n eyebrow={slug}\n title={`Browse ${slug}`}\n description={`Search, filter, and explore ${formatCount(total, { singular: itemLabel(), plural: itemLabelPlural() })} in this directory.`}\n />\n\n {/* Curated views. Real links (not a JS-driven control) — the\n same server-and-client filter pipeline (@grove-dev/core's\n filtersFromSearchParams/filterRecords) already understands\n `?lens=`, so this works with JS disabled too. */}\n <SmartLensTabs\n currentParams={Astro.url.searchParams}\n pathPrefix={`/${slug}`}\n lensIds={[\"all\", \"hot\", \"new\", \"mature\"]}\n allLabel={`All ${itemLabelPlural()}`}\n class=\"mt-6\"\n />\n </Fragment>\n </DirectoryBrowseView>\n\n <section class=\"border-t border-ink-200 dark:border-ink-800\">\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n <div class=\"flex flex-col items-center gap-3 py-12 text-center\">\n <h2 class=\"m-0 text-xl font-semibold tracking-tight text-ink-900 dark:text-ink-100\">\n {`Know a real ${itemLabel()} that belongs here?`}\n </h2>\n <p class=\"m-0 max-w-2xl text-sm text-ink-500 dark:text-ink-400\">\n {`Open a pull request with a YAML file. We review every submission against the bar — no marketing, no tutorials.`}\n </p>\n <Button href=\"/submit/\" variant=\"primary\" size=\"sm\" class=\"mt-2\">\n {`Submit ${itemLabel()}`}\n </Button>\n\n </div>\n </div>\n </section>\n</BaseLayout>\n",
|
|
39
39
|
"type": "registry:component",
|
|
40
40
|
"target": "~/src/components/grove/directory-browse.astro"
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
43
|
"path": "default/components/grove/directory-browse-view.astro",
|
|
44
|
-
"content": "---\n/**\n * DirectoryBrowseView — the browse engine's body: search and sort, the\n * facet filters, the applied-filter chips, the results, and the client\n * controller that keeps all of it in step with the query string.\n *\n * Two kinds of page render it:\n * - `DirectoryBrowse` (`/{slug}/`, `/{slug}/page/{n}/`), which puts\n * its page header and lens tabs in the `header` slot.\n * - `TaxonomyList` (`/stacks/<id>/`, `/categories/<id>/`, …), which\n * passes a `scope` and its own `pathPrefix`.\n *\n * `scope` is an immutable slice of the directory, such as\n * `{ stacks: ['flutter'] }`. It is merged into every query, so results\n * and facet counts only ever come from the scoped set. It is never a\n * chip, its facet group is not rendered, and it never goes in the URL:\n * the page's own path already says it. Filters, sort and the query\n * live in that page's query string (`/stacks/flutter/?platform=ios`),\n * and \"Clear all\" or the zero-results reset lead back to the page\n * itself, so nothing can drop the scope.\n *\n * A scoped list is not paginated. The host page has no `/page/{n}/`\n * routes, so one prerendered document carries every record in the\n * scope, which keeps all of them linked without JavaScript. That is\n * what taxonomy pages rendered before they had filters.\n *\n * With no `scope` this renders exactly what `/{slug}/` always did.\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport { SORT_OPTIONS, sortDisplay } from '@grove-dev/astro';\nimport {\n getDirectoryIndexModel,\n itemLabel,\n itemLabelPlural,\n taxonomy,\n} from '@grove-dev/astro/server';\nimport { searchParamsFromFilters } from '@grove-dev/core';\nimport { chipClass } from '../../lib/classnames.ts';\nimport { type DirectoryScope, scopedGroups } from '../../lib/live-filters.ts';\nimport Button from '../ui/button.astro';\nimport FilterDrawer from '../ui/filter-drawer.astro';\nimport SearchField from '../ui/search-field.astro';\nimport CardGrid from './card-grid.astro';\nimport DirectoryIndexClient from './directory-index-client.astro';\nimport IndexRow from './index-row.astro';\nimport Pagination from './pagination.astro';\nimport RefinePanel from './refine-panel.astro';\n\ninterface Props {\n /** 1-based page this route renders. Ignored when `scope` is set. */\n routePage?: number;\n /**\n * Fixed filters for every query on this page, e.g.\n * `{ categories: ['productivity'] }`. Omit on the directory itself.\n */\n scope?: DirectoryScope;\n /**\n * Path the filtered URLs are built on, without a trailing slash.\n * Default: the directory route (`/{slug}`). A scoped page passes its\n * own path (`/stacks/flutter`).\n */\n pathPrefix?: string;\n}\n\nconst slug = siteConfig.blueprintConfig?.routeSlug ?? 'projects';\nconst { routePage = 1, scope, pathPrefix = `/${slug}` } = Astro.props;\nconst fixed = scopedGroups(scope);\nconst scoped = fixed.length > 0;\n\n// A scoped page asks the same model the directory uses, with the scope\n// as its query. Every facet's intersection count then already excludes\n// records outside the scope, and `sorted` is the scoped set. On an\n// unscoped page the build never sees a query, so this is empty.\nconst query = scoped\n ? searchParamsFromFilters(\n Object.fromEntries(fixed.map((group) => [group, [...(scope?.[group] ?? [])]])),\n )\n : Astro.url.searchParams;\nconst model = getDirectoryIndexModel(query, siteConfig, { page: scoped ? 1 : routePage });\nconst { filters, searchPlaceholder, sort, sorted } = model;\n\n// The scoped group is the page itself, not a choice: no facet for it,\n// and no chip. Nothing else the visitor picked exists at build time.\nconst facetGroups = model.facetGroups.filter(\n (group) => !fixed.includes(group.filterKey as (typeof fixed)[number]),\n);\nconst chips = scoped ? [] : model.chips;\nconst clearFiltersHref = scoped ? `${pathPrefix}/` : model.clearFiltersHref;\nconst pageItems = scoped ? sorted : model.pageItems;\nconst pages = scoped ? 1 : model.pages;\nconst page = scoped ? 1 : model.page;\nconst { hrefForResultPage } = model;\n---\n\n<section class=\"border-b border-border bg-background\">\n <div class:list={[\"mx-auto w-full max-w-container px-5 sm:px-7\", Astro.slots.has(\"header\") && \"pt-10 sm:pt-12\"]}>\n <slot name=\"header\" />\n\n {/* Row 1 — search and sort. Search filters as you type (see\n DirectoryIndexClient); the submit button is sr-only so Enter\n still works when JavaScript never arrives. */}\n <form\n method=\"get\"\n action={pathPrefix}\n id=\"search-form\"\n class:list={[\"flex flex-col gap-2 sm:flex-row\", Astro.slots.has(\"header\") && \"mt-6\"]}\n role=\"search\"\n >\n <SearchField\n class=\"flex-1\"\n label={`Search ${itemLabelPlural()}`}\n value={filters.q ?? \"\"}\n placeholder={searchPlaceholder}\n shortcut\n />\n <label class=\"relative\">\n <span class=\"sr-only\">{`Sort ${itemLabelPlural()}`}</span>\n <select\n id=\"sort-select\"\n name=\"sort\"\n class=\"h-10 w-full cursor-pointer appearance-none rounded-md border border-input bg-background py-1.5 pl-3 pr-8 text-sm font-medium text-foreground transition-colors hover:border-ring focus:border-ring focus:outline-none focus:ring-2 focus:ring-ring/20 sm:w-auto\"\n >\n {SORT_OPTIONS.map((o) => (\n <option value={o.value} selected={o.value === sort}>{o.label}</option>\n ))}\n </select>\n <svg\n viewBox=\"0 0 16 16\"\n width=\"11\"\n height=\"11\"\n aria-hidden=\"true\"\n class=\"pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground\"\n fill=\"currentColor\"\n >\n <path d=\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\" />\n </svg>\n </label>\n <button type=\"submit\" class=\"sr-only\">Search</button>\n </form>\n\n {/* Row 2 — every filter on one line. On mobile they collapse into\n a full-width \"Filters (n)\" button opening a bottom sheet.\n Filters apply live in both places. The sheet's footer button\n (\"Show 12 apps\") just closes it and moves focus to the\n results heading. */}\n <div class=\"mt-3\">\n <FilterDrawer\n label=\"Filters\"\n activeCount={chips.length}\n clearHref={clearFiltersHref}\n resultsLabel={`Show ${sorted.length} ${sorted.length === 1 ? itemLabel() : itemLabelPlural()}`}\n resultsTarget=\"#results-heading\"\n >\n {/* The applied chips again, inside the sheet: on mobile the\n row above the list is behind the sheet. On desktop the\n filters render inline right above that row, so this copy\n stays hidden. DirectoryIndexClient fills both. The sheet's\n header already has \"Clear all\", so this row leaves it out. */}\n <div\n data-active-filters\n data-without-clear\n class:list={[\"mb-3 flex flex-wrap items-center gap-1.5 md:hidden\", chips.length === 0 && \"hidden\"]}\n aria-label=\"Active filters\"\n ></div>\n <RefinePanel\n class=\"max-md:flex-col max-md:items-stretch\"\n groups={facetGroups}\n initial={filters}\n pathPrefix={pathPrefix}\n hide={[\"sort\"]}\n />\n </FilterDrawer>\n </div>\n\n {/* Row 3 — what is currently narrowing the list, and one way out\n of all of it. Server-rendered empty on this prerendered route;\n the client fills it from the live query string. */}\n <div\n id=\"active-filters\"\n data-active-filters\n class:list={[\"mt-3 flex flex-wrap items-center gap-1.5 pb-6\", chips.length === 0 && \"hidden\"]}\n aria-label=\"Active filters\"\n >\n {chips.map((chip) => (\n <a href={chip.href} class={chipClass()} aria-label={`Remove filter: ${chip.label}`}>\n {chip.label} <span aria-hidden=\"true\">×</span>\n </a>\n ))}\n {chips.length > 0 && (\n <a\n href={clearFiltersHref}\n class=\"text-2xs font-medium text-ink-500 underline decoration-border underline-offset-2 hover:text-ink-900 dark:hover:text-ink-100\"\n aria-label=\"Clear all active filters\"\n >\n Clear all\n </a>\n )}\n </div>\n {chips.length === 0 && <div class=\"pb-6\"></div>}\n </div>\n</section>\n\n<section class=\"py-10 sm:py-12\">\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n {/* The count line IS the results heading — it carries a fact,\n which \"All projects / Every item in the directory\" did not,\n and it keeps the document's heading order intact above the\n cards' own h3s. */}\n {/* `tabindex=\"-1\"` lets the drawer's \"Show N\" button and the\n focus fallbacks in DirectoryIndexClient move focus here. */}\n <h2\n id=\"results-heading\"\n tabindex=\"-1\"\n class=\"m-0 mb-5 scroll-mt-4 text-2xs font-normal text-ink-500 dark:text-ink-400\"\n >\n <span id=\"results-count\" class=\"font-mono font-semibold text-ink-900 dark:text-ink-100\">\n {sorted.length} {sorted.length === 1 ? itemLabel() : itemLabelPlural()}\n </span>\n <span id=\"results-sort\">{` · sorted by ${sortDisplay(sort)}`}</span>\n <span id=\"results-page\">{pages > 1 ? ` · page ${page} of ${pages}` : \"\"}</span>\n </h2>\n\n {/* Screen readers hear the result count here, debounced by\n DirectoryIndexClient so rapid toggles make one announcement.\n The visible count above is deliberately not a live region,\n or every change would be announced twice. */}\n <p id=\"results-status\" class=\"sr-only\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\"></p>\n\n <CardGrid id=\"results-list\">\n {pageItems.map((item, i) => (\n <li class=\"m-0 p-0\" data-record-slug={item.slug}>\n <IndexRow\n record={item as Parameters<typeof IndexRow>[0][\"record\"]}\n detailHref={`/${slug}/${item.slug}/`}\n eager={i < 3}\n />\n </li>\n ))}\n </CardGrid>\n\n <div id=\"empty-state\" class:list={[\"py-12 text-center\", sorted.length > 0 && \"hidden\"]}>\n <p class=\"m-0 text-sm font-medium text-ink-700 dark:text-ink-200\">\n {`No ${itemLabelPlural()} match these filters.`}\n </p>\n {/* The client keeps this href in step with the live query, so\n clearing keeps the chosen sort, and on a scoped page it stays\n on that page. */}\n <Button href={clearFiltersHref} variant=\"secondary\" size=\"sm\" class=\"mt-4\" data-empty-reset>Clear filters</Button>\n </div>\n {/* Plain div wrapper — Pagination renders its own\n <nav aria-label=\"Pagination\">, so a nav here would nest two\n identical landmarks. */}\n <div id=\"results-pagination\" class=\"mt-8 flex flex-wrap items-center justify-center gap-1.5\">\n <Pagination current={page} total={pages} hrefFor={hrefForResultPage} />\n </div>\n </div>\n</section>\n\n<DirectoryIndexClient\n slug={slug}\n singular={itemLabel()}\n plural={itemLabelPlural()}\n taxonomy={taxonomy}\n routePage={page}\n scope={scoped ? scope : undefined}\n pathPrefix={pathPrefix}\n/>\n",
|
|
44
|
+
"content": "---\n/**\n * DirectoryBrowseView — the browse engine's body: search and sort, the\n * facet filters, the applied-filter chips, the results, and the client\n * controller that keeps all of it in step with the query string.\n *\n * Two kinds of page render it:\n * - `DirectoryBrowse` (`/{slug}/`, `/{slug}/page/{n}/`), which puts\n * its page header and lens tabs in the `header` slot.\n * - `TaxonomyList` (`/stacks/<id>/`, `/categories/<id>/`, …), which\n * passes a `scope` and its own `pathPrefix`.\n *\n * `scope` is an immutable slice of the directory, such as\n * `{ stacks: ['flutter'] }`. It is merged into every query, so results\n * and facet counts only ever come from the scoped set. It is never a\n * chip, its facet group is not rendered, and it never goes in the URL:\n * the page's own path already says it. Filters, sort and the query\n * live in that page's query string (`/stacks/flutter/?platform=ios`),\n * and \"Clear all\" or the zero-results reset lead back to the page\n * itself, so nothing can drop the scope.\n *\n * A scoped list is not paginated. The host page has no `/page/{n}/`\n * routes, so one prerendered document carries every record in the\n * scope, which keeps all of them linked without JavaScript. That is\n * what taxonomy pages rendered before they had filters.\n *\n * With no `scope` this renders exactly what `/{slug}/` always did.\n */\nimport siteConfig from '@grove/generated/site-config.json';\nimport { SORT_OPTIONS, sortDisplay } from '@grove-dev/astro';\nimport {\n getDirectoryIndexModel,\n itemLabel,\n itemLabelPlural,\n taxonomy,\n} from '@grove-dev/astro/server';\nimport { searchParamsFromFilters } from '@grove-dev/core';\nimport { chipClass } from '../../lib/classnames.ts';\nimport { type DirectoryScope, scopedGroups } from '../../lib/live-filters.ts';\nimport Button from '../ui/button.astro';\nimport FilterDrawer from '../ui/filter-drawer.astro';\nimport SearchField from '../ui/search-field.astro';\nimport CardGrid from './card-grid.astro';\nimport DirectoryIndexClient from './directory-index-client.astro';\nimport IndexRow from './index-row.astro';\nimport Pagination from './pagination.astro';\nimport RefinePanel from './refine-panel.astro';\n\ninterface Props {\n /** 1-based page this route renders. Ignored when `scope` is set. */\n routePage?: number;\n /**\n * Fixed filters for every query on this page, e.g.\n * `{ categories: ['productivity'] }`. Omit on the directory itself.\n */\n scope?: DirectoryScope;\n /**\n * Path the filtered URLs are built on, without a trailing slash.\n * Default: the directory route (`/{slug}`). A scoped page passes its\n * own path (`/stacks/flutter`).\n */\n pathPrefix?: string;\n}\n\nconst slug = siteConfig.blueprintConfig?.routeSlug ?? 'projects';\nconst { routePage = 1, scope, pathPrefix = `/${slug}` } = Astro.props;\nconst fixed = scopedGroups(scope);\nconst scoped = fixed.length > 0;\n\n// A scoped page asks the same model the directory uses, with the scope\n// as its query. Every facet's intersection count then already excludes\n// records outside the scope, and `sorted` is the scoped set. On an\n// unscoped page the build never sees a query, so this is empty.\nconst query = scoped\n ? searchParamsFromFilters(\n Object.fromEntries(fixed.map((group) => [group, [...(scope?.[group] ?? [])]])),\n )\n : Astro.url.searchParams;\nconst model = getDirectoryIndexModel(query, siteConfig, { page: scoped ? 1 : routePage });\nconst { filters, searchPlaceholder, sort, sorted } = model;\n\n// The scoped group is the page itself, not a choice: no facet for it,\n// and no chip. Nothing else the visitor picked exists at build time.\nconst facetGroups = model.facetGroups.filter(\n (group) => !fixed.includes(group.filterKey as (typeof fixed)[number]),\n);\nconst chips = scoped ? [] : model.chips;\nconst clearFiltersHref = scoped ? `${pathPrefix}/` : model.clearFiltersHref;\nconst pageItems = scoped ? sorted : model.pageItems;\nconst pages = scoped ? 1 : model.pages;\nconst page = scoped ? 1 : model.page;\nconst { hrefForResultPage } = model;\n---\n\n<section class=\"border-b border-border bg-background\">\n <div class:list={[\"mx-auto w-full max-w-container px-5 sm:px-7\", Astro.slots.has(\"header\") && \"pt-10 sm:pt-12\"]}>\n <slot name=\"header\" />\n\n {/* Row 1 — search and sort. Search filters as you type (see\n DirectoryIndexClient); the submit button is sr-only so Enter\n still works when JavaScript never arrives. */}\n <form\n method=\"get\"\n action={pathPrefix.endsWith(\"/\") ? pathPrefix : `${pathPrefix}/`}\n id=\"search-form\"\n class:list={[\"flex flex-col gap-2 sm:flex-row\", Astro.slots.has(\"header\") && \"mt-6\"]}\n role=\"search\"\n >\n <SearchField\n class=\"flex-1\"\n label={`Search ${itemLabelPlural()}`}\n value={filters.q ?? \"\"}\n placeholder={searchPlaceholder}\n shortcut\n />\n <label class=\"relative\">\n <span class=\"sr-only\">{`Sort ${itemLabelPlural()}`}</span>\n <select\n id=\"sort-select\"\n name=\"sort\"\n class=\"h-10 w-full cursor-pointer appearance-none rounded-md border border-input bg-background py-1.5 pl-3 pr-8 text-sm font-medium text-foreground transition-colors hover:border-ring focus:border-ring focus:outline-none focus:ring-2 focus:ring-ring/20 sm:w-auto\"\n >\n {SORT_OPTIONS.map((o) => (\n <option value={o.value} selected={o.value === sort}>{o.label}</option>\n ))}\n </select>\n <svg\n viewBox=\"0 0 16 16\"\n width=\"11\"\n height=\"11\"\n aria-hidden=\"true\"\n class=\"pointer-events-none absolute right-2.5 top-1/2 -translate-y-1/2 text-muted-foreground\"\n fill=\"currentColor\"\n >\n <path d=\"M4.22 6.22a.75.75 0 0 1 1.06 0L8 8.94l2.72-2.72a.75.75 0 1 1 1.06 1.06l-3.25 3.25a.75.75 0 0 1-1.06 0L4.22 7.28a.75.75 0 0 1 0-1.06Z\" />\n </svg>\n </label>\n <button type=\"submit\" class=\"sr-only\">Search</button>\n </form>\n\n {/* Row 2 — every filter on one line. On mobile they collapse into\n a full-width \"Filters (n)\" button opening a bottom sheet.\n Filters apply live in both places. The sheet's footer button\n (\"Show 12 apps\") just closes it and moves focus to the\n results heading. */}\n <div class=\"mt-3\">\n <FilterDrawer\n label=\"Filters\"\n activeCount={chips.length}\n clearHref={clearFiltersHref}\n resultsLabel={`Show ${sorted.length} ${sorted.length === 1 ? itemLabel() : itemLabelPlural()}`}\n resultsTarget=\"#results-heading\"\n >\n {/* The applied chips again, inside the sheet: on mobile the\n row above the list is behind the sheet. On desktop the\n filters render inline right above that row, so this copy\n stays hidden. DirectoryIndexClient fills both. The sheet's\n header already has \"Clear all\", so this row leaves it out. */}\n <div\n data-active-filters\n data-without-clear\n class:list={[\"mb-3 flex flex-wrap items-center gap-1.5 md:hidden\", chips.length === 0 && \"hidden\"]}\n aria-label=\"Active filters\"\n ></div>\n <RefinePanel\n class=\"max-md:flex-col max-md:items-stretch\"\n groups={facetGroups}\n initial={filters}\n pathPrefix={pathPrefix}\n hide={[\"sort\"]}\n />\n </FilterDrawer>\n </div>\n\n {/* Row 3 — what is currently narrowing the list, and one way out\n of all of it. Server-rendered empty on this prerendered route;\n the client fills it from the live query string. */}\n <div\n id=\"active-filters\"\n data-active-filters\n class:list={[\"mt-3 flex flex-wrap items-center gap-1.5 pb-6\", chips.length === 0 && \"hidden\"]}\n aria-label=\"Active filters\"\n >\n {chips.map((chip) => (\n <a href={chip.href} class={chipClass()} aria-label={`Remove filter: ${chip.label}`}>\n {chip.label} <span aria-hidden=\"true\">×</span>\n </a>\n ))}\n {chips.length > 0 && (\n <a\n href={clearFiltersHref}\n class=\"text-2xs font-medium text-ink-500 underline decoration-border underline-offset-2 hover:text-ink-900 dark:hover:text-ink-100\"\n aria-label=\"Clear all active filters\"\n >\n Clear all\n </a>\n )}\n </div>\n {chips.length === 0 && <div class=\"pb-6\"></div>}\n </div>\n</section>\n\n<section class=\"py-10 sm:py-12\">\n <div class=\"mx-auto w-full max-w-container px-5 sm:px-7\">\n {/* The count line IS the results heading — it carries a fact,\n which \"All projects / Every item in the directory\" did not,\n and it keeps the document's heading order intact above the\n cards' own h3s. */}\n {/* `tabindex=\"-1\"` lets the drawer's \"Show N\" button and the\n focus fallbacks in DirectoryIndexClient move focus here. */}\n <h2\n id=\"results-heading\"\n tabindex=\"-1\"\n class=\"m-0 mb-5 scroll-mt-4 text-2xs font-normal text-ink-500 dark:text-ink-400\"\n >\n <span id=\"results-count\" class=\"font-mono font-semibold text-ink-900 dark:text-ink-100\">\n {sorted.length} {sorted.length === 1 ? itemLabel() : itemLabelPlural()}\n </span>\n <span id=\"results-sort\">{` · sorted by ${sortDisplay(sort)}`}</span>\n <span id=\"results-page\">{pages > 1 ? ` · page ${page} of ${pages}` : \"\"}</span>\n </h2>\n\n {/* Screen readers hear the result count here, debounced by\n DirectoryIndexClient so rapid toggles make one announcement.\n The visible count above is deliberately not a live region,\n or every change would be announced twice. */}\n <p id=\"results-status\" class=\"sr-only\" role=\"status\" aria-live=\"polite\" aria-atomic=\"true\"></p>\n\n <CardGrid id=\"results-list\">\n {pageItems.map((item, i) => (\n <li class=\"m-0 p-0\" data-record-slug={item.slug}>\n <IndexRow\n record={item as Parameters<typeof IndexRow>[0][\"record\"]}\n detailHref={`/${slug}/${item.slug}/`}\n eager={i < 3}\n />\n </li>\n ))}\n </CardGrid>\n\n <div id=\"empty-state\" class:list={[\"py-12 text-center\", sorted.length > 0 && \"hidden\"]}>\n <p class=\"m-0 text-sm font-medium text-ink-700 dark:text-ink-200\">\n {`No ${itemLabelPlural()} match these filters.`}\n </p>\n {/* The client keeps this href in step with the live query, so\n clearing keeps the chosen sort, and on a scoped page it stays\n on that page. */}\n <Button href={clearFiltersHref} variant=\"secondary\" size=\"sm\" class=\"mt-4\" data-empty-reset>Clear filters</Button>\n </div>\n {/* Plain div wrapper — Pagination renders its own\n <nav aria-label=\"Pagination\">, so a nav here would nest two\n identical landmarks. */}\n <div id=\"results-pagination\" class=\"mt-8 flex flex-wrap items-center justify-center gap-1.5\">\n <Pagination current={page} total={pages} hrefFor={hrefForResultPage} />\n </div>\n </div>\n</section>\n\n<DirectoryIndexClient\n slug={slug}\n singular={itemLabel()}\n plural={itemLabelPlural()}\n taxonomy={taxonomy}\n routePage={page}\n scope={scoped ? scope : undefined}\n pathPrefix={pathPrefix}\n/>\n",
|
|
45
45
|
"type": "registry:component",
|
|
46
46
|
"target": "~/src/components/grove/directory-browse-view.astro"
|
|
47
47
|
},
|
|
@@ -89,14 +89,14 @@
|
|
|
89
89
|
},
|
|
90
90
|
{
|
|
91
91
|
"path": "default/lib/live-filters.ts",
|
|
92
|
-
"content": "/**\n * Live-filter logic for the browse page. These are the pieces of\n * behaviour that do not need a DOM: URL building, the history-session\n * decision, the labels the page speaks, a debounce and the focus\n * fallback index.\n *\n * They live here, not inline in the `.astro` scripts, so they can be\n * unit-tested. RefinePanel, FilterDrawer and DirectoryIndexClient\n * import them.\n */\n\n/** The facet groups a scope can fix (core's `DirectoryFilterGroupKey`). */\nexport type ScopeGroup = 'stacks' | 'platforms' | 'categories' | 'tags' | 'licenses';\n\n/**\n * A fixed slice of the directory that a page browses inside, keyed by\n * facet group: `{ stacks: ['flutter'] }` on `/stacks/flutter/`,\n * `{ categories: ['productivity'] }` on `/categories/productivity/`.\n *\n * A scope is not a filter the visitor chose. It is merged into every\n * query, but it never shows as a chip or a facet, and it never goes in\n * the URL: the page's own path already says it. So clearing filters,\n * the zero-results reset and Back/Forward can never drop it.\n */\nexport type DirectoryScope = Partial<Record<ScopeGroup, readonly string[]>>;\n\n/** The facet groups a scope fixes. Groups with no values do not count. */\nexport function scopedGroups(scope: DirectoryScope | null | undefined): ScopeGroup[] {\n if (!scope) return [];\n return (Object.keys(scope) as ScopeGroup[]).filter((key) => (scope[key]?.length ?? 0) > 0);\n}\n\n/**\n * Drop the scoped groups from a filter state read off the URL. On\n * `/stacks/flutter/?stack=react` the `stack` parameter is ignored:\n * the page is Flutter, whatever the query says.\n */\nexport function withoutScope<F extends Partial<Record<ScopeGroup, unknown>>>(\n filters: F,\n scope: DirectoryScope | null | undefined,\n): F {\n const groups = scopedGroups(scope);\n if (groups.length === 0) return filters;\n const next = { ...filters };\n for (const group of groups) delete next[group];\n return next;\n}\n\n/**\n * The query string with the scoped groups' parameters removed, or\n * `null` when there was nothing to remove. The page uses it to tidy a\n * hand-written URL like `/stacks/flutter/?stack=react&platform=ios`.\n *\n * `paramKeys` maps a group to its URL key. Callers pass core's\n * `DIRECTORY_FILTER_KEYS`, so this file needs no package import.\n */\nexport function searchWithoutScope(\n search: string,\n scope: DirectoryScope | null | undefined,\n paramKeys: Readonly<Record<ScopeGroup, string>>,\n): string | null {\n const groups = scopedGroups(scope);\n const params = new URLSearchParams(search);\n let changed = false;\n for (const group of groups) {\n const key = paramKeys[group];\n if (params.has(key)) {\n params.delete(key);\n changed = true;\n }\n }\n if (!changed) return null;\n const query = params.toString();\n return query ? `?${query}` : '';\n}\n\n/**\n * URL for one facet group's new selection. Every other parameter in\n * `search` is kept, so the query, other groups, sort and lens survive.\n * The group's key is rewritten and `page` is dropped, because a\n * different result set starts on page 1.\n *\n * This is the same URL shape the page has always used: a repeated key\n * per value. Existing links keep working.\n */\nexport function hrefForGroupSelection(\n search: string,\n pathPrefix: string,\n paramKey: string,\n values: readonly string[],\n): string {\n const params = new URLSearchParams(search);\n params.delete(paramKey);\n params.delete('page');\n for (const value of values) if (value) params.append(paramKey, value);\n const query = params.toString();\n return query ? `${
|
|
92
|
+
"content": "/**\n * Live-filter logic for the browse page. These are the pieces of\n * behaviour that do not need a DOM: URL building, the history-session\n * decision, the labels the page speaks, a debounce and the focus\n * fallback index.\n *\n * They live here, not inline in the `.astro` scripts, so they can be\n * unit-tested. RefinePanel, FilterDrawer and DirectoryIndexClient\n * import them.\n */\n\n/** The facet groups a scope can fix (core's `DirectoryFilterGroupKey`). */\nexport type ScopeGroup = 'stacks' | 'platforms' | 'categories' | 'tags' | 'licenses';\n\n/**\n * A fixed slice of the directory that a page browses inside, keyed by\n * facet group: `{ stacks: ['flutter'] }` on `/stacks/flutter/`,\n * `{ categories: ['productivity'] }` on `/categories/productivity/`.\n *\n * A scope is not a filter the visitor chose. It is merged into every\n * query, but it never shows as a chip or a facet, and it never goes in\n * the URL: the page's own path already says it. So clearing filters,\n * the zero-results reset and Back/Forward can never drop it.\n */\nexport type DirectoryScope = Partial<Record<ScopeGroup, readonly string[]>>;\n\n/** The facet groups a scope fixes. Groups with no values do not count. */\nexport function scopedGroups(scope: DirectoryScope | null | undefined): ScopeGroup[] {\n if (!scope) return [];\n return (Object.keys(scope) as ScopeGroup[]).filter((key) => (scope[key]?.length ?? 0) > 0);\n}\n\n/**\n * Drop the scoped groups from a filter state read off the URL. On\n * `/stacks/flutter/?stack=react` the `stack` parameter is ignored:\n * the page is Flutter, whatever the query says.\n */\nexport function withoutScope<F extends Partial<Record<ScopeGroup, unknown>>>(\n filters: F,\n scope: DirectoryScope | null | undefined,\n): F {\n const groups = scopedGroups(scope);\n if (groups.length === 0) return filters;\n const next = { ...filters };\n for (const group of groups) delete next[group];\n return next;\n}\n\n/**\n * The query string with the scoped groups' parameters removed, or\n * `null` when there was nothing to remove. The page uses it to tidy a\n * hand-written URL like `/stacks/flutter/?stack=react&platform=ios`.\n *\n * `paramKeys` maps a group to its URL key. Callers pass core's\n * `DIRECTORY_FILTER_KEYS`, so this file needs no package import.\n */\nexport function searchWithoutScope(\n search: string,\n scope: DirectoryScope | null | undefined,\n paramKeys: Readonly<Record<ScopeGroup, string>>,\n): string | null {\n const groups = scopedGroups(scope);\n const params = new URLSearchParams(search);\n let changed = false;\n for (const group of groups) {\n const key = paramKeys[group];\n if (params.has(key)) {\n params.delete(key);\n changed = true;\n }\n }\n if (!changed) return null;\n const query = params.toString();\n return query ? `?${query}` : '';\n}\n\n/**\n * URL for one facet group's new selection. Every other parameter in\n * `search` is kept, so the query, other groups, sort and lens survive.\n * The group's key is rewritten and `page` is dropped, because a\n * different result set starts on page 1.\n *\n * This is the same URL shape the page has always used: a repeated key\n * per value. Existing links keep working.\n */\nexport function hrefForGroupSelection(\n search: string,\n pathPrefix: string,\n paramKey: string,\n values: readonly string[],\n): string {\n const params = new URLSearchParams(search);\n params.delete(paramKey);\n params.delete('page');\n for (const value of values) if (value) params.append(paramKey, value);\n const query = params.toString();\n // The list is `/apps/`; `/apps` is only a redirect to it (core's\n // `directoryHref` follows the same rule).\n const base = pathPrefix === '' || pathPrefix.endsWith('/') ? pathPrefix : `${pathPrefix}/`;\n return query ? `${base}?${query}` : base;\n}\n\n/**\n * Whether the browse page can show `target` in place, or must really\n * navigate to it.\n *\n * A URL with a query is always a client view of the list, so it can\n * be shown in place. A URL with no query is a prerendered document.\n * On page 1 of the same list that is the document already on screen,\n * so clearing the last filter can still happen in place, keeping focus\n * and an open drawer. From `/{slug}/page/2/`, or for a different path,\n * it is a different document and has to load for real. Otherwise page\n * 2's records would sit under the page-1 URL.\n */\nexport function canAdoptInPlace(\n target: { pathname: string; search: string },\n currentPathname: string,\n routePage: number,\n): boolean {\n if (target.search) return true;\n const strip = (path: string) => path.replace(/\\/$/, '');\n return strip(target.pathname) === strip(currentPathname) && routePage <= 1;\n}\n\n/** What a filter change does to the history stack. */\nexport type HistoryMode = 'push' | 'replace';\n\n/** Where the history stood when a filter session opened. */\nexport interface HistorySnapshot {\n url: string;\n scrollY: number;\n}\n\n/**\n * The history entries a closing session has to write: put `start` back\n * on the current entry, then push `end`.\n */\nexport interface HistoryCommit {\n start: HistorySnapshot;\n end: string;\n}\n\n/**\n * One \"filter session\": the time a filter surface (a facet popover or\n * the mobile drawer) is open.\n *\n * While a session is open, each change replaces the current history\n * entry, so ticking five checkboxes does not leave five Back steps.\n * When the last surface closes and the URL has changed, the caller\n * restores the starting URL on the current entry and pushes the final\n * one. That is one pushState per session, and Back goes to the result\n * set from before the session.\n *\n * Surfaces nest: a popover can open inside the drawer. The session\n * only ends when every surface has closed.\n */\nexport class FilterHistorySession {\n #open = new Set<string>();\n #start: HistorySnapshot | null = null;\n\n /** True while at least one filter surface is open. */\n get active(): boolean {\n return this.#open.size > 0;\n }\n\n /** A surface opened. The first one records where history stood. */\n open(surface: string, snapshot: HistorySnapshot): void {\n if (this.#open.size === 0) this.#start = snapshot;\n this.#open.add(surface);\n }\n\n /** How a filter change made now should write to history. */\n modeForChange(): HistoryMode {\n return this.active ? 'replace' : 'push';\n }\n\n /**\n * A surface closed. Returns the commit to write when this ended the\n * session and the URL changed during it. Otherwise returns `null`:\n * another surface is still open, the surface was not open, or\n * nothing changed.\n */\n close(surface: string, currentUrl: string): HistoryCommit | null {\n if (!this.#open.delete(surface) || this.#open.size > 0) return null;\n const start = this.#start;\n this.#start = null;\n if (!start || sameUrl(start.url, currentUrl)) return null;\n return { start, end: currentUrl };\n }\n\n /**\n * Back/Forward moved to another entry while a surface was open. The\n * new entry becomes the session's starting point: later changes\n * replace it, and closing pushes one entry after it. When no session\n * is open this does nothing.\n */\n rebase(snapshot: HistorySnapshot): void {\n if (this.active) this.#start = snapshot;\n }\n}\n\n/** Compare two same-origin URLs, ignoring a trailing slash on the path. */\nfunction sameUrl(a: string, b: string): boolean {\n const left = new URL(a, 'https://grove.invalid');\n const right = new URL(b, 'https://grove.invalid');\n const path = (url: URL) => url.pathname.replace(/\\/$/, '');\n return path(left) === path(right) && left.search === right.search;\n}\n\n/** `1 app`, `12 apps`. */\nexport function countLabel(count: number, singular: string, plural: string): string {\n return `${count} ${count === 1 ? singular : plural}`;\n}\n\n/**\n * What the polite live region says after the results change. It is a\n * whole sentence because a screen reader hears it without the visible\n * heading around it.\n */\nexport function resultsAnnouncement(count: number, singular: string, plural: string): string {\n if (count === 0) return `No ${plural} match these filters.`;\n return `${countLabel(count, singular, plural)} found.`;\n}\n\n/**\n * Label for the mobile drawer's results button. The button shows the\n * results. It does not apply anything, because every change has\n * already applied.\n */\nexport function showResultsLabel(\n count: number,\n singular: string,\n plural: string,\n pending = false,\n): string {\n if (pending) return 'Updating results…';\n if (count === 0) return `No ${plural} match`;\n return `Show ${countLabel(count, singular, plural)}`;\n}\n\n/** A trailing-edge debounce that can also be cancelled. */\nexport interface Debounced<Args extends unknown[]> {\n (...args: Args): void;\n cancel(): void;\n}\n\nexport function debounce<Args extends unknown[]>(\n fn: (...args: Args) => void,\n wait: number,\n): Debounced<Args> {\n let timer: ReturnType<typeof setTimeout> | undefined;\n const debounced = (...args: Args) => {\n if (timer !== undefined) clearTimeout(timer);\n timer = setTimeout(() => {\n timer = undefined;\n fn(...args);\n }, wait);\n };\n debounced.cancel = () => {\n if (timer !== undefined) clearTimeout(timer);\n timer = undefined;\n };\n return debounced;\n}\n\n/**\n * When a list re-renders under a focused item (for example, removing\n * the focused chip), this picks which item gets focus next. The answer\n * is the item that took the old one's place, or the new last item.\n * Returns `-1` when the list is empty and the caller has to fall back\n * to something else.\n */\nexport function focusIndexAfterRender(previousIndex: number, length: number): number {\n if (length <= 0) return -1;\n return Math.min(Math.max(previousIndex, 0), length - 1);\n}\n",
|
|
93
93
|
"type": "registry:file",
|
|
94
94
|
"target": "~/src/lib/live-filters.ts"
|
|
95
95
|
}
|
|
96
96
|
],
|
|
97
97
|
"meta": {
|
|
98
98
|
"version": "1.6.0",
|
|
99
|
-
"requiresGrove": "1.
|
|
99
|
+
"requiresGrove": "1.4.0"
|
|
100
100
|
},
|
|
101
101
|
"type": "registry:block"
|
|
102
102
|
}
|
package/dist/r/collections.json
CHANGED