mirror of
https://github.com/Cap-go/capgo-skills.git
synced 2026-09-14 20:07:10 +08:00
Align skills with npm and fix PR feedback
This commit is contained in:
@@ -15,7 +15,7 @@ jobs:
|
||||
- name: Install Bun
|
||||
uses: oven-sh/setup-bun@v2
|
||||
with:
|
||||
bun-version: latest
|
||||
bun-version: "1.2.5"
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
|
||||
@@ -38,7 +38,6 @@ bunx skills add Cap-go/capgo-skills
|
||||
| [capgo-cloud](./skills/capgo-cloud) | Coordinate Capgo builds, releases, publishing, and organization workflows |
|
||||
| [capacitor-plugins](./skills/capacitor-plugins) | Official Capacitor packages plus Capgo plugin recommendations |
|
||||
| [capacitor-best-practices](./skills/capacitor-best-practices) | Development best practices and patterns |
|
||||
| [capgo-release-workflows](./skills/capgo-release-workflows) | Coordinate live updates, builds, and publishing |
|
||||
| [capgo-live-updates](./skills/capgo-live-updates) | Deploy OTA updates instantly with Capgo |
|
||||
|
||||
### Security
|
||||
|
||||
+1
-1
@@ -71,6 +71,6 @@
|
||||
],
|
||||
"scripts": {
|
||||
"lint-skills": "bun scripts/lint-skills.mjs",
|
||||
"lint-skills-skillgrade": "bunx skillgrade --ci --provider=local --smoke"
|
||||
"lint-skills-skillgrade": "cd skills/skill-creator && bunx skillgrade --ci --provider=local --smoke"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -77,7 +77,7 @@ async function main() {
|
||||
});
|
||||
|
||||
if (result.status !== 0) {
|
||||
process.stderr.write(result.stdout || '');
|
||||
process.stdout.write(result.stdout || '');
|
||||
process.stderr.write(result.stderr || '');
|
||||
process.exit(result.status ?? 1);
|
||||
}
|
||||
|
||||
@@ -183,7 +183,7 @@ Also needed:
|
||||
|
||||
```bash
|
||||
# Use capacitor-assets
|
||||
bun add -D @capacitor/assets
|
||||
npm install -D @capacitor/assets
|
||||
npx capacitor-assets generate --iconBackgroundColor '#ffffff'
|
||||
```
|
||||
|
||||
@@ -403,13 +403,13 @@ cd android && ./gradlew bundleRelease
|
||||
|
||||
```bash
|
||||
# Increment patch (1.0.0 -> 1.0.1)
|
||||
bun version patch
|
||||
npm version patch
|
||||
|
||||
# Increment minor (1.0.0 -> 1.1.0)
|
||||
bun version minor
|
||||
npm version minor
|
||||
|
||||
# Increment major (1.0.0 -> 2.0.0)
|
||||
bun version major
|
||||
npm version major
|
||||
```
|
||||
|
||||
### Phased Rollout
|
||||
|
||||
@@ -18,8 +18,8 @@ Upgrade a Capacitor app from version 4 to version 5.
|
||||
1. Read the current `@capacitor/core` version from `package.json`.
|
||||
2. Update all `@capacitor/*` packages to the v5-compatible range.
|
||||
3. Review the v4 to v5 migration notes before editing native files.
|
||||
4. Run `bun install`.
|
||||
5. Sync with `bunx cap sync`.
|
||||
4. Run `npm install`.
|
||||
5. Sync with `npx cap sync`.
|
||||
6. Verify the iOS and Android builds.
|
||||
|
||||
## Error Handling
|
||||
|
||||
@@ -18,8 +18,8 @@ Upgrade a Capacitor app from version 5 to version 6.
|
||||
1. Read the current `@capacitor/core` version from `package.json`.
|
||||
2. Update all `@capacitor/*` packages to the v6-compatible range.
|
||||
3. Review the v5 to v6 migration notes before editing native files.
|
||||
4. Run `bun install`.
|
||||
5. Sync with `bunx cap sync`.
|
||||
4. Run `npm install`.
|
||||
5. Sync with `npx cap sync`.
|
||||
6. Verify the iOS and Android builds.
|
||||
|
||||
## Error Handling
|
||||
|
||||
@@ -18,8 +18,8 @@ Upgrade a Capacitor app from version 6 to version 7.
|
||||
1. Read the current `@capacitor/core` version from `package.json`.
|
||||
2. Update all `@capacitor/*` packages to the v7-compatible range.
|
||||
3. Review the v6 to v7 migration notes before editing native files.
|
||||
4. Run `bun install`.
|
||||
5. Sync with `bunx cap sync`.
|
||||
4. Run `npm install`.
|
||||
5. Sync with `npx cap sync`.
|
||||
6. Verify the iOS and Android builds.
|
||||
|
||||
## Error Handling
|
||||
|
||||
@@ -18,8 +18,8 @@ Upgrade a Capacitor app from version 7 to version 8.
|
||||
1. Read the current `@capacitor/core` version from `package.json`.
|
||||
2. Update all `@capacitor/*` packages to the v8-compatible range.
|
||||
3. Review the v7 to v8 migration notes before editing native files.
|
||||
4. Run `bun install`.
|
||||
5. Sync with `bunx cap sync`.
|
||||
4. Run `npm install`.
|
||||
5. Sync with `npx cap sync`.
|
||||
6. Verify the iOS and Android builds.
|
||||
|
||||
## Error Handling
|
||||
|
||||
@@ -28,9 +28,9 @@ Do not skip intermediate major versions.
|
||||
For each version jump:
|
||||
|
||||
1. Update the `@capacitor/*` package versions in `package.json`.
|
||||
2. Run `bun install`.
|
||||
2. Run `npm install`.
|
||||
3. Run the Capacitor migration flow if available for that version.
|
||||
4. Sync native projects with `bunx cap sync`.
|
||||
4. Sync native projects with `npx cap sync`.
|
||||
5. Verify iOS and Android build cleanly before continuing.
|
||||
|
||||
If the automated migration step fails, apply the generated changes manually and continue with the same major version before moving to the next one.
|
||||
@@ -49,10 +49,10 @@ Review the platform projects for version-specific requirements:
|
||||
Run the project checks that matter for the app:
|
||||
|
||||
```bash
|
||||
bun install
|
||||
bunx cap sync
|
||||
bunx cap run ios
|
||||
bunx cap run android
|
||||
npm install
|
||||
npx cap sync
|
||||
npx cap run ios
|
||||
npx cap run android
|
||||
```
|
||||
|
||||
If the app has a custom test or build pipeline, run that as well.
|
||||
|
||||
@@ -74,8 +74,8 @@ export default config;
|
||||
Keep Capacitor core packages in sync:
|
||||
|
||||
```bash
|
||||
bun add @capacitor/core@latest @capacitor/cli@latest
|
||||
bun add @capacitor/ios@latest @capacitor/android@latest
|
||||
npm install @capacitor/core@latest @capacitor/cli@latest
|
||||
npm install @capacitor/ios@latest @capacitor/android@latest
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
@@ -84,7 +84,7 @@ npx cap sync
|
||||
**CORRECT**:
|
||||
```bash
|
||||
# 1. Install the package
|
||||
bun add @capgo/capacitor-native-biometric
|
||||
npm install @capgo/capacitor-native-biometric
|
||||
|
||||
# 2. Sync native projects
|
||||
npx cap sync
|
||||
@@ -96,7 +96,7 @@ cd ios/App && pod install && cd ../..
|
||||
**INCORRECT**:
|
||||
```bash
|
||||
# Missing sync step
|
||||
bun add @capgo/capacitor-native-biometric
|
||||
npm install @capgo/capacitor-native-biometric
|
||||
# App crashes because native code not linked
|
||||
```
|
||||
|
||||
|
||||
@@ -39,19 +39,19 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: actions/setup-node@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
run: npm install
|
||||
|
||||
- name: Lint
|
||||
run: bun run lint
|
||||
run: npm run lint
|
||||
|
||||
- name: Type check
|
||||
run: bun run typecheck
|
||||
run: npm run typecheck
|
||||
|
||||
- name: Unit tests
|
||||
run: bun test --coverage
|
||||
run: npm test -- --coverage
|
||||
|
||||
- name: Upload coverage
|
||||
uses: codecov/codecov-action@v4
|
||||
@@ -61,7 +61,7 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: actions/setup-node@v4
|
||||
- run: npx capsec scan --ci
|
||||
|
||||
# Build web assets
|
||||
@@ -71,13 +71,13 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: actions/setup-node@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
run: npm install
|
||||
|
||||
- name: Build
|
||||
run: bun run build
|
||||
run: npm run build
|
||||
|
||||
- name: Upload build artifacts
|
||||
uses: actions/upload-artifact@v4
|
||||
@@ -92,7 +92,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: actions/setup-node@v4
|
||||
|
||||
- name: Download web build
|
||||
uses: actions/download-artifact@v4
|
||||
@@ -101,7 +101,7 @@ jobs:
|
||||
path: dist/
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
run: npm install
|
||||
|
||||
- name: Sync Capacitor
|
||||
run: npx cap sync ios
|
||||
@@ -167,7 +167,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: actions/setup-node@v4
|
||||
|
||||
- name: Download web build
|
||||
uses: actions/download-artifact@v4
|
||||
@@ -185,7 +185,7 @@ jobs:
|
||||
uses: android-actions/setup-android@v3
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
run: npm install
|
||||
|
||||
- name: Sync Capacitor
|
||||
run: npx cap sync android
|
||||
@@ -242,7 +242,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: actions/setup-node@v4
|
||||
|
||||
- name: Download web build
|
||||
uses: actions/download-artifact@v4
|
||||
@@ -448,23 +448,23 @@ stages:
|
||||
- deploy
|
||||
|
||||
variables:
|
||||
BUN_VERSION: "1.0"
|
||||
NODE_VERSION: "1.0"
|
||||
|
||||
.bun-cache: &bun-cache
|
||||
.npm-cache: &npm-cache
|
||||
cache:
|
||||
key: ${CI_COMMIT_REF_SLUG}
|
||||
paths:
|
||||
- node_modules/
|
||||
- ~/.bun/install/cache
|
||||
- ~/.npm
|
||||
|
||||
test:
|
||||
stage: test
|
||||
image: oven/bun:${BUN_VERSION}
|
||||
<<: *bun-cache
|
||||
image: node:20
|
||||
<<: *npm-cache
|
||||
script:
|
||||
- bun install
|
||||
- bun run lint
|
||||
- bun test --coverage
|
||||
- npm install
|
||||
- npm run lint
|
||||
- npm test -- --coverage
|
||||
coverage: '/All files[^|]*\|[^|]*\s+([\d\.]+)/'
|
||||
artifacts:
|
||||
reports:
|
||||
@@ -474,7 +474,7 @@ test:
|
||||
|
||||
security:
|
||||
stage: test
|
||||
image: oven/bun:${BUN_VERSION}
|
||||
image: node:20
|
||||
script:
|
||||
- npx capsec scan --ci --output json --output-file security.json
|
||||
artifacts:
|
||||
@@ -483,11 +483,11 @@ security:
|
||||
|
||||
build-web:
|
||||
stage: build
|
||||
image: oven/bun:${BUN_VERSION}
|
||||
<<: *bun-cache
|
||||
image: node:20
|
||||
<<: *npm-cache
|
||||
script:
|
||||
- bun install
|
||||
- bun run build
|
||||
- npm install
|
||||
- npm run build
|
||||
artifacts:
|
||||
paths:
|
||||
- dist/
|
||||
@@ -499,7 +499,7 @@ build-ios:
|
||||
- macos
|
||||
needs: [build-web]
|
||||
script:
|
||||
- bun install
|
||||
- npm install
|
||||
- npx cap sync ios
|
||||
- cd ios/App && fastlane build
|
||||
artifacts:
|
||||
@@ -514,7 +514,7 @@ build-android:
|
||||
image: thyrlian/android-sdk
|
||||
needs: [build-web]
|
||||
script:
|
||||
- bun install
|
||||
- npm install
|
||||
- npx cap sync android
|
||||
- cd android && ./gradlew assembleRelease
|
||||
artifacts:
|
||||
@@ -526,7 +526,7 @@ build-android:
|
||||
|
||||
deploy-capgo:
|
||||
stage: deploy
|
||||
image: oven/bun:${BUN_VERSION}
|
||||
image: node:20
|
||||
needs: [build-web]
|
||||
script:
|
||||
- npx @capgo/cli upload --channel production
|
||||
@@ -571,7 +571,7 @@ base64 -i release.keystore | pbcopy
|
||||
### Semantic Release
|
||||
|
||||
```bash
|
||||
bun add -D semantic-release @semantic-release/git @semantic-release/changelog
|
||||
npm install -D semantic-release @semantic-release/git @semantic-release/changelog
|
||||
```
|
||||
|
||||
```json
|
||||
@@ -617,9 +617,9 @@ jobs:
|
||||
fetch-depth: 0
|
||||
persist-credentials: false
|
||||
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: actions/setup-node@v4
|
||||
|
||||
- run: bun install
|
||||
- run: npm install
|
||||
|
||||
- name: Release
|
||||
env:
|
||||
|
||||
@@ -28,7 +28,7 @@ Implement deep links, universal links, and app links in Capacitor apps.
|
||||
### Install Plugin
|
||||
|
||||
```bash
|
||||
bun add @capacitor/app
|
||||
npm install @capacitor/app
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
|
||||
@@ -18,7 +18,7 @@ Manage keyboard behavior in iOS and Android apps.
|
||||
## Quick Start
|
||||
|
||||
```bash
|
||||
bun add @capacitor/keyboard
|
||||
npm install @capacitor/keyboard
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
|
||||
@@ -41,7 +41,7 @@ Build apps that work seamlessly with or without internet connectivity.
|
||||
### Using Capacitor Network Plugin
|
||||
|
||||
```bash
|
||||
bun add @capacitor/network
|
||||
npm install @capacitor/network
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
|
||||
@@ -75,15 +75,12 @@ Add an iOS SPM install command if the project maintains script helpers.
|
||||
|
||||
### Step 6: Verify
|
||||
|
||||
Use the repository's existing package manager for dependency install.
|
||||
Install dependencies with the repository's existing package manager.
|
||||
|
||||
Run Capacitor sync from the example or test app directory that contains `capacitor.config.*`.
|
||||
Use the repository's package manager install command, then `cd example-app` and run the matching Capacitor sync command from there.
|
||||
|
||||
Then build that same example or test app.
|
||||
Then `cd` into the example or test app directory that contains `capacitor.config.*`, run `npx cap sync` (or the repository's equivalent runner) there, and build that same app.
|
||||
|
||||
## Error Handling
|
||||
|
||||
- For Swift package resolver failures, check the target path and package dependency names first.
|
||||
- For bridged plugin registration failures, verify the class name, `identifier`, and `jsName` match the exported API.
|
||||
- For unsupported CocoaPods dependencies, keep CocoaPods for those dependencies or replace them with SPM-compatible equivalents before removing the old bridge.
|
||||
- Start with the Swift package resolver: check the target path and package dependency names first.
|
||||
- Verify bridge registration by matching the class name, `identifier`, and `jsName` against the exported API.
|
||||
- For unsupported CocoaPods dependencies, replace them with SPM-compatible packages or keep CocoaPods for that dependency.
|
||||
|
||||
@@ -19,7 +19,7 @@ Upgrade a Capacitor plugin from version 4 to version 5.
|
||||
2. Update the peer dependency range to Capacitor 5.
|
||||
3. Review the v4 to v5 migration notes before editing native files.
|
||||
4. Update the example app if it exists.
|
||||
5. Run `bun install`.
|
||||
5. Run `npm install`.
|
||||
6. Sync and verify the example or test app.
|
||||
|
||||
## Error Handling
|
||||
|
||||
@@ -19,7 +19,7 @@ Upgrade a Capacitor plugin from version 5 to version 6.
|
||||
2. Update the peer dependency range to Capacitor 6.
|
||||
3. Review the v5 to v6 migration notes before editing native files.
|
||||
4. Update the example app if it exists.
|
||||
5. Run `bun install`.
|
||||
5. Run `npm install`.
|
||||
6. Sync and verify the example or test app.
|
||||
|
||||
## Error Handling
|
||||
|
||||
@@ -19,7 +19,7 @@ Upgrade a Capacitor plugin from version 6 to version 7.
|
||||
2. Update the peer dependency range to Capacitor 7.
|
||||
3. Review the v6 to v7 migration notes before editing native files.
|
||||
4. Update the example app if it exists.
|
||||
5. Run `bun install`.
|
||||
5. Run `npm install`.
|
||||
6. Sync and verify the example or test app.
|
||||
|
||||
## Error Handling
|
||||
|
||||
@@ -19,7 +19,7 @@ Upgrade a Capacitor plugin from version 7 to version 8.
|
||||
2. Update the peer dependency range to Capacitor 8.
|
||||
3. Review the v7 to v8 migration notes before editing native files.
|
||||
4. Update the example app if it exists.
|
||||
5. Run `bun install`.
|
||||
5. Run `npm install`.
|
||||
6. Sync and verify the example or test app.
|
||||
|
||||
## Error Handling
|
||||
|
||||
@@ -27,8 +27,8 @@ For each major jump:
|
||||
|
||||
1. Update `@capacitor/*` peer dependencies and native bridge code as needed.
|
||||
2. Adjust iOS and Android native project settings for the target Capacitor version.
|
||||
3. Run `bun install`.
|
||||
4. Sync or rebuild the example app with `bunx cap sync`.
|
||||
3. Run `npm install`.
|
||||
4. Run `npx cap sync` from the example or test app directory that contains `capacitor.config.*`, or rebuild that app with the repository's documented command.
|
||||
5. Verify the plugin API still works in the example app or test app.
|
||||
|
||||
Do not skip intermediate major versions.
|
||||
@@ -45,15 +45,20 @@ Review these plugin areas carefully:
|
||||
|
||||
### Step 4: Final Verification
|
||||
|
||||
Check whether `bun run verify` exists in `package.json` or the repository scripts.
|
||||
Check whether `npm run verify` exists in `package.json` or the repository scripts.
|
||||
|
||||
If it exists, run:
|
||||
|
||||
```bash
|
||||
bun run verify
|
||||
npm run verify
|
||||
```
|
||||
|
||||
If it does not exist, run the repository's documented build, test, and example-app verification commands instead.
|
||||
If it does not exist, run the repository's documented fallback checks instead:
|
||||
|
||||
- `npm run build`
|
||||
- `npm test`
|
||||
- `npx cap sync` from the example/test app directory
|
||||
- the example app or test app build for every shipped platform
|
||||
|
||||
Run the sync and build commands from the plugin's example/test app directory, not the plugin root.
|
||||
|
||||
|
||||
@@ -273,7 +273,7 @@ For official Capacitor packages, follow the package-specific instructions from `
|
||||
For Capgo plugins, use:
|
||||
|
||||
```bash
|
||||
bun add @capgo/capacitor-<name>
|
||||
npm install @capgo/capacitor-<name>
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
|
||||
@@ -7,8 +7,8 @@ Provides access to native Action Sheets.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/action-sheet
|
||||
bunx cap sync
|
||||
npm install @capacitor/action-sheet
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -7,8 +7,8 @@ Check if an app can be opened and open it via URL schemes or package names.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/app-launcher
|
||||
bunx cap sync
|
||||
npm install @capacitor/app-launcher
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -7,8 +7,8 @@ Handles high-level app state and events including foreground/background transiti
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/app
|
||||
bunx cap sync
|
||||
npm install @capacitor/app
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -7,8 +7,8 @@ Event-based standalone JavaScript environment for executing code outside the web
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/background-runner
|
||||
bunx cap sync
|
||||
npm install @capacitor/background-runner
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -7,8 +7,8 @@ Barcode/QR scanning using Outsystems Barcode libs.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/barcode-scanner
|
||||
bunx cap sync
|
||||
npm install @capacitor/barcode-scanner
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -7,8 +7,8 @@ Opens an in-app browser. Uses SFSafariViewController on iOS (OAuth-compliant).
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/browser
|
||||
bunx cap sync
|
||||
npm install @capacitor/browser
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -7,8 +7,8 @@ Photo capture and gallery selection.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/camera
|
||||
bunx cap sync
|
||||
npm install @capacitor/camera
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -7,8 +7,8 @@ System clipboard API for copy/paste operations.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/clipboard
|
||||
bunx cap sync
|
||||
npm install @capacitor/clipboard
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -7,8 +7,8 @@ Exposes internal device information (model, OS version, unique IDs).
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/device
|
||||
bunx cap sync
|
||||
npm install @capacitor/device
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -7,8 +7,8 @@ Triggers native dialog windows for alerts, confirmations, and prompts.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/dialog
|
||||
bunx cap sync
|
||||
npm install @capacitor/dialog
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -7,8 +7,8 @@ File upload and download with progress tracking.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/file-transfer
|
||||
bunx cap sync
|
||||
npm install @capacitor/file-transfer
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -7,8 +7,8 @@ Open files and preview media on mobile devices.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/file-viewer
|
||||
bunx cap sync
|
||||
npm install @capacitor/file-viewer
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -7,8 +7,8 @@ Node.js-like API for device file operations (read, write, delete, manage files a
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/filesystem
|
||||
bunx cap sync
|
||||
npm install @capacitor/filesystem
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -7,8 +7,8 @@ GPS position tracking with altitude, heading, and speed data.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/geolocation
|
||||
bunx cap sync
|
||||
npm install @capacitor/geolocation
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -7,8 +7,8 @@ Integrates Google Maps SDK into Capacitor applications.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/google-maps
|
||||
bunx cap sync
|
||||
npm install @capacitor/google-maps
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -7,8 +7,8 @@ Physical feedback through touch or vibration.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/haptics
|
||||
bunx cap sync
|
||||
npm install @capacitor/haptics
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -7,8 +7,8 @@ Opens URLs in WebView, in-app system browser, or external browser.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/inappbrowser
|
||||
bunx cap sync
|
||||
npm install @capacitor/inappbrowser
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -7,8 +7,8 @@ Keyboard display/visibility control and event tracking.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/keyboard
|
||||
bunx cap sync
|
||||
npm install @capacitor/keyboard
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -7,8 +7,8 @@ Schedule device notifications locally without server-based push.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/local-notifications
|
||||
bunx cap sync
|
||||
npm install @capacitor/local-notifications
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -7,8 +7,8 @@ Tracks accelerometer and device orientation (compass heading, etc.).
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/motion
|
||||
bunx cap sync
|
||||
npm install @capacitor/motion
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -7,8 +7,8 @@ Network and connectivity information.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/network
|
||||
bunx cap sync
|
||||
npm install @capacitor/network
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -7,8 +7,8 @@ Key/value storage for lightweight persistent data. Not a database replacement.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/preferences
|
||||
bunx cap sync
|
||||
npm install @capacitor/preferences
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -7,8 +7,8 @@ Prevents sensitive app information from appearing in app switchers/recent apps.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/privacy-screen
|
||||
bunx cap sync
|
||||
npm install @capacitor/privacy-screen
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -7,8 +7,8 @@ Native push notifications via FCM (Android) and APNs (iOS).
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/push-notifications
|
||||
bunx cap sync
|
||||
npm install @capacitor/push-notifications
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -7,8 +7,8 @@ Screen orientation information and locking.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/screen-orientation
|
||||
bunx cap sync
|
||||
npm install @capacitor/screen-orientation
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -7,8 +7,8 @@ Access TalkBack/VoiceOver and text-to-speech for accessibility.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/screen-reader
|
||||
bunx cap sync
|
||||
npm install @capacitor/screen-reader
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -7,8 +7,8 @@ Share content through the system share sheet.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/share
|
||||
bunx cap sync
|
||||
npm install @capacitor/share
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -7,8 +7,8 @@ Control display and hiding of splash screen images.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/splash-screen
|
||||
bunx cap sync
|
||||
npm install @capacitor/splash-screen
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -7,8 +7,8 @@ Configure style, visibility, and background color of the Status Bar.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/status-bar
|
||||
bunx cap sync
|
||||
npm install @capacitor/status-bar
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -7,8 +7,8 @@ Change WebView text size for visual accessibility.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/text-zoom
|
||||
bunx cap sync
|
||||
npm install @capacitor/text-zoom
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -7,8 +7,8 @@ Display a notification popup.
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/toast
|
||||
bunx cap sync
|
||||
npm install @capacitor/toast
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
@@ -7,8 +7,8 @@ Build watch interfaces in web code for display on paired Apple Watch devices. Ex
|
||||
## Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/watch
|
||||
bunx cap sync
|
||||
npm install @capacitor/watch
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
## Configuration
|
||||
|
||||
@@ -20,7 +20,7 @@ Implement push notifications for iOS and Android using Firebase and APNs.
|
||||
### Install Plugin
|
||||
|
||||
```bash
|
||||
bun add @capacitor/push-notifications
|
||||
npm install @capacitor/push-notifications
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
|
||||
@@ -372,7 +372,7 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: actions/setup-node@v4
|
||||
|
||||
- name: Run Capsec Security Scan
|
||||
run: npx capsec scan --ci --output json --output-file security-report.json
|
||||
@@ -389,7 +389,7 @@ jobs:
|
||||
|
||||
```yaml
|
||||
security-scan:
|
||||
image: oven/bun:latest
|
||||
image: node:20
|
||||
script:
|
||||
- npx capsec scan --ci
|
||||
artifacts:
|
||||
|
||||
@@ -19,7 +19,7 @@ Configure and customize splash screens for iOS and Android.
|
||||
### Install Plugin
|
||||
|
||||
```bash
|
||||
bun add @capacitor/splash-screen
|
||||
npm install @capacitor/splash-screen
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
@@ -76,7 +76,7 @@ await SplashScreen.hide({
|
||||
### Using Capacitor Assets
|
||||
|
||||
```bash
|
||||
bun add -D @capacitor/assets
|
||||
npm install -D @capacitor/assets
|
||||
|
||||
# Place source images in resources/
|
||||
# resources/splash.png (2732x2732 recommended)
|
||||
|
||||
@@ -35,7 +35,7 @@ Comprehensive testing strategies for Capacitor mobile apps.
|
||||
### Setup with Vitest
|
||||
|
||||
```bash
|
||||
bun add -D vitest @vitest/coverage-v8
|
||||
npm install -D vitest @vitest/coverage-v8
|
||||
```
|
||||
|
||||
```typescript
|
||||
@@ -185,7 +185,7 @@ describe('Platform-specific behavior', () => {
|
||||
### React Testing Library
|
||||
|
||||
```bash
|
||||
bun add -D @testing-library/react @testing-library/user-event
|
||||
npm install -D @testing-library/react @testing-library/user-event
|
||||
```
|
||||
|
||||
```typescript
|
||||
@@ -219,7 +219,7 @@ describe('LoginButton', () => {
|
||||
### Vue Test Utils
|
||||
|
||||
```bash
|
||||
bun add -D @vue/test-utils
|
||||
npm install -D @vue/test-utils
|
||||
```
|
||||
|
||||
```typescript
|
||||
@@ -252,7 +252,7 @@ describe('LoginButton', () => {
|
||||
### Playwright for Web
|
||||
|
||||
```bash
|
||||
bun add -D @playwright/test
|
||||
npm install -D @playwright/test
|
||||
npx playwright install
|
||||
```
|
||||
|
||||
@@ -282,7 +282,7 @@ export default defineConfig({
|
||||
},
|
||||
],
|
||||
webServer: {
|
||||
command: 'bun run dev',
|
||||
command: 'npm run dev',
|
||||
url: 'http://localhost:5173',
|
||||
reuseExistingServer: !process.env.CI,
|
||||
},
|
||||
@@ -320,7 +320,7 @@ test.describe('Login Flow', () => {
|
||||
### Appium for Native
|
||||
|
||||
```bash
|
||||
bun add -D webdriverio @wdio/appium-service @wdio/mocha-framework
|
||||
npm install -D webdriverio @wdio/appium-service @wdio/mocha-framework
|
||||
```
|
||||
|
||||
```typescript
|
||||
@@ -375,7 +375,7 @@ describe('Native Login', () => {
|
||||
### Detox for React Native Style Testing
|
||||
|
||||
```bash
|
||||
bun add -D detox
|
||||
npm install -D detox
|
||||
```
|
||||
|
||||
```javascript
|
||||
@@ -549,18 +549,18 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- run: bun install
|
||||
- run: bun test --coverage
|
||||
- uses: actions/setup-node@v4
|
||||
- run: npm install
|
||||
- run: npm test -- --coverage
|
||||
|
||||
e2e:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- run: bun install
|
||||
- uses: actions/setup-node@v4
|
||||
- run: npm install
|
||||
- run: npx playwright install --with-deps
|
||||
- run: bun run build
|
||||
- run: npm run build
|
||||
- run: npx playwright test
|
||||
|
||||
ios:
|
||||
|
||||
@@ -37,7 +37,7 @@ Route specific workflows to the matching skill:
|
||||
Prefer the current CLI form:
|
||||
|
||||
```bash
|
||||
bunx @capgo/cli@latest doctor
|
||||
npx @capgo/cli@latest doctor
|
||||
```
|
||||
|
||||
## Error Handling
|
||||
|
||||
@@ -43,7 +43,7 @@ Capgo is a live update service for Capacitor apps that lets you:
|
||||
### Step 2: Install the CLI
|
||||
|
||||
```bash
|
||||
bun add -g @capgo/cli
|
||||
npm install -g @capgo/cli
|
||||
```
|
||||
|
||||
### Step 3: Login to Capgo
|
||||
@@ -76,7 +76,7 @@ This will:
|
||||
If not installed automatically:
|
||||
|
||||
```bash
|
||||
bun add @capgo/capacitor-updater
|
||||
npm install @capgo/capacitor-updater
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
@@ -266,7 +266,7 @@ CapacitorUpdater.addListener('appReady', () => {
|
||||
|
||||
```bash
|
||||
# Build your web app
|
||||
bun run build
|
||||
npm run build
|
||||
|
||||
# Upload to Capgo
|
||||
capgo upload
|
||||
@@ -296,13 +296,13 @@ jobs:
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
|
||||
- uses: oven-sh/setup-bun@v1
|
||||
- uses: actions/setup-node@v4
|
||||
|
||||
- name: Install dependencies
|
||||
run: bun install
|
||||
run: npm install
|
||||
|
||||
- name: Build
|
||||
run: bun run build
|
||||
run: npm run build
|
||||
|
||||
- name: Deploy to Capgo
|
||||
run: npx @capgo/cli upload
|
||||
@@ -316,10 +316,10 @@ jobs:
|
||||
# .gitlab-ci.yml
|
||||
deploy:
|
||||
stage: deploy
|
||||
image: oven/bun
|
||||
image: node:20
|
||||
script:
|
||||
- bun install
|
||||
- bun run build
|
||||
- npm install
|
||||
- npm run build
|
||||
- npx @capgo/cli upload
|
||||
only:
|
||||
- main
|
||||
|
||||
@@ -29,7 +29,7 @@ Use the credential workflow that matches the platform:
|
||||
Prefer the Capgo build flow:
|
||||
|
||||
```bash
|
||||
bunx @capgo/cli@latest build request com.example.app --platform ios --path .
|
||||
npx @capgo/cli@latest build request com.example.app --platform ios --path .
|
||||
```
|
||||
|
||||
Use `--platform android` for Android builds.
|
||||
|
||||
@@ -29,7 +29,7 @@ Decide whether the request is:
|
||||
Prefer the Capgo CLI:
|
||||
|
||||
```bash
|
||||
bunx @capgo/cli@latest organization list
|
||||
npx @capgo/cli@latest organization list
|
||||
```
|
||||
|
||||
Use `account id` for safe account sharing and support workflows.
|
||||
|
||||
@@ -29,7 +29,7 @@ Use the matching command group:
|
||||
Prefer the current Capgo CLI:
|
||||
|
||||
```bash
|
||||
bunx @capgo/cli@latest bundle upload com.example.app --path ./dist --channel production
|
||||
npx @capgo/cli@latest bundle upload com.example.app --path ./dist --channel production
|
||||
```
|
||||
|
||||
Use compatibility checks before channel changes when the user is unsure whether a bundle is safe for rollout.
|
||||
|
||||
@@ -52,7 +52,7 @@ cat config.xml
|
||||
**In your existing Cordova project:**
|
||||
```bash
|
||||
# Install Capacitor
|
||||
bun add @capacitor/core @capacitor/cli
|
||||
npm install @capacitor/core @capacitor/cli
|
||||
|
||||
# Initialize Capacitor
|
||||
npx cap init
|
||||
@@ -69,11 +69,11 @@ npx cap init
|
||||
|
||||
```bash
|
||||
# Add iOS platform
|
||||
bun add @capacitor/ios
|
||||
npm install @capacitor/ios
|
||||
npx cap add ios
|
||||
|
||||
# Add Android platform
|
||||
bun add @capacitor/android
|
||||
npm install @capacitor/android
|
||||
npx cap add android
|
||||
```
|
||||
|
||||
@@ -89,20 +89,20 @@ This creates:
|
||||
|
||||
| Cordova Plugin | Capacitor Equivalent | Install Command |
|
||||
|----------------|---------------------|-----------------|
|
||||
| cordova-plugin-camera | @capacitor/camera | `bun add @capacitor/camera` |
|
||||
| cordova-plugin-geolocation | @capacitor/geolocation | `bun add @capacitor/geolocation` |
|
||||
| cordova-plugin-device | @capacitor/device | `bun add @capacitor/device` |
|
||||
| cordova-plugin-network-information | @capacitor/network | `bun add @capacitor/network` |
|
||||
| cordova-plugin-statusbar | @capacitor/status-bar | `bun add @capacitor/status-bar` |
|
||||
| cordova-plugin-splashscreen | @capacitor/splash-screen | `bun add @capacitor/splash-screen` |
|
||||
| cordova-plugin-keyboard | @capacitor/keyboard | `bun add @capacitor/keyboard` |
|
||||
| cordova-plugin-dialogs | @capacitor/dialog | `bun add @capacitor/dialog` |
|
||||
| cordova-plugin-file | @capacitor/filesystem | `bun add @capacitor/filesystem` |
|
||||
| cordova-plugin-inappbrowser | @capacitor/browser | `bun add @capacitor/browser` |
|
||||
| cordova-plugin-camera | @capacitor/camera | `npm install @capacitor/camera` |
|
||||
| cordova-plugin-geolocation | @capacitor/geolocation | `npm install @capacitor/geolocation` |
|
||||
| cordova-plugin-device | @capacitor/device | `npm install @capacitor/device` |
|
||||
| cordova-plugin-network-information | @capacitor/network | `npm install @capacitor/network` |
|
||||
| cordova-plugin-statusbar | @capacitor/status-bar | `npm install @capacitor/status-bar` |
|
||||
| cordova-plugin-splashscreen | @capacitor/splash-screen | `npm install @capacitor/splash-screen` |
|
||||
| cordova-plugin-keyboard | @capacitor/keyboard | `npm install @capacitor/keyboard` |
|
||||
| cordova-plugin-dialogs | @capacitor/dialog | `npm install @capacitor/dialog` |
|
||||
| cordova-plugin-file | @capacitor/filesystem | `npm install @capacitor/filesystem` |
|
||||
| cordova-plugin-inappbrowser | @capacitor/browser | `npm install @capacitor/browser` |
|
||||
| cordova-plugin-media | @capacitor/media | Custom or use @capgo plugins |
|
||||
| cordova-plugin-vibration | @capacitor/haptics | `bun add @capacitor/haptics` |
|
||||
| cordova-plugin-local-notifications | @capacitor/local-notifications | `bun add @capacitor/local-notifications` |
|
||||
| cordova-plugin-push | @capacitor/push-notifications | `bun add @capacitor/push-notifications` |
|
||||
| cordova-plugin-vibration | @capacitor/haptics | `npm install @capacitor/haptics` |
|
||||
| cordova-plugin-local-notifications | @capacitor/local-notifications | `npm install @capacitor/local-notifications` |
|
||||
| cordova-plugin-push | @capacitor/push-notifications | `npm install @capacitor/push-notifications` |
|
||||
|
||||
#### Third-Party Cordova Plugins → Capgo Equivalents
|
||||
|
||||
@@ -112,7 +112,7 @@ This creates:
|
||||
cordova plugin add cordova-plugin-fingerprint-aio
|
||||
|
||||
# Capacitor
|
||||
bun add @capgo/capacitor-native-biometric
|
||||
npm install @capgo/capacitor-native-biometric
|
||||
```
|
||||
|
||||
**For payments:**
|
||||
@@ -121,16 +121,16 @@ bun add @capgo/capacitor-native-biometric
|
||||
cordova plugin add cordova-plugin-purchase
|
||||
|
||||
# Capacitor
|
||||
bun add @capgo/capacitor-purchases
|
||||
npm install @capgo/capacitor-purchases
|
||||
```
|
||||
|
||||
**For social login:**
|
||||
```bash
|
||||
# Facebook
|
||||
bun add @capgo/capacitor-social-login
|
||||
npm install @capgo/capacitor-social-login
|
||||
|
||||
# Google
|
||||
bun add @codetrix-studio/capacitor-google-auth
|
||||
npm install @codetrix-studio/capacitor-google-auth
|
||||
```
|
||||
|
||||
**Check the full plugin catalog:**
|
||||
@@ -360,9 +360,9 @@ cordova platform remove ios
|
||||
cordova platform remove android
|
||||
|
||||
# Remove Cordova
|
||||
bun remove cordova
|
||||
bun remove cordova-ios
|
||||
bun remove cordova-android
|
||||
npm uninstall cordova
|
||||
npm uninstall cordova-ios
|
||||
npm uninstall cordova-android
|
||||
|
||||
# Remove Cordova plugins
|
||||
cordova plugin list | xargs -I {} cordova plugin remove {}
|
||||
@@ -381,7 +381,7 @@ Error: Plugin not found
|
||||
```
|
||||
|
||||
**Solution:**
|
||||
1. Check if plugin is installed: `bun list`
|
||||
1. Check if plugin is installed: `npm list`
|
||||
2. Sync native projects: `npx cap sync`
|
||||
3. Clean and rebuild in Xcode/Android Studio
|
||||
|
||||
@@ -411,7 +411,7 @@ App shows white screen or crashes.
|
||||
|
||||
**Solution:**
|
||||
1. Check `webDir` in capacitor.config.ts points to correct build output
|
||||
2. Rebuild web app: `bun run build`
|
||||
2. Rebuild web app: `npm run build`
|
||||
3. Sync: `npx cap sync`
|
||||
4. Check browser console in device for errors
|
||||
|
||||
@@ -441,7 +441,7 @@ Some third-party Cordova plugins still reference Cordova global.
|
||||
Use the Capacitor Cordova compatibility layer:
|
||||
|
||||
```bash
|
||||
bun add cordova-plugin-example
|
||||
npm install cordova-plugin-example
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
@@ -464,7 +464,7 @@ Capacitor includes Cordova compatibility, but:
|
||||
|
||||
- [ ] List all Cordova plugins: `cordova plugin list`
|
||||
- [ ] Find Capacitor equivalents (use table above)
|
||||
- [ ] Install Capacitor plugins: `bun add @capacitor/plugin-name`
|
||||
- [ ] Install Capacitor plugins: `npm install @capacitor/plugin-name`
|
||||
- [ ] Update imports in code
|
||||
- [ ] Convert callbacks to async/await
|
||||
- [ ] Remove `deviceready` event listeners
|
||||
@@ -481,15 +481,15 @@ After migration, add Capgo for OTA updates:
|
||||
|
||||
```bash
|
||||
# Install Capgo plugin
|
||||
bun add @capgo/capacitor-updater
|
||||
npm install @capgo/capacitor-updater
|
||||
|
||||
# Create account at capgo.app
|
||||
bun add -g @capgo/cli
|
||||
npm install -g @capgo/cli
|
||||
capgo login
|
||||
|
||||
# Initialize and deploy
|
||||
capgo init
|
||||
bun run build
|
||||
npm run build
|
||||
capgo upload
|
||||
```
|
||||
|
||||
|
||||
@@ -262,7 +262,7 @@ console.log('MyPlugin available:', !!Capacitor.Plugins.MyPlugin);
|
||||
```
|
||||
|
||||
**Solutions**:
|
||||
1. Ensure plugin is installed: `bun add @capgo/plugin-name`
|
||||
1. Ensure plugin is installed: `npm install @capgo/plugin-name`
|
||||
2. Run sync: `npx cap sync`
|
||||
3. Check plugin is registered (native code)
|
||||
|
||||
@@ -344,7 +344,7 @@ console.log('Camera permission:', status.state);
|
||||
**Solutions**:
|
||||
```bash
|
||||
# Rebuild web assets
|
||||
bun run build
|
||||
npm run build
|
||||
|
||||
# Sync to native
|
||||
npx cap sync
|
||||
@@ -432,7 +432,7 @@ When debugging issues:
|
||||
- [ ] Verify plugin is installed and synced
|
||||
- [ ] Check permissions (Info.plist/AndroidManifest)
|
||||
- [ ] Test on real device (not just simulator)
|
||||
- [ ] Try clean build (`rm -rf node_modules && bun install`)
|
||||
- [ ] Try clean build (`rm -rf node_modules && npm install`)
|
||||
- [ ] Verify capacitor.config.ts settings
|
||||
- [ ] Check for version mismatches (capacitor packages)
|
||||
|
||||
|
||||
@@ -68,7 +68,7 @@ module.exports = {
|
||||
### Step 2: Build Static Files
|
||||
|
||||
```bash
|
||||
bun run build
|
||||
npm run build
|
||||
```
|
||||
|
||||
This creates an `out/` directory with static files.
|
||||
@@ -76,7 +76,7 @@ This creates an `out/` directory with static files.
|
||||
### Step 3: Install Capacitor
|
||||
|
||||
```bash
|
||||
bun add @capacitor/core @capacitor/cli
|
||||
npm install @capacitor/core @capacitor/cli
|
||||
npx cap init
|
||||
```
|
||||
|
||||
@@ -106,7 +106,7 @@ export default config;
|
||||
### Step 5: Add Platforms
|
||||
|
||||
```bash
|
||||
bun add @capacitor/ios @capacitor/android
|
||||
npm install @capacitor/ios @capacitor/android
|
||||
npx cap add ios
|
||||
npx cap add android
|
||||
```
|
||||
@@ -115,7 +115,7 @@ npx cap add android
|
||||
|
||||
```bash
|
||||
# Build Next.js
|
||||
bun run build
|
||||
npm run build
|
||||
|
||||
# Sync with native projects
|
||||
npx cap sync
|
||||
@@ -260,14 +260,14 @@ React works great with Capacitor using Vite or Create React App.
|
||||
|
||||
**Create new project:**
|
||||
```bash
|
||||
bun create vite my-app --template react-ts
|
||||
npx create-vite@latest my-app --template react-ts
|
||||
cd my-app
|
||||
bun install
|
||||
npm install
|
||||
```
|
||||
|
||||
**Install Capacitor:**
|
||||
```bash
|
||||
bun add @capacitor/core @capacitor/cli
|
||||
npm install @capacitor/core @capacitor/cli
|
||||
npx cap init
|
||||
```
|
||||
|
||||
@@ -299,10 +299,10 @@ export default config;
|
||||
|
||||
**Add platforms and build:**
|
||||
```bash
|
||||
bun add @capacitor/ios @capacitor/android
|
||||
npm install @capacitor/ios @capacitor/android
|
||||
npx cap add ios
|
||||
npx cap add android
|
||||
bun run build
|
||||
npm run build
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
@@ -316,7 +316,7 @@ cd my-app
|
||||
|
||||
**Install Capacitor:**
|
||||
```bash
|
||||
bun add @capacitor/core @capacitor/cli
|
||||
npm install @capacitor/core @capacitor/cli
|
||||
npx cap init
|
||||
```
|
||||
|
||||
@@ -331,7 +331,7 @@ const config: CapacitorConfig = {
|
||||
|
||||
**Build and sync:**
|
||||
```bash
|
||||
bun run build
|
||||
npm run build
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
@@ -363,14 +363,14 @@ Vue works seamlessly with Capacitor.
|
||||
|
||||
**Using Vite:**
|
||||
```bash
|
||||
bun create vite my-app --template vue-ts
|
||||
npx create-vite@latest my-app --template vue-ts
|
||||
cd my-app
|
||||
bun install
|
||||
npm install
|
||||
```
|
||||
|
||||
**Install Capacitor:**
|
||||
```bash
|
||||
bun add @capacitor/core @capacitor/cli
|
||||
npm install @capacitor/core @capacitor/cli
|
||||
npx cap init
|
||||
```
|
||||
|
||||
@@ -398,10 +398,10 @@ const config: CapacitorConfig = {
|
||||
|
||||
**Add platforms:**
|
||||
```bash
|
||||
bun add @capacitor/ios @capacitor/android
|
||||
npm install @capacitor/ios @capacitor/android
|
||||
npx cap add ios
|
||||
npx cap add android
|
||||
bun run build
|
||||
npm run build
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
@@ -439,7 +439,7 @@ cd my-app
|
||||
|
||||
**Install Capacitor:**
|
||||
```bash
|
||||
bun add @capacitor/core @capacitor/cli
|
||||
npm install @capacitor/core @capacitor/cli
|
||||
npx cap init
|
||||
```
|
||||
|
||||
@@ -459,10 +459,10 @@ webDir: 'dist/my-app',
|
||||
|
||||
**Add platforms:**
|
||||
```bash
|
||||
bun add @capacitor/ios @capacitor/android
|
||||
npm install @capacitor/ios @capacitor/android
|
||||
npx cap add ios
|
||||
npx cap add android
|
||||
bun run build
|
||||
npm run build
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
@@ -505,12 +505,12 @@ Svelte and SvelteKit work great with Capacitor.
|
||||
```bash
|
||||
npx create-svelte my-app
|
||||
cd my-app
|
||||
bun install
|
||||
npm install
|
||||
```
|
||||
|
||||
**Install adapter-static:**
|
||||
```bash
|
||||
bun add -D @sveltejs/adapter-static
|
||||
npm install -D @sveltejs/adapter-static
|
||||
```
|
||||
|
||||
**Configure svelte.config.js:**
|
||||
@@ -532,7 +532,7 @@ export default config;
|
||||
|
||||
**Install Capacitor:**
|
||||
```bash
|
||||
bun add @capacitor/core @capacitor/cli
|
||||
npm install @capacitor/core @capacitor/cli
|
||||
npx cap init
|
||||
```
|
||||
|
||||
@@ -547,7 +547,7 @@ const config: CapacitorConfig = {
|
||||
|
||||
**Build and sync:**
|
||||
```bash
|
||||
bun run build
|
||||
npm run build
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
@@ -555,14 +555,14 @@ npx cap sync
|
||||
|
||||
**Create with Vite:**
|
||||
```bash
|
||||
bun create vite my-app --template svelte-ts
|
||||
npx create-vite@latest my-app --template svelte-ts
|
||||
cd my-app
|
||||
bun install
|
||||
npm install
|
||||
```
|
||||
|
||||
**Install Capacitor:**
|
||||
```bash
|
||||
bun add @capacitor/core @capacitor/cli
|
||||
npm install @capacitor/core @capacitor/cli
|
||||
npx cap init
|
||||
```
|
||||
|
||||
@@ -612,7 +612,7 @@ App.addListener('appUrlOpen', (data) => {
|
||||
|
||||
**Add live updates to any framework:**
|
||||
```bash
|
||||
bun add @capgo/capacitor-updater
|
||||
npm install @capgo/capacitor-updater
|
||||
```
|
||||
|
||||
```typescript
|
||||
@@ -631,22 +631,22 @@ await CapacitorUpdater.set({ id });
|
||||
|
||||
**Use Ionic Framework for any framework:**
|
||||
```bash
|
||||
bun add @ionic/core
|
||||
npm install @ionic/core
|
||||
```
|
||||
|
||||
**React:**
|
||||
```bash
|
||||
bun add @ionic/react @ionic/react-router
|
||||
npm install @ionic/react @ionic/react-router
|
||||
```
|
||||
|
||||
**Vue:**
|
||||
```bash
|
||||
bun add @ionic/vue @ionic/vue-router
|
||||
npm install @ionic/vue @ionic/vue-router
|
||||
```
|
||||
|
||||
**Angular:**
|
||||
```bash
|
||||
bun add @ionic/angular
|
||||
npm install @ionic/angular
|
||||
```
|
||||
|
||||
### 5. Storage
|
||||
@@ -729,7 +729,7 @@ const imageUrl = photo.webPath;
|
||||
|
||||
**Solution:**
|
||||
1. Check build output directory matches `webDir` in capacitor.config.ts
|
||||
2. Rebuild: `bun run build`
|
||||
2. Rebuild: `npm run build`
|
||||
3. Sync: `npx cap sync`
|
||||
4. Check browser console in device
|
||||
|
||||
|
||||
@@ -30,17 +30,17 @@ Ionic provides:
|
||||
|
||||
```bash
|
||||
# For React
|
||||
bun create vite my-app --template react-ts
|
||||
npx create-vite@latest my-app --template react-ts
|
||||
cd my-app
|
||||
bun add @ionic/react @ionic/react-router
|
||||
npm install @ionic/react @ionic/react-router
|
||||
|
||||
# For Vue
|
||||
bun create vite my-app --template vue-ts
|
||||
npx create-vite@latest my-app --template vue-ts
|
||||
cd my-app
|
||||
bun add @ionic/vue @ionic/vue-router
|
||||
npm install @ionic/vue @ionic/vue-router
|
||||
|
||||
# Add Capacitor
|
||||
bun add @capacitor/core @capacitor/cli
|
||||
npm install @capacitor/core @capacitor/cli
|
||||
npx cap init
|
||||
```
|
||||
|
||||
|
||||
@@ -79,11 +79,11 @@ Replace or remove any leftovers before continuing.
|
||||
|
||||
### Step 6: Clean Up and Verify
|
||||
|
||||
Remove unused enterprise packages from `package.json`, reinstall dependencies, and sync the project:
|
||||
Remove unused enterprise packages from `package.json`, reinstall dependencies with the repository's existing package manager, and run sync from the app directory that contains `capacitor.config.*`:
|
||||
|
||||
```bash
|
||||
bun install
|
||||
bunx cap sync
|
||||
npm install
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
Then verify the app builds on every shipped platform.
|
||||
|
||||
@@ -30,16 +30,16 @@ Konsta UI provides:
|
||||
|
||||
```bash
|
||||
# React
|
||||
bun add konsta
|
||||
npm install konsta
|
||||
|
||||
# Vue
|
||||
bun add konsta
|
||||
npm install konsta
|
||||
|
||||
# Svelte
|
||||
bun add konsta
|
||||
npm install konsta
|
||||
|
||||
# Required: Tailwind CSS
|
||||
bun add -D tailwindcss postcss autoprefixer
|
||||
npm install -D tailwindcss postcss autoprefixer
|
||||
npx tailwindcss init -p
|
||||
```
|
||||
|
||||
|
||||
@@ -428,7 +428,7 @@ class MainActivity : BridgeActivity() {
|
||||
### Installation
|
||||
|
||||
```bash
|
||||
bun add @capacitor/status-bar
|
||||
npm install @capacitor/status-bar
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
|
||||
@@ -7,15 +7,20 @@ defaults:
|
||||
provider: local
|
||||
trials: 3
|
||||
timeout: 300
|
||||
threshold: 0.8
|
||||
threshold: 1.0
|
||||
|
||||
tasks:
|
||||
- name: fix-skill-draft
|
||||
instruction: |
|
||||
Rewrite `draft/SKILL.md` so it follows the skill authoring standard.
|
||||
|
||||
Keep the file lean, use YAML frontmatter, include a clear "When to Use This Skill" section, and add an "Error Handling" section.
|
||||
Preserve the overall purpose of the draft, but make the metadata and structure production-ready.
|
||||
Keep the file lean and production-ready while preserving the draft's purpose.
|
||||
Requirements:
|
||||
- Use YAML frontmatter at the top of the file.
|
||||
- Include a non-empty `name`.
|
||||
- Include a non-empty `description`.
|
||||
- Include a clear "When to Use This Skill" section.
|
||||
- Include an "Error Handling" section.
|
||||
|
||||
workspace:
|
||||
- src: fixtures/broken-skill/SKILL.md
|
||||
@@ -23,5 +28,5 @@ tasks:
|
||||
|
||||
graders:
|
||||
- type: deterministic
|
||||
run: bun graders/check-skill.js
|
||||
run: node graders/check-skill.js
|
||||
weight: 1
|
||||
|
||||
@@ -1,6 +1,21 @@
|
||||
import { readFileSync } from 'node:fs';
|
||||
|
||||
const skill = readFileSync('draft/SKILL.md', 'utf8');
|
||||
let skill = '';
|
||||
try {
|
||||
skill = readFileSync('draft/SKILL.md', 'utf8');
|
||||
} catch (error) {
|
||||
console.log(JSON.stringify({
|
||||
status: 'failure',
|
||||
reason: 'missing input file',
|
||||
file: 'draft/SKILL.md',
|
||||
details: error instanceof Error ? error.message : String(error),
|
||||
score: 0,
|
||||
checks: [
|
||||
{ name: 'input-file', passed: false, message: 'Missing or unreadable draft/SKILL.md' },
|
||||
],
|
||||
}));
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const checks = [];
|
||||
let passed = 0;
|
||||
@@ -10,12 +25,14 @@ function addCheck(name, condition, message) {
|
||||
if (condition) passed += 1;
|
||||
}
|
||||
|
||||
addCheck('frontmatter', /^---\n[\s\S]*?\n---/m.test(skill), 'Missing YAML frontmatter');
|
||||
addCheck('name', /name:\s*skill-creator\b/.test(skill), 'name must be skill-creator');
|
||||
addCheck('description', /description:\s*.+/.test(skill), 'description missing');
|
||||
const frontmatterMatch = skill.match(/^---\r?\n([\s\S]*?)\r?\n---\r?\n?/);
|
||||
const frontmatter = frontmatterMatch?.[1] ?? '';
|
||||
|
||||
addCheck('frontmatter', Boolean(frontmatterMatch), 'Missing YAML frontmatter at the top of the file');
|
||||
addCheck('name', /^name:\s*\S.+$/m.test(frontmatter), 'name missing');
|
||||
addCheck('description', /^description:\s*\S.+$/m.test(frontmatter), 'description missing');
|
||||
addCheck('usage', /## When to Use This Skill/.test(skill), 'Missing usage section');
|
||||
addCheck('error-handling', /## Error Handling/.test(skill), 'Missing error handling section');
|
||||
addCheck('no-readme', !/README\.md/.test(skill), 'Should not mention README.md');
|
||||
|
||||
const score = (passed / checks.length).toFixed(2);
|
||||
console.log(JSON.stringify({
|
||||
|
||||
@@ -58,8 +58,8 @@ Map the old plugin calls to Fast SQL equivalents:
|
||||
Install the new package with the repository's package manager and sync native projects.
|
||||
|
||||
```bash
|
||||
bun add @capgo/capacitor-fast-sql
|
||||
bunx cap sync
|
||||
npm install @capgo/capacitor-fast-sql
|
||||
npx cap sync
|
||||
```
|
||||
|
||||
If the app ships web support, install `sql.js` for the web fallback when needed.
|
||||
|
||||
@@ -20,7 +20,7 @@ Build beautiful mobile apps with Tailwind CSS and Capacitor.
|
||||
### Installation
|
||||
|
||||
```bash
|
||||
bun add -D tailwindcss postcss autoprefixer
|
||||
npm install -D tailwindcss postcss autoprefixer
|
||||
npx tailwindcss init -p
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user