@rsbuild/core 2.0.0-beta.7 → 2.0.0-beta.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 (59) hide show
  1. package/compiled/connect-next/index.d.ts +56 -0
  2. package/compiled/{connect → connect-next}/license +1 -0
  3. package/compiled/connect-next/package.json +1 -0
  4. package/compiled/css-loader/index.js +2 -2
  5. package/compiled/html-rspack-plugin/index.js +14 -14
  6. package/compiled/jiti/dist/babel.cjs +60 -60
  7. package/compiled/jiti/dist/jiti.cjs +2 -2
  8. package/compiled/postcss-loader/index.js +6 -6
  9. package/compiled/rslog/index.d.ts +17 -1
  10. package/compiled/rslog/package.json +1 -1
  11. package/compiled/rspack-chain/package.json +1 -1
  12. package/compiled/rspack-chain/types/index.d.ts +0 -3
  13. package/compiled/style-loader/index.js +10 -10
  14. package/dist/{131.js → 958.js} +258 -361
  15. package/dist/chokidar.js +59 -57
  16. package/dist/client/hmr.js +1 -1
  17. package/dist/client/overlay.js +1 -1
  18. package/dist/connect-next.js +268 -0
  19. package/dist/{connect.js.LICENSE.txt → connect-next.js.LICENSE.txt} +3 -13
  20. package/dist/cors.js +2 -2
  21. package/dist/http-proxy-middleware.js +57 -552
  22. package/dist/index.js +1 -1
  23. package/dist/launch-editor-middleware.js +23 -8
  24. package/dist/manifest-plugin.js +18 -18
  25. package/dist/memfs.js +178 -717
  26. package/dist/{710.js → mrmime.js} +2 -1
  27. package/dist/open.js +35 -32
  28. package/dist/range-parser.js +2 -2
  29. package/dist/remapping.js +2 -2
  30. package/dist/rslib-runtime.js +3 -3
  31. package/dist/sirv.js +14 -14
  32. package/dist/src.js +510 -0
  33. package/dist/tinyglobby.js +25 -25
  34. package/dist/transformLoader.mjs +38 -1
  35. package/dist/transformRawLoader.mjs +1 -1
  36. package/dist/ws.js +1541 -0
  37. package/dist-types/helpers/index.d.ts +1 -1
  38. package/dist-types/helpers/vendors.d.ts +0 -1
  39. package/dist-types/server/runner/asModule.d.ts +1 -1
  40. package/dist-types/server/socketServer.d.ts +1 -1
  41. package/dist-types/types/config.d.ts +3 -2
  42. package/dist-types/types/thirdParty.d.ts +1 -1
  43. package/package.json +9 -10
  44. package/compiled/connect/index.d.ts +0 -90
  45. package/compiled/connect/package.json +0 -1
  46. package/compiled/ws/index.d.ts +0 -437
  47. package/compiled/ws/index.js +0 -3166
  48. package/compiled/ws/license +0 -20
  49. package/compiled/ws/package.json +0 -1
  50. package/dist/397.js +0 -11
  51. package/dist/7.js +0 -1
  52. package/dist/712.js +0 -15
  53. package/dist/743.js +0 -7
  54. package/dist/88.js +0 -40
  55. package/dist/connect.js +0 -574
  56. package/dist-types/helpers/color.d.ts +0 -4
  57. /package/dist/{131.js.LICENSE.txt → 958.js.LICENSE.txt} +0 -0
  58. /package/dist/client/{59.js → 797.js} +0 -0
  59. /package/dist/{31.js → trace-mapping.js} +0 -0
package/dist/index.js CHANGED
@@ -1 +1 @@
1
- export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, loadConfig, loadEnv, logger, mergeRsbuildConfig, rspack, runCLI, version } from "./131.js";
1
+ export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, loadConfig, loadEnv, logger, mergeRsbuildConfig, rspack, runCLI, version } from "./958.js";
@@ -1,9 +1,12 @@
1
1
  import * as __rspack_external_child_process from "child_process";
2
+ import * as __rspack_external_fs from "fs";
3
+ import * as __rspack_external_os from "os";
4
+ import * as __rspack_external_path from "path";
5
+ import * as __rspack_external_url from "url";
2
6
  import { __webpack_require__ } from "./rslib-runtime.js";
