Requirements: Node v5+ / NPM 3+
Provides a unified environment combining the following set of NPM modules / scripts and dependencies for building, documenting, and testing ES6 NPM modules including instrumentation of JSPM / SystemJS tests for TyphonJS and beyond:
- typhonjs-istanbul-instrument-jspm
- typhonjs-npm-scripts-build-babel
- typhonjs-npm-scripts-publish
- typhonjs-npm-scripts-test-mocha
- typhonjs-npm-scripts-runner
Please refer to the above NPM modules for documentation regarding expanded configuration details specific to each script.
All TyphonJS NPM script modules use .npmscriptrc
found in the root path to store JSON formatted configuration parameters.
One can also use .npmscriptrc.js
which will be required and must be CSJ formatted outputting an object via
module.exports
. It should be noted that this NPM module requires NPM 3.0+ as flat packages for the ./node_modules
directory is necessary to easily import the NPM modules linked by typhonjs-npm-build-test
.
For the latest significant changes please see the CHANGELOG.
Please be aware of a 0.7.0 breaking change as babel-preset-latest has been swapped out for babel-preset-env.
Please be aware of a 0.5.0 breaking change as typhonjs-node-esdoc has been removed, so ESDoc is no longer available. Please check out with TJSDoc (the spiritual successor to ESDoc).
Please be aware of a 0.2.0 breaking change in typhonjs-npm-scripts-test-mocha
To configure all scripts included in typhonjs-npm-build-test
provide this entry in package.json
scripts entry:
"devDependencies": {
"typhonjs-npm-build-test": "^0.7.0"
},
"scripts": {
"build": "babel-node ./node_modules/typhonjs-npm-scripts-build-babel/scripts/build.js",
"eslint": "eslint .",
"prepublish": "babel-node ./node_modules/typhonjs-npm-scripts-publish/scripts/prepublish.js",
"test": "babel-node ./node_modules/typhonjs-npm-scripts-test-mocha/scripts/mocha.js",
"test-coverage": "babel-node ./node_modules/typhonjs-npm-scripts-test-mocha/scripts/mocha-istanbul.js"
},
The following is a standard .npmscriptrc
file that all TyphonJS NPM modules use:
{
"build":
{
"babel": { "source": "src", "destination": "dist" }
},
"publish":
{
"prepublish": { "scripts": [ "npm run eslint", "npm run test", "npm run build" ] }
},
"test":
{
// Provides a report handling command that is executed after running tests / coverage when running on Travis CI.
"travis":
{
"report": "./node_modules/.bin/codecov",
"istanbul": { "command": "cover", "options": [ "--report lcovonly" ] }
},
"istanbul": { "command": "cover" },
"mocha": { "source": "./test/src", "options": [ "--compilers js:babel-register", "-t 120000 --recursive" ] }
}
}
Please note that you can add comments to .npmscriptrc
.