CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-expo-modules-autolinking

Scripts that autolink Expo modules.

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

cli-commands.mddocs/

CLI Commands

Comprehensive command-line interface for discovering, resolving, and configuring Expo modules with support for multiple platforms and output formats.

Common Arguments

All commands support these common autolinking arguments:

interface AutolinkingCommonArguments {
  projectRoot?: string | null;
  searchPaths?: string[] | null;
  exclude?: string[] | null;
  platform?: SupportedPlatform | null;
}

/**
 * Register common autolinking arguments on a command
 * @param command - Commander command instance
 * @returns Command with registered arguments
 */
function registerAutolinkingArguments(command: commander.Command): commander.Command;

Capabilities

Search Command

Search for available Expo modules in specified search paths with optional JSON output.

/**
 * Search for available Expo modules in project or custom search paths
 * @param searchPaths - Optional array of custom search paths
 * @param options - Search configuration options
 */
interface SearchArguments extends AutolinkingCommonArguments {
  json?: boolean | null;
}

// CLI usage: expo-modules-autolinking search [searchPaths...]
// Options: -j, --json           Output results in plain JSON format
//          --platform <platform> Target platform (default: apple)
//          --project-root <path> Project root directory
//          --exclude <packages>  Comma-separated packages to exclude
//          --search-paths <paths> Comma-separated custom search paths

Usage Examples:

# Search for modules using default settings
expo-modules-autolinking search

# Search with JSON output for iOS platform
expo-modules-autolinking search --platform ios --json

# Search in custom paths
expo-modules-autolinking search ./custom-modules ./vendor-modules

# Search excluding specific packages
expo-modules-autolinking search --exclude react-native-vector-icons,react-native-maps

# Search with custom project root
expo-modules-autolinking search --project-root /path/to/project

Resolve Command

Searches for available Expo modules and resolves the results for given platform, including extra dependencies, core features, and configuration.

/**
 * Resolve modules for a specific platform with full dependency analysis
 * @param searchPaths - Optional array of custom search paths
 * @param options - Resolution configuration options
 */
interface ResolveArguments extends AutolinkingCommonArguments {
  json?: boolean | null;
}

// CLI usage: expo-modules-autolinking resolve [searchPaths...]
// Options: -j, --json           Output results in plain JSON format
//          --platform <platform> Target platform (default: apple)
//          --project-root <path> Project root directory
//          --exclude <packages>  Comma-separated packages to exclude
//          --search-paths <paths> Comma-separated custom search paths

// Output includes:
// - modules: Array of resolved ModuleDescriptor objects
// - extraDependencies: Additional build dependencies
// - coreFeatures: Array of core features provided by modules
// - configuration: Platform-specific configuration (if applicable)

Usage Examples:

# Resolve modules for iOS platform
expo-modules-autolinking resolve --platform ios

# Resolve with JSON output for Android
expo-modules-autolinking resolve --platform android --json

# Resolve in custom search paths
expo-modules-autolinking resolve ./custom-modules --exclude react-native-vector-icons

Verify Command

Verifies module installations and checks for duplicate dependencies across the project.

/**
 * Verify module installations for duplicate dependencies
 * @param options - Verification configuration options
 */
interface VerifyArguments extends AutolinkingCommonArguments {
  verbose?: boolean | null;
  json?: boolean | null;
}

// CLI usage: expo-modules-autolinking verify
// Options: -v, --verbose         Output all results instead of just warnings
//          -j, --json           Output results in plain JSON format
//          -p, --platform <platform> Platform to validate ("android", "ios", "both", default: "both")
//          --project-root <path> Project root directory
//          --exclude <packages>  Comma-separated packages to exclude
//          --search-paths <paths> Comma-separated custom search paths

// Output groups dependencies by source:
// - reactNativeProjectConfig: Modules from RN project config
// - searchPaths: Modules found in custom search paths
// - dependencies: Modules found in dependency tree
// - duplicates: Modules with multiple versions detected

Usage Examples:

# Verify all platforms with warnings only
expo-modules-autolinking verify

