mirror of
https://github.com/expo/config-plugins.git
synced 2026-11-13 20:28:07 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9ff7299176 | ||
|
|
f1bd9a7e27 | ||
|
|
83b52a3b61 | ||
|
|
16dfad4dc8 | ||
|
|
0f6493e28d | ||
|
|
0d55f9c8c9 | ||
|
|
fa85f7cf36 | ||
|
|
28997c1062 | ||
|
|
d6050beb2a | ||
|
|
5f4e90059e | ||
|
|
c3a375b292 | ||
|
|
1648e8598b | ||
|
|
e2d2b27494 | ||
|
|
ff8b167764 | ||
|
|
eee366bebc | ||
|
|
72fa3e14ef | ||
|
|
6324eb041b | ||
|
|
480ec19161 | ||
|
|
39a9e63fe9 | ||
|
|
7ffc38a808 | ||
|
|
97dcf1aca6 | ||
|
|
4dcc613a70 | ||
|
|
b07ab9e848 | ||
|
|
7411365343 | ||
|
|
e6e8745f05 | ||
|
|
e9f737cfeb | ||
|
|
b0cfebadb4 | ||
|
|
eb957dec79 | ||
|
|
eb4927760b | ||
|
|
3719d67596 | ||
|
|
df9ac710d5 | ||
|
|
73109da98d | ||
|
|
c904bc6a5f | ||
|
|
1374ab2bf4 | ||
|
|
429dcdc1d0 | ||
|
|
5de4ae3e61 | ||
|
|
537afa4c7d | ||
|
|
ada8b99f32 | ||
|
|
546da1c354 | ||
|
|
71c0aa1387 | ||
|
|
8414fda99b | ||
|
|
95c1f0fcd0 | ||
|
|
718c3f9347 | ||
|
|
2591fe2de7 | ||
|
|
39a88c3703 | ||
|
|
1bc203e66e | ||
|
|
352e887b21 | ||
|
|
96fbab5b2a | ||
|
|
4b7192f364 | ||
|
|
7896eccf49 | ||
|
|
ab8076adf5 | ||
|
|
4affbbb7cc | ||
|
|
831546f34b | ||
|
|
90b841d285 | ||
|
|
99acdc71d2 | ||
|
|
d656142bd0 | ||
|
|
063e812b0b |
No files matched your search
@@ -0,0 +1 @@
|
|||||||
|
/* @EvanBacon
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
<!--
|
||||||
|
🚨 We use semantic release (a bot publishes everything automatically)
|
||||||
|
🚨 so please use conventional commit style for the PR title:
|
||||||
|
🚨 https://www.conventionalcommits.org/en/v1.0.0/
|
||||||
|
🚨 Example: feat(detox): add new step
|
||||||
|
-->
|
||||||
|
|
||||||
|
# Why
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Please describe the motivation for this PR, and link to relevant GitHub issues, forums posts, or feature requests.
|
||||||
|
-->
|
||||||
|
|
||||||
|
# How
|
||||||
|
|
||||||
|
<!--
|
||||||
|
How did you build this feature or fix this bug and why?
|
||||||
|
-->
|
||||||
|
|
||||||
|
# Test Plan
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Please describe how you tested this change and how a reviewer could reproduce your test, especially if this PR does not include automated tests! If possible, please also provide terminal output and/or screenshots demonstrating your test/reproduction.
|
||||||
|
-->
|
||||||
@@ -1,25 +0,0 @@
|
|||||||
name: PR Title
|
|
||||||
on:
|
|
||||||
pull_request:
|
|
||||||
branches:
|
|
||||||
- "*"
|
|
||||||
types:
|
|
||||||
- opened
|
|
||||||
- reopened
|
|
||||||
- edited
|
|
||||||
- synchronize
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
main:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
steps:
|
|
||||||
- uses: aslafy-z/[email protected]
|
|
||||||
# continue-on-error: true
|
|
||||||
id: title-check
|
|
||||||
with:
|
|
||||||
success-state: PR title is valid
|
|
||||||
failure-state: "PR title does not follow the conventional commit spec: https://www.conventionalcommits.org/en/v1.0.0/"
|
|
||||||
context-name: pr-title
|
|
||||||
preset: conventional-changelog-angular@latest
|
|
||||||
env:
|
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
|
||||||
@@ -22,11 +22,16 @@ jobs:
|
|||||||
- run: yarn install --frozen-lockfile --check-files
|
- run: yarn install --frozen-lockfile --check-files
|
||||||
- run: yarn lerna run prepare --stream
|
- run: yarn lerna run prepare --stream
|
||||||
|
|
||||||
# https://github.com/dhoulb/multi-semantic-release
|
# If the dry run fails then it will prevent us from automatically breaking the repo.
|
||||||
|
- name: Semantic release (dry run)
|
||||||
|
run: npx multi-semantic-release --dry-run --ignore-private-packages
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
- name: Semantic release
|
- name: Semantic release
|
||||||
# use `--ignore-packages` to ignore packages on bumping process
|
# use `--ignore-packages` to ignore packages on bumping process
|
||||||
# npx multi-semantic-release --ignore-packages=packages/a/**,packages/b/**
|
# npx multi-semantic-release --ignore-packages=packages/a/**,packages/b/**
|
||||||
run: npx multi-semantic-release
|
run: npx multi-semantic-release --ignore-private-packages
|
||||||
env:
|
env:
|
||||||
GITHUB_TOKEN: ${{ github.token }}
|
GITHUB_TOKEN: ${{ github.token }}
|
||||||
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
NPM_TOKEN: ${{ secrets.NPM_TOKEN }}
|
||||||
+5
-1
@@ -51,4 +51,8 @@ xcuserdata
|
|||||||
# VSCode
|
# VSCode
|
||||||
.history/
|
.history/
|
||||||
|
|
||||||
# packages/*/build/
|
# Ignore build folders
|
||||||
|
|
||||||
|
packages/*/build/**
|
||||||
|
packages/*/plugin/build/**
|
||||||
|
packages/@*/*/build/**
|
||||||
+1
-1
@@ -49,6 +49,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
"@semantic-release/changelog",
|
"@semantic-release/changelog",
|
||||||
|
"@semantic-release/npm",
|
||||||
[
|
[
|
||||||
"@semantic-release/git",
|
"@semantic-release/git",
|
||||||
{
|
{
|
||||||
@@ -57,6 +58,5 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
],
|
],
|
||||||
"@semantic-release/github",
|
"@semantic-release/github",
|
||||||
"@semantic-release/npm",
|
|
||||||
],
|
],
|
||||||
};
|
};
|
||||||
@@ -0,0 +1,66 @@
|
|||||||
|
### @expo/app [1.0.1](https://github.com/expo/config-plugins/compare/@expo/[email protected]...@expo/[email protected]) (2022-03-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **ci:** use correct internal versions ([ab8076a](https://github.com/expo/config-plugins/commit/ab8076adf51e9ba0439eba60b153d729a0996b8d))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@config-plugins/android-jsc-intl:** upgraded to 1.0.1
|
||||||
|
* **@config-plugins/detox:** upgraded to 1.0.1
|
||||||
|
* **@config-plugins/react-native-adjust:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/react-native-ble-plx:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/react-native-blob-util:** upgraded to 1.0.1
|
||||||
|
* **@config-plugins/react-native-branch:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/react-native-callkeep:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/react-native-dynamic-app-icon:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/react-native-google-cast:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/react-native-pdf:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/react-native-quick-actions:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/react-native-webrtc:** upgraded to 1.0.0
|
||||||
|
|
||||||
|
## @expo/app 1.0.0 (2022-03-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* create react-native-branch plugin ([0b06baa](https://github.com/expo/config-plugins/commit/0b06baa2b486c5e02d433a4ac785960934f403b9))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* respect old config from expo-branch ([d0e0186](https://github.com/expo/config-plugins/commit/d0e018601c09c0e92191a4eb2998ab0e6fa1c6ec))
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* added start-metro script ([4a7d707](https://github.com/expo/config-plugins/commit/4a7d707b200a3e499d9d71caf49ad4fc1d0a89e0))
|
||||||
|
* update script ([dcf61a9](https://github.com/expo/config-plugins/commit/dcf61a9b9542851095954d84c9054c97c5400dc9))
|
||||||
|
* upgrade to latest react-native-branch ([df98474](https://github.com/expo/config-plugins/commit/df98474d79ed139b42ddd698d13100160c656c26))
|
||||||
|
|
||||||
|
|
||||||
|
### Documentation changes
|
||||||
|
|
||||||
|
* add android-jsc-intl example ([d96c0b2](https://github.com/expo/config-plugins/commit/d96c0b2888da3808d7c4e2dd7993129711ba717d))
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Dependencies
|
||||||
|
|
||||||
|
* **@config-plugins/android-jsc-intl:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/detox:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/ffmpeg-kit-react-native:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/ios-stickers:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/react-native-adjust:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/react-native-ble-plx:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/react-native-blob-util:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/react-native-branch:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/react-native-callkeep:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/react-native-dynamic-app-icon:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/react-native-google-cast:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/react-native-pdf:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/react-native-quick-actions:** upgraded to 1.0.0
|
||||||
|
* **@config-plugins/react-native-webrtc:** upgraded to 1.0.0
|
||||||
+14
-14
@@ -21,20 +21,20 @@
|
|||||||
"android": "expo run:android"
|
"android": "expo run:android"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@config-plugins/android-jsc-intl": "^0.0.2",
|
"@config-plugins/android-jsc-intl": "*",
|
||||||
"@config-plugins/detox": "^1.1.0",
|
"@config-plugins/detox": "*",
|
||||||
"@config-plugins/ffmpeg-kit-react-native": "^0.0.1",
|
"@config-plugins/ffmpeg-kit-react-native": "*",
|
||||||
"@config-plugins/ios-stickers": "^0.0.4",
|
"@config-plugins/ios-stickers": "*",
|
||||||
"@config-plugins/react-native-adjust": "^0.0.1",
|
"@config-plugins/react-native-adjust": "*",
|
||||||
"@config-plugins/react-native-ble-plx": "^0.0.2",
|
"@config-plugins/react-native-ble-plx": "*",
|
||||||
"@config-plugins/react-native-blob-util": "^0.0.0",
|
"@config-plugins/react-native-blob-util": "*",
|
||||||
"@config-plugins/react-native-branch": "^0.0.1",
|
"@config-plugins/react-native-branch": "*",
|
||||||
"@config-plugins/react-native-callkeep": "^0.0.1",
|
"@config-plugins/react-native-callkeep": "*",
|
||||||
"@config-plugins/react-native-dynamic-app-icon": "^0.0.2",
|
"@config-plugins/react-native-dynamic-app-icon": "*",
|
||||||
"@config-plugins/react-native-google-cast": "^0.1.0",
|
"@config-plugins/react-native-google-cast": "*",
|
||||||
"@config-plugins/react-native-pdf": "^0.0.0",
|
"@config-plugins/react-native-pdf": "*",
|
||||||
"@config-plugins/react-native-quick-actions": "^0.0.1",
|
"@config-plugins/react-native-quick-actions": "*",
|
||||||
"@config-plugins/react-native-webrtc": "^2.0.0",
|
"@config-plugins/react-native-webrtc": "*",
|
||||||
"expo": "^44.0.0",
|
"expo": "^44.0.0",
|
||||||
"expo-localization": "~12.0.0",
|
"expo-localization": "~12.0.0",
|
||||||
"expo-splash-screen": "~0.14.0",
|
"expo-splash-screen": "~0.14.0",
|
||||||
|
|||||||
@@ -0,0 +1,43 @@
|
|||||||
|
### @config-plugins/android-jsc-intl [1.0.3](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* git ignore build folders ([#59](https://github.com/expo/config-plugins/issues/59)) ([d6050be](https://github.com/expo/config-plugins/commit/d6050beb2a5c68dc59287c27ec388c2002ec7904))
|
||||||
|
|
||||||
|
### @config-plugins/android-jsc-intl [1.0.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Continuous Integration
|
||||||
|
|
||||||
|
* fix versions [skip ci] ([#53](https://github.com/expo/config-plugins/issues/53)) ([5de4ae3](https://github.com/expo/config-plugins/commit/5de4ae3e6182c32b7aa24d70ccd23a11663bb089))
|
||||||
|
|
||||||
|
### @config-plugins/android-jsc-intl [1.0.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **ci:** use correct internal versions ([ab8076a](https://github.com/expo/config-plugins/commit/ab8076adf51e9ba0439eba60b153d729a0996b8d))
|
||||||
|
|
||||||
|
## @config-plugins/android-jsc-intl 1.0.0 (2022-03-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* Intl support for android via withAndroidJscIntl ([eb6642c](https://github.com/expo/config-plugins/commit/eb6642c0e7b37d6d9baf196ec40cc520f559e665))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* remove createPluginOnce ([68cf1c0](https://github.com/expo/config-plugins/commit/68cf1c07b2c48249cbbd0732668ea95455636a0b))
|
||||||
|
* run expo prepare ([8d364ed](https://github.com/expo/config-plugins/commit/8d364ed99ea4b0e0e3af73dbcc780819bf55d6c2))
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* upgrade @expo/config-plugins ([#49](https://github.com/expo/config-plugins/issues/49)) ([119e31e](https://github.com/expo/config-plugins/commit/119e31edf110409272ace750f02d651124e1a22d))
|
||||||
|
|
||||||
|
|
||||||
|
### Documentation changes
|
||||||
|
|
||||||
|
* clarify readme ([b524633](https://github.com/expo/config-plugins/commit/b5246338cb37ae41d138bc6253703b0d438fc3e3))
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@config-plugins/android-jsc-intl",
|
"name": "@config-plugins/android-jsc-intl",
|
||||||
"version": "0.0.2",
|
"version": "1.0.3",
|
||||||
"description": "Config plugin for android-jsc-intl package",
|
"description": "Config plugin for android-jsc-intl package",
|
||||||
"main": "build/withAndroidJscIntl.js",
|
"main": "build/withAndroidJscIntl.js",
|
||||||
"types": "build/withAndroidJscIntl.d.ts",
|
"types": "build/withAndroidJscIntl.d.ts",
|
||||||
|
|||||||
@@ -0,0 +1,22 @@
|
|||||||
|
### @config-plugins/detox [1.2.3](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* git ignore build folders ([#59](https://github.com/expo/config-plugins/issues/59)) ([d6050be](https://github.com/expo/config-plugins/commit/d6050beb2a5c68dc59287c27ec388c2002ec7904))
|
||||||
|
|
||||||
|
### @config-plugins/detox [1.2.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **detox:** use improved xml generation ([#47](https://github.com/expo/config-plugins/issues/47)) ([6324eb0](https://github.com/expo/config-plugins/commit/6324eb041b3b4eb2318c0a1ea0297e3b7bf28f7c))
|
||||||
|
|
||||||
|
### @config-plugins/detox [1.2.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Continuous Integration
|
||||||
|
|
||||||
|
* fix versions [skip ci] ([#53](https://github.com/expo/config-plugins/issues/53)) ([5de4ae3](https://github.com/expo/config-plugins/commit/5de4ae3e6182c32b7aa24d70ccd23a11663bb089))
|
||||||
|
|
||||||
|
### @config-plugins/detox 1.2.0
|
||||||
+9
-6
@@ -42,12 +42,15 @@ function getTemplateConfigContent(subdomains) {
|
|||||||
}
|
}
|
||||||
function getTemplateFile(subdomains) {
|
function getTemplateFile(subdomains) {
|
||||||
const content = getTemplateConfigContent(subdomains);
|
const content = getTemplateConfigContent(subdomains);
|
||||||
return `
|
/**
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
* May not have new lines or spaces in the beginning.
|
||||||
<network-security-config>
|
* Otherwise build fails with:
|
||||||
${content}
|
* "AAPT: error: XML or text declaration not at start of entity"
|
||||||
</network-security-config>
|
*/
|
||||||
`;
|
return `<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<network-security-config>
|
||||||
|
${content}
|
||||||
|
</network-security-config>`;
|
||||||
}
|
}
|
||||||
exports.getTemplateFile = getTemplateFile;
|
exports.getTemplateFile = getTemplateFile;
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@config-plugins/detox",
|
"name": "@config-plugins/detox",
|
||||||
"version": "1.2.0",
|
"version": "1.2.3",
|
||||||
"description": "Config plugin to auto configure detox on prebuild",
|
"description": "Config plugin to auto configure detox on prebuild",
|
||||||
"main": "build/withDetox.js",
|
"main": "build/withDetox.js",
|
||||||
"types": "build/withDetox.d.ts",
|
"types": "build/withDetox.d.ts",
|
||||||
|
|||||||
@@ -1,25 +1,21 @@
|
|||||||
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
||||||
|
|
||||||
exports[`getTemplateFile returns domain-config when subdomains is an array 1`] = `
|
exports[`getTemplateFile returns domain-config when subdomains is an array 1`] = `
|
||||||
"
|
"<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
|
||||||
<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
|
<network-security-config>
|
||||||
<network-security-config>
|
|
||||||
|
|
||||||
<domain-config cleartextTrafficPermitted=\\"true\\">
|
<domain-config cleartextTrafficPermitted=\\"true\\">
|
||||||
<domain includeSubdomains=\\"true\\">localhost</domain>
|
<domain includeSubdomains=\\"true\\">localhost</domain>
|
||||||
</domain-config>
|
</domain-config>
|
||||||
|
|
||||||
</network-security-config>
|
</network-security-config>"
|
||||||
"
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`getTemplateFile returns only base-config when subdomains is '*' 1`] = `
|
exports[`getTemplateFile returns only base-config when subdomains is '*' 1`] = `
|
||||||
"
|
"<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
|
||||||
<?xml version=\\"1.0\\" encoding=\\"utf-8\\"?>
|
<network-security-config>
|
||||||
<network-security-config>
|
<base-config cleartextTrafficPermitted=\\"true\\" />
|
||||||
<base-config cleartextTrafficPermitted=\\"true\\" />
|
</network-security-config>"
|
||||||
</network-security-config>
|
|
||||||
"
|
|
||||||
`;
|
`;
|
||||||
|
|
||||||
exports[`withNetworkSecurityConfigManifest doesn't modify config if subdomains is an empty array 1`] = `
|
exports[`withNetworkSecurityConfigManifest doesn't modify config if subdomains is an empty array 1`] = `
|
||||||
|
|||||||
@@ -29,12 +29,15 @@ function getTemplateConfigContent(subdomains: SubdomainsType) {
|
|||||||
|
|
||||||
export function getTemplateFile(subdomains: SubdomainsType): string {
|
export function getTemplateFile(subdomains: SubdomainsType): string {
|
||||||
const content = getTemplateConfigContent(subdomains);
|
const content = getTemplateConfigContent(subdomains);
|
||||||
return `
|
/**
|
||||||
<?xml version="1.0" encoding="utf-8"?>
|
* May not have new lines or spaces in the beginning.
|
||||||
<network-security-config>
|
* Otherwise build fails with:
|
||||||
${content}
|
* "AAPT: error: XML or text declaration not at start of entity"
|
||||||
</network-security-config>
|
*/
|
||||||
`;
|
return `<?xml version="1.0" encoding="utf-8"?>
|
||||||
|
<network-security-config>
|
||||||
|
${content}
|
||||||
|
</network-security-config>`;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|||||||
@@ -0,0 +1,27 @@
|
|||||||
|
### @config-plugins/ffmpeg-kit-react-native [1.0.3](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* git ignore build folders ([#59](https://github.com/expo/config-plugins/issues/59)) ([d6050be](https://github.com/expo/config-plugins/commit/d6050beb2a5c68dc59287c27ec388c2002ec7904))
|
||||||
|
|
||||||
|
### @config-plugins/ffmpeg-kit-react-native [1.0.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* **ffmpeg-kit-react-native:** update plugin to use `AndroidConfig.Version.withBuildScriptExtMinimumVersion` ([#60](https://github.com/expo/config-plugins/issues/60)) ([c3a375b](https://github.com/expo/config-plugins/commit/c3a375b292d6405be7b3277d10ab4f8dbb006047))
|
||||||
|
|
||||||
|
### @config-plugins/ffmpeg-kit-react-native [1.0.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Continuous Integration
|
||||||
|
|
||||||
|
* fix versions [skip ci] ([#53](https://github.com/expo/config-plugins/issues/53)) ([5de4ae3](https://github.com/expo/config-plugins/commit/5de4ae3e6182c32b7aa24d70ccd23a11663bb089))
|
||||||
|
|
||||||
|
## @config-plugins/ffmpeg-kit-react-native 1.0.0 (2022-03-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* upgrade @expo/config-plugins ([#49](https://github.com/expo/config-plugins/issues/49)) ([119e31e](https://github.com/expo/config-plugins/commit/119e31edf110409272ace750f02d651124e1a22d))
|
||||||
-10
@@ -1,10 +0,0 @@
|
|||||||
import { ConfigPlugin } from "@expo/config-plugins";
|
|
||||||
/** Sets a numeric version for a value in the project.gradle buildscript.ext object to be at least the provided props.minVersion, if the existing value is greater then no change will be made. */
|
|
||||||
export declare const withBuildScriptExtMinimumVersion: ConfigPlugin<{
|
|
||||||
name: string;
|
|
||||||
minVersion: number;
|
|
||||||
}>;
|
|
||||||
export declare function setMinBuildScriptExtVersion(buildGradle: string, { name, minVersion }: {
|
|
||||||
name: string;
|
|
||||||
minVersion: number;
|
|
||||||
}): string;
|
|
||||||
@@ -1,31 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
// Copied from https://github.com/expo/expo-cli/blob/main/packages/config-plugins/src/android/Version.ts
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.setMinBuildScriptExtVersion = exports.withBuildScriptExtMinimumVersion = void 0;
|
|
||||||
const config_plugins_1 = require("@expo/config-plugins");
|
|
||||||
/** Sets a numeric version for a value in the project.gradle buildscript.ext object to be at least the provided props.minVersion, if the existing value is greater then no change will be made. */
|
|
||||||
const withBuildScriptExtMinimumVersion = (config, props) => {
|
|
||||||
return config_plugins_1.withProjectBuildGradle(config, (config) => {
|
|
||||||
if (config.modResults.language === "groovy") {
|
|
||||||
config.modResults.contents = setMinBuildScriptExtVersion(config.modResults.contents, props);
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
config_plugins_1.WarningAggregator.addWarningAndroid("withBuildScriptExtVersion", `Cannot automatically configure project build.gradle if it's not groovy`);
|
|
||||||
}
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
exports.withBuildScriptExtMinimumVersion = withBuildScriptExtMinimumVersion;
|
|
||||||
function setMinBuildScriptExtVersion(buildGradle, { name, minVersion }) {
|
|
||||||
var _a;
|
|
||||||
const regex = new RegExp(`(${name}\\s?=\\s?)(\\d+(?:\\.\\d+)?)`);
|
|
||||||
const currentVersion = (_a = buildGradle.match(regex)) === null || _a === void 0 ? void 0 : _a[2];
|
|
||||||
if (!currentVersion) {
|
|
||||||
config_plugins_1.WarningAggregator.addWarningAndroid("withBuildScriptExtVersion", `Cannot set minimum buildscript.ext.${name} version because the property "${name}" cannot be found or does not have a numeric value.`);
|
|
||||||
// TODO: Maybe just add the property...
|
|
||||||
return buildGradle;
|
|
||||||
}
|
|
||||||
const currentVersionNum = Number(currentVersion);
|
|
||||||
return buildGradle.replace(regex, `$1${Math.max(minVersion, currentVersionNum)}`);
|
|
||||||
}
|
|
||||||
exports.setMinBuildScriptExtVersion = setMinBuildScriptExtVersion;
|
|
||||||
+1
-2
@@ -2,7 +2,6 @@
|
|||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
const config_plugins_1 = require("@expo/config-plugins");
|
const config_plugins_1 = require("@expo/config-plugins");
|
||||||
const withAndroidFFMPEGPackage_1 = require("./withAndroidFFMPEGPackage");
|
const withAndroidFFMPEGPackage_1 = require("./withAndroidFFMPEGPackage");
|
||||||
const withBuildScriptExtMinimumVersion_1 = require("./withBuildScriptExtMinimumVersion");
|
|
||||||
const withCocoaPodsImport_1 = require("./withCocoaPodsImport");
|
const withCocoaPodsImport_1 = require("./withCocoaPodsImport");
|
||||||
const withIosDeploymentTarget_1 = require("./withIosDeploymentTarget");
|
const withIosDeploymentTarget_1 = require("./withIosDeploymentTarget");
|
||||||
let pkg = {
|
let pkg = {
|
||||||
@@ -31,7 +30,7 @@ const withFFMPEG = (config, _props) => {
|
|||||||
// Android
|
// Android
|
||||||
// Set min SDK Version to 24.
|
// Set min SDK Version to 24.
|
||||||
[
|
[
|
||||||
withBuildScriptExtMinimumVersion_1.withBuildScriptExtMinimumVersion,
|
config_plugins_1.AndroidConfig.Version.withBuildScriptExtMinimumVersion,
|
||||||
{
|
{
|
||||||
name: "minSdkVersion",
|
name: "minSdkVersion",
|
||||||
minVersion: 24,
|
minVersion: 24,
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@config-plugins/ffmpeg-kit-react-native",
|
"name": "@config-plugins/ffmpeg-kit-react-native",
|
||||||
"version": "0.0.1",
|
"version": "1.0.3",
|
||||||
"description": "Config plugin to auto configure FFMPEG on prebuild",
|
"description": "Config plugin to auto configure FFMPEG on prebuild",
|
||||||
"main": "build/withFFMPEG.js",
|
"main": "build/withFFMPEG.js",
|
||||||
"types": "build/withFFMPEG.d.ts",
|
"types": "build/withFFMPEG.d.ts",
|
||||||
|
|||||||
-89
@@ -1,89 +0,0 @@
|
|||||||
import { WarningAggregator } from "@expo/config-plugins";
|
|
||||||
import { setMinBuildScriptExtVersion } from "../withBuildScriptExtMinimumVersion";
|
|
||||||
|
|
||||||
const EXAMPLE_PROJECT_BUILD_GRADLE = `
|
|
||||||
buildscript {
|
|
||||||
ext {
|
|
||||||
buildToolsVersion = "29.0.3"
|
|
||||||
minSdkVersion = 21
|
|
||||||
compileSdkVersion = 30
|
|
||||||
targetSdkVersion = 30
|
|
||||||
oddFormat = 30.2
|
|
||||||
}
|
|
||||||
repositories {
|
|
||||||
}
|
|
||||||
dependencies {
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
allprojects {
|
|
||||||
repositories {
|
|
||||||
mavenLocal()
|
|
||||||
maven {
|
|
||||||
// Android JSC is installed from npm
|
|
||||||
url(new File(["node", "--print", "require.resolve('jsc-android/package.json')"].execute(null, rootDir).text.trim(), "../dist"))
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
|
|
||||||
describe(setMinBuildScriptExtVersion, () => {
|
|
||||||
beforeEach(() => {
|
|
||||||
// @ts-ignore: jest
|
|
||||||
// eslint-disable-next-line import/namespace
|
|
||||||
WarningAggregator.addWarningAndroid = jest.fn();
|
|
||||||
});
|
|
||||||
|
|
||||||
it(`sets the minSdkVersion in build.gradle if minSdkVersion is given`, () => {
|
|
||||||
expect(
|
|
||||||
setMinBuildScriptExtVersion(EXAMPLE_PROJECT_BUILD_GRADLE, {
|
|
||||||
name: "minSdkVersion",
|
|
||||||
minVersion: 22,
|
|
||||||
})
|
|
||||||
).toMatch(/minSdkVersion = 22/);
|
|
||||||
expect(WarningAggregator.addWarningAndroid).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
|
|
||||||
it(`sets the oddFormat in build.gradle if oddFormat is given`, () => {
|
|
||||||
expect(
|
|
||||||
setMinBuildScriptExtVersion(EXAMPLE_PROJECT_BUILD_GRADLE, {
|
|
||||||
name: "oddFormat",
|
|
||||||
minVersion: 30.3,
|
|
||||||
})
|
|
||||||
).toMatch(/oddFormat = 30\.3/);
|
|
||||||
expect(WarningAggregator.addWarningAndroid).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
it(`does not change the compileSdkVersion in build.gradle if compileSdkVersion is lower than the existing value`, () => {
|
|
||||||
expect(
|
|
||||||
setMinBuildScriptExtVersion(EXAMPLE_PROJECT_BUILD_GRADLE, {
|
|
||||||
name: "compileSdkVersion",
|
|
||||||
minVersion: 12,
|
|
||||||
})
|
|
||||||
).toBe(EXAMPLE_PROJECT_BUILD_GRADLE);
|
|
||||||
expect(WarningAggregator.addWarningAndroid).not.toHaveBeenCalled();
|
|
||||||
});
|
|
||||||
it(`warns when it cannot find the requested value`, () => {
|
|
||||||
expect(
|
|
||||||
setMinBuildScriptExtVersion(EXAMPLE_PROJECT_BUILD_GRADLE, {
|
|
||||||
name: "foobar",
|
|
||||||
minVersion: 12,
|
|
||||||
})
|
|
||||||
).toBe(EXAMPLE_PROJECT_BUILD_GRADLE);
|
|
||||||
expect(WarningAggregator.addWarningAndroid).toBeCalledWith(
|
|
||||||
"withBuildScriptExtVersion",
|
|
||||||
'Cannot set minimum buildscript.ext.foobar version because the property "foobar" cannot be found or does not have a numeric value.'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
it(`does warns when targeting a property with a string value`, () => {
|
|
||||||
expect(
|
|
||||||
setMinBuildScriptExtVersion(EXAMPLE_PROJECT_BUILD_GRADLE, {
|
|
||||||
name: "buildToolsVersion",
|
|
||||||
minVersion: 12,
|
|
||||||
})
|
|
||||||
).toBe(EXAMPLE_PROJECT_BUILD_GRADLE);
|
|
||||||
expect(WarningAggregator.addWarningAndroid).toBeCalledWith(
|
|
||||||
"withBuildScriptExtVersion",
|
|
||||||
'Cannot set minimum buildscript.ext.buildToolsVersion version because the property "buildToolsVersion" cannot be found or does not have a numeric value.'
|
|
||||||
);
|
|
||||||
});
|
|
||||||
});
|
|
||||||
@@ -1,50 +0,0 @@
|
|||||||
// Copied from https://github.com/expo/expo-cli/blob/main/packages/config-plugins/src/android/Version.ts
|
|
||||||
|
|
||||||
import {
|
|
||||||
ConfigPlugin,
|
|
||||||
WarningAggregator,
|
|
||||||
withProjectBuildGradle,
|
|
||||||
} from "@expo/config-plugins";
|
|
||||||
|
|
||||||
/** Sets a numeric version for a value in the project.gradle buildscript.ext object to be at least the provided props.minVersion, if the existing value is greater then no change will be made. */
|
|
||||||
export const withBuildScriptExtMinimumVersion: ConfigPlugin<{
|
|
||||||
name: string;
|
|
||||||
minVersion: number;
|
|
||||||
}> = (config, props) => {
|
|
||||||
return withProjectBuildGradle(config, (config) => {
|
|
||||||
if (config.modResults.language === "groovy") {
|
|
||||||
config.modResults.contents = setMinBuildScriptExtVersion(
|
|
||||||
config.modResults.contents,
|
|
||||||
props
|
|
||||||
);
|
|
||||||
} else {
|
|
||||||
WarningAggregator.addWarningAndroid(
|
|
||||||
"withBuildScriptExtVersion",
|
|
||||||
`Cannot automatically configure project build.gradle if it's not groovy`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
|
|
||||||
export function setMinBuildScriptExtVersion(
|
|
||||||
buildGradle: string,
|
|
||||||
{ name, minVersion }: { name: string; minVersion: number }
|
|
||||||
) {
|
|
||||||
const regex = new RegExp(`(${name}\\s?=\\s?)(\\d+(?:\\.\\d+)?)`);
|
|
||||||
const currentVersion = buildGradle.match(regex)?.[2];
|
|
||||||
if (!currentVersion) {
|
|
||||||
WarningAggregator.addWarningAndroid(
|
|
||||||
"withBuildScriptExtVersion",
|
|
||||||
`Cannot set minimum buildscript.ext.${name} version because the property "${name}" cannot be found or does not have a numeric value.`
|
|
||||||
);
|
|
||||||
// TODO: Maybe just add the property...
|
|
||||||
return buildGradle;
|
|
||||||
}
|
|
||||||
|
|
||||||
const currentVersionNum = Number(currentVersion);
|
|
||||||
return buildGradle.replace(
|
|
||||||
regex,
|
|
||||||
`$1${Math.max(minVersion, currentVersionNum)}`
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@@ -1,11 +1,11 @@
|
|||||||
import {
|
import {
|
||||||
|
AndroidConfig,
|
||||||
ConfigPlugin,
|
ConfigPlugin,
|
||||||
createRunOncePlugin,
|
createRunOncePlugin,
|
||||||
withPlugins,
|
withPlugins,
|
||||||
} from "@expo/config-plugins";
|
} from "@expo/config-plugins";
|
||||||
|
|
||||||
import { withAndroidFFMPEGPackage } from "./withAndroidFFMPEGPackage";
|
import { withAndroidFFMPEGPackage } from "./withAndroidFFMPEGPackage";
|
||||||
import { withBuildScriptExtMinimumVersion } from "./withBuildScriptExtMinimumVersion";
|
|
||||||
import {
|
import {
|
||||||
withCocoaPodsImport,
|
withCocoaPodsImport,
|
||||||
withPodfilePropertiesPackage,
|
withPodfilePropertiesPackage,
|
||||||
@@ -56,7 +56,7 @@ const withFFMPEG: ConfigPlugin<void | Props> = (config, _props) => {
|
|||||||
|
|
||||||
// Set min SDK Version to 24.
|
// Set min SDK Version to 24.
|
||||||
[
|
[
|
||||||
withBuildScriptExtMinimumVersion,
|
AndroidConfig.Version.withBuildScriptExtMinimumVersion,
|
||||||
{
|
{
|
||||||
name: "minSdkVersion",
|
name: "minSdkVersion",
|
||||||
minVersion: 24,
|
minVersion: 24,
|
||||||
|
|||||||
@@ -0,0 +1,25 @@
|
|||||||
|
### @config-plugins/ios-stickers [1.0.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* git ignore build folders ([#59](https://github.com/expo/config-plugins/issues/59)) ([d6050be](https://github.com/expo/config-plugins/commit/d6050beb2a5c68dc59287c27ec388c2002ec7904))
|
||||||
|
|
||||||
|
### @config-plugins/ios-stickers [1.0.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Continuous Integration
|
||||||
|
|
||||||
|
* fix versions [skip ci] ([#53](https://github.com/expo/config-plugins/issues/53)) ([5de4ae3](https://github.com/expo/config-plugins/commit/5de4ae3e6182c32b7aa24d70ccd23a11663bb089))
|
||||||
|
|
||||||
|
|
||||||
|
### Documentation changes
|
||||||
|
|
||||||
|
* **ios-stickers:** add doc block ([#55](https://github.com/expo/config-plugins/issues/55)) ([c904bc6](https://github.com/expo/config-plugins/commit/c904bc6a5f410645696a0356b5c188b94f80c231))
|
||||||
|
|
||||||
|
## @config-plugins/ios-stickers 1.0.0 (2022-03-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* upgrade @expo/config-plugins ([#49](https://github.com/expo/config-plugins/issues/49)) ([119e31e](https://github.com/expo/config-plugins/commit/119e31edf110409272ace750f02d651124e1a22d))
|
||||||
+1
@@ -1,4 +1,5 @@
|
|||||||
import { ConfigPlugin } from "@expo/config-plugins";
|
import { ConfigPlugin } from "@expo/config-plugins";
|
||||||
|
/** Dangerously applies sticker assets to the iOS project. */
|
||||||
export declare const withStickerAssets: ConfigPlugin<{
|
export declare const withStickerAssets: ConfigPlugin<{
|
||||||
icon?: string;
|
icon?: string;
|
||||||
size: string;
|
size: string;
|
||||||
|
|||||||
@@ -44,6 +44,7 @@ function createSticker({ stickerpackPath, name, imageBuffer, extension, accessib
|
|||||||
name: stickerName,
|
name: stickerName,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
/** Dangerously applies sticker assets to the iOS project. */
|
||||||
const withStickerAssets = (config, { stickers, icon, size }) => {
|
const withStickerAssets = (config, { stickers, icon, size }) => {
|
||||||
// Default to using the app icon
|
// Default to using the app icon
|
||||||
if (!icon) {
|
if (!icon) {
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@config-plugins/ios-stickers",
|
"name": "@config-plugins/ios-stickers",
|
||||||
"version": "0.0.4",
|
"version": "1.0.2",
|
||||||
"description": "Config plugin to auto configure iOS iMessage stickers",
|
"description": "Config plugin to auto configure iOS iMessage stickers",
|
||||||
"main": "build/withStickerPack.js",
|
"main": "build/withStickerPack.js",
|
||||||
"types": "build/withStickerPack.d.ts",
|
"types": "build/withStickerPack.d.ts",
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ function createSticker({
|
|||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Dangerously applies sticker assets to the iOS project. */
|
||||||
export const withStickerAssets: ConfigPlugin<{
|
export const withStickerAssets: ConfigPlugin<{
|
||||||
icon?: string;
|
icon?: string;
|
||||||
size: string;
|
size: string;
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
### @config-plugins/react-native-adjust [1.0.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* git ignore build folders ([#59](https://github.com/expo/config-plugins/issues/59)) ([d6050be](https://github.com/expo/config-plugins/commit/d6050beb2a5c68dc59287c27ec388c2002ec7904))
|
||||||
|
|
||||||
|
### @config-plugins/react-native-adjust [1.0.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Continuous Integration
|
||||||
|
|
||||||
|
* fix versions [skip ci] ([#53](https://github.com/expo/config-plugins/issues/53)) ([5de4ae3](https://github.com/expo/config-plugins/commit/5de4ae3e6182c32b7aa24d70ccd23a11663bb089))
|
||||||
|
|
||||||
|
## @config-plugins/react-native-adjust 1.0.0 (2022-03-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* upgrade @expo/config-plugins ([#49](https://github.com/expo/config-plugins/issues/49)) ([119e31e](https://github.com/expo/config-plugins/commit/119e31edf110409272ace750f02d651124e1a22d))
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@config-plugins/react-native-adjust",
|
"name": "@config-plugins/react-native-adjust",
|
||||||
"version": "0.0.1",
|
"version": "1.0.2",
|
||||||
"description": "Config plugin to auto configure Adjust SDK on prebuild",
|
"description": "Config plugin to auto configure Adjust SDK on prebuild",
|
||||||
"main": "build/withReactNativeAdjust.js",
|
"main": "build/withReactNativeAdjust.js",
|
||||||
"types": "build/withReactNativeAdjust.d.ts",
|
"types": "build/withReactNativeAdjust.d.ts",
|
||||||
|
|||||||
@@ -0,0 +1,20 @@
|
|||||||
|
### @config-plugins/react-native-ble-plx [1.0.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* git ignore build folders ([#59](https://github.com/expo/config-plugins/issues/59)) ([d6050be](https://github.com/expo/config-plugins/commit/d6050beb2a5c68dc59287c27ec388c2002ec7904))
|
||||||
|
|
||||||
|
### @config-plugins/react-native-ble-plx [1.0.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Continuous Integration
|
||||||
|
|
||||||
|
* fix versions [skip ci] ([#53](https://github.com/expo/config-plugins/issues/53)) ([5de4ae3](https://github.com/expo/config-plugins/commit/5de4ae3e6182c32b7aa24d70ccd23a11663bb089))
|
||||||
|
|
||||||
|
## @config-plugins/react-native-ble-plx 1.0.0 (2022-03-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* upgrade @expo/config-plugins ([#49](https://github.com/expo/config-plugins/issues/49)) ([119e31e](https://github.com/expo/config-plugins/commit/119e31edf110409272ace750f02d651124e1a22d))
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@config-plugins/react-native-ble-plx",
|
"name": "@config-plugins/react-native-ble-plx",
|
||||||
"version": "0.0.2",
|
"version": "1.0.2",
|
||||||
"description": "Config plugin to auto configure react-native-ble-plx on prebuild",
|
"description": "Config plugin to auto configure react-native-ble-plx on prebuild",
|
||||||
"main": "build/withBLE.js",
|
"main": "build/withBLE.js",
|
||||||
"types": "build/withBLE.d.ts",
|
"types": "build/withBLE.d.ts",
|
||||||
|
|||||||
@@ -1,3 +1,24 @@
|
|||||||
|
### @config-plugins/react-native-blob-util [1.0.3](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* git ignore build folders ([#59](https://github.com/expo/config-plugins/issues/59)) ([d6050be](https://github.com/expo/config-plugins/commit/d6050beb2a5c68dc59287c27ec388c2002ec7904))
|
||||||
|
|
||||||
|
### @config-plugins/react-native-blob-util [1.0.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Continuous Integration
|
||||||
|
|
||||||
|
* fix versions [skip ci] ([#53](https://github.com/expo/config-plugins/issues/53)) ([5de4ae3](https://github.com/expo/config-plugins/commit/5de4ae3e6182c32b7aa24d70ccd23a11663bb089))
|
||||||
|
|
||||||
|
### @config-plugins/react-native-blob-util [1.0.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* **ci:** use correct internal versions ([ab8076a](https://github.com/expo/config-plugins/commit/ab8076adf51e9ba0439eba60b153d729a0996b8d))
|
||||||
|
|
||||||
## @config-plugins/react-native-blob-util 1.0.0 (2022-03-15)
|
## @config-plugins/react-native-blob-util 1.0.0 (2022-03-15)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@config-plugins/react-native-blob-util",
|
"name": "@config-plugins/react-native-blob-util",
|
||||||
"version": "0.0.0",
|
"version": "1.0.3",
|
||||||
"description": "Config plugin to auto configure react-native-blob-util on prebuild",
|
"description": "Config plugin to auto configure react-native-blob-util on prebuild",
|
||||||
"main": "build/withReactNativeBlobUtil.js",
|
"main": "build/withReactNativeBlobUtil.js",
|
||||||
"types": "build/withReactNativeBlobUtil.d.ts",
|
"types": "build/withReactNativeBlobUtil.d.ts",
|
||||||
|
|||||||
@@ -0,0 +1,50 @@
|
|||||||
|
### @config-plugins/react-native-branch [1.0.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* git ignore build folders ([#59](https://github.com/expo/config-plugins/issues/59)) ([d6050be](https://github.com/expo/config-plugins/commit/d6050beb2a5c68dc59287c27ec388c2002ec7904))
|
||||||
|
|
||||||
|
### @config-plugins/react-native-branch [1.0.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Continuous Integration
|
||||||
|
|
||||||
|
* fix versions [skip ci] ([#53](https://github.com/expo/config-plugins/issues/53)) ([5de4ae3](https://github.com/expo/config-plugins/commit/5de4ae3e6182c32b7aa24d70ccd23a11663bb089))
|
||||||
|
|
||||||
|
## @config-plugins/react-native-branch 1.0.0 (2022-03-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* create react-native-branch plugin ([0b06baa](https://github.com/expo/config-plugins/commit/0b06baa2b486c5e02d433a4ac785960934f403b9))
|
||||||
|
* support for universalLinkDomains ([01ca879](https://github.com/expo/config-plugins/commit/01ca879ca3f6cebac1177d74969337819a5fc72d))
|
||||||
|
|
||||||
|
|
||||||
|
### Bug Fixes
|
||||||
|
|
||||||
|
* added expo-module.config.json to files ([57d589b](https://github.com/expo/config-plugins/commit/57d589ba8ad60e057b34ad7b2f404f67e85896ab))
|
||||||
|
* fixed MATCH_INIT for SDKv44 ([904741a](https://github.com/expo/config-plugins/commit/904741a3bdb02f5bb76ebcf44131f1698dad0831))
|
||||||
|
* fixed missing files when publish ([ebb8666](https://github.com/expo/config-plugins/commit/ebb86666d6e61a70838048839b144c7217886d73))
|
||||||
|
* removed proguard-rules.pro edit step ([e1159b4](https://github.com/expo/config-plugins/commit/e1159b4021ab722cf3998479e6a459374bdb5075))
|
||||||
|
* updates from code-reviews ([597ffc3](https://github.com/expo/config-plugins/commit/597ffc3bd76517ac96c39b77d8b76e6aee2609dd))
|
||||||
|
* **android:** added `onNewIntent` handler ([31ed997](https://github.com/expo/config-plugins/commit/31ed9978ca6c0a079341b5b4be5479a5e5633f79))
|
||||||
|
* rename module ([7f0dd05](https://github.com/expo/config-plugins/commit/7f0dd05fdc15293b84606cb000bcd7321b418de8))
|
||||||
|
* respect old config from expo-branch ([d0e0186](https://github.com/expo/config-plugins/commit/d0e018601c09c0e92191a4eb2998ab0e6fa1c6ec))
|
||||||
|
|
||||||
|
|
||||||
|
### Code Refactoring
|
||||||
|
|
||||||
|
* **android:** migrate to new expo modules system ([1ac233e](https://github.com/expo/config-plugins/commit/1ac233eb432eaeeb7ead6723a4a232f86cfc8e50))
|
||||||
|
* **ios:** migrate to new expo modules system ([a98a6e0](https://github.com/expo/config-plugins/commit/a98a6e022fc06f8b9c996e4e2b4a1d7aac830d8a))
|
||||||
|
* update plugin to use CodeMod ([ae66cac](https://github.com/expo/config-plugins/commit/ae66cac141847e33add62cc30375620e1a5cc1d0))
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* apply suggestions from code review ([0ccc227](https://github.com/expo/config-plugins/commit/0ccc22771d5ecc97da7720c362ecf90a76e5de1c))
|
||||||
|
* cleanup android gitignore ([c88609a](https://github.com/expo/config-plugins/commit/c88609a8666be1b4137a3694bd844bb6a0f1ec12))
|
||||||
|
* latest cleanup ([ef50c05](https://github.com/expo/config-plugins/commit/ef50c05892b965e2ccd70418da962f2c3d96ab2e))
|
||||||
|
* rename files to avoid possible conflict ([d0b32ce](https://github.com/expo/config-plugins/commit/d0b32ce4a1c28060e61e7109f59be215c5f92f14))
|
||||||
|
* rename module ([71e429b](https://github.com/expo/config-plugins/commit/71e429b77fca05953e94636b31e9b1b8da2ddcb6))
|
||||||
|
* upgrade @expo/config-plugins ([#49](https://github.com/expo/config-plugins/issues/49)) ([119e31e](https://github.com/expo/config-plugins/commit/119e31edf110409272ace750f02d651124e1a22d))
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@config-plugins/react-native-branch",
|
"name": "@config-plugins/react-native-branch",
|
||||||
"version": "0.0.1",
|
"version": "1.0.2",
|
||||||
"description": "Config plugin to auto configure react-native-branch on prebuild",
|
"description": "Config plugin to auto configure react-native-branch on prebuild",
|
||||||
"author": "650 Industries, Inc.",
|
"author": "650 Industries, Inc.",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
### @config-plugins/react-native-callkeep [1.0.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Continuous Integration
|
||||||
|
|
||||||
|
* fix versions [skip ci] ([#53](https://github.com/expo/config-plugins/issues/53)) ([5de4ae3](https://github.com/expo/config-plugins/commit/5de4ae3e6182c32b7aa24d70ccd23a11663bb089))
|
||||||
|
|
||||||
|
## @config-plugins/react-native-callkeep 1.0.0 (2022-03-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* upgrade @expo/config-plugins ([#49](https://github.com/expo/config-plugins/issues/49)) ([119e31e](https://github.com/expo/config-plugins/commit/119e31edf110409272ace750f02d651124e1a22d))
|
||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
import { XcodeProject } from "@expo/config-plugins";
|
|
||||||
export declare function ensureHeaderSearchPath(project: XcodeProject, file: string): void;
|
|
||||||
-33
@@ -1,33 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.ensureHeaderSearchPath = void 0;
|
|
||||||
const COMMENT_KEY = /_comment$/;
|
|
||||||
function unquote(str) {
|
|
||||||
if (str)
|
|
||||||
return str.replace(/^"(.*)"$/, "$1");
|
|
||||||
}
|
|
||||||
function nonComments(obj) {
|
|
||||||
var keys = Object.keys(obj), newObj = {}, i = 0;
|
|
||||||
for (i; i < keys.length; i++) {
|
|
||||||
if (!COMMENT_KEY.test(keys[i])) {
|
|
||||||
newObj[keys[i]] = obj[keys[i]];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return newObj;
|
|
||||||
}
|
|
||||||
function ensureHeaderSearchPath(project, file) {
|
|
||||||
const configurations = nonComments(project.pbxXCBuildConfigurationSection());
|
|
||||||
const INHERITED = '"$(inherited)"';
|
|
||||||
for (const config in configurations) {
|
|
||||||
const buildSettings = configurations[config].buildSettings;
|
|
||||||
if (unquote(buildSettings["PRODUCT_NAME"]) != project.productName)
|
|
||||||
continue;
|
|
||||||
if (!buildSettings["HEADER_SEARCH_PATHS"]) {
|
|
||||||
buildSettings["HEADER_SEARCH_PATHS"] = [INHERITED];
|
|
||||||
}
|
|
||||||
if (!buildSettings.HEADER_SEARCH_PATHS.includes(file)) {
|
|
||||||
buildSettings["HEADER_SEARCH_PATHS"].push(file);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.ensureHeaderSearchPath = ensureHeaderSearchPath;
|
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
import { ConfigPlugin } from "@expo/config-plugins";
|
|
||||||
declare const withCallkeep: ConfigPlugin;
|
|
||||||
export declare const withXcodeLinkBinaryWithLibraries: ConfigPlugin<{
|
|
||||||
library: string;
|
|
||||||
status?: string;
|
|
||||||
}>;
|
|
||||||
export default withCallkeep;
|
|
||||||
-110
@@ -1,110 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.withXcodeLinkBinaryWithLibraries = void 0;
|
|
||||||
const config_plugins_1 = require("@expo/config-plugins");
|
|
||||||
const ensureHeaderSearchPath_1 = require("./ensureHeaderSearchPath");
|
|
||||||
const withCallkeepHeaderSearchPath = (config) => {
|
|
||||||
const headerSearchPath = `"$(SRCROOT)/../node_modules/react-native-callkeep/ios/RNCallKeep"`;
|
|
||||||
return config_plugins_1.withXcodeProject(config, (config) => {
|
|
||||||
ensureHeaderSearchPath_1.ensureHeaderSearchPath(config.modResults, headerSearchPath);
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const withAndroidManifestService = (config) => {
|
|
||||||
return config_plugins_1.withAndroidManifest(config, (config) => {
|
|
||||||
// <service
|
|
||||||
// android:name="io.wazo.callkeep.VoiceConnectionService"
|
|
||||||
// android:label="Wazo"
|
|
||||||
// android:permission="android.permission.BIND_TELECOM_CONNECTION_SERVICE"
|
|
||||||
// // Use this to target android >= 11
|
|
||||||
// android:foregroundServiceType="camera|microphone"
|
|
||||||
// // For android < 11
|
|
||||||
// android:foregroundServiceType="phoneCall"
|
|
||||||
// >
|
|
||||||
// <intent-filter>
|
|
||||||
// <action android:name="android.telecom.ConnectionService" />
|
|
||||||
// </intent-filter>
|
|
||||||
// </service>;
|
|
||||||
const app = config_plugins_1.AndroidConfig.Manifest.getMainApplicationOrThrow(config.modResults);
|
|
||||||
if (!Array.isArray(app.service))
|
|
||||||
app.service = [];
|
|
||||||
if (!app.service.find((item) => item.$["android:name"] ===
|
|
||||||
"io.wazo.callkeep.RNCallKeepBackgroundMessagingService")) {
|
|
||||||
app.service.push({
|
|
||||||
$: {
|
|
||||||
"android:name": "io.wazo.callkeep.RNCallKeepBackgroundMessagingService",
|
|
||||||
},
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// TODO: Update item
|
|
||||||
if (!app.service.find((item) => item.$["android:name"] === "io.wazo.callkeep.VoiceConnectionService")) {
|
|
||||||
app.service.push({
|
|
||||||
$: {
|
|
||||||
"android:name": "io.wazo.callkeep.VoiceConnectionService",
|
|
||||||
// @ts-ignore
|
|
||||||
"android:label": "Wazo",
|
|
||||||
"android:permission": "android.permission.BIND_TELECOM_CONNECTION_SERVICE",
|
|
||||||
// Use this to target android >= 11
|
|
||||||
// "android:foregroundServiceType": "camera|microphone",
|
|
||||||
// For android < 11
|
|
||||||
"android:foregroundServiceType": "phoneCall",
|
|
||||||
},
|
|
||||||
"intent-filter": [
|
|
||||||
{
|
|
||||||
action: [
|
|
||||||
{
|
|
||||||
$: {
|
|
||||||
"android:name": "android.telecom.ConnectionService",
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
});
|
|
||||||
}
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const withCallkeep = (config) => {
|
|
||||||
config = config_plugins_1.withInfoPlist(config, (config) => {
|
|
||||||
if (!Array.isArray(config.modResults.UIBackgroundModes)) {
|
|
||||||
config.modResults.UIBackgroundModes = [];
|
|
||||||
}
|
|
||||||
if (!config.modResults.UIBackgroundModes.includes("voip")) {
|
|
||||||
config.modResults.UIBackgroundModes.push("voip");
|
|
||||||
}
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
config = withCallkeepHeaderSearchPath(config);
|
|
||||||
config = exports.withXcodeLinkBinaryWithLibraries(config, {
|
|
||||||
library: "Intents.framework",
|
|
||||||
status: "optional",
|
|
||||||
});
|
|
||||||
config = exports.withXcodeLinkBinaryWithLibraries(config, {
|
|
||||||
library: "CallKit.framework",
|
|
||||||
});
|
|
||||||
config = config_plugins_1.AndroidConfig.Permissions.withPermissions(config, [
|
|
||||||
"android.permission.BIND_TELECOM_CONNECTION_SERVICE",
|
|
||||||
"android.permission.FOREGROUND_SERVICE",
|
|
||||||
"android.permission.READ_PHONE_STATE",
|
|
||||||
"android.permission.CALL_PHONE",
|
|
||||||
]);
|
|
||||||
config = withAndroidManifestService(config);
|
|
||||||
return config;
|
|
||||||
};
|
|
||||||
const withXcodeLinkBinaryWithLibraries = (config, { library, status }) => {
|
|
||||||
return config_plugins_1.withXcodeProject(config, (config) => {
|
|
||||||
const options = status === "optional" ? { weak: true } : {};
|
|
||||||
const target = config_plugins_1.IOSConfig.XcodeUtils.getApplicationNativeTarget({
|
|
||||||
project: config.modResults,
|
|
||||||
projectName: config.modRequest.projectName,
|
|
||||||
});
|
|
||||||
config.modResults.addFramework(library, {
|
|
||||||
target: target.uuid,
|
|
||||||
...options,
|
|
||||||
});
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
exports.withXcodeLinkBinaryWithLibraries = withXcodeLinkBinaryWithLibraries;
|
|
||||||
exports.default = withCallkeep;
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@config-plugins/react-native-callkeep",
|
"name": "@config-plugins/react-native-callkeep",
|
||||||
"version": "0.0.1",
|
"version": "1.0.1",
|
||||||
"description": "Config plugin to auto configure callkeep on prebuild",
|
"description": "Config plugin to auto configure callkeep on prebuild",
|
||||||
"main": "build/withCallkeep.js",
|
"main": "build/withCallkeep.js",
|
||||||
"types": "build/withCallkeep.d.ts",
|
"types": "build/withCallkeep.d.ts",
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
### @config-plugins/react-native-dynamic-app-icon [1.0.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Continuous Integration
|
||||||
|
|
||||||
|
* fix versions [skip ci] ([#53](https://github.com/expo/config-plugins/issues/53)) ([5de4ae3](https://github.com/expo/config-plugins/commit/5de4ae3e6182c32b7aa24d70ccd23a11663bb089))
|
||||||
|
|
||||||
|
## @config-plugins/react-native-dynamic-app-icon 1.0.0 (2022-03-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* upgrade @expo/config-plugins ([#49](https://github.com/expo/config-plugins/issues/49)) ([119e31e](https://github.com/expo/config-plugins/commit/119e31edf110409272ace750f02d651124e1a22d))
|
||||||
-7
@@ -1,7 +0,0 @@
|
|||||||
import { ConfigPlugin } from "@expo/config-plugins";
|
|
||||||
declare type IconSet = Record<string, {
|
|
||||||
image: string;
|
|
||||||
prerendered?: boolean;
|
|
||||||
}>;
|
|
||||||
declare const withDynamicIcon: ConfigPlugin<string[] | IconSet | void>;
|
|
||||||
export default withDynamicIcon;
|
|
||||||
-175
@@ -1,175 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
||||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
||||||
};
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const config_plugins_1 = require("@expo/config-plugins");
|
|
||||||
const image_utils_1 = require("@expo/image-utils");
|
|
||||||
const fs_1 = __importDefault(require("fs"));
|
|
||||||
const path_1 = __importDefault(require("path"));
|
|
||||||
const folderName = "DynamicAppIcons";
|
|
||||||
const size = 60;
|
|
||||||
const scales = [2, 3];
|
|
||||||
function arrayToImages(images) {
|
|
||||||
return images.reduce((prev, curr, i) => ({ ...prev, [i]: { image: curr } }), {});
|
|
||||||
}
|
|
||||||
const withDynamicIcon = (config, props = {}) => {
|
|
||||||
const _props = props || {};
|
|
||||||
let prepped = {};
|
|
||||||
if (Array.isArray(_props)) {
|
|
||||||
prepped = arrayToImages(_props);
|
|
||||||
}
|
|
||||||
else if (_props) {
|
|
||||||
prepped = _props;
|
|
||||||
}
|
|
||||||
config = withIconXcodeProject(config, { icons: prepped });
|
|
||||||
config = withIconInfoPlist(config, { icons: prepped });
|
|
||||||
config = withIconImages(config, { icons: prepped });
|
|
||||||
return config;
|
|
||||||
};
|
|
||||||
function getIconName(name, size, scale) {
|
|
||||||
const fileName = `${name}-Icon-${size}x${size}`;
|
|
||||||
if (scale != null) {
|
|
||||||
return `${fileName}@${scale}x.png`;
|
|
||||||
}
|
|
||||||
return fileName;
|
|
||||||
}
|
|
||||||
// @ts-ignore
|
|
||||||
const pbxFile_1 = __importDefault(require("xcode/lib/pbxFile"));
|
|
||||||
const withIconXcodeProject = (config, { icons }) => {
|
|
||||||
return config_plugins_1.withXcodeProject(config, async (config) => {
|
|
||||||
const groupPath = `${config.modRequest.projectName}/${folderName}`;
|
|
||||||
const group = config_plugins_1.IOSConfig.XcodeUtils.ensureGroupRecursively(config.modResults, groupPath);
|
|
||||||
const project = config.modResults;
|
|
||||||
const opt = {};
|
|
||||||
// Unlink old assets
|
|
||||||
const groupId = Object.keys(project.hash.project.objects["PBXGroup"]).find((id) => {
|
|
||||||
const _group = project.hash.project.objects["PBXGroup"][id];
|
|
||||||
return _group.name === group.name;
|
|
||||||
});
|
|
||||||
if (!project.hash.project.objects["PBXVariantGroup"]) {
|
|
||||||
project.hash.project.objects["PBXVariantGroup"] = {};
|
|
||||||
}
|
|
||||||
const variantGroupId = Object.keys(project.hash.project.objects["PBXVariantGroup"]).find((id) => {
|
|
||||||
const _group = project.hash.project.objects["PBXVariantGroup"][id];
|
|
||||||
return _group.name === group.name;
|
|
||||||
});
|
|
||||||
const children = [...(group.children || [])];
|
|
||||||
for (const child of children) {
|
|
||||||
const file = new pbxFile_1.default(path_1.default.join(group.name, child.comment), opt);
|
|
||||||
file.target = opt ? opt.target : undefined;
|
|
||||||
project.removeFromPbxBuildFileSection(file); // PBXBuildFile
|
|
||||||
project.removeFromPbxFileReferenceSection(file); // PBXFileReference
|
|
||||||
if (group) {
|
|
||||||
if (groupId) {
|
|
||||||
project.removeFromPbxGroup(file, groupId); //Group other than Resources (i.e. 'splash')
|
|
||||||
}
|
|
||||||
else if (variantGroupId) {
|
|
||||||
project.removeFromPbxVariantGroup(file, variantGroupId); // PBXVariantGroup
|
|
||||||
}
|
|
||||||
}
|
|
||||||
project.removeFromPbxResourcesBuildPhase(file); // PBXResourcesBuildPhase
|
|
||||||
}
|
|
||||||
// Link new assets
|
|
||||||
await iterateIconsAsync({ icons }, async (key, icon, index) => {
|
|
||||||
for (const scale of scales) {
|
|
||||||
const iconFileName = getIconName(key, size, scale);
|
|
||||||
if (!(group === null || group === void 0 ? void 0 : group.children.some(({ comment }) => comment === iconFileName))) {
|
|
||||||
// Only write the file if it doesn't already exist.
|
|
||||||
config.modResults = config_plugins_1.IOSConfig.XcodeUtils.addResourceFileToGroup({
|
|
||||||
filepath: path_1.default.join(groupPath, iconFileName),
|
|
||||||
groupName: groupPath,
|
|
||||||
project: config.modResults,
|
|
||||||
isBuildFile: true,
|
|
||||||
verbose: true,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
console.log("Skipping duplicate: ", iconFileName);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const withIconInfoPlist = (config, { icons }) => {
|
|
||||||
return config_plugins_1.withInfoPlist(config, async (config) => {
|
|
||||||
const altIcons = {};
|
|
||||||
await iterateIconsAsync({ icons }, async (key, icon) => {
|
|
||||||
altIcons[key] = {
|
|
||||||
CFBundleIconFiles: [
|
|
||||||
// Must be a file path relative to the source root (not a icon set it seems).
|
|
||||||
// i.e. `Bacon-Icon-60x60` when the image is `ios/somn/appIcons/[email protected]`
|
|
||||||
getIconName(key, size),
|
|
||||||
],
|
|
||||||
UIPrerenderedIcon: !!icon.prerendered,
|
|
||||||
};
|
|
||||||
});
|
|
||||||
function applyToPlist(key) {
|
|
||||||
if (typeof config.modResults[key] !== "object" ||
|
|
||||||
Array.isArray(config.modResults[key]) ||
|
|
||||||
!config.modResults[key]) {
|
|
||||||
config.modResults[key] = {};
|
|
||||||
}
|
|
||||||
// @ts-expect-error
|
|
||||||
config.modResults[key].CFBundleAlternateIcons = altIcons;
|
|
||||||
// @ts-expect-error
|
|
||||||
config.modResults[key].CFBundlePrimaryIcon = {
|
|
||||||
CFBundleIconFiles: ["AppIcon"],
|
|
||||||
};
|
|
||||||
}
|
|
||||||
// Apply for both tablet and phone support
|
|
||||||
applyToPlist("CFBundleIcons");
|
|
||||||
applyToPlist("CFBundleIcons~ipad");
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const withIconImages = (config, props) => {
|
|
||||||
return config_plugins_1.withDangerousMod(config, [
|
|
||||||
"ios",
|
|
||||||
async (config) => {
|
|
||||||
await createIconsAsync(config, props);
|
|
||||||
return config;
|
|
||||||
},
|
|
||||||
]);
|
|
||||||
};
|
|
||||||
async function createIconsAsync(config, { icons }) {
|
|
||||||
const iosRoot = path_1.default.join(config.modRequest.platformProjectRoot, config.modRequest.projectName);
|
|
||||||
// Delete all existing assets
|
|
||||||
await fs_1.default.promises
|
|
||||||
.rmdir(path_1.default.join(iosRoot, folderName), { recursive: true })
|
|
||||||
.catch(() => null);
|
|
||||||
// Ensure directory exists
|
|
||||||
await fs_1.default.promises.mkdir(path_1.default.join(iosRoot, folderName), { recursive: true });
|
|
||||||
// Generate new assets
|
|
||||||
await iterateIconsAsync({ icons }, async (key, icon) => {
|
|
||||||
for (const scale of scales) {
|
|
||||||
const iconFileName = getIconName(key, size, scale);
|
|
||||||
const fileName = path_1.default.join(folderName, iconFileName);
|
|
||||||
const outputPath = path_1.default.join(iosRoot, fileName);
|
|
||||||
const scaledSize = scale * size;
|
|
||||||
const { source } = await image_utils_1.generateImageAsync({
|
|
||||||
projectRoot: config.modRequest.projectRoot,
|
|
||||||
cacheType: "react-native-dynamic-app-icon",
|
|
||||||
}, {
|
|
||||||
name: iconFileName,
|
|
||||||
src: icon.image,
|
|
||||||
removeTransparency: true,
|
|
||||||
backgroundColor: "#ffffff",
|
|
||||||
resizeMode: "cover",
|
|
||||||
width: scaledSize,
|
|
||||||
height: scaledSize,
|
|
||||||
});
|
|
||||||
await fs_1.default.promises.writeFile(outputPath, source);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
async function iterateIconsAsync({ icons }, callback) {
|
|
||||||
const entries = Object.entries(icons);
|
|
||||||
for (let i = 0; i < entries.length; i++) {
|
|
||||||
const [key, val] = entries[i];
|
|
||||||
await callback(key, val, i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
exports.default = withDynamicIcon;
|
|
||||||
//# sourceMappingURL=index.js.map
|
|
||||||
@@ -1 +0,0 @@
|
|||||||
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"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 truncated
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@config-plugins/react-native-dynamic-app-icon",
|
"name": "@config-plugins/react-native-dynamic-app-icon",
|
||||||
"version": "0.0.2",
|
"version": "1.0.1",
|
||||||
"description": "Config plugin to auto configure react-native-dynamic-app-icon",
|
"description": "Config plugin to auto configure react-native-dynamic-app-icon",
|
||||||
"main": "build/index.js",
|
"main": "build/index.js",
|
||||||
"types": "build/index.d.ts",
|
"types": "build/index.d.ts",
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
### @config-plugins/react-native-google-cast [1.0.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Continuous Integration
|
||||||
|
|
||||||
|
* fix versions [skip ci] ([#53](https://github.com/expo/config-plugins/issues/53)) ([5de4ae3](https://github.com/expo/config-plugins/commit/5de4ae3e6182c32b7aa24d70ccd23a11663bb089))
|
||||||
|
|
||||||
|
## @config-plugins/react-native-google-cast 1.0.0 (2022-03-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* upgrade @expo/config-plugins ([#49](https://github.com/expo/config-plugins/issues/49)) ([119e31e](https://github.com/expo/config-plugins/commit/119e31edf110409272ace750f02d651124e1a22d))
|
||||||
-11
@@ -1,11 +0,0 @@
|
|||||||
import { ConfigPlugin } from "@expo/config-plugins";
|
|
||||||
export declare const withAndroidGoogleCast: ConfigPlugin<{
|
|
||||||
/**
|
|
||||||
* @default '+'
|
|
||||||
*/
|
|
||||||
androidPlayServicesCastFrameworkVersion?: string;
|
|
||||||
/**
|
|
||||||
* ??
|
|
||||||
*/
|
|
||||||
receiverAppId?: string;
|
|
||||||
}>;
|
|
||||||
-151
@@ -1,151 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.withAndroidGoogleCast = void 0;
|
|
||||||
const config_plugins_1 = require("@expo/config-plugins");
|
|
||||||
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
|
||||||
const codeMod_1 = require("@expo/config-plugins/build/android/codeMod");
|
|
||||||
const { addMetaDataItemToMainApplication, getMainApplicationOrThrow } = config_plugins_1.AndroidConfig.Manifest;
|
|
||||||
const META_PROVIDER_CLASS = "com.google.android.gms.cast.framework.OPTIONS_PROVIDER_CLASS_NAME";
|
|
||||||
const META_RECEIVER_APP_ID = "com.reactnative.googlecast.RECEIVER_APPLICATION_ID";
|
|
||||||
const CUSTOM_ACTIVITY = "com.reactnative.googlecast.RNGCExpandedControllerActivity";
|
|
||||||
async function ensureCustomActivityAsync({ mainApplication, }) {
|
|
||||||
if (Array.isArray(mainApplication.activity)) {
|
|
||||||
// Remove all activities matching the custom name
|
|
||||||
mainApplication.activity = mainApplication.activity.filter((activity) => {
|
|
||||||
var _a;
|
|
||||||
return ((_a = activity.$) === null || _a === void 0 ? void 0 : _a["android:name"]) !== CUSTOM_ACTIVITY;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
mainApplication.activity = [];
|
|
||||||
}
|
|
||||||
// `<activity android:name="${CUSTOM_ACTIVITY}" />`
|
|
||||||
mainApplication.activity.push({
|
|
||||||
$: {
|
|
||||||
"android:name": CUSTOM_ACTIVITY,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
return mainApplication;
|
|
||||||
}
|
|
||||||
const withAndroidManifestCast = (config, { receiverAppId } = {}) => {
|
|
||||||
return config_plugins_1.withAndroidManifest(config, async (config) => {
|
|
||||||
const mainApplication = getMainApplicationOrThrow(config.modResults);
|
|
||||||
ensureCustomActivityAsync({ mainApplication });
|
|
||||||
addMetaDataItemToMainApplication(mainApplication, META_PROVIDER_CLASS,
|
|
||||||
// This is the native Java class
|
|
||||||
"com.reactnative.googlecast.GoogleCastOptionsProvider");
|
|
||||||
if (receiverAppId) {
|
|
||||||
addMetaDataItemToMainApplication(mainApplication, META_RECEIVER_APP_ID, receiverAppId);
|
|
||||||
}
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const withProjectBuildGradleVersion = (config, { version }) => {
|
|
||||||
return config_plugins_1.withProjectBuildGradle(config, (config) => {
|
|
||||||
if (config.modResults.language !== "groovy")
|
|
||||||
throw new Error("react-native-google-cast config plugin does not support Kotlin /build.gradle yet.");
|
|
||||||
config.modResults.contents = addGoogleCastVersionImport(config.modResults.contents, {
|
|
||||||
version,
|
|
||||||
}).contents;
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const withAppBuildGradleImport = (config, { version }) => {
|
|
||||||
return config_plugins_1.withAppBuildGradle(config, (config) => {
|
|
||||||
if (config.modResults.language !== "groovy")
|
|
||||||
throw new Error("react-native-google-cast config plugin does not support Kotlin app/build.gradle yet.");
|
|
||||||
config.modResults.contents = addSafeExtGet(config.modResults.contents);
|
|
||||||
config.modResults.contents = addGoogleCastImport(config.modResults.contents, {
|
|
||||||
version,
|
|
||||||
}).contents;
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const withMainActivityLazyLoading = (config) => {
|
|
||||||
return config_plugins_1.withMainActivity(config, async (config) => {
|
|
||||||
let src = codeMod_1.addImports(config.modResults.contents, ["com.google.android.gms.cast.framework.CastContext"], config.modResults.language === "java");
|
|
||||||
if (config.modResults.language === "java") {
|
|
||||||
config.modResults.contents = addGoogleCastLazyLoadingImport(src).contents;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw new Error("react-native-google-cast config plugin does not support kotlin MainActivity yet.");
|
|
||||||
}
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
// castFrameworkVersion
|
|
||||||
const withAndroidGoogleCast = (config, props) => {
|
|
||||||
var _a, _b;
|
|
||||||
config = withAndroidManifestCast(config, {
|
|
||||||
receiverAppId: props.receiverAppId,
|
|
||||||
});
|
|
||||||
config = withMainActivityLazyLoading(config);
|
|
||||||
config = withProjectBuildGradleVersion(config, {
|
|
||||||
// gradle dep version
|
|
||||||
version: (_a = props.androidPlayServicesCastFrameworkVersion) !== null && _a !== void 0 ? _a : "+",
|
|
||||||
});
|
|
||||||
config = withAppBuildGradleImport(config, {
|
|
||||||
// gradle dep version
|
|
||||||
version: (_b = props.androidPlayServicesCastFrameworkVersion) !== null && _b !== void 0 ? _b : "+",
|
|
||||||
});
|
|
||||||
return config;
|
|
||||||
};
|
|
||||||
exports.withAndroidGoogleCast = withAndroidGoogleCast;
|
|
||||||
function addGoogleCastLazyLoadingImport(src) {
|
|
||||||
const newSrc = [];
|
|
||||||
newSrc.push(" CastContext.getSharedInstance(this);");
|
|
||||||
return generateCode_1.mergeContents({
|
|
||||||
tag: "react-native-google-cast-onCreate",
|
|
||||||
src,
|
|
||||||
newSrc: newSrc.join("\n"),
|
|
||||||
anchor: /super\.onCreate\(\w+\);/,
|
|
||||||
offset: 1,
|
|
||||||
comment: "//",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
// TODO: Add this ability to autolinking
|
|
||||||
// dependencies { implementation "com.google.android.gms:play-services-cast-framework:+" }
|
|
||||||
function addGoogleCastImport(src, { version } = {}) {
|
|
||||||
const newSrc = [];
|
|
||||||
newSrc.push(` implementation "com.google.android.gms:play-services-cast-framework:\${safeExtGet('castFrameworkVersion', '${version}')}"`);
|
|
||||||
return generateCode_1.mergeContents({
|
|
||||||
tag: "react-native-google-cast-dependencies",
|
|
||||||
src,
|
|
||||||
newSrc: newSrc.join("\n"),
|
|
||||||
anchor: /dependencies(?:\s+)?\{/,
|
|
||||||
offset: 1,
|
|
||||||
comment: "//",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
function addSafeExtGet(src) {
|
|
||||||
const tag = "safeExtGet";
|
|
||||||
src = generateCode_1.removeContents({ src, tag }).contents;
|
|
||||||
// If the source already has a safeExtGet method after removing this one, then go with the existing one.
|
|
||||||
if (src.match(/def(?:\s+)?safeExtGet\(/)) {
|
|
||||||
return src;
|
|
||||||
}
|
|
||||||
// Otherwise add a new one
|
|
||||||
const newSrc = [];
|
|
||||||
newSrc.push("def safeExtGet(prop, fallback) {", " rootProject.ext.has(prop) ? rootProject.ext.get(prop) : fallback", "}");
|
|
||||||
return generateCode_1.mergeContents({
|
|
||||||
tag: "safeExtGet",
|
|
||||||
src,
|
|
||||||
newSrc: newSrc.join("\n"),
|
|
||||||
// This block can go anywhere in the upper scope
|
|
||||||
anchor: /apply plugin/,
|
|
||||||
offset: 1,
|
|
||||||
comment: "//",
|
|
||||||
}).contents;
|
|
||||||
}
|
|
||||||
function addGoogleCastVersionImport(src, { version } = {}) {
|
|
||||||
const newSrc = [];
|
|
||||||
newSrc.push(` castFrameworkVersion = "${version}"`);
|
|
||||||
return generateCode_1.mergeContents({
|
|
||||||
tag: "react-native-google-cast-version",
|
|
||||||
src,
|
|
||||||
newSrc: newSrc.join("\n"),
|
|
||||||
anchor: /ext(?:\s+)?\{/,
|
|
||||||
offset: 1,
|
|
||||||
comment: "//",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
-16
@@ -1,16 +0,0 @@
|
|||||||
import { ConfigPlugin } from "@expo/config-plugins";
|
|
||||||
declare const _default: ConfigPlugin<void | {
|
|
||||||
/**
|
|
||||||
* @default '+'
|
|
||||||
*/
|
|
||||||
androidPlayServicesCastFrameworkVersion?: string | undefined;
|
|
||||||
/**
|
|
||||||
* @default 'CC1AD845'
|
|
||||||
*/
|
|
||||||
iosReceiverAppId?: string | undefined;
|
|
||||||
/**
|
|
||||||
* ??
|
|
||||||
*/
|
|
||||||
androidReceiverAppId?: string | undefined;
|
|
||||||
}>;
|
|
||||||
export default _default;
|
|
||||||
-20
@@ -1,20 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const config_plugins_1 = require("@expo/config-plugins");
|
|
||||||
const withAndroidGoogleCast_1 = require("./withAndroidGoogleCast");
|
|
||||||
const withIosGoogleCast_1 = require("./withIosGoogleCast");
|
|
||||||
const withGoogleCast = (config, _props) => {
|
|
||||||
const props = _props || {};
|
|
||||||
// TODO: Are the Android and iOS receiverAppId values the same?
|
|
||||||
config = withIosGoogleCast_1.withIosGoogleCast(config, {
|
|
||||||
receiverAppId: props.iosReceiverAppId,
|
|
||||||
// disableDiscoveryAutostart?: boolean;
|
|
||||||
// startDiscoveryAfterFirstTapOnCastButton?: boolean;
|
|
||||||
});
|
|
||||||
config = withAndroidGoogleCast_1.withAndroidGoogleCast(config, {
|
|
||||||
receiverAppId: props.androidReceiverAppId,
|
|
||||||
androidPlayServicesCastFrameworkVersion: props.androidPlayServicesCastFrameworkVersion,
|
|
||||||
});
|
|
||||||
return config;
|
|
||||||
};
|
|
||||||
exports.default = config_plugins_1.createRunOncePlugin(withGoogleCast, "react-native-google-cast");
|
|
||||||
-15
@@ -1,15 +0,0 @@
|
|||||||
import { ConfigPlugin } from "@expo/config-plugins";
|
|
||||||
export declare const withIosGoogleCast: ConfigPlugin<{
|
|
||||||
/**
|
|
||||||
* @default 'CC1AD845'
|
|
||||||
*/
|
|
||||||
receiverAppId?: string;
|
|
||||||
}>;
|
|
||||||
export declare const MATCH_INIT: RegExp;
|
|
||||||
declare type IosProps = {
|
|
||||||
receiverAppId?: string | null;
|
|
||||||
disableDiscoveryAutostart?: boolean;
|
|
||||||
startDiscoveryAfterFirstTapOnCastButton?: boolean;
|
|
||||||
};
|
|
||||||
export declare function addGoogleCastAppDelegateDidFinishLaunchingWithOptions(src: string, { receiverAppId, disableDiscoveryAutostart, startDiscoveryAfterFirstTapOnCastButton, }?: IosProps): import("@expo/config-plugins/build/utils/generateCode").MergeResults;
|
|
||||||
export {};
|
|
||||||
-124
@@ -1,124 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.addGoogleCastAppDelegateDidFinishLaunchingWithOptions = exports.MATCH_INIT = exports.withIosGoogleCast = void 0;
|
|
||||||
const config_plugins_1 = require("@expo/config-plugins");
|
|
||||||
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
|
||||||
/**
|
|
||||||
* In Xcode, go to Signing & Capabilities, click + Capability and select Access WiFi Information. (This is required since iOS 12.)
|
|
||||||
* Note that "Wireless Accessory Configuration" is unrelated.
|
|
||||||
*
|
|
||||||
* @param {*} config
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
const withIosWifiEntitlements = (config) => {
|
|
||||||
return config_plugins_1.withEntitlementsPlist(config, (config) => {
|
|
||||||
config.modResults["com.apple.developer.networking.wifi-info"] = true;
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const LOCAL_NETWORK_USAGE = "${PRODUCT_NAME} uses the local network to discover Cast-enabled devices on your WiFi network";
|
|
||||||
const BLUETOOTH_ALWAYS_USAGE = "${PRODUCT_NAME} uses Bluetooth to discover nearby Cast devices";
|
|
||||||
const BLUETOOTH_PERIPHERAL_USAGE = "${PRODUCT_NAME} uses Bluetooth to discover nearby Cast devices";
|
|
||||||
const MICROPHONE_USAGE = "${PRODUCT_NAME} uses microphone access to listen for ultrasonic tokens when pairing with nearby Cast devices";
|
|
||||||
/**
|
|
||||||
* On iOS, a dialog asking the user for the local network permission will now be displayed immediately when the app is opened.
|
|
||||||
*
|
|
||||||
* @param {*} config
|
|
||||||
* @param {*} props.receiverAppId If using a custom receiver, make sure to replace `CC1AD845` with your custom receiver app id.
|
|
||||||
* @returns
|
|
||||||
*/
|
|
||||||
const withIosLocalNetworkPermissions = (config, { receiverAppId = "CC1AD845" } = {}) => {
|
|
||||||
return config_plugins_1.withInfoPlist(config, (config) => {
|
|
||||||
if (!Array.isArray(config.modResults.NSBonjourServices)) {
|
|
||||||
config.modResults.NSBonjourServices = [];
|
|
||||||
}
|
|
||||||
// Add required values
|
|
||||||
config.modResults.NSBonjourServices.push("_googlecast._tcp", `_${receiverAppId}._googlecast._tcp`);
|
|
||||||
// Remove duplicates
|
|
||||||
config.modResults.NSBonjourServices = [
|
|
||||||
...new Set(config.modResults.NSBonjourServices),
|
|
||||||
];
|
|
||||||
// For iOS 14+, you need to add local network permissions to Info.plist:
|
|
||||||
// https://developers.google.com/cast/docs/ios_sender/ios_permissions_changes#updating_your_app_on_ios_14
|
|
||||||
config.modResults.NSLocalNetworkUsageDescription =
|
|
||||||
config.modResults.NSLocalNetworkUsageDescription || LOCAL_NETWORK_USAGE;
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const withIosGuestMode = (config) => {
|
|
||||||
return config_plugins_1.withInfoPlist(config, (config) => {
|
|
||||||
config.modResults.NSBluetoothAlwaysUsageDescription =
|
|
||||||
config.modResults.NSBluetoothAlwaysUsageDescription ||
|
|
||||||
BLUETOOTH_ALWAYS_USAGE;
|
|
||||||
config.modResults.NSBluetoothPeripheralUsageDescription =
|
|
||||||
config.modResults.NSBluetoothPeripheralUsageDescription ||
|
|
||||||
BLUETOOTH_PERIPHERAL_USAGE;
|
|
||||||
config.modResults.NSMicrophoneUsageDescription =
|
|
||||||
config.modResults.NSMicrophoneUsageDescription || MICROPHONE_USAGE;
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
// TODO: Use AppDelegate swizzling
|
|
||||||
const withIosAppDelegateLoaded = (config, props) => {
|
|
||||||
return config_plugins_1.withAppDelegate(config, (config) => {
|
|
||||||
if (config.modResults.language !== "objc") {
|
|
||||||
throw new Error("react-native-google-cast config plugin does not support Swift AppDelegate yet.");
|
|
||||||
}
|
|
||||||
config.modResults.contents =
|
|
||||||
addGoogleCastAppDelegateDidFinishLaunchingWithOptions(config.modResults.contents, props).contents;
|
|
||||||
config.modResults.contents = addGoogleCastAppDelegateImport(config.modResults.contents).contents;
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const withIosGoogleCast = (config, props) => {
|
|
||||||
config = withIosWifiEntitlements(config);
|
|
||||||
config = withIosLocalNetworkPermissions(config, {
|
|
||||||
receiverAppId: props.receiverAppId,
|
|
||||||
});
|
|
||||||
config = withIosAppDelegateLoaded(config, {
|
|
||||||
receiverAppId: props.receiverAppId,
|
|
||||||
// disableDiscoveryAutostart?: boolean;
|
|
||||||
// startDiscoveryAfterFirstTapOnCastButton?: boolean;
|
|
||||||
});
|
|
||||||
// TODO
|
|
||||||
// config = withIosGuestMode(config)
|
|
||||||
return config;
|
|
||||||
};
|
|
||||||
exports.withIosGoogleCast = withIosGoogleCast;
|
|
||||||
// From expo-cli RNMaps setup
|
|
||||||
exports.MATCH_INIT = /(?:(self\.|_)(\w+)\s?=\s?\[\[UMModuleRegistryAdapter alloc\])|(?:RCTBridge\s?\*\s?(\w+)\s?=\s?\[\[RCTBridge alloc\])|(\[self\.reactDelegate createBridgeWithDelegate:self launchOptions:launchOptions\])/g;
|
|
||||||
function addGoogleCastAppDelegateDidFinishLaunchingWithOptions(src, { receiverAppId = null, disableDiscoveryAutostart = false, startDiscoveryAfterFirstTapOnCastButton = true, } = {}) {
|
|
||||||
let newSrc = [];
|
|
||||||
newSrc.push(
|
|
||||||
// For extra safety
|
|
||||||
"#if __has_include(<GoogleCast/GoogleCast.h>)",
|
|
||||||
// TODO: This should probably read safely from a static file like the Info.plist
|
|
||||||
` NSString *receiverAppID = ${receiverAppId
|
|
||||||
? `@"${receiverAppId}"`
|
|
||||||
: "kGCKDefaultMediaReceiverApplicationID"};`, " GCKDiscoveryCriteria *criteria = [[GCKDiscoveryCriteria alloc] initWithApplicationID:receiverAppID];", " GCKCastOptions* options = [[GCKCastOptions alloc] initWithDiscoveryCriteria:criteria];",
|
|
||||||
// TODO: Same as above, read statically
|
|
||||||
// ` options.disableDiscoveryAutostart = ${String(!!disableDiscoveryAutostart)};`,
|
|
||||||
` options.startDiscoveryAfterFirstTapOnCastButton = ${String(!!startDiscoveryAfterFirstTapOnCastButton)};`, " [GCKCastContext setSharedInstanceWithOptions:options];", "#endif");
|
|
||||||
newSrc = newSrc.filter(Boolean);
|
|
||||||
return generateCode_1.mergeContents({
|
|
||||||
tag: "react-native-google-cast-didFinishLaunchingWithOptions",
|
|
||||||
src,
|
|
||||||
newSrc: newSrc.join("\n"),
|
|
||||||
anchor: exports.MATCH_INIT,
|
|
||||||
offset: 0,
|
|
||||||
comment: "//",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
exports.addGoogleCastAppDelegateDidFinishLaunchingWithOptions = addGoogleCastAppDelegateDidFinishLaunchingWithOptions;
|
|
||||||
function addGoogleCastAppDelegateImport(src) {
|
|
||||||
const newSrc = [];
|
|
||||||
newSrc.push("#if __has_include(<GoogleCast/GoogleCast.h>)", "#import <GoogleCast/GoogleCast.h>", "#endif");
|
|
||||||
return generateCode_1.mergeContents({
|
|
||||||
tag: "react-native-google-cast-import",
|
|
||||||
src,
|
|
||||||
newSrc: newSrc.join("\n"),
|
|
||||||
anchor: /#import "AppDelegate\.h"/,
|
|
||||||
offset: 1,
|
|
||||||
comment: "//",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@config-plugins/react-native-google-cast",
|
"name": "@config-plugins/react-native-google-cast",
|
||||||
"version": "0.1.0",
|
"version": "1.0.1",
|
||||||
"description": "Config plugin to auto configure Google Cast on prebuild",
|
"description": "Config plugin to auto configure Google Cast on prebuild",
|
||||||
"main": "build/withGoogleCast.js",
|
"main": "build/withGoogleCast.js",
|
||||||
"types": "build/withGoogleCast.d.ts",
|
"types": "build/withGoogleCast.d.ts",
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
### @config-plugins/react-native-pdf [1.0.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Continuous Integration
|
||||||
|
|
||||||
|
* fix versions [skip ci] ([#53](https://github.com/expo/config-plugins/issues/53)) ([5de4ae3](https://github.com/expo/config-plugins/commit/5de4ae3e6182c32b7aa24d70ccd23a11663bb089))
|
||||||
|
|
||||||
|
## @config-plugins/react-native-pdf 1.0.0 (2022-03-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* upgrade @expo/config-plugins ([#49](https://github.com/expo/config-plugins/issues/49)) ([119e31e](https://github.com/expo/config-plugins/commit/119e31edf110409272ace750f02d651124e1a22d))
|
||||||
-5
@@ -1,5 +0,0 @@
|
|||||||
import { ConfigPlugin } from "@expo/config-plugins";
|
|
||||||
export declare const withAndroidPackagingOptions: ConfigPlugin;
|
|
||||||
export declare function addAndroidPackagingOptions(src: string): import("@expo/config-plugins/build/utils/generateCode").MergeResults;
|
|
||||||
declare const _default: ConfigPlugin<void>;
|
|
||||||
export default _default;
|
|
||||||
-52
@@ -1,52 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.addAndroidPackagingOptions = exports.withAndroidPackagingOptions = void 0;
|
|
||||||
const config_plugins_1 = require("@expo/config-plugins");
|
|
||||||
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
|
||||||
let pkg = {
|
|
||||||
name: "react-native-pdf",
|
|
||||||
};
|
|
||||||
try {
|
|
||||||
pkg = require("react-native-pdf/package.json");
|
|
||||||
}
|
|
||||||
catch (_a) {
|
|
||||||
// empty catch block
|
|
||||||
}
|
|
||||||
const withAndroidPackagingOptions = (config) => {
|
|
||||||
return config_plugins_1.withAppBuildGradle(config, (config) => {
|
|
||||||
if (config.modResults.language === "groovy") {
|
|
||||||
config.modResults.contents = addAndroidPackagingOptions(config.modResults.contents).contents;
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
config_plugins_1.WarningAggregator.addWarningAndroid("@config-plugins/react-native-pdf", `Cannot automatically configure app build.gradle if it's not groovy`);
|
|
||||||
}
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
exports.withAndroidPackagingOptions = withAndroidPackagingOptions;
|
|
||||||
function addAndroidPackagingOptions(src) {
|
|
||||||
return generateCode_1.mergeContents({
|
|
||||||
tag: "react-native-pdf-packaging-options",
|
|
||||||
src,
|
|
||||||
newSrc: packagingOptionsContents,
|
|
||||||
anchor: /android(?:\s+)?\{/,
|
|
||||||
// Inside the android block.
|
|
||||||
offset: 1,
|
|
||||||
comment: "//",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
exports.addAndroidPackagingOptions = addAndroidPackagingOptions;
|
|
||||||
const packagingOptionsContents = `
|
|
||||||
packagingOptions {
|
|
||||||
pickFirst 'lib/x86/libc++_shared.so'
|
|
||||||
pickFirst 'lib/x86_64/libjsc.so'
|
|
||||||
pickFirst 'lib/arm64-v8a/libjsc.so'
|
|
||||||
pickFirst 'lib/arm64-v8a/libc++_shared.so'
|
|
||||||
pickFirst 'lib/x86_64/libc++_shared.so'
|
|
||||||
pickFirst 'lib/armeabi-v7a/libc++_shared.so'
|
|
||||||
}
|
|
||||||
`;
|
|
||||||
const withReactNativePdf = (config) => {
|
|
||||||
return exports.withAndroidPackagingOptions(config);
|
|
||||||
};
|
|
||||||
exports.default = config_plugins_1.createRunOncePlugin(withReactNativePdf, pkg.name, pkg.version);
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@config-plugins/react-native-pdf",
|
"name": "@config-plugins/react-native-pdf",
|
||||||
"version": "0.0.0",
|
"version": "1.0.1",
|
||||||
"description": "Config plugin to auto configure react-native-pdf on prebuild",
|
"description": "Config plugin to auto configure react-native-pdf on prebuild",
|
||||||
"main": "build/withPdf.js",
|
"main": "build/withPdf.js",
|
||||||
"types": "build/withPdf.d.ts",
|
"types": "build/withPdf.d.ts",
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
### @config-plugins/react-native-quick-actions [1.0.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Continuous Integration
|
||||||
|
|
||||||
|
* fix versions [skip ci] ([#53](https://github.com/expo/config-plugins/issues/53)) ([5de4ae3](https://github.com/expo/config-plugins/commit/5de4ae3e6182c32b7aa24d70ccd23a11663bb089))
|
||||||
|
|
||||||
|
## @config-plugins/react-native-quick-actions 1.0.0 (2022-03-15)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* upgrade @expo/config-plugins ([#49](https://github.com/expo/config-plugins/issues/49)) ([119e31e](https://github.com/expo/config-plugins/commit/119e31edf110409272ace750f02d651124e1a22d))
|
||||||
-20
@@ -1,20 +0,0 @@
|
|||||||
import { ConfigPlugin, XML } from "@expo/config-plugins";
|
|
||||||
import { MergeResults } from "@expo/config-plugins/build/utils/generateCode";
|
|
||||||
export declare function addQuickActionsAppDelegateImport(src: string): MergeResults;
|
|
||||||
export declare function addQuickActionsAppDelegateInit(src: string): MergeResults;
|
|
||||||
declare const _default: ConfigPlugin<void | {
|
|
||||||
iconType?: string | undefined;
|
|
||||||
title: string;
|
|
||||||
iconSymbolName?: string | undefined;
|
|
||||||
iconFile?: string | undefined;
|
|
||||||
subtitle?: string | undefined;
|
|
||||||
/**
|
|
||||||
* A unique string that the system passes to your app
|
|
||||||
*/
|
|
||||||
type: string;
|
|
||||||
/**
|
|
||||||
* An optional, app-defined dictionary. One use for this dictionary is to provide app version information, as described in the “App Launch and App Update Considerations for Quick Actions” section of the overview in UIApplicationShortcutItem Class Reference.
|
|
||||||
*/
|
|
||||||
userInfo?: XML.XMLObject | undefined;
|
|
||||||
}[]>;
|
|
||||||
export default _default;
|
|
||||||
-106
@@ -1,106 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.addQuickActionsAppDelegateInit = exports.addQuickActionsAppDelegateImport = void 0;
|
|
||||||
const config_plugins_1 = require("@expo/config-plugins");
|
|
||||||
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
|
||||||
const remapping = {
|
|
||||||
iconType: "UIApplicationShortcutItemIconType",
|
|
||||||
iconFile: "UIApplicationShortcutItemIconFile",
|
|
||||||
iconSymbolName: "UIApplicationShortcutItemIconSymbolName",
|
|
||||||
title: "UIApplicationShortcutItemTitle",
|
|
||||||
subtitle: "UIApplicationShortcutItemSubtitle",
|
|
||||||
type: "UIApplicationShortcutItemType",
|
|
||||||
userInfo: "UIApplicationShortcutItemUserInfo",
|
|
||||||
};
|
|
||||||
// #import "RNQuickActionManager.h"
|
|
||||||
// https://github.com/jordanbyron/react-native-quick-actions#adding-static-quick-actions---ios-only
|
|
||||||
// https://developer.apple.com/documentation/uikit/menus_and_shortcuts/add_home_screen_quick_actions
|
|
||||||
// TODO: Auto generate images in asset catalogues
|
|
||||||
/**
|
|
||||||
* Apply react-native-quick-actions configuration for Expo SDK 42 projects.
|
|
||||||
*/
|
|
||||||
const withReactNativeQuickActions = (config, _items) => {
|
|
||||||
config = withQuickActionsAppDelegate(config);
|
|
||||||
const items = _items || [];
|
|
||||||
if (!Array.isArray(items) || !items.length) {
|
|
||||||
return config;
|
|
||||||
}
|
|
||||||
return config_plugins_1.withInfoPlist(config, (config) => {
|
|
||||||
config.modResults.UIApplicationShortcutItems = items.map((item) => {
|
|
||||||
const result = {};
|
|
||||||
for (const [key, value] of Object.entries(remapping)) {
|
|
||||||
// @ts-expect-error
|
|
||||||
const itemValue = item[key];
|
|
||||||
if (itemValue) {
|
|
||||||
result[value] = itemValue;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
});
|
|
||||||
for (const index in config.modResults.UIApplicationShortcutItems) {
|
|
||||||
const item = config.modResults.UIApplicationShortcutItems[index];
|
|
||||||
for (const key of Object.keys(item)) {
|
|
||||||
if (!item[key]) {
|
|
||||||
// @ts-expect-error
|
|
||||||
delete config.modResults.UIApplicationShortcutItems[index][key];
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
function addQuickActionsAppDelegateImport(src) {
|
|
||||||
return generateCode_1.mergeContents({
|
|
||||||
tag: "react-native-quick-actions-import",
|
|
||||||
src,
|
|
||||||
newSrc: '#import "RNQuickActionManager.h"',
|
|
||||||
anchor: /#import "AppDelegate\.h"/,
|
|
||||||
offset: 1,
|
|
||||||
comment: "//",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
exports.addQuickActionsAppDelegateImport = addQuickActionsAppDelegateImport;
|
|
||||||
function addQuickActionsAppDelegateInit(src) {
|
|
||||||
const newSrc = [];
|
|
||||||
newSrc.push("- (void)application:(UIApplication *)application performActionForShortcutItem:(UIApplicationShortcutItem *)shortcutItem completionHandler:(void (^)(BOOL succeeded)) completionHandler {", " [RNQuickActionManager onQuickActionPress:shortcutItem completionHandler:completionHandler];", "}");
|
|
||||||
return generateCode_1.mergeContents({
|
|
||||||
tag: "react-native-quick-actions-delegate",
|
|
||||||
src,
|
|
||||||
newSrc: newSrc.join("\n"),
|
|
||||||
anchor: /-\s?\(BOOL\)application:\(UIApplication\s?\*\)application/,
|
|
||||||
offset: 0,
|
|
||||||
comment: "//",
|
|
||||||
});
|
|
||||||
}
|
|
||||||
exports.addQuickActionsAppDelegateInit = addQuickActionsAppDelegateInit;
|
|
||||||
const withQuickActionsAppDelegate = (config) => {
|
|
||||||
return config_plugins_1.withAppDelegate(config, (config) => {
|
|
||||||
if (config.modResults.language === "objc") {
|
|
||||||
try {
|
|
||||||
config.modResults.contents = addQuickActionsAppDelegateImport(config.modResults.contents).contents;
|
|
||||||
config.modResults.contents = addQuickActionsAppDelegateInit(config.modResults.contents).contents;
|
|
||||||
}
|
|
||||||
catch (error) {
|
|
||||||
if (error.code === "ERR_NO_MATCH") {
|
|
||||||
throw new Error(`Cannot add QuickActions to the project's AppDelegate because it's malformed. Please report this with a copy of your project AppDelegate.`);
|
|
||||||
}
|
|
||||||
throw error;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else {
|
|
||||||
throw new Error("Cannot setup QuickActions because the AppDelegate is not Objective C");
|
|
||||||
}
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
const pkg = {
|
|
||||||
// Prevent this plugin from being run more than once.
|
|
||||||
// This pattern enables users to safely migrate off of this
|
|
||||||
// out-of-tree `@config-plugins/react-native-quick-actions` to a future
|
|
||||||
// upstream plugin in `react-native-quick-actions`
|
|
||||||
name: "react-native-quick-actions",
|
|
||||||
// Indicates that this plugin is dangerously linked to a module,
|
|
||||||
// and might not work with the latest version of that module.
|
|
||||||
version: "UNVERSIONED",
|
|
||||||
};
|
|
||||||
exports.default = config_plugins_1.createRunOncePlugin(withReactNativeQuickActions, pkg.name, pkg.version);
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@config-plugins/react-native-quick-actions",
|
"name": "@config-plugins/react-native-quick-actions",
|
||||||
"version": "0.0.1",
|
"version": "1.0.1",
|
||||||
"description": "Config plugin for react-native-quick-actions package",
|
"description": "Config plugin for react-native-quick-actions package",
|
||||||
"main": "build/withReactNativeQuickActions.js",
|
"main": "build/withReactNativeQuickActions.js",
|
||||||
"types": "build/withReactNativeQuickActions.d.ts",
|
"types": "build/withReactNativeQuickActions.d.ts",
|
||||||
|
|||||||
@@ -0,0 +1,15 @@
|
|||||||
|
## @config-plugins/react-native-webrtc [2.1.0](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **react-native-webrtc:** add config mod for Android minSdkVersion 24 ([ff8b167](https://github.com/expo/config-plugins/commit/ff8b1677640a560ca98abd8a83f349b3a1ee9017))
|
||||||
|
|
||||||
|
### @config-plugins/react-native-webrtc [2.0.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-16)
|
||||||
|
|
||||||
|
|
||||||
|
### Continuous Integration
|
||||||
|
|
||||||
|
* fix versions [skip ci] ([#53](https://github.com/expo/config-plugins/issues/53)) ([5de4ae3](https://github.com/expo/config-plugins/commit/5de4ae3e6182c32b7aa24d70ccd23a11663bb089))
|
||||||
|
|
||||||
|
## @config-plugins/react-native-webrtc 2.0.1
|
||||||
@@ -59,7 +59,10 @@ export default {
|
|||||||
};
|
};
|
||||||
```
|
```
|
||||||
|
|
||||||
This plugin will also disable desugaring in the Android `gradle.properties`: `android.enableDexingArtifactTransform.desugaring=false`, and disable iOS Bitcode for "Release" builds (required).
|
## Important Notes
|
||||||
|
|
||||||
|
- For iOS, this plugin disables Bitcodes for all builds (required).
|
||||||
|
- For Android, this plugin disables desugaring in `gradle.properties`: `android.enableDexingArtifactTransform.desugaring=false` and the [minimum deployment target is changed to `24`](https://github.com/react-native-webrtc/react-native-webrtc/issues/720#issuecomment-552374206) (from `21`) which may break other packages in your app!
|
||||||
|
|
||||||
## Manual Setup
|
## Manual Setup
|
||||||
|
|
||||||
|
|||||||
-2
@@ -1,2 +0,0 @@
|
|||||||
import { ConfigPlugin } from "@expo/config-plugins";
|
|
||||||
export declare const withBitcodeDisabled: ConfigPlugin;
|
|
||||||
-19
@@ -1,19 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.withBitcodeDisabled = void 0;
|
|
||||||
const config_plugins_1 = require("@expo/config-plugins");
|
|
||||||
const withBitcodeDisabled = (config) => {
|
|
||||||
var _a, _b;
|
|
||||||
if (!config.ios) {
|
|
||||||
config.ios = {};
|
|
||||||
}
|
|
||||||
if (((_a = config.ios) === null || _a === void 0 ? void 0 : _a.bitcode) != null && ((_b = config.ios) === null || _b === void 0 ? void 0 : _b.bitcode) !== false) {
|
|
||||||
config_plugins_1.WarningAggregator.addWarningIOS("ios.bitcode", "react-native-webrtc plugin is overwriting project bitcode settings. WebRTC requires bitcode to be disabled for builds, targeting physical iOS devices.");
|
|
||||||
}
|
|
||||||
// WebRTC requires Bitcode be disabled for
|
|
||||||
// production AND development iOS builds that target devices, e.g. not simulators.
|
|
||||||
// SDK +44 property
|
|
||||||
config.ios.bitcode = false;
|
|
||||||
return config;
|
|
||||||
};
|
|
||||||
exports.withBitcodeDisabled = withBitcodeDisabled;
|
|
||||||
-6
@@ -1,6 +0,0 @@
|
|||||||
import { ConfigPlugin } from "@expo/config-plugins";
|
|
||||||
/**
|
|
||||||
* Set the `android.enableDexingArtifactTransform.desugaring` value in the static `gradle.properties` file.
|
|
||||||
* This is used to disable desugaring to fix weird Android bugs. [Learn more](https://github.com/jitsi/jitsi-meet/issues/7911#issuecomment-714323255).
|
|
||||||
*/
|
|
||||||
export declare const withDesugaring: ConfigPlugin<boolean>;
|
|
||||||
-26
@@ -1,26 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.withDesugaring = void 0;
|
|
||||||
const config_plugins_1 = require("@expo/config-plugins");
|
|
||||||
/**
|
|
||||||
* Set the `android.enableDexingArtifactTransform.desugaring` value in the static `gradle.properties` file.
|
|
||||||
* This is used to disable desugaring to fix weird Android bugs. [Learn more](https://github.com/jitsi/jitsi-meet/issues/7911#issuecomment-714323255).
|
|
||||||
*/
|
|
||||||
const withDesugaring = (config, isDisabled) => {
|
|
||||||
const desugaringKey = "android.enableDexingArtifactTransform.desugaring";
|
|
||||||
return config_plugins_1.withGradleProperties(config, (config) => {
|
|
||||||
config.modResults = config.modResults.filter((item) => {
|
|
||||||
if (item.type == "property" && item.key === desugaringKey) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
});
|
|
||||||
config.modResults.push({
|
|
||||||
type: "property",
|
|
||||||
key: desugaringKey,
|
|
||||||
value: String(!isDisabled),
|
|
||||||
});
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
exports.withDesugaring = withDesugaring;
|
|
||||||
-6
@@ -1,6 +0,0 @@
|
|||||||
import { ConfigPlugin } from "@expo/config-plugins";
|
|
||||||
export declare type IOSPermissionsProps = {
|
|
||||||
cameraPermission?: string;
|
|
||||||
microphonePermission?: string;
|
|
||||||
};
|
|
||||||
export declare const withPermissions: ConfigPlugin<IOSPermissionsProps | void>;
|
|
||||||
-21
@@ -1,21 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
exports.withPermissions = void 0;
|
|
||||||
const config_plugins_1 = require("@expo/config-plugins");
|
|
||||||
const CAMERA_USAGE = "Allow $(PRODUCT_NAME) to access your camera";
|
|
||||||
const MICROPHONE_USAGE = "Allow $(PRODUCT_NAME) to access your microphone";
|
|
||||||
const withPermissions = (config, props) => {
|
|
||||||
return config_plugins_1.withInfoPlist(config, (config) => {
|
|
||||||
const { cameraPermission, microphonePermission } = props || {};
|
|
||||||
config.modResults.NSCameraUsageDescription =
|
|
||||||
cameraPermission ||
|
|
||||||
config.modResults.NSCameraUsageDescription ||
|
|
||||||
CAMERA_USAGE;
|
|
||||||
config.modResults.NSMicrophoneUsageDescription =
|
|
||||||
microphonePermission ||
|
|
||||||
config.modResults.NSMicrophoneUsageDescription ||
|
|
||||||
MICROPHONE_USAGE;
|
|
||||||
return config;
|
|
||||||
});
|
|
||||||
};
|
|
||||||
exports.withPermissions = withPermissions;
|
|
||||||
-4
@@ -1,4 +0,0 @@
|
|||||||
import { ConfigPlugin } from "@expo/config-plugins";
|
|
||||||
import { IOSPermissionsProps } from "./withPermissions";
|
|
||||||
declare const _default: ConfigPlugin<void | IOSPermissionsProps>;
|
|
||||||
export default _default;
|
|
||||||
-27
@@ -1,27 +0,0 @@
|
|||||||
"use strict";
|
|
||||||
Object.defineProperty(exports, "__esModule", { value: true });
|
|
||||||
const config_plugins_1 = require("@expo/config-plugins");
|
|
||||||
const withBitcodeDisabled_1 = require("./withBitcodeDisabled");
|
|
||||||
const withDesugaring_1 = require("./withDesugaring");
|
|
||||||
const withPermissions_1 = require("./withPermissions");
|
|
||||||
const pkg = { name: "react-native-webrtc", version: "UNVERSIONED" }; //require("react-native-webrtc/package.json");
|
|
||||||
const withWebRTC = (config, props = {}) => {
|
|
||||||
const _props = props || {};
|
|
||||||
// iOS
|
|
||||||
config = withPermissions_1.withPermissions(config, _props);
|
|
||||||
config = withBitcodeDisabled_1.withBitcodeDisabled(config);
|
|
||||||
// Android
|
|
||||||
config = config_plugins_1.AndroidConfig.Permissions.withPermissions(config, [
|
|
||||||
"android.permission.ACCESS_NETWORK_STATE",
|
|
||||||
"android.permission.BLUETOOTH",
|
|
||||||
"android.permission.CAMERA",
|
|
||||||
"android.permission.INTERNET",
|
|
||||||
"android.permission.MODIFY_AUDIO_SETTINGS",
|
|
||||||
"android.permission.RECORD_AUDIO",
|
|
||||||
"android.permission.SYSTEM_ALERT_WINDOW",
|
|
||||||
"android.permission.WAKE_LOCK",
|
|
||||||
]);
|
|
||||||
config = withDesugaring_1.withDesugaring(config, true);
|
|
||||||
return config;
|
|
||||||
};
|
|
||||||
exports.default = config_plugins_1.createRunOncePlugin(withWebRTC, pkg.name, pkg.version);
|
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@config-plugins/react-native-webrtc",
|
"name": "@config-plugins/react-native-webrtc",
|
||||||
"version": "2.0.1",
|
"version": "2.1.0",
|
||||||
"description": "Config plugin to setup react-native-webrtc on prebuild",
|
"description": "Config plugin to setup react-native-webrtc on prebuild",
|
||||||
"main": "build/withWebRTC.js",
|
"main": "build/withWebRTC.js",
|
||||||
"types": "build/withWebRTC.d.ts",
|
"types": "build/withWebRTC.d.ts",
|
||||||
|
|||||||
@@ -31,7 +31,12 @@ const withWebRTC: ConfigPlugin<IOSPermissionsProps | void> = (
|
|||||||
"android.permission.SYSTEM_ALERT_WINDOW",
|
"android.permission.SYSTEM_ALERT_WINDOW",
|
||||||
"android.permission.WAKE_LOCK",
|
"android.permission.WAKE_LOCK",
|
||||||
]);
|
]);
|
||||||
|
config = AndroidConfig.Version.withBuildScriptExtMinimumVersion(config,
|
||||||
|
{
|
||||||
|
name: "minSdkVersion",
|
||||||
|
minVersion: 24,
|
||||||
|
}
|
||||||
|
)
|
||||||
config = withDesugaring(config, true);
|
config = withDesugaring(config, true);
|
||||||
|
|
||||||
return config;
|
return config;
|
||||||
|
|||||||
Reference in new issue
Block a user