@jay-framework/logger 0.23.0 → 0.23.1

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.
Files changed (2) hide show
  1. package/dist/index.mjs +7 -14
  2. package/package.json +2 -2
package/dist/index.mjs CHANGED
@@ -44,16 +44,11 @@ function createDevLogger(level) {
44
44
  const isTTY = process.stdout.isTTY;
45
45
  function formatTiming(state) {
46
46
  const parts = [];
47
- if (state.viteSsr > 0)
48
- parts.push(`vite-ssr: ${state.viteSsr}ms`);
49
- if (state.params > 0)
50
- parts.push(`params: ${state.params}ms`);
51
- if (state.slowRender > 0)
52
- parts.push(`slow: ${state.slowRender}ms`);
53
- if (state.fastRender > 0)
54
- parts.push(`fast: ${state.fastRender}ms`);
55
- if (state.viteClient > 0)
56
- parts.push(`vite-client: ${state.viteClient}ms`);
47
+ if (state.viteSsr > 0) parts.push(`vite-ssr: ${state.viteSsr}ms`);
48
+ if (state.params > 0) parts.push(`params: ${state.params}ms`);
49
+ if (state.slowRender > 0) parts.push(`slow: ${state.slowRender}ms`);
50
+ if (state.fastRender > 0) parts.push(`fast: ${state.fastRender}ms`);
51
+ if (state.viteClient > 0) parts.push(`vite-client: ${state.viteClient}ms`);
57
52
  const total = Date.now() - state.startTime;
58
53
  const timingStr = parts.length > 0 ? `[${parts.join(" | ")}] ` : "";
59
54
  const ann = state.annotation ? ` ${state.annotation}` : "";
@@ -73,8 +68,7 @@ function createDevLogger(level) {
73
68
  };
74
69
  let lastLineLength = 0;
75
70
  function updateLine() {
76
- if (isSilent)
77
- return;
71
+ if (isSilent) return;
78
72
  const line = formatTiming(state);
79
73
  if (isTTY) {
80
74
  const clearStr = "\r" + " ".repeat(lastLineLength) + "\r";
@@ -108,8 +102,7 @@ function createDevLogger(level) {
108
102
  updateLine();
109
103
  },
110
104
  end: () => {
111
- if (isSilent)
112
- return;
105
+ if (isSilent) return;
113
106
  const line = formatTiming(state);
114
107
  if (isTTY) {
115
108
  const clearStr = "\r" + " ".repeat(lastLineLength) + "\r";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jay-framework/logger",
3
- "version": "0.23.0",
3
+ "version": "0.23.1",
4
4
  "license": "Apache-2.0",
5
5
  "main": "dist/index.mjs",
6
6
  "types": "dist/index.d.mts",
@@ -19,7 +19,7 @@
19
19
  "test:watch": "vitest"
20
20
  },
21
21
  "devDependencies": {
22
- "@jay-framework/dev-environment": "^0.23.0",
22
+ "@jay-framework/dev-environment": "^0.23.1",
23
23
  "@types/node": "^20.11.5",
24
24
  "rimraf": "^5.0.5",
25
25
  "tsup": "^8.0.1",