Teardown

Configuration

Configure your app with teardown.config.ts.

The teardown.config.ts file is the central configuration for your React Native app. It defines app metadata, platform settings, and plugins.

Basic Structure

import { defineConfig } from "@teardown/cli";

export default defineConfig({
  name: "My App",
  slug: "myapp",
  version: "1.0.0",
  
  ios: { ... },
  android: { ... },
  plugins: [ ... ],
  navigation: { ... },
});

Core Options

OptionTypeRequiredDescription
namestringYesDisplay name of the app
slugstringYesURL-safe identifier (used for deep links)
versionstringYesSemantic version (e.g., "1.0.0")

iOS Configuration

ios: {
  bundleIdentifier: "com.example.myapp",
  buildNumber: 1,
  deploymentTarget: "15.0",
  infoPlist: {
    // Additional Info.plist entries
  },
  entitlements: {
    // App entitlements
  },
  associatedDomains: ["applinks:myapp.com"],
}

iOS Options

OptionTypeDefaultDescription
bundleIdentifierstringRequirediOS bundle ID
buildNumbernumber1Build number for App Store
deploymentTargetstring"15.0"Minimum iOS version
infoPlistobject{}Additional Info.plist entries
entitlementsobject{}App entitlements
associatedDomainsstring[][]Associated domains for universal links
usesAppleSignInbooleanfalseEnable Sign in with Apple
backgroundColorstring-Launch screen background color
iconstring-Path to app icon

Android Configuration

android: {
  packageName: "com.example.myapp",
  versionCode: 1,
  minSdkVersion: 24,
  targetSdkVersion: 34,
  permissions: [
    "INTERNET",
    "CAMERA",
  ],
  intentFilters: [ ... ],
}

Android Options

OptionTypeDefaultDescription
packageNamestringRequiredAndroid package name
versionCodenumber1Version code for Play Store
minSdkVersionnumber24Minimum Android SDK version
targetSdkVersionnumber34Target Android SDK version
compileSdkVersionnumber34Compile SDK version
permissionsstring[][]Android permissions
intentFiltersobject[][]Intent filters for deep links
backgroundColorstring-Splash screen background
iconstring-Path to app icon

Plugins

Add native capabilities:

plugins: [
  // Simple string format
  "camera",
  "location",
  
  // With configuration
  ["camera", {
    cameraPermission: "Take photos for your profile",
  }],
]

See Plugins for all available plugins.

Configure file-based navigation:

navigation: {
  routesDir: "./src/_routes",
  generatedDir: "./.teardown",
  verbose: false,
}
OptionTypeDefaultDescription
routesDirstring"./src/_routes"Route files directory
generatedDirstring"./.teardown"Generated types directory
verbosebooleanfalseVerbose logging

Full Example

import { defineConfig } from "@teardown/cli";

export default defineConfig({
  name: "My Awesome App",
  slug: "myawesomeapp",
  version: "1.2.0",
  
  ios: {
    bundleIdentifier: "com.mycompany.myawesomeapp",
    buildNumber: 12,
    deploymentTarget: "15.0",
    associatedDomains: [
      "applinks:myawesomeapp.com",
      "webcredentials:myawesomeapp.com",
    ],
    infoPlist: {
      ITSAppUsesNonExemptEncryption: false,
    },
  },
  
  android: {
    packageName: "com.mycompany.myawesomeapp",
    versionCode: 12,
    minSdkVersion: 24,
    targetSdkVersion: 34,
    permissions: [
      "INTERNET",
      "ACCESS_NETWORK_STATE",
    ],
    intentFilters: [{
      action: "VIEW",
      autoVerify: true,
      data: [{
        scheme: "https",
        host: "myawesomeapp.com",
        pathPrefix: "/",
      }],
      category: ["BROWSABLE", "DEFAULT"],
    }],
  },
  
  plugins: [
    "camera",
    ["location", {
      locationPermission: "Find nearby features",
      backgroundLocation: false,
    }],
    "push-notifications",
    "biometrics",
    ["firebase", {
      googleServicesFile: "./GoogleService-Info.plist",
      googleServicesJsonFile: "./google-services.json",
    }],
  ],
  
  navigation: {
    routesDir: "./src/_routes",
    generatedDir: "./.teardown",
  },
});

Validation

Validate your configuration:

teardown validate

Shows errors and warnings with suggestions:

Configuration valid!

Summary:
  Name: My Awesome App
  Slug: myawesomeapp
  Version: 1.2.0
  iOS: com.mycompany.myawesomeapp (build 12)
  Android: com.mycompany.myawesomeapp (version code 12)
  Plugins: 5

Environment Variables

Reference environment variables in config:

import { defineConfig } from "@teardown/cli";

export default defineConfig({
  name: "My App",
  slug: "myapp",
  version: process.env.APP_VERSION || "1.0.0",
  
  ios: {
    bundleIdentifier: process.env.IOS_BUNDLE_ID || "com.example.myapp",
  },
});

Config File Formats

The CLI looks for config files in this order:

  1. teardown.config.ts
  2. teardown.config.js
  3. teardown.config.mjs
  4. launchpad.config.ts (legacy)

Type Safety

The defineConfig helper provides full TypeScript intellisense:

import { defineConfig } from "@teardown/cli";

export default defineConfig({
  // Full autocomplete for all options
  // Type errors for invalid values
});