@cat-org/configs v1.5.8
@cat-org/configs ·

Use to manage the multiple configs.
Install
yarn add @cat-org/configs --devRun command
Depend on the first argument, @cat-org/configs will run the command, generate the config file and use the default option.
yarn configs babelIn this case, this will generate babel.config.js and run babel src -d lib --verbose.
You can also add other option to this command.
yarn configs babel -wThis command is equal to babel src -d lib --verbose -w.
yarn configs exec custom-command argumentA argumentB --configs-files babelThis command will generate a babel config when running your custom-command. You can also use --configs-files babel,jest to generate babel and jest at the same time.
Get the configs lint
yarn configs --infoGet the information about the config
By this option, you can get the detail of this config.
yarn configs babel --infoDownload the packages from the config
yarn configs babel --installIn this case, this will run yarn install @babel/cli @babel/core @cat-org/babel-plugin-base --dev.
Get help
yarn configs -hWrite config
This module use cosmiconfig to find the config file. The filename which is supported by cosmiconfig can be used.
module.exports = {
// configsEnv is special key, this will give to the argument of the each config function
configsEnv: ['react'],
// overwrite the existing config by function
babel: config => { ... },
// overwrite the existing config by object
jest: {
config: config => { ... },
},
// add custom config, each field is optional
custom: {
aliase: 'babel', // run config with babel cli
getCli: () => 'path-to-cli', // cli path which is used to run the command
install: install => [ // install packages
...install,
'@cat-org/configs',
],
config: config => { // write the config
...config,
key: 'value',
},
ignore: ignore => [ // generate ignore file
...ignore,
'node_modules'
],
ignoreName: '.gitignore' // ignore filename
run: argv => [ // command to run
...argv,
'src',
'-d',
'lib',
],
env: { // run command with environment
NODE_ENV: 'development',
},
configFiles: { // link the config files. For example, `jest` need to run with `babel`, you need to add `babel: true`
eslint: true,
},
},
};6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
6 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago