@rsbuild/core 1.4.15 → 1.4.16

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.
@@ -1,8 +1,8 @@
1
1
  (() => {
2
2
  var __webpack_modules__ = {
3
- 814: (module, __unused_webpack_exports, __nccwpck_require__) => {
3
+ 377: (module, __unused_webpack_exports, __nccwpck_require__) => {
4
4
  const path = __nccwpck_require__(928);
5
- const launch = __nccwpck_require__(586);
5
+ const launch = __nccwpck_require__(719);
6
6
  module.exports = (specifiedEditor, srcRoot, onErrorCallback) => {
7
7
  if (typeof specifiedEditor === "function") {
8
8
  onErrorCallback = specifiedEditor;
@@ -16,7 +16,10 @@
16
16
  return function launchEditorMiddleware(req, res) {
17
17
  let url;
18
18
  try {
19
- url = new URL(req.url);
19
+ const fullUrl = req.url.startsWith("http")
20
+ ? req.url
21
+ : `http://localhost${req.url}`;
22
+ url = new URL(fullUrl);
20
23
  } catch (_err) {
21
24
  res.statusCode = 500;
22
25
  res.end(`launch-editor-middleware: invalid URL.`);
@@ -38,7 +41,7 @@
38
41
  };
39
42
  };
40
43
  },
41
- 575: (module) => {
44
+ 218: (module) => {
42
45
  module.exports = {
43
46
  atom: "atom",
44
47
  Brackets: "brackets",
@@ -68,7 +71,7 @@
68
71
  zed: "zed",
69
72
  };
70
73
  },
71
- 780: (module) => {
74
+ 193: (module) => {
72
75
  module.exports = {
73
76
  "/Applications/Atom.app/Contents/MacOS/Atom": "atom",
74
77
  "/Applications/Atom Beta.app/Contents/MacOS/Atom Beta":
@@ -116,7 +119,7 @@
116
119
  "/Applications/Zed.app/Contents/MacOS/zed": "zed",
117
120
  };
118
121
  },
119
- 708: (module) => {
122
+ 361: (module) => {
120
123
  module.exports = [
121
124
  "Brackets.exe",
122
125
  "Code.exe",
@@ -145,7 +148,7 @@
145
148
  "trae.exe",
146
149
  ];
147
150
  },
148
- 118: (module, __unused_webpack_exports, __nccwpck_require__) => {
151
+ 421: (module, __unused_webpack_exports, __nccwpck_require__) => {
149
152
  const path = __nccwpck_require__(928);
150
153
  module.exports = function getArgumentsForPosition(
151
154
  editor,
@@ -217,13 +220,13 @@
217
220
  return [fileName];
218
221
  };
219
222
  },
220
- 191: (module, __unused_webpack_exports, __nccwpck_require__) => {
223
+ 346: (module, __unused_webpack_exports, __nccwpck_require__) => {
221
224
  const path = __nccwpck_require__(928);
222
225
  const shellQuote = __nccwpck_require__(710);
223
226
  const childProcess = __nccwpck_require__(317);
224
- const COMMON_EDITORS_MACOS = __nccwpck_require__(780);
225
- const COMMON_EDITORS_LINUX = __nccwpck_require__(575);
226
- const COMMON_EDITORS_WIN = __nccwpck_require__(708);
227
+ const COMMON_EDITORS_MACOS = __nccwpck_require__(193);
228
+ const COMMON_EDITORS_LINUX = __nccwpck_require__(218);
229
+ const COMMON_EDITORS_WIN = __nccwpck_require__(361);
227
230
  module.exports = function guessEditor(specifiedEditor) {
228
231
  if (specifiedEditor) {
229
232
  return shellQuote.parse(specifiedEditor);
@@ -303,14 +306,14 @@
303
306
  return [null];
304
307
  };
305
308
  },
306
- 586: (module, __unused_webpack_exports, __nccwpck_require__) => {
309
+ 719: (module, __unused_webpack_exports, __nccwpck_require__) => {
307
310
  const fs = __nccwpck_require__(896);
308
311
  const os = __nccwpck_require__(857);
309
312
  const path = __nccwpck_require__(928);
310
313
  const colors = __nccwpck_require__(717);
311
314
  const childProcess = __nccwpck_require__(317);
312
- const guessEditor = __nccwpck_require__(191);
313
- const getArgumentsForPosition = __nccwpck_require__(118);
315
+ const guessEditor = __nccwpck_require__(346);
316
+ const getArgumentsForPosition = __nccwpck_require__(421);
314
317
  function wrapErrorCallback(cb) {
315
318
  return (fileName, errorMessage) => {
316
319
  console.log();
@@ -710,6 +713,6 @@
710
713
  }
711
714
  if (typeof __nccwpck_require__ !== "undefined")
712
715
  __nccwpck_require__.ab = __dirname + "/";
713
- var __webpack_exports__ = __nccwpck_require__(814);
716
+ var __webpack_exports__ = __nccwpck_require__(377);
714
717
  module.exports = __webpack_exports__;
715
718
  })();
@@ -1 +1 @@
1
- {"name":"launch-editor-middleware","author":"Evan You","version":"2.11.0","license":"MIT","types":"index.d.ts","type":"commonjs"}
1
+ {"name":"launch-editor-middleware","author":"Evan You","version":"2.11.1","license":"MIT","types":"index.d.ts","type":"commonjs"}
package/dist/index.cjs CHANGED
@@ -3309,7 +3309,7 @@ ${section.body}` : section.body).join("\n\n"));
3309
3309
  async function createContext(options, userConfig) {
3310
3310
  let { cwd } = options, rootPath = userConfig.root ? ensureAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = (0, external_node_path_namespaceObject.join)(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0, bundlerType = userConfig.provider ? 'webpack' : 'rspack';
3311
3311
  return {
3312
- version: "1.4.15",
3312
+ version: "1.4.16",
3313
3313
  rootPath,
3314
3314
  distPath: '',
3315
3315
  cachePath,
@@ -9026,11 +9026,11 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
9026
9026
  ].includes(level) && (index_js_namespaceObject.logger.level = level);
9027
9027
  }
9028
9028
  let { npm_execpath } = process.env;
9029
- (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && index_js_namespaceObject.logger.log(), index_js_namespaceObject.logger.greet(` Rsbuild v1.4.15\n`);
9029
+ (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && index_js_namespaceObject.logger.log(), index_js_namespaceObject.logger.greet(` Rsbuild v1.4.16\n`);
9030
9030
  try {
9031
9031
  !function() {
9032
9032
  let cli = ((name = "")=>new CAC(name))('rsbuild');
9033
- cli.help(), cli.version("1.4.15"), cli.option('--base <base>', 'specify the base path of the server').option('-c, --config <config>', 'specify the configuration file, can be a relative or absolute path').option('--config-loader <loader>', 'specify the loader to load the config file, can be `jiti` or `native`', {
9033
+ cli.help(), cli.version("1.4.16"), cli.option('--base <base>', 'specify the base path of the server').option('-c, --config <config>', 'specify the configuration file, can be a relative or absolute path').option('--config-loader <loader>', 'specify the loader to load the config file, can be `jiti` or `native`', {
9034
9034
  default: 'jiti'
9035
9035
  }).option('-r, --root <root>', 'specify the project root directory, can be an absolute path or a path relative to cwd').option('-m, --mode <mode>', 'specify the build mode, can be `development`, `production` or `none`').option('--log-level <level>', 'specify the log level, can be `info`, `warn`, `error` or `silent`').option('--env-mode <mode>', 'specify the env mode to load the `.env.[mode]` file').option('--environment <name>', 'specify the name of environment to build', {
9036
9036
  type: [
@@ -9088,7 +9088,7 @@ throw new Error('Failed to load Node.js addon: "${name}"\\n' + error);
9088
9088
  index_js_namespaceObject.logger.error('Failed to start Rsbuild CLI.'), index_js_namespaceObject.logger.error(err);
9089
9089
  }
9090
9090
  }
9091
- let src_version = "1.4.15";
9091
+ let src_version = "1.4.16";
9092
9092
  })(), exports.PLUGIN_CSS_NAME = __webpack_exports__.PLUGIN_CSS_NAME, exports.PLUGIN_SWC_NAME = __webpack_exports__.PLUGIN_SWC_NAME, exports.createRsbuild = __webpack_exports__.createRsbuild, exports.defaultAllowedOrigins = __webpack_exports__.defaultAllowedOrigins, exports.defineConfig = __webpack_exports__.defineConfig, exports.ensureAssetPrefix = __webpack_exports__.ensureAssetPrefix, exports.loadConfig = __webpack_exports__.loadConfig, exports.loadEnv = __webpack_exports__.loadEnv, exports.logger = __webpack_exports__.logger, exports.mergeRsbuildConfig = __webpack_exports__.mergeRsbuildConfig, exports.rspack = __webpack_exports__.rspack, exports.runCLI = __webpack_exports__.runCLI, exports.version = __webpack_exports__.version, __webpack_exports__)-1 === [
9093
9093
  "PLUGIN_CSS_NAME",
9094
9094
  "PLUGIN_SWC_NAME",
package/dist/index.js CHANGED
@@ -3112,7 +3112,7 @@ async function updateEnvironmentContext(context, configs) {
3112
3112
  async function createContext(options, userConfig) {
3113
3113
  let { cwd } = options, rootPath = userConfig.root ? ensureAbsolutePath(cwd, userConfig.root) : cwd, rsbuildConfig = await withDefaultConfig(rootPath, userConfig), cachePath = join(rootPath, 'node_modules', '.cache'), specifiedEnvironments = options.environment && options.environment.length > 0 ? options.environment : void 0, bundlerType = userConfig.provider ? 'webpack' : 'rspack';
3114
3114
  return {
3115
- version: "1.4.15",
3115
+ version: "1.4.16",
3116
3116
  rootPath,
3117
3117
  distPath: '',
3118
3118
  cachePath,
@@ -8799,11 +8799,11 @@ function runCLI() {
8799
8799
  ].includes(level) && (logger.level = level);
8800
8800
  }
8801
8801
  let { npm_execpath } = process.env;
8802
- (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && logger.log(), logger.greet(` Rsbuild v1.4.15\n`);
8802
+ (!npm_execpath || npm_execpath.includes('npx-cli.js') || npm_execpath.includes('.bun')) && logger.log(), logger.greet(` Rsbuild v1.4.16\n`);
8803
8803
  try {
8804
8804
  !function() {
8805
8805
  let cli = ((name = "")=>new CAC(name))('rsbuild');
8806
- cli.help(), cli.version("1.4.15"), cli.option('--base <base>', 'specify the base path of the server').option('-c, --config <config>', 'specify the configuration file, can be a relative or absolute path').option('--config-loader <loader>', 'specify the loader to load the config file, can be `jiti` or `native`', {
8806
+ cli.help(), cli.version("1.4.16"), cli.option('--base <base>', 'specify the base path of the server').option('-c, --config <config>', 'specify the configuration file, can be a relative or absolute path').option('--config-loader <loader>', 'specify the loader to load the config file, can be `jiti` or `native`', {
8807
8807
  default: 'jiti'
8808
8808
  }).option('-r, --root <root>', 'specify the project root directory, can be an absolute path or a path relative to cwd').option('-m, --mode <mode>', 'specify the build mode, can be `development`, `production` or `none`').option('--log-level <level>', 'specify the log level, can be `info`, `warn`, `error` or `silent`').option('--env-mode <mode>', 'specify the env mode to load the `.env.[mode]` file').option('--environment <name>', 'specify the name of environment to build', {
8809
8809
  type: [
@@ -8861,5 +8861,5 @@ function runCLI() {
8861
8861
  logger.error('Failed to start Rsbuild CLI.'), logger.error(err);
8862
8862
  }
8863
8863
  }
8864
- let src_version = "1.4.15";
8864
+ let src_version = "1.4.16";
8865
8865
  export { PLUGIN_CSS_NAME, PLUGIN_SWC_NAME, createRsbuild, defaultAllowedOrigins, defineConfig, ensureAssetPrefix, loadConfig_loadConfig as loadConfig, loadEnv, logger, mergeRsbuildConfig, rspack_rspack as rspack, runCLI, src_version as version };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rsbuild/core",
3
- "version": "1.4.15",
3
+ "version": "1.4.16",
4
4
  "description": "The Rspack-based build tool.",
5
5
  "homepage": "https://rsbuild.rs",
6
6
  "bugs": {
@@ -70,7 +70,7 @@
70
70
  "dotenv-expand": "12.0.2",
71
71
  "html-rspack-plugin": "6.1.2",
72
72
  "http-proxy-middleware": "^2.0.9",
73
- "launch-editor-middleware": "^2.11.0",
73
+ "launch-editor-middleware": "^2.11.1",
74
74
  "mrmime": "^2.0.1",
75
75
  "on-finished": "2.4.1",
76
76
  "open": "^10.2.0",