@rsbuild/core 1.0.0 → 1.0.1-beta.0

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 (387) hide show
  1. package/README.md +1 -1
  2. package/bin/rsbuild.js +4 -2
  3. package/compiled/autoprefixer/index.d.ts +95 -0
  4. package/compiled/autoprefixer/index.js +7000 -0
  5. package/compiled/autoprefixer/license +20 -0
  6. package/compiled/autoprefixer/package.json +1 -0
  7. package/compiled/browserslist/index.d.ts +201 -0
  8. package/compiled/browserslist/index.js +1867 -0
  9. package/compiled/browserslist/license +20 -0
  10. package/compiled/browserslist/package.json +1 -0
  11. package/compiled/chokidar/index.d.ts +198 -0
  12. package/compiled/chokidar/index.js +5139 -0
  13. package/compiled/chokidar/license +21 -0
  14. package/compiled/chokidar/package.json +1 -0
  15. package/compiled/commander/{typings/index.d.ts → index.d.ts} +184 -102
  16. package/compiled/commander/index.js +2190 -1
  17. package/compiled/commander/package.json +1 -1
  18. package/compiled/connect/index.d.ts +90 -0
  19. package/compiled/connect/index.js +1240 -0
  20. package/compiled/connect/license +25 -0
  21. package/compiled/connect/package.json +1 -0
  22. package/compiled/connect-history-api-fallback/index.js +149 -1
  23. package/compiled/connect-history-api-fallback/package.json +1 -1
  24. package/compiled/css-loader/api.js +85 -0
  25. package/compiled/css-loader/getUrl.js +26 -0
  26. package/compiled/css-loader/index.d.ts +1 -0
  27. package/compiled/css-loader/index.js +7541 -0
  28. package/compiled/css-loader/license +20 -0
  29. package/compiled/css-loader/noSourceMaps.js +5 -0
  30. package/compiled/css-loader/package.json +1 -0
  31. package/compiled/css-loader/semver.js +1 -0
  32. package/compiled/css-loader/sourceMaps.js +16 -0
  33. package/compiled/dotenv/{lib/main.d.ts → index.d.ts} +25 -24
  34. package/compiled/dotenv/index.js +336 -1
  35. package/compiled/dotenv/package.json +1 -1
  36. package/compiled/dotenv-expand/index.d.ts +52 -0
  37. package/compiled/dotenv-expand/index.js +105 -1
  38. package/compiled/dotenv-expand/package.json +1 -1
  39. package/compiled/html-rspack-plugin/default_index.ejs +9 -0
  40. package/compiled/html-rspack-plugin/index.d.ts +284 -0
  41. package/compiled/html-rspack-plugin/index.js +1574 -0
  42. package/compiled/html-rspack-plugin/license +20 -0
  43. package/compiled/html-rspack-plugin/loader.js +173 -0
  44. package/compiled/html-rspack-plugin/package.json +1 -0
  45. package/compiled/http-compression/index.js +134 -1
  46. package/compiled/http-compression/package.json +1 -1
  47. package/compiled/http-proxy-middleware/index.d.ts +315 -0
  48. package/compiled/http-proxy-middleware/index.js +5251 -0
  49. package/compiled/http-proxy-middleware/license +22 -0
  50. package/compiled/http-proxy-middleware/package.json +1 -0
  51. package/compiled/jiti/index.d.ts +1 -0
  52. package/compiled/jiti/index.js +254 -1748
  53. package/compiled/jiti/package.json +1 -1
  54. package/compiled/launch-editor-middleware/index.d.ts +1 -0
  55. package/compiled/launch-editor-middleware/index.js +696 -0
  56. package/compiled/launch-editor-middleware/license +21 -0
  57. package/compiled/launch-editor-middleware/package.json +1 -0
  58. package/compiled/on-finished/index.d.ts +13 -0
  59. package/compiled/on-finished/index.js +197 -0
  60. package/compiled/on-finished/license +23 -0
  61. package/compiled/on-finished/package.json +1 -0
  62. package/compiled/open/index.d.ts +1 -153
  63. package/compiled/open/index.js +409 -1
  64. package/compiled/open/package.json +1 -1
  65. package/compiled/picocolors/index.d.ts +34 -0
  66. package/compiled/picocolors/index.js +97 -0
  67. package/compiled/picocolors/license +15 -0
  68. package/compiled/picocolors/package.json +1 -0
  69. package/compiled/postcss-load-config/index.d.ts +1 -0
  70. package/compiled/postcss-load-config/index.js +751 -0
  71. package/compiled/postcss-load-config/license +20 -0
  72. package/compiled/postcss-load-config/package.json +1 -0
  73. package/compiled/postcss-loader/index.d.ts +1 -0
  74. package/compiled/postcss-loader/index.js +8423 -0
  75. package/compiled/postcss-loader/license +20 -0
  76. package/compiled/postcss-loader/package.json +1 -0
  77. package/compiled/postcss-loader/semver.js +1 -0
  78. package/compiled/postcss-value-parser/index.d.ts +1 -0
  79. package/compiled/postcss-value-parser/index.js +495 -0
  80. package/compiled/postcss-value-parser/license +22 -0
  81. package/compiled/postcss-value-parser/package.json +1 -0
  82. package/compiled/rslog/index.d.ts +66 -0
  83. package/compiled/rslog/index.js +334 -0
  84. package/compiled/rslog/license +21 -0
  85. package/compiled/rslog/package.json +1 -0
  86. package/compiled/rspack-chain/index.d.ts +601 -0
  87. package/compiled/rspack-chain/index.js +1702 -0
  88. package/compiled/rspack-chain/license +373 -0
  89. package/compiled/rspack-chain/package.json +1 -0
  90. package/compiled/rspack-manifest-plugin/index.d.ts +1 -0
  91. package/compiled/rspack-manifest-plugin/index.js +5884 -0
  92. package/compiled/rspack-manifest-plugin/license +21 -0
  93. package/compiled/rspack-manifest-plugin/package.json +1 -0
  94. package/compiled/sirv/index.d.ts +1 -0
  95. package/compiled/sirv/index.js +701 -1
  96. package/compiled/sirv/package.json +1 -1
  97. package/compiled/style-loader/index.d.ts +1 -0
  98. package/compiled/style-loader/index.js +427 -0
  99. package/compiled/style-loader/license +20 -0
  100. package/compiled/style-loader/package.json +1 -0
  101. package/compiled/style-loader/runtime/injectStylesIntoLinkTag.js +29 -0
  102. package/compiled/style-loader/runtime/injectStylesIntoStyleTag.js +84 -0
  103. package/compiled/style-loader/runtime/insertBySelector.js +34 -0
  104. package/compiled/style-loader/runtime/insertStyleElement.js +10 -0
  105. package/compiled/style-loader/runtime/isEqualLocals.js +28 -0
  106. package/compiled/style-loader/runtime/isOldIE.js +17 -0
  107. package/compiled/style-loader/runtime/setAttributesWithAttributes.js +13 -0
  108. package/compiled/style-loader/runtime/setAttributesWithAttributesAndNonce.js +9 -0
  109. package/compiled/style-loader/runtime/setAttributesWithoutAttributes.js +10 -0
  110. package/compiled/style-loader/runtime/singletonStyleDomAPI.js +86 -0
  111. package/compiled/style-loader/runtime/styleDomAPI.js +61 -0
  112. package/compiled/style-loader/runtime/styleTagTransform.js +14 -0
  113. package/compiled/webpack-bundle-analyzer/index.d.ts +160 -0
  114. package/compiled/webpack-bundle-analyzer/index.js +13352 -0
  115. package/compiled/webpack-bundle-analyzer/license +20 -0
  116. package/compiled/webpack-bundle-analyzer/package.json +1 -0
  117. package/compiled/webpack-bundle-analyzer/public/viewer.js +16 -0
  118. package/compiled/webpack-bundle-analyzer/public/viewer.js.LICENSE.txt +10 -0
  119. package/compiled/webpack-dev-middleware/index.d.ts +1 -0
  120. package/compiled/webpack-dev-middleware/index.js +5672 -0
  121. package/compiled/webpack-dev-middleware/license +20 -0
  122. package/compiled/webpack-dev-middleware/package.json +1 -0
  123. package/compiled/webpack-dev-middleware/schema-utils.js +1 -0
  124. package/compiled/webpack-merge/index.d.ts +31 -0
  125. package/compiled/webpack-merge/index.js +1200 -0
  126. package/compiled/webpack-merge/license +20 -0
  127. package/compiled/webpack-merge/package.json +1 -0
  128. package/compiled/ws/index.d.ts +402 -0
  129. package/compiled/ws/index.js +3153 -0
  130. package/compiled/ws/license +20 -0
  131. package/compiled/ws/package.json +1 -0
  132. package/dist/client/hmr.js +249 -405
  133. package/dist/client/overlay.js +221 -0
  134. package/dist/{rspack-provider/plugins/basic.js → ignoreCssLoader.cjs} +12 -14
  135. package/dist/index.cjs +9004 -0
  136. package/dist/index.js +9075 -16
  137. package/dist/transformLoader.cjs +54 -0
  138. package/dist/transformRawLoader.cjs +65 -0
  139. package/dist-types/cli/commands.d.ts +20 -0
  140. package/dist-types/cli/init.d.ts +6 -0
  141. package/dist-types/cli/prepare.d.ts +1 -0
  142. package/dist-types/client/format.d.ts +5 -0
  143. package/dist-types/client/hmr.d.ts +1 -0
  144. package/dist-types/client/overlay.d.ts +1 -0
  145. package/dist-types/config.d.ts +63 -0
  146. package/dist-types/configChain.d.ts +162 -0
  147. package/dist-types/constants.d.ts +32 -0
  148. package/dist-types/createContext.d.ts +11 -0
  149. package/dist-types/createRsbuild.d.ts +2 -0
  150. package/dist-types/helpers/path.d.ts +10 -0
  151. package/dist-types/helpers.d.ts +57 -0
  152. package/dist-types/index.d.ts +24 -0
  153. package/dist-types/initHooks.d.ts +23 -0
  154. package/dist-types/initPlugins.d.ts +6 -0
  155. package/dist-types/internal.d.ts +20 -0
  156. package/dist-types/loadEnv.d.ts +27 -0
  157. package/dist-types/loader/ignoreCssLoader.d.ts +2 -0
  158. package/dist-types/loader/transformLoader.d.ts +5 -0
  159. package/dist-types/loader/transformRawLoader.d.ts +3 -0
  160. package/dist-types/logger.d.ts +4 -0
  161. package/dist-types/mergeConfig.d.ts +2 -0
  162. package/dist-types/package.json +1 -0
  163. package/dist-types/pluginHelper.d.ts +12 -0
  164. package/dist-types/pluginManager.d.ts +7 -0
  165. package/{dist → dist-types}/plugins/asset.d.ts +1 -1
  166. package/dist-types/plugins/basic.d.ts +5 -0
  167. package/dist-types/plugins/bundleAnalyzer.d.ts +2 -0
  168. package/dist-types/plugins/cache.d.ts +2 -0
  169. package/dist-types/plugins/cleanOutput.d.ts +2 -0
  170. package/dist-types/plugins/css.d.ts +10 -0
  171. package/dist-types/plugins/define.d.ts +2 -0
  172. package/dist-types/plugins/entry.d.ts +2 -0
  173. package/dist-types/plugins/externals.d.ts +2 -0
  174. package/{dist → dist-types}/plugins/fileSize.d.ts +1 -1
  175. package/dist-types/plugins/html.d.ts +9 -0
  176. package/dist-types/plugins/inlineChunk.d.ts +2 -0
  177. package/dist-types/plugins/lazyCompilation.d.ts +2 -0
  178. package/dist-types/plugins/manifest.d.ts +2 -0
  179. package/dist-types/plugins/minimize.d.ts +10 -0
  180. package/dist-types/plugins/moduleFederation.d.ts +2 -0
  181. package/dist-types/plugins/moment.d.ts +2 -0
  182. package/dist-types/plugins/nodeAddons.d.ts +2 -0
  183. package/dist-types/plugins/nonce.d.ts +2 -0
  184. package/{dist/plugins/startUrl.d.ts → dist-types/plugins/open.d.ts} +2 -1
  185. package/dist-types/plugins/output.d.ts +2 -0
  186. package/{dist → dist-types}/plugins/performance.d.ts +1 -1
  187. package/dist-types/plugins/progress.d.ts +2 -0
  188. package/dist-types/plugins/resolve.d.ts +2 -0
  189. package/dist-types/plugins/resourceHints.d.ts +2 -0
  190. package/dist-types/plugins/rsdoctor.d.ts +2 -0
  191. package/dist-types/plugins/rspackProfile.d.ts +2 -0
  192. package/dist-types/plugins/server.d.ts +2 -0
  193. package/dist-types/plugins/splitChunks.d.ts +4 -0
  194. package/dist-types/plugins/sri.d.ts +2 -0
  195. package/dist-types/plugins/swc.d.ts +7 -0
  196. package/dist-types/plugins/target.d.ts +2 -0
  197. package/dist-types/plugins/wasm.d.ts +2 -0
  198. package/dist-types/provider/build.d.ts +3 -0
  199. package/dist-types/provider/createCompiler.d.ts +33 -0
  200. package/dist-types/provider/initConfigs.d.ts +10 -0
  201. package/dist-types/provider/inspectConfig.d.ts +6 -0
  202. package/dist-types/provider/provider.d.ts +2 -0
  203. package/dist-types/provider/rspackConfig.d.ts +8 -0
  204. package/dist-types/rspack/HtmlAppIconPlugin.d.ts +13 -0
  205. package/dist-types/rspack/HtmlBasicPlugin.d.ts +37 -0
  206. package/dist-types/rspack/InlineChunkHtmlPlugin.d.ts +29 -0
  207. package/dist-types/rspack/preload/HtmlPreloadOrPrefetchPlugin.d.ts +29 -0
  208. package/dist-types/rspack/preload/helpers/determineAsValue.d.ts +22 -0
  209. package/dist-types/rspack/preload/helpers/doesChunkBelongToHtml.d.ts +29 -0
  210. package/dist-types/rspack/preload/helpers/extractChunks.d.ts +28 -0
  211. package/dist-types/rspack/preload/helpers/index.d.ts +4 -0
  212. package/dist-types/rspack/preload/helpers/type.d.ts +13 -0
  213. package/dist-types/server/compilerDevMiddleware.d.ts +30 -0
  214. package/dist-types/server/devMiddleware.d.ts +39 -0
  215. package/dist-types/server/devServer.d.ts +50 -0
  216. package/dist-types/server/environment.d.ts +7 -0
  217. package/dist-types/server/getDevMiddlewares.d.ts +25 -0
  218. package/dist-types/server/helper.d.ts +59 -0
  219. package/dist-types/server/httpServer.d.ts +8 -0
  220. package/dist-types/server/middlewares.d.ts +22 -0
  221. package/dist-types/server/prodServer.d.ts +25 -0
  222. package/dist-types/server/proxy.d.ts +6 -0
  223. package/dist-types/server/restart.d.ts +9 -0
  224. package/dist-types/server/runner/asModule.d.ts +2 -0
  225. package/dist-types/server/runner/basic.d.ts +25 -0
  226. package/dist-types/server/runner/cjs.d.ts +10 -0
  227. package/dist-types/server/runner/esm.d.ts +6 -0
  228. package/dist-types/server/runner/index.d.ts +8 -0
  229. package/dist-types/server/runner/type.d.ts +36 -0
  230. package/dist-types/server/socketServer.d.ts +22 -0
  231. package/dist-types/server/watchFiles.d.ts +11 -0
  232. package/dist-types/types/config/dev.d.ts +88 -0
  233. package/dist-types/types/config/html.d.ts +107 -0
  234. package/dist-types/types/config/index.d.ts +134 -0
  235. package/dist-types/types/config/output.d.ts +297 -0
  236. package/dist-types/types/config/performance.d.ts +123 -0
  237. package/dist-types/types/config/security.d.ts +18 -0
  238. package/dist-types/types/config/server.d.ts +106 -0
  239. package/dist-types/types/config/source.d.ts +79 -0
  240. package/dist-types/types/config/tools.d.ts +85 -0
  241. package/dist-types/types/context.d.ts +38 -0
  242. package/dist-types/types/hooks.d.ts +125 -0
  243. package/dist-types/types/index.d.ts +9 -0
  244. package/dist-types/types/plugin.d.ts +197 -0
  245. package/dist-types/types/rsbuild.d.ts +109 -0
  246. package/dist-types/types/rspack.d.ts +28 -0
  247. package/dist-types/types/stats.d.ts +17 -0
  248. package/dist-types/types/thirdParty.d.ts +168 -0
  249. package/dist-types/types/utils.d.ts +13 -0
  250. package/package.json +73 -43
  251. package/types.d.ts +36 -4
  252. package/compiled/dotenv-expand/lib/main.d.ts +0 -29
  253. package/compiled/jiti/types/jiti.d.ts +0 -19
  254. package/compiled/jiti/types/types.d.ts +0 -31
  255. package/compiled/open/license +0 -9
  256. package/compiled/sirv/sirv.d.ts +0 -27
  257. package/dist/cli/commands.d.ts +0 -20
  258. package/dist/cli/commands.js +0 -131
  259. package/dist/cli/config.d.ts +0 -9
  260. package/dist/cli/config.js +0 -110
  261. package/dist/cli/prepare.d.ts +0 -1
  262. package/dist/cli/prepare.js +0 -43
  263. package/dist/client/hmr/createSocketUrl.d.ts +0 -16
  264. package/dist/client/hmr/index.d.ts +0 -1
  265. package/dist/createRsbuild.d.ts +0 -10
  266. package/dist/createRsbuild.js +0 -100
  267. package/dist/index.d.ts +0 -10
  268. package/dist/loadEnv.d.ts +0 -5
  269. package/dist/loadEnv.js +0 -58
  270. package/dist/plugins/asset.js +0 -73
  271. package/dist/plugins/bundleAnalyzer.d.ts +0 -2
  272. package/dist/plugins/bundleAnalyzer.js +0 -59
  273. package/dist/plugins/cache.d.ts +0 -2
  274. package/dist/plugins/cache.js +0 -112
  275. package/dist/plugins/cleanOutput.d.ts +0 -2
  276. package/dist/plugins/cleanOutput.js +0 -47
  277. package/dist/plugins/define.d.ts +0 -2
  278. package/dist/plugins/define.js +0 -47
  279. package/dist/plugins/devtool.d.ts +0 -2
  280. package/dist/plugins/devtool.js +0 -46
  281. package/dist/plugins/entry.d.ts +0 -2
  282. package/dist/plugins/entry.js +0 -53
  283. package/dist/plugins/externals.d.ts +0 -2
  284. package/dist/plugins/externals.js +0 -48
  285. package/dist/plugins/fileSize.js +0 -158
  286. package/dist/plugins/html.d.ts +0 -15
  287. package/dist/plugins/html.js +0 -270
  288. package/dist/plugins/index.d.ts +0 -2
  289. package/dist/plugins/index.js +0 -61
  290. package/dist/plugins/inlineChunk.d.ts +0 -2
  291. package/dist/plugins/inlineChunk.js +0 -76
  292. package/dist/plugins/moment.d.ts +0 -2
  293. package/dist/plugins/moment.js +0 -68
  294. package/dist/plugins/networkPerformance.d.ts +0 -2
  295. package/dist/plugins/networkPerformance.js +0 -58
  296. package/dist/plugins/nodeAddons.d.ts +0 -2
  297. package/dist/plugins/nodeAddons.js +0 -70
  298. package/dist/plugins/performance.js +0 -63
  299. package/dist/plugins/preloadOrPrefetch.d.ts +0 -2
  300. package/dist/plugins/preloadOrPrefetch.js +0 -61
  301. package/dist/plugins/splitChunks.d.ts +0 -2
  302. package/dist/plugins/splitChunks.js +0 -228
  303. package/dist/plugins/startUrl.js +0 -148
  304. package/dist/plugins/target.d.ts +0 -2
  305. package/dist/plugins/target.js +0 -53
  306. package/dist/plugins/toml.d.ts +0 -2
  307. package/dist/plugins/toml.js +0 -36
  308. package/dist/plugins/wasm.d.ts +0 -2
  309. package/dist/plugins/wasm.js +0 -51
  310. package/dist/plugins/yaml.d.ts +0 -2
  311. package/dist/plugins/yaml.js +0 -36
  312. package/dist/rspack-plugins/HtmlBasicPlugin.d.ts +0 -19
  313. package/dist/rspack-plugins/HtmlBasicPlugin.js +0 -87
  314. package/dist/rspack-plugins/RemoveCssSourcemapPlugin.d.ts +0 -8
  315. package/dist/rspack-plugins/RemoveCssSourcemapPlugin.js +0 -51
  316. package/dist/rspack-provider/config.d.ts +0 -9
  317. package/dist/rspack-provider/config.js +0 -47
  318. package/dist/rspack-provider/core/build.d.ts +0 -19
  319. package/dist/rspack-provider/core/build.js +0 -79
  320. package/dist/rspack-provider/core/createCompiler.d.ts +0 -11
  321. package/dist/rspack-provider/core/createCompiler.js +0 -112
  322. package/dist/rspack-provider/core/createContext.d.ts +0 -13
  323. package/dist/rspack-provider/core/createContext.js +0 -133
  324. package/dist/rspack-provider/core/devMiddleware.d.ts +0 -3
  325. package/dist/rspack-provider/core/devMiddleware.js +0 -65
  326. package/dist/rspack-provider/core/initConfigs.d.ts +0 -14
  327. package/dist/rspack-provider/core/initConfigs.js +0 -78
  328. package/dist/rspack-provider/core/initHooks.d.ts +0 -19
  329. package/dist/rspack-provider/core/initHooks.js +0 -45
  330. package/dist/rspack-provider/core/initPlugins.d.ts +0 -9
  331. package/dist/rspack-provider/core/initPlugins.js +0 -87
  332. package/dist/rspack-provider/core/inspectConfig.d.ts +0 -19
  333. package/dist/rspack-provider/core/inspectConfig.js +0 -81
  334. package/dist/rspack-provider/core/rspackConfig.d.ts +0 -9
  335. package/dist/rspack-provider/core/rspackConfig.js +0 -132
  336. package/dist/rspack-provider/css-modules-typescript-pre-loader/index.d.ts +0 -6
  337. package/dist/rspack-provider/css-modules-typescript-pre-loader/index.js +0 -84
  338. package/dist/rspack-provider/css-modules-typescript-pre-loader/postcss-icss-extract-plugin.d.ts +0 -11
  339. package/dist/rspack-provider/css-modules-typescript-pre-loader/postcss-icss-extract-plugin.js +0 -67
  340. package/dist/rspack-provider/index.d.ts +0 -5
  341. package/dist/rspack-provider/index.js +0 -38
  342. package/dist/rspack-provider/plugins/basic.d.ts +0 -5
  343. package/dist/rspack-provider/plugins/css.d.ts +0 -29
  344. package/dist/rspack-provider/plugins/css.js +0 -199
  345. package/dist/rspack-provider/plugins/hmr.d.ts +0 -2
  346. package/dist/rspack-provider/plugins/hmr.js +0 -38
  347. package/dist/rspack-provider/plugins/less.d.ts +0 -2
  348. package/dist/rspack-provider/plugins/less.js +0 -78
  349. package/dist/rspack-provider/plugins/minimize.d.ts +0 -5
  350. package/dist/rspack-provider/plugins/minimize.js +0 -77
  351. package/dist/rspack-provider/plugins/output.d.ts +0 -2
  352. package/dist/rspack-provider/plugins/output.js +0 -65
  353. package/dist/rspack-provider/plugins/progress.d.ts +0 -2
  354. package/dist/rspack-provider/plugins/progress.js +0 -61
  355. package/dist/rspack-provider/plugins/resolve.d.ts +0 -2
  356. package/dist/rspack-provider/plugins/resolve.js +0 -54
  357. package/dist/rspack-provider/plugins/rspackProfile.d.ts +0 -5
  358. package/dist/rspack-provider/plugins/rspackProfile.js +0 -107
  359. package/dist/rspack-provider/plugins/sass.d.ts +0 -2
  360. package/dist/rspack-provider/plugins/sass.js +0 -83
  361. package/dist/rspack-provider/plugins/swc.d.ts +0 -7
  362. package/dist/rspack-provider/plugins/swc.js +0 -147
  363. package/dist/rspack-provider/plugins/transition.d.ts +0 -5
  364. package/dist/rspack-provider/plugins/transition.js +0 -42
  365. package/dist/rspack-provider/provider.d.ts +0 -8
  366. package/dist/rspack-provider/provider.js +0 -117
  367. package/dist/rspack-provider/shared.d.ts +0 -8
  368. package/dist/rspack-provider/shared.js +0 -116
  369. package/dist/server/dev-middleware/index.d.ts +0 -24
  370. package/dist/server/dev-middleware/index.js +0 -91
  371. package/dist/server/dev-middleware/socketServer.d.ts +0 -22
  372. package/dist/server/dev-middleware/socketServer.js +0 -164
  373. package/dist/server/devServer.d.ts +0 -34
  374. package/dist/server/devServer.js +0 -252
  375. package/dist/server/index.d.ts +0 -2
  376. package/dist/server/index.js +0 -31
  377. package/dist/server/middlewares.d.ts +0 -9
  378. package/dist/server/middlewares.js +0 -115
  379. package/dist/server/prodServer.d.ts +0 -33
  380. package/dist/server/prodServer.js +0 -197
  381. package/dist/server/proxy.d.ts +0 -9
  382. package/dist/server/proxy.js +0 -90
  383. package/dist/server/restart.d.ts +0 -11
  384. package/dist/server/restart.js +0 -65
  385. package/dist/types.d.ts +0 -19
  386. package/dist/types.js +0 -16
  387. package/static/template.html +0 -7
