platformPickerCategories.tsx 3.3 KB

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