platformPickerCategories.tsx 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173
  1. import {t} from 'sentry/locale';
  2. import {PlatformKey} from 'sentry/types';
  3. const popularPlatformCategories: Set<PlatformKey> = new Set([
  4. 'android',
  5. 'apple-ios',
  6. 'dotnet',
  7. 'dotnet-aspnetcore',
  8. 'flutter',
  9. 'go',
  10. 'java',
  11. 'java-spring-boot',
  12. 'javascript',
  13. 'javascript-angular',
  14. 'javascript-nextjs',
  15. 'javascript-react',
  16. 'javascript-vue',
  17. 'node',
  18. 'node-express',
  19. 'php',
  20. 'php-laravel',
  21. 'python',
  22. 'python-django',
  23. 'python-fastapi',
  24. 'python-flask',
  25. 'react-native',
  26. 'ruby-rails',
  27. 'ruby',
  28. 'unity',
  29. ]);
  30. const browser: Set<PlatformKey> = new Set([
  31. 'dart',
  32. 'javascript',
  33. 'javascript-angular',
  34. 'javascript-ember',
  35. 'javascript-gatsby',
  36. 'javascript-nextjs',
  37. 'javascript-react',
  38. 'javascript-remix',
  39. 'javascript-svelte',
  40. 'javascript-sveltekit',
  41. 'javascript-vue',
  42. 'unity',
  43. ]);
  44. const server: Set<PlatformKey> = new Set([
  45. 'bun',
  46. 'dotnet',
  47. 'dotnet-aspnet',
  48. 'dotnet-aspnetcore',
  49. 'elixir',
  50. 'go',
  51. 'go-http',
  52. 'java',
  53. 'java-log4j2',
  54. 'java-logback',
  55. 'java-spring',
  56. 'java-spring-boot',
  57. 'kotlin',
  58. 'native',
  59. 'node',
  60. 'node-connect',
  61. 'node-express',
  62. 'node-koa',
  63. 'php',
  64. 'php-laravel',
  65. 'php-symfony',
  66. 'python',
  67. 'python-aiohttp',
  68. 'python-asgi',
  69. 'python-bottle',
  70. 'python-celery',
  71. 'python-chalice',
  72. 'python-django',
  73. 'python-falcon',
  74. 'python-fastapi',
  75. 'python-flask',
  76. 'python-pyramid',
  77. 'python-quart',
  78. 'python-rq',
  79. 'python-sanic',
  80. 'python-starlette',
  81. 'python-tornado',
  82. 'python-tryton',
  83. 'python-wsgi',
  84. 'ruby',
  85. 'ruby-rack',
  86. 'ruby-rails',
  87. 'rust',
  88. ]);
  89. const mobile: Set<PlatformKey> = new Set([
  90. 'android',
  91. 'apple-ios',
  92. 'capacitor',
  93. 'cordova',
  94. 'dotnet-maui',
  95. 'dotnet-xamarin',
  96. 'flutter',
  97. 'ionic',
  98. 'react-native',
  99. 'unity',
  100. 'unreal',
  101. ]);
  102. const desktop: Set<PlatformKey> = new Set([
  103. 'apple-macos',
  104. 'dotnet',
  105. 'dotnet-maui',
  106. 'dotnet-winforms',
  107. 'dotnet-wpf',
  108. 'electron',
  109. 'flutter',
  110. 'java',
  111. 'kotlin',
  112. 'minidump',
  113. 'native',
  114. 'native-qt',
  115. 'unity',
  116. 'unreal',
  117. ]);
  118. const serverless: Set<PlatformKey> = new Set([
  119. 'dotnet-awslambda',
  120. 'dotnet-gcpfunctions',
  121. 'node-awslambda',
  122. 'node-azurefunctions',
  123. 'node-gcpfunctions',
  124. 'python-awslambda',
  125. 'python-gcpfunctions',
  126. 'python-serverless',
  127. ]);
  128. export const createablePlatforms: Set<PlatformKey> = new Set([
  129. ...popularPlatformCategories,
  130. ...browser,
  131. ...server,
  132. ...mobile,
  133. ...desktop,
  134. ...serverless,
  135. ]);
  136. /**
  137. * Additional aliases used for filtering in the platform picker
  138. */
  139. export const filterAliases: Partial<Record<PlatformKey, string[]>> = {
  140. native: ['cpp', 'c++'],
  141. };
  142. const categoryList = [
  143. {id: 'popular', name: t('Popular'), platforms: popularPlatformCategories},
  144. {id: 'browser', name: t('Browser'), platforms: browser},
  145. {id: 'server', name: t('Server'), platforms: server},
  146. {id: 'mobile', name: t('Mobile'), platforms: mobile},
  147. {id: 'desktop', name: t('Desktop'), platforms: desktop},
  148. {id: 'serverless', name: t('Serverless'), platforms: serverless},
  149. {
  150. id: 'all',
  151. name: t('All'),
  152. platforms: createablePlatforms,
  153. },
  154. ];
  155. export default categoryList;
  156. // TODO(aknaus): Drop in favour of PlatformIntegration
  157. export type Platform = {
  158. key: PlatformKey;
  159. id?: string;
  160. link?: string | null;
  161. name?: string;
  162. };