@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.
Files changed (175) hide show
  1. package/README.md +192 -23
  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 +99 -49
  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/icons-cli.d.ts +1 -1
  22. package/dist/icons-cli.d.ts.map +1 -1
  23. package/dist/icons-cli.js +32 -14
  24. package/dist/icons-cli.js.map +1 -1
  25. package/dist/import-cli.d.ts +1 -1
  26. package/dist/import-cli.d.ts.map +1 -1
  27. package/dist/import-cli.js +6 -6
  28. package/dist/import-cli.js.map +1 -1
  29. package/dist/index.js +95 -58
  30. package/dist/index.js.map +1 -1
  31. package/dist/init.d.ts +37 -4
  32. package/dist/init.d.ts.map +1 -1
  33. package/dist/init.js +251 -57
  34. package/dist/init.js.map +1 -1
  35. package/dist/package.json +3 -2
  36. package/dist/r/about.json +22 -0
  37. package/dist/r/browse.json +89 -0
  38. package/dist/r/collections.json +59 -0
  39. package/dist/r/contributors.json +22 -0
  40. package/dist/r/default.json +438 -0
  41. package/dist/r/home.json +67 -0
  42. package/dist/r/not-found.json +22 -0
  43. package/dist/r/project-card.json +48 -0
  44. package/dist/r/record.json +59 -0
  45. package/dist/r/registry.json +903 -0
  46. package/dist/r/shell.json +75 -0
  47. package/dist/r/submit.json +28 -0
  48. package/dist/r/taxonomy.json +65 -0
  49. package/dist/r/ui.json +54 -0
  50. package/dist/readme-cli.d.ts +1 -1
  51. package/dist/readme-cli.d.ts.map +1 -1
  52. package/dist/readme-cli.js +84 -49
  53. package/dist/readme-cli.js.map +1 -1
  54. package/dist/registry.d.ts +74 -0
  55. package/dist/registry.d.ts.map +1 -0
  56. package/dist/registry.js +180 -0
  57. package/dist/registry.js.map +1 -0
  58. package/dist/run.d.ts +7 -0
  59. package/dist/run.d.ts.map +1 -0
  60. package/dist/run.js +20 -0
  61. package/dist/run.js.map +1 -0
  62. package/dist/unified-diff.d.ts +14 -0
  63. package/dist/unified-diff.d.ts.map +1 -0
  64. package/dist/unified-diff.js +103 -0
  65. package/dist/unified-diff.js.map +1 -0
  66. package/dist/update.d.ts +47 -0
  67. package/dist/update.d.ts.map +1 -0
  68. package/dist/update.js +231 -0
  69. package/dist/update.js.map +1 -0
  70. package/package.json +5 -4
  71. package/dist/site/.github/ISSUE_TEMPLATE/bug_report.md +0 -33
  72. package/dist/site/.github/ISSUE_TEMPLATE/feature_request.md +0 -20
  73. package/dist/site/.github/ISSUE_TEMPLATE/record_submission.md +0 -48
  74. package/dist/site/.github/pull_request_template.md +0 -27
  75. package/dist/site/.github/workflows/ci.yml +0 -21
  76. package/dist/site/.github/workflows/cleanup.yml +0 -23
  77. package/dist/site/.github/workflows/deploy.yml +0 -36
  78. package/dist/site/.github/workflows/readme.yml +0 -41
  79. package/dist/site/.github/workflows/sync-contributors.yml +0 -28
  80. package/dist/site/.github/workflows/sync-github.yml +0 -31
  81. package/dist/site/README.md +0 -89
  82. package/dist/site/astro.config.mjs +0 -26
  83. package/dist/site/content/records/crewai.md +0 -898
  84. package/dist/site/content/records/dify.md +0 -35
  85. package/dist/site/content/records/flowise.md +0 -38
  86. package/dist/site/content/records/llamaindex.md +0 -45
  87. package/dist/site/content/records/ollama.md +0 -39
  88. package/dist/site/content/records/open-webui.md +0 -35
  89. package/dist/site/data/collections/top-ai-agents.yml +0 -14
  90. package/dist/site/data/collections/top-flutter.yml +0 -12
  91. package/dist/site/data/health.yml +0 -13
  92. package/dist/site/data/records/.gitkeep +0 -0
  93. package/dist/site/data/records/crewai.yml +0 -23
  94. package/dist/site/data/records/dify.yml +0 -23
  95. package/dist/site/data/records/flowise.yml +0 -23
  96. package/dist/site/data/records/llamaindex.yml +0 -23
  97. package/dist/site/data/records/ollama.yml +0 -30
  98. package/dist/site/data/records/open-webui.yml +0 -23
  99. package/dist/site/data/taxonomy/categories.yml +0 -10
  100. package/dist/site/data/taxonomy/distribution-channels.yml +0 -43
  101. package/dist/site/data/taxonomy/licenses.yml +0 -16
  102. package/dist/site/data/taxonomy/platforms.yml +0 -20
  103. package/dist/site/data/taxonomy/stacks.yml +0 -15
  104. package/dist/site/data/taxonomy/topics.yml +0 -29
  105. package/dist/site/grove.config.ts +0 -110
  106. package/dist/site/package.json +0 -34
  107. package/dist/site/public/icons/.grove-icons.json +0 -47
  108. package/dist/site/public/icons/platforms/android.svg +0 -1
  109. package/dist/site/public/icons/platforms/app.svg +0 -4
  110. package/dist/site/public/icons/platforms/chrome.svg +0 -1
  111. package/dist/site/public/icons/platforms/desktop.svg +0 -4
  112. package/dist/site/public/icons/platforms/embedded.svg +0 -5
  113. package/dist/site/public/icons/platforms/ios.svg +0 -1
  114. package/dist/site/public/icons/platforms/linux.svg +0 -1
  115. package/dist/site/public/icons/platforms/macos.svg +0 -1
  116. package/dist/site/public/icons/platforms/ubuntu.svg +0 -1
  117. package/dist/site/public/icons/platforms/web.svg +0 -5
  118. package/dist/site/public/icons/platforms/windows.svg +0 -1
  119. package/dist/site/public/icons/stacks/android.svg +0 -1
  120. package/dist/site/public/icons/stacks/apple.svg +0 -1
  121. package/dist/site/public/icons/stacks/bun.svg +0 -1
  122. package/dist/site/public/icons/stacks/capacitor.svg +0 -1
  123. package/dist/site/public/icons/stacks/clojure.svg +0 -1
  124. package/dist/site/public/icons/stacks/dart.svg +0 -1
  125. package/dist/site/public/icons/stacks/deno.svg +0 -1
  126. package/dist/site/public/icons/stacks/django.svg +0 -1
  127. package/dist/site/public/icons/stacks/docker.svg +0 -1
  128. package/dist/site/public/icons/stacks/firebase.svg +0 -1
  129. package/dist/site/public/icons/stacks/flutter.svg +0 -1
  130. package/dist/site/public/icons/stacks/go.svg +0 -1
  131. package/dist/site/public/icons/stacks/graphql.svg +0 -1
  132. package/dist/site/public/icons/stacks/ionic.svg +0 -1
  133. package/dist/site/public/icons/stacks/java.svg +0 -1
  134. package/dist/site/public/icons/stacks/javascript.svg +0 -1
  135. package/dist/site/public/icons/stacks/kotlin.svg +0 -1
  136. package/dist/site/public/icons/stacks/llm.svg +0 -4
  137. package/dist/site/public/icons/stacks/mongodb.svg +0 -1
  138. package/dist/site/public/icons/stacks/nodejs.svg +0 -1
  139. package/dist/site/public/icons/stacks/python.svg +0 -1
  140. package/dist/site/public/icons/stacks/rag.svg +0 -6
  141. package/dist/site/public/icons/stacks/react-native.svg +0 -1
  142. package/dist/site/public/icons/stacks/react.svg +0 -1
  143. package/dist/site/public/icons/stacks/rust.svg +0 -1
  144. package/dist/site/public/icons/stacks/solidity.svg +0 -1
  145. package/dist/site/public/icons/stacks/sveltekit.svg +0 -1
  146. package/dist/site/public/icons/stacks/swift.svg +0 -1
  147. package/dist/site/public/icons/stacks/tauri.svg +0 -1
  148. package/dist/site/public/icons/stacks/tensorflow.svg +0 -1
  149. package/dist/site/public/icons/stacks/typescript.svg +0 -1
  150. package/dist/site/public/icons/stacks/vue.svg +0 -1
  151. package/dist/site/public/logo.svg +0 -16
  152. package/dist/site/src/components/DirectoryBrowse.astro +0 -246
  153. package/dist/site/src/components/PipelineStrip.astro +0 -121
  154. package/dist/site/src/components/TaxonomyList.astro +0 -108
  155. package/dist/site/src/pages/404.astro +0 -63
  156. package/dist/site/src/pages/[slug]/[recordSlug].astro +0 -71
  157. package/dist/site/src/pages/[slug]/index.astro +0 -19
  158. package/dist/site/src/pages/[slug]/page/[page].astro +0 -32
  159. package/dist/site/src/pages/[slug]/page/cards.astro +0 -50
  160. package/dist/site/src/pages/[slug]/page/records.json.ts +0 -24
  161. package/dist/site/src/pages/about.astro +0 -130
  162. package/dist/site/src/pages/categories/[name].astro +0 -35
  163. package/dist/site/src/pages/categories/index.astro +0 -33
  164. package/dist/site/src/pages/collections/[slug].astro +0 -45
  165. package/dist/site/src/pages/collections/index.astro +0 -32
  166. package/dist/site/src/pages/contributors.astro +0 -115
  167. package/dist/site/src/pages/empty.astro +0 -24
  168. package/dist/site/src/pages/index.astro +0 -161
  169. package/dist/site/src/pages/licenses/[name].astro +0 -35
  170. package/dist/site/src/pages/stacks/[name].astro +0 -35
  171. package/dist/site/src/pages/stacks/index.astro +0 -35
  172. package/dist/site/src/pages/submit.astro +0 -183
  173. package/dist/site/src/styles/global.css +0 -21
  174. package/dist/site/tsconfig.json +0 -13
  175. /package/{dist/site/LICENSE → LICENSE} +0 -0
