Changelog - 2026-09-06
Shared singletons across module copies
Bug FixIn one line. AppEnvs.set() in one copy of helpers is now read by the other copy, and a peer handed to ModuleUtility.register() is found by every copy.
What changed
applicationEnvironment(AppEnvs,Envs) is one instance per process. A process that loads both the ESM and CommonJS build of@venizia/ignis-helpers(for example a TypeScript test beside a compiled library, or two copies in one bundle) used to hold two instances, so a value set through one was invisible to the other. No API change.ModuleUtility.register()is shared across copies, soload()in any copy finds a registered peer. In abun build --compilebinary this is the difference between booting and failing to resolve the peer.RestApplicationchecksconfigs.path.baseat construction. A config assembled from the environment can lose it at run time. The router used to fail later insideroute()withundefined is not an object (evaluating 'path.replaceAll'). It now throws[<scope>] configs.path.base must be a string | value: undefined | an empty string mounts the application at the rootbefore the boot sequence starts.
typescript
AppEnvs.set('APP_ENV_INVOICE_CLAIM_BASE_URL', 'https://probe.example');
buildClaimUrl(); // before: read an empty value from a second instance; now: reads the value aboveWho is affected
- Tests that mix
importandrequireof helpers. Values set throughAppEnvsare now visible everywhere. A test that relied on the two instances being separate (unlikely) would notice. - Compiled binaries registering peers.
ModuleUtility.register()from the entrypoint now reaches the framework's own copy. - Applications whose base path comes from an unset environment variable. They fail at construction with the key named instead of at
start(). Set the variable (an empty string mounts at the root).