@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 CHANGED
@@ -91,28 +91,35 @@ export function registerInspectorTool(tool) {
91
91
  }
92
92
 
93
93
  if (typeof window !== 'undefined' && typeof document !== 'undefined') {
94
- // Create inspector element
95
- const inspector = document.createElement('dev-inspector-mcp');
96
- document.body.appendChild(inspector);
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
- // Store dev server config globally
99
- window.__DEV_INSPECTOR_CONFIG__ = {
100
- host: '${resolvedHost}',
101
- port: '${resolvedPort}',
102
- base: '/',
103
- showInspectorBar: ${options.showInspectorBar ?? true}
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
- // Dynamically load inspector script
107
- const script = document.createElement('script');
108
- const config = window.__DEV_INSPECTOR_CONFIG__;
109
- let baseUrl = 'http://' + config.host + ':' + config.port + config.base;
110
- if (baseUrl.endsWith('/')) {
111
- baseUrl = baseUrl.slice(0, -1);
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 unplugin0 from "unplugin";
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: unplugin0.UnpluginInstance<DevInspectorOptions | undefined, boolean>;
137
+ declare const unplugin: unplugin1.UnpluginInstance<DevInspectorOptions | undefined, boolean>;
138
138
  //#endregion
139
139
  //#region src/core-external.d.ts
140
- declare const unpluginExternal: unplugin0.UnpluginInstance<DevInspectorOptions | undefined, boolean>;
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: unplugin0.UnpluginInstance<DevInspectorOptions | undefined, boolean>;
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
- // Create inspector element
91
- const inspector = document.createElement('dev-inspector-mcp');
92
- document.body.appendChild(inspector);
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
- // Store dev server config globally
95
- window.__DEV_INSPECTOR_CONFIG__ = {
96
- host: '${resolvedHost}',
97
- port: '${resolvedPort}',
98
- base: '/',
99
- showInspectorBar: ${options.showInspectorBar ?? true}
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
- // Dynamically load inspector script
103
- const script = document.createElement('script');
104
- const config = window.__DEV_INSPECTOR_CONFIG__;
105
- let baseUrl = 'http://' + config.host + ':' + config.port + config.base;
106
- if (baseUrl.endsWith('/')) {
107
- baseUrl = baseUrl.slice(0, -1);
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mcpc-tech/unplugin-dev-inspector-mcp",
3
- "version": "0.0.34",
3
+ "version": "0.0.35",
4
4
  "description": "Universal dev inspector plugin for React/Vue - inspect component sources and API calls in any bundler",
5
5
  "type": "module",
6
6
  "license": "MIT",