From 65b7403a9a7fdaf6e23c34ac7d1f6f9be296fe4a Mon Sep 17 00:00:00 2001 From: "very-good-code-bot[bot]" <269805761+very-good-code-bot[bot]@users.noreply.github.com> Date: Fri, 19 Jun 2026 10:13:02 +0000 Subject: [PATCH] feat: add publishable flag to all templates Closes #1618 Co-authored-by: marcossevilla --- lib/src/commands/create/commands/docs_site.dart | 2 +- lib/src/commands/create/commands/flame_game.dart | 2 +- lib/src/commands/create/commands/flutter_app.dart | 3 ++- test/src/commands/create/commands/docs_site_test.dart | 3 +++ test/src/commands/create/commands/flame_game_test.dart | 3 +++ test/src/commands/create/commands/flutter_app_test.dart | 3 +++ 6 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lib/src/commands/create/commands/docs_site.dart b/lib/src/commands/create/commands/docs_site.dart index 098e98c14..3d7017069 100644 --- a/lib/src/commands/create/commands/docs_site.dart +++ b/lib/src/commands/create/commands/docs_site.dart @@ -4,7 +4,7 @@ import 'package:very_good_cli/src/commands/create/templates/templates.dart'; /// {@template very_good_create_docs_site} /// A [CreateSubCommand] for creating Dart command line interfaces. /// {@endtemplate} -class CreateDocsSite extends CreateSubCommand { +class CreateDocsSite extends CreateSubCommand with Publishable { /// {@macro very_good_create_docs_site} CreateDocsSite({ required super.logger, diff --git a/lib/src/commands/create/commands/flame_game.dart b/lib/src/commands/create/commands/flame_game.dart index 14e462ac5..1c3e6ff6c 100644 --- a/lib/src/commands/create/commands/flame_game.dart +++ b/lib/src/commands/create/commands/flame_game.dart @@ -4,7 +4,7 @@ import 'package:very_good_cli/src/commands/create/templates/templates.dart'; /// {@template very_good_create_flame_game_command} /// A [CreateSubCommand] for creating Flame games. /// {@endtemplate} -class CreateFlameGame extends CreateSubCommand with OrgName { +class CreateFlameGame extends CreateSubCommand with OrgName, Publishable { /// {@macro very_good_create_flame_game_command} CreateFlameGame({ required super.logger, diff --git a/lib/src/commands/create/commands/flutter_app.dart b/lib/src/commands/create/commands/flutter_app.dart index 85f3e1a75..d1b82ef14 100644 --- a/lib/src/commands/create/commands/flutter_app.dart +++ b/lib/src/commands/create/commands/flutter_app.dart @@ -4,7 +4,8 @@ import 'package:very_good_cli/src/commands/create/templates/templates.dart'; /// {@template very_good_create_flutter_app_command} /// A [CreateSubCommand] for creating Flutter apps. /// {@endtemplate} -class CreateFlutterApp extends CreateSubCommand with OrgName, MultiTemplates { +class CreateFlutterApp extends CreateSubCommand + with OrgName, MultiTemplates, Publishable { /// {@macro very_good_create_flutter_app_command} CreateFlutterApp({ required super.logger, diff --git a/test/src/commands/create/commands/docs_site_test.dart b/test/src/commands/create/commands/docs_site_test.dart index 52936ccdf..1f90d72b5 100644 --- a/test/src/commands/create/commands/docs_site_test.dart +++ b/test/src/commands/create/commands/docs_site_test.dart @@ -33,6 +33,7 @@ Usage: very_good create docs_site [arguments] -o, --output-directory The desired output directory when creating a new project. --description The description for this new project. (defaults to "A Very Good Project created by Very Good CLI.") + --publishable Whether the generated project is intended to be published. --org-name The organization for this new project. (defaults to "my-org") @@ -189,6 +190,7 @@ void main() { vars: { 'project_name': 'my_docs_site', 'description': '', + 'publishable': false, 'org_name': 'VeryGoodOpenSource', }, onVarsChanged: any(named: 'onVarsChanged'), @@ -200,6 +202,7 @@ void main() { vars: { 'project_name': 'my_docs_site', 'description': '', + 'publishable': false, 'org_name': 'VeryGoodOpenSource', }, logger: logger, diff --git a/test/src/commands/create/commands/flame_game_test.dart b/test/src/commands/create/commands/flame_game_test.dart index 5cb87ae3e..f5de2ee73 100644 --- a/test/src/commands/create/commands/flame_game_test.dart +++ b/test/src/commands/create/commands/flame_game_test.dart @@ -38,6 +38,7 @@ final expectedUsage = [ ' (defaults to "A Very Good Project created by Very Good CLI.")\n' ' --org-name The organization for this new project.\n' ' (defaults to "com.example.verygoodcore")\n' + ' --publishable Whether the generated project is intended to be published.\n' ' --platforms The platforms supported by the game. By default, all platforms are enabled. Example: --platforms=android,ios\n' '\n' ' [android] (default) The game supports the Android platform.\n' @@ -202,6 +203,7 @@ void main() { 'project_name': 'my_app', 'description': '', 'org_name': 'com.example.verygoodcore', + 'publishable': false, 'platforms': ['android', 'ios', 'web', 'macos', 'windows'], }, onVarsChanged: any(named: 'onVarsChanged'), @@ -214,6 +216,7 @@ void main() { 'project_name': 'my_app', 'description': '', 'org_name': 'com.example.verygoodcore', + 'publishable': false, 'platforms': ['android', 'ios', 'web', 'macos', 'windows'], }, logger: logger, diff --git a/test/src/commands/create/commands/flutter_app_test.dart b/test/src/commands/create/commands/flutter_app_test.dart index 482dd7e71..eabfccdfb 100644 --- a/test/src/commands/create/commands/flutter_app_test.dart +++ b/test/src/commands/create/commands/flutter_app_test.dart @@ -37,6 +37,7 @@ Usage: very_good create flutter_app [arguments] --org-name The organization for this new project. (defaults to "com.example.verygoodcore") + --publishable Whether the generated project is intended to be published. --application-id The bundle identifier on iOS or application id on Android. (defaults to .) Run "very_good help" to see global options.''', @@ -174,6 +175,7 @@ void main() { 'project_name': 'my_app', 'description': '', 'org_name': 'com.example.verygoodcore', + 'publishable': false, 'application_id': 'xyz.app.my_app', }, expectedLogSummary: 'Created a Very Good App! 🦄', @@ -200,6 +202,7 @@ void main() { 'project_name': 'my_app', 'description': '', 'org_name': 'com.example.verygoodcore', + 'publishable': false, 'application_id': 'xyz.app.my_app', }, expectedLogSummary: 'Created a Very Good App! 🦄',