Shuffle bundle names around so that openpgp.js is the debug version

This commit is contained in:
Robert Nelson 2013-12-09 00:30:13 -08:00
parent 911e103de9
commit 48af7ce584
11 changed files with 34 additions and 13569 deletions

3
.gitignore vendored
View File

@ -4,4 +4,5 @@ build/
node_modules/
npm*
test/lib/
test/test-bundle.js
resources/keyring_nodebug.js
resources/openpgp_nodebug.js

View File

@ -4,35 +4,35 @@ module.exports = function(grunt) {
grunt.initConfig({
pkg: grunt.file.readJSON('package.json'),
browserify: {
openpgp: {
openpgp_nodebug: {
files: {
'resources/openpgp.js': []
'resources/openpgp_nodebug.js': []
},
options: {
alias: './src/:openpgp'
}
},
openpgp_debug: {
openpgp: {
files: {
'resources/openpgp.debug.js': []
'resources/openpgp.js': []
},
options: {
debug: true,
alias: './src/:openpgp'
}
},
keyring: {
keyring_nodebug: {
files: {
'resources/keyring.js': []
'resources/keyring_nodebug.js': []
},
options: {
alias: './src/keyring/:keyring',
external: [ 'openpgp' ]
}
},
keyring_debug: {
keyring: {
files: {
'resources/keyring.debug.js': []
'resources/keyring.js': []
},
options: {
debug: true,
@ -69,13 +69,21 @@ module.exports = function(grunt) {
from: /OpenPGP.js VERSION/g,
to: 'OpenPGP.js v<%= pkg.version %>.<%= grunt.template.today("yyyymmdd") %>'
}]
},
openpgpjs_nodebug: {
src: ['resources/openpgp_nodebug.js'],
dest: ['resources/openpgp_nodebug.js'],
replacements: [{
from: /OpenPGP.js VERSION/g,
to: 'OpenPGP.js v<%= pkg.version %>.<%= grunt.template.today("yyyymmdd") %>'
}]
}
},
uglify: {
openpgpjs: {
files: {
"resources/openpgp.min.js" : [ "resources/openpgp.js" ],
"resources/keyring.min.js" : [ "resources/keyring.js" ]
"resources/openpgp.min.js" : [ "resources/openpgp_nodebug.js" ],
"resources/keyring.min.js" : [ "resources/keyring_nodebug.js" ]
}
},
options: {
@ -116,7 +124,7 @@ module.exports = function(grunt) {
openpgp: {
expand: true,
cwd: 'resources/',
src: ['openpgp.debug.js', 'keyring.debug.js', 'jquery.min.js'],
src: ['openpgp.js', 'keyring.js', 'jquery.min.js'],
dest: 'test/lib/'
}
}

View File

@ -31,10 +31,10 @@ lint:
@./scripts/lint.sh
bundle:
@browserify -r ./src/:openpgp > ./resources/openpgp.js
@browserify -d -r ./src/:openpgp > ./resources/openpgp.debug.js
@browserify -x openpgp -r ./src/keyring/:keyring > ./resources/keyring.js
@browserify -d -x openpgp -r ./src/keyring/:keyring > ./resources/keyring.debug.js
@browserify -d -r ./src/:openpgp > ./resources/openpgp.js
@browserify -r ./src/:openpgp > ./resources/openpgp_nodebug.js
@browserify -d -x openpgp -r ./src/keyring/:keyring > ./resources/keyring.js
@browserify -x openpgp -r ./src/keyring/:keyring > ./resources/keyring_nodebug.js
bundle-test:
@browserify -d -r ./test/test-all.js:unittests > ./test/lib/test-bundle.js

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
/*! OpenPGPjs.org this is LGPL licensed code, see LICENSE/our website for more information.- v0.0.1 - 2013-12-08 */require=function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({RRTcVk:[function(a,b){b.exports=a("./keyring.js"),b.exports.localstore=a("./localstore.js")},{"./keyring.js":3,"./localstore.js":4}],keyring:[function(a,b){b.exports=a("RRTcVk")},{}],3:[function(a,b){var c=a("openpgp"),d=function(){function b(b){this.storeHandler=b?b:a("./localstore"),this.keys=[],this.storeHandler.init(this.keys)}function d(a,b){a=a.toLowerCase();for(var c,d=b.getUserIds();c<d.length;c++)if(keyEmail=d[c].split("<")[1].split(">")[0].trim().toLowerCase(),keyEmail==a)return!0;return!1}function e(a,b){for(var d=b.getKeyIds(),e=0;e<d.length;e++)return c.util.hexstrdump(d[e].write())==a?!0:!1}function f(a,b,d,e){for(var f=[],g=0;g<a.length;g++){var h=a[g];switch(e){case c.enums.packet.public_key:h.isPublic()&&b(d,h)&&f.push(h);break;case c.enums.packet.private_key:h.isPrivate()&&b(d,h)&&f.push(h)}}return f}function g(a){return f(this.keys,d,a,c.enums.packet.public_key)}function h(a){return f(this.keys,d,a,c.enums.packet.secret_key)}function i(a){return this.checkForIdentityAndKeyTypeMatch(this.keys,e,a,c.enums.packet.public_key)}function j(a){return this.keys.push(c.key.readArmored(a)),!0}function k(a){return this.keys[a].armor()}function l(a){var b=this.keys.splice(a,1);return b}function m(a){return this.keys[a].toPublic().armor()}this.keys=[],this.init=b,this.store=function(){this.storeHandler.store(this.keys)},this.checkForIdentityAndKeyTypeMatch=f,this.getPublicKeyForAddress=g,this.getPrivateKeyForAddress=h,this.getKeysForKeyId=i,this.importKey=j,this.exportKey=k,this.removeKey=l,this.exportPublicKey=m};b.exports=new d},{"./localstore":4}],4:[function(a,b){var c=a("openpgp"),d=function(){function a(a){var b=JSON.parse(window.localStorage.getItem("armoredKeys"));if(null!==b&&0===b.length)for(var d,e=0;e<b.length;e++)d=c.key.readArmored(b[e]),a.push(d);else this.keys=[]}function b(a){for(var b=[],c=0;c<a.length;c++)b.push(a[c].armor());window.localStorage.setItem("armoredKeys",JSON.stringify(b))}this.init=a,this.store=b};b.exports=new d},{}]},{},[]);
/*! OpenPGPjs.org this is LGPL licensed code, see LICENSE/our website for more information.- v0.0.1 - 2013-12-09 */require=function a(b,c,d){function e(g,h){if(!c[g]){if(!b[g]){var i="function"==typeof require&&require;if(!h&&i)return i(g,!0);if(f)return f(g,!0);throw new Error("Cannot find module '"+g+"'")}var j=c[g]={exports:{}};b[g][0].call(j.exports,function(a){var c=b[g][1][a];return e(c?c:a)},j,j.exports,a,b,c,d)}return c[g].exports}for(var f="function"==typeof require&&require,g=0;g<d.length;g++)e(d[g]);return e}({RRTcVk:[function(a,b){b.exports=a("./keyring.js"),b.exports.localstore=a("./localstore.js")},{"./keyring.js":3,"./localstore.js":4}],keyring:[function(a,b){b.exports=a("RRTcVk")},{}],3:[function(a,b){var c=a("openpgp"),d=function(){function b(b){this.storeHandler=b?b:a("./localstore"),this.keys=[],this.storeHandler.init(this.keys)}function d(a,b){a=a.toLowerCase();for(var c,d=b.getUserIds();c<d.length;c++)if(keyEmail=d[c].split("<")[1].split(">")[0].trim().toLowerCase(),keyEmail==a)return!0;return!1}function e(a,b){for(var d=b.getKeyIds(),e=0;e<d.length;e++)return c.util.hexstrdump(d[e].write())==a?!0:!1}function f(a,b,d,e){for(var f=[],g=0;g<a.length;g++){var h=a[g];switch(e){case c.enums.packet.public_key:h.isPublic()&&b(d,h)&&f.push(h);break;case c.enums.packet.private_key:h.isPrivate()&&b(d,h)&&f.push(h)}}return f}function g(a){return f(this.keys,d,a,c.enums.packet.public_key)}function h(a){return f(this.keys,d,a,c.enums.packet.secret_key)}function i(a){return this.checkForIdentityAndKeyTypeMatch(this.keys,e,a,c.enums.packet.public_key)}function j(a){return this.keys.push(c.key.readArmored(a)),!0}function k(a){return this.keys[a].armor()}function l(a){var b=this.keys.splice(a,1);return b}function m(a){return this.keys[a].toPublic().armor()}this.keys=[],this.init=b,this.store=function(){this.storeHandler.store(this.keys)},this.checkForIdentityAndKeyTypeMatch=f,this.getPublicKeyForAddress=g,this.getPrivateKeyForAddress=h,this.getKeysForKeyId=i,this.importKey=j,this.exportKey=k,this.removeKey=l,this.exportPublicKey=m};b.exports=new d},{"./localstore":4}],4:[function(a,b){var c=a("openpgp"),d=function(){function a(a){var b=JSON.parse(window.localStorage.getItem("armoredKeys"));if(null!==b&&0===b.length)for(var d,e=0;e<b.length;e++)d=c.key.readArmored(b[e]),a.push(d);else this.keys=[]}function b(a){for(var b=[],c=0;c<a.length;c++)b.push(a[c].armor());window.localStorage.setItem("armoredKeys",JSON.stringify(b))}this.init=a,this.store=b};b.exports=new d},{}]},{},[]);

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -10,8 +10,8 @@
<div id="mocha"></div>
<!--<script src="lib/jquery.min.js"></script>-->
<script src="lib/openpgp.debug.js"></script>
<script src="lib/keyring.debug.js"></script>
<script src="lib/openpgp.js"></script>
<script src="lib/keyring.js"></script>
<script src="lib/chai.js"></script>
<script src="lib/sinon.js"></script>
<script src="lib/mocha.js"></script>

View File

@ -56,8 +56,8 @@
</style>
<script src="lib/openpgp.debug.js"></script>
<script src="lib/keyring.debug.js"></script>
<script src="lib/openpgp.js"></script>
<script src="lib/keyring.js"></script>
<script src="lib/test-bundle.js"></script>
<script type="text/javascript">