From adfeb87c8227ae553b0aad5bbe59bcb09e61e05f Mon Sep 17 00:00:00 2001 From: David Majda Date: Sun, 28 Oct 2012 12:12:00 +0200 Subject: [PATCH] Do not preprecess package.json Before this commit, package.json in the project root directory was preprocessed in order to insert correct version into it. This made it invalid JSON and thus unusable for npm purposes. This commit makes package.json a valid JSON by hardcoding the version into it. I think that introducing this small duplicity is outweighted by being able to use npm in project root directory. For example, it is now possible to make the "npm test" command work and introduce Travis CI integration. --- Makefile | 30 ++++++++++++++---------------- package.json | 2 +- 2 files changed, 15 insertions(+), 17 deletions(-) diff --git a/Makefile b/Makefile index 3115125..7d8932f 100644 --- a/Makefile +++ b/Makefile @@ -18,16 +18,14 @@ PARSER_OUT_FILE = $(SRC_DIR)/parser.js PEGJS_SRC_FILE = $(SRC_DIR)/peg.js PEGJS_LIB_FILE = $(LIB_DIR)/peg.js -PACKAGE_JSON_SRC_FILE = package.json -PACKAGE_JSON_DIST_FILE = $(DIST_NODE_DIR)/package.json - PEGJS_DIST_FILE_DEV = $(DIST_WEB_DIR)/peg-$(PEGJS_VERSION).js PEGJS_DIST_FILE_MIN = $(DIST_WEB_DIR)/peg-$(PEGJS_VERSION).min.js -CHANGELOG_FILE = CHANGELOG -LICENSE_FILE = LICENSE -README_FILE = README.md -VERSION_FILE = VERSION +PACKAGE_JSON_FILE = package.json +CHANGELOG_FILE = CHANGELOG +LICENSE_FILE = LICENSE +README_FILE = README.md +VERSION_FILE = VERSION # ===== Executables ===== @@ -108,16 +106,16 @@ dist: build # Node.js mkdir -p $(DIST_NODE_DIR) - cp -r \ - $(LIB_DIR) \ - $(BIN_DIR) \ - $(EXAMPLES_DIR) \ - $(CHANGELOG_FILE) \ - $(LICENSE_FILE) \ - $(README_FILE) \ - $(VERSION_FILE) \ + cp -r \ + $(LIB_DIR) \ + $(BIN_DIR) \ + $(EXAMPLES_DIR) \ + $(PACKAGE_JSON_FILE) \ + $(CHANGELOG_FILE) \ + $(LICENSE_FILE) \ + $(README_FILE) \ + $(VERSION_FILE) \ $(DIST_NODE_DIR) - $(PREPROCESS) $(PACKAGE_JSON_SRC_FILE) > $(PACKAGE_JSON_DIST_FILE) # Remove distribution file (created by "dist") distclean: diff --git a/package.json b/package.json index 427161a..0155ab8 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "pegjs", - "version": "@VERSION", + "version": "0.7.0", "description": "Parser generator for JavaScript", "homepage": "http://pegjs.majda.cz/", "author": {