From d67f04dfc9ff32b10ef966edeea83882541b58aa Mon Sep 17 00:00:00 2001 From: Dane Mackier Date: Tue, 3 Jan 2023 12:30:29 +0200 Subject: [PATCH] Adds generate command --- .../stacked_tools/stacked_cli/CHANGELOG.md | 4 + .../stacked_cli/bin/stacked.dart | 2 + .../stacked_cli/example/lib/app/app.dart | 2 +- .../example/test/helpers/test_helpers.dart | 3 +- .../commands/generate/generate_command.dart | 19 + .../lib/src/models/config_model.freezed.dart | 162 ++- .../src/models/template_models.freezed.dart | 226 ++- .../stacked_tools/stacked_cli/pubspec.yaml | 4 +- .../test/helpers/test_helpers.mocks.dart | 1236 ++++++----------- 9 files changed, 659 insertions(+), 999 deletions(-) create mode 100644 packages/stacked_tools/stacked_cli/lib/src/commands/generate/generate_command.dart diff --git a/packages/stacked_tools/stacked_cli/CHANGELOG.md b/packages/stacked_tools/stacked_cli/CHANGELOG.md index adda2667d..6d0d245a1 100644 --- a/packages/stacked_tools/stacked_cli/CHANGELOG.md +++ b/packages/stacked_tools/stacked_cli/CHANGELOG.md @@ -1,3 +1,7 @@ +## 0.2.5 + +- Adds the new Generate command + ## 0.2.4 - promotes the package to stable diff --git a/packages/stacked_tools/stacked_cli/bin/stacked.dart b/packages/stacked_tools/stacked_cli/bin/stacked.dart index 0408b275a..d9125b854 100644 --- a/packages/stacked_tools/stacked_cli/bin/stacked.dart +++ b/packages/stacked_tools/stacked_cli/bin/stacked.dart @@ -4,6 +4,7 @@ import 'package:args/command_runner.dart'; import 'package:stacked_tools/src/commands/compile/compile_command.dart'; import 'package:stacked_tools/src/commands/create/create_command.dart'; import 'package:stacked_tools/src/commands/delete/delete_command.dart'; +import 'package:stacked_tools/src/commands/generate/generate_command.dart'; import 'package:stacked_tools/src/exceptions/invalid_stacked_structure_exception.dart'; import 'package:stacked_tools/src/locator.dart'; @@ -18,6 +19,7 @@ Future main(List arguments) async { ..addCommand(CreateCommand()) ..addCommand(DeleteCommand()) ..addCommand(CompileCommand()) + ..addCommand(GenerateCommand()) ..run(arguments); } on InvalidStackedStructureException catch (e) { stdout.writeln(e.message); diff --git a/packages/stacked_tools/stacked_cli/example/lib/app/app.dart b/packages/stacked_tools/stacked_cli/example/lib/app/app.dart index 3f1a10715..f30ae0952 100644 --- a/packages/stacked_tools/stacked_cli/example/lib/app/app.dart +++ b/packages/stacked_tools/stacked_cli/example/lib/app/app.dart @@ -1,6 +1,6 @@ -import 'package:stacked/stacked_annotations.dart'; import 'package:example/ui/views/home/home_view.dart'; import 'package:example/ui/views/startup/startup_view.dart'; +import 'package:stacked/stacked_annotations.dart'; import 'package:stacked_services/stacked_services.dart'; // @stacked-import diff --git a/packages/stacked_tools/stacked_cli/example/test/helpers/test_helpers.dart b/packages/stacked_tools/stacked_cli/example/test/helpers/test_helpers.dart index f8639eb19..5b3766cef 100644 --- a/packages/stacked_tools/stacked_cli/example/test/helpers/test_helpers.dart +++ b/packages/stacked_tools/stacked_cli/example/test/helpers/test_helpers.dart @@ -1,7 +1,8 @@ +import 'package:example/app/app.locator.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; -import 'package:example/app/app.locator.dart'; import 'package:stacked_services/stacked_services.dart'; + // @stacked-import import 'test_helpers.mocks.dart'; diff --git a/packages/stacked_tools/stacked_cli/lib/src/commands/generate/generate_command.dart b/packages/stacked_tools/stacked_cli/lib/src/commands/generate/generate_command.dart new file mode 100644 index 000000000..11646c89d --- /dev/null +++ b/packages/stacked_tools/stacked_cli/lib/src/commands/generate/generate_command.dart @@ -0,0 +1,19 @@ +import 'package:args/command_runner.dart'; +import 'package:stacked_tools/src/locator.dart'; +import 'package:stacked_tools/src/services/process_service.dart'; + +class GenerateCommand extends Command { + final _processService = locator(); + + @override + String get description => + '''Generates the code for the stacked application if any changes were made'''; + + @override + String get name => 'generate'; + + @override + Future run() async { + await _processService.runBuildRunner(); + } +} diff --git a/packages/stacked_tools/stacked_cli/lib/src/models/config_model.freezed.dart b/packages/stacked_tools/stacked_cli/lib/src/models/config_model.freezed.dart index bfe397268..f9bf3fd72 100644 --- a/packages/stacked_tools/stacked_cli/lib/src/models/config_model.freezed.dart +++ b/packages/stacked_tools/stacked_cli/lib/src/models/config_model.freezed.dart @@ -75,8 +75,7 @@ mixin _$Config { /// @nodoc abstract class $ConfigCopyWith<$Res> { factory $ConfigCopyWith(Config value, $Res Function(Config) then) = - _$ConfigCopyWithImpl<$Res, Config>; - @useResult + _$ConfigCopyWithImpl<$Res>; $Res call( {@JsonKey(name: 'views_path') String viewsPath, @JsonKey(name: 'services_path') String servicesPath, @@ -91,71 +90,68 @@ abstract class $ConfigCopyWith<$Res> { } /// @nodoc -class _$ConfigCopyWithImpl<$Res, $Val extends Config> - implements $ConfigCopyWith<$Res> { +class _$ConfigCopyWithImpl<$Res> implements $ConfigCopyWith<$Res> { _$ConfigCopyWithImpl(this._value, this._then); + final Config _value; // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final $Res Function(Config) _then; - @pragma('vm:prefer-inline') @override $Res call({ - Object? viewsPath = null, - Object? servicesPath = null, - Object? stackedAppFilePath = null, - Object? testHelpersFilePath = null, - Object? testServicesPath = null, - Object? testViewsPath = null, - Object? locatorName = null, - Object? registerMocksFunction = null, - Object? v1 = null, - Object? lineLength = null, + Object? viewsPath = freezed, + Object? servicesPath = freezed, + Object? stackedAppFilePath = freezed, + Object? testHelpersFilePath = freezed, + Object? testServicesPath = freezed, + Object? testViewsPath = freezed, + Object? locatorName = freezed, + Object? registerMocksFunction = freezed, + Object? v1 = freezed, + Object? lineLength = freezed, }) { return _then(_value.copyWith( - viewsPath: null == viewsPath + viewsPath: viewsPath == freezed ? _value.viewsPath : viewsPath // ignore: cast_nullable_to_non_nullable as String, - servicesPath: null == servicesPath + servicesPath: servicesPath == freezed ? _value.servicesPath : servicesPath // ignore: cast_nullable_to_non_nullable as String, - stackedAppFilePath: null == stackedAppFilePath + stackedAppFilePath: stackedAppFilePath == freezed ? _value.stackedAppFilePath : stackedAppFilePath // ignore: cast_nullable_to_non_nullable as String, - testHelpersFilePath: null == testHelpersFilePath + testHelpersFilePath: testHelpersFilePath == freezed ? _value.testHelpersFilePath : testHelpersFilePath // ignore: cast_nullable_to_non_nullable as String, - testServicesPath: null == testServicesPath + testServicesPath: testServicesPath == freezed ? _value.testServicesPath : testServicesPath // ignore: cast_nullable_to_non_nullable as String, - testViewsPath: null == testViewsPath + testViewsPath: testViewsPath == freezed ? _value.testViewsPath : testViewsPath // ignore: cast_nullable_to_non_nullable as String, - locatorName: null == locatorName + locatorName: locatorName == freezed ? _value.locatorName : locatorName // ignore: cast_nullable_to_non_nullable as String, - registerMocksFunction: null == registerMocksFunction + registerMocksFunction: registerMocksFunction == freezed ? _value.registerMocksFunction : registerMocksFunction // ignore: cast_nullable_to_non_nullable as String, - v1: null == v1 + v1: v1 == freezed ? _value.v1 : v1 // ignore: cast_nullable_to_non_nullable as bool, - lineLength: null == lineLength + lineLength: lineLength == freezed ? _value.lineLength : lineLength // ignore: cast_nullable_to_non_nullable as int, - ) as $Val); + )); } } @@ -164,7 +160,6 @@ abstract class _$$_ConfigCopyWith<$Res> implements $ConfigCopyWith<$Res> { factory _$$_ConfigCopyWith(_$_Config value, $Res Function(_$_Config) then) = __$$_ConfigCopyWithImpl<$Res>; @override - @useResult $Res call( {@JsonKey(name: 'views_path') String viewsPath, @JsonKey(name: 'services_path') String servicesPath, @@ -179,64 +174,65 @@ abstract class _$$_ConfigCopyWith<$Res> implements $ConfigCopyWith<$Res> { } /// @nodoc -class __$$_ConfigCopyWithImpl<$Res> - extends _$ConfigCopyWithImpl<$Res, _$_Config> +class __$$_ConfigCopyWithImpl<$Res> extends _$ConfigCopyWithImpl<$Res> implements _$$_ConfigCopyWith<$Res> { __$$_ConfigCopyWithImpl(_$_Config _value, $Res Function(_$_Config) _then) - : super(_value, _then); + : super(_value, (v) => _then(v as _$_Config)); + + @override + _$_Config get _value => super._value as _$_Config; - @pragma('vm:prefer-inline') @override $Res call({ - Object? viewsPath = null, - Object? servicesPath = null, - Object? stackedAppFilePath = null, - Object? testHelpersFilePath = null, - Object? testServicesPath = null, - Object? testViewsPath = null, - Object? locatorName = null, - Object? registerMocksFunction = null, - Object? v1 = null, - Object? lineLength = null, + Object? viewsPath = freezed, + Object? servicesPath = freezed, + Object? stackedAppFilePath = freezed, + Object? testHelpersFilePath = freezed, + Object? testServicesPath = freezed, + Object? testViewsPath = freezed, + Object? locatorName = freezed, + Object? registerMocksFunction = freezed, + Object? v1 = freezed, + Object? lineLength = freezed, }) { return _then(_$_Config( - viewsPath: null == viewsPath + viewsPath: viewsPath == freezed ? _value.viewsPath : viewsPath // ignore: cast_nullable_to_non_nullable as String, - servicesPath: null == servicesPath + servicesPath: servicesPath == freezed ? _value.servicesPath : servicesPath // ignore: cast_nullable_to_non_nullable as String, - stackedAppFilePath: null == stackedAppFilePath + stackedAppFilePath: stackedAppFilePath == freezed ? _value.stackedAppFilePath : stackedAppFilePath // ignore: cast_nullable_to_non_nullable as String, - testHelpersFilePath: null == testHelpersFilePath + testHelpersFilePath: testHelpersFilePath == freezed ? _value.testHelpersFilePath : testHelpersFilePath // ignore: cast_nullable_to_non_nullable as String, - testServicesPath: null == testServicesPath + testServicesPath: testServicesPath == freezed ? _value.testServicesPath : testServicesPath // ignore: cast_nullable_to_non_nullable as String, - testViewsPath: null == testViewsPath + testViewsPath: testViewsPath == freezed ? _value.testViewsPath : testViewsPath // ignore: cast_nullable_to_non_nullable as String, - locatorName: null == locatorName + locatorName: locatorName == freezed ? _value.locatorName : locatorName // ignore: cast_nullable_to_non_nullable as String, - registerMocksFunction: null == registerMocksFunction + registerMocksFunction: registerMocksFunction == freezed ? _value.registerMocksFunction : registerMocksFunction // ignore: cast_nullable_to_non_nullable as String, - v1: null == v1 + v1: v1 == freezed ? _value.v1 : v1 // ignore: cast_nullable_to_non_nullable as bool, - lineLength: null == lineLength + lineLength: lineLength == freezed ? _value.lineLength : lineLength // ignore: cast_nullable_to_non_nullable as int, @@ -339,45 +335,43 @@ class _$_Config implements _Config { return identical(this, other) || (other.runtimeType == runtimeType && other is _$_Config && - (identical(other.viewsPath, viewsPath) || - other.viewsPath == viewsPath) && - (identical(other.servicesPath, servicesPath) || - other.servicesPath == servicesPath) && - (identical(other.stackedAppFilePath, stackedAppFilePath) || - other.stackedAppFilePath == stackedAppFilePath) && - (identical(other.testHelpersFilePath, testHelpersFilePath) || - other.testHelpersFilePath == testHelpersFilePath) && - (identical(other.testServicesPath, testServicesPath) || - other.testServicesPath == testServicesPath) && - (identical(other.testViewsPath, testViewsPath) || - other.testViewsPath == testViewsPath) && - (identical(other.locatorName, locatorName) || - other.locatorName == locatorName) && - (identical(other.registerMocksFunction, registerMocksFunction) || - other.registerMocksFunction == registerMocksFunction) && - (identical(other.v1, v1) || other.v1 == v1) && - (identical(other.lineLength, lineLength) || - other.lineLength == lineLength)); + const DeepCollectionEquality().equals(other.viewsPath, viewsPath) && + const DeepCollectionEquality() + .equals(other.servicesPath, servicesPath) && + const DeepCollectionEquality() + .equals(other.stackedAppFilePath, stackedAppFilePath) && + const DeepCollectionEquality() + .equals(other.testHelpersFilePath, testHelpersFilePath) && + const DeepCollectionEquality() + .equals(other.testServicesPath, testServicesPath) && + const DeepCollectionEquality() + .equals(other.testViewsPath, testViewsPath) && + const DeepCollectionEquality() + .equals(other.locatorName, locatorName) && + const DeepCollectionEquality() + .equals(other.registerMocksFunction, registerMocksFunction) && + const DeepCollectionEquality().equals(other.v1, v1) && + const DeepCollectionEquality() + .equals(other.lineLength, lineLength)); } @JsonKey(ignore: true) @override int get hashCode => Object.hash( runtimeType, - viewsPath, - servicesPath, - stackedAppFilePath, - testHelpersFilePath, - testServicesPath, - testViewsPath, - locatorName, - registerMocksFunction, - v1, - lineLength); + const DeepCollectionEquality().hash(viewsPath), + const DeepCollectionEquality().hash(servicesPath), + const DeepCollectionEquality().hash(stackedAppFilePath), + const DeepCollectionEquality().hash(testHelpersFilePath), + const DeepCollectionEquality().hash(testServicesPath), + const DeepCollectionEquality().hash(testViewsPath), + const DeepCollectionEquality().hash(locatorName), + const DeepCollectionEquality().hash(registerMocksFunction), + const DeepCollectionEquality().hash(v1), + const DeepCollectionEquality().hash(lineLength)); @JsonKey(ignore: true) @override - @pragma('vm:prefer-inline') _$$_ConfigCopyWith<_$_Config> get copyWith => __$$_ConfigCopyWithImpl<_$_Config>(this, _$identity); diff --git a/packages/stacked_tools/stacked_cli/lib/src/models/template_models.freezed.dart b/packages/stacked_tools/stacked_cli/lib/src/models/template_models.freezed.dart index cf516bab3..a0093f319 100644 --- a/packages/stacked_tools/stacked_cli/lib/src/models/template_models.freezed.dart +++ b/packages/stacked_tools/stacked_cli/lib/src/models/template_models.freezed.dart @@ -44,48 +44,44 @@ mixin _$CompliledTemplateFile { abstract class $CompliledTemplateFileCopyWith<$Res> { factory $CompliledTemplateFileCopyWith(CompliledTemplateFile value, $Res Function(CompliledTemplateFile) then) = - _$CompliledTemplateFileCopyWithImpl<$Res, CompliledTemplateFile>; - @useResult + _$CompliledTemplateFileCopyWithImpl<$Res>; $Res call({String name, String fileName, String path, String content}); } /// @nodoc -class _$CompliledTemplateFileCopyWithImpl<$Res, - $Val extends CompliledTemplateFile> +class _$CompliledTemplateFileCopyWithImpl<$Res> implements $CompliledTemplateFileCopyWith<$Res> { _$CompliledTemplateFileCopyWithImpl(this._value, this._then); + final CompliledTemplateFile _value; // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final $Res Function(CompliledTemplateFile) _then; - @pragma('vm:prefer-inline') @override $Res call({ - Object? name = null, - Object? fileName = null, - Object? path = null, - Object? content = null, + Object? name = freezed, + Object? fileName = freezed, + Object? path = freezed, + Object? content = freezed, }) { return _then(_value.copyWith( - name: null == name + name: name == freezed ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - fileName: null == fileName + fileName: fileName == freezed ? _value.fileName : fileName // ignore: cast_nullable_to_non_nullable as String, - path: null == path + path: path == freezed ? _value.path : path // ignore: cast_nullable_to_non_nullable as String, - content: null == content + content: content == freezed ? _value.content : content // ignore: cast_nullable_to_non_nullable as String, - ) as $Val); + )); } } @@ -96,40 +92,42 @@ abstract class _$$_CompliledTemplateFileCopyWith<$Res> $Res Function(_$_CompliledTemplateFile) then) = __$$_CompliledTemplateFileCopyWithImpl<$Res>; @override - @useResult $Res call({String name, String fileName, String path, String content}); } /// @nodoc class __$$_CompliledTemplateFileCopyWithImpl<$Res> - extends _$CompliledTemplateFileCopyWithImpl<$Res, _$_CompliledTemplateFile> + extends _$CompliledTemplateFileCopyWithImpl<$Res> implements _$$_CompliledTemplateFileCopyWith<$Res> { __$$_CompliledTemplateFileCopyWithImpl(_$_CompliledTemplateFile _value, $Res Function(_$_CompliledTemplateFile) _then) - : super(_value, _then); + : super(_value, (v) => _then(v as _$_CompliledTemplateFile)); + + @override + _$_CompliledTemplateFile get _value => + super._value as _$_CompliledTemplateFile; - @pragma('vm:prefer-inline') @override $Res call({ - Object? name = null, - Object? fileName = null, - Object? path = null, - Object? content = null, + Object? name = freezed, + Object? fileName = freezed, + Object? path = freezed, + Object? content = freezed, }) { return _then(_$_CompliledTemplateFile( - name: null == name + name: name == freezed ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - fileName: null == fileName + fileName: fileName == freezed ? _value.fileName : fileName // ignore: cast_nullable_to_non_nullable as String, - path: null == path + path: path == freezed ? _value.path : path // ignore: cast_nullable_to_non_nullable as String, - content: null == content + content: content == freezed ? _value.content : content // ignore: cast_nullable_to_non_nullable as String, @@ -176,20 +174,23 @@ class _$_CompliledTemplateFile implements _CompliledTemplateFile { return identical(this, other) || (other.runtimeType == runtimeType && other is _$_CompliledTemplateFile && - (identical(other.name, name) || other.name == name) && - (identical(other.fileName, fileName) || - other.fileName == fileName) && - (identical(other.path, path) || other.path == path) && - (identical(other.content, content) || other.content == content)); + const DeepCollectionEquality().equals(other.name, name) && + const DeepCollectionEquality().equals(other.fileName, fileName) && + const DeepCollectionEquality().equals(other.path, path) && + const DeepCollectionEquality().equals(other.content, content)); } @JsonKey(ignore: true) @override - int get hashCode => Object.hash(runtimeType, name, fileName, path, content); + int get hashCode => Object.hash( + runtimeType, + const DeepCollectionEquality().hash(name), + const DeepCollectionEquality().hash(fileName), + const DeepCollectionEquality().hash(path), + const DeepCollectionEquality().hash(content)); @JsonKey(ignore: true) @override - @pragma('vm:prefer-inline') _$$_CompliledTemplateFileCopyWith<_$_CompliledTemplateFile> get copyWith => __$$_CompliledTemplateFileCopyWithImpl<_$_CompliledTemplateFile>( this, _$identity); @@ -258,8 +259,7 @@ mixin _$CompiledStackedTemplate { abstract class $CompiledStackedTemplateCopyWith<$Res> { factory $CompiledStackedTemplateCopyWith(CompiledStackedTemplate value, $Res Function(CompiledStackedTemplate) then) = - _$CompiledStackedTemplateCopyWithImpl<$Res, CompiledStackedTemplate>; - @useResult + _$CompiledStackedTemplateCopyWithImpl<$Res>; $Res call( {String name, List templateFiles, @@ -267,37 +267,34 @@ abstract class $CompiledStackedTemplateCopyWith<$Res> { } /// @nodoc -class _$CompiledStackedTemplateCopyWithImpl<$Res, - $Val extends CompiledStackedTemplate> +class _$CompiledStackedTemplateCopyWithImpl<$Res> implements $CompiledStackedTemplateCopyWith<$Res> { _$CompiledStackedTemplateCopyWithImpl(this._value, this._then); + final CompiledStackedTemplate _value; // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final $Res Function(CompiledStackedTemplate) _then; - @pragma('vm:prefer-inline') @override $Res call({ - Object? name = null, - Object? templateFiles = null, - Object? modificationFiles = null, + Object? name = freezed, + Object? templateFiles = freezed, + Object? modificationFiles = freezed, }) { return _then(_value.copyWith( - name: null == name + name: name == freezed ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - templateFiles: null == templateFiles + templateFiles: templateFiles == freezed ? _value.templateFiles : templateFiles // ignore: cast_nullable_to_non_nullable as List, - modificationFiles: null == modificationFiles + modificationFiles: modificationFiles == freezed ? _value.modificationFiles : modificationFiles // ignore: cast_nullable_to_non_nullable as List, - ) as $Val); + )); } } @@ -308,7 +305,6 @@ abstract class _$$_CompiledStackedTemplateCopyWith<$Res> $Res Function(_$_CompiledStackedTemplate) then) = __$$_CompiledStackedTemplateCopyWithImpl<$Res>; @override - @useResult $Res call( {String name, List templateFiles, @@ -317,30 +313,32 @@ abstract class _$$_CompiledStackedTemplateCopyWith<$Res> /// @nodoc class __$$_CompiledStackedTemplateCopyWithImpl<$Res> - extends _$CompiledStackedTemplateCopyWithImpl<$Res, - _$_CompiledStackedTemplate> + extends _$CompiledStackedTemplateCopyWithImpl<$Res> implements _$$_CompiledStackedTemplateCopyWith<$Res> { __$$_CompiledStackedTemplateCopyWithImpl(_$_CompiledStackedTemplate _value, $Res Function(_$_CompiledStackedTemplate) _then) - : super(_value, _then); + : super(_value, (v) => _then(v as _$_CompiledStackedTemplate)); + + @override + _$_CompiledStackedTemplate get _value => + super._value as _$_CompiledStackedTemplate; - @pragma('vm:prefer-inline') @override $Res call({ - Object? name = null, - Object? templateFiles = null, - Object? modificationFiles = null, + Object? name = freezed, + Object? templateFiles = freezed, + Object? modificationFiles = freezed, }) { return _then(_$_CompiledStackedTemplate( - name: null == name + name: name == freezed ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - templateFiles: null == templateFiles + templateFiles: templateFiles == freezed ? _value._templateFiles : templateFiles // ignore: cast_nullable_to_non_nullable as List, - modificationFiles: null == modificationFiles + modificationFiles: modificationFiles == freezed ? _value._modificationFiles : modificationFiles // ignore: cast_nullable_to_non_nullable as List, @@ -388,7 +386,7 @@ class _$_CompiledStackedTemplate implements _CompiledStackedTemplate { return identical(this, other) || (other.runtimeType == runtimeType && other is _$_CompiledStackedTemplate && - (identical(other.name, name) || other.name == name) && + const DeepCollectionEquality().equals(other.name, name) && const DeepCollectionEquality() .equals(other._templateFiles, _templateFiles) && const DeepCollectionEquality() @@ -399,13 +397,12 @@ class _$_CompiledStackedTemplate implements _CompiledStackedTemplate { @override int get hashCode => Object.hash( runtimeType, - name, + const DeepCollectionEquality().hash(name), const DeepCollectionEquality().hash(_templateFiles), const DeepCollectionEquality().hash(_modificationFiles)); @JsonKey(ignore: true) @override - @pragma('vm:prefer-inline') _$$_CompiledStackedTemplateCopyWith<_$_CompiledStackedTemplate> get copyWith => __$$_CompiledStackedTemplateCopyWithImpl<_$_CompiledStackedTemplate>( @@ -476,8 +473,7 @@ mixin _$CompiledFileModification { abstract class $CompiledFileModificationCopyWith<$Res> { factory $CompiledFileModificationCopyWith(CompiledFileModification value, $Res Function(CompiledFileModification) then) = - _$CompiledFileModificationCopyWithImpl<$Res, CompiledFileModification>; - @useResult + _$CompiledFileModificationCopyWithImpl<$Res>; $Res call( {String description, String path, @@ -488,52 +484,49 @@ abstract class $CompiledFileModificationCopyWith<$Res> { } /// @nodoc -class _$CompiledFileModificationCopyWithImpl<$Res, - $Val extends CompiledFileModification> +class _$CompiledFileModificationCopyWithImpl<$Res> implements $CompiledFileModificationCopyWith<$Res> { _$CompiledFileModificationCopyWithImpl(this._value, this._then); + final CompiledFileModification _value; // ignore: unused_field - final $Val _value; - // ignore: unused_field - final $Res Function($Val) _then; + final $Res Function(CompiledFileModification) _then; - @pragma('vm:prefer-inline') @override $Res call({ - Object? description = null, - Object? path = null, - Object? identifier = null, - Object? template = null, - Object? error = null, - Object? name = null, + Object? description = freezed, + Object? path = freezed, + Object? identifier = freezed, + Object? template = freezed, + Object? error = freezed, + Object? name = freezed, }) { return _then(_value.copyWith( - description: null == description + description: description == freezed ? _value.description : description // ignore: cast_nullable_to_non_nullable as String, - path: null == path + path: path == freezed ? _value.path : path // ignore: cast_nullable_to_non_nullable as String, - identifier: null == identifier + identifier: identifier == freezed ? _value.identifier : identifier // ignore: cast_nullable_to_non_nullable as String, - template: null == template + template: template == freezed ? _value.template : template // ignore: cast_nullable_to_non_nullable as String, - error: null == error + error: error == freezed ? _value.error : error // ignore: cast_nullable_to_non_nullable as String, - name: null == name + name: name == freezed ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, - ) as $Val); + )); } } @@ -545,7 +538,6 @@ abstract class _$$_CompiledFileModificationCopyWith<$Res> $Res Function(_$_CompiledFileModification) then) = __$$_CompiledFileModificationCopyWithImpl<$Res>; @override - @useResult $Res call( {String description, String path, @@ -557,45 +549,47 @@ abstract class _$$_CompiledFileModificationCopyWith<$Res> /// @nodoc class __$$_CompiledFileModificationCopyWithImpl<$Res> - extends _$CompiledFileModificationCopyWithImpl<$Res, - _$_CompiledFileModification> + extends _$CompiledFileModificationCopyWithImpl<$Res> implements _$$_CompiledFileModificationCopyWith<$Res> { __$$_CompiledFileModificationCopyWithImpl(_$_CompiledFileModification _value, $Res Function(_$_CompiledFileModification) _then) - : super(_value, _then); + : super(_value, (v) => _then(v as _$_CompiledFileModification)); + + @override + _$_CompiledFileModification get _value => + super._value as _$_CompiledFileModification; - @pragma('vm:prefer-inline') @override $Res call({ - Object? description = null, - Object? path = null, - Object? identifier = null, - Object? template = null, - Object? error = null, - Object? name = null, + Object? description = freezed, + Object? path = freezed, + Object? identifier = freezed, + Object? template = freezed, + Object? error = freezed, + Object? name = freezed, }) { return _then(_$_CompiledFileModification( - description: null == description + description: description == freezed ? _value.description : description // ignore: cast_nullable_to_non_nullable as String, - path: null == path + path: path == freezed ? _value.path : path // ignore: cast_nullable_to_non_nullable as String, - identifier: null == identifier + identifier: identifier == freezed ? _value.identifier : identifier // ignore: cast_nullable_to_non_nullable as String, - template: null == template + template: template == freezed ? _value.template : template // ignore: cast_nullable_to_non_nullable as String, - error: null == error + error: error == freezed ? _value.error : error // ignore: cast_nullable_to_non_nullable as String, - name: null == name + name: name == freezed ? _value.name : name // ignore: cast_nullable_to_non_nullable as String, @@ -651,25 +645,29 @@ class _$_CompiledFileModification implements _CompiledFileModification { return identical(this, other) || (other.runtimeType == runtimeType && other is _$_CompiledFileModification && - (identical(other.description, description) || - other.description == description) && - (identical(other.path, path) || other.path == path) && - (identical(other.identifier, identifier) || - other.identifier == identifier) && - (identical(other.template, template) || - other.template == template) && - (identical(other.error, error) || other.error == error) && - (identical(other.name, name) || other.name == name)); + const DeepCollectionEquality() + .equals(other.description, description) && + const DeepCollectionEquality().equals(other.path, path) && + const DeepCollectionEquality() + .equals(other.identifier, identifier) && + const DeepCollectionEquality().equals(other.template, template) && + const DeepCollectionEquality().equals(other.error, error) && + const DeepCollectionEquality().equals(other.name, name)); } @JsonKey(ignore: true) @override int get hashCode => Object.hash( - runtimeType, description, path, identifier, template, error, name); + runtimeType, + const DeepCollectionEquality().hash(description), + const DeepCollectionEquality().hash(path), + const DeepCollectionEquality().hash(identifier), + const DeepCollectionEquality().hash(template), + const DeepCollectionEquality().hash(error), + const DeepCollectionEquality().hash(name)); @JsonKey(ignore: true) @override - @pragma('vm:prefer-inline') _$$_CompiledFileModificationCopyWith<_$_CompiledFileModification> get copyWith => __$$_CompiledFileModificationCopyWithImpl< _$_CompiledFileModification>(this, _$identity); diff --git a/packages/stacked_tools/stacked_cli/pubspec.yaml b/packages/stacked_tools/stacked_cli/pubspec.yaml index 984359ea1..07be3cfd2 100644 --- a/packages/stacked_tools/stacked_cli/pubspec.yaml +++ b/packages/stacked_tools/stacked_cli/pubspec.yaml @@ -1,6 +1,6 @@ name: stacked_tools -description: The official dev tools for the stacked flutter framework -version: 0.2.4 +description: The official dev tools for the Stacked Framework +version: 0.2.5 homepage: https://stacked.filledstacks.com/docs/stacked-cli repository: https://github.com/FilledStacks/stacked/tree/master/packages/stacked_tools diff --git a/packages/stacked_tools/stacked_cli/test/helpers/test_helpers.mocks.dart b/packages/stacked_tools/stacked_cli/test/helpers/test_helpers.mocks.dart index 6c99300f9..4409b8373 100644 --- a/packages/stacked_tools/stacked_cli/test/helpers/test_helpers.mocks.dart +++ b/packages/stacked_tools/stacked_cli/test/helpers/test_helpers.mocks.dart @@ -1,4 +1,4 @@ -// Mocks generated by Mockito 5.3.2 from annotations +// Mocks generated by Mockito 5.3.0 from annotations // in stacked_tools/test/helpers/test_helpers.dart. // Do not manually edit this file. @@ -33,33 +33,18 @@ import 'package:stacked_tools/src/templates/template_render_functions.dart' // ignore_for_file: subtype_of_sealed_class class _FakeDirectory_0 extends _i1.SmartFake implements _i2.Directory { - _FakeDirectory_0( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeDirectory_0(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakePubspecYaml_1 extends _i1.SmartFake implements _i3.PubspecYaml { - _FakePubspecYaml_1( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakePubspecYaml_1(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } class _FakeAnsiPen_2 extends _i1.SmartFake implements _i4.AnsiPen { - _FakeAnsiPen_2( - Object parent, - Invocation parentInvocation, - ) : super( - parent, - parentInvocation, - ); + _FakeAnsiPen_2(Object parent, Invocation parentInvocation) + : super(parent, parentInvocation); } /// A class which mocks [FileService]. @@ -67,145 +52,96 @@ class _FakeAnsiPen_2 extends _i1.SmartFake implements _i4.AnsiPen { /// See the documentation for Mockito's code generation for more information. class MockFileService extends _i1.Mock implements _i5.FileService { @override - _i6.Future writeFile({ - required _i2.File? file, - required String? fileContent, - bool? verbose = false, - _i5.FileModificationType? type = _i5.FileModificationType.Create, - String? verboseMessage, - }) => + _i6.Future writeFile( + {_i2.File? file, + String? fileContent, + bool? verbose = false, + _i5.FileModificationType? type = _i5.FileModificationType.Create, + String? verboseMessage}) => (super.noSuchMethod( - Invocation.method( - #writeFile, - [], - { - #file: file, - #fileContent: fileContent, - #verbose: verbose, - #type: type, - #verboseMessage: verboseMessage, - }, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - @override - _i6.Future deleteFile({required String? filePath}) => - (super.noSuchMethod( - Invocation.method( - #deleteFile, - [], - {#filePath: filePath}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - @override - _i6.Future deleteFolder({required String? directoryPath}) => - (super.noSuchMethod( - Invocation.method( - #deleteFolder, - [], - {#directoryPath: directoryPath}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - @override - _i6.Future fileExists({required String? filePath}) => + Invocation.method(#writeFile, [], { + #file: file, + #fileContent: fileContent, + #verbose: verbose, + #type: type, + #verboseMessage: verboseMessage + }), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value()) + as _i6.Future); + @override + _i6.Future deleteFile({String? filePath}) => (super.noSuchMethod( + Invocation.method(#deleteFile, [], {#filePath: filePath}), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value()) as _i6.Future); + @override + _i6.Future deleteFolder({String? directoryPath}) => (super.noSuchMethod( + Invocation.method(#deleteFolder, [], {#directoryPath: directoryPath}), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value()) as _i6.Future); + @override + _i6.Future fileExists({String? filePath}) => (super.noSuchMethod( + Invocation.method(#fileExists, [], {#filePath: filePath}), + returnValue: _i6.Future.value(false), + returnValueForMissingStub: _i6.Future.value(false)) + as _i6.Future); + @override + _i6.Future readFileAsString({String? filePath}) => (super.noSuchMethod( - Invocation.method( - #fileExists, - [], - {#filePath: filePath}, - ), - returnValue: _i6.Future.value(false), - returnValueForMissingStub: _i6.Future.value(false), - ) as _i6.Future); - @override - _i6.Future readFileAsString({required String? filePath}) => - (super.noSuchMethod( - Invocation.method( - #readFileAsString, - [], - {#filePath: filePath}, - ), - returnValue: _i6.Future.value(''), - returnValueForMissingStub: _i6.Future.value(''), - ) as _i6.Future); - @override - _i6.Future> readFileAsLines({required String? filePath}) => + Invocation.method(#readFileAsString, [], {#filePath: filePath}), + returnValue: _i6.Future.value(''), + returnValueForMissingStub: _i6.Future.value('')) + as _i6.Future); + @override + _i6.Future> readFileAsLines({String? filePath}) => (super.noSuchMethod( - Invocation.method( - #readFileAsLines, - [], - {#filePath: filePath}, - ), - returnValue: _i6.Future>.value([]), - returnValueForMissingStub: _i6.Future>.value([]), - ) as _i6.Future>); - @override - _i6.Future removeSpecificFileLines({ - required String? filePath, - required String? removedContent, - String? type = r'view', - }) => + Invocation.method(#readFileAsLines, [], {#filePath: filePath}), + returnValue: _i6.Future>.value([]), + returnValueForMissingStub: + _i6.Future>.value([])) + as _i6.Future>); + @override + _i6.Future removeSpecificFileLines( + {String? filePath, String? removedContent, String? type = r'view'}) => (super.noSuchMethod( - Invocation.method( - #removeSpecificFileLines, - [], - { - #filePath: filePath, - #removedContent: removedContent, - #type: type, - }, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - @override - _i6.Future removeTestHelperFunctionFromFile({ - required String? filePath, - required String? serviceName, - }) => + Invocation.method(#removeSpecificFileLines, [], { + #filePath: filePath, + #removedContent: removedContent, + #type: type + }), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value()) + as _i6.Future); + @override + _i6.Future removeTestHelperFunctionFromFile( + {String? filePath, String? serviceName}) => (super.noSuchMethod( - Invocation.method( - #removeTestHelperFunctionFromFile, - [], - { - #filePath: filePath, - #serviceName: serviceName, - }, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#removeTestHelperFunctionFromFile, [], + {#filePath: filePath, #serviceName: serviceName}), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value()) + as _i6.Future); @override _i6.Future> getFilesInDirectory( - {required String? directoryPath}) => + {String? directoryPath}) => (super.noSuchMethod( - Invocation.method( - #getFilesInDirectory, - [], - {#directoryPath: directoryPath}, - ), - returnValue: _i6.Future>.value( - <_i2.FileSystemEntity>[]), - returnValueForMissingStub: _i6.Future>.value( - <_i2.FileSystemEntity>[]), - ) as _i6.Future>); - @override - _i6.Future> getFoldersInDirectory( - {required String? directoryPath}) => + Invocation.method( + #getFilesInDirectory, [], {#directoryPath: directoryPath}), + returnValue: _i6.Future>.value( + <_i2.FileSystemEntity>[]), + returnValueForMissingStub: + _i6.Future>.value( + <_i2.FileSystemEntity>[])) + as _i6.Future>); + @override + _i6.Future> getFoldersInDirectory({String? directoryPath}) => (super.noSuchMethod( - Invocation.method( - #getFoldersInDirectory, - [], - {#directoryPath: directoryPath}, - ), - returnValue: _i6.Future>.value([]), - returnValueForMissingStub: _i6.Future>.value([]), - ) as _i6.Future>); + Invocation.method( + #getFoldersInDirectory, [], {#directoryPath: directoryPath}), + returnValue: _i6.Future>.value([]), + returnValueForMissingStub: + _i6.Future>.value([])) + as _i6.Future>); } /// A class which mocks [PathService]. @@ -213,66 +149,37 @@ class MockFileService extends _i1.Mock implements _i5.FileService { /// See the documentation for Mockito's code generation for more information. class MockPathService extends _i1.Mock implements _i7.PathService { @override - String get templatesPath => (super.noSuchMethod( - Invocation.getter(#templatesPath), - returnValue: '', - returnValueForMissingStub: '', - ) as String); + String get templatesPath => + (super.noSuchMethod(Invocation.getter(#templatesPath), + returnValue: '', returnValueForMissingStub: '') as String); @override - String get separator => (super.noSuchMethod( - Invocation.getter(#separator), - returnValue: '', - returnValueForMissingStub: '', - ) as String); + String get separator => (super.noSuchMethod(Invocation.getter(#separator), + returnValue: '', returnValueForMissingStub: '') as String); @override _i2.Directory get configHome => (super.noSuchMethod( - Invocation.getter(#configHome), - returnValue: _FakeDirectory_0( - this, - Invocation.getter(#configHome), - ), - returnValueForMissingStub: _FakeDirectory_0( - this, Invocation.getter(#configHome), - ), - ) as _i2.Directory); - @override - String join( - String? part1, [ - String? part2, - String? part3, - String? part4, - String? part5, - String? part6, - String? part7, - String? part8, - ]) => + returnValue: _FakeDirectory_0(this, Invocation.getter(#configHome)), + returnValueForMissingStub: + _FakeDirectory_0(this, Invocation.getter(#configHome))) + as _i2.Directory); + @override + String join(String? part1, + [String? part2, + String? part3, + String? part4, + String? part5, + String? part6, + String? part7, + String? part8]) => (super.noSuchMethod( - Invocation.method( - #join, - [ - part1, - part2, - part3, - part4, - part5, - part6, - part7, - part8, - ], - ), - returnValue: '', - returnValueForMissingStub: '', - ) as String); - @override - String basename(String? path) => (super.noSuchMethod( - Invocation.method( - #basename, - [path], - ), - returnValue: '', - returnValueForMissingStub: '', - ) as String); + Invocation.method( + #join, [part1, part2, part3, part4, part5, part6, part7, part8]), + returnValue: '', + returnValueForMissingStub: '') as String); + @override + String basename(String? path) => + (super.noSuchMethod(Invocation.method(#basename, [path]), + returnValue: '', returnValueForMissingStub: '') as String); } /// A class which mocks [TemplateService]. @@ -281,195 +188,136 @@ class MockPathService extends _i1.Mock implements _i7.PathService { class MockTemplateService extends _i1.Mock implements _i8.TemplateService { @override _i6.Future compileTemplateInformation() => (super.noSuchMethod( - Invocation.method( - #compileTemplateInformation, - [], - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - @override - _i6.Future renderTemplate({ - required String? templateName, - required String? name, - bool? verbose = false, - bool? excludeRoute = false, - bool? useBuilder = false, - String? outputPath, - }) => + Invocation.method(#compileTemplateInformation, []), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value()) as _i6.Future); + @override + _i6.Future renderTemplate( + {String? templateName, + String? name, + bool? verbose = false, + bool? excludeRoute = false, + bool? useBuilder = false, + String? outputPath}) => (super.noSuchMethod( - Invocation.method( - #renderTemplate, - [], - { - #templateName: templateName, - #name: name, - #verbose: verbose, - #excludeRoute: excludeRoute, - #useBuilder: useBuilder, - #outputPath: outputPath, - }, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - @override - _i6.Future writeOutTemplateFiles({ - required _i9.StackedTemplate? template, - required String? templateName, - required String? name, - String? outputFolder, - bool? useBuilder = false, - }) => + Invocation.method(#renderTemplate, [], { + #templateName: templateName, + #name: name, + #verbose: verbose, + #excludeRoute: excludeRoute, + #useBuilder: useBuilder, + #outputPath: outputPath + }), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value()) + as _i6.Future); + @override + _i6.Future writeOutTemplateFiles( + {_i9.StackedTemplate? template, + String? templateName, + String? name, + String? outputFolder, + bool? useBuilder = false}) => (super.noSuchMethod( - Invocation.method( - #writeOutTemplateFiles, - [], - { - #template: template, - #templateName: templateName, - #name: name, - #outputFolder: outputFolder, - #useBuilder: useBuilder, - }, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - @override - String getTemplateOutputPath({ - required String? inputTemplatePath, - required String? name, - String? outputFolder, - }) => + Invocation.method(#writeOutTemplateFiles, [], { + #template: template, + #templateName: templateName, + #name: name, + #outputFolder: outputFolder, + #useBuilder: useBuilder + }), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value()) + as _i6.Future); + @override + String getTemplateOutputPath( + {String? inputTemplatePath, String? name, String? outputFolder}) => (super.noSuchMethod( - Invocation.method( - #getTemplateOutputPath, - [], - { + Invocation.method(#getTemplateOutputPath, [], { #inputTemplatePath: inputTemplatePath, #name: name, - #outputFolder: outputFolder, - }, - ), - returnValue: '', - returnValueForMissingStub: '', - ) as String); - @override - String renderContentForTemplate({ - required String? content, - required String? templateName, - required String? name, - }) => + #outputFolder: outputFolder + }), + returnValue: '', + returnValueForMissingStub: '') as String); + @override + String renderContentForTemplate( + {String? content, String? templateName, String? name}) => (super.noSuchMethod( - Invocation.method( - #renderContentForTemplate, - [], - { - #content: content, - #templateName: templateName, - #name: name, - }, - ), - returnValue: '', - returnValueForMissingStub: '', - ) as String); - @override - Map getTemplateRenderData({ - required String? templateName, - required String? name, - Map? testRenderFunctions, - }) => + Invocation.method(#renderContentForTemplate, [], + {#content: content, #templateName: templateName, #name: name}), + returnValue: '', + returnValueForMissingStub: '') as String); + @override + Map getTemplateRenderData( + {String? templateName, + String? name, + Map? testRenderFunctions}) => (super.noSuchMethod( - Invocation.method( - #getTemplateRenderData, - [], - { - #templateName: templateName, - #name: name, - #testRenderFunctions: testRenderFunctions, - }, - ), - returnValue: {}, - returnValueForMissingStub: {}, - ) as Map); + Invocation.method(#getTemplateRenderData, [], { + #templateName: templateName, + #name: name, + #testRenderFunctions: testRenderFunctions + }), + returnValue: {}, + returnValueForMissingStub: {}) + as Map); @override Map applyGlobalTemplateProperties( - Map? renderTemplate, { - String? packageName, - }) => + Map? renderTemplate, + {String? packageName}) => (super.noSuchMethod( - Invocation.method( - #applyGlobalTemplateProperties, - [renderTemplate], - {#packageName: packageName}, - ), - returnValue: {}, - returnValueForMissingStub: {}, - ) as Map); - @override - _i6.Future modifyExistingFiles({ - required _i9.StackedTemplate? template, - required String? templateName, - required String? name, - String? outputPath, - }) => + Invocation.method( + #applyGlobalTemplateProperties, + [renderTemplate], + {#packageName: packageName}), + returnValue: {}, + returnValueForMissingStub: {}) + as Map); + @override + _i6.Future modifyExistingFiles( + {_i9.StackedTemplate? template, + String? templateName, + String? name, + String? outputPath}) => (super.noSuchMethod( - Invocation.method( - #modifyExistingFiles, - [], - { - #template: template, - #templateName: templateName, - #name: name, - #outputPath: outputPath, - }, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - @override - String templateModificationName({ - required String? modificationName, - required String? name, - required String? templateName, - }) => + Invocation.method(#modifyExistingFiles, [], { + #template: template, + #templateName: templateName, + #name: name, + #outputPath: outputPath + }), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value()) + as _i6.Future); + @override + String templateModificationName( + {String? modificationName, String? name, String? templateName}) => (super.noSuchMethod( - Invocation.method( - #templateModificationName, - [], - { + Invocation.method(#templateModificationName, [], { #modificationName: modificationName, #name: name, - #templateName: templateName, - }, - ), - returnValue: '', - returnValueForMissingStub: '', - ) as String); - @override - String templateModificationFileContent({ - required String? fileContent, - required String? modificationTemplate, - required String? modificationIdentifier, - required String? name, - required String? templateName, - }) => + #templateName: templateName + }), + returnValue: '', + returnValueForMissingStub: '') as String); + @override + String templateModificationFileContent( + {String? fileContent, + String? modificationTemplate, + String? modificationIdentifier, + String? name, + String? templateName}) => (super.noSuchMethod( - Invocation.method( - #templateModificationFileContent, - [], - { + Invocation.method(#templateModificationFileContent, [], { #fileContent: fileContent, #modificationTemplate: modificationTemplate, #modificationIdentifier: modificationIdentifier, #name: name, - #templateName: templateName, - }, - ), - returnValue: '', - returnValueForMissingStub: '', - ) as String); + #templateName: templateName + }), + returnValue: '', + returnValueForMissingStub: '') as String); } /// A class which mocks [TemplateHelper]. @@ -477,117 +325,74 @@ class MockTemplateService extends _i1.Mock implements _i8.TemplateService { /// See the documentation for Mockito's code generation for more information. class MockTemplateHelper extends _i1.Mock implements _i11.TemplateHelper { @override - String get templatesPath => (super.noSuchMethod( - Invocation.getter(#templatesPath), - returnValue: '', - returnValueForMissingStub: '', - ) as String); + String get templatesPath => + (super.noSuchMethod(Invocation.getter(#templatesPath), + returnValue: '', returnValueForMissingStub: '') as String); @override - List<_i2.FileSystemEntity> getFilesWithExtension({ - required List<_i2.FileSystemEntity>? filePaths, - required String? extension, - }) => + List<_i2.FileSystemEntity> getFilesWithExtension( + {List<_i2.FileSystemEntity>? filePaths, String? extension}) => (super.noSuchMethod( - Invocation.method( - #getFilesWithExtension, - [], - { - #filePaths: filePaths, - #extension: extension, - }, - ), - returnValue: <_i2.FileSystemEntity>[], - returnValueForMissingStub: <_i2.FileSystemEntity>[], - ) as List<_i2.FileSystemEntity>); - @override - List<_i2.FileSystemEntity> getFilesThatContainSection({ - required List<_i2.FileSystemEntity>? files, - required String? section, - }) => + Invocation.method(#getFilesWithExtension, [], + {#filePaths: filePaths, #extension: extension}), + returnValue: <_i2.FileSystemEntity>[], + returnValueForMissingStub: <_i2.FileSystemEntity>[]) + as List<_i2.FileSystemEntity>); + @override + List<_i2.FileSystemEntity> getFilesThatContainSection( + {List<_i2.FileSystemEntity>? files, String? section}) => (super.noSuchMethod( - Invocation.method( - #getFilesThatContainSection, - [], - { - #files: files, - #section: section, - }, - ), - returnValue: <_i2.FileSystemEntity>[], - returnValueForMissingStub: <_i2.FileSystemEntity>[], - ) as List<_i2.FileSystemEntity>); - @override - String getTemplateFileNameOnly( - {required _i2.FileSystemEntity? templateFilePath}) => + Invocation.method(#getFilesThatContainSection, [], + {#files: files, #section: section}), + returnValue: <_i2.FileSystemEntity>[], + returnValueForMissingStub: <_i2.FileSystemEntity>[]) + as List<_i2.FileSystemEntity>); + @override + String getTemplateFileNameOnly({_i2.FileSystemEntity? templateFilePath}) => (super.noSuchMethod( - Invocation.method( - #getTemplateFileNameOnly, - [], - {#templateFilePath: templateFilePath}, - ), - returnValue: '', - returnValueForMissingStub: '', - ) as String); - @override - String getTemplateFolderName({required String? templateFilePath}) => + Invocation.method(#getTemplateFileNameOnly, [], + {#templateFilePath: templateFilePath}), + returnValue: '', + returnValueForMissingStub: '') as String); + @override + String getTemplateFolderName({String? templateFilePath}) => + (super.noSuchMethod( + Invocation.method(#getTemplateFolderName, [], + {#templateFilePath: templateFilePath}), + returnValue: '', + returnValueForMissingStub: '') as String); + @override + _i6.Future> getFilesForTemplate( + {String? templateName, String? extension = r'stk'}) => (super.noSuchMethod( - Invocation.method( - #getTemplateFolderName, - [], - {#templateFilePath: templateFilePath}, - ), - returnValue: '', - returnValueForMissingStub: '', - ) as String); - @override - _i6.Future> getFilesForTemplate({ - required String? templateName, - String? extension = r'stk', - }) => + Invocation.method(#getFilesForTemplate, [], + {#templateName: templateName, #extension: extension}), + returnValue: _i6.Future>.value( + <_i2.FileSystemEntity>[]), + returnValueForMissingStub: _i6.Future>.value( + <_i2.FileSystemEntity>[])) as _i6.Future>); + @override + _i6.Future> getTemplateModificationsToApply( + {String? templateName}) => (super.noSuchMethod( - Invocation.method( - #getFilesForTemplate, - [], - { - #templateName: templateName, - #extension: extension, - }, - ), - returnValue: _i6.Future>.value( - <_i2.FileSystemEntity>[]), - returnValueForMissingStub: _i6.Future>.value( - <_i2.FileSystemEntity>[]), - ) as _i6.Future>); - @override - _i6.Future> - getTemplateModificationsToApply({required String? templateName}) => - (super.noSuchMethod( - Invocation.method( - #getTemplateModificationsToApply, - [], - {#templateName: templateName}, - ), - returnValue: _i6.Future>.value( - <_i9.CompiledFileModification>[]), - returnValueForMissingStub: - _i6.Future>.value( - <_i9.CompiledFileModification>[]), - ) as _i6.Future>); + Invocation.method(#getTemplateModificationsToApply, [], + {#templateName: templateName}), + returnValue: _i6.Future>.value( + <_i9.CompiledFileModification>[]), + returnValueForMissingStub: + _i6.Future>.value(<_i9.CompiledFileModification>[])) + as _i6.Future>); @override _i6.Future> getTemplateItemsToRender( - {required String? templateName}) => + {String? templateName}) => (super.noSuchMethod( - Invocation.method( - #getTemplateItemsToRender, - [], - {#templateName: templateName}, - ), - returnValue: _i6.Future>.value( - <_i9.CompliledTemplateFile>[]), - returnValueForMissingStub: - _i6.Future>.value( - <_i9.CompliledTemplateFile>[]), - ) as _i6.Future>); + Invocation.method( + #getTemplateItemsToRender, [], {#templateName: templateName}), + returnValue: _i6.Future>.value( + <_i9.CompliledTemplateFile>[]), + returnValueForMissingStub: + _i6.Future>.value( + <_i9.CompliledTemplateFile>[])) + as _i6.Future>); } /// A class which mocks [PubspecService]. @@ -596,41 +401,26 @@ class MockTemplateHelper extends _i1.Mock implements _i11.TemplateHelper { class MockPubspecService extends _i1.Mock implements _i12.PubspecService { @override _i3.PubspecYaml get pubspecYaml => (super.noSuchMethod( - Invocation.getter(#pubspecYaml), - returnValue: _FakePubspecYaml_1( - this, - Invocation.getter(#pubspecYaml), - ), - returnValueForMissingStub: _FakePubspecYaml_1( - this, - Invocation.getter(#pubspecYaml), - ), - ) as _i3.PubspecYaml); - @override - set pubspecYaml(_i3.PubspecYaml? _pubspecYaml) => super.noSuchMethod( - Invocation.setter( - #pubspecYaml, - _pubspecYaml, - ), - returnValueForMissingStub: null, - ); - @override - String get getPackageName => (super.noSuchMethod( - Invocation.getter(#getPackageName), - returnValue: '', - returnValueForMissingStub: '', - ) as String); + Invocation.getter(#pubspecYaml), + returnValue: _FakePubspecYaml_1(this, Invocation.getter(#pubspecYaml)), + returnValueForMissingStub: _FakePubspecYaml_1( + this, Invocation.getter(#pubspecYaml))) as _i3.PubspecYaml); + @override + set pubspecYaml(_i3.PubspecYaml? _pubspecYaml) => + super.noSuchMethod(Invocation.setter(#pubspecYaml, _pubspecYaml), + returnValueForMissingStub: null); + @override + String get getPackageName => + (super.noSuchMethod(Invocation.getter(#getPackageName), + returnValue: '', returnValueForMissingStub: '') as String); @override _i6.Future initialise({String? workingDirectory}) => (super.noSuchMethod( - Invocation.method( - #initialise, - [], - {#workingDirectory: workingDirectory}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method( + #initialise, [], {#workingDirectory: workingDirectory}), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value()) + as _i6.Future); } /// A class which mocks [ColorizedLogService]. @@ -639,115 +429,49 @@ class MockPubspecService extends _i1.Mock implements _i12.PubspecService { class MockColorizedLogService extends _i1.Mock implements _i13.ColorizedLogService { @override - _i4.AnsiPen get pen => (super.noSuchMethod( - Invocation.getter(#pen), - returnValue: _FakeAnsiPen_2( - this, - Invocation.getter(#pen), - ), - returnValueForMissingStub: _FakeAnsiPen_2( - this, - Invocation.getter(#pen), - ), - ) as _i4.AnsiPen); - @override - set pen(_i4.AnsiPen? _pen) => super.noSuchMethod( - Invocation.setter( - #pen, - _pen, - ), - returnValueForMissingStub: null, - ); - @override - void coloredPrint( - _i4.AnsiPen? pen, { - required String? message, - }) => - super.noSuchMethod( - Invocation.method( - #coloredPrint, - [pen], - {#message: message}, - ), - returnValueForMissingStub: null, - ); - @override - void fileOutput({ - required _i5.FileModificationType? type, - required String? message, - }) => - super.noSuchMethod( - Invocation.method( - #fileOutput, - [], - { - #type: type, - #message: message, - }, - ), - returnValueForMissingStub: null, - ); - @override - void flutterOutput({required String? message}) => super.noSuchMethod( - Invocation.method( - #flutterOutput, - [], - {#message: message}, - ), - returnValueForMissingStub: null, - ); - @override - void stackedOutput({ - required String? message, - bool? isBold = false, - }) => + _i4.AnsiPen get pen => (super.noSuchMethod(Invocation.getter(#pen), + returnValue: _FakeAnsiPen_2(this, Invocation.getter(#pen)), + returnValueForMissingStub: + _FakeAnsiPen_2(this, Invocation.getter(#pen))) as _i4.AnsiPen); + @override + set pen(_i4.AnsiPen? _pen) => + super.noSuchMethod(Invocation.setter(#pen, _pen), + returnValueForMissingStub: null); + @override + void coloredPrint(_i4.AnsiPen? pen, {String? message}) => super.noSuchMethod( + Invocation.method(#coloredPrint, [pen], {#message: message}), + returnValueForMissingStub: null); + @override + void fileOutput({_i5.FileModificationType? type, String? message}) => super.noSuchMethod( - Invocation.method( - #stackedOutput, - [], - { - #message: message, - #isBold: isBold, - }, - ), - returnValueForMissingStub: null, - ); - @override - void success({required String? message}) => super.noSuchMethod( - Invocation.method( - #success, - [], - {#message: message}, - ), - returnValueForMissingStub: null, - ); - @override - void warn({required String? message}) => super.noSuchMethod( - Invocation.method( - #warn, - [], - {#message: message}, - ), - returnValueForMissingStub: null, - ); - @override - void info({required String? message}) => super.noSuchMethod( - Invocation.method( - #info, - [], - {#message: message}, - ), - returnValueForMissingStub: null, - ); - @override - void error({required String? message}) => super.noSuchMethod( - Invocation.method( - #error, - [], - {#message: message}, - ), - returnValueForMissingStub: null, - ); + Invocation.method(#fileOutput, [], {#type: type, #message: message}), + returnValueForMissingStub: null); + @override + void flutterOutput({String? message}) => super.noSuchMethod( + Invocation.method(#flutterOutput, [], {#message: message}), + returnValueForMissingStub: null); + @override + void stackedOutput({String? message, bool? isBold = false}) => super + .noSuchMethod( + Invocation.method( + #stackedOutput, [], {#message: message, #isBold: isBold}), + returnValueForMissingStub: null); + @override + void success({String? message}) => + super.noSuchMethod(Invocation.method(#success, [], {#message: message}), + returnValueForMissingStub: null); + @override + void warn({String? message}) => + super.noSuchMethod(Invocation.method(#warn, [], {#message: message}), + returnValueForMissingStub: null); + @override + void info({String? message}) => + super.noSuchMethod(Invocation.method(#info, [], {#message: message}), + returnValueForMissingStub: null); + @override + void error({String? message}) => + super.noSuchMethod(Invocation.method(#error, [], {#message: message}), + returnValueForMissingStub: null); } /// A class which mocks [ConfigService]. @@ -755,133 +479,84 @@ class MockColorizedLogService extends _i1.Mock /// See the documentation for Mockito's code generation for more information. class MockConfigService extends _i1.Mock implements _i14.ConfigService { @override - bool get hasCustomConfig => (super.noSuchMethod( - Invocation.getter(#hasCustomConfig), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); - @override - String get serviceImportPath => (super.noSuchMethod( - Invocation.getter(#serviceImportPath), - returnValue: '', - returnValueForMissingStub: '', - ) as String); - @override - String get servicePath => (super.noSuchMethod( - Invocation.getter(#servicePath), - returnValue: '', - returnValueForMissingStub: '', - ) as String); - @override - String get locatorName => (super.noSuchMethod( - Invocation.getter(#locatorName), - returnValue: '', - returnValueForMissingStub: '', - ) as String); - @override - String get registerMocksFunction => (super.noSuchMethod( - Invocation.getter(#registerMocksFunction), - returnValue: '', - returnValueForMissingStub: '', - ) as String); - @override - String get serviceTestHelpersImport => (super.noSuchMethod( - Invocation.getter(#serviceTestHelpersImport), - returnValue: '', - returnValueForMissingStub: '', - ) as String); - @override - String get stackedAppFilePath => (super.noSuchMethod( - Invocation.getter(#stackedAppFilePath), - returnValue: '', - returnValueForMissingStub: '', - ) as String); - @override - String get testHelpersFilePath => (super.noSuchMethod( - Invocation.getter(#testHelpersFilePath), - returnValue: '', - returnValueForMissingStub: '', - ) as String); - @override - String get testServicesPath => (super.noSuchMethod( - Invocation.getter(#testServicesPath), - returnValue: '', - returnValueForMissingStub: '', - ) as String); - @override - String get testViewsPath => (super.noSuchMethod( - Invocation.getter(#testViewsPath), - returnValue: '', - returnValueForMissingStub: '', - ) as String); - @override - String get viewImportPath => (super.noSuchMethod( - Invocation.getter(#viewImportPath), - returnValue: '', - returnValueForMissingStub: '', - ) as String); - @override - String get viewPath => (super.noSuchMethod( - Invocation.getter(#viewPath), - returnValue: '', - returnValueForMissingStub: '', - ) as String); - @override - String get viewTestHelpersImport => (super.noSuchMethod( - Invocation.getter(#viewTestHelpersImport), - returnValue: '', - returnValueForMissingStub: '', - ) as String); - @override - bool get v1 => (super.noSuchMethod( - Invocation.getter(#v1), - returnValue: false, - returnValueForMissingStub: false, - ) as bool); - @override - int get lineLength => (super.noSuchMethod( - Invocation.getter(#lineLength), - returnValue: 0, - returnValueForMissingStub: 0, - ) as int); + bool get hasCustomConfig => + (super.noSuchMethod(Invocation.getter(#hasCustomConfig), + returnValue: false, returnValueForMissingStub: false) as bool); + @override + String get serviceImportPath => + (super.noSuchMethod(Invocation.getter(#serviceImportPath), + returnValue: '', returnValueForMissingStub: '') as String); + @override + String get servicePath => (super.noSuchMethod(Invocation.getter(#servicePath), + returnValue: '', returnValueForMissingStub: '') as String); + @override + String get locatorName => (super.noSuchMethod(Invocation.getter(#locatorName), + returnValue: '', returnValueForMissingStub: '') as String); + @override + String get registerMocksFunction => + (super.noSuchMethod(Invocation.getter(#registerMocksFunction), + returnValue: '', returnValueForMissingStub: '') as String); + @override + String get serviceTestHelpersImport => + (super.noSuchMethod(Invocation.getter(#serviceTestHelpersImport), + returnValue: '', returnValueForMissingStub: '') as String); + @override + String get stackedAppFilePath => + (super.noSuchMethod(Invocation.getter(#stackedAppFilePath), + returnValue: '', returnValueForMissingStub: '') as String); + @override + String get testHelpersFilePath => + (super.noSuchMethod(Invocation.getter(#testHelpersFilePath), + returnValue: '', returnValueForMissingStub: '') as String); + @override + String get testServicesPath => + (super.noSuchMethod(Invocation.getter(#testServicesPath), + returnValue: '', returnValueForMissingStub: '') as String); + @override + String get testViewsPath => + (super.noSuchMethod(Invocation.getter(#testViewsPath), + returnValue: '', returnValueForMissingStub: '') as String); + @override + String get viewImportPath => + (super.noSuchMethod(Invocation.getter(#viewImportPath), + returnValue: '', returnValueForMissingStub: '') as String); + @override + String get viewPath => (super.noSuchMethod(Invocation.getter(#viewPath), + returnValue: '', returnValueForMissingStub: '') as String); + @override + String get viewTestHelpersImport => + (super.noSuchMethod(Invocation.getter(#viewTestHelpersImport), + returnValue: '', returnValueForMissingStub: '') as String); + @override + bool get v1 => (super.noSuchMethod(Invocation.getter(#v1), + returnValue: false, returnValueForMissingStub: false) as bool); + @override + int get lineLength => (super.noSuchMethod(Invocation.getter(#lineLength), + returnValue: 0, returnValueForMissingStub: 0) as int); @override _i6.Future resolveConfigFile({String? path}) => (super.noSuchMethod( - Invocation.method( - #resolveConfigFile, - [], - {#path: path}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#resolveConfigFile, [], {#path: path}), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value()) + as _i6.Future); @override _i6.Future loadConfig({String? path}) => (super.noSuchMethod( - Invocation.method( - #loadConfig, - [], - {#path: path}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - @override - String replaceCustomPaths(String? path) => (super.noSuchMethod( - Invocation.method( - #replaceCustomPaths, - [path], - ), - returnValue: '', - returnValueForMissingStub: '', - ) as String); + Invocation.method(#loadConfig, [], {#path: path}), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value()) as _i6.Future); + @override + String replaceCustomPaths(String? path) => + (super.noSuchMethod(Invocation.method(#replaceCustomPaths, [path]), + returnValue: '', returnValueForMissingStub: '') as String); + @override + String sanitizePath(String? path, [String? find = r'lib/']) => + (super.noSuchMethod(Invocation.method(#sanitizePath, [path, find]), + returnValue: '', returnValueForMissingStub: '') as String); @override String getFilePathToHelpersAndMocks(String? path) => (super.noSuchMethod( - Invocation.method( - #getFilePathToHelpersAndMocks, - [path], - ), - returnValue: '', - returnValueForMissingStub: '', - ) as String); + Invocation.method(#getFilePathToHelpersAndMocks, [path]), + returnValue: '', + returnValueForMissingStub: '') as String); } /// A class which mocks [ProcessService]. @@ -889,67 +564,34 @@ class MockConfigService extends _i1.Mock implements _i14.ConfigService { /// See the documentation for Mockito's code generation for more information. class MockProcessService extends _i1.Mock implements _i15.ProcessService { @override - set formattingLineLength(String? length) => super.noSuchMethod( - Invocation.setter( - #formattingLineLength, - length, - ), - returnValueForMissingStub: null, - ); + set formattingLineLength(String? length) => + super.noSuchMethod(Invocation.setter(#formattingLineLength, length), + returnValueForMissingStub: null); @override - _i6.Future runCreateApp({required String? appName}) => - (super.noSuchMethod( - Invocation.method( - #runCreateApp, - [], - {#appName: appName}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + _i6.Future runCreateApp({String? appName}) => (super.noSuchMethod( + Invocation.method(#runCreateApp, [], {#appName: appName}), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value()) as _i6.Future); @override _i6.Future runBuildRunner({String? appName}) => (super.noSuchMethod( - Invocation.method( - #runBuildRunner, - [], - {#appName: appName}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); + Invocation.method(#runBuildRunner, [], {#appName: appName}), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value()) as _i6.Future); @override _i6.Future runPubGet({String? appName}) => (super.noSuchMethod( - Invocation.method( - #runPubGet, - [], - {#appName: appName}, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - @override - _i6.Future runFormat({ - String? appName, - String? filePath, - }) => + Invocation.method(#runPubGet, [], {#appName: appName}), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value()) as _i6.Future); + @override + _i6.Future runFormat({String? appName, String? filePath}) => (super.noSuchMethod( - Invocation.method( - #runFormat, - [], - { - #appName: appName, - #filePath: filePath, - }, - ), - returnValue: _i6.Future.value(), - returnValueForMissingStub: _i6.Future.value(), - ) as _i6.Future); - @override - void logSuccessStatus(int? exitCode) => super.noSuchMethod( - Invocation.method( - #logSuccessStatus, - [exitCode], - ), - returnValueForMissingStub: null, - ); + Invocation.method( + #runFormat, [], {#appName: appName, #filePath: filePath}), + returnValue: _i6.Future.value(), + returnValueForMissingStub: _i6.Future.value()) + as _i6.Future); + @override + void logSuccessStatus(int? exitCode) => + super.noSuchMethod(Invocation.method(#logSuccessStatus, [exitCode]), + returnValueForMissingStub: null); }