@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.
- package/CHANGELOG.md +1 -1
- 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
- package/dist/0~src_cli_exit_ts.js +98 -108
- package/dist/0~src_config_output_dist-path_ts.js +2 -0
- package/dist/0~src_config_validate_ts.js +41917 -41925
- package/dist/0~src_plugins_api_plugin_ts.js +21 -31
- package/dist/0~src_plugins_chunkLoading_plugin_ts.js +10 -20
- package/dist/0~src_plugins_dev_plugin_ts.js +168 -179
- package/dist/0~src_plugins_emitOnErrors_plugin_ts.js +10 -20
- package/dist/0~src_plugins_index_ts.js +63 -51
- package/dist/0~src_plugins_inspect_plugin_ts.js +434 -39
- package/dist/0~src_plugins_minify_plugin_ts.js +66 -76
- package/dist/0~src_plugins_optimization_plugin_ts.js +14 -24
- package/dist/0~src_plugins_output_plugin_ts.js +29 -45
- package/dist/0~src_plugins_resolve_plugin_ts.js +10 -20
- package/dist/0~src_plugins_rsdoctor_plugin_ts.js +39 -49
- package/dist/0~src_plugins_sourcemap_plugin_ts.js +86 -96
- package/dist/0~src_plugins_swc_plugin_ts.js +20 -38
- package/dist/0~src_plugins_target_plugin_ts.js +21 -39
- package/dist/0~src_utils_getESVersionTarget_ts.js +4 -0
- package/dist/1~node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js +1422 -0
- 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
- 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
- package/dist/1~src_cli_build_ts.js +35 -424
- package/dist/1~src_cli_commands_ts.js +56 -74
- package/dist/1~src_cli_dev_ts.js +29 -410
- package/dist/1~src_cli_init_ts-src_create-rspeedy_ts.js +318 -0
- package/dist/1~src_cli_inspect_ts.js +18 -356
- package/dist/1~src_cli_preview_ts.js +23 -359
- package/dist/1~src_cli_watch_ts.js +39 -0
- package/dist/1~src_config_output_dist-path_ts.js +2 -0
- package/dist/1~src_config_validate_ts.js +41917 -41925
- package/dist/1~src_plugins_api_plugin_ts.js +22 -31
- package/dist/1~src_plugins_chunkLoading_plugin_ts.js +10 -20
- package/dist/1~src_plugins_dev_plugin_ts.js +170 -179
- package/dist/1~src_plugins_emitOnErrors_plugin_ts.js +10 -20
- package/dist/1~src_plugins_index_ts.js +63 -51
- package/dist/1~src_plugins_inspect_plugin_ts.js +436 -39
- package/dist/1~src_plugins_minify_plugin_ts.js +66 -76
- package/dist/1~src_plugins_optimization_plugin_ts.js +14 -24
- package/dist/1~src_plugins_output_plugin_ts.js +29 -45
- package/dist/1~src_plugins_resolve_plugin_ts.js +10 -20
- package/dist/1~src_plugins_rsdoctor_plugin_ts.js +37 -55
- package/dist/1~src_plugins_sourcemap_plugin_ts.js +86 -96
- package/dist/1~src_plugins_swc_plugin_ts.js +20 -38
- package/dist/1~src_plugins_target_plugin_ts.js +21 -39
- package/dist/1~src_utils_getESVersionTarget_ts.js +4 -0
- package/dist/1~src_utils_is-ci_ts.js +4 -0
- package/dist/1~src_version_ts.js +6 -18
- package/dist/cli/main.js +1 -357
- package/dist/cli/start.js +16 -130
- package/dist/index.js +1 -524
- package/dist/node_fs.js +7 -0
- package/dist/node_path.js +7 -0
- package/dist/node_url.js +1 -0
- package/dist/rslib-runtime.js +75 -0
- package/dist/src_cli_main_ts.js +149 -0
- package/dist/src_debug_ts.js +93 -0
- package/dist/src_index_ts.js +381 -0
- package/package.json +1 -1
- package/dist/0~vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc.js +0 -417
- package/dist/1~events-fs-fs_promises-os-path-stream.js +0 -30
- package/dist/1~node_child_process-node_events-node_fs-node_path.js +0 -22
- package/dist/1~vendors-node_modules_pnpm_chokidar_4_0_3_node_modules_chokidar_esm_index_js.js +0 -1432
- package/dist/1~vendors-node_modules_pnpm_javascript-stringify_2_1_0_node_modules_javascript-stringify_dist_i-562fbc.js +0 -417
- /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,8 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
if (
|
|
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 };
|