Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions AGENTS.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,3 +22,16 @@ bunx @tailwindcss/upgrade --force
```

- Use that command to fix deprecated class syntax across the repo instead of doing large manual replacements.

## Adding A Plugin To The Website

- Add the plugin registry entry in `apps/web/src/config/plugins.ts` inside `actionDefinitionRows` with the package name, title, short description, and GitHub URL.
- 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`.
- Add the English tutorial in `apps/web/src/content/plugins-tutorials/en/<tutorial-slug>.md`.
- 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:
`https://github.com/Cap-go/capacitor-live-activities/` -> `apps/web/src/content/plugins-tutorials/en/capacitor-live-activities.md`
`https://github.com/Cap-go/electron-updater/` -> `apps/web/src/content/plugins-tutorials/en/electron-updater.md`
- Register documented plugins in `apps/docs/src/config/sidebar.mjs` so they appear in the Starlight plugin sidebar.
- Register documented plugins in `apps/docs/src/config/llmsCustomSets.ts` so they appear in the docs search and LLM sets.
- Refresh metadata after adding a plugin with `bun run fetch:stars` and `bun run fetch:downloads`.
- 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.
24 changes: 24 additions & 0 deletions apps/docs/src/components/doc/PluginOverview.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
---
import { Card, CardGrid } from '@astrojs/starlight/components'

interface PluginOverviewCard {
body: string
title: string
}

interface Props {
cards: PluginOverviewCard[]
summary: string
}

const { cards, summary } = Astro.props as Props
---

<section aria-live="polite" aria-labelledby="plugin-overview-heading">
<h2 id="plugin-overview-heading" class="sr-only">Plugin overview</h2>
<p>{summary}</p>

<CardGrid stagger>
{cards.map((card) => <Card title={card.title}>{card.body}</Card>)}
</CardGrid>
</section>
33 changes: 33 additions & 0 deletions apps/docs/src/components/doc/PluginSetupSteps.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
---
import { PackageManagers } from 'starlight-package-managers'

interface Props {
installLabel?: string
pkg: string
stepTitle: string
}

const { installLabel = 'plugin', pkg, stepTitle } = Astro.props as Props
const pkgManagers: Array<'npm' | 'pnpm' | 'yarn' | 'bun'> = ['npm', 'pnpm', 'yarn', 'bun']
---

<ol class="sl-steps" aria-live="polite" aria-atomic="true">
<li>
<p>
<strong>Install the {installLabel}</strong>
</p>
<PackageManagers pkg={pkg} pkgManagers={pkgManagers} />
</li>
<li>
<p>
<strong>Sync native platforms</strong>
</p>
<PackageManagers type="exec" pkg="cap" args="sync" pkgManagers={pkgManagers} />
</li>
<li>
<p>
<strong>{stepTitle}</strong>
</p>
<slot />
</li>
</ol>
48 changes: 48 additions & 0 deletions apps/docs/src/components/doc/PluginsDirectory.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
---
import { CardGrid, LinkCard } from '@astrojs/starlight/components'
import { actions } from '@/config/plugins'
import { defaultLocale } from '@/services/locale'
import { getPluginDocsSlugs, resolvePluginDocsSlug } from '@/services/pluginDocs'
import { getRelativeLocaleUrl } from 'astro:i18n'

const locale = Astro.locals.locale ?? defaultLocale
const { localizedDocsSlugs, docsSlugs } = await getPluginDocsSlugs(locale)
const seenPluginLinks = new Set<string>()

const plugins = actions
.map((plugin) => {
const docsSlug = resolvePluginDocsSlug(plugin, docsSlugs)
if (docsSlug) {
const docsKey = `docs:${docsSlug}`
if (seenPluginLinks.has(docsKey)) return null

seenPluginLinks.add(docsKey)

const docsLocale = localizedDocsSlugs.has(docsSlug) ? locale : defaultLocale

return {
description: plugin.description,
href: getRelativeLocaleUrl(docsLocale, `docs/plugins/${docsSlug}/`),
title: plugin.title,
}
}

const fallbackKey = `repo:${plugin.href}`
if (seenPluginLinks.has(fallbackKey)) return null
seenPluginLinks.add(fallbackKey)

return {
description: `${plugin.description} Opens the plugin repository until a dedicated docs page is available.`,
href: plugin.href,
title: plugin.title,
}
})
.filter((plugin): plugin is NonNullable<typeof plugin> => Boolean(plugin))
.sort((left, right) => left.title.localeCompare(right.title))
---

<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>

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

export const docsLlmsCustomSets = llmsCustomSetRows.map((row, index) => {
const [label, description, ...paths] = row.split('|').map((part) => part.trim())
Expand Down
1 change: 1 addition & 0 deletions apps/docs/src/config/plugins.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export { actions, type Action, type Plugin } from '../../../web/src/config/plugins'
Loading