Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enable modules with commands #1656

Merged
merged 159 commits into from
Jan 8, 2025
Merged
Show file tree
Hide file tree
Changes from 150 commits
Commits
Show all changes
159 commits
Select commit Hold shift + click to select a range
2b7b58c
enable camera with npm run useCamera command
sharjeelyunus Sep 29, 2024
63588f1
enable files module
sharjeelyunus Sep 29, 2024
fe07bf4
use utils for same tasks
sharjeelyunus Sep 29, 2024
21ca13b
add permissions and descriptions
sharjeelyunus Sep 29, 2024
6e3ebed
Enable camera and files modules for specified platforms
sharjeelyunus Sep 29, 2024
d7265d1
run commands with npm
sharjeelyunus Sep 29, 2024
ccfe89c
fix dart runner
sharjeelyunus Sep 29, 2024
d6a8941
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Sep 29, 2024
9a5a803
enable multiple modules with a single command
sharjeelyunus Sep 29, 2024
fa501d1
define files paths in utils
sharjeelyunus Sep 29, 2024
561e995
enable contacts modules with a command
sharjeelyunus Sep 30, 2024
a707668
use reusable components to update files
sharjeelyunus Sep 30, 2024
594b7b2
refactoring + added exception for logs
sharjeelyunus Oct 1, 2024
8c5135c
adding github workflow to test test the commands on each PR to preven…
sharjeelyunus Oct 1, 2024
26b35d8
use starter as working directory for starter commands
sharjeelyunus Oct 1, 2024
8a0b29a
setup flutter sdk for dart commands
sharjeelyunus Oct 1, 2024
a78e668
fix
sharjeelyunus Oct 1, 2024
fc226a1
exist on failure + test if workflow fails on error
sharjeelyunus Oct 1, 2024
ef7acc3
fix
sharjeelyunus Oct 1, 2024
9a8ab81
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Oct 3, 2024
06e3ea8
added commands for generate keystore, get sha keys + other fixes
sharjeelyunus Oct 5, 2024
bcd7953
fix generate keystore to accept password at least 6 char long
sharjeelyunus Oct 6, 2024
526847c
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Oct 6, 2024
6b5d3cd
initialize all modules with scripts
sharjeelyunus Oct 7, 2024
6d991bc
location, google maps, and connect modules with commands
sharjeelyunus Oct 7, 2024
d58d8eb
enable deeplink with command for android
sharjeelyunus Oct 7, 2024
74efb17
fix deeplink
sharjeelyunus Oct 7, 2024
328e416
ask questions if arguments are not passed in the command
sharjeelyunus Oct 7, 2024
f9caf6f
fix: ask questions at once for all the modules when using `enable` co…
sharjeelyunus Oct 7, 2024
c71fd29
fix: ask multiple questions for enable command
sharjeelyunus Oct 7, 2024
bc678b8
enable deeplink for ios
sharjeelyunus Oct 8, 2024
f823039
options for platform choice, plus deeplink fix for web
sharjeelyunus Oct 8, 2024
219fc19
fix: select multiple platforms
sharjeelyunus Oct 8, 2024
d3b31d7
fix location module to accept google maps key for each platform
sharjeelyunus Oct 8, 2024
7bbee6c
option to enable qr code
sharjeelyunus Oct 10, 2024
7a571f2
fix: add branch keys in ensemble.properties for deeplink
sharjeelyunus Oct 10, 2024
9677da4
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Oct 10, 2024
c922bff
enable notifications with command
sharjeelyunus Oct 12, 2024
281df3d
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Oct 12, 2024
a7fde4b
fix android permissions to include meta data as well
sharjeelyunus Oct 13, 2024
480c5c0
throw error on if required values aren't provided
sharjeelyunus Oct 13, 2024
1478c1a
fix
sharjeelyunus Oct 13, 2024
9abf570
fix firebase initialization for notifications and analytics
sharjeelyunus Oct 13, 2024
16206b8
run formatter after running the command
sharjeelyunus Oct 13, 2024
8c8f17e
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Oct 14, 2024
0ac6f26
fix firebase initialization
sharjeelyunus Oct 15, 2024
dbc4724
enable firebase analytics with command
sharjeelyunus Oct 15, 2024
626890a
enable auth module with command
sharjeelyunus Oct 15, 2024
4b578a1
bypass questions + refactor dart runner
sharjeelyunus Oct 15, 2024
196c054
Add modules.js file for managing common parameters, modules, and scripts
sharjeelyunus Oct 15, 2024
07cb967
fix bypass questions
sharjeelyunus Oct 15, 2024
ed840ed
refactoring file paths
sharjeelyunus Oct 23, 2024
c4d28af
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Nov 4, 2024
d2b0ed3
retrieve ensemble git references dynamically
sharjeelyunus Nov 8, 2024
176c9c1
refactor getEnsembleRef to parse git ref directly from pubspec.yaml c…
sharjeelyunus Nov 8, 2024
7ca9844
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Nov 9, 2024
0baccd0
add ensemble_version parameter to module scripts for dynamic git refe…
sharjeelyunus Nov 9, 2024
f5b1049
Merge branch 'enable-modules-with-scripts' of https://github.com/Ense…
sharjeelyunus Nov 9, 2024
14996d0
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Nov 19, 2024
b6749f7
fix: update Kotlin and Gradle plugin versions in build.gradle
sharjeelyunus Nov 19, 2024
2b68c1f
fix: downgrade Kotlin version and update Gradle plugin in build.gradle
sharjeelyunus Nov 20, 2024
b3409a2
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Nov 25, 2024
fb67beb
fix: update .gitignore to correctly include node_modules directory
sharjeelyunus Nov 25, 2024
0968c52
Merge branch 'enable-modules-with-scripts' of https://github.com/Ense…
sharjeelyunus Nov 25, 2024
4daed7a
added scripts for chat, bracket, network, bluetooth
TheNoumanDev Nov 26, 2024
e2036c2
Merge branch 'enable-modules-with-scripts' of https://github.com/Ense…
TheNoumanDev Nov 26, 2024
c55018c
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Nov 26, 2024
a1c3758
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Nov 26, 2024
5fa9fa5
added script for biometric
TheNoumanDev Nov 27, 2024
7c86fa9
Merge branch 'enable-modules-with-scripts' of https://github.com/Ense…
TheNoumanDev Nov 27, 2024
bc7bd5f
fix: update Android build.gradle to configure Java compatibility
sharjeelyunus Nov 27, 2024
ec97534
Merge branch 'enable-modules-with-scripts' of https://github.com/Ense…
sharjeelyunus Nov 27, 2024
78d79be
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Nov 27, 2024
22c989c
fix
sharjeelyunus Nov 27, 2024
efe377e
Merge branch 'enable-modules-with-scripts' of https://github.com/Ense…
sharjeelyunus Nov 27, 2024
1936dfd
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Dec 2, 2024
8d7cced
fix: update FirebaseFirestore pod to version 10.25.0
sharjeelyunus Dec 4, 2024
1240bba
Revert "fix: update FirebaseFirestore pod to version 10.25.0"
sharjeelyunus Dec 4, 2024
f99e0dc
fix: update Firebase dependencies to version 11.4.0
sharjeelyunus Dec 5, 2024
65c58f8
fix: update Firebase dependencies to version 11.4.0
sharjeelyunus Dec 5, 2024
b662e91
fix: update GoogleUtilities dependencies to version 7.13.3 in Podfile…
sharjeelyunus Dec 5, 2024
fa0692c
fix: update GoogleUtilities dependencies to version 7.13.4 in Podfile…
sharjeelyunus Dec 5, 2024
626dd72
fix: update GoogleUtilities dependencies to version 8.0 in Podfile.lock
sharjeelyunus Dec 5, 2024
69e94d0
revert to firebase 10.25.0
sharjeelyunus Dec 5, 2024
f1b0733
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Dec 5, 2024
0388056
refactor: remove Firebase web configuration prompts for notifications
sharjeelyunus Dec 9, 2024
7906a1e
fix: update Firebase initialization to only run for Android and iOS p…
sharjeelyunus Dec 9, 2024
c2dfc8b
feat: enhance HTML update functionality to remove existing tags befor…
sharjeelyunus Dec 9, 2024
103f905
fix: conditionally update ensemble modules for Android and iOS platfo…
sharjeelyunus Dec 9, 2024
87b3853
feat: add description prompt for using location services always and w…
sharjeelyunus Dec 11, 2024
ec5654c
feat: add description for always and when in use location services on…
sharjeelyunus Dec 11, 2024
641990b
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Dec 11, 2024
ad0f676
fix: update EnsembleChat registration to use build method
sharjeelyunus Dec 12, 2024
cb67111
Merge branch 'enable-modules-with-scripts' of https://github.com/Ense…
sharjeelyunus Dec 12, 2024
66c6b6d
feat: add precise location description parameter for network info module
sharjeelyunus Dec 13, 2024
738dd6e
fix: wrap module answer values in quotes for proper formatting
sharjeelyunus Dec 13, 2024
6dad6e7
feat: update network info module to include necessary entitlements fo…
sharjeelyunus Dec 13, 2024
47d27fe
fix: ensure arguments are properly quoted in dart_runner.js for consi…
sharjeelyunus Dec 13, 2024
943cd92
refactor: simplify argument formatting in dart_runner.js by removing …
sharjeelyunus Dec 13, 2024
6a33150
fix: improve argument parsing in dart_runner.js to escape quotes and …
sharjeelyunus Dec 13, 2024
7b03977
feat: rename modules for consistency and add Google Maps and QR code …
sharjeelyunus Dec 17, 2024
04823eb
refactor: standardize key naming conventions across modules
sharjeelyunus Dec 17, 2024
b1c8275
feat: rename 'chat' module to 'ai_chat' for clarity and consistency
sharjeelyunus Dec 17, 2024
d7d1926
feat: add Firebase Web configuration prompts and simplify initializat…
sharjeelyunus Dec 18, 2024
6a0faca
feat: update command scripts for consistency and add new useConnect a…
sharjeelyunus Dec 18, 2024
0578bfd
feat: enhance error handling in findScript function and improve argum…
sharjeelyunus Dec 18, 2024
f58ff5e
feat: update authentication client ID prompts to be optional and adju…
sharjeelyunus Dec 19, 2024
1f046ac
feat: move precise location description validation to iOS permissions…
sharjeelyunus Dec 19, 2024
7bef38b
feat: rename command scripts to use 'has' prefix for clarity
sharjeelyunus Dec 19, 2024
42edfea
feat: update auth config to clear key values when no value is provided
sharjeelyunus Dec 19, 2024
c870a7b
feat: update web API argument names for consistency in firebase_utils
sharjeelyunus Dec 19, 2024
3acaeca
feat: rename command scripts to use 'has' prefix for clarity
sharjeelyunus Dec 19, 2024
b8cf3c3
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Dec 19, 2024
c3aa5a8
feat: remove getShaKeys script and related references
sharjeelyunus Dec 20, 2024
75656c8
feat: add TypeScript configuration and implement dart runner with arg…
sharjeelyunus Dec 20, 2024
01d6477
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Dec 22, 2024
34b3d0d
fix: android compile issue
sharjeelyunus Dec 23, 2024
de4b682
added: update Firebase configuration handling for multiple platforms
sharjeelyunus Dec 24, 2024
dae8abc
added: enhance Firebase configuration prompts for Android, iOS, and W…
sharjeelyunus Dec 24, 2024
c00fc05
fix: comment out Firebase configuration update in analytics and notif…
sharjeelyunus Dec 24, 2024
8c528db
added: implement Firebase configuration updates for Android build files
sharjeelyunus Dec 24, 2024
81ddc09
added: implement console log configuration for Firebase analytics
sharjeelyunus Dec 24, 2024
1efa839
added: enhance Firebase configuration for Android by adding implement…
sharjeelyunus Dec 24, 2024
8d63e45
refactor: update Firebase initialization and configuration handling i…
sharjeelyunus Dec 25, 2024
9e99bf6
refactor: streamline Firebase configuration updates for Android in an…
sharjeelyunus Dec 25, 2024
f96a658
added: implement ProGuard rules for Firebase and Google Play Services…
sharjeelyunus Dec 25, 2024
356dcee
refactor: modify iOS client ID format in Info.plist update function
sharjeelyunus Dec 25, 2024
722ba3e
refactor: enable Firebase initialization in analytics and notificatio…
sharjeelyunus Dec 25, 2024
7438a3a
refactor: add ProGuard rules for plaid connect
sharjeelyunus Dec 25, 2024
f9471cf
refactor: remove redundant code in updateAuthConfig function
sharjeelyunus Dec 26, 2024
bc0a6ca
refactor: add OpenJSSE and Conscrypt dependencies for Android in enab…
sharjeelyunus Dec 26, 2024
e0ef4ff
refactor: update ProGuard rules for OkHttp and Conscrypt in constants…
sharjeelyunus Dec 27, 2024
04b7890
refactor: enhance ProGuard rules for OkHttp, Conscrypt, Bouncy Castle…
sharjeelyunus Dec 27, 2024
0487db6
refactor: update build.gradle to disable minification and resource sh…
sharjeelyunus Dec 30, 2024
a1992c9
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Dec 30, 2024
0e263b5
feat: add platform-specific Firebase parameters for Android, iOS, and…
sharjeelyunus Dec 30, 2024
6805eef
feat: update parameter structure to include platform-specific require…
sharjeelyunus Dec 30, 2024
0d94acb
refactor: reorganize common parameters and scripts into utility_scrip…
sharjeelyunus Dec 31, 2024
c4898f5
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Dec 31, 2024
9912289
fix: remove unused authentication configuration keys
sharjeelyunus Dec 31, 2024
634ecfe
fix: add key to indicate app does not use non-exempt encryption for A…
sharjeelyunus Dec 31, 2024
642e1d1
fix: update iOS client ID handling to remove suffix and reverse format
sharjeelyunus Jan 1, 2025
4002841
feat: add Firebase Performance SDK integration script
sharjeelyunus Jan 1, 2025
a339310
fix: update dependency handling in Firebase Performance script
sharjeelyunus Jan 1, 2025
f97dbde
fix: remove unused ProGuard rules for connect module
sharjeelyunus Jan 1, 2025
e514d81
added moengage scripts
TheNoumanDev Jan 3, 2025
f3489d8
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Jan 3, 2025
adf6630
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Jan 3, 2025
afadc49
fix use latest version
sharjeelyunus Jan 3, 2025
ab29a7b
refactor: update ProGuard rules for Firebase integration
sharjeelyunus Jan 3, 2025
e891385
FIXME: adding proguard rules for now for moengage (remove it later)
sharjeelyunus Jan 3, 2025
21db6a4
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Jan 6, 2025
4cd4963
refactor: remove ProGuard rules file for moengage
sharjeelyunus Jan 6, 2025
af0dae9
Merge branch 'enable-modules-with-scripts' of https://github.com/Ense…
sharjeelyunus Jan 6, 2025
ac48c26
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Jan 7, 2025
107c3bf
chore: update FirebaseFirestore pod to version 11.6.0
sharjeelyunus Jan 7, 2025
f8ca8dd
chore: comment out Apple Sign In entitlement key in Runner.entitlements
sharjeelyunus Jan 7, 2025
ecdf74c
chore: comment out Apple Sign In entitlement key in Runner.entitlements
sharjeelyunus Jan 7, 2025
b33a7ca
Merge branch 'main' into enable-modules-with-scripts
sharjeelyunus Jan 8, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
49 changes: 49 additions & 0 deletions .github/workflows/starter-commands.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Test Commands in Starter

