bulltrackers-module 1.0.649 → 1.0.650
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.
|
@@ -80,9 +80,21 @@ async function fetchDependencies(date, calcs, config, deps, manifestLookup = {},
|
|
|
80
80
|
|
|
81
81
|
calcs.forEach(c => {
|
|
82
82
|
// [FIX] Support both .getDependencies() method and .dependencies array
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
83
|
+
// CRITICAL: Prefer class.getDependencies() over manifest.dependencies
|
|
84
|
+
// because the class method returns original case-sensitive names,
|
|
85
|
+
// while manifest.dependencies contains normalized names
|
|
86
|
+
let reqs = [];
|
|
87
|
+
if (c.class && typeof c.class.getDependencies === 'function') {
|
|
88
|
+
// Use the class method - returns original case-sensitive names
|
|
89
|
+
reqs = c.class.getDependencies();
|
|
90
|
+
} else if (typeof c.getDependencies === 'function') {
|
|
91
|
+
// Fallback: direct method call (if c is the class itself)
|
|
92
|
+
reqs = c.getDependencies();
|
|
93
|
+
} else if (c.dependencies && Array.isArray(c.dependencies)) {
|
|
94
|
+
// Last resort: use manifest's dependencies array (normalized)
|
|
95
|
+
// This is less ideal because names are normalized, but we'll use them as-is
|
|
96
|
+
reqs = c.dependencies;
|
|
97
|
+
}
|
|
86
98
|
|
|
87
99
|
if (Array.isArray(reqs)) {
|
|
88
100
|
reqs.forEach(r => {
|
|
@@ -99,6 +111,10 @@ async function fetchDependencies(date, calcs, config, deps, manifestLookup = {},
|
|
|
99
111
|
const calcNames = calcs.map(c => c.name || c.constructor?.name || 'unknown').join(', ');
|
|
100
112
|
logger.log('INFO', `[DependencyFetcher] Fetching ${needed.size} dependencies for computation(s): ${calcNames} (date: ${dStr})`);
|
|
101
113
|
|
|
114
|
+
// DEBUG: Log what dependencies we're looking for
|
|
115
|
+
const depList = Array.from(needed.entries()).map(([norm, orig]) => `${orig} (normalized: ${norm})`).join(', ');
|
|
116
|
+
logger.log('INFO', `[DependencyFetcher] Dependencies requested: ${depList}`);
|
|
117
|
+
|
|
102
118
|
const results = {};
|
|
103
119
|
const missingDeps = [];
|
|
104
120
|
const emptyDeps = [];
|
|
@@ -142,6 +158,9 @@ async function fetchDependencies(date, calcs, config, deps, manifestLookup = {},
|
|
|
142
158
|
} else {
|
|
143
159
|
// CHANGED: Store result using the ORIGINAL name so context.computed['CaseSensitive'] works
|
|
144
160
|
results[originalName] = data;
|
|
161
|
+
// DEBUG: Log successful dependency load
|
|
162
|
+
const dataKeys = Object.keys(data);
|
|
163
|
+
logger.log('INFO', `[DependencyFetcher] ✅ Stored dependency '${originalName}' in results. Keys: ${dataKeys.length} (sample: ${dataKeys.slice(0, 5).join(', ')})`);
|
|
145
164
|
}
|
|
146
165
|
} catch (e) {
|
|
147
166
|
missingDeps.push({ name: originalName, normalizedName: normName, path, error: e.message });
|
|
@@ -156,6 +175,10 @@ async function fetchDependencies(date, calcs, config, deps, manifestLookup = {},
|
|
|
156
175
|
|
|
157
176
|
await Promise.all(promises);
|
|
158
177
|
|
|
178
|
+
// DEBUG: Log what we're returning
|
|
179
|
+
const resultKeys = Object.keys(results);
|
|
180
|
+
logger.log('INFO', `[DependencyFetcher] ✅ Returning ${resultKeys.length} dependencies: ${resultKeys.join(', ')}`);
|
|
181
|
+
|
|
159
182
|
// CRITICAL: Fail if any required dependencies are missing or empty
|
|
160
183
|
// EXCEPTION: For historical/lookback scenarios, missing dependencies are permissible
|
|
161
184
|
if ((missingDeps.length > 0 || emptyDeps.length > 0) && !allowMissing) {
|
|
@@ -177,6 +177,10 @@ class MetaExecutor {
|
|
|
177
177
|
const inst = new c.class();
|
|
178
178
|
inst.manifest = c;
|
|
179
179
|
|
|
180
|
+
// DEBUG: Log what dependencies were fetched
|
|
181
|
+
const fetchedDepKeys = Object.keys(fetchedDeps || {});
|
|
182
|
+
logger.log('INFO', `[MetaExecutor] 📦 Fetched dependencies available: ${fetchedDepKeys.length > 0 ? fetchedDepKeys.join(', ') : 'NONE'}`);
|
|
183
|
+
|
|
180
184
|
const context = ContextFactory.buildMetaContext({
|
|
181
185
|
dateStr: dStr,
|
|
182
186
|
metadata: c,
|
|
@@ -197,7 +201,10 @@ class MetaExecutor {
|
|
|
197
201
|
});
|
|
198
202
|
|
|
199
203
|
// DEBUG: Log dependency availability
|
|
200
|
-
|
|
204
|
+
// CRITICAL: Use class.getDependencies() to get original case-sensitive names
|
|
205
|
+
const depNames = (c.class && typeof c.class.getDependencies === 'function')
|
|
206
|
+
? c.class.getDependencies()
|
|
207
|
+
: (c.getDependencies ? c.getDependencies() : (c.dependencies || []));
|
|
201
208
|
depNames.forEach(depName => {
|
|
202
209
|
const depData = context.computed[depName];
|
|
203
210
|
if (depData) {
|