@rife/logger 0.0.6-beta.16 → 0.0.6-beta.18
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/dist/cjs/common.cjs +9 -5
- package/dist/cjs/env.cjs +13 -9
- package/dist/cjs/index.cjs +9 -5
- package/dist/cjs/pino/index.cjs +9 -5
- package/dist/cjs/pino/rotate.cjs +12 -8
- package/dist/cjs/pino/worker/pino-file.cjs +177 -93
- package/dist/cjs/pino/worker/pino-pretty.cjs +9 -19
- package/dist/cjs/pino/worker/pino-rotate.cjs +12 -8
- package/dist/cjs/pino/worker/pino-worker.cjs +177 -93
- package/dist/cjs/pino/worker/thread-stream.cjs +107 -13
- package/dist/cjs/trace.cjs +9 -5
- package/dist/esm/common.mjs +2 -2
- package/dist/esm/pino/index.mjs +10 -10
- package/dist/esm/pino/rotate.mjs +2 -2
- package/dist/esm/pino/worker/pino-file.cjs +177 -93
- package/dist/esm/pino/worker/pino-pretty.cjs +9 -19
- package/dist/esm/pino/worker/pino-rotate.cjs +12 -8
- package/dist/esm/pino/worker/pino-worker.cjs +177 -93
- package/dist/esm/pino/worker/thread-stream.cjs +107 -13
- package/dist/worker/pino-file.cjs +177 -93
- package/dist/worker/pino-pretty.cjs +9 -19
- package/dist/worker/pino-rotate.cjs +12 -8
- package/dist/worker/pino-worker.cjs +177 -93
- package/dist/worker/thread-stream.cjs +107 -13
- package/package.json +3 -3
- package/src/pino/index.ts +3 -4
package/dist/cjs/trace.cjs
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __webpack_require__ = {};
|
|
3
3
|
(()=>{
|
|
4
|
-
__webpack_require__.d = (exports1,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
__webpack_require__.d = (exports1, getters, values)=>{
|
|
5
|
+
var define = (defs, kind)=>{
|
|
6
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports1, key)) Object.defineProperty(exports1, key, {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
[kind]: defs[key]
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
define(getters, "get");
|
|
12
|
+
define(values, "value");
|
|
9
13
|
};
|
|
10
14
|
})();
|
|
11
15
|
(()=>{
|
package/dist/esm/common.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import path from "path";
|
|
3
3
|
import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
|
|
4
|
-
var
|
|
5
|
-
const isEsm = '.mjs' === path.extname(
|
|
4
|
+
var __rspack_import_meta_filename__ = __rspack_fileURLToPath(import.meta.url);
|
|
5
|
+
const isEsm = '.mjs' === path.extname(__rspack_import_meta_filename__);
|
|
6
6
|
const isCjs = !isEsm;
|
|
7
7
|
export { isCjs, isEsm };
|
package/dist/esm/pino/index.mjs
CHANGED
|
@@ -5,17 +5,17 @@ import { genTraceId, getTraceId, runInTrace } from "../trace.mjs";
|
|
|
5
5
|
import { __webpack_require__ } from "../rslib-runtime.mjs";
|
|
6
6
|
import { fileURLToPath as __rspack_fileURLToPath } from "node:url";
|
|
7
7
|
import { dirname as __rspack_dirname } from "node:path";
|
|
8
|
-
|
|
8
|
+
var __rspack_import_meta_filename__ = __rspack_fileURLToPath(import.meta.url);
|
|
9
|
+
var __rspack_import_meta_dirname__ = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
|
|
10
|
+
import * as __rspack_external_pino_std_serializers_c7d9cf2d from "pino-std-serializers";
|
|
9
11
|
__webpack_require__.add({
|
|
10
12
|
"pino-std-serializers" (module) {
|
|
11
|
-
module.exports =
|
|
13
|
+
module.exports = __rspack_external_pino_std_serializers_c7d9cf2d;
|
|
12
14
|
}
|
|
13
15
|
});
|
|
14
|
-
var pino_filename = __rspack_fileURLToPath(import.meta.url);
|
|
15
|
-
var pino_dirname = __rspack_dirname(__rspack_fileURLToPath(import.meta.url));
|
|
16
16
|
function getPinoConfig() {
|
|
17
17
|
const targets = [];
|
|
18
|
-
const rotate = `./rotate${path.extname(
|
|
18
|
+
const rotate = `./rotate${path.extname(__rspack_import_meta_filename__)}`;
|
|
19
19
|
targets.push({
|
|
20
20
|
level: 'debug',
|
|
21
21
|
target: rotate,
|
|
@@ -24,11 +24,11 @@ function getPinoConfig() {
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
if ("u" > typeof __isNodeSingleFileBundle || "u" > typeof __isVite || global?.__remix_devServerHooks || 'development' !== process.env.NODE_ENV) globalThis.__bundlerPathsOverrides = {
|
|
27
|
-
'pino-pretty': path.join(
|
|
28
|
-
'pino-worker': path.join(
|
|
29
|
-
[rotate]: path.join(
|
|
30
|
-
'pino/file': path.join(
|
|
31
|
-
'thread-stream-worker': path.join(
|
|
27
|
+
'pino-pretty': path.join(__rspack_import_meta_dirname__, './worker/pino-pretty.cjs'),
|
|
28
|
+
'pino-worker': path.join(__rspack_import_meta_dirname__, './worker/pino-worker.cjs'),
|
|
29
|
+
[rotate]: path.join(__rspack_import_meta_dirname__, './worker/pino-rotate.cjs'),
|
|
30
|
+
'pino/file': path.join(__rspack_import_meta_dirname__, './worker/pino-file.cjs'),
|
|
31
|
+
'thread-stream-worker': path.join(__rspack_import_meta_dirname__, './worker/thread-stream.cjs'),
|
|
32
32
|
...globalThis.__bundlerPathsOverrides
|
|
33
33
|
};
|
|
34
34
|
'production' === process.env.NODE_ENV || void 0 !== process.env.VITEST || targets.push({
|
package/dist/esm/pino/rotate.mjs
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import "node:module";
|
|
2
2
|
import { __webpack_require__ } from "../rslib-runtime.mjs";
|
|
3
|
-
import * as
|
|
3
|
+
import * as __rspack_external_rotating_file_stream_a9540b88 from "rotating-file-stream";
|
|
4
4
|
__webpack_require__.add({
|
|
5
5
|
"rotating-file-stream" (module) {
|
|
6
|
-
module.exports =
|
|
6
|
+
module.exports = __rspack_external_rotating_file_stream_a9540b88;
|
|
7
7
|
}
|
|
8
8
|
});
|
|
9
9
|
const generator = (time, index)=>{
|
|
@@ -946,19 +946,32 @@ var __webpack_modules__ = {
|
|
|
946
946
|
return stringify;
|
|
947
947
|
}
|
|
948
948
|
},
|
|
949
|
-
"../../node_modules/.pnpm/thread-stream@4.
|
|
949
|
+
"../../node_modules/.pnpm/thread-stream@4.2.0/node_modules/thread-stream/index.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
950
950
|
"use strict";
|
|
951
|
-
const { version } = __webpack_require__("../../node_modules/.pnpm/thread-stream@4.
|
|
951
|
+
const { version } = __webpack_require__("../../node_modules/.pnpm/thread-stream@4.2.0/node_modules/thread-stream/package.json");
|
|
952
952
|
const { EventEmitter } = __webpack_require__("events");
|
|
953
953
|
const { Worker } = __webpack_require__("worker_threads");
|
|
954
954
|
const { join } = __webpack_require__("path");
|
|
955
955
|
const { pathToFileURL } = __webpack_require__("url");
|
|
956
|
-
const { wait } = __webpack_require__("../../node_modules/.pnpm/thread-stream@4.
|
|
957
|
-
const { WRITE_INDEX, READ_INDEX } = __webpack_require__("../../node_modules/.pnpm/thread-stream@4.
|
|
956
|
+
const { wait } = __webpack_require__("../../node_modules/.pnpm/thread-stream@4.2.0/node_modules/thread-stream/lib/wait.js");
|
|
957
|
+
const { WRITE_INDEX, READ_INDEX, SEQ_INDEX } = __webpack_require__("../../node_modules/.pnpm/thread-stream@4.2.0/node_modules/thread-stream/lib/indexes.js");
|
|
958
958
|
const buffer = __webpack_require__("buffer");
|
|
959
959
|
const assert = __webpack_require__("assert");
|
|
960
960
|
const kImpl = Symbol('kImpl');
|
|
961
961
|
const MAX_STRING = buffer.constants.MAX_STRING_LENGTH;
|
|
962
|
+
function noop() {}
|
|
963
|
+
function updateState(stream, fn) {
|
|
964
|
+
Atomics.add(stream[kImpl].state, SEQ_INDEX, 1);
|
|
965
|
+
fn();
|
|
966
|
+
Atomics.add(stream[kImpl].state, SEQ_INDEX, 1);
|
|
967
|
+
Atomics.notify(stream[kImpl].state, SEQ_INDEX);
|
|
968
|
+
}
|
|
969
|
+
function resetIndexes(stream) {
|
|
970
|
+
updateState(stream, ()=>{
|
|
971
|
+
Atomics.store(stream[kImpl].state, READ_INDEX, 0);
|
|
972
|
+
Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
|
|
973
|
+
});
|
|
974
|
+
}
|
|
962
975
|
class FakeWeakRef {
|
|
963
976
|
constructor(value){
|
|
964
977
|
this._value = value;
|
|
@@ -983,6 +996,7 @@ var __webpack_modules__ = {
|
|
|
983
996
|
const toExecute = bundlerOverrides['thread-stream-worker'] || join(__dirname, 'lib', 'worker.js');
|
|
984
997
|
const worker = new Worker(toExecute, {
|
|
985
998
|
...opts.workerOpts,
|
|
999
|
+
name: opts.workerOpts?.name || 'thread-stream',
|
|
986
1000
|
trackUnmanagedFds: false,
|
|
987
1001
|
workerData: {
|
|
988
1002
|
filename: 0 === filename.indexOf('file://') ? filename : pathToFileURL(filename).href,
|
|
@@ -1010,42 +1024,31 @@ var __webpack_modules__ = {
|
|
|
1010
1024
|
}
|
|
1011
1025
|
}
|
|
1012
1026
|
function nextFlush(stream) {
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
if (
|
|
1017
|
-
stream[kImpl].
|
|
1018
|
-
|
|
1019
|
-
|
|
1027
|
+
while(true){
|
|
1028
|
+
const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
|
|
1029
|
+
const leftover = stream[kImpl].data.length - writeIndex;
|
|
1030
|
+
if (leftover > 0) {
|
|
1031
|
+
if (0 === stream[kImpl].bufLen) {
|
|
1032
|
+
stream[kImpl].flushing = false;
|
|
1033
|
+
if (stream[kImpl].ending) end(stream);
|
|
1034
|
+
else if (stream[kImpl].needDrain) process.nextTick(drain, stream);
|
|
1035
|
+
return;
|
|
1036
|
+
}
|
|
1037
|
+
write(stream, leftover, noop);
|
|
1038
|
+
continue;
|
|
1039
|
+
}
|
|
1040
|
+
if (0 === leftover) {
|
|
1041
|
+
if (0 === writeIndex && 0 === stream[kImpl].bufLen) return;
|
|
1042
|
+
waitForRead(stream, ()=>{
|
|
1043
|
+
if (stream.destroyed) return;
|
|
1044
|
+
resetIndexes(stream);
|
|
1045
|
+
nextFlush(stream);
|
|
1046
|
+
});
|
|
1020
1047
|
return;
|
|
1021
1048
|
}
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
|
|
1026
|
-
write(stream, toWrite, nextFlush.bind(null, stream));
|
|
1027
|
-
} else stream.flush(()=>{
|
|
1028
|
-
if (stream.destroyed) return;
|
|
1029
|
-
Atomics.store(stream[kImpl].state, READ_INDEX, 0);
|
|
1030
|
-
Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
|
|
1031
|
-
Atomics.notify(stream[kImpl].state, READ_INDEX);
|
|
1032
|
-
while(toWriteBytes > stream[kImpl].data.length){
|
|
1033
|
-
leftover /= 2;
|
|
1034
|
-
toWrite = stream[kImpl].buf.slice(0, leftover);
|
|
1035
|
-
toWriteBytes = Buffer.byteLength(toWrite);
|
|
1036
|
-
}
|
|
1037
|
-
stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
|
|
1038
|
-
write(stream, toWrite, nextFlush.bind(null, stream));
|
|
1039
|
-
});
|
|
1040
|
-
} else if (0 === leftover) {
|
|
1041
|
-
if (0 === writeIndex && 0 === stream[kImpl].buf.length) return;
|
|
1042
|
-
stream.flush(()=>{
|
|
1043
|
-
Atomics.store(stream[kImpl].state, READ_INDEX, 0);
|
|
1044
|
-
Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
|
|
1045
|
-
Atomics.notify(stream[kImpl].state, READ_INDEX);
|
|
1046
|
-
nextFlush(stream);
|
|
1047
|
-
});
|
|
1048
|
-
} else destroy(stream, new Error('overwritten'));
|
|
1049
|
+
destroy(stream, new Error('overwritten'));
|
|
1050
|
+
return;
|
|
1051
|
+
}
|
|
1049
1052
|
}
|
|
1050
1053
|
function onWorkerMessage(msg) {
|
|
1051
1054
|
const stream = this.stream.deref();
|
|
@@ -1054,10 +1057,11 @@ var __webpack_modules__ = {
|
|
|
1054
1057
|
this.terminate();
|
|
1055
1058
|
return;
|
|
1056
1059
|
}
|
|
1060
|
+
if (msg?.code == null) return;
|
|
1057
1061
|
switch(msg.code){
|
|
1058
1062
|
case 'READY':
|
|
1059
1063
|
this.stream = new WeakRef1(stream);
|
|
1060
|
-
stream
|
|
1064
|
+
waitForRead(stream, ()=>{
|
|
1061
1065
|
stream[kImpl].ready = true;
|
|
1062
1066
|
stream.emit('ready');
|
|
1063
1067
|
});
|
|
@@ -1069,6 +1073,19 @@ var __webpack_modules__ = {
|
|
|
1069
1073
|
if (Array.isArray(msg.args)) stream.emit(msg.name, ...msg.args);
|
|
1070
1074
|
else stream.emit(msg.name, msg.args);
|
|
1071
1075
|
break;
|
|
1076
|
+
case 'FLUSHED':
|
|
1077
|
+
{
|
|
1078
|
+
if ('thread-stream' !== msg.context) {
|
|
1079
|
+
destroy(stream, new Error('this should not happen: ' + msg.code));
|
|
1080
|
+
break;
|
|
1081
|
+
}
|
|
1082
|
+
const cb = stream[kImpl].flushCallbacks.get(msg.id);
|
|
1083
|
+
if (cb) {
|
|
1084
|
+
stream[kImpl].flushCallbacks.delete(msg.id);
|
|
1085
|
+
process.nextTick(cb);
|
|
1086
|
+
}
|
|
1087
|
+
break;
|
|
1088
|
+
}
|
|
1072
1089
|
case 'WARNING':
|
|
1073
1090
|
process.emitWarning(msg.err);
|
|
1074
1091
|
break;
|
|
@@ -1103,13 +1120,18 @@ var __webpack_modules__ = {
|
|
|
1103
1120
|
this[kImpl].finished = false;
|
|
1104
1121
|
this[kImpl].errored = null;
|
|
1105
1122
|
this[kImpl].closed = false;
|
|
1106
|
-
this[kImpl].buf =
|
|
1123
|
+
this[kImpl].buf = [];
|
|
1124
|
+
this[kImpl].bufHead = 0;
|
|
1125
|
+
this[kImpl].bufLen = 0;
|
|
1126
|
+
this[kImpl].flushCallbacks = new Map();
|
|
1127
|
+
this[kImpl].nextFlushId = 0;
|
|
1107
1128
|
this.worker = createWorker(this, opts);
|
|
1108
1129
|
this.on('message', (message, transferList)=>{
|
|
1109
1130
|
this.worker.postMessage(message, transferList);
|
|
1110
1131
|
});
|
|
1111
1132
|
}
|
|
1112
1133
|
write(data) {
|
|
1134
|
+
const dataBuf = Buffer.isBuffer(data) ? data : Buffer.from(data);
|
|
1113
1135
|
if (this[kImpl].destroyed) {
|
|
1114
1136
|
error(this, new Error('the worker has exited'));
|
|
1115
1137
|
return false;
|
|
@@ -1118,14 +1140,15 @@ var __webpack_modules__ = {
|
|
|
1118
1140
|
error(this, new Error('the worker is ending'));
|
|
1119
1141
|
return false;
|
|
1120
1142
|
}
|
|
1121
|
-
if (this[kImpl].flushing && this[kImpl].
|
|
1143
|
+
if (this[kImpl].flushing && this[kImpl].bufLen + dataBuf.length >= MAX_STRING) try {
|
|
1122
1144
|
writeSync(this);
|
|
1123
1145
|
this[kImpl].flushing = true;
|
|
1124
1146
|
} catch (err) {
|
|
1125
1147
|
destroy(this, err);
|
|
1126
1148
|
return false;
|
|
1127
1149
|
}
|
|
1128
|
-
this[kImpl].buf
|
|
1150
|
+
this[kImpl].buf.push(dataBuf);
|
|
1151
|
+
this[kImpl].bufLen += dataBuf.length;
|
|
1129
1152
|
if (this[kImpl].sync) try {
|
|
1130
1153
|
writeSync(this);
|
|
1131
1154
|
return true;
|
|
@@ -1137,7 +1160,7 @@ var __webpack_modules__ = {
|
|
|
1137
1160
|
this[kImpl].flushing = true;
|
|
1138
1161
|
setImmediate(nextFlush, this);
|
|
1139
1162
|
}
|
|
1140
|
-
this[kImpl].needDrain = this[kImpl].data.length - this[kImpl].
|
|
1163
|
+
this[kImpl].needDrain = this[kImpl].data.length - this[kImpl].bufLen - Atomics.load(this[kImpl].state, WRITE_INDEX) <= 0;
|
|
1141
1164
|
return !this[kImpl].needDrain;
|
|
1142
1165
|
}
|
|
1143
1166
|
end() {
|
|
@@ -1146,19 +1169,10 @@ var __webpack_modules__ = {
|
|
|
1146
1169
|
end(this);
|
|
1147
1170
|
}
|
|
1148
1171
|
flush(cb) {
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
return;
|
|
1152
|
-
|
|
1153
|
-
const writeIndex = Atomics.load(this[kImpl].state, WRITE_INDEX);
|
|
1154
|
-
wait(this[kImpl].state, READ_INDEX, writeIndex, 1 / 0, (err, res)=>{
|
|
1155
|
-
if (err) {
|
|
1156
|
-
destroy(this, err);
|
|
1157
|
-
process.nextTick(cb, err);
|
|
1158
|
-
return;
|
|
1159
|
-
}
|
|
1160
|
-
if ('not-equal' === res) return void this.flush(cb);
|
|
1161
|
-
process.nextTick(cb);
|
|
1172
|
+
cb = 'function' == typeof cb ? cb : noop;
|
|
1173
|
+
flushBuffer(this, (err)=>{
|
|
1174
|
+
if (err) return void process.nextTick(cb, err);
|
|
1175
|
+
requestWorkerFlush(this, cb);
|
|
1162
1176
|
});
|
|
1163
1177
|
}
|
|
1164
1178
|
flushSync() {
|
|
@@ -1200,6 +1214,63 @@ var __webpack_modules__ = {
|
|
|
1200
1214
|
return this[kImpl].errored;
|
|
1201
1215
|
}
|
|
1202
1216
|
}
|
|
1217
|
+
function flushBuffer(stream, cb) {
|
|
1218
|
+
if (stream[kImpl].destroyed) return void process.nextTick(cb, new Error('the worker has exited'));
|
|
1219
|
+
if (!stream[kImpl].sync && (stream[kImpl].flushing || stream[kImpl].bufLen > 0)) return void setImmediate(flushBuffer, stream, cb);
|
|
1220
|
+
waitForRead(stream, cb);
|
|
1221
|
+
}
|
|
1222
|
+
function waitForRead(stream, cb) {
|
|
1223
|
+
const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
|
|
1224
|
+
wait(stream[kImpl].state, READ_INDEX, writeIndex, 1 / 0, (err, res)=>{
|
|
1225
|
+
if (err) {
|
|
1226
|
+
destroy(stream, err);
|
|
1227
|
+
cb(err);
|
|
1228
|
+
return;
|
|
1229
|
+
}
|
|
1230
|
+
if ('ok' !== res) return void waitForRead(stream, cb);
|
|
1231
|
+
cb();
|
|
1232
|
+
});
|
|
1233
|
+
}
|
|
1234
|
+
function requestWorkerFlush(stream, cb) {
|
|
1235
|
+
if (stream[kImpl].destroyed) return void process.nextTick(cb, new Error('the worker has exited'));
|
|
1236
|
+
if (!stream[kImpl].ready) {
|
|
1237
|
+
const onReady = ()=>{
|
|
1238
|
+
cleanup();
|
|
1239
|
+
requestWorkerFlush(stream, cb);
|
|
1240
|
+
};
|
|
1241
|
+
const onClose = ()=>{
|
|
1242
|
+
cleanup();
|
|
1243
|
+
process.nextTick(cb, new Error('the worker has exited'));
|
|
1244
|
+
};
|
|
1245
|
+
const cleanup = ()=>{
|
|
1246
|
+
stream.off('ready', onReady);
|
|
1247
|
+
stream.off('close', onClose);
|
|
1248
|
+
};
|
|
1249
|
+
stream.once('ready', onReady);
|
|
1250
|
+
stream.once('close', onClose);
|
|
1251
|
+
return;
|
|
1252
|
+
}
|
|
1253
|
+
const id = ++stream[kImpl].nextFlushId;
|
|
1254
|
+
stream[kImpl].flushCallbacks.set(id, cb);
|
|
1255
|
+
try {
|
|
1256
|
+
stream.worker.postMessage({
|
|
1257
|
+
code: 'FLUSH',
|
|
1258
|
+
context: 'thread-stream',
|
|
1259
|
+
id
|
|
1260
|
+
});
|
|
1261
|
+
} catch (err) {
|
|
1262
|
+
stream[kImpl].flushCallbacks.delete(id);
|
|
1263
|
+
destroy(stream, err);
|
|
1264
|
+
process.nextTick(cb, err);
|
|
1265
|
+
}
|
|
1266
|
+
}
|
|
1267
|
+
function failPendingFlushCallbacks(stream, err) {
|
|
1268
|
+
const callbacks = stream[kImpl].flushCallbacks;
|
|
1269
|
+
if (0 === callbacks.size) return;
|
|
1270
|
+
const flushErr = err || new Error('the worker has exited');
|
|
1271
|
+
for (const cb of callbacks.values())process.nextTick(cb, flushErr);
|
|
1272
|
+
callbacks.clear();
|
|
1273
|
+
}
|
|
1203
1274
|
function error(stream, err) {
|
|
1204
1275
|
setImmediate(()=>{
|
|
1205
1276
|
stream.emit('error', err);
|
|
@@ -1208,6 +1279,7 @@ var __webpack_modules__ = {
|
|
|
1208
1279
|
function destroy(stream, err) {
|
|
1209
1280
|
if (stream[kImpl].destroyed) return;
|
|
1210
1281
|
stream[kImpl].destroyed = true;
|
|
1282
|
+
failPendingFlushCallbacks(stream, err);
|
|
1211
1283
|
if (err) {
|
|
1212
1284
|
stream[kImpl].errored = err;
|
|
1213
1285
|
error(stream, err);
|
|
@@ -1221,12 +1293,37 @@ var __webpack_modules__ = {
|
|
|
1221
1293
|
stream.emit('close');
|
|
1222
1294
|
});
|
|
1223
1295
|
}
|
|
1224
|
-
function write(stream,
|
|
1296
|
+
function write(stream, maxBytes, cb) {
|
|
1225
1297
|
const current = Atomics.load(stream[kImpl].state, WRITE_INDEX);
|
|
1226
|
-
|
|
1227
|
-
|
|
1228
|
-
|
|
1229
|
-
|
|
1298
|
+
let offset = current;
|
|
1299
|
+
let remaining = maxBytes;
|
|
1300
|
+
while(remaining > 0 && 0 !== stream[kImpl].bufLen){
|
|
1301
|
+
const head = stream[kImpl].bufHead;
|
|
1302
|
+
const buf = stream[kImpl].buf[head];
|
|
1303
|
+
if (buf.length <= remaining) {
|
|
1304
|
+
buf.copy(stream[kImpl].data, offset);
|
|
1305
|
+
offset += buf.length;
|
|
1306
|
+
remaining -= buf.length;
|
|
1307
|
+
stream[kImpl].bufLen -= buf.length;
|
|
1308
|
+
stream[kImpl].bufHead = head + 1;
|
|
1309
|
+
if (stream[kImpl].bufHead === stream[kImpl].buf.length) {
|
|
1310
|
+
stream[kImpl].buf.length = 0;
|
|
1311
|
+
stream[kImpl].bufHead = 0;
|
|
1312
|
+
} else if (stream[kImpl].bufHead >= 1024 && 2 * stream[kImpl].bufHead >= stream[kImpl].buf.length) {
|
|
1313
|
+
stream[kImpl].buf.splice(0, stream[kImpl].bufHead);
|
|
1314
|
+
stream[kImpl].bufHead = 0;
|
|
1315
|
+
}
|
|
1316
|
+
continue;
|
|
1317
|
+
}
|
|
1318
|
+
buf.copy(stream[kImpl].data, offset, 0, remaining);
|
|
1319
|
+
stream[kImpl].buf[head] = buf.subarray(remaining);
|
|
1320
|
+
stream[kImpl].bufLen -= remaining;
|
|
1321
|
+
offset += remaining;
|
|
1322
|
+
remaining = 0;
|
|
1323
|
+
}
|
|
1324
|
+
updateState(stream, ()=>{
|
|
1325
|
+
Atomics.store(stream[kImpl].state, WRITE_INDEX, offset);
|
|
1326
|
+
});
|
|
1230
1327
|
cb();
|
|
1231
1328
|
return true;
|
|
1232
1329
|
}
|
|
@@ -1236,8 +1333,9 @@ var __webpack_modules__ = {
|
|
|
1236
1333
|
try {
|
|
1237
1334
|
stream.flushSync();
|
|
1238
1335
|
let readIndex = Atomics.load(stream[kImpl].state, READ_INDEX);
|
|
1239
|
-
|
|
1240
|
-
|
|
1336
|
+
updateState(stream, ()=>{
|
|
1337
|
+
Atomics.store(stream[kImpl].state, WRITE_INDEX, -1);
|
|
1338
|
+
});
|
|
1241
1339
|
let spins = 0;
|
|
1242
1340
|
while(-1 !== readIndex){
|
|
1243
1341
|
Atomics.wait(stream[kImpl].state, READ_INDEX, readIndex, 1000);
|
|
@@ -1259,35 +1357,16 @@ var __webpack_modules__ = {
|
|
|
1259
1357
|
else if (stream[kImpl].needDrain) process.nextTick(drain, stream);
|
|
1260
1358
|
};
|
|
1261
1359
|
stream[kImpl].flushing = false;
|
|
1262
|
-
while(0 !== stream[kImpl].
|
|
1360
|
+
while(0 !== stream[kImpl].bufLen){
|
|
1263
1361
|
const writeIndex = Atomics.load(stream[kImpl].state, WRITE_INDEX);
|
|
1264
|
-
|
|
1362
|
+
const leftover = stream[kImpl].data.length - writeIndex;
|
|
1265
1363
|
if (0 === leftover) {
|
|
1266
1364
|
flushSync(stream);
|
|
1267
|
-
|
|
1268
|
-
Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
|
|
1269
|
-
Atomics.notify(stream[kImpl].state, READ_INDEX);
|
|
1365
|
+
resetIndexes(stream);
|
|
1270
1366
|
continue;
|
|
1271
1367
|
}
|
|
1272
1368
|
if (leftover < 0) throw new Error('overwritten');
|
|
1273
|
-
|
|
1274
|
-
let toWriteBytes = Buffer.byteLength(toWrite);
|
|
1275
|
-
if (toWriteBytes <= leftover) {
|
|
1276
|
-
stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
|
|
1277
|
-
write(stream, toWrite, cb);
|
|
1278
|
-
} else {
|
|
1279
|
-
flushSync(stream);
|
|
1280
|
-
Atomics.store(stream[kImpl].state, READ_INDEX, 0);
|
|
1281
|
-
Atomics.store(stream[kImpl].state, WRITE_INDEX, 0);
|
|
1282
|
-
Atomics.notify(stream[kImpl].state, READ_INDEX);
|
|
1283
|
-
while(toWriteBytes > stream[kImpl].buf.length){
|
|
1284
|
-
leftover /= 2;
|
|
1285
|
-
toWrite = stream[kImpl].buf.slice(0, leftover);
|
|
1286
|
-
toWriteBytes = Buffer.byteLength(toWrite);
|
|
1287
|
-
}
|
|
1288
|
-
stream[kImpl].buf = stream[kImpl].buf.slice(leftover);
|
|
1289
|
-
write(stream, toWrite, cb);
|
|
1290
|
-
}
|
|
1369
|
+
write(stream, leftover, cb);
|
|
1291
1370
|
}
|
|
1292
1371
|
}
|
|
1293
1372
|
function flushSync(stream) {
|
|
@@ -1304,16 +1383,18 @@ var __webpack_modules__ = {
|
|
|
1304
1383
|
}
|
|
1305
1384
|
module1.exports = ThreadStream;
|
|
1306
1385
|
},
|
|
1307
|
-
"../../node_modules/.pnpm/thread-stream@4.
|
|
1386
|
+
"../../node_modules/.pnpm/thread-stream@4.2.0/node_modules/thread-stream/lib/indexes.js" (module1) {
|
|
1308
1387
|
"use strict";
|
|
1388
|
+
const SEQ_INDEX = 2;
|
|
1309
1389
|
const WRITE_INDEX = 4;
|
|
1310
1390
|
const READ_INDEX = 8;
|
|
1311
1391
|
module1.exports = {
|
|
1312
1392
|
WRITE_INDEX,
|
|
1313
|
-
READ_INDEX
|
|
1393
|
+
READ_INDEX,
|
|
1394
|
+
SEQ_INDEX
|
|
1314
1395
|
};
|
|
1315
1396
|
},
|
|
1316
|
-
"../../node_modules/.pnpm/thread-stream@4.
|
|
1397
|
+
"../../node_modules/.pnpm/thread-stream@4.2.0/node_modules/thread-stream/lib/wait.js" (module1) {
|
|
1317
1398
|
"use strict";
|
|
1318
1399
|
const WAIT_MS = 10000;
|
|
1319
1400
|
function wait(state, index, expected, timeout, done) {
|
|
@@ -1337,7 +1418,10 @@ var __webpack_modules__ = {
|
|
|
1337
1418
|
if (max !== 1 / 0 && Date.now() > max) return void done(null, 'timed-out');
|
|
1338
1419
|
const remaining = max === 1 / 0 ? WAIT_MS : Math.min(WAIT_MS, Math.max(1, max - Date.now()));
|
|
1339
1420
|
const result = Atomics.waitAsync(state, index, expected, remaining);
|
|
1340
|
-
if (result.async) result.value.then(
|
|
1421
|
+
if (result.async) result.value.then((res)=>{
|
|
1422
|
+
if ('ok' === res) return void done(null, 'ok');
|
|
1423
|
+
check();
|
|
1424
|
+
});
|
|
1341
1425
|
else setImmediate(check);
|
|
1342
1426
|
};
|
|
1343
1427
|
check();
|
|
@@ -2668,7 +2752,7 @@ var __webpack_modules__ = {
|
|
|
2668
2752
|
const { fileURLToPath } = __webpack_require__("node:url");
|
|
2669
2753
|
const sleep = __webpack_require__("../../node_modules/.pnpm/atomic-sleep@1.0.0/node_modules/atomic-sleep/index.js");
|
|
2670
2754
|
const onExit = __webpack_require__("../../node_modules/.pnpm/on-exit-leak-free@2.1.2/node_modules/on-exit-leak-free/index.js");
|
|
2671
|
-
const ThreadStream = __webpack_require__("../../node_modules/.pnpm/thread-stream@4.
|
|
2755
|
+
const ThreadStream = __webpack_require__("../../node_modules/.pnpm/thread-stream@4.2.0/node_modules/thread-stream/index.js");
|
|
2672
2756
|
function setupOnExit(stream) {
|
|
2673
2757
|
onExit.register(stream, autoEnd);
|
|
2674
2758
|
onExit.registerBeforeExit(stream, flush);
|
|
@@ -3432,10 +3516,10 @@ var __webpack_modules__ = {
|
|
|
3432
3516
|
SonicBoom.default = SonicBoom;
|
|
3433
3517
|
module1.exports = SonicBoom;
|
|
3434
3518
|
},
|
|
3435
|
-
"../../node_modules/.pnpm/thread-stream@4.
|
|
3519
|
+
"../../node_modules/.pnpm/thread-stream@4.2.0/node_modules/thread-stream/package.json" (module1) {
|
|
3436
3520
|
"use strict";
|
|
3437
3521
|
module1.exports = {
|
|
3438
|
-
version: "4.
|
|
3522
|
+
version: "4.2.0"
|
|
3439
3523
|
};
|
|
3440
3524
|
}
|
|
3441
3525
|
};
|
|
@@ -1127,7 +1127,7 @@ var __webpack_modules__ = {
|
|
|
1127
1127
|
exports.createColors = createColors;
|
|
1128
1128
|
exports.isColorSupported = isColorSupported;
|
|
1129
1129
|
},
|
|
1130
|
-
"../../node_modules/.pnpm/fast-copy@4.0.
|
|
1130
|
+
"../../node_modules/.pnpm/fast-copy@4.0.4/node_modules/fast-copy/dist/cjs/index.cjs" (__unused_rspack_module, exports) {
|
|
1131
1131
|
"use strict";
|
|
1132
1132
|
const toStringFunction = Function.prototype.toString;
|
|
1133
1133
|
const toStringObject = Object.prototype.toString;
|
|
@@ -1146,7 +1146,7 @@ var __webpack_modules__ = {
|
|
|
1146
1146
|
const type = toStringObject.call(value);
|
|
1147
1147
|
return type.substring(8, type.length - 1);
|
|
1148
1148
|
}
|
|
1149
|
-
const {
|
|
1149
|
+
const { propertyIsEnumerable } = Object.prototype;
|
|
1150
1150
|
function copyOwnDescriptor(original, clone, property, state) {
|
|
1151
1151
|
const ownDescriptor = Object.getOwnPropertyDescriptor(original, property) || {
|
|
1152
1152
|
configurable: true,
|
|
@@ -1167,10 +1167,8 @@ var __webpack_modules__ = {
|
|
|
1167
1167
|
}
|
|
1168
1168
|
}
|
|
1169
1169
|
function copyOwnPropertiesStrict(value, clone, state) {
|
|
1170
|
-
const
|
|
1171
|
-
for(
|
|
1172
|
-
const symbols = Object.getOwnPropertySymbols(value);
|
|
1173
|
-
for(let index = 0; index < symbols.length; ++index)copyOwnDescriptor(value, clone, symbols[index], state);
|
|
1170
|
+
for (const name of Object.getOwnPropertyNames(value))copyOwnDescriptor(value, clone, name, state);
|
|
1171
|
+
for (const symbol of Object.getOwnPropertySymbols(value))copyOwnDescriptor(value, clone, symbol, state);
|
|
1174
1172
|
return clone;
|
|
1175
1173
|
}
|
|
1176
1174
|
function copyArrayLoose(array, state) {
|
|
@@ -1199,9 +1197,7 @@ var __webpack_modules__ = {
|
|
|
1199
1197
|
function copyMapLoose(map, state) {
|
|
1200
1198
|
const clone = new state.Constructor();
|
|
1201
1199
|
state.cache.set(map, clone);
|
|
1202
|
-
map.
|
|
1203
|
-
clone.set(key, state.copier(value, state));
|
|
1204
|
-
});
|
|
1200
|
+
for (const [key, value] of map)clone.set(key, state.copier(value, state));
|
|
1205
1201
|
return clone;
|
|
1206
1202
|
}
|
|
1207
1203
|
function copyMapStrict(map, state) {
|
|
@@ -1210,12 +1206,8 @@ var __webpack_modules__ = {
|
|
|
1210
1206
|
function copyObjectLoose(object, state) {
|
|
1211
1207
|
const clone = getCleanClone(state.prototype);
|
|
1212
1208
|
state.cache.set(object, clone);
|
|
1213
|
-
for(const key
|
|
1214
|
-
const
|
|
1215
|
-
for(let index = 0; index < symbols.length; ++index){
|
|
1216
|
-
const symbol = symbols[index];
|
|
1217
|
-
if (propertyIsEnumerable.call(object, symbol)) clone[symbol] = state.copier(object[symbol], state);
|
|
1218
|
-
}
|
|
1209
|
+
for (const key of Object.keys(object))clone[key] = state.copier(object[key], state);
|
|
1210
|
+
for (const symbol of Object.getOwnPropertySymbols(object))if (propertyIsEnumerable.call(object, symbol)) clone[symbol] = state.copier(object[symbol], state);
|
|
1219
1211
|
return clone;
|
|
1220
1212
|
}
|
|
1221
1213
|
function copyObjectStrict(object, state) {
|
|
@@ -1237,9 +1229,7 @@ var __webpack_modules__ = {
|
|
|
1237
1229
|
function copySetLoose(set, state) {
|
|
1238
1230
|
const clone = new state.Constructor();
|
|
1239
1231
|
state.cache.set(set, clone);
|
|
1240
|
-
set.
|
|
1241
|
-
clone.add(state.copier(value, state));
|
|
1242
|
-
});
|
|
1232
|
+
for (const value of set)clone.add(state.copier(value, state));
|
|
1243
1233
|
return clone;
|
|
1244
1234
|
}
|
|
1245
1235
|
function copySetStrict(set, state) {
|
|
@@ -1732,7 +1722,7 @@ var __webpack_modules__ = {
|
|
|
1732
1722
|
"../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/filter-log.js" (module1, __unused_rspack_exports, __webpack_require__) {
|
|
1733
1723
|
"use strict";
|
|
1734
1724
|
module1.exports = filterLog;
|
|
1735
|
-
const { createCopier } = __webpack_require__("../../node_modules/.pnpm/fast-copy@4.0.
|
|
1725
|
+
const { createCopier } = __webpack_require__("../../node_modules/.pnpm/fast-copy@4.0.4/node_modules/fast-copy/dist/cjs/index.cjs");
|
|
1736
1726
|
const fastCopy = createCopier({});
|
|
1737
1727
|
const deleteLogProperty = __webpack_require__("../../node_modules/.pnpm/pino-pretty@13.1.3/node_modules/pino-pretty/lib/utils/delete-log-property.js");
|
|
1738
1728
|
function filterLog({ log, context }) {
|
|
@@ -554,11 +554,15 @@ function __webpack_require__(moduleId) {
|
|
|
554
554
|
return module1.exports;
|
|
555
555
|
}
|
|
556
556
|
(()=>{
|
|
557
|
-
__webpack_require__.d = (exports,
|
|
558
|
-
|
|
559
|
-
|
|
560
|
-
|
|
561
|
-
|
|
557
|
+
__webpack_require__.d = (exports, getters, values)=>{
|
|
558
|
+
var define = (defs, kind)=>{
|
|
559
|
+
for(var key in defs)if (__webpack_require__.o(defs, key) && !__webpack_require__.o(exports, key)) Object.defineProperty(exports, key, {
|
|
560
|
+
enumerable: true,
|
|
561
|
+
[kind]: defs[key]
|
|
562
|
+
});
|
|
563
|
+
};
|
|
564
|
+
define(getters, "get");
|
|
565
|
+
define(values, "value");
|
|
562
566
|
};
|
|
563
567
|
})();
|
|
564
568
|
(()=>{
|
|
@@ -577,9 +581,6 @@ function __webpack_require__(moduleId) {
|
|
|
577
581
|
var __webpack_exports__ = {};
|
|
578
582
|
(()=>{
|
|
579
583
|
__webpack_require__.r(__webpack_exports__);
|
|
580
|
-
__webpack_require__.d(__webpack_exports__, {
|
|
581
|
-
default: ()=>__rspack_default_export
|
|
582
|
-
});
|
|
583
584
|
const generator = (time, index)=>{
|
|
584
585
|
if (!time) return 'server.log';
|
|
585
586
|
time = new Date(time);
|
|
@@ -601,5 +602,8 @@ var __webpack_exports__ = {};
|
|
|
601
602
|
path
|
|
602
603
|
});
|
|
603
604
|
};
|
|
605
|
+
__webpack_require__.d(__webpack_exports__, {}, {
|
|
606
|
+
default: __rspack_default_export
|
|
607
|
+
});
|
|
604
608
|
})();
|
|
605
609
|
module.exports = __webpack_exports__;
|