@holz/stream-backend 0.9.2-rc.9.sha-de3724b → 0.10.0

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.
@@ -1,19 +1,16 @@
1
- import { LogProcessor } from '@holz/core';
2
- import { Writable } from 'node:stream';
3
-
4
- declare interface Config {
5
- /** Where to print logs. Normally `process.stderr`. */
6
- stream: Writable;
7
- }
8
-
9
- /**
10
- * Prints logs to a writable stream in plaintext. Optimized for log files.
11
- *
12
- * @example
13
- * createStreamBackend({
14
- * stream: fs.createWriteStream('my-app.log', { flags: 'a' }),
15
- * })
16
- */
17
- export declare const createStreamBackend: ({ stream }: Config) => LogProcessor;
18
-
19
- export { }
1
+ import { LogProcessor } from "@holz/core";
2
+ import { Writable } from "node:stream";
3
+ /**
4
+ * Prints logs to a writable stream in plaintext. Optimized for log files.
5
+ *
6
+ * @example
7
+ * createStreamBackend({
8
+ * stream: fs.createWriteStream('my-app.log', { flags: 'a' }),
9
+ * })
10
+ */
11
+ export declare const createStreamBackend: ({ stream }: Config) => LogProcessor;
12
+ interface Config {
13
+ /** Where to print logs. Normally `process.stderr`. */
14
+ stream: Writable;
15
+ }
16
+ export {};
@@ -1,7 +1,7 @@
1
1
  import { EOL as e } from "node:os";
2
2
  import { inspect as t } from "node:util";
3
3
  import { level as n } from "@holz/core";
4
- //#region src/stream-backend.ts
4
+ // src/stream-backend.ts
5
5
  var r = ({ stream: n }) => (r) => {
6
6
  let { error: s, ...c } = r.context, l = new Date(r.timestamp).toISOString(), u = o[r.level], d = a(c), f = `${l} ${u} ${r.origin.length ? `[${r.origin.join(":")}] ` : ""}`, p = `${f}${i(f.length, r.message)}${d ? " " + d : ""}`, m = s ? t(s, { colors: !1 }) + e : "";
7
7
  n.write(`${p}${e}${m}`);
@@ -13,5 +13,4 @@ var r = ({ stream: n }) => (r) => {
13
13
  [n.error]: "ERROR",
14
14
  [n.fatal]: "FATAL"
15
15
  };
16
- //#endregion
17
16
  export { r as createStreamBackend };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@holz/stream-backend",
3
- "version": "0.9.2-rc.9.sha-de3724b",
3
+ "version": "0.10.0",
4
4
  "description": "Print logs to stdout or a file.",
5
5
  "type": "module",
6
6
  "repository": {
@@ -12,12 +12,12 @@
12
12
  ".": {
13
13
  "source": "./src/index.ts",
14
14
  "types": "./dist/holz-stream-backend.d.ts",
15
- "require": "./dist/holz-stream-backend.cjs",
16
- "import": "./dist/holz-stream-backend.js"
15
+ "default": "./dist/holz-stream-backend.js"
17
16
  }
18
17
  },
19
18
  "publishConfig": {
20
- "access": "public"
19
+ "access": "public",
20
+ "timeout": 60000
21
21
  },
22
22
  "author": "Jesse Gibson",
23
23
  "license": "MIT",
@@ -40,18 +40,16 @@
40
40
  "test:types": "tsc"
41
41
  },
42
42
  "peerDependencies": {
43
- "@holz/core": "^0.8.0 || ^0.9.0"
43
+ "@holz/core": "^0.8.0 || ^0.9.0 || ^0.10.0"
44
44
  },
45
45
  "devDependencies": {
46
- "@holz/core": "^0.9.2-rc.9.sha-de3724b",
47
- "@microsoft/api-extractor": "^7.58.8",
48
- "@types/node": "^24.0.0",
46
+ "@holz/core": "^0.10.0",
47
+ "@types/node": "^26.0.0",
49
48
  "@vitest/coverage-v8": "^5.0.0",
49
+ "rolldown-plugin-dts": "^0.28.8",
50
50
  "typescript": "^6.0.0",
51
51
  "vite": "^8.0.0",
52
- "vite-plugin-dts": "^5.0.0",
53
- "vite-tsconfig-paths": "^6.0.0",
54
52
  "vitest": "^5.0.0"
55
53
  },
56
- "gitHead": "de3724b406e0bd8c31e18d6df61d424a1513463b"
54
+ "gitHead": "929ed730c793ac0e8e6d0d8bb1fa9bc5dfd2a7ae"
57
55
  }
@@ -1,13 +1,8 @@
1
1
  import type { Writable } from 'node:stream';
2
2
  import { EOL } from 'node:os';
3
3
  import { inspect } from 'node:util';
4
- import {
5
- level,
6
- type LogLevel,
7
- type Log,
8
- type LogContext,
9
- type LogProcessor,
10
- } from '@holz/core';
4
+ import { level } from '@holz/core';
5
+ import type { LogLevel, Log, LogContext, LogProcessor } from '@holz/core';
11
6
 
12
7
  /**
13
8
  * Prints logs to a writable stream in plaintext. Optimized for log files.
@@ -1 +0,0 @@
1
- Object.defineProperty(exports,Symbol.toStringTag,{value:`Module`});let e=require("node:os"),t=require("node:util"),n=require("@holz/core");var r=({stream:n})=>r=>{let{error:s,...c}=r.context,l=new Date(r.timestamp).toISOString(),u=o[r.level],d=a(c),f=`${l} ${u} ${r.origin.length?`[${r.origin.join(`:`)}] `:``}`,p=`${f}${i(f.length,r.message)}${d?` `+d:``}`,m=s?(0,t.inspect)(s,{colors:!1})+e.EOL:``;n.write(`${p}${e.EOL}${m}`)},i=(e,t)=>t.replace(/(\r?\n)/g,t=>t+` `.repeat(e)),a=e=>Object.entries(e).map(([e,t])=>`${e}=${JSON.stringify(t)}`).join(` `),o={[n.level.trace]:`TRACE`,[n.level.debug]:`DEBUG`,[n.level.info]:`INFO `,[n.level.warn]:`WARN `,[n.level.error]:`ERROR`,[n.level.fatal]:`FATAL`};exports.createStreamBackend=r;