UNPKG

progresspulse-pwa

Version:

A modern PWA for tracking progress and achieving goals with iPhone-style design

75 lines (57 loc) โ€ข 2.79 kB
#!/usr/bin/env node const fs = require('fs'); const path = require('path'); const { execSync } = require('child_process'); console.log('๐Ÿš€ Starting deployment process...'); // Step 1: Increment version console.log('๐Ÿ“ฆ Incrementing version...'); execSync('npm version patch', { stdio: 'inherit' }); // Step 2: Generate update manifest console.log('๐Ÿ“ Generating update manifest...'); execSync('node scripts/generate-update-manifest.cjs', { stdio: 'inherit' }); // Step 3: Build the project console.log('๐Ÿ—๏ธ Building project...'); execSync('npm run build', { stdio: 'inherit' }); // Step 4: Regenerate manifest for dist (in case build overwrote it) console.log('๐Ÿ”„ Regenerating manifest for dist...'); execSync('node scripts/generate-update-manifest.cjs', { stdio: 'inherit' }); // Step 5: Publish to NPM console.log('๐Ÿ“ค Publishing to NPM...'); execSync('npm publish', { stdio: 'inherit' }); // Step 6: Create deployment instructions const packageJson = JSON.parse(fs.readFileSync('package.json', 'utf8')); const newVersion = packageJson.version; const deploymentInstructions = ` ๐ŸŽ‰ DEPLOYMENT COMPLETE - Version ${newVersion} ๐Ÿ“ FILES TO UPLOAD TO YOUR DOMAIN: Upload the entire 'dist/' folder contents to your web server ๐Ÿ”— CRITICAL FILES FOR UPDATES: โœ… dist/update-manifest.json (Contains version info) โœ… dist/version.json (For service worker) โœ… dist/sw-notifications.js (Background notifications) โœ… dist/sw.js (Main service worker) ๐ŸŒ DEPLOYMENT STEPS: 1. Upload all files from 'dist/' to your domain 2. Ensure update-manifest.json is accessible at: https://yourdomain.com/update-manifest.json 3. Test by visiting: https://yourdomain.com/update-manifest.json 4. Users will automatically get update notifications within 24 hours ๐Ÿงช TESTING UPDATES: 1. Deploy this version to your domain 2. Wait 5 minutes for CDN cache to clear 3. Open your app in browser 4. Go to Settings โ†’ Updates โ†’ Check for Updates 5. Should show version ${newVersion} available ๐Ÿ“ฑ APK USERS: - Will receive background notifications about the update - Can update by visiting your domain in their APK browser - Or download new APK from PWA Builder with this version ๐Ÿ”” NOTIFICATION TESTING: - Daily reminders will work in background - Update notifications will appear automatically - Test notifications work immediately โœ… Your app is now ready for production deployment! `; console.log(deploymentInstructions); // Write instructions to file fs.writeFileSync('DEPLOYMENT_INSTRUCTIONS.txt', deploymentInstructions); console.log('๐Ÿ“„ Deployment instructions saved to DEPLOYMENT_INSTRUCTIONS.txt');