platforms.tsx 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. import integrationDocsPlatforms from 'integration-docs-platforms';
  2. import sortBy from 'lodash/sortBy';
  3. import {PlatformIntegration} from 'sentry/types';
  4. import {tracing} from './platformCategories';
  5. const platformIntegrations: PlatformIntegration[] = integrationDocsPlatforms.platforms
  6. .map(platform => {
  7. const integrations = platform.integrations.reduce((acc, value) => {
  8. // 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
  9. if (value.id.match('^javascript-([A-Za-z]+)-([a-zA-Z0-9]+.*)$')) {
  10. return acc;
  11. }
  12. // filter out any tracing platforms; as they're not meant to be used as a platform for
  13. // the project creation flow
  14. if ((tracing as readonly string[]).includes(value.id)) {
  15. return acc;
  16. }
  17. // filter out any performance onboarding documentation
  18. if (value.id.includes('performance-onboarding')) {
  19. return acc;
  20. }
  21. // filter out any replay onboarding documentation
  22. if (value.id.includes('replay-onboarding')) {
  23. return acc;
  24. }
  25. // filter out any profiling onboarding documentation
  26. if (value.id.includes('profiling-onboarding')) {
  27. return acc;
  28. }
  29. if (!acc[value.id]) {
  30. acc[value.id] = {...value, language: platform.id};
  31. return acc;
  32. }
  33. return acc;
  34. }, {});
  35. return Object.values(integrations) as PlatformIntegration[];
  36. })
  37. .flat();
  38. const platforms = sortBy(platformIntegrations, 'id');
  39. export default platforms;