16 changed files with 62144 additions and 3828 deletions
@ -0,0 +1,13 @@ |
|||
/** |
|||
* @license |
|||
* https://github.com/bitcoincashjs/bitcoincashjs
|
|||
* Copyright (c) 2017-2018 Emilio Almansi |
|||
* Copyright (c) 2013-2017 BitPay, Inc. |
|||
* Copyright (c) 2009-2015 The Bitcoin Core developers |
|||
* Copyright (c) 2014 Ryan X. Charles |
|||
* Copyright (c) 2014 reddit, Inc. |
|||
* Copyright (c) 2011 Stefan Thomas <justmoon@members.fsf.org> |
|||
* Copyright (c) 2011 Google Inc. |
|||
* Distributed under the MIT software license, see the accompanying |
|||
* file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|||
*/ |
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
@ -1,125 +0,0 @@ |
|||
/** |
|||
* @file gulpfile.js |
|||
* |
|||
* Defines tasks that can be run on gulp. |
|||
* |
|||
* Summary: |
|||
* <ul> |
|||
* <li> `test` - an alias for `test:node` |
|||
* <li> `test:node` - runs all the tests on node (mocha) |
|||
* <li> `test:browser` - runs all the tests in the browser (karma) |
|||
* <li> `build` - generate files needed for browser (browserify) |
|||
* <li> `build:test` - generate files needed for testing in the browser |
|||
* <li> `lint` - run `jshint` |
|||
* <li> `coveralls` - updates coveralls info |
|||
* </ul> |
|||
*/ |
|||
|
|||
'use strict'; |
|||
|
|||
const gulp = require('gulp'); |
|||
const shell = require('gulp-shell'); |
|||
const npmPackage = require('./package.json'); |
|||
|
|||
gulp.task( |
|||
'build', |
|||
['build:node', 'build:browser'] |
|||
); |
|||
|
|||
gulp.task( |
|||
'build:node', |
|||
shell.task([[ |
|||
'rm -rf lib', '&&', |
|||
'mkdir -p lib', '&&', |
|||
'npx babel-cli src --out-dir lib', |
|||
].join(' ')]) |
|||
); |
|||
|
|||
gulp.task( |
|||
'build:browser', |
|||
['build:node'], |
|||
shell.task([[ |
|||
'rm -rf dist', '&&', |
|||
'mkdir -p dist', '&&', |
|||
'npx browserify lib/bitcoincash.js --s bch', '|', |
|||
`npx minify --out-file dist/bitcoincashjs.${npmPackage.version}.min.js`, |
|||
].join(' ')]) |
|||
); |
|||
|
|||
gulp.task( |
|||
'build:test', |
|||
['build:node'], |
|||
shell.task([[ |
|||
'rm -rf build', '&&', |
|||
'mkdir -p build', '&&', |
|||
'find test/ -type f -name "*.js" | xargs npx browserify -t brfs -o build/tests.js' |
|||
].join(' ')]) |
|||
); |
|||
|
|||
gulp.task( |
|||
'test', |
|||
['test:node'] |
|||
); |
|||
|
|||
gulp.task( |
|||
'test:all', |
|||
['test:node', 'test:browser'] |
|||
); |
|||
|
|||
gulp.task( |
|||
'test:node', |
|||
['build:node'], |
|||
shell.task([ |
|||
`npx nyc --reporter=html --reporter=text npx mocha ${getTaskArgs()}`, |
|||
]) |
|||
); |
|||
|
|||
gulp.task( |
|||
'test:browser', |
|||
['build:test'], |
|||
shell.task([ |
|||
'npx karma start', |
|||
]) |
|||
); |
|||
|
|||
gulp.task( |
|||
'lint', |
|||
shell.task([ |
|||
'find gulpfile.js src/ test/ -type f -name "*.js" | xargs npx jshint', |
|||
]) |
|||
); |
|||
|
|||
gulp.task( |
|||
'coveralls', |
|||
shell.task([ |
|||
'npx nyc report --reporter=text-lcov | npx coveralls', |
|||
]) |
|||
); |
|||
|
|||
gulp.task( |
|||
'version', |
|||
['build'], |
|||
shell.task([[ |
|||
'npx mustache package.json README.tpl.md > README.md', '&&', |
|||
'git add -A dist README.md', |
|||
].join(' ')]) |
|||
); |
|||
|
|||
gulp.task( |
|||
'postversion', |
|||
shell.task([[ |
|||
'git push', '&&', |
|||
'git push --tags', '&&', |
|||
'npm publish', |
|||
].join(' ')]) |
|||
); |
|||
|
|||
function getTaskArgs() { |
|||
if (process.argv.length < 4) { |
|||
return ''; |
|||
} |
|||
const args = process.argv.splice(3); |
|||
const argsWithQuotes = args.map(a => a.indexOf(' ') !== -1 ? `"${a}"` : a); |
|||
return argsWithQuotes.join(' '); |
|||
} |
|||
|
File diff suppressed because it is too large
@ -0,0 +1,18 @@ |
|||
/** |
|||
* @license |
|||
* https://github.com/bitcoincashjs/bitcoincashjs
|
|||
* Copyright (c) 2018 Emilio Almansi |
|||
* Distributed under the MIT software license, see the accompanying |
|||
* file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|||
*/ |
|||
|
|||
var shell = require('shelljs') |
|||
shell.config.fatal = true |
|||
|
|||
shell.rm('-rf', '.build') |
|||
shell.mkdir('-p', '.build') |
|||
|
|||
shell.exec('find test/ -type f -name "*.js"', { silent: true }) |
|||
.exec('xargs npx browserify -t brfs', { silent: true }) |
|||
.to('.build/tests.js') |
|||
shell.echo('Generated file: .build/tests.js.') |
@ -0,0 +1,23 @@ |
|||
/** |
|||
* @license |
|||
* https://github.com/bitcoincashjs/bitcoincashjs
|
|||
* Copyright (c) 2018 Emilio Almansi |
|||
* Distributed under the MIT software license, see the accompanying |
|||
* file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|||
*/ |
|||
|
|||
var shell = require('shelljs') |
|||
shell.config.fatal = true |
|||
var version = require('../package.json').version |
|||
|
|||
shell.rm('-rf', 'dist') |
|||
shell.mkdir('-p', 'dist') |
|||
|
|||
shell.exec('npx browserify src/bitcoincash.js --s bch', { silent: true }) |
|||
.to('dist/bitcoincash-' + version + '.js') |
|||
shell.echo('Generated file: dist/bitcoincash-' + version + '.js.') |
|||
|
|||
shell.cp('LICENSE.js', 'dist/bitcoincash-' + version + '.min.js') |
|||
shell.exec('cat dist/bitcoincash-' + version + '.js | npx uglifyjs -c', { silent: true }) |
|||
.toEnd('dist/bitcoincash-' + version + '.min.js') |
|||
shell.echo('Generated file: dist/bitcoincash-' + version + '.min.js.') |
@ -0,0 +1,13 @@ |
|||
/** |
|||
* @license |
|||
* https://github.com/bitcoincashjs/bitcoincashjs
|
|||
* Copyright (c) 2018 Emilio Almansi |
|||
* Distributed under the MIT software license, see the accompanying |
|||
* file LICENSE or http://www.opensource.org/licenses/mit-license.php.
|
|||
*/ |
|||
|
|||
var shell = require('shelljs') |
|||
shell.config.fatal = false |
|||
|
|||
shell.exec('find src/ test/ scripts/ -type f -name "*.js"', { silent: true }) |
|||
.exec('xargs npx jshint') |
Loading…
Reference in new issue