@@ -1 +1 @@
1
- {"name":"jiti","version":"1.20.0","license":"MIT","types":"types/jiti.d.ts"}
1
+ {"name":"jiti","version":"1.21.6","license":"MIT","types":"index.d.ts","type":"commonjs"}
@@ -0,0 +1 @@
1
+ export = any;
@@ -0,0 +1,696 @@
1
+ (() => {
2
+ var __webpack_modules__ = {
3
+ 258: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
+ const url = __nccwpck_require__(310);
5
+ const path = __nccwpck_require__(17);
6
+ const launch = __nccwpck_require__(469);
7
+ module.exports = (specifiedEditor, srcRoot, onErrorCallback) => {
8
+ if (typeof specifiedEditor === "function") {
9
+ onErrorCallback = specifiedEditor;
10
+ specifiedEditor = undefined;
11
+ }
12
+ if (typeof srcRoot === "function") {
13
+ onErrorCallback = srcRoot;
14
+ srcRoot = undefined;
15
+ }
16
+ srcRoot = srcRoot || process.cwd();
17
+ return function launchEditorMiddleware(req, res) {
18
+ const { file } = url.parse(req.url, true).query || {};
19
+ if (!file) {
20
+ res.statusCode = 500;
21
+ res.end(
22
+ `launch-editor-middleware: required query param "file" is missing.`,
23
+ );
24
+ } else {
25
+ launch(
26
+ path.resolve(srcRoot, file),
27
+ specifiedEditor,
28
+ onErrorCallback,
29
+ );
30
+ res.end();
31
+ }
32
+ };
33
+ };
34
+ },
35
+ 578: (module) => {
36
+ module.exports = {
37
+ atom: "atom",
38
+ Brackets: "brackets",
39
+ "code-insiders": "code-insiders",
40
+ code: "code",
41
+ vscodium: "vscodium",
42
+ codium: "codium",
43
+ emacs: "emacs",
44
+ gvim: "gvim",
45
+ "idea.sh": "idea",
46
+ "phpstorm.sh": "phpstorm",
47
+ "pycharm.sh": "pycharm",
48
+ "rubymine.sh": "rubymine",
49
+ sublime_text: "subl",
50
+ vim: "vim",
51
+ "webstorm.sh": "webstorm",
52
+ "goland.sh": "goland",
53
+ "rider.sh": "rider",
54
+ };
55
+ },
56
+ 692: (module) => {
57
+ module.exports = {
58
+ "/Applications/Atom.app/Contents/MacOS/Atom": "atom",
59
+ "/Applications/Atom Beta.app/Contents/MacOS/Atom Beta":
60
+ "/Applications/Atom Beta.app/Contents/MacOS/Atom Beta",
61
+ "/Applications/Brackets.app/Contents/MacOS/Brackets": "brackets",
62
+ "/Applications/Sublime Text.app/Contents/MacOS/Sublime Text":
63
+ "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl",
64
+ "/Applications/Sublime Text.app/Contents/MacOS/sublime_text":
65
+ "/Applications/Sublime Text.app/Contents/SharedSupport/bin/subl",
66
+ "/Applications/Sublime Text 2.app/Contents/MacOS/Sublime Text 2":
67
+ "/Applications/Sublime Text 2.app/Contents/SharedSupport/bin/subl",
68
+ "/Applications/Sublime Text Dev.app/Contents/MacOS/Sublime Text":
69
+ "/Applications/Sublime Text Dev.app/Contents/SharedSupport/bin/subl",
70
+ "/Applications/Visual Studio Code.app/Contents/MacOS/Electron": "code",
71
+ "/Applications/Visual Studio Code - Insiders.app/Contents/MacOS/Electron":
72
+ "code-insiders",
73
+ "/Applications/VSCodium.app/Contents/MacOS/Electron": "codium",
74
+ "/Applications/Cursor.app/Contents/MacOS/Cursor": "cursor",
75
+ "/Applications/AppCode.app/Contents/MacOS/appcode":
76
+ "/Applications/AppCode.app/Contents/MacOS/appcode",
77
+ "/Applications/CLion.app/Contents/MacOS/clion":
78
+ "/Applications/CLion.app/Contents/MacOS/clion",
79
+ "/Applications/IntelliJ IDEA.app/Contents/MacOS/idea":
80
+ "/Applications/IntelliJ IDEA.app/Contents/MacOS/idea",
81
+ "/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea":
82
+ "/Applications/IntelliJ IDEA Ultimate.app/Contents/MacOS/idea",
83
+ "/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea":
84
+ "/Applications/IntelliJ IDEA Community Edition.app/Contents/MacOS/idea",
85
+ "/Applications/PhpStorm.app/Contents/MacOS/phpstorm":
86
+ "/Applications/PhpStorm.app/Contents/MacOS/phpstorm",
87
+ "/Applications/PyCharm.app/Contents/MacOS/pycharm":
88
+ "/Applications/PyCharm.app/Contents/MacOS/pycharm",
89
+ "/Applications/PyCharm CE.app/Contents/MacOS/pycharm":
90
+ "/Applications/PyCharm CE.app/Contents/MacOS/pycharm",
91
+ "/Applications/RubyMine.app/Contents/MacOS/rubymine":
92
+ "/Applications/RubyMine.app/Contents/MacOS/rubymine",
93
+ "/Applications/WebStorm.app/Contents/MacOS/webstorm":
94
+ "/Applications/WebStorm.app/Contents/MacOS/webstorm",
95
+ "/Applications/MacVim.app/Contents/MacOS/MacVim": "mvim",
96
+ "/Applications/GoLand.app/Contents/MacOS/goland":
97
+ "/Applications/GoLand.app/Contents/MacOS/goland",
98
+ "/Applications/Rider.app/Contents/MacOS/rider":
99
+ "/Applications/Rider.app/Contents/MacOS/rider",
100
+ "/Applications/Zed.app/Contents/MacOS/zed": "zed",
101
+ };
102
+ },
103
+ 119: (module) => {
104
+ module.exports = [
105
+ "Brackets.exe",
106
+ "Code.exe",
107
+ "Code - Insiders.exe",
108
+ "VSCodium.exe",
109
+ "atom.exe",
110
+ "sublime_text.exe",
111
+ "notepad++.exe",
112
+ "clion.exe",
113
+ "clion64.exe",
114
+ "idea.exe",
115
+ "idea64.exe",
116
+ "phpstorm.exe",
117
+ "phpstorm64.exe",
118
+ "pycharm.exe",
119
+ "pycharm64.exe",
120
+ "rubymine.exe",
121
+ "rubymine64.exe",
122
+ "webstorm.exe",
123
+ "webstorm64.exe",
124
+ "goland.exe",
125
+ "goland64.exe",
126
+ "rider.exe",
127
+ "rider64.exe",
128
+ ];
129
+ },
130
+ 961: (module, __unused_webpack_exports, __nccwpck_require__) => {
131
+ const path = __nccwpck_require__(17);
132
+ module.exports = function getArgumentsForPosition(
133
+ editor,
134
+ fileName,
135
+ lineNumber,
136
+ columnNumber = 1,
137
+ ) {
138
+ const editorBasename = path
139
+ .basename(editor)
140
+ .replace(/\.(exe|cmd|bat)$/i, "");
141
+ switch (editorBasename) {
142
+ case "atom":
143
+ case "Atom":
144
+ case "Atom Beta":
145
+ case "subl":
146
+ case "sublime":
147
+ case "sublime_text":
148
+ case "wstorm":
149
+ case "charm":
150
+ case "zed":
151
+ return [`${fileName}:${lineNumber}:${columnNumber}`];
152
+ case "notepad++":
153
+ return ["-n" + lineNumber, "-c" + columnNumber, fileName];
154
+ case "vim":
155
+ case "mvim":
156
+ return [`+call cursor(${lineNumber}, ${columnNumber})`, fileName];
157
+ case "joe":
158
+ case "gvim":
159
+ return ["+" + `${lineNumber}`, fileName];
160
+ case "emacs":
161
+ case "emacsclient":
162
+ return [`+${lineNumber}:${columnNumber}`, fileName];
163
+ case "rmate":
164
+ case "mate":
165
+ case "mine":
166
+ return ["--line", lineNumber, fileName];
167
+ case "code":
168
+ case "Code":
169
+ case "code-insiders":
170
+ case "Code - Insiders":
171
+ case "codium":
172
+ case "cursor":
173
+ case "vscodium":
174
+ case "VSCodium":
175
+ return ["-r", "-g", `${fileName}:${lineNumber}:${columnNumber}`];
176
+ case "appcode":
177
+ case "clion":
178
+ case "clion64":
179
+ case "idea":
180
+ case "idea64":
181
+ case "phpstorm":
182
+ case "phpstorm64":
183
+ case "pycharm":
184
+ case "pycharm64":
185
+ case "rubymine":
186
+ case "rubymine64":
187
+ case "webstorm":
188
+ case "webstorm64":
189
+ case "goland":
190
+ case "goland64":
191
+ case "rider":
192
+ case "rider64":
193
+ return ["--line", lineNumber, "--column", columnNumber, fileName];
194
+ }
195
+ if (process.env.LAUNCH_EDITOR) {
196
+ return [fileName, lineNumber, columnNumber];
197
+ }
198
+ return [fileName];
199
+ };
200
+ },
201
+ 641: (module, __unused_webpack_exports, __nccwpck_require__) => {
202
+ const path = __nccwpck_require__(17);
203
+ const shellQuote = __nccwpck_require__(522);
204
+ const childProcess = __nccwpck_require__(81);
205
+ const COMMON_EDITORS_MACOS = __nccwpck_require__(692);
206
+ const COMMON_EDITORS_LINUX = __nccwpck_require__(578);
207
+ const COMMON_EDITORS_WIN = __nccwpck_require__(119);
208
+ module.exports = function guessEditor(specifiedEditor) {
209
+ if (specifiedEditor) {
210
+ return shellQuote.parse(specifiedEditor);
211
+ }
212
+ if (process.env.LAUNCH_EDITOR) {
213
+ return [process.env.LAUNCH_EDITOR];
214
+ }
215
+ if (process.versions.webcontainer) {
216
+ return [process.env.EDITOR || "code"];
217
+ }
218
+ try {
219
+ if (process.platform === "darwin") {
220
+ const output = childProcess
221
+ .execSync("ps x -o comm=", { stdio: ["pipe", "pipe", "ignore"] })
222
+ .toString();
223
+ const processNames = Object.keys(COMMON_EDITORS_MACOS);
224
+ const processList = output.split("\n");
225
+ for (let i = 0; i < processNames.length; i++) {
226
+ const processName = processNames[i];
227
+ if (processList.includes(processName)) {
228
+ return [COMMON_EDITORS_MACOS[processName]];
229
+ }
230
+ const processNameWithoutApplications = processName.replace(
231
+ "/Applications",
232
+ "",
233
+ );
234
+ if (output.indexOf(processNameWithoutApplications) !== -1) {
235
+ if (processName !== COMMON_EDITORS_MACOS[processName]) {
236
+ return [COMMON_EDITORS_MACOS[processName]];
237
+ }
238
+ const runningProcess = processList.find((procName) =>
239
+ procName.endsWith(processNameWithoutApplications),
240
+ );
241
+ if (runningProcess !== undefined) {
242
+ return [runningProcess];
243
+ }
244
+ }
245
+ }
246
+ } else if (process.platform === "win32") {
247
+ const output = childProcess
248
+ .execSync(
249
+ 'powershell -NoProfile -Command "Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"',
250
+ { stdio: ["pipe", "pipe", "ignore"] },
251
+ )
252
+ .toString();
253
+ const runningProcesses = output.split("\r\n");
254
+ for (let i = 0; i < runningProcesses.length; i++) {
255
+ const fullProcessPath = runningProcesses[i].trim();
256
+ const shortProcessName = path.basename(fullProcessPath);
257
+ if (COMMON_EDITORS_WIN.indexOf(shortProcessName) !== -1) {
258
+ return [fullProcessPath];
259
+ }
260
+ }
261
+ } else if (process.platform === "linux") {
262
+ const output = childProcess
263
+ .execSync("ps x --no-heading -o comm --sort=comm", {
264
+ stdio: ["pipe", "pipe", "ignore"],
265
+ })
266
+ .toString();
267
+ const processNames = Object.keys(COMMON_EDITORS_LINUX);
268
+ for (let i = 0; i < processNames.length; i++) {
269
+ const processName = processNames[i];
270
+ if (output.indexOf(processName) !== -1) {
271
+ return [COMMON_EDITORS_LINUX[processName]];
272
+ }
273
+ }
274
+ }
275
+ } catch (ignoreError) {}
276
+ if (process.env.VISUAL) {
277
+ return [process.env.VISUAL];
278
+ } else if (process.env.EDITOR) {
279
+ return [process.env.EDITOR];
280
+ }
281
+ return [null];
282
+ };
283
+ },
284
+ 469: (module, __unused_webpack_exports, __nccwpck_require__) => {
285
+ const fs = __nccwpck_require__(147);
286
+ const os = __nccwpck_require__(37);
287
+ const path = __nccwpck_require__(17);
288
+ const colors = __nccwpck_require__(272);
289
+ const childProcess = __nccwpck_require__(81);
290
+ const guessEditor = __nccwpck_require__(641);
291
+ const getArgumentsForPosition = __nccwpck_require__(961);
292
+ function wrapErrorCallback(cb) {
293
+ return (fileName, errorMessage) => {
294
+ console.log();
295
+ console.log(
296
+ colors.red(
297
+ "Could not open " + path.basename(fileName) + " in the editor.",
298
+ ),
299
+ );
300
+ if (errorMessage) {
301
+ if (errorMessage[errorMessage.length - 1] !== ".") {
302
+ errorMessage += ".";
303
+ }
304
+ console.log(
305
+ colors.red(
306
+ "The editor process exited with an error: " + errorMessage,
307
+ ),
308
+ );
309
+ }
310
+ console.log();
311
+ if (cb) cb(fileName, errorMessage);
312
+ };
313
+ }
314
+ function isTerminalEditor(editor) {
315
+ switch (editor) {
316
+ case "vim":
317
+ case "emacs":
318
+ case "nano":
319
+ return true;
320
+ }
321
+ return false;
322
+ }
323
+ const positionRE = /:(\d+)(:(\d+))?$/;
324
+ function parseFile(file) {
325
+ const fileName = file.replace(positionRE, "");
326
+ const match = file.match(positionRE);
327
+ const lineNumber = match && match[1];
328
+ const columnNumber = match && match[3];
329
+ return { fileName, lineNumber, columnNumber };
330
+ }
331
+ let _childProcess = null;
332
+ function launchEditor(file, specifiedEditor, onErrorCallback) {
333
+ const parsed = parseFile(file);
334
+ let { fileName } = parsed;
335
+ const { lineNumber, columnNumber } = parsed;
336
+ if (!fs.existsSync(fileName)) {
337
+ return;
338
+ }
339
+ if (typeof specifiedEditor === "function") {
340
+ onErrorCallback = specifiedEditor;
341
+ specifiedEditor = undefined;
342
+ }
343
+ onErrorCallback = wrapErrorCallback(onErrorCallback);
344
+ const [editor, ...args] = guessEditor(specifiedEditor);
345
+ if (!editor) {
346
+ onErrorCallback(fileName, null);
347
+ return;
348
+ }
349
+ if (
350
+ process.platform === "linux" &&
351
+ fileName.startsWith("/mnt/") &&
352
+ /Microsoft/i.test(os.release())
353
+ ) {
354
+ fileName = path.relative("", fileName);
355
+ }
356
+ const WINDOWS_CMD_SAFE_FILE_NAME_PATTERN =
357
+ /^([A-Za-z]:[/\\])?[\p{L}0-9/.\-_\\]+$/u;
358
+ if (
359
+ process.platform === "win32" &&
360
+ !WINDOWS_CMD_SAFE_FILE_NAME_PATTERN.test(fileName.trim())
361
+ ) {
362
+ console.log();
363
+ console.log(
364
+ colors.red(
365
+ "Could not open " + path.basename(fileName) + " in the editor.",
366
+ ),
367
+ );
368
+ console.log();
369
+ console.log(
370
+ "When running on Windows, file names are checked against a safe file name " +
371
+ "pattern to protect against remote code execution attacks. File names " +
372
+ "may consist only of alphanumeric characters (all languages), periods, " +
373
+ "dashes, slashes, and underscores.",
374
+ );
375
+ console.log();
376
+ return;
377
+ }
378
+ if (lineNumber) {
379
+ const extraArgs = getArgumentsForPosition(
380
+ editor,
381
+ fileName,
382
+ lineNumber,
383
+ columnNumber,
384
+ );
385
+ args.push.apply(args, extraArgs);
386
+ } else {
387
+ args.push(fileName);
388
+ }
389
+ if (_childProcess && isTerminalEditor(editor)) {
390
+ _childProcess.kill("SIGKILL");
391
+ }
392
+ if (process.platform === "win32") {
393
+ _childProcess = childProcess.spawn(
394
+ "cmd.exe",
395
+ ["/C", editor].concat(args),
396
+ { stdio: "inherit" },
397
+ );
398
+ } else {
399
+ _childProcess = childProcess.spawn(editor, args, {
400
+ stdio: "inherit",
401
+ });
402
+ }
403
+ _childProcess.on("exit", function (errorCode) {
404
+ _childProcess = null;
405
+ if (errorCode) {
406
+ onErrorCallback(fileName, "(code " + errorCode + ")");
407
+ }
408
+ });
409
+ _childProcess.on("error", function (error) {
410
+ let { code, message } = error;
411
+ if ("ENOENT" === code) {
412
+ message = `${message} ('${editor}' command does not exist in 'PATH')`;
413
+ }
414
+ onErrorCallback(fileName, message);
415
+ });
416
+ }
417
+ module.exports = launchEditor;
418
+ },
419
+ 522: (__unused_webpack_module, exports, __nccwpck_require__) => {
420
+ "use strict";
421
+ exports.quote = __nccwpck_require__(392);
422
+ exports.parse = __nccwpck_require__(145);
423
+ },
424
+ 145: (module) => {
425
+ "use strict";
426
+ var CONTROL =
427
+ "(?:" +
428
+ [
429
+ "\\|\\|",
430
+ "\\&\\&",
431
+ ";;",
432
+ "\\|\\&",
433
+ "\\<\\(",
434
+ "\\<\\<\\<",
435
+ ">>",
436
+ ">\\&",
437
+ "<\\&",
438
+ "[&;()|<>]",
439
+ ].join("|") +
440
+ ")";
441
+ var controlRE = new RegExp("^" + CONTROL + "$");
442
+ var META = "|&;()<> \\t";
443
+ var SINGLE_QUOTE = '"((\\\\"|[^"])*?)"';
444
+ var DOUBLE_QUOTE = "'((\\\\'|[^'])*?)'";
445
+ var hash = /^#$/;
446
+ var SQ = "'";
447
+ var DQ = '"';
448
+ var DS = "$";
449
+ var TOKEN = "";
450
+ var mult = 4294967296;
451
+ for (var i = 0; i < 4; i++) {
452
+ TOKEN += (mult * Math.random()).toString(16);
453
+ }
454
+ var startsWithToken = new RegExp("^" + TOKEN);
455
+ function matchAll(s, r) {
456
+ var origIndex = r.lastIndex;
457
+ var matches = [];
458
+ var matchObj;
459
+ while ((matchObj = r.exec(s))) {
460
+ matches.push(matchObj);
461
+ if (r.lastIndex === matchObj.index) {
462
+ r.lastIndex += 1;
463
+ }
464
+ }
465
+ r.lastIndex = origIndex;
466
+ return matches;
467
+ }
468
+ function getVar(env, pre, key) {
469
+ var r = typeof env === "function" ? env(key) : env[key];
470
+ if (typeof r === "undefined" && key != "") {
471
+ r = "";
472
+ } else if (typeof r === "undefined") {
473
+ r = "$";
474
+ }
475
+ if (typeof r === "object") {
476
+ return pre + TOKEN + JSON.stringify(r) + TOKEN;
477
+ }
478
+ return pre + r;
479
+ }
480
+ function parseInternal(string, env, opts) {
481
+ if (!opts) {
482
+ opts = {};
483
+ }
484
+ var BS = opts.escape || "\\";
485
+ var BAREWORD = "(\\" + BS + "['\"" + META + "]|[^\\s'\"" + META + "])+";
486
+ var chunker = new RegExp(
487
+ [
488
+ "(" + CONTROL + ")",
489
+ "(" + BAREWORD + "|" + SINGLE_QUOTE + "|" + DOUBLE_QUOTE + ")+",
490
+ ].join("|"),
491
+ "g",
492
+ );
493
+ var matches = matchAll(string, chunker);
494
+ if (matches.length === 0) {
495
+ return [];
496
+ }
497
+ if (!env) {
498
+ env = {};
499
+ }
500
+ var commented = false;
501
+ return matches
502
+ .map(function (match) {
503
+ var s = match[0];
504
+ if (!s || commented) {
505
+ return void undefined;
506
+ }
507
+ if (controlRE.test(s)) {
508
+ return { op: s };
509
+ }
510
+ var quote = false;
511
+ var esc = false;
512
+ var out = "";
513
+ var isGlob = false;
514
+ var i;
515
+ function parseEnvVar() {
516
+ i += 1;
517
+ var varend;
518
+ var varname;
519
+ var char = s.charAt(i);
520
+ if (char === "{") {
521
+ i += 1;
522
+ if (s.charAt(i) === "}") {
523
+ throw new Error("Bad substitution: " + s.slice(i - 2, i + 1));
524
+ }
525
+ varend = s.indexOf("}", i);
526
+ if (varend < 0) {
527
+ throw new Error("Bad substitution: " + s.slice(i));
528
+ }
529
+ varname = s.slice(i, varend);
530
+ i = varend;
531
+ } else if (/[*@#?$!_-]/.test(char)) {
532
+ varname = char;
533
+ i += 1;
534
+ } else {
535
+ var slicedFromI = s.slice(i);
536
+ varend = slicedFromI.match(/[^\w\d_]/);
537
+ if (!varend) {
538
+ varname = slicedFromI;
539
+ i = s.length;
540
+ } else {
541
+ varname = slicedFromI.slice(0, varend.index);
542
+ i += varend.index - 1;
543
+ }
544
+ }
545
+ return getVar(env, "", varname);
546
+ }
547
+ for (i = 0; i < s.length; i++) {
548
+ var c = s.charAt(i);
549
+ isGlob = isGlob || (!quote && (c === "*" || c === "?"));
550
+ if (esc) {
551
+ out += c;
552
+ esc = false;
553
+ } else if (quote) {
554
+ if (c === quote) {
555
+ quote = false;
556
+ } else if (quote == SQ) {
557
+ out += c;
558
+ } else {
559
+ if (c === BS) {
560
+ i += 1;
561
+ c = s.charAt(i);
562
+ if (c === DQ || c === BS || c === DS) {
563
+ out += c;
564
+ } else {
565
+ out += BS + c;
566
+ }
567
+ } else if (c === DS) {
568
+ out += parseEnvVar();
569
+ } else {
570
+ out += c;
571
+ }
572
+ }
573
+ } else if (c === DQ || c === SQ) {
574
+ quote = c;
575
+ } else if (controlRE.test(c)) {
576
+ return { op: s };
577
+ } else if (hash.test(c)) {
578
+ commented = true;
579
+ var commentObj = { comment: string.slice(match.index + i + 1) };
580
+ if (out.length) {
581
+ return [out, commentObj];
582
+ }
583
+ return [commentObj];
584
+ } else if (c === BS) {
585
+ esc = true;
586
+ } else if (c === DS) {
587
+ out += parseEnvVar();
588
+ } else {
589
+ out += c;
590
+ }
591
+ }
592
+ if (isGlob) {
593
+ return { op: "glob", pattern: out };
594
+ }
595
+ return out;
596
+ })
597
+ .reduce(function (prev, arg) {
598
+ return typeof arg === "undefined" ? prev : prev.concat(arg);
599
+ }, []);
600
+ }
601
+ module.exports = function parse(s, env, opts) {
602
+ var mapped = parseInternal(s, env, opts);
603
+ if (typeof env !== "function") {
604
+ return mapped;
605
+ }
606
+ return mapped.reduce(function (acc, s) {
607
+ if (typeof s === "object") {
608
+ return acc.concat(s);
609
+ }
610
+ var xs = s.split(RegExp("(" + TOKEN + ".*?" + TOKEN + ")", "g"));
611
+ if (xs.length === 1) {
612
+ return acc.concat(xs[0]);
613
+ }
614
+ return acc.concat(
615
+ xs.filter(Boolean).map(function (x) {
616
+ if (startsWithToken.test(x)) {
617
+ return JSON.parse(x.split(TOKEN)[1]);
618
+ }
619
+ return x;
620
+ }),
621
+ );
622
+ }, []);
623
+ };
624
+ },
625
+ 392: (module) => {
626
+ "use strict";
627
+ module.exports = function quote(xs) {
628
+ return xs
629
+ .map(function (s) {
630
+ if (s && typeof s === "object") {
631
+ return s.op.replace(/(.)/g, "\\$1");
632
+ }
633
+ if (/["\s]/.test(s) && !/'/.test(s)) {
634
+ return "'" + s.replace(/(['\\])/g, "\\$1") + "'";
635
+ }
636
+ if (/["'\s]/.test(s)) {
637
+ return '"' + s.replace(/(["\\$`!])/g, "\\$1") + '"';
638
+ }
639
+ return String(s).replace(
640
+ /([A-Za-z]:)?([#!"$&'()*,:;<=>?@[\\\]^`{|}])/g,
641
+ "$1\\$2",
642
+ );
643
+ })
644
+ .join(" ");
645
+ };
646
+ },
647
+ 272: (module) => {
648
+ "use strict";
649
+ module.exports = require("../picocolors");
650
+ },
651
+ 81: (module) => {
652
+ "use strict";
653
+ module.exports = require("child_process");
654
+ },
655
+ 147: (module) => {
656
+ "use strict";
657
+ module.exports = require("fs");
658
+ },
659
+ 37: (module) => {
660
+ "use strict";
661
+ module.exports = require("os");
662
+ },
663
+ 17: (module) => {
664
+ "use strict";
665
+ module.exports = require("path");
666
+ },
667
+ 310: (module) => {
668
+ "use strict";
669
+ module.exports = require("url");
670
+ },
671
+ };
672
+ var __webpack_module_cache__ = {};
673
+ function __nccwpck_require__(moduleId) {
674
+ var cachedModule = __webpack_module_cache__[moduleId];
675
+ if (cachedModule !== undefined) {
676
+ return cachedModule.exports;
677
+ }
678
+ var module = (__webpack_module_cache__[moduleId] = { exports: {} });
679
+ var threw = true;
680
+ try {
681
+ __webpack_modules__[moduleId](
682
+ module,
683
+ module.exports,
684
+ __nccwpck_require__,
685
+ );
686
+ threw = false;
687
+ } finally {
688
+ if (threw) delete __webpack_module_cache__[moduleId];
689
+ }
690
+ return module.exports;
691
+ }
692
+ if (typeof __nccwpck_require__ !== "undefined")
693
+ __nccwpck_require__.ab = __dirname + "/";
694
+ var __webpack_exports__ = __nccwpck_require__(258);
695
+ module.exports = __webpack_exports__;
696
+ })();