Skip to content

Commit 104bbc5

Browse files
authored
[codex] sync plugin registry and docs (#552)
* sync plugin registry and docs * reduce plugin docs duplication * dedupe plugin metadata wiring * fix plugin docs review issues * Add missing Capgo plugin pages * Fix plugin tutorial locale fallback * Polish electron updater tutorial copy * Fix plugin icon include scanning
1 parent 5384ea7 commit 104bbc5

38 files changed

Lines changed: 2540 additions & 666 deletions

AGENTS.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,3 +22,16 @@ bunx @tailwindcss/upgrade --force
2222
```
2323

2424
- Use that command to fix deprecated class syntax across the repo instead of doing large manual replacements.
25+
26+
## Adding A Plugin To The Website
27+
28+
- Add the plugin registry entry in `apps/web/src/config/plugins.ts` inside `actionDefinitionRows` with the package name, title, short description, and GitHub URL.
29+
- Add the plugin docs in `apps/docs/src/content/docs/docs/plugins/<docs-slug>/index.mdx` and `apps/docs/src/content/docs/docs/plugins/<docs-slug>/getting-started.mdx`.
30+
- Add the English tutorial in `apps/web/src/content/plugins-tutorials/en/<tutorial-slug>.md`.
31+
- The tutorial slug must match the GitHub URL slug used by `item.href` on the plugin entry because `/plugins/[slug]` resolves from that repo slug. Examples:
32+
`https://github.com/Cap-go/capacitor-live-activities/` -> `apps/web/src/content/plugins-tutorials/en/capacitor-live-activities.md`
33+
`https://github.com/Cap-go/electron-updater/` -> `apps/web/src/content/plugins-tutorials/en/electron-updater.md`
34+
- Register documented plugins in `apps/docs/src/config/sidebar.mjs` so they appear in the Starlight plugin sidebar.
35+
- Register documented plugins in `apps/docs/src/config/llmsCustomSets.ts` so they appear in the docs search and LLM sets.
36+
- Refresh metadata after adding a plugin with `bun run fetch:stars` and `bun run fetch:downloads`.
37+
- Validate the change with `bunx prettier --write <touched-files>` and `NODE_OPTIONS=--max-old-space-size=16384 bunx astro check` in both `apps/web` and `apps/docs`, or `bun run check` from the repo root.
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
---
2+
import { Card, CardGrid } from '@astrojs/starlight/components'
3+
4+
interface PluginOverviewCard {
5+
body: string
6+
title: string
7+
}
8+
9+
interface Props {
10+
cards: PluginOverviewCard[]
11+
summary: string
12+
}
13+
14+
const { cards, summary } = Astro.props as Props
15+
---
16+
17+
<section aria-live="polite" aria-labelledby="plugin-overview-heading">
18+
<h2 id="plugin-overview-heading" class="sr-only">Plugin overview</h2>
19+
<p>{summary}</p>
20+
21+
<CardGrid stagger>
22+
{cards.map((card) => <Card title={card.title}>{card.body}</Card>)}
23+
</CardGrid>
24+
</section>
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
---
2+
import { PackageManagers } from 'starlight-package-managers'
3+
4+
interface Props {
5+
installLabel?: string
6+
pkg: string
7+
stepTitle: string
8+
}
9+
10+
const { installLabel = 'plugin', pkg, stepTitle } = Astro.props as Props
11+
const pkgManagers: Array<'npm' | 'pnpm' | 'yarn' | 'bun'> = ['npm', 'pnpm', 'yarn', 'bun']
12+
---
13+
14+
<ol class="sl-steps" aria-live="polite" aria-atomic="true">
15+
<li>
16+
<p>
17+
<strong>Install the {installLabel}</strong>
18+
</p>
19+
<PackageManagers pkg={pkg} pkgManagers={pkgManagers} />
20+
</li>
21+
<li>
22+
<p>
23+
<strong>Sync native platforms</strong>
24+
</p>
25+
<PackageManagers type="exec" pkg="cap" args="sync" pkgManagers={pkgManagers} />
26+
</li>
27+
<li>
28+
<p>
29+
<strong>{stepTitle}</strong>
30+
</p>
31+
<slot />
32+
</li>
33+
</ol>
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
---
2+
import { CardGrid, LinkCard } from '@astrojs/starlight/components'
3+
import { actions } from '@/config/plugins'
4+
import { defaultLocale } from '@/services/locale'
5+
import { getPluginDocsSlugs, resolvePluginDocsSlug } from '@/services/pluginDocs'
6+
import { getRelativeLocaleUrl } from 'astro:i18n'
7+
8+
const locale = Astro.locals.locale ?? defaultLocale
9+
const { localizedDocsSlugs, docsSlugs } = await getPluginDocsSlugs(locale)
10+
const seenPluginLinks = new Set<string>()
11+
12+
const plugins = actions
13+
.map((plugin) => {
14+
const docsSlug = resolvePluginDocsSlug(plugin, docsSlugs)
15+
if (docsSlug) {
16+
const docsKey = `docs:${docsSlug}`
17+
if (seenPluginLinks.has(docsKey)) return null
18+
19+
seenPluginLinks.add(docsKey)
20+
21+
const docsLocale = localizedDocsSlugs.has(docsSlug) ? locale : defaultLocale
22+
23+
return {
24+
description: plugin.description,
25+
href: getRelativeLocaleUrl(docsLocale, `docs/plugins/${docsSlug}/`),
26+
title: plugin.title,
27+
}
28+
}
29+
30+
const fallbackKey = `repo:${plugin.href}`
31+
if (seenPluginLinks.has(fallbackKey)) return null
32+
seenPluginLinks.add(fallbackKey)
33+
34+
return {
35+
description: `${plugin.description} Opens the plugin repository until a dedicated docs page is available.`,
36+
href: plugin.href,
37+
title: plugin.title,
38+
}
39+
})
40+
.filter((plugin): plugin is NonNullable<typeof plugin> => Boolean(plugin))
41+
.sort((left, right) => left.title.localeCompare(right.title))
42+
---
43+
44+
<p>{plugins.length} plugins currently resolve from the live Capgo registry. Dedicated docs open when available, and repository links remain visible for the rest.</p>
45+
46+
<CardGrid>
47+
{plugins.map((plugin) => <LinkCard title={plugin.title} description={plugin.description} href={plugin.href} />)}
48+
</CardGrid>

apps/docs/src/config/llmsCustomSets.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Console Tutorial|step-by-step tutorial to get started with Capgo Console and liv
44
Public API|full reference documentation for public API|docs/public-api/**
55
Plugin Accelerometer|accelerometer sensor plugin for detecting device motion and orientation|docs/plugins/accelerometer/**
66
Plugin AdMob|Google AdMob plugin for mobile advertising integration|docs/plugins/admob/**
7+
Plugin Age Range|cross-platform age range detection plugin|docs/plugins/age-range/**
78
Plugin Age Signals|Android age signals plugin for age verification|docs/plugins/age-signals/**
89
Plugin Alarm|alarm and notification scheduling plugin|docs/plugins/alarm/**
910
Plugin Android Inline Install|Android inline app installation plugin|docs/plugins/android-inline-install/**
@@ -12,6 +13,7 @@ Plugin Android Kiosk|Android kiosk mode plugin for locked-down device experience
1213
Plugin AppInsights|Microsoft Application Insights analytics plugin|docs/plugins/appinsights/**
1314
Plugin AppsFlyer|AppsFlyer mobile attribution, analytics, and deep linking plugin|docs/plugins/appsflyer/**
1415
Plugin App Attest|cross-platform app attestation plugin using Apple App Attest and Google Play Integrity Standard|docs/plugins/app-attest/**
16+
Plugin App Tracking Transparency|iOS app tracking transparency permission plugin|docs/plugins/app-tracking-transparency/**
1517
Plugin Audio Recorder|audio recording plugin for capturing microphone input|docs/plugins/audio-recorder/**
1618
Plugin Audio Session|iOS audio session configuration plugin|docs/plugins/audiosession/**
1719
Plugin Autofill Save Password|autofill and password save plugin for credential management|docs/plugins/autofill-save-password/**
@@ -49,6 +51,7 @@ Plugin JW Player|JW Player video integration plugin|docs/plugins/jw-player/**
4951
Plugin Keep Awake|screen wake lock plugin to prevent sleep|docs/plugins/keep-awake/**
5052
Plugin Launch Navigator|native maps navigation plugin|docs/plugins/launch-navigator/**
5153
Plugin Light Sensor|ambient light sensor plugin|docs/plugins/light-sensor/**
54+
Plugin Live Activities|iOS Live Activities and Dynamic Island plugin|docs/plugins/live-activities/**
5255
Plugin Live Reload|development live reload plugin|docs/plugins/live-reload/**
5356
Plugin LLM|on-device large language model plugin|docs/plugins/llm/**
5457
Plugin Media Session|media session and playback controls plugin|docs/plugins/media-session/**
@@ -84,6 +87,7 @@ Plugin Speech Synthesis|text-to-speech synthesis plugin|docs/plugins/speech-synt
8487
Plugin SSL Pinning|certificate pinning plugin for CapacitorHttp requests|docs/plugins/ssl-pinning/**
8588
Plugin StreamCall|Stream video calling plugin|docs/plugins/streamcall/**
8689
Plugin Text Interaction|text selection and interaction plugin|docs/plugins/textinteraction/**
90+
Plugin Twilio Video|Twilio Video room integration plugin|docs/plugins/twilio-video/**
8791
Plugin Twilio Voice|Twilio voice calling plugin|docs/plugins/twilio-voice/**
8892
Plugin Uploader|file upload plugin with background support|docs/plugins/uploader/**
8993
Plugin Video Player|native video player plugin|docs/plugins/video-player/**
@@ -94,6 +98,7 @@ Plugin WeChat|WeChat integration plugin|docs/plugins/wechat/**
9498
Plugin Webview Guardian|webview security and protection plugin|docs/plugins/webview-guardian/**
9599
Plugin Webview Version Checker|Android WebView version validation plugin|docs/plugins/webview-version-checker/**
96100
Plugin WiFi|WiFi network information plugin|docs/plugins/wifi/**
101+
Plugin Widget Kit|WidgetKit and Live Activities template plugin|docs/plugins/widget-kit/**
97102
Plugin Zebra DataWedge|Zebra DataWedge plugin for barcode profiles, notifications, and scan intents|docs/plugins/zebra-datawedge/**
98103
Plugin YouTube Player|YouTube video player plugin|docs/plugins/youtube-player/**
99104
Plugin Zip|file compression and extraction plugin|docs/plugins/zip/**
@@ -107,7 +112,9 @@ Plugin Firebase Functions|Firebase Cloud Functions plugin|docs/plugins/firebase-
107112
Plugin Firebase Messaging|Firebase Cloud Messaging push notifications plugin|docs/plugins/firebase-messaging/**
108113
Plugin Firebase Performance|Firebase Performance Monitoring plugin|docs/plugins/firebase-performance/**
109114
Plugin Firebase Remote Config|Firebase Remote Config plugin|docs/plugins/firebase-remote-config/**
110-
Plugin Firebase Storage|Firebase Cloud Storage plugin|docs/plugins/firebase-storage/**`.trim().split('\n')
115+
Plugin Firebase Storage|Firebase Cloud Storage plugin|docs/plugins/firebase-storage/**`
116+
.trim()
117+
.split('\n')
111118

112119
export const docsLlmsCustomSets = llmsCustomSetRows.map((row, index) => {
113120
const [label, description, ...paths] = row.split('|').map((part) => part.trim())

apps/docs/src/config/plugins.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
export { actions, type Action, type Plugin } from '../../../web/src/config/plugins'

0 commit comments

Comments
 (0)