@witchcraft/nuxt-logger 0.0.10 → 0.0.11
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/dist/module.json +1 -1
- package/dist/module.mjs +2 -2
- package/dist/runtime/composables/useLogger.d.ts +1 -1
- package/dist/runtime/helpers/getBaseOptions.js +1 -1
- package/dist/runtime/server/utils/useServerLogger.d.ts +1 -1
- package/dist/runtime/shared/createUseLogger.d.ts +1 -4
- package/dist/runtime/types.d.ts +4 -0
- package/package.json +10 -10
- package/src/runtime/helpers/getBaseOptions.ts +2 -2
- package/src/runtime/shared/createUseLogger.ts +1 -4
- package/src/runtime/types.ts +6 -0
package/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { defu } from 'defu';
|
|
|
3
3
|
import fs from 'node:fs/promises';
|
|
4
4
|
import path from 'node:path';
|
|
5
5
|
|
|
6
|
-
const module = defineNuxtModule({
|
|
6
|
+
const module$1 = defineNuxtModule({
|
|
7
7
|
meta: {
|
|
8
8
|
name: "logger",
|
|
9
9
|
configKey: "logger"
|
|
@@ -88,4 +88,4 @@ const module = defineNuxtModule({
|
|
|
88
88
|
}
|
|
89
89
|
});
|
|
90
90
|
|
|
91
|
-
export { module as default };
|
|
91
|
+
export { module$1 as default };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const useLogger: ({ redirectTo, redirectAll }?: {
|
|
2
2
|
redirectTo?: "electron";
|
|
3
3
|
redirectAll?: boolean | ((level: keyof import("pino").Logger, data: any) => boolean);
|
|
4
|
-
}) => import("../
|
|
4
|
+
}) => import("../types.js").BaseLogger;
|
|
@@ -40,7 +40,7 @@ export function getBaseOptions(config, serverPathResolver) {
|
|
|
40
40
|
const maybeElectronLogLevel = import.meta.client ? window.electron?.meta?.env?.LOG_LEVEL : void 0;
|
|
41
41
|
const maybeElectronLogWriteLevel = import.meta.client ? window.electron?.meta?.env?.LOG_WRITE_LEVEL : void 0;
|
|
42
42
|
const writeLevel = maybeElectronLogWriteLevel ?? maybeElectronLogLevel ?? process.env.LOG_WRITE_LEVEL ?? process.env.LOG_LEVEL ?? (import.meta.dev ? "debug" : void 0) ?? "warn";
|
|
43
|
-
const logLevel =
|
|
43
|
+
const logLevel = maybeElectronLogLevel ?? process.env.LOG_LEVEL ?? (import.meta.dev ? "debug" : void 0) ?? "info";
|
|
44
44
|
const processedAdditionalServerTransportTargets = [];
|
|
45
45
|
const thisContexts = [
|
|
46
46
|
...isElectronClient ? ["electron-client"] : [],
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
export declare const useServerLogger: ({ redirectTo, redirectAll }?: {
|
|
2
2
|
redirectTo?: "electron";
|
|
3
3
|
redirectAll?: boolean | ((level: keyof import("pino").Logger, data: any) => boolean);
|
|
4
|
-
}) => import("../../
|
|
4
|
+
}) => import("../../types.js").BaseLogger;
|
|
@@ -1,9 +1,6 @@
|
|
|
1
1
|
import type { RuntimeConfig } from "nuxt/schema";
|
|
2
2
|
import { type Logger } from "pino";
|
|
3
|
-
import type {
|
|
4
|
-
export type BaseLogger = Record<Levels, ((data: any) => void)> & {
|
|
5
|
-
flush: Logger["flush"];
|
|
6
|
-
};
|
|
3
|
+
import type { BaseLogger } from "../types.js";
|
|
7
4
|
/**
|
|
8
5
|
* This exists to allow creating useLogger both on the client and the server since for the module to work on the server we must import from `#imports` and have the module transpile the files, but this is not neccesary from the composable.
|
|
9
6
|
*
|
package/dist/runtime/types.d.ts
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@witchcraft/nuxt-logger",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.11",
|
|
4
4
|
"description": "Nuxt module for logging.",
|
|
5
5
|
"repository": "witchcraftjs/nuxt-logger",
|
|
6
6
|
"license": "MIT",
|
|
@@ -32,28 +32,28 @@
|
|
|
32
32
|
"dependencies": {
|
|
33
33
|
"@alanscodelog/tsconfigs": "^6.2.0",
|
|
34
34
|
"@alanscodelog/utils": "^6.0.1",
|
|
35
|
-
"@nuxt/kit": "^4.
|
|
35
|
+
"@nuxt/kit": "^4.3.1",
|
|
36
36
|
"defu": "latest",
|
|
37
37
|
"pino": "^9.9.0",
|
|
38
38
|
"pino-pretty": "^11.3.0"
|
|
39
39
|
},
|
|
40
40
|
"devDependencies": {
|
|
41
|
-
"@alanscodelog/eslint-config": "^6.3.
|
|
42
|
-
"@alanscodelog/semantic-release-config": "^6.0.
|
|
43
|
-
"@nuxt/eslint-config": "^1.
|
|
41
|
+
"@alanscodelog/eslint-config": "^6.3.1",
|
|
42
|
+
"@alanscodelog/semantic-release-config": "^6.0.2",
|
|
43
|
+
"@nuxt/eslint-config": "^1.15.2",
|
|
44
44
|
"@nuxt/module-builder": "^1.0.2",
|
|
45
|
-
"@nuxt/schema": "^4.
|
|
45
|
+
"@nuxt/schema": "^4.3.1",
|
|
46
46
|
"@nuxt/test-utils": "^3.19.2",
|
|
47
47
|
"@types/node": "latest",
|
|
48
48
|
"changelogen": "^0.6.2",
|
|
49
49
|
"electron": "^34.5.8",
|
|
50
50
|
"eslint": "^9.34.0",
|
|
51
51
|
"husky": "^9.1.7",
|
|
52
|
-
"nuxt": "^4.
|
|
53
|
-
"semantic-release": "^
|
|
54
|
-
"typescript": "^5.9.
|
|
52
|
+
"nuxt": "^4.2.1",
|
|
53
|
+
"semantic-release": "^25.0.3",
|
|
54
|
+
"typescript": "^5.9.3",
|
|
55
55
|
"vitest": "^3.2.4",
|
|
56
|
-
"vue-tsc": "^
|
|
56
|
+
"vue-tsc": "^3.2.5"
|
|
57
57
|
},
|
|
58
58
|
"release": {
|
|
59
59
|
"extends": [
|
|
@@ -71,10 +71,10 @@ export function getBaseOptions(
|
|
|
71
71
|
?? (import.meta.dev ? "debug" : undefined)
|
|
72
72
|
?? "warn"
|
|
73
73
|
const logLevel: (typeof validLevels)[number]
|
|
74
|
-
=
|
|
74
|
+
= maybeElectronLogLevel
|
|
75
75
|
?? process.env.LOG_LEVEL as any
|
|
76
76
|
?? (import.meta.dev ? "debug" : undefined)
|
|
77
|
-
?? "
|
|
77
|
+
?? "info"
|
|
78
78
|
|
|
79
79
|
const processedAdditionalServerTransportTargets = []
|
|
80
80
|
const thisContexts = [
|
|
@@ -2,11 +2,8 @@ import type { RuntimeConfig } from "nuxt/schema"
|
|
|
2
2
|
import { type Logger, pino } from "pino"
|
|
3
3
|
|
|
4
4
|
import { getBaseOptions } from "../helpers/getBaseOptions.js"
|
|
5
|
-
import type { Levels } from "../types.js"
|
|
5
|
+
import type { BaseLogger, Levels } from "../types.js"
|
|
6
6
|
|
|
7
|
-
export type BaseLogger = Record<Levels, ((data: any) => void)> & {
|
|
8
|
-
flush: Logger["flush"]
|
|
9
|
-
}
|
|
10
7
|
const logger: BaseLogger = {} as any
|
|
11
8
|
|
|
12
9
|
/**
|