mirror of
https://github.com/expo/config-plugins.git
synced 2026-11-14 10:08:06 -10:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
057c6bd978 | ||
|
|
3fbc237fd6 | ||
|
|
6603ab3215 | ||
|
|
9f49f02401 | ||
|
|
14dc560092 | ||
|
|
2dcaff6772 | ||
|
|
68190997b6 | ||
|
|
74f55fc342 | ||
|
|
e32378e8ed | ||
|
|
764a04710b | ||
|
|
837602af36 |
No files matched your search
@@ -23,11 +23,14 @@ Here is a list of known packages that have a built-in Config Plugin.
|
|||||||
- [@stripe/stripe-react-native](https://www.npmjs.com/package/@stripe/stripe-react-native)
|
- [@stripe/stripe-react-native](https://www.npmjs.com/package/@stripe/stripe-react-native)
|
||||||
- [@react-native-voice/voice](https://www.npmjs.com/package/@react-native-voice/voice)
|
- [@react-native-voice/voice](https://www.npmjs.com/package/@react-native-voice/voice)
|
||||||
- [react-native-imglysdk](https://www.npmjs.com/package/react-native-imglysdk)
|
- [react-native-imglysdk](https://www.npmjs.com/package/react-native-imglysdk)
|
||||||
- [@viro-community/react-viro](https://github.com/virocommunity/viro)
|
- [@viro-community/react-viro](https://github.com/virocommunity/viro) -- [Guide](https://viro-community.readme.io/docs/integrating-with-expo)
|
||||||
- [react-native-msal](https://www.npmjs.com/package/react-native-msal)
|
- [react-native-msal](https://www.npmjs.com/package/react-native-msal)
|
||||||
- [react-native-spotlight-search](https://www.npmjs.com/package/react-native-spotlight-search)
|
- [react-native-spotlight-search](https://www.npmjs.com/package/react-native-spotlight-search)
|
||||||
- [newrelic-react-native-agent](https://www.npmjs.com/package/newrelic-react-native-agent)
|
- [newrelic-react-native-agent](https://www.npmjs.com/package/newrelic-react-native-agent)
|
||||||
- [react-native-videoeditorsdk](https://www.npmjs.com/package/react-native-videoeditorsdk)
|
- [react-native-videoeditorsdk](https://www.npmjs.com/package/react-native-videoeditorsdk)
|
||||||
|
- [notifee](https://notifee.app/)
|
||||||
|
- [App Clips](https://github.com/bndkt/react-native-app-clip/)
|
||||||
|
- [iOS Safari Extensions](https://github.com/andrew-levy/react-native-safari-extension/)
|
||||||
|
|
||||||
### Complementary
|
### Complementary
|
||||||
|
|
||||||
@@ -39,9 +42,20 @@ More out-of-tree plugins which can be used to configure more packages.
|
|||||||
- [config-plugin-react-native-intercom](https://www.npmjs.com/package/config-plugin-react-native-intercom) (for use with `intercom-react-native`)
|
- [config-plugin-react-native-intercom](https://www.npmjs.com/package/config-plugin-react-native-intercom) (for use with `intercom-react-native`)
|
||||||
- [@allboatsrise/expo-marketingcloudsdk](https://www.npmjs.com/package/@allboatsrise/expo-marketingcloudsdk) (for use with `react-native-marketingcloudsdk`)
|
- [@allboatsrise/expo-marketingcloudsdk](https://www.npmjs.com/package/@allboatsrise/expo-marketingcloudsdk) (for use with `react-native-marketingcloudsdk`)
|
||||||
- [@ouvio/react-native-background-location-plugin](https://www.npmjs.com/package/@ouvio/react-native-background-location-plugin) (for use with `react-native-background-location-plugin`)
|
- [@ouvio/react-native-background-location-plugin](https://www.npmjs.com/package/@ouvio/react-native-background-location-plugin) (for use with `react-native-background-location-plugin`)
|
||||||
- [with-notifee](https://www.npmjs.com/package/with-notifee) (for use with [notifee](https://notifee.app/))
|
|
||||||
- [expo-community-flipper](https://www.npmjs.com/package/expo-community-flipper) (for use with Flipper)
|
- [expo-community-flipper](https://www.npmjs.com/package/expo-community-flipper) (for use with Flipper)
|
||||||
|
|
||||||
|
### No Plugin Required
|
||||||
|
|
||||||
|
Just install and rebuild! If a package doesn't require any futher setup then it most likely doesn't need an Expo config plugin. Most packages work without a config plugin (including packages not listed below):
|
||||||
|
|
||||||
|
- [react-native-share](https://github.com/react-native-share/react-native-share)
|
||||||
|
- [@react-native-menu/menu](https://github.com/react-native-menu/menu)
|
||||||
|
- [react-native-blurhash](https://github.com/mrousavy/react-native-blurhash)
|
||||||
|
- [react-native-app-shortcuts](https://github.com/lokyoung/react-native-app-shortcuts)
|
||||||
|
- [react-native-multiple-image-picker](https://github.com/baronha/react-native-multiple-image-picker)
|
||||||
|
- [`@shopify/flash-list`](https://github.com/Shopify/flash-list)
|
||||||
|
|
||||||
|
> Feel free to [open a PR](https://github.com/expo/config-plugins/edit/main/README.md) with missing packages.
|
||||||
|
|
||||||
## Contributing!
|
## Contributing!
|
||||||
|
|
||||||
|
|||||||
@@ -1,3 +1,10 @@
|
|||||||
|
### @config-plugins/ios-stickers [2.0.2](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-06-30)
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* **deps-dev:** bump memfs in /packages/ios-stickers ([#83](https://github.com/expo/config-plugins/issues/83)) ([764a047](https://github.com/expo/config-plugins/commit/764a04710bea6e66dbc6d0065812acb1591435fb))
|
||||||
|
|
||||||
### @config-plugins/ios-stickers [2.0.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-05-30)
|
### @config-plugins/ios-stickers [2.0.1](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-05-30)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@config-plugins/ios-stickers",
|
"name": "@config-plugins/ios-stickers",
|
||||||
"version": "2.0.1",
|
"version": "2.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",
|
||||||
@@ -34,6 +34,6 @@
|
|||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"expo-module-scripts": "^2.0.0",
|
"expo-module-scripts": "^2.0.0",
|
||||||
"memfs": "^2.15.5"
|
"memfs": "^3.4.4"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,3 +1,19 @@
|
|||||||
|
## @config-plugins/react-native-callkeep [2.0.0](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-07-25)
|
||||||
|
|
||||||
|
|
||||||
|
### ⚠ BREAKING CHANGES
|
||||||
|
|
||||||
|
* add SDK 45 support (#79)
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* add SDK 45 support ([#79](https://github.com/expo/config-plugins/issues/79)) ([96c72dd](https://github.com/expo/config-plugins/commit/96c72dda469ace2b9eafd38ba4d21f1bcd2e3cdf))
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* publish packages [no-ci] ([0c7b413](https://github.com/expo/config-plugins/commit/0c7b413a765e4b1ff92b9e3edc2b62077c41ce46))
|
||||||
|
|
||||||
### @config-plugins/react-native-callkeep [1.0.3](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
|
### @config-plugins/react-native-callkeep [1.0.3](https://github.com/expo/config-plugins/compare/@config-plugins/[email protected]...@config-plugins/[email protected]) (2022-03-22)
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
## @config-plugins/react-native-siri-shortcut 1.0.0 (2022-07-12)
|
||||||
|
|
||||||
|
|
||||||
|
### Features
|
||||||
|
|
||||||
|
* **siri-shortcut:** Add config plugin ([#86](https://github.com/expo/config-plugins/issues/86)) ([226b2a6](https://github.com/expo/config-plugins/commit/226b2a6412ad3fe75c98952831fab5a63254d19f))
|
||||||
|
|
||||||
|
|
||||||
|
### Other chores
|
||||||
|
|
||||||
|
* **react-native-siri-shortcut:** add tests ([#88](https://github.com/expo/config-plugins/issues/88)) ([994fadc](https://github.com/expo/config-plugins/commit/994fadc8ddf9ee858f2ccb7d544674f107f7f9ad))
|
||||||
+6
@@ -0,0 +1,6 @@
|
|||||||
|
import { ConfigPlugin } from "@expo/config-plugins";
|
||||||
|
import { MergeResults } from "@expo/config-plugins/build/utils/generateCode";
|
||||||
|
export declare function addSiriShortcutAppDelegateImport(src: string): MergeResults;
|
||||||
|
export declare function addSiriShortcutAppDelegateInit(src: string): MergeResults;
|
||||||
|
declare const _default: ConfigPlugin<void | string[]>;
|
||||||
|
export default _default;
|
||||||
+88
@@ -0,0 +1,88 @@
|
|||||||
|
"use strict";
|
||||||
|
Object.defineProperty(exports, "__esModule", { value: true });
|
||||||
|
exports.addSiriShortcutAppDelegateInit = exports.addSiriShortcutAppDelegateImport = void 0;
|
||||||
|
const config_plugins_1 = require("@expo/config-plugins");
|
||||||
|
const generateCode_1 = require("@expo/config-plugins/build/utils/generateCode");
|
||||||
|
/**
|
||||||
|
* Apply react-native-siri-shortcut configuration for Expo SDK 44 projects.
|
||||||
|
*/
|
||||||
|
const withReactNativeSiriShortcut = (config, activityTypes) => {
|
||||||
|
withSiriShortcutAppDelegate(config);
|
||||||
|
withSiriEntitlements(config);
|
||||||
|
const items = activityTypes || [];
|
||||||
|
if (!Array.isArray(items) || !items.length) {
|
||||||
|
return config;
|
||||||
|
}
|
||||||
|
return withReactNativeSiriShortcutInfoPlist(config, items);
|
||||||
|
};
|
||||||
|
const withReactNativeSiriShortcutInfoPlist = (config, activityTypes) => {
|
||||||
|
return config_plugins_1.withInfoPlist(config, (config) => {
|
||||||
|
config.modResults.NSUserActivityTypes = activityTypes;
|
||||||
|
return config;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
function addSiriShortcutAppDelegateImport(src) {
|
||||||
|
return generateCode_1.mergeContents({
|
||||||
|
tag: "react-native-siri-shortcut",
|
||||||
|
src,
|
||||||
|
newSrc: "#import <RNSiriShortcuts/RNSiriShortcuts.h>",
|
||||||
|
anchor: /#import "AppDelegate\.h"/,
|
||||||
|
offset: 1,
|
||||||
|
comment: "//",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.addSiriShortcutAppDelegateImport = addSiriShortcutAppDelegateImport;
|
||||||
|
function addSiriShortcutAppDelegateInit(src) {
|
||||||
|
return generateCode_1.mergeContents({
|
||||||
|
tag: "react-native-siri-shortcut-delegate",
|
||||||
|
src,
|
||||||
|
newSrc: [
|
||||||
|
" BOOL shortcutResult = [RNSSSiriShortcuts application:application continueUserActivity:userActivity restorationHandler:restorationHandler];",
|
||||||
|
" if (shortcutResult) {",
|
||||||
|
" return [super application:application continueUserActivity:userActivity restorationHandler:restorationHandler] || shortcutResult;",
|
||||||
|
" }",
|
||||||
|
].join("\n"),
|
||||||
|
anchor: / return \[super application:application continueUserActivity:userActivity restorationHandler:restorationHandler\] \|\| result;/,
|
||||||
|
offset: -1,
|
||||||
|
comment: "//",
|
||||||
|
});
|
||||||
|
}
|
||||||
|
exports.addSiriShortcutAppDelegateInit = addSiriShortcutAppDelegateInit;
|
||||||
|
/** Append the siri entitlement on iOS */
|
||||||
|
const withSiriEntitlements = (config) => {
|
||||||
|
return config_plugins_1.withEntitlementsPlist(config, (config) => {
|
||||||
|
config.modResults["com.apple.developer.siri"] = true;
|
||||||
|
return config;
|
||||||
|
});
|
||||||
|
};
|
||||||
|
const withSiriShortcutAppDelegate = (config) => {
|
||||||
|
return config_plugins_1.withAppDelegate(config, (config) => {
|
||||||
|
if (["objc", "objcpp"].includes(config.modResults.language)) {
|
||||||
|
try {
|
||||||
|
config.modResults.contents = addSiriShortcutAppDelegateImport(config.modResults.contents).contents;
|
||||||
|
config.modResults.contents = addSiriShortcutAppDelegateInit(config.modResults.contents).contents;
|
||||||
|
}
|
||||||
|
catch (error) {
|
||||||
|
if (error.code === "ERR_NO_MATCH") {
|
||||||
|
throw new Error(`Cannot add Siri Shortcut 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 Siri Shortcut 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-siri-shortcut` to a future
|
||||||
|
// upstream plugin in `react-native-siri-shortcut`
|
||||||
|
name: "react-native-siri-shortcut",
|
||||||
|
// 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(withReactNativeSiriShortcut, pkg.name, pkg.version);
|
||||||
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "@config-plugins/react-native-siri-shortcut",
|
"name": "@config-plugins/react-native-siri-shortcut",
|
||||||
"version": "0.0.0",
|
"version": "1.0.0",
|
||||||
"description": "Config plugin for react-native-siri-shortcut package",
|
"description": "Config plugin for react-native-siri-shortcut package",
|
||||||
"main": "build/withReactNativeSiriShortcut.js",
|
"main": "build/withReactNativeSiriShortcut.js",
|
||||||
"types": "build/withReactNativeSiriShortcut.d.ts",
|
"types": "build/withReactNativeSiriShortcut.d.ts",
|
||||||
@@ -37,4 +37,4 @@
|
|||||||
"expo-module-scripts": "^2.0.0"
|
"expo-module-scripts": "^2.0.0"
|
||||||
},
|
},
|
||||||
"upstreamPackage": "react-native-siri-shortcut"
|
"upstreamPackage": "react-native-siri-shortcut"
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user