on:
pull_request:
branches:
- main

jobs:
test-modules:
runs-on: ubuntu-latest
timeout-minutes: 20
defaults:
run:
working-directory: starter

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Flutter SDK
uses: subosito/flutter-action@v2
with:
channel: 'stable'

- name: Set up Node.js
uses: actions/setup-node@v2

- name: Install dependencies
run: npm install

- name: Run hasCamera command
run: npm run hasCamera platform="ios,android" cameraDescription="Hello world"
continue-on-error: false

- name: Run hasFileManager command
run: npm run hasFileManager platform="ios,android" photoLibraryDescription="Hello" musicDescription="world"
continue-on-error: false

- name: Run hasContacts command
run: npm run hasContacts contactsDescription="Hello world" platform="ios,android"
continue-on-error: false

- name: Run hasConnect command
run: npm run hasConnect platform="ios,android" cameraDescription="Hello world" contactsDescription="Hello world"
continue-on-error: false

- name: Run hasLocation command
run: npm run hasLocation platform="ios,android" locationDescription="Hello world" alwaysUseLocationDescription="Hello world" inUseLocationDescription="Hello world"
continue-on-error: false
4 changes: 3 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,8 @@ pubspec_overrides.yaml
/starter/ios/Flutter
starter/ios/Runner.xcodeproj/project.pbxproj
/node_modules
starter/node_modules
starter/package-lock.json

