@tradejs/node 3.1.4 → 3.1.5
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/runtimeStrategies.js +22 -1
- package/dist/runtimeStrategies.mjs +22 -1
- package/package.json +4 -4
|
@@ -576,6 +576,23 @@ var resolveInstalledPackageVersion = async (projectRoot, packageName, manifest)
|
|
|
576
576
|
return null;
|
|
577
577
|
}
|
|
578
578
|
};
|
|
579
|
+
var resolveStrategyPackageName = async ({
|
|
580
|
+
pluginSource,
|
|
581
|
+
projectRoot
|
|
582
|
+
}) => {
|
|
583
|
+
if (!pluginSource) return null;
|
|
584
|
+
if (!pluginSource.startsWith(".") && !import_node_path.default.isAbsolute(pluginSource)) {
|
|
585
|
+
return pluginSource;
|
|
586
|
+
}
|
|
587
|
+
try {
|
|
588
|
+
const packageJson = JSON.parse(
|
|
589
|
+
await (0, import_promises.readFile)(import_node_path.default.join(projectRoot, "package.json"), "utf8")
|
|
590
|
+
);
|
|
591
|
+
return typeof packageJson.name === "string" && packageJson.name.trim() ? packageJson.name : null;
|
|
592
|
+
} catch {
|
|
593
|
+
return null;
|
|
594
|
+
}
|
|
595
|
+
};
|
|
579
596
|
var validateReleaseRuntimeCompatibility = async ({
|
|
580
597
|
release,
|
|
581
598
|
projectRoot,
|
|
@@ -716,7 +733,11 @@ var getRuntimeStrategyPackageMetadata = async ({
|
|
|
716
733
|
projectRoot
|
|
717
734
|
}) => {
|
|
718
735
|
const packageManifest = await readPackageManifest(projectRoot);
|
|
719
|
-
const
|
|
736
|
+
const pluginSource = await getStrategyPluginSource(strategyName, projectRoot) ?? null;
|
|
737
|
+
const strategyPackage = await resolveStrategyPackageName({
|
|
738
|
+
pluginSource,
|
|
739
|
+
projectRoot
|
|
740
|
+
});
|
|
720
741
|
return {
|
|
721
742
|
strategyPackage,
|
|
722
743
|
strategyPackageVersion: await resolveInstalledPackageVersion(
|
|
@@ -43,6 +43,23 @@ var resolveInstalledPackageVersion = async (projectRoot, packageName, manifest)
|
|
|
43
43
|
return null;
|
|
44
44
|
}
|
|
45
45
|
};
|
|
46
|
+
var resolveStrategyPackageName = async ({
|
|
47
|
+
pluginSource,
|
|
48
|
+
projectRoot
|
|
49
|
+
}) => {
|
|
50
|
+
if (!pluginSource) return null;
|
|
51
|
+
if (!pluginSource.startsWith(".") && !path.isAbsolute(pluginSource)) {
|
|
52
|
+
return pluginSource;
|
|
53
|
+
}
|
|
54
|
+
try {
|
|
55
|
+
const packageJson = JSON.parse(
|
|
56
|
+
await readFile(path.join(projectRoot, "package.json"), "utf8")
|
|
57
|
+
);
|
|
58
|
+
return typeof packageJson.name === "string" && packageJson.name.trim() ? packageJson.name : null;
|
|
59
|
+
} catch {
|
|
60
|
+
return null;
|
|
61
|
+
}
|
|
62
|
+
};
|
|
46
63
|
var validateReleaseRuntimeCompatibility = async ({
|
|
47
64
|
release,
|
|
48
65
|
projectRoot,
|
|
@@ -183,7 +200,11 @@ var getRuntimeStrategyPackageMetadata = async ({
|
|
|
183
200
|
projectRoot
|
|
184
201
|
}) => {
|
|
185
202
|
const packageManifest = await readPackageManifest(projectRoot);
|
|
186
|
-
const
|
|
203
|
+
const pluginSource = await getStrategyPluginSource(strategyName, projectRoot) ?? null;
|
|
204
|
+
const strategyPackage = await resolveStrategyPackageName({
|
|
205
|
+
pluginSource,
|
|
206
|
+
projectRoot
|
|
207
|
+
});
|
|
187
208
|
return {
|
|
188
209
|
strategyPackage,
|
|
189
210
|
strategyPackageVersion: await resolveInstalledPackageVersion(
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tradejs/node",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.5",
|
|
4
4
|
"description": "Node-only runtime for the TradeJS TypeScript framework: strategies, backtests, Pine strategy loading, and plugin registries.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"tradejs",
|
|
@@ -85,9 +85,9 @@
|
|
|
85
85
|
"dependencies": {
|
|
86
86
|
"@langchain/core": "^1.2.3",
|
|
87
87
|
"@langchain/openai": "^1.5.5",
|
|
88
|
-
"@tradejs/core": "^3.1.
|
|
89
|
-
"@tradejs/infra": "^3.1.
|
|
90
|
-
"@tradejs/types": "^3.1.
|
|
88
|
+
"@tradejs/core": "^3.1.5",
|
|
89
|
+
"@tradejs/infra": "^3.1.5",
|
|
90
|
+
"@tradejs/types": "^3.1.5",
|
|
91
91
|
"chalk": "4.1.2",
|
|
92
92
|
"ioredis": "5.11.1",
|
|
93
93
|
"lodash": "^4.18.1",
|