platformPickerCategories.tsx 3.4 KB

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