From 36b8e4b6a88344cdb121834c6319cfe2979f443a Mon Sep 17 00:00:00 2001 From: Jaco Greeff Date: Sun, 11 Dec 2016 10:13:34 +0100 Subject: [PATCH] Extended publishing of libraries to npm (#3786) * Extended publishing of libraries to npm * Update source links * Add some tests before publishing NPM library * Fix Shapeshift tests --- js/npm/etherscan/README.md | 34 +++++++++++ js/npm/etherscan/package.json | 33 +++++++++++ js/{parity.md => npm/parity/README.md} | 4 +- .../parity/package.json} | 8 +-- js/npm/parity/test/smoke.spec.js | 26 +++++++++ js/npm/shapeshift/README.md | 34 +++++++++++ js/npm/shapeshift/package.json | 31 ++++++++++ js/npm/test/mocha.config.js | 29 ++++++++++ js/npm/test/mocha.opts | 1 + js/package.json | 2 +- js/scripts/dryrun-npm.sh | 33 +++++++++++ js/scripts/release.sh | 22 +++++--- js/src/3rdparty/etherscan/account.spec.js | 6 +- js/src/3rdparty/etherscan/stats.spec.js | 6 +- js/src/3rdparty/shapeshift/helpers.spec.js | 17 ++---- js/src/3rdparty/shapeshift/rpc.spec.js | 7 ++- js/src/3rdparty/shapeshift/shapeshift.js | 5 ++ js/src/3rdparty/shapeshift/shapeshift.spec.js | 6 +- js/src/library.etherscan.js | 34 +++++++++++ js/src/{library.js => library.parity.js} | 0 js/src/library.shapeshift.js | 34 +++++++++++ js/test/{npmLibrary.js => npmParity.js} | 4 +- js/webpack/npm.js | 56 +++++++++++++++++-- 23 files changed, 394 insertions(+), 38 deletions(-) create mode 100644 js/npm/etherscan/README.md create mode 100644 js/npm/etherscan/package.json rename js/{parity.md => npm/parity/README.md} (92%) rename js/{parity.package.json => npm/parity/package.json} (72%) create mode 100644 js/npm/parity/test/smoke.spec.js create mode 100644 js/npm/shapeshift/README.md create mode 100644 js/npm/shapeshift/package.json create mode 100644 js/npm/test/mocha.config.js create mode 100644 js/npm/test/mocha.opts create mode 100755 js/scripts/dryrun-npm.sh create mode 100644 js/src/library.etherscan.js rename js/src/{library.js => library.parity.js} (100%) create mode 100644 js/src/library.shapeshift.js rename js/test/{npmLibrary.js => npmParity.js} (92%) diff --git a/js/npm/etherscan/README.md b/js/npm/etherscan/README.md new file mode 100644 index 000000000..39c86d62b --- /dev/null +++ b/js/npm/etherscan/README.md @@ -0,0 +1,34 @@ +# @parity/Etherscan + +A thin, lightweight promise wrapper for the api.etherscan.io/apis service, exposing a common endpoint for use in JavaScript applications. + +[https://github.com/ethcore/parity/tree/master/js/src/3rdparty/etherscan](https://github.com/ethcore/parity/tree/master/js/src/3rdparty/etherscan) + +## usage + +installation - + +``` +npm install --save @parity/Etherscan +``` + +Usage - + +``` +const etherscan = require('@parity/Etherscan'); + +// api calls goes here +``` + +## api + +account (exposed on etherscan.account) - + +- `balance(address)` +- `balances(addresses)` (array or addresses) +- `transactions(address, page)` (page offset starts at 0, returns 25) + +stats (exposed on etherscan.stats) - + +- `price()` +- `supply()` diff --git a/js/npm/etherscan/package.json b/js/npm/etherscan/package.json new file mode 100644 index 000000000..80b1a38f8 --- /dev/null +++ b/js/npm/etherscan/package.json @@ -0,0 +1,33 @@ +{ + "name": "@parity/Etherscan", + "description": "The Parity Promise-based library for interfacing with Etherscan over HTTP", + "version": "0.0.0", + "main": "library.js", + "author": "Parity Team ", + "maintainers": [ + "Jaco Greeff" + ], + "contributors": [], + "license": "GPL-3.0", + "repository": { + "type": "git", + "url": "git+https://github.com/ethcore/parity.git" + }, + "keywords": [ + "Ethereum", + "ABI", + "API", + "RPC", + "Parity", + "Promise" + ], + "scripts": { + }, + "devDependencies": { + "chai": "3.5.0", + "mocha": "3.2.0" + }, + "dependencies": { + "node-fetch": "~1.6.3" + } +} diff --git a/js/parity.md b/js/npm/parity/README.md similarity index 92% rename from js/parity.md rename to js/npm/parity/README.md index 3e42f5c8d..30efd3b94 100644 --- a/js/parity.md +++ b/js/npm/parity/README.md @@ -1,7 +1,9 @@ -# parity.js +# @parity/parity.js Parity.js is a thin, fast, Promise-based wrapper around the Ethereum APIs. +[https://github.com/ethcore/parity/tree/master/js/src/api](https://github.com/ethcore/parity/tree/master/js/src/api) + ## installation Install the package with `npm install --save @parity/parity.js` diff --git a/js/parity.package.json b/js/npm/parity/package.json similarity index 72% rename from js/parity.package.json rename to js/npm/parity/package.json index 0974e072f..7b1fcebda 100644 --- a/js/parity.package.json +++ b/js/npm/parity/package.json @@ -1,6 +1,6 @@ { "name": "@parity/parity.js", - "description": "The Parity Promise-base API & ABI library for interfacing with Ethereum over RPC", + "description": "The Parity Promise-based API & ABI library for interfacing with Ethereum over RPC", "version": "0.0.0", "main": "library.js", "author": "Parity Team ", @@ -26,8 +26,8 @@ "devDependencies": { }, "dependencies": { - "bignumber.js": "^2.3.0", - "js-sha3": "^0.5.2", - "node-fetch": "^1.6.3" + "bignumber.js": "~2.3.0", + "js-sha3": "~0.5.2", + "node-fetch": "~1.6.3" } } diff --git a/js/npm/parity/test/smoke.spec.js b/js/npm/parity/test/smoke.spec.js new file mode 100644 index 000000000..9920b10d2 --- /dev/null +++ b/js/npm/parity/test/smoke.spec.js @@ -0,0 +1,26 @@ +// Copyright 2015, 2016 Ethcore (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +const parity = require('../'); + +describe('load the Parity library', function () { + it('should no throw any error', () => { + expect(parity).to.be.ok; + + expect(parity.Api).to.be.ok; + expect(parity.Abi).to.be.ok; + }); +}); diff --git a/js/npm/shapeshift/README.md b/js/npm/shapeshift/README.md new file mode 100644 index 000000000..e12b7b7ef --- /dev/null +++ b/js/npm/shapeshift/README.md @@ -0,0 +1,34 @@ +# @parity/ShapeShift + +A thin ES6 promise wrapper around the shapeshift.io APIs as documented at https://shapeshift.io/api + +[https://github.com/ethcore/parity/tree/master/js/src/3rdparty/shapeshift](https://github.com/ethcore/parity/tree/master/js/src/3rdparty/shapeshift) + +## usage + +installation - + +``` +npm install --save @parity/ShapeShift +``` + +Usage - + +``` +const APIKEY = 'private affiliate key or undefined'; +const shapeshift = require('@parity/ShapeShift')(APIKEY); + +// api calls goes here +``` + +## api + +queries - + +- `getCoins()` [https://shapeshift.io/api#api-104](https://shapeshift.io/api#api-104) +- `getMarketInfo(pair)` [https://shapeshift.io/api#api-103](https://shapeshift.io/api#api-103) +- `getStatus(depositAddress)` [https://shapeshift.io/api#api-5](https://shapeshift.io/api#api-5) + +transactions - + +- `shift(toAddress, returnAddress, pair)` [https://shapeshift.io/api#api-7](https://shapeshift.io/api#api-7) diff --git a/js/npm/shapeshift/package.json b/js/npm/shapeshift/package.json new file mode 100644 index 000000000..c163b0e5f --- /dev/null +++ b/js/npm/shapeshift/package.json @@ -0,0 +1,31 @@ +{ + "name": "@parity/ShapeShift", + "description": "The Parity Promise-based library for interfacing with ShapeShift over HTTP", + "version": "0.0.0", + "main": "library.js", + "author": "Parity Team ", + "maintainers": [ + "Jaco Greeff" + ], + "contributors": [], + "license": "GPL-3.0", + "repository": { + "type": "git", + "url": "git+https://github.com/ethcore/parity.git" + }, + "keywords": [ + "Ethereum", + "ABI", + "API", + "RPC", + "Parity", + "Promise" + ], + "scripts": { + }, + "devDependencies": { + }, + "dependencies": { + "node-fetch": "~1.6.3" + } +} diff --git a/js/npm/test/mocha.config.js b/js/npm/test/mocha.config.js new file mode 100644 index 000000000..2b871f518 --- /dev/null +++ b/js/npm/test/mocha.config.js @@ -0,0 +1,29 @@ +// Copyright 2015, 2016 Ethcore (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +const chai = require('chai'); +// const chaiAsPromised from 'chai-as-promised'; +// const chaiEnzyme from 'chai-enzyme'; +// const sinonChai from 'sinon-chai'; + +// chai.use(chaiAsPromised); +// chai.use(chaiEnzyme()); +// chai.use(sinonChai); + +// expose expect to global so we won't have to manually import & define it in every test +global.expect = chai.expect; + +module.exports = {}; diff --git a/js/npm/test/mocha.opts b/js/npm/test/mocha.opts new file mode 100644 index 000000000..0ed8269b4 --- /dev/null +++ b/js/npm/test/mocha.opts @@ -0,0 +1 @@ +-r ./test/mocha.config diff --git a/js/package.json b/js/package.json index f0e925fe4..4a15e9fee 100644 --- a/js/package.json +++ b/js/package.json @@ -43,7 +43,7 @@ "test": "NODE_ENV=test mocha 'src/**/*.spec.js'", "test:coverage": "NODE_ENV=test istanbul cover _mocha -- 'src/**/*.spec.js'", "test:e2e": "NODE_ENV=test mocha 'src/**/*.e2e.js'", - "test:npm": "(cd .npmjs && npm i) && node test/npmLibrary && (rm -rf .npmjs/node_modules)", + "test:npm": "(cd .npmjs && npm i) && node test/npmParity && (rm -rf .npmjs/node_modules)", "prepush": "npm run lint:cached" }, "devDependencies": { diff --git a/js/scripts/dryrun-npm.sh b/js/scripts/dryrun-npm.sh new file mode 100755 index 000000000..21e00f157 --- /dev/null +++ b/js/scripts/dryrun-npm.sh @@ -0,0 +1,33 @@ +#!/bin/bash +set -e + +# variables +PACKAGES=( "Parity" "Etherscan" "ShapeShift" ) + +# change into the build directory +BASEDIR=`dirname $0` +cd $BASEDIR/.. + +# build all packages +echo "*** Building packages for npmjs" +echo "$NPM_TOKEN" >> ~/.npmrc + +for PACKAGE in ${PACKAGES[@]} +do + echo "*** Building $PACKAGE" + LIBRARY=$PACKAGE npm run ci:build:npm + DIRECTORY=.npmjs/$(echo $PACKAGE | tr '[:upper:]' '[:lower:]') + + cd $DIRECTORY + echo "*** Executing $PACKAGE tests from $DIRECTORY" + npm test + + echo "*** Publishing $PACKAGE from $DIRECTORY" + echo "npm publish --access public || true" + cd ../.. + +done +cd .. + +# exit with exit code +exit 0 diff --git a/js/scripts/release.sh b/js/scripts/release.sh index 1cf3095ef..e120aaf95 100755 --- a/js/scripts/release.sh +++ b/js/scripts/release.sh @@ -3,7 +3,7 @@ set -e # variables UTCDATE=`date -u "+%Y%m%d-%H%M%S"` -PACKAGES=( "parity.js" ) +PACKAGES=( "Parity" "Etherscan" "ShapeShift" ) BRANCH=$CI_BUILD_REF_NAME GIT_JS_PRECOMPILED="https://${GITHUB_JS_PRECOMPILED}:@github.com/ethcore/js-precompiled.git" GIT_PARITY="https://${GITHUB_JS_PRECOMPILED}:@github.com/ethcore/parity.git" @@ -59,19 +59,27 @@ git reset --hard origin/$BRANCH 2>$GITLOG if [ "$BRANCH" == "master" ]; then cd js + echo "*** Bumping package.json patch version" npm --no-git-tag-version version npm version patch echo "*** Building packages for npmjs" - # echo -e "$NPM_USERNAME\n$NPM_PASSWORD\n$NPM_EMAIL" | npm login echo "$NPM_TOKEN" >> ~/.npmrc - npm run ci:build:npm - echo "*** Publishing $PACKAGE to npmjs" - cd .npmjs - npm publish --access public || true - cd ../.. + for PACKAGE in ${PACKAGES[@]} + do + echo "*** Building $PACKAGE" + LIBRARY=$PACKAGE npm run ci:build:npm + DIRECTORY=.npmjs/$(echo $PACKAGE | tr '[:upper:]' '[:lower:]') + + echo "*** Publishing $PACKAGE from $DIRECTORY" + cd $DIRECTORY + npm publish --access public || true + cd ../.. + done + + cd .. fi echo "*** Updating cargo parity-ui-precompiled#$PRECOMPILED_HASH" diff --git a/js/src/3rdparty/etherscan/account.spec.js b/js/src/3rdparty/etherscan/account.spec.js index 283fab3d2..9dc36c254 100644 --- a/js/src/3rdparty/etherscan/account.spec.js +++ b/js/src/3rdparty/etherscan/account.spec.js @@ -14,11 +14,13 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -import etherscan from './'; +const etherscan = require('./'); const TESTADDR = '0xbf885e2b55c6bcc84556a3c5f07d3040833c8d00'; -describe.skip('etherscan/account', () => { +describe.skip('etherscan/account', function () { + this.timeout(60 * 1000); + const checkBalance = function (balance, addr) { expect(balance).to.be.ok; expect(balance.account).to.equal(addr); diff --git a/js/src/3rdparty/etherscan/stats.spec.js b/js/src/3rdparty/etherscan/stats.spec.js index fde2b035c..62152b6be 100644 --- a/js/src/3rdparty/etherscan/stats.spec.js +++ b/js/src/3rdparty/etherscan/stats.spec.js @@ -14,9 +14,11 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -import etherscan from './'; +const etherscan = require('./'); + +describe.skip('etherscan/stats', function () { + this.timeout(60 * 1000); -describe.skip('etherscan/stats', () => { it('retrieves the latest price', () => { return etherscan.stats .price() diff --git a/js/src/3rdparty/shapeshift/helpers.spec.js b/js/src/3rdparty/shapeshift/helpers.spec.js index a82b2f6c3..f2ea0f3f9 100644 --- a/js/src/3rdparty/shapeshift/helpers.spec.js +++ b/js/src/3rdparty/shapeshift/helpers.spec.js @@ -14,22 +14,15 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -import chai from 'chai'; -import nock from 'nock'; +const nock = require('nock'); -global.expect = chai.expect; // eslint-disable-line no-undef - -import 'isomorphic-fetch'; -import es6Promise from 'es6-promise'; -es6Promise.polyfill(); - -import initShapeshift from './'; -import initRpc from './rpc'; +const ShapeShift = require('./'); +const initShapeshift = (ShapeShift.default || ShapeShift); const APIKEY = '0x123454321'; const shapeshift = initShapeshift(APIKEY); -const rpc = initRpc(APIKEY); +const rpc = shapeshift.getRpc(); function mockget (requests) { let scope = nock(rpc.ENDPOINT); @@ -62,7 +55,7 @@ function mockpost (requests) { return scope; } -export { +module.exports = { APIKEY, mockget, mockpost, diff --git a/js/src/3rdparty/shapeshift/rpc.spec.js b/js/src/3rdparty/shapeshift/rpc.spec.js index 8de9e8641..47d4e0052 100644 --- a/js/src/3rdparty/shapeshift/rpc.spec.js +++ b/js/src/3rdparty/shapeshift/rpc.spec.js @@ -14,7 +14,12 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -import { APIKEY, mockget, mockpost, rpc } from './helpers.spec.js'; +const helpers = require('./helpers.spec.js'); + +const APIKEY = helpers.APIKEY; +const mockget = helpers.mockget; +const mockpost = helpers.mockpost; +const rpc = helpers.rpc; describe('shapeshift/rpc', () => { describe('GET', () => { diff --git a/js/src/3rdparty/shapeshift/shapeshift.js b/js/src/3rdparty/shapeshift/shapeshift.js index 8f388d0a7..5743fcac1 100644 --- a/js/src/3rdparty/shapeshift/shapeshift.js +++ b/js/src/3rdparty/shapeshift/shapeshift.js @@ -26,6 +26,10 @@ export default function (rpc) { return rpc.get(`marketinfo/${pair}`); } + function getRpc () { + return rpc; + } + function getStatus (depositAddress) { return rpc.get(`txStat/${depositAddress}`); } @@ -103,6 +107,7 @@ export default function (rpc) { return { getCoins, getMarketInfo, + getRpc, getStatus, shift, subscribe, diff --git a/js/src/3rdparty/shapeshift/shapeshift.spec.js b/js/src/3rdparty/shapeshift/shapeshift.spec.js index 36b1506a2..01180e130 100644 --- a/js/src/3rdparty/shapeshift/shapeshift.spec.js +++ b/js/src/3rdparty/shapeshift/shapeshift.spec.js @@ -14,7 +14,11 @@ // You should have received a copy of the GNU General Public License // along with Parity. If not, see . -import { mockget, mockpost, shapeshift } from './helpers.spec.js'; +const helpers = require('./helpers.spec.js'); + +const mockget = helpers.mockget; +const mockpost = helpers.mockpost; +const shapeshift = helpers.shapeshift; describe('shapeshift/calls', () => { describe('getCoins', () => { diff --git a/js/src/library.etherscan.js b/js/src/library.etherscan.js new file mode 100644 index 000000000..59cb861d3 --- /dev/null +++ b/js/src/library.etherscan.js @@ -0,0 +1,34 @@ +// Copyright 2015, 2016 Ethcore (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +import 'babel-polyfill/dist/polyfill.js'; +import es6Promise from 'es6-promise'; +es6Promise.polyfill(); + +const isNode = typeof global !== 'undefined' && typeof global !== 'undefined'; +const isBrowser = typeof self !== 'undefined' && typeof self.window !== 'undefined'; + +if (isBrowser) { + require('whatwg-fetch'); +} + +if (isNode) { + global.fetch = require('node-fetch'); +} + +import Etherscan from './3rdparty/etherscan'; + +module.exports = Etherscan; diff --git a/js/src/library.js b/js/src/library.parity.js similarity index 100% rename from js/src/library.js rename to js/src/library.parity.js diff --git a/js/src/library.shapeshift.js b/js/src/library.shapeshift.js new file mode 100644 index 000000000..3f24f216b --- /dev/null +++ b/js/src/library.shapeshift.js @@ -0,0 +1,34 @@ +// Copyright 2015, 2016 Ethcore (UK) Ltd. +// This file is part of Parity. + +// Parity is free software: you can redistribute it and/or modify +// it under the terms of the GNU General Public License as published by +// the Free Software Foundation, either version 3 of the License, or +// (at your option) any later version. + +// Parity is distributed in the hope that it will be useful, +// but WITHOUT ANY WARRANTY; without even the implied warranty of +// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +// GNU General Public License for more details. + +// You should have received a copy of the GNU General Public License +// along with Parity. If not, see . + +import 'babel-polyfill/dist/polyfill.js'; +import es6Promise from 'es6-promise'; +es6Promise.polyfill(); + +const isNode = typeof global !== 'undefined' && typeof global !== 'undefined'; +const isBrowser = typeof self !== 'undefined' && typeof self.window !== 'undefined'; + +if (isBrowser) { + require('whatwg-fetch'); +} + +if (isNode) { + global.fetch = require('node-fetch'); +} + +import ShapeShift from './3rdparty/shapeshift'; + +module.exports = ShapeShift; diff --git a/js/test/npmLibrary.js b/js/test/npmParity.js similarity index 92% rename from js/test/npmLibrary.js rename to js/test/npmParity.js index 63d8f9515..6e125e9e2 100644 --- a/js/test/npmLibrary.js +++ b/js/test/npmParity.js @@ -15,8 +15,8 @@ // along with Parity. If not, see . try { - var Api = require('../.npmjs/library.js').Api; - var Abi = require('../.npmjs/library.js').Abi; + var Api = require('../.npmjs/parity/library.js').Api; + var Abi = require('../.npmjs/parity/library.js').Abi; if (typeof Api !== 'function') { throw new Error('No Api'); diff --git a/js/webpack/npm.js b/js/webpack/npm.js index 7353efe55..a1bbaeda9 100644 --- a/js/webpack/npm.js +++ b/js/webpack/npm.js @@ -23,14 +23,27 @@ const Shared = require('./shared'); const ENV = process.env.NODE_ENV || 'development'; const isProd = ENV === 'production'; +const LIBRARY = process.env.LIBRARY; +if (!LIBRARY) { + process.exit(-1); +} +const SRC = LIBRARY.toLowerCase(); +const OUTPUT_PATH = path.join(__dirname, '../.npmjs', SRC); + +const TEST_CONTEXT = SRC === 'parity' + ? '../npm/parity/test/' + : `../src/3rdparty/${SRC}/`; + +console.log(`Building ${LIBRARY} from library.${SRC}.js to .npmjs/${SRC}`); + module.exports = { context: path.join(__dirname, '../src'), target: 'node', - entry: 'library.js', + entry: `library.${SRC}.js`, output: { - path: path.join(__dirname, '../.npmjs'), + path: OUTPUT_PATH, filename: 'library.js', - library: 'Parity', + library: LIBRARY, libraryTarget: 'umd', umdNamedDefine: true }, @@ -66,19 +79,52 @@ module.exports = { plugins: Shared.getPlugins().concat([ new CopyWebpackPlugin([ { - from: '../parity.package.json', + from: `../npm/${SRC}/package.json`, to: 'package.json', transform: function (content, path) { const json = JSON.parse(content.toString()); json.version = packageJson.version; + + // Add tests dependencies to Dev Deps + json.devDependencies.chai = packageJson.devDependencies.chai; + json.devDependencies.mocha = packageJson.devDependencies.mocha; + json.devDependencies.nock = packageJson.devDependencies.nock; + + // Add test script + json.scripts.test = 'mocha \'test/*.spec.js\''; + return new Buffer(JSON.stringify(json, null, ' '), 'utf-8'); } }, { from: '../LICENSE' }, + + // Copy the base test config { - from: '../parity.md', + from: '../npm/test', + to: 'test' + }, + + // Copy the actual tests + { + context: TEST_CONTEXT, + from: '**/*.spec.js', + to: 'test', + transform: function (content, path) { + let output = content.toString(); + + // Don't skip tests + output = output.replace(/describe\.skip/, 'describe'); + + // Require parent library + output = output.replace('require(\'./\')', 'require(\'../\')'); + + return new Buffer(output, 'utf-8'); + } + }, + { + from: `../npm/${SRC}/README.md`, to: 'README.md' } ], { copyUnmodified: true })