Skip to content

Commit 9768eb8

Browse files
1 parent cd2166d commit 9768eb8

File tree

9 files changed

+120
-96
lines changed

9 files changed

+120
-96
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {getNodeAgentMonitoringOnboarding} from 'sentry/gettingStartedDocs/node/node/utils';
2+
3+
export const agentMonitoring = getNodeAgentMonitoringOnboarding();
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
import {
2+
StepType,
3+
type OnboardingConfig,
4+
} from 'sentry/components/onboarding/gettingStartedDoc/types';
5+
import {
6+
getCrashReportJavaScriptInstallSteps,
7+
getCrashReportModalConfigDescription,
8+
getCrashReportModalIntroduction,
9+
} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
10+
11+
export const crashReport: OnboardingConfig = {
12+
introduction: () => getCrashReportModalIntroduction(),
13+
install: params => getCrashReportJavaScriptInstallSteps(params),
14+
configure: () => [
15+
{
16+
type: StepType.CONFIGURE,
17+
content: [
18+
{
19+
type: 'text',
20+
text: getCrashReportModalConfigDescription({
21+
link: 'https://docs.sentry.io/platforms/javascript/guides/hapi/user-feedback/configuration/#crash-report-modal',
22+
}),
23+
},
24+
],
25+
},
26+
],
27+
verify: () => [],
28+
nextSteps: () => [],
29+
};
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
import {
2+
StepType,
3+
type OnboardingConfig,
4+
} from 'sentry/components/onboarding/gettingStartedDoc/types';
5+
import {
6+
getCrashReportApiIntroduction,
7+
getCrashReportInstallDescription,
8+
} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
9+
10+
export const feedback: OnboardingConfig = {
11+
introduction: () => getCrashReportApiIntroduction(),
12+
install: () => [
13+
{
14+
type: StepType.INSTALL,
15+
content: [
16+
{
17+
type: 'text',
18+
text: getCrashReportInstallDescription(),
19+
},
20+
{
21+
type: 'code',
22+
tabs: [
23+
{
24+
label: 'JavaScript',
25+
language: 'javascript',
26+
code: `import * as Sentry from "@sentry/node";
27+
28+
const eventId = Sentry.captureMessage("User Feedback");
29+
// OR: const eventId = Sentry.lastEventId();
30+
31+
const userFeedback = {
32+
event_id: eventId,
33+
name: "John Doe",
34+
email: "john@doe.com",
35+
comments: "I really like your App, thanks!",
36+
};
37+
Sentry.captureUserFeedback(userFeedback);
38+
`,
39+
},
40+
],
41+
},
42+
],
43+
},
44+
],
45+
configure: () => [],
46+
verify: () => [],
47+
nextSteps: () => [],
48+
};
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
import type {Docs} from 'sentry/components/onboarding/gettingStartedDoc/types';
2+
3+
import {agentMonitoring} from './agentMonitoring';
4+
import {crashReport} from './crashReport';
5+
import {feedback} from './feedback';
6+
import {logs} from './logs';
7+
import {mcp} from './mcp';
8+
import {onboarding} from './onboarding';
9+
import {profiling} from './profiling';
10+
11+
const docs: Docs = {
12+
onboarding,
13+
feedbackOnboardingCrashApi: feedback,
14+
crashReportOnboarding: crashReport,
15+
logsOnboarding: logs,
16+
profilingOnboarding: profiling,
17+
agentMonitoringOnboarding: agentMonitoring,
18+
mcpOnboarding: mcp,
19+
};
20+
21+
export default docs;
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import {getNodeLogsOnboarding} from 'sentry/gettingStartedDocs/node/node/utils';
2+
3+
export const logs = getNodeLogsOnboarding({
4+
docsPlatform: 'hapi',
5+
packageName: '@sentry/node',
6+
});
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {getNodeMcpOnboarding} from 'sentry/gettingStartedDocs/node/node/utils';
2+
3+
export const mcp = getNodeMcpOnboarding();

static/app/gettingStartedDocs/node/hapi.spec.tsx renamed to static/app/gettingStartedDocs/node/hapi/onboarding.spec.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ import {textWithMarkupMatcher} from 'sentry-test/utils';
66

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

9-
import docs from './hapi';
9+
import docs from '.';
1010

