diff --git a/appveyor.yml b/appveyor.yml new file mode 100644 index 0000000..de3e378 --- /dev/null +++ b/appveyor.yml @@ -0,0 +1,23 @@ +environment: + matrix: + - nodejs_version: "6" + - nodejs_version: "8" + +# cache: +# - node_modules + +platform: + - x64 + +install: + - ps: Install-Product node $env:nodejs_version $env:platform + - npm install + +test_script: + - node --version + - npm --version + - npm test + +build: off + +version: "{build}" diff --git a/package.json b/package.json index 63cba49..317b924 100644 --- a/package.json +++ b/package.json @@ -32,10 +32,10 @@ "homepage": "https://github.com/ipld/js-ipld-resolver#readme", "license": "MIT", "devDependencies": { - "aegir": "^12.0.8", + "aegir": "^12.1.3", "chai": "^4.1.2", "dirty-chai": "^2.0.1", - "eth-hash-to-cid": "^0.1.0", + "eth-hash-to-cid": "~0.1.0", "ethereumjs-block": "^1.7.0", "lodash": "^4.17.4", "ncp": "^2.0.0", @@ -46,20 +46,20 @@ "dependencies": { "async": "^2.5.0", "cids": "~0.5.2", - "interface-datastore": "^0.3.1", - "ipfs-block": "~0.6.0", - "ipfs-block-service": "~0.12.0", - "ipfs-repo": "~0.17.0", + "interface-datastore": "~0.4.1", + "ipfs-block": "~0.6.1", + "ipfs-block-service": "~0.13.0", + "ipfs-repo": "~0.18.2", "ipld-dag-cbor": "~0.11.1", "ipld-dag-pb": "~0.11.2", "ipld-ethereum": "^1.4.3", - "ipld-git": "^0.1.0", + "ipld-git": "~0.1.0", "ipld-raw": "^1.0.6", "is-ipfs": "~0.3.2", "lodash.flatten": "^4.4.0", "lodash.includes": "^4.3.0", "memdown": "^1.4.1", - "multihashes": "~0.4.9", + "multihashes": "~0.4.12", "pull-sort": "^1.0.1", "pull-stream": "^3.6.1", "pull-traverse": "^1.0.3" diff --git a/src/index.js b/src/index.js index 1b07b0a..353c5fb 100644 --- a/src/index.js +++ b/src/index.js @@ -7,6 +7,7 @@ const doUntil = require('async/doUntil') const IPFSRepo = require('ipfs-repo') const BlockService = require('ipfs-block-service') const joinPath = require('path').join +const osPathSep = require('path').sep const pullDeferSource = require('pull-defer').source const pullTraverse = require('pull-traverse') const map = require('async/map') @@ -116,8 +117,12 @@ class IPLDResolver { // this removes occurrences of ./, //, ../ // makes sure that path never starts with ./ or / + // path.join is OS specific. Need to convert back to POSIX format. if (typeof path === 'string') { - path = joinPath('/', path).substr(1) + path = joinPath('/', path) + .substr(1) + .split(osPathSep) + .join('/') } if (path === '' || !path) { diff --git a/test/ipld-eth.js b/test/ipld-eth.js index c7d0b82..2331b33 100644 --- a/test/ipld-eth.js +++ b/test/ipld-eth.js @@ -21,7 +21,8 @@ module.exports = (repo) => { let ethObjs - before((done) => { + before(function (done) { + this.timeout(10 * 1000) const bs = new BlockService(repo) resolver = new IPLDResolver(bs)