Closed luckyf closed 1 year ago
Why is it useful? All of this data is static (as should be all configuration, ideally)
I use it for sharing the configuration between projects by creating an "@project/licensee-config" NPM package, which I then export in the .licensee.js
file.
It's also possible to override single keys in specific projects.
const config = require("@project/licensee-config");
module.exports = {
...config,
somekey: "override",
};
For keeping the configuration up to date, I just need to update my dependencies and skip copying JSON files to all projects, which makes it also easy to automate with Dependabot or Renovate.
That's interesting. I wonder tho if eslint-style extension would be better, like this:
{
"extends": "@project/licensee-config",
"somekey": "override"
}
I'm loathe to make munging or managing fundamentally static configuration data direct features of this tool. The tool checks npm package licenses against a configuration. It doesn't know or care how that configuration gets written.
@luckyf, you might try symlinking node_modules/@project/licensee-config/whatever
to .licensee.json
. Or writing .licensee.json
before calling licensee
in an npm script like node -e "console.log(JSON.stringify(require('@project/licensee-config')))" > .licensee.json && licensee
.
For sharing configuration files between projects as NPM modules it is useful to use dynamic JavaScript files as configuration, in addition to JSON files.
ESLint Config Docs or Commitlint Config Docs can be used as reference.
The .licensee.js configuration file could look like this: