launch-ide
Advanced tools
+1
-1
@@ -1,1 +0,1 @@ | ||
| "use strict";var F=Object.defineProperty,H=Object.defineProperties;var X=Object.getOwnPropertyDescriptors;var B=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var A=(t,e,n)=>e in t?F(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,g=(t,e)=>{for(var n in e||(e={}))q.call(e,n)&&A(t,n,e[n]);if(B)for(var n of B(e))Q.call(e,n)&&A(t,n,e[n]);return t},I=(t,e)=>H(t,X(e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("fs"),w=require("path"),v=require("child_process"),j=require("os"),l=require("chalk"),J=require("dotenv"),U={"/Kiro.app/Contents/MacOS/Electron":"/Kiro.app/Contents/MacOS/Electron","/Antigravity.app/Contents/MacOS/Electron":"/Antigravity.app/Contents/MacOS/Electron","/Cursor.app/Contents/MacOS/Cursor":"/Cursor.app/Contents/MacOS/Cursor","/Comate.app/Contents/MacOS/Electron":"/Comate.app/Contents/MacOS/Electron","/Qoder.app/Contents/MacOS/Electron":"/Qoder.app/Contents/MacOS/Electron","/Qoder CN.app/Contents/MacOS/Electron":"/Qoder CN.app/Contents/MacOS/Electron","/Windsurf.app/Contents/MacOS/Electron":"/Windsurf.app/Contents/MacOS/Electron","/Trae.app/Contents/MacOS/Electron":"/Trae.app/Contents/MacOS/Electron","/Trae CN.app/Contents/MacOS/Electron":"/Trae CN.app/Contents/MacOS/Electron","/Applications/CodeBuddy.app/Contents/MacOS/Electron":"/Applications/CodeBuddy.app/Contents/MacOS/Electron","/Applications/CodeBuddy CN.app/Contents/MacOS/Electron":"/Applications/CodeBuddy CN.app/Contents/MacOS/Electron","/Visual Studio Code.app/Contents/MacOS/Electron":"/Visual Studio Code.app/Contents/MacOS/Electron","/Visual Studio Code.app/Contents/MacOS/Code":"/Visual Studio Code.app/Contents/MacOS/Code","/Visual Studio Code - Insiders.app/Contents/MacOS/Electron":"/Visual Studio Code - Insiders.app/Contents/MacOS/Electron","/VSCodium.app/Contents/MacOS/Electron":"/VSCodium.app/Contents/MacOS/Electron","/WebStorm.app/Contents/MacOS/webstorm":"/WebStorm.app/Contents/MacOS/webstorm","/HBuilderX.app/Contents/MacOS/HBuilderX":"/HBuilderX.app/Contents/MacOS/HBuilderX","/Atom.app/Contents/MacOS/Atom":"atom","/Atom Beta.app/Contents/MacOS/Atom Beta":"/Atom Beta.app/Contents/MacOS/Atom Beta","/Brackets.app/Contents/MacOS/Brackets":"brackets","/Sublime Text.app/Contents/MacOS/Sublime Text":"/Sublime Text.app/Contents/SharedSupport/bin/subl","/Sublime Text.app/Contents/MacOS/sublime_text":"/Sublime Text.app/Contents/SharedSupport/bin/subl","/Sublime Text 2.app/Contents/MacOS/Sublime Text 2":"/Sublime Text 2.app/Contents/SharedSupport/bin/subl","/Sublime Text Dev.app/Contents/MacOS/Sublime Text":"/Sublime Text Dev.app/Contents/SharedSupport/bin/subl","/PhpStorm.app/Contents/MacOS/phpstorm":"/PhpStorm.app/Contents/MacOS/phpstorm","/PyCharm.app/Contents/MacOS/pycharm":"/PyCharm.app/Contents/MacOS/pycharm","/PyCharm CE.app/Contents/MacOS/pycharm":"/PyCharm CE.app/Contents/MacOS/pycharm","/IntelliJ IDEA.app/Contents/MacOS/idea":"/IntelliJ IDEA.app/Contents/MacOS/idea","/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea":"/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea","/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea":"/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea","/Zed.app/Contents/MacOS/zed":"zed","/GoLand.app/Contents/MacOS/goland":"/GoLand.app/Contents/MacOS/goland","/AppCode.app/Contents/MacOS/appcode":"/AppCode.app/Contents/MacOS/appcode","/CLion.app/Contents/MacOS/clion":"/CLion.app/Contents/MacOS/clion","/RubyMine.app/Contents/MacOS/rubymine":"/RubyMine.app/Contents/MacOS/rubymine","/MacVim.app/Contents/MacOS/MacVim":"mvim","/Rider.app/Contents/MacOS/rider":"/Rider.app/Contents/MacOS/rider"},z={kiro:["/Kiro.app/Contents/MacOS/Electron"],cursor:["/Cursor.app/Contents/MacOS/Cursor"],comate:["/Comate.app/Contents/MacOS/Electron"],qoder:["/Qoder.app/Contents/MacOS/Electron","/Qoder CN.app/Contents/MacOS/Electron"],windsurf:["/Windsurf.app/Contents/MacOS/Electron"],trae:["/Trae.app/Contents/MacOS/Electron","/Trae CN.app/Contents/MacOS/Electron"],codebuddy:["/Applications/CodeBuddy.app/Contents/MacOS/Electron","/Applications/CodeBuddy CN.app/Contents/MacOS/Electron"],antigravity:["Antigravity.app/Contents/MacOS/Electron"],code:["/Visual Studio Code.app/Contents/MacOS/Electron","/Visual Studio Code.app/Contents/MacOS/Code"],"code-insiders":["/Visual Studio Code - Insiders.app/Contents/MacOS/Electron"],webstorm:["/WebStorm.app/Contents/MacOS/webstorm"],atom:["/Atom.app/Contents/MacOS/Atom"],hbuilder:["/HBuilderX.app/Contents/MacOS/HBuilderX"],phpstorm:["/PhpStorm.app/Contents/MacOS/phpstorm"],pycharm:["/PyCharm.app/Contents/MacOS/pycharm"],idea:["/IntelliJ IDEA.app/Contents/MacOS/idea"],codium:["/VSCodium.app/Contents/MacOS/Electron"],goland:["/GoLand.app/Contents/MacOS/goland"],colin:["/CLion.app/Contents/MacOS/clion"],appcode:["/AppCode.app/Contents/MacOS/appcode"],"atom-beta":["/Atom Beta.app/Contents/MacOS/Atom Beta"],brackets:["/Brackets.app/Contents/MacOS/Brackets"],rider:["/Rider.app/Contents/MacOS/rider"],rubymine:["/RubyMine.app/Contents/MacOS/rubymine"],sublime:["/Sublime Text.app/Contents/MacOS/sublime_text"],zed:["/Zed.app/Contents/MacOS/zed"]},D={kiro:"kiro",cursor:"cursor",comate:"comate",qoder:"qoder",windsurf:"windsurf",trae:"trae",codebuddy:"codebuddy",antigravity:"antigravity",code:"vscode",codium:"vscodium"},K={kiro:"kiro",antigravity:"antigravity",cursor:"cursor",windsurf:"windsurf",code:"code",vscodium:"vscodium",codium:"codium",webstorm:"webstorm","webstorm.sh":"webstorm",hbuilderx:"hbuilderx","hbuilderx.sh":"hbuilderx",atom:"atom",Brackets:"brackets","code-insiders":"code-insiders",emacs:"emacs",gvim:"gvim",idea:"idea","idea.sh":"idea",phpstorm:"phpstorm","phpstorm.sh":"phpstorm",pycharm:"pycharm","pycharm.sh":"pycharm",rubymine:"rubymine","rubymine.sh":"rubymine",sublime_text:"subl",vim:"vim",goland:"goland","goland.sh":"goland",rider:"rider","rider.sh":"rider"},G={kiro:["kiro"],antigravity:["antigravity"],code:["code"],"code-insiders":["code-insiders"],webstorm:["webstorm","webstorm.sh"],cursor:["cursor"],windsurf:["windsurf"],trae:["trae"],comate:["comate"],qoder:["qoder"],codebuddy:["codebuddy"],atom:["atom"],hbuilder:["hbuilderx","hbuilderx.sh"],phpstorm:["phpstorm","phpstorm.sh"],pycharm:["pycharm","pycharm.sh"],idea:["idea","idea.sh"],codium:["vscodium"],goland:["goland"],brackets:["Brackets"],rider:["rider"],rubymine:["rubymine","rubymine.sh"],sublime:["sublime_text"],vim:["vim"],emacs:["emacs"]},Z={"Kiro.exe":"","Antigravity.exe":"","Cursor.exe":"","Windsurf.exe":"","Trae.exe":"","Trae CN.exe":"","comate.exe":"","Qoder.exe":"","Qoder CN.exe":"","CodeBuddy.exe":"","CodeBuddy CN.exe":"","Code.exe":"","Code - Insiders.exe":"","VSCodium.exe":"","webstorm.exe":"","webstorm64.exe":"","HBuilderX.exe":"","HBuilderX64.exe":"","HBuilder.exe":"","HBuilder64.exe":"","Brackets.exe":"","atom.exe":"","sublime_text.exe":"","notepad++.exe":"","clion.exe":"","clion64.exe":"","idea.exe":"","idea64.exe":"","phpstorm.exe":"","phpstorm64.exe":"","pycharm.exe":"","pycharm64.exe":"","rubymine.exe":"","rubymine64.exe":"","goland.exe":"","goland64.exe":"","rider.exe":"","rider64.exe":""},Y={kiro:["Kiro.exe"],antigravity:["Antigravity.exe"],code:["Code.exe"],"code-insiders":["Code - Insiders.exe"],webstorm:["webstorm.exe","webstorm64.exe"],cursor:["Cursor.exe"],windsurf:["Windsurf.exe"],trae:["Trae.exe","Trae CN.exe"],comate:["comate.exe"],qoder:["Qoder.exe","Qoder CN.exe"],codebuddy:["CodeBuddy.exe","CodeBuddy CN.exe"],atom:["atom.exe"],hbuilder:["HBuilderX.exe","HBuilder.exe","HBuilderX64.exe","HBuilder64.exe"],phpstorm:["phpstorm.exe","phpstorm64.exe"],pycharm:["pycharm.exe","pycharm64.exe"],idea:["idea.exe","idea64.exe"],codium:["VSCodium.exe"],goland:["goland.exe","goland64.exe"],colin:["clion.exe","clion64.exe"],brackets:["Brackets.exe"],rider:["rider.exe","rider64.exe"],rubymine:["rubymine.exe","rubymine64.exe"],sublime:["sublime_text.exe"],notepad:["notepad++.exe"]},$={darwin:U,linux:K,win32:Z},_={darwin:z,linux:G,win32:Y},u="{file}",m="{line}",E="{column}";function L(t,e,n,o){let a="".concat(t,":").concat(e,":").concat(n);if(typeof o=="string")a=o.replace(u,t).replace(m,e.toString()).replace(E,n.toString());else if(o instanceof Array)return o.map(r=>r.replace(u,t).replace(m,e.toString()).replace(E,n.toString()));return[a]}const ee=["-g","-r","{file}:{line}:{column}"];function te(t){const{editorBasename:e,fileName:n,lineNumber:o,colNumber:a,workspace:r,openWindowParams:i,pathFormat:c}=t,b=oe({editorBasename:e,openWindowParams:i,workspace:r})||ee;return L(n,o,a,c||b)}function ne(t){let e=w.basename(t).replace(/\.(exe|cmd|bat|sh)$/i,"");const n=process.platform,o=Object.keys(_[n]);for(let a=0;a<o.length;a++)if((_[n][o[a]]||[]).some(i=>t.endsWith(i))){e=o[a];break}return e.toLowerCase()}function oe(t){const{editorBasename:e,openWindowParams:n,workspace:o}=t;switch(e){case"atom":case"atom beta":case"subl":case"sublime":case"sublime_text":case"wstorm":case"charm":case"zed":return"".concat(u,":").concat(m,":").concat(E);case"notepad++":return["-n"+m,"-c"+E,u];case"vim":case"mvim":return["+call cursor(".concat(m,", ").concat(E,")"),u];case"joe":case"gvim":return["+"+m,u];case"emacs":case"emacsclient":return["+"+m+":"+E,u];case"rmate":case"mate":case"mine":return["--line",m,u];case"code":case"code-insiders":case"code - insiders":case"codium":case"cursor":case"windsurf":case"trae":case"codebuddy":case"antigravity":case"comate":case"qoder":case"vscodium":case"hbuilderx":case"hbuilder":case"kiro":return[...o?[o]:[],"-g",...n?[n]:[],"".concat(u,":").concat(m,":").concat(E)];case"appcode":case"clion":case"clion64":case"idea":case"idea64":case"phpstorm":case"phpstorm64":case"pycharm":case"pycharm64":case"rubymine":case"rubymine64":case"webstorm":case"webstorm64":case"goland":case"goland64":case"rider":case"rider64":return[...o?[o]:[],"--line",m,u]}return""}function V(t){let e={};process.env&&(e=g({},process.env));let n="";if(t){const o=w.resolve(t,".env.local");T.existsSync(o)&&(n=o)}if(!n){const o=w.resolve(process.cwd(),".env.local");T.existsSync(o)&&(n=o)}if(n){const o=T.readFileSync(n,"utf-8"),a=J.parse(o||"");e=g(g({},a),e)}return e}function N(t,e){return V(e)[t]||null}const re={darwin:"ps ax -o comm=",linux:"ps -eo comm --sort=comm",win32:'powershell -NoProfile -Command "Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"'};function ae(t,e,n){let o=null;const a=N("CODE_EDITOR",e||"");if(a){const r=k(a);if(r)o=r;else return[a]}if(!o&&t){const r=k(t);r&&(o=r)}if(!o&&n){const r=se();if(r)return[r]}try{let r;const i=process.platform,c=process.platform==="win32",h=re[i],b=$[i];W(c);const P=v.execSync(h,{encoding:"utf-8"}),C=Object.keys(b),S=P.split(c?"\r\n":"\n").map(x=>x.trim());for(let x=0;x<C.length;x++){const p=C[x];let s="",M="";if(c){const O=S.find(y=>w.basename(y).toLowerCase()===p.toLowerCase());O&&(M=w.basename(O),s=O)}else if(i==="darwin"){const O=S.find(y=>y.toLowerCase().endsWith(p.toLowerCase()));if(O){const y=O.replace(p,""),d=b[p];M=p,d.includes("/")?s="".concat(y).concat(d):s=d}}else P.indexOf(p)!==-1&&(M=p,s=b[p]);if(M&&s){if(o!=null&&o.includes(M))return[s];r||(r=[s])}}if(r)return r}catch(r){}return process.env.VISUAL?[process.env.VISUAL]:process.env.EDITOR?[process.env.EDITOR]:[null]}const k=t=>{const e=process.platform;return _[e]&&_[e][t]||null},W=t=>{if(t)try{v.execSync("chcp 65001")}catch(e){}};function se(){const t=process.platform,e=Object.keys($[t]);try{return ce(process.pid,t,e)}catch(n){return console.log(l.red("Error while getting editor by PID:"),n),null}}function ce(t,e,n){let o=0;const a=50,r=0;for(;t&&t!==r&&o<a;){const i=ie(t,e);if(!i)break;const{command:c,parentPid:h}=i;if(ue(c,n))return c;t=h,o++}return null}function ie(t,e){switch(e){case"darwin":case"linux":return pe(t);case"win32":return de(t);default:return null}}function pe(t){try{const n=v.execSync("ps -p ".concat(t," -o ppid=,comm="),{encoding:"utf8"}).trim().split("\n");return n.length?le(n[0].trim()):null}catch(e){return null}}function de(t){try{W(!0);const e='powershell -NoProfile -Command "Get-CimInstance -ClassName Win32_Process -Filter "ProcessId='.concat(t,'" | Select-Object ParentProcessId, ExecutablePath | ConvertTo-Csv -NoTypeInformation'),o=v.execSync(e,{encoding:"utf8"}).trim().split("\r\n").filter(i=>i.trim()).slice(1);if(o.length===0)return null;const[a,r]=o[0].split(",");return!r||!a?null:{command:r.slice(1,-1),parentPid:Number(a.slice(1,-1))}}catch(e){return null}}function le(t){const e=t.match(/^(\d+)\s+(.+)$/);return e?{command:e[2],parentPid:parseInt(e[1])}:null}function ue(t,e){return e.some(n=>t.toLowerCase().endsWith(n.toLowerCase()))}function me(t){switch(t){case"vim":case"emacs":case"nano":return!0}return!1}function Ce(t){const e=N("CODE_INSPECTOR_FORMAT_PATH",t);if(e)try{return JSON.parse(e)}catch(n){return null}return null}function R(t,e){console.log(l.red("Could not open "+w.basename(t)+" in the editor.")),e&&(e[e.length-1]!=="."&&(e+="."),console.log(l.red("The editor process exited with an error: "+e))),console.log("To set up the editor integration, add something like "+l.cyan("CODE_EDITOR=code")+" to the "+l.green(".env.local")+" file in your project folder, or add "+l.green('editor: "code"')+" to CodeInspectorPlugin config, and then restart the development server. Learn more: "+l.green("https://goo.gl/MMTaZt"))}let f=null;function Se(t){return t==="reuse"?"-r":t==="new"?"-n":""}function Oe(t){let{file:e,line:n=1,column:o=1,editor:a,method:r,format:i,onError:c,rootDir:h,usePid:b,type:P="exec"}=t;if(!T.existsSync(e))return;let[C,...S]=ae(a,h,b);const x=Ce(h||"")||i;if(!C||C.toLowerCase()==="none"){typeof c=="function"?c(e,"Failed to recognize IDE automatically"):console.log("Failed to recognize IDE automatically, add something like "+l.cyan("CODE_EDITOR=code")+" to the "+l.green(".env.local")+" file in your project folder, or add "+l.green('editor: "code"')+" to CodeInspectorPlugin config, and then restart the development server. Learn more: "+l.green("https://goo.gl/MMTaZt"));return}const p=ne(C);if(P==="open"&&process.platform==="darwin"&&D[p])f=v.spawn("open",["".concat(D[p],"://file").concat(e,":").concat(n,":").concat(o)],{stdio:"ignore",env:I(g({},process.env),{NODE_OPTIONS:""})});else{process.platform==="linux"&&e.startsWith("/mnt/")&&/Microsoft/i.test(j.release())&&(e=w.relative("",e));let s=null;if(n?S=S.concat(te({editorBasename:p,fileName:e,lineNumber:n,colNumber:o,workspace:s,openWindowParams:Se(r),pathFormat:x})):S.push(e),f&&me(C)&&f.kill("SIGKILL"),process.platform==="win32"){const M=d=>d.replace(/([&|<>,;=^])/g,"^$1"),O=d=>d.includes("^")?'^"'.concat(d,'^"'):d.includes(" ")?'"'.concat(d,'"'):d,y=[C,...S.map(M)].map(O).join(" ");f=v.exec(y,{stdio:"ignore",shell:!0,env:I(g({},process.env),{NODE_OPTIONS:""})})}else f=v.spawn(C,S,{stdio:"ignore",env:I(g({},process.env),{NODE_OPTIONS:""})})}f.on("exit",function(s){f=null,s&&(typeof c=="function"?c(e,"(code "+s+")"):R(e,"(code "+s+")"))}),f.on("error",function(s){typeof c=="function"?c(e,s.message):R(e,s.message)})}exports.formatOpenPath=L;exports.getEnvVariable=N;exports.getEnvVariables=V;exports.launchIDE=Oe; | ||
| "use strict";var F=Object.defineProperty,H=Object.defineProperties;var X=Object.getOwnPropertyDescriptors;var B=Object.getOwnPropertySymbols;var q=Object.prototype.hasOwnProperty,Q=Object.prototype.propertyIsEnumerable;var A=(t,e,n)=>e in t?F(t,e,{enumerable:!0,configurable:!0,writable:!0,value:n}):t[e]=n,g=(t,e)=>{for(var n in e||(e={}))q.call(e,n)&&A(t,n,e[n]);if(B)for(var n of B(e))Q.call(e,n)&&A(t,n,e[n]);return t},I=(t,e)=>H(t,X(e));Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const T=require("fs"),w=require("path"),v=require("child_process"),j=require("os"),l=require("chalk"),J=require("dotenv"),U={"/Kiro.app/Contents/MacOS/Electron":"/Kiro.app/Contents/MacOS/Electron","/Antigravity.app/Contents/MacOS/Electron":"/Antigravity.app/Contents/MacOS/Electron","/Cursor.app/Contents/MacOS/Cursor":"/Cursor.app/Contents/MacOS/Cursor","/Comate.app/Contents/MacOS/Electron":"/Comate.app/Contents/MacOS/Electron","/Qoder.app/Contents/MacOS/Electron":"/Qoder.app/Contents/MacOS/Electron","/Qoder CN.app/Contents/MacOS/Electron":"/Qoder CN.app/Contents/MacOS/Electron","/Windsurf.app/Contents/MacOS/Electron":"/Windsurf.app/Contents/MacOS/Electron","/Trae.app/Contents/MacOS/Electron":"/Trae.app/Contents/MacOS/Electron","/Trae CN.app/Contents/MacOS/Electron":"/Trae CN.app/Contents/MacOS/Electron","/Applications/CodeBuddy.app/Contents/MacOS/Electron":"/Applications/CodeBuddy.app/Contents/MacOS/Electron","/Applications/CodeBuddy CN.app/Contents/MacOS/Electron":"/Applications/CodeBuddy CN.app/Contents/MacOS/Electron","/Visual Studio Code.app/Contents/MacOS/Electron":"/Visual Studio Code.app/Contents/MacOS/Electron","/Visual Studio Code.app/Contents/MacOS/Code":"/Visual Studio Code.app/Contents/MacOS/Code","/Visual Studio Code - Insiders.app/Contents/MacOS/Electron":"/Visual Studio Code - Insiders.app/Contents/MacOS/Electron","/VSCodium.app/Contents/MacOS/Electron":"/VSCodium.app/Contents/MacOS/Electron","/WebStorm.app/Contents/MacOS/webstorm":"/WebStorm.app/Contents/MacOS/webstorm","/HBuilderX.app/Contents/MacOS/HBuilderX":"/HBuilderX.app/Contents/MacOS/HBuilderX","/Atom.app/Contents/MacOS/Atom":"atom","/Atom Beta.app/Contents/MacOS/Atom Beta":"/Atom Beta.app/Contents/MacOS/Atom Beta","/Brackets.app/Contents/MacOS/Brackets":"brackets","/Sublime Text.app/Contents/MacOS/Sublime Text":"/Sublime Text.app/Contents/SharedSupport/bin/subl","/Sublime Text.app/Contents/MacOS/sublime_text":"/Sublime Text.app/Contents/SharedSupport/bin/subl","/Sublime Text 2.app/Contents/MacOS/Sublime Text 2":"/Sublime Text 2.app/Contents/SharedSupport/bin/subl","/Sublime Text Dev.app/Contents/MacOS/Sublime Text":"/Sublime Text Dev.app/Contents/SharedSupport/bin/subl","/PhpStorm.app/Contents/MacOS/phpstorm":"/PhpStorm.app/Contents/MacOS/phpstorm","/PyCharm.app/Contents/MacOS/pycharm":"/PyCharm.app/Contents/MacOS/pycharm","/PyCharm CE.app/Contents/MacOS/pycharm":"/PyCharm CE.app/Contents/MacOS/pycharm","/IntelliJ IDEA.app/Contents/MacOS/idea":"/IntelliJ IDEA.app/Contents/MacOS/idea","/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea":"/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea","/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea":"/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea","/Zed.app/Contents/MacOS/zed":"zed","/GoLand.app/Contents/MacOS/goland":"/GoLand.app/Contents/MacOS/goland","/AppCode.app/Contents/MacOS/appcode":"/AppCode.app/Contents/MacOS/appcode","/CLion.app/Contents/MacOS/clion":"/CLion.app/Contents/MacOS/clion","/RubyMine.app/Contents/MacOS/rubymine":"/RubyMine.app/Contents/MacOS/rubymine","/MacVim.app/Contents/MacOS/MacVim":"mvim","/Rider.app/Contents/MacOS/rider":"/Rider.app/Contents/MacOS/rider"},z={kiro:["/Kiro.app/Contents/MacOS/Electron"],cursor:["/Cursor.app/Contents/MacOS/Cursor"],comate:["/Comate.app/Contents/MacOS/Electron"],qoder:["/Qoder.app/Contents/MacOS/Electron","/Qoder CN.app/Contents/MacOS/Electron"],windsurf:["/Windsurf.app/Contents/MacOS/Electron"],trae:["/Trae.app/Contents/MacOS/Electron","/Trae CN.app/Contents/MacOS/Electron"],codebuddy:["/Applications/CodeBuddy.app/Contents/MacOS/Electron","/Applications/CodeBuddy CN.app/Contents/MacOS/Electron"],antigravity:["Antigravity.app/Contents/MacOS/Electron"],code:["/Visual Studio Code.app/Contents/MacOS/Electron","/Visual Studio Code.app/Contents/MacOS/Code"],"code-insiders":["/Visual Studio Code - Insiders.app/Contents/MacOS/Electron"],webstorm:["/WebStorm.app/Contents/MacOS/webstorm"],atom:["/Atom.app/Contents/MacOS/Atom"],hbuilder:["/HBuilderX.app/Contents/MacOS/HBuilderX"],phpstorm:["/PhpStorm.app/Contents/MacOS/phpstorm"],pycharm:["/PyCharm.app/Contents/MacOS/pycharm"],idea:["/IntelliJ IDEA.app/Contents/MacOS/idea"],codium:["/VSCodium.app/Contents/MacOS/Electron"],goland:["/GoLand.app/Contents/MacOS/goland"],colin:["/CLion.app/Contents/MacOS/clion"],appcode:["/AppCode.app/Contents/MacOS/appcode"],"atom-beta":["/Atom Beta.app/Contents/MacOS/Atom Beta"],brackets:["/Brackets.app/Contents/MacOS/Brackets"],rider:["/Rider.app/Contents/MacOS/rider"],rubymine:["/RubyMine.app/Contents/MacOS/rubymine"],sublime:["/Sublime Text.app/Contents/MacOS/sublime_text"],zed:["/Zed.app/Contents/MacOS/zed"]},D={kiro:"kiro",cursor:"cursor",comate:"comate",qoder:"qoder",windsurf:"windsurf",trae:"trae",codebuddy:"codebuddy",antigravity:"antigravity",code:"vscode",codium:"vscodium"},K={kiro:"kiro",antigravity:"antigravity",cursor:"cursor",windsurf:"windsurf",code:"code",vscodium:"vscodium",codium:"codium",webstorm:"webstorm","webstorm.sh":"webstorm",hbuilderx:"hbuilderx","hbuilderx.sh":"hbuilderx",atom:"atom",Brackets:"brackets","code-insiders":"code-insiders",emacs:"emacs",gvim:"gvim",idea:"idea","idea.sh":"idea",phpstorm:"phpstorm","phpstorm.sh":"phpstorm",pycharm:"pycharm","pycharm.sh":"pycharm",rubymine:"rubymine","rubymine.sh":"rubymine",sublime_text:"subl",vim:"vim",goland:"goland","goland.sh":"goland",rider:"rider","rider.sh":"rider"},G={kiro:["kiro"],antigravity:["antigravity"],code:["code"],"code-insiders":["code-insiders"],webstorm:["webstorm","webstorm.sh"],cursor:["cursor"],windsurf:["windsurf"],trae:["trae"],comate:["comate"],qoder:["qoder"],codebuddy:["codebuddy"],atom:["atom"],hbuilder:["hbuilderx","hbuilderx.sh"],phpstorm:["phpstorm","phpstorm.sh"],pycharm:["pycharm","pycharm.sh"],idea:["idea","idea.sh"],codium:["vscodium"],goland:["goland"],brackets:["Brackets"],rider:["rider"],rubymine:["rubymine","rubymine.sh"],sublime:["sublime_text"],vim:["vim"],emacs:["emacs"]},Z={"Kiro.exe":"","Antigravity.exe":"","Cursor.exe":"","Windsurf.exe":"","Trae.exe":"","Trae CN.exe":"","comate.exe":"","Qoder.exe":"","Qoder CN.exe":"","CodeBuddy.exe":"","CodeBuddy CN.exe":"","Code.exe":"","Code - Insiders.exe":"","VSCodium.exe":"","webstorm.exe":"","webstorm64.exe":"","HBuilderX.exe":"","HBuilderX64.exe":"","HBuilder.exe":"","HBuilder64.exe":"","Brackets.exe":"","atom.exe":"","sublime_text.exe":"","notepad++.exe":"","clion.exe":"","clion64.exe":"","idea.exe":"","idea64.exe":"","phpstorm.exe":"","phpstorm64.exe":"","pycharm.exe":"","pycharm64.exe":"","rubymine.exe":"","rubymine64.exe":"","goland.exe":"","goland64.exe":"","rider.exe":"","rider64.exe":""},Y={kiro:["Kiro.exe"],antigravity:["Antigravity.exe"],code:["Code.exe"],"code-insiders":["Code - Insiders.exe"],webstorm:["webstorm.exe","webstorm64.exe"],cursor:["Cursor.exe"],windsurf:["Windsurf.exe"],trae:["Trae.exe","Trae CN.exe"],comate:["comate.exe"],qoder:["Qoder.exe","Qoder CN.exe"],codebuddy:["CodeBuddy.exe","CodeBuddy CN.exe"],atom:["atom.exe"],hbuilder:["HBuilderX.exe","HBuilder.exe","HBuilderX64.exe","HBuilder64.exe"],phpstorm:["phpstorm.exe","phpstorm64.exe"],pycharm:["pycharm.exe","pycharm64.exe"],idea:["idea.exe","idea64.exe"],codium:["VSCodium.exe"],goland:["goland.exe","goland64.exe"],colin:["clion.exe","clion64.exe"],brackets:["Brackets.exe"],rider:["rider.exe","rider64.exe"],rubymine:["rubymine.exe","rubymine64.exe"],sublime:["sublime_text.exe"],notepad:["notepad++.exe"]},$={darwin:U,linux:K,win32:Z},_={darwin:z,linux:G,win32:Y},u="{file}",m="{line}",E="{column}";function L(t,e,n,o){let a="".concat(t,":").concat(e,":").concat(n);if(typeof o=="string")a=o.replace(u,t).replace(m,e.toString()).replace(E,n.toString());else if(o instanceof Array)return o.map(r=>r.replace(u,t).replace(m,e.toString()).replace(E,n.toString()));return[a]}const ee=["-g","-r","{file}:{line}:{column}"];function te(t){const{editorBasename:e,fileName:n,lineNumber:o,colNumber:a,workspace:r,openWindowParams:i,pathFormat:c}=t,x=oe({editorBasename:e,openWindowParams:i,workspace:r})||ee;return L(n,o,a,c||x)}function ne(t){let e=w.basename(t).replace(/\.(exe|cmd|bat|sh)$/i,"");const n=process.platform,o=Object.keys(_[n]);for(let a=0;a<o.length;a++)if((_[n][o[a]]||[]).some(i=>t.endsWith(i))){e=o[a];break}return e.toLowerCase()}function oe(t){const{editorBasename:e,openWindowParams:n,workspace:o}=t;switch(e){case"atom":case"atom beta":case"subl":case"sublime":case"sublime_text":case"wstorm":case"charm":case"zed":return"".concat(u,":").concat(m,":").concat(E);case"notepad++":return["-n"+m,"-c"+E,u];case"vim":case"mvim":return["+call cursor(".concat(m,", ").concat(E,")"),u];case"joe":case"gvim":return["+"+m,u];case"emacs":case"emacsclient":return["+"+m+":"+E,u];case"rmate":case"mate":case"mine":return["--line",m,u];case"code":case"code-insiders":case"code - insiders":case"codium":case"cursor":case"windsurf":case"trae":case"codebuddy":case"antigravity":case"comate":case"qoder":case"vscodium":case"hbuilderx":case"hbuilder":case"kiro":return[...o?[o]:[],"-g",...n?[n]:[],"".concat(u,":").concat(m,":").concat(E)];case"appcode":case"clion":case"clion64":case"idea":case"idea64":case"phpstorm":case"phpstorm64":case"pycharm":case"pycharm64":case"rubymine":case"rubymine64":case"webstorm":case"webstorm64":case"goland":case"goland64":case"rider":case"rider64":return[...o?[o]:[],"--line",m,u]}return""}function V(t){let e={};process.env&&(e=g({},process.env));let n="";if(t){const o=w.resolve(t,".env.local");T.existsSync(o)&&(n=o)}if(!n){const o=w.resolve(process.cwd(),".env.local");T.existsSync(o)&&(n=o)}if(n){const o=T.readFileSync(n,"utf-8"),a=J.parse(o||"");e=g(g({},a),e)}return e}function N(t,e){return V(e)[t]||null}const re={darwin:"ps ax -o comm=",linux:"ps -eo comm --sort=comm",win32:'powershell -NoProfile -Command "Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"'};function ae(t,e,n){let o=null;const a=N("CODE_EDITOR",e||"");if(a){const r=k(a);if(r)o=r;else return[a]}if(!o&&t){const r=k(t);r&&(o=r)}if(!o&&n){const r=se();if(r)return[r]}try{let r;const i=process.platform,c=process.platform==="win32",b=re[i],x=$[i];W(c);const P=v.execSync(b,{encoding:"utf-8"}),C=Object.keys(x),O=P.split(c?"\r\n":"\n").map(M=>M.trim());for(let M=0;M<C.length;M++){const p=C[M];let s="",S="";if(c){const f=O.find(y=>w.basename(y).toLowerCase()===p.toLowerCase());f&&(S=w.basename(f),s=f)}else if(i==="darwin"){const f=O.find(y=>y.toLowerCase().endsWith(p.toLowerCase()));if(f){const y=f.replace(p,""),d=x[p];S=p,d.includes("/")?s="".concat(y).concat(d):s=d}}else P.indexOf(p)!==-1&&(S=p,s=x[p]);if(S&&s){if(o!=null&&o.includes(S))return[s];r||(r=[s])}}if(r)return r}catch(r){}return process.env.VISUAL?[process.env.VISUAL]:process.env.EDITOR?[process.env.EDITOR]:[null]}const k=t=>{const e=process.platform;return _[e]&&_[e][t]||null},W=t=>{if(t)try{v.execSync("chcp 65001")}catch(e){}};function se(){const t=process.platform,e=Object.keys($[t]);try{return ce(process.pid,t,e)}catch(n){return console.log(l.red("Error while getting editor by PID:"),n),null}}function ce(t,e,n){let o=0;const a=50,r=0;for(;t&&t!==r&&o<a;){const i=ie(t,e);if(!i)break;const{command:c,parentPid:b}=i;if(ue(c,n))return c;t=b,o++}return null}function ie(t,e){switch(e){case"darwin":case"linux":return pe(t);case"win32":return de(t);default:return null}}function pe(t){try{const n=v.execSync("ps -p ".concat(t," -o ppid=,comm="),{encoding:"utf8"}).trim().split("\n");return n.length?le(n[0].trim()):null}catch(e){return null}}function de(t){try{W(!0);const e='powershell -NoProfile -Command "Get-CimInstance -ClassName Win32_Process -Filter "ProcessId='.concat(t,'" | Select-Object ParentProcessId, ExecutablePath | ConvertTo-Csv -NoTypeInformation'),o=v.execSync(e,{encoding:"utf8"}).trim().split("\r\n").filter(i=>i.trim()).slice(1);if(o.length===0)return null;const[a,r]=o[0].split(",");return!r||!a?null:{command:r.slice(1,-1),parentPid:Number(a.slice(1,-1))}}catch(e){return null}}function le(t){const e=t.match(/^(\d+)\s+(.+)$/);return e?{command:e[2],parentPid:parseInt(e[1])}:null}function ue(t,e){return e.some(n=>t.toLowerCase().endsWith(n.toLowerCase()))}function me(t){switch(t){case"vim":case"emacs":case"nano":return!0}return!1}function Ce(t){const e=N("CODE_INSPECTOR_FORMAT_PATH",t);if(e)try{return JSON.parse(e)}catch(n){return null}return null}function R(t,e){console.log(l.red("Could not open "+w.basename(t)+" in the editor.")),e&&(e[e.length-1]!=="."&&(e+="."),console.log(l.red("The editor process exited with an error: "+e))),console.log("To set up the editor integration, add something like "+l.cyan("CODE_EDITOR=code")+" to the "+l.green(".env.local")+" file in your project folder, or add "+l.green('editor: "code"')+" to CodeInspectorPlugin config, and then restart the development server. Learn more: "+l.green("https://goo.gl/MMTaZt"))}let h=null;function Se(t){return t==="reuse"?"-r":t==="new"?"-n":""}function Oe(t){let{file:e,line:n=1,column:o=1,editor:a,method:r,format:i,onError:c,rootDir:b,usePid:x,type:P="exec"}=t;if(!T.existsSync(e))return;let[C,...O]=ae(a,b,x);const M=Ce(b||"")||i;if(!C||C.toLowerCase()==="none"){typeof c=="function"?c(e,"Failed to recognize IDE automatically"):console.log("Failed to recognize IDE automatically, add something like "+l.cyan("CODE_EDITOR=code")+" to the "+l.green(".env.local")+" file in your project folder, or add "+l.green('editor: "code"')+" to CodeInspectorPlugin config, and then restart the development server. Learn more: "+l.green("https://goo.gl/MMTaZt"));return}const p=ne(C);if((P==="open"||P==="open-bg")&&process.platform==="darwin"&&D[p]){const s="".concat(D[p],"://file").concat(e,":").concat(n,":").concat(o),S=P==="open-bg"?["-g",s]:[s];h=v.spawn("open",S,{stdio:"ignore",env:I(g({},process.env),{NODE_OPTIONS:""})})}else{process.platform==="linux"&&e.startsWith("/mnt/")&&/Microsoft/i.test(j.release())&&(e=w.relative("",e));let s=null;if(n?O=O.concat(te({editorBasename:p,fileName:e,lineNumber:n,colNumber:o,workspace:s,openWindowParams:Se(r),pathFormat:M})):O.push(e),h&&me(C)&&h.kill("SIGKILL"),process.platform==="win32"){const S=d=>d.replace(/([&|<>,;=^])/g,"^$1"),f=d=>d.includes("^")?'^"'.concat(d,'^"'):d.includes(" ")?'"'.concat(d,'"'):d,y=[C,...O.map(S)].map(f).join(" ");h=v.exec(y,{stdio:"ignore",shell:!0,env:I(g({},process.env),{NODE_OPTIONS:""})})}else h=v.spawn(C,O,{stdio:"ignore",env:I(g({},process.env),{NODE_OPTIONS:""})})}h.on("exit",function(s){h=null,s&&(typeof c=="function"?c(e,"(code "+s+")"):R(e,"(code "+s+")"))}),h.on("error",function(s){typeof c=="function"?c(e,s.message):R(e,s.message)})}exports.formatOpenPath=L;exports.getEnvVariable=N;exports.getEnvVariables=V;exports.launchIDE=Oe; |
+63
-66
@@ -5,3 +5,3 @@ var V = Object.defineProperty, W = Object.defineProperties; | ||
| var H = Object.prototype.hasOwnProperty, X = Object.prototype.propertyIsEnumerable; | ||
| var B = (t, e, n) => e in t ? V(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, E = (t, e) => { | ||
| var B = (t, e, n) => e in t ? V(t, e, { enumerable: !0, configurable: !0, writable: !0, value: n }) : t[e] = n, g = (t, e) => { | ||
| for (var n in e || (e = {})) | ||
@@ -240,9 +240,9 @@ H.call(e, n) && B(t, n, e[n]); | ||
| win32: G | ||
| }, m = "{file}", u = "{line}", g = "{column}"; | ||
| }, u = "{file}", m = "{line}", E = "{column}"; | ||
| function Z(t, e, n, o) { | ||
| let a = "".concat(t, ":").concat(e, ":").concat(n); | ||
| if (typeof o == "string") | ||
| a = o.replace(m, t).replace(u, e.toString()).replace(g, n.toString()); | ||
| a = o.replace(u, t).replace(m, e.toString()).replace(E, n.toString()); | ||
| else if (o instanceof Array) | ||
| return o.map((r) => r.replace(m, t).replace(u, e.toString()).replace(g, n.toString())); | ||
| return o.map((r) => r.replace(u, t).replace(m, e.toString()).replace(E, n.toString())); | ||
| return [a]; | ||
@@ -260,4 +260,4 @@ } | ||
| pathFormat: c | ||
| } = t, x = ne({ editorBasename: e, openWindowParams: i, workspace: r }) || Y; | ||
| return Z(n, o, a, c || x); | ||
| } = t, b = ne({ editorBasename: e, openWindowParams: i, workspace: r }) || Y; | ||
| return Z(n, o, a, c || b); | ||
| } | ||
@@ -285,18 +285,18 @@ function te(t) { | ||
| case "zed": | ||
| return "".concat(m, ":").concat(u, ":").concat(g); | ||
| return "".concat(u, ":").concat(m, ":").concat(E); | ||
| case "notepad++": | ||
| return ["-n" + u, "-c" + g, m]; | ||
| return ["-n" + m, "-c" + E, u]; | ||
| case "vim": | ||
| case "mvim": | ||
| return ["+call cursor(".concat(u, ", ").concat(g, ")"), m]; | ||
| return ["+call cursor(".concat(m, ", ").concat(E, ")"), u]; | ||
| case "joe": | ||
| case "gvim": | ||
| return ["+" + u, m]; | ||
| return ["+" + m, u]; | ||
| case "emacs": | ||
| case "emacsclient": | ||
| return ["+" + u + ":" + g, m]; | ||
| return ["+" + m + ":" + E, u]; | ||
| case "rmate": | ||
| case "mate": | ||
| case "mine": | ||
| return ["--line", u, m]; | ||
| return ["--line", m, u]; | ||
| case "code": | ||
@@ -321,3 +321,3 @@ case "code-insiders": | ||
| ...n ? [n] : [], | ||
| "".concat(m, ":").concat(u, ":").concat(g) | ||
| "".concat(u, ":").concat(m, ":").concat(E) | ||
| ]; | ||
@@ -344,4 +344,4 @@ case "appcode": | ||
| "--line", | ||
| u, | ||
| m | ||
| m, | ||
| u | ||
| ]; | ||
@@ -353,3 +353,3 @@ } | ||
| let e = {}; | ||
| process.env && (e = E({}, process.env)); | ||
| process.env && (e = g({}, process.env)); | ||
| let n = ""; | ||
@@ -366,3 +366,3 @@ if (t) { | ||
| const o = T.readFileSync(n, "utf-8"), a = j.parse(o || ""); | ||
| e = E(E({}, a), e); | ||
| e = g(g({}, a), e); | ||
| } | ||
@@ -400,25 +400,25 @@ return e; | ||
| let r; | ||
| const i = process.platform, c = process.platform === "win32", h = re[i], x = R[i]; | ||
| const i = process.platform, c = process.platform === "win32", x = re[i], b = R[i]; | ||
| L(c); | ||
| const I = w.execSync(h, { encoding: "utf-8" }), C = Object.keys(x), S = I.split(c ? "\r\n" : "\n").map((b) => b.trim()); | ||
| for (let b = 0; b < C.length; b++) { | ||
| const p = C[b]; | ||
| let s = "", M = ""; | ||
| const I = w.execSync(x, { encoding: "utf-8" }), C = Object.keys(b), f = I.split(c ? "\r\n" : "\n").map((M) => M.trim()); | ||
| for (let M = 0; M < C.length; M++) { | ||
| const p = C[M]; | ||
| let s = "", S = ""; | ||
| if (c) { | ||
| const f = S.find( | ||
| const O = f.find( | ||
| (y) => v.basename(y).toLowerCase() === p.toLowerCase() | ||
| ); | ||
| f && (M = v.basename(f), s = f); | ||
| O && (S = v.basename(O), s = O); | ||
| } else if (i === "darwin") { | ||
| const f = S.find( | ||
| const O = f.find( | ||
| (y) => y.toLowerCase().endsWith(p.toLowerCase()) | ||
| ); | ||
| if (f) { | ||
| const y = f.replace(p, ""), d = x[p]; | ||
| M = p, d.includes("/") ? s = "".concat(y).concat(d) : s = d; | ||
| if (O) { | ||
| const y = O.replace(p, ""), d = b[p]; | ||
| S = p, d.includes("/") ? s = "".concat(y).concat(d) : s = d; | ||
| } | ||
| } else | ||
| I.indexOf(p) !== -1 && (M = p, s = x[p]); | ||
| if (M && s) { | ||
| if (o != null && o.includes(M)) | ||
| I.indexOf(p) !== -1 && (S = p, s = b[p]); | ||
| if (S && s) { | ||
| if (o != null && o.includes(S)) | ||
| return [s]; | ||
@@ -459,6 +459,6 @@ r || (r = [s]); | ||
| break; | ||
| const { command: c, parentPid: h } = i; | ||
| if (me(c, n)) | ||
| const { command: c, parentPid: x } = i; | ||
| if (ue(c, n)) | ||
| return c; | ||
| t = h, o++; | ||
| t = x, o++; | ||
| } | ||
@@ -512,3 +512,3 @@ return null; | ||
| } | ||
| function me(t, e) { | ||
| function ue(t, e) { | ||
| return e.some( | ||
@@ -518,3 +518,3 @@ (n) => t.toLowerCase().endsWith(n.toLowerCase()) | ||
| } | ||
| function ue(t) { | ||
| function me(t) { | ||
| switch (t) { | ||
@@ -550,7 +550,7 @@ case "vim": | ||
| } | ||
| let O = null; | ||
| let h = null; | ||
| function Se(t) { | ||
| return t === "reuse" ? "-r" : t === "new" ? "-n" : ""; | ||
| } | ||
| function Ee(t) { | ||
| function ge(t) { | ||
| let { | ||
@@ -564,4 +564,4 @@ file: e, | ||
| onError: c, | ||
| rootDir: h, | ||
| usePid: x, | ||
| rootDir: x, | ||
| usePid: b, | ||
| type: I = "exec" | ||
@@ -571,4 +571,4 @@ } = t; | ||
| return; | ||
| let [C, ...S] = ae(a, h, x); | ||
| const b = Ce(h || "") || i; | ||
| let [C, ...f] = ae(a, x, b); | ||
| const M = Ce(x || "") || i; | ||
| if (!C || C.toLowerCase() === "none") { | ||
@@ -583,17 +583,14 @@ typeof c == "function" ? c(e, "Failed to recognize IDE automatically") : console.log( | ||
| ); | ||
| if (I === "open" && process.platform === "darwin" && A[p]) | ||
| O = w.spawn( | ||
| "open", | ||
| ["".concat(A[p], "://file").concat(e, ":").concat(n, ":").concat(o)], | ||
| { | ||
| stdio: "ignore", | ||
| env: P(E({}, process.env), { | ||
| NODE_OPTIONS: "" | ||
| }) | ||
| } | ||
| ); | ||
| else { | ||
| if ((I === "open" || I === "open-bg") && process.platform === "darwin" && A[p]) { | ||
| const s = "".concat(A[p], "://file").concat(e, ":").concat(n, ":").concat(o), S = I === "open-bg" ? ["-g", s] : [s]; | ||
| h = w.spawn("open", S, { | ||
| stdio: "ignore", | ||
| env: P(g({}, process.env), { | ||
| NODE_OPTIONS: "" | ||
| }) | ||
| }); | ||
| } else { | ||
| process.platform === "linux" && e.startsWith("/mnt/") && /Microsoft/i.test(Q.release()) && (e = v.relative("", e)); | ||
| let s = null; | ||
| if (n ? S = S.concat( | ||
| if (n ? f = f.concat( | ||
| ee({ | ||
@@ -606,11 +603,11 @@ editorBasename: p, | ||
| openWindowParams: Se(r), | ||
| pathFormat: b | ||
| pathFormat: M | ||
| }) | ||
| ) : S.push(e), O && ue(C) && O.kill("SIGKILL"), process.platform === "win32") { | ||
| const M = (d) => d.replace(/([&|<>,;=^])/g, "^$1"), f = (d) => d.includes("^") ? '^"'.concat(d, '^"') : d.includes(" ") ? '"'.concat(d, '"') : d, y = [C, ...S.map(M)].map(f).join(" "); | ||
| O = w.exec(y, { | ||
| ) : f.push(e), h && me(C) && h.kill("SIGKILL"), process.platform === "win32") { | ||
| const S = (d) => d.replace(/([&|<>,;=^])/g, "^$1"), O = (d) => d.includes("^") ? '^"'.concat(d, '^"') : d.includes(" ") ? '"'.concat(d, '"') : d, y = [C, ...f.map(S)].map(O).join(" "); | ||
| h = w.exec(y, { | ||
| stdio: "ignore", | ||
| // @ts-ignore | ||
| shell: !0, | ||
| env: P(E({}, process.env), { | ||
| env: P(g({}, process.env), { | ||
| NODE_OPTIONS: "" | ||
@@ -620,5 +617,5 @@ }) | ||
| } else | ||
| O = w.spawn(C, S, { | ||
| h = w.spawn(C, f, { | ||
| stdio: "ignore", | ||
| env: P(E({}, process.env), { | ||
| env: P(g({}, process.env), { | ||
| NODE_OPTIONS: "" | ||
@@ -628,5 +625,5 @@ }) | ||
| } | ||
| O.on("exit", function(s) { | ||
| O = null, s && (typeof c == "function" ? c(e, "(code " + s + ")") : k(e, "(code " + s + ")")); | ||
| }), O.on("error", function(s) { | ||
| h.on("exit", function(s) { | ||
| h = null, s && (typeof c == "function" ? c(e, "(code " + s + ")") : k(e, "(code " + s + ")")); | ||
| }), h.on("error", function(s) { | ||
| typeof c == "function" ? c(e, s.message) : k(e, s.message); | ||
@@ -639,3 +636,3 @@ }); | ||
| oe as getEnvVariables, | ||
| Ee as launchIDE | ||
| ge as launchIDE | ||
| }; |
+8
-8
| { | ||
| "name": "launch-ide", | ||
| "version": "1.4.3", | ||
| "version": "1.4.4", | ||
| "main": "dist/index.js", | ||
@@ -39,2 +39,9 @@ "module": "./dist/index.mjs", | ||
| }, | ||
| "scripts": { | ||
| "dev": "vite", | ||
| "build": "pnpm clear && tsc && vite build", | ||
| "clear": "rimraf ./dist && rimraf ./types", | ||
| "pub": "pnpm publish", | ||
| "pub:beta": "pnpm publish --tag beta" | ||
| }, | ||
| "dependencies": { | ||
@@ -50,10 +57,3 @@ "chalk": "^4.1.1", | ||
| "vite-plugin-node-stdlib-browser": "^0.2.1" | ||
| }, | ||
| "scripts": { | ||
| "dev": "vite", | ||
| "build": "pnpm clear && tsc && vite build", | ||
| "clear": "rimraf ./dist && rimraf ./types", | ||
| "pub": "pnpm publish", | ||
| "pub:beta": "pnpm publish --tag beta" | ||
| } | ||
| } |
+2
-2
@@ -106,6 +106,6 @@ # launch-ide · [](https://www.npmjs.com/package/launch-ide) [](https://npmcharts.netlify.app/compare/launch-ide?minimal=true) [](https://opensource.org/licenses/MIT) [](https://github.com/zh-lx/launch-ide) | ||
| * @type: string | ||
| * @description: The ways to launch the editor. exec: opening editor using the executable path; open: opening editor using the open command. Only effective on MacOS and these editors: code/cursor/windsurf/qoder/comate/trae/codebuddy/antigravity/kiro/codium | ||
| * @description: The ways to launch the editor. `exec`: opening editor using the executable path. `open`: opening editor using the macOS `open` command (activates the editor). `open-bg`: like `open` but adds the `-g` flag, so the file opens at the right line without bringing the editor to the foreground ā the user's current window (e.g. browser) keeps focus. `open` and `open-bg` are only effective on MacOS and these editors: code/cursor/windsurf/qoder/comate/trae/codebuddy/antigravity/kiro/codium | ||
| * @default exec | ||
| */ | ||
| type?: 'exec' | 'open'; | ||
| type?: 'exec' | 'open' | 'open-bg'; | ||
| } | ||
@@ -112,0 +112,0 @@ ``` |
+1
-1
@@ -7,2 +7,2 @@ export type Editor = 'antigravity' | 'appcode' | 'atom' | 'kiro' | 'atom-beta' | 'brackets' | 'code' | 'code-insiders' | 'codebuddy' | 'codium' | 'comate' | 'cursor' | 'colin' | 'emacs' | 'goland' | 'hbuilder' | 'idea' | 'notepad' | 'phpstorm' | 'pycharm' | 'qoder' | 'trae' | 'rider' | 'rubymine' | 'sublime' | 'vim' | 'webstorm' | 'windsurf' | 'zed'; | ||
| export type IDEOpenMethod = 'reuse' | 'new' | 'auto'; | ||
| export type LaunchType = 'exec' | 'open'; | ||
| export type LaunchType = 'exec' | 'open' | 'open-bg'; |
52381
0.71%809
-0.25%