- Add build number/timestamp display on login screen - Improve error message when beneficiary has no deployment (user-friendly text instead of crash) - Fix verify-otp screen layout for Android (smaller spacing, icon sizes) - Add KeyboardAvoidingView to setup-wifi screen - Save WiFi passwords per SSID (auto-fill on reconnect) - Suppress BLE "operation cancelled" noise in logs - Add build-info generation script (npm run build-info) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
42 lines
1.3 KiB
JavaScript
42 lines
1.3 KiB
JavaScript
#!/usr/bin/env node
|
|
|
|
/**
|
|
* Generates build-info.ts with auto-incrementing build number and timestamp.
|
|
* Run before each build: node scripts/generate-build-info.js
|
|
*/
|
|
|
|
const fs = require('fs');
|
|
const path = require('path');
|
|
|
|
const BUILD_INFO_PATH = path.join(__dirname, '..', 'constants', 'build-info.ts');
|
|
|
|
// Read current build number
|
|
let buildNumber = 0;
|
|
try {
|
|
const existing = fs.readFileSync(BUILD_INFO_PATH, 'utf8');
|
|
const match = existing.match(/BUILD_NUMBER\s*=\s*(\d+)/);
|
|
if (match) {
|
|
buildNumber = parseInt(match[1], 10);
|
|
}
|
|
} catch {
|
|
// First build
|
|
}
|
|
|
|
buildNumber++;
|
|
|
|
const now = new Date();
|
|
const timestamp = now.toISOString();
|
|
// Short format for UI: "Jan 28, 08:15"
|
|
const shortDate = now.toLocaleDateString('en-US', { month: 'short', day: 'numeric' });
|
|
const shortTime = now.toLocaleTimeString('en-US', { hour: '2-digit', minute: '2-digit', hour12: false });
|
|
|
|
const content = `// Auto-generated by scripts/generate-build-info.js
|
|
// DO NOT EDIT MANUALLY
|
|
export const BUILD_NUMBER = ${buildNumber};
|
|
export const BUILD_TIMESTAMP = '${timestamp}';
|
|
export const BUILD_DISPLAY = 'build ${buildNumber} · ${shortDate}, ${shortTime}';
|
|
`;
|
|
|
|
fs.writeFileSync(BUILD_INFO_PATH, content, 'utf8');
|
|
console.log(`Build info generated: #${buildNumber} at ${timestamp}`);
|