@grove-dev/astro 0.3.1 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -75
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/display.d.ts +1 -26
- package/dist/lib/display.d.ts.map +1 -1
- package/dist/lib/display.js +1 -103
- package/dist/lib/display.js.map +1 -1
- package/dist/lib/format.d.ts +1 -28
- package/dist/lib/format.d.ts.map +1 -1
- package/dist/lib/format.js +1 -71
- package/dist/lib/format.js.map +1 -1
- package/dist/lib/lenses.d.ts +1 -57
- package/dist/lib/lenses.d.ts.map +1 -1
- package/dist/lib/lenses.js +1 -198
- package/dist/lib/lenses.js.map +1 -1
- package/dist/lib/repo.d.ts +1 -19
- package/dist/lib/repo.d.ts.map +1 -1
- package/dist/lib/repo.js +1 -30
- package/dist/lib/repo.js.map +1 -1
- package/dist/lib/scores.d.ts +1 -36
- package/dist/lib/scores.d.ts.map +1 -1
- package/dist/lib/scores.js +1 -75
- package/dist/lib/scores.js.map +1 -1
- package/dist/lib/search.d.ts +1 -113
- package/dist/lib/search.d.ts.map +1 -1
- package/dist/lib/search.js +1 -379
- package/dist/lib/search.js.map +1 -1
- package/dist/lib/taxonomy-counts.d.ts +1 -10
- package/dist/lib/taxonomy-counts.d.ts.map +1 -1
- package/dist/lib/taxonomy-counts.js +1 -21
- package/dist/lib/taxonomy-counts.js.map +1 -1
- package/package.json +23 -11
- package/src/components/ContributorsGrid.astro +3 -3
- package/src/components/CurationGrid.astro +2 -2
- package/src/components/DirectoryIndexClient.astro +240 -0
- package/src/components/FilterGroupMenu.astro +8 -4
- package/src/components/FinalCta.astro +41 -0
- package/src/components/Hero.astro +15 -18
- package/src/components/Icon.astro +35 -7
- package/src/components/IndexRow.astro +2 -2
- package/src/components/ItemCard.astro +2 -7
- package/src/components/RefinePanel.astro +7 -7
- package/src/components/SmartLensTabs.astro +9 -5
- package/src/components/StackGrid.astro +1 -1
- package/src/components/SubmissionClient.astro +133 -0
- package/src/index.ts +11 -1
- package/src/layouts/BaseLayout.astro +30 -8
- package/src/layouts/Footer.astro +25 -56
- package/src/layouts/Header.astro +33 -15
- package/src/layouts/ThemeToggle.astro +7 -3
- package/src/lib/display.ts +1 -111
- package/src/lib/format.ts +1 -64
- package/src/lib/lenses.ts +1 -220
- package/src/lib/repo.ts +1 -32
- package/src/lib/scores.ts +1 -90
- package/src/lib/search.ts +1 -418
- package/src/lib/taxonomy-counts.ts +1 -26
- package/{templates/default/src/data/records.ts → src/server/directory.ts} +12 -8
- package/src/server/index.ts +2 -0
- package/src/server/models.ts +436 -0
- package/dist/template-routes.test.d.ts +0 -2
- package/dist/template-routes.test.d.ts.map +0 -1
- package/dist/template-routes.test.js +0 -63
- package/dist/template-routes.test.js.map +0 -1
- package/dist/theme.test.d.ts +0 -2
- package/dist/theme.test.d.ts.map +0 -1
- package/dist/theme.test.js +0 -60
- package/dist/theme.test.js.map +0 -1
- package/src/template-routes.test.ts +0 -103
- package/src/theme.test.ts +0 -76
- package/templates/default/.github/ISSUE_TEMPLATE/bug_report.md +0 -33
- package/templates/default/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/templates/default/.github/ISSUE_TEMPLATE/record_submission.md +0 -48
- package/templates/default/.github/pull_request_template.md +0 -27
- package/templates/default/.github/workflows/build.yml +0 -53
- package/templates/default/.github/workflows/cleanup-stale-records.yml +0 -46
- package/templates/default/.github/workflows/daily-refresh.yml +0 -51
- package/templates/default/.github/workflows/sync-contributors.yml +0 -51
- package/templates/default/.github/workflows/sync-github-metadata.yml +0 -56
- package/templates/default/.github/workflows/validate-data.yml +0 -33
- package/templates/default/astro.config.mjs +0 -25
- package/templates/default/content/pages/about.md +0 -66
- package/templates/default/content/pages/methodology.md +0 -103
- package/templates/default/data/records/.gitkeep +0 -0
- package/templates/default/data/records/coolify.yml +0 -46
- package/templates/default/data/records/gitea.yml +0 -46
- package/templates/default/data/records/hoppscotch.yml +0 -47
- package/templates/default/data/records/inventree.yml +0 -47
- package/templates/default/data/records/label-studio.yml +0 -46
- package/templates/default/data/records/logseq.yml +0 -48
- package/templates/default/data/records/private-gpt.yml +0 -47
- package/templates/default/data/records/wakapi.yml +0 -44
- package/templates/default/data/taxonomy/categories.yml +0 -47
- package/templates/default/data/taxonomy/distribution-channels.yml +0 -43
- package/templates/default/data/taxonomy/platforms.yml +0 -27
- package/templates/default/data/taxonomy/stacks.yml +0 -41
- package/templates/default/grove.config.ts +0 -36
- package/templates/default/package.json +0 -43
- package/templates/default/public/icons/platforms/android.svg +0 -1
- package/templates/default/public/icons/platforms/apple-dark.svg +0 -1
- package/templates/default/public/icons/platforms/apple-light.svg +0 -1
- package/templates/default/public/icons/platforms/chrome.svg +0 -1
- package/templates/default/public/icons/platforms/chromeos.svg +0 -5
- package/templates/default/public/icons/platforms/desktop.svg +0 -4
- package/templates/default/public/icons/platforms/embedded.svg +0 -5
- package/templates/default/public/icons/platforms/ios.svg +0 -1
- package/templates/default/public/icons/platforms/linux.svg +0 -1
- package/templates/default/public/icons/platforms/macos.svg +0 -1
- package/templates/default/public/icons/platforms/ubuntu.svg +0 -1
- package/templates/default/public/icons/platforms/web.svg +0 -5
- package/templates/default/public/icons/platforms/windows.svg +0 -6
- package/templates/default/public/icons/stacks/android.svg +0 -1
- package/templates/default/public/icons/stacks/apple-dark.svg +0 -1
- package/templates/default/public/icons/stacks/apple-light.svg +0 -1
- package/templates/default/public/icons/stacks/bun.svg +0 -1
- package/templates/default/public/icons/stacks/capacitor.svg +0 -14
- package/templates/default/public/icons/stacks/clojure.svg +0 -1
- package/templates/default/public/icons/stacks/clojurescript.svg +0 -1
- package/templates/default/public/icons/stacks/dart.svg +0 -1
- package/templates/default/public/icons/stacks/deno.svg +0 -1
- package/templates/default/public/icons/stacks/django.svg +0 -1
- package/templates/default/public/icons/stacks/docker.svg +0 -1
- package/templates/default/public/icons/stacks/firebase.svg +0 -1
- package/templates/default/public/icons/stacks/flutter.svg +0 -1
- package/templates/default/public/icons/stacks/go.svg +0 -1
- package/templates/default/public/icons/stacks/graphql.svg +0 -1
- package/templates/default/public/icons/stacks/ionic.svg +0 -4
- package/templates/default/public/icons/stacks/java.svg +0 -1
- package/templates/default/public/icons/stacks/javascript.svg +0 -1
- package/templates/default/public/icons/stacks/kotlin.svg +0 -1
- package/templates/default/public/icons/stacks/llm.svg +0 -1
- package/templates/default/public/icons/stacks/mongodb.svg +0 -1
- package/templates/default/public/icons/stacks/node.js.svg +0 -1
- package/templates/default/public/icons/stacks/nodejs.svg +0 -1
- package/templates/default/public/icons/stacks/python.svg +0 -1
- package/templates/default/public/icons/stacks/rag.svg +0 -7
- package/templates/default/public/icons/stacks/react-native.svg +0 -1
- package/templates/default/public/icons/stacks/react.svg +0 -1
- package/templates/default/public/icons/stacks/rust.svg +0 -1
- package/templates/default/public/icons/stacks/solidity.svg +0 -1
- package/templates/default/public/icons/stacks/sveltekit.svg +0 -1
- package/templates/default/public/icons/stacks/swift.svg +0 -1
- package/templates/default/public/icons/stacks/tensorflow.svg +0 -1
- package/templates/default/public/icons/stacks/typescript.svg +0 -1
- package/templates/default/public/icons/stacks/vue.svg +0 -1
- package/templates/default/public/llms-full.txt +0 -83
- package/templates/default/public/llms.txt +0 -11
- package/templates/default/public/og-image.svg +0 -48
- package/templates/default/public/robots.txt +0 -53
- package/templates/default/public/sitemap.xml +0 -63
- package/templates/default/src/pages/404.astro +0 -64
- package/templates/default/src/pages/[slug]/[recordSlug].astro +0 -691
- package/templates/default/src/pages/[slug]/index.astro +0 -482
- package/templates/default/src/pages/about.astro +0 -189
- package/templates/default/src/pages/apps/[recordSlug].astro +0 -34
- package/templates/default/src/pages/contributors.astro +0 -175
- package/templates/default/src/pages/index.astro +0 -233
- package/templates/default/src/pages/sitemap.xml.ts +0 -89
- package/templates/default/src/pages/submit.astro +0 -281
- package/templates/default/src/styles/global.css +0 -33
- package/templates/default/tsconfig.json +0 -9
- package/templates/default/wrangler.jsonc +0 -28
package/README.md
CHANGED
|
@@ -1,89 +1,23 @@
|
|
|
1
1
|
# `@grove-dev/astro`
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Composable Astro UI and generated-data adapters for Grove-powered directories.
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
The integration prepares generated data before Astro runs, aliases generated files, and loads Grove's shared styles. It does not inject routes. Every route lives in the consumer's `src/pages`, where it can be reordered, replaced, or extended without a Grove sync overwriting it.
|
|
6
6
|
|
|
7
|
-
```
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
## What it ships
|
|
12
|
-
|
|
13
|
-
```txt
|
|
14
|
-
src/
|
|
15
|
-
├── components/ # ItemCard, CategoryGrid, ScoreBars, IndexRow,
|
|
16
|
-
│ # Pagination, RecordSection, RefinePanel, Hero,
|
|
17
|
-
│ # Icon, SmartLensTabs, ExploreByCategory,
|
|
18
|
-
│ # ExploreByStack, WhyThisExists, CurationGrid,
|
|
19
|
-
│ # ContributorsGrid, StackGrid, MinimalAbout,
|
|
20
|
-
│ # OriginalCollection, DecisionRow, FilterGroupMenu,
|
|
21
|
-
│ # FilterOptions
|
|
22
|
-
├── layouts/ # BaseLayout
|
|
23
|
-
├── styles.css # design tokens + utility classes
|
|
24
|
-
└── index.ts # re-exports @grove-dev/core + @grove-dev/ui
|
|
25
|
-
|
|
26
|
-
templates/
|
|
27
|
-
└── default/ # full Astro starter: pages/, layouts/, public/, data/,
|
|
28
|
-
# .github/, astro.config.mjs
|
|
29
|
-
```
|
|
30
|
-
|
|
31
|
-
The package publishes `dist/`, `src/`, and `templates/`. The `templates/` directory is **not** imported by consumers; it is copied by `@grove-dev/cli` at scaffold time.
|
|
32
|
-
|
|
33
|
-
> **Component naming:** `ItemCard` is the V1 published API name (kept for stability — it appears in user docs and downstream sites). The internal `IndexRow` / `Pagination` / `RecordSection` aliases are V1 canonical names; the old `AppsIndexRow` / `AppsPagination` / `ItemSection` V0 names have been removed.
|
|
34
|
-
|
|
35
|
-
## Usage in a space
|
|
7
|
+
```js
|
|
8
|
+
import { defineConfig } from "astro/config";
|
|
9
|
+
import grove from "@grove-dev/astro";
|
|
36
10
|
|
|
37
|
-
|
|
38
|
-
---
|
|
39
|
-
import ItemCard from "@grove-dev/astro/components/ItemCard.astro";
|
|
40
|
-
import IndexRow from "@grove-dev/astro/components/IndexRow.astro";
|
|
41
|
-
import { ScoreBars, filterRecords, sortDisplay } from "@grove-dev/astro";
|
|
42
|
-
import "@grove-dev/astro/styles.css";
|
|
43
|
-
import BaseLayout from "@grove-dev/astro/layouts/BaseLayout.astro";
|
|
44
|
-
import records from "../data/generated/records.json";
|
|
45
|
-
---
|
|
46
|
-
<BaseLayout title="My Grove space">
|
|
47
|
-
<RefinePanel initial={filters} facets={facets} />
|
|
48
|
-
{records.map((r) => <ItemCard record={r} href={`/projects/${r.slug}`} />)}
|
|
49
|
-
</BaseLayout>
|
|
11
|
+
export default defineConfig({ integrations: [grove()] });
|
|
50
12
|
```
|
|
51
13
|
|
|
52
|
-
|
|
14
|
+
`grove init` copies a complete working set of home, directory list, record detail, about, contributors, submit, 404, and legacy redirect pages from the canonical `apps/example/` scaffold. `grove.config.ts` determines the directory route and branding.
|
|
53
15
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
`templates/default/` is a complete Astro starter. It contains:
|
|
57
|
-
|
|
58
|
-
- `src/pages/` — index, contributors, about, submit, 404, sitemap.xml, plus blueprint-aware dynamic routes at `[slug]/index.astro` (list) and `[slug]/[recordSlug].astro` (detail), plus `apps/[recordSlug].astro` (V0→V1 301 redirect)
|
|
59
|
-
- `src/components/` — site-specific page sections (none by default; the V1 surface is in `packages/astro/src/components/`)
|
|
60
|
-
- `src/data/records.ts` — typed loader for `data/generated/records.full.json` (V0 `src/data/config.ts` is replaced)
|
|
61
|
-
- `src/lib/` — site-specific helpers (no business logic)
|
|
62
|
-
- `scripts/` — `build-llms.mjs` (regenerates `llms-full.txt` only, preserves committed `llms.txt`), `fetch-icons.mjs`, `migrate-legacy-to-schema-v1.mjs`
|
|
63
|
-
- `public/` — icons, OG image, robots, `llms.txt`, `llms-full.txt`
|
|
64
|
-
- `data/` — empty tree for the gardener to populate; `data/records/<slug>.yml` is the V1 layout (V0 was `data/apps/*.yml`)
|
|
65
|
-
- `astro.config.mjs` (no `tailwind.config.mjs` by default; plain CSS + design tokens)
|
|
66
|
-
- `.github/` — issue templates + 11 GitHub Actions workflows (validate, build, deploy, sync, cleanup, …)
|
|
67
|
-
|
|
68
|
-
Business logic (filtering, sorting, scoring, faceting) is **imported from `@grove-dev/ui`**, never re-implemented in the template. The V0 commands (`grove build-data`, `grove build-llms-full`, `grove analyze`, `grove enrich`) have been replaced with V1 names (`grove generate`, `grove llms`, `grove sync github`).
|
|
69
|
-
|
|
70
|
-
## Layering
|
|
71
|
-
|
|
72
|
-
`@grove-dev/astro` is the third layer of the Grove stack:
|
|
73
|
-
|
|
74
|
-
1. **`@grove-dev/core`** — schemas, importers, build pipeline (headless).
|
|
75
|
-
2. **`@grove-dev/ui`** — framework-agnostic UI primitives.
|
|
76
|
-
3. **`@grove-dev/astro`** ← you are here — Astro components, layouts, template.
|
|
77
|
-
|
|
78
|
-
If you need a Svelte or Next.js variant, see `@grove-dev/svelte` and `@grove-dev/nextjs`.
|
|
79
|
-
|
|
80
|
-
## Development
|
|
16
|
+
The package exports granular components and layouts plus `@grove-dev/astro/server` view-model functions. Framework-independent filtering, sorting, lenses, scoring, formatting, and taxonomy logic live in `@grove-dev/core`.
|
|
81
17
|
|
|
82
18
|
```bash
|
|
83
|
-
pnpm --filter @grove-dev/astro build
|
|
84
19
|
pnpm --filter @grove-dev/astro check
|
|
20
|
+
pnpm --dir apps/example build
|
|
85
21
|
```
|
|
86
22
|
|
|
87
|
-
## License
|
|
88
|
-
|
|
89
23
|
MIT
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AA6BA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAG9C,cAAc,iBAAiB,CAAC;AAMhC,cAAc,gBAAgB,CAAC;AAkB/B,MAAM,CAAC,OAAO,UAAU,UAAU,IAAI,gBAAgB,CAgErD;AAID,eAAO,MAAM,sBAAsB,sCAAiC,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -27,6 +27,7 @@
|
|
|
27
27
|
import { existsSync } from "node:fs";
|
|
28
28
|
import { fileURLToPath } from "node:url";
|
|
29
29
|
import { dirname, resolve } from "node:path";
|
|
30
|
+
import { loadConfig, prepareDirectory } from "@grove-dev/core";
|
|
30
31
|
export * from "@grove-dev/core";
|
|
31
32
|
// Generic lib helpers — repo URL parsing, formatting, search /
|
|
32
33
|
// facet / sort / paginate, lens application, score tiers, taxonomy
|
|
@@ -50,13 +51,21 @@ export default function groveAstro() {
|
|
|
50
51
|
return {
|
|
51
52
|
name: "@grove-dev/astro",
|
|
52
53
|
hooks: {
|
|
53
|
-
"astro:config:setup": ({ config, updateConfig, injectScript }) => {
|
|
54
|
+
"astro:config:setup": async ({ config, updateConfig, injectScript }) => {
|
|
54
55
|
// Alias the components/layouts source directories so
|
|
55
56
|
// consumer builds can import from
|
|
56
57
|
// @grove-dev/astro/components/ItemCard.astro
|
|
57
58
|
// without us shipping a glob-shaped `exports` map that
|
|
58
59
|
// Vite/Rollup does not expand reliably.
|
|
59
60
|
const consumerRoot = fileURLToPath(config.root);
|
|
61
|
+
const groveConfigPath = resolve(consumerRoot, "grove.config.ts");
|
|
62
|
+
if (existsSync(groveConfigPath)) {
|
|
63
|
+
await prepareDirectory(consumerRoot);
|
|
64
|
+
// Preparation is the integration's only site-level side effect.
|
|
65
|
+
// Routes belong to the consumer's `src/pages`, where they remain
|
|
66
|
+
// visible, editable, and safe from future Grove syncs.
|
|
67
|
+
await loadConfig(consumerRoot);
|
|
68
|
+
}
|
|
60
69
|
const globalCssPath = resolve(consumerRoot, "src/styles/global.css");
|
|
61
70
|
const globalCssExists = existsSync(globalCssPath);
|
|
62
71
|
updateConfig({
|
|
@@ -65,6 +74,7 @@ export default function groveAstro() {
|
|
|
65
74
|
alias: {
|
|
66
75
|
"@grove-dev/astro/components": componentsDir,
|
|
67
76
|
"@grove-dev/astro/layouts": layoutsDir,
|
|
77
|
+
"@grove/generated": resolve(consumerRoot, "data/generated"),
|
|
68
78
|
},
|
|
69
79
|
},
|
|
70
80
|
plugins: [
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;GAyBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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"}
|
package/dist/lib/display.d.ts
CHANGED
|
@@ -1,27 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Display-name helpers for curation labels, statuses, lenses, and sort
|
|
3
|
-
* options. Internal ids (e.g. "hot", "stale", "production-like") stay
|
|
4
|
-
* stable for URL state and data files; this module owns the mapping
|
|
5
|
-
* from id → user-facing string.
|
|
6
|
-
*
|
|
7
|
-
* Every export here is dependency-free so it can be imported by both
|
|
8
|
-
* server-rendered Astro components and any client-side script.
|
|
9
|
-
*/
|
|
10
|
-
export type LabelId = "new" | "hot" | "mature" | "featured";
|
|
11
|
-
export declare const LABEL_DISPLAY: Record<LabelId, string>;
|
|
12
|
-
/** Returns a human-readable name for a label id, or null if unknown. */
|
|
13
|
-
export declare function labelDisplay(id: string | null | undefined): string | null;
|
|
14
|
-
/**
|
|
15
|
-
* Canonical status ids, including the curated "needs-maintainer"
|
|
16
|
-
* composite that's emitted by the `needs-maintainer` lens (it expands
|
|
17
|
-
* to "stale,quiet" in URL state but presents as one chip).
|
|
18
|
-
*/
|
|
19
|
-
export declare const STATUS_DISPLAY: Record<string, string>;
|
|
20
|
-
export declare function statusDisplay(s: string | null | undefined): string;
|
|
21
|
-
export declare const LENS_DISPLAY: Record<string, string>;
|
|
22
|
-
export declare function lensDisplay(id: string | null | undefined): string;
|
|
23
|
-
export declare const SORT_DISPLAY: Record<string, string>;
|
|
24
|
-
export declare function sortDisplay(id: string | null | undefined): string;
|
|
25
|
-
export declare function prettySlug(value: string | null | undefined): string;
|
|
26
|
-
export declare const STATUS_OPTIONS: string[];
|
|
1
|
+
export * from "@grove-dev/core";
|
|
27
2
|
//# sourceMappingURL=display.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../src/lib/display.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../src/lib/display.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
package/dist/lib/display.js
CHANGED
|
@@ -1,104 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Display-name helpers for curation labels, statuses, lenses, and sort
|
|
3
|
-
* options. Internal ids (e.g. "hot", "stale", "production-like") stay
|
|
4
|
-
* stable for URL state and data files; this module owns the mapping
|
|
5
|
-
* from id → user-facing string.
|
|
6
|
-
*
|
|
7
|
-
* Every export here is dependency-free so it can be imported by both
|
|
8
|
-
* server-rendered Astro components and any client-side script.
|
|
9
|
-
*/
|
|
10
|
-
export const LABEL_DISPLAY = {
|
|
11
|
-
new: "Recently added",
|
|
12
|
-
hot: "Trending",
|
|
13
|
-
mature: "Established",
|
|
14
|
-
featured: "Featured",
|
|
15
|
-
};
|
|
16
|
-
/** Returns a human-readable name for a label id, or null if unknown. */
|
|
17
|
-
export function labelDisplay(id) {
|
|
18
|
-
if (!id)
|
|
19
|
-
return null;
|
|
20
|
-
return LABEL_DISPLAY[id] ?? null;
|
|
21
|
-
}
|
|
22
|
-
// ── Status ids (the `status` field on an item) ───────────────────────
|
|
23
|
-
/**
|
|
24
|
-
* Canonical status ids, including the curated "needs-maintainer"
|
|
25
|
-
* composite that's emitted by the `needs-maintainer` lens (it expands
|
|
26
|
-
* to "stale,quiet" in URL state but presents as one chip).
|
|
27
|
-
*/
|
|
28
|
-
export const STATUS_DISPLAY = {
|
|
29
|
-
active: "Active",
|
|
30
|
-
mature: "Mature",
|
|
31
|
-
quiet: "Quiet",
|
|
32
|
-
stale: "Not recently active",
|
|
33
|
-
inactive: "Inactive",
|
|
34
|
-
"needs-maintainer": "Needs maintainer",
|
|
35
|
-
archived: "Archived",
|
|
36
|
-
historical: "Historical",
|
|
37
|
-
needs_review: "Needs review",
|
|
38
|
-
unavailable: "Unavailable",
|
|
39
|
-
unknown: "Unknown",
|
|
40
|
-
};
|
|
41
|
-
export function statusDisplay(s) {
|
|
42
|
-
if (!s)
|
|
43
|
-
return STATUS_DISPLAY.unknown ?? "";
|
|
44
|
-
return STATUS_DISPLAY[s] ?? STATUS_DISPLAY.unknown ?? "";
|
|
45
|
-
}
|
|
46
|
-
// ── Lens ids (the curated tabs on /items) ────────────────────────────
|
|
47
|
-
export const LENS_DISPLAY = {
|
|
48
|
-
all: "All items",
|
|
49
|
-
new: "Recently added",
|
|
50
|
-
hot: "Trending",
|
|
51
|
-
mature: "Established",
|
|
52
|
-
"good-to-learn": "Good to learn",
|
|
53
|
-
"production-like": "Production-like",
|
|
54
|
-
"beginner-friendly": "Beginner friendly",
|
|
55
|
-
"contribution-ready": "Contribution ready",
|
|
56
|
-
launches: "Launches",
|
|
57
|
-
"actively-developed": "Active",
|
|
58
|
-
"needs-maintainer": "Needs maintainer",
|
|
59
|
-
};
|
|
60
|
-
export function lensDisplay(id) {
|
|
61
|
-
if (!id)
|
|
62
|
-
return LENS_DISPLAY.all ?? "All";
|
|
63
|
-
return LENS_DISPLAY[id] ?? id;
|
|
64
|
-
}
|
|
65
|
-
// ── Sort ids (the /items sort dropdown) ──────────────────────────────
|
|
66
|
-
export const SORT_DISPLAY = {
|
|
67
|
-
"recently-updated": "Recently updated",
|
|
68
|
-
"most-starred": "Most starred",
|
|
69
|
-
"recently-added": "Recently added",
|
|
70
|
-
"best-overall": "Best overall",
|
|
71
|
-
alphabetical: "Alphabetical",
|
|
72
|
-
};
|
|
73
|
-
export function sortDisplay(id) {
|
|
74
|
-
if (!id)
|
|
75
|
-
return SORT_DISPLAY["recently-updated"] ?? "";
|
|
76
|
-
return SORT_DISPLAY[id] ?? id;
|
|
77
|
-
}
|
|
78
|
-
export function prettySlug(value) {
|
|
79
|
-
if (!value)
|
|
80
|
-
return "";
|
|
81
|
-
return value
|
|
82
|
-
.split(/[-_]+/)
|
|
83
|
-
.filter(Boolean)
|
|
84
|
-
.map((part) => part.charAt(0).toUpperCase() + part.slice(1))
|
|
85
|
-
.join(" ");
|
|
86
|
-
}
|
|
87
|
-
// ── Status option list (used by filter dropdowns) ───────────────────
|
|
88
|
-
// "needs-maintainer" is included even though it's a derived/composite
|
|
89
|
-
// status — filter dropdowns and chip rendering need to offer it
|
|
90
|
-
// alongside the raw AppStatus values.
|
|
91
|
-
export const STATUS_OPTIONS = [
|
|
92
|
-
"active",
|
|
93
|
-
"mature",
|
|
94
|
-
"quiet",
|
|
95
|
-
"stale",
|
|
96
|
-
"inactive",
|
|
97
|
-
"needs-maintainer",
|
|
98
|
-
"archived",
|
|
99
|
-
"historical",
|
|
100
|
-
"needs_review",
|
|
101
|
-
"unavailable",
|
|
102
|
-
"unknown",
|
|
103
|
-
];
|
|
1
|
+
export * from "@grove-dev/core";
|
|
104
2
|
//# sourceMappingURL=display.js.map
|
package/dist/lib/display.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"display.js","sourceRoot":"","sources":["../../src/lib/display.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"display.js","sourceRoot":"","sources":["../../src/lib/display.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
package/dist/lib/format.d.ts
CHANGED
|
@@ -1,29 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Shared formatting helpers used across components.
|
|
3
|
-
*
|
|
4
|
-
* Keep these dependency-free so they can be imported by both server-
|
|
5
|
-
* rendered Astro components and any future client-side scripts.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Format a number compactly: 1234 → "1.2k", 12345 → "12k", 79 → "79".
|
|
9
|
-
* Used for hero/header star counts and other large-num displays.
|
|
10
|
-
*/
|
|
11
|
-
export declare function compact(n: number): string;
|
|
12
|
-
/**
|
|
13
|
-
* Format a star count compactly. Returns null when input is not a
|
|
14
|
-
* finite number, so callers can render "—" without an extra guard.
|
|
15
|
-
*/
|
|
16
|
-
export declare function formatStars(n: number | null | undefined): string | null;
|
|
17
|
-
/**
|
|
18
|
-
* Format an ISO date as a human "Xd ago" / "Xmo ago" / "Xy ago" string.
|
|
19
|
-
* Returns "—" for missing or invalid input, and "today" for future
|
|
20
|
-
* dates (which can happen with bad upstream timestamps).
|
|
21
|
-
*/
|
|
22
|
-
export declare function formatRelative(iso: string | null | undefined): string;
|
|
23
|
-
/**
|
|
24
|
-
* Format an ISO date as a localized short date (e.g. "Jan 5, 2026").
|
|
25
|
-
* Returns the original string for unparseable input, or "—" when
|
|
26
|
-
* no value is provided.
|
|
27
|
-
*/
|
|
28
|
-
export declare function formatDate(iso: string | null | undefined): string;
|
|
1
|
+
export * from "@grove-dev/core";
|
|
29
2
|
//# sourceMappingURL=format.d.ts.map
|
package/dist/lib/format.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/lib/format.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/lib/format.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
package/dist/lib/format.js
CHANGED
|
@@ -1,72 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Shared formatting helpers used across components.
|
|
3
|
-
*
|
|
4
|
-
* Keep these dependency-free so they can be imported by both server-
|
|
5
|
-
* rendered Astro components and any future client-side scripts.
|
|
6
|
-
*/
|
|
7
|
-
/**
|
|
8
|
-
* Format a number compactly: 1234 → "1.2k", 12345 → "12k", 79 → "79".
|
|
9
|
-
* Used for hero/header star counts and other large-num displays.
|
|
10
|
-
*/
|
|
11
|
-
export function compact(n) {
|
|
12
|
-
if (n >= 1000) {
|
|
13
|
-
const k = n / 1000;
|
|
14
|
-
return (k >= 10 ? Math.round(k).toString() : k.toFixed(1)) + "k";
|
|
15
|
-
}
|
|
16
|
-
return n.toString();
|
|
17
|
-
}
|
|
18
|
-
/**
|
|
19
|
-
* Format a star count compactly. Returns null when input is not a
|
|
20
|
-
* finite number, so callers can render "—" without an extra guard.
|
|
21
|
-
*/
|
|
22
|
-
export function formatStars(n) {
|
|
23
|
-
if (typeof n !== "number" || !Number.isFinite(n))
|
|
24
|
-
return null;
|
|
25
|
-
return compact(n);
|
|
26
|
-
}
|
|
27
|
-
/**
|
|
28
|
-
* Format an ISO date as a human "Xd ago" / "Xmo ago" / "Xy ago" string.
|
|
29
|
-
* Returns "—" for missing or invalid input, and "today" for future
|
|
30
|
-
* dates (which can happen with bad upstream timestamps).
|
|
31
|
-
*/
|
|
32
|
-
export function formatRelative(iso) {
|
|
33
|
-
if (!iso)
|
|
34
|
-
return "—";
|
|
35
|
-
const d = new Date(iso);
|
|
36
|
-
if (Number.isNaN(d.valueOf()))
|
|
37
|
-
return "—";
|
|
38
|
-
const days = Math.floor((Date.now() - d.valueOf()) / (1000 * 60 * 60 * 24));
|
|
39
|
-
if (days <= 0)
|
|
40
|
-
return "today";
|
|
41
|
-
if (days === 1)
|
|
42
|
-
return "1d ago";
|
|
43
|
-
if (days < 30)
|
|
44
|
-
return `${days}d ago`;
|
|
45
|
-
const months = Math.floor(days / 30);
|
|
46
|
-
if (months === 1)
|
|
47
|
-
return "1mo ago";
|
|
48
|
-
if (months < 12)
|
|
49
|
-
return `${months}mo ago`;
|
|
50
|
-
const years = Math.floor(months / 12);
|
|
51
|
-
if (years === 1)
|
|
52
|
-
return "1y ago";
|
|
53
|
-
return `${years}y ago`;
|
|
54
|
-
}
|
|
55
|
-
/**
|
|
56
|
-
* Format an ISO date as a localized short date (e.g. "Jan 5, 2026").
|
|
57
|
-
* Returns the original string for unparseable input, or "—" when
|
|
58
|
-
* no value is provided.
|
|
59
|
-
*/
|
|
60
|
-
export function formatDate(iso) {
|
|
61
|
-
if (!iso)
|
|
62
|
-
return "—";
|
|
63
|
-
const d = new Date(iso);
|
|
64
|
-
if (Number.isNaN(d.valueOf()))
|
|
65
|
-
return iso;
|
|
66
|
-
return d.toLocaleDateString("en-US", {
|
|
67
|
-
year: "numeric",
|
|
68
|
-
month: "short",
|
|
69
|
-
day: "numeric",
|
|
70
|
-
});
|
|
71
|
-
}
|
|
1
|
+
export * from "@grove-dev/core";
|
|
72
2
|
//# sourceMappingURL=format.js.map
|
package/dist/lib/format.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/lib/format.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/lib/format.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
package/dist/lib/lenses.d.ts
CHANGED
|
@@ -1,58 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Curated lenses for the list page.
|
|
3
|
-
*
|
|
4
|
-
* Two flavors:
|
|
5
|
-
* - "label-based": maps to a single `labels` value (e.g. new / hot / mature).
|
|
6
|
-
* No extra curation needed — every item already has a label.
|
|
7
|
-
* - "curator-assigned": maps to a `lenses` value on the item. The 5 anchor
|
|
8
|
-
* items get these populated. Other items will simply not match.
|
|
9
|
-
*
|
|
10
|
-
* The lens id is what shows up in the URL as `?lens=...`. For
|
|
11
|
-
* label-based lenses, the lens id is the same as the label.
|
|
12
|
-
*
|
|
13
|
-
* The 6 lenses in `PRIMARY_LENSES` are rendered as top-row tabs. The rest
|
|
14
|
-
* remain in the union type for URL deep-linking and future use, but are
|
|
15
|
-
* not shown in the UI by default.
|
|
16
|
-
*/
|
|
17
|
-
export type LensId = "all" | "new" | "hot" | "mature" | "good-to-learn" | "production-like" | "beginner-friendly" | "contribution-ready" | "launches" | "actively-developed" | "needs-maintainer";
|
|
18
|
-
export interface LensDef {
|
|
19
|
-
id: LensId;
|
|
20
|
-
label: string;
|
|
21
|
-
/** Short blurb shown when the lens is active. */
|
|
22
|
-
description?: string;
|
|
23
|
-
/** What URL state this lens implies. Empty means no filter. */
|
|
24
|
-
toParams: () => Record<string, string | string[]>;
|
|
25
|
-
}
|
|
26
|
-
export declare const LENSES: LensDef[];
|
|
27
|
-
/**
|
|
28
|
-
* The 6 lenses shown as top-row tabs on /items. Order matters — left to right.
|
|
29
|
-
* Keep this list aligned with what the design calls for: All, signal lenses,
|
|
30
|
-
* and the two curator-assigned lenses that have any matches.
|
|
31
|
-
*/
|
|
32
|
-
export declare const PRIMARY_LENSES: LensId[];
|
|
33
|
-
export declare function lensById(id: string | null | undefined): LensDef | undefined;
|
|
34
|
-
/**
|
|
35
|
-
* Check whether the current URL search params match a given lens's
|
|
36
|
-
* implied filter state. Used to highlight the active tab when a
|
|
37
|
-
* deep-link uses the underlying filter key (e.g. ?label=hot) rather
|
|
38
|
-
* than the abstract lens id (?lens=hot).
|
|
39
|
-
*/
|
|
40
|
-
export declare function isLensActive(lensId: LensId, sp: URLSearchParams): boolean;
|
|
41
|
-
export declare function isPrimaryLens(id: string | null | undefined): boolean;
|
|
42
|
-
/**
|
|
43
|
-
* Turn a lens's `toParams()` output into a URLSearchParams string
|
|
44
|
-
* (with the existing query preserved, then lens params merged on top).
|
|
45
|
-
*/
|
|
46
|
-
export declare function lensToQuery(id: LensId | null | undefined, current: URLSearchParams): string;
|
|
47
|
-
/**
|
|
48
|
-
* Read a `?lens=...` value from URL search params.
|
|
49
|
-
*/
|
|
50
|
-
export declare function lensFromSearchParams(sp: URLSearchParams): LensId | null;
|
|
51
|
-
/**
|
|
52
|
-
* Build a `href` for a lens tab. Per the single-select-view rule,
|
|
53
|
-
* clicking a lens resets the "view" params (lens, label, status, page)
|
|
54
|
-
* and applies only the chosen lens's params. Stack/Platform/Category/
|
|
55
|
-
* License/q/sort/density filters are preserved.
|
|
56
|
-
*/
|
|
57
|
-
export declare function hrefForLens(lensId: LensId | null | undefined, current: URLSearchParams, pathPrefix?: string): string;
|
|
1
|
+
export * from "@grove-dev/core";
|
|
58
2
|
//# sourceMappingURL=lenses.d.ts.map
|
package/dist/lib/lenses.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lenses.d.ts","sourceRoot":"","sources":["../../src/lib/lenses.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lenses.d.ts","sourceRoot":"","sources":["../../src/lib/lenses.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|