Skip to content

Conversation

tido64
Copy link
Member

@tido64 tido64 commented Aug 2, 2022

Description

Adds support for @expo/config-plugins. Support is currently limited to Android and iOS.

Platforms affected

  • Android
  • iOS
  • macOS
  • Windows

Test plan

First, we need to create a config plugin:

diff --git a/app.plugin.js b/app.plugin.js
new file mode 100644
index 0000000..2a27230
--- /dev/null
+++ b/app.plugin.js
@@ -0,0 +1,8 @@
+const { withInfoPlist } = require("@expo/config-plugins");
+
+module.exports = (config, id) => {
+  return withInfoPlist(config, (config) => {
+    console.log(">>>", config);
+    return config;
+  });
+};

We then need to add it to the example app's config:

diff --git a/example/app.json b/example/app.json
index ef69fa7..ee74be2 100644
--- a/example/app.json
+++ b/example/app.json
@@ -13,6 +13,7 @@
       "presentationStyle": "modal"
     }
   ],
+  "plugins": ["react-native-test-app"],
   "resources": {
     "android": [
       "dist/res",

…and add @expo/config-plugins as a dependency:

diff --git a/example/package.json b/example/package.json
index 790926a..79fffae 100644
--- a/example/package.json
+++ b/example/package.json
@@ -24,6 +24,7 @@
   },
   "devDependencies": {
     "@babel/core": "^7.0.0",
+    "@expo/config-plugins": "^5.0.0",
     "@types/jest": "^27.0.0",
     "jest": "^27.0.0",
     "metro-react-native-babel-preset": "^0.67.0",

Finally, run:

yarn
cd example
pod install --project-directory=ios

…and verify that the content of Info.plist was output, and that tabs were converted to spaces (because @expo/config-plugins wrote to it).

@github-actions github-actions bot added platform: Android This affects Android platform: iOS This affects iOS platform: macOS This affects macOS labels Aug 2, 2022
@tido64 tido64 force-pushed the tido/config-plugins branch from c3ed507 to fcf1ee5 Compare August 2, 2022 22:07
@tido64 tido64 added this to the Single-app Mode milestone Aug 2, 2022
@tido64 tido64 force-pushed the tido/config-plugins branch 7 times, most recently from be81097 to bdac8c4 Compare August 19, 2022 09:07
@tido64 tido64 marked this pull request as ready for review August 19, 2022 09:07
@tido64 tido64 requested review from afoxman and kelset August 19, 2022 09:08
@tido64 tido64 force-pushed the tido/config-plugins branch 3 times, most recently from b95456c to acdf74f Compare August 23, 2022 13:24
@tido64 tido64 force-pushed the tido/config-plugins branch from acdf74f to bca960a Compare September 13, 2022 14:19
Copy link
Contributor

@kelset kelset left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

all tested, all as expected (even the Info.plist part).

:shipit:

@tido64 tido64 force-pushed the tido/config-plugins branch from bca960a to 36df950 Compare October 5, 2022 07:40
@tido64 tido64 force-pushed the tido/config-plugins branch from 36df950 to 1301fd7 Compare October 6, 2022 15:53
@tido64 tido64 merged commit c4f425d into trunk Oct 6, 2022
@tido64 tido64 deleted the tido/config-plugins branch October 6, 2022 16:21
@tido64 tido64 mentioned this pull request Nov 7, 2022
1 task
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
platform: Android This affects Android platform: iOS This affects iOS platform: macOS This affects macOS
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants