@innei/pretty-logger-core 0.3.3 → 0.3.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/index.ts CHANGED
@@ -1,3 +1,3 @@
1
+ export * from './consola'
1
2
  export * from './consola.instance'
2
3
  export * from './consola/reporters'
3
- export * from './consola'
package/package.json CHANGED
@@ -1,25 +1,25 @@
1
1
  {
2
2
  "name": "@innei/pretty-logger-core",
3
- "version": "0.3.3",
4
- "main": "dist/index.js",
5
- "module": "dist/index.mjs",
6
- "types": "dist/index.d.ts",
3
+ "version": "0.3.4",
7
4
  "exports": {
8
5
  ".": {
9
6
  "require": "./dist/index.js",
10
7
  "import": "./dist/index.mjs"
11
8
  }
12
9
  },
10
+ "main": "dist/index.js",
11
+ "module": "dist/index.mjs",
12
+ "types": "dist/index.d.ts",
13
13
  "dependencies": {
14
- "cron": "3.1.6",
14
+ "cron": "4.3.0",
15
15
  "defu": "^6.1.3",
16
16
  "picocolors": "^1.0.0",
17
17
  "std-env": "^3.5.0"
18
18
  },
19
19
  "devDependencies": {
20
- "string-width": "npm:@innei/string-width@7.1.1-fork.0"
20
+ "string-width": "7.2.0"
21
21
  },
22
22
  "scripts": {
23
- "build": "tsup"
23
+ "build": "tsdown"
24
24
  }
25
25
  }
package/tool.util.ts CHANGED
@@ -1,29 +1,20 @@
1
- import path from 'path'
1
+ import path from 'node:path'
2
2
 
3
- export const getShortTime = (date: Date) => {
3
+ export function getShortTime (date: Date) {
4
4
  return Intl.DateTimeFormat('en-US', {
5
5
  timeStyle: 'medium',
6
6
  hour12: false,
7
7
  }).format(date)
8
8
  }
9
9
 
10
- export const getShortDate = (date: Date) => {
10
+ export function getShortDate (date: Date) {
11
11
  return Intl.DateTimeFormat('en-US', {
12
12
  dateStyle: 'short',
13
13
  })
14
14
  .format(date)
15
- .replace(/\//g, '-')
16
- }
17
- /** 2-12-22, 21:31:42 */
18
- export const getShortDateTime = (date: Date) => {
19
- return Intl.DateTimeFormat('en-US', {
20
- dateStyle: 'short',
21
- timeStyle: 'medium',
22
- hour12: false,
23
- })
24
- .format(date)
25
- .replace(/\//g, '-')
15
+ .replaceAll('/', '-')
26
16
  }
27
17
 
28
- export const getLogFilePath = (logDir: string, formatString: string) =>
29
- path.resolve(logDir, formatString.replace(/%d/g, getShortDate(new Date())))
18
+ export function getLogFilePath (logDir: string, formatString: string) {
19
+ return path.resolve(logDir, formatString.replaceAll('%d', getShortDate(new Date())))
20
+ }
@@ -1,4 +1,4 @@
1
- import { defineConfig } from 'tsup'
1
+ import { defineConfig } from 'tsdown'
2
2
 
3
3
  export default defineConfig({
4
4
  clean: true,