package/README.md CHANGED
@@ -1,29 +1,183 @@
1
1
  # `@grove-dev/cli`
2
2
 
3
- The deliberately small CLI for Grove directories.
3
+ The deliberately small CLI for Grove. It scaffolds new projects,
4
+ validates sources, refreshes external metadata, and writes the
5
+ maintenance reports that keep generated outputs in sync with the
6
+ files you own.
7
+
8
+ Grove does not replace Astro. Use Astro's normal `pnpm dev` and
9
+ `pnpm build` — the `@grove-dev/astro` integration prepares data
10
+ automatically. `grove init` installs the `@grove/default` scaffold
11
+ (a shadcn registry item, shipped inside this CLI so `init` works
12
+ offline) with the official shadcn CLI, and `grove update` reconciles
13
+ that install against the hosted registry later without overwriting
14
+ files you have edited.
15
+
16
+ ## Install
17
+
18
+ The recommended path is to run commands with `pnpm dlx`:
4
19
 
5
20
  ```bash
6
- pnpm dlx @grove-dev/cli init my-directory
21
+ pnpm dlx @grove-dev/cli@latest init my-space
7
22
  ```
8
23
 
24
+ Or install it as a dev dependency inside a Grove project:
25
+
26
+ ```bash
27
+ pnpm add -D @grove-dev/cli
28
+ ```
29
+
30
+ Requires Node.js `>=22.12.0`.
31
+
9
32
  ## Commands
