@sentry/solidstart 11.12.0 → 11.13.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.
Files changed (101) hide show
  1. package/build/cjs/_virtual/_rolldown/runtime.js +34 -0
  2. package/build/cjs/client/index.js +11 -18
  3. package/build/cjs/client/sdk.js +19 -20
  4. package/build/cjs/client/sdk.js.map +1 -1
  5. package/build/cjs/client/solidrouter.js +8 -16
  6. package/build/cjs/common/tunnel.js +11 -8
  7. package/build/cjs/common/tunnel.js.map +1 -1
  8. package/build/cjs/config/addInstrumentation.js +110 -111
  9. package/build/cjs/config/addInstrumentation.js.map +1 -1
  10. package/build/cjs/config/index.js +2 -0
  11. package/build/cjs/config/withSentry.js +86 -87
  12. package/build/cjs/config/withSentry.js.map +1 -1
  13. package/build/cjs/config/wrapServerEntryWithDynamicImport.js +139 -135
  14. package/build/cjs/config/wrapServerEntryWithDynamicImport.js.map +1 -1
  15. package/build/cjs/index.client.js +12 -18
  16. package/build/cjs/index.server.js +162 -159
  17. package/build/cjs/index.server.js.map +1 -1
  18. package/build/cjs/nitro/tunnelPlugin.js +12 -10
  19. package/build/cjs/nitro/tunnelPlugin.js.map +1 -1
  20. package/build/cjs/server/index.js +151 -158
  21. package/build/cjs/server/middleware.js +26 -37
  22. package/build/cjs/server/middleware.js.map +1 -1
  23. package/build/cjs/server/sdk.js +13 -14
  24. package/build/cjs/server/sdk.js.map +1 -1
  25. package/build/cjs/server/solidrouter.js +26 -18
  26. package/build/cjs/server/solidrouter.js.map +1 -1
  27. package/build/cjs/server/utils.js +32 -27
  28. package/build/cjs/server/utils.js.map +1 -1
  29. package/build/cjs/server/withServerActionInstrumentation.js +46 -49
  30. package/build/cjs/server/withServerActionInstrumentation.js.map +1 -1
  31. package/build/cjs/solidrouter.client.js +9 -16
  32. package/build/cjs/solidrouter.js +12 -18
  33. package/build/cjs/solidrouter.server.js +3 -8
  34. package/build/cjs/vite/buildInstrumentationFile.js +46 -46
  35. package/build/cjs/vite/buildInstrumentationFile.js.map +1 -1
  36. package/build/cjs/vite/index.js +5 -10
  37. package/build/cjs/vite/sentrySolidStart.js +86 -39
  38. package/build/cjs/vite/sentrySolidStart.js.map +1 -1
  39. package/build/cjs/vite/sentrySolidStartVite.js +32 -35
  40. package/build/cjs/vite/sentrySolidStartVite.js.map +1 -1
  41. package/build/cjs/vite/sourceMaps.js +117 -152
  42. package/build/cjs/vite/sourceMaps.js.map +1 -1
  43. package/build/esm/client/index.js +2 -3
  44. package/build/esm/client/sdk.js +19 -18
  45. package/build/esm/client/sdk.js.map +1 -1
  46. package/build/esm/client/solidrouter.js +1 -2
  47. package/build/esm/common/tunnel.js +11 -6
  48. package/build/esm/common/tunnel.js.map +1 -1
  49. package/build/esm/config/addInstrumentation.js +107 -109
  50. package/build/esm/config/addInstrumentation.js.map +1 -1
  51. package/build/esm/config/index.js +1 -0
  52. package/build/esm/config/withSentry.js +86 -84
  53. package/build/esm/config/withSentry.js.map +1 -1
  54. package/build/esm/config/wrapServerEntryWithDynamicImport.js +139 -133
  55. package/build/esm/config/wrapServerEntryWithDynamicImport.js.map +1 -1
  56. package/build/esm/index.client.js +3 -3
  57. package/build/esm/index.server.js +14 -10
  58. package/build/esm/index.server.js.map +1 -1
  59. package/build/esm/nitro/tunnelPlugin.js +12 -10
  60. package/build/esm/nitro/tunnelPlugin.js.map +1 -1
  61. package/build/esm/package.json +1 -1
  62. package/build/esm/server/index.js +7 -7
  63. package/build/esm/server/middleware.js +26 -35
  64. package/build/esm/server/middleware.js.map +1 -1
  65. package/build/esm/server/sdk.js +13 -12
  66. package/build/esm/server/sdk.js.map +1 -1
  67. package/build/esm/server/solidrouter.js +25 -16
  68. package/build/esm/server/solidrouter.js.map +1 -1
  69. package/build/esm/server/utils.js +32 -25
  70. package/build/esm/server/utils.js.map +1 -1
  71. package/build/esm/server/withServerActionInstrumentation.js +46 -47
  72. package/build/esm/server/withServerActionInstrumentation.js.map +1 -1
  73. package/build/esm/solidrouter.client.js +2 -2
  74. package/build/esm/solidrouter.js +3 -3
  75. package/build/esm/solidrouter.server.js +1 -2
  76. package/build/esm/vite/buildInstrumentationFile.js +43 -44
  77. package/build/esm/vite/buildInstrumentationFile.js.map +1 -1
  78. package/build/esm/vite/index.js +3 -3
  79. package/build/esm/vite/sentrySolidStart.js +86 -37
  80. package/build/esm/vite/sentrySolidStart.js.map +1 -1
  81. package/build/esm/vite/sentrySolidStartVite.js +32 -33
  82. package/build/esm/vite/sentrySolidStartVite.js.map +1 -1
  83. package/build/esm/vite/sourceMaps.js +117 -150
  84. package/build/esm/vite/sourceMaps.js.map +1 -1
  85. package/package.json +20 -20
  86. package/build/cjs/client/index.js.map +0 -1
  87. package/build/cjs/client/solidrouter.js.map +0 -1
  88. package/build/cjs/index.client.js.map +0 -1
  89. package/build/cjs/server/index.js.map +0 -1
  90. package/build/cjs/solidrouter.client.js.map +0 -1
  91. package/build/cjs/solidrouter.js.map +0 -1
  92. package/build/cjs/solidrouter.server.js.map +0 -1
  93. package/build/cjs/vite/index.js.map +0 -1
  94. package/build/esm/client/index.js.map +0 -1
  95. package/build/esm/client/solidrouter.js.map +0 -1
  96. package/build/esm/index.client.js.map +0 -1
  97. package/build/esm/server/index.js.map +0 -1
  98. package/build/esm/solidrouter.client.js.map +0 -1
  99. package/build/esm/solidrouter.js.map +0 -1
  100. package/build/esm/solidrouter.server.js.map +0 -1
  101. package/build/esm/vite/index.js.map +0 -1
@@ -1,52 +1,49 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const core = require('@sentry/core');
4
- const server = require('@sentry/core/server');
5
- const node = require('@sentry/node');
6
- const utils = require('./utils.js');
7
- const attributes = require('@sentry/conventions/attributes');
8
- const op = require('@sentry/conventions/op');
9
- const serverUtils = require('@sentry/server-utils');
10
-
1
+ const require_utils = require("./utils.js");
2
+ let _sentry_core = require("@sentry/core");
3
+ let _sentry_node = require("@sentry/node");
4
+ let _sentry_core_server = require("@sentry/core/server");
5
+ let _sentry_conventions_attributes = require("@sentry/conventions/attributes");
6
+ let _sentry_conventions_op = require("@sentry/conventions/op");
7
+ let _sentry_server_utils = require("@sentry/server-utils");
8
+ // src/server/withServerActionInstrumentation.ts
9
+ /**
10
+ * Wraps a server action (functions that use the 'use server' directive)
11
+ * function body with Sentry Error and Performance instrumentation.
12
+ */
11
13
  async function withServerActionInstrumentation(serverActionName, callback) {
12
- const activeSpan = node.getActiveSpan();
13
- if (activeSpan) {
14
- const spanData = node.spanToJSON(node.getRootSpan(activeSpan)).attributes;
15
- const requestPath = spanData?.[attributes.URL_PATH] ?? spanData?.[attributes.HTTP_TARGET];
16
- if (spanData && !spanData[attributes.HTTP_ROUTE] && requestPath === "/_server") {
17
- serverUtils.setHttpServerSpanRouteAttribute(serverActionName);
18
- }
19
- }
20
- try {
21
- return await node.startSpan(
22
- {
23
- name: serverActionName,
24
- attributes: {
25
- [attributes.SENTRY_OP]: op.FUNCTION,
26
- [attributes.CODE_FUNCTION_NAME]: serverActionName,
27
- [attributes.SENTRY_ORIGIN]: "auto.function.solidstart",
28
- [attributes.SENTRY_SEGMENT_NAME_SOURCE]: "component"
29
- }
30
- },
31
- async (span) => {
32
- const result = await core.handleCallbackErrors(callback, (error) => {
33
- if (!utils.isRedirect(error)) {
34
- span.setStatus({ code: core.SPAN_STATUS_ERROR, message: "internal_error" });
35
- node.captureException(error, {
36
- mechanism: {
37
- handled: false,
38
- type: "auto.function.solidstart"
39
- }
40
- });
41
- }
42
- });
43
- return result;
44
- }
45
- );
46
- } finally {
47
- await server.flushIfServerless();
48
- }
14
+ const activeSpan = (0, _sentry_node.getActiveSpan)();
15
+ if (activeSpan) {
16
+ const spanData = (0, _sentry_node.spanToJSON)((0, _sentry_node.getRootSpan)(activeSpan)).attributes;
17
+ const requestPath = spanData?.[_sentry_conventions_attributes.URL_PATH] ?? spanData?.[_sentry_conventions_attributes.HTTP_TARGET];
18
+ if (spanData && !spanData[_sentry_conventions_attributes.HTTP_ROUTE] && requestPath === "/_server") (0, _sentry_server_utils.setHttpServerSpanRouteAttribute)(serverActionName);
19
+ }
20
+ try {
21
+ return await (0, _sentry_node.startSpan)({
22
+ name: serverActionName,
23
+ attributes: {
24
+ [_sentry_conventions_attributes.SENTRY_OP]: _sentry_conventions_op.FUNCTION,
25
+ [_sentry_conventions_attributes.CODE_FUNCTION_NAME]: serverActionName,
26
+ [_sentry_conventions_attributes.SENTRY_ORIGIN]: "auto.function.solidstart",
27
+ [_sentry_conventions_attributes.SENTRY_SEGMENT_NAME_SOURCE]: "component"
28
+ }
29
+ }, async (span) => {
30
+ return await (0, _sentry_core.handleCallbackErrors)(callback, (error) => {
31
+ if (!require_utils.isRedirect(error)) {
32
+ span.setStatus({
33
+ code: _sentry_core.SPAN_STATUS_ERROR,
34
+ message: "internal_error"
35
+ });
36
+ (0, _sentry_node.captureException)(error, { mechanism: {
37
+ handled: false,
38
+ type: "auto.function.solidstart"
39
+ } });
40
+ }
41
+ });
42
+ });
43
+ } finally {
44
+ await (0, _sentry_core_server.flushIfServerless)();
45
+ }
49
46
  }
