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-fh-build

v2.0.1

Published

A plugin for development and build lifecycle of FeedHenry components

Downloads

41

Readme

grunt-fh-build

A plugin for development and build lifecycle of FeedHenry components

Getting Started

This plugin requires Grunt ~0.4.5

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-fh-build --save-dev

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

grunt.loadNpmTasks('grunt-fh-build');

The "fh" task

Overview

The task exposed by this plugin is called fh, and is used as more of a namespace prefix for the targets that provide its functionality. You probably won't want to call grunt fh by itself, but rather one of its targets. In most cases, these targets will wrap other plugins and provide default configuration values.

Targets

fh:dist

This target creates the tarball for the project in which grunt is run. The archive will be named according to the following:

<name>-<version>-<build-number>.tar.gz

In the above, name and version come from the package.json file, and build-number is one of the following:

  • Value of BUILD_NUMBER env variable (as set by Jenkins, for example), or
  • the literal string DEV-VERSION, if no BUILD_NUMBER variable is set.

fh:clean

This target removes generated files & directories that may be created by other targets, including the node_modules directory created by npm.

fh:test

This target will run all tests; starting with unit tests, then integration tests, and finally acceptance tests. See below sections fh:unit, fh:integrate and fh:accept for more information on how to configure these.

fh:unit

This target will run the unit tests for the project. To configure which and how tests are run, add a property called unit to the configuration in your Gruntfile.js. This property is an array of commands to run, so that different test runners can be used per project:

unit: ['mocha -A -u exports --recursive -t 10000 ./test/helper.js ./test/unit']

Note: by default, the directory node_modules/.bin will be added to the beginning of the PATH environment variable, so we don't have to specify the path to commands, if they reside in that directory.

fh:testfile

This target will run the single unit test file for the project. To configure which and how tests are run, add a property called unit_single to the configuration in your Gruntfile.js. Command string should contain test_filename placeholder that will be replaced with filename argument at runtime. Additional parameters are supported by specifying unit_test_param1 where 1 is number of parameter after filename. This property is an array of commands to run, so that different test runners can be used per project. Example for mocha framework with support for running single test method.

unit_single: ['mocha -A -u exports ./test/helper.js ./test/unit/**/<%= unit_test_filename %> --grep=<%= unit_test_param1 %>''],

Example:

grunt fh:testfile:testfile.js

fh:integrate

This target works the same as the fh:unit one above, with the exception that the property specifying the commands to run will be called integrate.

fh:accept

This target works the same as the fh:unit one above, with the exception that the property specifying the commands to run will be called accept.

fh:coverage

This target will compute the code coverage provided by unit and acceptance tests, and produce reports (both lcov and cobertura reports).

Like the unit/integrate/accept test targets, array properties specifying the commands to compute the coverage for each type of test, need to be included in your project's Gruntfile.js, just suffixed with _cover:

unit_cover: ['istanbul cover --dir cov-unit turbo --series=true -- ./test/unit'],
accept_cover: ['istanbul cover --dir cov-accept turbo --series=true -- --setUp ./test/globalSetupTeardown.js --tearDown ./test/globalSetupTeardown.js ./test/accept']

fh:analysis

This target will generate an HTML static analysis report using plato.

fh:shrinkwrap

This target is just a wrapper around npm cache clean && npm shrinkwrap. Its purpose is to reduce the amount of diff churn (esp. in the 'from' and 'resolved' fields after running npm shrinkwrap.

See https://www.npmjs.com/package/npm-shrinkwrap#reduce-diff-churn for details.