Skip to content

Commit

Permalink
fix: Add firestore and firebase auth to the flags for deploy.
Browse files Browse the repository at this point in the history
  • Loading branch information
mathrunet committed Jan 30, 2023
1 parent 50759bd commit 452d965
Show file tree
Hide file tree
Showing 4 changed files with 62 additions and 16 deletions.
22 changes: 17 additions & 5 deletions packages/katana_cli/lib/action/firebase/init.dart
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,14 @@ class FirebaseInitCliAction extends CliCommand with CliActionMixin {
bool checkEnabled(ExecContext context) {
final firebase = context.yaml.getAsMap("firebase");
final projectId = firebase.get("project_id", "");
final firestore = firebase.getAsMap("firestore").get("enable", false);
final authentication =
firebase.getAsMap("authentication").get("enable", false);
final functions = firebase.getAsMap("functions").get("enable", false);
final hosting = firebase.getAsMap("hosting").get("enable", false);
final messaging = firebase.getAsMap("messaging").get("enable", false);
return projectId.isNotEmpty && (functions || hosting || messaging);
return projectId.isNotEmpty &&
(firestore || authentication || functions || hosting || messaging);
}

@override
Expand All @@ -39,6 +43,10 @@ class FirebaseInitCliAction extends CliCommand with CliActionMixin {
final projectId = firebase.get("project_id", "");
final hosting = firebase.getAsMap("hosting");
final useFlutter = hosting.get("use_flutter", false);
final enabledFirestore =
firebase.getAsMap("firestore").get("enable", false);
final enabledAuthentication =
firebase.getAsMap("authentication").get("enable", false);
final enabledFunctions =
firebase.getAsMap("functions").get("enable", false);
final enabledHosting = hosting.get("enable", false);
Expand Down Expand Up @@ -105,10 +113,14 @@ class FirebaseInitCliAction extends CliCommand with CliActionMixin {
"pub",
"add",
"firebase_core",
"firebase_auth",
"cloud_firestore",
"katana_auth_firebase",
"katana_model_firestore",
if (enabledAuthentication) ...[
"firebase_auth",
"katana_auth_firebase",
],
if (enabledFirestore) ...[
"cloud_firestore",
"katana_model_firestore",
],
if (enabledFunctions) ...[
"firebase_storage",
"katana_storage_firebase",
Expand Down
24 changes: 24 additions & 0 deletions packages/katana_cli/lib/command/pub/version.dart
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,30 @@ class PubVersionCliCommand extends CliCommand {
break;
}
} else {
await command(
"Run dart fix",
[
melos,
"run",
"fix",
],
);
await command(
"Run dart format",
[
melos,
"run",
"format",
],
);
await command(
"Run import_sorter",
[
melos,
"run",
"import_sorter",
],
);
await command(
"Update the version of the management package according to the Git log.",
[
Expand Down
10 changes: 10 additions & 0 deletions packages/katana_cli/lib/config.dart
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,16 @@ firebase:
# FirebaseのプロジェクトIDを設定します。
project_id:
# Enable Firebase Firestore.
# Firebase Firestoreを有効にします。
firestore:
enable: false
# Enable Firebase Authentication.
# Firebase Authenticationを有効にします。
authentication:
enable: false
# Enable Firebase Functions.
# Firebase Functionsを有効にします。
functions:
Expand Down
22 changes: 11 additions & 11 deletions packages/katana_cli/pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ packages:
dependency: "direct main"
description:
name: archive
sha256: ed7cc591a948744994714375caf9a2ce89e1d82e8243997c8a2994d57181c212
sha256: d6347d54a2d8028e0437e3c099f66fdb8ae02c4720c1e7534c9f24c10351f85d
url: "https://pub.dev"
source: hosted
version: "3.3.5"
version: "3.3.6"
args:
dependency: transitive
description:
Expand Down Expand Up @@ -45,10 +45,10 @@ packages:
dependency: transitive
description:
name: collection
sha256: cfc915e6923fe5ce6e153b0723c753045de46de1b4d63771530504004a45fae0
sha256: "4a07be6cb69c84d677a6c3096fcf960cc3285a8330b4603e0d463d15d9bd934c"
url: "https://pub.dev"
source: hosted
version: "1.17.0"
version: "1.17.1"
convert:
dependency: transitive
description:
Expand Down Expand Up @@ -133,18 +133,18 @@ packages:
dependency: transitive
description:
name: js
sha256: "323b7c70073cccf6b9b8d8b334be418a3293cfb612a560dc2737160a37bf61bd"
sha256: f2c445dce49627136094980615a031419f7f3eb393237e4ecd97ac15dea343f3
url: "https://pub.dev"
source: hosted
version: "0.6.6"
version: "0.6.7"
katana:
dependency: "direct main"
description:
name: katana
sha256: fc59c8fd5c5eaeff569bff1bf37933ca9b2e69739c85dd3b6abffa63567a7cd4
sha256: "9a3ec047c35ec88e027139e88ce45202b022dd2111b38848c85159101b0028ce"
url: "https://pub.dev"
source: hosted
version: "1.0.3"
version: "1.0.5"
lints:
dependency: "direct main"
description:
Expand Down Expand Up @@ -205,10 +205,10 @@ packages:
dependency: transitive
description:
name: sprintf
sha256: ec76d38910b6f1c854ce1353c62d37e7ef82b53dc5ab048c25400d35970776d1
sha256: "1fc9ffe69d4df602376b52949af107d8f5703b77cda567c4d7d86a0693120f23"
url: "https://pub.dev"
source: hosted
version: "6.0.2"
version: "7.0.0"
string_scanner:
dependency: transitive
description:
Expand Down Expand Up @@ -274,4 +274,4 @@ packages:
source: hosted
version: "1.0.3"
sdks:
dart: ">=2.19.0-345.0.dev <4.0.0"
dart: ">=2.19.0 <4.0.0"

0 comments on commit 452d965

Please sign in to comment.