Permalink
Browse files

version bump 0.8.1: fixes to support node 4+

- codepage updated to 1.6.0 (latest)
- clean up Makefile
- adapted .travis.yml to support 0.8
- removed test files that drifted from baseline
- removed XLSB pseudo-inverse tests due to fails in node 4+
1 parent 53f7f6d commit 2a756fffccc30bf6871d7f04ede61a6fef160555 @SheetJSDev SheetJSDev committed Dec 31, 2016
Showing with 369 additions and 276 deletions.
  1. +26 −0 .flowconfig
  2. +1 −0 .npmignore
  3. +8 −4 .travis.yml
  4. +1 −1 LICENSE
  5. +67 −56 Makefile
  6. +66 −52 README.md
  7. +2 −1 bin/xlsx.njs
  8. +1 −1 bits/00_header.js
  9. +1 −1 bits/01_version.js
  10. +1 −1 bower.json
  11. +1 −1 dist/LICENSE
  12. +88 −97 dist/cpexcel.js
  13. +1 −1 dist/ods.js
  14. +14 −13 dist/xlsx.core.min.js
  15. +1 −1 dist/xlsx.core.min.map
  16. +18 −17 dist/xlsx.full.min.js
  17. +1 −1 dist/xlsx.full.min.map
  18. +2 −2 dist/xlsx.js
  19. +10 −9 dist/xlsx.min.js
  20. +1 −1 dist/xlsx.min.map
  21. +1 −1 index.html
  22. +42 −0 misc/help.sh
  23. +1 −1 misc/spin.sh
  24. +2 −2 misc/strip_sourcemap.sh
  25. +1 −1 ods.js
  26. +1 −1 odsbits/00_header.js
  27. +3 −2 package.json
  28. +1 −1 test.js
  29. +1 −1 test_files
  30. +0 −1 tests.lst
  31. +2 −2 xlsx.js
  32. +1 −1 xlsxworker.js
  33. +1 −1 xlsxworker1.js
  34. +1 −1 xlsxworker2.js
