@lynx-js/rspeedy-canary 0.13.0-canary-20260105-12629a30 → 0.13.0-canary-20260105-ea78a1ca

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 (66) hide show
  1. package/CHANGELOG.md +1 -1
  2. package/dist/{0~vendors-node_modules_pnpm_ipaddr_js_2_3_0_node_modules_ipaddr_js_lib_ipaddr_js.js → 0~node_modules_pnpm_ipaddr_js_2_3_0_node_modules_ipaddr_js_lib_ipaddr_js.js} +3 -6
  3. package/dist/0~src_cli_exit_ts.js +98 -108
  4. package/dist/0~src_config_output_dist-path_ts.js +2 -0
  5. package/dist/0~src_config_validate_ts.js +41917 -41925
  6. package/dist/0~src_plugins_api_plugin_ts.js +21 -31
  7. package/dist/0~src_plugins_chunkLoading_plugin_ts.js +10 -20
  8. package/dist/0~src_plugins_dev_plugin_ts.js +168 -179
  9. package/dist/0~src_plugins_emitOnErrors_plugin_ts.js +10 -20
  10. package/dist/0~src_plugins_index_ts.js +63 -51
  11. package/dist/0~src_plugins_inspect_plugin_ts.js +434 -39
  12. package/dist/0~src_plugins_minify_plugin_ts.js +66 -76
  13. package/dist/0~src_plugins_optimization_plugin_ts.js +14 -24
  14. package/dist/0~src_plugins_output_plugin_ts.js +29 -45
  15. package/dist/0~src_plugins_resolve_plugin_ts.js +10 -20
  16. package/dist/0~src_plugins_rsdoctor_plugin_ts.js +39 -49
  17. package/dist/0~src_plugins_sourcemap_plugin_ts.js +86 -96
  18. package/dist/0~src_plugins_swc_plugin_ts.js +20 -38
  19. package/dist/0~src_plugins_target_plugin_ts.js +21 -39
  20. package/dist/0~src_utils_getESVersionTarget_ts.js +4 -0
  21. package/dist/1~node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js +1422 -0
  22. package/dist/{1~vendors-node_modules_pnpm_commander_13_1_0_node_modules_commander_esm_mjs.js → 1~node_modules_pnpm_commander_13_1_0_node_modules_commander_esm_mjs.js} +17 -24
  23. package/dist/{1~vendors-node_modules_pnpm_ipaddr_js_2_3_0_node_modules_ipaddr_js_lib_ipaddr_js.js → 1~node_modules_pnpm_ipaddr_js_2_3_0_node_modules_ipaddr_js_lib_ipaddr_js.js} +3 -6
  24. package/dist/1~src_cli_build_ts.js +35 -424
  25. package/dist/1~src_cli_commands_ts.js +56 -74
  26. package/dist/1~src_cli_dev_ts.js +29 -410
  27. package/dist/1~src_cli_init_ts-src_create-rspeedy_ts.js +318 -0
  28. package/dist/1~src_cli_inspect_ts.js +18 -356
  29. package/dist/1~src_cli_preview_ts.js +23 -359
  30. package/dist/1~src_cli_watch_ts.js +39 -0
  31. package/dist/1~src_config_output_dist-path_ts.js +2 -0
  32. package/dist/1~src_config_validate_ts.js +41917 -41925
  33. package/dist/1~src_plugins_api_plugin_ts.js +22 -31
  34. package/dist/1~src_plugins_chunkLoading_plugin_ts.js +10 -20
  35. package/dist/1~src_plugins_dev_plugin_ts.js +170 -179
  36. package/dist/1~src_plugins_emitOnErrors_plugin_ts.js +10 -20
  37. package/dist/1~src_plugins_index_ts.js +63 -51
  38. package/dist/1~src_plugins_inspect_plugin_ts.js +436 -39
  39. package/dist/1~src_plugins_minify_plugin_ts.js +66 -76
  40. package/dist/1~src_plugins_optimization_plugin_ts.js +14 -24
  41. package/dist/1~src_plugins_output_plugin_ts.js +29 -45
  42. package/dist/1~src_plugins_resolve_plugin_ts.js +10 -20
  43. package/dist/1~src_plugins_rsdoctor_plugin_ts.js +37 -55
  44. package/dist/1~src_plugins_sourcemap_plugin_ts.js +86 -96
  45. package/dist/1~src_plugins_swc_plugin_ts.js +20 -38
  46. package/dist/1~src_plugins_target_plugin_ts.js +21 -39
  47. package/dist/1~src_utils_getESVersionTarget_ts.js +4 -0
  48. package/dist/1~src_utils_is-ci_ts.js +4 -0
  49. package/dist/1~src_version_ts.js +6 -18
  50. package/dist/cli/main.js +1 -357
  51. package/dist/cli/start.js +16 -130
  52. package/dist/index.js +1 -524
  53. package/dist/node_fs.js +7 -0
  54. package/dist/node_path.js +7 -0
  55. package/dist/node_url.js +1 -0
  56. package/dist/rslib-runtime.js +75 -0
  57. package/dist/src_cli_main_ts.js +149 -0
  58. package/dist/src_debug_ts.js +93 -0
  59. package/dist/src_index_ts.js +381 -0
  60. package/package.json +1 -1
  61. package/dist/0~vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc.js +0 -417
  62. package/dist/1~events-fs-fs_promises-os-path-stream.js +0 -30
  63. package/dist/1~node_child_process-node_events-node_fs-node_path.js +0 -22
  64. package/dist/1~vendors-node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js +0 -1432
  65. package/dist/1~vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc.js +0 -417
  66. /package/dist/{1~vendors-node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js.LICENSE.txt → 1~node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js.LICENSE.txt} +0 -0
