@grove-dev/cli 0.1.0
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 +69 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +847 -0
- package/dist/index.js.map +1 -0
- package/dist/template-loader.d.ts +46 -0
- package/dist/template-loader.d.ts.map +1 -0
- package/dist/template-loader.js +101 -0
- package/dist/template-loader.js.map +1 -0
- package/package.json +70 -0
package/README.md
ADDED
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# `@grove-dev/cli`
|
|
2
|
+
|
|
3
|
+
> The Grove command line.
|
|
4
|
+
|
|
5
|
+
Scaffolds Grove-powered spaces, orchestrates `@grove-dev/core` commands, and runs framework-specific `build` / `dev` against the project's own framework adapter.
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
pnpm add -g @grove-dev/cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Design
|
|
12
|
+
|
|
13
|
+
The CLI is intentionally **framework-agnostic**. It depends on `@grove-dev/core` and on `commander`, and treats framework adapters (`@grove-dev/astro`, `@grove-dev/nextjs`, `@grove-dev/svelte`) as **optional peer dependencies**. Templates are copied from the framework adapter's `templates/` directory at scaffold time; the CLI does not import or execute framework code at runtime.
|
|
14
|
+
|
|
15
|
+
This means:
|
|
16
|
+
|
|
17
|
+
- `pnpm add -g @grove-dev/cli` only pulls in `@grove-dev/core` and `commander`.
|
|
18
|
+
- `grove new --framework <f>` requires `<f>`'s adapter to be installed.
|
|
19
|
+
- `grove build` and `grove dev` detect the framework from the project's `package.json` and spawn the matching command.
|
|
20
|
+
|
|
21
|
+
## Commands
|
|
22
|
+
|
|
23
|
+
| Command | Purpose |
|
|
24
|
+
|---|---|
|
|
25
|
+
| `grove new [name] --framework <f> [--template <t>] [--deploy <p>]` | Scaffold a new space from a framework template. `--framework` is `astro`, `nextjs`, or `svelte`. `--deploy` is `vercel`, `netlify`, `cloudflare`, `github-pages`, or `none`. |
|
|
26
|
+
| `grove import <source>` | Parse a Markdown awesome list (GitHub URL, raw URL, or local path) into `data/resources/*.yml`. |
|
|
27
|
+
| `grove analyze [--limit N]` | Fetch GitHub metadata for each resource that has a repository, write `data/health.yml`. |
|
|
28
|
+
| `grove validate` | Schema + reference checks. |
|
|
29
|
+
| `grove build-data` | Compile `data/resources/*.yml` and `curated.config.ts` into `data/generated/apps.{full,index}.json` and a typed `src/data/config.ts`. |
|
|
30
|
+
| `sitemap` | Generate `public/sitemap.xml` from generated data. |
|
|
31
|
+
| `grove build-llms-full` | Emit `public/llms.txt` and `public/llms-full.txt`. |
|
|
32
|
+
| `grove review` | List cleanup candidates from `data/health.yml` to `data/generated/review-report.json`. |
|
|
33
|
+
| `grove enrich [--limit N]` | Token-free HTML-scrape GitHub enrichment (license, language, topics, homepage). |
|
|
34
|
+
| `grove build` | Run the project's framework build command. |
|
|
35
|
+
| `grove dev` | Start the framework dev server. |
|
|
36
|
+
|
|
37
|
+
## Scaffolding flow
|
|
38
|
+
|
|
39
|
+
```bash
|
|
40
|
+
grove new my-space --framework astro --deploy vercel
|
|
41
|
+
# 1. resolves @grove-dev/astro/templates/default
|
|
42
|
+
# 2. copies it into ./my-space
|
|
43
|
+
# 3. renames the project in template package.json
|
|
44
|
+
# 4. writes curated.config.ts, data/, content/, public/, .github/
|
|
45
|
+
# 5. writes deploy.yml for the chosen provider
|
|
46
|
+
# 6. writes validate-data.yml, import.yml, issue templates, LICENSE
|
|
47
|
+
```
|
|
48
|
+
|
|
49
|
+
## Peer dependencies
|
|
50
|
+
|
|
51
|
+
| Peer | Purpose |
|
|
52
|
+
|---|---|
|
|
53
|
+
| `@grove-dev/astro` *(optional)* | Required for `--framework astro` and `grove build`/`dev` in Astro projects. |
|
|
54
|
+
| `@grove-dev/nextjs` *(optional)* | Required for `--framework nextjs` and `grove build`/`dev` in Next.js projects. |
|
|
55
|
+
| `@grove-dev/svelte` *(optional)* | Required for `--framework svelte` and `grove build`/`dev` in SvelteKit projects. |
|
|
56
|
+
|
|
57
|
+
All three are optional. The CLI only complains when you ask for a framework whose adapter is not installed.
|
|
58
|
+
|
|
59
|
+
## Development
|
|
60
|
+
|
|
61
|
+
```bash
|
|
62
|
+
pnpm --filter @grove-dev/cli build
|
|
63
|
+
pnpm --filter @grove-dev/cli check
|
|
64
|
+
pnpm --filter @grove-dev/cli dev # tsx src/index.ts --help
|
|
65
|
+
```
|
|
66
|
+
|
|
67
|
+
## License
|
|
68
|
+
|
|
69
|
+
MIT
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":""}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,847 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
/**
|
|
3
|
+
* Grove CLI — turns awesome lists into living, health-aware developer directories.
|
|
4
|
+
*
|
|
5
|
+
* Layered on top of `@grove-dev/core`. The CLI is intentionally
|
|
6
|
+
* framework-agnostic: it orchestrates `core` functions and asks the
|
|
7
|
+
* matching framework adapter (e.g. `@grove-dev/astro`) for templates
|
|
8
|
+
* to scaffold a project.
|
|
9
|
+
*/
|
|
10
|
+
import { spawn } from "node:child_process";
|
|
11
|
+
import { mkdir, readFile, writeFile } from "node:fs/promises";
|
|
12
|
+
import { dirname, join, resolve } from "node:path";
|
|
13
|
+
import { Command } from "commander";
|
|
14
|
+
import { buildData, buildLlmsFiles, buildReviewReport, buildSitemap, classifyHealth, enrichFromGithubHtml, fetchGithubMetadata, importAwesomeList, itemsFileSchema, loadConfig, parseAppYaml, parseGithubRepoUrl, readYamlFile, normalizeAppRecord, stringifyAppYaml, validateProject, writeTextFile, writeYamlFile, } from "@grove-dev/core";
|
|
15
|
+
import { copyTemplate, ensureDir, isFramework, listTemplates, renameProjectInTemplate, } from "./template-loader.js";
|
|
16
|
+
const program = new Command();
|
|
17
|
+
program
|
|
18
|
+
.name("grove")
|
|
19
|
+
.description("Turn awesome lists into living, health-aware developer directories.")
|
|
20
|
+
.version("0.1.0");
|
|
21
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
22
|
+
// grove new
|
|
23
|
+
//
|
|
24
|
+
// Scaffold a brand-new project repo. Copies a framework template
|
|
25
|
+
// (default: @grove-dev/astro/templates/default) into <dir>, optionally
|
|
26
|
+
// adds GitHub Actions workflows for the chosen deploy provider.
|
|
27
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
28
|
+
program
|
|
29
|
+
.command("new")
|
|
30
|
+
.argument("[name]", "project directory name", ".")
|
|
31
|
+
.description("Scaffold a new Grove project from a framework template.")
|
|
32
|
+
.option("-f, --framework <name>", "framework: astro | nextjs | svelte", "astro")
|
|
33
|
+
.option("-t, --template <name>", "template name", "default")
|
|
34
|
+
.option("-d, --deploy <provider>", "deploy provider: vercel | netlify | cloudflare | github-pages | none", "github-pages")
|
|
35
|
+
.option("--no-install", "skip writing starter files (test only)")
|
|
36
|
+
.action(async (name, opts) => {
|
|
37
|
+
if (!isFramework(opts.framework)) {
|
|
38
|
+
console.error(`Unknown framework: ${opts.framework}. Try one of: astro, nextjs, svelte.`);
|
|
39
|
+
process.exit(1);
|
|
40
|
+
}
|
|
41
|
+
const framework = opts.framework;
|
|
42
|
+
const templates = await listTemplates(framework);
|
|
43
|
+
const tpl = templates.find((t) => t.template === opts.template) ?? templates[0];
|
|
44
|
+
if (!tpl) {
|
|
45
|
+
console.error(`No templates found for ${framework}.`);
|
|
46
|
+
process.exit(1);
|
|
47
|
+
}
|
|
48
|
+
const root = resolve(name);
|
|
49
|
+
const projectName = name === "." ? "Grove Directory" : name;
|
|
50
|
+
await mkdir(root, { recursive: true });
|
|
51
|
+
await copyTemplate(framework, root, tpl.template);
|
|
52
|
+
await renameProjectInTemplate(framework, root, projectName, tpl.template);
|
|
53
|
+
// Project data files
|
|
54
|
+
await Promise.all([
|
|
55
|
+
ensureDir(join(root, "sources")),
|
|
56
|
+
ensureDir(join(root, "data")),
|
|
57
|
+
ensureDir(join(root, "data", "apps")),
|
|
58
|
+
ensureDir(join(root, "data", "taxonomy")),
|
|
59
|
+
ensureDir(join(root, "data", "generated")),
|
|
60
|
+
ensureDir(join(root, "content")),
|
|
61
|
+
ensureDir(join(root, "public")),
|
|
62
|
+
ensureDir(join(root, ".github")),
|
|
63
|
+
ensureDir(join(root, ".github", "ISSUE_TEMPLATE")),
|
|
64
|
+
ensureDir(join(root, ".github", "workflows")),
|
|
65
|
+
]);
|
|
66
|
+
await writeIfMissing(join(root, "curated.config.ts"), projectConfig(projectName));
|
|
67
|
+
await writeIfMissing(join(root, "README.md"), projectReadme(projectName, framework));
|
|
68
|
+
await writeIfMissing(join(root, ".gitignore"), gitignoreTemplate());
|
|
69
|
+
await writeIfMissing(join(root, "data", "items.yml"), "items: []\n");
|
|
70
|
+
await writeIfMissing(join(root, "data", "health.yml"), "health: []\n");
|
|
71
|
+
await writeIfMissing(join(root, "data", "decisions.yml"), "decisions: []\n");
|
|
72
|
+
await writeIfMissing(join(root, "data", "overrides.yml"), "overrides: []\n");
|
|
73
|
+
await writeIfMissing(join(root, "data", "taxonomy", "stacks.yml"), taxonomyStacks());
|
|
74
|
+
await writeIfMissing(join(root, "data", "taxonomy", "platforms.yml"), taxonomyPlatforms());
|
|
75
|
+
await writeIfMissing(join(root, "data", "taxonomy", "categories.yml"), taxonomyCategories());
|
|
76
|
+
await writeIfMissing(join(root, "data", "taxonomy", "distribution-channels.yml"), taxonomyDistribution());
|
|
77
|
+
await writeIfMissing(join(root, "content", "methodology.md"), "# Methodology\n\nGrove uses repository metadata as a signal. Human curation decisions control final visibility.\n");
|
|
78
|
+
// GitHub workflows
|
|
79
|
+
await writeIfMissing(join(root, ".github", "workflows", "validate-data.yml"), workflowValidate());
|
|
80
|
+
await writeIfMissing(join(root, ".github", "workflows", "import.yml"), workflowImport());
|
|
81
|
+
await writeIfMissing(join(root, ".github", "workflows", "deploy.yml"), workflowDeploy(opts.deploy, framework));
|
|
82
|
+
await writeIfMissing(join(root, ".github", "ISSUE_TEMPLATE", "app_submission.md"), issueTemplateSubmission());
|
|
83
|
+
await writeIfMissing(join(root, ".github", "ISSUE_TEMPLATE", "bug_report.md"), issueTemplateBug());
|
|
84
|
+
await writeIfMissing(join(root, ".github", "ISSUE_TEMPLATE", "feature_request.md"), issueTemplateFeature());
|
|
85
|
+
await writeIfMissing(join(root, "LICENSE"), licenseMIT(projectName));
|
|
86
|
+
console.log(`Created Grove project at ${root} (${framework}/${tpl.template})`);
|
|
87
|
+
});
|
|
88
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
89
|
+
// grove import
|
|
90
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
91
|
+
program
|
|
92
|
+
.command("import")
|
|
93
|
+
.argument("<source>", "GitHub awesome-list URL, raw README URL, or local README.md")
|
|
94
|
+
.description("Import Markdown links into data/items.yml.")
|
|
95
|
+
.action(async (source) => {
|
|
96
|
+
const config = await loadConfig();
|
|
97
|
+
const result = await importAwesomeList(source);
|
|
98
|
+
await writeYamlFile(config.paths.items, { items: result.items });
|
|
99
|
+
const report = [
|
|
100
|
+
"# Import Report",
|
|
101
|
+
"",
|
|
102
|
+
`Source: ${source}`,
|
|
103
|
+
`Imported: ${result.report.imported}`,
|
|
104
|
+
`Skipped: ${result.report.skipped}`,
|
|
105
|
+
`Categories: ${result.report.categories.length}`,
|
|
106
|
+
`Duplicate slugs adjusted: ${result.report.duplicateSlugs}`,
|
|
107
|
+
"",
|
|
108
|
+
"## Categories",
|
|
109
|
+
"",
|
|
110
|
+
...result.report.categories.map((category) => `- ${category}`),
|
|
111
|
+
"",
|
|
112
|
+
].join("\n");
|
|
113
|
+
await writeTextFile(join(config.paths.sourcesDir, "import-report.md"), report);
|
|
114
|
+
console.log(`Imported ${result.items.length} items into ${config.paths.items}`);
|
|
115
|
+
});
|
|
116
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
117
|
+
// grove analyze
|
|
118
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
119
|
+
program
|
|
120
|
+
.command("analyze")
|
|
121
|
+
.description("Fetch GitHub metadata and generate data/health.yml.")
|
|
122
|
+
.option("--limit <n>", "limit analyzed items for demos/rate limits", (value) => Number(value))
|
|
123
|
+
.action(async (options) => {
|
|
124
|
+
const config = await loadConfig();
|
|
125
|
+
const items = itemsFileSchema.parse(await readYamlFile(config.paths.items));
|
|
126
|
+
const list = "items" in items ? items.items : items;
|
|
127
|
+
const selected = typeof options.limit === "number" ? list.slice(0, options.limit) : list;
|
|
128
|
+
const health = [];
|
|
129
|
+
for (const item of selected) {
|
|
130
|
+
const ref = parseGithubRepoUrl(item.links.github);
|
|
131
|
+
if (!ref) {
|
|
132
|
+
health.push(classifyHealth(item.id));
|
|
133
|
+
continue;
|
|
134
|
+
}
|
|
135
|
+
console.log(`Analyzing ${ref.owner}/${ref.repo}`);
|
|
136
|
+
const metadata = await fetchGithubMetadata(ref);
|
|
137
|
+
health.push(classifyHealth(item.id, metadata));
|
|
138
|
+
}
|
|
139
|
+
await writeYamlFile(config.paths.health, { health });
|
|
140
|
+
console.log(`Wrote ${health.length} health entries to ${config.paths.health}`);
|
|
141
|
+
});
|
|
142
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
143
|
+
// grove validate
|
|
144
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
145
|
+
program
|
|
146
|
+
.command("validate")
|
|
147
|
+
.description("Validate project data files.")
|
|
148
|
+
.action(async () => {
|
|
149
|
+
const config = await loadConfig();
|
|
150
|
+
const result = await validateProject(config);
|
|
151
|
+
for (const issue of result.issues) {
|
|
152
|
+
console.log(`${issue.code}: ${issue.message}`);
|
|
153
|
+
}
|
|
154
|
+
if (!result.ok) {
|
|
155
|
+
process.exitCode = 1;
|
|
156
|
+
console.log(`Validation failed with ${result.issues.length} issue(s).`);
|
|
157
|
+
return;
|
|
158
|
+
}
|
|
159
|
+
console.log("Validation passed.");
|
|
160
|
+
});
|
|
161
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
162
|
+
// grove build
|
|
163
|
+
//
|
|
164
|
+
// Build the static site in the current project. Discovers the
|
|
165
|
+
// framework by reading the project's package.json (deps on
|
|
166
|
+
// @grove-dev/<framework>), then runs the matching build command
|
|
167
|
+
// (`astro build`, `next build`, `vite build`).
|
|
168
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
169
|
+
program
|
|
170
|
+
.command("build")
|
|
171
|
+
.description("Build the static directory in the current project repo.")
|
|
172
|
+
.action(async () => {
|
|
173
|
+
const framework = await detectFramework();
|
|
174
|
+
const cmd = frameworkBuildCommand(framework);
|
|
175
|
+
runExternal(cmd, { stdio: "inherit" });
|
|
176
|
+
});
|
|
177
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
178
|
+
// grove dev
|
|
179
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
180
|
+
program
|
|
181
|
+
.command("dev")
|
|
182
|
+
.description("Start the framework dev server in the current project repo.")
|
|
183
|
+
.action(async () => {
|
|
184
|
+
const framework = await detectFramework();
|
|
185
|
+
const cmd = frameworkDevCommand(framework);
|
|
186
|
+
runExternal(cmd, { stdio: "inherit" });
|
|
187
|
+
});
|
|
188
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
189
|
+
// grove build-data
|
|
190
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
191
|
+
program
|
|
192
|
+
.command("build-data")
|
|
193
|
+
.description("Build data/generated/*.json from data/apps/*.yml + curated.config.ts.")
|
|
194
|
+
.action(async () => {
|
|
195
|
+
const result = await buildData();
|
|
196
|
+
console.log(`[build-data] ${result.totalApps} full, ${result.visibleApps} visible index\n` +
|
|
197
|
+
` full: ${result.fullPath}\n` +
|
|
198
|
+
` index: ${result.indexPath}\n` +
|
|
199
|
+
` config: ${result.configTsPath}`);
|
|
200
|
+
});
|
|
201
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
202
|
+
// grove sitemap
|
|
203
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
204
|
+
program
|
|
205
|
+
.command("sitemap")
|
|
206
|
+
.description("Generate public/sitemap.xml from data/generated/apps.full.json + curated.config.ts.")
|
|
207
|
+
.action(async () => {
|
|
208
|
+
const config = await loadConfig();
|
|
209
|
+
const appsPath = join(process.cwd(), config.paths.generatedDir, "apps.full.json");
|
|
210
|
+
let payload;
|
|
211
|
+
try {
|
|
212
|
+
payload = JSON.parse(await readFile(appsPath, "utf8"));
|
|
213
|
+
}
|
|
214
|
+
catch {
|
|
215
|
+
payload = { apps: [] };
|
|
216
|
+
}
|
|
217
|
+
const items = (payload.apps ?? []);
|
|
218
|
+
const result = await buildSitemap({
|
|
219
|
+
generatedAt: payload.generatedAt ?? new Date().toISOString(),
|
|
220
|
+
items,
|
|
221
|
+
});
|
|
222
|
+
console.log(`[sitemap] wrote ${result.urlCount} URLs → ${result.path}`);
|
|
223
|
+
});
|
|
224
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
225
|
+
// grove enrich
|
|
226
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
227
|
+
program
|
|
228
|
+
.command("enrich")
|
|
229
|
+
.description("Enrich data/apps/*.yml with HTML-scrape GitHub metadata (no token required).")
|
|
230
|
+
.option("--limit <n>", "limit enriched apps for rate limits", (value) => Number(value))
|
|
231
|
+
.action(async (options) => {
|
|
232
|
+
const config = await loadConfig();
|
|
233
|
+
const appsDir = resolve(process.cwd(), config.paths.appsDir);
|
|
234
|
+
const { readdir } = await import("node:fs/promises");
|
|
235
|
+
let entries;
|
|
236
|
+
try {
|
|
237
|
+
entries = await readdir(appsDir);
|
|
238
|
+
}
|
|
239
|
+
catch (err) {
|
|
240
|
+
console.error(`[enrich] ${appsDir} does not exist.`);
|
|
241
|
+
process.exit(1);
|
|
242
|
+
}
|
|
243
|
+
const files = entries.filter((f) => f.endsWith(".yml")).sort();
|
|
244
|
+
const selected = typeof options.limit === "number" ? files.slice(0, options.limit) : files;
|
|
245
|
+
let updated = 0;
|
|
246
|
+
let skipped = 0;
|
|
247
|
+
const failed = [];
|
|
248
|
+
for (const file of selected) {
|
|
249
|
+
const path = join(appsDir, file);
|
|
250
|
+
const text = await readFile(path, "utf8");
|
|
251
|
+
const raw = parseAppYaml(text, file.replace(/\.yml$/, ""));
|
|
252
|
+
const app = normalizeAppRecord(raw, file.replace(/\.yml$/, ""));
|
|
253
|
+
if (!app.repoUrl) {
|
|
254
|
+
skipped++;
|
|
255
|
+
continue;
|
|
256
|
+
}
|
|
257
|
+
process.stdout.write(`[enrich] ${app.slug} ... `);
|
|
258
|
+
const res = await enrichFromGithubHtml(app.repoUrl);
|
|
259
|
+
if (res.notFound) {
|
|
260
|
+
process.stdout.write("skip (404)\n");
|
|
261
|
+
skipped++;
|
|
262
|
+
continue;
|
|
263
|
+
}
|
|
264
|
+
if (res.rateLimited) {
|
|
265
|
+
process.stdout.write("rate-limited\n");
|
|
266
|
+
failed.push(`${app.slug}: rate-limited`);
|
|
267
|
+
continue;
|
|
268
|
+
}
|
|
269
|
+
if (res.error) {
|
|
270
|
+
process.stdout.write(`error: ${res.error}\n`);
|
|
271
|
+
failed.push(`${app.slug}: ${res.error}`);
|
|
272
|
+
continue;
|
|
273
|
+
}
|
|
274
|
+
const f = res.fields;
|
|
275
|
+
const repo = raw.github?.repository;
|
|
276
|
+
const next = {
|
|
277
|
+
...(repo ?? {}),
|
|
278
|
+
...(f.license ? { license: { spdx_id: f.license, key: null, name: null, url: null } } : {}),
|
|
279
|
+
...(f.language ? { language: f.language } : {}),
|
|
280
|
+
...(f.topics.length > 0 ? { topics: f.topics } : {}),
|
|
281
|
+
...(f.homepage ? { homepage: f.homepage } : {}),
|
|
282
|
+
};
|
|
283
|
+
const nextDoc = { ...raw, github: { ...(raw.github ?? {}), repository: next } };
|
|
284
|
+
const out = stringifyAppYaml(nextDoc);
|
|
285
|
+
if (out !== text) {
|
|
286
|
+
await writeFile(path, out, "utf8");
|
|
287
|
+
process.stdout.write(`updated (license=${f.license ?? "—"} lang=${f.language ?? "—"})\n`);
|
|
288
|
+
updated++;
|
|
289
|
+
}
|
|
290
|
+
else {
|
|
291
|
+
process.stdout.write("no change\n");
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
console.log(`\n[enrich] ${updated} updated, ${skipped} skipped, ${failed.length} failed`);
|
|
295
|
+
});
|
|
296
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
297
|
+
// grove review
|
|
298
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
299
|
+
program
|
|
300
|
+
.command("review")
|
|
301
|
+
.description("List items that need human curation (cleanup candidates, unknown, etc).")
|
|
302
|
+
.action(async () => {
|
|
303
|
+
const { report, path } = await buildReviewReport();
|
|
304
|
+
console.log(`[review] ${report.totalCandidates} candidate(s) → ${path}`);
|
|
305
|
+
for (const c of report.candidates.slice(0, 10)) {
|
|
306
|
+
console.log(` - ${c.slug} (${c.status}, ${c.stars}★)`);
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
310
|
+
// grove build-llms-full
|
|
311
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
312
|
+
program
|
|
313
|
+
.command("build-llms-full")
|
|
314
|
+
.description("Generate public/llms.txt and public/llms-full.txt from generated apps data.")
|
|
315
|
+
.action(async () => {
|
|
316
|
+
const config = await loadConfig();
|
|
317
|
+
const appsPath = join(process.cwd(), config.paths.generatedDir, "apps.full.json");
|
|
318
|
+
let payload;
|
|
319
|
+
try {
|
|
320
|
+
payload = JSON.parse(await readFile(appsPath, "utf8"));
|
|
321
|
+
}
|
|
322
|
+
catch {
|
|
323
|
+
payload = { apps: [] };
|
|
324
|
+
}
|
|
325
|
+
const apps = (payload.apps ?? []);
|
|
326
|
+
const result = await buildLlmsFiles({
|
|
327
|
+
generatedAt: payload.generatedAt ?? new Date().toISOString(),
|
|
328
|
+
apps: apps.map((a) => ({
|
|
329
|
+
slug: a.slug,
|
|
330
|
+
name: a.name,
|
|
331
|
+
description: a.description,
|
|
332
|
+
category: a.category,
|
|
333
|
+
stack: a.stack,
|
|
334
|
+
stars: a.stars,
|
|
335
|
+
visibility: a.visibility,
|
|
336
|
+
})),
|
|
337
|
+
});
|
|
338
|
+
console.log(`[build-llms-full] ${result.indexed} indexed → ${result.txtPath} + ${result.fullPath}`);
|
|
339
|
+
});
|
|
340
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
341
|
+
// Framework discovery + command resolution
|
|
342
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
343
|
+
async function detectFramework() {
|
|
344
|
+
try {
|
|
345
|
+
const pkg = JSON.parse(await readFile("package.json", "utf8"));
|
|
346
|
+
const all = { ...(pkg.dependencies ?? {}), ...(pkg.devDependencies ?? {}) };
|
|
347
|
+
if (all["@grove-dev/astro"])
|
|
348
|
+
return "astro";
|
|
349
|
+
if (all["@grove-dev/nextjs"])
|
|
350
|
+
return "nextjs";
|
|
351
|
+
if (all["@grove-dev/svelte"])
|
|
352
|
+
return "svelte";
|
|
353
|
+
}
|
|
354
|
+
catch {
|
|
355
|
+
/* ignore */
|
|
356
|
+
}
|
|
357
|
+
console.error("Could not detect a Grove framework in the current project.");
|
|
358
|
+
console.error("Install @grove-dev/astro, @grove-dev/nextjs, or @grove-dev/svelte first.");
|
|
359
|
+
process.exit(1);
|
|
360
|
+
}
|
|
361
|
+
function frameworkBuildCommand(fw) {
|
|
362
|
+
switch (fw) {
|
|
363
|
+
case "astro":
|
|
364
|
+
return ["pnpm", ["exec", "astro", "build"]];
|
|
365
|
+
case "nextjs":
|
|
366
|
+
return ["pnpm", ["exec", "next", "build"]];
|
|
367
|
+
case "svelte":
|
|
368
|
+
return ["pnpm", ["exec", "vite", "build"]];
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
function frameworkDevCommand(fw) {
|
|
372
|
+
switch (fw) {
|
|
373
|
+
case "astro":
|
|
374
|
+
return ["pnpm", ["exec", "astro", "dev"]];
|
|
375
|
+
case "nextjs":
|
|
376
|
+
return ["pnpm", ["exec", "next", "dev"]];
|
|
377
|
+
case "svelte":
|
|
378
|
+
return ["pnpm", ["exec", "vite", "dev"]];
|
|
379
|
+
}
|
|
380
|
+
}
|
|
381
|
+
function runExternal(cmd, opts = { stdio: "inherit" }) {
|
|
382
|
+
const [bin, args] = cmd;
|
|
383
|
+
const child = spawn(bin, args, {
|
|
384
|
+
stdio: opts.stdio,
|
|
385
|
+
shell: process.platform === "win32",
|
|
386
|
+
});
|
|
387
|
+
child.on("exit", (code) => {
|
|
388
|
+
process.exitCode = code ?? 1;
|
|
389
|
+
});
|
|
390
|
+
}
|
|
391
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
392
|
+
// Templated project files (these stay in the CLI; they're emitted
|
|
393
|
+
// per-project and have nothing to do with the framework adapter).
|
|
394
|
+
// ──────────────────────────────────────────────────────────────────────
|
|
395
|
+
async function writeIfMissing(path, content) {
|
|
396
|
+
try {
|
|
397
|
+
await readFile(path, "utf8");
|
|
398
|
+
}
|
|
399
|
+
catch {
|
|
400
|
+
await mkdir(dirname(path), { recursive: true });
|
|
401
|
+
await writeFile(path, content, "utf8");
|
|
402
|
+
}
|
|
403
|
+
}
|
|
404
|
+
function projectConfig(projectName) {
|
|
405
|
+
return `import { defineConfig } from "@grove-dev/core";
|
|
406
|
+
|
|
407
|
+
export default defineConfig({
|
|
408
|
+
name: "${projectName}",
|
|
409
|
+
tagline: "A living, health-aware developer directory.",
|
|
410
|
+
itemLabel: "project",
|
|
411
|
+
});
|
|
412
|
+
`;
|
|
413
|
+
}
|
|
414
|
+
function projectReadme(projectName, framework) {
|
|
415
|
+
return `# ${projectName}
|
|
416
|
+
|
|
417
|
+
A living, health-aware developer directory built with [Grove](https://github.com/tortuvshin/grove).
|
|
418
|
+
|
|
419
|
+
Framework: **${framework}**
|
|
420
|
+
|
|
421
|
+
## What this is
|
|
422
|
+
|
|
423
|
+
This repository is **data + branding + decisions**, not the framework.
|
|
424
|
+
The CLI and static framework live in the separate \`grove\` repo.
|
|
425
|
+
|
|
426
|
+
## Workflow
|
|
427
|
+
|
|
428
|
+
\`\`\`bash
|
|
429
|
+
grove import <source>
|
|
430
|
+
grove analyze
|
|
431
|
+
grove review
|
|
432
|
+
grove validate
|
|
433
|
+
grove build-data
|
|
434
|
+
grove build-llms-full
|
|
435
|
+
grove sitemap
|
|
436
|
+
grove build
|
|
437
|
+
\`\`\`
|
|
438
|
+
|
|
439
|
+
## Files
|
|
440
|
+
|
|
441
|
+
- \`curated.config.ts\` — site name, tagline, and data paths.
|
|
442
|
+
- \`sources/\` — original Markdown lists that feed the directory.
|
|
443
|
+
- \`data/items.yml\` — parsed project list (commit this).
|
|
444
|
+
- \`data/apps/\` — per-app YAML records (commit this).
|
|
445
|
+
- \`data/health.yml\` — generated GitHub health metadata (regenerate on demand).
|
|
446
|
+
- \`data/overrides.yml\` — manual corrections to items.
|
|
447
|
+
- \`data/decisions.yml\` — human curation decisions.
|
|
448
|
+
- \`data/taxonomy/\` — registry of stacks, platforms, categories, distribution channels.
|
|
449
|
+
- \`content/methodology.md\` — the public methodology page.
|
|
450
|
+
- \`public/\` — logo, OG image, and other static assets.
|
|
451
|
+
`;
|
|
452
|
+
}
|
|
453
|
+
function gitignoreTemplate() {
|
|
454
|
+
return `node_modules/
|
|
455
|
+
dist/
|
|
456
|
+
.astro/
|
|
457
|
+
.next/
|
|
458
|
+
.svelte-kit/
|
|
459
|
+
.DS_Store
|
|
460
|
+
.env
|
|
461
|
+
.env.*
|
|
462
|
+
!.env.example
|
|
463
|
+
data/.cache/
|
|
464
|
+
data/generated/
|
|
465
|
+
coverage/
|
|
466
|
+
.tmp-test/
|
|
467
|
+
.idea/
|
|
468
|
+
.vscode/
|
|
469
|
+
*.log
|
|
470
|
+
*.tsbuildinfo
|
|
471
|
+
`;
|
|
472
|
+
}
|
|
473
|
+
function taxonomyStacks() {
|
|
474
|
+
return `- id: typescript
|
|
475
|
+
name: TypeScript
|
|
476
|
+
family: language
|
|
477
|
+
languages: [typescript, javascript]
|
|
478
|
+
- id: javascript
|
|
479
|
+
name: JavaScript
|
|
480
|
+
family: language
|
|
481
|
+
languages: [javascript]
|
|
482
|
+
- id: rust
|
|
483
|
+
name: Rust
|
|
484
|
+
family: language
|
|
485
|
+
languages: [rust]
|
|
486
|
+
- id: go
|
|
487
|
+
name: Go
|
|
488
|
+
family: language
|
|
489
|
+
languages: [go]
|
|
490
|
+
- id: python
|
|
491
|
+
name: Python
|
|
492
|
+
family: language
|
|
493
|
+
languages: [python]
|
|
494
|
+
- id: flutter
|
|
495
|
+
name: Flutter
|
|
496
|
+
family: cross-platform
|
|
497
|
+
languages: [dart]
|
|
498
|
+
platforms: [ios, android, web, macos, windows, linux]
|
|
499
|
+
- id: react-native
|
|
500
|
+
name: React Native
|
|
501
|
+
family: cross-platform
|
|
502
|
+
languages: [typescript, javascript]
|
|
503
|
+
platforms: [ios, android]
|
|
504
|
+
`;
|
|
505
|
+
}
|
|
506
|
+
function taxonomyPlatforms() {
|
|
507
|
+
return `- id: web
|
|
508
|
+
name: Web
|
|
509
|
+
- id: ios
|
|
510
|
+
name: iOS
|
|
511
|
+
- id: android
|
|
512
|
+
name: Android
|
|
513
|
+
- id: macos
|
|
514
|
+
name: macOS
|
|
515
|
+
- id: windows
|
|
516
|
+
name: Windows
|
|
517
|
+
- id: linux
|
|
518
|
+
name: Linux
|
|
519
|
+
- id: desktop
|
|
520
|
+
name: Desktop
|
|
521
|
+
- id: embedded
|
|
522
|
+
name: Embedded
|
|
523
|
+
`;
|
|
524
|
+
}
|
|
525
|
+
function taxonomyCategories() {
|
|
526
|
+
return `- id: tools
|
|
527
|
+
name: Tools
|
|
528
|
+
- id: libraries
|
|
529
|
+
name: Libraries
|
|
530
|
+
- id: frameworks
|
|
531
|
+
name: Frameworks
|
|
532
|
+
- id: applications
|
|
533
|
+
name: Applications
|
|
534
|
+
- id: ai
|
|
535
|
+
name: AI / ML
|
|
536
|
+
- id: devtools
|
|
537
|
+
name: Developer Tools
|
|
538
|
+
- id: web
|
|
539
|
+
name: Web
|
|
540
|
+
- id: mobile
|
|
541
|
+
name: Mobile
|
|
542
|
+
- id: backend
|
|
543
|
+
name: Backend
|
|
544
|
+
- id: infrastructure
|
|
545
|
+
name: Infrastructure
|
|
546
|
+
`;
|
|
547
|
+
}
|
|
548
|
+
function taxonomyDistribution() {
|
|
549
|
+
return `- id: app-store
|
|
550
|
+
name: App Store
|
|
551
|
+
platforms: [ios, macos]
|
|
552
|
+
- id: play-store
|
|
553
|
+
name: Play Store
|
|
554
|
+
platforms: [android]
|
|
555
|
+
- id: fdroid
|
|
556
|
+
name: F-Droid
|
|
557
|
+
platforms: [android]
|
|
558
|
+
- id: github-releases
|
|
559
|
+
name: GitHub Releases
|
|
560
|
+
platforms: [ios, android, macos, windows, linux]
|
|
561
|
+
- id: website
|
|
562
|
+
name: Website
|
|
563
|
+
platforms: [web, ios, android, macos, windows, linux]
|
|
564
|
+
- id: package-registry
|
|
565
|
+
name: Package Registry
|
|
566
|
+
- id: npm
|
|
567
|
+
name: npm
|
|
568
|
+
- id: crates-io
|
|
569
|
+
name: crates.io
|
|
570
|
+
- id: pypi
|
|
571
|
+
name: PyPI
|
|
572
|
+
- id: other
|
|
573
|
+
name: Other
|
|
574
|
+
`;
|
|
575
|
+
}
|
|
576
|
+
function workflowValidate() {
|
|
577
|
+
return `name: Validate data
|
|
578
|
+
|
|
579
|
+
on:
|
|
580
|
+
pull_request:
|
|
581
|
+
paths:
|
|
582
|
+
- "data/**"
|
|
583
|
+
- "curated.config.ts"
|
|
584
|
+
- "package.json"
|
|
585
|
+
workflow_dispatch:
|
|
586
|
+
|
|
587
|
+
jobs:
|
|
588
|
+
validate:
|
|
589
|
+
runs-on: ubuntu-latest
|
|
590
|
+
steps:
|
|
591
|
+
- uses: actions/checkout@v4
|
|
592
|
+
- uses: pnpm/action-setup@v4
|
|
593
|
+
- uses: actions/setup-node@v4
|
|
594
|
+
with:
|
|
595
|
+
node-version: "20"
|
|
596
|
+
cache: pnpm
|
|
597
|
+
- run: pnpm install --frozen-lockfile
|
|
598
|
+
- run: pnpm run validate:data
|
|
599
|
+
`;
|
|
600
|
+
}
|
|
601
|
+
function workflowImport() {
|
|
602
|
+
return `name: Refresh data
|
|
603
|
+
|
|
604
|
+
on:
|
|
605
|
+
schedule:
|
|
606
|
+
- cron: "0 6 * * *"
|
|
607
|
+
workflow_dispatch:
|
|
608
|
+
|
|
609
|
+
jobs:
|
|
610
|
+
refresh:
|
|
611
|
+
runs-on: ubuntu-latest
|
|
612
|
+
permissions:
|
|
613
|
+
contents: write
|
|
614
|
+
pull-requests: write
|
|
615
|
+
steps:
|
|
616
|
+
- uses: actions/checkout@v4
|
|
617
|
+
- uses: pnpm/action-setup@v4
|
|
618
|
+
- uses: actions/setup-node@v4
|
|
619
|
+
with:
|
|
620
|
+
node-version: "20"
|
|
621
|
+
cache: pnpm
|
|
622
|
+
- run: pnpm install --frozen-lockfile
|
|
623
|
+
- name: Refresh items
|
|
624
|
+
run: |
|
|
625
|
+
grove import "$AWESOME_SOURCE"
|
|
626
|
+
grove analyze
|
|
627
|
+
grove review
|
|
628
|
+
grove build-data
|
|
629
|
+
grove build-llms-full
|
|
630
|
+
grove sitemap
|
|
631
|
+
env:
|
|
632
|
+
AWESOME_SOURCE: \${{ vars.AWESOME_SOURCE }}
|
|
633
|
+
GITHUB_TOKEN: \${{ secrets.GITHUB_TOKEN }}
|
|
634
|
+
- name: Open PR
|
|
635
|
+
uses: peter-evans/create-pull-request@v6
|
|
636
|
+
with:
|
|
637
|
+
title: "chore(data): refresh from upstream"
|
|
638
|
+
commit-message: "chore(data): refresh from upstream"
|
|
639
|
+
branch: chore/data-refresh
|
|
640
|
+
`;
|
|
641
|
+
}
|
|
642
|
+
function workflowDeploy(provider, framework) {
|
|
643
|
+
switch (provider) {
|
|
644
|
+
case "vercel":
|
|
645
|
+
return `name: Deploy to Vercel
|
|
646
|
+
on:
|
|
647
|
+
push:
|
|
648
|
+
branches: [main]
|
|
649
|
+
workflow_dispatch:
|
|
650
|
+
jobs:
|
|
651
|
+
deploy:
|
|
652
|
+
runs-on: ubuntu-latest
|
|
653
|
+
steps:
|
|
654
|
+
- uses: actions/checkout@v4
|
|
655
|
+
- uses: pnpm/action-setup@v4
|
|
656
|
+
- uses: actions/setup-node@v4
|
|
657
|
+
with: { node-version: "20", cache: pnpm }
|
|
658
|
+
- run: pnpm install --frozen-lockfile
|
|
659
|
+
- run: pnpm run build
|
|
660
|
+
- uses: amondnet/vercel-action@v25
|
|
661
|
+
with:
|
|
662
|
+
vercel-token: \${{ secrets.VERCEL_TOKEN }}
|
|
663
|
+
vercel-org-id: \${{ secrets.VERCEL_ORG_ID }}
|
|
664
|
+
vercel-project-id: \${{ secrets.VERCEL_PROJECT_ID }}
|
|
665
|
+
vercel-args: '--prod'
|
|
666
|
+
working-directory: ./
|
|
667
|
+
`;
|
|
668
|
+
case "netlify":
|
|
669
|
+
return `name: Deploy to Netlify
|
|
670
|
+
on:
|
|
671
|
+
push:
|
|
672
|
+
branches: [main]
|
|
673
|
+
workflow_dispatch:
|
|
674
|
+
jobs:
|
|
675
|
+
deploy:
|
|
676
|
+
runs-on: ubuntu-latest
|
|
677
|
+
steps:
|
|
678
|
+
- uses: actions/checkout@v4
|
|
679
|
+
- uses: pnpm/action-setup@v4
|
|
680
|
+
- uses: actions/setup-node@v4
|
|
681
|
+
with: { node-version: "20", cache: pnpm }
|
|
682
|
+
- run: pnpm install --frozen-lockfile
|
|
683
|
+
- run: pnpm run build
|
|
684
|
+
- uses: nwtgck/actions-netlify@v3.0
|
|
685
|
+
with:
|
|
686
|
+
publish-dir: ./dist
|
|
687
|
+
production-deploy: true
|
|
688
|
+
deploy-message: "Deploy from GitHub Actions"
|
|
689
|
+
env:
|
|
690
|
+
NETLIFY_AUTH_TOKEN: \${{ secrets.NETLIFY_AUTH_TOKEN }}
|
|
691
|
+
NETLIFY_SITE_ID: \${{ secrets.NETLIFY_SITE_ID }}
|
|
692
|
+
`;
|
|
693
|
+
case "cloudflare":
|
|
694
|
+
return `name: Deploy to Cloudflare Pages
|
|
695
|
+
on:
|
|
696
|
+
push:
|
|
697
|
+
branches: [main]
|
|
698
|
+
workflow_dispatch:
|
|
699
|
+
jobs:
|
|
700
|
+
deploy:
|
|
701
|
+
runs-on: ubuntu-latest
|
|
702
|
+
steps:
|
|
703
|
+
- uses: actions/checkout@v4
|
|
704
|
+
- uses: pnpm/action-setup@v4
|
|
705
|
+
- uses: actions/setup-node@v4
|
|
706
|
+
with: { node-version: "20", cache: pnpm }
|
|
707
|
+
- run: pnpm install --frozen-lockfile
|
|
708
|
+
- run: pnpm run build
|
|
709
|
+
- uses: cloudflare/pages-action@v1
|
|
710
|
+
with:
|
|
711
|
+
apiToken: \${{ secrets.CLOUDFLARE_API_TOKEN }}
|
|
712
|
+
accountId: \${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
|
713
|
+
projectName: ${framework}-site
|
|
714
|
+
directory: dist
|
|
715
|
+
`;
|
|
716
|
+
case "github-pages":
|
|
717
|
+
return `name: Build & deploy to GitHub Pages
|
|
718
|
+
on:
|
|
719
|
+
push:
|
|
720
|
+
branches: [main]
|
|
721
|
+
workflow_dispatch:
|
|
722
|
+
jobs:
|
|
723
|
+
build:
|
|
724
|
+
runs-on: ubuntu-latest
|
|
725
|
+
steps:
|
|
726
|
+
- uses: actions/checkout@v4
|
|
727
|
+
- uses: pnpm/action-setup@v4
|
|
728
|
+
- uses: actions/setup-node@v4
|
|
729
|
+
with: { node-version: "20", cache: pnpm }
|
|
730
|
+
- run: pnpm install --frozen-lockfile
|
|
731
|
+
- run: pnpm run build
|
|
732
|
+
- uses: actions/upload-pages-artifact@v3
|
|
733
|
+
with:
|
|
734
|
+
path: dist
|
|
735
|
+
deploy:
|
|
736
|
+
needs: build
|
|
737
|
+
if: github.ref == 'refs/heads/main'
|
|
738
|
+
runs-on: ubuntu-latest
|
|
739
|
+
permissions:
|
|
740
|
+
pages: write
|
|
741
|
+
id-token: write
|
|
742
|
+
environment:
|
|
743
|
+
name: github-pages
|
|
744
|
+
url: \${{ steps.deployment.outputs.page_url }}
|
|
745
|
+
steps:
|
|
746
|
+
- id: deployment
|
|
747
|
+
uses: actions/deploy-pages@v4
|
|
748
|
+
`;
|
|
749
|
+
case "none":
|
|
750
|
+
return `# No deploy workflow generated. Add your own when ready.`;
|
|
751
|
+
}
|
|
752
|
+
}
|
|
753
|
+
function issueTemplateSubmission() {
|
|
754
|
+
return `---
|
|
755
|
+
name: Submit a project
|
|
756
|
+
about: Suggest an open-source project to add to this directory
|
|
757
|
+
title: "[Submit] "
|
|
758
|
+
labels: submission
|
|
759
|
+
---
|
|
760
|
+
|
|
761
|
+
## Project
|
|
762
|
+
|
|
763
|
+
- **Repository URL** (required):
|
|
764
|
+
- **Name**:
|
|
765
|
+
- **One-line description** (≤ 120 chars):
|
|
766
|
+
- **Category** (e.g. tools, libraries, frameworks):
|
|
767
|
+
- **Stack / language** (e.g. typescript, rust):
|
|
768
|
+
- **Platforms** (e.g. web, ios, android):
|
|
769
|
+
|
|
770
|
+
## Why include it?
|
|
771
|
+
|
|
772
|
+
A few sentences on what makes this project worth listing — maturity,
|
|
773
|
+
adoption, learning value, or unique qualities.
|
|
774
|
+
|
|
775
|
+
## Source
|
|
776
|
+
|
|
777
|
+
Where did you find it? (Awesome list, blog post, etc.)
|
|
778
|
+
`;
|
|
779
|
+
}
|
|
780
|
+
function issueTemplateBug() {
|
|
781
|
+
return `---
|
|
782
|
+
name: Bug report
|
|
783
|
+
about: Something is broken or wrong
|
|
784
|
+
title: "[Bug] "
|
|
785
|
+
labels: bug
|
|
786
|
+
---
|
|
787
|
+
|
|
788
|
+
## What happened
|
|
789
|
+
|
|
790
|
+
A clear description of the bug.
|
|
791
|
+
|
|
792
|
+
## How to reproduce
|
|
793
|
+
|
|
794
|
+
Steps to reproduce the behaviour.
|
|
795
|
+
|
|
796
|
+
## Expected
|
|
797
|
+
|
|
798
|
+
What you expected to happen.
|
|
799
|
+
`;
|
|
800
|
+
}
|
|
801
|
+
function issueTemplateFeature() {
|
|
802
|
+
return `---
|
|
803
|
+
name: Feature request
|
|
804
|
+
about: Suggest a new feature for this directory
|
|
805
|
+
title: "[Feature] "
|
|
806
|
+
labels: enhancement
|
|
807
|
+
---
|
|
808
|
+
|
|
809
|
+
## What
|
|
810
|
+
|
|
811
|
+
A clear description of the feature.
|
|
812
|
+
|
|
813
|
+
## Why
|
|
814
|
+
|
|
815
|
+
What problem does this solve?
|
|
816
|
+
`;
|
|
817
|
+
}
|
|
818
|
+
function licenseMIT(projectName) {
|
|
819
|
+
const year = new Date().getFullYear();
|
|
820
|
+
return `MIT License
|
|
821
|
+
|
|
822
|
+
Copyright (c) ${year} ${projectName}
|
|
823
|
+
|
|
824
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
825
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
826
|
+
in the Software without restriction, including without limitation the rights
|
|
827
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
828
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
829
|
+
furnished to do so, subject to the following conditions:
|
|
830
|
+
|
|
831
|
+
The above copyright notice and this permission notice shall be included in all
|
|
832
|
+
copies or substantial portions of the Software.
|
|
833
|
+
|
|
834
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
835
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
836
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
837
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
838
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
839
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
840
|
+
SOFTWARE.
|
|
841
|
+
`;
|
|
842
|
+
}
|
|
843
|
+
program.parseAsync().catch((error) => {
|
|
844
|
+
console.error(error instanceof Error ? error.message : String(error));
|
|
845
|
+
process.exit(1);
|
|
846
|
+
});
|
|
847
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AACA;;;;;;;GAOG;AACH,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAC3C,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EACL,SAAS,EACT,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,cAAc,EACd,oBAAoB,EACpB,mBAAmB,EAEnB,iBAAiB,EACjB,eAAe,EACf,UAAU,EACV,YAAY,EACZ,kBAAkB,EAElB,YAAY,EAIZ,kBAAkB,EAClB,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,aAAa,GACd,MAAM,iBAAiB,CAAC;AACzB,OAAO,EACL,YAAY,EACZ,SAAS,EACT,WAAW,EACX,aAAa,EACb,uBAAuB,GAGxB,MAAM,sBAAsB,CAAC;AAE9B,MAAM,OAAO,GAAG,IAAI,OAAO,EAAE,CAAC;AAE9B,OAAO;KACJ,IAAI,CAAC,OAAO,CAAC;KACb,WAAW,CAAC,qEAAqE,CAAC;KAClF,OAAO,CAAC,OAAO,CAAC,CAAC;AAEpB,yEAAyE;AACzE,YAAY;AACZ,EAAE;AACF,iEAAiE;AACjE,uEAAuE;AACvE,gEAAgE;AAChE,yEAAyE;AACzE,OAAO;KACJ,OAAO,CAAC,KAAK,CAAC;KACd,QAAQ,CAAC,QAAQ,EAAE,wB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,IAAI,WAAW;;;;;;;;;;;;;;;;;;;CAmBlC,CAAC;AACF,CAAC;AAED,OAAO,CAAC,UAAU,EAAE,CAAC,KAAK,CAAC,CAAC,KAAc,EAAE,EAAE;IAC5C,OAAO,CAAC,KAAK,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACtE,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;AAClB,CAAC,CAAC,CAAC"}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
export type Framework = "astro" | "nextjs" | "svelte";
|
|
2
|
+
export type DeployProvider = "vercel" | "netlify" | "cloudflare" | "github-pages" | "none";
|
|
3
|
+
export interface TemplateSummary {
|
|
4
|
+
framework: Framework;
|
|
5
|
+
template: string;
|
|
6
|
+
path: string;
|
|
7
|
+
description?: string;
|
|
8
|
+
}
|
|
9
|
+
/** Frameworks that ship templates inside the adapter package. */
|
|
10
|
+
export declare const SUPPORTED_FRAMEWORKS: readonly Framework[];
|
|
11
|
+
export declare function isFramework(value: string): value is Framework;
|
|
12
|
+
/** List every available template for a framework. */
|
|
13
|
+
export declare function listTemplates(framework: Framework): Promise<TemplateSummary[]>;
|
|
14
|
+
/** Resolve the absolute path of a framework template directory. */
|
|
15
|
+
export declare function templatePath(framework: Framework, name?: string): string;
|
|
16
|
+
/**
|
|
17
|
+
* Copy a template directory into a project root. Honors `force: false`
|
|
18
|
+
* by default so an existing project isn't clobbered.
|
|
19
|
+
*/
|
|
20
|
+
export declare function copyTemplate(framework: Framework, targetRoot: string, name?: string, options?: {
|
|
21
|
+
force?: boolean;
|
|
22
|
+
}): Promise<{
|
|
23
|
+
from: string;
|
|
24
|
+
to: string;
|
|
25
|
+
files: number;
|
|
26
|
+
}>;
|
|
27
|
+
/**
|
|
28
|
+
* Read the framework's `package.json` from the template and rewrite
|
|
29
|
+
* the `name` to a project-friendly slug. Leaves everything else
|
|
30
|
+
* intact (deps, scripts) so the new project starts with the right
|
|
31
|
+
* wiring.
|
|
32
|
+
*/
|
|
33
|
+
export declare function renameProjectInTemplate(framework: Framework, targetRoot: string, projectName: string, templateName?: string): Promise<{
|
|
34
|
+
packageJsonPath: string;
|
|
35
|
+
finalName: string;
|
|
36
|
+
}>;
|
|
37
|
+
/**
|
|
38
|
+
* Make sure a directory exists. Async wrapper around `mkdir -p`.
|
|
39
|
+
*/
|
|
40
|
+
export declare function ensureDir(path: string): Promise<void>;
|
|
41
|
+
/**
|
|
42
|
+
* Resolve a file path relative to the current module — handy for
|
|
43
|
+
* locating bundled assets the CLI ships with (e.g. .github templates).
|
|
44
|
+
*/
|
|
45
|
+
export declare function here(...parts: string[]): string;
|
|
46
|
+
//# sourceMappingURL=template-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-loader.d.ts","sourceRoot":"","sources":["../src/template-loader.ts"],"names":[],"mappings":"AAeA,MAAM,MAAM,SAAS,GAAG,OAAO,GAAG,QAAQ,GAAG,QAAQ,CAAC;AACtD,MAAM,MAAM,cAAc,GAAG,QAAQ,GAAG,SAAS,GAAG,YAAY,GAAG,cAAc,GAAG,MAAM,CAAC;AAE3F,MAAM,WAAW,eAAe;IAC9B,SAAS,EAAE,SAAS,CAAC;IACrB,QAAQ,EAAE,MAAM,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,CAAC,EAAE,MAAM,CAAC;CACtB;AAED,iEAAiE;AACjE,eAAO,MAAM,oBAAoB,EAAE,SAAS,SAAS,EAA2C,CAAC;AAEjG,wBAAgB,WAAW,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,IAAI,SAAS,CAE7D;AA0BD,qDAAqD;AACrD,wBAAsB,aAAa,CAAC,SAAS,EAAE,SAAS,GAAG,OAAO,CAAC,eAAe,EAAE,CAAC,CAIpF;AAED,mEAAmE;AACnE,wBAAgB,YAAY,CAAC,SAAS,EAAE,SAAS,EAAE,IAAI,SAAY,GAAG,MAAM,CAE3E;AAED;;;GAGG;AACH,wBAAsB,YAAY,CAChC,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM,EAClB,IAAI,SAAY,EAChB,OAAO,GAAE;IAAE,KAAK,CAAC,EAAE,OAAO,CAAA;CAAO,GAChC,OAAO,CAAC;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,EAAE,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC,CAQtD;AAED;;;;;GAKG;AACH,wBAAsB,uBAAuB,CAC3C,SAAS,EAAE,SAAS,EACpB,UAAU,EAAE,MAAM,EAClB,WAAW,EAAE,MAAM,EACnB,YAAY,SAAY,GACvB,OAAO,CAAC;IAAE,eAAe,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC,CAOzD;AAWD;;GAEG;AACH,wBAAsB,SAAS,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,IAAI,CAAC,CAE3D;AAED;;;GAGG;AACH,wBAAgB,IAAI,CAAC,GAAG,KAAK,EAAE,MAAM,EAAE,GAAG,MAAM,CAG/C"}
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Resolve and copy Grove framework templates into a project directory.
|
|
3
|
+
*
|
|
4
|
+
* Templates live inside each framework adapter package
|
|
5
|
+
* (`@grove-dev/astro/templates/<name>`, ...). The CLI looks them
|
|
6
|
+
* up in `node_modules` so that `grove new <dir> --framework <f>`
|
|
7
|
+
* just works after `pnpm add @grove-dev/<framework>`.
|
|
8
|
+
*/
|
|
9
|
+
import { cp, mkdir, readFile, writeFile } from "node:fs/promises";
|
|
10
|
+
import { dirname, join, resolve } from "node:path";
|
|
11
|
+
import { createRequire } from "node:module";
|
|
12
|
+
import { fileURLToPath } from "node:url";
|
|
13
|
+
const require = createRequire(import.meta.url);
|
|
14
|
+
/** Frameworks that ship templates inside the adapter package. */
|
|
15
|
+
export const SUPPORTED_FRAMEWORKS = ["astro", "nextjs", "svelte"];
|
|
16
|
+
export function isFramework(value) {
|
|
17
|
+
return SUPPORTED_FRAMEWORKS.includes(value);
|
|
18
|
+
}
|
|
19
|
+
function templatesRoot(framework) {
|
|
20
|
+
const pkg = `@grove-dev/${framework}`;
|
|
21
|
+
// Resolve from the CLI's own location so the framework package is
|
|
22
|
+
// found whether it was installed as a dep of the consumer's project
|
|
23
|
+
// or as a workspace sibling during local dev.
|
|
24
|
+
let entrypoint;
|
|
25
|
+
try {
|
|
26
|
+
entrypoint = require.resolve(`${pkg}/package.json`, { paths: [process.cwd()] });
|
|
27
|
+
}
|
|
28
|
+
catch {
|
|
29
|
+
try {
|
|
30
|
+
entrypoint = require.resolve(`${pkg}/package.json`);
|
|
31
|
+
}
|
|
32
|
+
catch {
|
|
33
|
+
throw new Error(`Framework package ${pkg} is not installed.\n` +
|
|
34
|
+
`Run one of:\n` +
|
|
35
|
+
` pnpm add -g ${pkg}\n` +
|
|
36
|
+
` pnpm add -D ${pkg}\n` +
|
|
37
|
+
(framework === "astro" ? "then retry: grove new <dir> --framework astro" : ""));
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
return resolve(dirname(entrypoint), "templates");
|
|
41
|
+
}
|
|
42
|
+
/** List every available template for a framework. */
|
|
43
|
+
export async function listTemplates(framework) {
|
|
44
|
+
const root = templatesRoot(framework);
|
|
45
|
+
// No fs.readdir on unknown folders; assume a single 'default' template per framework.
|
|
46
|
+
return [{ framework, template: "default", path: join(root, "default") }];
|
|
47
|
+
}
|
|
48
|
+
/** Resolve the absolute path of a framework template directory. */
|
|
49
|
+
export function templatePath(framework, name = "default") {
|
|
50
|
+
return join(templatesRoot(framework), name);
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Copy a template directory into a project root. Honors `force: false`
|
|
54
|
+
* by default so an existing project isn't clobbered.
|
|
55
|
+
*/
|
|
56
|
+
export async function copyTemplate(framework, targetRoot, name = "default", options = {}) {
|
|
57
|
+
const from = templatePath(framework, name);
|
|
58
|
+
await cp(from, targetRoot, {
|
|
59
|
+
recursive: true,
|
|
60
|
+
force: options.force ?? false,
|
|
61
|
+
errorOnExist: !(options.force ?? false),
|
|
62
|
+
});
|
|
63
|
+
return { from, to: targetRoot, files: -1 };
|
|
64
|
+
}
|
|
65
|
+
/**
|
|
66
|
+
* Read the framework's `package.json` from the template and rewrite
|
|
67
|
+
* the `name` to a project-friendly slug. Leaves everything else
|
|
68
|
+
* intact (deps, scripts) so the new project starts with the right
|
|
69
|
+
* wiring.
|
|
70
|
+
*/
|
|
71
|
+
export async function renameProjectInTemplate(framework, targetRoot, projectName, templateName = "default") {
|
|
72
|
+
const packageJsonPath = join(targetRoot, "package.json");
|
|
73
|
+
const raw = await readFile(packageJsonPath, "utf8");
|
|
74
|
+
const pkg = JSON.parse(raw);
|
|
75
|
+
pkg.name = packageNameFromProjectName(projectName, framework, templateName);
|
|
76
|
+
await writeFile(packageJsonPath, `${JSON.stringify(pkg, null, 2)}\n`, "utf8");
|
|
77
|
+
return { packageJsonPath, finalName: pkg.name };
|
|
78
|
+
}
|
|
79
|
+
function packageNameFromProjectName(name, framework, templateName) {
|
|
80
|
+
const slug = name
|
|
81
|
+
.toLowerCase()
|
|
82
|
+
.replace(/[^a-z0-9]+/g, "-")
|
|
83
|
+
.replace(/^-+|-+$/g, "");
|
|
84
|
+
// Make the npm name unique-ish per template: e.g. "grove-astro-default"
|
|
85
|
+
return `${slug || "grove-site"}-${framework}-${templateName}`;
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Make sure a directory exists. Async wrapper around `mkdir -p`.
|
|
89
|
+
*/
|
|
90
|
+
export async function ensureDir(path) {
|
|
91
|
+
await mkdir(path, { recursive: true });
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Resolve a file path relative to the current module — handy for
|
|
95
|
+
* locating bundled assets the CLI ships with (e.g. .github templates).
|
|
96
|
+
*/
|
|
97
|
+
export function here(...parts) {
|
|
98
|
+
const url = new URL(import.meta.url);
|
|
99
|
+
return resolve(fileURLToPath(url), "..", ...parts);
|
|
100
|
+
}
|
|
101
|
+
//# sourceMappingURL=template-loader.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"template-loader.js","sourceRoot":"","sources":["../src/template-loader.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AACH,OAAO,EAAE,EAAE,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAClE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,aAAa,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,MAAM,OAAO,GAAG,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAY/C,iEAAiE;AACjE,MAAM,CAAC,MAAM,oBAAoB,GAAyB,CAAC,OAAO,EAAE,QAAQ,EAAE,QAAQ,CAAU,CAAC;AAEjG,MAAM,UAAU,WAAW,CAAC,KAAa;IACvC,OAAQ,oBAA0C,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;AACrE,CAAC;AAED,SAAS,aAAa,CAAC,SAAoB;IACzC,MAAM,GAAG,GAAG,cAAc,SAAS,EAAE,CAAC;IACtC,kEAAkE;IAClE,oEAAoE;IACpE,8CAA8C;IAC9C,IAAI,UAAkB,CAAC;IACvB,IAAI,CAAC;QACH,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,GAAG,eAAe,EAAE,EAAE,KAAK,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,CAAC,EAAE,CAAC,CAAC;IAClF,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC;YACH,UAAU,GAAG,OAAO,CAAC,OAAO,CAAC,GAAG,GAAG,eAAe,CAAC,CAA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AC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC;AACrD,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@grove-dev/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "Grove CLI — scaffolds Grove-powered spaces and orchestrates @grove-dev/core commands.",
|
|
6
|
+
"license": "MIT",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"grove",
|
|
9
|
+
"cli",
|
|
10
|
+
"scaffold",
|
|
11
|
+
"directory",
|
|
12
|
+
"community",
|
|
13
|
+
"knowledge"
|
|
14
|
+
],
|
|
15
|
+
"homepage": "https://github.com/tortuvshin/grove#readme",
|
|
16
|
+
"repository": {
|
|
17
|
+
"type": "git",
|
|
18
|
+
"url": "git+https://github.com/tortuvshin/grove.git",
|
|
19
|
+
"directory": "packages/cli"
|
|
20
|
+
},
|
|
21
|
+
"bugs": {
|
|
22
|
+
"url": "https://github.com/tortuvshin/grove/issues"
|
|
23
|
+
},
|
|
24
|
+
"publishConfig": {
|
|
25
|
+
"access": "public",
|
|
26
|
+
"registry": "https://registry.npmjs.org/"
|
|
27
|
+
},
|
|
28
|
+
"bin": {
|
|
29
|
+
"grove": "./dist/index.js"
|
|
30
|
+
},
|
|
31
|
+
"exports": {
|
|
32
|
+
".": {
|
|
33
|
+
"types": "./dist/index.d.ts",
|
|
34
|
+
"import": "./dist/index.js"
|
|
35
|
+
}
|
|
36
|
+
},
|
|
37
|
+
"files": [
|
|
38
|
+
"dist",
|
|
39
|
+
"README.md"
|
|
40
|
+
],
|
|
41
|
+
"dependencies": {
|
|
42
|
+
"@grove-dev/core": "0.1.1",
|
|
43
|
+
"commander": "^14.0.2"
|
|
44
|
+
},
|
|
45
|
+
"peerDependencies": {
|
|
46
|
+
"@grove-dev/astro": "0.1.1",
|
|
47
|
+
"@grove-dev/nextjs": "0.1.1",
|
|
48
|
+
"@grove-dev/svelte": "0.1.1"
|
|
49
|
+
},
|
|
50
|
+
"peerDependenciesMeta": {
|
|
51
|
+
"@grove-dev/astro": {
|
|
52
|
+
"optional": true
|
|
53
|
+
},
|
|
54
|
+
"@grove-dev/nextjs": {
|
|
55
|
+
"optional": true
|
|
56
|
+
},
|
|
57
|
+
"@grove-dev/svelte": {
|
|
58
|
+
"optional": true
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
"devDependencies": {
|
|
62
|
+
"tsx": "^4.21.0"
|
|
63
|
+
},
|
|
64
|
+
"scripts": {
|
|
65
|
+
"build": "tsc -p tsconfig.json",
|
|
66
|
+
"check": "tsc -p tsconfig.json --noEmit",
|
|
67
|
+
"test": "echo \"No cli package tests yet\"",
|
|
68
|
+
"dev": "tsx src/index.ts --help"
|
|
69
|
+
}
|
|
70
|
+
}
|