@vscode/component-explorer-vite-plugin 0.1.1-1 → 0.1.1-11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +55 -0
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/plugin.d.ts +18 -2
- package/dist/plugin.d.ts.map +1 -1
- package/dist/plugin.js +179 -15
- package/dist/plugin.js.map +1 -1
- package/package.json +11 -4
package/README.md
ADDED
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
# @vscode/component-explorer-vite-plugin
|
|
2
|
+
|
|
3
|
+
Vite plugin for the [Component Explorer](../../README.md). Discovers fixture files, generates virtual entry modules, and serves the explorer UI during development.
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```ts
|
|
8
|
+
// vite.config.ts
|
|
9
|
+
import { defineConfig } from 'vite';
|
|
10
|
+
import { componentExplorer } from '@vscode/component-explorer-vite-plugin';
|
|
11
|
+
|
|
12
|
+
export default defineConfig({
|
|
13
|
+
plugins: [
|
|
14
|
+
componentExplorer({
|
|
15
|
+
// options (all optional)
|
|
16
|
+
}),
|
|
17
|
+
],
|
|
18
|
+
});
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
## Options
|
|
22
|
+
|
|
23
|
+
| Option | Type | Default | Description |
|
|
24
|
+
|---|---|---|---|
|
|
25
|
+
| `include` | `string` | `'./src/**/*.fixture.{ts,tsx}'` | Glob pattern for discovering fixture files. |
|
|
26
|
+
| `route` | `string` | `'/___explorer'` | URL path where the explorer UI is served during development. |
|
|
27
|
+
| `build` | `BuildMode` | `'app-only'` | Controls what gets included in `vite build` output. See [Build Modes](#build-modes). |
|
|
28
|
+
| `outFile` | `string` | `'___explorer.html'` | Output filename for the explorer HTML in production builds. Defaults to `'index.html'` when `build` is `'explorer-only'`. |
|
|
29
|
+
| `logLevel` | `LogLevel` | `'info'` | Logging verbosity: `'silent'`, `'info'`, or `'verbose'`. |
|
|
30
|
+
|
|
31
|
+
### Build Modes
|
|
32
|
+
|
|
33
|
+
The `build` option controls what gets emitted during `vite build` (has no effect on `vite dev`):
|
|
34
|
+
|
|
35
|
+
| Mode | Description |
|
|
36
|
+
|---|---|
|
|
37
|
+
| `'app-only'` | Build the app without the explorer. Suitable for production deployments. |
|
|
38
|
+
| `'all'` | Build both the app and the explorer. Useful for CI/staging environments. |
|
|
39
|
+
| `'explorer-only'` | Build only the explorer, emitting `index.html`. For static hosting of the explorer. |
|
|
40
|
+
|
|
41
|
+
```ts
|
|
42
|
+
componentExplorer({
|
|
43
|
+
build: 'all', // include explorer in production build
|
|
44
|
+
})
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
To set the build mode via an environment variable:
|
|
48
|
+
|
|
49
|
+
```ts
|
|
50
|
+
import { type BuildMode } from '@vscode/component-explorer-vite-plugin';
|
|
51
|
+
|
|
52
|
+
componentExplorer({
|
|
53
|
+
build: (process.env.EXPLORER_BUILD as BuildMode) ?? undefined,
|
|
54
|
+
})
|
|
55
|
+
```
|
package/dist/index.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { componentExplorer, type ComponentExplorerOptions } from './plugin.js';
|
|
1
|
+
export { componentExplorer, type ComponentExplorerOptions, type BuildMode } from './plugin.js';
|
|
2
2
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,wBAAwB,EAAE,MAAM,aAAa,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,KAAK,wBAAwB,EAAE,KAAK,SAAS,EAAE,MAAM,aAAa,CAAC"}
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiD,MAAM,aAAa,CAAC"}
|
package/dist/plugin.d.ts
CHANGED
|
@@ -1,12 +1,28 @@
|
|
|
1
1
|
import type { Plugin } from 'vite';
|
|
2
|
-
|
|
2
|
+
declare global {
|
|
3
|
+
interface Window {
|
|
4
|
+
__EXPLORER_DAEMON__?: {
|
|
5
|
+
sessionName: string;
|
|
6
|
+
};
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export type LogLevel = 'silent' | 'info' | 'verbose' | 'warn' | 'error';
|
|
10
|
+
/** Controls what the plugin includes during `vite build`. Has no effect on dev serve. */
|
|
11
|
+
export type BuildMode = 'app-only' | 'all' | 'explorer-only';
|
|
3
12
|
export interface ComponentExplorerOptions {
|
|
4
13
|
/** Glob pattern for fixture files. Default: './src/**\/*.fixture.{ts,tsx}' */
|
|
5
14
|
include?: string;
|
|
6
15
|
/** Explorer route path. Default: '/___explorer' */
|
|
7
16
|
route?: string;
|
|
8
|
-
/** Output filename for the explorer HTML. Default: '___explorer.html' */
|
|
17
|
+
/** Output filename for the explorer HTML. Default: '___explorer.html' (or 'index.html' in explorer-only mode) */
|
|
9
18
|
outFile?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Controls what gets built during `vite build`. Has no effect on dev serve.
|
|
21
|
+
* - `'app-only'` (default): build the app without the explorer
|
|
22
|
+
* - `'all'`: build the app + explorer
|
|
23
|
+
* - `'explorer-only'`: build only the explorer (emits index.html for static hosting)
|
|
24
|
+
*/
|
|
25
|
+
build?: BuildMode;
|
|
10
26
|
/** Log level. Default: 'info' */
|
|
11
27
|
logLevel?: LogLevel;
|
|
12
28
|
}
|
package/dist/plugin.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,MAAM,CAAC;
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,MAAM,CAAC;AAkBnD,OAAO,CAAC,MAAM,CAAC;IACd,UAAU,MAAM;QACf,mBAAmB,CAAC,EAAE;YAAE,WAAW,EAAE,MAAM,CAAA;SAAE,CAAC;KAC9C;CACD;AAED,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,OAAO,CAAC;AAExE,0FAA0F;AAC1F,MAAM,MAAM,SAAS,GACjB,UAAU,GACV,KAAK,GACL,eAAe,CAAC;AAapB,MAAM,WAAW,wBAAwB;IACvC,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,iHAAiH;IACjH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,KAAK,CAAC,EAAE,SAAS,CAAC;IAClB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,wBAA6B,GAAG,MAAM,CAoRhF"}
|
package/dist/plugin.js
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
+
import http from 'node:http';
|
|
1
2
|
import { glob } from 'tinyglobby';
|
|
2
3
|
import path from 'node:path';
|
|
3
4
|
const VIRTUAL_ENTRY_ID = 'virtual:component-explorer/entry';
|
|
4
5
|
const VIRTUAL_FIXTURES_ID = 'virtual:component-explorer/fixtures';
|
|
5
6
|
const RESOLVED_VIRTUAL_ENTRY_ID = '\0' + VIRTUAL_ENTRY_ID;
|
|
6
7
|
const RESOLVED_VIRTUAL_FIXTURES_ID = '\0' + VIRTUAL_FIXTURES_ID;
|
|
8
|
+
const DAEMON_API_PREFIX = '/__explorer/daemon-api';
|
|
7
9
|
/** Normalize a glob pattern for use with import.meta.glob (must start with '/') */
|
|
8
10
|
function normalizeGlobForImportMeta(fixtureGlob) {
|
|
9
11
|
if (fixtureGlob.startsWith('./')) {
|
|
@@ -17,11 +19,13 @@ function normalizeGlobForImportMeta(fixtureGlob) {
|
|
|
17
19
|
}
|
|
18
20
|
}
|
|
19
21
|
export function componentExplorer(options = {}) {
|
|
20
|
-
const
|
|
22
|
+
const rawInclude = options.include ?? './src/**/*.fixture.{ts,tsx}';
|
|
21
23
|
const explorerRoute = options.route ?? '/___explorer';
|
|
22
|
-
const
|
|
24
|
+
const buildMode = options.build ?? 'app-only';
|
|
25
|
+
const outFile = options.outFile ?? (buildMode === 'explorer-only' ? 'index.html' : '___explorer.html');
|
|
23
26
|
const logLevel = options.logLevel ?? 'info';
|
|
24
27
|
let config;
|
|
28
|
+
let fixtureGlob;
|
|
25
29
|
const log = (level, message) => {
|
|
26
30
|
const levels = ['silent', 'info', 'verbose'];
|
|
27
31
|
if (levels.indexOf(level) <= levels.indexOf(logLevel)) {
|
|
@@ -32,6 +36,14 @@ export function componentExplorer(options = {}) {
|
|
|
32
36
|
name: 'component-explorer',
|
|
33
37
|
async configResolved(resolvedConfig) {
|
|
34
38
|
config = resolvedConfig;
|
|
39
|
+
// If the include glob is absolute, make it relative to root so both
|
|
40
|
+
// tinyglobby and import.meta.glob resolve consistently.
|
|
41
|
+
if (path.isAbsolute(rawInclude)) {
|
|
42
|
+
fixtureGlob = './' + path.relative(config.root, rawInclude).split(path.sep).join('/');
|
|
43
|
+
}
|
|
44
|
+
else {
|
|
45
|
+
fixtureGlob = rawInclude;
|
|
46
|
+
}
|
|
35
47
|
if (logLevel === 'verbose') {
|
|
36
48
|
const rootDir = config.root;
|
|
37
49
|
const normalizedGlob = fixtureGlob.startsWith('./') ? fixtureGlob.slice(2) : fixtureGlob;
|
|
@@ -52,7 +64,25 @@ export function componentExplorer(options = {}) {
|
|
|
52
64
|
}
|
|
53
65
|
},
|
|
54
66
|
config(userConfig) {
|
|
55
|
-
|
|
67
|
+
if (buildMode === 'app-only') {
|
|
68
|
+
return;
|
|
69
|
+
}
|
|
70
|
+
if (buildMode === 'explorer-only') {
|
|
71
|
+
// Mutate directly — returning `input` would deep-merge with the
|
|
72
|
+
// user's existing entries (e.g. MPA pages), but we want only the
|
|
73
|
+
// explorer entry.
|
|
74
|
+
userConfig.build ??= {};
|
|
75
|
+
userConfig.build.rollupOptions ??= {};
|
|
76
|
+
userConfig.build.rollupOptions.input = { '___explorer': VIRTUAL_ENTRY_ID };
|
|
77
|
+
// Clear lib mode so the explorer gets a proper HTML build
|
|
78
|
+
delete userConfig.build.lib;
|
|
79
|
+
return {
|
|
80
|
+
define: {
|
|
81
|
+
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
82
|
+
},
|
|
83
|
+
};
|
|
84
|
+
}
|
|
85
|
+
// buildMode === 'all': add explorer entry alongside app inputs
|
|
56
86
|
const currentInput = userConfig.build?.rollupOptions?.input;
|
|
57
87
|
let input;
|
|
58
88
|
if (!currentInput) {
|
|
@@ -68,21 +98,52 @@ export function componentExplorer(options = {}) {
|
|
|
68
98
|
else {
|
|
69
99
|
input = { ...currentInput, '___explorer': VIRTUAL_ENTRY_ID };
|
|
70
100
|
}
|
|
101
|
+
// When lib mode is used, lib.fileName controls entryFileNames for ALL
|
|
102
|
+
// entries, causing the explorer chunk to get the same filename as the
|
|
103
|
+
// app entry (e.g. both become "index.js"). Override entryFileNames to
|
|
104
|
+
// give the explorer entry a distinct name while preserving the lib
|
|
105
|
+
// naming for the app entry.
|
|
106
|
+
const lib = userConfig.build?.lib;
|
|
107
|
+
const libFileName = lib && typeof lib === 'object' && !Array.isArray(lib)
|
|
108
|
+
? lib.fileName
|
|
109
|
+
: undefined;
|
|
110
|
+
const outputOverrides = {};
|
|
111
|
+
if (typeof libFileName === 'string') {
|
|
112
|
+
outputOverrides.entryFileNames = (chunkInfo) => {
|
|
113
|
+
if (chunkInfo.name === '___explorer') {
|
|
114
|
+
return '___explorer-[hash].js';
|
|
115
|
+
}
|
|
116
|
+
return `${libFileName}.js`;
|
|
117
|
+
};
|
|
118
|
+
}
|
|
71
119
|
return {
|
|
120
|
+
define: {
|
|
121
|
+
'process.env.NODE_ENV': JSON.stringify('production'),
|
|
122
|
+
},
|
|
72
123
|
build: {
|
|
73
124
|
rollupOptions: {
|
|
74
125
|
input,
|
|
126
|
+
output: outputOverrides,
|
|
75
127
|
},
|
|
76
128
|
},
|
|
77
129
|
};
|
|
78
130
|
},
|
|
79
|
-
resolveId(id) {
|
|
131
|
+
async resolveId(id, importer) {
|
|
80
132
|
if (id === VIRTUAL_ENTRY_ID) {
|
|
81
133
|
return RESOLVED_VIRTUAL_ENTRY_ID;
|
|
82
134
|
}
|
|
83
135
|
if (id === VIRTUAL_FIXTURES_ID) {
|
|
84
136
|
return RESOLVED_VIRTUAL_FIXTURES_ID;
|
|
85
137
|
}
|
|
138
|
+
if (importer === RESOLVED_VIRTUAL_ENTRY_ID && id.startsWith('@vscode/component-explorer')) {
|
|
139
|
+
const fakeImporter = config.configFile; // file must exist for vite resolution to work
|
|
140
|
+
const result = await this.resolve(id, fakeImporter, { skipSelf: true });
|
|
141
|
+
if (result) {
|
|
142
|
+
log('verbose', `Resolving ${id}: Resolved to ${result.id}`);
|
|
143
|
+
return result;
|
|
144
|
+
}
|
|
145
|
+
log('verbose', `Resolving ${id}: Failed to resolve from ${fakeImporter}`);
|
|
146
|
+
}
|
|
86
147
|
},
|
|
87
148
|
load(id) {
|
|
88
149
|
if (id === RESOLVED_VIRTUAL_ENTRY_ID) {
|
|
@@ -93,13 +154,35 @@ export function componentExplorer(options = {}) {
|
|
|
93
154
|
}
|
|
94
155
|
},
|
|
95
156
|
generateBundle(_, bundle) {
|
|
157
|
+
if (buildMode === 'app-only') {
|
|
158
|
+
return;
|
|
159
|
+
}
|
|
96
160
|
// Find the explorer entry chunk
|
|
97
161
|
const explorerChunk = Object.values(bundle).find((chunk) => chunk.type === 'chunk' && chunk.name === '___explorer' && chunk.isEntry);
|
|
98
162
|
if (explorerChunk && explorerChunk.type === 'chunk') {
|
|
99
163
|
const base = config.base ?? '/';
|
|
100
164
|
const scriptPath = `${base}${explorerChunk.fileName}`;
|
|
101
|
-
// Collect CSS
|
|
102
|
-
|
|
165
|
+
// Collect CSS from the explorer chunk and all transitively imported chunks.
|
|
166
|
+
// viteMetadata.importedCss on the entry chunk alone may miss CSS from shared chunks.
|
|
167
|
+
const cssFiles = new Set();
|
|
168
|
+
const visited = new Set();
|
|
169
|
+
const collectCss = (chunkFileName) => {
|
|
170
|
+
if (visited.has(chunkFileName)) {
|
|
171
|
+
return;
|
|
172
|
+
}
|
|
173
|
+
visited.add(chunkFileName);
|
|
174
|
+
const chunk = bundle[chunkFileName];
|
|
175
|
+
if (!chunk || chunk.type !== 'chunk') {
|
|
176
|
+
return;
|
|
177
|
+
}
|
|
178
|
+
for (const css of chunk.viteMetadata?.importedCss ?? []) {
|
|
179
|
+
cssFiles.add(css);
|
|
180
|
+
}
|
|
181
|
+
for (const imported of chunk.imports ?? []) {
|
|
182
|
+
collectCss(imported);
|
|
183
|
+
}
|
|
184
|
+
};
|
|
185
|
+
collectCss(explorerChunk.fileName);
|
|
103
186
|
const cssLinks = Array.from(cssFiles)
|
|
104
187
|
.map((file) => ` <link rel="stylesheet" href="${base}${file}">`)
|
|
105
188
|
.join('\n');
|
|
@@ -112,6 +195,18 @@ export function componentExplorer(options = {}) {
|
|
|
112
195
|
},
|
|
113
196
|
configureServer(viteServer) {
|
|
114
197
|
log('info', `Explorer available at: ${explorerRoute}`);
|
|
198
|
+
// Parse daemon config from env var (set by daemon process)
|
|
199
|
+
const daemonEnv = process.env.COMPONENT_EXPLORER_DAEMON_CONFIG;
|
|
200
|
+
let daemonConfig;
|
|
201
|
+
if (daemonEnv) {
|
|
202
|
+
try {
|
|
203
|
+
daemonConfig = JSON.parse(daemonEnv);
|
|
204
|
+
log('info', `Daemon mode enabled (session: ${daemonConfig.sessionName})`);
|
|
205
|
+
}
|
|
206
|
+
catch (e) {
|
|
207
|
+
log('error', `Failed to parse daemon config: ${e}`);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
115
210
|
// Watch for fixture file additions/deletions to reload the fixtures module
|
|
116
211
|
const isFixtureFile = (file) => file.match(/\.fixture\.(ts|tsx)$/);
|
|
117
212
|
const invalidateFixturesModule = (file, event) => {
|
|
@@ -133,12 +228,21 @@ export function componentExplorer(options = {}) {
|
|
|
133
228
|
});
|
|
134
229
|
viteServer.middlewares.use(async (req, res, next) => {
|
|
135
230
|
const url = req.url ?? '';
|
|
136
|
-
|
|
137
|
-
|
|
231
|
+
const parsedUrl = new URL(url, 'http://localhost');
|
|
232
|
+
// Proxy daemon API requests to the named pipe
|
|
233
|
+
if (daemonConfig && parsedUrl.pathname.startsWith(DAEMON_API_PREFIX + '/')) {
|
|
234
|
+
const daemonPath = '/api' + parsedUrl.pathname.slice(DAEMON_API_PREFIX.length);
|
|
235
|
+
proxyToDaemon(req, res, daemonConfig.pipeName, daemonPath, log);
|
|
236
|
+
return;
|
|
237
|
+
}
|
|
238
|
+
// Serve explorer HTML for the explorer route (all modes via query params)
|
|
239
|
+
if (parsedUrl.pathname === explorerRoute || parsedUrl.pathname === explorerRoute + '/') {
|
|
138
240
|
log('verbose', `Serving explorer HTML for: ${url}`);
|
|
139
|
-
const html = getExplorerHtml();
|
|
140
|
-
// Transform HTML through Vite to inject React preamble and client
|
|
141
|
-
|
|
241
|
+
const html = getExplorerHtml(daemonConfig);
|
|
242
|
+
// Transform HTML through Vite to inject React preamble and client.
|
|
243
|
+
// Use only the pathname — passing query params (e.g. ?report=...url.json)
|
|
244
|
+
// confuses Vite's JSON plugin into treating inline CSS as JSON.
|
|
245
|
+
const transformedHtml = await viteServer.transformIndexHtml(parsedUrl.pathname, html);
|
|
142
246
|
res.setHeader('Content-Type', 'text/html');
|
|
143
247
|
res.end(transformedHtml);
|
|
144
248
|
return;
|
|
@@ -161,17 +265,38 @@ export function componentExplorer(options = {}) {
|
|
|
161
265
|
}
|
|
162
266
|
function generateEntryModule() {
|
|
163
267
|
return `
|
|
164
|
-
import { ExplorerApp } from '@vscode/component-explorer';
|
|
268
|
+
import { ExplorerApp, CliRuntime } from '@vscode/component-explorer/viewer';
|
|
269
|
+
import '@vscode/component-explorer/styles.css';
|
|
165
270
|
import { fixtures } from 'virtual:component-explorer/fixtures';
|
|
166
271
|
|
|
167
|
-
const
|
|
272
|
+
const params = new URLSearchParams(location.search);
|
|
273
|
+
const root = document.getElementById('root');
|
|
274
|
+
|
|
275
|
+
const target = params.get('mode') === 'render'
|
|
276
|
+
? new CliRuntime(root, fixtures)
|
|
277
|
+
: new ExplorerApp(root, fixtures);
|
|
278
|
+
|
|
279
|
+
const autoFixture = params.get('fixture');
|
|
280
|
+
if (autoFixture && target instanceof CliRuntime) {
|
|
281
|
+
target.renderFixture(autoFixture);
|
|
282
|
+
}
|
|
168
283
|
|
|
169
284
|
if (import.meta.hot) {
|
|
170
285
|
import.meta.hot.accept('virtual:component-explorer/fixtures', (newModule) => {
|
|
171
286
|
if (newModule) {
|
|
172
|
-
|
|
287
|
+
target.updateFixtures(newModule.fixtures);
|
|
173
288
|
}
|
|
174
289
|
});
|
|
290
|
+
|
|
291
|
+
import.meta.hot.on('vite:afterUpdate', (payload) => {
|
|
292
|
+
if (payload.updates.length > 0) {
|
|
293
|
+
target.bumpVersion();
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
import.meta.hot.on('vite:beforeFullReload', () => {
|
|
298
|
+
console.log('[component-explorer] Full page reload incoming');
|
|
299
|
+
});
|
|
175
300
|
}
|
|
176
301
|
`;
|
|
177
302
|
}
|
|
@@ -181,7 +306,10 @@ function generateFixturesModule(fixtureGlob) {
|
|
|
181
306
|
export const fixtures = import.meta.glob('${normalizedGlob}', { eager: true });
|
|
182
307
|
`;
|
|
183
308
|
}
|
|
184
|
-
function getExplorerHtml() {
|
|
309
|
+
function getExplorerHtml(daemonConfig) {
|
|
310
|
+
const daemonScript = daemonConfig
|
|
311
|
+
? `<script>window.__EXPLORER_DAEMON__ = ${JSON.stringify({ sessionName: daemonConfig.sessionName })};</script>`
|
|
312
|
+
: '';
|
|
185
313
|
return `<!DOCTYPE html>
|
|
186
314
|
<html lang="en">
|
|
187
315
|
<head>
|
|
@@ -192,6 +320,7 @@ function getExplorerHtml() {
|
|
|
192
320
|
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
193
321
|
html, body, #root { height: 100%; width: 100%; }
|
|
194
322
|
</style>
|
|
323
|
+
${daemonScript}
|
|
195
324
|
</head>
|
|
196
325
|
<body>
|
|
197
326
|
<div id="root"></div>
|
|
@@ -199,6 +328,41 @@ function getExplorerHtml() {
|
|
|
199
328
|
</body>
|
|
200
329
|
</html>`;
|
|
201
330
|
}
|
|
331
|
+
/**
|
|
332
|
+
* Proxies a request to the daemon's named pipe server.
|
|
333
|
+
*/
|
|
334
|
+
function proxyToDaemon(req, res, pipeName, daemonPath, log) {
|
|
335
|
+
const body = [];
|
|
336
|
+
req.on('data', chunk => body.push(chunk));
|
|
337
|
+
req.on('end', () => {
|
|
338
|
+
const reqBody = Buffer.concat(body);
|
|
339
|
+
const options = {
|
|
340
|
+
socketPath: pipeName,
|
|
341
|
+
path: daemonPath || '/',
|
|
342
|
+
method: req.method,
|
|
343
|
+
headers: {
|
|
344
|
+
'Content-Type': 'application/json',
|
|
345
|
+
'Content-Length': reqBody.byteLength,
|
|
346
|
+
},
|
|
347
|
+
};
|
|
348
|
+
const daemonReq = http.request(options, (daemonRes) => {
|
|
349
|
+
const chunks = [];
|
|
350
|
+
daemonRes.on('data', chunk => chunks.push(chunk));
|
|
351
|
+
daemonRes.on('end', () => {
|
|
352
|
+
const responseBuffer = Buffer.concat(chunks);
|
|
353
|
+
res.writeHead(daemonRes.statusCode || 200, daemonRes.headers);
|
|
354
|
+
res.end(responseBuffer);
|
|
355
|
+
});
|
|
356
|
+
});
|
|
357
|
+
daemonReq.on('error', (err) => {
|
|
358
|
+
log('info', `Daemon proxy error: ${err.message}`);
|
|
359
|
+
res.writeHead(503, { 'Content-Type': 'application/json' });
|
|
360
|
+
res.end(JSON.stringify({ error: 'Daemon unavailable' }));
|
|
361
|
+
});
|
|
362
|
+
daemonReq.write(reqBody);
|
|
363
|
+
daemonReq.end();
|
|
364
|
+
});
|
|
365
|
+
}
|
|
202
366
|
function getExplorerHtmlForBuild(scriptPath, cssLinks) {
|
|
203
367
|
return `<!DOCTYPE html>
|
|
204
368
|
<html lang="en">
|
package/dist/plugin.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,IAAI,EAAE,MAAM,YAAY,CAAC;AAClC,OAAO,IAAI,MAAM,WAAW,CAAC;AAE7B,MAAM,gBAAgB,GAAG,kCAAkC,CAAC;AAC5D,MAAM,mBAAmB,GAAG,qCAAqC,CAAC;AAClE,MAAM,yBAAyB,GAAG,IAAI,GAAG,gBAAgB,CAAC;AAC1D,MAAM,4BAA4B,GAAG,IAAI,GAAG,mBAAmB,CAAC;AAIhE,mFAAmF;AACnF,SAAS,0BAA0B,CAAC,WAAmB;IACrD,IAAI,WAAW,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;QACjC,OAAO,GAAG,GAAG,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;IACpC,CAAC;SAAM,IAAI,WAAW,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE,CAAC;QACvC,OAAO,WAAW,CAAC;IACrB,CAAC;SAAM,CAAC;QACN,OAAO,GAAG,GAAG,WAAW,CAAC;IAC3B,CAA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.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@vscode/component-explorer-vite-plugin",
|
|
3
|
-
"version": "0.1.1-
|
|
3
|
+
"version": "0.1.1-11",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"main": "./dist/index.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -15,16 +15,23 @@
|
|
|
15
15
|
],
|
|
16
16
|
"scripts": {
|
|
17
17
|
"build": "tsc",
|
|
18
|
-
"
|
|
18
|
+
"dev": "tsc --watch",
|
|
19
|
+
"test": "vitest --run",
|
|
20
|
+
"test:update": "vitest --run --update"
|
|
19
21
|
},
|
|
20
22
|
"dependencies": {
|
|
21
23
|
"tinyglobby": "^0.2.0"
|
|
22
24
|
},
|
|
23
25
|
"devDependencies": {
|
|
24
26
|
"@vscode/component-explorer": "workspace:*",
|
|
25
|
-
"@types/node": "^
|
|
27
|
+
"@types/node": "^22.0.0",
|
|
28
|
+
"@vitejs/plugin-react": "^4.3.0",
|
|
29
|
+
"playwright": "^1.40.0",
|
|
30
|
+
"react": "^18.3.0",
|
|
31
|
+
"react-dom": "^18.3.0",
|
|
26
32
|
"typescript": "^5.4.0",
|
|
27
|
-
"vite": "^6.0.0"
|
|
33
|
+
"vite": "^6.0.0",
|
|
34
|
+
"vitest": "^1.3.0"
|
|
28
35
|
},
|
|
29
36
|
"peerDependencies": {
|
|
30
37
|
"@vscode/component-explorer": "*",
|