From 2bd6247b06691b6f223c757c305f929b61226ea3 Mon Sep 17 00:00:00 2001 From: Jesse Wright <63333554+jeswr@users.noreply.github.com> Date: Sun, 5 Jul 2026 12:15:50 +0000 Subject: [PATCH] fix: Honour the remoteContextLookups option instead of typeChecking's value ComponentsManagerBuilder assigned `Boolean(options.typeChecking)` to `this.remoteContextLookups` whenever `options.remoteContextLookups` was defined - a copy-paste slip. As a result, passing `remoteContextLookups: true` together with `typeChecking: false` silently disabled remote context lookups (and conversely, `remoteContextLookups: false` with default type checking silently enabled them). Adds a regression test pinning the two options as independent. Co-Authored-By: Claude Fable 5 --- lib/loading/ComponentsManagerBuilder.ts | 2 +- test/unit/loading/ComponentsManagerBuilder-test.ts | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/loading/ComponentsManagerBuilder.ts b/lib/loading/ComponentsManagerBuilder.ts index 6d84813..6542f8b 100644 --- a/lib/loading/ComponentsManagerBuilder.ts +++ b/lib/loading/ComponentsManagerBuilder.ts @@ -54,7 +54,7 @@ export class ComponentsManagerBuilder { Boolean(options.typeChecking); this.remoteContextLookups = options.remoteContextLookups === undefined ? false : - Boolean(options.typeChecking); + Boolean(options.remoteContextLookups); } public static createLogger(logLevel: LogLevel = 'warn'): Logger { diff --git a/test/unit/loading/ComponentsManagerBuilder-test.ts b/test/unit/loading/ComponentsManagerBuilder-test.ts index 55e147f..3b4774c 100644 --- a/test/unit/loading/ComponentsManagerBuilder-test.ts +++ b/test/unit/loading/ComponentsManagerBuilder-test.ts @@ -57,6 +57,16 @@ describe('ComponentsManagerBuilder', () => { jest.clearAllMocks(); }); + it('should honour remoteContextLookups independently of typeChecking', async() => { + const builder = new ComponentsManagerBuilder({ + mainModulePath, + remoteContextLookups: true, + typeChecking: false, + }); + const mgr = await builder.build(); + expect(( mgr.configRegistry).remoteContextLookups).toBe(true); + }); + it('should build with default options', async() => { const componentsManagerBuilder = new ComponentsManagerBuilder({ mainModulePath,