@grove-dev/astro 0.2.6 → 0.2.13

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.
Files changed (136) hide show
  1. package/dist/lib/display.d.ts +11 -17
  2. package/dist/lib/display.d.ts.map +1 -1
  3. package/dist/lib/display.js +43 -43
  4. package/dist/lib/display.js.map +1 -1
  5. package/dist/lib/format.d.ts +6 -7
  6. package/dist/lib/format.d.ts.map +1 -1
  7. package/dist/lib/format.js +11 -12
  8. package/dist/lib/format.js.map +1 -1
  9. package/dist/lib/lenses.d.ts +35 -73
  10. package/dist/lib/lenses.d.ts.map +1 -1
  11. package/dist/lib/lenses.js +144 -126
  12. package/dist/lib/lenses.js.map +1 -1
  13. package/dist/lib/repo.d.ts +11 -22
  14. package/dist/lib/repo.d.ts.map +1 -1
  15. package/dist/lib/repo.js +12 -25
  16. package/dist/lib/repo.js.map +1 -1
  17. package/dist/lib/scores.d.ts +15 -16
  18. package/dist/lib/scores.d.ts.map +1 -1
  19. package/dist/lib/scores.js +4 -11
  20. package/dist/lib/scores.js.map +1 -1
  21. package/dist/lib/search.d.ts +47 -129
  22. package/dist/lib/search.d.ts.map +1 -1
  23. package/dist/lib/search.js +195 -180
  24. package/dist/lib/search.js.map +1 -1
  25. package/dist/lib/taxonomy-counts.d.ts +7 -21
  26. package/dist/lib/taxonomy-counts.d.ts.map +1 -1
  27. package/dist/lib/taxonomy-counts.js +12 -31
  28. package/dist/lib/taxonomy-counts.js.map +1 -1
  29. package/package.json +4 -4
  30. package/src/components/AppsIndexRow.astro +55 -184
  31. package/src/components/AppsPagination.astro +45 -108
  32. package/src/components/CategoryGrid.astro +43 -31
  33. package/src/components/ContributorsGrid.astro +3 -3
  34. package/src/components/CurationGrid.astro +41 -0
  35. package/src/components/ExploreByStack.astro +6 -0
  36. package/src/components/FilterGroupMenu.astro +49 -0
  37. package/src/components/FilterOptions.astro +44 -0
  38. package/src/components/Hero.astro +198 -147
  39. package/src/components/Icon.astro +10 -3
  40. package/src/components/ItemCard.astro +266 -248
  41. package/src/components/RecordSection.astro +68 -33
  42. package/src/components/RefinePanel.astro +115 -141
  43. package/src/components/StackGrid.astro +32 -24
  44. package/src/components/WhyThisExists.astro +32 -32
  45. package/src/layouts/BaseLayout.astro +104 -49
  46. package/src/layouts/Container.astro +5 -44
  47. package/src/layouts/Footer.astro +31 -20
  48. package/src/layouts/Header.astro +40 -19
  49. package/src/layouts/SectionHeader.astro +27 -43
  50. package/src/layouts/Seo.astro +38 -56
  51. package/src/layouts/ThemeToggle.astro +35 -48
  52. package/src/lib/display.ts +46 -53
  53. package/src/lib/format.ts +11 -12
  54. package/src/lib/lenses.ts +151 -172
  55. package/src/lib/repo.ts +16 -28
  56. package/src/lib/scores.ts +15 -19
  57. package/src/lib/search.ts +222 -290
  58. package/src/lib/taxonomy-counts.ts +12 -46
  59. package/src/styles.css +207 -1
  60. package/templates/default/.github/ISSUE_TEMPLATE/bug_report.md +33 -0
  61. package/templates/default/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  62. package/templates/default/.github/ISSUE_TEMPLATE/record_submission.md +48 -0
  63. package/templates/default/.github/pull_request_template.md +27 -0
  64. package/templates/default/.github/workflows/build.yml +55 -0
  65. package/templates/default/.github/workflows/cleanup-stale-records.yml +48 -0
  66. package/templates/default/.github/workflows/daily-refresh.yml +53 -0
  67. package/templates/default/.github/workflows/sync-contributors.yml +53 -0
  68. package/templates/default/.github/workflows/sync-github-metadata.yml +58 -0
  69. package/templates/default/.github/workflows/validate-data.yml +35 -0
  70. package/templates/default/data/records/coolify.yml +46 -0
  71. package/templates/default/data/records/gitea.yml +46 -0
  72. package/templates/default/data/records/hoppscotch.yml +47 -0
  73. package/templates/default/data/records/inventree.yml +47 -0
  74. package/templates/default/data/records/label-studio.yml +46 -0
  75. package/templates/default/data/records/logseq.yml +48 -0
  76. package/templates/default/data/records/private-gpt.yml +47 -0
  77. package/templates/default/data/records/wakapi.yml +44 -0
  78. package/templates/default/data/taxonomy/categories.yml +47 -0
  79. package/templates/default/data/taxonomy/distribution-channels.yml +43 -0
  80. package/templates/default/data/taxonomy/platforms.yml +27 -0
  81. package/templates/default/data/taxonomy/stacks.yml +41 -0
  82. package/templates/default/grove.config.ts +1 -1
  83. package/templates/default/package.json +5 -4
  84. package/templates/default/public/icons/stacks/bun.svg +1 -0
  85. package/templates/default/public/icons/stacks/clojure.svg +1 -0
  86. package/templates/default/public/icons/stacks/clojurescript.svg +1 -0
  87. package/templates/default/public/icons/stacks/deno.svg +1 -0
  88. package/templates/default/public/icons/stacks/django.svg +1 -0
  89. package/templates/default/public/icons/stacks/docker.svg +1 -0
  90. package/templates/default/public/icons/stacks/go.svg +1 -0
  91. package/templates/default/public/icons/stacks/llm.svg +1 -0
  92. package/templates/default/public/icons/stacks/node.js.svg +1 -0
  93. package/templates/default/public/icons/stacks/sveltekit.svg +1 -0
  94. package/templates/default/public/icons/stacks/vue.svg +1 -0
  95. package/templates/default/public/llms-full.txt +197 -5
  96. package/templates/default/public/llms.txt +107 -6
  97. package/templates/default/public/sitemap.xml +63 -0
  98. package/templates/default/scripts/build-llms.mjs +123 -0
  99. package/templates/default/scripts/build-records-json.mjs +27 -0
  100. package/templates/default/scripts/build-sitemap.mjs +20 -0
  101. package/templates/default/scripts/cleanup-stale-records.mjs +20 -0
  102. package/templates/default/scripts/enrich-github-metadata.mjs +99 -0
  103. package/templates/default/scripts/fetch-icons.mjs +137 -0
  104. package/templates/default/scripts/migrate-legacy-to-schema-v1.mjs +86 -0
  105. package/templates/default/scripts/parse-legacy-readme.mjs +59 -0
  106. package/templates/default/scripts/refresh-records-activity.mjs +24 -0
  107. package/templates/default/scripts/repair-license-format.mjs +72 -0
  108. package/templates/default/scripts/report-cleanup-candidates.mjs +21 -0
  109. package/templates/default/scripts/seed-from-github.mjs +62 -0
  110. package/templates/default/scripts/sync-contributors.mjs +145 -0
  111. package/templates/default/scripts/sync-github-metadata.mjs +28 -0
  112. package/templates/default/scripts/validate-records.mjs +27 -0
  113. package/templates/default/src/data/records.ts +134 -51
  114. package/templates/default/src/pages/404.astro +64 -0
  115. package/templates/default/src/pages/{projects/[slug].astro → [slug]/[itemSlug].astro} +236 -66
  116. package/templates/default/src/pages/[slug]/index.astro +476 -0
  117. package/templates/default/src/pages/about.astro +165 -82
  118. package/templates/default/src/pages/apps/[itemSlug].astro +301 -0
  119. package/templates/default/src/pages/apps/index.astro +146 -0
  120. package/templates/default/src/pages/contributors.astro +184 -0
  121. package/templates/default/src/pages/index.astro +119 -162
  122. package/templates/default/src/pages/submit.astro +276 -114
  123. package/templates/default/wrangler.jsonc +28 -0
  124. package/LICENSE +0 -21
  125. package/templates/default/data/generated/apps.json +0 -1
  126. package/templates/default/data/generated/records.full.json +0 -8
  127. package/templates/default/data/generated/records.index.json +0 -7
  128. package/templates/default/data/generated/records.json +0 -8
  129. package/templates/default/data/generated/repo-stats.json +0 -1
  130. package/templates/default/data/generated/site-config.json +0 -31
  131. package/templates/default/src/components/layout/BaseLayout.astro +0 -47
  132. package/templates/default/src/components/layout/Container.astro +0 -18
  133. package/templates/default/src/components/layout/Footer.astro +0 -27
  134. package/templates/default/src/components/layout/Header.astro +0 -43
  135. package/templates/default/src/lib/markdown.ts +0 -171
  136. package/templates/default/src/pages/projects/index.astro +0 -193
