@logtape/testing-node 2.3.0-dev.0
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/README.md +78 -0
- package/dist/_virtual/rolldown_runtime.cjs +30 -0
- package/dist/autoload.cjs +240 -0
- package/dist/autoload.d.cts +125 -0
- package/dist/autoload.d.cts.map +1 -0
- package/dist/autoload.d.ts +125 -0
- package/dist/autoload.d.ts.map +1 -0
- package/dist/autoload.js +159 -0
- package/dist/autoload.js.map +1 -0
- package/dist/mod.cjs +202 -0
- package/dist/mod.d.cts +125 -0
- package/dist/mod.d.cts.map +1 -0
- package/dist/mod.d.ts +125 -0
- package/dist/mod.d.ts.map +1 -0
- package/dist/mod.js +143 -0
- package/dist/mod.js.map +1 -0
- package/package.json +81 -0
package/dist/mod.js
ADDED
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import nodeTest, { after, afterEach, before, beforeEach, describe, it as it$1, mock, run, suite } from "node:test";
|
|
2
|
+
import { createFailureLogReporter } from "@logtape/testing/reporter";
|
|
3
|
+
|
|
4
|
+
//#region src/mod.ts
|
|
5
|
+
/**
|
|
6
|
+
* Creates a `node:test` test function that reports LogTape records from failed
|
|
7
|
+
* test callbacks.
|
|
8
|
+
*
|
|
9
|
+
* The returned function preserves Node.js test options and shorthand helpers
|
|
10
|
+
* such as `test.only()`, `test.skip()`, and `test.todo()`. Only callback
|
|
11
|
+
* arguments are adapted; options are passed through to `node:test`.
|
|
12
|
+
*
|
|
13
|
+
* @param options Failure log reporter options.
|
|
14
|
+
* @returns A configured `node:test`-compatible test function.
|
|
15
|
+
* @since 2.3.0
|
|
16
|
+
*/
|
|
17
|
+
function createTest(options = {}) {
|
|
18
|
+
return createNodeTestFunction(nodeTest, options);
|
|
19
|
+
}
|
|
20
|
+
/**
|
|
21
|
+
* Creates an `it()` alias that reports LogTape records from failed test
|
|
22
|
+
* callbacks.
|
|
23
|
+
*
|
|
24
|
+
* @param options Failure log reporter options.
|
|
25
|
+
* @returns A configured `node:test`-compatible `it()` function.
|
|
26
|
+
* @since 2.3.0
|
|
27
|
+
*/
|
|
28
|
+
function createIt(options = {}) {
|
|
29
|
+
return createNodeTestFunction(it$1, options);
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* A `node:test` test function that reports LogTape records from failed test
|
|
33
|
+
* callbacks using the default reporter options.
|
|
34
|
+
*
|
|
35
|
+
* @since 2.3.0
|
|
36
|
+
*/
|
|
37
|
+
const test = createTest();
|
|
38
|
+
/**
|
|
39
|
+
* A `node:test` `it()` alias that reports LogTape records from failed test
|
|
40
|
+
* callbacks using the default reporter options.
|
|
41
|
+
*
|
|
42
|
+
* @since 2.3.0
|
|
43
|
+
*/
|
|
44
|
+
const it = createIt();
|
|
45
|
+
/**
|
|
46
|
+
* Shorthand for marking a test as `only`.
|
|
47
|
+
*
|
|
48
|
+
* @since 2.3.0
|
|
49
|
+
*/
|
|
50
|
+
const only = test.only;
|
|
51
|
+
/**
|
|
52
|
+
* Shorthand for skipping a test.
|
|
53
|
+
*
|
|
54
|
+
* @since 2.3.0
|
|
55
|
+
*/
|
|
56
|
+
const skip = test.skip;
|
|
57
|
+
/**
|
|
58
|
+
* Shorthand for marking a test as TODO.
|
|
59
|
+
*
|
|
60
|
+
* @since 2.3.0
|
|
61
|
+
*/
|
|
62
|
+
const todo = test.todo;
|
|
63
|
+
/**
|
|
64
|
+
* Shorthand for expecting a test to fail when supported by the active Node.js
|
|
65
|
+
* runtime.
|
|
66
|
+
*
|
|
67
|
+
* @since 2.3.0
|
|
68
|
+
*/
|
|
69
|
+
const expectFailure = test.expectFailure;
|
|
70
|
+
/**
|
|
71
|
+
* Node.js' test assertion tracker when supported by the active runtime.
|
|
72
|
+
*
|
|
73
|
+
* @since 2.3.0
|
|
74
|
+
*/
|
|
75
|
+
const assert = test.assert;
|
|
76
|
+
/**
|
|
77
|
+
* Node.js' snapshot helper when supported by the active runtime.
|
|
78
|
+
*
|
|
79
|
+
* @since 2.3.0
|
|
80
|
+
*/
|
|
81
|
+
const snapshot = test.snapshot;
|
|
82
|
+
var src_default = test;
|
|
83
|
+
function createNodeTestFunction(baseTest, options, includeExtendedProperties = true) {
|
|
84
|
+
const register = (...args) => Reflect.apply(baseTest, void 0, wrapCallbackArgument(args, options));
|
|
85
|
+
const baseExpectFailure = baseTest.expectFailure;
|
|
86
|
+
const wrapped = Object.assign(register, baseTest, {
|
|
87
|
+
only: (...args) => Reflect.apply(baseTest.only, void 0, wrapCallbackArgument(args, options)),
|
|
88
|
+
skip: (...args) => Reflect.apply(baseTest.skip, void 0, wrapCallbackArgument(args, options)),
|
|
89
|
+
todo: (...args) => Reflect.apply(baseTest.todo, void 0, wrapCallbackArgument(args, options)),
|
|
90
|
+
expectFailure: typeof baseExpectFailure === "function" ? (...args) => Reflect.apply(baseExpectFailure, void 0, wrapCallbackArgument(args, options)) : void 0
|
|
91
|
+
});
|
|
92
|
+
if (includeExtendedProperties) {
|
|
93
|
+
if (typeof baseTest.it === "function") Object.defineProperty(wrapped, "it", {
|
|
94
|
+
configurable: true,
|
|
95
|
+
enumerable: true,
|
|
96
|
+
value: createNodeTestFunction(baseTest.it, options, false),
|
|
97
|
+
writable: true
|
|
98
|
+
});
|
|
99
|
+
if (typeof baseTest.test === "function") Object.defineProperty(wrapped, "test", {
|
|
100
|
+
configurable: true,
|
|
101
|
+
enumerable: true,
|
|
102
|
+
value: wrapped,
|
|
103
|
+
writable: true
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
return wrapped;
|
|
107
|
+
}
|
|
108
|
+
function wrapCallbackArgument(args, options) {
|
|
109
|
+
const callback = args.at(-1);
|
|
110
|
+
if (typeof callback !== "function") return [...args];
|
|
111
|
+
const reporter = createFailureLogReporter(options);
|
|
112
|
+
const wrapped = wrapNodeCallback(reporter.wrap.bind(reporter), callback);
|
|
113
|
+
return [...args.slice(0, -1), wrapped];
|
|
114
|
+
}
|
|
115
|
+
function wrapNodeCallback(wrap, callback) {
|
|
116
|
+
if (callback.length >= 2) return function(context, done) {
|
|
117
|
+
const runCallback = (...args) => Reflect.apply(callback, this, args);
|
|
118
|
+
wrap(() => new Promise((resolve, reject) => {
|
|
119
|
+
let settled = false;
|
|
120
|
+
const wrappedDone = (error) => {
|
|
121
|
+
if (settled) return;
|
|
122
|
+
settled = true;
|
|
123
|
+
if (error == null) resolve();
|
|
124
|
+
else reject(error);
|
|
125
|
+
};
|
|
126
|
+
try {
|
|
127
|
+
runCallback(context, wrappedDone);
|
|
128
|
+
} catch (error) {
|
|
129
|
+
reject(error);
|
|
130
|
+
}
|
|
131
|
+
}))().then(() => done(), (error) => done(error));
|
|
132
|
+
};
|
|
133
|
+
if (callback.length === 0) return function() {
|
|
134
|
+
return wrap(() => Reflect.apply(callback, this, []))();
|
|
135
|
+
};
|
|
136
|
+
return function(context) {
|
|
137
|
+
return wrap(() => Reflect.apply(callback, this, [context]))();
|
|
138
|
+
};
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
//#endregion
|
|
142
|
+
export { after, afterEach, assert, before, beforeEach, createIt, createTest, src_default as default, describe, expectFailure, it, mock, only, run, skip, snapshot, suite, test, todo };
|
|
143
|
+
//# sourceMappingURL=mod.js.map
|
package/dist/mod.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"mod.js","names":["options: FailureLogReporterOptions","nodeIt","test: NodeTestFunction","it: NodeTestFunction","only: NodeTestFunction","skip: NodeTestFunction","todo: NodeTestFunction","expectFailure: NodeTestFunction | undefined","assert: unknown","snapshot: unknown","baseTest: BaseNodeTestFunction","args: readonly unknown[]","wrap: ReturnType<typeof createFailureLogReporter>[\"wrap\"]","callback: AnyFunction","context: TestContext","done: NodeDoneCallback","wrappedDone: NodeDoneCallback","error?: unknown","error: unknown"],"sources":["../src/mod.ts"],"sourcesContent":["import nodeTest, { it as nodeIt } from \"node:test\";\nimport type { TestContext } from \"node:test\";\n\nimport {\n createFailureLogReporter,\n type FailureLogReporterOptions,\n} from \"@logtape/testing/reporter\";\n\nexport type {\n FailureLogReporterOptions,\n FailureLogReportMode,\n} from \"@logtape/testing/reporter\";\nexport {\n after,\n afterEach,\n before,\n beforeEach,\n describe,\n mock,\n run,\n suite,\n} from \"node:test\";\n\n/**\n * Options accepted by Node.js `test()` and `it()` functions.\n *\n * The shape intentionally mirrors Node's documented option bag while allowing\n * newer Node.js options to pass through even when a runtime's bundled TypeScript\n * declarations lag behind the current documentation.\n *\n * @since 2.3.0\n */\nexport interface NodeTestOptions {\n readonly concurrency?: number | boolean;\n readonly expectFailure?:\n | boolean\n | string\n | RegExp\n | ((error: unknown) => boolean)\n | object\n | Error;\n readonly only?: boolean;\n readonly signal?: AbortSignal;\n readonly skip?: boolean | string;\n readonly tags?: readonly string[];\n readonly todo?: boolean | string;\n readonly timeout?: number;\n readonly plan?: number;\n}\n\n/**\n * A callback passed to Node.js `test()` or `it()`.\n *\n * @since 2.3.0\n */\nexport type NodeTestCallback = (\n context: TestContext,\n done?: NodeDoneCallback,\n) => unknown;\n\n/**\n * A Node.js `test()`-compatible function.\n *\n * @since 2.3.0\n */\nexport interface NodeTestFunction {\n (name?: string, options?: NodeTestOptions, fn?: NodeTestCallback): Promise<\n void\n >;\n (name?: string, fn?: NodeTestCallback): Promise<void>;\n (options?: NodeTestOptions, fn?: NodeTestCallback): Promise<void>;\n (fn?: NodeTestCallback): Promise<void>;\n readonly only: NodeTestFunction;\n readonly skip: NodeTestFunction;\n readonly todo: NodeTestFunction;\n readonly expectFailure?: NodeTestFunction;\n readonly it?: NodeTestFunction;\n readonly test?: NodeTestFunction;\n}\n\ntype NodeDoneCallback = (error?: unknown) => void;\ntype AnyFunction = (...args: never[]) => unknown;\ntype BaseNodeTestFunction = AnyFunction & {\n readonly only: AnyFunction;\n readonly skip: AnyFunction;\n readonly todo: AnyFunction;\n readonly expectFailure?: AnyFunction;\n readonly it?: AnyFunction;\n readonly test?: AnyFunction;\n};\n\n/**\n * Creates a `node:test` test function that reports LogTape records from failed\n * test callbacks.\n *\n * The returned function preserves Node.js test options and shorthand helpers\n * such as `test.only()`, `test.skip()`, and `test.todo()`. Only callback\n * arguments are adapted; options are passed through to `node:test`.\n *\n * @param options Failure log reporter options.\n * @returns A configured `node:test`-compatible test function.\n * @since 2.3.0\n */\nexport function createTest(\n options: FailureLogReporterOptions = {},\n): NodeTestFunction {\n return createNodeTestFunction(\n nodeTest as unknown as BaseNodeTestFunction,\n options,\n );\n}\n\n/**\n * Creates an `it()` alias that reports LogTape records from failed test\n * callbacks.\n *\n * @param options Failure log reporter options.\n * @returns A configured `node:test`-compatible `it()` function.\n * @since 2.3.0\n */\nexport function createIt(\n options: FailureLogReporterOptions = {},\n): NodeTestFunction {\n return createNodeTestFunction(\n nodeIt as unknown as BaseNodeTestFunction,\n options,\n );\n}\n\n/**\n * A `node:test` test function that reports LogTape records from failed test\n * callbacks using the default reporter options.\n *\n * @since 2.3.0\n */\nexport const test: NodeTestFunction = createTest();\n\n/**\n * A `node:test` `it()` alias that reports LogTape records from failed test\n * callbacks using the default reporter options.\n *\n * @since 2.3.0\n */\nexport const it: NodeTestFunction = createIt();\n\n/**\n * Shorthand for marking a test as `only`.\n *\n * @since 2.3.0\n */\nexport const only: NodeTestFunction = test.only;\n\n/**\n * Shorthand for skipping a test.\n *\n * @since 2.3.0\n */\nexport const skip: NodeTestFunction = test.skip;\n\n/**\n * Shorthand for marking a test as TODO.\n *\n * @since 2.3.0\n */\nexport const todo: NodeTestFunction = test.todo;\n\n/**\n * Shorthand for expecting a test to fail when supported by the active Node.js\n * runtime.\n *\n * @since 2.3.0\n */\nexport const expectFailure: NodeTestFunction | undefined = test.expectFailure;\n\n/**\n * Node.js' test assertion tracker when supported by the active runtime.\n *\n * @since 2.3.0\n */\nexport const assert: unknown = (test as { readonly assert?: unknown }).assert;\n\n/**\n * Node.js' snapshot helper when supported by the active runtime.\n *\n * @since 2.3.0\n */\nexport const snapshot: unknown = (test as { readonly snapshot?: unknown })\n .snapshot;\n\nexport default test;\n\nfunction createNodeTestFunction(\n baseTest: BaseNodeTestFunction,\n options: FailureLogReporterOptions,\n includeExtendedProperties = true,\n): NodeTestFunction {\n const register = ((...args: unknown[]) =>\n Reflect.apply(\n baseTest,\n undefined,\n wrapCallbackArgument(args, options),\n )) as NodeTestFunction;\n\n const baseExpectFailure = baseTest.expectFailure;\n const wrapped = Object.assign(register, baseTest, {\n only: ((...args: unknown[]) =>\n Reflect.apply(\n baseTest.only,\n undefined,\n wrapCallbackArgument(args, options),\n )) as NodeTestFunction[\"only\"],\n skip: ((...args: unknown[]) =>\n Reflect.apply(\n baseTest.skip,\n undefined,\n wrapCallbackArgument(args, options),\n )) as NodeTestFunction[\"skip\"],\n todo: ((...args: unknown[]) =>\n Reflect.apply(\n baseTest.todo,\n undefined,\n wrapCallbackArgument(args, options),\n )) as NodeTestFunction[\"todo\"],\n expectFailure: typeof baseExpectFailure === \"function\"\n ? ((...args: unknown[]) =>\n Reflect.apply(\n baseExpectFailure,\n undefined,\n wrapCallbackArgument(args, options),\n )) as NodeTestFunction[\"expectFailure\"]\n : undefined,\n });\n\n if (includeExtendedProperties) {\n if (typeof baseTest.it === \"function\") {\n Object.defineProperty(wrapped, \"it\", {\n configurable: true,\n enumerable: true,\n value: createNodeTestFunction(\n baseTest.it as BaseNodeTestFunction,\n options,\n false,\n ),\n writable: true,\n });\n }\n if (typeof baseTest.test === \"function\") {\n Object.defineProperty(wrapped, \"test\", {\n configurable: true,\n enumerable: true,\n value: wrapped,\n writable: true,\n });\n }\n }\n\n return wrapped;\n}\n\nfunction wrapCallbackArgument(\n args: readonly unknown[],\n options: FailureLogReporterOptions,\n): unknown[] {\n const callback = args.at(-1);\n if (typeof callback !== \"function\") return [...args];\n\n const reporter = createFailureLogReporter(options);\n const wrapped = wrapNodeCallback(\n reporter.wrap.bind(reporter),\n callback as unknown as AnyFunction,\n );\n return [...args.slice(0, -1), wrapped];\n}\n\nfunction wrapNodeCallback(\n wrap: ReturnType<typeof createFailureLogReporter>[\"wrap\"],\n callback: AnyFunction,\n): AnyFunction {\n if (callback.length >= 2) {\n return function (\n this: unknown,\n context: TestContext,\n done: NodeDoneCallback,\n ): void {\n const runCallback = (...args: readonly unknown[]): unknown =>\n Reflect.apply(callback, this, args);\n void wrap(() =>\n new Promise<void>((resolve, reject) => {\n let settled = false;\n const wrappedDone: NodeDoneCallback = ((error?: unknown) => {\n if (settled) return;\n settled = true;\n if (error == null) resolve();\n else reject(error);\n }) as NodeDoneCallback;\n\n try {\n runCallback(context, wrappedDone);\n } catch (error) {\n reject(error);\n }\n })\n )().then(\n () => done(),\n (error: unknown) => done(error),\n );\n };\n }\n\n if (callback.length === 0) {\n return function (this: unknown): Promise<unknown> {\n return wrap(() => Reflect.apply(callback, this, []))();\n };\n }\n\n return function (this: unknown, context: TestContext): Promise<unknown> {\n return wrap(() => Reflect.apply(callback, this, [context]))();\n };\n}\n\nexport type { TestContext };\n"],"mappings":";;;;;;;;;;;;;;;;AAuGA,SAAgB,WACdA,UAAqC,CAAE,GACrB;AAClB,QAAO,uBACL,UACA,QACD;AACF;;;;;;;;;AAUD,SAAgB,SACdA,UAAqC,CAAE,GACrB;AAClB,QAAO,uBACLC,MACA,QACD;AACF;;;;;;;AAQD,MAAaC,OAAyB,YAAY;;;;;;;AAQlD,MAAaC,KAAuB,UAAU;;;;;;AAO9C,MAAaC,OAAyB,KAAK;;;;;;AAO3C,MAAaC,OAAyB,KAAK;;;;;;AAO3C,MAAaC,OAAyB,KAAK;;;;;;;AAQ3C,MAAaC,gBAA8C,KAAK;;;;;;AAOhE,MAAaC,SAAmB,KAAuC;;;;;;AAOvE,MAAaC,WAAqB,KAC/B;AAEH,kBAAe;AAEf,SAAS,uBACPC,UACAV,SACA,4BAA4B,MACV;CAClB,MAAM,WAAY,CAAC,GAAG,SACpB,QAAQ,MACN,kBAEA,qBAAqB,MAAM,QAAQ,CACpC;CAEH,MAAM,oBAAoB,SAAS;CACnC,MAAM,UAAU,OAAO,OAAO,UAAU,UAAU;EAChD,MAAO,CAAC,GAAG,SACT,QAAQ,MACN,SAAS,cAET,qBAAqB,MAAM,QAAQ,CACpC;EACH,MAAO,CAAC,GAAG,SACT,QAAQ,MACN,SAAS,cAET,qBAAqB,MAAM,QAAQ,CACpC;EACH,MAAO,CAAC,GAAG,SACT,QAAQ,MACN,SAAS,cAET,qBAAqB,MAAM,QAAQ,CACpC;EACH,sBAAsB,sBAAsB,aACvC,CAAC,GAAG,SACL,QAAQ,MACN,2BAEA,qBAAqB,MAAM,QAAQ,CACpC;CAEN,EAAC;AAEF,KAAI,2BAA2B;AAC7B,aAAW,SAAS,OAAO,WACzB,QAAO,eAAe,SAAS,MAAM;GACnC,cAAc;GACd,YAAY;GACZ,OAAO,uBACL,SAAS,IACT,SACA,MACD;GACD,UAAU;EACX,EAAC;AAEJ,aAAW,SAAS,SAAS,WAC3B,QAAO,eAAe,SAAS,QAAQ;GACrC,cAAc;GACd,YAAY;GACZ,OAAO;GACP,UAAU;EACX,EAAC;CAEL;AAED,QAAO;AACR;AAED,SAAS,qBACPW,MACAX,SACW;CACX,MAAM,WAAW,KAAK,GAAG,GAAG;AAC5B,YAAW,aAAa,WAAY,QAAO,CAAC,GAAG,IAAK;CAEpD,MAAM,WAAW,yBAAyB,QAAQ;CAClD,MAAM,UAAU,iBACd,SAAS,KAAK,KAAK,SAAS,EAC5B,SACD;AACD,QAAO,CAAC,GAAG,KAAK,MAAM,GAAG,GAAG,EAAE,OAAQ;AACvC;AAED,SAAS,iBACPY,MACAC,UACa;AACb,KAAI,SAAS,UAAU,EACrB,QAAO,SAELC,SACAC,MACM;EACN,MAAM,cAAc,CAAC,GAAG,SACtB,QAAQ,MAAM,UAAU,MAAM,KAAK;AACrC,EAAK,KAAK,MACR,IAAI,QAAc,CAAC,SAAS,WAAW;GACrC,IAAI,UAAU;GACd,MAAMC,cAAiC,CAACC,UAAoB;AAC1D,QAAI,QAAS;AACb,cAAU;AACV,QAAI,SAAS,KAAM,UAAS;QACvB,QAAO,MAAM;GACnB;AAED,OAAI;AACF,gBAAY,SAAS,YAAY;GAClC,SAAQ,OAAO;AACd,WAAO,MAAM;GACd;EACF,GACF,EAAE,CAAC,KACF,MAAM,MAAM,EACZ,CAACC,UAAmB,KAAK,MAAM,CAChC;CACF;AAGH,KAAI,SAAS,WAAW,EACtB,QAAO,WAA2C;AAChD,SAAO,KAAK,MAAM,QAAQ,MAAM,UAAU,MAAM,CAAE,EAAC,CAAC,EAAE;CACvD;AAGH,QAAO,SAAyBJ,SAAwC;AACtE,SAAO,KAAK,MAAM,QAAQ,MAAM,UAAU,MAAM,CAAC,OAAQ,EAAC,CAAC,EAAE;CAC9D;AACF"}
|
package/package.json
ADDED
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@logtape/testing-node",
|
|
3
|
+
"version": "2.3.0-dev.0",
|
|
4
|
+
"description": "Node.js test runner integration for LogTape failure log reporting",
|
|
5
|
+
"keywords": [
|
|
6
|
+
"logging",
|
|
7
|
+
"log",
|
|
8
|
+
"logger",
|
|
9
|
+
"logtape",
|
|
10
|
+
"testing",
|
|
11
|
+
"test",
|
|
12
|
+
"node:test"
|
|
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/testing-node/"
|
|
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
|
+
"./autoload": {
|
|
46
|
+
"types": {
|
|
47
|
+
"import": "./dist/autoload.d.ts",
|
|
48
|
+
"require": "./dist/autoload.d.cts"
|
|
49
|
+
},
|
|
50
|
+
"import": "./dist/autoload.js",
|
|
51
|
+
"require": "./dist/autoload.cjs"
|
|
52
|
+
},
|
|
53
|
+
"./package.json": "./package.json"
|
|
54
|
+
},
|
|
55
|
+
"sideEffects": [
|
|
56
|
+
"./dist/autoload.js",
|
|
57
|
+
"./dist/autoload.cjs"
|
|
58
|
+
],
|
|
59
|
+
"files": [
|
|
60
|
+
"dist/"
|
|
61
|
+
],
|
|
62
|
+
"dependencies": {
|
|
63
|
+
"@logtape/testing": "^2.3.0"
|
|
64
|
+
},
|
|
65
|
+
"peerDependencies": {
|
|
66
|
+
"@logtape/logtape": "^2.3.0"
|
|
67
|
+
},
|
|
68
|
+
"devDependencies": {
|
|
69
|
+
"tsdown": "^0.12.7",
|
|
70
|
+
"typescript": "^5.8.3",
|
|
71
|
+
"@logtape/logtape": "^2.3.0"
|
|
72
|
+
},
|
|
73
|
+
"scripts": {
|
|
74
|
+
"build": "tsdown",
|
|
75
|
+
"prepublish": "tsdown",
|
|
76
|
+
"test": "tsdown && node --experimental-transform-types --test",
|
|
77
|
+
"test:bun": "tsdown && bun test",
|
|
78
|
+
"test:deno": "deno test --allow-read",
|
|
79
|
+
"test-all": "tsdown && node --experimental-transform-types --test && bun test && deno test --allow-read"
|
|
80
|
+
}
|
|
81
|
+
}
|