@mcpc-tech/unplugin-dev-inspector-mcp 0.0.34 → 0.0.35
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.cjs +26 -19
- package/dist/index.d.cts +4 -4
- package/dist/index.js +26 -19
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -91,28 +91,35 @@ export function registerInspectorTool(tool) {
|
|
|
91
91
|
}
|
|
92
92
|
|
|
93
93
|
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
94
|
-
//
|
|
95
|
-
|
|
96
|
-
|
|
94
|
+
// Skip if already loaded (e.g., by HTML injection)
|
|
95
|
+
if (window.__DEV_INSPECTOR_LOADED__) {
|
|
96
|
+
// Already initialized, skip
|
|
97
|
+
} else {
|
|
98
|
+
window.__DEV_INSPECTOR_LOADED__ = true;
|
|
99
|
+
|
|
100
|
+
// Create inspector element
|
|
101
|
+
const inspector = document.createElement('dev-inspector-mcp');
|
|
102
|
+
document.body.appendChild(inspector);
|
|
97
103
|
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
104
|
+
// Store dev server config globally
|
|
105
|
+
window.__DEV_INSPECTOR_CONFIG__ = {
|
|
106
|
+
host: '${resolvedHost}',
|
|
107
|
+
port: '${resolvedPort}',
|
|
108
|
+
base: '/',
|
|
109
|
+
showInspectorBar: ${options.showInspectorBar ?? true}
|
|
110
|
+
};
|
|
105
111
|
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
+
// Dynamically load inspector script
|
|
113
|
+
const script = document.createElement('script');
|
|
114
|
+
const config = window.__DEV_INSPECTOR_CONFIG__;
|
|
115
|
+
let baseUrl = 'http://' + config.host + ':' + config.port + config.base;
|
|
116
|
+
if (baseUrl.endsWith('/')) {
|
|
117
|
+
baseUrl = baseUrl.slice(0, -1);
|
|
118
|
+
}
|
|
119
|
+
script.src = baseUrl + '/__inspector__/inspector.iife.js';
|
|
120
|
+
script.type = 'module';
|
|
121
|
+
document.head.appendChild(script);
|
|
112
122
|
}
|
|
113
|
-
script.src = baseUrl + '/__inspector__/inspector.iife.js';
|
|
114
|
-
script.type = 'module';
|
|
115
|
-
document.head.appendChild(script);
|
|
116
123
|
}
|
|
117
124
|
`;
|
|
118
125
|
},
|
package/dist/index.d.cts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as unplugin1 from "unplugin";
|
|
2
2
|
|
|
3
3
|
//#region src/utils/config-updater.d.ts
|
|
4
4
|
type EditorId = "cursor" | "vscode" | "windsurf" | "claude-code" | "antigravity";
|
|
@@ -134,10 +134,10 @@ interface DevInspectorOptions extends McpConfigOptions, AcpOptions {
|
|
|
134
134
|
}
|
|
135
135
|
//#endregion
|
|
136
136
|
//#region src/core.d.ts
|
|
137
|
-
declare const unplugin:
|
|
137
|
+
declare const unplugin: unplugin1.UnpluginInstance<DevInspectorOptions | undefined, boolean>;
|
|
138
138
|
//#endregion
|
|
139
139
|
//#region src/core-external.d.ts
|
|
140
|
-
declare const unpluginExternal:
|
|
140
|
+
declare const unpluginExternal: unplugin1.UnpluginInstance<DevInspectorOptions | undefined, boolean>;
|
|
141
141
|
//#endregion
|
|
142
142
|
//#region src/turbopack.d.ts
|
|
143
143
|
interface TurbopackDevInspectorOptions extends DevInspectorOptions {
|
|
@@ -162,7 +162,7 @@ interface TurbopackDevInspectorOptions extends DevInspectorOptions {
|
|
|
162
162
|
declare function turbopackDevInspector(options?: TurbopackDevInspectorOptions): any;
|
|
163
163
|
//#endregion
|
|
164
164
|
//#region src/index.d.ts
|
|
165
|
-
declare const external:
|
|
165
|
+
declare const external: unplugin1.UnpluginInstance<DevInspectorOptions | undefined, boolean>;
|
|
166
166
|
declare module "virtual:dev-inspector-mcp" {}
|
|
167
167
|
//#endregion
|
|
168
168
|
export { type CustomEditorConfig, type DevInspectorOptions, type EditorId, type McpConfigOptions, type TurbopackDevInspectorOptions, unplugin as default, unplugin, external, turbopackDevInspector, unpluginExternal };
|
package/dist/index.js
CHANGED
|
@@ -87,28 +87,35 @@ export function registerInspectorTool(tool) {
|
|
|
87
87
|
}
|
|
88
88
|
|
|
89
89
|
if (typeof window !== 'undefined' && typeof document !== 'undefined') {
|
|
90
|
-
//
|
|
91
|
-
|
|
92
|
-
|
|
90
|
+
// Skip if already loaded (e.g., by HTML injection)
|
|
91
|
+
if (window.__DEV_INSPECTOR_LOADED__) {
|
|
92
|
+
// Already initialized, skip
|
|
93
|
+
} else {
|
|
94
|
+
window.__DEV_INSPECTOR_LOADED__ = true;
|
|
95
|
+
|
|
96
|
+
// Create inspector element
|
|
97
|
+
const inspector = document.createElement('dev-inspector-mcp');
|
|
98
|
+
document.body.appendChild(inspector);
|
|
93
99
|
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
100
|
+
// Store dev server config globally
|
|
101
|
+
window.__DEV_INSPECTOR_CONFIG__ = {
|
|
102
|
+
host: '${resolvedHost}',
|
|
103
|
+
port: '${resolvedPort}',
|
|
104
|
+
base: '/',
|
|
105
|
+
showInspectorBar: ${options.showInspectorBar ?? true}
|
|
106
|
+
};
|
|
101
107
|
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
+
// Dynamically load inspector script
|
|
109
|
+
const script = document.createElement('script');
|
|
110
|
+
const config = window.__DEV_INSPECTOR_CONFIG__;
|
|
111
|
+
let baseUrl = 'http://' + config.host + ':' + config.port + config.base;
|
|
112
|
+
if (baseUrl.endsWith('/')) {
|
|
113
|
+
baseUrl = baseUrl.slice(0, -1);
|
|
114
|
+
}
|
|
115
|
+
script.src = baseUrl + '/__inspector__/inspector.iife.js';
|
|
116
|
+
script.type = 'module';
|
|
117
|
+
document.head.appendChild(script);
|
|
108
118
|
}
|
|
109
|
-
script.src = baseUrl + '/__inspector__/inspector.iife.js';
|
|
110
|
-
script.type = 'module';
|
|
111
|
-
document.head.appendChild(script);
|
|
112
119
|
}
|
|
113
120
|
`;
|
|
114
121
|
},
|
package/package.json
CHANGED