amis-rpc-design/node_modules/@react-native-community/cli-tools/build/launchEditor.js.map

1 line
27 KiB
Plaintext
Raw Normal View History

2023-10-07 19:42:30 +08:00
{"version":3,"names":["isTerminalEditor","editor","COMMON_EDITORS","COMMON_WINDOWS_EDITORS","WINDOWS_FILE_NAME_WHITELIST","addWorkspaceToArgumentsIfExists","args","workspace","unshift","getArgumentsForLineNumber","fileName","lineNumber","path","basename","String","getArgumentsForFileName","guessEditor","process","env","REACT_EDITOR","shellQuote","parse","platform","output","execSync","toString","processNames","Object","keys","processName","indexOf","runningProcesses","split","map","line","replace","includes","error","VISUAL","EDITOR","printInstructions","title","WINDOWS_FIXIT_INSTRUCTIONS","FIXIT_INSTRUCTIONS","logger","info","chalk","bgBlue","white","bold","join","transformToAbsolutePathIfNeeded","pathName","isAbsolute","resolve","cwd","findRootForFile","projectRoots","absoluteFileName","find","root","absoluteRoot","startsWith","sep","editorWindowsLaunchPath","fs","existsSync","stdio","editorNames","values","editorImageNames","i","length","editorName","toLowerCase","results","pid","parseInt","trim","_childProcess","launchEditor","isNaN","concat","test","underline","kill","spawn","on","errorCode","message"],"sources":["../src/launchEditor.ts"],"sourcesContent":["/**\n * Copyright (c) Facebook, Inc. and its affiliates.\n *\n * This source code is licensed under the MIT license found in the\n * LICENSE file in the root directory of this source tree.\n *\n * @format\n */\n\nimport chalk from 'chalk';\nimport fs from 'fs';\nimport path from 'path';\nimport {execSync, spawn, ChildProcess} from 'child_process';\nimport shellQuote from 'shell-quote';\nimport logger from './logger';\n\nfunction isTerminalEditor(editor: string) {\n switch (editor) {\n case 'vim':\n case 'emacs':\n case 'nano':\n return true;\n default:\n return false;\n }\n}\n\n// Map from full process name to binary that starts the process\n// We can't just re-use full process name, because it will spawn a new instance\n// of the app every time\nconst COMMON_EDITORS: Record<string, string> = {\n '/Applications/Atom.app/Contents/MacOS/Atom': 'atom',\n '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta':\n '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta',\n '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea': 'idea',\n '/Applications/Sublime Text.app/Contents/MacOS/Sublime Text':\n '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',\n '/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2':\n '/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl',\n '/Applications/Visual Studio Code.app/Contents/MacOS/Electron': 'code',\n '/Applications/WebStorm.app/Contents/MacOS/webstorm': 'webstorm',\n};\n\n// Map of process image name used to identify already running instances of the editor\n// And an editor id which is used to determine which arguments to add to the commandline\nconst COMMON_WINDOWS_EDITORS: Record<string, string> = {\n 'Code.exe': 'code',\n 'sublime_text.exe': 'subl',\n 'devenv.exe': 'devenv',\n 'notepad.exe': 'notepad',\n};\n\n// Transpiled version of: /^([a-zA-Z]+:)?[\\p{L}0-9@/.\\-_\\\\]+$/u\n// Non-transpiled version requires support for Unicode property regex. Allows\n// alphanumeric characters, periods, dashes, at signs, slashes, and underscores, with an optional drive prefix\nconst WINDOWS_FILE_NAME_WHITELIST = /^([a-zA-Z]+:)?(?:[\\x2D-9@-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\\u