Teardown

init

Initialize a new Teardown React Native project.

The init command creates a new Teardown React Native project with all necessary configuration files and folder structure.

Usage

teardown init <name> [options]

Arguments

ArgumentDescription
nameApp name (required)

Options

OptionDescriptionDefault
-f, --forceOverwrite existing filesfalse
--skip-srcSkip generating src folderfalse
--skip-gitSkip generating .gitignorefalse
--skip-installSkip installing dependenciesfalse
-v, --verboseShow detailed outputfalse

Examples

Basic Initialization

teardown init MyApp

Creates a new project with:

  • teardown.config.ts - App configuration
  • src/ folder with routes and components
  • Config files (metro, babel, react-native)
  • .gitignore
  • Dependencies installed

Force Overwrite

teardown init MyApp --force

Overwrites existing files if present.

Skip Steps

# Initialize without installing dependencies
teardown init MyApp --skip-install

# Initialize without src folder
teardown init MyApp --skip-src

# Initialize without .gitignore
teardown init MyApp --skip-git

Generated Files

teardown.config.ts

Main configuration file:

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

export default defineConfig({
  name: "MyApp",
  slug: "myapp",
  version: "1.0.0",
  
  ios: {
    bundleIdentifier: "com.example.myapp",
    buildNumber: 1,
    deploymentTarget: "15.0",
  },
  
  android: {
    packageName: "com.example.myapp",
    versionCode: 1,
    minSdkVersion: 24,
    targetSdkVersion: 34,
  },
  
  plugins: [],
});

src/ Folder Structure

src/
├── _routes/
│   ├── _layout.tsx       # Root layout
│   └── index.tsx         # Home screen
├── app/
│   └── index.tsx         # Router setup
├── components/           # Shared components
├── core/                 # Core utilities
└── providers/
    └── app.provider.tsx  # App providers

Config Files

FilePurpose
metro.config.jsMetro bundler configuration
babel.config.jsBabel transpiler configuration
react-native.config.jsReact Native CLI configuration
GemfileRuby dependencies for CocoaPods
dev-client.config.tsDevelopment client settings

.gitignore

Includes patterns for:

  • ios/ and android/ (generated native code)
  • node_modules/
  • .teardown/ (generated types)
  • Build artifacts
  • Environment files

What's Next

After initialization:

  1. Configure plugins - Add native capabilities in teardown.config.ts
export default defineConfig({
  // ...
  plugins: [
    "camera",
    "location",
  ],
});
  1. Generate native projects
teardown prebuild
  1. Run on device
teardown run ios
# or
teardown run android

Troubleshooting

Config Already Exists

Configuration file already exists

Use --force to overwrite, or manually update the existing config.

Dependencies Failed to Install

If bun install fails, try:

teardown init MyApp --skip-install
cd MyApp
bun install  # or npm install

Existing src/ Folder

The command preserves existing src/ if present. Use --force to overwrite.