Skip to content

Commit

Permalink
Merge branch 'main' into photo-picker
Browse files Browse the repository at this point in the history
  • Loading branch information
jcesarmobile authored Nov 6, 2023
2 parents f93136f + f5ca8e0 commit ff07001
Show file tree
Hide file tree
Showing 47 changed files with 291 additions and 106 deletions.
8 changes: 4 additions & 4 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest, macos-12]
os: [ubuntu-latest, macos-13]
timeout-minutes: 30
outputs:
plugins: ${{ steps.packages.outputs.paths }}
Expand Down Expand Up @@ -51,7 +51,7 @@ jobs:
files: ${{ steps.catjson.outputs.FILES_JSON }}

lint:
runs-on: macos-12
runs-on: macos-13
timeout-minutes: 30
needs:
- setup
Expand All @@ -74,7 +74,7 @@ jobs:
- run: npm run lint

verify-ios:
runs-on: macos-12
runs-on: macos-13
if: needs.setup.outputs.plugins != '[]'
timeout-minutes: 30
needs:
Expand All @@ -83,7 +83,7 @@ jobs:
strategy:
matrix:
xcode:
- /Applications/Xcode_14.2.app
- /Applications/Xcode_15.0.app
plugin: ${{ fromJson(needs.setup.outputs.plugins) }}
steps:
- run: sudo xcode-select --switch ${{ matrix.xcode }}
Expand Down
86 changes: 86 additions & 0 deletions .github/workflows/dev-releases-for-pr.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
name: Release Dev Build for PR

on:
pull_request:
types:
- opened
- synchronize

jobs:
setup:
if: github.event.pull_request.draft == false
runs-on: ubuntu-latest
timeout-minutes: 30
outputs:
plugins: ${{ steps.packages.outputs.paths }}
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@ce177499ccf9fd2aded3b0426c97e5434c2e8a73
with:
access_token: ${{ secrets.GITHUB_TOKEN }}
- name: Get Latest
uses: actions/setup-node@v3
with:
node-version: 18.18.0
- uses: actions/checkout@v3
- name: Restore Dependency Cache
id: cache-modules
uses: actions/cache@v3
with:
path: |
node_modules
*/node_modules
key: ${{ runner.os }}-dependency-caching-${{ hashFiles('package.json', '*/package.json') }}
- run: npm install
- id: files
uses: tj-actions/changed-files@v37
with:
json: true
write_output_files: true
- id: catjson
run: |
echo "FILES_JSON=$(cat .github/outputs/all_changed_files.json)" >> $GITHUB_OUTPUT
- id: packages
uses: ./.github/actions/changed-packages
with:
files: ${{ steps.catjson.outputs.FILES_JSON }}

release-dev-of-plugins:
runs-on: ubuntu-latest
timeout-minutes: 30
permissions:
pull-requests: write
needs:
- setup
strategy:
matrix:
plugin: ${{ fromJson(needs.setup.outputs.plugins) }}
steps:
- uses: actions/setup-node@v3
with:
node-version: 18.18.0
- uses: actions/checkout@v3
- name: Restore Dependency Cache
id: cache-modules
uses: actions/cache@v3
with:
path: |
node_modules
*/node_modules
key: ${{ runner.os }}-dependency-caching-${{ hashFiles('package.json', '*/package.json') }}
- run: npm install
- env:
PR_NUMBER: ${{ github.event.pull_request.number }}
run: |
npm version prerelease --no-git-tag-version -f --preid dev-$PR_NUMBER-$(date +%Y%m%dT%H%M%S)
npm publish --tag dev --dry-run
working-directory: ${{ matrix.plugin }}
- name: get-npm-version
id: package-version
uses: martinbeentjes/[email protected]
with:
path: ${{ matrix.plugin }}
- uses: mshick/add-pr-comment@v2
with:
message: |
Released dev build of ${{ matrix.plugin }} with dev version: ${{ steps.package-version.outputs.current-version }}
4 changes: 2 additions & 2 deletions .github/workflows/publish-ios.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ on:
required: true
jobs:
publish-ios:
runs-on: macos-12
runs-on: macos-13
if: github.event.inputs.plugins != '[]'
timeout-minutes: 30
strategy:
matrix:
plugin: ${{ fromJson(github.event.inputs.plugins) }}
steps:
- run: sudo xcode-select --switch /Applications/Xcode_14.2.app
- run: sudo xcode-select --switch /Applications/Xcode_15.0.app
- uses: actions/setup-node@v3
with:
node-version: 16
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-npm-alpha.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:

jobs:
deploy-npm-alpha:
runs-on: macos-12
runs-on: macos-13
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-npm-beta.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:

jobs:
deploy-npm-beta:
runs-on: macos-12
runs-on: macos-13
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-npm-dev.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:

jobs:
deploy-npm-dev:
runs-on: macos-12
runs-on: macos-13
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-npm-latest-from-pre.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:
jobs:
deploy-npm-latest-from-pre:
if: github.ref == 'refs/heads/main'
runs-on: macos-12
runs-on: macos-13
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-npm-latest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ permissions:
jobs:
deploy-npm-latest:
if: github.ref == 'refs/heads/main'
runs-on: macos-12
runs-on: macos-13
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-npm-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ permissions:
jobs:
deploy-npm-nightly:
if: github.ref == 'refs/heads/main'
runs-on: macos-12
runs-on: macos-13
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/publish-npm-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ permissions:

jobs:
deploy-npm-rc:
runs-on: macos-12
runs-on: macos-13
timeout-minutes: 30
steps:
- uses: actions/checkout@v3
Expand Down
6 changes: 3 additions & 3 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ See [`CONTRIBUTING.md`](https://github.com/ionic-team/capacitor/blob/HEAD/CONTRI
brew install swiftlint
```

Sometimes, it may be necessary to work on Capacitor in parellel with the plugin(s). In this case, a few extra steps are necessary:
Sometimes, it may be necessary to work on Capacitor in parallel with the plugin(s). In this case, a few extra steps are necessary:

4. Follow the Capacitor repo's [local setup instructions](https://github.com/ionic-team/capacitor/blob/HEAD/CONTRIBUTING.md#local-setup).
5. Toggle each plugin to use your local copy of Capacitor.
Expand Down Expand Up @@ -47,13 +47,13 @@ To aid in managing these plugins, this repo has a variety of scripts (located in
#### `npm run set-capacitor-version "<version>"`
This script is for setting the version (or version range) of Capacitor packages in each plugin's `package.json`. It will also run `lerna bootstrap` for you.
This script is for setting the version (or version range) of Capacitor packages in each plugin's `package.json`.

#### `npm run toggle-local`

> :memo: Requires [Capacitor](https://github.com/ionic-team/capacitor/) to be cloned in a sibling directory.

This script is for switching between Capacitor packages from npm and Capacitor packages installed locally. It will also run `lerna bootstrap` for you.
This script is for switching between Capacitor packages from npm and Capacitor packages installed locally.

> If you get npm errors, you can try installing from scratch:
>
Expand Down
24 changes: 12 additions & 12 deletions app/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ Only available for Android.
### addListener('appStateChange', ...)

```typescript
addListener(eventName: 'appStateChange', listenerFunc: StateChangeListener) => Promise<PluginListenerHandle> & PluginListenerHandle
addListener(eventName: 'appStateChange', listenerFunc: StateChangeListener) => Promise<PluginListenerHandle>
```

Listen for changes in the app or the activity states.
Expand All @@ -185,7 +185,7 @@ On Web it's fired when the document's visibilitychange gets fired.
| **`eventName`** | <code>'appStateChange'</code> |
| **`listenerFunc`** | <code><a href="#statechangelistener">StateChangeListener</a></code> |

**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>

**Since:** 1.0.0

Expand All @@ -195,7 +195,7 @@ On Web it's fired when the document's visibilitychange gets fired.
### addListener('pause', ...)

```typescript
addListener(eventName: 'pause', listenerFunc: () => void) => Promise<PluginListenerHandle> & PluginListenerHandle
addListener(eventName: 'pause', listenerFunc: () => void) => Promise<PluginListenerHandle>
```

Listen for when the app or the activity are paused.
Expand All @@ -209,7 +209,7 @@ On Web it's fired when the document's visibilitychange gets fired and document.h
| **`eventName`** | <code>'pause'</code> |
| **`listenerFunc`** | <code>() =&gt; void</code> |

**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>

**Since:** 4.1.0

Expand All @@ -219,7 +219,7 @@ On Web it's fired when the document's visibilitychange gets fired and document.h
### addListener('resume', ...)

```typescript
addListener(eventName: 'resume', listenerFunc: () => void) => Promise<PluginListenerHandle> & PluginListenerHandle
addListener(eventName: 'resume', listenerFunc: () => void) => Promise<PluginListenerHandle>
```

Listen for when the app or activity are resumed.
Expand All @@ -234,7 +234,7 @@ On Web it's fired when the document's visibilitychange gets fired and document.h
| **`eventName`** | <code>'resume'</code> |
| **`listenerFunc`** | <code>() =&gt; void</code> |

**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>

**Since:** 4.1.0

Expand All @@ -244,7 +244,7 @@ On Web it's fired when the document's visibilitychange gets fired and document.h
### addListener('appUrlOpen', ...)

```typescript
addListener(eventName: 'appUrlOpen', listenerFunc: URLOpenListener) => Promise<PluginListenerHandle> & PluginListenerHandle
addListener(eventName: 'appUrlOpen', listenerFunc: URLOpenListener) => Promise<PluginListenerHandle>
```

Listen for url open events for the app. This handles both custom URL scheme links as well
Expand All @@ -255,7 +255,7 @@ as URLs your app handles (Universal Links on iOS and App Links on Android)
| **`eventName`** | <code>'appUrlOpen'</code> |
| **`listenerFunc`** | <code><a href="#urlopenlistener">URLOpenListener</a></code> |

**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>

**Since:** 1.0.0

Expand All @@ -265,7 +265,7 @@ as URLs your app handles (Universal Links on iOS and App Links on Android)
### addListener('appRestoredResult', ...)

```typescript
addListener(eventName: 'appRestoredResult', listenerFunc: RestoredListener) => Promise<PluginListenerHandle> & PluginListenerHandle
addListener(eventName: 'appRestoredResult', listenerFunc: RestoredListener) => Promise<PluginListenerHandle>
```

If the app was launched with previously persisted plugin call data, such as on Android
Expand Down Expand Up @@ -295,7 +295,7 @@ Activities (for example, Camera) to have this event and process handled.
| **`eventName`** | <code>'appRestoredResult'</code> |
| **`listenerFunc`** | <code><a href="#restoredlistener">RestoredListener</a></code> |

**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>

**Since:** 1.0.0

Expand All @@ -305,7 +305,7 @@ Activities (for example, Camera) to have this event and process handled.
### addListener('backButton', ...)

```typescript
addListener(eventName: 'backButton', listenerFunc: BackButtonListener) => Promise<PluginListenerHandle> & PluginListenerHandle
addListener(eventName: 'backButton', listenerFunc: BackButtonListener) => Promise<PluginListenerHandle>
```

Listen for the hardware back button event (Android only). Listening for this event will disable the
Expand All @@ -317,7 +317,7 @@ If you want to close the app, call `App.exitApp()`.
| **`eventName`** | <code>'backButton'</code> |
| **`listenerFunc`** | <code><a href="#backbuttonlistener">BackButtonListener</a></code> |

**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt; & <a href="#pluginlistenerhandle">PluginListenerHandle</a></code>
**Returns:** <code>Promise&lt;<a href="#pluginlistenerhandle">PluginListenerHandle</a>&gt;</code>

**Since:** 1.0.0

Expand Down
12 changes: 6 additions & 6 deletions app/src/definitions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ export interface AppPlugin {
addListener(
eventName: 'appStateChange',
listenerFunc: StateChangeListener,
): Promise<PluginListenerHandle> & PluginListenerHandle;
): Promise<PluginListenerHandle>;

/**
* Listen for when the app or the activity are paused.
Expand All @@ -198,7 +198,7 @@ export interface AppPlugin {
addListener(
eventName: 'pause',
listenerFunc: () => void,
): Promise<PluginListenerHandle> & PluginListenerHandle;
): Promise<PluginListenerHandle>;

/**
* Listen for when the app or activity are resumed.
Expand All @@ -213,7 +213,7 @@ export interface AppPlugin {
addListener(
eventName: 'resume',
listenerFunc: () => void,
): Promise<PluginListenerHandle> & PluginListenerHandle;
): Promise<PluginListenerHandle>;

/**
* Listen for url open events for the app. This handles both custom URL scheme links as well
Expand All @@ -224,7 +224,7 @@ export interface AppPlugin {
addListener(
eventName: 'appUrlOpen',
listenerFunc: URLOpenListener,
): Promise<PluginListenerHandle> & PluginListenerHandle;
): Promise<PluginListenerHandle>;

/**
* If the app was launched with previously persisted plugin call data, such as on Android
Expand Down Expand Up @@ -254,7 +254,7 @@ export interface AppPlugin {
addListener(
eventName: 'appRestoredResult',
listenerFunc: RestoredListener,
): Promise<PluginListenerHandle> & PluginListenerHandle;
): Promise<PluginListenerHandle>;

/**
* Listen for the hardware back button event (Android only). Listening for this event will disable the
Expand All @@ -266,7 +266,7 @@ export interface AppPlugin {
addListener(
eventName: 'backButton',
listenerFunc: BackButtonListener,
): Promise<PluginListenerHandle> & PluginListenerHandle;
): Promise<PluginListenerHandle>;

/**
* Remove all native listeners for this plugin
Expand Down
Loading

0 comments on commit ff07001

Please sign in to comment.