esbuild-plugin-pino
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -7,9 +7,6 @@ 'use strict'; | ||
function _interopDefaultLegacy (e) { return e && typeof e === 'object' && 'default' in e ? e : { 'default': e }; } | ||
var path__default = /*#__PURE__*/_interopDefaultLegacy(path); | ||
var _documentCurrentScript = typeof document !== 'undefined' ? document.currentScript : null; | ||
var require$1 = ( | ||
false | ||
? /* @__PURE__ */ module$1.createRequire((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.src || new URL('index.js', document.baseURI).href))) | ||
? /* @__PURE__ */ module$1.createRequire((typeof document === 'undefined' ? require('u' + 'rl').pathToFileURL(__filename).href : (_documentCurrentScript && _documentCurrentScript.src || new URL('index.js', document.baseURI).href))) | ||
: require | ||
@@ -24,3 +21,3 @@ ); | ||
function transformToObject(entryPoints, outbase) { | ||
const separator = entryPoints[0].includes("\\") ? path__default["default"].win32.sep : path__default["default"].posix.sep; | ||
const separator = entryPoints[0].includes("\\") ? path.win32.sep : path.posix.sep; | ||
if (!outbase) { | ||
@@ -59,10 +56,10 @@ const hierarchy = entryPoints[0].split(separator); | ||
setup(currentBuild) { | ||
const pino = path__default["default"].dirname(require$1.resolve("pino")); | ||
const threadStream = path__default["default"].dirname(require$1.resolve("thread-stream")); | ||
const pino = path.dirname(require$1.resolve("pino")); | ||
const threadStream = path.dirname(require$1.resolve("thread-stream")); | ||
const { entryPoints, outbase } = currentBuild.initialOptions; | ||
const customEntrypoints = { | ||
"thread-stream-worker": path__default["default"].join(threadStream, "lib/worker.js"), | ||
"pino-worker": path__default["default"].join(pino, "lib/worker.js"), | ||
"pino-pipeline-worker": path__default["default"].join(pino, "lib/worker-pipeline.js"), | ||
"pino-file": path__default["default"].join(pino, "file.js") | ||
"thread-stream-worker": path.join(threadStream, "lib/worker.js"), | ||
"pino-worker": path.join(pino, "lib/worker.js"), | ||
"pino-pipeline-worker": path.join(pino, "lib/worker-pipeline.js"), | ||
"pino-file": path.join(pino, "file.js") | ||
}; | ||
@@ -104,3 +101,10 @@ const transportsEntrypoints = Object.fromEntries( | ||
const contents = await promises.readFile(args.path, "utf8"); | ||
const absoluteOutputPath = `\${process.cwd()}\${require('path').sep}${currentBuild.initialOptions.outdir || "dist"}`; | ||
let absoluteOutputPath = ""; | ||
const { outdir = "dist" } = currentBuild.initialOptions; | ||
if (path.isAbsolute(outdir)) { | ||
absoluteOutputPath = outdir.replace(/\\/g, "\\\\"); | ||
} else { | ||
const workingDir = currentBuild.initialOptions.absWorkingDir ? `"${currentBuild.initialOptions.absWorkingDir.replace(/\\/g, "\\\\")}"` : "process.cwd()"; | ||
absoluteOutputPath = `\${${workingDir}}\${require('path').sep}${currentBuild.initialOptions.outdir || "dist"}`; | ||
} | ||
const functionDeclaration = ` | ||
@@ -107,0 +111,0 @@ function pinoBundlerAbsolutePath(p) { |
{ | ||
"name": "esbuild-plugin-pino", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"description": "An esbuild plugin to generate extra pino files for bundling", | ||
@@ -28,21 +28,21 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@types/node": "18.17.5", | ||
"@typescript-eslint/eslint-plugin": "6.3.0", | ||
"@typescript-eslint/parser": "6.3.0", | ||
"esbuild": "0.19.2", | ||
"eslint": "8.47.0", | ||
"@types/node": "18.18.1", | ||
"@typescript-eslint/eslint-plugin": "6.7.3", | ||
"@typescript-eslint/parser": "6.7.3", | ||
"esbuild": "0.19.4", | ||
"eslint": "8.50.0", | ||
"eslint-config-prettier": "9.0.0", | ||
"eslint-plugin-prettier": "5.0.0", | ||
"execa": "7.2.0", | ||
"execa": "8.0.1", | ||
"nodemon": "3.0.1", | ||
"pino": "8.15.0", | ||
"pino": "8.15.3", | ||
"pino-loki": "2.1.3", | ||
"pino-pretty": "10.2.0", | ||
"pkgroll": "1.11.0", | ||
"prettier": "3.0.1", | ||
"pkgroll": "2.0.0", | ||
"prettier": "3.0.3", | ||
"standard-version": "9.5.0", | ||
"thread-stream": "2.4.0", | ||
"tsx": "3.12.7", | ||
"typescript": "5.1.6", | ||
"vitest": "0.34.1" | ||
"tsx": "3.13.0", | ||
"typescript": "5.2.2", | ||
"vitest": "0.34.6" | ||
}, | ||
@@ -49,0 +49,0 @@ "peerDependencies": { |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
17071
294