@grove-dev/astro 0.1.4 → 0.2.2

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 (246) hide show
  1. package/dist/index.d.ts +4 -25
  2. package/dist/index.d.ts.map +1 -1
  3. package/dist/index.js +56 -22
  4. package/dist/index.js.map +1 -1
  5. package/dist/layouts/index.d.ts +25 -0
  6. package/dist/layouts/index.d.ts.map +1 -0
  7. package/dist/layouts/index.js +25 -0
  8. package/dist/layouts/index.js.map +1 -0
  9. package/dist/lib/display.d.ts +33 -0
  10. package/dist/lib/display.d.ts.map +1 -0
  11. package/dist/lib/display.js +104 -0
  12. package/dist/lib/display.js.map +1 -0
  13. package/dist/lib/format.d.ts +30 -0
  14. package/dist/lib/format.d.ts.map +1 -0
  15. package/dist/lib/format.js +73 -0
  16. package/dist/lib/format.js.map +1 -0
  17. package/dist/lib/index.d.ts +26 -0
  18. package/dist/lib/index.d.ts.map +1 -0
  19. package/dist/lib/index.js +26 -0
  20. package/dist/lib/index.js.map +1 -0
  21. package/dist/lib/lenses.d.ts +96 -0
  22. package/dist/lib/lenses.d.ts.map +1 -0
  23. package/dist/lib/lenses.js +181 -0
  24. package/dist/lib/lenses.js.map +1 -0
  25. package/dist/lib/repo.d.ts +30 -0
  26. package/dist/lib/repo.d.ts.map +1 -0
  27. package/dist/lib/repo.js +44 -0
  28. package/dist/lib/repo.js.map +1 -0
  29. package/dist/lib/scores.d.ts +38 -0
  30. package/dist/lib/scores.d.ts.map +1 -0
  31. package/dist/lib/scores.js +83 -0
  32. package/dist/lib/scores.js.map +1 -0
  33. package/dist/lib/search.d.ts +199 -0
  34. package/dist/lib/search.d.ts.map +1 -0
  35. package/dist/lib/search.js +357 -0
  36. package/dist/lib/search.js.map +1 -0
  37. package/dist/lib/taxonomy-counts.d.ts +25 -0
  38. package/dist/lib/taxonomy-counts.d.ts.map +1 -0
  39. package/dist/lib/taxonomy-counts.js +41 -0
  40. package/dist/lib/taxonomy-counts.js.map +1 -0
  41. package/package.json +7 -7
  42. package/src/components/AppSection.astro +83 -0
  43. package/src/components/AppsIndexRow.astro +204 -0
  44. package/src/components/AppsPagination.astro +126 -0
  45. package/src/components/CategoryGrid.astro +86 -17
  46. package/src/components/ContributorsGrid.astro +149 -0
  47. package/src/components/DecisionRow.astro +89 -0
  48. package/src/components/ExploreByCategory.astro +67 -0
  49. package/src/components/ExploreByStack.astro +72 -0
  50. package/src/components/Hero.astro +246 -0
  51. package/src/components/Icon.astro +223 -0
  52. package/src/components/ItemCard.astro +289 -30
  53. package/src/components/MinimalAbout.astro +82 -0
  54. package/src/components/OriginalCollection.astro +116 -0
  55. package/src/components/RefinePanel.astro +197 -0
  56. package/src/components/ScoreBars.astro +92 -22
  57. package/src/components/SmartLensTabs.astro +71 -0
  58. package/src/components/StackGrid.astro +132 -0
  59. package/src/components/WhyThisExists.astro +116 -0
  60. package/src/index.ts +61 -14
  61. package/src/layouts/BaseLayout.astro +227 -15
  62. package/src/layouts/Container.astro +57 -0
  63. package/src/layouts/Footer.astro +235 -0
  64. package/src/layouts/Header.astro +159 -0
  65. package/src/layouts/SectionHeader.astro +58 -0
  66. package/{templates/default/src/components/layout → src/layouts}/Seo.astro +62 -38
  67. package/src/layouts/ThemeToggle.astro +110 -0
  68. package/src/layouts/astro-shim.d.ts +29 -0
  69. package/src/layouts/index.ts +24 -0
  70. package/src/lib/display.ts +118 -0
  71. package/src/lib/format.ts +65 -0
  72. package/src/lib/index.ts +26 -0
  73. package/src/lib/lenses.ts +241 -0
  74. package/src/lib/repo.ts +44 -0
  75. package/src/lib/scores.ts +94 -0
  76. package/src/lib/search.ts +481 -0
  77. package/src/lib/taxonomy-counts.ts +60 -0
  78. package/src/styles.css +366 -638
  79. package/templates/default/.astro/content.d.ts +155 -0
  80. package/templates/default/.astro/settings.json +5 -0
  81. package/templates/default/.astro/types.d.ts +2 -0
  82. package/templates/default/astro.config.mjs +8 -6
  83. package/templates/default/content/pages/about.md +66 -0
  84. package/templates/default/content/pages/methodology.md +103 -0
  85. package/templates/default/data/generated/records.full.json +8 -0
  86. package/templates/default/data/generated/records.index.json +7 -0
  87. package/templates/default/data/generated/records.json +8 -0
  88. package/templates/default/data/generated/site-config.json +31 -0
  89. package/templates/default/data/records/.gitkeep +0 -0
  90. package/templates/default/dist/_astro/BaseLayout.DfpwR3jc.css +1 -0
  91. package/templates/default/dist/about/index.html +165 -0
  92. package/templates/default/dist/icons/platforms/android.svg +1 -0
  93. package/templates/default/dist/icons/platforms/apple-dark.svg +1 -0
  94. package/templates/default/dist/icons/platforms/apple-light.svg +1 -0
  95. package/templates/default/dist/icons/platforms/chrome.svg +1 -0
  96. package/templates/default/dist/icons/platforms/chromeos.svg +5 -0
  97. package/templates/default/dist/icons/platforms/desktop.svg +4 -0
  98. package/templates/default/dist/icons/platforms/embedded.svg +5 -0
  99. package/templates/default/dist/icons/platforms/ios.svg +1 -0
  100. package/templates/default/dist/icons/platforms/linux.svg +1 -0
  101. package/templates/default/dist/icons/platforms/macos.svg +1 -0
  102. package/templates/default/dist/icons/platforms/ubuntu.svg +1 -0
  103. package/templates/default/dist/icons/platforms/web.svg +5 -0
  104. package/templates/default/dist/icons/platforms/windows.svg +6 -0
  105. package/templates/default/dist/icons/stacks/android.svg +1 -0
  106. package/templates/default/dist/icons/stacks/apple-dark.svg +1 -0
  107. package/templates/default/dist/icons/stacks/apple-light.svg +1 -0
  108. package/templates/default/dist/icons/stacks/capacitor.svg +14 -0
  109. package/templates/default/dist/icons/stacks/dart.svg +1 -0
  110. package/templates/default/dist/icons/stacks/firebase.svg +1 -0
  111. package/templates/default/dist/icons/stacks/flutter.svg +1 -0
  112. package/templates/default/dist/icons/stacks/graphql.svg +1 -0
  113. package/templates/default/dist/icons/stacks/ionic.svg +4 -0
  114. package/templates/default/dist/icons/stacks/java.svg +1 -0
  115. package/templates/default/dist/icons/stacks/javascript.svg +1 -0
  116. package/templates/default/dist/icons/stacks/kotlin.svg +1 -0
  117. package/templates/default/dist/icons/stacks/mongodb.svg +1 -0
  118. package/templates/default/dist/icons/stacks/nodejs.svg +1 -0
  119. package/templates/default/dist/icons/stacks/python.svg +1 -0
  120. package/templates/default/dist/icons/stacks/react-native.svg +1 -0
  121. package/templates/default/dist/icons/stacks/react.svg +1 -0
  122. package/templates/default/dist/icons/stacks/rust.svg +1 -0
  123. package/templates/default/dist/icons/stacks/solidity.svg +1 -0
  124. package/templates/default/dist/icons/stacks/swift.svg +1 -0
  125. package/templates/default/dist/icons/stacks/tensorflow.svg +1 -0
  126. package/templates/default/dist/icons/stacks/typescript.svg +1 -0
  127. package/templates/default/dist/index.html +55 -0
  128. package/templates/default/dist/llms-full.txt +14 -0
  129. package/templates/default/dist/llms.txt +11 -0
  130. package/templates/default/dist/og-image.svg +48 -0
  131. package/templates/default/dist/projects/index.html +61 -0
  132. package/templates/default/dist/robots.txt +53 -0
  133. package/templates/default/dist/sitemap.xml +21 -0
  134. package/templates/default/dist/submit/index.html +69 -0
  135. package/templates/default/grove.config.ts +36 -0
  136. package/templates/default/node_modules/.bin/astro +21 -0
  137. package/templates/default/node_modules/.bin/astro-check +21 -0
  138. package/templates/default/node_modules/.bin/grove +21 -0
  139. package/templates/default/node_modules/.bin/jiti +21 -0
  140. package/templates/default/node_modules/.bin/prettier +21 -0
  141. package/templates/default/node_modules/.bin/rollup +21 -0
  142. package/templates/default/node_modules/.bin/tsc +21 -0
  143. package/templates/default/node_modules/.bin/tsserver +21 -0
  144. package/templates/default/node_modules/.bin/tsx +21 -0
  145. package/templates/default/node_modules/.bin/vite +21 -0
  146. package/templates/default/node_modules/.bin/yaml +21 -0
  147. package/templates/default/node_modules/.vite/deps/_metadata.json +79 -0
  148. package/templates/default/node_modules/.vite/deps/astro-KRVZHBC5.js +433 -0
  149. package/templates/default/node_modules/.vite/deps/astro-KRVZHBC5.js.map +7 -0
  150. package/templates/default/node_modules/.vite/deps/astro___aria-query.js +5 -0
  151. package/templates/default/node_modules/.vite/deps/astro___aria-query.js.map +7 -0
  152. package/templates/default/node_modules/.vite/deps/astro___axobject-query.js +5 -0
  153. package/templates/default/node_modules/.vite/deps/astro___axobject-query.js.map +7 -0
  154. package/templates/default/node_modules/.vite/deps/astro___html-escaper.js +9 -0
  155. package/templates/default/node_modules/.vite/deps/astro___html-escaper.js.map +7 -0
  156. package/templates/default/node_modules/.vite/deps/astro_runtime_client_dev-toolbar_entrypoint__js.js +241 -0
  157. package/templates/default/node_modules/.vite/deps/astro_runtime_client_dev-toolbar_entrypoint__js.js.map +7 -0
  158. package/templates/default/node_modules/.vite/deps/audit-GYHQ3ITH.js +1592 -0
  159. package/templates/default/node_modules/.vite/deps/audit-GYHQ3ITH.js.map +7 -0
  160. package/templates/default/node_modules/.vite/deps/chunk-5WRI5ZAA.js +30 -0
  161. package/templates/default/node_modules/.vite/deps/chunk-5WRI5ZAA.js.map +7 -0
  162. package/templates/default/node_modules/.vite/deps/chunk-7P4KIK53.js +186 -0
  163. package/templates/default/node_modules/.vite/deps/chunk-7P4KIK53.js.map +7 -0
  164. package/templates/default/node_modules/.vite/deps/chunk-BQGHFQJH.js +48 -0
  165. package/templates/default/node_modules/.vite/deps/chunk-BQGHFQJH.js.map +7 -0
  166. package/templates/default/node_modules/.vite/deps/chunk-CJCDKWP2.js +6779 -0
  167. package/templates/default/node_modules/.vite/deps/chunk-CJCDKWP2.js.map +7 -0
  168. package/templates/default/node_modules/.vite/deps/chunk-FHJ3XBDE.js +33 -0
  169. package/templates/default/node_modules/.vite/deps/chunk-FHJ3XBDE.js.map +7 -0
  170. package/templates/default/node_modules/.vite/deps/chunk-FQEMNIUQ.js +88 -0
  171. package/templates/default/node_modules/.vite/deps/chunk-FQEMNIUQ.js.map +7 -0
  172. package/templates/default/node_modules/.vite/deps/chunk-HBSVDAQD.js +72 -0
  173. package/templates/default/node_modules/.vite/deps/chunk-HBSVDAQD.js.map +7 -0
  174. package/templates/default/node_modules/.vite/deps/chunk-HDOQ2U3U.js +3757 -0
  175. package/templates/default/node_modules/.vite/deps/chunk-HDOQ2U3U.js.map +7 -0
  176. package/templates/default/node_modules/.vite/deps/chunk-XEBKRCNE.js +54 -0
  177. package/templates/default/node_modules/.vite/deps/chunk-XEBKRCNE.js.map +7 -0
  178. package/templates/default/node_modules/.vite/deps/package.json +3 -0
  179. package/templates/default/node_modules/.vite/deps/settings-C5H4VHXU.js +213 -0
  180. package/templates/default/node_modules/.vite/deps/settings-C5H4VHXU.js.map +7 -0
  181. package/templates/default/node_modules/.vite/deps/toolbar-H5DB6HVP.js +525 -0
  182. package/templates/default/node_modules/.vite/deps/toolbar-H5DB6HVP.js.map +7 -0
  183. package/templates/default/node_modules/.vite/deps/ui-library-JGHU6JE2.js +1020 -0
  184. package/templates/default/node_modules/.vite/deps/ui-library-JGHU6JE2.js.map +7 -0
  185. package/templates/default/node_modules/.vite/deps/xray-EFCQOW4E.js +147 -0
  186. package/templates/default/node_modules/.vite/deps/xray-EFCQOW4E.js.map +7 -0
  187. package/templates/default/package.json +6 -5
  188. package/templates/default/public/llms-full.txt +14 -0
  189. package/templates/default/public/llms.txt +11 -0
  190. package/templates/default/src/components/layout/BaseLayout.astro +10 -57
  191. package/templates/default/src/components/layout/Footer.astro +16 -134
  192. package/templates/default/src/components/layout/Header.astro +25 -126
  193. package/templates/default/src/data/records.ts +161 -0
  194. package/templates/default/src/lib/markdown.ts +171 -0
  195. package/templates/default/src/pages/about.astro +95 -429
  196. package/templates/default/src/pages/index.astro +258 -61
  197. package/templates/default/src/pages/projects/[slug].astro +480 -0
  198. package/templates/default/src/pages/projects/index.astro +193 -0
  199. package/templates/default/src/pages/sitemap.xml.ts +73 -61
  200. package/templates/default/src/pages/submit.astro +122 -411
  201. package/templates/default/src/styles/global.css +42 -68
  202. package/src/components/ActiveFilterChips.astro +0 -20
  203. package/src/components/DirectoryFilters.astro +0 -100
  204. package/src/components/DirectoryHero.astro +0 -32
  205. package/src/components/HealthBadge.astro +0 -12
  206. package/src/components/LensTabs.astro +0 -26
  207. package/src/components/MethodologyPanel.astro +0 -20
  208. package/src/components/Pagination.astro +0 -24
  209. package/src/components/ProjectDetail.astro +0 -166
  210. package/src/components/SubmitDraft.astro +0 -137
  211. package/templates/default/src/components/AppCard.astro +0 -248
  212. package/templates/default/src/components/AppSection.astro +0 -58
  213. package/templates/default/src/components/AppsIndexRow.astro +0 -230
  214. package/templates/default/src/components/AppsPagination.astro +0 -147
  215. package/templates/default/src/components/CategoryGrid.astro +0 -80
  216. package/templates/default/src/components/ContributorsGrid.astro +0 -105
  217. package/templates/default/src/components/DecisionRow.astro +0 -219
  218. package/templates/default/src/components/ExploreByCategory.astro +0 -74
  219. package/templates/default/src/components/ExploreByStack.astro +0 -102
  220. package/templates/default/src/components/Hero.astro +0 -176
  221. package/templates/default/src/components/MinimalAbout.astro +0 -57
  222. package/templates/default/src/components/OriginalCollection.astro +0 -144
  223. package/templates/default/src/components/RefinePanel.astro +0 -272
  224. package/templates/default/src/components/ScoreBars.astro +0 -72
  225. package/templates/default/src/components/SmartLensTabs.astro +0 -65
  226. package/templates/default/src/components/StackGrid.astro +0 -95
  227. package/templates/default/src/components/WhyThisExists.astro +0 -81
  228. package/templates/default/src/components/icons/Icon.astro +0 -148
  229. package/templates/default/src/components/layout/SectionHeader.astro +0 -42
  230. package/templates/default/src/components/layout/ThemeToggle.astro +0 -97
  231. package/templates/default/src/data/apps.ts +0 -149
  232. package/templates/default/src/data/categories.ts +0 -27
  233. package/templates/default/src/data/config.ts +0 -28
  234. package/templates/default/src/data/contributors.ts +0 -96
  235. package/templates/default/src/data/stacks.ts +0 -47
  236. package/templates/default/src/data/stats.ts +0 -65
  237. package/templates/default/src/data/types.ts +0 -248
  238. package/templates/default/src/lib/apps-search.ts +0 -228
  239. package/templates/default/src/lib/format.ts +0 -36
  240. package/templates/default/src/lib/lenses.ts +0 -98
  241. package/templates/default/src/lib/repo.ts +0 -12
  242. package/templates/default/src/lib/scores.ts +0 -51
  243. package/templates/default/src/lib/taxonomy-counts.ts +0 -31
  244. package/templates/default/src/pages/apps/[slug].astro +0 -709
  245. package/templates/default/src/pages/apps/index.astro +0 -669
  246. package/templates/default/src/pages/contributors.astro +0 -142
