From 6f5bc856ed09a86a528d14d45e1b824d86506ad5 Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Tue, 3 Jan 2017 21:37:15 -0500 Subject: [PATCH 1/6] Update gltf-pipeline and general project cleanup --- .gitignore | 10 ++++++---- .npmignore | 3 ++- .travis.yml | 7 ++++++- CHANGES.md | 5 +++++ gulpfile.js | 2 +- package.json | 42 +++++++++++++++++++++++------------------- 6 files changed, 43 insertions(+), 26 deletions(-) diff --git a/.gitignore b/.gitignore index ad27f7b..b04cad6 100644 --- a/.gitignore +++ b/.gitignore @@ -2,14 +2,16 @@ node_modules npm-debug.log +# TypeScript definitions +typings + # WebStorm user-specific .idea/workspace.xml .idea/tasks.xml -# TypeScript definitions -typings - # Generate data -test coverage +doc +output +test *.tgz diff --git a/.npmignore b/.npmignore index 1fe05bd..dec66d7 100644 --- a/.npmignore +++ b/.npmignore @@ -1,9 +1,10 @@ /.idea +/coverage /doc +/output /specs /test /typings -/coverage .jshintrc .npmignore .travis.yml diff --git a/.travis.yml b/.travis.yml index a73b51f..32c35f7 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,6 +1,11 @@ language: node_js node_js: - - 4 + - "4" + - "6" script: - npm run jsHint -- --failTaskOnError - npm run test -- --failTaskOnError --suppressPassed +after_success: +## We only need to run coveralls for one node version (doesn't matter which one). +## We also ignore publishing failures, since restarting an existing travis build would otherwise break. + - if node --version | grep -q ^v6 ; npm run coveralls ; fi diff --git a/CHANGES.md b/CHANGES.md index 110fada..0584792 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,6 +1,11 @@ Change Log ========== +### 0.1.7 2017-01-03 + +* Update gltf-pipeline to 0.1.0-alpha9 +* Added command to generate documentation (npm run jsdoc) + ### 0.1.6 2016-09-07 * Changed obj2gltf.js line endings from CRLF to LF in npm package. diff --git a/gulpfile.js b/gulpfile.js index f479227..66d574e 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -20,7 +20,7 @@ var environmentSeparator = process.platform === 'win32' ? ';' : ':'; var nodeBinaries = path.join(__dirname, 'node_modules', '.bin'); process.env.PATH += environmentSeparator + nodeBinaries; -var jsHintFiles = ['**/*.js', '!node_modules/**', '!coverage/**']; +var jsHintFiles = ['**/*.js', '!node_modules/**', '!coverage/**', '!doc/**']; var specFiles = ['**/*.js', '!node_modules/**', '!coverage/**']; gulp.task('jsHint', function () { diff --git a/package.json b/package.json index 75a2b70..5a56146 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "obj2gltf", - "version": "0.1.6", + "version": "0.1.7", "description": "Convert OBJ model format to glTF", "license": "Apache-2.0", "contributors": [ @@ -26,33 +26,37 @@ "node": ">=4.0.0" }, "dependencies": { - "async": "2.1.2", - "bluebird": "3.4.6", - "byline": "5.0.0", - "cesium": "1.26.0", - "fs-extra": "0.30.0", - "gltf-pipeline": "0.1.0-alpha8", - "yargs": "6.3.0" + "async": "^2.1.4", + "bluebird": "^3.4.7", + "byline": "^5.0.0", + "cesium": "^1.29.0", + "fs-extra": "^1.0.0", + "gltf-pipeline": "^0.1.0-alpha9", + "yargs": "^6.6.0" }, "devDependencies": { - "gulp": "3.9.1", - "gulp-jshint": "2.0.2", - "istanbul": "0.4.5", - "jasmine": "2.5.2", - "jasmine-spec-reporter": "2.7.0", - "jshint": "2.9.4", - "jshint-stylish": "2.2.1", - "open": "0.0.5", - "requirejs": "2.3.2", - "typings": "1.4.0" + "coveralls": "^2.11.15", + "gulp": "^3.9.1", + "gulp-jshint": "^2.0.4", + "istanbul": "^0.4.5", + "jasmine": "^2.5.2", + "jasmine-spec-reporter": "^3.0.0", + "jsdoc": "^3.4.3", + "jshint": "^2.9.4", + "jshint-stylish": "^2.2.1", + "open": "^0.0.5", + "requirejs": "^2.3.2", + "typings": "^2.1.0" }, "scripts": { "prepublish": "typings install", + "jsdoc": "jsdoc ./lib -R ./README.md -d doc", "jsHint": "gulp jsHint", "jsHint-watch": "gulp jsHint-watch", "test": "gulp test", "test-watch": "gulp test-watch", - "coverage": "gulp coverage" + "coverage": "gulp coverage", + "coveralls": "cat ./coverage/lcov.info | ./node_modules/.bin/coveralls" }, "bin": { "obj2gltf": "./bin/obj2gltf.js" From b91e0e87310a59ac7359a91983f4dcff42ce38ae Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Wed, 4 Jan 2017 13:10:51 -0500 Subject: [PATCH 2/6] Jasmine spec reporter fix --- gulpfile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gulpfile.js b/gulpfile.js index 66d574e..c40039d 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -6,7 +6,7 @@ var fsExtra = require('fs-extra'); var gulp = require('gulp'); var gulpJshint = require('gulp-jshint'); var Jasmine = require('jasmine'); -var JasmineSpecReporter = require('jasmine-spec-reporter'); +var SpecReporter = require('jasmine-spec-reporter').SpecReporter; var open = require('open'); var path = require('path'); var yargs = require('yargs'); @@ -42,7 +42,7 @@ gulp.task('jsHint-watch', function () { gulp.task('test', function (done) { var jasmine = new Jasmine(); jasmine.loadConfigFile('specs/jasmine.json'); - jasmine.addReporter(new JasmineSpecReporter({ + jasmine.addReporter(new SpecReporter({ displaySuccessfulSpec: !defined(argv.suppressPassed) || !argv.suppressPassed })); jasmine.execute(); From b382a6374e86ac66381e077ded171e12e7a93654 Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Fri, 6 Jan 2017 11:36:44 -0500 Subject: [PATCH 3/6] Updated README and LICENSE --- LICENSE.md | 26 ++++++++++++++++++++++++++ README.md | 39 +++++++++++++++++++++++++++++++++++++++ 2 files changed, 65 insertions(+) diff --git a/LICENSE.md b/LICENSE.md index 8938747..abfee94 100644 --- a/LICENSE.md +++ b/LICENSE.md @@ -35,6 +35,32 @@ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. +### bluebird + +https://www.npmjs.com/package/bluebird + +> The MIT License (MIT) +> +> Copyright (c) 2013-2015 Petka Antonov +> +> Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: +> +> The above copyright notice and this permission notice shall be included in +all copies or substantial portions of the Software. +> +> THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN +THE SOFTWARE. + ### byline https://www.npmjs.com/package/byline diff --git a/README.md b/README.md index f1e7784..4469ba5 100644 --- a/README.md +++ b/README.md @@ -45,6 +45,45 @@ Using obj2gltf as a command-line tool: |`--ao`|Apply ambient occlusion to the converted model.|No, default `false`| |`-h`|Display help|No| +## Build Instructions + +Run the tests: +``` +npm run test +``` +To run JSHint on the entire codebase, run: +``` +npm run jsHint +``` +To run JSHint automatically when a file is saved, run the following and leave it open in a console window: +``` +npm run jsHint-watch +``` + +### Running Test Coverage + +Coverage uses [istanbul](https://github.com/gotwarlost/istanbul). Run: +``` +npm run coverage +``` +For complete coverage details, open `coverage/lcov-report/index.html`. + +The tests and coverage covers the Node.js module; it does not cover the command-line interface, which is tiny. + +## Generating Documentation + +To generate the documentation: +``` +npm run jsdoc +``` + +The documentation will be placed in the `doc` folder. + +### Debugging + +* To debug the tests in Webstorm, open the Gulp tab, right click the `test` task, and click `Debug 'test'`. +* To run a single test, change the test function from `it` to `fit`. + ## Contributions Pull requests are appreciated. Please use the same [Contributor License Agreement (CLA)](https://github.com/AnalyticalGraphicsInc/cesium/blob/master/CONTRIBUTING.md) used for [Cesium](http://cesiumjs.org/). From bc27653d5ef25d3906499d57b087b38027c0e834 Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Fri, 6 Jan 2017 14:09:46 -0500 Subject: [PATCH 4/6] Fix broken link in documentation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 4469ba5..6971918 100644 --- a/README.md +++ b/README.md @@ -92,5 +92,5 @@ Pull requests are appreciated. Please use the same [Contributor License Agreeme Developed by the Cesium team.

