@grove-dev/astro 0.3.1 → 0.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -75
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/dist/lib/display.d.ts +1 -26
- package/dist/lib/display.d.ts.map +1 -1
- package/dist/lib/display.js +1 -103
- package/dist/lib/display.js.map +1 -1
- package/dist/lib/format.d.ts +1 -28
- package/dist/lib/format.d.ts.map +1 -1
- package/dist/lib/format.js +1 -71
- package/dist/lib/format.js.map +1 -1
- package/dist/lib/lenses.d.ts +1 -57
- package/dist/lib/lenses.d.ts.map +1 -1
- package/dist/lib/lenses.js +1 -198
- package/dist/lib/lenses.js.map +1 -1
- package/dist/lib/repo.d.ts +1 -19
- package/dist/lib/repo.d.ts.map +1 -1
- package/dist/lib/repo.js +1 -30
- package/dist/lib/repo.js.map +1 -1
- package/dist/lib/scores.d.ts +1 -36
- package/dist/lib/scores.d.ts.map +1 -1
- package/dist/lib/scores.js +1 -75
- package/dist/lib/scores.js.map +1 -1
- package/dist/lib/search.d.ts +1 -113
- package/dist/lib/search.d.ts.map +1 -1
- package/dist/lib/search.js +1 -379
- package/dist/lib/search.js.map +1 -1
- package/dist/lib/taxonomy-counts.d.ts +1 -10
- package/dist/lib/taxonomy-counts.d.ts.map +1 -1
- package/dist/lib/taxonomy-counts.js +1 -21
- package/dist/lib/taxonomy-counts.js.map +1 -1
- package/package.json +23 -11
- package/src/components/ContributorsGrid.astro +3 -3
- package/src/components/CurationGrid.astro +2 -2
- package/src/components/DirectoryIndexClient.astro +240 -0
- package/src/components/FilterGroupMenu.astro +8 -4
- package/src/components/FinalCta.astro +41 -0
- package/src/components/Hero.astro +15 -18
- package/src/components/Icon.astro +35 -7
- package/src/components/IndexRow.astro +2 -2
- package/src/components/ItemCard.astro +2 -7
- package/src/components/RefinePanel.astro +7 -7
- package/src/components/SmartLensTabs.astro +9 -5
- package/src/components/StackGrid.astro +1 -1
- package/src/components/SubmissionClient.astro +133 -0
- package/src/index.ts +11 -1
- package/src/layouts/BaseLayout.astro +30 -8
- package/src/layouts/Footer.astro +25 -56
- package/src/layouts/Header.astro +33 -15
- package/src/layouts/ThemeToggle.astro +7 -3
- package/src/lib/display.ts +1 -111
- package/src/lib/format.ts +1 -64
- package/src/lib/lenses.ts +1 -220
- package/src/lib/repo.ts +1 -32
- package/src/lib/scores.ts +1 -90
- package/src/lib/search.ts +1 -418
- package/src/lib/taxonomy-counts.ts +1 -26
- package/{templates/default/src/data/records.ts → src/server/directory.ts} +12 -8
- package/src/server/index.ts +2 -0
- package/src/server/models.ts +436 -0
- package/dist/template-routes.test.d.ts +0 -2
- package/dist/template-routes.test.d.ts.map +0 -1
- package/dist/template-routes.test.js +0 -63
- package/dist/template-routes.test.js.map +0 -1
- package/dist/theme.test.d.ts +0 -2
- package/dist/theme.test.d.ts.map +0 -1
- package/dist/theme.test.js +0 -60
- package/dist/theme.test.js.map +0 -1
- package/src/template-routes.test.ts +0 -103
- package/src/theme.test.ts +0 -76
- package/templates/default/.github/ISSUE_TEMPLATE/bug_report.md +0 -33
- package/templates/default/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/templates/default/.github/ISSUE_TEMPLATE/record_submission.md +0 -48
- package/templates/default/.github/pull_request_template.md +0 -27
- package/templates/default/.github/workflows/build.yml +0 -53
- package/templates/default/.github/workflows/cleanup-stale-records.yml +0 -46
- package/templates/default/.github/workflows/daily-refresh.yml +0 -51
- package/templates/default/.github/workflows/sync-contributors.yml +0 -51
- package/templates/default/.github/workflows/sync-github-metadata.yml +0 -56
- package/templates/default/.github/workflows/validate-data.yml +0 -33
- package/templates/default/astro.config.mjs +0 -25
- package/templates/default/content/pages/about.md +0 -66
- package/templates/default/content/pages/methodology.md +0 -103
- package/templates/default/data/records/.gitkeep +0 -0
- package/templates/default/data/records/coolify.yml +0 -46
- package/templates/default/data/records/gitea.yml +0 -46
- package/templates/default/data/records/hoppscotch.yml +0 -47
- package/templates/default/data/records/inventree.yml +0 -47
- package/templates/default/data/records/label-studio.yml +0 -46
- package/templates/default/data/records/logseq.yml +0 -48
- package/templates/default/data/records/private-gpt.yml +0 -47
- package/templates/default/data/records/wakapi.yml +0 -44
- package/templates/default/data/taxonomy/categories.yml +0 -47
- package/templates/default/data/taxonomy/distribution-channels.yml +0 -43
- package/templates/default/data/taxonomy/platforms.yml +0 -27
- package/templates/default/data/taxonomy/stacks.yml +0 -41
- package/templates/default/grove.config.ts +0 -36
- package/templates/default/package.json +0 -43
- package/templates/default/public/icons/platforms/android.svg +0 -1
- package/templates/default/public/icons/platforms/apple-dark.svg +0 -1
- package/templates/default/public/icons/platforms/apple-light.svg +0 -1
- package/templates/default/public/icons/platforms/chrome.svg +0 -1
- package/templates/default/public/icons/platforms/chromeos.svg +0 -5
- package/templates/default/public/icons/platforms/desktop.svg +0 -4
- package/templates/default/public/icons/platforms/embedded.svg +0 -5
- package/templates/default/public/icons/platforms/ios.svg +0 -1
- package/templates/default/public/icons/platforms/linux.svg +0 -1
- package/templates/default/public/icons/platforms/macos.svg +0 -1
- package/templates/default/public/icons/platforms/ubuntu.svg +0 -1
- package/templates/default/public/icons/platforms/web.svg +0 -5
- package/templates/default/public/icons/platforms/windows.svg +0 -6
- package/templates/default/public/icons/stacks/android.svg +0 -1
- package/templates/default/public/icons/stacks/apple-dark.svg +0 -1
- package/templates/default/public/icons/stacks/apple-light.svg +0 -1
- package/templates/default/public/icons/stacks/bun.svg +0 -1
- package/templates/default/public/icons/stacks/capacitor.svg +0 -14
- package/templates/default/public/icons/stacks/clojure.svg +0 -1
- package/templates/default/public/icons/stacks/clojurescript.svg +0 -1
- package/templates/default/public/icons/stacks/dart.svg +0 -1
- package/templates/default/public/icons/stacks/deno.svg +0 -1
- package/templates/default/public/icons/stacks/django.svg +0 -1
- package/templates/default/public/icons/stacks/docker.svg +0 -1
- package/templates/default/public/icons/stacks/firebase.svg +0 -1
- package/templates/default/public/icons/stacks/flutter.svg +0 -1
- package/templates/default/public/icons/stacks/go.svg +0 -1
- package/templates/default/public/icons/stacks/graphql.svg +0 -1
- package/templates/default/public/icons/stacks/ionic.svg +0 -4
- package/templates/default/public/icons/stacks/java.svg +0 -1
- package/templates/default/public/icons/stacks/javascript.svg +0 -1
- package/templates/default/public/icons/stacks/kotlin.svg +0 -1
- package/templates/default/public/icons/stacks/llm.svg +0 -1
- package/templates/default/public/icons/stacks/mongodb.svg +0 -1
- package/templates/default/public/icons/stacks/node.js.svg +0 -1
- package/templates/default/public/icons/stacks/nodejs.svg +0 -1
- package/templates/default/public/icons/stacks/python.svg +0 -1
- package/templates/default/public/icons/stacks/rag.svg +0 -7
- package/templates/default/public/icons/stacks/react-native.svg +0 -1
- package/templates/default/public/icons/stacks/react.svg +0 -1
- package/templates/default/public/icons/stacks/rust.svg +0 -1
- package/templates/default/public/icons/stacks/solidity.svg +0 -1
- package/templates/default/public/icons/stacks/sveltekit.svg +0 -1
- package/templates/default/public/icons/stacks/swift.svg +0 -1
- package/templates/default/public/icons/stacks/tensorflow.svg +0 -1
- package/templates/default/public/icons/stacks/typescript.svg +0 -1
- package/templates/default/public/icons/stacks/vue.svg +0 -1
- package/templates/default/public/llms-full.txt +0 -83
- package/templates/default/public/llms.txt +0 -11
- package/templates/default/public/og-image.svg +0 -48
- package/templates/default/public/robots.txt +0 -53
- package/templates/default/public/sitemap.xml +0 -63
- package/templates/default/src/pages/404.astro +0 -64
- package/templates/default/src/pages/[slug]/[recordSlug].astro +0 -691
- package/templates/default/src/pages/[slug]/index.astro +0 -482
- package/templates/default/src/pages/about.astro +0 -189
- package/templates/default/src/pages/apps/[recordSlug].astro +0 -34
- package/templates/default/src/pages/contributors.astro +0 -175
- package/templates/default/src/pages/index.astro +0 -233
- package/templates/default/src/pages/sitemap.xml.ts +0 -89
- package/templates/default/src/pages/submit.astro +0 -281
- package/templates/default/src/styles/global.css +0 -33
- package/templates/default/tsconfig.json +0 -9
- package/templates/default/wrangler.jsonc +0 -28
package/dist/lib/lenses.js
CHANGED
|
@@ -1,199 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Curated lenses for the list page.
|
|
3
|
-
*
|
|
4
|
-
* Two flavors:
|
|
5
|
-
* - "label-based": maps to a single `labels` value (e.g. new / hot / mature).
|
|
6
|
-
* No extra curation needed — every item already has a label.
|
|
7
|
-
* - "curator-assigned": maps to a `lenses` value on the item. The 5 anchor
|
|
8
|
-
* items get these populated. Other items will simply not match.
|
|
9
|
-
*
|
|
10
|
-
* The lens id is what shows up in the URL as `?lens=...`. For
|
|
11
|
-
* label-based lenses, the lens id is the same as the label.
|
|
12
|
-
*
|
|
13
|
-
* The 6 lenses in `PRIMARY_LENSES` are rendered as top-row tabs. The rest
|
|
14
|
-
* remain in the union type for URL deep-linking and future use, but are
|
|
15
|
-
* not shown in the UI by default.
|
|
16
|
-
*/
|
|
17
|
-
export const LENSES = [
|
|
18
|
-
{ id: "all", label: "All items", description: "Every item in the directory", toParams: () => ({}) },
|
|
19
|
-
{
|
|
20
|
-
id: "new",
|
|
21
|
-
label: "Recently added",
|
|
22
|
-
description: "Apps recently added to the directory",
|
|
23
|
-
toParams: () => ({ label: "new" }),
|
|
24
|
-
},
|
|
25
|
-
{
|
|
26
|
-
id: "hot",
|
|
27
|
-
label: "Trending",
|
|
28
|
-
description: "Apps with recent activity and attention",
|
|
29
|
-
toParams: () => ({ label: "hot" }),
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
id: "mature",
|
|
33
|
-
label: "Established",
|
|
34
|
-
description: "Long-running projects with stable history",
|
|
35
|
-
toParams: () => ({ label: "mature" }),
|
|
36
|
-
},
|
|
37
|
-
{
|
|
38
|
-
id: "production-like",
|
|
39
|
-
label: "Production-like",
|
|
40
|
-
description: "Real items, not toy projects",
|
|
41
|
-
toParams: () => ({ lens: "production-like" }),
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
id: "good-to-learn",
|
|
45
|
-
label: "Good to learn",
|
|
46
|
-
description: "Readable codebases with useful patterns",
|
|
47
|
-
toParams: () => ({ lens: "good-to-learn" }),
|
|
48
|
-
},
|
|
49
|
-
// Secondary (URL-only, not rendered as tabs)
|
|
50
|
-
{
|
|
51
|
-
id: "beginner-friendly",
|
|
52
|
-
label: "Beginner friendly",
|
|
53
|
-
description: "Smaller, readable, easier to understand",
|
|
54
|
-
toParams: () => ({ lens: "beginner-friendly" }),
|
|
55
|
-
},
|
|
56
|
-
{
|
|
57
|
-
id: "contribution-ready",
|
|
58
|
-
label: "Contribution ready",
|
|
59
|
-
description: "Clear issues, active maintainers, license, contribution docs",
|
|
60
|
-
toParams: () => ({ lens: "contribution-ready" }),
|
|
61
|
-
},
|
|
62
|
-
{
|
|
63
|
-
id: "launches",
|
|
64
|
-
label: "Launches",
|
|
65
|
-
description: "Recently launched OSS items seeking feedback",
|
|
66
|
-
toParams: () => ({ lens: "launches" }),
|
|
67
|
-
},
|
|
68
|
-
{
|
|
69
|
-
id: "actively-developed",
|
|
70
|
-
label: "Active",
|
|
71
|
-
description: "Apps with recent commits, releases, and issue activity",
|
|
72
|
-
toParams: () => ({ status: "active" }),
|
|
73
|
-
},
|
|
74
|
-
{
|
|
75
|
-
id: "needs-maintainer",
|
|
76
|
-
label: "Needs maintainer",
|
|
77
|
-
description: "Useful items that need help",
|
|
78
|
-
toParams: () => ({ status: "stale,quiet" }),
|
|
79
|
-
},
|
|
80
|
-
];
|
|
81
|
-
/**
|
|
82
|
-
* The 6 lenses shown as top-row tabs on /items. Order matters — left to right.
|
|
83
|
-
* Keep this list aligned with what the design calls for: All, signal lenses,
|
|
84
|
-
* and the two curator-assigned lenses that have any matches.
|
|
85
|
-
*/
|
|
86
|
-
export const PRIMARY_LENSES = [
|
|
87
|
-
"all",
|
|
88
|
-
"new",
|
|
89
|
-
"hot",
|
|
90
|
-
"mature",
|
|
91
|
-
"production-like",
|
|
92
|
-
"good-to-learn",
|
|
93
|
-
];
|
|
94
|
-
export function lensById(id) {
|
|
95
|
-
if (!id)
|
|
96
|
-
return undefined;
|
|
97
|
-
return LENSES.find((l) => l.id === id);
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* Check whether the current URL search params match a given lens's
|
|
101
|
-
* implied filter state. Used to highlight the active tab when a
|
|
102
|
-
* deep-link uses the underlying filter key (e.g. ?label=hot) rather
|
|
103
|
-
* than the abstract lens id (?lens=hot).
|
|
104
|
-
*/
|
|
105
|
-
export function isLensActive(lensId, sp) {
|
|
106
|
-
if (lensId === "all") {
|
|
107
|
-
// "All" is active when no lens-shaped filter is present.
|
|
108
|
-
return !lensFromSearchParams(sp) && !sp.get("label") && !sp.get("status");
|
|
109
|
-
}
|
|
110
|
-
const def = lensById(lensId);
|
|
111
|
-
if (!def)
|
|
112
|
-
return false;
|
|
113
|
-
const target = def.toParams();
|
|
114
|
-
for (const [k, v] of Object.entries(target)) {
|
|
115
|
-
if (Array.isArray(v)) {
|
|
116
|
-
if (sp.getAll(k).length !== v.length)
|
|
117
|
-
return false;
|
|
118
|
-
for (const item of v)
|
|
119
|
-
if (!sp.getAll(k).includes(item))
|
|
120
|
-
return false;
|
|
121
|
-
}
|
|
122
|
-
else {
|
|
123
|
-
if (sp.get(k) !== v)
|
|
124
|
-
return false;
|
|
125
|
-
}
|
|
126
|
-
}
|
|
127
|
-
return true;
|
|
128
|
-
}
|
|
129
|
-
export function isPrimaryLens(id) {
|
|
130
|
-
if (!id)
|
|
131
|
-
return false;
|
|
132
|
-
return PRIMARY_LENSES.includes(id);
|
|
133
|
-
}
|
|
134
|
-
/**
|
|
135
|
-
* Turn a lens's `toParams()` output into a URLSearchParams string
|
|
136
|
-
* (with the existing query preserved, then lens params merged on top).
|
|
137
|
-
*/
|
|
138
|
-
export function lensToQuery(id, current) {
|
|
139
|
-
if (!id || id === "all")
|
|
140
|
-
return "";
|
|
141
|
-
const def = lensById(id);
|
|
142
|
-
if (!def)
|
|
143
|
-
return "";
|
|
144
|
-
const next = new URLSearchParams(current);
|
|
145
|
-
for (const [k, v] of Object.entries(def.toParams())) {
|
|
146
|
-
if (Array.isArray(v)) {
|
|
147
|
-
next.delete(k);
|
|
148
|
-
for (const item of v)
|
|
149
|
-
next.append(k, item);
|
|
150
|
-
}
|
|
151
|
-
else {
|
|
152
|
-
next.set(k, v);
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
return next.toString();
|
|
156
|
-
}
|
|
157
|
-
/**
|
|
158
|
-
* Read a `?lens=...` value from URL search params.
|
|
159
|
-
*/
|
|
160
|
-
export function lensFromSearchParams(sp) {
|
|
161
|
-
const v = sp.get("lens");
|
|
162
|
-
if (!v)
|
|
163
|
-
return null;
|
|
164
|
-
if (LENSES.some((l) => l.id === v))
|
|
165
|
-
return v;
|
|
166
|
-
return null;
|
|
167
|
-
}
|
|
168
|
-
/**
|
|
169
|
-
* Build a `href` for a lens tab. Per the single-select-view rule,
|
|
170
|
-
* clicking a lens resets the "view" params (lens, label, status, page)
|
|
171
|
-
* and applies only the chosen lens's params. Stack/Platform/Category/
|
|
172
|
-
* License/q/sort/density filters are preserved.
|
|
173
|
-
*/
|
|
174
|
-
export function hrefForLens(lensId, current, pathPrefix = "/items") {
|
|
175
|
-
const sp = new URLSearchParams(current);
|
|
176
|
-
sp.delete("lens");
|
|
177
|
-
sp.delete("label");
|
|
178
|
-
sp.delete("status");
|
|
179
|
-
sp.delete("page");
|
|
180
|
-
if (lensId && lensId !== "all") {
|
|
181
|
-
const def = lensById(lensId);
|
|
182
|
-
if (def) {
|
|
183
|
-
for (const [k, v] of Object.entries(def.toParams())) {
|
|
184
|
-
if (Array.isArray(v)) {
|
|
185
|
-
sp.delete(k);
|
|
186
|
-
for (const item of v)
|
|
187
|
-
sp.append(k, item);
|
|
188
|
-
}
|
|
189
|
-
else {
|
|
190
|
-
sp.set(k, v);
|
|
191
|
-
}
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
const qs = sp.toString();
|
|
196
|
-
const base = pathPrefix.replace(/\/$/, "") || "/";
|
|
197
|
-
return qs ? `${base}?${qs}` : base;
|
|
198
|
-
}
|
|
1
|
+
export * from "@grove-dev/core";
|
|
199
2
|
//# sourceMappingURL=lenses.js.map
|
package/dist/lib/lenses.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lenses.js","sourceRoot":"","sources":["../../src/lib/lenses.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"lenses.js","sourceRoot":"","sources":["../../src/lib/lenses.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
package/dist/lib/repo.d.ts
CHANGED
|
@@ -1,20 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Parse a GitHub repo URL into its owner and repo components.
|
|
3
|
-
* Returns nulls if the URL doesn't match github.com/{owner}/{repo}.
|
|
4
|
-
*
|
|
5
|
-
* Used in:
|
|
6
|
-
* - ItemCard avatar fallback (owner avatar via GitHub avatars
|
|
7
|
-
* API; component name retained for V1 published API stability)
|
|
8
|
-
* - App detail page (showing owner + repo name in breadcrumb / header)
|
|
9
|
-
* - Anywhere we need to display "@owner / repo" or link to the owner
|
|
10
|
-
*/
|
|
11
|
-
export declare function getOwnerAndRepoFromRepoUrl(repoUrl: string): {
|
|
12
|
-
owner: string | null;
|
|
13
|
-
repo: string | null;
|
|
14
|
-
};
|
|
15
|
-
/**
|
|
16
|
-
* Build a GitHub avatar URL for a given owner.
|
|
17
|
-
* Returns null if owner is null/empty.
|
|
18
|
-
*/
|
|
19
|
-
export declare function getOwnerAvatarUrl(owner: string | null, size?: number): string | null;
|
|
1
|
+
export * from "@grove-dev/core";
|
|
20
2
|
//# sourceMappingURL=repo.d.ts.map
|
package/dist/lib/repo.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/lib/repo.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"repo.d.ts","sourceRoot":"","sources":["../../src/lib/repo.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
package/dist/lib/repo.js
CHANGED
|
@@ -1,31 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Parse a GitHub repo URL into its owner and repo components.
|
|
3
|
-
* Returns nulls if the URL doesn't match github.com/{owner}/{repo}.
|
|
4
|
-
*
|
|
5
|
-
* Used in:
|
|
6
|
-
* - ItemCard avatar fallback (owner avatar via GitHub avatars
|
|
7
|
-
* API; component name retained for V1 published API stability)
|
|
8
|
-
* - App detail page (showing owner + repo name in breadcrumb / header)
|
|
9
|
-
* - Anywhere we need to display "@owner / repo" or link to the owner
|
|
10
|
-
*/
|
|
11
|
-
export function getOwnerAndRepoFromRepoUrl(repoUrl) {
|
|
12
|
-
if (!repoUrl || !repoUrl.includes("github.com/")) {
|
|
13
|
-
return { owner: null, repo: null };
|
|
14
|
-
}
|
|
15
|
-
const m = repoUrl.match(/github\.com\/([^/]+)\/([^/?#]+)/);
|
|
16
|
-
if (!m)
|
|
17
|
-
return { owner: null, repo: null };
|
|
18
|
-
const owner = m[1] ?? null;
|
|
19
|
-
const repo = m[2]?.replace(/\.git$/, "") ?? null;
|
|
20
|
-
return { owner, repo };
|
|
21
|
-
}
|
|
22
|
-
/**
|
|
23
|
-
* Build a GitHub avatar URL for a given owner.
|
|
24
|
-
* Returns null if owner is null/empty.
|
|
25
|
-
*/
|
|
26
|
-
export function getOwnerAvatarUrl(owner, size = 80) {
|
|
27
|
-
if (!owner)
|
|
28
|
-
return null;
|
|
29
|
-
return `https://avatars.githubusercontent.com/${owner}?v=4&s=${size}`;
|
|
30
|
-
}
|
|
1
|
+
export * from "@grove-dev/core";
|
|
31
2
|
//# sourceMappingURL=repo.js.map
|
package/dist/lib/repo.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"repo.js","sourceRoot":"","sources":["../../src/lib/repo.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"repo.js","sourceRoot":"","sources":["../../src/lib/repo.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
package/dist/lib/scores.d.ts
CHANGED
|
@@ -1,37 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
activity?: number;
|
|
3
|
-
maturity?: number;
|
|
4
|
-
learning?: number;
|
|
5
|
-
contribution?: number;
|
|
6
|
-
docs?: number;
|
|
7
|
-
overall?: number;
|
|
8
|
-
};
|
|
9
|
-
/**
|
|
10
|
-
* Format a single score (0-100) into a 0-5 "tier" used by the UI:
|
|
11
|
-
*
|
|
12
|
-
* 0-19 → 0 (very low)
|
|
13
|
-
* 20-39 → 1 (low)
|
|
14
|
-
* 40-59 → 2 (medium)
|
|
15
|
-
* 60-79 → 3 (high)
|
|
16
|
-
* 80-100 → 4 (very high)
|
|
17
|
-
*
|
|
18
|
-
* The list page renders each score as a 4-cell bar; this gives the
|
|
19
|
-
* visual a stable shape regardless of the underlying number.
|
|
20
|
-
*/
|
|
21
|
-
export declare function scoreTier(n: number): 0 | 1 | 2 | 3 | 4;
|
|
22
|
-
/** Compact textual label for a score tier (used in tooltips). */
|
|
23
|
-
export declare function scoreTierLabel(n: number): string;
|
|
24
|
-
/** Short numeric label used inline next to a score bar, e.g. "82". */
|
|
25
|
-
export declare function scoreLabel(n: number | undefined): string;
|
|
26
|
-
/** Order of score dimensions, used by both list and detail. */
|
|
27
|
-
export declare const SCORE_DIMENSIONS: (keyof AppScores)[];
|
|
28
|
-
/** Human-readable label for a score dimension. */
|
|
29
|
-
export declare const SCORE_LABELS: Record<keyof AppScores, string>;
|
|
30
|
-
/**
|
|
31
|
-
* Reasoning copy per dimension, surfaced in the detail page so the
|
|
32
|
-
* numbers don't feel magical. These are intentionally short — the
|
|
33
|
-
* curation.notes on each item carries the longer story.
|
|
34
|
-
*/
|
|
35
|
-
export declare const SCORE_REASONING: Record<keyof AppScores, string>;
|
|
36
|
-
export {};
|
|
1
|
+
export * from "@grove-dev/core";
|
|
37
2
|
//# sourceMappingURL=scores.d.ts.map
|
package/dist/lib/scores.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scores.d.ts","sourceRoot":"","sources":["../../src/lib/scores.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"scores.d.ts","sourceRoot":"","sources":["../../src/lib/scores.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
package/dist/lib/scores.js
CHANGED
|
@@ -1,76 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
* Format a single score (0-100) into a 0-5 "tier" used by the UI:
|
|
3
|
-
*
|
|
4
|
-
* 0-19 → 0 (very low)
|
|
5
|
-
* 20-39 → 1 (low)
|
|
6
|
-
* 40-59 → 2 (medium)
|
|
7
|
-
* 60-79 → 3 (high)
|
|
8
|
-
* 80-100 → 4 (very high)
|
|
9
|
-
*
|
|
10
|
-
* The list page renders each score as a 4-cell bar; this gives the
|
|
11
|
-
* visual a stable shape regardless of the underlying number.
|
|
12
|
-
*/
|
|
13
|
-
export function scoreTier(n) {
|
|
14
|
-
if (n < 20)
|
|
15
|
-
return 0;
|
|
16
|
-
if (n < 40)
|
|
17
|
-
return 1;
|
|
18
|
-
if (n < 60)
|
|
19
|
-
return 2;
|
|
20
|
-
if (n < 80)
|
|
21
|
-
return 3;
|
|
22
|
-
return 4;
|
|
23
|
-
}
|
|
24
|
-
/** Compact textual label for a score tier (used in tooltips). */
|
|
25
|
-
export function scoreTierLabel(n) {
|
|
26
|
-
switch (scoreTier(n)) {
|
|
27
|
-
case 0:
|
|
28
|
-
return "Very low";
|
|
29
|
-
case 1:
|
|
30
|
-
return "Low";
|
|
31
|
-
case 2:
|
|
32
|
-
return "Medium";
|
|
33
|
-
case 3:
|
|
34
|
-
return "High";
|
|
35
|
-
case 4:
|
|
36
|
-
return "Very high";
|
|
37
|
-
}
|
|
38
|
-
}
|
|
39
|
-
/** Short numeric label used inline next to a score bar, e.g. "82". */
|
|
40
|
-
export function scoreLabel(n) {
|
|
41
|
-
if (typeof n !== "number")
|
|
42
|
-
return "—";
|
|
43
|
-
return Math.round(n).toString();
|
|
44
|
-
}
|
|
45
|
-
/** Order of score dimensions, used by both list and detail. */
|
|
46
|
-
export const SCORE_DIMENSIONS = [
|
|
47
|
-
"activity",
|
|
48
|
-
"maturity",
|
|
49
|
-
"learning",
|
|
50
|
-
"contribution",
|
|
51
|
-
"docs",
|
|
52
|
-
"overall",
|
|
53
|
-
];
|
|
54
|
-
/** Human-readable label for a score dimension. */
|
|
55
|
-
export const SCORE_LABELS = {
|
|
56
|
-
activity: "Activity",
|
|
57
|
-
maturity: "Maturity",
|
|
58
|
-
learning: "Learning",
|
|
59
|
-
contribution: "Contribution",
|
|
60
|
-
docs: "Docs",
|
|
61
|
-
overall: "Overall",
|
|
62
|
-
};
|
|
63
|
-
/**
|
|
64
|
-
* Reasoning copy per dimension, surfaced in the detail page so the
|
|
65
|
-
* numbers don't feel magical. These are intentionally short — the
|
|
66
|
-
* curation.notes on each item carries the longer story.
|
|
67
|
-
*/
|
|
68
|
-
export const SCORE_REASONING = {
|
|
69
|
-
activity: "Recent commits, open and merged PRs, issue response time, release cadence.",
|
|
70
|
-
maturity: "Repo age, stable structure, real-world production usage, contributor stability.",
|
|
71
|
-
learning: "Codebase readability, useful architecture patterns, comment quality, examples.",
|
|
72
|
-
contribution: "Open issues, recent merged PRs from new contributors, maintainer responsiveness, contribution guide.",
|
|
73
|
-
docs: "README quality, architecture docs, contributing guide, examples, code comments.",
|
|
74
|
-
overall: "Composite judgment — how likely this item is to satisfy a curious developer.",
|
|
75
|
-
};
|
|
1
|
+
export * from "@grove-dev/core";
|
|
76
2
|
//# sourceMappingURL=scores.js.map
|
package/dist/lib/scores.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scores.js","sourceRoot":"","sources":["../../src/lib/scores.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"scores.js","sourceRoot":"","sources":["../../src/lib/scores.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|
package/dist/lib/search.d.ts
CHANGED
|
@@ -1,114 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
/**
|
|
3
|
-
* URL-driven filter state for the /items discovery page.
|
|
4
|
-
*
|
|
5
|
-
* Multi-value fields use repeated keys in the URL: `?stack=Flutter&stack=React+Native`.
|
|
6
|
-
* Empty / undefined fields mean "no filter on this dimension".
|
|
7
|
-
*/
|
|
8
|
-
export type IndexFilters = {
|
|
9
|
-
q?: string;
|
|
10
|
-
stacks?: string[];
|
|
11
|
-
platforms?: string[];
|
|
12
|
-
categories?: string[];
|
|
13
|
-
labels?: string[];
|
|
14
|
-
licenses?: string[];
|
|
15
|
-
statuses?: string[];
|
|
16
|
-
/** A curated lens (e.g. "good-to-learn", "production-like"). Single value. */
|
|
17
|
-
lens?: string;
|
|
18
|
-
/** Sort order. Single value, defaults to "recently-updated". */
|
|
19
|
-
sort?: IndexSort | undefined;
|
|
20
|
-
/** 1-based page number. */
|
|
21
|
-
page?: number | undefined;
|
|
22
|
-
};
|
|
23
|
-
/** Available sort orders, in UI order. */
|
|
24
|
-
export declare const SORT_OPTIONS: readonly [{
|
|
25
|
-
readonly value: "recently-updated";
|
|
26
|
-
readonly label: "Recently updated";
|
|
27
|
-
}, {
|
|
28
|
-
readonly value: "most-starred";
|
|
29
|
-
readonly label: "Most starred";
|
|
30
|
-
}, {
|
|
31
|
-
readonly value: "recently-added";
|
|
32
|
-
readonly label: "Recently added";
|
|
33
|
-
}, {
|
|
34
|
-
readonly value: "best-overall";
|
|
35
|
-
readonly label: "Best overall";
|
|
36
|
-
}, {
|
|
37
|
-
readonly value: "alphabetical";
|
|
38
|
-
readonly label: "Alphabetical";
|
|
39
|
-
}];
|
|
40
|
-
export type IndexSort = (typeof SORT_OPTIONS)[number]["value"];
|
|
41
|
-
/**
|
|
42
|
-
* Read filters from a URLSearchParams (or anything URLSearchParams-shaped,
|
|
43
|
-
* e.g. the result of `new URL(req.url).searchParams`).
|
|
44
|
-
*/
|
|
45
|
-
export declare function filtersFromSearchParams(sp: URLSearchParams): IndexFilters;
|
|
46
|
-
/**
|
|
47
|
-
* Serialize a filters object back to URLSearchParams.
|
|
48
|
-
* Undefined / empty values are dropped. Defaults (sort, page 1, comfortable
|
|
49
|
-
* density) are also dropped to keep URLs short and canonical.
|
|
50
|
-
*/
|
|
51
|
-
export declare function searchParamsFromFilters(f: IndexFilters): URLSearchParams;
|
|
52
|
-
/** True if any filter is active (i.e. the result list isn't "all items"). */
|
|
53
|
-
export declare function hasAnyFilter(f: IndexFilters): boolean;
|
|
54
|
-
/** How many items per page. Constant for now; future versions may vary. */
|
|
55
|
-
export declare const PAGE_SIZE = 20;
|
|
56
|
-
export declare function applySort(items: IndexRecord[], sort: IndexSort): IndexRecord[];
|
|
57
|
-
/** Slice an array for a given page (1-based). */
|
|
58
|
-
export declare function paginate<T>(items: T[], page: number, pageSize?: number): T[];
|
|
59
|
-
/** Total number of pages given an item count. Always >= 1. */
|
|
60
|
-
export declare function totalPages(itemCount: number, pageSize?: number): number;
|
|
61
|
-
/** Resolve the effective sort from a filters object, applying default. */
|
|
62
|
-
export declare function effectiveSort(f: IndexFilters): IndexSort;
|
|
63
|
-
/** Resolve the effective page from a filters object, applying default. */
|
|
64
|
-
export declare function effectivePage(f: IndexFilters): number;
|
|
65
|
-
/**
|
|
66
|
-
* Return the subset of items that match all active filters (AND across
|
|
67
|
-
* dimensions, OR within a dimension).
|
|
68
|
-
*
|
|
69
|
-
* `q` is a case-insensitive substring search across name, owner,
|
|
70
|
-
* description, and category. Other dimensions are exact match.
|
|
71
|
-
*/
|
|
72
|
-
export declare function filterRecords(items: IndexRecord[], f: IndexFilters): IndexRecord[];
|
|
73
|
-
/** Build a flat list of "active filter" chips for display + removal. */
|
|
74
|
-
export declare function activeFilterChips(f: IndexFilters): {
|
|
75
|
-
key: keyof IndexFilters;
|
|
76
|
-
value: string;
|
|
77
|
-
label: string;
|
|
78
|
-
}[];
|
|
79
|
-
/**
|
|
80
|
-
* Return a new filters object with one (key, value) removed.
|
|
81
|
-
* - key="q" → clears the search string
|
|
82
|
-
* - multi-value keys → removes the single matching value
|
|
83
|
-
* Used by the "x" button on each active filter chip.
|
|
84
|
-
* Also resets page to 1 so the user doesn't get stranded on a high page
|
|
85
|
-
* that no longer has results.
|
|
86
|
-
*/
|
|
87
|
-
export declare function removeFilter(f: IndexFilters, key: keyof IndexFilters, value: string): IndexFilters;
|
|
88
|
-
/**
|
|
89
|
-
* Build the full list of facet values from the items array, preserving
|
|
90
|
-
* a sensible order (frequency desc, then alphabetical for ties).
|
|
91
|
-
*/
|
|
92
|
-
export declare function buildFacets(items: IndexRecord[]): {
|
|
93
|
-
stacks: {
|
|
94
|
-
value: string;
|
|
95
|
-
count: number;
|
|
96
|
-
}[];
|
|
97
|
-
platforms: {
|
|
98
|
-
value: string;
|
|
99
|
-
count: number;
|
|
100
|
-
}[];
|
|
101
|
-
categories: {
|
|
102
|
-
value: string;
|
|
103
|
-
count: number;
|
|
104
|
-
}[];
|
|
105
|
-
labels: {
|
|
106
|
-
value: string;
|
|
107
|
-
count: number;
|
|
108
|
-
}[];
|
|
109
|
-
licenses: {
|
|
110
|
-
value: string;
|
|
111
|
-
count: number;
|
|
112
|
-
}[];
|
|
113
|
-
};
|
|
1
|
+
export * from "@grove-dev/core";
|
|
114
2
|
//# sourceMappingURL=search.d.ts.map
|
package/dist/lib/search.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/lib/search.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"search.d.ts","sourceRoot":"","sources":["../../src/lib/search.ts"],"names":[],"mappings":"AAAA,cAAc,iBAAiB,CAAC"}
|