Bot releases are hidden (Show)
The new changes make lilconfig work as expected when a nodejs app is bundled using webpack.
Thanks @CHC383
Published by antonk52 8 months ago
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.
Published by antonk52 8 months ago
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"
in package.json
.mjs
files in projects that use commonjsThanks for pushing this feature @marekdedic
Published by antonk52 11 months ago
cache
featureLilconfig 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})
Published by antonk52 over 1 year ago
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
Published by antonk52 over 2 years ago
Thanks for reporting @edgan 👏
Published by antonk52 over 2 years ago
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`
});
Published by antonk52 almost 3 years ago
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:
.yml
key in add loaded example in readmePublished by antonk52 over 3 years ago
This release contains a fix for unix root directory. Please see #17 for more information
Thank you @JounQin for the PR 🙌
Published by antonk52 almost 4 years ago
Lilconfig got future proof by removing the usage of deprecated nodejs api.
Thanks to @jeetiss & @TrySound 👏
Published by antonk52 about 4 years ago
lilconfig v2 is supposed to mimic the functionality of cosmiconfig v7
The breaking changes are the same. To learn more about cosmiconfig v7 click here.
Published by antonk52 about 4 years ago
After carefully testing compatibility with cosmiconfig, lilconfig's first major release is finally ready.
Published by antonk52 over 4 years ago
lilconfig(name).search([searchPlace])
argument should be optional. Thanks @lttb 🎉esModuleInterop
was disabled to prevent typescript from inlining import helpers into the transpiled code.