esbuild-plugin-pino
Advanced tools
Comparing version 1.2.0 to 1.2.1
@@ -24,2 +24,4 @@ type Platform = 'browser' | 'node' | 'neutral'; | ||
target?: string | string[]; | ||
/** Documentation: https://esbuild.github.io/api/#supported */ | ||
supported?: Record<string, boolean>; | ||
@@ -26,0 +28,0 @@ /** Documentation: https://esbuild.github.io/api/#mangle-props */ |
@@ -17,18 +17,2 @@ 'use strict'; | ||
var __defProp = Object.defineProperty; | ||
var __getOwnPropSymbols = Object.getOwnPropertySymbols; | ||
var __hasOwnProp = Object.prototype.hasOwnProperty; | ||
var __propIsEnum = Object.prototype.propertyIsEnumerable; | ||
var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value; | ||
var __spreadValues = (a, b) => { | ||
for (var prop in b || (b = {})) | ||
if (__hasOwnProp.call(b, prop)) | ||
__defNormalProp(a, prop, b[prop]); | ||
if (__getOwnPropSymbols) | ||
for (var prop of __getOwnPropSymbols(b)) { | ||
if (__propIsEnum.call(b, prop)) | ||
__defNormalProp(a, prop, b[prop]); | ||
} | ||
return a; | ||
}; | ||
function esbuildPluginPino({ | ||
@@ -71,3 +55,7 @@ transports | ||
const transportsEntrypoints = Object.fromEntries((transports || []).map((t) => [t, require$1.resolve(t)])); | ||
currentBuild.initialOptions.entryPoints = __spreadValues(__spreadValues(__spreadValues({}, entrypoints), customEntrypoints), transportsEntrypoints); | ||
currentBuild.initialOptions.entryPoints = { | ||
...entrypoints, | ||
...customEntrypoints, | ||
...transportsEntrypoints | ||
}; | ||
let pinoBundlerRan = false; | ||
@@ -82,7 +70,7 @@ currentBuild.onEnd(() => { | ||
const contents = await promises.readFile(args.path, "utf8"); | ||
const absoluteOutputPath = path__default["default"].join(path__default["default"].resolve(process.cwd()), currentBuild.initialOptions.outdir || "dist").replace(/\\/g, "/"); | ||
const absoluteOutputPath = `\${process.cwd()}\${require('path').sep}${currentBuild.initialOptions.outdir || "dist"}`; | ||
const functionDeclaration = ` | ||
function pinoBundlerAbsolutePath(p) { | ||
try { | ||
return require('path').join('${absoluteOutputPath}', p) | ||
return require('path').join(\`${absoluteOutputPath}\`.replace(/\\\\/g, '/'), p) | ||
} catch(e) { | ||
@@ -94,3 +82,6 @@ const f = new Function('p', 'return new URL(p, import.meta.url).pathname'); | ||
`; | ||
const pinoOverrides = Object.keys(__spreadValues(__spreadValues({}, customEntrypoints), transportsEntrypoints)).map((id) => `'${id === "pino-file" ? "pino/file" : id}': pinoBundlerAbsolutePath('./${id}.js')`).join(","); | ||
const pinoOverrides = Object.keys({ | ||
...customEntrypoints, | ||
...transportsEntrypoints | ||
}).map((id) => `'${id === "pino-file" ? "pino/file" : id}': pinoBundlerAbsolutePath('./${id}.js')`).join(","); | ||
const globalThisDeclaration = ` | ||
@@ -97,0 +88,0 @@ globalThis.__bundlerPathsOverrides = |
{ | ||
"name": "esbuild-plugin-pino", | ||
"version": "1.2.0", | ||
"version": "1.2.1", | ||
"description": "An esbuild plugin to generate extra pino files for bundling", | ||
@@ -28,28 +28,28 @@ "main": "dist/index.js", | ||
"devDependencies": { | ||
"@commitlint/cli": "^17.0.2", | ||
"@commitlint/config-conventional": "^17.0.2", | ||
"@commitlint/cz-commitlint": "^17.0.0", | ||
"@types/node": "^18.0.0", | ||
"@typescript-eslint/eslint-plugin": "^5.28.0", | ||
"@typescript-eslint/parser": "^5.28.0", | ||
"commitizen": "^4.2.4", | ||
"esbuild": "^0.14.45", | ||
"eslint": "^8.18.0", | ||
"eslint-config-prettier": "^8.5.0", | ||
"eslint-plugin-prettier": "^4.0.0", | ||
"execa": "^6.1.0", | ||
"husky": "^8.0.1", | ||
"inquirer": "^8.2.4", | ||
"lint-staged": "^13.0.2", | ||
"nodemon": "^2.0.18", | ||
"pino": "^8.0.0", | ||
"pino-loki": "^2.0.0", | ||
"pino-pretty": "^8.0.0", | ||
"pkgroll": "^1.3.1", | ||
"prettier": "^2.7.1", | ||
"standard-version": "^9.5.0", | ||
"thread-stream": "^1.0.0", | ||
"tsx": "^3.4.3", | ||
"typescript": "^4.7.4", | ||
"vitest": "^0.15.1" | ||
"@commitlint/cli": "17.0.3", | ||
"@commitlint/config-conventional": "17.0.3", | ||
"@commitlint/cz-commitlint": "17.0.3", | ||
"@types/node": "18.0.0", | ||
"@typescript-eslint/eslint-plugin": "5.30.0", | ||
"@typescript-eslint/parser": "5.30.0", | ||
"commitizen": "4.2.4", | ||
"esbuild": "0.14.47", | ||
"eslint": "8.18.0", | ||
"eslint-config-prettier": "8.5.0", | ||
"eslint-plugin-prettier": "4.1.0", | ||
"execa": "6.1.0", | ||
"husky": "8.0.1", | ||
"inquirer": "8.2.4", | ||
"lint-staged": "13.0.3", | ||
"nodemon": "2.0.18", | ||
"pino": "8.1.0", | ||
"pino-loki": "2.0.0", | ||
"pino-pretty": "8.1.0", | ||
"pkgroll": "1.3.1", | ||
"prettier": "2.7.1", | ||
"standard-version": "9.5.0", | ||
"thread-stream": "1.0.0", | ||
"tsx": "3.6.0", | ||
"typescript": "4.7.4", | ||
"vitest": "0.15.2" | ||
}, | ||
@@ -56,0 +56,0 @@ "scripts": { |
@@ -66,2 +66,7 @@ # esbuild-plugin-pino | ||
## Deploy to production | ||
If you use `docker` or severless function like AWS Lambda, make sure to use the same `outdir` in your production. | ||
Ex: If your `outdir` is set to `dist` in `esbuild`, you need to copy the whole `dist` but not extracting files into the docker image root folder. | ||
## Credits | ||
@@ -68,0 +73,0 @@ |
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
75
32116
743