From b816790c6a207e1b8fa91c47838f56b08078ccac Mon Sep 17 00:00:00 2001 From: oger000 Date: Fri, 20 Jul 2018 10:54:27 +0200 Subject: [PATCH 1/2] switch build-tools to npm --- Makefile | 10 ---------- package.json | 9 +++++++-- 2 files changed, 7 insertions(+), 12 deletions(-) delete mode 100644 Makefile diff --git a/Makefile b/Makefile deleted file mode 100644 index 670c77e..0000000 --- a/Makefile +++ /dev/null @@ -1,10 +0,0 @@ -TEST = $(shell ls -S `find test -type f -name "*.test.js"`) - -test: - node --harmony ./node_modules/.bin/jison -m js ./src/sqlParser.jison -o ./dist/parser/sqlParser.js - cat src/stringify.js >> ./dist/parser/sqlParser.js - cat src/suffix.js >> ./dist/parser/sqlParser.js - ./node_modules/mocha/bin/mocha $(TEST) --require babel-register - -.PHONY: test - diff --git a/package.json b/package.json index 547dbc6..1fe3d7c 100644 --- a/package.json +++ b/package.json @@ -4,8 +4,12 @@ "description": "", "main": "./dist/parser/sqlParser.js", "scripts": { - "test": "make test", - "benchmark": "node test/benchmark.js" + "build": "jison -m js ./src/sqlParser.jison -o ./dist/parser/sqlParser.js && npm run build-concat", + "build-concat": "concat -o ./dist/parser/sqlParser.js ./dist/parser/sqlParser.js src/stringify.js src/suffix.js", + "postbuild": "npm run test:build", + "test:all": "mocha --require babel-register", + "test:build": "mocha 'test/*.test.js'", + "test:benchmark": "mocha test/benchmark.js" }, "repository": { "type": "git", @@ -25,6 +29,7 @@ "babel-preset-es2015": "^6.22.0", "babel-register": "^6.22.0", "benchmark": "^2.1.3", + "concat": "^1.0.3", "debug": "^3.1.0", "jison": "^0.4.17", "mocha": "^3.2.0" From 417841da9accd7ad4d26d5337b7f91a50c39c75f Mon Sep 17 00:00:00 2001 From: oger000 Date: Fri, 20 Jul 2018 11:43:51 +0200 Subject: [PATCH 2/2] give hint howto build --- README.md | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/README.md b/README.md index 52e214a..642fa81 100644 --- a/README.md +++ b/README.md @@ -54,6 +54,10 @@ var sql = sqlParser.stringify(ast); - ${value} like value place holder support. +## Build + +- Run `npm run build` to build the distributable. + ## LICENSE MIT