Maintaining a fork of the Cordova local-notifications plugin
Not every repository starts life as your own code — some are forks you maintain because a project you depend on needed a fix. cordova-plugin-local-notifications is my fork of the well-known Cordova plugin (by Katzer) that lets hybrid mobile apps show local notifications — alarms, reminders, badges — while the app is not in the foreground.
What local notifications are
Unlike push notifications (sent from a server), local notifications are scheduled by the app itself and delivered by the OS at the right moment: "appointment in 10 minutes", a daily reminder, a badge count. They are ideal for calendar- and to-do-style apps, and they work with no backend at all.
Why fork instead of patch locally
When you cordova plugin add, npm pulls a pinned copy. If you need a behaviour
the upstream lacks, your options are: patch node_modules (lost on every
install), maintain a private plugin (fine, but invisible), or fork publicly and pin your
package.json to the fork. The fork keeps a visible history of exactly what I
changed and why — which is the whole point of using git for this.
Beginner lessons from maintaining a fork
- Track upstream. Add the original repo as a git remote and rebase your fixes on their releases; the longer you diverge, the harder merging becomes.
- Keep changes small and named. One branch or commit per fix makes rebasing mechanical instead of archaeological.
- Document divergence in the README. Future-you (and any user) should see immediately which behaviours differ from upstream.
Repository: github.com/bobhuang1/cordova-plugin-local-notifications. The original project remains the reference for full documentation.