npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

grunt-bower-verify

v2.0.1

Published

> Install and test all your dependencies versions.

Downloads

103

Readme

grunt-bower-verify

Prove your bower.json don't lie. Install and test all your dependencies versions.

Dependency Status

Getting Started

This plugin requires Grunt ~0.4.0

If you haven't used Grunt before, be sure to check out the Getting Started guide, as it explains how to create a Gruntfile as well as install and use Grunt plugins. Once you're familiar with that process, you may install this plugin with this command:

npm install grunt-bower-verify --save-dev

Once the plugin has been installed, it may be enabled inside your Gruntfile with this line of JavaScript:

grunt.loadNpmTasks('grunt-bower-verify');

Bower verify task

Run this task with the grunt bower-verify command.

Options

ignorePatch

Type: Boolean Default value: false

This will only install the latest patch version of the major/minor version.

onlyStandardVersions

Type: Boolean Default value: true

This will only install versions that match /^[\d]+\.[\d]+\.[\d]+$/. So only x.y.z. This means pre-release versions and versions containing build info is ignored. These versions do easily cause problems, so this option is on by default.

showTasksOutput

Type: Boolean Default value: true

If false it will just show one line with OK or ERROR at the end depending on if the tasks failed or not.

completeOnError

Type: Boolean Default value: true

Completes all versions before failimg if an error.

Configuring

This is a multitask so you can specify your own targets

bowerVerify: {
	targetname: {
		tasks: ['test'] //some task or tasks of your choice to be run after each bower install
	}
},

Example cases

You can find out if your bower.json config really is valid, by automatically installing all published version that matches the semver your described.

Say you have the following bower.json file

{
  "name": "my-jquery-plugin",
  "dependencies": {
    "jquery": ">=1.6.0"
  }
}

Running grunt bower-verify:test will first fetch all versions available for jquery.

Then if the version satisfies the semver you have in your bower config it will try to install that version and then run the tasks that you have defined in your target. Typically this will be tests, a build process or similar.

This allows you to verify that your bower package actually supports all the versions that it claims that it supports. This could be handy to be run in a CI environment especially.

Say you claim that your support jquery >=1.6.0 like above. But if you run a normal bower install it will install the latest version probably.

Let's further assume you have started using the on function for events that got introduced in 1.7. Running bower-verify would easily allow you to discover that either you will have to change your supported version of jquery to >=1.7 or stop using the on function.

Multiple dependencies

If you have multiple dependencies, say underscore >=1.3 and jquery >=1.6 then it will first install all versions of one of them and then all versions of all the other.

It might be added in the future to do all combinations of the two. However this might result in many many combinations.

Colliding sub dependencies

Since bower uses a flat dependency tree it might occur that if you install let's say bootstrap 2.3.2, that requires jquery >=1.8.0 <2.1.0

But if your own bower.json contains >=1.6 it will still try to install 1.6.x and 1.7.x and >=2.1.0. bower-verify will then report that these versions was not installed due to the conflict with bootstrap.

This information could be used by you to update your main bower.json config accordingly.