mobile-snap 1.0.4 → 1.0.6

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.
Files changed (4) hide show
  1. package/README.html +62 -62
  2. package/README.md +83 -78
  3. package/bin/cli.js +1039 -1015
  4. package/package.json +1 -1
package/README.html CHANGED
@@ -1,9 +1,9 @@
1
1
  <!DOCTYPE html>
2
- <html lang="id">
2
+ <html lang="en">
3
3
  <head>
4
4
  <meta charset="UTF-8">
5
5
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
6
- <title>MobileSnap - Dokumentasi & Arsitektur</title>
6
+ <title>MobileSnap - Documentation & Architecture</title>
7
7
  <!-- Google Fonts -->
8
8
  <link rel="preconnect" href="https://fonts.googleapis.com">
9
9
  <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
@@ -586,7 +586,7 @@
586
586
  <div class="header-glow"></div>
587
587
  <div class="container">
588
588
  <h1>MobileSnap 📸</h1>
589
- <p class="tagline">Otomasi Pixel-Precise App Store & Play Store Screenshots dari Server Lokal secara Dual-Vendor menggunakan NPX.</p>
589
+ <p class="tagline">Automate pixel-precise App Store & Google Play screenshots directly from your local development server using NPX.</p>
590
590
 
591
591
  <div class="badge-container">
592
592
  <div class="badge">
@@ -603,10 +603,10 @@
603
603
  </header>
604
604
 
605
605
  <div class="container">
606
- <!-- Contoh Output (Mockup Premium) -->
606
+ <!-- Sample Output Mockups -->
607
607
  <section class="glass-card">
608
- <h2>📱 Contoh Output (Mockup Premium)</h2>
609
- <p style="color: var(--text-muted); margin-bottom: 1.5rem;">Visualisasi nyata dari tangkapan layar yang dibungkus otomatis ke dalam bingkai mockup perangkat premium menggunakan opsi <code>-m</code> atau <code>--mockup</code>:</p>
608
+ <h2>📱 Sample Output (Premium Mockups)</h2>
609
+ <p style="color: var(--text-muted); margin-bottom: 1.5rem;">Real-world visualization of screenshots automatically wrapped in premium device mockup frames using the <code>-m</code> or <code>--mockup</code> option:</p>
610
610
  <div style="display: flex; justify-content: center; gap: 2rem; flex-wrap: wrap; margin-top: 1.5rem;">
611
611
  <div style="text-align: center; max-width: 45%; min-width: 280px;">
