Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: ipfs/js-ipfs-unixfs
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: dedbd82c3ac4f6f1dc40cd084453b627abdcfc36
Choose a base ref
...
head repository: ipfs/js-ipfs-unixfs
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 0316760b74c300dc9a46e5d09f98b27f285b1065
Choose a head ref
Loading
Showing with 2,001 additions and 1,196 deletions.
  1. +11 −0 .github/dependabot.yml
  2. +11 −0 .github/workflows/automerge.yml
  3. +148 −0 .github/workflows/js-test-and-release.yml
  4. +26 −0 .github/workflows/stale.yml
  5. +1 −0 .gitignore
  6. +0 −101 .travis.yml
  7. +3 −21 LICENSE
  8. +5 −0 LICENSE-APACHE
  9. +19 −0 LICENSE-MIT
  10. +34 −20 README.md
  11. +2 −13 lerna.json
  12. +29 −47 package.json
  13. +2 −31 packages/ipfs-unixfs-exporter/.aegir.js
  14. +144 −0 packages/ipfs-unixfs-exporter/CHANGELOG.md
  15. +3 −21 packages/ipfs-unixfs-exporter/LICENSE
  16. +5 −0 packages/ipfs-unixfs-exporter/LICENSE-APACHE
  17. +19 −0 packages/ipfs-unixfs-exporter/LICENSE-MIT
  18. +62 −48 packages/ipfs-unixfs-exporter/README.md
  19. +157 −53 packages/ipfs-unixfs-exporter/package.json
  20. +7 −15 packages/ipfs-unixfs-exporter/src/index.js
  21. +4 −6 packages/ipfs-unixfs-exporter/src/resolvers/dag-cbor.js
  22. +5 −7 packages/ipfs-unixfs-exporter/src/resolvers/identity.js
  23. +14 −11 packages/ipfs-unixfs-exporter/src/resolvers/index.js
  24. +4 −6 packages/ipfs-unixfs-exporter/src/resolvers/raw.js
  25. +1 −3 packages/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/directory.js
  26. +9 −11 packages/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/file.js
  27. +2 −4 packages/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/hamt-sharded-directory.js
  28. +3 −5 packages/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/content/raw.js
  29. +13 −11 packages/ipfs-unixfs-exporter/src/resolvers/unixfs-v1/index.js
  30. +0 −70 packages/ipfs-unixfs-exporter/src/types.d.ts
  31. +70 −0 packages/ipfs-unixfs-exporter/src/types.ts
  32. +3 −3 packages/ipfs-unixfs-exporter/src/utils/extract-data-from-block.js
  33. +12 −9 packages/ipfs-unixfs-exporter/src/utils/find-cid-in-shard.js
  34. +2 −4 packages/ipfs-unixfs-exporter/src/utils/validate-offset-and-length.js
  35. +13 −15 packages/ipfs-unixfs-exporter/test/exporter-sharded.spec.js
  36. +10 −12 packages/ipfs-unixfs-exporter/test/exporter-subtree.spec.js
  37. +33 −34 packages/ipfs-unixfs-exporter/test/exporter.spec.js
  38. +1 −3 packages/ipfs-unixfs-exporter/test/helpers/as-async-iterable.js
  39. +46 −5 packages/ipfs-unixfs-exporter/test/helpers/block.js
  40. +2 −4 packages/ipfs-unixfs-exporter/test/helpers/collect-leaf-cids.js
  41. +11 −13 packages/ipfs-unixfs-exporter/test/import-export-dir-sharding.spec.js
  42. +9 −11 packages/ipfs-unixfs-exporter/test/import-export-nested-dir.spec.js
  43. +10 −13 packages/ipfs-unixfs-exporter/test/import-export.spec.js
  44. +72 −32 packages/ipfs-unixfs-exporter/test/importer.spec.js
  45. +4 −5 packages/ipfs-unixfs-exporter/tsconfig.json
  46. +2 −31 packages/ipfs-unixfs-importer/.aegir.js
  47. +142 −0 packages/ipfs-unixfs-importer/CHANGELOG.md
  48. +3 −21 packages/ipfs-unixfs-importer/LICENSE
  49. +5 −0 packages/ipfs-unixfs-importer/LICENSE-APACHE
  50. +19 −0 packages/ipfs-unixfs-importer/LICENSE-MIT
  51. +47 −29 packages/ipfs-unixfs-importer/README.md
  52. +153 −46 packages/ipfs-unixfs-importer/package.json
  53. +4 −4 packages/ipfs-unixfs-importer/src/chunker/fixed-size.js
  54. +0 −31 packages/ipfs-unixfs-importer/src/chunker/index.js
  55. +6 −6 packages/ipfs-unixfs-importer/src/chunker/rabin.js
  56. +4 −6 packages/ipfs-unixfs-importer/src/dag-builder/dir.js
  57. +2 −4 packages/ipfs-unixfs-importer/src/dag-builder/file/balanced.js
  58. +6 −10 packages/ipfs-unixfs-importer/src/dag-builder/file/buffer-importer.js
  59. +4 −4 packages/ipfs-unixfs-importer/src/dag-builder/file/flat.js
  60. +18 −15 packages/ipfs-unixfs-importer/src/dag-builder/file/index.js
  61. +4 −4 packages/ipfs-unixfs-importer/src/dag-builder/file/trickle.js
  62. +10 −9 packages/ipfs-unixfs-importer/src/dag-builder/index.js
  63. +3 −5 packages/ipfs-unixfs-importer/src/dag-builder/validate-chunks.js
  64. +5 −7 packages/ipfs-unixfs-importer/src/dir-flat.js
  65. +6 −8 packages/ipfs-unixfs-importer/src/dir-sharded.js
  66. +2 −4 packages/ipfs-unixfs-importer/src/dir.js
  67. +6 −6 packages/ipfs-unixfs-importer/src/flat-to-shard.js
  68. +7 −11 packages/ipfs-unixfs-importer/src/index.js
  69. +7 −10 packages/ipfs-unixfs-importer/src/options.js
  70. +5 −7 packages/ipfs-unixfs-importer/src/tree-builder.js
  71. +24 −24 packages/ipfs-unixfs-importer/src/{types.d.ts → types.ts}
  72. +4 −6 packages/ipfs-unixfs-importer/src/utils/persist.js
  73. +2 −4 packages/ipfs-unixfs-importer/src/utils/to-path-components.js
  74. +3 −5 packages/ipfs-unixfs-importer/test/benchmark.spec.js
  75. +4 −6 packages/ipfs-unixfs-importer/test/builder-balanced.spec.js
  76. +2 −3 packages/ipfs-unixfs-importer/test/builder-flat.spec.js
  77. +7 −8 packages/ipfs-unixfs-importer/test/builder-only-hash.spec.js
  78. +3 −4 packages/ipfs-unixfs-importer/test/builder-trickle-dag.spec.js
  79. +11 −13 packages/ipfs-unixfs-importer/test/builder.spec.js
  80. +8 −9 packages/ipfs-unixfs-importer/test/chunker-custom.spec.js
  81. +7 −9 packages/ipfs-unixfs-importer/test/chunker-fixed-size.spec.js
  82. +18 −10 packages/ipfs-unixfs-importer/test/chunker-rabin.spec.js
  83. +6 −8 packages/ipfs-unixfs-importer/test/hash-parity-with-go-ipfs.spec.js
  84. +1 −3 packages/ipfs-unixfs-importer/test/helpers/as-async-iterable.js
  85. +5 −7 packages/ipfs-unixfs-importer/test/helpers/block.js
  86. +3 −3 packages/ipfs-unixfs-importer/test/helpers/finite-pseudorandom-byte-stream.js
  87. +1 −3 packages/ipfs-unixfs-importer/test/helpers/random-byte-stream.js
  88. +25 −0 packages/ipfs-unixfs-importer/test/utils.spec.js
  89. +1 −5 packages/ipfs-unixfs-importer/tsconfig.json
  90. +1 −2 packages/ipfs-unixfs/.aegir.js
  91. +119 −0 packages/ipfs-unixfs/CHANGELOG.md
  92. +3 −20 packages/ipfs-unixfs/LICENSE
  93. +5 −0 packages/ipfs-unixfs/LICENSE-APACHE
  94. +19 −0 packages/ipfs-unixfs/LICENSE-MIT
  95. +34 −20 packages/ipfs-unixfs/README.md
  96. +147 −39 packages/ipfs-unixfs/package.json
  97. +8 −15 packages/ipfs-unixfs/src/index.js
  98. 0 packages/ipfs-unixfs/src/{types.d.ts → types.ts}
  99. +1 −1 packages/ipfs-unixfs/src/unixfs.d.ts
  100. +8 −10 packages/ipfs-unixfs/src/unixfs.js
  101. +8 −11 packages/ipfs-unixfs/test/unixfs-format.spec.js
  102. +2 −3 packages/ipfs-unixfs/tsconfig.json
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
version: 2
updates:
- package-ecosystem: npm
directory: "/"
schedule:
interval: daily
time: "10:00"
open-pull-requests-limit: 10
commit-message:
prefix: "deps"
prefix-development: "deps(dev)"
11 changes: 11 additions & 0 deletions .github/workflows/automerge.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.

