@grove-dev/cli 0.6.1 → 0.8.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 +192 -23
- package/dist/audit-cli.d.ts +1 -1
- package/dist/audit-cli.d.ts.map +1 -1
- package/dist/audit-cli.js +11 -11
- package/dist/audit-cli.js.map +1 -1
- package/dist/audit.d.ts +4 -4
- package/dist/audit.d.ts.map +1 -1
- package/dist/audit.js +99 -49
- package/dist/audit.js.map +1 -1
- package/dist/collection-cli.d.ts.map +1 -1
- package/dist/collection-cli.js +1 -1
- package/dist/collection-cli.js.map +1 -1
- package/dist/diff.d.ts +43 -0
- package/dist/diff.d.ts.map +1 -0
- package/dist/diff.js +70 -0
- package/dist/diff.js.map +1 -0
- package/dist/hash.d.ts +36 -0
- package/dist/hash.d.ts.map +1 -0
- package/dist/hash.js +82 -0
- package/dist/hash.js.map +1 -0
- package/dist/icons-cli.d.ts +1 -1
- package/dist/icons-cli.d.ts.map +1 -1
- package/dist/icons-cli.js +32 -14
- package/dist/icons-cli.js.map +1 -1
- package/dist/import-cli.d.ts +1 -1
- package/dist/import-cli.d.ts.map +1 -1
- package/dist/import-cli.js +6 -6
- package/dist/import-cli.js.map +1 -1
- package/dist/index.js +95 -58
- package/dist/index.js.map +1 -1
- package/dist/init.d.ts +37 -4
- package/dist/init.d.ts.map +1 -1
- package/dist/init.js +251 -57
- package/dist/init.js.map +1 -1
- package/dist/package.json +3 -2
- package/dist/r/about.json +22 -0
- package/dist/r/browse.json +89 -0
- package/dist/r/collections.json +59 -0
- package/dist/r/contributors.json +22 -0
- package/dist/r/default.json +438 -0
- package/dist/r/home.json +67 -0
- package/dist/r/not-found.json +22 -0
- package/dist/r/project-card.json +48 -0
- package/dist/r/record.json +59 -0
- package/dist/r/registry.json +903 -0
- package/dist/r/shell.json +75 -0
- package/dist/r/submit.json +28 -0
- package/dist/r/taxonomy.json +65 -0
- package/dist/r/ui.json +54 -0
- package/dist/readme-cli.d.ts +1 -1
- package/dist/readme-cli.d.ts.map +1 -1
- package/dist/readme-cli.js +84 -49
- package/dist/readme-cli.js.map +1 -1
- package/dist/registry.d.ts +74 -0
- package/dist/registry.d.ts.map +1 -0
- package/dist/registry.js +180 -0
- package/dist/registry.js.map +1 -0
- package/dist/run.d.ts +7 -0
- package/dist/run.d.ts.map +1 -0
- package/dist/run.js +20 -0
- package/dist/run.js.map +1 -0
- package/dist/unified-diff.d.ts +14 -0
- package/dist/unified-diff.d.ts.map +1 -0
- package/dist/unified-diff.js +103 -0
- package/dist/unified-diff.js.map +1 -0
- package/dist/update.d.ts +47 -0
- package/dist/update.d.ts.map +1 -0
- package/dist/update.js +231 -0
- package/dist/update.js.map +1 -0
- package/package.json +5 -4
- package/dist/site/.github/ISSUE_TEMPLATE/bug_report.md +0 -33
- package/dist/site/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
- package/dist/site/.github/ISSUE_TEMPLATE/record_submission.md +0 -48
- package/dist/site/.github/pull_request_template.md +0 -27
- package/dist/site/.github/workflows/ci.yml +0 -21
- package/dist/site/.github/workflows/cleanup.yml +0 -23
- package/dist/site/.github/workflows/deploy.yml +0 -36
- package/dist/site/.github/workflows/readme.yml +0 -41
- package/dist/site/.github/workflows/sync-contributors.yml +0 -28
- package/dist/site/.github/workflows/sync-github.yml +0 -31
- package/dist/site/README.md +0 -89
- package/dist/site/astro.config.mjs +0 -26
- package/dist/site/content/records/crewai.md +0 -898
- package/dist/site/content/records/dify.md +0 -35
- package/dist/site/content/records/flowise.md +0 -38
- package/dist/site/content/records/llamaindex.md +0 -45
- package/dist/site/content/records/ollama.md +0 -39
- package/dist/site/content/records/open-webui.md +0 -35
- package/dist/site/data/collections/top-ai-agents.yml +0 -14
- package/dist/site/data/collections/top-flutter.yml +0 -12
- package/dist/site/data/health.yml +0 -13
- package/dist/site/data/records/.gitkeep +0 -0
- package/dist/site/data/records/crewai.yml +0 -23
- package/dist/site/data/records/dify.yml +0 -23
- package/dist/site/data/records/flowise.yml +0 -23
- package/dist/site/data/records/llamaindex.yml +0 -23
- package/dist/site/data/records/ollama.yml +0 -30
- package/dist/site/data/records/open-webui.yml +0 -23
- package/dist/site/data/taxonomy/categories.yml +0 -10
- package/dist/site/data/taxonomy/distribution-channels.yml +0 -43
- package/dist/site/data/taxonomy/licenses.yml +0 -16
- package/dist/site/data/taxonomy/platforms.yml +0 -20
- package/dist/site/data/taxonomy/stacks.yml +0 -15
- package/dist/site/data/taxonomy/topics.yml +0 -29
- package/dist/site/grove.config.ts +0 -110
- package/dist/site/package.json +0 -34
- package/dist/site/public/icons/.grove-icons.json +0 -47
- package/dist/site/public/icons/platforms/android.svg +0 -1
- package/dist/site/public/icons/platforms/app.svg +0 -4
- package/dist/site/public/icons/platforms/chrome.svg +0 -1
- package/dist/site/public/icons/platforms/desktop.svg +0 -4
- package/dist/site/public/icons/platforms/embedded.svg +0 -5
- package/dist/site/public/icons/platforms/ios.svg +0 -1
- package/dist/site/public/icons/platforms/linux.svg +0 -1
- package/dist/site/public/icons/platforms/macos.svg +0 -1
- package/dist/site/public/icons/platforms/ubuntu.svg +0 -1
- package/dist/site/public/icons/platforms/web.svg +0 -5
- package/dist/site/public/icons/platforms/windows.svg +0 -1
- package/dist/site/public/icons/stacks/android.svg +0 -1
- package/dist/site/public/icons/stacks/apple.svg +0 -1
- package/dist/site/public/icons/stacks/bun.svg +0 -1
- package/dist/site/public/icons/stacks/capacitor.svg +0 -1
- package/dist/site/public/icons/stacks/clojure.svg +0 -1
- package/dist/site/public/icons/stacks/dart.svg +0 -1
- package/dist/site/public/icons/stacks/deno.svg +0 -1
- package/dist/site/public/icons/stacks/django.svg +0 -1
- package/dist/site/public/icons/stacks/docker.svg +0 -1
- package/dist/site/public/icons/stacks/firebase.svg +0 -1
- package/dist/site/public/icons/stacks/flutter.svg +0 -1
- package/dist/site/public/icons/stacks/go.svg +0 -1
- package/dist/site/public/icons/stacks/graphql.svg +0 -1
- package/dist/site/public/icons/stacks/ionic.svg +0 -1
- package/dist/site/public/icons/stacks/java.svg +0 -1
- package/dist/site/public/icons/stacks/javascript.svg +0 -1
- package/dist/site/public/icons/stacks/kotlin.svg +0 -1
- package/dist/site/public/icons/stacks/llm.svg +0 -4
- package/dist/site/public/icons/stacks/mongodb.svg +0 -1
- package/dist/site/public/icons/stacks/nodejs.svg +0 -1
- package/dist/site/public/icons/stacks/python.svg +0 -1
- package/dist/site/public/icons/stacks/rag.svg +0 -6
- package/dist/site/public/icons/stacks/react-native.svg +0 -1
- package/dist/site/public/icons/stacks/react.svg +0 -1
- package/dist/site/public/icons/stacks/rust.svg +0 -1
- package/dist/site/public/icons/stacks/solidity.svg +0 -1
- package/dist/site/public/icons/stacks/sveltekit.svg +0 -1
- package/dist/site/public/icons/stacks/swift.svg +0 -1
- package/dist/site/public/icons/stacks/tauri.svg +0 -1
- package/dist/site/public/icons/stacks/tensorflow.svg +0 -1
- package/dist/site/public/icons/stacks/typescript.svg +0 -1
- package/dist/site/public/icons/stacks/vue.svg +0 -1
- package/dist/site/public/logo.svg +0 -16
- package/dist/site/src/components/DirectoryBrowse.astro +0 -246
- package/dist/site/src/components/PipelineStrip.astro +0 -121
- package/dist/site/src/components/TaxonomyList.astro +0 -108
- package/dist/site/src/pages/404.astro +0 -63
- package/dist/site/src/pages/[slug]/[recordSlug].astro +0 -71
- package/dist/site/src/pages/[slug]/index.astro +0 -19
- package/dist/site/src/pages/[slug]/page/[page].astro +0 -32
- package/dist/site/src/pages/[slug]/page/cards.astro +0 -50
- package/dist/site/src/pages/[slug]/page/records.json.ts +0 -24
- package/dist/site/src/pages/about.astro +0 -130
- package/dist/site/src/pages/categories/[name].astro +0 -35
- package/dist/site/src/pages/categories/index.astro +0 -33
- package/dist/site/src/pages/collections/[slug].astro +0 -45
- package/dist/site/src/pages/collections/index.astro +0 -32
- package/dist/site/src/pages/contributors.astro +0 -115
- package/dist/site/src/pages/empty.astro +0 -24
- package/dist/site/src/pages/index.astro +0 -161
- package/dist/site/src/pages/licenses/[name].astro +0 -35
- package/dist/site/src/pages/stacks/[name].astro +0 -35
- package/dist/site/src/pages/stacks/index.astro +0 -35
- package/dist/site/src/pages/submit.astro +0 -183
- package/dist/site/src/styles/global.css +0 -21
- package/dist/site/tsconfig.json +0 -13
- /package/{dist/site/LICENSE → LICENSE} +0 -0
package/dist/readme-cli.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readme-cli.d.ts","sourceRoot":"","sources":["../src/readme-cli.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"readme-cli.d.ts","sourceRoot":"","sources":["../src/readme-cli.ts"],"names":[],"mappings":"AAYA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAKpC,wBAAgB,kBAAkB,IAAI,OAAO,CA0D5C"}
|
package/dist/readme-cli.js
CHANGED
|
@@ -1,30 +1,28 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
const DEFAULT_README_PATH =
|
|
1
|
+
import { readdir, readFile, writeFile } from 'node:fs/promises';
|
|
2
|
+
import { join, resolve } from 'node:path';
|
|
3
|
+
import { buildAwesomeReadme, decisionsFileSchema, healthFileSchema, injectAwesomeReadmeBlock, loadConfig, } from '@grove-dev/core';
|
|
4
|
+
import { Command } from 'commander';
|
|
5
|
+
import { parse as parseYaml } from 'yaml';
|
|
6
|
+
const DEFAULT_README_PATH = 'README.md';
|
|
7
7
|
export function buildReadmeCommand() {
|
|
8
|
-
const cmd = new Command(
|
|
9
|
-
cmd.description(
|
|
8
|
+
const cmd = new Command('readme');
|
|
9
|
+
cmd.description('Generate an awesome-list formatted README from data/records/.');
|
|
10
10
|
cmd
|
|
11
|
-
.command(
|
|
12
|
-
.description(
|
|
13
|
-
.option(
|
|
14
|
-
.option(
|
|
15
|
-
.option(
|
|
11
|
+
.command('generate')
|
|
12
|
+
.description('Render the README into the grove-managed sentinel block.')
|
|
13
|
+
.option('--stdout', 'Print to stdout instead of writing to README.md (for CI dry-runs).')
|
|
14
|
+
.option('--path <path>', 'README path relative to cwd', DEFAULT_README_PATH)
|
|
15
|
+
.option('--check', 'Exit with code 1 when the rendered block differs from the existing README.')
|
|
16
16
|
.action(async (opts) => {
|
|
17
17
|
const cwd = process.cwd();
|
|
18
18
|
const config = await loadConfig(cwd);
|
|
19
|
-
const records = await loadRecords(cwd, config
|
|
19
|
+
const records = await loadRecords(cwd, config);
|
|
20
20
|
const categories = await loadCategories(cwd, config.paths.taxonomyDir);
|
|
21
21
|
const markdown = buildAwesomeReadme({
|
|
22
22
|
site: {
|
|
23
23
|
name: config.site.name,
|
|
24
24
|
...(config.site.tagline ? { tagline: config.site.tagline } : {}),
|
|
25
|
-
...(config.site.description
|
|
26
|
-
? { description: config.site.description }
|
|
27
|
-
: {}),
|
|
25
|
+
...(config.site.description ? { description: config.site.description } : {}),
|
|
28
26
|
...(config.site.url ? { url: config.site.url } : {}),
|
|
29
27
|
...(config.site.repoUrl ? { repoUrl: config.site.repoUrl } : {}),
|
|
30
28
|
},
|
|
@@ -49,58 +47,95 @@ export function buildReadmeCommand() {
|
|
|
49
47
|
console.log(`[grove readme] ${opts.path} is up to date.`);
|
|
50
48
|
return;
|
|
51
49
|
}
|
|
52
|
-
await writeFile(readmePath, rendered,
|
|
50
|
+
await writeFile(readmePath, rendered, 'utf8');
|
|
53
51
|
console.log(`[grove readme] wrote ${opts.path} (${records.length} records, ${categories.length} categories)`);
|
|
54
52
|
});
|
|
55
53
|
return cmd;
|
|
56
54
|
}
|
|
57
55
|
async function safeRead(path) {
|
|
58
56
|
try {
|
|
59
|
-
return await readFile(path,
|
|
57
|
+
return await readFile(path, 'utf8');
|
|
60
58
|
}
|
|
61
59
|
catch (error) {
|
|
62
|
-
if (error.code ===
|
|
63
|
-
return
|
|
60
|
+
if (error.code === 'ENOENT')
|
|
61
|
+
return '';
|
|
64
62
|
throw error;
|
|
65
63
|
}
|
|
66
64
|
}
|
|
67
|
-
|
|
68
|
-
|
|
65
|
+
/**
|
|
66
|
+
* Resolve effective visibility the same way the build does.
|
|
67
|
+
*
|
|
68
|
+
* This command used to read only the record's own top-level
|
|
69
|
+
* `visibility:` field. For project records that field is not the
|
|
70
|
+
* signal the site uses — `health.visibility` is, and a
|
|
71
|
+
* `data/decisions.yml` entry overrides both. The result was that a
|
|
72
|
+
* record hidden by a curator decision still shipped in the generated
|
|
73
|
+
* README. Precedence here matches `generate()` in
|
|
74
|
+
* `@grove-dev/core`: decision, then inline health, then health.yml,
|
|
75
|
+
* then the record's own field.
|
|
76
|
+
*/
|
|
77
|
+
async function loadVisibilityResolver(cwd, config) {
|
|
78
|
+
const decisions = new Map();
|
|
79
|
+
try {
|
|
80
|
+
const parsed = decisionsFileSchema.parse(parseYaml(await readFile(resolve(cwd, config.paths.decisions), 'utf8')) ?? {});
|
|
81
|
+
const list = Array.isArray(parsed) ? parsed : parsed.decisions;
|
|
82
|
+
for (const d of list)
|
|
83
|
+
decisions.set(d.id, d.decision.visibility);
|
|
84
|
+
}
|
|
85
|
+
catch {
|
|
86
|
+
// missing or invalid decisions.yml → no overrides
|
|
87
|
+
}
|
|
88
|
+
const health = new Map();
|
|
89
|
+
try {
|
|
90
|
+
const parsed = healthFileSchema.parse(parseYaml(await readFile(resolve(cwd, config.paths.health), 'utf8')) ?? {});
|
|
91
|
+
const list = Array.isArray(parsed) ? parsed : parsed.health;
|
|
92
|
+
for (const e of list)
|
|
93
|
+
health.set(e.id, e.health.visibility);
|
|
94
|
+
}
|
|
95
|
+
catch {
|
|
96
|
+
// missing or invalid health.yml → no entries
|
|
97
|
+
}
|
|
98
|
+
return (slug, raw) => {
|
|
99
|
+
const decided = decisions.get(slug);
|
|
100
|
+
if (decided)
|
|
101
|
+
return decided;
|
|
102
|
+
const inline = raw.health?.visibility;
|
|
103
|
+
if (inline)
|
|
104
|
+
return inline;
|
|
105
|
+
const fromFile = health.get(slug);
|
|
106
|
+
if (fromFile)
|
|
107
|
+
return fromFile;
|
|
108
|
+
return typeof raw.visibility === 'string' ? raw.visibility : undefined;
|
|
109
|
+
};
|
|
110
|
+
}
|
|
111
|
+
async function loadRecords(cwd, config) {
|
|
112
|
+
const dir = resolve(cwd, config.paths.recordsDir);
|
|
113
|
+
const resolveVisibility = await loadVisibilityResolver(cwd, config);
|
|
69
114
|
const files = (await readdir(dir))
|
|
70
|
-
.filter((file) => file.endsWith(
|
|
115
|
+
.filter((file) => file.endsWith('.yml') || file.endsWith('.yaml'))
|
|
71
116
|
.sort();
|
|
72
117
|
const out = [];
|
|
73
118
|
for (const file of files) {
|
|
74
|
-
const raw = (parseYaml(await readFile(join(dir, file),
|
|
119
|
+
const raw = (parseYaml(await readFile(join(dir, file), 'utf8')) ?? {});
|
|
75
120
|
const github = raw.github ?? {};
|
|
76
121
|
const repoMeta = github.repository ?? {};
|
|
77
122
|
const links = raw.links ?? {};
|
|
78
|
-
const stars = typeof github.stars ===
|
|
123
|
+
const stars = typeof github.stars === 'number'
|
|
79
124
|
? github.stars
|
|
80
|
-
: typeof repoMeta.stargazers_count ===
|
|
125
|
+
: typeof repoMeta.stargazers_count === 'number'
|
|
81
126
|
? repoMeta.stargazers_count
|
|
82
127
|
: undefined;
|
|
83
|
-
const license = typeof github.license ===
|
|
84
|
-
? github.license
|
|
85
|
-
: undefined;
|
|
128
|
+
const license = typeof github.license === 'string' ? github.license : undefined;
|
|
86
129
|
out.push({
|
|
87
|
-
slug: typeof raw.slug ===
|
|
88
|
-
name: typeof raw.name ===
|
|
89
|
-
description: typeof raw.description ===
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
? raw.category
|
|
94
|
-
: undefined,
|
|
95
|
-
repoUrl: typeof raw.repoUrl === "string"
|
|
96
|
-
? raw.repoUrl
|
|
97
|
-
: (links.github ?? undefined),
|
|
98
|
-
homepageUrl: typeof raw.homepageUrl === "string"
|
|
130
|
+
slug: typeof raw.slug === 'string' ? raw.slug : '',
|
|
131
|
+
name: typeof raw.name === 'string' ? raw.name : undefined,
|
|
132
|
+
description: typeof raw.description === 'string' ? raw.description : undefined,
|
|
133
|
+
category: typeof raw.category === 'string' ? raw.category : undefined,
|
|
134
|
+
repoUrl: typeof raw.repoUrl === 'string' ? raw.repoUrl : (links.github ?? undefined),
|
|
135
|
+
homepageUrl: typeof raw.homepageUrl === 'string'
|
|
99
136
|
? raw.homepageUrl
|
|
100
137
|
: (links.website ?? undefined),
|
|
101
|
-
visibility: typeof raw.
|
|
102
|
-
? raw.visibility
|
|
103
|
-
: undefined,
|
|
138
|
+
visibility: resolveVisibility(typeof raw.slug === 'string' ? raw.slug : file.replace(/\.ya?ml$/, ''), raw),
|
|
104
139
|
...(stars !== undefined ? { stars } : {}),
|
|
105
140
|
...(license !== undefined ? { license } : {}),
|
|
106
141
|
});
|
|
@@ -108,12 +143,12 @@ async function loadRecords(cwd, recordsDir) {
|
|
|
108
143
|
return out;
|
|
109
144
|
}
|
|
110
145
|
async function loadCategories(cwd, taxonomyDir) {
|
|
111
|
-
const path = resolve(cwd, taxonomyDir,
|
|
112
|
-
const raw = (parseYaml(await readFile(path,
|
|
146
|
+
const path = resolve(cwd, taxonomyDir, 'categories.yml');
|
|
147
|
+
const raw = (parseYaml(await readFile(path, 'utf8')) ?? []);
|
|
113
148
|
return raw
|
|
114
149
|
.map((entry) => ({
|
|
115
|
-
id: typeof entry.id ===
|
|
116
|
-
name: typeof entry.name ===
|
|
150
|
+
id: typeof entry.id === 'string' ? entry.id : '',
|
|
151
|
+
name: typeof entry.name === 'string' ? entry.name : '',
|
|
117
152
|
}))
|
|
118
153
|
.filter((entry) => entry.id && entry.name);
|
|
119
154
|
}
|
package/dist/readme-cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"readme-cli.js","sourceRoot":"","sources":["../src/readme-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"read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G,CAAC;AACb,CAAC;AAED,KAAK,UAAU,cAAc,CAAC,GAAW,EAAE,WAAmB;IAC5D,MAAM,IAAI,GAAG,OAAO,CAAC,GAAG,EAAE,WAAW,EAAE,gBAAgB,CAAC,CAAC;IACzD,MAAM,GAAG,GAAG,CAAC,SAAS,CAAC,MAAM,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,IAAI,EAAE,CAAmC,CAAC;IAC9F,OAAO,GAAG;SACP,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;QACf,EAAE,EAAE,OAAO,KAAK,CAAC,EAAE,KAAK,QAAQ,CAAC,CAAC,CAAE,KAAK,CAAC,EAAa,CAAC,CAAC,CAAC,EAAE;QAC5D,IAAI,EAAE,OAAO,KAAK,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAE,KAAK,CAAC,IAAe,CAAC,CAAC,CAAC,EAAE;KACnE,CAAC,CAAC;SACF,MAAM,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC;AAC/C,CAAC"}
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import { type LockfileFile, type RegistryLockfile } from './hash.js';
|
|
2
|
+
/** The registry namespace consumers configure in `components.json`. */
|
|
3
|
+
export declare const REGISTRY_NAMESPACE = "@grove";
|
|
4
|
+
/** Where the built items are served; `{name}` is the shadcn placeholder. */
|
|
5
|
+
export declare const REGISTRY_URL_TEMPLATE = "https://withgrove.dev/r/{name}.json";
|
|
6
|
+
/** The shadcn CLI release `grove init` drives. Pinned: item install behavior is version-specific. */
|
|
7
|
+
export declare const SHADCN_VERSION = "4.19.0";
|
|
8
|
+
/** The generated full-scaffold item. */
|
|
9
|
+
export declare const SCAFFOLD_ITEM = "default";
|
|
10
|
+
/** What `.grove/registry.lock.json` records as `scaffold`. */
|
|
11
|
+
export declare const SCAFFOLD_ID = "@grove/default";
|
|
12
|
+
export interface RegistryItemFile {
|
|
13
|
+
/** Path inside the registry source tree (`default/components/ui/badge.astro`). */
|
|
14
|
+
path: string;
|
|
15
|
+
type: string;
|
|
16
|
+
/** Install location; `~/` is the consumer's project root. */
|
|
17
|
+
target: string;
|
|
18
|
+
/** Full file content, inlined by `shadcn build`. */
|
|
19
|
+
content: string;
|
|
20
|
+
}
|
|
21
|
+
/** A built registry item (`dist/r/<name>.json`, official registry-item schema). */
|
|
22
|
+
export interface RegistryItem {
|
|
23
|
+
name: string;
|
|
24
|
+
type: string;
|
|
25
|
+
title?: string;
|
|
26
|
+
description?: string;
|
|
27
|
+
dependencies?: string[];
|
|
28
|
+
registryDependencies?: string[];
|
|
29
|
+
meta?: {
|
|
30
|
+
version?: string;
|
|
31
|
+
};
|
|
32
|
+
files: RegistryItemFile[];
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Locate a built item in the copy the CLI ships beside its own code.
|
|
36
|
+
*
|
|
37
|
+
* `@grove-dev/registry` is a workspace build unit, not a published
|
|
38
|
+
* package — nothing installs it, and consumers never import it. The
|
|
39
|
+
* CLI's build step copies `packages/registry/dist/r/` to
|
|
40
|
+
* `packages/cli/dist/r/`, so the scaffold travels inside the CLI
|
|
41
|
+
* tarball and `grove init` works offline.
|
|
42
|
+
*/
|
|
43
|
+
export declare function resolveBundledItemPath(name?: string): string;
|
|
44
|
+
/**
|
|
45
|
+
* Load and validate a built registry item from a local path or an
|
|
46
|
+
* http(s) URL. Every file must carry inlined `content` and a `target`
|
|
47
|
+
* — that is what `shadcn build` emits, and what both install paths
|
|
48
|
+
* need; a hand-written item without them is rejected up front.
|
|
49
|
+
*/
|
|
50
|
+
export declare function loadItem(source: string): Promise<RegistryItem>;
|
|
51
|
+
/** `~/src/components/ui/button.astro` → `src/components/ui/button.astro` */
|
|
52
|
+
export declare function targetToProjectPath(target: string): string;
|
|
53
|
+
/**
|
|
54
|
+
* Lockfile entries for an item, sorted by target — the same shape and
|
|
55
|
+
* digest `scripts/lib/registry.mjs` computes for the example app.
|
|
56
|
+
*/
|
|
57
|
+
export declare function itemLockEntries(item: RegistryItem): LockfileFile[];
|
|
58
|
+
export declare function buildLockfile(item: RegistryItem): RegistryLockfile;
|
|
59
|
+
/**
|
|
60
|
+
* Write an item's files into a project, verbatim. `grove update` uses
|
|
61
|
+
* this to apply the files its plan says are safe (`only` = those
|
|
62
|
+
* project-relative targets); tests use it as a no-network stand-in
|
|
63
|
+
* for `shadcn add`. Returns the project-relative paths written.
|
|
64
|
+
*/
|
|
65
|
+
export declare function writeItemFiles(item: RegistryItem, cwd: string, options?: {
|
|
66
|
+
only?: Set<string>;
|
|
67
|
+
}): Promise<string[]>;
|
|
68
|
+
/**
|
|
69
|
+
* The `@grove` registry URL template from the project's
|
|
70
|
+
* `components.json`, or null when the file or the entry is absent.
|
|
71
|
+
* shadcn accepts either a bare string or `{ url, headers? }`.
|
|
72
|
+
*/
|
|
73
|
+
export declare function resolveRegistryTemplate(cwd: string): Promise<string | null>;
|
|
74
|
+
//# sourceMappingURL=registry.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.d.ts","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AA6BA,OAAO,EAAE,KAAK,YAAY,EAAE,KAAK,gBAAgB,EAAU,MAAM,WAAW,CAAC;AAE7E,uEAAuE;AACvE,eAAO,MAAM,kBAAkB,WAAW,CAAC;AAC3C,4EAA4E;AAC5E,eAAO,MAAM,qBAAqB,wCAAwC,CAAC;AAC3E,qGAAqG;AACrG,eAAO,MAAM,cAAc,WAAW,CAAC;AACvC,wCAAwC;AACxC,eAAO,MAAM,aAAa,YAAY,CAAC;AACvC,8DAA8D;AAC9D,eAAO,MAAM,WAAW,mBAA2C,CAAC;AAEpE,MAAM,WAAW,gBAAgB;IAC/B,kFAAkF;IAClF,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,6DAA6D;IAC7D,MAAM,EAAE,MA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
2
|
+
/**
|
|
3
|
+
* The CLI's view of the Grove UI registry.
|
|
4
|
+
*
|
|
5
|
+
* Grove's UI ships as an ordinary shadcn registry (built from
|
|
6
|
+
* `packages/registry`, a workspace-private build unit):
|
|
7
|
+
* hand-authored `registry.json`, built by the official `shadcn build`
|
|
8
|
+
* into one JSON document per item with every file's content inlined.
|
|
9
|
+
* The full scaffold — every item in the registry, in one block — is
|
|
10
|
+
* the generated `default` item. That single document is what both
|
|
11
|
+
* `grove init` and `grove update` consume:
|
|
12
|
+
*
|
|
13
|
+
* grove init → `shadcn add <path to default.json>` installs it,
|
|
14
|
+
* then this module records the install-time hashes
|
|
15
|
+
* in `.grove/registry.lock.json`.
|
|
16
|
+
* grove update → loads the upstream `default` item (a URL, a path,
|
|
17
|
+
* or the copy bundled inside the CLI itself),
|
|
18
|
+
* three-way diffs it against the lockfile and disk,
|
|
19
|
+
* and writes the safe subset of files itself.
|
|
20
|
+
*
|
|
21
|
+
* The lockfile shape and hash format are shared with the monorepo's
|
|
22
|
+
* `scripts/lib/registry.mjs` (which maintains the example app's copy)
|
|
23
|
+
* — the two must agree byte-for-byte or `grove update` reports
|
|
24
|
+
* phantom drift.
|
|
25
|
+
*/
|
|
26
|
+
import { existsSync } from 'node:fs';
|
|
27
|
+
import { mkdir, readFile, writeFile } from 'node:fs/promises';
|
|
28
|
+
import { dirname, isAbsolute, join, resolve } from 'node:path';
|
|
29
|
+
import { fileURLToPath } from 'node:url';
|
|
30
|
+
import { sha256 } from './hash.js';
|
|
31
|
+
/** The registry namespace consumers configure in `components.json`. */
|
|
32
|
+
export const REGISTRY_NAMESPACE = '@grove';
|
|
33
|
+
/** Where the built items are served; `{name}` is the shadcn placeholder. */
|
|
34
|
+
export const REGISTRY_URL_TEMPLATE = 'https://withgrove.dev/r/{name}.json';
|
|
35
|
+
/** The shadcn CLI release `grove init` drives. Pinned: item install behavior is version-specific. */
|
|
36
|
+
export const SHADCN_VERSION = '4.19.0';
|
|
37
|
+
/** The generated full-scaffold item. */
|
|
38
|
+
export const SCAFFOLD_ITEM = 'default';
|
|
39
|
+
/** What `.grove/registry.lock.json` records as `scaffold`. */
|
|
40
|
+
export const SCAFFOLD_ID = `${REGISTRY_NAMESPACE}/${SCAFFOLD_ITEM}`;
|
|
41
|
+
/**
|
|
42
|
+
* Locate a built item in the copy the CLI ships beside its own code.
|
|
43
|
+
*
|
|
44
|
+
* `@grove-dev/registry` is a workspace build unit, not a published
|
|
45
|
+
* package — nothing installs it, and consumers never import it. The
|
|
46
|
+
* CLI's build step copies `packages/registry/dist/r/` to
|
|
47
|
+
* `packages/cli/dist/r/`, so the scaffold travels inside the CLI
|
|
48
|
+
* tarball and `grove init` works offline.
|
|
49
|
+
*/
|
|
50
|
+
export function resolveBundledItemPath(name = SCAFFOLD_ITEM) {
|
|
51
|
+
const here = dirname(fileURLToPath(import.meta.url));
|
|
52
|
+
const candidates = [
|
|
53
|
+
// Published / built: dist/index.js sits beside dist/r/.
|
|
54
|
+
join(here, 'r', `${name}.json`),
|
|
55
|
+
// Running from source (vitest, tsx): src/ has no r/, dist/ does.
|
|
56
|
+
join(here, '..', 'dist', 'r', `${name}.json`),
|
|
57
|
+
// Monorepo source before the CLI has been rebuilt.
|
|
58
|
+
join(here, '..', '..', 'registry', 'dist', 'r', `${name}.json`),
|
|
59
|
+
];
|
|
60
|
+
const found = candidates.find((candidate) => existsSync(candidate));
|
|
61
|
+
if (!found) {
|
|
62
|
+
throw new Error(`Registry item "${name}" is not bundled with this CLI. Looked in:\n` +
|
|
63
|
+
candidates.map((candidate) => ` ${candidate}`).join('\n') +
|
|
64
|
+
'\nIn the Grove monorepo run `pnpm registry:build`; otherwise reinstall @grove-dev/cli.');
|
|
65
|
+
}
|
|
66
|
+
return found;
|
|
67
|
+
}
|
|
68
|
+
function isUrl(source) {
|
|
69
|
+
return /^https?:\/\//.test(source);
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Load and validate a built registry item from a local path or an
|
|
73
|
+
* http(s) URL. Every file must carry inlined `content` and a `target`
|
|
74
|
+
* — that is what `shadcn build` emits, and what both install paths
|
|
75
|
+
* need; a hand-written item without them is rejected up front.
|
|
76
|
+
*/
|
|
77
|
+
export async function loadItem(source) {
|
|
78
|
+
let raw;
|
|
79
|
+
if (isUrl(source)) {
|
|
80
|
+
const response = await fetch(source);
|
|
81
|
+
if (!response.ok) {
|
|
82
|
+
throw new Error(`Could not fetch registry item ${source}: HTTP ${response.status}`);
|
|
83
|
+
}
|
|
84
|
+
raw = await response.text();
|
|
85
|
+
}
|
|
86
|
+
else {
|
|
87
|
+
raw = await readFile(isAbsolute(source) ? source : resolve(source), 'utf8');
|
|
88
|
+
}
|
|
89
|
+
let parsed;
|
|
90
|
+
try {
|
|
91
|
+
parsed = JSON.parse(raw);
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
throw new Error(`Registry item ${source} is not valid JSON.`);
|
|
95
|
+
}
|
|
96
|
+
const item = parsed;
|
|
97
|
+
if (typeof item.name !== 'string' || !Array.isArray(item.files)) {
|
|
98
|
+
throw new Error(`Registry item ${source} is missing "name" or "files".`);
|
|
99
|
+
}
|
|
100
|
+
for (const file of item.files) {
|
|
101
|
+
if (typeof file.content !== 'string') {
|
|
102
|
+
throw new Error(`Registry item ${source}: ${file.path ?? 'a file'} has no inlined content (was it built with \`shadcn build\`?).`);
|
|
103
|
+
}
|
|
104
|
+
if (typeof file.target !== 'string' || file.target.length === 0) {
|
|
105
|
+
throw new Error(`Registry item ${source}: ${file.path ?? 'a file'} has no target.`);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
return item;
|
|
109
|
+
}
|
|
110
|
+
/** `~/src/components/ui/button.astro` → `src/components/ui/button.astro` */
|
|
111
|
+
export function targetToProjectPath(target) {
|
|
112
|
+
return target.replace(/^~\//, '');
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Lockfile entries for an item, sorted by target — the same shape and
|
|
116
|
+
* digest `scripts/lib/registry.mjs` computes for the example app.
|
|
117
|
+
*/
|
|
118
|
+
export function itemLockEntries(item) {
|
|
119
|
+
return item.files
|
|
120
|
+
.map((file) => ({
|
|
121
|
+
target: targetToProjectPath(file.target),
|
|
122
|
+
source: file.path,
|
|
123
|
+
hash: sha256(file.content),
|
|
124
|
+
bytes: Buffer.byteLength(file.content, 'utf8'),
|
|
125
|
+
}))
|
|
126
|
+
.sort((a, b) => a.target.localeCompare(b.target));
|
|
127
|
+
}
|
|
128
|
+
export function buildLockfile(item) {
|
|
129
|
+
const files = itemLockEntries(item);
|
|
130
|
+
return {
|
|
131
|
+
scaffold: SCAFFOLD_ID,
|
|
132
|
+
scaffoldVersion: item.meta?.version ?? '0.0.0',
|
|
133
|
+
installedAt: new Date().toISOString().slice(0, 10),
|
|
134
|
+
fileCount: files.length,
|
|
135
|
+
files,
|
|
136
|
+
};
|
|
137
|
+
}
|
|
138
|
+
/**
|
|
139
|
+
* Write an item's files into a project, verbatim. `grove update` uses
|
|
140
|
+
* this to apply the files its plan says are safe (`only` = those
|
|
141
|
+
* project-relative targets); tests use it as a no-network stand-in
|
|
142
|
+
* for `shadcn add`. Returns the project-relative paths written.
|
|
143
|
+
*/
|
|
144
|
+
export async function writeItemFiles(item, cwd, options = {}) {
|
|
145
|
+
const written = [];
|
|
146
|
+
for (const file of item.files) {
|
|
147
|
+
const projectPath = targetToProjectPath(file.target);
|
|
148
|
+
if (options.only && !options.only.has(projectPath))
|
|
149
|
+
continue;
|
|
150
|
+
const dest = join(cwd, projectPath);
|
|
151
|
+
await mkdir(dirname(dest), { recursive: true });
|
|
152
|
+
await writeFile(dest, file.content, 'utf8');
|
|
153
|
+
written.push(projectPath);
|
|
154
|
+
}
|
|
155
|
+
return written;
|
|
156
|
+
}
|
|
157
|
+
/**
|
|
158
|
+
* The `@grove` registry URL template from the project's
|
|
159
|
+
* `components.json`, or null when the file or the entry is absent.
|
|
160
|
+
* shadcn accepts either a bare string or `{ url, headers? }`.
|
|
161
|
+
*/
|
|
162
|
+
export async function resolveRegistryTemplate(cwd) {
|
|
163
|
+
let raw;
|
|
164
|
+
try {
|
|
165
|
+
raw = await readFile(join(cwd, 'components.json'), 'utf8');
|
|
166
|
+
}
|
|
167
|
+
catch (err) {
|
|
168
|
+
if (err.code === 'ENOENT')
|
|
169
|
+
return null;
|
|
170
|
+
throw err;
|
|
171
|
+
}
|
|
172
|
+
const config = JSON.parse(raw);
|
|
173
|
+
const entry = config.registries?.[REGISTRY_NAMESPACE];
|
|
174
|
+
if (typeof entry === 'string')
|
|
175
|
+
return entry;
|
|
176
|
+
if (entry && typeof entry.url === 'string')
|
|
177
|
+
return entry.url;
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
//# sourceMappingURL=registry.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"registry.js","sourceRoot":"","sources":["../src/registry.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,OAAO,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC;AACrC,OAAO,EAAE,KAAK,EAAE,QAAQ,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAC9D,OAAO,EAAE,OAAO,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC/D,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAA4C,MAAM,EAAE,MAAM,WAAW,CAAC;AAE7E,uEAAuE;AACvE,MAAM,CAAC,MAAM,kBAAkB,GAAG,QAAQ,CAAC;AAC3C,4EAA4E;AAC5E,MAAM,CAAC,MAAM,qBAAqB,GAAG,qCAAqC,CAAC;AAC3E,qGAAqG;AACrG,MAAM,CAAC,MAAM,cAAc,GAAG,QAAQ,CAAC;AACvC,wCAAwC;AACxC,MAAM,CAAC,MAAM,aAAa,GAAG,SAAS,CAAC;AACvC,8DAA8D;AAC9D,MAAM,CAAC,MAAM,WAA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O,KAAK,CAAC,GAAG,CAAC;IAC7D,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/run.d.ts
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Run a child process with inherited stdio and resolve when it exits 0.
|
|
3
|
+
* Shared by the CLI's subcommands (`pnpm install`, `git init`,
|
|
4
|
+
* `astro check`) and by `grove init`'s `shadcn add` step.
|
|
5
|
+
*/
|
|
6
|
+
export declare function run(command: string, args: string[], cwd?: string): Promise<void>;
|
|
7
|
+
//# sourceMappingURL=run.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.d.ts","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,wBAAgB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,EAAE,GAAG,SAAgB,GAAG,OAAO,CAAC,IAAI,CAAC,CASvF"}
|
package/dist/run.js
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
// SPDX-License-Identifier: MIT
|
|
2
|
+
import { spawn } from 'node:child_process';
|
|
3
|
+
/**
|
|
4
|
+
* Run a child process with inherited stdio and resolve when it exits 0.
|
|
5
|
+
* Shared by the CLI's subcommands (`pnpm install`, `git init`,
|
|
6
|
+
* `astro check`) and by `grove init`'s `shadcn add` step.
|
|
7
|
+
*/
|
|
8
|
+
export function run(command, args, cwd = process.cwd()) {
|
|
9
|
+
return new Promise((resolvePromise, reject) => {
|
|
10
|
+
const child = spawn(command, args, { cwd, stdio: 'inherit', shell: false });
|
|
11
|
+
child.once('error', reject);
|
|
12
|
+
child.once('exit', (code, signal) => {
|
|
13
|
+
if (code === 0)
|
|
14
|
+
resolvePromise();
|
|
15
|
+
else
|
|
16
|
+
reject(new Error(`${command} exited with ${signal ?? code ?? 'unknown status'}`));
|
|
17
|
+
});
|
|
18
|
+
});
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=run.js.map
|
package/dist/run.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"run.js","sourceRoot":"","sources":["../src/run.ts"],"names":[],"mappings":"AAAA,+BAA+B;AAC/B,OAAO,EAAE,KAAK,EAAE,MAAM,oBAAoB,CAAC;AAE3C;;;;GAIG;AACH,MAAM,UAAU,GAAG,CAAC,OAAe,EAAE,IAAc,EAAE,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE;IACtE,OAAO,IAAI,OAAO,CAAC,CAAC,cAAc,EAAE,MAAM,EAAE,EAAE;QAC5C,MAAM,KAAK,GAAG,KAAK,CAAC,OAAO,EAAE,IAAI,EAAE,EAAE,GAAG,EAAE,KAAK,EAAE,SAAS,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;QAC5E,KAAK,CAAC,IAAI,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;QAC5B,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE;YAClC,IAAI,IAAI,KAAK,CAAC;gBAAE,cAAc,EAAE,CAAC;;gBAC5B,MAAM,CAAC,IAAI,KAAK,CAAC,GAAG,OAAO,gBAAgB,MAAM,IAAI,IAAI,IAAI,gBAAgB,EAAE,CAAC,CAAC,CAAC;QACzF,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A minimal unified diff, used by `grove update --diff` to show what an
|
|
3
|
+
* upstream change would do to a file before it is applied.
|
|
4
|
+
*
|
|
5
|
+
* The CLI has no diff dependency and does not want one for this: the
|
|
6
|
+
* inputs are two versions of one source file, always small enough that a
|
|
7
|
+
* plain longest-common-subsequence table is the right trade.
|
|
8
|
+
*/
|
|
9
|
+
/**
|
|
10
|
+
* Render a unified diff of `before` → `after`. Returns an empty string
|
|
11
|
+
* when the two are identical, so callers can skip a file with one check.
|
|
12
|
+
*/
|
|
13
|
+
export declare function unifiedDiff(before: string, after: string, label: string): string;
|
|
14
|
+
//# sourceMappingURL=unified-diff.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unified-diff.d.ts","sourceRoot":"","sources":["../src/unified-diff.ts"],"names":[],"mappings":"AACA;;;;;;;GAOG;AA6DH;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAgChF"}
|