kasy-cli 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +56 -0
- package/bin/kasy.js +529 -0
- package/docs/cli-reference.md +251 -0
- package/lib/commands/add.js +777 -0
- package/lib/commands/check.js +240 -0
- package/lib/commands/codemagic.js +161 -0
- package/lib/commands/deploy.js +257 -0
- package/lib/commands/docs.js +47 -0
- package/lib/commands/doctor.js +227 -0
- package/lib/commands/features.js +36 -0
- package/lib/commands/ios.js +206 -0
- package/lib/commands/new.js +1870 -0
- package/lib/commands/notifications.js +207 -0
- package/lib/commands/remove.js +466 -0
- package/lib/commands/run.js +75 -0
- package/lib/commands/update.js +382 -0
- package/lib/commands/validate.js +131 -0
- package/lib/scaffold/CHANGELOG.json +6 -0
- package/lib/scaffold/backends/api/.flutter-plugins-dependencies +1 -0
- package/lib/scaffold/backends/api/analysis_options.yaml +5 -0
- package/lib/scaffold/backends/api/generator.js +76 -0
- package/lib/scaffold/backends/api/patch/README.md +85 -0
- package/lib/scaffold/backends/api/patch/android/app/src/main/AndroidManifest.xml +87 -0
- package/lib/scaffold/backends/api/patch/ios/Runner/AppDelegate.swift +61 -0
- package/lib/scaffold/backends/api/patch/lib/core/data/api/meta_ads_api.dart +80 -0
- package/lib/scaffold/backends/api/patch/lib/core/data/api/storage_api.dart +117 -0
- package/lib/scaffold/backends/api/patch/lib/core/data/api/user_api.dart +148 -0
- package/lib/scaffold/backends/api/patch/lib/core/data/entities/json_converters.dart +35 -0
- package/lib/scaffold/backends/api/patch/lib/core/data/entities/user_entity.dart +48 -0
- package/lib/scaffold/backends/api/patch/lib/core/rating/widgets/review_popup.dart +211 -0
- package/lib/scaffold/backends/api/patch/lib/environnements.dart +151 -0
- package/lib/scaffold/backends/api/patch/lib/features/authentication/api/authentication_api.dart +303 -0
- package/lib/scaffold/backends/api/patch/lib/features/authentication/api/authentication_api_interface.dart +80 -0
- package/lib/scaffold/backends/api/patch/lib/features/authentication/repositories/authentication_repository.dart +406 -0
- package/lib/scaffold/backends/api/patch/lib/features/camera/xfile_extension.dart +6 -0
- package/lib/scaffold/backends/api/patch/lib/features/feedbacks/api/entities/feature_request_entity.dart +24 -0
- package/lib/scaffold/backends/api/patch/lib/features/feedbacks/api/entities/feature_vote_entity.dart +21 -0
- package/lib/scaffold/backends/api/patch/lib/features/feedbacks/api/feature_request_api.dart +52 -0
- package/lib/scaffold/backends/api/patch/lib/features/feedbacks/api/feature_vote_api.dart +60 -0
- package/lib/scaffold/backends/api/patch/lib/features/llm_chat/api/llm_chat_api.dart +58 -0
- package/lib/scaffold/backends/api/patch/lib/features/llm_chat/api/llm_chat_message_entity.dart +29 -0
- package/lib/scaffold/backends/api/patch/lib/features/notifications/api/device_api.dart +398 -0
- package/lib/scaffold/backends/api/patch/lib/features/notifications/api/entities/device_entity.dart +39 -0
- package/lib/scaffold/backends/api/patch/lib/features/notifications/api/entities/notifications_entity.dart +23 -0
- package/lib/scaffold/backends/api/patch/lib/features/notifications/api/notifications_api.dart +333 -0
- package/lib/scaffold/backends/api/patch/lib/features/notifications/providers/models/notification.dart +185 -0
- package/lib/scaffold/backends/api/patch/lib/features/onboarding/api/entities/user_info_entity.dart +26 -0
- package/lib/scaffold/backends/api/patch/lib/features/onboarding/api/user_infos_api.dart +107 -0
- package/lib/scaffold/backends/api/patch/lib/features/onboarding/models/user_info.dart +94 -0
- package/lib/scaffold/backends/api/patch/lib/features/onboarding/repositories/user_infos_repository.dart +29 -0
- package/lib/scaffold/backends/api/patch/lib/features/onboarding/ui/animations/movefade_anim.dart +34 -0
- package/lib/scaffold/backends/api/patch/lib/features/onboarding/ui/components/onboarding_att_setup.dart +66 -0
- package/lib/scaffold/backends/api/patch/lib/features/onboarding/ui/components/onboarding_notifications_setup.dart +73 -0
- package/lib/scaffold/backends/api/patch/lib/features/onboarding/ui/widgets/onboarding_radio_question.dart +173 -0
- package/lib/scaffold/backends/api/patch/lib/features/settings/ui/widgets/avatar_utils.dart +33 -0
- package/lib/scaffold/backends/api/patch/lib/features/subscription/api/entities/subscription_entity.dart +34 -0
- package/lib/scaffold/backends/api/patch/lib/features/subscription/api/subscription_api.dart +49 -0
- package/lib/scaffold/backends/api/patch/lib/features/subscription/shared/maybeshow_premium.dart +88 -0
- package/lib/scaffold/backends/api/patch/lib/main.dart +256 -0
- package/lib/scaffold/backends/api/patch/lib/router.dart +133 -0
- package/lib/scaffold/backends/api/pubspec.yaml.tpl +108 -0
- package/lib/scaffold/backends/firebase/deploy.js +1006 -0
- package/lib/scaffold/backends/firebase/generator.js +24 -0
- package/lib/scaffold/backends/firebase/setup-from-scratch.js +1008 -0
- package/lib/scaffold/backends/firebase/tokens.js +113 -0
- package/lib/scaffold/backends/supabase/.flutter-plugins-dependencies +1 -0
- package/lib/scaffold/backends/supabase/analysis_options.yaml +5 -0
- package/lib/scaffold/backends/supabase/config.toml +34 -0
- package/lib/scaffold/backends/supabase/deploy.js +485 -0
- package/lib/scaffold/backends/supabase/edge-functions/delete-user-account/README.md +15 -0
- package/lib/scaffold/backends/supabase/edge-functions/delete-user-account/index.ts +97 -0
- package/lib/scaffold/backends/supabase/edge-functions/llm-chat/index.ts +156 -0
- package/lib/scaffold/backends/supabase/edge-functions/meta-track-event/index.ts +292 -0
- package/lib/scaffold/backends/supabase/edge-functions/revenuecat-webhook/README.md +30 -0
- package/lib/scaffold/backends/supabase/edge-functions/revenuecat-webhook/index.ts +488 -0
- package/lib/scaffold/backends/supabase/edge-functions/send-push-notification/README.md +35 -0
- package/lib/scaffold/backends/supabase/edge-functions/send-push-notification/index.ts +314 -0
- package/lib/scaffold/backends/supabase/generator.js +108 -0
- package/lib/scaffold/backends/supabase/migrations/20240101000001_initial_schema.sql +149 -0
- package/lib/scaffold/backends/supabase/migrations/20240101000002_storage_bucket.sql +40 -0
- package/lib/scaffold/backends/supabase/migrations/20240101000005_vote_triggers.sql +34 -0
- package/lib/scaffold/backends/supabase/migrations/20240101000006_notification_webhook.sql +36 -0
- package/lib/scaffold/backends/supabase/migrations/20240101000007_welcome_notification.sql +64 -0
- package/lib/scaffold/backends/supabase/migrations/20240101000008_user_feature_requests.sql +2 -0
- package/lib/scaffold/backends/supabase/migrations/20240101000009_llm_messages.sql +22 -0
- package/lib/scaffold/backends/supabase/migrations/20240101000010_notification_image.sql +2 -0
- package/lib/scaffold/backends/supabase/patch/README.md +121 -0
- package/lib/scaffold/backends/supabase/patch/android/app/src/main/AndroidManifest.xml +87 -0
- package/lib/scaffold/backends/supabase/patch/ios/Runner/AppDelegate.swift +61 -0
- package/lib/scaffold/backends/supabase/patch/lib/core/data/api/meta_ads_api.dart +75 -0
- package/lib/scaffold/backends/supabase/patch/lib/core/data/api/storage_api.dart +83 -0
- package/lib/scaffold/backends/supabase/patch/lib/core/data/api/user_api.dart +143 -0
- package/lib/scaffold/backends/supabase/patch/lib/core/data/entities/json_converters.dart +35 -0
- package/lib/scaffold/backends/supabase/patch/lib/core/data/entities/user_entity.dart +48 -0
- package/lib/scaffold/backends/supabase/patch/lib/core/rating/widgets/review_popup.dart +211 -0
- package/lib/scaffold/backends/supabase/patch/lib/environnements.dart +149 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/authentication/api/authentication_api.dart +546 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/authentication/repositories/authentication_repository.dart +410 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/camera/xfile_extension.dart +6 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/feedbacks/api/entities/feature_request_entity.dart +25 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/feedbacks/api/entities/feature_vote_entity.dart +21 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/feedbacks/api/feature_request_api.dart +59 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/feedbacks/api/feature_vote_api.dart +85 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/feedbacks/ui/component/add_feature_form.dart +199 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/llm_chat/api/llm_chat_api.dart +47 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/llm_chat/api/llm_chat_message_entity.dart +30 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/llm_chat/providers/llm_chat_notifier.dart +266 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/notifications/api/device_api.dart +410 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/notifications/api/entities/device_entity.dart +51 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/notifications/api/entities/notifications_entity.dart +26 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/notifications/api/notifications_api.dart +317 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/notifications/providers/models/notification.dart +174 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/onboarding/api/entities/user_info_entity.dart +26 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/onboarding/api/user_infos_api.dart +90 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/onboarding/models/user_info.dart +94 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/onboarding/repositories/user_infos_repository.dart +29 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/onboarding/ui/animations/movefade_anim.dart +34 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/onboarding/ui/components/onboarding_att_setup.dart +66 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/onboarding/ui/components/onboarding_notifications_setup.dart +73 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/onboarding/ui/widgets/onboarding_radio_question.dart +173 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/settings/ui/widgets/avatar_utils.dart +35 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/subscription/api/entities/subscription_entity.dart +35 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/subscription/api/subscription_api.dart +44 -0
- package/lib/scaffold/backends/supabase/patch/lib/features/subscription/shared/maybeshow_premium.dart +85 -0
- package/lib/scaffold/backends/supabase/patch/lib/google_auth_options.dart +23 -0
- package/lib/scaffold/backends/supabase/patch/lib/main.dart +288 -0
- package/lib/scaffold/backends/supabase/patch/lib/router.dart +133 -0
- package/lib/scaffold/backends/supabase/pubspec.yaml.tpl +110 -0
- package/lib/scaffold/backends/supabase/tokens.js +9 -0
- package/lib/scaffold/catalog.js +177 -0
- package/lib/scaffold/engine.js +230 -0
- package/lib/scaffold/features/README.md +152 -0
- package/lib/scaffold/features/analytics/lib/core/data/api/analytics_api.dart +124 -0
- package/lib/scaffold/features/ci/.github/ISSUE_TEMPLATE/BUG.es.md +35 -0
- package/lib/scaffold/features/ci/.github/ISSUE_TEMPLATE/BUG.md +35 -0
- package/lib/scaffold/features/ci/.github/ISSUE_TEMPLATE/BUG.pt.md +35 -0
- package/lib/scaffold/features/ci/.github/ISSUE_TEMPLATE/feature_request.es.md +12 -0
- package/lib/scaffold/features/ci/.github/ISSUE_TEMPLATE/feature_request.md +12 -0
- package/lib/scaffold/features/ci/.github/ISSUE_TEMPLATE/feature_request.pt.md +12 -0
- package/lib/scaffold/features/ci/.github/PULL_REQUEST_TEMPLATE.es.md +17 -0
- package/lib/scaffold/features/ci/.github/PULL_REQUEST_TEMPLATE.md +17 -0
- package/lib/scaffold/features/ci/.github/PULL_REQUEST_TEMPLATE.pt.md +17 -0
- package/lib/scaffold/features/ci/.github/dependabot.yml +16 -0
- package/lib/scaffold/features/ci/.github/workflows/app.yml +20 -0
- package/lib/scaffold/features/ci/.gitlab/templates/deploy.yaml +14 -0
- package/lib/scaffold/features/ci/.gitlab/templates/dropbox.yaml +19 -0
- package/lib/scaffold/features/ci/.gitlab/templates/flutter.yaml +163 -0
- package/lib/scaffold/features/ci/.gitlab/templates/mailgun.yaml +28 -0
- package/lib/scaffold/features/ci/.gitlab-ci.yml +37 -0
- package/lib/scaffold/features/ci/codemagic.yaml +157 -0
- package/lib/scaffold/features/facebook/lib/core/data/api/tracking_api.dart +111 -0
- package/lib/scaffold/features/feedback/lib/features/feedbacks/api/entities/feature_request_entity.dart +27 -0
- package/lib/scaffold/features/feedback/lib/features/feedbacks/api/entities/feature_vote_entity.dart +27 -0
- package/lib/scaffold/features/feedback/lib/features/feedbacks/api/feature_request_api.dart +50 -0
- package/lib/scaffold/features/feedback/lib/features/feedbacks/api/feature_vote_api.dart +79 -0
- package/lib/scaffold/features/feedback/lib/features/feedbacks/models/feature_requests.dart +48 -0
- package/lib/scaffold/features/feedback/lib/features/feedbacks/models/feedback_state.dart +42 -0
- package/lib/scaffold/features/feedback/lib/features/feedbacks/providers/feedback_page_notifier.dart +147 -0
- package/lib/scaffold/features/feedback/lib/features/feedbacks/repositories/feature_request_repository.dart +95 -0
- package/lib/scaffold/features/feedback/lib/features/feedbacks/ui/component/add_feature_form.dart +199 -0
- package/lib/scaffold/features/feedback/lib/features/feedbacks/ui/feedback_page.dart +175 -0
- package/lib/scaffold/features/feedback/lib/features/feedbacks/ui/widgets/add_feature_button.dart +76 -0
- package/lib/scaffold/features/feedback/lib/features/feedbacks/ui/widgets/feature_card.dart +279 -0
- package/lib/scaffold/features/ios-release/.kasy/apple.env.example +8 -0
- package/lib/scaffold/features/ios-release/.kasy/codemagic.env.example +7 -0
- package/lib/scaffold/features/ios-release/docs/codemagic-release.en.md +50 -0
- package/lib/scaffold/features/ios-release/docs/codemagic-release.es.md +50 -0
- package/lib/scaffold/features/ios-release/docs/codemagic-release.pt.md +50 -0
- package/lib/scaffold/features/ios-release/docs/ios-release.en.md +41 -0
- package/lib/scaffold/features/ios-release/docs/ios-release.es.md +41 -0
- package/lib/scaffold/features/ios-release/docs/ios-release.pt.md +41 -0
- package/lib/scaffold/features/ios-release/scripts/bump-ios-version.js +38 -0
- package/lib/scaffold/features/ios-release/scripts/release-ios.sh +137 -0
- package/lib/scaffold/features/llm_chat/lib/features/llm_chat/llm_chat_page.dart +301 -0
- package/lib/scaffold/features/local_notifications/lib/features/local_reminder/providers/reminder_notifier.dart +81 -0
- package/lib/scaffold/features/local_notifications/lib/features/local_reminder/repositories/reminder_preferences.dart +76 -0
- package/lib/scaffold/features/local_notifications/lib/features/local_reminder/ui/reminder_page.dart +282 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/api/entities/user_info_entity.dart +24 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/api/user_infos_api.dart +71 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/models/user_info.dart +92 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/providers/onboarding_model.dart +15 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/providers/onboarding_provider.dart +78 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/repositories/user_infos_repository.dart +29 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/ui/animations/page_transitions.dart +30 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/ui/components/onboarding_att_setup.dart +66 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/ui/components/onboarding_features.dart +72 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/ui/components/onboarding_loader.dart +92 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/ui/components/onboarding_notifications_setup.dart +73 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/ui/components/onboarding_questions.dart +89 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/ui/onboarding_page.dart +94 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/ui/widgets/onboarding_background.dart +80 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/ui/widgets/onboarding_feature.dart +139 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/ui/widgets/onboarding_illustration_scaffold.dart +110 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/ui/widgets/onboarding_progress.dart +84 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/ui/widgets/onboarding_radio_question.dart +173 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/ui/widgets/onboarding_reassurance.dart +45 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/ui/widgets/onboarding_sticky_footer.dart +77 -0
- package/lib/scaffold/features/onboarding/lib/features/onboarding/ui/widgets/selectable_row_tile.dart +392 -0
- package/lib/scaffold/features/revenuecat/lib/core/data/api/tracking_api.dart +116 -0
- package/lib/scaffold/features/revenuecat/lib/core/data/models/subscription.dart +322 -0
- package/lib/scaffold/features/revenuecat/lib/core/home_widgets/home_widget_background_task.dart +41 -0
- package/lib/scaffold/features/revenuecat/lib/core/states/user_state_notifier.dart +305 -0
- package/lib/scaffold/features/widget/lib/core/home_widgets/home_widget_background_task.dart +41 -0
- package/lib/scaffold/features/widget/lib/core/home_widgets/home_widget_mywidget_service.dart +57 -0
- package/lib/scaffold/features/widget/lib/core/home_widgets/home_widget_service.dart +54 -0
- package/lib/scaffold/features/widget/lib/features/settings/ui/components/admin/admin_home_widgets.dart +32 -0
- package/lib/scaffold/generate.js +370 -0
- package/lib/scaffold/patch.js +395 -0
- package/lib/scaffold/shared/backend-config.js +74 -0
- package/lib/scaffold/shared/fcm-service-account.js +126 -0
- package/lib/scaffold/shared/generator-utils.js +1664 -0
- package/lib/scaffold/shared/post-build.js +809 -0
- package/lib/scaffold/shared/template-strings.js +112 -0
- package/lib/utils/apple-release.js +273 -0
- package/lib/utils/checks.js +319 -0
- package/lib/utils/codemagic-release.js +127 -0
- package/lib/utils/fs.js +122 -0
- package/lib/utils/i18n.js +2123 -0
- package/lib/utils/license-gate.js +72 -0
- package/lib/utils/license.js +64 -0
- package/lib/utils/prompts.js +213 -0
- package/lib/utils/updates.js +97 -0
- package/package.json +55 -0
- package/templates/firebase/.env.example +24 -0
- package/templates/firebase/.firebaserc +5 -0
- package/templates/firebase/.kasy/apple.env.example +8 -0
- package/templates/firebase/.kasy/codemagic.env.example +7 -0
- package/templates/firebase/.metadata +30 -0
- package/templates/firebase/.windsurfrules +95 -0
- package/templates/firebase/Makefile +30 -0
- package/templates/firebase/README.en.md +180 -0
- package/templates/firebase/README.es.md +180 -0
- package/templates/firebase/README.md +180 -0
- package/templates/firebase/analysis_options.yaml +37 -0
- package/templates/firebase/android/app/build.gradle.kts +80 -0
- package/templates/firebase/android/app/src/debug/AndroidManifest.xml +7 -0
- package/templates/firebase/android/app/src/main/AndroidManifest.xml +93 -0
- package/templates/firebase/android/app/src/main/kotlin/com/aicrus/firebase/kit/MainActivity.kt +36 -0
- package/templates/firebase/android/app/src/main/kotlin/com/aicrus/firebase/kit/MyWidget.kt +50 -0
- package/templates/firebase/android/app/src/main/kotlin/com/aicrus/firebase/kit/MyWidgetReceiver.kt +7 -0
- package/templates/firebase/android/app/src/main/res/drawable/background.png +0 -0
- package/templates/firebase/android/app/src/main/res/drawable/launch_background.xml +9 -0
- package/templates/firebase/android/app/src/main/res/drawable-hdpi/splash.png +0 -0
- package/templates/firebase/android/app/src/main/res/drawable-mdpi/splash.png +0 -0
- package/templates/firebase/android/app/src/main/res/drawable-v21/background.png +0 -0
- package/templates/firebase/android/app/src/main/res/drawable-v21/launch_background.xml +9 -0
- package/templates/firebase/android/app/src/main/res/drawable-xhdpi/splash.png +0 -0
- package/templates/firebase/android/app/src/main/res/drawable-xxhdpi/splash.png +0 -0
- package/templates/firebase/android/app/src/main/res/drawable-xxxhdpi/splash.png +0 -0
- package/templates/firebase/android/app/src/main/res/mipmap-hdpi/ic_launcher.png +0 -0
- package/templates/firebase/android/app/src/main/res/mipmap-mdpi/ic_launcher.png +0 -0
- package/templates/firebase/android/app/src/main/res/mipmap-xhdpi/ic_launcher.png +0 -0
- package/templates/firebase/android/app/src/main/res/mipmap-xxhdpi/ic_launcher.png +0 -0
- package/templates/firebase/android/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png +0 -0
- package/templates/firebase/android/app/src/main/res/values/strings.xml +6 -0
- package/templates/firebase/android/app/src/main/res/values/styles.xml +22 -0
- package/templates/firebase/android/app/src/main/res/values-night/styles.xml +22 -0
- package/templates/firebase/android/app/src/main/res/values-night-v31/styles.xml +20 -0
- package/templates/firebase/android/app/src/main/res/values-v31/styles.xml +20 -0
- package/templates/firebase/android/app/src/main/res/xml/locales_config.xml +7 -0
- package/templates/firebase/android/app/src/main/res/xml/mywidget_info.xml +11 -0
- package/templates/firebase/android/app/src/profile/AndroidManifest.xml +7 -0
- package/templates/firebase/android/build.gradle.kts +28 -0
- package/templates/firebase/android/gradle/wrapper/gradle-wrapper.properties +5 -0
- package/templates/firebase/android/gradle.properties +2 -0
- package/templates/firebase/android/settings.gradle.kts +29 -0
- package/templates/firebase/assets/icons/apple.png +0 -0
- package/templates/firebase/assets/icons/facebook.png +0 -0
- package/templates/firebase/assets/icons/google.png +0 -0
- package/templates/firebase/assets/icons/google_play_games.png +0 -0
- package/templates/firebase/assets/images/app_icon.png +0 -0
- package/templates/firebase/assets/images/empty_notifications.jpg +0 -0
- package/templates/firebase/assets/images/icon.png +0 -0
- package/templates/firebase/assets/images/onboarding/authentication-login-template.jpg +0 -0
- package/templates/firebase/assets/images/onboarding/img1.jpg +0 -0
- package/templates/firebase/assets/images/onboarding/img2.jpg +0 -0
- package/templates/firebase/assets/images/onboarding/img3.jpg +0 -0
- package/templates/firebase/assets/images/onboarding/notifications.png +0 -0
- package/templates/firebase/assets/images/onboarding/onboarding.png +0 -0
- package/templates/firebase/assets/images/onboarding/purchase.png +0 -0
- package/templates/firebase/assets/images/premium-bg.jpg +0 -0
- package/templates/firebase/assets/images/premium-switch-header.png +0 -0
- package/templates/firebase/assets/images/review.png +0 -0
- package/templates/firebase/assets/images/splashscreen.png +0 -0
- package/templates/firebase/assets/images/update.png +0 -0
- package/templates/firebase/build.yaml +13 -0
- package/templates/firebase/devtools_options.yaml +3 -0
- package/templates/firebase/docs/auth-setup.en.md +145 -0
- package/templates/firebase/docs/auth-setup.es.md +145 -0
- package/templates/firebase/docs/auth-setup.pt.md +145 -0
- package/templates/firebase/docs/codemagic-release.en.md +50 -0
- package/templates/firebase/docs/codemagic-release.es.md +50 -0
- package/templates/firebase/docs/codemagic-release.pt.md +50 -0
- package/templates/firebase/docs/ios-release.en.md +41 -0
- package/templates/firebase/docs/ios-release.es.md +41 -0
- package/templates/firebase/docs/ios-release.pt.md +54 -0
- package/templates/firebase/docs/navigation-transitions.md +80 -0
- package/templates/firebase/docs/revenuecat-setup.es.md +341 -0
- package/templates/firebase/docs/revenuecat-setup.pt.md +341 -0
- package/templates/firebase/firebase.json +1 -0
- package/templates/firebase/firestore.indexes.json +25 -0
- package/templates/firebase/firestore.rules +51 -0
- package/templates/firebase/functions/.eslintrc.js +45 -0
- package/templates/firebase/functions/jest.config.js +16 -0
- package/templates/firebase/functions/package-lock.json +6876 -0
- package/templates/firebase/functions/package.json +33 -0
- package/templates/firebase/functions/src/authentication/functions.ts +30 -0
- package/templates/firebase/functions/src/authentication/triggers.ts +103 -0
- package/templates/firebase/functions/src/core/api/meta_ads_api.ts +390 -0
- package/templates/firebase/functions/src/core/data/entities/entity_utils.ts +87 -0
- package/templates/firebase/functions/src/core/data/entities/notification_entity.ts +74 -0
- package/templates/firebase/functions/src/core/data/entities/page.ts +4 -0
- package/templates/firebase/functions/src/core/data/entities/subscription_entity.ts +76 -0
- package/templates/firebase/functions/src/core/data/entities/user_device_entity.ts +64 -0
- package/templates/firebase/functions/src/core/data/entities/user_entity.ts +43 -0
- package/templates/firebase/functions/src/core/data/repositories/repositories.ts +16 -0
- package/templates/firebase/functions/src/core/data/repositories/subscription_repository.ts +42 -0
- package/templates/firebase/functions/src/core/data/repositories/user_device_repository.ts +31 -0
- package/templates/firebase/functions/src/core/data/repositories/user_notifications_repository.ts +58 -0
- package/templates/firebase/functions/src/core/data/repositories/user_repository.ts +84 -0
- package/templates/firebase/functions/src/core/logger/logger.ts +13 -0
- package/templates/firebase/functions/src/core/storage/storage_manager.ts +52 -0
- package/templates/firebase/functions/src/core/utils/async_utils.ts +5 -0
- package/templates/firebase/functions/src/feature_requests/triggers.ts +3 -0
- package/templates/firebase/functions/src/index.ts +24 -0
- package/templates/firebase/functions/src/llm_chat/index.ts +181 -0
- package/templates/firebase/functions/src/notifications/admin_functions.ts +91 -0
- package/templates/firebase/functions/src/notifications/models/notification.ts +61 -0
- package/templates/firebase/functions/src/notifications/notifications_api.ts +147 -0
- package/templates/firebase/functions/src/notifications/triggers.ts +102 -0
- package/templates/firebase/functions/src/subscriptions/models/revenuecat_events.ts +162 -0
- package/templates/firebase/functions/src/subscriptions/models/subscription_status.ts +18 -0
- package/templates/firebase/functions/src/subscriptions/models/subscriptions.ts +173 -0
- package/templates/firebase/functions/src/subscriptions/subscriptions_functions.ts +135 -0
- package/templates/firebase/functions/src/subscriptions/triggers.ts +35 -0
- package/templates/firebase/functions/src/test/core/data/entities/entity_utils.spec.ts +44 -0
- package/templates/firebase/functions/tsconfig.dev.json +5 -0
- package/templates/firebase/functions/tsconfig.json +18 -0
- package/templates/firebase/home_widget_config.json +30 -0
- package/templates/firebase/ios/Flutter/AppFrameworkInfo.plist +24 -0
- package/templates/firebase/ios/Flutter/Debug.xcconfig +2 -0
- package/templates/firebase/ios/Flutter/Profile.xcconfig +2 -0
- package/templates/firebase/ios/Flutter/Release.xcconfig +2 -0
- package/templates/firebase/ios/HomeWidgetExtension/HomeWidgetBundle.swift +13 -0
- package/templates/firebase/ios/HomeWidgetExtension/Info.plist +29 -0
- package/templates/firebase/ios/HomeWidgetExtension/MyWidget.swift +86 -0
- package/templates/firebase/ios/HomeWidgetExtension.entitlements +10 -0
- package/templates/firebase/ios/NotificationService/Info.plist +31 -0
- package/templates/firebase/ios/NotificationService/NotificationService.swift +76 -0
- package/templates/firebase/ios/Podfile +111 -0
- package/templates/firebase/ios/Runner/AppDelegate.swift +75 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Contents.json +1 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-1024x1024@1x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@1x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@2x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-20x20@3x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@1x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@2x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-29x29@3x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@1x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@2x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-40x40@3x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@1x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-50x50@2x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@1x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-57x57@2x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@2x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-60x60@3x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@1x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-72x72@2x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@1x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-76x76@2x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/AppIcon.appiconset/Icon-App-83.5x83.5@2x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/LaunchBackground.imageset/Contents.json +21 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/LaunchBackground.imageset/background.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/LaunchImage.imageset/Contents.json +23 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@2x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/LaunchImage.imageset/LaunchImage@3x.png +0 -0
- package/templates/firebase/ios/Runner/Assets.xcassets/LaunchImage.imageset/README.md +5 -0
- package/templates/firebase/ios/Runner/Base.lproj/LaunchScreen.storyboard +44 -0
- package/templates/firebase/ios/Runner/Base.lproj/Main.storyboard +26 -0
- package/templates/firebase/ios/Runner/Info.plist +132 -0
- package/templates/firebase/ios/Runner/Runner-Bridging-Header.h +1 -0
- package/templates/firebase/ios/Runner/Runner.entitlements +14 -0
- package/templates/firebase/ios/Runner/es.lproj/InfoPlist.strings +10 -0
- package/templates/firebase/ios/Runner/pt-BR.lproj/InfoPlist.strings +10 -0
- package/templates/firebase/ios/Runner/pt.lproj/InfoPlist.strings +10 -0
- package/templates/firebase/ios/Runner.xcodeproj/project.pbxproj +1108 -0
- package/templates/firebase/ios/Runner.xcodeproj/project.xcworkspace/contents.xcworkspacedata +7 -0
- package/templates/firebase/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/templates/firebase/ios/Runner.xcodeproj/project.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- package/templates/firebase/ios/Runner.xcodeproj/xcshareddata/xcschemes/NotificationService.xcscheme +58 -0
- package/templates/firebase/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme +101 -0
- package/templates/firebase/ios/Runner.xcworkspace/contents.xcworkspacedata +10 -0
- package/templates/firebase/ios/Runner.xcworkspace/xcshareddata/IDEWorkspaceChecks.plist +8 -0
- package/templates/firebase/ios/Runner.xcworkspace/xcshareddata/WorkspaceSettings.xcsettings +8 -0
- package/templates/firebase/ios/RunnerTests/RunnerTests.swift +12 -0
- package/templates/firebase/lib/components/components.dart +27 -0
- package/templates/firebase/lib/components/kasy_accordion.dart +384 -0
- package/templates/firebase/lib/components/kasy_alert.dart +266 -0
- package/templates/firebase/lib/components/kasy_app_bar.dart +536 -0
- package/templates/firebase/lib/components/kasy_avatar.dart +549 -0
- package/templates/firebase/lib/components/kasy_avatar_presets.dart +104 -0
- package/templates/firebase/lib/components/kasy_badge.dart +278 -0
- package/templates/firebase/lib/components/kasy_bottom_sheet.dart +338 -0
- package/templates/firebase/lib/components/kasy_button.dart +926 -0
- package/templates/firebase/lib/components/kasy_card.dart +128 -0
- package/templates/firebase/lib/components/kasy_checkbox.dart +429 -0
- package/templates/firebase/lib/components/kasy_chip.dart +83 -0
- package/templates/firebase/lib/components/kasy_dialog.dart +789 -0
- package/templates/firebase/lib/components/kasy_otp_verification_bottom_sheet.dart +233 -0
- package/templates/firebase/lib/components/kasy_skeleton.dart +225 -0
- package/templates/firebase/lib/components/kasy_text_area.dart +392 -0
- package/templates/firebase/lib/components/kasy_text_field.dart +591 -0
- package/templates/firebase/lib/components/kasy_text_field_otp.dart +532 -0
- package/templates/firebase/lib/components/kasy_toast.dart +803 -0
- package/templates/firebase/lib/core/ads/ads_provider.dart +136 -0
- package/templates/firebase/lib/core/ads/ads_state.dart +15 -0
- package/templates/firebase/lib/core/animations/bottomfade_anim.dart +37 -0
- package/templates/firebase/lib/core/animations/movefade_anim.dart +34 -0
- package/templates/firebase/lib/core/animations/slideright_anim.dart +38 -0
- package/templates/firebase/lib/core/bottom_menu/bart_inner_paths.dart +5 -0
- package/templates/firebase/lib/core/bottom_menu/bottom_menu.dart +127 -0
- package/templates/firebase/lib/core/bottom_menu/bottom_router.dart +281 -0
- package/templates/firebase/lib/core/bottom_menu/kasy_bart_navigation.dart +22 -0
- package/templates/firebase/lib/core/bottom_menu/kasy_bottom_bar_factory.dart +127 -0
- package/templates/firebase/lib/core/bottom_menu/notification_bottom_item.dart +48 -0
- package/templates/firebase/lib/core/config/app_env.dart +100 -0
- package/templates/firebase/lib/core/config/features.dart +15 -0
- package/templates/firebase/lib/core/data/api/analytics_api.dart +124 -0
- package/templates/firebase/lib/core/data/api/base_api_exceptions.dart +28 -0
- package/templates/firebase/lib/core/data/api/firestore_retry.dart +29 -0
- package/templates/firebase/lib/core/data/api/http_client.dart +38 -0
- package/templates/firebase/lib/core/data/api/image.dart +52 -0
- package/templates/firebase/lib/core/data/api/remote_config_api.dart +170 -0
- package/templates/firebase/lib/core/data/api/storage_api.dart +115 -0
- package/templates/firebase/lib/core/data/api/tracking_api.dart +119 -0
- package/templates/firebase/lib/core/data/api/user_api.dart +115 -0
- package/templates/firebase/lib/core/data/entities/json_converters.dart +39 -0
- package/templates/firebase/lib/core/data/entities/upload_result.dart +48 -0
- package/templates/firebase/lib/core/data/entities/user_entity.dart +54 -0
- package/templates/firebase/lib/core/data/models/pageable.dart +12 -0
- package/templates/firebase/lib/core/data/models/subscription.dart +322 -0
- package/templates/firebase/lib/core/data/models/user.dart +107 -0
- package/templates/firebase/lib/core/data/repositories/user_repository.dart +130 -0
- package/templates/firebase/lib/core/dev_inspector/dev_inspector.dart +464 -0
- package/templates/firebase/lib/core/dev_inspector/dev_inspector_highlight.dart +88 -0
- package/templates/firebase/lib/core/dev_inspector/dev_inspector_info.dart +70 -0
- package/templates/firebase/lib/core/dev_inspector/dev_inspector_panel.dart +204 -0
- package/templates/firebase/lib/core/dev_inspector/dev_inspector_service.dart +321 -0
- package/templates/firebase/lib/core/extensions/date.ext.dart +32 -0
- package/templates/firebase/lib/core/guards/authenticated_guard.dart +37 -0
- package/templates/firebase/lib/core/guards/guard.dart +68 -0
- package/templates/firebase/lib/core/guards/user_info_guard.dart +55 -0
- package/templates/firebase/lib/core/haptics/haptic_feedback_notifier.dart +19 -0
- package/templates/firebase/lib/core/haptics/kasy_haptics.dart +27 -0
- package/templates/firebase/lib/core/home_widgets/home_widget_background_task.dart +41 -0
- package/templates/firebase/lib/core/home_widgets/home_widget_mywidget_service.dart +57 -0
- package/templates/firebase/lib/core/home_widgets/home_widget_service.dart +54 -0
- package/templates/firebase/lib/core/icons/kasy_icons.dart +86 -0
- package/templates/firebase/lib/core/initializer/models/run_state.dart +14 -0
- package/templates/firebase/lib/core/initializer/onstart_service.dart +38 -0
- package/templates/firebase/lib/core/initializer/onstart_widget.dart +83 -0
- package/templates/firebase/lib/core/initializer/pending_notification_handler.dart +48 -0
- package/templates/firebase/lib/core/keyboard_fix/keyboard_flicker_fix.dart +164 -0
- package/templates/firebase/lib/core/navigation/kasy_fade_page_transitions_builder.dart +34 -0
- package/templates/firebase/lib/core/navigation/kasy_material_page_route.dart +41 -0
- package/templates/firebase/lib/core/navigation/kasy_navigation_config.dart +29 -0
- package/templates/firebase/lib/core/navigation/kasy_page_transition.dart +40 -0
- package/templates/firebase/lib/core/navigation/kasy_route_transition.dart +68 -0
- package/templates/firebase/lib/core/navigation/kasy_transition_kind.dart +17 -0
- package/templates/firebase/lib/core/navigation/navigation.dart +6 -0
- package/templates/firebase/lib/core/rating/api/rating_api.dart +99 -0
- package/templates/firebase/lib/core/rating/models/rating.dart +52 -0
- package/templates/firebase/lib/core/rating/models/review.dart +70 -0
- package/templates/firebase/lib/core/rating/providers/rating_repository.dart +75 -0
- package/templates/firebase/lib/core/rating/widgets/rate_banner.dart +190 -0
- package/templates/firebase/lib/core/rating/widgets/rate_popup.dart +54 -0
- package/templates/firebase/lib/core/rating/widgets/review_popup.dart +175 -0
- package/templates/firebase/lib/core/security/biometric_copy_slot.dart +20 -0
- package/templates/firebase/lib/core/security/biometric_guard.dart +114 -0
- package/templates/firebase/lib/core/security/biometric_preference_notifier.dart +17 -0
- package/templates/firebase/lib/core/security/biometric_service.dart +79 -0
- package/templates/firebase/lib/core/security/biometric_ui_bundle.dart +136 -0
- package/templates/firebase/lib/core/security/secured_storage.dart +46 -0
- package/templates/firebase/lib/core/shared_preferences/shared_preferences.dart +70 -0
- package/templates/firebase/lib/core/sidebar/kasy_sidebar.dart +2021 -0
- package/templates/firebase/lib/core/states/components/maybe_ask_biometric_setup.dart +88 -0
- package/templates/firebase/lib/core/states/components/maybe_ask_rating.dart +49 -0
- package/templates/firebase/lib/core/states/components/maybe_show_update_bottom_sheet.dart +86 -0
- package/templates/firebase/lib/core/states/components/maybeshow_component.dart +110 -0
- package/templates/firebase/lib/core/states/events_dispatcher.dart +103 -0
- package/templates/firebase/lib/core/states/models/event_model.dart +118 -0
- package/templates/firebase/lib/core/states/models/user_state.dart +22 -0
- package/templates/firebase/lib/core/states/notifications_dispatcher.dart +81 -0
- package/templates/firebase/lib/core/states/translations.dart +11 -0
- package/templates/firebase/lib/core/states/user_state_notifier.dart +321 -0
- package/templates/firebase/lib/core/theme/colors.dart +262 -0
- package/templates/firebase/lib/core/theme/extensions/theme_extension.dart +48 -0
- package/templates/firebase/lib/core/theme/providers/kasy_theme.dart +76 -0
- package/templates/firebase/lib/core/theme/providers/theme_provider.dart +212 -0
- package/templates/firebase/lib/core/theme/radius.dart +33 -0
- package/templates/firebase/lib/core/theme/shadows.dart +64 -0
- package/templates/firebase/lib/core/theme/spacing.dart +44 -0
- package/templates/firebase/lib/core/theme/texts.dart +176 -0
- package/templates/firebase/lib/core/theme/theme.dart +24 -0
- package/templates/firebase/lib/core/theme/theme_data/theme_data.dart +32 -0
- package/templates/firebase/lib/core/theme/theme_data/theme_data_factory.dart +15 -0
- package/templates/firebase/lib/core/theme/universal_theme.dart +210 -0
- package/templates/firebase/lib/core/toast/toast_service.dart +55 -0
- package/templates/firebase/lib/core/ui/app_dialog.dart +26 -0
- package/templates/firebase/lib/core/web_device_preview/web_device_preview.dart +1126 -0
- package/templates/firebase/lib/core/widgets/debouncer.dart +31 -0
- package/templates/firebase/lib/core/widgets/kasy_hover.dart +166 -0
- package/templates/firebase/lib/core/widgets/kasy_pressable.dart +2 -0
- package/templates/firebase/lib/core/widgets/kasy_pressable_depth.dart +161 -0
- package/templates/firebase/lib/core/widgets/kasy_scroll_behavior.dart +17 -0
- package/templates/firebase/lib/core/widgets/keyboard_visibility.dart +75 -0
- package/templates/firebase/lib/core/widgets/page_background.dart +71 -0
- package/templates/firebase/lib/core/widgets/page_not_found.dart +15 -0
- package/templates/firebase/lib/core/widgets/responsive_layout.dart +215 -0
- package/templates/firebase/lib/core/widgets/update_bottom_sheet.dart +192 -0
- package/templates/firebase/lib/environnements.dart +160 -0
- package/templates/firebase/lib/features/authentication/api/authentication_api.dart +528 -0
- package/templates/firebase/lib/features/authentication/api/authentication_api_interface.dart +84 -0
- package/templates/firebase/lib/features/authentication/providers/models/email.dart +36 -0
- package/templates/firebase/lib/features/authentication/providers/models/password.dart +37 -0
- package/templates/firebase/lib/features/authentication/providers/models/phone_signin_state.dart +21 -0
- package/templates/firebase/lib/features/authentication/providers/models/recover_state.dart +21 -0
- package/templates/firebase/lib/features/authentication/providers/models/signin_state.dart +20 -0
- package/templates/firebase/lib/features/authentication/providers/models/signup_state.dart +20 -0
- package/templates/firebase/lib/features/authentication/providers/phone_auth_notifier.dart +132 -0
- package/templates/firebase/lib/features/authentication/providers/recover_provider.dart +51 -0
- package/templates/firebase/lib/features/authentication/providers/signin_state_provider.dart +166 -0
- package/templates/firebase/lib/features/authentication/providers/signup_state_provider.dart +67 -0
- package/templates/firebase/lib/features/authentication/repositories/authentication_repository.dart +399 -0
- package/templates/firebase/lib/features/authentication/repositories/exceptions/authentication_exceptions.dart +85 -0
- package/templates/firebase/lib/features/authentication/ui/components/apple_signin.dart +19 -0
- package/templates/firebase/lib/features/authentication/ui/components/facebook_signin.dart +19 -0
- package/templates/firebase/lib/features/authentication/ui/components/google_signin.dart +32 -0
- package/templates/firebase/lib/features/authentication/ui/components/otp_verification.dart +100 -0
- package/templates/firebase/lib/features/authentication/ui/components/phone_input.dart +109 -0
- package/templates/firebase/lib/features/authentication/ui/phone_auth_page.dart +60 -0
- package/templates/firebase/lib/features/authentication/ui/recover_password_page.dart +101 -0
- package/templates/firebase/lib/features/authentication/ui/signin_page.dart +321 -0
- package/templates/firebase/lib/features/authentication/ui/signup_page.dart +310 -0
- package/templates/firebase/lib/features/authentication/ui/widgets/auth_brand.dart +35 -0
- package/templates/firebase/lib/features/authentication/ui/widgets/auth_page_back_button.dart +149 -0
- package/templates/firebase/lib/features/authentication/ui/widgets/otp_input.dart +194 -0
- package/templates/firebase/lib/features/authentication/ui/widgets/recover_password_result.dart +62 -0
- package/templates/firebase/lib/features/authentication/ui/widgets/round_signin.dart +73 -0
- package/templates/firebase/lib/features/authentication/ui/widgets/social_separator.dart +26 -0
- package/templates/firebase/lib/features/dev/keyboard_test_page.dart +93 -0
- package/templates/firebase/lib/features/feedbacks/api/entities/feature_request_entity.dart +27 -0
- package/templates/firebase/lib/features/feedbacks/api/entities/feature_vote_entity.dart +27 -0
- package/templates/firebase/lib/features/feedbacks/api/feature_request_api.dart +51 -0
- package/templates/firebase/lib/features/feedbacks/api/feature_vote_api.dart +79 -0
- package/templates/firebase/lib/features/feedbacks/models/feature_requests.dart +48 -0
- package/templates/firebase/lib/features/feedbacks/models/feedback_state.dart +43 -0
- package/templates/firebase/lib/features/feedbacks/providers/feedback_page_notifier.dart +147 -0
- package/templates/firebase/lib/features/feedbacks/repositories/feature_request_repository.dart +92 -0
- package/templates/firebase/lib/features/feedbacks/ui/component/add_feature_form.dart +112 -0
- package/templates/firebase/lib/features/feedbacks/ui/feedback_page.dart +184 -0
- package/templates/firebase/lib/features/feedbacks/ui/widgets/add_feature_button.dart +66 -0
- package/templates/firebase/lib/features/feedbacks/ui/widgets/feature_card.dart +266 -0
- package/templates/firebase/lib/features/home/design_system_page.dart +552 -0
- package/templates/firebase/lib/features/home/home_components_page.dart +314 -0
- package/templates/firebase/lib/features/home/home_components_preview_page.dart +791 -0
- package/templates/firebase/lib/features/home/home_components_preview_registry.dart +7712 -0
- package/templates/firebase/lib/features/home/home_features_page.dart +207 -0
- package/templates/firebase/lib/features/home/home_page.dart +348 -0
- package/templates/firebase/lib/features/llm_chat/api/llm_chat_api.dart +50 -0
- package/templates/firebase/lib/features/llm_chat/api/llm_chat_message_entity.dart +35 -0
- package/templates/firebase/lib/features/llm_chat/llm_chat_page.dart +352 -0
- package/templates/firebase/lib/features/llm_chat/providers/llm_chat_notifier.dart +315 -0
- package/templates/firebase/lib/features/llm_chat/ui/widgets/llm_chat_avatars.dart +148 -0
- package/templates/firebase/lib/features/llm_chat/ui/widgets/llm_chat_composer.dart +124 -0
- package/templates/firebase/lib/features/local_reminder/providers/reminder_notifier.dart +81 -0
- package/templates/firebase/lib/features/local_reminder/repositories/reminder_preferences.dart +76 -0
- package/templates/firebase/lib/features/local_reminder/ui/reminder_page.dart +288 -0
- package/templates/firebase/lib/features/notifications/api/device_api.dart +433 -0
- package/templates/firebase/lib/features/notifications/api/entities/device_entity.dart +62 -0
- package/templates/firebase/lib/features/notifications/api/entities/notifications_entity.dart +35 -0
- package/templates/firebase/lib/features/notifications/api/local_notifier.dart +409 -0
- package/templates/firebase/lib/features/notifications/api/notifications_api.dart +319 -0
- package/templates/firebase/lib/features/notifications/providers/models/device.dart +27 -0
- package/templates/firebase/lib/features/notifications/providers/models/notification.dart +196 -0
- package/templates/firebase/lib/features/notifications/providers/models/notification_list.dart +38 -0
- package/templates/firebase/lib/features/notifications/providers/notifications_provider.dart +120 -0
- package/templates/firebase/lib/features/notifications/repositories/background_notification_handler.dart +13 -0
- package/templates/firebase/lib/features/notifications/repositories/device_repository.dart +137 -0
- package/templates/firebase/lib/features/notifications/repositories/notifications_repository.dart +214 -0
- package/templates/firebase/lib/features/notifications/shared/att_permission.dart +75 -0
- package/templates/firebase/lib/features/notifications/shared/notification_permission_bottom_sheet.dart +144 -0
- package/templates/firebase/lib/features/notifications/ui/components/notification_settings_sheet.dart +169 -0
- package/templates/firebase/lib/features/notifications/ui/components/notification_tile.dart +46 -0
- package/templates/firebase/lib/features/notifications/ui/components/notifications_header.dart +32 -0
- package/templates/firebase/lib/features/notifications/ui/components/push_notification_switcher.dart +106 -0
- package/templates/firebase/lib/features/notifications/ui/notifications_page.dart +202 -0
- package/templates/firebase/lib/features/notifications/ui/request_notification_permission.dart +84 -0
- package/templates/firebase/lib/features/notifications/ui/widgets/empty_notifications.dart +73 -0
- package/templates/firebase/lib/features/notifications/ui/widgets/notification_tile.dart +362 -0
- package/templates/firebase/lib/features/onboarding/api/entities/user_info_entity.dart +24 -0
- package/templates/firebase/lib/features/onboarding/api/user_infos_api.dart +71 -0
- package/templates/firebase/lib/features/onboarding/models/user_info.dart +92 -0
- package/templates/firebase/lib/features/onboarding/providers/onboarding_model.dart +15 -0
- package/templates/firebase/lib/features/onboarding/providers/onboarding_provider.dart +78 -0
- package/templates/firebase/lib/features/onboarding/repositories/user_infos_repository.dart +29 -0
- package/templates/firebase/lib/features/onboarding/ui/animations/page_transitions.dart +33 -0
- package/templates/firebase/lib/features/onboarding/ui/components/onboarding_att_setup.dart +66 -0
- package/templates/firebase/lib/features/onboarding/ui/components/onboarding_features.dart +76 -0
- package/templates/firebase/lib/features/onboarding/ui/components/onboarding_loader.dart +92 -0
- package/templates/firebase/lib/features/onboarding/ui/components/onboarding_notifications_setup.dart +76 -0
- package/templates/firebase/lib/features/onboarding/ui/components/onboarding_questions.dart +89 -0
- package/templates/firebase/lib/features/onboarding/ui/onboarding_page.dart +108 -0
- package/templates/firebase/lib/features/onboarding/ui/widgets/onboarding_background.dart +80 -0
- package/templates/firebase/lib/features/onboarding/ui/widgets/onboarding_feature.dart +145 -0
- package/templates/firebase/lib/features/onboarding/ui/widgets/onboarding_illustration_scaffold.dart +125 -0
- package/templates/firebase/lib/features/onboarding/ui/widgets/onboarding_progress.dart +84 -0
- package/templates/firebase/lib/features/onboarding/ui/widgets/onboarding_radio_question.dart +173 -0
- package/templates/firebase/lib/features/onboarding/ui/widgets/onboarding_reassurance.dart +44 -0
- package/templates/firebase/lib/features/onboarding/ui/widgets/onboarding_sticky_footer.dart +77 -0
- package/templates/firebase/lib/features/onboarding/ui/widgets/selectable_row_tile.dart +392 -0
- package/templates/firebase/lib/features/settings/settings_page.dart +460 -0
- package/templates/firebase/lib/features/settings/ui/components/admin/admin_bottom_sheet.dart +301 -0
- package/templates/firebase/lib/features/settings/ui/components/admin/admin_home_widgets.dart +38 -0
- package/templates/firebase/lib/features/settings/ui/components/admin/admin_paywalls.dart +53 -0
- package/templates/firebase/lib/features/settings/ui/components/admin/admin_routes.dart +22 -0
- package/templates/firebase/lib/features/settings/ui/components/admin/send_push_notification_page.dart +366 -0
- package/templates/firebase/lib/features/settings/ui/components/admin/send_push_notifier.dart +40 -0
- package/templates/firebase/lib/features/settings/ui/components/avatar_component.dart +430 -0
- package/templates/firebase/lib/features/settings/ui/components/delete_user_component.dart +28 -0
- package/templates/firebase/lib/features/settings/ui/components/language_switcher.dart +163 -0
- package/templates/firebase/lib/features/settings/ui/widgets/admin_card.dart +59 -0
- package/templates/firebase/lib/features/settings/ui/widgets/avatar_utils.dart +51 -0
- package/templates/firebase/lib/features/settings/ui/widgets/round_progress.dart +151 -0
- package/templates/firebase/lib/features/settings/ui/widgets/settings_bottom_sheet_option_tile.dart +52 -0
- package/templates/firebase/lib/features/settings/ui/widgets/settings_tile.dart +163 -0
- package/templates/firebase/lib/features/subscription/api/entities/subscription_entity.dart +40 -0
- package/templates/firebase/lib/features/subscription/api/inapp_subscription_api.dart +389 -0
- package/templates/firebase/lib/features/subscription/api/subscription_api.dart +39 -0
- package/templates/firebase/lib/features/subscription/providers/models/premium_state.dart +35 -0
- package/templates/firebase/lib/features/subscription/providers/premium_page_provider.dart +259 -0
- package/templates/firebase/lib/features/subscription/repositories/subscription_repository.dart +177 -0
- package/templates/firebase/lib/features/subscription/shared/maybeshow_premium.dart +85 -0
- package/templates/firebase/lib/features/subscription/ui/component/active_premium_content.dart +171 -0
- package/templates/firebase/lib/features/subscription/ui/component/paywall_minimal.dart +146 -0
- package/templates/firebase/lib/features/subscription/ui/component/paywall_row.dart +332 -0
- package/templates/firebase/lib/features/subscription/ui/component/paywall_with_switch.dart +207 -0
- package/templates/firebase/lib/features/subscription/ui/component/premium_content.dart +157 -0
- package/templates/firebase/lib/features/subscription/ui/component/premium_page_factory.dart +161 -0
- package/templates/firebase/lib/features/subscription/ui/premium_page.dart +139 -0
- package/templates/firebase/lib/features/subscription/ui/widgets/comparison_table.dart +346 -0
- package/templates/firebase/lib/features/subscription/ui/widgets/feature_line.dart +131 -0
- package/templates/firebase/lib/features/subscription/ui/widgets/paywall_empty_state.dart +68 -0
- package/templates/firebase/lib/features/subscription/ui/widgets/premium_background.dart +63 -0
- package/templates/firebase/lib/features/subscription/ui/widgets/premium_background_gradient.dart +53 -0
- package/templates/firebase/lib/features/subscription/ui/widgets/premium_banner.dart +80 -0
- package/templates/firebase/lib/features/subscription/ui/widgets/premium_bottom_menu.dart +102 -0
- package/templates/firebase/lib/features/subscription/ui/widgets/premium_card.dart +26 -0
- package/templates/firebase/lib/features/subscription/ui/widgets/premium_close_button.dart +61 -0
- package/templates/firebase/lib/features/subscription/ui/widgets/premium_feature.dart +39 -0
- package/templates/firebase/lib/features/subscription/ui/widgets/selectable_col.dart +377 -0
- package/templates/firebase/lib/features/subscription/ui/widgets/selectable_row.dart +436 -0
- package/templates/firebase/lib/features/subscription/ui/widgets/trial_switcher.dart +85 -0
- package/templates/firebase/lib/features/subscription/ui/widgets/unsubscribe_feedback_popup.dart +123 -0
- package/templates/firebase/lib/firebase_options.dart +75 -0
- package/templates/firebase/lib/google_auth_options.dart +10 -0
- package/templates/firebase/lib/i18n/app_locale_display.dart +17 -0
- package/templates/firebase/lib/i18n/en.i18n.json +514 -0
- package/templates/firebase/lib/i18n/es.i18n.json +514 -0
- package/templates/firebase/lib/i18n/pt.i18n.json +514 -0
- package/templates/firebase/lib/i18n/widgets/locale_code_badge.dart +47 -0
- package/templates/firebase/lib/main.dart +263 -0
- package/templates/firebase/lib/router.dart +226 -0
- package/templates/firebase/login-redesign-preview.png +0 -0
- package/templates/firebase/pubspec.yaml +177 -0
- package/templates/firebase/scripts/bump-ios-version.js +38 -0
- package/templates/firebase/scripts/release-ios.sh +137 -0
- package/templates/firebase/slang.yaml +7 -0
- package/templates/firebase/storage.rules +12 -0
- package/templates/firebase/test/core/data/api/analytics_api_fake.dart +25 -0
- package/templates/firebase/test/core/data/api/fake_remote_config_api.dart +45 -0
- package/templates/firebase/test/core/data/api/storage_api_fake.dart +28 -0
- package/templates/firebase/test/core/data/models/subscription_test.dart +42 -0
- package/templates/firebase/test/core/data/repositories/user_repository_test.dart +56 -0
- package/templates/firebase/test/core/guards/guard_test.dart +78 -0
- package/templates/firebase/test/core/navigation/kasy_page_transition_test.dart +30 -0
- package/templates/firebase/test/core/onstart_service_test.dart +18 -0
- package/templates/firebase/test/core/rating/rating_api_fake.dart +58 -0
- package/templates/firebase/test/core/rating/rating_banner_test.dart +117 -0
- package/templates/firebase/test/core/rating/rating_test.dart +60 -0
- package/templates/firebase/test/core/security/secured_storage_fake.dart +33 -0
- package/templates/firebase/test/core/states/event_dispatcher_test.dart +269 -0
- package/templates/firebase/test/core/states/user_state_notifier_test.dart +244 -0
- package/templates/firebase/test/core/widgets/responsive_layout_test.dart +50 -0
- package/templates/firebase/test/device_test_utils.dart +98 -0
- package/templates/firebase/test/features/authentication/data/api/auth_api_fake.dart +169 -0
- package/templates/firebase/test/features/authentication/data/api/user_api_fake.dart +86 -0
- package/templates/firebase/test/features/authentication/lost_password_page_test.dart +59 -0
- package/templates/firebase/test/features/authentication/repositories/authentication_repository_test.dart +88 -0
- package/templates/firebase/test/features/authentication/signin_page_test.dart +133 -0
- package/templates/firebase/test/features/authentication/signup_page_test.dart +136 -0
- package/templates/firebase/test/features/notifications/data/device_api_fake.dart +66 -0
- package/templates/firebase/test/features/notifications/data/fake_facebook_api.dart +40 -0
- package/templates/firebase/test/features/notifications/data/local_notifier_fake.dart +59 -0
- package/templates/firebase/test/features/notifications/data/notifications_api_fake.dart +120 -0
- package/templates/firebase/test/features/notifications/data/notifications_settings_fake.dart +34 -0
- package/templates/firebase/test/features/notifications/providers/device_repository_test.dart +68 -0
- package/templates/firebase/test/features/notifications/providers/notifications_repository_test.dart +74 -0
- package/templates/firebase/test/features/notifications/ui/notifications_page_test.dart +69 -0
- package/templates/firebase/test/features/subscription/api/fake_inapp_subscription_api.dart +85 -0
- package/templates/firebase/test/features/subscription/api/fake_revenuecat_product.dart +186 -0
- package/templates/firebase/test/features/subscription/api/fake_subscription_api.dart +11 -0
- package/templates/firebase/test/features/subscription/subscription_page_test.dart +119 -0
- package/templates/firebase/test/firebase_test_utils.dart +25 -0
- package/templates/firebase/test/test_utils.dart +272 -0
- package/templates/firebase/web/favicon.png +0 -0
- package/templates/firebase/web/firebase-messaging-sw.js +27 -0
- package/templates/firebase/web/icons/Icon-192.png +0 -0
- package/templates/firebase/web/icons/Icon-512.png +0 -0
- package/templates/firebase/web/icons/Icon-maskable-192.png +0 -0
- package/templates/firebase/web/icons/Icon-maskable-512.png +0 -0
- package/templates/firebase/web/index.html +110 -0
- package/templates/firebase/web/local_notifications.js +31 -0
- package/templates/firebase/web/manifest.json +35 -0
- package/templates/firebase/web/splash/img/dark-1x.png +0 -0
- package/templates/firebase/web/splash/img/dark-2x.png +0 -0
- package/templates/firebase/web/splash/img/dark-3x.png +0 -0
- package/templates/firebase/web/splash/img/dark-4x.png +0 -0
- package/templates/firebase/web/splash/img/light-1x.png +0 -0
- package/templates/firebase/web/splash/img/light-2x.png +0 -0
- package/templates/firebase/web/splash/img/light-3x.png +0 -0
- package/templates/firebase/web/splash/img/light-4x.png +0 -0
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
2
|
+
import 'package:logger/logger.dart';
|
|
3
|
+
import 'package:kasy_kit/core/home_widgets/home_widget_mywidget_service.dart';
|
|
4
|
+
import 'package:kasy_kit/core/shared_preferences/shared_preferences.dart';
|
|
5
|
+
import 'package:kasy_kit/core/states/user_state_notifier.dart';
|
|
6
|
+
import 'package:kasy_kit/features/authentication/api/authentication_api.dart';
|
|
7
|
+
import 'package:kasy_kit/features/subscription/repositories/subscription_repository.dart';
|
|
8
|
+
|
|
9
|
+
/// Generated by Kasy CLI
|
|
10
|
+
/// ----
|
|
11
|
+
/// Background task callback for workmanager
|
|
12
|
+
/// This allows updating home widgets even when the app is in the background
|
|
13
|
+
@pragma('vm:entry-point')
|
|
14
|
+
Future<void> homeWidgetCallbackDispatcher() async {
|
|
15
|
+
try {
|
|
16
|
+
Logger().i('🔄 Home Widget background task triggered');
|
|
17
|
+
final globalContainer = ProviderContainer();
|
|
18
|
+
final sharedPreferences = globalContainer.read(sharedPreferencesProvider);
|
|
19
|
+
await sharedPreferences.init();
|
|
20
|
+
await globalContainer.read(authenticationApiProvider).init();
|
|
21
|
+
await globalContainer.read(subscriptionRepositoryProvider).init();
|
|
22
|
+
await globalContainer.read(userStateNotifierProvider.notifier).init();
|
|
23
|
+
|
|
24
|
+
/// If you want to restric the background task to only run when the user is subscribed,
|
|
25
|
+
/// you can use the subscription variable here.
|
|
26
|
+
// final subscription = globalContainer
|
|
27
|
+
// .read(userStateNotifierProvider)
|
|
28
|
+
// .subscription;
|
|
29
|
+
|
|
30
|
+
final myWidgetWidget = globalContainer.read(
|
|
31
|
+
myWidgetHomeWidgetProvider.notifier,
|
|
32
|
+
);
|
|
33
|
+
await myWidgetWidget.update();
|
|
34
|
+
|
|
35
|
+
globalContainer.dispose();
|
|
36
|
+
return;
|
|
37
|
+
} catch (e) {
|
|
38
|
+
Logger().e('Error in background task: $e');
|
|
39
|
+
return;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import 'package:home_widget/home_widget.dart';
|
|
2
|
+
import 'package:logger/logger.dart';
|
|
3
|
+
import 'package:kasy_kit/core/home_widgets/home_widget_service.dart';
|
|
4
|
+
import 'package:kasy_kit/core/states/user_state_notifier.dart';
|
|
5
|
+
import 'package:riverpod_annotation/riverpod_annotation.dart';
|
|
6
|
+
|
|
7
|
+
part 'home_widget_mywidget_service.g.dart';
|
|
8
|
+
|
|
9
|
+
@Riverpod(keepAlive: true)
|
|
10
|
+
class MyWidgetHomeWidget extends _$MyWidgetHomeWidget
|
|
11
|
+
implements UpdatableHomeWidget {
|
|
12
|
+
static const String _androidWidgetName = 'MyWidgetReceiver';
|
|
13
|
+
static const String _iosWidgetName = 'MyWidgetWidget';
|
|
14
|
+
|
|
15
|
+
@override
|
|
16
|
+
void build() {}
|
|
17
|
+
|
|
18
|
+
@override
|
|
19
|
+
Future<void> update() {
|
|
20
|
+
Logger().i('🔄 Updating MyWidget Home Widget');
|
|
21
|
+
// Example: fetch some data from the user state
|
|
22
|
+
final userState = ref.read(userStateNotifierProvider);
|
|
23
|
+
final userName = userState.user.idOrNull ?? 'Guest';
|
|
24
|
+
|
|
25
|
+
return updateWidget({'title': 'Hello, $userName', 'counter': '0'});
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/// Update widget data
|
|
29
|
+
///
|
|
30
|
+
/// This will save data that the widget can read
|
|
31
|
+
Future<void> updateWidget(Map<String, String> data) async {
|
|
32
|
+
await HomeWidget.saveWidgetData<String>('title', data['title'] ?? 'Hello');
|
|
33
|
+
|
|
34
|
+
await HomeWidget.saveWidgetData<String>('counter', data['counter'] ?? '0');
|
|
35
|
+
|
|
36
|
+
// Trigger widget update
|
|
37
|
+
await HomeWidget.updateWidget(
|
|
38
|
+
name: _androidWidgetName,
|
|
39
|
+
iOSName: _iosWidgetName,
|
|
40
|
+
);
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/// Get current widget data
|
|
44
|
+
Future<Map<String, dynamic>> getWidgetData() async {
|
|
45
|
+
return {
|
|
46
|
+
'title': await HomeWidget.getWidgetData<String>(
|
|
47
|
+
'title',
|
|
48
|
+
defaultValue: 'Hello',
|
|
49
|
+
),
|
|
50
|
+
|
|
51
|
+
'counter': await HomeWidget.getWidgetData<String>(
|
|
52
|
+
'counter',
|
|
53
|
+
defaultValue: '0',
|
|
54
|
+
),
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
import 'package:background_fetch/background_fetch.dart';
|
|
2
|
+
import 'package:flutter/foundation.dart';
|
|
3
|
+
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
4
|
+
import 'package:home_widget/home_widget.dart';
|
|
5
|
+
import 'package:logger/logger.dart';
|
|
6
|
+
import 'package:kasy_kit/core/home_widgets/home_widget_background_task.dart';
|
|
7
|
+
import 'package:kasy_kit/core/initializer/onstart_service.dart';
|
|
8
|
+
|
|
9
|
+
final homeWidgetsManagerProvider = Provider<HomeWidgetsManager>(
|
|
10
|
+
(ref) => HomeWidgetsManager(),
|
|
11
|
+
);
|
|
12
|
+
|
|
13
|
+
const String appGroupId = 'group.com.appfirebase.app';
|
|
14
|
+
|
|
15
|
+
/// Manager for all home widgets
|
|
16
|
+
/// -> Don't modify this file
|
|
17
|
+
/// ------------------------------------------------------------
|
|
18
|
+
/// will be used to initialize the home widgets and set the app group id
|
|
19
|
+
/// Register the background task for the home widgets
|
|
20
|
+
class HomeWidgetsManager implements OnStartService {
|
|
21
|
+
@override
|
|
22
|
+
Future<void> init() async {
|
|
23
|
+
if (kIsWeb) return;
|
|
24
|
+
try {
|
|
25
|
+
await HomeWidget.setAppGroupId(appGroupId);
|
|
26
|
+
|
|
27
|
+
final status = await BackgroundFetch.configure(
|
|
28
|
+
BackgroundFetchConfig(
|
|
29
|
+
minimumFetchInterval: 15,
|
|
30
|
+
stopOnTerminate: false,
|
|
31
|
+
enableHeadless: true,
|
|
32
|
+
requiresBatteryNotLow: false,
|
|
33
|
+
requiresCharging: false,
|
|
34
|
+
requiresStorageNotLow: false,
|
|
35
|
+
requiresDeviceIdle: false,
|
|
36
|
+
requiredNetworkType: NetworkType.ANY,
|
|
37
|
+
),
|
|
38
|
+
(String taskId) async {
|
|
39
|
+
final res = await homeWidgetCallbackDispatcher();
|
|
40
|
+
BackgroundFetch.finish(taskId);
|
|
41
|
+
return res;
|
|
42
|
+
},
|
|
43
|
+
);
|
|
44
|
+
Logger().i('🔄 - Home widgets manager initialized with status: $status');
|
|
45
|
+
await BackgroundFetch.start();
|
|
46
|
+
} catch (e, s) {
|
|
47
|
+
Logger().e('⚠️ Could not initialize home widgets: $e $s');
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
abstract class UpdatableHomeWidget {
|
|
53
|
+
Future<void> update();
|
|
54
|
+
}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import 'package:flutter/material.dart';
|
|
2
|
+
import 'package:flutter_riverpod/flutter_riverpod.dart';
|
|
3
|
+
import 'package:kasy_kit/core/home_widgets/home_widget_mywidget_service.dart';
|
|
4
|
+
import 'package:kasy_kit/core/theme/theme.dart';
|
|
5
|
+
import 'package:kasy_kit/i18n/translations.g.dart';
|
|
6
|
+
import 'package:kasy_kit/features/settings/ui/widgets/admin_card.dart';
|
|
7
|
+
|
|
8
|
+
class AdminHomeWidgets extends ConsumerWidget {
|
|
9
|
+
const AdminHomeWidgets({super.key});
|
|
10
|
+
|
|
11
|
+
@override
|
|
12
|
+
Widget build(BuildContext context, WidgetRef ref) {
|
|
13
|
+
return Scaffold(
|
|
14
|
+
appBar: AppBar(title: Text(t.settings.admin.home_widgets_title)),
|
|
15
|
+
body: Padding(
|
|
16
|
+
padding: const EdgeInsets.all(KasySpacing.lg),
|
|
17
|
+
child: Column(
|
|
18
|
+
crossAxisAlignment: CrossAxisAlignment.stretch,
|
|
19
|
+
children: [
|
|
20
|
+
AdminPanelCard(
|
|
21
|
+
title: t.settings.admin.update_mywidget_title,
|
|
22
|
+
description: t.settings.admin.update_mywidget_desc,
|
|
23
|
+
onTap: () =>
|
|
24
|
+
ref.watch(myWidgetHomeWidgetProvider.notifier).update(),
|
|
25
|
+
),
|
|
26
|
+
const SizedBox(height: KasySpacing.md),
|
|
27
|
+
],
|
|
28
|
+
),
|
|
29
|
+
),
|
|
30
|
+
);
|
|
31
|
+
}
|
|
32
|
+
}
|
|
@@ -0,0 +1,370 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* generate.js — Motor unificado de geração de projetos.
|
|
3
|
+
*
|
|
4
|
+
* Todos os backends (Firebase, Supabase, API) usam este motor.
|
|
5
|
+
* Cada backend fornece dois hooks opcionais:
|
|
6
|
+
*
|
|
7
|
+
* applyBackendSetup(targetDir, tokens, pathReplacements, options)
|
|
8
|
+
* → Chamado dentro do bloco project-setup, logo após copyWithTokens.
|
|
9
|
+
* → Responsável por: aplicar patch do backend, trocar pubspec.yaml,
|
|
10
|
+
* remover artefatos irrelevantes, escrever overrides de environment
|
|
11
|
+
* e copiar arquivos extras do backend (ex: supabase/migrations/).
|
|
12
|
+
* → Retorna: { detail?, extraAnswers?, kitSetupExtra?, returnExtra? }
|
|
13
|
+
* - detail : string extra para o log do passo (ex: "12 patch files")
|
|
14
|
+
* - extraAnswers : campos extras para writeVsCodeLaunch / writeEnvExample
|
|
15
|
+
* - kitSetupExtra: campos extras para writeKitSetup
|
|
16
|
+
* - returnExtra : campos extras no objeto de retorno da função
|
|
17
|
+
*
|
|
18
|
+
* postBuild(targetDir, options, steps)
|
|
19
|
+
* → Chamado após build-runner e flutterfire configure.
|
|
20
|
+
* → Responsável por: deploy automático (Firebase), etc.
|
|
21
|
+
*
|
|
22
|
+
* Passos comuns executados para todos os backends:
|
|
23
|
+
* 1. Validação do template base (Firebase/)
|
|
24
|
+
* 2. buildTokens (tokens de substituição de texto)
|
|
25
|
+
* 3. copyWithTokens (Firebase/ → targetDir)
|
|
26
|
+
* [hook: applyBackendSetup]
|
|
27
|
+
* 3b. applyFeaturePatches (features/ci/, features/web/, etc.)
|
|
28
|
+
* 4. writeVsCodeLaunch
|
|
29
|
+
* 5. writeEnvExample
|
|
30
|
+
* 6. writeFeaturesConfig
|
|
31
|
+
* 7. writeKitSetup
|
|
32
|
+
* 8. flutter pub get
|
|
33
|
+
* 9. dart run slang
|
|
34
|
+
* 10. dart run build_runner build
|
|
35
|
+
* 11. flutterfire configure (Firebase para FCM + Remote Config — todos os backends)
|
|
36
|
+
* 12. writeFirebaserc
|
|
37
|
+
* [hook: postBuild]
|
|
38
|
+
*/
|
|
39
|
+
|
|
40
|
+
const path = require('node:path');
|
|
41
|
+
const fs = require('fs-extra');
|
|
42
|
+
const { copyWithTokens, applyPatch } = require('./engine');
|
|
43
|
+
const { buildTokens } = require('./backends/firebase/tokens');
|
|
44
|
+
const { FEATURES_PATCH_DIR } = require('./catalog');
|
|
45
|
+
const {
|
|
46
|
+
writeRouter,
|
|
47
|
+
writeVsCodeLaunch,
|
|
48
|
+
writeEnvExample,
|
|
49
|
+
writeEnvFileIfMissing,
|
|
50
|
+
writeFirebaserc,
|
|
51
|
+
writeFeaturesConfig,
|
|
52
|
+
writeKitSetup,
|
|
53
|
+
writeMakefile,
|
|
54
|
+
writeNoOpAnalyticsApi,
|
|
55
|
+
writeNoOpTrackingApi,
|
|
56
|
+
removeAndroidWidgetArtifacts,
|
|
57
|
+
removeFacebookSigninFromAuthPages,
|
|
58
|
+
removeAndroidFacebookMetadata,
|
|
59
|
+
writeNoOpAdminHomeWidgets,
|
|
60
|
+
writeNoOpFeatureRequestRepository,
|
|
61
|
+
writeNoOpSubscriptionStubs,
|
|
62
|
+
writeNoOpSentryUsages,
|
|
63
|
+
writeMainDart,
|
|
64
|
+
removeModuleDirs,
|
|
65
|
+
stripPubspecDeps,
|
|
66
|
+
removeDevelopmentTeam,
|
|
67
|
+
localizeReleaseDocs,
|
|
68
|
+
} = require('./shared/generator-utils');
|
|
69
|
+
const { pubGet, slangGenerate, buildRunner, flutterfireConfigure, writeGoogleAuthOptions, writeGoogleIosUrlScheme, patchFirebaseServiceWorker } = require('./shared/post-build');
|
|
70
|
+
const { FIREBASE_SOURCE_DIR } = require('./shared/backend-config');
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* Gera um projeto Flutter para o backend indicado.
|
|
74
|
+
*
|
|
75
|
+
* @param {string} targetDir - Caminho absoluto do diretório de destino.
|
|
76
|
+
* @param {'firebase'|'supabase'|'api'} backend - Backend selecionado.
|
|
77
|
+
* @param {object} options
|
|
78
|
+
* @param {string} options.appName
|
|
79
|
+
* @param {string} options.bundleId
|
|
80
|
+
* @param {string} options.firebaseProjectId
|
|
81
|
+
* @param {string[]} [options.modules=[]]
|
|
82
|
+
* @param {object} [options.moduleAnswers={}]
|
|
83
|
+
* @param {Function} [options.onProgress] - Callback para atualizar spinner no CLI.
|
|
84
|
+
* @param {object} [options.deploy] - Usado pelo hook postBuild do Firebase.
|
|
85
|
+
* @param {object} [hooks={}]
|
|
86
|
+
* @param {Function|null} [hooks.applyBackendSetup]
|
|
87
|
+
* @param {Function|null} [hooks.postBuild]
|
|
88
|
+
* @returns {Promise<{steps: object[], packageName: string, appName: string, bundleId: string, firebaseProjectId: string}>}
|
|
89
|
+
*/
|
|
90
|
+
async function generateProject(targetDir, backend, options, hooks = {}) {
|
|
91
|
+
const {
|
|
92
|
+
appName,
|
|
93
|
+
bundleId,
|
|
94
|
+
firebaseProjectId,
|
|
95
|
+
modules = [],
|
|
96
|
+
moduleAnswers = {},
|
|
97
|
+
onProgress = () => {},
|
|
98
|
+
includeWeb = true,
|
|
99
|
+
language = 'en',
|
|
100
|
+
} = options;
|
|
101
|
+
|
|
102
|
+
const { applyBackendSetup = null, postBuild = null } = hooks;
|
|
103
|
+
|
|
104
|
+
if (!(await fs.pathExists(FIREBASE_SOURCE_DIR))) {
|
|
105
|
+
throw new Error(
|
|
106
|
+
`Firebase template not found: ${FIREBASE_SOURCE_DIR}\n` +
|
|
107
|
+
'Make sure the Firebase/ folder exists at the kit root.'
|
|
108
|
+
);
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
const { tokens, packageName, pathReplacements } = buildTokens({
|
|
112
|
+
appName,
|
|
113
|
+
bundleId,
|
|
114
|
+
fbAppId: moduleAnswers.fbAppId,
|
|
115
|
+
fbToken: moduleAnswers.fbToken,
|
|
116
|
+
defaultPaywall: moduleAnswers.defaultPaywall || 'basic',
|
|
117
|
+
functionsRegion: options.functionsRegion || 'us-central1',
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
const steps = [];
|
|
121
|
+
let extraAnswers = {};
|
|
122
|
+
let kitSetupExtra = {};
|
|
123
|
+
let returnExtra = {};
|
|
124
|
+
|
|
125
|
+
// Track whether we created the target directory so we can clean it up on failure
|
|
126
|
+
const targetDirExistedBefore = await fs.pathExists(targetDir);
|
|
127
|
+
|
|
128
|
+
// ── 1. Project setup ───────────────────────────────────────────────────────
|
|
129
|
+
onProgress('project-setup');
|
|
130
|
+
try {
|
|
131
|
+
const { filesCopied } = await copyWithTokens(
|
|
132
|
+
FIREBASE_SOURCE_DIR,
|
|
133
|
+
targetDir,
|
|
134
|
+
tokens,
|
|
135
|
+
[],
|
|
136
|
+
pathReplacements
|
|
137
|
+
);
|
|
138
|
+
|
|
139
|
+
// Copy README in user's language (README.md = pt, README.en.md, README.es.md)
|
|
140
|
+
const readmeLang = ['en', 'pt', 'es'].includes(language) ? language : 'en';
|
|
141
|
+
if (readmeLang !== 'pt') {
|
|
142
|
+
const langReadme = path.join(targetDir, `README.${readmeLang}.md`);
|
|
143
|
+
if (await fs.pathExists(langReadme)) {
|
|
144
|
+
await fs.copy(langReadme, path.join(targetDir, 'README.md'));
|
|
145
|
+
}
|
|
146
|
+
}
|
|
147
|
+
for (const lang of ['en', 'es']) {
|
|
148
|
+
const p = path.join(targetDir, `README.${lang}.md`);
|
|
149
|
+
if (await fs.pathExists(p)) await fs.remove(p);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
await localizeReleaseDocs(targetDir, readmeLang);
|
|
153
|
+
|
|
154
|
+
let setupDetail = `${filesCopied} files`;
|
|
155
|
+
|
|
156
|
+
// Remove the web/ folder when the web module was NOT selected.
|
|
157
|
+
// The base template always has web/, but clients that want native-only
|
|
158
|
+
// should not receive it.
|
|
159
|
+
if (!modules.includes('web')) {
|
|
160
|
+
const webDir = path.join(targetDir, 'web');
|
|
161
|
+
if (await fs.pathExists(webDir)) {
|
|
162
|
+
await fs.remove(webDir);
|
|
163
|
+
}
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// Apply feature patches BEFORE backend setup so the backend patch can
|
|
167
|
+
// override any Firebase-specific files introduced by the feature patch
|
|
168
|
+
// (e.g. feedbacks/api/ uses Firestore in the feature patch but Supabase/API
|
|
169
|
+
// backends have their own version that must win).
|
|
170
|
+
let featurePatchCount = 0;
|
|
171
|
+
for (const module of modules) {
|
|
172
|
+
const patchDir = path.join(FEATURES_PATCH_DIR, module);
|
|
173
|
+
if (await fs.pathExists(patchDir)) {
|
|
174
|
+
const { filesApplied } = await applyPatch(patchDir, targetDir, tokens, pathReplacements);
|
|
175
|
+
featurePatchCount += filesApplied;
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
if (featurePatchCount > 0) setupDetail += ` + ${featurePatchCount} feature files`;
|
|
179
|
+
|
|
180
|
+
if (applyBackendSetup) {
|
|
181
|
+
const hookResult = (await applyBackendSetup(targetDir, tokens, pathReplacements, options)) ?? {};
|
|
182
|
+
if (hookResult.detail) setupDetail += ` + ${hookResult.detail}`;
|
|
183
|
+
if (hookResult.extraAnswers) extraAnswers = hookResult.extraAnswers;
|
|
184
|
+
if (hookResult.kitSetupExtra) kitSetupExtra = hookResult.kitSetupExtra;
|
|
185
|
+
if (hookResult.returnExtra) returnExtra = hookResult.returnExtra;
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
// CI templates: swap to user's language (PULL_REQUEST_TEMPLATE, BUG, feature_request)
|
|
189
|
+
if (modules.includes('ci')) {
|
|
190
|
+
const githubDir = path.join(targetDir, '.github');
|
|
191
|
+
const issueDir = path.join(githubDir, 'ISSUE_TEMPLATE');
|
|
192
|
+
const ciFiles = [
|
|
193
|
+
['PULL_REQUEST_TEMPLATE', path.join(githubDir, 'PULL_REQUEST_TEMPLATE.md')],
|
|
194
|
+
['BUG', path.join(issueDir, 'BUG.md')],
|
|
195
|
+
['feature_request', path.join(issueDir, 'feature_request.md')],
|
|
196
|
+
];
|
|
197
|
+
const readmeLang = ['en', 'pt', 'es'].includes(language) ? language : 'en';
|
|
198
|
+
for (const [base, destPath] of ciFiles) {
|
|
199
|
+
const dir = path.dirname(destPath);
|
|
200
|
+
if (readmeLang !== 'en') {
|
|
201
|
+
const langPath = path.join(dir, `${base}.${readmeLang}.md`);
|
|
202
|
+
if (await fs.pathExists(langPath)) {
|
|
203
|
+
await fs.copy(langPath, destPath);
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
for (const lang of ['pt', 'es']) {
|
|
207
|
+
const p = path.join(dir, `${base}.${lang}.md`);
|
|
208
|
+
if (await fs.pathExists(p)) await fs.remove(p);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
const answers = { ...moduleAnswers, ...extraAnswers, functionsRegion: options.functionsRegion || 'us-central1' };
|
|
214
|
+
await writeVsCodeLaunch(targetDir, appName, backend, modules, answers, language);
|
|
215
|
+
await writeEnvExample(targetDir, modules, answers, language);
|
|
216
|
+
await writeEnvFileIfMissing(targetDir);
|
|
217
|
+
await writeFeaturesConfig(targetDir, modules, answers, language);
|
|
218
|
+
await writeRouter(targetDir, modules, packageName, moduleAnswers.defaultPaywall || 'basic');
|
|
219
|
+
await writeMakefile(targetDir, language, backend, modules, answers);
|
|
220
|
+
await writeKitSetup(targetDir, {
|
|
221
|
+
appName,
|
|
222
|
+
bundleId,
|
|
223
|
+
backend,
|
|
224
|
+
modules,
|
|
225
|
+
firebaseProjectId,
|
|
226
|
+
moduleAnswers: answers,
|
|
227
|
+
...kitSetupExtra,
|
|
228
|
+
});
|
|
229
|
+
|
|
230
|
+
// ── Phase B: decouple optional modules ───────────────────────────────────
|
|
231
|
+
// Remove directories of modules that were NOT selected
|
|
232
|
+
await removeModuleDirs(targetDir, modules);
|
|
233
|
+
|
|
234
|
+
// Write no-op analytics_api.dart if analytics not selected
|
|
235
|
+
if (!modules.includes('analytics')) {
|
|
236
|
+
await writeNoOpAnalyticsApi(targetDir, packageName);
|
|
237
|
+
}
|
|
238
|
+
|
|
239
|
+
// Write no-op tracking_api.dart if facebook not selected
|
|
240
|
+
if (!modules.includes('facebook')) {
|
|
241
|
+
await writeNoOpTrackingApi(targetDir, packageName);
|
|
242
|
+
// Remove Facebook SDK meta-data from AndroidManifest so the SDK doesn't
|
|
243
|
+
// initialize on app start and spam logs with OAuthException error 190.
|
|
244
|
+
await removeAndroidFacebookMetadata(targetDir);
|
|
245
|
+
await removeFacebookSigninFromAuthPages(targetDir);
|
|
246
|
+
}
|
|
247
|
+
|
|
248
|
+
// Write no-op feature_request_repository.dart if feedback not selected but revenuecat IS selected.
|
|
249
|
+
// Only premium_page_provider.dart (subscription module) imports this — when revenuecat is not
|
|
250
|
+
// selected the subscription module is removed entirely, so the stub is not needed.
|
|
251
|
+
if (!modules.includes('feedback') && modules.includes('revenuecat')) {
|
|
252
|
+
await writeNoOpFeatureRequestRepository(targetDir, packageName);
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
// Write no-op subscription stubs if revenuecat not selected
|
|
256
|
+
// (user_repository, home_page, admin_paywalls, onboarding_page reference subscription types)
|
|
257
|
+
if (!modules.includes('revenuecat')) {
|
|
258
|
+
await writeNoOpSubscriptionStubs(targetDir, packageName);
|
|
259
|
+
}
|
|
260
|
+
|
|
261
|
+
// Write no-op admin_home_widgets.dart if widget not selected
|
|
262
|
+
// (imports home_widget_mywidget_service which only exists when widget is selected)
|
|
263
|
+
if (!modules.includes('widget')) {
|
|
264
|
+
await writeNoOpAdminHomeWidgets(targetDir);
|
|
265
|
+
// Remove Android native widget files and unregister the receiver from the manifest
|
|
266
|
+
// so the widget does not appear in the Android widget picker when not selected
|
|
267
|
+
await removeAndroidWidgetArtifacts(targetDir, bundleId);
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// Patch core files that import sentry_flutter when sentry, revenuecat, and facebook
|
|
271
|
+
// are all not selected — removes sentry import so the dep can be stripped from pubspec.
|
|
272
|
+
if (!modules.includes('sentry') && !modules.includes('revenuecat') && !modules.includes('facebook')) {
|
|
273
|
+
await writeNoOpSentryUsages(targetDir);
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
// Generate main.dart based on backend + selected modules
|
|
277
|
+
await writeMainDart(targetDir, backend, modules, packageName, {
|
|
278
|
+
supabaseUrl: extraAnswers.supabaseUrl,
|
|
279
|
+
supabaseAnonKey: extraAnswers.supabaseAnonKey,
|
|
280
|
+
});
|
|
281
|
+
|
|
282
|
+
// Strip unused deps from pubspec.yaml
|
|
283
|
+
await stripPubspecDeps(targetDir, modules);
|
|
284
|
+
|
|
285
|
+
// Remove internal DEVELOPMENT_TEAM from iOS project — clients use their own Apple team
|
|
286
|
+
await removeDevelopmentTeam(targetDir);
|
|
287
|
+
// ── End Phase B ──────────────────────────────────────────────────────────
|
|
288
|
+
|
|
289
|
+
steps.push({ name: 'project-setup', ok: true, detail: setupDetail });
|
|
290
|
+
} catch (err) {
|
|
291
|
+
steps.push({ name: 'project-setup', ok: false, detail: err.message });
|
|
292
|
+
// Clean up partial output only if we created the directory — never delete pre-existing dirs
|
|
293
|
+
if (!targetDirExistedBefore && await fs.pathExists(targetDir)) {
|
|
294
|
+
await fs.remove(targetDir).catch(() => {});
|
|
295
|
+
}
|
|
296
|
+
return { steps };
|
|
297
|
+
}
|
|
298
|
+
|
|
299
|
+
// ── 2. Post-build comum ────────────────────────────────────────────────────
|
|
300
|
+
onProgress('pub-get');
|
|
301
|
+
const pubGetResult = await pubGet(targetDir);
|
|
302
|
+
steps.push({ name: 'pub-get', ok: pubGetResult.ok, detail: pubGetResult.ok ? null : pubGetResult.error });
|
|
303
|
+
if (!pubGetResult.ok) return { steps };
|
|
304
|
+
|
|
305
|
+
onProgress('slang');
|
|
306
|
+
const slangResult = await slangGenerate(targetDir);
|
|
307
|
+
steps.push({ name: 'slang', ok: slangResult.ok, detail: slangResult.ok ? null : slangResult.error });
|
|
308
|
+
if (!slangResult.ok) return { steps };
|
|
309
|
+
|
|
310
|
+
onProgress('build-runner');
|
|
311
|
+
const buildRunnerResult = await buildRunner(targetDir);
|
|
312
|
+
steps.push({
|
|
313
|
+
name: 'build-runner',
|
|
314
|
+
ok: buildRunnerResult.ok,
|
|
315
|
+
detail: buildRunnerResult.ok ? null : buildRunnerResult.error,
|
|
316
|
+
});
|
|
317
|
+
if (!buildRunnerResult.ok) return { steps };
|
|
318
|
+
|
|
319
|
+
onProgress('flutterfire');
|
|
320
|
+
const ffResult = await flutterfireConfigure(targetDir, firebaseProjectId, { includeWeb });
|
|
321
|
+
steps.push({ name: 'flutterfire', ok: ffResult.ok, detail: ffResult.ok ? null : ffResult.error });
|
|
322
|
+
|
|
323
|
+
// After flutterfire: patch Android, iOS and Web config files.
|
|
324
|
+
if (ffResult.ok) {
|
|
325
|
+
// Android: populate kGoogleWebClientId in lib/google_auth_options.dart.
|
|
326
|
+
// Skip for Supabase — it defines kGoogleIosClientId too, handled separately
|
|
327
|
+
// in new.js after credentials are resolved (readSupabaseGoogleCredentials).
|
|
328
|
+
if (backend !== 'supabase') {
|
|
329
|
+
const gaResult = await writeGoogleAuthOptions(targetDir);
|
|
330
|
+
steps.push({
|
|
331
|
+
name: 'google-auth-options',
|
|
332
|
+
ok: gaResult.ok,
|
|
333
|
+
detail: gaResult.ok ? null : gaResult.error,
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
// iOS: register REVERSED_CLIENT_ID as a URL scheme in ios/Runner/Info.plist
|
|
338
|
+
const iosSchemeResult = await writeGoogleIosUrlScheme(targetDir);
|
|
339
|
+
steps.push({
|
|
340
|
+
name: 'google-ios-url-scheme',
|
|
341
|
+
ok: iosSchemeResult.ok,
|
|
342
|
+
detail: iosSchemeResult.ok ? null : iosSchemeResult.error,
|
|
343
|
+
});
|
|
344
|
+
|
|
345
|
+
// Web: patch firebase-messaging-sw.js with real config values (only when web module is selected)
|
|
346
|
+
if (modules.includes('web')) {
|
|
347
|
+
const swResult = await patchFirebaseServiceWorker(targetDir);
|
|
348
|
+
steps.push({
|
|
349
|
+
name: 'firebase-messaging-sw',
|
|
350
|
+
ok: swResult.ok,
|
|
351
|
+
detail: swResult.ok ? null : swResult.error,
|
|
352
|
+
});
|
|
353
|
+
}
|
|
354
|
+
}
|
|
355
|
+
|
|
356
|
+
await writeFirebaserc(targetDir, firebaseProjectId);
|
|
357
|
+
|
|
358
|
+
// ── 3. Post-build específico do backend ────────────────────────────────────
|
|
359
|
+
if (postBuild) {
|
|
360
|
+
try {
|
|
361
|
+
await postBuild(targetDir, options, steps);
|
|
362
|
+
} catch (err) {
|
|
363
|
+
steps.push({ name: 'post-build', ok: false, detail: err.message });
|
|
364
|
+
}
|
|
365
|
+
}
|
|
366
|
+
|
|
367
|
+
return { steps, packageName, appName, bundleId, firebaseProjectId, ...returnExtra };
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
module.exports = { generateProject };
|