@siranjeevan/releaseflow 1.1.0 → 1.1.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/index.js +34 -9
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -119,6 +119,23 @@ function getProjectPaths() {
|
|
|
119
119
|
throw new Error('Could not find pubspec.yaml. Please run this command inside your Flutter project folder.');
|
|
120
120
|
}
|
|
121
121
|
|
|
122
|
+
async function checkFlutterFireConfig() {
|
|
123
|
+
try {
|
|
124
|
+
const { root } = getProjectPaths();
|
|
125
|
+
const configPath = path.join(root, 'lib', 'firebase_options.dart');
|
|
126
|
+
|
|
127
|
+
if (!fs.existsSync(configPath)) {
|
|
128
|
+
console.log('\x1b[33m\nWarning: Your Flutter project is not yet linked to Firebase.\x1b[0m');
|
|
129
|
+
console.log('To prevent the "Splash Screen Freeze", you must run this command manually:');
|
|
130
|
+
console.log(' \x1b[36mflutterfire configure\x1b[0m\n');
|
|
131
|
+
return false;
|
|
132
|
+
}
|
|
133
|
+
return true;
|
|
134
|
+
} catch (e) {
|
|
135
|
+
return false;
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
|
|
122
139
|
function getPubspecVersion() {
|
|
123
140
|
try {
|
|
124
141
|
const { pubspec } = getProjectPaths();
|
|
@@ -247,24 +264,31 @@ async function runConfigureFlow() {
|
|
|
247
264
|
fs.writeFileSync(configLocation, JSON.stringify(config, null, 2));
|
|
248
265
|
console.log('\x1b[32mConfiguration saved successfully!\x1b[0m\n');
|
|
249
266
|
console.log(`\x1b[34mSaved to: ${configLocation}\x1b[0m`);
|
|
267
|
+
|
|
268
|
+
await checkFlutterFireConfig();
|
|
250
269
|
}
|
|
251
270
|
|
|
252
271
|
function runPromptFlow() {
|
|
253
272
|
console.log('\n\x1b[36m--- NEXT STEPS FOR YOUR FLUTTER APP ---\x1b[0m');
|
|
254
|
-
console.log('1. Manual UI:
|
|
255
|
-
console.log('2.
|
|
256
|
-
console.log('3. Security: Allow
|
|
273
|
+
console.log('1. Manual UI: Build a Force Update screen with an "Update Now" button.');
|
|
274
|
+
console.log('2. Integration: On your button\'s "onPressed:", add the code below.');
|
|
275
|
+
console.log('3. Security: Allow users to READ "app_config/version" in Firebase Rules.');
|
|
276
|
+
|
|
277
|
+
console.log('\n\x1b[35m--- BUTTON DART CODE (COPY THIS!) ---\x1b[0m');
|
|
278
|
+
console.log('// Place this in your button\'s onPressed:');
|
|
279
|
+
console.log('final url = doc["download_url"]; // Field name from the CLI');
|
|
280
|
+
console.log('if (await canLaunchUrl(Uri.parse(url))) {');
|
|
281
|
+
console.log(' await launchUrl(Uri.parse(url), mode: LaunchMode.externalApplication);');
|
|
282
|
+
console.log('}');
|
|
257
283
|
|
|
258
284
|
console.log('\n\x1b[33m--- VERIFICATION CHECKLIST (TEST YOUR UI) ---\x1b[0m');
|
|
259
|
-
console.log('
|
|
285
|
+
console.log('To confirm your navigation is working:');
|
|
260
286
|
console.log(' a. Run "releaseflow release" and set "Force Update" to TRUE.');
|
|
261
|
-
console.log(' b. Open your
|
|
262
|
-
console.log(' c.
|
|
287
|
+
console.log(' b. Open your app and click your "Update Now" button.');
|
|
288
|
+
console.log(' c. Verify: Does it open Chrome and download your new APK?');
|
|
263
289
|
|
|
264
|
-
console.log('\n\x1b[
|
|
265
|
-
console.log('Run these commands to start:');
|
|
290
|
+
console.log('\n\x1b[32m--- READY TO RELEASE? ---\x1b[0m');
|
|
266
291
|
console.log(' releaseflow release : Build and Upload your first APK.');
|
|
267
|
-
console.log(' releaseflow config show : Verify your current project settings.');
|
|
268
292
|
console.log(' releaseflow manual : View full Flutter integration guide.\n');
|
|
269
293
|
}
|
|
270
294
|
|
|
@@ -301,6 +325,7 @@ function runShowConfig() {
|
|
|
301
325
|
}
|
|
302
326
|
|
|
303
327
|
async function runFullReleaseFlow() {
|
|
328
|
+
await checkFlutterFireConfig();
|
|
304
329
|
console.log('\x1b[34mChecking versions and history...\x1b[0m');
|
|
305
330
|
|
|
306
331
|
const liveVersion = await getLiveVersion();
|