Replace Makefile with npm scripts

This commit is contained in:
Ray Schamp 2016-10-17 09:35:59 -04:00
parent 3bfd755e60
commit 3f4a244cbd
5 changed files with 19 additions and 43 deletions

6
.eslintignore Normal file
View file

@ -0,0 +1,6 @@
build/*
dist.js
node_modules/*
playground/*
vm.js
vm.min.js

View file

@ -1,34 +0,0 @@
ESLINT=./node_modules/.bin/eslint
NODE=node
TAP=./node_modules/.bin/tap
WEBPACK=./node_modules/.bin/webpack --progress --colors
WEBPACK_DEV_SERVER=./node_modules/.bin/webpack-dev-server
# ------------------------------------------------------------------------------
build:
$(WEBPACK)
watch:
$(WEBPACK) --watch
serve:
$(WEBPACK_DEV_SERVER)
# ------------------------------------------------------------------------------
lint:
$(ESLINT) ./src/*.js
$(ESLINT) ./src/**/*.js
$(ESLINT) ./test/**/*.js
test:
@make lint
$(TAP) ./test/{unit,integration}/*.js
coverage:
$(TAP) ./test/{unit,integration}/*.js --coverage --coverage-report=lcov
# ------------------------------------------------------------------------------
.PHONY: build lint test coverage benchmark serve

View file

@ -43,7 +43,7 @@ To run the Playground, make sure the dev server's running and go to [http://loca
## Standalone Build ## Standalone Build
```bash ```bash
make build npm run build
``` ```
```html ```html
@ -104,11 +104,11 @@ The VM's block representation contains all the important information for executi
## Testing ## Testing
```bash ```bash
make test npm test
``` ```
```bash ```bash
make coverage npm run coverage
``` ```
## Donate ## Donate

View file

@ -1,2 +0,0 @@
@echo off
node_modules\.bin\webpack-dev-server --host 0.0.0.0 --content-base .\playground

View file

@ -11,10 +11,16 @@
}, },
"main": "./dist.js", "main": "./dist.js",
"scripts": { "scripts": {
"prepublish": "./node_modules/.bin/webpack --bail", "build": "./node_modules/.bin/webpack --progress --colors --bail",
"start": "webpack-dev-server", "coverage": "./node_modules/.bin/tap ./test/{unit,integration}/*.js --coverage --coverage-report=lcov",
"build": "webpack --colors --progress", "lint": "./node_modules/.bin/eslint .",
"test": "make test", "prepublish": "npm run build",
"prepublish-watch": "npm run watch",
"start": "./node_modules/.bin/webpack-dev-server",
"tap-integration": "./node_modules/.bin/tap ./test/integration/*.js",
"tap-unit": "./node_modules/.bin/tap ./test/unit/*.js",
"test": "npm run lint && npm run tap-unit && npm run tap-integration",
"watch": "./node_modules/.bin/webpack --progress --colors --watch",
"version": "./node_modules/.bin/json -f package.json -I -e \"this.repository.sha = '$(git log -n1 --pretty=format:%H)'\"" "version": "./node_modules/.bin/json -f package.json -I -e \"this.repository.sha = '$(git log -n1 --pretty=format:%H)'\""
}, },
"devDependencies": { "devDependencies": {