Skip to content

Commit 37f269b

Browse files
appflowyvedon
andauthored
Chore/rename flowy sdk (#1679)
* chore: run flutter create on flowy_sdk * chore: rename flowy-sdk to flowy-core * chore: rename flowy_sdk to appflowy_backend * chore: fix windows build * chore: replace bloctest with test Co-authored-by: nathan <[email protected]> Co-authored-by: vedon <[email protected]>
1 parent a0b5f09 commit 37f269b

File tree

371 files changed

+1229
-1977
lines changed

Some content is hidden

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

371 files changed

+1229
-1977
lines changed

frontend/Makefile.toml

Lines changed: 13 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,13 @@
11
#https://github.com/sagiegurari/cargo-make
22

33
extend = [
4-
{ path = "scripts/makefile/desktop.toml" },
5-
{ path = "scripts/makefile/protobuf.toml" },
6-
{ path = "scripts/makefile/tests.toml" },
7-
{ path = "scripts/makefile/docker.toml" },
8-
{ path = "scripts/makefile/env.toml" },
9-
{ path = "scripts/makefile/flutter.toml" },
10-
{ path = "scripts/makefile/tool.toml" },
4+
{ path = "scripts/makefile/desktop.toml" },
5+
{ path = "scripts/makefile/protobuf.toml" },
6+
{ path = "scripts/makefile/tests.toml" },
7+
{ path = "scripts/makefile/docker.toml" },
8+
{ path = "scripts/makefile/env.toml" },
9+
{ path = "scripts/makefile/flutter.toml" },
10+
{ path = "scripts/makefile/tool.toml" },
1111
]
1212

1313
[config]
@@ -27,7 +27,7 @@ FEATURES = "flutter"
2727
PRODUCT_NAME = "AppFlowy"
2828
# CRATE_TYPE: https://doc.rust-lang.org/reference/linkage.html
2929
# If you update the macOS's CRATE_TYPE, don't forget to update the
30-
# flowy_sdk.podspec
30+
# appflowy_backend.podspec
3131
# for staticlib:
3232
# s.static_framework = true
3333
# s.vendored_libraries = "libdart_ffi.a"
@@ -42,7 +42,7 @@ PRODUCT_NAME = "AppFlowy"
4242
CRATE_TYPE = "staticlib"
4343
LIB_EXT = "a"
4444
APP_ENVIRONMENT = "local"
45-
FLUTTER_FLOWY_SDK_PATH = "app_flowy/packages/flowy_sdk"
45+
FLUTTER_FLOWY_SDK_PATH = "app_flowy/packages/appflowy_backend"
4646
# Test default config
4747
TEST_CRATE_TYPE = "cdylib"
4848
TEST_LIB_EXT = "dylib"
@@ -181,7 +181,7 @@ FEATURES = "flutter,openssl_vendored"
181181
[tasks.setup-crate-type]
182182
private = true
183183
script = [
184-
"""
184+
"""
185185
toml = readfile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml
186186
val = replace ${toml} "staticlib" ${CRATE_TYPE}
187187
result = writefile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml ${val}
@@ -193,7 +193,7 @@ script_runner = "@duckscript"
193193
[tasks.restore-crate-type]
194194
private = true
195195
script = [
196-
"""
196+
"""
197197
toml = readfile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml
198198
val = replace ${toml} ${CRATE_TYPE} "staticlib"
199199
result = writefile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml ${val}
@@ -221,7 +221,7 @@ TEST_COMPILE_TARGET = "x86_64-pc-windows-msvc"
221221
[tasks.setup-test-crate-type]
222222
private = true
223223
script = [
224-
"""
224+
"""
225225
toml = readfile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml
226226
val = replace ${toml} "staticlib" ${TEST_CRATE_TYPE}
227227
result = writefile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml ${val}
@@ -233,7 +233,7 @@ script_runner = "@duckscript"
233233
[tasks.restore-test-crate-type]
234234
private = true
235235
script = [
236-
"""
236+
"""
237237
toml = readfile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml
238238
val = replace ${toml} ${TEST_CRATE_TYPE} "staticlib"
239239
result = writefile ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/rust-lib/${CARGO_MAKE_CRATE_NAME}/Cargo.toml ${val}
@@ -249,5 +249,3 @@ script = ["""
249249
cargo build -vv --features=dart
250250
"""]
251251
script_runner = "@shell"
252-
253-

frontend/app_flowy/ios/Podfile.lock

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ PODS:
33
- Flutter
44
- flowy_infra_ui (0.0.1):
55
- Flutter
6-
- flowy_sdk (0.0.1):
6+
- appflowy_backend (0.0.1):
77
- Flutter
88
- Flutter (1.0.0)
99
- flutter_inappwebview (0.0.1):
@@ -28,7 +28,7 @@ PODS:
2828
DEPENDENCIES:
2929
- flowy_editor (from `.symlinks/plugins/flowy_editor/ios`)
3030
- flowy_infra_ui (from `.symlinks/plugins/flowy_infra_ui/ios`)
31-
- flowy_sdk (from `.symlinks/plugins/flowy_sdk/ios`)
31+
- appflowy_backend (from `.symlinks/plugins/appflowy_backend/ios`)
3232
- Flutter (from `Flutter`)
3333
- flutter_inappwebview (from `.symlinks/plugins/flutter_inappwebview/ios`)
3434
- flutter_keyboard_visibility (from `.symlinks/plugins/flutter_keyboard_visibility/ios`)
@@ -46,8 +46,8 @@ EXTERNAL SOURCES:
4646
:path: ".symlinks/plugins/flowy_editor/ios"
4747
flowy_infra_ui:
4848
:path: ".symlinks/plugins/flowy_infra_ui/ios"
49-
flowy_sdk:
50-
:path: ".symlinks/plugins/flowy_sdk/ios"
49+
appflowy_backend:
50+
:path: ".symlinks/plugins/appflowy_backend/ios"
5151
Flutter:
5252
:path: Flutter
5353
flutter_inappwebview:
@@ -66,7 +66,7 @@ EXTERNAL SOURCES:
6666
SPEC CHECKSUMS:
6767
flowy_editor: bf8d58894ddb03453bd4d8521c57267ad638b837
6868
flowy_infra_ui: 146c88346fd55d2ee6a41ae35059a5bf095cfbb3
69-
flowy_sdk: c416222c639e678828776789bf0c1a1d0d59df3c
69+
appflowy_backend: c416222c639e678828776789bf0c1a1d0d59df3c
7070
Flutter: 50d75fe2f02b26cc09d224853bb45737f8b3214a
7171
flutter_inappwebview: bfd58618f49dc62f2676de690fc6dcda1d6c3721
7272
flutter_keyboard_visibility: 0339d06371254c3eb25eeb90ba8d17dca8f9c069

frontend/app_flowy/lib/core/folder_notification.dart

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
import 'dart:async';
22
import 'dart:typed_data';
3-
import 'package:flowy_sdk/protobuf/dart-notify/protobuf.dart';
3+
import 'package:appflowy_backend/protobuf/dart-notify/protobuf.dart';
44
import 'package:dartz/dartz.dart';
5-
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
6-
import 'package:flowy_sdk/protobuf/flowy-folder/dart_notification.pb.dart';
7-
import 'package:flowy_sdk/rust_stream.dart';
5+
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
6+
import 'package:appflowy_backend/protobuf/flowy-folder/dart_notification.pb.dart';
7+
import 'package:appflowy_backend/rust_stream.dart';
88

99
import 'notification_helper.dart';
1010

1111
// Folder
12-
typedef FolderNotificationCallback = void Function(FolderNotification, Either<Uint8List, FlowyError>);
12+
typedef FolderNotificationCallback = void Function(
13+
FolderNotification, Either<Uint8List, FlowyError>);
1314

14-
class FolderNotificationParser extends NotificationParser<FolderNotification, FlowyError> {
15-
FolderNotificationParser({String? id, required FolderNotificationCallback callback})
15+
class FolderNotificationParser
16+
extends NotificationParser<FolderNotification, FlowyError> {
17+
FolderNotificationParser(
18+
{String? id, required FolderNotificationCallback callback})
1619
: super(
1720
id: id,
1821
callback: callback,
@@ -21,15 +24,18 @@ class FolderNotificationParser extends NotificationParser<FolderNotification, Fl
2124
);
2225
}
2326

24-
typedef FolderNotificationHandler = Function(FolderNotification ty, Either<Uint8List, FlowyError> result);
27+
typedef FolderNotificationHandler = Function(
28+
FolderNotification ty, Either<Uint8List, FlowyError> result);
2529

2630
class FolderNotificationListener {
2731
StreamSubscription<SubscribeObject>? _subscription;
2832
FolderNotificationParser? _parser;
2933

30-
FolderNotificationListener({required String objectId, required FolderNotificationHandler handler})
34+
FolderNotificationListener(
35+
{required String objectId, required FolderNotificationHandler handler})
3136
: _parser = FolderNotificationParser(id: objectId, callback: handler) {
32-
_subscription = RustStreamReceiver.listen((observable) => _parser?.parse(observable));
37+
_subscription =
38+
RustStreamReceiver.listen((observable) => _parser?.parse(observable));
3339
}
3440

3541
Future<void> stop() async {

frontend/app_flowy/lib/core/grid_notification.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
import 'dart:async';
22
import 'dart:typed_data';
3-
import 'package:flowy_sdk/protobuf/dart-notify/protobuf.dart';
3+
import 'package:appflowy_backend/protobuf/dart-notify/protobuf.dart';
44
import 'package:dartz/dartz.dart';
5-
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
6-
import 'package:flowy_sdk/protobuf/flowy-grid/dart_notification.pb.dart';
7-
import 'package:flowy_sdk/rust_stream.dart';
5+
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
6+
import 'package:appflowy_backend/protobuf/flowy-grid/dart_notification.pb.dart';
7+
import 'package:appflowy_backend/rust_stream.dart';
88

99
import 'notification_helper.dart';
1010

frontend/app_flowy/lib/core/network_monitor.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import 'dart:async';
22

33
import 'package:connectivity_plus/connectivity_plus.dart';
4-
import 'package:flowy_sdk/log.dart';
5-
import 'package:flowy_sdk/dispatch/dispatch.dart';
6-
import 'package:flowy_sdk/protobuf/flowy-net/network_state.pb.dart';
4+
import 'package:appflowy_backend/log.dart';
5+
import 'package:appflowy_backend/dispatch/dispatch.dart';
6+
import 'package:appflowy_backend/protobuf/flowy-net/network_state.pb.dart';
77
import 'package:flutter/services.dart';
88

99
class NetworkListener {

frontend/app_flowy/lib/core/notification_helper.dart

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import 'dart:typed_data';
2-
import 'package:flowy_sdk/protobuf/dart-notify/protobuf.dart';
2+
import 'package:appflowy_backend/protobuf/dart-notify/protobuf.dart';
33
import 'package:dartz/dartz.dart';
44

55
class NotificationParser<T, E> {
@@ -9,7 +9,11 @@ class NotificationParser<T, E> {
99
T? Function(int) tyParser;
1010
E Function(Uint8List) errorParser;
1111

12-
NotificationParser({this.id, required this.callback, required this.errorParser, required this.tyParser});
12+
NotificationParser(
13+
{this.id,
14+
required this.callback,
15+
required this.errorParser,
16+
required this.tyParser});
1317
void parse(SubscribeObject subject) {
1418
if (id != null) {
1519
if (subject.id != id) {

frontend/app_flowy/lib/core/user_notification.dart

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,21 @@
11
import 'dart:async';
22
import 'dart:typed_data';
3-
import 'package:flowy_sdk/protobuf/dart-notify/protobuf.dart';
4-
import 'package:flowy_sdk/protobuf/flowy-user/protobuf.dart';
3+
import 'package:appflowy_backend/protobuf/dart-notify/protobuf.dart';
4+
import 'package:appflowy_backend/protobuf/flowy-user/protobuf.dart';
55
import 'package:dartz/dartz.dart';
6-
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
7-
import 'package:flowy_sdk/rust_stream.dart';
6+
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
7+
import 'package:appflowy_backend/rust_stream.dart';
88

99
import 'notification_helper.dart';
1010

1111
// User
12-
typedef UserNotificationCallback = void Function(UserNotification, Either<Uint8List, FlowyError>);
12+
typedef UserNotificationCallback = void Function(
13+
UserNotification, Either<Uint8List, FlowyError>);
1314

14-
class UserNotificationParser extends NotificationParser<UserNotification, FlowyError> {
15-
UserNotificationParser({required String id, required UserNotificationCallback callback})
15+
class UserNotificationParser
16+
extends NotificationParser<UserNotification, FlowyError> {
17+
UserNotificationParser(
18+
{required String id, required UserNotificationCallback callback})
1619
: super(
1720
id: id,
1821
callback: callback,
@@ -21,15 +24,18 @@ class UserNotificationParser extends NotificationParser<UserNotification, FlowyE
2124
);
2225
}
2326

24-
typedef UserNotificationHandler = Function(UserNotification ty, Either<Uint8List, FlowyError> result);
27+
typedef UserNotificationHandler = Function(
28+
UserNotification ty, Either<Uint8List, FlowyError> result);
2529

2630
class UserNotificationListener {
2731
StreamSubscription<SubscribeObject>? _subscription;
2832
UserNotificationParser? _parser;
2933

30-
UserNotificationListener({required String objectId, required UserNotificationHandler handler})
34+
UserNotificationListener(
35+
{required String objectId, required UserNotificationHandler handler})
3136
: _parser = UserNotificationParser(id: objectId, callback: handler) {
32-
_subscription = RustStreamReceiver.listen((observable) => _parser?.parse(observable));
37+
_subscription =
38+
RustStreamReceiver.listen((observable) => _parser?.parse(observable));
3339
}
3440

3541
Future<void> stop() async {

frontend/app_flowy/lib/plugins/board/application/board_bloc.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,10 @@ import 'package:app_flowy/plugins/grid/application/row/row_service.dart';
77
import 'package:appflowy_board/appflowy_board.dart';
88
import 'package:dartz/dartz.dart';
99
import 'package:equatable/equatable.dart';
10-
import 'package:flowy_sdk/log.dart';
11-
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
12-
import 'package:flowy_sdk/protobuf/flowy-folder/view.pb.dart';
13-
import 'package:flowy_sdk/protobuf/flowy-grid/protobuf.dart';
10+
import 'package:appflowy_backend/log.dart';
11+
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
12+
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
13+
import 'package:appflowy_backend/protobuf/flowy-grid/protobuf.dart';
1414
import 'package:flutter_bloc/flutter_bloc.dart';
1515
import 'package:freezed_annotation/freezed_annotation.dart';
1616

frontend/app_flowy/lib/plugins/board/application/board_data_controller.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ import 'package:app_flowy/plugins/grid/application/view/grid_view_cache.dart';
44
import 'package:app_flowy/plugins/grid/application/field/field_controller.dart';
55
import 'package:app_flowy/plugins/grid/application/grid_service.dart';
66
import 'package:app_flowy/plugins/grid/application/row/row_cache.dart';
7-
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
8-
import 'package:flowy_sdk/protobuf/flowy-folder/view.pb.dart';
7+
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
8+
import 'package:appflowy_backend/protobuf/flowy-folder/view.pb.dart';
99
import 'dart:async';
1010
import 'package:dartz/dartz.dart';
11-
import 'package:flowy_sdk/protobuf/flowy-grid/protobuf.dart';
11+
import 'package:appflowy_backend/protobuf/flowy-grid/protobuf.dart';
1212

1313
import 'board_listener.dart';
1414

frontend/app_flowy/lib/plugins/board/application/board_listener.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@ import 'dart:typed_data';
22

33
import 'package:app_flowy/core/grid_notification.dart';
44
import 'package:flowy_infra/notifier.dart';
5-
import 'package:flowy_sdk/protobuf/flowy-error/errors.pb.dart';
6-
import 'package:flowy_sdk/protobuf/flowy-grid/dart_notification.pb.dart';
5+
import 'package:appflowy_backend/protobuf/flowy-error/errors.pb.dart';
6+
import 'package:appflowy_backend/protobuf/flowy-grid/dart_notification.pb.dart';
77
import 'package:dartz/dartz.dart';
8-
import 'package:flowy_sdk/protobuf/flowy-grid/group.pb.dart';
9-
import 'package:flowy_sdk/protobuf/flowy-grid/group_changeset.pb.dart';
8+
import 'package:appflowy_backend/protobuf/flowy-grid/group.pb.dart';
9+
import 'package:appflowy_backend/protobuf/flowy-grid/group_changeset.pb.dart';
1010

1111
typedef GroupUpdateValue = Either<GroupViewChangesetPB, FlowyError>;
1212
typedef GroupByNewFieldValue = Either<List<GroupPB>, FlowyError>;

0 commit comments

Comments
 (0)