@@ -1,33 +1,27 @@
1
1
  /**
2
- * Display-name helpers for curation labels, statuses, lenses, and
3
- * sort options. Internal ids (e.g. "hot", "stale", "production-like")
4
- * stay stable for URL state and data files; this module owns the
5
- * mapping from id → user-facing string.
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
6
  *
7
- * Every export is dependency-free so it can be imported by both
7
+ * Every export here is dependency-free so it can be imported by both
8
8
  * server-rendered Astro components and any client-side script.
9
- *
10
- * Status ids accept the `HealthStatus` union from `@grove-dev/core`
11
- * plus a couple of curated composites (e.g. "needs-maintainer")
12
- * that appear in URL state.
13
9
  */
14
- import type { AppLabel, HealthStatus } from "@grove-dev/core";
15
- export type LabelId = AppLabel;
10
+ export type LabelId = "new" | "hot" | "mature" | "featured";
16
11
  export declare const LABEL_DISPLAY: Record<LabelId, string>;
17
- /** Pretty-print a slug to Title Case. Used for arbitrary slugs. */
18
- export declare function prettySlug(slug: string | null | undefined): string;
19
12
  /** Returns a human-readable name for a label id, or null if unknown. */
20
13
  export declare function labelDisplay(id: string | null | undefined): string | null;
