@ekino/config 2.0#43
Merged
Merged
Conversation
Nico385412
approved these changes
Dec 3, 2025
atacanjacques
approved these changes
Feb 4, 2026
isNullsy returns a boolean; 'boolean == null' is always false in JS, making the left side of the || permanently dead. The null-traversal path was only protected by the 'typeof current !== object' branch, which silently misses an explicit null value assigned mid-path. Replace '== null' with direct boolean evaluation so both null and non-object intermediaries are caught correctly. Adds a regression test for null intermediate node traversal.
The Internals type declared cast as accepting an optional boolean value, but the implementation only handles string | number as input (it produces boolean output, it does not consume it). The mismatch let TypeScript silently accept boolean env vars at the call site despite the runtime function never handling that case. - Remove boolean and the optional marker from the Internals cast type - Narrow envVal to string | number at the call site (ProcessEnv index signature includes boolean for test assignment ergonomics, not runtime)
The previous guard cast the input to its target type before checking, which means an object with key explicitly set to undefined would pass the !== undefined test and be misidentified as an advanced config. Using typeof .key === 'string' checks the runtime shape without assuming the cast is safe, making the guard correct by construction.
mergeWithDeep mutates the target when it is an object, which made the call sites work in practice. However the return value is the canonical result and discarding it creates a hidden coupling to the internal mutation behaviour. Assigning the return value back to internals.cfg makes the data-flow explicit and correct even if the target were ever a wrapped primitive, where the mutation would have been silently lost.
TypeScript 6 removed implicit typeRoots auto-inclusion. Previously, listing './node_modules/@types' in typeRoots was enough to pull in @types/node globally. TS6 requires an explicit types: ['node'] entry in compilerOptions.
e94eab5 to
a8302a6
Compare
- Remove allowSyntheticDefaultImports, esModuleInterop, strict, noImplicitAny: all now default to true/enabled in TS6, explicit values are redundant - Remove typeRoots: superseded by explicit types:[node] added previously - Add rootDir:./src to tsconfig.lib.json: TS6 no longer infers rootDir from input files; without it tsc errors (TS5011) and would emit to lib/src/ instead of lib/
51ee926 to
c34e022
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rewrite @ekino/config for v2.0
Motivation
What has changed?
Here are the key changes made in this PR:
Test plan
Also close issue #40
For the NPM release, now we use: "Trusted publishing for npm packages"
https://docs.npmjs.com/trusted-publishers#supported-cicd-providers