platforms.tsx 3.0 KB

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