fix: dart template should not rely on `flutter` commands
yahu1031 opened this issue Β· comments
Mr.Minnu commented
Description
I'm trying to create a cli using very_good_cli, but I noticed that it uses Flutter to get packages. But Why? We can actually use Dart and Flutter according to the project types, right?
Steps To Reproduce
- Install cli
- create a dart_cli project
- Observe the logs
Expected Behavior
Should Ideally, use dart cli to get package dependencies
Verbose Logs
mr.minnu@MrMinnu's-Macbook-Pro ~ % very_good create dart_cli ttd_cli --verbose
Argument information:
Top level options:
- verbose: true
Command: create
Command options:
Command sub command: dart_cli
Building generator from brick: very_good_dart_cli ^0.5.1
Validating project name; args: [ttd_cli]
Validating project name; args: [ttd_cli]
β Generated 24 file(s) (63ms)
Validating project name; args: [ttd_cli]
Running: flutter with [--version]
stdout:
Flutter 3.18.0-19.0.pre.64 β’ channel master β’ https://github.com/flutter/flutter.git
Framework β’ revision 49edbc7491 (8 days ago) β’ 2024-01-04 10:26:48 -0800
Engine β’ revision b81023eb71
Tools β’ Dart 3.3.0 (build 3.3.0-279.0.dev) β’ DevTools 2.31.0
stderr:
Running: flutter with [pub, get] ### <------ SEE HERE
β Running "flutter pub get" in ./ttd_cli... (3.8s)stdout: ### <------ SEE HERE
Resolving dependencies...
+ _fe_analyzer_shared 65.0.0
+ analyzer 6.3.0
+ args 2.4.2
+ async 2.11.0
+ boolean_selector 2.1.1
+ build 2.4.1
+ build_config 1.1.1
+ build_daemon 4.0.1
+ build_resolvers 2.4.2
+ build_runner 2.4.8
+ build_runner_core 7.2.11
+ build_verify 3.1.0
+ build_version 2.1.1
+ built_collection 5.1.1
+ built_value 8.8.1
+ checked_yaml 2.0.3
+ cli_completion 0.3.0 (0.4.0 available)
+ code_builder 4.10.0
+ collection 1.18.0
+ convert 3.1.1
+ coverage 1.7.2
+ crypto 3.0.3
+ dart_style 2.3.4
+ equatable 2.0.5
+ ffi 2.1.0
+ file 6.1.4 (7.0.0 available)
+ fixnum 1.1.0
+ frontend_server_client 3.2.0
+ glob 2.1.2
+ graphs 2.3.1
+ http 1.1.2
+ http_multi_server 3.2.1
+ http_parser 4.0.2
+ io 1.0.4
+ js 0.7.0
+ json_annotation 4.8.1
+ logging 1.2.0
+ mason_logger 0.2.11
+ matcher 0.12.16+1
+ meta 1.11.0
+ mime 1.0.4
+ mocktail 1.0.2
+ node_preamble 2.0.2
+ package_config 2.1.0
+ path 1.9.0
+ platform 3.1.4
+ pool 1.5.1
+ process 4.2.4 (5.0.2 available)
+ pub_semver 2.1.4
+ pub_updater 0.3.1 (0.4.0 available)
+ pubspec_parse 1.2.3
+ shelf 1.4.1
+ shelf_packages_handler 3.0.2
+ shelf_static 1.1.2
+ shelf_web_socket 1.0.4
+ source_map_stack_trace 2.1.1
+ source_maps 0.10.12
+ source_span 1.10.0
+ stack_trace 1.11.1
+ stream_channel 2.1.2
+ stream_transform 2.1.0
+ string_scanner 1.2.0
+ term_glyph 1.2.1
+ test 1.25.1
+ test_api 0.7.0
+ test_core 0.6.0
+ timing 1.0.1
+ typed_data 1.3.2
+ very_good_analysis 5.1.0
+ vm_service 14.0.0
+ watcher 1.1.0
+ web 0.4.2
+ web_socket_channel 2.4.3
+ webkit_inspection_protocol 1.2.1
+ win32 5.2.0
+ yaml 3.1.2
Changed 76 dependencies!
4 packages have newer versions incompatible with dependency constraints.
Try `flutter pub outdated` for more information. ### <------ SEE HERE
stderr:
β Running "flutter pub get" in ./ttd_cli (3.9s)
Running: dart with [--version]
stdout:
Dart SDK version: 3.3.0-279.0.dev (dev) (Thu Jan 4 06:34:46 2024 -0800) on "macos_arm64"
stderr:
Running: dart with [fix, --apply]
β Ή Running "dart fix --apply" in ./ttd_cli... (1.8s)stdout:
Computing fixes in ttd_cli...
Applying fixes...
lib/src/command_runner.dart
directives_ordering - 1 fix
lib/src/commands/update_command.dart
directives_ordering - 1 fix
test/src/command_runner_test.dart
directives_ordering - 1 fix
test/src/commands/sample_command_test.dart
directives_ordering - 1 fix
test/src/commands/update_command_test.dart
directives_ordering - 1 fix
5 fixes made in 5 files.
stderr:
β Running "dart fix --apply" in ./ttd_cli (1.8s)
Created a Very Good Dart CLI application! π¦
Alejandro Santiago commented
Thanks @yahu1031 for opening this issue!
I was able to reproduce this, I got:
very_good create dart_cli issue
β Generated 24 file(s) (68ms)
β Running "flutter pub get" in ./issue (3.0s)
β Running "dart fix --apply" in ./issue (1.6s)
Created a Very Good Dart CLI application! π¦
I believe you're correct, only dart pub get
should be needed.