@remotion/cli 4.0.0-fastlambda.8 → 4.0.0-lambda.3
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.
- package/dist/bundle-on-cli.d.ts +2 -0
- package/dist/bundle-on-cli.js +41 -0
- package/dist/bundle.d.ts +1 -0
- package/dist/bundle.js +31 -0
- package/dist/compositions.js +14 -3
- package/dist/download-progress.js +4 -1
- package/dist/editor/components/AudioWaveform.js +2 -2
- package/dist/editor/components/AudioWaveformBar.js +1 -1
- package/dist/editor/components/Canvas.js +1 -1
- package/dist/editor/components/CheckboardToggle.js +1 -1
- package/dist/editor/components/ClipboardIcon.js +1 -1
- package/dist/editor/components/CollapsedCompositionSelector.d.ts +4 -0
- package/dist/editor/components/CollapsedCompositionSelector.js +39 -0
- package/dist/editor/components/CompositionSelector.js +5 -45
- package/dist/editor/components/CompositionSelectorItem.js +3 -3
- package/dist/editor/components/ControlButton.js +1 -1
- package/dist/editor/components/CopyButton.js +2 -2
- package/dist/editor/components/CurrentComposition.js +2 -2
- package/dist/editor/components/Editor.js +24 -8
- package/dist/editor/components/EditorContent.js +3 -2
- package/dist/editor/components/FpsCounter.js +1 -1
- package/dist/editor/components/InitialCompositionLoader.d.ts +4 -0
- package/dist/editor/components/InitialCompositionLoader.js +60 -0
- package/dist/editor/components/KeyboardShortcutsModal.js +1 -1
- package/dist/editor/components/LoadingIndicator.js +1 -1
- package/dist/editor/components/LoopToggle.js +1 -1
- package/dist/editor/components/Menu/MenuDivider.js +1 -1
- package/dist/editor/components/Menu/MenuItem.js +3 -3
- package/dist/editor/components/Menu/MenuSubItem.js +3 -3
- package/dist/editor/components/Menu/SubMenu.js +1 -1
- package/dist/editor/components/MenuBuildIndicator.d.ts +2 -0
- package/dist/editor/components/MenuBuildIndicator.js +26 -0
- package/dist/editor/components/MenuToolbar.js +69 -9
- package/dist/editor/components/ModalContainer.js +1 -1
- package/dist/editor/components/ModalHeader.js +1 -1
- package/dist/editor/components/MuteToggle.js +1 -1
- package/dist/editor/components/NewComposition/CancelButton.js +1 -1
- package/dist/editor/components/NewComposition/ComboBox.js +3 -3
- package/dist/editor/components/NewComposition/CopyHint.js +1 -1
- package/dist/editor/components/NewComposition/InputDragger.js +2 -2
- package/dist/editor/components/NewComposition/MenuContent.js +1 -1
- package/dist/editor/components/NewComposition/NewCompAspectRatio.js +1 -1
- package/dist/editor/components/NewComposition/NewCompDuration.js +1 -1
- package/dist/editor/components/NewComposition/NewComposition.js +4 -4
- package/dist/editor/components/NewComposition/RemInput.js +1 -1
- package/dist/editor/components/NewComposition/ToggleAspectRatio.js +1 -1
- package/dist/editor/components/NewComposition/ValidationMessage.js +2 -2
- package/dist/editor/components/NoRegisterRoot.d.ts +2 -0
- package/dist/editor/components/NoRegisterRoot.js +41 -0
- package/dist/editor/components/PlayPause.js +40 -11
- package/dist/editor/components/PlaybackRateSelector.js +2 -2
- package/dist/editor/components/Preview.js +10 -7
- package/dist/editor/components/PreviewToolbar.js +1 -1
- package/dist/editor/components/RichTimelineToggle.js +1 -1
- package/dist/editor/components/SizeSelector.js +2 -2
- package/dist/editor/components/Splitter/SplitterContainer.js +1 -1
- package/dist/editor/components/Splitter/SplitterElement.js +4 -2
- package/dist/editor/components/Splitter/SplitterHandle.d.ts +4 -1
- package/dist/editor/components/Splitter/SplitterHandle.js +28 -7
- package/dist/editor/components/Thumbnail.js +1 -1
- package/dist/editor/components/TimeValue.js +1 -1
- package/dist/editor/components/Timeline/LoopedIndicator.js +2 -2
- package/dist/editor/components/Timeline/LoopedTimelineIndicators.js +3 -3
- package/dist/editor/components/Timeline/MaxTimelineTracks.js +1 -1
- package/dist/editor/components/Timeline/Timeline.js +2 -1
- package/dist/editor/components/Timeline/TimelineCollapseToggle.js +2 -2
- package/dist/editor/components/Timeline/TimelineDragHandler.js +1 -1
- package/dist/editor/components/Timeline/TimelineInOutPointer.js +2 -2
- package/dist/editor/components/Timeline/TimelineInOutPointerHandle.js +1 -1
- package/dist/editor/components/Timeline/TimelineList.js +1 -1
- package/dist/editor/components/Timeline/TimelineListItem.js +1 -1
- package/dist/editor/components/Timeline/TimelineSequence.js +1 -1
- package/dist/editor/components/Timeline/TimelineSequenceFrame.js +1 -1
- package/dist/editor/components/Timeline/TimelineSlider.js +1 -1
- package/dist/editor/components/Timeline/TimelineSliderHandle.js +1 -1
- package/dist/editor/components/Timeline/TimelineTracks.js +2 -2
- package/dist/editor/components/Timeline/TimelineVideoInfo.js +1 -1
- package/dist/editor/components/TimelineInOutToggle.js +1 -1
- package/dist/editor/components/TopPanel.js +24 -1
- package/dist/editor/components/UpdateCheck.d.ts +1 -1
- package/dist/editor/components/UpdateCheck.js +1 -1
- package/dist/editor/components/UpdateModal/UpdateModal.js +1 -1
- package/dist/editor/components/layout.js +4 -4
- package/dist/editor/helpers/use-compact-ui.d.ts +1 -0
- package/dist/editor/helpers/use-compact-ui.js +18 -0
- package/dist/editor/icons/Checkmark.js +1 -1
- package/dist/editor/icons/caret.d.ts +1 -1
- package/dist/editor/icons/caret.js +4 -4
- package/dist/editor/icons/film.js +1 -1
- package/dist/editor/icons/folder.js +2 -2
- package/dist/editor/icons/jump-to-start.d.ts +2 -0
- package/dist/editor/icons/jump-to-start.js +8 -0
- package/dist/editor/icons/keys.js +3 -3
- package/dist/editor/icons/lock.js +2 -2
- package/dist/editor/icons/media-volume.js +2 -2
- package/dist/editor/icons/pause.js +1 -1
- package/dist/editor/icons/play.js +1 -1
- package/dist/editor/icons/step-back.js +1 -1
- package/dist/editor/icons/step-forward.js +1 -1
- package/dist/editor/icons/still.js +1 -1
- package/dist/editor/icons/timeline.js +1 -1
- package/dist/editor/icons/timelineInOutPointer.js +2 -2
- package/dist/editor/state/folders.d.ts +11 -0
- package/dist/editor/state/folders.js +23 -0
- package/dist/editor/state/highest-z-index.js +2 -2
- package/dist/editor/state/keybindings.js +1 -1
- package/dist/editor/state/sidebar.d.ts +12 -0
- package/dist/editor/state/sidebar.js +40 -0
- package/dist/editor/state/z-index.js +1 -1
- package/dist/get-cli-options.d.ts +3 -1
- package/dist/get-cli-options.js +8 -2
- package/dist/get-latest-remotion-version.d.ts +1 -0
- package/dist/get-latest-remotion-version.js +31 -0
- package/dist/index.d.ts +3 -1
- package/dist/index.js +5 -1
- package/dist/lambda-command.js +5 -1
- package/dist/parse-command-line.d.ts +1 -0
- package/dist/parse-command-line.js +6 -0
- package/dist/prepare-entry-point.d.ts +11 -0
- package/dist/prepare-entry-point.js +36 -0
- package/dist/preview-server/dev-middleware/compatible-api.d.ts +7 -0
- package/dist/preview-server/dev-middleware/compatible-api.js +20 -0
- package/dist/preview-server/dev-middleware/get-paths.d.ts +7 -0
- package/dist/preview-server/dev-middleware/get-paths.js +19 -0
- package/dist/preview-server/dev-middleware/index.d.ts +3 -0
- package/dist/preview-server/dev-middleware/index.js +27 -0
- package/dist/preview-server/dev-middleware/is-color-supported.d.ts +1 -0
- package/dist/preview-server/dev-middleware/is-color-supported.js +37 -0
- package/dist/preview-server/dev-middleware/middleware.d.ts +10 -0
- package/dist/preview-server/dev-middleware/middleware.js +224 -0
- package/dist/preview-server/dev-middleware/range-parser.d.ts +15 -0
- package/dist/preview-server/dev-middleware/range-parser.js +96 -0
- package/dist/preview-server/dev-middleware/ready.d.ts +3 -0
- package/dist/preview-server/dev-middleware/ready.js +11 -0
- package/dist/preview-server/dev-middleware/setup-hooks.d.ts +2 -0
- package/dist/preview-server/dev-middleware/setup-hooks.js +42 -0
- package/dist/preview-server/dev-middleware/setup-output-filesystem.d.ts +2 -0
- package/dist/preview-server/dev-middleware/setup-output-filesystem.js +13 -0
- package/dist/preview-server/dev-middleware/types.d.ts +10 -0
- package/dist/preview-server/dev-middleware/types.js +2 -0
- package/dist/preview-server/error-overlay/entry-basic.d.ts +1 -0
- package/dist/preview-server/error-overlay/entry-basic.js +21 -0
- package/dist/preview-server/error-overlay/react-overlay/effects/format-warning.d.ts +11 -0
- package/dist/preview-server/error-overlay/react-overlay/effects/format-warning.js +41 -0
- package/dist/preview-server/error-overlay/react-overlay/effects/map-error-to-react-stack.d.ts +7 -0
- package/dist/preview-server/error-overlay/react-overlay/effects/map-error-to-react-stack.js +46 -0
- package/dist/preview-server/error-overlay/react-overlay/effects/proxy-console.d.ts +24 -0
- package/dist/preview-server/error-overlay/react-overlay/effects/proxy-console.js +64 -0
- package/dist/preview-server/error-overlay/react-overlay/effects/resolve-file-source.d.ts +3 -0
- package/dist/preview-server/error-overlay/react-overlay/effects/resolve-file-source.js +31 -0
- package/dist/preview-server/error-overlay/react-overlay/effects/stack-trace-limit.d.ts +3 -0
- package/dist/preview-server/error-overlay/react-overlay/effects/stack-trace-limit.js +43 -0
- package/dist/preview-server/error-overlay/react-overlay/effects/unhandled-error.d.ts +4 -0
- package/dist/preview-server/error-overlay/react-overlay/effects/unhandled-error.js +45 -0
- package/dist/preview-server/error-overlay/react-overlay/effects/unhandled-rejection.d.ts +4 -0
- package/dist/preview-server/error-overlay/react-overlay/effects/unhandled-rejection.js +41 -0
- package/dist/preview-server/error-overlay/react-overlay/index.d.ts +2 -0
- package/dist/preview-server/error-overlay/react-overlay/index.js +21 -0
- package/dist/preview-server/error-overlay/react-overlay/listen-to-runtime-errors.d.ts +8 -0
- package/dist/preview-server/error-overlay/react-overlay/listen-to-runtime-errors.js +79 -0
- package/dist/preview-server/error-overlay/react-overlay/utils/get-file-source.d.ts +1 -0
- package/dist/preview-server/error-overlay/react-overlay/utils/get-file-source.js +21 -0
- package/dist/preview-server/error-overlay/react-overlay/utils/get-lines-around.d.ts +14 -0
- package/dist/preview-server/error-overlay/react-overlay/utils/get-lines-around.js +24 -0
- package/dist/preview-server/error-overlay/react-overlay/utils/get-source-map.d.ts +13 -0
- package/dist/preview-server/error-overlay/react-overlay/utils/get-source-map.js +58 -0
- package/dist/preview-server/error-overlay/react-overlay/utils/get-stack-frames.d.ts +2 -0
- package/dist/preview-server/error-overlay/react-overlay/utils/get-stack-frames.js +27 -0
- package/dist/preview-server/error-overlay/react-overlay/utils/open-in-editor.d.ts +12 -0
- package/dist/preview-server/error-overlay/react-overlay/utils/open-in-editor.js +460 -0
- package/dist/preview-server/error-overlay/react-overlay/utils/parser.d.ts +2 -0
- package/dist/preview-server/error-overlay/react-overlay/utils/parser.js +117 -0
- package/dist/preview-server/error-overlay/react-overlay/utils/stack-frame.d.ts +40 -0
- package/dist/preview-server/error-overlay/react-overlay/utils/stack-frame.js +31 -0
- package/dist/preview-server/error-overlay/react-overlay/utils/unmapper.d.ts +2 -0
- package/dist/preview-server/error-overlay/react-overlay/utils/unmapper.js +64 -0
- package/dist/preview-server/error-overlay/remotion-overlay/AskOnDiscord.d.ts +2 -0
- package/dist/preview-server/error-overlay/remotion-overlay/AskOnDiscord.js +14 -0
- package/dist/preview-server/error-overlay/remotion-overlay/Button.d.ts +6 -0
- package/dist/preview-server/error-overlay/remotion-overlay/Button.js +24 -0
- package/dist/preview-server/error-overlay/remotion-overlay/CodeFrame.d.ts +6 -0
- package/dist/preview-server/error-overlay/remotion-overlay/CodeFrame.js +28 -0
- package/dist/preview-server/error-overlay/remotion-overlay/DismissButton.d.ts +2 -0
- package/dist/preview-server/error-overlay/remotion-overlay/DismissButton.js +23 -0
- package/dist/preview-server/error-overlay/remotion-overlay/ErrorDisplay.d.ts +5 -0
- package/dist/preview-server/error-overlay/remotion-overlay/ErrorDisplay.js +45 -0
- package/dist/preview-server/error-overlay/remotion-overlay/ErrorLoader.d.ts +4 -0
- package/dist/preview-server/error-overlay/remotion-overlay/ErrorLoader.js +61 -0
- package/dist/preview-server/error-overlay/remotion-overlay/ErrorTitle.d.ts +6 -0
- package/dist/preview-server/error-overlay/remotion-overlay/ErrorTitle.js +41 -0
- package/dist/preview-server/error-overlay/remotion-overlay/OpenInEditor.d.ts +5 -0
- package/dist/preview-server/error-overlay/remotion-overlay/OpenInEditor.js +91 -0
- package/dist/preview-server/error-overlay/remotion-overlay/Overlay.d.ts +14 -0
- package/dist/preview-server/error-overlay/remotion-overlay/Overlay.js +49 -0
- package/dist/preview-server/error-overlay/remotion-overlay/SearchGitHubIssues.d.ts +4 -0
- package/dist/preview-server/error-overlay/remotion-overlay/SearchGitHubIssues.js +13 -0
- package/dist/preview-server/error-overlay/remotion-overlay/StackFrame.d.ts +8 -0
- package/dist/preview-server/error-overlay/remotion-overlay/StackFrame.js +48 -0
- package/dist/preview-server/error-overlay/remotion-overlay/Symbolicating.d.ts +2 -0
- package/dist/preview-server/error-overlay/remotion-overlay/Symbolicating.js +8 -0
- package/dist/preview-server/error-overlay/remotion-overlay/carets.d.ts +3 -0
- package/dist/preview-server/error-overlay/remotion-overlay/carets.js +12 -0
- package/dist/preview-server/error-overlay/remotion-overlay/format-location.d.ts +1 -0
- package/dist/preview-server/error-overlay/remotion-overlay/format-location.js +10 -0
- package/dist/preview-server/error-overlay/remotion-overlay/index.d.ts +1 -0
- package/dist/preview-server/error-overlay/remotion-overlay/index.js +18 -0
- package/dist/preview-server/get-package-manager.d.ts +9 -0
- package/dist/preview-server/get-package-manager.js +40 -0
- package/dist/preview-server/hot-middleware/client.d.ts +19 -0
- package/dist/preview-server/hot-middleware/client.js +177 -0
- package/dist/preview-server/hot-middleware/index.d.ts +8 -0
- package/dist/preview-server/hot-middleware/index.js +150 -0
- package/dist/preview-server/hot-middleware/process-update.d.ts +12 -0
- package/dist/preview-server/hot-middleware/process-update.js +144 -0
- package/dist/preview-server/hot-middleware/strip-ansi.d.ts +1 -0
- package/dist/preview-server/hot-middleware/strip-ansi.js +21 -0
- package/dist/preview-server/hot-middleware/types.d.ts +27 -0
- package/dist/preview-server/hot-middleware/types.js +10 -0
- package/dist/preview-server/project-info.d.ts +5 -0
- package/dist/preview-server/project-info.js +22 -0
- package/dist/preview-server/routes.d.ts +7 -0
- package/dist/preview-server/routes.js +128 -0
- package/dist/preview-server/serve-static.d.ts +9 -0
- package/dist/preview-server/serve-static.js +77 -0
- package/dist/preview-server/start-server.d.ts +8 -0
- package/dist/preview-server/start-server.js +69 -0
- package/dist/preview-server/update-available.d.ts +11 -0
- package/dist/preview-server/update-available.js +44 -0
- package/dist/preview.js +2 -2
- package/dist/previewEntry.js +2 -2
- package/dist/print-error.js +1 -0
- package/dist/print-help.js +3 -3
- package/dist/render.js +30 -24
- package/dist/still.js +46 -15
- package/dist/upgrade.js +9 -7
- package/dist/versions.js +3 -0
- package/dist/webpack-cache.d.ts +12 -0
- package/dist/webpack-cache.js +66 -0
- package/package.json +12 -10
- package/web/favicon.png +0 -0
|
@@ -0,0 +1,460 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Duplicated in create-video/src/open-in-editor.ts
|
|
3
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
4
|
+
if (k2 === undefined) k2 = k;
|
|
5
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
6
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
7
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
8
|
+
}
|
|
9
|
+
Object.defineProperty(o, k2, desc);
|
|
10
|
+
}) : (function(o, m, k, k2) {
|
|
11
|
+
if (k2 === undefined) k2 = k;
|
|
12
|
+
o[k2] = m[k];
|
|
13
|
+
}));
|
|
14
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
15
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
16
|
+
}) : function(o, v) {
|
|
17
|
+
o["default"] = v;
|
|
18
|
+
});
|
|
19
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
20
|
+
if (mod && mod.__esModule) return mod;
|
|
21
|
+
var result = {};
|
|
22
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
23
|
+
__setModuleDefault(result, mod);
|
|
24
|
+
return result;
|
|
25
|
+
};
|
|
26
|
+
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
27
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
28
|
+
};
|
|
29
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
30
|
+
exports.launchEditor = exports.guessEditor = exports.getDisplayNameForEditor = void 0;
|
|
31
|
+
/*
|
|
32
|
+
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.
|
|
33
|
+
*/
|
|
34
|
+
/**
|
|
35
|
+
* Copyright (c) 2015-present, Facebook, Inc.
|
|
36
|
+
*
|
|
37
|
+
* This source code is licensed under the MIT license found in the
|
|
38
|
+
* LICENSE file in the root directory of this source tree.
|
|
39
|
+
*/
|
|
40
|
+
const child_process_1 = __importStar(require("child_process"));
|
|
41
|
+
const fs_1 = __importDefault(require("fs"));
|
|
42
|
+
const os_1 = __importDefault(require("os"));
|
|
43
|
+
const path_1 = __importDefault(require("path"));
|
|
44
|
+
const util_1 = __importDefault(require("util"));
|
|
45
|
+
const log_1 = require("../../../../log");
|
|
46
|
+
const execProm = util_1.default.promisify(child_process_1.exec);
|
|
47
|
+
const isVsCodeDerivative = (editor) => {
|
|
48
|
+
return (editor === 'code' ||
|
|
49
|
+
editor === 'code-insiders' ||
|
|
50
|
+
editor === 'Code.exe' ||
|
|
51
|
+
editor === 'vscodium' ||
|
|
52
|
+
editor === 'VSCodium.exe' ||
|
|
53
|
+
editor === 'Code - Insiders.exe');
|
|
54
|
+
};
|
|
55
|
+
function isTerminalEditor(editor) {
|
|
56
|
+
switch (editor) {
|
|
57
|
+
case 'vim':
|
|
58
|
+
case 'emacs':
|
|
59
|
+
case 'nano':
|
|
60
|
+
return true;
|
|
61
|
+
default:
|
|
62
|
+
return false;
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
const editorNames = [
|
|
66
|
+
'atom',
|
|
67
|
+
'/Applications/Atom Beta.app/Contents/MacOS/Atom Beta',
|
|
68
|
+
'brackets',
|
|
69
|
+
'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',
|
|
70
|
+
'/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl',
|
|
71
|
+
'/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl',
|
|
72
|
+
'code',
|
|
73
|
+
'code-insiders',
|
|
74
|
+
'vscodium',
|
|
75
|
+
'/Applications/AppCode.app/Contents/MacOS/appcode',
|
|
76
|
+
'/Applications/CLion.app/Contents/MacOS/clion',
|
|
77
|
+
'/Applications/IntelliJ IDEA.app/Contents/MacOS/idea',
|
|
78
|
+
'/Applications/PhpStorm.app/Contents/MacOS/phpstorm',
|
|
79
|
+
'/Applications/PyCharm.app/Contents/MacOS/pycharm',
|
|
80
|
+
'/Applications/PyCharm CE.app/Contents/MacOS/pycharm',
|
|
81
|
+
'/Applications/RubyMine.app/Contents/MacOS/rubymine',
|
|
82
|
+
'/Applications/WebStorm.app/Contents/MacOS/webstorm',
|
|
83
|
+
'/Applications/GoLand.app/Contents/MacOS/goland',
|
|
84
|
+
'/Applications/Rider.app/Contents/MacOS/rider',
|
|
85
|
+
'mvim',
|
|
86
|
+
'emacs',
|
|
87
|
+
'gvim',
|
|
88
|
+
'idea',
|
|
89
|
+
'phpstorm',
|
|
90
|
+
'pycharm',
|
|
91
|
+
'rubymine',
|
|
92
|
+
'sublime_text',
|
|
93
|
+
'vim',
|
|
94
|
+
'webstorm',
|
|
95
|
+
'goland',
|
|
96
|
+
'rider',
|
|
97
|
+
'Brackets.exe',
|
|
98
|
+
'Code.exe',
|
|
99
|
+
'Code - Insiders.exe',
|
|
100
|
+
'VSCodium.exe',
|
|
101
|
+
'atom.exe',
|
|
102
|
+
'sublime_text.exe',
|
|
103
|
+
'notepad++.exe',
|
|
104
|
+
'clion.exe',
|
|
105
|
+
'clion64.exe',
|
|
106
|
+
'idea.exe',
|
|
107
|
+
'idea64.exe',
|
|
108
|
+
'phpstorm.exe',
|
|
109
|
+
'phpstorm64.exe',
|
|
110
|
+
'pycharm.exe',
|
|
111
|
+
'pycharm64.exe',
|
|
112
|
+
'rubymine.exe',
|
|
113
|
+
'rubymine64.exe',
|
|
114
|
+
'webstorm.exe',
|
|
115
|
+
'webstorm64.exe',
|
|
116
|
+
'goland.exe',
|
|
117
|
+
'goland64.exe',
|
|
118
|
+
'rider.exe',
|
|
119
|
+
'rider64.exe',
|
|
120
|
+
'nano',
|
|
121
|
+
];
|
|
122
|
+
const displayNameForEditor = {
|
|
123
|
+
'/Applications/AppCode.app/Contents/MacOS/appcode': 'AppCode',
|
|
124
|
+
'/Applications/Atom Beta.app/Contents/MacOS/Atom Beta': 'Atom Beta',
|
|
125
|
+
'/Applications/CLion.app/Contents/MacOS/clion': 'CLion',
|
|
126
|
+
'/Applications/GoLand.app/Contents/MacOS/goland': 'GoLand',
|
|
127
|
+
'/Applications/IntelliJ IDEA.app/Contents/MacOS/idea': 'IDEA',
|
|
128
|
+
'/Applications/PhpStorm.app/Contents/MacOS/phpstorm': 'PHPStorm',
|
|
129
|
+
'/Applications/PyCharm CE.app/Contents/MacOS/pycharm': 'PyCharm',
|
|
130
|
+
'/Applications/PyCharm.app/Contents/MacOS/pycharm': 'PyCharm',
|
|
131
|
+
'/Applications/Rider.app/Contents/MacOS/rider': 'Rider',
|
|
132
|
+
'/Applications/RubyMine.app/Contents/MacOS/rubymine': 'RubyMine',
|
|
133
|
+
'/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl': 'Sublime Text 2',
|
|
134
|
+
'/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl': 'Sublime Text Dev',
|
|
135
|
+
'/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl': 'Sublime Text',
|
|
136
|
+
'/Applications/WebStorm.app/Contents/MacOS/webstorm': 'WebStorm',
|
|
137
|
+
'Brackets.exe': 'Brackets',
|
|
138
|
+
'Code - Insiders.exe': 'VS Code Insiders',
|
|
139
|
+
'Code.exe': 'VS Code',
|
|
140
|
+
'VSCodium.exe': 'VS Codium',
|
|
141
|
+
'atom.exe': 'Atom',
|
|
142
|
+
'clion.exe': 'CLion',
|
|
143
|
+
'clion64.exe': 'CLion',
|
|
144
|
+
'code-insiders': 'VS Code Insiders',
|
|
145
|
+
'goland.exe': 'GoLand',
|
|
146
|
+
'goland64.exe': 'GoLand',
|
|
147
|
+
'idea.exe': 'IDEA',
|
|
148
|
+
'idea64.exe': 'IDEA',
|
|
149
|
+
'notepad++.exe': 'Notepad++',
|
|
150
|
+
'phpstorm.exe': 'PHPStorm',
|
|
151
|
+
'phpstorm64.exe': 'PHPStorm',
|
|
152
|
+
'pycharm.exe': 'PyCharm',
|
|
153
|
+
'pycharm64.exe': 'PyCharm',
|
|
154
|
+
'rider.exe': 'Rider',
|
|
155
|
+
'rider64.exe': 'Rider',
|
|
156
|
+
'rubymine.exe': 'RubyMine',
|
|
157
|
+
'rubymine64.exe': 'RubyMine',
|
|
158
|
+
'sublime_text.exe': 'Sublime Text',
|
|
159
|
+
'webstorm.exe': 'WebStorm',
|
|
160
|
+
'webstorm64.exe': 'WebStorm',
|
|
161
|
+
atom: 'Atom',
|
|
162
|
+
brackets: 'Brackets',
|
|
163
|
+
code: 'VS Code',
|
|
164
|
+
emacs: 'emacs',
|
|
165
|
+
goland: 'GoLand',
|
|
166
|
+
gvim: 'GVim',
|
|
167
|
+
idea: 'IDEA',
|
|
168
|
+
mvim: 'mvim',
|
|
169
|
+
phpstorm: 'PHPStorm',
|
|
170
|
+
pycharm: 'PyCharm',
|
|
171
|
+
rider: 'Rider',
|
|
172
|
+
rubymine: 'RubyMine',
|
|
173
|
+
sublime_text: 'Sublime Text',
|
|
174
|
+
vim: 'vim',
|
|
175
|
+
vscodium: 'VS Codium',
|
|
176
|
+
webstorm: 'WebStorm',
|
|
177
|
+
nano: 'nano',
|
|
178
|
+
};
|
|
179
|
+
const getDisplayNameForEditor = (editor) => {
|
|
180
|
+
var _a, _b;
|
|
181
|
+
if (!editor) {
|
|
182
|
+
return null;
|
|
183
|
+
}
|
|
184
|
+
const endsIn = Object.keys(displayNameForEditor).find((displayNameKey) => {
|
|
185
|
+
return editor.endsWith(displayNameKey);
|
|
186
|
+
});
|
|
187
|
+
return ((_b = (_a = displayNameForEditor[editor]) !== null && _a !== void 0 ? _a : displayNameForEditor[endsIn]) !== null && _b !== void 0 ? _b : editor);
|
|
188
|
+
};
|
|
189
|
+
exports.getDisplayNameForEditor = getDisplayNameForEditor;
|
|
190
|
+
// Map from full process name to binary that starts the process
|
|
191
|
+
// We can't just re-use full process name, because it will spawn a new instance
|
|
192
|
+
// of the app every time
|
|
193
|
+
const COMMON_EDITORS_OSX = {
|
|
194
|
+
'/Applications/Atom.app/Contents/MacOS/Atom': 'atom',
|
|
195
|
+
'/Applications/Atom Beta.app/Contents/MacOS/Atom Beta': '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta',
|
|
196
|
+
'/Applications/Brackets.app/Contents/MacOS/Brackets': 'brackets',
|
|
197
|
+
'/Applications/Sublime Text.app/Contents/MacOS/Sublime Text': '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',
|
|
198
|
+
'/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text': '/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl',
|
|
199
|
+
'/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2': '/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl',
|
|
200
|
+
'/Applications/Visual Studio Code.app/Contents/MacOS/Electron': 'code',
|
|
201
|
+
'/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron': 'code-insiders',
|
|
202
|
+
'/Applications/VSCodium.app/Contents/MacOS/Electron': 'vscodium',
|
|
203
|
+
'/Applications/AppCode.app/Contents/MacOS/appcode': '/Applications/AppCode.app/Contents/MacOS/appcode',
|
|
204
|
+
'/Applications/CLion.app/Contents/MacOS/clion': '/Applications/CLion.app/Contents/MacOS/clion',
|
|
205
|
+
'/Applications/IntelliJ IDEA.app/Contents/MacOS/idea': '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea',
|
|
206
|
+
'/Applications/PhpStorm.app/Contents/MacOS/phpstorm': '/Applications/PhpStorm.app/Contents/MacOS/phpstorm',
|
|
207
|
+
'/Applications/PyCharm.app/Contents/MacOS/pycharm': '/Applications/PyCharm.app/Contents/MacOS/pycharm',
|
|
208
|
+
'/Applications/PyCharm CE.app/Contents/MacOS/pycharm': '/Applications/PyCharm CE.app/Contents/MacOS/pycharm',
|
|
209
|
+
'/Applications/RubyMine.app/Contents/MacOS/rubymine': '/Applications/RubyMine.app/Contents/MacOS/rubymine',
|
|
210
|
+
'/Applications/WebStorm.app/Contents/MacOS/webstorm': '/Applications/WebStorm.app/Contents/MacOS/webstorm',
|
|
211
|
+
'/Applications/MacVim.app/Contents/MacOS/MacVim': 'mvim',
|
|
212
|
+
'/Applications/GoLand.app/Contents/MacOS/goland': '/Applications/GoLand.app/Contents/MacOS/goland',
|
|
213
|
+
'/Applications/Rider.app/Contents/MacOS/rider': '/Applications/Rider.app/Contents/MacOS/rider',
|
|
214
|
+
};
|
|
215
|
+
const COMMON_EDITORS_LINUX = {
|
|
216
|
+
atom: 'atom',
|
|
217
|
+
Brackets: 'brackets',
|
|
218
|
+
code: 'code',
|
|
219
|
+
'code-insiders': 'code-insiders',
|
|
220
|
+
vscodium: 'vscodium',
|
|
221
|
+
emacs: 'emacs',
|
|
222
|
+
gvim: 'gvim',
|
|
223
|
+
'idea.sh': 'idea',
|
|
224
|
+
'phpstorm.sh': 'phpstorm',
|
|
225
|
+
'pycharm.sh': 'pycharm',
|
|
226
|
+
'rubymine.sh': 'rubymine',
|
|
227
|
+
sublime_text: 'sublime_text',
|
|
228
|
+
vim: 'vim',
|
|
229
|
+
'webstorm.sh': 'webstorm',
|
|
230
|
+
'goland.sh': 'goland',
|
|
231
|
+
'rider.sh': 'rider',
|
|
232
|
+
};
|
|
233
|
+
const COMMON_EDITORS_WIN = [
|
|
234
|
+
'Brackets.exe',
|
|
235
|
+
'Code.exe',
|
|
236
|
+
'Code - Insiders.exe',
|
|
237
|
+
'VSCodium.exe',
|
|
238
|
+
'atom.exe',
|
|
239
|
+
'sublime_text.exe',
|
|
240
|
+
'notepad++.exe',
|
|
241
|
+
'clion.exe',
|
|
242
|
+
'clion64.exe',
|
|
243
|
+
'idea.exe',
|
|
244
|
+
'idea64.exe',
|
|
245
|
+
'phpstorm.exe',
|
|
246
|
+
'phpstorm64.exe',
|
|
247
|
+
'pycharm.exe',
|
|
248
|
+
'pycharm64.exe',
|
|
249
|
+
'rubymine.exe',
|
|
250
|
+
'rubymine64.exe',
|
|
251
|
+
'webstorm.exe',
|
|
252
|
+
'webstorm64.exe',
|
|
253
|
+
'goland.exe',
|
|
254
|
+
'goland64.exe',
|
|
255
|
+
'rider.exe',
|
|
256
|
+
'rider64.exe',
|
|
257
|
+
];
|
|
258
|
+
// Transpiled version of: /^([A-Za-z]:[/\\])?[\p{L}0-9/.\-_\\]+$/u
|
|
259
|
+
// Non-transpiled version requires support for Unicode property regex. Allows
|
|
260
|
+
// alphanumeric characters, periods, dashes, slashes, and underscores.
|
|
261
|
+
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])+$/;
|
|
262
|
+
function getArgumentsForLineNumber(editor, fileName, lineNumber, colNumber) {
|
|
263
|
+
const editorBasename = path_1.default.basename(editor).replace(/\.(exe|cmd|bat)$/i, '');
|
|
264
|
+
switch (editorBasename) {
|
|
265
|
+
case 'atom':
|
|
266
|
+
case 'Atom':
|
|
267
|
+
case 'Atom Beta':
|
|
268
|
+
case 'subl':
|
|
269
|
+
case 'sublime':
|
|
270
|
+
case 'sublime_text':
|
|
271
|
+
return [fileName + ':' + lineNumber + ':' + colNumber];
|
|
272
|
+
case 'wstorm':
|
|
273
|
+
case 'charm':
|
|
274
|
+
return [fileName + ':' + lineNumber];
|
|
275
|
+
case 'notepad++':
|
|
276
|
+
return ['-n' + lineNumber, '-c' + colNumber, fileName];
|
|
277
|
+
case 'vim':
|
|
278
|
+
case 'mvim':
|
|
279
|
+
case 'joe':
|
|
280
|
+
case 'gvim':
|
|
281
|
+
return ['+' + lineNumber, fileName];
|
|
282
|
+
case 'emacs':
|
|
283
|
+
case 'emacsclient':
|
|
284
|
+
return ['+' + lineNumber + ':' + colNumber, fileName];
|
|
285
|
+
case 'rmate':
|
|
286
|
+
case 'mate':
|
|
287
|
+
case 'mine':
|
|
288
|
+
return ['--line', lineNumber, fileName];
|
|
289
|
+
case 'code':
|
|
290
|
+
case 'Code':
|
|
291
|
+
case 'code-insiders':
|
|
292
|
+
case 'Code - Insiders':
|
|
293
|
+
case 'vscodium':
|
|
294
|
+
case 'VSCodium':
|
|
295
|
+
return ['-g', fileName + ':' + lineNumber + ':' + colNumber];
|
|
296
|
+
case 'appcode':
|
|
297
|
+
case 'clion':
|
|
298
|
+
case 'clion64':
|
|
299
|
+
case 'idea':
|
|
300
|
+
case 'idea64':
|
|
301
|
+
case 'phpstorm':
|
|
302
|
+
case 'phpstorm64':
|
|
303
|
+
case 'pycharm':
|
|
304
|
+
case 'pycharm64':
|
|
305
|
+
case 'rubymine':
|
|
306
|
+
case 'rubymine64':
|
|
307
|
+
case 'webstorm':
|
|
308
|
+
case 'webstorm64':
|
|
309
|
+
case 'goland':
|
|
310
|
+
case 'goland64':
|
|
311
|
+
case 'rider':
|
|
312
|
+
case 'rider64':
|
|
313
|
+
return ['--line', lineNumber, fileName];
|
|
314
|
+
default:
|
|
315
|
+
// For all others, drop the lineNumber until we have
|
|
316
|
+
// a mapping above, since providing the lineNumber incorrectly
|
|
317
|
+
// can result in errors or confusing behavior.
|
|
318
|
+
return [fileName];
|
|
319
|
+
}
|
|
320
|
+
}
|
|
321
|
+
async function guessEditor() {
|
|
322
|
+
// We can find out which editor is currently running by:
|
|
323
|
+
// `ps x` on macOS and Linux
|
|
324
|
+
// `Get-Process` on Windows
|
|
325
|
+
const availableEditors = [];
|
|
326
|
+
try {
|
|
327
|
+
if (process.platform === 'darwin') {
|
|
328
|
+
const output = (await execProm('ps x')).stdout.toString();
|
|
329
|
+
const processNames = Object.keys(COMMON_EDITORS_OSX);
|
|
330
|
+
for (let i = 0; i < processNames.length; i++) {
|
|
331
|
+
const processName = processNames[i];
|
|
332
|
+
if (output.indexOf(processName) !== -1) {
|
|
333
|
+
availableEditors.push(COMMON_EDITORS_OSX[processName]);
|
|
334
|
+
}
|
|
335
|
+
}
|
|
336
|
+
return availableEditors;
|
|
337
|
+
}
|
|
338
|
+
if (process.platform === 'win32') {
|
|
339
|
+
// Some processes need elevated rights to get its executable path.
|
|
340
|
+
// Just filter them out upfront. This also saves 10-20ms on the command.
|
|
341
|
+
const output = (await execProm('wmic process where "executablepath is not null" get executablepath')).stdout.toString();
|
|
342
|
+
const runningProcesses = output.split('\r\n');
|
|
343
|
+
for (let i = 0; i < runningProcesses.length; i++) {
|
|
344
|
+
const processPath = runningProcesses[i].trim();
|
|
345
|
+
const processName = path_1.default.basename(processPath);
|
|
346
|
+
if (COMMON_EDITORS_WIN.indexOf(processName) !== -1) {
|
|
347
|
+
availableEditors.push(processPath);
|
|
348
|
+
}
|
|
349
|
+
}
|
|
350
|
+
return availableEditors;
|
|
351
|
+
}
|
|
352
|
+
if (process.platform === 'linux') {
|
|
353
|
+
// --no-heading No header line
|
|
354
|
+
// x List all processes owned by you
|
|
355
|
+
// -o comm Need only names column
|
|
356
|
+
const output = (await execProm('ps x --no-heading -o comm --sort=comm')).stdout.toString();
|
|
357
|
+
const processNames = Object.keys(COMMON_EDITORS_LINUX);
|
|
358
|
+
for (let i = 0; i < processNames.length; i++) {
|
|
359
|
+
const processName = processNames[i];
|
|
360
|
+
if (output.indexOf(processName) !== -1) {
|
|
361
|
+
availableEditors.push(COMMON_EDITORS_LINUX[processName]);
|
|
362
|
+
}
|
|
363
|
+
}
|
|
364
|
+
return availableEditors;
|
|
365
|
+
}
|
|
366
|
+
}
|
|
367
|
+
catch (error) {
|
|
368
|
+
// Ignore...
|
|
369
|
+
}
|
|
370
|
+
// Last resort, use old skool env vars
|
|
371
|
+
if (process.env.VISUAL) {
|
|
372
|
+
return [process.env.VISUAL];
|
|
373
|
+
}
|
|
374
|
+
if (process.env.EDITOR) {
|
|
375
|
+
return [process.env.EDITOR];
|
|
376
|
+
}
|
|
377
|
+
return [];
|
|
378
|
+
}
|
|
379
|
+
exports.guessEditor = guessEditor;
|
|
380
|
+
let _childProcess = null;
|
|
381
|
+
function launchEditor({ colNumber, editor, fileName, lineNumber, vsCodeNewWindow, }) {
|
|
382
|
+
if (!fs_1.default.existsSync(fileName)) {
|
|
383
|
+
return Promise.resolve(false);
|
|
384
|
+
}
|
|
385
|
+
// Sanitize lineNumber to prevent malicious use on win32
|
|
386
|
+
// via: https://github.com/nodejs/node/blob/c3bb4b1aa5e907d489619fb43d233c3336bfc03d/lib/child_process.js#L333
|
|
387
|
+
// and it should be a positive integer
|
|
388
|
+
if (!(Number.isInteger(lineNumber) && lineNumber > 0)) {
|
|
389
|
+
return Promise.resolve(false);
|
|
390
|
+
}
|
|
391
|
+
// colNumber is optional, but should be a positive integer too
|
|
392
|
+
// default is 1
|
|
393
|
+
if (!(Number.isInteger(colNumber) && colNumber > 0)) {
|
|
394
|
+
colNumber = 1;
|
|
395
|
+
}
|
|
396
|
+
if (editor.toLowerCase() === 'none') {
|
|
397
|
+
return Promise.resolve(false);
|
|
398
|
+
}
|
|
399
|
+
if (process.platform === 'linux' &&
|
|
400
|
+
fileName.startsWith('/mnt/') &&
|
|
401
|
+
/Microsoft/i.test(os_1.default.release())) {
|
|
402
|
+
// Assume WSL / "Bash on Ubuntu on Windows" is being used, and
|
|
403
|
+
// that the file exists on the Windows file system.
|
|
404
|
+
// `os.release()` is "4.4.0-43-Microsoft" in the current release
|
|
405
|
+
// build of WSL, see: https://github.com/Microsoft/BashOnWindows/issues/423#issuecomment-221627364
|
|
406
|
+
// When a Windows editor is specified, interop functionality can
|
|
407
|
+
// handle the path translation, but only if a relative path is used.
|
|
408
|
+
fileName = path_1.default.relative('', fileName);
|
|
409
|
+
}
|
|
410
|
+
// cmd.exe on Windows is vulnerable to RCE attacks given a file name of the
|
|
411
|
+
// form "C:\Users\myusername\Downloads\& curl 172.21.93.52". Use a whitelist
|
|
412
|
+
// to validate user-provided file names. This doesn't cover the entire range
|
|
413
|
+
// of valid file names but should cover almost all of them in practice.
|
|
414
|
+
if (process.platform === 'win32' &&
|
|
415
|
+
!WINDOWS_FILE_NAME_WHITELIST.test(fileName.trim())) {
|
|
416
|
+
log_1.Log.error();
|
|
417
|
+
log_1.Log.error('Could not open ' + path_1.default.basename(fileName) + ' in the editor.');
|
|
418
|
+
log_1.Log.error();
|
|
419
|
+
log_1.Log.error('When running on Windows, file names are checked against a whitelist ' +
|
|
420
|
+
'to protect against remote code execution attacks. File names may ' +
|
|
421
|
+
'consist only of alphanumeric characters (all languages), periods, ' +
|
|
422
|
+
'dashes, slashes, and underscores.');
|
|
423
|
+
log_1.Log.error();
|
|
424
|
+
return Promise.resolve(false);
|
|
425
|
+
}
|
|
426
|
+
const shouldOpenVsCodeNewWindow = isVsCodeDerivative(editor) && vsCodeNewWindow;
|
|
427
|
+
const args = shouldOpenVsCodeNewWindow
|
|
428
|
+
? ['--new-window', fileName]
|
|
429
|
+
: lineNumber
|
|
430
|
+
? getArgumentsForLineNumber(editor, fileName, String(lineNumber), colNumber)
|
|
431
|
+
: [fileName];
|
|
432
|
+
if (_childProcess && isTerminalEditor(editor)) {
|
|
433
|
+
// There's an existing editor process already and it's attached
|
|
434
|
+
// to the terminal, so go kill it. Otherwise two separate editor
|
|
435
|
+
// instances attach to the stdin/stdout which gets confusing.
|
|
436
|
+
_childProcess.kill('SIGKILL');
|
|
437
|
+
}
|
|
438
|
+
if (process.platform === 'win32') {
|
|
439
|
+
// On Windows, launch the editor in a shell because spawn can only
|
|
440
|
+
// launch .exe files.
|
|
441
|
+
_childProcess = child_process_1.default.spawn('cmd.exe', ['/C', editor].concat(args), { stdio: 'inherit' });
|
|
442
|
+
}
|
|
443
|
+
else {
|
|
444
|
+
_childProcess = child_process_1.default.spawn(editor, args, {
|
|
445
|
+
stdio: 'inherit',
|
|
446
|
+
detached: true,
|
|
447
|
+
});
|
|
448
|
+
}
|
|
449
|
+
_childProcess.on('exit', (errorCode) => {
|
|
450
|
+
_childProcess = null;
|
|
451
|
+
if (errorCode) {
|
|
452
|
+
log_1.Log.error(`Process exited with code ${errorCode}`);
|
|
453
|
+
}
|
|
454
|
+
});
|
|
455
|
+
_childProcess.on('error', (error) => {
|
|
456
|
+
log_1.Log.error('Error opening file in editor', fileName, error.message);
|
|
457
|
+
});
|
|
458
|
+
return Promise.resolve(true);
|
|
459
|
+
}
|
|
460
|
+
exports.launchEditor = launchEditor;
|
|
@@ -0,0 +1,117 @@
|
|
|
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.parseError = 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 map_error_to_react_stack_1 = require("../effects/map-error-to-react-stack");
|
|
14
|
+
const resolve_file_source_1 = require("../effects/resolve-file-source");
|
|
15
|
+
const stack_frame_1 = require("./stack-frame");
|
|
16
|
+
const regexExtractLocation = /\(?(.+?)(?::(\d+))?(?::(\d+))?\)?$/;
|
|
17
|
+
function extractLocation(token) {
|
|
18
|
+
const execed = regexExtractLocation.exec(token);
|
|
19
|
+
if (!execed) {
|
|
20
|
+
throw new Error('Could not match in extractLocation');
|
|
21
|
+
}
|
|
22
|
+
return execed.slice(1).map((v) => {
|
|
23
|
+
const p = Number(v);
|
|
24
|
+
if (!isNaN(p)) {
|
|
25
|
+
return p;
|
|
26
|
+
}
|
|
27
|
+
return v;
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
const regexValidFrame_Chrome = /^\s*(at|in)\s.+(:\d+)/;
|
|
31
|
+
const regexValidFrame_FireFox = /(^|@)\S+:\d+|.+line\s+\d+\s+>\s+(eval|Function).+/;
|
|
32
|
+
function parseStack(stack) {
|
|
33
|
+
const frames = stack
|
|
34
|
+
.filter((e) => regexValidFrame_Chrome.test(e) || regexValidFrame_FireFox.test(e))
|
|
35
|
+
.map((e) => {
|
|
36
|
+
if (regexValidFrame_FireFox.test(e)) {
|
|
37
|
+
// Strip eval, we don't care about it
|
|
38
|
+
let isEval = false;
|
|
39
|
+
if (/ > (eval|Function)/.test(e)) {
|
|
40
|
+
e = e.replace(/ line (\d+)(?: > eval line \d+)* > (eval|Function):\d+:\d+/g, ':$1');
|
|
41
|
+
isEval = true;
|
|
42
|
+
}
|
|
43
|
+
const _data = e.split(/[@]/g);
|
|
44
|
+
const _last = _data.pop();
|
|
45
|
+
if (!_last) {
|
|
46
|
+
throw new Error('could not get last');
|
|
47
|
+
}
|
|
48
|
+
const [_fileName, _lineNumber, _columnNumber] = extractLocation(_last);
|
|
49
|
+
return (0, stack_frame_1.makeStackFrame)({
|
|
50
|
+
functionName: _data.join('@') || (isEval ? 'eval' : null),
|
|
51
|
+
fileName: _fileName,
|
|
52
|
+
lineNumber: _lineNumber,
|
|
53
|
+
columnNumber: _columnNumber,
|
|
54
|
+
});
|
|
55
|
+
}
|
|
56
|
+
// Strip eval, we don't care about it
|
|
57
|
+
if (e.indexOf('(eval ') !== -1) {
|
|
58
|
+
e = e.replace(/(\(eval at [^()]*)|(\),.*$)/g, '');
|
|
59
|
+
}
|
|
60
|
+
if (e.indexOf('(at ') !== -1) {
|
|
61
|
+
e = e.replace(/\(at /, '(');
|
|
62
|
+
}
|
|
63
|
+
const data = e.trim().split(/\s+/g).slice(1);
|
|
64
|
+
const last = data.pop();
|
|
65
|
+
if (!last) {
|
|
66
|
+
throw new Error('could not get last');
|
|
67
|
+
}
|
|
68
|
+
const [fileName, lineNumber, columnNumber] = extractLocation(last);
|
|
69
|
+
return (0, stack_frame_1.makeStackFrame)({
|
|
70
|
+
functionName: data.join(' ') || null,
|
|
71
|
+
fileName,
|
|
72
|
+
lineNumber,
|
|
73
|
+
columnNumber,
|
|
74
|
+
});
|
|
75
|
+
});
|
|
76
|
+
return frames;
|
|
77
|
+
}
|
|
78
|
+
const parseError = async (error, contextLines) => {
|
|
79
|
+
if (error === null) {
|
|
80
|
+
throw new Error('You cannot pass a null object.');
|
|
81
|
+
}
|
|
82
|
+
if (typeof error === 'string') {
|
|
83
|
+
return parseStack(error.split('\n')).map((frame) => {
|
|
84
|
+
return {
|
|
85
|
+
type: 'transpiled',
|
|
86
|
+
frame,
|
|
87
|
+
};
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
if (Array.isArray(error)) {
|
|
91
|
+
return parseStack(error).map((frame) => {
|
|
92
|
+
return {
|
|
93
|
+
type: 'transpiled',
|
|
94
|
+
frame,
|
|
95
|
+
};
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
const errorLocation = (0, map_error_to_react_stack_1.getLocationFromBuildError)(error);
|
|
99
|
+
if (errorLocation) {
|
|
100
|
+
return [
|
|
101
|
+
{
|
|
102
|
+
type: 'symbolicated',
|
|
103
|
+
frame: await (0, resolve_file_source_1.resolveFileSource)(errorLocation, contextLines),
|
|
104
|
+
},
|
|
105
|
+
];
|
|
106
|
+
}
|
|
107
|
+
if (typeof error.stack === 'string') {
|
|
108
|
+
return parseStack(error.stack.split('\n')).map((frame) => {
|
|
109
|
+
return {
|
|
110
|
+
type: 'transpiled',
|
|
111
|
+
frame,
|
|
112
|
+
};
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
return [];
|
|
116
|
+
};
|
|
117
|
+
exports.parseError = parseError;
|
|
@@ -0,0 +1,40 @@
|
|
|
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
|
+
export declare type ScriptLine = {
|
|
8
|
+
lineNumber: number;
|
|
9
|
+
content: string;
|
|
10
|
+
highlight: boolean;
|
|
11
|
+
};
|
|
12
|
+
export declare type SymbolicatedStackFrame = {
|
|
13
|
+
originalFunctionName: string | null;
|
|
14
|
+
originalFileName: string | null;
|
|
15
|
+
originalLineNumber: number | null;
|
|
16
|
+
originalColumnNumber: number | null;
|
|
17
|
+
originalScriptCode: ScriptLine[] | null;
|
|
18
|
+
};
|
|
19
|
+
export declare type StackFrame = {
|
|
20
|
+
functionName: string | null;
|
|
21
|
+
fileName: string;
|
|
22
|
+
lineNumber: number;
|
|
23
|
+
columnNumber: number;
|
|
24
|
+
};
|
|
25
|
+
export declare type SomeStackFrame = {
|
|
26
|
+
type: 'symbolicated';
|
|
27
|
+
frame: SymbolicatedStackFrame;
|
|
28
|
+
} | {
|
|
29
|
+
type: 'transpiled';
|
|
30
|
+
frame: StackFrame;
|
|
31
|
+
};
|
|
32
|
+
/**
|
|
33
|
+
* A representation of a stack frame.
|
|
34
|
+
*/
|
|
35
|
+
export declare const makeStackFrame: ({ functionName, fileName, lineNumber, columnNumber, }: {
|
|
36
|
+
functionName: string | null;
|
|
37
|
+
fileName: string;
|
|
38
|
+
lineNumber: number;
|
|
39
|
+
columnNumber: number;
|
|
40
|
+
}) => StackFrame;
|
|
@@ -0,0 +1,31 @@
|
|
|
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.makeStackFrame = void 0;
|
|
7
|
+
/**
|
|
8
|
+
* A representation of a stack frame.
|
|
9
|
+
*/
|
|
10
|
+
const makeStackFrame = ({ functionName, fileName, lineNumber, columnNumber, }) => {
|
|
11
|
+
if (functionName && functionName.indexOf('Object.') === 0) {
|
|
12
|
+
functionName = functionName.slice('Object.'.length);
|
|
13
|
+
}
|
|
14
|
+
if (
|
|
15
|
+
// Chrome has a bug with inferring function.name:
|
|
16
|
+
// https://github.com/facebook/create-react-app/issues/2097
|
|
17
|
+
// Let's ignore a meaningless name we get for top-level modules.
|
|
18
|
+
functionName === 'friendlySyntaxErrorLabel' ||
|
|
19
|
+
functionName === 'exports.__esModule' ||
|
|
20
|
+
functionName === '<anonymous>' ||
|
|
21
|
+
!functionName) {
|
|
22
|
+
functionName = null;
|
|
23
|
+
}
|
|
24
|
+
return {
|
|
25
|
+
columnNumber,
|
|
26
|
+
fileName,
|
|
27
|
+
functionName,
|
|
28
|
+
lineNumber,
|
|
29
|
+
};
|
|
30
|
+
};
|
|
31
|
+
exports.makeStackFrame = makeStackFrame;
|