From 0c522001592c205d6986c00ef1083439663a51ae Mon Sep 17 00:00:00 2001 From: Felix Angelov Date: Tue, 27 Jun 2023 22:29:06 -0700 Subject: [PATCH] chore(bricks): flutter_bloc_feature v0.3.0 (#3891) --- bricks/flutter_bloc_feature/CHANGELOG.md | 5 +++++ bricks/flutter_bloc_feature/LICENSE | 2 +- bricks/flutter_bloc_feature/brick.yaml | 2 +- bricks/flutter_bloc_feature/hooks/pre_gen.dart | 18 ++++++++++++++++-- bricks/flutter_bloc_feature/hooks/pubspec.yaml | 2 +- 5 files changed, 24 insertions(+), 5 deletions(-) diff --git a/bricks/flutter_bloc_feature/CHANGELOG.md b/bricks/flutter_bloc_feature/CHANGELOG.md index a227443ea16..23e405ab90e 100644 --- a/bricks/flutter_bloc_feature/CHANGELOG.md +++ b/bricks/flutter_bloc_feature/CHANGELOG.md @@ -1,3 +1,8 @@ +# 0.3.0 + +- feat: upgrade to Dart 3.0 + - use `sealed` classes for bloc events + # 0.2.1 - fix: upgrade to mason v0.1.0-dev.40 diff --git a/bricks/flutter_bloc_feature/LICENSE b/bricks/flutter_bloc_feature/LICENSE index 269ac1dbf3d..d4f112b7a57 100644 --- a/bricks/flutter_bloc_feature/LICENSE +++ b/bricks/flutter_bloc_feature/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2022 Felix Angelov +Copyright (c) 2023 Felix Angelov Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/bricks/flutter_bloc_feature/brick.yaml b/bricks/flutter_bloc_feature/brick.yaml index da59af0d734..78bb31e5268 100644 --- a/bricks/flutter_bloc_feature/brick.yaml +++ b/bricks/flutter_bloc_feature/brick.yaml @@ -1,7 +1,7 @@ name: flutter_bloc_feature description: Generate a new Flutter feature with bloc. Built for the bloc state management library. repository: https://github.com/felangel/bloc/tree/master/bricks/flutter_bloc_feature -version: 0.2.1 +version: 0.3.0 environment: mason: ">=0.1.0-dev.40 <0.1.0" diff --git a/bricks/flutter_bloc_feature/hooks/pre_gen.dart b/bricks/flutter_bloc_feature/hooks/pre_gen.dart index deb2f46f5c7..a820e09ef30 100644 --- a/bricks/flutter_bloc_feature/hooks/pre_gen.dart +++ b/bricks/flutter_bloc_feature/hooks/pre_gen.dart @@ -1,3 +1,5 @@ +// ignore_for_file: constant_identifier_names + import 'dart:io'; import 'package:mason/mason.dart'; @@ -12,12 +14,24 @@ enum BlocType { replay_cubit, } +final brickVersions = { + BlocType.bloc: '^0.3.0', + BlocType.cubit: '^0.2.0', + BlocType.hydrated_bloc: '^0.3.0', + BlocType.hydrated_cubit: '^0.2.0', + BlocType.replay_bloc: '^0.2.0', + BlocType.replay_cubit: '^0.2.0', +}; + Future run(HookContext context) async { final blocType = _blocTypeFromContext(context); final progress = context.logger.progress('Making brick ${blocType.name}'); final name = context.vars['name'] as String; final style = context.vars['style'] as String; - final brick = Brick.version(name: blocType.name, version: '^0.2.0'); + final brick = Brick.version( + name: blocType.name, + version: brickVersions[blocType]!, + ); final generator = await MasonGenerator.fromBrick(brick); final blocDirectoryName = blocType.toDirectoryName(); final directory = Directory( @@ -34,7 +48,7 @@ Future run(HookContext context) async { ); await generator.hooks.postGen(vars: vars); final blocExport = - './${blocDirectoryName}/${name.snakeCase}_${blocDirectoryName}.dart'; + './$blocDirectoryName/${name.snakeCase}_$blocDirectoryName.dart'; progress.complete('Made brick ${blocType.name}'); context.logger.logFilesGenerated(files.length); context.vars = { diff --git a/bricks/flutter_bloc_feature/hooks/pubspec.yaml b/bricks/flutter_bloc_feature/hooks/pubspec.yaml index 3d2958e29b9..2df2d206e12 100644 --- a/bricks/flutter_bloc_feature/hooks/pubspec.yaml +++ b/bricks/flutter_bloc_feature/hooks/pubspec.yaml @@ -1,7 +1,7 @@ name: flutter_bloc_feature_hooks environment: - sdk: ">=2.12.0 <3.0.0" + sdk: ">=2.15.0 <3.0.0" dependencies: mason: ^0.1.0-dev.40