# Verify iOS platform with verbose output
expo-modules-autolinking verify --platform ios --verbose

# Verify with JSON output for CI/CD integration
expo-modules-autolinking verify --json

# Verify Android platform only
expo-modules-autolinking verify --platform android

Generate Package List Command

Generates a source file listing all packages to link (deprecated for Apple platforms).

/**
 * Generate package list for native platforms
 * @param options - Generation configuration options
 */
interface GeneratePackageListArguments extends AutolinkingCommonArguments {
  target?: string | null;
  namespace?: string | null;
  empty?: boolean | null;
}

// CLI usage: expo-modules-autolinking generate-package-list
// Options: -t, --target <path>    Target file path for generated list
//          -n, --namespace <namespace> Java package namespace (Android)
//          --empty              Generate empty list only
//          --platform <platform> Target platform (default: apple)
//          --project-root <path> Project root directory
//          --exclude <packages>  Comma-separated packages to exclude
//          --search-paths <paths> Comma-separated custom search paths

// Note: This command is deprecated for Apple platforms

Usage Examples:

# Generate package list for Android
expo-modules-autolinking generate-package-list --platform android --target ./MainApplication.java

# Generate with custom namespace
expo-modules-autolinking generate-package-list --platform android --namespace com.myapp --target ./src/main/java/MainApplication.java

# Generate empty list
expo-modules-autolinking generate-package-list --empty

Generate Modules Provider Command

Generates a source file for runtime module provider.

/**
 * Generate modules provider source file
 * @param options - Provider generation configuration options
 */
interface GenerateModulesProviderArguments extends AutolinkingCommonArguments {
  target?: string | null;
  entitlement?: string | null;
  packages?: string[] | null;
}

// CLI usage: expo-modules-autolinking generate-modules-provider
// Options: -t, --target <path>        Target file path for generated provider
//          --entitlement <path>     Apple code signing entitlements file
//          -p, --packages <packages...> Specific packages to include
//          --platform <platform>    Target platform (default: apple)
//          --project-root <path>    Project root directory
//          --exclude <packages>     Comma-separated packages to exclude
//          --search-paths <paths>   Comma-separated custom search paths

Usage Examples:

# Generate modules provider for iOS
expo-modules-autolinking generate-modules-provider --platform ios --target ./ios/MyApp/ExpoModulesProvider.swift

# Generate for specific packages only
expo-modules-autolinking generate-modules-provider --packages expo-camera,expo-location --target ./provider.swift

# Generate with entitlements file
expo-modules-autolinking generate-modules-provider --entitlement ./ios/MyApp/MyApp.entitlements --target ./provider.swift

React Native Config Command

Provides React Native CLI linking compatible configuration.

/**
 * Generate React Native CLI compatible configuration
 * @param options - React Native config generation options
 */
interface ReactNativeConfigArguments extends AutolinkingCommonArguments {
  json?: boolean | null;
  sourceDir?: string | null;
}

// CLI usage: expo-modules-autolinking react-native-config
// Options: -p, --platform <platform> Platform ("android", "ios")
//          --source-dir <sourceDir> Native source directory path
//          -j, --json             JSON output format
//          --project-root <path>  Project root directory
//          --exclude <packages>   Comma-separated packages to exclude
//          --search-paths <paths> Comma-separated custom search paths

Usage Examples:

# Generate React Native config for iOS
expo-modules-autolinking react-native-config --platform ios

# Generate for Android with custom source directory
expo-modules-autolinking react-native-config --platform android --source-dir ./android/app/src/main/java

# Generate with JSON output
expo-modules-autolinking react-native-config --platform ios --json

CLI Implementation

/**
 * Main CLI function that processes command line arguments
 * @param args - Array of command line arguments
 */
function main(args: string[]): Promise<void>;

The CLI is implemented using the Commander.js framework and provides comprehensive error handling, colored output, and extensive help documentation for all commands.

docs

cli-commands.md

dependency-management.md

index.md

module-discovery.md

platform-support.md

react-native-integration.md

tile.json