From 395ea31e951ac1863484fb4df34f1f0469cd0ea3 Mon Sep 17 00:00:00 2001 From: SheetJS Date: Sat, 29 Apr 2017 13:30:52 -0400 Subject: [PATCH] version bump 1.0.6: module cleanup --- .eslintrc | 19 ++++++++ .flowconfig | 2 + .npmignore | 6 +++ .travis.yml | 4 +- Makefile | 14 +++++- README.md | 13 ++++- index.html | 134 +++++++++++++++++++++++++++------------------------ package.json | 3 +- 8 files changed, 124 insertions(+), 71 deletions(-) create mode 100644 .eslintrc diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..8ae8c66 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,19 @@ +{ + "env": { "shared-node-browser":true }, + "globals": {}, + "parserOptions": { + "ecmaVersion": 3, + }, + "plugins": [ "html", "json" ], + "rules": { + "no-use-before-define": [ 1, { + "functions":false, "classes":true, "variables":true + }], + "no-bitwise": 0, + "curly": 0, + "comma-style": [ 2, "last" ], + "no-trailing-spaces": 2, + "semi": [ 2, "always" ], + "comma-dangle": [ 2, "never" ] + } +} diff --git a/.flowconfig b/.flowconfig index b7e9ace..a82f30c 100644 --- a/.flowconfig +++ b/.flowconfig @@ -1,6 +1,8 @@ [ignore] .*/node_modules/.* .*/dist/.* +.*/ctest/mocha.js +.*/ctest/sauce.* .*/test.js .*/frac.js diff --git a/.npmignore b/.npmignore index 9c37b08..874d256 100644 --- a/.npmignore +++ b/.npmignore @@ -1,5 +1,9 @@ test_files/*.tsv +ctest/ +test.js +Makefile .gitignore +.npmignore node_modules/ coverage.html .travis.yml @@ -13,3 +17,5 @@ build/ MANIFEST *.gz *.tgz +*.py +*.html diff --git a/.travis.yml b/.travis.yml index 65ece8c..656779e 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,8 +8,8 @@ node_js: - "0.10" - "0.8" before_install: - - "npm install -g npm@next" - - "npm install -g mocha voc" + - "npm install -g npm@4.3.0" + - "npm install -g mocha@2.x voc" - "npm install blanket" - "npm install coveralls mocha-lcov-reporter" after_success: diff --git a/Makefile b/Makefile index 3213830..59b031d 100644 --- a/Makefile +++ b/Makefile @@ -2,12 +2,15 @@ LIB=frac REQS= ADDONS= AUXTARGETS= +CMDS= HTMLLINT=index.html ULIB=$(shell echo $(LIB) | tr a-z A-Z) DEPS=$(LIB).md TARGET=$(LIB).js FLOWTARGET=$(LIB).flow.js +UGLIFYOPTS=--support-ie8 +CLOSURE=/usr/local/lib/node_modules/google-closure-compiler/compiler.jar ## Main Targets @@ -40,11 +43,18 @@ ctestserv: ## Start a test server on port 8000 @cd ctest && python -mSimpleHTTPServer .PHONY: lint -lint: $(TARGET) $(AUXTARGETS) ## Run jshint and jscs checks +lint: $(TARGET) $(AUXTARGETS) ## Run eslint checks + @eslint --ext .js,.njs,.json,.html,.htm $(TARGET) $(AUXTARGETS) $(CMDS) $(HTMLLINT) package.json bower.json + if [ -e $(CLOSURE) ]; then java -jar $(CLOSURE) $(REQS) $(FLOWTARGET) --jscomp_warning=reportUnknownTypes >/dev/null; fi + +.PHONY: old-lint +old-lint: $(TARGET) $(AUXTARGETS) ## Run jshint and jscs checks @jshint --show-non-errors $(TARGET) $(AUXTARGETS) + @jshint --show-non-errors $(CMDS) @jshint --show-non-errors package.json @jshint --show-non-errors --extract=always $(HTMLLINT) @jscs $(TARGET) $(AUXTARGETS) + if [ -e $(CLOSURE) ]; then java -jar $(CLOSURE) $(REQS) $(FLOWTARGET) --jscomp_warning=reportUnknownTypes >/dev/null; fi .PHONY: flow flow: lint ## Run flow checker @@ -64,7 +74,7 @@ coveralls: ## Coverage Test + Send to coveralls.io dist: dist-deps $(TARGET) ## 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 frac.js)" + uglifyjs $(UGLIFYOPTS) $(TARGET) -o dist/$(LIB).min.js --source-map dist/$(LIB).min.map --preamble "$$(head -n 1 frac.js)" misc/strip_sourcemap.sh dist/$(LIB).min.js .PHONY: aux diff --git a/README.md b/README.md index 9fb959d..7d2e531 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,8 @@ Uses the [Mediant Method](https://en.wikipedia.org/wiki/Mediant_method). This module also provides an implementation of the continued fraction method as described by Aberth in "A method for exact computation with rational numbers". - +The algorithm is used in SheetJS Libraries to +replicate fraction formats. ## Installation @@ -109,12 +110,20 @@ The test TSV baselines in the `test_files` directory have four columns: ## License Please consult the attached LICENSE file for details. All rights not explicitly -granted by the Apache 2.0 license are reserved by the Original Author. +granted by the Apache 2.0 License are reserved by the Original Author. ## Badges +[![Build Status](https://saucelabs.com/browser-matrix/frac.svg)](https://saucelabs.com/u/frac) + [![Build Status](https://travis-ci.org/SheetJS/frac.svg?branch=master)](https://travis-ci.org/SheetJS/frac) [![Coverage Status](http://img.shields.io/coveralls/SheetJS/frac/master.svg)](https://coveralls.io/r/SheetJS/frac?branch=master) +[![NPM Downloads](https://img.shields.io/npm/dt/frac.svg)](https://npmjs.org/package/frac) + +[![Dependencies Status](https://david-dm.org/sheetjs/frac/status.svg)](https://david-dm.org/sheetjs/frac) + +[![ghit.me](https://ghit.me/badge.svg?repo=sheetjs/js-xlsx)](https://ghit.me/repo/sheetjs/js-xlsx) + [![Analytics](https://ga-beacon.appspot.com/UA-36810333-1/SheetJS/frac?pixel)](https://github.com/SheetJS/frac) diff --git a/index.html b/index.html index 6b1d8a1..b7cb309 100644 --- a/index.html +++ b/index.html @@ -1,16 +1,21 @@ - + - - Fraction Live Demo - - - - Fraction Live Demo
- Source Code
- Issues? Something look weird? Click here and report an issue
-
+ + +Fraction Live Demo + + + +
+SheetJS Fraction Live Demo
+
+Source Code Repo
+Issues?  Something look weird?  Click here and report an issue
+
@@ -19,62 +24,63 @@
Number:
Denominator Digits:
Mediant Fraction:
Aberth Fraction:
- - + - + + (function() { + var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true; + ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js'; + var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s); + })(); + + - diff --git a/package.json b/package.json index 0b0c5c7..45b5bd5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "frac", - "version": "1.0.5", + "version": "1.0.6", "author": "SheetJS", "description": "Rational approximation with bounded denominator", "keywords": [ "math", "fraction", "rational", "approximation" ], @@ -20,6 +20,7 @@ "pattern": "frac.js" } }, + "homepage": "http://oss.sheetjs.com/frac", "bugs": { "url": "https://github.com/SheetJS/frac/issues" }, "license": "Apache-2.0", "engines": { "node": ">=0.8" }