package/dist/index.d.ts CHANGED
@@ -1,26 +1,5 @@
1
- /**
2
- * @grove-dev/astro — Astro UI primitives for Grove.
3
- *
4
- * This package only owns Astro components, layouts, styles, and
5
- * Astro-specific integrations. Generic filter/sort/stats/score
6
- * helpers live in `@grove-dev/ui` and are re-exported from here for
7
- * convenience.
8
- *
9
- * Templates (concrete pages, layouts, public/, .github/) are not
10
- * published; they're copied into user projects by `grove new`.
11
- */
12
- export * from "@grove-dev/ui";
13
- export { default as ItemCard } from "./components/ItemCard.astro";
14
- export { default as CategoryGrid } from "./components/CategoryGrid.astro";
15
- export { default as HealthBadge } from "./components/HealthBadge.astro";
16
- export { default as ScoreBars } from "./components/ScoreBars.astro";
17
- export { default as DirectoryHero } from "./components/DirectoryHero.astro";
18
- export { default as DirectoryFilters } from "./components/DirectoryFilters.astro";
19
- export { default as ActiveFilterChips } from "./components/ActiveFilterChips.astro";
20
- export { default as LensTabs } from "./components/LensTabs.astro";
21
- export { default as MethodologyPanel } from "./components/MethodologyPanel.astro";
22
- export { default as Pagination } from "./components/Pagination.astro";
23
- export { default as ProjectDetail } from "./components/ProjectDetail.astro";
24
- export { default as SubmitDraft } from "./components/SubmitDraft.astro";
25
- export { default as BaseLayout } from "./layouts/BaseLayout.astro";
1
+ import type { AstroIntegration } from "astro";
2
+ export * from "@grove-dev/core";
3
+ export * from "./lib/index.js";
4
+ export default function groveAstro(): AstroIntegration;
26
5
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,+BAA+B,CAAC;AACtE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,4BAA4B,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,OAAO,CAAC;AAE9C,cAAc,iBAAiB,CAAC;AAMhC,cAAc,gBAAgB,CAAC;AAW/B,MAAM,CAAC,OAAO,UAAU,UAAU,IAAI,gBAAgB,CAuBrD"}
package/dist/index.js CHANGED
@@ -1,26 +1,60 @@
1
1
  /**
2
- * @grove-dev/astro — Astro UI primitives for Grove.
2
+ * @grove-dev/astro — Astro framework adapter for Grove.
3
3
  *
4
- * This package only owns Astro components, layouts, styles, and
5
- * Astro-specific integrations. Generic filter/sort/stats/score
6
- * helpers live in `@grove-dev/ui` and are re-exported from here for
7
- * convenience.
8
- *
9
- * Templates (concrete pages, layouts, public/, .github/) are not
10
- * published; they're copied into user projects by `grove new`.
4
+ * Provides:
5
+ * - `default` export: an Astro integration that wires the
6
+ * `@grove-dev/astro/components/*` and `@grove-dev/astro/layouts/*`
7
+ * subpath imports into Vite so consumer projects can write:
8
+ * import ItemCard from "@grove-dev/astro/components/ItemCard.astro";
9
+ * and have Vite resolve the source `.astro` file (the package's
10
+ * `dist/` only contains TypeScript helpers, not the components
11
+ * themselves).
12
+ * - Re-exports the framework-agnostic `Resource` types from
13
+ * `@grove-dev/core` so the component prop signatures stay
14
+ * type-safe without forcing a dependency on the core package
15
+ * in every consumer file.
16
+ * - Re-exports the generic `lib/` helpers (search, lenses, scores,
17
+ * repo, format, display, taxonomy-counts) under a single import
18
+ * path so consumers can `import { ... } from "@grove-dev/astro"`.
11
19
  */
