Skip to content

Commit 57cb0de

Browse files
committed
feat: refactor for next version
1 parent 6351bc5 commit 57cb0de

File tree

6 files changed

+147
-192
lines changed

6 files changed

+147
-192
lines changed

package.json

+7-12
Original file line numberDiff line numberDiff line change
@@ -3,23 +3,18 @@
33
"description": "Logger for professionals",
44
"version": "1.7.1",
55
"sideEffects": false,
6-
"main": "lib/node.js",
7-
"types": "index.d.ts",
6+
"type": "module",
87
"exports": {
98
".": {
9+
"types": "./shared.d.ts",
1010
"node": "./lib/node.js",
11-
"browser": "./lib/browser.mjs",
12-
"types": "./index.d.ts"
13-
},
14-
"./shared": {
15-
"require": "./lib/shared.js",
16-
"import": "./lib/shared.mjs"
11+
"default": "./lib/browser.js"
1712
},
13+
"./src/*": "./src/*",
1814
"./package.json": "./package.json"
1915
},
2016
"files": [
2117
"lib",
22-
"src",
2318
"index.d.ts"
2419
],
2520
"repository": {
@@ -58,8 +53,8 @@
5853
"typescript": "^5.5.3"
5954
},
6055
"dependencies": {
61-
"cosmokit": "^1.6.3",
62-
"object-inspect": "^1.13.1",
63-
"supports-color": "^8.1.1"
56+
"cosmokit": "^1.7.2",
57+
"object-inspect": "^1.13.4",
58+
"supports-color": "^10.0.0"
6459
}
6560
}

src/browser.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import inspect from 'object-inspect'
2-
import Logger from './shared'
2+
import { Factory } from './shared'
33

4-
Logger.format('o', (value, target) => {
5-
return inspect(value, { depth: Infinity }).replace(/\s*\n\s*/g, ' ')
6-
})
4+
Factory.formatters['o'] = (value, target) => {
5+
return inspect(value, { depth: Infinity })
6+
}
77

8-
export = Logger
8+
export * from './shared'

src/index.ts

-3
This file was deleted.

src/node.ts

+5-5
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import { inspect } from 'util'
2-
import Logger from './shared'
2+
import { Factory } from './shared'
33

4-
Logger.format('o', (value, target) => {
5-
return inspect(value, { colors: !!target.colors, depth: Infinity }).replace(/\s*\n\s*/g, ' ')
6-
})
4+
Factory.formatters['o'] = (value, target) => {
5+
return inspect(value, { colors: !!target.colors, depth: Infinity, compact: true, breakLength: Infinity })
6+
}
77

8-
export = Logger
8+
export * from './shared'

0 commit comments

Comments
 (0)