@visulima/vite-overlay 1.2.1 → 1.3.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/CHANGELOG.md CHANGED
@@ -1,3 +1,30 @@
1
+ ## @visulima/vite-overlay [1.3.0](https://github.com/visulima/visulima/compare/@visulima/vite-overlay@1.2.1...@visulima/vite-overlay@1.3.0) (2025-10-15)
2
+
3
+ ### Features
4
+
5
+ * enhance error overlay with location extraction and comprehensive docs ([13c6336](https://github.com/visulima/visulima/commit/13c63366c6e4a462f89da56fe10ad4f5d7cf875f))
6
+
7
+ ### Bug Fixes
8
+
9
+ * enhance linting commands and update package dependencies for improved performance ([cdbda6b](https://github.com/visulima/visulima/commit/cdbda6bd693d0618b58525e8fe10eb45d90eb6f5))
10
+ * update @visulima/packem to 2.0.0-alpha.30 across multiple packages for improved compatibility ([27b346e](https://github.com/visulima/visulima/commit/27b346eaa1c0fb0e420d9a9824482028307f4249))
11
+ * update devDependencies and packem configuration ([db05ef1](https://github.com/visulima/visulima/commit/db05ef1f50c6efa73be2ab8f1362fa90587fafeb))
12
+
13
+ ### Miscellaneous Chores
14
+
15
+ * update package dependencies across multiple packages for improved compatibility and performance ([9567591](https://github.com/visulima/visulima/commit/9567591c415da3002f3a4fe08f8caf7ce01ca5f7))
16
+ * update package versions in examples and pnpm-lock.yaml for improved compatibility ([af9b5b5](https://github.com/visulima/visulima/commit/af9b5b563c8bcff0ad8da3c51278a13b320cfe96))
17
+
18
+ ### Code Refactoring
19
+
20
+ * rename forwardClientLogs to forwardConsole in error overlay configuration ([98389e7](https://github.com/visulima/visulima/commit/98389e7e7ef63d8fbbd48fb4595bdeb34c636b37))
21
+
22
+
23
+ ### Dependencies
24
+
25
+ * **@visulima/error:** upgraded to 5.0.0
26
+ * **@visulima/path:** upgraded to 2.0.0
27
+
1
28
  ## @visulima/vite-overlay [1.2.1](https://github.com/visulima/visulima/compare/@visulima/vite-overlay@1.2.0...@visulima/vite-overlay@1.2.1) (2025-10-02)
2
29
 
3
30
  ### Bug Fixes
package/README.md CHANGED
@@ -34,7 +34,8 @@
34
34
  - **Enhanced Error Display** - Rich, interactive error overlays with syntax highlighting
35
35
  - **Source Map Integration** - Shows original `.tsx`/`.ts` files instead of compiled paths
36
36
  - **Cause Chain Navigation** - Navigate through multi-level error chains with original source locations
37
- - **Beautiful UI** - Modern, accessible interface with light/dark theme support
37
+ - **Console Method Forwarding** - Intercept and display console.error, console.warn, and other console methods
38
+ - **Beautiful UI** - Modern, accessible interface with light/dark theme support and floating balloon button
38
39
  - **Intelligent Solutions** - AI-powered error analysis and suggested fixes
39
40
  - **Real-time Updates** - Hot Module Replacement (HMR) integration for instant error feedback
40
41
  - **Comprehensive Testing** - Extensive e2e test coverage for reliability
@@ -78,13 +79,25 @@ export default defineConfig({
78
79
  plugins: [
79
80
  errorOverlay({
80
81
  // Whether to log/display client-side runtime errors (default: true)
81
- logClientRuntimeError: true,
82
+ forwardConsole: true,
83
+
84
+ // Array of console method names to forward (default: ["error"])
85
+ forwardedConsoleMethods: ["error", "warn"],
82
86
 
83
87
  // Custom React plugin name for detection (optional)
84
88
  reactPluginName: "@vitejs/plugin-react",
85
89
 
90
+ // Custom Vue plugin name for detection (optional)
91
+ vuePluginName: "@vitejs/plugin-vue",
92
+
93
+ // Whether to show the balloon button in the overlay (default: true)
94
+ showBallonButton: true,
95
+
86
96
  // Custom solution finder functions (optional)
87
97
  solutionFinders: [],
98
+
99
+ // @deprecated Use forwardConsole instead
100
+ logClientRuntimeError: true,
88
101
  }),
89
102
  ],
90
103
  });
@@ -92,11 +105,15 @@ export default defineConfig({
92
105
 
93
106
  #### Options
94
107
 
95
- | Option | Type | Default | Description |
96
- | ----------------------- | ------------------ | ----------- | ------------------------------------------------------------------------ |
97
- | `logClientRuntimeError` | `boolean` | `true` | Enable/disable client-side runtime error logging and overlay display |
98
- | `reactPluginName` | `string` | `undefined` | Custom React plugin name for detection (useful for custom React plugins) |
99
- | `solutionFinders` | `SolutionFinder[]` | `[]` | Array of custom solution finder functions for enhanced error analysis |
108
+ | Option | Type | Default | Description |
109
+ | ------------------------- | ------------------ | ----------- | ------------------------------------------------------------------------ |
110
+ | `forwardConsole` | `boolean` | `true` | Enable/disable client-side runtime error logging and overlay display |
111
+ | `forwardedConsoleMethods` | `string[]` | `["error"]` | Array of console method names to intercept and forward to overlay |
112
+ | `reactPluginName` | `string` | `undefined` | Custom React plugin name for detection (useful for custom React plugins) |
113
+ | `vuePluginName` | `string` | `undefined` | Custom Vue plugin name for detection (useful for custom Vue plugins) |
114
+ | `showBallonButton` | `boolean` | `true` | Whether to show the floating balloon button for error navigation |
115
+ | `solutionFinders` | `SolutionFinder[]` | `[]` | Array of custom solution finder functions for enhanced error analysis |
116
+ | `logClientRuntimeError` | `boolean` | `undefined` | **@deprecated** Use `forwardConsole` instead |
100
117
 
101
118
  ## Error Handling
102
119
 
@@ -106,6 +123,7 @@ The plugin automatically handles various types of errors:
106
123
 
107
124
  - Runtime JavaScript errors
108
125
  - Unhandled promise rejections
126
+ - Console method interception (configurable via `forwardedConsoleMethods`)
109
127
  - React component errors (when React plugin is detected)
110
128
  - Async context errors
111
129
 
@@ -125,6 +143,16 @@ The plugin automatically handles various types of errors:
125
143
 
126
144
  ## User Interface
127
145
 
146
+ ### Floating Balloon Button
147
+
148
+ When errors occur, a floating balloon button appears in the bottom-right corner of the screen. Click it to:
149
+
150
+ - View the most recent error details
151
+ - Navigate through multiple errors
152
+ - Access error overlay controls
153
+
154
+ The balloon button can be disabled by setting `showBallonButton: false` in the plugin options.
155
+
128
156
  ### Keyboard Shortcuts
129
157
 
130
158
  - `ESC` - Close error overlay (client-side errors only)
@@ -180,6 +208,34 @@ export default defineConfig({
180
208
  });
181
209
  ```
182
210
 
211
+ ### Vue Plugin Detection
212
+
213
+ Similar to React detection, you can specify a custom Vue plugin name:
214
+
215
+ ```typescript
216
+ export default defineConfig({
217
+ plugins: [
218
+ errorOverlay({
219
+ vuePluginName: "my-custom-vue-plugin",
220
+ }),
221
+ ],
222
+ });
223
+ ```
224
+
225
+ ### Console Method Forwarding
226
+
227
+ By default, only `console.error` calls are intercepted and displayed in the overlay. You can customize which console methods to forward:
228
+
229
+ ```typescript
230
+ export default defineConfig({
231
+ plugins: [
232
+ errorOverlay({
233
+ forwardedConsoleMethods: ["error", "warn", "log"],
234
+ }),
235
+ ],
236
+ });
237
+ ```
238
+
183
239
  ## Theming
184
240
 
185
241
  The error overlay uses a custom design system with CSS custom properties:
package/dist/index.d.ts CHANGED
@@ -2,6 +2,8 @@ import { SolutionFinder } from '@visulima/error/solution';
2
2
  import { Plugin } from 'vite';
3
3
 
4
4
  declare const errorOverlayPlugin: (options?: {
5
+ forwardConsole?: boolean;
6
+ forwardedConsoleMethods?: string[];
5
7
  logClientRuntimeError?: boolean;
6
8
  reactPluginName?: string;
7
9
  showBallonButton?: boolean;