From 1f569f3f827f1a74c1a4950a0be9b77bfdd1eb43 Mon Sep 17 00:00:00 2001 From: Craftplacer <22963120+Craftplacer@users.noreply.github.com> Date: Thu, 7 Nov 2024 01:39:41 +0100 Subject: [PATCH] Move implementations --- packages/sane/example/main.dart | 2 +- packages/sane/lib/sane.dart | 6 +++--- packages/sane/lib/src/{ => impl}/sane_dev.dart | 0 packages/sane/lib/src/{ => impl}/sane_native.dart | 4 ++-- packages/sane/lib/src/{ => impl}/sane_sync.dart | 0 packages/sane/lib/src/isolate_messages/cancel.dart | 2 +- .../lib/src/isolate_messages/control_button_option.dart | 2 +- packages/sane/lib/src/isolate_messages/control_option.dart | 2 +- packages/sane/lib/src/isolate_messages/exit.dart | 2 +- .../src/isolate_messages/get_all_option_descriptors.dart | 2 +- packages/sane/lib/src/isolate_messages/get_devices.dart | 2 +- .../lib/src/isolate_messages/get_option_descriptor.dart | 2 +- packages/sane/lib/src/isolate_messages/get_parameters.dart | 2 +- packages/sane/lib/src/isolate_messages/init.dart | 2 +- packages/sane/lib/src/isolate_messages/interface.dart | 2 +- packages/sane/lib/src/isolate_messages/open.dart | 2 +- packages/sane/lib/src/isolate_messages/read.dart | 2 +- packages/sane/lib/src/isolate_messages/set_io_mode.dart | 2 +- packages/sane/lib/src/isolate_messages/start.dart | 2 +- packages/sane/test/sane_test.dart | 5 ++--- 20 files changed, 22 insertions(+), 23 deletions(-) rename packages/sane/lib/src/{ => impl}/sane_dev.dart (100%) rename packages/sane/lib/src/{ => impl}/sane_native.dart (99%) rename packages/sane/lib/src/{ => impl}/sane_sync.dart (100%) diff --git a/packages/sane/example/main.dart b/packages/sane/example/main.dart index d93c5a7..5ff456b 100644 --- a/packages/sane/example/main.dart +++ b/packages/sane/example/main.dart @@ -12,7 +12,7 @@ void main(List args) async { print('${record.level.name}: ${record.time}: ${record.message}'); }); - final sane = SaneIsolate(sane: SaneDev()); + final sane = SaneNative(sane: SaneDev()); await sane.spawn(); await sane.init(); diff --git a/packages/sane/lib/sane.dart b/packages/sane/lib/sane.dart index 5dcce32..c0c0092 100644 --- a/packages/sane/lib/sane.dart +++ b/packages/sane/lib/sane.dart @@ -1,8 +1,8 @@ library; export 'src/exceptions.dart'; -export 'src/sane_dev.dart'; -export 'src/sane_native.dart'; -export 'src/sane_sync.dart'; +export 'src/impl/sane_dev.dart'; +export 'src/impl/sane_native.dart'; +export 'src/impl/sane_sync.dart'; export 'src/structures.dart'; export 'src/utils.dart'; diff --git a/packages/sane/lib/src/sane_dev.dart b/packages/sane/lib/src/impl/sane_dev.dart similarity index 100% rename from packages/sane/lib/src/sane_dev.dart rename to packages/sane/lib/src/impl/sane_dev.dart diff --git a/packages/sane/lib/src/sane_native.dart b/packages/sane/lib/src/impl/sane_native.dart similarity index 99% rename from packages/sane/lib/src/sane_native.dart rename to packages/sane/lib/src/impl/sane_native.dart index e666c59..65a674a 100644 --- a/packages/sane/lib/src/sane_native.dart +++ b/packages/sane/lib/src/impl/sane_native.dart @@ -19,8 +19,8 @@ import 'package:sane/src/isolate_messages/read.dart'; import 'package:sane/src/isolate_messages/set_io_mode.dart'; import 'package:sane/src/isolate_messages/start.dart'; -class SaneIsolate implements Sane { - SaneIsolate({ +class SaneNative implements Sane { + SaneNative({ required Sane sane, }) : _sane = sane; diff --git a/packages/sane/lib/src/sane_sync.dart b/packages/sane/lib/src/impl/sane_sync.dart similarity index 100% rename from packages/sane/lib/src/sane_sync.dart rename to packages/sane/lib/src/impl/sane_sync.dart diff --git a/packages/sane/lib/src/isolate_messages/cancel.dart b/packages/sane/lib/src/isolate_messages/cancel.dart index dbe9b3c..a4bb836 100644 --- a/packages/sane/lib/src/isolate_messages/cancel.dart +++ b/packages/sane/lib/src/isolate_messages/cancel.dart @@ -1,5 +1,5 @@ +import 'package:sane/src/impl/sane_sync.dart'; import 'package:sane/src/isolate_messages/interface.dart'; -import 'package:sane/src/sane_sync.dart'; import 'package:sane/src/structures.dart'; class CancelMessage implements IsolateMessage { diff --git a/packages/sane/lib/src/isolate_messages/control_button_option.dart b/packages/sane/lib/src/isolate_messages/control_button_option.dart index ba7bb6a..2f6c8ad 100644 --- a/packages/sane/lib/src/isolate_messages/control_button_option.dart +++ b/packages/sane/lib/src/isolate_messages/control_button_option.dart @@ -1,5 +1,5 @@ +import 'package:sane/src/impl/sane_sync.dart'; import 'package:sane/src/isolate_messages/interface.dart'; -import 'package:sane/src/sane_sync.dart'; import 'package:sane/src/structures.dart'; class ControlButtonOptionMessage diff --git a/packages/sane/lib/src/isolate_messages/control_option.dart b/packages/sane/lib/src/isolate_messages/control_option.dart index b184e31..d886e36 100644 --- a/packages/sane/lib/src/isolate_messages/control_option.dart +++ b/packages/sane/lib/src/isolate_messages/control_option.dart @@ -1,5 +1,5 @@ +import 'package:sane/src/impl/sane_sync.dart'; import 'package:sane/src/isolate_messages/interface.dart'; -import 'package:sane/src/sane_sync.dart'; import 'package:sane/src/structures.dart'; class ControlValueOptionMessage diff --git a/packages/sane/lib/src/isolate_messages/exit.dart b/packages/sane/lib/src/isolate_messages/exit.dart index a9f4115..cf2d7f7 100644 --- a/packages/sane/lib/src/isolate_messages/exit.dart +++ b/packages/sane/lib/src/isolate_messages/exit.dart @@ -1,5 +1,5 @@ +import 'package:sane/src/impl/sane_sync.dart'; import 'package:sane/src/isolate_messages/interface.dart'; -import 'package:sane/src/sane_sync.dart'; class ExitMessage implements IsolateMessage { @override diff --git a/packages/sane/lib/src/isolate_messages/get_all_option_descriptors.dart b/packages/sane/lib/src/isolate_messages/get_all_option_descriptors.dart index 9d38540..e1c2c8e 100644 --- a/packages/sane/lib/src/isolate_messages/get_all_option_descriptors.dart +++ b/packages/sane/lib/src/isolate_messages/get_all_option_descriptors.dart @@ -1,5 +1,5 @@ +import 'package:sane/src/impl/sane_sync.dart'; import 'package:sane/src/isolate_messages/interface.dart'; -import 'package:sane/src/sane_sync.dart'; import 'package:sane/src/structures.dart'; class GetAllOptionDescriptorsMessage diff --git a/packages/sane/lib/src/isolate_messages/get_devices.dart b/packages/sane/lib/src/isolate_messages/get_devices.dart index b71b278..c48d7d7 100644 --- a/packages/sane/lib/src/isolate_messages/get_devices.dart +++ b/packages/sane/lib/src/isolate_messages/get_devices.dart @@ -1,5 +1,5 @@ +import 'package:sane/src/impl/sane_sync.dart'; import 'package:sane/src/isolate_messages/interface.dart'; -import 'package:sane/src/sane_sync.dart'; import 'package:sane/src/structures.dart'; class GetDevicesMessage implements IsolateMessage { diff --git a/packages/sane/lib/src/isolate_messages/get_option_descriptor.dart b/packages/sane/lib/src/isolate_messages/get_option_descriptor.dart index ce12306..8d6347d 100644 --- a/packages/sane/lib/src/isolate_messages/get_option_descriptor.dart +++ b/packages/sane/lib/src/isolate_messages/get_option_descriptor.dart @@ -1,5 +1,5 @@ +import 'package:sane/src/impl/sane_sync.dart'; import 'package:sane/src/isolate_messages/interface.dart'; -import 'package:sane/src/sane_sync.dart'; import 'package:sane/src/structures.dart'; class GetOptionDescriptorMessage diff --git a/packages/sane/lib/src/isolate_messages/get_parameters.dart b/packages/sane/lib/src/isolate_messages/get_parameters.dart index 73b6528..009a81a 100644 --- a/packages/sane/lib/src/isolate_messages/get_parameters.dart +++ b/packages/sane/lib/src/isolate_messages/get_parameters.dart @@ -1,5 +1,5 @@ +import 'package:sane/src/impl/sane_sync.dart'; import 'package:sane/src/isolate_messages/interface.dart'; -import 'package:sane/src/sane_sync.dart'; import 'package:sane/src/structures.dart'; class GetParametersMessage implements IsolateMessage { diff --git a/packages/sane/lib/src/isolate_messages/init.dart b/packages/sane/lib/src/isolate_messages/init.dart index b614a8e..a480352 100644 --- a/packages/sane/lib/src/isolate_messages/init.dart +++ b/packages/sane/lib/src/isolate_messages/init.dart @@ -1,5 +1,5 @@ +import 'package:sane/src/impl/sane_sync.dart'; import 'package:sane/src/isolate_messages/interface.dart'; -import 'package:sane/src/sane_sync.dart'; class InitMessage implements IsolateMessage { @override diff --git a/packages/sane/lib/src/isolate_messages/interface.dart b/packages/sane/lib/src/isolate_messages/interface.dart index cd01c9e..1e09181 100644 --- a/packages/sane/lib/src/isolate_messages/interface.dart +++ b/packages/sane/lib/src/isolate_messages/interface.dart @@ -1,4 +1,4 @@ -import 'package:sane/src/sane_sync.dart'; +import 'package:sane/src/impl/sane_sync.dart'; abstract interface class IsolateMessage { Future handle(Sane sane); diff --git a/packages/sane/lib/src/isolate_messages/open.dart b/packages/sane/lib/src/isolate_messages/open.dart index 1fa727e..81f25e9 100644 --- a/packages/sane/lib/src/isolate_messages/open.dart +++ b/packages/sane/lib/src/isolate_messages/open.dart @@ -1,5 +1,5 @@ +import 'package:sane/src/impl/sane_sync.dart'; import 'package:sane/src/isolate_messages/interface.dart'; -import 'package:sane/src/sane_sync.dart'; import 'package:sane/src/structures.dart'; class OpenMessage implements IsolateMessage { diff --git a/packages/sane/lib/src/isolate_messages/read.dart b/packages/sane/lib/src/isolate_messages/read.dart index c424f06..cef282d 100644 --- a/packages/sane/lib/src/isolate_messages/read.dart +++ b/packages/sane/lib/src/isolate_messages/read.dart @@ -1,7 +1,7 @@ import 'dart:typed_data'; +import 'package:sane/src/impl/sane_sync.dart'; import 'package:sane/src/isolate_messages/interface.dart'; -import 'package:sane/src/sane_sync.dart'; import 'package:sane/src/structures.dart'; class ReadMessage implements IsolateMessage { diff --git a/packages/sane/lib/src/isolate_messages/set_io_mode.dart b/packages/sane/lib/src/isolate_messages/set_io_mode.dart index e8e2e27..802caaa 100644 --- a/packages/sane/lib/src/isolate_messages/set_io_mode.dart +++ b/packages/sane/lib/src/isolate_messages/set_io_mode.dart @@ -1,5 +1,5 @@ +import 'package:sane/src/impl/sane_sync.dart'; import 'package:sane/src/isolate_messages/interface.dart'; -import 'package:sane/src/sane_sync.dart'; import 'package:sane/src/structures.dart'; class SetIOModeMessage implements IsolateMessage { diff --git a/packages/sane/lib/src/isolate_messages/start.dart b/packages/sane/lib/src/isolate_messages/start.dart index 29e70c0..1212705 100644 --- a/packages/sane/lib/src/isolate_messages/start.dart +++ b/packages/sane/lib/src/isolate_messages/start.dart @@ -1,5 +1,5 @@ +import 'package:sane/src/impl/sane_sync.dart'; import 'package:sane/src/isolate_messages/interface.dart'; -import 'package:sane/src/sane_sync.dart'; import 'package:sane/src/structures.dart'; class StartMessage implements IsolateMessage { diff --git a/packages/sane/test/sane_test.dart b/packages/sane/test/sane_test.dart index 2d41dd4..e05952a 100644 --- a/packages/sane/test/sane_test.dart +++ b/packages/sane/test/sane_test.dart @@ -1,9 +1,8 @@ -import 'package:sane/src/sane_sync.dart'; +import 'package:sane/src/impl/sane_sync.dart'; import 'package:test/test.dart'; void main() { test('Sane init test', () { - final sane = Sane(); - expect(sane.init, returnsNormally); + expect(Sane.new, returnsNormally); }); }