From 2bf3b1300cfd6971901aea95e8e5c4b0d96f12be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Nacho=20Codo=C3=B1er?= Date: Wed, 14 May 2025 10:50:35 +0200 Subject: [PATCH] ensure get meteor config only returns proper filtered config --- tools/project-context.js | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/tools/project-context.js b/tools/project-context.js index 0dce0164eb..23d3ba50f2 100644 --- a/tools/project-context.js +++ b/tools/project-context.js @@ -1819,14 +1819,16 @@ export class MeteorConfig { // TODO Implement an API for setting these values? get(...keys) { let config = this._ensureInitialized(); + let filteredConfig = keys.length ? undefined : config; if (config) { keys.every(key => { if (config && _.has(config, key)) { - config = config[key]; + filteredConfig = config[key]; return true; } + return false; }); - return config; + return filteredConfig; } } @@ -1908,6 +1910,8 @@ export class MeteorConfig { _getEntryModulesByArch(...keys) { const configEntryModule = this.get(...keys); + console.log("--> (project-context.js-Line: 1911)\n configEntryModule: ", configEntryModule); + console.log("--> (project-context.js-Line: 1911)\n keys: ", keys); const entryModulesByArch = Object.create(null); if (typeof configEntryModule === "string" || @@ -1927,6 +1931,7 @@ export class MeteorConfig { }); } + console.log("--> (project-context.js-Line: 1931)\n entryModulesByArch: ", entryModulesByArch); return entryModulesByArch; } @@ -1936,9 +1941,13 @@ export class MeteorConfig { ) { const entryMatch = archinfo.mostSpecificMatch( arch, Object.keys(entryModulesByArch)); + // console.log("--> (project-context.js-Line: 1939)\n archinfo: ", archinfo); + // console.log("--> (project-context.js-Line: 1939)\n Object.keys(entryModulesByArch): ", Object.keys(entryModulesByArch)); if (entryMatch) { const entryModule = entryModulesByArch[entryMatch]; + console.log("--> (project-context.js-Line: 1944)\n entryModulesByArch: ", entryModulesByArch); + console.log("--> (project-context.js-Line: 1942)\n entryModule: ", entryModule); if (entryModule === false) { // If meteor.{main,test}Module.{client,server,...} === false, no @@ -1967,6 +1976,7 @@ export class MeteorConfig { "./" + files.pathNormalize(entryModule), this.packageJsonPath ); + console.log("--> (project-context.js-Line: 1970)\n res: ", res); if (res && typeof res === "object") { return files.pathRelative(this.appDirectory, res.path);