Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: adds bridge definition + iOS implementation #1

Merged
merged 8 commits into from
Feb 17, 2025
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
56 changes: 56 additions & 0 deletions .github/ISSUE_TEMPLATE/bug-report.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
---
name: 🚨 Bug Report
about: Report something not working
title: ""
labels: ""
assignees: ""
---

## Bug Report

### Capacitor Version

<!--
Paste the output from the `npx cap doctor` command into the code block below. This will provide the versions of Capacitor packages and related dependencies.
-->

```
PASTE OUTPUT HERE
```

### Platform(s)

<!--
List the platforms that this bug affects.
-->

### Current Behavior

<!--
Describe how the bug manifests. Be specific.
-->

### Expected Behavior

<!--
Describe what the behavior should be.
-->

### Code Reproduction

<!--
To isolate the cause of the problem, we ask you to provide a minimal sample application that demonstrates the issue.
For full instructions, see: https://github.com/ionic-team/capacitor/blob/master/CONTRIBUTING.md#creating-a-code-reproduction
-->

### Other Technical Details

<!--
Please provide the following information with your request and any other relevant technical details (versions of IDEs, local environment info, plugin information or links, etc).
-->

### Additional Context

<!--
List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, Stack Overflow links, forum links, etc.
-->
41 changes: 41 additions & 0 deletions .github/ISSUE_TEMPLATE/feature-request.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
---
name: ⚡️ Feature Request
about: Request a feature or change
title: ""
labels: ""
assignees: ""
---

## Feature Request

### Plugin

<!--
List which plugin this feature is for.
-->

### Description

<!--
Describe the feature request. If your feature request is related to a problem, be sure to describe that as well.
-->

### Platform(s)

<!--
List the platforms for which this feature should be added.
-->

### Preferred Solution

<!-- Describe the solution you would prefer. -->

### Alternatives

<!-- Describe alternative solutions or features you've considered, if any. -->

### Additional Context

<!--
List any other information that is relevant to your issue. Stack traces, related issues, suggestions on how to fix, Stack Overflow links, forum links, etc.
-->
30 changes: 30 additions & 0 deletions .github/ISSUE_TEMPLATE/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
## Description

<!--- Describe your changes in detail -->

## Context

<!--- Why is this change required? What problem does it solve? -->
<!--- Place the link to the issue here -->

## Type of changes

<!--- What types of changes does your code introduce? Put an `x` in all the boxes that apply -->

- [ ] Fix (non-breaking change which fixes an issue)
- [ ] Feature (non-breaking change which adds functionality)
- [ ] Refactor (cosmetic changes)
- [ ] Breaking change (change that would cause existing functionality to not work as expected)

## Platforms affected

- [ ] Android
- [ ] iOS
- [ ] JavaScript

## Tests

<!--- Describe how you tested your changes in detail -->
<!--- Include details of your test environment if relevant -->

## Screenshots (if appropriate)
14 changes: 14 additions & 0 deletions .github/actions/setup-tools/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
name: 'Setup Tools'
description: 'Setup tools needed in repo'

runs:
using: 'composite'
steps:
- name: Install Node.js
uses: actions/setup-node@v4
with:
node-version: 23
- name: Install dependencies
working-directory: ./packages/capacitor-plugin
shell: bash
run: npm i
Binary file added .github/assets/logo.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
56 changes: 56 additions & 0 deletions .github/workflows/continuous_integration.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
name: "Continuous Integrations"

on:
pull_request:
types: [opened, synchronize, reopened]

jobs:
setup:
uses: ./.github/workflows/reusable_setup.yml

lint:
needs: 'setup'
uses: ./.github/workflows/reusable_lint.yml

build:
needs: 'setup'
uses: ./.github/workflows/reusable_build.yml

verify-plugin:
needs: ['setup', 'lint', 'build']
runs-on: 'macos-15'
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: 'Setup Tools'
uses: ./.github/actions/setup-tools
- name: 'Verify iOS + Android + Web'
working-directory: ./packages/capacitor-plugin
run: npm run verify

