diff --git a/packages/solidstart/README.md b/packages/solidstart/README.md index b5d775781875..0b25a3a37e3e 100644 --- a/packages/solidstart/README.md +++ b/packages/solidstart/README.md @@ -73,10 +73,10 @@ Sentry.init({ ### 4. Server instrumentation -Complete the setup by adding the Sentry middlware to your `src/middleware.ts` file: +Complete the setup by adding the Sentry middleware to your `src/middleware.ts` file: ```typescript -import { sentryBeforeResponseMiddleware } from '@sentry/solidstart/middleware'; +import { sentryBeforeResponseMiddleware } from '@sentry/solidstart'; import { createMiddleware } from '@solidjs/start/middleware'; export default createMiddleware({ diff --git a/packages/solidstart/package.json b/packages/solidstart/package.json index ee9fd2e4c956..4fb81cc25c2f 100644 --- a/packages/solidstart/package.json +++ b/packages/solidstart/package.json @@ -39,17 +39,6 @@ "require": "./build/cjs/index.server.js" } }, - "./middleware": { - "types": "./middleware.d.ts", - "import": { - "types": "./middleware.d.ts", - "default": "./build/esm/middleware.js" - }, - "require": { - "types": "./middleware.d.ts", - "default": "./build/cjs/middleware.js" - } - }, "./solidrouter": { "types": "./solidrouter.d.ts", "browser": { @@ -106,7 +95,7 @@ "build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch", "build:types:watch": "tsc -p tsconfig.types.json --watch", "build:tarball": "npm pack", - "circularDepCheck": "madge --circular src/index.client.ts && madge --circular src/index.server.ts && madge --circular src/index.types.ts && madge --circular src/solidrouter.client.ts && madge --circular src/solidrouter.server.ts && madge --circular src/solidrouter.ts && madge --circular src/middleware.ts", + "circularDepCheck": "madge --circular src/index.client.ts && madge --circular src/index.server.ts && madge --circular src/index.types.ts && madge --circular src/solidrouter.client.ts && madge --circular src/solidrouter.server.ts && madge --circular src/solidrouter.ts", "clean": "rimraf build coverage sentry-solidstart-*.tgz ./*.d.ts ./*.d.ts.map ./client ./server", "fix": "eslint . --format stylish --fix", "lint": "eslint . --format stylish", diff --git a/packages/solidstart/rollup.npm.config.mjs b/packages/solidstart/rollup.npm.config.mjs index 8e91d0371a27..b0087a93c6fe 100644 --- a/packages/solidstart/rollup.npm.config.mjs +++ b/packages/solidstart/rollup.npm.config.mjs @@ -12,7 +12,6 @@ export default makeNPMConfigVariants( 'src/solidrouter.server.ts', 'src/client/solidrouter.ts', 'src/server/solidrouter.ts', - 'src/middleware.ts', ], // prevent this internal code from ending up in our built package (this doesn't happen automatially because // the name doesn't match an SDK dependency) diff --git a/packages/solidstart/src/server/index.ts b/packages/solidstart/src/server/index.ts index 75a67d3bb847..c3499a82459a 100644 --- a/packages/solidstart/src/server/index.ts +++ b/packages/solidstart/src/server/index.ts @@ -128,3 +128,4 @@ export { withSentryErrorBoundary } from '@sentry/solid'; export { init } from './sdk'; export * from './withServerActionInstrumentation'; +export * from './middleware'; diff --git a/packages/solidstart/src/middleware.ts b/packages/solidstart/src/server/middleware.ts similarity index 100% rename from packages/solidstart/src/middleware.ts rename to packages/solidstart/src/server/middleware.ts diff --git a/packages/solidstart/test/middleware.test.ts b/packages/solidstart/test/server/middleware.test.ts similarity index 95% rename from packages/solidstart/test/middleware.test.ts rename to packages/solidstart/test/server/middleware.test.ts index c025dc38af97..c1d6ff644b9d 100644 --- a/packages/solidstart/test/middleware.test.ts +++ b/packages/solidstart/test/server/middleware.test.ts @@ -1,7 +1,7 @@ import * as SentryCore from '@sentry/core'; import { beforeEach, describe, it, vi } from 'vitest'; -import { sentryBeforeResponseMiddleware } from '../src/middleware'; -import type { ResponseMiddlewareResponse } from '../src/middleware'; +import { sentryBeforeResponseMiddleware } from '../../src/server'; +import type { ResponseMiddlewareResponse } from '../../src/server'; describe('middleware', () => { describe('sentryBeforeResponseMiddleware', () => { diff --git a/packages/solidstart/tsconfig.subexports-types.json b/packages/solidstart/tsconfig.subexports-types.json index 1c9daec11314..f800d830c511 100644 --- a/packages/solidstart/tsconfig.subexports-types.json +++ b/packages/solidstart/tsconfig.subexports-types.json @@ -15,7 +15,6 @@ "src/solidrouter.server.ts", "src/server/solidrouter.ts", "src/solidrouter.ts", - "src/middleware.ts", ], // Without this, we cannot output into the root dir "exclude": [] diff --git a/packages/solidstart/tsconfig.types.json b/packages/solidstart/tsconfig.types.json index bf2ca092abc1..51154c9c7878 100644 --- a/packages/solidstart/tsconfig.types.json +++ b/packages/solidstart/tsconfig.types.json @@ -15,6 +15,5 @@ "src/solidrouter.server.ts", "src/server/solidrouter.ts", "src/solidrouter.ts", - "src/middleware.ts", ] }