@remotion/bundler 3.0.0-lambda.25 → 3.0.0-lambda.250

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (238) hide show
  1. package/dist/bundler.d.ts.map +1 -1
  2. package/dist/bundler.js +27 -9
  3. package/dist/bundler.js.map +1 -1
  4. package/dist/copy-dir.d.ts +2 -0
  5. package/dist/copy-dir.d.ts.map +1 -0
  6. package/dist/copy-dir.js +24 -0
  7. package/dist/copy-dir.js.map +1 -0
  8. package/dist/dev-middleware/compatible-api.d.ts +10 -0
  9. package/dist/dev-middleware/compatible-api.d.ts.map +1 -0
  10. package/dist/dev-middleware/compatible-api.js +45 -0
  11. package/dist/dev-middleware/compatible-api.js.map +1 -0
  12. package/dist/dev-middleware/get-filename-from-url.d.ts +3 -0
  13. package/dist/dev-middleware/get-filename-from-url.d.ts.map +1 -0
  14. package/dist/dev-middleware/get-filename-from-url.js +93 -0
  15. package/dist/dev-middleware/get-filename-from-url.js.map +1 -0
  16. package/dist/dev-middleware/get-paths.d.ts +8 -0
  17. package/dist/dev-middleware/get-paths.d.ts.map +1 -0
  18. package/dist/dev-middleware/get-paths.js +20 -0
  19. package/dist/dev-middleware/get-paths.js.map +1 -0
  20. package/dist/dev-middleware/index.d.ts +3 -0
  21. package/dist/dev-middleware/index.d.ts.map +1 -0
  22. package/dist/dev-middleware/index.js +58 -0
  23. package/dist/dev-middleware/index.js.map +1 -0
  24. package/dist/dev-middleware/is-color-supported.d.ts +2 -0
  25. package/dist/dev-middleware/is-color-supported.d.ts.map +1 -0
  26. package/dist/dev-middleware/is-color-supported.js +34 -0
  27. package/dist/dev-middleware/is-color-supported.js.map +1 -0
  28. package/dist/dev-middleware/middleware.d.ts +4 -0
  29. package/dist/dev-middleware/middleware.d.ts.map +1 -0
  30. package/dist/dev-middleware/middleware.js +142 -0
  31. package/dist/dev-middleware/middleware.js.map +1 -0
  32. package/dist/dev-middleware/range-parser.d.ts +16 -0
  33. package/dist/dev-middleware/range-parser.d.ts.map +1 -0
  34. package/dist/dev-middleware/range-parser.js +97 -0
  35. package/dist/dev-middleware/range-parser.js.map +1 -0
  36. package/dist/dev-middleware/ready.d.ts +6 -0
  37. package/dist/dev-middleware/ready.d.ts.map +1 -0
  38. package/dist/dev-middleware/ready.js +14 -0
  39. package/dist/dev-middleware/ready.js.map +1 -0
  40. package/dist/dev-middleware/setup-hooks.d.ts +3 -0
  41. package/dist/dev-middleware/setup-hooks.d.ts.map +1 -0
  42. package/dist/dev-middleware/setup-hooks.js +45 -0
  43. package/dist/dev-middleware/setup-hooks.js.map +1 -0
  44. package/dist/dev-middleware/setup-output-filesystem.d.ts +3 -0
  45. package/dist/dev-middleware/setup-output-filesystem.d.ts.map +1 -0
  46. package/dist/dev-middleware/setup-output-filesystem.js +14 -0
  47. package/dist/dev-middleware/setup-output-filesystem.js.map +1 -0
  48. package/dist/dev-middleware/types.d.ts +12 -0
  49. package/dist/dev-middleware/types.d.ts.map +1 -0
  50. package/dist/dev-middleware/types.js +3 -0
  51. package/dist/dev-middleware/types.js.map +1 -0
  52. package/dist/error-overlay/entry-basic.d.ts +2 -0
  53. package/dist/error-overlay/entry-basic.d.ts.map +1 -0
  54. package/dist/error-overlay/entry-basic.js +22 -0
  55. package/dist/error-overlay/entry-basic.js.map +1 -0
  56. package/dist/error-overlay/react-overlay/effects/format-warning.d.ts +13 -0
  57. package/dist/error-overlay/react-overlay/effects/format-warning.d.ts.map +1 -0
  58. package/dist/error-overlay/react-overlay/effects/format-warning.js +42 -0
  59. package/dist/error-overlay/react-overlay/effects/format-warning.js.map +1 -0
  60. package/dist/error-overlay/react-overlay/effects/proxy-console.d.ts +18 -0
  61. package/dist/error-overlay/react-overlay/effects/proxy-console.d.ts.map +1 -0
  62. package/dist/error-overlay/react-overlay/effects/proxy-console.js +55 -0
  63. package/dist/error-overlay/react-overlay/effects/proxy-console.js.map +1 -0
  64. package/dist/error-overlay/react-overlay/effects/stack-trace-limit.d.ts +4 -0
  65. package/dist/error-overlay/react-overlay/effects/stack-trace-limit.d.ts.map +1 -0
  66. package/dist/error-overlay/react-overlay/effects/stack-trace-limit.js +44 -0
  67. package/dist/error-overlay/react-overlay/effects/stack-trace-limit.js.map +1 -0
  68. package/dist/error-overlay/react-overlay/effects/unhandled-error.d.ts +5 -0
  69. package/dist/error-overlay/react-overlay/effects/unhandled-error.d.ts.map +1 -0
  70. package/dist/error-overlay/react-overlay/effects/unhandled-error.js +46 -0
  71. package/dist/error-overlay/react-overlay/effects/unhandled-error.js.map +1 -0
  72. package/dist/error-overlay/react-overlay/effects/unhandled-rejection.d.ts +5 -0
  73. package/dist/error-overlay/react-overlay/effects/unhandled-rejection.d.ts.map +1 -0
  74. package/dist/error-overlay/react-overlay/effects/unhandled-rejection.js +42 -0
  75. package/dist/error-overlay/react-overlay/effects/unhandled-rejection.js.map +1 -0
  76. package/dist/error-overlay/react-overlay/index.d.ts +8 -0
  77. package/dist/error-overlay/react-overlay/index.d.ts.map +1 -0
  78. package/dist/error-overlay/react-overlay/index.js +45 -0
  79. package/dist/error-overlay/react-overlay/index.js.map +1 -0
  80. package/dist/error-overlay/react-overlay/listen-to-runtime-errors.d.ts +12 -0
  81. package/dist/error-overlay/react-overlay/listen-to-runtime-errors.d.ts.map +1 -0
  82. package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js +63 -0
  83. package/dist/error-overlay/react-overlay/listen-to-runtime-errors.js.map +1 -0
  84. package/dist/error-overlay/react-overlay/utils/get-lines-around.d.ts +15 -0
  85. package/dist/error-overlay/react-overlay/utils/get-lines-around.d.ts.map +1 -0
  86. package/dist/error-overlay/react-overlay/utils/get-lines-around.js +31 -0
  87. package/dist/error-overlay/react-overlay/utils/get-lines-around.js.map +1 -0
  88. package/dist/error-overlay/react-overlay/utils/get-source-map.d.ts +52 -0
  89. package/dist/error-overlay/react-overlay/utils/get-source-map.d.ts.map +1 -0
  90. package/dist/error-overlay/react-overlay/utils/get-source-map.js +108 -0
  91. package/dist/error-overlay/react-overlay/utils/get-source-map.js.map +1 -0
  92. package/dist/error-overlay/react-overlay/utils/get-stack-frames.d.ts +13 -0
  93. package/dist/error-overlay/react-overlay/utils/get-stack-frames.d.ts.map +1 -0
  94. package/dist/error-overlay/react-overlay/utils/get-stack-frames.js +32 -0
  95. package/dist/error-overlay/react-overlay/utils/get-stack-frames.js.map +1 -0
  96. package/dist/error-overlay/react-overlay/utils/mapper.d.ts +16 -0
  97. package/dist/error-overlay/react-overlay/utils/mapper.d.ts.map +1 -0
  98. package/dist/error-overlay/react-overlay/utils/mapper.js +61 -0
  99. package/dist/error-overlay/react-overlay/utils/mapper.js.map +1 -0
  100. package/dist/error-overlay/react-overlay/utils/open-in-editor.d.ts +7 -0
  101. package/dist/error-overlay/react-overlay/utils/open-in-editor.d.ts.map +1 -0
  102. package/dist/error-overlay/react-overlay/utils/open-in-editor.js +436 -0
  103. package/dist/error-overlay/react-overlay/utils/open-in-editor.js.map +1 -0
  104. package/dist/error-overlay/react-overlay/utils/parser.d.ts +15 -0
  105. package/dist/error-overlay/react-overlay/utils/parser.d.ts.map +1 -0
  106. package/dist/error-overlay/react-overlay/utils/parser.js +85 -0
  107. package/dist/error-overlay/react-overlay/utils/parser.js.map +1 -0
  108. package/dist/error-overlay/react-overlay/utils/path.d.ts +2 -0
  109. package/dist/error-overlay/react-overlay/utils/path.d.ts.map +1 -0
  110. package/dist/error-overlay/react-overlay/utils/path.js +98 -0
  111. package/dist/error-overlay/react-overlay/utils/path.js.map +1 -0
  112. package/dist/error-overlay/react-overlay/utils/settle-promise.d.ts +3 -0
  113. package/dist/error-overlay/react-overlay/utils/settle-promise.d.ts.map +1 -0
  114. package/dist/error-overlay/react-overlay/utils/settle-promise.js +20 -0
  115. package/dist/error-overlay/react-overlay/utils/settle-promise.js.map +1 -0
  116. package/dist/error-overlay/react-overlay/utils/stack-frame.d.ts +46 -0
  117. package/dist/error-overlay/react-overlay/utils/stack-frame.d.ts.map +1 -0
  118. package/dist/error-overlay/react-overlay/utils/stack-frame.js +85 -0
  119. package/dist/error-overlay/react-overlay/utils/stack-frame.js.map +1 -0
  120. package/dist/error-overlay/react-overlay/utils/unmapper.d.ts +14 -0
  121. package/dist/error-overlay/react-overlay/utils/unmapper.d.ts.map +1 -0
  122. package/dist/error-overlay/react-overlay/utils/unmapper.js +94 -0
  123. package/dist/error-overlay/react-overlay/utils/unmapper.js.map +1 -0
  124. package/dist/error-overlay/remotion-overlay/AskOnDiscord.d.ts +3 -0
  125. package/dist/error-overlay/remotion-overlay/AskOnDiscord.d.ts.map +1 -0
  126. package/dist/error-overlay/remotion-overlay/AskOnDiscord.js +15 -0
  127. package/dist/error-overlay/remotion-overlay/AskOnDiscord.js.map +1 -0
  128. package/dist/error-overlay/remotion-overlay/Button.d.ts +6 -0
  129. package/dist/error-overlay/remotion-overlay/Button.d.ts.map +1 -0
  130. package/dist/error-overlay/remotion-overlay/Button.js +25 -0
  131. package/dist/error-overlay/remotion-overlay/Button.js.map +1 -0
  132. package/dist/error-overlay/remotion-overlay/CodeFrame.d.ts +7 -0
  133. package/dist/error-overlay/remotion-overlay/CodeFrame.d.ts.map +1 -0
  134. package/dist/error-overlay/remotion-overlay/CodeFrame.js +29 -0
  135. package/dist/error-overlay/remotion-overlay/CodeFrame.js.map +1 -0
  136. package/dist/error-overlay/remotion-overlay/DismissButton.d.ts +3 -0
  137. package/dist/error-overlay/remotion-overlay/DismissButton.d.ts.map +1 -0
  138. package/dist/error-overlay/remotion-overlay/DismissButton.js +24 -0
  139. package/dist/error-overlay/remotion-overlay/DismissButton.js.map +1 -0
  140. package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts +6 -0
  141. package/dist/error-overlay/remotion-overlay/ErrorDisplay.d.ts.map +1 -0
  142. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js +62 -0
  143. package/dist/error-overlay/remotion-overlay/ErrorDisplay.js.map +1 -0
  144. package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts +6 -0
  145. package/dist/error-overlay/remotion-overlay/OpenInEditor.d.ts.map +1 -0
  146. package/dist/error-overlay/remotion-overlay/OpenInEditor.js +92 -0
  147. package/dist/error-overlay/remotion-overlay/OpenInEditor.js.map +1 -0
  148. package/dist/error-overlay/remotion-overlay/Overlay.d.ts +17 -0
  149. package/dist/error-overlay/remotion-overlay/Overlay.d.ts.map +1 -0
  150. package/dist/error-overlay/remotion-overlay/Overlay.js +35 -0
  151. package/dist/error-overlay/remotion-overlay/Overlay.js.map +1 -0
  152. package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.d.ts +5 -0
  153. package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.d.ts.map +1 -0
  154. package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js +14 -0
  155. package/dist/error-overlay/remotion-overlay/SearchGitHubIssues.js.map +1 -0
  156. package/dist/error-overlay/remotion-overlay/StackFrame.d.ts +8 -0
  157. package/dist/error-overlay/remotion-overlay/StackFrame.d.ts.map +1 -0
  158. package/dist/error-overlay/remotion-overlay/StackFrame.js +42 -0
  159. package/dist/error-overlay/remotion-overlay/StackFrame.js.map +1 -0
  160. package/dist/error-overlay/remotion-overlay/carets.d.ts +3 -0
  161. package/dist/error-overlay/remotion-overlay/carets.d.ts.map +1 -0
  162. package/dist/error-overlay/remotion-overlay/carets.js +13 -0
  163. package/dist/error-overlay/remotion-overlay/carets.js.map +1 -0
  164. package/dist/error-overlay/remotion-overlay/format-location.d.ts +2 -0
  165. package/dist/error-overlay/remotion-overlay/format-location.d.ts.map +1 -0
  166. package/dist/error-overlay/remotion-overlay/format-location.js +11 -0
  167. package/dist/error-overlay/remotion-overlay/format-location.js.map +1 -0
  168. package/dist/error-overlay/remotion-overlay/index.d.ts +2 -0
  169. package/dist/error-overlay/remotion-overlay/index.d.ts.map +1 -0
  170. package/dist/error-overlay/remotion-overlay/index.js +14 -0
  171. package/dist/error-overlay/remotion-overlay/index.js.map +1 -0
  172. package/dist/fast-refresh/helpers.d.ts +40 -0
  173. package/dist/fast-refresh/helpers.d.ts.map +1 -0
  174. package/dist/fast-refresh/helpers.js +146 -0
  175. package/dist/fast-refresh/helpers.js.map +1 -0
  176. package/dist/fast-refresh/index.d.ts +31 -0
  177. package/dist/fast-refresh/index.d.ts.map +1 -0
  178. package/dist/fast-refresh/index.js +60 -0
  179. package/dist/fast-refresh/index.js.map +1 -0
  180. package/dist/fast-refresh/loader.d.ts +36 -0
  181. package/dist/fast-refresh/loader.d.ts.map +1 -0
  182. package/dist/fast-refresh/loader.js +82 -0
  183. package/dist/fast-refresh/loader.js.map +1 -0
  184. package/dist/fast-refresh/runtime.d.ts +36 -0
  185. package/dist/fast-refresh/runtime.d.ts.map +1 -0
  186. package/dist/fast-refresh/runtime.js +33 -0
  187. package/dist/fast-refresh/runtime.js.map +1 -0
  188. package/dist/homepage/homepage.d.ts +4 -0
  189. package/dist/homepage/homepage.d.ts.map +1 -0
  190. package/dist/homepage/homepage.js +63 -0
  191. package/dist/homepage/homepage.js.map +1 -0
  192. package/dist/hot-middleware/client.d.ts +20 -0
  193. package/dist/hot-middleware/client.d.ts.map +1 -0
  194. package/dist/hot-middleware/client.js +208 -0
  195. package/dist/hot-middleware/client.js.map +1 -0
  196. package/dist/hot-middleware/index.d.ts +14 -0
  197. package/dist/hot-middleware/index.d.ts.map +1 -0
  198. package/dist/hot-middleware/index.js +181 -0
  199. package/dist/hot-middleware/index.js.map +1 -0
  200. package/dist/hot-middleware/process-update.d.ts +13 -0
  201. package/dist/hot-middleware/process-update.d.ts.map +1 -0
  202. package/dist/hot-middleware/process-update.js +147 -0
  203. package/dist/hot-middleware/process-update.js.map +1 -0
  204. package/dist/hot-middleware/strip-ansi.d.ts +7 -0
  205. package/dist/hot-middleware/strip-ansi.d.ts.map +1 -0
  206. package/dist/hot-middleware/strip-ansi.js +23 -0
  207. package/dist/hot-middleware/strip-ansi.js.map +1 -0
  208. package/dist/hot-middleware/types.d.ts +39 -0
  209. package/dist/hot-middleware/types.d.ts.map +1 -0
  210. package/dist/hot-middleware/types.js +18 -0
  211. package/dist/hot-middleware/types.js.map +1 -0
  212. package/dist/index.d.ts +1 -1
  213. package/dist/index.d.ts.map +1 -1
  214. package/dist/index.js.map +1 -1
  215. package/dist/renderEntry.js +6 -2
  216. package/dist/renderEntry.js.map +1 -1
  217. package/dist/start-server.d.ts +0 -1
  218. package/dist/start-server.d.ts.map +1 -1
  219. package/dist/start-server.js +35 -14
  220. package/dist/start-server.js.map +1 -1
  221. package/dist/static-preview.d.ts +2 -0
  222. package/dist/static-preview.d.ts.map +1 -0
  223. package/dist/static-preview.js +34 -0
  224. package/dist/static-preview.js.map +1 -0
  225. package/dist/webpack-config.d.ts +1 -2
  226. package/dist/webpack-config.d.ts.map +1 -1
  227. package/dist/webpack-config.js +29 -12
  228. package/dist/webpack-config.js.map +1 -1
  229. package/package.json +11 -8
  230. package/dist/env-variables.d.ts +0 -2
  231. package/dist/env-variables.d.ts.map +0 -1
  232. package/dist/env-variables.js +0 -5
  233. package/dist/env-variables.js.map +0 -1
  234. package/dist/setup-env-variables.d.ts +0 -2
  235. package/dist/setup-env-variables.d.ts.map +0 -1
  236. package/dist/setup-env-variables.js +0 -5
  237. package/dist/setup-env-variables.js.map +0 -1
  238. package/web/index.html +0 -20
