@grove-dev/astro 0.1.5 → 0.2.5
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/LICENSE +21 -0
- package/dist/index.d.ts +4 -25
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +56 -22
- package/dist/index.js.map +1 -1
- package/dist/layouts/index.d.ts +25 -0
- package/dist/layouts/index.d.ts.map +1 -0
- package/dist/layouts/index.js +25 -0
- package/dist/layouts/index.js.map +1 -0
- package/dist/lib/display.d.ts +33 -0
- package/dist/lib/display.d.ts.map +1 -0
- package/dist/lib/display.js +104 -0
- package/dist/lib/display.js.map +1 -0
- package/dist/lib/format.d.ts +30 -0
- package/dist/lib/format.d.ts.map +1 -0
- package/dist/lib/format.js +73 -0
- package/dist/lib/format.js.map +1 -0
- package/dist/lib/index.d.ts +26 -0
- package/dist/lib/index.d.ts.map +1 -0
- package/dist/lib/index.js +26 -0
- package/dist/lib/index.js.map +1 -0
- package/dist/lib/lenses.d.ts +96 -0
- package/dist/lib/lenses.d.ts.map +1 -0
- package/dist/lib/lenses.js +181 -0
- package/dist/lib/lenses.js.map +1 -0
- package/dist/lib/repo.d.ts +30 -0
- package/dist/lib/repo.d.ts.map +1 -0
- package/dist/lib/repo.js +44 -0
- package/dist/lib/repo.js.map +1 -0
- package/dist/lib/scores.d.ts +38 -0
- package/dist/lib/scores.d.ts.map +1 -0
- package/dist/lib/scores.js +83 -0
- package/dist/lib/scores.js.map +1 -0
- package/dist/lib/search.d.ts +199 -0
- package/dist/lib/search.d.ts.map +1 -0
- package/dist/lib/search.js +357 -0
- package/dist/lib/search.js.map +1 -0
- package/dist/lib/taxonomy-counts.d.ts +25 -0
- package/dist/lib/taxonomy-counts.d.ts.map +1 -0
- package/dist/lib/taxonomy-counts.js +41 -0
- package/dist/lib/taxonomy-counts.js.map +1 -0
- package/package.json +7 -7
- package/src/components/AppsIndexRow.astro +204 -0
- package/src/components/AppsPagination.astro +126 -0
- package/src/components/CategoryGrid.astro +86 -17
- package/src/components/ContributorsGrid.astro +149 -0
- package/src/components/DecisionRow.astro +89 -0
- package/src/components/ExploreByCategory.astro +67 -0
- package/src/components/ExploreByStack.astro +72 -0
- package/src/components/Hero.astro +246 -0
- package/src/components/Icon.astro +223 -0
- package/src/components/ItemCard.astro +306 -30
- package/src/components/MinimalAbout.astro +82 -0
- package/src/components/OriginalCollection.astro +116 -0
- package/src/components/RecordSection.astro +88 -0
- package/src/components/RefinePanel.astro +197 -0
- package/src/components/ScoreBars.astro +92 -22
- package/src/components/SmartLensTabs.astro +71 -0
- package/src/components/StackGrid.astro +132 -0
- package/src/components/WhyThisExists.astro +116 -0
- package/src/index.ts +61 -14
- package/src/layouts/BaseLayout.astro +227 -15
- package/src/layouts/Container.astro +57 -0
- package/src/layouts/Footer.astro +235 -0
- package/src/layouts/Header.astro +159 -0
- package/src/layouts/SectionHeader.astro +58 -0
- package/{templates/default/src/components/layout → src/layouts}/Seo.astro +62 -38
- package/src/layouts/ThemeToggle.astro +110 -0
- package/src/layouts/astro-shim.d.ts +29 -0
- package/src/layouts/index.ts +24 -0
- package/src/lib/display.ts +118 -0
- package/src/lib/format.ts +65 -0
- package/src/lib/index.ts +26 -0
- package/src/lib/lenses.ts +241 -0
- package/src/lib/repo.ts +44 -0
- package/src/lib/scores.ts +94 -0
- package/src/lib/search.ts +481 -0
- package/src/lib/taxonomy-counts.ts +60 -0
- package/src/styles.css +366 -638
- package/templates/default/astro.config.mjs +8 -6
- package/templates/default/content/pages/about.md +66 -0
- package/templates/default/content/pages/methodology.md +103 -0
- package/templates/default/data/generated/records.full.json +8 -0
- package/templates/default/data/generated/records.index.json +7 -0
- package/templates/default/data/generated/records.json +8 -0
- package/templates/default/data/generated/site-config.json +31 -0
- package/templates/default/data/records/.gitkeep +0 -0
- package/templates/default/grove.config.ts +36 -0
- package/templates/default/package.json +6 -5
- package/templates/default/public/llms-full.txt +14 -0
- package/templates/default/public/llms.txt +11 -0
- package/templates/default/src/components/layout/BaseLayout.astro +10 -57
- package/templates/default/src/components/layout/Footer.astro +16 -134
- package/templates/default/src/components/layout/Header.astro +25 -126
- package/templates/default/src/data/records.ts +193 -0
- package/templates/default/src/lib/markdown.ts +171 -0
- package/templates/default/src/pages/about.astro +95 -429
- package/templates/default/src/pages/index.astro +263 -61
- package/templates/default/src/pages/projects/[slug].astro +480 -0
- package/templates/default/src/pages/projects/index.astro +193 -0
- package/templates/default/src/pages/sitemap.xml.ts +73 -61
- package/templates/default/src/pages/submit.astro +122 -411
- package/templates/default/src/styles/global.css +42 -68
- package/src/components/ActiveFilterChips.astro +0 -20
- package/src/components/DirectoryFilters.astro +0 -100
- package/src/components/DirectoryHero.astro +0 -32
- package/src/components/HealthBadge.astro +0 -12
- package/src/components/LensTabs.astro +0 -26
- package/src/components/MethodologyPanel.astro +0 -20
- package/src/components/Pagination.astro +0 -24
- package/src/components/ProjectDetail.astro +0 -166
- package/src/components/SubmitDraft.astro +0 -137
- package/templates/default/src/components/AppCard.astro +0 -248
- package/templates/default/src/components/AppSection.astro +0 -58
- package/templates/default/src/components/AppsIndexRow.astro +0 -230
- package/templates/default/src/components/AppsPagination.astro +0 -147
- package/templates/default/src/components/CategoryGrid.astro +0 -80
- package/templates/default/src/components/ContributorsGrid.astro +0 -105
- package/templates/default/src/components/DecisionRow.astro +0 -219
- package/templates/default/src/components/ExploreByCategory.astro +0 -74
- package/templates/default/src/components/ExploreByStack.astro +0 -102
- package/templates/default/src/components/Hero.astro +0 -176
- package/templates/default/src/components/MinimalAbout.astro +0 -57
- package/templates/default/src/components/OriginalCollection.astro +0 -144
- package/templates/default/src/components/RefinePanel.astro +0 -272
- package/templates/default/src/components/ScoreBars.astro +0 -72
- package/templates/default/src/components/SmartLensTabs.astro +0 -65
- package/templates/default/src/components/StackGrid.astro +0 -95
- package/templates/default/src/components/WhyThisExists.astro +0 -81
- package/templates/default/src/components/icons/Icon.astro +0 -148
- package/templates/default/src/components/layout/SectionHeader.astro +0 -42
- package/templates/default/src/components/layout/ThemeToggle.astro +0 -97
- package/templates/default/src/data/apps.ts +0 -149
- package/templates/default/src/data/categories.ts +0 -27
- package/templates/default/src/data/config.ts +0 -28
- package/templates/default/src/data/contributors.ts +0 -96
- package/templates/default/src/data/stacks.ts +0 -47
- package/templates/default/src/data/stats.ts +0 -65
- package/templates/default/src/data/types.ts +0 -248
- package/templates/default/src/lib/apps-search.ts +0 -228
- package/templates/default/src/lib/format.ts +0 -36
- package/templates/default/src/lib/lenses.ts +0 -98
- package/templates/default/src/lib/repo.ts +0 -12
- package/templates/default/src/lib/scores.ts +0 -51
- package/templates/default/src/lib/taxonomy-counts.ts +0 -31
- package/templates/default/src/pages/apps/[slug].astro +0 -709
- package/templates/default/src/pages/apps/index.astro +0 -669
- package/templates/default/src/pages/contributors.astro +0 -142
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Turtuvshin Byambaa
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/dist/index.d.ts
CHANGED
|
@@ -1,26 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
* @grove-dev/
|
|
3
|
-
*
|
|
4
|
-
|
|
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
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
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
|
|
2
|
+
* @grove-dev/astro — Astro framework adapter for Grove.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
* Astro
|
|
6
|
-
*
|
|
7
|
-
*
|
|
8
|
-
*
|
|
9
|
-
*
|
|
10
|
-
*
|
|
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
|
-
|
|
13
|
-
|
|
14
|
-
export
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
export
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AACH,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAG7C,cAAc,iBAAiB,CAAC;AAEhC,+DAA+D;AAC/D,mEAAmE;AACnE,iEAAiE;AACjE,mCAAmC;AACnC,cAAc,gBAAgB,CAAC;AAE/B,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AACrD,+DAA+D;AAC/D,0DAA0D;AAC1D,8DAA8D;AAC9D,sCAAsC;AACtC,MAAM,OAAO,GAAG,OAAO,CAAC,IAAI,EAAE,IAAI,EAAE,KAAK,CAAC,CAAC;AAC3C,MAAM,aAAa,GAAG,OAAO,CAAC,OAAO,EAAE,YAAY,CAAC,CAAC;AACrD,MAAM,UAAU,GAAG,OAAO,CAAC,OAAO,EAAE,SAAS,CAAC,CAAC;AAE/C,MAAM,CAAC,OAAO,UAAU,UAAU;IAChC,OAAO;QACL,IAAI,EAAE,kBAAkB;QACxB,KAAK,EAAE;YACL,oBAAoB,EAAE,CAAC,EAAE,YAAY,EAAE,EAAE,EAAE;gBACzC,qDAAqD;gBACrD,kCAAkC;gBAClC,+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,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC;SACvD,IAAI,CAAC,GAAG,CAAC,CAAC;AACf,CAAC;AAED,wEAAwE;AACxE,MAAM,UAAU,YAAY,CAAC,EAA6B;IACxD,IAAI,CAAC,EAAE;QAAE,OAAO,IAAI,CAAC;IACrB,IAAI,EAAE,IAAI,aAAa,EAAE,CAAC;QACxB,OAAO,aAAa,CAAC,EAAa,CAAC,CAAC;IACtC,CAAC;IACD,OAAO,UAAU,CAAC,EAAE,CAAC,CAAC;AACxB,CAAC;AAED,oEAAoE;AACpE;;;;GAIG;AACH,MAAM,CAAC,MAAM,cAAc,GAA2B;IACpD,MAAM,EAAE,QAAQ;IAChB,MAAM,EAAE,QAAQ;IAChB,KAAK,EAAE,qBAAqB;IAC5B,QAAQ,EAAE,UAAU;IACpB,QAAQ,EAAE,UAAU;IACpB,OAAO,EAAE,SAAS;IAClB,UAAU,EAAE,YAAY;IACxB,YAAY,EAAE,cAAc;IAC5B,KAAK,EAAE,OAAO;IACd,WAAW,EAAE,aAAa;IAC1B,kBAAkB,EAAE,kBAAkB;CACvC,CAAC;AAEF,MAAM,UAAU,aAAa,CAC3B,CAA2C;IAE3C,IAAI,CAAC,CAAC;QAAE,OAAO,cAAc,CAAC,OAAO,CAAC;IACtC,OAAO,cAAc,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,CAAC,CAAC,CAAC;AAC5C,CAAC;AAED,oEAAoE;AACpE,MAAM,CAAC,MAAM,YAAY,GAA2B;IAClD,GAAG,EAAE,KAAK;IACV,GAAG,EAAE,UAAU;IACf,GAAG,EAAE,gBAAgB;IACrB,MAAM,EAAE,aAAa;IACrB,QAAQ,EAAE,UAAU;IACpB,cAAc,EAAE,cAAc;CAC/B,CAAC;AAEF,MAAM,UAAU,WAAW,CAAC,EAA6B;IACvD,IAAI,CAAC,EAAE;QAAE,OAAO,YAAY,CAAC,GAAG,CAAC;IACjC,OAAO,YAAY,CAAC,EAAE,CAAC,IAAI,UAAU,CAAC,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,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,CAAC,KAAK,CAAC,CAAC,IAAI,CAAC,GAAG,EAAE,GAAG,CAAC,CAAC,OAAO,EAAE,CAAC,GAAG,CAAC,IAAI,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,CAAC,CAAC,CAAC;IAC5E,IAAI,IAAI,IAAI,CAAC;QAAE,OAAO,OAAO,CAAC;IAC9B,IAAI,IAAI,KAAK,CAAC;QAAE,OAAO,QAAQ,CAAC;IAChC,IAAI,IAAI,GAAG,EAAE;QAAE,OAAO,GAAG,IAAI,OAAO,CAAC;IACrC,MAAM,MAAM,GAAG,IAAI,CAAC,KAAK,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,IAA+B;IACxD,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,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
|