platformPickerCategories.tsx 3.4 KB

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