21
14
  /**
22
- * Canonical status display map. Includes the curated
23
- * "needs-maintainer" composite that's emitted by the
24
- * `needs-maintainer` lens.
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).
25
18
  */
26
19
  export declare const STATUS_DISPLAY: Record<string, string>;
27
- export declare function statusDisplay(s: HealthStatus | string | null | undefined): string;
20
+ export declare function statusDisplay(s: string | null | undefined): string;
28
21
  export declare const LENS_DISPLAY: Record<string, string>;
29
22
  export declare function lensDisplay(id: string | null | undefined): string;
30
23
  export declare const SORT_DISPLAY: Record<string, string>;
31
24
  export declare function sortDisplay(id: string | null | undefined): string;
25
+ export declare function prettySlug(value: string | null | undefined): string;
32
26
  export declare const STATUS_OPTIONS: string[];
33
27
  //# sourceMappingURL=display.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"display.d.ts","sourceRoot":"","sources":["../../src/lib/display.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,KAAK,EACV,QAAQ,EACR,YAAY,EACb,MAAM,iBAAiB,CAAC;AAGzB,MAAM,MAAM,OAAO,GAAG,QAAQ,CAAC;AAE/B,eAAO,MAAM,aAAa,EAAE,MAAM,CAAC,OAAO,EAAE,MAAM,CAKjD,CAAC;AAEF,mEAAmE;AACnE,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG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AO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAY/C,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAGjE;AAGD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAM/C,CAAC;AAEF,wBAAgB,WAAW,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAGjE;AAED,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAOnE;AAMD,eAAO,MAAM,cAAc,EAAE,MAAM,EAYlC,CAAC"}
