JSPM

  • Created
  • Published
  • Downloads 144
  • Score
    100M100P100Q82924F
  • License MIT

One shared config to rule them all

Package Exports

  • standard-shared-config

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (standard-shared-config) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

Standard shared config logo

Build Status npm NPM

One shared config to rule them all βžΏπŸ“¦

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-config

Usage

Create a shared configuration package

  • Create package.json with name, version and description.
  • Create .config directory 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 outDir:

  • bin/[you shared config name from package]
  • dependencies.js - List of devDependencies, see .sharedconfig.yml
  • scripts.js - Script commands which will be added to the package.json, see .sharedconfig.yml
  • snapshots.js - snapshots of config files from rootDir
  • index.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.json scripts for creating sharable configuration files.
  • override parts of config files in rootDir, if needed (.config by 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.

License

MIT