npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

expo-config-plugins

v0.1.2

Published

A collection predefined plugins for use with @expo/config-plugins

Downloads

2,487

Readme

Expo Config Plugins

This project provides a collection of custom Expo config plugins to integrate Google Maps, React Native Firebase, and additional Android permissions (such as usesClearTextTraffic) into an Expo-managed project.

Overview

Expo Config Plugins enable you to customize and extend the native behavior of an Expo project without ejecting. These plugins automatically modify native files during the build process, allowing you to integrate native modules that require additional configurations.

Included Plugins

  1. Google Maps Integration
  2. React Native Firebase Integration
  3. Enabling usesClearTextTraffic (Android)

Setup

To use these plugins in your Expo project, follow the steps below:

1. Install the Required Packages

You need to install Expo config plugins to utilize the custom plugins.

npm install expo-config-plugins

2. Add the Plugins to app.json or app.config.js

In your project's app.json or app.config.js, add the respective plugin configurations:

Google Maps Plugin

{
  "expo": {
    "plugins": [
      [
        "expo-config-plugins/lib/with-google-maps",
        {
          "apiKey": "YOUR_GOOGLE_MAPS_API_KEY"
        }
      ]
    ]
  }
}

Replace YOUR_GOOGLE_MAPS_API_KEY with your actual Google Maps API key.

React Native Firebase Plugin

{
  "expo": {
    "plugins": [
      "expo-config-plugins/lib/with-react-native-firebase"
    ]
  }
}

Android Cleartext Traffic Permission Plugin

{
  "expo": {
    "plugins": [
      "expo-config-plugins/lib/with-uses-cleartext-traffic"
    ]
  }
}

This will allow Android apps to use cleartext network traffic.

3. Usage

Once the plugins are added to your configuration, Expo will automatically apply the necessary changes to the native project files during the build process.

4. Building the App

After setting up the configuration, run the following command to build your app:

eas build -p android|ios

This will generate and modify the native files required for the integrations to work.

Plugin Details

1. Google Maps Integration (with-google-maps)

  • iOS: Adds Google Maps dependencies to the Podfile and updates AppDelegate.mm to configure the API key.
  • Android: Adds the Google Maps API key to the AndroidManifest.xml.

2. React Native Firebase Integration (with-react-native-firebase)

  • iOS: Configures Firebase to be used as a static framework and modifies AppDelegate.mm to initialize Firebase.

Note: The Android configuration for Firebase has been commented out in the code. You can enable it by uncommenting the relevant parts in src/with-react-native-firebase.ts if needed.

3. Android Cleartext Traffic (with-uses-cleartext-traffic)

  • Android: Enables cleartext traffic by setting android:usesCleartextTraffic to true in the AndroidManifest.xml.

Customization

You can modify these plugins to fit your own project needs. Each plugin is located in the src directory:

  • Google Maps: src/with-google-maps.ts
  • React Native Firebase: src/with-react-native-firebase.ts
  • Cleartext Traffic: src/with-uses-cleartext-traffic.ts

If you need to further customize the way the plugins modify native files, you can adjust the mergeContentsAndSaveAsync utility and the plugin logic directly.

License

This project is licensed under the MIT License.