50
-
51
47
  exports.withServerActionInstrumentation = withServerActionInstrumentation;
52
- //# sourceMappingURL=withServerActionInstrumentation.js.map
48
+
49
+ //# sourceMappingURL=withServerActionInstrumentation.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"withServerActionInstrumentation.js","sources":["../../../src/server/withServerActionInstrumentation.ts"],"sourcesContent":["import { handleCallbackErrors, SPAN_STATUS_ERROR } from '@sentry/core';\nimport { flushIfServerless } from '@sentry/core/server';\nimport { captureException, getActiveSpan, getRootSpan, spanToJSON, startSpan } from '@sentry/node';\nimport { isRedirect } from './utils';\nimport {\n SENTRY_SEGMENT_NAME_SOURCE,\n CODE_FUNCTION_NAME,\n HTTP_ROUTE,\n HTTP_TARGET,\n SENTRY_OP,\n URL_PATH,\n SENTRY_ORIGIN,\n} from '@sentry/conventions/attributes';\nimport { FUNCTION } from '@sentry/conventions/op';\nimport { setHttpServerSpanRouteAttribute } from '@sentry/server-utils';\n\n/**\n * Wraps a server action (functions that use the 'use server' directive)\n * function body with Sentry Error and Performance instrumentation.\n */\nexport async function withServerActionInstrumentation<A extends (...args: unknown[]) => unknown>(\n serverActionName: string,\n callback: A,\n): Promise<ReturnType<A>> {\n const activeSpan = getActiveSpan();\n\n if (activeSpan) {\n // Read the request's `http.server` root span, which is the span we rename. The active span is\n // usually a framework handler span (e.g. Nitro's h3 `handler` span) without any URL attributes.\n const spanData = spanToJSON(getRootSpan(activeSpan)).attributes;\n\n // In solid start, server function calls are made to `/_server` which doesn't tell us\n // a lot. We rewrite the span's route to be that of the sever action name but only\n // if the target is `/_server`, otherwise we'd overwrite pageloads on routes that use\n // server actions (which are more meaningful, e.g. a request to `GET /users/5` is more\n // meaningful than overwriting it with `GET doSomeFunctionCall`).\n // `@sentry/node` HTTP spans only carry `url.path`; the deprecated `http.target` is kept as a\n // fallback for instrumentation that still sets only that.\n // oxlint-disable-next-line typescript/no-deprecated\n const requestPath = spanData?.[URL_PATH] ?? spanData?.[HTTP_TARGET];\n\n if (spanData && !spanData[HTTP_ROUTE] && requestPath === '/_server') {\n setHttpServerSpanRouteAttribute(serverActionName);\n }\n }\n\n try {\n return await startSpan(\n {\n name: serverActionName,\n attributes: {\n [SENTRY_OP]: FUNCTION,\n [CODE_FUNCTION_NAME]: serverActionName,\n [SENTRY_ORIGIN]: 'auto.function.solidstart',\n [SENTRY_SEGMENT_NAME_SOURCE]: 'component',\n },\n },\n async span => {\n // oxlint-disable-next-line typescript/await-thenable -- callback may be async at runtime\n const result = await handleCallbackErrors(callback, error => {\n if (!isRedirect(error)) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n captureException(error, {\n mechanism: {\n handled: false,\n type: 'auto.function.solidstart',\n },\n });\n }\n });\n\n return result;\n },\n );\n } finally {\n await flushIfServerless();\n }\n}\n"],"names":["getActiveSpan","spanToJSON","getRootSpan","URL_PATH","HTTP_TARGET","HTTP_ROUTE","setHttpServerSpanRouteAttribute","startSpan","SENTRY_OP","FUNCTION","CODE_FUNCTION_NAME","SENTRY_ORIGIN","SENTRY_SEGMENT_NAME_SOURCE","handleCallbackErrors","isRedirect","SPAN_STATUS_ERROR","captureException","flushIfServerless"],"mappings":";;;;;;;;;;AAoBA,eAAsB,+BAAA,CACpB,kBACA,QAAA,EACwB;AACxB,EAAA,MAAM,aAAaA,kBAAA,EAAc;AAEjC,EAAA,IAAI,UAAA,EAAY;AAGd,IAAA,MAAM,QAAA,GAAWC,eAAA,CAAWC,gBAAA,CAAY,UAAU,CAAC,CAAA,CAAE,UAAA;AAUrD,IAAA,MAAM,WAAA,GAAc,QAAA,GAAWC,mBAAQ,CAAA,IAAK,WAAWC,sBAAW,CAAA;AAElE,IAAA,IAAI,YAAY,CAAC,QAAA,CAASC,qBAAU,CAAA,IAAK,gBAAgB,UAAA,EAAY;AACnE,MAAAC,2CAAA,CAAgC,gBAAgB,CAAA;AAAA,IAClD;AAAA,EACF;AAEA,EAAA,IAAI;AACF,IAAA,OAAO,MAAMC,cAAA;AAAA,MACX;AAAA,QACE,IAAA,EAAM,gBAAA;AAAA,QACN,UAAA,EAAY;AAAA,UACV,CAACC,oBAAS,GAAGC,WAAA;AAAA,UACb,CAACC,6BAAkB,GAAG,gBAAA;AAAA,UACtB,CAACC,wBAAa,GAAG,0BAAA;AAAA,UACjB,CAACC,qCAA0B,GAAG;AAAA;AAChC,OACF;AAAA,MACA,OAAM,IAAA,KAAQ;AAEZ,QAAA,MAAM,MAAA,GAAS,MAAMC,yBAAA,CAAqB,QAAA,EAAU,CAAA,KAAA,KAAS;AAC3D,UAAA,IAAI,CAACC,gBAAA,CAAW,KAAK,CAAA,EAAG;AACtB,YAAA,IAAA,CAAK,UAAU,EAAE,IAAA,EAAMC,sBAAA,EAAmB,OAAA,EAAS,kBAAkB,CAAA;AACrE,YAAAC,qBAAA,CAAiB,KAAA,EAAO;AAAA,cACtB,SAAA,EAAW;AAAA,gBACT,OAAA,EAAS,KAAA;AAAA,gBACT,IAAA,EAAM;AAAA;AACR,aACD,CAAA;AAAA,UACH;AAAA,QACF,CAAC,CAAA;AAED,QAAA,OAAO,MAAA;AAAA,MACT;AAAA,KACF;AAAA,EACF,CAAA,SAAE;AACA,IAAA,MAAMC,wBAAA,EAAkB;AAAA,EAC1B;AACF;;;;"}
1
+ {"version":3,"file":"withServerActionInstrumentation.js","names":["getActiveSpan","spanToJSON","getRootSpan","URL_PATH","HTTP_TARGET","HTTP_ROUTE","setHttpServerSpanRouteAttribute","startSpan","SENTRY_OP","FUNCTION","CODE_FUNCTION_NAME","SENTRY_ORIGIN","SENTRY_SEGMENT_NAME_SOURCE","handleCallbackErrors","isRedirect","SPAN_STATUS_ERROR","captureException","flushIfServerless"],"sources":["../../../src/server/withServerActionInstrumentation.ts"],"sourcesContent":["import { handleCallbackErrors, SPAN_STATUS_ERROR } from '@sentry/core';\nimport { flushIfServerless } from '@sentry/core/server';\nimport { captureException, getActiveSpan, getRootSpan, spanToJSON, startSpan } from '@sentry/node';\nimport { isRedirect } from './utils';\nimport {\n SENTRY_SEGMENT_NAME_SOURCE,\n CODE_FUNCTION_NAME,\n HTTP_ROUTE,\n HTTP_TARGET,\n SENTRY_OP,\n URL_PATH,\n SENTRY_ORIGIN,\n} from '@sentry/conventions/attributes';\nimport { FUNCTION } from '@sentry/conventions/op';\nimport { setHttpServerSpanRouteAttribute } from '@sentry/server-utils';\n\n/**\n * Wraps a server action (functions that use the 'use server' directive)\n * function body with Sentry Error and Performance instrumentation.\n */\nexport async function withServerActionInstrumentation<A extends (...args: unknown[]) => unknown>(\n serverActionName: string,\n callback: A,\n): Promise<ReturnType<A>> {\n const activeSpan = getActiveSpan();\n\n if (activeSpan) {\n // Read the request's `http.server` root span, which is the span we rename. The active span is\n // usually a framework handler span (e.g. Nitro's h3 `handler` span) without any URL attributes.\n const spanData = spanToJSON(getRootSpan(activeSpan)).attributes;\n\n // In solid start, server function calls are made to `/_server` which doesn't tell us\n // a lot. We rewrite the span's route to be that of the sever action name but only\n // if the target is `/_server`, otherwise we'd overwrite pageloads on routes that use\n // server actions (which are more meaningful, e.g. a request to `GET /users/5` is more\n // meaningful than overwriting it with `GET doSomeFunctionCall`).\n // `@sentry/node` HTTP spans only carry `url.path`; the deprecated `http.target` is kept as a\n // fallback for instrumentation that still sets only that.\n // oxlint-disable-next-line typescript/no-deprecated\n const requestPath = spanData?.[URL_PATH] ?? spanData?.[HTTP_TARGET];\n\n if (spanData && !spanData[HTTP_ROUTE] && requestPath === '/_server') {\n setHttpServerSpanRouteAttribute(serverActionName);\n }\n }\n\n try {\n return await startSpan(\n {\n name: serverActionName,\n attributes: {\n [SENTRY_OP]: FUNCTION,\n [CODE_FUNCTION_NAME]: serverActionName,\n [SENTRY_ORIGIN]: 'auto.function.solidstart',\n [SENTRY_SEGMENT_NAME_SOURCE]: 'component',\n },\n },\n async span => {\n // oxlint-disable-next-line typescript/await-thenable -- callback may be async at runtime\n const result = await handleCallbackErrors(callback, error => {\n if (!isRedirect(error)) {\n span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });\n captureException(error, {\n mechanism: {\n handled: false,\n type: 'auto.function.solidstart',\n },\n });\n }\n });\n\n return result;\n },\n );\n } finally {\n await flushIfServerless();\n }\n}\n"],"mappings":";;;;;;;;;;;;AAoBA,eAAsB,gCACpB,kBACA,UACwB;CACxB,MAAM,cAAA,GAAaA,aAAAA,cAAAA,CAAc;CAEjC,IAAI,YAAY;EAGd,MAAM,YAAA,GAAWC,aAAAA,WAAAA,EAAAA,GAAWC,aAAAA,YAAAA,CAAY,UAAU,CAAC,CAAC,CAAC;EAUrD,MAAM,cAAc,WAAWC,+BAAAA,aAAa,WAAWC,+BAAAA;EAEvD,IAAI,YAAY,CAAC,SAASC,+BAAAA,eAAe,gBAAgB,YACvDC,CAAAA,GAAAA,qBAAAA,gCAAAA,CAAgC,gBAAgB;CAEpD;CAEA,IAAI;EACF,OAAO,OAAA,GAAMC,aAAAA,UAAAA,CACX;GACE,MAAM;GACN,YAAY;KACTC,+BAAAA,YAAYC,uBAAAA;KACZC,+BAAAA,qBAAqB;KACrBC,+BAAAA,gBAAgB;KAChBC,+BAAAA,6BAA6B;GAChC;EACF,GACA,OAAM,SAAQ;GAcZ,OAAO,OAAA,GAZcC,aAAAA,qBAAAA,CAAqB,WAAU,UAAS;IAC3D,IAAI,CAACC,cAAAA,WAAW,KAAK,GAAG;KACtB,KAAK,UAAU;MAAE,MAAMC,aAAAA;MAAmB,SAAS;KAAiB,CAAC;KACrEC,CAAAA,GAAAA,aAAAA,iBAAAA,CAAiB,OAAO,EACtB,WAAW;MACT,SAAS;MACT,MAAM;KACR,EACF,CAAC;IACH;GACF,CAAC;EAGH,CACF;CACF,UAAU;EACR,OAAA,GAAMC,oBAAAA,kBAAAA,CAAkB;CAC1B;AACF"}
@@ -1,17 +1,10 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const solidrouter = require('@sentry/solid/solidrouter');
4
-
5
-
6
-
7
- Object.prototype.hasOwnProperty.call(solidrouter, '__proto__') &&
8
- !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
9
- Object.defineProperty(exports, '__proto__', {
10
- enumerable: true,
11
- value: solidrouter['__proto__']
12
- });
13
-
14
- Object.keys(solidrouter).forEach(function (k) {
15
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = solidrouter[k];
1
+ require("./_virtual/_rolldown/runtime.js");
2
+ require("./client/solidrouter.js");
3
+ var _sentry_solid_solidrouter = require("@sentry/solid/solidrouter");
4
+ Object.prototype.hasOwnProperty.call(_sentry_solid_solidrouter, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
5
+ enumerable: true,
6
+ value: _sentry_solid_solidrouter["__proto__"]
7
+ });
8
+ Object.keys(_sentry_solid_solidrouter).forEach(function(k) {
9
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = _sentry_solid_solidrouter[k];
16
10
  });
17
- //# sourceMappingURL=solidrouter.client.js.map
@@ -1,19 +1,13 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const solidrouter = require('@sentry/solid/solidrouter');
4
- const solidrouter$1 = require('./server/solidrouter.js');
5
-
6
-
7
-
8
- exports.withSentryRouterRouting = solidrouter$1.withSentryRouterRouting;
9
- Object.prototype.hasOwnProperty.call(solidrouter, '__proto__') &&
10
- !Object.prototype.hasOwnProperty.call(exports, '__proto__') &&
11
- Object.defineProperty(exports, '__proto__', {
12
- enumerable: true,
13
- value: solidrouter['__proto__']
14
- });
15
-
16
- Object.keys(solidrouter).forEach(function (k) {
17
- if (k !== 'default' && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = solidrouter[k];
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ require("./_virtual/_rolldown/runtime.js");
3
+ require("./client/solidrouter.js");
4
+ const require_solidrouter$1 = require("./server/solidrouter.js");
5
+ exports.withSentryRouterRouting = require_solidrouter$1.withSentryRouterRouting;
6
+ var _sentry_solid_solidrouter = require("@sentry/solid/solidrouter");
7
+ Object.prototype.hasOwnProperty.call(_sentry_solid_solidrouter, "__proto__") && !Object.prototype.hasOwnProperty.call(exports, "__proto__") && Object.defineProperty(exports, "__proto__", {
8
+ enumerable: true,
9
+ value: _sentry_solid_solidrouter["__proto__"]
10
+ });
11
+ Object.keys(_sentry_solid_solidrouter).forEach(function(k) {
12
+ if (k !== "default" && !Object.prototype.hasOwnProperty.call(exports, k)) exports[k] = _sentry_solid_solidrouter[k];
18
13
  });
19
- //# sourceMappingURL=solidrouter.js.map
@@ -1,8 +1,3 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const solidrouter = require('./server/solidrouter.js');
4
-
5
-
6
-
7
- exports.withSentryRouterRouting = solidrouter.withSentryRouterRouting;
8
- //# sourceMappingURL=solidrouter.server.js.map
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_solidrouter = require("./server/solidrouter.js");
3
+ exports.withSentryRouterRouting = require_solidrouter.withSentryRouterRouting;
@@ -1,49 +1,49 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const core = require('@sentry/core');
4
- const fs = require('fs');
5
- const path = require('path');
6
-
1
+ const require_runtime = require("../_virtual/_rolldown/runtime.js");
2
+ let _sentry_core = require("@sentry/core");
3
+ let fs = require("fs");
4
+ fs = require_runtime.__toESM(fs);
5
+ let path = require("path");
6
+ path = require_runtime.__toESM(path);
7
+ // src/vite/buildInstrumentationFile.ts
8
+ /**
9
+ * A Sentry plugin for SolidStart to build the server
10
+ * `instrument.server.ts` file.
11
+ */
7
12
  function makeBuildInstrumentationFilePlugin(options = {}) {
8
- return {
9
- name: "sentry-solidstart-build-instrumentation-file",
10
- apply: "build",
11
- enforce: "post",
12
- async config(config, { command }) {
13
- const instrumentationFilePath = options.instrumentation || "./src/instrument.server.ts";
14
- const router = config.router;
15
- const { rollupOptions, rolldownOptions, ...build } = config.build || {};
16
- const bundlerOptionsKey = rolldownOptions ? "rolldownOptions" : "rollupOptions";
17
- const bundlerOptions = rolldownOptions || rollupOptions || {};
18
- const input = [...bundlerOptions.input || []];
19
- if (command !== "build" || router.target !== "server" || router.name === "server-fns") {
20
- return config;
21
- }
22
- try {
23
- await fs.promises.access(instrumentationFilePath, fs.constants.F_OK);
24
- } catch (error) {
25
- core.consoleSandbox(() => {
26
- console.warn(
27
- `[Sentry SolidStart Plugin] Could not access \`${instrumentationFilePath}\`, please make sure it exists.`,
28
- error
29
- );
30
- });
31
- return config;
32
- }
33
- input.push(path.resolve(router.root, instrumentationFilePath));
34
- return {
35
- ...config,
36
- build: {
37
- ...build,
38
- [bundlerOptionsKey]: {
39
- ...bundlerOptions,
40
- input
41
- }
42
- }
43
- };
44
- }
45
- };
13
+ return {
14
+ name: "sentry-solidstart-build-instrumentation-file",
15
+ apply: "build",
16
+ enforce: "post",
17
+ async config(config, { command }) {
18
+ const instrumentationFilePath = options.instrumentation || "./src/instrument.server.ts";
19
+ const router = config.router;
20
+ const { rollupOptions, rolldownOptions, ...build } = config.build || {};
21
+ const bundlerOptionsKey = rolldownOptions ? "rolldownOptions" : "rollupOptions";
22
+ const bundlerOptions = rolldownOptions || rollupOptions || {};
23
+ const input = [...bundlerOptions.input || []];
24
+ if (command !== "build" || router.target !== "server" || router.name === "server-fns") return config;
25
+ try {
26
+ await fs.promises.access(instrumentationFilePath, fs.constants.F_OK);
27
+ } catch (error) {
28
+ (0, _sentry_core.consoleSandbox)(() => {
29
+ console.warn(`[Sentry SolidStart Plugin] Could not access \`${instrumentationFilePath}\`, please make sure it exists.`, error);
30
+ });
31
+ return config;
32
+ }
33
+ input.push(path.resolve(router.root, instrumentationFilePath));
34
+ return {
35
+ ...config,
36
+ build: {
37
+ ...build,
38
+ [bundlerOptionsKey]: {
39
+ ...bundlerOptions,
40
+ input
41
+ }
42
+ }
43
+ };
44
+ }
45
+ };
46
46
  }
47
-
48
47
  exports.makeBuildInstrumentationFilePlugin = makeBuildInstrumentationFilePlugin;
49
- //# sourceMappingURL=buildInstrumentationFile.js.map
48
+
49
+ //# sourceMappingURL=buildInstrumentationFile.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"buildInstrumentationFile.js","sources":["../../../src/vite/buildInstrumentationFile.ts"],"sourcesContent":["import { consoleSandbox } from '@sentry/core';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport type { Plugin, UserConfig } from 'vite';\nimport type { SentrySolidStartPluginOptions } from './types';\n\n/**\n * A Sentry plugin for SolidStart to build the server\n * `instrument.server.ts` file.\n */\nexport function makeBuildInstrumentationFilePlugin(options: SentrySolidStartPluginOptions = {}): Plugin {\n return {\n name: 'sentry-solidstart-build-instrumentation-file',\n apply: 'build',\n enforce: 'post',\n async config(config: UserConfig, { command }) {\n const instrumentationFilePath = options.instrumentation || './src/instrument.server.ts';\n const router = (config as UserConfig & { router: { target: string; name: string; root: string } }).router;\n // `rollupOptions` is a deprecated alias of `rolldownOptions` in Vite 8+, but the only option in older Vite.\n // Returning both makes Vite 8 ignore `rollupOptions`, so only write back the one that is in use.\n // oxlint-disable-next-line typescript/no-deprecated\n const { rollupOptions, rolldownOptions, ...build } = config.build || {};\n const bundlerOptionsKey = rolldownOptions ? 'rolldownOptions' : 'rollupOptions';\n const bundlerOptions = rolldownOptions || rollupOptions || {};\n const input = [...((bundlerOptions.input || []) as string[])];\n\n // plugin runs for client, server and sever-fns, we only want to run it for the server once.\n if (command !== 'build' || router.target !== 'server' || router.name === 'server-fns') {\n return config;\n }\n\n try {\n await fs.promises.access(instrumentationFilePath, fs.constants.F_OK);\n } catch (error) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry SolidStart Plugin] Could not access \\`${instrumentationFilePath}\\`, please make sure it exists.`,\n error,\n );\n });\n return config;\n }\n\n input.push(path.resolve(router.root, instrumentationFilePath));\n\n return {\n ...config,\n build: {\n ...build,\n [bundlerOptionsKey]: {\n ...bundlerOptions,\n input,\n },\n },\n };\n },\n };\n}\n"],"names":["consoleSandbox"],"mappings":";;;;;;AAUO,SAAS,kCAAA,CAAmC,OAAA,GAAyC,EAAC,EAAW;AACtG,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,8CAAA;AAAA,IACN,KAAA,EAAO,OAAA;AAAA,IACP,OAAA,EAAS,MAAA;AAAA,IACT,MAAM,MAAA,CAAO,MAAA,EAAoB,EAAE,SAAQ,EAAG;AAC5C,MAAA,MAAM,uBAAA,GAA0B,QAAQ,eAAA,IAAmB,4BAAA;AAC3D,MAAA,MAAM,SAAU,MAAA,CAAmF,MAAA;AAInG,MAAA,MAAM,EAAE,eAAe,eAAA,EAAiB,GAAG,OAAM,GAAI,MAAA,CAAO,SAAS,EAAC;AACtE,MAAA,MAAM,iBAAA,GAAoB,kBAAkB,iBAAA,GAAoB,eAAA;AAChE,MAAA,MAAM,cAAA,GAAiB,eAAA,IAAmB,aAAA,IAAiB,EAAC;AAC5D,MAAA,MAAM,QAAQ,CAAC,GAAK,cAAA,CAAe,KAAA,IAAS,EAAgB,CAAA;AAG5D,MAAA,IAAI,YAAY,OAAA,IAAW,MAAA,CAAO,WAAW,QAAA,IAAY,MAAA,CAAO,SAAS,YAAA,EAAc;AACrF,QAAA,OAAO,MAAA;AAAA,MACT;AAEA,MAAA,IAAI;AACF,QAAA,MAAM,GAAG,QAAA,CAAS,MAAA,CAAO,uBAAA,EAAyB,EAAA,CAAG,UAAU,IAAI,CAAA;AAAA,MACrE,SAAS,KAAA,EAAO;AACd,QAAAA,mBAAA,CAAe,MAAM;AAEnB,UAAA,OAAA,CAAQ,IAAA;AAAA,YACN,iDAAiD,uBAAuB,CAAA,+BAAA,CAAA;AAAA,YACxE;AAAA,WACF;AAAA,QACF,CAAC,CAAA;AACD,QAAA,OAAO,MAAA;AAAA,MACT;AAEA,MAAA,KAAA,CAAM,KAAK,IAAA,CAAK,OAAA,CAAQ,MAAA,CAAO,IAAA,EAAM,uBAAuB,CAAC,CAAA;AAE7D,MAAA,OAAO;AAAA,QACL,GAAG,MAAA;AAAA,QACH,KAAA,EAAO;AAAA,UACL,GAAG,KAAA;AAAA,UACH,CAAC,iBAAiB,GAAG;AAAA,YACnB,GAAG,cAAA;AAAA,YACH;AAAA;AACF;AACF,OACF;AAAA,IACF;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"buildInstrumentationFile.js","names":["consoleSandbox"],"sources":["../../../src/vite/buildInstrumentationFile.ts"],"sourcesContent":["import { consoleSandbox } from '@sentry/core';\nimport * as fs from 'fs';\nimport * as path from 'path';\nimport type { Plugin, UserConfig } from 'vite';\nimport type { SentrySolidStartPluginOptions } from './types';\n\n/**\n * A Sentry plugin for SolidStart to build the server\n * `instrument.server.ts` file.\n */\nexport function makeBuildInstrumentationFilePlugin(options: SentrySolidStartPluginOptions = {}): Plugin {\n return {\n name: 'sentry-solidstart-build-instrumentation-file',\n apply: 'build',\n enforce: 'post',\n async config(config: UserConfig, { command }) {\n const instrumentationFilePath = options.instrumentation || './src/instrument.server.ts';\n const router = (config as UserConfig & { router: { target: string; name: string; root: string } }).router;\n // `rollupOptions` is a deprecated alias of `rolldownOptions` in Vite 8+, but the only option in older Vite.\n // Returning both makes Vite 8 ignore `rollupOptions`, so only write back the one that is in use.\n // oxlint-disable-next-line typescript/no-deprecated\n const { rollupOptions, rolldownOptions, ...build } = config.build || {};\n const bundlerOptionsKey = rolldownOptions ? 'rolldownOptions' : 'rollupOptions';\n const bundlerOptions = rolldownOptions || rollupOptions || {};\n const input = [...((bundlerOptions.input || []) as string[])];\n\n // plugin runs for client, server and sever-fns, we only want to run it for the server once.\n if (command !== 'build' || router.target !== 'server' || router.name === 'server-fns') {\n return config;\n }\n\n try {\n await fs.promises.access(instrumentationFilePath, fs.constants.F_OK);\n } catch (error) {\n consoleSandbox(() => {\n // eslint-disable-next-line no-console\n console.warn(\n `[Sentry SolidStart Plugin] Could not access \\`${instrumentationFilePath}\\`, please make sure it exists.`,\n error,\n );\n });\n return config;\n }\n\n input.push(path.resolve(router.root, instrumentationFilePath));\n\n return {\n ...config,\n build: {\n ...build,\n [bundlerOptionsKey]: {\n ...bundlerOptions,\n input,\n },\n },\n };\n },\n };\n}\n"],"mappings":";;;;;;;;;;;AAUA,SAAgB,mCAAmC,UAAyC,CAAC,GAAW;CACtG,OAAO;EACL,MAAM;EACN,OAAO;EACP,SAAS;EACT,MAAM,OAAO,QAAoB,EAAE,WAAW;GAC5C,MAAM,0BAA0B,QAAQ,mBAAmB;GAC3D,MAAM,SAAU,OAAmF;GAInG,MAAM,EAAE,eAAe,iBAAiB,GAAG,UAAU,OAAO,SAAS,CAAC;GACtE,MAAM,oBAAoB,kBAAkB,oBAAoB;GAChE,MAAM,iBAAiB,mBAAmB,iBAAiB,CAAC;GAC5D,MAAM,QAAQ,CAAC,GAAK,eAAe,SAAS,CAAC,CAAe;GAG5D,IAAI,YAAY,WAAW,OAAO,WAAW,YAAY,OAAO,SAAS,cACvE,OAAO;GAGT,IAAI;IACF,MAAM,GAAG,SAAS,OAAO,yBAAyB,GAAG,UAAU,IAAI;GACrE,SAAS,OAAO;IACdA,CAAAA,GAAAA,aAAAA,eAAAA,OAAqB;KAEnB,QAAQ,KACN,iDAAiD,wBAAwB,kCACzE,KACF;IACF,CAAC;IACD,OAAO;GACT;GAEA,MAAM,KAAK,KAAK,QAAQ,OAAO,MAAM,uBAAuB,CAAC;GAE7D,OAAO;IACL,GAAG;IACH,OAAO;KACL,GAAG;MACF,oBAAoB;MACnB,GAAG;MACH;KACF;IACF;GACF;EACF;CACF;AACF"}
@@ -1,10 +1,5 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const sentrySolidStart = require('./sentrySolidStart.js');
4
- const withSentry = require('../config/withSentry.js');
5
-
6
-
7
-
8
- exports.sentrySolidStart = sentrySolidStart.sentrySolidStart;
9
- exports.withSentry = withSentry.withSentry;
10
- //# sourceMappingURL=index.js.map
1
+ Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
2
+ const require_sentrySolidStart = require("./sentrySolidStart.js");
3
+ const require_withSentry = require("../config/withSentry.js");
4
+ exports.sentrySolidStart = require_sentrySolidStart.sentrySolidStart;
5
+ exports.withSentry = require_withSentry.withSentry;
@@ -1,44 +1,91 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const core = require('@sentry/core');
4
- const nitro = require('@sentry/nitro');
5
- const vite = require('@sentry/server-utils/orchestrion/vite');
6
- const sourceMaps = require('./sourceMaps.js');
7
-
1
+ const require_sourceMaps = require("./sourceMaps.js");
2
+ let _sentry_core = require("@sentry/core");
3
+ let _sentry_nitro = require("@sentry/nitro");
4
+ let _sentry_server_utils_orchestrion_vite = require("@sentry/server-utils/orchestrion/vite");
5
+ // src/vite/sentrySolidStart.ts
6
+ /**
7
+ * Vite plugins for the Sentry SolidStart SDK. Requires SolidStart 2.
8
+ *
9
+ * On SolidStart 1, use `withSentry` in `app.config.ts` instead.
10
+ *
11
+ * @example
12
+ * ```typescript
13
+ * // vite.config.ts
14
+ * import { sentrySolidStart } from '@sentry/solidstart/vite';
15
+ * import { solidStart } from '@solidjs/start/config';
16
+ * import { nitro } from 'nitro/vite';
17
+ * import { defineConfig } from 'vite';
18
+ *
19
+ * export default defineConfig({
20
+ * plugins: [
21
+ * solidStart(),
22
+ * sentrySolidStart({
23
+ * org: 'your-org',
24
+ * project: 'your-project',
25
+ * }),
26
+ * nitro(),
27
+ * ],
28
+ * });
29
+ * ```
30
+ *
31
+ * @param options - Options to configure the Sentry Vite plugins
32
+ * @returns An array of Vite plugins
33
+ */
8
34
  function sentrySolidStart(options = {}) {
9
- core.warnOnRemovedBuildOptions(options, ["unstable_sentryVitePluginOptions"]);
10
- const plugins = [makeSentryNitroPlugin(options)];
11
- if (process.env.NODE_ENV === "development") {
12
- return plugins;
13
- }
14
- plugins.push(vite.sentryOrchestrionPlugin({ buildTimeInstrumentation: options.buildTimeInstrumentation }));
15
- if (options.sourcemaps?.disable !== true) {
16
- plugins.push(...sourceMaps.makeAddSentryVitePluginSolidStart2(options), ...sourceMaps.makeEnableSourceMapsVitePlugin(options));
17
- }
18
- return plugins;
35
+ (0, _sentry_core.warnOnRemovedBuildOptions)(options, ["unstable_sentryVitePluginOptions"]);
36
+ const plugins = [makeSentryNitroPlugin(options), makeServerEntryPlugin()];
37
+ if (process.env.NODE_ENV === "development") return plugins;
38
+ plugins.push((0, _sentry_server_utils_orchestrion_vite.sentryOrchestrionPlugin)({ buildTimeInstrumentation: options.buildTimeInstrumentation }));
39
+ if (options.sourcemaps?.disable !== true) plugins.push(...require_sourceMaps.makeAddSentryVitePluginSolidStart2(options), ...require_sourceMaps.makeEnableSourceMapsVitePlugin(options));
40
+ return plugins;
41
+ }
42
+ const SERVER_RUNTIME_CONDITION = "sentry-solidstart-runtime";
43
+ /**
44
+ * Resolves `@sentry/solidstart` in server environments to the entry without the deprecated SolidStart 1
45
+ * `withSentry`. Its build-time imports (Sentry CLI, oxc-parser) otherwise end up in the server output:
46
+ * Nitro traces their native files, and Rolldown still emits the CLI's dynamic-import chunks after
47
+ * tree-shaking the code that imports them.
48
+ */
49
+ function makeServerEntryPlugin() {
50
+ return {
51
+ name: "sentry-solidstart-server-entry",
52
+ configEnvironment(name, config) {
53
+ if (name === "client" || config.consumer === "client" || !config.resolve?.conditions) return;
54
+ return { resolve: { conditions: [SERVER_RUNTIME_CONDITION] } };
55
+ }
56
+ };
19
57
  }
58
+ /**
59
+ * Delivers everything only Nitro can reach — server source maps, runtime hooks, the
60
+ * `sourcemapMinify` opt-out — through Vite's `nitro` key, and the app's base path to the browser SDK.
61
+ *
62
+ * `setupSentryNitroModule` is handed only the keys it reads, never the user's whole config, so what
63
+ * comes back is purely Sentry's additions. Vite concatenates arrays when merging a `config` return
64
+ * value, so echoing the user's own `modules`/`plugins` back would duplicate every entry.
65
+ *
66
+ * `enforce: 'pre'` is load-bearing: Nitro creates its instance inside its own `config` hook, so a
67
+ * normal-priority hook sorting after it would be read too late and silently ignored.
68
+ */
20
69
  function makeSentryNitroPlugin(options) {
21
- return {
22
- name: "sentry-solidstart-nitro",
23
- enforce: "pre",
24
- config(userConfig) {
25
- const userNitro = userConfig.nitro;
26
- const tunnelBasePath = core._INTERNAL_normalizeTunnelBasePath(userConfig.server?.baseURL || userConfig.base);
27
- return {
28
- define: { __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__: JSON.stringify(tunnelBasePath) },
29
- nitro: {
30
- ...nitro.setupSentryNitroModule(
31
- // `sourcemap` decides whether Sentry enables its own; `tracingChannel` is left as the user set it.
32
- { sourcemap: userNitro?.sourcemap, tracingChannel: userNitro?.tracingChannel },
33
- options
34
- ),
35
- // `@sentry/nitro` serves the tunnel under this instead of Nitro's `baseURL`.
36
- ...tunnelBasePath && { runtimeConfig: { sentryTunnelBasePath: tunnelBasePath } }
37
- }
38
- };
39
- }
40
- };
70
+ return {
71
+ name: "sentry-solidstart-nitro",
72
+ enforce: "pre",
73
+ config(userConfig) {
74
+ const userNitro = userConfig.nitro;
75
+ const tunnelBasePath = (0, _sentry_core._INTERNAL_normalizeTunnelBasePath)(userConfig.server?.baseURL || userConfig.base);
76
+ return {
77
+ define: { __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__: JSON.stringify(tunnelBasePath) },
78
+ nitro: {
79
+ ...(0, _sentry_nitro.setupSentryNitroModule)({
80
+ sourcemap: userNitro?.sourcemap,
81
+ tracingChannel: userNitro?.tracingChannel
82
+ }, options),
83
+ ...tunnelBasePath && { runtimeConfig: { sentryTunnelBasePath: tunnelBasePath } }
84
+ }
85
+ };
86
+ }
87
+ };
41
88
  }
42
-
43
89
  exports.sentrySolidStart = sentrySolidStart;
44
- //# sourceMappingURL=sentrySolidStart.js.map
90
+
91
+ //# sourceMappingURL=sentrySolidStart.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sentrySolidStart.js","sources":["../../../src/vite/sentrySolidStart.ts"],"sourcesContent":["import {\n type BuildTimeOptionsBase,\n _INTERNAL_normalizeTunnelBasePath as normalizeTunnelBasePath,\n warnOnRemovedBuildOptions,\n} from '@sentry/core';\nimport { setupSentryNitroModule } from '@sentry/nitro';\nimport { sentryOrchestrionPlugin } from '@sentry/server-utils/orchestrion/vite';\nimport type { Plugin, UserConfig } from 'vite';\nimport { makeAddSentryVitePluginSolidStart2, makeEnableSourceMapsVitePlugin } from './sourceMaps';\n\n/**\n * Build-time options for the Sentry SolidStart SDK on SolidStart 2.\n */\nexport type SentrySolidStartOptions = BuildTimeOptionsBase;\n\n/**\n * Vite plugins for the Sentry SolidStart SDK. Requires SolidStart 2.\n *\n * On SolidStart 1, use `withSentry` in `app.config.ts` instead.\n *\n * @example\n * ```typescript\n * // vite.config.ts\n * import { sentrySolidStart } from '@sentry/solidstart/vite';\n * import { solidStart } from '@solidjs/start/config';\n * import { nitro } from 'nitro/vite';\n * import { defineConfig } from 'vite';\n *\n * export default defineConfig({\n * plugins: [\n * solidStart(),\n * sentrySolidStart({\n * org: 'your-org',\n * project: 'your-project',\n * }),\n * nitro(),\n * ],\n * });\n * ```\n *\n * @param options - Options to configure the Sentry Vite plugins\n * @returns An array of Vite plugins\n */\nexport function sentrySolidStart(options: SentrySolidStartOptions = {}): Plugin[] {\n warnOnRemovedBuildOptions(options, ['unstable_sentryVitePluginOptions']);\n\n const plugins: Plugin[] = [makeSentryNitroPlugin(options)];\n\n // Only the Nitro plugin is dev-safe; its module handles `dev` itself.\n if (process.env.NODE_ENV === 'development') {\n return plugins;\n }\n\n // Injects `diagnostics_channel` publishers into instrumented deps at build time, which is what\n // lets `Sentry.init()` run from a bundled Nitro plugin rather than an `--import` preload.\n plugins.push(sentryOrchestrionPlugin({ buildTimeInstrumentation: options.buildTimeInstrumentation }));\n\n if (options.sourcemaps?.disable !== true) {\n plugins.push(...makeAddSentryVitePluginSolidStart2(options), ...makeEnableSourceMapsVitePlugin(options));\n }\n\n return plugins;\n}\n\n// Nitro's `NitroConfig` only matches `@sentry/nitro`'s when both resolve the same `nitro` install,\n// which is not guaranteed, so the key stays opaque rather than coupling the two copies.\ntype ViteConfigWithNitro = UserConfig & {\n nitro?: Record<string, unknown>;\n server?: UserConfig['server'] & { baseURL?: string };\n};\n\n/**\n * Delivers everything only Nitro can reach — server source maps, runtime hooks, the\n * `sourcemapMinify` opt-out — through Vite's `nitro` key, and the app's base path to the browser SDK.\n *\n * `setupSentryNitroModule` is handed only the keys it reads, never the user's whole config, so what\n * comes back is purely Sentry's additions. Vite concatenates arrays when merging a `config` return\n * value, so echoing the user's own `modules`/`plugins` back would duplicate every entry.\n *\n * `enforce: 'pre'` is load-bearing: Nitro creates its instance inside its own `config` hook, so a\n * normal-priority hook sorting after it would be read too late and silently ignored.\n */\nfunction makeSentryNitroPlugin(options: SentrySolidStartOptions): Plugin {\n return {\n name: 'sentry-solidstart-nitro',\n enforce: 'pre',\n config(userConfig: ViteConfigWithNitro) {\n const userNitro = userConfig.nitro;\n // SolidStart serves the app under Vite's `base` (or `server.baseURL`), not Nitro's `baseURL`, so the browser\n // and the server both serve the managed tunnel under it.\n const tunnelBasePath = normalizeTunnelBasePath(userConfig.server?.baseURL || userConfig.base);\n\n return {\n define: { __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__: JSON.stringify(tunnelBasePath) },\n nitro: {\n ...(setupSentryNitroModule(\n // `sourcemap` decides whether Sentry enables its own; `tracingChannel` is left as the user set it.\n { sourcemap: userNitro?.sourcemap, tracingChannel: userNitro?.tracingChannel } as Parameters<\n typeof setupSentryNitroModule\n >[0],\n options,\n ) as Record<string, unknown>),\n // `@sentry/nitro` serves the tunnel under this instead of Nitro's `baseURL`.\n ...(tunnelBasePath && { runtimeConfig: { sentryTunnelBasePath: tunnelBasePath } }),\n },\n } as Omit<UserConfig, 'plugins'>;\n },\n };\n}\n"],"names":["warnOnRemovedBuildOptions","sentryOrchestrionPlugin","makeAddSentryVitePluginSolidStart2","makeEnableSourceMapsVitePlugin","normalizeTunnelBasePath","setupSentryNitroModule"],"mappings":";;;;;;;AA2CO,SAAS,gBAAA,CAAiB,OAAA,GAAmC,EAAC,EAAa;AAChF,EAAAA,8BAAA,CAA0B,OAAA,EAAS,CAAC,kCAAkC,CAAC,CAAA;AAEvE,EAAA,MAAM,OAAA,GAAoB,CAAC,qBAAA,CAAsB,OAAO,CAAC,CAAA;AAGzD,EAAA,IAAI,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa,aAAA,EAAe;AAC1C,IAAA,OAAO,OAAA;AAAA,EACT;AAIA,EAAA,OAAA,CAAQ,KAAKC,4BAAA,CAAwB,EAAE,0BAA0B,OAAA,CAAQ,wBAAA,EAA0B,CAAC,CAAA;AAEpG,EAAA,IAAI,OAAA,CAAQ,UAAA,EAAY,OAAA,KAAY,IAAA,EAAM;AACxC,IAAA,OAAA,CAAQ,IAAA,CAAK,GAAGC,6CAAA,CAAmC,OAAO,GAAG,GAAGC,yCAAA,CAA+B,OAAO,CAAC,CAAA;AAAA,EACzG;AAEA,EAAA,OAAO,OAAA;AACT;AAoBA,SAAS,sBAAsB,OAAA,EAA0C;AACvE,EAAA,OAAO;AAAA,IACL,IAAA,EAAM,yBAAA;AAAA,IACN,OAAA,EAAS,KAAA;AAAA,IACT,OAAO,UAAA,EAAiC;AACtC,MAAA,MAAM,YAAY,UAAA,CAAW,KAAA;AAG7B,MAAA,MAAM,iBAAiBC,sCAAA,CAAwB,UAAA,CAAW,MAAA,EAAQ,OAAA,IAAW,WAAW,IAAI,CAAA;AAE5F,MAAA,OAAO;AAAA,QACL,QAAQ,EAAE,sCAAA,EAAwC,IAAA,CAAK,SAAA,CAAU,cAAc,CAAA,EAAE;AAAA,QACjF,KAAA,EAAO;AAAA,UACL,GAAIC,4BAAA;AAAA;AAAA,YAEF,EAAE,SAAA,EAAW,SAAA,EAAW,SAAA,EAAW,cAAA,EAAgB,WAAW,cAAA,EAAe;AAAA,YAG7E;AAAA,WACF;AAAA;AAAA,UAEA,GAAI,cAAA,IAAkB,EAAE,eAAe,EAAE,oBAAA,EAAsB,gBAAe;AAAE;AAClF,OACF;AAAA,IACF;AAAA,GACF;AACF;;;;"}
1
+ {"version":3,"file":"sentrySolidStart.js","names":["warnOnRemovedBuildOptions","sentryOrchestrionPlugin","makeAddSentryVitePluginSolidStart2","makeEnableSourceMapsVitePlugin","normalizeTunnelBasePath","setupSentryNitroModule"],"sources":["../../../src/vite/sentrySolidStart.ts"],"sourcesContent":["import {\n type BuildTimeOptionsBase,\n _INTERNAL_normalizeTunnelBasePath as normalizeTunnelBasePath,\n warnOnRemovedBuildOptions,\n} from '@sentry/core';\nimport { setupSentryNitroModule } from '@sentry/nitro';\nimport { sentryOrchestrionPlugin } from '@sentry/server-utils/orchestrion/vite';\nimport type { Plugin, UserConfig } from 'vite';\nimport { makeAddSentryVitePluginSolidStart2, makeEnableSourceMapsVitePlugin } from './sourceMaps';\n\n/**\n * Build-time options for the Sentry SolidStart SDK on SolidStart 2.\n */\nexport type SentrySolidStartOptions = BuildTimeOptionsBase;\n\n/**\n * Vite plugins for the Sentry SolidStart SDK. Requires SolidStart 2.\n *\n * On SolidStart 1, use `withSentry` in `app.config.ts` instead.\n *\n * @example\n * ```typescript\n * // vite.config.ts\n * import { sentrySolidStart } from '@sentry/solidstart/vite';\n * import { solidStart } from '@solidjs/start/config';\n * import { nitro } from 'nitro/vite';\n * import { defineConfig } from 'vite';\n *\n * export default defineConfig({\n * plugins: [\n * solidStart(),\n * sentrySolidStart({\n * org: 'your-org',\n * project: 'your-project',\n * }),\n * nitro(),\n * ],\n * });\n * ```\n *\n * @param options - Options to configure the Sentry Vite plugins\n * @returns An array of Vite plugins\n */\nexport function sentrySolidStart(options: SentrySolidStartOptions = {}): Plugin[] {\n warnOnRemovedBuildOptions(options, ['unstable_sentryVitePluginOptions']);\n\n const plugins: Plugin[] = [makeSentryNitroPlugin(options), makeServerEntryPlugin()];\n\n // Only the Nitro and server entry plugins are dev-safe; the Nitro module handles `dev` itself.\n if (process.env.NODE_ENV === 'development') {\n return plugins;\n }\n\n // Injects `diagnostics_channel` publishers into instrumented deps at build time, which is what\n // lets `Sentry.init()` run from a bundled Nitro plugin rather than an `--import` preload.\n plugins.push(sentryOrchestrionPlugin({ buildTimeInstrumentation: options.buildTimeInstrumentation }));\n\n if (options.sourcemaps?.disable !== true) {\n plugins.push(...makeAddSentryVitePluginSolidStart2(options), ...makeEnableSourceMapsVitePlugin(options));\n }\n\n return plugins;\n}\n\nconst SERVER_RUNTIME_CONDITION = 'sentry-solidstart-runtime';\n\n/**\n * Resolves `@sentry/solidstart` in server environments to the entry without the deprecated SolidStart 1\n * `withSentry`. Its build-time imports (Sentry CLI, oxc-parser) otherwise end up in the server output:\n * Nitro traces their native files, and Rolldown still emits the CLI's dynamic-import chunks after\n * tree-shaking the code that imports them.\n */\nfunction makeServerEntryPlugin(): Plugin {\n return {\n name: 'sentry-solidstart-server-entry',\n configEnvironment(name, config) {\n // Vite concatenates the returned conditions onto these. If none are set yet, returning one would\n // replace Vite's defaults, so leave resolution alone.\n if (name === 'client' || config.consumer === 'client' || !config.resolve?.conditions) {\n return;\n }\n\n return { resolve: { conditions: [SERVER_RUNTIME_CONDITION] } };\n },\n };\n}\n\n// Nitro's `NitroConfig` only matches `@sentry/nitro`'s when both resolve the same `nitro` install,\n// which is not guaranteed, so the key stays opaque rather than coupling the two copies.\ntype ViteConfigWithNitro = UserConfig & {\n nitro?: Record<string, unknown>;\n server?: UserConfig['server'] & { baseURL?: string };\n};\n\n/**\n * Delivers everything only Nitro can reach — server source maps, runtime hooks, the\n * `sourcemapMinify` opt-out — through Vite's `nitro` key, and the app's base path to the browser SDK.\n *\n * `setupSentryNitroModule` is handed only the keys it reads, never the user's whole config, so what\n * comes back is purely Sentry's additions. Vite concatenates arrays when merging a `config` return\n * value, so echoing the user's own `modules`/`plugins` back would duplicate every entry.\n *\n * `enforce: 'pre'` is load-bearing: Nitro creates its instance inside its own `config` hook, so a\n * normal-priority hook sorting after it would be read too late and silently ignored.\n */\nfunction makeSentryNitroPlugin(options: SentrySolidStartOptions): Plugin {\n return {\n name: 'sentry-solidstart-nitro',\n enforce: 'pre',\n config(userConfig: ViteConfigWithNitro) {\n const userNitro = userConfig.nitro;\n // SolidStart serves the app under Vite's `base` (or `server.baseURL`), not Nitro's `baseURL`, so the browser\n // and the server both serve the managed tunnel under it.\n const tunnelBasePath = normalizeTunnelBasePath(userConfig.server?.baseURL || userConfig.base);\n\n return {\n define: { __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__: JSON.stringify(tunnelBasePath) },\n nitro: {\n ...(setupSentryNitroModule(\n // `sourcemap` decides whether Sentry enables its own; `tracingChannel` is left as the user set it.\n { sourcemap: userNitro?.sourcemap, tracingChannel: userNitro?.tracingChannel } as Parameters<\n typeof setupSentryNitroModule\n >[0],\n options,\n ) as Record<string, unknown>),\n // `@sentry/nitro` serves the tunnel under this instead of Nitro's `baseURL`.\n ...(tunnelBasePath && { runtimeConfig: { sentryTunnelBasePath: tunnelBasePath } }),\n },\n } as Omit<UserConfig, 'plugins'>;\n },\n };\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2CA,SAAgB,iBAAiB,UAAmC,CAAC,GAAa;CAChFA,CAAAA,GAAAA,aAAAA,0BAAAA,CAA0B,SAAS,CAAC,kCAAkC,CAAC;CAEvE,MAAM,UAAoB,CAAC,sBAAsB,OAAO,GAAG,sBAAsB,CAAC;CAGlF,IAAA,QAAA,IAAA,aAA6B,eAC3B,OAAO;CAKT,QAAQ,MAAA,GAAKC,sCAAAA,wBAAAA,CAAwB,EAAE,0BAA0B,QAAQ,yBAAyB,CAAC,CAAC;CAEpG,IAAI,QAAQ,YAAY,YAAY,MAClC,QAAQ,KAAK,GAAGC,mBAAAA,mCAAmC,OAAO,GAAG,GAAGC,mBAAAA,+BAA+B,OAAO,CAAC;CAGzG,OAAO;AACT;AAEA,MAAM,2BAA2B;;;;;;;AAQjC,SAAS,wBAAgC;CACvC,OAAO;EACL,MAAM;EACN,kBAAkB,MAAM,QAAQ;GAG9B,IAAI,SAAS,YAAY,OAAO,aAAa,YAAY,CAAC,OAAO,SAAS,YACxE;GAGF,OAAO,EAAE,SAAS,EAAE,YAAY,CAAC,wBAAwB,EAAE,EAAE;EAC/D;CACF;AACF;;;;;;;;;;;;AAoBA,SAAS,sBAAsB,SAA0C;CACvE,OAAO;EACL,MAAM;EACN,SAAS;EACT,OAAO,YAAiC;GACtC,MAAM,YAAY,WAAW;GAG7B,MAAM,kBAAA,GAAiBC,aAAAA,kCAAAA,CAAwB,WAAW,QAAQ,WAAW,WAAW,IAAI;GAE5F,OAAO;IACL,QAAQ,EAAE,wCAAwC,KAAK,UAAU,cAAc,EAAE;IACjF,OAAO;KACL,IAAA,GAAIC,cAAAA,uBAAAA,CAEF;MAAE,WAAW,WAAW;MAAW,gBAAgB,WAAW;KAAe,GAG7E,OACF;KAEA,GAAI,kBAAkB,EAAE,eAAe,EAAE,sBAAsB,eAAe,EAAE;IAClF;GACF;EACF;CACF;AACF"}
@@ -1,41 +1,38 @@
1
- Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
2
-
3
- const core = require('@sentry/core');
4
- const buildInstrumentationFile = require('./buildInstrumentationFile.js');
5
- const sourceMaps = require('./sourceMaps.js');
6
-
1
+ const require_buildInstrumentationFile = require("./buildInstrumentationFile.js");
2
+ const require_sourceMaps = require("./sourceMaps.js");
3
+ let _sentry_core = require("@sentry/core");
4
+ // src/vite/sentrySolidStartVite.ts
5
+ /**
6
+ * Various Sentry vite plugins to be used for SolidStart.
7
+ */
7
8
  const sentrySolidStartVite = (options = {}, viteConfig, tunnelBasePath = "") => {
8
- core.warnOnRemovedBuildOptions(options, ["unstable_sentryVitePluginOptions"]);
9
- const sentryPlugins = [
10
- {
11
- name: "sentry-solidstart-tunnel-base-path",
12
- // Serves the browser's managed tunnel under `server.baseURL`, like every other route of the app.
13
- config: () => ({
14
- define: { __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__: JSON.stringify(tunnelBasePath) }
15
- })
16
- }
17
- ];
18
- if (options.autoInjectServerSentry !== "experimental_dynamic-import") {
19
- sentryPlugins.push(buildInstrumentationFile.makeBuildInstrumentationFilePlugin(options));
20
- }
21
- if (process.env.NODE_ENV !== "development") {
22
- if (options.sourcemaps?.disable !== true) {
23
- const sourceMapsPlugin = sourceMaps.makeAddSentryVitePlugin(options, viteConfig);
24
- const enableSourceMapsPlugin = sourceMaps.makeEnableSourceMapsVitePlugin(options);
25
- sentryPlugins.push(...sourceMapsPlugin, ...enableSourceMapsPlugin);
26
- }
27
- }
28
- return sentryPlugins;
9
+ (0, _sentry_core.warnOnRemovedBuildOptions)(options, ["unstable_sentryVitePluginOptions"]);
10
+ const sentryPlugins = [{
11
+ name: "sentry-solidstart-tunnel-base-path",
12
+ config: () => ({ define: { __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__: JSON.stringify(tunnelBasePath) } })
13
+ }];
14
+ if (options.autoInjectServerSentry !== "experimental_dynamic-import") sentryPlugins.push(require_buildInstrumentationFile.makeBuildInstrumentationFilePlugin(options));
15
+ if (process.env.NODE_ENV !== "development") {
16
+ if (options.sourcemaps?.disable !== true) {
17
+ const sourceMapsPlugin = require_sourceMaps.makeAddSentryVitePlugin(options, viteConfig);
18
+ const enableSourceMapsPlugin = require_sourceMaps.makeEnableSourceMapsVitePlugin(options);
19
+ sentryPlugins.push(...sourceMapsPlugin, ...enableSourceMapsPlugin);
20
+ }
21
+ }
22
+ return sentryPlugins;
29
23
  };
24
+ /**
25
+ * Helper to add the Sentry SolidStart vite plugin to a vite config.
26
+ */
30
27
  const addSentryPluginToVite = (config = {}, options, tunnelBasePath) => {
31
- const plugins = Array.isArray(config.plugins) ? [...config.plugins] : [];
32
- plugins.unshift(sentrySolidStartVite(options, config, tunnelBasePath));
33
- return {
34
- ...config,
35
- plugins
36
- };
28
+ const plugins = Array.isArray(config.plugins) ? [...config.plugins] : [];
29
+ plugins.unshift(sentrySolidStartVite(options, config, tunnelBasePath));
30
+ return {
31
+ ...config,
32
+ plugins
33
+ };
37
34
  };
38
-
39
35
  exports.addSentryPluginToVite = addSentryPluginToVite;
40
36
  exports.sentrySolidStartVite = sentrySolidStartVite;
41
- //# sourceMappingURL=sentrySolidStartVite.js.map
37
+
38
+ //# sourceMappingURL=sentrySolidStartVite.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"sentrySolidStartVite.js","sources":["../../../src/vite/sentrySolidStartVite.ts"],"sourcesContent":["import { warnOnRemovedBuildOptions } from '@sentry/core';\nimport type { Plugin, UserConfig } from 'vite';\nimport { makeBuildInstrumentationFilePlugin } from './buildInstrumentationFile';\nimport { makeAddSentryVitePlugin, makeEnableSourceMapsVitePlugin } from './sourceMaps';\nimport type { SentrySolidStartPluginOptions } from './types';\n\n/**\n * Various Sentry vite plugins to be used for SolidStart.\n */\nexport const sentrySolidStartVite = (\n options: SentrySolidStartPluginOptions = {},\n viteConfig: UserConfig,\n tunnelBasePath = '',\n): Plugin[] => {\n warnOnRemovedBuildOptions(options, ['unstable_sentryVitePluginOptions']);\n\n const sentryPlugins: Plugin[] = [\n {\n name: 'sentry-solidstart-tunnel-base-path',\n // Serves the browser's managed tunnel under `server.baseURL`, like every other route of the app.\n config: () => ({\n define: { __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__: JSON.stringify(tunnelBasePath) },\n }),\n },\n ];\n\n if (options.autoInjectServerSentry !== 'experimental_dynamic-import') {\n sentryPlugins.push(makeBuildInstrumentationFilePlugin(options));\n }\n\n if (process.env.NODE_ENV !== 'development') {\n if (options.sourcemaps?.disable !== true) {\n const sourceMapsPlugin = makeAddSentryVitePlugin(options, viteConfig);\n const enableSourceMapsPlugin = makeEnableSourceMapsVitePlugin(options);\n\n sentryPlugins.push(...sourceMapsPlugin, ...enableSourceMapsPlugin);\n }\n }\n\n return sentryPlugins;\n};\n\n/**\n * Helper to add the Sentry SolidStart vite plugin to a vite config.\n */\nexport const addSentryPluginToVite = (\n config: UserConfig = {},\n options: SentrySolidStartPluginOptions,\n tunnelBasePath?: string,\n): UserConfig => {\n const plugins = Array.isArray(config.plugins) ? [...config.plugins] : [];\n plugins.unshift(sentrySolidStartVite(options, config, tunnelBasePath));\n\n return {\n ...config,\n plugins,\n };\n};\n"],"names":["warnOnRemovedBuildOptions","makeBuildInstrumentationFilePlugin","makeAddSentryVitePlugin","makeEnableSourceMapsVitePlugin"],"mappings":";;;;;;AASO,MAAM,uBAAuB,CAClC,OAAA,GAAyC,EAAC,EAC1C,UAAA,EACA,iBAAiB,EAAA,KACJ;AACb,EAAAA,8BAAA,CAA0B,OAAA,EAAS,CAAC,kCAAkC,CAAC,CAAA;AAEvE,EAAA,MAAM,aAAA,GAA0B;AAAA,IAC9B;AAAA,MACE,IAAA,EAAM,oCAAA;AAAA;AAAA,MAEN,QAAQ,OAAO;AAAA,QACb,QAAQ,EAAE,sCAAA,EAAwC,IAAA,CAAK,SAAA,CAAU,cAAc,CAAA;AAAE,OACnF;AAAA;AACF,GACF;AAEA,EAAA,IAAI,OAAA,CAAQ,2BAA2B,6BAAA,EAA+B;AACpE,IAAA,aAAA,CAAc,IAAA,CAAKC,2DAAA,CAAmC,OAAO,CAAC,CAAA;AAAA,EAChE;AAEA,EAAA,IAAI,OAAA,CAAQ,GAAA,CAAI,QAAA,KAAa,aAAA,EAAe;AAC1C,IAAA,IAAI,OAAA,CAAQ,UAAA,EAAY,OAAA,KAAY,IAAA,EAAM;AACxC,MAAA,MAAM,gBAAA,GAAmBC,kCAAA,CAAwB,OAAA,EAAS,UAAU,CAAA;AACpE,MAAA,MAAM,sBAAA,GAAyBC,0CAA+B,OAAO,CAAA;AAErE,MAAA,aAAA,CAAc,IAAA,CAAK,GAAG,gBAAA,EAAkB,GAAG,sBAAsB,CAAA;AAAA,IACnE;AAAA,EACF;AAEA,EAAA,OAAO,aAAA;AACT;AAKO,MAAM,wBAAwB,CACnC,MAAA,GAAqB,EAAC,EACtB,SACA,cAAA,KACe;AACf,EAAA,MAAM,OAAA,GAAU,KAAA,CAAM,OAAA,CAAQ,MAAA,CAAO,OAAO,CAAA,GAAI,CAAC,GAAG,MAAA,CAAO,OAAO,CAAA,GAAI,EAAC;AACvE,EAAA,OAAA,CAAQ,OAAA,CAAQ,oBAAA,CAAqB,OAAA,EAAS,MAAA,EAAQ,cAAc,CAAC,CAAA;AAErE,EAAA,OAAO;AAAA,IACL,GAAG,MAAA;AAAA,IACH;AAAA,GACF;AACF;;;;;"}
1
+ {"version":3,"file":"sentrySolidStartVite.js","names":["warnOnRemovedBuildOptions","makeBuildInstrumentationFilePlugin","makeAddSentryVitePlugin","makeEnableSourceMapsVitePlugin"],"sources":["../../../src/vite/sentrySolidStartVite.ts"],"sourcesContent":["import { warnOnRemovedBuildOptions } from '@sentry/core';\nimport type { Plugin, UserConfig } from 'vite';\nimport { makeBuildInstrumentationFilePlugin } from './buildInstrumentationFile';\nimport { makeAddSentryVitePlugin, makeEnableSourceMapsVitePlugin } from './sourceMaps';\nimport type { SentrySolidStartPluginOptions } from './types';\n\n/**\n * Various Sentry vite plugins to be used for SolidStart.\n */\nexport const sentrySolidStartVite = (\n options: SentrySolidStartPluginOptions = {},\n viteConfig: UserConfig,\n tunnelBasePath = '',\n): Plugin[] => {\n warnOnRemovedBuildOptions(options, ['unstable_sentryVitePluginOptions']);\n\n const sentryPlugins: Plugin[] = [\n {\n name: 'sentry-solidstart-tunnel-base-path',\n // Serves the browser's managed tunnel under `server.baseURL`, like every other route of the app.\n config: () => ({\n define: { __SENTRY_SOLIDSTART_TUNNEL_BASE_PATH__: JSON.stringify(tunnelBasePath) },\n }),\n },\n ];\n\n if (options.autoInjectServerSentry !== 'experimental_dynamic-import') {\n sentryPlugins.push(makeBuildInstrumentationFilePlugin(options));\n }\n\n if (process.env.NODE_ENV !== 'development') {\n if (options.sourcemaps?.disable !== true) {\n const sourceMapsPlugin = makeAddSentryVitePlugin(options, viteConfig);\n const enableSourceMapsPlugin = makeEnableSourceMapsVitePlugin(options);\n\n sentryPlugins.push(...sourceMapsPlugin, ...enableSourceMapsPlugin);\n }\n }\n\n return sentryPlugins;\n};\n\n/**\n * Helper to add the Sentry SolidStart vite plugin to a vite config.\n */\nexport const addSentryPluginToVite = (\n config: UserConfig = {},\n options: SentrySolidStartPluginOptions,\n tunnelBasePath?: string,\n): UserConfig => {\n const plugins = Array.isArray(config.plugins) ? [...config.plugins] : [];\n plugins.unshift(sentrySolidStartVite(options, config, tunnelBasePath));\n\n return {\n ...config,\n plugins,\n };\n};\n"],"mappings":";;;;;;;AASA,MAAa,wBACX,UAAyC,CAAC,GAC1C,YACA,iBAAiB,OACJ;CACbA,CAAAA,GAAAA,aAAAA,0BAAAA,CAA0B,SAAS,CAAC,kCAAkC,CAAC;CAEvE,MAAM,gBAA0B,CAC9B;EACE,MAAM;EAEN,eAAe,EACb,QAAQ,EAAE,wCAAwC,KAAK,UAAU,cAAc,EAAE,EACnF;CACF,CACF;CAEA,IAAI,QAAQ,2BAA2B,+BACrC,cAAc,KAAKC,iCAAAA,mCAAmC,OAAO,CAAC;CAGhE,IAAA,QAAA,IAAA,aAA6B,eACvB;MAAA,QAAQ,YAAY,YAAY,MAAM;GACxC,MAAM,mBAAmBC,mBAAAA,wBAAwB,SAAS,UAAU;GACpE,MAAM,yBAAyBC,mBAAAA,+BAA+B,OAAO;GAErE,cAAc,KAAK,GAAG,kBAAkB,GAAG,sBAAsB;EACnE;;CAGF,OAAO;AACT;;;;AAKA,MAAa,yBACX,SAAqB,CAAC,GACtB,SACA,mBACe;CACf,MAAM,UAAU,MAAM,QAAQ,OAAO,OAAO,IAAI,CAAC,GAAG,OAAO,OAAO,IAAI,CAAC;CACvE,QAAQ,QAAQ,qBAAqB,SAAS,QAAQ,cAAc,CAAC;CAErE,OAAO;EACL,GAAG;EACH;CACF;AACF"}