platformPickerCategories.tsx 3.4 KB

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