File tree Expand file tree Collapse file tree 2 files changed +4
-13
lines changed
packages/tanstackstart-react Expand file tree Collapse file tree 2 files changed +4
-13
lines changed Original file line number Diff line number Diff 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 */
1712export 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
Original file line number Diff line number Diff line change 11import type { Plugin } from 'vite' ;
22import { 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
85type 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 ( ) ;
You can’t perform that action at this time.
0 commit comments