Compare commits

...
Author SHA1 Message Date
semantic-release-bot 9b22a71343 chore: 1.0.3
### @config-plugins/react-native-google-cast [1.0.3](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-23)

### Other chores

* **react-native-google-cast:** lint fix ([21c4928](https://github.com/expo/config-plugins/commit/21c49280d49a3584863d8338e4b34c508249a595))
2022-03-23 19:03:10 +00:00
evanbacon e49a241243 fix: drop build folders 2022-03-23 13:59:17 -05:00
semantic-release-bot 2e06dcae54 chore: 1.0.3
### @config-plugins/react-native-adjust [1.0.3](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-23)

### Bug Fixes

* upgrade google play-services-analytics to v18.0.1 ([a24ea1d](https://github.com/expo/config-plugins/commit/a24ea1df58e9d0639dc4fa016aae8a4e15d53529))
2022-03-23 17:17:22 +00:00
Yann Pringault a24ea1df58 fix: upgrade google play-services-analytics to v18.0.1 2022-03-23 12:03:11 -05:00
semantic-release-bot 50646306c5 chore: 1.0.4
### @config-plugins/android-jsc-intl [1.0.4](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-23)

### Other chores

* **android-jsc-intl:** lint fix ([5ca4e44](https://github.com/expo/config-plugins/commit/5ca4e44a49ad5c3153b4a2b15acf69db594d76b8))
2022-03-23 05:26:26 +00:00
dependabot[bot] 6fbb2192ad chore(deps): bump @expo/config-types in /packages/react-native-branch (#63)
Bumps [@expo/config-types](https://github.com/expo/expo-cli/tree/HEAD/packages/config-types) from 43.0.1 to 44.0.0.
- [Release notes](https://github.com/expo/expo-cli/releases)
- [Changelog](https://github.com/expo/expo-cli/blob/main/CHANGELOG.md)
- [Commits](https://github.com/expo/expo-cli/commits/HEAD/packages/config-types)

---
updated-dependencies:
- dependency-name: "@expo/config-types"
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <[email protected]>

Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-03-23 00:22:42 -05:00
semantic-release-bot 7c3cda4f79 chore: 1.0.3
### @config-plugins/ios-stickers [1.0.3](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)

### Other chores

* **ios-stickers:** lint fix ([331ecb1](https://github.com/expo/config-plugins/commit/331ecb163f000578bc519ebe94f90d62374095d1))
2022-03-22 22:41:06 +00:00
Evan Bacon a78e569f54 test: add tests for core plugin methods (#64)
* test: add tests for core plugin methods

* Update test.yml
2022-03-22 17:38:19 -05:00
22 changed files with 171 additions and 131 deletions

No files matched your search

+3 -1
View File
@@ -40,6 +40,7 @@ jobs:
ios-stickers,
react-native-ble-plx,
react-native-blob-util,
react-native-branch,
react-native-google-cast,
react-native-pdf,
# react-native-quick-actions,
@@ -58,7 +59,8 @@ jobs:
run: yarn lint --max-warnings 0
working-directory: packages/${{ matrix.package }}
- name: Test ${{ matrix.package }}
run: cd packages/${{ matrix.package }} && yarn test
run: yarn test
working-directory: packages/${{ matrix.package }}
env:
CI: true
EXPO_DEBUG: true
+7
View File
@@ -1,3 +1,10 @@
### @config-plugins/android-jsc-intl [1.0.4](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-23)
### Other chores
* **android-jsc-intl:** lint fix ([5ca4e44](https://github.com/expo/config-plugins/commit/5ca4e44a49ad5c3153b4a2b15acf69db594d76b8))
### @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)
+4 -4
View File
@@ -8,12 +8,12 @@ const config_plugins_1 = require("@expo/config-plugins");
*/
const withAndroidJscIntl = (config) => {
// Return the modified config.
return config_plugins_1.withAppBuildGradle(config, config => {
if (config.modResults.language === 'groovy') {
config.modResults.contents = config.modResults.contents.replace('org.webkit:android-jsc:+', 'org.webkit:android-jsc-intl:+');
return config_plugins_1.withAppBuildGradle(config, (config) => {
if (config.modResults.language === "groovy") {
config.modResults.contents = config.modResults.contents.replace("org.webkit:android-jsc:+", "org.webkit:android-jsc-intl:+");
}
else {
throw new Error('[@expo/config-plugins][withAndroidJscIntl] Cannot enable Intl in Android JSC app gradle because the build.gradle is not groovy.');
throw new Error("[@expo/config-plugins][withAndroidJscIntl] Cannot enable Intl in Android JSC app gradle because the build.gradle is not groovy.");
}
return config;
});
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@config-plugins/android-jsc-intl",
"version": "1.0.3",
"version": "1.0.4",
"description": "Config plugin for android-jsc-intl package",
"main": "build/withAndroidJscIntl.js",
"types": "build/withAndroidJscIntl.d.ts",
+7
View File
@@ -1,3 +1,10 @@
### @config-plugins/ios-stickers [1.0.3](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
### Other chores
* **ios-stickers:** lint fix ([331ecb1](https://github.com/expo/config-plugins/commit/331ecb163f000578bc519ebe94f90d62374095d1))
### @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)
+1 -1
View File
@@ -4,12 +4,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.normalizeStickersProps = void 0;
const path_1 = __importDefault(require("path"));
const schema_utils_1 = require("schema-utils");
const options_json_1 = __importDefault(require("./options.json"));
const withStickerAssets_1 = require("./withStickerAssets");
const withStickerInfoPlist_1 = require("./withStickerInfoPlist");
const withStickerXcodeTarget_1 = require("./withStickerXcodeTarget");
const path_1 = __importDefault(require("path"));
// TODO: Maybe the name is better to use as a prop...
const sizeColumnMap = {
4: "small",
+3 -3
View File
@@ -70,9 +70,9 @@ const pbxTargetDependency = "PBXTargetDependency";
const pbxContainerItemProxy = "PBXContainerItemProxy";
function addStickersTarget(proj, name, bundleId, subfolder) {
// Setup uuid and name of new target
let targetUuid = proj.generateUuid();
let targetType = "app_extension_messages_sticker_pack";
let targetName = name.trim();
const targetUuid = proj.generateUuid();
const targetType = "app_extension_messages_sticker_pack";
const targetName = name.trim();
const bundleName = subfolder.trim().split(" ").join("-");
// Check type against list of allowed target types
if (!targetName) {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@config-plugins/ios-stickers",
"version": "1.0.2",
"version": "1.0.3",
"description": "Config plugin to auto configure iOS iMessage stickers",
"main": "build/withStickerPack.js",
"types": "build/withStickerPack.d.ts",
@@ -1,3 +1,10 @@
### @config-plugins/react-native-adjust [1.0.3](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-23)
### Bug Fixes
* upgrade google play-services-analytics to v18.0.1 ([a24ea1d](https://github.com/expo/config-plugins/commit/a24ea1df58e9d0639dc4fa016aae8a4e15d53529))
### @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)
-5
View File
@@ -1,5 +0,0 @@
import { ConfigPlugin } from "@expo/config-plugins";
declare const _default: ConfigPlugin<void | {
targetAndroid12?: boolean | undefined;
}>;
export default _default;
-92
View File
@@ -1,92 +0,0 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
const config_plugins_1 = require("@expo/config-plugins");
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
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;
});
};
const addAndroidPackagingOptions = (src) => {
return generateCode_1.mergeContents({
tag: "react-native-play-services-analytics",
src,
newSrc: `
implementation 'com.google.android.gms:play-services-analytics:18.0.0'
implementation 'com.android.installreferrer:installreferrer:2.2'
`,
anchor: /dependencies(?:\s+)?\{/,
// Inside the dependencies block.
offset: 1,
comment: "//",
});
};
const withGradle = (config) => {
return config_plugins_1.withAppBuildGradle(config, (config) => {
if (config.modResults.language === "groovy") {
config.modResults.contents = addAndroidPackagingOptions(config.modResults.contents).contents;
}
else {
throw new Error("Cannot add Play Services maven gradle because the project build.gradle is not groovy");
}
return config;
});
};
/**
* Apply react-native-adjust configuration for Expo SDK +44 projects.
*/
const withAdjustPlugin = (config, _props) => {
const props = _props || {};
config = withXcodeLinkBinaryWithLibraries(config, {
library: "iAd.framework",
status: "optional",
});
config = withXcodeLinkBinaryWithLibraries(config, {
library: "AdServices.framework",
status: "optional",
});
config = withXcodeLinkBinaryWithLibraries(config, {
library: "AdSupport.framework",
status: "optional",
});
config = withXcodeLinkBinaryWithLibraries(config, {
library: "StoreKit.framework",
status: "optional",
});
config = withXcodeLinkBinaryWithLibraries(config, {
library: "AppTrackingTransparency.framework",
status: "optional",
});
if (props.targetAndroid12) {
config = config_plugins_1.AndroidConfig.Version.withBuildScriptExtMinimumVersion(config, {
name: "compileSdkVersion",
minVersion: 31,
});
config = config_plugins_1.AndroidConfig.Permissions.withPermissions(config, [
"com.google.android.gms.permission.AD_ID",
]);
}
config = withGradle(config);
// Return the modified config.
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-adjust` to a future
// upstream plugin in `react-native-adjust`
name: "react-native-adjust",
// 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(withAdjustPlugin, pkg.name, pkg.version);
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "@config-plugins/react-native-adjust",
"version": "1.0.2",
"version": "1.0.3",
"description": "Config plugin to auto configure Adjust SDK on prebuild",
"main": "build/withReactNativeAdjust.js",
"types": "build/withReactNativeAdjust.d.ts",
@@ -34,7 +34,7 @@ const addAndroidPackagingOptions = (src: string) => {
tag: "react-native-play-services-analytics",
src,
newSrc: `
implementation 'com.google.android.gms:play-services-analytics:18.0.0'
implementation 'com.google.android.gms:play-services-analytics:18.0.1'
implementation 'com.android.installreferrer:installreferrer:2.2'
`,
anchor: /dependencies(?:\s+)?\{/,
+1 -1
View File
@@ -34,7 +34,7 @@
},
"dependencies": {
"@expo/config-plugins": "^4.1.0",
"@expo/config-types": "^43.0.1"
"@expo/config-types": "^44.0.0"
},
"devDependencies": {
"expo-module-scripts": "^2.0.0"
@@ -0,0 +1,24 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.expo.mycoolapp">
<uses-permission android:name="android.permission.INTERNET" />
<queries>
<!-- Support checking for http(s) links via the Linking API -->
<intent>
<action android:name="android.intent.action.VIEW" />
<category android:name="android.intent.category.BROWSABLE" />
<data android:scheme="https" />
</intent>
</queries>
<application android:name=".MainApplication" android:label="@string/app_name" android:icon="@mipmap/ic_launcher" android:roundIcon="@mipmap/ic_launcher_round" android:allowBackup="true" android:theme="@style/AppTheme">
<activity android:name=".MainActivity" android:launchMode="singleTask" android:label="@string/app_name" android:configChanges="keyboard|keyboardHidden|orientation|screenSize" android:windowSoftInputMode="adjustResize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity android:name="com.facebook.react.devsupport.DevSettingsActivity" />
</application>
</manifest>
@@ -0,0 +1,53 @@
import { AndroidConfig } from "@expo/config-plugins";
import { resolve } from "path";
import { getBranchApiKey, setBranchApiKey } from "../withBranchAndroid";
const { findMetaDataItem, getMainApplication, readAndroidManifestAsync } =
AndroidConfig.Manifest;
const sampleManifestPath = resolve(
__dirname,
"./fixtures",
"react-native-AndroidManifest.xml"
);
describe(getBranchApiKey, () => {
it(`returns null if no android branch api key is provided`, () => {
expect(getBranchApiKey({ android: { config: {} } } as any)).toBe(null);
});
it(`returns apikey if android branch api key is provided`, () => {
expect(
getBranchApiKey({
android: { config: { branch: { apiKey: "MY-API-KEY" } } },
} as any)
).toBe("MY-API-KEY");
});
});
describe(setBranchApiKey, () => {
it("sets branch api key in AndroidManifest.xml if given", async () => {
let androidManifestJson = await readAndroidManifestAsync(
sampleManifestPath
);
androidManifestJson = await setBranchApiKey(
"MY-API-KEY",
androidManifestJson
);
let mainApplication = getMainApplication(androidManifestJson);
expect(
findMetaDataItem(mainApplication, "io.branch.sdk.BranchKey")
).toBeGreaterThan(-1);
// Unset the item
androidManifestJson = await setBranchApiKey(null, androidManifestJson);
mainApplication = getMainApplication(androidManifestJson);
expect(findMetaDataItem(mainApplication, "io.branch.sdk.BranchKey")).toBe(
-1
);
});
});
@@ -0,0 +1,27 @@
import { getBranchApiKey, setBranchApiKey } from "../withBranchIOS";
describe(getBranchApiKey, () => {
it(`returns null if no api key is provided`, () => {
expect(getBranchApiKey({})).toBe(null);
});
it(`returns the api key if provided`, () => {
expect(
getBranchApiKey({ ios: { config: { branch: { apiKey: "123" } } } })
).toBe("123");
});
});
describe(setBranchApiKey, () => {
it(`sets branch_key.live if the api key is given`, () => {
expect(setBranchApiKey("123", {})).toMatchObject({
branch_key: {
live: "123",
},
});
});
it(`makes no changes to the infoPlist no api key is provided`, () => {
expect(setBranchApiKey(null, {})).toMatchObject({});
});
});
@@ -9,7 +9,7 @@ export function getBranchApiKey(config: Pick<ExpoConfig, "ios">) {
}
export function setBranchApiKey(
apiKey: string,
apiKey: string | null,
infoPlist: InfoPlist
): InfoPlist {
if (apiKey === null) {
@@ -1,3 +1,10 @@
### @config-plugins/react-native-google-cast [1.0.3](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-23)
### Other chores
* **react-native-google-cast:** lint fix ([21c4928](https://github.com/expo/config-plugins/commit/21c49280d49a3584863d8338e4b34c508249a595))
### @config-plugins/react-native-google-cast [1.0.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
+2 -2
View File
@@ -2,8 +2,8 @@
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 generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
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";
@@ -63,7 +63,7 @@ const withAppBuildGradleImport = (config, { version }) => {
};
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");
const 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;
}
+19 -16
View File
@@ -17,9 +17,12 @@ const withIosWifiEntitlements = (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";
// 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.
*
@@ -45,19 +48,19 @@ const withIosLocalNetworkPermissions = (config, { receiverAppId = "CC1AD845" } =
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;
});
};
// const withIosGuestMode: ConfigPlugin = (config) => {
// return 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) => {
@@ -1,6 +1,6 @@
{
"name": "@config-plugins/react-native-google-cast",
"version": "1.0.2",
"version": "1.0.3",
"description": "Config plugin to auto configure Google Cast on prebuild",
"main": "build/withGoogleCast.js",
"types": "build/withGoogleCast.d.ts",