standard-shared-config v5.1.2
Easy way to create and share your boilerplate configs. One shared config to rule them all:loop::package:
The configuration files is an important part of your project, and as such, you may want to share it with other projects or people. Shareable configs allow you to publish your configuration settings on npm and have others download and use it in their projects.
Install
npm install standard-shared-configUsage
Create a shared configuration package
- Create
package.jsonwithname,versionanddescription. - Create
.configdirectory and copy all the configuration files you want to share. - Create
.sharedconfig.yml- file containing schema and rules for your shared configuration and specify the usage parameters. - Run
shared-config build
After completing the command execution, you will get the following structure inside the outputDir:
bin/[you shared config name from package]scripts.js- Script commands which will be added to thepackage.json, see.sharedconfig.ymlsnapshots.js- snapshots of config files fromsharedDirindex.js- will be called when your config is applied to copy config files to the project
Now publish your shared configuration package to NPM!
Use shared configuration
- install your shared configuration package
- add script with your shared configuration package name to
package.jsonscripts for creating sharable configuration files. - override parts of config files in
sharedDir, if needed (.configby default) - override package scripts in
.sharedconfig.ymlinsharedDir, if needed (.configby default)
{
"scripts": {
"prepare:config": "my-shared-config"
}
}Do not forget to add the shared configuration files in the
.gitignore, because you no longer need them in the repository
API
Read the API documentation for more information.
2 years ago
2 years ago
2 years ago
2 years ago
2 years ago
3 years ago
3 years ago
3 years ago
3 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
4 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago
5 years ago