Skip to content

Commit a97d463

Browse files
authored
Merge pull request #62 from kwonoj/feat-esm
build(tsconfig): emit esm output
2 parents 02769f2 + a7c6a2f commit a97d463

File tree

9 files changed

+1048
-977
lines changed

9 files changed

+1048
-977
lines changed

README.md

Lines changed: 121 additions & 107 deletions
Large diffs are not rendered by default.

package.json

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,9 @@
22
"name": "tslog",
33
"version": "2.11.1",
44
"description": "📝 Expressive TypeScript Logger for Node.js: Pretty errors, stack traces, code frames, and JSON output to attachable transports.",
5-
"main": "dist/index",
6-
"typings": "dist/index",
5+
"main": "./dist/cjs/index.js",
6+
"module": "./dist/esm/index.js",
7+
"types": "./dist/types/index.d.ts",
78
"engines": {
89
"node": ">=10"
910
},
@@ -12,7 +13,7 @@
1213
"ts-node-onchange": "onchange -i \"**/*.ts\" -- npm run ts-node",
1314
"start-ts": "npm run ts-node",
1415
"start": "node dist/example/index.js",
15-
"build": "tsc",
16+
"build": "tsc -b tsconfig.json tsconfig.esm.json tsconfig.types.json",
1617
"prepublishOnly": "npm run build && npm run test",
1718
"eslint": "eslint . --ext .ts",
1819
"eslint-fix": "eslint . --ext .ts --fix",
@@ -80,8 +81,10 @@
8081
"source-map-support": "^0.5.19"
8182
},
8283
"files": [
83-
"dist"
84+
"dist",
85+
"src"
8486
],
87+
"sideEffects": false,
8588
"keywords": [
8689
"logger",
8790
"typescript",

src/Logger.ts

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
import { wrapCallSite } from "source-map-support";
2+
import { ISettings, ISettingsParam } from ".";
3+
import { LoggerWithoutCallSite } from "./LoggerWithoutCallSite";
4+
5+
/**
6+
* 📝 Expressive TypeScript Logger for Node.js
7+
* @public
8+
*/
9+
export class Logger extends LoggerWithoutCallSite {
10+
/**
11+
* @param settings - Configuration of the logger instance (all settings are optional with sane defaults)
12+
* @param parentSettings - Used internally to
13+
*/
14+
public constructor(settings?: ISettingsParam, parentSettings?: ISettings) {
15+
super(settings, parentSettings);
16+
this._callSiteWrapper = wrapCallSite;
17+
}
18+
}

0 commit comments

Comments
 (0)