Compare commits
4 Commits
48c5215c70
...
d69106adeb
Author | SHA1 | Date | |
---|---|---|---|
d69106adeb | |||
cca7b29a6d | |||
283bf80243 | |||
d217a202cb |
@ -1 +1 @@
|
||||
{"bricks":{"wyatt_component_template":{"git":{"url":"ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git","path":"bricks/wyatt_component_template","ref":"0d2605717add29556b12ad1145e4457d71f18c18"}},"wyatt_package_template":{"git":{"url":"ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git","path":"bricks/wyatt_package_template","ref":"0d2605717add29556b12ad1145e4457d71f18c18"}}}}
|
||||
{"bricks":{"wyatt_component_template":{"git":{"url":"ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git","path":"bricks/wyatt_component_template","ref":"1f3807adb548a7d65ead7f19e8b743462cb6be22"}},"wyatt_package_template":{"git":{"url":"ssh://git@git.wyatt-studio.fr:993/Wyatt-FOSS/wyatt-bricks.git","path":"bricks/wyatt_package_template","ref":"1f3807adb548a7d65ead7f19e8b743462cb6be22"}}}}
|
@ -27,34 +27,34 @@ class ExampleAuthenticationCubit extends AuthenticationCubit<int> {
|
||||
Result<Account, AppException> result) async {
|
||||
debugPrint('onReauthenticate');
|
||||
|
||||
return const Ok(1);
|
||||
return Ok(1);
|
||||
}
|
||||
|
||||
@override
|
||||
FutureOrResult<int?> onRefresh(Result<Account, AppException> result) {
|
||||
debugPrint('onRefresh');
|
||||
|
||||
return const Ok(1);
|
||||
return Ok(1);
|
||||
}
|
||||
|
||||
@override
|
||||
FutureOrResult<int?> onSignInFromCache(AuthenticationSession<int> session) {
|
||||
debugPrint('onSignInFromCache');
|
||||
|
||||
return const Ok(1);
|
||||
return Ok(1);
|
||||
}
|
||||
|
||||
@override
|
||||
FutureOrResult<void> onSignOut() {
|
||||
debugPrint('onSignOut');
|
||||
|
||||
return const Ok(null);
|
||||
return Ok(null);
|
||||
}
|
||||
|
||||
@override
|
||||
FutureOrResult<void> onDelete() {
|
||||
debugPrint('onDelete');
|
||||
|
||||
return const Ok(null);
|
||||
return Ok(null);
|
||||
}
|
||||
}
|
||||
|
@ -30,7 +30,7 @@ class ExampleSignInCubit extends SignInCubit<int> {
|
||||
Result<Account, AppException> result, WyattForm form) {
|
||||
debugPrint('onSignInWithEmailAndPassword: ${result.ok?.accessToken}');
|
||||
|
||||
return const Ok(1);
|
||||
return Ok(1);
|
||||
}
|
||||
|
||||
@override
|
||||
@ -38,7 +38,7 @@ class ExampleSignInCubit extends SignInCubit<int> {
|
||||
Result<Account, AppException> result, WyattForm form) {
|
||||
debugPrint('onSignInAnonymously');
|
||||
|
||||
return const Ok(1);
|
||||
return Ok(1);
|
||||
}
|
||||
|
||||
@override
|
||||
@ -46,6 +46,6 @@ class ExampleSignInCubit extends SignInCubit<int> {
|
||||
Result<Account, AppException> result, WyattForm form) {
|
||||
debugPrint('onSignInWithGoogle');
|
||||
|
||||
return const Ok(1);
|
||||
return Ok(1);
|
||||
}
|
||||
}
|
||||
|
@ -30,6 +30,6 @@ class ExampleSignUpCubit extends SignUpCubit<int> {
|
||||
Result<Account, AppException> result, WyattForm form) async {
|
||||
debugPrint('onSignUpWithEmailAndPassword');
|
||||
|
||||
return const Ok(1);
|
||||
return Ok(1);
|
||||
}
|
||||
}
|
||||
|
@ -28,7 +28,7 @@ class ExampleEditAccountCubit extends EditAccountCubit<int> {
|
||||
Result<Account, AppException> result, WyattForm form) async {
|
||||
debugPrint('onEmailUpdated');
|
||||
|
||||
return const Ok(1);
|
||||
return Ok(1);
|
||||
}
|
||||
|
||||
@override
|
||||
@ -36,6 +36,6 @@ class ExampleEditAccountCubit extends EditAccountCubit<int> {
|
||||
Result<Account, AppException> result, WyattForm form) async {
|
||||
debugPrint('onPasswordUpdated');
|
||||
|
||||
return const Ok(1);
|
||||
return Ok(1);
|
||||
}
|
||||
}
|
||||
|
@ -20,7 +20,7 @@ import 'package:wyatt_authentication_bloc/src/domain/entities/account.dart';
|
||||
/// {@template authentication_cache_data_source}
|
||||
/// A data source that manages the cache strategy.
|
||||
/// {@endtemplate}
|
||||
abstract class AuthenticationCacheDataSource<Data> extends BaseLocalDataSource {
|
||||
abstract class AuthenticationCacheDataSource<Data> extends BaseDataSource {
|
||||
/// {@macro authentication_cache_data_source}
|
||||
const AuthenticationCacheDataSource();
|
||||
|
||||
|
@ -20,8 +20,7 @@ import 'package:wyatt_authentication_bloc/wyatt_authentication_bloc.dart';
|
||||
/// {@template authentication_session_data_source}
|
||||
/// A data source that manages the current session.
|
||||
/// {@endtemplate}
|
||||
abstract class AuthenticationSessionDataSource<Data>
|
||||
extends BaseLocalDataSource {
|
||||
abstract class AuthenticationSessionDataSource<Data> extends BaseDataSource {
|
||||
/// {@macro authentication_session_data_source}
|
||||
const AuthenticationSessionDataSource();
|
||||
|
||||
|
@ -22,8 +22,7 @@ import 'package:wyatt_authentication_bloc/src/domain/entities/account.dart';
|
||||
/// It is responsible for all the external communication with the authentication
|
||||
/// providers.
|
||||
/// {@endtemplate}
|
||||
abstract class AuthenticationRemoteDataSource<Data>
|
||||
extends BaseRemoteDataSource {
|
||||
abstract class AuthenticationRemoteDataSource<Data> extends BaseDataSource {
|
||||
/// {@macro authentication_remote_data_source}
|
||||
const AuthenticationRemoteDataSource();
|
||||
|
||||
|
@ -43,12 +43,12 @@ class EditAccountCubit<Data> extends BaseEditAccountCubit<Data>
|
||||
Result<Account, AppException> result,
|
||||
WyattForm form,
|
||||
) =>
|
||||
const Ok(null);
|
||||
Ok(null);
|
||||
|
||||
@override
|
||||
FutureOrResult<Data?> onPasswordUpdated(
|
||||
Result<Account, AppException> result,
|
||||
WyattForm form,
|
||||
) =>
|
||||
const Ok(null);
|
||||
Ok(null);
|
||||
}
|
||||
|
@ -48,19 +48,19 @@ class SignInCubit<Data> extends BaseSignInCubit<Data>
|
||||
Result<Account, AppException> result,
|
||||
WyattForm form,
|
||||
) =>
|
||||
const Ok(null);
|
||||
Ok(null);
|
||||
|
||||
@override
|
||||
FutureOrResult<Data?> onSignInWithEmailAndPassword(
|
||||
Result<Account, AppException> result,
|
||||
WyattForm form,
|
||||
) =>
|
||||
const Ok(null);
|
||||
Ok(null);
|
||||
|
||||
@override
|
||||
FutureOrResult<Data?> onSignInWithGoogle(
|
||||
Result<Account, AppException> result,
|
||||
WyattForm form,
|
||||
) =>
|
||||
const Ok(null);
|
||||
Ok(null);
|
||||
}
|
||||
|
@ -43,5 +43,5 @@ class SignUpCubit<Data> extends BaseSignUpCubit<Data>
|
||||
Result<Account, AppException> result,
|
||||
WyattForm form,
|
||||
) =>
|
||||
const Ok(null);
|
||||
Ok(null);
|
||||
}
|
||||
|
@ -30,26 +30,26 @@ class TestAuthenticationCubit extends AuthenticationCubit<int> {
|
||||
TestAuthenticationCubit({required super.authenticationRepository});
|
||||
|
||||
@override
|
||||
FutureOrResult<void> onDelete() async => const Ok(null);
|
||||
FutureOrResult<void> onDelete() async => Ok(null);
|
||||
|
||||
@override
|
||||
FutureOrResult<int?> onReauthenticate(
|
||||
Result<Account, AppException> result,
|
||||
) async =>
|
||||
const Ok(null);
|
||||
Ok(null);
|
||||
|
||||
@override
|
||||
FutureOrResult<int?> onRefresh(Result<Account, AppException> result) async =>
|
||||
const Ok(null);
|
||||
Ok(null);
|
||||
|
||||
@override
|
||||
FutureOrResult<int?> onSignInFromCache(
|
||||
AuthenticationSession<int> session,
|
||||
) async =>
|
||||
const Ok(null);
|
||||
Ok(null);
|
||||
|
||||
@override
|
||||
FutureOrResult<void> onSignOut() async => const Ok(null);
|
||||
FutureOrResult<void> onSignOut() async => Ok(null);
|
||||
}
|
||||
|
||||
void main() {
|
||||
@ -92,7 +92,7 @@ void main() {
|
||||
build: () => TestAuthenticationCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
),
|
||||
seed: () => const AuthenticationState.unknown(),
|
||||
seed: AuthenticationState.unknown,
|
||||
expect: () => [AuthenticationState<int>.authenticated(session)],
|
||||
);
|
||||
|
||||
@ -108,7 +108,7 @@ void main() {
|
||||
build: () => TestAuthenticationCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
),
|
||||
seed: () => const AuthenticationState.unknown(),
|
||||
seed: AuthenticationState.unknown,
|
||||
expect: () => [const AuthenticationState<int>.unauthenticated()],
|
||||
);
|
||||
});
|
||||
@ -119,7 +119,7 @@ void main() {
|
||||
setUp: () {
|
||||
when(
|
||||
() => authenticationRepository.signOut(),
|
||||
).thenAnswer((_) async => const Ok(null));
|
||||
).thenAnswer((_) async => Ok(null));
|
||||
},
|
||||
build: () => TestAuthenticationCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
|
@ -84,7 +84,7 @@ void main() {
|
||||
'invokes sendEmailVerification,',
|
||||
setUp: () {
|
||||
when(() => authenticationRepository.sendEmailVerification())
|
||||
.thenAnswer((_) async => const Ok(null));
|
||||
.thenAnswer((_) async => Ok(null));
|
||||
},
|
||||
build: () => EmailVerificationCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
@ -100,12 +100,12 @@ void main() {
|
||||
'emits success',
|
||||
setUp: () {
|
||||
when(() => authenticationRepository.sendEmailVerification())
|
||||
.thenAnswer((_) async => const Ok(null));
|
||||
.thenAnswer((_) async => Ok(null));
|
||||
},
|
||||
build: () => EmailVerificationCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
),
|
||||
seed: () => const EmailVerificationState(),
|
||||
seed: EmailVerificationState.new,
|
||||
act: (cubit) => cubit.sendEmailVerification(),
|
||||
expect: () => [
|
||||
const EmailVerificationState(
|
||||
@ -121,12 +121,12 @@ void main() {
|
||||
'emits failure',
|
||||
setUp: () {
|
||||
when(() => authenticationRepository.sendEmailVerification())
|
||||
.thenAnswer((_) async => const Err(ServerException('erreur')));
|
||||
.thenAnswer((_) async => Err(const ServerException('erreur')));
|
||||
},
|
||||
build: () => EmailVerificationCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
),
|
||||
seed: () => const EmailVerificationState(),
|
||||
seed: EmailVerificationState.new,
|
||||
act: (cubit) => cubit.sendEmailVerification(),
|
||||
expect: () => [
|
||||
const EmailVerificationState(
|
||||
@ -183,7 +183,7 @@ void main() {
|
||||
build: () => EmailVerificationCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
),
|
||||
seed: () => const EmailVerificationState(),
|
||||
seed: EmailVerificationState.new,
|
||||
act: (cubit) => cubit.checkEmailVerification(),
|
||||
expect: () => [
|
||||
const EmailVerificationState(
|
||||
@ -206,7 +206,7 @@ void main() {
|
||||
build: () => EmailVerificationCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
),
|
||||
seed: () => const EmailVerificationState(),
|
||||
seed: EmailVerificationState.new,
|
||||
act: (cubit) => cubit.checkEmailVerification(),
|
||||
expect: () => [
|
||||
const EmailVerificationState(
|
||||
@ -222,12 +222,12 @@ void main() {
|
||||
'emits failure on refresh error',
|
||||
setUp: () {
|
||||
when(() => authenticationRepository.refresh())
|
||||
.thenAnswer((_) async => const Err(ServerException('erreur')));
|
||||
.thenAnswer((_) async => Err(const ServerException('erreur')));
|
||||
},
|
||||
build: () => EmailVerificationCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
),
|
||||
seed: () => const EmailVerificationState(),
|
||||
seed: EmailVerificationState.new,
|
||||
act: (cubit) => cubit.checkEmailVerification(),
|
||||
expect: () => [
|
||||
const EmailVerificationState(
|
||||
|
@ -57,7 +57,7 @@ void main() {
|
||||
() => authenticationRepository.sendPasswordResetEmail(
|
||||
email: any(named: 'email'),
|
||||
),
|
||||
).thenAnswer((_) async => const Ok(null));
|
||||
).thenAnswer((_) async => Ok(null));
|
||||
|
||||
when(
|
||||
() => authenticationRepository.formRepository,
|
||||
@ -157,7 +157,7 @@ void main() {
|
||||
authenticationRepository: authenticationRepository,
|
||||
),
|
||||
act: (cubit) => cubit.submit(),
|
||||
expect: () => const <PasswordResetState>[],
|
||||
expect: () => <PasswordResetState>[],
|
||||
);
|
||||
|
||||
blocTest<PasswordResetCubit<int>, PasswordResetState>(
|
||||
@ -272,7 +272,7 @@ void main() {
|
||||
() => authenticationRepository.sendPasswordResetEmail(
|
||||
email: any(named: 'email'),
|
||||
),
|
||||
).thenAnswer((_) async => const Err(ServerException()));
|
||||
).thenAnswer((_) async => Err(const ServerException()));
|
||||
when(
|
||||
() => formRepository.accessForm(AuthFormName.passwordResetForm),
|
||||
).thenAnswer(
|
||||
|
@ -435,7 +435,7 @@ void main() {
|
||||
email: any(named: 'email'),
|
||||
password: any(named: 'password'),
|
||||
),
|
||||
).thenAnswer((_) async => const Err(ServerException()));
|
||||
).thenAnswer((_) async => Err(const ServerException()));
|
||||
when(
|
||||
() => formRepository.accessForm(AuthFormName.signInForm),
|
||||
).thenAnswer(
|
||||
@ -615,7 +615,7 @@ void main() {
|
||||
setUp: () {
|
||||
when(
|
||||
() => authenticationRepository.signInAnonymously(),
|
||||
).thenAnswer((_) async => const Err(ServerException()));
|
||||
).thenAnswer((_) async => Err(const ServerException()));
|
||||
},
|
||||
build: () => SignInCubit(
|
||||
authenticationRepository: authenticationRepository,
|
||||
|
@ -406,7 +406,7 @@ void main() {
|
||||
email: any(named: 'email'),
|
||||
password: any(named: 'password'),
|
||||
),
|
||||
).thenAnswer((_) async => const Err(ServerException()));
|
||||
).thenAnswer((_) async => Err(const ServerException()));
|
||||
when(
|
||||
() => formRepository.accessForm(AuthFormName.signUpForm),
|
||||
).thenAnswer(
|
||||
|
@ -17,12 +17,12 @@
|
||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||
import 'package:wyatt_cloud_messaging_bloc_base/src/domain/repositories/cloud_messaging_repository.dart';
|
||||
|
||||
class InitCloudmessagingUseCase extends AsyncUseCase<NoParam, void> {
|
||||
class InitCloudmessagingUseCase extends NoParamsAsyncUseCase<void> {
|
||||
InitCloudmessagingUseCase({
|
||||
required CloudMessagingRepository notificationRepository,
|
||||
}) : _notificationRepository = notificationRepository;
|
||||
final CloudMessagingRepository _notificationRepository;
|
||||
@override
|
||||
FutureOrResult<void> execute(NoParam? params) =>
|
||||
FutureOrResult<void> execute() =>
|
||||
_notificationRepository.init();
|
||||
}
|
||||
|
@ -24,13 +24,13 @@ import 'package:wyatt_cloud_messaging_bloc_base/src/domain/repositories/cloud_me
|
||||
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
||||
|
||||
class ListenNotificationUseCase
|
||||
extends StreamUseCase<NoParam, RemoteNotification> {
|
||||
extends NoParamsAsyncUseCase<Stream<RemoteNotification>> {
|
||||
ListenNotificationUseCase({
|
||||
required CloudMessagingRepository notificationRepository,
|
||||
}) : _notificationRepository = notificationRepository;
|
||||
final CloudMessagingRepository _notificationRepository;
|
||||
@override
|
||||
FutureOrResult<Stream<RemoteNotification>> execute(NoParam? params) async {
|
||||
FutureOrResult<Stream<RemoteNotification>> execute() async {
|
||||
Stream<RemoteNotification>? notificationStream;
|
||||
|
||||
final notificationStreamResponse =
|
||||
@ -66,7 +66,7 @@ class ListenNotificationUseCase
|
||||
}
|
||||
|
||||
if (notificationStream == null) {
|
||||
return const Err(NotificationException('Cannot listen notifications'));
|
||||
return Err(const NotificationException('Cannot listen notifications'));
|
||||
}
|
||||
|
||||
return Ok(notificationStream);
|
||||
|
@ -18,11 +18,9 @@ import 'dart:async';
|
||||
|
||||
import 'package:equatable/equatable.dart';
|
||||
import 'package:flutter_bloc/flutter_bloc.dart';
|
||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||
import 'package:wyatt_cloud_messaging_bloc_base/src/domain/entities/remote_notifications.dart';
|
||||
import 'package:wyatt_cloud_messaging_bloc_base/src/domain/usecases/listen_notification_use_case.dart';
|
||||
import 'package:wyatt_cloud_messaging_bloc_base/src/domain/usecases/subscribe_to_notification_topic_use_case.dart';
|
||||
|
||||
import 'package:wyatt_cloud_messaging_bloc_base/src/domain/usecases/unsubscribe_from_notification_topic_use_case.dart';
|
||||
|
||||
part 'cloud_messaging_state.dart';
|
||||
@ -46,7 +44,7 @@ class CloudMessagingCubit extends Cubit<CloudmessagingState> {
|
||||
final OnNotification? handleNotification;
|
||||
|
||||
Future<void> listenNotification() async {
|
||||
final notificaitons = await _listenNotification.execute(const NoParam());
|
||||
final notificaitons = await _listenNotification.execute();
|
||||
if (notificaitons.isOk) {
|
||||
notificaitons.ok?.listen((notification) {
|
||||
emit(CloudmessagingState(notification));
|
||||
|
@ -0,0 +1,23 @@
|
||||
// Copyright (C) 2024 WYATT GROUP
|
||||
// Please see the AUTHORS file for details.
|
||||
//
|
||||
// This program is free software: you can redistribute it and/or modify
|
||||
// it under the terms of the GNU General Public License as published by
|
||||
// the Free Software Foundation, either version 3 of the License, or
|
||||
// any later version.
|
||||
//
|
||||
// This program is distributed in the hope that it will be useful,
|
||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
// GNU General Public License for more details.
|
||||
//
|
||||
// You should have received a copy of the GNU General Public License
|
||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:wyatt_continuous_deployment_example/main.dart';
|
||||
|
||||
void main(List<String> args) {
|
||||
WyattContinuousDeploymentExample.run(args).then((_) => exit(0));
|
||||
}
|
@ -20,7 +20,7 @@ class WyattContinuousDeploymentExample {
|
||||
static Future<void> run(List<String> args) async {
|
||||
const useCase = CheckToolsUsecase();
|
||||
|
||||
final result = await useCase(null);
|
||||
final result = await useCase();
|
||||
|
||||
result.fold((value) => print('Success'), (error) => print('Error: $error'));
|
||||
}
|
||||
|
@ -66,7 +66,7 @@ class InitProjectTask extends TaskCubit {
|
||||
// 2. Check tools
|
||||
emit(TaskStateCheckTools());
|
||||
|
||||
final checkToolsResult = await checkToolsUsecase(null);
|
||||
final checkToolsResult = await checkToolsUsecase();
|
||||
if (checkToolsResult.isErr) {
|
||||
return emit(TaskStateError.fromRes(checkToolsResult));
|
||||
}
|
||||
|
@ -62,7 +62,7 @@ abstract class TaskCubit extends Cubit<TaskState> {
|
||||
if (checks) {
|
||||
emit(TaskStateCheckTools());
|
||||
|
||||
final checkToolsResult = await _checkToolsUsecase(null);
|
||||
final checkToolsResult = await _checkToolsUsecase();
|
||||
if (checkToolsResult.isErr) {
|
||||
return emit(TaskStateError.fromRes(checkToolsResult));
|
||||
}
|
||||
|
@ -49,9 +49,9 @@ class Flutter {
|
||||
final FlutterBuildIpaUsecase _flutterBuildIpaUsecase;
|
||||
final FlutterBuildAppBundleUsecase _flutterBuildAppBundleUsecase;
|
||||
|
||||
FutureOrResult<void> clean() => _flutterCleanUsecase(null);
|
||||
FutureOrResult<void> getDependencies() => _flutterPubGetUsecase(null);
|
||||
FutureOrResult<void> createXcArchive() => _flutterBuildXcarchiveUsecase(null);
|
||||
FutureOrResult<void> clean() => _flutterCleanUsecase();
|
||||
FutureOrResult<void> getDependencies() => _flutterPubGetUsecase();
|
||||
FutureOrResult<void> createXcArchive() => _flutterBuildXcarchiveUsecase();
|
||||
FutureOrResult<void> buildIpa(List<String> args) =>
|
||||
_flutterBuildIpaUsecase(args);
|
||||
FutureOrResult<void> buildAppBundle(List<String> args) =>
|
||||
|
@ -19,7 +19,6 @@ import 'dart:io';
|
||||
|
||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||
import 'package:wyatt_continuous_deployment/src/core/utils/logging.dart';
|
||||
import 'package:wyatt_continuous_deployment/src/domain/usecases/usecase.dart';
|
||||
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
||||
|
||||
abstract class ProcessUsecase<T> extends AsyncUseCase<T, void> {
|
||||
@ -58,7 +57,7 @@ abstract class ProcessUsecase<T> extends AsyncUseCase<T, void> {
|
||||
}
|
||||
progress.complete(onCompletedMessage);
|
||||
logger.detail(processResult?.stdout.toString().trim());
|
||||
return const Ok(null);
|
||||
return Ok(null);
|
||||
}
|
||||
|
||||
/// Run the process with the given parameters.
|
||||
@ -81,7 +80,7 @@ abstract class ProcessNoParamsUsecase extends NoParamsAsyncUseCase<void> {
|
||||
String get onErrorMessage;
|
||||
|
||||
@override
|
||||
FutureOrResult<void> execute(void params) async {
|
||||
FutureOrResult<void> execute() async {
|
||||
final progress = logger.progress(onStartedMessage);
|
||||
final processResult = await run();
|
||||
if (processResult != null) {
|
||||
@ -94,7 +93,7 @@ abstract class ProcessNoParamsUsecase extends NoParamsAsyncUseCase<void> {
|
||||
}
|
||||
progress.complete(onCompletedMessage);
|
||||
logger.detail(processResult?.stdout.toString().trim());
|
||||
return const Ok(null);
|
||||
return Ok(null);
|
||||
}
|
||||
|
||||
/// Run the process with no parameters.
|
||||
|
@ -27,7 +27,7 @@ class CheckToolsUsecase extends NoParamsAsyncUseCase<void> {
|
||||
const CheckToolsUsecase() : super();
|
||||
|
||||
@override
|
||||
FutureOrResult<void> execute(void params) async => unsafeAsync(() async {
|
||||
FutureOrResult<void> execute() async => unsafeAsync(() async {
|
||||
final missingTools = <String>[];
|
||||
for (final tool in AppConstants.requiredTools) {
|
||||
final isInstalled = await checkToolInstalled(tool);
|
||||
|
@ -17,7 +17,6 @@
|
||||
import 'dart:async';
|
||||
|
||||
import 'package:wyatt_architecture/wyatt_architecture.dart';
|
||||
import 'package:wyatt_continuous_deployment/src/core/extensions/object_extension.dart';
|
||||
import 'package:wyatt_type_utils/wyatt_type_utils.dart';
|
||||
|
||||
typedef Res<T> = Result<T, AppException>;
|
||||
@ -28,7 +27,3 @@ FutureOrResult<T> unsafeAsync<T>(FutureOr<T> Function() fn) =>
|
||||
() async => fn.call(),
|
||||
(error) => error.toException(),
|
||||
);
|
||||
|
||||
abstract class NoParamsAsyncUseCase<T> extends AsyncUseCase<void, T> {
|
||||
const NoParamsAsyncUseCase();
|
||||
}
|
||||
|
@ -1,7 +1,7 @@
|
||||
name: wyatt_packages_workspace
|
||||
|
||||
environment:
|
||||
sdk: '>=2.18.0 <3.0.0'
|
||||
sdk: '>=3.0.0 <4.0.0'
|
||||
|
||||
dev_dependencies:
|
||||
melos: ^3.0.1
|
||||
melos: ^5.2.2
|
||||
|
Loading…
x
Reference in New Issue
Block a user