3
- import "./131.js";
4
7
  __webpack_require__.add({
5
8
  "../../node_modules/.pnpm/launch-editor-middleware@2.13.1/node_modules/launch-editor-middleware/index.js" (module, __unused_rspack_exports, __webpack_require__) {
6
- let path = __webpack_require__("path"), launch = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/index.js");
9
+ let path = __webpack_require__("path?a5e4"), launch = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/index.js");
7
10
  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) {
8
11
  let url;
9
12
  try {
@@ -113,7 +116,7 @@ __webpack_require__.add({
113
116
  ];
114
117
  },
115
118
  "../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/get-args.js" (module, __unused_rspack_exports, __webpack_require__) {
116
- let path = __webpack_require__("path");
119
+ let path = __webpack_require__("path?a5e4");
117
120
  module.exports = function getArgumentsForPosition(editor, fileName, lineNumber, columnNumber = 1) {
118
121
  switch(path.basename(editor).replace(/\.(exe|cmd|bat)$/i, '')){
119
122
  case 'atom':
@@ -210,7 +213,7 @@ __webpack_require__.add({
210
213
  };
211
214
  },
212
215
  "../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/guess.js" (module, __unused_rspack_exports, __webpack_require__) {
213
- let path = __webpack_require__("path"), shellQuote = __webpack_require__("../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/index.js"), childProcess = __webpack_require__("child_process"), COMMON_EDITORS_MACOS = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/editor-info/macos.js"), COMMON_EDITORS_LINUX = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/editor-info/linux.js"), COMMON_EDITORS_WIN = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/editor-info/windows.js");
216
+ let path = __webpack_require__("path?a5e4"), shellQuote = __webpack_require__("../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/index.js"), childProcess = __webpack_require__("child_process"), COMMON_EDITORS_MACOS = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/editor-info/macos.js"), COMMON_EDITORS_LINUX = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/editor-info/linux.js"), COMMON_EDITORS_WIN = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/editor-info/windows.js");
214
217
  module.exports = function guessEditor(specifiedEditor) {
215
218
  if (specifiedEditor) return shellQuote.parse(specifiedEditor);
216
219
  if (process.env.LAUNCH_EDITOR) return [
@@ -284,7 +287,7 @@ __webpack_require__.add({
284
287
  };
285
288
  },
286
289
  "../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/index.js" (module, __unused_rspack_exports, __webpack_require__) {
287
- let fs = __webpack_require__("fs"), os = __webpack_require__("os"), path = __webpack_require__("path"), 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.13.1/node_modules/launch-editor/guess.js"), getArgumentsForPosition = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/get-args.js");
290
+ let fs = __webpack_require__("fs?fd42"), os = __webpack_require__("os?a1c2"), path = __webpack_require__("path?a5e4"), 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.13.1/node_modules/launch-editor/guess.js"), getArgumentsForPosition = __webpack_require__("../../node_modules/.pnpm/launch-editor@2.13.1/node_modules/launch-editor/get-args.js");
288
291
  function wrapErrorCallback(cb) {
289
292
  return (fileName, errorMessage)=>{
290
293
  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);
@@ -301,7 +304,7 @@ __webpack_require__.add({
301
304
  }
302
305
  let positionRE = /:(\d+)(:(\d+))?$/;
303
306
  function parseFile(file) {
304
- file.startsWith('file://') && (file = __webpack_require__("url").fileURLToPath(file));
307
+ file.startsWith('file://') && (file = __webpack_require__("url?5589").fileURLToPath(file));
305
308
  let fileName = file.replace(positionRE, ''), match = file.match(positionRE);
306
309
  return {
307
310
  fileName,
@@ -405,7 +408,7 @@ __webpack_require__.add({
405
408
  module.exports = createColors(), module.exports.createColors = createColors;
406
409
  },
407
410
  "../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/index.js" (__unused_rspack_module, exports, __webpack_require__) {
408
- exports.quote = __webpack_require__("../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/quote.js"), exports.parse = __webpack_require__("../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/parse.js");
411
+ __webpack_require__("../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/quote.js"), exports.parse = __webpack_require__("../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/parse.js");
409
412
  },
410
413
  "../../node_modules/.pnpm/shell-quote@1.8.3/node_modules/shell-quote/parse.js" (module) {
411
414
  for(var CONTROL = "(?:\\|\\||\\&\\&|;;|\\|\\&|\\<\\(|\\<\\<\\<|>>|>\\&|<\\&|[&;()|<>])", controlRE = RegExp('^' + CONTROL + '$'), META = '|&;()<> \\t', hash = /^#$/, TOKEN = '', i = 0; i < 4; i++)TOKEN += (0x100000000 * Math.random()).toString(16);
@@ -499,5 +502,17 @@ __webpack_require__.add({
499
502
  },
500
503
  child_process (module) {
501
504
  module.exports = __rspack_external_child_process;
505
+ },
506
+ "fs?fd42" (module) {
507
+ module.exports = __rspack_external_fs;
508
+ },
509
+ "os?a1c2" (module) {
510
+ module.exports = __rspack_external_os;
511
+ },
512
+ "path?a5e4" (module) {
513
+ module.exports = __rspack_external_path;
514
+ },
515
+ "url?5589" (module) {
516
+ module.exports = __rspack_external_url;
502
517
  }
503
- });
518
+ }), __webpack_require__("../../node_modules/.pnpm/launch-editor-middleware@2.13.1/node_modules/launch-editor-middleware/index.js");
@@ -1,11 +1,10 @@
1
+ import * as __rspack_external_node_fs_5ea92f0c from "node:fs";
2
+ import * as __rspack_external_node_path_c5b9b54f from "node:path";
1
3
  import { __webpack_require__ } from "./rslib-runtime.js";
2
- import "./131.js";
3
4
  __webpack_require__.add({
4
- "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-beta.5_@module-federation+runtime-tools@2.0.1_@swc+helpers@0.5.19_/node_modules/rspack-manifest-plugin/dist/helpers.js" (__unused_rspack_module, exports, __webpack_require__) {
5
- Object.defineProperty(exports, "__esModule", {
6
- value: !0
7
- }), exports.transformFiles = exports.reduceChunk = exports.reduceAssets = exports.generateManifest = void 0;
8
- let node_path_1 = __webpack_require__("node:path");
5
+ "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-beta.7_@module-federation+runtime-tools@2.2.1_@swc+helpers@0.5.19_/node_modules/rspack-manifest-plugin/dist/helpers.js" (__unused_rspack_module, exports, __webpack_require__) {
6
+ exports.transformFiles = exports.reduceChunk = exports.reduceAssets = exports.generateManifest = void 0;
7
+ let node_path_1 = __webpack_require__("node:path?c537");
9
8
  exports.generateManifest = (compilation, files, { generate, seed = {} })=>generate ? generate(seed, files, Array.from(compilation.entrypoints.entries()).reduce((e, [name, entrypoint])=>Object.assign(e, {
10
9
  [name]: entrypoint.getFiles()
11
10
  }), {}), {
@@ -63,11 +62,9 @@ __webpack_require__.add({
63
62
  'sort'
64
63
  ].filter((fname)=>!!options[fname]).reduce((prev, fname)=>prev[fname](options[fname]), files).map(standardizeFilePaths);
65
64
  },
66
- "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-beta.5_@module-federation+runtime-tools@2.0.1_@swc+helpers@0.5.19_/node_modules/rspack-manifest-plugin/dist/hooks.js" (__unused_rspack_module, exports, __webpack_require__) {
67
- Object.defineProperty(exports, "__esModule", {
68
- value: !0
69
- }), exports.normalModuleLoaderHook = exports.getCompilerHooks = exports.emitHook = exports.beforeRunHook = void 0;
70
- let node_fs_1 = __webpack_require__("node:fs"), node_path_1 = __webpack_require__("node:path"), lite_tapable_1 = __webpack_require__("../../node_modules/.pnpm/@rspack+lite-tapable@1.1.0/node_modules/@rspack/lite-tapable/dist/index.cjs"), helpers_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-beta.5_@module-federation+runtime-tools@2.0.1_@swc+helpers@0.5.19_/node_modules/rspack-manifest-plugin/dist/helpers.js"), compilerHookMap = new WeakMap(), getCompilerHooks = (compiler)=>{
65
+ "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-beta.7_@module-federation+runtime-tools@2.2.1_@swc+helpers@0.5.19_/node_modules/rspack-manifest-plugin/dist/hooks.js" (__unused_rspack_module, exports, __webpack_require__) {
66
+ exports.getCompilerHooks = exports.emitHook = exports.beforeRunHook = void 0;
67
+ let node_fs_1 = __webpack_require__("node:fs?2caf"), node_path_1 = __webpack_require__("node:path?c537"), lite_tapable_1 = __webpack_require__("../../node_modules/.pnpm/@rspack+lite-tapable@1.1.0/node_modules/@rspack/lite-tapable/dist/index.cjs"), helpers_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-beta.7_@module-federation+runtime-tools@2.2.1_@swc+helpers@0.5.19_/node_modules/rspack-manifest-plugin/dist/helpers.js"), compilerHookMap = new WeakMap(), getCompilerHooks = (compiler)=>{
71
68
  let hooks = compilerHookMap.get(compiler);
72
69
  return void 0 === hooks && (hooks = {
73
70
  afterEmit: new lite_tapable_1.SyncWaterfallHook([
@@ -114,16 +111,11 @@ __webpack_require__.add({
114
111
  }), (0, node_fs_1.writeFileSync)(manifestFileName, output));
115
112
  }
116
113
  getCompilerHooks(compiler).afterEmit.call(manifest);
117
- }, exports.normalModuleLoaderHook = ({ moduleAssets }, context, module)=>{
118
- let { emitFile } = context;
119
- context.emitFile = (file, content, sourceMap)=>(module.userRequest && !moduleAssets[file] && Object.assign(moduleAssets, {
120
- [file]: (0, node_path_1.join)((0, node_path_1.dirname)(file), (0, node_path_1.basename)(module.userRequest))
121
- }), emitFile.call(module, file, content, sourceMap));
122
114
  };
123
115
  },
124
- "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-beta.5_@module-federation+runtime-tools@2.0.1_@swc+helpers@0.5.19_/node_modules/rspack-manifest-plugin/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
116
+ "../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-beta.7_@module-federation+runtime-tools@2.2.1_@swc+helpers@0.5.19_/node_modules/rspack-manifest-plugin/dist/index.js" (__unused_rspack_module, exports, __webpack_require__) {
125
117
  exports.RspackManifestPlugin = void 0;
126
- let node_path_1 = __webpack_require__("node:path"), hooks_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-beta.5_@module-federation+runtime-tools@2.0.1_@swc+helpers@0.5.19_/node_modules/rspack-manifest-plugin/dist/hooks.js"), emitCountMap = new Map(), defaults = {
118
+ let node_path_1 = __webpack_require__("node:path?c537"), hooks_1 = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-beta.7_@module-federation+runtime-tools@2.2.1_@swc+helpers@0.5.19_/node_modules/rspack-manifest-plugin/dist/hooks.js"), emitCountMap = new Map(), defaults = {
127
119
  assetHookStage: 1 / 0,
128
120
  basePath: '',
129
121
  fileName: 'manifest.json',
@@ -165,6 +157,12 @@ __webpack_require__.add({
165
157
  }
166
158
  };
167
159
  },
160
+ "node:fs?2caf" (module) {
161
+ module.exports = __rspack_external_node_fs_5ea92f0c;
162
+ },
163
+ "node:path?c537" (module) {
164
+ module.exports = __rspack_external_node_path_c5b9b54f;
165
+ },
168
166
  "../../node_modules/.pnpm/@rspack+lite-tapable@1.1.0/node_modules/@rspack/lite-tapable/dist/index.cjs" (__unused_rspack_module, exports) {
169
167
  var __nested_rspack_require_18_37__ = {};
170
168
  __nested_rspack_require_18_37__.d = (exports1, definition)=>{
@@ -692,3 +690,5 @@ __webpack_require__.add({
692
690
  });
693
691
  }
694
692
  });
693
+ var RspackManifestPlugin = __webpack_require__("../../node_modules/.pnpm/rspack-manifest-plugin@5.2.1_@rspack+core@2.0.0-beta.7_@module-federation+runtime-tools@2.2.1_@swc+helpers@0.5.19_/node_modules/rspack-manifest-plugin/dist/index.js").RspackManifestPlugin;
694
+ export { RspackManifestPlugin };