@@ -0,0 +1,436 @@
1
+ "use strict";
2
+ /*
3
+ Source code adapted from https://github.com/facebook/create-react-app/tree/main/packages/react-error-overlay and refactored in Typescript. This file is MIT-licensed.
4
+ */
5
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
6
+ if (k2 === undefined) k2 = k;
7
+ Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
8
+ }) : (function(o, m, k, k2) {
9
+ if (k2 === undefined) k2 = k;
10
+ o[k2] = m[k];
11
+ }));
12
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
13
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
14
+ }) : function(o, v) {
15
+ o["default"] = v;
16
+ });
17
+ var __importStar = (this && this.__importStar) || function (mod) {
18
+ if (mod && mod.__esModule) return mod;
19
+ var result = {};
20
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
21
+ __setModuleDefault(result, mod);
22
+ return result;
23
+ };
24
+ var __importDefault = (this && this.__importDefault) || function (mod) {
25
+ return (mod && mod.__esModule) ? mod : { "default": mod };
26
+ };
27
+ Object.defineProperty(exports, "__esModule", { value: true });
28
+ exports.launchEditor = exports.guessEditor = exports.getDisplayNameForEditor = void 0;
29
+ /**
30
+ * Copyright (c) 2015-present, Facebook, Inc.
31
+ *
32
+ * This source code is licensed under the MIT license found in the
33
+ * LICENSE file in the root directory of this source tree.
34
+ */
35
+ const util_1 = __importDefault(require("util"));
36
+ const fs_1 = __importDefault(require("fs"));
37
+ const path_1 = __importDefault(require("path"));
38
+ const child_process_1 = __importStar(require("child_process"));
39
+ const os_1 = __importDefault(require("os"));
40
+ const execProm = util_1.default.promisify(child_process_1.exec);
41
+ function isTerminalEditor(editor) {
42
+ switch (editor) {
43
+ case 'vim':
44
+ case 'emacs':
45
+ case 'nano':
46
+ return true;
47
+ default:
48
+ return false;
49
+ }
50
+ }
51
+ const editorNames = [
52
+ 'atom',
53
+ '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta',
54
+ 'brackets',
55
+ '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',
56
+ '/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl',
57
+ '/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl',
58
+ 'code',
59
+ 'code-insiders',
60
+ 'vscodium',
61
+ '/Applications/AppCode.app/Contents/MacOS/appcode',
62
+ '/Applications/CLion.app/Contents/MacOS/clion',
63
+ '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea',
64
+ '/Applications/PhpStorm.app/Contents/MacOS/phpstorm',
65
+ '/Applications/PyCharm.app/Contents/MacOS/pycharm',
66
+ '/Applications/PyCharm CE.app/Contents/MacOS/pycharm',
67
+ '/Applications/RubyMine.app/Contents/MacOS/rubymine',
68
+ '/Applications/WebStorm.app/Contents/MacOS/webstorm',
69
+ '/Applications/GoLand.app/Contents/MacOS/goland',
70
+ '/Applications/Rider.app/Contents/MacOS/rider',
71
+ 'mvim',
72
+ 'emacs',
73
+ 'gvim',
74
+ 'idea',
75
+ 'phpstorm',
76
+ 'pycharm',
77
+ 'rubymine',
78
+ 'sublime_text',
79
+ 'vim',
80
+ 'webstorm',
81
+ 'goland',
82
+ 'rider',
83
+ 'Brackets.exe',
84
+ 'Code.exe',
85
+ 'Code - Insiders.exe',
86
+ 'VSCodium.exe',
87
+ 'atom.exe',
88
+ 'sublime_text.exe',
89
+ 'notepad++.exe',
90
+ 'clion.exe',
91
+ 'clion64.exe',
92
+ 'idea.exe',
93
+ 'idea64.exe',
94
+ 'phpstorm.exe',
95
+ 'phpstorm64.exe',
96
+ 'pycharm.exe',
97
+ 'pycharm64.exe',
98
+ 'rubymine.exe',
99
+ 'rubymine64.exe',
100
+ 'webstorm.exe',
101
+ 'webstorm64.exe',
102
+ 'goland.exe',
103
+ 'goland64.exe',
104
+ 'rider.exe',
105
+ 'rider64.exe',
106
+ ];
107
+ const displayNameForEditor = {
108
+ '/Applications/AppCode.app/Contents/MacOS/appcode': 'AppCode',
109
+ '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta': 'Atom Beta',
110
+ '/Applications/CLion.app/Contents/MacOS/clion': 'CLion',
111
+ '/Applications/GoLand.app/Contents/MacOS/goland': 'GoLand',
112
+ '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea': 'IDEA',
113
+ '/Applications/PhpStorm.app/Contents/MacOS/phpstorm': 'PHPStorm',
114
+ '/Applications/PyCharm CE.app/Contents/MacOS/pycharm': 'PyCharm',
115
+ '/Applications/PyCharm.app/Contents/MacOS/pycharm': 'PyCharm',
116
+ '/Applications/Rider.app/Contents/MacOS/rider': 'Rider',
117
+ '/Applications/RubyMine.app/Contents/MacOS/rubymine': 'RubyMine',
118
+ '/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl': 'Sublime Text 2',
119
+ '/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl': 'Sublime Text Dev',
120
+ '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl': 'Sublime Text',
121
+ '/Applications/WebStorm.app/Contents/MacOS/webstorm': 'WebStorm',
122
+ 'Brackets.exe': 'Brackets',
123
+ 'Code - Insiders.exe': 'VS Code Insiders',
124
+ 'Code.exe': 'VS Code',
125
+ 'VSCodium.exe': 'VS Codium',
126
+ 'atom.exe': 'Atom',
127
+ 'clion.exe': 'CLion',
128
+ 'clion64.exe': 'CLion',
129
+ 'code-insiders': 'VS Code Insiders',
130
+ 'goland.exe': 'GoLand',
131
+ 'goland64.exe': 'GoLand',
132
+ 'idea.exe': 'IDEA',
133
+ 'idea64.exe': 'IDEA',
134
+ 'notepad++.exe': 'Notepad++',
135
+ 'phpstorm.exe': 'PHPStorm',
136
+ 'phpstorm64.exe': 'PHPStorm',
137
+ 'pycharm.exe': 'PyCharm',
138
+ 'pycharm64.exe': 'PyCharm',
139
+ 'rider.exe': 'Rider',
140
+ 'rider64.exe': 'Rider',
141
+ 'rubymine.exe': 'RubyMine',
142
+ 'rubymine64.exe': 'RubyMine',
143
+ 'sublime_text.exe': 'Sublime Text',
144
+ 'webstorm.exe': 'WebStorm',
145
+ 'webstorm64.exe': 'WebStorm',
146
+ atom: 'Atom',
147
+ brackets: 'Brackets',
148
+ code: 'VS Code',
149
+ emacs: 'emacs',
150
+ goland: 'GoLand',
151
+ gvim: 'GVim',
152
+ idea: 'IDEA',
153
+ mvim: 'mvim',
154
+ phpstorm: 'PHPStorm',
155
+ pycharm: 'PyCharm',
156
+ rider: 'Rider',
157
+ rubymine: 'RubyMine',
158
+ sublime_text: 'Sublime Text',
159
+ vim: 'vim',
160
+ vscodium: 'VS Codium',
161
+ webstorm: 'WebStorm',
162
+ };
163
+ const getDisplayNameForEditor = (editor) => {
164
+ var _a;
165
+ if (!editor) {
166
+ return null;
167
+ }
168
+ return (_a = displayNameForEditor[editor]) !== null && _a !== void 0 ? _a : editor;
169
+ };
170
+ exports.getDisplayNameForEditor = getDisplayNameForEditor;
171
+ // Map from full process name to binary that starts the process
172
+ // We can't just re-use full process name, because it will spawn a new instance
173
+ // of the app every time
174
+ const COMMON_EDITORS_OSX = {
175
+ '/Applications/Atom.app/Contents/MacOS/Atom': 'atom',
176
+ '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta': '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta',
177
+ '/Applications/Brackets.app/Contents/MacOS/Brackets': 'brackets',
178
+ '/Applications/Sublime Text.app/Contents/MacOS/Sublime Text': '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',
179
+ '/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text': '/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl',
180
+ '/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2': '/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl',
181
+ '/Applications/Visual Studio Code.app/Contents/MacOS/Electron': 'code',
182
+ '/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron': 'code-insiders',
183
+ '/Applications/VSCodium.app/Contents/MacOS/Electron': 'vscodium',
184
+ '/Applications/AppCode.app/Contents/MacOS/appcode': '/Applications/AppCode.app/Contents/MacOS/appcode',
185
+ '/Applications/CLion.app/Contents/MacOS/clion': '/Applications/CLion.app/Contents/MacOS/clion',
186
+ '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea': '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea',
187
+ '/Applications/PhpStorm.app/Contents/MacOS/phpstorm': '/Applications/PhpStorm.app/Contents/MacOS/phpstorm',
188
+ '/Applications/PyCharm.app/Contents/MacOS/pycharm': '/Applications/PyCharm.app/Contents/MacOS/pycharm',
189
+ '/Applications/PyCharm CE.app/Contents/MacOS/pycharm': '/Applications/PyCharm CE.app/Contents/MacOS/pycharm',
190
+ '/Applications/RubyMine.app/Contents/MacOS/rubymine': '/Applications/RubyMine.app/Contents/MacOS/rubymine',
191
+ '/Applications/WebStorm.app/Contents/MacOS/webstorm': '/Applications/WebStorm.app/Contents/MacOS/webstorm',
192
+ '/Applications/MacVim.app/Contents/MacOS/MacVim': 'mvim',
193
+ '/Applications/GoLand.app/Contents/MacOS/goland': '/Applications/GoLand.app/Contents/MacOS/goland',
194
+ '/Applications/Rider.app/Contents/MacOS/rider': '/Applications/Rider.app/Contents/MacOS/rider',
195
+ };
196
+ const COMMON_EDITORS_LINUX = {
197
+ atom: 'atom',
198
+ Brackets: 'brackets',
199
+ code: 'code',
200
+ 'code-insiders': 'code-insiders',
201
+ vscodium: 'vscodium',
202
+ emacs: 'emacs',
203
+ gvim: 'gvim',
204
+ 'idea.sh': 'idea',
205
+ 'phpstorm.sh': 'phpstorm',
206
+ 'pycharm.sh': 'pycharm',
207
+ 'rubymine.sh': 'rubymine',
208
+ sublime_text: 'sublime_text',
209
+ vim: 'vim',
210
+ 'webstorm.sh': 'webstorm',
211
+ 'goland.sh': 'goland',
212
+ 'rider.sh': 'rider',
213
+ };
214
+ const COMMON_EDITORS_WIN = [
215
+ 'Brackets.exe',
216
+ 'Code.exe',
217
+ 'Code - Insiders.exe',
218
+ 'VSCodium.exe',
219
+ 'atom.exe',
220
+ 'sublime_text.exe',
221
+ 'notepad++.exe',
222
+ 'clion.exe',
223
+ 'clion64.exe',
224
+ 'idea.exe',
225
+ 'idea64.exe',
226
+ 'phpstorm.exe',
227
+ 'phpstorm64.exe',
228
+ 'pycharm.exe',
229
+ 'pycharm64.exe',
230
+ 'rubymine.exe',
231
+ 'rubymine64.exe',
232
+ 'webstorm.exe',
233
+ 'webstorm64.exe',
234
+ 'goland.exe',
235
+ 'goland64.exe',
236
+ 'rider.exe',
237
+ 'rider64.exe',
238
+ ];
239
+ // Transpiled version of: /^([A-Za-z]:[/\\])?[\p{L}0-9/.\-_\\]+$/u
240
+ // Non-transpiled version requires support for Unicode property regex. Allows
241
+ // alphanumeric characters, periods, dashes, slashes, and underscores.
242
+ const WINDOWS_FILE_NAME_WHITELIST = /^([A-Za-z]:[/\\])?(?:[\x2D-9A-Z\\_a-z\xAA\xB5\xBA\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07CA-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08BD\u0904-\u0939\u093D\u0950\u0958-\u0961\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09F0\u09F1\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B71\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CF1\u0CF2\u0D05-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D5F-\u0D61\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E81\u0E82\u0E84\u0E87\u0E88\u0E8A\u0E8D\u0E94-\u0E97\u0E99-\u0E9F\u0EA1-\u0EA3\u0EA5\u0EA7\u0EAA\u0EAB\u0EAD-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0EDC-\u0EDF\u0F00\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u10A0-\u10C5\u10C7\u10CD\u10D0-\u10FA\u10FC-\u1248\u124A-\u124D\u1250-\u1256\u1258\u125A-\u125D\u1260-\u1288\u128A-\u128D\u1290-\u12B0\u12B2-\u12B5\u12B8-\u12BE\u12C0\u12C2-\u12C5\u12C8-\u12D6\u12D8-\u1310\u1312-\u1315\u1318-\u135A\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16F1-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1950-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u1A00-\u1A16\u1A20-\u1A54\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B83-\u1BA0\u1BAE\u1BAF\u1BBA-\u1BE5\u1C00-\u1C23\u1C4D-\u1C4F\u1C5A-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF1\u1CF5\u1CF6\u1D00-\u1DBF\u1E00-\u1F15\u1F18-\u1F1D\u1F20-\u1F45\u1F48-\u1F4D\u1F50-\u1F57\u1F59\u1F5B\u1F5D\u1F5F-\u1F7D\u1F80-\u1FB4\u1FB6-\u1FBC\u1FBE\u1FC2-\u1FC4\u1FC6-\u1FCC\u1FD0-\u1FD3\u1FD6-\u1FDB\u1FE0-\u1FEC\u1FF2-\u1FF4\u1FF6-\u1FFC\u2071\u207F\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2183\u2184\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2D00-\u2D25\u2D27\u2D2D\u2D30-\u2D67\u2D6F\u2D80-\u2D96\u2DA0-\u2DA6\u2DA8-\u2DAE\u2DB0-\u2DB6\u2DB8-\u2DBE\u2DC0-\u2DC6\u2DC8-\u2DCE\u2DD0-\u2DD6\u2DD8-\u2DDE\u2E2F\u3005\u3006\u3031-\u3035\u303B\u303C\u3041-\u3096\u309D-\u309F\u30A1-\u30FA\u30FC-\u30FF\u3105-\u312F\u3131-\u318E\u31A0-\u31BA\u31F0-\u31FF\u3400-\u4DB5\u4E00-\u9FEF\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA61F\uA62A\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6E5\uA717-\uA71F\uA722-\uA788\uA78B-\uA7B9\uA7F7-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA840-\uA873\uA882-\uA8B3\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA90A-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF\uA9E0-\uA9E4\uA9E6-\uA9EF\uA9FA-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB65\uAB70-\uABE2\uAC00-\uD7A3\uD7B0-\uD7C6\uD7CB-\uD7FB\uF900-\uFA6D\uFA70-\uFAD9\uFB00-\uFB06\uFB13-\uFB17\uFB1D\uFB1F-\uFB28\uFB2A-\uFB36\uFB38-\uFB3C\uFB3E\uFB40\uFB41\uFB43\uFB44\uFB46-\uFBB1\uFBD3-\uFD3D\uFD50-\uFD8F\uFD92-\uFDC7\uFDF0-\uFDFB\uFE70-\uFE74\uFE76-\uFEFC\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDE80-\uDE9C\uDEA0-\uDED0\uDF00-\uDF1F\uDF2D-\uDF40\uDF42-\uDF49\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF]|\uD801[\uDC00-\uDC9D\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC60-\uDC76\uDC80-\uDC9E\uDCE0-\uDCF2\uDCF4\uDCF5\uDD00-\uDD15\uDD20-\uDD39\uDD80-\uDDB7\uDDBE\uDDBF\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE60-\uDE7C\uDE80-\uDE9C\uDEC0-\uDEC7\uDEC9-\uDEE4\uDF00-\uDF35\uDF40-\uDF55\uDF60-\uDF72\uDF80-\uDF91]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDD00-\uDD23\uDF00-\uDF1C\uDF27\uDF30-\uDF45]|\uD804[\uDC03-\uDC37\uDC83-\uDCAF\uDCD0-\uDCE8\uDD03-\uDD26\uDD44\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDDA\uDDDC\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE80-\uDEAA\uDF00-\uDF1A]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCDF\uDCFF\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE83\uDE86-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDEE0-\uDEF2]|\uD808[\uDC00-\uDF99]|\uD809[\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE7F\uDF00-\uDF44\uDF50\uDF93-\uDF9F\uDFE0\uDFE1]|\uD821[\uDC00-\uDFF1]|\uD822[\uDC00-\uDEF2]|\uD82C[\uDC00-\uDD1E\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB]|\uD83A[\uDC00-\uDCC4\uDD00-\uDD43]|\uD83B[\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD869[\uDC00-\uDED6\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D])+$/;
243
+ function getArgumentsForLineNumber(editor, fileName, lineNumber, colNumber) {
244
+ const editorBasename = path_1.default.basename(editor).replace(/\.(exe|cmd|bat)$/i, '');
245
+ switch (editorBasename) {
246
+ case 'atom':
247
+ case 'Atom':
248
+ case 'Atom Beta':
249
+ case 'subl':
250
+ case 'sublime':
251
+ case 'sublime_text':
252
+ return [fileName + ':' + lineNumber + ':' + colNumber];
253
+ case 'wstorm':
254
+ case 'charm':
255
+ return [fileName + ':' + lineNumber];
256
+ case 'notepad++':
257
+ return ['-n' + lineNumber, '-c' + colNumber, fileName];
258
+ case 'vim':
259
+ case 'mvim':
260
+ case 'joe':
261
+ case 'gvim':
262
+ return ['+' + lineNumber, fileName];
263
+ case 'emacs':
264
+ case 'emacsclient':
265
+ return ['+' + lineNumber + ':' + colNumber, fileName];
266
+ case 'rmate':
267
+ case 'mate':
268
+ case 'mine':
269
+ return ['--line', lineNumber, fileName];
270
+ case 'code':
271
+ case 'Code':
272
+ case 'code-insiders':
273
+ case 'Code - Insiders':
274
+ case 'vscodium':
275
+ case 'VSCodium':
276
+ return ['-g', fileName + ':' + lineNumber + ':' + colNumber];
277
+ case 'appcode':
278
+ case 'clion':
279
+ case 'clion64':
280
+ case 'idea':
281
+ case 'idea64':
282
+ case 'phpstorm':
283
+ case 'phpstorm64':
284
+ case 'pycharm':
285
+ case 'pycharm64':
286
+ case 'rubymine':
287
+ case 'rubymine64':
288
+ case 'webstorm':
289
+ case 'webstorm64':
290
+ case 'goland':
291
+ case 'goland64':
292
+ case 'rider':
293
+ case 'rider64':
294
+ return ['--line', lineNumber, fileName];
295
+ default:
296
+ // For all others, drop the lineNumber until we have
297
+ // a mapping above, since providing the lineNumber incorrectly
298
+ // can result in errors or confusing behavior.
299
+ return [fileName];
300
+ }
301
+ }
302
+ async function guessEditor() {
303
+ // We can find out which editor is currently running by:
304
+ // `ps x` on macOS and Linux
305
+ // `Get-Process` on Windows
306
+ const availableEditors = [];
307
+ try {
308
+ if (process.platform === 'darwin') {
309
+ const output = (await execProm('ps x')).stdout.toString();
310
+ const processNames = Object.keys(COMMON_EDITORS_OSX);
311
+ for (let i = 0; i < processNames.length; i++) {
312
+ const processName = processNames[i];
313
+ if (output.indexOf(processName) !== -1) {
314
+ availableEditors.push(COMMON_EDITORS_OSX[processName]);
315
+ }
316
+ }
317
+ return availableEditors;
318
+ }
319
+ if (process.platform === 'win32') {
320
+ // Some processes need elevated rights to get its executable path.
321
+ // Just filter them out upfront. This also saves 10-20ms on the command.
322
+ const output = (await execProm('wmic process where "executablepath is not null" get executablepath')).stdout.toString();
323
+ const runningProcesses = output.split('\r\n');
324
+ for (let i = 0; i < runningProcesses.length; i++) {
325
+ const processPath = runningProcesses[i].trim();
326
+ const processName = path_1.default.basename(processPath);
327
+ if (COMMON_EDITORS_WIN.indexOf(processName) !== -1) {
328
+ availableEditors.push(processPath);
329
+ }
330
+ }
331
+ return availableEditors;
332
+ }
333
+ if (process.platform === 'linux') {
334
+ // --no-heading No header line
335
+ // x List all processes owned by you
336
+ // -o comm Need only names column
337
+ const output = (await execProm('ps x --no-heading -o comm --sort=comm')).stdout.toString();
338
+ const processNames = Object.keys(COMMON_EDITORS_LINUX);
339
+ for (let i = 0; i < processNames.length; i++) {
340
+ const processName = processNames[i];
341
+ if (output.indexOf(processName) !== -1) {
342
+ availableEditors.push(COMMON_EDITORS_LINUX[processName]);
343
+ }
344
+ }
345
+ return availableEditors;
346
+ }
347
+ }
348
+ catch (error) {
349
+ // Ignore...
350
+ }
351
+ // Last resort, use old skool env vars
352
+ if (process.env.VISUAL) {
353
+ return [process.env.VISUAL];
354
+ }
355
+ if (process.env.EDITOR) {
356
+ return [process.env.EDITOR];
357
+ }
358
+ return [];
359
+ }
360
+ exports.guessEditor = guessEditor;
361
+ let _childProcess = null;
362
+ async function launchEditor(fileName, lineNumber, colNumber, editor) {
363
+ if (!fs_1.default.existsSync(fileName)) {
364
+ return false;
365
+ }
366
+ // Sanitize lineNumber to prevent malicious use on win32
367
+ // via: https://github.com/nodejs/node/blob/c3bb4b1aa5e907d489619fb43d233c3336bfc03d/lib/child_process.js#L333
368
+ // and it should be a positive integer
369
+ if (!(Number.isInteger(lineNumber) && lineNumber > 0)) {
370
+ return false;
371
+ }
372
+ // colNumber is optional, but should be a positive integer too
373
+ // default is 1
374
+ if (!(Number.isInteger(colNumber) && colNumber > 0)) {
375
+ colNumber = 1;
376
+ }
377
+ if (editor.toLowerCase() === 'none') {
378
+ return false;
379
+ }
380
+ if (process.platform === 'linux' &&
381
+ fileName.startsWith('/mnt/') &&
382
+ /Microsoft/i.test(os_1.default.release())) {
383
+ // Assume WSL / "Bash on Ubuntu on Windows" is being used, and
384
+ // that the file exists on the Windows file system.
385
+ // `os.release()` is "4.4.0-43-Microsoft" in the current release
386
+ // build of WSL, see: https://github.com/Microsoft/BashOnWindows/issues/423#issuecomment-221627364
387
+ // When a Windows editor is specified, interop functionality can
388
+ // handle the path translation, but only if a relative path is used.
389
+ fileName = path_1.default.relative('', fileName);
390
+ }
391
+ // cmd.exe on Windows is vulnerable to RCE attacks given a file name of the
392
+ // form "C:\Users\myusername\Downloads\& curl 172.21.93.52". Use a whitelist
393
+ // to validate user-provided file names. This doesn't cover the entire range
394
+ // of valid file names but should cover almost all of them in practice.
395
+ if (process.platform === 'win32' &&
396
+ !WINDOWS_FILE_NAME_WHITELIST.test(fileName.trim())) {
397
+ console.log();
398
+ console.log('Could not open ' + path_1.default.basename(fileName) + ' in the editor.');
399
+ console.log();
400
+ console.log('When running on Windows, file names are checked against a whitelist ' +
401
+ 'to protect against remote code execution attacks. File names may ' +
402
+ 'consist only of alphanumeric characters (all languages), periods, ' +
403
+ 'dashes, slashes, and underscores.');
404
+ console.log();
405
+ return false;
406
+ }
407
+ const args = lineNumber
408
+ ? getArgumentsForLineNumber(editor, fileName, String(lineNumber), colNumber)
409
+ : [fileName];
410
+ if (_childProcess && isTerminalEditor(editor)) {
411
+ // There's an existing editor process already and it's attached
412
+ // to the terminal, so go kill it. Otherwise two separate editor
413
+ // instances attach to the stdin/stdout which gets confusing.
414
+ _childProcess.kill('SIGKILL');
415
+ }
416
+ if (process.platform === 'win32') {
417
+ // On Windows, launch the editor in a shell because spawn can only
418
+ // launch .exe files.
419
+ _childProcess = child_process_1.default.spawn('cmd.exe', ['/C', editor].concat(args), { stdio: 'inherit' });
420
+ }
421
+ else {
422
+ _childProcess = child_process_1.default.spawn(editor, args, { stdio: 'inherit' });
423
+ }
424
+ _childProcess.on('exit', (errorCode) => {
425
+ _childProcess = null;
426
+ if (errorCode) {
427
+ console.log(`Process exited with code ${errorCode}`);
428
+ }
429
+ });
430
+ _childProcess.on('error', (error) => {
431
+ console.log('Error opening file in editor', fileName, error.message);
432
+ });
433
+ return true;
434
+ }
435
+ exports.launchEditor = launchEditor;
436
+ //# sourceMappingURL=open-in-editor.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"open-in-editor.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/open-in-editor.ts"],"names":[],"mappings":";AAAA;;EAEE;;;;;;;;;;;;;;;;;;;;;;;;;AAEF;;;;;GAKG;AACH,gDAAwB;AAExB,4CAAoB;AACpB,gDAAwB;AACxB,+DAAgE;AAChE,4CAAoB;AAEpB,MAAM,QAAQ,GAAG,cAAI,CAAC,SAAS,CAAC,oBAAI,CAAC,CAAC;AAEtC,SAAS,gBAAgB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Aa,CAAC,IAAI,CAAC,SAAS,CAAC,CAAC;KAC9B;IAED,IAAI,OAAO,CAAC,QAAQ,KAAK,OAAO,EAAE;QACjC,kEAAkE;QAClE,qBAAqB;QACrB,aAAa,GAAG,uBAAa,CAAC,KAAK,CAClC,SAAS,EACT,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC,MAAM,CAAC,IAAI,CAAC,EAC3B,EAAC,KAAK,EAAE,SAAS,EAAC,CAClB,CAAC;KACF;SAAM;QACN,aAAa,GAAG,uBAAa,CAAC,KAAK,CAAC,MAAM,EAAE,IAAI,EAAE,EAAC,KAAK,EAAE,SAAS,EAAC,CAAC,CAAC;KACtE;IAED,aAAa,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,SAAS,EAAE,EAAE;QACtC,aAAa,GAAG,IAAI,CAAC;QAErB,IAAI,SAAS,EAAE;YACd,OAAO,CAAC,GAAG,CAAC,4BAA4B,SAAS,EAAE,CAAC,CAAC;SACrD;IACF,CAAC,CAAC,CAAC;IAEH,aAAa,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,KAAK,EAAE,EAAE;QACnC,OAAO,CAAC,GAAG,CAAC,8BAA8B,EAAE,QAAQ,EAAE,KAAK,CAAC,OAAO,CAAC,CAAC;IACtE,CAAC,CAAC,CAAC;IACH,OAAO,IAAI,CAAC;AACb,CAAC;AAnGD,oCAmGC"}
@@ -0,0 +1,15 @@
1
+ /**
2
+ * Copyright (c) 2015-present, Facebook, Inc.
3
+ *
4
+ * This source code is licensed under the MIT license found in the
5
+ * LICENSE file in the root directory of this source tree.
6
+ */
7
+ import { StackFrame } from './stack-frame';
8
+ /**
9
+ * Turns an <code>Error</code>, or similar object, into a set of <code>StackFrame</code>s.
10
+ * @alias parse
11
+ */
12
+ declare function parseError(error: Error | string | string[]): StackFrame[];
13
+ export { parseError as parse };
14
+ export default parseError;
15
+ //# sourceMappingURL=parser.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/parser.ts"],"names":[],"mappings":"AAIA;;;;;GAKG;AAEH,OAAO,EAAC,UAAU,EAAC,MAAM,eAAe,CAAC;AAyEzC;;;GAGG;AACH,iBAAS,UAAU,CAAC,KAAK,EAAE,KAAK,GAAG,MAAM,GAAG,MAAM,EAAE,GAAG,UAAU,EAAE,CAkBlE;AAED,OAAO,EAAC,UAAU,IAAI,KAAK,EAAC,CAAC;AAC7B,eAAe,UAAU,CAAC"}
@@ -0,0 +1,85 @@
1
+ "use strict";
2
+ /*
3
+ Source code adapted from https://github.com/facebook/create-react-app/tree/main/packages/react-error-overlay and refactored in Typescript. This file is MIT-licensed.
4
+ */
5
+ Object.defineProperty(exports, "__esModule", { value: true });
6
+ exports.parse = void 0;
7
+ /**
8
+ * Copyright (c) 2015-present, Facebook, Inc.
9
+ *
10
+ * This source code is licensed under the MIT license found in the
11
+ * LICENSE file in the root directory of this source tree.
12
+ */
13
+ const stack_frame_1 = require("./stack-frame");
14
+ const regexExtractLocation = /\(?(.+?)(?::(\d+))?(?::(\d+))?\)?$/;
15
+ function extractLocation(token) {
16
+ const execed = regexExtractLocation.exec(token);
17
+ if (!execed) {
18
+ throw new Error('Could not match in extractLocation');
19
+ }
20
+ return execed.slice(1).map((v) => {
21
+ const p = Number(v);
22
+ if (!isNaN(p)) {
23
+ return p;
24
+ }
25
+ return v;
26
+ });
27
+ }
28
+ const regexValidFrame_Chrome = /^\s*(at|in)\s.+(:\d+)/;
29
+ const regexValidFrame_FireFox = /(^|@)\S+:\d+|.+line\s+\d+\s+>\s+(eval|Function).+/;
30
+ function parseStack(stack) {
31
+ const frames = stack
32
+ .filter((e) => regexValidFrame_Chrome.test(e) || regexValidFrame_FireFox.test(e))
33
+ .map((e) => {
34
+ if (regexValidFrame_FireFox.test(e)) {
35
+ // Strip eval, we don't care about it
36
+ let isEval = false;
37
+ if (/ > (eval|Function)/.test(e)) {
38
+ e = e.replace(/ line (\d+)(?: > eval line \d+)* > (eval|Function):\d+:\d+/g, ':$1');
39
+ isEval = true;
40
+ }
41
+ const _data = e.split(/[@]/g);
42
+ const _last = _data.pop();
43
+ if (!_last) {
44
+ throw new Error('could not get last');
45
+ }
46
+ return new stack_frame_1.StackFrame(_data.join('@') || (isEval ? 'eval' : null), ...extractLocation(_last));
47
+ }
48
+ // Strip eval, we don't care about it
49
+ if (e.indexOf('(eval ') !== -1) {
50
+ e = e.replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
51
+ }
52
+ if (e.indexOf('(at ') !== -1) {
53
+ e = e.replace(/\(at /, '(');
54
+ }
55
+ const data = e.trim().split(/\s+/g).slice(1);
56
+ const last = data.pop();
57
+ if (!last) {
58
+ throw new Error('could not get last');
59
+ }
60
+ return new stack_frame_1.StackFrame(data.join(' ') || null, ...extractLocation(last));
61
+ });
62
+ return frames;
63
+ }
64
+ /**
65
+ * Turns an <code>Error</code>, or similar object, into a set of <code>StackFrame</code>s.
66
+ * @alias parse
67
+ */
68
+ function parseError(error) {
69
+ if (error === null) {
70
+ throw new Error('You cannot pass a null object.');
71
+ }
72
+ if (typeof error === 'string') {
73
+ return parseStack(error.split('\n'));
74
+ }
75
+ if (Array.isArray(error)) {
76
+ return parseStack(error);
77
+ }
78
+ if (typeof error.stack === 'string') {
79
+ return parseStack(error.stack.split('\n'));
80
+ }
81
+ throw new Error('The error you provided does not contain a stack trace.');
82
+ }
83
+ exports.parse = parseError;
84
+ exports.default = parseError;
85
+ //# sourceMappingURL=parser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"parser.js","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/parser.ts"],"names":[],"mappings":";AAAA;;EAEE;;;AAEF;;;;;GAKG;AAEH,+CAAyC;AAEzC,MAAM,oBAAoB,GAAG,oCAAoC,CAAC;AAElE,SAAS,eAAe,CAAC,KAAa;IACrC,MAAM,MAAM,GAAG,oBAAoB,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;IAChD,IAA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;IAED,IAAI,OAAO,KAAK,CAAC,KAAK,KAAK,QAAQ,EAAE;QACpC,OAAO,UAAU,CAAC,KAAK,CAAC,KAAK,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC,CAAC;KAC3C;IAED,MAAM,IAAI,KAAK,CAAC,wDAAwD,CAAC,CAAC;AAC3E,CAAC;AAEqB,2BAAK;AAC3B,kBAAe,UAAU,CAAC"}
@@ -0,0 +1,2 @@
1
+ export declare function pathNormalize(path: string): string;
2
+ //# sourceMappingURL=path.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"path.d.ts","sourceRoot":"","sources":["../../../../src/error-overlay/react-overlay/utils/path.ts"],"names":[],"mappings":"AAyEA,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,UAczC"}