Skip to content

Commit 092e344

Browse files
authored
Merge branch 'main' into main
2 parents 12d5d8e + 7dad9a4 commit 092e344

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

76 files changed

+1144
-683
lines changed
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
name: Semantic PR
2+
3+
on:
4+
pull_request_target:
5+
types:
6+
- opened
7+
- edited
8+
- synchronize
9+
10+
jobs:
11+
main:
12+
uses: pl-strflt/.github/.github/workflows/[email protected]

README.md

Lines changed: 4 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,11 @@
1-
# stores <!-- omit in toc -->
2-
31
[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
42
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
53
[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-stores.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-stores)
64
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/js-stores/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipfs/js-stores/actions/workflows/js-test-and-release.yml?query=branch%3Amain)
75

86
> Blockstores and datastores used by IP-JS internals
97
10-
## Table of contents <!-- omit in toc -->
11-
12-
- [Structure](#structure)
13-
- [Packages](#packages)
14-
- [API Docs](#api-docs)
15-
- [License](#license)
16-
- [Contribute](#contribute)
17-
18-
## Structure
8+
# Packages
199

2010
- [`/packages/blockstore-core`](./packages/blockstore-core) Contains various implementations of the API contract described in interface-blockstore
2111
- [`/packages/blockstore-fs`](./packages/blockstore-fs) Blockstore implementation with file system backend
@@ -33,22 +23,18 @@
3323
- [`/packages/interface-datastore-tests`](./packages/interface-datastore-tests) Compliance tests for the datastore interface
3424
- [`/packages/interface-store`](./packages/interface-store) A generic interface for storing and retrieving data
3525

36-
## Packages
37-
38-
See the [./packages](./packages) directory for the various interfaces.
39-
40-
## API Docs
26+
# API Docs
4127

4228
- <https://ipfs.github.io/js-stores>
4329

44-
## License
30+
# License
4531

4632
Licensed under either of
4733

4834
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
4935
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
5036

51-
## Contribute
37+
# Contribute
5238

5339
Contributions welcome! Please check out [the issues](https://github.com/ipfs/js-stores/issues).
5440

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
3131
"release": "npm run docs:no-publish && aegir run release && npm run docs"
3232
},
3333
"devDependencies": {
34-
"aegir": "^40.0.8"
34+
"aegir": "^41.1.9"
3535
},
3636
"workspaces": [
3737
"packages/*"

packages/blockstore-core/CHANGELOG.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,36 @@
1+
## [blockstore-core-v4.3.8](https://github.com/ipfs/js-stores/compare/blockstore-core-v4.3.7...blockstore-core-v4.3.8) (2023-12-08)
2+
3+
4+
### Dependencies
5+
6+
* bump uint8arrays from 4.0.10 to 5.0.0 ([#282](https://github.com/ipfs/js-stores/issues/282)) ([2cbfd52](https://github.com/ipfs/js-stores/commit/2cbfd52257e9358786962d94e144df9583a45c30))
7+
8+
## [blockstore-core-v4.3.7](https://github.com/ipfs/js-stores/compare/blockstore-core-v4.3.6...blockstore-core-v4.3.7) (2023-12-01)
9+
10+
11+
### Bug Fixes
12+
13+
* cleanup references to datastore in blockstores ([#274](https://github.com/ipfs/js-stores/issues/274)) ([f550624](https://github.com/ipfs/js-stores/commit/f5506243b2cb1e6462457241a1614bd5f0755c12))
14+
15+
## [blockstore-core-v4.3.6](https://github.com/ipfs/js-stores/compare/blockstore-core-v4.3.5...blockstore-core-v4.3.6) (2023-12-01)
16+
17+
18+
### Dependencies
19+
20+
* bump @libp2p/logger from 3.1.0 to 4.0.1 ([#280](https://github.com/ipfs/js-stores/issues/280)) ([ab4731f](https://github.com/ipfs/js-stores/commit/ab4731f49a1a6f9163fb9c246121b3392503ba8b))
21+
22+
## [blockstore-core-v4.3.5](https://github.com/ipfs/js-stores/compare/blockstore-core-v4.3.4...blockstore-core-v4.3.5) (2023-11-27)
23+
24+
25+
### Documentation
26+
27+
* update datastore core readme and package config ([#245](https://github.com/ipfs/js-stores/issues/245)) ([c08d29a](https://github.com/ipfs/js-stores/commit/c08d29ab18ddea26a1d9dd73d673847469d28a13))
28+
29+
30+
### Dependencies
31+
32+
* **dev:** bump aegir from 40.0.13 to 41.1.9 ([#268](https://github.com/ipfs/js-stores/issues/268)) ([0aa0944](https://github.com/ipfs/js-stores/commit/0aa0944d42798d1f6fd589e8a58de7d791760644))
33+
134
## [blockstore-core-v4.3.4](https://github.com/ipfs/js-stores/compare/blockstore-core-v4.3.3...blockstore-core-v4.3.4) (2023-09-05)
235

336

packages/blockstore-core/README.md

Lines changed: 5 additions & 86 deletions
Original file line numberDiff line numberDiff line change
@@ -1,117 +1,36 @@
1-
# blockstore-core <!-- omit in toc -->
2-
31
[![ipfs.tech](https://img.shields.io/badge/project-IPFS-blue.svg?style=flat-square)](https://ipfs.tech)
42
[![Discuss](https://img.shields.io/discourse/https/discuss.ipfs.tech/posts.svg?style=flat-square)](https://discuss.ipfs.tech)
53
[![codecov](https://img.shields.io/codecov/c/github/ipfs/js-stores.svg?style=flat-square)](https://codecov.io/gh/ipfs/js-stores)
64
[![CI](https://img.shields.io/github/actions/workflow/status/ipfs/js-stores/js-test-and-release.yml?branch=main\&style=flat-square)](https://github.com/ipfs/js-stores/actions/workflows/js-test-and-release.yml?query=branch%3Amain)
75

86
> Contains various implementations of the API contract described in interface-blockstore
97
10-
## Table of contents <!-- omit in toc -->
11-
12-
- [Install](#install)
13-
- [Browser `<script>` tag](#browser-script-tag)
14-
- [Implementations](#implementations)
15-
- [Usage](#usage)
16-
- [BaseBlockstore](#baseblockstore)
17-
- [MemoryBlockstore](#memoryblockstore)
18-
- [BlackHoleBlockstore](#blackholeblockstore)
19-
- [TieredBlockstore](#tieredblockstore)
20-
- [API Docs](#api-docs)
21-
- [License](#license)
22-
- [Contribute](#contribute)
23-
24-
## Install
8+
# Install
259

2610
```console
2711
$ npm i blockstore-core
2812
```
2913

30-
### Browser `<script>` tag
14+
## Browser `<script>` tag
3115

3216
Loading this module through a script tag will make it's exports available as `BlockstoreCore` in the global namespace.
3317

3418
```html
3519
<script src="https://unpkg.com/blockstore-core/dist/index.min.js"></script>
3620
```
3721

38-
## Implementations
39-
40-
- Base: [`src/base`](src/base.ts)
41-
- Memory: [`src/memory`](src/memory.ts)
42-
- BlackHole: ['src/black-hole](src/black-hole.ts)
43-
- Tiered: ['src/tiered](src/tiered.ts)
44-
45-
## Usage
46-
47-
### BaseBlockstore
48-
49-
Provides a complete implementation of the Blockstore interface. You must implement `.get`, `.put`, etc.
50-
51-
```js
52-
import { BaseBlockstore } from 'blockstore-core/base'
53-
54-
class MyCustomBlockstore extends BaseBlockstore {
55-
put (key, val, options) {
56-
// store a block
57-
}
58-
59-
get (key, options) {
60-
// retrieve a block
61-
}
62-
63-
// ...etc
64-
}
65-
```
66-
67-
### MemoryBlockstore
68-
69-
A simple Blockstore that stores blocks in memory.
70-
71-
```js
72-
import { MemoryBlockstore } from 'blockstore-core/memory'
73-
74-
const store = new MemoryBlockstore()
75-
```
76-
77-
### BlackHoleBlockstore
78-
79-
A Blockstore that does not store any blocks.
80-
81-
```js
82-
import { BlackHoleBlockstore } from 'blockstore-core/black-hole'
83-
84-
const store = new BlackHoleBlockstore()
85-
```
86-
87-
### TieredBlockstore
88-
89-
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.
90-
91-
Writes are invoked on all wrapped blockstores.
92-
93-
```js
94-
import { TieredBlockstore } from 'blockstore-core/tiered'
95-
96-
const store = new TieredBlockstore([
97-
store1,
98-
store2,
99-
// ...etc
100-
])
101-
```
102-
103-
## API Docs
22+
# API Docs
10423

10524
- <https://ipfs.github.io/js-stores/modules/blockstore_core.html>
10625

107-
## License
26+
# License
10827

10928
Licensed under either of
11029

11130
- Apache 2.0, ([LICENSE-APACHE](LICENSE-APACHE) / <http://www.apache.org/licenses/LICENSE-2.0>)
11231
- MIT ([LICENSE-MIT](LICENSE-MIT) / <http://opensource.org/licenses/MIT>)
11332

114-
## Contribute
33+
# Contribute
11534

11635
Contributions welcome! Please check out [the issues](https://github.com/ipfs/js-stores/issues).
11736

packages/blockstore-core/package.json

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "blockstore-core",
3-
"version": "4.3.4",
3+
"version": "4.3.8",
44
"description": "Contains various implementations of the API contract described in interface-blockstore",
55
"author": "Alex Potsides <[email protected]>",
66
"license": "Apache-2.0 OR MIT",
@@ -71,6 +71,7 @@
7171
"eslintConfig": {
7272
"extends": "ipfs",
7373
"parserOptions": {
74+
"project": true,
7475
"sourceType": "module"
7576
}
7677
},
@@ -174,7 +175,7 @@
174175
"dep-check": "aegir dep-check"
175176
},
176177
"dependencies": {
177-
"@libp2p/logger": "^3.0.0",
178+
"@libp2p/logger": "^4.0.1",
178179
"err-code": "^3.0.1",
179180
"interface-blockstore": "^5.0.0",
180181
"interface-store": "^5.0.0",
@@ -183,10 +184,10 @@
183184
"it-merge": "^3.0.1",
184185
"it-pushable": "^3.0.0",
185186
"multiformats": "^12.0.1",
186-
"uint8arrays": "^4.0.2"
187+
"uint8arrays": "^5.0.0"
187188
},
188189
"devDependencies": {
189-
"aegir": "^40.0.8",
190+
"aegir": "^41.1.9",
190191
"interface-blockstore-tests": "^6.0.0"
191192
}
192193
}

packages/blockstore-core/src/index.ts

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,72 @@
1+
/**
2+
* @packageDocumentation
3+
*
4+
* Various Blockstore implementations are available.
5+
*
6+
* ## Implementations
7+
*
8+
* - Base: [`src/base`](src/base.ts)
9+
* - Memory: [`src/memory`](src/memory.ts)
10+
* - BlackHole: ['src/black-hole](src/black-hole.ts)
11+
* - Tiered: ['src/tiered](src/tiered.ts)
12+
*
13+
* @example BaseBlockstore
14+
*
15+
* Provides a complete implementation of the Blockstore interface. You must implement `.get`, `.put`, etc.
16+
*
17+
* ```js
18+
* import { BaseBlockstore } from 'blockstore-core/base'
19+
*
20+
* class MyCustomBlockstore extends BaseBlockstore {
21+
* put (key, val, options) {
22+
* // store a block
23+
* }
24+
*
25+
* get (key, options) {
26+
* // retrieve a block
27+
* }
28+
*
29+
* // ...etc
30+
* }
31+
* ```
32+
*
33+
* @example MemoryBlockstore
34+
*
35+
* A simple Blockstore that stores blocks in memory.
36+
*
37+
* ```js
38+
* import { MemoryBlockstore } from 'blockstore-core/memory'
39+
*
40+
* const store = new MemoryBlockstore()
41+
* ```
42+
*
43+
* @example BlackHoleBlockstore
44+
*
45+
* A Blockstore that does not store any blocks.
46+
*
47+
* ```js
48+
* import { BlackHoleBlockstore } from 'blockstore-core/black-hole'
49+
*
50+
* const store = new BlackHoleBlockstore()
51+
* ```
52+
*
53+
* @example TieredBlockstore
54+
*
55+
* 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.
56+
*
57+
* Writes are invoked on all wrapped blockstores.
58+
*
59+
* ```js
60+
* import { TieredBlockstore } from 'blockstore-core/tiered'
61+
*
62+
* const store = new TieredBlockstore([
63+
* store1,
64+
* store2,
65+
* // ...etc
66+
* ])
67+
* ```
68+
*/
69+
170
import * as ErrorsImport from './errors.js'
271

372
export { BaseBlockstore } from './base.js'

packages/blockstore-core/test/memory.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { interfaceBlockstoreTests } from 'interface-blockstore-tests'
44
import { MemoryBlockstore } from '../src/memory.js'
55

66
describe('memory', () => {
7-
describe('interface-datastore', () => {
7+
describe('interface-blockstore', () => {
88
interfaceBlockstoreTests({
99
setup () {
1010
return new MemoryBlockstore()

packages/blockstore-core/test/tiered.spec.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,7 @@ describe('Tiered', () => {
5454
})
5555
})
5656

57-
describe('inteface-datastore-single', () => {
57+
describe('inteface-blockstore-single', () => {
5858
interfaceBlockstoreTests({
5959
setup () {
6060
return new TieredBlockstore([

packages/blockstore-fs/CHANGELOG.md

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,22 @@
1+
## [blockstore-fs-v1.1.8](https://github.com/ipfs/js-stores/compare/blockstore-fs-v1.1.7...blockstore-fs-v1.1.8) (2023-12-01)
2+
3+
4+
### Bug Fixes
5+
6+
* cleanup references to datastore in blockstores ([#274](https://github.com/ipfs/js-stores/issues/274)) ([f550624](https://github.com/ipfs/js-stores/commit/f5506243b2cb1e6462457241a1614bd5f0755c12))
7+
8+
## [blockstore-fs-v1.1.7](https://github.com/ipfs/js-stores/compare/blockstore-fs-v1.1.6...blockstore-fs-v1.1.7) (2023-11-27)
9+
10+
11+
### Documentation
12+
13+
* update datastore core readme and package config ([#245](https://github.com/ipfs/js-stores/issues/245)) ([c08d29a](https://github.com/ipfs/js-stores/commit/c08d29ab18ddea26a1d9dd73d673847469d28a13))
14+
15+
16+
### Dependencies
17+
18+
* **dev:** bump aegir from 40.0.13 to 41.1.9 ([#268](https://github.com/ipfs/js-stores/issues/268)) ([0aa0944](https://github.com/ipfs/js-stores/commit/0aa0944d42798d1f6fd589e8a58de7d791760644))
19+
120
## [blockstore-fs-v1.1.6](https://github.com/ipfs/js-stores/compare/blockstore-fs-v1.1.5...blockstore-fs-v1.1.6) (2023-09-05)
221

322

0 commit comments

Comments
 (0)