@rsbuild/core 2.1.7 → 2.1.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 (160) hide show
  1. package/compiled/cors/index.d.ts +1 -1
  2. package/compiled/css-loader/index.js +2 -2
  3. package/compiled/html-rspack-plugin/index.d.ts +1 -1
  4. package/compiled/html-rspack-plugin/index.js +14 -14
  5. package/compiled/postcss/index.js +1 -1
  6. package/compiled/postcss/lib/node.d.ts +2 -2
  7. package/compiled/postcss/package.json +1 -1
  8. package/compiled/postcss-loader/index.js +6 -6
  9. package/dist/{711.js → 626.js} +106 -84
  10. package/dist/build.d.ts +4 -0
  11. package/dist/chokidar.js +1 -1046
  12. package/{dist-types → dist}/cli/commands.d.ts +2 -2
  13. package/{dist-types → dist}/cli/init.d.ts +2 -2
  14. package/dist/client/hmr.js +1 -1
  15. package/dist/client/overlay.js +1 -1
  16. package/{dist-types → dist}/configChain.d.ts +2 -2
  17. package/dist/connect-next.js +1 -876
  18. package/dist/cors.js +1 -1
  19. package/{dist-types → dist}/createCompiler.d.ts +2 -2
  20. package/{dist-types → dist}/createContext.d.ts +3 -3
  21. package/{dist-types → dist}/createRsbuild.d.ts +1 -1
  22. package/{dist-types → dist}/defaultConfig.d.ts +1 -1
  23. package/{dist-types → dist}/helpers/compiler.d.ts +1 -1
  24. package/{dist-types → dist}/helpers/css.d.ts +1 -1
  25. package/{dist-types → dist}/helpers/format.d.ts +1 -1
  26. package/{dist-types → dist}/helpers/fs.d.ts +2 -2
  27. package/{dist-types → dist}/helpers/index.d.ts +4 -4
  28. package/{dist-types → dist}/helpers/overlayConfig.d.ts +1 -1
  29. package/{dist-types → dist}/helpers/path.d.ts +1 -1
  30. package/{dist-types → dist}/helpers/restartManager.d.ts +2 -2
  31. package/{dist-types → dist}/helpers/stats.d.ts +2 -2
  32. package/{dist-types → dist}/helpers/url.d.ts +2 -2
  33. package/{dist-types → dist}/helpers/vendors.d.ts +1 -1
  34. package/{dist-types → dist}/hooks.d.ts +1 -1
  35. package/dist/http-proxy-middleware.js +5 -3010
  36. package/{dist-types → dist}/index.d.ts +14 -14
  37. package/dist/index.js +1 -1
  38. package/{dist-types → dist}/initConfigs.d.ts +1 -1
  39. package/{dist-types → dist}/initPlugins.d.ts +2 -2
  40. package/{dist-types → dist}/inspectConfig.d.ts +2 -2
  41. package/dist/launch-editor-middleware.js +1 -544
  42. package/{dist-types → dist}/loadConfig.d.ts +6 -6
  43. package/{dist-types → dist}/loader/cssUrlLoader.d.ts +1 -1
  44. package/{dist-types → dist}/loader/ignoreCssLoader.d.ts +1 -1
  45. package/{dist-types → dist}/loader/transformLoader.d.ts +1 -1
  46. package/{dist-types → dist}/loader/transformRawLoader.d.ts +1 -1
  47. package/{dist-types → dist}/logger.d.ts +1 -1
  48. package/dist/manifest-plugin.js +1 -692
  49. package/dist/memfs.js +1 -5695
  50. package/{dist-types → dist}/mergeConfig.d.ts +1 -1
  51. package/dist/open.js +2 -439
  52. package/{dist-types → dist}/pluginHelper.d.ts +1 -1
  53. package/{dist-types → dist}/pluginManager.d.ts +2 -2
  54. package/{dist-types → dist}/plugins/appIcon.d.ts +1 -1
  55. package/{dist-types → dist}/plugins/asset.d.ts +1 -1
  56. package/{dist-types → dist}/plugins/basic.d.ts +1 -1
  57. package/dist/plugins/cache.d.ts +2 -0
  58. package/{dist-types → dist}/plugins/cleanOutput.d.ts +1 -1
  59. package/{dist-types → dist}/plugins/css.d.ts +1 -1
  60. package/{dist-types → dist}/plugins/define.d.ts +1 -1
  61. package/dist/plugins/entry.d.ts +2 -0
  62. package/{dist-types → dist}/plugins/externals.d.ts +2 -2
  63. package/{dist-types → dist}/plugins/fileSize.d.ts +1 -1
  64. package/{dist-types → dist}/plugins/html.d.ts +1 -1
  65. package/{dist-types → dist}/plugins/inlineChunk.d.ts +1 -1
  66. package/{dist-types → dist}/plugins/lazyCompilation.d.ts +1 -1
  67. package/{dist-types → dist}/plugins/manifest.d.ts +1 -1
  68. package/{dist-types → dist}/plugins/minimize.d.ts +2 -2
  69. package/{dist-types → dist}/plugins/moduleFederation.d.ts +1 -1
  70. package/{dist-types → dist}/plugins/nodeAddons.d.ts +1 -1
  71. package/dist/plugins/nonce.d.ts +2 -0
  72. package/{dist-types → dist}/plugins/output.d.ts +1 -1
  73. package/{dist-types → dist}/plugins/progress.d.ts +1 -1
  74. package/{dist-types → dist}/plugins/resolve.d.ts +1 -1
  75. package/{dist-types → dist}/plugins/resourceHints.d.ts +1 -1
  76. package/{dist-types → dist}/plugins/rsdoctor.d.ts +1 -1
  77. package/{dist-types → dist}/plugins/rspackProfile.d.ts +1 -1
  78. package/{dist-types → dist}/plugins/server.d.ts +1 -1
  79. package/{dist-types → dist}/plugins/sourceMap.d.ts +1 -1
  80. package/{dist-types → dist}/plugins/splitChunks.d.ts +1 -1
  81. package/dist/plugins/sri.d.ts +2 -0
  82. package/{dist-types → dist}/plugins/swc.d.ts +1 -1
  83. package/{dist-types → dist}/plugins/target.d.ts +1 -1
  84. package/dist/plugins/wasm.d.ts +2 -0
  85. package/{dist-types → dist}/plugins/worker.d.ts +1 -1
  86. package/dist/range-parser.js +1 -1
  87. package/dist/restart.d.ts +15 -0
  88. package/{dist-types → dist}/rspack-plugins/RsbuildHtmlPlugin.d.ts +1 -1
  89. package/{dist-types → dist}/rspack-plugins/resource-hints/HtmlResourceHintsPlugin.d.ts +1 -1
  90. package/{dist-types → dist}/rspack-plugins/resource-hints/doesChunkBelongToHtml.d.ts +1 -1
  91. package/{dist-types → dist}/rspack-plugins/resource-hints/extractChunks.d.ts +1 -1
  92. package/{dist-types → dist}/rspackConfig.d.ts +1 -1
  93. package/{dist-types → dist}/server/assets-middleware/getFileFromUrl.d.ts +1 -1
  94. package/{dist-types → dist}/server/assets-middleware/index.d.ts +2 -2
  95. package/{dist-types → dist}/server/assets-middleware/middleware.d.ts +1 -1
  96. package/{dist-types → dist}/server/assets-middleware/setupOutputFileSystem.d.ts +1 -1
  97. package/{dist-types → dist}/server/assets-middleware/setupWriteToDisk.d.ts +2 -2
  98. package/{dist-types → dist}/server/browserLogs.d.ts +1 -1
  99. package/{dist-types → dist}/server/buildManager.d.ts +3 -3
  100. package/{dist-types → dist}/server/cliShortcuts.d.ts +2 -2
  101. package/{dist-types → dist}/server/devMiddlewares.d.ts +4 -4
  102. package/{dist-types → dist}/server/devServer.d.ts +4 -4
  103. package/{dist-types → dist}/server/environment.d.ts +1 -1
  104. package/{dist-types → dist}/server/gzipMiddleware.d.ts +1 -1
  105. package/{dist-types → dist}/server/helper.d.ts +4 -4
  106. package/{dist-types → dist}/server/historyApiFallback.d.ts +2 -2
  107. package/{dist-types → dist}/server/httpServer.d.ts +1 -1
  108. package/{dist-types → dist}/server/middlewares.d.ts +2 -2
  109. package/{dist-types → dist}/server/open.d.ts +2 -2
  110. package/{dist-types → dist}/server/previewServer.d.ts +2 -2
  111. package/{dist-types → dist}/server/proxy.d.ts +3 -3
  112. package/{dist-types → dist}/server/runner/basic.d.ts +1 -1
  113. package/{dist-types → dist}/server/runner/cjs.d.ts +2 -2
  114. package/{dist-types → dist}/server/runner/esm.d.ts +2 -2
  115. package/{dist-types → dist}/server/runner/index.d.ts +1 -1
  116. package/{dist-types → dist}/server/serverSetup.d.ts +1 -1
  117. package/{dist-types → dist}/server/socketServer.d.ts +1 -1
  118. package/{dist-types → dist}/server/watchFiles.d.ts +4 -3
  119. package/dist/sirv.js +1 -1
  120. package/dist/tinyglobby.js +1 -1670
  121. package/{dist-types → dist}/types/config.d.ts +24 -15
  122. package/{dist-types → dist}/types/context.d.ts +9 -9
  123. package/{dist-types → dist}/types/hooks.d.ts +31 -15
  124. package/dist/types/index.d.ts +8 -0
  125. package/{dist-types → dist}/types/plugin.d.ts +7 -7
  126. package/{dist-types → dist}/types/rsbuild.d.ts +15 -14
  127. package/{dist-types → dist}/types/rspack.d.ts +2 -2
  128. package/{dist-types → dist}/types/thirdParty.d.ts +5 -5
  129. package/dist/ws.js +2 -1524
  130. package/package.json +9 -10
  131. package/dist-types/build.d.ts +0 -4
  132. package/dist-types/package.json +0 -1
  133. package/dist-types/plugins/cache.d.ts +0 -2
  134. package/dist-types/plugins/entry.d.ts +0 -2
  135. package/dist-types/plugins/nonce.d.ts +0 -2
  136. package/dist-types/plugins/sri.d.ts +0 -2
  137. package/dist-types/plugins/wasm.d.ts +0 -2
  138. package/dist-types/restart.d.ts +0 -14
  139. package/dist-types/types/index.d.ts +0 -8
  140. /package/dist/{711.js.LICENSE.txt → 626.js.LICENSE.txt} +0 -0
  141. /package/{dist-types → dist}/cli/index.d.ts +0 -0
  142. /package/dist/client/{307.js → 307~0.js} +0 -0
  143. /package/{dist-types → dist}/constants.d.ts +0 -0
  144. /package/{dist-types → dist}/helpers/exitHook.d.ts +0 -0
  145. /package/{dist-types → dist}/helpers/packageJson.d.ts +0 -0
  146. /package/{dist-types → dist}/helpers/version.d.ts +0 -0
  147. /package/{dist-types → dist}/loadEnv.d.ts +0 -0
  148. /package/{dist-types → dist}/loader/workerLoader.d.ts +0 -0
  149. /package/dist/{1~rslib-runtime.js → rslib-runtime.js} +0 -0
  150. /package/{dist-types → dist}/rspack-plugins/resource-hints/getResourceType.d.ts +0 -0
  151. /package/{dist-types → dist}/server/ansiHTML.d.ts +0 -0
  152. /package/{dist-types → dist}/server/assets-middleware/parseTokenList.d.ts +0 -0
  153. /package/{dist-types → dist}/server/compileState.d.ts +0 -0
  154. /package/{dist-types → dist}/server/gracefulShutdown.d.ts +0 -0
  155. /package/{dist-types → dist}/server/hmrFallback.d.ts +0 -0
  156. /package/{dist-types → dist}/server/overlay.d.ts +0 -0
  157. /package/{dist-types → dist}/server/publicPathnames.d.ts +0 -0
  158. /package/{dist-types → dist}/server/runner/asModule.d.ts +0 -0
  159. /package/{dist-types → dist}/server/runner/type.d.ts +0 -0
  160. /package/{dist-types → dist}/types/utils.d.ts +0 -0
