Skip to content

Commit

Permalink
feat: move to native web streams (#56)
Browse files Browse the repository at this point in the history
resolves #55
  • Loading branch information
talentlessguy authored Jan 16, 2024
1 parent acf1c63 commit 23dd7e1
Show file tree
Hide file tree
Showing 13 changed files with 1,313 additions and 1,186 deletions.
26 changes: 13 additions & 13 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,13 @@ jobs:
strategy:
matrix:
node-version:
- 16
- 20
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup node ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -45,13 +45,13 @@ jobs:
strategy:
matrix:
node-version:
- 16
- 20
steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup node ${{ matrix.node-version }}
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -75,16 +75,16 @@ jobs:
strategy:
matrix:
node-version:
- 16
- 20
os:
- ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}

Expand All @@ -100,16 +100,16 @@ jobs:
strategy:
matrix:
node-version:
- 16
- 20

steps:
- name: Checkout
uses: actions/checkout@v3
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: 16
node-version: 20

- name: Install dependencies
uses: bahmutov/npm-install@v1
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ This library provides functionality similar to [ipfs-unixfs-importer][], but it
You can encode a file as follows

```js
import { TransformStream } from "@web-std/stream"
import * as UnixFS from "@ipld/unixfs"

// Create a redable & writable streams with internal queue that can
Expand Down
4 changes: 0 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,14 +33,12 @@
"@ipld/dag-pb": "^4.0.0",
"@multiformats/murmur3": "^2.1.3",
"@perma/map": "^1.0.2",
"@web-std/stream": "1.0.1",
"actor": "^2.3.1",
"multiformats": "^11.0.1",
"protobufjs": "^7.1.2",
"rabin-rs": "^2.1.0"
},
"type": "module",
"main": "src/lib.js",
"types": "./dist/src/lib.d.ts",
"typesVersions": {
"*": {
Expand Down Expand Up @@ -126,8 +124,6 @@
"@types/chai": "^4.3.3",
"@types/mocha": "^10.0.0",
"@types/tsv": "^0.2.1",
"@web-std/fetch": "^4.1.0",
"@web-std/file": "^3.0.2",
"c8": "^7.12.0",
"chai": "^4.3.6",
"fzstd": "^0.0.4",
Expand Down
1 change: 0 additions & 1 deletion test/codec.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
import * as unixfs from "../src/codec.js"
import { assert } from "chai"
import * as blocks from "./fixtures.js"
import { fetch } from "./util.js"

const utf8 = new TextEncoder()
const MURMUR = 0x22
Expand Down
1 change: 0 additions & 1 deletion test/convergence.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ import Matrix from "./dataset/convergence_rawdata.js"
import * as UnixFS from "../src/lib.js"
import { parseConfig, unpackFile } from "./matrix.js"
import { Link, collect, iterate, encodeCar, writeFile } from "./util.js"
import { TransformStream } from "@web-std/stream"

/**
*
Expand Down
1 change: 0 additions & 1 deletion test/directory.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as UnixFS from "../src/lib.js"
import { TransformStream } from "@web-std/stream"
import { assert } from "chai"
import { encodeUTF8, Link, collect, importFile } from "./util.js"

Expand Down
1 change: 0 additions & 1 deletion test/file.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ import * as Balanced from "../src/file/layout/balanced.js"
import * as FixedSize from "../src/file/chunker/fixed.js"
import * as Rabin from "../src/file/chunker/rabin.js"
import { sha256 } from "multiformats/hashes/sha2"
import { TransformStream } from "@web-std/stream"

const CHUNK_SIZE = 262144
describe("test file", () => {
Expand Down
1 change: 0 additions & 1 deletion test/lib.spec.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import * as UnixFS from "../src/lib.js"
import { assert } from "chai"
import { encodeUTF8, Link, collect, importFile } from "./util.js"
import { TransformStream } from "@web-std/stream"

describe("UnixFS.createWriter", () => {
it("UnixFS.createFileWriter", async () => {
Expand Down
2 changes: 1 addition & 1 deletion test/matrix.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Link, File, fetch } from "./util.js"
import { Link } from "./util.js"
import * as Trickle from "../src/file/layout/trickle.js"
import * as Balanced from "../src/file/layout/balanced.js"
import * as FixedSize from "../src/file/chunker/fixed.js"
Expand Down
1 change: 0 additions & 1 deletion test/sharded-directory.spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import * as UnixFS from "../src/lib.js"
import { TransformStream } from "@web-std/stream"
import { assert } from "chai"
import { encodeUTF8, Link, collect, importFile } from "./util.js"

Expand Down
4 changes: 1 addition & 3 deletions test/util.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,4 @@
import { File, Blob } from "@web-std/file"
import * as Link from "multiformats/link"
import fetch from "@web-std/fetch"
import { sha256 } from "multiformats/hashes/sha2"
import { CarWriter } from "@ipld/car"
import * as UnixFS from "../src/lib.js"
Expand Down Expand Up @@ -143,4 +141,4 @@ export const importFile = async (fs, content) => {
return await file.close()
}

export { File, Link, fetch }
export { Link }
1 change: 0 additions & 1 deletion test/writer.spec.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import * as Writer from "../src/file/writer.js"
import * as UnixFS from "../src/lib.js"
import { TransformStream } from "@web-std/stream"
import { assert } from "chai"

describe("Writer", () => {
Expand Down
Loading

0 comments on commit 23dd7e1

Please sign in to comment.