Releases: antonk52/lilconfig
v3.1.2 Webpack friendly
v3.1.1 Security release
- Fix security vulnerability by migrating from typescript to javascript with TSDoc comments. See #48
- Use tabs instead of spaces
Due to how typescript compilation works I had to use eval()
to have a dynamic import in project compiled to commonjs in v3.1.0. Eval call introduced a security vulnerability as it was pointed out to me by kind people from Secfault Security. As there is currently no way to make typescript output dynamic import with a commonjs target I migrated the source code to be in javascript. This means that the code in this repository is the code that gets published to npm. The package still includes first party typescript types in index.d.ts
file that gets published as well. The runtime code now uses TSDoc annotations to maintain type safety.
v3.1.0 Support ESM config files (async api only)
Lilconfig now supports loading ESM configuration files.
ESM configs can be searched or loaded via async API only.
ESM syntax can be valid in either
.js
and.mjs
files in projects with"type": "module"
inpackage.json
.mjs
files in projects that use commonjs
Thanks for pushing this feature @marekdedic
v3.0.0 Cache support
BREAKING CHANGES
- Cache support enabled by default
- Drop support for Node v10 & v12
New cache
feature
Lilconfig now can cache results in between searches within the same nodejs process. If you are reusing the searcher to look up configuration files, you will get much faster configuration lookups.
Otherwise you can disable it in options using the new cache
key
lilconfig('myapp', {cache: false})
v2.1.0 adds support for `.config/<name>rc` files
The default search places for configuration now also searches in the following files:
.config/${name}rc
.config/${name}rc.json
.config/${name}rc.js
.config/${name}rc.cjs
This version should nicely correlate with cosmiconfig v7.1.0
v2.0.6 adds missing LICENSE file
Thanks for reporting @edgan π
v2.0.5 Fixes async loaders π user defined ESM support
Thanks to @michael42 who reported and fixed a bug for async loaders in lilconfig
function π
You can now add support to ESM configs by providing a custom loader
import {lilconfig} from 'lilconfig';
const loadEsm = filepath => import(filepath);
lilconfig('myapp', {
loaders: {
'.js': loadEsm,
'.mjs': loadEsm,
}
})
.search()
.then(result => {
result // {config, filepath}
result.config.default // if config uses `export default`
});
v2.0.4 Fix relative paths handling for `load` methods
Thanks to @iiroj for highlighting a bug in okonet/lint-staged/issues/1034 where relative paths did not work appropriately when passed to load
methods. This bug has been fixed and tested to make sure this would not happen again π
There were also a few minor improvements:
- Dev dependencies update
- Include nodejs v14 and v16 into PR checks
- Add missing
.yml
key in add loaded example in readme