View
@@ -0,0 +1,26 @@
+[ignore]
+.*/node_modules/.*
+.*/dist/.*
+.*/test.js
+
+.*/bits/.*
+.*/ctest/.*
+.*/misc/.*
+.*/perf/.*
+
+.*/demo/browser.js
+.*/shim.js
+
+[include]
+xlsx.js
+.*/bin/.*.njs
+.*/demo/browser.flow.js
+
+[libs]
+misc/flow.js
+misc/flowdeps.js
+
+[options]
+module.file_ext=.js
+module.file_ext=.njs
+
View
@@ -30,6 +30,7 @@ test.js
.jscs.json
.gitmodules
.travis.yml
+.flowconfig
bits/
odsbits/
tests/
View
@@ -1,11 +1,15 @@
language: node_js
node_js:
- - "iojs"
- - "0.11.14"
+ - "7"
+ - "6"
+ - "5"
+ - "4.2"
+ - "0.12"
- "0.10"
-# - "0.8" # commented because of npm issue with camelcase
+ - "0.8"
before_install:
- - "npm install -g mocha"
+ - "npm install -g npm@next"
+ - "npm install -g mocha voc"
- "npm install blanket"
- "npm install xlsjs"
- "npm install coveralls mocha-lcov-reporter"
View
@@ -1,4 +1,4 @@
-Copyright (C) 2012-2015 SheetJS
+Copyright (C) 2012-present SheetJS
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
View
@@ -1,15 +1,21 @@
+SHELL=/bin/bash
LIB=xlsx
FMT=xlsx xlsm xlsb ods xls xml misc full
REQS=jszip.js
ADDONS=dist/cpexcel.js
AUXTARGETS=ods.js
+CMDS=bin/xlsx.njs
+HTMLLINT=index.html
ULIB=$(shell echo $(LIB) | tr a-z A-Z)
DEPS=$(sort $(wildcard bits/*.js))
TARGET=$(LIB).js
+FLOWTARGET=$(LIB).flow.js
+
+## Main Targets
.PHONY: all
-all: $(TARGET) $(AUXTARGETS)
+all: $(TARGET) $(AUXTARGETS) ## Build library and auxiliary scripts
$(TARGET): $(DEPS)
cat $^ | tr -d '\15\32' > $@
@@ -21,96 +27,101 @@ bits/18_cfb.js: node_modules/cfb/dist/xlscfb.js
cp $^ $@
.PHONY: clean
-clean:
+clean: ## Remove targets and build artifacts
rm -f $(TARGET)
.PHONY: clean-data
clean-data:
rm -f *.xlsx *.xlsm *.xlsb *.xls *.xml
.PHONY: init
-init:
+init: ## Initial setup for development
git submodule init
git submodule update
git submodule foreach git pull origin master
git submodule foreach make
+ mkdir -p tmp
+
+.PHONY: dist
+dist: dist-deps $(TARGET) bower.json ## Prepare JS files for distribution
+ cp $(TARGET) dist/
+ cp LICENSE dist/
+ uglifyjs $(TARGET) -o dist/$(LIB).min.js --source-map dist/$(LIB).min.map --preamble "$$(head -n 1 bits/00_header.js)"
+ misc/strip_sourcemap.sh dist/$(LIB).min.js
+ uglifyjs $(REQS) $(TARGET) -o dist/$(LIB).core.min.js --source-map dist/$(LIB).core.min.map --preamble "$$(head -n 1 bits/00_header.js)"
+ misc/strip_sourcemap.sh dist/$(LIB).core.min.js
+ uglifyjs $(REQS) $(ADDONS) $(TARGET) -o dist/$(LIB).full.min.js --source-map dist/$(LIB).full.min.map --preamble "$$(head -n 1 bits/00_header.js)"
+ misc/strip_sourcemap.sh dist/$(LIB).full.min.js
+
+.PHONY: dist-deps
+dist-deps: ods.js ## Copy dependencies for distribution
+ cp node_modules/codepage/dist/cpexcel.full.js dist/cpexcel.js
+ cp jszip.js dist/jszip.js
+ cp ods.js dist/ods.js
+
+bower.json: misc/_bower.json package.json
+ cat $< | sed 's/_VERSION_/'`grep version package.json | awk '{gsub(/[^0-9a-z\.-]/,"",$$2); print $$2}'`'/' > $@
+
+.PHONY: aux
+aux: $(AUXTARGETS)
+
+.PHONY: ods
+ods: ods.js
+
+ODSDEPS=$(sort $(wildcard odsbits/*.js))
+ods.js: $(ODSDEPS) ## Build ODS support library
+ cat $(ODSDEPS) | tr -d '\15\32' > $@
+ cp ods.js dist/ods.js
+## Testing
+
.PHONY: test mocha
-test mocha: test.js
- mkdir -p tmp
+test mocha: test.js ## Run test suite
mocha -R spec -t 20000
-.PHONY: prof
-prof:
- cat misc/prof.js test.js > prof.js
- node --prof prof.js
-
+#* To run tests for one format, make test_<fmt>
TESTFMT=$(patsubst %,test_%,$(FMT))
.PHONY: $(TESTFMT)
$(TESTFMT): test_%:
FMTS=$* make test
+## Code Checking
+
.PHONY: lint
-lint: $(TARGET)
- jshint --show-non-errors $(TARGET) $(AUXTARGETS)
- jshint --show-non-errors package.json bower.json
- jscs $(TARGET) $(AUXTARGETS)
+lint: $(TARGET) ## Run jshint and jscs checks
+ @jshint --show-non-errors $(TARGET) $(AUXTARGETS)
+ @jshint --show-non-errors $(CMDS)
+ @jshint --show-non-errors package.json bower.json
+ @jshint --show-non-errors --extract=always $(HTMLLINT)
+ @jscs $(TARGET) $(AUXTARGETS)
-.PHONY: test-osx
-test-osx:
- node tests/write.js
- open -a Numbers sheetjs.xlsx
- open -a "Microsoft Excel" sheetjs.xlsx
+.PHONY: flow
+flow: lint ## Run flow checker
+ @flow check --all --show-all-errors
.PHONY: cov cov-spin
-cov: misc/coverage.html
-cov-spin:
- make cov & bash misc/spin.sh $$!
+cov: misc/coverage.html ## Run coverage test
+#* To run coverage tests for one format, make cov_<fmt>
COVFMT=$(patsubst %,cov_%,$(FMT))
.PHONY: $(COVFMT)
$(COVFMT): cov_%:
FMTS=$* make cov
misc/coverage.html: $(TARGET) test.js
- mocha --require blanket -R html-cov > $@
+ mocha --require blanket -R html-cov -t 20000 > $@
.PHONY: coveralls coveralls-spin
-coveralls:
- mocha --require blanket --reporter mocha-lcov-reporter | ./node_modules/coveralls/bin/coveralls.js
-
-coveralls-spin:
- make coveralls & bash misc/spin.sh $$!
-
-bower.json: misc/_bower.json package.json
- cat $< | sed 's/_VERSION_/'`grep version package.json | awk '{gsub(/[^0-9a-z\.-]/,"",$$2); print $$2}'`'/' > $@
-
-.PHONY: dist
-dist: dist-deps $(TARGET) bower.json
- cp $(TARGET) dist/
- cp LICENSE dist/
- uglifyjs $(TARGET) -o dist/$(LIB).min.js --source-map dist/$(LIB).min.map --preamble "$$(head -n 1 bits/00_header.js)"
- misc/strip_sourcemap.sh dist/$(LIB).min.js
- uglifyjs $(REQS) $(TARGET) -o dist/$(LIB).core.min.js --source-map dist/$(LIB).core.min.map --preamble "$$(head -n 1 bits/00_header.js)"
- misc/strip_sourcemap.sh dist/$(LIB).core.min.js
- uglifyjs $(REQS) $(ADDONS) $(TARGET) -o dist/$(LIB).full.min.js --source-map dist/$(LIB).full.min.map --preamble "$$(head -n 1 bits/00_header.js)"
- misc/strip_sourcemap.sh dist/$(LIB).full.min.js
+coveralls: ## Coverage Test + Send to coveralls.io
+ mocha --require blanket --reporter mocha-lcov-reporter -t 20000 | node ./node_modules/coveralls/bin/coveralls.js
-.PHONY: aux
-aux: $(AUXTARGETS)
-.PHONY: ods
-ods: ods.js
+.PHONY: help
+help:
+ @grep -hE '(^[a-zA-Z_-][ a-zA-Z_-]*:.*?|^#[#*])' $(MAKEFILE_LIST) | bash misc/help.sh
-ODSDEPS=$(sort $(wildcard odsbits/*.js))
-ods.js: $(ODSDEPS)
- cat $(ODSDEPS) | tr -d '\15\32' > $@
- cp ods.js dist/ods.js
-
-.PHONY: dist-deps
-dist-deps: ods.js
- cp node_modules/codepage/dist/cpexcel.full.js dist/cpexcel.js
- cp jszip.js dist/jszip.js
- cp ods.js dist/ods.js
+#* To show a spinner, append "-spin" to any target e.g. cov-spin
+%-spin:
+ @make $* & bash misc/spin.sh $$!
Oops, something went wrong.

1 comment on commit 2a756ff

@timruffles

🎉 great! :)

Please sign in to comment.