- Fix System Status card to show correct plugin availability - Add automatic status check on component mount - Remove HomeViewSimple.vue (no longer needed) - Fix Vue 3 compatibility issues (@click.native removal) - Add comprehensive plugin diagnostics with all available plugins - Implement post-sync script to maintain capacitor.plugins.json - Add annotation processor for automatic plugin discovery The DailyNotification plugin now loads correctly and both System Status and Plugin Diagnostics show consistent, accurate information.
59 lines
1.6 KiB
JavaScript
Executable File
59 lines
1.6 KiB
JavaScript
Executable File
#!/usr/bin/env node
|
|
|
|
/**
|
|
* Post-sync script to fix capacitor.plugins.json
|
|
* This ensures the DailyNotification plugin is always registered
|
|
* even after npx cap sync overwrites the file
|
|
*
|
|
* @author Matthew Raymer
|
|
*/
|
|
|
|
import fs from 'fs';
|
|
import path from 'path';
|
|
import { fileURLToPath } from 'url';
|
|
|
|
const __filename = fileURLToPath(import.meta.url);
|
|
const __dirname = path.dirname(__filename);
|
|
|
|
const PLUGINS_JSON_PATH = path.join(__dirname, '../android/app/src/main/assets/capacitor.plugins.json');
|
|
|
|
const PLUGIN_ENTRY = {
|
|
name: "DailyNotification",
|
|
classpath: "com.timesafari.dailynotification.DailyNotificationPlugin"
|
|
};
|
|
|
|
function fixCapacitorPlugins() {
|
|
console.log('🔧 Fixing capacitor.plugins.json...');
|
|
|
|
try {
|
|
// Read current content
|
|
let plugins = [];
|
|
if (fs.existsSync(PLUGINS_JSON_PATH)) {
|
|
const content = fs.readFileSync(PLUGINS_JSON_PATH, 'utf8');
|
|
plugins = JSON.parse(content);
|
|
}
|
|
|
|
// Check if our plugin is already there
|
|
const hasPlugin = plugins.some(p => p.name === PLUGIN_ENTRY.name);
|
|
|
|
if (!hasPlugin) {
|
|
plugins.push(PLUGIN_ENTRY);
|
|
fs.writeFileSync(PLUGINS_JSON_PATH, JSON.stringify(plugins, null, 2));
|
|
console.log('✅ Added DailyNotification plugin to capacitor.plugins.json');
|
|
} else {
|
|
console.log('✅ DailyNotification plugin already exists in capacitor.plugins.json');
|
|
}
|
|
|
|
} catch (error) {
|
|
console.error('❌ Error fixing capacitor.plugins.json:', error.message);
|
|
process.exit(1);
|
|
}
|
|
}
|
|
|
|
// Run if called directly
|
|
if (import.meta.url === `file://${process.argv[1]}`) {
|
|
fixCapacitorPlugins();
|
|
}
|
|
|
|
export { fixCapacitorPlugins };
|