10
33
 
11
- - `grove init [directory]` copies the canonical working Grove site and installs it.
12
- - `grove check [--strict]` validates YAML, prepares artifacts, and runs `astro check`.
13
- - `grove sync github` refreshes record repository metadata.
14
- - `grove sync contributors` refreshes directory-community metadata.
15
- - `grove cleanup [--strict]` writes the human-review report.
16
- - `grove collection promote --from PATH --slug SLUG [--title T] [--description D]` writes a curated collection YAML from a filter URL.
17
- - `grove readme generate [--stdout] [--path PATH] [--check]` renders the awesome-list README block.
18
- - `grove audit` runs Lighthouse against every page declared in `grove.config.ts` `audit.pages[]` and enforces the default quality budget.
34
+ | Command | Purpose |
35
+ | --- | --- |
36
+ | `grove init [directory]` | Scaffold a project in `[directory]`: config files, then the `@grove/default` registry item installed through the shadcn CLI. |
37
+ | `grove check [--strict]` | Validate YAML sources, prepare artifacts, and run `astro check`. |
38
+ | `grove update` | Reconcile the installed UI scaffold against the registry upstream, preserving files you edited. |
39
+ | `grove sync github` | Refresh repository metadata for records that point at a GitHub repo. |
40
+ | `grove sync contributors` | Refresh directory-community metadata from configured sources. |
41
+ | `grove icons sync` | Reconcile the consumer's `public/icons/` with the packaged set. |
42
+ | `grove cleanup [--strict]` | Write the human-review report listing stale or archived records. |
43
+ | `grove collection promote` | Write a curated collection YAML from a filter URL. |
44
+ | `grove import` | Import records from an external source (for example, an awesome-list README). |
45
+ | `grove readme generate` | Render the generated README section (awesome-list block or consumer-facing summary). |
46
+ | `grove audit` | Run Lighthouse against every page declared in `grove.config.ts` `audit.pages[]` and enforce the default quality budget. |
47
+
48
+ ### `grove init`
19
49
 
20
- There are no framework, blueprint, template, deployment, build, or dev commands. Use Astro's normal `pnpm dev` and `pnpm build`; the integration prepares data automatically. The CLI bundles a release snapshot of the repository's real `apps/example/`, so the demo and generated project cannot drift into separate implementations.
50
+ ```bash
51
+ grove init my-space
52
+ ```
53
+
54
+ Copies the canonical working Grove site into `my-space/` and runs
55
+ `pnpm install`. Use `--no-install` to skip dependency installation or
56
+ `--no-git` to skip the initial `git init`.
57
+
58
+ ### `grove check`
21
59
 
22
- ## Audit
60
+ ```bash
61
+ grove check
62
+ grove check --strict
63
+ ```
23
64
 
24
- `grove audit` runs Lighthouse against every page declared in `grove.config.ts` `audit.pages[]` and enforces the default quality budget (Lighthouse cannot meaningfully score 404 responses, so `type: "404"` pages are audited for completeness but are exempt from the budget).
65
+ Loads `grove.config.ts`, validates every record and decision file,
66
+ runs `prepareDirectory()`, and finishes with `astro check`. With
67
+ `--strict`, Grove warnings are treated as errors.
25
68
 