# FVM Version Cache
.fvm/
.fvm/
29 changes: 26 additions & 3 deletions starter/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,33 @@ allprojects {

rootProject.buildDir = '../build'
subprojects {
afterEvaluate { project ->
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just to log, can you share which modules still breaks with out this manual override?

This was specifically add for high_chart which we removed, might want to update/remove other modules instead of force update on all package

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think these modules causes the problems

  • Auth
  • Camera (QR Code)
  • Connect

Not sure if others too, have to create builds 1 by 1 for each to be sure

if (project.extensions.findByName("android") != null) {
Integer pluginCompileSdk = project.android.compileSdk
if (pluginCompileSdk != null && pluginCompileSdk < 34) {

def javaVersion = JavaVersion.VERSION_17
project.android {
compileSdk 34
if (namespace == null) {
namespace project.group
}
compileOptions {
sourceCompatibility javaVersion
targetCompatibility javaVersion
}
tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).configureEach {
kotlinOptions {
jvmTarget = javaVersion.toString()
}
}
}
}
}
}

project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
project.evaluationDependsOn(":app")
}

tasks.register("clean", Delete) {
Expand Down
4 changes: 4 additions & 0 deletions starter/ios/Runner/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -71,5 +71,9 @@
<string>filza</string>
<string>activator</string>
</array>

<!-- To indicate that app does not use non-exempt (custom) encryption. Required for App Store submission, Otherwise, you need do it manually in App Store Connect -->
<key>ITSAppUsesNonExemptEncryption</key>
<false/>
</dict>
</plist>
11 changes: 7 additions & 4 deletions starter/lib/generated/ensemble_modules.dart
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,10 @@ import 'package:get_it/get_it.dart';
// Uncomment to enable deeplink services
// import 'package:ensemble_deeplink/deferred_link_manager.dart';

// Uncomment to enable push notifications services or Firebase Analytics
// import 'package:flutter/foundation.dart';
// import 'dart:io';

/// TODO: This class should be generated to enable selected Services
class EnsembleModules {
static final EnsembleModules _instance = EnsembleModules._internal();
Expand Down Expand Up @@ -168,13 +172,13 @@ class EnsembleModules {

if (enableChat) {
// Uncomment to enable ensemble chat
// GetIt.I.registerSingleton<EnsembleChat>(EnsembleChatImpl());
// GetIt.I.registerSingleton<EnsembleChat>(EnsembleChatImpl.build(null));
} else {
GetIt.I.registerSingleton<EnsembleChat>(const EnsembleChatStub());
}
if (useFirebaseAnalytics) {
//uncomment to enable firebase analytics
//GetIt.I.registerSingleton<LogProvider>(FirebaseAnalyticsProvider());
// GetIt.I.registerSingleton<LogProvider>(FirebaseAnalyticsProvider());
} else {
GetIt.I.registerSingleton<LogProvider>(LogProviderStub());
}
Expand All @@ -194,8 +198,7 @@ class EnsembleModules {
}

if (useBluetooth) {

//GetIt.I.registerSingleton<BluetoothManager>(BluetoothManagerImpl());
//GetIt.I.registerSingleton<BluetoothManager>(BluetoothManagerImpl());
} else {
GetIt.I.registerSingleton<BluetoothManager>(BluetoothManagerStub());
}
Expand Down
46 changes: 46 additions & 0 deletions starter/package.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"name": "starter",
"version": "1.0.0",
"description": "This starter project enables running and deploying Ensemble-powered Apps across iOS, Android, and Web (other platforms are not yet fully supported). It also includes examples on how to integrate Ensemble pages into your existing Flutter App.",
"main": "index.js",
"directories": {
"lib": "lib",
"test": "test"
},
"scripts": {
"build": "tsc",
"enable": "ts-node src/dart_runner.ts enable",
"hasCamera": "ts-node src/dart_runner.ts camera",
"hasFileManager": "ts-node src/dart_runner.ts file_manager",
"hasContacts": "ts-node src/dart_runner.ts contacts",
"hasConnect": "ts-node src/dart_runner.ts plaid_connect",
"hasLocation": "ts-node src/dart_runner.ts location",
"hasDeeplink": "ts-node src/dart_runner.ts deeplink",
"hasFirebaseAnalytics": "ts-node src/dart_runner.ts firebase_analytics",
"hasMoengage": "ts-node src/dart_runner.ts moengage",
"hasNotification": "ts-node src/dart_runner.ts notification",
"hasBracket": "ts-node src/dart_runner.ts bracket",
"hasNetworkInfo": "ts-node src/dart_runner.ts network_info",
"hasChat": "ts-node src/dart_runner.ts ai_chat",
"hasAuth": "ts-node src/dart_runner.ts auth",
"hasBluetooth": "ts-node src/dart_runner.ts bluetooth",
"hasBiometric": "ts-node src/dart_runner.ts biometric",
"qrCodeEnabled": "ts-node src/dart_runner.ts qr_code",
"hasGoogleMaps": "ts-node src/dart_runner.ts google_maps",
"generate_keystore": "ts-node src/dart_runner.ts generateKeystore"
},
"keywords": [],
"author": "",
"license": "ISC",
"dependencies": {
"inquirer": "^12.0.0",
"prompts": "^2.4.2"
},
"devDependencies": {
"@types/inquirer": "^9.0.7",
"@types/node": "^22.10.2",
"@types/prompts": "^2.4.9",
"ts-node": "^10.9.2",
"typescript": "^5.7.2"
}
}
26 changes: 11 additions & 15 deletions starter/pubspec.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: ensemble_starter
description: Ensemble Starter project in Flutter
# The following line prevents the package from being accidentally published to
# pub.dev using `flutter pub publish`. This is preferred for private packages.
publish_to: "none" # Remove this line if you wish to publish to pub.dev
publish_to: 'none' # Remove this line if you wish to publish to pub.dev

# The following defines the version and build number for your application.
# A version number is three numbers separated by dots, like 1.2.43
Expand Down Expand Up @@ -36,7 +36,7 @@ dependencies:
ensemble:
git:
url: https://github.com/EnsembleUI/ensemble.git
ref: ensemble-v1.1.12
ref: ensemble-v1.1.13
path: modules/ensemble


Expand Down Expand Up @@ -103,12 +103,10 @@ dependencies:

# Uncomment to enable firebase analytics
# ensemble_firebase_analytics:
# git:
# url: https://github.com/EnsembleUI/ensemble.git
# ref: main
# path: modules/firebase_analytics


# git:
# url: https://github.com/EnsembleUI/ensemble.git
# ref: main
# path: modules/firebase_analytics

# Uncomment to enable ensemble chat widget
# ensemble_chat:
Expand All @@ -124,14 +122,12 @@ dependencies:
# ref: main
# path: modules/bracket


# Uncomment to enable NetworkInfo
# ensemble_network_info:
# git:
# url: https://github.com/EnsembleUI/ensemble.git
# ref: main
# path: modules/ensemble_network_info

# ensemble_network_info:
# git:
# url: https://github.com/EnsembleUI/ensemble.git
# ref: main
# path: modules/ensemble_network_info

# The following adds the Cupertino Icons font to your application.
# Use with the CupertinoIcons class for iOS style icons.
Expand Down
14 changes: 14 additions & 0 deletions starter/scripts/constants.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
const firebaseProguardRules = '''
# Keep Google Play Services classes
-keep class com.google.android.gms.** { *; }
-keep interface com.google.android.gms.** { *; }
-dontwarn com.google.android.gms.**

# Keep Firebase-related classes
-keep class com.google.firebase.** { *; }
-dontwarn com.google.firebase.**

# Keep other necessary classes for Flutter
-keep class io.flutter.** { *; }
-dontwarn io.flutter.**
''';
85 changes: 85 additions & 0 deletions starter/scripts/firebase_performance.dart
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
import 'dart:io';

import 'utils.dart';
import 'utils/firebase_utils.dart';
import 'utils/proguard_utils.dart';
import 'constants.dart';

// Adds the Firebase Performance SDK to the project
void main(List<String> arguments) {
List<String> platforms = getPlatforms(arguments);

try {
addDependency('firebase_performance', '^0.10.0+11');

if (platforms.contains('android')) {
createProguardRules(firebaseProguardRules);
addClasspathDependency(
"classpath 'com.google.firebase:perf-plugin:1.4.2'");
addPluginDependency("apply plugin: 'com.google.firebase.firebase-perf'");
}

// Configure iOS-specific settings
if (platforms.contains('ios')) {
addPod('FirebasePerformance');
}

print(
'Firebase Performance SDK enabled successfully for ${platforms.join(', ')}! 🎉');
exit(0);
} catch (e) {
print('Starter Error: $e');
exit(1);
}
}

void addPod(String pod) {
final podfile = File('ios/Podfile');
if (!podfile.existsSync()) {
throw 'ios/Podfile not found';
}

final lines = podfile.readAsLinesSync();
final newLines = <String>[];
bool added = false;

for (var line in lines) {
newLines.add(line);
if (line.contains('use_frameworks!')) {
newLines.add(" pod '$pod'");
added = true;
}
}

if (!added) {
throw 'use_frameworks! not found in ios/Podfile';
}

podfile.writeAsStringSync(newLines.join('\n'));
}

void addDependency(String dependency, String version) {
final pubspec = File(pubspecFilePath);
if (!pubspec.existsSync()) {
throw 'pubspec.yaml not found';
}

final content = pubspec.readAsStringSync();
final dependenciesSection =
RegExp(r'dependencies:', multiLine: true).firstMatch(content);

if (dependenciesSection == null) {
throw 'dependencies section not found in pubspec.yaml';
}

final dependencyPattern = RegExp(r'\s+$dependency:\s+\S+');
if (dependencyPattern.hasMatch(content)) {
return;
}
final newContent = content.replaceFirst(
dependenciesSection.group(0)!,
'${dependenciesSection.group(0)}\n $dependency: $version\n',
);

pubspec.writeAsStringSync(newContent);
}
Loading
Loading