build-example-app:
needs: ['verify-plugin']
runs-on: 'macos-15'
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: 'Setup Tools'
uses: ./.github/actions/setup-tools
- name: 'Build plugin'
working-directory: ./packages/capacitor-plugin
run: npm run build
- name: 'Install example app dependencies'
working-directory: ./packages/example-app-capacitor
run: npm i
- name: 'Build Web example app'
working-directory: ./packages/example-app-capacitor
run: npm run build
- name: 'Sync example app native platforms'
working-directory: ./packages/example-app-capacitor
run: npx cap sync
- name: 'Build Android example app'
working-directory: ./packages/example-app-capacitor/android
run: ./gradlew clean assembleDebug
- name: 'Build iOS example app'
working-directory: ./packages/example-app-capacitor/ios/App
run: xcodebuild clean build -workspace App.xcworkspace -scheme App CODE_SIGN_IDENTITY="" CODE_SIGNING_REQUIRED=NO
51 changes: 51 additions & 0 deletions .github/workflows/release_plugin.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
name: "Release Plugin"

on:
push:
branches:
- development
- next
- main
workflow_dispatch:

permissions:
contents: write
issues: write
deployments: write

jobs:
setup:
uses: ./.github/workflows/reusable_setup.yml
secrets:
THE_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}

lint:
needs: 'setup'
uses: ./.github/workflows/reusable_lint.yml
secrets:
THE_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}

build-packages:
needs: 'setup'
uses: ./.github/workflows/reusable_build.yml
secrets:
THE_GH_RELEASE_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}

release:
needs: ['setup','lint','build-packages']
runs-on: 'ubuntu-24.04'
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.CAP_GH_RELEASE_TOKEN }}
- name: 'Setup Tools'
uses: ./.github/actions/setup-tools
- name: Release
working-directory: ./packages/capacitor-plugin
env:
GITHUB_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}
GH_TOKEN: ${{ secrets.CAP_GH_RELEASE_TOKEN }}
NPM_TOKEN: ${{ secrets.NPM_AUTH_TOKEN }}
run: npx semantic-release
36 changes: 36 additions & 0 deletions .github/workflows/reusable_build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
name: "Build Plugin"

on:
workflow_call:
secrets:
THE_GH_RELEASE_TOKEN:
required: false

jobs:
build:
runs-on: "ubuntu-24.04"
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
token: ${{ secrets.THE_GH_RELEASE_TOKEN || github.token }}

- name: "Setup Tools"
uses: ./.github/actions/setup-tools

- name: "Copy README.md in root"
working-directory: ./packages/capacitor-plugin
run: cp README.md README.md.original

- name: "Build Packages"
working-directory: ./packages/capacitor-plugin
run: npm run build

- name: "Check README.md changes"
working-directory: ./packages/capacitor-plugin
run: |
if ! cmp --silent README.md README.md.original; then
echo "Detected README.md changes; Do 'npm run build' to update the docs."
exit 1
fi
23 changes: 23 additions & 0 deletions .github/workflows/reusable_lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: "Lint Plugin"

on:
workflow_call:
secrets:
THE_GH_RELEASE_TOKEN:
required: false

jobs:
lint:
runs-on: 'macos-15'
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.THE_GH_RELEASE_TOKEN || github.token }}

- name: 'Setup Tools'
uses: ./.github/actions/setup-tools

- name: 'Lint Packages'
working-directory: ./packages/capacitor-plugin
run: npm run lint
22 changes: 22 additions & 0 deletions .github/workflows/reusable_setup.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
name: "Setup"

on:
workflow_call:
secrets:
THE_GH_RELEASE_TOKEN:
required: false

jobs:
setup:
strategy:
matrix:
os: ['ubuntu-24.04', 'macos-15']
runs-on: ${{ matrix.os }}
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
with:
token: ${{ secrets.THE_GH_RELEASE_TOKEN || github.token }}

- name: 'Setup Tools'
uses: ./.github/actions/setup-tools
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
node_modules
2 changes: 2 additions & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
package-lock=false
provenance=true
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
# Change Log

All notable changes to this project will be documented in this file.
See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.

# [Unreleased]
Loading
Loading