26
- ### Options
69
+ ### `grove sync github`
70
+
71
+ ```bash
72
+ grove sync github
73
+ ```
74
+
75
+ Re-fetches the GitHub metadata that the generated record payloads
76
+ expose — stars, default branch, license, latest release, archived
77
+ flag, and so on. Produces a patch that `grove check` can apply.
78
+
79
+ ### `grove sync contributors`
80
+
81
+ ```bash
82
+ grove sync contributors
83
+ ```
84
+
85
+ Refreshes the contributor list rendered on the contributors page
86
+ from the configured sources.
87
+
88
+ ### `grove icons sync`
89
+
90
+ ```bash
91
+ grove icons sync
92
+ grove icons sync --force
93
+ grove icons sync --check
94
+ ```
95
+
96
+ Reconciles the consumer's `public/icons/` with the packaged set.
97
+ Locally edited files are left alone and reported. `--force` restores
98
+ the packaged versions; `--check` exits non-zero on any drift, which is
99
+ what CI should run.
100
+
101
+ ### `grove update`
102
+
103
+ ```bash
104
+ grove update # apply what is safe
105
+ grove update --check # print the plan, touch nothing
106
+ grove update --diff # unified diff for every file upstream moved
107
+ grove update --force # take the upstream side of a conflict
108
+ grove update --json # machine-readable summary
109
+ ```
110
+
111
+ Three-way reconcile of your installed UI against the registry upstream.
112
+ Files you edited are never overwritten; files where both sides moved are
113
+ reported as conflicts and left alone unless you pass `--force`. Exits `2`
114
+ while a conflict is unresolved, and keeps doing so on every subsequent
115
+ run until it is merged.
116
+
117
+ ### `grove cleanup`
118
+
119
+ ```bash
120
+ grove cleanup
121
+ grove cleanup --strict
122
+ ```
123
+
124
+ Classifies records against their health signals and writes a
125
+ human-review queue. The CLI never deletes records — it produces a
126
+ file an editor can act on. With `--strict`, Grove warnings are
127
+ treated as errors.
128
+
129
+ ### `grove collection promote`
130
+
131
+ ```bash
132
+ grove collection promote --from PATH --slug SLUG [--title T] [--description D]
133
+ ```
134
+
135
+ Writes a curated collection YAML from a filter URL. The result is a
136
+ file under the configured collections directory that the build
137
+ pipeline renders as a static page.
138
+
139
+ ### `grove import`
140
+
141
+ ```bash
142
+ grove import <source>
143
+ ```
144
+
145
+ Imports records from an external source. The exact inputs depend on
146
+ the importer (for example, an awesome-list README); pass `--help`
147
+ for the current contract.
148
+
149
+ ### `grove readme generate`
150
+
151
+ ```bash
152
+ grove readme generate
153
+ grove readme generate --stdout
154
+ grove readme generate --path README.md
155
+ grove readme generate --check
156
+ ```
157
+
158
+ Renders the generated README section. `--stdout` prints to standard
159
+ output. `--path` targets a specific file. `--check` exits non-zero
160
+ when the rendered block would differ from what is currently on disk
161
+ — useful for CI.
162
+
163
+ ### `grove audit`
164
+
165
+ ```bash
166
+ grove audit
167
+ grove audit --base-url https://staging.example.com
168
+ grove audit --mobile
169
+ grove audit --desktop
170
+ grove audit --runs 5
171
+ grove audit --page / --page /directory
172
+ grove audit --json report.json
173
+ grove audit --junit report.xml
174
+ ```
175
+
176
+ Runs Lighthouse against every page declared in
177
+ `grove.config.ts` `audit.pages[]` and enforces the default quality
178
+ budget.
179
+
180
+ #### Options
27
181
 
28
182
  | Flag | Description |
29
183
  | --- | --- |
@@ -35,23 +189,38 @@ There are no framework, blueprint, template, deployment, build, or dev commands.
35
189
  | `--json <file>` | Write a machine-readable JSON report to `<file>`. |
36
190
  | `--junit <file>` | Write a JUnit XML report to `<file>`. |
37
191
 
38
- ### Default budget
192
+ #### Default budget
39
193
 
40
- The shipped budget targets Lighthouse "good" thresholds on every score category and metric:
194
+ The shipped budget targets Lighthouse "good" thresholds on every
195
+ score category and metric:
41
196
 
42
- - **Score categories** (`performance`, `accessibility`, `best-practices`, `seo`) ≥ 0.9
197
+ - **Score categories** (`performance`, `accessibility`,
198
+ `best-practices`, `seo`) ≥ 0.9
43
199
  - **LCP** ≤ 2500 ms
44
200
  - **CLS** ≤ 0.25
45
201
  - **TBT** ≤ 200 ms
46
202
 
47
- The budget is skipped for `type: "404"` pages — Lighthouse returns `0`/`Infinity` for missing pages by design.
203
+ The budget is skipped for `type: "404"` pages — Lighthouse returns
204
+ `0`/`Infinity` for missing pages by design.
48
205
 
49
- ### Output and exit codes
206
+ #### Output and exit codes
50
207
 
51
- - stdout: per-run progress (`✓ <profile> <path>`) plus a final summary.
208
+ - stdout: per-run progress (`✓ <profile> <path>`) plus a final
209
+ summary.
52
210
  - stderr: a list of every budget violation, when any occur.
53
- - optional `--json` and `--junit` reports capture the full result set for CI.
211
+ - `--json` and `--junit` reports capture the full result set for CI.
212
+
213
+ `grove audit` exits with code `0` when every page passes the budget
214
+ and `1` if any violation is detected, so it drops cleanly into CI
215
+ pipelines.
216
+
217
+ ## Develop the CLI
218
+
219
+ ```bash
220
+ pnpm --filter @grove-dev/cli check
221
+ pnpm --filter @grove-dev/cli dev -- --help
222
+ ```
54
223
 
