-
Notifications
You must be signed in to change notification settings - Fork 4
feat: Integrate mason_logger for improved logging and user prompts #23
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Draft
Luckey-Elijah
wants to merge
20
commits into
flame-engine:main
Choose a base branch
from
Luckey-Elijah:feat/use-mason_logger
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Changes from 4 commits
Commits
Show all changes
20 commits
Select commit
Hold shift + click to select a range
b8ce152
feat: Integrate mason_logger for improved logging and user prompts
Luckey-Elijah 6927bb2
switch to more descriptive exit codes & logger
Luckey-Elijah c858e09
use logger in create and version command logs
Luckey-Elijah dc7ff3b
refactor: Change error logging to info level for command validation
Luckey-Elijah 667b18c
setup context
Luckey-Elijah 79ad1f8
simplifying
Luckey-Elijah 757ad4d
working
Luckey-Elijah e347f5e
fix up thiings?
Luckey-Elijah ef061f2
ninx rules
Luckey-Elijah 7dbf9b1
grammar
Luckey-Elijah ea21a7f
tidy up
Luckey-Elijah b12f3db
coment
Luckey-Elijah 541280b
remove unnessacry deps
Luckey-Elijah 2d1dbd6
tweaks with testing
Luckey-Elijah 427fef4
rename
Luckey-Elijah d291f10
scope run to just context
Luckey-Elijah 96a18db
it's all context
Luckey-Elijah 3237593
fix closing buffer for stdout and stdin
Luckey-Elijah 76d24c2
no show imports
Luckey-Elijah 5137bd4
null assert
Luckey-Elijah File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,7 +9,7 @@ import 'package:io/ansi.dart' as ansi; | |
import 'package:mason/mason.dart'; | ||
import 'package:process_run/process_run.dart'; | ||
|
||
Future<void> createCommand(ArgResults command) async { | ||
Future<void> createCommand(ArgResults command, Logger logger) async { | ||
final interactive = command['interactive'] != 'false'; | ||
|
||
if (interactive) { | ||
|
@@ -19,6 +19,7 @@ Future<void> createCommand(ArgResults command) async { | |
|
||
final name = getString( | ||
isInteractive: interactive, | ||
logger: logger, | ||
|
||
command, | ||
'name', | ||
'Choose a name for your project: ', | ||
|
@@ -34,6 +35,7 @@ Future<void> createCommand(ArgResults command) async { | |
); | ||
|
||
final org = getString( | ||
logger: logger, | ||
isInteractive: interactive, | ||
command, | ||
'org', | ||
|
@@ -51,6 +53,7 @@ Future<void> createCommand(ArgResults command) async { | |
final versions = FlameVersionManager.singleton.versions; | ||
final flameVersions = versions[Package.flame]!; | ||
final flameVersion = getOption( | ||
logger: logger, | ||
isInteractive: interactive, | ||
command, | ||
'flame-version', | ||
|
@@ -65,6 +68,7 @@ Future<void> createCommand(ArgResults command) async { | |
.map((key) => key.name) | ||
.toList(); | ||
final extraPackages = getMultiOption( | ||
logger: logger, | ||
isInteractive: interactive, | ||
isRequired: false, | ||
command, | ||
|
@@ -86,6 +90,7 @@ Future<void> createCommand(ArgResults command) async { | |
print('\nYour current directory is: $currentDir'); | ||
|
||
final createFolder = getOption( | ||
logger: logger, | ||
isInteractive: interactive, | ||
command, | ||
'create-folder', | ||
|
@@ -100,6 +105,7 @@ Future<void> createCommand(ArgResults command) async { | |
|
||
print('\n'); | ||
final template = getOption( | ||
logger: logger, | ||
isInteractive: interactive, | ||
command, | ||
'template', | ||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,11 +1,12 @@ | ||
import 'package:ignite_cli/version.g.dart'; | ||
import 'package:mason/mason.dart'; | ||
import 'package:process_run/process_run.dart'; | ||
|
||
Future<void> versionCommand() async { | ||
print(r'$ ignite --version:'); | ||
print(igniteVersion); | ||
print(''); | ||
Future<void> versionCommand(Logger logger) async { | ||
logger.detail(r'$ ignite --version:'); | ||
logger.detail(igniteVersion); | ||
logger.detail(''); | ||
await runExecutableArguments('dart', ['--version'], verbose: true); | ||
print(''); | ||
logger.detail(''); | ||
await runExecutableArguments('flutter', ['--version'], verbose: true); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
for a followup, I would envision we creating some class that wraps the ArgResults and Logger to pass around as a unit, and then the "utils" methods would live on this class as well
something like "CLI context", not sure what is a good name
but as I said - this is def a followup!