@rowanmanning/make v2.3.0
Make
Reusable Makefiles for my open source projects.
Usage
Install with:
npm install --save-dev @rowanmanning/makeCreate a Makefile in the root of your project and add the boilerplate content:
# Reusable Makefile
# ------------------------------------------------------------------------
# This section of the Makefile should not be modified, it includes
# commands from my reusable Makefile: https://github.com/rowanmanning/make
include node_modules/@rowanmanning/make/<LANGUAGE>/index.mk
# [edit below this line]
# ------------------------------------------------------------------------where <LANGUAGE> is one of the following:
- javascript
Now you can use the following commands, based on which language you choose.
JavaScript
Commands
all: Run theinstallandcitasks.ci: Run theverifyandtesttasks.clean: Cleans the working directory. Relies ongit.install: Runsnpm installbut only ifpackage.jsonhas changed more recently than thenode_modulesfolder. This speeds up installing to be instant if nothing needs doing. This task also prunes extra dependencies.env: Copies asample.envfile to.envif the sample file exists.verify: Run theverify-javascriptandverify-dusttasks.verify-javascript: Run theverify-eslint,verify-jshint, andverify-jscstasks.verify-dust: If an.dustmitercfile is present in the project root, run Dustmite against the code.verify-eslint: If an.eslintrcfile is present in the project root, run ESLint against the code.verify-jscs: If a.jscsrcfile is present in the project root, run JSCS against the code.verify-jshint: If a.jshintrcfile is present in the project root, run JSHint against the code.verify-coverage: If acoverage/lcov-reportfolder is present in the project root and thenycmodule is installed, check that coverage is above90%. This is configurable by specifyingexport EXPECTED_COVERAGE := <value>in your dependant Makefile.test: Run thetest-unit-coverage,verify-coverage, andtest-integrationtasks.test-unit: If atest/unitfolder is present in the project root, run Mocha recursively on any files that end in.test.js.test-unit-coverage: If atest/unitfolder is present in the project root and thenycmodule is installed, run Mocha recursively on any files that end in.test.jswith coverage reporting. Ifnycis not present, fall back to runningmake test-unittest-integration: If atest/integrationfolder is present in the project root, run Mocha recursively on any files that end in.test.js.publish-npm: If anNPM_PUBLISH_TAG(orCIRCLE_TAG/TRAVIS_TAG), and anNPM_AUTH_TOKENenvironment variable is present, publish the module to npm.
Helpers
The
TASK_DONEoutput helper allows you to quickly output a check-marked notice after a task has completed successfully. Just add it to your own tasks like this:mytask: @do something @$(TASK_DONE)The folder
./node_modules/.binis added to thePATHenvironment variable so that you don't need to explicitly reference it in calls to further commands.
License
ESLint Config is licensed under the MIT license. Copyright © 2017, Rowan Manning