diff --git a/.travis.yml b/.travis.yml index 2d9b42bd..8342eb00 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,8 +1,5 @@ sudo: false language: node_js -cache: - directories: - - node_modules matrix: fast_finish: true include: diff --git a/Gruntfile.js b/Gruntfile.js index 7a0de57a..5b64cd37 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -16,9 +16,9 @@ module.exports = function(grunt) { }, options: { browserifyOptions: { - standalone: 'openpgp', - external: [ 'crypto', 'node-localstorage' ] - } + standalone: 'openpgp' + }, + external: [ 'crypto', 'node-localstorage' ] } }, openpgp_debug: { @@ -28,9 +28,9 @@ module.exports = function(grunt) { options: { browserifyOptions: { debug: true, - standalone: 'openpgp', - external: [ 'crypto', 'node-localstorage' ] - } + standalone: 'openpgp' + }, + external: [ 'crypto', 'node-localstorage' ] } }, worker: { @@ -48,9 +48,7 @@ module.exports = function(grunt) { 'test/lib/unittests-bundle.js': [ './test/unittests.js' ] }, options: { - browserifyOptions: { - external: [ 'openpgp', 'crypto', 'node-localstorage'] - } + external: ['crypto', 'node-localstorage', 'openpgp', '../../../dist/openpgp', '../../dist/openpgp'] } } }, @@ -119,14 +117,14 @@ module.exports = function(grunt) { coverage: { src: 'test', options: { - root: 'node_modules/openpgp', + root: '.', timeout: 240000, } }, coveralls: { src: ['test'], options: { - root: 'node_modules/openpgp', + root: '.', timeout: 240000, coverage: true, reportFormats: ['cobertura','lcovonly'] @@ -143,7 +141,7 @@ module.exports = function(grunt) { } }, copy: { - npm: { + browsertest: { expand: true, flatten: true, cwd: 'node_modules/', @@ -228,32 +226,13 @@ module.exports = function(grunt) { } grunt.registerTask('default', 'Build OpenPGP.js', function() { - grunt.task.run(['clean', 'copy:zlib', 'browserify', 'replace', 'uglify', 'npm_pack']); + grunt.task.run(['clean', 'copy:zlib', 'browserify', 'replace', 'uglify']); //TODO jshint is not run because of too many discovered issues, once these are addressed it should autorun grunt.log.ok('Before Submitting a Pull Request please also run `grunt jshint`.'); }); grunt.registerTask('documentation', ['jsdoc']); - // Alias the `npm_pack` task to run `npm pack` - grunt.registerTask('npm_pack', 'npm pack', function () { - var done = this.async(); - var npm = require('child_process').exec('npm pack ../', { cwd: 'dist'}, function (err, stdout) { - var package = stdout; - if (err === null) { - var install = require('child_process').exec('npm install dist/' + package, function (err) { - done(err); - }); - install.stdout.pipe(process.stdout); - install.stderr.pipe(process.stderr); - } else { - done(err); - } - }); - npm.stdout.pipe(process.stdout); - npm.stderr.pipe(process.stderr); - }); - grunt.event.on('coverage', function(lcov, done){ require('coveralls').handleInput(lcov, function(err){ if (err) { @@ -264,8 +243,8 @@ module.exports = function(grunt) { }); // Test/Dev tasks - grunt.registerTask('test', ['copy:npm', 'mochaTest']); - grunt.registerTask('coverage', ['default', 'copy:npm', 'mocha_istanbul:coverage']); - grunt.registerTask('coveralls', ['default', 'copy:npm', 'mocha_istanbul:coveralls']); - grunt.registerTask('saucelabs', ['default', 'copy:npm', 'connect', 'saucelabs-mocha']); + grunt.registerTask('test', ['copy:zlib', 'mochaTest']); + grunt.registerTask('coverage', ['copy:zlib', 'mocha_istanbul:coverage']); + grunt.registerTask('coveralls', ['copy:zlib', 'mocha_istanbul:coveralls']); + grunt.registerTask('saucelabs', ['default', 'copy:browsertest', 'connect', 'saucelabs-mocha']); }; diff --git a/package.json b/package.json index 1c54e231..42cedbd9 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,7 @@ "name": "openpgp", "description": "OpenPGP.js is a Javascript implementation of the OpenPGP protocol. This is defined in RFC 4880.", "version": "1.4.1", - "license" : "LGPL-3.0+", + "license": "LGPL-3.0+", "homepage": "http://openpgpjs.org/", "engines": { "node": ">=0.8" @@ -13,7 +13,7 @@ "gpg", "openpgp" ], - "main": "src/index.js", + "main": "dist/openpgp.js", "directories": { "lib": "src" }, @@ -32,7 +32,7 @@ "test": "grunt test" }, "devDependencies": { - "browserify": "~12.0", + "browserify": "~13.0", "chai": "~3.4.1", "coveralls": "^2.11.2", "grunt": "~0.4.5", @@ -40,23 +40,23 @@ "grunt-contrib-clean": "~0.7.0", "grunt-contrib-connect": "~0.11.2", "grunt-contrib-copy": "~0.8.0", - "grunt-contrib-jshint": "*", + "grunt-contrib-jshint": "~0.12.0", "grunt-contrib-uglify": "~0.11.0", "grunt-jsbeautifier": "~0.2.10", - "grunt-jsdoc": "*", + "grunt-jsdoc": "~1.1.0", "grunt-mocha-istanbul": "^3.0.1", "grunt-mocha-test": "~0.12.7", "grunt-saucelabs": "8.6.2", "grunt-text-replace": "~0.4.0", - "istanbul": "^0.4.1", + "istanbul": "~0.4.1", "mocha": "~2.3.4", "node-fetch": "^1.3.3", - "whatwg-fetch": "^0.10.1" + "whatwg-fetch": "~0.11.0" }, "dependencies": { - "es6-promise": "^3.0.2", + "es6-promise": "~3.0.2", "node-localstorage": "~1.1.2", - "zlibjs": "^0.2.0" + "zlibjs": "~0.2.0" }, "repository": { "type": "git", diff --git a/test/crypto/cipher/aes.js b/test/crypto/cipher/aes.js index 6cc1f3ca..335160f7 100644 --- a/test/crypto/cipher/aes.js +++ b/test/crypto/cipher/aes.js @@ -1,6 +1,6 @@ 'use strict'; -var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('openpgp'); +var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../../dist/openpgp'); var util = openpgp.util, chai = require('chai'), diff --git a/test/crypto/cipher/blowfish.js b/test/crypto/cipher/blowfish.js index 81100dd7..232d7366 100644 --- a/test/crypto/cipher/blowfish.js +++ b/test/crypto/cipher/blowfish.js @@ -1,6 +1,6 @@ 'use strict'; -var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('openpgp'); +var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../../dist/openpgp'); var util = openpgp.util, BFencrypt = openpgp.crypto.cipher.blowfish, diff --git a/test/crypto/cipher/cast5.js b/test/crypto/cipher/cast5.js index 40ab972e..5bbf02da 100644 --- a/test/crypto/cipher/cast5.js +++ b/test/crypto/cipher/cast5.js @@ -1,6 +1,6 @@ 'use strict'; -var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('openpgp'); +var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../../dist/openpgp'); var util = openpgp.util, chai = require('chai'), diff --git a/test/crypto/cipher/des.js b/test/crypto/cipher/des.js index 1be7e80f..27239b93 100644 --- a/test/crypto/cipher/des.js +++ b/test/crypto/cipher/des.js @@ -1,6 +1,6 @@ 'use strict'; -var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('openpgp'); +var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../../dist/openpgp'); var util = openpgp.util, chai = require('chai'), diff --git a/test/crypto/cipher/twofish.js b/test/crypto/cipher/twofish.js index e2ee828c..169e43ec 100644 --- a/test/crypto/cipher/twofish.js +++ b/test/crypto/cipher/twofish.js @@ -1,6 +1,6 @@ 'use strict'; -var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('openpgp'); +var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../../dist/openpgp'); var util = openpgp.util, chai = require('chai'), diff --git a/test/crypto/crypto.js b/test/crypto/crypto.js index f7dec980..f76ee68c 100644 --- a/test/crypto/crypto.js +++ b/test/crypto/crypto.js @@ -1,6 +1,6 @@ 'use strict'; -var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('openpgp'); +var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp'); var chai = require('chai'), expect = chai.expect; diff --git a/test/crypto/hash/md5.js b/test/crypto/hash/md5.js index b3d0a777..43fbec79 100644 --- a/test/crypto/hash/md5.js +++ b/test/crypto/hash/md5.js @@ -1,6 +1,6 @@ 'use strict'; -var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('openpgp'); +var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../../dist/openpgp'); var util = openpgp.util, MD5 = openpgp.crypto.hash.md5, diff --git a/test/crypto/hash/ripemd.js b/test/crypto/hash/ripemd.js index 75c353c9..4d998be9 100644 --- a/test/crypto/hash/ripemd.js +++ b/test/crypto/hash/ripemd.js @@ -1,6 +1,6 @@ 'use strict'; -var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('openpgp'); +var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../../dist/openpgp'); var util = openpgp.util, RMDstring = openpgp.crypto.hash.ripemd, diff --git a/test/crypto/hash/sha.js b/test/crypto/hash/sha.js index ce8da58a..a304c895 100644 --- a/test/crypto/hash/sha.js +++ b/test/crypto/hash/sha.js @@ -1,6 +1,6 @@ 'use strict'; -var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('openpgp'); +var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../../dist/openpgp'); var util = openpgp.util, hash = openpgp.crypto.hash, diff --git a/test/general/armor.js b/test/general/armor.js index 69ce787f..f5ceb2e3 100644 --- a/test/general/armor.js +++ b/test/general/armor.js @@ -1,6 +1,6 @@ 'use strict'; -var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('openpgp'); +var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp'); var chai = require('chai'), expect = chai.expect; diff --git a/test/general/basic.js b/test/general/basic.js index ef9857ca..616399ff 100644 --- a/test/general/basic.js +++ b/test/general/basic.js @@ -1,6 +1,6 @@ 'use strict'; -var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('openpgp'); +var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp'); var chai = require('chai'), expect = chai.expect; diff --git a/test/general/hkp.js b/test/general/hkp.js index cbe71bcd..568e4a89 100644 --- a/test/general/hkp.js +++ b/test/general/hkp.js @@ -1,6 +1,6 @@ 'use strict'; -var openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('openpgp'); +var openpgp = typeof window !== 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp'); var fetch = typeof window !== 'undefined' ? window.fetch : require('node-fetch'); var chai = require('chai'), diff --git a/test/general/key.js b/test/general/key.js index e3be1c32..50e52c3f 100644 --- a/test/general/key.js +++ b/test/general/key.js @@ -1,6 +1,6 @@ 'use strict'; -var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('openpgp'); +var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp'); var chai = require('chai'), expect = chai.expect; diff --git a/test/general/keyring.js b/test/general/keyring.js index cc770d4b..39962f73 100644 --- a/test/general/keyring.js +++ b/test/general/keyring.js @@ -1,6 +1,6 @@ 'use strict'; -var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('openpgp'); +var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp'); var keyring = new openpgp.Keyring(), chai = require('chai'), diff --git a/test/general/packet.js b/test/general/packet.js index 250c7dfe..82904fe5 100644 --- a/test/general/packet.js +++ b/test/general/packet.js @@ -1,6 +1,6 @@ 'use strict'; -var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('openpgp'); +var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp'); var chai = require('chai'), expect = chai.expect; diff --git a/test/general/signature.js b/test/general/signature.js index 466a1036..e6d3a7cb 100644 --- a/test/general/signature.js +++ b/test/general/signature.js @@ -1,6 +1,6 @@ 'use strict'; -var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('openpgp'); +var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp'); var chai = require('chai'), expect = chai.expect; diff --git a/test/worker/api.js b/test/worker/api.js index d23d8a60..3fac8a94 100644 --- a/test/worker/api.js +++ b/test/worker/api.js @@ -1,6 +1,6 @@ 'use strict'; -var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('openpgp'); +var openpgp = typeof window != 'undefined' && window.openpgp ? window.openpgp : require('../../dist/openpgp'); var chai = require('chai'), expect = chai.expect;