@grove-dev/core 0.2.13 → 0.2.16
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 +111 -42
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
> Generic, framework-free engine for Grove.
|
|
4
4
|
|
|
5
|
-
Headless TypeScript. Owns the
|
|
5
|
+
Headless TypeScript. Owns the discriminated `Resource` union (`ProjectRecord` | `ResourceRecord` | `EntityRecord`), the config loader, importers, validators, taxonomy types, optional GitHub signal sync, sitemap generation, llms.txt generation, and the data build pipeline. Zero framework dependencies — no Astro, no React, no Svelte.
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
8
|
pnpm add @grove-dev/core
|
|
@@ -10,73 +10,142 @@ pnpm add @grove-dev/core
|
|
|
10
10
|
|
|
11
11
|
## What it does
|
|
12
12
|
|
|
13
|
-
- **Resource schema** — Zod-validated
|
|
14
|
-
- **Config** — `
|
|
15
|
-
- **Importers** — parse Markdown awesome lists into structured records.
|
|
16
|
-
- **Validators** — schema + reference checks (duplicate
|
|
17
|
-
- **Taxonomy** — typed registry for stacks, platforms, categories, distribution channels.
|
|
18
|
-
- **Build pipeline** — `
|
|
19
|
-
- **Sitemap & llms.txt** — `buildSitemap
|
|
20
|
-
- **Optional GitHub signal sync** — `fetchGithubMetadata
|
|
21
|
-
- **
|
|
13
|
+
- **Discriminated `Resource` schema** — Zod-validated `ProjectRecord` / `ResourceRecord` / `EntityRecord` union, plus the slim `IndexRecord` projection for list views. Each kind binds to a V1 blueprint (`project-directory` / `resource-hub` / `ecosystem-map`).
|
|
14
|
+
- **Config** — `defineConfig(config)` (V0's `defineGroveConfig` is gone) and `loadConfig` for `grove.config.ts` projects, via `jiti` so no build step is required.
|
|
15
|
+
- **Importers** — `parseAwesomeMarkdown` and `importAwesomeList` parse Markdown awesome lists into structured records.
|
|
16
|
+
- **Validators** — schema + reference checks (duplicate slugs, missing descriptions, broken categories, unknown decisions, kind-vs-blueprint mismatches).
|
|
17
|
+
- **Taxonomy** — typed registry for stacks, platforms, categories, distribution channels, lenses, labels.
|
|
18
|
+
- **Build pipeline** — `generate(config)` (the library form of `grove generate`) produces `data/generated/records.full.json`, `data/generated/records.index.json`, `data/generated/records.json` (alias), and `data/generated/site-config.json`.
|
|
19
|
+
- **Sitemap & llms.txt** — `buildSitemap` and `buildSitemapXml` (the library form of `grove sitemap`); `buildLlmsTxt` and `buildLlmsFullTxt` (the library form of `grove llms`).
|
|
20
|
+
- **Optional GitHub signal sync** — `fetchGithubMetadata`, `classifyHealth`, `enrichFromGithubHtml`, `parseGithubRepoUrl` for spaces that want maintenance signals. The CLI wraps these as `grove sync github`.
|
|
21
|
+
- **Cleanup** — `pickCleanupCandidates` (the library form of `grove cleanup stale`) flags records that need human review.
|
|
22
22
|
|
|
23
|
-
## Public surface
|
|
23
|
+
## Public surface (V1)
|
|
24
24
|
|
|
25
25
|
```ts
|
|
26
26
|
import {
|
|
27
27
|
// Config
|
|
28
28
|
defineConfig,
|
|
29
29
|
loadConfig,
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
30
|
+
type GroveConfig,
|
|
31
|
+
|
|
32
|
+
// Schemas (Zod)
|
|
33
|
+
blueprintSchema,
|
|
34
|
+
resourceKindSchema,
|
|
35
|
+
healthStatusSchema,
|
|
36
|
+
healthTierSchema,
|
|
37
|
+
healthBlockSchema,
|
|
34
38
|
healthEntrySchema,
|
|
39
|
+
healthFileSchema,
|
|
35
40
|
decisionSchema,
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
41
|
+
decisionsFileSchema,
|
|
42
|
+
overrideSchema,
|
|
43
|
+
overridesFileSchema,
|
|
44
|
+
projectRecordSchema,
|
|
45
|
+
resourceRecordSchema,
|
|
46
|
+
entityRecordSchema,
|
|
47
|
+
projectTypeSchema,
|
|
48
|
+
resourceTypeSchema,
|
|
49
|
+
entityTypeSchema,
|
|
50
|
+
appLabelSchema,
|
|
51
|
+
scoreSchema,
|
|
52
|
+
linksSchema,
|
|
53
|
+
githubRepositorySchema,
|
|
54
|
+
githubMetadataSchema,
|
|
55
|
+
githubLicenseSchema,
|
|
56
|
+
type Blueprint,
|
|
57
|
+
type ResourceKind,
|
|
58
|
+
type DecisionVisibility,
|
|
59
|
+
|
|
60
|
+
// Discriminated record types
|
|
61
|
+
type Resource,
|
|
62
|
+
type ProjectRecord,
|
|
63
|
+
type ResourceRecord,
|
|
64
|
+
type EntityRecord,
|
|
65
|
+
type IndexRecord,
|
|
66
|
+
type IndexProjectRecord,
|
|
67
|
+
type IndexResourceRecord,
|
|
68
|
+
type IndexEntityRecord,
|
|
69
|
+
blueprintKind,
|
|
70
|
+
|
|
71
|
+
// Build pipeline (library form)
|
|
72
|
+
generate,
|
|
73
|
+
type GenerateResult,
|
|
74
|
+
type RecordsFullPayload,
|
|
75
|
+
type RecordsIndexPayload,
|
|
76
|
+
|
|
77
|
+
// Sitemap
|
|
43
78
|
buildSitemap,
|
|
44
79
|
buildSitemapXml,
|
|
45
|
-
|
|
80
|
+
|
|
81
|
+
// llms.txt
|
|
46
82
|
buildLlmsTxt,
|
|
47
83
|
buildLlmsFullTxt,
|
|
84
|
+
type LlmsInput,
|
|
85
|
+
type LlmsRecordInput,
|
|
86
|
+
type LlmsResult,
|
|
48
87
|
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
// Importers / parsers
|
|
54
|
-
importAwesomeList,
|
|
55
|
-
parseAppYaml,
|
|
56
|
-
normalizeAppRecord,
|
|
57
|
-
toIndexApp,
|
|
58
|
-
parseGithubRepoUrl,
|
|
88
|
+
// Cleanup
|
|
89
|
+
pickCleanupCandidates,
|
|
90
|
+
type CleanupCandidate,
|
|
91
|
+
type CleanupReport,
|
|
59
92
|
|
|
60
93
|
// GitHub
|
|
94
|
+
parseGithubRepoUrl,
|
|
95
|
+
type GithubRepoRef,
|
|
61
96
|
fetchGithubMetadata,
|
|
97
|
+
enrichFromGithubHtml,
|
|
62
98
|
classifyHealth,
|
|
63
99
|
healthFromSignals,
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
100
|
+
type GithubMetadata,
|
|
101
|
+
type HealthEntry,
|
|
102
|
+
type EnrichedFields,
|
|
103
|
+
type EnrichResult,
|
|
104
|
+
rateLimitWaitMs,
|
|
105
|
+
sleep,
|
|
106
|
+
type GhFetchOptions,
|
|
67
107
|
|
|
68
|
-
//
|
|
108
|
+
// Importers / parsers
|
|
109
|
+
detectGithubRepo,
|
|
110
|
+
parseAwesomeMarkdown,
|
|
111
|
+
parseEntry,
|
|
112
|
+
parseSections,
|
|
113
|
+
type ImportedRecord,
|
|
114
|
+
type ImportSummary,
|
|
115
|
+
type ImportResult,
|
|
116
|
+
type ParsedEntry,
|
|
117
|
+
type ParsedSection,
|
|
118
|
+
|
|
119
|
+
// IO helpers
|
|
69
120
|
readYamlFile,
|
|
70
121
|
writeYamlFile,
|
|
71
122
|
writeTextFile,
|
|
72
|
-
stringifyAppYaml,
|
|
73
|
-
|
|
74
|
-
// Validate
|
|
75
|
-
validateProject,
|
|
76
|
-
validateAppRecord,
|
|
77
123
|
} from "@grove-dev/core";
|
|
78
124
|
```
|
|
79
125
|
|
|
126
|
+
## V0→V1 renames in this package
|
|
127
|
+
|
|
128
|
+
The V0 published `@grove-dev/core` exposed several names that the V1 release replaces with `record` / `IndexRecord` / `Resource` semantics. The renames are:
|
|
129
|
+
|
|
130
|
+
| V0 name (removed) | V1 canonical name |
|
|
131
|
+
|---|---|
|
|
132
|
+
| `curatedConfigSchema` | `blueprintSchema` (in `schema.ts`) |
|
|
133
|
+
| `defineGroveConfig` | `defineConfig` (in `config.ts`) |
|
|
134
|
+
| `resourceSchema` | `projectRecordSchema` / `resourceRecordSchema` / `entityRecordSchema` |
|
|
135
|
+
| `itemsFileSchema` | removed (the records are individual `<slug>.yml` files, no aggregate file) |
|
|
136
|
+
| `buildData` | `generate` (library form) |
|
|
137
|
+
| `buildSitemap` / `buildSitemapXml` | kept (V1 names) |
|
|
138
|
+
| `buildLlmsFiles` | `buildLlmsTxt` + `buildLlmsFullTxt` (split into two functions) |
|
|
139
|
+
| `buildLlmsTxt` / `buildLlmsFullTxt` | kept (V1 names) |
|
|
140
|
+
| `fetchGithubMetadata` | kept (V1 name) |
|
|
141
|
+
| `enrichFromGithubHtml` | kept (V1 name) |
|
|
142
|
+
| `ghFetch` / `pLimit` | internal to `github-client.ts`; not part of the V1 public surface |
|
|
143
|
+
| `pickReviewCandidates` | `pickCleanupCandidates` |
|
|
144
|
+
| `buildReviewReport` | removed (the cleanup report is a side effect of `pickCleanupCandidates`) |
|
|
145
|
+
| `parseAppYaml` | removed (V0 `apps` model is gone; use `readYamlFile` + Zod parse) |
|
|
146
|
+
| `normalizeAppRecord` / `toIndexApp` | internal to `build-data.ts`; not part of the V1 public surface |
|
|
147
|
+
| `validateProject` / `validateAppRecord` | removed (replaced by `generate` which surfaces validation errors) |
|
|
148
|
+
|
|
80
149
|
## Development
|
|
81
150
|
|
|
82
151
|
```bash
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@grove-dev/core",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.16",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Headless engine for Grove: resource schema, config, importers, validators, taxonomy, sitemap, llms.txt, and the data build pipeline.",
|
|
6
6
|
"license": "MIT",
|