-
Notifications
You must be signed in to change notification settings - Fork 33
Experimental support for CNG and Expo Config Plugins #166
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
f25b722 to
c5e0a0c
Compare
203ea34 to
c8bf0c3
Compare
|
Summary
Experimental support for Continuous Native Generation (CNG) and Expo Config Plugins, based on an approach adopted from RNTA.
Expo Config Plugins are great and the ecosystem is huge. By supporting the patterns already defined by them, most libraries that provide Expo Config Plugins should work out of the box, with the exception of the ones that use dangerous mods (since these depend on specific lines of code that might be different in our templates).
That means that apps will be able to use
app.jsonkeys in the same convention already defined by Expo, as well as thepluginsarray for third-party libraries.What's nice is that this setup doesn't require
expoinstalled and we can use config plugins to modify our own templates, which opens path to CNG and prebuilds.This PR adds 2 new commands:
rock apply-config-plugins: readsapp.jsonkeys and applies both internal Expo Config Plugins as well as third-party libraries (app.config.tsnot yet supported)rock prebuild: deletes and regenerates the native iOS and Android directories, and then applies config pluginsTest plan
In
pluginExpoConfigPlugins.test.ts, we've added tests for most of Expo's default iOS and Android config plugins (e.g.name,ios.bundleIdentifier,android.package, etc) and they work well, but there's still improvements to be made to the test suite in order to guarantee more reliability.The automated test suite uses the new test app at
apps/expo-config-plugins-test-app, copies to a TMP dir, runs the Expo Config Plugins modifiers, and check for the expected changes in the template.To test manually:
pnpm create rock@latest@expo/config-pluginsto sample project dependenciespluginExpoConfigPlugins()to rnef.config.js:app.jsonfile and add propertiesrock prebuildto regen native dirs and apply plugins orrock apply-config-pluginsto apply config plugins directly without regenerating directoriesNote
Add
apps/*topnpm-workspace.yamland introduce TS path mapping for@rock-js/plugin-expo-config-plugins.pnpm-workspace.yamlto includeapps/*.@rock-js/plugin-expo-config-pluginsintsconfig.base.json.Written by Cursor Bugbot for commit 860dfd5. This will update automatically on new commits. Configure here.