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.
redux
David Majda 12 years ago
parent b1db42e1b4
commit adfeb87c82

@ -18,16 +18,14 @@ PARSER_OUT_FILE = $(SRC_DIR)/parser.js
PEGJS_SRC_FILE = $(SRC_DIR)/peg.js PEGJS_SRC_FILE = $(SRC_DIR)/peg.js
PEGJS_LIB_FILE = $(LIB_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_DEV = $(DIST_WEB_DIR)/peg-$(PEGJS_VERSION).js
PEGJS_DIST_FILE_MIN = $(DIST_WEB_DIR)/peg-$(PEGJS_VERSION).min.js PEGJS_DIST_FILE_MIN = $(DIST_WEB_DIR)/peg-$(PEGJS_VERSION).min.js
CHANGELOG_FILE = CHANGELOG PACKAGE_JSON_FILE = package.json
LICENSE_FILE = LICENSE CHANGELOG_FILE = CHANGELOG
README_FILE = README.md LICENSE_FILE = LICENSE
VERSION_FILE = VERSION README_FILE = README.md
VERSION_FILE = VERSION
# ===== Executables ===== # ===== Executables =====
@ -108,16 +106,16 @@ dist: build
# Node.js # Node.js
mkdir -p $(DIST_NODE_DIR) mkdir -p $(DIST_NODE_DIR)
cp -r \ cp -r \
$(LIB_DIR) \ $(LIB_DIR) \
$(BIN_DIR) \ $(BIN_DIR) \
$(EXAMPLES_DIR) \ $(EXAMPLES_DIR) \
$(CHANGELOG_FILE) \ $(PACKAGE_JSON_FILE) \
$(LICENSE_FILE) \ $(CHANGELOG_FILE) \
$(README_FILE) \ $(LICENSE_FILE) \
$(VERSION_FILE) \ $(README_FILE) \
$(VERSION_FILE) \
$(DIST_NODE_DIR) $(DIST_NODE_DIR)
$(PREPROCESS) $(PACKAGE_JSON_SRC_FILE) > $(PACKAGE_JSON_DIST_FILE)
# Remove distribution file (created by "dist") # Remove distribution file (created by "dist")
distclean: distclean:

@ -1,6 +1,6 @@
{ {
"name": "pegjs", "name": "pegjs",
"version": "@VERSION", "version": "0.7.0",
"description": "Parser generator for JavaScript", "description": "Parser generator for JavaScript",
"homepage": "http://pegjs.majda.cz/", "homepage": "http://pegjs.majda.cz/",
"author": { "author": {

Loading…
Cancel
Save