Skip to content
This repository was archived by the owner on Aug 12, 2020. It is now read-only.

Commit c24e027

Browse files
ready for the next level
1 parent d8b68ef commit c24e027

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

46 files changed

+42
-209
lines changed

.travis.yml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,16 @@
11
sudo: false
22
language: node_js
3-
node_js:
4-
- 4
5-
- 6
6-
- stable
3+
4+
matrix:
5+
include:
6+
- node_js: 4
7+
env: CXX=g++-4.8
8+
- node_js: 6
9+
env:
10+
- SAUCE=true
11+
- CXX=g++-4.8
12+
- node_js: stable
13+
env: CXX=g++-4.8
714

815
# Make sure we have new NPM.
916
before_install:
@@ -14,12 +21,17 @@ script:
1421
- npm test
1522
- npm run coverage
1623

17-
addons:
18-
firefox: 'latest'
19-
2024
before_script:
2125
- export DISPLAY=:99.0
2226
- sh -e /etc/init.d/xvfb start
2327

2428
after_success:
2529
- npm run coverage-publish
30+
31+
addons:
32+
firefox: 'latest'
33+
apt:
34+
sources:
35+
- ubuntu-toolchain-r-test
36+
packages:
37+
- g++-4.8

README.md

Lines changed: 6 additions & 2 deletions

package.json

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,9 @@
33
"version": "0.12.0",
44
"description": "JavaScript implementation of the unixfs Engine used by IPFS",
55
"main": "src/index.js",
6+
"browser": {
7+
"fs": false
8+
},
69
"scripts": {
710
"lint": "aegir-lint",
811
"build": "aegir-build",
@@ -36,7 +39,7 @@
3639
},
3740
"homepage": "https://github.com/ipfs/js-ipfs-unixfs-engine#readme",
3841
"devDependencies": {
39-
"aegir": "^8.1.2",
42+
"aegir": "^9.0.1",
4043
"buffer-loader": "0.0.1",
4144
"chai": "^3.5.0",
4245
"fs-pull-blob-store": "^0.4.1",
@@ -46,23 +49,22 @@
4649
"ncp": "^2.0.0",
4750
"pre-commit": "^1.1.3",
4851
"pull-zip": "^2.0.1",
49-
"raw-loader": "^0.5.1",
5052
"rimraf": "^2.5.4"
5153
},
5254
"dependencies": {
53-
"async": "^2.0.1",
55+
"async": "^2.1.2",
5456
"cids": "^0.2.0",
5557
"ipfs-unixfs": "^0.1.4",
5658
"ipld-dag-pb": "^0.1.3",
57-
"ipld-resolver": "^0.1.1",
59+
"ipld-resolver": "^0.1.2",
5860
"is-ipfs": "^0.2.1",
5961
"multihashes": "^0.2.2",
6062
"pull-block": "^1.0.2",
6163
"pull-paramap": "^1.2.0",
6264
"pull-pushable": "^2.0.1",
6365
"pull-stream": "^3.4.5",
6466
"pull-traverse": "^1.0.3",
65-
"pull-write": "^1.1.1",
67+
"pull-write": "^1.1.1"
6668
},
6769
"contributors": [
6870
"David Dias <[email protected]>",
@@ -74,4 +76,4 @@
7476
"jbenet <[email protected]>",
7577
"nginnever <[email protected]>"
7678
]
77-
}
79+
}

src/exporter/index.js

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,8 @@
22

33
const traverse = require('pull-traverse')
44
const pull = require('pull-stream')
5-
<<<<<<< HEAD:src/exporter/index.js
65
const CID = require('cids')
7-
=======
86
const isIPFS = require('is-ipfs')
9-
>>>>>>> fix some more tests:src/exporter.js
107

118
const util = require('./../util')
129
const switchType = util.switchType

src/importer.js

Lines changed: 0 additions & 173 deletions
This file was deleted.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

test/test-exporter.js

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,22 +5,21 @@ const expect = require('chai').expect
55
const BlockService = require('ipfs-block-service')
66
const IPLDResolver = require('ipld-resolver')
77
const UnixFS = require('ipfs-unixfs')
8-
const fs = require('fs')
9-
const path = require('path')
108
const bs58 = require('bs58')
119
const pull = require('pull-stream')
1210
const zip = require('pull-zip')
1311
const CID = require('cids')
12+
const loadFixture = require('aegir/fixtures')
1413

1514
const unixFSEngine = require('./../src')
1615
const exporter = unixFSEngine.exporter
1716

17+
const bigFile = loadFixture(__dirname, 'fixtures/1.2MiB.txt')
18+
1819
module.exports = (repo) => {
1920
describe('exporter', () => {
2021
let ipldResolver
2122

22-
const bigFile = fs.readFileSync(path.join(__dirname, '/test-data/1.2MiB.txt'))
23-
2423
before(() => {
2524
const bs = new BlockService(repo)
2625
ipldResolver = new IPLDResolver(bs)

test/test-fixed-size-chunker.js

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,11 @@
22
'use strict'
33

44
const chunker = require('./../src/chunker/fixed-size')
5-
const fs = require('fs')
65
const expect = require('chai').expect
7-
const path = require('path')
86
const pull = require('pull-stream')
7+
const loadFixture = require('aegir/fixtures')
98

10-
const rawFile = fs.readFileSync(
11-
path.join(__dirname, '/test-data/1MiB.txt')
12-
)
9+
const rawFile = loadFixture(__dirname, 'fixtures/1MiB.txt')
1310

1411
describe('chunker: fixed size', () => {
1512
it('chunks non flat buffers', (done) => {

test/test-importer.js

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,10 @@
44
const importer = require('./../src').importer
55
const expect = require('chai').expect
66
const BlockService = require('ipfs-block-service')
7-
const fs = require('fs')
8-
const path = require('path')
97
const pull = require('pull-stream')
108
const mh = require('multihashes')
119
const IPLDResolver = require('ipld-resolver')
10+
const loadFixture = require('aegir/fixtures')
1211

1312
function stringifyMh (files) {
1413
return files.map((file) => {
@@ -17,17 +16,13 @@ function stringifyMh (files) {
1716
})
1817
}
1918

19+
const bigFile = loadFixture(__dirname, 'fixtures/1.2MiB.txt')
20+
const smallFile = loadFixture(__dirname, 'fixtures/200Bytes.txt')
21+
2022
module.exports = function (repo) {
2123
describe('importer', function () {
2224
let ipldResolver
2325

24-
const bigFile = fs.readFileSync(path.join(__dirname, '/test-data/1.2MiB.txt'))
25-
const smallFile = fs.readFileSync(path.join(__dirname, '/test-data/200Bytes.txt'))
26-
27-
// const dirSmall = path.join(__dirname, '/test-data/dir-small')
28-
// const dirBig = path.join(__dirname, '/test-data/dir-big')
29-
// const dirNested = path.join(__dirname, '/test-data/dir-nested')
30-
3126
before(() => {
3227
const bs = new BlockService(repo)
3328
ipldResolver = new IPLDResolver(bs)

0 commit comments

Comments
 (0)