@grove-dev/cli 0.7.0 → 0.9.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.
Files changed (187) hide show
  1. package/README.md +53 -13
  2. package/dist/audit-cli.d.ts +1 -1
  3. package/dist/audit-cli.d.ts.map +1 -1
  4. package/dist/audit-cli.js +11 -11
  5. package/dist/audit-cli.js.map +1 -1
  6. package/dist/audit.d.ts +4 -4
  7. package/dist/audit.d.ts.map +1 -1
  8. package/dist/audit.js +91 -51
  9. package/dist/audit.js.map +1 -1
  10. package/dist/collection-cli.d.ts.map +1 -1
  11. package/dist/collection-cli.js +1 -1
  12. package/dist/collection-cli.js.map +1 -1
  13. package/dist/diff.d.ts +43 -0
  14. package/dist/diff.d.ts.map +1 -0
  15. package/dist/diff.js +70 -0
  16. package/dist/diff.js.map +1 -0
  17. package/dist/hash.d.ts +36 -0
  18. package/dist/hash.d.ts.map +1 -0
  19. package/dist/hash.js +82 -0
  20. package/dist/hash.js.map +1 -0
  21. package/dist/health-cli.d.ts +3 -0
  22. package/dist/health-cli.d.ts.map +1 -0
  23. package/dist/health-cli.js +15 -0
  24. package/dist/health-cli.js.map +1 -0
  25. package/dist/health.d.ts +7 -0
  26. package/dist/health.d.ts.map +1 -0
  27. package/dist/health.js +68 -0
  28. package/dist/health.js.map +1 -0
  29. package/dist/icons-cli.d.ts +1 -1
  30. package/dist/icons-cli.d.ts.map +1 -1
  31. package/dist/icons-cli.js +33 -14
  32. package/dist/icons-cli.js.map +1 -1
  33. package/dist/import-cli.d.ts +1 -1
  34. package/dist/import-cli.d.ts.map +1 -1
  35. package/dist/import-cli.js +6 -6
  36. package/dist/import-cli.js.map +1 -1
  37. package/dist/index.js +114 -70
  38. package/dist/index.js.map +1 -1
  39. package/dist/init.d.ts +52 -4
  40. package/dist/init.d.ts.map +1 -1
  41. package/dist/init.js +378 -57
  42. package/dist/init.js.map +1 -1
  43. package/dist/package-manager.d.ts +57 -0
  44. package/dist/package-manager.d.ts.map +1 -0
  45. package/dist/package-manager.js +157 -0
  46. package/dist/package-manager.js.map +1 -0
  47. package/dist/package.json +3 -2
  48. package/dist/r/about.json +23 -0
  49. package/dist/r/browse.json +90 -0
  50. package/dist/r/collections.json +60 -0
  51. package/dist/r/contributors.json +23 -0
  52. package/dist/r/default.json +439 -0
  53. package/dist/r/home.json +68 -0
  54. package/dist/r/not-found.json +23 -0
  55. package/dist/r/project-card.json +49 -0
  56. package/dist/r/record.json +60 -0
  57. package/dist/r/registry.json +916 -0
  58. package/dist/r/shell.json +76 -0
  59. package/dist/r/submit.json +29 -0
  60. package/dist/r/taxonomy.json +66 -0
  61. package/dist/r/ui.json +55 -0
  62. package/dist/readme-cli.d.ts +1 -1
  63. package/dist/readme-cli.d.ts.map +1 -1
  64. package/dist/readme-cli.js +37 -47
  65. package/dist/readme-cli.js.map +1 -1
  66. package/dist/registry.d.ts +80 -0
  67. package/dist/registry.d.ts.map +1 -0
  68. package/dist/registry.js +180 -0
  69. package/dist/registry.js.map +1 -0
  70. package/dist/run.d.ts +7 -0
  71. package/dist/run.d.ts.map +1 -0
  72. package/dist/run.js +20 -0
  73. package/dist/run.js.map +1 -0
  74. package/dist/unified-diff.d.ts +14 -0
  75. package/dist/unified-diff.d.ts.map +1 -0
  76. package/dist/unified-diff.js +103 -0
  77. package/dist/unified-diff.js.map +1 -0
  78. package/dist/update.d.ts +66 -0
  79. package/dist/update.d.ts.map +1 -0
  80. package/dist/update.js +311 -0
  81. package/dist/update.js.map +1 -0
  82. package/package.json +5 -4
  83. package/dist/site/.github/ISSUE_TEMPLATE/bug_report.md +0 -33
  84. package/dist/site/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  85. package/dist/site/.github/ISSUE_TEMPLATE/record_submission.md +0 -48
  86. package/dist/site/.github/pull_request_template.md +0 -27
  87. package/dist/site/.github/workflows/ci.yml +0 -21
  88. package/dist/site/.github/workflows/cleanup.yml +0 -27
  89. package/dist/site/.github/workflows/deploy.yml +0 -36
  90. package/dist/site/.github/workflows/readme.yml +0 -41
  91. package/dist/site/.github/workflows/sync-contributors.yml +0 -28
  92. package/dist/site/.github/workflows/sync-github.yml +0 -31
  93. package/dist/site/README.md +0 -89
  94. package/dist/site/astro.config.mjs +0 -26
  95. package/dist/site/content/records/crewai.md +0 -898
  96. package/dist/site/content/records/dify.md +0 -35
  97. package/dist/site/content/records/flowise.md +0 -38
  98. package/dist/site/content/records/llamaindex.md +0 -45
  99. package/dist/site/content/records/ollama.md +0 -39
  100. package/dist/site/content/records/open-webui.md +0 -35
  101. package/dist/site/data/collections/top-ai-agents.yml +0 -14
  102. package/dist/site/data/collections/top-flutter.yml +0 -12
  103. package/dist/site/data/health.yml +0 -13
  104. package/dist/site/data/records/.gitkeep +0 -0
  105. package/dist/site/data/records/crewai.yml +0 -23
  106. package/dist/site/data/records/dify.yml +0 -23
  107. package/dist/site/data/records/flowise.yml +0 -23
  108. package/dist/site/data/records/llamaindex.yml +0 -23
  109. package/dist/site/data/records/ollama.yml +0 -30
  110. package/dist/site/data/records/open-webui.yml +0 -23
  111. package/dist/site/data/taxonomy/categories.yml +0 -10
  112. package/dist/site/data/taxonomy/distribution-channels.yml +0 -43
  113. package/dist/site/data/taxonomy/licenses.yml +0 -16
  114. package/dist/site/data/taxonomy/platforms.yml +0 -20
  115. package/dist/site/data/taxonomy/stacks.yml +0 -15
  116. package/dist/site/data/taxonomy/topics.yml +0 -29
  117. package/dist/site/grove.config.ts +0 -110
  118. package/dist/site/package.json +0 -34
  119. package/dist/site/public/icons/.grove-icons.json +0 -47
  120. package/dist/site/public/icons/platforms/android.svg +0 -1
  121. package/dist/site/public/icons/platforms/app.svg +0 -4
  122. package/dist/site/public/icons/platforms/chrome.svg +0 -1
  123. package/dist/site/public/icons/platforms/desktop.svg +0 -4
  124. package/dist/site/public/icons/platforms/embedded.svg +0 -5
  125. package/dist/site/public/icons/platforms/ios.svg +0 -1
  126. package/dist/site/public/icons/platforms/linux.svg +0 -1
  127. package/dist/site/public/icons/platforms/macos.svg +0 -1
  128. package/dist/site/public/icons/platforms/ubuntu.svg +0 -1
  129. package/dist/site/public/icons/platforms/web.svg +0 -5
  130. package/dist/site/public/icons/platforms/windows.svg +0 -1
  131. package/dist/site/public/icons/stacks/android.svg +0 -1
  132. package/dist/site/public/icons/stacks/apple.svg +0 -1
  133. package/dist/site/public/icons/stacks/bun.svg +0 -1
  134. package/dist/site/public/icons/stacks/capacitor.svg +0 -1
  135. package/dist/site/public/icons/stacks/clojure.svg +0 -1
  136. package/dist/site/public/icons/stacks/dart.svg +0 -1
  137. package/dist/site/public/icons/stacks/deno.svg +0 -1
  138. package/dist/site/public/icons/stacks/django.svg +0 -1
  139. package/dist/site/public/icons/stacks/docker.svg +0 -1
  140. package/dist/site/public/icons/stacks/firebase.svg +0 -1
  141. package/dist/site/public/icons/stacks/flutter.svg +0 -1
  142. package/dist/site/public/icons/stacks/go.svg +0 -1
  143. package/dist/site/public/icons/stacks/graphql.svg +0 -1
  144. package/dist/site/public/icons/stacks/ionic.svg +0 -1
  145. package/dist/site/public/icons/stacks/java.svg +0 -1
  146. package/dist/site/public/icons/stacks/javascript.svg +0 -1
  147. package/dist/site/public/icons/stacks/kotlin.svg +0 -1
  148. package/dist/site/public/icons/stacks/llm.svg +0 -4
  149. package/dist/site/public/icons/stacks/mongodb.svg +0 -1
  150. package/dist/site/public/icons/stacks/nodejs.svg +0 -1
  151. package/dist/site/public/icons/stacks/python.svg +0 -1
  152. package/dist/site/public/icons/stacks/rag.svg +0 -6
  153. package/dist/site/public/icons/stacks/react-native.svg +0 -1
  154. package/dist/site/public/icons/stacks/react.svg +0 -1
  155. package/dist/site/public/icons/stacks/rust.svg +0 -1
  156. package/dist/site/public/icons/stacks/solidity.svg +0 -1
  157. package/dist/site/public/icons/stacks/sveltekit.svg +0 -1
  158. package/dist/site/public/icons/stacks/swift.svg +0 -1
  159. package/dist/site/public/icons/stacks/tauri.svg +0 -1
  160. package/dist/site/public/icons/stacks/tensorflow.svg +0 -1
  161. package/dist/site/public/icons/stacks/typescript.svg +0 -1
  162. package/dist/site/public/icons/stacks/vue.svg +0 -1
  163. package/dist/site/public/logo.svg +0 -16
  164. package/dist/site/src/components/DirectoryBrowse.astro +0 -246
  165. package/dist/site/src/components/PipelineStrip.astro +0 -121
  166. package/dist/site/src/components/TaxonomyList.astro +0 -108
  167. package/dist/site/src/pages/404.astro +0 -63
  168. package/dist/site/src/pages/[slug]/[recordSlug].astro +0 -71
  169. package/dist/site/src/pages/[slug]/index.astro +0 -19
  170. package/dist/site/src/pages/[slug]/page/[page].astro +0 -32
  171. package/dist/site/src/pages/[slug]/page/cards.astro +0 -50
  172. package/dist/site/src/pages/[slug]/page/records.json.ts +0 -24
  173. package/dist/site/src/pages/about.astro +0 -130
  174. package/dist/site/src/pages/categories/[name].astro +0 -35
  175. package/dist/site/src/pages/categories/index.astro +0 -33
  176. package/dist/site/src/pages/collections/[slug].astro +0 -45
  177. package/dist/site/src/pages/collections/index.astro +0 -32
  178. package/dist/site/src/pages/contributors.astro +0 -115
  179. package/dist/site/src/pages/empty.astro +0 -24
  180. package/dist/site/src/pages/index.astro +0 -161
  181. package/dist/site/src/pages/licenses/[name].astro +0 -35
  182. package/dist/site/src/pages/stacks/[name].astro +0 -35
  183. package/dist/site/src/pages/stacks/index.astro +0 -35
  184. package/dist/site/src/pages/submit.astro +0 -183
  185. package/dist/site/src/styles/global.css +0 -21
  186. package/dist/site/tsconfig.json +0 -13
  187. /package/{dist/site/LICENSE → LICENSE} +0 -0
