From 7eb630d55f3facf722b2a56b5d5102b9ff4a489e Mon Sep 17 00:00:00 2001 From: David Dias Date: Fri, 10 Feb 2017 20:49:41 -0800 Subject: [PATCH] fix: make sure all deps are up to date, expose Buffer type --- examples/bundle-browserify/package.json | 4 ++-- examples/bundle-browserify/src/index.js | 8 ++++++-- package.json | 6 +++--- src/core/index.js | 4 +++- 4 files changed, 14 insertions(+), 8 deletions(-) diff --git a/examples/bundle-browserify/package.json b/examples/bundle-browserify/package.json index be1f8cecee..e51462fa19 100644 --- a/examples/bundle-browserify/package.json +++ b/examples/bundle-browserify/package.json @@ -11,8 +11,8 @@ "keywords": [], "license": "MIT", "devDependencies": { - "browserify": "^13.1.1", - "concat-stream": "^1.5.2", + "browserify": "^14.0.0", + "concat-stream": "^1.6.0", "http-server": "^0.9.0", "browserify-zlib-next": "^1.0.1" }, diff --git a/examples/bundle-browserify/src/index.js b/examples/bundle-browserify/src/index.js index bb95e3f48a..ac187e5c8b 100644 --- a/examples/bundle-browserify/src/index.js +++ b/examples/bundle-browserify/src/index.js @@ -1,19 +1,23 @@ 'use strict' -var IPFS = require('../../../src/core') // replace this by line below +const concat = require('concat-stream') +const IPFS = require('../../../src/core') // replace this by line below // var IPFS = require('ipfs') // Create the IPFS node instance // for simplicity, we create a new repo everytime the node // is created, because you can't init already existing repos const repoPath = String(Math.random()) + const node = new IPFS({ repo: repoPath, EXPERIMENTAL: { pubsub: false } }) -const concat = require('concat-stream') + +// expose the node to the window, for the fun! +window.ipfs = node node.init({ emptyRepo: true, bits: 2048 }, function (err) { if (err) { diff --git a/package.json b/package.json index 97d213e7ff..83629c1d6e 100644 --- a/package.json +++ b/package.json @@ -90,7 +90,7 @@ "async": "^2.1.4", "bl": "^1.2.0", "boom": "^4.2.0", - "debug": "^2.6.0", + "debug": "^2.6.1", "fs-pull-blob-store": "~0.3.0", "glob": "^7.1.1", "hapi": "^16.1.0", @@ -109,8 +109,8 @@ "isstream": "^0.1.2", "joi": "^10.2.2", "libp2p-floodsub": "~0.7.3", - "libp2p-ipfs-browser": "~0.18.0", - "libp2p-ipfs-nodejs": "~0.18.0", + "libp2p-ipfs-browser": "~0.18.2", + "libp2p-ipfs-nodejs": "~0.18.1", "lodash.flatmap": "^4.5.0", "lodash.get": "^4.4.2", "lodash.has": "^4.5.2", diff --git a/src/core/index.js b/src/core/index.js index 3c6d3470e3..ff1a682877 100644 --- a/src/core/index.js +++ b/src/core/index.js @@ -22,7 +22,9 @@ class IPFS { configOpts.EXPERIMENTAL = configOpts.EXPERIMENTAL || {} // IPFS utils - this.types = {} + this.types = { + Buffer: Buffer + } this.log = debug('jsipfs') this.log.err = debug('jsipfs:err')