Skip to main content

api

packageConfigs

Configuration files that are bundled in the cli-style package. Can be imported from the main entry-point.

Used to either resolve the base configuration file to use, or referenced from a template config file when installed in a project.

Kind: global constant

projectConfigs

The configuration files as they should appear when installed into a project.

Kind: global constant

templateConfigs

The template configuration files are the config files that are installed into the project as defined by the projectConfig path.

We want to be able to update the packageConfig and have those updates automatically propagate to the projectConfig, so we use these templates to refer to the packageConfigs, which can then be customized in the project.

The "base" property to specify a default template to use is special, and used to make it easier for a user, so instead of requiring they write "d2-style add eslint base" we automatically use the base template if they write "d2-style add eslint".

See the templateConfig() function for details.

Kind: global constant

add()

Add a configuration file to the project based on a template. If there is already a config file, we install a new one next to it with '.new' as the suffix.

This allows users to diff old vs. new and see if there are any customizations that need to be brought over.

Kind: global function

remove()

Removes a configuration file based on the tool and/or type used.

If path is used, then tool and type are ignored.

Kind: global function