@rsbuild/core 0.6.7 → 0.6.9

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/compiled/commander/{typings/index.d.ts → index.d.ts} +26 -24
  2. package/compiled/commander/index.js +3528 -1
  3. package/compiled/commander/package.json +1 -1
  4. package/compiled/connect-history-api-fallback/index.js +186 -1
  5. package/compiled/dotenv/{lib/main.d.ts → index.d.ts} +16 -12
  6. package/compiled/dotenv/index.js +458 -1
  7. package/compiled/dotenv/package.json +1 -1
  8. package/compiled/dotenv-expand/{lib/main.d.ts → index.d.ts} +9 -7
  9. package/compiled/dotenv-expand/index.js +146 -1
  10. package/compiled/dotenv-expand/package.json +1 -1
  11. package/compiled/http-compression/index.js +185 -1
  12. package/compiled/launch-editor-middleware/index.js +843 -1
  13. package/compiled/on-finished/index.d.ts +2 -2
  14. package/compiled/on-finished/index.js +390 -3
  15. package/compiled/on-finished/package.json +1 -1
  16. package/compiled/open/index.d.ts +1 -153
  17. package/compiled/open/index.js +526 -1
  18. package/compiled/open/package.json +1 -1
  19. package/compiled/sirv/index.d.ts +1 -0
  20. package/compiled/sirv/index.js +798 -1
  21. package/compiled/sirv/package.json +1 -1
  22. package/compiled/webpack-dev-middleware/index.d.ts +1 -0
  23. package/compiled/webpack-dev-middleware/index.js +6696 -0
  24. package/compiled/webpack-dev-middleware/license +20 -0
  25. package/compiled/webpack-dev-middleware/package.json +1 -0
  26. package/compiled/webpack-dev-middleware/schema-utils.js +1 -0
  27. package/compiled/ws/index.d.ts +7 -15
  28. package/compiled/ws/index.js +4885 -1
  29. package/compiled/ws/package.json +1 -1
  30. package/dist/cli/commands.js +1 -1
  31. package/dist/cli/prepare.js +1 -1
  32. package/dist/client/format.d.ts +5 -0
  33. package/dist/client/{formatStats.js → format.js} +22 -46
  34. package/dist/client/hmr.d.ts +5 -0
  35. package/dist/client/hmr.mjs +201 -474
  36. package/dist/client/overlay.mjs +208 -237
  37. package/dist/createContext.js +1 -1
  38. package/dist/index.js +1 -1
  39. package/dist/plugins/target.js +19 -16
  40. package/dist/provider/plugins/swc.js +1 -0
  41. package/dist/provider/shared.js +2 -2
  42. package/dist/server/devMiddleware.js +1 -1
  43. package/dist/server/devServer.js +6 -1
  44. package/dist/server/getDevMiddlewares.d.ts +3 -0
  45. package/dist/server/getDevMiddlewares.js +6 -8
  46. package/dist/server/helper.d.ts +4 -4
  47. package/dist/server/middlewares.d.ts +5 -2
  48. package/dist/server/middlewares.js +1 -7
  49. package/package.json +6 -5
  50. package/compiled/open/license +0 -9
  51. package/compiled/sirv/sirv.d.ts +0 -27
  52. package/dist/client/formatStats.d.ts +0 -12
  53. package/dist/client/hmr/createSocketUrl.d.ts +0 -12
  54. package/dist/client/hmr/index.d.ts +0 -4
