From b8a0b71d34a91db05029a57d81b41e6e53a9a933 Mon Sep 17 00:00:00 2001 From: Innes Anderson-Morrison Date: Wed, 13 Nov 2024 13:11:33 +0000 Subject: [PATCH 1/2] refactor: updating the project structure for bootstrap --- .../integration_test/screenshot_test.dart | 2 +- apps/ubuntu_bootstrap/lib/{installer.dart => app.dart} | 8 ++++---- .../lib/{installer => app}/installation_step.dart | 0 .../lib/{installer => app}/installer_model.dart | 0 .../lib/{installer => app}/installer_wizard.dart | 4 ++-- apps/ubuntu_bootstrap/lib/main.dart | 2 +- .../lib/pages/autoinstall/autoinstall_model.dart | 2 +- apps/ubuntu_bootstrap/lib/pages/confirm/confirm_page.dart | 2 +- .../lib/pages/refresh/refresh_widgets.dart | 2 +- .../lib/pages/storage/storage_wizard.dart | 2 +- apps/ubuntu_bootstrap/lib/services/installer_service.dart | 2 +- apps/ubuntu_bootstrap/lib/ubuntu_bootstrap.dart | 2 +- apps/ubuntu_bootstrap/test/installer_model_test.dart | 2 +- apps/ubuntu_bootstrap/test/installer_test.dart | 2 +- apps/ubuntu_bootstrap/test/installer_wizard_test.dart | 4 ++-- .../test/source/not_enough_disk_space_test.dart | 2 +- apps/ubuntu_bootstrap/test/test_utils.dart | 2 +- 17 files changed, 20 insertions(+), 20 deletions(-) rename apps/ubuntu_bootstrap/lib/{installer.dart => app.dart} (97%) rename apps/ubuntu_bootstrap/lib/{installer => app}/installation_step.dart (100%) rename apps/ubuntu_bootstrap/lib/{installer => app}/installer_model.dart (100%) rename apps/ubuntu_bootstrap/lib/{installer => app}/installer_wizard.dart (97%) diff --git a/apps/ubuntu_bootstrap/integration_test/screenshot_test.dart b/apps/ubuntu_bootstrap/integration_test/screenshot_test.dart index fce3690d4..b90eb3c2e 100644 --- a/apps/ubuntu_bootstrap/integration_test/screenshot_test.dart +++ b/apps/ubuntu_bootstrap/integration_test/screenshot_test.dart @@ -4,7 +4,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:integration_test/integration_test.dart'; import 'package:subiquity_client/subiquity_client.dart'; import 'package:subiquity_test/subiquity_test.dart'; -import 'package:ubuntu_bootstrap/installer/installation_step.dart'; +import 'package:ubuntu_bootstrap/app/installation_step.dart'; import 'package:ubuntu_bootstrap/ubuntu_bootstrap.dart'; import 'package:ubuntu_provision/ubuntu_provision.dart'; import 'package:ubuntu_provision_test/ubuntu_provision_test.dart'; diff --git a/apps/ubuntu_bootstrap/lib/installer.dart b/apps/ubuntu_bootstrap/lib/app.dart similarity index 97% rename from apps/ubuntu_bootstrap/lib/installer.dart rename to apps/ubuntu_bootstrap/lib/app.dart index 7c1a76174..5079938f7 100644 --- a/apps/ubuntu_bootstrap/lib/installer.dart +++ b/apps/ubuntu_bootstrap/lib/app.dart @@ -11,9 +11,9 @@ import 'package:path/path.dart' as p; import 'package:subiquity_client/subiquity_client.dart'; import 'package:subiquity_client/subiquity_server.dart'; import 'package:timezone_map/timezone_map.dart'; -import 'package:ubuntu_bootstrap/installer/installation_step.dart'; -import 'package:ubuntu_bootstrap/installer/installer_model.dart'; -import 'package:ubuntu_bootstrap/installer/installer_wizard.dart'; +import 'package:ubuntu_bootstrap/app/installation_step.dart'; +import 'package:ubuntu_bootstrap/app/installer_model.dart'; +import 'package:ubuntu_bootstrap/app/installer_wizard.dart'; import 'package:ubuntu_bootstrap/l10n.dart'; import 'package:ubuntu_bootstrap/pages/loading/loading_page.dart'; import 'package:ubuntu_bootstrap/services.dart'; @@ -24,7 +24,7 @@ import 'package:ubuntu_utils/ubuntu_utils.dart'; import 'package:ubuntu_wizard/ubuntu_wizard.dart'; import 'package:yaru/yaru.dart'; -export 'installer/installer_wizard.dart'; +export 'app/installer_wizard.dart'; Future runInstallerApp( List args, { diff --git a/apps/ubuntu_bootstrap/lib/installer/installation_step.dart b/apps/ubuntu_bootstrap/lib/app/installation_step.dart similarity index 100% rename from apps/ubuntu_bootstrap/lib/installer/installation_step.dart rename to apps/ubuntu_bootstrap/lib/app/installation_step.dart diff --git a/apps/ubuntu_bootstrap/lib/installer/installer_model.dart b/apps/ubuntu_bootstrap/lib/app/installer_model.dart similarity index 100% rename from apps/ubuntu_bootstrap/lib/installer/installer_model.dart rename to apps/ubuntu_bootstrap/lib/app/installer_model.dart diff --git a/apps/ubuntu_bootstrap/lib/installer/installer_wizard.dart b/apps/ubuntu_bootstrap/lib/app/installer_wizard.dart similarity index 97% rename from apps/ubuntu_bootstrap/lib/installer/installer_wizard.dart rename to apps/ubuntu_bootstrap/lib/app/installer_wizard.dart index 30532aeb9..9e14885c1 100644 --- a/apps/ubuntu_bootstrap/lib/installer/installer_wizard.dart +++ b/apps/ubuntu_bootstrap/lib/app/installer_wizard.dart @@ -1,8 +1,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:subiquity_client/subiquity_client.dart'; -import 'package:ubuntu_bootstrap/installer/installation_step.dart'; -import 'package:ubuntu_bootstrap/installer/installer_model.dart'; +import 'package:ubuntu_bootstrap/app/installation_step.dart'; +import 'package:ubuntu_bootstrap/app/installer_model.dart'; import 'package:ubuntu_bootstrap/pages.dart'; import 'package:ubuntu_bootstrap/services.dart'; import 'package:ubuntu_provision/ubuntu_provision.dart'; diff --git a/apps/ubuntu_bootstrap/lib/main.dart b/apps/ubuntu_bootstrap/lib/main.dart index acef1bf5d..6176d296c 100644 --- a/apps/ubuntu_bootstrap/lib/main.dart +++ b/apps/ubuntu_bootstrap/lib/main.dart @@ -1,3 +1,3 @@ -import 'package:ubuntu_bootstrap/installer.dart'; +import 'package:ubuntu_bootstrap/app.dart'; Future main(List args) => runInstallerApp(args); diff --git a/apps/ubuntu_bootstrap/lib/pages/autoinstall/autoinstall_model.dart b/apps/ubuntu_bootstrap/lib/pages/autoinstall/autoinstall_model.dart index d81319c9d..f0260e5ce 100644 --- a/apps/ubuntu_bootstrap/lib/pages/autoinstall/autoinstall_model.dart +++ b/apps/ubuntu_bootstrap/lib/pages/autoinstall/autoinstall_model.dart @@ -10,7 +10,7 @@ import 'package:path/path.dart' as p; import 'package:safe_change_notifier/safe_change_notifier.dart'; import 'package:subiquity_client/subiquity_client.dart'; import 'package:subiquity_client/subiquity_server.dart'; -import 'package:ubuntu_bootstrap/installer/installer_model.dart'; +import 'package:ubuntu_bootstrap/app/installer_model.dart'; import 'package:ubuntu_bootstrap/pages/loading/loading_provider.dart'; import 'package:ubuntu_bootstrap/ubuntu_bootstrap.dart'; import 'package:ubuntu_logger/ubuntu_logger.dart'; diff --git a/apps/ubuntu_bootstrap/lib/pages/confirm/confirm_page.dart b/apps/ubuntu_bootstrap/lib/pages/confirm/confirm_page.dart index 38b1e8d74..b778b8c05 100644 --- a/apps/ubuntu_bootstrap/lib/pages/confirm/confirm_page.dart +++ b/apps/ubuntu_bootstrap/lib/pages/confirm/confirm_page.dart @@ -3,7 +3,7 @@ import 'package:flutter/material.dart'; import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:subiquity_client/subiquity_client.dart'; -import 'package:ubuntu_bootstrap/installer/installer_model.dart'; +import 'package:ubuntu_bootstrap/app/installer_model.dart'; import 'package:ubuntu_bootstrap/l10n.dart'; import 'package:ubuntu_bootstrap/pages/autoinstall/autoinstall_model.dart'; import 'package:ubuntu_bootstrap/pages/confirm/confirm_model.dart'; diff --git a/apps/ubuntu_bootstrap/lib/pages/refresh/refresh_widgets.dart b/apps/ubuntu_bootstrap/lib/pages/refresh/refresh_widgets.dart index a3fd90b01..07ccadc61 100644 --- a/apps/ubuntu_bootstrap/lib/pages/refresh/refresh_widgets.dart +++ b/apps/ubuntu_bootstrap/lib/pages/refresh/refresh_widgets.dart @@ -3,7 +3,7 @@ import 'dart:io'; import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:path/path.dart' as p; -import 'package:ubuntu_bootstrap/installer/installation_step.dart'; +import 'package:ubuntu_bootstrap/app/installation_step.dart'; import 'package:ubuntu_bootstrap/l10n.dart'; import 'package:ubuntu_bootstrap/pages/refresh/refresh_l10n.dart'; import 'package:ubuntu_bootstrap/pages/refresh/refresh_model.dart'; diff --git a/apps/ubuntu_bootstrap/lib/pages/storage/storage_wizard.dart b/apps/ubuntu_bootstrap/lib/pages/storage/storage_wizard.dart index b38ccc95b..9407d1c77 100644 --- a/apps/ubuntu_bootstrap/lib/pages/storage/storage_wizard.dart +++ b/apps/ubuntu_bootstrap/lib/pages/storage/storage_wizard.dart @@ -1,6 +1,6 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; -import 'package:ubuntu_bootstrap/installer/installation_step.dart'; +import 'package:ubuntu_bootstrap/app/installation_step.dart'; import 'package:ubuntu_bootstrap/pages/storage/bitlocker/bitlocker_page.dart'; import 'package:ubuntu_bootstrap/pages/storage/guided_reformat/guided_reformat_page.dart'; import 'package:ubuntu_bootstrap/pages/storage/guided_resize/guided_resize_page.dart'; diff --git a/apps/ubuntu_bootstrap/lib/services/installer_service.dart b/apps/ubuntu_bootstrap/lib/services/installer_service.dart index a150a1a08..00d439a28 100644 --- a/apps/ubuntu_bootstrap/lib/services/installer_service.dart +++ b/apps/ubuntu_bootstrap/lib/services/installer_service.dart @@ -1,6 +1,6 @@ import 'package:collection/collection.dart'; import 'package:subiquity_client/subiquity_client.dart'; -import 'package:ubuntu_bootstrap/installer/installation_step.dart'; +import 'package:ubuntu_bootstrap/app/installation_step.dart'; import 'package:ubuntu_logger/ubuntu_logger.dart'; import 'package:ubuntu_provision/services.dart'; diff --git a/apps/ubuntu_bootstrap/lib/ubuntu_bootstrap.dart b/apps/ubuntu_bootstrap/lib/ubuntu_bootstrap.dart index ad45dd97d..600889727 100644 --- a/apps/ubuntu_bootstrap/lib/ubuntu_bootstrap.dart +++ b/apps/ubuntu_bootstrap/lib/ubuntu_bootstrap.dart @@ -1,6 +1,6 @@ library ubuntu_bootstrap; -export 'installer.dart'; +export 'app.dart'; export 'l10n.dart'; export 'pages.dart'; export 'services.dart'; diff --git a/apps/ubuntu_bootstrap/test/installer_model_test.dart b/apps/ubuntu_bootstrap/test/installer_model_test.dart index 5ab3b0df9..e477dfbf8 100644 --- a/apps/ubuntu_bootstrap/test/installer_model_test.dart +++ b/apps/ubuntu_bootstrap/test/installer_model_test.dart @@ -5,7 +5,7 @@ import 'dart:async'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import 'package:subiquity_client/subiquity_client.dart'; -import 'package:ubuntu_bootstrap/installer/installer_model.dart'; +import 'package:ubuntu_bootstrap/app/installer_model.dart'; import 'test_utils.dart'; diff --git a/apps/ubuntu_bootstrap/test/installer_test.dart b/apps/ubuntu_bootstrap/test/installer_test.dart index ffd8a6414..e70643d06 100644 --- a/apps/ubuntu_bootstrap/test/installer_test.dart +++ b/apps/ubuntu_bootstrap/test/installer_test.dart @@ -5,7 +5,7 @@ import 'package:mockito/mockito.dart'; import 'package:subiquity_client/subiquity_client.dart'; import 'package:subiquity_client/subiquity_server.dart'; import 'package:subiquity_test/subiquity_test.dart'; -import 'package:ubuntu_bootstrap/installer.dart'; +import 'package:ubuntu_bootstrap/app.dart'; import 'package:ubuntu_bootstrap/l10n.dart'; import 'package:ubuntu_bootstrap/pages.dart'; import 'package:ubuntu_bootstrap/pages/autoinstall/autoinstall_model.dart'; diff --git a/apps/ubuntu_bootstrap/test/installer_wizard_test.dart b/apps/ubuntu_bootstrap/test/installer_wizard_test.dart index c8c5f6453..d9589fc0a 100644 --- a/apps/ubuntu_bootstrap/test/installer_wizard_test.dart +++ b/apps/ubuntu_bootstrap/test/installer_wizard_test.dart @@ -7,8 +7,8 @@ import 'package:mockito/mockito.dart'; import 'package:subiquity_client/subiquity_client.dart'; import 'package:subiquity_test/subiquity_test.dart'; import 'package:timezone_map/timezone_map.dart'; -import 'package:ubuntu_bootstrap/installer.dart'; -import 'package:ubuntu_bootstrap/installer/installation_step.dart'; +import 'package:ubuntu_bootstrap/app.dart'; +import 'package:ubuntu_bootstrap/app/installation_step.dart'; import 'package:ubuntu_bootstrap/l10n.dart'; import 'package:ubuntu_bootstrap/pages.dart'; import 'package:ubuntu_bootstrap/pages/autoinstall/autoinstall_model.dart'; diff --git a/apps/ubuntu_bootstrap/test/source/not_enough_disk_space_test.dart b/apps/ubuntu_bootstrap/test/source/not_enough_disk_space_test.dart index 2ddae8532..cba492425 100644 --- a/apps/ubuntu_bootstrap/test/source/not_enough_disk_space_test.dart +++ b/apps/ubuntu_bootstrap/test/source/not_enough_disk_space_test.dart @@ -4,7 +4,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; import 'package:subiquity_client/subiquity_client.dart'; import 'package:subiquity_test/subiquity_test.dart'; -import 'package:ubuntu_bootstrap/installer/installation_step.dart'; +import 'package:ubuntu_bootstrap/app/installation_step.dart'; import 'package:ubuntu_bootstrap/l10n.dart'; import 'package:ubuntu_bootstrap/pages.dart'; import 'package:ubuntu_bootstrap/services.dart'; diff --git a/apps/ubuntu_bootstrap/test/test_utils.dart b/apps/ubuntu_bootstrap/test/test_utils.dart index 8103f020f..329671fb4 100644 --- a/apps/ubuntu_bootstrap/test/test_utils.dart +++ b/apps/ubuntu_bootstrap/test/test_utils.dart @@ -3,7 +3,7 @@ import 'package:flutter_test/flutter_test.dart'; import 'package:gsettings/gsettings.dart'; import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; -import 'package:ubuntu_bootstrap/installer/installation_step.dart'; +import 'package:ubuntu_bootstrap/app/installation_step.dart'; import 'package:ubuntu_bootstrap/l10n.dart'; import 'package:ubuntu_bootstrap/services.dart'; import 'package:ubuntu_provision/ubuntu_provision.dart'; From b26ae74472332d8d119f388597ec53f14ff6be12 Mon Sep 17 00:00:00 2001 From: Innes Anderson-Morrison Date: Wed, 13 Nov 2024 14:05:12 +0000 Subject: [PATCH 2/2] refactor: moving slides to providers --- apps/ubuntu_bootstrap/lib/pages/install/install_page.dart | 2 +- .../lib/{slides => providers}/slide_html.dart | 0 .../lib/{slides => providers}/slides_provider.dart | 2 +- apps/ubuntu_bootstrap/test/install/slide_html_test.dart | 2 +- apps/ubuntu_bootstrap/test/install/test_install.dart | 4 ++-- apps/ubuntu_bootstrap/test/installer_test.dart | 2 +- apps/ubuntu_bootstrap/test/installer_wizard_test.dart | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) rename apps/ubuntu_bootstrap/lib/{slides => providers}/slide_html.dart (100%) rename apps/ubuntu_bootstrap/lib/{slides => providers}/slides_provider.dart (98%) diff --git a/apps/ubuntu_bootstrap/lib/pages/install/install_page.dart b/apps/ubuntu_bootstrap/lib/pages/install/install_page.dart index b0e2c4940..62a00e79a 100644 --- a/apps/ubuntu_bootstrap/lib/pages/install/install_page.dart +++ b/apps/ubuntu_bootstrap/lib/pages/install/install_page.dart @@ -7,7 +7,7 @@ import 'package:ubuntu_bootstrap/pages/install/bottom_bar.dart'; import 'package:ubuntu_bootstrap/pages/install/done_page.dart'; import 'package:ubuntu_bootstrap/pages/install/install_model.dart'; import 'package:ubuntu_bootstrap/pages/install/slide_view.dart'; -import 'package:ubuntu_bootstrap/slides/slides_provider.dart'; +import 'package:ubuntu_bootstrap/providers/slides_provider.dart'; import 'package:ubuntu_provision/ubuntu_provision.dart'; import 'package:ubuntu_wizard/ubuntu_wizard.dart'; import 'package:yaru/yaru.dart'; diff --git a/apps/ubuntu_bootstrap/lib/slides/slide_html.dart b/apps/ubuntu_bootstrap/lib/providers/slide_html.dart similarity index 100% rename from apps/ubuntu_bootstrap/lib/slides/slide_html.dart rename to apps/ubuntu_bootstrap/lib/providers/slide_html.dart diff --git a/apps/ubuntu_bootstrap/lib/slides/slides_provider.dart b/apps/ubuntu_bootstrap/lib/providers/slides_provider.dart similarity index 98% rename from apps/ubuntu_bootstrap/lib/slides/slides_provider.dart rename to apps/ubuntu_bootstrap/lib/providers/slides_provider.dart index 4d97ae627..90599ba40 100644 --- a/apps/ubuntu_bootstrap/lib/slides/slides_provider.dart +++ b/apps/ubuntu_bootstrap/lib/providers/slides_provider.dart @@ -8,7 +8,7 @@ import 'package:html/parser.dart' show parse; import 'package:intl/intl.dart' hide TextDirection; import 'package:intl/intl_standalone.dart'; import 'package:path/path.dart' as path; -import 'package:ubuntu_bootstrap/slides/slide_html.dart'; +import 'package:ubuntu_bootstrap/providers/slide_html.dart'; import 'package:ubuntu_logger/ubuntu_logger.dart'; import 'package:ubuntu_provision/ubuntu_provision.dart'; diff --git a/apps/ubuntu_bootstrap/test/install/slide_html_test.dart b/apps/ubuntu_bootstrap/test/install/slide_html_test.dart index b62810d1c..8fd5074c2 100644 --- a/apps/ubuntu_bootstrap/test/install/slide_html_test.dart +++ b/apps/ubuntu_bootstrap/test/install/slide_html_test.dart @@ -2,8 +2,8 @@ import 'package:flutter/material.dart'; import 'package:flutter_riverpod/flutter_riverpod.dart'; import 'package:flutter_test/flutter_test.dart'; import 'package:mockito/mockito.dart'; +import 'package:ubuntu_bootstrap/providers/slide_html.dart'; import 'package:ubuntu_bootstrap/services.dart'; -import 'package:ubuntu_bootstrap/slides/slide_html.dart'; import 'package:ubuntu_test/ubuntu_test.dart'; import 'package:ubuntu_utils/ubuntu_utils.dart'; diff --git a/apps/ubuntu_bootstrap/test/install/test_install.dart b/apps/ubuntu_bootstrap/test/install/test_install.dart index f8d2ee8e5..56edf70d5 100644 --- a/apps/ubuntu_bootstrap/test/install/test_install.dart +++ b/apps/ubuntu_bootstrap/test/install/test_install.dart @@ -6,8 +6,8 @@ import 'package:mockito/annotations.dart'; import 'package:mockito/mockito.dart'; import 'package:ubuntu_bootstrap/pages/install/install_model.dart'; import 'package:ubuntu_bootstrap/pages/install/install_page.dart'; -import 'package:ubuntu_bootstrap/slides/slide_html.dart'; -import 'package:ubuntu_bootstrap/slides/slides_provider.dart'; +import 'package:ubuntu_bootstrap/providers/slide_html.dart'; +import 'package:ubuntu_bootstrap/providers/slides_provider.dart'; import 'package:ubuntu_provision/providers.dart'; import 'package:ubuntu_provision/services.dart'; diff --git a/apps/ubuntu_bootstrap/test/installer_test.dart b/apps/ubuntu_bootstrap/test/installer_test.dart index e70643d06..277e4a392 100644 --- a/apps/ubuntu_bootstrap/test/installer_test.dart +++ b/apps/ubuntu_bootstrap/test/installer_test.dart @@ -9,8 +9,8 @@ import 'package:ubuntu_bootstrap/app.dart'; import 'package:ubuntu_bootstrap/l10n.dart'; import 'package:ubuntu_bootstrap/pages.dart'; import 'package:ubuntu_bootstrap/pages/autoinstall/autoinstall_model.dart'; +import 'package:ubuntu_bootstrap/providers/slides_provider.dart'; import 'package:ubuntu_bootstrap/services.dart'; -import 'package:ubuntu_bootstrap/slides/slides_provider.dart'; import 'package:ubuntu_provision/ubuntu_provision.dart'; import 'package:ubuntu_wizard/ubuntu_wizard.dart'; import 'package:yaru_test/yaru_test.dart'; diff --git a/apps/ubuntu_bootstrap/test/installer_wizard_test.dart b/apps/ubuntu_bootstrap/test/installer_wizard_test.dart index d9589fc0a..9f780d423 100644 --- a/apps/ubuntu_bootstrap/test/installer_wizard_test.dart +++ b/apps/ubuntu_bootstrap/test/installer_wizard_test.dart @@ -26,8 +26,8 @@ import 'package:ubuntu_bootstrap/pages/storage/passphrase/passphrase_model.dart' import 'package:ubuntu_bootstrap/pages/storage/recovery_key/recovery_key_model.dart'; import 'package:ubuntu_bootstrap/pages/storage/storage_model.dart'; import 'package:ubuntu_bootstrap/pages/try_or_install/try_or_install_model.dart'; +import 'package:ubuntu_bootstrap/providers/slides_provider.dart'; import 'package:ubuntu_bootstrap/services.dart'; -import 'package:ubuntu_bootstrap/slides/slides_provider.dart'; import 'package:ubuntu_provision/ubuntu_provision.dart'; import 'package:ubuntu_test/ubuntu_test.dart'; import 'package:ubuntu_wizard/ubuntu_wizard.dart';