@vscode/component-explorer-cli 0.1.1-7 → 0.1.1-8
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/dist/commands/mcpCommand.d.ts +2 -0
- package/dist/commands/mcpCommand.d.ts.map +1 -1
- package/dist/commands/mcpCommand.js +35 -6
- package/dist/commands/mcpCommand.js.map +1 -1
- package/dist/commands/serveCommand.d.ts +3 -0
- package/dist/commands/serveCommand.d.ts.map +1 -1
- package/dist/commands/serveCommand.js +52 -3
- package/dist/commands/serveCommand.js.map +1 -1
- package/dist/component-explorer-config.schema.json +183 -0
- package/dist/componentExplorer.d.ts +10 -0
- package/dist/componentExplorer.d.ts.map +1 -1
- package/dist/componentExplorer.js +48 -2
- package/dist/componentExplorer.js.map +1 -1
- package/dist/daemon/DaemonService.d.ts +26 -4
- package/dist/daemon/DaemonService.d.ts.map +1 -1
- package/dist/daemon/DaemonService.js +39 -3
- package/dist/daemon/DaemonService.js.map +1 -1
- package/dist/daemon/lifecycle.js +2 -2
- package/dist/daemon/lifecycle.js.map +1 -1
- package/dist/daemon/pipeClient.js +3 -3
- package/dist/daemon/pipeClient.js.map +1 -1
- package/dist/daemon/pipeServer.js +2 -2
- package/dist/daemon/pipeServer.js.map +1 -1
- package/dist/dependencyInstaller.js +1 -1
- package/dist/dependencyInstaller.js.map +1 -1
- package/dist/external/vscode-observables/observables/dist/disposables.js +24 -1
- package/dist/external/vscode-observables/observables/dist/disposables.js.map +1 -1
- package/dist/external/vscode-observables/observables/dist/observableInternal/commonFacade/deps.js +1 -4
- package/dist/external/vscode-observables/observables/dist/observableInternal/commonFacade/deps.js.map +1 -1
- package/dist/external/vscode-observables/observables/dist/observableInternal/index.js +2 -5
- package/dist/external/vscode-observables/observables/dist/observableInternal/index.js.map +1 -1
- package/dist/external/vscode-observables/observables/dist/observableInternal/logging/consoleObservableLogger.js +30 -6
- package/dist/external/vscode-observables/observables/dist/observableInternal/logging/consoleObservableLogger.js.map +1 -1
- package/dist/external/vscode-observables/observables/dist/observableInternal/observables/baseObservable.js +1 -1
- package/dist/external/vscode-observables/observables/dist/observableInternal/observables/baseObservable.js.map +1 -1
- package/dist/external/vscode-observables/observables/dist/observableInternal/observables/derived.js +12 -1
- package/dist/external/vscode-observables/observables/dist/observableInternal/observables/derived.js.map +1 -1
- package/dist/external/vscode-observables/observables/dist/observableInternal/utils/utilsCancellation.js +55 -0
- package/dist/external/vscode-observables/observables/dist/observableInternal/utils/utilsCancellation.js.map +1 -0
- package/dist/git/gitUtils.js +1 -1
- package/dist/git/gitUtils.js.map +1 -1
- package/dist/mcp/McpServer.d.ts +29 -4
- package/dist/mcp/McpServer.d.ts.map +1 -1
- package/dist/mcp/McpServer.js +393 -81
- package/dist/mcp/McpServer.js.map +1 -1
- package/dist/packages/simple-api/dist/{chunk-A5PE72HI.js → chunk-Q24JOMNK.js} +7 -1
- package/dist/packages/simple-api/dist/chunk-Q24JOMNK.js.map +1 -0
- package/dist/utils.d.ts +20 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +22 -1
- package/dist/utils.js.map +1 -1
- package/dist/watchConfig.d.ts +36 -0
- package/dist/watchConfig.d.ts.map +1 -1
- package/dist/watchConfig.js +32 -22
- package/dist/watchConfig.js.map +1 -1
- package/package.json +6 -4
- package/dist/external/vscode-observables/observables/dist/observableInternal/logging/debugger/debuggerRpc.js +0 -72
- package/dist/external/vscode-observables/observables/dist/observableInternal/logging/debugger/debuggerRpc.js.map +0 -1
- package/dist/external/vscode-observables/observables/dist/observableInternal/logging/debugger/devToolsLogger.js +0 -447
- package/dist/external/vscode-observables/observables/dist/observableInternal/logging/debugger/devToolsLogger.js.map +0 -1
- package/dist/external/vscode-observables/observables/dist/observableInternal/logging/debugger/rpc.js +0 -64
- package/dist/external/vscode-observables/observables/dist/observableInternal/logging/debugger/rpc.js.map +0 -1
- package/dist/external/vscode-observables/observables/dist/observableInternal/logging/debugger/utils.js +0 -52
- package/dist/external/vscode-observables/observables/dist/observableInternal/logging/debugger/utils.js.map +0 -1
- package/dist/packages/simple-api/dist/chunk-A5PE72HI.js.map +0 -1
|
@@ -3,6 +3,8 @@ export declare class McpCommand extends Command {
|
|
|
3
3
|
static paths: string[][];
|
|
4
4
|
static usage: import("clipanion").Usage;
|
|
5
5
|
readonly project: string;
|
|
6
|
+
readonly noAutostart: boolean;
|
|
7
|
+
readonly noAutostartHint: string | undefined;
|
|
6
8
|
execute(): Promise<void>;
|
|
7
9
|
}
|
|
8
10
|
//# 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;AAO5C,qBAAa,UAAW,SAAQ,OAAO;IACtC,OAAgB,KAAK,aAAa;IAElC,OAAgB,KAAK,4BAMlB;IAEH,QAAQ,CAAC,OAAO,SAA2I;IAC3J,QAAQ,CAAC,WAAW,UAAoH;IACxI,QAAQ,CAAC,eAAe,qBAAyI;IAE3J,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAqC9B"}
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
import { Command, Option } from 'clipanion';
|
|
2
|
-
import
|
|
3
|
-
import {
|
|
2
|
+
import '../external/vscode-observables/observables/dist/observableInternal/index.js';
|
|
3
|
+
import { observableValue } from '../external/vscode-observables/observables/dist/observableInternal/observables/observableValue.js';
|
|
4
|
+
import '../external/vscode-observables/observables/dist/observableInternal/debugLocation.js';
|
|
5
|
+
import '../external/vscode-observables/observables/dist/observableInternal/observables/derived.js';
|
|
6
|
+
import '../external/vscode-observables/observables/dist/observableInternal/utils/utils.js';
|
|
7
|
+
import '../external/vscode-observables/observables/dist/observableInternal/observables/observableFromEvent.js';
|
|
8
|
+
import { ensureDaemon, tryConnect } from '../daemon/lifecycle.js';
|
|
9
|
+
import { daemonPipeName } from '../daemon/pipeName.js';
|
|
10
|
+
import { DaemonConnection, ComponentExplorerMcpServer } from '../mcp/McpServer.js';
|
|
4
11
|
import { resolveProject } from '../resolveProject.js';
|
|
5
12
|
|
|
6
13
|
class McpCommand extends Command {
|
|
@@ -9,20 +16,42 @@ class McpCommand extends Command {
|
|
|
9
16
|
description: 'Start an MCP server over stdio. Auto-starts a daemon if not already running.',
|
|
10
17
|
examples: [
|
|
11
18
|
['Start MCP server', '$0 mcp --project config.json'],
|
|
19
|
+
['Require existing daemon', '$0 mcp --project config.json --no-daemon-autostart'],
|
|
12
20
|
],
|
|
13
21
|
});
|
|
14
22
|
project = Option.String('-p,--project,-c', { required: true, description: 'Project: a directory, vite config file, or component-explorer.json' });
|
|
23
|
+
noAutostart = Option.Boolean('--no-daemon-autostart', false, { description: 'Do not auto-start daemon; poll for it instead' });
|
|
24
|
+
noAutostartHint = Option.String('--no-daemon-hint', { description: 'Hint message shown when daemon is not running (used with --no-daemon-autostart)' });
|
|
15
25
|
async execute() {
|
|
16
26
|
const resolved = await resolveProject(this.project);
|
|
17
27
|
if (resolved.kind !== 'explorerConfig') {
|
|
18
28
|
this.context.stderr.write('Error: mcp requires a component-explorer.json config file.\n');
|
|
19
29
|
return;
|
|
20
30
|
}
|
|
21
|
-
|
|
22
|
-
|
|
31
|
+
const daemonObservable = observableValue('daemon', undefined);
|
|
32
|
+
let pollFn;
|
|
33
|
+
if (this.noAutostart) {
|
|
34
|
+
// Poll for daemon every 5 seconds
|
|
35
|
+
const pipeName = daemonPipeName(resolved.configPath);
|
|
36
|
+
pollFn = async () => {
|
|
37
|
+
const client = await tryConnect(pipeName);
|
|
38
|
+
daemonObservable.set(client ? new DaemonConnection(client) : undefined, undefined);
|
|
39
|
+
};
|
|
40
|
+
await pollFn();
|
|
41
|
+
setInterval(pollFn, 5000);
|
|
42
|
+
}
|
|
43
|
+
else {
|
|
44
|
+
// Auto-start daemon and connect
|
|
45
|
+
const daemon = await ensureDaemon(resolved.configPath);
|
|
46
|
+
daemonObservable.set(new DaemonConnection(daemon), undefined);
|
|
47
|
+
}
|
|
23
48
|
// Create and connect the MCP server over stdio
|
|
24
|
-
|
|
25
|
-
|
|
49
|
+
await ComponentExplorerMcpServer.create(daemonObservable, {
|
|
50
|
+
pollFn,
|
|
51
|
+
noAutostartHint: this.noAutostartHint,
|
|
52
|
+
});
|
|
53
|
+
// Keep the process alive until the MCP connection closes
|
|
54
|
+
await new Promise(() => { });
|
|
26
55
|
}
|
|
27
56
|
}
|
|
28
57
|
|
|
@@ -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":";;;;;;;;;;;;AAOM,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;YACpD,CAAC,yBAAyB,EAAE,oDAAoD,CAAC;AACjF,SAAA;AACD,KAAA,CAAC;AAEO,IAAA,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,iBAAiB,EAAE,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,EAAE,oEAAoE,EAAE,CAAC;AACjJ,IAAA,WAAW,GAAG,MAAM,CAAC,OAAO,CAAC,uBAAuB,EAAE,KAAK,EAAE,EAAE,WAAW,EAAE,+CAA+C,EAAE,CA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
|
readonly background: boolean;
|
|
8
8
|
readonly attach: boolean;
|
|
9
9
|
readonly kill: boolean;
|
|
10
|
+
readonly redirectionPort: string | undefined;
|
|
11
|
+
readonly redirectionHost: string | undefined;
|
|
10
12
|
execute(): Promise<void>;
|
|
11
13
|
private _ensureBackground;
|
|
12
14
|
private _attach;
|
|
13
15
|
private _printEvent;
|
|
14
16
|
private _startDaemon;
|
|
17
|
+
private _startRedirectionServer;
|
|
15
18
|
}
|
|
16
19
|
//# sourceMappingURL=serveCommand.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serveCommand.d.ts","sourceRoot":"","sources":["../../src/commands/serveCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;
|
|
1
|
+
{"version":3,"file":"serveCommand.d.ts","sourceRoot":"","sources":["../../src/commands/serveCommand.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAU,MAAM,WAAW,CAAC;AAc5C,qBAAa,YAAa,SAAQ,OAAO;IACxC,OAAgB,KAAK,aAAe;IAEpC,OAAgB,KAAK,4BAgBlB;IAEH,QAAQ,CAAC,OAAO,SAAsG;IACtH,QAAQ,CAAC,OAAO,SAA2I;IAC3J,QAAQ,CAAC,UAAU,UAAoG;IACvH,QAAQ,CAAC,MAAM,UAAsG;IACrH,QAAQ,CAAC,IAAI,UAAkF;IAC/F,QAAQ,CAAC,eAAe,qBAA8H;IACtJ,QAAQ,CAAC,eAAe,qBAAsH;IAExI,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;YAwDhB,iBAAiB;YA0BjB,OAAO;IAgBrB,OAAO,CAAC,WAAW;YAeL,YAAY;IA8C1B,OAAO,CAAC,uBAAuB;CAyB/B"}
|
|
@@ -2,6 +2,7 @@ import { Command, Option } from 'clipanion';
|
|
|
2
2
|
import { spawn } from 'node:child_process';
|
|
3
3
|
import { fileURLToPath } from 'node:url';
|
|
4
4
|
import * as path from 'node:path';
|
|
5
|
+
import * as http from 'node:http';
|
|
5
6
|
import { ConsoleLogger, verbosityToLogLevel } from '../logger.js';
|
|
6
7
|
import { ResolvedWatchConfig } from '../watchConfig.js';
|
|
7
8
|
import { DaemonService } from '../daemon/DaemonService.js';
|
|
@@ -34,6 +35,8 @@ Without flags: starts a foreground daemon. Errors if one is already running.
|
|
|
34
35
|
background = Option.Boolean('--background', false, { description: 'Spawn as a detached background process' });
|
|
35
36
|
attach = Option.Boolean('--attach', false, { description: 'Attach to a running daemon and stream events' });
|
|
36
37
|
kill = Option.Boolean('--kill', false, { description: 'Shut down a running daemon' });
|
|
38
|
+
redirectionPort = Option.String('--redirectionPort', { description: 'Start an HTTP server that redirects /___explorer to the session URL' });
|
|
39
|
+
redirectionHost = Option.String('--redirectionHost', { description: 'Host to bind the redirection server to (default: localhost)' });
|
|
37
40
|
async execute() {
|
|
38
41
|
const resolved = await resolveProject(this.project);
|
|
39
42
|
if (resolved.kind !== 'explorerConfig') {
|
|
@@ -76,7 +79,9 @@ Without flags: starts a foreground daemon. Errors if one is already running.
|
|
|
76
79
|
// Default: start foreground daemon
|
|
77
80
|
const existing = await tryConnect(pipeName);
|
|
78
81
|
if (existing) {
|
|
79
|
-
this.context.stderr.write(`Daemon already running (pipe: ${pipeName}).\
|
|
82
|
+
this.context.stderr.write(`Daemon already running (pipe: ${pipeName}).\n`);
|
|
83
|
+
this.context.stderr.write(` Attach: component-explorer serve -c ${configPath} --attach\n`);
|
|
84
|
+
this.context.stderr.write(` Kill: component-explorer serve -c ${configPath} --kill\n`);
|
|
80
85
|
return;
|
|
81
86
|
}
|
|
82
87
|
return this._startDaemon(pipeName, configPath);
|
|
@@ -87,7 +92,14 @@ Without flags: starts a foreground daemon. Errors if one is already running.
|
|
|
87
92
|
return;
|
|
88
93
|
}
|
|
89
94
|
const cliEntryPoint = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../index.js');
|
|
90
|
-
const
|
|
95
|
+
const args = [cliEntryPoint, 'serve', '--project', configPath];
|
|
96
|
+
if (this.redirectionPort) {
|
|
97
|
+
args.push('--redirectionPort', this.redirectionPort);
|
|
98
|
+
}
|
|
99
|
+
if (this.redirectionHost) {
|
|
100
|
+
args.push('--redirectionHost', this.redirectionHost);
|
|
101
|
+
}
|
|
102
|
+
const child = spawn(process.execPath, args, { detached: true, stdio: 'ignore', windowsHide: true });
|
|
91
103
|
child.unref();
|
|
92
104
|
await waitForDaemon(pipeName, { timeoutMs: 30_000 });
|
|
93
105
|
this.context.stdout.write(`Daemon started (pipe: ${pipeName})\n`);
|
|
@@ -127,17 +139,54 @@ Without flags: starts a foreground daemon. Errors if one is already running.
|
|
|
127
139
|
this.context.stdout.write('Press Ctrl+C to stop.\n\n');
|
|
128
140
|
const sessionInfos = service.getSessionInfos();
|
|
129
141
|
for (const s of sessionInfos) {
|
|
130
|
-
|
|
142
|
+
if (s.isLoading) {
|
|
143
|
+
this.context.stdout.write(` ${s.name}: (loading) (${s.sourceKind})\n`);
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
this.context.stdout.write(` ${s.name}: ${s.serverUrl} (${s.sourceKind})\n`);
|
|
147
|
+
}
|
|
131
148
|
}
|
|
132
149
|
this.context.stdout.write('\n');
|
|
150
|
+
let redirectServer;
|
|
151
|
+
const redirectPort = this.redirectionPort
|
|
152
|
+
? parseInt(this.redirectionPort, 10)
|
|
153
|
+
: resolvedConfig.redirection?.port;
|
|
154
|
+
const redirectHost = this.redirectionHost ?? resolvedConfig.redirection?.host ?? 'localhost';
|
|
155
|
+
if (redirectPort) {
|
|
156
|
+
redirectServer = this._startRedirectionServer(service, redirectPort, redirectHost);
|
|
157
|
+
}
|
|
133
158
|
process.on('SIGINT', () => {
|
|
134
159
|
service.requestShutdown();
|
|
135
160
|
});
|
|
136
161
|
await service.runEventLoop();
|
|
137
162
|
this.context.stdout.write('\nShutting down...\n');
|
|
163
|
+
redirectServer?.dispose();
|
|
138
164
|
server.close();
|
|
139
165
|
await service.dispose();
|
|
140
166
|
}
|
|
167
|
+
_startRedirectionServer(service, port, host) {
|
|
168
|
+
const server = http.createServer(async (req, res) => {
|
|
169
|
+
const url = new URL(req.url ?? '/', `http://${req.headers.host}`);
|
|
170
|
+
const sessionName = url.searchParams.get('sessionName');
|
|
171
|
+
try {
|
|
172
|
+
const session = await service.waitForSession(sessionName ?? undefined);
|
|
173
|
+
const target = new URL(session.serverUrl);
|
|
174
|
+
target.pathname = url.pathname;
|
|
175
|
+
url.searchParams.delete('sessionName');
|
|
176
|
+
target.search = url.search;
|
|
177
|
+
res.writeHead(302, { Location: target.href });
|
|
178
|
+
res.end();
|
|
179
|
+
}
|
|
180
|
+
catch {
|
|
181
|
+
res.writeHead(503);
|
|
182
|
+
res.end('Session not available.\\n');
|
|
183
|
+
}
|
|
184
|
+
});
|
|
185
|
+
server.listen(port, host, () => {
|
|
186
|
+
this.context.stdout.write(`Redirection server listening on http://${host}:${port}\\n`);
|
|
187
|
+
});
|
|
188
|
+
return { dispose: () => server.close() };
|
|
189
|
+
}
|
|
141
190
|
}
|
|
142
191
|
|
|
143
192
|
export { ServeCommand };
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"serveCommand.js","sources":["../../src/commands/serveCommand.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"serveCommand.js","sources":["../../src/commands/serveCommand.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;;;;;;;;AAcM,MAAO,YAAa,SAAQ,OAAO,CAAA;IACxC,OAAgB,KAAK,GAAG,CAAC,CAAC,OAAO,CAAC,CAAC;AAEnC,IAAA,OAAgB,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;AACrC,QAAA,WAAW,EAAE,iDAAiD;AAC9D,QAAA,OAAO,EAAE;;;;;;AAMR,EAAA,CAAA;AACD,QAAA,QAAQ,EAAE;YACT,CAAC,qBAAqB,EAAE,yBAAyB,CAAC;YAClD,CAAC,qBAAqB,EAAE,sCAAsC,CAAC;Y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-12/schema",
|
|
3
|
+
"type": "object",
|
|
4
|
+
"properties": {
|
|
5
|
+
"screenshotDir": {
|
|
6
|
+
"description": "Directory for storing screenshots (default: .screenshots)",
|
|
7
|
+
"type": "string"
|
|
8
|
+
},
|
|
9
|
+
"sessions": {
|
|
10
|
+
"minItems": 1,
|
|
11
|
+
"type": "array",
|
|
12
|
+
"items": {
|
|
13
|
+
"type": "object",
|
|
14
|
+
"properties": {
|
|
15
|
+
"name": {
|
|
16
|
+
"type": "string",
|
|
17
|
+
"description": "Unique session name"
|
|
18
|
+
},
|
|
19
|
+
"source": {
|
|
20
|
+
"anyOf": [
|
|
21
|
+
{
|
|
22
|
+
"type": "string",
|
|
23
|
+
"const": "current"
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
"type": "object",
|
|
27
|
+
"properties": {
|
|
28
|
+
"worktree": {
|
|
29
|
+
"type": "object",
|
|
30
|
+
"properties": {
|
|
31
|
+
"ref": {
|
|
32
|
+
"type": "string",
|
|
33
|
+
"description": "Git ref (branch, tag, or commit) to check out"
|
|
34
|
+
},
|
|
35
|
+
"name": {
|
|
36
|
+
"description": "Directory name for the worktree (default: component-explorer-baseline)",
|
|
37
|
+
"type": "string"
|
|
38
|
+
},
|
|
39
|
+
"install": {
|
|
40
|
+
"anyOf": [
|
|
41
|
+
{
|
|
42
|
+
"type": "string",
|
|
43
|
+
"const": "auto"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"type": "string",
|
|
47
|
+
"const": "npm"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"type": "string",
|
|
51
|
+
"const": "pnpm"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
"type": "string",
|
|
55
|
+
"const": "yarn"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"type": "object",
|
|
59
|
+
"properties": {
|
|
60
|
+
"command": {
|
|
61
|
+
"type": "string",
|
|
62
|
+
"description": "Custom install command to run in the worktree"
|
|
63
|
+
}
|
|
64
|
+
},
|
|
65
|
+
"required": [
|
|
66
|
+
"command"
|
|
67
|
+
],
|
|
68
|
+
"additionalProperties": false
|
|
69
|
+
},
|
|
70
|
+
{
|
|
71
|
+
"type": "boolean",
|
|
72
|
+
"const": false
|
|
73
|
+
}
|
|
74
|
+
],
|
|
75
|
+
"description": "Dependency install strategy for the worktree"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"required": [
|
|
79
|
+
"ref"
|
|
80
|
+
],
|
|
81
|
+
"additionalProperties": false,
|
|
82
|
+
"description": "Git worktree configuration for a baseline session"
|
|
83
|
+
}
|
|
84
|
+
},
|
|
85
|
+
"required": [
|
|
86
|
+
"worktree"
|
|
87
|
+
],
|
|
88
|
+
"additionalProperties": false
|
|
89
|
+
}
|
|
90
|
+
],
|
|
91
|
+
"description": "Session source: \"current\" for the working tree, or a worktree config for a baseline"
|
|
92
|
+
},
|
|
93
|
+
"viteConfig": {
|
|
94
|
+
"description": "Path to vite config file, relative to this config (overrides top-level viteConfig)",
|
|
95
|
+
"type": "string"
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"required": [
|
|
99
|
+
"name"
|
|
100
|
+
],
|
|
101
|
+
"additionalProperties": false,
|
|
102
|
+
"description": "A component explorer session"
|
|
103
|
+
},
|
|
104
|
+
"description": "List of explorer sessions"
|
|
105
|
+
},
|
|
106
|
+
"compare": {
|
|
107
|
+
"type": "object",
|
|
108
|
+
"properties": {
|
|
109
|
+
"baseline": {
|
|
110
|
+
"type": "string",
|
|
111
|
+
"description": "Session name to use as the baseline for comparisons"
|
|
112
|
+
},
|
|
113
|
+
"current": {
|
|
114
|
+
"type": "string",
|
|
115
|
+
"description": "Session name to use as the current version for comparisons"
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"required": [
|
|
119
|
+
"baseline",
|
|
120
|
+
"current"
|
|
121
|
+
],
|
|
122
|
+
"additionalProperties": false,
|
|
123
|
+
"description": "Screenshot comparison configuration"
|
|
124
|
+
},
|
|
125
|
+
"viteConfig": {
|
|
126
|
+
"description": "Default vite config file path, relative to this config (default: vite.config.ts)",
|
|
127
|
+
"type": "string"
|
|
128
|
+
},
|
|
129
|
+
"vite": {
|
|
130
|
+
"type": "object",
|
|
131
|
+
"properties": {
|
|
132
|
+
"hmr": {
|
|
133
|
+
"type": "object",
|
|
134
|
+
"properties": {
|
|
135
|
+
"allowedPaths": {
|
|
136
|
+
"type": "array",
|
|
137
|
+
"items": {
|
|
138
|
+
"type": "string"
|
|
139
|
+
},
|
|
140
|
+
"description": "Glob patterns for files that keep HMR; everything else triggers a full reload"
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"required": [
|
|
144
|
+
"allowedPaths"
|
|
145
|
+
],
|
|
146
|
+
"additionalProperties": false,
|
|
147
|
+
"description": "Vite HMR configuration"
|
|
148
|
+
}
|
|
149
|
+
},
|
|
150
|
+
"additionalProperties": false,
|
|
151
|
+
"description": "Vite configuration overrides"
|
|
152
|
+
},
|
|
153
|
+
"redirection": {
|
|
154
|
+
"type": "object",
|
|
155
|
+
"properties": {
|
|
156
|
+
"port": {
|
|
157
|
+
"type": "integer",
|
|
158
|
+
"minimum": 1,
|
|
159
|
+
"maximum": 65535,
|
|
160
|
+
"description": "Port for the redirection HTTP server"
|
|
161
|
+
},
|
|
162
|
+
"host": {
|
|
163
|
+
"description": "Host to bind the redirection server to (default: localhost)",
|
|
164
|
+
"type": "string"
|
|
165
|
+
}
|
|
166
|
+
},
|
|
167
|
+
"required": [
|
|
168
|
+
"port"
|
|
169
|
+
],
|
|
170
|
+
"additionalProperties": false,
|
|
171
|
+
"description": "HTTP redirection server that redirects to the session URL"
|
|
172
|
+
},
|
|
173
|
+
"$schema": {
|
|
174
|
+
"type": "string",
|
|
175
|
+
"description": "URL of the JSON Schema for this config file"
|
|
176
|
+
}
|
|
177
|
+
},
|
|
178
|
+
"required": [
|
|
179
|
+
"sessions"
|
|
180
|
+
],
|
|
181
|
+
"additionalProperties": false,
|
|
182
|
+
"description": "Component Explorer configuration"
|
|
183
|
+
}
|
|
@@ -49,9 +49,18 @@ export interface ScreenshotResult {
|
|
|
49
49
|
readonly image: Uint8Array;
|
|
50
50
|
readonly errors: ErrorInfo[];
|
|
51
51
|
}
|
|
52
|
+
export interface StabilityScreenshot {
|
|
53
|
+
readonly image: Uint8Array;
|
|
54
|
+
readonly delayMs: number;
|
|
55
|
+
}
|
|
56
|
+
export interface StabilityCheckResult {
|
|
57
|
+
readonly screenshots: readonly StabilityScreenshot[];
|
|
58
|
+
readonly errors: ErrorInfo[];
|
|
59
|
+
}
|
|
52
60
|
export interface ComponentExplorer {
|
|
53
61
|
listFixtures(): Promise<FixtureInfo[]>;
|
|
54
62
|
screenshotFixture(fixtureId: string): Promise<ScreenshotResult>;
|
|
63
|
+
screenshotFixtureStabilityCheck(fixtureId: string): Promise<StabilityCheckResult>;
|
|
55
64
|
evaluateJs(expression: string, fixtureId?: string): Promise<unknown>;
|
|
56
65
|
codeCoverage(id: FixtureId | FixtureGroupId): Promise<CoverageData>;
|
|
57
66
|
waitForUpdate(timeoutMs?: number): Promise<void>;
|
|
@@ -70,6 +79,7 @@ export declare class BrowserComponentExplorer implements ComponentExplorer {
|
|
|
70
79
|
private _getState;
|
|
71
80
|
listFixtures(): Promise<FixtureInfo[]>;
|
|
72
81
|
screenshotFixture(fixtureId: string): Promise<ScreenshotResult>;
|
|
82
|
+
screenshotFixtureStabilityCheck(fixtureId: string): Promise<StabilityCheckResult>;
|
|
73
83
|
evaluateJs(expression: string, fixtureId?: string): Promise<unknown>;
|
|
74
84
|
codeCoverage(_id: FixtureId | FixtureGroupId): Promise<CoverageData>;
|
|
75
85
|
waitForUpdate(timeoutMs?: number): Promise<void>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentExplorer.d.ts","sourceRoot":"","sources":["../src/componentExplorer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,kBAAkB,EAAE,MAAM,kBAAkB,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AiB;IAMhE,OAAO,CAAC,QAAQ,CAAC,mBAAmB;IACpC,OAAO,CAAC,QAAQ,CAAC,OAAO;IACxB,OAAO,CAAC,QAAQ,CAAC,OAAO;IAPzB,OAAO,CAAC,KAAK,CAA0B;IACvC,OAAO,CAAC,UAAU,CAAuB;IACzC,OAAO,CAAC,gBAAgB,CAAoC;gBAG1C,mBAAmB,EAAE,kBAAkB,EACvC,OAAO,EAAE,2BAA2B,EACpC,OAAO,GAAE,OAAoB;YAGjC,YAAY;YAUZ,cAAc;YAed,SAAS;IAOjB,YAAY,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAKtC,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IAyB/D,+BAA+B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAsDjF,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAkBpE,YAAY,CAAC,GAAG,EAAE,SAAS,GAAG,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAIpE,aAAa,CAAC,SAAS,SAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAuC3C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAI9B"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { nullLogger } from './logger.js';
|
|
2
|
+
import { buildExplorerUrl } from './utils.js';
|
|
2
3
|
|
|
3
4
|
class BrowserComponentExplorer {
|
|
4
5
|
_browserPageFactory;
|
|
@@ -14,7 +15,7 @@ class BrowserComponentExplorer {
|
|
|
14
15
|
}
|
|
15
16
|
async _ensureReady() {
|
|
16
17
|
if (!this._page) {
|
|
17
|
-
const cliUrl = this._server.url
|
|
18
|
+
const cliUrl = buildExplorerUrl({ baseUrl: this._server.url, rawRender: true });
|
|
18
19
|
this._logger.log(`Opening browser page: ${cliUrl}`);
|
|
19
20
|
this._page = await this._browserPageFactory.openPage(cliUrl);
|
|
20
21
|
await this._waitForCliApi(this._page);
|
|
@@ -54,7 +55,7 @@ class BrowserComponentExplorer {
|
|
|
54
55
|
try {
|
|
55
56
|
const page = await this._ensureReady();
|
|
56
57
|
const escapedId = JSON.stringify(fixtureId);
|
|
57
|
-
const debugUrl =
|
|
58
|
+
const debugUrl = buildExplorerUrl({ baseUrl: this._server.url, rawRender: true, fixtureId });
|
|
58
59
|
this._logger.log(`Rendering fixture: ${debugUrl}`);
|
|
59
60
|
// renderFixture now returns { errors: ErrorInfo[] }
|
|
60
61
|
const renderResult = await page.evaluateJs(`window.__componentExplorerCli__.renderFixture(${escapedId})`);
|
|
@@ -65,6 +66,51 @@ class BrowserComponentExplorer {
|
|
|
65
66
|
resolve();
|
|
66
67
|
}
|
|
67
68
|
}
|
|
69
|
+
async screenshotFixtureStabilityCheck(fixtureId) {
|
|
70
|
+
const prev = this._screenshotMutex;
|
|
71
|
+
let resolve;
|
|
72
|
+
this._screenshotMutex = new Promise(r => { resolve = r; });
|
|
73
|
+
await prev;
|
|
74
|
+
try {
|
|
75
|
+
const page = await this._ensureReady();
|
|
76
|
+
const escapedId = JSON.stringify(fixtureId);
|
|
77
|
+
const debugUrl = buildExplorerUrl({ baseUrl: this._server.url, rawRender: true, fixtureId });
|
|
78
|
+
this._logger.log(`Stability check: ${debugUrl}`);
|
|
79
|
+
// Dispose current fixture first to test initial mounting stability
|
|
80
|
+
await page.evaluateJs(`window.__componentExplorerCli__.disposeCurrentFixture?.()`);
|
|
81
|
+
const startTime = Date.now();
|
|
82
|
+
const renderResult = await page.evaluateJs(`window.__componentExplorerCli__.renderFixture(${escapedId})`);
|
|
83
|
+
// Screenshot at t≈0 (immediately after render)
|
|
84
|
+
const domExpr = `document.getElementById('root').lastElementChild`;
|
|
85
|
+
const image0 = await page.screenshot(domExpr);
|
|
86
|
+
const delay0 = Date.now() - startTime;
|
|
87
|
+
// Wait until 500ms from start
|
|
88
|
+
const elapsed1 = Date.now() - startTime;
|
|
89
|
+
if (elapsed1 < 500) {
|
|
90
|
+
await new Promise(r => setTimeout(r, 500 - elapsed1));
|
|
91
|
+
}
|
|
92
|
+
const image1 = await page.screenshot(domExpr);
|
|
93
|
+
const delay1 = Date.now() - startTime;
|
|
94
|
+
// Wait until 3000ms from start
|
|
95
|
+
const elapsed2 = Date.now() - startTime;
|
|
96
|
+
if (elapsed2 < 3000) {
|
|
97
|
+
await new Promise(r => setTimeout(r, 3000 - elapsed2));
|
|
98
|
+
}
|
|
99
|
+
const image2 = await page.screenshot(domExpr);
|
|
100
|
+
const delay2 = Date.now() - startTime;
|
|
101
|
+
return {
|
|
102
|
+
screenshots: [
|
|
103
|
+
{ image: image0, delayMs: delay0 },
|
|
104
|
+
{ image: image1, delayMs: delay1 },
|
|
105
|
+
{ image: image2, delayMs: delay2 },
|
|
106
|
+
],
|
|
107
|
+
errors: renderResult.errors,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
finally {
|
|
111
|
+
resolve();
|
|
112
|
+
}
|
|
113
|
+
}
|
|
68
114
|
async evaluateJs(expression, fixtureId) {
|
|
69
115
|
const prev = this._screenshotMutex;
|
|
70
116
|
let resolve;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentExplorer.js","sources":["../src/componentExplorer.ts"],"sourcesContent":[null],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"componentExplorer.js","sources":["../src/componentExplorer.ts"],"sourcesContent":[null],"names":[],"mappings":";;;MAkFa,wBAAwB,CAAA;AAMlB,IAAA,mBAAA;AACA,IAAA,OAAA;AACA,IAAA,OAAA;AAPV,IAAA,KAAK;AACL,IAAA,UAAU;AACV,IAAA,gBAAgB,GAAkB,OAAO,CAAC,OAAO,EAAE;AAE3D,IAAA,WAAA,CACkB,mBAAuC,EACvC,OAAoC,EACpC,UAAmB,UAAU,EAAA;QAF7B,IAAA,CAAA,mBAAmB,GAAnB,mBAAmB;QACnB,IAAA,CAAA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
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type IDisposable } from '@vscode/observables';
|
|
1
|
+
import { type IDisposable, type IReader } from '@vscode/observables';
|
|
2
2
|
import { AsyncStream } from '@hediet/simple-api';
|
|
3
3
|
import { ExplorerSession } from '../explorerSession.js';
|
|
4
4
|
import type { ResolvedWatchConfig } from '../watchConfig.js';
|
|
@@ -33,12 +33,17 @@ export type DaemonEvent = {
|
|
|
33
33
|
readonly level: 'info' | 'debug' | 'trace';
|
|
34
34
|
readonly message: string;
|
|
35
35
|
};
|
|
36
|
-
export
|
|
36
|
+
export type SessionInfo = {
|
|
37
37
|
readonly name: string;
|
|
38
38
|
readonly sourceKind: 'current' | 'worktree';
|
|
39
|
+
readonly isLoading: true;
|
|
40
|
+
} | {
|
|
41
|
+
readonly name: string;
|
|
42
|
+
readonly sourceKind: 'current' | 'worktree';
|
|
43
|
+
readonly isLoading?: false;
|
|
39
44
|
readonly serverUrl: string;
|
|
40
45
|
readonly sourceTreeId: string;
|
|
41
|
-
}
|
|
46
|
+
};
|
|
42
47
|
export declare class SourceTreeChangedError extends Error {
|
|
43
48
|
constructor(sessionName: string);
|
|
44
49
|
}
|
|
@@ -71,11 +76,25 @@ export declare class DaemonService {
|
|
|
71
76
|
sourceTreeId: string;
|
|
72
77
|
sessionName: string;
|
|
73
78
|
includeImage?: boolean | undefined;
|
|
79
|
+
stabilityCheck?: boolean | undefined;
|
|
74
80
|
}, {
|
|
75
81
|
hash: string;
|
|
76
82
|
sourceTreeId: string;
|
|
77
83
|
image: string | undefined;
|
|
78
84
|
errors: import("../componentExplorer.js").ErrorInfo[] | undefined;
|
|
85
|
+
isStable: boolean;
|
|
86
|
+
stabilityScreenshots: {
|
|
87
|
+
hash: string;
|
|
88
|
+
delayMs: number;
|
|
89
|
+
image: string | undefined;
|
|
90
|
+
}[];
|
|
91
|
+
} | {
|
|
92
|
+
hash: string;
|
|
93
|
+
sourceTreeId: string;
|
|
94
|
+
image: string | undefined;
|
|
95
|
+
errors: import("../componentExplorer.js").ErrorInfo[] | undefined;
|
|
96
|
+
isStable?: undefined;
|
|
97
|
+
stabilityScreenshots?: undefined;
|
|
79
98
|
}, undefined>;
|
|
80
99
|
takeBatch: import("@hediet/simple-api").IMethod<{
|
|
81
100
|
fixtureIds: string[];
|
|
@@ -148,7 +167,10 @@ export declare class DaemonService {
|
|
|
148
167
|
}): Promise<DaemonService>;
|
|
149
168
|
private _buildApi;
|
|
150
169
|
getSession(name: string): ExplorerSession;
|
|
151
|
-
getSessionInfos(): SessionInfo[];
|
|
170
|
+
getSessionInfos(reader?: IReader): SessionInfo[];
|
|
171
|
+
waitForSession(sessionName: string | undefined): Promise<SessionInfo & {
|
|
172
|
+
isLoading?: false;
|
|
173
|
+
}>;
|
|
152
174
|
getSourceTreeId(sessionName: string): string;
|
|
153
175
|
assertSourceTreeId(sessionName: string, expected: string): void;
|
|
154
176
|
eventStream(): AsyncIterable<DaemonEvent>;
|