name: Automerge
on: [ pull_request ]

jobs:
automerge:
uses: protocol/.github/.github/workflows/automerge.yml@master
with:
job: 'automerge'
148 changes: 148 additions & 0 deletions .github/workflows/js-test-and-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
# File managed by web3-bot. DO NOT EDIT.
# See https://github.com/protocol/.github/ for details.

name: test & maybe release
on:
push:
branches:
- master # with #262 - ${{{ github.default_branch }}}
pull_request:
branches:
- master # with #262 - ${{{ github.default_branch }}}

jobs:

check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present lint
- run: npm run --if-present dep-check

test-node:
needs: check
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, ubuntu-latest, macos-latest]
node: [16]
fail-fast: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node }}
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:node
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
flags: node

test-chrome:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:chrome
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
flags: chrome

test-chrome-webworker:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:chrome-webworker
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
flags: chrome-webworker

test-firefox:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:firefox
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
flags: firefox

test-firefox-webworker:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npm run --if-present test:firefox-webworker
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
flags: firefox-webworker

test-electron-main:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npx xvfb-maybe npm run --if-present test:electron-main
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
flags: electron-main

test-electron-renderer:
needs: check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- run: npx xvfb-maybe npm run --if-present test:electron-renderer
- uses: codecov/codecov-action@81cd2dc8148241f03f5839d295e000b8f761e378 # v3.1.0
with:
flags: electron-renderer

