0.3.2 • Published 8 years ago

bower-ignore v0.3.2

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

Bower Ignore

Travis  Coverage  npm  npm  npm  GitHub license

A simple CLI tool to gitignore useless files of bower dependencies

npm.io

Installation

 npm install bower-ignore -g

Glossary

  • ignores: JSON object named "dependencies-gitignore" (by default) in bower.json, which looks like:
"dependencies-gitignore": {
  "bootstrap": {
    "ignore": ["*", "dist/css/*.map"],
    "unignore": ["dist/*"]
  }
}
  • package: Generally the name of a repository appeared in bower.json, which has been installed with bower.

  • formulae: Collection of polular packages ignores, hosted on GitHub: github.com/mdluo/bower-ignore-formulae

📢  Contribution wanted!  Go >>

  • gitignore: Plain text in .gitignore, generated based on ignores. For each package in ignores, the bdgi git command takes elements from ignore Array and unignore Array by turns and prefix bower_components path and package name to them. And then write the multiline text to .gitignore.
# Generated by bower-ignore, please DO NOT modify
# = Bower Ignore Begin
bower_components/bootstrap/*
!bower_components/bootstrap/dist/*
bower_components/bootstrap/dist/css/*.map
# = Bower Ignore End

Usage

Example

Add and set "dependencies-gitignore" (i.e. ignores, hereinbelow) based on "dependencies" in bower.json:

 bdgi json

Add or replace (if ignores already exists) ignores based on "dependencies" packages in bower.json:

 bdgi json -f

Download and replace ignores based on "dependencies" packages in bower.json:

 bdgi json -df

Download jquery and moment formulae and set. Skip if packages already exist in ignores:

 bdgi json jquery moment -d

Sometimes you may need to edit the ignores part of your bower.json to meet your dependencies tree.

Setup ignores in bower.json and add ignores and unignores to .gitignore:

 bdgi json -d && bdgi git

Command Line Usage

Usage: bdgi <cmd> [options] [packages...]

Commands:

  json|j [options] [packages...]  add and set "dependencies-gitignore" in bower.json
  git|g [options]                 add ignores and unignores to .gitignore based on ignores in bower.json

Options:

  -h, --help     output usage information
  -V, --version  output the version number

Future features

  • Resolve packages dependencies tree and add ignores automaticly.

  • Watch file change and take reactions.

  • Add version support to packages.

Contributing

Feel free to submit pull requests, open issues if you have any question to ask or bug to report. Or, just help to improve this README.md file and messages in bin/bdgi.