@@ -1,3 +1,3 @@
1
- import { Command } from "commander";
1
+ import { Command } from 'commander';
2
2
  export declare function buildReadmeCommand(): Command;
3
3
  //# sourceMappingURL=readme-cli.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"readme-cli.d.ts","sourceRoot":"","sources":["../src/readme-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAiBpC,wBAAgB,kBAAkB,IAAI,OAAO,CA2E5C"}
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"}
@@ -1,18 +1,18 @@
1
- import { Command } from "commander";
2
- import { readFile, readdir, writeFile } from "node:fs/promises";
3
- import { join, resolve } from "node:path";
4
- import { parse as parseYaml } from "yaml";
5
- import { buildAwesomeReadme, decisionsFileSchema, healthFileSchema, injectAwesomeReadmeBlock, loadConfig, } from "@grove-dev/core";
6
- const DEFAULT_README_PATH = "README.md";
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("readme");
9
- cmd.description("Generate an awesome-list formatted README from data/records/.");
8
+ const cmd = new Command('readme');
9
+ cmd.description('Generate an awesome-list formatted README from data/records/.');
10
10
  cmd
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.")
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);
@@ -22,9 +22,7 @@ export function buildReadmeCommand() {
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,18 +47,18 @@ 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, "utf8");
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, "utf8");
57
+ return await readFile(path, 'utf8');
60
58
  }
