diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 000000000..a836e072a --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +* text=auto +test/fixtures/** text eol=lf diff --git a/.travis.yml b/.travis.yml index 5102ee5ff..fb59f0eeb 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,32 +1,46 @@ -# Warning: This file is automatically synced from https://github.com/ipfs/ci-sync so if you want to change it, please change it there and ask someone to sync all repositories. -sudo: false language: node_js +cache: npm +stages: + - check + - test + - cov -matrix: +node_js: + - '10' + +os: + - linux + - osx + - windows + +script: npx nyc -s npm run test:node -- --bail +after_success: npx nyc report --reporter=text-lcov > coverage.lcov && npx codecov + +jobs: include: - - node_js: 6 - env: CXX=g++-4.8 - - node_js: 8 - env: CXX=g++-4.8 - # - node_js: stable - # env: CXX=g++-4.8 - -script: - - npm run lint - - npm run test - - npm run coverage - -before_script: - - export DISPLAY=:99.0 - - sh -e /etc/init.d/xvfb start - -after_success: - - npm run coverage-publish - -addons: - firefox: 'latest' - apt: - sources: - - ubuntu-toolchain-r-test - packages: - - g++-4.8 + - stage: check + script: + - npx aegir commitlint --travis + - npx aegir dep-check + - npm run lint + + - stage: test + name: chrome + addons: + chrome: stable + script: npx aegir test -t browser + + - stage: test + name: firefox + addons: + firefox: latest + script: npx aegir test -t browser -- --browsers FirefoxHeadless + + - stage: test + name: webworker + addons: + chrome: stable + script: npx aegir test -t webworker + +notifications: + email: false diff --git a/README.md b/README.md index 4bcc34255..f8bb44c80 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@

- +
diff --git a/appveyor.yml b/appveyor.yml deleted file mode 100644 index 046bf9108..000000000 --- a/appveyor.yml +++ /dev/null @@ -1,29 +0,0 @@ -# Warning: This file is automatically synced from https://github.com/ipfs/ci-sync so if you want to change it, please change it there and ask someone to sync all repositories. -version: "{build}" - -environment: - matrix: - - nodejs_version: "6" - - nodejs_version: "8" - -matrix: - fast_finish: true - -install: - # Install Node.js - - ps: Install-Product node $env:nodejs_version - - # Upgrade npm - - npm install -g npm - - # Output our current versions for debugging - - node --version - - npm --version - - # Install our package dependencies - - npm install - -test_script: - - npm run test:node - -build: off diff --git a/ci/Jenkinsfile b/ci/Jenkinsfile deleted file mode 100644 index a7da2e54f..000000000 --- a/ci/Jenkinsfile +++ /dev/null @@ -1,2 +0,0 @@ -// Warning: This file is automatically synced from https://github.com/ipfs/ci-sync so if you want to change it, please change it there and ask someone to sync all repositories. -javascript() diff --git a/circle.yml b/circle.yml deleted file mode 100644 index e0338e62d..000000000 --- a/circle.yml +++ /dev/null @@ -1,19 +0,0 @@ -# Warning: This file is automatically synced from https://github.com/ipfs/ci-sync so if you want to change it, please change it there and ask someone to sync all repositories. -machine: - node: - version: stable - -test: - post: - - npm run coverage -- --upload --providers coveralls - -dependencies: - pre: - - google-chrome --version - - curl -L -o google-chrome.deb https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb - - sudo dpkg -i google-chrome.deb || true - - sudo apt-get update - - sudo apt-get install -f - - sudo apt-get install --only-upgrade lsb-base - - sudo dpkg -i google-chrome.deb - - google-chrome --version diff --git a/src/files-regular/get-pull-stream.js b/src/files-regular/get-pull-stream.js index d86088e30..c7d8aa7a4 100644 --- a/src/files-regular/get-pull-stream.js +++ b/src/files-regular/get-pull-stream.js @@ -3,7 +3,6 @@ const cleanCID = require('../utils/clean-cid') const TarStreamToObjects = require('../utils/tar-stream-to-objects') const v = require('is-ipfs') -const through = require('through2') const pull = require('pull-stream') const toPull = require('stream-to-pull-stream') const deferred = require('pull-defer') @@ -28,15 +27,15 @@ module.exports = (send) => { send.andTransform(request, TarStreamToObjects, (err, stream) => { if (err) { return p.end(err) } - const files = [] - stream.pipe(through.obj((file, enc, next) => { - if (file.content) { - files.push({ path: file.path, content: toPull(file.content) }) - } else { - files.push(file) - } - next() - }, () => p.resolve(pull.values(files)))) + p.resolve( + pull( + toPull.source(stream), + pull.map(file => { + const { path, content } = file + return content ? { path, content: toPull.source(content) } : file + }) + ) + ) }) return p