@decaf-ts/core 0.8.50 → 0.8.52
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/README.md +206 -93
- package/dist/core.cjs +1 -1
- package/dist/core.cjs.map +1 -1
- package/dist/core.js +1 -1
- package/dist/core.js.map +1 -1
- package/lib/esm/fs/FilesystemAdapter.d.ts +67 -0
- package/lib/esm/fs/FilesystemAdapter.js +430 -0
- package/lib/esm/fs/FilesystemAdapter.js.map +1 -0
- package/lib/esm/fs/FsDispatch.d.ts +7 -0
- package/lib/esm/fs/FsDispatch.js +20 -0
- package/lib/esm/fs/FsDispatch.js.map +1 -0
- package/lib/esm/fs/helpers.d.ts +17 -0
- package/lib/esm/fs/helpers.js +64 -0
- package/lib/esm/fs/helpers.js.map +1 -0
- package/lib/esm/fs/index.d.ts +4 -0
- package/lib/esm/fs/index.js +5 -0
- package/lib/esm/fs/index.js.map +1 -0
- package/lib/esm/fs/indexStore.d.ts +28 -0
- package/lib/esm/fs/indexStore.js +173 -0
- package/lib/esm/fs/indexStore.js.map +1 -0
- package/lib/esm/fs/locks/FilesystemLock.d.ts +13 -0
- package/lib/esm/fs/locks/FilesystemLock.js +49 -0
- package/lib/esm/fs/locks/FilesystemLock.js.map +1 -0
- package/lib/esm/fs/locks/FilesystemMultiLock.d.ts +8 -0
- package/lib/esm/fs/locks/FilesystemMultiLock.js +23 -0
- package/lib/esm/fs/locks/FilesystemMultiLock.js.map +1 -0
- package/lib/esm/fs/types.d.ts +34 -0
- package/lib/esm/fs/types.js +2 -0
- package/lib/esm/fs/types.js.map +1 -0
- package/lib/esm/index.d.ts +1 -1
- package/lib/esm/index.js +1 -1
- package/lib/esm/query/Paginator.js +2 -2
- package/lib/esm/query/Paginator.js.map +1 -1
- package/lib/esm/ram/RamAdapter.d.ts +1 -1
- package/lib/esm/ram/types.d.ts +2 -1
- package/lib/esm/tasks/TaskEngine.d.ts +30 -1
- package/lib/esm/tasks/TaskEngine.js +361 -16
- package/lib/esm/tasks/TaskEngine.js.map +1 -1
- package/lib/esm/tasks/TaskService.js +3 -0
- package/lib/esm/tasks/TaskService.js.map +1 -1
- package/lib/esm/tasks/builder.js +1 -1
- package/lib/esm/tasks/builder.js.map +1 -1
- package/lib/esm/tasks/constants.js +1 -0
- package/lib/esm/tasks/constants.js.map +1 -1
- package/lib/esm/tasks/types.d.ts +12 -0
- package/lib/esm/tasks/workers/WorkThreadEnvironment.d.ts +32 -0
- package/lib/esm/tasks/workers/WorkThreadEnvironment.js +28 -0
- package/lib/esm/tasks/workers/WorkThreadEnvironment.js.map +1 -0
- package/lib/esm/tasks/workers/messages.d.ts +69 -0
- package/lib/esm/tasks/workers/messages.js +2 -0
- package/lib/esm/tasks/workers/messages.js.map +1 -0
- package/lib/esm/tasks/workers/workerThread.d.ts +1 -0
- package/lib/esm/tasks/workers/workerThread.js +185 -0
- package/lib/esm/tasks/workers/workerThread.js.map +1 -0
- package/lib/fs/FilesystemAdapter.cjs +437 -0
- package/lib/fs/FilesystemAdapter.d.ts +67 -0
- package/lib/fs/FilesystemAdapter.js.map +1 -0
- package/lib/fs/FsDispatch.cjs +24 -0
- package/lib/fs/FsDispatch.d.ts +7 -0
- package/lib/fs/FsDispatch.js.map +1 -0
- package/lib/fs/helpers.cjs +76 -0
- package/lib/fs/helpers.d.ts +17 -0
- package/lib/fs/helpers.js.map +1 -0
- package/lib/fs/index.cjs +21 -0
- package/lib/fs/index.d.ts +4 -0
- package/lib/fs/index.js.map +1 -0
- package/lib/fs/indexStore.cjs +181 -0
- package/lib/fs/indexStore.d.ts +28 -0
- package/lib/fs/indexStore.js.map +1 -0
- package/lib/fs/locks/FilesystemLock.cjs +56 -0
- package/lib/fs/locks/FilesystemLock.d.ts +13 -0
- package/lib/fs/locks/FilesystemLock.js.map +1 -0
- package/lib/fs/locks/FilesystemMultiLock.cjs +30 -0
- package/lib/fs/locks/FilesystemMultiLock.d.ts +8 -0
- package/lib/fs/locks/FilesystemMultiLock.js.map +1 -0
- package/lib/fs/types.cjs +3 -0
- package/lib/fs/types.d.ts +34 -0
- package/lib/fs/types.js.map +1 -0
- package/lib/index.cjs +1 -1
- package/lib/index.d.ts +1 -1
- package/lib/query/Paginator.cjs +2 -2
- package/lib/query/Paginator.js.map +1 -1
- package/lib/ram/RamAdapter.d.ts +1 -1
- package/lib/ram/types.d.ts +2 -1
- package/lib/tasks/TaskEngine.cjs +360 -15
- package/lib/tasks/TaskEngine.d.ts +30 -1
- package/lib/tasks/TaskEngine.js.map +1 -1
- package/lib/tasks/TaskService.cjs +3 -0
- package/lib/tasks/TaskService.js.map +1 -1
- package/lib/tasks/builder.cjs +1 -1
- package/lib/tasks/builder.js.map +1 -1
- package/lib/tasks/constants.cjs +1 -0
- package/lib/tasks/constants.js.map +1 -1
- package/lib/tasks/types.d.ts +12 -0
- package/lib/tasks/workers/WorkThreadEnvironment.cjs +31 -0
- package/lib/tasks/workers/WorkThreadEnvironment.d.ts +32 -0
- package/lib/tasks/workers/WorkThreadEnvironment.js.map +1 -0
- package/lib/tasks/workers/messages.cjs +3 -0
- package/lib/tasks/workers/messages.d.ts +69 -0
- package/lib/tasks/workers/messages.js.map +1 -0
- package/lib/tasks/workers/workerThread.cjs +220 -0
- package/lib/tasks/workers/workerThread.d.ts +1 -0
- package/lib/tasks/workers/workerThread.js.map +1 -0
- package/package.json +19 -8
|
@@ -0,0 +1,220 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
require("./../../overrides/index.cjs");
|
|
37
|
+
const worker_threads_1 = require("worker_threads");
|
|
38
|
+
const Adapter_1 = require("./../../persistence/Adapter.cjs");
|
|
39
|
+
const WorkThreadEnvironment_1 = require("./WorkThreadEnvironment.cjs");
|
|
40
|
+
const TaskHandlerRegistry_1 = require("./../TaskHandlerRegistry.cjs");
|
|
41
|
+
const TaskEngine_1 = require("./../TaskEngine.cjs");
|
|
42
|
+
const logging_1 = require("./../logging.cjs");
|
|
43
|
+
const logging_2 = require("@decaf-ts/logging");
|
|
44
|
+
const TaskStateChangeError_1 = require("./../TaskStateChangeError.cjs");
|
|
45
|
+
const utils_1 = require("./../utils.cjs");
|
|
46
|
+
const utils_2 = require("./../../utils/utils.cjs");
|
|
47
|
+
const initialPort = worker_threads_1.parentPort;
|
|
48
|
+
if (!initialPort) {
|
|
49
|
+
throw new Error("workerThread.ts must be run inside a worker thread");
|
|
50
|
+
}
|
|
51
|
+
const port = initialPort;
|
|
52
|
+
const environment = WorkThreadEnvironment_1.WorkThreadEnvironment.accumulate(worker_threads_1.workerData.environment);
|
|
53
|
+
const persistence = environment.persistence;
|
|
54
|
+
const moduleLoadPromise = loadModules(environment.modules);
|
|
55
|
+
async function loadModules(modules) {
|
|
56
|
+
const imports = modules?.imports ?? [];
|
|
57
|
+
if (!imports.length) {
|
|
58
|
+
throw new Error("Worker modules configuration must include at least one import");
|
|
59
|
+
}
|
|
60
|
+
const loaded = [];
|
|
61
|
+
for (const specifier of imports) {
|
|
62
|
+
const normalized = await (0, utils_2.normalizeImport)(Promise.resolve(`${specifier}`).then(s => __importStar(require(s))));
|
|
63
|
+
loaded.push(normalized);
|
|
64
|
+
}
|
|
65
|
+
return loaded;
|
|
66
|
+
}
|
|
67
|
+
async function resolveAdapter() {
|
|
68
|
+
const loadedModules = await moduleLoadPromise;
|
|
69
|
+
if (!loadedModules.length) {
|
|
70
|
+
throw new Error("Unable to load adapter module for worker");
|
|
71
|
+
}
|
|
72
|
+
if (persistence.adapterModule &&
|
|
73
|
+
environment.modules.imports[0] !== persistence.adapterModule) {
|
|
74
|
+
throw new Error(`Adapter module mismatch: expected ${persistence.adapterModule} as the first import`);
|
|
75
|
+
}
|
|
76
|
+
const adapterExports = loadedModules[0];
|
|
77
|
+
const AdapterCtor = persistence.adapterClass
|
|
78
|
+
? adapterExports[persistence.adapterClass]
|
|
79
|
+
: adapterExports.default || adapterExports;
|
|
80
|
+
if (!AdapterCtor) {
|
|
81
|
+
throw new Error(`Unable to resolve adapter constructor ${persistence.adapterClass} from ${environment.modules.imports[0]}`);
|
|
82
|
+
}
|
|
83
|
+
const instance = new AdapterCtor(...(persistence.adapterArgs || []));
|
|
84
|
+
if (persistence.alias) {
|
|
85
|
+
Adapter_1.Adapter.setCurrent(persistence.alias);
|
|
86
|
+
}
|
|
87
|
+
else if (instance.flavour) {
|
|
88
|
+
Adapter_1.Adapter.setCurrent(instance.flavour);
|
|
89
|
+
}
|
|
90
|
+
return instance;
|
|
91
|
+
}
|
|
92
|
+
let adapterPromise;
|
|
93
|
+
const registryPromise = moduleLoadPromise.then(() => new TaskHandlerRegistry_1.TaskHandlerRegistry());
|
|
94
|
+
function getAdapter() {
|
|
95
|
+
if (!adapterPromise)
|
|
96
|
+
adapterPromise = resolveAdapter();
|
|
97
|
+
return adapterPromise;
|
|
98
|
+
}
|
|
99
|
+
const workerLogger = logging_2.Logging.get().for(`TaskWorker:${environment.workerId}`);
|
|
100
|
+
function post(message) {
|
|
101
|
+
port.postMessage(message);
|
|
102
|
+
}
|
|
103
|
+
function toLogMessage(jobId, entries) {
|
|
104
|
+
return { type: "log", workerId: environment.workerId, jobId, entries };
|
|
105
|
+
}
|
|
106
|
+
getAdapter()
|
|
107
|
+
.then(() => {
|
|
108
|
+
post({
|
|
109
|
+
type: "ready",
|
|
110
|
+
workerId: environment.workerId,
|
|
111
|
+
});
|
|
112
|
+
})
|
|
113
|
+
.catch((err) => {
|
|
114
|
+
post({
|
|
115
|
+
type: "error",
|
|
116
|
+
workerId: environment.workerId,
|
|
117
|
+
error: err instanceof Error ? err.message : String(err),
|
|
118
|
+
stack: err instanceof Error ? err.stack : undefined,
|
|
119
|
+
});
|
|
120
|
+
});
|
|
121
|
+
async function runJob(job) {
|
|
122
|
+
await getAdapter();
|
|
123
|
+
const registry = await registryPromise;
|
|
124
|
+
const handler = registry.get(job.classification);
|
|
125
|
+
if (!handler) {
|
|
126
|
+
throw new Error(`No task handler registered for type: ${job.classification}`);
|
|
127
|
+
}
|
|
128
|
+
const taskLogger = new logging_1.TaskLogger(workerLogger, job.streamBufferSize, job.maxLoggingBuffer);
|
|
129
|
+
const pipe = async (entries) => {
|
|
130
|
+
if (!entries.length)
|
|
131
|
+
return;
|
|
132
|
+
post(toLogMessage(job.jobId, entries));
|
|
133
|
+
};
|
|
134
|
+
const ctx = TaskEngine_1.TaskEngine.createTaskContext(undefined, {
|
|
135
|
+
logger: taskLogger,
|
|
136
|
+
taskId: job.taskId,
|
|
137
|
+
attempt: job.attempt,
|
|
138
|
+
pipe: async (entries) => pipe(entries),
|
|
139
|
+
flush: async () => {
|
|
140
|
+
const logs = await taskLogger.flush();
|
|
141
|
+
await pipe(logs);
|
|
142
|
+
},
|
|
143
|
+
progress: async (payload) => {
|
|
144
|
+
post({
|
|
145
|
+
type: "progress",
|
|
146
|
+
workerId: environment.workerId,
|
|
147
|
+
jobId: job.jobId,
|
|
148
|
+
payload,
|
|
149
|
+
});
|
|
150
|
+
},
|
|
151
|
+
heartbeat: async () => {
|
|
152
|
+
post({
|
|
153
|
+
type: "heartbeat",
|
|
154
|
+
workerId: environment.workerId,
|
|
155
|
+
jobId: job.jobId,
|
|
156
|
+
});
|
|
157
|
+
},
|
|
158
|
+
resultCache: job.resultCache ?? {},
|
|
159
|
+
});
|
|
160
|
+
try {
|
|
161
|
+
const output = await handler.run(job.input, ctx);
|
|
162
|
+
await ctx.flush();
|
|
163
|
+
post({
|
|
164
|
+
type: "result",
|
|
165
|
+
workerId: environment.workerId,
|
|
166
|
+
jobId: job.jobId,
|
|
167
|
+
status: "success",
|
|
168
|
+
output,
|
|
169
|
+
cache: ctx.resultCache ?? {},
|
|
170
|
+
});
|
|
171
|
+
}
|
|
172
|
+
catch (error) {
|
|
173
|
+
await ctx.flush();
|
|
174
|
+
if (error instanceof TaskStateChangeError_1.TaskStateChangeError) {
|
|
175
|
+
post({
|
|
176
|
+
type: "result",
|
|
177
|
+
workerId: environment.workerId,
|
|
178
|
+
jobId: job.jobId,
|
|
179
|
+
status: "state-change",
|
|
180
|
+
request: error.request,
|
|
181
|
+
cache: ctx.resultCache ?? {},
|
|
182
|
+
});
|
|
183
|
+
return;
|
|
184
|
+
}
|
|
185
|
+
const serialized = (0, utils_1.serializeError)(error);
|
|
186
|
+
post({
|
|
187
|
+
type: "result",
|
|
188
|
+
workerId: environment.workerId,
|
|
189
|
+
jobId: job.jobId,
|
|
190
|
+
status: "error",
|
|
191
|
+
error: {
|
|
192
|
+
name: error instanceof Error
|
|
193
|
+
? error.name
|
|
194
|
+
: serialized?.code || "Error",
|
|
195
|
+
message: serialized?.message ?? String(error),
|
|
196
|
+
stack: serialized?.stack,
|
|
197
|
+
},
|
|
198
|
+
cache: ctx.resultCache ?? {},
|
|
199
|
+
});
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
port.on("message", (message) => {
|
|
203
|
+
if (message.type === "control") {
|
|
204
|
+
if (message.command === "stop" || message.command === "shutdown") {
|
|
205
|
+
process.exit(0);
|
|
206
|
+
}
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
if (message.type === "execute") {
|
|
210
|
+
void runJob(message.job).catch((err) => {
|
|
211
|
+
post({
|
|
212
|
+
type: "error",
|
|
213
|
+
workerId: environment.workerId,
|
|
214
|
+
error: err instanceof Error ? err.message : String(err),
|
|
215
|
+
stack: err instanceof Error ? err.stack : undefined,
|
|
216
|
+
});
|
|
217
|
+
});
|
|
218
|
+
}
|
|
219
|
+
});
|
|
220
|
+
//# sourceMappingURL=workerThread.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import "../../overrides/index";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"workerThread.js","sourceRoot":"","sources":["../../../src/tasks/workers/workerThread.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,uCAA+B;AAC/B,mDAAwD;AACxD,6DAAoD;AACpD,uEAIiC;AAOjC,sEAA6D;AAC7D,oDAA2C;AAE3C,8CAAwC;AACxC,+CAA4C;AAC5C,wEAA+D;AAC/D,0CAA0C;AAC1C,mDAAoD;AAEpD,MAAM,WAAW,GAAG,2BAAU,CAAC;AAC/B,IAAI,CAAC,WAAW,EAAE,CAAC;IACjB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,SAAS,EAAE,CAAC;QAC/B,KAAK,MAAM,CAAC,OAAO,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,GAAG,EAAE,EAAE;YACrC,IAAI,CAAC;gBACH,IAAI,EAAE,OAAO;gBACb,QAAQ,EAAE,WAAW,CAAC,QAAQ;gBAC9B,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,GAAG,CAAC;gBACvD,KAAK,EAAE,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS;aACpD,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;IACL,CAAC;AACH,CAAC,CAAC,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@decaf-ts/core",
|
|
3
|
-
"version": "0.8.
|
|
3
|
+
"version": "0.8.52",
|
|
4
4
|
"description": "Core persistence module for the decaf framework",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -19,6 +19,11 @@
|
|
|
19
19
|
"import": "./lib/esm/ram/index.js",
|
|
20
20
|
"types": "./lib/ram/index.d.ts"
|
|
21
21
|
},
|
|
22
|
+
"./fs": {
|
|
23
|
+
"require": "./lib/fs/index.cjs",
|
|
24
|
+
"import": "./lib/esm/fs/index.js",
|
|
25
|
+
"types": "./lib/fs/index.d.ts"
|
|
26
|
+
},
|
|
22
27
|
"./tasks": {
|
|
23
28
|
"require": "./lib/tasks/index.cjs",
|
|
24
29
|
"import": "./lib/esm/tasks/index.js",
|
|
@@ -36,13 +41,13 @@
|
|
|
36
41
|
"reset": "rm -rf * && git checkout . && git pull && npm run do-install",
|
|
37
42
|
"build": "npx build-scripts --dev",
|
|
38
43
|
"build:prod": "npx build-scripts --prod",
|
|
39
|
-
"test": "jest --runInBand --coverage --detectOpenHandles",
|
|
40
|
-
"test:unit": "jest --
|
|
41
|
-
"test:integration": "jest --
|
|
42
|
-
"test:e2e": "jest --
|
|
43
|
-
"test:all": "jest --
|
|
44
|
+
"test": "npm run build && jest --runInBand --coverage --detectOpenHandles",
|
|
45
|
+
"test:unit": "jest --testPathPatterns=\"/tests/unit\" --passWithNoTests --detectOpenHandles",
|
|
46
|
+
"test:integration": "jest --testPathPatterns=\"/tests/(integration)\" --passWithNoTests --detectOpenHandles",
|
|
47
|
+
"test:e2e": "jest --testPathPatterns=\"/tests/(e2e)\" --passWithNoTests --detectOpenHandles",
|
|
48
|
+
"test:all": "jest --testPathPatterns=\"/tests\" --passWithNoTests",
|
|
44
49
|
"test:circular": "dpdm -T --no-warning --no-tree ./src/index.ts",
|
|
45
|
-
"coverage": "rimraf ./workdocs/reports/data/*.json && npm run test:all -- --coverage --config=./workdocs/reports/jest.coverage.config.
|
|
50
|
+
"coverage": "rimraf ./workdocs/reports/data/*.json && npm run test:all -- --coverage --config=./workdocs/reports/jest.coverage.config.cjs",
|
|
46
51
|
"lint": "eslint .",
|
|
47
52
|
"lint-fix": "eslint --fix .",
|
|
48
53
|
"prepare-pr": "npm run lint-fix && npm run build:prod && npm run coverage && npm run docs",
|
|
@@ -95,7 +100,9 @@
|
|
|
95
100
|
"homepage": "https://github.com/decaf-ts/core#readme",
|
|
96
101
|
"devDependencies": {
|
|
97
102
|
"@decaf-ts/logging": "latest",
|
|
98
|
-
"@decaf-ts/utils": "latest"
|
|
103
|
+
"@decaf-ts/utils": "latest",
|
|
104
|
+
"@types/jest": "^30.0.0",
|
|
105
|
+
"typescript": "^5.9.3"
|
|
99
106
|
},
|
|
100
107
|
"dependencies": {
|
|
101
108
|
"@decaf-ts/db-decorators": "latest",
|
|
@@ -103,5 +110,9 @@
|
|
|
103
110
|
"@decaf-ts/decorator-validation": "latest",
|
|
104
111
|
"@decaf-ts/injectable-decorators": "latest",
|
|
105
112
|
"@decaf-ts/transactional-decorators": "latest"
|
|
113
|
+
},
|
|
114
|
+
"overrides": {
|
|
115
|
+
"minimatch": "^10.2.2",
|
|
116
|
+
"test-exclude": "7.0.1"
|
|
106
117
|
}
|
|
107
118
|
}
|