@rife/logger 0.0.6-beta.17 → 0.0.6-beta.19

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.
@@ -26,12 +26,12 @@ var __webpack_modules__ = {
26
26
  "use strict";
27
27
  const WAIT_MS = 10000;
28
28
  function wait(state, index, expected, timeout, done) {
29
- const max = timeout === 1 / 0 ? 1 / 0 : Date.now() + timeout;
29
+ const max = 1 / 0 === timeout ? 1 / 0 : Date.now() + timeout;
30
30
  const check = ()=>{
31
31
  const current = Atomics.load(state, index);
32
32
  if (current === expected) return void done(null, 'ok');
33
- if (max !== 1 / 0 && Date.now() > max) return void done(null, 'timed-out');
34
- const remaining = max === 1 / 0 ? WAIT_MS : Math.min(WAIT_MS, Math.max(1, max - Date.now()));
33
+ if (1 / 0 !== max && Date.now() > max) return void done(null, 'timed-out');
34
+ const remaining = 1 / 0 === max ? WAIT_MS : Math.min(WAIT_MS, Math.max(1, max - Date.now()));
35
35
  const result = Atomics.waitAsync(state, index, current, remaining);
36
36
  if (result.async) result.value.then(check);
37
37
  else setImmediate(check);
@@ -39,12 +39,12 @@ var __webpack_modules__ = {
39
39
  check();
40
40
  }
41
41
  function waitDiff(state, index, expected, timeout, done) {
42
- const max = timeout === 1 / 0 ? 1 / 0 : Date.now() + timeout;
42
+ const max = 1 / 0 === timeout ? 1 / 0 : Date.now() + timeout;
43
43
  const check = ()=>{
44
44
  const current = Atomics.load(state, index);
45
45
  if (current !== expected) return void done(null, 'ok');
46
- if (max !== 1 / 0 && Date.now() > max) return void done(null, 'timed-out');
47
- const remaining = max === 1 / 0 ? WAIT_MS : Math.min(WAIT_MS, Math.max(1, max - Date.now()));
46
+ if (1 / 0 !== max && Date.now() > max) return void done(null, 'timed-out');
47
+ const remaining = 1 / 0 === max ? WAIT_MS : Math.min(WAIT_MS, Math.max(1, max - Date.now()));
48
48
  const result = Atomics.waitAsync(state, index, expected, remaining);
49
49
  if (result.async) result.value.then((res)=>{
50
50
  if ('ok' === res) return void done(null, 'ok');
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@rife/logger",
3
- "version": "0.0.6-beta.17",
3
+ "version": "0.0.6-beta.19",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "types": "./src/index.ts",
@@ -37,15 +37,15 @@
37
37
  "tsconfig.json"
38
38
  ],
39
39
  "dependencies": {
40
- "pino": "^10.3.1",
41
- "pino-pretty": "^13.1.3",
40
+ "pino": "^10.4.0",
41
+ "pino-pretty": "^13.2.0",
42
42
  "pino-std-serializers": "^7.1.0",
43
43
  "rotating-file-stream": "^3.2.9"
44
44
  },
45
45
  "devDependencies": {
46
- "thread-stream": "^4.0.0",
47
- "@rife/cli": "0.0.6-beta.24",
48
- "@rife/plugin-rstack": "0.0.1-beta.24"
46
+ "@rife/cli": "0.0.6-beta.26",
47
+ "@rife/plugin-rstack": "0.0.1-beta.26",
48
+ "thread-stream": "^4.0.0"
49
49
  },
50
50
  "scripts": {
51
51
  "dev": "rife dev",
package/src/pino/index.ts CHANGED
@@ -2,8 +2,6 @@ import path from 'path';
2
2
  import pino from 'pino';
3
3
 
4
4
  export { pino };
5
- // 避免报错 "This is likely not portable. A type annotation is necessary."
6
- export type { Logger } from 'pino';
7
5
 
8
6
  import { genTraceId, getTraceId, runInTrace } from '../trace';
9
7
 
@@ -108,8 +106,10 @@ function getPinoConfig() {
108
106
  return config;
109
107
  }
110
108
 
109
+ export type Logger = pino.Logger<never, boolean>;
110
+
111
111
  export function createLogger() {
112
- const logger = pino({
112
+ const logger: Logger = pino({
113
113
  // https://github.com/pinojs/pino/blob/main/docs/api.md#opt-serializers
114
114
  base: { pid: process.pid },
115
115
  messageKey: 'message',
package/tsconfig.json CHANGED
@@ -4,7 +4,8 @@
4
4
  "declaration": true,
5
5
  "paths": {
6
6
  "@/*": ["./src/*"]
7
- }
7
+ },
8
+ "tsBuildInfoFile": "./node_modules/.cache/.tsbuildinfo"
8
9
  },
9
10
  "include": ["./src/**/*"]
10
11
  }
@@ -1,19 +0,0 @@
1
- import "node:module";
2
- var __webpack_modules__ = {};
3
- var __webpack_module_cache__ = {};
4
- function __webpack_require__(moduleId) {
5
- var cachedModule = __webpack_module_cache__[moduleId];
6
- if (void 0 !== cachedModule) return cachedModule.exports;
7
- var module = __webpack_module_cache__[moduleId] = {
8
- exports: {}
9
- };
10
- __webpack_modules__[moduleId](module, module.exports, __webpack_require__);
11
- return module.exports;
12
- }
13
- __webpack_require__.m = __webpack_modules__;
14
- (()=>{
15
- __webpack_require__.add = function(modules) {
16
- Object.assign(__webpack_require__.m, modules);
17
- };
18
- })();
19
- export { __webpack_require__ };