61
59
  catch (error) {
62
- if (error.code === "ENOENT")
63
- return "";
60
+ if (error.code === 'ENOENT')
61
+ return '';
64
62
  throw error;
65
63
  }
66
64
  }
@@ -79,7 +77,7 @@ async function safeRead(path) {
79
77
  async function loadVisibilityResolver(cwd, config) {
80
78
  const decisions = new Map();
81
79
  try {
82
- const parsed = decisionsFileSchema.parse(parseYaml(await readFile(resolve(cwd, config.paths.decisions), "utf8")) ?? {});
80
+ const parsed = decisionsFileSchema.parse(parseYaml(await readFile(resolve(cwd, config.paths.decisions), 'utf8')) ?? {});
83
81
  const list = Array.isArray(parsed) ? parsed : parsed.decisions;
84
82
  for (const d of list)
85
83
  decisions.set(d.id, d.decision.visibility);
@@ -89,7 +87,7 @@ async function loadVisibilityResolver(cwd, config) {
89
87
  }
90
88
  const health = new Map();
91
89
  try {
92
- const parsed = healthFileSchema.parse(parseYaml(await readFile(resolve(cwd, config.paths.health), "utf8")) ?? {});
90
+ const parsed = healthFileSchema.parse(parseYaml(await readFile(resolve(cwd, config.paths.health), 'utf8')) ?? {});
93
91
  const list = Array.isArray(parsed) ? parsed : parsed.health;
94
92
  for (const e of list)
95
93
  health.set(e.id, e.health.visibility);
@@ -107,45 +105,37 @@ async function loadVisibilityResolver(cwd, config) {
107
105
  const fromFile = health.get(slug);
108
106
  if (fromFile)
109
107
  return fromFile;
110
- return typeof raw.visibility === "string" ? raw.visibility : undefined;
108
+ return typeof raw.visibility === 'string' ? raw.visibility : undefined;
111
109
  };
112
110
  }
113
111
  async function loadRecords(cwd, config) {
114
112
  const dir = resolve(cwd, config.paths.recordsDir);
115
113
  const resolveVisibility = await loadVisibilityResolver(cwd, config);
116
114
  const files = (await readdir(dir))
117
- .filter((file) => file.endsWith(".yml") || file.endsWith(".yaml"))
115
+ .filter((file) => file.endsWith('.yml') || file.endsWith('.yaml'))
118
116
  .sort();
119
117
  const out = [];
120
118
  for (const file of files) {
121
- const raw = (parseYaml(await readFile(join(dir, file), "utf8")) ?? {});
119
+ const raw = (parseYaml(await readFile(join(dir, file), 'utf8')) ?? {});
122
120
  const github = raw.github ?? {};
123
121
  const repoMeta = github.repository ?? {};
124
122
  const links = raw.links ?? {};
125
- const stars = typeof github.stars === "number"
123
+ const stars = typeof github.stars === 'number'
126
124
  ? github.stars
127
- : typeof repoMeta.stargazers_count === "number"
125
+ : typeof repoMeta.stargazers_count === 'number'
128
126
  ? repoMeta.stargazers_count
129
127
  : undefined;
130
- const license = typeof github.license === "string"
131
- ? github.license
132
- : undefined;
128
+ const license = typeof github.license === 'string' ? github.license : undefined;
133
129
  out.push({
134
- slug: typeof raw.slug === "string" ? raw.slug : "",
135
- name: typeof raw.name === "string" ? raw.name : undefined,
136
- description: typeof raw.description === "string"
137
- ? raw.description
138
- : undefined,
139
- category: typeof raw.category === "string"
140
- ? raw.category
141
- : undefined,
142
- repoUrl: typeof raw.repoUrl === "string"
143
- ? raw.repoUrl
144
- : (links.github ?? undefined),
145
- 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'
146
136
  ? raw.homepageUrl
147
137
  : (links.website ?? undefined),
148
- visibility: resolveVisibility(typeof raw.slug === "string" ? raw.slug : file.replace(/\.ya?ml$/, ""), raw),
138
+ visibility: resolveVisibility(typeof raw.slug === 'string' ? raw.slug : file.replace(/\.ya?ml$/, ''), raw),
149
139
  ...(stars !== undefined ? { stars } : {}),
150
140
  ...(license !== undefined ? { license } : {}),
151
141
  });
@@ -153,12 +143,12 @@ async function loadRecords(cwd, config) {
153
143
  return out;
154
144
  }
155
145
  async function loadCategories(cwd, taxonomyDir) {
156
- const path = resolve(cwd, taxonomyDir, "categories.yml");
157
- const raw = (parseYaml(await readFile(path, "utf8")) ?? []);
146
+ const path = resolve(cwd, taxonomyDir, 'categories.yml');
147
+ const raw = (parseYaml(await readFile(path, 'utf8')) ?? []);
158
148
  return raw
159
149
  .map((entry) => ({
160
- id: typeof entry.id === "string" ? entry.id : "",
161
- name: typeof entry.name === "string" ? entry.name : "",
150
+ id: typeof entry.id === 'string' ? entry.id : '',
151
+ name: typeof entry.name === 'string' ? entry.name : '',
162
152
  }))
163
153
  .filter((entry) => entry.id && entry.name);
164
154
  }
@@ -1 +1 @@
1
- {"version":3,"file":"readme-cli.js","sourceRoot":"","sources":["../src/readme-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAChE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,KAAK,IAAI,SAAS,EAAE,MAAM,MAAM,CAAC;AAC1C,OAAO,EACL,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,CAAC,IAAI,KAAK,QAAQ,CAAC,CAAC,CAAE,GAAG,CAAC,IAAe,CAAC,CAAC,CAAC,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC,EAClF,GAAG,CACJ;YACD,GAAG,CAAC,KAAK,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;YACzC,GAAG,CAAC,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SAC9C,CAAC,CAAC;IACL,CAAC;IACD,OAAO,GAAG,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,80 @@
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
+ * The `@grove-dev/*` version this scaffold's source expects. The
33
+ * components read a typed model built by `@grove-dev/astro`, so a
34
+ * scaffold can outrun the packages a project has installed.
35
+ */
36
+ requiresGrove?: string;
37
+ };
38
+ files: RegistryItemFile[];
39
+ }
40
+ /**
41
+ * Locate a built item in the copy the CLI ships beside its own code.
42
+ *
43
+ * `@grove-dev/registry` is a workspace build unit, not a published
44
+ * package — nothing installs it, and consumers never import it. The
45
+ * CLI's build step copies `packages/registry/dist/r/` to
46
+ * `packages/cli/dist/r/`, so the scaffold travels inside the CLI
47
+ * tarball and `grove init` works offline.
48
+ */
49
+ export declare function resolveBundledItemPath(name?: string): string;
50
+ /**
51
+ * Load and validate a built registry item from a local path or an
52
+ * http(s) URL. Every file must carry inlined `content` and a `target`
53
+ * — that is what `shadcn build` emits, and what both install paths
54
+ * need; a hand-written item without them is rejected up front.
55
+ */
56
+ export declare function loadItem(source: string): Promise<RegistryItem>;
57
+ /** `~/src/components/ui/button.astro` → `src/components/ui/button.astro` */
58
+ export declare function targetToProjectPath(target: string): string;
59
+ /**
60
+ * Lockfile entries for an item, sorted by target — the same shape and
61
+ * digest `scripts/lib/registry.mjs` computes for the example app.
62
+ */
63
+ export declare function itemLockEntries(item: RegistryItem): LockfileFile[];
64
+ export declare function buildLockfile(item: RegistryItem): RegistryLockfile;
65
+ /**
66
+ * Write an item's files into a project, verbatim. `grove update` uses
67
+ * this to apply the files its plan says are safe (`only` = those
68
+ * project-relative targets); tests use it as a no-network stand-in
69
+ * for `shadcn add`. Returns the project-relative paths written.
70
+ */
71
+ export declare function writeItemFiles(item: RegistryItem, cwd: string, options?: {
72
+ only?: Set<string>;
73
+ }): Promise<string[]>;
74
+ /**
75
+ * The `@grove` registry URL template from the project's
76
+ * `components.json`, or null when the file or the entry is absent.
77
+ * shadcn accepts either a bare string or `{ url, headers? }`.
78
+ */
79
+ export declare function resolveRegistryTemplate(cwd: string): Promise<string | null>;
80
+ //# 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,MAAM,CAAC;IACf,oDAAoD;IACpD,OAAO,EA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ove 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,WAAW,GAAG,GAAG,kBAAkB,IAAI,aAAa,EAAE,CAAC;AAgCpE;;;;;;;;GAQG;AACH,MAAM,UAAU,sBAAsB,CAAC,IA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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
@@ -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"}
@@ -0,0 +1,103 @@
1
+ // SPDX-License-Identifier: MIT
2
+ /**
3
+ * A minimal unified diff, used by `grove update --diff` to show what an
4
+ * upstream change would do to a file before it is applied.
5
+ *
6
+ * The CLI has no diff dependency and does not want one for this: the
7
+ * inputs are two versions of one source file, always small enough that a
8
+ * plain longest-common-subsequence table is the right trade.
9
+ */
10
+ const CONTEXT = 3;
11
+ /**
12
+ * Longest common subsequence of two line arrays, as `[oldIndex, newIndex]`
13
+ * pairs. The DP table is a flat Int32Array — `(a.length + 1) * (b.length + 1)`
14
+ * counts of the LCS from each position onward.
15
+ */
16
+ function commonSubsequence(a, b) {
17
+ const width = b.length + 1;
18
+ const lengths = new Int32Array((a.length + 1) * width);
19
+ // `noUncheckedIndexedAccess` types every index read as possibly
20
+ // undefined, including typed arrays; every read here is in range.
21
+ const lcs = (i, j) => lengths[i * width + j] ?? 0;
22
+ for (let i = a.length - 1; i >= 0; i--) {
23
+ for (let j = b.length - 1; j >= 0; j--) {
24
+ lengths[i * width + j] =
25
+ a[i] === b[j] ? lcs(i + 1, j + 1) + 1 : Math.max(lcs(i + 1, j), lcs(i, j + 1));
26
+ }
27
+ }
28
+ const pairs = [];
29
+ let i = 0;
30
+ let j = 0;
31
+ while (i < a.length && j < b.length) {
32
+ if (a[i] === b[j]) {
33
+ pairs.push([i, j]);
34
+ i++;
35
+ j++;
36
+ }
37
+ else if (lcs(i + 1, j) >= lcs(i, j + 1)) {
38
+ i++;
39
+ }
40
+ else {
41
+ j++;
42
+ }
43
+ }
44
+ return pairs;
45
+ }
46
+ function editScript(a, b) {
47
+ const edits = [];
48
+ let i = 0;
49
+ let j = 0;
50
+ for (const [ai, bj] of commonSubsequence(a, b)) {
51
+ while (i < ai)
52
+ edits.push({ kind: '-', text: a[i] ?? '', oldLine: ++i });
53
+ while (j < bj)
54
+ edits.push({ kind: '+', text: b[j] ?? '', newLine: ++j });
55
+ edits.push({ kind: ' ', text: a[ai] ?? '', oldLine: ++i, newLine: ++j });
56
+ }
57
+ while (i < a.length)
58
+ edits.push({ kind: '-', text: a[i] ?? '', oldLine: ++i });
59
+ while (j < b.length)
60
+ edits.push({ kind: '+', text: b[j] ?? '', newLine: ++j });
61
+ return edits;
62
+ }
63
+ /**
64
+ * Render a unified diff of `before` → `after`. Returns an empty string
65
+ * when the two are identical, so callers can skip a file with one check.
66
+ */
67
+ export function unifiedDiff(before, after, label) {
68
+ if (before === after)
69
+ return '';
70
+ const edits = editScript(before.split('\n'), after.split('\n'));
71
+ // Keep every changed line plus CONTEXT unchanged lines either side;
72
+ // consecutive kept runs become hunks.
73
+ const keep = new Array(edits.length).fill(false);
74
+ for (let index = 0; index < edits.length; index++) {
75
+ if (edits[index]?.kind === ' ')
76
+ continue;
77
+ const from = Math.max(0, index - CONTEXT);
78
+ const to = Math.min(edits.length - 1, index + CONTEXT);
79
+ for (let k = from; k <= to; k++)
80
+ keep[k] = true;
81
+ }
82
+ const lines = [`--- a/${label}`, `+++ b/${label}`];
83
+ let index = 0;
84
+ while (index < edits.length) {
85
+ if (!keep[index]) {
86
+ index++;
87
+ continue;
88
+ }
89
+ const start = index;
90
+ while (index < edits.length && keep[index])
91
+ index++;
92
+ const hunk = edits.slice(start, index);
93
+ const oldStart = hunk.find((edit) => edit.oldLine !== undefined)?.oldLine ?? 0;
94
+ const newStart = hunk.find((edit) => edit.newLine !== undefined)?.newLine ?? 0;
95
+ const oldCount = hunk.filter((edit) => edit.kind !== '+').length;
96
+ const newCount = hunk.filter((edit) => edit.kind !== '-').length;
97
+ lines.push(`@@ -${oldStart},${oldCount} +${newStart},${newCount} @@`);
98
+ for (const edit of hunk)
99
+ lines.push(`${edit.kind}${edit.text}`);
100
+ }
101
+ return lines.join('\n');
102
+ }
103
+ //# sourceMappingURL=unified-diff.js.map