
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
thehelp-project
Advanced tools
Gets high quality grunt-based project automation in place very quickly
I don't expect to make any more updates to this project, but by all means continue to use it if it helps you out! Also, let's talk if you'd like to jump in and help maintain it!
This project is designed to get high quality grunt-based project automation in place very quickly, with just one entry in your package.json.
time-grunt, tracking how long your grunt tasks takeenv, loading environment variables from env.jsonmocha-cli for 'unit', 'integration' and 'manual' tasks, running mocha tests underneath 'test/' excluding the 'client' subdirectorygrunt-mocha-istanbul when --coverage option is providedjshint and complexityjscsjsonlintgroc (with a few stylesheet tweaks)watch core setup and subtasks for tests, static analysis, style and documentation generationmodifiedInLast())clean, deleting everything under 'public/', 'tmp/', and 'dist/' by default, and extended to include files under 'doc/' along with documentation generation setupFirst, install the project as a dev dependency:
npm install thehelp-project --save-dev
Then make sure you have the grunt installed locally and the grunt command available:
npm install grunt --save-dev
npm install -g grunt-cli
The easiest way to use this project is to take all the defaults. To do that, you can use this as your whole Gruntfile:
var GruntConfig = require('thehelp-project').GruntConfig;
module.exports = function(grunt) {
var config = new GruntConfig(grunt);
config.standardSetup();
config.standardDefault();
};
With just that you've got quite a few new grunt tasks available to you! You can take a look by typing grunt --help, or you can just type grunt and the default task will do quite a bit. But you may want to do a little more setup first...
To use all the defaults you'll have to structure your project the way thehelp-project expects:
├ README.md becomes doc/index.html
├ FILENAME.md becomes doc/FILENAME.html
├ env.json environment variables needed by your project
├ src/ core source files
├ tasks/ any grunt tasks your project exposes
├ docs/ all groc-generated doc files added here
├ coverage/ istanbul code coverage reports generated here
└ test/
├ unit/ unit tests
│ └ client/ files under client/ in all three test directories are excluded
├ integration/ integration tests
└ manual/ manual tests (will not be run as part of 'grunt test')
Put some mocha tests in place, then try these commands:
grunt unit
grunt integration
grunt manual
# just unit and integration tests
grunt test
# all three types of tests
grunt test-all
grunt test --bail
grunt test --grep searchPattern
grunt test --reporter nyan
grunt test-all --coverage
grunt test --coverage=true --bail
This last option will collect code coverage into the coverage directory, using a different, slower-starting grunt task. To customize the files instrumented for code coverage, provide custom options to the test command setup:
config.standardSetup({
test: {
exclusions: ['src/legacy/**/*.js']
}
});
Note: when combining boolean options, be sure to include =true after any option which is followed by another option. grunt won't pick up the second option; it will be considered the value for the preceding option.
npm install blanket --save-dev
In your package.json you'll need some configuration information to let blanket know which files you want to instrument for code coverage. I usually use something like this:
{
"config": {
"blanket": {
"data-cover-only": "src",
"data-cover-never": "['lib/','node_modules/','test/','src/client']"
}
}
}
For static analysis delivered by jshint and complexity:
grunt sa
grunt staticanalysis
For code style checking, delivered by jscs:
grunt style
To ensure that all *.json files in the root directory of your project are well-formed:
grunt jsonlint
groc generates html files from markdown in your source files' comments. Take a look at the docs for this project for an example: https://thehelp.github.com/project (navigation in the top-right).
grunt doc
# automatically publishes generated docs to github pages
grunt doc --publish-docs
Some tips:
/* ... */) then you can use lists and other multiline constructs. Use something other than * for list delimiters./*jshint camelcase: false */)groc generates to your target directory normally, it will generate into the root when publishing to github pages. For example, your readme/index.html will be in the root directory.Three directories are registered by default: 'dist/', 'tmp/', and 'public/'. If you set documentation generation up with standardSetup() or call registerDoc() a fourth directory will be added: 'doc/'
grunt clean
grunt clean:tmp
grunt clean:dist
grunt clean:public
grunt clean:doc
Five sub-tasks are supported for the watch file-watching task from grunt-contrib-watch:
Because, for large projects, you may not want to run these entire tasks every time one file changes, a partial option is available which limits the set of files to the set modified in the last N minutes.
grunt watch:staticanalysis
grunt watch:doc --partial 3
grunt watch:unit
# note: when filtering, you'll need to modify the test files
grunt watch:unit --partial 3
The first level of customization is adding to what thehelp-project provides. For example, if you'd like to add a new clean target, you can add to its grunt configuration with a targeted update:
grunt.config('clean.build', {
src: ['build/**/*']
})
The next step is changing things by passing data to standardSetup(). For example, if you'd like to provide your own jshint and jscs rules, you can do this to load your own local config files:
config.standardSetup({
staticAnalysis: {
jshintrc: '.jshintrc'
},
style: {
jscsrc: '.jscsrc'
}
})
If you would like to eliminate setup for a given task completely, you can always bypass the standardSetup() function. This example just loads what it needs - it will add its own test-related tasks later:
this.setupTimeGrunt();
this.registerWatch();
this.registerEnv();
this.registerClean();
this.registerStaticAnalysis();
this.registerStyle();
this.registerDoc();
Detailed docs be found at this project's GitHub Pages, thanks to groc: http://thehelp.github.io/project/src/server/grunt_config.html
I have a lot of projects. For a while I was using a large collection of shell scripts to give me all the project automation I needed, but that was constly to maintain. Big dependency lists in package.json, a lot of file copying to start a new project, and a pain to roll out a new feature to all projects.
When I started playing with grunt, I realized that I could radically improve my approach here, now that we were in code. One unit to pull down, and quite a few things would be in place immediately.
The goal of thehelp-project is to encompass basic project automation which all node projects might want. Nothing specific to the client side, or servers, or full web applications. Just node: node modules, command-line utilities, etc.
I've been using this code in some form since September 2013, and in its current form since November 2013. I'm using it in something like 15 projects, so I feel all breaking changes. I plan to follow semver like this:
Possible changes on the horizon (as of 2014-06-22):
groc's jsdoc-style keyword support (mostly for this project's documentation; no changes to this project should be needed)Use Github Issues for feature requests and bugs. Use StackOverflow for troubleshooting. For discussion about the future of TheHelp, new projects, big new features, join the mailing list.
First, you'll need a file 'env.json' in your root directory with contents like this:
{
"VAR": "value"
}
When you have some changes ready, please submit a pull request with:
groc-generated HTML too.I may ask you to use a git rebase to ensure that your commits are not interleaved with commits already in the history. And of course, make sure grunt completes successfully. :0)
Lastly, this project is really just a collection of other open-source projects. Many thanks to everyone before me who has provided such value to the community. I hope to continue that fine tradition.
(The MIT License)
Copyright (c) 2013 Scott Nonnenberg <scott@nonnenberg.com>
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the 'Software'), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
FAQs
Gets high quality grunt-based project automation in place very quickly
The npm package thehelp-project receives a total of 9 weekly downloads. As such, thehelp-project popularity was classified as not popular.
We found that thehelp-project demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.