@vscode/component-explorer-cli 0.1.1-5 → 0.1.1-6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +178 -0
- package/dist/commands/acceptCommand.d.ts +2 -1
- package/dist/commands/acceptCommand.d.ts.map +1 -1
- package/dist/commands/acceptCommand.js +12 -6
- package/dist/commands/acceptCommand.js.map +1 -1
- package/dist/commands/compareCommand.d.ts +8 -1
- package/dist/commands/compareCommand.d.ts.map +1 -1
- package/dist/commands/compareCommand.js +197 -33
- package/dist/commands/compareCommand.js.map +1 -1
- package/dist/commands/mcpCommand.d.ts +1 -1
- package/dist/commands/mcpCommand.d.ts.map +1 -1
- package/dist/commands/mcpCommand.js +9 -3
- package/dist/commands/mcpCommand.js.map +1 -1
- package/dist/commands/screenshotCommand.d.ts +7 -2
- package/dist/commands/screenshotCommand.d.ts.map +1 -1
- package/dist/commands/screenshotCommand.js +111 -10
- package/dist/commands/screenshotCommand.js.map +1 -1
- package/dist/commands/serveCommand.d.ts +1 -1
- package/dist/commands/serveCommand.d.ts.map +1 -1
- package/dist/commands/serveCommand.js +18 -11
- package/dist/commands/serveCommand.js.map +1 -1
- package/dist/commands/watchCommand.d.ts +1 -2
- package/dist/commands/watchCommand.d.ts.map +1 -1
- package/dist/commands/watchCommand.js +18 -17
- package/dist/commands/watchCommand.js.map +1 -1
- package/dist/componentExplorer.d.ts +30 -2
- package/dist/componentExplorer.d.ts.map +1 -1
- package/dist/componentExplorer.js +4 -2
- package/dist/componentExplorer.js.map +1 -1
- package/dist/daemon/DaemonService.d.ts +4 -0
- package/dist/daemon/DaemonService.d.ts.map +1 -1
- package/dist/daemon/DaemonService.js +16 -12
- package/dist/daemon/DaemonService.js.map +1 -1
- package/dist/daemon/lifecycle.js +1 -1
- package/dist/daemon/lifecycle.js.map +1 -1
- package/dist/httpServer.js +14 -8
- package/dist/httpServer.js.map +1 -1
- package/dist/mcp/McpServer.d.ts.map +1 -1
- package/dist/mcp/McpServer.js +14 -1
- package/dist/mcp/McpServer.js.map +1 -1
- package/dist/resolveProject.d.ts +21 -0
- package/dist/resolveProject.d.ts.map +1 -0
- package/dist/resolveProject.js +39 -0
- package/dist/resolveProject.js.map +1 -0
- package/package.json +1 -1
package/README.md
ADDED
|
@@ -0,0 +1,178 @@
|
|
|
1
|
+
# @vscode/component-explorer-cli
|
|
2
|
+
|
|
3
|
+
Command-line tool for capturing, comparing, and managing component fixture screenshots.
|
|
4
|
+
|
|
5
|
+
## Installation
|
|
6
|
+
|
|
7
|
+
```bash
|
|
8
|
+
npm install @vscode/component-explorer-cli
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
The binary is available as `component-explorer`.
|
|
12
|
+
|
|
13
|
+
## Commands
|
|
14
|
+
|
|
15
|
+
### `screenshot`
|
|
16
|
+
|
|
17
|
+
Capture screenshots of all fixtures using a headless browser.
|
|
18
|
+
|
|
19
|
+
```bash
|
|
20
|
+
component-explorer screenshot [options]
|
|
21
|
+
```
|
|
22
|
+
|
|
23
|
+
| Option | Description |
|
|
24
|
+
|---|---|
|
|
25
|
+
| `-p, --project <path>` | Project: a directory, vite config file, or component-explorer.json (default: cwd) |
|
|
26
|
+
| `--filter <pattern>` | Filter fixtures by glob pattern |
|
|
27
|
+
| `--accept` | Write to baseline instead of current (mutually exclusive with `--target`) |
|
|
28
|
+
| `--target <dir>` | Screenshot output directory (default: `.screenshots/current`, or `.screenshots/baseline` with `--accept`) |
|
|
29
|
+
| `--compare` | Compare screenshots after capturing |
|
|
30
|
+
| `--compare-target <dir>` | Directory to compare against (default: `.screenshots/baseline`, or `.screenshots/current` with `--accept`) |
|
|
31
|
+
| `--report <path>` | Output JSON comparison report path (requires `--compare`) |
|
|
32
|
+
| `-v, --verbose` | Increase log verbosity (`-v` debug, `-vv` trace) |
|
|
33
|
+
|
|
34
|
+
```bash
|
|
35
|
+
# Capture all fixtures
|
|
36
|
+
component-explorer screenshot
|
|
37
|
+
|
|
38
|
+
# Capture and accept as baseline
|
|
39
|
+
component-explorer screenshot --accept
|
|
40
|
+
|
|
41
|
+
# Capture, then compare against baseline
|
|
42
|
+
component-explorer screenshot --compare
|
|
43
|
+
|
|
44
|
+
# Filter by glob
|
|
45
|
+
component-explorer screenshot --filter "Button/*"
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
### `screenshot:compare`
|
|
49
|
+
|
|
50
|
+
Compare two screenshot directories (file-level hash comparison).
|
|
51
|
+
|
|
52
|
+
```bash
|
|
53
|
+
component-explorer screenshot:compare [options]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
| Option | Description |
|
|
57
|
+
|---|---|
|
|
58
|
+
| `-p, --project <path>` | Project directory (default: cwd) |
|
|
59
|
+
| `--baseline <dir>` | Baseline screenshots directory (default: `.screenshots/baseline`) |
|
|
60
|
+
| `--current <dir>` | Current screenshots directory (default: `.screenshots/current`) |
|
|
61
|
+
| `--filter <pattern>` | Filter fixtures by glob pattern |
|
|
62
|
+
| `--report <path>` | Output JSON report path |
|
|
63
|
+
| `--report-markdown <path>` | Output Markdown report path |
|
|
64
|
+
| `-v, --verbose` | Increase log verbosity |
|
|
65
|
+
|
|
66
|
+
Exits with code 1 if differences are found, 0 otherwise.
|
|
67
|
+
|
|
68
|
+
```bash
|
|
69
|
+
# Compare default directories
|
|
70
|
+
component-explorer screenshot:compare
|
|
71
|
+
|
|
72
|
+
# Compare with custom paths
|
|
73
|
+
component-explorer screenshot:compare --baseline ./golden --current ./actual
|
|
74
|
+
|
|
75
|
+
# Generate reports
|
|
76
|
+
component-explorer screenshot:compare --report report.json --report-markdown report.md
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
### `screenshot:accept`
|
|
80
|
+
|
|
81
|
+
Promote current screenshots to baseline by copying them from `.screenshots/current` to `.screenshots/baseline`.
|
|
82
|
+
|
|
83
|
+
```bash
|
|
84
|
+
component-explorer screenshot:accept [options]
|
|
85
|
+
```
|
|
86
|
+
|
|
87
|
+
| Option | Description |
|
|
88
|
+
|---|---|
|
|
89
|
+
| `-p, --project <path>` | Project directory (default: cwd) |
|
|
90
|
+
| `--filter <pattern>` | Filter fixtures by glob pattern |
|
|
91
|
+
| `--screenshot-dir <dir>` | Screenshots directory (default: `.screenshots`) |
|
|
92
|
+
| `-v, --verbose` | Increase log verbosity |
|
|
93
|
+
|
|
94
|
+
```bash
|
|
95
|
+
# Accept all current screenshots as baseline
|
|
96
|
+
component-explorer screenshot:accept
|
|
97
|
+
|
|
98
|
+
# Accept specific fixtures
|
|
99
|
+
component-explorer screenshot:accept --filter "Button/*"
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
### `watch`
|
|
103
|
+
|
|
104
|
+
Watch for source changes and automatically re-capture/compare screenshots. Supports both simple mode (single project) and config mode (multiple sessions with git worktrees).
|
|
105
|
+
|
|
106
|
+
```bash
|
|
107
|
+
component-explorer watch [options]
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
| Option | Description |
|
|
111
|
+
|---|---|
|
|
112
|
+
| `-p, --project <path>` | Project: a directory, vite config file, or component-explorer.json (default: cwd) |
|
|
113
|
+
| `-v, --verbose` | Increase log verbosity |
|
|
114
|
+
|
|
115
|
+
In simple mode, starts a Vite dev server and re-captures screenshots on every HMR update. In config mode (when given a `component-explorer.json`), manages multiple sessions including git worktree-based baselines.
|
|
116
|
+
|
|
117
|
+
```bash
|
|
118
|
+
# Watch all fixtures
|
|
119
|
+
component-explorer watch
|
|
120
|
+
|
|
121
|
+
# Watch with config
|
|
122
|
+
component-explorer watch -p component-explorer.json
|
|
123
|
+
```
|
|
124
|
+
|
|
125
|
+
### `serve`
|
|
126
|
+
|
|
127
|
+
Start or attach to a Component Explorer daemon process. The daemon manages Vite servers and browser sessions in the background.
|
|
128
|
+
|
|
129
|
+
```bash
|
|
130
|
+
component-explorer serve -p <config> [options]
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
| Option | Description |
|
|
134
|
+
|---|---|
|
|
135
|
+
| `-p, --project, -c <path>` | **(required)** Path to a component-explorer.json config file |
|
|
136
|
+
| `--background` | Spawn as a detached background process |
|
|
137
|
+
| `--attach` | Attach to a running daemon and stream events |
|
|
138
|
+
| `--kill` | Shut down a running daemon |
|
|
139
|
+
| `-v, --verbose` | Increase log verbosity |
|
|
140
|
+
|
|
141
|
+
Without flags, starts a foreground daemon. Combine `--background` and `--attach` to ensure a daemon is running and then stream its events.
|
|
142
|
+
|
|
143
|
+
```bash
|
|
144
|
+
# Start in foreground
|
|
145
|
+
component-explorer serve -p config.json
|
|
146
|
+
|
|
147
|
+
# Start in background
|
|
148
|
+
component-explorer serve -p config.json --background
|
|
149
|
+
|
|
150
|
+
# Attach to running daemon
|
|
151
|
+
component-explorer serve -p config.json --attach
|
|
152
|
+
|
|
153
|
+
# Ensure daemon + attach
|
|
154
|
+
component-explorer serve -p config.json --background --attach
|
|
155
|
+
|
|
156
|
+
# Kill running daemon
|
|
157
|
+
component-explorer serve -p config.json --kill
|
|
158
|
+
```
|
|
159
|
+
|
|
160
|
+
### `mcp`
|
|
161
|
+
|
|
162
|
+
Start a [Model Context Protocol](https://modelcontextprotocol.io/) server over stdio. Auto-starts a daemon if one is not already running.
|
|
163
|
+
|
|
164
|
+
```bash
|
|
165
|
+
component-explorer mcp -p <config>
|
|
166
|
+
```
|
|
167
|
+
|
|
168
|
+
| Option | Description |
|
|
169
|
+
|---|---|
|
|
170
|
+
| `-p, --project, -c <path>` | **(required)** Path to a component-explorer.json config file |
|
|
171
|
+
|
|
172
|
+
```bash
|
|
173
|
+
component-explorer mcp --project config.json
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
## Global Options
|
|
177
|
+
|
|
178
|
+
All commands support `-v` / `--verbose` for increased log output. Use `-vv` for trace-level logging.
|
|
@@ -4,7 +4,8 @@ export declare class AcceptCommand extends Command {
|
|
|
4
4
|
static usage: import("clipanion").Usage;
|
|
5
5
|
readonly verbose: number;
|
|
6
6
|
readonly filter: string | undefined;
|
|
7
|
-
readonly
|
|
7
|
+
readonly project: string;
|
|
8
|
+
readonly screenshotDir: string;
|
|
8
9
|
execute(): Promise<void>;
|
|
9
10
|
}
|
|
10
11
|
//# sourceMappingURL=acceptCommand.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acceptCommand.d.ts","sourceRoot":"","sources":["../../src/commands/acceptCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"acceptCommand.d.ts","sourceRoot":"","sources":["../../src/commands/acceptCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAM5C,qBAAa,aAAc,SAAQ,OAAO;IACzC,OAAgB,KAAK,aAA2B;IAEhD,OAAgB,KAAK,4BAMlB;IAEH,QAAQ,CAAC,OAAO,SAAsG;IACtH,QAAQ,CAAC,MAAM,qBAAkG;IACjH,QAAQ,CAAC,OAAO,SAAuI;IACvJ,QAAQ,CAAC,aAAa,SAA+F;IAE/G,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CA8B9B"}
|
|
@@ -1,22 +1,28 @@
|
|
|
1
1
|
import { Command, Option } from 'clipanion';
|
|
2
|
+
import * as path from 'node:path';
|
|
2
3
|
import { ConsoleLogger, verbosityToLogLevel } from '../logger.js';
|
|
3
4
|
import { FileSystemStorage } from '../storage.js';
|
|
5
|
+
import { resolveProject } from '../resolveProject.js';
|
|
4
6
|
|
|
5
7
|
class AcceptCommand extends Command {
|
|
6
|
-
static paths = [['accept']];
|
|
8
|
+
static paths = [['screenshot:accept']];
|
|
7
9
|
static usage = Command.Usage({
|
|
8
|
-
description: 'Promote current screenshots
|
|
10
|
+
description: 'Promote current screenshots to baseline (file-level only)',
|
|
9
11
|
examples: [
|
|
10
|
-
['Accept all', '$0 accept'],
|
|
11
|
-
['Accept specific fixtures', '$0 accept --filter "Button/*"'],
|
|
12
|
+
['Accept all', '$0 screenshot:accept'],
|
|
13
|
+
['Accept specific fixtures', '$0 screenshot:accept --filter "Button/*"'],
|
|
12
14
|
],
|
|
13
15
|
});
|
|
14
16
|
verbose = Option.Counter('-v,--verbose', 0, { description: 'Increase log verbosity (-v debug, -vv trace)' });
|
|
15
17
|
filter = Option.String('--filter', { required: false, description: 'Filter fixtures by glob pattern' });
|
|
16
|
-
|
|
18
|
+
project = Option.String('-p,--project', process.cwd(), { description: 'Project: a directory, vite config file, or component-explorer.json' });
|
|
19
|
+
screenshotDir = Option.String('--screenshot-dir', '.screenshots', { description: 'Screenshots directory' });
|
|
17
20
|
async execute() {
|
|
21
|
+
const resolved = await resolveProject(this.project);
|
|
22
|
+
const projectDir = resolved.projectDir;
|
|
18
23
|
new ConsoleLogger('accept', this.context.stdout, verbosityToLogLevel(this.verbose));
|
|
19
|
-
const
|
|
24
|
+
const screenshotPath = path.isAbsolute(this.screenshotDir) ? this.screenshotDir : path.join(projectDir, this.screenshotDir);
|
|
25
|
+
const storage = new FileSystemStorage(screenshotPath);
|
|
20
26
|
let currentFiles = await storage.list('current');
|
|
21
27
|
if (this.filter) {
|
|
22
28
|
const regex = new RegExp('^current/' + this.filter.replace(/\*/g, '.*').replace(/\?/g, '.') + '$');
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acceptCommand.js","sources":["../../src/commands/acceptCommand.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"acceptCommand.js","sources":["../../src/commands/acceptCommand.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAMM,MAAO,aAAc,SAAQ,OAAO,CAAA;IACzC,OAAgB,KAAK,GAAG,CAAC,CAAC,mBAAmB,CAAC,CAAC;AAE/C,IAAA,OAAgB,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;AACrC,QAAA,WAAW,EAAE,2DAA2D;AACxE,QAAA,QAAQ,EAAE;YACT,CAAC,YAAY,EAAE,sBAAsB,CAAC;YACtC,CAAC,0BAA0B,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IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,GAAG,CACxE;AACD,YAAA,YAAY,GAAG,YAAY,CAAC,MAAM,CAAC,CAAC,IAAI,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;QACvD;AAEA,QAAA,IAAI,YAAY,CAAC,MAAM,KAAK,CAAC,EAAE;YAC9B,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,qCAAqC,CAAC;YAChE;QACD;AAEA,QAAA,KAAK,MAAM,IAAI,IAAI,YAAY,EAAE;YAChC,MAAM,YAAY,GAAG,IAAI,CAAC,OAAO,CAAC,UAAU,EAAE,EAAE,CAAC;YACjD,MAAM,IAAI,GAAG,MAAM,OAAO,CAAC,IAAI,CAAC,IAAI,CAAC;YACrC,MAAM,OAAO,CAAC,KAAK,CAAC,CAAA,SAAA,EAAY,YAAY,CAAA,CAAE,EAAE,IAAI,CAAC;YACrD,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA,IAAA,EAAO,YAAY,CAAA,EAAA,CAAI,CAAC;QACnD;AAEA,QAAA,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAA,WAAA,EAAc,YAAY,CAAC,MAAM,CAAA,6BAAA,CAA+B,CAAC;IAC5F;;;;;"}
|
|
@@ -3,7 +3,14 @@ export declare class CompareCommand extends Command {
|
|
|
3
3
|
static paths: string[][];
|
|
4
4
|
static usage: import("clipanion").Usage;
|
|
5
5
|
readonly verbose: number;
|
|
6
|
-
readonly
|
|
6
|
+
readonly filter: string | undefined;
|
|
7
|
+
readonly project: string;
|
|
8
|
+
readonly baseline: string;
|
|
9
|
+
readonly current: string;
|
|
10
|
+
readonly report: string | undefined;
|
|
11
|
+
readonly reportMarkdown: string | undefined;
|
|
7
12
|
execute(): Promise<number>;
|
|
13
|
+
private _printConsoleOutput;
|
|
14
|
+
private _generateMarkdownReport;
|
|
8
15
|
}
|
|
9
16
|
//# sourceMappingURL=compareCommand.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compareCommand.d.ts","sourceRoot":"","sources":["../../src/commands/compareCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"compareCommand.d.ts","sourceRoot":"","sources":["../../src/commands/compareCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AA6B5C,qBAAa,cAAe,SAAQ,OAAO;IAC1C,OAAgB,KAAK,aAA4B;IAEjD,OAAgB,KAAK,4BAOlB;IAEH,QAAQ,CAAC,OAAO,SAAsG;IACtH,QAAQ,CAAC,MAAM,qBAAkG;IACjH,QAAQ,CAAC,OAAO,SAAuI;IACvJ,QAAQ,CAAC,QAAQ,SAA2G;IAC5H,QAAQ,CAAC,OAAO,SAAwG;IACxH,QAAQ,CAAC,MAAM,qBAA0F;IACzG,QAAQ,CAAC,cAAc,qBAAuG;IAExH,OAAO,IAAI,OAAO,CAAC,MAAM,CAAC;IAgHhC,OAAO,CAAC,mBAAmB;IA+B3B,OAAO,CAAC,uBAAuB;CA0E/B"}
|
|
@@ -1,48 +1,128 @@
|
|
|
1
1
|
import { Command, Option } from 'clipanion';
|
|
2
|
+
import * as fs from 'node:fs/promises';
|
|
3
|
+
import * as path from 'node:path';
|
|
2
4
|
import { ConsoleLogger, verbosityToLogLevel } from '../logger.js';
|
|
3
5
|
import { FileSystemStorage } from '../storage.js';
|
|
6
|
+
import { resolveProject } from '../resolveProject.js';
|
|
7
|
+
import { contentHash } from '../screenshotCache.js';
|
|
4
8
|
|
|
5
9
|
class CompareCommand extends Command {
|
|
6
|
-
static paths = [['compare']];
|
|
10
|
+
static paths = [['screenshot:compare']];
|
|
7
11
|
static usage = Command.Usage({
|
|
8
|
-
description: 'Compare
|
|
12
|
+
description: 'Compare screenshot directories (file-level only)',
|
|
9
13
|
examples: [
|
|
10
|
-
['Compare default directories', '$0 compare'],
|
|
14
|
+
['Compare default directories', '$0 screenshot:compare'],
|
|
15
|
+
['Compare with custom paths', '$0 screenshot:compare --baseline ./golden --current ./actual'],
|
|
16
|
+
['Generate reports', '$0 screenshot:compare --report report.json'],
|
|
11
17
|
],
|
|
12
18
|
});
|
|
13
19
|
verbose = Option.Counter('-v,--verbose', 0, { description: 'Increase log verbosity (-v debug, -vv trace)' });
|
|
14
|
-
|
|
20
|
+
filter = Option.String('--filter', { required: false, description: 'Filter fixtures by glob pattern' });
|
|
21
|
+
project = Option.String('-p,--project', process.cwd(), { description: 'Project: a directory, vite config file, or component-explorer.json' });
|
|
22
|
+
baseline = Option.String('--baseline', '.screenshots/baseline', { description: 'Baseline screenshots directory' });
|
|
23
|
+
current = Option.String('--current', '.screenshots/current', { description: 'Current screenshots directory' });
|
|
24
|
+
report = Option.String('--report', { required: false, description: 'Output JSON report path' });
|
|
25
|
+
reportMarkdown = Option.String('--report-markdown', { required: false, description: 'Output Markdown report path' });
|
|
15
26
|
async execute() {
|
|
27
|
+
const resolved = await resolveProject(this.project);
|
|
28
|
+
const projectDir = resolved.projectDir;
|
|
16
29
|
new ConsoleLogger('compare', this.context.stdout, verbosityToLogLevel(this.verbose));
|
|
17
|
-
const
|
|
18
|
-
const
|
|
19
|
-
const
|
|
20
|
-
const
|
|
21
|
-
|
|
30
|
+
const baselineDir = path.isAbsolute(this.baseline) ? this.baseline : path.join(projectDir, this.baseline);
|
|
31
|
+
const currentDir = path.isAbsolute(this.current) ? this.current : path.join(projectDir, this.current);
|
|
32
|
+
const baselineStorage = new FileSystemStorage(baselineDir);
|
|
33
|
+
const currentStorage = new FileSystemStorage(currentDir);
|
|
34
|
+
// List all PNG files
|
|
35
|
+
let baselineFiles = await listPngFiles(baselineDir);
|
|
36
|
+
let currentFiles = await listPngFiles(currentDir);
|
|
37
|
+
// Apply filter if specified
|
|
38
|
+
if (this.filter) {
|
|
39
|
+
const filterFn = (file) => matchGlob(file.replace(/\.png$/, ''), this.filter);
|
|
40
|
+
baselineFiles = baselineFiles.filter(filterFn);
|
|
41
|
+
currentFiles = currentFiles.filter(filterFn);
|
|
42
|
+
}
|
|
43
|
+
const baselineSet = new Set(baselineFiles);
|
|
44
|
+
const currentSet = new Set(currentFiles);
|
|
22
45
|
const added = [];
|
|
23
46
|
const removed = [];
|
|
24
47
|
const changed = [];
|
|
25
48
|
const unchanged = [];
|
|
49
|
+
const details = {};
|
|
50
|
+
// Compare files
|
|
26
51
|
for (const file of currentSet) {
|
|
52
|
+
const fixtureId = file.replace(/\.png$/, '');
|
|
27
53
|
if (!baselineSet.has(file)) {
|
|
28
|
-
added.push(
|
|
54
|
+
added.push(fixtureId);
|
|
55
|
+
const currentData = await currentStorage.read(file);
|
|
56
|
+
details[fixtureId] = { currentHash: contentHash(currentData) };
|
|
29
57
|
}
|
|
30
58
|
else {
|
|
31
|
-
const baselineData = await
|
|
32
|
-
const currentData = await
|
|
33
|
-
|
|
34
|
-
|
|
59
|
+
const baselineData = await baselineStorage.read(file);
|
|
60
|
+
const currentData = await currentStorage.read(file);
|
|
61
|
+
const baselineHashVal = contentHash(baselineData);
|
|
62
|
+
const currentHashVal = contentHash(currentData);
|
|
63
|
+
if (baselineHashVal === currentHashVal) {
|
|
64
|
+
unchanged.push(fixtureId);
|
|
65
|
+
details[fixtureId] = { baselineHash: baselineHashVal, currentHash: currentHashVal };
|
|
35
66
|
}
|
|
36
67
|
else {
|
|
37
|
-
changed.push(
|
|
68
|
+
changed.push(fixtureId);
|
|
69
|
+
details[fixtureId] = { baselineHash: baselineHashVal, currentHash: currentHashVal };
|
|
38
70
|
}
|
|
39
71
|
}
|
|
40
72
|
}
|
|
41
73
|
for (const file of baselineSet) {
|
|
74
|
+
const fixtureId = file.replace(/\.png$/, '');
|
|
42
75
|
if (!currentSet.has(file)) {
|
|
43
|
-
removed.push(
|
|
76
|
+
removed.push(fixtureId);
|
|
77
|
+
const baselineData = await baselineStorage.read(file);
|
|
78
|
+
details[fixtureId] = { baselineHash: contentHash(baselineData) };
|
|
44
79
|
}
|
|
45
80
|
}
|
|
81
|
+
// Sort for consistent output
|
|
82
|
+
added.sort();
|
|
83
|
+
removed.sort();
|
|
84
|
+
changed.sort();
|
|
85
|
+
unchanged.sort();
|
|
86
|
+
// Build report
|
|
87
|
+
const report = {
|
|
88
|
+
timestamp: new Date().toISOString(),
|
|
89
|
+
baseline: this.baseline,
|
|
90
|
+
current: this.current,
|
|
91
|
+
summary: {
|
|
92
|
+
total: added.length + removed.length + changed.length + unchanged.length,
|
|
93
|
+
added: added.length,
|
|
94
|
+
removed: removed.length,
|
|
95
|
+
changed: changed.length,
|
|
96
|
+
unchanged: unchanged.length,
|
|
97
|
+
},
|
|
98
|
+
added,
|
|
99
|
+
removed,
|
|
100
|
+
changed,
|
|
101
|
+
unchanged,
|
|
102
|
+
details,
|
|
103
|
+
};
|
|
104
|
+
// Console output
|
|
105
|
+
this._printConsoleOutput(report);
|
|
106
|
+
// Write JSON report
|
|
107
|
+
if (this.report) {
|
|
108
|
+
const reportPath = path.isAbsolute(this.report) ? this.report : path.join(projectDir, this.report);
|
|
109
|
+
await fs.mkdir(path.dirname(reportPath), { recursive: true });
|
|
110
|
+
await fs.writeFile(reportPath, JSON.stringify(report, null, 2));
|
|
111
|
+
this.context.stdout.write(`\nJSON report written to: ${this.report}\n`);
|
|
112
|
+
}
|
|
113
|
+
// Write Markdown report
|
|
114
|
+
if (this.reportMarkdown) {
|
|
115
|
+
const mdPath = path.isAbsolute(this.reportMarkdown) ? this.reportMarkdown : path.join(projectDir, this.reportMarkdown);
|
|
116
|
+
await fs.mkdir(path.dirname(mdPath), { recursive: true });
|
|
117
|
+
const markdown = this._generateMarkdownReport(report);
|
|
118
|
+
await fs.writeFile(mdPath, markdown);
|
|
119
|
+
this.context.stdout.write(`Markdown report written to: ${this.reportMarkdown}\n`);
|
|
120
|
+
}
|
|
121
|
+
const hasDiffs = added.length > 0 || removed.length > 0 || changed.length > 0;
|
|
122
|
+
return hasDiffs ? 1 : 0;
|
|
123
|
+
}
|
|
124
|
+
_printConsoleOutput(report) {
|
|
125
|
+
const { added, removed, changed, unchanged } = report;
|
|
46
126
|
if (added.length > 0) {
|
|
47
127
|
this.context.stdout.write(`Added (${added.length}):\n`);
|
|
48
128
|
for (const f of added) {
|
|
@@ -61,29 +141,113 @@ class CompareCommand extends Command {
|
|
|
61
141
|
this.context.stdout.write(` ~ ${f}\n`);
|
|
62
142
|
}
|
|
63
143
|
}
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
144
|
+
this.context.stdout.write(`\nSummary: ${report.summary.total} fixtures`);
|
|
145
|
+
if (added.length > 0 || removed.length > 0 || changed.length > 0) {
|
|
146
|
+
const parts = [];
|
|
147
|
+
if (added.length > 0)
|
|
148
|
+
parts.push(`${added.length} added`);
|
|
149
|
+
if (removed.length > 0)
|
|
150
|
+
parts.push(`${removed.length} removed`);
|
|
151
|
+
if (changed.length > 0)
|
|
152
|
+
parts.push(`${changed.length} changed`);
|
|
153
|
+
if (unchanged.length > 0)
|
|
154
|
+
parts.push(`${unchanged.length} unchanged`);
|
|
155
|
+
this.context.stdout.write(` (${parts.join(', ')})\n`);
|
|
156
|
+
}
|
|
157
|
+
else {
|
|
158
|
+
this.context.stdout.write(' — no differences\n');
|
|
159
|
+
}
|
|
160
|
+
}
|
|
161
|
+
_generateMarkdownReport(report) {
|
|
162
|
+
const lines = [];
|
|
163
|
+
const hasDiffs = report.added.length > 0 || report.removed.length > 0 || report.changed.length > 0;
|
|
164
|
+
lines.push('# Screenshot Comparison Report');
|
|
165
|
+
lines.push('');
|
|
166
|
+
lines.push(`**Generated:** ${report.timestamp}`);
|
|
167
|
+
lines.push(`**Baseline:** \`${report.baseline}\``);
|
|
168
|
+
lines.push(`**Current:** \`${report.current}\``);
|
|
169
|
+
lines.push('');
|
|
170
|
+
// Summary
|
|
171
|
+
lines.push('## Summary');
|
|
172
|
+
lines.push('');
|
|
173
|
+
if (!hasDiffs) {
|
|
174
|
+
lines.push('✅ **No visual differences detected.**');
|
|
175
|
+
}
|
|
176
|
+
else {
|
|
177
|
+
lines.push('| Status | Count |');
|
|
178
|
+
lines.push('|--------|-------|');
|
|
179
|
+
if (report.added.length > 0)
|
|
180
|
+
lines.push(`| ➕ Added | ${report.added.length} |`);
|
|
181
|
+
if (report.removed.length > 0)
|
|
182
|
+
lines.push(`| ➖ Removed | ${report.removed.length} |`);
|
|
183
|
+
if (report.changed.length > 0)
|
|
184
|
+
lines.push(`| ⚠️ Changed | ${report.changed.length} |`);
|
|
185
|
+
lines.push(`| ✅ Unchanged | ${report.unchanged.length} |`);
|
|
186
|
+
lines.push(`| **Total** | **${report.summary.total}** |`);
|
|
187
|
+
}
|
|
188
|
+
lines.push('');
|
|
189
|
+
// Changed fixtures (most important)
|
|
190
|
+
if (report.changed.length > 0) {
|
|
191
|
+
lines.push('## Changed Fixtures');
|
|
192
|
+
lines.push('');
|
|
193
|
+
lines.push('| Fixture | Baseline Hash | Current Hash |');
|
|
194
|
+
lines.push('|---------|---------------|--------------|');
|
|
195
|
+
for (const id of report.changed) {
|
|
196
|
+
const detail = report.details[id];
|
|
197
|
+
lines.push(`| \`${id}\` | \`${detail?.baselineHash ?? '-'}\` | \`${detail?.currentHash ?? '-'}\` |`);
|
|
198
|
+
}
|
|
199
|
+
lines.push('');
|
|
200
|
+
}
|
|
201
|
+
// Added fixtures
|
|
202
|
+
if (report.added.length > 0) {
|
|
203
|
+
lines.push('## Added Fixtures');
|
|
204
|
+
lines.push('');
|
|
205
|
+
for (const id of report.added) {
|
|
206
|
+
lines.push(`- \`${id}\``);
|
|
68
207
|
}
|
|
208
|
+
lines.push('');
|
|
69
209
|
}
|
|
70
|
-
|
|
71
|
-
if (
|
|
72
|
-
|
|
73
|
-
|
|
210
|
+
// Removed fixtures
|
|
211
|
+
if (report.removed.length > 0) {
|
|
212
|
+
lines.push('## Removed Fixtures');
|
|
213
|
+
lines.push('');
|
|
214
|
+
for (const id of report.removed) {
|
|
215
|
+
lines.push(`- \`${id}\``);
|
|
216
|
+
}
|
|
217
|
+
lines.push('');
|
|
218
|
+
}
|
|
219
|
+
// Unchanged (collapsed/summary only)
|
|
220
|
+
if (report.unchanged.length > 0) {
|
|
221
|
+
lines.push('<details>');
|
|
222
|
+
lines.push(`<summary>Unchanged Fixtures (${report.unchanged.length})</summary>`);
|
|
223
|
+
lines.push('');
|
|
224
|
+
for (const id of report.unchanged) {
|
|
225
|
+
lines.push(`- \`${id}\``);
|
|
226
|
+
}
|
|
227
|
+
lines.push('');
|
|
228
|
+
lines.push('</details>');
|
|
74
229
|
}
|
|
75
|
-
|
|
76
|
-
return 0;
|
|
230
|
+
return lines.join('\n');
|
|
77
231
|
}
|
|
78
232
|
}
|
|
79
|
-
function
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
233
|
+
async function listPngFiles(dir) {
|
|
234
|
+
try {
|
|
235
|
+
const entries = await fs.readdir(dir, { recursive: true });
|
|
236
|
+
const results = [];
|
|
237
|
+
for (const entry of entries) {
|
|
238
|
+
if (entry.endsWith('.png')) {
|
|
239
|
+
results.push(entry.split(path.sep).join('/'));
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
return results;
|
|
85
243
|
}
|
|
86
|
-
|
|
244
|
+
catch {
|
|
245
|
+
return [];
|
|
246
|
+
}
|
|
247
|
+
}
|
|
248
|
+
function matchGlob(fixtureId, pattern) {
|
|
249
|
+
const regex = new RegExp('^' + pattern.replace(/\*/g, '.*').replace(/\?/g, '.') + '$');
|
|
250
|
+
return regex.test(fixtureId);
|
|
87
251
|
}
|
|
88
252
|
|
|
89
253
|
export { CompareCommand };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"compareCommand.js","sources":["../../src/commands/compareCommand.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;AAIM,MAAO,cAAe,SAAQ,OAAO,CAAA;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O,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC;IACxB;;AAGD,eAAe,YAAY,CAAC,GAAW,EAAA;AACtC,IAAA,IAAI;AACH,QAAA,MAAM,OAAO,GAAG,MAAM,EAAE,CAAC,OAAO,CAAC,GAAG,EAAE,EAAE,SAAS,EAAE,IAAI,EAAE,CAAC;QAC1D,MAAM,OAAO,GAAa,EAAE;AAC5B,QAAA,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE;AAC5B,YAAA,IAAI,KAAK,CAAC,QAAQ,CAAC,MAAM,CAAC,EAAE;AAC3B,gBAAA,OAAO,CAAC,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YAC9C;QACD;AACA,QAAA,OAAO,OAAO;IACf;AAAE,IAAA,MAAM;AACP,QAAA,OAAO,EAAE;IACV;AACD;AAEA,SAAS,SAAS,CAAC,SAAiB,EAAE,OAAe,EAAA;IACpD,MAAM,KAAK,GAAG,IAAI,MAAM,CACvB,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,GAAG,GAAG,CAC5D;AACD,IAAA,OAAO,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC;AAC7B;;;;"}
|
|
@@ -2,7 +2,7 @@ import { Command } from 'clipanion';
|
|
|
2
2
|
export declare class McpCommand extends Command {
|
|
3
3
|
static paths: string[][];
|
|
4
4
|
static usage: import("clipanion").Usage;
|
|
5
|
-
readonly
|
|
5
|
+
readonly project: string;
|
|
6
6
|
execute(): Promise<void>;
|
|
7
7
|
}
|
|
8
8
|
//# sourceMappingURL=mcpCommand.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpCommand.d.ts","sourceRoot":"","sources":["../../src/commands/mcpCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"mcpCommand.d.ts","sourceRoot":"","sources":["../../src/commands/mcpCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAK5C,qBAAa,UAAW,SAAQ,OAAO;IACtC,OAAgB,KAAK,aAAa;IAElC,OAAgB,KAAK,4BAKlB;IAEH,QAAQ,CAAC,OAAO,SAA2I;IAErJ,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAc9B"}
|
|
@@ -1,19 +1,25 @@
|
|
|
1
1
|
import { Command, Option } from 'clipanion';
|
|
2
2
|
import { ensureDaemon } from '../daemon/lifecycle.js';
|
|
3
3
|
import { ComponentExplorerMcpServer } from '../mcp/McpServer.js';
|
|
4
|
+
import { resolveProject } from '../resolveProject.js';
|
|
4
5
|
|
|
5
6
|
class McpCommand extends Command {
|
|
6
7
|
static paths = [['mcp']];
|
|
7
8
|
static usage = Command.Usage({
|
|
8
9
|
description: 'Start an MCP server over stdio. Auto-starts a daemon if not already running.',
|
|
9
10
|
examples: [
|
|
10
|
-
['Start MCP server', '$0 mcp
|
|
11
|
+
['Start MCP server', '$0 mcp --project config.json'],
|
|
11
12
|
],
|
|
12
13
|
});
|
|
13
|
-
|
|
14
|
+
project = Option.String('-p,--project,-c', { required: true, description: 'Project: a directory, vite config file, or component-explorer.json' });
|
|
14
15
|
async execute() {
|
|
16
|
+
const resolved = await resolveProject(this.project);
|
|
17
|
+
if (resolved.kind !== 'explorerConfig') {
|
|
18
|
+
this.context.stderr.write('Error: mcp requires a component-explorer.json config file.\n');
|
|
19
|
+
return;
|
|
20
|
+
}
|
|
15
21
|
// Ensure daemon is running (auto-starts in background if needed)
|
|
16
|
-
const daemon = await ensureDaemon(
|
|
22
|
+
const daemon = await ensureDaemon(resolved.configPath);
|
|
17
23
|
// Create and connect the MCP server over stdio
|
|
18
24
|
const mcpServer = new ComponentExplorerMcpServer(daemon);
|
|
19
25
|
await mcpServer.connect();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mcpCommand.js","sources":["../../src/commands/mcpCommand.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"mcpCommand.js","sources":["../../src/commands/mcpCommand.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;AAKM,MAAO,UAAW,SAAQ,OAAO,CAAA;IACtC,OAAgB,KAAK,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC;AAEjC,IAAA,OAAgB,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;AACrC,QAAA,WAAW,EAAE,8EAA8E;AAC3F,QAAA,QAAQ,EAAE;YACT,CAAC,kBAAkB,EAAE,8BAA8B,CAAC;AACpD,SAAA;AACD,KAAA,CAAC;AAEO,IAAA,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,oEAAoE,EAAE,CAAC;AAE1J,IAAA,MAAM,OAAO,GAAA;QACZ,MAAM,QAAQ,GAAG,MAAM,cAAc,CAAC,IAAI,CAAC,OAAO,CAAC;AACnD,QAAA,IAAI,QAAQ,CAAC,IAAI,KAAK,gBAAgB,EAAE;YACvC,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,8DAA8D,CAAC;YACzF;QACD;;QAGA,MAAM,MAAM,GAAG,MAAM,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC;;AAGtD,QAAA,MAAM,SAAS,GAAG,IAAI,0BAA0B,CAAC,MAAM,CAAC;AACxD,QAAA,MAAM,SAAS,CAAC,OAAO,EAAE;IAC1B;;;;;"}
|
|
@@ -5,7 +5,12 @@ export declare class ScreenshotCommand extends Command {
|
|
|
5
5
|
readonly verbose: number;
|
|
6
6
|
readonly filter: string | undefined;
|
|
7
7
|
readonly accept: boolean;
|
|
8
|
-
readonly
|
|
9
|
-
|
|
8
|
+
readonly project: string;
|
|
9
|
+
readonly target: string | undefined;
|
|
10
|
+
readonly compare: boolean;
|
|
11
|
+
readonly compareTarget: string | undefined;
|
|
12
|
+
readonly report: string | undefined;
|
|
13
|
+
execute(): Promise<number>;
|
|
14
|
+
private _runComparison;
|
|
10
15
|
}
|
|
11
16
|
//# sourceMappingURL=screenshotCommand.d.ts.map
|