@vscode/component-explorer-cli 0.1.1-9 → 0.2.1-0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/SECURITY.md +14 -0
- 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/browserPage.d.ts +15 -1
- package/dist/browserPage.d.ts.map +1 -1
- package/dist/browserPage.js +51 -7
- package/dist/browserPage.js.map +1 -1
- 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 +12 -0
- package/dist/commands/checkStabilityCommand.d.ts.map +1 -0
- package/dist/commands/checkStabilityCommand.js +84 -0
- package/dist/commands/checkStabilityCommand.js.map +1 -0
- package/dist/commands/compareCommand.d.ts +1 -0
- package/dist/commands/compareCommand.d.ts.map +1 -1
- package/dist/commands/compareCommand.js +25 -4
- package/dist/commands/compareCommand.js.map +1 -1
- package/dist/commands/mcpCommand.d.ts +1 -0
- package/dist/commands/mcpCommand.d.ts.map +1 -1
- package/dist/commands/mcpCommand.js +23 -10
- package/dist/commands/mcpCommand.js.map +1 -1
- package/dist/commands/screenshotCommand.d.ts +2 -0
- package/dist/commands/screenshotCommand.d.ts.map +1 -1
- package/dist/commands/screenshotCommand.js +19 -4
- package/dist/commands/screenshotCommand.js.map +1 -1
- package/dist/commands/serveCommand.d.ts +4 -0
- package/dist/commands/serveCommand.d.ts.map +1 -1
- package/dist/commands/serveCommand.js +101 -26
- package/dist/commands/serveCommand.js.map +1 -1
- package/dist/commands/watchCommand.d.ts +2 -0
- package/dist/commands/watchCommand.d.ts.map +1 -1
- package/dist/commands/watchCommand.js +18 -66
- package/dist/commands/watchCommand.js.map +1 -1
- package/dist/comparison.d.ts +11 -1
- package/dist/comparison.d.ts.map +1 -1
- package/dist/comparison.js +25 -11
- package/dist/comparison.js.map +1 -1
- package/dist/component-explorer-config.schema.json +260 -55
- package/dist/componentExplorer.d.ts +21 -18
- package/dist/componentExplorer.d.ts.map +1 -1
- package/dist/componentExplorer.js +60 -19
- package/dist/componentExplorer.js.map +1 -1
- package/dist/daemon/DaemonService.d.ts +100 -11
- package/dist/daemon/DaemonService.d.ts.map +1 -1
- package/dist/daemon/DaemonService.js +512 -129
- 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/lifecycle.d.ts +2 -1
- package/dist/daemon/lifecycle.d.ts.map +1 -1
- package/dist/daemon/lifecycle.js +52 -30
- package/dist/daemon/lifecycle.js.map +1 -1
- package/dist/daemon/pipeClient.d.ts.map +1 -1
- package/dist/daemon/pipeClient.js +81 -2
- package/dist/daemon/pipeClient.js.map +1 -1
- package/dist/daemon/pipeServer.d.ts +2 -1
- package/dist/daemon/pipeServer.d.ts.map +1 -1
- package/dist/daemon/pipeServer.js +59 -2
- package/dist/daemon/pipeServer.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/explorerSession.d.ts +3 -3
- package/dist/explorerSession.d.ts.map +1 -1
- package/dist/explorerSession.js +26 -9
- package/dist/explorerSession.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 +18 -7
- package/dist/httpServer.d.ts.map +1 -1
- package/dist/httpServer.js +117 -18
- package/dist/httpServer.js.map +1 -1
- package/dist/httpServer.test.d.ts +2 -0
- package/dist/httpServer.test.d.ts.map +1 -0
- package/dist/index.js +11 -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 +18 -0
- package/dist/mcp/McpServer.d.ts.map +1 -1
- package/dist/mcp/McpServer.js +555 -13
- package/dist/mcp/McpServer.js.map +1 -1
- package/dist/mcp/TaskManager.d.ts +28 -0
- package/dist/mcp/TaskManager.d.ts.map +1 -0
- package/dist/mcp/TaskManager.js +54 -0
- package/dist/mcp/TaskManager.js.map +1 -0
- 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 +11 -3
- 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/visualCache.d.ts +34 -0
- package/dist/visualCache.d.ts.map +1 -0
- package/dist/visualCache.js +90 -0
- package/dist/visualCache.js.map +1 -0
- package/dist/watchConfig.d.ts +68 -15
- package/dist/watchConfig.d.ts.map +1 -1
- package/dist/watchConfig.js +109 -65
- package/dist/watchConfig.js.map +1 -1
- package/package.json +21 -4
- package/dist/packages/simple-api/dist/chunk-Q24JOMNK.js.map +0 -1
package/dist/watchConfig.d.ts
CHANGED
|
@@ -5,21 +5,58 @@ export declare const watchConfigSchema: z.ZodObject<{
|
|
|
5
5
|
screenshotDir: z.ZodOptional<z.ZodString>;
|
|
6
6
|
sessions: z.ZodArray<z.ZodObject<{
|
|
7
7
|
name: z.ZodString;
|
|
8
|
-
source: z.ZodOptional<z.
|
|
8
|
+
source: z.ZodOptional<z.ZodObject<{
|
|
9
9
|
worktree: z.ZodObject<{
|
|
10
10
|
ref: z.ZodString;
|
|
11
|
-
name: z.ZodOptional<z.ZodString>;
|
|
12
11
|
install: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"npm">, z.ZodLiteral<"pnpm">, z.ZodLiteral<"yarn">, z.ZodObject<{
|
|
13
12
|
command: z.ZodString;
|
|
14
13
|
}, z.core.$strip>, z.ZodLiteral<false>]>>;
|
|
15
14
|
}, z.core.$strip>;
|
|
16
|
-
}, z.core.$strip
|
|
15
|
+
}, z.core.$strip>>;
|
|
16
|
+
server: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
17
|
+
type: z.ZodLiteral<"vite">;
|
|
18
|
+
viteConfig: z.ZodOptional<z.ZodString>;
|
|
19
|
+
hmr: z.ZodOptional<z.ZodObject<{
|
|
20
|
+
allowedPaths: z.ZodArray<z.ZodString>;
|
|
21
|
+
}, z.core.$strip>>;
|
|
22
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
23
|
+
type: z.ZodLiteral<"http">;
|
|
24
|
+
url: z.ZodString;
|
|
25
|
+
cmd: z.ZodOptional<z.ZodString>;
|
|
26
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
27
|
+
wait: z.ZodOptional<z.ZodObject<{
|
|
28
|
+
stdout: z.ZodOptional<z.ZodString>;
|
|
29
|
+
stderr: z.ZodOptional<z.ZodString>;
|
|
30
|
+
}, z.core.$strip>>;
|
|
31
|
+
}, z.core.$strip>], "type">>;
|
|
17
32
|
viteConfig: z.ZodOptional<z.ZodString>;
|
|
18
33
|
}, z.core.$strip>>;
|
|
34
|
+
worktree: z.ZodOptional<z.ZodObject<{
|
|
35
|
+
setup: z.ZodOptional<z.ZodUnion<readonly [z.ZodLiteral<"auto">, z.ZodLiteral<"npm">, z.ZodLiteral<"pnpm">, z.ZodLiteral<"yarn">, z.ZodObject<{
|
|
36
|
+
command: z.ZodString;
|
|
37
|
+
}, z.core.$strip>, z.ZodLiteral<false>]>>;
|
|
38
|
+
maxSlots: z.ZodOptional<z.ZodNumber>;
|
|
39
|
+
}, z.core.$strip>>;
|
|
19
40
|
compare: z.ZodOptional<z.ZodObject<{
|
|
20
41
|
baseline: z.ZodString;
|
|
21
42
|
current: z.ZodString;
|
|
22
43
|
}, z.core.$strip>>;
|
|
44
|
+
server: z.ZodOptional<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
45
|
+
type: z.ZodLiteral<"vite">;
|
|
46
|
+
viteConfig: z.ZodOptional<z.ZodString>;
|
|
47
|
+
hmr: z.ZodOptional<z.ZodObject<{
|
|
48
|
+
allowedPaths: z.ZodArray<z.ZodString>;
|
|
49
|
+
}, z.core.$strip>>;
|
|
50
|
+
}, z.core.$strip>, z.ZodObject<{
|
|
51
|
+
type: z.ZodLiteral<"http">;
|
|
52
|
+
url: z.ZodString;
|
|
53
|
+
cmd: z.ZodOptional<z.ZodString>;
|
|
54
|
+
cwd: z.ZodOptional<z.ZodString>;
|
|
55
|
+
wait: z.ZodOptional<z.ZodObject<{
|
|
56
|
+
stdout: z.ZodOptional<z.ZodString>;
|
|
57
|
+
stderr: z.ZodOptional<z.ZodString>;
|
|
58
|
+
}, z.core.$strip>>;
|
|
59
|
+
}, z.core.$strip>], "type">>;
|
|
23
60
|
viteConfig: z.ZodOptional<z.ZodString>;
|
|
24
61
|
vite: z.ZodOptional<z.ZodObject<{
|
|
25
62
|
hmr: z.ZodOptional<z.ZodObject<{
|
|
@@ -31,7 +68,7 @@ export declare const watchConfigSchema: z.ZodObject<{
|
|
|
31
68
|
host: z.ZodOptional<z.ZodString>;
|
|
32
69
|
}, z.core.$strip>>;
|
|
33
70
|
}, z.core.$strip>;
|
|
34
|
-
export type
|
|
71
|
+
export type WorktreeSetupConfig = {
|
|
35
72
|
readonly kind: 'auto';
|
|
36
73
|
} | {
|
|
37
74
|
readonly kind: 'npm';
|
|
@@ -45,23 +82,38 @@ export type WorktreeInstallConfig = {
|
|
|
45
82
|
} | {
|
|
46
83
|
readonly kind: 'skip';
|
|
47
84
|
};
|
|
48
|
-
export declare class ResolvedWorktreeConfig {
|
|
49
|
-
readonly ref: string;
|
|
50
|
-
readonly worktreePath: string;
|
|
51
|
-
readonly install: WorktreeInstallConfig;
|
|
52
|
-
constructor(ref: string, worktreePath: string, install: WorktreeInstallConfig);
|
|
53
|
-
}
|
|
54
85
|
export type ResolvedSourceConfig = {
|
|
55
86
|
readonly kind: 'current';
|
|
56
87
|
} | {
|
|
57
88
|
readonly kind: 'worktree';
|
|
58
|
-
readonly
|
|
89
|
+
readonly ref: string;
|
|
90
|
+
readonly install: WorktreeSetupConfig | undefined;
|
|
91
|
+
};
|
|
92
|
+
export interface ResolvedHttpWaitConfig {
|
|
93
|
+
readonly stdout?: RegExp;
|
|
94
|
+
readonly stderr?: RegExp;
|
|
95
|
+
}
|
|
96
|
+
export type ResolvedServerConfig = {
|
|
97
|
+
readonly kind: 'vite';
|
|
98
|
+
readonly viteProject: ViteProjectRef;
|
|
99
|
+
readonly hmr: ResolvedViteHmrConfig | undefined;
|
|
100
|
+
} | {
|
|
101
|
+
readonly kind: 'http';
|
|
102
|
+
readonly url: string;
|
|
103
|
+
readonly cmd: string | undefined;
|
|
104
|
+
readonly cwd: string;
|
|
105
|
+
readonly wait: ResolvedHttpWaitConfig | undefined;
|
|
59
106
|
};
|
|
60
107
|
export declare class ResolvedSessionConfig {
|
|
61
108
|
readonly name: string;
|
|
62
109
|
readonly source: ResolvedSourceConfig;
|
|
63
|
-
readonly
|
|
64
|
-
constructor(name: string, source: ResolvedSourceConfig,
|
|
110
|
+
readonly server: ResolvedServerConfig;
|
|
111
|
+
constructor(name: string, source: ResolvedSourceConfig, server: ResolvedServerConfig);
|
|
112
|
+
}
|
|
113
|
+
export declare class ResolvedWorktreePoolConfig {
|
|
114
|
+
readonly setup: WorktreeSetupConfig;
|
|
115
|
+
readonly maxSlots: number;
|
|
116
|
+
constructor(setup: WorktreeSetupConfig, maxSlots: number);
|
|
65
117
|
}
|
|
66
118
|
export declare class ResolvedCompareConfig {
|
|
67
119
|
readonly baseline: string;
|
|
@@ -69,7 +121,6 @@ export declare class ResolvedCompareConfig {
|
|
|
69
121
|
constructor(baseline: string, current: string);
|
|
70
122
|
}
|
|
71
123
|
export interface ResolvedViteHmrConfig {
|
|
72
|
-
/** Glob patterns for files that keep HMR. Everything else triggers a full reload. */
|
|
73
124
|
readonly allowedPaths: readonly string[];
|
|
74
125
|
}
|
|
75
126
|
export interface ResolvedRedirectionConfig {
|
|
@@ -79,10 +130,12 @@ export interface ResolvedRedirectionConfig {
|
|
|
79
130
|
export declare class ResolvedWatchConfig {
|
|
80
131
|
readonly screenshotDir: string;
|
|
81
132
|
readonly sessions: readonly ResolvedSessionConfig[];
|
|
133
|
+
readonly worktreePool: ResolvedWorktreePoolConfig | undefined;
|
|
82
134
|
readonly compare: ResolvedCompareConfig | undefined;
|
|
83
135
|
readonly repo: IGitRepo;
|
|
84
|
-
readonly viteHmr: ResolvedViteHmrConfig | undefined;
|
|
85
136
|
readonly redirection: ResolvedRedirectionConfig | undefined;
|
|
137
|
+
readonly configDir: string;
|
|
138
|
+
readonly defaultServerConfig: ResolvedServerConfig;
|
|
86
139
|
private constructor();
|
|
87
140
|
static fromFile(configPath: string): Promise<ResolvedWatchConfig>;
|
|
88
141
|
static fromData(data: unknown, configDir: string, repo: IGitRepo): ResolvedWatchConfig;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watchConfig.d.ts","sourceRoot":"","sources":["../src/watchConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"watchConfig.d.ts","sourceRoot":"","sources":["../src/watchConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAGxB,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAEpD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AA2ErD,eAAO,MAAM,iBAAiB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAWiB,CAAC;AAIhD,MAAM,MAAM,mBAAmB,GAC5B;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,KAAK,CAAA;CAAE,GACxB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CAAE,GACzB;IAAE,QAAQ,CAAC,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,CAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GACrD;IAAE,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAA;CA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a,qBAAqB;IAEhC,QAAQ,CAAC,QAAQ,EAAE,MAAM;IACzB,QAAQ,CAAC,OAAO,EAAE,MAAM;gBADf,QAAQ,EAAE,MAAM,EAChB,OAAO,EAAE,MAAM;CAEzB;AAED,MAAM,WAAW,qBAAqB;IACrC,QAAQ,CAAC,YAAY,EAAE,SAAS,MAAM,EAAE,CAAC;CACzC;AAED,MAAM,WAAW,yBAAyB;IACzC,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;CACtB;AAED,qBAAa,mBAAmB;IAE9B,QAAQ,CAAC,aAAa,EAAE,MAAM;IAC9B,QAAQ,CAAC,QAAQ,EAAE,SAAS,qBAAqB,EAAE;IACnD,QAAQ,CAAC,YAAY,EAAE,0BAA0B,GAAG,SAAS;IAC7D,QAAQ,CAAC,OAAO,EAAE,qBAAqB,GAAG,SAAS;IACnD,QAAQ,CAAC,IAAI,EAAE,QAAQ;IACvB,QAAQ,CAAC,WAAW,EAAE,yBAAyB,GAAG,SAAS;IAC3D,QAAQ,CAAC,SAAS,EAAE,MAAM;IAC1B,QAAQ,CAAC,mBAAmB,EAAE,oBAAoB;IARnD,OAAO;WAWM,QAAQ,CAAC,UAAU,EAAE,MAAM,GAAG,OAAO,CAAC,mBAAmB,CAAC;IASvE,MAAM,CAAC,QAAQ,CAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,GAAG,mBAAmB;CAkDtF"}
|
package/dist/watchConfig.js
CHANGED
|
@@ -5,7 +5,7 @@ import { GitService } from './git/gitService.js';
|
|
|
5
5
|
import { ViteProjectRef } from './viteProjectRef.js';
|
|
6
6
|
|
|
7
7
|
// --- Zod schemas ---
|
|
8
|
-
const
|
|
8
|
+
const worktreeSetupSchema = z.union([
|
|
9
9
|
z.literal('auto'),
|
|
10
10
|
z.literal('npm'),
|
|
11
11
|
z.literal('pnpm'),
|
|
@@ -13,20 +13,17 @@ const worktreeInstallSchema = z.union([
|
|
|
13
13
|
z.object({ command: z.string().describe('Custom install command to run in the worktree') }),
|
|
14
14
|
z.literal(false),
|
|
15
15
|
]).describe('Dependency install strategy for the worktree');
|
|
16
|
-
const
|
|
17
|
-
ref: z.string().describe('Git ref (branch, tag, or
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
source: sessionSourceSchema.optional(),
|
|
28
|
-
viteConfig: z.string().optional().describe('Path to vite config file, relative to this config (overrides top-level viteConfig)'),
|
|
29
|
-
}).describe('A component explorer session');
|
|
16
|
+
const sessionSourceWorktreeSchema = z.object({
|
|
17
|
+
ref: z.string().describe('Git ref to check out (branch, tag, commit, or "INDEX" for the git staging area)'),
|
|
18
|
+
install: worktreeSetupSchema.optional().describe('Dependency install strategy override for this session'),
|
|
19
|
+
}).describe('Worktree source configuration');
|
|
20
|
+
const sessionSourceSchema = z.object({
|
|
21
|
+
worktree: sessionSourceWorktreeSchema,
|
|
22
|
+
}).describe('Session source configuration');
|
|
23
|
+
const worktreePoolConfigSchema = z.object({
|
|
24
|
+
setup: worktreeSetupSchema.optional().describe('Dependency install strategy for dynamic worktree sessions (default: auto)'),
|
|
25
|
+
maxSlots: z.number().int().min(1).max(3).optional().describe('Maximum number of simultaneous worktree sessions (default: 2, max: 3)'),
|
|
26
|
+
}).describe('Configuration for dynamic worktree sessions managed via MCP');
|
|
30
27
|
const compareConfigSchema = z.object({
|
|
31
28
|
baseline: z.string().describe('Session name to use as the baseline for comparisons'),
|
|
32
29
|
current: z.string().describe('Session name to use as the current version for comparisons'),
|
|
@@ -37,36 +34,64 @@ const viteHmrConfigSchema = z.object({
|
|
|
37
34
|
const viteConfigOverridesSchema = z.object({
|
|
38
35
|
hmr: viteHmrConfigSchema.optional(),
|
|
39
36
|
}).describe('Vite configuration overrides');
|
|
37
|
+
const serverConfigViteSchema = z.object({
|
|
38
|
+
type: z.literal('vite'),
|
|
39
|
+
viteConfig: z.string().optional().describe('Path to vite config file, relative to this config'),
|
|
40
|
+
hmr: viteHmrConfigSchema.optional(),
|
|
41
|
+
}).describe('Vite dev server configuration');
|
|
42
|
+
const serverConfigHttpSchema = z.object({
|
|
43
|
+
type: z.literal('http'),
|
|
44
|
+
url: z.string().describe('URL of the HTTP server. Use ${var:name} to reference named capture groups from wait patterns'),
|
|
45
|
+
cmd: z.string().optional().describe('Command to start the HTTP server (e.g. "npx rspack serve")'),
|
|
46
|
+
cwd: z.string().optional().describe('Working directory for cmd, relative to this config file (default: config file directory)'),
|
|
47
|
+
wait: z.object({
|
|
48
|
+
stdout: z.string().optional().describe('Regex pattern to wait for on stdout. Named capture groups become variables for the url field'),
|
|
49
|
+
stderr: z.string().optional().describe('Regex pattern to wait for on stderr. Named capture groups become variables for the url field'),
|
|
50
|
+
}).optional().describe('Wait for the server to be ready before connecting'),
|
|
51
|
+
}).describe('External HTTP server configuration');
|
|
52
|
+
const serverConfigSchema = z.discriminatedUnion('type', [
|
|
53
|
+
serverConfigViteSchema,
|
|
54
|
+
serverConfigHttpSchema,
|
|
55
|
+
]).describe('Server configuration');
|
|
56
|
+
const sessionConfigSchema = z.object({
|
|
57
|
+
name: z.string().describe('Unique session name'),
|
|
58
|
+
source: sessionSourceSchema.optional().describe('Source configuration (default: current working tree)'),
|
|
59
|
+
server: serverConfigSchema.optional().describe('Server configuration for this session (overrides top-level)'),
|
|
60
|
+
/** @deprecated Use `server.viteConfig` instead */
|
|
61
|
+
viteConfig: z.string().optional().describe('Path to vite config file, relative to this config (overrides top-level viteConfig)'),
|
|
62
|
+
}).describe('A component explorer session');
|
|
40
63
|
const redirectionConfigSchema = z.object({
|
|
41
64
|
port: z.number().int().min(1).max(65535).describe('Port for the redirection HTTP server'),
|
|
42
65
|
host: z.string().optional().describe('Host to bind the redirection server to (default: localhost)'),
|
|
43
66
|
}).describe('HTTP redirection server that redirects to the session URL');
|
|
44
67
|
const watchConfigSchema = z.object({
|
|
45
68
|
screenshotDir: z.string().optional().describe('Directory for storing screenshots (default: .screenshots)'),
|
|
46
|
-
sessions: z.array(sessionConfigSchema).min(1).describe('List of explorer sessions'),
|
|
69
|
+
sessions: z.array(sessionConfigSchema).min(1).describe('List of explorer sessions (currently only "current" working tree sessions)'),
|
|
70
|
+
worktree: worktreePoolConfigSchema.optional().describe('Dynamic worktree session pool configuration'),
|
|
47
71
|
compare: compareConfigSchema.optional(),
|
|
48
|
-
|
|
49
|
-
vite:
|
|
72
|
+
server: serverConfigSchema.optional().describe('Default server configuration'),
|
|
73
|
+
/** @deprecated Use `server: { type: "vite", viteConfig: "..." }` instead */
|
|
74
|
+
viteConfig: z.string().optional().describe('Default vite config file path, relative to this config (default: vite.config.ts)').meta({ deprecated: true }),
|
|
75
|
+
/** @deprecated Use `server: { type: "vite", hmr: { ... } }` instead */
|
|
76
|
+
vite: viteConfigOverridesSchema.optional().meta({ deprecated: true }),
|
|
50
77
|
redirection: redirectionConfigSchema.optional(),
|
|
51
78
|
}).describe('Component Explorer configuration');
|
|
52
|
-
class ResolvedWorktreeConfig {
|
|
53
|
-
ref;
|
|
54
|
-
worktreePath;
|
|
55
|
-
install;
|
|
56
|
-
constructor(ref, worktreePath, install) {
|
|
57
|
-
this.ref = ref;
|
|
58
|
-
this.worktreePath = worktreePath;
|
|
59
|
-
this.install = install;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
79
|
class ResolvedSessionConfig {
|
|
63
80
|
name;
|
|
64
81
|
source;
|
|
65
|
-
|
|
66
|
-
constructor(name, source,
|
|
82
|
+
server;
|
|
83
|
+
constructor(name, source, server) {
|
|
67
84
|
this.name = name;
|
|
68
85
|
this.source = source;
|
|
69
|
-
this.
|
|
86
|
+
this.server = server;
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
class ResolvedWorktreePoolConfig {
|
|
90
|
+
setup;
|
|
91
|
+
maxSlots;
|
|
92
|
+
constructor(setup, maxSlots) {
|
|
93
|
+
this.setup = setup;
|
|
94
|
+
this.maxSlots = maxSlots;
|
|
70
95
|
}
|
|
71
96
|
}
|
|
72
97
|
class ResolvedCompareConfig {
|
|
@@ -80,17 +105,21 @@ class ResolvedCompareConfig {
|
|
|
80
105
|
class ResolvedWatchConfig {
|
|
81
106
|
screenshotDir;
|
|
82
107
|
sessions;
|
|
108
|
+
worktreePool;
|
|
83
109
|
compare;
|
|
84
110
|
repo;
|
|
85
|
-
viteHmr;
|
|
86
111
|
redirection;
|
|
87
|
-
|
|
112
|
+
configDir;
|
|
113
|
+
defaultServerConfig;
|
|
114
|
+
constructor(screenshotDir, sessions, worktreePool, compare, repo, redirection, configDir, defaultServerConfig) {
|
|
88
115
|
this.screenshotDir = screenshotDir;
|
|
89
116
|
this.sessions = sessions;
|
|
117
|
+
this.worktreePool = worktreePool;
|
|
90
118
|
this.compare = compare;
|
|
91
119
|
this.repo = repo;
|
|
92
|
-
this.viteHmr = viteHmr;
|
|
93
120
|
this.redirection = redirection;
|
|
121
|
+
this.configDir = configDir;
|
|
122
|
+
this.defaultServerConfig = defaultServerConfig;
|
|
94
123
|
}
|
|
95
124
|
static async fromFile(configPath) {
|
|
96
125
|
const absConfigPath = path.resolve(configPath);
|
|
@@ -103,33 +132,20 @@ class ResolvedWatchConfig {
|
|
|
103
132
|
static fromData(data, configDir, repo) {
|
|
104
133
|
const parsed = watchConfigSchema.parse(data);
|
|
105
134
|
const screenshotDir = path.resolve(configDir, parsed.screenshotDir ?? '.screenshots');
|
|
106
|
-
|
|
107
|
-
const
|
|
108
|
-
// Config dir's position relative to the git root — needed to mirror
|
|
109
|
-
// the same path inside a worktree (which replicates the repo structure).
|
|
110
|
-
const configDirRelToGitRoot = path.relative(repo.gitRoot, configDir);
|
|
135
|
+
// Resolve top-level server config, normalizing legacy fields
|
|
136
|
+
const defaultServerConfig = resolveServerConfig(parsed.server, parsed.viteConfig, parsed.vite, configDir);
|
|
111
137
|
const sessions = parsed.sessions.map(session => {
|
|
112
|
-
const
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
const wt = sourceRaw.worktree;
|
|
122
|
-
const worktreeName = wt.name ?? 'component-explorer-baseline';
|
|
123
|
-
const worktreePath = path.resolve(wtRoot, worktreeName);
|
|
124
|
-
const install = resolveInstallConfig(wt.install);
|
|
125
|
-
const worktreeConfig = new ResolvedWorktreeConfig(wt.ref, worktreePath, install);
|
|
126
|
-
source = { kind: 'worktree', worktree: worktreeConfig };
|
|
127
|
-
// Mirror the config dir inside the worktree, then resolve viteConfig from there
|
|
128
|
-
const worktreeConfigDir = path.resolve(worktreePath, configDirRelToGitRoot);
|
|
129
|
-
viteProject = ViteProjectRef.fromViteConfigPath(path.resolve(worktreeConfigDir, viteConfigRel));
|
|
130
|
-
}
|
|
131
|
-
return new ResolvedSessionConfig(session.name, source, viteProject);
|
|
138
|
+
const source = session.source
|
|
139
|
+
? { kind: 'worktree', ref: session.source.worktree.ref, install: session.source.worktree.install ? resolveSetupConfig(session.source.worktree.install) : undefined }
|
|
140
|
+
: { kind: 'current' };
|
|
141
|
+
const server = session.server
|
|
142
|
+
? resolveServerConfig(session.server, undefined, undefined, configDir)
|
|
143
|
+
: session.viteConfig
|
|
144
|
+
? resolveServerConfig(undefined, session.viteConfig, undefined, configDir)
|
|
145
|
+
: defaultServerConfig;
|
|
146
|
+
return new ResolvedSessionConfig(session.name, source, server);
|
|
132
147
|
});
|
|
148
|
+
const needsWorktreePool = sessions.some(s => s.source.kind === 'worktree');
|
|
133
149
|
const sessionNames = new Set(sessions.map(s => s.name));
|
|
134
150
|
let compare;
|
|
135
151
|
if (parsed.compare) {
|
|
@@ -141,16 +157,18 @@ class ResolvedWatchConfig {
|
|
|
141
157
|
}
|
|
142
158
|
compare = new ResolvedCompareConfig(parsed.compare.baseline, parsed.compare.current);
|
|
143
159
|
}
|
|
144
|
-
const
|
|
145
|
-
?
|
|
146
|
-
:
|
|
160
|
+
const worktreePool = parsed.worktree
|
|
161
|
+
? new ResolvedWorktreePoolConfig(resolveSetupConfig(parsed.worktree.setup), parsed.worktree.maxSlots ?? 2)
|
|
162
|
+
: needsWorktreePool
|
|
163
|
+
? new ResolvedWorktreePoolConfig({ kind: 'auto' }, 2)
|
|
164
|
+
: undefined;
|
|
147
165
|
const redirection = parsed.redirection
|
|
148
166
|
? { port: parsed.redirection.port, host: parsed.redirection.host ?? 'localhost' }
|
|
149
167
|
: undefined;
|
|
150
|
-
return new ResolvedWatchConfig(screenshotDir, sessions, compare, repo,
|
|
168
|
+
return new ResolvedWatchConfig(screenshotDir, sessions, worktreePool, compare, repo, redirection, configDir, defaultServerConfig);
|
|
151
169
|
}
|
|
152
170
|
}
|
|
153
|
-
function
|
|
171
|
+
function resolveSetupConfig(raw) {
|
|
154
172
|
if (raw === undefined || raw === 'auto') {
|
|
155
173
|
return { kind: 'auto' };
|
|
156
174
|
}
|
|
@@ -168,6 +186,32 @@ function resolveInstallConfig(raw) {
|
|
|
168
186
|
}
|
|
169
187
|
return { kind: 'custom', command: raw.command };
|
|
170
188
|
}
|
|
189
|
+
function resolveServerConfig(server, legacyViteConfig, legacyVite, configDir) {
|
|
190
|
+
if (server) {
|
|
191
|
+
if (legacyViteConfig || legacyVite) {
|
|
192
|
+
throw new Error('Cannot specify both "server" and legacy "viteConfig"/"vite" fields. Use "server" only.');
|
|
193
|
+
}
|
|
194
|
+
if (server.type === 'http') {
|
|
195
|
+
const wait = server.wait?.stdout || server.wait?.stderr
|
|
196
|
+
? {
|
|
197
|
+
stdout: server.wait.stdout ? new RegExp(server.wait.stdout) : undefined,
|
|
198
|
+
stderr: server.wait.stderr ? new RegExp(server.wait.stderr) : undefined,
|
|
199
|
+
}
|
|
200
|
+
: undefined;
|
|
201
|
+
const cwd = server.cwd ? path.resolve(configDir, server.cwd) : configDir;
|
|
202
|
+
return { kind: 'http', url: server.url, cmd: server.cmd, cwd, wait };
|
|
203
|
+
}
|
|
204
|
+
const viteConfigRel = server.viteConfig ?? 'vite.config.ts';
|
|
205
|
+
const viteProject = ViteProjectRef.fromViteConfigPath(path.resolve(configDir, viteConfigRel));
|
|
206
|
+
const hmr = server.hmr ? { allowedPaths: server.hmr.allowedPaths } : undefined;
|
|
207
|
+
return { kind: 'vite', viteProject, hmr };
|
|
208
|
+
}
|
|
209
|
+
// Legacy normalization
|
|
210
|
+
const viteConfigRel = legacyViteConfig ?? 'vite.config.ts';
|
|
211
|
+
const viteProject = ViteProjectRef.fromViteConfigPath(path.resolve(configDir, viteConfigRel));
|
|
212
|
+
const hmr = legacyVite?.hmr ? { allowedPaths: legacyVite.hmr.allowedPaths } : undefined;
|
|
213
|
+
return { kind: 'vite', viteProject, hmr };
|
|
214
|
+
}
|
|
171
215
|
|
|
172
|
-
export { ResolvedCompareConfig, ResolvedSessionConfig, ResolvedWatchConfig,
|
|
216
|
+
export { ResolvedCompareConfig, ResolvedSessionConfig, ResolvedWatchConfig, ResolvedWorktreePoolConfig, watchConfigSchema };
|
|
173
217
|
//# sourceMappingURL=watchConfig.js.map
|
package/dist/watchConfig.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watchConfig.js","sources":["../src/watchConfig.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAOA;AAEA,MAAM,
|
|
1
|
+
{"version":3,"file":"watchConfig.js","sources":["../src/watchConfig.ts"],"sourcesContent":[null],"names":[],"mappings":";;;;;;AAOA;AAEA,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC;AACnC,IAAA,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;AACjB,IAAA,CAAC,CAAC,OAAO,CAAC,KAAK,CAAC;AAChB,IAAA,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;AACjB,IAAA,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC;AACjB,IAAA,CAAC,CAAC,MAAM,CAAC,EAA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"type": "module",
|
|
5
|
+
"repository": {
|
|
6
|
+
"type": "git",
|
|
7
|
+
"url": "git+https://github.com/microsoft/vscode-packages.git",
|
|
8
|
+
"directory": "js-component-explorer/packages/cli"
|
|
9
|
+
},
|
|
10
|
+
"homepage": "https://github.com/microsoft/vscode-packages/tree/main/js-component-explorer/packages/cli",
|
|
11
|
+
"bugs": {
|
|
12
|
+
"url": "https://github.com/microsoft/vscode-packages/issues"
|
|
13
|
+
},
|
|
14
|
+
"license": "MIT",
|
|
5
15
|
"bin": {
|
|
6
16
|
"component-explorer": "./dist/index.js"
|
|
7
17
|
},
|
|
@@ -16,10 +26,17 @@
|
|
|
16
26
|
"import": "./dist/daemon/DaemonService.js",
|
|
17
27
|
"types": "./dist/daemon/DaemonService.d.ts"
|
|
18
28
|
},
|
|
29
|
+
"./explorer-types": {
|
|
30
|
+
"import": "./dist/utils.js",
|
|
31
|
+
"types": "./dist/utils.d.ts"
|
|
32
|
+
},
|
|
19
33
|
"./config-schema.json": "./dist/component-explorer-config.schema.json"
|
|
20
34
|
},
|
|
21
35
|
"files": [
|
|
22
|
-
"dist"
|
|
36
|
+
"dist",
|
|
37
|
+
"README.md",
|
|
38
|
+
"LICENSE",
|
|
39
|
+
"SECURITY.md"
|
|
23
40
|
],
|
|
24
41
|
"scripts": {
|
|
25
42
|
"build": "rollup -c && node --experimental-strip-types scripts/generate-json-schema.ts",
|
|
@@ -28,6 +45,7 @@
|
|
|
28
45
|
"generate-schema": "node --experimental-strip-types scripts/generate-json-schema.ts"
|
|
29
46
|
},
|
|
30
47
|
"dependencies": {
|
|
48
|
+
"@hediet/semver": "^0.2.2",
|
|
31
49
|
"@modelcontextprotocol/sdk": "^1.26.0",
|
|
32
50
|
"clipanion": "^4.0.0-rc.4",
|
|
33
51
|
"express": "^5.0.0",
|
|
@@ -44,13 +62,12 @@
|
|
|
44
62
|
"@types/express": "^5.0.0",
|
|
45
63
|
"@types/node": "^20.0.0",
|
|
46
64
|
"@vitejs/plugin-react": "^4.3.0",
|
|
47
|
-
"@vscode/component-explorer": "workspace:*",
|
|
48
65
|
"@vscode/component-explorer-vite-plugin": "workspace:*",
|
|
49
66
|
"@vscode/observables": "workspace:*",
|
|
50
67
|
"playwright": "^1.40.0",
|
|
51
68
|
"react": "^18.3.0",
|
|
52
69
|
"react-dom": "^18.3.0",
|
|
53
|
-
"rollup": "^4.
|
|
70
|
+
"rollup": "^4.59.0",
|
|
54
71
|
"typescript": "^5.4.0",
|
|
55
72
|
"vite": "^6.0.0",
|
|
56
73
|
"vitest": "^1.3.0"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"chunk-Q24JOMNK.js","sources":["../../../../../simple-api/dist/chunk-Q24JOMNK.mjs"],"sourcesContent":["import {\n AsyncStream\n} from \"./chunk-SGBCNXYH.mjs\";\n\n// src/client.ts\nvar ApiError = class extends Error {\n constructor(statusCode, method, message) {\n super(message);\n this.statusCode = statusCode;\n this.method = method;\n this.name = \"ApiError\";\n }\n};\nvar ProxyApiClient = class {\n constructor(_request) {\n this._request = _request;\n }\n _createProxy(prefix) {\n return new Proxy(() => {\n }, {\n apply: async (_target, _self, args) => {\n const result = await this._request(prefix, args[0]);\n return result;\n },\n get: (_target, prop) => {\n if (typeof prop === \"symbol\") {\n return void 0;\n }\n if (prop === \"then\" || prop === \"catch\" || prop === \"finally\" || prop === \"toString\" || prop === \"valueOf\" || prop === \"toJSON\" || prop === \"name\" || prop === \"length\" || prop === \"prototype\" || prop === \"constructor\" || prop === \"caller\" || prop === \"arguments\") {\n return void 0;\n }\n return this._createProxy(`${prefix}${prefix ? \"/\" : \"\"}${prop}`);\n }\n });\n }\n methods = this._createProxy(\"\");\n};\nfunction createFetchClient(baseUrl, options) {\n return new ProxyApiClient(async (method, arg) => {\n const result = await fetch(`${baseUrl}/${method}`, {\n method: \"POST\",\n headers: {\n \"Content-Type\": \"application/json\",\n ...options?.getHeaders?.()\n },\n body: JSON.stringify(arg)\n });\n if (result.status !== 200) {\n const data2 = await result.json().catch(() => null);\n let message;\n if (data2 && typeof data2 === \"object\" && \"errorMessage\" in data2) {\n message = `${data2.errorMessage}`;\n } else {\n message = `Error calling API method ${method}: ${JSON.stringify(data2)} (Status: ${result.status}, Status Text: ${result.statusText})`;\n }\n const error = new ApiError(result.status, method, message);\n options?.onError?.(error);\n throw error;\n }\n const contentType = result.headers.get(\"Content-Type\");\n if (contentType?.startsWith(\"application/jsonl\")) {\n return AsyncStream.fromFn(async function* () {\n const reader = result.body?.getReader();\n if (!reader) {\n return;\n }\n let buffer = \"\";\n const decoder = new TextDecoder(\"utf-8\");\n while (true) {\n const { done, value } = await reader.read();\n if (done) {\n break;\n }\n buffer += decoder.decode(value, { stream: true });\n let eolIndex;\n while ((eolIndex = buffer.indexOf(\"\\n\")) >= 0) {\n const line = buffer.slice(0, eolIndex).trim();\n buffer = buffer.slice(eolIndex + 1);\n if (line.length > 0) {\n yield JSON.parse(line);\n }\n }\n }\n const finalLine = buffer.trim();\n if (finalLine.length > 0) {\n yield JSON.parse(finalLine);\n }\n });\n }\n const data = await result.json();\n return data;\n });\n}\nfunction createLocalClient(api, context) {\n return new ProxyApiClient(async (method, args) => {\n return await api.run(method, args, context);\n });\n}\n\nexport {\n ApiError,\n ProxyApiClient,\n createFetchClient,\n createLocalClient\n};\n//# sourceMappingURL=chunk-Q24JOMNK.mjs.map"],"names":[],"mappings":"AAaG,IAAC,cAAc,GAAG,MAAM;AAC3B,EAAE,WAAW,CAAC,QAAQ,EAAE;AACxB,IAAI,IAAI,CAAC,QAAQ,GAAG,QAAQ;AAC5B,EAAE;AACF,EAAE,YAAY,CAAC,MAAM,EAAE;AACvB,IAAI,OAAO,IAAI,KAAK,CAAC,MAAM;AAC3B,IAAI,CAAC,EAAE;AACP,MAAM,KAAK,EAAE,OAAO,OAAO,EAAE,KAAK,EAAE,IAAI,KAAK;AAC7C,QAAQ,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI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