/
platforms.tsx
108 lines (95 loc) · 3.02 KB
/
platforms.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
import integrationDocsPlatforms from 'integration-docs-platforms';
import sortBy from 'lodash/sortBy';
import {t} from 'sentry/locale';
import {PlatformIntegration} from 'sentry/types';
import {tracing} from './platformCategories';
const goPlatforms = [
{
integrations: [
...(integrationDocsPlatforms.platforms.find(platform => platform.id === 'go')
?.integrations ?? []),
{
link: 'https://docs.sentry.io/platforms/go/guides/echo/',
type: 'framework',
id: 'go-echo',
name: t('Echo'),
},
{
link: 'https://docs.sentry.io/platforms/go/guides/fasthttp/',
type: 'framework',
id: 'go-fasthttp',
name: t('FastHTTP'),
},
{
link: 'https://docs.sentry.io/platforms/go/guides/gin/',
type: 'framework',
id: 'go-gin',
name: t('Gin'),
},
{
link: 'https://docs.sentry.io/platforms/go/guides/http/',
type: 'framework',
id: 'go-http',
name: t('Net/Http'),
},
{
link: 'https://docs.sentry.io/platforms/go/guides/iris',
type: 'framework',
id: 'go-iris',
name: t('Iris'),
},
{
link: 'https://docs.sentry.io/platforms/go/guides/martini/',
type: 'framework',
id: 'go-martini',
name: t('Martini'),
},
{
link: 'https://docs.sentry.io/platforms/go/guides/negroni/',
type: 'framework',
id: 'go-negroni',
name: t('Negroni'),
},
],
id: 'go',
name: t('Go'),
},
];
const platformIntegrations: PlatformIntegration[] = [
...integrationDocsPlatforms.platforms.filter(platform => platform.id !== 'go'),
...goPlatforms,
]
.map(platform => {
const integrations = platform.integrations.reduce((acc, value) => {
// filter out any javascript-[angular|angularjs|ember|gatsby|nextjs|react|remix|svelte|sveltekit|vue]-* platforms; as they're not meant to be used as a platform in the PlatformPicker component
if (value.id.match('^javascript-([A-Za-z]+)-([a-zA-Z0-9]+.*)$')) {
return acc;
}
// filter out any tracing platforms; as they're not meant to be used as a platform for
// the project creation flow
if ((tracing as readonly string[]).includes(value.id)) {
return acc;
}
// filter out any performance onboarding documentation
if (value.id.includes('performance-onboarding')) {
return acc;
}
// filter out any replay onboarding documentation
if (value.id.includes('replay-onboarding')) {
return acc;
}
// filter out any profiling onboarding documentation
if (value.id.includes('profiling-onboarding')) {
return acc;
}
if (!acc[value.id]) {
acc[value.id] = {...value, language: platform.id};
return acc;
}
return acc;
}, {});
return Object.values(integrations) as PlatformIntegration[];
})
.flat();
const platforms = sortBy(platformIntegrations, 'id');
export default platforms;