Skip to content

Commit 318bbdd

Browse files
committed
small refactors
1 parent 013fd9f commit 318bbdd

2 files changed

Lines changed: 7 additions & 8 deletions

File tree

package.json

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -23,10 +23,7 @@
2323
"./service-worker": "./dist/_entries/service-worker.mjs",
2424
"./node": "./dist/_entries/node.mjs",
2525
"./generic": "./dist/_entries/generic.mjs",
26-
"./tracing": {
27-
"types": "./dist/tracing.d.mts",
28-
"default": "./dist/tracing.mjs"
29-
}
26+
"./tracing": "./dist/tracing.mjs"
3027
},
3128
"types": "./dist/_entries/generic.d.mts",
3229
"files": [

src/tracing.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import type { H3Event } from "./event.ts";
2+
import type { H3 } from "./h3.ts";
23
import {
3-
definePlugin,
44
type H3Plugin,
55
type H3Route,
66
type MiddlewareOptions,
@@ -35,8 +35,9 @@ export interface TracingPluginOptions {
3535
/**
3636
* Enables tracing for H3 apps.
3737
*/
38-
export const tracingPlugin: (traceOpts?: TracingPluginOptions) => H3Plugin =
39-
definePlugin((h3, traceOpts?: TracingPluginOptions) => {
38+
export function tracingPlugin(traceOpts?: TracingPluginOptions): H3Plugin {
39+
// TODO: Support H3Core (Nitro)
40+
return (h3: H3) => {
4041
const { tracingChannel } =
4142
globalThis.process.getBuiltinModule?.("diagnostics_channel") ?? {};
4243

@@ -149,4 +150,5 @@ export const tracingPlugin: (traceOpts?: TracingPluginOptions) => H3Plugin =
149150
};
150151

151152
return h3;
152-
});
153+
};
154+
}

0 commit comments

Comments
 (0)