- +

From b5c366e2c70a50a53f841440324ea2142493630a Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Fri, 6 Jan 2017 17:49:38 -0500 Subject: [PATCH 5/6] Fix AO option --- lib/convert.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/convert.js b/lib/convert.js index 8a135d8..0242177 100644 --- a/lib/convert.js +++ b/lib/convert.js @@ -43,7 +43,7 @@ function convert(objFile, outputPath, options) { return createGltf(data, inputPath, modelName); }) .then(function(gltf) { - var aoOptions = ao ? {} : undefined; + var aoOptions = ao ? {enable : true} : undefined; var options = { binary: binary, embed: embed, From 233d163b4cbfdf94a18a63adf7aaf57f0b0918d2 Mon Sep 17 00:00:00 2001 From: Sean Lilley Date: Fri, 6 Jan 2017 17:50:19 -0500 Subject: [PATCH 6/6] Update date --- CHANGES.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGES.md b/CHANGES.md index 0584792..b0db92d 100644 --- a/CHANGES.md +++ b/CHANGES.md @@ -1,7 +1,7 @@ Change Log ========== -### 0.1.7 2017-01-03 +### 0.1.7 2017-01-06 * Update gltf-pipeline to 0.1.0-alpha9 * Added command to generate documentation (npm run jsdoc)