Merge pull request #276 from rschamp/Makefile--

Replace Makefile with npm scripts
This commit is contained in:
Ray Schamp 2016-10-18 09:44:32 -04:00 committed by GitHub
commit 4cb680c047
6 changed files with 51 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

32
.gitattributes vendored Normal file
View file

@ -0,0 +1,32 @@
# Set the default behavior, in case people don't have core.autocrlf set.
* text=auto
# Explicitly specify line endings for as many files as possible.
# People who (for example) rsync between Windows and Linux need this.
# File types which we know are binary
# Prefer LF for most file types
*.frag text eol=lf
*.htm text eol=lf
*.html text eol=lf
*.iml text eol=lf
*.js text eol=lf
*.js.map text eol=lf
*.json text eol=lf
*.md text eol=lf
*.vert text eol=lf
*.xml text eol=lf
# Prefer LF for these files
.editorconfig text eol=lf
.eslintrc text eol=lf
.gitattributes text eol=lf
.gitignore text eol=lf
.gitmodules text eol=lf
LICENSE text eol=lf
Makefile text eol=lf
README text eol=lf
TRADEMARK text eol=lf
# Use CRLF for Windows-specific file types

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": {