Skip to content

Commit a794648

Browse files
committed
chore: add missing deps
chore: remove pin/preload options and use correct aegir check command chore: update interface-blockstore version chore: update deps chore: update deps and fix linting
1 parent e443a5c commit a794648

File tree

7 files changed

+37
-42
lines changed

7 files changed

+37
-42
lines changed

packages/ipfs-unixfs-exporter/package.json

+7-6
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@
1212
"test": "aegir test",
1313
"build": "aegir build",
1414
"clean": "rimraf ./dist",
15-
"lint": "aegir ts --check && aegir lint",
15+
"lint": "aegir ts -p check && aegir lint",
1616
"coverage": "nyc -s npm run test -t node && nyc report --reporter=html",
17-
"depcheck": "aegir dep-check -i @types/mocha -i @types/sinon -i nyc -i abort-controller -i rimraf -i ipfs-core-types -i copy -i util -i crypto-browserify -i events -i readable-stream"
17+
"depcheck": "aegir dep-check -i @types/mocha -i @types/sinon -i nyc -i abort-controller -i rimraf -i copy -i util -i crypto-browserify -i events -i readable-stream -i interface-blockstore"
1818
},
1919
"repository": {
2020
"type": "git",
@@ -36,12 +36,11 @@
3636
"@types/mocha": "^8.2.1",
3737
"@types/sinon": "^10.0.0",
3838
"abort-controller": "^3.0.0",
39-
"aegir": "^33.1.0",
39+
"aegir": "^34.0.0",
4040
"copy": "^0.3.2",
4141
"crypto-browserify": "^3.12.0",
4242
"detect-node": "^2.0.4",
4343
"events": "^3.3.0",
44-
"ipfs-core-types": "^0.5.2",
4544
"ipfs-unixfs-importer": "^7.0.3",
4645
"it-all": "^1.0.5",
4746
"it-buffer-stream": "^2.0.0",
@@ -61,10 +60,12 @@
6160
"@ipld/dag-pb": "^2.0.2",
6261
"err-code": "^3.0.1",
6362
"hamt-sharding": "^2.0.0",
64-
"interface-blockstore": "^0.0.5",
63+
"interface-blockstore": "^1.0.0",
6564
"ipfs-unixfs": "^4.0.3",
6665
"it-last": "^1.0.5",
67-
"multiformats": "^9.0.4"
66+
"multiformats": "^9.0.4",
67+
"murmurhash3js-revisited": "^3.0.0",
68+
"uint8arrays": "^2.1.5"
6869
},
6970
"types": "dist/src/index.d.ts",
7071
"files": [

packages/ipfs-unixfs-exporter/src/types.d.ts

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ interface ExporterOptions {
1111
}
1212

1313
interface Exportable<T> {
14-
type: 'file' | 'directory' | 'object' | 'raw' | 'identity',
14+
type: 'file' | 'directory' | 'object' | 'raw' | 'identity'
1515
name: string
1616
path: string
1717
cid: CID
@@ -61,10 +61,10 @@ interface ResolveResult {
6161
next?: NextResult
6262
}
6363

64-
type Resolve = (cid: CID, name: string, path: string, toResolve: string[], depth: number, blockstore: Blockstore, options: ExporterOptions) => Promise<ResolveResult>
65-
type Resolver = (cid: CID, name: string, path: string, toResolve: string[], resolve: Resolve, depth: number, blockstore: Blockstore, options: ExporterOptions) => Promise<ResolveResult>
64+
interface Resolve { (cid: CID, name: string, path: string, toResolve: string[], depth: number, blockstore: Blockstore, options: ExporterOptions): Promise<ResolveResult> }
65+
interface Resolver { (cid: CID, name: string, path: string, toResolve: string[], resolve: Resolve, depth: number, blockstore: Blockstore, options: ExporterOptions): Promise<ResolveResult> }
6666

6767
type UnixfsV1FileContent = AsyncIterable<Uint8Array> | Iterable<Uint8Array>
6868
type UnixfsV1DirectoryContent = AsyncIterable<UnixFSEntry> | Iterable<UnixFSEntry>
6969
type UnixfsV1Content = UnixfsV1FileContent | UnixfsV1DirectoryContent
70-
type UnixfsV1Resolver = (cid: CID, node: PBNode, unixfs: UnixFS, path: string, resolve: Resolve, depth: number, blockstore: Blockstore) => (options: ExporterOptions) => UnixfsV1Content
70+
interface UnixfsV1Resolver { (cid: CID, node: PBNode, unixfs: UnixFS, path: string, resolve: Resolve, depth: number, blockstore: Blockstore): (options: ExporterOptions) => UnixfsV1Content }

packages/ipfs-unixfs-importer/README.md

-2
Original file line numberDiff line numberDiff line change
@@ -140,8 +140,6 @@ The input's file paths and directory structure will be preserved in the [`dag-pb
140140
- `leafType` (string, defaults to `'file'`) what type of UnixFS node leaves should be - can be `'file'` or `'raw'` (ignored when `rawLeaves` is `true`)
141141
- `blockWriteConcurrency` (positive integer, defaults to 10) How many blocks to hash and write to the block store concurrently. For small numbers of large files this should be high (e.g. 50).
142142
- `fileImportConcurrency` (number, defaults to 50) How many files to import concurrently. For large numbers of small files this should be high (e.g. 50).
143-
- `pin` (boolean, defaults to `false`) Whether to pin each block as it is created
144-
- `preload` (boolean, defaults to `false`) Whether to preload each block as it is created
145143

146144
## Overriding internals
147145

packages/ipfs-unixfs-importer/package.json

+3-4
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
"test": "aegir test",
1313
"build": "aegir build",
1414
"clean": "rimraf ./dist",
15-
"lint": "aegir ts --check && aegir lint",
15+
"lint": "aegir ts -p check && aegir lint",
1616
"coverage": "nyc -s npm run test -t node && nyc report --reporter=html",
1717
"depcheck": "aegir dep-check -i @types/mocha -i nyc -i rimraf -i copy -i util -i crypto-browserify -i events -i readable-stream -i assert"
1818
},
@@ -33,9 +33,8 @@
3333
},
3434
"homepage": "https://github.com/ipfs/js-ipfs-unixfs#readme",
3535
"devDependencies": {
36-
"@ipld/dag-cbor": "^6.0.4",
3736
"@types/mocha": "^8.2.1",
38-
"aegir": "^33.1.0",
37+
"aegir": "^34.0.0",
3938
"assert": "^2.0.0",
4039
"copy": "^0.3.2",
4140
"crypto-browserify": "^3.12.0",
@@ -51,7 +50,7 @@
5150
"bl": "^5.0.0",
5251
"err-code": "^3.0.1",
5352
"hamt-sharding": "^2.0.0",
54-
"interface-blockstore": "^0.0.5",
53+
"interface-blockstore": "^1.0.0",
5554
"ipfs-unixfs": "^4.0.3",
5655
"it-all": "^1.0.5",
5756
"it-batch": "^1.0.8",

packages/ipfs-unixfs-importer/src/options.js

-2
Original file line numberDiff line numberDiff line change
@@ -50,10 +50,8 @@ const defaultOptions = {
5050
maxChildrenPerNode: 174,
5151
layerRepeat: 4,
5252
wrapWithDirectory: false,
53-
pin: false,
5453
recursive: false,
5554
hidden: false,
56-
preload: false,
5755
timeout: undefined,
5856
hamtHashFn,
5957
hamtHashCode: 0x22,

packages/ipfs-unixfs-importer/src/types.d.ts

+17-21
Original file line numberDiff line numberDiff line change
@@ -36,17 +36,17 @@ interface InProgressImportResult extends ImportResult {
3636
}
3737

3838
type ChunkerType = 'fixed' | 'rabin'
39-
type ProgressHandler = (chunkSize: number, path?: string) => void
40-
type HamtHashFn = (value: Uint8Array) => Promise<Uint8Array>
41-
type Chunker = (source: AsyncIterable<Uint8Array>, options: ImporterOptions) => AsyncIterable<Uint8Array>
42-
type DAGBuilder = (source: AsyncIterable<ImportCandidate> | Iterable<ImportCandidate>, blockstore: Blockstore, options: ImporterOptions) => AsyncIterable<() => Promise<InProgressImportResult>>
43-
type TreeBuilder = (source: AsyncIterable<InProgressImportResult>, blockstore: Blockstore, options: ImporterOptions) => AsyncIterable<ImportResult>
44-
type BufferImporter = (file: File, blockstore: Blockstore, options: ImporterOptions) => AsyncIterable<() => Promise<InProgressImportResult>>
45-
type ChunkValidator = (source: AsyncIterable<Uint8Array>, options: ImporterOptions) => AsyncIterable<Uint8Array>
46-
type UnixFSV1DagBuilder<T> = (item: T, blockstore: Blockstore, options: ImporterOptions) => Promise<InProgressImportResult>
47-
type Reducer = (leaves: InProgressImportResult[]) => Promise<InProgressImportResult>
39+
interface ProgressHandler { (chunkSize: number, path?: string): void }
40+
interface HamtHashFn { (value: Uint8Array): Promise<Uint8Array> }
41+
interface Chunker { (source: AsyncIterable<Uint8Array>, options: ImporterOptions): AsyncIterable<Uint8Array> }
42+
interface DAGBuilder { (source: AsyncIterable<ImportCandidate> | Iterable<ImportCandidate>, blockstore: Blockstore, options: ImporterOptions): AsyncIterable<() => Promise<InProgressImportResult>> }
43+
interface TreeBuilder { (source: AsyncIterable<InProgressImportResult>, blockstore: Blockstore, options: ImporterOptions): AsyncIterable<ImportResult> }
44+
interface BufferImporter { (file: File, blockstore: Blockstore, options: ImporterOptions): AsyncIterable<() => Promise<InProgressImportResult>> }
45+
interface ChunkValidator { (source: AsyncIterable<Uint8Array>, options: ImporterOptions): AsyncIterable<Uint8Array> }
46+
interface UnixFSV1DagBuilder<T> { (item: T, blockstore: Blockstore, options: ImporterOptions): Promise<InProgressImportResult> }
47+
interface Reducer { (leaves: InProgressImportResult[]): Promise<InProgressImportResult> }
4848

49-
type FileDAGBuilder = (source: AsyncIterable<InProgressImportResult> | Iterable<InProgressImportResult>, reducer: Reducer, options: ImporterOptions) => Promise<InProgressImportResult>
49+
interface FileDAGBuilder { (source: AsyncIterable<InProgressImportResult> | Iterable<InProgressImportResult>, reducer: Reducer, options: ImporterOptions): Promise<InProgressImportResult> }
5050

5151
interface UserImporterOptions {
5252
strategy?: 'balanced' | 'flat' | 'trickle'
@@ -68,10 +68,8 @@ interface UserImporterOptions {
6868
maxChildrenPerNode?: number
6969
layerRepeat?: number
7070
wrapWithDirectory?: boolean
71-
pin?: boolean
7271
recursive?: boolean
7372
hidden?: boolean
74-
preload?: boolean
7573
timeout?: number
7674
hamtHashFn?: HamtHashFn
7775
hamtBucketBits?: number
@@ -103,10 +101,8 @@ interface ImporterOptions {
103101
maxChildrenPerNode: number
104102
layerRepeat: number
105103
wrapWithDirectory: boolean
106-
pin: boolean
107104
recursive: boolean
108105
hidden: boolean
109-
preload: boolean
110106
timeout?: number
111107
hamtHashFn: HamtHashFn
112108
hamtBucketBits: number
@@ -119,14 +115,14 @@ interface ImporterOptions {
119115
}
120116

121117
export interface TrickleDagNode {
122-
children: InProgressImportResult[],
123-
depth: number,
124-
maxDepth: number,
125-
maxChildren: number,
126-
data?: InProgressImportResult[],
118+
children: InProgressImportResult[]
119+
depth: number
120+
maxDepth: number
121+
maxChildren: number
122+
data?: InProgressImportResult[]
127123
parent?: TrickleDagNode
128-
cid?: CID,
129-
size?: number,
124+
cid?: CID
125+
size?: number
130126
unixfs?: UnixFS
131127
}
132128

packages/ipfs-unixfs/package.json

+6-3
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
"test": "aegir test",
1616
"build": "aegir build",
1717
"clean": "rimraf ./dist",
18-
"lint": "aegir ts --check && aegir lint",
18+
"lint": "aegir ts -p check && aegir lint",
1919
"coverage": "nyc -s aegir test -t node && nyc report --reporter=html",
2020
"depcheck": "aegir dep-check -i mkdirp -i @types/mocha -i nyc -i npm-run-all -i copy -i util"
2121
},
@@ -37,7 +37,7 @@
3737
"homepage": "https://github.com/ipfs/js-ipfs-unixfs#readme",
3838
"devDependencies": {
3939
"@types/mocha": "^8.2.1",
40-
"aegir": "^33.1.0",
40+
"aegir": "^34.0.0",
4141
"copy": "^0.3.2",
4242
"mkdirp": "^1.0.4",
4343
"npm-run-all": "^4.1.5",
@@ -55,6 +55,9 @@
5555
"dist"
5656
],
5757
"eslintConfig": {
58-
"extends": "ipfs"
58+
"extends": "ipfs",
59+
"ignorePatterns": [
60+
"src/unixfs.d.ts"
61+
]
5962
}
6063
}

0 commit comments

Comments
 (0)