@vscode/component-explorer-cli 0.1.1-17 → 0.1.1-18
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/WorktreePool.d.ts +22 -0
- package/dist/WorktreePool.d.ts.map +1 -0
- package/dist/WorktreePool.js +58 -0
- package/dist/WorktreePool.js.map +1 -0
- package/dist/WorktreePool.test.d.ts +2 -0
- package/dist/WorktreePool.test.d.ts.map +1 -0
- package/dist/_virtual/_build-info.js +4 -0
- package/dist/_virtual/_build-info.js.map +1 -0
- package/dist/commands/acceptCommand.d.ts.map +1 -1
- package/dist/commands/acceptCommand.js +3 -2
- package/dist/commands/acceptCommand.js.map +1 -1
- package/dist/commands/checkStabilityCommand.d.ts.map +1 -1
- package/dist/commands/checkStabilityCommand.js +2 -1
- package/dist/commands/checkStabilityCommand.js.map +1 -1
- package/dist/commands/compareCommand.d.ts.map +1 -1
- package/dist/commands/compareCommand.js +3 -2
- package/dist/commands/compareCommand.js.map +1 -1
- package/dist/commands/screenshotCommand.d.ts.map +1 -1
- package/dist/commands/screenshotCommand.js +2 -1
- package/dist/commands/screenshotCommand.js.map +1 -1
- package/dist/commands/serveCommand.d.ts.map +1 -1
- package/dist/commands/serveCommand.js +2 -1
- package/dist/commands/serveCommand.js.map +1 -1
- package/dist/commands/watchCommand.d.ts.map +1 -1
- package/dist/commands/watchCommand.js +6 -61
- package/dist/commands/watchCommand.js.map +1 -1
- package/dist/component-explorer-config.schema.json +97 -58
- package/dist/componentExplorer.d.ts +12 -17
- package/dist/componentExplorer.d.ts.map +1 -1
- package/dist/componentExplorer.js +27 -15
- package/dist/componentExplorer.js.map +1 -1
- package/dist/daemon/DaemonService.d.ts +71 -5
- package/dist/daemon/DaemonService.d.ts.map +1 -1
- package/dist/daemon/DaemonService.js +415 -90
- package/dist/daemon/DaemonService.js.map +1 -1
- package/dist/daemon/dynamicSessions.test.d.ts +2 -0
- package/dist/daemon/dynamicSessions.test.d.ts.map +1 -0
- package/dist/daemon/pipeClient.d.ts.map +1 -1
- package/dist/daemon/pipeClient.js +71 -2
- package/dist/daemon/pipeClient.js.map +1 -1
- package/dist/daemon/version.d.ts +10 -0
- package/dist/daemon/version.d.ts.map +1 -0
- package/dist/daemon/version.js +17 -0
- package/dist/daemon/version.js.map +1 -0
- package/dist/dependencyInstaller.d.ts +2 -2
- package/dist/dependencyInstaller.d.ts.map +1 -1
- package/dist/dependencyInstaller.js.map +1 -1
- package/dist/git/gitIndexResolver.d.ts +25 -0
- package/dist/git/gitIndexResolver.d.ts.map +1 -0
- package/dist/git/gitIndexResolver.js +91 -0
- package/dist/git/gitIndexResolver.js.map +1 -0
- package/dist/git/gitIndexResolver.test.d.ts +2 -0
- package/dist/git/gitIndexResolver.test.d.ts.map +1 -0
- package/dist/git/gitService.d.ts +2 -0
- package/dist/git/gitService.d.ts.map +1 -1
- package/dist/git/gitService.js +6 -0
- package/dist/git/gitService.js.map +1 -1
- package/dist/git/gitWorktreeManager.d.ts +6 -0
- package/dist/git/gitWorktreeManager.d.ts.map +1 -1
- package/dist/git/gitWorktreeManager.js +42 -13
- package/dist/git/gitWorktreeManager.js.map +1 -1
- package/dist/git/gitWorktreeManager.test.d.ts +2 -0
- package/dist/git/gitWorktreeManager.test.d.ts.map +1 -0
- package/dist/git/testUtils.d.ts +13 -0
- package/dist/git/testUtils.d.ts.map +1 -0
- package/dist/httpServer.d.ts +6 -1
- package/dist/httpServer.d.ts.map +1 -1
- package/dist/httpServer.js +13 -0
- package/dist/httpServer.js.map +1 -1
- package/dist/index.js +9 -2
- package/dist/index.js.map +1 -1
- package/dist/logger.d.ts +1 -0
- package/dist/logger.d.ts.map +1 -1
- package/dist/logger.js +7 -1
- package/dist/logger.js.map +1 -1
- package/dist/mcp/McpServer.d.ts +6 -0
- package/dist/mcp/McpServer.d.ts.map +1 -1
- package/dist/mcp/McpServer.js +175 -26
- package/dist/mcp/McpServer.js.map +1 -1
- package/dist/packages/simple-api/dist/{chunk-Q24JOMNK.js → chunk-TAEFVNPN.js} +1 -1
- package/dist/packages/simple-api/dist/chunk-TAEFVNPN.js.map +1 -0
- package/dist/packages/simple-api/dist/express.js +1 -1
- package/dist/packages/simple-api/dist/express.js.map +1 -1
- package/dist/utils.d.ts +7 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +6 -7
- package/dist/utils.js.map +1 -1
- package/dist/watchConfig.d.ts +19 -12
- package/dist/watchConfig.d.ts.map +1 -1
- package/dist/watchConfig.js +43 -48
- package/dist/watchConfig.js.map +1 -1
- package/package.json +6 -2
- package/dist/packages/simple-api/dist/chunk-Q24JOMNK.js.map +0 -1
|
@@ -17,78 +17,66 @@
|
|
|
17
17
|
"description": "Unique session name"
|
|
18
18
|
},
|
|
19
19
|
"source": {
|
|
20
|
-
"
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
},
|
|
25
|
-
{
|
|
20
|
+
"description": "Source configuration (default: current working tree)",
|
|
21
|
+
"type": "object",
|
|
22
|
+
"properties": {
|
|
23
|
+
"worktree": {
|
|
26
24
|
"type": "object",
|
|
27
25
|
"properties": {
|
|
28
|
-
"
|
|
29
|
-
"type": "
|
|
30
|
-
"
|
|
31
|
-
|
|
26
|
+
"ref": {
|
|
27
|
+
"type": "string",
|
|
28
|
+
"description": "Git ref to check out (branch, tag, commit, or \"INDEX\" for the git staging area)"
|
|
29
|
+
},
|
|
30
|
+
"install": {
|
|
31
|
+
"description": "Dependency install strategy override for this session",
|
|
32
|
+
"anyOf": [
|
|
33
|
+
{
|
|
32
34
|
"type": "string",
|
|
33
|
-
"
|
|
35
|
+
"const": "auto"
|
|
34
36
|
},
|
|
35
|
-
|
|
36
|
-
"
|
|
37
|
-
"
|
|
37
|
+
{
|
|
38
|
+
"type": "string",
|
|
39
|
+
"const": "npm"
|
|
38
40
|
},
|
|
39
|
-
|
|
40
|
-
"
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"const": "pnpm"
|
|
52
|
-
},
|
|
53
|
-
{
|
|
41
|
+
{
|
|
42
|
+
"type": "string",
|
|
43
|
+
"const": "pnpm"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"type": "string",
|
|
47
|
+
"const": "yarn"
|
|
48
|
+
},
|
|
49
|
+
{
|
|
50
|
+
"type": "object",
|
|
51
|
+
"properties": {
|
|
52
|
+
"command": {
|
|
54
53
|
"type": "string",
|
|
55
|
-
"
|
|
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
|
|
54
|
+
"description": "Custom install command to run in the worktree"
|
|
73
55
|
}
|
|
56
|
+
},
|
|
57
|
+
"required": [
|
|
58
|
+
"command"
|
|
74
59
|
],
|
|
75
|
-
"
|
|
60
|
+
"additionalProperties": false
|
|
61
|
+
},
|
|
62
|
+
{
|
|
63
|
+
"type": "boolean",
|
|
64
|
+
"const": false
|
|
76
65
|
}
|
|
77
|
-
|
|
78
|
-
"required": [
|
|
79
|
-
"ref"
|
|
80
|
-
],
|
|
81
|
-
"additionalProperties": false,
|
|
82
|
-
"description": "Git worktree configuration for a baseline session"
|
|
66
|
+
]
|
|
83
67
|
}
|
|
84
68
|
},
|
|
85
69
|
"required": [
|
|
86
|
-
"
|
|
70
|
+
"ref"
|
|
87
71
|
],
|
|
88
|
-
"additionalProperties": false
|
|
72
|
+
"additionalProperties": false,
|
|
73
|
+
"description": "Worktree source configuration"
|
|
89
74
|
}
|
|
75
|
+
},
|
|
76
|
+
"required": [
|
|
77
|
+
"worktree"
|
|
90
78
|
],
|
|
91
|
-
"
|
|
79
|
+
"additionalProperties": false
|
|
92
80
|
},
|
|
93
81
|
"viteConfig": {
|
|
94
82
|
"description": "Path to vite config file, relative to this config (overrides top-level viteConfig)",
|
|
@@ -101,7 +89,58 @@
|
|
|
101
89
|
"additionalProperties": false,
|
|
102
90
|
"description": "A component explorer session"
|
|
103
91
|
},
|
|
104
|
-
"description": "List of explorer sessions"
|
|
92
|
+
"description": "List of explorer sessions (currently only \"current\" working tree sessions)"
|
|
93
|
+
},
|
|
94
|
+
"worktree": {
|
|
95
|
+
"description": "Dynamic worktree session pool configuration",
|
|
96
|
+
"type": "object",
|
|
97
|
+
"properties": {
|
|
98
|
+
"setup": {
|
|
99
|
+
"description": "Dependency install strategy for dynamic worktree sessions (default: auto)",
|
|
100
|
+
"anyOf": [
|
|
101
|
+
{
|
|
102
|
+
"type": "string",
|
|
103
|
+
"const": "auto"
|
|
104
|
+
},
|
|
105
|
+
{
|
|
106
|
+
"type": "string",
|
|
107
|
+
"const": "npm"
|
|
108
|
+
},
|
|
109
|
+
{
|
|
110
|
+
"type": "string",
|
|
111
|
+
"const": "pnpm"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"type": "string",
|
|
115
|
+
"const": "yarn"
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
"type": "object",
|
|
119
|
+
"properties": {
|
|
120
|
+
"command": {
|
|
121
|
+
"type": "string",
|
|
122
|
+
"description": "Custom install command to run in the worktree"
|
|
123
|
+
}
|
|
124
|
+
},
|
|
125
|
+
"required": [
|
|
126
|
+
"command"
|
|
127
|
+
],
|
|
128
|
+
"additionalProperties": false
|
|
129
|
+
},
|
|
130
|
+
{
|
|
131
|
+
"type": "boolean",
|
|
132
|
+
"const": false
|
|
133
|
+
}
|
|
134
|
+
]
|
|
135
|
+
},
|
|
136
|
+
"maxSlots": {
|
|
137
|
+
"description": "Maximum number of simultaneous worktree sessions (default: 2, max: 3)",
|
|
138
|
+
"type": "integer",
|
|
139
|
+
"minimum": 1,
|
|
140
|
+
"maximum": 3
|
|
141
|
+
}
|
|
142
|
+
},
|
|
143
|
+
"additionalProperties": false
|
|
105
144
|
},
|
|
106
145
|
"compare": {
|
|
107
146
|
"type": "object",
|
|
@@ -22,25 +22,13 @@ export interface CoverageFileEntry {
|
|
|
22
22
|
readonly coveredLines: readonly number[];
|
|
23
23
|
readonly uncoveredLines: readonly number[];
|
|
24
24
|
}
|
|
25
|
-
/**
|
|
26
|
-
* Error captured during fixture rendering.
|
|
27
|
-
* Can be either an unhandled exception or a console error/warning.
|
|
28
|
-
*/
|
|
29
|
-
export type ErrorInfo = ExceptionError | ConsoleError;
|
|
30
|
-
/**
|
|
31
|
-
* Unhandled exception thrown during render.
|
|
32
|
-
*/
|
|
33
25
|
export interface ExceptionError {
|
|
34
|
-
readonly kind: 'exception';
|
|
35
26
|
readonly message: string;
|
|
36
27
|
readonly stack?: string;
|
|
37
28
|
}
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
export interface ConsoleError {
|
|
42
|
-
readonly kind: 'console';
|
|
43
|
-
readonly level: 'error' | 'warn';
|
|
29
|
+
export type RenderEventType = 'console.error' | 'console.warn' | 'console.log' | 'window.error' | 'window.unhandledrejection';
|
|
30
|
+
export interface RenderEvent {
|
|
31
|
+
readonly type: RenderEventType;
|
|
44
32
|
readonly message: string;
|
|
45
33
|
}
|
|
46
34
|
/**
|
|
@@ -48,7 +36,10 @@ export interface ConsoleError {
|
|
|
48
36
|
*/
|
|
49
37
|
export interface ScreenshotResult {
|
|
50
38
|
readonly image: Uint8Array;
|
|
51
|
-
readonly
|
|
39
|
+
readonly hasError: boolean;
|
|
40
|
+
readonly error?: ExceptionError;
|
|
41
|
+
readonly events: RenderEvent[];
|
|
42
|
+
readonly resultData?: unknown;
|
|
52
43
|
}
|
|
53
44
|
export interface StabilityScreenshot {
|
|
54
45
|
readonly image: Uint8Array;
|
|
@@ -56,7 +47,10 @@ export interface StabilityScreenshot {
|
|
|
56
47
|
}
|
|
57
48
|
export interface StabilityCheckResult {
|
|
58
49
|
readonly screenshots: readonly StabilityScreenshot[];
|
|
59
|
-
readonly
|
|
50
|
+
readonly hasError: boolean;
|
|
51
|
+
readonly error?: ExceptionError;
|
|
52
|
+
readonly events: RenderEvent[];
|
|
53
|
+
readonly resultData?: unknown;
|
|
60
54
|
}
|
|
61
55
|
export interface ComponentExplorer {
|
|
62
56
|
listFixtures(): Promise<FixtureInfo[]>;
|
|
@@ -77,6 +71,7 @@ export declare class BrowserComponentExplorer implements ComponentExplorer {
|
|
|
77
71
|
constructor(_browserPageFactory: BrowserPageFactory, _server: ComponentExplorerHttpServer, _logger?: ILogger);
|
|
78
72
|
private _ensureReady;
|
|
79
73
|
private _waitForCliApi;
|
|
74
|
+
private _assertRuntimeVersionCompatibility;
|
|
80
75
|
private _getState;
|
|
81
76
|
listFixtures(): Promise<FixtureInfo[]>;
|
|
82
77
|
screenshotFixture(fixtureId: string): Promise<ScreenshotResult>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentExplorer.d.ts","sourceRoot":"","sources":["../src/componentExplorer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"componentExplorer.d.ts","sourceRoot":"","sources":["../src/componentExplorer.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAe,kBAAkB,EAAE,MAAM,kBAAkB,CAAC;AACxE,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,iBAAiB,CAAC;AACnE,OAAO,EAAE,KAAK,OAAO,EAAc,MAAM,aAAa,CAAC;AAQvD,MAAM,WA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K,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;IAgB5B,OAAO,CAAC,kCAAkC;YAU5B,SAAS;IAQjB,YAAY,IAAI,OAAO,CAAC,WAAW,EAAE,CAAC;IAKtC,iBAAiB,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,gBAAgB,CAAC;IA6B/D,+BAA+B,CAAC,SAAS,EAAE,MAAM,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAwDjF,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,SAAS,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAqBpE,YAAY,CAAC,GAAG,EAAE,SAAS,GAAG,cAAc,GAAG,OAAO,CAAC,YAAY,CAAC;IAIpE,aAAa,CAAC,SAAS,SAAI,GAAG,OAAO,CAAC,IAAI,CAAC;IAsC3C,OAAO,IAAI,OAAO,CAAC,IAAI,CAAC;CAI9B"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { nullLogger } from './logger.js';
|
|
2
2
|
import { buildExplorerUrl } from './utils.js';
|
|
3
|
+
import { parseVersion, isCompatibleVersion, runtimeVersionNeededByCliText } from './daemon/version.js';
|
|
3
4
|
|
|
4
5
|
class BrowserComponentExplorer {
|
|
5
6
|
_browserPageFactory;
|
|
@@ -23,28 +24,37 @@ class BrowserComponentExplorer {
|
|
|
23
24
|
return this._page;
|
|
24
25
|
}
|
|
25
26
|
async _waitForCliApi(page) {
|
|
26
|
-
this._logger.trace('Polling for
|
|
27
|
+
this._logger.trace('Polling for __componentExplorer__ to initialize...');
|
|
27
28
|
await page.evaluateJs(`
|
|
28
29
|
new Promise(resolve => {
|
|
29
30
|
function check() {
|
|
30
|
-
if (window.
|
|
31
|
+
if (window.__componentExplorer__) resolve();
|
|
31
32
|
else setTimeout(check, 50);
|
|
32
33
|
}
|
|
33
34
|
check();
|
|
34
35
|
})
|
|
35
36
|
`);
|
|
36
37
|
this._lastState = await this._getState(page);
|
|
38
|
+
this._assertRuntimeVersionCompatibility(this._lastState.runtimeVersion);
|
|
37
39
|
this._logger.debug(`CLI API ready, sessionId=${this._lastState.sessionId}, version=${this._lastState.updateVersion}`);
|
|
38
40
|
}
|
|
41
|
+
_assertRuntimeVersionCompatibility(runtimeVersion) {
|
|
42
|
+
const expected = parseVersion(runtimeVersionNeededByCliText);
|
|
43
|
+
const actual = parseVersion(runtimeVersion);
|
|
44
|
+
if (!isCompatibleVersion(expected, actual)) {
|
|
45
|
+
throw new Error(`Explorer runtime version mismatch. CLI requires ${runtimeVersionNeededByCliText}, browser runtime provides ${runtimeVersion}. Update CLI and explorer runtime together.`);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
39
48
|
async _getState(page) {
|
|
40
49
|
return page.evaluateJs(`({
|
|
41
|
-
sessionId: window.
|
|
42
|
-
updateVersion: window.
|
|
50
|
+
sessionId: window.__componentExplorer__.sessionId,
|
|
51
|
+
updateVersion: window.__componentExplorer__.updateVersion,
|
|
52
|
+
runtimeVersion: window.__componentExplorer__.runtimeVersion,
|
|
43
53
|
})`);
|
|
44
54
|
}
|
|
45
55
|
async listFixtures() {
|
|
46
56
|
const page = await this._ensureReady();
|
|
47
|
-
return page.evaluateJs('window.
|
|
57
|
+
return page.evaluateJs('window.__componentExplorer__.listFixtures()');
|
|
48
58
|
}
|
|
49
59
|
async screenshotFixture(fixtureId) {
|
|
50
60
|
// Serialize screenshot calls — the single browser page can only render one fixture at a time
|
|
@@ -60,10 +70,10 @@ class BrowserComponentExplorer {
|
|
|
60
70
|
const escapedId = JSON.stringify(fixtureId);
|
|
61
71
|
const debugUrl = buildExplorerUrl({ baseUrl: this._server.url, rawRender: true, fixtureId });
|
|
62
72
|
this._logger.debug(`Rendering fixture: ${debugUrl}`);
|
|
63
|
-
const renderResult = await page.evaluateJs(`window.
|
|
73
|
+
const renderResult = await page.evaluateJs(`window.__componentExplorer__.renderFixture(${escapedId})`);
|
|
64
74
|
const image = await page.screenshot(`document.getElementById('root').lastElementChild`);
|
|
65
75
|
this._logger.debug(`Screenshot done: ${fixtureId} (${Date.now() - startTime}ms)`);
|
|
66
|
-
return { image,
|
|
76
|
+
return { image, ...renderResult };
|
|
67
77
|
}
|
|
68
78
|
finally {
|
|
69
79
|
this._logger.trace(`Screenshot mutex: released for ${fixtureId}`);
|
|
@@ -82,9 +92,9 @@ class BrowserComponentExplorer {
|
|
|
82
92
|
const escapedId = JSON.stringify(fixtureId);
|
|
83
93
|
const debugUrl = buildExplorerUrl({ baseUrl: this._server.url, rawRender: true, fixtureId });
|
|
84
94
|
this._logger.debug(`Stability check: ${debugUrl}`);
|
|
85
|
-
await page.evaluateJs(`window.
|
|
95
|
+
await page.evaluateJs(`window.__componentExplorer__.disposeCurrentFixture?.()`);
|
|
86
96
|
const startTime = Date.now();
|
|
87
|
-
const renderResult = await page.evaluateJs(`window.
|
|
97
|
+
const renderResult = await page.evaluateJs(`window.__componentExplorer__.renderFixture(${escapedId})`);
|
|
88
98
|
const domExpr = `document.getElementById('root').lastElementChild`;
|
|
89
99
|
const image0 = await page.screenshot(domExpr);
|
|
90
100
|
const delay0 = Date.now() - startTime;
|
|
@@ -109,7 +119,7 @@ class BrowserComponentExplorer {
|
|
|
109
119
|
{ image: image1, delayMs: delay1 },
|
|
110
120
|
{ image: image2, delayMs: delay2 },
|
|
111
121
|
],
|
|
112
|
-
|
|
122
|
+
...renderResult,
|
|
113
123
|
};
|
|
114
124
|
}
|
|
115
125
|
finally {
|
|
@@ -127,7 +137,7 @@ class BrowserComponentExplorer {
|
|
|
127
137
|
const page = await this._ensureReady();
|
|
128
138
|
if (fixtureId !== undefined) {
|
|
129
139
|
const escapedId = JSON.stringify(fixtureId);
|
|
130
|
-
await page.evaluateJs(`window.
|
|
140
|
+
await page.evaluateJs(`window.__componentExplorer__.renderFixture(${escapedId})`);
|
|
131
141
|
}
|
|
132
142
|
const result = await page.evaluateJs(expression);
|
|
133
143
|
this._logger.trace(`evaluateJs: result length=${JSON.stringify(result)?.length ?? 0}`);
|
|
@@ -148,16 +158,17 @@ class BrowserComponentExplorer {
|
|
|
148
158
|
new Promise((resolve, reject) => {
|
|
149
159
|
${timeoutMs > 0 ? `const timeout = setTimeout(() => reject(new Error('Timeout waiting for HMR update')), ${timeoutMs});` : ''}
|
|
150
160
|
function check() {
|
|
151
|
-
if (!window.
|
|
161
|
+
if (!window.__componentExplorer__) {
|
|
152
162
|
// Page reloaded — CLI not yet re-initialized, keep waiting
|
|
153
163
|
setTimeout(check, 50);
|
|
154
164
|
return;
|
|
155
165
|
}
|
|
156
|
-
const s = window.
|
|
157
|
-
const v = window.
|
|
166
|
+
const s = window.__componentExplorer__.sessionId;
|
|
167
|
+
const v = window.__componentExplorer__.updateVersion;
|
|
168
|
+
const r = window.__componentExplorer__.runtimeVersion;
|
|
158
169
|
if (s !== '${prev.sessionId}' || v > ${prev.updateVersion}) {
|
|
159
170
|
${timeoutMs > 0 ? 'clearTimeout(timeout);' : ''}
|
|
160
|
-
resolve({ sessionId: s, updateVersion: v });
|
|
171
|
+
resolve({ sessionId: s, updateVersion: v, runtimeVersion: r });
|
|
161
172
|
} else {
|
|
162
173
|
setTimeout(check, 50);
|
|
163
174
|
}
|
|
@@ -165,6 +176,7 @@ class BrowserComponentExplorer {
|
|
|
165
176
|
check();
|
|
166
177
|
})
|
|
167
178
|
`);
|
|
179
|
+
this._assertRuntimeVersionCompatibility(newState.runtimeVersion);
|
|
168
180
|
const reloaded = newState.sessionId !== prev.sessionId;
|
|
169
181
|
if (reloaded) {
|
|
170
182
|
this._logger.debug(`Page reloaded: sessionId ${prev.sessionId} → ${newState.sessionId}`);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"componentExplorer.js","sources":["../src/componentExplorer.ts"],"sourcesContent":[null],"names":[],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AExG,QAAA,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,UAAU,CAAW;;MAE7C,SAAS,GAAG,CAAC,GAAG,CAAA,sFAAA,EAAyF,SAAS,CAAA,EAAA,CAAI,GAAG,EAAE;;;;;;;;;;AAU/G,gBAAA,EAAA,IAAI,CAAC,SAAS,CAAA,SAAA,EAAY,IAAI,CAAC,aAAa,CAAA;QACtD,SAAS,GAAG,CAAC,GAAG,wBAAwB,GAAG,EAAE;;;;;;;;AAQlD,EAAA,CAAA,CAAC;AACF,QAAA,IAAI,CAAC,kCAAkC,CAAC,QAAQ,CAAC,cAAc,CAAC;QAEhE,MAAM,QAAQ,GAAG,QAAQ,CAAC,SAAS,KAAK,IAAI,CAAC,SAAS;QACtD,IAAI,QAAQ,EAAE;AACb,YAAA,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA,yBAAA,EAA4B,IAAI,CAAC,SAAS,MAAM,QAAQ,CAAC,SAAS,CAAA,CAAE,CAAC;QACzF;aAAO;AACN,YAAA,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA,oBAAA,EAAuB,IAAI,CAAC,aAAa,MAAM,QAAQ,CAAC,aAAa,CAAA,CAAE,CAAC;QAC5F;AACA,QAAA,IAAI,CAAC,UAAU,GAAG,QAAQ;IAC3B;AAEA,IAAA,MAAM,OAAO,GAAA;AACZ,QAAA,MAAM,IAAI,CAAC,KAAK,EAAE,OAAO,EAAE;AAC3B,QAAA,IAAI,CAAC,KAAK,GAAG,SAAS;IACvB;AACA;;;;"}
|
|
@@ -5,6 +5,7 @@ import type { ResolvedWatchConfig } from '../watchConfig.js';
|
|
|
5
5
|
import { type ILogger } from '../logger.js';
|
|
6
6
|
import { type ApprovalStore } from './approvalStore.js';
|
|
7
7
|
import type { DaemonContext } from './DaemonContext.js';
|
|
8
|
+
export { daemonApiVersionText, pluginProtocolVersionText, parseVersion, isCompatibleVersion, } from './version.js';
|
|
8
9
|
export declare class ActivityTracker implements IDisposable {
|
|
9
10
|
private readonly _idleTimeoutMs;
|
|
10
11
|
private readonly _onIdle;
|
|
@@ -29,6 +30,8 @@ export type DaemonEvent = {
|
|
|
29
30
|
readonly type: 'ref-change';
|
|
30
31
|
readonly sessionName: string;
|
|
31
32
|
readonly newCommit: string;
|
|
33
|
+
} | {
|
|
34
|
+
readonly type: 'session-change';
|
|
32
35
|
} | {
|
|
33
36
|
readonly type: 'log';
|
|
34
37
|
readonly level: 'info' | 'debug' | 'trace';
|
|
@@ -44,11 +47,17 @@ export type SessionInfo = {
|
|
|
44
47
|
readonly isLoading?: false;
|
|
45
48
|
readonly serverUrl: string;
|
|
46
49
|
readonly sourceTreeId: string;
|
|
50
|
+
readonly worktreePath?: string;
|
|
51
|
+
readonly ref?: string;
|
|
47
52
|
};
|
|
48
53
|
export declare class SourceTreeChangedError extends Error {
|
|
49
54
|
constructor(sessionName: string);
|
|
50
55
|
}
|
|
51
56
|
export type DaemonApiType = DaemonService['api']['TMethods'];
|
|
57
|
+
export interface DaemonVersionInfo {
|
|
58
|
+
readonly daemonApiVersion: string;
|
|
59
|
+
readonly pluginProtocolVersion: string;
|
|
60
|
+
}
|
|
52
61
|
export declare class DaemonService {
|
|
53
62
|
private readonly _config;
|
|
54
63
|
private readonly _pipeName;
|
|
@@ -57,12 +66,14 @@ export declare class DaemonService {
|
|
|
57
66
|
private readonly _serverFactory;
|
|
58
67
|
private readonly _sessions;
|
|
59
68
|
private readonly _sessionConfigs;
|
|
69
|
+
private readonly _dynamicSessionMeta;
|
|
60
70
|
private readonly _resolvers;
|
|
61
71
|
private readonly _eventListenerCount;
|
|
62
72
|
private readonly _eventListeners;
|
|
63
73
|
private _shutdownRequested;
|
|
64
74
|
private _shutdownResolvers;
|
|
65
75
|
private readonly _activityTracker;
|
|
76
|
+
private readonly _worktreePool;
|
|
66
77
|
readonly approvals: ApprovalStore;
|
|
67
78
|
readonly api: import("@hediet/simple-api").ApiImplementation<import("@hediet/simple-api").MapMethods<{
|
|
68
79
|
fixtures: import("@hediet/simple-api").ApiImplementation<import("@hediet/simple-api").MapMethods<{
|
|
@@ -82,7 +93,10 @@ export declare class DaemonService {
|
|
|
82
93
|
hash: string;
|
|
83
94
|
sourceTreeId: string;
|
|
84
95
|
image: string | undefined;
|
|
85
|
-
|
|
96
|
+
hasError: boolean;
|
|
97
|
+
error: import("../componentExplorer.js").ExceptionError | undefined;
|
|
98
|
+
events: import("../componentExplorer.js").RenderEvent[] | undefined;
|
|
99
|
+
resultData: unknown;
|
|
86
100
|
isStable: boolean;
|
|
87
101
|
stabilityScreenshots: {
|
|
88
102
|
hash: string;
|
|
@@ -93,7 +107,10 @@ export declare class DaemonService {
|
|
|
93
107
|
hash: string;
|
|
94
108
|
sourceTreeId: string;
|
|
95
109
|
image: string | undefined;
|
|
96
|
-
|
|
110
|
+
hasError: boolean;
|
|
111
|
+
error: import("../componentExplorer.js").ExceptionError | undefined;
|
|
112
|
+
events: import("../componentExplorer.js").RenderEvent[] | undefined;
|
|
113
|
+
resultData: unknown;
|
|
97
114
|
isStable?: undefined;
|
|
98
115
|
stabilityScreenshots?: undefined;
|
|
99
116
|
}, DaemonContext>;
|
|
@@ -108,7 +125,10 @@ export declare class DaemonService {
|
|
|
108
125
|
fixtureId: string;
|
|
109
126
|
hash: string;
|
|
110
127
|
image: string | undefined;
|
|
111
|
-
|
|
128
|
+
hasError: boolean;
|
|
129
|
+
error: import("../componentExplorer.js").ExceptionError | undefined;
|
|
130
|
+
events: import("../componentExplorer.js").RenderEvent[] | undefined;
|
|
131
|
+
resultData: unknown;
|
|
112
132
|
}[];
|
|
113
133
|
}, DaemonContext>;
|
|
114
134
|
compare: import("@hediet/simple-api").IMethod<{
|
|
@@ -124,8 +144,14 @@ export declare class DaemonService {
|
|
|
124
144
|
currentHash: string;
|
|
125
145
|
baselineImage: string | undefined;
|
|
126
146
|
currentImage: string | undefined;
|
|
127
|
-
|
|
128
|
-
|
|
147
|
+
baselineHasError: boolean;
|
|
148
|
+
baselineError: import("../componentExplorer.js").ExceptionError | undefined;
|
|
149
|
+
baselineEvents: import("../componentExplorer.js").RenderEvent[] | undefined;
|
|
150
|
+
baselineResultData: unknown;
|
|
151
|
+
currentHasError: boolean;
|
|
152
|
+
currentError: import("../componentExplorer.js").ExceptionError | undefined;
|
|
153
|
+
currentEvents: import("../componentExplorer.js").RenderEvent[] | undefined;
|
|
154
|
+
currentResultData: unknown;
|
|
129
155
|
approval: import("./approvalStore.js").ApprovalInfo | undefined;
|
|
130
156
|
}, DaemonContext>;
|
|
131
157
|
}>, DaemonContext>;
|
|
@@ -160,6 +186,36 @@ export declare class DaemonService {
|
|
|
160
186
|
}, DaemonContext>;
|
|
161
187
|
events: import("@hediet/simple-api").IMethod<Record<string, never>, AsyncStream<DaemonEvent>, DaemonContext>;
|
|
162
188
|
sessions: import("@hediet/simple-api").IMethod<Record<string, never>, SessionInfo[], DaemonContext>;
|
|
189
|
+
version: import("@hediet/simple-api").IMethod<Record<string, never>, {
|
|
190
|
+
daemonApiVersion: string;
|
|
191
|
+
pluginProtocolVersion: string;
|
|
192
|
+
}, DaemonContext>;
|
|
193
|
+
restartSession: import("@hediet/simple-api").IMethod<{
|
|
194
|
+
sessionName: string;
|
|
195
|
+
}, SessionInfo[], DaemonContext>;
|
|
196
|
+
openSession: import("@hediet/simple-api").IMethod<{
|
|
197
|
+
name: string;
|
|
198
|
+
ref: string;
|
|
199
|
+
}, {
|
|
200
|
+
sessions: SessionInfo[];
|
|
201
|
+
} | {
|
|
202
|
+
error: string;
|
|
203
|
+
}, DaemonContext>;
|
|
204
|
+
closeSession: import("@hediet/simple-api").IMethod<{
|
|
205
|
+
name: string;
|
|
206
|
+
}, {
|
|
207
|
+
sessions: SessionInfo[];
|
|
208
|
+
} | {
|
|
209
|
+
error: string;
|
|
210
|
+
}, DaemonContext>;
|
|
211
|
+
updateSessionRef: import("@hediet/simple-api").IMethod<{
|
|
212
|
+
name: string;
|
|
213
|
+
ref: string;
|
|
214
|
+
}, {
|
|
215
|
+
sessions: SessionInfo[];
|
|
216
|
+
} | {
|
|
217
|
+
error: string;
|
|
218
|
+
}, DaemonContext>;
|
|
163
219
|
shutdown: import("@hediet/simple-api").IMethod<Record<string, never>, void, DaemonContext>;
|
|
164
220
|
}>, DaemonContext>;
|
|
165
221
|
private constructor();
|
|
@@ -178,10 +234,20 @@ export declare class DaemonService {
|
|
|
178
234
|
runEventLoop(): Promise<void>;
|
|
179
235
|
private _sourceChangeDisposables;
|
|
180
236
|
private _startSourceChangeWatchers;
|
|
237
|
+
private _addSourceChangeWatcher;
|
|
181
238
|
private _handleRefChange;
|
|
182
239
|
requestShutdown(): void;
|
|
183
240
|
dispose(): Promise<void>;
|
|
184
241
|
private _emit;
|
|
242
|
+
private _restartSession;
|
|
243
|
+
private _createExplorerSession;
|
|
244
|
+
private _createWorktreeExplorerSession;
|
|
185
245
|
private _setupSession;
|
|
246
|
+
private _setupWorktreeSession;
|
|
247
|
+
private _openDynamicSession;
|
|
248
|
+
private _closeDynamicSession;
|
|
249
|
+
private _updateDynamicSessionRef;
|
|
250
|
+
private readonly _dynamicRefWatchers;
|
|
251
|
+
private _addDynamicRefWatcher;
|
|
186
252
|
}
|
|
187
253
|
//# sourceMappingURL=DaemonService.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"DaemonService.d.ts","sourceRoot":"","sources":["../../src/daemon/DaemonService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"DaemonService.d.ts","sourceRoot":"","sources":["../../src/daemon/DaemonService.ts"],"names":[],"mappings":"AAEA,OAAO,EAAmD,KAAK,WAAW,EAAE,KAAK,OAAO,EAAE,MAAM,qBAAqB,CAAC;AAEtH,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AACxD,OAAO,KAAK,EAAyB,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AAKpF,OAAO,EAAE,KAAK,OAAO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