clean up builds

This commit is contained in:
Josh Junon 2018-09-10 23:45:28 -06:00
parent 9f4f8f59ba
commit 3ca23316a4
4 changed files with 22 additions and 40 deletions

View File

@ -1,15 +0,0 @@
support
test
examples
example
*.sock
dist
yarn.lock
coverage
bower.json
.coveralls.yml
.eslintrc
.travis.yml
.npmignore
karma.conf.js
Makefile

View File

@ -1,47 +1,39 @@
# get Makefile directory name: http://stackoverflow.com/a/5982798/376773
# http://stackoverflow.com/a/5982798/376773
THIS_MAKEFILE_PATH:=$(word $(words $(MAKEFILE_LIST)),$(MAKEFILE_LIST))
THIS_DIR:=$(shell cd $(dir $(THIS_MAKEFILE_PATH));pwd)
# BIN directory
BIN := $(THIS_DIR)/node_modules/.bin
# Path
PATH := node_modules/.bin:$(PATH)
export PATH := $(THIS_DIR)/node_modules/.bin:$(PATH)
SHELL := /bin/bash
# applications
BROWSERIFY ?= $(BIN)/browserify
all: lint test
browser: dist/debug.js dist/test.js
dist: dist/debug.js dist/test.js
dist/debug.js: src/*.js
.INTERMEDIATE: dist/debug.es6.js
dist/debug.es6.js: src/*.js
@mkdir -p dist
@$(BROWSERIFY) --standalone debug . > $@.es6.js
@babel $@.es6.js > $@
@rm $@.es6.js
browserify --standalone debug $< > $@
dist/debug.js: dist/debug.es6.js
@mkdir -p dist
babel $< > $@
dist/test.js: test.js
@mkdir -p dist
@cp $< $@.es6.js
@babel $@.es6.js > $@
@rm $@.es6.js
babel $< > $@
lint:
@xo
xo
test-node:
@istanbul cover node_modules/mocha/bin/_mocha -- test.js
istanbul cover node_modules/mocha/bin/_mocha -- test.js
@cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js
test-browser:
@$(MAKE) browser
@karma start --single-run
test-browser: dist
karma start --single-run
test: test-node test-browser
clean:
rm -rf dist coverage
.PHONY: all browser install clean lint test test-node test-browser
.PHONY: all dist clean lint test test-node test-browser

View File

@ -1 +0,0 @@
module.exports = require('./src/node');

View File

@ -11,6 +11,12 @@
"log",
"debugger"
],
"files": [
"src",
"dist/debug.js",
"LICENSE",
"README.md"
],
"author": "TJ Holowaychuk <tj@vision-media.ca>",
"contributors": [
"Nathan Rajlich <nathan@tootallnate.net> (http://n8.io)",