@grove-dev/cli 0.2.20 → 0.3.2

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 (108) hide show
  1. package/README.md +8 -93
  2. package/dist/index.d.ts +1 -2
  3. package/dist/index.d.ts.map +1 -1
  4. package/dist/index.js +99 -1937
  5. package/dist/index.js.map +1 -1
  6. package/dist/init.d.ts +11 -0
  7. package/dist/init.d.ts.map +1 -0
  8. package/dist/init.js +82 -0
  9. package/dist/init.js.map +1 -0
  10. package/dist/package.json +7 -18
  11. package/dist/site/.github/ISSUE_TEMPLATE/bug_report.md +33 -0
  12. package/dist/site/.github/ISSUE_TEMPLATE/feature_request.md +20 -0
  13. package/dist/site/.github/ISSUE_TEMPLATE/record_submission.md +48 -0
  14. package/dist/site/.github/pull_request_template.md +27 -0
  15. package/dist/site/.github/workflows/ci.yml +21 -0
  16. package/dist/site/.github/workflows/cleanup.yml +23 -0
  17. package/dist/site/.github/workflows/deploy.yml +36 -0
  18. package/dist/site/.github/workflows/sync-contributors.yml +28 -0
  19. package/dist/site/.github/workflows/sync-github.yml +31 -0
  20. package/dist/site/astro.config.mjs +24 -0
  21. package/dist/site/content/pages/about.md +63 -0
  22. package/dist/site/content/pages/methodology.md +103 -0
  23. package/dist/site/data/health.yml +13 -0
  24. package/dist/site/data/records/.gitkeep +0 -0
  25. package/dist/site/data/records/crewai.yml +21 -0
  26. package/dist/site/data/records/dify.yml +21 -0
  27. package/dist/site/data/records/flowise.yml +21 -0
  28. package/dist/site/data/records/llamaindex.yml +21 -0
  29. package/dist/site/data/records/ollama.yml +28 -0
  30. package/dist/site/data/records/open-webui.yml +21 -0
  31. package/dist/site/data/taxonomy/categories.yml +10 -0
  32. package/dist/site/data/taxonomy/distribution-channels.yml +43 -0
  33. package/dist/site/data/taxonomy/platforms.yml +27 -0
  34. package/dist/site/data/taxonomy/stacks.yml +18 -0
  35. package/dist/site/grove.config.ts +76 -0
  36. package/dist/site/package.json +33 -0
  37. package/dist/site/public/icons/platforms/android.svg +1 -0
  38. package/dist/site/public/icons/platforms/apple-dark.svg +1 -0
  39. package/dist/site/public/icons/platforms/apple-light.svg +1 -0
  40. package/dist/site/public/icons/platforms/chrome.svg +1 -0
  41. package/dist/site/public/icons/platforms/chromeos.svg +5 -0
  42. package/dist/site/public/icons/platforms/desktop.svg +4 -0
  43. package/dist/site/public/icons/platforms/embedded.svg +5 -0
  44. package/dist/site/public/icons/platforms/ios.svg +1 -0
  45. package/dist/site/public/icons/platforms/linux.svg +1 -0
  46. package/dist/site/public/icons/platforms/macos.svg +1 -0
  47. package/dist/site/public/icons/platforms/ubuntu.svg +1 -0
  48. package/dist/site/public/icons/platforms/web.svg +5 -0
  49. package/dist/site/public/icons/platforms/windows.svg +6 -0
  50. package/dist/site/public/icons/stacks/android.svg +1 -0
  51. package/dist/site/public/icons/stacks/apple-dark.svg +1 -0
  52. package/dist/site/public/icons/stacks/apple-light.svg +1 -0
  53. package/dist/site/public/icons/stacks/bun.svg +1 -0
  54. package/dist/site/public/icons/stacks/capacitor.svg +14 -0
  55. package/dist/site/public/icons/stacks/clojure.svg +1 -0
  56. package/dist/site/public/icons/stacks/clojurescript.svg +1 -0
  57. package/dist/site/public/icons/stacks/dart.svg +1 -0
  58. package/dist/site/public/icons/stacks/deno.svg +1 -0
  59. package/dist/site/public/icons/stacks/django.svg +1 -0
  60. package/dist/site/public/icons/stacks/docker.svg +1 -0
  61. package/dist/site/public/icons/stacks/firebase.svg +1 -0
  62. package/dist/site/public/icons/stacks/flutter.svg +1 -0
  63. package/dist/site/public/icons/stacks/go.svg +1 -0
  64. package/dist/site/public/icons/stacks/graphql.svg +1 -0
  65. package/dist/site/public/icons/stacks/ionic.svg +4 -0
  66. package/dist/site/public/icons/stacks/java.svg +1 -0
  67. package/dist/site/public/icons/stacks/javascript.svg +1 -0
  68. package/dist/site/public/icons/stacks/kotlin.svg +1 -0
  69. package/dist/site/public/icons/stacks/llm.svg +1 -0
  70. package/dist/site/public/icons/stacks/mongodb.svg +1 -0
  71. package/dist/site/public/icons/stacks/node.js.svg +1 -0
  72. package/dist/site/public/icons/stacks/nodejs.svg +1 -0
  73. package/dist/site/public/icons/stacks/python.svg +1 -0
  74. package/dist/site/public/icons/stacks/rag.svg +7 -0
  75. package/dist/site/public/icons/stacks/react-native.svg +1 -0
  76. package/dist/site/public/icons/stacks/react.svg +1 -0
  77. package/dist/site/public/icons/stacks/rust.svg +1 -0
  78. package/dist/site/public/icons/stacks/solidity.svg +1 -0
  79. package/dist/site/public/icons/stacks/sveltekit.svg +1 -0
  80. package/dist/site/public/icons/stacks/swift.svg +1 -0
  81. package/dist/site/public/icons/stacks/tensorflow.svg +1 -0
  82. package/dist/site/public/icons/stacks/typescript.svg +1 -0
  83. package/dist/site/public/icons/stacks/vue.svg +1 -0
  84. package/dist/site/public/og-image.svg +48 -0
  85. package/dist/site/public/robots.txt +53 -0
  86. package/dist/site/src/pages/404.astro +64 -0
  87. package/dist/site/src/pages/[slug]/[recordSlug].astro +527 -0
  88. package/dist/site/src/pages/[slug]/index.astro +242 -0
  89. package/dist/site/src/pages/about.astro +189 -0
  90. package/dist/site/src/pages/apps/[recordSlug].astro +34 -0
  91. package/dist/site/src/pages/contributors.astro +113 -0
  92. package/dist/site/src/pages/index.astro +131 -0
  93. package/dist/site/src/pages/submit.astro +170 -0
  94. package/dist/site/src/styles/global.css +33 -0
  95. package/dist/site/tsconfig.json +13 -0
  96. package/package.json +8 -19
  97. package/dist/helpers.d.ts +0 -27
  98. package/dist/helpers.d.ts.map +0 -1
  99. package/dist/helpers.js +0 -41
  100. package/dist/helpers.js.map +0 -1
  101. package/dist/template-loader.d.ts +0 -99
  102. package/dist/template-loader.d.ts.map +0 -1
  103. package/dist/template-loader.js +0 -338
  104. package/dist/template-loader.js.map +0 -1
  105. package/dist/template-loader.test.d.ts +0 -2
  106. package/dist/template-loader.test.d.ts.map +0 -1
  107. package/dist/template-loader.test.js +0 -270
  108. package/dist/template-loader.test.js.map +0 -1
