Skip to content

Commit 9ff29b8

Browse files
feat: add publishable flag to all templates (#1621)
* feat: add publishable flag to all templates Closes #1618 Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com> * fix: address review feedback on PR #1621 Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com> * fix: address review feedback on PR #1621 Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com> --------- Co-authored-by: very-good-code-bot[bot] <269805761+very-good-code-bot[bot]@users.noreply.github.com> Co-authored-by: marcossevilla <marcossevilla@users.noreply.github.com> Co-authored-by: Marcos Sevilla <31174242+marcossevilla@users.noreply.github.com>
1 parent e9996cf commit 9ff29b8

6 files changed

Lines changed: 14 additions & 3 deletions

File tree

lib/src/commands/create/commands/docs_site.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import 'package:very_good_cli/src/commands/create/templates/templates.dart';
44
/// {@template very_good_create_docs_site}
55
/// A [CreateSubCommand] for creating Dart command line interfaces.
66
/// {@endtemplate}
7-
class CreateDocsSite extends CreateSubCommand {
7+
class CreateDocsSite extends CreateSubCommand with Publishable {
88
/// {@macro very_good_create_docs_site}
99
CreateDocsSite({
1010
required super.logger,

lib/src/commands/create/commands/flame_game.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import 'package:very_good_cli/src/commands/create/templates/templates.dart';
44
/// {@template very_good_create_flame_game_command}
55
/// A [CreateSubCommand] for creating Flame games.
66
/// {@endtemplate}
7-
class CreateFlameGame extends CreateSubCommand with OrgName {
7+
class CreateFlameGame extends CreateSubCommand with OrgName, Publishable {
88
/// {@macro very_good_create_flame_game_command}
99
CreateFlameGame({
1010
required super.logger,

lib/src/commands/create/commands/flutter_app.dart

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@ import 'package:very_good_cli/src/commands/create/templates/templates.dart';
44
/// {@template very_good_create_flutter_app_command}
55
/// A [CreateSubCommand] for creating Flutter apps.
66
/// {@endtemplate}
7-
class CreateFlutterApp extends CreateSubCommand with OrgName, MultiTemplates {
7+
class CreateFlutterApp extends CreateSubCommand
8+
with OrgName, MultiTemplates, Publishable {
89
/// {@macro very_good_create_flutter_app_command}
910
CreateFlutterApp({
1011
required super.logger,

test/src/commands/create/commands/docs_site_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ Usage: very_good create docs_site <project-name> [arguments]
3333
-o, --output-directory The desired output directory when creating a new project.
3434
--description The description for this new project.
3535
(defaults to "A Very Good Project created by Very Good CLI.")
36+
--publishable Whether the generated project is intended to be published.
3637
--org-name The organization for this new project.
3738
(defaults to "my-org")
3839
@@ -187,6 +188,7 @@ void main() {
187188
vars: <String, dynamic>{
188189
'project_name': 'my_docs_site',
189190
'description': '',
191+
'publishable': false,
190192
'org_name': 'VeryGoodOpenSource',
191193
},
192194
onVarsChanged: any(named: 'onVarsChanged'),
@@ -198,6 +200,7 @@ void main() {
198200
vars: <String, dynamic>{
199201
'project_name': 'my_docs_site',
200202
'description': '',
203+
'publishable': false,
201204
'org_name': 'VeryGoodOpenSource',
202205
},
203206
logger: logger,

test/src/commands/create/commands/flame_game_test.dart

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,7 @@ final expectedUsage = [
3838
' (defaults to "A Very Good Project created by Very Good CLI.")\n'
3939
' --org-name The organization for this new project.\n'
4040
' (defaults to "com.example.verygoodcore")\n'
41+
' --publishable Whether the generated project is intended to be published.\n'
4142
' --platforms The platforms supported by the game. By default, all platforms are enabled. Example: --platforms=android,ios\n'
4243
'\n'
4344
' [android] (default) The game supports the Android platform.\n'
@@ -200,6 +201,7 @@ void main() {
200201
'project_name': 'my_app',
201202
'description': '',
202203
'org_name': 'com.example.verygoodcore',
204+
'publishable': false,
203205
'platforms': ['android', 'ios', 'web', 'macos', 'windows'],
204206
},
205207
onVarsChanged: any(named: 'onVarsChanged'),
@@ -212,6 +214,7 @@ void main() {
212214
'project_name': 'my_app',
213215
'description': '',
214216
'org_name': 'com.example.verygoodcore',
217+
'publishable': false,
215218
'platforms': ['android', 'ios', 'web', 'macos', 'windows'],
216219
},
217220
logger: logger,

test/src/commands/create/commands/flutter_app_test.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@ Usage: very_good create flutter_app <project-name> [arguments]
3737
3838
--org-name The organization for this new project.
3939
(defaults to "com.example.verygoodcore")
40+
--publishable Whether the generated project is intended to be published.
4041
--application-id The bundle identifier on iOS or application id on Android. (defaults to <org-name>.<project-name>)
4142
--platforms The platforms supported by the app. By default, all platforms are enabled. Example: --platforms=android,ios
4243
@@ -188,6 +189,7 @@ void main() {
188189
'project_name': 'my_app',
189190
'description': '',
190191
'org_name': 'com.example.verygoodcore',
192+
'publishable': false,
191193
'application_id': 'xyz.app.my_app',
192194
'platforms': const [
193195
'android',
@@ -219,6 +221,7 @@ void main() {
219221
'project_name': 'my_app',
220222
'description': '',
221223
'org_name': 'com.example.verygoodcore',
224+
'publishable': false,
222225
'application_id': 'xyz.app.my_app',
223226
'platforms': const ['android', 'ios'],
224227
},
@@ -254,6 +257,7 @@ void main() {
254257
'project_name': 'my_app',
255258
'description': '',
256259
'org_name': 'com.example.verygoodcore',
260+
'publishable': false,
257261
'application_id': 'xyz.app.my_app',
258262
'platforms': const [
259263
'android',

0 commit comments

Comments
 (0)