release:
needs: [test-node, test-chrome, test-chrome-webworker, test-firefox, test-firefox-webworker, test-electron-main, test-electron-renderer]
runs-on: ubuntu-latest
if: github.event_name == 'push' && github.ref == 'refs/heads/master' # with #262 - 'refs/heads/${{{ github.default_branch }}}'
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-node@v2
with:
node-version: lts/*
- uses: ipfs/aegir/actions/cache-node-modules@master
- uses: ipfs/aegir/actions/docker-login@master
with:
docker-token: ${{ secrets.DOCKER_TOKEN }}
docker-username: ${{ secrets.DOCKER_USERNAME }}
- run: npm run --if-present release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
26 changes: 26 additions & 0 deletions .github/workflows/stale.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Close and mark stale issue

on:
schedule:
- cron: '0 0 * * *'

jobs:
stale:

runs-on: ubuntu-latest
permissions:
issues: write
pull-requests: write

steps:
- uses: actions/stale@v3
with:
repo-token: ${{ secrets.GITHUB_TOKEN }}
stale-issue-message: 'Oops, seems like we needed more information for this issue, please comment with more details or this issue will be closed in 7 days.'
close-issue-message: 'This issue was closed because it is missing author input.'
stale-issue-label: 'kind/stale'
any-of-labels: 'need/author-input'
exempt-issue-labels: 'need/triage,need/community-input,need/maintainer-input,need/maintainers-input,need/analysis,status/blocked,status/in-progress,status/ready,status/deferred,status/inactive'
days-before-issue-stale: 6
days-before-issue-close: 7
enable-statistics: true
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -40,3 +40,4 @@ node_modules

lib
dist
types
101 changes: 0 additions & 101 deletions .travis.yml

This file was deleted.

24 changes: 3 additions & 21 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -1,22 +1,4 @@
The MIT License (MIT)

Copyright (c) 2016 David Dias

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
This project is dual licensed under MIT and Apache-2.0.

MIT: https://www.opensource.org/licenses/mit
Apache-2.0: https://www.apache.org/licenses/license-2.0
5 changes: 5 additions & 0 deletions LICENSE-APACHE
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
19 changes: 19 additions & 0 deletions LICENSE-MIT
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
The MIT License (MIT)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
Loading