Skip to content
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

feat: Create the command dvm doctor #80

Merged
merged 21 commits into from
Apr 7, 2024
Merged

feat: Create the command dvm doctor #80

merged 21 commits into from
Apr 7, 2024

Conversation

blendthink
Copy link
Contributor

Overview

dvm doctor

Provides a comprehensive overview of the tool's version, configuration settings, and any potential issues with the setup.

Issues

Closes #7

- Add `gen/cli_info.dart` and local `cli_info.dart` for CLI info management in `app_container.dart`.
- Refactor `doctor_command_service.dart` to use `PackageVersionService` instead of `PackageService`, removing unused `SdkService`.
- Remove `package_service.dart` and its content, shifting functionality to `PackageVersionService`.
- Introduce `cli_info.dart` and `cli_info.g.dart` for local CLI information handling.
- Implement `package_version_status.dart` for detailed package version status management.
- Create `package_version_service.dart` and `package_version_service.g.dart`, incorporating the previously handled logic by `PackageService` for version checking.
- Introduce `GlobalConfigStatus` class to handle various global configuration states such as found, not found, and errors related to JSON formatting, parameter formatting, and unknown errors.
- Implement `checkGlobalConfig` method in `GlobalConfigService` to check for the existence of the global configuration file and parse it, returning the appropriate `GlobalConfigStatus`.
- Add `ProjectConfigStatus` class for detailed handling of project configuration states including found, not found, and various error scenarios.
- Implement `checkProjectConfig` method in `ProjectConfigService` to validate the presence and integrity of the project configuration file, returning an appropriate `ProjectConfigStatus`.
- Rename `checkVersion` to `checkPackageVersion` in `PackageVersionService` for clearer distinction of its functionality.
- Update hash in `doctor_command_service.g.dart` reflecting changes in dependencies.
- Adjust dependencies to include `packageVersionServiceProvider`, `globalConfigServiceProvider`, and `projectConfigServiceProvider`, ensuring alignment with service modifications.
- Implement checks for package version, global configuration, and project configuration within `DoctorCommandService`.
- Utilize `progress` from `ConsoleService` to indicate the beginning and completion of the checks.
- Create `CheckStatus` enum with values `success`, `warning`, and `error` to represent the outcome of various checks within the application.
- Extend `ConsoleService` to include a `checkResult` method, allowing for detailed reporting of check outcomes based on `CheckStatus`.
- Utilize color-coded tags to visually distinguish between success, warning, and error statuses in console outputs.
- Implement conditional detail printing for comprehensive feedback on check results.
- Add `toString` overrides to `GlobalConfig` and `ProjectConfig` classes for improved debuggability and logging, displaying the Dart SDK version.
@blendthink blendthink merged commit f0695e6 into main Apr 7, 2024
2 checks passed
@blendthink blendthink deleted the issues/7 branch April 7, 2024 09:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Create a command for showing info about dvm configuration
1 participant