@@ -1,544 +1 @@
1
- import { __webpack_require__ } from "./1~rslib-runtime.js";
2
- import "./711.js";
3
- __webpack_require__.add({
4
- "../../node_modules/.pnpm/launch-editor-middleware@2.14.1/node_modules/launch-editor-middleware/index.js" (module, __unused_rspack_exports, __webpack_require__) {
5
- let path = __webpack_require__("path?aeb1"), launch = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/index.js");
6
- module.exports = (specifiedEditor, srcRoot, onErrorCallback)=>('function' == typeof specifiedEditor && (onErrorCallback = specifiedEditor, specifiedEditor = void 0), 'function' == typeof srcRoot && (onErrorCallback = srcRoot, srcRoot = void 0), srcRoot = srcRoot || process.cwd(), function launchEditorMiddleware(req, res) {
7
- let url;
8
- try {
9
- let fullUrl = req.url.startsWith('http') ? req.url : `http://localhost${req.url}`;
10
- url = new URL(fullUrl);
11
- } catch (_err) {
12
- res.statusCode = 500, res.end("launch-editor-middleware: invalid URL.");
13
- return;
14
- }
15
- let file = url.searchParams.get('file');
16
- file ? (launch(file.startsWith('file://') ? file : path.resolve(srcRoot, file), specifiedEditor, onErrorCallback), res.end()) : (res.statusCode = 500, res.end('launch-editor-middleware: required query param "file" is missing.'));
17
- });
18
- },
19
- "../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/linux.js" (module) {
20
- module.exports = {
21
- atom: 'atom',
22
- Brackets: 'brackets',
23
- 'code-insiders': 'code-insiders',
24
- code: 'code',
25
- vscodium: 'vscodium',
26
- codium: 'codium',
27
- cursor: 'cursor',
28
- trae: 'trae',
29
- antigravity: 'antigravity',
30
- emacs: 'emacs',
31
- gvim: 'gvim',
32
- idea: 'idea',
33
- 'idea.sh': 'idea',
34
- phpstorm: 'phpstorm',
35
- 'phpstorm.sh': 'phpstorm',
36
- pycharm: 'pycharm',
37
- 'pycharm.sh': 'pycharm',
38
- rubymine: 'rubymine',
39
- 'rubymine.sh': 'rubymine',
40
- sublime_text: 'subl',
41
- vim: 'vim',
42
- webstorm: 'webstorm',
43
- 'webstorm.sh': 'webstorm',
44
- goland: 'goland',
45
- 'goland.sh': 'goland',
46
- rider: 'rider',
47
- 'rider.sh': 'rider',
48
- zed: 'zed'
49
- };
50
- },
51
- "../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/macos.js" (module) {
52
- module.exports = {
53
- '/Applications/Atom.app/Contents/MacOS/Atom': 'atom',
54
- '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta': '/Applications/Atom Beta.app/Contents/MacOS/Atom Beta',
55
- '/Applications/Brackets.app/Contents/MacOS/Brackets': 'brackets',
56
- '/Applications/Sublime Text.app/Contents/MacOS/Sublime Text': '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',
57
- '/Applications/Sublime Text.app/Contents/MacOS/sublime_text': '/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl',
58
- '/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2': '/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl',
59
- '/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text': '/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl',
60
- '/Applications/Visual Studio Code.app/Contents/MacOS/Code': 'code',
61
- '/Applications/Visual Studio Code.app/Contents/MacOS/Electron': 'code',
62
- '/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Code - Insiders': 'code-insiders',
63
- '/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron': 'code-insiders',
64
- '/Applications/VSCodium.app/Contents/MacOS/Electron': 'codium',
65
- '/Applications/Cursor.app/Contents/MacOS/Cursor': 'cursor',
66
- '/Applications/Trae.app/Contents/MacOS/Electron': 'trae',
67
- '/Applications/Antigravity.app/Contents/MacOS/Electron': 'antigravity',
68
- '/Applications/AppCode.app/Contents/MacOS/appcode': '/Applications/AppCode.app/Contents/MacOS/appcode',
69
- '/Applications/CLion.app/Contents/MacOS/clion': '/Applications/CLion.app/Contents/MacOS/clion',
70
- '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea': '/Applications/IntelliJ IDEA.app/Contents/MacOS/idea',
71
- '/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea': '/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea',
72
- '/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea': '/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea',
73
- '/Applications/PhpStorm.app/Contents/MacOS/phpstorm': '/Applications/PhpStorm.app/Contents/MacOS/phpstorm',
74
- '/Applications/PyCharm.app/Contents/MacOS/pycharm': '/Applications/PyCharm.app/Contents/MacOS/pycharm',
75
- '/Applications/PyCharm CE.app/Contents/MacOS/pycharm': '/Applications/PyCharm CE.app/Contents/MacOS/pycharm',
76
- '/Applications/RubyMine.app/Contents/MacOS/rubymine': '/Applications/RubyMine.app/Contents/MacOS/rubymine',
77
- '/Applications/WebStorm.app/Contents/MacOS/webstorm': '/Applications/WebStorm.app/Contents/MacOS/webstorm',
78
- '/Applications/MacVim.app/Contents/MacOS/MacVim': 'mvim',
79
- '/Applications/GoLand.app/Contents/MacOS/goland': '/Applications/GoLand.app/Contents/MacOS/goland',
80
- '/Applications/Rider.app/Contents/MacOS/rider': '/Applications/Rider.app/Contents/MacOS/rider',
81
- '/Applications/Zed.app/Contents/MacOS/zed': 'zed'
82
- };
83
- },
84
- "../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/windows.js" (module) {
85
- module.exports = [
86
- 'Brackets.exe',
87
- 'Code.exe',
88
- 'Code - Insiders.exe',
89
- 'VSCodium.exe',
90
- 'Cursor.exe',
91
- 'atom.exe',
92
- 'sublime_text.exe',
93
- 'notepad++.exe',
94
- 'clion.exe',
95
- 'clion64.exe',
96
- 'idea.exe',
97
- 'idea64.exe',
98
- 'phpstorm.exe',
99
- 'phpstorm64.exe',
100
- 'pycharm.exe',
101
- 'pycharm64.exe',
102
- 'rubymine.exe',
103
- 'rubymine64.exe',
104
- 'webstorm.exe',
105
- 'webstorm64.exe',
106
- 'goland.exe',
107
- 'goland64.exe',
108
- 'rider.exe',
109
- 'rider64.exe',
110
- 'Trae.exe',
111
- 'zed.exe',
112
- 'Antigravity.exe'
113
- ];
114
- },
115
- "../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/get-args.js" (module, __unused_rspack_exports, __webpack_require__) {
116
- let path = __webpack_require__("path?aeb1");
117
- module.exports = function getArgumentsForPosition(editor, fileName, lineNumber, columnNumber = 1) {
118
- switch(path.basename(editor).replace(/\.(exe|cmd|bat)$/i, '')){
119
- case 'atom':
120
- case 'Atom':
121
- case 'Atom Beta':
122
- case 'subl':
123
- case 'sublime':
124
- case 'sublime_text':
125
- case 'wstorm':
126
- case 'charm':
127
- case 'zed':
128
- return [
129
- `${fileName}:${lineNumber}:${columnNumber}`
130
- ];
131
- case 'notepad++':
132
- return [
133
- '-n' + lineNumber,
134
- '-c' + columnNumber,
135
- fileName
136
- ];
137
- case 'vim':
138
- case 'mvim':
139
- return [
140
- `+call cursor(${lineNumber}, ${columnNumber})`,
141
- fileName
142
- ];
143
- case 'joe':
144
- case 'gvim':
145
- return [
146
- `+${lineNumber}`,
147
- fileName
148
- ];
149
- case 'emacs':
150
- case 'emacsclient':
151
- return [
152
- `+${lineNumber}:${columnNumber}`,
153
- fileName
154
- ];
155
- case 'rmate':
156
- case 'mate':
157
- case 'mine':
158
- return [
159
- '--line',
160
- lineNumber,
161
- fileName
162
- ];
163
- case 'code':
164
- case 'Code':
165
- case 'code-insiders':
166
- case 'Code - Insiders':
167
- case 'codium':
168
- case 'trae':
169
- case 'antigravity':
170
- case 'cursor':
171
- case 'vscodium':
172
- case 'VSCodium':
173
- return [
174
- '-r',
175
- '-g',
176
- `${fileName}:${lineNumber}:${columnNumber}`
177
- ];
178
- case 'appcode':
179
- case 'clion':
180
- case 'clion64':
181
- case 'idea':
182
- case 'idea64':
183
- case 'phpstorm':
184
- case 'phpstorm64':
185
- case 'pycharm':
186
- case 'pycharm64':
187
- case 'rubymine':
188
- case 'rubymine64':
189
- case 'webstorm':
190
- case 'webstorm64':
191
- case 'goland':
192
- case 'goland64':
193
- case 'rider':
194
- case 'rider64':
195
- return [
196
- '--line',
197
- lineNumber,
198
- '--column',
199
- columnNumber,
200
- fileName
201
- ];
202
- }
203
- return process.env.LAUNCH_EDITOR ? [
204
- fileName,
205
- lineNumber,
206
- columnNumber
207
- ] : [
208
- fileName
209
- ];
210
- };
211
- },
212
- "../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/guess.js" (module, __unused_rspack_exports, __webpack_require__) {
213
- let path = __webpack_require__("path?aeb1"), shellQuote = __webpack_require__("../../node_modules/.pnpm/shell-quote@1.8.4/node_modules/shell-quote/index.js"), childProcess = __webpack_require__("child_process"), COMMON_EDITORS_MACOS = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/macos.js"), COMMON_EDITORS_LINUX = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/linux.js"), COMMON_EDITORS_WIN = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/windows.js");
214
- function getEditorFromMacProcesses(output) {
215
- let processNames = Object.keys(COMMON_EDITORS_MACOS), processList = output.split('\n');
216
- for(let i = 0; i < processNames.length; i++){
217
- let processName = processNames[i];
218
- if (processList.includes(processName)) return COMMON_EDITORS_MACOS[processName];
219
- let processNameWithoutApplications = processName.replace('/Applications', '');
220
- if (-1 !== output.indexOf(processNameWithoutApplications)) {
221
- if (processName !== COMMON_EDITORS_MACOS[processName]) return COMMON_EDITORS_MACOS[processName];
222
- let runningProcess = processList.find((procName)=>procName.endsWith(processNameWithoutApplications));
223
- if (void 0 !== runningProcess) return runningProcess;
224
- }
225
- }
226
- }
227
- function getEditorFromWindowsProcesses(output) {
228
- let runningProcesses = output.split('\r\n');
229
- for(let i = 0; i < runningProcesses.length; i++){
230
- let fullProcessPath = runningProcesses[i].trim(), shortProcessName = path.win32.basename(fullProcessPath);
231
- if (-1 !== COMMON_EDITORS_WIN.indexOf(shortProcessName)) return fullProcessPath;
232
- }
233
- }
234
- function getEditorFromLinuxProcesses(output) {
235
- let processNames = Object.keys(COMMON_EDITORS_LINUX);
236
- for(let i = 0; i < processNames.length; i++){
237
- let processName = processNames[i];
238
- if (-1 !== output.indexOf(processName)) return COMMON_EDITORS_LINUX[processName];
239
- }
240
- }
241
- module.exports = function guessEditor(specifiedEditor) {
242
- if (specifiedEditor) return shellQuote.parse(specifiedEditor);
243
- if (process.env.LAUNCH_EDITOR) return [
244
- process.env.LAUNCH_EDITOR
245
- ];
246
- if (process.versions.webcontainer) return [
247
- process.env.EDITOR || 'code'
248
- ];
249
- try {
250
- if ('darwin' === process.platform) {
251
- let output = childProcess.execSync('ps x -o comm=', {
252
- stdio: [
253
- 'pipe',
254
- 'pipe',
255
- 'ignore'
256
- ]
257
- }).toString(), editor = getEditorFromMacProcesses(output);
258
- if (void 0 !== editor) return [
259
- editor
260
- ];
261
- } else if ('win32' === process.platform) {
262
- let output = childProcess.execSync('powershell -NoProfile -Command "[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"', {
263
- stdio: [
264
- 'pipe',
265
- 'pipe',
266
- 'ignore'
267
- ]
268
- }).toString(), editor = getEditorFromWindowsProcesses(output);
269
- if (void 0 !== editor) return [
270
- editor
271
- ];
272
- } else if ('linux' === process.platform) {
273
- let output = childProcess.execSync('ps x --no-heading -o comm --sort=comm', {
274
- stdio: [
275
- 'pipe',
276
- 'pipe',
277
- 'ignore'
278
- ]
279
- }).toString(), editor = getEditorFromLinuxProcesses(output);
280
- if (void 0 !== editor) return [
281
- editor
282
- ];
283
- }
284
- } catch (ignoreError) {}
285
- return process.env.VISUAL ? [
286
- process.env.VISUAL
287
- ] : process.env.EDITOR ? [
288
- process.env.EDITOR
289
- ] : [
290
- null
291
- ];
292
- }, module.exports.getEditorFromMacProcesses = getEditorFromMacProcesses, module.exports.getEditorFromWindowsProcesses = getEditorFromWindowsProcesses, module.exports.getEditorFromLinuxProcesses = getEditorFromLinuxProcesses;
293
- },
294
- "../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/index.js" (module, __unused_rspack_exports, __webpack_require__) {
295
- let fs = __webpack_require__("fs?8b28"), os = __webpack_require__("os"), path = __webpack_require__("path?aeb1"), colors = __webpack_require__("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"), childProcess = __webpack_require__("child_process"), guessEditor = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/guess.js"), getArgumentsForPosition = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/get-args.js");
296
- function wrapErrorCallback(cb) {
297
- return (fileName, errorMessage)=>{
298
- console.log(), console.log(colors.red('Could not open ' + path.basename(fileName) + ' in the editor.')), errorMessage && ('.' !== errorMessage[errorMessage.length - 1] && (errorMessage += '.'), console.log(colors.red('The editor process exited with an error: ' + errorMessage))), console.log(), cb && cb(fileName, errorMessage);
299
- };
300
- }
301
- function isTerminalEditor(editor) {
302
- switch(editor){
303
- case 'vim':
304
- case 'emacs':
305
- case 'nano':
306
- return !0;
307
- }
308
- return !1;
309
- }
310
- let positionRE = /:(\d+)(:(\d+))?$/;
311
- function parseFile(file) {
312
- file.startsWith('file://') && (file = __webpack_require__("url?b918").fileURLToPath(file));
313
- let fileName = file.replace(positionRE, ''), match = file.match(positionRE);
314
- return {
315
- fileName,
316
- lineNumber: match && match[1],
317
- columnNumber: match && match[3]
318
- };
319
- }
320
- let currentChildProcess = null;
321
- module.exports = function launchEditor(file, specifiedEditor, onErrorCallback) {
322
- let parsed = parseFile(file), { fileName } = parsed, { lineNumber, columnNumber } = parsed;
323
- if ('win32' === process.platform && path.resolve(fileName).startsWith('\\\\')) return onErrorCallback(fileName, "UNC paths are not supported on Windows to avoid security issues. See https://github.com/vitejs/launch-editor/tree/main/packages/launch-editor#unc-paths-on-windows for details.");
324
- if (!fs.existsSync(fileName)) return;
325
- 'function' == typeof specifiedEditor && (onErrorCallback = specifiedEditor, specifiedEditor = void 0), onErrorCallback = wrapErrorCallback(onErrorCallback);
326
- let [editor, ...args] = guessEditor(specifiedEditor);
327
- if (!editor) return void onErrorCallback(fileName, null);
328
- if ('linux' === process.platform && fileName.startsWith('/mnt/') && /Microsoft/i.test(os.release()) && (fileName = path.relative('', fileName)), lineNumber) {
329
- let extraArgs = getArgumentsForPosition(editor, fileName, lineNumber, columnNumber);
330
- args.push.apply(args, extraArgs);
331
- } else args.push(fileName);
332
- if (currentChildProcess && isTerminalEditor(editor) && currentChildProcess.kill('SIGKILL'), 'win32' === process.platform) {
333
- function escapeCmdArgs(cmdArgs) {
334
- return cmdArgs.replace(/([&|<>,;=^])/g, '^$1');
335
- }
336
- function doubleQuoteIfNeeded(str) {
337
- return str.includes('^') ? `^"${str}^"` : str.includes(' ') ? `"${str}"` : str;
338
- }
339
- let launchCommand = [
340
- editor,
341
- ...args.map(escapeCmdArgs)
342
- ].map(doubleQuoteIfNeeded).join(' ');
343
- currentChildProcess = childProcess.exec(launchCommand, {
344
- stdio: 'inherit',
345
- shell: !0
346
- });
347
- } else currentChildProcess = childProcess.spawn(editor, args, {
348
- stdio: 'inherit'
349
- });
350
- currentChildProcess.on('exit', function(errorCode) {
351
- currentChildProcess = null, errorCode && onErrorCallback(fileName, '(code ' + errorCode + ')');
352
- }), currentChildProcess.on('error', function(error) {
353
- let { code, message } = error;
354
- 'ENOENT' === code && (message = `${message} ('${editor}' command does not exist in 'PATH')`), onErrorCallback(fileName, message);
355
- });
356
- };
357
- },
358
- "../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js" (module) {
359
- let p = process || {}, argv = p.argv || [], env = p.env || {}, isColorSupported = !(env.NO_COLOR || argv.includes("--no-color")) && (!!env.FORCE_COLOR || argv.includes("--color") || "win32" === p.platform || (p.stdout || {}).isTTY && "dumb" !== env.TERM || !!env.CI), formatter = (open, close, replace = open)=>(input)=>{
360
- let string = "" + input, index = string.indexOf(close, open.length);
361
- return ~index ? open + replaceClose(string, close, replace, index) + close : open + string + close;
362
- }, replaceClose = (string, close, replace, index)=>{
363
- let result = "", cursor = 0;
364
- do result += string.substring(cursor, index) + replace, cursor = index + close.length, index = string.indexOf(close, cursor);
365
- while (~index);
366
- return result + string.substring(cursor);
367
- }, createColors = (enabled = isColorSupported)=>{
368
- let f = enabled ? formatter : ()=>String;
369
- return {
370
- isColorSupported: enabled,
371
- reset: f("\x1b[0m", "\x1b[0m"),
372
- bold: f("\x1b[1m", "\x1b[22m", "\x1b[22m\x1b[1m"),
373
- dim: f("\x1b[2m", "\x1b[22m", "\x1b[22m\x1b[2m"),
374
- italic: f("\x1b[3m", "\x1b[23m"),
375
- underline: f("\x1b[4m", "\x1b[24m"),
376
- inverse: f("\x1b[7m", "\x1b[27m"),
377
- hidden: f("\x1b[8m", "\x1b[28m"),
378
- strikethrough: f("\x1b[9m", "\x1b[29m"),
379
- black: f("\x1b[30m", "\x1b[39m"),
380
- red: f("\x1b[31m", "\x1b[39m"),
381
- green: f("\x1b[32m", "\x1b[39m"),
382
- yellow: f("\x1b[33m", "\x1b[39m"),
383
- blue: f("\x1b[34m", "\x1b[39m"),
384
- magenta: f("\x1b[35m", "\x1b[39m"),
385
- cyan: f("\x1b[36m", "\x1b[39m"),
386
- white: f("\x1b[37m", "\x1b[39m"),
387
- gray: f("\x1b[90m", "\x1b[39m"),
388
- bgBlack: f("\x1b[40m", "\x1b[49m"),
389
- bgRed: f("\x1b[41m", "\x1b[49m"),
390
- bgGreen: f("\x1b[42m", "\x1b[49m"),
391
- bgYellow: f("\x1b[43m", "\x1b[49m"),
392
- bgBlue: f("\x1b[44m", "\x1b[49m"),
393
- bgMagenta: f("\x1b[45m", "\x1b[49m"),
394
- bgCyan: f("\x1b[46m", "\x1b[49m"),
395
- bgWhite: f("\x1b[47m", "\x1b[49m"),
396
- blackBright: f("\x1b[90m", "\x1b[39m"),
397
- redBright: f("\x1b[91m", "\x1b[39m"),
398
- greenBright: f("\x1b[92m", "\x1b[39m"),
399
- yellowBright: f("\x1b[93m", "\x1b[39m"),
400
- blueBright: f("\x1b[94m", "\x1b[39m"),
401
- magentaBright: f("\x1b[95m", "\x1b[39m"),
402
- cyanBright: f("\x1b[96m", "\x1b[39m"),
403
- whiteBright: f("\x1b[97m", "\x1b[39m"),
404
- bgBlackBright: f("\x1b[100m", "\x1b[49m"),
405
- bgRedBright: f("\x1b[101m", "\x1b[49m"),
406
- bgGreenBright: f("\x1b[102m", "\x1b[49m"),
407
- bgYellowBright: f("\x1b[103m", "\x1b[49m"),
408
- bgBlueBright: f("\x1b[104m", "\x1b[49m"),
409
- bgMagentaBright: f("\x1b[105m", "\x1b[49m"),
410
- bgCyanBright: f("\x1b[106m", "\x1b[49m"),
411
- bgWhiteBright: f("\x1b[107m", "\x1b[49m")
412
- };
413
- };
414
- module.exports = createColors(), module.exports.createColors = createColors;
415
- },
416
- "../../node_modules/.pnpm/shell-quote@1.8.4/node_modules/shell-quote/index.js" (__unused_rspack_module, exports, __webpack_require__) {
417
- __webpack_require__("../../node_modules/.pnpm/shell-quote@1.8.4/node_modules/shell-quote/quote.js"), exports.parse = __webpack_require__("../../node_modules/.pnpm/shell-quote@1.8.4/node_modules/shell-quote/parse.js");
418
- },
419
- "../../node_modules/.pnpm/shell-quote@1.8.4/node_modules/shell-quote/parse.js" (module) {
420
- for(var CONTROL = "(?:\\|\\||\\&\\&|;;|\\|\\&|\\<\\(|\\<\\<\\<|>>|>\\&|<\\&|[&;()|<>])", controlRE = RegExp('^' + CONTROL + '$'), META = '|&;()<> \\t', hash = /^#$/, TOKEN = '', i = 0; i < 4; i++)TOKEN += (0x100000000 * Math.random()).toString(16);
421
- var startsWithToken = RegExp('^' + TOKEN);
422
- function matchAll(s, r) {
423
- for(var matchObj, origIndex = r.lastIndex, matches = []; matchObj = r.exec(s);)matches.push(matchObj), r.lastIndex === matchObj.index && (r.lastIndex += 1);
424
- return r.lastIndex = origIndex, matches;
425
- }
426
- function getVar(env, pre, key) {
427
- var r = 'function' == typeof env ? env(key) : env[key];
428
- return (void 0 === r && '' != key ? r = '' : void 0 === r && (r = '$'), 'object' == typeof r) ? pre + TOKEN + JSON.stringify(r) + TOKEN : pre + r;
429
- }
430
- function parseInternal(string, env, opts) {
431
- opts || (opts = {});
432
- var BS = opts.escape || '\\', matches = matchAll(string, RegExp([
433
- '(' + CONTROL + ')',
434
- '(' + ('(\\' + BS + '[\'"' + META + ']|[^\\s\'"' + META) + "])+|\"((\\\\\"|[^\"])*?)\"|'((\\\\'|[^'])*?)')+"
435
- ].join('|'), 'g'));
436
- if (0 === matches.length) return [];
437
- env || (env = {});
438
- var commented = !1;
439
- return matches.map(function(match) {
440
- var i, s = match[0];
441
- if (s && !commented) {
442
- if (controlRE.test(s)) return {
443
- op: s
444
- };
445
- var quote = !1, esc = !1, out = '', isGlob = !1;
446
- for(i = 0; i < s.length; i++){
447
- var c = s.charAt(i);
448
- if (isGlob = isGlob || !quote && ('*' === c || '?' === c), esc) out += c, esc = !1;
449
- else if (quote) c === quote ? quote = !1 : "'" == quote ? out += c : c === BS ? (i += 1, '"' === (c = s.charAt(i)) || c === BS || '$' === c ? out += c : out += BS + c) : '$' === c ? out += parseEnvVar() : out += c;
450
- else if ('"' === c || "'" === c) quote = c;
451
- else if (controlRE.test(c)) return {
452
- op: s
453
- };
454
- else if (hash.test(c)) {
455
- commented = !0;
456
- var commentObj = {
457
- comment: string.slice(match.index + i + 1)
458
- };
459
- if (out.length) return [
460
- out,
461
- commentObj
462
- ];
463
- return [
464
- commentObj
465
- ];
466
- } else c === BS ? esc = !0 : '$' === c ? out += parseEnvVar() : out += c;
467
- }
468
- return isGlob ? {
469
- op: 'glob',
470
- pattern: out
471
- } : out;
472
- }
473
- function parseEnvVar() {
474
- i += 1;
475
- var varend, varname, char = s.charAt(i);
476
- if ('{' === char) {
477
- if (i += 1, '}' === s.charAt(i)) throw Error('Bad substitution: ' + s.slice(i - 2, i + 1));
478
- if ((varend = s.indexOf('}', i)) < 0) throw Error('Bad substitution: ' + s.slice(i));
479
- varname = s.slice(i, varend), i = varend;
480
- } else if (/[*@#?$!_-]/.test(char)) varname = char, i += 1;
481
- else {
482
- var slicedFromI = s.slice(i);
483
- (varend = slicedFromI.match(/[^\w\d_]/)) ? (varname = slicedFromI.slice(0, varend.index), i += varend.index - 1) : (varname = slicedFromI, i = s.length);
484
- }
485
- return getVar(env, '', varname);
486
- }
487
- }).reduce(function(prev, arg) {
488
- return void 0 === arg ? prev : prev.concat(arg);
489
- }, []);
490
- }
491
- module.exports = function parse(s, env, opts) {
492
- var mapped = parseInternal(s, env, opts);
493
- return 'function' != typeof env ? mapped : mapped.reduce(function(acc, s) {
494
- if ('object' == typeof s) return acc.concat(s);
495
- var xs = s.split(RegExp('(' + TOKEN + '.*?' + TOKEN + ')', 'g'));
496
- return 1 === xs.length ? acc.concat(xs[0]) : acc.concat(xs.filter(Boolean).map(function(x) {
497
- return startsWithToken.test(x) ? JSON.parse(x.split(TOKEN)[1]) : x;
498
- }));
499
- }, []);
500
- };
501
- },
502
- "../../node_modules/.pnpm/shell-quote@1.8.4/node_modules/shell-quote/quote.js" (module) {
503
- var OPS = [
504
- '||',
505
- '&&',
506
- ';;',
507
- '|&',
508
- '<(',
509
- '<<<',
510
- '>>',
511
- '>&',
512
- '<&',
513
- '&',
514
- ';',
515
- '(',
516
- ')',
517
- '|',
518
- '<',
519
- '>'
520
- ], LINE_TERMINATORS = /[\n\r\u2028\u2029]/, GLOB_SHELL_SPECIAL = /[\s#!"$&'():;<=>@\\^`|]/g;
521
- module.exports = function quote(xs) {
522
- return xs.map(function(s) {
523
- if ('' === s) return '\'\'';
524
- if (s && 'object' == typeof s) {
525
- if ('glob' === s.op) {
526
- if ('string' != typeof s.pattern) throw TypeError('glob token requires a string `pattern`');
527
- if (LINE_TERMINATORS.test(s.pattern)) throw TypeError('glob `pattern` must not contain line terminators');
528
- return s.pattern.replace(GLOB_SHELL_SPECIAL, '\\$&');
529
- }
530
- if ('string' == typeof s.op) {
531
- if (0 > OPS.indexOf(s.op)) throw TypeError('invalid `op` value: ' + JSON.stringify(s.op));
532
- return s.op.replace(/[\s\S]/g, '\\$&');
533
- }
534
- if ('string' == typeof s.comment) {
535
- if (LINE_TERMINATORS.test(s.comment)) throw TypeError('`comment` must not contain line terminators');
536
- return '#' + s.comment;
537
- }
538
- throw TypeError('unrecognized object token shape');
539
- }
540
- return /["\s\\]/.test(s) && !/'/.test(s) ? "'" + s.replace(/(['])/g, '\\$1') + "'" : /["'\s]/.test(s) ? '"' + s.replace(/(["\\$`!])/g, '\\$1') + '"' : String(s).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g, '$1\\$2');
541
- }).join(' ');
542
- };
543
- }
544
- }), __webpack_require__("../../node_modules/.pnpm/launch-editor-middleware@2.14.1/node_modules/launch-editor-middleware/index.js");
1
+ import{__webpack_require__ as e}from"./rslib-runtime.js";import"./626.js";e.add({"../../node_modules/.pnpm/launch-editor-middleware@2.14.1/node_modules/launch-editor-middleware/index.js"(e,t,o){let n=o("path?37f5"),i=o("../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/index.js");e.exports=(e,t,o)=>("function"==typeof e&&(o=e,e=void 0),"function"==typeof t&&(o=t,t=void 0),t=t||process.cwd(),function(r,s){let a;try{let e=r.url.startsWith("http")?r.url:`http://localhost${r.url}`;a=new URL(e)}catch(e){s.statusCode=500,s.end("launch-editor-middleware: invalid URL.");return}let p=a.searchParams.get("file");p?(i(p.startsWith("file://")?p:n.resolve(t,p),e,o),s.end()):(s.statusCode=500,s.end('launch-editor-middleware: required query param "file" is missing.'))})},"../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/linux.js"(e){e.exports={atom:"atom",Brackets:"brackets","code-insiders":"code-insiders",code:"code",vscodium:"vscodium",codium:"codium",cursor:"cursor",trae:"trae",antigravity:"antigravity",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",webstorm:"webstorm","webstorm.sh":"webstorm",goland:"goland","goland.sh":"goland",rider:"rider","rider.sh":"rider",zed:"zed"}},"../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/macos.js"(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/Code":"code","/Applications/Visual Studio Code.app/Contents/MacOS/Electron":"code","/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Code - Insiders":"code-insiders","/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron":"code-insiders","/Applications/VSCodium.app/Contents/MacOS/Electron":"codium","/Applications/Cursor.app/Contents/MacOS/Cursor":"cursor","/Applications/Trae.app/Contents/MacOS/Electron":"trae","/Applications/Antigravity.app/Contents/MacOS/Electron":"antigravity","/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/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea","/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea":"/Applications/IntelliJ IDEA Community Edition.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","/Applications/Zed.app/Contents/MacOS/zed":"zed"}},"../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/windows.js"(e){e.exports=["Brackets.exe","Code.exe","Code - Insiders.exe","VSCodium.exe","Cursor.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","Trae.exe","zed.exe","Antigravity.exe"]},"../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/get-args.js"(e,t,o){let n=o("path?37f5");e.exports=function(e,t,o,i=1){switch(n.basename(e).replace(/\.(exe|cmd|bat)$/i,"")){case"atom":case"Atom":case"Atom Beta":case"subl":case"sublime":case"sublime_text":case"wstorm":case"charm":case"zed":return[`${t}:${o}:${i}`];case"notepad++":return["-n"+o,"-c"+i,t];case"vim":case"mvim":return[`+call cursor(${o}, ${i})`,t];case"joe":case"gvim":return[`+${o}`,t];case"emacs":case"emacsclient":return[`+${o}:${i}`,t];case"rmate":case"mate":case"mine":return["--line",o,t];case"code":case"Code":case"code-insiders":case"Code - Insiders":case"codium":case"trae":case"antigravity":case"cursor":case"vscodium":case"VSCodium":return["-r","-g",`${t}:${o}:${i}`];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",o,"--column",i,t]}return process.env.LAUNCH_EDITOR?[t,o,i]:[t]}},"../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/guess.js"(e,t,o){let n=o("path?37f5"),i=o("../../node_modules/.pnpm/shell-quote@1.10.0/node_modules/shell-quote/index.js"),r=o("child_process"),s=o("../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/macos.js"),a=o("../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/linux.js"),p=o("../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/editor-info/windows.js");function l(e){let t=Object.keys(s),o=e.split("\n");for(let n=0;n<t.length;n++){let i=t[n];if(o.includes(i))return s[i];let r=i.replace("/Applications","");if(-1!==e.indexOf(r)){if(i!==s[i])return s[i];let e=o.find(e=>e.endsWith(r));if(void 0!==e)return e}}}function c(e){let t=e.split("\r\n");for(let e=0;e<t.length;e++){let o=t[e].trim(),i=n.win32.basename(o);if(-1!==p.indexOf(i))return o}}function d(e){let t=Object.keys(a);for(let o=0;o<t.length;o++){let n=t[o];if(-1!==e.indexOf(n))return a[n]}}e.exports=function(e){if(e)return i.parse(e);if(process.env.LAUNCH_EDITOR)return[process.env.LAUNCH_EDITOR];if(process.versions.webcontainer)return[process.env.EDITOR||"code"];try{if("darwin"===process.platform){let e=r.execSync("ps x -o comm=",{stdio:["pipe","pipe","ignore"]}).toString(),t=l(e);if(void 0!==t)return[t]}else if("win32"===process.platform){let e=r.execSync('powershell -NoProfile -Command "[Console]::OutputEncoding=[Text.Encoding]::UTF8;Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"',{stdio:["pipe","pipe","ignore"]}).toString(),t=c(e);if(void 0!==t)return[t]}else if("linux"===process.platform){let e=r.execSync("ps x --no-heading -o comm --sort=comm",{stdio:["pipe","pipe","ignore"]}).toString(),t=d(e);if(void 0!==t)return[t]}}catch(e){}return process.env.VISUAL?[process.env.VISUAL]:process.env.EDITOR?[process.env.EDITOR]:[null]},e.exports.getEditorFromMacProcesses=l,e.exports.getEditorFromWindowsProcesses=c,e.exports.getEditorFromLinuxProcesses=d},"../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/index.js"(e,t,o){let n=o("fs?cdbd"),i=o("os"),r=o("path?37f5"),s=o("../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"),a=o("child_process"),p=o("../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/guess.js"),l=o("../../node_modules/.pnpm/launch-editor@2.14.1/node_modules/launch-editor/get-args.js"),c=/:(\d+)(:(\d+))?$/,d=null;e.exports=function(e,t,m){var u,h;let x,b,f=((u=e).startsWith("file://")&&(u=o("url?5f07").fileURLToPath(u)),x=u.replace(c,""),{fileName:x,lineNumber:(b=u.match(c))&&b[1],columnNumber:b&&b[3]}),{fileName:g}=f,{lineNumber:C,columnNumber:S}=f;if("win32"===process.platform&&r.resolve(g).startsWith("\\\\"))return m(g,"UNC paths are not supported on Windows to avoid security issues. See https://github.com/vitejs/launch-editor/tree/main/packages/launch-editor#unc-paths-on-windows for details.");if(!n.existsSync(g))return;"function"==typeof t&&(m=t,t=void 0),h=m,m=(e,t)=>{console.log(),console.log(s.red("Could not open "+r.basename(e)+" in the editor.")),t&&("."!==t[t.length-1]&&(t+="."),console.log(s.red("The editor process exited with an error: "+t))),console.log(),h&&h(e,t)};let[A,...y]=p(t);if(!A)return void m(g,null);if("linux"===process.platform&&g.startsWith("/mnt/")&&/Microsoft/i.test(i.release())&&(g=r.relative("",g)),C){let e=l(A,g,C,S);y.push.apply(y,e)}else y.push(g);if(d&&function(e){switch(e){case"vim":case"emacs":case"nano":return!0}return!1}(A)&&d.kill("SIGKILL"),"win32"===process.platform){let e=[A,...y.map(function(e){return e.replace(/([&|<>,;=^])/g,"^$1")})].map(function(e){return e.includes("^")?`^"${e}^"`:e.includes(" ")?`"${e}"`:e}).join(" ");d=a.exec(e,{stdio:"inherit",shell:!0})}else d=a.spawn(A,y,{stdio:"inherit"});d.on("exit",function(e){d=null,e&&m(g,"(code "+e+")")}),d.on("error",function(e){let{code:t,message:o}=e;"ENOENT"===t&&(o=`${o} ('${A}' command does not exist in 'PATH')`),m(g,o)})}},"../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js"(e){let t=process||{},o=t.argv||[],n=t.env||{},i=!(n.NO_COLOR||o.includes("--no-color"))&&(!!n.FORCE_COLOR||o.includes("--color")||"win32"===t.platform||(t.stdout||{}).isTTY&&"dumb"!==n.TERM||!!n.CI),r=(e,t,o=e)=>n=>{let i=""+n,r=i.indexOf(t,e.length);return~r?e+s(i,t,o,r)+t:e+i+t},s=(e,t,o,n)=>{let i="",r=0;do i+=e.substring(r,n)+o,r=n+t.length,n=e.indexOf(t,r);while(~n);return i+e.substring(r)},a=(e=i)=>{let t=e?r:()=>String;return{isColorSupported:e,reset:t("\x1b[0m","\x1b[0m"),bold:t("\x1b[1m","\x1b[22m","\x1b[22m\x1b[1m"),dim:t("\x1b[2m","\x1b[22m","\x1b[22m\x1b[2m"),italic:t("\x1b[3m","\x1b[23m"),underline:t("\x1b[4m","\x1b[24m"),inverse:t("\x1b[7m","\x1b[27m"),hidden:t("\x1b[8m","\x1b[28m"),strikethrough:t("\x1b[9m","\x1b[29m"),black:t("\x1b[30m","\x1b[39m"),red:t("\x1b[31m","\x1b[39m"),green:t("\x1b[32m","\x1b[39m"),yellow:t("\x1b[33m","\x1b[39m"),blue:t("\x1b[34m","\x1b[39m"),magenta:t("\x1b[35m","\x1b[39m"),cyan:t("\x1b[36m","\x1b[39m"),white:t("\x1b[37m","\x1b[39m"),gray:t("\x1b[90m","\x1b[39m"),bgBlack:t("\x1b[40m","\x1b[49m"),bgRed:t("\x1b[41m","\x1b[49m"),bgGreen:t("\x1b[42m","\x1b[49m"),bgYellow:t("\x1b[43m","\x1b[49m"),bgBlue:t("\x1b[44m","\x1b[49m"),bgMagenta:t("\x1b[45m","\x1b[49m"),bgCyan:t("\x1b[46m","\x1b[49m"),bgWhite:t("\x1b[47m","\x1b[49m"),blackBright:t("\x1b[90m","\x1b[39m"),redBright:t("\x1b[91m","\x1b[39m"),greenBright:t("\x1b[92m","\x1b[39m"),yellowBright:t("\x1b[93m","\x1b[39m"),blueBright:t("\x1b[94m","\x1b[39m"),magentaBright:t("\x1b[95m","\x1b[39m"),cyanBright:t("\x1b[96m","\x1b[39m"),whiteBright:t("\x1b[97m","\x1b[39m"),bgBlackBright:t("\x1b[100m","\x1b[49m"),bgRedBright:t("\x1b[101m","\x1b[49m"),bgGreenBright:t("\x1b[102m","\x1b[49m"),bgYellowBright:t("\x1b[103m","\x1b[49m"),bgBlueBright:t("\x1b[104m","\x1b[49m"),bgMagentaBright:t("\x1b[105m","\x1b[49m"),bgCyanBright:t("\x1b[106m","\x1b[49m"),bgWhiteBright:t("\x1b[107m","\x1b[49m")}};e.exports=a(),e.exports.createColors=a},"../../node_modules/.pnpm/shell-quote@1.10.0/node_modules/shell-quote/index.js"(e,t,o){o("../../node_modules/.pnpm/shell-quote@1.10.0/node_modules/shell-quote/quote.js"),t.parse=o("../../node_modules/.pnpm/shell-quote@1.10.0/node_modules/shell-quote/parse.js")},"../../node_modules/.pnpm/shell-quote@1.10.0/node_modules/shell-quote/parse.js"(e){for(var t="(?:\\|\\||\\&\\&|;;|\\|\\&|\\<\\(|\\<\\<\\<|>>|>\\&|<\\&|[&;()|<>])",o=RegExp("^"+t+"$"),n="|&;()<> \\t",i=/^#$/,r="",s=0;s<4;s++)r+=(0x100000000*Math.random()).toString(16);var a=RegExp("^"+r);e.exports=function(e,s,p){var l=function(e,s,a){a||(a={});var p=a.escape||"\\",l=!0===a.splitUnquoted?" \n":"string"==typeof a.splitUnquoted?a.splitUnquoted:"",c=function(e,t){for(var o,n=t.lastIndex,i=[];o=t.exec(e);)i[i.length]=o,t.lastIndex===o.index&&(t.lastIndex+=1);return t.lastIndex=n,i}(e,RegExp(["("+t+")","("+("(\\"+p+"['\""+n+"]|[^\\s'\""+n)+'])+|"((\\\\"|[^"])*?)"|\'([^\']*?)\')+'].join("|"),"g"));if(0===c.length)return[];s||(s={});var d=!1;return c.map(function(t){var n,a=t[0];if(a&&!d){if(o.test(a))return{op:a};var c=!1,m=!1,u="",h=[],x=!1,b=null,f=!1;for(n=0;n<a.length;n++){var g=a.charAt(n);if(l&&"$"!==g&&O(),f=f||!c&&("*"===g||"?"===g),m)u+=g,m=!1;else if(c)g===c?c=!1:"'"==c?u+=g:g===p?(n+=1,'"'===(g=a.charAt(n))||g===p||"$"===g?u+=g:u+=p+g):"$"===g?u+=_():u+=g;else if('"'===g||"'"===g)c=g,x=!0;else if(o.test(g))return{op:a};else if(i.test(g)){d=!0;var C={comment:e.slice(t.index+n+1)};if(u.length)return[u,C];return[C]}else if(g===p)m=!0;else if("$"===g){var S=_();if(l)for(var A=0;A<S.length;A+=1){var y=S.charAt(A);0>l.indexOf(y)?(O(),u+=y):null===b?b=+(" "!==y&&" "!==y&&"\n"!==y):" "!==y&&" "!==y&&"\n"!==y&&(b+=1)}else u+=S}else u+=g}if(f)return{op:"glob",pattern:u};if(l){if(null!==b&&b>0){h[h.length]=u,u="";for(var v=1;v<b;v+=1)h[h.length]=""}return(""!==u||x&&0===h.length)&&(h[h.length]=u),h}return u}function _(){n+=1;var e,t,o,i,p,l=a.charAt(n);if("{"===l){if(n+=1,"}"===a.charAt(n))throw Error("Bad substitution: "+a.slice(n-2,n+1));var c=1;for(i=n;c>0&&i<a.length;)"{"===a.charAt(i)&&"$"===a.charAt(i-1)?c+=1:"}"===a.charAt(i)&&(c-=1),i+=1;if(0!==c)throw Error("Bad substitution: "+a.slice(n));i-=1,p=a.slice(n,i),n=i}else if(/[*@#?$!_-]/.test(l))p=l,n+=1;else{var d=a.slice(n);(i=d.match(/[^\w\d_]/))?(p=d.slice(0,i.index),n+=i.index-1):(p=d,n=a.length)}return e=s,t=p,(void 0===(o="function"==typeof e?e(t):e[t])&&""!=t?o="":void 0===o&&(o="$"),"object"==typeof o)?""+r+JSON.stringify(o)+r:""+o}function O(){if(null!==b){if(0===b)""!==u&&(h[h.length]=u,u="");else{h[h.length]=u,u="";for(var e=1;e<b;e+=1)h[h.length]=""}b=null}}}).reduce(function(e,t){return void 0===t||[].concat(t).forEach(function(t){e[e.length]=t}),e},[])}(e,s,p);return"function"!=typeof s?l:l.reduce(function(e,t){if("object"==typeof t)return e[e.length]=t,e;var o=t.split(RegExp("("+r+".*?"+r+")","g"));return 1===o.length?e[e.length]=o[0]:o.filter(Boolean).forEach(function(t){e[e.length]=a.test(t)?JSON.parse(t.split(r)[1]):t}),e},[])}},"../../node_modules/.pnpm/shell-quote@1.10.0/node_modules/shell-quote/quote.js"(e){var t=["||","&&",";;","|&","<(","<<<",">>",">&","<&","&",";","(",")","|","<",">"],o=/[\n\r\u2028\u2029]/,n=/[\s#!"$&'():;<=>@\\^`|]/g;e.exports=function(e){return e.map(function(e){if(""===e)return"''";if(e&&"object"==typeof e){if("op"in e&&"glob"===e.op){if("string"!=typeof e.pattern)throw TypeError("glob token requires a string `pattern`");if(o.test(e.pattern))throw TypeError("glob `pattern` must not contain line terminators");return e.pattern.replace(n,"\\$&")}if("op"in e&&"string"==typeof e.op){if(0>t.indexOf(e.op))throw TypeError("invalid `op` value: "+JSON.stringify(e.op));return e.op.replace(/[\s\S]/g,"\\$&")}if("comment"in e&&"string"==typeof e.comment){if(o.test(e.comment))throw TypeError("`comment` must not contain line terminators");return"#"+e.comment}throw TypeError("unrecognized object token shape")}return/["\s\\]/.test(e)&&!/'/.test(e)?"'"+e.replace(/(['])/g,"\\$1")+"'":/["'\s]/.test(e)?'"'+e.replace(/(["\\$`!])/g,"\\$1")+'"':String(e).replace(/([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}~])/g,"$1\\$2")}).join(" ")}}}),e("../../node_modules/.pnpm/launch-editor-middleware@2.14.1/node_modules/launch-editor-middleware/index.js");
@@ -1,6 +1,6 @@
1
- import { type LoadConfigOptions as BaseOptions, type LoadConfigResult as BaseResult } from '../compiled/@rstackjs/load-config';
2
- import type { RsbuildConfig } from './types';
3
- export type { ConfigLoader } from '../compiled/@rstackjs/load-config';
1
+ import { type LoadConfigOptions as BaseOptions, type LoadConfigResult as BaseResult } from '../compiled/@rstackjs/load-config/index.js';
2
+ import type { RsbuildConfig } from './types/index.js';
3
+ export type { ConfigLoader } from '../compiled/@rstackjs/load-config/index.js';
4
4
  export type ConfigParams = {
5
5
  env: string;
6
6
  command: string;
@@ -27,8 +27,8 @@ export type LoadConfigResult<Config = RsbuildConfig> = Pick<BaseResult<Config>,
27
27
  /**
28
28
  * This function helps you to autocomplete configuration types.
29
29
  * It accepts a Rsbuild config object, or a function that returns a config.
30
- */ export declare function defineConfig(config: RsbuildConfig): RsbuildConfig;
31
- export declare function defineConfig(config: RsbuildConfigSyncFn): RsbuildConfigSyncFn;
32
- export declare function defineConfig(config: RsbuildConfigAsyncFn): RsbuildConfigAsyncFn;
30
+ */ export declare function defineConfig<const Config extends RsbuildConfig>(config: (env: ConfigParams) => Config): RsbuildConfigSyncFn;
31
+ export declare function defineConfig<const Config extends RsbuildConfig>(config: (env: ConfigParams) => Promise<Config>): RsbuildConfigAsyncFn;
32
+ export declare function defineConfig(config: RsbuildConfig): RsbuildConfig;
33
33
  export declare function defineConfig(config: RsbuildConfigDefinition): RsbuildConfigDefinition;
34
34
  export declare function loadConfig<Config = RsbuildConfig>({ cwd, path, configFileNames, envMode, meta, loader, command, exportName }?: LoadConfigOptions): Promise<LoadConfigResult<Config>>;
@@ -1,5 +1,5 @@
1
1
  import type { AssetInfo, LoaderDefinitionFunction, PathData, PitchLoaderDefinitionFunction } from '@rspack/core';
2
- import type { CSSLoaderOptions } from '../types';
2
+ import type { CSSLoaderOptions } from '../types/index.js';
3
3
  type CSSUrlLoaderOptions = {
4
4
  filename: string | ((pathData: PathData, assetInfo?: AssetInfo) => string);
5
5
  modules: CSSLoaderOptions['modules'];
@@ -1,5 +1,5 @@
1
1
  import type { LoaderDefinition, PitchLoaderDefinitionFunction } from '@rspack/core';
2
- import type { CSSLoaderOptions } from '../types';
2
+ import type { CSSLoaderOptions } from '../types/index.js';
3
3
  type IgnoreCssLoaderOptions = {
4
4
  modules?: CSSLoaderOptions['modules'];
5
5
  };
@@ -1,5 +1,5 @@
1
1
  import type { LoaderDefinition } from '@rspack/core';
2
- import type { EnvironmentContext } from '../types';
2
+ import type { EnvironmentContext } from '../types/index.js';
3
3
  export type TransformLoaderOptions = {
4
4
  id: string;
5
5
  getEnvironment: () => EnvironmentContext;