Create Expo Stack (CES)

repository·main·Indexed 25 days ago

https://github.com/roninoss/create-expo-stack

An interactive CLI tool for rapidly scaffolding highly configurable, typesafe Expo applications. It supports a wide range of tech stack options including Expo Router, React Navigation, Nativewind, Unistyles, Supabase, and Firebase. The CLI provides flags for package manager selection (npm, yarn, pnpm, bun), EAS setup, TypeScript path aliases, and state management with Zustand.

Tokens
22.8K
Snippets
44
Records
94
Agent score
82%

What's inside create-expo-stack

  1. Overview of Unistyles

    main

    Unistyles is a cross-platform styling library designed to allow up to 100% style sharing across all platforms. It is built to combine the familiar StyleSheet syntax of React Native with high-performance C++ implementation.

    Key capabilities include:

    • Theme Support: Native support for incorporating theme-based styles into components.
    • Media Queries: Ability to adapt styles based on different breakpoints.
    • Dynamic Functions: Support for dynamic functions within style definitions for increased flexibility.
    • Enhanced Styles: Extends standard React Native styles with superpowers like breakpoints and themes.
  2. Key features of React Navigation

    main

    React Navigation provides a comprehensive set of tools for managing navigation in React Native and web applications:

    • Navigation Components: Includes various navigator types like Stack Navigator, Tab Navigator, and Drawer Navigator to build app structures.
    • Declarative Navigation: Navigation state and structures are defined using React components and props.
    • Navigation Hooks: Functional components can access navigation properties and route information using useNavigation and useRoute.
    • Navigation Events: You can subscribe to lifecycle events such as focus and blur to execute logic when screens enter or leave view.
    • Navigation Middleware: Allows intercepting and modifying navigation actions for advanced control.
    • Cross-Platform Support: Works seamlessly with React Native and provides support for web environments.
  3. What is Nativewind and how does it work?

    main

    Nativewind is a universal styling solution for React Native applications that uses Tailwind CSS as its scripting language. It allows you to share styled components across all React Native platforms (Web, iOS, Android) by automatically selecting the most efficient engine for each:

    • Web: Uses standard CSS StyleSheet.
    • Native: Uses StyleSheet.create via a compatibility layer.

    Key characteristics include build-time processing via the Tailwind CSS compiler for efficiency and a small runtime to handle responsive styles (like orientation or color scheme changes) at high performance.

  4. Configure package manager via CLI

    main
    In versions 2.3.2 and later, the CLI includes a prompt to select your preferred package manager. Additionally, in non-interactive modes (where flags are passed directly), the CLI ensures that the installation process uses the specific packageManager you have selected or provided.
  5. Nativewind v4 best practices in generated templates

    main

    In versions 2.20.0 and later, Nativewind templates have been updated to follow v4 best practices. Key changes in the generated code include:

    • Replacing SafeAreaView with safe area utility classes.
    • Adding SafeAreaProvider at the app root.
    • Using interface and React.FC for component typing.
    • Fixing className concatenation bugs.
  6. Core principles of Create Expo Stack

    main

    CES is guided by three core axioms that shape the developer experience:

    1. Iterate Quickly, At All Costs: The CLI is optimized for speed. For example, project initialization is designed to take less than 10 seconds to ensure developers can focus on interpreting feedback rather than waiting for setup.
    2. You Are Not a Guinea Pig: Experimental features are never forced upon users. Any unstable or experimental experience is explicitly communicated and must be opted into.
    3. Type Safety Isn't Optional: Type safety is treated as a fundamental requirement for productivity in rapid prototyping. The tool is built with modularity and strict type safety as core pillars.
  7. Features of the Nativewind Universal Style System

    main

    Nativewind provides a comprehensive set of styling capabilities that work across platforms:

    • Static & UI State Styles: Supports basic styles as well as pseudo-classes like hover, focus, and active on compatible components.
    • Parent State Styles: Allows children components to be styled automatically based on the pseudo-classes of their parent.
    • Responsive & Device Styles: Includes support for media queries, dynamic units, and styles that adapt to device orientation and color schemes (dark mode).
    • Tailwind Ecosystem: Supports arbitrary classes, custom themes, custom values, and standard Tailwind plugins.
  8. Understand Expo Router features

    main

    Expo Router is a file-based routing library for React Native and web applications, built on top of @react-navigation. It provides a universal navigation experience by leveraging file-system routing concepts common in web development.

    Key features include:

    • File-Based Routing: Navigation is managed by the file structure within the app directory; adding a file automatically creates a route.
    • Native Integration: Uses the @react-navigation suite to ensure platform-optimized navigation on Android, iOS, and web.
    • Shareable Routes: Every screen is automatically deep linkable, allowing users to share specific app content via URLs.
    • Offline-First: Supports offline use through caching and handles native URLs without requiring a network connection.
    • Optimized Performance: Uses lazy-evaluation in production and deferred bundling in development. It also supports Universal Fast Refresh.
    • Unified Structure: Provides a single navigation structure across Android, iOS, and web, while allowing access to platform-specific APIs at the route level.
    • Discoverable Content: Supports build-time static rendering for web and universal linking to native, making content indexable by search engines.
  9. Understand the Astro Project Structure

    main

    Astro projects follow a specific directory convention for routing and assets:

    • src/pages/: Contains .astro or .md files. Each file in this directory is automatically exposed as a route based on its filename.
    • src/components/: A recommended location for storing Astro, React, Vue, Svelte, or Preact components.
    • public/: A directory for static assets (like images) that should be served as-is.
    • package.json: Defines project dependencies and scripts.
    /
    ├── public/
    ├── src/
    │   └── pages/
    │       └── index.astro
    └── package.json
  10. Available Tech Stack options

    main

    The CLI allows you to configure your project with various libraries. While not all templates include every library, the following are supported:

    CategoryLibraries
    NavigationExpo Router (file-based), React Navigation (configuration-based)
    StylingNativewind, Unistyles, or standard StyleSheets
    Authentication/BackendSupabase or Firebase
    Core FrameworksReact Native, Expo, React, TypeScript
    UI & SystemExpo Font, Expo Splash Screen, Expo Status Bar, Expo System UI, Safe Area Context
    Web SupportReact Native Web, Expo Web Browser, Expo Linking