@logtape/fastify 1.3.0-dev.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.
- package/LICENSE +20 -0
- package/deno.json +34 -0
- package/dist/_virtual/rolldown_runtime.cjs +30 -0
- package/dist/mod.cjs +123 -0
- package/dist/mod.d.cts +115 -0
- package/dist/mod.d.cts.map +1 -0
- package/dist/mod.d.ts +115 -0
- package/dist/mod.d.ts.map +1 -0
- package/dist/mod.js +123 -0
- package/dist/mod.js.map +1 -0
- package/package.json +66 -0
- package/src/mod.test.ts +779 -0
- package/src/mod.ts +252 -0
- package/tsdown.config.ts +11 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright 2024–2025 Hong Minhee
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
|
|
9
|
+
the Software, and to permit persons to whom the Software is furnished to do so,
|
|
10
|
+
subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
|
|
17
|
+
FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
|
|
18
|
+
COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
19
|
+
IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
20
|
+
CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/deno.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@logtape/fastify",
|
|
3
|
+
"version": "1.3.0",
|
|
4
|
+
"license": "MIT",
|
|
5
|
+
"exports": "./src/mod.ts",
|
|
6
|
+
"exclude": [
|
|
7
|
+
"coverage/",
|
|
8
|
+
"npm/",
|
|
9
|
+
"dist/"
|
|
10
|
+
],
|
|
11
|
+
"tasks": {
|
|
12
|
+
"build": "pnpm build",
|
|
13
|
+
"test": "deno test --allow-env --allow-sys --allow-net",
|
|
14
|
+
"test:node": {
|
|
15
|
+
"dependencies": [
|
|
16
|
+
"build"
|
|
17
|
+
],
|
|
18
|
+
"command": "node --experimental-transform-types --test"
|
|
19
|
+
},
|
|
20
|
+
"test:bun": {
|
|
21
|
+
"dependencies": [
|
|
22
|
+
"build"
|
|
23
|
+
],
|
|
24
|
+
"command": "bun test"
|
|
25
|
+
},
|
|
26
|
+
"test-all": {
|
|
27
|
+
"dependencies": [
|
|
28
|
+
"test",
|
|
29
|
+
"test:node",
|
|
30
|
+
"test:bun"
|
|
31
|
+
]
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
//#region rolldown:runtime
|
|
2
|
+
var __create = Object.create;
|
|
3
|
+
var __defProp = Object.defineProperty;
|
|
4
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
5
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
7
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
8
|
+
var __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
10
|
+
key = keys[i];
|
|
11
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
12
|
+
get: ((k) => from[k]).bind(null, key),
|
|
13
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
14
|
+
});
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
19
|
+
value: mod,
|
|
20
|
+
enumerable: true
|
|
21
|
+
}) : target, mod));
|
|
22
|
+
|
|
23
|
+
//#endregion
|
|
24
|
+
|
|
25
|
+
Object.defineProperty(exports, '__toESM', {
|
|
26
|
+
enumerable: true,
|
|
27
|
+
get: function () {
|
|
28
|
+
return __toESM;
|
|
29
|
+
}
|
|
30
|
+
});
|
package/dist/mod.cjs
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
const require_rolldown_runtime = require('./_virtual/rolldown_runtime.cjs');
|
|
2
|
+
const __logtape_logtape = require_rolldown_runtime.__toESM(require("@logtape/logtape"));
|
|
3
|
+
|
|
4
|
+
//#region src/mod.ts
|
|
5
|
+
/**
|
|
6
|
+
* Creates a Pino-compatible logger that wraps LogTape.
|
|
7
|
+
* This logger can be used as Fastify's `loggerInstance`.
|
|
8
|
+
*
|
|
9
|
+
* @example Basic usage
|
|
10
|
+
* ```typescript
|
|
11
|
+
* import Fastify from "fastify";
|
|
12
|
+
* import { configure } from "@logtape/logtape";
|
|
13
|
+
* import { getLogTapeFastifyLogger } from "@logtape/fastify";
|
|
14
|
+
*
|
|
15
|
+
* await configure({
|
|
16
|
+
* // ... LogTape configuration
|
|
17
|
+
* });
|
|
18
|
+
*
|
|
19
|
+
* const fastify = Fastify({
|
|
20
|
+
* loggerInstance: getLogTapeFastifyLogger(),
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example With custom category
|
|
25
|
+
* ```typescript
|
|
26
|
+
* const fastify = Fastify({
|
|
27
|
+
* loggerInstance: getLogTapeFastifyLogger({
|
|
28
|
+
* category: ["myapp", "http"],
|
|
29
|
+
* }),
|
|
30
|
+
* });
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* @param options Configuration options for the logger.
|
|
34
|
+
* @returns A Pino-compatible logger wrapping LogTape.
|
|
35
|
+
* @since 1.3.0
|
|
36
|
+
*/
|
|
37
|
+
function getLogTapeFastifyLogger(options = {}) {
|
|
38
|
+
const category = normalizeCategory(options.category ?? ["fastify"]);
|
|
39
|
+
const logger = (0, __logtape_logtape.getLogger)(category);
|
|
40
|
+
const initialLevel = options.level ?? "info";
|
|
41
|
+
return createPinoLikeLogger(logger, initialLevel);
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* Normalize category to array format.
|
|
45
|
+
*/
|
|
46
|
+
function normalizeCategory(category) {
|
|
47
|
+
return typeof category === "string" ? [category] : category;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Format message with printf-style interpolation.
|
|
51
|
+
* Supports: %s (string), %d (number), %j (JSON), %o/%O (object), %% (escaped %)
|
|
52
|
+
*/
|
|
53
|
+
function formatMessage(template, ...args) {
|
|
54
|
+
let argIndex = 0;
|
|
55
|
+
return template.replace(/%[sdjoO%]/g, (match) => {
|
|
56
|
+
if (match === "%%") return "%";
|
|
57
|
+
if (argIndex >= args.length) return match;
|
|
58
|
+
const arg = args[argIndex++];
|
|
59
|
+
switch (match) {
|
|
60
|
+
case "%s": return String(arg);
|
|
61
|
+
case "%d": return Number(arg).toString();
|
|
62
|
+
case "%j":
|
|
63
|
+
case "%o":
|
|
64
|
+
case "%O": return JSON.stringify(arg);
|
|
65
|
+
default: return match;
|
|
66
|
+
}
|
|
67
|
+
});
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Creates a Pino-like logger wrapper around a LogTape logger.
|
|
71
|
+
*/
|
|
72
|
+
function createPinoLikeLogger(logger, initialLevel, bindings = {}) {
|
|
73
|
+
let _level = initialLevel;
|
|
74
|
+
const contextLogger = Object.keys(bindings).length > 0 ? logger.with(bindings) : logger;
|
|
75
|
+
/**
|
|
76
|
+
* Create a log method for a specific level.
|
|
77
|
+
*/
|
|
78
|
+
function createLogMethod(logFn) {
|
|
79
|
+
return function pinoLogMethod(objOrMsg, ...restArgs) {
|
|
80
|
+
if (typeof objOrMsg === "string") {
|
|
81
|
+
const message = formatMessage(objOrMsg, ...restArgs);
|
|
82
|
+
logFn(message);
|
|
83
|
+
} else if (typeof objOrMsg === "object" && objOrMsg !== null) {
|
|
84
|
+
const properties = { ...objOrMsg };
|
|
85
|
+
const [msgOrArg, ...args] = restArgs;
|
|
86
|
+
if (typeof msgOrArg === "string") {
|
|
87
|
+
const message = formatMessage(msgOrArg, ...args);
|
|
88
|
+
logFn(message, properties);
|
|
89
|
+
} else if ("msg" in properties && typeof properties.msg === "string") {
|
|
90
|
+
const message = properties.msg;
|
|
91
|
+
delete properties.msg;
|
|
92
|
+
logFn(message, properties);
|
|
93
|
+
} else logFn("{*}", properties);
|
|
94
|
+
}
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
const pinoLogger = {
|
|
98
|
+
trace: createLogMethod((msg, props) => contextLogger.trace(msg, props)),
|
|
99
|
+
debug: createLogMethod((msg, props) => contextLogger.debug(msg, props)),
|
|
100
|
+
info: createLogMethod((msg, props) => contextLogger.info(msg, props)),
|
|
101
|
+
warn: createLogMethod((msg, props) => contextLogger.warn(msg, props)),
|
|
102
|
+
error: createLogMethod((msg, props) => contextLogger.error(msg, props)),
|
|
103
|
+
fatal: createLogMethod((msg, props) => contextLogger.fatal(msg, props)),
|
|
104
|
+
silent: () => {},
|
|
105
|
+
child: (childBindings) => {
|
|
106
|
+
const mergedBindings = {
|
|
107
|
+
...bindings,
|
|
108
|
+
...childBindings
|
|
109
|
+
};
|
|
110
|
+
return createPinoLikeLogger(logger, _level, mergedBindings);
|
|
111
|
+
},
|
|
112
|
+
get level() {
|
|
113
|
+
return _level;
|
|
114
|
+
},
|
|
115
|
+
set level(newLevel) {
|
|
116
|
+
_level = newLevel;
|
|
117
|
+
}
|
|
118
|
+
};
|
|
119
|
+
return pinoLogger;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
//#endregion
|
|
123
|
+
exports.getLogTapeFastifyLogger = getLogTapeFastifyLogger;
|
package/dist/mod.d.cts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
//#region src/mod.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Pino log levels as strings.
|
|
4
|
+
* @since 1.3.0
|
|
5
|
+
*/
|
|
6
|
+
type PinoLevel = "trace" | "debug" | "info" | "warn" | "error" | "fatal" | "silent";
|
|
7
|
+
/**
|
|
8
|
+
* Options for configuring the Fastify LogTape logger.
|
|
9
|
+
* @since 1.3.0
|
|
10
|
+
*/
|
|
11
|
+
interface FastifyLogTapeOptions {
|
|
12
|
+
/**
|
|
13
|
+
* The LogTape category to use for logging.
|
|
14
|
+
* @default ["fastify"]
|
|
15
|
+
*/
|
|
16
|
+
readonly category?: string | readonly string[];
|
|
17
|
+
/**
|
|
18
|
+
* The initial log level. This is tracked internally to satisfy
|
|
19
|
+
* Pino's level property requirement.
|
|
20
|
+
* Note: Actual filtering is controlled by LogTape configuration.
|
|
21
|
+
* @default "info"
|
|
22
|
+
*/
|
|
23
|
+
readonly level?: PinoLevel;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Pino-style log method supporting multiple signatures.
|
|
27
|
+
*
|
|
28
|
+
* Supports the following calling conventions:
|
|
29
|
+
* - `logger.info("message")` - Simple message
|
|
30
|
+
* - `logger.info("message %s", arg)` - Printf-style interpolation
|
|
31
|
+
* - `logger.info({ key: "value" }, "message")` - Object with message
|
|
32
|
+
* - `logger.info({ key: "value" })` - Object only
|
|
33
|
+
* - `logger.info({ msg: "message", key: "value" })` - Object with msg property
|
|
34
|
+
*
|
|
35
|
+
* @since 1.3.0
|
|
36
|
+
*/
|
|
37
|
+
interface PinoLogMethod {
|
|
38
|
+
/** Log with object and optional message */
|
|
39
|
+
(obj: Record<string, unknown>, msg?: string, ...args: unknown[]): void;
|
|
40
|
+
/** Log with just a message and optional interpolation args */
|
|
41
|
+
(msg: string, ...args: unknown[]): void;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A Pino-compatible logger interface that wraps LogTape.
|
|
45
|
+
* This interface satisfies Fastify's `loggerInstance` requirements.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* import Fastify from "fastify";
|
|
50
|
+
* import { getLogTapeFastifyLogger } from "@logtape/fastify";
|
|
51
|
+
*
|
|
52
|
+
* const fastify = Fastify({
|
|
53
|
+
* loggerInstance: getLogTapeFastifyLogger(),
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @since 1.3.0
|
|
58
|
+
*/
|
|
59
|
+
interface PinoLikeLogger {
|
|
60
|
+
/** Log at trace level */
|
|
61
|
+
trace: PinoLogMethod;
|
|
62
|
+
/** Log at debug level */
|
|
63
|
+
debug: PinoLogMethod;
|
|
64
|
+
/** Log at info level */
|
|
65
|
+
info: PinoLogMethod;
|
|
66
|
+
/** Log at warn level */
|
|
67
|
+
warn: PinoLogMethod;
|
|
68
|
+
/** Log at error level */
|
|
69
|
+
error: PinoLogMethod;
|
|
70
|
+
/** Log at fatal level */
|
|
71
|
+
fatal: PinoLogMethod;
|
|
72
|
+
/** No-op silent method for Pino compatibility */
|
|
73
|
+
silent: () => void;
|
|
74
|
+
/** Create a child logger with additional bindings */
|
|
75
|
+
child: (bindings: Record<string, unknown>) => PinoLikeLogger;
|
|
76
|
+
/** Current log level (readable/writable for Pino compatibility) */
|
|
77
|
+
level: string;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Creates a Pino-compatible logger that wraps LogTape.
|
|
81
|
+
* This logger can be used as Fastify's `loggerInstance`.
|
|
82
|
+
*
|
|
83
|
+
* @example Basic usage
|
|
84
|
+
* ```typescript
|
|
85
|
+
* import Fastify from "fastify";
|
|
86
|
+
* import { configure } from "@logtape/logtape";
|
|
87
|
+
* import { getLogTapeFastifyLogger } from "@logtape/fastify";
|
|
88
|
+
*
|
|
89
|
+
* await configure({
|
|
90
|
+
* // ... LogTape configuration
|
|
91
|
+
* });
|
|
92
|
+
*
|
|
93
|
+
* const fastify = Fastify({
|
|
94
|
+
* loggerInstance: getLogTapeFastifyLogger(),
|
|
95
|
+
* });
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @example With custom category
|
|
99
|
+
* ```typescript
|
|
100
|
+
* const fastify = Fastify({
|
|
101
|
+
* loggerInstance: getLogTapeFastifyLogger({
|
|
102
|
+
* category: ["myapp", "http"],
|
|
103
|
+
* }),
|
|
104
|
+
* });
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* @param options Configuration options for the logger.
|
|
108
|
+
* @returns A Pino-compatible logger wrapping LogTape.
|
|
109
|
+
* @since 1.3.0
|
|
110
|
+
*/
|
|
111
|
+
declare function getLogTapeFastifyLogger(options?: FastifyLogTapeOptions): PinoLikeLogger;
|
|
112
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
113
|
+
//#endregion
|
|
114
|
+
export { FastifyLogTapeOptions, PinoLevel, PinoLikeLogger, PinoLogMethod, getLogTapeFastifyLogger };
|
|
115
|
+
//# sourceMappingURL=mod.d.cts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.cts","names":[],"sources":["../src/mod.ts"],"sourcesContent":[],"mappings":";;AAMA;AAaA;AA4BA;AAuBiB,KAhEL,SAAA,GAgEmB,OAAA,GAAA,OAAA,GAAA,MAAA,GAAA,MAAA,GAAA,OAAA,GAAA,OAAA,GAAA,QAAA;;;;;AAQvB,UA3DS,qBAAA,CA2DT;EAAa;;;;EAQyC,SAAA,QAAA,CAAA,EAAA,MAAA,GAAA,SAAA,MAAA,EAAA;EAqC9C;;;;AAEC;;mBA7FE;;;;;;;;;;;;;;UAeF,aAAA;;QAET;;;;;;;;;;;;;;;;;;;;UAqBS,cAAA;;SAER;;SAEA;;QAED;;QAEA;;SAEC;;SAEA;;;;oBAIW,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqChC,uBAAA,WACL,wBACR"}
|
package/dist/mod.d.ts
ADDED
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
//#region src/mod.d.ts
|
|
2
|
+
/**
|
|
3
|
+
* Pino log levels as strings.
|
|
4
|
+
* @since 1.3.0
|
|
5
|
+
*/
|
|
6
|
+
type PinoLevel = "trace" | "debug" | "info" | "warn" | "error" | "fatal" | "silent";
|
|
7
|
+
/**
|
|
8
|
+
* Options for configuring the Fastify LogTape logger.
|
|
9
|
+
* @since 1.3.0
|
|
10
|
+
*/
|
|
11
|
+
interface FastifyLogTapeOptions {
|
|
12
|
+
/**
|
|
13
|
+
* The LogTape category to use for logging.
|
|
14
|
+
* @default ["fastify"]
|
|
15
|
+
*/
|
|
16
|
+
readonly category?: string | readonly string[];
|
|
17
|
+
/**
|
|
18
|
+
* The initial log level. This is tracked internally to satisfy
|
|
19
|
+
* Pino's level property requirement.
|
|
20
|
+
* Note: Actual filtering is controlled by LogTape configuration.
|
|
21
|
+
* @default "info"
|
|
22
|
+
*/
|
|
23
|
+
readonly level?: PinoLevel;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Pino-style log method supporting multiple signatures.
|
|
27
|
+
*
|
|
28
|
+
* Supports the following calling conventions:
|
|
29
|
+
* - `logger.info("message")` - Simple message
|
|
30
|
+
* - `logger.info("message %s", arg)` - Printf-style interpolation
|
|
31
|
+
* - `logger.info({ key: "value" }, "message")` - Object with message
|
|
32
|
+
* - `logger.info({ key: "value" })` - Object only
|
|
33
|
+
* - `logger.info({ msg: "message", key: "value" })` - Object with msg property
|
|
34
|
+
*
|
|
35
|
+
* @since 1.3.0
|
|
36
|
+
*/
|
|
37
|
+
interface PinoLogMethod {
|
|
38
|
+
/** Log with object and optional message */
|
|
39
|
+
(obj: Record<string, unknown>, msg?: string, ...args: unknown[]): void;
|
|
40
|
+
/** Log with just a message and optional interpolation args */
|
|
41
|
+
(msg: string, ...args: unknown[]): void;
|
|
42
|
+
}
|
|
43
|
+
/**
|
|
44
|
+
* A Pino-compatible logger interface that wraps LogTape.
|
|
45
|
+
* This interface satisfies Fastify's `loggerInstance` requirements.
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```typescript
|
|
49
|
+
* import Fastify from "fastify";
|
|
50
|
+
* import { getLogTapeFastifyLogger } from "@logtape/fastify";
|
|
51
|
+
*
|
|
52
|
+
* const fastify = Fastify({
|
|
53
|
+
* loggerInstance: getLogTapeFastifyLogger(),
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @since 1.3.0
|
|
58
|
+
*/
|
|
59
|
+
interface PinoLikeLogger {
|
|
60
|
+
/** Log at trace level */
|
|
61
|
+
trace: PinoLogMethod;
|
|
62
|
+
/** Log at debug level */
|
|
63
|
+
debug: PinoLogMethod;
|
|
64
|
+
/** Log at info level */
|
|
65
|
+
info: PinoLogMethod;
|
|
66
|
+
/** Log at warn level */
|
|
67
|
+
warn: PinoLogMethod;
|
|
68
|
+
/** Log at error level */
|
|
69
|
+
error: PinoLogMethod;
|
|
70
|
+
/** Log at fatal level */
|
|
71
|
+
fatal: PinoLogMethod;
|
|
72
|
+
/** No-op silent method for Pino compatibility */
|
|
73
|
+
silent: () => void;
|
|
74
|
+
/** Create a child logger with additional bindings */
|
|
75
|
+
child: (bindings: Record<string, unknown>) => PinoLikeLogger;
|
|
76
|
+
/** Current log level (readable/writable for Pino compatibility) */
|
|
77
|
+
level: string;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Creates a Pino-compatible logger that wraps LogTape.
|
|
81
|
+
* This logger can be used as Fastify's `loggerInstance`.
|
|
82
|
+
*
|
|
83
|
+
* @example Basic usage
|
|
84
|
+
* ```typescript
|
|
85
|
+
* import Fastify from "fastify";
|
|
86
|
+
* import { configure } from "@logtape/logtape";
|
|
87
|
+
* import { getLogTapeFastifyLogger } from "@logtape/fastify";
|
|
88
|
+
*
|
|
89
|
+
* await configure({
|
|
90
|
+
* // ... LogTape configuration
|
|
91
|
+
* });
|
|
92
|
+
*
|
|
93
|
+
* const fastify = Fastify({
|
|
94
|
+
* loggerInstance: getLogTapeFastifyLogger(),
|
|
95
|
+
* });
|
|
96
|
+
* ```
|
|
97
|
+
*
|
|
98
|
+
* @example With custom category
|
|
99
|
+
* ```typescript
|
|
100
|
+
* const fastify = Fastify({
|
|
101
|
+
* loggerInstance: getLogTapeFastifyLogger({
|
|
102
|
+
* category: ["myapp", "http"],
|
|
103
|
+
* }),
|
|
104
|
+
* });
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
* @param options Configuration options for the logger.
|
|
108
|
+
* @returns A Pino-compatible logger wrapping LogTape.
|
|
109
|
+
* @since 1.3.0
|
|
110
|
+
*/
|
|
111
|
+
declare function getLogTapeFastifyLogger(options?: FastifyLogTapeOptions): PinoLikeLogger;
|
|
112
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
113
|
+
//#endregion
|
|
114
|
+
export { FastifyLogTapeOptions, PinoLevel, PinoLikeLogger, PinoLogMethod, getLogTapeFastifyLogger };
|
|
115
|
+
//# sourceMappingURL=mod.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.d.ts","names":[],"sources":["../src/mod.ts"],"sourcesContent":[],"mappings":";;AAMA;AAaA;AA4BA;AAuBiB,KAhEL,SAAA,GAgEmB,OAAA,GAAA,OAAA,GAAA,MAAA,GAAA,MAAA,GAAA,OAAA,GAAA,OAAA,GAAA,QAAA;;;;;AAQvB,UA3DS,qBAAA,CA2DT;EAAa;;;;EAQyC,SAAA,QAAA,CAAA,EAAA,MAAA,GAAA,SAAA,MAAA,EAAA;EAqC9C;;;;AAEC;;mBA7FE;;;;;;;;;;;;;;UAeF,aAAA;;QAET;;;;;;;;;;;;;;;;;;;;UAqBS,cAAA;;SAER;;SAEA;;QAED;;QAEA;;SAEC;;SAEA;;;;oBAIW,4BAA4B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;iBAqChC,uBAAA,WACL,wBACR"}
|
package/dist/mod.js
ADDED
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
import { getLogger } from "@logtape/logtape";
|
|
2
|
+
|
|
3
|
+
//#region src/mod.ts
|
|
4
|
+
/**
|
|
5
|
+
* Creates a Pino-compatible logger that wraps LogTape.
|
|
6
|
+
* This logger can be used as Fastify's `loggerInstance`.
|
|
7
|
+
*
|
|
8
|
+
* @example Basic usage
|
|
9
|
+
* ```typescript
|
|
10
|
+
* import Fastify from "fastify";
|
|
11
|
+
* import { configure } from "@logtape/logtape";
|
|
12
|
+
* import { getLogTapeFastifyLogger } from "@logtape/fastify";
|
|
13
|
+
*
|
|
14
|
+
* await configure({
|
|
15
|
+
* // ... LogTape configuration
|
|
16
|
+
* });
|
|
17
|
+
*
|
|
18
|
+
* const fastify = Fastify({
|
|
19
|
+
* loggerInstance: getLogTapeFastifyLogger(),
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
22
|
+
*
|
|
23
|
+
* @example With custom category
|
|
24
|
+
* ```typescript
|
|
25
|
+
* const fastify = Fastify({
|
|
26
|
+
* loggerInstance: getLogTapeFastifyLogger({
|
|
27
|
+
* category: ["myapp", "http"],
|
|
28
|
+
* }),
|
|
29
|
+
* });
|
|
30
|
+
* ```
|
|
31
|
+
*
|
|
32
|
+
* @param options Configuration options for the logger.
|
|
33
|
+
* @returns A Pino-compatible logger wrapping LogTape.
|
|
34
|
+
* @since 1.3.0
|
|
35
|
+
*/
|
|
36
|
+
function getLogTapeFastifyLogger(options = {}) {
|
|
37
|
+
const category = normalizeCategory(options.category ?? ["fastify"]);
|
|
38
|
+
const logger = getLogger(category);
|
|
39
|
+
const initialLevel = options.level ?? "info";
|
|
40
|
+
return createPinoLikeLogger(logger, initialLevel);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Normalize category to array format.
|
|
44
|
+
*/
|
|
45
|
+
function normalizeCategory(category) {
|
|
46
|
+
return typeof category === "string" ? [category] : category;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Format message with printf-style interpolation.
|
|
50
|
+
* Supports: %s (string), %d (number), %j (JSON), %o/%O (object), %% (escaped %)
|
|
51
|
+
*/
|
|
52
|
+
function formatMessage(template, ...args) {
|
|
53
|
+
let argIndex = 0;
|
|
54
|
+
return template.replace(/%[sdjoO%]/g, (match) => {
|
|
55
|
+
if (match === "%%") return "%";
|
|
56
|
+
if (argIndex >= args.length) return match;
|
|
57
|
+
const arg = args[argIndex++];
|
|
58
|
+
switch (match) {
|
|
59
|
+
case "%s": return String(arg);
|
|
60
|
+
case "%d": return Number(arg).toString();
|
|
61
|
+
case "%j":
|
|
62
|
+
case "%o":
|
|
63
|
+
case "%O": return JSON.stringify(arg);
|
|
64
|
+
default: return match;
|
|
65
|
+
}
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Creates a Pino-like logger wrapper around a LogTape logger.
|
|
70
|
+
*/
|
|
71
|
+
function createPinoLikeLogger(logger, initialLevel, bindings = {}) {
|
|
72
|
+
let _level = initialLevel;
|
|
73
|
+
const contextLogger = Object.keys(bindings).length > 0 ? logger.with(bindings) : logger;
|
|
74
|
+
/**
|
|
75
|
+
* Create a log method for a specific level.
|
|
76
|
+
*/
|
|
77
|
+
function createLogMethod(logFn) {
|
|
78
|
+
return function pinoLogMethod(objOrMsg, ...restArgs) {
|
|
79
|
+
if (typeof objOrMsg === "string") {
|
|
80
|
+
const message = formatMessage(objOrMsg, ...restArgs);
|
|
81
|
+
logFn(message);
|
|
82
|
+
} else if (typeof objOrMsg === "object" && objOrMsg !== null) {
|
|
83
|
+
const properties = { ...objOrMsg };
|
|
84
|
+
const [msgOrArg, ...args] = restArgs;
|
|
85
|
+
if (typeof msgOrArg === "string") {
|
|
86
|
+
const message = formatMessage(msgOrArg, ...args);
|
|
87
|
+
logFn(message, properties);
|
|
88
|
+
} else if ("msg" in properties && typeof properties.msg === "string") {
|
|
89
|
+
const message = properties.msg;
|
|
90
|
+
delete properties.msg;
|
|
91
|
+
logFn(message, properties);
|
|
92
|
+
} else logFn("{*}", properties);
|
|
93
|
+
}
|
|
94
|
+
};
|
|
95
|
+
}
|
|
96
|
+
const pinoLogger = {
|
|
97
|
+
trace: createLogMethod((msg, props) => contextLogger.trace(msg, props)),
|
|
98
|
+
debug: createLogMethod((msg, props) => contextLogger.debug(msg, props)),
|
|
99
|
+
info: createLogMethod((msg, props) => contextLogger.info(msg, props)),
|
|
100
|
+
warn: createLogMethod((msg, props) => contextLogger.warn(msg, props)),
|
|
101
|
+
error: createLogMethod((msg, props) => contextLogger.error(msg, props)),
|
|
102
|
+
fatal: createLogMethod((msg, props) => contextLogger.fatal(msg, props)),
|
|
103
|
+
silent: () => {},
|
|
104
|
+
child: (childBindings) => {
|
|
105
|
+
const mergedBindings = {
|
|
106
|
+
...bindings,
|
|
107
|
+
...childBindings
|
|
108
|
+
};
|
|
109
|
+
return createPinoLikeLogger(logger, _level, mergedBindings);
|
|
110
|
+
},
|
|
111
|
+
get level() {
|
|
112
|
+
return _level;
|
|
113
|
+
},
|
|
114
|
+
set level(newLevel) {
|
|
115
|
+
_level = newLevel;
|
|
116
|
+
}
|
|
117
|
+
};
|
|
118
|
+
return pinoLogger;
|
|
119
|
+
}
|
|
120
|
+
|
|
121
|
+
//#endregion
|
|
122
|
+
export { getLogTapeFastifyLogger };
|
|
123
|
+
//# sourceMappingURL=mod.js.map
|
package/dist/mod.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.js","names":["options: FastifyLogTapeOptions","category: string | readonly string[]","template: string","logger: Logger","initialLevel: PinoLevel","bindings: Record<string, unknown>","_level: string","logFn: (msg: string, props?: Record<string, unknown>) => void","objOrMsg: Record<string, unknown> | string","pinoLogger: PinoLikeLogger","childBindings: Record<string, unknown>","newLevel: string"],"sources":["../src/mod.ts"],"sourcesContent":["import { getLogger, type Logger } from \"@logtape/logtape\";\n\n/**\n * Pino log levels as strings.\n * @since 1.3.0\n */\nexport type PinoLevel =\n | \"trace\"\n | \"debug\"\n | \"info\"\n | \"warn\"\n | \"error\"\n | \"fatal\"\n | \"silent\";\n\n/**\n * Options for configuring the Fastify LogTape logger.\n * @since 1.3.0\n */\nexport interface FastifyLogTapeOptions {\n /**\n * The LogTape category to use for logging.\n * @default [\"fastify\"]\n */\n readonly category?: string | readonly string[];\n\n /**\n * The initial log level. This is tracked internally to satisfy\n * Pino's level property requirement.\n * Note: Actual filtering is controlled by LogTape configuration.\n * @default \"info\"\n */\n readonly level?: PinoLevel;\n}\n\n/**\n * Pino-style log method supporting multiple signatures.\n *\n * Supports the following calling conventions:\n * - `logger.info(\"message\")` - Simple message\n * - `logger.info(\"message %s\", arg)` - Printf-style interpolation\n * - `logger.info({ key: \"value\" }, \"message\")` - Object with message\n * - `logger.info({ key: \"value\" })` - Object only\n * - `logger.info({ msg: \"message\", key: \"value\" })` - Object with msg property\n *\n * @since 1.3.0\n */\nexport interface PinoLogMethod {\n /** Log with object and optional message */\n (obj: Record<string, unknown>, msg?: string, ...args: unknown[]): void;\n /** Log with just a message and optional interpolation args */\n (msg: string, ...args: unknown[]): void;\n}\n\n/**\n * A Pino-compatible logger interface that wraps LogTape.\n * This interface satisfies Fastify's `loggerInstance` requirements.\n *\n * @example\n * ```typescript\n * import Fastify from \"fastify\";\n * import { getLogTapeFastifyLogger } from \"@logtape/fastify\";\n *\n * const fastify = Fastify({\n * loggerInstance: getLogTapeFastifyLogger(),\n * });\n * ```\n *\n * @since 1.3.0\n */\nexport interface PinoLikeLogger {\n /** Log at trace level */\n trace: PinoLogMethod;\n /** Log at debug level */\n debug: PinoLogMethod;\n /** Log at info level */\n info: PinoLogMethod;\n /** Log at warn level */\n warn: PinoLogMethod;\n /** Log at error level */\n error: PinoLogMethod;\n /** Log at fatal level */\n fatal: PinoLogMethod;\n /** No-op silent method for Pino compatibility */\n silent: () => void;\n /** Create a child logger with additional bindings */\n child: (bindings: Record<string, unknown>) => PinoLikeLogger;\n /** Current log level (readable/writable for Pino compatibility) */\n level: string;\n}\n\n/**\n * Creates a Pino-compatible logger that wraps LogTape.\n * This logger can be used as Fastify's `loggerInstance`.\n *\n * @example Basic usage\n * ```typescript\n * import Fastify from \"fastify\";\n * import { configure } from \"@logtape/logtape\";\n * import { getLogTapeFastifyLogger } from \"@logtape/fastify\";\n *\n * await configure({\n * // ... LogTape configuration\n * });\n *\n * const fastify = Fastify({\n * loggerInstance: getLogTapeFastifyLogger(),\n * });\n * ```\n *\n * @example With custom category\n * ```typescript\n * const fastify = Fastify({\n * loggerInstance: getLogTapeFastifyLogger({\n * category: [\"myapp\", \"http\"],\n * }),\n * });\n * ```\n *\n * @param options Configuration options for the logger.\n * @returns A Pino-compatible logger wrapping LogTape.\n * @since 1.3.0\n */\nexport function getLogTapeFastifyLogger(\n options: FastifyLogTapeOptions = {},\n): PinoLikeLogger {\n const category = normalizeCategory(options.category ?? [\"fastify\"]);\n const logger = getLogger(category);\n const initialLevel = options.level ?? \"info\";\n\n return createPinoLikeLogger(logger, initialLevel);\n}\n\n/**\n * Normalize category to array format.\n */\nfunction normalizeCategory(\n category: string | readonly string[],\n): readonly string[] {\n return typeof category === \"string\" ? [category] : category;\n}\n\n/**\n * Format message with printf-style interpolation.\n * Supports: %s (string), %d (number), %j (JSON), %o/%O (object), %% (escaped %)\n */\nfunction formatMessage(template: string, ...args: unknown[]): string {\n let argIndex = 0;\n return template.replace(/%[sdjoO%]/g, (match) => {\n if (match === \"%%\") return \"%\";\n if (argIndex >= args.length) return match;\n\n const arg = args[argIndex++];\n switch (match) {\n case \"%s\":\n return String(arg);\n case \"%d\":\n return Number(arg).toString();\n case \"%j\":\n case \"%o\":\n case \"%O\":\n return JSON.stringify(arg);\n default:\n return match;\n }\n });\n}\n\n/**\n * Creates a Pino-like logger wrapper around a LogTape logger.\n */\nfunction createPinoLikeLogger(\n logger: Logger,\n initialLevel: PinoLevel,\n bindings: Record<string, unknown> = {},\n): PinoLikeLogger {\n // Track level internally for Pino compatibility\n let _level: string = initialLevel;\n\n // If there are bindings, create a contextual logger\n const contextLogger = Object.keys(bindings).length > 0\n ? logger.with(bindings)\n : logger;\n\n /**\n * Create a log method for a specific level.\n */\n function createLogMethod(\n logFn: (msg: string, props?: Record<string, unknown>) => void,\n ): PinoLogMethod {\n return function pinoLogMethod(\n objOrMsg: Record<string, unknown> | string,\n ...restArgs: unknown[]\n ): void {\n // Detect calling convention\n if (typeof objOrMsg === \"string\") {\n // Called as: logger.info(\"message\") or logger.info(\"message %s\", arg)\n const message = formatMessage(objOrMsg, ...restArgs);\n logFn(message);\n } else if (typeof objOrMsg === \"object\" && objOrMsg !== null) {\n // Called as: logger.info({ key: value }, \"message\") or logger.info({ key: value })\n const properties = { ...objOrMsg };\n const [msgOrArg, ...args] = restArgs;\n\n if (typeof msgOrArg === \"string\") {\n // Has message string: logger.info({ foo: 1 }, \"message %s\", arg)\n const message = formatMessage(msgOrArg, ...args);\n logFn(message, properties);\n } else if (\"msg\" in properties && typeof properties.msg === \"string\") {\n // Extract message from object: logger.info({ msg: \"hello\", foo: 1 })\n const message = properties.msg as string;\n delete properties.msg;\n logFn(message, properties);\n } else {\n // Object-only logging: logger.info({ foo: 1 })\n logFn(\"{*}\", properties);\n }\n }\n } as PinoLogMethod;\n }\n\n const pinoLogger: PinoLikeLogger = {\n trace: createLogMethod((msg, props) => contextLogger.trace(msg, props)),\n debug: createLogMethod((msg, props) => contextLogger.debug(msg, props)),\n info: createLogMethod((msg, props) => contextLogger.info(msg, props)),\n warn: createLogMethod((msg, props) => contextLogger.warn(msg, props)),\n error: createLogMethod((msg, props) => contextLogger.error(msg, props)),\n fatal: createLogMethod((msg, props) => contextLogger.fatal(msg, props)),\n\n silent: () => {\n // No-op for silent level\n },\n\n child: (childBindings: Record<string, unknown>) => {\n // Merge parent bindings with child bindings\n const mergedBindings = { ...bindings, ...childBindings };\n return createPinoLikeLogger(logger, _level as PinoLevel, mergedBindings);\n },\n\n get level() {\n return _level;\n },\n\n set level(newLevel: string) {\n // Store level for Pino compatibility\n // Note: Actual filtering is handled by LogTape configuration\n _level = newLevel;\n },\n };\n\n return pinoLogger;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AA2HA,SAAgB,wBACdA,UAAiC,CAAE,GACnB;CAChB,MAAM,WAAW,kBAAkB,QAAQ,YAAY,CAAC,SAAU,EAAC;CACnE,MAAM,SAAS,UAAU,SAAS;CAClC,MAAM,eAAe,QAAQ,SAAS;AAEtC,QAAO,qBAAqB,QAAQ,aAAa;AAClD;;;;AAKD,SAAS,kBACPC,UACmB;AACnB,eAAc,aAAa,WAAW,CAAC,QAAS,IAAG;AACpD;;;;;AAMD,SAAS,cAAcC,UAAkB,GAAG,MAAyB;CACnE,IAAI,WAAW;AACf,QAAO,SAAS,QAAQ,cAAc,CAAC,UAAU;AAC/C,MAAI,UAAU,KAAM,QAAO;AAC3B,MAAI,YAAY,KAAK,OAAQ,QAAO;EAEpC,MAAM,MAAM,KAAK;AACjB,UAAQ,OAAR;GACE,KAAK,KACH,QAAO,OAAO,IAAI;GACpB,KAAK,KACH,QAAO,OAAO,IAAI,CAAC,UAAU;GAC/B,KAAK;GACL,KAAK;GACL,KAAK,KACH,QAAO,KAAK,UAAU,IAAI;GAC5B,QACE,QAAO;EACV;CACF,EAAC;AACH;;;;AAKD,SAAS,qBACPC,QACAC,cACAC,WAAoC,CAAE,GACtB;CAEhB,IAAIC,SAAiB;CAGrB,MAAM,gBAAgB,OAAO,KAAK,SAAS,CAAC,SAAS,IACjD,OAAO,KAAK,SAAS,GACrB;;;;CAKJ,SAAS,gBACPC,OACe;AACf,SAAO,SAAS,cACdC,UACA,GAAG,UACG;AAEN,cAAW,aAAa,UAAU;IAEhC,MAAM,UAAU,cAAc,UAAU,GAAG,SAAS;AACpD,UAAM,QAAQ;GACf,kBAAiB,aAAa,YAAY,aAAa,MAAM;IAE5D,MAAM,aAAa,EAAE,GAAG,SAAU;IAClC,MAAM,CAAC,UAAU,GAAG,KAAK,GAAG;AAE5B,eAAW,aAAa,UAAU;KAEhC,MAAM,UAAU,cAAc,UAAU,GAAG,KAAK;AAChD,WAAM,SAAS,WAAW;IAC3B,WAAU,SAAS,qBAAqB,WAAW,QAAQ,UAAU;KAEpE,MAAM,UAAU,WAAW;AAC3B,YAAO,WAAW;AAClB,WAAM,SAAS,WAAW;IAC3B,MAEC,OAAM,OAAO,WAAW;GAE3B;EACF;CACF;CAED,MAAMC,aAA6B;EACjC,OAAO,gBAAgB,CAAC,KAAK,UAAU,cAAc,MAAM,KAAK,MAAM,CAAC;EACvE,OAAO,gBAAgB,CAAC,KAAK,UAAU,cAAc,MAAM,KAAK,MAAM,CAAC;EACvE,MAAM,gBAAgB,CAAC,KAAK,UAAU,cAAc,KAAK,KAAK,MAAM,CAAC;EACrE,MAAM,gBAAgB,CAAC,KAAK,UAAU,cAAc,KAAK,KAAK,MAAM,CAAC;EACrE,OAAO,gBAAgB,CAAC,KAAK,UAAU,cAAc,MAAM,KAAK,MAAM,CAAC;EACvE,OAAO,gBAAgB,CAAC,KAAK,UAAU,cAAc,MAAM,KAAK,MAAM,CAAC;EAEvE,QAAQ,MAAM,CAEb;EAED,OAAO,CAACC,kBAA2C;GAEjD,MAAM,iBAAiB;IAAE,GAAG;IAAU,GAAG;GAAe;AACxD,UAAO,qBAAqB,QAAQ,QAAqB,eAAe;EACzE;EAED,IAAI,QAAQ;AACV,UAAO;EACR;EAED,IAAI,MAAMC,UAAkB;AAG1B,YAAS;EACV;CACF;AAED,QAAO;AACR"}
|
package/package.json
ADDED
|
@@ -0,0 +1,66 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@logtape/fastify",
|
|
3
|
+
"version": "1.3.0-dev.1",
|
|
4
|
+
"description": "Fastify adapter for LogTape logging library",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"logging",
|
|
7
|
+
"log",
|
|
8
|
+
"logger",
|
|
9
|
+
"fastify",
|
|
10
|
+
"pino",
|
|
11
|
+
"adapter",
|
|
12
|
+
"logtape"
|
|
13
|
+
],
|
|
14
|
+
"license": "MIT",
|
|
15
|
+
"author": {
|
|
16
|
+
"name": "Hong Minhee",
|
|
17
|
+
"email": "hong@minhee.org",
|
|
18
|
+
"url": "https://hongminhee.org/"
|
|
19
|
+
},
|
|
20
|
+
"homepage": "https://logtape.org/",
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "git+https://github.com/dahlia/logtape.git",
|
|
24
|
+
"directory": "packages/fastify/"
|
|
25
|
+
},
|
|
26
|
+
"bugs": {
|
|
27
|
+
"url": "https://github.com/dahlia/logtape/issues"
|
|
28
|
+
},
|
|
29
|
+
"funding": [
|
|
30
|
+
"https://github.com/sponsors/dahlia"
|
|
31
|
+
],
|
|
32
|
+
"type": "module",
|
|
33
|
+
"module": "./dist/mod.js",
|
|
34
|
+
"main": "./dist/mod.cjs",
|
|
35
|
+
"types": "./dist/mod.d.ts",
|
|
36
|
+
"exports": {
|
|
37
|
+
".": {
|
|
38
|
+
"types": {
|
|
39
|
+
"import": "./dist/mod.d.ts",
|
|
40
|
+
"require": "./dist/mod.d.cts"
|
|
41
|
+
},
|
|
42
|
+
"import": "./dist/mod.js",
|
|
43
|
+
"require": "./dist/mod.cjs"
|
|
44
|
+
},
|
|
45
|
+
"./package.json": "./package.json"
|
|
46
|
+
},
|
|
47
|
+
"sideEffects": false,
|
|
48
|
+
"peerDependencies": {
|
|
49
|
+
"@logtape/logtape": "^1.3.0"
|
|
50
|
+
},
|
|
51
|
+
"devDependencies": {
|
|
52
|
+
"@alinea/suite": "^0.6.3",
|
|
53
|
+
"@std/assert": "npm:@jsr/std__assert@^1.0.13",
|
|
54
|
+
"fastify": "^5.0.0",
|
|
55
|
+
"tsdown": "^0.12.7",
|
|
56
|
+
"typescript": "^5.8.3"
|
|
57
|
+
},
|
|
58
|
+
"scripts": {
|
|
59
|
+
"build": "tsdown",
|
|
60
|
+
"prepublish": "tsdown",
|
|
61
|
+
"test": "tsdown && node --experimental-transform-types --test",
|
|
62
|
+
"test:bun": "tsdown && bun test",
|
|
63
|
+
"test:deno": "deno test --allow-env --allow-sys --allow-net",
|
|
64
|
+
"test-all": "tsdown && node --experimental-transform-types --test && bun test && deno test"
|
|
65
|
+
}
|
|
66
|
+
}
|