Cap-go / capacitor-updater

Instant updates for Capacitor Ship updates, fixes, changes, and features within minutes
https://capgo.app
Mozilla Public License 2.0
508 stars 106 forks source link

feat: abstract the updater into a standalone lib #392

Open WcaleNieWolny opened 2 months ago

WcaleNieWolny commented 2 months ago

Feature Request

Description

Currently all of the code is in one very big package that is designed to work with capacitor + ios/android. This makes adding react native support, tests really difficult.

This would allow for very precise testing as well as relatively easy implementation of the react native platform.

It is a good step forward both in terms of code stability and adding new platforms

Platform(s)

Android, Ios

Preferred Solution

I propose that we abstract away the core logic (downloading, unzipping, etc) into a separate library that will not depend on capacitor nor on any ios/android specific feature and a package implementing this new library for the capacitor platform. The structure would be like so:

ios:
 - core
 - capacitor
 android:
  - core
  - capacitor

Alternatives

None

Additional Context

This is related to #266 as well as #361

Partial update would be heavily impacted by this change so perhaps we should conciser doing partial first

riderx commented 2 weeks ago

I think this is a good idea if we manage to make the capacitor the more dumb possible. Just call the right function in the lib and set the settings, including giving the right folder to save and the right method to change path. The rest should be done in the lib. The lib should be in the plugin, not published anywhere for now