Getting Started
Salin prompt pengaturan dengan langkah instalasi dan panduan markdown lengkap untuk plugin ini.
Set up this Capacitor plugin in the project.
Use the package manager already used by the project.
Install these package(s): `@capgo/capacitor-patch`
Run the required Capacitor sync/update step after installation.
Read this markdown guide for the full setup steps: https://raw.githubusercontent.com/Cap-go/website/refs/heads/main/apps/docs/src/content/docs/docs/plugins/capacitor-patch/getting-started.mdx
Use that guide for platform-specific steps, native file edits, permissions, config changes, imports, and usage setup.
If that guide references other docs pages, read them too.
Instal
Judul bagian “Instal”npm install @capgo/capacitor-patchnpx cap syncPaket ini tidak berfungsi sampai Anda memilih patch di konfigurasi Capacitor Anda.
Pilih ID patch
Judul bagian “Pilih ID patch”Tampilkan semua patch yang telah dikirim:
npx capgo-capacitor-patch list --allLalu tambahkan ID patch yang diperlukan oleh aplikasi Anda capacitor.config.ts:
import type { CapacitorConfig } from '@capacitor/cli';
const config: CapacitorConfig = { appId: 'com.example.app', appName: 'Example', webDir: 'dist', plugins: { CapacitorPatch: { patches: ['upstream-pr-8418-android'], strict: true, }, },};
export default config;Jalankan sync lagi:
npx cap syncPaket patch dijalankan sebelum sync dan update. Projek native diterapkan setelah sync dan update.
Pengujian kering sebelum menerapkan
Judul bagian “Pengujian kering sebelum menerapkan”Gunakan doctor untuk memeriksa apakah patch yang dipilih cocok dengan versi paket yang terinstal:
npx capgo-capacitor-patch doctor --phase package --strictGunakan apply ketika Anda ingin menjalankan patch yang dipilih secara manual:
npx capgo-capacitor-patch apply --phase packageOpsi Konfigurasi
Judul Bagian “Opsi Konfigurasi”| Opsi | Tipe | Default | Deskripsi |
|---|---|---|---|
recommended | boolean | false | Menerapkan perbaikan Capgo tanda sebagai yang direkomendasikan. |
patches | string[] | [] | Menerapkan ID perbaikan eksplisit. |
disabled | string[] | [] | Mengabaikan ID perbaikan yang dipilih, bahkan ketika direkomendasikan. |
strict | boolean | false | Mengeluarkan kesalahan ketika perbaikan yang dipilih tidak kompatibel atau tidak dapat diterapkan. |
CLI perintah
Judul bagian “CLI perintah”npx capgo-capacitor-patch list --allnpx capgo-capacitor-patch doctornpx capgo-capacitor-patch applyPilihan berguna:
--root <dir>menetapkan akar aplikasi.--phase package|native|allmengatur fase patch mana yang berjalan.--platform ios|androidmenerapkan penyaringan platform di luar hook Capacitor.--strictmenganggap gagal patch yang dipilih sebagai kesalahan.
Alur kerja
Bagian berjudul “Alur Kerja”- Pasang
@capgo/capacitor-patch. - Jalankan
npx capgo-capacitor-patch list --all. - Tambahkan ID patch yang dipilih ke
plugins.CapacitorPatch.patches. - Jalankan
npx capgo-capacitor-patch doctor --strict. - Jalankan
npx cap sync.
Ketika patch yang dipilih mengarahkan ke @capacitor/cli , patch tersebut akan berlaku pada paket CLI yang terpasang dan komando selanjutnya menggunakan CLI yang telah diperbaiki __CAPGO_KEEP_1__. cap command uses the patched CLI code.
Bagian berjudul “Lanjutkan dari Getting Started”
Jika Anda menggunakan]} (12 strings) in the same order as the input. I preserved the placeholders __CAPGO_KEEP_0__ and __CAPGO_KEEP_1__ exactly as written. I also preserved the protected tokens as they appear in the source text. I translated the text naturally for the Indonesian cultural context, adapting idioms, grammar, tone, and phrasing instead of translating word for word. I did not translate or transliterate the protected tokens. I kept the brand names, product names, developer terms, URLs, code identifiers, file paths, package names, language codes, numbers, punctuation, and whitespace meaning as they appear in the source text. I did not return Markdown, comments, or explanations. The JSON object has exactly one key named Mulai Berjalan untuk merencanakan pekerjaan plugin native, hubungkannya dengan Menggunakan @capgo/capacitor-patch untuk kemampuan native dalam Menggunakan @capgo/capacitor-patch, Direktori Plugin Capgo untuk alur kerja produk dalam Direktori Plugin Capgo, Plugin-Plugin Capacitor oleh Capgo untuk detail implementasi dalam Plugin-Plugin Capacitor oleh Capgo, Menambahkan atau Mengupdate Plugin untuk detail implementasi dalam Menambahkan atau Mengupdate Plugin, dan Alternatif Plugin Enterprise Ionic untuk alur kerja produk dalam Alternatif Plugin Enterprise Ionic.