@@ -1,338 +0,0 @@
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 { existsSync, readFileSync, readdirSync, realpathSync } from "node:fs";
11
- import { dirname, join, resolve } from "node:path";
12
- import { fileURLToPath } from "node:url";
13
- /** Frameworks that ship templates inside the adapter package. */
14
- export const SUPPORTED_FRAMEWORKS = ["astro"];
15
- export function isFramework(value) {
16
- return SUPPORTED_FRAMEWORKS.includes(value);
17
- }
18
- function templatesRoot(framework) {
19
- const pkg = `@grove-dev/${framework}`;
20
- // Resolve the package's *root* entrypoint. We do not ask for
21
- // `pkg/package.json` because the V1 package's `exports` field
22
- // intentionally does not list that subpath — only the
23
- // user-facing entrypoints (`./components/*`, `./layouts/*`,
24
- // `./styles.css`) are public. The package root directory is
25
- // then used to look up `templates/` and `package.json`
26
- // directly via the filesystem.
27
- let packageRoot;
28
- try {
29
- // Walking the node_modules ancestry from the CLI's own
30
- // location: this works whether the framework adapter was
31
- // installed as a dep of the consumer's project, as a
32
- // workspace sibling, or as a global package.
33
- const here = dirname(fileURLToPath(import.meta.url));
34
- packageRoot = resolveGrovePackage(pkg, here);
35
- }
36
- catch {
37
- try {
38
- packageRoot = resolveGrovePackage(pkg, process.cwd());
39
- }
40
- catch {
41
- throw new Error(`Framework package ${pkg} is not installed.\n` +
42
- `Run one of:\n` +
43
- ` pnpm add -g ${pkg}\n` +
44
- ` pnpm add -D ${pkg}\n` +
45
- (framework === "astro" ? "then retry: grove new <dir> --framework astro" : ""));
46
- }
47
- }
48
- return resolve(packageRoot, "templates");
49
- }
50
- function resolvePackageRoot(pkg, from) {
51
- let cursor = from;
52
- for (let i = 0; i < 8; i++) {
53
- const candidate = join(cursor, "node_modules", pkg);
54
- if (existsSync(candidate))
55
- return candidate;
56
- cursor = resolve(cursor, "..");
57
- }
58
- throw new Error(`Could not find ${pkg} from ${from}`);
59
- }
60
- /**
61
- * Walk up from a starting directory looking for `pnpm-workspace.yaml`.
62
- * That file marks the monorepo root — pnpm convention. We need it for
63
- * the special case where the package we want to resolve IS the CLI
64
- * itself (`@grove-dev/cli`): the CLI's `node_modules/@grove-dev/cli`
65
- * doesn't exist because the CLI is a root package, not a dep of
66
- * itself. From the monorepo root, `packages/cli` is always canonical.
67
- *
68
- * Throws if we never find a `pnpm-workspace.yaml` (we are not inside
69
- * a monorepo, so `grove run` is the wrong tool anyway).
70
- */
71
- function findMonorepoRoot(from) {
72
- let cursor = from;
73
- for (let i = 0; i < 8; i++) {
74
- if (existsSync(join(cursor, "pnpm-workspace.yaml")))
75
- return cursor;
76
- const parent = resolve(cursor, "..");
77
- if (parent === cursor)
78
- break; // filesystem root
79
- cursor = parent;
80
- }
81
- throw new Error(`Could not find monorepo root (pnpm-workspace.yaml) starting from ${from}. ` +
82
- `grove run must be executed from inside the grove monorepo.`);
83
- }
84
- /**
85
- * Resolve a `@grove-dev/*` package's on-disk path. Two strategies:
86
- *
87
- * 1. Workspace: when running inside the Grove monorepo, prefer the
88
- * matching `packages/<short>` source package. This is essential for
89
- * `grove run`: the CLI may depend on an older published adapter, but
90
- * local template work must be scaffolded from the current checkout.
91
- * 2. Standard: walk up from `from` looking for `node_modules/<pkg>`.
92
- * This is the normal path for published/global CLI installations.
93
- */
94
- function resolveGrovePackage(pkg, from) {
95
- const shortName = pkg.startsWith("@grove-dev/")
96
- ? pkg.slice("@grove-dev/".length)
97
- : "";
98
- if (shortName) {
99
- try {
100
- const monorepoRoot = findMonorepoRoot(from);
101
- const workspacePath = join(monorepoRoot, "packages", shortName);
102
- const manifestPath = join(workspacePath, "package.json");
103
- if (existsSync(manifestPath)) {
104
- const manifest = JSON.parse(readFileSync(manifestPath, "utf8"));
105
- if (manifest.name === pkg)
106
- return workspacePath;
107
- }
108
- }
109
- catch {
110
- // Not inside the Grove source workspace (or not a Grove package
111
- // checkout). Fall through to normal node_modules resolution.
112
- }
113
- }
114
- if (pkg === "@grove-dev/cli") {
115
- const monorepoRoot = findMonorepoRoot(from);
116
- const cliPath = join(monorepoRoot, "packages", "cli");
117
- if (existsSync(cliPath))
118
- return cliPath;
119
- // Fall through to the standard strategy below; the package might
120
- // still be findable via a globally installed `grove` layout.
121
- }
122
- return resolvePackageRoot(pkg, from);
123
- }
124
- /** List every available template for a framework. */
125
- export async function listTemplates(framework) {
126
- const root = templatesRoot(framework);
127
- // No fs.readdir on unknown folders; assume a single 'default' template per framework.
128
- return [{ framework, template: "default", path: join(root, "default") }];
129
- }
130
- /** Resolve the absolute path of a framework template directory. */
131
- export function templatePath(framework, name = "default") {
132
- return join(templatesRoot(framework), name);
133
- }
134
- /**
135
- * Read the version of the framework adapter package
136
- * (`@grove-dev/<framework>`) that shipped the templates. This is the
137
- * fallback for older templates that still contain loose dependencies;
138
- * current templates already carry exact published versions.
139
- */
140
- export function frameworkVersion(framework) {
141
- const here = dirname(fileURLToPath(import.meta.url));
142
- const root = resolveGrovePackage(`@grove-dev/${framework}`, here);
143
- const pkgPath = join(root, "package.json");
144
- const pkg = JSON.parse(readFileSync(pkgPath, "utf8"));
145
- if (!pkg.version) {
146
- throw new Error(`Could not read version of @grove-dev/${framework} from ${pkgPath}`);
147
- }
148
- return pkg.version;
149
- }
150
- /**
151
- * Copy a template directory into a project root. Honors `force: false`
152
- * by default so an existing project isn't clobbered.
153
- *
154
- * V1: the `new` action runs `mkdir(root, { recursive: true })` before
155
- * we get here, which means `targetRoot` already exists (and is empty)
156
- * for a fresh scaffold. `cp` with `errorOnExist: true` would reject
157
- * that empty dir with EEXIST, so we let `cp` overwrite it silently.
158
- *
159
- * The non-empty case is handled before the copy: a non-empty
160
- * `targetRoot` with `force: false` raises up front (partial
161
- * scaffolds are worse than a hard fail), and `force: true` proceeds
162
- * and overwrites per `cp`'s `force: true` semantics.
163
- */
164
- export async function copyTemplate(framework, targetRoot, name = "default", options = {}) {
165
- const from = templatePath(framework, name);
166
- // Guard: refuse to silently produce a partial scaffold. Node's
167
- // `cp` with `force: false` will skip existing files without
168
- // raising — which is the worst possible outcome for a scaffolder
169
- // (the user gets a half-populated project and no error).
170
- if (existsSync(targetRoot)) {
171
- const entries = readdirSync(targetRoot);
172
- if (entries.length > 0 && !options.force) {
173
- throw new Error(`Target directory ${targetRoot} is not empty. ` +
174
- `Re-run with force: true to overwrite, or pick a different target.`);
175
- }
176
- }
177
- await cp(from, targetRoot, {
178
- recursive: true,
179
- force: options.force ?? false,
180
- errorOnExist: false,
181
- filter: (source) => {
182
- const relative = source.slice(from.length).replace(/^[/\\]/, "");
183
- if (!relative)
184
- return true;
185
- const normalized = relative.replaceAll("\\", "/");
186
- return !(normalized === "node_modules" ||
187
- normalized.startsWith("node_modules/") ||
188
- normalized === ".astro" ||
189
- normalized.startsWith(".astro/") ||
190
- normalized === "dist" ||
191
- normalized.startsWith("dist/") ||
192
- normalized === "data/generated" ||
193
- normalized.startsWith("data/generated/") ||
194
- normalized.endsWith("/.DS_Store") ||
195
- normalized === ".DS_Store");
196
- },
197
- });
198
- // Count the files we actually wrote — used by callers that surface
199
- // a "(N files)" line in their success message. We walk the
200
- // destination tree post-copy because Node's `cp` callback doesn't
201
- // report a file count. The `filter` above matches the exclude
202
- // list one-to-one, so this count reflects exactly what was copied.
203
- // (Audit finding: was returning `files: -1` as a sentinel.)
204
- const copiedFiles = walkDir(targetRoot);
205
- return { from, to: targetRoot, files: copiedFiles };
206
- }
207
- /**
208
- * Count the regular files under `dir`, recursively. Used by
209
- * `copyTemplate` to report a real file count instead of a `-1`
210
- * sentinel. Symlinks are counted as one file each (we don't follow
211
- * them — the symlink itself is the artefact, the target is a
212
- * pre-existing tree we shouldn't be double-counting).
213
- */
214
- function walkDir(dir) {
215
- let count = 0;
216
- const entries = readdirSync(dir, { withFileTypes: true });
217
- for (const entry of entries) {
218
- if (entry.isDirectory()) {
219
- count += walkDir(join(dir, entry.name));
220
- }
221
- else if (entry.isFile() || entry.isSymbolicLink()) {
222
- count++;
223
- }
224
- }
225
- return count;
226
- }
227
- export async function renameProjectInTemplate(framework, targetRoot, projectName, templateName = "default", options = {}) {
228
- const mode = options.mode ?? "published";
229
- const packageJsonPath = join(targetRoot, "package.json");
230
- const raw = await readFile(packageJsonPath, "utf8");
231
- const pkg = JSON.parse(raw);
232
- pkg.name = packageNameFromProjectName(projectName, framework, templateName);
233
- const rewrittenDeps = mode === "published"
234
- ? rewriteWorkspaceDepsToVersion(pkg, frameworkVersion(framework))
235
- : rewriteWorkspaceDepsToFile(pkg);
236
- await writeFile(packageJsonPath, `${JSON.stringify(pkg, null, 2)}\n`, "utf8");
237
- return { packageJsonPath, finalName: pkg.name, rewrittenDeps };
238
- }
239
- /**
240
- * In-place: replace loose or non-semver `@grove-dev/*` dependencies
241
- * with the supplied published version. Exact versions already present
242
- * in current templates are preserved.
243
- *
244
- * Non-Grove deps are left untouched.
245
- */
246
- function rewriteWorkspaceDepsToVersion(pkg, version) {
247
- const rewritten = [];
248
- for (const section of ["dependencies", "devDependencies", "peerDependencies"]) {
249
- const map = pkg[section];
250
- if (!map)
251
- continue;
252
- for (const [name, value] of Object.entries(map)) {
253
- if (!name.startsWith("@grove-dev/"))
254
- continue;
255
- if (value === version)
256
- continue;
257
- // Pin placeholders, git/file URLs that do not exist in the
258
- // scaffold, or values that do not look like real semver.
259
- const looksPinned = /^[~^]?\d/.test(value);
260
- if (!looksPinned) {
261
- rewritten.push(`${name}: ${value} -> ${version}`);
262
- map[name] = version;
263
- }
264
- }
265
- }
266
- return rewritten;
267
- }
268
- /**
269
- * In-place: rewrite every `@grove-dev/*` dependency in the template's
270
- * `package.json` to a `link:` URL pointing at the matching package
271
- * inside the local monorepo. Used by `grove run` to make a freshly
272
- * scaffolded project installable from this workspace without going
273
- * through the npm registry or `pnpm-workspace.yaml` membership.
274
- *
275
- * We resolve each package from the Grove workspace first, falling back
276
- * to the CLI's `node_modules` ancestry outside a source checkout. A
277
- * direct link avoids repacking the local package dependency graph for
278
- * every smoke-test scaffold.
279
- */
280
- function rewriteWorkspaceDepsToFile(pkg) {
281
- const rewritten = [];
282
- // The CLI's own dist/ directory is the only stable reference point
283
- // we have. From there we walk up to find each `@grove-dev/*` package.
284
- const cliLocation = dirname(fileURLToPath(import.meta.url));
285
- for (const section of ["dependencies", "devDependencies", "peerDependencies"]) {
286
- const map = pkg[section];
287
- if (!map)
288
- continue;
289
- for (const name of Object.keys(map)) {
290
- if (!name.startsWith("@grove-dev/"))
291
- continue;
292
- let pkgPath;
293
- try {
294
- pkgPath = realpathSync(resolveGrovePackage(name, cliLocation));
295
- }
296
- catch {
297
- // Not installed locally (e.g. a future framework like
298
- // `@grove-dev/svelte` that has no real template in V1). Skip
299
- // rather than crashing — the user will see a normal pnpm
300
- // install error and can fix it.
301
- continue;
302
- }
303
- rewritten.push(`${name}: -> link:${pkgPath}`);
304
- map[name] = `link:${pkgPath}`;
305
- }
306
- }
307
- return rewritten;
308
- }
309
- export function packageNameFromProjectName(name, framework, templateName) {
310
- const slug = name
311
- .toLowerCase()
312
- .replace(/[^a-z0-9]+/g, "-")
313
- .replace(/^-+|-+$/g, "");
314
- // Make the npm name unique-ish per template: e.g. "grove-astro-default"
315
- return `${slug || "grove-site"}-${framework}-${templateName}`;
316
- }
317
- /**
318
- * Make sure a directory exists. Async wrapper around `mkdir -p`.
319
- */
320
- export async function ensureDir(path) {
321
- await mkdir(path, { recursive: true });
322
- }
323
- /**
324
- * Resolve a file path relative to the current module — handy for
325
- * locating bundled assets the CLI ships with (e.g. .github templates).
326
- */
327
- export function here(...parts) {
328
- const url = new URL(import.meta.url);
329
- return resolve(fileURLToPath(url), "..", ...parts);
330
- }
331
- /**
332
- * Public re-export: `grove run` needs to find the monorepo root to
333
- * place its scratch project under `<root>/.grove/run/...` and to run
334
- * `pnpm install --filter` from there. The implementation lives above
335
- * so this stays a thin alias.
336
- */
337
- export { findMonorepoRoot };
338
- //# sourceMappingURL=template-loader.js.map
@@ -1 +0,0 @@
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,UAAU,EAAE,YAAY,EAAE,WAAW,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AAC9E,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACnD,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAqBzC,iEAAiE;AACjE,MAAM,CAAC,MAAM,oBAAoB,GAAyB,CAAC,OAAO,CAAU,CAAC;AAE7E,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,6DAA6D;IAC7D,8DAA8D;IAC9D,sDAAsD;IACtD,4DAA4D;IAC5D,4DAA4D;IAC5D,uDAAuD;IACvD,+BAA+B;IAC/B,IAAI,WAAmB,CAAC;IACxB,IAAI,CAAC;QACH,uDAAuD;QACvD,yDAAyD;QACzD,qDAAqD;QACrD,6CAA6C;QAC7C,MAAM,IAAI,GAAG,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;QACrD,WAAW,GAAG,mBAAmB,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;IAC/C,CAAC;IAAC,MAAM,CAAC;QACP,IAAI,CAAC;YACH,WAAW,GAAG,mBAAmB,CAAC,GAAG,EAAE,OAAO,CAAC,GAAG,EAAE,CAAC,CAAC;QACxD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GAEG;AACH,MAAM,CAAC,KAAK,UAAU,SAAS,CAAC,IAAY;IAC1C,MAAM,KAAK,CAAC,IAAI,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC,CAAC;AACzC,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,IAAI,CAAC,GAAG,KAAe;IACrC,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrC,OAAO,OAAO,CAAC,aAAa,CAAC,GAAG,CAAC,EAAE,IAAI,EAAE,GAAG,KAAK,CAAC,CAAC;AACrD,CAAC;AAED;;;;;GAKG;AACH,OAAO,EAAE,gBAAgB,EAAE,CAAC"}
@@ -1,2 +0,0 @@
1
- export {};
2
- //# sourceMappingURL=template-loader.test.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-loader.test.d.ts","sourceRoot":"","sources":["../src/template-loader.test.ts"],"names":[],"mappings":""}
@@ -1,270 +0,0 @@
1
- /**
2
- * @grove-dev/cli — unit tests for the pure-logic helpers
3
- * exported from `template-loader.ts` and the `parseDeployProvider`
4
- * helper from `index.ts`.
5
- *
6
- * Coverage (per the brief):
7
- * - packageNameFromProjectName: slugification, template suffix,
8
- * empty-input fallback ("grove-site")
9
- * - renameProjectInTemplate: published mode pins versions,
10
- * file mode rewrites to absolute `link:` paths
11
- * - copyTemplate: force flag (overwrites a non-empty dir),
12
- * default refuses a non-empty target, filter rules
13
- * (excludes node_modules / .astro / dist / data/generated /
14
- * .DS_Store)
15
- * - parseDeployProvider: valid values pass through, undefined
16
- * → "github-pages" default, invalid value → process.exit(1)
17
- * (the cli-scripts-tooling audit finding)
18
- */
19
- import { describe, it, expect, beforeEach, afterEach, vi } from "vitest";
20
- import { mkdtemp, mkdir, writeFile, readFile, rm, readdir } from "node:fs/promises";
21
- import { realpathSync } from "node:fs";
22
- import { tmpdir } from "node:os";
23
- import { join, resolve } from "node:path";
24
- import { packageNameFromProjectName, renameProjectInTemplate, copyTemplate, } from "./template-loader.js";
25
- import { parseDeployProvider } from "./helpers.js";
26
- // Use the @grove-dev/astro package's template as the source of
27
- // truth for the copyTemplate tests. It IS present in node_modules
28
- // (CLI depends on it) and has a `templates/default/` tree that
29
- // matches the schema copyTemplate expects.
30
- const ASTRO_TEMPLATE = resolve(
31
- // Walk up from packages/cli/src to the monorepo root, then into
32
- // packages/astro/templates/default.
33
- import.meta.dirname, // src/
34
- "../../../astro/templates/default");
35
- describe("packageNameFromProjectName", () => {
36
- it("slugifies a multi-word project name and appends framework+template", () => {
37
- expect(packageNameFromProjectName("My Cool Project", "astro", "default")).toBe("my-cool-project-astro-default");
38
- });
39
- it("strips punctuation but keeps lowercase alphanumerics", () => {
40
- expect(packageNameFromProjectName("foo_bar.baz", "astro", "default")).toBe("foo-bar-baz-astro-default");
41
- });
42
- it("falls back to 'grove-site' for an input that slugifies to empty (e.g. emoji-only)", () => {
43
- // The function: if `slug` ends up empty, substitute
44
- // "grove-site". Pin the behaviour so a user typing "🚀"
45
- // as the project name doesn't end up with a package called
46
- // "-astro-default".
47
- expect(packageNameFromProjectName("🚀", "astro", "default")).toBe("grove-site-astro-default");
48
- });
49
- it("embeds the template name so two scaffolds with the same project name don't collide", () => {
50
- expect(packageNameFromProjectName("foo", "astro", "minimal")).toBe("foo-astro-minimal");
51
- expect(packageNameFromProjectName("foo", "astro", "blog")).toBe("foo-astro-blog");
52
- });
53
- });
54
- describe("copyTemplate — force flag, filter rules", () => {
55
- let cwd;
56
- beforeEach(async () => {
57
- cwd = await mkdtemp(join(tmpdir(), "grove-cli-copy-"));
58
- });
59
- afterEach(async () => {
60
- await rm(cwd, { recursive: true, force: true });
61
- });
62
- it("copies a real @grove-dev/astro template into a fresh empty target dir", async () => {
63
- const target = join(cwd, "fresh");
64
- await mkdir(target, { recursive: true });
65
- const r = await copyTemplate("astro", target, "default");
66
- expect(r.to).toBe(target);
67
- // File count must be > 0 (audit: was returning -1 as a sentinel).
68
- expect(r.files).toBeGreaterThan(0);
69
- // Spot-check: the template's package.json should be there.
70
- const pkg = JSON.parse(await readFile(join(target, "package.json"), "utf8"));
71
- expect(pkg.name).toBe("grove-site");
72
- });
73
- it("throws when the target dir is non-empty and force is not set", async () => {
74
- const target = join(cwd, "occupied");
75
- await mkdir(target, { recursive: true });
76
- await writeFile(join(target, "user-file.txt"), "do not delete me");
77
- // Default (force: false) → refuse.
78
- await expect(copyTemplate("astro", target, "default")).rejects.toThrow(/not empty/);
79
- // The user's file is still there (we didn't half-copy).
80
- const userFile = await readFile(join(target, "user-file.txt"), "utf8");
81
- expect(userFile).toBe("do not delete me");
82
- });
83
- it("overwrites files that exist in the source tree when force: true", async () => {
84
- // Pre-seed the target with a `package.json` whose contents
85
- // differ from the template's. With force: true, the copy
86
- // overwrites the existing package.json with the template's
87
- // version. (Without force, copyTemplate refuses up front
88
- // for a non-empty target — see the previous test.)
89
- const target = join(cwd, "forced");
90
- await mkdir(target, { recursive: true });
91
- await writeFile(join(target, "package.json"), JSON.stringify({ name: "user-wrote-this" }));
92
- const r = await copyTemplate("astro", target, "default", { force: true });
93
- expect(r.files).toBeGreaterThan(0);
94
- // The package.json was overwritten with the template's
95
- // version (name = "grove-site").
96
- const pkg = JSON.parse(await readFile(join(target, "package.json"), "utf8"));
97
- expect(pkg.name).toBe("grove-site");
98
- });
99
- it("excludes node_modules, .astro, dist, data/generated, and .DS_Store from the copy", async () => {
100
- // We can't easily inject "garbage" into the @grove-dev/astro
101
- // template, so we exercise the filter indirectly: the real
102
- // template does NOT contain any of those paths, so a clean
103
- // copy should produce zero matches. This is a "nothing
104
- // filtered accidentally" assertion.
105
- const target = join(cwd, "filter-check");
106
- await mkdir(target, { recursive: true });
107
- await copyTemplate("astro", target, "default");
108
- // Walk the target and assert no excluded path sneaks in.
109
- async function walk(dir, out) {
110
- for (const entry of await readdir(dir, { withFileTypes: true })) {
111
- const full = join(dir, entry.name);
112
- out.push(full);
113
- if (entry.isDirectory())
114
- await walk(full, out);
115
- }
116
- }
117
- const all = [];
118
- await walk(target, all);
119
- const offending = all.filter((p) => {
120
- const rel = p.slice(target.length).replace(/^[/\\]/, "");
121
- const norm = rel.replaceAll("\\", "/");
122
- return (norm === "node_modules" ||
123
- norm.startsWith("node_modules/") ||
124
- norm === ".astro" ||
125
- norm.startsWith(".astro/") ||
126
- norm === "dist" ||
127
- norm.startsWith("dist/") ||
128
- norm === "data/generated" ||
129
- norm.startsWith("data/generated/") ||
130
- norm.endsWith("/.DS_Store") ||
131
- norm === ".DS_Store");
132
- });
133
- expect(offending).toEqual([]);
134
- });
135
- });
136
- describe("renameProjectInTemplate — published vs file mode", () => {
137
- let cwd;
138
- beforeEach(async () => {
139
- cwd = await mkdtemp(join(tmpdir(), "grove-cli-rename-"));
140
- await mkdir(cwd, { recursive: true });
141
- // A minimal package.json that mirrors what a real template
142
- // ships — has both `dependencies` and `devDependencies` with
143
- // @grove-dev/* entries, so we can test the rewrite in both.
144
- await writeFile(join(cwd, "package.json"), JSON.stringify({
145
- name: "old-name",
146
- dependencies: {
147
- "@grove-dev/core": "workspace:*",
148
- "@grove-dev/astro": "workspace:*",
149
- "react": "^18.0.0", // not a Grove dep — must be left alone
150
- },
151
- devDependencies: {
152
- "@grove-dev/ui": "workspace:*",
153
- },
154
- }, null, 2));
155
- });
156
- afterEach(async () => {
157
- await rm(cwd, { recursive: true, force: true });
158
- });
159
- it("published mode: rewrites @grove-dev/* deps to the supplied version", async () => {
160
- const r = await renameProjectInTemplate("astro", cwd, "my-project", "default", {
161
- mode: "published",
162
- });
163
- // The package name was rewritten to the slug-form.
164
- expect(r.finalName).toBe("my-project-astro-default");
165
- const pkg = JSON.parse(await readFile(join(cwd, "package.json"), "utf8"));
166
- // The non-Grove dep is untouched.
167
- expect(pkg.dependencies.react).toBe("^18.0.0");
168
- // At least one of the Grove deps was rewritten (the version
169
- // arg defaults to whatever frameworkVersion returns).
170
- const rewritten = r.rewrittenDeps.some((line) => line.includes("@grove-dev/"));
171
- expect(rewritten).toBe(true);
172
- });
173
- it("file mode: rewrites @grove-dev/* deps to absolute `link:` paths", async () => {
174
- // We don't actually need the links to resolve here — we
175
- // only need to assert the shape of the rewrite. The CLI's
176
- // real `grove run` path uses this to wire the dev monorepo
177
- // into the scaffold without a publish step.
178
- //
179
- // We can't predict the exact path (it depends on
180
- // node_modules walk), but every entry in rewrittenDeps
181
- // must mention "link:" for a Grove dep.
182
- const r = await renameProjectInTemplate("astro", cwd, "my-project", "default", {
183
- mode: "file",
184
- });
185
- // If the resolveGrovePackage walk finds any @grove-dev/*
186
- // package in the CLI's node_modules, they all become
187
- // link:<abs-path>. The walk may not find them in this
188
- // isolated test (the CLI is symlinked into the
189
- // monorepo, so the walk should succeed) — either way,
190
- // the package name is rewritten.
191
- expect(r.finalName).toBe("my-project-astro-default");
192
- // If we did get any rewrites, they must be `link:` paths.
193
- for (const line of r.rewrittenDeps) {
194
- expect(line).toMatch(/@grove-dev\/.*->\s*link:/);
195
- }
196
- const pkg = JSON.parse(await readFile(join(cwd, "package.json"), "utf8"));
197
- expect(realpathSync(pkg.dependencies["@grove-dev/astro"].slice("link:".length)))
198
- .toBe(realpathSync(resolve("packages/astro")));
199
- });
200
- it("leaves the package.json `name` field rewritten to the slug form", async () => {
201
- await renameProjectInTemplate("astro", cwd, "My Cool Project", "default", {
202
- mode: "published",
203
- });
204
- const pkg = JSON.parse(await readFile(join(cwd, "package.json"), "utf8"));
205
- expect(pkg.name).toBe("my-cool-project-astro-default");
206
- });
207
- });
208
- describe("parseDeployProvider — cli-scripts-tooling audit finding", () => {
209
- let exitSpy;
210
- let errSpy;
211
- beforeEach(() => {
212
- // Track calls without actually exiting. We do NOT throw
213
- // because parseDeployProvider's exit(1) lands inside a
214
- // process.on('uncaughtException') handler at the bottom
215
- // of index.ts, which would then also call our mocked
216
- // exit(1), recursing into the uncaughtException handler
217
- // and producing a noisy unhandled-rejection in vitest.
218
- // The cleanest approach: replace the implementation with a
219
- // no-op so process.exit(1) is observed but not propagated.
220
- exitSpy = vi.spyOn(process, "exit").mockImplementation(() => undefined);
221
- errSpy = vi.spyOn(console, "error").mockImplementation(() => { });
222
- });
223
- afterEach(() => {
224
- exitSpy.mockRestore();
225
- errSpy.mockRestore();
226
- });
227
- it("returns the value unchanged for every valid provider", () => {
228
- // The valid set is locked at template-loader.ts:24 — any
229
- // new value added there must be reflected here.
230
- expect(parseDeployProvider("vercel")).toBe("vercel");
231
- expect(parseDeployProvider("netlify")).toBe("netlify");
232
- expect(parseDeployProvider("cloudflare")).toBe("cloudflare");
233
- expect(parseDeployProvider("github-pages")).toBe("github-pages");
234
- expect(parseDeployProvider("none")).toBe("none");
235
- });
236
- it("returns 'github-pages' for undefined (the historical default)", () => {
237
- // Pin the default: undefined means the user did not pass
238
- // --deploy at all. The previous implementation returned
239
- // "github-pages" too, so this is unchanged — but pinning
240
- // it so a future "default to none" change is visible.
241
- expect(parseDeployProvider(undefined)).toBe("github-pages");
242
- });
243
- it("calls process.exit(1) for an invalid value (the audit fix)", () => {
244
- // The audit finding: the previous implementation silently
245
- // coerced invalid values to "github-pages", which masked
246
- // typos. The current implementation calls process.exit(1).
247
- // We do NOT throw inside the mock — see the beforeEach
248
- // comment for why. The test just asserts exit was called
249
- // with code 1 and the error message was informative.
250
- parseDeployProvider("vercels");
251
- expect(exitSpy).toHaveBeenCalledWith(1);
252
- // The error message names the bad value AND the valid set.
253
- const messages = errSpy.mock.calls.map((c) => String(c));
254
- expect(messages.some((m) => m.includes("vercels"))).toBe(true);
255
- expect(messages.some((m) => m.includes("vercel"))).toBe(true);
256
- });
257
- it("does NOT return 'github-pages' for an invalid value (regression guard)", () => {
258
- // The exact bug the audit found. parseDeployProvider must
259
- // NOT return a valid DeployProvider for an invalid input.
260
- // The mock makes process.exit(1) a no-op so the function
261
- // returns undefined (because the explicit `return` after
262
- // the exit is unreachable). Either way, it's not
263
- // "github-pages" — the silent-fallback path that
264
- // masked typos in CI scripts.
265
- const result = parseDeployProvider("garbage-provider");
266
- expect(result).not.toBe("github-pages");
267
- expect(exitSpy).toHaveBeenCalledWith(1);
268
- });
269
- });
270
- //# sourceMappingURL=template-loader.test.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"template-loader.test.js","sourceRoot":"","sources":["../src/template-loader.test.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;GAiBG;AACH,OAAO,EAAE,QAAQ,EAAE,EAAE,EAAE,MAAM,EAAE,UAAU,EAAE,SAAS,EAAE,EAAE,EAAE,MAAM,QAAQ,CAAC;AACzE,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,SAAS,EAAE,QAAQ,EAAE,EAAE,EAAE,OAAO,EAAQ,MAAM,kBAAkB,CAAC;AAC1F,OAAO,EAAE,YAAY,EAAE,MAAM,SAAS,CAAC;AACvC,OAAO,EAAE,MAAM,EAAE,MAAM,SAAS,CAAC;AACjC,OAAO,EAAE,IAAI,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EACL,0BAA0B,EAC1B,uBAAuB,EACvB,YAAY,GAEb,MAAM,sBAAsB,CAAC;AAC9B,OAAO,EAAE,mBAAmB,EAAE,MAAM,cAAc,CAAC;AAEnD,+DAA+D;AAC/D,kEAAkE;AAClE,+DAA+D;AAC/D,2CAA2C;AAC3C,MAAM,cAAc,GAAG,OAAO;AAC5B,gEAAgE;AAChE,oCAAoC;AACpC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,OAAO;AAC5B,kCAAkC,CACnC,CAAC;AAEF,QAAQ,CAAC,4BAA4B,EAAE,GAAG,EAAE;IAC1C,EAAE,CAAC,oEAAoE,EAAE,GAAG,EAAE;QAC5E,MAAM,CAAC,0BAA0B,CAAC,iBAAiB,EAAE,OAAO,EAAE,SAAS,CAAC,CAAC,CAAC,IAAI,CAC5E,+BAA+B,CAChC,CAAC;IACJ,CAAC,CAAC,CAAC;IAEH,EAAE,CAAC,sDAAsD,EAAE,GAAG,EAAE;QAC9D,MAAM,CAAC,0BAA0B,CAAC,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