Skip to content

Commit c8bd3cc

Browse files
authored
Merge pull request #5 from holochain-open-dev/chore/publish-package
rename package to 'hc_prefix_index'
2 parents 1ac756b + 26dc0c0 commit c8bd3cc

File tree

14 files changed

+45
-30
lines changed

14 files changed

+45
-30
lines changed

CHANGELOG.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,26 @@
22

33
All notable changes to this project will be documented in this file.
44

5+
## [0.9.0] - 2023-12-16
6+
7+
### Miscellaneous Tasks
8+
9+
- Move package dir to match name
10+
11+
### Refactor
12+
13+
- Rename package 'hc_prefix_index'
14+
15+
### Build
16+
17+
- Bump package version
18+
519
## [0.8.0] - 2023-12-16
620

721
### Documentation
822

923
- Add changelog
24+
- Changelog
1025

1126
### Miscellaneous Tasks
1227

Cargo.lock

Lines changed: 11 additions & 11 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,5 +23,5 @@ path = "dnas/demo/zomes/coordinator/demo"
2323
[workspace.dependencies.demo_integrity]
2424
path = "dnas/demo/zomes/integrity/demo"
2525

26-
[workspace.dependencies.prefix_index]
27-
path = "lib/prefix_index"
26+
[workspace.dependencies.hc_prefix_index]
27+
path = "lib/hc_prefix_index"

README.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,33 +6,35 @@ A prefix index is useful for typeahead "search" functionality.
66

77
## Usage
88

9-
1. Include the prefix_index crate in your coordinator zome's Cargo.toml:
9+
1. Include the hc_prefix_index crate in your coordinator zome's Cargo.toml:
1010

1111
```toml
1212
[dependencies]
1313
...
14-
prefix_index = { git = "https://github.com/mattyg/holochain-prefix-index" module = "prefix_index" }
14+
hc_prefix_index = "=0.9.0"
1515
```
1616

17-
2. Include the prefix_index crate in your integrity zome's Cargo.toml and create a link type for the index:
17+
2. Include the hc_prefix_index crate in your integrity zome's Cargo.toml
18+
19+
3. Create a link type for the index:
1820
```rust
1921
#[hdk_link_types]
2022
enum LinkTypes {
2123
PrefixIndex
2224
}
2325
```
2426

25-
3. Add the prefix index validation functions to your validate match arm for CreateLink and DeleteLink on LinkTypes::PrefixIndex
27+
4. Add the prefix index validation functions to your validate match arm for CreateLink and DeleteLink on LinkTypes::PrefixIndex
2628

27-
3. Setup a prefix index
29+
5. Setup a prefix index
2830

2931
```rust
3032
use prefix_index::PrefixIndex;
3133

3234
let index = PrefixIndex::new("demo_index".into(), LinkTypes::PrefixIndex, 3, 3)?;
3335
```
3436

35-
4. Add some results to the index:
37+
6. Add some results to the index:
3638
```rust
3739
index.add_result("superdupercool");
3840
index.add_result("superdupercrazy");
@@ -42,7 +44,7 @@ index.add_result("SUPERDUPER");
4244

4345
```
4446

45-
5. This will generate an index of links for the strings as follows:
47+
7. This will generate an index of links for the strings as follows:
4648

4749
```mermaid
4850
flowchart LR
@@ -54,7 +56,7 @@ flowchart LR
5456
B --> J[ers] --> K[atu] --> L[supersaturates]
5557
```
5658

57-
6. Now you can search the index using DFS.
59+
8. Now you can search the index using DFS.
5860
```rust
5961
index.get_results("sup", 10);
6062
// [

dnas/demo/zomes/coordinator/demo/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ name = "demo"
1111
hdk = { workspace = true }
1212
serde = { workspace = true }
1313
demo_integrity = { workspace = true }
14-
prefix_index = { workspace = true }
14+
hc_prefix_index = { workspace = true }
1515

1616
[dev-dependencies]
1717
hdk = { workspace = true, features = ["encoding", "test_utils"] }

dnas/demo/zomes/coordinator/demo/src/demo_prefix_index.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
use demo_integrity::*;
2+
use hc_prefix_index::PrefixIndex;
23
use hdk::prelude::*;
3-
use prefix_index::PrefixIndex;
44

55
#[hdk_extern]
66
pub fn add_to_index_a(text: String) -> ExternResult<()> {

dnas/demo/zomes/integrity/demo/Cargo.toml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,5 @@ name = "demo_integrity"
99

1010
[dependencies]
1111
hdi = { workspace = true }
12-
1312
serde = { workspace = true }
14-
prefix_index = { workspace = true }
13+
hc_prefix_index = { workspace = true }

dnas/demo/zomes/integrity/demo/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1+
use hc_prefix_index::PrefixIndex;
12
use hdi::prelude::*;
2-
use prefix_index::PrefixIndex;
33

44
pub const PREFIX_INDEX_A_NAME: &str = "prefix_index_a";
55
pub const PREFIX_INDEX_A_WIDTH: usize = 3;
Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
[package]
2-
name = "prefix_index"
3-
version = "0.8.0"
2+
name = "hc_prefix_index"
3+
version = "0.9.0"
44
edition = "2021"
55

66
[lib]
77
crate-type = ["cdylib", "rlib"]
8-
name = "prefix_index"
8+
name = "hc_prefix_index"
99

1010
[dependencies]
1111
hdk = { workspace = true }

0 commit comments

Comments
 (0)