Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: bump aegir to 42.2.3, update project config and fix deps #297

Merged
merged 2 commits into from
Feb 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ updates:
schedule:
interval: daily
time: "10:00"
open-pull-requests-limit: 10
open-pull-requests-limit: 20
commit-message:
prefix: "deps"
prefix-development: "deps(dev)"
2 changes: 2 additions & 0 deletions .github/workflows/js-test-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,9 @@ on:

permissions:
contents: write
id-token: write
packages: write
pull-requests: write

concurrency:
group: ${{ github.workflow }}-${{ github.event_name }}-${{ github.event_name == 'push' && github.sha || github.ref }}
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"release": "npm run docs:no-publish && aegir run release --concurrency=1 && npm run docs"
},
"devDependencies": {
"aegir": "^41.1.9"
"aegir": "^42.2.3"
},
"workspaces": [
"packages/*"
Expand Down
67 changes: 67 additions & 0 deletions packages/blockstore-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,73 @@

> Contains various implementations of the API contract described in interface-blockstore

# About

Various Blockstore implementations are available.

## Implementations

- Base: [`src/base`](src/base.ts)
- Memory: [`src/memory`](src/memory.ts)
- BlackHole: ['src/black-hole](src/black-hole.ts)
- Tiered: ['src/tiered](src/tiered.ts)

## Example - BaseBlockstore

Provides a complete implementation of the Blockstore interface. You must implement `.get`, `.put`, etc.

```js
import { BaseBlockstore } from 'blockstore-core/base'

class MyCustomBlockstore extends BaseBlockstore {
put (key, val, options) {
// store a block
}

get (key, options) {
// retrieve a block
}

// ...etc
}
```

## Example - MemoryBlockstore

A simple Blockstore that stores blocks in memory.

```js
import { MemoryBlockstore } from 'blockstore-core/memory'

const store = new MemoryBlockstore()
```

## Example - BlackHoleBlockstore

A Blockstore that does not store any blocks.

```js
import { BlackHoleBlockstore } from 'blockstore-core/black-hole'

const store = new BlackHoleBlockstore()
```

## Example - TieredBlockstore

A tiered blockstore wraps one or more blockstores and will query each in parallel to retrieve a block - the operation will succeed if any wrapped store has the block.

Writes are invoked on all wrapped blockstores.

```js
import { TieredBlockstore } from 'blockstore-core/tiered'

const store = new TieredBlockstore([
store1,
store2,
// ...etc
])
```

# Install

```console
Expand Down
24 changes: 14 additions & 10 deletions packages/blockstore-core/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,18 @@
"description": "Contains various implementations of the API contract described in interface-blockstore",
"author": "Alex Potsides <alex.potsides@protocol.ai>",
"license": "Apache-2.0 OR MIT",
"homepage": "https://github.com/ipfs/js-stores/tree/master/packages/blockstore-core#readme",
"homepage": "https://github.com/ipfs/js-stores/tree/main/packages/blockstore-core#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/ipfs/js-stores.git"
},
"bugs": {
"url": "https://github.com/ipfs/js-stores/issues"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"keywords": [
"datastore",
"interface",
Expand Down Expand Up @@ -175,19 +179,19 @@
"dep-check": "aegir dep-check"
},
"dependencies": {
"@libp2p/logger": "^4.0.1",
"@libp2p/logger": "^4.0.6",
"err-code": "^3.0.1",
"interface-blockstore": "^5.0.0",
"interface-store": "^5.0.0",
"it-drain": "^3.0.1",
"it-filter": "^3.0.0",
"it-merge": "^3.0.1",
"it-pushable": "^3.0.0",
"multiformats": "^13.0.0",
"uint8arrays": "^5.0.0"
"it-drain": "^3.0.5",
"it-filter": "^3.0.4",
"it-merge": "^3.0.3",
"it-pushable": "^3.2.3",
"multiformats": "^13.0.1"
},
"devDependencies": {
"aegir": "^41.1.9",
"interface-blockstore-tests": "^6.0.0"
"aegir": "^42.2.3",
"interface-blockstore-tests": "^6.0.0",
"uint8arrays": "^5.0.2"
}
}
12 changes: 12 additions & 0 deletions packages/blockstore-fs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,18 @@

> Blockstore implementation with file system backend

# About

A Blockstore implementation that stores blocks in the local filesystem.

## Example

```js
import { FsBlockstore } from 'blockstore-fs'

const store = new FsBlockstore('path/to/store')
```

# Install

```console
Expand Down
18 changes: 11 additions & 7 deletions packages/blockstore-fs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
"version": "1.1.9",
"description": "Blockstore implementation with file system backend",
"license": "Apache-2.0 OR MIT",
"homepage": "https://github.com/ipfs/js-stores/tree/master/packages/blockstore-fs#readme",
"homepage": "https://github.com/ipfs/js-stores/tree/main/packages/blockstore-fs#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/ipfs/js-stores.git"
},
"bugs": {
"url": "https://github.com/ipfs/js-stores/issues"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"keywords": [
"datastore",
"fs",
Expand Down Expand Up @@ -159,16 +163,16 @@
},
"dependencies": {
"blockstore-core": "^4.0.0",
"fast-write-atomic": "^0.2.0",
"fast-write-atomic": "^0.2.1",
"interface-blockstore": "^5.0.0",
"interface-store": "^5.0.0",
"it-glob": "^2.0.1",
"it-map": "^3.0.1",
"it-parallel-batch": "^3.0.0",
"multiformats": "^13.0.0"
"it-glob": "^2.0.6",
"it-map": "^3.0.5",
"it-parallel-batch": "^3.0.4",
"multiformats": "^13.0.1"
},
"devDependencies": {
"aegir": "^41.1.9",
"aegir": "^42.2.3",
"interface-blockstore-tests": "^6.0.0"
}
}
10 changes: 7 additions & 3 deletions packages/blockstore-idb/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
"version": "1.1.7",
"description": "Blockstore implementation with IndexedDB backend",
"license": "Apache-2.0 OR MIT",
"homepage": "https://github.com/ipfs/js-stores/tree/master/packages/blockstore-idb#readme",
"homepage": "https://github.com/ipfs/js-stores/tree/main/packages/blockstore-idb#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/ipfs/js-stores.git"
},
"bugs": {
"url": "https://github.com/ipfs/js-stores/issues"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"keywords": [
"browser",
"datastore",
Expand Down Expand Up @@ -142,10 +146,10 @@
"idb": "^8.0.0",
"interface-blockstore": "^5.0.0",
"interface-store": "^5.0.0",
"multiformats": "^13.0.0"
"multiformats": "^13.0.1"
},
"devDependencies": {
"aegir": "^41.1.9",
"aegir": "^42.2.3",
"interface-blockstore-tests": "^6.0.0"
}
}
14 changes: 9 additions & 5 deletions packages/blockstore-level/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
"version": "1.1.7",
"description": "Blockstore implementation with level(up|down) backend",
"license": "Apache-2.0 OR MIT",
"homepage": "https://github.com/ipfs/js-stores/tree/master/packages/blockstore-level#readme",
"homepage": "https://github.com/ipfs/js-stores/tree/main/packages/blockstore-level#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/ipfs/js-stores.git"
},
"bugs": {
"url": "https://github.com/ipfs/js-stores/issues"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"keywords": [
"blockstore",
"interface",
Expand Down Expand Up @@ -144,13 +148,13 @@
"blockstore-core": "^4.0.0",
"interface-blockstore": "^5.0.0",
"interface-store": "^5.0.0",
"level": "^8.0.0",
"multiformats": "^13.0.0"
"level": "^8.0.1",
"multiformats": "^13.0.1"
},
"devDependencies": {
"aegir": "^41.1.9",
"aegir": "^42.2.3",
"interface-blockstore-tests": "^6.0.0",
"ipfs-utils": "^9.0.4",
"ipfs-utils": "^9.0.14",
"memory-level": "^1.0.0"
}
}
18 changes: 11 additions & 7 deletions packages/blockstore-s3/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,18 @@
"version": "1.0.14",
"description": "IPFS blockstore implementation backed by s3",
"license": "Apache-2.0 OR MIT",
"homepage": "https://github.com/ipfs/js-stores/tree/master/packages/blockstore-s3#readme",
"homepage": "https://github.com/ipfs/js-stores/tree/main/packages/blockstore-s3#readme",
"repository": {
"type": "git",
"url": "git+https://github.com/ipfs/js-stores.git"
},
"bugs": {
"url": "https://github.com/ipfs/js-stores/issues"
},
"publishConfig": {
"access": "public",
"provenance": true
},
"keywords": [
"blockstore",
"interface",
Expand Down Expand Up @@ -139,17 +143,17 @@
"dep-check": "aegir dep-check"
},
"dependencies": {
"@aws-sdk/client-s3": "^3.297.0",
"@aws-sdk/client-s3": "^3.511.0",
"blockstore-core": "^4.0.0",
"interface-blockstore": "^5.0.0",
"interface-store": "^5.0.0",
"it-to-buffer": "^4.0.1",
"multiformats": "^13.0.0",
"uint8arrays": "^5.0.0"
"it-to-buffer": "^4.0.5",
"multiformats": "^13.0.1",
"uint8arrays": "^5.0.2"
},
"devDependencies": {
"@types/sinon": "^17.0.2",
"aegir": "^41.1.9",
"@types/sinon": "^17.0.3",
"aegir": "^42.2.3",
"interface-blockstore-tests": "^6.0.0",
"p-defer": "^4.0.0",
"sinon": "^17.0.1"
Expand Down
61 changes: 61 additions & 0 deletions packages/datastore-core/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,67 @@

> Wrapper implementation for interface-datastore

# About

Various Datastore implementations are available.

## Implementations

- Mount: [`src/mount`](src/mount.ts)
- Keytransform: [`src/keytransform`](src/keytransform.ts)
- Sharding: [`src/sharding`](src/sharding.ts)
- Tiered: [`src/tiered`](src/tirered.ts)
- Namespace: [`src/namespace`](src/namespace.ts)
- BlackHole: [`src/black-hole`](src/black-hole.ts)

## Example - BaseDatastore

An base store is made available to make implementing your own datastore easier:

```javascript
import { BaseDatastore } from 'datastore-core'

class MyDatastore extends BaseDatastore {
constructor () {
super()
}

async put (key, val) {
// your implementation here
}

async get (key) {
// your implementation here
}

// etc...
}
```

See the [MemoryDatastore](./src/memory.js) for an example of how it is used.

## Example - Wrapping Stores

```js
import { Key } from 'interface-datastore'
import {
MemoryStore,
MountStore
} from 'datastore-core'

const store = new MountStore({prefix: new Key('/a'), datastore: new MemoryStore()})
```

## Example - BlackHoleDatastore

A datastore that does not store any data.

```js
import { BlackHoleDatastore } from 'datastore-core/black-hole'

const store = new BlackHoleDatastore()
```

# Install

```console
Expand Down
Loading
Loading