55
- `grove audit` exits with code `0` when every page passes the budget and `1` if any violation is detected, so it drops cleanly into CI pipelines.
224
+ ## License
56
225
 
57
- MIT
226
+ [MIT](../../LICENSE) © Grove contributors.
@@ -1,3 +1,3 @@
1
- import { Command } from "commander";
1
+ import { Command } from 'commander';
2
2
  export declare function buildAuditCommand(): Command;
3
3
  //# sourceMappingURL=audit-cli.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"audit-cli.d.ts","sourceRoot":"","sources":["../src/audit-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,iBAAiB,IAAI,OAAO,CAa3C"}
1
+ {"version":3,"file":"audit-cli.d.ts","sourceRoot":"","sources":["../src/audit-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AAGpC,wBAAgB,iBAAiB,IAAI,OAAO,CAe3C"}
package/dist/audit-cli.js CHANGED
@@ -1,15 +1,15 @@
1
- import { Command } from "commander";
2
- import { runAudit } from "./audit.js";
1
+ import { Command } from 'commander';
2
+ import { runAudit } from './audit.js';
3
3
  export function buildAuditCommand() {
4
- return new Command("audit")
5
- .description("Run Lighthouse against every page in grove.config.ts audit.pages[] and enforce the default quality budget.")
6
- .option("--base-url <url>", "Override audit.baseUrl from grove.config.ts")
7
- .option("--mobile", "Mobile profile only")
8
- .option("--desktop", "Desktop profile only")
9
- .option("--runs <count>", "Runs per page (default 3, max 5)", (v) => parseInt(v, 10), 3)
10
- .option("--page <path>", "Audit a single page path (repeatable)", collect, [])
11
- .option("--json <path>", "Write JSON report")
12
- .option("--junit <path>", "Write JUnit XML report")
4
+ return new Command('audit')
5
+ .description('Run Lighthouse against every page in grove.config.ts audit.pages[] and enforce the default quality budget.')
6
+ .option('--base-url <url>', 'Override audit.baseUrl from grove.config.ts')
7
+ .option('--mobile', 'Mobile profile only')
8
+ .option('--desktop', 'Desktop profile only')
9
+ .option('--runs <count>', 'Runs per page (default 3, max 5)', (v) => parseInt(v, 10), 3)
10
+ .option('--page <path>', 'Audit a single page path (repeatable)', collect, [])
11
+ .option('--json <path>', 'Write JSON report')
12
+ .option('--junit <path>', 'Write JUnit XML report')
13
13
  .action(async (opts) => {
14
14
  process.exitCode = await runAudit(opts);
15
15
  });
@@ -1 +1 @@
1
- {"version":3,"file":"audit-cli.js","sourceRoot":"","sources":["../src/audit-cli.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEtC,MAAM,UAAU,iBAAiB;IAC/B,OAAO,IAAI,OAAO,CAAC,OAAO,CAAC;SACxB,W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EAAE,CAAC,EAAE,CAAC,CAAC;SACvF,MAAM,CAAC,eAAe,EAAE,uCAAuC,EAAE,OAAO,EAAE,EAAc,CAAC;SACzF,MAAM,CAAC,eAAe,EAAE,mBAAmB,CAAC;SAC5C,MAAM,CAAC,gBAAgB,EAAE,wBAAwB,CAAC;SAClD,MAAM,CAAC,KAAK,EAAE,IAAI,EAAE,EAAE;QACrB,OAAO,CAAC,QAAQ,GAAG,MAAM,QAAQ,CAAC,IAAI,CAAC,CAAC;IAC1C,CAAC,CAAC,CAAC;AACP,CAAC;AAED,SAAS,OAAO,CAAC,KAAa,EAAE,QAAkB;IAChD,OAAO,CAAC,GAAG,QAAQ,EAAE,KAAK,CAAC,CAAC;AAC9B,CAAC"}
package/dist/audit.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { type Result as LHResult } from "lighthouse";
2
- import * as ts from "typescript";
3
- import { type AuditResult, type LighthouseMetrics, type LighthouseScores, type PageManifestEntry, type PageType, type Profile } from "@grove-dev/core";
1
+ import { type AuditResult, type LighthouseMetrics, type LighthouseScores, type PageManifestEntry, type PageType, type Profile } from '@grove-dev/core';
2
+ import { type Result as LHResult } from 'lighthouse';
3
+ import * as ts from 'typescript';
4
4
  export interface AuditCliOptions {
5
5
  baseUrl?: string;
6
6
  mobile?: boolean;
@@ -23,5 +23,5 @@ export declare function parsePageEntry(node: ts.ObjectLiteralExpression): PageMa
23
23
  export declare function propName(name: ts.PropertyName): string;
24
24
  export declare function extractScores(lhr: LHResult): LighthouseScores;
25
25
  export declare function extractMetrics(lhr: LHResult): LighthouseMetrics;
26
- export declare function aggregateRuns(url: string, type: PageType, profile: Profile, runs: Array<Omit<AuditResult, "runs">>): AuditResult;
26
+ export declare function aggregateRuns(url: string, type: PageType, profile: Profile, runs: Array<Omit<AuditResult, 'runs'>>): AuditResult;
27
27
  //# sourceMappingURL=audit.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"audit.d.ts","sourceRoot":"","sources":["../src/audit.ts"],"names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G,iBAAiB,CAYlF;AAED,wBAAgB,QAAQ,CAAC,IAAI,EAAE,EAAE,CAAC,YAAY,GAAG,MAAM,CAKtD;AAuBD,wBAAgB,aAAa,CAAC,GAAG,EAAE,QAAQ,GAAG,gBAAgB,CAQ7D;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,QAAQ,GAAG,iBAAiB,CAO/D;AAED,wBAAgB,aAAa,CAC3B,GAAG,EAAE,MAAM,EACX,IAAI,EAAE,QAAQ,EACd,OAAO,EAAE,OAAO,EAChB,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC,GACrC,WAAW,CA0Bb"}
package/dist/audit.js CHANGED
@@ -1,10 +1,18 @@
1
- import * as chromeLauncher from "chrome-launcher";
2
- import lighthouse from "lighthouse";
3
- import * as ts from "typescript";
4
- import { readFile, writeFile } from "node:fs/promises";
5
- import { resolve } from "node:path";
6
- import { DEFAULT_BUDGET, evaluateBudget, } from "@grove-dev/core";
7
- const ALLOWED_TYPES = new Set(["home", "directory", "collection", "record", "content", "empty", "404"]);
1
+ import { readFile, writeFile } from 'node:fs/promises';
2
+ import { resolve } from 'node:path';
3
+ import { DEFAULT_BUDGET, evaluateBudget, } from '@grove-dev/core';
4
+ import * as chromeLauncher from 'chrome-launcher';
5
+ import lighthouse from 'lighthouse';
6
+ import * as ts from 'typescript';
7
+ const ALLOWED_TYPES = new Set([
8
+ 'home',
9
+ 'directory',
10
+ 'collection',
11
+ 'record',
12
+ 'content',
13
+ 'empty',
14
+ '404',
15
+ ]);
8
16
  export async function runAudit(opts) {
9
17
  const manifest = await loadManifest(process.cwd());
10
18
  const baseUrl = opts.baseUrl ?? manifest.baseUrl;
@@ -12,6 +20,16 @@ export async function runAudit(opts) {
12
20
  const runs = clampRuns(opts.runs);
13
21
  const pageFilter = opts.page.length > 0 ? new Set(opts.page) : null;
14
22
  const pages = manifest.pages.filter((p) => !pageFilter || pageFilter.has(p.path));
23
+ // A `--page` value that matches nothing used to leave `pages` empty,
24
+ // which skipped every loop below and still printed a passing
25
+ // scorecard with an exit code of 0 — a typo in CI read as a green
26
+ // audit. Fail loudly instead, and name the paths that do exist.
27
+ if (pages.length === 0) {
28
+ const known = manifest.pages.map((p) => p.path).join(', ');
29
+ console.error(`[audit] no pages matched ${[...(pageFilter ?? [])].join(', ')}. ` +
30
+ `audit.pages[] declares: ${known}`);
31
+ return 1;
32
+ }
15
33
  const results = [];
16
34
  const chrome = await chromeLauncher.launch({
17
35
  chromeFlags: buildChromeFlags(process.platform, true),
@@ -26,22 +44,50 @@ export async function runAudit(opts) {
26
44
  const start = Date.now();
27
45
  const result = await lighthouse(url, {
28
46
  port: chrome.port,
29
- output: "json",
30
- logLevel: "error",
31
- onlyCategories: ["performance", "accessibility", "best-practices", "seo"],
47
+ output: 'json',
48
+ logLevel: 'error',
49
+ onlyCategories: ['performance', 'accessibility', 'best-practices', 'seo'],
32
50
  formFactor: profile,
33
- screenEmulation: profile === "mobile"
34
- ? { mobile: true, width: 412, height: 823, deviceScaleFactor: 1.75, disabled: false }
35
- : { mobile: false, width: 1350, height: 940, deviceScaleFactor: 1, disabled: false },
36
- throttling: profile === "mobile"
37
- ? { rttMs: 150, throughputKbps: 1638.4, requestLatencyMs: 562.5, downloadThroughputKbps: 1474.56, uploadThroughputKbps: 675, cpuSlowdownMultiplier: 4 }
38
- : { rttMs: 40, throughputKbps: 10240, cpuSlowdownMultiplier: 1, requestLatencyMs: 0, downloadThroughputKbps: 0, uploadThroughputKbps: 0 },
51
+ screenEmulation: profile === 'mobile'
52
+ ? {
53
+ mobile: true,
54
+ width: 412,
55
+ height: 823,
56
+ deviceScaleFactor: 1.75,
57
+ disabled: false,
58
+ }
59
+ : {
60
+ mobile: false,
61
+ width: 1350,
62
+ height: 940,
63
+ deviceScaleFactor: 1,
64
+ disabled: false,
65
+ },
66
+ throttling: profile === 'mobile'
67
+ ? {
68
+ rttMs: 150,
69
+ throughputKbps: 1638.4,
70
+ requestLatencyMs: 562.5,
71
+ downloadThroughputKbps: 1474.56,
72
+ uploadThroughputKbps: 675,
73
+ cpuSlowdownMultiplier: 4,
74
+ }
75
+ : {
76
+ rttMs: 40,
77
+ throughputKbps: 10240,
78
+ cpuSlowdownMultiplier: 1,
79
+ requestLatencyMs: 0,
80
+ downloadThroughputKbps: 0,
81
+ uploadThroughputKbps: 0,
82
+ },
39
83
  });
40
84
  if (!result)
41
85
  throw new Error(`Lighthouse returned no result for ${url}`);
42
86
  const lhr = result.lhr;
43
87
  runsFor.push({
44
- url, type: page.type, profile,
88
+ url,
89
+ type: page.type,
90
+ profile,
45
91
  scores: extractScores(lhr),
46
92
  metrics: extractMetrics(lhr),
47
93
  durationMs: Date.now() - start,
@@ -83,12 +129,12 @@ export async function runAudit(opts) {
83
129
  return 0;
84
130
  }
85
131
  export async function loadManifest(cwd) {
86
- const configPath = resolve(cwd, "grove.config.ts");
87
- const source = await readFile(configPath, "utf8");
88
- const ast = ts.createSourceFile("grove.config.ts", source, ts.ScriptTarget.ESNext, true, ts.ScriptKind.TS);
132
+ const configPath = resolve(cwd, 'grove.config.ts');
133
+ const source = await readFile(configPath, 'utf8');
134
+ const ast = ts.createSourceFile('grove.config.ts', source, ts.ScriptTarget.ESNext, true, ts.ScriptKind.TS);
89
135
  function extractAuditFromConfigLiteral(node) {
90
136
  for (const prop of node.properties) {
91
- if (ts.isPropertyAssignment(prop) && propName(prop.name) === "audit") {
137
+ if (ts.isPropertyAssignment(prop) && propName(prop.name) === 'audit') {
92
138
  if (ts.isObjectLiteralExpression(prop.initializer)) {
93
139
  return parseAuditBlock(prop.initializer);
94
140
  }
@@ -114,12 +160,12 @@ export async function loadManifest(cwd) {
114
160
  }
115
161
  }
116
162
  if (!audit?.pages?.length)
117
- throw new Error("grove.config.ts must declare audit.pages[]");
163
+ throw new Error('grove.config.ts must declare audit.pages[]');
118
164
  for (const page of audit.pages) {
119
165
  if (!ALLOWED_TYPES.has(page.type))
120
166
  throw new Error(`Invalid page type "${page.type}" for ${page.path}`);
121
167
  }
122
- return { baseUrl: audit.baseUrl ?? "http://127.0.0.1:4321", pages: audit.pages };
168
+ return { baseUrl: audit.baseUrl ?? 'http://127.0.0.1:4321', pages: audit.pages };
123
169
  }
124
170
  export function parseAuditBlock(node) {
125
171
  const out = { pages: [] };
@@ -127,9 +173,9 @@ export function parseAuditBlock(node) {
127
173
  if (!ts.isPropertyAssignment(prop))
128
174
  continue;
129
175
  const name = propName(prop.name);
130
- if (name === "baseUrl" && ts.isStringLiteral(prop.initializer))
176
+ if (name === 'baseUrl' && ts.isStringLiteral(prop.initializer))
131
177
  out.baseUrl = prop.initializer.text;
132
- if (name === "pages" && ts.isArrayLiteralExpression(prop.initializer)) {
178
+ if (name === 'pages' && ts.isArrayLiteralExpression(prop.initializer)) {
133
179
  out.pages = prop.initializer.elements
134
180
  .filter(ts.isObjectLiteralExpression)
135
181
  .map((el) => parsePageEntry(el));
@@ -138,16 +184,16 @@ export function parseAuditBlock(node) {
138
184
  return out;
139
185
  }
140
186
  export function parsePageEntry(node) {
141
- const entry = { path: "", type: "home", label: "" };
187
+ const entry = { path: '', type: 'home', label: '' };
142
188
  for (const prop of node.properties) {
143
189
  if (!ts.isPropertyAssignment(prop))
144
190
  continue;
145
191
  const name = propName(prop.name);
146
- if (name === "path" && ts.isStringLiteral(prop.initializer))
192
+ if (name === 'path' && ts.isStringLiteral(prop.initializer))
147
193
  entry.path = prop.initializer.text;
148
- if (name === "type" && ts.isStringLiteral(prop.initializer))
194
+ if (name === 'type' && ts.isStringLiteral(prop.initializer))
149
195
  entry.type = prop.initializer.text;
150
- if (name === "label" && ts.isStringLiteral(prop.initializer))
196
+ if (name === 'label' && ts.isStringLiteral(prop.initializer))
151
197
  entry.label = prop.initializer.text;
152
198
  }
153
199
  return entry;
@@ -160,10 +206,10 @@ export function propName(name) {
160
206
  }
161
207
  function profilesFromOptions(opts) {
162
208
  if (opts.mobile && !opts.desktop)
163
- return ["mobile"];
209
+ return ['mobile'];
164
210
  if (opts.desktop && !opts.mobile)
165
- return ["desktop"];
166
- return ["mobile", "desktop"];
211
+ return ['desktop'];
212
+ return ['mobile', 'desktop'];
167
213
  }
168
214
  function clampRuns(input) {
169
215
  return Math.min(Math.max(input, 1), 5);
@@ -171,34 +217,34 @@ function clampRuns(input) {
171
217
  function buildChromeFlags(platform, headless) {
172
218
  const flags = [];
173
219
  if (headless)
174
- flags.push("--headless=new", "--disable-gpu", "--disable-dev-shm-usage");
175
- if (platform === "linux")
176
- flags.push("--no-sandbox");
220
+ flags.push('--headless=new', '--disable-gpu', '--disable-dev-shm-usage');
221
+ if (platform === 'linux')
222
+ flags.push('--no-sandbox');
177
223
  return flags;
178
224
  }
179
225
  function joinUrl(base, path) {
180
- return new URL(path, base.endsWith("/") ? base : `${base}/`).toString();
226
+ return new URL(path, base.endsWith('/') ? base : `${base}/`).toString();
181
227
  }
182
228
  export function extractScores(lhr) {
183
229
  const c = lhr.categories ?? {};
184
230
  return {
185
231
  performance: c.performance?.score ?? 0,
186
232
  accessibility: c.accessibility?.score ?? 0,
187
- bestPractices: c["best-practices"]?.score ?? 0,
233
+ bestPractices: c['best-practices']?.score ?? 0,
188
234
  seo: c.seo?.score ?? 0,
189
235
  };
190
236
  }
191
237
  export function extractMetrics(lhr) {
192
238
  const a = lhr.audits ?? {};
193
239
  return {
194
- lcp: a["largest-contentful-paint"]?.numericValue ?? Infinity,
195
- cls: a["cumulative-layout-shift"]?.numericValue ?? Infinity,
196
- tbt: a["total-blocking-time"]?.numericValue ?? Infinity,
240
+ lcp: a['largest-contentful-paint']?.numericValue ?? Infinity,
241
+ cls: a['cumulative-layout-shift']?.numericValue ?? Infinity,
242
+ tbt: a['total-blocking-time']?.numericValue ?? Infinity,
197
243
  };
198
244
  }
199
245
  export function aggregateRuns(url, type, profile, runs) {
200
246
  if (runs.length === 0)
201
- throw new Error("aggregateRuns requires at least one run");
247
+ throw new Error('aggregateRuns requires at least one run');
202
248
  const med = (vals) => {
203
249
  const sorted = [...vals].sort((a, b) => a - b);
204
250
  const mid = Math.floor(sorted.length / 2);
@@ -207,7 +253,9 @@ export function aggregateRuns(url, type, profile, runs) {
207
253
  return ((sorted[mid - 1] ?? 0) + (sorted[mid] ?? 0)) / 2;
208
254
  };
209
255
  return {
210
- url, type, profile,
256
+ url,
257
+ type,
258
+ profile,
211
259
  scores: {
212
260
  performance: med(runs.map((r) => r.scores.performance)),
213
261
  accessibility: med(runs.map((r) => r.scores.accessibility)),
@@ -224,7 +272,7 @@ export function aggregateRuns(url, type, profile, runs) {
224
272
  };
225
273
  }
226
274
  async function writeJsonReport(path, results, violations) {
227
- await writeFile(path, JSON.stringify({ results, violations }, null, 2), "utf8");
275
+ await writeFile(path, JSON.stringify({ results, violations }, null, 2), 'utf8');
228
276
  }
229
277
  async function writeJunitReport(path, results, violations) {
230
278
  const failures = new Map();
@@ -234,21 +282,23 @@ async function writeJunitReport(path, results, violations) {
234
282
  list.push(v);
235
283
  failures.set(key, list);
236
284
  }
237
- const cases = results.map((r) => {
285
+ const cases = results
286
+ .map((r) => {
238
287
  const key = `${r.profile}:${new URL(r.url).pathname}`;
239
288
  const failed = failures.get(key);
240
289
  const failure = failed && failed.length > 0
241
- ? `<failure type="${failed[0].category}" message="${esc(failed.map((f) => `${f.name}: expected ${f.expected}, got ${f.actual}`).join("; "))}"/>`
242
- : "";
290
+ ? `<failure type="${failed[0].category}" message="${esc(failed.map((f) => `${f.name}: expected ${f.expected}, got ${f.actual}`).join('; '))}"/>`
291
+ : '';
243
292
  return `<testcase name="${esc(r.profile)} ${esc(new URL(r.url).pathname)}" classname="grove.audit">${failure}</testcase>`;
244
- }).join("\n");
293
+ })
294
+ .join('\n');
245
295
  const xml = `<?xml version="1.0" encoding="UTF-8"?>
246
296
  <testsuite name="grove-audit" tests="${results.length}" failures="${violations.length}">
247
297
  ${cases}
248
298
  </testsuite>`;
249
- await writeFile(path, xml, "utf8");
299
+ await writeFile(path, xml, 'utf8');
250
300
  }
251
301
  function esc(s) {
252
- return s.replace(/[<>&'"]/g, (c) => ({ "<": "&lt;", ">": "&gt;", "&": "&amp;", "'": "&apos;", '"': "&quot;" }[c] ?? c));
302
+ return s.replace(/[<>&'"]/g, (c) => ({ '<': '&lt;', '>': '&gt;', '&': '&amp;', "'": '&apos;', '"': '&quot;' })[c] ?? c);
253
303
  }
254
304
  //# sourceMappingURL=audit.js.map