612
612
  <h4 style="margin-bottom: 0.5rem; color: #fff;">iOS (iPhone 6.7" Pro Max)</h4>
@@ -619,38 +619,38 @@
619
619
  </div>
620
620
  </section>
621
621
 
622
- <!-- Arsitektur Utama -->
622
+ <!-- Workflow Architecture -->
623
623
  <section class="glass-card">
624
- <h2>🏗️ Arsitektur Aliran Kerja</h2>
625
- <p style="color: var(--text-muted); margin-bottom: 1.5rem;">MobileSnap dibangun menggunakan <strong>Commander</strong> untuk antarmuka CLI yang kaya, dan <strong>Playwright Node API</strong> untuk mengontrol Chromium secara berurutan pada berbagai dimensi.</p>
624
+ <h2>🏗️ Workflow Architecture</h2>
625
+ <p style="color: var(--text-muted); margin-bottom: 1.5rem;">MobileSnap is built using <strong>Commander</strong> for a rich CLI interface, and the <strong>Playwright Node API</strong> to control Chromium sequentially across various dimensions.</p>
626
626
 
627
627
  <div class="arch-flow">
628
628
  <div class="arch-node">
629
629
  <div class="node-num">1</div>
630
630
  <h4>CLI Parser</h4>
631
- <p>Membaca parameter URL, rute (paths), platform target, dan folder keluaran.</p>
631
+ <p>Parses URL parameters, routes (paths), target platforms, and the output directory.</p>
632
632
  </div>
633
633
  <div class="arch-node">
634
634
  <div class="node-num">2</div>
635
635
  <h4>Browser Engine</h4>
636
- <p>Inisiasi Chromium secara terisolasi dan asinkronus.</p>
636
+ <p>Launches Chromium in an isolated and asynchronous instance.</p>
637
637
  </div>
638
638
  <div class="arch-node">
639
639
  <div class="node-num">3</div>
640
640
  <h4>Viewport Emulation</h4>
641
- <p>Meniru dimensi layar Retina (iOS) & Android secara dinamis.</p>
641
+ <p>Dynamically emulates Retina (iOS) & Android display dimensions.</p>
642
642
  </div>
643
643
  <div class="arch-node">
644
644
  <div class="node-num">4</div>
645
645
  <h4>Hydration Check</h4>
646
- <p>Menunggu aktivitas jaringan idle agar rendering JavaScript selesai.</p>
646
+ <p>Waits for network idle state to ensure JavaScript rendering is fully complete.</p>
647
647
  </div>
648
648
  </div>
649
649
  </section>
650
650
 
651
- <!-- Target Dimensi -->
651
+ <!-- Target Dimensions Requirement -->
652
652
  <section class="glass-card">
653
- <h2>📱 Dimensi Layar Target (Wajib Store)</h2>
653
+ <h2>📱 Target Screen Dimensions (Store Requirements)</h2>
654
654
 
655
655
  <h3>🍎 iOS (Apple App Store)</h3>
656
656
  <div class="device-showcase">
@@ -662,8 +662,8 @@
662
662
  <div class="device-info">
663
663
  <h4>iPhone 6.7" Display</h4>
664
664
  <div class="resolution">1290 x 2796 pixels</div>
665
- <p>Digunakan untuk jajaran iPhone Max/Pro Max terbaru.</p>
666
- <p style="margin-top: 0.5rem; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem;">Berkas: 6.7_inch_[path].png</p>
665
+ <p>Used for the latest iPhone Max/Pro Max models.</p>
666
+ <p style="margin-top: 0.5rem; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem;">File: 6.7_inch_[path].png</p>
667
667
  </div>
668
668
  </div>
669
669
 
@@ -675,8 +675,8 @@
675
675
  <div class="device-info">
676
676
  <h4>iPhone 6.5" Display</h4>
677
677
  <div class="resolution">1242 x 2688 pixels</div>
678
- <p>Digunakan untuk seri iPhone Xs Max / 11 Pro Max.</p>
679
- <p style="margin-top: 0.5rem; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem;">Berkas: 6.5_inch_[path].png</p>
678
+ <p>Used for the iPhone Xs Max / 11 Pro Max series.</p>
679
+ <p style="margin-top: 0.5rem; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem;">File: 6.5_inch_[path].png</p>
680
680
  </div>
681
681
  </div>
682
682
  </div>
@@ -691,8 +691,8 @@
691
691
  <div class="device-info">
692
692
  <h4>Android Phone</h4>
693
693
  <div class="resolution">1080 x 2400 pixels</div>
694
- <p>Rasio aspek modern 20:9 untuk Google Play Phone screenshots.</p>
695
- <p style="margin-top: 0.5rem; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem;">Berkas: android_phone_[path].png</p>
694
+ <p>Modern 20:9 aspect ratio for Google Play Phone screenshots.</p>
695
+ <p style="margin-top: 0.5rem; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem;">File: android_phone_[path].png</p>
696
696
  </div>
697
697
  </div>
698
698
 
@@ -704,17 +704,17 @@
704
704
  <div class="device-info">
705
705
  <h4>Android Tablet (10")</h4>
706
706
  <div class="resolution">1600 x 2560 pixels</div>
707
- <p>Dimensi tablet standar untuk kebutuhan rilis Google Play Tablet.</p>
708
- <p style="margin-top: 0.5rem; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem;">Berkas: android_tablet_[path].png</p>
707
+ <p>Standard tablet dimensions for Google Play Tablet release requirements.</p>
708
+ <p style="margin-top: 0.5rem; font-family: 'JetBrains Mono', monospace; font-size: 0.75rem;">File: android_tablet_[path].png</p>
709
709
  </div>
710
710
  </div>
711
711
  </div>
712
712
  </section>
713
713
 
714
- <!-- Cara Instalasi -->
714
+ <!-- NPX Usage -->
715
715
  <section class="glass-card">
716
- <h2>🚀 Cara Penggunaan Instan (NPX)</h2>
717
- <p style="color: var(--text-muted); margin-bottom: 1rem;">Anda tidak perlu melakukan penyiapan manual. Cukup gunakan <code>npx</code> untuk menjalankan MobileSnap.</p>
716
+ <h2>🚀 Instant Usage (NPX)</h2>
717
+ <p style="color: var(--text-muted); margin-bottom: 1rem;">You do not need any manual setup. Simply use <code>npx</code> to run MobileSnap instantly.</p>
718
718
 
719
719
  <div class="terminal">
720
720
  <div class="terminal-header">
@@ -728,38 +728,38 @@
728
728
  <div class="terminal-body">
729
729
  <button class="btn-copy" onclick="copyText('setup-cmds')">Copy</button>
730
730
  <pre id="setup-cmds" style="font-family: inherit;">
731
- <span class="terminal-comment"># 1. Jalankan instan menggunakan npx (ganti port sesuai server lokal Anda)</span>
731
+ <span class="terminal-comment"># 1. Run instantly using npx (change port according to your local server)</span>
732
732
  <span class="terminal-prompt">PS></span>npx mobile-snap --url http://localhost:4321
733
733
 
734
- <span class="terminal-comment"># 2. Opsional: Unduh browser binaries jika Playwright belum dikonfigurasi di sistem</span>
734
+ <span class="terminal-comment"># 2. Optional: Download browser binaries if Playwright is not yet configured in the system</span>
735
735
  <span class="terminal-prompt">PS></span>npx playwright install chromium</pre>
736
736
  </div>
737
737
  </div>
738
738
  </section>
739
739
 
740
- <!-- Interaktif Command Builder -->
740
+ <!-- Command Builder -->
741
741
  <section class="glass-card">
742
742
  <h2>⚡ CLI Command Builder (NPM / NPX)</h2>
743
- <p style="color: var(--text-muted);">Gunakan builder interaktif ini untuk membuat dan menyalin perintah sesuai kebutuhan pengembangan Anda:</p>
743
+ <p style="color: var(--text-muted);">Use this interactive builder to generate and copy the command that fits your development needs:</p>
744
744
 
745
745
  <div class="builder-container">
746
746
  <div class="grid-2">
747
747
  <div class="form-group">
748
- <label for="input-url">URL Dev Server Lokal</label>
748
+ <label for="input-url">Local Dev Server URL</label>
749
749
  <input type="text" id="input-url" class="form-control" value="http://localhost:4321" oninput="updateCommand()">
750
750
  </div>
751
751
  <div class="form-group">
752
- <label for="input-paths">Rute / Paths (pisahkan koma)</label>
752
+ <label for="input-paths">Routes / Paths (comma-separated)</label>
753
753
  <input type="text" id="input-paths" class="form-control" value="/" oninput="updateCommand()">
754
754
  </div>
755
755
  </div>
756
756
  <div class="grid-4">
757
757
  <div class="form-group">
758
- <label for="input-platform">Platform Target</label>
758
+ <label for="input-platform">Target Platform</label>
759
759
  <select id="input-platform" class="form-control" onchange="updateCommand()">
760
760
  <option value="ios">iOS (App Store)</option>
761
761
  <option value="android">Android (Play Store)</option>
762
- <option value="both">Both (iOS & Android Sekaligus)</option>
762
+ <option value="both">Both (iOS & Android Simultaneously)</option>
763
763
  </select>
764
764
  </div>
765
765
  <div class="form-group" style="display: flex; align-items: center; gap: 0.5rem; margin-top: 1.5rem;">
@@ -776,7 +776,7 @@
776
776
  </div>
777
777
  </div>
778
778
  <div class="form-group" style="margin-top: 1rem;">
779
- <label for="input-output">Folder Output</label>
779
+ <label for="input-output">Output Folder</label>
780
780
  <input type="text" id="input-output" class="form-control" value="mobilesnap_output" oninput="updateCommand()">
781
781
  </div>
782
782
 
@@ -787,121 +787,121 @@
787
787
  </div>
788
788
  </section>
789
789
 
790
- <!-- Detail Opsi Parameter -->
790
+ <!-- Parameters Table -->
791
791
  <section class="glass-card">
792
- <h2>⚙️ Parameter & Opsi CLI</h2>
792
+ <h2>⚙️ CLI Parameters & Options</h2>
793
793
  <table class="option-table">
794
794
  <thead>
795
795
  <tr>
796
- <th>Parameter</th>
796
+ <th>Option</th>
797
797
  <th>Alias</th>
798
- <th>Deskripsi</th>
799
- <th>Bawaan (Default)</th>
798
+ <th>Description</th>
799
+ <th>Default</th>
800
800
  </tr>
801
801
  </thead>
802
802
  <tbody>
803
803
  <tr>
804
804
  <td><span class="param-tag">--url</span></td>
805
805
  <td><span class="param-tag">-u</span></td>
806
- <td><strong>(Wajib)</strong> URL server lokal yang sedang berjalan (contoh: Astro).</td>
806
+ <td><strong>(Required)</strong> URL of the local development server (e.g., Astro).</td>
807
807
  <td>-</td>
808
808
  </tr>
809
809
  <tr>
810
810
  <td><span class="param-tag">--paths</span></td>
811
811
  <td><span class="param-tag">-p</span></td>
812
- <td>Daftar rute halaman yang dipisahkan dengan tanda koma.</td>
812
+ <td>Comma-separated list of routes to capture.</td>
813
813
  <td><code style="color: var(--secondary);">"/"</code></td>
814
814
  </tr>
815
815
  <tr>
816
816
  <td><span class="param-tag">--platform</span></td>
817
817
  <td><span class="param-tag">-l</span></td>
818
- <td>Platform yang ingin ditangkap: <code style="color: var(--secondary);">"ios"</code>, <code style="color: var(--secondary);">"android"</code>, atau <code style="color: var(--secondary);">"both"</code>.</td>
818
+ <td>Target platform to capture: <code style="color: var(--secondary);">"ios"</code>, <code style="color: var(--secondary);">"android"</code>, or <code style="color: var(--secondary);">"both"</code>.</td>
819
819
  <td><code style="color: var(--secondary);">"ios"</code></td>
820
820
  </tr>
821
821
  <tr>
822
822
  <td><span class="param-tag">--output</span></td>
823
823
  <td><span class="param-tag">-o</span></td>
824
- <td>Folder tujuan untuk menaruh berkas gambar hasil tangkapan.</td>
824
+ <td>Destination directory to save the screenshot files.</td>
825
825
  <td><code style="color: var(--secondary);">"mobilesnap_output"</code></td>
826
826
  </tr>
827
827
  <tr>
828
828
  <td><span class="param-tag">--crawl</span></td>
829
829
  <td><span class="param-tag">-c</span></td>
830
- <td>Menelusuri secara otomatis semua link internal dari halaman beranda.</td>
830
+ <td>Automatically discover and screenshot all internal links starting from the home page.</td>
831
831
  <td><code style="color: var(--secondary);">false</code></td>
832
832
  </tr>
833
833
  <tr>
834
834
  <td><span class="param-tag">--detect-pages</span></td>
835
835
  <td><span class="param-tag">-d</span></td>
836
- <td>Memindai direktori folder proyek lokal (Astro/Next.js) untuk rute statis.</td>
836
+ <td>Scan the local project directories (Astro/Next.js) for static routes.</td>
837
837
  <td><code style="color: var(--secondary);">false</code></td>
838
838
  </tr>
839
839
  <tr>
840
840
  <td><span class="param-tag">--email</span></td>
841
841
  <td>-</td>
842
- <td>Email / Username untuk autentikasi otomatis jika halaman memerlukan login.</td>
842
+ <td>Email / Username for automatic authentication if the page requires login.</td>
843
843
  <td>-</td>
844
844
  </tr>
845
845
  <tr>
846
846
  <td><span class="param-tag">--password</span></td>
847
847
  <td>-</td>
848
- <td>Password untuk autentikasi otomatis jika halaman memerlukan login (input disensor).</td>
848
+ <td>Password for automatic authentication if the page requires login (masked input).</td>
849
849
  <td>-</td>
850
850
  </tr>
851
851
  <tr>
852
852
  <td><span class="param-tag">--login-path</span></td>
853
853
  <td>-</td>
854
- <td>Jalur rute URL ke halaman login.</td>
854
+ <td>URL route path to the login page.</td>
855
855
  <td><code style="color: var(--secondary);">"/login.html"</code></td>
856
856
  </tr>
857
857
  <tr>
858
858
  <td><span class="param-tag">--html</span></td>
859
859
  <td>-</td>
860
- <td>Menambahkan ekstensi .html otomatis ke rute statis yang terdeteksi.</td>
860
+ <td>Automatically append .html extension to detected static routes.</td>
861
861
  <td><code style="color: var(--secondary);">false</code></td>
862
862
  </tr>
863
863
  <tr>
864
864
  <td><span class="param-tag">--mockup</span></td>
865
865
  <td><span class="param-tag">-m</span></td>
866
- <td>Membungkus tangkapan layar dalam bingkai mockup perangkat (iPhone/Android) dengan status bar dan bayangan transparan.</td>
866
+ <td>Wrap screenshots in a beautiful device mockup frame (iPhone/Android) with status bars and transparent drop shadows.</td>
867
867
  <td><code style="color: var(--secondary);">false</code></td>
868
868
  </tr>
869
869
  </tbody>
870
870
  </table>
871
871
  </section>
872
872
 
873
- <!-- Penanganan Masalah & Ketahanan -->
873
+ <!-- Resilience and Special Features -->
874
874
  <section class="glass-card">
875
- <h2>🛡️ Ketahanan Sistem & Fitur Khusus</h2>
875
+ <h2>🛡️ System Resilience & Special Features</h2>
876
876
 
877
877
  <div class="alert-box alert-warning">
878
878
  <div class="alert-icon">💡</div>
879
879
  <div class="alert-text">
880
- <h5>Skema Protokol URL & Auto-Normalisasi</h5>
881
- <p>MobileSnap secara otomatis mendeteksi jika URL tidak memiliki protokol (seperti <code>localhost:3000</code>) dan menambahkan <code>http://</code> secara dinamis.</p>
880
+ <h5>URL Protocol & Auto-Normalization</h5>
881
+ <p>MobileSnap automatically detects if the URL lacks a protocol prefix (e.g., <code>localhost:3000</code>) and prepends <code>http://</code> dynamically.</p>
882
882
  </div>
883
883
  </div>
884
884
 
885
885
  <div class="alert-box alert-warning">
886
886
  <div class="alert-icon">🌐</div>
887
887
  <div class="alert-text">
888
- <h5>User-Agent Dinamis per Platform</h5>
889
- <p>Ketika platform Android berjalan, mesin otomatisasi mengemulasi Agen Pengguna Android 13 (Pixel 7). Sedangkan untuk platform iOS, digunakan Agen Pengguna iPhone. Ini menjamin server memberikan respon tampilan yang tepat sesuai target vendor.</p>
888
+ <h5>Dynamic User-Agents per Platform</h5>
889
+ <p>When capturing for Android, the system emulates Android 13 (Pixel 7) user-agent. For iOS, it emulates iPhone. This guarantees that your server serves the appropriate layout for each specific vendor.</p>
890
890
  </div>
891
891
  </div>
892
892
 
893
893
  <div class="alert-box alert-warning">
894
894
  <div class="alert-icon">📁</div>
895
895
  <div class="alert-text">
896
- <h5>Skala Resolusi Retina (DPI 3x)</h5>
897
- <p>Semua screenshot ditangkap dengan pengaturan <code>deviceScaleFactor: 3</code> untuk menjaga kualitas output tetap tajam untuk standar unggahan store resmi.</p>
896
+ <h5>Retina Resolution Scale (DPI 3x)</h5>
897
+ <p>All screenshots are captured with <code>deviceScaleFactor: 3</code> to ensure the output remains ultra-sharp, complying with official store upload standards.</p>
898
898
  </div>
899
899
  </div>
900
900
  </section>
901
901
  </div>
902
902
 
903
903
  <footer>
904
- <p>&copy; 2026 MobileSnap CLI Tool. Dibuat dengan presisi visual untuk kebutuhan App Store & Play Store Anda.</p>
904
+ <p>&copy; 2026 MobileSnap CLI Tool. Crafted with visual precision for all your App Store & Play Store requirements.</p>
905
905
  </footer>
906
906
 
907
907
  <script>
@@ -942,9 +942,9 @@
942
942
  const textToCopy = isInner ? element.innerText : element.textContent;
943
943
 
944
944
  navigator.clipboard.writeText(textToCopy).then(() => {
945
- alert('Teks berhasil disalin ke clipboard!');
945
+ alert('Command copied to clipboard successfully!');
946
946
  }).catch(err => {
947
- console.error('Gagal menyalin teks: ', err);
947
+ console.error('Failed to copy text: ', err);
948
948
  });
949
949
  }
950
950
  </script>