Merge pull request #654 from eordano/fix/buildErrors

Fix Error issues and other issues found with packaging
This commit is contained in:
Manuel Aráoz 2014-12-03 17:34:48 -03:00
commit cf0561b98e
6 changed files with 19 additions and 10 deletions

1
.gitignore vendored
View File

@ -15,3 +15,4 @@ npm-debug.log
apiref
bower_components
dist
report

View File

@ -96,7 +96,8 @@ gulp.task('lint', function() {
gulp.task('browser', ['errors'], function() {
return gulp.src('index.js')
.pipe(browserify({
insertGlobals: true
insertGlobals: true,
standalone: 'bitcore'
}))
.pipe(rename('bitcore.js'))
.pipe(gulp.dest('browser'));
@ -110,7 +111,7 @@ gulp.task('browser-all', ['errors'], function(callback) {
runSequence(['browser'], ['browser-test'], callback);
});
gulp.task('karma', ['browser-test'], testKarma);
gulp.task('karma', ['browser-all'], testKarma);
gulp.task('errors', shell.task([
'node ./lib/errors/build.js'

View File

@ -14,10 +14,10 @@ var formatMessage = function(message) {
var defineElement = function(fullName, baseClass, message) {
return fullName + ' = function() {\n' +
' this.message = ' + formatMessage(message) + ';\n' +
' ' + baseClass + '.call(this, this.message);\n' +
' this.name = "' + fullName + '";\n' +
' this.stack = this.message + \'\\n\' + (new Error()).stack;\n' +
'};\n' +
'inherits(' + fullName + ', ' + baseClass + ');\n\n';
fullName + '.prototype = Object.create(' + baseClass + '.prototype);\n' +
fullName + '.prototype.name = "' + fullName + '";\n\n';
};
var traverseNode = function(baseClass, errorDefinition) {

View File

@ -4,7 +4,7 @@ module.exports = [{
errors: [
{
name: 'InvalidArgument',
message: 'HDPrivateKey: Invalid Argument {0}, expected {1} but got {2}',
message: 'Invalid Argument {0}, expected {1} but got {2}',
errors: [{
name: 'InvalidB58Char',
message: 'Invalid Base58 character: {0} in {1}'
@ -48,7 +48,7 @@ module.exports = [{
errors: [
{
name: 'InvalidArgument',
message: 'HDPublicKey: Invalid Argument {0}, expected {1} but got {2}',
message: 'Invalid Argument {0}, expected {1} but got {2}',
errors: [{
name: 'ArgumentIsPrivateExtended',
message: 'Argument is an extended private key: {0}'

10
npm-shrinkwrap.json generated
View File

@ -38,6 +38,11 @@
}
}
},
"inherits": {
"version": "2.0.1",
"from": "inherits@2.0.1",
"resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz"
},
"hash.js": {
"version": "0.3.2",
"from": "hash.js@0.3.2",
@ -49,6 +54,11 @@
}
}
},
"lodash": {
"version": "2.4.1",
"from": "lodash@=2.4.1",
"resolved": "https://registry.npmjs.org/lodash/-/lodash-2.4.1.tgz"
},
"sha512": {
"version": "0.0.1",
"from": "sha512@=0.0.1",

View File

@ -91,14 +91,11 @@
"gulp-mocha": "^2.0.0",
"gulp-rename": "^1.2.0",
"gulp-shell": "^0.2.10",
"inherits": "^2.0.1",
"lodash": "^2.4.1",
"mocha": "~2.0.1",
"run-sequence": "^1.0.2",
"karma": "^0.12.28",
"karma-firefox-launcher": "^0.1.3",
"karma-mocha": "^0.1.9",
"lodash": "^2.4.1",
"mocha": "~2.0.1",
"run-sequence": "^1.0.2"
},