@vscode/component-explorer-vite-plugin 0.1.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/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +2 -0
- package/dist/index.js.map +1 -0
- package/dist/plugin.d.ts +14 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +221 -0
- package/dist/plugin.js.map +1 -0
- package/package.json +32 -0
package/dist/index.d.ts
ADDED
|
@@ -0,0 +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"}
|
package/dist/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAiC,MAAM,aAAa,CAAC"}
|
package/dist/plugin.d.ts
ADDED
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { Plugin } from 'vite';
|
|
2
|
+
export type LogLevel = 'silent' | 'info' | 'verbose';
|
|
3
|
+
export interface ComponentExplorerOptions {
|
|
4
|
+
/** Glob pattern for fixture files. Default: './src/**\/*.fixture.{ts,tsx}' */
|
|
5
|
+
include?: string;
|
|
6
|
+
/** Explorer route path. Default: '/___explorer' */
|
|
7
|
+
route?: string;
|
|
8
|
+
/** Output filename for the explorer HTML. Default: '___explorer.html' */
|
|
9
|
+
outFile?: string;
|
|
10
|
+
/** Log level. Default: 'info' */
|
|
11
|
+
logLevel?: LogLevel;
|
|
12
|
+
}
|
|
13
|
+
export declare function componentExplorer(options?: ComponentExplorerOptions): Plugin;
|
|
14
|
+
//# sourceMappingURL=plugin.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAkB,MAAM,MAAM,CAAC;AAUnD,MAAM,MAAM,QAAQ,GAAG,QAAQ,GAAG,MAAM,GAAG,SAAS,CAAC;AAarD,MAAM,WAAW,wBAAwB;IACvC,8EAA8E;IAC9E,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,mDAAmD;IACnD,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,yEAAyE;IACzE,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,iCAAiC;IACjC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,wBAAgB,iBAAiB,CAAC,OAAO,GAAE,wBAA6B,GAAG,MAAM,CAoKhF"}
|
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
import { glob } from 'tinyglobby';
|
|
2
|
+
import path from 'node:path';
|
|
3
|
+
const VIRTUAL_ENTRY_ID = 'virtual:component-explorer/entry';
|
|
4
|
+
const VIRTUAL_FIXTURES_ID = 'virtual:component-explorer/fixtures';
|
|
5
|
+
const RESOLVED_VIRTUAL_ENTRY_ID = '\0' + VIRTUAL_ENTRY_ID;
|
|
6
|
+
const RESOLVED_VIRTUAL_FIXTURES_ID = '\0' + VIRTUAL_FIXTURES_ID;
|
|
7
|
+
/** Normalize a glob pattern for use with import.meta.glob (must start with '/') */
|
|
8
|
+
function normalizeGlobForImportMeta(fixtureGlob) {
|
|
9
|
+
if (fixtureGlob.startsWith('./')) {
|
|
10
|
+
return '/' + fixtureGlob.slice(2);
|
|
11
|
+
}
|
|
12
|
+
else if (fixtureGlob.startsWith('/')) {
|
|
13
|
+
return fixtureGlob;
|
|
14
|
+
}
|
|
15
|
+
else {
|
|
16
|
+
return '/' + fixtureGlob;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export function componentExplorer(options = {}) {
|
|
20
|
+
const fixtureGlob = options.include ?? './src/**/*.fixture.{ts,tsx}';
|
|
21
|
+
const explorerRoute = options.route ?? '/___explorer';
|
|
22
|
+
const outFile = options.outFile ?? '___explorer.html';
|
|
23
|
+
const logLevel = options.logLevel ?? 'info';
|
|
24
|
+
let config;
|
|
25
|
+
const log = (level, message) => {
|
|
26
|
+
const levels = ['silent', 'info', 'verbose'];
|
|
27
|
+
if (levels.indexOf(level) <= levels.indexOf(logLevel)) {
|
|
28
|
+
console.log(`[component-explorer] ${message}`);
|
|
29
|
+
}
|
|
30
|
+
};
|
|
31
|
+
return {
|
|
32
|
+
name: 'component-explorer',
|
|
33
|
+
async configResolved(resolvedConfig) {
|
|
34
|
+
config = resolvedConfig;
|
|
35
|
+
if (logLevel === 'verbose') {
|
|
36
|
+
const rootDir = config.root;
|
|
37
|
+
const normalizedGlob = fixtureGlob.startsWith('./') ? fixtureGlob.slice(2) : fixtureGlob;
|
|
38
|
+
const fixtures = await glob(normalizedGlob, { cwd: rootDir });
|
|
39
|
+
const resolvedGlob = normalizeGlobForImportMeta(fixtureGlob);
|
|
40
|
+
if (fixtures.length === 0) {
|
|
41
|
+
log('verbose', `No fixtures found`);
|
|
42
|
+
log('verbose', ` Glob: ${fixtureGlob}`);
|
|
43
|
+
log('verbose', ` Resolved: ${resolvedGlob}`);
|
|
44
|
+
log('verbose', ` Root: ${rootDir}`);
|
|
45
|
+
}
|
|
46
|
+
else {
|
|
47
|
+
log('verbose', `Found ${fixtures.length} fixture(s) (glob: ${resolvedGlob}):`);
|
|
48
|
+
for (const fixture of fixtures) {
|
|
49
|
+
log('verbose', ` - ${fixture}`);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
},
|
|
54
|
+
config(userConfig) {
|
|
55
|
+
// Add explorer entry to build inputs
|
|
56
|
+
const currentInput = userConfig.build?.rollupOptions?.input;
|
|
57
|
+
let input;
|
|
58
|
+
if (!currentInput) {
|
|
59
|
+
input = { '___explorer': VIRTUAL_ENTRY_ID };
|
|
60
|
+
}
|
|
61
|
+
else if (typeof currentInput === 'string') {
|
|
62
|
+
input = { main: currentInput, '___explorer': VIRTUAL_ENTRY_ID };
|
|
63
|
+
}
|
|
64
|
+
else if (Array.isArray(currentInput)) {
|
|
65
|
+
input = Object.fromEntries(currentInput.map((p, i) => [`input${i}`, p]));
|
|
66
|
+
input['___explorer'] = VIRTUAL_ENTRY_ID;
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
input = { ...currentInput, '___explorer': VIRTUAL_ENTRY_ID };
|
|
70
|
+
}
|
|
71
|
+
return {
|
|
72
|
+
build: {
|
|
73
|
+
rollupOptions: {
|
|
74
|
+
input,
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
};
|
|
78
|
+
},
|
|
79
|
+
resolveId(id) {
|
|
80
|
+
if (id === VIRTUAL_ENTRY_ID) {
|
|
81
|
+
return RESOLVED_VIRTUAL_ENTRY_ID;
|
|
82
|
+
}
|
|
83
|
+
if (id === VIRTUAL_FIXTURES_ID) {
|
|
84
|
+
return RESOLVED_VIRTUAL_FIXTURES_ID;
|
|
85
|
+
}
|
|
86
|
+
},
|
|
87
|
+
load(id) {
|
|
88
|
+
if (id === RESOLVED_VIRTUAL_ENTRY_ID) {
|
|
89
|
+
return generateEntryModule();
|
|
90
|
+
}
|
|
91
|
+
if (id === RESOLVED_VIRTUAL_FIXTURES_ID) {
|
|
92
|
+
return generateFixturesModule(fixtureGlob);
|
|
93
|
+
}
|
|
94
|
+
},
|
|
95
|
+
generateBundle(_, bundle) {
|
|
96
|
+
// Find the explorer entry chunk
|
|
97
|
+
const explorerChunk = Object.values(bundle).find((chunk) => chunk.type === 'chunk' && chunk.name === '___explorer' && chunk.isEntry);
|
|
98
|
+
if (explorerChunk && explorerChunk.type === 'chunk') {
|
|
99
|
+
const base = config.base ?? '/';
|
|
100
|
+
const scriptPath = `${base}${explorerChunk.fileName}`;
|
|
101
|
+
// Collect CSS files imported by the explorer
|
|
102
|
+
const cssFiles = explorerChunk.viteMetadata?.importedCss ?? new Set();
|
|
103
|
+
const cssLinks = Array.from(cssFiles)
|
|
104
|
+
.map((file) => ` <link rel="stylesheet" href="${base}${file}">`)
|
|
105
|
+
.join('\n');
|
|
106
|
+
this.emitFile({
|
|
107
|
+
type: 'asset',
|
|
108
|
+
fileName: outFile,
|
|
109
|
+
source: getExplorerHtmlForBuild(scriptPath, cssLinks),
|
|
110
|
+
});
|
|
111
|
+
}
|
|
112
|
+
},
|
|
113
|
+
configureServer(viteServer) {
|
|
114
|
+
log('info', `Explorer available at: ${explorerRoute}`);
|
|
115
|
+
// Watch for fixture file additions/deletions to reload the fixtures module
|
|
116
|
+
const isFixtureFile = (file) => file.match(/\.fixture\.(ts|tsx)$/);
|
|
117
|
+
const invalidateFixturesModule = (file, event) => {
|
|
118
|
+
log('verbose', `Fixture ${event}: ${path.relative(config.root, file)}`);
|
|
119
|
+
const mod = viteServer.moduleGraph.getModuleById(RESOLVED_VIRTUAL_FIXTURES_ID);
|
|
120
|
+
if (mod) {
|
|
121
|
+
viteServer.moduleGraph.invalidateModule(mod);
|
|
122
|
+
}
|
|
123
|
+
};
|
|
124
|
+
viteServer.watcher.on('add', (file) => {
|
|
125
|
+
if (isFixtureFile(file)) {
|
|
126
|
+
invalidateFixturesModule(file, 'added');
|
|
127
|
+
}
|
|
128
|
+
});
|
|
129
|
+
viteServer.watcher.on('unlink', (file) => {
|
|
130
|
+
if (isFixtureFile(file)) {
|
|
131
|
+
invalidateFixturesModule(file, 'removed');
|
|
132
|
+
}
|
|
133
|
+
});
|
|
134
|
+
viteServer.middlewares.use(async (req, res, next) => {
|
|
135
|
+
const url = req.url ?? '';
|
|
136
|
+
// Explorer shell route
|
|
137
|
+
if (url === explorerRoute || url === explorerRoute + '/') {
|
|
138
|
+
log('verbose', `Serving explorer HTML for: ${url}`);
|
|
139
|
+
const html = getExplorerHtml();
|
|
140
|
+
// Transform HTML through Vite to inject React preamble and client
|
|
141
|
+
const transformedHtml = await viteServer.transformIndexHtml(url, html);
|
|
142
|
+
res.setHeader('Content-Type', 'text/html');
|
|
143
|
+
res.end(transformedHtml);
|
|
144
|
+
return;
|
|
145
|
+
}
|
|
146
|
+
next();
|
|
147
|
+
});
|
|
148
|
+
},
|
|
149
|
+
handleHotUpdate({ file, server }) {
|
|
150
|
+
// When a fixture file changes, send HMR event
|
|
151
|
+
if (file.match(/\.fixture\.(ts|tsx)$/)) {
|
|
152
|
+
log('verbose', `Fixture changed: ${path.relative(config.root, file)}`);
|
|
153
|
+
server.ws.send({
|
|
154
|
+
type: 'custom',
|
|
155
|
+
event: 'component-explorer:fixture-change',
|
|
156
|
+
data: { file },
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
}
|
|
162
|
+
function generateEntryModule() {
|
|
163
|
+
return `
|
|
164
|
+
import { ExplorerApp } from '@vscode/component-explorer';
|
|
165
|
+
import { fixtures } from 'virtual:component-explorer/fixtures';
|
|
166
|
+
|
|
167
|
+
const app = new ExplorerApp(document.getElementById('root'), fixtures);
|
|
168
|
+
|
|
169
|
+
if (import.meta.hot) {
|
|
170
|
+
import.meta.hot.accept('virtual:component-explorer/fixtures', (newModule) => {
|
|
171
|
+
if (newModule) {
|
|
172
|
+
app.updateFixtures(newModule.fixtures);
|
|
173
|
+
}
|
|
174
|
+
});
|
|
175
|
+
}
|
|
176
|
+
`;
|
|
177
|
+
}
|
|
178
|
+
function generateFixturesModule(fixtureGlob) {
|
|
179
|
+
const normalizedGlob = normalizeGlobForImportMeta(fixtureGlob);
|
|
180
|
+
return `
|
|
181
|
+
export const fixtures = import.meta.glob('${normalizedGlob}', { eager: true });
|
|
182
|
+
`;
|
|
183
|
+
}
|
|
184
|
+
function getExplorerHtml() {
|
|
185
|
+
return `<!DOCTYPE html>
|
|
186
|
+
<html lang="en">
|
|
187
|
+
<head>
|
|
188
|
+
<meta charset="UTF-8">
|
|
189
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
190
|
+
<title>Component Explorer</title>
|
|
191
|
+
<style>
|
|
192
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
193
|
+
html, body, #root { height: 100%; width: 100%; }
|
|
194
|
+
</style>
|
|
195
|
+
</head>
|
|
196
|
+
<body>
|
|
197
|
+
<div id="root"></div>
|
|
198
|
+
<script type="module" src="/@id/__x00__virtual:component-explorer/entry"></script>
|
|
199
|
+
</body>
|
|
200
|
+
</html>`;
|
|
201
|
+
}
|
|
202
|
+
function getExplorerHtmlForBuild(scriptPath, cssLinks) {
|
|
203
|
+
return `<!DOCTYPE html>
|
|
204
|
+
<html lang="en">
|
|
205
|
+
<head>
|
|
206
|
+
<meta charset="UTF-8">
|
|
207
|
+
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
208
|
+
<title>Component Explorer</title>
|
|
209
|
+
${cssLinks}
|
|
210
|
+
<style>
|
|
211
|
+
* { margin: 0; padding: 0; box-sizing: border-box; }
|
|
212
|
+
html, body, #root { height: 100%; width: 100%; }
|
|
213
|
+
</style>
|
|
214
|
+
</head>
|
|
215
|
+
<body>
|
|
216
|
+
<div id="root"></div>
|
|
217
|
+
<script type="module" src="${scriptPath}"></script>
|
|
218
|
+
</body>
|
|
219
|
+
</html>`;
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +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,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,CAAC,QAAQ,CAAC,MAAM,CAAC,IAAI,EAAE,IAAI,CAAC,EAAE,CAAC,CAAC;gBACvE,MAAM,CAAC,EAAE,CAAC,IAAI,CAAC;oBACb,IAAI,EAAE,QAAQ;oBACd,KAAK,EAAE,mCAAmC;oBAC1C,IAAI,EAAE,EAAE,IAAI,EAAE;iBACf,CAAC,CAAC;YACL,CAAC;QACH,CAAC;KACF,CAAC;AACJ,CAAC;AAED,SAAS,mBAAmB;IAC1B,OAAO;;;;;;;;;;;;;CAaR,CAAC;AACF,CAAC;AAED,SAAS,sBAAsB,CAAC,WAAmB;IACjD,MAAM,cAAc,GAAG,0BAA0B,CAAC,WAAW,CAAC,CAAC;IAC/D,OAAO;4CACmC,cAAc;CACzD,CAAC;AACF,CAAC;AAED,SAAS,eAAe;IACtB,OAAO;;;;;;;;;;;;;;;QAeD,CAAC;AACT,CAAC;AAED,SAAS,uBAAuB,CAAC,UAAkB,EAAE,QAAgB;IACnE,OAAO;;;;;;EAMP,QAAQ;;;;;;;;+BAQqB,UAAU;;QAEjC,CAAC;AACT,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@vscode/component-explorer-vite-plugin",
|
|
3
|
+
"version": "0.1.1-0",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"main": "./dist/index.js",
|
|
6
|
+
"types": "./dist/index.d.ts",
|
|
7
|
+
"exports": {
|
|
8
|
+
".": {
|
|
9
|
+
"import": "./dist/index.js",
|
|
10
|
+
"types": "./dist/index.d.ts"
|
|
11
|
+
}
|
|
12
|
+
},
|
|
13
|
+
"files": [
|
|
14
|
+
"dist"
|
|
15
|
+
],
|
|
16
|
+
"scripts": {
|
|
17
|
+
"build": "tsc",
|
|
18
|
+
"watch": "tsc --watch"
|
|
19
|
+
},
|
|
20
|
+
"dependencies": {
|
|
21
|
+
"@vscode/component-explorer": "workspace:*",
|
|
22
|
+
"tinyglobby": "^0.2.0"
|
|
23
|
+
},
|
|
24
|
+
"devDependencies": {
|
|
25
|
+
"@types/node": "^20.0.0",
|
|
26
|
+
"typescript": "^5.4.0",
|
|
27
|
+
"vite": "^6.0.0"
|
|
28
|
+
},
|
|
29
|
+
"peerDependencies": {
|
|
30
|
+
"vite": "^5.0.0 || ^6.0.0"
|
|
31
|
+
}
|
|
32
|
+
}
|