platformPickerCategories.tsx 3.2 KB

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