@sentry/solidstart 8.25.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.
- package/LICENSE +21 -0
- package/README.md +219 -0
- package/build/cjs/client/index.js +19 -0
- package/build/cjs/client/index.js.map +1 -0
- package/build/cjs/client/sdk.js +20 -0
- package/build/cjs/client/sdk.js.map +1 -0
- package/build/cjs/client/solidrouter.js +17 -0
- package/build/cjs/client/solidrouter.js.map +1 -0
- package/build/cjs/common/debug-build.js +11 -0
- package/build/cjs/common/debug-build.js.map +1 -0
- package/build/cjs/index.client.js +19 -0
- package/build/cjs/index.client.js.map +1 -0
- package/build/cjs/index.server.js +134 -0
- package/build/cjs/index.server.js.map +1 -0
- package/build/cjs/middleware.js +54 -0
- package/build/cjs/middleware.js.map +1 -0
- package/build/cjs/server/index.js +134 -0
- package/build/cjs/server/index.js.map +1 -0
- package/build/cjs/server/sdk.js +22 -0
- package/build/cjs/server/sdk.js.map +1 -0
- package/build/cjs/server/solidrouter.js +44 -0
- package/build/cjs/server/solidrouter.js.map +1 -0
- package/build/cjs/server/utils.js +67 -0
- package/build/cjs/server/utils.js.map +1 -0
- package/build/cjs/server/withServerActionInstrumentation.js +63 -0
- package/build/cjs/server/withServerActionInstrumentation.js.map +1 -0
- package/build/cjs/solidrouter.client.js +17 -0
- package/build/cjs/solidrouter.client.js.map +1 -0
- package/build/cjs/solidrouter.js +19 -0
- package/build/cjs/solidrouter.js.map +1 -0
- package/build/cjs/solidrouter.server.js +8 -0
- package/build/cjs/solidrouter.server.js.map +1 -0
- package/build/esm/client/index.js +3 -0
- package/build/esm/client/index.js.map +1 -0
- package/build/esm/client/sdk.js +18 -0
- package/build/esm/client/sdk.js.map +1 -0
- package/build/esm/client/solidrouter.js +2 -0
- package/build/esm/client/solidrouter.js.map +1 -0
- package/build/esm/common/debug-build.js +9 -0
- package/build/esm/common/debug-build.js.map +1 -0
- package/build/esm/index.client.js +3 -0
- package/build/esm/index.client.js.map +1 -0
- package/build/esm/index.server.js +6 -0
- package/build/esm/index.server.js.map +1 -0
- package/build/esm/middleware.js +52 -0
- package/build/esm/middleware.js.map +1 -0
- package/build/esm/package.json +1 -0
- package/build/esm/server/index.js +6 -0
- package/build/esm/server/index.js.map +1 -0
- package/build/esm/server/sdk.js +20 -0
- package/build/esm/server/sdk.js.map +1 -0
- package/build/esm/server/solidrouter.js +42 -0
- package/build/esm/server/solidrouter.js.map +1 -0
- package/build/esm/server/utils.js +60 -0
- package/build/esm/server/utils.js.map +1 -0
- package/build/esm/server/withServerActionInstrumentation.js +61 -0
- package/build/esm/server/withServerActionInstrumentation.js.map +1 -0
- package/build/esm/solidrouter.client.js +2 -0
- package/build/esm/solidrouter.client.js.map +1 -0
- package/build/esm/solidrouter.js +3 -0
- package/build/esm/solidrouter.js.map +1 -0
- package/build/esm/solidrouter.server.js +2 -0
- package/build/esm/solidrouter.server.js.map +1 -0
- package/build/types/client/index.d.ts +3 -0
- package/build/types/client/index.d.ts.map +1 -0
- package/build/types/client/sdk.d.ts +7 -0
- package/build/types/client/sdk.d.ts.map +1 -0
- package/build/types/common/debug-build.d.ts +7 -0
- package/build/types/common/debug-build.d.ts.map +1 -0
- package/build/types/index.client.d.ts +2 -0
- package/build/types/index.client.d.ts.map +1 -0
- package/build/types/index.server.d.ts +2 -0
- package/build/types/index.server.d.ts.map +1 -0
- package/build/types/index.types.d.ts +18 -0
- package/build/types/index.types.d.ts.map +1 -0
- package/build/types/server/index.d.ts +6 -0
- package/build/types/server/index.d.ts.map +1 -0
- package/build/types/server/sdk.d.ts +6 -0
- package/build/types/server/sdk.d.ts.map +1 -0
- package/build/types/server/utils.d.ts +15 -0
- package/build/types/server/utils.d.ts.map +1 -0
- package/build/types/server/withServerActionInstrumentation.d.ts +6 -0
- package/build/types/server/withServerActionInstrumentation.d.ts.map +1 -0
- package/client/solidrouter.d.ts +2 -0
- package/client/solidrouter.d.ts.map +1 -0
- package/middleware.d.ts +11 -0
- package/middleware.d.ts.map +1 -0
- package/package.json +134 -0
- package/server/solidrouter.d.ts +8 -0
- package/server/solidrouter.d.ts.map +1 -0
- package/solidrouter.client.d.ts +2 -0
- package/solidrouter.client.d.ts.map +1 -0
- package/solidrouter.d.ts +5 -0
- package/solidrouter.d.ts.map +1 -0
- package/solidrouter.server.d.ts +2 -0
- package/solidrouter.server.d.ts.map +1 -0
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import { splitProps, mergeProps } from 'solid-js';
|
|
2
|
+
import { createComponent } from 'solid-js/web';
|
|
3
|
+
|
|
4
|
+
// We use @sentry/solid/solidrouter on the client.
|
|
5
|
+
// On the server, we have to create matching components
|
|
6
|
+
// in structure to avoid hydration errors.
|
|
7
|
+
|
|
8
|
+
/** Pass-through component in case user didn't specify a root **/
|
|
9
|
+
function SentryDefaultRoot(props) {
|
|
10
|
+
return props.children;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* On the client, router hooks are used in the router's root render prop.
|
|
15
|
+
* This creates a matching structure that's purely pass-through to avoid hydration errors.
|
|
16
|
+
*/
|
|
17
|
+
function withSentryRouterRoot(Root) {
|
|
18
|
+
const SentryRouterRoot = (props) => {
|
|
19
|
+
return createComponent(Root, props);
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
return SentryRouterRoot;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* On the client, router hooks are used to start navigation spans.
|
|
27
|
+
* This creates a matching structure that's purely pass-through to avoid hydration errors.
|
|
28
|
+
*/
|
|
29
|
+
function withSentryRouterRouting(Router) {
|
|
30
|
+
const SentryRouter = (props) => {
|
|
31
|
+
const [local, others] = splitProps(props, ['root']);
|
|
32
|
+
// We need to wrap root here in case the user passed in their own root
|
|
33
|
+
const Root = withSentryRouterRoot(local.root ? local.root : SentryDefaultRoot);
|
|
34
|
+
|
|
35
|
+
return createComponent(Router, mergeProps({ root: Root }, others));
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
return SentryRouter;
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export { withSentryRouterRouting };
|
|
42
|
+
//# sourceMappingURL=solidrouter.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solidrouter.js","sources":["../../../src/server/solidrouter.ts"],"sourcesContent":["import type { HashRouter, MemoryRouter, RouteSectionProps, Router as BaseRouter, StaticRouter } from '@solidjs/router';\nimport { mergeProps, splitProps } from 'solid-js';\nimport type { Component, JSX, ParentProps } from 'solid-js';\nimport { createComponent } from 'solid-js/web';\n\n// We use @sentry/solid/solidrouter on the client.\n// On the server, we have to create matching components\n// in structure to avoid hydration errors.\n\n/** Pass-through component in case user didn't specify a root **/\nfunction SentryDefaultRoot(props: ParentProps): JSX.Element {\n return props.children;\n}\n\n/**\n * On the client, router hooks are used in the router's root render prop.\n * This creates a matching structure that's purely pass-through to avoid hydration errors.\n */\nfunction withSentryRouterRoot(Root: Component<RouteSectionProps>): Component<RouteSectionProps> {\n const SentryRouterRoot = (props: RouteSectionProps): JSX.Element => {\n return createComponent(Root, props);\n };\n\n return SentryRouterRoot;\n}\n\nexport type RouterType = typeof BaseRouter | typeof HashRouter | typeof MemoryRouter | typeof StaticRouter;\n\n/**\n * On the client, router hooks are used to start navigation spans.\n * This creates a matching structure that's purely pass-through to avoid hydration errors.\n */\nexport function withSentryRouterRouting(Router: RouterType): RouterType {\n const SentryRouter = (props: Parameters<RouterType>[0]): JSX.Element => {\n const [local, others] = splitProps(props, ['root']);\n // We need to wrap root here in case the user passed in their own root\n const Root = withSentryRouterRoot(local.root ? local.root : SentryDefaultRoot);\n\n return createComponent(Router, mergeProps({ root: Root }, others));\n };\n\n return SentryRouter;\n}\n"],"names":[],"mappings":";;;AAKA;AACA;AACA;AACA;AACA;AACA,SAAS,iBAAiB,CAAC,KAAK,EAA4B;AAC5D,EAAE,OAAO,KAAK,CAAC,QAAQ,CAAA;AACvB,CAAA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,oBAAoB,CAAC,IAAI,EAA8D;AAChG,EAAE,MAAM,gBAAA,GAAmB,CAAC,KAAK,KAAqC;AACtE,IAAI,OAAO,eAAe,CAAC,IAAI,EAAE,KAAK,CAAC,CAAA;AACvC,GAAG,CAAA;AACH;AACA,EAAE,OAAO,gBAAgB,CAAA;AACzB,CAAA;;AAIA;AACA;AACA;AACA;AACO,SAAS,uBAAuB,CAAC,MAAM,EAA0B;AACxE,EAAE,MAAM,YAAA,GAAe,CAAC,KAAK,KAA6C;AAC1E,IAAI,MAAM,CAAC,KAAK,EAAE,MAAM,CAAE,GAAE,UAAU,CAAC,KAAK,EAAE,CAAC,MAAM,CAAC,CAAC,CAAA;AACvD;AACA,IAAI,MAAM,IAAA,GAAO,oBAAoB,CAAC,KAAK,CAAC,IAAK,GAAE,KAAK,CAAC,IAAK,GAAE,iBAAiB,CAAC,CAAA;AAClF;AACA,IAAI,OAAO,eAAe,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,IAAI,EAAE,IAAK,EAAC,EAAE,MAAM,CAAC,CAAC,CAAA;AACtE,GAAG,CAAA;AACH;AACA,EAAE,OAAO,YAAY,CAAA;AACrB;;;;"}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import { _optionalChain } from '@sentry/utils';
|
|
2
|
+
import { flush, getGlobalScope } from '@sentry/node';
|
|
3
|
+
import { logger } from '@sentry/utils';
|
|
4
|
+
import { DEBUG_BUILD } from '../common/debug-build.js';
|
|
5
|
+
|
|
6
|
+
/** Flush the event queue to ensure that events get sent to Sentry before the response is finished and the lambda ends */
|
|
7
|
+
async function flushIfServerless() {
|
|
8
|
+
const isServerless = !!process.env.LAMBDA_TASK_ROOT || !!process.env.VERCEL;
|
|
9
|
+
|
|
10
|
+
if (isServerless) {
|
|
11
|
+
try {
|
|
12
|
+
DEBUG_BUILD && logger.log('Flushing events...');
|
|
13
|
+
await flush(2000);
|
|
14
|
+
DEBUG_BUILD && logger.log('Done flushing events');
|
|
15
|
+
} catch (e) {
|
|
16
|
+
DEBUG_BUILD && logger.log('Error while flushing events:\n', e);
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Determines if a thrown "error" is a redirect Response which Solid Start users can throw to redirect to another route.
|
|
23
|
+
* see: https://docs.solidjs.com/solid-router/reference/data-apis/response-helpers#redirect
|
|
24
|
+
* @param error the potential redirect error
|
|
25
|
+
*/
|
|
26
|
+
function isRedirect(error) {
|
|
27
|
+
if (error == null || !(error instanceof Response)) {
|
|
28
|
+
return false;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
const hasValidLocation = typeof error.headers.get('location') === 'string';
|
|
32
|
+
const hasValidStatus = error.status >= 300 && error.status <= 308;
|
|
33
|
+
return hasValidLocation && hasValidStatus;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/**
|
|
37
|
+
* Adds an event processor to filter out low quality transactions,
|
|
38
|
+
* e.g. to filter out transactions for build assets
|
|
39
|
+
*/
|
|
40
|
+
function filterLowQualityTransactions(options) {
|
|
41
|
+
getGlobalScope().addEventProcessor(
|
|
42
|
+
Object.assign(
|
|
43
|
+
(event => {
|
|
44
|
+
if (event.type !== 'transaction') {
|
|
45
|
+
return event;
|
|
46
|
+
}
|
|
47
|
+
// Filter out transactions for build assets
|
|
48
|
+
if (_optionalChain([event, 'access', _ => _.transaction, 'optionalAccess', _2 => _2.match, 'call', _3 => _3(/^GET \/_build\//)])) {
|
|
49
|
+
options.debug && logger.log('SolidStartLowQualityTransactionsFilter filtered transaction', event.transaction);
|
|
50
|
+
return null;
|
|
51
|
+
}
|
|
52
|
+
return event;
|
|
53
|
+
}) ,
|
|
54
|
+
{ id: 'SolidStartLowQualityTransactionsFilter' },
|
|
55
|
+
),
|
|
56
|
+
);
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export { filterLowQualityTransactions, flushIfServerless, isRedirect };
|
|
60
|
+
//# sourceMappingURL=utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.js","sources":["../../../src/server/utils.ts"],"sourcesContent":["import { flush, getGlobalScope } from '@sentry/node';\nimport type { EventProcessor, Options } from '@sentry/types';\nimport { logger } from '@sentry/utils';\nimport { DEBUG_BUILD } from '../common/debug-build';\n\n/** Flush the event queue to ensure that events get sent to Sentry before the response is finished and the lambda ends */\nexport async function flushIfServerless(): Promise<void> {\n const isServerless = !!process.env.LAMBDA_TASK_ROOT || !!process.env.VERCEL;\n\n if (isServerless) {\n try {\n DEBUG_BUILD && logger.log('Flushing events...');\n await flush(2000);\n DEBUG_BUILD && logger.log('Done flushing events');\n } catch (e) {\n DEBUG_BUILD && logger.log('Error while flushing events:\\n', e);\n }\n }\n}\n\n/**\n * Determines if a thrown \"error\" is a redirect Response which Solid Start users can throw to redirect to another route.\n * see: https://docs.solidjs.com/solid-router/reference/data-apis/response-helpers#redirect\n * @param error the potential redirect error\n */\nexport function isRedirect(error: unknown): boolean {\n if (error == null || !(error instanceof Response)) {\n return false;\n }\n\n const hasValidLocation = typeof error.headers.get('location') === 'string';\n const hasValidStatus = error.status >= 300 && error.status <= 308;\n return hasValidLocation && hasValidStatus;\n}\n\n/**\n * Adds an event processor to filter out low quality transactions,\n * e.g. to filter out transactions for build assets\n */\nexport function filterLowQualityTransactions(options: Options): void {\n getGlobalScope().addEventProcessor(\n Object.assign(\n (event => {\n if (event.type !== 'transaction') {\n return event;\n }\n // Filter out transactions for build assets\n if (event.transaction?.match(/^GET \\/_build\\//)) {\n options.debug && logger.log('SolidStartLowQualityTransactionsFilter filtered transaction', event.transaction);\n return null;\n }\n return event;\n }) satisfies EventProcessor,\n { id: 'SolidStartLowQualityTransactionsFilter' },\n ),\n );\n}\n"],"names":[],"mappings":";;;;;AAKA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,EAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAA,CAAA,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CAA6D,EAAE,CAAA,CAAA,CAAA,CAAA,CAAK,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAW,CAAC;UAC7G,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,IAAI;QACb;QACA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAO,KAAK;MACb,CAAA,EAAA;MACD,EAAE,CAAA,CAAE,EAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAA0C,CAAA;IACjD,CAAA;EACL,CAAG;AACH;;"}
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, handleCallbackErrors, SPAN_STATUS_ERROR } from '@sentry/core';
|
|
2
|
+
import { getActiveSpan, spanToJSON, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, startSpan, captureException } from '@sentry/node';
|
|
3
|
+
import { isRedirect, flushIfServerless } from './utils.js';
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Wraps a server action (functions that use the 'use server' directive)
|
|
7
|
+
* function body with Sentry Error and Performance instrumentation.
|
|
8
|
+
*/
|
|
9
|
+
async function withServerActionInstrumentation(
|
|
10
|
+
serverActionName,
|
|
11
|
+
callback,
|
|
12
|
+
) {
|
|
13
|
+
const activeSpan = getActiveSpan();
|
|
14
|
+
|
|
15
|
+
if (activeSpan) {
|
|
16
|
+
const spanData = spanToJSON(activeSpan).data;
|
|
17
|
+
|
|
18
|
+
// In solid start, server function calls are made to `/_server` which doesn't tell us
|
|
19
|
+
// a lot. We rewrite the span's route to be that of the sever action name but only
|
|
20
|
+
// if the target is `/_server`, otherwise we'd overwrite pageloads on routes that use
|
|
21
|
+
// server actions (which are more meaningful, e.g. a request to `GET /users/5` is more
|
|
22
|
+
// meaningful than overwriting it with `GET doSomeFunctionCall`).
|
|
23
|
+
if (spanData && !spanData['http.route'] && spanData['http.target'] === '/_server') {
|
|
24
|
+
activeSpan.setAttribute('http.route', serverActionName);
|
|
25
|
+
activeSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'component');
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
try {
|
|
30
|
+
return await startSpan(
|
|
31
|
+
{
|
|
32
|
+
op: 'function.server_action',
|
|
33
|
+
name: serverActionName,
|
|
34
|
+
attributes: {
|
|
35
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.solidstart',
|
|
36
|
+
[SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',
|
|
37
|
+
},
|
|
38
|
+
},
|
|
39
|
+
async span => {
|
|
40
|
+
const result = await handleCallbackErrors(callback, error => {
|
|
41
|
+
if (!isRedirect(error)) {
|
|
42
|
+
span.setStatus({ code: SPAN_STATUS_ERROR, message: 'internal_error' });
|
|
43
|
+
captureException(error, {
|
|
44
|
+
mechanism: {
|
|
45
|
+
handled: false,
|
|
46
|
+
type: 'solidstart',
|
|
47
|
+
},
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
return result;
|
|
53
|
+
},
|
|
54
|
+
);
|
|
55
|
+
} finally {
|
|
56
|
+
await flushIfServerless();
|
|
57
|
+
}
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export { withServerActionInstrumentation };
|
|
61
|
+
//# sourceMappingURL=withServerActionInstrumentation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withServerActionInstrumentation.js","sources":["../../../src/server/withServerActionInstrumentation.ts"],"sourcesContent":["import { SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SPAN_STATUS_ERROR, handleCallbackErrors } from '@sentry/core';\nimport { SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, captureException, getActiveSpan, spanToJSON, startSpan } from '@sentry/node';\nimport { flushIfServerless, isRedirect } from './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 const spanData = spanToJSON(activeSpan).data;\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 if (spanData && !spanData['http.route'] && spanData['http.target'] === '/_server') {\n activeSpan.setAttribute('http.route', serverActionName);\n activeSpan.setAttribute(SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, 'component');\n }\n }\n\n try {\n return await startSpan(\n {\n op: 'function.server_action',\n name: serverActionName,\n attributes: {\n [SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN]: 'auto.function.solidstart',\n [SEMANTIC_ATTRIBUTE_SENTRY_SOURCE]: 'component',\n },\n },\n async span => {\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: 'solidstart',\n },\n });\n }\n });\n\n return result;\n },\n );\n } finally {\n await flushIfServerless();\n }\n}\n"],"names":[],"mappings":";;;;AAIA;AACA;AACA;AACA;AACO,eAAe,+BAA+B;AACrD,EAAE,gBAAgB;AAClB,EAAE,QAAQ;AACV,EAA0B;AAC1B,EAAE,MAAM,UAAA,GAAa,aAAa,EAAE,CAAA;AACpC;AACA,EA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F;;;;"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solidrouter.client.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solidrouter.js","sources":[],"sourcesContent":[],"names":[],"mappings":";"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solidrouter.server.js","sources":[],"sourcesContent":[],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/client/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAE9B,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { BrowserOptions } from '@sentry/solid';
|
|
2
|
+
import type { Client } from '@sentry/types';
|
|
3
|
+
/**
|
|
4
|
+
* Initializes the client side of the Solid Start SDK.
|
|
5
|
+
*/
|
|
6
|
+
export declare function init(options: BrowserOptions): Client | undefined;
|
|
7
|
+
//# sourceMappingURL=sdk.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/client/sdk.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,eAAe,CAAC;AAEpD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,eAAe,CAAC;AAE5C;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM,GAAG,SAAS,CAQhE"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This serves as a build time flag that will be true by default, but false in non-debug builds or if users replace `__SENTRY_DEBUG__` in their generated code.
|
|
3
|
+
*
|
|
4
|
+
* ATTENTION: This constant must never cross package boundaries (i.e. be exported) to guarantee that it can be used for tree shaking.
|
|
5
|
+
*/
|
|
6
|
+
export declare const DEBUG_BUILD: boolean;
|
|
7
|
+
//# sourceMappingURL=debug-build.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"debug-build.d.ts","sourceRoot":"","sources":["../../../src/common/debug-build.ts"],"names":[],"mappings":"AAEA;;;;GAIG;AACH,eAAO,MAAM,WAAW,SAAkB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.client.d.ts","sourceRoot":"","sources":["../../src/index.client.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.server.d.ts","sourceRoot":"","sources":["../../src/index.server.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export * from './client';
|
|
2
|
+
export * from './server';
|
|
3
|
+
import type { Integration, Options, StackParser } from '@sentry/types';
|
|
4
|
+
import type * as clientSdk from './client';
|
|
5
|
+
import type * as serverSdk from './server';
|
|
6
|
+
/** Initializes Sentry Solid Start SDK */
|
|
7
|
+
export declare function init(options: Options | clientSdk.BrowserOptions | serverSdk.NodeOptions): void;
|
|
8
|
+
export declare const linkedErrorsIntegration: typeof clientSdk.linkedErrorsIntegration;
|
|
9
|
+
export declare const contextLinesIntegration: typeof clientSdk.contextLinesIntegration;
|
|
10
|
+
export declare const getDefaultIntegrations: (options: Options) => Integration[];
|
|
11
|
+
export declare const defaultStackParser: StackParser;
|
|
12
|
+
export declare const getClient: typeof clientSdk.getClient;
|
|
13
|
+
export declare function close(timeout?: number | undefined): PromiseLike<boolean>;
|
|
14
|
+
export declare function flush(timeout?: number | undefined): PromiseLike<boolean>;
|
|
15
|
+
export declare function lastEventId(): string | undefined;
|
|
16
|
+
export declare const continueTrace: typeof clientSdk.continueTrace;
|
|
17
|
+
export declare const metrics: typeof clientSdk.metrics & typeof serverSdk.metrics;
|
|
18
|
+
//#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M,aAAa,EAAE,OAAO,SAAS,CAAC,aAAa,CAAC;AAEnE,MAAM,CAAC,OAAO,CAAC,MAAM,OAAO,EAAE,OAAO,SAAS,CAAC,OAAO,GAAG,OAAO,SAAS,CAAC,OAAO,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { addBreadcrumb, addEventProcessor, addIntegration, addOpenTelemetryInstrumentation, addRequestDataToEvent, anrIntegration, captureCheckIn, captureConsoleIntegration, captureEvent, captureException, captureFeedback, captureMessage, captureSession, close, connectIntegration, consoleIntegration, contextLinesIntegration, continueTrace, createGetModuleFromFilename, createTransport, cron, debugIntegration, dedupeIntegration, DEFAULT_USER_INCLUDES, defaultStackParser, endSession, expressErrorHandler, expressIntegration, extractRequestData, extraErrorDataIntegration, fastifyIntegration, flush, functionToStringIntegration, generateInstrumentOnce, getActiveSpan, getAutoPerformanceIntegrations, getClient, getCurrentHub, getCurrentScope, getDefaultIntegrations, getGlobalScope, getIsolationScope, getRootSpan, getSentryRelease, getSpanDescendants, getSpanStatusFromHttpCode, graphqlIntegration, hapiIntegration, httpIntegration, inboundFiltersIntegration, initOpenTelemetry, isInitialized, koaIntegration, lastEventId, linkedErrorsIntegration, localVariablesIntegration, makeNodeTransport, metrics, modulesIntegration, mongoIntegration, mongooseIntegration, mysql2Integration, mysqlIntegration, nativeNodeFetchIntegration, nestIntegration, NodeClient, nodeContextIntegration, onUncaughtExceptionIntegration, onUnhandledRejectionIntegration, parameterize, postgresIntegration, prismaIntegration, redisIntegration, requestDataIntegration, rewriteFramesIntegration, Scope, SDK_VERSION, SEMANTIC_ATTRIBUTE_SENTRY_OP, SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE, SEMANTIC_ATTRIBUTE_SENTRY_SOURCE, sessionTimingIntegration, setContext, setCurrentClient, setExtra, setExtras, setHttpStatus, setMeasurement, setTag, setTags, setupConnectErrorHandler, setupExpressErrorHandler, setupHapiErrorHandler, setupKoaErrorHandler, setupNestErrorHandler, setUser, spanToBaggageHeader, spanToJSON, spanToTraceHeader, spotlightIntegration, startInactiveSpan, startNewTrace, startSession, startSpan, startSpanManual, trpcMiddleware, withActiveSpan, withIsolationScope, withMonitor, withScope, zodErrorsIntegration, } from '@sentry/node';
|
|
2
|
+
export * from '@sentry/node';
|
|
3
|
+
export { withSentryErrorBoundary } from '@sentry/solid';
|
|
4
|
+
export { init } from './sdk';
|
|
5
|
+
export * from './withServerActionInstrumentation';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/server/index.ts"],"names":[],"mappings":"AAKA,OAAO,EACL,aAAa,EACb,iBAAiB,EACjB,cAAc,EACd,+BAA+B,EAC/B,qBAAqB,EACrB,cAAc,EACd,cAAc,EACd,yBAAyB,EACzB,YAAY,EACZ,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,cAAc,EACd,KAAK,EACL,kBAAkB,EAClB,kBAAkB,EAClB,uBAAuB,EACvB,aAAa,EACb,2BAA2B,EAC3B,eAAe,EACf,IAAI,EACJ,gBAAgB,EAChB,iBAAiB,EACjB,qBAAqB,EACrB,kBAAkB,EAClB,UAAU,EACV,mBAAmB,EACnB,kBAAkB,EAClB,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,KAAK,EACL,2BAA2B,EAC3B,sBAAsB,EACtB,aAAa,EACb,8BAA8B,EAC9B,SAAS,EAET,aAAa,EACb,eAAe,EACf,sBAAsB,EACtB,cAAc,EACd,iBAAiB,EACjB,WAAW,EACX,gBAAgB,EAChB,kBAAkB,EAClB,yBAAyB,EACzB,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,yBAAyB,EACzB,iBAAiB,EACjB,aAAa,EACb,cAAc,EACd,WAAW,EACX,uBAAuB,EACvB,yBAAyB,EACzB,iBAAiB,EACjB,OAAO,EACP,kBAAkB,EAClB,gBAAgB,EAChB,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,0BAA0B,EAC1B,eAAe,EACf,UAAU,EACV,sBAAsB,EACtB,8BAA8B,EAC9B,+BAA+B,EAC/B,YAAY,EACZ,mBAAmB,EACnB,iBAAiB,EACjB,gBAAgB,EAChB,sBAAsB,EACtB,wBAAwB,EACxB,KAAK,EACL,WAAW,EACX,4BAA4B,EAC5B,gCAAgC,EAChC,qCAAqC,EACrC,gCAAgC,EAChC,wBAAwB,EACxB,UAAU,EACV,gBAAgB,EAChB,QAAQ,EACR,SAAS,EACT,aAAa,EACb,cAAc,EACd,MAAM,EACN,OAAO,EACP,wBAAwB,EACxB,wBAAwB,EACxB,qBAAqB,EACrB,oBAAoB,EACpB,qBAAqB,EACrB,OAAO,EACP,mBAAmB,EACnB,UAAU,EACV,iBAAiB,EACjB,oBAAoB,EACpB,iBAAiB,EACjB,aAAa,EACb,YAAY,EACZ,SAAS,EACT,eAAe,EACf,cAAc,EACd,cAAc,EACd,kBAAkB,EAClB,WAAW,EACX,SAAS,EACT,oBAAoB,GACrB,MAAM,cAAc,CAAC;AAGtB,cAAc,cAAc,CAAC;AAE7B,OAAO,EAAE,uBAAuB,EAAE,MAAM,eAAe,CAAC;AAIxD,OAAO,EAAE,IAAI,EAAE,MAAM,OAAO,CAAC;AAE7B,cAAc,mCAAmC,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"sdk.d.ts","sourceRoot":"","sources":["../../../src/server/sdk.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAI5D;;GAEG;AACH,wBAAgB,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,UAAU,GAAG,SAAS,CASjE"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Options } from '@sentry/types';
|
|
2
|
+
/** Flush the event queue to ensure that events get sent to Sentry before the response is finished and the lambda ends */
|
|
3
|
+
export declare function flushIfServerless(): Promise<void>;
|
|
4
|
+
/**
|
|
5
|
+
* Determines if a thrown "error" is a redirect Response which Solid Start users can throw to redirect to another route.
|
|
6
|
+
* see: https://docs.solidjs.com/solid-router/reference/data-apis/response-helpers#redirect
|
|
7
|
+
* @param error the potential redirect error
|
|
8
|
+
*/
|
|
9
|
+
export declare function isRedirect(error: unknown): boolean;
|
|
10
|
+
/**
|
|
11
|
+
* Adds an event processor to filter out low quality transactions,
|
|
12
|
+
* e.g. to filter out transactions for build assets
|
|
13
|
+
*/
|
|
14
|
+
export declare function filterLowQualityTransactions(options: Options): void;
|
|
15
|
+
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../src/server/utils.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAkB,OAAO,EAAE,MAAM,eAAe,CAAC;AAI7D,yHAAyH;AACzH,wBAAsB,iBAAiB,IAAI,OAAO,CAAC,IAAI,CAAC,CAYvD;AAED;;;;GAIG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,OAAO,GAAG,OAAO,CAQlD;AAED;;;GAGG;AACH,wBAAgB,4BAA4B,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,CAiBnE"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Wraps a server action (functions that use the 'use server' directive)
|
|
3
|
+
* function body with Sentry Error and Performance instrumentation.
|
|
4
|
+
*/
|
|
5
|
+
export declare function withServerActionInstrumentation<A extends (...args: unknown[]) => unknown>(serverActionName: string, callback: A): Promise<ReturnType<A>>;
|
|
6
|
+
//# sourceMappingURL=withServerActionInstrumentation.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"withServerActionInstrumentation.d.ts","sourceRoot":"","sources":["../../../src/server/withServerActionInstrumentation.ts"],"names":[],"mappings":"AAIA;;;GAGG;AACH,wBAAsB,+BAA+B,CAAC,CAAC,SAAS,CAAC,GAAG,IAAI,EAAE,OAAO,EAAE,KAAK,OAAO,EAC7F,gBAAgB,EAAE,MAAM,EACxB,QAAQ,EAAE,CAAC,GACV,OAAO,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CA8CxB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solidrouter.d.ts","sourceRoot":"","sources":["../src/client/solidrouter.ts"],"names":[],"mappings":"AAAA,cAAc,2BAA2B,CAAC"}
|
package/middleware.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import type { ResponseMiddleware } from '@solidjs/start/middleware';
|
|
2
|
+
import type { FetchEvent } from '@solidjs/start/server';
|
|
3
|
+
export type ResponseMiddlewareResponse = Parameters<ResponseMiddleware>[1] & {
|
|
4
|
+
__sentry_wrapped__?: boolean;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Returns an `onBeforeResponse` solid start middleware handler that adds tracing data as
|
|
8
|
+
* <meta> tags to a page on pageload to enable distributed tracing.
|
|
9
|
+
*/
|
|
10
|
+
export declare function sentryBeforeResponseMiddleware(): (event: FetchEvent, response: ResponseMiddlewareResponse) => Promise<void>;
|
|
11
|
+
//# sourceMappingURL=middleware.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"middleware.d.ts","sourceRoot":"","sources":["src/middleware.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AACpE,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,uBAAuB,CAAC;AAExD,MAAM,MAAM,0BAA0B,GAAG,UAAU,CAAC,kBAAkB,CAAC,CAAC,CAAC,CAAC,GAAG;IAC3E,kBAAkB,CAAC,EAAE,OAAO,CAAC;CAC9B,CAAC;AAaF;;;GAGG;AACH,wBAAgB,8BAA8B,YACE,UAAU,YAAY,0BAA0B,mBA6B/F"}
|
package/package.json
ADDED
|
@@ -0,0 +1,134 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sentry/solidstart",
|
|
3
|
+
"version": "8.25.0",
|
|
4
|
+
"description": "Official Sentry SDK for Solid Start",
|
|
5
|
+
"repository": "git://github.com/getsentry/sentry-javascript.git",
|
|
6
|
+
"homepage": "https://github.com/getsentry/sentry-javascript/tree/master/packages/solidstart",
|
|
7
|
+
"author": "Sentry",
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"engines": {
|
|
10
|
+
"node": ">=16"
|
|
11
|
+
},
|
|
12
|
+
"files": [
|
|
13
|
+
"/build",
|
|
14
|
+
"/client",
|
|
15
|
+
"/server",
|
|
16
|
+
"/*.d.ts",
|
|
17
|
+
"/*.d.ts.map"
|
|
18
|
+
],
|
|
19
|
+
"main": "build/cjs/index.server.js",
|
|
20
|
+
"module": "build/esm/index.server.js",
|
|
21
|
+
"browser": "build/esm/index.client.js",
|
|
22
|
+
"types": "build/types/index.types.d.ts",
|
|
23
|
+
"//": [
|
|
24
|
+
"For `@sentry/solidstart/solidrouter` types to resolve correctly for both `moduleResolution: bundler` and `moduleResolution: node`",
|
|
25
|
+
"- type definitions have to be exported at root level (/build won't work)",
|
|
26
|
+
"- type definitions have to match in name (i.e. `solidrouter.d.ts`)",
|
|
27
|
+
"- the `types` entry needs to be set both at the root of the export and within `browser` and `node`"
|
|
28
|
+
],
|
|
29
|
+
"exports": {
|
|
30
|
+
"./package.json": "./package.json",
|
|
31
|
+
".": {
|
|
32
|
+
"types": "./build/types/index.types.d.ts",
|
|
33
|
+
"browser": {
|
|
34
|
+
"import": "./build/esm/index.client.js",
|
|
35
|
+
"require": "./build/cjs/index.client.js"
|
|
36
|
+
},
|
|
37
|
+
"node": {
|
|
38
|
+
"import": "./build/esm/index.server.js",
|
|
39
|
+
"require": "./build/cjs/index.server.js"
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"./middleware": {
|
|
43
|
+
"types": "./middleware.d.ts",
|
|
44
|
+
"import": {
|
|
45
|
+
"types": "./middleware.d.ts",
|
|
46
|
+
"default": "./build/esm/middleware.js"
|
|
47
|
+
},
|
|
48
|
+
"require": {
|
|
49
|
+
"types": "./middleware.d.ts",
|
|
50
|
+
"default": "./build/cjs/middleware.js"
|
|
51
|
+
}
|
|
52
|
+
},
|
|
53
|
+
"./solidrouter": {
|
|
54
|
+
"types": "./solidrouter.d.ts",
|
|
55
|
+
"browser": {
|
|
56
|
+
"types": "./solidrouter.d.ts",
|
|
57
|
+
"import": "./build/esm/solidrouter.client.js",
|
|
58
|
+
"require": "./build/cjs/solidrouter.client.js"
|
|
59
|
+
},
|
|
60
|
+
"node": {
|
|
61
|
+
"types": "./solidrouter.d.ts",
|
|
62
|
+
"import": "./build/esm/solidrouter.server.js",
|
|
63
|
+
"require": "./build/cjs/solidrouter.server.js"
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
},
|
|
67
|
+
"publishConfig": {
|
|
68
|
+
"access": "public"
|
|
69
|
+
},
|
|
70
|
+
"peerDependencies": {
|
|
71
|
+
"@solidjs/router": "^0.13.4",
|
|
72
|
+
"@solidjs/start": "^1.0.0"
|
|
73
|
+
},
|
|
74
|
+
"peerDependenciesMeta": {
|
|
75
|
+
"@solidjs/router": {
|
|
76
|
+
"optional": true
|
|
77
|
+
}
|
|
78
|
+
},
|
|
79
|
+
"dependencies": {
|
|
80
|
+
"@opentelemetry/instrumentation": "^0.52.1",
|
|
81
|
+
"@sentry/core": "8.25.0",
|
|
82
|
+
"@sentry/node": "8.25.0",
|
|
83
|
+
"@sentry/opentelemetry": "8.25.0",
|
|
84
|
+
"@sentry/solid": "8.25.0",
|
|
85
|
+
"@sentry/types": "8.25.0",
|
|
86
|
+
"@sentry/utils": "8.25.0",
|
|
87
|
+
"@sentry/vite-plugin": "2.19.0"
|
|
88
|
+
},
|
|
89
|
+
"devDependencies": {
|
|
90
|
+
"@solidjs/router": "^0.13.4",
|
|
91
|
+
"@solidjs/start": "^1.0.0",
|
|
92
|
+
"@solidjs/testing-library": "0.8.5",
|
|
93
|
+
"@testing-library/jest-dom": "^6.4.5",
|
|
94
|
+
"@testing-library/user-event": "^14.5.2",
|
|
95
|
+
"vite-plugin-solid": "^2.8.2"
|
|
96
|
+
},
|
|
97
|
+
"scripts": {
|
|
98
|
+
"build": "run-p build:transpile build:types",
|
|
99
|
+
"build:dev": "yarn build",
|
|
100
|
+
"build:transpile": "rollup -c rollup.npm.config.mjs",
|
|
101
|
+
"build:types": "run-s build:types:core build:types:subexports",
|
|
102
|
+
"build:types:core": "tsc -p tsconfig.types.json",
|
|
103
|
+
"build:types:subexports": "tsc -p tsconfig.subexports-types.json",
|
|
104
|
+
"build:watch": "run-p build:transpile:watch build:types:watch",
|
|
105
|
+
"build:dev:watch": "yarn build:watch",
|
|
106
|
+
"build:transpile:watch": "rollup -c rollup.npm.config.mjs --watch",
|
|
107
|
+
"build:types:watch": "tsc -p tsconfig.types.json --watch",
|
|
108
|
+
"build:tarball": "npm pack",
|
|
109
|
+
"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",
|
|
110
|
+
"clean": "rimraf build coverage sentry-solidstart-*.tgz ./*.d.ts ./*.d.ts.map ./client ./server",
|
|
111
|
+
"fix": "eslint . --format stylish --fix",
|
|
112
|
+
"lint": "eslint . --format stylish",
|
|
113
|
+
"test": "yarn test:unit",
|
|
114
|
+
"test:unit": "vitest run",
|
|
115
|
+
"test:watch": "vitest --watch",
|
|
116
|
+
"yalc:publish": "yalc publish --push --sig"
|
|
117
|
+
},
|
|
118
|
+
"volta": {
|
|
119
|
+
"extends": "../../package.json"
|
|
120
|
+
},
|
|
121
|
+
"nx": {
|
|
122
|
+
"targets": {
|
|
123
|
+
"build:types": {
|
|
124
|
+
"outputs": [
|
|
125
|
+
"{projectRoot}/build/types",
|
|
126
|
+
"{projectRoot}/client",
|
|
127
|
+
"{projectRoot}/server",
|
|
128
|
+
"{projectRoot}/*.d.ts",
|
|
129
|
+
"{projectRoot}/*.d.ts.map"
|
|
130
|
+
]
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { HashRouter, MemoryRouter, Router as BaseRouter, StaticRouter } from '@solidjs/router';
|
|
2
|
+
export type RouterType = typeof BaseRouter | typeof HashRouter | typeof MemoryRouter | typeof StaticRouter;
|
|
3
|
+
/**
|
|
4
|
+
* On the client, router hooks are used to start navigation spans.
|
|
5
|
+
* This creates a matching structure that's purely pass-through to avoid hydration errors.
|
|
6
|
+
*/
|
|
7
|
+
export declare function withSentryRouterRouting(Router: RouterType): RouterType;
|
|
8
|
+
//# sourceMappingURL=solidrouter.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solidrouter.d.ts","sourceRoot":"","sources":["../src/server/solidrouter.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAqB,MAAM,IAAI,UAAU,EAAE,YAAY,EAAE,MAAM,iBAAiB,CAAC;AA0BvH,MAAM,MAAM,UAAU,GAAG,OAAO,UAAU,GAAG,OAAO,UAAU,GAAG,OAAO,YAAY,GAAG,OAAO,YAAY,CAAC;AAE3G;;;GAGG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAUtE"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solidrouter.client.d.ts","sourceRoot":"","sources":["src/solidrouter.client.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|
package/solidrouter.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solidrouter.d.ts","sourceRoot":"","sources":["src/solidrouter.ts"],"names":[],"mappings":"AAIA,cAAc,sBAAsB,CAAC;AACrC,cAAc,sBAAsB,CAAC;AAErC,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAC;AAEvD,MAAM,CAAC,OAAO,UAAU,uBAAuB,CAAC,MAAM,EAAE,UAAU,GAAG,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"solidrouter.server.d.ts","sourceRoot":"","sources":["src/solidrouter.server.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAC"}
|