@mono-labs/expo
v0.1.276
Published
Expo and CDK utilities for mono-labs
Readme
@mono-labs/expo
Expo and EAS build utilities for Mono. Provides environment variable filtering, Expo config setup, and token replacement for Expo/React Native projects.
Installation
yarn add @mono-labs/expoPeer dependency: expo >= 52 (optional)
API Reference
Config Setup
import { setUpConfig } from "@mono-labs/expo";setUpConfig(config)-- Transforms an Expoapp.jsonconfig into a fully resolvedExpoConfigwith environment variable injection. FiltersNEXT_PUBLIC_*vars, sets up EAS project ID, and configures router settings.
Token Replacement
import { replaceTokens } from "@mono-labs/expo";replaceTokens(input, tokens)-- Replaces${KEY}and$KEYpatterns in a string using the provided tokens object. Data layer values take priority over environment variables.
Environment Filtering
import {
filterUnwantedEnvVars,
filterUnwantedEnvVarsEAS,
generateNewEnvList
} from "@mono-labs/expo";filterUnwantedEnvVars(env)-- Minimal filtering for local development. Removes onlynpm_config_force.filterUnwantedEnvVarsEAS(env)-- Aggressive filtering for EAS cloud builds. Removes 50+ system and developer tool variables (Windows paths, VS Code, Git, Node internals, etc.) to keep the EAS build environment clean.generateNewEnvList(processEnv)-- MapsMONO_*prefixed environment variables to configured prefixes using theenvMapfrom.mono/config.json. Variables containingSECRETin the name are excluded from mapping.
Subpath Exports
| Export | Description |
|--------|-------------|
| @mono-labs/expo | All utilities: replaceTokens, setUpConfig, filterUnwantedEnvVars, filterUnwantedEnvVarsEAS, generateNewEnvList |
| @mono-labs/expo/tools | replaceTokens, setUpConfig |
| @mono-labs/expo/cdk | replaceTokens, setUpConfig |
Development
Build the expo package:
yarn build:expoThis package depends on @mono-labs/project for config loading. Build project first if making changes to both.
See the Contributing guide for full development setup.
