Skip to content

Commit 03736a2

Browse files
authored
Merge crate (#424)
* chore: remove macro * chore: remove collab derive * chore: merge crates * fix: clippy * chore: create plugin feature * chore: use one error
1 parent 6d082fa commit 03736a2

File tree

401 files changed

+2933
-6765
lines changed

Some content is hidden

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

401 files changed

+2933
-6765
lines changed

Cargo.lock

Lines changed: 37 additions & 525 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 & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,8 @@
11
[workspace]
2-
members = [
3-
"collab",
4-
"collab-database",
5-
"collab-user",
6-
"collab-entity",
7-
"collab-document",
8-
"collab-folder",
9-
"collab-plugins",
10-
"collab-importer",
11-
]
2+
members = ["collab"]
123
resolver = "2"
134

145
[workspace.dependencies]
15-
collab = { path = "collab" }
16-
collab-database = { path = "collab-database" }
17-
collab-plugins = { path = "collab-plugins" }
18-
collab-user = { path = "collab-user" }
19-
collab-entity = { path = "collab-entity" }
20-
collab-document = { path = "collab-document" }
21-
collab-folder = { path = "collab-folder" }
22-
collab-importer = { path = "collab-importer" }
236
yrs = { version = "0.24", features = ["sync"] }
247
anyhow = "1.0.94"
258
thiserror = "1.0.39"
@@ -37,4 +20,4 @@ futures-lite = { version = "2.6.0", features = ["futures-io"] }
3720
[patch.crates-io]
3821
# We're using a specific commit here because rust-rocksdb doesn't publish the latest version that includes the memory alignment fix.
3922
# For more details, see https://github.com/rust-rocksdb/rust-rocksdb/pull/868
40-
rocksdb = { git = "https://github.com/rust-rocksdb/rust-rocksdb", rev = "1710120e4549e04ba3baa6a1ee5a5a801fa45a72" }
23+
rocksdb = { git = "https://github.com/rust-rocksdb/rust-rocksdb", rev = "1710120e4549e04ba3baa6a1ee5a5a801fa45a72" }

Makefile.toml

Lines changed: 0 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -76,45 +76,3 @@ default_to_workspace = false
7676

7777
[env]
7878
CARGO_MAKE_EXTEND_WORKSPACE_MAKEFILE = true
79-
80-
[tasks.wasm_build]
81-
script_runner = "bash"
82-
script = [
83-
"""
84-
#!/bin/bash
85-
BASE_DIR=$(pwd)
86-
crates=("collab" "collab-document" "collab-folder" "collab-user" "collab-plugins")
87-
88-
# Iterate over each crate and build it
89-
for crate in "${crates[@]}"; do
90-
echo "🔥🔥🔥 Building $crate with wasm-pack..."
91-
92-
# Navigate to the crate directory
93-
cd "$BASE_DIR/$crate" || { echo "Failed to enter directory $crate"; exit 1; }
94-
95-
# Build the crate
96-
wasm-pack build || { echo "Build failed for $crate"; exit 1; }
97-
done
98-
"""
99-
]
100-
101-
[tasks.wasm_test]
102-
script_runner = "bash"
103-
script = [
104-
"""
105-
#!/bin/bash
106-
BASE_DIR=$(pwd)
107-
crates=("collab-plugins")
108-
109-
# Iterate over each crate and build it
110-
for crate in "${crates[@]}"; do
111-
echo "🔥🔥🔥 Running $crate tests with wasm-pack..."
112-
113-
# Navigate to the crate directory
114-
cd "$BASE_DIR/$crate" || { echo "Failed to enter directory $crate"; exit 1; }
115-
116-
# Build the crate
117-
wasm-pack test --headless --firefox
118-
done
119-
"""
120-
]

README.md

Lines changed: 11 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,9 @@
11

22
# AppFlowy-Collab
33

4-
`AppFlowy-Collab` is a project that aims to support the collaborative features of AppFlowy. It consists of several crates that are currently under active development:
5-
6-
* `collab`
7-
* `collab-database`
8-
* `collab-document`
9-
* `collab-folder`
10-
* `collab-plugins`
11-
* `collab-sync`
4+
`AppFlowy-Collab` is a project that aims to support the collaborative features of AppFlowy. The workspace now centers on
5+
the `collab` crate, which houses database, document, folder, importer, plugin, and user functionality under a single
6+
module tree.
127

138
![architecture.png](resources/crate_arch.png)
149

@@ -18,23 +13,13 @@ ones are refined.
1813

1914
## collab
2015
The `collab` crate is built on top of the [yrs](https://docs.rs/yrs/latest/yrs/) crate, providing a higher level of
21-
abstraction for the collaborative features of AppFlowy. It offers a simple API for creating and managing collaborative
22-
documents.
23-
24-
## collab-database
25-
The `collab-database` crate provides a simple API for creating and managing collaborative databases. It is built on top
26-
of the `collab` crate.
27-
28-
## collab-document
29-
The `collab-document` crate provides a simple API for creating and managing collaborative documents. It is built on top
30-
of the `collab` crate.
31-
32-
## collab-folder
33-
The `collab-folder` crate provides a simple API for creating and managing collaborative folders. It is built on top of
34-
the `collab` crate.
16+
abstraction for the collaborative features of AppFlowy. It exposes cohesive modules:
3517

36-
## collab-plugins
37-
The `collab-plugins` crate contains a list of plugins that can be used with the `collab` crate.
18+
- Entity definitions and protobuf types under `collab::entity`.
19+
- Database, document, folder, importer, plugin, and user services under `collab::database`, `collab::document`,
20+
`collab::folder`, `collab::importer`, `collab::plugins`, and `collab::user`.
21+
- The plugin subsystem (`collab::plugins`) is guarded by the optional `plugins` Cargo feature; enable it when you
22+
need local/remote persistence helpers.
3823

39-
## collab-sync
40-
The `collab-sync` crate supports syncing the collaborative documents to a remote server.
24+
With everything consolidated, consumers only need to depend on the `collab` crate to access the full collaborative
25+
feature set.

collab-database/Cargo.toml

Lines changed: 0 additions & 63 deletions
This file was deleted.

collab-database/src/error.rs

Lines changed: 0 additions & 67 deletions
This file was deleted.

0 commit comments

Comments
 (0)