@@ -1,15 +1,11 @@
1
1
  /**
2
- * Display-name helpers for curation labels, statuses, lenses, and
3
- * sort options. Internal ids (e.g. "hot", "stale", "production-like")
4
- * stay stable for URL state and data files; this module owns the
5
- * mapping from id → user-facing string.
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
6
  *
7
- * Every export is dependency-free so it can be imported by both
7
+ * Every export here is dependency-free so it can be imported by both
8
8
  * server-rendered Astro components and any client-side script.
9
- *
10
- * Status ids accept the `HealthStatus` union from `@grove-dev/core`
11
- * plus a couple of curated composites (e.g. "needs-maintainer")
12
- * that appear in URL state.
13
9
  */
14
10
  export const LABEL_DISPLAY = {
15
11
  new: "Recently added",
@@ -17,66 +13,56 @@ export const LABEL_DISPLAY = {
17
13
  mature: "Established",
18
14
  featured: "Featured",
19
15
  };
20
- /** Pretty-print a slug to Title Case. Used for arbitrary slugs. */
21
- export function prettySlug(slug) {
22
- if (!slug)
23
- return "";
24
- return slug
25
- .replace(/[-_]+/g, " ")
26
- .replace(/\s+/g, " ")
27
- .trim()
28
- .split(" ")
29
- .map((w) => (w ? w[0].toUpperCase() + w.slice(1) : ""))
30
- .join(" ");
31
- }
32
16
  /** Returns a human-readable name for a label id, or null if unknown. */
33
17
  export function labelDisplay(id) {
34
18
  if (!id)
35
19
  return null;
36
- if (id in LABEL_DISPLAY) {
37
- return LABEL_DISPLAY[id];
38
- }
39
- return prettySlug(id);
20
+ return LABEL_DISPLAY[id] ?? null;
40
21
  }
41
- // ── Status ids (the `health.status` field on a record) ───────────
22
+ // ── Status ids (the `status` field on an item) ───────────────────────
42
23
  /**
43
- * Canonical status display map. Includes the curated
44
- * "needs-maintainer" composite that's emitted by the
45
- * `needs-maintainer` lens.
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).
46
27
  */
47
28
  export const STATUS_DISPLAY = {
48
29
  active: "Active",
49
30
  mature: "Mature",
31
+ quiet: "Quiet",
50
32
  stale: "Not recently active",
51
33
  inactive: "Inactive",
34
+ "needs-maintainer": "Needs maintainer",
52
35
  archived: "Archived",
53
- unknown: "Unknown",
54
36
  historical: "Historical",
55
37
  needs_review: "Needs review",
56
- quiet: "Quiet",
57
38
  unavailable: "Unavailable",
58
- "needs-maintainer": "Needs maintainer",
39
+ unknown: "Unknown",
59
40
  };
60
41
  export function statusDisplay(s) {
61
42
  if (!s)
62
43
  return STATUS_DISPLAY.unknown;
63
- return STATUS_DISPLAY[s] ?? prettySlug(s);
44
+ return STATUS_DISPLAY[s] ?? STATUS_DISPLAY.unknown;
64
45
  }
65
- // ── Lens ids (the curated tabs on /projects) ─────────────────────
46
+ // ── Lens ids (the curated tabs on /items) ────────────────────────────
66
47
  export const LENS_DISPLAY = {
67
- all: "All",
68
- hot: "Trending",
48
+ all: "All items",
69
49
  new: "Recently added",
50
+ hot: "Trending",
70
51
  mature: "Established",
71
- featured: "Featured",
72
- "needs-review": "Needs review",
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",
73
59
  };
74
60
  export function lensDisplay(id) {
75
61
  if (!id)
76
62
  return LENS_DISPLAY.all;
77
- return LENS_DISPLAY[id] ?? prettySlug(id);
63
+ return LENS_DISPLAY[id] ?? id;
78
64
  }
79
- // ── Sort ids (the /projects sort dropdown) ───────────────────────
65
+ // ── Sort ids (the /items sort dropdown) ──────────────────────────────
80
66
  export const SORT_DISPLAY = {
81
67
  "recently-updated": "Recently updated",
82
68
  "most-starred": "Most starred",
@@ -87,18 +73,32 @@ export const SORT_DISPLAY = {
87
73
  export function sortDisplay(id) {
88
74
  if (!id)
89
75
  return SORT_DISPLAY["recently-updated"];
90
- return SORT_DISPLAY[id] ?? prettySlug(id);
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(" ");
91
86
  }
92
- // ── Status option list (used by filter dropdowns) ───────────────
87
+ // ── Status option list (used by filter dropdowns) ───────────────────
93
88
  // "needs-maintainer" is included even though it's a derived/composite
94
89
  // status — filter dropdowns and chip rendering need to offer it
95
- // alongside the raw HealthStatus values.
90
+ // alongside the raw AppStatus values.
96
91
  export const STATUS_OPTIONS = [
97
92
  "active",
93
+ "mature",
98
94
  "quiet",
99
95
  "stale",
96
+ "inactive",
100
97
  "needs-maintainer",
101
98
  "archived",
99
+ "historical",
100
+ "needs_review",
101
+ "unavailable",
102
102
  "unknown",
103
103
  ];
104
104
  //# sourceMappingURL=display.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"display.js","sourceRoot":"","sources":["../../src/lib/display.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAUH,MAAM,CAAC,MAAM,aAAa,GAA4B;IACpD,GAAG,EAAE,gBAAgB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C,GAAG,CAAC;IACjC,OAAO,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;AAChC,CAAC;AAED,wEAAwE;AACxE,MAAM,CAAC,MAAM,YAAY,GAA2B;IAClD,kBAAkB,EAAE,kBAAkB;IACtC,cAAc,EAAE,cAAc;IAC9B,gBAAgB,EAAE,gBAAgB;IAClC,cAAc,EAAE,cAAc;IAC9B,YAAY,EAAE,cAAc;CAC7B,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,EAA6B;IACvD,IAAI,CAAC,EAAE;QAAE,OAAO,YAAY,CAAC,kBAAkB,CAAC,CAAC;IACjD,OAAO,YAAY,CAAC,EAAE,CAAC,IAAI,EAAE,CAAC;AAChC,CAAC;AAED,MAAM,UAAU,UAAU,CAAC,KAAgC;IACzD,IAAI,CAAC,KAAK;QAAE,OAAO,EAAE,CAAC;IACtB,OAAO,KAAK;SACT,KAAK,CAAC,OAAO,CAAC;SACd,MAAM,CAAC,OAAO,CAAC;SACf,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,WAAW,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SAC3D,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED,uEAAuE;AACvE,sEAAsE;AACtE,gEAAgE;AAChE,sCAAsC;AACtC,MAAM,CAAC,MAAM,cAAc,GAAa;IACtC,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,OAAO;IACP,UAAU;IACV,kBAAkB;IAClB,UAAU;IACV,YAAY;IACZ,cAAc;IACd,aAAa;IACb,SAAS;CACV,CAAC"}
@@ -1,9 +1,8 @@
1
1
  /**
2
- * Shared formatting helpers.
2
+ * Shared formatting helpers used across components.
3
3
  *
4
- * Dependency-free importable by both server-rendered Astro
5
- * components and any future client-side script. No `Intl`-heavy
6
- * calls that would explode the client bundle.
4
+ * Keep these dependency-free so they can be imported by both server-
5
+ * rendered Astro components and any future client-side scripts.
7
6
  */
8
7
  /**
9
8
  * Format a number compactly: 1234 → "1.2k", 12345 → "12k", 79 → "79".
@@ -11,7 +10,7 @@
11
10
  */
12
11
  export declare function compact(n: number): string;
13
12
  /**
14
- * Format a star count compactly. Returns `null` when input is not a
13
+ * Format a star count compactly. Returns null when input is not a
15
14
  * finite number, so callers can render "—" without an extra guard.
16
15
  */
17
16
  export declare function formatStars(n: number | null | undefined): string | null;
@@ -20,11 +19,11 @@ export declare function formatStars(n: number | null | undefined): string | null
20
19
  * Returns "—" for missing or invalid input, and "today" for future
21
20
  * dates (which can happen with bad upstream timestamps).
22
21
  */
23
- export declare function formatRelative(date: string | null | undefined): string;
22
+ export declare function formatRelative(iso: string | null | undefined): string;
24
23
  /**
25
24
  * Format an ISO date as a localized short date (e.g. "Jan 5, 2026").
26
25
  * Returns the original string for unparseable input, or "—" when
27
26
  * no value is provided.
28
27
  */
29
- export declare function formatDate(date: string | null | undefined): string;
28
+ export declare function formatDate(iso: string | null | undefined): string;
30
29
  //# sourceMappingURL=format.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/lib/format.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAMzC;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAGvE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CActE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,IAAI,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CASlE"}
1
+ {"version":3,"file":"format.d.ts","sourceRoot":"","sources":["../../src/lib/format.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH;;;GAGG;AACH,wBAAgB,OAAO,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAMzC;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAGvE;AAED;;;;GAIG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CAcrE;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,GAAG,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,CASjE"}
@@ -1,9 +1,8 @@
1
1
  /**
2
- * Shared formatting helpers.
2
+ * Shared formatting helpers used across components.
3
3
  *
4
- * Dependency-free importable by both server-rendered Astro
5
- * components and any future client-side script. No `Intl`-heavy
6
- * calls that would explode the client bundle.
4
+ * Keep these dependency-free so they can be imported by both server-
5
+ * rendered Astro components and any future client-side scripts.
7
6
  */
8
7
  /**
9
8
  * Format a number compactly: 1234 → "1.2k", 12345 → "12k", 79 → "79".
@@ -17,7 +16,7 @@ export function compact(n) {
17
16
  return n.toString();
18
17
  }
19
18
  /**
20
- * Format a star count compactly. Returns `null` when input is not a
19
+ * Format a star count compactly. Returns null when input is not a
21
20
  * finite number, so callers can render "—" without an extra guard.
22
21
  */
23
22
  export function formatStars(n) {
@@ -30,10 +29,10 @@ export function formatStars(n) {
30
29
  * Returns "—" for missing or invalid input, and "today" for future
31
30
  * dates (which can happen with bad upstream timestamps).
32
31
  */
33
- export function formatRelative(date) {
34
- if (!date)
32
+ export function formatRelative(iso) {
33
+ if (!iso)
35
34
  return "—";
36
- const d = new Date(date);
35
+ const d = new Date(iso);
37
36
  if (Number.isNaN(d.valueOf()))
38
37
  return "—";
39
38
  const days = Math.floor((Date.now() - d.valueOf()) / (1000 * 60 * 60 * 24));
@@ -58,12 +57,12 @@ export function formatRelative(date) {
58
57
  * Returns the original string for unparseable input, or "—" when
59
58
  * no value is provided.
60
59
  */
61
- export function formatDate(date) {
62
- if (!date)
60
+ export function formatDate(iso) {
61
+ if (!iso)
63
62
  return "—";
64
- const d = new Date(date);
63
+ const d = new Date(iso);
65
64
  if (Number.isNaN(d.valueOf()))
66
- return date;
65
+ return iso;
67
66
  return d.toLocaleDateString("en-US", {
68
67
  year: "numeric",
69
68
  month: "short",
@@ -1 +1 @@
1
- {"version":3,"file":"format.js","sourceRoot":"","sources":["../../src/lib/format.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH;;;GAGG;AACH,MAAM,UAAU,OAAO,CAAC,CAAS;IAC/B,IAAI,CAAC,IAAI,IAAI,EAAE,CAAC;QACd,MAAM,CAAC,GAAG,CAAC,GAAG,IAAI,CAAC;QACnB,OAAO,CAAC,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,CAAC;IACnE,CAAC;IACD,OAAO,CAAC,CAAC,QAAQ,EAAE,CAAC;AACtB,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,WAAW,CAAC,CAA4B;IACtD,IAAI,OAAO,CAAC,KAAK,QAAQ,IAAI,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,CAAC;QAAE,OAAO,IAAI,CAAC;IAC9D,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;AACpB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,cAAc,CAAC,IAA+B;IAC5D,IAAI,CAAC,IAAI;QAAE,OAAO,GAAG,CAAC;IACtB,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,IAAI,CAAC,CAAC;IACzB,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAAE,OAAO,GAAG,CAAC;IAC1C,MAAM,IAAI,GAAG,IAAI,CA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,CAAC,IAAI,GAAG,EAAE,CAAC,CAAC;IACrC,IAAI,MAAM,KAAK,CAAC;QAAE,OAAO,SAAS,CAAC;IACnC,IAAI,MAAM,GAAG,EAAE;QAAE,OAAO,GAAG,MAAM,QAAQ,CAAC;IAC1C,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;IACtC,IAAI,KAAK,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IACjC,OAAO,GAAG,KAAK,OAAO,CAAC;AACzB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,UAAU,CAAC,GAA8B;IACvD,IAAI,CAAC,GAAG;QAAE,OAAO,GAAG,CAAC;IACrB,MAAM,CAAC,GAAG,IAAI,IAAI,CAAC,GAAG,CAAC,CAAC;IACxB,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC;QAAE,OAAO,GAAG,CAAC;IAC1C,OAAO,CAAC,CAAC,kBAAkB,CAAC,OAAO,EAAE;QACnC,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,OAAO;QACd,GAAG,EAAE,SAAS;KACf,CAAC,CAAC;AACL,CAAC"}
@@ -1,96 +1,58 @@
1
1
  /**
2
- * Curated lenses for the list / discovery page.
2
+ * Curated lenses for the list page.
3
3
  *
4
- * A lens is a single-select view that translates into a (possibly
5
- * empty) URL search-param filter. The 6 lenses below cover the
6
- * "what should I look at next?" mental shortcut:
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.
7
9
  *
8
- * - "all" — no filter
9
- * - "hot" — recent attention: stars 1000 OR pushed within 30d
10
- * - "new" — fresh entries: pushed within 7d OR curated "new" label
11
- * - "mature" — long-running projects: curated tier AND pushed > 365d ago
12
- * - "featured" — curated "featured" label
13
- * - "needs-review" — cleanup candidate (stale / archived / etc.)
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.
14
12
  *
15
- * The lens id is what shows up in the URL as `?lens=...`. Filter
16
- * resolution happens in `lib/search.ts` (`filterApps`).
17
- *
18
- * Keep this list in sync with `lib/search.ts` and any UI tabs.
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.
19
16
  */
20
- import type { HealthStatus, ProjectRecord } from "@grove-dev/core";
21
- export type LensId = "all" | "hot" | "new" | "mature" | "featured" | "needs-review";
17
+ export type LensId = "all" | "new" | "hot" | "mature" | "good-to-learn" | "production-like" | "beginner-friendly" | "contribution-ready" | "launches" | "actively-developed" | "needs-maintainer";
22
18
  export interface LensDef {
23
19
  id: LensId;
24
20
  label: string;
25
- description: string;
26
- /**
27
- * Returns true when the record matches this lens. Designed to
28
- * operate on the index payload (`toIndexRecord`) shape — the
29
- * same record the list page already holds — so consumers don't
30
- * need to do a second fetch.
31
- */
32
- match: (record: AppLike) => boolean;
33
- }
34
- /**
35
- * The shape that lens matching actually reads. Decoupled from
36
- * `ProjectRecord` so the search lib can also pass the index payload
37
- * (which omits a few heavy fields) and tests can pass minimal
38
- * fixtures.
39
- */
40
- export interface AppLike {
41
- curation?: {
42
- labels?: string[];
43
- };
44
- health?: {
45
- status?: HealthStatus;
46
- tier?: "curated" | "listed" | "experimental" | "hidden";
47
- cleanupCandidate?: boolean;
48
- };
49
- github?: {
50
- stars?: number;
51
- pushedAt?: string | null;
52
- };
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[]>;
53
25
  }
54
26
  export declare const LENSES: LensDef[];
55
27
  /**
56
- * The lenses rendered as top-row tabs on the list page. Order
57
- * matters — left to right. Keep this in sync with what the design
58
- * calls for; URL deep-linking accepts any `LensId` even if it's not
59
- * in the primary row.
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.
60
31
  */
61
32
  export declare const PRIMARY_LENSES: LensId[];
62
33
  export declare function lensById(id: string | null | undefined): LensDef | undefined;
63
- export declare function isPrimaryLens(id: string | null | undefined): id is LensId;
64
34
  /**
65
- * Resolve the active lens from URL search params. Returns the empty
66
- * string when no `lens=...` is set, so callers can treat both
67
- * "absent" and "unknown" identically.
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).
68
39
  */
69
- export declare function lensFromSearchParams(params: URLSearchParams): LensId | "";
40
+ export declare function isLensActive(lensId: LensId, sp: URLSearchParams): boolean;
41
+ export declare function isPrimaryLens(id: string | null | undefined): boolean;
70
42
  /**
71
- * `true` when the URL search params currently reflect this lens's
72
- * filter shape. The "all" lens is the implicit "no filter" state —
73
- * it's active only when no other lens-shaped params are present.
43
+ * Turn a lens's `toParams()` output into a URLSearchParams string
44
+ * (with the existing query preserved, then lens params merged on top).
74
45
  */
75
- export declare function isLensActive(lensId: LensId, params: URLSearchParams): boolean;
46
+ export declare function lensToQuery(id: LensId | null | undefined, current: URLSearchParams): string;
76
47
  /**
77
- * Build a `href` for a lens tab. Selecting a lens resets the other
78
- * "view" params (label, page) and applies only the chosen lens's
79
- * filter. Other filters (q, stack, platform, category, sort) are
80
- * preserved.
81
- *
82
- * `pathPrefix` is the URL root for the list page — typically
83
- * `/projects` for the project-directory blueprint, `/resources` for
84
- * resource-hub, `/entities` for ecosystem-map. Defaults to `/`.
48
+ * Read a `?lens=...` value from URL search params.
85
49
  */
86
- export declare function hrefForLens(lensId: LensId, params: URLSearchParams, pathPrefix?: string): string;
50
+ export declare function lensFromSearchParams(sp: URLSearchParams): LensId | null;
87
51
  /**
88
- * Apply the lens filter to a record array. When `lensId` is
89
- * `""` (no lens) or `"all"`, returns the input unchanged.
90
- *
91
- * Type-parameterized so the same helper works on `ProjectRecord[]`
92
- * and on the lighter index payload that list pages ship.
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.
93
56
  */
94
- export declare function applyLens<T extends AppLike>(records: T[], lensId: LensId | ""): T[];
95
- export type { ProjectRecord };
57
+ export declare function hrefForLens(lensId: LensId | null | undefined, current: URLSearchParams, pathPrefix?: string): string;
96
58
  //# sourceMappingURL=lenses.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"lenses.d.ts","sourceRoot":"","sources":["../../src/lib/lenses.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,OAAO,KAAK,EACV,YAAY,EACZ,aAAa,EACd,MAAM,iBAAiB,CAAC;AAEzB,MAAM,MAAM,MAAM,GACd,KAAK,GACL,KAAK,GACL,KAAK,GACL,QAAQ,GACR,UAAU,GACV,cAAc,CAAC;AAEnB,MAAM,WAAW,OAAO;IACtB,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,WAAW,EAAE,MAAM,CAAC;IACpB;;;;;OAKG;IACH,KAAK,EAAE,CAAC,MAAM,EAAE,OAAO,KAAK,OAAO,CAAC;CACrC;AAID;;;;;GAKG;AACH,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,EAAE;QAAE,MAAM,CAAC,EAAE,MAAM,EAAE,CAAA;KAAE,CAAC;IACjC,MAAM,CAAC,EAAE;QACP,MAAM,CAAC,EAAE,YAAY,CAAC;QACtB,IAAI,CAAC,EAAE,SAAS,GAAG,QAAQ,GAAG,cAAc,GAAG,QAAQ,CAAC;QACxD,gBAAgB,CAAC,EAAE,OAAO,CAAC;KAC5B,CAAC;IACF,MAAM,CAAC,EAAE;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