12
- export * from "@grove-dev/ui";
13
- export { default as ItemCard } from "./components/ItemCard.astro";
14
- export { default as CategoryGrid } from "./components/CategoryGrid.astro";
15
- export { default as HealthBadge } from "./components/HealthBadge.astro";
16
- export { default as ScoreBars } from "./components/ScoreBars.astro";
17
- export { default as DirectoryHero } from "./components/DirectoryHero.astro";
18
- export { default as DirectoryFilters } from "./components/DirectoryFilters.astro";
19
- export { default as ActiveFilterChips } from "./components/ActiveFilterChips.astro";
20
- export { default as LensTabs } from "./components/LensTabs.astro";
21
- export { default as MethodologyPanel } from "./components/MethodologyPanel.astro";
22
- export { default as Pagination } from "./components/Pagination.astro";
23
- export { default as ProjectDetail } from "./components/ProjectDetail.astro";
24
- export { default as SubmitDraft } from "./components/SubmitDraft.astro";
25
- export { default as BaseLayout } from "./layouts/BaseLayout.astro";
20
+ import { fileURLToPath } from "node:url";
21
+ import { dirname, resolve } from "node:path";
22
+ export * from "@grove-dev/core";
23
+ // Generic lib helpers repo URL parsing, formatting, search /
24
+ // facet / sort / paginate, lens application, score tiers, taxonomy
25
+ // counts, and pretty-print display maps. All dependency-free and
26
+ // typed against `@grove-dev/core`.
27
+ export * from "./lib/index.js";
28
+ const here = dirname(fileURLToPath(import.meta.url));
29
+ // `here` is the compiled `dist/` directory. The components and
30
+ // layouts live in the source tree (the `dist/` is for the
31
+ // integration helper only). Walk up one level to reach `src/`
32
+ // before resolving the subpath roots.
33
+ const srcRoot = resolve(here, "..", "src");
34
+ const componentsDir = resolve(srcRoot, "components");
35
+ const layoutsDir = resolve(srcRoot, "layouts");
36
+ export default function groveAstro() {
37
+ return {
38
+ name: "@grove-dev/astro",
39
+ hooks: {
40
+ "astro:config:setup": ({ updateConfig }) => {
41
+ // Alias the components/layouts source directories so
42
+ // consumer builds can import from
43
+ // @grove-dev/astro/components/ItemCard.astro
44
+ // without us shipping a glob-shaped `exports` map that
45
+ // Vite/Rollup does not expand reliably.
46
+ updateConfig({
47
+ vite: {
48
+ resolve: {
49
+ alias: {
50
+ "@grove-dev/astro/components": componentsDir,
51
+ "@grove-dev/astro/layouts": layoutsDir,
52
+ },
53
+ },
54
+ },
55
+ });
56
+ },
57
+ },
58
+ };
59
+ }
26
60
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAE,OAAO,IAAI,QAAQ,EAAE,MAAM,6BAA6B,CAAC;AAClE,OAAO,EAAE,OAAO,IAAI,YAAY,EAAE,MAAM,iCAAiC,CAAC;AAC1E,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,gCAAgC,CAAC;AACxE,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,8BAA8B,CAAC;AACpE,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,OAAO,IAAI,gBAAgB,EAAE,MAAM,qCAAqC,CAAC;AAClF,OAAO,EAAE,OAAO,IAAI,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AACpF,OAAO,EAAE,O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AClC,+CAA+C;gBAC/C,uDAAuD;gBACvD,wCAAwC;gBACxC,YAAY,CAAC;oBACX,IAAI,EAAE;wBACJ,OAAO,EAAE;4BACP,KAAK,EAAE;gCACL,6BAA6B,EAAE,aAAa;gCAC5C,0BAA0B,EAAE,UAAU;6BACvC;yBACF;qBACF;iBACF,CAAC,CAAC;YACL,CAAC;SACF;KACF,CAAC;AACJ,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @grove-dev/astro — generic layout components.
3
+ *
4
+ * These layouts are the public, framework-agnostic shell used by
5
+ * every consumer page. They:
6
+ *
7
+ * - take a `site` prop (name, tagline, nav, repoUrl) instead of
8
+ * importing a `siteConfig` from a project-local path;
9
+ * - compose the standard Header / Footer / Seo / Container /
10
+ * SectionHeader / ThemeToggle components;
11
+ * - share the `grove-theme` localStorage key for theme state.
12
+ *
13
+ * Re-exported as ESM module names. Astro resolves the
14
+ * `@grove-dev/astro/layouts/*` subpath import from `src/layouts/`
15
+ * (the package's `dist/` only contains TypeScript helpers, not the
16
+ * `.astro` files themselves).
17
+ */
18
+ export { default as BaseLayout } from "./BaseLayout.astro";
19
+ export { default as Container } from "./Container.astro";
20
+ export { default as Footer } from "./Footer.astro";
21
+ export { default as Header } from "./Header.astro";
22
+ export { default as SectionHeader } from "./SectionHeader.astro";
23
+ export { default as Seo } from "./Seo.astro";
24
+ export { default as ThemeToggle } from "./ThemeToggle.astro";
25
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/layouts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,25 @@
1
+ /**
2
+ * @grove-dev/astro — generic layout components.
3
+ *
4
+ * These layouts are the public, framework-agnostic shell used by
5
+ * every consumer page. They:
6
+ *
7
+ * - take a `site` prop (name, tagline, nav, repoUrl) instead of
8
+ * importing a `siteConfig` from a project-local path;
9
+ * - compose the standard Header / Footer / Seo / Container /
10
+ * SectionHeader / ThemeToggle components;
11
+ * - share the `grove-theme` localStorage key for theme state.
12
+ *
13
+ * Re-exported as ESM module names. Astro resolves the
14
+ * `@grove-dev/astro/layouts/*` subpath import from `src/layouts/`
15
+ * (the package's `dist/` only contains TypeScript helpers, not the
16
+ * `.astro` files themselves).
17
+ */
18
+ export { default as BaseLayout } from "./BaseLayout.astro";
19
+ export { default as Container } from "./Container.astro";
20
+ export { default as Footer } from "./Footer.astro";
21
+ export { default as Header } from "./Header.astro";
22
+ export { default as SectionHeader } from "./SectionHeader.astro";
23
+ export { default as Seo } from "./Seo.astro";
24
+ export { default as ThemeToggle } from "./ThemeToggle.astro";
25
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/layouts/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;GAgBG;AACH,OAAO,EAAE,OAAO,IAAI,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAC3D,OAAO,EAAE,OAAO,IAAI,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAE,OAAO,IAAI,aAAa,EAAE,MAAM,uBAAuB,CAAC;AACjE,OAAO,EAAE,OAAO,IAAI,GAAG,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,OAAO,IAAI,WAAW,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,33 @@
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.
6
+ *
7
+ * Every export is dependency-free so it can be imported by both
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
+ */
14
+ import type { AppLabel, HealthStatus } from "@grove-dev/core";
15
+ export type LabelId = AppLabel;
16
+ 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
+ /** Returns a human-readable name for a label id, or null if unknown. */
20
+ export declare function labelDisplay(id: string | null | undefined): string | null;
21
+ /**
22
+ * Canonical status display map. Includes the curated
23
+ * "needs-maintainer" composite that's emitted by the
24
+ * `needs-maintainer` lens.
25
+ */
26
+ export declare const STATUS_DISPLAY: Record<string, string>;
27
+ export declare function statusDisplay(s: HealthStatus | string | null | undefined): string;
28
+ export declare const LENS_DISPLAY: Record<string, string>;
29
+ export declare function lensDisplay(id: string | null | undefined): string;
30
+ export declare const SORT_DISPLAY: Record<string, string>;
31
+ export declare function sortDisplay(id: string | null | undefined): string;
32
+ export declare const STATUS_OPTIONS: string[];
33
+ //# sourceMappingURL=display.d.ts.map
@@ -0,0 +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,MAAM,CASlE;AAED,wEAAwE;AACxE,wBAAgB,YAAY,CAAC,EAAE,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,GAAG,MAAM,GAAG,IAAI,CAMzE;AAGD;;;;GAIG;AACH,eAAO,MAAM,cAAc,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAYjD,CAAC;AAEF,wBAAgB,aAAa,CAC3B,CAAC,EAAE,YAAY,GAAG,MAAM,GAAG,IAAI,GAAG,SAAS,GAC1C,MAAM,CAGR;AAGD,eAAO,MAAM,YAAY,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAO/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;AAMD,eAAO,MAAM,cAAc,EAAE,MAAM,EAOlC,CAAC"}
@@ -0,0 +1,104 @@
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.
6
+ *
7
+ * Every export is dependency-free so it can be imported by both
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
+ */
14
+ export const LABEL_DISPLAY = {
15
+ new: "Recently added",
16
+ hot: "Trending",
17
+ mature: "Established",
18
+ featured: "Featured",
19
+ };
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
+ /** Returns a human-readable name for a label id, or null if unknown. */
33
+ export function labelDisplay(id) {
34
+ if (!id)
35
+ return null;
36
+ if (id in LABEL_DISPLAY) {
37
+ return LABEL_DISPLAY[id];
38
+ }
39
+ return prettySlug(id);
40
+ }
41
+ // ── Status ids (the `health.status` field on a record) ───────────
42
+ /**
43
+ * Canonical status display map. Includes the curated
44
+ * "needs-maintainer" composite that's emitted by the
45
+ * `needs-maintainer` lens.
46
+ */
47
+ export const STATUS_DISPLAY = {
48
+ active: "Active",
49
+ mature: "Mature",
50
+ stale: "Not recently active",
51
+ inactive: "Inactive",
52
+ archived: "Archived",
53
+ unknown: "Unknown",
54
+ historical: "Historical",
55
+ needs_review: "Needs review",
56
+ quiet: "Quiet",
57
+ unavailable: "Unavailable",
58
+ "needs-maintainer": "Needs maintainer",
59
+ };
60
+ export function statusDisplay(s) {
61
+ if (!s)
62
+ return STATUS_DISPLAY.unknown;
63
+ return STATUS_DISPLAY[s] ?? prettySlug(s);
64
+ }
65
+ // ── Lens ids (the curated tabs on /projects) ─────────────────────
66
+ export const LENS_DISPLAY = {
67
+ all: "All",
68
+ hot: "Trending",
69
+ new: "Recently added",
70
+ mature: "Established",
71
+ featured: "Featured",
72
+ "needs-review": "Needs review",
73
+ };
74
+ export function lensDisplay(id) {
75
+ if (!id)
76
+ return LENS_DISPLAY.all;
77
+ return LENS_DISPLAY[id] ?? prettySlug(id);
78
+ }
79
+ // ── Sort ids (the /projects sort dropdown) ───────────────────────
80
+ export const SORT_DISPLAY = {
81
+ "recently-updated": "Recently updated",
82
+ "most-starred": "Most starred",
83
+ "recently-added": "Recently added",
84
+ "best-overall": "Best overall",
85
+ alphabetical: "Alphabetical",
86
+ };
87
+ export function sortDisplay(id) {
88
+ if (!id)
89
+ return SORT_DISPLAY["recently-updated"];
90
+ return SORT_DISPLAY[id] ?? prettySlug(id);
91
+ }
92
+ // ── Status option list (used by filter dropdowns) ───────────────
93
+ // "needs-maintainer" is included even though it's a derived/composite
94
+ // status — filter dropdowns and chip rendering need to offer it
95
+ // alongside the raw HealthStatus values.
96
+ export const STATUS_OPTIONS = [
97
+ "active",
98
+ "quiet",
99
+ "stale",
100
+ "needs-maintainer",
101
+ "archived",
102
+ "unknown",
103
+ ];
104
+ //# sourceMappingURL=display.js.map
@@ -0,0 +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;IACrB,GAAG,EAAE,UAAU;IACf,MAAM,EAAE,aAAa;IACrB,QAAQ,EAAE,UAAU;CACrB,CAAC;AAEF,mEAAmE;AACnE,MAAM,UAAU,UAAU,CAAC,IAA+B;IACxD,IAAI,CAAC,IAAI;QAAE,OAAO,EAAE,CAAC;IACrB,OAAO,IAAI;SACR,OAAO,CAAC,QAAQ,EAAE,GAAG,CAAC;SACtB,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC;SACpB,IAAI,EAAE;SACN,KAAK,CAAC,GAAG,CAAC;SACV,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAE,CAAC,WAAW,EAAE,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAA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AC,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,oEAAoE;AACpE,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,UAAU,CAAC,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,mEAAmE;AACnE,sEAAsE;AACtE,gEAAgE;AAChE,yCAAyC;AACzC,MAAM,CAAC,MAAM,cAAc,GAAa;IACtC,QAAQ;IACR,OAAO;IACP,OAAO;IACP,kBAAkB;IAClB,UAAU;IACV,SAAS;CACV,CAAC"}
@@ -0,0 +1,30 @@
1
+ /**
2
+ * Shared formatting helpers.
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.
7
+ */
8
+ /**
9
+ * Format a number compactly: 1234 → "1.2k", 12345 → "12k", 79 → "79".
10
+ * Used for hero/header star counts and other large-num displays.
11
+ */
12
+ export declare function compact(n: number): string;
13
+ /**
14
+ * Format a star count compactly. Returns `null` when input is not a
15
+ * finite number, so callers can render "—" without an extra guard.
16
+ */
17
+ export declare function formatStars(n: number | null | undefined): string | null;
18
+ /**
19
+ * Format an ISO date as a human "Xd ago" / "Xmo ago" / "Xy ago" string.
20
+ * Returns "—" for missing or invalid input, and "today" for future
21
+ * dates (which can happen with bad upstream timestamps).
22
+ */
23
+ export declare function formatRelative(date: string | null | undefined): string;
24
+ /**
25
+ * Format an ISO date as a localized short date (e.g. "Jan 5, 2026").
26
+ * Returns the original string for unparseable input, or "—" when
27
+ * no value is provided.
28
+ */
29
+ export declare function formatDate(date: string | null | undefined): string;
30
+ //# sourceMappingURL=format.d.ts.map
@@ -0,0 +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"}
@@ -0,0 +1,73 @@
1
+ /**
2
+ * Shared formatting helpers.
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.
7
+ */
8
+ /**
9
+ * Format a number compactly: 1234 → "1.2k", 12345 → "12k", 79 → "79".
10
+ * Used for hero/header star counts and other large-num displays.
11
+ */
12
+ export function compact(n) {
13
+ if (n >= 1000) {
14
+ const k = n / 1000;
15
+ return (k >= 10 ? Math.round(k).toString() : k.toFixed(1)) + "k";
16
+ }
17
+ return n.toString();
18
+ }
19
+ /**
20
+ * Format a star count compactly. Returns `null` when input is not a
21
+ * finite number, so callers can render "—" without an extra guard.
22
+ */
23
+ export function formatStars(n) {
24
+ if (typeof n !== "number" || !Number.isFinite(n))
25
+ return null;
26
+ return compact(n);
27
+ }
28
+ /**
29
+ * Format an ISO date as a human "Xd ago" / "Xmo ago" / "Xy ago" string.
30
+ * Returns "—" for missing or invalid input, and "today" for future
31
+ * dates (which can happen with bad upstream timestamps).
32
+ */
33
+ export function formatRelative(date) {
34
+ if (!date)
35
+ return "—";
36
+ const d = new Date(date);
37
+ if (Number.isNaN(d.valueOf()))
38
+ return "—";
39
+ const days = Math.floor((Date.now() - d.valueOf()) / (1000 * 60 * 60 * 24));
40
+ if (days <= 0)
41
+ return "today";
42
+ if (days === 1)
43
+ return "1d ago";
44
+ if (days < 30)
45
+ return `${days}d ago`;
46
+ const months = Math.floor(days / 30);
47
+ if (months === 1)
48
+ return "1mo ago";
49
+ if (months < 12)
50
+ return `${months}mo ago`;
51
+ const years = Math.floor(months / 12);
52
+ if (years === 1)
53
+ return "1y ago";
54
+ return `${years}y ago`;
55
+ }
56
+ /**
57
+ * Format an ISO date as a localized short date (e.g. "Jan 5, 2026").
58
+ * Returns the original string for unparseable input, or "—" when
59
+ * no value is provided.
60
+ */
61
+ export function formatDate(date) {
62
+ if (!date)
63
+ return "—";
64
+ const d = new Date(date);
65
+ if (Number.isNaN(d.valueOf()))
66
+ return date;
67
+ return d.toLocaleDateString("en-US", {
68
+ year: "numeric",
69
+ month: "short",
70
+ day: "numeric",
71
+ });
72
+ }
73
+ //# sourceMappingURL=format.js.map
@@ -0,0 +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,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,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,IAAI,CAAC;IAC3C,OAAO,CAAC,CAAC,kBAAkB,CAAC,OAAO,EAAE;QACnC,IAAI,EAAE,SAAS;QACf,KAAK,EAAE,OAAO;QACd,GAAG,EAAE,SAAS;KACf,CAAC,CAAC;AACL,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @grove-dev/astro — framework-agnostic lib helpers.
3
+ *
4
+ * Re-exports every helper that the showcase component library
5
+ * (and any future consumer) can use to:
6
+ *
7
+ * - parse GitHub repo URLs (`lib/repo`)
8
+ * - format counts, dates, stars (`lib/format`)
9
+ * - apply curated lenses / facets / search filters (`lib/lenses`,
10
+ * `lib/search`)
11
+ * - render score bars (`lib/scores`)
12
+ * - compute taxonomy counts at build time (`lib/taxonomy-counts`)
13
+ * - pretty-print slugs and label/lens/sort/status ids (`lib/display`)
14
+ *
15
+ * All helpers are pure, dependency-free, and typed against
16
+ * `@grove-dev/core` (specifically `ProjectRecord` for the index
17
+ * payload and the `Score` / `HealthStatus` unions).
18
+ */
19
+ export * from "./repo.js";
20
+ export * from "./format.js";
21
+ export * from "./lenses.js";
22
+ export * from "./search.js";
23
+ export * from "./scores.js";
24
+ export * from "./taxonomy-counts.js";
25
+ export * from "./display.js";
26
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC"}
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @grove-dev/astro — framework-agnostic lib helpers.
3
+ *
4
+ * Re-exports every helper that the showcase component library
5
+ * (and any future consumer) can use to:
6
+ *
7
+ * - parse GitHub repo URLs (`lib/repo`)
8
+ * - format counts, dates, stars (`lib/format`)
9
+ * - apply curated lenses / facets / search filters (`lib/lenses`,
10
+ * `lib/search`)
11
+ * - render score bars (`lib/scores`)
12
+ * - compute taxonomy counts at build time (`lib/taxonomy-counts`)
13
+ * - pretty-print slugs and label/lens/sort/status ids (`lib/display`)
14
+ *
15
+ * All helpers are pure, dependency-free, and typed against
16
+ * `@grove-dev/core` (specifically `ProjectRecord` for the index
17
+ * payload and the `Score` / `HealthStatus` unions).
18
+ */
19
+ export * from "./repo.js";
20
+ export * from "./format.js";
21
+ export * from "./lenses.js";
22
+ export * from "./search.js";
23
+ export * from "./scores.js";
24
+ export * from "./taxonomy-counts.js";
25
+ export * from "./display.js";
26
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/lib/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AAEH,cAAc,WAAW,CAAC;AAC1B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,aAAa,CAAC;AAC5B,cAAc,sBAAsB,CAAC;AACrC,cAAc,cAAc,CAAC"}
@@ -0,0 +1,96 @@
1
+ /**
2
+ * Curated lenses for the list / discovery page.
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:
7
+ *
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.)
14
+ *
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.
19
+ */
20
+ import type { HealthStatus, ProjectRecord } from "@grove-dev/core";
21
+ export type LensId = "all" | "hot" | "new" | "mature" | "featured" | "needs-review";
22
+ export interface LensDef {
23
+ id: LensId;
24
+ 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
+ };
53
+ }
54
+ export declare const LENSES: LensDef[];
55
+ /**
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.
60
+ */
61
+ export declare const PRIMARY_LENSES: LensId[];
62
+ export declare function lensById(id: string | null | undefined): LensDef | undefined;
63
+ export declare function isPrimaryLens(id: string | null | undefined): id is LensId;
64
+ /**
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.
68
+ */
69
+ export declare function lensFromSearchParams(params: URLSearchParams): LensId | "";
70
+ /**
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.
74
+ */
75
+ export declare function isLensActive(lensId: LensId, params: URLSearchParams): boolean;
76
+ /**
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 `/`.
85
+ */
86
+ export declare function hrefForLens(lensId: LensId, params: URLSearchParams, pathPrefix?: string): string;
87
+ /**
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.
93
+ */
94
+ export declare function applyLens<T extends AppLike>(records: T[], lensId: LensId | ""): T[];
95
+ export type { ProjectRecord };
96
+ //# sourceMappingURL=lenses.d.ts.map
@@ -0,0 +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,CAA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