Skip to content

Commit

Permalink
Merge pull request #143 from WcaleNieWolny/improve_docs
Browse files Browse the repository at this point in the history
Improve docs
  • Loading branch information
riderx authored Nov 15, 2023
2 parents 9ed1599 + a5ad34b commit a0c42cb
Show file tree
Hide file tree
Showing 60 changed files with 471 additions and 84 deletions.
7 changes: 6 additions & 1 deletion astro.config.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ export default defineConfig({
AstroPWA(pwa),
starlight({
title: 'Capgo',
logo: { src: './logo.svg' },
// logo: { src: './logo.svg' },
social: {
discord: 'https://discord.com/invite/VnYRvBfgA6',
github: 'https://github.com/Cap-go',
Expand All @@ -43,6 +43,10 @@ export default defineConfig({
label: 'Tooling',
autogenerate: { directory: 'docs/tooling' },
},
{
label: 'Web app',
autogenerate: { directory: 'docs/webapp' },
},
{
label: 'Upgrade',
autogenerate: { directory: 'docs/upgrade' },
Expand All @@ -55,6 +59,7 @@ export default defineConfig({
label: 'Self Hosted',
items: [
{ label: 'Getting Started', link: '/docs/self-hosted/getting-started' },
{ label: 'Contributing to capgo OSS', link: '/docs/self-hosted/contributing' },
{ label: 'Auto Update', autogenerate: { directory: 'docs/self-hosted/Auto Update' } },
{
label: 'Local development',
Expand Down
Binary file added public/ab-start.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/account-save.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/account-updated.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/apikeys-add.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/apikeys-regenerate.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/apikeys-remove.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/apikeys-select-perm.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/app-multiple-sections.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/bundle-change.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/bundle-info.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/bundles.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/channel_settings.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/channels.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/confirm-make-default.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/create-account.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/device-specific.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/devices.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/download-bundle.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/login.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/logs.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/main-app-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/main-page.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/manage_channel_main.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/new_channel_modal.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/overwrite-filter.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added public/passwd-error.png
Binary file added public/post-channel-create.png
Binary file added public/progressive-deploy-finish.png
Binary file added public/progressive-deploy-show.png
Binary file added public/progressive-no-skip.png
Binary file added public/progressive-skip.png
Binary file added public/progressive-start.png
Binary file added public/settings-go.png
Binary file added public/update-passwd.png
11 changes: 10 additions & 1 deletion src/content/docs/docs/how-to.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ sidebar:
import { LinkCard, CardGrid } from '@astrojs/starlight/components';

<LinkCard
title="How version work in Capgo"
title="How version works in Capgo"
description="capgo.app"
href="https://capgo.app/blog/how-version-work-in-capgo/"
/>
Expand Down Expand Up @@ -39,3 +39,12 @@ import { LinkCard, CardGrid } from '@astrojs/starlight/components';
description="capgo.app"
href="https://capgo.app/blog/automatic-build-and-release-with-github-actions/"
/>

## Contributing


<LinkCard
title="Contributing to Capgo open source"
description="github.com"
href="https://github.com/Cap-go/capgo/blob/main/CONTRIBUTING.md"
/>
8 changes: 4 additions & 4 deletions src/content/docs/docs/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ Update OTA (Over the Air) only works for HTML, CSS, and JS changes. If you updat
- **Cloud Auto Mode:** <br/> Logic is handled by Capgo backend, providing enhanced security and fine-grained updates. You can deploy updates to specific devices or groups.
- **Cloud Manual Mode:** <br/> Update logic is handled by your JS, while Capgo backend handles the update content.
- **Self-hosted Auto Mode:** <br/> You need to recreate the update logic in your backend.
- **Self-hosted Manual Mode:** <br/> Update logic is handled by your JS, while the server handles the update content.
- **Self-hosted Manual Mode:** <br/> Update logic is handled by your JS, while the server handles the updates.
- **Manual Mode without Backend:** <br/> All logic must be handled by your JS.


Expand Down Expand Up @@ -73,18 +73,18 @@ The roadmap is managed on [GitHub](https://github.com/orgs/Cap-go/projects/1).

The plugin is under the LGPL-3.0 License and the back-end is AGPL-3.0 License.

> 💡 LGPL-3.0 mean if someone modify the code of the plugin, it’s mandatory to publish it, in open-source with same licensing. If you use the code without modification, that doesn’t concern you. See issue below for more details check the link 👇
> 💡 LGPL-3.0 means if someone modifies the code of the plugin, it’s mandatory to publish it, in open-source with the same licensing. If you use the code without modification, that doesn’t concern you. See the issue below for more details check the link 👇
<LinkCard
title="Licensing?"
href="https://github.com/Cap-go/capacitor-updater/issues/7"
/>

> You can include it in your app without worring
> You can include it in your app without worrying
## Last words

If you self host and find this tool useful, please consider supporting my work by becoming a [GitHub sponsor](https://github.com/sponsors/riderx).
If you self-host and find this tool useful, please consider supporting my work by becoming a [GitHub sponsor](https://github.com/sponsors/riderx).

I made a bet to open-source all the code I built here instead of keeping it for myself and charging a high price. By opening up instead of fighting and hiding, I believe we can make the world a better place.

Expand Down
30 changes: 15 additions & 15 deletions src/content/docs/docs/plugin/api.md
Original file line number Diff line number Diff line change
Expand Up @@ -53,9 +53,9 @@ See the Github [Readme](https://github.com/Cap-go/capacitor-updater) for more in
notifyAppReady() => Promise<{ bundle: BundleInfo; }>
```

Notify Capacitor Updater that the current bundle is working (a rollback will occur of this method is not called on every app launch)
By default this method should be called in the first 10 sec after app launch, otherwise a rollback will occur.
Change this behaviour with {@link appReadyTimeout}
Notify Capacitor Updater that the current bundle is working (a rollback will occur if this method is not called on every app launch)
By default this method should be called in the first 10 sec after the app launch, otherwise, a rollback will occur.
Change this behavior with {@link appReadyTimeout}

**Returns:** <code>Promise&lt;{ bundle: <a href="#bundleinfo">BundleInfo</a>; }&gt;</code>

Expand Down Expand Up @@ -102,7 +102,7 @@ Set the next bundle to be used when the app is reloaded.
set(options: { id: string; }) => Promise<void>
```

Set the current bundle and immediately reloads the app.
Set the current bundle and immediately reload the app.

| Param | Type |
| ------------- | ---------------------------- |
Expand Down Expand Up @@ -145,7 +145,7 @@ Get all locally downloaded bundles in your app
reset(options?: { toLastSuccessful?: boolean | undefined; } | undefined) => Promise<void>
```

Set the `builtin` bundle (the one sent to Apple store / Google play store ) as current bundle
Set the `builtin` bundle (the one sent to Apple store / Google play store ) as a current bundle

| Param | Type |
| ------------- | -------------------------------------------- |
Expand Down Expand Up @@ -229,7 +229,7 @@ Get Latest bundle available from update Url
setChannel(options: SetChannelOptions) => Promise<channelRes>
```

Set Channel for this device, the channel have to allow self assignement to make this work
Set Channel for this device, the channel has to allow self assignment to make this work

| Param | Type | Description |
| ------------- | --------------------------------------------------------------- | -------------------------------------------------------------------------------- |
Expand Down Expand Up @@ -297,7 +297,7 @@ Set Channel for this device
addListener(eventName: "download", listenerFunc: DownloadChangeListener) => Promise<PluginListenerHandle> & PluginListenerHandle
```

Listen for download event in the App, let you know when the download is started, loading and finished, with a percent value
Listen for download event in the App, let you know when the download is started, loading, and finished, with a percent value

| Param | Type |
| ------------------ | ------------------------------------------------------------------------- |
Expand Down Expand Up @@ -357,7 +357,7 @@ Listen for availbale update event, usefull when you want to force check every ti
addListener(eventName: "downloadComplete", listenerFunc: DownloadCompleteListener) => Promise<PluginListenerHandle> & PluginListenerHandle
```

Listen for download event in the App, let you know when the download is started, loading and finished
Listen for download event in the App, let you know when the download is started, loading, and finished

| Param | Type |
| ------------------ | ----------------------------------------------------------------------------- |
Expand All @@ -377,7 +377,7 @@ Listen for download event in the App, let you know when the download is started,
addListener(eventName: "majorAvailable", listenerFunc: MajorAvailableListener) => Promise<PluginListenerHandle> & PluginListenerHandle
```

Listen for Major update event in the App, let you know when major update is blocked by setting disableAutoUpdateBreaking
Listen for Major update event in the App, and let you know when a major update is blocked by setting disableAutoUpdateBreaking

| Param | Type |
| ------------------ | ------------------------------------------------------------------------- |
Expand All @@ -397,7 +397,7 @@ Listen for Major update event in the App, let you know when major update is bloc
addListener(eventName: "updateFailed", listenerFunc: UpdateFailedListener) => Promise<PluginListenerHandle> & PluginListenerHandle
```

Listen for update fail event in the App, let you know when update has fail to install at next app start
Listen for update fail event in the App, and let you know when the update has failed to install at the next app start

| Param | Type |
| ------------------ | --------------------------------------------------------------------- |
Expand All @@ -417,7 +417,7 @@ Listen for update fail event in the App, let you know when update has fail to in
addListener(eventName: "downloadFailed", listenerFunc: DownloadFailedListener) => Promise<PluginListenerHandle> & PluginListenerHandle
```

Listen for download fail event in the App, let you know when download has fail finished
Listen for download fail event in the App, and let you know when the download has failed finished

| Param | Type |
| ------------------ | ------------------------------------------------------------------------- |
Expand All @@ -437,7 +437,7 @@ Listen for download fail event in the App, let you know when download has fail f
addListener(eventName: "appReloaded", listenerFunc: AppReloadedListener) => Promise<PluginListenerHandle> & PluginListenerHandle
```

Listen for reload event in the App, let you know when reload has happend
Listen for reload event in the App, and let you know when the reload has happened

| Param | Type |
| ------------------ | ------------------------------------------------------------------- |
Expand All @@ -457,7 +457,7 @@ Listen for reload event in the App, let you know when reload has happend
addListener(eventName: "appReady", listenerFunc: AppReadyListener) => Promise<PluginListenerHandle> & PluginListenerHandle
```

Listen for app ready event in the App, let you know when app is ready to use
Listen for app ready event in the App, and let you know when the app is ready to use

| Param | Type |
| ------------------ | ------------------------------------------------------------- |
Expand All @@ -477,7 +477,7 @@ Listen for app ready event in the App, let you know when app is ready to use
getBuiltinVersion() => Promise<{ version: string; }>
```

Get the native app version or the builtin version if set in config
Get the native app version or the builtin version if set in the config

**Returns:** <code>Promise&lt;{ version: string; }&gt;</code>

Expand All @@ -492,7 +492,7 @@ Get the native app version or the builtin version if set in config
getDeviceId() => Promise<{ deviceId: string; }>
```

Get unique ID used to identify device (sent to auto update server)
Get a unique ID used to identify the device (sent to auto-update server)

**Returns:** <code>Promise&lt;{ deviceId: string; }&gt;</code>

Expand Down
14 changes: 7 additions & 7 deletions src/content/docs/docs/plugin/auto-update.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ npx cap sync

Click on [register](https://capgo.app) to create your account if you don't have one.

The server allows you to manage channel and versions and much more.
The server allows you to manage channels and versions and much more.

`autoUpdate` will use data from `capacitor.config` to identify into the Capgo server

> ℹ️ You can use Capgo Cloud without sending your code to our server. If that not allowed by your company.
> ℹ️ You can use Capgo Cloud without sending your code to our server. If that is not allowed by your company.
#### Validate version

When auto-update is setup you have to send a signal from JS that your app is alive
When auto-update is set up you have to send a signal from JS that your app is alive

This can be done by calling within your app `notifyAppReady`.

Expand All @@ -61,12 +61,12 @@ CapacitorUpdater.notifyAppReady()

#### User flow

* When User open app, it calls the server to check for update, if found it download in the background.
* When the User opens the app, it calls the server to check for updates, if found it is downloaded in the background.
* When the user leaves the app, the new version is set as active
* When the user opens again, he sees the new app
* If `notifyAppReady()` is called, when the user leaves, the past version is deleted.
* If not called, when the user leaves, the version is reset to past one and marked as invalid.
* User Continue normal flow until the next update process.
* User continues normal flow until the next update process.

#### Dev flow

Expand All @@ -76,13 +76,13 @@ When you develop new features, be sure to block `autoUpdate`, otherwise you will
Be sure to set `autoUpdate` to false in your config before doing that.
And then build it again with Xcode or Android studio.

To upload version at each commit setup CI/CD with this guide
To upload the version at each commit setup CI/CD with this guide

[Automatic build and release with GitHub actions](https://capgo.app/blog/automatic-build-and-release-with-github-actions)

#### Major Available event

When `disableAutoUpdateBreaking` is true, you can listen to event to know when the app refuses to do a major braking update.
When `disableAutoUpdateBreaking` is true, you can listen to the event to know when the app refuses to do a major braking update.

```jsx
import { CapacitorUpdater } from '@capgo/capacitor-updater'
Expand Down
29 changes: 15 additions & 14 deletions src/content/docs/docs/plugin/channel-system.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,21 +4,21 @@ sidebar:
order: 6
---

With Capgo and capacitor-updater come a powerful channel system.
With Capgo and capacitor-updater comes a powerful channel system.

## What you can do with channels:

* Associate devices to channel for development, beta test or AB testing
* Use one channel by dev branch and let your team self assign from the phone to test
* Associate devices to channel for development, beta test, or AB testing
* Use one channel by dev branch and let your team self-assign from the phone to test

## You have 3 ways to assign device to channel:
## You have 3 ways to assign a device to a channel:

* Make the channel default, each time a new device asks Capgo for update this one answer
* Make the channel default, each time a new device asks Capgo for an update this one answer
* Send the **deviceId** (with [**getId**](/docs/plugin/api#getid) method) to your backend and send from your backend to Capgo the assign order
* Make the channel self assignable (with [**setChannel**](/docs/plugin/api#setchannel) method), and let the device subscribe to channel (with user interaction or not)
* Make the channel self-assignable (with [**setChannel**](/docs/plugin/api#setchannel) method), and let the device subscribe to the channel (with user interaction or not)

{% hint style="info" %}
You can also, for specific case, assign a device directly to a bundle, for debug purpose for example.
You can also, for a specific case, assign a device directly to a bundle, for debugging purposes for example.
{% endhint %}

## Channel options
Expand All @@ -27,14 +27,15 @@ You can also, for specific case, assign a device directly to a bundle, for debug

Meaning of each:

* **Disable auto downgrade under native** => Don't send an update if the app native version is bigger than the channel one
* **Disable auto upgrade above major** => Don't send an update if the app native version is lower from a Major (**1**.2.3) than the channel one
* **Allow device to self assign** => Let a device use the `setChannel` method to this channel
* **IOS** => Allow iOS devices to download update from this channel
* **Android** => Allow android devices to download update from this channel
* **Disable auto downgrade under native** => Don't send an update if the app's native version is bigger than the channel one
* **Disable auto upgrade above major** => Don't send an update if the app native version is lower then a Major (**1**.2.3) from the channel one
* **Disable auto upgrade above minor** => Don't send an update if the app native version is lower then a minor (1.**2**.3) from the channel one
* **Allow the device to self-assign** => Let a device use the `setChannel` method to this channel
* **IOS** => Allow IOS devices to download updates from this channel
* **Android** => Allow Android devices to download updates from this channel
* **Allow Emulator** => Allow emulator to receive update
* **Allow development build** => Allow development build to receive update

> Capgo is doing some filtering for you. If you have CI/CD configured to send your version to Google PLAY, Google is running your app each time to 20+ real devices. During the 4 first hours of a new bundle, we block Google data center IP to prevent them to being counted.
> Capgo is doing some filtering for you. If you have CI/CD configured to send your version to Google PLAY, Google is running your app each time to 20+ real devices. During the 4 first hours of a new bundle, we block Google data center IP to prevent them from being counted.
> Capgo don't count emulator and dev build in your usage. Keep in mind after the trial you can't have more than 3% of them, or that will lock your account, until you fix it.
> Capgo don't count emulator and dev build in your usage. Keep in mind after the trial you can't have more than 3% of them, or that will lock your account until you fix it.
6 changes: 3 additions & 3 deletions src/content/docs/docs/plugin/cordova.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,18 @@ sidebar:

You are many to wonder if this plugin will be available in Cordova.

I have stared R\&D repository for that, but it's a huge work.
I have started a R\&D repository for that, but it's a huge work.

## Problems

I know I can do it. For that, I have to read all the code of Cordova codebase as I did for Capacitor, to understand how to make it work.

The Android version is easier to do since both use java, but iOS needs a full rewrite, Swift it's still not well-supported in Cordova.
The Android version is easier to do since both use Java, but iOS needs a full rewrite because Swift is still not well-supported in Cordova

## Solution

We have many solutions to solve that :

* [Support me](https://github.com/sponsors/riderx) on GitHub and I can prioritize that. This will need at least 1 month of work.
* Hire me as a Consultant, I used to help big company migrate to capacitor, it usually takes from 10 to 20 days, and the [benefit](https://ionic.io/resources/articles/capacitor-vs-cordova-modern-hybrid-app-development) is huge for the team
* Hire me as a Consultant, I used to help big companies migrate to capacitor, it usually takes from 10 to 20 days, and the [benefit](https://ionic.io/resources/articles/capacitor-vs-cordova-modern-hybrid-app-development) is huge for the team
* Wait until this comes out, it is very low on the to-do for now.
Loading

0 comments on commit a0c42cb

Please sign in to comment.