@lynx-js/rspeedy-canary 0.10.8-canary-20250826-bc7f532b → 0.10.9-canary-20250826-d65ef500

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.
package/CHANGELOG.md CHANGED
@@ -1,6 +1,12 @@
1
1
  # @lynx-js/rspeedy
2
2
 
3
- ## 0.10.8-canary-20250826035202-bc7f532b048be97bae08b8b66137faaa7bc6deee
3
+ ## 0.10.9-canary-20250826132859-d65ef500d012f108f150e9a1a3f3e399e25bfde4
4
+
5
+ ### Patch Changes
6
+
7
+ - Support `rspeedy build --watch` ([#1579](https://github.com/lynx-family/lynx-stack/pull/1579))
8
+
9
+ ## 0.10.8
4
10
 
5
11
  ### Patch Changes
6
12
 
@@ -13,8 +19,8 @@
13
19
  - Fix missing `publicPath` using when `rspeedy dev --mode production`. ([#1310](https://github.com/lynx-family/lynx-stack/pull/1310))
14
20
 
15
21
  - Updated dependencies [[`aaca8f9`](https://github.com/lynx-family/lynx-stack/commit/aaca8f91d177061c7b0430cc5cb21a3602897534)]:
16
- - @lynx-js/cache-events-webpack-plugin@0.0.1-canary-20250826035202-bc7f532b048be97bae08b8b66137faaa7bc6deee
17
- - @lynx-js/chunk-loading-webpack-plugin@0.3.1-canary-20250826035202-bc7f532b048be97bae08b8b66137faaa7bc6deee
22
+ - @lynx-js/cache-events-webpack-plugin@0.0.1
23
+ - @lynx-js/chunk-loading-webpack-plugin@0.3.1
18
24
 
19
25
  ## 0.10.7
20
26
 
package/dist/index.js CHANGED
@@ -113,7 +113,7 @@ var __webpack_modules__ = {
113
113
  });
114
114
  var core_ = __webpack_require__("@rsbuild/core");
115
115
  var package_namespaceObject = {
116
- i8: "0.10.7"
116
+ i8: "0.10.8"
117
117
  };
118
118
  const version = package_namespaceObject.i8;
119
119
  const rspackVersion = core_.rspack.rspackVersion;
@@ -7,23 +7,42 @@ export const __webpack_modules__ = {
7
7
  __webpack_require__.d(__webpack_exports__, {
8
8
  build: ()=>build
9
9
  });
10
- var _rsbuild_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("@rsbuild/core");
11
- var _exit_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("./src/cli/exit.ts");
12
- var _create_rspeedy_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/create-rspeedy.ts");
13
- var _init_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/cli/init.ts");
14
- var _utils_is_ci_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./src/utils/is-ci.ts");
10
+ var node_path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("node:path");
11
+ var _rsbuild_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("@rsbuild/core");
12
+ var picocolors__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__("../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
13
+ var picocolors__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/ __webpack_require__.n(picocolors__WEBPACK_IMPORTED_MODULE_7__);
14
+ var _exit_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/cli/exit.ts");
15
+ var _create_rspeedy_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/create-rspeedy.ts");
16
+ var _init_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./src/cli/init.ts");
17
+ var _watch_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./src/cli/watch.ts");
18
+ var _utils_is_ci_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("./src/utils/is-ci.ts");
15
19
  async function build(cwd, buildOptions) {
16
- const shouldExit = 'true' !== process.env['RSDOCTOR'] || (0, _utils_is_ci_js__WEBPACK_IMPORTED_MODULE_4__.y)();
20
+ const shouldExit = 'true' !== process.env['RSDOCTOR'] || (0, _utils_is_ci_js__WEBPACK_IMPORTED_MODULE_6__.y)();
21
+ const isWatch = buildOptions.watch ?? false;
22
+ let onBeforeRestart = [];
17
23
  try {
18
- const { createRspeedyOptions } = await (0, _init_js__WEBPACK_IMPORTED_MODULE_3__.S)(cwd, buildOptions);
19
- const rspeedy = await (0, _create_rspeedy_js__WEBPACK_IMPORTED_MODULE_2__.S)(createRspeedyOptions);
20
- const { close } = await rspeedy.build();
21
- await close();
24
+ const { rspeedyConfig, configPath, createRspeedyOptions } = await (0, _init_js__WEBPACK_IMPORTED_MODULE_4__.S)(cwd, buildOptions);
25
+ if (isWatch) {
26
+ const watchedFiles = (0, _watch_js__WEBPACK_IMPORTED_MODULE_5__.z)(configPath, rspeedyConfig);
27
+ await (0, _watch_js__WEBPACK_IMPORTED_MODULE_5__.s)(watchedFiles.map((filePath)=>node_path__WEBPACK_IMPORTED_MODULE_0__["default"].isAbsolute(filePath) ? filePath : node_path__WEBPACK_IMPORTED_MODULE_0__["default"].join(cwd, filePath)), async (filename)=>{
28
+ _rsbuild_core__WEBPACK_IMPORTED_MODULE_1__.logger.info(`Restart because ${picocolors__WEBPACK_IMPORTED_MODULE_7___default().yellow(filename)} is changed.\n`);
29
+ const cleanup = onBeforeRestart.map((f)=>f());
30
+ onBeforeRestart = [];
31
+ await Promise.all(cleanup);
32
+ await build.call(this, cwd, buildOptions);
33
+ });
34
+ }
35
+ const rspeedy = await (0, _create_rspeedy_js__WEBPACK_IMPORTED_MODULE_3__.S)(createRspeedyOptions);
36
+ const { close } = await rspeedy.build({
37
+ watch: isWatch
38
+ });
39
+ if (isWatch) onBeforeRestart.push(close);
40
+ else await close();
22
41
  } catch (error) {
23
- _rsbuild_core__WEBPACK_IMPORTED_MODULE_0__.logger.error(error);
24
- if (shouldExit) return void (0, _exit_js__WEBPACK_IMPORTED_MODULE_1__.exit)(1);
42
+ _rsbuild_core__WEBPACK_IMPORTED_MODULE_1__.logger.error(error);
43
+ if (shouldExit) return void (0, _exit_js__WEBPACK_IMPORTED_MODULE_2__.exit)(1);
25
44
  }
26
- if (shouldExit) (0, _exit_js__WEBPACK_IMPORTED_MODULE_1__.exit)();
45
+ if (shouldExit && !isWatch) (0, _exit_js__WEBPACK_IMPORTED_MODULE_2__.exit)();
27
46
  }
28
47
  },
29
48
  "./src/cli/init.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
@@ -144,6 +163,48 @@ export const __webpack_modules__ = {
144
163
  };
145
164
  }
146
165
  },
166
+ "./src/cli/watch.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
167
+ __webpack_require__.d(__webpack_exports__, {
168
+ s: ()=>watchFiles,
169
+ z: ()=>getWatchedFiles
170
+ });
171
+ async function watchFiles(files, callback) {
172
+ const chokidar = await __webpack_require__.e("vendors-node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js").then(__webpack_require__.bind(__webpack_require__, "../../../node_modules/.pnpm/chokidar@4.0.3/node_modules/chokidar/esm/index.js"));
173
+ const watcher = chokidar.default.watch(files, {
174
+ ignoreInitial: true,
175
+ ignorePermissionErrors: true
176
+ });
177
+ const cb = debounce((event, filePath)=>{
178
+ const startTime = Date.now();
179
+ watcher.close().then(()=>callback(filePath, startTime, event));
180
+ }, 300);
181
+ watcher.once('add', cb.bind(null, 'add'));
182
+ watcher.once('change', cb.bind(null, 'change'));
183
+ watcher.once('unlink', cb.bind(null, 'unlink'));
184
+ }
185
+ function debounce(func, wait) {
186
+ let timeoutId = null;
187
+ return (...args)=>{
188
+ if (null !== timeoutId) clearTimeout(timeoutId);
189
+ timeoutId = setTimeout(()=>{
190
+ func(...args);
191
+ }, wait);
192
+ };
193
+ }
194
+ function getWatchedFiles(configPath, rspeedyConfig) {
195
+ const watchedFiles = [
196
+ configPath
197
+ ];
198
+ if (Array.isArray(rspeedyConfig.dev?.watchFiles)) watchedFiles.push(...rspeedyConfig.dev.watchFiles.filter((item)=>'reload-server' === item.type).flatMap((item)=>item.paths));
199
+ else if (rspeedyConfig.dev?.watchFiles?.type === 'reload-server') {
200
+ const { paths } = rspeedyConfig.dev.watchFiles;
201
+ watchedFiles.push(...Array.isArray(paths) ? paths : [
202
+ paths
203
+ ]);
204
+ }
205
+ return watchedFiles;
206
+ }
207
+ },
147
208
  "./src/create-rspeedy.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
148
209
  __webpack_require__.d(__webpack_exports__, {
149
210
  S: ()=>createRspeedy
@@ -15,7 +15,7 @@ export const __webpack_modules__ = {
15
15
  const cwd = process.cwd();
16
16
  program.name('rspeedy').usage('<command> [options]').version(_version_js__WEBPACK_IMPORTED_MODULE_0__.version).option('--unmanaged', 'Force to use the unmanaged version of Rspeedy, instead of the locally installed.').showHelpAfterError(true).showSuggestionAfterError(true).exitOverride();
17
17
  const buildCommand = program.command('build');
18
- buildCommand.description('Build the project in production mode').option('--environment <name...>', 'specify the name of environment to build').action((buildOptions)=>__webpack_require__.e("src_cli_build_ts").then(__webpack_require__.bind(__webpack_require__, "./src/cli/build.ts")).then(({ build })=>build.call(buildCommand, cwd, buildOptions)));
18
+ buildCommand.description('Build the project in production mode').option('--environment <name...>', 'specify the name of environment to build').option('--watch', 'Enable watch mode to automatically rebuild on file changes').action((buildOptions)=>__webpack_require__.e("src_cli_build_ts").then(__webpack_require__.bind(__webpack_require__, "./src/cli/build.ts")).then(({ build })=>build.call(buildCommand, cwd, buildOptions)));
19
19
  const devCommand = program.command('dev');
20
20
  devCommand.description('Run the dev server and watch for source file changes while serving.').option('--base <base>', 'specify the base path of the server').option('--environment <name...>', 'specify the name of environment to build').action((devOptions)=>__webpack_require__.e("src_cli_dev_ts").then(__webpack_require__.bind(__webpack_require__, "./src/cli/dev.ts")).then(({ dev })=>dev.call(devCommand, cwd, devOptions)));
21
21
  const inspectCommand = program.command('inspect');
@@ -40,7 +40,7 @@ export const __webpack_modules__ = {
40
40
  });
41
41
  var core_ = __webpack_require__("@rsbuild/core");
42
42
  var package_namespaceObject = {
43
- i8: "0.10.7"
43
+ i8: "0.10.8"
44
44
  };
45
45
  const version = package_namespaceObject.i8;
46
46
  const rspackVersion = core_.rspack.rspackVersion;
@@ -9,27 +9,19 @@ export const __webpack_modules__ = {
9
9
  });
10
10
  var node_path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__("node:path");
11
11
  var _rsbuild_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__("@rsbuild/core");
12
- var picocolors__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
13
- var picocolors__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/ __webpack_require__.n(picocolors__WEBPACK_IMPORTED_MODULE_5__);
12
+ var picocolors__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__("../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
13
+ var picocolors__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/ __webpack_require__.n(picocolors__WEBPACK_IMPORTED_MODULE_6__);
14
14
  var _create_rspeedy_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__("./src/create-rspeedy.ts");
15
15
  var _exit_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__("./src/cli/exit.ts");
16
16
  var _init_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__("./src/cli/init.ts");
17
+ var _watch_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__("./src/cli/watch.ts");
17
18
  async function dev(cwd, devOptions) {
18
19
  let onBeforeRestart = [];
19
20
  try {
20
21
  const { rspeedyConfig, configPath, createRspeedyOptions } = await (0, _init_js__WEBPACK_IMPORTED_MODULE_4__.S)(cwd, devOptions);
21
- const watchedFiles = [
22
- configPath
23
- ];
24
- if (Array.isArray(rspeedyConfig.dev?.watchFiles)) watchedFiles.push(...rspeedyConfig.dev.watchFiles.filter((item)=>'reload-server' === item.type).flatMap((item)=>item.paths));
25
- else if (rspeedyConfig.dev?.watchFiles?.type === 'reload-server') {
26
- const { paths } = rspeedyConfig.dev.watchFiles;
27
- watchedFiles.push(...Array.isArray(paths) ? paths : [
28
- paths
29
- ]);
30
- }
31
- await watchFiles(watchedFiles.map((filePath)=>node_path__WEBPACK_IMPORTED_MODULE_0__["default"].isAbsolute(filePath) ? filePath : node_path__WEBPACK_IMPORTED_MODULE_0__["default"].join(cwd, filePath)), async (filename)=>{
32
- _rsbuild_core__WEBPACK_IMPORTED_MODULE_1__.logger.info(`Restart because ${picocolors__WEBPACK_IMPORTED_MODULE_5___default().yellow(filename)} is changed.\n`);
22
+ const watchedFiles = (0, _watch_js__WEBPACK_IMPORTED_MODULE_5__.z)(configPath, rspeedyConfig);
23
+ await (0, _watch_js__WEBPACK_IMPORTED_MODULE_5__.s)(watchedFiles.map((filePath)=>node_path__WEBPACK_IMPORTED_MODULE_0__["default"].isAbsolute(filePath) ? filePath : node_path__WEBPACK_IMPORTED_MODULE_0__["default"].join(cwd, filePath)), async (filename)=>{
24
+ _rsbuild_core__WEBPACK_IMPORTED_MODULE_1__.logger.info(`Restart because ${picocolors__WEBPACK_IMPORTED_MODULE_6___default().yellow(filename)} is changed.\n`);
33
25
  const cleanup = onBeforeRestart.map((f)=>f());
34
26
  onBeforeRestart = [];
35
27
  await Promise.all(cleanup);
@@ -44,29 +36,6 @@ export const __webpack_modules__ = {
44
36
  (0, _exit_js__WEBPACK_IMPORTED_MODULE_3__.exit)(1);
45
37
  }
46
38
  }
47
- async function watchFiles(files, callback) {
48
- const chokidar = await __webpack_require__.e("vendors-node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js").then(__webpack_require__.bind(__webpack_require__, "../../../node_modules/.pnpm/chokidar@4.0.3/node_modules/chokidar/esm/index.js"));
49
- const watcher = chokidar.default.watch(files, {
50
- ignoreInitial: true,
51
- ignorePermissionErrors: true
52
- });
53
- const cb = debounce((event, filePath)=>{
54
- const startTime = Date.now();
55
- watcher.close().then(()=>callback(filePath, startTime, event));
56
- }, 300);
57
- watcher.once('add', cb.bind(null, 'add'));
58
- watcher.once('change', cb.bind(null, 'change'));
59
- watcher.once('unlink', cb.bind(null, 'unlink'));
60
- }
61
- function debounce(func, wait) {
62
- let timeoutId = null;
63
- return (...args)=>{
64
- if (null !== timeoutId) clearTimeout(timeoutId);
65
- timeoutId = setTimeout(()=>{
66
- func(...args);
67
- }, wait);
68
- };
69
- }
70
39
  },
71
40
  "./src/cli/init.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
72
41
  __webpack_require__.d(__webpack_exports__, {
@@ -186,6 +155,48 @@ export const __webpack_modules__ = {
186
155
  };
187
156
  }
188
157
  },
158
+ "./src/cli/watch.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
159
+ __webpack_require__.d(__webpack_exports__, {
160
+ s: ()=>watchFiles,
161
+ z: ()=>getWatchedFiles
162
+ });
163
+ async function watchFiles(files, callback) {
164
+ const chokidar = await __webpack_require__.e("vendors-node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js").then(__webpack_require__.bind(__webpack_require__, "../../../node_modules/.pnpm/chokidar@4.0.3/node_modules/chokidar/esm/index.js"));
165
+ const watcher = chokidar.default.watch(files, {
166
+ ignoreInitial: true,
167
+ ignorePermissionErrors: true
168
+ });
169
+ const cb = debounce((event, filePath)=>{
170
+ const startTime = Date.now();
171
+ watcher.close().then(()=>callback(filePath, startTime, event));
172
+ }, 300);
173
+ watcher.once('add', cb.bind(null, 'add'));
174
+ watcher.once('change', cb.bind(null, 'change'));
175
+ watcher.once('unlink', cb.bind(null, 'unlink'));
176
+ }
177
+ function debounce(func, wait) {
178
+ let timeoutId = null;
179
+ return (...args)=>{
180
+ if (null !== timeoutId) clearTimeout(timeoutId);
181
+ timeoutId = setTimeout(()=>{
182
+ func(...args);
183
+ }, wait);
184
+ };
185
+ }
186
+ function getWatchedFiles(configPath, rspeedyConfig) {
187
+ const watchedFiles = [
188
+ configPath
189
+ ];
190
+ if (Array.isArray(rspeedyConfig.dev?.watchFiles)) watchedFiles.push(...rspeedyConfig.dev.watchFiles.filter((item)=>'reload-server' === item.type).flatMap((item)=>item.paths));
191
+ else if (rspeedyConfig.dev?.watchFiles?.type === 'reload-server') {
192
+ const { paths } = rspeedyConfig.dev.watchFiles;
193
+ watchedFiles.push(...Array.isArray(paths) ? paths : [
194
+ paths
195
+ ]);
196
+ }
197
+ return watchedFiles;
198
+ }
199
+ },
189
200
  "./src/create-rspeedy.ts": function(__unused_webpack_module, __webpack_exports__, __webpack_require__) {
190
201
  __webpack_require__.d(__webpack_exports__, {
191
202
  S: ()=>createRspeedy
@@ -10,7 +10,7 @@ export const __webpack_modules__ = {
10
10
  });
11
11
  var core_ = __webpack_require__("@rsbuild/core");
12
12
  var package_namespaceObject = {
13
- i8: "0.10.7"
13
+ i8: "0.10.8"
14
14
  };
15
15
  const version = package_namespaceObject.i8;
16
16
  const rspackVersion = core_.rspack.rspackVersion;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@lynx-js/rspeedy-canary",
3
- "version": "0.10.8-canary-20250826-bc7f532b",
3
+ "version": "0.10.9-canary-20250826-d65ef500",
4
4
  "description": "A webpack/rspack-based frontend toolchain for Lynx",
5
5
  "keywords": [
6
6
  "webpack",
@@ -46,8 +46,8 @@
46
46
  "README.md"
47
47
  ],
48
48
  "dependencies": {
49
- "@lynx-js/cache-events-webpack-plugin": "npm:@lynx-js/cache-events-webpack-plugin-canary@0.0.1-canary-20250826-bc7f532b",
50
- "@lynx-js/chunk-loading-webpack-plugin": "npm:@lynx-js/chunk-loading-webpack-plugin-canary@0.3.1-canary-20250826-bc7f532b",
49
+ "@lynx-js/cache-events-webpack-plugin": "npm:@lynx-js/cache-events-webpack-plugin-canary@0.0.1",
50
+ "@lynx-js/chunk-loading-webpack-plugin": "npm:@lynx-js/chunk-loading-webpack-plugin-canary@0.3.1",
51
51
  "@lynx-js/webpack-dev-transport": "npm:@lynx-js/webpack-dev-transport-canary@0.2.0",
52
52
  "@lynx-js/websocket": "npm:@lynx-js/websocket-canary@0.0.4",
53
53
  "@rsbuild/core": "1.4.15",