From 32c08912dad90ee89d568a44aea01a2fbe2e8df0 Mon Sep 17 00:00:00 2001 From: FoxxMD Date: Mon, 18 Mar 2024 09:49:46 -0400 Subject: [PATCH] refactor: Use scoped pino packages as interim dependencies #1 Need to use full NPM packages to support library in use for flatpak and docker images without git. Can remove once PRs are merged. --- package-lock.json | 90 ++++++++++++++++++++++----------------------- package.json | 8 ++-- src/destinations.ts | 4 +- src/pretty.ts | 2 +- src/types.ts | 2 +- tests/index.test.ts | 6 +-- 6 files changed, 56 insertions(+), 56 deletions(-) diff --git a/package-lock.json b/package-lock.json index 08ad68a..d35d264 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,17 +1,17 @@ { "name": "@foxxmd/logging", - "version": "0.1.5", + "version": "0.1.6", "lockfileVersion": 3, "requires": true, "packages": { "": { "name": "@foxxmd/logging", - "version": "0.1.5", + "version": "0.1.6", "license": "MIT", "dependencies": { - "pino": "^8.19.0", - "pino-pretty": "github:foxxmd/pino-pretty#additionalFunctionality", - "pino-roll": "github:foxxmd/pino-roll#fileAsFunc" + "@foxxmd/pino-pretty": "^10.3.2", + "@foxxmd/pino-roll": "^1.0.1", + "pino": "^8.19.0" }, "devDependencies": { "@types/chai": "^4.3.0", @@ -421,6 +421,46 @@ "node": ">=12" } }, + "node_modules/@foxxmd/pino-pretty": { + "version": "10.3.2", + "resolved": "https://registry.npmjs.org/@foxxmd/pino-pretty/-/pino-pretty-10.3.2.tgz", + "integrity": "sha512-rdrYCWd9gP+7X5eU1kXjN8N5It7ml62frw8EYBvrlHyFNoDtvARLit8NWBFlQKk/YaQ9QRow9O0buWRgqubIYw==", + "dependencies": { + "colorette": "^2.0.7", + "dateformat": "^4.6.3", + "fast-copy": "^3.0.0", + "fast-safe-stringify": "^2.1.1", + "help-me": "^5.0.0", + "joycon": "^3.1.1", + "minimist": "^1.2.6", + "on-exit-leak-free": "^2.1.0", + "pino-abstract-transport": "^1.0.0", + "pump": "^3.0.0", + "readable-stream": "^4.0.0", + "secure-json-parse": "^2.4.0", + "sonic-boom": "^3.0.0", + "strip-json-comments": "^3.1.1" + }, + "bin": { + "pino-pretty": "bin.js" + } + }, + "node_modules/@foxxmd/pino-pretty/node_modules/dateformat": { + "version": "4.6.3", + "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", + "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==", + "engines": { + "node": "*" + } + }, + "node_modules/@foxxmd/pino-roll": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@foxxmd/pino-roll/-/pino-roll-1.0.1.tgz", + "integrity": "sha512-THgMw/gb9Jhd0o7SeYEYbEqUQ5V+JU0OUfiMJrhd/mP3XI6WZI5fESL1ivurTbmGZik2H4L/0azkeabrFpTqKw==", + "dependencies": { + "sonic-boom": "^3.2.0" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -1791,46 +1831,6 @@ "split2": "^4.0.0" } }, - "node_modules/pino-pretty": { - "version": "10.3.1", - "resolved": "git+ssh://git@github.com/foxxmd/pino-pretty.git#1ee28b3b79c0131c323440494ff487db888e5c57", - "license": "MIT", - "dependencies": { - "colorette": "^2.0.7", - "dateformat": "^4.6.3", - "fast-copy": "^3.0.0", - "fast-safe-stringify": "^2.1.1", - "help-me": "^5.0.0", - "joycon": "^3.1.1", - "minimist": "^1.2.6", - "on-exit-leak-free": "^2.1.0", - "pino-abstract-transport": "^1.0.0", - "pump": "^3.0.0", - "readable-stream": "^4.0.0", - "secure-json-parse": "^2.4.0", - "sonic-boom": "^3.0.0", - "strip-json-comments": "^3.1.1" - }, - "bin": { - "pino-pretty": "bin.js" - } - }, - "node_modules/pino-pretty/node_modules/dateformat": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-4.6.3.tgz", - "integrity": "sha512-2P0p0pFGzHS5EMnhdxQi7aJN+iMheud0UhG4dlE1DLAlvL8JHjJJTX/CSm4JXwV0Ka5nGk3zC5mcb5bUQUxxMA==", - "engines": { - "node": "*" - } - }, - "node_modules/pino-roll": { - "version": "1.0.0-rc.1", - "resolved": "git+ssh://git@github.com/foxxmd/pino-roll.git#11a676826e83a807eac74a3328996d10bc1c720a", - "license": "MIT", - "dependencies": { - "sonic-boom": "^3.2.0" - } - }, "node_modules/pino-std-serializers": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/pino-std-serializers/-/pino-std-serializers-6.2.2.tgz", diff --git a/package.json b/package.json index 15e35c5..fcc97bb 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@foxxmd/logging", "type": "module", - "version": "0.1.5", + "version": "0.1.6", "repository": "https://github.com/foxxmd/logging", "description": "A typed, opinionated, batteries-included, Pino-based logging solution for backend TS/JS projects", "scripts": { @@ -67,9 +67,9 @@ "with-local-tmp-dir": "^5.1.1" }, "dependencies": { - "pino": "^8.19.0", - "pino-pretty": "github:foxxmd/pino-pretty#additionalFunctionality", - "pino-roll": "github:foxxmd/pino-roll#fileAsFunc" + "@foxxmd/pino-pretty": "^10.3.2", + "@foxxmd/pino-roll": "^1.0.1", + "pino": "^8.19.0" }, "overrides": { "with-local-tmp-dir": { diff --git a/src/destinations.ts b/src/destinations.ts index dd23d25..939b2e8 100644 --- a/src/destinations.ts +++ b/src/destinations.ts @@ -1,4 +1,4 @@ -import pinoRoll from 'pino-roll'; +import pinoRoll from '@foxxmd/pino-roll'; import { LogLevelStreamEntry, LogLevel, @@ -6,7 +6,7 @@ import { FileDestination, } from "./types.js"; import {DestinationStream, pino, destination} from "pino"; -import {build} from "pino-pretty" +import {build} from "@foxxmd/pino-pretty" import {PRETTY_OPTS_CONSOLE, PRETTY_OPTS_FILE, prettyOptsConsoleFactory, prettyOptsFileFactory} from "./pretty.js"; import {fileOrDirectoryIsWriteable} from "./util.js"; import path from "path"; diff --git a/src/pretty.ts b/src/pretty.ts index ba3cb46..fef4a5e 100644 --- a/src/pretty.ts +++ b/src/pretty.ts @@ -1,4 +1,4 @@ -import {PrettyOptions} from "pino-pretty"; +import {PrettyOptions} from "@foxxmd/pino-pretty"; import {CWD, getLongestStr} from "./util.js"; import { LOG_LEVEL_NAMES, diff --git a/src/types.ts b/src/types.ts index 151c97b..4c10a9b 100644 --- a/src/types.ts +++ b/src/types.ts @@ -1,5 +1,5 @@ import {DestinationStream, Logger as PinoLogger, LoggerOptions, StreamEntry, Level} from 'pino'; -import {PrettyOptions} from "pino-pretty"; +import {PrettyOptions} from "@foxxmd/pino-pretty"; import {MarkRequired} from "ts-essentials"; export type LogLevel = typeof LOG_LEVEL_NAMES[number]; diff --git a/tests/index.test.ts b/tests/index.test.ts index 001f7ef..779d846 100644 --- a/tests/index.test.ts +++ b/tests/index.test.ts @@ -108,8 +108,8 @@ const testRollingAppLogger = async (config: LogOptions | object = {}, extras: Lo stream: rawStream } ]; - const {destinations = [], ...restExtras} = extras; - const logger = await loggerAppRolling({...opts, console: 'silent'}, {destinations: [...destinations, ...streams], ...restExtras}); + const {destinations = [], pretty, ...restExtras} = extras; + const logger = await loggerAppRolling({...opts, console: 'silent'}, {destinations: [...destinations, ...streams], pretty, ...restExtras}); return [logger, testStream, rawStream]; } @@ -135,7 +135,7 @@ const testAppLogger = (config: LogOptions | object = {}, extras: LoggerAppExtras }, ]; - const logger = loggerApp({...opts, console: 'silent'}, {destinations: [...destinations, ...streams], ...pretty, ...restExtras}); + const logger = loggerApp({...opts, console: 'silent'}, {destinations: [...destinations, ...streams], pretty, ...restExtras}); return [logger, testStream, rawStream]; }