@@ -1 +1,843 @@
1
- (()=>{var e={426:(e,t,n)=>{const r=n(310);const s=n(17);const i=n(80);e.exports=(e,t,n)=>{if(typeof e==="function"){n=e;e=undefined}if(typeof t==="function"){n=t;t=undefined}t=t||process.cwd();return function launchEditorMiddleware(o,a,c){const{file:p}=r.parse(o.url,true).query||{};if(!p){a.statusCode=500;a.end(`launch-editor-middleware: required query param "file" is missing.`)}else{i(s.resolve(t,p),e,n);a.end()}}}},881:e=>{e.exports={atom:"atom",Brackets:"brackets","code-insiders":"code-insiders",code:"code",vscodium:"vscodium",codium:"codium",emacs:"emacs",gvim:"gvim","idea.sh":"idea","phpstorm.sh":"phpstorm","pycharm.sh":"pycharm","rubymine.sh":"rubymine",sublime_text:"subl",vim:"vim","webstorm.sh":"webstorm","goland.sh":"goland","rider.sh":"rider"}},341:e=>{e.exports={"/Applications/Atom.app/Contents/MacOS/Atom":"atom","/Applications/Atom Beta.app/Contents/MacOS/Atom Beta":"/Applications/Atom Beta.app/Contents/MacOS/Atom Beta","/Applications/Brackets.app/Contents/MacOS/Brackets":"brackets","/Applications/Sublime Text.app/Contents/MacOS/Sublime Text":"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text.app/Contents/MacOS/sublime_text":"/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2":"/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl","/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text":"/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl","/Applications/Visual Studio Code.app/Contents/MacOS/Electron":"code","/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron":"code-insiders","/Applications/VSCodium.app/Contents/MacOS/Electron":"codium","/Applications/AppCode.app/Contents/MacOS/appcode":"/Applications/AppCode.app/Contents/MacOS/appcode","/Applications/CLion.app/Contents/MacOS/clion":"/Applications/CLion.app/Contents/MacOS/clion","/Applications/IntelliJ IDEA.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA.app/Contents/MacOS/idea","/Applications/PhpStorm.app/Contents/MacOS/phpstorm":"/Applications/PhpStorm.app/Contents/MacOS/phpstorm","/Applications/PyCharm.app/Contents/MacOS/pycharm":"/Applications/PyCharm.app/Contents/MacOS/pycharm","/Applications/PyCharm CE.app/Contents/MacOS/pycharm":"/Applications/PyCharm CE.app/Contents/MacOS/pycharm","/Applications/RubyMine.app/Contents/MacOS/rubymine":"/Applications/RubyMine.app/Contents/MacOS/rubymine","/Applications/WebStorm.app/Contents/MacOS/webstorm":"/Applications/WebStorm.app/Contents/MacOS/webstorm","/Applications/MacVim.app/Contents/MacOS/MacVim":"mvim","/Applications/GoLand.app/Contents/MacOS/goland":"/Applications/GoLand.app/Contents/MacOS/goland","/Applications/Rider.app/Contents/MacOS/rider":"/Applications/Rider.app/Contents/MacOS/rider"}},3:e=>{e.exports=["Brackets.exe","Code.exe","Code - Insiders.exe","VSCodium.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","webstorm.exe","webstorm64.exe","goland.exe","goland64.exe","rider.exe","rider64.exe"]},417:(e,t,n)=>{const r=n(17);e.exports=function getArgumentsForPosition(e,t,n,s=1){const i=r.basename(e).replace(/\.(exe|cmd|bat)$/i,"");switch(i){case"atom":case"Atom":case"Atom Beta":case"subl":case"sublime":case"sublime_text":case"wstorm":case"charm":return[`${t}:${n}:${s}`];case"notepad++":return["-n"+n,"-c"+s,t];case"vim":case"mvim":return[`+call cursor(${n}, ${s})`,t];case"joe":case"gvim":return["+"+`${n}`,t];case"emacs":case"emacsclient":return[`+${n}:${s}`,t];case"rmate":case"mate":case"mine":return["--line",n,t];case"code":case"Code":case"code-insiders":case"Code - Insiders":case"codium":case"vscodium":case"VSCodium":return["-r","-g",`${t}:${n}:${s}`];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["--line",n,"--column",s,t]}if(process.env.LAUNCH_EDITOR){return[t,n,s]}return[t]}},841:(e,t,n)=>{const r=n(17);const s=n(522);const i=n(81);const o=n(341);const a=n(881);const c=n(3);e.exports=function guessEditor(e){if(e){return s.parse(e)}if(process.env.LAUNCH_EDITOR){return[process.env.LAUNCH_EDITOR]}if(process.versions.webcontainer){return[process.env.EDITOR||"code"]}try{if(process.platform==="darwin"){const e=i.execSync("ps x -o comm=",{stdio:["pipe","pipe","ignore"]}).toString();const t=Object.keys(o);const n=e.split("\n");for(let r=0;r<t.length;r++){const s=t[r];if(e.indexOf(s)!==-1){return[o[s]]}const i=s.replace("/Applications","");if(e.indexOf(i)!==-1){if(s!==o[s]){return[o[s]]}const e=n.find((e=>e.endsWith(i)));if(e!==undefined){return[e]}}}}else if(process.platform==="win32"){const e=i.execSync('powershell -NoProfile -Command "Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"',{stdio:["pipe","pipe","ignore"]}).toString();const t=e.split("\r\n");for(let e=0;e<t.length;e++){const n=t[e].trim();const s=r.basename(n);if(c.indexOf(s)!==-1){return[n]}}}else if(process.platform==="linux"){const e=i.execSync("ps x --no-heading -o comm --sort=comm",{stdio:["pipe","pipe","ignore"]}).toString();const t=Object.keys(a);for(let n=0;n<t.length;n++){const r=t[n];if(e.indexOf(r)!==-1){return[a[r]]}}}}catch(e){}if(process.env.VISUAL){return[process.env.VISUAL]}else if(process.env.EDITOR){return[process.env.EDITOR]}return[null]}},80:(e,t,n)=>{const r=n(147);const s=n(37);const i=n(17);const o=n(802);const a=n(81);const c=n(841);const p=n(417);function wrapErrorCallback(e){return(t,n)=>{console.log();console.log(o.red("Could not open "+i.basename(t)+" in the editor."));if(n){if(n[n.length-1]!=="."){n+="."}console.log(o.red("The editor process exited with an error: "+n))}console.log();if(e)e(t,n)}}function isTerminalEditor(e){switch(e){case"vim":case"emacs":case"nano":return true}return false}const l=/:(\d+)(:(\d+))?$/;function parseFile(e){const t=e.replace(l,"");const n=e.match(l);const r=n&&n[1];const s=n&&n[3];return{fileName:t,lineNumber:r,columnNumber:s}}let u=null;function launchEditor(e,t,n){const o=parseFile(e);let{fileName:l}=o;const{lineNumber:d,columnNumber:m}=o;if(!r.existsSync(l)){return}if(typeof t==="function"){n=t;t=undefined}n=wrapErrorCallback(n);const[f,...x]=c(t);if(!f){n(l,null);return}if(process.platform==="linux"&&l.startsWith("/mnt/")&&/Microsoft/i.test(s.release())){l=i.relative("",l)}if(d){const e=p(f,l,d,m);x.push.apply(x,e)}else{x.push(l)}if(u&&isTerminalEditor(f)){u.kill("SIGKILL")}if(process.platform==="win32"){u=a.spawn("cmd.exe",["/C",f].concat(x),{stdio:"inherit"})}else{u=a.spawn(f,x,{stdio:"inherit"})}u.on("exit",(function(e){u=null;if(e){n(l,"(code "+e+")")}}));u.on("error",(function(e){n(l,e.message)}))}e.exports=launchEditor},522:(e,t,n)=>{"use strict";t.quote=n(392);t.parse=n(145)},145:e=>{"use strict";var t="(?:"+["\\|\\|","\\&\\&",";;","\\|\\&","\\<\\(","\\<\\<\\<",">>",">\\&","<\\&","[&;()|<>]"].join("|")+")";var n=new RegExp("^"+t+"$");var r="|&;()<> \\t";var s='"((\\\\"|[^"])*?)"';var i="'((\\\\'|[^'])*?)'";var o=/^#$/;var a="'";var c='"';var p="$";var l="";var u=4294967296;for(var d=0;d<4;d++){l+=(u*Math.random()).toString(16)}var m=new RegExp("^"+l);function matchAll(e,t){var n=t.lastIndex;var r=[];var s;while(s=t.exec(e)){r.push(s);if(t.lastIndex===s.index){t.lastIndex+=1}}t.lastIndex=n;return r}function getVar(e,t,n){var r=typeof e==="function"?e(n):e[n];if(typeof r==="undefined"&&n!=""){r=""}else if(typeof r==="undefined"){r="$"}if(typeof r==="object"){return t+l+JSON.stringify(r)+l}return t+r}function parseInternal(e,l,u){if(!u){u={}}var d=u.escape||"\\";var m="(\\"+d+"['\""+r+"]|[^\\s'\""+r+"])+";var f=new RegExp(["("+t+")","("+m+"|"+s+"|"+i+")+"].join("|"),"g");var x=matchAll(e,f);if(x.length===0){return[]}if(!l){l={}}var h=false;return x.map((function(t){var r=t[0];if(!r||h){return void undefined}if(n.test(r)){return{op:r}}var s=false;var i=false;var u="";var m=false;var f;function parseEnvVar(){f+=1;var e;var t;var n=r.charAt(f);if(n==="{"){f+=1;if(r.charAt(f)==="}"){throw new Error("Bad substitution: "+r.slice(f-2,f+1))}e=r.indexOf("}",f);if(e<0){throw new Error("Bad substitution: "+r.slice(f))}t=r.slice(f,e);f=e}else if(/[*@#?$!_-]/.test(n)){t=n;f+=1}else{var s=r.slice(f);e=s.match(/[^\w\d_]/);if(!e){t=s;f=r.length}else{t=s.slice(0,e.index);f+=e.index-1}}return getVar(l,"",t)}for(f=0;f<r.length;f++){var x=r.charAt(f);m=m||!s&&(x==="*"||x==="?");if(i){u+=x;i=false}else if(s){if(x===s){s=false}else if(s==a){u+=x}else{if(x===d){f+=1;x=r.charAt(f);if(x===c||x===d||x===p){u+=x}else{u+=d+x}}else if(x===p){u+=parseEnvVar()}else{u+=x}}}else if(x===c||x===a){s=x}else if(n.test(x)){return{op:r}}else if(o.test(x)){h=true;var b={comment:e.slice(t.index+f+1)};if(u.length){return[u,b]}return[b]}else if(x===d){i=true}else if(x===p){u+=parseEnvVar()}else{u+=x}}if(m){return{op:"glob",pattern:u}}return u})).reduce((function(e,t){return typeof t==="undefined"?e:e.concat(t)}),[])}e.exports=function parse(e,t,n){var r=parseInternal(e,t,n);if(typeof t!=="function"){return r}return r.reduce((function(e,t){if(typeof t==="object"){return e.concat(t)}var n=t.split(RegExp("("+l+".*?"+l+")","g"));if(n.length===1){return e.concat(n[0])}return e.concat(n.filter(Boolean).map((function(e){if(m.test(e)){return JSON.parse(e.split(l)[1])}return e})))}),[])}},392:e=>{"use strict";e.exports=function quote(e){return e.map((function(e){if(e&&typeof e==="object"){return e.op.replace(/(.)/g,"\\$1")}if(/["\s]/.test(e)&&!/'/.test(e)){return"'"+e.replace(/(['\\])/g,"\\$1")+"'"}if(/["'\s]/.test(e)){return'"'+e.replace(/(["\\$`!])/g,"\\$1")+'"'}return String(e).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,"$1\\$2")})).join(" ")}},802:e=>{"use strict";e.exports=require("@rsbuild/shared/picocolors")},81:e=>{"use strict";e.exports=require("child_process")},147:e=>{"use strict";e.exports=require("fs")},37:e=>{"use strict";e.exports=require("os")},17:e=>{"use strict";e.exports=require("path")},310:e=>{"use strict";e.exports=require("url")}};var t={};function __nccwpck_require__(n){var r=t[n];if(r!==undefined){return r.exports}var s=t[n]={exports:{}};var i=true;try{e[n](s,s.exports,__nccwpck_require__);i=false}finally{if(i)delete t[n]}return s.exports}if(typeof __nccwpck_require__!=="undefined")__nccwpck_require__.ab=__dirname+"/";var n=__nccwpck_require__(426);module.exports=n})();
1
+ /******/ (() => { // webpackBootstrap
2
+ /******/ var __webpack_modules__ = ({
3
+
4
+ /***/ 426:
5
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
6
+
7
+ const url = __nccwpck_require__(310)
8
+ const path = __nccwpck_require__(17)
9
+ const launch = __nccwpck_require__(80)
10
+
11
+ module.exports = (specifiedEditor, srcRoot, onErrorCallback) => {
12
+ if (typeof specifiedEditor === 'function') {
13
+ onErrorCallback = specifiedEditor
14
+ specifiedEditor = undefined
15
+ }
16
+
17
+ if (typeof srcRoot === 'function') {
18
+ onErrorCallback = srcRoot
19
+ srcRoot = undefined
20
+ }
21
+
22
+ srcRoot = srcRoot || process.cwd()
23
+
24
+ return function launchEditorMiddleware (req, res, next) {
25
+ const { file } = url.parse(req.url, true).query || {}
26
+ if (!file) {
27
+ res.statusCode = 500
28
+ res.end(`launch-editor-middleware: required query param "file" is missing.`)
29
+ } else {
30
+ launch(path.resolve(srcRoot, file), specifiedEditor, onErrorCallback)
31
+ res.end()
32
+ }
33
+ }
34
+ }
35
+
36
+
37
+ /***/ }),
38
+
39
+ /***/ 881:
40
+ /***/ ((module) => {
41
+
42
+ module.exports = {
43
+ atom: 'atom',
44
+ Brackets: 'brackets',
45
+ 'code-insiders': 'code-insiders',
46
+ code: 'code',
47
+ vscodium: 'vscodium',
48
+ codium: 'codium',
49
+ emacs: 'emacs',
50
+ gvim: 'gvim',
51
+ 'idea.sh': 'idea',
52
+ 'phpstorm.sh': 'phpstorm',
53
+ 'pycharm.sh': 'pycharm',
54
+ 'rubymine.sh': 'rubymine',
55
+ sublime_text: 'subl',
56
+ vim: 'vim',
57
+ 'webstorm.sh': 'webstorm',
58
+ 'goland.sh': 'goland',
59
+ 'rider.sh': 'rider'
60
+ }
61
+
62
+
63
+ /***/ }),
64
+
65
+ /***/ 341:
66
+ /***/ ((module) => {
67
+
68
+ module.exports = {
69
+ '/Applications/Atom.app/Contents/MacOS/Atom': 'atom',
70
+ '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta':
71
+ '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta',
72
+ '/Applications/Brackets.app/Contents/MacOS/Brackets': 'brackets',
73
+ '/Applications/Sublime Text.app/Contents/MacOS/Sublime Text':
74
+ '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',
75
+ '/Applications/Sublime Text.app/Contents/MacOS/sublime_text':
76
+ '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',
77
+ '/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2':
78
+ '/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl',
79
+ '/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text':
80
+ '/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl',
81
+ '/Applications/Visual Studio Code.app/Contents/MacOS/Electron': 'code',
82
+ '/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron':
83
+ 'code-insiders',
84
+ '/Applications/VSCodium.app/Contents/MacOS/Electron': 'codium',
85
+ '/Applications/AppCode.app/Contents/MacOS/appcode':
86
+ '/Applications/AppCode.app/Contents/MacOS/appcode',
87
+ '/Applications/CLion.app/Contents/MacOS/clion':
88
+ '/Applications/CLion.app/Contents/MacOS/clion',
89
+ '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea':
90
+ '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea',
91
+ '/Applications/PhpStorm.app/Contents/MacOS/phpstorm':
92
+ '/Applications/PhpStorm.app/Contents/MacOS/phpstorm',
93
+ '/Applications/PyCharm.app/Contents/MacOS/pycharm':
94
+ '/Applications/PyCharm.app/Contents/MacOS/pycharm',
95
+ '/Applications/PyCharm CE.app/Contents/MacOS/pycharm':
96
+ '/Applications/PyCharm CE.app/Contents/MacOS/pycharm',
97
+ '/Applications/RubyMine.app/Contents/MacOS/rubymine':
98
+ '/Applications/RubyMine.app/Contents/MacOS/rubymine',
99
+ '/Applications/WebStorm.app/Contents/MacOS/webstorm':
100
+ '/Applications/WebStorm.app/Contents/MacOS/webstorm',
101
+ '/Applications/MacVim.app/Contents/MacOS/MacVim': 'mvim',
102
+ '/Applications/GoLand.app/Contents/MacOS/goland':
103
+ '/Applications/GoLand.app/Contents/MacOS/goland',
104
+ '/Applications/Rider.app/Contents/MacOS/rider':
105
+ '/Applications/Rider.app/Contents/MacOS/rider'
106
+ }
107
+
108
+
109
+ /***/ }),
110
+
111
+ /***/ 3:
112
+ /***/ ((module) => {
113
+
114
+ module.exports = [
115
+ 'Brackets.exe',
116
+ 'Code.exe',
117
+ 'Code - Insiders.exe',
118
+ 'VSCodium.exe',
119
+ 'atom.exe',
120
+ 'sublime_text.exe',
121
+ 'notepad++.exe',
122
+ 'clion.exe',
123
+ 'clion64.exe',
124
+ 'idea.exe',
125
+ 'idea64.exe',
126
+ 'phpstorm.exe',
127
+ 'phpstorm64.exe',
128
+ 'pycharm.exe',
129
+ 'pycharm64.exe',
130
+ 'rubymine.exe',
131
+ 'rubymine64.exe',
132
+ 'webstorm.exe',
133
+ 'webstorm64.exe',
134
+ 'goland.exe',
135
+ 'goland64.exe',
136
+ 'rider.exe',
137
+ 'rider64.exe'
138
+ ]
139
+
140
+
141
+ /***/ }),
142
+
143
+ /***/ 417:
144
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
145
+
146
+ const path = __nccwpck_require__(17)
147
+
148
+ // normalize file/line numbers into command line args for specific editors
149
+ module.exports = function getArgumentsForPosition (
150
+ editor,
151
+ fileName,
152
+ lineNumber,
153
+ columnNumber = 1
154
+ ) {
155
+ const editorBasename = path.basename(editor).replace(/\.(exe|cmd|bat)$/i, '')
156
+ switch (editorBasename) {
157
+ case 'atom':
158
+ case 'Atom':
159
+ case 'Atom Beta':
160
+ case 'subl':
161
+ case 'sublime':
162
+ case 'sublime_text':
163
+ case 'wstorm':
164
+ case 'charm':
165
+ return [`${fileName}:${lineNumber}:${columnNumber}`]
166
+ case 'notepad++':
167
+ return ['-n' + lineNumber, '-c' + columnNumber, fileName]
168
+ case 'vim':
169
+ case 'mvim':
170
+ return [`+call cursor(${lineNumber}, ${columnNumber})`, fileName]
171
+ case 'joe':
172
+ case 'gvim':
173
+ return ['+' + `${lineNumber}`, fileName]
174
+ case 'emacs':
175
+ case 'emacsclient':
176
+ return [`+${lineNumber}:${columnNumber}`, fileName]
177
+ case 'rmate':
178
+ case 'mate':
179
+ case 'mine':
180
+ return ['--line', lineNumber, fileName]
181
+ case 'code':
182
+ case 'Code':
183
+ case 'code-insiders':
184
+ case 'Code - Insiders':
185
+ case 'codium':
186
+ case 'vscodium':
187
+ case 'VSCodium':
188
+ return ['-r', '-g', `${fileName}:${lineNumber}:${columnNumber}`]
189
+ case 'appcode':
190
+ case 'clion':
191
+ case 'clion64':
192
+ case 'idea':
193
+ case 'idea64':
194
+ case 'phpstorm':
195
+ case 'phpstorm64':
196
+ case 'pycharm':
197
+ case 'pycharm64':
198
+ case 'rubymine':
199
+ case 'rubymine64':
200
+ case 'webstorm':
201
+ case 'webstorm64':
202
+ case 'goland':
203
+ case 'goland64':
204
+ case 'rider':
205
+ case 'rider64':
206
+ return ['--line', lineNumber, '--column', columnNumber, fileName]
207
+ }
208
+
209
+ if (process.env.LAUNCH_EDITOR) {
210
+ return [fileName, lineNumber, columnNumber]
211
+ }
212
+
213
+ // For all others, drop the lineNumber until we have
214
+ // a mapping above, since providing the lineNumber incorrectly
215
+ // can result in errors or confusing behavior.
216
+ return [fileName]
217
+ }
218
+
219
+
220
+ /***/ }),
221
+
222
+ /***/ 841:
223
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
224
+
225
+ const path = __nccwpck_require__(17)
226
+ const shellQuote = __nccwpck_require__(522)
227
+ const childProcess = __nccwpck_require__(81)
228
+
229
+ // Map from full process name to binary that starts the process
230
+ // We can't just re-use full process name, because it will spawn a new instance
231
+ // of the app every time
232
+ const COMMON_EDITORS_OSX = __nccwpck_require__(341)
233
+ const COMMON_EDITORS_LINUX = __nccwpck_require__(881)
234
+ const COMMON_EDITORS_WIN = __nccwpck_require__(3)
235
+
236
+ module.exports = function guessEditor (specifiedEditor) {
237
+ if (specifiedEditor) {
238
+ return shellQuote.parse(specifiedEditor)
239
+ }
240
+
241
+ if (process.env.LAUNCH_EDITOR) {
242
+ return [process.env.LAUNCH_EDITOR]
243
+ }
244
+
245
+ if (process.versions.webcontainer) {
246
+ return [process.env.EDITOR || 'code']
247
+ }
248
+
249
+ // We can find out which editor is currently running by:
250
+ // `ps x` on macOS and Linux
251
+ // `Get-Process` on Windows
252
+ try {
253
+ if (process.platform === 'darwin') {
254
+ const output = childProcess
255
+ .execSync('ps x -o comm=', {
256
+ stdio: ['pipe', 'pipe', 'ignore']
257
+ })
258
+ .toString()
259
+ const processNames = Object.keys(COMMON_EDITORS_OSX)
260
+ const processList = output.split('\n')
261
+ for (let i = 0; i < processNames.length; i++) {
262
+ const processName = processNames[i]
263
+ // Find editor by exact match.
264
+ if (output.indexOf(processName) !== -1) {
265
+ return [COMMON_EDITORS_OSX[processName]]
266
+ }
267
+ const processNameWithoutApplications = processName.replace('/Applications', '')
268
+ // Find editor installation not in /Applications.
269
+ if (output.indexOf(processNameWithoutApplications) !== -1) {
270
+ // Use the CLI command if one is specified
271
+ if (processName !== COMMON_EDITORS_OSX[processName]) {
272
+ return [COMMON_EDITORS_OSX[processName]]
273
+ }
274
+ // Use a partial match to find the running process path. If one is found, use the
275
+ // existing path since it can be running from anywhere.
276
+ const runningProcess = processList.find((procName) => procName.endsWith(processNameWithoutApplications))
277
+ if (runningProcess !== undefined) {
278
+ return [runningProcess]
279
+ }
280
+ }
281
+ }
282
+ } else if (process.platform === 'win32') {
283
+ const output = childProcess
284
+ .execSync(
285
+ 'powershell -NoProfile -Command "Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"',
286
+ {
287
+ stdio: ['pipe', 'pipe', 'ignore']
288
+ }
289
+ )
290
+ .toString()
291
+ const runningProcesses = output.split('\r\n')
292
+ for (let i = 0; i < runningProcesses.length; i++) {
293
+ const fullProcessPath = runningProcesses[i].trim()
294
+ const shortProcessName = path.basename(fullProcessPath)
295
+
296
+ if (COMMON_EDITORS_WIN.indexOf(shortProcessName) !== -1) {
297
+ return [fullProcessPath]
298
+ }
299
+ }
300
+ } else if (process.platform === 'linux') {
301
+ // --no-heading No header line
302
+ // x List all processes owned by you
303
+ // -o comm Need only names column
304
+ const output = childProcess
305
+ .execSync('ps x --no-heading -o comm --sort=comm', {
306
+ stdio: ['pipe', 'pipe', 'ignore']
307
+ })
308
+ .toString()
309
+ const processNames = Object.keys(COMMON_EDITORS_LINUX)
310
+ for (let i = 0; i < processNames.length; i++) {
311
+ const processName = processNames[i]
312
+ if (output.indexOf(processName) !== -1) {
313
+ return [COMMON_EDITORS_LINUX[processName]]
314
+ }
315
+ }
316
+ }
317
+ } catch (error) {
318
+ // Ignore...
319
+ }
320
+
321
+ // Last resort, use old skool env vars
322
+ if (process.env.VISUAL) {
323
+ return [process.env.VISUAL]
324
+ } else if (process.env.EDITOR) {
325
+ return [process.env.EDITOR]
326
+ }
327
+
328
+ return [null]
329
+ }
330
+
331
+
332
+ /***/ }),
333
+
334
+ /***/ 80:
335
+ /***/ ((module, __unused_webpack_exports, __nccwpck_require__) => {
336
+
337
+ /**
338
+ * Copyright (c) 2015-present, Facebook, Inc.
339
+ *
340
+ * This source code is licensed under the MIT license found in the
341
+ * LICENSE file at
342
+ * https://github.com/facebookincubator/create-react-app/blob/master/LICENSE
343
+ *
344
+ * Modified by Yuxi Evan You
345
+ */
346
+
347
+ const fs = __nccwpck_require__(147)
348
+ const os = __nccwpck_require__(37)
349
+ const path = __nccwpck_require__(17)
350
+ const colors = __nccwpck_require__(802)
351
+ const childProcess = __nccwpck_require__(81)
352
+
353
+ const guessEditor = __nccwpck_require__(841)
354
+ const getArgumentsForPosition = __nccwpck_require__(417)
355
+
356
+ function wrapErrorCallback (cb) {
357
+ return (fileName, errorMessage) => {
358
+ console.log()
359
+ console.log(
360
+ colors.red('Could not open ' + path.basename(fileName) + ' in the editor.')
361
+ )
362
+ if (errorMessage) {
363
+ if (errorMessage[errorMessage.length - 1] !== '.') {
364
+ errorMessage += '.'
365
+ }
366
+ console.log(
367
+ colors.red('The editor process exited with an error: ' + errorMessage)
368
+ )
369
+ }
370
+ console.log()
371
+ if (cb) cb(fileName, errorMessage)
372
+ }
373
+ }
374
+
375
+ function isTerminalEditor (editor) {
376
+ switch (editor) {
377
+ case 'vim':
378
+ case 'emacs':
379
+ case 'nano':
380
+ return true
381
+ }
382
+ return false
383
+ }
384
+
385
+ const positionRE = /:(\d+)(:(\d+))?$/
386
+ function parseFile (file) {
387
+ const fileName = file.replace(positionRE, '')
388
+ const match = file.match(positionRE)
389
+ const lineNumber = match && match[1]
390
+ const columnNumber = match && match[3]
391
+ return {
392
+ fileName,
393
+ lineNumber,
394
+ columnNumber
395
+ }
396
+ }
397
+
398
+ let _childProcess = null
399
+
400
+ function launchEditor (file, specifiedEditor, onErrorCallback) {
401
+ const parsed = parseFile(file)
402
+ let { fileName } = parsed
403
+ const { lineNumber, columnNumber } = parsed
404
+
405
+ if (!fs.existsSync(fileName)) {
406
+ return
407
+ }
408
+
409
+ if (typeof specifiedEditor === 'function') {
410
+ onErrorCallback = specifiedEditor
411
+ specifiedEditor = undefined
412
+ }
413
+
414
+ onErrorCallback = wrapErrorCallback(onErrorCallback)
415
+
416
+ const [editor, ...args] = guessEditor(specifiedEditor)
417
+ if (!editor) {
418
+ onErrorCallback(fileName, null)
419
+ return
420
+ }
421
+
422
+ if (
423
+ process.platform === 'linux' &&
424
+ fileName.startsWith('/mnt/') &&
425
+ /Microsoft/i.test(os.release())
426
+ ) {
427
+ // Assume WSL / "Bash on Ubuntu on Windows" is being used, and
428
+ // that the file exists on the Windows file system.
429
+ // `os.release()` is "4.4.0-43-Microsoft" in the current release
430
+ // build of WSL, see: https://github.com/Microsoft/BashOnWindows/issues/423#issuecomment-221627364
431
+ // When a Windows editor is specified, interop functionality can
432
+ // handle the path translation, but only if a relative path is used.
433
+ fileName = path.relative('', fileName)
434
+ }
435
+
436
+ if (lineNumber) {
437
+ const extraArgs = getArgumentsForPosition(editor, fileName, lineNumber, columnNumber)
438
+ args.push.apply(args, extraArgs)
439
+ } else {
440
+ args.push(fileName)
441
+ }
442
+
443
+ if (_childProcess && isTerminalEditor(editor)) {
444
+ // There's an existing editor process already and it's attached
445
+ // to the terminal, so go kill it. Otherwise two separate editor
446
+ // instances attach to the stdin/stdout which gets confusing.
447
+ _childProcess.kill('SIGKILL')
448
+ }
449
+
450
+ if (process.platform === 'win32') {
451
+ // On Windows, launch the editor in a shell because spawn can only
452
+ // launch .exe files.
453
+ _childProcess = childProcess.spawn(
454
+ 'cmd.exe',
455
+ ['/C', editor].concat(args),
456
+ { stdio: 'inherit' }
457
+ )
458
+ } else {
459
+ _childProcess = childProcess.spawn(editor, args, { stdio: 'inherit' })
460
+ }
461
+ _childProcess.on('exit', function (errorCode) {
462
+ _childProcess = null
463
+
464
+ if (errorCode) {
465
+ onErrorCallback(fileName, '(code ' + errorCode + ')')
466
+ }
467
+ })
468
+
469
+ _childProcess.on('error', function (error) {
470
+ onErrorCallback(fileName, error.message)
471
+ })
472
+ }
473
+
474
+ module.exports = launchEditor
475
+
476
+
477
+ /***/ }),
478
+
479
+ /***/ 522:
480
+ /***/ ((__unused_webpack_module, exports, __nccwpck_require__) => {
481
+
482
+ "use strict";
483
+
484
+
485
+ exports.quote = __nccwpck_require__(392);
486
+ exports.parse = __nccwpck_require__(145);
487
+
488
+
489
+ /***/ }),
490
+
491
+ /***/ 145:
492
+ /***/ ((module) => {
493
+
494
+ "use strict";
495
+
496
+
497
+ // '<(' is process substitution operator and
498
+ // can be parsed the same as control operator
499
+ var CONTROL = '(?:' + [
500
+ '\\|\\|',
501
+ '\\&\\&',
502
+ ';;',
503
+ '\\|\\&',
504
+ '\\<\\(',
505
+ '\\<\\<\\<',
506
+ '>>',
507
+ '>\\&',
508
+ '<\\&',
509
+ '[&;()|<>]'
510
+ ].join('|') + ')';
511
+ var controlRE = new RegExp('^' + CONTROL + '$');
512
+ var META = '|&;()<> \\t';
513
+ var SINGLE_QUOTE = '"((\\\\"|[^"])*?)"';
514
+ var DOUBLE_QUOTE = '\'((\\\\\'|[^\'])*?)\'';
515
+ var hash = /^#$/;
516
+
517
+ var SQ = "'";
518
+ var DQ = '"';
519
+ var DS = '$';
520
+
521
+ var TOKEN = '';
522
+ var mult = 0x100000000; // Math.pow(16, 8);
523
+ for (var i = 0; i < 4; i++) {
524
+ TOKEN += (mult * Math.random()).toString(16);
525
+ }
526
+ var startsWithToken = new RegExp('^' + TOKEN);
527
+
528
+ function matchAll(s, r) {
529
+ var origIndex = r.lastIndex;
530
+
531
+ var matches = [];
532
+ var matchObj;
533
+
534
+ while ((matchObj = r.exec(s))) {
535
+ matches.push(matchObj);
536
+ if (r.lastIndex === matchObj.index) {
537
+ r.lastIndex += 1;
538
+ }
539
+ }
540
+
541
+ r.lastIndex = origIndex;
542
+
543
+ return matches;
544
+ }
545
+
546
+ function getVar(env, pre, key) {
547
+ var r = typeof env === 'function' ? env(key) : env[key];
548
+ if (typeof r === 'undefined' && key != '') {
549
+ r = '';
550
+ } else if (typeof r === 'undefined') {
551
+ r = '$';
552
+ }
553
+
554
+ if (typeof r === 'object') {
555
+ return pre + TOKEN + JSON.stringify(r) + TOKEN;
556
+ }
557
+ return pre + r;
558
+ }
559
+
560
+ function parseInternal(string, env, opts) {
561
+ if (!opts) {
562
+ opts = {};
563
+ }
564
+ var BS = opts.escape || '\\';
565
+ var BAREWORD = '(\\' + BS + '[\'"' + META + ']|[^\\s\'"' + META + '])+';
566
+
567
+ var chunker = new RegExp([
568
+ '(' + CONTROL + ')', // control chars
569
+ '(' + BAREWORD + '|' + SINGLE_QUOTE + '|' + DOUBLE_QUOTE + ')+'
570
+ ].join('|'), 'g');
571
+
572
+ var matches = matchAll(string, chunker);
573
+
574
+ if (matches.length === 0) {
575
+ return [];
576
+ }
577
+ if (!env) {
578
+ env = {};
579
+ }
580
+
581
+ var commented = false;
582
+
583
+ return matches.map(function (match) {
584
+ var s = match[0];
585
+ if (!s || commented) {
586
+ return void undefined;
587
+ }
588
+ if (controlRE.test(s)) {
589
+ return { op: s };
590
+ }
591
+
592
+ // Hand-written scanner/parser for Bash quoting rules:
593
+ //
594
+ // 1. inside single quotes, all characters are printed literally.
595
+ // 2. inside double quotes, all characters are printed literally
596
+ // except variables prefixed by '$' and backslashes followed by
597
+ // either a double quote or another backslash.
598
+ // 3. outside of any quotes, backslashes are treated as escape
599
+ // characters and not printed (unless they are themselves escaped)
600
+ // 4. quote context can switch mid-token if there is no whitespace
601
+ // between the two quote contexts (e.g. all'one'"token" parses as
602
+ // "allonetoken")
603
+ var quote = false;
604
+ var esc = false;
605
+ var out = '';
606
+ var isGlob = false;
607
+ var i;
608
+
609
+ function parseEnvVar() {
610
+ i += 1;
611
+ var varend;
612
+ var varname;
613
+ var char = s.charAt(i);
614
+
615
+ if (char === '{') {
616
+ i += 1;
617
+ if (s.charAt(i) === '}') {
618
+ throw new Error('Bad substitution: ' + s.slice(i - 2, i + 1));
619
+ }
620
+ varend = s.indexOf('}', i);
621
+ if (varend < 0) {
622
+ throw new Error('Bad substitution: ' + s.slice(i));
623
+ }
624
+ varname = s.slice(i, varend);
625
+ i = varend;
626
+ } else if ((/[*@#?$!_-]/).test(char)) {
627
+ varname = char;
628
+ i += 1;
629
+ } else {
630
+ var slicedFromI = s.slice(i);
631
+ varend = slicedFromI.match(/[^\w\d_]/);
632
+ if (!varend) {
633
+ varname = slicedFromI;
634
+ i = s.length;
635
+ } else {
636
+ varname = slicedFromI.slice(0, varend.index);
637
+ i += varend.index - 1;
638
+ }
639
+ }
640
+ return getVar(env, '', varname);
641
+ }
642
+
643
+ for (i = 0; i < s.length; i++) {
644
+ var c = s.charAt(i);
645
+ isGlob = isGlob || (!quote && (c === '*' || c === '?'));
646
+ if (esc) {
647
+ out += c;
648
+ esc = false;
649
+ } else if (quote) {
650
+ if (c === quote) {
651
+ quote = false;
652
+ } else if (quote == SQ) {
653
+ out += c;
654
+ } else { // Double quote
655
+ if (c === BS) {
656
+ i += 1;
657
+ c = s.charAt(i);
658
+ if (c === DQ || c === BS || c === DS) {
659
+ out += c;
660
+ } else {
661
+ out += BS + c;
662
+ }
663
+ } else if (c === DS) {
664
+ out += parseEnvVar();
665
+ } else {
666
+ out += c;
667
+ }
668
+ }
669
+ } else if (c === DQ || c === SQ) {
670
+ quote = c;
671
+ } else if (controlRE.test(c)) {
672
+ return { op: s };
673
+ } else if (hash.test(c)) {
674
+ commented = true;
675
+ var commentObj = { comment: string.slice(match.index + i + 1) };
676
+ if (out.length) {
677
+ return [out, commentObj];
678
+ }
679
+ return [commentObj];
680
+ } else if (c === BS) {
681
+ esc = true;
682
+ } else if (c === DS) {
683
+ out += parseEnvVar();
684
+ } else {
685
+ out += c;
686
+ }
687
+ }
688
+
689
+ if (isGlob) {
690
+ return { op: 'glob', pattern: out };
691
+ }
692
+
693
+ return out;
694
+ }).reduce(function (prev, arg) { // finalize parsed arguments
695
+ // TODO: replace this whole reduce with a concat
696
+ return typeof arg === 'undefined' ? prev : prev.concat(arg);
697
+ }, []);
698
+ }
699
+
700
+ module.exports = function parse(s, env, opts) {
701
+ var mapped = parseInternal(s, env, opts);
702
+ if (typeof env !== 'function') {
703
+ return mapped;
704
+ }
705
+ return mapped.reduce(function (acc, s) {
706
+ if (typeof s === 'object') {
707
+ return acc.concat(s);
708
+ }
709
+ var xs = s.split(RegExp('(' + TOKEN + '.*?' + TOKEN + ')', 'g'));
710
+ if (xs.length === 1) {
711
+ return acc.concat(xs[0]);
712
+ }
713
+ return acc.concat(xs.filter(Boolean).map(function (x) {
714
+ if (startsWithToken.test(x)) {
715
+ return JSON.parse(x.split(TOKEN)[1]);
716
+ }
717
+ return x;
718
+ }));
719
+ }, []);
720
+ };
721
+
722
+
723
+ /***/ }),
724
+
725
+ /***/ 392:
726
+ /***/ ((module) => {
727
+
728
+ "use strict";
729
+
730
+
731
+ module.exports = function quote(xs) {
732
+ return xs.map(function (s) {
733
+ if (s && typeof s === 'object') {
734
+ return s.op.replace(/(.)/g, '\\$1');
735
+ }
736
+ if ((/["\s]/).test(s) && !(/'/).test(s)) {
737
+ return "'" + s.replace(/(['\\])/g, '\\$1') + "'";
738
+ }
739
+ if ((/["'\s]/).test(s)) {
740
+ return '"' + s.replace(/(["\\$`!])/g, '\\$1') + '"';
741
+ }
742
+ return String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, '$1\\$2');
743
+ }).join(' ');
744
+ };
745
+
746
+
747
+ /***/ }),
748
+
749
+ /***/ 802:
750
+ /***/ ((module) => {
751
+
752
+ "use strict";
753
+ module.exports = require("@rsbuild/shared/picocolors");
754
+
755
+ /***/ }),
756
+
757
+ /***/ 81:
758
+ /***/ ((module) => {
759
+
760
+ "use strict";
761
+ module.exports = require("child_process");
762
+
763
+ /***/ }),
764
+
765
+ /***/ 147:
766
+ /***/ ((module) => {
767
+
768
+ "use strict";
769
+ module.exports = require("fs");
770
+
771
+ /***/ }),
772
+
773
+ /***/ 37:
774
+ /***/ ((module) => {
775
+
776
+ "use strict";
777
+ module.exports = require("os");
778
+
779
+ /***/ }),
780
+
781
+ /***/ 17:
782
+ /***/ ((module) => {
783
+
784
+ "use strict";
785
+ module.exports = require("path");
786
+
787
+ /***/ }),
788
+
789
+ /***/ 310:
790
+ /***/ ((module) => {
791
+
792
+ "use strict";
793
+ module.exports = require("url");
794
+
795
+ /***/ })
796
+
797
+ /******/ });
798
+ /************************************************************************/
799
+ /******/ // The module cache
800
+ /******/ var __webpack_module_cache__ = {};
801
+ /******/
802
+ /******/ // The require function
803
+ /******/ function __nccwpck_require__(moduleId) {
804
+ /******/ // Check if module is in cache
805
+ /******/ var cachedModule = __webpack_module_cache__[moduleId];
806
+ /******/ if (cachedModule !== undefined) {
807
+ /******/ return cachedModule.exports;
808
+ /******/ }
809
+ /******/ // Create a new module (and put it into the cache)
810
+ /******/ var module = __webpack_module_cache__[moduleId] = {
811
+ /******/ // no module.id needed
812
+ /******/ // no module.loaded needed
813
+ /******/ exports: {}
814
+ /******/ };
815
+ /******/
816
+ /******/ // Execute the module function
817
+ /******/ var threw = true;
818
+ /******/ try {
819
+ /******/ __webpack_modules__[moduleId](module, module.exports, __nccwpck_require__);
820
+ /******/ threw = false;
821
+ /******/ } finally {
822
+ /******/ if(threw) delete __webpack_module_cache__[moduleId];
823
+ /******/ }
824
+ /******/
825
+ /******/ // Return the exports of the module
826
+ /******/ return module.exports;
827
+ /******/ }
828
+ /******/
829
+ /************************************************************************/
830
+ /******/ /* webpack/runtime/compat */
831
+ /******/
832
+ /******/ if (typeof __nccwpck_require__ !== 'undefined') __nccwpck_require__.ab = __dirname + "/";
833
+ /******/
834
+ /************************************************************************/
835
+ /******/
836
+ /******/ // startup
837
+ /******/ // Load entry module and return exports
838
+ /******/ // This entry module is referenced by other modules so it can't be inlined
839
+ /******/ var __webpack_exports__ = __nccwpck_require__(426);
840
+ /******/ module.exports = __webpack_exports__;
841
+ /******/
842
+ /******/ })()
843
+ ;