Skip to content

Commit 55fc5c9

Browse files
committed
clean
1 parent d0e2293 commit 55fc5c9

File tree

2 files changed

+4
-13
lines changed

2 files changed

+4
-13
lines changed

packages/tanstackstart-react/src/vite/autoInstrumentMiddleware.ts

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,8 @@ type AutoInstrumentMiddlewareOptions = {
66
};
77

88
/**
9-
* A Vite plugin that automatically instruments TanStack Start middlewares.
10-
*
11-
* Phase 1: Only wraps global middlewares in `createStart()` configuration
12-
* (`requestMiddleware` and `functionMiddleware` arrays).
13-
*
14-
* @param options - Configuration options for the plugin
15-
* @returns A Vite plugin
9+
* A Vite plugin that automatically instruments TanStack Start middlewares
10+
* by wrapping `requestMiddleware` and `functionMiddleware` arrays in `createStart()`.
1611
*/
1712
export function makeAutoInstrumentMiddlewarePlugin(options: AutoInstrumentMiddlewareOptions = {}): Plugin {
1813
const { enabled = true, debug = false } = options;
@@ -62,7 +57,6 @@ export function makeAutoInstrumentMiddlewarePlugin(options: AutoInstrumentMiddle
6257

6358
if (needsImport) {
6459
transformed = `import { wrapMiddlewaresWithSentry } from '@sentry/tanstackstart-react';\n${transformed}`;
65-
console.log(`[Sentry] transformed:`, transformed);
6660
return { code: transformed, map: null };
6761
}
6862

packages/tanstackstart-react/test/vite/autoInstrumentMiddleware.test.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
import type { Plugin } from 'vite';
22
import { describe, expect, it } from 'vitest';
3-
import {
4-
arrayToObjectShorthand,
5-
makeAutoInstrumentMiddlewarePlugin,
6-
} from '../../src/vite/autoInstrumentMiddleware';
3+
import { arrayToObjectShorthand, makeAutoInstrumentMiddlewarePlugin } from '../../src/vite/autoInstrumentMiddleware';
74

85
type PluginWithTransform = Plugin & {
96
transform: (code: string, id: string) => { code: string; map: null } | null;
@@ -32,7 +29,7 @@ export const startInstance = createStart(() => ({
3229

3330
it('does not instrument files without createStart', () => {
3431
const plugin = makeAutoInstrumentMiddlewarePlugin() as PluginWithTransform;
35-
const code = `export const foo = 'bar';`;
32+
const code = "export const foo = 'bar';";
3633
const result = plugin.transform(code, '/app/other.ts');
3734

3835
expect(result).toBeNull();

0 commit comments

Comments
 (0)