feat: adding build process to logger package using tsup #7210

This commit is contained in:
sriram veeraghanta 2025-06-13 01:50:44 +05:30 committed by GitHub
parent 11b222ece8
commit ebc2bdcd3a
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 23 additions and 6 deletions

View file

@ -3,7 +3,4 @@ module.exports = {
root: true, root: true,
extends: ["@plane/eslint-config/library.js"], extends: ["@plane/eslint-config/library.js"],
parser: "@typescript-eslint/parser", parser: "@typescript-eslint/parser",
parserOptions: {
project: true,
},
}; };

View file

@ -4,11 +4,18 @@
"license": "AGPL-3.0", "license": "AGPL-3.0",
"description": "Logger shared across multiple apps internally", "description": "Logger shared across multiple apps internally",
"private": true, "private": true,
"main": "./src/index.ts", "main": "./dist/index.js",
"types": "./src/index.ts", "module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/**"
],
"scripts": { "scripts": {
"build": "tsup",
"dev": "tsup --watch",
"lint": "eslint src --ext .ts,.tsx", "lint": "eslint src --ext .ts,.tsx",
"lint:errors": "eslint src --ext .ts,.tsx --quiet" "lint:errors": "eslint src --ext .ts,.tsx --quiet",
"clean": "rm -rf .turbo && rm -rf node_modules && rm -rf dist"
}, },
"dependencies": { "dependencies": {
"winston": "^3.17.0", "winston": "^3.17.0",
@ -17,6 +24,7 @@
"devDependencies": { "devDependencies": {
"@plane/eslint-config": "*", "@plane/eslint-config": "*",
"@types/node": "^22.5.4", "@types/node": "^22.5.4",
"tsup": "8.4.0",
"typescript": "5.8.3" "typescript": "5.8.3"
} }
} }

View file

@ -0,0 +1,12 @@
import { defineConfig } from "tsup";
export default defineConfig({
entry: ["src/index.ts"],
format: ["esm", "cjs"],
dts: true,
splitting: false,
sourcemap: true,
clean: true,
external: ["winston", "winston-daily-rotate-file"],
treeshake: true,
});