Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions static/app/gettingStartedDocs/node/hapi/agentMonitoring.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import {getNodeAgentMonitoringOnboarding} from 'sentry/gettingStartedDocs/node/node/utils';

export const agentMonitoring = getNodeAgentMonitoringOnboarding();
29 changes: 29 additions & 0 deletions static/app/gettingStartedDocs/node/hapi/crashReport.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
import {
StepType,
type OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {
getCrashReportJavaScriptInstallSteps,
getCrashReportModalConfigDescription,
getCrashReportModalIntroduction,
} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';

export const crashReport: OnboardingConfig = {
introduction: () => getCrashReportModalIntroduction(),
install: params => getCrashReportJavaScriptInstallSteps(params),
configure: () => [
{
type: StepType.CONFIGURE,
content: [
{
type: 'text',
text: getCrashReportModalConfigDescription({
link: 'https://docs.sentry.io/platforms/javascript/guides/hapi/user-feedback/configuration/#crash-report-modal',
}),
},
],
},
],
verify: () => [],
nextSteps: () => [],
};
48 changes: 48 additions & 0 deletions static/app/gettingStartedDocs/node/hapi/feedback.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
import {
StepType,
type OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {
getCrashReportApiIntroduction,
getCrashReportInstallDescription,
} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';

export const feedback: OnboardingConfig = {
introduction: () => getCrashReportApiIntroduction(),
install: () => [
{
type: StepType.INSTALL,
content: [
{
type: 'text',
text: getCrashReportInstallDescription(),
},
{
type: 'code',
tabs: [
{
label: 'JavaScript',
language: 'javascript',
code: `import * as Sentry from "@sentry/node";

const eventId = Sentry.captureMessage("User Feedback");
// OR: const eventId = Sentry.lastEventId();

const userFeedback = {
event_id: eventId,
name: "John Doe",
email: "john@doe.com",
comments: "I really like your App, thanks!",
};
Sentry.captureUserFeedback(userFeedback);
`,
},
],
},
],
},
],
configure: () => [],
verify: () => [],
nextSteps: () => [],
};
21 changes: 21 additions & 0 deletions static/app/gettingStartedDocs/node/hapi/index.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import type {Docs} from 'sentry/components/onboarding/gettingStartedDoc/types';

import {agentMonitoring} from './agentMonitoring';
import {crashReport} from './crashReport';
import {feedback} from './feedback';
import {logs} from './logs';
import {mcp} from './mcp';
import {onboarding} from './onboarding';
import {profiling} from './profiling';

const docs: Docs = {
onboarding,
feedbackOnboardingCrashApi: feedback,
crashReportOnboarding: crashReport,
logsOnboarding: logs,
profilingOnboarding: profiling,
agentMonitoringOnboarding: agentMonitoring,
mcpOnboarding: mcp,
};

export default docs;
6 changes: 6 additions & 0 deletions static/app/gettingStartedDocs/node/hapi/logs.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import {getNodeLogsOnboarding} from 'sentry/gettingStartedDocs/node/node/utils';

export const logs = getNodeLogsOnboarding({
docsPlatform: 'hapi',
packageName: '@sentry/node',
});
3 changes: 3 additions & 0 deletions static/app/gettingStartedDocs/node/hapi/mcp.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import {getNodeMcpOnboarding} from 'sentry/gettingStartedDocs/node/node/utils';

export const mcp = getNodeMcpOnboarding();
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {textWithMarkupMatcher} from 'sentry-test/utils';

import {ProductSolution} from 'sentry/components/onboarding/gettingStartedDoc/types';

import docs from './hapi';
import docs from '.';

describe('hapi onboarding docs', () => {
it('renders onboarding docs correctly', () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,31 +1,17 @@
import {ExternalLink} from 'sentry/components/core/link';
import type {
Docs,
DocsParams,
OnboardingConfig,
} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/types';
import {getUploadSourceMapsStep} from 'sentry/components/onboarding/gettingStartedDoc/utils';
import {
getCrashReportApiIntroduction,
getCrashReportInstallDescription,
getCrashReportJavaScriptInstallSteps,
getCrashReportModalConfigDescription,
getCrashReportModalIntroduction,
} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
import {t, tct} from 'sentry/locale';
import {
getImportInstrumentSnippet,
getInstallCodeBlock,
getNodeAgentMonitoringOnboarding,
getNodeLogsOnboarding,
getNodeMcpOnboarding,
getNodeProfilingOnboarding,
getSdkInitSnippet,
getSentryImportSnippet,
} from 'sentry/utils/gettingStartedDocs/node';

type Params = DocsParams;
} from 'sentry/gettingStartedDocs/node/node/utils';
import {t, tct} from 'sentry/locale';

const getSdkSetupSnippet = () => `
${getImportInstrumentSnippet()}
Expand All @@ -49,7 +35,7 @@ const init = async () => {
init();
`;

const getVerifySnippet = (params: Params) => `
const getVerifySnippet = (params: DocsParams) => `
server.route({
method: 'GET',
path: '/debug-sentry',
Expand All @@ -67,7 +53,7 @@ server.route({
});
`;

const onboarding: OnboardingConfig = {
export const onboarding: OnboardingConfig = {
introduction: () =>
tct("In this quick guide you'll use [strong:npm] or [strong:yarn] to set up:", {
strong: <strong />,
Expand Down Expand Up @@ -142,7 +128,7 @@ const onboarding: OnboardingConfig = {
...params,
}),
],
verify: (params: Params) => [
verify: (params: DocsParams) => [
{
type: StepType.VERIFY,
content: [
Expand All @@ -160,7 +146,7 @@ const onboarding: OnboardingConfig = {
],
},
],
nextSteps: (params: Params) => {
nextSteps: (params: DocsParams) => {
const steps = [];

if (params.isLogsSelected) {
Expand All @@ -177,78 +163,3 @@ const onboarding: OnboardingConfig = {
return steps;
},
};

const feedbackOnboardingNode: OnboardingConfig = {
introduction: () => getCrashReportApiIntroduction(),
install: () => [
{
type: StepType.INSTALL,
content: [
{
type: 'text',
text: getCrashReportInstallDescription(),
},
{
type: 'code',
tabs: [
{
label: 'JavaScript',
language: 'javascript',
code: `import * as Sentry from "@sentry/node";

const eventId = Sentry.captureMessage("User Feedback");
// OR: const eventId = Sentry.lastEventId();

const userFeedback = {
event_id: eventId,
name: "John Doe",
email: "john@doe.com",
comments: "I really like your App, thanks!",
};
Sentry.captureUserFeedback(userFeedback);
`,
},
],
},
],
},
],
configure: () => [],
verify: () => [],
nextSteps: () => [],
};

const crashReportOnboarding: OnboardingConfig = {
introduction: () => getCrashReportModalIntroduction(),
install: (params: Params) => getCrashReportJavaScriptInstallSteps(params),
configure: () => [
{
type: StepType.CONFIGURE,
content: [
{
type: 'text',
text: getCrashReportModalConfigDescription({
link: 'https://docs.sentry.io/platforms/javascript/guides/hapi/user-feedback/configuration/#crash-report-modal',
}),
},
],
},
],
verify: () => [],
nextSteps: () => [],
};

const docs: Docs = {
onboarding,
feedbackOnboardingCrashApi: feedbackOnboardingNode,
crashReportOnboarding,
logsOnboarding: getNodeLogsOnboarding({
docsPlatform: 'hapi',
packageName: '@sentry/node',
}),
profilingOnboarding: getNodeProfilingOnboarding(),
agentMonitoringOnboarding: getNodeAgentMonitoringOnboarding(),
mcpOnboarding: getNodeMcpOnboarding(),
};

export default docs;
3 changes: 3 additions & 0 deletions static/app/gettingStartedDocs/node/hapi/profiling.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
import {getNodeProfilingOnboarding} from 'sentry/gettingStartedDocs/node/node/utils';

export const profiling = getNodeProfilingOnboarding();
Loading