package/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @lynx-js/rspeedy
2
2
 
3
- ## 0.13.0-canary-20260105052834-12629a308b843dc6aa68eefa15a89b3891576083
3
+ ## 0.13.0-canary-20260105073431-ea78a1cabbd5cf53fad01d3567e2d10df6e579b2
4
4
 
5
5
  ### Minor Changes
6
6
 
@@ -1,8 +1,5 @@
1
- export const __rspack_esm_id = "vendors-node_modules_pnpm_ipaddr_js_2_3_0_node_modules_ipaddr_js_lib_ipaddr_js";
2
- export const __rspack_esm_ids = [
3
- "vendors-node_modules_pnpm_ipaddr_js_2_3_0_node_modules_ipaddr_js_lib_ipaddr_js"
4
- ];
5
- export const __webpack_modules__ = {
1
+ import { __webpack_require__ } from "./rslib-runtime.js";
2
+ __webpack_require__.add({
6
3
  "../../../node_modules/.pnpm/ipaddr.js@2.3.0/node_modules/ipaddr.js/lib/ipaddr.js" (module) {
7
4
  (function(root) {
8
5
  'use strict';
@@ -1070,4 +1067,4 @@ export const __webpack_modules__ = {
1070
1067
  else root.ipaddr = ipaddr;
1071
1068
  })(this);
1072
1069
  }
1073
- };
1070
+ });
@@ -1,112 +1,102 @@
1
+ import { __webpack_require__ } from "./rslib-runtime.js";
1
2
  import node_process from "node:process";
2
- export const __rspack_esm_id = "src_cli_exit_ts";
3
- export const __rspack_esm_ids = [
4
- "src_cli_exit_ts"
5
- ];
6
- export const __webpack_modules__ = {
7
- "./src/cli/exit.ts" (__unused_rspack_module, __webpack_exports__, __webpack_require__) {
8
- __webpack_require__.d(__webpack_exports__, {
9
- exit: ()=>exit_exit
10
- });
11
- var core_ = __webpack_require__("@rsbuild/core");
12
- const asyncCallbacks = new Set();
13
- const callbacks = new Set();
14
- let isCalled = false;
15
- let isRegistered = false;
16
- async function exit(shouldManuallyExit, isSynchronous, signal) {
17
- if (isCalled) return;
18
- isCalled = true;
19
- if (asyncCallbacks.size > 0 && isSynchronous) console.error("SYNCHRONOUS TERMINATION NOTICE: When explicitly exiting the process via process.exit or via a parent process, asynchronous tasks in your exitHooks will not run. Either remove these tasks, use gracefulExit() instead of process.exit(), or ensure your parent process sends a SIGINT to the process running this code.");
20
- const exitCode = 128 + signal;
21
- const done = (force = false)=>{
22
- if (true === force || true === shouldManuallyExit) node_process.exit(exitCode);
23
- };
24
- for (const callback of callbacks)callback(exitCode);
25
- if (isSynchronous) return void done();
26
- const promises = [];
27
- let forceAfter = 0;
28
- for (const [callback, wait] of asyncCallbacks){
29
- forceAfter = Math.max(forceAfter, wait);
30
- promises.push(Promise.resolve(callback(exitCode)));
31
- }
32
- const asyncTimer = setTimeout(()=>{
33
- done(true);
34
- }, forceAfter);
35
- await Promise.all(promises);
36
- clearTimeout(asyncTimer);
37
- done();
38
- }
39
- function addHook(options) {
40
- const { onExit, wait, isSynchronous } = options;
41
- const asyncCallbackConfig = [
42
- onExit,
43
- wait
44
- ];
45
- if (isSynchronous) callbacks.add(onExit);
46
- else asyncCallbacks.add(asyncCallbackConfig);
47
- if (!isRegistered) {
48
- isRegistered = true;
49
- node_process.once('beforeExit', exit.bind(void 0, true, false, -128));
50
- node_process.once('SIGINT', exit.bind(void 0, true, false, 2));
51
- node_process.once('SIGTERM', exit.bind(void 0, true, false, 15));
52
- node_process.once('exit', exit.bind(void 0, false, true, 0));
53
- node_process.on('message', (message)=>{
54
- if ('shutdown' === message) exit(true, true, -128);
55
- });
56
- }
57
- return ()=>{
58
- if (isSynchronous) callbacks.delete(onExit);
59
- else asyncCallbacks.delete(asyncCallbackConfig);
60
- };
61
- }
62
- function asyncExitHook(onExit, options = {}) {
63
- if ('function' != typeof onExit) throw new TypeError('onExit must be a function');
64
- if (!('number' == typeof options.wait && options.wait > 0)) throw new TypeError('wait must be set to a positive numeric value');
65
- return addHook({
66
- onExit,
67
- wait: options.wait,
68
- isSynchronous: false
69
- });
70
- }
71
- function gracefulExit(signal = 0) {
72
- exit(true, false, -128 + signal);
73
- }
74
- var picocolors = __webpack_require__("../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
75
- var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
76
- var debug = __webpack_require__("./src/debug.ts");
77
- const start = Date.now();
78
- const exitPromises = [];
79
- const unsubscribe = asyncExitHook(exit_onExit, {
80
- wait: 1000
81
- });
82
- process.on('unhandledRejection', async (reason)=>{
83
- core_.logger.error('Unhandled Rejection with reason:', reason instanceof Error ? reason : new Error(JSON.stringify(reason)));
84
- unsubscribe();
85
- await exit_onExit(1);
86
- process.exit(1);
87
- });
88
- let interrupted = false;
89
- process.on('SIGINT', ()=>{
90
- if (interrupted) {
91
- core_.logger.info("Force exiting Rspeedy.");
92
- return process.exit(130);
93
- }
94
- interrupted = true;
95
- core_.logger.info(`Gracefully shutting down. Please wait... (Press ${picocolors_default().cyan('Ctrl+C')} again to force exit)`);
96
- exit_exit(130);
3
+ import { debug, logger } from "./src_index_ts.js";
4
+ const asyncCallbacks = new Set();
5
+ const callbacks = new Set();
6
+ let isCalled = false;
7
+ let isRegistered = false;
8
+ async function exit(shouldManuallyExit, isSynchronous, signal) {
9
+ if (isCalled) return;
10
+ isCalled = true;
11
+ if (asyncCallbacks.size > 0 && isSynchronous) console.error("SYNCHRONOUS TERMINATION NOTICE: When explicitly exiting the process via process.exit or via a parent process, asynchronous tasks in your exitHooks will not run. Either remove these tasks, use gracefulExit() instead of process.exit(), or ensure your parent process sends a SIGINT to the process running this code.");
12
+ const exitCode = 128 + signal;
13
+ const done = (force = false)=>{
14
+ if (true === force || true === shouldManuallyExit) node_process.exit(exitCode);
15
+ };
16
+ for (const callback of callbacks)callback(exitCode);
17
+ if (isSynchronous) return void done();
18
+ const promises = [];
19
+ let forceAfter = 0;
20
+ for (const [callback, wait] of asyncCallbacks){
21
+ forceAfter = Math.max(forceAfter, wait);
22
+ promises.push(Promise.resolve(callback(exitCode)));
23
+ }
24
+ const asyncTimer = setTimeout(()=>{
25
+ done(true);
26
+ }, forceAfter);
27
+ await Promise.all(promises);
28
+ clearTimeout(asyncTimer);
29
+ done();
30
+ }
31
+ function addHook(options) {
32
+ const { onExit, wait, isSynchronous } = options;
33
+ const asyncCallbackConfig = [
34
+ onExit,
35
+ wait
36
+ ];
37
+ if (isSynchronous) callbacks.add(onExit);
38
+ else asyncCallbacks.add(asyncCallbackConfig);
39
+ if (!isRegistered) {
40
+ isRegistered = true;
41
+ node_process.once('beforeExit', exit.bind(void 0, true, false, -128));
42
+ node_process.once('SIGINT', exit.bind(void 0, true, false, 2));
43
+ node_process.once('SIGTERM', exit.bind(void 0, true, false, 15));
44
+ node_process.once('exit', exit.bind(void 0, false, true, 0));
45
+ node_process.on('message', (message)=>{
46
+ if ('shutdown' === message) exit(true, true, -128);
97
47
  });
98
- let previousSignal = null;
99
- const exit_exit = (signal = 0)=>{
100
- if (null !== previousSignal) (0, debug.Yz)(`graceful exit called multiple times, current: ${signal}, previous: ${previousSignal}`);
101
- previousSignal = signal;
102
- (0, debug.Yz)(`graceful exit process with signal: ${signal}`);
103
- gracefulExit(signal);
104
- };
105
- async function exit_onExit(signal) {
106
- const duration = Date.now() - start;
107
- (0, debug.Yz)(`exit hook fired with signal: ${signal}, duration: ${duration}`);
108
- (0, debug.Yz)(`awaiting exit promises(length: ${exitPromises.length})...`);
109
- await Promise.allSettled(exitPromises);
110
- }
111
48
  }
49
+ return ()=>{
50
+ if (isSynchronous) callbacks.delete(onExit);
51
+ else asyncCallbacks.delete(asyncCallbackConfig);
52
+ };
53
+ }
54
+ function asyncExitHook(onExit, options = {}) {
55
+ if ('function' != typeof onExit) throw new TypeError('onExit must be a function');
56
+ if (!('number' == typeof options.wait && options.wait > 0)) throw new TypeError('wait must be set to a positive numeric value');
57
+ return addHook({
58
+ onExit,
59
+ wait: options.wait,
60
+ isSynchronous: false
61
+ });
62
+ }
63
+ function gracefulExit(signal = 0) {
64
+ exit(true, false, -128 + signal);
65
+ }
66
+ const picocolors = __webpack_require__("../../../node_modules/.pnpm/picocolors@1.1.1/node_modules/picocolors/picocolors.js");
67
+ var picocolors_default = /*#__PURE__*/ __webpack_require__.n(picocolors);
68
+ const start = Date.now();
69
+ const exitPromises = [];
70
+ const unsubscribe = asyncExitHook(exit_onExit, {
71
+ wait: 1000
72
+ });
73
+ process.on('unhandledRejection', async (reason)=>{
74
+ logger.error('Unhandled Rejection with reason:', reason instanceof Error ? reason : new Error(JSON.stringify(reason)));
75
+ unsubscribe();
76
+ await exit_onExit(1);
77
+ process.exit(1);
78
+ });
79
+ let interrupted = false;
80
+ process.on('SIGINT', ()=>{
81
+ if (interrupted) {
82
+ logger.info("Force exiting Rspeedy.");
83
+ return process.exit(130);
84
+ }
85
+ interrupted = true;
86
+ logger.info(`Gracefully shutting down. Please wait... (Press ${picocolors_default().cyan('Ctrl+C')} again to force exit)`);
87
+ exit_exit(130);
88
+ });
89
+ let previousSignal = null;
90
+ const exit_exit = (signal = 0)=>{
91
+ if (null !== previousSignal) debug(`graceful exit called multiple times, current: ${signal}, previous: ${previousSignal}`);
92
+ previousSignal = signal;
93
+ debug(`graceful exit process with signal: ${signal}`);
94
+ gracefulExit(signal);
112
95
  };
96
+ async function exit_onExit(signal) {
97
+ const duration = Date.now() - start;
98
+ debug(`exit hook fired with signal: ${signal}, duration: ${duration}`);
99
+ debug(`awaiting exit promises(length: ${exitPromises.length})...`);
100
+ await Promise.allSettled(exitPromises);
101
+ }
102
+ export { exit_exit };
@@ -0,0 +1,2 @@
1
+ const DEFAULT_DIST_PATH_INTERMEDIATE = '.rspeedy';
2
+ export { DEFAULT_DIST_PATH_INTERMEDIATE };