Skip to content

Commit 4fa11af

Browse files
ref(onboarding): Split gcp functions onboarding docs (#102650)
Contributes to https://linear.app/getsentry/issue/TET-864/introduce-folders-for-onboarding-platforms
1 parent f27e037 commit 4fa11af

File tree

8 files changed

+76
-61
lines changed

8 files changed

+76
-61
lines changed
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import {getNodeAgentMonitoringOnboarding} from 'sentry/gettingStartedDocs/node/node/utils';
2+
3+
export const agentMonitoring = getNodeAgentMonitoringOnboarding({
4+
packageName: '@sentry/google-cloud-serverless',
5+
});
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/gcp-functions/user-feedback/configuration/#crash-report-modal',
22+
}),
23+
},
24+
],
25+
},
26+
],
27+
verify: () => [],
28+
nextSteps: () => [],
29+
};
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
import type {Docs} from 'sentry/components/onboarding/gettingStartedDoc/types';
2+
3+
import {agentMonitoring} from './agentMonitoring';
4+
import {crashReport} from './crashReport';
5+
import {logs} from './logs';
6+
import {mcp} from './mcp';
7+
import {onboarding} from './onboarding';
8+
import {profiling} from './profiling';
9+
10+
const docs: Docs = {
11+
onboarding,
12+
crashReportOnboarding: crashReport,
13+
profilingOnboarding: profiling,
14+
logsOnboarding: logs,
15+
agentMonitoringOnboarding: agentMonitoring,
16+
mcpOnboarding: mcp,
17+
};
18+
19+
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: 'gcp-functions',
5+
packageName: '@sentry/google-cloud-serverless',
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/gcpfunctions.spec.tsx renamed to static/app/gettingStartedDocs/node/gcpfunctions/onboarding.spec.tsx

Lines changed: 2 additions & 4 deletions
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 './gcpfunctions';
9+
import docs from '.';
1010

1111
describe('gcpfunctions onboarding docs', () => {
1212
it('renders onboarding docs correctly', () => {
@@ -22,9 +22,7 @@ describe('gcpfunctions onboarding docs', () => {
2222

2323
// Includes import statement
2424
const allMatches = screen.getAllByText(
25-
textWithMarkupMatcher(
26-
/const Sentry = require\("@sentry\/google-cloud-serverless"\);/
27-
)
25+
textWithMarkupMatcher(/import \* as Sentry from "@sentry\/google-cloud-serverless"/)
2826
);
2927
allMatches.forEach(match => {
3028
expect(match).toBeInTheDocument();

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

Lines changed: 7 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,16 @@
11
import type {
2-
Docs,
32
DocsParams,
43
OnboardingConfig,
54
} from 'sentry/components/onboarding/gettingStartedDoc/types';
65
import {StepType} from 'sentry/components/onboarding/gettingStartedDoc/types';
76
import {getUploadSourceMapsStep} from 'sentry/components/onboarding/gettingStartedDoc/utils';
8-
import {
9-
getCrashReportJavaScriptInstallSteps,
10-
getCrashReportModalConfigDescription,
11-
getCrashReportModalIntroduction,
12-
} from 'sentry/components/onboarding/gettingStartedDoc/utils/feedbackOnboarding';
13-
import {t, tct} from 'sentry/locale';
147
import {
158
getInstallCodeBlock,
16-
getNodeAgentMonitoringOnboarding,
17-
getNodeLogsOnboarding,
18-
getNodeMcpOnboarding,
19-
getNodeProfilingOnboarding,
209
getSdkInitSnippet,
21-
} from 'sentry/utils/gettingStartedDocs/node';
22-
23-
type Params = DocsParams;
10+
} from 'sentry/gettingStartedDocs/node/node/utils';
11+
import {t, tct} from 'sentry/locale';
2412

25-
const getSdkSetupSnippet = (params: Params) => `
13+
const getSdkSetupSnippet = (params: DocsParams) => `
2614
// IMPORTANT: Make sure to import and initialize Sentry at the top of your file.
2715
${getSdkInitSnippet(params, 'gpc')}
2816
// Place any other require/import statements here
@@ -46,7 +34,7 @@ exports.helloEvents = Sentry.wrapCloudEventFunction(
4634
}
4735
);`;
4836

49-
const getVerifySnippet = (params: Params) => `
37+
const getVerifySnippet = (params: DocsParams) => `
5038
exports.helloHttp = Sentry.wrapHttpFunction((req, res) => {${
5139
params.isLogsSelected
5240
? `
@@ -59,7 +47,7 @@ exports.helloHttp = Sentry.wrapHttpFunction((req, res) => {${
5947
throw new Error("oh, hello there!");
6048
});`;
6149

62-
const onboarding: OnboardingConfig = {
50+
export const onboarding: OnboardingConfig = {
6351
introduction: () =>
6452
tct("In this quick guide you'll use [strong:npm] or [strong:yarn] to set up:", {
6553
strong: <strong />,
@@ -105,7 +93,7 @@ const onboarding: OnboardingConfig = {
10593
...params,
10694
}),
10795
],
108-
verify: (params: Params) => [
96+
verify: (params: DocsParams) => [
10997
{
11098
type: StepType.VERIFY,
11199
content: [
@@ -123,7 +111,7 @@ const onboarding: OnboardingConfig = {
123111
],
124112
},
125113
],
126-
nextSteps: (params: Params) => {
114+
nextSteps: (params: DocsParams) => {
127115
const steps = [];
128116

129117
if (params.isLogsSelected) {
@@ -140,41 +128,3 @@ const onboarding: OnboardingConfig = {
140128
return steps;
141129
},
142130
};
143-
144-
const crashReportOnboarding: OnboardingConfig = {
145-
introduction: () => getCrashReportModalIntroduction(),
146-
install: (params: Params) => getCrashReportJavaScriptInstallSteps(params),
147-
configure: () => [
148-
{
149-
type: StepType.CONFIGURE,
150-
content: [
151-
{
152-
type: 'text',
153-
text: getCrashReportModalConfigDescription({
154-
link: 'https://docs.sentry.io/platforms/javascript/guides/gcp-functions/user-feedback/configuration/#crash-report-modal',
155-
}),
156-
},
157-
],
158-
},
159-
],
160-
verify: () => [],
161-
nextSteps: () => [],
162-
};
163-
164-
const docs: Docs = {
165-
onboarding,
166-
crashReportOnboarding,
167-
profilingOnboarding: getNodeProfilingOnboarding({
168-
packageName: '@sentry/google-cloud-serverless',
169-
}),
170-
logsOnboarding: getNodeLogsOnboarding({
171-
docsPlatform: 'gcp-functions',
172-
packageName: '@sentry/google-cloud-serverless',
173-
}),
174-
agentMonitoringOnboarding: getNodeAgentMonitoringOnboarding({
175-
packageName: '@sentry/google-cloud-serverless',
176-
}),
177-
mcpOnboarding: getNodeMcpOnboarding(),
178-
};
179-
180-
export default docs;
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
import {getNodeProfilingOnboarding} from 'sentry/gettingStartedDocs/node/node/utils';
2+
3+
export const profiling = getNodeProfilingOnboarding({
4+
packageName: '@sentry/google-cloud-serverless',
5+
});

0 commit comments

Comments
 (0)