1111
describe('hapi onboarding docs', () => {
1212
it('renders onboarding docs correctly', () => {

static/app/gettingStartedDocs/node/hapi.tsx renamed to static/app/gettingStartedDocs/node/hapi/onboarding.tsx

Lines changed: 6 additions & 95 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,17 @@
11
import {ExternalLink} from 'sentry/components/core/link';
22
import type {
3-
Docs,
43
DocsParams,
54
OnboardingConfig,
65
} from 'sentry/components/onboarding/gettingStartedDoc/types';
76
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/types';
87
import {getUploadSourceMapsStep} from 'sentry/components/onboarding/gettingStartedDoc/utils';
9-
import {
10-
getCrashReportApiIntroduction,
11-
getCrashReportInstallDescription,
12-
getCrashReportJavaScriptInstallSteps,
13-
getCrashReportModalConfigDescription,
14-
getCrashReportModalIntroduction,
15-
} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
16-
import {t, tct} from 'sentry/locale';
178
import {
189
getImportInstrumentSnippet,
1910
getInstallCodeBlock,
20-
getNodeAgentMonitoringOnboarding,
21-
getNodeLogsOnboarding,
22-
getNodeMcpOnboarding,
23-
getNodeProfilingOnboarding,
2411
getSdkInitSnippet,
2512
getSentryImportSnippet,
26-
} from 'sentry/utils/gettingStartedDocs/node';
27-
28-
type Params = DocsParams;
13+
} from 'sentry/gettingStartedDocs/node/node/utils';
14+
import {t, tct} from 'sentry/locale';
2915

3016
const getSdkSetupSnippet = () => `
3117
${getImportInstrumentSnippet()}
@@ -49,7 +35,7 @@ const init = async () => {
4935
init();
5036
`;
5137

52-
const getVerifySnippet = (params: Params) => `
38+
const getVerifySnippet = (params: DocsParams) => `
5339
server.route({
5440
method: 'GET',
5541
path: '/debug-sentry',
@@ -67,7 +53,7 @@ server.route({
6753
});
6854
`;
6955

70-
const onboarding: OnboardingConfig = {
56+
export const onboarding: OnboardingConfig = {
7157
introduction: () =>
7258
tct("In this quick guide you'll use [strong:npm] or [strong:yarn] to set up:", {
7359
strong: <strong />,
@@ -142,7 +128,7 @@ const onboarding: OnboardingConfig = {
142128
...params,
143129
}),
144130
],
145-
verify: (params: Params) => [
131+
verify: (params: DocsParams) => [
146132
{
147133
type: StepType.VERIFY,
148134
content: [
@@ -160,7 +146,7 @@ const onboarding: OnboardingConfig = {
160146
],
161147
},
162148
],
163-
nextSteps: (params: Params) => {
149+
nextSteps: (params: DocsParams) => {
164150
const steps = [];
165151

166152
if (params.isLogsSelected) {
@@ -177,78 +163,3 @@ const onboarding: OnboardingConfig = {
177163
return steps;
178164
},
179165
};
180-
181-
const feedbackOnboardingNode: OnboardingConfig = {
182-
introduction: () => getCrashReportApiIntroduction(),
183-
install: () => [
184-
{
185-
type: StepType.INSTALL,
186-
content: [
187-
{
188-
type: 'text',
189-
text: getCrashReportInstallDescription(),
190-
},
191-
{
192-
type: 'code',
193-
tabs: [
194-
{
195-
label: 'JavaScript',
196-
language: 'javascript',
197-
code: `import * as Sentry from "@sentry/node";
198-
199-
const eventId = Sentry.captureMessage("User Feedback");
200-
// OR: const eventId = Sentry.lastEventId();
201-
202-
const userFeedback = {
203-
event_id: eventId,
204-
name: "John Doe",
205-
email: "john@doe.com",
206-
comments: "I really like your App, thanks!",
207-
};
208-
Sentry.captureUserFeedback(userFeedback);
209-
`,
210-
},
211-
],
212-
},
213-
],
214-
},
215-
],
216-
configure: () => [],
217-
verify: () => [],
218-
nextSteps: () => [],
219-
};
220-
221-
const crashReportOnboarding: OnboardingConfig = {
222-
introduction: () => getCrashReportModalIntroduction(),
223-
install: (params: Params) => getCrashReportJavaScriptInstallSteps(params),
224-
configure: () => [
225-
{
226-
type: StepType.CONFIGURE,
227-
content: [
228-
{
229-
type: 'text',
230-
text: getCrashReportModalConfigDescription({
231-
link: 'https://docs.sentry.io/platforms/javascript/guides/hapi/user-feedback/configuration/#crash-report-modal',
232-
}),
233-
},
234-
],
235-
},
236-
],
237-
verify: () => [],
238-
nextSteps: () => [],
239-
};
240-
241-
const docs: Docs = {
242-
onboarding,
243-
feedbackOnboardingCrashApi: feedbackOnboardingNode,
244-
crashReportOnboarding,
245-
logsOnboarding: getNodeLogsOnboarding({
246-
docsPlatform: 'hapi',
247-
packageName: '@sentry/node',
248-
}),
249-
profilingOnboarding: getNodeProfilingOnboarding(),
250-
agentMonitoringOnboarding: getNodeAgentMonitoringOnboarding(),
251-
mcpOnboarding: getNodeMcpOnboarding(),
252-
};
253-
254-
export default docs;
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import {getNodeProfilingOnboarding} from 'sentry/gettingStartedDocs/node/node/utils';
2+
3+
export const profiling = getNodeProfilingOnboarding();

0 commit comments

Comments
 (0)